homework

Finding Similarity measure between different images?

problem Statement : I have to make a table consists of ( i,j,s(i,j)) where i and j are Keyframes or images and S(i,j) is similarity measure value between those images. how to find similarity value between two images? Can anyone please tell me how to find this Using sum of squared distances of pixels using Matlab ? My problem cont...

c# logic to get the first non-repeating(distinct) character from the string

In c# i want to create logic that if i a string like abcabda is passed to a method then it should return first non repeative character from string like in above it should return c. i am unable to convert a string to array of character then how to make comparison of each array character to the string and return the first non repeative ch...

Finding the border of a string

Firstofall let me tell you what a border of string is. Let x = abacab. The borders of x are ε, ab . That is a border of a string is a substring which is both a prefix and suffix of it. for e.g. In string abcde hgrab edcba abcde is prefix as well as suffix .Thus it is also the border of above string. Guys please could somebody help me...

class containing a generic type of a child

Is there any possible way that a generic type can be used to contain a child of a base class. From the assignment given to me, I am to create something similar to the following in structure. template <class T> class Fruit { private: int count; int location_id; T type; public: virtual void displayInfo(); }; class Ap...

Algorithm to find the lines bracketing one point

I have following task: In the program we should draw lines on a bit mapped display. An array of n pairs of reals (ai,bi) defined the n lines yi = ai*x + bi. The lines were ordered in the x-interval [0, 1] in the sense that yi < yi+1 for all values of i between 0 and n-2 and for all values of x in [0, 1] Less formally, the lines do...

problem in understanding the hill cipher

i want to implement hill cipher but i think i have problem in understanding the algorithm itself. the key i'll use it 2X2 matrix and i'll encode 2 charachter each time. i'll multiply the key matrix with the matrix of 2 charachters then modulus the result on 26 as this equation C = E(K, P) = KP mod 26 where: K:key P:plain text ...

Need advice for Coursework

Hello, In have Coursework in my university by OOP development. I have some themes in this Coursework, but i can create Coursework inmy own idea. Please can you advice me theme in Coursework by object oriented programming, any programming language supporting OOP. Thank you. ...

scala list of objects, using groupBy with average

Hi, basically I'm not really a Java/Scala fan, but unfortunately I'm forced to use it for my studies. Anyways, I was given an assignment: What the program gets is a list of objects like: Mark(val name String, val style_mark Int, val other_mark Int). How can I use groupBy, to group the marks by name, and get an average for style_mark an...

How to use BuffereImage for a Chess Game

I am trying to create a chess game for java using images my classmate and I are working on. We are using a created image to serve as the board and pieces to place about that the user can drag and place. Unfortunately we do not currently know how to import images from a file directory into the program itself. Not only that, but we are co...

Why does this method always return zero?

I am trying to make a Date() class, however I think my variables may not be working correctly or I am breaking some obscure class rule? One clue I got was during debugging...it directed me to the "thread.Class" and displayed the following code: private void exit() { if (group != null) { group.remove(this); group = nu...

What is the best way to extract a diagonal from a matrix in Haskell?

I was asked to write a function that would extract the diagonal of a matrix stored as a list of lists. The first version was to extract the number by indexing the lists, but I soon concluded it isn't a good algorithm for Haskell and wrote another function: getDiagonal :: (Num a) => [[a]] -> [a] getDiagonal [[]] = [] getDiagonal (x...

repeating back digits?

Hi, I'm trying to use C++ to grab 5 digits from the user and repeat it back to the user. Unfortunately, the closest I have come to that is by repeating it back backwards... any help here? ...

scala sort a list by object parameter error

Ok, I wouldn't be coming to You for help if I knew what to do, anyways, still having problems with my "program". class Mark(val name: String, val style_mark: Double, val other_mark: Double) {} object Test extends Application { val m1 = new Mark("Smith", 18, 16); val m2 = new Mark("Cole", 14, 7); val m3 = new Mark("James", 13, 1...

Can child templates stored in a base class array, use an overloaded virtual function?

In hope to simplify a homework problem dealing with inheritance, I thought it might be better to use polymorphism to accomplish the task. It isn't required, but makes much more sense if possible. I am, however, getting symbol errors making it work as I thought it should or just the base class definition is called. I want the overloade...

where do i add a systemcall to the linux Kernel source

Hello Guys i am tryin to add a new helloworld system call to a new version of the linux ubuntu kernel, i have been looking through the web but i cannot find a consistent example to show me what files i will have to modify to enable a helloworld system call to be added to the kernel. i have tried many and compile error have occured s...

Having trouble debugging variable might not have been initialized error

Hey guys, I have seen a lot of similar questions in the archives, but I can't find a scenario like the problem I'm having. Below is my code. I'm running into erros with "finalPrice" and "grandTotalPrice" may not have been initialized. The lines of code are towards the end of the program. The variables should be assigned totals via c...

Recursion Append list

Heres a snippet: translate("a", "4"). translate("m", "/\\/\\"). tol33t([], []). tol33t([Upper|UpperTail], [Lower|LowerTail]) :- translate([Upper], [Lower]), tol33t(UpperTail, LowerTail). Basically what i want to do is look up in the table for a letter and then get that letter and add it to the new list. What i have works if ...

What would be some orthogonal or non-orthogonal features in Python?

What would be some orthogonal or non-orthogonal features in Python? Can you give some examples? ...

Java : evenly spread out nodes on the circumference of a circle

Hi all: I am working on a simple game in Java, everything goes fine, except I have a situation where I need to evenly spread out nodes on the circumference of a circle. For instance, if there are exactly 4 nodes, then one would go straight to the north, one to the south, one to the east and one to the west. Of course there could be an ...

Java Beginner Help!

I must create a program in which the output would show the season accroding to these ranges: 12/16-3/15 is winter 3/16-6/15 is spring 6/16-9/15 is summer 9/16-12/15 is fall Here is my code thus far: public class season1 { public static void main(String[] args) { System.out.println("Between 12/16 and 3/15 is " + season()); ...