Questions tagged [nested]

This tag relates to any of various nested entities or operations in programming.

This tag relates to any of various nested entities in programming, including but not limited to:

  • Nested data structures
  • Nested queries
  • Nested calls to a procedure, subroutine, method or operation

For example, nesting queries in SQL means to create a subquery. Its result is used in the query itself and provides a query order and subsets.


Related tags :

16389 questions
3
votes
2 answers

Append to a nested list in a list of dicts under conditions

I have 2 lists that share information. First, I want to have a unique set of names (e.g.list_person has repeated name values); For this I produce a new list of dictionaries. Then, I want to add/append list_pets['pet'] to the correct…
blah
  • 674
  • 3
  • 17
3
votes
1 answer

CSS grid nested elements

I have a problem with the css grid. I don't know if it is possible at all. My DOM looks like:
Item i want to nested
Item 1
Item 2
Lukf
  • 35
  • 5
3
votes
2 answers

Is this a Nested class?

I came across this piece of code while I was working on a project, this was reported as a bug for something. public class Test { public static Test ONE = new Test() { @Override public int value() { return 1; …
user14528515
3
votes
1 answer

How to avoid using a double loop to improve this method?

I was asked in an interview to rewrite this method without the nested for-loop. All I knew apart from this was that the arrays are of the same size. What's a good way to approach this ? public int addTwo(int[] first, int[] second) { int result =…
user15317516
3
votes
1 answer

Print list elements by 1 column and 1 row, then 1 column and 2 row and so on till end of the list

This is my list: numbs = [[1, 2, 3], [2, 3, 4], [4, 5, 6]] I want it to print like this: 1 2 4 2 3 5 3 4 6 I have tried using: for xs in numbs: print(" ".join(map(str, xs))) But it prints this instead: 1 2 3 2 3 4 4 5 6
wildling
  • 33
  • 4
3
votes
2 answers

R dataframe to nested list

I want to convert a dataframe in this format (tbl) to the following nested list (tbllst): library(tidyr) tbl <- tribble( ~Col1, ~Col2, ~Col3, "Var1", "Var1_1", "Var1_1_1", "Var1", "Var1_1", "Var1_1_2", "Var1", "Var1_2", "Var1_2_1", …
Jerwin Wieser
  • 115
  • 1
  • 1
  • 6
3
votes
2 answers

How to use for loops with nested lists?

Here is an example (with dummy numbers) of a nested list with three levels: mylist <- list("A" = list("A1" = list("1", "2", "3"), "A2" = list("10", "20", "30")), "B" = list("B1" =…
Tom
  • 97
  • 7
3
votes
1 answer

Nested/threaded comments system - MongoDB and Java

I am currently building a charity student support website, to help African students that want to apply to American Universities. I want to build a threaded comments system. I was planing on using MongoDB, (backend is all java). I'm fairly new to…
Anthony Silva
  • 195
  • 1
  • 14
3
votes
1 answer

Nested struct in templated class with std::map::const_iterator?

The folowing code generates a syntax error at the line where the iterator is declared: template class A { public: struct B { int x, y, z; }; void a() { std::map::const_iterator itr; //…
Dennis
  • 35
  • 2
3
votes
1 answer

Using v-model inside nested v-for

I am trying to use multiple carousel components inside card components with nested v-for loops but I’m having trouble figuring out the correct way to assign the carousel v-model so that it’s unique and doesn’t update all the carousels when the slide…
3
votes
1 answer

Access nested values in JSON-Object in VBA

I would like to get data from a JSON-Object, that I got from a Rest-API, with VBA to display some data into an Excel-Worksheet. I'm using the library (VBA-JSON v2.3.1 JsonConverter). I have the following JSON-Object: { "devices": [ { …
Ivan1102
  • 55
  • 1
  • 6
3
votes
1 answer

How to access second-level nested enum passed as parameter in Swift

Trying to access the value of a double-nested enum in Swift that is passed in as a parameter to the first enum. I'm not sure how to access the CutStyle; within the for loop in shareSalad, each ingredient that is iterated over does not have a .dot…
Elliot
  • 83
  • 7
3
votes
1 answer

PHP nested menu security question

From a novice: In looking to display a modified nested menu of How to create a nested menu from MySQL with PHP?. My question is: are there any security concerns in taking this kind of approach. From my novice point of view this code is server-sided…
crash_course
  • 127
  • 2
  • 12
3
votes
6 answers

Print Nested Dictionary in Table Format

I am trying to print my nested dictionary in a table format. But have not been able to do so. The table is a list of student names and student grades. I would like it to be in a "Report Card" type format that is easy to read. The for loop I am using…
PythonCoder1981
  • 403
  • 9
  • 19
3
votes
2 answers

LINQ filter by attribute nested in 3 lists

I am kind of new to working with LINQ and ran into a problem which I can't seem to solve. So I basically need to filter on an attribute of an object that is nested inside three lists. The Data (as a JSON) looks as follows: [ { …
Snoopy111
  • 212
  • 4
  • 13