homework

Scheme - Problems with Sorting

So I'm learning Scheme in a class and my professor doesn't answer questions after 8:00, so I'm hoping you all can help me out. Basically I have a family tree type thing and I'm trying to get all the ancestors of one person, and display them as one string, sorted alphabetically. The problem is, because of the recursion, each generatio...

C Shared memory database

So this is a homework assignment, and it's kind of a doozy so i'll try to TL;DR it. Basically Im making a Shared memory database with 5 files (load,query,clean,print,change) Load loads the database from a file. (students have a first name/last name/address/telephone number) Query lets someone "search" for a specific student print....well...

Python function to convert seconds into minutes, hours, and days

Question: Write a program that asks the user to enter a number of seconds, and works as follows: There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds. There are 3600 seconds in an hour. If the number of secon...

Can someone fix this and add an array(s)? It will not compile?

include<iostream> class Hanoi { private: int n;// no. of disks public: Hanoi(int); solve(char, char, char int); }; void Hanoi :: Hanoi(int a) { cout << "Enter number of disks : " << endl; cin >> a; n = a; } void Hanoi :: tower(char from, char use, char to) { if (n > 0) { tower(n-1, from, use, to); cout << "Move disk " << ...

Java: "static class" or pass references around?

I'm part of a team designing the server for a client/server model naval warfare video game (University course). We have a fairly concrete (well, I think) system design, but there is one aspect that bothers me. The basic layout of the system is: Server [thread] (handles incoming connections) | Game [thread] (deals with game events in it...

any source code for capturing the data of a video form webcams and for converting2d videos to a 3d video ?

actually, i am doing a project that coverting 2d videos to a 3d video from 2 webcams. it is hard for me to do this. can anybody tell me how to do in detail??what should i do and how..iam very annoyed about this project!!thanks for helping ...

Detect local minima and maxima, java

Hi, given is any sequence of integers like 23 7 13 4 8 6. I want to detect local minima and maxima with the following rules: the first number in the sequence is a local minimum when the following number is greater the last number in the sequence is a local minimum when the previous number is greater a number in the sequence is a local...

array comparison for multiplication & subtraction

I have two big numbers (type int) which are stored in array with a size at least 1000, and I want to compare these two numbers to get information which one is bigger than the other. How can I do this? Actually , I will do two things subtract these two multiply these two (I am studying in this topic, indeed, and I didn't find an effi...

why is compareTo returning true when it should be false?

I'm debugging erroneous search returns from my data structures class project. This current project required us to build an ordered unrolled linked list, and run a search on the contents, then return a sublist of items from an inclusive start point to an exclusive end point. In order to do this, I have to search the internal array to fi...

Multi Processor Programming Question: Lock Free Stacks.

In preperation for my upcoming Concurrent Systems Exam, I am trying to complete some questions from the text book "The Art of Multiprocessor Programming". One question is bugging me: Exercise 129: Does it make sense to use the same shared BackOff object for both pushes and pop in our LockFreeStack object? How else could we structure the...

Error with aclocal

I have an error while trying to run aclocal although i have the Autoconf v 2.67 installed configure.ac:6: error: Autoconf version 2.62 or higher is required /usr/share/aclocal-1.11/init.m4:26: AM_INIT_AUTOMAKE is expanded from... configure.ac:6: the top level autom4te: /usr/bin/m4 failed with exit status: 63 aclocal: autom4te...

Shell scripting

3rd requirement 3- At the end of the execution, the script must produce a file named report.txt that contains a list of all files in the user's home directory including full path, owner, group and permissions for each file. ...

Abundant - defective number code not showing results

I have this code from my professor and it's about finding abundant and defective numbers. A number x is effective if the sum of all integer divisors, except for x itself, is less than x. If it's greater than x, then it's abundant. There are no compile errors and it seems all fine, but it just doesn't print anything, it doesn't get any r...

Load shared memory in C

So Im making a Load.c file, that basically will load a bunch of "students" into shared memory. The students are stored in a struct that looks like this: struct StudentInfo{ char fName[20]; char lName[20]; char telNumber[15]; char whoModified[10]; }; Anyways I need to load this in shared memory, we were given some sample code. and we a...

How to add an Image to a JPanel

I am trying to add an image to a JPanel class, which is a chess board. Then I want to be able to "cut" it to define each space as a part of an array list and then be able to place pieces on top of each according to the part of the board it is supposed to start in. Here is part of what I have: import javax.swing.*; import java.awt.*; im...

Java: merges two ordered list objects of integers into a single ordered-list

Write a program that merges two ordered list objects of integers into a single ordered-list object of integers. Method merge of class ListMerge should receive references to each of the list objects to be merged and return a reference to the merged list object ...

How to efficiently structure a terminal application with multiple option menus in C++

I'm writing a console based program for my coursework, and am wondering how best to structure it so that it is both stable and efficient. I currently have #include <iostream> #include <cstdlib> using namespace std; int main() { int choice; do { cout << "\E[H\E[2J" // Clear the console << "Main men...

Recursion in MIPS

I'm struggling to simply understand how to implement recursion in MIPS. I have an assignment to write a Fibonacci program and a Towers of Hanoi Program. I understand recursion and how each of them can be solved, but I don't know how to implement them in MIPS. I am completely lost and could use any help I can get. ...

What does this function do?

int mystery( const char *s1, const char *s2 ) { for( ; *s1 != '\0' && *s2 != '\0'; s1++, s2++ ) { if( *s1 != *s2 ) { return 0; } //end if } //end for return 1; } I know it has typing errors but this is exactly how it was. ...

Why is my if statement not working?

I am trying to check if a gas pump is free for use && full of gas, and then I am trying to make that pump the pump to be used by the cars in a queue. Thread carThreads[]=new Thread[TOTAL_CARS]; try { Pump pump1 = new Pump(); pump1.setName("pump1"); pump1.setFuelAmount(2000); pump1.setState(0); Pump pump2 = new Pum...