text:
require("firecast.lua");
local __o_rrpgObjs = require("rrpgObjs.lua");
require("rrpgGUI.lua");
require("rrpgDialogs.lua");
require("rrpgLFM.lua");
require("ndb.lua");
require("locale.lua");
local __o_Utils = require("utils.lua");

local function constructNew_frmQuality()
    local obj = GUI.fromHandle(_obj_newObject("form"));
    local self = obj;
    local sheet = nil;

    rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject"));

    function obj:setNodeObject(nodeObject)
        sheet = nodeObject;
        self.sheet = nodeObject;
        self:_oldSetNodeObjectFunction(nodeObject);
    end;

    function obj:setNodeDatabase(nodeObject)
        self:setNodeObject(nodeObject);
    end;

    _gui_assignInitialParentForForm(obj.handle);
    obj:beginUpdate();
    obj:setName("frmQuality");
    obj:setWidth(375);
    obj:setHeight(25);
    obj:setMargins({top=1});

    obj.rectangle1 = GUI.fromHandle(_obj_newObject("rectangle"));
    obj.rectangle1:setParent(obj);
    obj.rectangle1:setAlign("client");
    obj.rectangle1:setColor("#212121");
    obj.rectangle1:setName("rectangle1");

    obj.edit1 = GUI.fromHandle(_obj_newObject("edit"));
    obj.edit1:setParent(obj.rectangle1);
    obj.edit1:setLeft(0);
    obj.edit1:setTop(0);
    obj.edit1:setWidth(150);
    obj.edit1:setHeight(25);
    obj.edit1:setField("quality_name");
    obj.edit1:setName("edit1");

    obj.edit2 = GUI.fromHandle(_obj_newObject("edit"));
    obj.edit2:setParent(obj.rectangle1);
    obj.edit2:setLeft(150);
    obj.edit2:setTop(0);
    obj.edit2:setWidth(150);
    obj.edit2:setHeight(25);
    obj.edit2:setField("quality_notes");
    obj.edit2:setName("edit2");

    obj.edit3 = GUI.fromHandle(_obj_newObject("edit"));
    obj.edit3:setParent(obj.rectangle1);
    obj.edit3:setLeft(300);
    obj.edit3:setTop(0);
    obj.edit3:setWidth(50);
    obj.edit3:setHeight(25);
    obj.edit3:setField("quality_karma");
    obj.edit3:setHorzTextAlign("center");
    obj.edit3:setType("number");
    obj.edit3:setName("edit3");

    obj.button1 = GUI.fromHandle(_obj_newObject("button"));
    obj.button1:setParent(obj.rectangle1);
    obj.button1:setLeft(350);
    obj.button1:setTop(0);
    obj.button1:setWidth(25);
    obj.button1:setHeight(25);
    obj.button1:setText("X");
    obj.button1:setName("button1");

    obj.dataLink1 = GUI.fromHandle(_obj_newObject("dataLink"));
    obj.dataLink1:setParent(obj.rectangle1);
    obj.dataLink1:setField("quality_karma");
    obj.dataLink1:setName("dataLink1");

    obj._e_event0 = obj.button1:addEventListener("onClick",
        function (_)
            Dialogs.confirmOkCancel("Tem certeza que quer apagar esse objeto?",
            					function (confirmado)
            						if confirmado then
            							NDB.deleteNode(sheet);
            						end;
            				end);
        end, obj);

    obj._e_event1 = obj.dataLink1:addEventListener("onChange",
        function (_, field, oldValue, newValue)
            if sheet==nil then return end;

            				local node = NDB.getRoot(sheet);
            				local objetos = NDB.getChildNodes(node.positiveQualityList);
            				local karma = 0;

            				for i=1, #objetos, 1 do
            					karma = karma + (tonumber(objetos[i].quality_karma) or 0);
            				end;

            				local objetos = NDB.getChildNodes(node.negativeQualityList);

            				for i=1, #objetos, 1 do
            					karma = karma + (tonumber(objetos[i].quality_karma) or 0);
            				end;

            				node.qualities_karma = karma;
        end, obj);

    function obj:_releaseEvents()
        __o_rrpgObjs.removeEventListenerById(self._e_event1);
        __o_rrpgObjs.removeEventListenerById(self._e_event0);
    end;

    obj._oldLFMDestroy = obj.destroy;

    function obj:destroy()
        self:_releaseEvents();

        if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then
          self:setNodeDatabase(nil);
        end;

        if self.edit3 ~= nil then self.edit3:destroy(); self.edit3 = nil; end;
        if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end;
        if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end;
        if self.edit2 ~= nil then self.edit2:destroy(); self.edit2 = nil; end;
        if self.button1 ~= nil then self.button1:destroy(); self.button1 = nil; end;
        if self.dataLink1 ~= nil then self.dataLink1:destroy(); self.dataLink1 = nil; end;
        self:_oldLFMDestroy();
    end;

    obj:endUpdate();

    return obj;
end;

function newfrmQuality()
    local retObj = nil;
    __o_rrpgObjs.beginObjectsLoading();

    __o_Utils.tryFinally(
      function()
        retObj = constructNew_frmQuality();
      end,
      function()
        __o_rrpgObjs.endObjectsLoading();
      end);

    assert(retObj ~= nil);
    return retObj;
end;

local _frmQuality = {
    newEditor = newfrmQuality,
    new = newfrmQuality,
    name = "frmQuality",
    dataType = "",
    formType = "undefined",
    formComponentName = "form",
    title = "",
    description=""};

frmQuality = _frmQuality;
Firecast.registrarForm(_frmQuality);

return _frmQuality;


text:
"use strict";

var expand = require("./expand.js");
var assert = require("assert");
var fs = require("fs");
var globy = require("globy");
var pathModule = require("path");

var globOptionDot = { dot: true };

