text:
from __future__ import print_function

# from cloudmesh_job.cm_jobdb import JobDB
from cmd3.console import Console
from cmd3.shell import command
import hostlist
from pprint import pprint
from cloudmesh_base.util import banner
from cloudmesh_job.cm_jobdb import JobDB
from cloudmesh_pbs.DbPBS import DbPBS
from cloudmesh_job.command_job import CommandJob
from cloudmesh_base.tables import row_table
from prettytable import PrettyTable
import yaml
import os

def job_table(d, order=None, labels=None):
    """prints a pretty table from data in the dict.
    :param d: A dict to be printed
    :param order: The order in which the columns are printed.
                  The order is specified by the key names of the dict.
    """
    # header

    x = PrettyTable(labels)

    # get attributes from firts element
    attributes = d[d.keys()[0]].keys()

    if order is None:
        order = attributes
    for key in d:
        value = d[key]
        if type(value) == list:
            x.add_row([key, value[0]])
            for element in value[1:]:
                x.add_row(["", element])
        elif type(value) == dict:
            value_keys = value.keys()
            first_key = value_keys[0]
            rest_keys = value_keys[1:]
            x.add_row([key, "{0} : {1}".format(first_key, value[first_key])])
            for element in rest_keys:
                x.add_row(["", "{0} : {1}".format(element, value[element])])
        else:
            x.add_row([key, value])

    x.align = "l"
    return x

def job_table_2(d, order=None, labels=None):
    """prints a pretty table from data in the dict.
    :param d: A dict to be printed
    :param order: The order in which the columns are printed.
                  The order is specified by the key names of the dict.
    """
    # header

    # get attributes from firts element
    attributes = d[d.keys()[0]].keys()
    x = PrettyTable(attributes)

    if order is None:
        order = attributes
    for key in d:
        element = d[key]
        l = []
        for attribute in attributes:
            l.append(str(element[attribute]))
        x.add_row(l)

        '''
        if type(value) == list:
            x.add_row([key, value[0]])
            for element in value[1:]:
                x.add_row(["", element])
        elif type(value) == dict:
            value_keys = value.keys()
            first_key = value_keys[0]
            rest_keys = value_keys[1:]
            x.add_row([key, "{0} : {1}".format(first_key, value[first_key])])
            for element in rest_keys:
                x.add_row(["", "{0} : {1}".format(element, value[element])])
        else:
            x.add_row([key, value])
        '''

    x.align = "l"
    return x

class cm_shell_job:
    db = None

    def activate_cm_shell_job(self):
        self.register_command_topic('HPC', 'job')

    @command
    def do_job(self, args, arguments):
        """
        ::

            Usage:
                job server start
                job server stop
                job server clean
                job server deploy
                job server ps
                job server info
                job server pid
                job script add FILENAME [--name=NAME]
                job script delete NAMES
                job script get NAME FILENAME
                job script cat NAME
                job script list
                job info
                job stat
                job list [--output=FORMAT]
                job add JOBLIST [--host=HOST] [--options=OPTIONS] [--inputs=INPUTS] [--outputs=OUTPUTS]
                job load FILE
                job write --file=filename
                job find --name=NAME
                job find --attribute=ATTRIBUTE --value=VALUE
                job delete JOBLIST

            Arguments:

                NAME       the name of the job
                HOST       the host on which the job should run
                OPTIONS    options passed to the command
                INPUTS     input files
                OUTPUTS    output files
                ATTRIBUTE  an attribute
                VALUE      a value
                JOBLIST    the job list

            Description:

                manages a job catalog to submit them to a computation cloud
                or Grid.

                Server Management

                    job server start
                        starts the job server

                    job server stop
                        stops the job server

                    job server clean
                        removes all data in the job server and does a graceful clean, e.g deletes all scheduled jobs

                    job server kill
                        kills just the job server, but does not delete the jobs from the schedulers.
                        this command should not be called in normal circumstances.

                Job Management

                    job set GROUP
                        sets the default job group

                    job add  GROUP TODO
                        adds a job to a group

                    job server start
                        starts the server

                    job server stop
                        stops the server

                    job stat
                        prints a simple statistics of the jobs

                    job add NAMES [--host=HOST] [--option=OPTIONS] [--inputs=INPUTS] [--outputs=OUTPUTS]
                        adds a number of jobs

                    job add --file=filename
                        adds the job from the file. The postfix of the file deterimnes which
                        format it is. The formats supported are .csv, .yaml, .json

                    job write --file=filename
                        writes the jobs to a file. The postfix of the file deterimnes which
                        format it is. Thfe formats supported are .csv, .yaml, .json

                    job list [--output=OUTPUT]
                        lists the jobs in the format specified

                    job find --name=NAME
                        find the job with the given name

                    job find --attribute=ATTRIBUTE --value=VALUE
                        find jobs that match the given attribute.

                    job delete JOBLIST

                        delete the job with the specified names in the joblist.

                THE FOLLOWING IS NOT YET DEFINED OR MAY CHANGE

                job add TODO

                    ... not yet sure what in the rest of the command

                    adds a job to the job server and returns its id

                job last
                    returns the last job added to the server

                job delete ID
                    deletes the job from the job server and cancels it if it is scheduled for execution.

                job info ID
                    give the info of a job

                job submit ID HOST
                    submits the job with the given ID to the host

                job list GROUP
                    lists the jobs in the group

                job status [ID | GROUP]
                    list the status of a single job or the status of all jobs in the group

                job status statistics
                    list the statistics of the jobs in the job server (e.g. for the states)
        """
        # pprint(arguments)

        def connect():
            try:
                db = JobDB()
                db.connect()
            except Exception, e:
                print(e)
                raise Exception("connection error")
            return db

        if arguments["script"]:

            if arguments["add"]:

                # job script add FILENAME [--name=NAME]
                filename = arguments["FILENAME"]

                base=os.path.basename(filename)

                if "." in base:
                    name = base.split(".")[0]
                else:
                    name = base

                if arguments["--name"] is not None:
                    name =arguments["--name"]

                print ("Adding script {:} <- {:}".format(name, filename))

                db = connect()
                db.add_script_from_file(name, filename)
                return

            elif arguments["delete"]:
                # job script delete NAMES

                if arguments["NAMES"]:
                    names = hostlist.expand_hostlist(arguments["NAMES"])

                    db = connect()
                    for name in names:
                        print ("Delete Script", name)
                        db.delete_script(name)
                return

            elif arguments["get"]:
                # job script get NAME FILENAME
                Console.ok("get script")

                if arguments["NAME"]:
                    name = arguments["NAME"]
                    filename = arguments["FILENAME"]
                    db = connect()
                    db.write_script(name, filename)

                return

            elif arguments["cat"]:
                # job script cat NAME

                if arguments["NAME"]:
                    name = arguments["NAME"]
                    db = connect()
                    script = db.get_script(name)
                    print (script)

                return

            elif arguments["list"]:

                db = connect()
                scripts = db.list_scripts()
                if scripts is not None:
                    print("\n".join(scripts))
                return

        if arguments["server"]:

            if arguments["start"]:
                db = JobDB()
                db.start()
                return
            elif arguments["stop"]:
                db = JobDB()
                db.stop()
                return
            elif arguments["ps"]:
                db = connect()
                db.ps()
                return
            elif arguments["clean"]:
                db = connect()
                db.delete_jobs()
                return
            elif arguments["deploy"]:
                db = JobDB()
                db.deploy()
                return
            elif arguments["pid"]:
                try:
                    db = connect()
                    print(db.pid())
                except:
                    print("ERROR: connecting to server")
                return
            elif arguments["info"]:
                try:
                    db = connect()
                    db.info()
                except Exception, e:
                    print("ERROR: connecting to server")
                    print(e)
                return

        if arguments["info"]:
            db = connect()
            db.info()
            return

        elif arguments["stat"]:
            db = connect()
            db.stat()
            return

        elif arguments["delete"] and arguments["JOBLIST"]:

            joblist = hostlist.expand_hostlist(arguments["JOBLIST"])

            db = connect()

            for job in joblist:
                # if job exists:
                Console.ok("delete job {:}".format(job))

                db.delete_jobs("job_name", job)

        elif arguments["load"] and arguments["FILE"]:
            filename = arguments["FILE"]
            print("load", filename)
            db = connect()
            db.add_from_yaml(filename)
            return

        elif arguments["add"]:
            '''
                name = arguments["NAME"]
                host = arguments["HOST"]
                options = arguments["OPTIONS"]
                input_files = arguments["INPUT_FILES"]
                output_file = arguments["OUTPUT_FILES"]

                db = connect()

                db.insert(name, input_files, output_file, options, host)
                Console.ok("add")
            '''

            joblist = hostlist.expand_hostlist(arguments["JOBLIST"])

            host = [None]
            inputs = [None]
            outputs = [None]
            options = [None]

            db = connect()

            if arguments.get("--host"):
                host = arguments["--host"]
            if arguments["--inputs"]:
                inputs = hostlist.expand_hostlist(arguments["--inputs"])
            if arguments["--outputs"]:
                outputs = hostlist.expand_hostlist(arguments["--outputs"])
            if arguments["--options"]:
                options = hostlist.expand_hostlist(arguments["--options"])
                # check if inputs are either 0, 1 or the length of joblist

                def expand_parameter(parameter, label):
                    """

                    :param parameter:
                    :param label:
                    :return: list of strings
                    """
                    _parameter = parameter
                    if len(_parameter) == 1:
                        _parameter = _parameter * len(joblist)
                    elif len(_parameter) == len(joblist):
                        pass
                    else:
                        Console.error("the number of input files do not match the hostlist")
                        print("joblist count:", len(joblist))
                        print(label, "count: ", len(_parameter))
                    return _parameter

                options = expand_parameter(options, "options")
                inputs = expand_parameter(inputs, "inputs")
                outputs = expand_parameter(outputs, "outputs")

                # dependent on if 0, 1, or length of joblist handle that

                for i in range(len(joblist)):
                    banner(str(i))

                    Console.ok("add job : {:} ".format(joblist[i]))
                    Console.ok("  input : {:} ".format(inputs[i]))
                    Console.ok("  output: {:} ".format(outputs[i]))

                    # Build the dictionary for the job to be added
                    job = {
                        "job_name": joblist[i],
                        "input": inputs[i],
                        "output": outputs[i]
                    }

                    # Add the job
                    db.add(job)

        elif arguments["list"]:

            output = arguments["--output"]
            db = connect()

            jobs = db.find_jobs()

            d = {}
            for job in jobs:
                name = job["job_name"]
                d[name] = job

            if output is None:
                output = 'table'

            if 'json' in output:
                pprint (d)
            elif 'table' in output:
                print(
                    job_table_2(d)
                    #job_table_2(d,
                    #         order=['job_name','group'],
                    #         labels=['Job','Attributes'])
                )
            elif 'yaml' in output:
                print(yaml.safe_dump(d))

            # wrong:
            # get a list of all jobs and passes it to PBS class with output parameter
            # pbs = DbPBS()
            #pbs.list(allJobs, output)

            Console.ok("lists the jobs in the format specified")
            return

        elif arguments["write"]:
            '''call list function and then write output to a file'''
            filename = arguments["--filename"]

            # check if file exists
            # if it does ask if you want to overwrite
            # -f force

            target = open(filename)

            db = connect()

            allJobs = db.find_jobs()
            pbs = DbPBS()

            '''review string, determine output format, call PBS class, write to filename'''
            if filename.endswith("csv"):
                toOutput = pbs.list(allJobs, output="csv")
            elif filename.endswith("json"):
                toOutput = pbs.list(allJobs, output="json")
            elif filename.endswith("yaml"):
                toOutput = pbs.list(allJobs, output="yaml")

            target.write(toOutput)

            target.close()

        elif arguments["find"] and arguments["--name"]:

            name = arguments["NAME"]

            db = connect()
            db.find_jobs("job_name", name)

            Console.ok("find the job with the given name")

        elif arguments["find"] and arguments["--attribute"] and arguments["--value"]:

            name = arguments["NAME"]
            attribute = arguments["--attribute"]
            value = arguments["--value"]

            db = connect()
            db.find_jobs(attribute, value)

            Console.ok("job find --attribute=ATTRIBUTE --value=VALUE")

        pass

