text:
require "quilljs/rails/version"

module Quilljs
  module Rails
    class Engine < ::Rails::Engine
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package volume

import (
	"github.com/golang/glog"
	"fmt"
	"strconv"
	"os/exec"
	"k8s.io/client-go/pkg/api/v1"

	"github.com/kubernetes-incubator/external-storage/lib/controller"
)

func (p *flexProvisioner) Delete(volume *v1.PersistentVolume) error {
	glog.Infof("Delete called for volume:" , volume.Name)

	provisioned, err := p.provisioned(volume)
	if err != nil {
		return fmt.Errorf("error determining if this provisioner was the one to provision volume %q: %v", volume.Name, err)
	}
	if !provisioned {
		strerr := fmt.Sprintf("this provisioner id %s didn't provision volume %q and so can't delete it; id %s did & can", p.identity, volume.Name, volume.Annotations[annProvisionerId])
		return &controller.IgnoredError{strerr}
	}

	cmd := exec.Command(p.execCommand, "delete" )
	output, err := cmd.CombinedOutput()
	if err != nil {
		glog.Errorf("Failed to delete volume %s, output: %s, error: %s",  volume, output, err.Error())
		return err
	}
	return nil
}

func (p *flexProvisioner) provisioned(volume *v1.PersistentVolume) (bool, error) {
	provisionerId, ok := volume.Annotations[annProvisionerId]
	if !ok {
		return false, fmt.Errorf("PV doesn't have an annotation %s", annProvisionerId)
	}

	return provisionerId == string(p.identity), nil
}

func getBlockAndId(volume *v1.PersistentVolume, annBlock, annId string) (string, uint16, error) {
	block, ok := volume.Annotations[annBlock]
	if !ok {
		return "", 0, fmt.Errorf("PV doesn't have an annotation with key %s", annBlock)
	}

	idStr, ok := volume.Annotations[annId]
	if !ok {
		return "", 0, fmt.Errorf("PV doesn't have an annotation %s", annId)
	}
	id, _ := strconv.ParseUint(idStr, 10, 16)

	return block, uint16(id), nil
}


text:
(function (factory) {
  /* global define */
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['jquery'], factory);
  } else {
    // Browser globals: jQuery
    factory(window.jQuery);
  }
}(function ($) {
  // template
  var tmpl = $.summernote.renderer.getTemplate();

  /**
   * @class plugin.hello
   *
   * Hello Plugin
   */
  $.summernote.addPlugin({
    /** @property {String} name name of plugin */
    name: 'hello',
    /**
     * @property {Object} buttons
     * @property {Function} buttons.hello   function to make button
     * @property {Function} buttons.helloDropdown   function to make button
     * @property {Function} buttons.helloImage   function to make button
     */
    buttons: { // buttons
      hello: function (lang, options) {

        return tmpl.iconButton(options.iconPrefix + 'header', {
          event : 'hello',
          title: 'hello',
          hide: true
        });
      },
      helloDropdown: function (lang, options) {

        var list = '
summernote
';
        list += '
Code Mirror
';
        var dropdown = '
' + list + '
';

        return tmpl.iconButton(options.iconPrefix + 'header', {
          title: 'hello',
          hide: true,
          dropdown : dropdown
        });
      },
      helloImage : function (lang, options) {
        return tmpl.iconButton(options.iconPrefix + 'file-image-o', {
          event : 'helloImage',
          title: 'helloImage',
          hide: true
        });
      }

    },

    /**
     * @property {Object} events
     * @property {Function} events.hello  run function when button that has a 'hello' event name  fires click
     * @property {Function} events.helloDropdown run function when button that has a 'helloDropdown' event name  fires click
     * @property {Function} events.helloImage run function when button that has a 'helloImage' event name  fires click
     */
    events: { // events
      hello: function (event, editor, layoutInfo) {
        // Get current editable node
        var $editable = layoutInfo.editable();

        // Call insertText with 'hello'
        editor.insertText($editable, 'hello ');
      },
      helloDropdown: function (event, editor, layoutInfo, value) {
        // Get current editable node
        var $editable = layoutInfo.editable();

        // Call insertText with 'hello'
        editor.insertText($editable, 'hello ' + value + '!!!!');
      },
      helloImage : function (event, editor, layoutInfo) {
        var $editable = layoutInfo.editable();

        var img = $('');
        editor.insertNode($editable, img[0]);
      }
    }
  });
}));


text:
REPORTER = dot

test:
	@NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --ignore-leaks --timeout 3000


text:
//--------------------------------------------------------------------------//
// iq / rgba  .  tiny codes  .  2008                                        //
//--------------------------------------------------------------------------//

#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN
#include <windows.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "glext.h"
#include <emmintrin.h>

#include "config.h"
#include "intro.h"
#include "mzk.h"

float frand();
int rand();

#ifndef PI
#define PI 3.1415f
#endif

#define SHADER_DEBUG

inline int ftoi_fast(float f)
{
    return _mm_cvtt_ss2si(_mm_load_ss(&f));     // SSE1 instructions for float->int
}

extern double accumulated_drum_volume;
extern bool has_ended;

// -------------------------------------------------------------------
//                          SHADER CODE:
// -------------------------------------------------------------------

