Id
int64
4
8.51M
PostTypeId
int64
1
7
AcceptedAnswerId
int64
7
75.5M
ParentId
int64
4
41.8M
Score
int64
-208
27.7k
ViewCount
int64
11
12.4M
Body
stringlengths
0
45k
Title
stringlengths
2
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
225
CreationDate
stringdate
2008-07-31 21:42:52
2011-12-14 18:48:47
LastActivityDate
stringdate
2008-08-01 12:19:17
2023-03-05 04:40:26
LastEditDate
stringdate
2008-08-01 13:54:25
2023-03-05 03:12:45
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
-1
21.1M
Tags
listlengths
1
6
75,631,040
1
null
null
1
66
There is a possibility to hide some symbols in a shared library if they are not considered to be called from outside. But while the symbols are not required for the client of the library, they may be needed for tests. For example, in my case, I have a library with a small public api and large inner logic. In order to w...
What buildsystem design techniques are there (using CMake) to test functionality that is internal to my shared library?
CC BY-SA 4.0
null
2023-03-03T19:15:25.047
2023-03-04T18:27:58.440
2023-03-04T18:27:58.440
11,107,541
11,669,341
[ "c++", "cmake", "shared-libraries" ]
75,631,042
2
null
418,006
0
null
I'm using the following code to disable the tab page with index 2 and to switch the focus to the tab page index 0. ``` private void tabControl1_Selected(object sender, TabControlEventArgs e) { if( 2 == e.TabPageIndex) tabControl1.SelectedIndex = 0; } ```
null
CC BY-SA 4.0
null
2023-03-03T19:15:32.217
2023-03-03T19:15:32.217
null
null
12,113,436
null
75,631,041
1
null
null
-1
39
I'm attempting to make a call to an outside service. The call seems to go through successfully, but all I get returned is a Promise, and if I access a property, it returns another Promise. Would appreciate another set of eyes to see what I'm doing wrong (I'm a Java developer writing React for the first time). ``` funct...
Promise never resolves - only get another promise
CC BY-SA 4.0
null
2023-03-03T19:15:31.163
2023-03-03T19:33:48.117
null
null
1,660,256
[ "javascript", "typescript", "promise" ]
75,631,039
1
null
null
0
7
Hi I am having a k6 script. The k6 script do a post request . in the post request i am also setting the body and header . however the headers are ignored by k6 and k6 adding a different header value. please see the code ``` import http from 'k6/http'; export const payload = JSON.stringify({ firstField: 'Sample val...
K6 replacing Content-Type header?
CC BY-SA 4.0
null
2023-03-03T19:15:18.113
2023-03-03T19:17:51.760
null
null
14,820,140
[ "k6" ]
75,631,045
2
null
75,630,332
0
null
Maybe you can try this... ``` function onOpen(e) { var ui = SpreadsheetApp.getUi().createMenu("Menu").addItem("fillAColumn", "fillAColumn").addToUi(); } function fillAColumn(){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var value = ss.getActiveCell().getDisplayValue(); for (var i = 2; i <= 10; i++) { ...
null
CC BY-SA 4.0
null
2023-03-03T19:15:45.047
2023-03-03T19:15:45.047
null
null
11,475,597
null
75,631,035
1
null
null
0
11
I am currently calculating the contrast of two foreground colors and a background color to programmatically decide if the foreground color should be white or black. The formula for the contrast ratio is defined as > (L1 + 0.05) / (L2 + 0.05) Where L1 is the relative luminance value of the lighter color and L2 is the re...
Color contrast using relativ luminance, where does the 0.05 come from
CC BY-SA 4.0
null
2023-03-03T19:14:19.300
2023-03-03T19:15:55.003
2023-03-03T19:15:55.003
13,523,921
13,523,921
[ "colors", "wcag", "high-contrast", "luminance" ]
75,631,047
2
null
75,630,634
0
null
I had to translate the error you got, but 'The cloud file provider is not running' means that you have OneDrive or something like that setup in File On Demand mode, which means that the local files don't actually exist and are just representative of a file in your cloud storage. You can turn off the File On Demand feat...
null
CC BY-SA 4.0
null
2023-03-03T19:16:09.667
2023-03-03T19:16:09.667
null
null
3,245,749
null
75,631,044
2
null
309,424
0
null
I see a lot of just snippets but zero explanations as to WHY this the snippet is a good way. I'm going to limit myself to just plain Java. What's key to understand about Java is `java.io.InputStream` are for reading bytes. `java.io.Reader` is for reading character data. You should NOT be reading InputStream and con...
null
CC BY-SA 4.0
null
2023-03-03T19:15:44.357
2023-03-03T19:15:44.357
null
null
155,020
null
75,631,046
2
null
75,630,235
1
null
I don't know why this works exactly, but could you try changing: ``` document.getElementById("sun").transform.fill('yellow'); ``` to ``` document.getElementById("sun").querySelector("circle").style.fill = 'yellow'; ``` (and do the same for the lightgrey version). For anyone who wants to try this in the browser here's...
null
CC BY-SA 4.0
null
2023-03-03T19:16:03.180
2023-03-03T19:16:03.180
null
null
14,454,939
null
75,631,048
1
null
null
-1
3
hi I don't know why I get this error [enter image description here](https://i.stack.imgur.com/2jsCs.png) IDK
DiscordAPIError: Interaction has already been acknowledged. unhandledRejection
CC BY-SA 4.0
null
2023-03-03T19:16:12.340
2023-03-03T19:16:12.340
null
null
21,328,154
[ "node.js", "discord", "discord-buttons" ]
75,631,050
2
null
75,622,948
0
null
It looks like there is a typo with how you are generating the postedBy reference.
null
CC BY-SA 4.0
null
2023-03-03T19:16:24.630
2023-03-03T19:16:24.630
null
null
10,106,418
null
75,631,049
2
null
14,382,579
0
null
You can add `using module ..\path\to\module` on the top of any PowerShell script file. The path is always relative to the script you put the [using statement](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_using) in. > Always use backslashes as the path separator. Even in Lin...
null
CC BY-SA 4.0
null
2023-03-03T19:16:18.847
2023-03-03T19:16:18.847
null
null
611,056
null
75,631,032
1
null
null
0
8
For a class, im working on a Wordle clone. The last kink in my program is that when ever there is a correct letter in its place, if that same letter appears in anyother place it will be marked yellow. For example; if the word is "Flame" and I guess "Fluff", The first F in Fluffy will be marked green, but the remaining ...
How do I prevent letters that are in the correct place being marked as yellow in other places in my Wordle Clone
CC BY-SA 4.0
null
2023-03-03T19:13:52.487
2023-03-03T19:13:52.487
null
null
21,328,114
[ "code.org" ]
75,631,053
2
null
75,559,673
0
null
I ended up removing `StoreModule.forFeature('auth', reducers)` from `AuthModule` imports and adding `StoreModule.forRoot<AppState>(reducers)` to `AppModule`. I had to add a `forRoot(): ModuleWithProviders<AuthModule>` definition to `AuthModule`: ``` export class AuthModule { static forRoot(): ModuleWithProviders<Auth...
null
CC BY-SA 4.0
null
2023-03-03T19:16:36.037
2023-03-03T19:16:36.037
null
null
1,742,373
null
75,631,054
1
null
null
0
13
I'm trying to track where the cursor is in my text view as the user types. It works fine until I get to the second line in the text view and then it's giving me infinite for minX and maxX. Here is the code: ``` if let cursorPosition = messageTextView.selectedTextRange?.start { let caretPositionRect = messageTextVie...
UITextView caretRect giving infinite for minX and maxX?
CC BY-SA 4.0
null
2023-03-03T19:16:37.453
2023-03-03T20:27:35.290
2023-03-03T20:27:35.290
20,287,183
18,897,324
[ "ios", "swift", "uitextview" ]
75,631,055
1
null
null
0
29
I am very new to Python. In the add_packages method below, is {package.name] just a variable name for the key? I guess I do not understand where we get package.name from? ``` class Repository: def __init__(self): self.packages = {} def add_package(self, package): self.packages[package.name] = package `...
Where does Package.Name come from?
CC BY-SA 4.0
null
2023-03-03T19:16:48.050
2023-03-03T19:52:25.777
2023-03-03T19:17:59.103
535,275
20,234,268
[ "python" ]
75,631,057
1
null
null
-1
24
how to implement image upload system with node js. How to save image on database I try to useing firebase storage..it is better for image upload system?
how to build image upload system and how to store image in database with node js?
CC BY-SA 4.0
null
2023-03-03T19:16:50.950
2023-03-04T14:32:03.410
2023-03-04T14:32:03.410
20,493,210
18,058,033
[ "javascript", "node.js", "firebase" ]
75,631,061
2
null
75,432,493
0
null
try importing 'validator' instead of 'express-validator.' had the same issue and this worked for me. still don't fully understand the difference between the two since codecademy does a bad job explaining and even confuses them in their own project. edit: oh and you'll have to install validator first!
null
CC BY-SA 4.0
null
2023-03-03T19:17:19.117
2023-03-03T19:28:56.360
2023-03-03T19:28:56.360
21,328,159
21,328,159
null
75,631,052
2
null
75,629,626
0
null
To get VS Code to open a new file on startup (when you don't command it to open a specific folder): ``` "workbench.startupEditor": "newUntitledFile" ``` To change the default language of new files, use the `files.defaultLanguage` setting. If you don't want these settings to be intrusive to your other use-cases for VS ...
null
CC BY-SA 4.0
null
2023-03-03T19:16:28.177
2023-03-03T19:30:56.580
2023-03-03T19:30:56.580
11,107,541
11,107,541
null
75,631,059
2
null
75,630,965
0
null
Have you tried using the `fill` method? ``` var IBM = plotSecond .marker(ibmDataTable) .name('IBM') .fill('blue'); ```
null
CC BY-SA 4.0
null
2023-03-03T19:17:05.243
2023-03-03T19:17:05.243
null
null
154,603
null
75,631,062
2
null
45,925,964
0
null
Install git on wsl Ubuntu ``` sudo apt install git ``` Set email and username ``` git config --global user.email "YOUR_EMAIL" git config --global user.name "YOUR_USERNAME" ``` Install Git credentials manager ``` wget "https://github.com/GitCredentialManager/git-credential-manager/releases/download/v2.0.886/gcm-linux_...
null
CC BY-SA 4.0
null
2023-03-03T19:17:21.503
2023-03-03T19:17:21.503
null
null
5,352,204
null
75,631,043
1
null
null
0
34
I'm creating an automated test suite for my job and currently I can't get it to run past the first line i.e ``` "driver.findElement(By.id("username")).sendKeys("example"); ``` I decided to try google to see if i could make any headway and this is the code i started out with ``` import org.openqa.selenium.By; import or...
I cant get my automation testcase to run past the "first" line
CC BY-SA 4.0
null
2023-03-03T19:15:44.040
2023-03-03T23:24:14.313
null
null
21,328,133
[ "java", "selenium-webdriver", "selenium-chromedriver" ]
75,631,025
1
null
null
0
27
I've been working on my website and changing some CSS-code. When I finally got some divs to be placed correctly my header-div suddenly looked weird. It is supposed to have a logo in full size as a square and my header-div is supposed to have a black box-shadow in the bottom. ![enter image description here](https://i.st...
Why has my box-shadow disappeared and my logo started looking like it does?
CC BY-SA 4.0
null
2023-03-03T19:13:03.657
2023-03-03T19:21:07.013
2023-03-03T19:21:07.013
1,264,804
21,244,489
[ "html", "css" ]
75,631,066
2
null
75,631,039
0
null
``` http.post('http://10.96.59.144:80/SccTestService/v1/requestMirror', payload , params); ``` payload was missing
null
CC BY-SA 4.0
null
2023-03-03T19:17:51.760
2023-03-03T19:17:51.760
null
null
14,820,140
null
75,631,058
2
null
75,630,121
0
null
There's not a one thing you can do to guarantee you never crash your notebook. There are things you can do to avoid crashing it when working with data that is bigger than memory. The first thing to do is look at the [docs](https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.scan_csv.html) and notice th...
null
CC BY-SA 4.0
null
2023-03-03T19:16:58.480
2023-03-03T19:16:58.480
null
null
1,818,713
null
75,631,063
2
null
75,630,401
0
null
There is one way, but it takes more time and requires writing code: You put each 3 "div" in a separate "div" eg a div named "row", then: ``` .products_page{ width:80%; min-height: 80%; display: grid; place-items: center; margin-top: -41%; margin-left: 25%; padding-bottom: 2%; } .products_page...
null
CC BY-SA 4.0
null
2023-03-03T19:17:25.700
2023-03-03T19:17:25.700
null
null
19,557,286
null
75,631,069
1
null
null
0
17
I need to rename a file in Box using the Python SDK API. I know the filename, but I guess to rename it I need a file object. How do I create a file object when all I have is the name of the file? The file is located in the root folder.
How to create file object using filename in Box
CC BY-SA 4.0
null
2023-03-03T19:18:12.697
2023-03-03T20:32:55.277
2023-03-03T20:32:55.277
15,766,257
15,766,257
[ "python", "box-api" ]
75,631,065
1
75,631,308
null
1
16
I have an input JSON that looks like this: ``` [ { "some_key": "x", "foo_id": 123, "foo_name": "bar_1", "all_foo": [ { "foo_id": 456, "foo_name": "bar_2" } ] } ] ``` The requirement is to collapse `foo_id` and `foo_name` (this is known ahead of time) as objects under...
Combine known keys external to nested array as objects of that array
CC BY-SA 4.0
null
2023-03-03T19:17:31.560
2023-03-03T20:03:18.543
null
null
1,689,144
[ "json", "apache-nifi", "jolt" ]
75,631,068
1
null
null
0
7
I want to capture all the data in the forms quiz. Currently as the default form if a user completes a question and does not submit the data does not get logged into the corresponding sheets page. Is there anyway of capturing the data and populating sheets as the form jumps from page break to page break before the last ...
google forms data collection
CC BY-SA 4.0
null
2023-03-03T19:18:09.700
2023-03-03T19:18:09.700
null
null
21,328,131
[ "jquery", "forms", "google-forms-api" ]
75,631,064
1
null
null
4
54
I found something very strange. In all major browsers, context menu event doesn't work on disabled elements, so this wouldn't print to console: ``` <button type="button" onContextMenu="console.log(123)" disabled > Click me </button> ``` But it's a little different with React. I tried to do the same t...
Why does React's onContextMenu work in Chrome on disabled elements?
CC BY-SA 4.0
null
2023-03-03T19:17:29.663
2023-03-03T20:56:42.843
2023-03-03T20:56:42.843
4,088,472
4,403,732
[ "javascript", "reactjs", "google-chrome", "dom-events", "contextmenu" ]
75,631,070
1
null
null
0
15
I downloaded Jupyter onto my Windows 11 laptop using the command `pip install jupyter`. That appeared to work OK, but when I tried starting it from the Windows command line, it didn't seem to know where to find it: ``` Installing collected packages: jupyter Successfully installed jupyter-1.0.0 C:\Users\marka>jupyter...
How to start Jupyter?
CC BY-SA 4.0
null
2023-03-03T19:18:18.133
2023-03-04T21:24:15.367
2023-03-04T21:24:15.367
5,446,749
2,417,922
[ "windows", "pip", "jupyter" ]
75,631,037
1
null
null
1
57
Please help me, my CNN don`t predict hard written numbers from MNIST dataset, where is my mistake? I'm writing my own CNN in C# without any external libraries because I want to understand how neural networks work. But now I am faced with the problem that during training, regardless of the learning rate, the filter valu...
I'm stuck with Backpropagation in my own CNN
CC BY-SA 4.0
null
2023-03-03T19:14:33.877
2023-03-04T19:30:01.493
2023-03-04T19:30:01.493
15,895,967
15,895,967
[ "c#", "neural-network", "conv-neural-network", "gradient-descent", "backpropagation" ]
75,631,051
1
null
null
0
17
I'm trying to build a shiny app that allows users to process large datasets on their local machines. The idea is that the shiny app acts as a MATLAB app in that it's just a friendly GUI to cover the analysis. This will allow folks new to my field to process their data in a way that 1) doesn't require a costly MATLAB li...
How to create a shiny app to process data locally
CC BY-SA 4.0
null
2023-03-03T19:16:25.717
2023-03-03T19:17:12.860
2023-03-03T19:17:12.860
4,705,008
4,705,008
[ "r", "shiny" ]
75,631,075
2
null
75,630,097
1
null
These are parameter hints. Try setting the following in your [settings.json file](https://code.visualstudio.com/docs/getstarted/settings) ``` "editor.parameterHints.enabled": false ``` The setting's description: > Enables a pop-up that shows parameter documentation and type information as you type.
null
CC BY-SA 4.0
null
2023-03-03T19:18:50.420
2023-03-03T19:47:40.240
2023-03-03T19:47:40.240
11,107,541
11,107,541
null
75,631,078
2
null
75,631,008
0
null
Removing the ``` info = info.concat((docComments.items)); ``` fixed the issue I have was having.
null
CC BY-SA 4.0
null
2023-03-03T19:19:02.547
2023-03-03T19:19:02.547
null
null
17,361,711
null
75,631,079
2
null
75,631,011
0
null
Try this: ``` onPressed: () => setState(() { logPage = false; }), ```
null
CC BY-SA 4.0
null
2023-03-03T19:19:05.620
2023-03-03T19:19:05.620
null
null
14,726,230
null
75,631,073
1
null
null
-2
14
I'm trying to upload 3 files in PHP and I get two warnings: > Warning: move_uploaded_file(): The second argument to copy() function cannot be a directory in /Applications/XAMPP/xamppfiles/htdocs/ > Warning: move_uploaded_file(): Unable to move '/Applications/XAMPP/xamppfiles/temp/php8p5gbs' to './product_images/' in /A...
Warning: move_uploaded_file(): The second argument to copy() function cannot be a directory in /Applications/XAMPP/xamppfiles/htdocs/
CC BY-SA 4.0
null
2023-03-03T19:18:38.507
2023-03-03T19:48:12.497
2023-03-03T19:48:12.497
1,007,220
14,456,033
[ "php", "file", "upload" ]
75,631,080
2
null
48,225,854
0
null
You can use `plot(...,legend.mar = 0)`.
null
CC BY-SA 4.0
null
2023-03-03T19:19:06.360
2023-03-03T19:19:06.360
null
null
20,736,205
null
75,631,076
2
null
75,630,890
6
null
`\r` and `\n` are "control characters". What are "control characters" controlling? A typewriter. Well, it used to. TTYs pre-date computers, going back to telegraphs. [TTY stands for teletype](https://en.wikipedia.org/wiki/Teleprinter); literally a typewriter that types the output. As it was a typewriter, it needed to b...
null
CC BY-SA 4.0
null
2023-03-03T19:18:52.000
2023-03-03T19:24:38.447
2023-03-03T19:24:38.447
14,660
14,660
null
75,631,071
1
null
null
0
26
am trying to create my 1st jinja2 template that extracts a field from a json string as am trying to create DHCP reserveration file. here is an example inventory feed. I would like to select the value from the mac address to use as a value as jinja2 value for a field for the interface that matches the ansible host. whic...
json filter in creating a jinja2 template
CC BY-SA 4.0
null
2023-03-03T19:18:27.583
2023-03-04T00:36:22.967
2023-03-03T19:20:05.170
11,613,885
11,613,885
[ "json", "ansible", "jinja2" ]
75,631,074
1
75,632,587
null
1
19
I am trying to create a user with Selenium because I don't have access to the database from my server. I get the message "PASS" but the user is never created so I thing it might be something related to headless. Is there any way to use clicks and filling forms with headless? ``` chrome_options = Options() chrome_optio...
Cannot create account in Selenium with Headless Chrome Driver
CC BY-SA 4.0
null
2023-03-03T19:18:42.413
2023-03-03T23:07:46.113
null
null
17,637,107
[ "python", "google-chrome", "selenium-webdriver", "selenium-chromedriver", "google-chrome-headless" ]
75,631,067
2
null
31,254,523
0
null
If you don't mind using PHP, here are two functions that work together to create multiple footnotes. These do about what Andie2302 suggests but do most of the work for you. You can hover over the footnote number to pop up a tooltip with the footnote text. You can click the footnote to jump to the original reference. To...
null
CC BY-SA 4.0
null
2023-03-03T19:18:05.523
2023-03-03T20:05:32.383
2023-03-03T20:05:32.383
21,161,663
21,161,663
null
75,631,081
2
null
75,630,914
1
null
You could just send the `FormData` as the body. ``` const formData = new FormData(); formData.append("file", blob); const data = { name: 'John', age: '24' }; // add all key-value pairs of object to the FormData for (const [key, val] of Object.entries(data)) formData.append(key, val); // ... fetch(endpoint, ...
null
CC BY-SA 4.0
null
2023-03-03T19:19:08.617
2023-03-03T19:19:08.617
null
null
9,513,184
null
75,631,083
1
null
null
-3
46
I'm trying to select trees from the following sample that have had the Vigor value 6,8 or 9 for the past three years straight. So, in the below grid I would want all rows with TreeID 2 and 3, but not any with TreeID 1. ``` PlotID ObsYear TreeID Vigor MACFI0407 2020 1 8 MACFI0407 2021 1 8 MACFI0407 20...
Having clause with aggregate and NOT IN doesn't apply both as expected
CC BY-SA 4.0
null
2023-03-03T19:19:24.467
2023-03-04T20:56:26.457
2023-03-03T19:41:11.637
11,908,297
11,908,297
[ "mysql" ]
75,631,085
1
null
null
0
14
I am writing a form using PyQt5. I want the validation to work when the user switches inputs, if it is invalid it shows an error message and the focus is on the invalid textbox. I've tried using the "editingFinished" to detect focus switching, but it doesn't work since if the validator is invalid it won't go into the "...
PyQt5 Validation on Focus change
CC BY-SA 4.0
null
2023-03-03T19:19:33.137
2023-03-03T19:19:33.137
null
null
21,328,155
[ "python-3.x", "pyqt5" ]
75,631,088
2
null
75,630,990
1
null
Try tidyverse / tidyr: ``` library(tidyverse) library(tidyr) df <- dtTest %>% as_tibble() %>% pivot_longer(everything(), names_to = "groups", values_to = "values") %>% mutate(answer = ifelse(values == 0, "no", "yes" )) ```
null
CC BY-SA 4.0
null
2023-03-03T19:19:49.323
2023-03-03T19:26:51.567
2023-03-03T19:26:51.567
4,026,992
4,026,992
null
75,631,084
1
75,631,305
null
-4
42
I have a dataframe and would like to create a stacked bar chart by having date on the x-axis and quantity on the y-axis. This is the current dataframe: ``` date | product_group | quantity 2021-10-01 | A | 10 2021-10-01 | C | 10 2021-10-01 | Z | 80 2021-11-11 | A | 1...
How to create stacked bar chart with given dataframe shape?
CC BY-SA 4.0
null
2023-03-03T19:19:26.173
2023-03-04T00:22:56.430
2023-03-04T00:22:56.430
13,107,804
19,321,677
[ "python", "pandas", "matplotlib", "seaborn" ]
75,631,090
1
null
null
0
12
I have a table like below id | status | EffDate | 1 | A | 12-Dec-2020 | 1 | T | 17-Dec-2022 | I need to pull the data from the above table based on a condition as below: 1. Get the record if the status is in ('A','W'), 2. get the record with status = 'T' if the 1st condition fails. At a time I need onl...
Sql Query to pull only one record from table 'Academic' based on condition
CC BY-SA 4.0
null
2023-03-03T19:19:55.943
2023-03-03T19:56:01.633
null
null
21,222,373
[ "select" ]
75,631,077
1
null
null
0
38
I have a table where the column `minute` is a string. ``` SELECT "minute", CAST("minute" AS INTEGER), CAST("minute" AS INTEGER) = 4 FROM "db"."table" WHERE "year" = '2023' AND "month" = '03' AND "day" = '03' AND "hour" = '03' AND "minute" = '04' AND CAST("minute" AS INTEGER) = 4 LIMIT 5 ``` When I run this I get...
Why does this Athena query return fewer results with a less restrictive search?
CC BY-SA 4.0
null
2023-03-03T19:19:01.653
2023-03-04T12:34:07.043
2023-03-03T23:34:54.620
581,002
581,002
[ "sql", "amazon-web-services", "amazon-athena" ]
75,631,086
2
null
75,630,220
1
null
To fetch it, you can use the `fresh()` or `refresh()` on `$fruit` object, like this: ``` $fruits = Fruit::whereIn('basket', [200, 300])->get(); foreach ($fruits as $fruit) { $fruit->update([ "basket_id" => 100 ]); $fruit->refresh(); // Fetch updated object } ``` [https://laravel.com/docs/10.x/eloquent#refre...
null
CC BY-SA 4.0
null
2023-03-03T19:19:46.797
2023-03-03T19:32:38.397
2023-03-03T19:32:38.397
984,422
984,422
null
75,631,092
1
null
null
0
33
if so, the R package car does not provides the results of r2, slope and intercept. How to extract them? ``` df <- data.frame(x = c(1, 2, 3, 4, 5), y = c(2, 4, 6, 8, 10.5)) model <- lm(y~x, data = df) Anova(model, type="II") ```
Does type II sum of squares gives a different r2, slope, and intercept of linear regression?
CC BY-SA 4.0
null
2023-03-03T19:20:06.917
2023-03-04T11:02:44.447
2023-03-03T21:00:04.237
21,327,530
21,327,530
[ "r", "linear-regression" ]
75,631,096
1
75,631,150
null
0
35
I have a navbar in my project where I am displaying the name of the user currently logged in and also has a logout button. When I try to login the page works fine and the jwt auth-token is stored in the local storage of the browser to maintain session. But after I have logged in, if I refresh the webpage then the jwt k...
Unable to set state in useEffect hook React
CC BY-SA 4.0
null
2023-03-03T19:20:33.037
2023-03-04T02:17:32.010
2023-03-03T19:23:00.417
17,260,037
17,260,037
[ "javascript", "reactjs", "react-hooks", "jwt", "local-storage" ]
75,631,094
1
null
null
0
31
I have following code: ``` AvroSerializerSettings settings = new AvroSerializerSettings { Resolver = new AvroPublicMemberContractResolver() }; var schemaWriter = AvroSerializer.Create<ProductOrderConfirmation>(settings).WriterSchema; var schema = schemaWriter.ToString(); ``` All works fine. The AvroSerializer class...
How to invoke static method on internal static class
CC BY-SA 4.0
null
2023-03-03T19:20:21.003
2023-03-03T21:08:44.367
2023-03-03T19:57:25.547
4,190,402
719,625
[ "c#", "activator" ]
75,631,099
2
null
75,630,269
0
null
Solved it, it was a bug in my code: The part where I call the `model()` should be inside the `with` statement as below: ``` pose = tf.Variable(tf.zeros((1, num_pose_params),tf.float32)) shape = tf.Variable(tf.zeros((1, shape_code_size))) model = Projection() optimizer = tf.optimizers.Adam() model.compile(optimizer=opti...
null
CC BY-SA 4.0
null
2023-03-03T19:21:20.017
2023-03-03T19:21:20.017
null
null
681,911
null
75,631,089
1
null
null
0
29
I'm trying to make a Wordle game in python. First I created it with no classes at all, only lists, tuples, dicts, variables. And... it works, but as I'm trying to add more features to it (calculating the points each person gets for guessing) it's becoming harder to do so. The code is also starting to become messier. If...
Should I use OOP for a worlde game clone? If yes what kind of OOP?
CC BY-SA 4.0
null
2023-03-03T19:19:49.560
2023-03-03T19:19:49.560
null
null
15,323,416
[ "python", "oop", "data-structures", "design-patterns", "wordle-game" ]
75,631,097
2
null
75,628,514
2
null
The easiest way is to send a mock response, which by-passes waiting for the server. It's feasible if the app does not use the response. ``` cy.intercept(url, {}).as('my-alias') // 2nd argument is a very simple mock response // request never gets to the server // trigger request i...
null
CC BY-SA 4.0
null
2023-03-03T19:21:02.413
2023-03-04T08:24:28.347
2023-03-04T08:24:28.347
16,695,029
16,695,029
null
75,631,091
2
null
40,665,125
0
null
With Git 2.38+ (Q3 2022), you can use quickly check if there will be conflicts between your feature branch and the PR target branch, using [git merge-tree --write-tree](https://git-scm.com/docs/git-merge-tree): ``` git merge-tree --write-tree --no-messages --name-only branch1 branch2 ``` --- With a GUI like [GitHub...
null
CC BY-SA 4.0
null
2023-03-03T19:19:59.390
2023-03-03T21:41:52.733
2023-03-03T21:41:52.733
6,309
6,309
null
75,631,087
1
75,631,135
null
0
24
Here I got this little code: ``` import '../styles/Navbar.css'; import * as React from 'react'; import logo from '../assets/logo.webp'; class Navbar extends React.Component { constructor(props) { super(props); this.ref1 = React.createRef(); this.ref2 = React....
React createRef current is null
CC BY-SA 4.0
null
2023-03-03T19:19:48.453
2023-03-03T19:24:53.290
null
null
21,328,139
[ "javascript", "reactjs" ]
75,631,103
2
null
75,631,011
0
null
You are invoking `setState()` in the of your `onPressed:`. You need to provide a function to be run at a future time, as in a VoidCallback. It'd look something like: ``` onPressed: () { setState(() { logPage = false; }), ``` Notice that the onPressed is now a function, not the result of calling a function.
null
CC BY-SA 4.0
null
2023-03-03T19:21:56.013
2023-03-03T19:21:56.013
null
null
22,483
null
75,631,102
2
null
75,630,591
1
null
`useEffect` is called twice in the development mode and will only run once on production if Strick mode is enabled. You shouldn't try to use those technics with `useRef` and `if` statements in `useEffect` to make it fire once, or remove `StrictMode` because react intentionally remounts your components in development to...
null
CC BY-SA 4.0
null
2023-03-03T19:21:46.620
2023-03-03T19:35:38.580
2023-03-03T19:35:38.580
12,083,049
12,083,049
null
75,631,107
1
null
null
1
29
I am working on listing out the users and groups who have access to a shared folder on our networking using PowerShell and Active directory but I am getting different results. When I run the command `(Get-Acl -Path "D:\ADMIN_FOLDER").Access` I see a security group called `EVERYONE` has the `ReadAndExecute` and when I c...
PowerShell command Get-Acl.Access shows different permissions than Active Directory
CC BY-SA 4.0
null
2023-03-03T19:22:23.677
2023-03-03T21:38:07.087
null
null
12,116,205
[ "powershell", "active-directory" ]
75,631,098
1
null
null
0
32
As the title suggests I am trying to convert base64 encoded string (EC Public Key) generated on IOS device(Swift) to Java PublicKey which will be used to calculate a Shared Secret Key between two parties. There is neither runtime nor compile time exception/error in the code, it compiles and runs successfully and genera...
Not getting the right result in base64 string when I try to convert base64 encoded string EC Public Key generated on iOS to Java PublicKey
CC BY-SA 4.0
null
2023-03-03T19:21:09.960
2023-03-04T09:56:20.893
2023-03-03T19:31:54.447
14,160,590
14,160,590
[ "android", "kotlin", "cryptography", "bouncycastle", "elliptic-curve" ]
75,631,108
2
null
40,091,000
0
null
Actually we say rather than (technically speaking). And what you have here (`div[class="UFIInputContainer"]`) is an input, not a button! (image below) [](https://i.stack.imgur.com/3znan.png) ## Focus an element in React Functional Component ``` function CustomTextInput(props) { // textInput must be declared here...
null
CC BY-SA 4.0
null
2023-03-03T19:22:24.507
2023-03-03T19:22:24.507
null
null
20,576,394
null
75,631,109
2
null
72,778,297
0
null
Probably your python version is too low. If you update it to higher version, for example 3.8, you can install a higher version of scipy, permutation_test will be included. I had the same issue and solved it recently.
null
CC BY-SA 4.0
null
2023-03-03T19:22:38.293
2023-03-03T19:22:38.293
null
null
21,328,203
null
75,631,111
2
null
75,621,159
0
null
Without having tried it out myself tbh, I'd guess that the destructuring in `val (track, isPlaying, repeatMode, isShuffleActive, progress, playbackState) = uiState` is to blame. It will always trigger whenever `uiState` changes. Have you tried using `LaunchedEffect(uiState.track)`?
null
CC BY-SA 4.0
null
2023-03-03T19:22:45.550
2023-03-03T19:23:23.060
2023-03-03T19:23:23.060
13,258,270
13,258,270
null
75,631,104
1
null
null
0
8
I'm using Microsoft AAD B2C with User Flow. I have a user that returns those identities objects: ``` "identities": [ { "signInType": "phoneNumber", "issuer": "ourtenant.onmicrosoft.com", "issuerAssignedId": "+55444444444" }, { ...
AAD B2C: Returning value: [] when trying to filter by identities
CC BY-SA 4.0
null
2023-03-03T19:21:59.413
2023-03-03T19:31:44.333
2023-03-03T19:31:44.333
11,836,553
11,836,553
[ "azure", "api", "microsoft-graph-api", "identity" ]
75,631,105
1
null
null
1
28
I am trying to create a shell script that will get the count of files in a static directory, then display the Directory and the number of files it contains in a table. Here is the setup I have so far. File containing static paths of directories. The file is called dirs.txt. These are written as. `/path/to/file.txt` Her...
Shell script to get file count of directories
CC BY-SA 4.0
null
2023-03-03T19:22:15.980
2023-03-03T19:41:01.270
null
null
4,703,251
[ "linux", "bash", "shell", "scripting", "debian" ]
75,631,095
1
null
null
0
27
I have a document which has two parts that are dynamically filled in by Ajax calls. In that call are a couple of input fields. I must store the contents of those fields in a database. The problem is that I can't get the values from the input fields. Instead of the value I get a long text with a complete function like b...
How to get value of input field dynamically which is added by an Ajax call?
CC BY-SA 4.0
null
2023-03-03T19:20:21.357
2023-03-03T19:40:17.667
2023-03-03T19:40:17.667
214,143
1,886,216
[ "javascript", "jquery", "ajax" ]
75,631,112
2
null
26,525,255
0
null
DJV's recommendation seems like it was correct at the time, but has been depreciated. Try this instead: ``` ggplot(a, aes(x=name, y=count, color=location, shape=type)) + geom_point(size=7) + guides(shape="none") ``` I used it for color, so I appreciate the tip. (below) ``` ggplot(a, aes(x=name, y=count, color=locatio...
null
CC BY-SA 4.0
null
2023-03-03T19:22:51.380
2023-03-03T19:22:51.380
null
null
13,112,683
null
75,631,115
2
null
75,629,325
0
null
A better option (faster, less allocations) would be just: ``` using DataFrames df=DataFrame(x=["1","2","3"]) df.x .= parse.(Int, df.x) ```
null
CC BY-SA 4.0
null
2023-03-03T19:23:02.033
2023-03-03T19:23:42.590
2023-03-03T19:23:42.590
9,957,710
9,957,710
null
75,631,113
1
null
null
0
14
After updating Android Studio to Electric Eel version, I try to build an apk from a Flutter project it gives the message ``` Error: could not open `C:\Program Files\Android\Android Studio\jre\lib\jvm.cfg' ``` I noticed that `Program Files\Android` contained two Android Studio folders with the other named as `Android S...
Android Studio after update Error: could not open `C:\Program Files\Android\Android Studio\jre\lib\jvm.cfg'
CC BY-SA 4.0
null
2023-03-03T19:22:52.747
2023-03-03T19:35:42.220
2023-03-03T19:26:13.830
13,691,187
13,691,187
[ "java", "android", "flutter", "android-studio" ]
75,631,110
1
null
null
0
25
Since iOS 16, TextKit 2 has replaced TextKit 1 for `UITextView` which means `layoutManager` is out and `textLayoutManager` is in. However, a number of the properties from the old are not in the new. How can I calculate the number of lines in a `UITextView` using TextKit 2? Below is the TextKit 1 implementation. ``` ext...
How to get UITextView number of lines using TextKit 2?
CC BY-SA 4.0
null
2023-03-03T19:22:39.750
2023-03-03T19:23:25.947
2023-03-03T19:23:25.947
4,967,050
4,967,050
[ "ios", "swift", "uitextview" ]
75,631,118
1
null
null
0
15
After loading the page (with the openstreet map), WebView2 asks for geolocation permission every time it is started (I do not clear WebView2 cookies - but I don't set anything either for cookies - is that wrong?). How to set C# Microsoft.Web.WebView2.WinForms (webView2.CoreWebView2? ) to remember a one-time user answer...
C# Microsoft.Web.WebView2.WinForms not remember answers to access to geolocation
CC BY-SA 4.0
null
2023-03-03T19:23:35.120
2023-03-03T19:23:35.120
null
null
15,567,170
[ "c#", "winforms", "settings", "webview2" ]
75,631,117
1
null
null
0
19
I use Arrow optimization in pySpark in order to make faster data transfer between Python and JVM. I add the corresponding param to my Spark session. ``` app_name = "App" spark_conf = { # some other params 'spark.sql.execution.arrow.enabled': 'true' } builder = ( SparkSession .builder .appName(a...
PySpark and pyArrow - Unsupported type in conversion to Arrow - Array of Struct
CC BY-SA 4.0
null
2023-03-03T19:23:20.257
2023-03-03T19:23:20.257
null
null
1,849,828
[ "apache-spark", "pyspark", "pyarrow" ]
75,631,120
1
null
null
0
30
I want to test for the existence of a file path on many computers, using SMB. Many of these computers will be offline, and it takes several seconds for the SMB request to time out, so I want to run this command in parallel. Foreach -parallel, however, does not seem to be running in parallel. It seems to just go one com...
Powershell Foreach -Parallel not running in parallel
CC BY-SA 4.0
null
2023-03-03T19:23:43.460
2023-03-03T21:36:53.147
2023-03-03T19:27:49.957
677,725
677,725
[ "powershell", "active-directory", "powershell-workflow" ]
75,631,119
2
null
75,630,986
2
null
The issue is that you link `Project` to glfw but do not link `CMakeTarget` (strange name, btw) to glfw. You need to add the line: ``` target_link_libraries( CMakeTarget glfw ) ``` This is because CMake uses link libraries to determine how to set up include paths for the compiler as well as for linking. Specifically, i...
null
CC BY-SA 4.0
null
2023-03-03T19:23:42.177
2023-03-03T19:25:10.567
2023-03-03T19:25:10.567
567,292
567,292
null
75,631,116
2
null
75,616,107
0
null
If you don't mind using static analysis, both [Psalm](https://psalm.dev/) and [PHPStan](https://phpstan.org/) support the `class-string<T>` type annotation. Define your function as follows: ``` /** * @param class-string<BackedEnum&TranslatableInterface> $enumClass */ private function translateEnum(string $enumClass) ...
null
CC BY-SA 4.0
null
2023-03-03T19:23:02.120
2023-03-03T19:23:02.120
null
null
5,057,350
null
75,631,124
1
null
null
-6
32
I am sending this request but getting timeout. ``` import requests value = 'Hi' token = ' ' id = '' tele = (f'https://api.telegram.org/bot/{token}/sendMessage?chat_id={id}&text={value}') req=requests.post(tele) ``` ![output this ](https://i.stack.imgur.com/dRsuY.png)
Getting request timeout error in python request
CC BY-SA 4.0
null
2023-03-03T19:24:03.543
2023-03-04T11:01:10.670
2023-03-04T11:01:10.670
7,329,832
21,328,020
[ "python-requests" ]
75,631,122
2
null
32,139,773
0
null
The algorithms presented above do not work if there is an empty array inside the matrix, I share a solution that solves the problem. ``` console.log(sumVertical([[1,2],[1,3],[1,4]])) console.log(sumVertical([[],[1,3],[1,4]])) function sumVertical(values){ let result = [] for (let index = 0; index < values...
null
CC BY-SA 4.0
null
2023-03-03T19:23:49.507
2023-03-03T19:25:01.703
2023-03-03T19:25:01.703
17,510,827
17,510,827
null
75,631,121
1
null
null
0
28
I am trying to place an image next to my signature line details. However, when I use the code below, the last two lines of the text are aligned the signature. How can I modify the code? ``` img { width: 100px; border-radius: 50px; float: left; margin-right: 10px; } p.Name { font-weight: bold; } ``` ``` <...
Formatting a signature card in HTML with an image
CC BY-SA 4.0
null
2023-03-03T19:23:46.610
2023-03-03T19:49:09.457
2023-03-03T19:37:41.463
1,264,804
4,897,557
[ "html", "css" ]
75,631,127
1
null
null
-1
27
There is an object that already exists in my global environment, let's call it `results`. I have the following function I wrote that I want to add a value to `results`: ``` assign.value <- function(object, ...){ object$newfield <- 1 } ``` This throws the error `object 'object' not found` since I do not have anything i...
Is there any way to edit an object in the global environment without knowing its name?
CC BY-SA 4.0
null
2023-03-03T19:24:08.080
2023-03-03T19:24:08.080
null
null
7,660,188
[ "r", "pass-by-reference" ]
75,631,130
2
null
37,250,987
-1
null
``` Realm realm = Realm.getDefaultInstance(); realm.where(Object.class) .findAllAsync() .addChangeListener(list -> { List<Object> listObjects = realm.copyFromRealm(list); }); ```
null
CC BY-SA 4.0
null
2023-03-03T19:24:26.987
2023-03-03T19:24:26.987
null
null
15,436,243
null
75,631,126
1
75,631,249
null
-1
41
I have a list of values stored, I need to compare each value with each column cell in a data frame, if its found then place a value of "YES" in a Key column: ``` dep_list = df_epl[['Values']].copy() dep_list = dep_list.dropna() dep_list = dep_list.drop_duplicates() dlist = dep_list['Values'].tolist() df_existing['Key'...
Validating values
CC BY-SA 4.0
null
2023-03-03T19:24:06.927
2023-03-03T19:45:14.007
2023-03-03T19:45:14.007
14,904,191
14,904,191
[ "python", "conditional-statements" ]
75,631,106
1
null
null
0
16
Our Vue app uses `vuetify` as its component library which by default uses material design icons. The only thing [that needs to be done for the icons to work correctly](https://vuetifyjs.com/en/features/icon-fonts/) is to import the css file which we do inside of the `vuetify.js` file: ``` import Vue from "vue"; import ...
Electron build of Vue app doesn't display material icons
CC BY-SA 4.0
null
2023-03-03T19:22:20.463
2023-03-03T19:22:20.463
null
null
13,302,438
[ "vue.js", "electron", "vuetify.js", "vue-cli" ]
75,631,131
2
null
75,629,867
0
null
here my proposal tell me if it corresponds ``` library(dplyr) library(tidyr) # you need tidyr for the fill function df=data.frame(date = 1:7,up=c(NA,10,NA,NA,NA,10,NA),down=c(NA,NA,NA,4,3,NA,2)) df date up down 1 1 NA NA 2 2 10 NA 3 3 NA NA 4 4 NA 4 5 5 NA 3 6 6 10 NA 7 7 NA 2 ...
null
CC BY-SA 4.0
null
2023-03-03T19:24:37.623
2023-03-03T19:24:37.623
null
null
13,046,806
null
75,631,129
1
null
null
0
27
I want to apply `gtsummary` by each group `gr`. `group_by` does not work here. How to do it? ``` library(tidyverse) library(gtsummary) df <- tibble(gr = c('a', 'a', 'a', 'a', 'b', 'b', 'b', 'b'), tr = c('pre', 'pos', 'pre', 'pos', 'pre', 'pos', 'pre', 'pos'), y = sample(1:9, 8, replace=TRUE))...
How to use gtsummary by group in R
CC BY-SA 4.0
null
2023-03-03T19:24:16.653
2023-03-03T19:24:16.653
null
null
3,225,661
[ "r", "gtsummary" ]
75,631,125
1
75,631,159
null
1
49
I've made an ArrayList from the result array and i'm wondering why i can't add an element to it ``` Enter array size 2 Enter a [0] element 3 Enter a [1] element 1 13Exception in thread "main" java.lang.UnsupportedOperationException at java.base/java.util.AbstractList.add(AbstractList.java:155) at java.base/java...
UnsupportedOperationException while trying to add element to the list
CC BY-SA 4.0
null
2023-03-03T19:24:06.497
2023-03-03T23:00:54.580
null
null
18,294,031
[ "java" ]
75,631,133
2
null
75,630,654
2
null
Mybe use a global variable or some state managers, you can also use lodash or Rxjs. here a simple global variable solution: > ``` let cooldown = false const btn = document.getElementById("menu") btn.addEventListener("click", () => { console.log("inside func", cooldown) setTimeout(() => { cooldown = false c...
null
CC BY-SA 4.0
null
2023-03-03T19:24:45.510
2023-03-03T19:24:45.510
null
null
9,233,391
null
75,631,135
2
null
75,631,087
0
null
- `navAppear``onClick`- `this` ``` onClick={this.navAppear.bind(this)} ```
null
CC BY-SA 4.0
null
2023-03-03T19:24:53.290
2023-03-03T19:24:53.290
null
null
9,513,184
null
75,631,139
2
null
75,624,425
0
null
Not exactly. The best you could do with the [schedule(interval, type, callback)](https://javadoc.io/static/org.apache.kafka/kafka-streams/3.4.0/org/apache/kafka/streams/processor/api/ProcessingContext.html#schedule-java.time.Duration-org.apache.kafka.streams.processor.PunctuationType-org.apache.kafka.streams.processor...
null
CC BY-SA 4.0
null
2023-03-03T19:25:26.837
2023-03-03T19:25:26.837
null
null
1,820,013
null
75,631,132
1
null
null
0
31
I am trying to display all the documents in a collection from my Firestore database. Here is where I query the DB and turn the documents into usable objects. ``` class DatabaseService { static List<Recipe> getSavedRecipes(String uid) { List<Recipe> recipes = []; FirebaseFirestore.instance .collection(...
Function returning before array is populated
CC BY-SA 4.0
null
2023-03-03T19:24:40.260
2023-03-04T08:22:38.740
2023-03-04T00:36:36.083
16,386,338
16,386,338
[ "flutter", "google-cloud-firestore" ]
75,631,100
1
null
null
-2
30
I'm trying to submit data into the database using laravel. I got an error Controller does not exist when it clearly exist. Here is my code ``` RequestInsertController.php <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use DB; use App\Http\Controllers\Controller; use App\Http\Requests; class Re...
errors in submitting data into database in php laravel
CC BY-SA 4.0
null
2023-03-03T19:21:31.657
2023-03-03T19:39:09.780
2023-03-03T19:26:22.087
7,607,190
5,948,742
[ "php", "sql", "laravel" ]
75,631,141
1
null
null
0
9
The Authy app Backup password not accepting, and then reset the password link not received on the registered email ID, anyone please help me how to change Authy app backup password.
How to reste Backup Password of Authy app
CC BY-SA 4.0
null
2023-03-03T19:25:56.473
2023-03-03T19:53:25.373
null
null
20,679,221
[ "twilio" ]
75,631,142
1
null
null
-2
9
I want to add HTML code in Tilda block 'product details' I tried to add HTML in Tilda product through T123 block, but that's not what I wanted. I wanted to display this HTML code in product card.
I want to add HTML code in Tilda, but I don't know how
CC BY-SA 4.0
null
2023-03-03T19:26:01.410
2023-03-03T19:26:01.410
null
null
16,304,308
[ "html", "constructor" ]
75,631,140
1
null
null
0
23
I built 18 models in a script in a unique R session. Since each model was the result of a step selection process that was taking quite some time, I saved the 18 final models as `.Rdata` files using the function `save` at the end of my script. Now, after some days, I want to load those models and continues working on th...
loading models in R require more memory than that used to build them
CC BY-SA 4.0
null
2023-03-03T19:25:54.870
2023-03-04T01:15:37.527
2023-03-03T19:34:20.577
3,570,800
3,570,800
[ "r", "memory", "save", "load", "spatstat" ]
75,631,137
2
null
75,630,374
0
null
The `Save` method of the `MailItem` class saves the Microsoft Outlook item to the current folder in Outlook (not disk) or, if this is a new item, to the Outlook default folder for the item type, in your case it would be the Drafts folder because it has never been saved in Outlook. If you need to save the created from a...
null
CC BY-SA 4.0
null
2023-03-03T19:25:05.383
2023-03-03T19:38:08.370
2023-03-03T19:38:08.370
1,603,351
1,603,351
null
75,631,138
1
null
null
1
43
[C# nullable reference types](https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references) I know that [I can use NotNullIfNotNullAttribute](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis) to specify that the return value of my method may be null if, and only if,...
Is there something similar to NotNullIfNotNullAttribute for IEnumerable return values?
CC BY-SA 4.0
null
2023-03-03T19:25:24.147
2023-03-05T02:07:35.160
2023-03-03T19:37:25.217
87,698
87,698
[ "c#", ".net", "generics", ".net-7.0", "nullable-reference-types" ]
75,631,143
1
null
null
0
12
I am trying to solve the following kata on the CodeWars website: [https://www.codewars.com/kata/5b93636ba28ce032600000b7](https://www.codewars.com/kata/5b93636ba28ce032600000b7) My code is as follows: ``` def solve(n,k): balls = list(range(n)) for i in range(n): balls = balls[:i] + balls[i:].revers...
reverse method returns NoneType
CC BY-SA 4.0
null
2023-03-03T19:26:05.377
2023-03-03T19:32:21.393
2023-03-03T19:32:21.393
642,070
21,328,160
[ "python-3.x", "algorithm", "function", "reverse" ]
75,631,146
1
null
null
0
54
There's a technique in Oracle SQL that can be used to simplify aggregation queries. Scenario: We've aggregated on a particular column — but we actually want to know information from a different column. There are a number of ways to achieve that using SQL. I'm looking for a solution that lets me do it in a calculated co...
SQL Server equivalent to Oracle's MAX(...) KEEP (DENSE_RANK FIRST/LAST ORDER BY ...)
CC BY-SA 4.0
null
2023-03-03T19:26:17.820
2023-03-03T21:37:56.877
2023-03-03T19:52:48.897
1,509,264
5,576,771
[ "sql", "sql-server", "oracle", "group-by" ]
75,631,147
2
null
75,628,495
1
null
Another possible solution, which is based on [numpy.roll](https://numpy.org/doc/stable/reference/generated/numpy.roll.html): ``` m = a[:, 0] != np.roll(a[:,0], 1) m[0] = True a[m, :] ``` Output: ``` array([[1, 1], [0, 2], [1, 4], [0, 6], [1, 7]]) ```
null
CC BY-SA 4.0
null
2023-03-03T19:26:22.207
2023-03-03T19:29:14.637
2023-03-03T19:29:14.637
11,564,487
11,564,487
null