homework

How to write a function to get the position of the smallest int in a list?

The prototype must be: listMinPos(lst) I'm able to write the same using two arguments, (list and index), but am not able to even think how it can be possible using only the list argument. The following must hold: only 1 argument (the list). no external libraries. function should be recursive (no 'let' inside the function) ...

Is there such a thing as a class that shares aspects of both control and entity stereotypes?

I have a class called 'Inventory' that has two subclasses, 'Drink' and 'Condiment'. They are a part of a software system being developed for use in a hot drinks vending machine. Note that this isn't really going to be implemented, rather it is a piece of coursework for my Software Engineering class. Anyway, I'm having trouble deciding wh...

Parse and pivot student assignment data in c#

I've got a list of student/assignment pairs coming in to my application via flat file into a List object and I'd like to validate those assignment names against a list of assignments I have to see which student has done what assignment (if any). So - I have a list of students, a list of student/assignment pairs, and a list of assignment...

How would one interleve elements of 2 lists in LISP?

Given 2 lists, how can you produce an output of a 3rd list which has it's elements as an interleaved set of L1 and L2? if they are uneven length, nil should be inserted for holes. On a second note, how can I reverse a list? I've super new to LISP and simply modifying existing code... I'd really love to have a good explanation, not jus...

How do I use rand_r and how do I use it in a thread safe way?

I am trying to learn how to use rand_r, and after reading this question I am still a little confused, can someone please take a look and point out what I'm missing? To my understanding, rand_r takes a pointer to some value (or a piece of memory with some initial value) and use it to generate new numbers every time it is called. Each thre...

Python - Homework - Converting Any Base to Any Base

I'm trying to make a program to convert a number in any base to another base of the user's choice. The code I have so far goes like this: innitvar = float(raw_input("Please enter a number: ")) basevar = int(raw_input("Please enter the base that your number is in: ")) convertvar = int(raw_input("Please enter the base that you would like ...

Overloading implicit in c++

full disclosure - this is for a homework assignment. And I normally would not ask for homework help, but here it is. I'm asked to provide 5 examples of "overloading implicit in c++". I'm sure he is referring to operator overloading for types such as char, int, float, etc in iostream and the types themselves. I understand explicitly o...

command prompt window

I am trying to use multiple parameters to find 3 different extensions in my windows/system32 in one command: exe, dll and sys dir c:\windows\system32*.dll/p i had this correct but can't get all 3 ...

command prompt window

I have to rephrase the question. I don't want my homework done for me. I need to use multiple parameters in my answer. I am looking for 3 differnent extensions in my windows system. how do I use multiple parameters. ...

can anyone help me with bit manipulation. thanks!

I'm not looking for the answers to be given to me, just some direction on what I need to look at to get started. /* copyLSB - set all bits of result to least significant bit of x * Example: copyLSB(5) = 0xFFFFFFFF, copyLSB(6) = 0x00000000 * Legal ops: ! ~ & ^ | + << >> * Max ops: 5 * Rating: 2 */ int copyLSB(int x) { return 0; ...

Proof by Induction of the sum of heights of nodes in a full binary tree

I'm trying to prove the following by induction: sum(k*2^(H-k), k = 0 .. H) = N-H-1 it's a problem for an algorithms class. I was thinking I could do what I normally do for summations, which is to assume that it works for some P(m) and then increment the sum for P(m+1) and work backwards by adding to the right side what the additional ...

Help for The final year project.

I want to create a project for my final year of o'level and i have an idea of creating an online Teacher - Student class room, i dont know where to start with .. i need serious help .. what languages what tutorials .. I just know the basics of C sharp and planning to learn Asp.Net. and i also want to mention the state of urgency .. I h...

Using k-fold cross validation in a neural network

Hi, I'm attempting to implement k-fold cross validation in an functional neural network. The training process is online, and I'm using k=10 for my initial testing. My question is: what is the best way to use the errors to figure out when to stop training? I compute the root mean squared error for each particular training instance (whic...

Endless for loop

Hi, I have the following loop. for(byte i = 0 ; i < 128; i++){ System.out.println(i + 1 + " " + name); } When I execute my programm it prints all numbers from -128 to 127 in a loop. But the loop seems to be endless. Any ideas? ...

How many times different letters appear in different words?

Hi everyone. How to know how many times strings s , t and n appear in each of the following words to have an output like this: descriptions: s 2 , t 1 , n 1 statements s 2 , t 3 , n 1 The words are not known in advance.The first thing came to my mind was to make a dictionary, but for dictionaries we can only have two unknowns, so an...

Need help for project

i Want to create a project for my o'level's final year , i was willing to create a teacher-student online classroom which will be enhanced with features like if teacher assigned some homework to his student than student will recieve its homework, date when it should be submitted and many else thing .. but the problem is i dont know from ...

Efficiency of Algorithm

This is a direct quote from the textbook, Invitation to Computer Science by G.Michael Scneider and Judith L.Gersting. At the end of Section 3.4.2, we talked about the tradeoff between using sequential search on an unsorted list as opposed to sorting the list and then using binary search. If the list size is n=100,000 about how many ...

i need information on system calls and understanding them

Hello guys, i am new to the Operating System development , and in college i have to add a system call to linux kernel, could you guys give me some in sight on what i will have to learn to be able to do this please. i have to extend the linux kernel, so any cool ideas would also be very helpful... thank you ...

Recurrence Relation for a loop

The question is to set up a recurrence relation to find the value given by the algorithm. The answer should be in teta() terms. foo = 0; for int i=1 to n do for j=ceiling(sqrt(i)) to n do for k=1 to ceiling(log(i+j)) do foo++ ...

Recurrence Relation

Hi, everyone I have simple recurrence relation and I need to solve it in teta() terms. (n-1)^2 f(n) = (n-1)(n+1)f(n-1) + (n-3)(n+1)f(n-2) + (n(n-1))/2 That would be great if you can help me out. Thanks ...