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
27
votes
1 answer

Vue - access nested childs using ref

I have vue component which I use inside himself - data can have array with subelements and I use this array to render them in loop, and next level, next level etc. according to nesting level. Now I would like to run child method from parent and then…
lukasamd
  • 651
  • 2
  • 8
  • 17
27
votes
2 answers

How to mock nested / multiple layers of return objects in python

I'm currently struggling to find a good way of mocking multiple layers / nested return values. In other words, I want to return a magic mock that in turn returns a magic mock with it's own set return values. I'm finding this relatively cumbersome…
Ric W
  • 2,232
  • 2
  • 18
  • 12
27
votes
1 answer

Nested type in Elasticsearch: "object mapping can't be changed from nested to non-nested" when indexing a document

I try to index some nested documents into an Elasticsearch (v2.3.1) mapping which looks as follows (based on this example from the documentation): PUT /my_index { "mappings": { "blogpost": { "properties": { "title": { "type":…
Dirk
  • 9,381
  • 17
  • 70
  • 98
27
votes
4 answers

In Python, how to make sure database connection will always close before leaving a code block?

I want to prevent database connection being open as much as possible, because this code will run on an intensive used server and people here already told me database connections should always be closed as soon as possible. def…
cregox
  • 17,674
  • 15
  • 85
  • 116
27
votes
7 answers

python "TypeError: 'numpy.float64' object cannot be interpreted as an integer"

This is the code which is produing the error: import numpy as np for i in range(len(x)): if (np.floor(N[i]/2)==N[i]/2): for j in range(N[i]/2): pxd[i,j]=x[i]-(delta*j)*np.sin(s[i]*np.pi/180) …
user3700852
27
votes
2 answers

Nested blocks in Django templates

The master template in my Django app looks like this: {% block parent %} Some text... {% block child %} Default content here... {% endblock child %} ...some more text {% endblock parent %} Now, this template should be…
Boldewyn
  • 81,211
  • 44
  • 156
  • 212
26
votes
2 answers

MySQL INSERT with multiple nested SELECTs

Is a query like this possible? MySQL gives me an Syntax error. Multiple insert-values with nested selects... INSERT INTO pv_indices_fields (index_id, veld_id) VALUES ('1', SELECT id FROM pv_fields WHERE col1='76' AND col2='val1'), ('1', SELECT id…
netiul
  • 2,737
  • 2
  • 24
  • 29
26
votes
12 answers

Python: How to match nested parentheses with regex?

I'm trying to match a mathematical-expression-like string, that have nested parentheses. import re p = re.compile('\(.+\)') str = '(((1+0)+1)+1)' print p.findall(s) ['(((1+0)+1)+1)'] I wanted it to match all the enclosed expressions, such as…
Cinco
  • 275
  • 1
  • 3
  • 6
26
votes
2 answers

Is in-class enum forward declaration possible?

I know that in C++11 it's possible to forward declare an enum type (if storage type is provided) e.g. enum E : short; void foo(E e); .... enum E : short { VALUE_1, VALUE_2, .... } But I would like to forward declare an enum defined…
tommyk
  • 3,187
  • 7
  • 39
  • 61
26
votes
3 answers

Less css, nested attributes, :hover::after

Is it possible to do this with less? a { &:after { background: red; } &:hover { &:after { background: blue; } } } I can't get the :after to change color when hovering over a?
Philip
  • 6,827
  • 13
  • 75
  • 104
25
votes
2 answers

React Hook Form: Submit a form with nested components or extract fields of nested components to submit

I have a form with multiple components in it (with each being either a functional or a class based component) containing multiple input fields or radio buttons. When I submit the form I either want to submit the fields that are nested into…
Ahmed
  • 2,966
  • 7
  • 42
  • 69
25
votes
1 answer

Updating a field with a nested array in Elastic Search

I am trying to update a field in a document with an array. I want to add an array to the field "products". I tried this: POST /index/type/1/_update { "doc" :{ "products": [ { "name": "A", "count": 1 …
user3407300
  • 419
  • 1
  • 5
  • 12
25
votes
3 answers

Get all keys of a nested dictionary

I have the below code which currently just prints the values of the initial dictionary. However I would like to iterate through every key of the nested dictionary to initially just print the names. Please see my code below: Liverpool = { …
Krishn
  • 813
  • 3
  • 14
  • 28
25
votes
2 answers

Elastic Search nested multimatch query

So my problem is basically the same as described here, however it still remains unanswered on the group. My mapping: { "abstract": { "properties": { "summary": { "type": "string" } } …
stpk
  • 2,015
  • 1
  • 16
  • 23
25
votes
1 answer

How to understand and use `` , in JavaFX?

It says tag fx:root has been added to javafx 2.2, but I don't understand how to use it, although with this sample: http://docs.oracle.com/javafx/2/fxml_get_started/whats_new2.htm main.xml
Freewind
  • 193,756
  • 157
  • 432
  • 708