nested

JavaScript get value from nested object [duplicate]

≯℡__Kan透↙ 提交于 2019-12-04 07:13:18
问题 This question already has an answer here : JavaScript - retrieve value from nested object, using array of keys (1 answer) Closed 2 years ago . If this is my object: var obj = { bakery1: { small: { name: "Small cookie", price: 0.75; } large: { name: "Large cookie", price: 3.00; } } bakery2: { small: { name: "Small cookie", price: 1.00; } large: { name: "Large cookie", price: 4.00; } } }; How would I go about making a loop that prints every price to the console? And when this value is printed,

Drawing nested venn diagrams

前提是你 提交于 2019-12-04 06:53:30
I have data which contain binary indicators for two groups, and to more groups that are nested within one of the first two groups. For example: set.seed(1) df <- data.frame(a=rep(0,10),b=rep(0,10),b.1=rep(0,10),b.2=rep(0,10)) df$a[sample(10,5,replace=F)] <- 1 df$b[sample(10,5,replace=F)] <- 1 df$b.1[sample(which(df$b==1),3,replace=F)] <- 1 df$b.2[sample(which(df$b==1),3,replace=F)] <- 1 df <- df[which(rowSums(df)==0),] a and b are the two groups and b.1 and b.2 are nested within group b . What I'd like to do is draw one venn diagram of all groups. This means that b.1 and b.2 will be

Nested Update panel problem

主宰稳场 提交于 2019-12-04 06:37:05
问题 I am having a nested update panel something like this <asp:UpdatePanel ID="DetailsUpdatePanel" runat="server" Visible="false" UpdateMode="Conditional" > <ContentTemplate> <div><ajaxToolkit:AsyncFileUpload runat="server" ID="BrochureUpload" Width="400px" OnClientUploadError="BrochureuploadError" OnClientUploadStarted="BrochureStartUpload" OnClientUploadComplete="BrochureUploadComplete" CompleteBackColor="Lime" UploaderStyle="Modern" ErrorBackColor="Red" ClientIDMode="AutoID" ThrobberID=

Dealing with Nested Loops in Python - Options?

放肆的年华 提交于 2019-12-04 06:18:18
问题 I have a function that looks like this (below). I'm using xlrd in python. Whenever I perform the "print path" function, I receive way too many iterations of path. Essentially, what I'm trying to do is compare two columns in excel, and print out a third. That works perfectly, except that the third is printed out too many times, and I believe the problem is the nested loops. def question(): for x in xrange(sheet.nrows): buddy = sheet.cell_value(x, 13) newton = buddy.split(',') james = sheet.col

Nesting Avro schemas

人走茶凉 提交于 2019-12-04 06:00:09
According to this question on nesting Avro schemas, the right way to nest a record schema is as follows: { "name": "person", "type": "record", "fields": [ {"name": "firstname", "type": "string"}, {"name": "lastname", "type": "string"}, { "name": "address", "type": { "type" : "record", "name" : "AddressUSRecord", "fields" : [ {"name": "streetaddress", "type": "string"}, {"name": "city", "type": "string"} ] }, } ] } I don't like giving the field the name address and having to give a different name ( AddressUSRecord ) to the field's schema. Can I give the field and schema the same name, address ?

How to run an sql query inside a while loop of another query

倾然丶 夕夏残阳落幕 提交于 2019-12-04 05:44:35
问题 The following works with no problem at all, when the photoId is directly on the statement and not a variable. $img_query = mysqli_query($con, 'SELECT * FROM imgs WHERE photoid = "103"') or die(mysqli_error($con)); but the following just won't work with no error, what might be causing this not to select. $imageid = '103'; $img_query = mysqli_query($con, 'SELECT * FROM imgs WHERE photoid = "$imageid"') or die(mysqli_error($con)); $img_row = mysqli_fetch_array($img_query); echo $img_row['img'];

How to create nested list from PHP array for dropdown select field?

柔情痞子 提交于 2019-12-04 05:33:55
问题 My problem is very similar to the one described here in this topic Create nested list from PHP array for dropdown select field The problem is that if investments are not consecutive, then incorrectly adds a dash function buildTree(Array $data, $parent = 0) { $tree = array(); foreach ($data as $d) { if ($d['parent'] == $parent) { $children = buildTree($data, $d['id']); // set a trivial key if (!empty($children)) { $d['_children'] = $children; } $tree[] = $d; } } return $tree; } function

Adding nested attributes to devise user model

試著忘記壹切 提交于 2019-12-04 05:30:59
问题 At first glance it would seem this question has been answered before, but not on my case (most are related to mass assignment issues and/or mongoid.) I have not been able to find an answer even though there are plenty somewhat related questions here. So basically I'm using the devise gem for user authentication on a ruby on rails application and I want to add a nested address model to the user model. I'm also using simple_form to generate the form views. I have a user model: class User <

How to access controls inside a nested master page? why does it behave differently from content pages?

♀尐吖头ヾ 提交于 2019-12-04 05:27:58
Is there a difference between these two scenarios: (1) Accessing a property on a master page from a regular child (2) Accessing a property on a master page from a nested master page I tried to access a textbox in the master page from a content page like this: TextBox a; a = (TextBox)Master.FindControl("ayyash"); // Master is declared in MasterType directive defaultTextbox.Text = a.Text; // defaultTextBox is a textbox control inside default.aspx it works, but then when I applied the same method on a nested master page: TextBox a; a = (TextBox)Master.FindControl("ayyash"); // Master is declared

How to search nested list grid and give lettered coordinates in Python? [closed]

痞子三分冷 提交于 2019-12-04 05:06:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm new to python and struggling quite a bit to get this going. This is my task: The Six-Letter Cipher is a method of encoding a secret message that involves both substitution and transposition. The encryption starts by randomly filling a 6  6 grid with the alphabet letters from A to Z and the digits from 0 to