exports.glob = function glob(env, pattern, cwd) {
    var patterns = [];
    cwd = cwd ? expand.expand(env, cwd) : "";

    if(typeof pattern === "string") {
        patterns.push(expand.expand(env, pattern));
    } else {
        for(var i = 0; i < pattern.length; i++) {
            patterns.push(expand.expand(env, pattern[i]));
        }
    }

    var paths = [];
    for(i = 0; i < patterns.length; i++) {
        var ptn = patterns[i];
        if(/[[{?*]/.test(ptn)) {
            var matched = globy.glob(ptn, { dot: true, cwd: cwd });
            for(var m = 0; m < matched.length; m++) {
                paths.push(matched[m]);
            }
        } else if(fs.existsSync(ptn)) {
            paths.push(ptn);
        }
    }
    return paths;
};

exports.listdir = function listdir(env, pattern) {
    if(! pattern) {
        return fs.readdirSync("./");
    }

    var files = [];
    var subfiles = [];

    exports.glob(env, pattern).forEach(function(file) {
        if(fs.statSync(file).isDirectory()) {
            var sub = globy.glob(file + "/*", globOptionDot);
            subfiles.push.apply(subfiles, sub);
        } else {
            files.push(file);
        }
    });

    if(files.length === 0 && subfiles.length === 0) {
        throw new Error("ShellUtil.listdir: '" + pattern + "' no such file or directory");
    }
    return files.concat(subfiles);

};

exports.which = function(env, file) {
    file = expand.expand(env, file);
    var pathdirs = env.PATH.split(pathModule.delimiter);

    for(var i = 0; i < pathdirs.length; i++) {
        var path = pathModule.join(pathdirs[i], file);
        try {
            if(fs.statSync(path).mode & 64) {
                return path;
            }
        } catch(_) { }
    }
    return null;
};

exports.mkdir = function(dirname) {
    try {
        if(fs.statSync(dirname).isDirectory()) {
            return;
        }
    } catch(err) {
        if(err.code !== "ENOENT") {
            throw err;
        }
        exports.mkdir(pathModule.dirname(dirname));
        fs.mkdirSync(dirname);
        return;
    }
    var err = new Error("EEXIST, file already exists \"" + dirname + "\"");
    err.code = "EEXIST";
    throw err;
};

exports.move = function(env, src, dest) {
    dest = expand.expand(env, dest);
    var files = exports.glob(env, src);

    switch(files.length) {
        case 0: throw new Error("ShellUtil.move: '" + src + "' no such file or directory");
        case 1: moveFile(files[0], dest); break;
        default: moveFilesToDir(files, dest);
    }
};

function moveFile(src, dest) {
    try {
        if(fs.statSync(dest).isDirectory()) {
            // move into directory
            var basename = pathModule.basename(src);
            var newpath = pathModule.join(dest, basename);
            fs.renameSync(src, newpath);
            return;
        }
    } catch(err) {
        if(err.code !== "ENOENT") { throw err; }
    }
    fs.renameSync(src, dest);
}

function moveFilesToDir(paths, dir) {
    try {
        var stat = fs.statSync(dir);
    } catch(e) {}

    if(stat === undefined || stat.isDirectory() === false) {
        throw new Error("'" + dir + "'" + " is not a directory");
    }

    paths.forEach(function(src) {
        var filename = pathModule.basename(src);
        var dest = pathModule.join(dir, filename);
        fs.renameSync(src, dest);
    });
}

exports.copy = function(env, pattern, dest) {
    dest = expand.expand(env, dest);
    var files = exports.glob(env, pattern);
    if(files.length === 0) {
        throw new Error("ShellUtil.copy: '" + pattern + "' no such file or directory");
    }

    try {
        var stat = fs.statSync(dest);
    } catch(err) {
        if(err.code !== "ENOENT") { throw err; }
    }

    var destIsDir = !!stat && stat.isDirectory();
    if(1 < files.length && destIsDir === false) {
        throw new Error("ShellUtil.copy: '" + dest + "' is not a directory");
    }

    files.forEach(function(src) {
        var dst = dest;
        if(destIsDir) {
            var basename = pathModule.basename(src);
            dst = pathModule.join(dest, basename);
        }
        copyAny(src, dst);
    });
};

function copyAny(src, dest) {
    var stat = fs.lstatSync(src);
    switch(true) {
        case stat.isFile(): copyFile(src, dest); break;
        case stat.isDirectory(): copyDirectory(src, dest); break;
        case stat.isSymbolicLink(): copyLink(src, dest); break;
        // ignore other types
    }
}

function copyFile(src, dest) {
    var srcfd = fs.openSync(src, "r");
    var destfd = fs.openSync(dest, "w");
    var bufsize = 8192;
    var buffer = new Buffer(bufsize);

    try {
        while(true) {
            var readSize = fs.readSync(srcfd, buffer, 0, bufsize);
            if(readSize === 0) {
                break;
            }
            fs.writeSync(destfd, buffer, 0, readSize);
        }
    } finally {
        fs.closeSync(srcfd);
        fs.closeSync(destfd);
    }
}

function copyDirectory(srcDir, destDir) {
    try {
        fs.mkdirSync(destDir);
    } catch(err) {
        if(err.code !== "EEXIST") { throw err; }
    }

    var files = fs.readdirSync(srcDir);
    if(srcDir.charAt(srcDir.length - 1) !== pathModule.sep) {
        srcDir += pathModule.sep;
    }

    for(var i = 0; i < files.length; i++) {
        var srcPath = srcDir + files[i];
        var destPath = destDir + pathModule.sep + files[i];
        copyAny(srcPath, destPath);
    }
}

function copyLink(src, dest) {
    var link = fs.readlinkSync(src);
    try {
        fs.symlinkSync(link, dest);
    } catch(err) {
        if(err.code !== "EEXIST") { throw err; }
        fs.unlinkSync(dest);
        fs.symlinkSync(link, dest);
    }
}

exports.remove = function(files, removeDir) {
    files.forEach(function(file) {
        if(removeDir) {
            removeTree(file);
        } else {
            if(fs.lstatSync(file).isDirectory() === false) {
                fs.unlinkSync(file);
            }
        }
    });
};

function removeTree(path) {
    if(fs.lstatSync(path).isDirectory()) {
        var files = globy.glob(path + "/*", globOptionDot);
        files.forEach(removeTree);
        fs.rmdirSync(path);
    } else {
        fs.unlinkSync(path);
    }
}

exports.modified = function (env, pattern, dest) {
    var files = exports.glob(env, pattern);
    if(files.length === 0) {
        throw new Error("ShellUtil.modified: '" + pattern + "' no such file or directory");
    }
    dest = expand.expand(env, dest);

    try {
        var destTime = fs.statSync(dest).mtime.getTime();
    } catch(e) {
        return true;
    }

    var latestSrcTime = files.map(function(file) {
        return fs.statSync(file).mtime.getTime();
    }).sort(function(a, b) { return b - a })[0];

    return destTime < latestSrcTime;
};

exports.prependFile = function(file, data) {
    if(Buffer.isBuffer(data) === false) {
        data = new Buffer(data);
    }

    var originalData = fs.readFileSync(file);
    var fd = fs.openSync(file, "w");
    fs.writeSync(fd, data, 0, data.length);
    fs.writeSync(fd, originalData, 0, originalData.length);
    fs.closeSync(fd);
};

exports.replace = function(env, pattern, regex, str) {
    assert(regex instanceof RegExp, "ShellUtil.replace: arguments[1] must be a RegExp");
    assert(regex.global, "ShellUtil.replace: RegExp needs global flag (for example: /foo/g )");

    var files = exports.glob(env, pattern);
    if(files.length === 0) {
        throw new Error("ShellUtil.replace: '" + pattern + "' no such file or directory");
    }

    files.forEach(function(file) {
        var content = fs.readFileSync(file).toString();
        var newContent = content.replace(regex, str);
        if(content !== newContent) {
            fs.writeFileSync(file, newContent);
        }
    });
};

exports.concat = function (env, pattern, sep, encoding) {
    if(sep === undefined) {
        sep = new Buffer(0);
    } else if(Buffer.isBuffer(sep) === false) {
        sep = new Buffer(sep);
    }

    var files = exports.glob(env, pattern);
    var buffers = [];
    files.forEach(function(file) {
        buffers.push(fs.readFileSync(file));
        buffers.push(sep);
    });
    buffers.pop(); // remove trailing separator

    var result = Buffer.concat(buffers);
    if(encoding) {
        return result.toString(encoding);
    }
    return result;
};

exports.tempfile = function(env, data) {
    var filename = "temp" + Date.now() + "_" + Math.random().toString().slice(2);
    var path = pathModule.join(env.TMPDIR, filename);
    fs.writeFileSync(path, data || "");
    return path;
};

redpajama_set_name: RedPajamaGithub


text:
<?php

abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
{
    /**
     * The base URL to use while testing the application.
     *
     * @var string
     */
    protected $baseUrl = 'http://localhost';

    public $userMock;

    public function setUp() {
        parent::setUp();
        $this->userMock = Mockery::mock('Illuminate\Database\Eloquent\Model', 'App\User')->makePartial();
    }

    /**
     * Creates the application.
     *
     * @return \Illuminate\Foundation\Application
     */
    public function createApplication()
    {
        $app = require __DIR__.'/../bootstrap/app.php';

        $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();

        return $app;
    }
}


text:
package java.lang;

/**
 * An AbstractMethodError is thrown when an application attempts to
 * access an abstract method. Compilers typically detect this error, but it can
 * be thrown at run time if the definition of a class has changed since the
 * application was last compiled. This can also occur when reflecting on
 * methods.
 *
 * @author Brian Jones
 * @author Tom Tromey (tromey@cygnus.com)
 * @status updated to 1.4
 */
public class AbstractMethodError extends IncompatibleClassChangeError {
	/**
	 * Compatible with JDK 1.0+.
	 */
	private static final long serialVersionUID = -1654391082989018462L;

	/**
	 * Create an error without a message.
	 */
	public AbstractMethodError() {
	}

	/**
	 * Create an error with a message.
	 *
	 * @param s
	 *            the message
	 */
	public AbstractMethodError(String s) {
		super(s);
	}
}


text:
"""Tests for train_proxy."""

from absl.testing import absltest
from flax import linen as nn
import jax
import numpy as np
from sklearn import linear_model

from proxy_rewards import train_proxy

class TrainProxyTest(absltest.TestCase):

  def setUp(self):
    super(TrainProxyTest, self).setUp()
    np.random.seed(0)
    self.data_x = np.array(
        np.random.binomial(1, 0.5, size=(1000, 2)), dtype=float)
    self.data_y = np.random.binomial(
        1, p=nn.sigmoid(self.data_x[:, 0] - self.data_x[:, 1]))
    self.data_a = np.random.choice(3, size=self.data_y.shape)
    self.data_t = np.random.choice(3, size=self.data_a.shape)

    self.data = {
        'a': self.data_a,
        'm': self.data_x,
        'y': self.data_y,
        't': self.data_t,
    }

  def test_match_sklearn(self):
    clf_sklearn = linear_model.LogisticRegression(penalty='none')
    clf_sklearn.fit(self.data_x, self.data_y)

    self.assertAlmostEqual(clf_sklearn.intercept_[0], -0.0271, places=3)
    self.assertAlmostEqual(clf_sklearn.coef_[0][0], 1.0987, places=3)
    self.assertAlmostEqual(clf_sklearn.coef_[0][1], -1.0216, places=3)

    model = train_proxy.LogisticReg()

    erm_loss = train_proxy.make_loss_func(
        model, self.data, erm_weight=1., bias_lamb=0.)

    init_params = train_proxy.initialize_params(
        model, mdim=self.data_x.shape[1], seed=0)

    erm_params, _ = train_proxy.train(erm_loss, init_params, lr=1., nsteps=1000)

    b, w = jax.tree_leaves(erm_params)
    self.assertAlmostEqual(w[0].item(), 1.0988, places=3)
    self.assertAlmostEqual(w[1].item(), -1.0216, places=3)
    self.assertAlmostEqual(b.item(), -0.0274, places=3)

  def test_l2_regularization(self):
    model = train_proxy.LogisticReg()

    erm_loss_reg = train_proxy.make_loss_func(
        model, self.data, erm_weight=1., l2_lamb=10., bias_lamb=0.)

    init_params = train_proxy.initialize_params(
        model, mdim=self.data_x.shape[1], seed=0)

    erm_params_reg, _ = train_proxy.train(
        erm_loss_reg, init_params, lr=1., nsteps=1000)

    b, w = jax.tree_leaves(erm_params_reg)
    self.assertAlmostEqual(w[0].item(), 0.0030, places=3)
    self.assertAlmostEqual(w[1].item(), -0.0028, places=3)
    self.assertAlmostEqual(b.item(), 0.0158, places=3)

  def test_policy_bias_regularization(self):
    model = train_proxy.LogisticReg()

    mix_loss = train_proxy.make_loss_func(
        model, self.data, erm_weight=1., bias_lamb=10.)

    init_params = train_proxy.initialize_params(
        model, mdim=self.data_x.shape[1], seed=0)

    mix_params, _ = train_proxy.train(
        mix_loss, init_params, lr=1., nsteps=1000)

    b, w = jax.tree_leaves(mix_params)
    self.assertAlmostEqual(w[0].item(), 1.4478, places=3)
    self.assertAlmostEqual(w[1].item(), -1.2915, places=3)
    self.assertAlmostEqual(b.item(), 0.1693, places=3)

if __name__ == '__main__':
  absltest.main()


text:
using Sif.Framework.Model.Persistence;
using System.Xml.Serialization;

namespace Sif.Framework.Demo.Au.Consumer.Models
{

    /// <summary>
    ///
    /// </summary>
    public partial class Name : IPersistable<long>
    {

        /// <summary>
        ///
        /// </summary>
        [XmlIgnoreAttribute]
        public virtual long Id { get; set; }

        /// <summary>
        ///
        /// </summary>
        public virtual string FamilyName { get; set; }

        /// <summary>
        ///
        /// </summary>
        public virtual string GivenName { get; set; }

        /// <summary>
        ///
        /// </summary>
        [XmlAttributeAttribute()]
        public virtual NameType Type { get; set; }

    }

}


text:
HTMLWidgets.widget({
  name: 'echarts',
  type: 'output',

  initialize: function(el, width, height) {
    return echarts.init(el);
  },

  renderValue: function(el, x, instance) {
    instance.setOption(x);
  },

  resize: function(el, width, height, instance) {
  }

});


text:
package aip0126

import "github.com/googleapis/api-linter/lint"

// AddRules adds all of the AIP-126 rules to the provided registry.
func AddRules(r lint.RuleRegistry) error {
	return r.Register(
		126,
		enumValueUpperSnakeCase,
		unspecified,
	)
}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>Pannonia - premium responsive admin template by Eugene Kopyov</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet' type='text/css'>

					Howdy, Eugene!

Profile

Messages9

Settings

Logout

Wazzup, Eugene!

New users+12

New orders+156

New messages+45

Users

Orders

Visits

116k+

1290

554

Dashboard

Form elements3

Form components

WYSIWYG editor

Wizards

Components4

Content components

Content grid

Blank page

Media

Icons

Charts & graphs

Invoice

Tables

Error pages6

403 page

404 page

405 page

500 page

503 page

Offline page

Typography

Calendar

File management

Menu levels3

Link

Link with submenu

Lorem ipsum

Dolor sit amet

Link

Page layouts3

No sidebar tabs

No action tabs

Action tabs on top

No breadcrumbs line

Datepicker

<input type="text" id="fromDate" name="from" placeholder="From" />

-

<input type="text" id="toDate" name="to" placeholder="To" />

                        <input type="text" value="" readonly >

<input id="timeformatExample1" type="text" placeholder="Start" />

-

<input id="timeformatExample2" type="text" placeholder="End" />

Social statistics

1,286

				        			total feed subscribers

12,683

				        			total twitter followers

530,893

				        			total facebook likes

Gallery thumbs

Action buttons

	                	<button class="btn btn-block btn-danger">Action button</button>
	                	<button class="btn btn-block btn-info">Action button</button>
	                	<button class="btn btn-block btn-success">Action button</button>

Tags input

						<input type="text" id="tags1" class="tags" value="these,are,sample,tags" />

Dashboard

Calendar

Stats

Messages

Tasks (+16)

Add new task

Statement

Settings

Calendar

				    	Daily, weekly and monthly

			    				New visits

22.504

10,14,8,45,23,41,22,31,19,12, 28, 21, 24, 20

			    				My balance

$16.290

10,14,8,45,23,41,22,31,19,12, 28, 21, 24, 20

					    				12,476

									User registrations

					    				621,873

									Total clicks

					    				562

									New orders

					    				$45,360

									General balance

					    				562K+

									Total users

					    				36,290

									Facebook fans

Quick actions

Website statistics

Google map

		    	<form class="search widget" action="#">

			    		<input type="text" placeholder="search website..." id="autocomplete" />
			    		<input type="submit" class="btn btn-info" value="Search" />

		    	</form>

Calendar

Copyright © 2014.Company name All rights reserved.网页模板

Contact admin

Report bug


text:
package com.example.ui.lockscreen;

import android.app.KeyguardManager;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.util.Log;

public class BitmapLockService extends Service {
	private static String TAG = "ZdLockService";
	private Intent zdLockIntent = null;
	private Handler mainHandler = null;

	public IBinder onBind(Intent arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	public void onCreate() {
		super.onCreate();

		zdLockIntent = new Intent(BitmapLockService.this,
				BitmapLockScrActivity.class);
		zdLockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

		IntentFilter mScreenOffFilter = new IntentFilter();
		mScreenOffFilter.addAction("android.intent.action.SCREEN_OFF");
		mScreenOffFilter.addAction("android.intent.action.SCREEN_ON");
		BitmapLockService.this.registerReceiver(mScreenOffReceiver,
				mScreenOffFilter);
	}

	public int onStartCommand(Intent intent, int flags, int startId) {

		return Service.START_STICKY;

	}

	public void onDestroy() {
		super.onDestroy();
		BitmapLockService.this.unregisterReceiver(mScreenOffReceiver);
		startService(new Intent(BitmapLockService.this, BitmapLockService.class));
	}

	private KeyguardManager mKeyguardManager = null;
	private KeyguardManager.KeyguardLock mKeyguardLock = null;

	private BroadcastReceiver mScreenOffReceiver = new BroadcastReceiver() {

		public void onReceive(Context context, Intent intent) {
			String action = intent.getAction();

			Log.i(TAG, intent.toString());

			if (action.equals(Intent.ACTION_TIME_TICK)
					|| action.equals(Intent.ACTION_TIMEZONE_CHANGED)) {
				mainHandler.obtainMessage(1).sendToTarget();
			}

			if (action.equals("android.intent.action.SCREEN_OFF")
					|| action.equals("android.intent.action.SCREEN_ON")) {
				mKeyguardManager = (KeyguardManager) context
						.getSystemService(Context.KEYGUARD_SERVICE);
				mKeyguardLock = mKeyguardManager.newKeyguardLock("zdLock 1");
				mKeyguardLock.disableKeyguard();
				startActivity(zdLockIntent);
			}
		}

	};

}


text:
<?php
namespace Maxtrunk\Debugbar\DataCollector;

use DebugBar\DataCollector\MessagesCollector;
use Psr\Log\LogLevel;
use ReflectionClass;

class LogsCollector extends MessagesCollector
{
    protected $lines = 124;

    public function __construct($path = null, $name = 'logs')
    {
        parent::__construct($name);

        $path = $path ?: $this->getLogsFile();
        $this->getStorageLogs($path);
    }

    /**
     * Get the path to the logs file
     *
     * @return string
     */
    public function getLogsFile()
    {
        // default daily rotating logs (Laravel 5.0)
        $path = storage_path() . '/logs/laravel-' . date('Y-m-d') . '.log';

        // single file logs
        if (!file_exists($path)) {
            $path = storage_path() . '/logs/laravel.log';
        }

        return $path;
    }

    /**
     * get logs apache in app/storage/logs
     * only 24 last of current day
     *
     * @param string $path
     *
     * @return array
     */
    public function getStorageLogs($path)
    {
        if (!file_exists($path)) {
            return;
        }

        //Load the latest lines, guessing about 15x the number of log entries (for stack traces etc)
        $file = implode("", $this->tailFile($path, $this->lines));

        foreach ($this->getLogs($file) as $log) {
            $this->addMessage($log['header'] . $log['stack'], $log['level'], false);
        }
    }

    /**
     * By Ain Tohvri (ain)
     * http://tekkie.flashbit.net/php/tail-functionality-in-php
     * @param string $file
     * @param int $lines
     * @return array
     */
    protected function tailFile($file, $lines)
    {
        $handle = fopen($file, "r");
        $linecounter = $lines;
        $pos = -2;
        $beginning = false;
        $text = array();
        while ($linecounter > 0) {
            $t = " ";
            while ($t != "\n") {
                if (fseek($handle, $pos, SEEK_END) == -1) {
                    $beginning = true;
                    break;
                }
                $t = fgetc($handle);
                $pos--;
            }
            $linecounter--;
            if ($beginning) {
                rewind($handle);
            }
            $text[$lines - $linecounter - 1] = fgets($handle);
            if ($beginning) {
                break;
            }
        }
        fclose($handle);
        return array_reverse($text);
    }

    /**
     * Search a string for log entries
     * Based on https://github.com/mikemand/logviewer/blob/master/src/Kmd/Logviewer/Logviewer.php by mikemand
     *
     * @param $file
     * @return array
     */
    public function getLogs($file)
    {
        $pattern = "/\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\].*/";

        $log_levels = $this->getLevels();

        // There has GOT to be a better way of doing this...
        preg_match_all($pattern, $file, $headings);
        $log_data = preg_split($pattern, $file);

        $log = array();
        foreach ($headings as $h) {
            for ($i = 0, $j = count($h); $i < $j; $i++) {
                foreach ($log_levels as $ll) {
                    if (strpos(strtolower($h[$i]), strtolower('.' . $ll))) {
                        $log[] = array('level' => $ll, 'header' => $h[$i], 'stack' => $log_data[$i]);
                    }
                }
            }
        }

        $log = array_reverse($log);

        return $log;
    }

    /**
     * Get the log levels from psr/log.
     * Based on https://github.com/mikemand/logviewer/blob/master/src/Kmd/Logviewer/Logviewer.php by mikemand
     *
     * @access public
     * @return array
     */
    public function getLevels()
    {
        $class = new ReflectionClass(new LogLevel());
        return $class->getConstants();
    }
}


text:
.. image:: https://travis-ci.org/EMBL-EBI-TSI/aap-client-python.svg?branch=master
   :target: https://travis-ci.org/EMBL-EBI-TSI/aap-client-python
.. image:: https://codecov.io/gh/EMBL-EBI-TSI/aap-client-python/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/EMBL-EBI-TSI/aap-client-python
.. image:: https://readthedocs.org/projects/aap-client-python/badge/?version=latest
   :target: https://aap-client-python.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

Overview
########

This library is meant to be used in the backed to interact with Tokens produced by EBI's AAP

Cryptographic files here shouldn't be used in production, they're just for testing :)

Usage
#####

To install the package, enable the virtual environment where it's going to be used and run
``$ pip install aap-client-python``

To use the Flask functionality this needs to be installed:
``$ pip install aap-client-python[flask]``

Developing
##########

To prepare the environment for developing the library, create a virtual environment, go to project root and then run:

::

  $ pip install -e .[dev]

Testing
#######
The recommended way is to test using detox.
This allows for testing in all the supported python versions using virtual environments effortlessly.
To use, install it, then run in the project root:

::

  $ pip install detox
  $ detox

Alternatively, testing can be done in the same environment as the dev one by installing it's dependencies, then running pytest:

::

  $ pip install -e .[test]
  $ python -m pytest -s


text:
var db = require('./db');

var collection = module.exports.db = db.get('resultcollection');

module.exports.createresult = function(map, cb) {
    var result = {}

    for (var key in map) result[key] = -1

    cb(result)
}

module.exports.saveresults = function(session, results, cb) {
    if (session.id == null) session.id = new ObjectId();
    if (session.resultid == null) session.resultid = new ObjectId();
    if (session.narrativeid == null) session.narrativeid = new ObjectId();
    collection.update({_id: session.id}, {_id: session.id, session: session, results: results}, {upsert: true});
}

module.exports.loadresults(id, cb) {
    collection.findOne({_id: id}, function (err, doc) {
        if (err) return res.json({error : err});
        cb(doc);
    });
}


text:
package org.kuali.kra.award.paymentreports.closeout;

import org.apache.commons.lang3.StringUtils;
import org.kuali.coeus.sys.framework.service.KcServiceLocator;
import org.kuali.kra.award.document.AwardDocument;
import org.kuali.kra.infrastructure.KeyConstants;
import org.kuali.rice.core.api.util.ConcreteKeyValue;
import org.kuali.rice.core.api.util.KeyValue;
import org.kuali.rice.coreservice.framework.parameter.ParameterService;
import org.kuali.rice.krad.service.KeyValuesService;
import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 *
 * This class is a values finder for ReportClass business object.
 */
public class CloseoutReportTypeValuesFinder extends UifKeyValuesFinderBase {

    private ParameterService parameterService;

    /**
     * Constructs the list of Report Classes using KeyValuesService.
     * Each entry in the list is a <key, value> pair, where the "key" is the unique
     * report class code and the "value" is the textual description that is viewed
     * by a user.
     *
     */
    @Override
    public List<KeyValue> getKeyValues() {
        Collection<CloseoutReportType> closeoutReportTypes = (Collection<CloseoutReportType>)getKeyValuesService().findAll(CloseoutReportType.class);

        List<KeyValue> keyValues = new ArrayList<KeyValue>();

        for(CloseoutReportType closeoutReportType: closeoutReportTypes){
            if (!StringUtils.equalsIgnoreCase(closeoutReportType.getCloseoutReportCode(), this.getParameterService().getParameterValueAsString(
                    AwardDocument.class,
                    KeyConstants.CLOSE_OUT_REPORT_TYPE_USER_DEFINED))){
                keyValues.add(new ConcreteKeyValue(closeoutReportType.getCloseoutReportCode(), closeoutReportType.getDescription()));
            }
        }

        return keyValues;
    }

    protected KeyValuesService getKeyValuesService(){
        return (KeyValuesService) KcServiceLocator.getService(KeyValuesService.class);
    }

    /**
     * Looks up and returns the ParameterService.
     * @return the parameter service.
     */
    protected ParameterService getParameterService() {
        if (this.parameterService == null) {
            this.parameterService = KcServiceLocator.getService(ParameterService.class);
        }
        return this.parameterService;
    }

}


text:
package xpath

import (
	"strings"

	"github.com/antchfx/xmlquery"
	path "github.com/antchfx/xpath"
)

type xmlDocument struct{}

func (d *xmlDocument) Parse(buf []byte) (dataNode, error) {
	return xmlquery.Parse(strings.NewReader(string(buf)))
}

func (d *xmlDocument) QueryAll(node dataNode, expr string) ([]dataNode, error) {
	// If this panics it's a programming error as we changed the document type while processing
	native, err := xmlquery.QueryAll(node.(*xmlquery.Node), expr)
	if err != nil {
		return nil, err
	}

	nodes := make([]dataNode, 0, len(native))
	for _, n := range native {
		nodes = append(nodes, n)
	}
	return nodes, nil
}

func (d *xmlDocument) CreateXPathNavigator(node dataNode) path.NodeNavigator {
	// If this panics it's a programming error as we changed the document type while processing
	return xmlquery.CreateXPathNavigator(node.(*xmlquery.Node))
}

func (d *xmlDocument) GetNodePath(node, relativeTo dataNode, sep string) string {
	names := make([]string, 0)

	// If these panic it's a programming error as we changed the document type while processing
	nativeNode := node.(*xmlquery.Node)
	nativeRelativeTo := relativeTo.(*xmlquery.Node)

	// Climb up the tree and collect the node names
	n := nativeNode.Parent
	for n != nil && n != nativeRelativeTo {
		names = append(names, n.Data)
		n = n.Parent
	}

	if len(names) < 1 {
		return ""
	}

	// Construct the nodes
	nodepath := ""
	for _, name := range names {
		nodepath = name + sep + nodepath
	}

	return nodepath[:len(nodepath)-1]
}

func (d *xmlDocument) OutputXML(node dataNode) string {
	native := node.(*xmlquery.Node)
	return native.OutputXML(false)
}


text:
package com.geecat.steps.queue;

import com.geecat.steps.linkedlist.LinkedList;

public class QueueLinkedList<T> {

	LinkedList<T> list = new LinkedList<>();
	public void enQueue(T t) {
		list.addRear(t);
	}
	public T deQueue() {
		return list.getFront();
	}

	public int queueSize() {
		return list.getTotal();
	}

	public T front() {
		return list.Front();
	}

	public void printQueue() {
		list.printList();
	}

	/*LinkedList<Integer> list = new LinkedList<>();
	list.addRear(2);
	list.addRear(3);
	list.addRear(4);
	list.getFront();
	list.getFront();
	//list.getFront();
	//list.getFront();
	list.addRear(5);
	//list.getFront();
	list.printList();*/
}


text:
package org.apache.aries.blueprint.plugin;

import java.util.Collection;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

import org.apache.aries.blueprint.plugin.model.OsgiServiceRef;

public class OsgiServiceRefWriter {
    private XMLStreamWriter writer;

    public OsgiServiceRefWriter(XMLStreamWriter writer) {
        this.writer = writer;
    }

    public void write(Collection<OsgiServiceRef> serviceRefs) throws XMLStreamException {
        for (OsgiServiceRef serviceBean : serviceRefs) {
            writeServiceRef(serviceBean);
        }
    }

    private void writeServiceRef(OsgiServiceRef serviceBean) throws XMLStreamException {
        writer.writeEmptyElement("reference");
        writer.writeAttribute("id", serviceBean.id);
        writer.writeAttribute("interface", serviceBean.clazz.getName());
        if (serviceBean.filter != null && !"".equals(serviceBean.filter)) {
            writer.writeAttribute("filter", serviceBean.filter);
        }
        writer.writeCharacters("\n");
    }

}


text:
package com.geeks.caveats;

public class VarArgsMethod {
	public static void main(String[] args) {
		int values[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
		int size = getVargsLength(values);

		System.out.println(size); // output: 1

		String strings[] = { "abc", "cde", "efg" };
		size = getVargsLength(strings);
		System.out.println(size); // output: 3

	}

	/**
	 * @Caveat 1: primitive array is treated as on object for vargs, reference
	 *         array can be treated as array
	 */
	private static <T> int getVargsLength(T... args) {
		return args.length;
	}
}


text:
package com.alliander.osgp.core.infra.jms.domain.in;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.activemq.command.ActiveMQQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.listener.DefaultMessageListenerContainer;

import com.alliander.osgp.core.domain.model.protocol.ProtocolResponseService;
import com.alliander.osgp.domain.core.entities.DomainInfo;
import com.alliander.osgp.domain.core.entities.ProtocolInfo;

public class DomainResponseMessageListenerContainerFactory extends DefaultMessageListenerContainer {

    private static final Logger LOGGER = LoggerFactory.getLogger(DomainResponseMessageListenerContainerFactory.class);

    @Autowired
    private ProtocolResponseService protocolResponseService;

    private List<DomainInfo> domainInfos;

    private List<ProtocolInfo> protocolInfos;

    private Map<String, DefaultMessageListenerContainer> containers = new HashMap<>();

    public DomainResponseMessageListenerContainerFactory(final List<DomainInfo> domainInfos,
            final List<ProtocolInfo> protocolInfos) {
        this.domainInfos = domainInfos;
        this.protocolInfos = protocolInfos;
    }

    public DefaultMessageListenerContainer getMessageListenerContainer(final String key) {
        return this.containers.get(key);
    }

    @Override
    public void afterPropertiesSet() {
        for (final DomainInfo domainInfo : this.domainInfos) {
            // Check if the queue name is present.
            if (domainInfo.getIncomingDomainResponsesQueue() != null) {
                LOGGER.info("Creating DomainResponseMessageListenerContainer {}", domainInfo.getKey());
                this.containers.put(domainInfo.getKey(), this.createDomainResponseMessageListenerContainer(domainInfo));
            }
        }

        for (final Entry<String, DefaultMessageListenerContainer> entry : this.containers.entrySet()) {
            LOGGER.debug("Method 'afterPropertiesSet' called for DomainResponseMessageListenerContainer {}",
                    entry.getKey());
            entry.getValue().afterPropertiesSet();
        }
    }

    @Override
    public void initialize() {
        for (final Entry<String, DefaultMessageListenerContainer> entry : this.containers.entrySet()) {
            LOGGER.debug("Method 'intitialize' called for DomainResponseMessageListenerContainer {}", entry.getKey());
            entry.getValue().initialize();
        }
    }

    @Override
    public void start() {
        for (final Entry<String, DefaultMessageListenerContainer> entry : this.containers.entrySet()) {
            LOGGER.debug("Method 'start' called for DomainResponseMessageListenerContainer {}", entry.getKey());
            entry.getValue().start();
        }
    }

    @Override
    public void destroy() {
        for (final Entry<String, DefaultMessageListenerContainer> entry : this.containers.entrySet()) {
            LOGGER.debug("Method 'destroy' called for DomainResponseMessageListenerContainer {}", entry.getKey());
            entry.getValue().destroy();
        }
    }

    private DefaultMessageListenerContainer createDomainResponseMessageListenerContainer(final DomainInfo domainInfo) {
        final DefaultMessageListenerContainer messageListenerContainer = new DefaultMessageListenerContainer();
        messageListenerContainer.setConnectionFactory(this.getConnectionFactory());
        messageListenerContainer.setDestination(new ActiveMQQueue(domainInfo.getIncomingDomainResponsesQueue()));
        messageListenerContainer.setConcurrentConsumers(this.getConcurrentConsumers());
        messageListenerContainer.setMaxConcurrentConsumers(this.getMaxConcurrentConsumers());

        messageListenerContainer.setMessageListener(new DomainResponseMessageListener(this.protocolResponseService,
                this.protocolInfos));
        messageListenerContainer.setSessionTransacted(true);

        return messageListenerContainer;
    }
}


text:
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>

#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>

#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>

/* returns the address info of a connection to localhost on a given port */
struct addrinfo * getLocalAddressInfo(unsigned short port)
{
    int addrErr;
    char portString[6];
    struct addrinfo hint,
                    *localInfo = NULL;

   /* set up the hint, so the computer knows what we want */
    memset(&hint, 0, sizeof(struct addrinfo));
    hint.ai_family   = AF_UNSPEC;
    hint.ai_socktype = SOCK_STREAM;
    hint.ai_flags    = AI_PASSIVE;

    /* getaddrinfo requires a character string instead of a port number*/
    sprintf(portString,"%d", port);

    /* populate the linked list */
    addrErr = getaddrinfo(NULL, portString, &hint, &localInfo);
    if(addrErr)
    {
        /* error returned by function call, print it */
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(addrErr));
        return NULL;
    }
    else
    {
        /* call successful */
        return localInfo;
    }
}

//Function to create and bind a listener socket based on
//a passed address value
//returns a socket file descriptor on success, 0 on failure.
int bindToAddress(struct addrinfo * addr)
{
    int sfd = 0;
    int optVal = 1;
    if(!addr) return 0; //code equivalent of foreshadowing
    /* The if call from hell.  Feel free to make fun of me for this, or change it yourself */
    else if(
            // open the socket file descriptor
            (sfd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol)) != -1 &&
            // set the socket to keep alive
            setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &optVal, sizeof(int))       != -1 &&
            setsockopt(sfd, SOL_SOCKET, SO_KEEPALIVE, &optVal, sizeof(int))       != -1 &&
            bind(sfd, addr->ai_addr, addr->ai_addrlen)                            != -1
           )
        {
        //if that massive if-statement went through, that means we're home free and the socket
        //is bound properly. return the socket descriptor
            return sfd;
        }
        else
        {
            //there's like 5 ways this function could've gone wrong, let's at least print one
            perror("BindToAddress");
            //close the socket file descriptor
            close(sfd);
            //call this function on the next member of the list THAT'S RIGHT, RECURSION!
            return bindToAddress(addr->ai_next);
        }
}

