var encoder = new GIFEncoder(); encoder.setRepeat(0); //0 -> loop forever, 1+ -> loop n times then stop encoder.setDelay(500); //go to next frame every n milliseconds
public final float percentBasecodeA(){ float sa = subA.size() - subA.files.length; return bcmatchesA.tokensMatched() * 100 / sa; } public final float percentBasecodeB(){
public final float percentA() { int divisor; if(bcmatchesA != null) divisor = subA.size()-subA.files.length-bcmatchesA.tokensMatched(); else divisor = subA.size()-subA.files.length; return (divisor == 0 ? 0f : (tokensMatched()*100 / (float) divisor)); } public final float percentB() {
public final AllMatches compare(Submission subA, Submission subB) { Submission A, B, tmp; if (subA.struct.size() > subB.struct.size()) { A = subB; B = subA; } else { A = subB; B = subA; } // if hashtable exists in first but not in second structure: flip around! if (B.struct.table == null && A.struct.table != null) { tmp = A; A = B; B = tmp; } return compare(A, B, this.program.get_min_token_match()); }
public final AllBasecodeMatches compareWithBasecode(Submission subA, Submission subB) { Submission A, B, tmp; if (subA.struct.size() > subB.struct.size()) { A = subB; B = subA; } else { A = subB; B = subA; } // if hashtable exists in first but not in second structure: flip around! if (B.struct.table == null && A.struct.table != null) { tmp = A; A = B; B = tmp; } return compareWithBasecode(A, B, this.program.get_min_token_match()); }
private int writeTop(int i, AllMatches match) throws jplag.ExitException { HTMLFile f = openHTMLFile(root, "match" + i + "-top.html"); writeHTMLHeaderWithScript(f, "Top"); f.println("<BODY BGCOLOR=\"#ffffff\">"); if (this.program.use_externalSearch()) { f.println("<A HREF=\"match" + i + "-dist.html\" TARGET=\"_top\">" + msg.getString("Report.Distribution") + "</A><P>"); } match.HTMLreport(f, i, this.program); f.println("</BODY>\n</HTML>\n"); f.close(); return f.bytesWritten(); }
public void resetBaseSubmission(Submission sub){ Structure tmpStruct = sub.struct; Token[] tok = tmpStruct.tokens; for (int z = 0; z < tmpStruct.size()-1;z++){ tok[z].basecode = false; } } }
private int writeDist(int i, AllMatches match) throws jplag.ExitException { HTMLFile f = openHTMLFile(root, "match" + i + "-dist.html"); writeHTMLHeader(f, msg.getString("Report.Token_Distribution")); f.println("<BODY>"); match.distributionReport(f, msg); f.println("</BODY>\n</HTML>"); f.close(); return f.bytesWritten(); }
public final void addMatch(int startA, int startB, int length) { for (int i=anzahl-1; i>=0; i--) { // starting at the end is better(?) if (matches[i].overlap(startA,startB,length)) return; // no overlaps! } ensureCapacity(anzahl + 1); //if (matches[anzahl] != null) // object recycling... matches[anzahl].set(startA,startB,length); //else //matches[anzahl ] = new Match(startA,startB,length); anzahl++; }
public short findCharString(short index, byte b) { int hshidx, nxtidx; if (index == HASH_FREE) return b; hshidx = Hash(index, b); while ((nxtidx = strHsh_[hshidx]) != HASH_FREE) { if (strNxt_[nxtidx] == index && strChr_[nxtidx] == b) return (short) nxtidx; hshidx = (hshidx + HASHSTEP) % HASHSIZE; } // ends while return (short) 0xFFFF; } // ends findCharString(short, byte)
public void writeHTMLHeader(HTMLFile file, String title) { file.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); file.println("<HTML><HEAD><TITLE>" + title + "</TITLE>"); file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"); file.println("</HEAD>"); }
private final int biggestMatch() { int erg = 0; for (int i=0; i<size(); i++) if (matches[i].length>erg) erg=matches[i].length; return erg; } public final boolean moreThan(float percent) {
public final float roundedPercentMaxAB() { float percent = percentMaxAB(); return ((int)(percent * 10)) / (float)10; } public final float percentMaxAB() {
public int compare(AllMatches o1, AllMatches o2) { float p1 = o1.percentMinAB(); float p2 = o2.percentMinAB(); if (p1 == p2) return 0; if (p1 < p2) return -1; else return 1; } }
public final float percentB() { int divisor; if(bcmatchesB != null) divisor = subB.size()-subB.files.length-bcmatchesB.tokensMatched(); else divisor = subB.size()-subB.files.length; return (divisor == 0 ? 0f : (tokensMatched()*100 / (float) divisor)); }
public final float percentBasecodeB(){ float sb = subB.size() - subB.files.length; return bcmatchesB.tokensMatched() * 100 / sb; } public final float roundedPercentBasecodeA() {
public final float percent() { float sa, sb; if(bcmatchesB != null && bcmatchesA != null){ sa = subA.size() - subA.files.length - bcmatchesA.tokensMatched(); sb = subB.size() - subB.files.length - bcmatchesB.tokensMatched(); } else{ sa = subA.size() - subA.files.length; sb = subB.size() - subB.files.length; } return (200*(float)tokensMatched())/(sa+sb); } public final float percentA() {