#pragma data_seg(".fragment_main_background")
static const GLchar *fragmentMainBackground=
 "uniform sampler3D t;"
 "varying vec3 o;"
 "varying mat4 p;"
 "void main()"
 "{"
    "vec2 rot_pos = o.xy * vec2(1.6, 0.9);"
    "vec2 rot_pos2 = rot_pos * mat2(p[0][1],-p[0][0],p[0][0],p[0][1]);"
    "vec2 rot_pos3 = rot_pos * mat2(p[0][1],p[0][0],-p[0][0],p[0][1]);"
    "rot_pos3 = rot_pos;"
    "float is_center = smoothstep(p[0][2]+ 0.04, p[0][2], abs(rot_pos2.x)) * 2.0;"
    "float noisy = 0.0;"
    // I have to fade-in topmost stuff somehow...
    "float new_time = p[3][3];"
    "float zoom_out = fract(1.182540764 * new_time);"
    "const float zoom_step = 0.65;"
    "float zoom = 9.0 * pow(1.0 / zoom_step, zoom_out);"
    "for (int overtones = 1; overtones < 16; overtones++) {"
        "float amount = sin((float(overtones) - zoom_out) / 16.0 * 3.1);"
        "noisy += texture3D(t, vec3(zoom * rot_pos3, (float(overtones) - zoom_out) * 0.05)).r * amount;"
        "zoom *= zoom_step;"
    "}"
    //"gl_FragColor = vec4(vec3(1.0, 1.2, 1.5) * (is_center + noisy), 1.0);"
    "vec3 color = mix(vec3(1.0, 1.0, 1.0), vec3(0.47, 0.25, 0.15), smoothstep(2.0, 1.0, is_center + noisy));"
    "color = mix(color, vec3(0.22, 0.20, 0.05), smoothstep(0.8, 0.0, is_center + noisy));"
    "color = mix(color, vec3(0., 0., 0.0), smoothstep(0.6, -0.6, is_center + noisy));"
    "float brightness = 1.0;"
    "gl_FragColor = vec4(color * brightness, 1.0);"
 "}";

#pragma data_seg(".vertex_main_object")
static const GLchar *vertexMainObject=
 "varying vec3 o;"
 "varying mat4 p;"
 "void main()"
 "{"
    "p=gl_ModelViewMatrix,o=vec3(gl_Vertex.xy,.9),gl_Position=vec4(o,1.);"
 "}";

// -------------------------------------------------------------------
//                          Constants:
// -------------------------------------------------------------------

HWND hWnd;

#define MAX_GL_NAME_LENGTH 16
#pragma data_seg(".gl_names")
#ifdef SHADER_DEBUG
#define NUM_GL_NAMES 10
const static char* glnames[NUM_GL_NAMES]={
     "glCreateShader", "glCreateProgram", "glShaderSource", "glCompileShader",
     "glAttachShader", "glLinkProgram", "glUseProgram",
	 "glTexImage3D", "glGetShaderiv","glGetShaderInfoLog",
};
#else
#define NUM_GL_NAMES 8
const static char glnames[NUM_GL_NAMES][MAX_GL_NAME_LENGTH]={
	{"glCreateShader"}, {"glCreateProgram"}, {"glShaderSource"}, {"glCompileShader"},
	{"glAttachShader"}, {"glLinkProgram"}, {"glUseProgram"},
	{"glTexImage3D"}
};
#endif

#define glCreateShader ((PFNGLCREATESHADERPROC)glFP[0])
#define glCreateProgram ((PFNGLCREATEPROGRAMPROC)glFP[1])
#define glShaderSource ((PFNGLSHADERSOURCEPROC)glFP[2])
#define glCompileShader ((PFNGLCOMPILESHADERPROC)glFP[3])
#define glAttachShader ((PFNGLATTACHSHADERPROC)glFP[4])
#define glLinkProgram ((PFNGLLINKPROGRAMPROC)glFP[5])
#define glUseProgram ((PFNGLUSEPROGRAMPROC)glFP[6])
#define glTexImage3D ((PFNGLTEXIMAGE3DPROC)glFP[7])
#define glGetShaderiv ((PFNGLGETSHADERIVPROC)glFP[8])
#define glGetShaderInfoLog ((PFNGLGETSHADERINFOLOGPROC)glFP[9])

// The model matrix is used to send the parameters to the hardware...
static float parameterMatrix[16];

static GLuint offscreenTexture;
// Name of the 32x32x32 noise texture
#define FLOAT_TEXTURE
#define NOISE_TEXTURE_SIZE 32 // try smaller?
static GLuint noiseTexture;
#ifdef FLOAT_TEXTURE
static float noiseData[NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * 4];
#else
static unsigned char noiseData[NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * 4];
#endif
static int noiseTmp[4];

typedef void (*GenFP)(void); // pointer to openGL functions
static GenFP glFP[NUM_GL_NAMES]; // pointer to openGL functions
static GLuint shaderProgram;

// -------------------------------------------------------------------
//                          Code:
// -------------------------------------------------------------------

