homework

Non-trivial merge of two tables

There are two tables 1 and 2 with columns Id: unique ; timestamp:long; money:double SOME RECORDS are missing in Table 1 and table2. Question: try to merge both tables together with the timestamps of table1 , and if the records is only in table 2 adjust the timestamp with average time difference between table 1 and table2. Please help ...

Getting all the permutations in an array

Hi, say i have the following array: string[] = new string[] { "A", "B", "C" }; How can i produce all the possible permutations which contains only 2 characters and no two the same (eg AB would be the same as BA). Therefore using the above array it would produce: AB AC BC Please note that this example has been simplified therefore ...

SQL-Time difference

2 Tables with the below model: Id: long unique; timestamp:long; price:double The data in both tables are identical except timestamp. Timestamp is given as unix_time in ms. Quest: how many pairs have a bigger time difference than 1000ms ? ...

matrix pointer and function

Hello, I want to create a program wherein I can pass a matrix to a function using pointers. I initialized and scanned 2 matrices in the void main() and then i tried to pass them to a void add function. I think i am going wrong in the syntax of declaration and calling of the function. I assigned a pointer to the base address of my ma...

Return record with max date

Table – Employee.Status.XREF Client Employee Date 198 Jon Doe 3/1/2009 198 Jon Doe 1/1/2009 Table – Employee.Status.History Client Employee Date Status 198 Jon Doe 5/21/2009 T 198 Jon Doe 3/1/2009 A 198 Jon Doe 1/1/2009 P Only query records in both Employee.Status.History and Employee.Status.XREF where Client, Employe...

floating point in assembly linux

Hi Could you please give me a assembly code in linux(ubuntu 9.04) to print floating point number? with best wishes ...

Beginning Java (Histogram)

I'm taking a beginner Java class, with the assignment to create a histogram program with the following output: (100 and 10 are user inputs). How many numbers? 100 How many intervals? 10 Histogram -------------------------------------------------------- 1 ****(4) 2 ******(6) 3 ***********(11) 4 *****************(17) 5 *****...

C run time stackoverflow

#include <stdio.h> int doHello(){ doHello(); } int main(){ doHello(); printf("\nLeaving Main"); return 0; } When you run the program quits without printing the message "Leaving Main" on the screen. This is a case of Stack Overflow and because of which program is terminating but I don't see any error messages on the co...

heap & free homework question

I post this here as a last resort. I'm completely stuck and do not know where to take this. With this question, I'm looking for direction rather than the answer. I've got a home work assignment that actually appears to be a pretty common assignment. The question is here at page 11. This isn't my assignment but it is one I found on Googl...

How many possible bugs are there?

A user has to complete ten steps to achieve a desired result. The ten steps can be completed in any order. If there is a bug, the bug is dependent only on the steps that have been taken, not the order in which they were taken (i.e., the bug is path independent). For example: If the user performs three steps in the order 10, 1, 2 and pr...

javascript homework question on converting decimal to hex

What is the hexadecimal equivalent of number 264 and 140 ? Please give me full coding of this program. ...

Bucket sort code help

Hello. I have three questions about the following code; static void funct(int[] list) { final int N = 20; java.util.ArrayList[] buckets = new java.util.ArrayList[N]; for(int i = 0; i< list.length; i++) { int key = list[i]; if(buckets[key] = null) buckets[key].add(list[i]); } int k = 0 for(int i = 0;...

Don't immediatly see the point behind this(php, school)

I'm a 2nd year ICT student. I never did PHP before this year and our instructor gave us the basics and at the end of the semester, gave us a project that would combine what we learned in his course and the databases course. We were to use the classic AMP setup on windows. Now, our instructor told us to make a profile-site, based on how ...

Graph Searching algorithm

Here is the problem: I have to find a path from the starting point to the destination with following considerations. In the given graph a point could be either (1) A Checkpoint--> this point must be there in the final path calculated (2) A Mine--> this point should not be there in the final path calculated (3) A neutral point--> thi...

Optimize code so that it executes faster.

Hi, How can I optimize the following code so that it executes faster: static void Main(string[] args) { String a = "Hello "; String b = " World! "; for (int i=0; i<20000; i++) { a = a + b; } Console.WriteLine(a); } ...

Beginner Java (Help with class assignment)

This is a lab I am working for for a CSE 201. The program is supposed to read information about students and their scores from a file, and output the name of each student with all his/her scores and the total score, plus the average score of the class, and the name and total score of the students with the highest and lowest total score. ...

one million records in log file for a online shopping website. FInd distinct IP addresses

It is a technical test question. Given 1 million records in a log file. These are records of website hits of an online shopping website. The records are of type: TimeStamp:Date,time ; IP address; ProductName Find the distinct IP addresses and most popular product. What is the most efficient way to do this? One solution is hashing. If s...

Hashtable in java is giving me the last stored value, but not the right value

Sorry this is kinda long, but I needed to get the right scenario. This outputs all C's, why?? thanks in advance import java.util.Hashtable; public class Main { public static ContainsTheHash containsthehash = new ContainsTheHash(); public static StoresValues storesvalues = new StoresValues(); public static GetsValuesAn...

Queue that uses a Stack

I am having trouble understanding a question. The question asks first to write a C++ class to represent a stack of integers. Done. Here are my prototypes: class Stack{ private: int top; int item[100]; public: Stack() {top = -1;} ~Stack(); void push(int x) {item[++top] = x;} int pop() {return item[top--];} int...

Python: Which modules for a discussion site?

A site should be ready in 6 days. I am not allowed to use any framework such as Django. I am going to use: Python modules HTMLGen to generate HTML code from class-based description SQLObject, relational tables onto Python's class model ? Other Python 2.5 A variant of the Postgres schema Super Smack for testing the schema Which m...