text:
package neta.crawler;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;

import neta.crawler.base.ConnectionManager;
import neta.crawler.process.dao.ArticleDao;
import neta.crawler.process.dto.Article;

import org.junit.Test;

public class Recorrect {
	final ArticleDao dao = new ArticleDao();

	@Test
	public void execute() throws Exception{
		List<ExecDto> dtoList = new ArrayList<ExecDto>();
		for (String f : getClassesName("neta.crawler.process.logic")){

			Class<?> clazz = Class.forName("neta.crawler.process.logic."+ f);

			Method recollect = clazz.getDeclaredMethod("collectSinglePage", new Class[]{String.class});
			recollect.setAccessible(true);

			Object instance = clazz.newInstance();
			Field url = clazz.getDeclaredField("URL");
			url.setAccessible(true);

			ExecDto dto = new ExecDto();

			dto.setClazz(clazz);
			dto.setInstance(instance);
			dto.setRecollect(recollect);
			dto.setUrl((String) url.get(this));

			dtoList.add(dto);
		}

		//準備したクラスでDBに格納しているURLに対して再度処理する
		ConnectionManager.prepareDataSource();
		List<Article> articles = dao.selectAll();
		List<Article> recollectArticles = new ArrayList<Article>();

		for (Article a: articles){
			for (ExecDto dto:dtoList){
				if (a.url.indexOf(dto.url) != -1){
					Article result = ((Article) dto.getRecollect().invoke(dto.getInstance(), a.url));
					result.id = a.id;
					recollectArticles.add(result);
					break;
				}
			}
		}

		//結果をupdate
		//念のため、ループの中で詰めて、再度ループしてupd
		for (Article a: recollectArticles){
			dao.update(a);
		}

		ConnectionManager.commitAndClose();
	}

	class ExecDto{
		private Class<?> clazz;
		private Object instance;
		private Method recollect;
		private String url;

		public Class<?> getClazz() {
			return clazz;
		}
		public void setClazz(Class<?> clazz) {
			this.clazz = clazz;
		}
		public Object getInstance() {
			return instance;
		}
		public void setInstance(Object instance) {
			this.instance = instance;
		}
		public Method getRecollect() {
			return recollect;
		}
		public void setRecollect(Method recollect) {
			this.recollect = recollect;
		}
		public String getUrl() {
			return url;
		}
		public void setUrl(String url) {
			this.url = url;
		}
	}

	/**
	 * 特定パッケージのクラス名一覧を取得する
	 * @param targetPackageName
	 * @return
	 * @throws IOException
	 */
	private List<String> getClassesName(String targetPackageName) throws IOException{
		String resourceName = convertResourceName(targetPackageName);
		Enumeration<URL> resourceUrls = Thread.currentThread().getContextClassLoader().getResources(resourceName);

		if (resourceUrls == null){
			return Collections.emptyList();
		}

		while (resourceUrls.hasMoreElements()) {
			URL url = resourceUrls.nextElement();
			String protocol = url.getProtocol();
			if ("file".equals(protocol)){
				return findClassesWithFile(targetPackageName, new File(url.getFile()));
			}else if ("jar".equals(protocol)){
				return Collections.emptyList();
			}
		}
		return Collections.emptyList();
	}

	private List<String> findClassesWithFile(String targetPackageName, File dir) {
	    List<String> classNames = new ArrayList<String>();

	    for (String path : dir.list()){
	    	File entry = new File(dir, path);
	    	if (entry.isFile() && isClassFile(entry.getName())){
	    		classNames.add(fileNameToClassName(entry.getName()));
	    	}
	    }
	    return classNames;
    }

	private String fileNameToClassName(String name) {
	    return name.substring(0, name.length()- ".class".length());
    }

	private boolean isClassFile(String fileName) {
        return fileName.endsWith(".class");
    }

	private String convertResourceName(String packageName){
		return packageName.replace(".", "/");
	}

}


text:
package com.oculusinfo.ml.unsupervised;

import com.oculusinfo.ml.DataSet;
import com.oculusinfo.ml.Instance;
import com.oculusinfo.ml.feature.string.StringFeature;
import com.oculusinfo.ml.feature.string.centroid.StringMedianCentroid;
import com.oculusinfo.ml.feature.string.distance.EditDistance;
import com.oculusinfo.ml.feature.string.distance.ExactTokenMatchDistance;
import com.oculusinfo.ml.unsupervised.cluster.Cluster;
import com.oculusinfo.ml.unsupervised.cluster.ClusterResult;
import com.oculusinfo.ml.unsupervised.cluster.dpmeans.DPMeans;

public class TestStringClusteringWithMissingFeatures {

	private static final String FEATURE_NAME1 = "name";
	private static final String FEATURE_NAME2 = "location";

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		DataSet<String> ds = new DataSet<String>();

		Instance<String> inst = new Instance<String>("1");
		StringFeature feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jack black");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("san diego");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("2");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jack black");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("3");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jack");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("san diego");
		inst.add(feature);

		ds.add(inst);

		inst = new Instance<String>("4");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jack l. black");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("san diego");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("5");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("j. black");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("san diego");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("6");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("j black");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("new york");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("7");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("black");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("new york");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("8");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jackie black");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("9");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jack brown");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("10");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jackie green");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("11");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("bob");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("san fran");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("12");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("bobbie");
		inst.add(feature);
		feature = new StringFeature(FEATURE_NAME2);
		feature.setValue("san fran");
		inst.add(feature);
		ds.add(inst);

		inst = new Instance<String>("13");
		feature = new StringFeature(FEATURE_NAME1);
		feature.setValue("jackie");
		inst.add(feature);
		ds.add(inst);

		DPMeans clusterer = new DPMeans(5, true);
		clusterer.registerFeatureType(
				FEATURE_NAME1,
				StringMedianCentroid.class,
				new EditDistance(0.5));
		clusterer.registerFeatureType(
				FEATURE_NAME2,
				StringMedianCentroid.class,
				new ExactTokenMatchDistance(0.5));
		clusterer.setThreshold(0.5);

		ClusterResult clusters = clusterer.doCluster(ds);
		for (Cluster c : clusters) {
			System.out.println(c.toString(true));
		}
		clusterer.terminate();
	}
}

redpajama_set_name: RedPajamaGithub


