142,006 questions
0
votes
0
answers
23
views
How should I configure a pathfinding algororithim for my new level generation program
my problem is that I have a 2D array like this:
[["#", "#", "#", "#", "#", "#", "#", "#", "#", "#&...
1
vote
2
answers
53
views
Scanning a list according to the elements in the list (Python)
This is a homework question, I've tried several ways to solve, but I haven't been able to make progress in, and I would appreciate any tips, and help in general.
The question: we are given a list of ...
0
votes
0
answers
36
views
Print list given by user [closed]
How can we print the same list of the numbers in the output given by the user by using the loop before print the answer in c++?
Example:
Find the largest number in the list
We can get the list of the ...
-4
votes
1
answer
46
views
Making a List with Arithmetic Progression [duplicate]
[Doing an assignment where I have to have to run the formula a(n) = 2*n - 5 (n>=1)] 100 times and have those in a list so that I can grab terms and compare and bunch of other stuff. This is what my ...
0
votes
1
answer
11
views
Excel validate entries in list of lists
I have a master list of things (column A below), and I have a list of lists (column C below), where all sub-entries should exist in the master list. I would like to validate the list of lists (in ...
0
votes
1
answer
6
views
Order the choice column of a sharepoint list when a user selects the choices out of order
I have a multiple selection column in a SharePoint list that has eleven options. If a user selects any of the eleven selections is there a way to order them in a certain order when they submit the ...
0
votes
0
answers
30
views
Python - Pandas matching two json API dumps as dataframes
I'm a network admin working on a small project at work using Cisco's Meraki API wrapper for Python
The end goal is to have a dashboard that displays the amount of authenticated users on a single ...
1
vote
1
answer
25
views
CMake: how to find all matching entries in list
I have a CMake list with thousands of entries, where I want to find (not remove!) all duplicates. Is there a clever way without looping through the whole list and do a lot of searches?
My problems:
...
0
votes
0
answers
8
views
GraphicsPath element in List <>
I have defined the class Intersection as:
// ******************************************** class Intersection
public class Intersection
{
public string name { get; set; }
public ...
-1
votes
0
answers
43
views
Is it possible to use one line if-then in Python list comprehension? [duplicate]
I need to remove spaces from each element in this Python list:
x = ['abc', ' ', ' space ', 3]
I could do this:
v = []
for i in x:
if type(i) == str:
v.append(i.strip())
else:
...
-4
votes
0
answers
27
views
I want to add a number value to a element in a list [closed]
I am creating a game with different characters and I have all the characters in a list. I want to add different numerical values to each character in the list as a type of health-bar. And then I want ...
-1
votes
0
answers
62
views
Why this string list/vector is not getting updated
I am trying to add items to a string list by one button and print the list by another button. A minimal reproducible example is as follows:
use fltk::{app, button::Button, prelude::*, window::Window};
...
-1
votes
2
answers
90
views
When deleting my circular linked list class, the L variable turns into random addresses
I'm making a circular linked list class in C++, everything works as expected, except for when i delete an object made based on my class. In the destructor, i'm deleting every single element plus the L ...
1
vote
1
answer
101
views
What should typing be for __add__ in a subclass of list?
This is a simplification of my code:
# my_list.py
from __future__ import annotations
class MyList(list[int]):
def __add__(self, other: list[int]) -> MyList:
return MyList()
mypy says:
...
0
votes
0
answers
36
views
flatten-tree flattens lambda body
I'm trying to flatten list. To simplify things, examples below flatten already-flat-list.
(flatten-tree (list :hoge (lambda () 42)))
;; => (:hoge lambda 42)
flatten-tree seems to flatten "...
-2
votes
1
answer
52
views
ensure unique tuple is returned from the list of tuples [closed]
In a given list below, I want to ensure that the tuple occur uniquely. The tuple I have has two elements only. Tuple containing more than two elements are out of the scope
original_list :
[("a&...
0
votes
2
answers
47
views
how to access the original nested list after modifying it in loop? [duplicate]
I am modifying the nested list and adding to an array now when I modify nested list it behaving very strangely, I am missing something very small but don't know what.
class Square {
constructor() {
...
1
vote
2
answers
63
views
Convert list of integers into a specific string format
I'm dealing with a list of integers that represent the pages in which a keyword was found. I would like to build block of code that converts this list into a string with a specific format that follow ...
-2
votes
0
answers
20
views
How to write a function involving lists and recursion [closed]
how do you write a racket function? how does car, cdr, cadr, caddr, etc work in that type of function and what does it do normally? how do you find the length of a list vs an atom?
I've done some ...
3
votes
2
answers
85
views
Efficient algorithm that returns a list of unique lists given a list of of lists as input
Given a python list of lists containing numbers i.e lists = [ [1, 2], [2, 1], [3, 4] ], the problem is to return a list of all unique lists from the input list. A list is considered a duplicate if it ...
0
votes
1
answer
35
views
Batch-update adjacent elements in a Vec in Rust (for performance)
I'm building a little graphics library using minifb, essentially just drawing pixels to a framebuffer.
Currently, my code for blitting a rectangle to a Texture is as follows:
fn blit(&self, dest: &...
-5
votes
0
answers
65
views
imputation reading columns from character list and compilation average [closed]
geo <- c("AT","BE","CZ","DE")
time <- c(2020, 2020, 2021,2021)
EltA1 <- c(150, NA, 120,NA)
EltA2 <- c(60, 70, 80,NA)
EltA <- c(...
0
votes
3
answers
95
views
How do I store data from a file into two lists?
I need to read data from a file game.txt and append the data into two lists. The first list should hold the player's name and the second list should hold the high score.
Also, this is for school and I'...
-3
votes
2
answers
55
views
Extracting string from ann email body
I'm using python to extract the information provided from the body of an email using imap.
Part of the email that interests to my code:
"BOT ID: 4824CF8B-2986-11EC-80F0-84A93851B964"
I can ...
-4
votes
0
answers
26
views
Loop changes list that it should not [duplicate]
I'm writing weights mutator for my neural network. "distribute_genome" function should slightly mutate best genome and return it.
import random
best_genome = [[1, 2, 3], [4, 5, 6]]
def ...
-2
votes
1
answer
46
views
Replace dash and increment for number of mines adjacent [closed]
I'm trying to replace the dashes in this 2d list for number of mines adjacent
grid = [["-", "-", "-", "#", "#"],
["-", "#",...
0
votes
0
answers
26
views
I am trying to convert .shx files to Python lists
I want to make a world map in pygame, but it doesn't work.
I tried this method of explode():
gdf = gp.read_file('ne_10m_admin_0_countries.shx')
coords = []
for geom in gdf.explode()['geometry']:
...
1
vote
1
answer
80
views
Weird C Syntax for implementing a List
I am programming on the NXP RT1170 chip using their SDK (Free Scale Library). While working with their CMOS Sensor Interface (CSI) driver, I encountered an unusual syntax that I couldn't understand, ...
2
votes
1
answer
43
views
How to dynamically adjust ylim in base R plots?
I have a list of data (see below), which I represent graphically using this script:
# Define plotting parameters
pch_values <- c(16, 17) # Different symbols for beta_0 and beta_1
colors <- c(&...
0
votes
1
answer
16
views
How do I use a multivaluearg in cmake so it prints as one string in an echo command?
I have a function which takes a list of arguments that I want to pass to a function in a target. Only when I try to use that multivalueargs, it places the second and further arguments on the following ...
-3
votes
0
answers
25
views
Sort list of keys (Python) [duplicate]
I have a dictionary with the following keys in a list (ListOfKeys = list(MyDict.keys())):
['1002', '1008', '1012', '1016', '1020', '1026', '103', '1030', '1034', '1038', '1044', '1048', '1052', '1056',...
0
votes
1
answer
12
views
Creating Sidemenu from a List
Hi I have a sharepoint site , There i have created a List now i want to create a sidemenu from this List. Basically when we add item in the list it shows up as a nav menu in side bar .
The list items ...
1
vote
1
answer
33
views
Android: List my app's own files is not working on Android 11+
I'm storing mp3, mp4, jpg and an app own aw format on app's cache dir and using the next piece of code to clear that tmp files after they're used:
private fun deleteTmp() {
val rootFolder = File(...
1
vote
2
answers
57
views
List overrides previous structures in list
I am trying to make an IT ticket system which allows for a user to input the name, the email, the date, the priority of the issue, and the issue description. It then allows the user to either add ...
0
votes
0
answers
33
views
1:1 pairs of elements from two lists within a for loop in R [duplicate]
I have two lists, list1 and list2, and I need to loop through a series of 1:1 pair within a for loop. For examples,
list1 <- c('1', '2', '3')
list2 <- c('a', 'b', 'c')
What I want is to use 'a' ...
-4
votes
2
answers
74
views
Sort a list of lists when one of the sort items is text month
I am trying to sort this list of lists by the year and then by month,I can get the years part sorted but am stuck when I try to do secondary sort by month. I have created a dict and a list to try to ...
0
votes
2
answers
40
views
How to Find Unique Pairs in a List That Add Up to a Target Sum in Python?
I’m trying to write Python code to find all unique pairs from a list of numbers where the sum of each pair equals a specific target. So far, my basic idea looks like this:
def find_unique_pairs(...
-1
votes
0
answers
24
views
make nested list with single line of code [duplicate]
Good Morning,
I have the following code to make a list of a list as an example. I can easily make the code in the following way:
innerl=[]
for outer in range(4):innerl.append([inner for inner in range(...
0
votes
3
answers
57
views
Check if specific value in a series is NaN
I have a Dataframe where I want to derive a Boolean column based on some other columns, including a check on whether a particular column is NaN:
def secret_sauce(my_row):
if (pd.isna(my_row["...
0
votes
0
answers
11
views
How can I get the index to update after removing a book from my list
This is a snippet of my code and i want to be able to ge the Id to update to the correct position of each element after removing a book from my list, not sure how to achieve this.
Right now if i try ...
1
vote
1
answer
69
views
My column values show as (lists) and not (character/numeric/integer) after using pivot_wider
A disclamire before I start, I am still very new to R; therefore, if I am using wrong terminology, please feel free to correct me, and if more information is needed to solve this, please let me know.
...
2
votes
2
answers
61
views
Nested list into data frame
I have not found an example that applies to my specific problem, but feel free to label as duplicate if needed.
I have a nested list like the following:
nested_list <- list(
ID1 = list(
FEAT =...
1
vote
0
answers
34
views
How to correctly set orderHint to preserve checklist item order in Microsoft Planner via Power Automate?
Title:
How to correctly set orderHint to preserve checklist item order in Microsoft Planner via Power Automate?
Question:
I'm working on a Power Automate flow that clones a Microsoft Planner bucket, ...
1
vote
0
answers
51
views
Adding items to a list but getting duplicated values
So I have a class called LedColChangeDate2 that has a constructor that takes a number of parameters. Within this class is a list of it's own classes ( see code if that don't make sense ).
In another ...
1
vote
2
answers
51
views
Printing a list without nil on common lisp
I am still stuck whit this. I'm trying to print a list of elements that are between two limits in Common Lisp. I wrote two functions to do this. In the first one I check if the element is inside the ...
0
votes
1
answer
85
views
Java: Remove a collection of objects (for ex the info about a vehicle with ID xxx) from a list and return removed objects to new list
I want to remove a collection of objects from a List, the removed objects should be added to new list and returned. The expected return of removed object (car) when outprinted look like for ex:
[...
-2
votes
3
answers
81
views
How can I merge two dictionaries in Python without losing any data? [duplicate]
I'm trying to merge two dictionaries in Python, but I'm having trouble ensuring that data from both dictionaries is preserved. If a key exists in both dictionaries, I want to combine their values into ...
0
votes
0
answers
18
views
Angular Material - how to inject pageable list into component
I have an app with several CRUD pages which will involve multi-select options. Ideally, I would like to have a component that does a sort standardish side by side list of available options on the ...
0
votes
2
answers
32
views
TCL - A condition for an item while appending items to a list
I have this list
set csv [list]
lappend csv [list \
a \
b \
c \
[expr {[cfg::get enable_all_columns]
? {
d
}
: {}
}] \
e \
f \
g]
I need to add element d only if enable_all_columns is 1. The problem ...
0
votes
1
answer
44
views
Batch processing multiple excel files in folder via python script and outputting into folder, while ignoring other file types
Each week our inventory reporting software outputs 15+ different inventory reports (one for each vendor respectively) in .xlsx format into one folder.
All the excel sheets are in an identical format ...