if __name__ == '__main__':
    command = cm_shell_job()
    command.do_job()


text:
var api = require('lib/server/api');
var express = require('express');
var omni = require('omni-di');
var assert = require('assert');
var request = require('request');
var _ = require('underscore');
var fs = require('fs');
var yaml = require('js-yaml');
var status = require('http-status');
var fs = require('fs');

var di = omni();
omni.addInjectToFunctionPrototype(di);

di.register('config', _.extend(require('lib/server/config.js'),
  yaml.safeLoad(fs.readFileSync('./axl.config.yml'))));

require('lib/server/dependencies')(di);

describe('REST API', function() {
  describe('releases', function() {
    var app;
    var server;
    var Release = di.get('Release');
    var Project = di.get('Project');
    var user = {
      id: '1234',
      username: 'code_barbarian'
    };

    var authStub = {
      checkLogin: function() {
        return function(req, res, next) {
          req.user = user;
          next();
        };
      }
    }

    beforeEach(function(done) {
      app = express();
      app.use('/api', api(di, authStub));
      server = app.listen(3000);
      Project.remove({}, function() {
        Release.remove({}, function() {
          done();
        });
      });
    });

    afterEach(function(done) {
      server.close();
      done();
    });

    it('should be able to load a version', function(done) {
      Release.create(
        {
          project: 'mongo-sanitize',
          version: '1.0.0',
          releaseNumber: 0,
          download: 'google.com'
        },
        function(error) {
          assert.ifError(error);

          var url = 'http://localhost:3000/api/release?' +
            'project=mongo-sanitize&version=1.0.0';
          request.get(url, function(e, r, body) {
            assert.ifError(e);
            var obj = JSON.parse(body);
            assert.equal('1.0.0', obj.release.version);
            assert.equal('mongo-sanitize', obj.release.project);
            done();
          });
        });
    });

    it('should stream through multiple versions', function(done) {
      Release.create(
        {
          project: 'mongo-sanitize',
          version: '1.0.0',
          releaseNumber: 0,
          download: 'google.com'
        },
        {
          project: 'mongo-sanitize',
          version: '1.0.1',
          releaseNumber: 1,
          download: 'google.com'
        },
        function(error) {
          assert.ifError(error);

          var url = 'http://localhost:3000/api/release?' +
            'project=mongo-sanitize&version=1.0.0';
          request.get(url, function(e, r, body) {
            assert.ifError(e);
            var obj = JSON.parse(body);
            assert.equal('1.0.0', obj.release.version);
            assert.equal('mongo-sanitize', obj.release.project);
            done();
          });
        });
    });

    it('should be able to parse semver', function(done) {
      Release.create(
        {
          project: 'mongo-sanitize',
          version: '1.0.0',
          releaseNumber: 0,
          download: 'google.com'
        },
        {
          project: 'mongo-sanitize',
          version: '1.0.1',
          releaseNumber: 1,
          download: 'google.com'
        },
        {
          project: 'mongo-sanitize',
          version: '1.1.0',
          releaseNumber: 2,
          download: 'google.com'
        },
        function(error) {
          assert.ifError(error);

          var v = encodeURIComponent('~1.0');
          var url = 'http://localhost:3000/api/release?' +
            'project=mongo-sanitize&version=' + v;
          request.get(url, function(e, r, body) {
            assert.ifError(e);
            var obj = JSON.parse(body);
            assert.equal('1.0.1', obj.release.version);
            assert.equal('mongo-sanitize', obj.release.project);
            done();
          });
        });
    });

    it('should be able to upload a tarball', function(done) {
      var project = {
        name: 'mongo-sanitize',
        releases: [],
        data: { maintainers: [{ username: 'code_barbarian' }] }
      };
      Project.create(project, function(error) {
        assert.ifError(error);
        var url = 'http://localhost:3000/api/release?' +
          'project=mongo-sanitize&version=1.0.0';
        var size = fs.statSync('test/integration/api/test.go.tgz').size;
        var writeStream = request.post({
          url: url,
          headers: { 'Content-Length': size }
        });
        var readStream = fs.createReadStream(
          'test/integration/api/test.go.tgz');
        readStream.pipe(writeStream);
        writeStream.on('response', function(data) {
          Project.findOne({ name: 'mongo-sanitize' },
            function(error, project) {
              assert.ifError(error);
              assert.ok(!!project);
              assert.equal(1, project.releases.length);
              Release.findOne(
                { project: 'mongo-sanitize', version: '1.0.0' },
                function(error, release) {
                  assert.ifError(error);
                  assert.ok(!!release);
                  assert.ok(release.download.indexOf('cloudfront') != -1);
                });
              done();
            });
        });
        writeStream.on('error', function(error) {
          assert.ifError(error);
          done();
        });
        readStream.on('error', function(error) {
          assert.ifError(error);
          done();
        });
      });
    });

    it('should fail to create a new release if one already exists', function(done) {
      var project = {
        name: 'mongo-sanitize',
        releases: ['1.0.0'],
        data: { maintainers: [{ username: 'code_barbarian' }] }
      };
      Project.create(project, function(error) {
        assert.ifError(error);
        Release.create(
          {
            project: 'mongo-sanitize',
            version: '1.0.0',
            releaseNumber: 0,
            download: 'google.com'
          },
          function(error) {
            assert.ifError(error);

            var url = 'http://localhost:3000/api/release?' +
              'project=mongo-sanitize&version=1.0.0';
            request.post(url, function(e, r, body) {
              assert.ifError(e);
              var obj = JSON.parse(body);
              assert.equal(status.CONFLICT, r.statusCode);
              assert.equal('Cant overwrite existing release mongo-sanitize@1.0.0', obj.error);
              done();
            });
          });
      });
    });
  });
});

redpajama_set_name: RedPajamaGithub


text:
import net.sf.json.JSONObject
import com.test.HttpApi

object Test {
    /* This is my first java program.
     * This will print 'Hello World' as the output
     */
    def main(args: Array[String]) {

        val test1_args = new JSONObject()
        test1_args.put("room_id", 73)
        test1_args.put("expire", 1000)
        test1_args.put("uid", "234234")
        test1_args.put("nick", "ttt")
        test1_args.put("ava", "")

        val test_1 = HttpApi.post("RoomMgr", "getAuthToken", test1_args)
        println("test_1 " +test_1.toString() )

        val test2_args = new JSONObject()
        test2_args.put("token", test_1.get("Info"))
        test2_args.put("page", 1)
        test2_args.put("num", 20)

        val test_2 = HttpApi.post("JiaoYuUserInfo", "listWisDoc", test2_args)
        System.out.println("test_2 " + test_2.toString())
    }
}


text:
package org.apache.accumulo.tserver;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.tserver.data.ServerConditionalMutation;
import org.apache.hadoop.io.WritableComparator;

public class ConditionalMutationSet {

  interface DeferFilter {
    void defer(List<ServerConditionalMutation> scml, List<ServerConditionalMutation> okMutations,
        List<ServerConditionalMutation> deferred);
  }

  static class DuplicateFilter implements DeferFilter {
    @Override
    public void defer(List<ServerConditionalMutation> scml,
        List<ServerConditionalMutation> okMutations, List<ServerConditionalMutation> deferred) {
      okMutations.add(scml.get(0));
      for (int i = 1; i < scml.size(); i++) {
        if (Arrays.equals(scml.get(i - 1).getRow(), scml.get(i).getRow())) {
          deferred.add(scml.get(i));
        } else {
          okMutations.add(scml.get(i));
        }
      }
    }
  }

  static void defer(Map<KeyExtent,List<ServerConditionalMutation>> updates,
      Map<KeyExtent,List<ServerConditionalMutation>> deferredMutations, DeferFilter filter) {
    for (Entry<KeyExtent,List<ServerConditionalMutation>> entry : updates.entrySet()) {
      List<ServerConditionalMutation> scml = entry.getValue();
      List<ServerConditionalMutation> okMutations = new ArrayList<>(scml.size());
      List<ServerConditionalMutation> deferred = new ArrayList<>();
      filter.defer(scml, okMutations, deferred);

      if (!deferred.isEmpty()) {
        scml.clear();
        scml.addAll(okMutations);
        List<ServerConditionalMutation> l = deferredMutations.get(entry.getKey());
        if (l == null) {
          l = deferred;
          deferredMutations.put(entry.getKey(), l);
        } else {
          l.addAll(deferred);
        }

      }
    }
  }

  static void deferDuplicatesRows(Map<KeyExtent,List<ServerConditionalMutation>> updates,
      Map<KeyExtent,List<ServerConditionalMutation>> deferred) {
    defer(updates, deferred, new DuplicateFilter());
  }

  static void sortConditionalMutations(Map<KeyExtent,List<ServerConditionalMutation>> updates) {
    for (Entry<KeyExtent,List<ServerConditionalMutation>> entry : updates.entrySet()) {
      entry.getValue().sort((o1, o2) -> WritableComparator.compareBytes(o1.getRow(), 0,
          o1.getRow().length, o2.getRow(), 0, o2.getRow().length));
    }
  }
}