#ifdef SHADER_DEBUG
static char err[4097];
#endif
#pragma code_seg(".intro_init")
void intro_init( void )
{
	// create openGL functions
	for (int i=0; i<NUM_GL_NAMES; i++) glFP[i] = (GenFP)wglGetProcAddress(glnames[i]);

	// create noise Texture
#ifdef FLOAT_TEXTURE
	for (int i = 0; i < NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * 4; i++)
	{
		noiseData[i] = frand() - 0.5f;
	}
#else
	for (int i = 0; i < NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * NOISE_TEXTURE_SIZE * 4; i++)
	{
		noiseData[i] = (unsigned char)rand();
	}
#endif

	// Create and link shader and stuff:
	// I will have to separate these to be able to use more than one shader...
	// TODO: I should make some sort of compiling and linking loop...

	// init objects:
	GLuint vMainObject = glCreateShader(GL_VERTEX_SHADER);
	GLuint fMainBackground = glCreateShader(GL_FRAGMENT_SHADER);
	shaderProgram = glCreateProgram();
	// compile sources:
	glShaderSource(vMainObject, 1, &vertexMainObject, NULL);
	glCompileShader(vMainObject);
	glShaderSource(fMainBackground, 1, &fragmentMainBackground, NULL);
	//glShaderSource(fMainBackground, 1, &fotzeShader, NULL);
	glCompileShader(fMainBackground);

#ifdef SHADER_DEBUG
	// Check programs
	int tmp, tmp2;
	glGetShaderiv(vMainObject, GL_COMPILE_STATUS, &tmp);
	if (!tmp)
	{
		glGetShaderInfoLog(vMainObject, 4096, &tmp2, err);
		err[tmp2]=0;
		MessageBox(hWnd, err, "vMainObject shader error", MB_OK);
		return;
	}
	glGetShaderiv(fMainBackground, GL_COMPILE_STATUS, &tmp);
	if (!tmp)
	{
		glGetShaderInfoLog(fMainBackground, 4096, &tmp2, err);
		err[tmp2]=0;
		MessageBox(hWnd, err, "fMainBackground shader error", MB_OK);
		return;
	}
#endif

	// link shaders:
	glAttachShader(shaderProgram, vMainObject);
	glAttachShader(shaderProgram, fMainBackground);
	glLinkProgram(shaderProgram);

	// Set texture.
	glEnable(GL_TEXTURE_3D); // automatic?
	glGenTextures(1, &noiseTexture);
	glBindTexture(GL_TEXTURE_3D, noiseTexture);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#if 0
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_REPEAT);
#endif
	//glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE, 0, GL_RGBA,
	//	         GL_UNSIGNED_BYTE, noiseData);
#ifdef FLOAT_TEXTURE
	glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA32F,
				 NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE,
				 0, GL_RGBA, GL_FLOAT, noiseData);
#else
	glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8,
				 NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE, NOISE_TEXTURE_SIZE,
				 0, GL_RGBA, GL_UNSIGNED_BYTE, noiseData);
#endif

	// RLY?
	//glEnable(GL_CULL_FACE);
}

static GLint viewport[4];

#pragma code_seg(".intro_do")
void intro_do( long itime )
{
	float ftime = 0.001f * (float)itime;

	/* Set everything to beginning */
	for (int i = 0; i < 16; i++)
	{
		parameterMatrix[i] = 0.0f;
	}

	glDisable(GL_BLEND);

	// draw background:
	glMatrixMode(GL_MODELVIEW);

    parameterMatrix[0] = (float)sin(accumulated_drum_volume*0.1199235712612);  // Optimized to synchronize with music
    parameterMatrix[1] = (float)cos(accumulated_drum_volume*0.1199235712612);
    parameterMatrix[2] = 0.07f;
	parameterMatrix[15] = ftime; // time
	glLoadMatrixf(parameterMatrix);

	// draw offscreen
	glUseProgram(shaderProgram);
	glBindTexture(GL_TEXTURE_3D, noiseTexture);
	glRectf(-1., -1., 1., 1.);
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: Cangzhou.Wu
 * Date: 15-6-24
 * Time: 下午1:55
 */

namespace star\account\controllers\home;

use star\account\models\MoneyLog;
use star\account\models\Recharge;
use Yii;
use star\account\models\Withdrawal;
use yii\data\ActiveDataProvider;
use yii\filters\AccessControl;
use yii\web\Controller;

class AccountController extends Controller
{
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
        ];
    }
    public $layout = '/member';

    public function actionWithdrawal()
    {
        $model = Yii::createObject(Withdrawal::className());
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['withdrawal-log',]);
        } else {
            return $this->render('createWithdrawal', [
                'model' => $model,
            ]);
        }
    }

    public function actionWithdrawalLog(){
        $model = Yii::createObject(Withdrawal::className());
        $dataProvider = new ActiveDataProvider([
            'query' => $model::find()->where(['user_id' => Yii::$app->user->id])->orderBy(['create_at' => SORT_DESC, 'status' => 0]),
        ]);

        return $this->render('withdrawalLog', [
            'dataProvider' => $dataProvider,
        ]);
    }

    public function actionRecharge(){
        $model = Yii::createObject(Recharge::className());
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['withdrawal-log',]);
        } else {
            return $this->render('createRecharge', [
                'model' => $model,
            ]);
        }
    }

    public function actionMoneyLog(){
        $model = Yii::createObject(MoneyLog::className());
        $dataProvider = new ActiveDataProvider([
            'query' => $model::find()->where(['user_id' => Yii::$app->user->id])->orderBy(['create_at' => SORT_DESC]),
        ]);

        return $this->render('moneyLog', [
            'dataProvider' => $dataProvider,
        ]);
    }
}


text:
<?php

namespace Corpus\Router;

use Corpus\Router\Interfaces\RouterInterface;

/**
 * MultiRouter
 */
class MultiRouter implements RouterInterface {

	/** @var RouterInterface[] */
	protected $routers = [];

	public function __construct( RouterInterface ...$routers ) {
		$this->routers = $routers;
	}

	/**
	 * Add a router to the queue
	 */
	public function addRouter( RouterInterface $router ) : void {
		$this->routers[] = $router;
	}

	/**
	 * @return Interfaces\RouterInterface[]
	 */
	public function getRouters() : array {
		return $this->routers;
	}

	/**
	 * Loops over routers in the order they were added until a match is found.
	 */
	public function match( string $path ) : ?array {
		foreach( $this->routers as $router ) {
			$match = $router->match($path);

			if( $match !== null ) {
				return $match;
			}
		}

		return null;
	}

}


