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
69
votes
6 answers

What happens when nesting elements with position: fixed inside each other?

Okay, I've noticed something, but couldn't find it in the CSS spec. Styling an element with position: fixed will position it absolutely, with respect to the browser viewport. What happens if you place a fixed-position element inside another? Example…
user146570
67
votes
9 answers

Ruby: merge nested hash

I would like to merge a nested hash. a = {:book=> [{:title=>"Hamlet", :author=>"William Shakespeare" }]} b = {:book=> [{:title=>"Pride and Prejudice", :author=>"Jane Austen" }]} I would like the merge to…
user1223862
  • 1,193
  • 2
  • 9
  • 10
67
votes
8 answers

Nested functions in Java

Are there any extensions for the Java programming language that make it possible to create nested functions? There are many situations where I need to create methods that are only used once in the context of another method or for-loop. I've been…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
67
votes
3 answers

Return value from nested function in Javascript

I have a function that is set up as follows function mainFunction() { function subFunction() { var str = "foo"; return str; } } var test = mainFunction(); alert(test); To my logic, that alert should return…
Chris Armstrong
  • 3,585
  • 12
  • 42
  • 47
65
votes
3 answers

How to sort OrderedDict of OrderedDict?

I'm trying to sort OrderedDict in OrderedDict by 'depth' key. Is there any solution to sort that Dictionary ? OrderedDict([ (2, OrderedDict([ ('depth', 0), ('height', 51), ('width', 51), ('id', 100) ])), (1,…
Damian Gądziak
  • 895
  • 1
  • 9
  • 12
62
votes
16 answers

How to set object property (of object property of..) given its string name in JavaScript?

Suppose we are only given var obj = {}; var propName = "foo.bar.foobar"; How can we set the property obj.foo.bar.foobar to a certain value (say "hello world")? So I want to achieve this, while we only have the property name in a…
chtenb
  • 14,924
  • 14
  • 78
  • 116
60
votes
3 answers

ldap nested group membership

Is it possible to create an LDAP query which will return (or check for) users in a nested group? e.g. UserA is a member of GroupA, and GroupA is a member of GroupB. I want a query on GroupB to return that UserA is a member. LDAP only. The server is…
askvictor
  • 3,621
  • 4
  • 32
  • 45
60
votes
2 answers

Django nested transactions - “with transaction.atomic()”

I would like to know if I have something like this: def functionA(): with transaction.atomic(): #save something functionB() def functionB(): with transaction.atomic(): #save another thing Someone knows what will…
Lara
  • 2,170
  • 6
  • 22
  • 43
60
votes
9 answers

How do nested functions work in Python?

def maker(n): def action(x): return x ** n return action f = maker(2) print(f) print(f(3)) print(f(4)) g = maker(3) print(g(3)) print(f(3)) # still remembers 2 Why does the nested function remember the first value 2 even though…
eozzy
  • 66,048
  • 104
  • 272
  • 428
60
votes
2 answers

understanding nested generic classes in C# with quiz

While talking with a colleague about C#, he showed me some C# code which I had to predict the output of. This looked simple in the first place, but it wasn't. I can not really understand why C# acts this way. The code: public class A { …
Memet Olsen
  • 4,578
  • 5
  • 40
  • 50
59
votes
2 answers

Angular ui-router - how to access parameters in nested, named view, passed from the parent template?

Hi I am trying to access a parameter in the controller "ViewWorklogCrtl" while using ui-router and running into difficulty. Basically, my parent template contains: a(ui-sref="instance-ticket.worklog({id:{{ticket.testnum}}})") show and then further…
hzane
  • 737
  • 1
  • 8
  • 9
59
votes
6 answers

Best way to create nested HTML elements with jQuery

If I need to create a couple of nested DOM elements, I know one way to do it, is to write them as long string and then place them in the document using a suitable jQuery function. Something like: elem.html( '
Maverick
  • 1,988
  • 5
  • 24
  • 31
56
votes
6 answers

How to search nested objects with Elasticsearch

OK, I've not been able to figure this out thus far. Hoping someone can offer some insight. Given the documents below, how would I search for all documents with a video that has "test" in the video title? I'm using the HTTP API. (Basically, how do…
swatkins
  • 13,530
  • 4
  • 46
  • 78
56
votes
5 answers

How to destack nested tuples in Python?

How to convert the following tuple: from: (('aa', 'bb', 'cc'), 'dd') to: ('aa', 'bb', 'cc', 'dd')
Cory
  • 14,865
  • 24
  • 57
  • 72
55
votes
2 answers

Nesting

won't work while nesting

I usually won't nest

like this:

The following:

one

two

and I will nest like that using
instead. But today I used

but it seems that both Emacs and Google Chrome both would consider the outer

closed as…

nonopolarity
  • 146,324
  • 131
  • 460
  • 740