homework

Help creating md5 in php

I am trying to create an md5 value in php using the instruction given. I can't seem to get it right and would like you help understanding the instructions and the code. This is what the instructions say: The md5 is constructed by performing an MD5 calculation on a string built up by concatenating these fields. Specifically the MD5 has...

What is a good 10 to 20 hour program-to-write for a new VB.NET programmer that utilizes inheritance?

I'd like to give a homework assignment to a person learning VB.NET. I'd like it to use basic inheritance and a variety of data structures including queues, lists, arrays, or stacks in a windows forms application. I was thinking of a pizza-ordering application. This would allow them to utilize some basic inheritance and practice using...

SQL where clause to work with Group by clause after performing a count()

Tried my usual references at w3schools and google. No luck I'm trying to produce the following results. QTY is a derived column | Position | QTY -------------------- 1 Clerk 2 2 Mgr 2 Here's what I'm not having luck with: SELECT Position, Count(position) AS 'QTY' FROM tblemployee Where ('QTY' != 1) ...

Codesample with bufferoverflow (gets method). Why does it not behave as expected?

This an extract from a c program that should demonstrate a bufferoverflow. void foo() { char arr[8]; printf(" enter bla bla bla"); gets(arr); printf(" you entered %s\n", arr); } The question was "How many input chars can a user maximal enter without a creating a buffer overflow" My initial answer was 8, because the char-arr...

Beginner question: ArrayList can't seem to get it right! Pls help

I have been staring at this code all day now, but just can't get it right. ATM I am just pushing codeblocks around without being able to concentrate anymore, with the due time being within almost an hour... So you guys are my last resort here. I am supposed to create a few random balls on a canvas, those balls being stored within an A...

Find if there is an element repeating itself n/k times

You have an array size n and a constant k (whatever) You can assume the the array is of int type (although it could be of any type) Describe an algorithm that finds if there is an element(s) that repeats itself at least n/k times... if there is return one. Do so in linear time (O(n)) The catch: do this algorithm (or even pseudo-code) ...

How to write a Stack class in Java

How do I write a stack class in Java while checking for palindrome words and phrases? ...

How do I output the preorder traversal of a tree given the inorder and postorder tranversal?

Given the code for outputing the postorder traversal of a tree when I have the preorder and the inorder traversal in an interger array. How do I similarily get the preorder with the inorder and postorder array given? void postorder( int preorder[], int prestart, int inorder[], int inostart, int length) { if(length==0) return; //termi...

what makes a Tomcat5.5 cannot be "aware" of new Java Web Applications?

This is for uni homework, but I reckon it is more a generic problem to the Tomcat Server(version 5.5.27) on my uni. The problem is, I first did a skeleton Java Web Application (Just a simple Servlet and a welcome-file, nothing complicated, no lib included) using NetBeans 6.8 with the bundled Tomcat 6.0.20 (localhost:8084/WSD) Then, to ...

Sorting a list of items using javascript

Hi all, I am working on a class assignment in which i need to accomplish the following: 1 User types a list of items into a text box (form field) 2 When the user presses the sort button, the list in the text box is sorted 3 It takes the text from the text box and puts the sorted text back in the text box Please help! edit: this is wha...

Question on First Order Logic formula

Hi, Can someone validate the following. I am supposed to 'write a formula asserting that for every number there's a unique next number...true for integers for instance' L(x,y) means x is smaller than y the intended Domain is the Integer numbers Can I give x y [ x<y ( z : z<x y<z ) ] Thanks ...

Balancing heuristics (for timetable problem)

I'm writing a genetic algorithm for generating timetables. At the moment I'm using these two heuristics: Number of holes between lectures in one day (related) (less holes -> bigger score) Each hour has some value, so for each timetable I sum values for hours when lectures are on. (lectures at more appropriate hours -> bigger score)...

JAVA: Can't get context parameters in Filter

Hello, I have a filter and parameters in web.xml web.xml is like this: <filter> <description> </description> <display-name>AllClassFilter</display-name> <filter-name>AllClassFilter</filter-name> <filter-class>com.datval.homework.AllClassFilter</filter-class> <init-param> <param-name>DB_URL</param-nam...

Update table.column with another table.column with common joined column

Hit a speed bump, trying to update some column values in my table from another table. This is what is supposed to happen when everything works Correct all the city, state entries in tblWADonations by creating an update statement that moves the zip city from the joined city/state zip field to the tblWADonations city state TB...

Count double palindromes in given int sequence

For a given int sequence check number of double palindromes, where by double palindrome we mean sequence of two same palindromes without break between them. So for example: in 1 0 1 1 0 1 we have 1 0 1 as a palindrome which appears 2 times without a break, in 1 0 1 5 1 0 1 we have 1 0 1 but it's separated (apart from the other palindr...

Java cannot find symbol enum

Hi, I'm modeling a chess game on Java, and I'm having some problem. Here's what the code looks like (the relevant parts): Enum class Couleur.java: public enum Couleur {BLANC, NOIR} Piece.java: public abstract class Piece { (...) public Piece(Couleur couleurParam){ this.couleurPiece = couleurParam; } (...) } And final...

A[i] * A[j] = k in O(nlog(n))

A is an Array of n positive int numbers k given int Algorithm should find if there is a pair of numbers which product gives the result a. A[i] * A[j] = k b. A[i] = A[j] + k if there is such a couple the algorithm should return thier index. thanks in advance. ...

Java problem cant find image file

I am a student working on a homework project. I spent DAYS trying to get the following code to display an image on my new windows 7 laptop. I compiled it and ran it on my old xp pc and it worked! I really want to use my laptop. Any suggestions on how to get it to display the image? The java code. HTML and immage are all in the same s...

Vector iterators in for loops, return statements, warning, c++

Had 3 questions regarding a hw assignment for C++. The goal was to create a simple palindrome method. Here is my template for that: #ifndef PALINDROME_H #define PALINDROME_H #include <vector> #include <iostream> #include <cmath> template <class T> static bool palindrome(const std::vector<T> &input) { std::vector<T>::const_iterat...

How to manipulate sql connection string in C#

Hi i'm trying to manipulate the sql connection string so instead of running the original copy of our database it runs from the copy one folder up in our C# project. ...