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
3 answers

Why don't my nested if and else statements work?

All I want to be able to do is validate an email every time the user enters a new character into the input field. When the input field is empty, it shouldn't show anything, but when it contains letters, it should show where the invalid characters…
Andy Lobel
  • 3,356
  • 9
  • 31
  • 40
3
votes
1 answer

Create nested JSON from flat csv

Trying to create a 4 deep nested JSON from a csv based upon this example: Region,Company,Department,Expense,Cost Gondwanaland,Bobs Bits,Operations,nuts,332 Gondwanaland,Bobs Bits,Operations,bolts,254 Gondwanaland,Maureens…
spadeisaspade
  • 61
  • 1
  • 4
3
votes
1 answer

How to include an id in the nested form?

I have a nested form ,and i want to include city_id in the stores model,is this <%= s.hidden_field :city_id, @city.id %> correct? If yes what do i add in the controller after that? If it is not a correct way to include it can anybody show me the…
3
votes
1 answer

How to use AutoMapper for mapping with nesting properties?

I have 2 tables [Customer] [Sale] and related with each others, I try to map Sale to SaleDto and show with customer name. Customer Model public class Customer { public int Id { get; set; } public string Name { get; set; } public…
3
votes
2 answers

mySQL - Pass id to nested query

I am trying to get the sum of the sums of two different columns from the same table, grouped by user. The problem is, one of sums I have to find, requires some additional paramters. Table 1: userid, fname, lname Table 2: assigned_to (is = to userid…
JimmyJammed
  • 9,598
  • 19
  • 79
  • 146
3
votes
3 answers

Singleton reference and recursion in PHP

I have a main bootstrap class (singleton1 in the example bellow) that instantiates some singleton classes. In those singleton classes, I need to keep a reference to the app main class for easy and quick reference to it, but doing so gives me…
3
votes
3 answers

Can't initialize struct with nested pointers to other structs

I'm using a third party library which defines this struct: typedef struct { unsigned short nbDetectors; //! structure of detector status struct DetectorStatus { unsigned int lastError; //< last detector internal…
dario_ramos
  • 7,118
  • 9
  • 61
  • 108
3
votes
1 answer

Stuck on this function

def moves_to_nested_dict(moves: list[list[str]]) -> dict[tuple[str, int], dict]: """ Convert into a nested dictionary representing the sequence of moves made in the games. Each list in corresponds to one game, with…
kakuro
  • 31
  • 5
3
votes
1 answer

Css class nesting and grouping

What is the difference between #id .A.B x { } #id .A .B y { } in CSS file? Both A and B are classes. x and y are some tags Does the spacing between .A and .B have any significance?
Ron
  • 319
  • 1
  • 3
  • 10
3
votes
2 answers

jq possible to use has() with nested keys?

is it possible to use the jq has() function with nested keys jq -r -c 'has("a.b")' <<< '{"a":{"b":"hello"}}' this returns as false, I have also tried has("a|b") has("a[b]")
art vanderlay
  • 2,341
  • 4
  • 35
  • 64
3
votes
2 answers

Modify 2d array to create nested datasets when specific key is encountered

I have an input array like this $input = [ ["relation" => "OR"], ["color" => 'green'], ["color" => 'yellow'], ["relation" => "AND"], ["color" => 'black'], ["color" => 'orange'], ["relation" => "OR"], ["color" =>…
3
votes
2 answers

Get nested type properties using reflection

As part of a test I am trying to compare similar objects using reflection. The objects may or may not have multiple levels of nested params. For example: public class Connection{ public string Ip{get; set} public string Id{get; set} …
3
votes
3 answers

Nested Dictionary Creation - Python

I have a dictionary setup like this: company = {'Honda': {} ,'Toyota':{} ,'Ford':{} } I have a list containing data like this: years = ['Year 1', 'Year 2', 'Year 3'] Finally, I also have a list of lists containing data like this: sales =…
eclipsedlamp
  • 149
  • 9
3
votes
2 answers

What would a python list (nested) parser look like in pyparsing?

I would like to understand how to use pyparsing to parse something like a nested Python list. This is a question to understand pyparsing. Solutions that circumvent the problem because the list of the example might look like JSON or Python itself…
Sergej Herbert
  • 753
  • 1
  • 7
  • 15
3
votes
4 answers

reducing nested object key value inside an an array

i have the following arrays array1 = [ {a:{key:1 , value: 10} , b:{key:1 , value:12} , c:{key:1 , value: 5} , d:{key:1 , value:2}}, {a:{key:2 , value: 10} , b:{key:2 , value:12} , c:{key:2 , value: 5} , d:{key:2 , value:2}}, {a:{key:3 ,…
xtyy
  • 37
  • 5