text:
package org.rythmengine.play;

import org.rythmengine.RythmEngine;
import org.rythmengine.exception.CompileException;
import org.rythmengine.exception.ParseException;
import org.rythmengine.exception.RythmException;
import org.rythmengine.extension.ICodeType;
import org.rythmengine.internal.compiler.ClassReloadException;
import org.rythmengine.internal.compiler.TemplateClass;
import org.rythmengine.resource.ITemplateResource;
import org.rythmengine.template.ITemplate;
import org.rythmengine.template.TemplateBase;
import org.rythmengine.utils.TextBuilder;
import play.Logger;
import play.Play;
import play.exceptions.TemplateCompilationException;
import play.exceptions.TemplateExecutionException;
import play.exceptions.UnexpectedException;
import play.i18n.Lang;
import play.mvc.results.Result;
import play.templates.Template;

import java.util.Collections;
import java.util.Locale;
import java.util.Map;

import static play.classloading.enhancers.ControllersEnhancer.ControllerInstrumentation.*;

/**
 * Created by IntelliJ IDEA.
 * User: luog
 * Date: 27/01/12
 * Time: 9:52 AM
 * To change this template use File | Settings | File Templates.
 */
public class RythmTemplate extends Template {

    private TemplateClass tc;
    private ICodeType codeType;
    private String fullName;

    RythmTemplate(ITemplateResource resource) {
        if (null == resource) throw new NullPointerException();
        //tc = new TemplateClass(resource, RythmPlugin.engine, true);
        tc = RythmPlugin.engine.getTemplateClass(resource);
        name = resource.getKey().toString();
        fullName = tc.getTagName();
        source = tc.templateResource.asTemplateContent();
        codeType = resource.codeType(engine());
    }

    private RythmEngine engine() {
        return RythmPlugin.engine;
    }

    static class TemplateInfo extends Template {
        @Override
        public void compile() {
        }
        @Override
        protected String internalRender(Map<String, Object> args) {
            return null;
        }

        TemplateInfo(String name, String source, int lineNo) {
            this.source = source;
            this.lineNo = lineNo;
            this.name = name;
        }

        public int lineNo = -1;
    }

    void refresh() {
        refresh(false);
    }

    void refresh(boolean forceRefresh) {
        if (!forceRefresh && engine().isProdMode()) return;
        try {
            engine().classLoader().detectChange(tc);
        } catch (ClassReloadException e) {
            RythmPlugin.debug("restart rythm engine to reload changed template...");
            engine().restart(e);
            refresh(forceRefresh);
        } catch (RythmException e) {
            handleRythmException(e);
        } catch (RuntimeException e) {
            throw new UnexpectedException(String.format("Unknown error when refreshing rythm template: %s", tc.getKey()), e);
        }
        if (!tc.isValid) {
            RythmTemplateLoader.cache.remove(getName());
        } else {
            source = tc.templateResource.asTemplateContent();
        }
    }

    public boolean isValid() {
        return tc.isValid;
    }

    @Override
    public void compile() {
        RythmEngine engine = this.engine();
        if (RythmPlugin.precompiling()) {
            try {
                refresh();
                tc.asTemplate(engine);
            } catch (Throwable e) {
                RythmPlugin.error(e, "Error precompiling template");
            }
        } else {
            refresh();
            if (isValid()) {
                ITemplate t = tc.asTemplate(engine);
//                TemplateResourceManager mgr = engine.resourceManager();
//                engine.registerTemplate(mgr.getFullTagName(tc), t);
            }
        }

        //if (tc.isValid) tc.compile();
    }

    private static final ThreadLocal<Integer> refreshCounter = new ThreadLocal<Integer>();
    @Override
    protected String internalRender(Map<String, Object> args) {
        boolean isActionCallAllowed = false;
        try {
            isActionCallAllowed = isActionCallAllowed();
        } catch (NullPointerException e) {
            // rendering mail from an non action handler thread
            initActionCall();
            isActionCallAllowed = true;
        }
        try {
            RythmEngine engine = engine();
            engine.prepare(codeType, new Locale(Lang.get()), Collections.EMPTY_MAP);
            //RythmPlugin.engine.renderSettings.init(codeType, new Locale(Lang.get()));
            if (Logger.isTraceEnabled()) RythmPlugin.trace("prepare template to render");
            TemplateBase t = (TemplateBase) tc.asTemplate(engine);
            engine.registerTemplate(fullName, t);
            if (Logger.isTraceEnabled()) RythmPlugin.trace("about to set render args");
            t.__setRenderArgs(args);
            // allow invoke controller method without redirect
            if (!isActionCallAllowed) initActionCall();
            // moved to RythmPlugin.beforeActionInvocation()
//            if (!RythmPlugin.isActionCall()) {
//                TagContext.init();
//            }
            if (Logger.isTraceEnabled()) RythmPlugin.trace("about to execute template");
            String s = t.render();
            if (!engine.isProdMode()) {
                refreshCounter.set(0);
            }
            if (Logger.isTraceEnabled()) RythmPlugin.trace("render completed");
            return s;
        } catch (RythmException e) {
            handleRythmException(e);
            return null; // honestly you will never arrive here
        } catch (Result e) {
            throw e;
        } catch (Exception e) {
            throw new TemplateExecutionException(this, -1, e.getMessage(), e);
        } finally {
            if (!isActionCallAllowed) stopActionCall();
        }
    }

