text:
#main {
  display: none;
}

#nav {
  position: fixed;
  top: 0;
  left: 250px;
  right: 0;
  height: 50px;
  background: #79589f;
}

#nav ul {
  margin: 0px;
  padding: 0px;
  height: 50px;
  display: block;
}

#nav ul li {
  margin: 0px;
  padding: 0px;
  float: left;
  height: 49px;
  line-height: 49px;
  font-size: 13px;
  padding: 0px 14px;
  color: #d6cce2;
  font-weight: 500;
  margin: 0 1px;
  cursor: pointer;
  display: block;
  list-style: none;
  list-style-type: none;
}

#nav ul li:first-child {
  margin-left: 0px;
}

#nav ul li:hover {
  color: #fff;
}

#nav ul li.selected {
  position: relative;
  background: #fff;
  color: #000;
  margin: 0;
}

#nav ul li.selected:before {
  content: ' ';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  widows: 100%;
  background: #fff;
}

#nav ul li.selected:first-child {
  border-left: none;
}

#sidebar {
  position: fixed;
  width: 250px;
  left: 0px;
  top: 0px;
  bottom: 0px;
  box-sizing: border-box;
  background: #f9f9f9;
}

#sidebar .current-database {
  position: fixed;
  left: 0px;
  top: 0px;
  width: 250px;
  height: 50px;
  line-height: 50px;
  font-weight: bold;
  font-size: 14px;
  color: #fff;
  background: #79589f;
  z-index: 900;
}

#sidebar .current-database .wrap {
  position: relative;
  height: 50px;
}

#sidebar .current-database span.current-database-name {
  margin-left: 30px;
  display: inline-block;
  width: 200px;
  height: 50px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

#sidebar .current-database i.fa-database {
  position: absolute;
  left: 8px;
  top: 18px;
}

#sidebar .current-database input.typeahead {
  margin-left: 30px;
  display: inline-block;
  width: 200px;
  height: 50px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebar .current-database input.typeahead {
  display: none;
  background: #79589f;
  width: 200px;
  height: 22px;
  color: #fff;
  font-weight: normal;
  outline: none;
  border: 0px none;
}

#sidebar .current-database span.refresh {
  position: absolute;
  top: 0px;
  right: 6px;
  cursor: pointer;
  color: #fff;
  display: none;
}

#sidebar .current-database:hover span.refresh {
  display: inline-block;
}

#sidebar .current-database input.typeahead::-webkit-input-placeholder {
  color: #fff;
}

#sidebar ul.typeahead {
  position: absolute;
  margin-left: 30px;
  overflow-y: auto;
  max-height: 300px;
  z-index: 999;
}

#sidebar ul.typeahead a {
  font-size: 13px;
  padding: 3px 10px;
}

#sidebar .objects-search {
  position: fixed;
  top: 50px;
  left: 0px;
  width: 250px;
  height: 30px;
  overflow: hidden;
}

#sidebar .objects-search .wrap {
  position: relative;
  background: transparent;
  height: 30px;
  padding: 4px;
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
}

#sidebar .objects-search i.fa-search {
  position: absolute;
  left: 8px;
  top: 7px;
  color: #a1a1a1;
}

#sidebar .objects-search i.fa-times-circle {
  position: absolute;
  right: 8px;
  top: 7px;
  color: #a1a1a1;
  display: none;
  cursor: pointer;
}

#sidebar .objects-search i.fa-times-circle:hover {
  color: #888;
}

#sidebar .objects-search input[type="text"] {
  background: transparent;
  border: 0px none;
  font-size: 12px;
  color: #000;
  height: 22px;
  line-height: 22px;
  padding: 0px;
  margin-left: 25px;
  width: 200px;
  outline: none;
}

#sidebar div.tables-list {
  position: fixed;
  width: 250px;
  top: 80px;
  left: 0px;
  bottom: 130px;
  overflow: auto;
}

#sidebar div.tables-list .wrap {
  height: 100%;
  overflow: auto;
}

#sidebar div.tables-list #tables, #sequences, #objects {
  font-size: 12px;
}

#sidebar div.table-information {
  position: fixed;
  width: 250px;
  left: 0px;
  height: 130px;
  bottom: 0px;
  box-sizing: border-box;
  cursor: default;
}

#sidebar div.table-information .wrap {
  height: 100%;
  overflow-y: auto;
}

#sidebar div.table-information .title {
  font-size: 12px;
  text-transform: uppercase;
  color: #aaa;
  line-height: 30px;
  padding: 0px 8px;
  border-top: 1px solid #eee;
}

#sidebar div.table-information .lines {
  display: none;
}

#sidebar div.table-information .lines .line {
  line-height: 24px;
  height: 24px;
  padding: 0 8px 0 8px;
  font-size: 12px;
  color: #7F7E7F !important;
}

#sidebar div.table-information .lines .line span {
  color: #4F4F4F;
  min-width: 0;
  padding-left: 0px;
}

#body {
  position: fixed;
  top: 50px;
  left: 250px;
  bottom: 0px;
  right: 0px;
  overflow: auto;
}

#input {
  height: 255px;
}

#input .wrapper {
  position: relative;
}

#input .actions {
  background: #fff;
  padding: 10px;
  height: 50px;
  border-bottom: solid 1px #ddd;
}

#input .actions #result-rows-count {
  font-size: 12px;
  display: inline-block;
  height: 30px;
  line-height: 30px;
  float: left;
  margin-right: 10px;
  color: #999;
}

#input .actions .btn {
  line-height: 30px;
  height: 30px;
  padding: 0px 13px;
  margin: 0px;
  font-size: 13px;
  color: #555;
  border: none;
  box-shadow: none;
  background: transparent;
  border: 1px solid #999;
  float: left;
  margin-right: 10px;
}

#input .actions .btn-primary {
  border-color: #7eb54e;
  color: #7eb54e;
}

#input .actions .btn:hover {
  background: transparent !important;
  border-color: #444;
  color: #000;
}

#input .actions .btn-primary:hover {
  color: #64903e;
  border-color: #64903e;
}

#input .actions #query_progress {
  display: none;
  float: left;
  line-height: 30px;
  height: 30px;
  color: #aaa;
}

#input .actions .btn:focus {
  outline: 0 none;
  box-shadow: 0;
}

#input .actions .btn:hover {
  background: #7eb154;
}

#input .actions .btn-default:hover {
  background: #bbb;
}

#input .actions .btn:last-child {
  margin-right: 0px;
}

#objects {
}

#output {
  position: absolute;
  left: 0px;
  top: 256px;
  bottom: 0px;
  right: 0px;
  margin: 0px;
  padding: 0px;
  overflow: auto;
}

#pagination {
  display: none;
  position: absolute;
  width: 100%;
  height: 50px;
  padding: 10px;
  top: 0px;
  left: 0px;
  background: #fff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 1px 3px 0px #f1f1f1;
}

#pagination .pager-container {
  float: right;
}

#pagination .filters {
  float: left;
  font-size: 12px;
}

#pagination .filters span {
  display: inline-block;
  float: left;
  font-weight: bold;
  line-height: 32px;
  height: 32px;
  margin: 0px 8px;
  color: #999;
}

#pagination .filters select {
  font-size: 12px;
  width: 100px;
  float: left;
  line-height: 30px;
  height: 30px;
  margin-right: 8px;
  outline: none;
}

#pagination .filters select.column {
  width: 150px;
}

#pagination .filters select.filter {
  width: 100px;
}

#pagination .filters input {
  float: left;
  width: 200px;
  height: 30px;
  line-height: 30px;
  margin-right: 8px;
  font-size: 12px;
}