text:
/*
Create classes: Environment, Event and Event's Children, each blender object in the lib file

*/
var terrainScale = 3;
function Environment(){
    //introduce environmental variables here:
    this.ground; //base plane for world
    this.objects = []; // array to hold objects for reference
    this.animateObjects = []; // array for all moving objects
    this.terrainQuadrants = []; //array of quadrants
    this.objectsInQuadrant = [];
    for(x=0;x<16;x++){
        this.objectsInQuadrant.push([]);
    } // record objects position by quadrant
    //update function runs world
    this.update = function(){
        this.animateObjects.forEach(function(obj) {
            obj.animate();
        }, this);
    }
}
// ---Genaric Animate Methods---
function Prey(obj){
    /*
        Determine movement based on:
        1) Food
        2) Safety/avoid predators
        3) Proximity of others of the same species
    */
    var options = [];
    var add;
    var keep;
    environment.terrainQuadrants.forEach(function(q){
        add = false;
        var iOfQ = environment.terrainQuadrants.indexOf(q); // set var to index of Quadrant
        var iOfObj = environment.terrainQuadrants.indexOf(obj.quadrant);//set var to index of obj.quadrant in terrain quadrants
        if(iOfQ-1 == iOfObj||iOfQ+1 == iOfObj ||iOfQ-4 == iOfObj ||iOfQ+4 == iOfObj){
            add = true;
        }
    });
    //narrow down option list based on food, shelter, others
    options.forEach(function(option){

        keep = false;
        //3) shelter TODO go over this
        if(environment.terrainQuadrants[options].name== obj.home){
            keep = true;
        }
        //3) Food
        if(environment.terrainQuadrants[options].name=='Plain'){
            keep = true;
        }
        environment.objectsInQuadrant[option].forEach(function(o){
            //2) others TODO classes may be the death of us
            if(o.name==obj.name&&keep!=true){
                keep = true;
            }
            if(!keep){
                options.remove(environment.terrainQuadrants.indexOf(environment.terrainQuadrants[options]));
            }
        });
        //make random choice based on remaining options
        var choice = Math.random()*options;
        choice = options[choice];
        var coords = quadCoordinates(environment.terrainQuadrants[choice]);
        move(obj,coords);
    });
}
function Predators(obj){
    /*
        Determine movement based on:
        1) Prey/Food
        2) Shelter
        3) Proximity of others of the same species
    */
    //determine movement options:
    var options = [];
    var add;
    var keep;
    environment.terrainQuadrants.forEach(function(q){
        add = false;
        var iOfQ = environment.terrainQuadrants.indexOf(q); // set var to index of Quadrant
        var iOfObj = environment.terrainQuadrants.indexOf(obj.quadrant);//set var to index of obj.quadrant in terrain quadrants
        if(iOfQ-1 == iOfObj||iOfQ+1 == iOfObj ||iOfQ-4 == iOfObj ||iOfQ+4 == iOfObj){
            add = true;
        }
    });
    //narrow down option list based on food, shelter, others
    options.forEach(function(option){

        keep = false;
        //3) shelter TODO go over this
        if(environment.terrainQuadrants[options].name == obj.home){
            keep = true;
        }else{
            options.remove(environment.terrainQuadrants.indexOf(environment.terrainQuadrants[options]));
        }

        environment.objectsInQuadrant[option].forEach(function(o){
            //3) Food
            if(o.class=='prey'){
                keep = true;
            }
            //2) others TODO classes may be the death of us
            if(o.name==obj.name&&keep!=true){
                keep = true;
            }
            if(!keep){
                options.remove(environment.terrainQuadrants.indexOf(environment.terrainQuadrants[options]));
            }
        });
        //make random choice based on remaining options
        var choice = Math.random()*options;
        choice = options[choice];
        var coords = quadCoordinates(environment.terrainQuadrants[choice]);
        move(obj,coords);
    });
}

function quadCoordinates(quadrant){
    var x = (quadrant.x - 30) + (60*Math.random());
    var z = (quadrant.z - 30) + (60*Math.random());
    var y;
    quadrant.object.geometry.vertices.forEach(function(v){
        if(v.x-x<.01&&v.z-z<.01){
              y = v.y;
        }
    });
    return [x,y,z];
}
function move(obj,coords){
    obj.x = coords[0];
    obj.y = coords[1];
    obj.z = coords[2];
    obj.object.position.x = obj.x;
    obj.object.position.y = obj.y;
    obj.object.position.z = obj.z;
}
// ---Generic Object Classes---
function Mountain(x,y,z){
    this.object = new THREE.Mesh();
    this.width = 60;
    this.height = 60;
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = terrainScale;
    this.path = '/Blender .js files/Mountain.js';
}
function Lake(x,y,z){
    this.object = new THREE.Mesh();
    this.width = 60;
    this.height = 60;
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = terrainScale;
    this.path = '/Blender .js files/Lake.js';
}
function Forest(x,y,z){
    this.object = new THREE.Mesh();
    this.width = 60;
    this.height = 60;
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = terrainScale;
    this.path = '/Blender .js files/Forest.js'
}
function Plain(x,y,z){
    this.object = new THREE.Mesh();
    this.width = 60;
    this.height = 60;
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = terrainScale;
    this.path = '/Blender .js files/Plane.js';
}
function Tree(x,y,z){
    this.object = new THREE.Mesh();
    this.width = 60;
    this.height = 60;
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = 10;
    this.path = '..//Blender .js files/finished_tree.js';
}
//---Animate Objects---
function Cow(x,y,z,quadrant){
    this.animate = function(){Prey(this)};
    this.class = "prey";
    this.quadrant = quadrant;
    this.object = new THREE.Mesh();
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = 10;
    this.home = new Plain();
    this.path = '/Blender .js files/cow-mini.js';
}
function Horse(x,y,z,quadrant){
    this.animate = function(){Prey(this)};
    this.class = "prey";
    this.quadrant = quadrant;;
    this.object = new THREE.Mesh();
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = 10;
    this.home = new Plain();
    this.path = '/Blender .js files/horse-mini.js';
}
function Goat(x,y,z,quadrant){
    this.animate = function(){Prey(this)};
    this.class = "prey";
    this.quadrant = quadrant;;
    this.object = new THREE.Mesh();
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = 10;
    this.home = new Mountain();
    this.path = '/Blender .js files/goat.js';
}
function Bear(x,y,z,quadrant){
    this.animate = function(){Predators(this)};
    this.class = "prey";
    this.quadrant = quadrant;;
    this.object = new THREE.Mesh();
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = 10;
    this.home = new Forest();
    this.path = '/Blender .js files/bear.js';
}
function Wolf(x,y,z,quadrant){
    this.animate = function(){Predators(this)};
    this.class = "prey";
    this.quadrant = quadrant;;
    this.object = new THREE.Mesh();
    this.x = x;
    this.y = y;
    this.z = z;
    this.scale = 10;
    this.home = new Mountain();
    this.path = '/Blender .js files/wolf.js';
}