// returns a socket file descriptor connected to the given port
int listenOnPort(unsigned short port)
{
   int sock_fd;

   struct addrinfo *addrInfo;

   //get the address info to open a socket at the given port
   addrInfo = getLocalAddressInfo(port);

   //failed to get address information
   if(!addrInfo) return 0;

   //get the socket file descriptor from the given address
   sock_fd = bindToAddress(addrInfo);

   freeaddrinfo(addrInfo);
   return sock_fd;
}


text:
#ifndef XTENSA_LIBISA_H
#define XTENSA_LIBISA_H

#ifdef __cplusplus
extern "C" {
#endif

/* Version number: This is intended to help support code that works with
   versions of this library from multiple Xtensa releases.  */

#define XTENSA_ISA_VERSION 7000

#ifndef uint32
#define uint32 unsigned int
#endif

/* This file defines the interface to the Xtensa ISA library.  This
   library contains most of the ISA-specific information for a
   particular Xtensa processor.  For example, the set of valid
   instructions, their opcode encodings and operand fields are all
   included here.

   This interface basically defines a number of abstract data types.

   . an instruction buffer - for holding the raw instruction bits
   . ISA info - information about the ISA as a whole
   . instruction formats - instruction size and slot structure
   . opcodes - information about individual instructions
   . operands - information about register and immediate instruction operands
   . stateOperands - information about processor state instruction operands
   . interfaceOperands - information about interface instruction operands
   . register files - register file information
   . processor states - internal processor state information
   . system registers - "special registers" and "user registers"
   . interfaces - TIE interfaces that are external to the processor
   . functional units - TIE shared functions

   The interface defines a set of functions to access each data type.
   With the exception of the instruction buffer, the internal
   representations of the data structures are hidden.  All accesses must
   be made through the functions defined here.  */

typedef struct xtensa_isa_opaque { int unused; } *xtensa_isa;

/* Most of the Xtensa ISA entities (e.g., opcodes, regfiles, etc.) are
   represented here using sequential integers beginning with 0.  The
   specific values are only fixed for a particular instantiation of an
   xtensa_isa structure, so these values should only be used
   internally.  */

typedef int xtensa_opcode;
typedef int xtensa_format;
typedef int xtensa_regfile;
typedef int xtensa_state;
typedef int xtensa_sysreg;
typedef int xtensa_interface;
typedef int xtensa_funcUnit;

/* Define a unique value for undefined items.  */

#define XTENSA_UNDEFINED -1

/* Overview of using this interface to decode/encode instructions:

   Each Xtensa instruction is associated with a particular instruction
   format, where the format defines a fixed number of slots for
   operations.  The formats for the core Xtensa ISA have only one slot,
   but FLIX instructions may have multiple slots.  Within each slot,
   there is a single opcode and some number of associated operands.

   The encoding and decoding functions operate on instruction buffers,
   not on the raw bytes of the instructions.  The same instruction
   buffer data structure is used for both entire instructions and
   individual slots in those instructions -- the contents of a slot need
   to be extracted from or inserted into the buffer for the instruction
   as a whole.

   Decoding an instruction involves first finding the format, which
   identifies the number of slots, and then decoding each slot
   separately.  A slot is decoded by finding the opcode and then using
   the opcode to determine how many operands there are.  For example:

   xtensa_insnbuf_from_chars
   xtensa_format_decode
   for each slot {
     xtensa_format_get_slot
     xtensa_opcode_decode
     for each operand {
       xtensa_operand_get_field
       xtensa_operand_decode
     }
   }

   Encoding an instruction is roughly the same procedure in reverse:

   xtensa_format_encode
   for each slot {
     xtensa_opcode_encode
     for each operand {
       xtensa_operand_encode
       xtensa_operand_set_field
     }
     xtensa_format_set_slot
   }
   xtensa_insnbuf_to_chars
*/

/* Error handling.  */

/* Error codes.  The code for the most recent error condition can be
   retrieved with the "errno" function.  For any result other than
   xtensa_isa_ok, an error message containing additional information
   about the problem can be retrieved using the "error_msg" function.
   The error messages are stored in an internal buffer, which should
   not be freed and may be overwritten by subsequent operations.  */

typedef enum xtensa_isa_status_enum
{
  xtensa_isa_ok = 0,
  xtensa_isa_bad_format,
  xtensa_isa_bad_slot,
  xtensa_isa_bad_opcode,
  xtensa_isa_bad_operand,
  xtensa_isa_bad_field,
  xtensa_isa_bad_iclass,
  xtensa_isa_bad_regfile,
  xtensa_isa_bad_sysreg,
  xtensa_isa_bad_state,
  xtensa_isa_bad_interface,
  xtensa_isa_bad_funcUnit,
  xtensa_isa_wrong_slot,
  xtensa_isa_no_field,
  xtensa_isa_out_of_memory,
  xtensa_isa_buffer_overflow,
  xtensa_isa_internal_error,
  xtensa_isa_bad_value
} xtensa_isa_status;

extern xtensa_isa_status
xtensa_isa_errno (xtensa_isa isa);

extern char *
xtensa_isa_error_msg (xtensa_isa isa);

/* Instruction buffers.  */

typedef uint32 xtensa_insnbuf_word;
typedef xtensa_insnbuf_word *xtensa_insnbuf;

/* Get the size in "insnbuf_words" of the xtensa_insnbuf array.  */

extern int
xtensa_insnbuf_size (xtensa_isa isa);

/* Allocate an xtensa_insnbuf of the right size.  */

extern xtensa_insnbuf
xtensa_insnbuf_alloc (xtensa_isa isa);

/* Release an xtensa_insnbuf.  */

extern void
xtensa_insnbuf_free (xtensa_isa isa, xtensa_insnbuf buf);

/* Conversion between raw memory (char arrays) and our internal
   instruction representation.  This is complicated by the Xtensa ISA's
   variable instruction lengths.  When converting to chars, the buffer
   must contain a valid instruction so we know how many bytes to copy;
   thus, the "to_chars" function returns the number of bytes copied or
   XTENSA_UNDEFINED on error.  The "from_chars" function first reads the
   minimal number of bytes required to decode the instruction length and
   then proceeds to copy the entire instruction into the buffer; if the
   memory does not contain a valid instruction, it copies the maximum
   number of bytes required for the longest Xtensa instruction.  The
   "num_chars" argument may be used to limit the number of bytes that
   can be read or written.  Otherwise, if "num_chars" is zero, the
   functions may read or write past the end of the code.  */

extern int
xtensa_insnbuf_to_chars (xtensa_isa isa, const xtensa_insnbuf insn,
			 unsigned char *cp, int num_chars);

extern void
xtensa_insnbuf_from_chars (xtensa_isa isa, xtensa_insnbuf insn,
			   const unsigned char *cp, int num_chars);

/* ISA information.  */

/* Initialize the ISA information.  */

extern xtensa_isa
xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p);

