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

Splitting a nested dictionary into several dicts

I want to split the following, nested dictionary into different dictionaries by language AND create a new JSON-File/Dictionary for each language. Afterwards I would like to merge them back together. Grateful for any suggestions how to…
3
votes
1 answer

How do I safely lock this property?

I have partial C# code for a blocking queue that looks like this: private bool flushed; private object _locker = new object(); public bool Flushed { get { lock (_locker) { return flushed; } } set { lock (_locker) { …
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
3
votes
2 answers

Get the count sum of an associated model in CakePHP

This is a little bit hard to explain, so I'll try to be as clear as possible. In my CakePHP project, suppose I have a model called Country, and Country has a hasMany association to Region. Now, the Region also has a hasMany association to User,…
Jimmie Lin
  • 2,205
  • 2
  • 23
  • 35
3
votes
0 answers

find and update property of nested object with lodash

I have been scanning through stackoverflow topics and couldn't find answer to the problem i am having. What i need to do is to find object inside nested (2 depths) array by some of the values and then update other of its values. I managed to put…
Mevia
  • 1,517
  • 1
  • 16
  • 51
3
votes
2 answers

How to append elements from a multi-dimensional list into 2nd multi-dimensional list

I am trying to append elements from a multi-dimensional list into a 2nd multi-dimensional list. Here is the code I wrote - my_list = [[['b', ['a'], 'c'], ['d', ['a', 'b'], 'e']], [['j', ['a', 'f']], ['q', 't']]] ref_list = [[['q', 'w',…
user16457847
3
votes
2 answers

r - how do I print ggplot objects from a nested tibble in a reactable with expandable rows?

I have a tibble in R with nested rows and I created a ggplot object per row. I would like to print these graphics using reactable's expandable rows feature. I think an example will explain this best. I'll use iris for simplicity. First, we take…
user1713174
  • 307
  • 2
  • 7
3
votes
1 answer

How to partition a list based on (sublist) indices of another list in Python

I have two lists, one containing some unique elements (integers in my case) and the other containing indices that indicate into which sublist of a newly created nested list the elements should be inserted. elements = [1, 2, 3, 4, 5, 6] indices = …
eltings
  • 57
  • 6
3
votes
5 answers

Accessing elements of nested list

What is the wrong with my code: l = ['a', ['bb', ['ccc', 'ddd'], 'ee', 'ff'], 'g', 'h'] for i in l: for j in i: print(j)` The output is: a bb ['ccc', 'ddd'] ee ff g h. But I want this output: a bb ccc ddd ee ff g h. What changes should be…
3
votes
1 answer

Flatten nested dictionary to key/value pairs with Ansible

--- - hosts: localhost vars: mydict: key1: val1 key2: val2 key3: subkey1: subval1 subkey2: subval2 tasks: - debug: msg: "{{ TODO }}" How would I make the above debug message print out all…
Joshua Gilman
  • 1,174
  • 4
  • 16
  • 32
3
votes
2 answers

PHP nested foreach

I thought that I understood php arrays, but it seems I don't :( This is my code:
Jorge
  • 259
  • 1
  • 7
  • 15
3
votes
1 answer

In APL how to turn a string into a one cell vector

So, I have a function f that takes a string as input. I want to create a function g that maps f to a vector of strings. I.e. g 'Hello' 'world' should yield (f 'Hello')(f 'world') Here's what I did: g ← {f¨⍵} And this works just fine for the…
3
votes
1 answer

Using nested package type as type's private part declaration

package P is type T is private; private package NP is type T is null record; end NP; end P; It is possible to use NP.T as full declaration of P.T?
3
votes
2 answers

In App Engine for Python, is it possible to persist a class with another object nested inside it?

In App Engine for Python, is there anything like Objectify (Java Library) where I can easily embed a class within another and save it to the datastore? This class would be modeled like the following example where a Venue contain a Location object. …
Sam Edwards
  • 874
  • 8
  • 19
3
votes
1 answer

Convert a nested list into rows using python

I am experiencing a scenario where my indigenous recursive implementation program output's a nested list, very similar to a tree. The nested list designed is an abstraction of a complicated structure. What I would require, is to resolve the nested…
PIngu
  • 115
  • 1
  • 10
3
votes
2 answers

Why are reference types "slower" when used as generic type arguments in .NET 5?

Today I ran into this issue: When using reference types as type arguments for a outer generic type, other methods in nested types are slower by a factor ~10. It does not matter which types I use - all reference types seem to "slow" the code down.…
sneusse
  • 1,422
  • 1
  • 10
  • 18