#pagination .filters .btn-primary {
  border-color: #7eb54e;
  color: #7eb54e;
  background: #fff;
  outline: none;
  float: left;
  margin-right: 8px;
}

#pagination .filters .btn-default {
  float: left;
  outline: none;
}

#pagination .btn-group {
  float: right;
}

#pagination .current-page {
  float: right;
  font-size: 12px;
  margin-right: 12px;
  color: #999;
  line-height: 32px;
  height: 32px;
}

#results {
  font-size: 12px;
  margin: 0px;
  padding: 0px;
}

#results.empty td {
  border: 0px none;
}

#results tr:nth-child(even) > td {
  border: none;
  background: #ffffff;
}

#results tr:nth-child(odd) > td {
  border: none;
  background: #f9f9f9;
}

#results th {
  border-top: none;
  border-bottom: 1px solid #eae9e9;
  padding: 3px 9px;
  line-height: 24px;
  color: #333;
  font-weight: bold;
  cursor: pointer;

  -webkit-font-smoothing: antialiased;
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

#results th:hover {
  background: #f8f8f8;
}

#results th.active {
  background: #f3faff;
}

#results[data-mode="browse"] th:hover {
  cursor: pointer;
  background: #fafafa;
}

#results tbody tr:hover td {
  background: #ffe;
}

#results tbody tr {
  border-bottom: 1px solid #f2f2f2;
}

#results tr.selected td {
  background: #3874d7 !important;
  color: #fff !important;
}

#results td {
  color: #3a3633;
  vertical-align: middle;
  border: 0px none;
}

#results td div {
  max-width: 350px;
  max-height: 51px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
}

#results td div span.null {
  color: #bbb;
  text-transform: uppercase;
}

#results td textarea {
  color: #000 !important;
  font-size: 12px;
}

#results th:first-child,
#results td:first-child {
  padding-left: 15px;
}

#results.no-crop td div {
  max-width: none;
}

.full #output {
  top: 0px !important;
}

.with-pagination #output {
  top: 50px !important;
}

.with-pagination #pagination {
  display: block;
}

.left {
  float: left;
}

/* -------------------------------------------------------------------------- */

#custom_query {
  height: 193px;
  margin-top: 12px;
}

#connection_window {
  z-index: 3;
  position: fixed;
  background: #fff;
  top: 0px;
  left: 0px;
  bottom: 0px;
  right: 0px;
  display: none;
  overflow-y: auto;
}

.connection-actions {
  position: fixed;
  right: 8px;
  top: 10px;
  display: none;
}

#edit_connection, #close_connection {
  background: #79589f;
  color: #fff;
  border-color: #fff;
}

#edit_connection i {
  margin-right: 4px;
}

#close_connection_window {
  display: none;
}

#connection_error {
  display: none;
}

.bookmarks {
  display: none;
}

.connection-settings {
  width: 600px;
  margin: 0px auto;
  margin-top: 50px;
}

.connection-settings .header {
  margin-bottom: 25px;
}

.connection-settings .header h1 {
  text-align: center;
  text-shadow: 0px 1px 0px #fff;
  color: #999;
  font-weight: normal;
}

.connection-settings .header .version {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  display: block;
}

.connection-settings .header .update {
  font-size: 12px;
  text-align: center;
  padding: 4px;
  margin: 12px 0px;
  display: none;
}

.connection-settings form {
  background: #f6f6f6;
  padding: 25px;
  border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
}

.connection-settings form p.help-block {
  font-size: 12px;
}

.connection-settings form .no-left-padding {
  padding-left: 0;
}

.connection-scheme-group {
  display: none;
}

.connection-ssh-group {
  display: none;
  z-index: 1000;
}

.connection-ssh-group h3 {
  font-size: 18px;
  margin: 0px 0px 20px 0px;
  color: #aaa;
}

/* -------------------------------------------------------------------------- */
/* Sidebar Schema Objects */
/* -------------------------------------------------------------------------- */

.schema {}
.schema i                           { display: inline-block; margin-right: 4px; }
.schema i.fa-folder-o               { display: inline-block; }
.schema i.fa-folder-open-o          { display: none; }
.schema.expanded i.fa-folder-open-o { display: inline-block; }
.schema.expanded i.fa-folder-o      { display: none; }

