Google App Java 開発後記

目次

  1. Servlet、form、DataStore、FileUploadに伴うパラム読み込み回りの文字コードの問題について *HTML "'% Escape + Encode *JDO SQL + Escape + DeleteAll + Buffering
  2. 非同期(であるかのような)FileUploadとGoogle認証の両立について Uploadifyを含め *File Post + javascript + Java
  3. データベースKeyとBlobキーについて、やってみたところ公式の方法でなくても普通のファイルと同じようにブロブに書き込めたこと。 ApacheCommonsUpload & com.oreilly.servletのほうのmultipart/form-dataについて *Data Restore @ GAE *Record
研究しないといけないことを増やさないでください

Diffutils

Recompiled for comment out those 2 lines. "wrapText" function is not needed. And I couldn't find out whether it is optionizable. diffutils-1.2.1.jar recompiled

            //removed by Ryoji.Kodakari@gmail.com
            //orig.setLines(StringUtills.wrapText((List<String>) orig.getLines(), this.columnWidth));
            //rev.setLines(StringUtills.wrapText((List<String>) rev.getLines(), this.columnWidth));
class DiffRowGenerator
method generateDiffRows(List<String> original, List<String> revised, Patch patch)
original http://code.google.com/p/java-diff-utils/source/browse/trunk/src/difflib/DiffRowGenerator.java?r=23#216

Running Code

class Record http://bazaar.launchpad.net/~ryoji-kodakari/gt/trunk/view/head:/src/com/tidspr/tsr/Record.java#L76
        final List<String> original = Arrays.asList(_raw.split("\n"));
        final List<String> revised = Arrays.asList(raw.split("\n"));

        final StringBuilder sb = new StringBuilder();
        final DiffRowGenerator.Builder builder = new DiffRowGenerator.Builder();
        final DiffRowGenerator dfg = builder.build();
        final List<DiffRow> rows = dfg.generateDiffRows(original, revised);
        for (final DiffRow diffRow : rows)
        {
            if (diffRow.getTag().equals(DiffRow.Tag.INSERT)) // or use switch* 
            {
                sb.append("<div class='insert'>"   diffRow.getNewLine()   "</div>");
            }
            else if (diffRow.getTag().equals(DiffRow.Tag.DELETE))
            {
                sb.append("<div class='del'>"   diffRow.getOldLine()   "</div>");
            }
            else if (diffRow.getTag().equals(DiffRow.Tag.CHANGE))
            {
                sb.append("<div class='mod'>");
                sb.append("\t<div class='mc'>"   diffRow.getOldLine()   "</div>");
                sb.append("\t<div class='mc'>"   diffRow.getNewLine()   "</div>");
                sb.append("</div>");
            }
        }
    last modified: 11 July 2011 [ View wiki source Close ]
     
SEARCH DIFFERENCE ATTACHMENT RECENT POST