/* Deallocate an xtensa_isa structure.  */

extern void
xtensa_isa_free (xtensa_isa isa);

/* Get the maximum instruction size in bytes.  */

extern int
xtensa_isa_maxlength (xtensa_isa isa);

/* Decode the length in bytes of an instruction in raw memory (not an
   insnbuf).  This function reads only the minimal number of bytes
   required to decode the instruction length.  Returns
   XTENSA_UNDEFINED on error.  */

extern int
xtensa_isa_length_from_chars (xtensa_isa isa, const unsigned char *cp);

/* Get the number of stages in the processor's pipeline.  The pipeline
   stage values returned by other functions in this library will range
   from 0 to N-1, where N is the value returned by this function.
   Note that the stage numbers used here may not correspond to the
   actual processor hardware, e.g., the hardware may have additional
   stages before stage 0.  Returns XTENSA_UNDEFINED on error.  */

extern int
xtensa_isa_num_pipe_stages (xtensa_isa isa);

/* Get the number of various entities that are defined for this processor.  */

extern int
xtensa_isa_num_formats (xtensa_isa isa);

extern int
xtensa_isa_num_opcodes (xtensa_isa isa);

extern int
xtensa_isa_num_regfiles (xtensa_isa isa);

extern int
xtensa_isa_num_states (xtensa_isa isa);

