How to detect silence in audio files?

What are some good ways to identify similarities in code files in order to detect plaigarism?

  • Let's assume I am professor of a class of 50 students. They submitted their code and I want to check who has copied code with whom? Students are very clever. They have changed the variable names and the Output format. What could be the best way to detect that?  I think (correct me If I am wrong) things like "diff" in Linux won't be able to detect that. Some kind of Natural Language processing will have to be done. Is there any easy way to do that? Any pointer is welcome.

  • Answer:

    plagiarism detection is useful to find similar code and text segments. Source code plagiarism detection is used to detect similar codes and program. I suggest to check out technical report "A comparison of plagiarism detection tools",http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.178.1043&rep=rep1&type=pdf .    I recommend you following tools:- Moss(http://theory.stanford.edu/~aiken/moss/):-  Moss find similarity between different programming languages  codes e.g. C, C++, Java, Pascal, Ada, ML, Lisp, and Scheme code. JPlag:- Jplag can find similarity between  Java, C#, C, C++, Scheme codes and natural language text. PMD(http://pmd.sourceforge.net/pmd-5.0.0/):- PMD can find similarity between java code. it supports  other features like bug detection, dead code detection etc.

Vineet Yadav at Quora Visit the source

Was this solution helpful to you?

Other answers

This is called Plagiarism detection, for computer program codes. The Moss system at Stanford does a pretty good job of this [1]. It can detect most changes, but obviously not everything. You can use their web service to evaulate a lot of student submissions at the same time. You can read about the technical details in their paper. [2] [1] http://theory.stanford.edu/~aiken/moss/ [2] http://theory.stanford.edu/~aiken/publications/papers/sigmod03.pdf

Kornél Csernai

Well, 1) Make some graphs of the programs and use graph isomorphism.  But on the other hand, 2) Realize that as a professor you are giving toy assignments, and it is necessarily true that the number of solutions is much smaller than the number of total students. Once, a 6th grade teacher of mine accused me of plagiarism because a play I wrote for an assignment was too good, in her moronic opinion.  I came from a theatre family and had been reading and going to plays since my fairly early single-digits, so I knew the conventions.  This has left a lifelong allergy for those who look for plagiarism under every rock.

Eric Pepke

The best way to detect two programs have the same "behavior" is actually through unit testing, provided that the assignment is sufficiently complex and allow for plenty of failure modes. Two programs, even if they have undergone separate refactoring efforts (including all cosmetic code changes), will fail for exactly the same set of test cases, if the person doing refactoring does not actively seek out and fix bugs.

Ryan Wong

Program analysis(http://en.wikipedia.org/wiki/Program_analysis)  is the area which can come to rescue here. Static program analysis can detect plagiarism the code without running the code. I am not very knowledgeable in the internal details but at an abstract level it tries to find similarity between the parse trees(concrete), Syntax trees(abstract), data flow graphs and call flow graphs in general. The fundamental book in this regard is Advanced Compiler Design Implementation by Muchnick(http://www.amazon.com/Advanced-Compiler-Design-Implementation-Muchnick/dp/1558603204/ref=pd_sim_b_35) . Graph matching algorithms and string kernels(in machine learning) can also be used to find similarity between the trees. Static program analysis is used extensively for automating code review.

Rahul K Mishra

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.