.schema .schema-name {
  font-weight: bold;
  font-size: 13px;
  display: block;
  line-height: 30px;
  height: 30px;
  padding: 0px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.schema .schema-container {
  display: none;
}

.schema.expanded .schema-container {
  display: block;
}

.schema .schema-container .schema-group .fa-chevron-down {
  display: none;
}

.schema .schema-container .schema-group .schema-group-title {
  display: block;
  cursor: pointer;
  line-height: 30px;
  height: 30px;
  padding: 0px 8px;
  overflow: hidden;
}

.schema .schema-container .schema-group .schema-group-count {
  color: #999;
  display: inline-block;
  float: right;
  margin-right: 8px;
}

.schema .schema-container .schema-group ul {
  padding: 0px;
  margin: 0px;
  display: none;
}

.schema .schema-container .schema-group ul li {
  list-style: none;
  list-style-type: none;
  margin: 0px;
  line-height: 30px;
  height: 30px;
  cursor: pointer;
  padding: 0px 8px;
  padding-left: 16px;
  white-space: nowrap;
  overflow: x-scroll;
}

.schema .schema-container .schema-group ul li i {
  color: #999;
}

.schema .schema-container .schema-group ul li.active {
  background: #f1f1f1;
  color: #333;
  font-weight: bold;
}

.schema .schema-container .schema-group ul li:hover {
  background: #f1f1f1;
}

.schema .schema-container .schema-group.expanded .fa-chevron-down {
  display: inline-block;
}

.schema .schema-container .schema-group.expanded .fa-chevron-right {
  display: none;
}

.schema .schema-container .schema-group.expanded ul {
  display: block;
}

/* -------------------------------------------------------------------------- */
/* Ace Customizations */
/* -------------------------------------------------------------------------- */

.ace_gutter, .ace_gutter-cell {
  background: #fff !important;
  color: #bbb;
  font-size: 12px;
}

.ace_content .ace_active-line {
  background: none !important;
}

.ace_autocomplete .ace_active-line {
  background: #eee !important;
}


text:
'use strict';

var _ = require('lodash');

/**
 * @ngdoc directive
 * @name fv.envoy.directives:envoyForm
 * @restrict EAC
 * @scope
 * @param {string=} name Name of this form.  If omitted, the form is *ignored*
 * by Envoy.
 * @description
 *
 * Use this instead of AngularJS'
 *     [`form`](https://docs.angularjs.org/api/ng/directive/form) (or `ngForm`)
 *     directives.
 *
 * Main differences:
 *
 * - It enables tracking of messages on the form.
 * - The controller is replaced with a {@link
  *     fv.envoy.controllers:EnvoyFormController EnvoyFormController}.
 * - The directive creates a new Scope.  See the {@link
  *     fv.envoy.controllers:MessagesFormController#$alias $alias property} for
 *     further information.
 */
function envoyFormDirective(formDirective) {
  return {
    restrict: 'EA',
    /**
     * So this is a little hack.  I'm pretty sure this is not dangerous, but
     * it could be.  The reason for this is that you may have a dynamic form
     * name; something interpolated.  Say, "myForm-2789618".  A FormController
     * will always place itself on the scope if it's given a name.  But it's
     * also handy to be able to reference "myForm".  If form "myForm-87329"
     * shared the same scope with "myForm-2789618", only one "myForm" could
     * exist; thus, we just make a new scope.
     * @type {boolean}
     */
    scope: true,
    name: 'form', // masquerade as a real form directive
    compile: _.first(formDirective).compile,
    controller: require('./formcontroller')
  };
}
envoyFormDirective.$inject = ['formDirective'];

module.exports = envoyFormDirective;

redpajama_set_name: RedPajamaGithub


text:
package com.baomidou.mybatisplus.test.h2.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 测试父类情况
 *
 * @author hubin
 * @since 2016-06-26
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class SuperEntity extends SuSuperEntity implements Serializable {

    /**
	 *  serialVersionUID
	 */
	private static final long serialVersionUID = -3111558058262086115L;

	/* 主键ID 注解,value 字段名,type 用户输入ID */
    @TableId
    private Long testId;

}


text:
<?php

namespace NotificationChannels\HipChat;

class CardAttribute
{
    /**
     * @var string
     */
    public $value;

    /**
     * @var string
     */
    public $label;

    /**
     * @var string
     */
    public $url;

    /**
     * @var string
     */
    public $style;

    /**
     * @var string
     */
    public $icon;

    /**
     * @var string
     */
    public $icon2;

    /**
     * Sets the textual value of the attribute.
     *
     * @param string $value
     * @return $this
     */
    public function value($value)
    {
        $this->value = trim($value);

        return $this;
    }

    /**
     * Sets the label of the attribute.
     *
     * @param string $label
     * @return $this
     */
    public function label($label)
    {
        $this->label = trim($label);

        return $this;
    }

    /**
     * @param string $url
     * @return $this
     */
    public function url($url)
    {
        $this->url = trim($url);

        return $this;
    }

    /**
     * Sets the style for the attribute.
     *
     * @param string $style
     * @return $this
     */
    public function style($style)
    {
        $this->style = trim($style);

        return $this;
    }

    /**
     * Sets the icon for the attribute.
     *
     * @param string $icon
     * @param string|null $icon2
     * @return $this
     */
    public function icon($icon, $icon2 = null)
    {
        $this->icon = trim($icon);

        if (! str_empty($icon2)) {
            $this->icon2 = trim($icon2);
        }

        return $this;
    }

    /**
     * Create a new instance of the attribute.
     *
     * @param string $label
     * @param string $value
     */
    public function __construct($value = null, $label = null)
    {
        $this->value($value);
        $this->label($label);
    }

    /**
     * Create a new instance of the attribute.
     *
     * @param string $value
     * @param string $label
     * @return static
     */
    public static function create($value = null, $label = null)
    {
        return new static($value, $label);
    }

    public function toArray()
    {
        $attribute = [
            'value' => str_array_filter([
                'label' => $this->value,
                'url' => $this->url,
                'style' => $this->style,
            ]),
        ];

        if (! str_empty($this->icon)) {
            $attribute['value']['icon'] = str_array_filter([
                'url' => $this->icon,
                'url@2x' => $this->icon2,
            ]);
        }

        if (! str_empty($this->label)) {
            $attribute['label'] = $this->label;
        }

        return $attribute;
    }
}


text:
import Test from '../helpers/test';
import itsInvalid from '../itsInvalid';
import itsValid from '../itsValid';
import agentSchema from '../helpers/agentSchema';

const agentMember = {
  objectType: 'Agent',
  mbox: 'mailto:test@example.com',
};

export default (test: Test) => {
  itsInvalid(10, 'not an object', test);
  itsInvalid({
    objectType: 'InvalidObjectType',
    mbox: 'mailto:test@example.org',
  }, 'uses invalid objectType', test);
  itsInvalid({
    objectType: 'Group',
    member: [],
  }, 'contains no members', test);
  itsInvalid({
    objectType: 'Group',
    member: [agentMember],
  }, 'contains too few members', test);
  itsInvalid({
    objectType: 'Group',
    member: [agentMember, agentMember],
    mbox: agentMember.mbox
  }, 'contains an mbox on a group', test);
  itsInvalid({
    objectType: 'Group',
    member: [agentMember, agentMember],
    account: {name: 'test', homePage: 'http://example.org'}
  }, 'contains an account on a group', test);
  itsInvalid({
    objectType: 'Group',
    member: [agentMember, agentMember],
    mbox_sha1sum: 'a9993e364706816aba3e25717850c26c9cd0d89d'
  }, 'contains an mbox_sha1sum on a group', test);
  itsInvalid({
    objectType: 'Group',
    member: [agentMember, agentMember],
    openid: 'http://example.org/test'
  }, 'contains an openid on a group', test);
  itsInvalid({
    objectType: 'Group',
    member: [agentMember, agentMember, agentMember],
  }, 'contains too many members', test);
  itsInvalid({
    objectType: 'Group',
    member: [agentMember, {
      objectType: 'Group',
      mbox: 'mailto:test@example.com',
    }],
  }, 'contains group members', test);
  itsValid({
    objectType: 'Group',
    member: [agentMember, agentMember],
  }, test);
  agentSchema(test);
};


text:
package de.tub.ise.benchfoundry.analyzer.model;

import de.tub.ise.benchfoundry.analyzer.model.enums.ResultType;

import java.util.List;

/**
 * @author Joern Kuhlenkamp (j.kuhlenkamp@gmail.com)
 *         Created by on 26.01.17.
 */
public class Measurement {

    private final String node_id;
    private final Long process_id;
    private final Long transaction_id;
    private final Long operation_id;
    private final Long logical_query_id;
    private final Long target_operation_start;
    //private final List<RequestResult> subrequests; //TODO How do we handel subrequests?
    private final Long is_operation_start;
    private final Long is_operation_end;
    private final ResultType result_type;
    private final List<List<String>> operation_result;

    public Measurement(String node_id, Long process_id, Long transaction_id, Long operation_id, Long logical_query_id, Long target_operation_start, Long is_operation_start, Long is_operation_end, ResultType result_type, List<List<String>> operation_result) {
        this.node_id = node_id;
        this.process_id = process_id;
        this.transaction_id = transaction_id;
        this.operation_id = operation_id;
        this.logical_query_id = logical_query_id;
        this.target_operation_start = target_operation_start;
        this.is_operation_start = is_operation_start;
        this.is_operation_end = is_operation_end;
        this.result_type = result_type;
        this.operation_result = operation_result;
    }

    public String getNode_id() {
        return node_id;
    }

    public Long getProcess_id() {
        return process_id;
    }

    public Long getTransaction_id() {
        return transaction_id;
    }

    public Long getOperation_id() {
        return operation_id;
    }

    public Long getTarget_operation_start() {
        return target_operation_start;
    }

    public Long getLogical_query_id() {
        return logical_query_id;
    }

    public Long getIs_operation_start() {
        return is_operation_start;
    }

    public Long getIs_operation_end() {
        return is_operation_end;
    }

    public ResultType getResult_type() {
        return result_type;
    }

    public List<List<String>> getOperation_result() {
        return operation_result;
    }

    /**
     * Returns the request-response latency of the business operation, i.e., the difference between is_operation_end and is_operation_start.
     * @return request-response latency of the business operation.
     */
    public Long getRequestResponseLatency() { return is_operation_end-is_operation_start; }
}


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

public class level1mov : MonoBehaviour {
	public GameObject laserShot,platformUp,platformFront;
	int fps=0;
	int platformUpPosition=-5; int platformUpwardsDirection=1;
	int platformFrontPosition=-4; int platformFrontDirection=-1;

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void FixedUpdate () {
		fps++;
		if (fps % 5 == 0) {
			if (platformUpPosition > 21) {
				platformUpwardsDirection *= -1;
			} else if (platformUpPosition < -5) {
				platformUpwardsDirection *= -1;
			}
			platformUpPosition += platformUpwardsDirection;
		}
		Vector3 upwards = new Vector3 (232, platformUpPosition, 0);
		platformUp.transform.position = upwards;
		if (fps % 6 == 0) {
			if (platformFrontPosition > 0) {
				platformFrontDirection *= -1;
			} else if (platformFrontPosition < -3) {
				platformFrontDirection *= -1;
			}
			platformFrontPosition += platformFrontDirection;
		}
		Vector3 frontBack = new Vector3 (245, 2, platformFrontPosition);
		platformFront.transform.position = frontBack;

		if (fps % 45 == 0) {
			//Debug.Log("RUN "+fps);
			if (fps % 90 == 0) {
				laserShot.active = true;
			} else {
				laserShot.active = false;
			}
		}
	}
}


text:
package gov.nih.nci.caintegrator.application.workspace;

import gov.nih.nci.caintegrator.application.CaIntegrator2BaseService;
import gov.nih.nci.caintegrator.application.study.GenomicDataSourceConfiguration;
import gov.nih.nci.caintegrator.application.study.ImageDataSourceConfiguration;
import gov.nih.nci.caintegrator.application.study.Status;
import gov.nih.nci.caintegrator.application.study.StudyConfiguration;
import gov.nih.nci.caintegrator.application.study.ValidationException;
import gov.nih.nci.caintegrator.application.study.Visibility;
import gov.nih.nci.caintegrator.common.DateUtil;
import gov.nih.nci.caintegrator.common.HibernateUtil;
import gov.nih.nci.caintegrator.common.QueryUtil;
import gov.nih.nci.caintegrator.domain.application.AbstractList;
import gov.nih.nci.caintegrator.domain.application.AbstractPersistedAnalysisJob;
import gov.nih.nci.caintegrator.domain.application.GeneList;
import gov.nih.nci.caintegrator.domain.application.Query;
import gov.nih.nci.caintegrator.domain.application.StudySubscription;
import gov.nih.nci.caintegrator.domain.application.SubjectIdentifier;
import gov.nih.nci.caintegrator.domain.application.SubjectList;
import gov.nih.nci.caintegrator.domain.application.SubjectListCriterion;
import gov.nih.nci.caintegrator.domain.application.UserWorkspace;
import gov.nih.nci.caintegrator.domain.genomic.Platform;
import gov.nih.nci.caintegrator.domain.imaging.ImageSeriesAcquisition;
import gov.nih.nci.caintegrator.domain.translational.Study;
import gov.nih.nci.caintegrator.security.SecurityHelper;
import gov.nih.nci.caintegrator.security.SecurityManager;
import gov.nih.nci.caintegrator.web.DisplayableGenomicSource;
import gov.nih.nci.caintegrator.web.DisplayableImageSource;
import gov.nih.nci.caintegrator.web.DisplayableStudySummary;
import gov.nih.nci.security.exceptions.CSException;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Implementation entry point for the WorkspaceService subsystem.
 */
@Service("workspaceService")
@Transactional(propagation = Propagation.REQUIRED)
public class WorkspaceServiceImpl extends CaIntegrator2BaseService implements WorkspaceService  {

    private static final int MAX_SUBJECT_IDENTIFIER_LEGNTH = 50;
    private SecurityManager securityManager;

    /**
     * {@inheritDoc}
     */
    @Override
    public UserWorkspace getWorkspace() {
        String username = SecurityHelper.getCurrentUsername();
        UserWorkspace userWorkspace = retrieveExistingUserWorkspace(username);
        if (userWorkspace == null) {
            userWorkspace = createUserWorkspace(username);
            saveUserWorkspace(userWorkspace);
        }
        return userWorkspace;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @Transactional(readOnly = true)
    public UserWorkspace getWorkspaceReadOnly() {
        return getWorkspace();
    }

    private UserWorkspace retrieveExistingUserWorkspace(String username) {
        return UserWorkspace.ANONYMOUS_USER_NAME.equals(username) ? null : getDao().getWorkspace(username);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void refreshWorkspaceStudies(UserWorkspace workspace) {
        for (StudySubscription subscription : workspace.getSubscriptionCollection()) {
            subscription.setStudy(getRefreshedEntity(subscription.getStudy()));
            HibernateUtil.loadCollection(subscription.getStudy());
            subscription.getStudy().setStudyConfiguration(
                    getRefreshedEntity(subscription.getStudy().getStudyConfiguration()));
        }
    }

    private UserWorkspace createUserWorkspace(String username) {
        UserWorkspace userWorkspace;
        userWorkspace = new UserWorkspace();
        userWorkspace.setUsername(username);
        return userWorkspace;
    }

    /**
     * @param workspace saves workspace.
     */
    @Override
    public void saveUserWorkspace(UserWorkspace workspace) {
        if (!workspace.isAnonymousUser()) {
            getDao().save(workspace);
        } else {
            fillStudySubscriptionIds(workspace);
        }
    }

    private void fillStudySubscriptionIds(UserWorkspace workspace) {
        int number = 1;
        for (StudySubscription subscription : workspace.getSubscriptionCollection()) {
            subscription.setId(Long.valueOf(number++));
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AbstractPersistedAnalysisJob getPersistedAnalysisJob(Long id) {
        return getDao().get(id, AbstractPersistedAnalysisJob.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public void savePersistedAnalysisJob(AbstractPersistedAnalysisJob job) {
        if (job.getId() == null) {
            getDao().save(job);
        } else {
            getDao().merge(job);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @Transactional(readOnly = true)
    public void subscribeAllReadOnly(UserWorkspace userWorkspace) {
        subscribeAll(userWorkspace);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void subscribeAll(UserWorkspace userWorkspace) {
        List<Study> myStudies = new ArrayList<Study>();
        List<Study> publicStudies = getDao().getPublicStudies();
        if (userWorkspace.isAnonymousUser()) {
            myStudies.addAll(publicStudies);
        } else {
            myStudies.addAll(getDao().getStudies(userWorkspace.getUsername()));
            publicStudies.removeAll(myStudies);
        }
        myStudies.removeAll(publicStudies);
        Set<Study> allVisibleStudies = new HashSet<Study>(myStudies);
        allVisibleStudies.addAll(publicStudies);
        removeOldSubscriptions(userWorkspace, allVisibleStudies);
        subscribeAll(userWorkspace, myStudies, false);
        subscribeAll(userWorkspace, publicStudies, true);
    }

    private void subscribeAll(UserWorkspace userWorkspace, List<Study> studies, boolean isPublicSubscription) {
        for (Study study : studies) {
            subscribe(userWorkspace, study, isPublicSubscription);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Set<StudyConfiguration> retrieveStudyConfigurationJobs(UserWorkspace userWorkspace)
        throws CSException {
        Set<StudyConfiguration> results = securityManager.retrieveManagedStudyConfigurations(
                userWorkspace.getUsername(),
                getDao().getStudies(userWorkspace.getUsername()));
        updateStatus(results);
        return results;
    }

    private void updateStatus(Set<StudyConfiguration> studsyConfigurations) {
        for (StudyConfiguration studyConfiguration : studsyConfigurations) {
            if (Status.PROCESSING.equals(studyConfiguration.getStatus())
                    && DateUtil.isTimeout(studyConfiguration.getDeploymentStartDate(), DateUtil.FOURTY_EIGHT_HOURS)) {
                studyConfiguration.setStatus(Status.ERROR);
                studyConfiguration.setStatusDescription("Timeout after "
                        + DateUtil.FOURTY_EIGHT_HOURS + " hours.");
                getDao().save(studyConfiguration);
            }
        }
    }

    private void removeOldSubscriptions(UserWorkspace userWorkspace, Collection<Study> myStudies) {
        List<Study> oldStudies = new ArrayList<Study>();
        for (StudySubscription studySubscription : userWorkspace.getSubscriptionCollection()) {
            if (!myStudies.contains(studySubscription.getStudy())) {
                oldStudies.add(studySubscription.getStudy());
            }
        }
        for (Study study : oldStudies) {
            unsubscribe(userWorkspace, study);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void subscribe(UserWorkspace workspace, Study study, boolean isPublicSubscription) {
        if (!isSubscribed(workspace, study)) {
            StudySubscription subscription = new StudySubscription();
            subscription.setStudy(study);
            subscription.setPublicSubscription(isPublicSubscription);
            workspace.getSubscriptionCollection().add(subscription);
            saveUserWorkspace(workspace);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void unsubscribe(UserWorkspace workspace, Study study) {
        for (StudySubscription subscription : workspace.getSubscriptionCollection()) {
            if (subscription.getStudy().equals(study)) {
                unsubscribe(workspace, subscription);
                return;
            }
        }
    }

    private void unsubscribe(UserWorkspace workspace, StudySubscription subscription) {
        workspace.getSubscriptionCollection().remove(subscription);
        if (workspace.getDefaultSubscription() != null
                && workspace.getDefaultSubscription().equals(subscription)) {
            workspace.setDefaultSubscription(null);
        }
        saveUserWorkspace(workspace);
        if (!workspace.isAnonymousUser()) {
            getDao().delete(subscription);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void unsubscribeAll(Study study) {
        List<UserWorkspace> workspaces = getDao().retrieveAllSubscribedWorkspaces(study);
        if (workspaces != null && !workspaces.isEmpty()) {
            for (UserWorkspace workspace : workspaces) {
                unsubscribe(workspace, study);
            }
        }
    }

    private boolean isSubscribed(UserWorkspace workspace, Study study) {
        for (StudySubscription subscription : workspace.getSubscriptionCollection()) {
            if (subscription.getStudy().equals(study)) {
                return true;
            }
        }
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Set<Platform> retrievePlatformsInStudy(Study study) {
        Set<Platform> allPlatforms = new HashSet<Platform>();
        for (GenomicDataSourceConfiguration genomicSource : study.getStudyConfiguration().getGenomicDataSources()) {
            allPlatforms.addAll(getDao().retrievePlatformsForGenomicSource(genomicSource));
        }
        return allPlatforms;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @Transactional(readOnly = true)
    public DisplayableStudySummary createDisplayableStudySummary(Study study) {
        DisplayableStudySummary studySummary = new DisplayableStudySummary(study);
        if (studySummary.isImagingStudy()) {
            addImagingData(studySummary);
        }
        if (studySummary.isGenomicStudy()) {
            addGenomicData(studySummary);
        }
        return studySummary;
    }

    private void addImagingData(DisplayableStudySummary studySummary) {
        for (ImageDataSourceConfiguration imageDataSource
                : studySummary.getStudy().getStudyConfiguration().getImageDataSources()) {
            DisplayableImageSource displayableImageSource = new DisplayableImageSource(imageDataSource);
            for (ImageSeriesAcquisition imageSeriesAcquisition : imageDataSource.getImageSeriesAcquisitions()) {
                if (imageSeriesAcquisition.getAssignment() != null) {
                    displayableImageSource.setNumberImageStudies(displayableImageSource.getNumberImageStudies() + 1);
                    displayableImageSource.setNumberImageSeries(displayableImageSource.getNumberImageSeries()
                            + imageSeriesAcquisition.getSeriesCollection().size());
                    displayableImageSource.setNumberImages(displayableImageSource.getNumberImages()
                            + getDao().retrieveNumberImages(imageSeriesAcquisition.getSeriesCollection()));
                }
            }
            studySummary.getImageDataSources().add(displayableImageSource);
        }
    }

    private void addGenomicData(DisplayableStudySummary studySummary) {
        for (GenomicDataSourceConfiguration genomicConfig
                : studySummary.getStudy().getStudyConfiguration().getGenomicDataSources()) {
            DisplayableGenomicSource displayableGenomicSource = new DisplayableGenomicSource(genomicConfig);
            List<Platform> platforms = getDao().retrievePlatformsForGenomicSource(genomicConfig);
            if (platforms != null && !platforms.isEmpty()) {
                displayableGenomicSource.getPlatforms().addAll(platforms);
            }
            studySummary.getGenomicDataSources().add(displayableGenomicSource);
        }
    }

    /**
     * @return the securityManager
     */
    public SecurityManager getSecurityManager() {
        return securityManager;
    }

    /**
     * @param securityManager the securityManager to set
     */
    @Autowired
    public void setSecurityManager(SecurityManager securityManager) {
        this.securityManager = securityManager;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void createGeneList(GeneList geneList, Set<String> geneSymbols) {
        for (String symbol : geneSymbols) {
            geneList.getGeneCollection().add(getDao().lookupOrCreateGene(symbol));
        }
        saveAbstractList(geneList);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void createSubjectList(SubjectList subjectList, Set<String> subjects) throws ValidationException {
        for (String subject : subjects) {
            if (MAX_SUBJECT_IDENTIFIER_LEGNTH < subject.length()) {
                throw new ValidationException("The identifier '" + subject + "' exceeds the maximum length of "
                        + MAX_SUBJECT_IDENTIFIER_LEGNTH);
            }
            subjectList.getSubjectIdentifiers().add(new SubjectIdentifier(subject));
        }
        saveAbstractList(subjectList);
    }

    private void saveAbstractList(AbstractList abstractList) {
        if (Visibility.GLOBAL.equals(abstractList.getVisibility())) {
            abstractList.getStudyConfiguration().getListCollection().add(abstractList);
        } else {
            abstractList.getSubscription().getListCollection().add(abstractList);
        }
        saveUserWorkspace(getWorkspace());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void makeListGlobal(AbstractList abstractList) {
        abstractList.setVisibility(Visibility.GLOBAL);
        abstractList.getSubscription().getListCollection().remove(abstractList);
        abstractList.getStudyConfiguration().getListCollection().add(abstractList);
        UserWorkspace userWorkspace = abstractList.getSubscription().getUserWorkspace();
        abstractList.setSubscription(null);
        saveUserWorkspace(userWorkspace);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void makeListPrivate(AbstractList abstractList) {
        abstractList.setVisibility(Visibility.PRIVATE);
        abstractList.getStudyConfiguration().getListCollection().remove(abstractList);
        abstractList.getSubscription().getListCollection().add(abstractList);
        abstractList.setStudyConfiguration(null);
        saveUserWorkspace(abstractList.getSubscription().getUserWorkspace());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void deleteAbstractList(StudySubscription subscription, AbstractList abstractList) {
        if (abstractList instanceof SubjectList) {
            for (Query query : subscription.getQueryCollection()) {
                Set<SubjectListCriterion> subjectListCriteria =
                    QueryUtil.getCriterionTypeFromQuery(query, SubjectListCriterion.class);
                for (SubjectListCriterion subjectListCriterion : subjectListCriteria) {
                    subjectListCriterion.getSubjectListCollection().remove(abstractList);
                }
            }
        }
        if (Visibility.GLOBAL.equals(abstractList.getVisibility())) {
            abstractList.getStudyConfiguration().getListCollection().remove(abstractList);
        } else {
            abstractList.getSubscription().getListCollection().remove(abstractList);
        }
        getDao().delete(abstractList);
        saveUserWorkspace(getWorkspace());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void clearSession() {
        getDao().clearSession();
    }

}


text:
#include "nrfx.h"
#include "hal/nrf_nvmc.h"

void nrf_peripherals_power_init(void) {
    // Set GPIO reference voltage to 3.3V if it isn't already. REGOUT0 will get reset to 0xfffffff
    // if flash is erased, which sets the default to 1.8V
    // This matters only when "high voltage mode" is enabled, which is true on the PCA10059,
    // and might be true on other boards.
    if (NRF_UICR->REGOUT0 == 0xffffffff && NRF_POWER->MAINREGSTATUS & 1) {
        // Expand what nrf_nvmc_word_write() did.
        // It's missing from nrfx V2.0.0, and nrfx_nvmc_word_write() does bounds
        // checking which prevents writes to UICR.
        // Reported: https://devzone.nordicsemi.com/f/nordic-q-a/57243/nrfx_nvmc-h-api-cannot-write-to-uicr
        NRF_NVMC->CONFIG = NRF_NVMC_MODE_WRITE;
        while (!(NRF_NVMC->READY & NVMC_READY_READY_Msk)) {}
        NRF_UICR->REGOUT0 = UICR_REGOUT0_VOUT_3V3 << UICR_REGOUT0_VOUT_Pos;
        __DMB();
        while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
        NRF_NVMC->CONFIG = NRF_NVMC_MODE_READONLY;

        // Must reset to enable change.
        NVIC_SystemReset();
    }
}


text:
import { ADD_TODO, REMOVE_TODO } from '../actionTypes/todos'

const initialTodos = [
  { id: 0, text: 'TODO #0' },
  { id: 1, text: 'TODO #1' }
]
const initialState = { todoList: initialTodos, idCounter: 1 }

export default function todoReducer (state = initialState, action) {
  switch (action.type) {
    case ADD_TODO:
      return {
        ...state,
        todoList: [
          ...state.todoList,
          { text: action.payload, id: state.idCounter + 1 }
        ],
        idCounter: state.idCounter + 1
      }
    case REMOVE_TODO:
      return {
        ...state,
        todoList: state.todoList.filter(todo => todo.id !== action.payload)
      }
    default:
      return state
  }
}


text:
from distutils.core import setup

setup(
    name='similarities',
    version='0.1',
    author='C Bates',
    author_email='chrsbats@gmail.com',
    packages=['similarities'],
    scripts=[],
    url='https://github.com/chrsbats/similarities',
    license='LICENSE.TXT',
    description='A collection of similarity metrics and hashes',
    long_description='A utility library containing hashes and distance metrics used in information retrieval.',
    install_requires=[
        "scurve==0.2",
        "xxhash==0.3.2"
    ],
)


text:
drop table if exists gh_ost_test;
create table gh_ost_test (
  id int auto_increment,
  c1 int not null,
  c2 int not null,
  primary key (id)
) auto_increment=1;

drop event if exists gh_ost_test;
delimiter ;;
create event gh_ost_test
  on schedule every 1 second
  starts current_timestamp
  ends current_timestamp + interval 60 second
  on completion not preserve
  enable
  do
begin
  insert into gh_ost_test values (null, 11, 23);
  insert into gh_ost_test values (null, 13, 23);
  insert into gh_ost_test values (null, floor(rand()*pow(2,32)), floor(rand()*pow(2,32)));
end ;;


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Recordings** | [**[]ApiV2010CallRecording**](ApiV2010CallRecording.md) |  |[optional]
**End** | **int** |  |[optional]
**FirstPageUri** | **string** |  |[optional]
**NextPageUri** | **string** |  |[optional]
**Page** | **int** |  |[optional]
**PageSize** | **int** |  |[optional]
**PreviousPageUri** | **string** |  |[optional]
**Start** | **int** |  |[optional]
**Uri** | **string** |  |[optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
// Licensed under the Apache License, Version 2.0

package com.flingtap.done.util;

import com.flingtap.done.base.R;

import android.content.ContentResolver;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.provider.OpenableColumns;

/**
 * Logic for extracting label and image info about a URI.
 */
public class UriInfo {

	private String label = null;
	private Intent.ShortcutIconResource iconResource = null;
	private Bitmap iconBitmap = null;

	public UriInfo(Intent standardIntent, Uri data, ContentResolver cr, PackageManager pm, Resources resources, String name){
		label = name;

		if( null != data ){
			String mimeType = cr.getType(data);
			if( null == label && null != mimeType ){
				// We know that the content provider should support OpenableColumns.

				Cursor openableCursor = cr.query(data, null, null, null, null);
				int columnIndex = openableCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
				if( -1 != columnIndex ){
					if( openableCursor.moveToFirst()){
						label = openableCursor.getString(columnIndex);
					}
				}
				openableCursor.close();

			}
		}
		if( label == null ){
			ResolveInfo resolveInfo = pm.resolveActivity(standardIntent, PackageManager.MATCH_DEFAULT_ONLY);
			if( null != resolveInfo ){
				CharSequence charSeqLabel = pm.getApplicationLabel(resolveInfo.activityInfo.applicationInfo);
				if( null != charSeqLabel ){  // Use application name.
					label = charSeqLabel.toString();
				}else if( null != data ){ // Use URI authority for unknown attachment name.
					label = data.getAuthority();
				}else{
					label = resources.getText(R.string.unknown).toString();
				}

				setupIconResource(pm, resolveInfo);

			}
		}

		// *********************
		// Find icon
		// *********************
		if( null == iconResource ){
			ResolveInfo resolveInfo = pm.resolveActivity(standardIntent, PackageManager.MATCH_DEFAULT_ONLY);
			if( null != resolveInfo ){
				setupIconResource(pm, resolveInfo);
			}
		}

		if( null == iconResource ){
			Drawable activityIcon = null;
			try {
				activityIcon = pm.getActivityIcon(standardIntent);

				if (activityIcon instanceof BitmapDrawable) { // Determine whether
																// activityIcon is
																// the default icon
																// so we can use our
																// own default icon.
					Bitmap defaultIconBitmap = ((BitmapDrawable) (pm.getDefaultActivityIcon())).getBitmap();
					if (defaultIconBitmap.equals(((BitmapDrawable) activityIcon).getBitmap())) {
						iconResource = new Intent.ShortcutIconResource();
						iconResource.packageName = resources.getResourcePackageName(R.drawable.question);
						iconResource.resourceName = resources.getResourceName(R.drawable.question);
					}else{
						iconBitmap = ((BitmapDrawable) activityIcon).getBitmap();
					}
				}else{
					// Cannot persist drawables that are not:
					//  - A resource
					//  - A Bitmap

				}
			} catch (NameNotFoundException e) {
				iconResource = new Intent.ShortcutIconResource();
				iconResource.packageName = resources.getResourcePackageName(R.drawable.question);
				iconResource.resourceName = resources.getResourceName(R.drawable.question);
			}
		}
	}

	private void setupIconResource(PackageManager pm, ResolveInfo resolveInfo) {
		Resources resources = null;
		try {
			resources = pm.getResourcesForApplication(resolveInfo.activityInfo.packageName);

			// Icon
			int id = resolveInfo.getIconResource();
			if( 0 == id ){
				return;
			}
			iconResource = new Intent.ShortcutIconResource();
			iconResource.packageName = resources.getResourcePackageName(id);
			iconResource.resourceName = resources.getResourceName(id);
		} catch (NameNotFoundException e) {
			// Ignore
		}

	}

	public String getLabel() {
		return label;
	}

	public Intent.ShortcutIconResource getIconResource() {
		return iconResource;
	}

	public Bitmap getIconBitmap() {
		return iconBitmap;
	}

}


text:
require("should");

module.exports = function(data) {
    data.should.not.equal(null);
    data.should.instanceOf(Object);

    data.should.have.property('code');
    data.code.should.be.String();

    data.should.have.property('name');
    data.name.should.be.String();

    data.should.have.property('remark');
    data.remark.should.be.String();
};


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated 2015-12-11 12:05:29 by Hibernate Tools 4.3.1.Final -->
<hibernate-mapping package="com.openscoring.mgr.model">
    <class name="FileMeta" table="ifx_file_meta" catalog="credit">

    	<cache usage="read-write"/>

        <id name="uuid" type="string">
            <column name="UUID" length="32" />
            <generator class="assigned" />
        </id>
        <property name="pmmlUuid" type="string">
            <column name="PMMLUUID" length="32" />
        </property>
        <property name="fileName" type="string">
            <column name="FILENAME" length="32" />
        </property>
        <property name="fileSize" type="string">
            <column name="FILESIZE" length="32"/>
        </property>
        <property name="fileType" type="string">
            <column name="FILETYPE" length="80" />
        </property>
        <property name="modelName" type="string">
            <column name="MODELNAME" length="80" />
        </property>
        <property name="effectDate" type="date">
            <column name="EFFECT_DATE" length="10" />
        </property>
        <property name="modelDesc" type="string">
            <column name="MODEL_DESC" length="2000" />
        </property>
        <property name="status" type="string">
            <column name="STATUS" length="45" />
        </property>
    </class>
</hibernate-mapping>


text:
<project name="jmdns" default="help" basedir=".">
	<target name="init">
		<mkdir dir="${dest}" />
		<tstamp />
	</target>

	<property name="src" value="./src/main/java" />
	<property name="tools" value="./src/sample/java" />
	<property name="samples" value="./src/sample/java" />
	<property name="lib" value="./lib" />
	<property name="test" value="./src/test/java" />
	<property name="build" value="./build" />
	<property name="dest" value="${build}/classes" />
	<property name="reports" value="${build}/reports" />
	<property name="buildlib" value="${build}/lib" />
	<property name="doc" value="${build}/docs" />
	<property name="jdk" value="1.6" />
	<property name="version" value="3.4.0" />
	<property name="release" value="${build}/jmdns-${version}" />

	<target name="help" description="Prints brief help message to screen">
		<echo message="usage:" />
		<echo message="  ant TARGET where TARGET is one of the following:" />
		<echo message="      build   --- Compiles the JmDNS sources. Including the tools" />
		<echo message="      test    --- Compiles the JmDNS tests and runs them against JmDNS" />
		<echo message="      tools   --- Compiles the tools: The browser and main class" />
		<echo message="      samples --- Compiles the samples in the samples package" />
		<echo message="      jar     --- Creates the jmdns.jar file " />
		<echo message="      bundle  --- Creates OSGi javax.jmdns_${version}.jar bundle" />
		<echo message="      javadoc --- Creates the javadoc docs " />
		<echo message="      release --- Creates a release " />
		<echo message="      clean   --- Cleanup time! " />
		<echo message="      help    --- This message " />
	</target>

	<target name="build" depends="init" description="compile the generated source">
		<javac target="${jdk}" srcdir="${src}" destdir="${dest}" debug="true">
			<compilerarg value="-Xlint" />
			<include name="javax/**/*.java" />
		</javac>
	</target>

	<target name="tools" depends="build" description="Main program">
		<javac target="${jdk}" srcdir="${tools}" destdir="${dest}">
			<compilerarg value="-Xlint" />
			<include name="com/**/tools/*.java" />
		</javac>
	</target>

	<target name="samples" depends="build" description="Sample programs">
		<javac target="${jdk}" srcdir="${samples}" destdir="${dest}">
			<compilerarg value="-Xlint" />
			<include name="samples/*.java" />
		</javac>
	</target>

	<target name="jar" depends="build,tools" description="Jar the files">
		<mkdir dir="${buildlib}" />
		<jar destfile="${buildlib}/jmdns.jar" manifest="${lib}/jmdns.manifest" basedir="${dest}">
			<fileset dir="${dest}" defaultexcludes="yes">
				<include name="**/*.class" />
				<exclude name="**/test/*.class" />
			</fileset>
		</jar>
	</target>

	<target name="bundle" description="Creates an OSGi bundle" depends="jar">
		<get src="http://www.aqute.biz/repo/biz/aQute/bnd/0.0.401/bnd-0.0.401.jar" dest="${lib}/bnd.jar" ignoreerrors="true" />
		<taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${lib}/bnd.jar" />
		<echo file="${build}/jmdns.bnd" append="false">
				Bundle-Version: ${version}
				Bundle-Name: JmDNS is a java implementation of the IETF draft RFP multicast extensions for DNS
				Bundle-SymbolicName: javax.jmdns
				Bundle-Vendor: jmdns.sourceforge.net
				Bundle-RequiredExecutionEnvironment: J2SE-${jdk}

				Private-Package: com.strangeberry.jmdns.tools,samples

				Import-Package:

				Export-Package: javax.jmdns;version=${version}
			</echo>
		<bndwrap definitions="${build}" jars="${buildlib}/jmdns.jar" output="${buildlib}/javax.jmdns_${version}.jar" />
	</target>

	<target name="javadoc" depends="build" description="Create the java doc">
		<mkdir dir="${doc}" />
		<javadoc destdir="${doc}" author="true" version="true" header="JmDNS ${version}" windowtitle="JmDNS">
			<fileset dir="${src}" defaultexcludes="yes">
				<include name="javax/**/*.java" />
			</fileset>
			<fileset dir="${samples}" defaultexcludes="yes">
				<include name="com/**/*.java" />
			</fileset>
			<doctitle><![CDATA[
JmDNS
]]></doctitle>
		</javadoc>
	</target>

	<target name="release" depends="build,tools,javadoc,jar,bundle" description="Create a release">
		<delete dir="${release}" includeEmptyDirs="true"  failonerror="false" />
		<mkdir dir="${release}" />
		<copy todir="${release}">
			<fileset dir="." includes="CHANGELOG.txt" />
			<fileset dir="." includes="NOTICE.txt" />
			<fileset dir="." includes="LICENSE" />
			<fileset dir="." includes="build.xml" />
			<fileset dir="." includes="fulllogging.properties" />
		</copy>
		<mkdir dir="${release}/lib" />
		<copy todir="${release}/lib">
			<fileset dir="${buildlib}" includes="jmdns.jar" />
		</copy>
		<mkdir dir="${release}/src" />
		<copy todir="${release}/src">
			<fileset dir="${src}" includes="**/*.java" />
			<fileset dir="${test}" includes="**/*.java" />
			<fileset dir="${samples}" includes="**/*.java" />
		</copy>
		<mkdir dir="${release}/docs" />
		<copy todir="${release}/docs">
			<fileset dir="${doc}" includes="**/*" />
		</copy>
		<zip destfile="${release}.zip">
			<fileset dir="${release}" includes="**/*" />
		</zip>
		<tar destfile="${release}.tar">
			<tarfileset dir="${release}" includes="**/*" />
		</tar>
		<gzip destfile="${release}.tgz" src="${release}.tar" />
	</target>

	<target name="clean">
		<delete dir="${build}" includeEmptyDirs="true"  failonerror="false" />
	</target>

	<path id="jmdns.classpath">
		<fileset dir="${lib}">
			<include name="*.jar" />
		</fileset>
		<fileset dir="${buildlib}">
			<include name="*.jar" />
		</fileset>
	</path>

	<target name="test" depends="build, jar">
		<mkdir dir="${reports}" />
		<get src="http://repo2.maven.org/maven2/junit/junit/4.8.1/junit-4.8.1.jar" usetimestamp="yes" dest="${lib}/junit.jar" ignoreerrors="true" />
		<get src="http://repo2.maven.org/maven2/org/easymock/easymock/3.0/easymock-3.0.jar" usetimestamp="yes" dest="${lib}/easymock.jar" ignoreerrors="true" />
		<get src="http://repo2.maven.org/maven2/cglib/cglib-nodep/2.2/cglib-nodep-2.2.jar" usetimestamp="yes" dest="${lib}/cglib-nodep.jar" ignoreerrors="true" />
		<get src="http://repo2.maven.org/maven2/org/objenesis/objenesis/1.2/objenesis-1.2.jar" usetimestamp="yes" dest="${lib}/objenesis.jar" ignoreerrors="true" />

		<javac target="${jdk}" srcdir="${test}" destdir="${dest}">
			<compilerarg value="-Xlint" />
			<classpath refid="jmdns.classpath" />
		</javac>

		<junit printsummary="yes" haltonfailure="no" showoutput="yes">
			<classpath>
				<pathelement path="${dest}" />
				<fileset dir="${lib}">
					<include name="**/*.jar" />
				</fileset>
			</classpath>

			<batchtest fork="yes" todir="${reports}">
				<formatter type="xml" />
				<formatter type="brief" usefile="false" />
				<fileset dir="${test}">
					<include name="**/*.java" />
				</fileset>
			</batchtest>
		</junit>
		<junitreport todir="${reports}">
			<fileset dir="${reports}">
				<include name="TEST-*.xml" />
			</fileset>
			<report todir="${reports}" />
		</junitreport>
	</target>

</project>


text:
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\models\Banners;

/**
 * BannersSearch represents the model behind the search form about `backend\models\Banners`.
 */
class BannersSearch extends Banners
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'id_place', 'interval'], 'integer'],
            [['size'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Banners::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'id_place' => $this->id_place,
            'interval' => $this->interval,
        ]);

        $query->andFilterWhere(['like', 'size', $this->size]);

        return $dataProvider;
    }
}


text:
<!DOCTYPE html>

		<title>Unicorn Admin</title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/font-awesome.css" />
		<link rel="stylesheet" href="css/icheck/flat/blue.css" />
		<link rel="stylesheet" href="css/select2.css" />
		<link rel="stylesheet" href="css/unicorn.css" />

Unicorn Admin

 Profile

 Messages 5

Messages

		                                3 mins ago

	                                    Nunc Cenenatis

	                                    Hi, can you meet me at the office tomorrow morning?

		                                3 mins ago

	                                    Nunc Cenenatis

	                                    Hi, can you meet me at the office tomorrow morning?

		                                3 mins ago

	                                    Nunc Cenenatis

	                                    Hi, can you meet me at the office tomorrow morning?

 Settings

 Logout

Theme Options

Colors

Layout Type

                	Flat
                    Old

				<input type="text" placeholder="Search here..."/><button type="submit" class="tip-right" title="Search"></button>

 Dashboard

					 UI Lab

Interface Elements

jQuery UI

Buttons & icons

					 Form elements

Common elements

Validation

Wizard

 Tables

 Grid Layout

					 Sample pages

Invoice

Support chat

Calendar

Gallery

Messages

					 Charts & graphs

					 Widgets

Form validation

					5

				 Home
				Form elements
				Validation

Basic validation

								48 notices

								<form class="form-horizontal" method="post" action="#" name="basic_validate" id="basic_validate" novalidate="novalidate">

                                        Required Field

                                            <input type="text" class="form-control input-sm" name="required" id="required">

                                        Email

                                            <input type="text" class="form-control input-sm" name="email" id="email">

                                        Date

                                            <input type="text" class="form-control input-sm" name="date" id="date">

                                        URL

                                            <input type="text" class="form-control input-sm" name="url" id="url">

                                        <input type="submit" value="Validate" class="btn btn-primary">

                                </form>

Number validation

								<form class="form-horizontal" method="post" action="#" name="number_validate" id="number_validate" novalidate="novalidate">

										Minimal value

											<input type="text" class="form-control input-sm" name="min" id="min" />

										Maximum value

											<input type="text" class="form-control input-sm" name="max" id="max" />

										Only number

											<input type="text" class="form-control input-sm" name="number" id="number" />

										<input type="submit" value="Validate" class="btn btn-primary">

								</form>

Password validation

								<form class="form-horizontal" method="post" action="#" name="password_validate" id="password_validate" novalidate="novalidate">

										Password

											<input type="password" class="form-control input-sm" name="pwd" id="pwd" />

										Confirm password

											<input type="password" class="form-control input-sm" name="pwd2" id="pwd2" />

										<input type="submit" value="Validate" class="btn btn-primary">

								</form>

				2012 - 2013 © Unicorn Admin. Brought to you by diablo9983


text:
import sqlite3
from itertools import groupby

def create_table(db, table_name, columns, primary_key=None):
    """Create a table with the given columns and, optionally, primary key.

    *columns* is a map from column name to type
    *primary_key* is a list of column names
    """

    col_def_sql = ', '.join('`{}` {}'.format(col_name, col_type)
                            for col_name, col_type in sorted(columns.items()))

    # optional PRIMARY KEY
    primary_key_sql = ''
    if primary_key:
        primary_key_sql = ', PRIMARY KEY({})'.format(col_sql(primary_key))

    create_sql = 'CREATE TABLE `{}` ({}{})'.format(
        table_name, col_def_sql, primary_key_sql)

    db.execute(create_sql)

def create_index(db, table_name, index_cols):
    if isinstance(index_cols, str):
        raise TypeError

    index_name = '_'.join([table_name] + list(index_cols))
    index_sql = 'CREATE INDEX `{}` ON `{}` ({})'.format(
            index_name, table_name, ', '.join(
                '`{}`'.format(ic) for ic in index_cols))

    db.execute(index_sql)

def col_sql(col_names):
    """Convert a list of column names to SQL."""
    return ', '.join('`{}`'.format(col_name) for col_name in col_names)

def insert_row(db, table_name, row):
    col_names, values = list(zip(*sorted(row.items())))

    insert_sql = 'INSERT INTO `{}` ({}) VALUES ({})'.format(
        table_name,
        col_sql(col_names),
        ', '.join('?' for _ in col_names))

    db.execute(insert_sql, values)

def open_db(path):
    """Open the sqlite database at the given path
    Use sqlite3.Row as our row_factory to wrap rows like dicts.
    """
    db = sqlite3.connect(path)
    db.row_factory = sqlite3.Row
    return db

def select_groups(db, table_name, key_cols, cols=None):
    """Select all rows in the given table. Yield tuples of
    (key, [rows]), where key is the values of the various key
    columns, and rows is a list of all rows with those values, as dicts.
    """
    if isinstance(key_cols, str):
        raise TypeError

    from_cols_sql = col_sql(cols) if cols else '*'
    key_sql = col_sql(key_cols)

    select_sql = 'SELECT {} FROM `{}` ORDER BY {}'.format(
        from_cols_sql, table_name, key_sql)

    for key, rows in groupby(
            db.execute(select_sql),
            key=lambda r: tuple(r[kc] for kc in key_cols)):

        yield key, [dict(row) for row in rows]

def show_tables(db):
    """List the tables in the given db."""
    sql = "SELECT name FROM sqlite_master WHERE type = 'table'"
    return sorted(row[0] for row in db.execute(sql))