homework

What is a better way to stream audio with Perl CGI?

Stackoverflow: For a cs assigment I am using the following code to stream audio. However, now I would like to add the ability to stream files successively, as in a playlist, how can I modify my code to accommodate this? I would like to have a text file of filenames that my script passes through sequentially streaming each. Is this ...

How to create a linked list of nodes that are contained in the max-Depth of a Binary Tree using Java

I've already created the Binary Tree and Linked list classes, I'm just in need of an algorithm that prints ONLY the nodes of the largest path. The height and size of the Binary Tree are already stored in the root node, but my problem is traversing only the largest path while adding each node to my linked list. ...

Maze recursive solving and randomly creating a maze (JAVA)

first assignment was a find the solution of a 12*12 maze. i am supposed to use a recursive method to solve them. secondly, i have to make a method to create a randomly generated maze with same dimensions. (# represents a wall, * represents a untraveled path, T represents a traveled path, X represents a path that leads to a dead end) im s...

Reading a file into an array

I would like to read a text file and input its contents into an array. Then I would like to show the contents of the array in the command line. My idea is to open the file using: inFile.open("pigData.txt") And then to get the contents of the file using: inFile >> myarray [size] And then show the contents using a for loop. My prob...

PushFront method for an array C++

Hello, I thought i'd post a little of my homework assignment. Im so lost in it. I just have to be really efficient. Without using any stls, boosts and the like. By this post, I was hoping that someone could help me figure it out. bool stack::pushFront(const int nPushFront) { if ( count == maxSize ) // indicates a full array ...

problem with join SQL Server 2000

I have 3 tables - Items, Props, Items_To_Props i need to return all items that match all properties that i send example items 1 2 3 4 props T1 T2 T3 items_to_props 1 T1 1 T2 1 T3 2 T1 3 T1 when i send T1,T2 i need to get only item 1 ...

What is the difference between association and dependancy relationship?

What's the difference between Association and Dependency? Aren't they both the same thing? as if class A is associated with B then Class A is dependent on B ie. there's a dependency between A and B. ...

Prolog Problem with combinding predicates that work on their own

Here we go, bear with me. The over-all goal is to return the max alignment between two lists. If there are more than one alignment with the same length it can just return the first. With alignment I mean the elements two lists share, in correct order but not necessarily in order. 1,2,3 and 1,2,9,3; here 1,2,3 would be the longest alignm...

Prolog Path Search Pointers

I need to check if a path is valid, true or false. It's given like this: ?-path(a,b,[(a,c),(c,d),(d,b)]). true In the list part, how do I access the a or c in (a,c)? Is it like a string"(a,c)"? And in general how would one solve this type of path finding? Sample code/pseudo is appreciated. Is there a way to make it interpret the tup...

Parsing problem, exception

This is my BMI calculator with GUI. It compiles, but if the user enters characters rather than numbers into the fields, the program crashes. What is wrong with my catching of the numberformatexception? Id appreciate any help! import java.awt.*; import javax.swing.*; import java.awt.event.*; class Exercise1b extends JFrame{ JLabel BMIl...

code for subtracting 1 from a digit stored in an array using c

can any one help me with code that subtract 1 from a digit stored in an array using c++ (elementary mathematics) eg.. 100-1=99 and 98-1=97 ...

Using pointers to swap int array values.

I am supposed to use pointers to swap ints in an array. It compiles with no errors or warnings and runs but does not swap the ints. Any suggestions would be helpful!!! Here is the tester: #import <stdio.h> void swap( int ary[] ); int main( int argc, char*argv[] ) { int ary[] = { 25, 50 }; printf( "The array values are: %i an...

Is it ok for private instances to be shared among objects?

I am only allowed to use private members in the programming course I'm taking, and I was wondering if something like this is ok. public class View { private Model object_; public View(Model object) { object_ = object; //blah blah blah } //blah blah blah } public class Controller { private Model object_; ...

ER Diagram (Drawing)

For a relational database that represents the current term enrollment at a large university, what is the ER diagram for a schema that takes into account all the assertions given: • 100 instructors, 200 courses, and 800 students. • An instructor may teach one or more courses in a given term (average is 2.0 courses). • An instructor mus...

what does this pointer do?

char* p = "hello world"; programmers usually assigns the address of an variable to a pointer. But in the above case, where is the pointer pointing to? and what in the world is int x =42; int* p= &x; int ** r = &p; ...

Tree like data structure

Hi i am working on a problem and could do with some help, i am working in C#. What i'm trying to do is create a data structure as follows: I need to layout out item with x and y co-ordinates on a page. Now the actual laying out is not a problem is more about having a valid set of co-ordinates. Each item in my list can have multiple pa...

finding numbers with C++

Hello, I have a problem in writing a program with C++. I have been studying C# and Java but C++ is a way different to me, so I need your help. My task is to make program which: reads an input from a text box than returns the nubers from that input which has two digits and their sum is 9. For example: Input: 12 231 81 53 522 11 63 Ou...

error correction code upper bound

If I want to send a d-bit packet and add another r bits for error correction code (d>r) how many errors I can find and correct at most? ...

Proving f (f bool) = bool

How can I in coq, prove that a function f that accepts a bool true|false and returns a bool true|false (shown below), when applied twice to a single bool true|false would always return that same value true|false: (f:bool -> bool) For example the function f can only do 4 things, lets call the input of the function b: Always return tr...

What is the difference between business class and domain class? What is meant by persistent classes?

What is the difference between business class and domain class? What is meant by persistent classes? ...