FAQ Database Discussion Community


Can this promise nesting be changed to chaining?

javascript,angularjs,nesting,chaining,angular-promise
This is the pseudo scenario | then (items) | then (items, actions) getItems() | getActions(for:items) | apply(actions -> items) :promise | :promise | model <= items | | :synchronous So in words: I need to get a list of global items. Fine. Items fetched. Make a request for actions that...

Does java.util.Properties support nested properties?

java,nesting,properties-file
I'm trying to set up environment-specific properties in a file, customized for each device running the code. I'd like to be able to nest some properties in others, for example: browser=chrome baseUrl=${server}/app/login.do server=http://localhost I'd like to be able to get http://localhost/app/login.do when I get the baseUrl property. Does java.util.Properties support...

Generating multiple html tags from one custom tag

css,html5,nesting
I basically want to be able to write something like: <mycustomtag>bob</mycustomtag> And have it generate: <div>I'm a template <h2>bob</h2> </div> Is it even possible to do such a thing? Note that I am not looking to do this with JS, really just plain HTML/CSS. Is such a thing even possible,...

Simplify nesting promises in protractor [duplicate]

javascript,angularjs,promise,protractor,nesting
This question already has an answer here: How do I access previous promise results in a .then() chain? 6 answers I have a canvas with unknown dimensions and position. I want to simulate clicking onto specific coordinates based on the dimensions and position of the canvas in protractor. The...

Detecting incorrect nesting of XML tags in Python

python,xml,nesting
A question about testing proper nesting of XML tags: I got a list of tags, extracted from top to bottom from an xml file: Closing tags are clearly indicated by forward slash /to and /lastname tags are incorrectly nested. They should be switched. /lastname should be within to, /to parent...

Access nested associative array by array of strings

php,arrays,indexing,nesting
So basically i would like to transform code like $my_array = []; $cur_string = ['a', 'b', 'c', 'd']; $v = 'Hello world!'; To something like: $my_array['a']['b']['c']['d'] = $v; I tried something like: foreach( $cur_string as $cur ) { if ( !isset( $current[ $cur ] ) ) { $current[ $cur ]...

java - Implementing Adjacency lists using Arraylist

java,arraylist,nesting
This is what i have : class Node { Integer value; ArrayList<Integer> adjList; public Node(Integer val, ArrayList<Integer> l) { value = val; Collections.sort(l); adjList = l; } } This is what i want : class Node { Integer value; ArrayList<Node> adjList; public Node(Integer val, ArrayList<Integer> l) { value = val;...

Error with YAML deep nesting

yaml,nesting
I wanted to create a config file in YAML that stores a few translations. To encapsulate everything, I began to nest the options. While parsing the file, I see the following error: Failed to read data from customize.yaml\customize.yaml: yaml: line 30: mapping values are not allow ed in this context...

Django advanced nesting urls

django,url,overlap,nesting
Welcome, I've got a problem where I`m trying to make a deep nesting. The thing is that I have Menu that has SUBMENU that can have multiple categories and those categories can have multiple services available and those services can have multiple products. Writing urls for that specific thing was...

Errors when nesting IF() formulas

excel,formula,nesting
I'm just putting together a simple spreadsheet that calculates tax owed based on a few different bands. I have an 'Invoiced Amount' cell that takes up the yearly invoicing and then applies a tax rate to it based on the following conditions: If 'Invoiced Amount' is below 10, 600 then...

Less css nesting?

css,less,mixins,nesting
I have some issues with nesting in Less, here is my less .edit-qa-table { thead { tr { th:first-child + th { text-align: center; } } tbody { tr { th:first-child + th { text-align: center; } } } .thead-append { th:first-child { width: 45%; } &:first-child + th +...

Emulate nested in

without actually nesting

html,css,layout,nesting
I've got to fix a page that has an href image in the h1 tag, like so: <h1>Header text <a href="example.com"><img src="image.png"></a></h1> and the page looks fine as is. However, having a link in the h1 tag is doing bad things to my SEO, so I need to separate them....

Find String Inside Outermost Parenthesis

c++,string,nesting,parentheses,repetition
Say that I have a string which contains both multiple sets and nesting of parenthesis. I want to extract only the string in the first parenthesis encountered, including whatever nested parenthesis it contains. For example: this (is(maybe)) a test (and maybe not) I want to extract: is(maybe) I believe this...

Cancancan authorisation of nested resources

ruby-on-rails,nesting,cancancan
I've an Account model which "has many" Users and also "has many" Meters. The Meter object has an account_id column so it's easy to define an ability for this in Cancancan: if user can :crud, Meter, :account_id => user.account_id end However, a Meter also "has many" Parameter. I want to...

Nesting a flat list

php,arrays,file,nesting
I've spent almost all day trying to convert this flat list of category into a nested list, as it should be, since its a 5-level deep category list. Here's an example: $array = array ( array ( 'CategoryID' => '001', 'CategoryLevel' => '1', 'CategoryName' => 'Category 1', 'CategoryParentID' => '001'...

Nested JSF Composite Components leading to a Stack Overflow exception

jsf,jstl,stack-overflow,composite-component,nesting
The problem When I attempt to nest a Composite Component within itself, with some logic to end the infinite recursion I receive a stack overflow exception. My understanding is that <c:xxx> tags run at view build time so I was not expecting to have an infinite view build as I...

Problems retrieving nested data from json

javascript,html,json,loops,nesting
I am working on a small project and i made the following json data -> http://www.smartbustracking.be/json/data.json. The following below code loops through my json data. I can successfully read the "busuur" but not the nesting of bussen. Am i writing the code wrong of is my syntax not correct <script...

Issues with using if/else statements correctly in C language

c,if-statement,nesting
I am still very new to programming, so I am not sure the correct action to take. I can't seem to get the program to display a different option when selected by the user. Either the first option displays, or it shows the 'Invalid Entry' text. I am only going...

ractivejs component nesting

custom-component,nesting,ractivejs
The documentation seems to indicate that it is possible to nest custom components within other custom components (http://docs.ractivejs.org/latest/components) : <Foo on-Bar.foo="barfooed" on-Baz.*="baz-event" on-*.bippy="any-bippy"> <Bar /><Baz /><Baz /> </Foo> However, the following code only displays the tooltip. The inner custom components al-tt-translation, and al-tt-input are not initialized. In fact, replacing those...

Iterative brute-force sudoku solver

java,nesting,sudoku
I am trying to implement an iterative Sudoku solver. To avoid recursion I used a stack, but I'm having problems with its management. The starting board is represented by a String array (variable 'input' in the following code) in which each element is composed of 3 numbers: the [row, col]...

Recursive function in Python: Best way to get a list of specific nested items

python,dictionary,nesting
I have a tree of nested dictionaries. This is an small extract, just to give you an idea: db = { 'compatibility': { 'style': { 'path_to_file': 'compatibility/render/style.py', 'checksum': { '0.0.3':'AAA55d796c25ad867bbcb8e0da4e48d17826e6f9fce', '0.0.2': '55d796c25ad867bbcb8e0da4e48d17826e6f9fe606',}}}, 'developer': { 'render': { 'installation': { 'path_to_file': 'developer/render/installation.py', 'checksum': { '0.0.1': 'c1c0d4080e72292710ac1ce942cf59ce0e26319cf3'}}, 'tests': { 'path_to_file': 'developer/render/test.py', 'checksum': {...