text:
class CreateCollectionAlbums < ActiveRecord::Migration
  def self.up
    create_table :collection_albums do |t|
      t.references :collection
      t.references :album

      t.timestamps
    end
  end

  def self.down
    drop_table :collection_albums
  end
end


text:
using MasterDevs.ChromeDevTools;

namespace MasterDevs.ChromeDevTools.Protocol
{
	public static class ProtocolName
	{
		public static class Inspector
		{
			public const string Enable = "Inspector.enable";
			public const string Disable = "Inspector.disable";
			public const string EvaluateForTestInFrontend = "Inspector.evaluateForTestInFrontend";
			public const string Inspect = "Inspector.inspect";
			public const string Detached = "Inspector.detached";
			public const string TargetCrashed = "Inspector.targetCrashed";
		}

		public static class Memory
		{
			public const string GetDOMCounters = "Memory.getDOMCounters";
		}

		public static class Page
		{
			public const string Enable = "Page.enable";
			public const string Disable = "Page.disable";
			public const string AddScriptToEvaluateOnLoad = "Page.addScriptToEvaluateOnLoad";
			public const string RemoveScriptToEvaluateOnLoad = "Page.removeScriptToEvaluateOnLoad";
			public const string Reload = "Page.reload";
			public const string Navigate = "Page.navigate";
			public const string GetNavigationHistory = "Page.getNavigationHistory";
			public const string NavigateToHistoryEntry = "Page.navigateToHistoryEntry";
			public const string GetCookies = "Page.getCookies";
			public const string DeleteCookie = "Page.deleteCookie";
			public const string GetResourceTree = "Page.getResourceTree";
			public const string GetResourceContent = "Page.getResourceContent";
			public const string SearchInResource = "Page.searchInResource";
			public const string SetDocumentContent = "Page.setDocumentContent";
			public const string SetDeviceMetricsOverride = "Page.setDeviceMetricsOverride";
			public const string ClearDeviceMetricsOverride = "Page.clearDeviceMetricsOverride";
			public const string SetGeolocationOverride = "Page.setGeolocationOverride";
			public const string ClearGeolocationOverride = "Page.clearGeolocationOverride";
			public const string SetDeviceOrientationOverride = "Page.setDeviceOrientationOverride";
			public const string ClearDeviceOrientationOverride = "Page.clearDeviceOrientationOverride";
			public const string SetTouchEmulationEnabled = "Page.setTouchEmulationEnabled";
			public const string CaptureScreenshot = "Page.captureScreenshot";
			public const string CanScreencast = "Page.canScreencast";
			public const string StartScreencast = "Page.startScreencast";
			public const string StopScreencast = "Page.stopScreencast";
			public const string ScreencastFrameAck = "Page.screencastFrameAck";
			public const string HandleJavaScriptDialog = "Page.handleJavaScriptDialog";
			public const string SetShowViewportSizeOnResize = "Page.setShowViewportSizeOnResize";
			public const string SetColorPickerEnabled = "Page.setColorPickerEnabled";
			public const string SetOverlayMessage = "Page.setOverlayMessage";
			public const string DomContentEventFired = "Page.domContentEventFired";
			public const string LoadEventFired = "Page.loadEventFired";
			public const string FrameAttached = "Page.frameAttached";
			public const string FrameNavigated = "Page.frameNavigated";
			public const string FrameDetached = "Page.frameDetached";
			public const string FrameStartedLoading = "Page.frameStartedLoading";
			public const string FrameStoppedLoading = "Page.frameStoppedLoading";
			public const string FrameScheduledNavigation = "Page.frameScheduledNavigation";
			public const string FrameClearedScheduledNavigation = "Page.frameClearedScheduledNavigation";
			public const string FrameResized = "Page.frameResized";
			public const string JavascriptDialogOpening = "Page.javascriptDialogOpening";
			public const string JavascriptDialogClosed = "Page.javascriptDialogClosed";
			public const string ScreencastFrame = "Page.screencastFrame";
			public const string ScreencastVisibilityChanged = "Page.screencastVisibilityChanged";
			public const string ColorPicked = "Page.colorPicked";
			public const string InterstitialShown = "Page.interstitialShown";
			public const string InterstitialHidden = "Page.interstitialHidden";
		}

		public static class Rendering
		{
			public const string SetShowPaintRects = "Rendering.setShowPaintRects";
			public const string SetShowDebugBorders = "Rendering.setShowDebugBorders";
			public const string SetShowFPSCounter = "Rendering.setShowFPSCounter";
			public const string SetContinuousPaintingEnabled = "Rendering.setContinuousPaintingEnabled";
			public const string SetShowScrollBottleneckRects = "Rendering.setShowScrollBottleneckRects";
		}

		public static class Emulation
		{
			public const string SetDeviceMetricsOverride = "Emulation.setDeviceMetricsOverride";
			public const string ClearDeviceMetricsOverride = "Emulation.clearDeviceMetricsOverride";
			public const string ResetScrollAndPageScaleFactor = "Emulation.resetScrollAndPageScaleFactor";
			public const string SetPageScaleFactor = "Emulation.setPageScaleFactor";
			public const string SetScriptExecutionDisabled = "Emulation.setScriptExecutionDisabled";
			public const string SetGeolocationOverride = "Emulation.setGeolocationOverride";
			public const string ClearGeolocationOverride = "Emulation.clearGeolocationOverride";
			public const string SetTouchEmulationEnabled = "Emulation.setTouchEmulationEnabled";
			public const string SetEmulatedMedia = "Emulation.setEmulatedMedia";
			public const string CanEmulate = "Emulation.canEmulate";
			public const string ViewportChanged = "Emulation.viewportChanged";
		}

		public static class Runtime
		{
			public const string Evaluate = "Runtime.evaluate";
			public const string CallFunctionOn = "Runtime.callFunctionOn";
			public const string GetProperties = "Runtime.getProperties";
			public const string GetEventListeners = "Runtime.getEventListeners";
			public const string ReleaseObject = "Runtime.releaseObject";
			public const string ReleaseObjectGroup = "Runtime.releaseObjectGroup";
			public const string Run = "Runtime.run";
			public const string Enable = "Runtime.enable";
			public const string Disable = "Runtime.disable";
			public const string IsRunRequired = "Runtime.isRunRequired";
			public const string SetCustomObjectFormatterEnabled = "Runtime.setCustomObjectFormatterEnabled";
			public const string ExecutionContextCreated = "Runtime.executionContextCreated";
			public const string ExecutionContextDestroyed = "Runtime.executionContextDestroyed";
			public const string ExecutionContextsCleared = "Runtime.executionContextsCleared";
		}

		public static class Console
		{
			public const string Enable = "Console.enable";
			public const string Disable = "Console.disable";
			public const string ClearMessages = "Console.clearMessages";
			public const string MessageAdded = "Console.messageAdded";
			public const string MessageRepeatCountUpdated = "Console.messageRepeatCountUpdated";
			public const string MessagesCleared = "Console.messagesCleared";
		}

		public static class Network
		{
			public const string Enable = "Network.enable";
			public const string Disable = "Network.disable";
			public const string SetUserAgentOverride = "Network.setUserAgentOverride";
			public const string SetExtraHTTPHeaders = "Network.setExtraHTTPHeaders";
			public const string GetResponseBody = "Network.getResponseBody";
			public const string ReplayXHR = "Network.replayXHR";
			public const string SetMonitoringXHREnabled = "Network.setMonitoringXHREnabled";
			public const string CanClearBrowserCache = "Network.canClearBrowserCache";
			public const string ClearBrowserCache = "Network.clearBrowserCache";
			public const string CanClearBrowserCookies = "Network.canClearBrowserCookies";
			public const string ClearBrowserCookies = "Network.clearBrowserCookies";
			public const string GetCookies = "Network.getCookies";
			public const string DeleteCookie = "Network.deleteCookie";
			public const string CanEmulateNetworkConditions = "Network.canEmulateNetworkConditions";
			public const string EmulateNetworkConditions = "Network.emulateNetworkConditions";
			public const string SetCacheDisabled = "Network.setCacheDisabled";
			public const string SetDataSizeLimitsForTest = "Network.setDataSizeLimitsForTest";
			public const string RequestWillBeSent = "Network.requestWillBeSent";
			public const string RequestServedFromCache = "Network.requestServedFromCache";
			public const string ResponseReceived = "Network.responseReceived";
			public const string DataReceived = "Network.dataReceived";
			public const string LoadingFinished = "Network.loadingFinished";
			public const string LoadingFailed = "Network.loadingFailed";
			public const string WebSocketWillSendHandshakeRequest = "Network.webSocketWillSendHandshakeRequest";
			public const string WebSocketHandshakeResponseReceived = "Network.webSocketHandshakeResponseReceived";
			public const string WebSocketCreated = "Network.webSocketCreated";
			public const string WebSocketClosed = "Network.webSocketClosed";
			public const string WebSocketFrameReceived = "Network.webSocketFrameReceived";
			public const string WebSocketFrameError = "Network.webSocketFrameError";
			public const string WebSocketFrameSent = "Network.webSocketFrameSent";
			public const string EventSourceMessageReceived = "Network.eventSourceMessageReceived";
		}

		public static class Database
		{
			public const string Enable = "Database.enable";
			public const string Disable = "Database.disable";
			public const string GetDatabaseTableNames = "Database.getDatabaseTableNames";
			public const string ExecuteSQL = "Database.executeSQL";
			public const string AddDatabase = "Database.addDatabase";
		}

		public static class IndexedDB
		{
			public const string Enable = "IndexedDB.enable";
			public const string Disable = "IndexedDB.disable";
			public const string RequestDatabaseNames = "IndexedDB.requestDatabaseNames";
			public const string RequestDatabase = "IndexedDB.requestDatabase";
			public const string RequestData = "IndexedDB.requestData";
			public const string ClearObjectStore = "IndexedDB.clearObjectStore";
		}

		public static class CacheStorage
		{
			public const string RequestCacheNames = "CacheStorage.requestCacheNames";
			public const string RequestEntries = "CacheStorage.requestEntries";
			public const string DeleteCache = "CacheStorage.deleteCache";
		}

		public static class DOMStorage
		{
			public const string Enable = "DOMStorage.enable";
			public const string Disable = "DOMStorage.disable";
			public const string GetDOMStorageItems = "DOMStorage.getDOMStorageItems";
			public const string SetDOMStorageItem = "DOMStorage.setDOMStorageItem";
			public const string RemoveDOMStorageItem = "DOMStorage.removeDOMStorageItem";
			public const string DomStorageItemsCleared = "DOMStorage.domStorageItemsCleared";
			public const string DomStorageItemRemoved = "DOMStorage.domStorageItemRemoved";
			public const string DomStorageItemAdded = "DOMStorage.domStorageItemAdded";
			public const string DomStorageItemUpdated = "DOMStorage.domStorageItemUpdated";
		}