text:
import express from 'express';
const router = express.Router({mergeParams: true}); // eslint-disable-line

router.use('/webhook', require('./webhook'));
router.use('/noti', require('./notification'));
router.use('/users', require('./users'));
router.use('/help', (req, res, next) => {
 res.render('help/help');
});

module.exports = router;


text:
qalib
=====

A commonjs library which generates sixth-form (grade 12) mathematical fluency exercise questions with answers. The output is in HTML/MathJAX.

This is the library that generates questions and answers, extracted from mathmo in [Apps1](https://github.com/gmp26/Apps1). The original had a large number of global variables which have been eliminated and the library has been converted to the CommonJS standard to handle dependencies between its components using browserify. It will now work in the browser or in a nodeJS environment.

Installation
------------
For browser use, include [dist/qalib.js](https://github.com/gmp26/dist/qalib.js).

For node, add `dist/qalib.js` to your project and then require it.

Use in a NodeJS project
-----------------------
```javascript
  var qalib = require('<path_to>/qalib.js')({});
  ...
```

Use in the browser
------------------
See the [examples](https://github.com/gmp26/examples) folder.
```html
<script src="../dist/qalib.js" type="text/javascript"></script>
<script>
  var qalib = require('qalib')({});

  // Initialise the seed - anything will do.
  // This just corresponds to the seed used in unit tests.
  var seed = "unit-test/C38/1";

  // qalib includes seedrandom for repeatable questions
  Math.seedrandom(seed);
  maker = qalib.topicMakerById('C38');

  for(var i = 1; i < 4; i++) {
    qa = maker();
    alert("question " + i + " = "+qa[0]);
    alert("answer " + i + " = " + qa[1]);
  }
</script>

```

Development
-----------
To install and run unit tests continuously:-

```shell
git clone https://github.com/gmp26/qalib.git
cd qalib
npm install
grunt
```


text:
{% extends "layout/page.html" %}
{% set active_page = "about" %}
{% block content %}

Bootstrap starter template

Use this document as a way to quickly start any new project.
 All you get is this text and a mostly barebones HTML document.

{% endblock %}


text:
//
// Copyright (C) INRIA 1999-2008
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License version 2 as published
// by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//%
// @file kernel/Utils.hpp
// @author Rémy MOZUL
//
// Affiliation(s): INRIA, team BIPOP
//
// Email(s): mozul@inria.fr
//
// @brief reducing and expanding functions for vecotr and matrices
//

#ifndef __Kernel_Utils_hpp
#define __Kernel_Utils_hpp

#ifdef WINDOWS
#define extern __declspec (dllexport)
#endif

#include <boost/numeric/bindings/traits/ublas_vector.hpp>
#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>

using namespace boost::numeric::ublas;

/**
 * Reduce the input matrix to the given indexes
 *
 * @param[in] mat (matrix)
 * @param[in] index1 (int)
 * @param[in] index2 (int)
 */
void reduceMatrix(matrix<double, column_major> & mat, vector<int> & index1, vector<int> & index2);

/**
 * Reduce the input matrix to the given indexes
 *
 * @param[in] mat (matrix)
 * @param[in] index1 (bool) <em> dim number of rows of mat </em>
 * @param[in] index2 (int)
 */
void reduceMatrix(matrix<double, column_major> & mat, vector<bool> & index1, vector<int> & index2);

/**
 * Reduce the input vector to the given index
 *
 * @param[in] vec (vector)
 * @param[in] index (int)
 *
 * @return reduced vector <em> dim size of index </em>
 */
vector<double> reduceVector(vector<double> & vec, vector<int> & index);

/**
 * Reduce the input vector to the given index
 *
 * @param[in/out] vec (vector)
 * @param[in] index (int)
 *
 * @return reduced vector <em> dim size of index </em>
 */
vector<double> reduceVector(vector<double, array_adaptor<double> > & vec, vector<int> & index);

/**
 * Reduce the input vector to the given index
 *
 * @param[in/out] vec (vector)
 * @param[in] index (bool) <em> dim size of vec </em>
 *
 */
void reduceVector(vector<double> & vec, vector<bool> & index);

/**
 * Reduce the input vector to the given index
 *
 * @param[in/out] vec (vector)
 * @param[in] index (bool) <em> dim size of vec </em>
 *
 */
void reduceVector(vector<bool> & vec, vector<bool> & index);

/**
 * Expand a vector2 into the given indexes of vector1
 *
 * @param[in/out] tab (double)
 * @param[in] vector (vector)
 * @param[in] index (int)
 */
void expandVector(double * tab, vector<double> & vector2, vector<int> & index);

/**
 * Expand a vector2 into the given indexes of vector1
 *
 * @param[in/out] tab (double)
 * @param[in] vector (vector)
 * @param[in] index (int) <em> dim size of tab </em>
 */
void expandVector(double * tab, vector<double> & vector, vector<bool> & index);

#endif /* __Kernel_Utils_hpp */


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 86: 475 (2003)

#### Original name
Spermosporina gymnadeniae Mulenko, U. Braun & Wolcz.

### Remarks
null


text:
BEGIN;

ALTER TABLE licenses DROP CONSTRAINT licenses_module_id_file_path;

END;


text:
#ifndef GRAPHICS_FREE_IMAGE_HPP
#define GRAPHICS_FREE_IMAGE_HPP

#include <string>

namespace OrbitEngine { namespace Graphics {

	/**
		@brief Reads an image from disk

		@param[in] path File location
		@param[out] width,height Read image dimensions
		@param[out] bpp Read image bits per pixel
		@param[in] force32bits Force any 24bit image to load as a 32bit image
		@return Raw pointer to the pixel data. Remember to delete it after its used
	*/
	unsigned char* ReadImage(const std::string& path, unsigned int& width, unsigned int& height, unsigned int& bpp, bool force32bits = false);

	/**
		@brief Reads an image from disk

		@param[in] file_data file binary data
		@param[in] file_size file size
		@param[out] width,height Read image dimensions
		@param[out] bpp Read image bits per pixel
		@param[in] force32bits Force any 24bit image to load as a 32bit image
		@return Raw pointer to the pixel data. Remember to delete it after its used
	*/
	unsigned char* ReadImage(unsigned char* file_data, size_t file_size, unsigned int& width, unsigned int& height, unsigned int& bpp, bool force32bits = false);

	/**
		@brief Writes a PNG file to disk

		@param[in] path File location
		@param[in] width,height Image dimensions
		@param[in] bpp Bits per pixel present int the image
		@param[in] data Raw pointer to the pixel data. Make sure it has at least \p width * \p height * \p bpp bits
		@return Whether the image was saved successfully
	*/
	bool WritePNG(const std::string& path, unsigned int width, unsigned int height, unsigned int bpp, unsigned char* data);

} }

#endif


text:
<?php
// Note: not portable, very specific to this Wordpress install.
require_once __DIR__ . '/../../../../wp/wp-blog-header.php';

// Verify the nonce to confirm intent (set in authentication.php)
if (check_admin_referer('log-out')) {
    wp_logout();
    $wp_login_url = wp_login_url();
    wp_die("You've been successfully logged out.", '', [
        "link_text" => "Log back in",
        "link_url" => wp_login_url(),
    ]);
}


text:
package com.intellij.uiDesigner.quickFixes;

import com.intellij.codeInspection.util.IntentionName;
import com.intellij.uiDesigner.designSurface.GuiEditor;
import com.intellij.uiDesigner.radComponents.RadComponent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author Anton Katilin
 * @author Vladimir Kondratyev
 */
public abstract class QuickFix {
  public static final QuickFix[] EMPTY_ARRAY = {};

  protected final GuiEditor myEditor;
  private final @IntentionName String myName;
  protected RadComponent myComponent;

  public QuickFix(@NotNull GuiEditor editor, @NotNull @IntentionName String name, @Nullable RadComponent component) {
    myEditor = editor;
    myName = name;
    myComponent = component;
  }

  /**
   * @return name of the quick fix.
   */
  @NotNull public final @IntentionName String getName() {
    return myName;
  }

  public abstract void run();

  public RadComponent getComponent() {
    return myComponent;
  }
}


text:
class Cms::Apis::Preview::InplaceEdit::PagesController < ApplicationController
  include Cms::ApiFilter
  include Cms::InplaceEditFilter

  model Cms::Page

  layout "ss/ajax_in_iframe"

  before_action :set_cur_node
  before_action :set_inplace_mode

  private

  def fix_params
    { cur_user: @cur_user, cur_site: @cur_site }
  end

  def set_item
    super
    return @item if @item.blank? || @item.class != Cms::Page

    @item = @item.becomes_with_route rescue @item
    @model = @item.class
  end

  def set_cur_node
    @cur_node ||= begin
      parent = @item.parent
      parent ? parent : nil
    end
  end

  def set_inplace_mode
    @inplace_mode = true
  end

  def save_with_overwrite
    result = @item.save

    if !result
      render file: :edit, status: :unprocessable_entity
      return
    end

    flash["cms.preview.notice"] = I18n.t("ss.notice.saved")
    render json: { reload: true }, status: :ok, content_type: json_content_type
  end

  def save_as_branch
    if @item.branches.present?
      @item.errors.add :base, :branch_is_already_existed
      render_save_as_branch false
      return
    end

    @item.cur_site = @cur_site
    @item.cur_node = @item.parent if @item.parent
    @item.cur_user = @cur_user
    copy = @item.new_clone
    copy.master = @item
    result = copy.save
    if result
      path_params = { path: copy.filename, anchor: "inplace" }
      path_params[:preview_date] = params[:preview_date].to_s if params[:preview_date].present?
      location = cms_preview_path(path_params)
    else
      @item.errors.messages[:base] += copy.errors.full_messages
    end

    render_save_as_branch result, location
  end

  def render_save_as_branch(result, location = nil)
    if result && location
      flash["cms.preview.notice"] = I18n.t("workflow.notice.created_branch_page")
      render json: { location: location }, status: :ok, content_type: json_content_type
    else
      render file: :edit, status: :unprocessable_entity
    end
  end

  public

  def edit
    raise "403" if !@item.allowed?(:edit, @cur_user, site: @cur_site)
    super
  end

  def update
    @item.attributes = get_params
    @item.in_updated = params[:_updated] if @item.respond_to?(:in_updated)
    raise "403" if !@item.allowed?(:edit, @cur_user, site: @cur_site)

    if creates_branch?
      save_as_branch
    else
      save_with_overwrite
    end
  end
end


text:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Pear.InteractionEngine.UI
{
	/// <summary>
	/// Highlights a game object with a specified material
	/// </summary>
	public class HighlightMaterial : AHighlight<GameObject, Material>
	{
		protected override Material HighlightProperty
		{
			get { return ObjectToHighlight.GetComponent<Renderer>().material; }
			set { ObjectToHighlight.GetComponent<Renderer>().material = value; }
		}
	}
}


text:
<?php

namespace Symfony\Components\Form;

/**
 * A localized field for entering integers.
 *
 * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
 */
class IntegerField extends NumberField
{
    /**
     * {@inheritDoc}
     */
    protected function configure()
    {
        $this->addOption('precision', 0);

        parent::configure();
    }

    /**
     * {@inheritDoc}
     */
    public function getData()
    {
        return (int)parent::getData();
    }
}


text:
Array of the item objects.

    Array, default = []

The .items property defines all toolbar items (buttons, drop down menus, etc.) You
can define them during object creation or at run-time.

<textarea class="javascript">
$('#toolbar').w2toolbar({
    name  : 'toolbar',
    right : 'text on the right',
    items : [
        { type: 'check',  id: 'item1', text: 'Check', img: 'icon-page', checked: true },
        { type: 'radio',  id: 'item3',  group: '1', text: 'Radio 1', img: 'icon-add' },
        { type: 'radio',  id: 'item4',  group: '1', text: 'Radio 2', img: 'icon-add' }
    ]
});
</textarea>

The structure of the item is defined in .item_template()

If you change this property during run-time, do not forget to call the .refresh()
method.

To add/remove items during run-time, you should better call
.add(),
.insert(),
.remove() methods.


text:
define([
  'underscore',
  'jquery',
  'views/editor_base',
  'vent',
  'storage',
  'text!templates/trigger_creator.tpl',
  'models/instance',
],
function(
  _,
  $,
  EditorView,
  vent,
  storage,
  Template,
  Instance
)
{
  return EditorView.extend(
  {

    /* View */

    template: _.template(Template),

    ui: {
      "save":   ".save",
      "cancel": ".cancel",

      "name":   "#object-name",

      "autofocus":  "input[autofocus]"
    },

    templateHelpers: function()
    {
      return {
      }
    },

    /* Initialization and Rendering */

    initialize: function(options)
    {
      this.scene       = options.scene;
      this.game_object = options.game_object;
      this.instance    = options.instance;
    },

    onShow: function()
    {
      this.ui.autofocus.focus();
    },

    /* View Events */

    events: {
      "click @ui.save":   "onClickSave",
      "click @ui.cancel": "onClickCancel"
    },

    /* Crud */

    onClickSave: function()
    {
      var view = this;
      var instance    = this.instance;
      var game_object = this.game_object;
      var trigger     = this.model;

      game_object.set("name", view.ui.name.val());

      game_object.save({}, {
        create: function()
        {
          storage.add_game_object(game_object);
        },
        success: function()
        {
          // Save Instance

          instance.set("object_id",   game_object.id);
          instance.set("object_type", Instance.type_for(game_object));

          instance.save({}, {
            create: function()
            {
              storage.add_game_object(instance);
            },

            success: function()
            {

              // Save Trigger
              trigger.set("instance_id", instance.id);

              trigger.save({},
              {
                create: function()
                {
                  storage.add_game_object(trigger);

                  vent.trigger("application:popup:hide");
                }
              }); /* Trigger save */
            }
          }); /* Instance save */
        }
      }); /* Game Object save */
    },

    onClickCancel: function()
    {
      this.close();
      vent.trigger("application:popup:hide");
    }

  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Classes/IFlyDataUploader.html">

		<Token>
			<TokenIdentifier>//apple_ref/occ/cl/IFlyDataUploader</TokenIdentifier>
			<Abstract type="html">数据上传类</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/IFlyDataUploader/setDataName:</TokenIdentifier>
			<Abstract type="html">数据名称</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *dataName</Declaration>

			<Anchor>//api/name/dataName</Anchor>
            <NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/IFlyDataUploader/dataName</TokenIdentifier>
			<Abstract type="html">数据名称</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *dataName</Declaration>

			<Anchor>//api/name/dataName</Anchor>
            <NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/IFlyDataUploader/dataName</TokenIdentifier>
			<Abstract type="html">数据名称</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *dataName</Declaration>

			<Anchor>//api/name/dataName</Anchor>
            <NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/IFlyDataUploader/setData:</TokenIdentifier>
			<Abstract type="html">数据</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *data</Declaration>

			<Anchor>//api/name/data</Anchor>
            <NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/IFlyDataUploader/data</TokenIdentifier>
			<Abstract type="html">数据</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *data</Declaration>

			<Anchor>//api/name/data</Anchor>
            <NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/IFlyDataUploader/data</TokenIdentifier>
			<Abstract type="html">数据</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>@property (nonatomic, copy) NSString *data</Declaration>

			<Anchor>//api/name/data</Anchor>
            <NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/IFlyDataUploader/uploadDataWithCompletionHandler:name:data:</TokenIdentifier>
			<Abstract type="html">上传数据
此函数用于上传数据,下载的过程是异步的。</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>- (void)uploadDataWithCompletionHandler:(IFlyUploadDataCompletionHandler)completionHandler name:(NSString *)name data:(NSString *)data</Declaration>
			<Parameters>
				<Parameter>
					<Name>completionHandler</Name>
					<Abstract type="html">-[in] 上传完成回调</Abstract>
				</Parameter><Parameter>
					<Name>name</Name>
					<Abstract type="html">-[in] 上传的内容名称,名称最好和你要上传的数据内容相关,不可以为nil</Abstract>
				</Parameter><Parameter>
					<Name>data</Name>
					<Abstract type="html">-[in] 上传的数据,以utf8编码,不可以为nil</Abstract>
				</Parameter>
			</Parameters>

			<Anchor>//api/name/uploadDataWithCompletionHandler:name:data:</Anchor>
            <NodeRef refid="3"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/IFlyDataUploader/setParameter:forKey:</TokenIdentifier>
			<Abstract type="html">设置上传数据参数</Abstract>
			<DeclaredIn>IFlyDataUploader.h</DeclaredIn>

			<Declaration>- (void)setParameter:(NSString *)parameter forKey:(NSString *)key</Declaration>
			<Parameters>
				<Parameter>
					<Name>parameter</Name>
					<Abstract type="html">参数值</Abstract>
				</Parameter><Parameter>
					<Name>key</Name>
					<Abstract type="html">参数名</Abstract>
				</Parameter>
			</Parameters>

			<Anchor>//api/name/setParameter:forKey:</Anchor>
            <NodeRef refid="3"/>
		</Token>

	</File>
</Tokens>


text:
function PublicKey(params) {
    this._fingerprint = params.fingerprint;
    this._modulus = params.modulus;
    this._exponent = params.exponent;
}

PublicKey.prototype.getFingerprint = function () {
    return this._fingerprint;
};

PublicKey.prototype.getModulus = function () {
    return this._modulus;
};

PublicKey.prototype.getExponent = function () {
    return this._exponent;
};

// The key store
var keyStore = {};

// Add a key to key store, it requires the fingerprint, the key and the exponent:
//
//      PublicKey.addKey{fingerprint: '...', modulus: '...', exponent: '...'});
//
PublicKey.addKey = function (params) {
    var newKey = new PublicKey(params);
    keyStore[newKey.getFingerprint()] = newKey;
};

// Retrieve a key with the fingerprint
PublicKey.retrieveKey = function (fingerprint) {
    return keyStore[fingerprint];
};

// Retrieve a keys
PublicKey.keys = function () {
    return keyStore;
};

// Export the class
module.exports = exports = PublicKey;


text:
using ATZ.CollectionObservers;
using ATZ.DependencyInjection;
using ATZ.DependencyInjection.System;
using ATZ.MVVM.ViewModels.Utility;
using ATZ.MVVM.Views.Utility.Interfaces;
using System.Collections;
using System.Collections.ObjectModel;

namespace ATZ.MVVM.Views.Utility.Connectors
{
    /// <summary>
    /// Connector between Views and ViewModels collections.
    /// </summary>
    /// <typeparam name="TModel">The type of the Model.</typeparam>
    public class CollectionViewToViewModelConnector<TModel> : CollectionObserverBase<IViewModel<TModel>, IView<IViewModel<TModel>>, IList> where TModel : class
    {
        /// <summary>
        /// The View collection.
        /// </summary>
        public IList ViewCollection
        {
            get => TargetCollection;
            set => TargetCollection = value;
        }

        /// <summary>
        /// The ViewModel collection.
        /// </summary>
        public ObservableCollection<IViewModel<TModel>> ViewModelCollection
        {
            get => SourceCollection;
            set => SourceCollection = value;
        }

        private static IView<IViewModel<TModel>> CreateViewForViewModel(IViewModel<TModel> viewModel)
        {
            if (viewModel == null)
            {
                DependencyResolver.Instance.Get<IDebug>()?.WriteLine("viewModel == null, cannot resolve appropriate view type without type information!");
                return null;
            }

            var obj = DependencyResolver.Instance.GetInterface(typeof(IView<>), viewModel.GetType());
            var view = obj as IView<IViewModel<TModel>>;
            if (view == null)
            {
                DependencyResolver.Instance.Get<IDebug>()?.WriteLine(
                    // ReSharper disable once PossibleNullReferenceException => non-null objects always have type.
                    $"IView<{viewModel.GetType().FullName}> was successfully resolved, but it has no interface of IView<IViewModel<{typeof(TModel).FullName}>>!");
                return null;
            }

            view.SetViewModel(viewModel);
            return view;
        }

        /// <summary>
        /// Clear the view collection.
        /// </summary>
        public override void ClearCollection() => TargetCollection?.Clear();

        /// <summary>
        /// Add a view into the view collection.
        /// </summary>
        /// <param name="item">The item to add to the target collection.</param>
        public override void AddItem(IView<IViewModel<TModel>> item) => TargetCollection?.Add(item?.UIElement);

        /// <summary>
        /// Create a new view for the view model.
        /// </summary>
        /// <param name="viewModel">The view model for which a view should be created.</param>
        /// <returns>The newly created view.</returns>
        public override IView<IViewModel<TModel>> CreateItem(IViewModel<TModel> viewModel) => CreateViewForViewModel(viewModel);

        /// <summary>
        /// Insert a view at the specified location into the view collection.
        /// </summary>
        /// <param name="index">The index where the view will be added into the view collection.</param>
        /// <param name="item">The view that will be added to the view collection.</param>
        public override void InsertItem(int index, IView<IViewModel<TModel>> item) => TargetCollection?.Insert(index, item?.UIElement);

        /// <summary>
        /// Move a view in the view collection from an old position to a new position.
        /// </summary>
        /// <param name="oldIndex">The current index of the view.</param>
        /// <param name="newIndex">The new index of the view.</param>
        public override void MoveItem(int oldIndex, int newIndex)
        {
            var collection = TargetCollection;
            if (collection == null)
            {
                return;
            }

            var uiElement = collection[oldIndex];
            collection.RemoveAt(oldIndex);
            collection.Insert(newIndex, uiElement);
        }

        /// <summary>
        /// Remove a view from the view collection.
        /// </summary>
        /// <param name="index">The current index of the view.</param>
        public override void RemoveItem(int index) => TargetCollection?.RemoveAt(index);

        /// <summary>
        /// Replace a view in the view collection.
        /// </summary>
        /// <param name="index">The index of the current view.</param>
        /// <param name="newItem">The new view.</param>
        public override void ReplaceItem(int index, IView<IViewModel<TModel>> newItem)
        {
            var collection = TargetCollection;
            if (collection == null)
            {
                return;
            }

            collection.RemoveAt(index);
            collection.Insert(index, newItem?.UIElement);
        }
    }
}


text:
package aptgraph.infection;

import aptgraph.batch.BatchProcessor;
import aptgraph.core.Request;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.ParseException;
import junit.framework.TestCase;

/**
 * Test file for ApplyAPT.
 *
 * @author Thomas Gilon
 */
public class ApplyAPTTest extends TestCase {

    /**
     * Test of periodicAPT() method.
     *
     * @throws IOException If files can not be read and written
     */
    public final void testPeriodicAPT() throws IOException {
        System.out.println("Test periodicAPT()");
        File temp_file = File.createTempFile("file", ".log");

        ApplyAPT apt = new ApplyAPT();
        apt.periodicAPT(getClass().getResourceAsStream(
                "/1000_http_requests.txt"),
                new FileOutputStream(temp_file),
                "APT.FINDME.be", "314.15.238.23", "squid", 1000L);

        BufferedReader in_1 = new BufferedReader(
                new InputStreamReader(new FileInputStream(temp_file), "UTF-8"));
        BufferedReader in_2 = new BufferedReader(
                new InputStreamReader(getClass().getResourceAsStream(
                        "/1000_http_requests.txt"), "UTF-8"));

        String line_1;
        Request request_1;
        String line_2;
        Request request_2;
        BatchProcessor batch = new BatchProcessor();
        while ((line_1 = in_1.readLine()) != null
                && (line_2 = in_2.readLine()) != null) {
            request_1 = batch.parseLine(line_1, "squid");
            request_2 = batch.parseLine(line_2, "squid");
            if (request_1.getDomain().equals("APT.FINDME.be")) {
                line_1 = in_1.readLine();
                request_1 = batch.parseLine(line_1, "squid");
            }

            assertEquals(line_1, line_2);
            assertEquals(request_1, request_2);
        }
    }

    /**
     * Test of trafficAPT() method.
     *
     * @throws IOException If files can not be read and written
     * @throws java.text.ParseException If expression can not be parsed
     */
    public final void testTrafficAPT() throws IOException, ParseException {
        System.out.println("Test testTrafficAPT()");
        File temp_file = File.createTempFile("file", ".log");

        ApplyAPT apt = new ApplyAPT();
        apt.trafficAPT(getClass().getResourceAsStream(
                "/1000_http_requests.txt"),
                new FileOutputStream(temp_file),
                "APT.FINDME.be", "314.15.238.23", "squid", 100L, 100L, 5, 1,
                1000, 50L);

        BufferedReader in_1 = new BufferedReader(
                new InputStreamReader(new FileInputStream(temp_file), "UTF-8"));
        BufferedReader in_2 = new BufferedReader(
                new InputStreamReader(getClass().getResourceAsStream(
                        "/1000_http_requests.txt"), "UTF-8"));

        String line_1;
        Request request_1;
        String line_2;
        Request request_2;
        BatchProcessor batch = new BatchProcessor();
        while ((line_1 = in_1.readLine()) != null
                && (line_2 = in_2.readLine()) != null) {
            request_1 = batch.parseLine(line_1, "squid");
            request_2 = batch.parseLine(line_2, "squid");
            if (request_1.getDomain().equals("APT.FINDME.be")) {
                line_1 = in_1.readLine();
                request_1 = batch.parseLine(line_1, "squid");
            }

            assertEquals(line_1, line_2);
            assertEquals(request_1, request_2);
        }
    }

    /**
     * Test generation of the UNIX day timestamp.
     *
     * @throws ParseException If expression can not be parsed
     */
    public final void testGetDay() throws ParseException {
        System.out.println("Test getDay()");

        ApplyAPT apt = new ApplyAPT();
        assertTrue(apt.getDay(1424217600000L) == 1424217600000L);
        assertTrue(apt.getDay(1424246271229L) == 1424217600000L);
    }

    /**
     * Test generation of APT log entry.
     *
     * @throws IOException If file can not be read and written
     */
    public final void testBuildAPT() throws IOException {
        System.out.println("Test buildAPT()");

        ApplyAPT apt = new ApplyAPT();
        Request apt_request = apt.buildAPT(1424246271229L, "APT.FINDME.be",
                "127.0.0.1");
        BatchProcessor batch = new BatchProcessor();

        // Squid format
        File temp_file_squid = File.createTempFile("file_squid", ".log");
        BufferedReader in_squid = new BufferedReader(
                new InputStreamReader(new FileInputStream(temp_file_squid), "UTF-8"));

        String squid_request_string = "1424246271.229    10 127.0.0.1"
                + " TCP_APT/200 10 GET http://APT.FINDME.be - HIER_DIRECT/"
                + "167.167.167.167 text/html";
        Request squid_request = batch.parseLine(squid_request_string, "squid");

        apt.writeRequest(apt_request, new FileOutputStream(temp_file_squid), "squid");
        String apt_string_squid = in_squid.readLine();

        assertEquals(apt_string_squid, squid_request_string); // compare string
        assertEquals(apt_request, squid_request); // compare requests

        // JSON format
        File temp_file_json = File.createTempFile("file_json", ".log");
        BufferedReader in_json = new BufferedReader(
                new InputStreamReader(new FileInputStream(temp_file_json), "UTF-8"));

        String json_request_string = "{\"@version\":\"0\",\"@timestamp\":\"2015-02-18T07:57:51.229Z\",\"type\":\"0\",\"timestamp\":\"0\",\"tk_username\":\"127.0.0.1\",\"tk_url\":\"http://APT.FINDME.be\",\"tk_size\":10,\"tk_date_field\":\"0\",\"tk_protocol\":\"0\",\"tk_mime_content\":\"text/html\",\"tk_client_ip\":\"127.0.0.1\",\"tk_server_ip\":\"167.167.167.167\",\"tk_domain\":\"0\",\"tk_path\":\"0\",\"tk_operation\":\"GET\",\"tk_uid\":\"0\",\"tk_category\":\"0\",\"tk_category_type\":\"0\",\"geoip\":{\"ip\":\"0\",\"country_code2\":\"0\",\"country_code3\":\"0\",\"country_name\":\"0\",\"continent_code\":\"0\",\"latitude\":0,\"longitude\":0,\"timezone\":\"0\",\"location\":[0,0]},\"category\":\"0\"}";
        Request json_request = batch.parseLine(json_request_string, "json");

        apt.writeRequest(apt_request, new FileOutputStream(temp_file_json), "json");
        String apt_string_json = in_json.readLine();

        System.out.println("apt_string_json = " + apt_string_json);
        System.out.println("json_req_string = " + json_request_string);
        assertEquals(apt_string_json, json_request_string); // compare string
        assertEquals(apt_request, json_request); // compare requests
    }
}


text:
package com.java110.api.smo.org;

import com.java110.core.context.IPageData;
import org.springframework.http.ResponseEntity;

/**
 * 添加组织管理接口
 *
 * add by wuxw 2019-06-30
 */
public interface IDeleteOrgSMO {

    /**
     * 添加组织管理
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    ResponseEntity<String> deleteOrg(IPageData pd);
}


text:
package com.intellij.execution.testframework.sm.runner;

import com.intellij.execution.testframework.AbstractTestProxy;
import com.intellij.execution.testframework.TestFrameworkRunningModel;
import com.intellij.execution.testframework.ui.AbstractTestTreeBuilderBase;
import com.intellij.ide.util.treeView.AbstractTreeStructure;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.Disposable;
import com.intellij.ui.tree.StructureTreeModel;
import com.intellij.util.Alarm;

import javax.swing.*;

public class SMTRunnerTreeBuilder implements Disposable, AbstractTestTreeBuilderBase<SMTestProxy> {
  private final JTree myTree;
  private final SMTRunnerTreeStructure myTreeStructure;
  private boolean myDisposed;
  private StructureTreeModel myTreeModel;
  private final Alarm mySelectionAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD, this);

  public SMTRunnerTreeBuilder(final JTree tree, final SMTRunnerTreeStructure structure) {
    myTree = tree;
    myTreeStructure = structure;
  }

  @Override
  public void repaintWithParents(SMTestProxy testProxy) {
    do {
      getTreeModel().invalidate(testProxy, false);
      testProxy = testProxy.getParent();
    }
    while (testProxy != null);
  }

  @Override
  public void dispose() {
    myDisposed = true;
  }

  public boolean isDisposed() {
    return myDisposed;
  }

  public void updateTestsSubtree(final SMTestProxy parentTestProxy) {
    getTreeModel().invalidate(parentTestProxy, true);
  }

  public JTree getTree() {
    return myTree;
  }

  public SMTRunnerTreeStructure getTreeStructure() {
    return myTreeStructure;
  }

  protected StructureTreeModel getTreeModel() {
    return myTreeModel;
  }

  //todo
  protected boolean isSmartExpand() {
    return false;
  }

  @Override
  public void setTestsComparator(TestFrameworkRunningModel model) {
    myTreeModel.setComparator(model.createComparator());
  }

  public void updateFromRoot() {
    myTreeModel.invalidate();
  }

  public void setModel(StructureTreeModel asyncTreeModel) {
    myTreeModel = asyncTreeModel;
  }

  public void expand(AbstractTestProxy test) {
    getTreeModel().expand(test, getTree(), path -> {
    });
  }

  public void select(Object proxy, Runnable onDone) {
    if (!(proxy instanceof AbstractTestProxy)) return;
    mySelectionAlarm.cancelAllRequests();
    mySelectionAlarm.addRequest(() -> getTreeModel().select(proxy, getTree(), path -> {
      if (onDone != null) onDone.run();
    }), 50);
  }

  //todo
  protected boolean isAutoExpandNode(final NodeDescriptor nodeDescriptor) {
    final AbstractTreeStructure treeStructure = getTreeStructure();
    final Object rootElement = treeStructure.getRootElement();
    final Object nodeElement = nodeDescriptor.getElement();

    if (nodeElement == rootElement) {
      return true;
    }

    if (((SMTestProxy)nodeElement).getParent() == rootElement
        && ((SMTestProxy)rootElement).getChildren().size() == 1) {
      return true;
    }
    return false;
  }
}


text:
package org.apache.drill.exec.vector.complex.fn;

import java.io.IOException;
import java.math.BigDecimal;

import org.apache.drill.exec.vector.complex.reader.FieldReader;
import org.joda.time.DateTime;
import org.joda.time.Period;

/**
 * Interface through which UDFs, RecordWriters and other systems can write out a JSON output.
 * Generally used to control how non-json types are mapped to a json output stream.
 */
public interface JsonOutput {

  // basic json tools.
  void flush() throws IOException;
  void writeStartArray() throws IOException;
  void writeEndArray() throws IOException;
  void writeStartObject() throws IOException;
  void writeEndObject() throws IOException;
  void writeUntypedNull() throws IOException;
  void writeFieldName(String name) throws IOException;

  // literals
  void writeDecimal(BigDecimal value) throws IOException;
  void writeTinyInt(byte value) throws IOException;
  void writeSmallInt(short value) throws IOException;
  void writeInt(int value) throws IOException;
  void writeBigInt(long value) throws IOException;
  void writeFloat(float value) throws IOException;
  void writeDouble(double value) throws IOException;
  void writeVarChar(String value) throws IOException;
  void writeVar16Char(String value) throws IOException;
  void writeBinary(byte[] value) throws IOException;
  void writeBoolean(boolean value) throws IOException;
  void writeDate(DateTime value) throws IOException;
  void writeTime(DateTime value) throws IOException;
  void writeTimestamp(DateTime value) throws IOException;
  void writeInterval(Period value) throws IOException;
  void writeDecimalNull() throws IOException;
  void writeTinyIntNull() throws IOException;
  void writeSmallIntNull() throws IOException;
  void writeIntNull() throws IOException;
  void writeBigIntNull() throws IOException;
  void writeFloatNull() throws IOException;
  void writeDoubleNull() throws IOException;
  void writeVarcharNull() throws IOException;
  void writeVar16charNull() throws IOException;
  void writeBinaryNull() throws IOException;
  void writeBooleanNull() throws IOException;
  void writeDateNull() throws IOException;
  void writeTimeNull() throws IOException;
  void writeTimestampNull() throws IOException;
  void writeIntervalNull() throws IOException;

  // scalars reader
  void writeDecimal(FieldReader reader) throws IOException;
  void writeTinyInt(FieldReader reader) throws IOException;
  void writeSmallInt(FieldReader reader) throws IOException;
  void writeInt(FieldReader reader) throws IOException;
  void writeBigInt(FieldReader reader) throws IOException;
  void writeFloat(FieldReader reader) throws IOException;
  void writeDouble(FieldReader reader) throws IOException;
  void writeVarChar(FieldReader reader) throws IOException;
  void writeVar16Char(FieldReader reader) throws IOException;
  void writeBinary(FieldReader reader) throws IOException;
  void writeBoolean(FieldReader reader) throws IOException;
  void writeDate(FieldReader reader) throws IOException;
  void writeTime(FieldReader reader) throws IOException;
  void writeTimestamp(FieldReader reader) throws IOException;
  void writeInterval(FieldReader reader) throws IOException;

  // index positioned scalars
  void writeDecimal(int index, FieldReader reader) throws IOException;
  void writeTinyInt(int index, FieldReader reader) throws IOException;
  void writeSmallInt(int index, FieldReader reader) throws IOException;
  void writeInt(int index, FieldReader reader) throws IOException;
  void writeBigInt(int index, FieldReader reader) throws IOException;
  void writeFloat(int index, FieldReader reader) throws IOException;
  void writeDouble(int index, FieldReader reader) throws IOException;
  void writeVarChar(int index, FieldReader reader) throws IOException;
  void writeVar16Char(int index, FieldReader reader) throws IOException;
  void writeBinary(int index, FieldReader reader) throws IOException;
  void writeBoolean(int index, FieldReader reader) throws IOException;
  void writeDate(int index, FieldReader reader) throws IOException;
  void writeTime(int index, FieldReader reader) throws IOException;
  void writeTimestamp(int index, FieldReader reader) throws IOException;
  void writeInterval(int index, FieldReader reader) throws IOException;
}