72 Topics
|
|
public class IC1 { private int x = 3; static int y=4; class Inner { public void inmet() { System.out.println(x + " " + y);} } public void do() { Inner i = new Inner(); i.inmet(); } public static void main(String r[]) { IC1 ic = new IC1(); ic.do(); } … |
|
Hi, I need to create a function using **recursion** to find out if two lists have the same shape. For example, if nest1 = [4, [ [3,6], [] ,7] ,[8] ] nest2 = [ [ [3] ] , 7 , [ [5 , [9 , 2] , [ [ [ … |
|
I have a nested list, named env, created in the constructor and another method to populate an element of the grid defined as below: ... class Environment(object): def __init__(self,rowCount,columnCount): env = [[ None for i in range(columnCount)] for j in range(rowCount) ] return env def addElement(self, row, column): self[row][column] = … |
|
Hey all. I have this program where I need a variable number of for loops. For eg. the program i use to find the pythogorean triplets is for n1 in range(100): for n2 in range(100): for n3 in range(100): if n1**2+n2**2 == n3**2: print str(n1**2) + '+' + str(n2**2) + … |
|
hello everyone I was wondering if anyone could explain big-oh estimate to me for c++ data structures. I do not understand it that much and does anyone know of any good websites that have good information on c++ data structures i would greatly appreciate it. Also could anyone explain to … |
|
Hey everyone, I am looking to write a query that I think can be solved a nested select but I am not yet that fluent in MySQL to be able to get the query working correctly. Basically what I want to do is this; SELECT count(*) from Inquiry Inner Join … |
|
Im having trouble with nested for loops. I have have a SQL database with a few tables i need data pulled from. So in my first for loop i search for all materials in a product, i insert the data into a datatable then i do the for each dr … |
|
I'm trying to parse an XML file in Java using the XOM library. Where i'm running into an issue is when i hit nested elements. So in XOM you start with a root node, and i am able to parse the attributes out of that root node, and the three … |
|
Hi, I have a problem finding a textbox control which is within panel and this panel is within datalist control. I would like to get textbox.text property and I tried several ways but I always get empty string "" although textbox contain some text in it. My code is below: … |
|
Hi - I'm a rookie programmer. Could somebody explain how I can append a nested list of the form: List = [[Name1,[Detail-1,Counter-1],[Detail-2,Counter-2].....] [Name2,[Detail-1,Counter-2],[Detail-2,Counter-2].....] ................................................. ] My code is : def program(List, Name, Detail): for entry in List: if entry[0] == Name: entry[1].append([Detail,Counter]) return [B][I] List.append ([Name,[Detail]]) for entry in index: … |
|
Dear all, I'm a C beginner and I was doing a small practice nested loop on C when I got a very strange error which when the console opens tells me that my program has stopped working. here is the code: [CODE] #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> … |
|
Hello, I created this little asci art in java, and am wondering how to implement a constant int value that can be changed to make the picture bigger/smaller etc.. these are my loops: [CODE] for(int i = 5;i>=0;i--){ for(int j = 1;j<=i;j++){ System.out.print("P"); } for(int j = 5;j>=i;j--){ System.out.print(" "); … |
|
Hello, I am trying to create this ascii art using nested for loops, [CODE] ***** ////////// ***** **** ////////\\ **** *** //////\\\\ *** ** ////\\\\\\ ** * //\\\\\\\\ * \\\\\\\\\\ [/CODE] I tried doing a paper check and this is what I have so far... [CODE] * / \ * … |
|
This program determines the grade average, raised grade average, of individual students and all students. The program takes scanner input. In the scanner, the number of students, the number of grades for each student, and the grades of each student are entered. Ultimately, I need to print out each student's … |
|
|
[CODE] for i in file: if i == 0: break else: y = i[0] for k in gile: ~~~~ break [/CODE] if i write something like this, which line does the program read after the second break? thanks |
I'll keep it simple and hopefully whatever simple error I keep overlooking can be used as a learning experience for others. This program uses a user created file called patient.dat that contains the following: Smith Eleanore 110/73 Jones Tom 200/78 The error I am having is that Mr Tom Jones … |
|
Hi Is there any way to do nested mail merge in vb.net . i can do only simple mail merge. but not nested mail merge. My Code gives: [code] <District1> <District2> <District3> [/code] What i want [code] <District1> <Code ID><Code Name> 1 pcs 2 pcs <District2> <Code ID><Code Name> 14 … |
|
Hello! I was given the following problem: Define the function f(x; y) as: f(x,y) = sqrt(x^2-y^2) Write a program that produces a table of f(x, y) for integers x and y from 0 to n where y <= x. The value of f(x,y) appears in row (x+1), column (y +1) … |
|
Im trying to find the first element in each nested list: x = [['hey','wassup'],['are','you','ok'],['i','am','fine'] So that I get print a string: "hw ayo iaf" so far I have: def first_letters(): x = [['hey','wassup'],['are','you','ok'],['i','am','fine'] Thanks! |
|
Im trying to get the last element in each nested list such as double list = [['Hello','how','are','you'],['I','am','fine'],['How','about','yourself']] so that it will print out ['you','fine','yourself] I am also trying to do this all under a function such as def last_words(): #where my double_list is already in this function Thank you! |
|
Hey all! What I am working on is a contact form with file upload functionality. (e.g. user should be able to upload a screenshot.) Uploading a file should not be mandatory. So the mail which is produced from the entered information in the form should be sent without an attachment … |
|
Hey everyone, I am new to this site, basically my problem is this: The user inputs an integer, and then the user inputs a character, the program is supposed to make a triangle out of the character, with the max width of the user inputed integer. for example; user inputs … |
|
with this structures: [CODE]//Structure of binary tree typedef struct nodo_ab { int etiqueta; list primerapos; list ultimapos; char dato; struct nodo_ab* izq; struct nodo_ab* der; struct nodo_ab* padre; } nodo_ab; typedef struct nodo_ab *abb; //Structure of list typedef struct nodo_lista{ int dato; struct nodo_lista *sig; }nodo_lista; typedef struct nodo_lista *list; … |
|
I have a nested class declared as: [CODE]class A { class B { // members }; // members }; [/CODE] Is there a good way to avoid typing A::B every time I need to access B's members? I'd just like to do this in one .cpp file. I tried "using … |
|
Hi everyone, I'm new to this site and hope you might be able to help me out? So I've been given an assignment to produce this output [CODE]% ./hw4b foo here foo and foo there % ./hw4b ABC123 here ABC123 and ABC123 there % ./hw4b 'where is' here where is … |
|
|
hi i was wondering if (and how) you can create nested methods in c#. c# seems to do it with size and other things. something.Size returns a value but also something.Size.X returns a value. how can i do something like this myself? Thanks Ollie |
Good day! can you guys help me to have the code for this output? pleasee.. _ _ _ 1 _ _ 2 2 _ 3 3 3 4 4 4 4 thanks in advance! |
|
I am calling this javascript function: var facing = "First"; [CODE] function switchit(list){ if (list != facing){ document.getElementById(facing).style.display="none"; }; var listElementStyle=document.getElementById(list).style; if (listElementStyle.display=="none"){ listElementStyle.display="block"; } else { listElementStyle.display="none"; } facing = list; } </script> [/CODE] inside a nested div so that when a hyperlink is clicked it will show one … |
|
Hi~ I've been stuck with this exercise for quite a few days. It's in a book I'm currently self-studying, C++ primer plus. The exercise requires using C syntax, while the exercise which follows this one requires using string objects instead, so i guess this is the appropriate forum^^. It is … |
|
I am trying to create a Unit Converter. My Idea is to have a select box at the top to select Length/Temp etc. which will populate the two select boxes below with appropriate units. The below code should Work only for Milimieters to Milimeter, Meters and Kilometers. It should show … |
The End.