    private static enum _ErrType {parsing, compilation, runtime}
    static void handleRythmException(RythmException e) {
        _ErrType errType = _ErrType.runtime;
        if (e instanceof ParseException)  errType = _ErrType.parsing;
        else if (e instanceof CompileException) errType = _ErrType.compilation;

        if (Play.mode.isDev()) {
            TextBuilder tb = new TextBuilder();
            tb.p("rythm ").p(errType).p(" exception captured on [").p(e.getTemplateName()).p("]: ").pn(e.originalMessage);
            tb.pn(e.templateSourceInfo());
            tb.pn(e.javaSourceInfo());
            Logger.error(tb.toString());
        }
        int line = e.templateLineNumber;
        TemplateInfo t;
        if (-1 == line) {
            line = e.javaLineNumber;
            t = new TemplateInfo(e.getTemplateName(), e.getJavaSource(), line);
        } else {
            t = new TemplateInfo(e.getTemplateName(), e.getTemplateSource(), line);
        }

        switch (errType) {
            case parsing: throw new TemplateParseException(t, t.lineNo, e.originalMessage);
            case compilation: throw new TemplateCompilationException(t, t.lineNo, e.originalMessage);
            default: throw new TemplateExecutionException(t, t.lineNo, e.originalMessage, e);
        }
    }

    @Override
    public String getName() {
        return tc.getKey().toString();
    }
}


text:
using System;
using System.ComponentModel;

namespace Azure.Management.Network.Models
{
    /// <summary> The network protocol this rule applies to. </summary>
    public readonly partial struct EffectiveSecurityRuleProtocol : IEquatable<EffectiveSecurityRuleProtocol>
    {
        private readonly string _value;

        /// <summary> Determines if two <see cref="EffectiveSecurityRuleProtocol"/> values are the same. </summary>
        public EffectiveSecurityRuleProtocol(string value)
        {
            _value = value ?? throw new ArgumentNullException(nameof(value));
        }

        private const string TcpValue = "Tcp";
        private const string UdpValue = "Udp";
        private const string AllValue = "All";

        /// <summary> Tcp. </summary>
        public static EffectiveSecurityRuleProtocol Tcp { get; } = new EffectiveSecurityRuleProtocol(TcpValue);
        /// <summary> Udp. </summary>
        public static EffectiveSecurityRuleProtocol Udp { get; } = new EffectiveSecurityRuleProtocol(UdpValue);
        /// <summary> All. </summary>
        public static EffectiveSecurityRuleProtocol All { get; } = new EffectiveSecurityRuleProtocol(AllValue);
        /// <summary> Determines if two <see cref="EffectiveSecurityRuleProtocol"/> values are the same. </summary>
        public static bool operator ==(EffectiveSecurityRuleProtocol left, EffectiveSecurityRuleProtocol right) => left.Equals(right);
        /// <summary> Determines if two <see cref="EffectiveSecurityRuleProtocol"/> values are not the same. </summary>
        public static bool operator !=(EffectiveSecurityRuleProtocol left, EffectiveSecurityRuleProtocol right) => !left.Equals(right);
        /// <summary> Converts a string to a <see cref="EffectiveSecurityRuleProtocol"/>. </summary>
        public static implicit operator EffectiveSecurityRuleProtocol(string value) => new EffectiveSecurityRuleProtocol(value);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is EffectiveSecurityRuleProtocol other && Equals(other);
        /// <inheritdoc />
        public bool Equals(EffectiveSecurityRuleProtocol other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
        /// <inheritdoc />
        public override string ToString() => _value;
    }
}


text:
package org.onetwo.boot.func.submit;

import org.onetwo.boot.module.redis.RedisOperationService;
import org.onetwo.boot.module.redis.TokenValidator;
import org.onetwo.common.utils.LangUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author weishao zeng
 * <br/>
 */
public class SubmitTokenService implements InitializingBean {

	private TokenValidator tokenValidator;
	@Autowired
	private RedisOperationService redisOperationService;

	@Override
	public void afterPropertiesSet() throws Exception {
		TokenValidator token = new TokenValidator();
		token.setTokenKeyPrefix("submit-token:");
		token.setExpiredInSeconds(3*60);
		token.setRedisOperationService(redisOperationService);
		this.tokenValidator = token;
	}

	public String get() {
		String key = LangUtils.randomUUID();
		this.tokenValidator.save(key, () -> Boolean.TRUE.toString());
		return key;
	}

	public void check(String token) {
		this.tokenValidator.checkOnlyOnce(token, Boolean.TRUE.toString(), () -> true);
	}

}


text:
import math
import time
from datetime import timedelta

from flask import url_for, request

def format_date_time(time):
    return time.strftime("%Y-%m-%d %H:%M:%S")

def format_date_time_millis(date):
    return date.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]

def format_distance(distance, unit=True):
    if distance > 1000:
        return "%0.2f%s" % (distance / 1000.0, " km" if unit else "")
    elif distance < 1000:
        return "%0.3f%s" % (distance / 1000.0, " km" if unit else "")

def format_speed(speed, unit=True):
    return "%0.1f%s" % (speed * 3.6, " km/h" if unit else "")

def format_pace_km(speed, unit=True):
    value = 3600 / (speed * 3.6)
    value = timedelta(seconds=value)

    _, remainder = divmod(value.total_seconds(), 3600)
    minutes, seconds = divmod(remainder, 60)
    return '%02d:%02.0f%s' % (minutes, seconds, " min/km" if unit else "")

def format_altitude(altitude, unit=True):
    return "%d%s" % (altitude, " m" if unit else "")

def format_temparature(temperature, unit=True):
    return "%0.1f%s" % (temperature - 273.15, " °C" if unit else "")

def format_hr(hr, unit=True):
    return "%d%s" % (hr * 60, " bpm" if unit else "")

