homework

Essay Help. Database Design

When constructing a database, the designer must know what type of relationship exist between records in different data sets, such as ‘one to one’, ‘one to many’ and ‘many to many’. Choose only one type and give an example of this relationship. ...

how to print the below in c++

1 121 12321 1234321 ...

Programming question --

What would be the best solution for this problem?? if we have a question say by the pythagoran theorem. x^2+ y^2 = c then according to that if we are given the value of c, what shall be the best way to deal and find the values of x and y? x and y can be negative. Also, suppose c=0 then x=0 and y=0. Moreover, if we have c=1 then we hav...

MYSQL: how can i select dates from this current day up to the next 2 months

i have to select from my homework dates from this time up to the next 2 months... i'm doing an expiration database.. pls help me ...

SML question about foldr

Hey, im trying to declare a function, string list -> string, that with the input for instance ["Chicago","city","USA"] should return "Chigago city USA". And im having a bit of trouble, what i did so far was this: fun gather ts = foldr op ^ "" ts; This seems to be somewhat along the lines, however the problem is, i would like to includ...

C++ program does not work on some inputs

Hallo I have this assignment to print only alphabets in a C++ string. It works for most input but when [ and ] are present in the input they are printed as well. #include <iostream> #include <string> using namespace std; int main() { string input = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG]"; for(int i=0;i<input.s...

How to read OutputStreamBitWriter object in Java?

I have the following code: OutputStreamBitWriter writer = new OutputStreamBitWriter(System.out); writer.writeBit(1); If I want to print the value or store it in a String, how do I do that? ...

How to automatically resize an AWT component after changing it's contents?

I have an AWT Label inside a Panel with FlowLayout. I want to dynamically change the Labels text and resize it to the required width. I have only found answers to the Swing version of this problem (setPrototypeDisplayValue()), but I have to stick with AWT since this is a homework. ...

A program to control memory for a task in C

Hi I have got a task to solve, that is a bit cryptic. The task is to make a program in C that handles texts messages, the program should simulate a system with a small amount of memory, the system should only be able to hold X messages with maximum X characters, every character takes 1 byte (ASCII). To manage messages should I make a sy...

SML - help with a function

Declare a function of shortLong: string list -> int * int , so the result of a call short long ts becomes (k, l) where k is the number of texts in ts with six or fewer characters, and l is the number of texts in ts with seven or peripheral characters. Try to express the short-long in such a way that the argument "not" be run two, but...

I have a problem building an array of "*" in C++.

I have a program that contains the following piece of code for constructing an array of asterisks: char array[Length][Height]; for (int count1 = 1; count1 <= Length; count1++) { for (int count2 = 1; count2 <= Height; count2++) { strcpy(array[count2][count3], "*"); cout << array[count2][count3]; } } cout << e...

Traversing a graph (with possible loops) and returning the path in Prolog

I'm given a list of arcs: arc(a,b). arc(b,c). arc(c,d). arc(d,b). arc(d,e). arc(e,e). arc(e,f). I've written a set of clauses which will tell me if theres a path from node X to node Y. Loops may occur and I've accounted for that. path(X,Y) :- arc(X,Y). path(X,Y) :- arc(X,Z), path(Z,Y,[X]). path(X,Y,P) :- arc(X,Y). path(X,Y,...

Bitshifting Java, please explain

Hi! I'm trying to understand how bit shift works. Can someone please explain the meaning of this line: while ((n&1)==0) n >>= 1; where n is an integer and give me an example of a n when the shift is executed. Thanks! ...

[AJAX+PHP] How to send data from one user to other without storing data in database

Hi,i got an assignment to make something similar to http://typewith.me .The problem i am facing is that i have to send xml through AJAX from one user to server(im using PHP) and the other user will receive it when he makes request through AJAX. But storing XML in database in the intermediate time will make it slow. So where else can i st...

Strategy for transferring Large amount of data

Hi, I am writing my master thesis and is in contact with a digital signage company where im writing about the distribution of large amount of data. I need some ideas or some documented experiences with transfering large amount of data (this is images and video, ~100Mb - ~1Gb - but any data would do, large datasets would give some of the ...

Combining list boxes into rich text boxes?

Hey all, another homework assignment here thats kind of unclear on the requirements. It is a forms program that assigns people to seats on an airplane. The part that is losing me is that its telling me to display the passenger manifest in a list box, but then its telling me to display it in a list box. Then it calls it a rich text box a...

findPattern() Python Code...not executing correctly?

Hi all, my homework assignment was to: "write a function called findPattern() which accepts two strings as parameters, a filename and a pattern. The function reads in the file specified by the given filename and searches the file’s contents for the given pattern. It then returns the line number and index of the line where the first inst...

error: invalid operands to binary % (have 'double' and 'double')

I have a program I am writing that lists 100,000 prime numbers. It works fine for 10 numbers, but after so many numbers they turn into negative values. I changed the ints to long ints and that did not change anything, then I changed them to doubles and I get the error listed in the title. What should my variable be? Keep in mind I am...

Java Tree Iterator Help

I am trying to write a class that implements a tree using an array and I need some help to write an Iterator method that which returns an iterator of the elements stored in the tree. Here is my code. import java.util.Arrays; import java.util.Iterator; import java.util.List; public class ArrayTree<E> implements Tree<E>{ protected ...

Cannot print array of strings without getting garbage characters...

int main(int argc, char** argv) { char *test[5][20]; char *input[20]; int i; for(i=0;i<5;i++){ printf("enter> "); fflush ( stdout ); fgets(input,20,stdin); *test[i] = *input; } for(i=0;i<5;i++) printf("%d | %s\n",i,test[i]); return 0; } Output: enter> pwd enter> pathd ...