nested

MYSQL WHERE-IN Subquery Runs Forever

折月煮酒 提交于 2019-12-05 05:20:51
I have a MySQL table. Let's call it Widgets. The Widget table has 3 fields: id , type_id , and name . I want, in one query, to get all the widgets that share a type_id with the Widget named 'doodad'. I've written 2 queries: Give me the type_id of the widget with the name 'doodad'. Give me all widgets with that type_id. This works. Each query, independently achieves its goal. But when I combine them into a single nested query, it runs forever, infinite loop style. It looks like this: SELECT * FROM widgets WHERE type_id IN ( SELECT type_id FROM widgets WHERE name = 'doodad' ); Can anyone explain

Module.nesting within instance_eval/exec or module_eval/exec

做~自己de王妃 提交于 2019-12-05 05:07:59
I came up with this question when I was trying to answer this . The following is an expected behaviour: module A p Module.nesting end # => [A] But the following: A.instance_eval{p Module.nesting} A.instance_exec{p Module.nesting} A.module_eval{p Module.nesting} A.module_exec{p Module.nesting} all return [] . Why do these not work as the above? Additional Question Mu is too short suggested an interesting point. If that is correct, then Module.nesting would be one of the methods and variables that are dependent on the literal context like Method#source_location , __FILE__ . Is this understanding

Angular: Pass Component to a Component

北慕城南 提交于 2019-12-05 04:43:57
I have this small gridComponent: @Component({ selector: 'moving-grid', templateUrl: './grid.component.html', styleUrls: ['./grid.component.css'] }) export class GridComponent { @Input('widgets') extComponents: Array<Component>; } And a second testComponent @Component({ selector: 'test', template: ` <div #content>I say hello<li>i</li><li>u</li><button (click)="test()">click me</button> world</div> ` }) export class TestComponent { @ViewChild('content') content: HTMLElement; getContent() { return this.content; } test() { console.log("test"); } } Now I'm trying to pass multiple instances of

Term, nested documents and must_not query incompatible in ElasticSearch?

一笑奈何 提交于 2019-12-05 04:09:29
I have trouble combining term, must_not queries on nested documents. Sense example can be found here : http://sense.qbox.io/gist/be436a1ffa01e4630a964f48b2d5b3a1ef5fa176 Here my mapping : { "mappings": { "docs" : { "properties": { "tags" : { "type": "nested", "properties" : { "type": { "type": "string", "index": "not_analyzed" } } }, "label" : { "type": "string" } } } } } with two documents in this index : { "tags" : [ {"type" : "POST"}, {"type" : "DELETE"} ], "label" : "item 1" }, { "tags" : [ {"type" : "POST"} ], "label" : "item 2" } When I query this index like this : { "query": { "nested":

confused about creating nested branches in git

假装没事ソ 提交于 2019-12-05 03:51:06
I just started using git and started collaborating with other developers on same code. I have worked a little with SVN before but never had to collaborate with other people on my codebase. Now with collaborators working on same code, I need an efficient workflow. While searching for such, I found this , and it seems like a good workflow for our requirement. My repository resides in a local machine. I created the repository with git init --bare . I added the initial codes to master and pushed it. Then I added a "develop" branch using git branch develop; git push -u origin develop . Now I want

Get all values from nested dictionaries in python

折月煮酒 提交于 2019-12-05 02:29:52
I have some dictionaries of dictionaries, like this: a['b']['c']['d']['answer'] = answer1 a['b']['c']['e']['answer'] = answer2 a['b']['c']['f']['answer'] = answer3 .... a['b']['c']['d']['conf'] = conf1 a['b']['c']['e']['conf'] = conf2 a['b']['c']['f']['conf'] = conf3 Is there a fast way to get a list of values of all answers for all elements at the third level (d,e,f)? Specifically I'd like to know if there's any mechanism implementing a wildcard (e.g., a['b']['c']['*']['answer'].values() update The fastest way I've found till now is: [x['answer'] for x in a['b']['c'].values()] Richard In

Is it possible to access inner functions and classes via code objects?

爱⌒轻易说出口 提交于 2019-12-05 02:27:19
问题 Say there's a function func def func(): class a: def method(self): return 'method' def a(): return 'function' lambda x: 'lambda' that I need to examine. As a part of the examination I want to "retrieve" source code or objects of all nested classes and functions (if any). However I do realize that they don't exist yet and there's no direct/clean way of accessing them without running func or defining them outside (before) func . Unfortunately, the most I can do is import a module containing

Nested Cursors in PL/SQL

情到浓时终转凉″ 提交于 2019-12-05 02:26:06
问题 I am working with Oracle PL/SQL. I´m trying to define Nested Cursors, which means that the output from the first Cursor should be the input for the second. To be more specific: the first one should store tables with a specific prefix in it. The second one should store all values from an attribute from all the tables which are in the first one. Here is my code snippet. I hope it makes my problem a little more clear: DECLARE var_table_name VARCHAR2(30); var_dimension_key VARCHAR2(30); CURSOR

searching a nested javascript object, getting an array of ancestors

坚强是说给别人听的谎言 提交于 2019-12-05 02:18:03
问题 I have a nested array like this: array = [ { "id": "67", "sub": [ { "id": "663", }, { "id": "435", } ] }, { "id": "546", "sub": [ { "id": "23", "sub": [ { "id": "4", } ] }, { "id": "71" } ] } ] I need to find 1 nested object by its id and get all its parents, producing an array of ids. find.array("71") => ["546", "71"] find.array("4") => ["546", "23", "4"] What's the cleanest way to do this? Thanks. 回答1: Recursively: function find(array, id) { if (typeof array != 'undefined') { for (var i = 0

How to get a SASS nested nested media query to work with the use of the media query or operator

跟風遠走 提交于 2019-12-05 02:16:38
问题 I am trying to get a nested IE10+ media query to work in SASS and am not understanding the output. I think that things are getting weird with the use of the media query or operator , . As a result, this query will not apply in all cases because the only thing that is outputted is one side of the or . Note that these are originally mixins; i removed the mixins to make things easier to debug .element { @media only screen and (min-width: 825px) and (max-width: 999px) { font-size: 10.4vw; @media