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

How does nested if/then/elseif work in bash?

How does the syntax work in bash? This is my pseudocode for C style if else statements. For instance: If (condition) then echo "do this stuff" elseif (condition) echo "do this stuff" elseif (condition) echo "do this stuff" …
Andrew Tsay
  • 1,893
  • 6
  • 23
  • 35
37
votes
2 answers

Dynamic nested Material menu from json object in Angular 5

How to create dynamic nested menu from json object? I started using Angular Material Design today for the first time and I'm trying to create nested menus using material design. The documentation is pretty straight forward for static stuff. But I…
rain01
  • 1,194
  • 1
  • 16
  • 25
37
votes
11 answers

Replacing nested if statements

This is related to a chapter from beautiful code. And in that chapter I read about the nested ifs. The author was talking about deeply nested ifs as originator of bugs and less readable. And he was talking about replacing nested ifs with case…
Biswanath
  • 9,075
  • 12
  • 44
  • 58
36
votes
9 answers

How to recursively replace character in keys of a nested dictionary?

I'm trying to create a generic function that replaces dots in keys of a nested dictionary. I have a non-generic function that goes 3 levels deep, but there must be a way to do this generic. Any help is appreciated! My code so far: output = {'key1':…
Bas Tichelaar
  • 397
  • 1
  • 4
  • 6
35
votes
2 answers

Objects inside objects in javascript

I'm somewhat new to Javascript, so maybe this is just a noob mistake, but I haven't found anything that specifically helps me while looking around. I'm writing a game, and I'm trying to build an object for the pause menu. One of the things I would…
Michael Taufen
  • 1,704
  • 1
  • 17
  • 22
35
votes
14 answers

Counting depth or the deepest level a nested list goes to

A have a real problem (and a headache) with an assignment... I'm in an introductory programming class, and I have to write a function that, given a list, will return the "maximum" depth it goes to... For example: [1,2,3] will return 1, [1,[2,3]]…
dhcarmona
  • 402
  • 2
  • 10
  • 29
35
votes
9 answers

Is there a recursive version of the dict.get() built-in?

I have a nested dictionary object and I want to be able to retrieve values of keys with an arbitrary depth. I'm able to do this by subclassing dict: >>> class MyDict(dict): ... def recursive_get(self, *args, **kwargs): ... default =…
jayhendren
  • 4,286
  • 2
  • 35
  • 59
34
votes
4 answers

Nested preferences.xml

Is it somehow possible to include one preferences.xml into another, like it can be done for layouts with the tag? Let's say:
GrAnd
  • 10,141
  • 3
  • 31
  • 43
34
votes
3 answers

Elasticsearch: nested object under path is not of nested type

I've been trying to search on my document which contains a nested field. I created the nested mapping like this: { "message": { "properties": { "messages": { "type": "nested", "properties": { "message_id": {…
Daniel Buckle
  • 628
  • 1
  • 9
  • 19
34
votes
3 answers

Rails: How to modify tests for a nested resource?

While learning Rails I've created an application with a Domains controller nested below a Customers controller. I'm using Rails 2.3.4 and it's been a learning experience. I managed to get the below routing set up: customer_domains GET …
Martijn Heemels
  • 3,529
  • 5
  • 37
  • 38
33
votes
5 answers

Update nested map dynamodb

I have a dynamodb table with an attribute containing a nested map and I would like to update a specific inventory item that is filtered via a filter expression that results in a single item from this map. How to write an update expression to update…
Nico Müller
  • 1,784
  • 1
  • 17
  • 37
33
votes
4 answers

I can "pickle local objects" if I use a derived class?

The pickle reference states that the set of objects which can be pickled is rather limited. Indeed, I have a function which returns a dinamically-generated class, and I found I can't pickle instances of that class: >>> import pickle >>> def f(): ...…
fonini
  • 2,989
  • 3
  • 21
  • 39
32
votes
2 answers

Check what element the cursor is on upon mouseleave() with jQuery?

I have a set of list elements (
  • within a
      ) laid out as bubbles on a chart like this, where the bubbles are the
    • elements: https://i.stack.imgur.com/PR7vR.png I want to be able to detect the difference between Moving the mouse from…
  • Tyler Nieman
    • 375
    • 1
    • 4
    • 9
    32
    votes
    8 answers

    In Java, how do I access the outer class when I'm not in the inner class?

    If I have an instance of an inner class, how can I access the outer class from code that is not in the inner class? I know that within the inner class, I can use Outer.this to get the outer class, but I can't find any external way of getting…
    Kip
    • 107,154
    • 87
    • 232
    • 265
    32
    votes
    8 answers

    A better way to use AutoMapper to flatten nested objects?

    I have been flattening domain objects into DTOs as shown in the example below: public class Root { public string AParentProperty { get; set; } public Nested TheNestedClass { get; set; } } public class Nested { public string…
    John
    • 511
    • 1
    • 5
    • 10