extern int
xtensa_isa_num_sysregs (xtensa_isa isa);

extern int
xtensa_isa_num_interfaces (xtensa_isa isa);

extern int
xtensa_isa_num_funcUnits (xtensa_isa isa);

/* Instruction formats.  */

/* Get the name of a format.  Returns null on error.  */

extern const char *
xtensa_format_name (xtensa_isa isa, xtensa_format fmt);

/* Given a format name, return the format number.  Returns
   XTENSA_UNDEFINED if the name is not a valid format.  */

extern xtensa_format
xtensa_format_lookup (xtensa_isa isa, const char *fmtname);

/* Decode the instruction format from a binary instruction buffer.
   Returns XTENSA_UNDEFINED if the format is not recognized.  */

extern xtensa_format
xtensa_format_decode (xtensa_isa isa, const xtensa_insnbuf insn);

/* Set the instruction format field(s) in a binary instruction buffer.
   All the other fields are set to zero.  Returns non-zero on error.  */

extern int
xtensa_format_encode (xtensa_isa isa, xtensa_format fmt, xtensa_insnbuf insn);

/* Find the length (in bytes) of an instruction.  Returns
   XTENSA_UNDEFINED on error.  */

extern int
xtensa_format_length (xtensa_isa isa, xtensa_format fmt);

/* Get the number of slots in an instruction.  Returns XTENSA_UNDEFINED
   on error.  */

extern int
xtensa_format_num_slots (xtensa_isa isa, xtensa_format fmt);

/* Get the opcode for a no-op in a particular slot.
   Returns XTENSA_UNDEFINED on error.  */

extern xtensa_opcode
xtensa_format_slot_nop_opcode (xtensa_isa isa, xtensa_format fmt, int slot);

/* Get the bits for a specified slot out of an insnbuf for the
   instruction as a whole and put them into an insnbuf for that one
   slot, and do the opposite to set a slot.  Return non-zero on error.  */

extern int
xtensa_format_get_slot (xtensa_isa isa, xtensa_format fmt, int slot,
			const xtensa_insnbuf insn, xtensa_insnbuf slotbuf);

extern int
xtensa_format_set_slot (xtensa_isa isa, xtensa_format fmt, int slot,
			xtensa_insnbuf insn, const xtensa_insnbuf slotbuf);

/* Opcode information.  */

/* Translate a mnemonic name to an opcode.  Returns XTENSA_UNDEFINED if
   the name is not a valid opcode mnemonic.  */

extern xtensa_opcode
xtensa_opcode_lookup (xtensa_isa isa, const char *opname);

/* Decode the opcode for one instruction slot from a binary instruction
   buffer.  Returns the opcode or XTENSA_UNDEFINED if the opcode is
   illegal.  */

extern xtensa_opcode
xtensa_opcode_decode (xtensa_isa isa, xtensa_format fmt, int slot,
		      const xtensa_insnbuf slotbuf);

/* Set the opcode field(s) for an instruction slot.  All other fields
   in the slot are set to zero.  Returns non-zero if the opcode cannot
   be encoded.  */

extern int
xtensa_opcode_encode (xtensa_isa isa, xtensa_format fmt, int slot,
		      xtensa_insnbuf slotbuf, xtensa_opcode opc);

/* Get the mnemonic name for an opcode.  Returns null on error.  */

extern const char *
xtensa_opcode_name (xtensa_isa isa, xtensa_opcode opc);

/* Check various properties of opcodes.  These functions return 0 if
   the condition is false, 1 if the condition is true, and
   XTENSA_UNDEFINED on error.  The instructions are classified as
   follows:

   branch: conditional branch; may fall through to next instruction (B*)
   jump: unconditional branch (J, JX, RET*, RF*)
   loop: zero-overhead loop (LOOP*)
   call: unconditional call; control returns to next instruction (CALL*)

   For the opcodes that affect control flow in some way, the branch
   target may be specified by an immediate operand or it may be an
   address stored in a register.  You can distinguish these by
   checking if the instruction has a PC-relative immediate
   operand.  */

extern int
xtensa_opcode_is_branch (xtensa_isa isa, xtensa_opcode opc);

extern int
xtensa_opcode_is_jump (xtensa_isa isa, xtensa_opcode opc);

extern int
xtensa_opcode_is_loop (xtensa_isa isa, xtensa_opcode opc);

extern int
xtensa_opcode_is_call (xtensa_isa isa, xtensa_opcode opc);

/* Find the number of ordinary operands, state operands, and interface
   operands for an instruction.  These return XTENSA_UNDEFINED on
   error.  */

extern int
xtensa_opcode_num_operands (xtensa_isa isa, xtensa_opcode opc);

extern int
xtensa_opcode_num_stateOperands (xtensa_isa isa, xtensa_opcode opc);

extern int
xtensa_opcode_num_interfaceOperands (xtensa_isa isa, xtensa_opcode opc);

/* Get functional unit usage requirements for an opcode.  Each "use"
   is identified by a <functional unit, pipeline stage> pair.  The
   "num_funcUnit_uses" function returns the number of these "uses" or
   XTENSA_UNDEFINED on error.  The "funcUnit_use" function returns
   a pointer to a "use" pair or null on error.  */

typedef struct xtensa_funcUnit_use_struct
{
  xtensa_funcUnit unit;
  int stage;
} xtensa_funcUnit_use;

extern int
xtensa_opcode_num_funcUnit_uses (xtensa_isa isa, xtensa_opcode opc);

extern xtensa_funcUnit_use *
xtensa_opcode_funcUnit_use (xtensa_isa isa, xtensa_opcode opc, int u);

/* Operand information.  */

/* Get the name of an operand.  Returns null on error.  */

extern const char *
xtensa_operand_name (xtensa_isa isa, xtensa_opcode opc, int opnd);

/* Some operands are "invisible", i.e., not explicitly specified in
   assembly language.  When assembling an instruction, you need not set
   the values of invisible operands, since they are either hardwired or
   derived from other field values.  The values of invisible operands
   can be examined in the same way as other operands, but remember that
   an invisible operand may get its value from another visible one, so
   the entire instruction must be available before examining the
   invisible operand values.  This function returns 1 if an operand is
   visible, 0 if it is invisible, or XTENSA_UNDEFINED on error.  Note
   that whether an operand is visible is orthogonal to whether it is
   "implicit", i.e., whether it is encoded in a field in the
   instruction.  */

extern int
xtensa_operand_is_visible (xtensa_isa isa, xtensa_opcode opc, int opnd);

/* Check if an operand is an input ('i'), output ('o'), or inout ('m')
   operand.  Note: The output operand of a conditional assignment
   (e.g., movnez) appears here as an inout ('m') even if it is declared
   in the TIE code as an output ('o'); this allows the compiler to
   properly handle register allocation for conditional assignments.
   Returns 0 on error.  */

extern char
xtensa_operand_inout (xtensa_isa isa, xtensa_opcode opc, int opnd);

/* Get and set the raw (encoded) value of the field for the specified
   operand.  The "set" function does not check if the value fits in the
   field; that is done by the "encode" function below.  Both of these
   functions return non-zero on error, e.g., if the field is not defined
   for the specified slot.  */

extern int
xtensa_operand_get_field (xtensa_isa isa, xtensa_opcode opc, int opnd,
			  xtensa_format fmt, int slot,
			  const xtensa_insnbuf slotbuf, uint32 *valp);

extern int
xtensa_operand_set_field (xtensa_isa isa, xtensa_opcode opc, int opnd,
			  xtensa_format fmt, int slot,
			  xtensa_insnbuf slotbuf, uint32 val);

/* Encode and decode operands.  The raw bits in the operand field may
   be encoded in a variety of different ways.  These functions hide
   the details of that encoding.  The result values are returned through
   the argument pointer.  The return value is non-zero on error.  */

extern int
xtensa_operand_encode (xtensa_isa isa, xtensa_opcode opc, int opnd,
		       uint32 *valp);

extern int
xtensa_operand_decode (xtensa_isa isa, xtensa_opcode opc, int opnd,
		       uint32 *valp);

/* An operand may be either a register operand or an immediate of some
   sort (e.g., PC-relative or not).  The "is_register" function returns
   0 if the operand is an immediate, 1 if it is a register, and
   XTENSA_UNDEFINED on error.  The "regfile" function returns the
   regfile for a register operand, or XTENSA_UNDEFINED on error.  */

extern int
xtensa_operand_is_register (xtensa_isa isa, xtensa_opcode opc, int opnd);

extern xtensa_regfile
xtensa_operand_regfile (xtensa_isa isa, xtensa_opcode opc, int opnd);

/* Register operands may span multiple consecutive registers, e.g., a
   64-bit data type may occupy two 32-bit registers.  Only the first
   register is encoded in the operand field.  This function specifies
   the number of consecutive registers occupied by this operand.  For
   non-register operands, the return value is undefined.  Returns
   XTENSA_UNDEFINED on error.  */

extern int
xtensa_operand_num_regs (xtensa_isa isa, xtensa_opcode opc, int opnd);

/* Some register operands do not completely identify the register being
   accessed.  For example, the operand value may be added to an internal
   state value.  By definition, this implies that the corresponding
   regfile is not allocatable.  Unknown registers should generally be
   treated with worst-case assumptions.  The function returns 0 if the
   register value is unknown, 1 if known, and XTENSA_UNDEFINED on
   error.  */

extern int
xtensa_operand_is_known_reg (xtensa_isa isa, xtensa_opcode opc, int opnd);

/* Check if an immediate operand is PC-relative.  Returns 0 for register
   operands and non-PC-relative immediates, 1 for PC-relative
   immediates, and XTENSA_UNDEFINED on error.  */

