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
106
votes
14 answers

Why/when should you use nested classes in .net? Or shouldn't you?

In Kathleen Dollard's 2008 blog post, she presents an interesting reason to use nested classes in .net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the people writing FxCop rules aren't stupid, so there must…
Eric Haskins
  • 8,505
  • 12
  • 38
  • 47
105
votes
3 answers

Rails nested form with has_many :through, how to edit attributes of join model?

How do you edit the attributes of a join model when using accepts_nested_attributes_for? I have 3 models: Topics and Articles joined by Linkers class Topic < ActiveRecord::Base has_many :linkers has_many :articles, :through => :linkers,…
Arcolye
  • 6,968
  • 4
  • 34
  • 28
100
votes
5 answers

How can I update a property of an object that is contained in an array of a parent object using mongodb?

I'm using MongoDB to be my database. i have a data: { _id : '123' friends: [ {name: 'allen', emails: [{email: '11111', using: 'true'}]} ] } now, i wanna to modify user's friends' emails ' email, whose _id is '123' i write like…
allen wang
  • 1,087
  • 2
  • 7
  • 16
92
votes
1 answer

Cannot access field in Big Query with type ARRAY>

I'm trying to run a query using Standard SQL Dialect (ie not Legacy SQL) on BigQuery. My query is: SELECT date, hits.referer FROM `refresh.ga_sessions_xxxxxx*` LIMIT 1000 But keep getting the error Error: Cannot access field referer on a value…
Feynman27
  • 3,049
  • 6
  • 30
  • 39
87
votes
26 answers

Javascript: how to dynamically create nested objects using object names given by an array

I hope someone can help me with this Javascript. I have an Object called "Settings" and I would like to write a function that adds new settings to that object. The new setting's name and value are provided as strings. The string giving the setting's…
David
  • 1,005
  • 1
  • 10
  • 12
85
votes
6 answers

Is there an overhead when nesting functions in Python?

In Python, if I have a child function within a parent function, is the child function "initialised" (created) every time the parent function is called? Is there any performance overhead associated with nesting a function within another?
XåpplI'-I0llwlg'I -
  • 21,649
  • 28
  • 102
  • 151
80
votes
5 answers

Nested list comprehension with two lists

I understand how the simple list comprehension works eg.: [x*2 for x in range(5)] # returns [0,2,4,6,8] and also I understand how the nested list comprehesion works: w_list = ["i_have_a_doubt", "with_the","nested_lists_comprehensions"] # returns…
André Caldas
  • 845
  • 1
  • 7
  • 8
79
votes
1 answer

Nested templates with dependent scope

What is dependent scope and what is the meaning of typename in the context of the following error? $ make g++ -std=gnu++0x main.cpp main.cpp:18:10: error: need 'typename' before 'ptrModel >::Type' because…
user383352
  • 5,033
  • 4
  • 25
  • 20
75
votes
2 answers

Understanding nested list comprehension

I want to understand nested list comprehension. Below, I listed a list comprehension expression and their for loop equivalent. I wonder if my understanding is correct on those. For example, [(min([row[i] for row in rows]),max([row[i] for row in…
eugene
  • 39,839
  • 68
  • 255
  • 489
75
votes
4 answers

Why can't I create an enum in an inner class in Java?

What I try to do is this: public class History { public class State { public enum StateType { Eclipse gives me this compile error on StateType: The member enum StateType must be defined inside a static member type. The error disappears…
Steven Roose
  • 2,731
  • 4
  • 29
  • 46
75
votes
5 answers

How to yield results from a nested generator function?

I have a function which yields results as it downloads them. For the purposes of this question, lets say I yield a sting once every second but I want a convenience function to wrap my generator: import time def GeneratorFunction(max_val): for i…
Jon Cage
  • 36,366
  • 38
  • 137
  • 215
71
votes
6 answers

accepts_nested_attributes_for child association validation failing

I'm using accepts_nested_attributes_for in one of my Rails models, and I want to save the children after creating the parent. The form works perfectly, but the validation is failing. For simplicity's sake imagine the following: class Project <…
Ryan Townsend
  • 1,015
  • 1
  • 9
  • 15
71
votes
10 answers

Nested ifelse statement

I'm still learning how to translate a SAS code into R and I get warnings. I need to understand where I'm making mistakes. What I want to do is create a variable which summarizes and differentiates 3 status of a population: mainland, overseas,…
balour
  • 741
  • 1
  • 6
  • 8
70
votes
4 answers

Styling nested elements in WPF

Suppose you have a nested element structure, for example a ContextMenu with MenuItems: ... You can easily apply styles…
gix
  • 5,737
  • 5
  • 34
  • 40
69
votes
4 answers

HTML tags inside

I have a table in a page that consists of checkboxes in the cells on the left and descriptions in the cells on the right. The "description" contains h4 headers and plain text. I want to make that whole description (everything inside ) a…
SaltyNuts
  • 5,068
  • 8
  • 48
  • 80