		public static class ApplicationCache
		{
			public const string GetFramesWithManifests = "ApplicationCache.getFramesWithManifests";
			public const string Enable = "ApplicationCache.enable";
			public const string GetManifestForFrame = "ApplicationCache.getManifestForFrame";
			public const string GetApplicationCacheForFrame = "ApplicationCache.getApplicationCacheForFrame";
			public const string ApplicationCacheStatusUpdated = "ApplicationCache.applicationCacheStatusUpdated";
			public const string NetworkStateUpdated = "ApplicationCache.networkStateUpdated";
		}

		public static class FileSystem
		{
			public const string Enable = "FileSystem.enable";
			public const string Disable = "FileSystem.disable";
			public const string RequestFileSystemRoot = "FileSystem.requestFileSystemRoot";
			public const string RequestDirectoryContent = "FileSystem.requestDirectoryContent";
			public const string RequestMetadata = "FileSystem.requestMetadata";
			public const string RequestFileContent = "FileSystem.requestFileContent";
			public const string DeleteEntry = "FileSystem.deleteEntry";
		}

		public static class DOM
		{
			public const string Enable = "DOM.enable";
			public const string Disable = "DOM.disable";
			public const string GetDocument = "DOM.getDocument";
			public const string RequestChildNodes = "DOM.requestChildNodes";
			public const string QuerySelector = "DOM.querySelector";
			public const string QuerySelectorAll = "DOM.querySelectorAll";
			public const string SetNodeName = "DOM.setNodeName";
			public const string SetNodeValue = "DOM.setNodeValue";
			public const string RemoveNode = "DOM.removeNode";
			public const string SetAttributeValue = "DOM.setAttributeValue";
			public const string SetAttributesAsText = "DOM.setAttributesAsText";
			public const string RemoveAttribute = "DOM.removeAttribute";
			public const string GetEventListenersForNode = "DOM.getEventListenersForNode";
			public const string GetOuterHTML = "DOM.getOuterHTML";
			public const string SetOuterHTML = "DOM.setOuterHTML";
			public const string PerformSearch = "DOM.performSearch";
			public const string GetSearchResults = "DOM.getSearchResults";
			public const string DiscardSearchResults = "DOM.discardSearchResults";
			public const string RequestNode = "DOM.requestNode";
			public const string SetInspectModeEnabled = "DOM.setInspectModeEnabled";
			public const string HighlightRect = "DOM.highlightRect";
			public const string HighlightQuad = "DOM.highlightQuad";
			public const string HighlightNode = "DOM.highlightNode";
			public const string HideHighlight = "DOM.hideHighlight";
			public const string HighlightFrame = "DOM.highlightFrame";
			public const string PushNodeByPathToFrontend = "DOM.pushNodeByPathToFrontend";
			public const string PushNodesByBackendIdsToFrontend = "DOM.pushNodesByBackendIdsToFrontend";
			public const string SetInspectedNode = "DOM.setInspectedNode";
			public const string ResolveNode = "DOM.resolveNode";
			public const string GetAttributes = "DOM.getAttributes";
			public const string CopyTo = "DOM.copyTo";
			public const string MoveTo = "DOM.moveTo";
			public const string Undo = "DOM.undo";
			public const string Redo = "DOM.redo";
			public const string MarkUndoableState = "DOM.markUndoableState";
			public const string Focus = "DOM.focus";
			public const string SetFileInputFiles = "DOM.setFileInputFiles";
			public const string GetBoxModel = "DOM.getBoxModel";
			public const string GetNodeForLocation = "DOM.getNodeForLocation";
			public const string GetRelayoutBoundary = "DOM.getRelayoutBoundary";
			public const string GetHighlightObjectForTest = "DOM.getHighlightObjectForTest";
			public const string DocumentUpdated = "DOM.documentUpdated";
			public const string InspectNodeRequested = "DOM.inspectNodeRequested";
			public const string SetChildNodes = "DOM.setChildNodes";
			public const string AttributeModified = "DOM.attributeModified";
			public const string AttributeRemoved = "DOM.attributeRemoved";
			public const string InlineStyleInvalidated = "DOM.inlineStyleInvalidated";
			public const string CharacterDataModified = "DOM.characterDataModified";
			public const string ChildNodeCountUpdated = "DOM.childNodeCountUpdated";
			public const string ChildNodeInserted = "DOM.childNodeInserted";
			public const string ChildNodeRemoved = "DOM.childNodeRemoved";
			public const string ShadowRootPushed = "DOM.shadowRootPushed";
			public const string ShadowRootPopped = "DOM.shadowRootPopped";
			public const string PseudoElementAdded = "DOM.pseudoElementAdded";
			public const string PseudoElementRemoved = "DOM.pseudoElementRemoved";
			public const string DistributedNodesUpdated = "DOM.distributedNodesUpdated";
		}

		public static class CSS
		{
			public const string Enable = "CSS.enable";
			public const string Disable = "CSS.disable";
			public const string GetMatchedStylesForNode = "CSS.getMatchedStylesForNode";
			public const string GetInlineStylesForNode = "CSS.getInlineStylesForNode";
			public const string GetComputedStyleForNode = "CSS.getComputedStyleForNode";
			public const string GetPlatformFontsForNode = "CSS.getPlatformFontsForNode";
			public const string GetStyleSheetText = "CSS.getStyleSheetText";
			public const string SetStyleSheetText = "CSS.setStyleSheetText";
			public const string SetPropertyText = "CSS.setPropertyText";
			public const string SetRuleSelector = "CSS.setRuleSelector";
			public const string SetMediaText = "CSS.setMediaText";
			public const string CreateStyleSheet = "CSS.createStyleSheet";
			public const string AddRule = "CSS.addRule";
			public const string ForcePseudoState = "CSS.forcePseudoState";
			public const string GetMediaQueries = "CSS.getMediaQueries";
			public const string MediaQueryResultChanged = "CSS.mediaQueryResultChanged";
			public const string StyleSheetChanged = "CSS.styleSheetChanged";
			public const string StyleSheetAdded = "CSS.styleSheetAdded";
			public const string StyleSheetRemoved = "CSS.styleSheetRemoved";
		}

		public static class Timeline
		{
			public const string Enable = "Timeline.enable";
			public const string Disable = "Timeline.disable";
			public const string Start = "Timeline.start";
			public const string Stop = "Timeline.stop";
			public const string EventRecorded = "Timeline.eventRecorded";
		}

		public static class Debugger
		{
			public const string Enable = "Debugger.enable";
			public const string Disable = "Debugger.disable";
			public const string SetBreakpointsActive = "Debugger.setBreakpointsActive";
			public const string SetSkipAllPauses = "Debugger.setSkipAllPauses";
			public const string SetBreakpointByUrl = "Debugger.setBreakpointByUrl";
			public const string SetBreakpoint = "Debugger.setBreakpoint";
			public const string RemoveBreakpoint = "Debugger.removeBreakpoint";
			public const string ContinueToLocation = "Debugger.continueToLocation";
			public const string StepOver = "Debugger.stepOver";
			public const string StepInto = "Debugger.stepInto";
			public const string StepOut = "Debugger.stepOut";
			public const string Pause = "Debugger.pause";
			public const string Resume = "Debugger.resume";
			public const string StepIntoAsync = "Debugger.stepIntoAsync";
			public const string SearchInContent = "Debugger.searchInContent";
			public const string CanSetScriptSource = "Debugger.canSetScriptSource";
			public const string SetScriptSource = "Debugger.setScriptSource";
			public const string RestartFrame = "Debugger.restartFrame";
			public const string GetScriptSource = "Debugger.getScriptSource";
			public const string GetFunctionDetails = "Debugger.getFunctionDetails";
			public const string GetGeneratorObjectDetails = "Debugger.getGeneratorObjectDetails";
			public const string GetCollectionEntries = "Debugger.getCollectionEntries";
			public const string SetPauseOnExceptions = "Debugger.setPauseOnExceptions";
			public const string EvaluateOnCallFrame = "Debugger.evaluateOnCallFrame";
			public const string CompileScript = "Debugger.compileScript";
			public const string RunScript = "Debugger.runScript";
			public const string SetVariableValue = "Debugger.setVariableValue";
			public const string GetStepInPositions = "Debugger.getStepInPositions";
			public const string GetBacktrace = "Debugger.getBacktrace";
			public const string SkipStackFrames = "Debugger.skipStackFrames";
			public const string SetAsyncCallStackDepth = "Debugger.setAsyncCallStackDepth";
			public const string EnablePromiseTracker = "Debugger.enablePromiseTracker";
			public const string DisablePromiseTracker = "Debugger.disablePromiseTracker";
			public const string GetPromises = "Debugger.getPromises";
			public const string GetPromiseById = "Debugger.getPromiseById";
			public const string FlushAsyncOperationEvents = "Debugger.flushAsyncOperationEvents";
			public const string SetAsyncOperationBreakpoint = "Debugger.setAsyncOperationBreakpoint";
			public const string RemoveAsyncOperationBreakpoint = "Debugger.removeAsyncOperationBreakpoint";
			public const string GlobalObjectCleared = "Debugger.globalObjectCleared";
			public const string ScriptParsed = "Debugger.scriptParsed";
			public const string ScriptFailedToParse = "Debugger.scriptFailedToParse";
			public const string BreakpointResolved = "Debugger.breakpointResolved";
			public const string Paused = "Debugger.paused";
			public const string Resumed = "Debugger.resumed";
			public const string PromiseUpdated = "Debugger.promiseUpdated";
			public const string AsyncOperationStarted = "Debugger.asyncOperationStarted";
			public const string AsyncOperationCompleted = "Debugger.asyncOperationCompleted";
		}

		public static class DOMDebugger
		{
			public const string SetDOMBreakpoint = "DOMDebugger.setDOMBreakpoint";
			public const string RemoveDOMBreakpoint = "DOMDebugger.removeDOMBreakpoint";
			public const string SetEventListenerBreakpoint = "DOMDebugger.setEventListenerBreakpoint";
			public const string RemoveEventListenerBreakpoint = "DOMDebugger.removeEventListenerBreakpoint";
			public const string SetInstrumentationBreakpoint = "DOMDebugger.setInstrumentationBreakpoint";
			public const string RemoveInstrumentationBreakpoint = "DOMDebugger.removeInstrumentationBreakpoint";
			public const string SetXHRBreakpoint = "DOMDebugger.setXHRBreakpoint";
			public const string RemoveXHRBreakpoint = "DOMDebugger.removeXHRBreakpoint";
		}