extern int
xtensa_operand_is_PCrelative (xtensa_isa isa, xtensa_opcode opc, int opnd);

/* For PC-relative offset operands, the interpretation of the offset may
   vary between opcodes, e.g., is it relative to the current PC or that
   of the next instruction?  The following functions are defined to
   perform PC-relative relocations and to undo them (as in the
   disassembler).  The "do_reloc" function takes the desired address
   value and the PC of the current instruction and sets the value to the
   corresponding PC-relative offset (which can then be encoded and
   stored into the operand field).  The "undo_reloc" function takes the
   unencoded offset value and the current PC and sets the value to the
   appropriate address.  The return values are non-zero on error.  Note
   that these functions do not replace the encode/decode functions; the
   operands must be encoded/decoded separately and the encode functions
   are responsible for detecting invalid operand values.  */

extern int
xtensa_operand_do_reloc (xtensa_isa isa, xtensa_opcode opc, int opnd,
			 uint32 *valp, uint32 pc);

extern int
xtensa_operand_undo_reloc (xtensa_isa isa, xtensa_opcode opc, int opnd,
			   uint32 *valp, uint32 pc);

/* State Operands.  */

/* Get the state accessed by a state operand.  Returns XTENSA_UNDEFINED
   on error.  */

extern xtensa_state
xtensa_stateOperand_state (xtensa_isa isa, xtensa_opcode opc, int stOp);

/* Check if a state operand is an input ('i'), output ('o'), or inout
   ('m') operand.  Returns 0 on error.  */

extern char
xtensa_stateOperand_inout (xtensa_isa isa, xtensa_opcode opc, int stOp);

/* Interface Operands.  */

/* Get the external interface accessed by an interface operand.
   Returns XTENSA_UNDEFINED on error.  */

extern xtensa_interface
xtensa_interfaceOperand_interface (xtensa_isa isa, xtensa_opcode opc,
				   int ifOp);

/* Register Files.  */

/* Regfiles include both "real" regfiles and "views", where a view
   allows a group of adjacent registers in a real "parent" regfile to be
   viewed as a single register.  A regfile view has all the same
   properties as its parent except for its (long) name, bit width, number
   of entries, and default ctype.  You can use the parent function to
   distinguish these two classes.  */

/* Look up a regfile by either its name or its abbreviated "short name".
   Returns XTENSA_UNDEFINED on error.  The "lookup_shortname" function
   ignores "view" regfiles since they always have the same shortname as
   their parents.  */

extern xtensa_regfile
xtensa_regfile_lookup (xtensa_isa isa, const char *name);

extern xtensa_regfile
xtensa_regfile_lookup_shortname (xtensa_isa isa, const char *shortname);

/* Get the name or abbreviated "short name" of a regfile.
   Returns null on error.  */

extern const char *
xtensa_regfile_name (xtensa_isa isa, xtensa_regfile rf);

extern const char *
xtensa_regfile_shortname (xtensa_isa isa, xtensa_regfile rf);

/* Get the parent regfile of a "view" regfile.  If the regfile is not a
   view, the result is the same as the input parameter.  Returns
   XTENSA_UNDEFINED on error.  */

extern xtensa_regfile
xtensa_regfile_view_parent (xtensa_isa isa, xtensa_regfile rf);

/* Get the bit width of a regfile or regfile view.
   Returns XTENSA_UNDEFINED on error.  */

extern int
xtensa_regfile_num_bits (xtensa_isa isa, xtensa_regfile rf);

/* Get the number of regfile entries.  Returns XTENSA_UNDEFINED on
   error.  */

extern int
xtensa_regfile_num_entries (xtensa_isa isa, xtensa_regfile rf);

/* Processor States.  */

/* Look up a state by name.  Returns XTENSA_UNDEFINED on error.  */

extern xtensa_state
xtensa_state_lookup (xtensa_isa isa, const char *name);

/* Get the name for a processor state.  Returns null on error.  */

extern const char *
xtensa_state_name (xtensa_isa isa, xtensa_state st);

/* Get the bit width for a processor state.
   Returns XTENSA_UNDEFINED on error.  */

extern int
xtensa_state_num_bits (xtensa_isa isa, xtensa_state st);

/* Check if a state is exported from the processor core.  Returns 0 if
   the condition is false, 1 if the condition is true, and
   XTENSA_UNDEFINED on error.  */

extern int
xtensa_state_is_exported (xtensa_isa isa, xtensa_state st);

/* Check for a "shared_or" state.  Returns 0 if the condition is false,
   1 if the condition is true, and XTENSA_UNDEFINED on error.  */

extern int
xtensa_state_is_shared_or (xtensa_isa isa, xtensa_state st);

/* Sysregs ("special registers" and "user registers").  */

/* Look up a register by its number and whether it is a "user register"
   or a "special register".  Returns XTENSA_UNDEFINED if the sysreg does
   not exist.  */

extern xtensa_sysreg
xtensa_sysreg_lookup (xtensa_isa isa, int num, int is_user);

/* Check if there exists a sysreg with a given name.
   If not, this function returns XTENSA_UNDEFINED.  */

extern xtensa_sysreg
xtensa_sysreg_lookup_name (xtensa_isa isa, const char *name);

/* Get the name of a sysreg.  Returns null on error.  */

extern const char *
xtensa_sysreg_name (xtensa_isa isa, xtensa_sysreg sysreg);

/* Get the register number.  Returns XTENSA_UNDEFINED on error.  */

extern int
xtensa_sysreg_number (xtensa_isa isa, xtensa_sysreg sysreg);

/* Check if a sysreg is a "special register" or a "user register".
   Returns 0 for special registers, 1 for user registers and
   XTENSA_UNDEFINED on error.  */

extern int
xtensa_sysreg_is_user (xtensa_isa isa, xtensa_sysreg sysreg);

/* Interfaces.  */

/* Find an interface by name.  The return value is XTENSA_UNDEFINED if
   the specified interface is not found.  */

extern xtensa_interface
xtensa_interface_lookup (xtensa_isa isa, const char *ifname);

/* Get the name of an interface.  Returns null on error.  */

extern const char *
xtensa_interface_name (xtensa_isa isa, xtensa_interface intf);

/* Get the bit width for an interface.
   Returns XTENSA_UNDEFINED on error.  */

extern int
xtensa_interface_num_bits (xtensa_isa isa, xtensa_interface intf);

/* Check if an interface is an input ('i') or output ('o') with respect
   to the Xtensa processor core.  Returns 0 on error.  */

extern char
xtensa_interface_inout (xtensa_isa isa, xtensa_interface intf);

/* Check if accessing an interface has potential side effects.
   Currently "data" interfaces have side effects and "control"
   interfaces do not.  Returns 1 if there are side effects, 0 if not,
   and XTENSA_UNDEFINED on error.  */

extern int
xtensa_interface_has_side_effect (xtensa_isa isa, xtensa_interface intf);

/* Some interfaces may be related such that accessing one interface
   has side effects on a set of related interfaces.  The interfaces
   are partitioned into equivalence classes of related interfaces, and
   each class is assigned a unique identifier number.  This function
   returns the class identifier for an interface, or XTENSA_UNDEFINED
   on error.  These identifiers can be compared to determine if two
   interfaces are related; the specific values of the identifiers have
   no particular meaning otherwise.  */

extern int
xtensa_interface_class_id (xtensa_isa isa, xtensa_interface intf);

/* Functional Units.  */

/* Find a functional unit by name.  The return value is XTENSA_UNDEFINED if
   the specified unit is not found.  */

extern xtensa_funcUnit
xtensa_funcUnit_lookup (xtensa_isa isa, const char *fname);

/* Get the name of a functional unit.  Returns null on error.  */

extern const char *
xtensa_funcUnit_name (xtensa_isa isa, xtensa_funcUnit fun);

/* Functional units may be replicated.  See how many instances of a
   particular function unit exist.  Returns XTENSA_UNDEFINED on error.  */

extern int
xtensa_funcUnit_num_copies (xtensa_isa isa, xtensa_funcUnit fun);

#ifdef __cplusplus
}
#endif
#endif /* XTENSA_LIBISA_H */


text:
<?php

/**
 * Created by PhpStorm.
 * User: Gowtham
 * Date: 10/29/2015
 * Time: 3:11 PM
 */
class Payment extends MY_Controller
{

    function confirm(){
        if($this->input->get('code')){
            $this->load->model('sys/student_model','student');
            $this->load->model('sys/Transaction_model','tran');

            $this->form_validation->set_rules('t_id', '', 'required');

            if ($this->form_validation->run() == TRUE){
                if( $this->tran->paymentSuccess($this->input->post('t_id')) ){
                    $this->session->set_flashdata('valid', 'Record Inserted Successfully');
                }else{
                    $this->session->set_flashdata('error', 'Record Insert Failure !!!');
                }
                redirect(current_url());
            }
            $result = $this->student->getPaymentDetails($this->input->get('code'),'code');
            $this->load->view('cashier/payment/payment_conform',array('record'=>$result));
        }else
            $this->load->view('cashier/payment/payment_conform');
    }
    function view(){
        $this->load->model('sys/Transaction_model','tran');

        $d['records'] = $this->tran->getRecords();

        $this->load->view('cashier/payment/payment_history',$d);
    }
}


text:
package org.apache.ibatis.builder;

import java.io.InputStream;
import java.io.StringReader;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import org.apache.ibatis.builder.xml.XMLConfigBuilder;
import org.apache.ibatis.executor.loader.cglib.CglibProxyFactory;
import org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory;
import org.apache.ibatis.io.JBoss6VFS;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.logging.slf4j.Slf4jImpl;
import org.apache.ibatis.scripting.defaults.RawLanguageDriver;
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver;
import org.apache.ibatis.session.AutoMappingBehavior;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.LocalCacheScope;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.TypeHandler;
import org.apache.ibatis.type.TypeHandlerRegistry;
import org.testng.annotations.Test;

import static org.hamcrest.core.Is.*;
import static org.hamcrest.core.IsInstanceOf.*;
import static org.junit.Assert.*;

public class XmlConfigBuilderTest {

