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,621,051 | 2 | null | 16,002,659 | 0 | null | ```
//Simple and best solution complete code with example
const mongoose = require("mongoose");
mongoose
.connect("mongodb://127.0.0.1:27017/test")
.then(() => console.log("Connected!"));
const blogSchema = new mongoose.Schema({
title: String,
author: String,
body: String,... | null | CC BY-SA 4.0 | null | 2023-03-02T21:36:39.333 | 2023-03-02T21:36:39.333 | null | null | 12,203,053 | null |
75,621,054 | 1 | null | null | 0 | 20 | I want to iterate over the characters of a string and convert every single character to its respective ASCII value. So far I have created this program that takes input from the user and then stores it in the `buffer`. I have also created a loop that reads the character from the buffer (`esi`) and stores it within the `... | iterate over characters and convert them to ascii in x86 assembly | CC BY-SA 4.0 | null | 2023-03-02T21:37:01.883 | 2023-03-02T21:37:01.883 | null | null | 17,151,917 | [
"assembly",
"x86",
"nasm",
"yasm"
] |
75,621,058 | 1 | null | null | 0 | 8 | I am generating an email tracking service that uses an embedded tracking pixel. The issue is that the emails contain attachments, and gmail allows users to directly preview the attachment by clicking on the attachment icons, and this leads to the tracking pixel not firing. Is there anyway to signal to gmail that it nee... | gmail - preview of email when user clicks on attachment | CC BY-SA 4.0 | null | 2023-03-02T21:37:29.160 | 2023-03-02T21:37:29.160 | null | null | 1,279,887 | [
"gmail",
"email-attachments"
] |
75,621,059 | 2 | null | 469,913 | -1 | null |
## Common Situation:
In javascript You can do this:
If you wanna check if a password contains both miniscule and majuscule letters, use this:
passwordValue.search(/[a-z]/) !== -1 passwordValue.search(/[A-Z]/) !== -1
This statement returns if the password input contains miniscule and majuscule letters, otherwise i... | null | CC BY-SA 4.0 | null | 2023-03-02T21:37:35.123 | 2023-03-02T21:37:35.123 | null | null | 13,831,239 | null |
75,621,062 | 1 | 75,623,307 | null | 0 | 24 | Does anyone know how I can get this dynamic query working?
(device.deviceTrustType -ne "ServerAD") and (device.devicePhysicalIds -any "(_ -match "^[OrderID]:.*_AzureAD_UserDriven$")
***This works: (device.deviceTrustType -ne "ServerAD")
**_AzureAD_UserDriven$")
But I can not bind them together
| Azure AD dynamic group query error when using "and" to combine two working queries | CC BY-SA 4.0 | null | 2023-03-02T21:37:49.327 | 2023-03-03T04:55:25.757 | null | null | 5,329,849 | [
"azure",
"azure-active-directory",
"intune",
"autopilot"
] |
75,621,061 | 2 | null | 66,960,129 | 0 | null | Dexie.js has implemented a thing called `PSD` which allows for tracking async context -- even with native promises.
I pulled it out into its own package here:
[https://github.com/vlcn-io/model/tree/main/ts/packages/zone](https://github.com/vlcn-io/model/tree/main/ts/packages/zone)
You can see example of tracking an asy... | null | CC BY-SA 4.0 | null | 2023-03-02T21:37:36.790 | 2023-03-02T21:37:36.790 | null | null | 216,941 | null |
75,621,057 | 1 | null | null | -1 | 30 | I'm editing a tour booking form and added a field that displays "No dates available" if there aren't any tours scheduled. (This is a Custom Field that allows us to add text - so the intention is to write "No dates available," but they might add different text at some point, such as "Private only, call to book."
I want ... | How to hide a button if a text field is NOT empty? | CC BY-SA 4.0 | null | 2023-03-02T21:37:26.293 | 2023-03-02T21:54:19.547 | 2023-03-02T21:54:19.547 | 82,548 | 10,598,360 | [
"php",
"wordpress",
"advanced-custom-fields",
"is-empty"
] |
75,621,063 | 1 | null | null | 0 | 40 | I have a fortran code (which is working perfectly), I need to submit the queue and direct it to the nodes.
I compiled the fortran code manually. The .bash code gives the following error:
```
Job start at Thu Mar 2 17:58:30 -03 2023
n20
1
Job end at Thu Mar 2 17:58:32 -03 2023
```
This is my .bash code:
```
#!/bin/ba... | How to write a shell script to queue and submit a given calculation (in fortran) directing to the nodes? | CC BY-SA 4.0 | null | 2023-03-02T21:38:06.077 | 2023-03-04T21:48:29.073 | 2023-03-04T21:48:29.073 | 721,644 | 14,446,363 | [
"bash",
"shell",
"slurm",
"hpc"
] |
75,621,034 | 1 | null | null | 0 | 30 | I've been struggling understanding and resolving to these typescript errors ( I have spent a lot of hours on this). My pure javascript code worked very well. However I can't get typescript to cooperate.
I am assigning dynamic key values to properties on an object being built within a reduce function.
[I posted my code ... | Can't assign dynamic key and value to object in reduce loop | CC BY-SA 4.0 | null | 2023-03-02T21:34:02.183 | 2023-03-02T21:52:26.973 | 2023-03-02T21:40:16.920 | 6,475,188 | 6,475,188 | [
"typescript"
] |
75,621,060 | 2 | null | 75,619,764 | 0 | null | Not a very good idea to use this code for production because of security reasons, but here is some insight:
There seem to be a few issues with the code that might be preventing the form data from being added to the Firebase database:
`database(`) is not defined: The code tries to access the `database()` function, but i... | null | CC BY-SA 4.0 | null | 2023-03-02T21:37:35.153 | 2023-03-02T21:37:35.153 | null | null | 1,811,914 | null |
75,621,069 | 2 | null | 75,605,942 | 1 | null | It sounds like you're looking for an `if`/`else if` statement.
```
option_1 = st.sidebar.checkbox('df1', value=True)
option_2 = st.sidebar.checkbox('df2')
option_3 = st.sidebar.checkbox('df3')
if option_1 and option_2:
st.write("Selected option 1 and option 1")
else if option_1:
st.write("Selected just option 1... | null | CC BY-SA 4.0 | null | 2023-03-02T21:38:51.857 | 2023-03-02T21:38:51.857 | null | null | 19,787,626 | null |
75,621,070 | 1 | null | null | 0 | 15 | I want to have grafana in a docker container within ec2. This will recieve traffic from Influxdb, also hosted in docker container, seperate ec2.
I want to know if these should be hosted in a private or public subnet within my VPC.
If i am needing to access the UI, I will need internet access (via Load Balancer to gatew... | Hosting my docker container in public or private subnet? | CC BY-SA 4.0 | null | 2023-03-02T21:38:55.057 | 2023-03-02T22:08:50.227 | null | null | 21,322,073 | [
"amazon-web-services",
"amazon-ec2",
"private-subnet",
"network-security-groups"
] |
75,621,071 | 2 | null | 75,597,154 | 0 | null | This dependency helped
```
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
</dependency>
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:39:13.137 | 2023-03-02T21:39:13.137 | null | null | 18,073,200 | null |
75,621,065 | 1 | null | null | 0 | 11 | ```
import tkinter as tk
from tkinter import *
window = tk.Tk()
window.title("Panda Clicker")
window.counter = 0
pps = 1
cost_pps = 20
counter = window.counter
def clicked():
global pps
global counter
counter += pps
L["text"] = "Pandas: " + str(counter)
C = Label(window, text="+" + str(p... | 'NoneType' object does not support item assignment when trying to update text in a button on Tkinter | CC BY-SA 4.0 | null | 2023-03-02T21:38:16.913 | 2023-03-02T21:42:22.817 | null | null | 21,322,047 | [
"python",
"nonetype"
] |
75,621,073 | 2 | null | 75,621,005 | 2 | null | You need to join the two sets on name so the values are all in one row, then subtract them
```
select
t1.Name,
t2.Score1 - t1.Score1 as Score1,
t2.Score2 - t1.Score2 as Score2,
t2.Score3 - t1.Score3 as Score3,
t2.Score4 - t1.Score4 as Score4
from
table1 t1
join
table2 t2 on t2.Name = t1.... | null | CC BY-SA 4.0 | null | 2023-03-02T21:40:00.347 | 2023-03-02T21:40:00.347 | null | null | 18,648,900 | null |
75,621,075 | 1 | null | null | 0 | 18 | I have a command where a job batch that runs some work that lasts at least 40 minutes is created, but I need the batch to pause about 10 hours if the next job is going to be executed after, let's say 2a.m., and start again at 12p.m. I did a schedule for the commando to not create a new batch if the time is between that... | Is it possible to make a job batch in Laravel to wait until a certain time in the future before running the next job? | CC BY-SA 4.0 | null | 2023-03-02T21:40:25.683 | 2023-03-03T00:22:16.087 | 2023-03-03T00:22:16.087 | 6,738,015 | 11,952,459 | [
"laravel",
"queue",
"batch-processing",
"jobs"
] |
75,621,076 | 2 | null | 75,620,459 | 1 | null | You can try:
```
from random import shuffle
idx = df.index.to_list() # get index to a list
shuffle(idx) # shuffle the list using `random.shuffle()`
for i in idx: # iterate over the shuffled list
print(df.iloc[i]) # access the index using `.iloc`
```
Prints (for example):
```
variabl... | null | CC BY-SA 4.0 | null | 2023-03-02T21:40:28.853 | 2023-03-02T21:40:28.853 | null | null | 10,035,985 | null |
75,621,068 | 2 | null | 75,620,734 | 2 | null | to enable keyboard tabbing and ARIA labels on a PrimeReact menu popup, you need to add several attributes to the Button and Menu components. first, for the Button component, you should add the attribute aria-haspopup="menu" to indicate that the button triggers a menu. you should also add the aria-expanded attribute and... | null | CC BY-SA 4.0 | null | 2023-03-02T21:38:50.937 | 2023-03-03T15:02:11.837 | 2023-03-03T15:02:11.837 | 17,996,884 | 17,996,884 | null |
75,621,078 | 1 | null | null | 0 | 18 | How can I print strings and dataframes inside `verbatimTextOutput`?
I have this simple app:
```
ui <- fluidPage(verbatimTextOutput("verba"))
server <- function(input, output,session) {
funDataSummary<-function(){
lapply(list("Firt 5 rows from iris"
,head(iris)
," "
... | Printing text and dataframes inside verbatimTextOuptut | CC BY-SA 4.0 | null | 2023-03-02T21:40:39.377 | 2023-03-02T21:40:39.377 | null | null | 5,157,277 | [
"r",
"shiny"
] |
75,621,074 | 2 | null | 75,620,956 | 0 | null | This is working for me :
```
from random import randint
score = 3
def is_even_game():
print('Welcome!')
print('May I have your name?')
name = input()
print(f'Hello, {name}!')
counter = 0
while counter < score: # Must be strictly inferior here, otherwise you
# could ... | null | CC BY-SA 4.0 | null | 2023-03-02T21:40:18.670 | 2023-03-02T21:52:35.950 | 2023-03-02T21:52:35.950 | 17,687,406 | 17,687,406 | null |
75,621,072 | 1 | null | null | 0 | 46 | I need to change values of items "Id" "SummaryId" and "CoworkersId" in my json. I have already code which will change values of "Id" and `"SummaryId"`. Code below generates new unique Id for these 2 items. I need that this code will change "CoworkersId" as well. As you can see the same value is in these 3 items - a4555... | Change values in json item which is list | CC BY-SA 4.0 | null | 2023-03-02T21:39:35.820 | 2023-03-03T03:10:12.070 | 2023-03-02T22:35:37.497 | 21,322,024 | 21,322,024 | [
"python",
"json",
"caching"
] |
75,621,085 | 1 | null | null | 0 | 7 | The following code I assumed was able to reject a body containing extraneous keys in addition to "url"
```
class CreateProductInput {
@IsNotEmpty()
url: string | undefined;
}
class ProductHandler {
@Post()
@HttpCode(201)
public async create_product(
@Body(ValidationPipe(options = {forbidNonWhitelis... | How can I reject data with next-api-decorator that have extra keys? | CC BY-SA 4.0 | null | 2023-03-02T21:41:27.090 | 2023-03-02T21:41:27.090 | null | null | 78,374 | [
"next.js"
] |
75,621,082 | 1 | null | null | -1 | 13 | I'm trying to catch the following exception when I try to connect to redis.
```
redis.exceptions.ConnectionError: Error 10061 connecting to localhost:6379. No connection could be made because the target machine actively refused it.
```
Using this code...
```
def getRedisConn():
try:
redis_conn = redis.Redis(host='... | Why isn't Flask catching this exception from a redis connection attempt? | CC BY-SA 4.0 | null | 2023-03-02T21:41:19.560 | 2023-03-02T22:29:03.567 | 2023-03-02T22:29:03.567 | 400,617 | 17,956,704 | [
"python",
"redis"
] |
75,621,083 | 1 | null | null | 0 | 19 | How do I invoke an AWS Step Function using an API Gateway request, and the request's JSON payload to the Step Function?
I need the API Gateway to start a Step Function which then invokes a Lambda function that uses the URL input parameter .
I have tried this by adding a mapping template within the integration request ... | How to invoke an AWS Step Function using an GET API Gateway | CC BY-SA 4.0 | null | 2023-03-02T21:41:23.587 | 2023-03-03T11:54:11.380 | null | null | 7,513,401 | [
"amazon-web-services",
"aws-lambda",
"aws-api-gateway",
"aws-step-functions"
] |
75,621,086 | 2 | null | 75,594,816 | 0 | null | I figured it out. The group by command worked.
| null | CC BY-SA 4.0 | null | 2023-03-02T21:41:27.847 | 2023-03-02T21:41:27.847 | null | null | 21,305,897 | null |
75,621,080 | 2 | null | 72,577,944 | 0 | null | Here is functioning code that works with either grid() or place(). After a bit of restructuring of the OP code, and incorporating comments from martineau and Сергей Кох, it creates root and child windows, with titles.
Assuming from the OP that the child window has only 6 rows and 9 columns, and that the Label goes in t... | null | CC BY-SA 4.0 | null | 2023-03-02T21:40:52.447 | 2023-03-02T21:40:52.447 | null | null | 13,658,996 | null |
75,621,084 | 1 | null | null | 0 | 21 | I have a couple of next.js apps on AWS Elastic Container Service.
I'm using CodePipeline in order to automate the CI/CD process (source is Github, build step is CodeBuild). Everything works perfectly except the "Deploy" step that takes way too much (approx. 10 minutes). I am hosting the docker image on AWS ECR.
What I ... | Deployment to ECS takes a lot of time | CC BY-SA 4.0 | null | 2023-03-02T21:41:26.397 | 2023-03-02T22:10:29.170 | 2023-03-02T22:10:29.170 | 10,183,877 | 10,183,877 | [
"amazon-web-services",
"amazon-ecs",
"amazon-ecr"
] |
75,621,052 | 1 | null | null | 0 | 17 | I have a list of 20 elements, whereby each element is a dataframe containing a pair of spatial points.
I am trying to create a function that calculates the distance between each pair of points.
See reproducible example at the bottom.
The function I tried to write;
```
my_fun <- function(x) {
x %>% rowwise() %>% ... | Calculating distance for pairs of points within a list | CC BY-SA 4.0 | null | 2023-03-02T21:36:46.610 | 2023-03-02T21:45:04.380 | null | null | 9,623,670 | [
"r",
"function",
"distance",
"spatial",
"geosphere"
] |
75,621,089 | 2 | null | 75,620,615 | 1 | null | When an Amazon SQS queue has been configured as a trigger for an AWS Lambda function, the Lambda service automatically retrieves the message(s) from the queue and passes it to the Lambda function via the `event` parameter. (Note: It might contain multiple messages.) The messages are made temporarily invisible.
When the... | null | CC BY-SA 4.0 | null | 2023-03-02T21:42:16.107 | 2023-03-02T21:42:16.107 | null | null | 174,777 | null |
75,621,092 | 2 | null | 75,620,757 | 0 | null | If you fetch the rows slowly, the query plan is still running on SQL Server and may be holding on to memory grants and locks.
And the slow fetching increases the likelihood of a connection failure, especially if the client and SQL Server are not on the same local network.
| null | CC BY-SA 4.0 | null | 2023-03-02T21:42:21.890 | 2023-03-02T21:42:21.890 | null | null | 7,297,700 | null |
75,621,087 | 1 | null | null | 0 | 9 | I a trying to calculate multiple NDVI files from multiple red band files and NIR band files in 2 separated filder with the following code using arcpy:
```
######
import arcpy
from arcpy.sa import *
# set workspace
arcpy.env.workspace = r"F:/..."
# set folder paths
folder1 = r"F:/..."
folder2 = r"F:/..."
# loop throu... | Arcpy - loop through files in 2 folders to calculate multiple NDVI files | CC BY-SA 4.0 | null | 2023-03-02T21:41:33.917 | 2023-03-02T21:42:19.647 | 2023-03-02T21:42:19.647 | 20,200,105 | 20,200,105 | [
"loops",
"raster",
"arcgis",
"arcpy"
] |
75,621,067 | 2 | null | 75,620,794 | 3 | null | Use the following command in your WSL `bash` session in order to perform in-place conversion of a file from `\r\n` (CRLF, Windows-format) to `\n` (LF, Unix-format) newlines (line endings):
```
sed -i 's/\r$//' file.txt
```
Alternatively, if you don't mind reading the file , using GNU `sed`'s `-z` option and the `g` re... | null | CC BY-SA 4.0 | null | 2023-03-02T21:38:43.210 | 2023-03-03T18:30:38.403 | 2023-03-03T18:30:38.403 | 45,375 | 45,375 | null |
75,621,088 | 1 | null | null | 0 | 17 | I am using ngx-online-status in order to get the online status of my application below is the relevant code.
Connection.service.ts
```
import { OnlineStatusService, OnlineStatusType } from 'ngx-online-status';
import {Injectable} from "@angular/core";
@Injectable({
providedIn: 'root',
})
export class ConnectionServi... | ngx-online-status is initally undefiend | CC BY-SA 4.0 | null | 2023-03-02T21:42:13.957 | 2023-03-02T21:42:13.957 | null | null | 4,942,698 | [
"javascript",
"angular",
"typescript"
] |
75,621,096 | 2 | null | 75,594,628 | 0 | null | The global_endpoint is missing the and make sure Toml registration ID matches the DPS registration ID.
| null | CC BY-SA 4.0 | null | 2023-03-02T21:42:52.027 | 2023-03-02T21:42:52.027 | null | null | 5,822,941 | null |
75,621,095 | 1 | null | null | -2 | 24 | I want to know if its possible to decrypt a list and use in dot formatting:
Eg as below:
```
list1 = ["a","b","c"]
str1 = "{}{}{}".format(list1)
```
What should I do to pick each elements from list1 and use in dot formatting?
```
list1 = ["a","b","c"]
str1 = "{}{}{}".format(list1.items())
```
| Dot formatting in Python with list | CC BY-SA 4.0 | null | 2023-03-02T21:42:44.087 | 2023-03-02T23:59:28.407 | 2023-03-02T21:44:41.313 | 1,491,895 | 21,322,077 | [
"python",
"list"
] |
75,621,091 | 1 | null | null | 0 | 25 | I have tried writing thing multiple ways and just end up trading one error for another. We are updating an existing Angular app using Typescript by adding new pages created in React. The basic page component looks like this:
```
const CreateWrapper = () => {
return(
<div>
....
</div>
);
};
export... | Migrating from ReactDom.render() to ReactDOMClient.createRoot() causing errors | CC BY-SA 4.0 | null | 2023-03-02T21:42:19.397 | 2023-03-02T23:13:15.130 | 2023-03-02T23:05:57.757 | 10,982,789 | 10,982,789 | [
"reactjs",
"typescript"
] |
75,621,097 | 2 | null | 75,620,507 | 0 | null | The issue is caused by the path of the img.
Try this :
```
export const dataJson = [
{
id: 1,
name: "forest_walk_dabiediedu_winter.jpg",
src: "../../images/forest_walk_dabiediedu_winter.jpg",
explanation: "dabie is one of the craziest creatures i've ever created. " +
"His ambition to find the in... | null | CC BY-SA 4.0 | null | 2023-03-02T21:43:08.743 | 2023-03-02T21:43:08.743 | null | null | 21,287,266 | null |
75,621,093 | 1 | null | null | 0 | 24 | ```
#!/bin/bash
function check_dgmgrl {
server_address="$1"
dgmgrl_output=$(echo -e "connect /;\nshow configuration;\n" | dgmgrl / | grep "$server_address")
echo "$dgmgrl_output" >> dgmgrl_output.txt
}
function check_srvctl {
export ORACLE_SID="$1"
echo "Service status for database $ORACLE_SID:"
srvctl st... | I want to run this code but I get error : syntax error near unexpected token done '<' | CC BY-SA 4.0 | null | 2023-03-02T21:42:25.047 | 2023-03-02T21:44:20.207 | 2023-03-02T21:44:20.207 | 507,793 | 21,322,064 | [
"bash"
] |
75,621,099 | 2 | null | 75,620,809 | 1 | null | Change your verbosity setting.
Settings > Accessibility > VoiceOver > Verbosity > Punctuation
Set it to "All".
[](https://i.stack.imgur.com/Lj3NF.png)
If you look at "All", you'll see the colon listed (about halfway down the list).
The default is "Some", which does not include the colon.
| null | CC BY-SA 4.0 | null | 2023-03-02T21:43:19.177 | 2023-03-02T21:43:19.177 | null | null | 76,714 | null |
75,621,100 | 1 | 75,621,146 | null | 0 | 54 | I want to pick a random sample group from a list that doesnt contain repetetive elements.
Here is how I do it currently, currDayLevels is a random sample with size 32 picked from levelPrefabs which has a size of 200. It works as intended but I wonder if there is a simpler way to achive it like in matlab's "randsample" ... | Is there a simpler way to pick a random sample group from a list? | CC BY-SA 4.0 | null | 2023-03-02T21:43:22.027 | 2023-03-02T21:54:00.757 | 2023-03-02T21:54:00.757 | 13,913,481 | 13,913,481 | [
"c#",
"arrays",
"list"
] |
75,621,081 | 2 | null | 75,620,911 | 1 | null | You already have the algorithm for calculating the distance between 2 points. You just need to apply that algorithm to your `operator<` (ie, it doesn't belong in `operator-`). Your `operator<` should return `true` if `this` (the left-hand `Point` being compared) is closer to the origin then the input point (the right... | null | CC BY-SA 4.0 | null | 2023-03-02T21:41:16.467 | 2023-03-02T22:22:14.027 | 2023-03-02T22:22:14.027 | 65,863 | 65,863 | null |
75,621,103 | 2 | null | 75,620,962 | 2 | null | By filtering you create another deep copied table that is separate from the original table.
Instead of filtering, you can use `fcoalesce` here. It returns the first non-missing value
```
dat_a[dat_b,
# as numeric to ensure same variable type
values := fcoalesce(values, as.numeric(i.values)),
on = .(p... | null | CC BY-SA 4.0 | null | 2023-03-02T21:43:45.380 | 2023-03-02T21:43:45.380 | null | null | 8,107,362 | null |
75,621,104 | 2 | null | 75,621,017 | 1 | null | This should do the trick:
```
$xml = new SimpleXMLElement("<root><element>text</element></root>");
$element = $xml->xpath('/root/element');
$element[0][0] = "new text";
echo $xml->asXML();
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:43:53.077 | 2023-03-02T21:43:53.077 | null | null | 11,162,567 | null |
75,621,094 | 1 | null | null | 0 | 7 | Q: How do you recommend integrating a dockerized remote kernel in JupyterLab?
# Scenario
There are two systems
1. system J, hosting JupyterLab
2. system D, an independent, network-connected machine for Python development, running in a Docker container with Python and IPython installed in a conda environment "python... | IPython kernel running in a Docker container, that is remote to JupyterLab | CC BY-SA 4.0 | null | 2023-03-02T21:42:35.460 | 2023-03-02T21:42:35.460 | null | null | 12,316,863 | [
"python",
"docker",
"ipython",
"jupyter-lab"
] |
75,621,102 | 1 | null | null | 0 | 21 | I'd like to have a dot product of a DF (multiple columns) and a dictionary with keys matching some of the column names and values that should be used as weights. Here is an example:
```
dic = {'SG_actions': 1, 'SO_actions': 2, 'GS_actions': 3}
```
df =
```
__________________________________________________
| Ag | SG_... | Pyspark dot product of a DF and a dictionary | CC BY-SA 4.0 | null | 2023-03-02T21:43:42.263 | 2023-03-03T10:04:48.407 | 2023-03-03T08:50:53.200 | 1,657,886 | 9,352,430 | [
"python",
"pyspark"
] |
75,621,107 | 1 | null | null | -1 | 38 | I am working on a project in React using VSCode. Today, when I opened the editor, I noticed that some angle brackets '<>' in my code are highlighted in red. The code is working properly though. I am not sure if this is a syntax error or a bug in VSCode. Can anyone provide any suggestions on how to fix this issue? Thank... | Why are angle brackets '<>' highlighted in red in my code in VSCode? | CC BY-SA 4.0 | null | 2023-03-02T21:44:15.910 | 2023-03-02T21:44:15.910 | null | null | 19,956,548 | [
"visual-studio-code"
] |
75,621,108 | 1 | 75,621,426 | null | -2 | 27 | I am trying to change a label on a button click and then after 3 seconds I want it to change back to nothing ("")
my code is this:
```
def apply_click(self):
ui.label_ischanged.setText("Applied!")
```
and I connected it to my button then I used `time.sleep(3)` but I know that it stops the program not in the real t... | Change a label after a specified time | CC BY-SA 4.0 | null | 2023-03-02T21:44:16.227 | 2023-03-02T22:40:51.910 | 2023-03-02T22:40:51.910 | 19,730,003 | 19,730,003 | [
"python",
"pyqt",
"pyqt5",
"qlabel",
"qpushbutton"
] |
75,621,110 | 2 | null | 75,621,095 | 3 | null | `list1` is already the sequence of values you need. What you are missing is the syntax to unpack the list and provide each element as a separate argument to `str.format`:
```
str1 = "{}{}{}".format(*list1)
```
Alternatively, you can pass the list as a single argument and let the format string extract the desired eleme... | null | CC BY-SA 4.0 | null | 2023-03-02T21:44:22.817 | 2023-03-02T21:47:05.443 | 2023-03-02T21:47:05.443 | 1,126,841 | 1,126,841 | null |
75,621,111 | 2 | null | 75,620,850 | 0 | null | You receiver config looks weird. I would use only default:
```
receivers:
otlp:
protocols:
grpc:
```
Debugging:
1.) Enable logging exporter for trace pipeline:
```
exporters:
logging:
verbosity: detailed
...
```
If you see traces in the collector logs, then you can assume app->collector cone... | null | CC BY-SA 4.0 | null | 2023-03-02T21:44:24.190 | 2023-03-02T21:44:24.190 | null | null | 3,348,604 | null |
75,621,112 | 1 | null | null | -3 | 25 | I am trying to upload photos/images on VM in Google Cloud.
Now, I try to use this photo to be published online. However, every time trying to do that the photo doesn't appear and got that error '404 Not Found'.
I would appreciate any help. Thanks
I tried this code
Here is the code I used in SSH, I try to upload the pho... | VM in Google Cloud | CC BY-SA 4.0 | null | 2023-03-02T21:44:28.683 | 2023-03-03T00:20:27.610 | 2023-03-02T21:49:55.153 | 635,608 | 12,892,254 | [
"google-cloud-platform",
"cloud",
"virtual-machine"
] |
75,621,115 | 2 | null | 75,610,209 | 1 | null | I found out the issue: Apparently discord updated a change related to Voice Connections that broke apps sending 70-byte UDP packets to the voice server when using IP Discovery. While the documentation and deprecation were updated in December 2019, there wasn't communication around the the change starting to roll out so... | null | CC BY-SA 4.0 | null | 2023-03-02T21:44:41.180 | 2023-03-02T21:44:41.180 | null | null | 12,289,436 | null |
75,621,116 | 2 | null | 75,621,052 | 0 | null | You can do:
```
sapply(z, function(d) geosphere::distHaversine(d[c("lon", "lat")]))
#> 3 4 8 14 50 60 66
#> 46536.901 43098.454 58490.822 10935.760 210985.491 13013.202 155541.196
#> 100 104 147 153 160 174 ... | null | CC BY-SA 4.0 | null | 2023-03-02T21:45:04.380 | 2023-03-02T21:45:04.380 | null | null | 12,500,315 | null |
75,621,098 | 1 | null | null | 1 | 28 | I have that simple code:
```
const Login = (): JSX.Element => {
const {errors}= useAppSelector(state => state.errorsReducer)
const dispatch = useAppDispatch();
const navigate = useNavigate();
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const onSubmit = (e: FormEv... | Why dispatch works with delay? React Redux | CC BY-SA 4.0 | null | 2023-03-02T21:43:12.313 | 2023-03-04T07:00:41.253 | null | null | 18,929,240 | [
"reactjs",
"typescript",
"redux",
"redux-toolkit"
] |
75,621,109 | 2 | null | 75,621,005 | 1 | null | You can use [abs()](https://www.w3schools.com/sql/func_mysql_abs.asp) function and a join operator to get the data you need.
here is the [query](https://www.db-fiddle.com/f/3sXCgyh3Y5mXBMLnmuay9T/0):
```
select
t1.name,
abs(t1.score1-t2.score1) as score1,
abs(t1.score2-t2.score2) as score2,
abs(t1.score... | null | CC BY-SA 4.0 | null | 2023-03-02T21:44:20.690 | 2023-03-02T21:46:05.503 | 2023-03-02T21:46:05.503 | 21,309,701 | 21,309,701 | null |
75,621,120 | 2 | null | 75,620,793 | 0 | null | It displays properly after replace the CSS code chunks from:
```
```{css style_setting, echo=FALSE}
```
```
to:
```
<style type="text/css">
</style>
```
While it's not consistent to other code chunks, it does work. Hopefully this is something Rstudio can fix in their next update.
| null | CC BY-SA 4.0 | null | 2023-03-02T21:45:28.890 | 2023-03-03T00:29:33.690 | 2023-03-03T00:29:33.690 | 20,524,021 | 20,524,021 | null |
75,621,118 | 1 | null | null | 0 | 14 | Python 3.8
MacOS M1 architecture
paramiko is installed but the following error pops up with it's imported
```
**ImportError: dlopen("path"/venv/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so, 0x0002): tried: '"path"/venv/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so' (mach-o file, but i... | Cannot install paramiko on M1 MacOS | CC BY-SA 4.0 | null | 2023-03-02T21:45:14.307 | 2023-03-02T21:45:14.307 | null | null | 3,012,001 | [
"python",
"macos",
"paramiko",
"apple-m1"
] |
75,621,125 | 2 | null | 75,620,960 | 0 | null | Add this to `inputContainer` or `input` style:
```
alignItems: 'center'
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:46:48.697 | 2023-03-02T21:46:48.697 | null | null | 21,017,967 | null |
75,621,124 | 1 | null | null | 0 | 4 | As comments don't work in Json file, what's the method to suppress Devskim issues in Json file?
Tried the following solution:
Create a new file called .devskim in the root directory of your project if it doesn't already exist. Inside the .devskim file, add a suppressions property with an array of objects representing t... | How to suppress devskim issue in a json file | CC BY-SA 4.0 | null | 2023-03-02T21:46:48.060 | 2023-03-02T21:46:48.060 | null | null | 14,702,135 | [
"security",
"static-analysis"
] |
75,621,121 | 2 | null | 75,621,008 | 0 | null | Implementing `INotifyPropertyChanged` is not enough, you actually have to use it.
See [INotifyPropertyChanged Interface documentation](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged?view=net-7.0) for an example.
```
using System.ComponentModel;
using System.Runtime.CompilerSer... | null | CC BY-SA 4.0 | null | 2023-03-02T21:46:04.260 | 2023-03-02T21:46:04.260 | null | null | 6,572,277 | null |
75,621,122 | 2 | null | 75,620,970 | -1 | null | You can start and stop an async function in JavaScript using a combination of the `mouseenter` and `mouseleave` events and the `clearTimeout` function.
Here's an example implementation:
```
javascript
// Define a variable to hold the timeout ID
let timeoutId;
// Define the async function
async function swiping() {
w... | null | CC BY-SA 4.0 | null | 2023-03-02T21:46:14.320 | 2023-03-02T21:46:14.320 | null | null | 1,811,914 | null |
75,621,105 | 1 | null | null | 0 | 21 | I have a dataset of about 500,000 animals `IndivID` of various species `binSpecies`.
```
Dataset <- data.frame(
IndivID <- (1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
binSpecies <- ("Dog", "Gato", "Canine", "Chienne", "Jument", "Avian", "Caballo", "Dog", "Cat", "Gato")
)
```
Some of the species names in my dataset are outda... | Merging two datasets by the values of three columns in R | CC BY-SA 4.0 | null | 2023-03-02T21:43:56.407 | 2023-03-02T22:00:30.480 | 2023-03-02T21:49:18.983 | 4,341,440 | 21,322,057 | [
"r"
] |
75,621,126 | 1 | null | null | -1 | 11 | As the title says I am struggling to have the manager show. I tried look online and all I could find are self joins. In my case I have two tables.
Instead of the 1, is there anyway I can have it list the manager name instead?
Brad should have a null value since he is the manager and Daimler should have Brad's name list... | MYSQL - How to get employee and their manager to show | CC BY-SA 4.0 | null | 2023-03-02T21:46:55.610 | 2023-03-02T21:48:48.593 | 2023-03-02T21:48:48.593 | 1,491,895 | 21,322,074 | [
"mysql"
] |
75,621,113 | 1 | null | null | 0 | 5 | I have an app that has an entity entitled, "Invoice". Within the Invoice entity, I have a reference to a collection for another entity entitled, "InvoiceLine".
I am using SyncFusion's DataGrid along with DataManager to perform CRUD operations. When I click on an invoice in the datagrid, it displays a component containi... | SyncFusion DataManager not recognizing changes to entity instance within Blazor WASM App | CC BY-SA 4.0 | null | 2023-03-02T21:44:38.547 | 2023-03-02T21:44:38.547 | null | null | 1,678,928 | [
"c#",
"datagrid",
"blazor",
"syncfusion"
] |
75,621,117 | 2 | null | 60,155,668 | 0 | null | After going through hell and back on this issue, I guess I was able to figure out a possible solution. Although this is a very old thread. But I just decided to give a response incase someone comes across this problem like I did, but didn't get any pointers. Ironically, I recently came across a post on Quora about the... | null | CC BY-SA 4.0 | null | 2023-03-02T21:45:13.150 | 2023-03-02T21:45:13.150 | null | null | 6,092,388 | null |
75,621,132 | 1 | null | null | 0 | 4 | why can't open win forms application downloaded online
Hello, I created a simple win forms application, but I have a problem: when I want to send it via gmail, it downloads to my friend, but then he can't open it, does anyone have any ideas on how to send this application remotely? perhaps even through discord
| why can't open win forms application downloaded online | CC BY-SA 4.0 | null | 2023-03-02T21:47:33.593 | 2023-03-02T21:47:33.593 | null | null | 20,886,622 | [
"gmail"
] |
75,621,130 | 1 | null | null | 0 | 38 | I am trying to make Audit return logs, but always returns this error:
> "item has already Been added. Key in dictionary: 'mndo' Key Being added: 'mndo'"
I used these commands to test with a "test" user.
```
USE Clinica_Medica
SELECT * FROM TEST WHERE Nome = 'OI';
```
In Audit the log returns empty and with this error... | "item has already Been added" added in audit | CC BY-SA 4.0 | null | 2023-03-02T21:47:28.203 | 2023-03-02T23:25:02.963 | 2023-03-02T23:25:02.963 | 14,868,997 | 20,728,633 | [
"sql",
"sql-server",
"ssms",
"audit"
] |
75,621,134 | 2 | null | 75,620,960 | 0 | null | I solved the problem by adding `flexDirection: 'row'` to the `inputContainer`.
| null | CC BY-SA 4.0 | null | 2023-03-02T21:47:48.433 | 2023-03-02T21:48:01.127 | 2023-03-02T21:48:01.127 | 15,419,146 | 15,419,146 | null |
75,621,129 | 2 | null | 75,620,956 | 0 | null | I redesigned your code and it works now.
```
import random
print('Welcome!')
print('May I have your name?')
name = input()
print(f'Hello, {name}!')
score = 0
counter = 0
loop = 9
def game():
rand_num = random.randint(1, 100)
global counter
print(f'Question No.{counter+1}: {rand_num}')
text = input("Is... | null | CC BY-SA 4.0 | null | 2023-03-02T21:47:26.573 | 2023-03-02T22:03:01.413 | 2023-03-02T22:03:01.413 | 20,157,443 | 20,157,443 | null |
75,621,135 | 2 | null | 65,321,989 | 0 | null | Just in case it might be helpful for someone.
To target scroll of specific element:
```
const el = document.getElementById('element-id-with-scroll') as HTMLElement;
fromEvent(el, 'scroll')
.pipe(
debounceTime(300)
)
.subscribe(res => console.log(res))
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:47:48.543 | 2023-03-02T21:47:48.543 | null | null | 7,943,893 | null |
75,621,137 | 1 | null | null | 0 | 9 | Actually I want to create live project link in GitHub and I do the steps for that I went to settings and than went to pages and set branch to master and folder to /root and save it but after link is generated and when I opened it. It only loads README.md file not index.html file. Someone please help me.
I want when I c... | I want to create live project link in GitHub | CC BY-SA 4.0 | null | 2023-03-02T21:47:56.967 | 2023-03-02T21:47:56.967 | null | null | 21,322,081 | [
"github"
] |
75,621,133 | 1 | null | null | 0 | 6 | I've just started experimenting with high-quality sound, and as such bought an external headphone DAC.
This DAC support ASIO which works just fine for solo application such as Tidal etc.
Now I've tried to look into how Windows sound is mixed from multiple sources into one stream and send to your speaker system.
And cor... | Dynamic resampling in windows. Common denominator | CC BY-SA 4.0 | null | 2023-03-02T21:47:33.753 | 2023-03-02T21:47:33.753 | null | null | 1,147,321 | [
"audio",
"asio"
] |
75,621,128 | 1 | 75,631,377 | null | 0 | 67 | I have this macro for GCC and CLANG working just fine
```
#if defined(__clang__)
#define BENCHMARK_DONT_OPTIMIZE [[clang::optnone]]
#elif defined(__GNUC__) || defined(__GNUG__)
#define BENCHMARK_DONT_OPTIMIZE [[gnu::optimize(0)]]
#elif defined(_WIN32)
#define BENCHMARK_DONT_OPTIMIZE __pragma(optimize("",off))
#else
#de... | Is there a single function "do-not-optimize" attribute that can be used with Microsoft Visual Studio compilers? | CC BY-SA 4.0 | null | 2023-03-02T21:47:23.610 | 2023-03-03T19:56:21.487 | null | null | 19,642,884 | [
"c++",
"visual-c++"
] |
75,621,131 | 1 | null | null | 0 | 16 | I am creating some automation software for our company that dynamically creates pages on a Multipage depending on some data within a chosen excel file. I have controls set up on the object viewer with events to trigger (ie DblClick a ListBox or ComboBox).
[This is my base UserForm with a Parent Multipage which contains... | Copying Event Triggers for Copied Control to New Multipage | CC BY-SA 4.0 | null | 2023-03-02T21:47:28.910 | 2023-03-02T21:47:28.910 | null | null | 7,543,579 | [
"excel",
"vba",
"object",
"events",
"copy"
] |
75,621,127 | 1 | null | null | 0 | 38 | I wonder if it's possible to pick a specific attribute from module outputs, knowing that I'm using a loop when I call the module.
The sequence is:
1. call backup_policy module with a for_each on a map
2. policies are created and their id are provided in module output
3. call vm module and specify in the call the polic... | Terraform - retrieve specific attribute from module outputs when using a for_each in the call | CC BY-SA 4.0 | null | 2023-03-02T21:47:22.463 | 2023-03-03T07:49:26.767 | null | null | 14,369,505 | [
"azure",
"terraform"
] |
75,621,138 | 2 | null | 68,364,356 | 0 | null | Unfortunately, this failure with no message is the default behavior you see when you're using `jest-environment-puppeteer` and the page in the browser has an unhandled global error thrown.
[You can disable this behavior](https://github.com/argos-ci/jest-puppeteer/tree/main/packages/jest-environment-puppeteer#jest-puppe... | null | CC BY-SA 4.0 | null | 2023-03-02T21:47:58.710 | 2023-03-02T21:47:58.710 | null | null | 8,582,339 | null |
75,621,144 | 1 | null | null | 0 | 14 | I'm using Grape API with Ruby on Rails. I would like to invoke a POST endpoint in Api::A from an endpoint in Api::B, where both are mounted under the Api class.
```
class Api < Grape::API
mount Api::A
mount Api::B
end
class Api::Base < Grape::API
# common functionality
end
# contains endpoints pertaining to ent... | RoR Grape API | How to invoke an endpoint in one API from another? | CC BY-SA 4.0 | null | 2023-03-02T21:49:01.657 | 2023-03-02T21:57:35.007 | 2023-03-02T21:57:35.007 | 8,005,367 | 8,005,367 | [
"ruby-on-rails",
"ruby-grape"
] |
75,621,141 | 2 | null | 75,619,893 | 1 | null | You can use jinja templates and embedded JS inside the HTML
Python
```
@app.route('/')
def home():
return render_html('home.html', state_dark=state_dark)
```
HTML
```
<script>
let state_dark = "{{state_dark}}"
let darkMode;
if (state_dark == "None") {
darkMode = window.matchMedia && window.matchMedia('... | null | CC BY-SA 4.0 | null | 2023-03-02T21:48:31.170 | 2023-03-02T21:48:31.170 | null | null | 19,708,567 | null |
75,621,140 | 2 | null | 75,604,322 | 0 | null | > ```
GET_INPUT PROC FAR
MOV AH, 1
MOV SI, TURN
INT 16H
MOV INPUT[SI], AL
GET_INPUT ENDP
```
- `mov ah, 1``int 16h``mov si, TURN`-
For your timeout on the player's turn, you can use a couple of nested loops like I wrote in below code snippet.
```
GET_INPUT PROC FAR
;; push ...
mov bx, 364 ; Timeout of 20... | null | CC BY-SA 4.0 | null | 2023-03-02T21:48:10.843 | 2023-03-02T21:48:10.843 | null | null | 3,144,770 | null |
75,621,139 | 2 | null | 446,663 | 0 | null | I looked at this an other posts trying to come up with a nice way for a JSON over HTTP backend API with Spring RestControllers calling services etc. I know this is old post, but here's what we did:
We defined an Enum like this:
```
public enum Error {
ERROR_0001("0001", "A %s is required for this operation."), ... | null | CC BY-SA 4.0 | null | 2023-03-02T21:48:05.170 | 2023-03-02T21:48:05.170 | null | null | 3,669,400 | null |
75,621,147 | 2 | null | 75,606,797 | 0 | null | The issue was that I was returning Results.ok() when I should have returned Results.File()
```
using (var memoryStream = new MemoryStream())
{
await blobClient.DownloadToAsync(memoryStream);
//memoryStream.Seek(0, SeekOrigin.Begin);
return Results.File(memoryStream.ToArray()... | null | CC BY-SA 4.0 | null | 2023-03-02T21:49:23.297 | 2023-03-02T21:49:23.297 | null | null | 18,708,498 | null |
75,621,146 | 2 | null | 75,621,100 | 0 | null | You can use the [Fisher-Yates shuffle algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle).
```
List<GameObject> currDayLevels = new List<GameObject>(levelPrefabs);
int n = currDayLevels.Count;
while (n > 1)
{
n--;
int k = Random.Next(0, n + 1);
GameObject temp = currDayLevels[k];
curr... | null | CC BY-SA 4.0 | null | 2023-03-02T21:49:16.330 | 2023-03-02T21:51:59.667 | 2023-03-02T21:51:59.667 | 5,649,561 | 5,649,561 | null |
75,621,150 | 1 | null | null | 0 | 6 | I have created a 3D model from a set of images using the Alice-Vision Meshroom, but I want to know if I can resize this model using Blender or any other program.
I want to resize it to be the size of another image or to another object
| Can I rescale or resize a 3D model that was created from a set of images? | CC BY-SA 4.0 | null | 2023-03-02T21:49:49.907 | 2023-03-02T21:49:49.907 | null | null | 21,322,083 | [
"3d",
"computer-vision",
"artificial-intelligence",
"blender",
"meshroom"
] |
75,621,142 | 1 | 75,621,571 | null | 0 | 23 | I am trying to have a function choose 1 person in the Cast Members Array to be the killer for the game and once that killer is picked, it will remove that killer from the castMember player array.
So the killer is removed from the survivors array and added as their own variable to call for future functions
I tried to us... | Killer removed from castMembers array | CC BY-SA 4.0 | null | 2023-03-02T21:48:59.007 | 2023-03-02T23:06:16.307 | 2023-03-02T22:45:33.553 | 21,283,559 | 21,283,559 | [
"javascript",
"arrays",
"function",
"for-loop",
"variables"
] |
75,621,151 | 1 | null | null | 1 | 40 | I have the following code in my Xamarin.iOS project:
```
public void sendEmail(NSData pdfData)
{
sharedItems[0] = pdfData;
var activityController = new UIActivityViewController(sharedItems, null);
activityController.PopoverPresentationController.SourceView = this.View;
activityController.PopoverPresent... | UIActivityViewController not working after iOS 16 update | CC BY-SA 4.0 | null | 2023-03-02T21:50:08.533 | 2023-03-02T21:50:08.533 | null | null | 1,136,506 | [
"xamarin",
"xamarin.ios"
] |
75,621,155 | 1 | null | null | 1 | 21 | I have created a database using SQL Server Management Studio v18. My authentication method is set to SQL Server authentication.
I am trying to run `Scaffold-Dbcontext` command from the Package manager console like this:
```
Scaffold-DbContext "Password=dummy;Persist Security Info=True;User ID=dummy;Initial Catalog=Some... | Scaffold-Dbcontext failed - The server was not found or was not accessible | CC BY-SA 4.0 | null | 2023-03-02T21:50:24.363 | 2023-03-03T05:12:12.237 | 2023-03-03T05:12:12.237 | 13,302 | 17,767,715 | [
"sql-server",
"entity-framework-core",
".net-7.0"
] |
75,621,152 | 1 | 75,621,354 | null | 1 | 27 | I am rendering a few cards on my page that all lead to the same page like this:
```
{
notes.map((card)=>(
<div key={card.id} onClick={()=> navigate('/EditNotes', {card})}>
<NoteCard title={card.NoteTitle} bgColor={card.CardColor} />
</div>
))
}
```
In the `navigate('/EditN... | React - Redirect with navigate(), send props to page | CC BY-SA 4.0 | null | 2023-03-02T21:50:08.573 | 2023-03-02T22:19:23.897 | null | null | 12,774,586 | [
"reactjs"
] |
75,621,148 | 1 | null | null | 0 | 55 | I was trying to understand how to use `Task` in Swift. So I have a few related questions
From reading online I found that you don't need to use `weak self` inside a `Task` as long as you are that the `Task` will end. But wasn't that the case with `DispatchQueues` too? For example if you make a network call
```
Task {
... | Retain cycles with MainActor and async/await | CC BY-SA 4.0 | null | 2023-03-02T21:49:28.647 | 2023-03-04T20:48:27.233 | null | null | 4,539,192 | [
"swift",
"async-await"
] |
75,621,149 | 1 | null | null | 0 | 19 | I have read through the docs and couldn't find anything about accessing the original/expected/unedited `return_value` of the `foo_hello` function and use it to make assertions. The best I could come up with is getting the parameters from the `call_args` and recalling the function. Using `side_effect` itself calls `foo_... | Is it possible to reference the original return_value of unmocked function without needing to recall the function? | CC BY-SA 4.0 | null | 2023-03-02T21:49:37.047 | 2023-03-03T17:42:07.083 | 2023-03-03T17:42:07.083 | 8,237,877 | 15,910,778 | [
"python",
"python-3.x",
"unit-testing",
"python-unittest",
"python-unittest.mock"
] |
75,621,158 | 2 | null | 34,544,489 | 1 | null | I had the same issue with polish chars and had to use UTF-16 vs UTF-8.
```
var xml= "小塚ゴシック Pro"
var file = new File(output);
file.encoding = "UTF-16";
file.open("w");
file.write(xml);
file.close();
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:50:36.367 | 2023-03-02T21:50:36.367 | null | null | 1,284,224 | null |
75,621,145 | 2 | null | 56,437,335 | 0 | null | This is my approach to solving this in SwiftUI using NavigationLink and tags. I'm pretty new to programming so please be polite :)
1. Create Custom Button to be implemented later on: struct CustomButton: View {
@State private var selection: String? = nil
var title: String
var subtitle: String
var tag: String
var bo... | null | CC BY-SA 4.0 | null | 2023-03-02T21:49:09.693 | 2023-03-02T21:49:09.693 | null | null | 18,486,824 | null |
75,621,161 | 2 | null | 75,620,977 | 0 | null | I posted the same question to the WordPress Reddit and got the answer so I want to document it here.
> Just remove all the capabilities stuff if you're setting everything to true, which is the default anyway. [https://developer.wordpress.org/reference/functions/register_post_type/#capabilities](https://developer.wordpr... | null | CC BY-SA 4.0 | null | 2023-03-02T21:50:58.777 | 2023-03-02T21:50:58.777 | null | null | 6,557,335 | null |
75,621,156 | 1 | 75,621,243 | null | 0 | 26 | I have a linked list with the node and list method thats:
```
class Node:
def __init__(self, value):
self._value = value
self._next = None
class LinkedList():
def __init__(self):
self._head = None
def add(self, node):
node._next = self._head
self._head = node
de... | how to find the first node smaller than a given value in a linked list python | CC BY-SA 4.0 | null | 2023-03-02T21:50:27.410 | 2023-03-02T22:21:59.153 | 2023-03-02T22:21:59.153 | 5,459,839 | 20,579,620 | [
"python"
] |
75,621,165 | 2 | null | 75,617,467 | 0 | null | Try this:
```
$gpoPath = get-gpo -Name "Test - GPO" | select -ExpandProperty Path
$object = [adsi]"LDAP://$gpoPath"
$object.gPCUserExtensionNames
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:51:52.070 | 2023-03-02T21:51:52.070 | null | null | 21,281,198 | null |
75,621,162 | 1 | null | null | 0 | 46 | I am trying to write generic method, which should parse `JToken` to concrete type, by using implicit conversion operator.
I've got my implicit operator like this:
```
public static implicit operator CategoryDto(JToken token)
{
var result = new CategoryDto
{
//Mapping here
};
```
And method with ge... | Implicit conversion operator with generic type | CC BY-SA 4.0 | null | 2023-03-02T21:51:08.710 | 2023-03-02T22:55:02.773 | 2023-03-02T21:57:09.223 | 11,683 | 10,886,518 | [
"c#",
"generics",
"implicit-conversion"
] |
75,621,164 | 1 | 75,621,509 | null | 0 | 29 | I have a dictionary.
```
import pandas as pd
d = {
'A':pd.DataFrame(
{'Age' : [5,5,5],
'Weight' : [5,5,5]}),
'B':pd.DataFrame(
{'Age' : [10,10,10],
'Weight' : [10,10,10]}),
'C':pd.DataFrame(
{'Age' : [7,7,7],
'Weight' : [10,10,100]}),
}
d
```
I wou... | Merge a large dictionary into a single dataframe | CC BY-SA 4.0 | null | 2023-03-02T21:51:42.827 | 2023-03-02T22:48:08.863 | null | null | 2,088,027 | [
"python",
"pandas"
] |
75,621,157 | 1 | 75,621,173 | null | 0 | 29 | I'm looking for a good struct pattern in python. The `NamedTuple` class constructor is what I want. Consider the following:
```
class MyStruct(NamedTuple):
prop1: str
prop2: str
prop3: Optional[str] = "prop3" # should allow default values
prop4: Optional[str] = "prop4"
...
# allow this
struct = MyStruct(pro... | Mutable NamedTuple in python | CC BY-SA 4.0 | null | 2023-03-02T21:50:31.790 | 2023-03-02T21:55:05.693 | null | null | 500,343 | [
"python",
"python-3.x",
"types"
] |
75,621,136 | 1 | null | null | -1 | 38 | I'm trying to use an API that is returning the below:
Everything works but the 'contacts'. When I'm decoding it sees this as a string and not as data. Any ideas on how to decode the contacts correctly?
[](https://i.stack.imgur.com/EH5GB.png)
```
struct Location: Codable, Identifiable {
let id: String
let name: ... | Decoding weird JSON in Swift | CC BY-SA 4.0 | null | 2023-03-02T21:47:48.793 | 2023-03-03T02:45:34.220 | 2023-03-03T02:45:34.220 | 3,890,041 | 3,890,041 | [
"json",
"swift",
"api",
"decode"
] |
75,621,168 | 2 | null | 75,620,456 | 1 | null | For your [sample project](https://github.com/kristofferous/stackof.git), right-click in the file, [Modify Run Configuration](https://i.imgur.com/63bTsx8.png).
Set Working directory to the root project directory (where `.env` file is located).
Set JavaScript file to the location of the file you want to run relative to t... | null | CC BY-SA 4.0 | null | 2023-03-02T21:52:03.323 | 2023-03-02T22:00:35.637 | 2023-03-02T22:00:35.637 | 104,891 | 104,891 | null |
75,621,167 | 2 | null | 75,620,714 | 2 | null | > I need to make the C5 returns 1 (True). And return False only if * is in the A cell.
If this is your goal, then your title is a [XY problem](https://xyproblem.info/). The easiest way to do this is using [REGEXMATCH](https://support.google.com/docs/answer/3098292?hl=en).
```
=NOT(REGEXMATCH(A2,"\*"))
```
This formula... | null | CC BY-SA 4.0 | null | 2023-03-02T21:51:59.237 | 2023-03-02T21:51:59.237 | null | null | 17,887,301 | null |
75,621,173 | 2 | null | 75,621,157 | 3 | null | You can use `@dataclass`:
```
from dataclasses import dataclass
from typing import Optional
@dataclass
class MyStruct:
prop1: str
prop2: str
prop3: Optional[str] = "prop3"
prop4: Optional[str] = "prop4"
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:52:39.423 | 2023-03-02T21:53:01.213 | 2023-03-02T21:53:01.213 | 1,126,841 | 9,513,184 | null |