		public static class Profiler
		{
			public const string Enable = "Profiler.enable";
			public const string Disable = "Profiler.disable";
			public const string SetSamplingInterval = "Profiler.setSamplingInterval";
			public const string Start = "Profiler.start";
			public const string Stop = "Profiler.stop";
			public const string ConsoleProfileStarted = "Profiler.consoleProfileStarted";
			public const string ConsoleProfileFinished = "Profiler.consoleProfileFinished";
		}

		public static class HeapProfiler
		{
			public const string Enable = "HeapProfiler.enable";
			public const string Disable = "HeapProfiler.disable";
			public const string StartTrackingHeapObjects = "HeapProfiler.startTrackingHeapObjects";
			public const string StopTrackingHeapObjects = "HeapProfiler.stopTrackingHeapObjects";
			public const string TakeHeapSnapshot = "HeapProfiler.takeHeapSnapshot";
			public const string CollectGarbage = "HeapProfiler.collectGarbage";
			public const string GetObjectByHeapObjectId = "HeapProfiler.getObjectByHeapObjectId";
			public const string AddInspectedHeapObject = "HeapProfiler.addInspectedHeapObject";
			public const string GetHeapObjectId = "HeapProfiler.getHeapObjectId";
			public const string AddHeapSnapshotChunk = "HeapProfiler.addHeapSnapshotChunk";
			public const string ResetProfiles = "HeapProfiler.resetProfiles";
			public const string ReportHeapSnapshotProgress = "HeapProfiler.reportHeapSnapshotProgress";
			public const string LastSeenObjectId = "HeapProfiler.lastSeenObjectId";
			public const string HeapStatsUpdate = "HeapProfiler.heapStatsUpdate";
		}

		public static class Worker
		{
			public const string Enable = "Worker.enable";
			public const string Disable = "Worker.disable";
			public const string SendMessageToWorker = "Worker.sendMessageToWorker";
			public const string ConnectToWorker = "Worker.connectToWorker";
			public const string DisconnectFromWorker = "Worker.disconnectFromWorker";
			public const string SetAutoconnectToWorkers = "Worker.setAutoconnectToWorkers";
			public const string WorkerCreated = "Worker.workerCreated";
			public const string WorkerTerminated = "Worker.workerTerminated";
			public const string DispatchMessageFromWorker = "Worker.dispatchMessageFromWorker";
		}

		public static class ServiceWorker
		{
			public const string Enable = "ServiceWorker.enable";
			public const string Disable = "ServiceWorker.disable";
			public const string SendMessage = "ServiceWorker.sendMessage";
			public const string Stop = "ServiceWorker.stop";
			public const string Unregister = "ServiceWorker.unregister";
			public const string UpdateRegistration = "ServiceWorker.updateRegistration";
			public const string StartWorker = "ServiceWorker.startWorker";
			public const string StopWorker = "ServiceWorker.stopWorker";
			public const string InspectWorker = "ServiceWorker.inspectWorker";
			public const string SetDebugOnStart = "ServiceWorker.setDebugOnStart";
			public const string DeliverPushMessage = "ServiceWorker.deliverPushMessage";
			public const string WorkerCreated = "ServiceWorker.workerCreated";
			public const string WorkerTerminated = "ServiceWorker.workerTerminated";
			public const string DispatchMessage = "ServiceWorker.dispatchMessage";
			public const string WorkerRegistrationUpdated = "ServiceWorker.workerRegistrationUpdated";
			public const string WorkerVersionUpdated = "ServiceWorker.workerVersionUpdated";
			public const string WorkerErrorReported = "ServiceWorker.workerErrorReported";
			public const string DebugOnStartUpdated = "ServiceWorker.debugOnStartUpdated";
		}

		public static class Canvas
		{
			public const string Enable = "Canvas.enable";
			public const string Disable = "Canvas.disable";
			public const string DropTraceLog = "Canvas.dropTraceLog";
			public const string HasUninstrumentedCanvases = "Canvas.hasUninstrumentedCanvases";
			public const string CaptureFrame = "Canvas.captureFrame";
			public const string StartCapturing = "Canvas.startCapturing";
			public const string StopCapturing = "Canvas.stopCapturing";
			public const string GetTraceLog = "Canvas.getTraceLog";
			public const string ReplayTraceLog = "Canvas.replayTraceLog";
			public const string GetResourceState = "Canvas.getResourceState";
			public const string EvaluateTraceLogCallArgument = "Canvas.evaluateTraceLogCallArgument";
			public const string ContextCreated = "Canvas.contextCreated";
			public const string TraceLogsRemoved = "Canvas.traceLogsRemoved";
		}

		public static class Input
		{
			public const string DispatchKeyEvent = "Input.dispatchKeyEvent";
			public const string DispatchMouseEvent = "Input.dispatchMouseEvent";
			public const string DispatchTouchEvent = "Input.dispatchTouchEvent";
			public const string EmulateTouchFromMouseEvent = "Input.emulateTouchFromMouseEvent";
			public const string SynthesizePinchGesture = "Input.synthesizePinchGesture";
			public const string SynthesizeScrollGesture = "Input.synthesizeScrollGesture";
			public const string SynthesizeTapGesture = "Input.synthesizeTapGesture";
		}

		public static class LayerTree
		{
			public const string Enable = "LayerTree.enable";
			public const string Disable = "LayerTree.disable";
			public const string CompositingReasons = "LayerTree.compositingReasons";
			public const string MakeSnapshot = "LayerTree.makeSnapshot";
			public const string LoadSnapshot = "LayerTree.loadSnapshot";
			public const string ReleaseSnapshot = "LayerTree.releaseSnapshot";
			public const string ProfileSnapshot = "LayerTree.profileSnapshot";
			public const string ReplaySnapshot = "LayerTree.replaySnapshot";
			public const string SnapshotCommandLog = "LayerTree.snapshotCommandLog";
			public const string LayerTreeDidChange = "LayerTree.layerTreeDidChange";
			public const string LayerPainted = "LayerTree.layerPainted";
		}

		public static class DeviceOrientation
		{
			public const string SetDeviceOrientationOverride = "DeviceOrientation.setDeviceOrientationOverride";
			public const string ClearDeviceOrientationOverride = "DeviceOrientation.clearDeviceOrientationOverride";
		}

		public static class Tracing
		{
			public const string Start = "Tracing.start";
			public const string End = "Tracing.end";
			public const string GetCategories = "Tracing.getCategories";
			public const string DataCollected = "Tracing.dataCollected";
			public const string TracingComplete = "Tracing.tracingComplete";
			public const string BufferUsage = "Tracing.bufferUsage";
		}

		public static class Power
		{
			public const string Start = "Power.start";
			public const string End = "Power.end";
			public const string CanProfilePower = "Power.canProfilePower";
			public const string GetAccuracyLevel = "Power.getAccuracyLevel";
			public const string DataAvailable = "Power.dataAvailable";
		}

		public static class Animation
		{
			public const string Enable = "Animation.enable";
			public const string GetAnimationPlayersForNode = "Animation.getAnimationPlayersForNode";
			public const string GetPlaybackRate = "Animation.getPlaybackRate";
			public const string SetPlaybackRate = "Animation.setPlaybackRate";
			public const string SetCurrentTime = "Animation.setCurrentTime";
			public const string SetTiming = "Animation.setTiming";
			public const string AnimationPlayerCreated = "Animation.animationPlayerCreated";
			public const string AnimationPlayerCanceled = "Animation.animationPlayerCanceled";
		}

		public static class Accessibility
		{
			public const string GetAXNode = "Accessibility.getAXNode";
		}

	}
}


text:
package com.wpj.wx.damain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import javax.persistence.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;

@Table(name = "tb_header")
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)//自动忽略空字段
public class TbHeader extends BaseDamain {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    @Column(name = "class_id")
    @Max(32)
    private String classId;
    @Max(32)
    private String theme;
    @Max(4)
    private boolean fixed;
    @Max(100)
    @Column(name = "Left_link")
    private String leftLink;
    @Max(100)
    @Column(name = "Right_link")
    private String rightLink;
    @Max(10)
    @Column(name = "Left_title")
    private String leftTitle;
    @Max(10)
    @Column(name = "Right_title")
    private String rightTitle;
    @Max(50)
    @Column(name = "Left_icon")
    private String leftIcon;
    @Max(50)
    @Column(name = "right_icon")
    private String rightIcon;
    @Max(32)
    @Column(name = "Left_class_Name")
    private String leftClassName;
    @Max(32)
    @Column(name = "right_class_Name")
    private String rightClassName;
    @Max(100)
    private String other;
    @NotNull
    @Max(20)
    @Column(name = "Title")
    private String title;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return class_id
     */
    public String getClassId() {
        return classId;
    }

    /**
     * @param classId
     */
    public void setClassId(String classId) {
        this.classId = classId;
    }

    /**
     * @return theme
     */
    public String getTheme() {
        return theme;
    }

    /**
     * @param theme
     */
    public void setTheme(String theme) {
        this.theme = theme;
    }

    /**
     * @return fixed
     */
    public boolean isFixed() {
        return fixed;
    }

    public void setFixed(boolean fixed) {
        this.fixed = fixed;
    }

    /**
     * @return Left_link
     */
    public String getLeftLink() {
        return leftLink;
    }

    /**
     * @param leftLink
     */
    public void setLeftLink(String leftLink) {
        this.leftLink = leftLink;
    }

    /**
     * @return Right_link
     */
    public String getRightLink() {
        return rightLink;
    }

    /**
     * @param rightLink
     */
    public void setRightLink(String rightLink) {
        this.rightLink = rightLink;
    }

    /**
     * @return Left_title
     */
    public String getLeftTitle() {
        return leftTitle;
    }

    /**
     * @param leftTitle
     */
    public void setLeftTitle(String leftTitle) {
        this.leftTitle = leftTitle;
    }

    /**
     * @return Right_title
     */
    public String getRightTitle() {
        return rightTitle;
    }

    /**
     * @param rightTitle
     */
    public void setRightTitle(String rightTitle) {
        this.rightTitle = rightTitle;
    }

    /**
     * @return Left_icon
     */
    public String getLeftIcon() {
        return leftIcon;
    }

    /**
     * @param leftIcon
     */
    public void setLeftIcon(String leftIcon) {
        this.leftIcon = leftIcon;
    }

    /**
     * @return right_icon
     */
    public String getRightIcon() {
        return rightIcon;
    }

    /**
     * @param rightIcon
     */
    public void setRightIcon(String rightIcon) {
        this.rightIcon = rightIcon;
    }

