homework

How do I validate the class diagram for a given domain?

I am working on car dealership business domain model/UML class diagram. I am new to modeling, so I would like to know how to validate the class diagram. It's very important for me to have an appropriate, if not 100 percent correct, class diagram to use further development (use cases, etc.). Is it possible to build a completely incorrec...

How do I reverse a list using recursion in Python?

I want to have a function that will return the reverse of a list that it is given -- using recursion. How can I do that? ...

Big O Notation Homework--Code Fragment Algorithm Analysis?

For homework, I was given the following 8 code fragments to analyze and give a Big-Oh notation for the running time. Can anybody please tell me if I'm on the right track? //Fragment 1 for(int i = 0; i < n; i++) sum++; I'm thinking O(N) for fragment 1 //Fragment 2 for(int i = 0; i < n; i+=2) sum++; O(N) for fragment 2 as ...

How do I find the running time given algorithm speed and computer speed?

I'm currently working through an assignment that deals with Big-O and running times. I have this one question presented to me that seems to be very easy, but I'm not sure if I'm doing it correctly. The rest of the problems have been quite difficult, and I feel like I'm overlooking something here. First, you have these things: Algorithm ...

How to get options in the order entered by the user, using Perl's Getopt::Long?

I have an existing Perl program that uses Getopt package and Getopt::Long::Configure with permute as one of the options. However, now I need to keep the order of the options entered by the user. There is an option $RETURN_IN_ORDER mentioned in the Long.pm, however doesn't seem to be used anywhere at all. When I pass return_in_order, I ...

How do I use Master theorem to describe recursion?

Recently I have been studying recursion; how to write it, analyze it, etc. I have thought for a while that recurrence and recursion were the same thing, but some problems on recent homework assignments and quizzes have me thinking there are slight differences, that 'recurrence' is the way to describe a recursive program or function. Thi...

database design and program design

How is database design different from program design? ...

Finding Min and Max Vaules In an array using vb.net

Hey, I need to find the min and max vaule on an array. The .max function works but .min keeps showing zero. Public Class Program_2_Grade Dim max As Integer Dim min As Integer Dim average As Integer Dim average1 As Integer Dim grade As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Syst...

Find the shortest path in a graph which visits certain nodes.

I have a undirected graph with about 100 nodes and about 200 edges. One node is labelled 'start', one is 'end', and there's about a dozen labelled 'mustpass'. I need to find the shortest path through this graph that starts at 'start', ends at 'end', and passes through all of the 'mustpass' nodes (in any order). ( http://3e.org/local/m...

Decrypt PHP encrypted string in C#

I have a string encrypted in PHP that I would like to decrypt in C#. I used the tutorial below to do the encryption, but am having problems decrypting. Can anyone post an example on how to do this? http://www.sanity-free.org/131/triple_des_between_php_and_csharp.html ...

how to use cursor for reading multiple files in database in python

In python how to read multiple files from mysql database using cursor or loop one by one and store in separate table ...

Converting a string of numbers into integers

I have a string (char) and I want to extract numbers out of it. So I have string: 1 2 3 4 /0 And now I want some variables, so I can use them as integer: a=1, a=2, a=3, a=4 How can I do that? ...

Replace SRC attribute with TITLE in LI Tag

Hi, I have the html given below: <ul id="thumbsPhotos"> <li src="/images/1alvaston-hall-relaxing-lg.jpg" onclick="updatePhoto (this.title)"><img src="/images/1alvaston-hall-relaxing-sl.jpg" width="56" height="56"></li> <li onclick="updatePhoto(this.title)" src=""><img src="" width="56" height="56"></li> <li onclick="u...

Optimal Rectangle hatching algorithm

Hi, I am looking for an algorithm to hatch a rectangle with shortest overall line length, so that an object of given area can be passed through the hatching. For example given a rectangle of 5x3 cm, and I hatch using parallel lines 1cm across, the biggest object I can pass through the hatch is a square of 1cm side. I have used an overa...

array compiling from mysql help required.

Hi This has been bugging me, I can't get my head around it. I will use the foodstuffs analogy to try and simplify my probelm. 1000 members of the public where asked to pick a variety from each of 13 categories of footstuff. These selections were then stored in a mysql database against their name. e.g. billy mary etc. etc. mi...

How to use a method Revision

I am very new to Java. My assignment is to create my own method and then create a class to test it in. My question, do I create the method separate of the class, or within the class? If it is separate of the class, how do I get the class to access my method? (Are they saved as two separate files?) This is what I have so far, but I am g...

How to write this Lisp / Scheme code?

A lambda expression which takes a function (of one argument) and a number, and applies the function to twice the number. ...

Help with this tree-recursive / time complexity Scheme problem?

If you could help me with ANY part of this question, I would appreciate it. Thanks. 2^0 = 1 2^N = 2^(N-1) + 2^(N-1) Convert this definition into an exactly equivalent tree-recursive function called two-to-the-power-of. Describe its asymptotic time complexity and explain why it has this time complexity. Now write a function called ttt...

How would you write a non-recursive algorithm to calculate factorials?

How would you write a non-recursive algorithm to compute n!. ...

Why this code is not working ?

Hi guys I wrote this code and i have two errors. Invalid rank specifier: expected ',' or ']' Cannot apply indexing with [] to an expression of type 'int' Can you help please? static void Main(string[] args) { ArrayList numbers = new ArrayList(); foreach (int number in new int[12] {10,9,8,7,6,5,4,3,2,1}) //...