homework

Database Inheritance Select

For my university assignment I have to design some basic managment system for sicknesses and all for a school. I have decided to model some basic inheritance in the form of Person --> Student Person --> Staff Person --> Guardian Person (PersonID, FirstName, LastName) Student (StudentID (Which references the PersonID), ... ) The re...

Quick SQL Question: SQLzoo tutorial problem

Problem 2b goes as follows: 2b. For each subject show the first year that the prize was awarded. nobel(yr, subject, winner) My solution was this: SELECT DISTINCT subject, yr FROM nobel ORDER BY yr ASC; Why isn't this working? ...

Logical error with functions in C

Hi guys I'm a junior student in IT. I am facing a problem with the output of the program. The idea of the program is that I should use functions to read an array of 10 elements, then get the average of the elements, then get the the max and min. I've got the max and min right but the average is showing weird stuff. Please check the cod...

SQL tutorial question: Listing the first value from a three-way joined table query

Ugh ok I'm terrible at explaining things, so I'll just give you the quotes and links first: Problem 4b (near bottom): 4b. List the film title and the leading actor for all of 'Julie Andrews' films. movie(id, title, yr, score, votes, director) actor(id, name) casting(movieid, actorid, ord) (Note: movie.id = cast...

Another SQL tutorial question: Field > 0?

Alright, this one (3a; sample problem with provided answer) has got me scratching my head: bbc(name, region, area, population, gdp) 3a. Find the largest country in each region: SELECT region, name, population FROM bbc x WHERE population >= ALL (SELECT population FROM bbc y WHERE y.region = x.region AND...

Working with Eclipse, writing servlets in java...

Another day, another class... I have gotten everything working for my class in which I am using Tomcat and Eclipse to write java servlets. What I would like to know is why eclipse seems to give me problems when I try to edit the servlet-name in the web.xml file. Does eclipse not allow you to edit this file? I know that it automaticall...

How do I represent my joins in Relational Algebra?

I am new to relational algebra and for my assignment I have to create two. I have written out the problem I have faced in SQL but I am unsure of how to represent such joins in relational algebra. Any help/pointers would be greatly appreciated. SELECT ps.FirstName AS StudentFirstName, ps.LastName AS StudentLastName, pst.FirstName AS Staf...

(ProjectEuler) Sum Combinations

From ProjectEuler.net: Prob 76: How many different ways can one hundred be written as a sum of at least two positive integers? I have no idea how to start this...any points in the right direction or help? I'm not looking for how to do it but some hints on how to do it. For example 5 can be written like: 4 + 1 3 + 2 3 + 1 + 1 2 + 2 + ...

About Memory Management in Java and C++.

Well, I've been given an assignment to basically figure out how memory allocation works for whatever language I'll be using. After some research, I have some questions and doubts which I'd like to get some insight in. For example: I read here that Java specifies exactly how the stack contents are organized. Looking at the JVM spec struc...

Write a number with two decimal places SQL server.

How do you write number in two decimal place for sql server? ...

Where can I find a bit shifting guide for C?

I have looked at http://stackoverflow.com/questions/141525/absolute-beginners-guide-to-bit-shifting but I still find the concept of bit shifting difficult to understand. Can someone point me in the direction of a more basic guide to bit shifting in C. I expect it will be something really long since it will need to cover the whole subjec...

Algorithm to find subset within two sets of integers whose sums match

Hi, I'm looking for an algorithm which can take two sets of integers (both positive and negative) and find subsets within each that have the same sum. The problem is similar to the subset sum problem: http://en.wikipedia.org/wiki/Subset-sum_problem except that I'm looking for subsets on both sides. Here's an example: List A {4, 5, 9,...

Pacman in Java questions

For my university assignment I have to make a networkable version of pacman. I thought I would best approach this problem with making a local copy of pacman first and then extend this functionality for network play. I would have to say that I am relatively new to java GUI development and utilizing such features within java. http://ww...

Pacman game class design.

Hi Everyone, I have to write a multiplayer pacman game in Java for a university assignment and I'm after some feedback for my design so far. So I'm trying to go down an MVC style and this is what I've sketched out. I've never designed anything using MVC, so my knowledge is really only from the pragmatic programmer and a short lecture ...

Base 3 Combinatorics

I've never been much for math and I'm hoping that someone can help me out with the following. I have 5 boxes: 1 2 3 4 5 [ ] [ ] [ ] [ ] [ ] The boxes can either be white, gray, or black (or think of it as 0, 1, 2) How many possible states can the box set be in? What is the pseudocode (or in any language) to generate all t...

retrieving rows with max date

I have two tables like this: Table1 (Number column is unique) Number | date 1234 2008-10-06 17:11:00 5678 2005-10-19 16:20:00 9023 2005-12-09 16:20:00 4243 2009-01-06 17:11:00 5234 2009-01-14 17:11:00 Table 2 Number | code 1234 A1 1234 B1 5678 A1 9023 A1 4243 C1 5234 ...

Does the controller handle all interaction with the model in MVC?

I'm creating a pacman game using the MVC pattern. According to this diagram on wikipedia the model and the view interact. "Note: the solid lines indicate a direct association, and the dashed lines indicate an indirect association" Now from my understanding, surely everything goes through the controller? Say for example, player moves ...

Looking for a good semester project (probably in java)

Hey, I'm currently taking a class on software development. The main aspect of the class is going through the development cycle on a fairly complex project. This project has to be complex enough to take 4 people a semester to do. I was wondering if anyone had some good ideas. I'll list two ideas we had below. A multithreaded client/ser...

Win Form Calculator: Buttons 0 - 9 Event handler to perform repetitive task

I have a win form UI that looks like a typical calculator. Naturally I do not want to rewrite the same logic for every single numeric button(0-9). I want to be able to know which button was clicked so I can perform calculations based on it's text property. Should I just make a method that accepts the button object as a parameter to promo...

Referencing other peoples code.

I'm currently working on my Bachelors dissertation. This involves developing a software product and a 12000 word write-up, mainly covering research, design and development. Now where I am quoting other peoples written work, I am obviously referencing this, but what about code? There have been plenty of times where I've looked for a solut...