    /**
     * @return Left_class_Name
     */
    public String getLeftClassName() {
        return leftClassName;
    }

    /**
     * @param leftClassName
     */
    public void setLeftClassName(String leftClassName) {
        this.leftClassName = leftClassName;
    }

    /**
     * @return right_class_Name
     */
    public String getRightClassName() {
        return rightClassName;
    }

    /**
     * @param rightClassName
     */
    public void setRightClassName(String rightClassName) {
        this.rightClassName = rightClassName;
    }

    /**
     * @return other
     */
    public String getOther() {
        return other;
    }

    /**
     * @param other
     */
    public void setOther(String other) {
        this.other = other;
    }

    /**
     * @return Title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title
     */
    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public String toString() {
        return "TbHeader{" +
                "id=" + id +
                ", classId='" + classId + '\'' +
                ", theme='" + theme + '\'' +
                ", fixed=" + fixed +
                ", leftLink='" + leftLink + '\'' +
                ", rightLink='" + rightLink + '\'' +
                ", leftTitle='" + leftTitle + '\'' +
                ", rightTitle='" + rightTitle + '\'' +
                ", leftIcon='" + leftIcon + '\'' +
                ", rightIcon='" + rightIcon + '\'' +
                ", leftClassName='" + leftClassName + '\'' +
                ", rightClassName='" + rightClassName + '\'' +
                ", other='" + other + '\'' +
                ", title='" + title + '\'' +
                '}';
    }
}