def format_energyconsumption(energyconsumption, unit=True):
    return "%0.1f%s" % (energyconsumption / 6.978 / 10.0, " kcal/min" if unit else "")

def duration(value):
    if not value:
        return ''
    elif type(value).__name__ in ('str', 'unicode'):
        value = timedelta(seconds=float(value))
    elif isinstance(value, (float, int)):
        value = timedelta(seconds=float(value))

    hours, remainder = divmod(value.total_seconds(), 3600)
    minutes, seconds = divmod(remainder, 60)
    if seconds == 0.0:
        return '%02d:%02d h' % (hours, minutes)
    else:
        return '%02d:%02d:%05.2f' % (hours, minutes, seconds)

def get_city(address):
    attribute_priorities = ('city', 'city_district', 'town', 'village')
    for attr in attribute_priorities:
        if attr in address:
            return address[attr]
    return None

def short_location(location_raw):
    if 'address' in location_raw:
        address = location_raw['address']
        city = get_city(address)

        if city:
            country_code = address['country_code'].upper()
            return "%s, %s" % (city, country_code)
        elif 'country' in address:
            return address['country']

    return None

def swim_pace(value):
    assert isinstance(value, timedelta)
    hours, remainder = divmod(100 * value.total_seconds(), 3600)
    minutes, seconds = divmod(remainder, 60)
    assert hours == 0
    return '%02d:%05.2f min / 100 m' % (minutes, seconds)

def radian_to_degree(value):
    return math.degrees(value)

def degree_to_radian(value):
    if value is None:
        return None
    return math.radians(value)

def celcius_to_kelvin(value):
    if value is None:
        return None
    return value + 273.15

def unix_epoch(date):
    return 1000 * time.mktime(date.timetuple())

# inspired by http://flask.pocoo.org/snippets/44/
def url_for_sortable(sort, sort_order):
    args = request.view_args.copy()
    args.update(request.args)
    args['sort'] = sort
    args['sort_order'] = sort_order
    return url_for(request.endpoint, **args)

def register_globals(app):
    app.jinja_env.globals['url_for_sortable'] = url_for_sortable

def register_filters(app):
    app.jinja_env.filters['date_time'] = format_date_time
    app.jinja_env.filters['date_time_millis'] = format_date_time_millis
    app.jinja_env.filters['duration'] = duration
    app.jinja_env.filters['pace_km'] = format_pace_km
    app.jinja_env.filters['degree'] = radian_to_degree
    app.jinja_env.filters['epoch'] = unix_epoch
    app.jinja_env.filters['swim_pace'] = swim_pace
    app.jinja_env.filters['short_location'] = short_location


text:
var fieldTests = require('./commonFieldTestUtils.js');
var ModelTestConfig = require('../../../modelTestConfig/RelationshipModelTestConfig');
var UserModelTestConfig = require('../../../modelTestConfig/UserModelTestConfig');