  @Test(groups = {"tidb"})
  public void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
    String resource = "org/apache/ibatis/builder/MinimalMapperConfig.xml";
    InputStream inputStream = Resources.getResourceAsStream(resource);
    XMLConfigBuilder builder = new XMLConfigBuilder(inputStream);
    Configuration config = builder.parse();
    assertNotNull(config);
    assertThat(config.getAutoMappingBehavior(), is(AutoMappingBehavior.PARTIAL));
    assertThat(config.isCacheEnabled(), is(true));
    assertThat(config.getProxyFactory(), is(instanceOf(JavassistProxyFactory.class)));
    assertThat(config.isLazyLoadingEnabled(), is(false));
    assertThat(config.isAggressiveLazyLoading(), is(true));
    assertThat(config.isMultipleResultSetsEnabled(), is(true));
    assertThat(config.isUseColumnLabel(), is(true));
    assertThat(config.isUseGeneratedKeys(), is(false));
    assertThat(config.getDefaultExecutorType(), is(ExecutorType.SIMPLE));
    assertNull(config.getDefaultStatementTimeout());
    assertNull(config.getDefaultFetchSize());
    assertThat(config.isMapUnderscoreToCamelCase(), is(false));
    assertThat(config.isSafeRowBoundsEnabled(), is(false));
    assertThat(config.getLocalCacheScope(), is(LocalCacheScope.SESSION));
    assertThat(config.getJdbcTypeForNull(), is(JdbcType.OTHER));
    assertThat(config.getLazyLoadTriggerMethods(), is((Set<String>) new HashSet<String>(Arrays.asList("equals", "clone", "hashCode", "toString"))));
    assertThat(config.isSafeResultHandlerEnabled(), is(true));
      assertThat(config.getDefaultScriptingLanuageInstance(), is(instanceOf(XMLLanguageDriver.class)));
    assertThat(config.isCallSettersOnNulls(), is(false));
    assertNull(config.getLogPrefix());
    assertNull(config.getLogImpl());
    assertNull(config.getConfigurationFactory());
  }

  enum MyEnum {
    ONE, TWO
  }

  public static class EnumOrderTypeHandler<E extends Enum<E>> extends BaseTypeHandler<E> {

    private E[] constants;

    public EnumOrderTypeHandler(Class<E> javaType) {
      constants = javaType.getEnumConstants();
    }

    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, E parameter, JdbcType jdbcType) throws SQLException {
      ps.setInt(i, parameter.ordinal() + 1); // 0 means NULL so add +1
    }

    @Override
    public E getNullableResult(ResultSet rs, String columnName) throws SQLException {
      int index = rs.getInt(columnName) - 1;
      return index < 0 ? null : constants[index];
    }

    @Override
    public E getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
      int index = rs.getInt(rs.getInt(columnIndex)) - 1;
      return index < 0 ? null : constants[index];
    }

    @Override
    public E getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
      int index = cs.getInt(columnIndex) - 1;
      return index < 0 ? null : constants[index];
    }
  }

  @Test(groups = {"tidb"})
  public void registerJavaTypeInitializingTypeHandler() {
    final String MAPPER_CONFIG = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
        + "<!DOCTYPE configuration PUBLIC \"-//mybatis.org//DTD Config 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-config.dtd\">\n"
        + "<configuration>\n"
        + "  <typeHandlers>\n"
        + "    <typeHandler javaType=\"org.apache.ibatis.builder.XmlConfigBuilderTest$MyEnum\"\n"
        + "      handler=\"org.apache.ibatis.builder.XmlConfigBuilderTest$EnumOrderTypeHandler\"/>\n"
        + "  </typeHandlers>\n"
        + "</configuration>\n";

    XMLConfigBuilder builder = new XMLConfigBuilder(new StringReader(MAPPER_CONFIG));
    builder.parse();

    TypeHandlerRegistry typeHandlerRegistry = builder.getConfiguration().getTypeHandlerRegistry();
    TypeHandler<MyEnum> typeHandler = typeHandlerRegistry.getTypeHandler(MyEnum.class);

    assertTrue(typeHandler instanceof EnumOrderTypeHandler);
    assertArrayEquals(MyEnum.values(), ((EnumOrderTypeHandler) typeHandler).constants);
  }

    @Test(groups = {"tidb"})
    public void shouldSuccessfullyLoadXMLConfigFile() throws Exception {
      String resource = "org/apache/ibatis/builder/CustomizedSettingsMapperConfig.xml";
      InputStream inputStream = Resources.getResourceAsStream(resource);
      XMLConfigBuilder builder = new XMLConfigBuilder(inputStream);
      Configuration config = builder.parse();

      assertThat(config.getAutoMappingBehavior(), is(AutoMappingBehavior.NONE));
      assertThat(config.isCacheEnabled(), is(false));
      assertThat(config.getProxyFactory(), is(instanceOf(CglibProxyFactory.class)));
      assertThat(config.isLazyLoadingEnabled(), is(true));
      assertThat(config.isAggressiveLazyLoading(), is(false));
      assertThat(config.isMultipleResultSetsEnabled(), is(false));
      assertThat(config.isUseColumnLabel(), is(false));
      assertThat(config.isUseGeneratedKeys(), is(true));
      assertThat(config.getDefaultExecutorType(), is(ExecutorType.BATCH));
      assertThat(config.getDefaultStatementTimeout(), is(10));
      assertThat(config.getDefaultFetchSize(), is(100));
      assertThat(config.isMapUnderscoreToCamelCase(), is(true));
      assertThat(config.isSafeRowBoundsEnabled(), is(true));
      assertThat(config.getLocalCacheScope(), is(LocalCacheScope.STATEMENT));
      assertThat(config.getJdbcTypeForNull(), is(JdbcType.NULL));
      assertThat(config.getLazyLoadTriggerMethods(), is((Set<String>) new HashSet<String>(Arrays.asList("equals", "clone", "hashCode", "toString", "xxx"))));
      assertThat(config.isSafeResultHandlerEnabled(), is(false));
      assertThat(config.getDefaultScriptingLanuageInstance(), is(instanceOf(RawLanguageDriver.class)));
      assertThat(config.isCallSettersOnNulls(), is(true));
      assertThat(config.getLogPrefix(), is("mybatis_"));
      assertThat(config.getLogImpl().getName(), is(Slf4jImpl.class.getName()));
      assertThat(config.getVfsImpl().getName(), is(JBoss6VFS.class.getName()));
      assertThat(config.getConfigurationFactory().getName(), is(String.class.getName()));

    }

}


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>JMSGOptionalContent Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">

				JMessage-iOS-SDK

				HXHG

Index

Hierarchy

							On This Page

							<select id="jump-to">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<optgroup label="Properties">

		<option value="//api/name/noSaveOffline">noSaveOffline</option>

		<option value="//api/name/noSaveNotification">noSaveNotification</option>

		<option value="//api/name/needReadReceipt">needReadReceipt</option>

		<option value="//api/name/messageCount">messageCount</option>

		<option value="//api/name/customNotification">customNotification</option>

	</optgroup>

</select>

JMSGOptionalContent Class Reference

	Inherits from
	NSObject

	Declared in
	JMSGOptionalContent.h

  noSaveOffline

不保存离线消息,NO,默认值,保存离线消息;YES,不保存离线消息

@property (nonatomic, assign) BOOL noSaveOffline

Declared In

JMSGOptionalContent.h

  noSaveNotification

不在状态栏显示消息,NO,默认值,状态栏显示消息;YES,状态栏不显示消息

@property (nonatomic, assign) BOOL noSaveNotification

Declared In

JMSGOptionalContent.h

  needReadReceipt

设置这条消息的发送是否需要对方发送已读回执,NO,默认值

@property (nonatomic, assign) BOOL needReadReceipt

Declared In

JMSGOptionalContent.h

  messageCount

设置消息发送时的未读数,默认为 1

@property (nonatomic, assign) SInt32 messageCount

Declared In

JMSGOptionalContent.h

  customNotification

自定义消息通知栏的内容

@property (nonatomic, strong) JMSGCustomNotification *customNotification

Discussion

这个属性可以具体参考 JMSGCustomNotification 类

Declared In

JMSGOptionalContent.h

Copyright © 2019 HXHG. All rights reserved. Updated: 2019-05-06

Generated by appledoc 2.2.1 (build 1334).


text:
require "better_strong_params/version"

module BetterStrongParams

  def self.included(base)
    base.class_eval do
      extend ClassMethods
    end
  end

  module Exceptions
    class Deprecated < RuntimeError; end
  end

  module ClassMethods

    def filter_parameters(options = {})
      raise(BetterStrongParams::Exceptions::Deprecated, "filter_parameters was deprecated in version 0.0.3, please refer to https://github.com/ShinobiDevs/better_strong_params for more information on the new DSL.")
    end

    def whitelist_parameters(options = {})

      alias_method :_params, :params

      define_method("params") do
        filtered = {}
        top_level_params = options.keys
        top_level_params.each do |top_level_param|
          filtered[top_level_param] = _params.require(top_level_param).permit(*options[top_level_param])
        end

        (_params.keys.map(&:to_s) - options.keys.map(&:to_s)).each do |root_level_param|
          filtered[root_level_param] = _params[root_level_param]
        end
        ActionController::Parameters.new(filtered).permit!
      end
    end
  end

end

if defined?(ActionController)
  ActionController::Base.send(:include, BetterStrongParams)
end


text:
TMGXMLE3 ;TMG/kst/XML Exporter -- Core functionality ;10/26/14, 3/17/21
         ;;1.0;TMG-LIB;**1**;07/12/05
 ;
 ;"TMG XML EXPORT FUNCTIONS (CORE FUNCTIONALITY)
 ;"Kevin Toppenberg MD
 ;
 ;"~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--
 ;"Copyright (c) 6/23/2015  Kevin S. Toppenberg MD
 ;"
 ;"This file is part of the TMG LIBRARY, and may only be used in accordence
 ;" to license terms outlined in separate file TMGLICNS.m, which should
 ;" always be distributed with this file.
 ;"~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--~--
 ;
 ;"=======================================================================
 ;" API -- Public Functions.
 ;"=======================================================================
 ;"WRIT1FIL(FILE,RECS,FLAGS,INDENTS,SHOWPROG,WRITERS,SAVFIELDINFO)  -- WRITE 1 FILE
 ;"=======================================================================
 ;"PRIVATE API FUNCTIONS
 ;"=======================================================================
 ;"WRTSTNGS(FLAGS,INDENTS)  -- WRITE settings
 ;
 ;"=======================================================================
 ;"DEPENDENCIES
 ;" TMGDBAP3, TMGDEBU2, TMGMISC2, TMGSTUT2, TMGUSRIF, TMGXMLT, MXMLUTL
 ;"=======================================================================
 ;"=======================================================================
 ;