text:
class Solution:
    def dominantIndex(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        if not nums:
            return -1
        elif len(nums) == 1:
            return 0
        first, second = nums[:2]
        large_idx = 0
        if first < second:
            first, second = second, first
            large_idx = 1
        for idx, other in enumerate(nums[2:], 2):
            if other > first:
                first, second = other, first
                large_idx = idx
            elif other > second:
                second = other
        if first >= 2 * second:
            return large_idx
        else:
            return -1


text:
require 'test_helper'

class GeoCertsTest < Test::Unit::TestCase

  context 'GeoCerts' do

    should 'use the sandbox host' do
      setting(GeoCerts, :sandbox, :to => true) do
        assert_equal('https://sandbox.geocerts.com', GeoCerts.host)
      end
    end

    should 'use the production host' do
      setting(GeoCerts, :sandbox, :to => false) do
        assert_equal('https://www.geocerts.com', GeoCerts.host)
      end
    end

    should 'use the given host' do
      setting(GeoCerts, :host, :to => 'test.com', :back => nil) do
        assert_equal('test.com', GeoCerts.host)
      end

      setting(GeoCerts, :host, :to => 'test.com:8000', :back => nil) do
        assert_equal('test.com:8000', GeoCerts.host)
      end
    end

  end

end


text:
import { ElementHandle, Page } from "puppeteer";
import { getDefaultOptions, setDefaultOptions } from 'expect-puppeteer';

const testGlobal = async (instance: ElementHandle | Page) => {
    await expect(instance).toClick("selector");
    await expect(instance).toClick("selector", { text: "text" });
    await expect(instance).toClick("selector", { button: "left" });
    await expect(instance).toClick("selector", { button: "right" });
    await expect(instance).toClick("selector", { button: "middle" });
    await expect(instance).toClick("selector", { clickCount: 3 });
    await expect(instance).toClick("selector", { delay: 100 });

    const dialog = await expect(instance).toDisplayDialog(async () => {});
    console.log(dialog.message());

    await expect(instance).toFill("selector", "value");
    await expect(instance).toFill("selector", "value", { delay: 777 });

    await expect(instance).toFillForm("selector", { foo: 'bar', baz: 123 });
    await expect(instance).toFillForm("selector", { foo: 'bar', baz: 123 }, { delay: 777 });

    await expect(instance).toMatch("some_string");
    await expect(instance).toMatch("some_string", { timeout: 777 });
    await expect(instance).toMatch("some_string", { polling: "raf", timeout: 777 });
    await expect(instance).toMatch("some_string", { polling: "mutation", timeout: 777 });
    await expect(instance).toMatch(/some_regexp/);
    await expect(instance).toMatch(/some_regexp/, { timeout: 777 });
    await expect(instance).toMatch(/some_regexp/, { polling: "raf", timeout: 777 });
    await expect(instance).toMatch(/some_regexp/, { polling: "mutation", timeout: 777 });

    await expect(instance).toMatchElement("selector");
    await expect(instance).toMatchElement("selector", { polling: "raf", timeout: 777 });
    await expect(instance).toMatchElement("selector", { polling: "mutation", text: "text" });
    await expect(instance).toMatchElement("selector", { polling: "raf", visible: true });

    await expect(instance).toSelect("selector", "valueOrText");

    await expect(instance).toUploadFile("selector", "filePath");
    await expect(instance).toUploadFile("selector", "filePath", { timeout: 777 });

    setDefaultOptions({ polling: "mutation", timeout: 5000 });
    const { polling, timeout } = getDefaultOptions();
};

const testImported = async (instance: ElementHandle | Page) => {
    const expectPuppeteer = await import("expect-puppeteer");

    await expectPuppeteer(instance).toClick("selector");
    await expect(instance).toClick("selector", { polling: "mutation", text: "text" });
    await expect(instance).toClick("selector", { polling: "raf", timeout: 777 });
};


text:
class CourseSection < ActiveRecord::Base
  belongs_to :course
  belongs_to :term

  has_and_belongs_to_many :instructors
  has_and_belongs_to_many :requirements
  has_many :course_section_times, :dependent => :destroy

  DAYS = %w{M T W R F S U}

  def full_destroy
    ActiveRecord::Base.connection.execute "DELETE FROM course_sections_schedules WHERE course_section_id = #{id}"
    ActiveRecord::Base.connection.execute "DELETE FROM course_sections_instructors WHERE course_section_id = #{id}"
    ActiveRecord::Base.connection.execute "DELETE FROM course_sections_requirements WHERE course_section_id = #{id}"
    self.destroy
  end

  # returns the section times as a string
  def to_s
    if course_section_times.length > 0
      times = course_section_times.map{|time| time.to_s}
      times2 = []

      for time in times
        good = true
        for time2 in times2
          if time[0] == time2[0]
            time2[1] += time[1]
            good = false
            break
          end
        end
        times2 << time if good
      end

      times2.map{|time| time.join(' ')}.join('<br />')
    else
      'TBA'
    end
  end

  def mapDays
  	course_section_times.map{|time| time.day}.uniq.sort
  end

  def days
    course_section_times.length > 0 ? mapDays.map{|day| DAYS[day]}.join('') : 'TBA'
  end

  def daysSort
    course_section_times.length > 0 ? mapDays.join('') : '0'
  end
end


text:
/* older glibc has C99 INFINITY in _GNU_SOURCE */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#include "diff_container.h"

#include <cmath>

using namespace std;

namespace {

/// a comparator suitable for diffing symbols
bool rough_less(symbol_entry const & lhs, symbol_entry const & rhs)
{
	if (lhs.image_name != rhs.image_name)
		return lhs.image_name < rhs.image_name;

	if (lhs.app_name != rhs.app_name)
		return lhs.app_name < rhs.app_name;

	if (lhs.name != rhs.name)
		return lhs.name < rhs.name;

	return false;
}

/// possibly add a diff sym
void
add_sym(diff_collection & syms, diff_symbol const & sym,
        profile_container::symbol_choice & choice)
{
	if (choice.match_image
	    && (image_names.name(sym.image_name) != choice.image_name))
		return;

	if (fabs(sym.diffs[0]) < choice.threshold)
		return;

	choice.hints = sym.output_hint(choice.hints);
	syms.push_back(sym);
}

/// add a symbol not present in the new profile
void
symbol_old(diff_collection & syms, symbol_entry const & sym,
           profile_container::symbol_choice & choice)
{
	diff_symbol symbol(sym);
	symbol.diffs.fill(sym.sample.counts.size(), -INFINITY);
	add_sym(syms, symbol, choice);
}

/// add a symbol not present in the old profile
void
symbol_new(diff_collection & syms, symbol_entry const & sym,
           profile_container::symbol_choice & choice)
{
	diff_symbol symbol(sym);
	symbol.diffs.fill(sym.sample.counts.size(), INFINITY);
	add_sym(syms, symbol, choice);
}

/// add a diffed symbol
void symbol_diff(diff_collection & syms,
                 symbol_entry const & sym1, count_array_t const & total1,
                 symbol_entry const & sym2, count_array_t const & total2,
                 profile_container::symbol_choice & choice)
{
	diff_symbol symbol(sym2);

	size_t size = sym2.sample.counts.size();
	for (size_t i = 0; i != size; ++i) {
		double percent1;
		double percent2;
		percent1 = op_ratio(sym1.sample.counts[i], total1[i]);
		percent2 = op_ratio(sym2.sample.counts[i], total2[i]);
		symbol.diffs[i] = op_ratio(percent2 - percent1, percent1);
		symbol.diffs[i] *= 100.0;
	}

	add_sym(syms, symbol, choice);
}

}; // namespace anon

diff_container::diff_container(profile_container const & c1,
                               profile_container const & c2)
	: pc1(c1), pc2(c2),
	  total1(pc1.samples_count()), total2(pc2.samples_count())
{
}

diff_collection const
diff_container::get_symbols(profile_container::symbol_choice & choice) const
{
	diff_collection syms;

	/*
	 * Do a pairwise comparison of the two symbol sets. We're
	 * relying here on the symbol container being sorted such
	 * that rough_less() is suitable for iterating through the
	 * two lists (see less_symbol).
	 */

	symbol_container::symbols_t::iterator it1 = pc1.begin_symbol();
	symbol_container::symbols_t::iterator end1 = pc1.end_symbol();
	symbol_container::symbols_t::iterator it2 = pc2.begin_symbol();
	symbol_container::symbols_t::iterator end2 = pc2.end_symbol();

	while (it1 != end1 && it2 != end2) {
		if (rough_less(*it1, *it2)) {
			symbol_old(syms, *it1, choice);
			++it1;
		} else if (rough_less(*it2, *it1)) {
			symbol_new(syms, *it2, choice);
			++it2;
		} else {
			symbol_diff(syms, *it1, total1, *it2, total2, choice);
			++it1;
			++it2;
		}
	}

	for (; it1 != end1; ++it1)
		symbol_old(syms, *it1, choice);

	for (; it2 != end2; ++it2)
		symbol_new(syms, *it2, choice);

	return syms;
}

count_array_t const diff_container::samples_count() const
{
	return total2;
}


text:
permalink: /MarkdownPad-Crash-And-Error-Fix/
title: MarkdownPad Crash and Error Fix
---

## This view has crashed!

awesomium web-browser framework This view has crashed!

You only need `Awesomium.dll` from awesomium SDK 1.6.6.

Replace `C:\Program Files (x86)\MarkdownPad 2\Awesomium.dll` with `C:\Program Files (x86)\Khrona LLC\Awesomium SDK\1.6.6\build\bin\release\Awesomium.dll` and restart MarkdownPad.

Download the required `Awesomium.dll` [here](https://chaohershi.github.io/assets/Awesomium.dll.zip).

## Could not create SSL/TLS secure channel.

An error occurred while processing GitHub Flavored Markdown.
The request was aborted: Could not create SSL/TLS secure channel.

Use the following registry changes and restart MarkdownPad.

```
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001
```

---

Reference:
- [markdown - MarkdownPad Crashes on Windows 10 - Stack Overflow](https://stackoverflow.com/questions/31791082/markdownpad-crashes-on-windows-10)
- [MarkdownPad preview fails on Windows 10 - Super User](https://superuser.com/questions/954091/markdownpad-preview-fails-on-windows-10)
- [MarkdownPad - Frequently Asked Questions](http://markdownpad.com/faq.html#livepreview-directx)
- [GFM online mode SSL/TLS secure channel aborts - MarkdownPad / Help and Support - Apricity Software Forums](http://forums.apricitysoftware.com/t/gfm-online-mode-ssl-tls-secure-channel-aborts/1313)
- [asp.net - TLS 1.2 in .NET Framework 4.0 - Stack Overflow](https://stackoverflow.com/questions/33761919/tls-1-2-in-net-framework-4-0)


text:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>locality</type>
  <type>political</type>
  <formatted_address>Leicester, UK</formatted_address>
  <address_component>
   <long_name>Leicester</long_name>
   <short_name>Leicester</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Leicester</long_name>
   <short_name>Leicester</short_name>
   <type>postal_town</type>
  </address_component>
  <address_component>
   <long_name>Leicester</long_name>
   <short_name>Leicester</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>England</long_name>
   <short_name>England</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United Kingdom</long_name>
   <short_name>GB</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <geometry>
   <location>
    <lat>52.6368778</lat>
    <lng>-1.1397592</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport>
    <southwest>
     <lat>52.5806504</lat>
     <lng>-1.2159877</lng>
    </southwest>
    <northeast>
     <lat>52.6915038</lat>
     <lng>-1.0462128</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>52.5806504</lat>
     <lng>-1.2159877</lng>
    </southwest>
    <northeast>
     <lat>52.6915038</lat>
     <lng>-1.0462128</lng>
    </northeast>
   </bounds>
  </geometry>
  <place_id>ChIJc2y3SatCd0gRuJy0byodFZo</place_id>
 </result>
</GeocodeResponse>


text:
'use strict';

Object.defineProperty(exports, '__esModule', {
    value: true
});

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var _GenericFinder2 = require('../GenericFinder');

var _GenericFinder3 = _interopRequireDefault(_GenericFinder2);

// import ProvisionGenericFinder from '../ProvisionGenericFinder';

/**
 *   This class allow make get request to OperationType resource into Opengate North API.
 */

var OperationTypesCatalog = (function (_GenericFinder) {
    _inherits(OperationTypesCatalog, _GenericFinder);

    /**
     * @param {InternalOpenGateAPI} ogapi - Reference to the API object.
     */

    function OperationTypesCatalog(ogapi) {
        _classCallCheck(this, OperationTypesCatalog);

        _get(Object.getPrototypeOf(OperationTypesCatalog.prototype), 'constructor', this).call(this, ogapi, 'operationTypes/catalog', "operationType", 'Operation types not found');
    }

    /**
     * Performs a get that returns operation types templates
     * @test
     *   ogapi.newOperationTypeCatalog().getOperationTypes();
     * @return {Promise}
     */

    _createClass(OperationTypesCatalog, [{
        key: 'getOperationTypes',
        value: function getOperationTypes() {
            return this._execute();
        }
    }, {
        key: '_composeUrl',
        value: function _composeUrl() {
            return this._baseUrl;
        }
    }]);

    return OperationTypesCatalog;
})(_GenericFinder3['default']);

exports['default'] = OperationTypesCatalog;
module.exports = exports['default'];
//# sourceMappingURL=OperationTypeCatalog.js.map


text:
layout: page
title: Lin Entertainment Show
date: 2016-05-24
author: Jeffrey Mcgrath
tags: weekly links, java
status: published
summary: Proin consectetur magna eu est ullamcorper, at hendrerit.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 08/28/2019
  endDate: 09/01/2019
  ctyhocn: CPKNYHX
  groupCode: LES
published: true
---
Curabitur venenatis diam quis dui vehicula consectetur. Curabitur interdum consequat sodales. Maecenas et risus tellus. Suspendisse cursus mi sollicitudin, sodales lacus sit amet, commodo massa. Nunc a hendrerit mauris. In non ultrices quam. Ut neque odio, mollis at commodo id, condimentum sit amet diam. Nullam sit amet massa sapien. Sed scelerisque purus nunc, bibendum suscipit elit tristique at. Phasellus a sem id urna pretium cursus quis eget libero. Proin dignissim mauris eu enim congue volutpat.

* In mollis ex vel pellentesque molestie
* Etiam sed magna nec tortor posuere porta in sodales justo.

Morbi lobortis bibendum mi, gravida volutpat odio fermentum eget. Morbi vel quam eu diam gravida feugiat in tempor lacus. Sed faucibus blandit sem, sit amet gravida sapien vulputate quis. Maecenas pellentesque ligula ut semper volutpat. Cras sed rhoncus felis, ut tincidunt tellus. Mauris suscipit urna eu tortor aliquam, vestibulum fermentum nisi tristique. Ut nec elementum ipsum, at porta tellus. Donec posuere, erat ut ultrices faucibus, nisl velit finibus orci, vel tincidunt arcu felis tristique elit.
Curabitur felis est, volutpat eu nibh eget, luctus malesuada nibh. Phasellus id consequat turpis, vehicula vehicula ipsum. Vivamus eget nunc convallis, aliquam nisi sit amet, finibus ligula. Etiam ultricies lobortis ligula. Suspendisse quis porttitor lorem, quis ullamcorper elit. Pellentesque efficitur, lacus non commodo laoreet, dolor dolor cursus nunc, ut hendrerit purus erat eget nulla. Aenean quam purus, tempus nec ultrices ac, ullamcorper vitae ex. Etiam sagittis, eros eget sollicitudin condimentum, enim sapien mattis tellus, non tristique mauris neque sit amet dui. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aenean eget urna non nisl interdum cursus. Suspendisse volutpat quis odio a consectetur.


text:
<?php

namespace Kaliop\TwigExpressBundle\Controller;

use Kaliop\TwigExpressBundle\Core\Utils;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Twig_Error;

class StaticController extends Controller
{
    // The excution flow can go e.g.: findAction -> renderTwig -> showTwigError,
    // and we'd like to keep some information around.
    /** @var bool The kernel.debug parameter */
    protected $debug;
    /** @var string Base URL for a request, e.g. '/static/bundleref/' */
    protected $baseUrl;
    /** @var null|string Valid bundle name, e.g. 'SomeCoolBundle' */
    protected $bundleName;
    /** @var null|string System path to bundle root */
    protected $bundlePath;
    /** @var null|string Document root, e.g. '@SomeCoolBundle/Resources/views/static' */
    protected $docRootName;
    /** @var null|string System path to document root */
    protected $docRootPath;
    /** @var null|string The name of an existing template we're trying to show */
    protected $templateName;
    /** @var null|string The requested path (minus any '/static/' or bundle id prefix) */
    protected $requestPath;

    /**
     * List Assetic bundles
     */
    public function rootAction()
    {
        return $this->render('@KaliopTwigExpress/rootindex.html.twig', [
            'bundles' => $this->container->getParameter('twig_express.bundles')
        ]);
    }

    /**
     * Find a template to render or a folder whose content to list
     * @param  string $slug Slug identifying a bundle
     * @param  string $path Path to a resource (starting with '/')
     * @return RedirectResponse|Response
     * @throws \Exception
     */
    public function findAction($slug, $path)
    {
        $this->debug = $this->container->getParameter('kernel.debug');
        $cleanPath = Utils::getCleanPath($path);
        $pathExt = pathinfo($cleanPath, PATHINFO_EXTENSION);
        $showSource = $pathExt === 'twig';

        // Store the requested path (for e.g. making breadcrumbs)
        $this->requestPath = $cleanPath;

        // Base URL for redirects and breadcrumbs (no trailing slash)
        $this->baseUrl = $this->generateUrl('kaliop_twig_express_find', [
            'slug' => $slug,
            'path' => ''
        ]);

        // Redirect if we can clean up the URL
        if ($cleanPath !== $path) {
            return $this->redirect($this->baseUrl . $cleanPath);
        }

        // Redirect if URL asks for a Twig file but we're not in debug mode
        if (!$this->debug && substr($cleanPath, -5) === '.twig') {
            return $this->redirect($this->baseUrl . substr($cleanPath, 0, -5));
        }

        // Figure out bundle name
        $bundleConfig = $this->container->getParameter('twig_express.bundles');
        if (!array_key_exists($slug, $bundleConfig)) {
            $rootUrl = $this->generateUrl('kaliop_twig_express_root');
            return $this->redirect($rootUrl . '?was=' . $slug);
        }
        $this->bundleName = $bundleConfig[$slug]['name'];

        // Check that it's a valid bundle
        $allBundles = array_keys($this->get('kernel')->getBundles());
        if (!in_array($this->bundleName, $allBundles)) {
            throw new \Exception("Unknown bundle '$this->bundleName'. Make sure this bundle is installed and your 'twig_express.bundles' config is correct.");
        }

        // Where is our "document root"?
        $docRoot = Utils::getCleanPath($bundleConfig[$slug]['root'], 'r');
        $this->bundlePath = rtrim($this->container->get('kernel')->locateResource('@'.$this->bundleName), '/');
        $this->docRootName = '@'.$this->bundleName . '/' . $docRoot;
        $this->docRootPath = $this->bundlePath . '/' . $docRoot;
        $basePath = $this->docRootPath . rtrim($cleanPath, '/');

        // First look for a directory
        if (!$pathExt && is_dir($basePath)) {
            // Redirect folder URL if missing the trailing slash
            if (substr($cleanPath, -1) !== '/') {
                return $this->redirect($this->baseUrl . $cleanPath . '/');
            }
            if (file_exists($basePath . '/index.html.twig')) {
                return $this->renderTwig($this->docRootName . $cleanPath . 'index.html.twig');
            } elseif (file_exists($basePath . '/index.twig')) {
                return $this->renderTwig($this->docRootName . $cleanPath . 'index.twig');
            } else {
                return $this->renderDir($basePath, $cleanPath);
            }
        }
        // Then look for a file
        elseif (file_exists($basePath . ($showSource ? '' : '.twig'))) {
            // Redirect without slash if needed
            if (substr($path, -1) === '/') {
                return $this->redirect($this->baseUrl . substr($cleanPath, 0, -1));
            } elseif ($showSource) {
                return $this->showSource($basePath, $cleanPath);
            } else {
                return $this->renderTwig($this->docRootName . $cleanPath . '.twig');
            }
        }
        // Finish with 404 if nothing matched
        return $this->render404($cleanPath);
    }

    /**
     * Show a directory listing page
     * @param string $dirPath Directory system path
     * @param string $urlFragment URL without base or bundle key
     * @return Response
     */
    private function renderDir($dirPath, $urlFragment)
    {
        // Prepare breadcrumbs
        $breadcrumbs = $this->makeBreadcrumbs(
            $this->baseUrl,
            $this->bundleName,
            $urlFragment
        );

        // Prepare content list
        $finder = new Finder();
        $iterator = $finder->depth(0)->in($dirPath)->sortByName();
        $dirList = [];
        $fileList = [];
        foreach ($iterator->directories() as $dir) {
            $name = $dir->getFilename();
            $dirList[] = ['name'=>$name, 'url'=>$name];
        }
        foreach ($iterator->files()->name('*.twig') as $file) {
            $name = $file->getFilename();
            $fileList[] = [
                'name' => $name,
                'url' => str_replace('.twig', '', $name)
            ];
        }

        return $this->render('@KaliopTwigExpress/dirindex.html.twig', [
            'breadcrumbs' => $breadcrumbs,
            'dirList' => $dirList,
            'fileList' => $fileList,
            'navBorder' => false
        ]);
    }

    /**
     * Show a File Not Found page
     * @param string $urlFragment URL without base or bundle key
     * @return Response
     */
    private function render404($urlFragment)
    {
        // Prepare breadcrumbs
        $breadcrumbs = $this->makeBreadcrumbs(
            $this->baseUrl,
            $this->bundleName,
            $urlFragment
        );

        // Prepare message
        $root = $this->docRootName;
        if (substr($urlFragment, -5) === '.twig' || substr($urlFragment, -1) === '/') {
            $miss = $urlFragment;
        } else {
            $miss = $urlFragment . '.twig';
        }
        $message = '
Could not find : '.$miss.'
';
        $message .= "\nIn : $root
";

        $response = $this->render('@KaliopTwigExpress/layout.html.twig', [
            'breadcrumbs' => $breadcrumbs,
            'metaTitle' => 'Not found: ' . $urlFragment,
            'title' => 'File does not exist',
            'message' => $message
        ]);
        $response->setStatusCode(404);
        return $response;
    }

    /**
     * Render a Twig template
     * @param string $templateName
     * @return Response
     * @throws \Exception
     */
    private function renderTwig($templateName)
    {
        // Always make breadcrumbs, in case the template calls the TwigExpress layout
        $breadcrumbs = $this->makeBreadcrumbs(
            $this->baseUrl,
            $this->bundleName,
            str_replace($this->docRootName, '', $templateName)
        );
        // Do we have an extension, like .html or .json?
        $ext = pathinfo(substr($templateName, 0, -5), PATHINFO_EXTENSION);
        $cType = $ext ? Utils::getMediaType($ext) . ';charset=utf-8' : null;
        try {
            $response = $this->render($templateName, ['breadcrumbs'=>$breadcrumbs]);
            if ($cType) $response->headers->set('Content-Type', $cType);
            return $response;
        }
        catch (Twig_Error $error) {
            if ($this->debug) {
                return $this->showTwigError($error, $breadcrumbs);
            } else {
                throw $error;
            }
        }
    }

    /**
     * Show an error page for a Twig_Error, with the faulty Twig code if we can.
     * @param Twig_Error $error
     * @param array $breadcrumbs - Breadcrumbs to pass along to template
     * @return Response
     */
    private function showTwigError(Twig_Error $error, $breadcrumbs)
    {
        $line = $error->getTemplateLine();
        $message = $error->getRawMessage();

        // Might be different from the known template name, if the error occurred in an
        // included file. Also we can get one of three types of result:
        // - A full system path
        // - @SomeBundleNameBundle/some/path/xyz
        // - @SomeBundleName/xyz (= @SomeBundleNameBundle/Resources/views/xyz)
        // We're going to have to do a bit of guessing.
        $fileRef  = $error->getTemplateFile();
        $filePath = $fileRef; // ultimately, we want a full system path
        $fileName = $fileRef; // we want a @SomeBundleNameBundle/xyz type of name

        // Key used by Symfony/Twig to reference views inside Resources/views,
        // Format is '@MyBunleName' without the final 'Bundle'.
        $bundlePrefix = '@' . $this->bundleName;
        $bundleViewsPrefix = '@' . substr($this->bundleName, 0, -6);

        // @SomeBundleNameBundle (bundle root)
        if (strpos($fileRef, $bundlePrefix.'/') === 0) {
            $filePath = str_replace($bundlePrefix, $this->bundlePath, $fileRef);
        }
        // @SomeBundleName (bundle root + Resources/views)
        elseif (strpos($fileRef, $bundleViewsPrefix.'/') === 0) {
            $filePath = str_replace($bundleViewsPrefix, $this->bundlePath.'/Resources/views', $fileRef);
            $fileName = str_replace($bundleViewsPrefix, $bundlePrefix.'/Resources/views', $fileRef);
        }
        // Full system path
        elseif (strpos($fileRef, $this->bundlePath) === 0) {
            $fileName = '@'.$this->bundleName . str_replace($this->bundlePath, '', $fileRef);
        }

        $data = [
            'metaTitle' => 'Error: ' . basename($fileName),
            'title' => get_class($error),
            'breadcrumbs' => $breadcrumbs,
            'message' => "$message
\nLine $line of $fileName"
        ];

        // Get a few lines of code from the buggy template
        if (file_exists($filePath)) {
            $code = file_get_contents($filePath);
            $data['code'] = Utils::formatCodeBlock($code, true, $line, 5);
            $data['codeContext'] = Utils::getHighlightLanguage($fileRef);
        }

        return $this->render('@KaliopTwigExpress/layout.html.twig', $data);
    }

    /**
     * Show a Twig file with syntax highlighting
     * @param string $systemPath Full path to file
     * @param string $urlFragment URL without base or bundle key
     * @return Response
     */
    private function showSource($systemPath, $urlFragment)
    {
        // Prepare breadcrumbs
        $breadcrumbs = $this->makeBreadcrumbs(
            $this->baseUrl,
            $this->bundleName,
            $urlFragment
        );
        $code = file_get_contents($systemPath);
        $data = [
            'metaTitle' => 'Source: ' . basename($systemPath),
            'breadcrumbs' => $breadcrumbs,
            'code' => Utils::formatCodeBlock($code, true),
            'codeContext' => Utils::getHighlightLanguage($systemPath),
            'navBorder' => false
        ];
        return $this->render('@KaliopTwigExpress/layout.html.twig', $data);
    }

    /**
     * Make an array representing navigation items
     * @param  string $baseUrl (no trailing slash)
     * @param  string $bundleName
     * @param  string $path
     * @return array
     */
    private function makeBreadcrumbs($baseUrl, $bundleName, $path)
    {
        $url = $baseUrl . '/';
        $crumbs = [['url' => $url, 'name' => $bundleName]];
        $fragments = array_filter(explode('/', $path));
        $last = array_pop($fragments);
        foreach ($fragments as $fragment) {
            $url .= $fragment . '/';
            $crumbs[] = ['url' => $url, 'name' => $fragment];
        }
        // Last fragment can be one item or two (if we want to link the '.twig' extension)
        if ($last) {
            $ext = pathinfo($last, PATHINFO_EXTENSION);
            $reqExt = $this->requestPath ? pathinfo($this->requestPath, PATHINFO_EXTENSION) : '';
            if ($ext === 'twig') {
                $noTwigExt = substr($last, 0, -5);
                $crumbs[] = [
                    'url' => $url . $noTwigExt,
                    'name' => $noTwigExt,
                    'active' => $ext !== $reqExt
                ];
                $crumbs[] = [
                    'url' => $url . $last,
                    'name' => '.twig',
                    'ext' => true,
                    'active' => $ext === $reqExt
                ];
            }
            else {
                $url .= $last . ($ext === '' ? '/' : '');
                $crumbs[] = ['url' => $url, 'name' => $last];
            }
        }
        // Make sure all items have 'active' and 'ext' properties
        for ($i=0, $end=count($crumbs) - 1; $i <= $end; $i++) {
            if (!array_key_exists('active', $crumbs[$i])) {
                $crumbs[$i]['active'] = $i === $end;
            }
            if (!array_key_exists('ext', $crumbs[$i])) {
                $crumbs[$i]['ext'] = false;
            }
        }
        return $crumbs;
    }
}


text:
import utility from './common/utility';
let app = new Vue({
    el: '#register',
    delimiters: ['${', '}'],
    data: {
        validationFailedMsg: '',
        registerSuccess: ''
    },
    methods: {
        async register() {
            let username = document.getElementById('username').value, password = utility.strHelper.trim(document.getElementById('password').value),
                passwordAgain = document.getElementById('passwordAgain'), email = utility.strHelper.trim(document.getElementById('email').value),
                data = {}, self = this, registerCallBack = null;
            self.validationFailedMsg = '';
            if (!(/^[a-zA-Z0-9\u4e00-\u9fa5]+$/.test(username)) || username.length < 6 || username.length > 12) {
                self.validationFailedMsg = '用户名不合法';
                document.getElementById('username').focus();
                return;
            }
            if (password === '' || password.length < 6 || password.length > 12) {
                self.validationFailedMsg = '密码不合法';
                document.getElementById('password').focus();
                return;
            } else if (password !== passwordAgain.value) {
                self.validationFailedMsg = '两次输入的密码不一致';
                passwordAgain.focus();
                return;
            }
            if (email === null || !(/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(email))) {
                self.validationFailedMsg = '邮箱格式不正确';
                document.getElementById('email').focus();
                return;
            }
            data = { username: username, password: password, email: email };
            registerCallBack = await utility.ajax('/register', 'post', data);
            if (registerCallBack) {
                self.validationFailedMsg = '';
                self.registerSuccess = '注册成功';
            } else {
                self.validationFailedMsg = '用户名已经存在';
                document.getElementById('username').focus();
            }
        }
    }
});