module.exports = {
	before: function (browser) {
		fieldTests.before(browser);
		browser.adminUIInitialFormScreen.setDefaultModelTestConfig(ModelTestConfig);
		browser.adminUIItemScreen.setDefaultModelTestConfig(ModelTestConfig);
		browser.adminUIListScreen.setDefaultModelTestConfig(ModelTestConfig);
	},
	after: fieldTests.after,
	'Relationship field should show correctly in the initial modal': function (browser) {
		browser.adminUIApp.openList({ section: 'fields', list: 'Relationship' });

		browser.adminUIListScreen.clickCreateItemButton();
		browser.adminUIApp.waitForInitialFormScreen();

		browser.adminUIInitialFormScreen.assertFieldUIVisible({
			fields: [
				{ name: 'name', },
				{ name: 'fieldA', }
			],
		});

		browser.adminUIInitialFormScreen.cancel();
		browser.adminUIApp.waitForListScreen();
	},
	'Relationship field can be filled via the initial modal': function (browser) {
		browser.adminUIApp.openList({ section: 'fields', list: 'Relationship' });

		browser.adminUIListScreen.clickCreateItemButton();
		browser.adminUIApp.waitForInitialFormScreen();

		browser.adminUIInitialFormScreen.fillFieldInputs({
			fields: [
				{ name: 'name', input: { value: 'Relationship Field Test 1' }, },
				{ name: 'fieldA', input: { option: 'option1' }, },
			],
		});
		browser.adminUIInitialFormScreen.assertFieldInputs({
			fields: [
				{ name: 'name', input: { value: 'Relationship Field Test 1' }, },
				{ name: 'fieldA', input: { value: 'e2e member' }, },
			],
		});

		browser.adminUIInitialFormScreen.save();
		browser.adminUIApp.waitForItemScreen();
	},
	'Relationship field should show correctly in the edit form': function (browser) {
		browser.adminUIItemScreen.assertFieldUIVisible({
			fields: [
				{ name: 'fieldB', }
			],
		});

		browser.adminUIItemScreen.assertFieldInputs({
			fields: [
				{ name: 'name', input: { value: 'Relationship Field Test 1' }, },
				{ name: 'fieldA', input: { value: 'e2e member' }, },
			],
		})
	},
	'Relationship field can be filled via the edit form': function (browser) {
		browser.adminUIItemScreen.fillFieldInputs({
			fields: [
				{ name: 'fieldB', input: { option: 'option2' }, },
			],
		});

		browser.adminUIItemScreen.save();
		browser.adminUIApp.waitForItemScreen();

		browser.adminUIItemScreen.assertElementTextEquals({ element: '@flashMessage', text: 'Your changes have been saved successfully' });

		browser.adminUIItemScreen.assertFieldInputs({
			fields: [
				{ name: 'name', input: { value: 'Relationship Field Test 1' }, },
				{ name: 'fieldA', input: { value: 'e2e member' }, },
				{ name: 'fieldB', input: { value: 'e2e user' }, },
			],
		})
	},
	'Clicking on the relationship navigates to the relavent item': function (browser) {
		browser.adminUIApp.openList({ section: 'fields', list: 'Relationship' });
		browser.adminUIApp.waitForListScreen();
		browser.adminUIListScreen.clickItemFieldValue({
			fields: [
				{ name: 'fieldA', row: 1, column: 3 }
			],
		});
		browser.adminUIApp.waitForItemScreen();
		browser.adminUIItemScreen.assertFieldUIVisible({
			fields: [
				{ name: 'name', modelTestConfig: UserModelTestConfig }
			],
		});
	}
};


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28192_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans607.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">"mm- m LEWIS FEDERAI. 5300 31-31 8! Section 31 usau meow mm Cum, uonh Dinah
Gaewmnfllhndmu Gasuhcmdatwmyvhm


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
  <document>
    <sentences>
      <sentence id="1">
        <tokens>
          <token id="1">
            <word>2002</word>
            <lemma>2002</lemma>
            <CharacterOffsetBegin>0</CharacterOffsetBegin>
            <CharacterOffsetEnd>4</CharacterOffsetEnd>
            <POS>CD</POS>
          </token>
          <token id="2">
            <word>Steeda</word>
            <lemma>Steeda</lemma>
            <CharacterOffsetBegin>5</CharacterOffsetBegin>
            <CharacterOffsetEnd>11</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="3">
            <word>Mustang</word>
            <lemma>Mustang</lemma>
            <CharacterOffsetBegin>12</CharacterOffsetBegin>
            <CharacterOffsetEnd>19</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="4">
            <word>GT</word>
            <lemma>gt</lemma>
            <CharacterOffsetBegin>20</CharacterOffsetBegin>
            <CharacterOffsetEnd>22</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="5">
            <word>Mustang</word>
            <lemma>Mustang</lemma>
            <CharacterOffsetBegin>23</CharacterOffsetBegin>
            <CharacterOffsetEnd>30</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="6">
            <word>GT</word>
            <lemma>gt</lemma>
            <CharacterOffsetBegin>31</CharacterOffsetBegin>
            <CharacterOffsetEnd>33</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
        </tokens>
        <parse>(ROOT (NP (NP (CD 2002) (NNP Steeda) (NNP Mustang) (NN GT)) (NP (NNP Mustang)) (NP (NN GT)))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="4">GT</dependent>
          </dep>
          <dep type="num">
            <governor idx="4">GT</governor>
            <dependent idx="1">2002</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">GT</governor>
            <dependent idx="2">Steeda</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">GT</governor>
            <dependent idx="3">Mustang</dependent>
          </dep>
          <dep type="appos">
            <governor idx="4">GT</governor>
            <dependent idx="5">Mustang</dependent>
          </dep>
          <dep type="dep">
            <governor idx="4">GT</governor>
            <dependent idx="6">GT</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="4">GT</dependent>
          </dep>
          <dep type="num">
            <governor idx="4">GT</governor>
            <dependent idx="1">2002</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">GT</governor>
            <dependent idx="2">Steeda</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">GT</governor>
            <dependent idx="3">Mustang</dependent>
          </dep>
          <dep type="appos">
            <governor idx="4">GT</governor>
            <dependent idx="5">Mustang</dependent>
          </dep>
          <dep type="dep">
            <governor idx="4">GT</governor>
            <dependent idx="6">GT</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="4">GT</dependent>
          </dep>
          <dep type="num">
            <governor idx="4">GT</governor>
            <dependent idx="1">2002</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">GT</governor>
            <dependent idx="2">Steeda</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">GT</governor>
            <dependent idx="3">Mustang</dependent>
          </dep>
          <dep type="appos">
            <governor idx="4">GT</governor>
            <dependent idx="5">Mustang</dependent>
          </dep>
          <dep type="dep">
            <governor idx="4">GT</governor>
            <dependent idx="6">GT</dependent>
          </dep>
        </dependencies>
      </sentence>
    </sentences>
  </document>
</root>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#dcf8c6">

    <ListView
        android:layout_marginTop="25dp"
        android:layout_marginBottom="25dp"
        android:layout_marginRight="5dp"
        android:layout_marginLeft="5dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/lvLog">

    </ListView>
</LinearLayout>


text:
package org.terpo.tmods.item;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.terpo.tmods.init.ModBlocks;
import org.terpo.tmods.reference.Names;
import org.terpo.tmods.reference.Reference;
import org.terpo.tmods.util.LogHelper;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ItemDoorGlassStained extends ItemTModsDoors
{
	private IIcon[] dooricon;
	public ItemDoorGlassStained()
	{
		super();
		this.maxStackSize = 16;
		setUnlocalizedName(Names.Items.DOORGLASSSTAINEDITEM);
		this.blockDoor = ModBlocks.doorGlassStainedWhite;
		this.setHasSubtypes(true);
	}

	@Override
	public int getMetadata(int damageValue)
	{
		return damageValue;
	}

	@Override
	public String getUnlocalizedName(ItemStack itemStack)
	{
		String name = "";

		switch (itemStack.getItemDamage())
		{
			case 0:
			{
				name = Names.Colors.COLORS[0];
				break;
			}
			case 1:
			{
				name = Names.Colors.COLORS[1];
				break;
			}
			case 2:
			{
				name = Names.Colors.COLORS[2];
				break;
			}
			case 3:
			{
				name = Names.Colors.COLORS[3];
				break;
			}
			case 4:
			{
				name = Names.Colors.COLORS[4];
				break;
			}
			case 5:
			{
				name = Names.Colors.COLORS[5];
				break;
			}
			case 6:
			{
				name = Names.Colors.COLORS[6];
				break;
			}
			case 7:
			{
				name = Names.Colors.COLORS[7];
				break;
			}
			case 8:
			{
				name = Names.Colors.COLORS[8];
				break;
			}
			case 9:
			{
				name = Names.Colors.COLORS[9];
				break;
			}
			case 10:
			{
				name = Names.Colors.COLORS[10];
				break;
			}
			case 11:
			{
				name = Names.Colors.COLORS[11];
				break;
			}
			case 12:
			{
				name = Names.Colors.COLORS[12];
				break;
			}
			case 13:
			{
				name = Names.Colors.COLORS[13];
				break;
			}
			case 14:
			{
				name = Names.Colors.COLORS[14];
				break;
			}
			case 15:
			{
				name = Names.Colors.COLORS[15];
				break;
			}
			default:
				name = Names.Colors.COLORS[0];
		}
		//LogHelper.info(super.getUnlocalizedName());
		//LogHelper.info(getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
		//LogHelper.info(String.format("item.%s%s", Reference.MOD_ID.toLowerCase() + ":",
		//		getUnwrappedUnlocalizedName(super.getUnlocalizedName())));
		return super.getUnlocalizedName()+"_"+name;
	}

	@Override
	public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float clickx, float clicky, float clickz)
    {

        if (side != 1)
        {
            return false;
        }
        else
        {
            ++y;

            switch(itemStack.getItemDamage())
            {
            	case 0 : this.blockDoor = ModBlocks.doorGlassStainedWhite; break;
            	case 1 : this.blockDoor = ModBlocks.doorGlassStainedOrange; break;
            	case 2 : this.blockDoor = ModBlocks.doorGlassStainedMagenta; break;
            	case 3 : this.blockDoor = ModBlocks.doorGlassStainedLightBlue; break;
            	case 4 : this.blockDoor = ModBlocks.doorGlassStainedYellow; break;
            	case 5 : this.blockDoor = ModBlocks.doorGlassStainedLightGreen; break;
            	case 6 : this.blockDoor = ModBlocks.doorGlassStainedPink; break;
            	case 7 : this.blockDoor = ModBlocks.doorGlassStainedDarkGray; break;
            	case 8 : this.blockDoor = ModBlocks.doorGlassStainedLightGray; break;
            	case 9 : this.blockDoor = ModBlocks.doorGlassStainedCyan; break;
            	case 10 : this.blockDoor = ModBlocks.doorGlassStainedPurple; break;
            	case 11 : this.blockDoor = ModBlocks.doorGlassStainedBlue; break;
            	case 12 : this.blockDoor = ModBlocks.doorGlassStainedBrown; break;
            	case 13 : this.blockDoor = ModBlocks.doorGlassStainedGreen; break;
            	case 14 : this.blockDoor = ModBlocks.doorGlassStainedRed; break;
            	case 15 : this.blockDoor = ModBlocks.doorGlassStainedBlack; break;
            	default : this.blockDoor = Blocks.wooden_door; break;
            }
            if (player.canPlayerEdit(x, y, z, side, itemStack) && player.canPlayerEdit(x, y + 1, z, side, itemStack))
            {
                if (!blockDoor.canPlaceBlockAt(world, x, y, z))
                {
                    return false;
                }
                else
                {
                    int i1 = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
                    placeDoorBlock(world, x, y, z, i1, blockDoor);
                    --itemStack.stackSize;
                    return true;
                }
            }
            else
            {
                return false;
            }
        }
    }

	@Override
	@SideOnly(Side.CLIENT)
	public void registerIcons(IIconRegister iconRegister)
	{
		this.dooricon = new IIcon[16];
		for(int i = 0; i<this.dooricon.length;i++)
			dooricon[i] = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1)+"_"+Names.Colors.COLORS[i]);
	}

    @SideOnly(Side.CLIENT)
    public IIcon getIcon(int side, int meta)
    {
        return this.dooricon[meta];
    }

    @SideOnly(Side.CLIENT)
    public IIcon getIconFromDamage(int meta)
    {
        return this.dooricon[meta];
    }

	@Override
	public void getSubItems (Item id, CreativeTabs tab, List list)
	{
		for (int i = 0; i < Names.Colors.COLORS.length; i++)
			list.add(new ItemStack(id, 1, i));
	}
}


text:
int main(void)
{
    size_t failedTestCount = 0;
    RUN_TEST_SUITE(HMACSHA256_UnitTests, failedTestCount);
    return failedTestCount;
}


text:
package ru.stqa.pft.mantis.tests;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import ru.stqa.pft.mantis.model.UserData;

import java.util.List;

/**
 * Created by user on 01.10.17.
 */
public class DBTest {
    private SessionFactory sessionFactory;

    @BeforeTest
    protected void setUp() throws Exception {
        final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
                .configure() // configures settings from hibernate.cfg.xml
                .build();
        try {
            sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();
        }
        catch (Exception e) {
            e.printStackTrace();
            StandardServiceRegistryBuilder.destroy( registry );
        }
    }
    @Test
    public void testHbConnectionGroups(){
        Session session = sessionFactory.openSession();
        session.beginTransaction();
        List<UserData> result = session.createQuery( "from UserData where id != 1" ).list();
        for ( UserData user : result) {
            System.out.println(user);
        }
        session.getTransaction().commit();
        session.close();
    }
}