WRIT1FIL(FILE,IENS,RECS,FLAGS,INDENTS,SHOWPROG,WRITERS,SAVFIELDINFO)  ;" WRITE 1 FILE
  ;"Scope: PUBLIC
  ;"Purpose: to dump out (in XML) one file, for specified records
  ;"Input: FILE -- number of file (or subfile) to dump
  ;"       IENS -- OPTIONAL.  Only used if FILE is a subfile. IENS for *PARENT* records.  E.g. "parent-IEN,grandparent-IEN," etc.
  ;"       RECS -- OPTIONAL. PASS BY REFERENCE (default is to WRITE ALL records, all fields)
  ;"          Format is as per documentation in ^TMGXMLE2 **EXCEPT** remove first node (which is file number)
  ;"          Quick summary: RECS(IEN,Field,FieldINFO);  (Default for all is "*")
  ;"                         RECS("TEMPLATE",...  see documentation in ^TMGXMLE2
  ;"       FLAGS -- OPTIONAL
  ;"                    b -- show tags for ALL fields, even IF field has no data
  ;"                    i -- indent tags for pretty, but technically useless, file formating.
  ;"                    I -- output INTERNAL values
  ;"                    D -- include data dictionary for file.
  ;"                    S -- output export settings
  ;"       INDENTS -- OPTIONAL -- current string to WRITE to indent line.
  ;"                    INDENTS("INCINDENT")=INCINDENT
  ;"       SHOWPROG   -- OPTIONAL -- **DONT** pass by reference.  If >0, then a progress bar will be shown.
  ;"       WRITERS -- OPTIONAL -- Array of callback functions for writing output
  ;"            NOTE: All writers will be responsible for ending with linefeed (if they want it).
  ;"         WRITERS("WRITE FILE LABEL FN") -- OPTIONAL -- the name of a custom function to use for writing
  ;"                        actual file starting and ending <file> </file>.  e.g.
  ;"                       "MyCustomFn".  Note DO NOT include parameters.  Function named
  ;"                       as custom function must accept same parameters as WTFILLBL
  ;"         WRITERS("WRITE REC LABEL FN") -- OPTIONAL -- the name of a custom function to use for writing
  ;"                        actual starting and ending <record> </record>.  e.g.
  ;"                       "MyCustomFn".  Note DO NOT include parameters.  Function named
  ;"                       as custom function must accept same parameters as WTRLABEL
  ;"         WRITERS("WRITE FLD LABEL FN") -- OPTIONAL -- the name of a custom function to use for writing
  ;"                       actual line of text out.  e.g. "WTFLABEL" or
  ;"                       "MyCustomFn".  Note DO NOT include parameters.  Function named
  ;"                       as custom function must accept same parameters as WTFLABEL
  ;"         WRITERS("WRITE LINE FN") -- OPTIONAL -- the name of a custom function to use for writing
  ;"                       actual line of text out for fields.  e.g. "WTLINE" or
  ;"                       "MyCustomFn".  Note DO NOT include parameters.  Function named
  ;"                       as custom function must accept same parameters as WTLINE
  ;"        WRITERS("WRITE WP LINE") -- OPTIONAL -- the name of a custom function to use for writing
  ;"                       actual line of text out for WP fields.  If not provided, then
  ;"                       LWRITER will be used instead.
  ;"                       e.g. "WriteWPLINE" or "MyWPCustomFn".  Note DO NOT include parameters.
  ;"                       Function named as custom function must accept same parameters as WTLINE
  ;"       SAVFIELDINFO -- OPTIONAL -- PASS BY REFERENCE.  An array to hold lookup values about
  ;"                fields, so it doesn't have to be done each time (faster)
  ;"Output: RESULTs are written to the current device.
  ;"RESULT : none
  NEW IEN,EXECFN
  NEW PROGCT SET PROGCT=0
  NEW PROGMAX SET PROGMAX=0
  SET FLAGS=$GET(FLAGS)
  SET IENS=$GET(IENS)
  NEW INCINDENT SET INCINDENT=$GET(INDENTS("INCINDENT")," ")
  SET INDENTS=$GET(INDENTS)
  NEW INDS0 MERGE INDS0=INDENTS SET INDS0=$SELECT(FLAGS["i":INDENTS,1:"")
  NEW INDS1 MERGE INDS1=INDENTS SET INDS1=INDS0_$SELECT(FLAGS["i":INCINDENT,1:"")
  NEW INDS2 MERGE INDS2=INDENTS SET INDS2=INDS1_$SELECT(FLAGS["i":INCINDENT,1:"")
  NEW TEMPLATE MERGE TEMPLATE=RECS("TEMPLATE")  ;"typicallly empty
  NEW RECSSPECIFIED SET RECSSPECIFIED=(($DATA(RECS)>1)&($DATA(RECS("*"))=0))
  NEW STARTTIME SET STARTTIME=$H
  NEW WTFILLBL SET WTFILLBL=$GET(WRITERS("WRITE FILE LABEL FN"),"WTFILLBL^TMGXMLE5")
  NEW RWRITER SET RWRITER=$GET(WRITERS("WRITE REC LABEL FN"),"WTRLABEL^TMGXMLE5")
  NEW INTROSHOWN SET INTROSHOWN=0
  ;
  NEW FILENUM SET FILENUM=+$GET(FILE)
  IF FILENUM=0 DO  GOTO WFDN
  . DO SHOWERR^TMGDEBU2(,"Can't convert file '"_$GET(FILE)_", to a number.")
  NEW FNAME SET FNAME=$ORDER(^DD(FILENUM,0,"NM",""))
  NEW ISSUBFILE SET ISSUBFILE=$$ISSUBFIL^TMGFMUT2(FILENUM)
  SET SHOWPROG=$GET(SHOWPROG)
  IF ISSUBFILE SET SHOWPROG=0
  ;
  NEW OROOT
  IF ISSUBFILE DO
  . SET OROOT=$$GETGREF^TMGFMUT2(FILENUM,IENS)
  ELSE  DO
  . SET OROOT=$$GET1^DID(FILENUM,"","","GLOBAL NAME") ;" Get global root   (Thanks, Don Donati...)
  NEW GREF SET GREF=$$CREF^DILF(OROOT) ;" Convert open to closed root
  ;
  IF SHOWPROG DO
  . IF RECSSPECIFIED DO
  . . SET PROGMAX=$$LISTCT^TMGMISC2("RECS")
  . ELSE  DO
  . . SET PROGMAX=0
  . . SET IEN=$ORDER(@GREF@("")) ;"count ALL records in file.
  . . FOR  DO  QUIT:(IEN'>0)
  . . . SET IEN=$ORDER(@GREF@(IEN))
  . . . IF +IEN>0 SET PROGMAX=PROGMAX+1
  ;
  SET IEN=0
  SET IEN("FILE-NUMBER")=FILENUM  ;"//kt mod 3/11/21
  FOR  DO  QUIT:(IEN'>0)
  . IF RECSSPECIFIED DO
  . . SET IEN=$ORDER(RECS(IEN))  ;"Cycle through specified records
  . . NEW EXTRA SET EXTRA=$GET(RECS(IEN))
  . . IF EXTRA'="" DO  ;"parse extra info into IEN array for output
  . . . NEW STR,N,TAG,VALUE
  . . . FOR N=1:1:$LENGTH(EXTRA,"^") DO
  . . . . SET STR=$PIECE(EXTRA,"^",N)
  . . . . IF STR'["=" QUIT
  . . . . SET TAG=$PIECE(STR,"=",1)
  . . . . SET VALUE=$PIECE(STR,"=",2)
  . . . . SET IEN(TAG)=VALUE
  . ELSE  DO
  . . SET IEN=$ORDER(@GREF@(IEN)) ;"Cycle through ALL records in file.
  . IF (IEN'>0) QUIT
  . NEW FIELDS MERGE FIELDS=RECS(IEN)
  . IF $DATA(FIELDS)'>1 MERGE FIELDS=TEMPLATE
  . IF $DATA(FIELDS)'>1 SET FIELDS("*")=""
  . IF $DATA(FIELDS("Rec Exclude",IEN)) QUIT  ;"skip excluded records
  . IF INTROSHOWN=0 DO
  . . SET EXECFN="DO "_WTFILLBL_"(.INDS0,"_FILENUM_","""_FNAME_""",0)"
  . . XECUTE EXECFN ;"e.g. '<FILE ...   >'
  . . IF FLAGS["D" DO WRITEDD^TMGXMLE4(FILENUM,FLAGS,.INDS1)  ;"WRITE out data dictionary file
  . . SET INTROSHOWN=1
  . SET EXECFN="DO "_RWRITER_"(.INDS1,.IEN,0)"
  . XECUTE EXECFN  ;"record label writer
  . NEW SUBIENS SET SUBIENS=+IEN_","_IENS
  . DO WRIT1REC^TMGXMLE4(FILENUM,IEN,.FIELDS,.FLAGS,"",SUBIENS,.INDS2,.WRITERS,.SAVFIELDINFO) ;"write out actual record content
  . SET EXECFN="DO "_RWRITER_"(.INDS1,.IEN,1)"
  . XECUTE EXECFN  ;"end record label writer
  . SET PROGCT=PROGCT+1
  . IF SHOWPROG&(PROGCT#2=1) DO
  . . USE $P
  . . DO PROGBAR^TMGUSRI2(PROGCT,"Writing "_FNAME,1,PROGMAX,,STARTTIME)
  . . IF $GET(IO)'="" USE IO
  ;
  IF INTROSHOWN DO
  . SET EXECFN="DO "_WTFILLBL_"(.INDS0,"_FILENUM_","""_FNAME_""",1)"
  . XECUTE EXECFN  ;"e.g. '</FILE>"
  ;
  IF SHOWPROG DO
  . USE $P
  . DO PROGBAR^TMGUSRI2(100,"Writing "_FNAME,1,100)
  . IF $GET(IO)'="" USE IO
  ;
WFDN ;
  QUIT
  ;
WRTSTNGS(FLAGS,INDENTS)  ;"WRITE settings
  ;"Scope: PRIVATE
  ;"Purpose: to output XML output settings.
  ;"Input: FLAGS -- flags as declared above.  Only "i" used here
  ;"       INDENTS -- OPTIONAL -- current string to WRITE to indent line.
  ;"          INDENTS("INCINDENT")=INCINDENT
  ;"NOTE: Uses GLOBAL SCOPED INCINDENT variable.  But setting this is OPTIONAL.
  ;"Results: none
  SET INDENTS=$GET(INDENTS)
  SET FLAGS=$GET(FLAGS)
  NEW INCINDENT SET INCINDENT=$GET(INDENTS("INCINDENT")," ")
  ;
  IF FLAGS["i" WRITE INDENTS
  WRITE "<ExportSettings>",!
  ;
  NEW FARRAY,FL
  SET FARRAY("i")="Indent_Output"
  SET FARRAY("b")="Output_Blanks"
  SET FARRAY("I")="Output_Internal_Values"
  SET FARRAY("D")="Output_Data_Dictionary"
  ;
  SET FL=""
  FOR  SET FL=$ORDER(FARRAY(FL)) QUIT:(FL="")  DO
  . IF FLAGS["i" WRITE INDENTS_INCINDENT
  . WRITE "<Setting id=""",$$SYMENC^MXMLUTL($GET(FARRAY(FL))),""">"
  . WRITE $SELECT((FLAGS[FL):"TRUE",1:"FALSE")
  . WRITE "</Setting>",!
  ;
  IF FLAGS["i" WRITE INDENTS
  WRITE "</ExportSettings>",!
  ;
  QUIT
  ;


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.l1.dao.SizeDao">

	<resultMap type="Size" id="SizeResult">
		<result property="id" column="id"/>
		<result property="name" column="name"/>
		<result property="text" column="text"/>
		<result property="code" column="code"/>
		<result property="stat" column="stat"/>
		<result property="create_by" column="create_by"/>
		<result property="create_time" column="create_time"/>
		<result property="update_by" column="update_by"/>
		<result property="update_time" column="update_time"/>
	</resultMap>

	<select id="find" parameterType="Map" resultMap="SizeResult">
		select * from tb_size
		<where>
			<if test="name!=null and name!='' ">
				and name like #{name}
			</if>
			<if test="code!=null and code!='' ">
				and code like #{code}
			</if>
			<if test="stat!=null and stat!='' ">
				and stat=#{stat}
			</if>
		</where>
		<if test="start!=null and size!=null">
			limit #{start},#{size}
		</if>
	</select>

	<select id="findByIds" parameterType="string" resultMap="SizeResult">
		select * from tb_size
		where id in (#{ids})
	</select>

	<select id="findById" parameterType="int" resultMap="SizeResult">
		select * from tb_size
		where id =#{id}
	</select>

	<select id="findNamesByIds" parameterType="string" resultType="String">
		select name from tb_size
		where id in (#{ids})
	</select>

	<select id="getTotal" parameterType="Map" resultType="Long">
		select count(*) from tb_size
		<where>
			<if test="name!=null and name!='' ">
				and name like #{name}
			</if>
			<if test="code!=null and code!='' ">
				and code like #{code}
			</if>
		</where>
	</select>

	<insert id="add" parameterType="Size">
		insert into tb_size(id,name,text,code,stat,create_time) values(null,#{name},#{name},#{code},#{stat},#{create_time})
	</insert>

	<update id="update" parameterType="Size">
		update tb_size
		<set>
			<if test="name!=null and name!='' ">
				name=#{name},
			</if>

			<if test="name!=null and name!='' ">
				text=#{name},
			</if>

			<if test="code!=null and code!='' ">
				code=#{code},
			</if>
			<if test="stat!=null and stat!='' ">
				stat=#{stat},
			</if>
			<if test="update_time!=null">
				update_time=#{update_time},
			</if>

		</set>
		where id=#{id}
	</update>

	<delete id="delete" parameterType="Integer">
		update tb_size set stat='停用' where id=#{id}
	</delete>
</mapper>


text:
'use strict';

// Employers controller
angular.module('employers').controller('EmployersController', ['$scope', '$stateParams', '$location', 'Authentication', 'Employers',
	function($scope, $stateParams, $location, Authentication, Employers ) {
		$scope.authentication = Authentication;

		// Create new Employer
		$scope.create = function() {
			// Create new Employer object
			var employer = new Employers ({
				name: this.name
			});

			// Redirect after save
			employer.$save(function(response) {
				$location.path('employers/' + response._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});

			// Clear form fields
			this.name = '';
		};

		// Remove existing Employer
		$scope.remove = function( employer ) {
			if ( employer ) { employer.$remove();

				for (var i in $scope.employers ) {
					if ($scope.employers [i] === employer ) {
						$scope.employers.splice(i, 1);
					}
				}
			} else {
				$scope.employer.$remove(function() {
					$location.path('employers');
				});
			}
		};

		// Update existing Employer
		$scope.update = function() {
			var employer = $scope.employer ;

			employer.$update(function() {
				$location.path('employers/' + employer._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Find a list of Employers
		$scope.find = function() {
			$scope.employers = Employers.query();
		};

		// Find existing Employer
		$scope.findOne = function() {
			$scope.employer = Employers.get({
				employerId: $stateParams.employerId
			});
		};
	}
]);