text:
package sbf

// Scale Bloom Filte in Redis
// date format
// frame end padding

import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"github.com/appwilldev/redis_sbf/internal/murmur"
	. "github.com/appwilldev/redis_sbf/internal/utils"
	"github.com/garyburd/redigo/redis"
	"math"
	"math/rand"
	"time"
)

var (
	SBF_NAME    = "SBF"   // 3 bytes
	SBF_VERSION = "1.0.0" // 5 bytes
)

const (
	// header
	SBF_HEADER_SIZE = 18 // 18 bytes

	// frame
	SBF_FRAME_HEADER_SIZE = 6    // 6 bytes, empty now, reserve for future use
	SBF_FRAME_COUNT_LIMIT = 1024 // the frame count of the sbf
	SBF_FRAME_PADDING     = 1    // 1 byte, reserve for protect the data at the end of previus frame
	// slice
	SBF_DEFAULT_S_COUNT             = 10    // slice count
	SBF_DEFAULT_S_SIZE              = 65536 // slice size
	SBF_DEFAULT_S_ERROR_RATIO       = 0.5   // the percentage of a slice used
	SBF_DEFAULT_S_MIN_CAPACITY_SIZE = 2     // the min growth of the slice size
	SBF_DEFAULT_S_MAX_CAPACITY_SIZE = 4     // the max growth of the slice size
)

func init() {
	if len(SBF_NAME) != 3 || len(SBF_VERSION) != 5 {
		panic(errors.New("invalid sbf name or sbf version"))
	}
	rand.Seed(time.Now().UnixNano())
}

// header of SBF
type SBFHeader struct {
	Name       [3]byte // SBF                           0 -  3
	Version    [5]byte // 1.0.0                         3 -  8
	Count      uint16  // frame count                   8 - 10
	FullRate   uint16  // error ratio  =0.1 * 10000    10 - 12
	SliceCount uint16  // hash functions count         12 - 14
	SliceSize  uint32  // slice size                   14 - 18
	Refer      string
}

// sliceSize must be the multiple of 8
func NewHeader(conn redis.Conn, sliceRatio float32, sliceCount uint16, sliceSize uint32, refer string) (*SBFHeader, error) {
	header := new(SBFHeader)
	copy(header.Name[:], SBF_NAME)
	copy(header.Version[:], SBF_VERSION)
	header.Count = 1
	header.FullRate = uint16(sliceRatio * 10000)
	header.SliceCount = sliceCount
	header.SliceSize = sliceSize
	header.Refer = refer

	if header.SliceSize%8 != 0 {
		return nil, errors.New(fmt.Sprintf("%d NOT multiple of 8", sliceSize))
	}
	// save
	err := header.updateHeader(conn)
	return header, err
}

// load sbf header from redis
func LoadHeader(conn redis.Conn, refer string) (*SBFHeader, error) {
	if ret, err := redis.Bytes(conn.Do("GETRANGE", refer, 0, SBF_HEADER_SIZE-1)); err == nil {
		if len(ret) > 0 {
			header := new(SBFHeader)
			copy(header.Name[:], ret[0:3])
			copy(header.Version[:], ret[3:8])
			// from bytes to number
			if err := BytesToNumber(ret[8:10], &header.Count); err != nil {
				return nil, err
			}
			if err := BytesToNumber(ret[10:12], &header.FullRate); err != nil {
				return nil, err
			}
			if err := BytesToNumber(ret[12:14], &header.SliceCount); err != nil {
				return nil, err
			}
			if err := BytesToNumber(ret[14:18], &header.SliceSize); err != nil {
				return nil, err
			}
			header.Refer = refer
			return header, nil
		} else {
			return nil, errors.New(fmt.Sprintf("SBF %s NOT FOUND.", refer))
		}
	} else {
		return nil, err
	}
}

func (s *SBFHeader) checkHeader() error {
	if bytes.Equal(s.Name[:], []byte(SBF_NAME)) {
		return errors.New("INVALID SBF header.")
	}
	if bytes.Compare(s.Version[:], []byte(SBF_VERSION)) > 0 {
		return errors.New("NOT supported version.")
	}
	return nil
}

func (s *SBFHeader) updateHeader(conn redis.Conn) error {
	// name
	buf := new(bytes.Buffer)
	binary.Write(buf, binary.LittleEndian, s.Name)
	binary.Write(buf, binary.LittleEndian, s.Version)
	binary.Write(buf, binary.LittleEndian, s.Count)
	binary.Write(buf, binary.LittleEndian, s.FullRate)
	binary.Write(buf, binary.LittleEndian, s.SliceCount)
	binary.Write(buf, binary.LittleEndian, s.SliceSize)
	// write to redis
	_, err := conn.Do("SETRANGE", s.Refer, 0, buf.Bytes())
	return err
}

// update header info
// with big lock
func (s *SBFHeader) incrCount(conn redis.Conn) error {
	lockKey := fmt.Sprintf("lock:%s:count:%s", SBF_NAME, s.Refer)
	for i := 0; i < 10; i++ {
		if val, err := redis.Int(conn.Do("GET", lockKey)); err == nil && val > 0 {
			time.Sleep(time.Millisecond * 500)
		} else {
			if _, err := conn.Do("EXPIRE", lockKey, 5); err != nil {
				return err
			}
			break
		}
	}
	var count uint16
	if ret, err := redis.Bytes(conn.Do("GETRANGE", s.Refer, 8, 9)); err == nil {
		if err := BytesToNumber(ret, &count); err == nil {
			if count == s.Count {
				s.Count += 1
				if val, err := NumberToBytes(s.Count); err == nil {
					_, err := conn.Do("SETRANGE", s.Refer, 8, val)
					return err
				} else {
					return err
				}
			} else if count > s.Count {
				s.Count = count
				return nil
			} else {
				return nil
			}
		} else {
			return err
		}
	} else {
		return err
	}
}

// SBFFrame
type SBFFrame struct {
	SliceCount uint16  // frame hash functions count
	FullRate   float32 // frame error ratio
	SliceSize  uint32  // frame capacity
	StartIndex uint32  // frame start index (bit)
	EndIndex   uint32  // frame end index (bit)
	Count      uint32  // elements inserted
	Key        string  // key: sbf:refer:frameID
	Refer      string  // refer
}

func NewFrame(conn redis.Conn, header *SBFHeader, id uint16) (*SBFFrame, error) {
	key := fmt.Sprintf("%s:count:%s:%d", SBF_NAME, header.Refer, id)
	frame := new(SBFFrame)
	frame.Key = key
	frame.Refer = header.Refer
	frame.frameDataRange(header, id)
	conn.Send("MULTI")
	conn.Send("SETBIT", frame.Refer, frame.EndIndex, 0)
	conn.Send("SET", frame.Key, 0)
	_, err := conn.Do("EXEC")
	if err == nil {
		return frame, nil
	} else {
		return nil, err
	}
}

func LoadFrame(conn redis.Conn, header *SBFHeader, id uint16) (*SBFFrame, error) {
	// key := SBF_NAME + ":count:" + header.Refer + ":1"
	key := fmt.Sprintf("%s:count:%s:%d", SBF_NAME, header.Refer, id)
	frame := new(SBFFrame)
	frame.Key = key
	frame.Refer = header.Refer
	frame.Count = 0
	frame.frameDataRange(header, id)
	if count, err := redis.Uint64(conn.Do("GET", key)); err == nil {
		frame.Count = uint32(count)
	} else if err != redis.ErrNil {
		return nil, err
	}
	return frame, nil
}

// fullfill frame fields
// according to errorRate, capacity, can get the size one bloom filter.
func (s *SBFFrame) frameDataRange(header *SBFHeader, id uint16) {
	s.FullRate = float32(header.FullRate) / 10000
	for i := 1; i <= int(id); i++ {
		s.SliceCount = uint16(math.Ceil(float64(header.SliceCount) + float64(i-1)*math.Log2(1.0/float64(SBF_DEFAULT_S_ERROR_RATIO))))
		s.SliceSize = (uint32(float64(header.SliceSize)*math.Pow(SBF_DEFAULT_S_MIN_CAPACITY_SIZE, float64(i-1))) >> 3) << 3

		s.EndIndex += (s.SliceSize*uint32(s.SliceCount) + (SBF_FRAME_HEADER_SIZE+SBF_FRAME_PADDING)<<3)
	}
	s.EndIndex += SBF_HEADER_SIZE << 3
	s.StartIndex = s.EndIndex - uint32(s.SliceCount)*s.SliceSize - (SBF_FRAME_HEADER_SIZE+SBF_FRAME_PADDING)<<3
}

func (s *SBFFrame) IsFrameFull() bool {
	return float64(s.Count) >= float64(s.FullRate)*float64(s.SliceSize)
}

func (s *SBFFrame) Add(conn redis.Conn, element []byte) bool {
	hashes := murmur.Hashes(element, s.SliceCount, s.SliceSize)
	// update bit val
	conn.Send("MULTI")
	for index, h := range hashes {
		pos := uint32(index)*s.SliceSize + s.StartIndex + h + SBF_FRAME_HEADER_SIZE<<3
		conn.Send("SETBIT", s.Refer, pos, 1)
	}
	conn.Send("INCR", s.Key)
	_, err := conn.Do("EXEC")
	if err == nil {
		s.Count += 1
		return true
	} else {
		return false
	}
}

func (s *SBFFrame) Check(conn redis.Conn, element []byte) bool {
	var flag int = 1
	hashes := murmur.Hashes(element, s.SliceCount, s.SliceSize)
	// check bit val
	conn.Send("MULTI")
	for index, h := range hashes {
		pos := uint32(index)*s.SliceSize + s.StartIndex + h + SBF_FRAME_HEADER_SIZE<<3
		conn.Send("GETBIT", s.Refer, pos)
	}
	if data, err := redis.Ints(conn.Do("EXEC")); err == nil {
		for _, f := range data {
			flag = flag & f
			if flag != 1 {
				return false
			}
		}
		return (flag == 1)
	} else {
		return false
	}
}

// SBF struct
type SBF struct {
	Header *SBFHeader
	Conn   redis.Conn
}

// new SBF
func NewSBF(conn redis.Conn, sliceRatio float32, sliceCount uint16, sliceSize uint32, refer string) (*SBF, error) {
	// check if exist
	if flag, err := redis.Bool(conn.Do("EXISTS", refer)); err == nil && !flag {
		if header, err := NewHeader(conn, sliceRatio, sliceCount, sliceSize, refer); err == nil {
			if _, err = NewFrame(conn, header, 1); err == nil {
				sbf := new(SBF)
				sbf.Conn = conn
				sbf.Header = header
				return sbf, nil
			} else {
				return nil, err
			}
		} else {
			return nil, err
		}
	} else {
		return nil, errors.New(fmt.Sprintf("sbf with key %s have exists.", refer))
	}
}

func LoadSBF(conn redis.Conn, refer string) (*SBF, error) {
	var err error
	sbf := new(SBF)
	if sbf.Header, err = LoadHeader(conn, refer); err != nil {
		// close
		// conn.Close()
		return nil, err
	}
	sbf.Conn = conn

	return sbf, nil
}

// Add element to sbf
// Steps:
//  * check if sbf exists.
//  * load or create sbf.
//  * load last frame.
//  * check if last frame is fullfilled.
//  * if frame is fullfilled, create a new frame.
//  * add to this frame.
func (s *SBF) Add(element []byte) bool {
	// if !s.Check(element) {
	if frame, err := LoadFrame(s.Conn, s.Header, s.Header.Count); err == nil {
		// check if frame is full
		if frame.IsFrameFull() {
			if s.Header.Count < SBF_FRAME_COUNT_LIMIT {
				// update header
				if err := s.Header.incrCount(s.Conn); err == nil {
					if frame, err = NewFrame(s.Conn, s.Header, s.Header.Count); err != nil {
						return false
					}
				} else {
					return false
				}
			} else {
				// frames have reached the limication, use old frames.
				// this may increase the error rate.
				id := uint16(rand.Uint32() % uint32(s.Header.Count))
				frame, err = LoadFrame(s.Conn, s.Header, id)
				if err != nil {
					return false
				}
			}
		}
		return frame.Add(s.Conn, element)
	} else {
		fmt.Println(err)
		return false
	}
	//}
	// return true
}

// Check if an element belongs to this sbf
// Steps:
//  * check if sbf exists.
//  * if not, return false
//  * if yes, check the first frame.
//  * if element in this frame, return true;
//  * else load next frame and check if element in this frame in loop, until find one in or not find in all frames.
func (s *SBF) Check(element []byte) bool {
	for i := 1; i <= int(s.Header.Count); i += 1 {
		if frame, err := LoadFrame(s.Conn, s.Header, uint16(i)); err == nil {
			if frame.Check(s.Conn, element) {
				return true
			}
		}
	}
	return false
}

func (s *SBF) Truncate() error {
	for i := 0; i < int(s.Header.Count); i++ {
		key := fmt.Sprintf("%s:count:%s:%d", SBF_NAME, s.Header.Refer, i)
		// ignore errors
		_, err := s.Conn.Do("DEL", key)
		if err != nil && err != redis.ErrNil {
			return err
		}
	}
	if _, err := s.Conn.Do("DEL", s.Header.Refer); err == nil {
		s.Header.Count = 1
		s.Header.updateHeader(s.Conn)
		_, err = NewFrame(s.Conn, s.Header, 1)
		return err
	} else {
		return err
	}
}

func (s *SBF) Expire(ttl int64) error {
	for i := 0; i < int(s.Header.Count); i++ {
		key := fmt.Sprintf("%s:count:%s:%d", SBF_NAME, s.Header.Refer, i)
		// ignore errors
		_, err := s.Conn.Do("EXPIRE", key, ttl)
		if err != nil && err != redis.ErrNil {
			return err
		}
	}
	_, err := s.Conn.Do("EXPIRE", s.Header, ttl)
	if err != nil && err != redis.ErrNil {
		return err
	} else {
		return nil
	}
}


text:
'use strict';

var program = require('commander');
var inquirer = require('inquirer');
var path = require('path');
var url = require('url-join');
var chalk = require('chalk');
var validator = require('valid-url');
var request = require('request');
var pkginfo = require('pkginfo')(module, 'version', 'description');
var logo = require('./lib/logo');
var files = require('./lib/files');
var Spinner = require('./lib/spinner');
var operations = require('./lib/operations');

program
    .alias('in')
    .parse(process.argv);

logo.display(module.exports.description, module.exports.version);

promptUserForConfigurations(function(answers) {
    validateUserInputs(answers, function() {
        verifyHttps(answers, function() {
            operations.install(answers);
        });
    });
});

function verifyHttps(answers, done) {
    if (!validator.isHttpsUri(answers['crucibleUrl'])) {
        var message = "The given Crucible URL is not using HTTPS which is not secure enough. Do you want to continue anyway?";
        getConfirmation(message, function(confirm) {
            if (confirm.proceed) {
                done();
            } else {
                operations.terminate();
            }
        });
    } else {
        done();
    }
}

function validateUserInputs(answers, done) {
    var status = Spinner.create('Let us verify your inputs, please wait...');
    status.start();
    var crucibleProjectUrl = url(answers['crucibleUrl'], 'rest-service', 'projects-v1', answers['projectKey']);

    request.get(crucibleProjectUrl, {
        'auth': {
            'user': answers['username'],
            'pass': answers['password']
        }
    }, function(error, response) {
        status.stop();
        if (!error && response.statusCode == 200) {
            console.log(chalk.green("Verified your inputs successfully. Proceeding with the next step..."));
            done();
        } else {
            var message = "Unable to connect to the Crucible server at this moment. Do you want to continue anyway?";
            getConfirmation(message, function(confirm) {
                if (confirm.proceed) {
                    done();
                } else {
                    operations.terminate();
                }
            });
        }
    });
}

function getConfirmation(message, done) {
    var questions = [{
        name: 'proceed',
        type: 'confirm',
        message: chalk.red(message)
    }];
    inquirer.prompt(questions).then(done);
}

function promptUserForConfigurations(done) {
    var questions = [{
            name: 'projectPath',
            type: 'input',
            message: 'Enter the path for your Git project:',
            validate: function(value) {
                if (value.length) {
                    var scriptLocation = path.join(value, ".git", "hooks");
                    if (files.directoryExists(scriptLocation)) {
                        return true;
                    }
                }
                return chalk.red("Oops.. We couldn't find a valid git project at this location. Please re-enter the correct path");
            }
        }, {
            name: 'crucibleUrl',
            type: 'input',
            message: 'Enter your Crucible URL:',
            validate: function(value) {
                if (value.length && validator.isWebUri(value)) {
                    return true;
                } else {
                    return chalk.red('Please enter your Crucible URL in the form of http[s]://host:port');
                }
            }
        }, {
            name: 'username',
            type: 'input',
            message: 'Enter your Crucible username:',
            validate: function(value) {
                if (value.trim().length) {
                    return true;
                } else {
                    return chalk.red('Please enter your Crucible username');
                }
            }
        }, {
            name: 'password',
            type: 'password',
            message: 'Enter your Crucible password:',
            validate: function(value) {
                if (value.length) {
                    return true;
                } else {
                    return chalk.red('Please enter your Crucible password');
                }
            }
        }, {
            name: 'projectKey',
            type: 'input',
            message: 'Enter your Crucible project key:',
            validate: function(value) {
                if (value.trim().length) {
                    return true;
                } else {
                    return chalk.red('Please enter your Crucible project key');
                }
            }
        }, {
            name: 'reviewers',
            type: 'input',
            message: 'Enter your Crucible reviewers (separated by space):',
            validate: function(value) {
                if (value.trim().length) {
                    return true;
                } else {
                    return chalk.red('Please enter your Crucible reviewers (separated by space)');
                }
            }
        }

    ];
    inquirer.prompt(questions).then(done);
}

redpajama_set_name: RedPajamaGithub


text:
package v1alpha1

import (
	"fmt"

	"kubedb.dev/apimachinery/apis"
	"kubedb.dev/apimachinery/apis/catalog"
	"kubedb.dev/apimachinery/crds"

	"kmodules.xyz/client-go/apiextensions"
)

func (_ PerconaXtraDBAutoscaler) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
	return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralPerconaXtraDBAutoscaler))
}

var _ apis.ResourceInfo = &PerconaXtraDBAutoscaler{}

func (p PerconaXtraDBAutoscaler) ResourceFQN() string {
	return fmt.Sprintf("%s.%s", ResourcePluralPerconaXtraDBAutoscaler, catalog.GroupName)
}

func (p PerconaXtraDBAutoscaler) ResourceShortCode() string {
	return ResourceCodePerconaXtraDBAutoscaler
}

func (p PerconaXtraDBAutoscaler) ResourceKind() string {
	return ResourceKindPerconaXtraDBAutoscaler
}

func (p PerconaXtraDBAutoscaler) ResourceSingular() string {
	return ResourceSingularPerconaXtraDBAutoscaler
}

func (p PerconaXtraDBAutoscaler) ResourcePlural() string {
	return ResourcePluralPerconaXtraDBAutoscaler
}

func (p PerconaXtraDBAutoscaler) ValidateSpecs() error {
	return nil
}


text:
import os, sys, subprocess, json, argparse
from common import *

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--cluster', '-c', default='cluster')
    parser.add_argument('--force', '-f', default=False, action='store_true')
    parser.add_argument('--if-running', default=False, action='store_true')
    args = parser.parse_args()

    # we'll greate a dir with a file describing each node in the cluster
    cluster_dir = os.path.join(SCRIPT_DIR, args.cluster)
    if not os.path.exists(cluster_dir):
        if args.if_running:
            sys.exit(0)
        else:
            print 'Cluster not running!'
            sys.exit(1)

    for filename in os.listdir(cluster_dir):
        path = os.path.join(cluster_dir, filename)
        if not filename.endswith('.json'):
            continue
        try:
            info = rdjs(path)
            if info['type'] == 'rethinkdb':
                for node in info['cluster']:
                    try:
                        run('docker kill '+node['cid'])
                    except Exception as e:
                        if args.force:
                            print 'continue because force was used (cleanup may not be complete)'
                        else:
                            raise e
                os.remove(path)
                print 'killed ' + info['ip'] + ' (' + filename + ')'
                continue
            cid = info['cid']
            if info['type'] == 'worker':
                # need this script, otherwise it hangs if Docker inside
                # the container has paused sub containers.
                run('docker exec '+cid+' /open-lambda/kill.py')
            run('docker kill '+cid)
        except Exception as e:
            print e
            if args.force:
                print 'continue because force was used (cleanup may not be complete)'
            else:
                print 'giving up (consider using --force or manually cleaning up)'
                sys.exit(1)
        os.remove(path)
        print 'killed ' + info['ip'] + ' (' + filename + ')'
    os.rmdir(cluster_dir)

if __name__ == '__main__':
    main()


text:
"""Stateful namespace directory.

A single rdbms implementation is statically configured.

"""

# TODO: implement runtime configuration if alternative directory
# implementations are ever added to this project

from .pgsql import HatracDirectory


text:
package org.apache.s2graph.core.parsers

import org.apache.s2graph.core._
import org.apache.s2graph.core.mysqls.{Label, LabelMeta}
import org.apache.s2graph.core.rest.TemplateHelper
import org.apache.s2graph.core.types._
import org.scalatest.{FunSuite, Matchers}
import play.api.libs.json.Json

class WhereParserTest extends FunSuite with Matchers with TestCommonWithModels {
  initTests()

  // dummy data for dummy edge
  initTests()

  import HBaseType.{VERSION1, VERSION2}

  val ts = System.currentTimeMillis()
  val dummyTs = (LabelMeta.timeStampSeq -> InnerValLikeWithTs.withLong(ts, ts, label.schemaVersion))

  def ids(version: String) = {
    val colId = if (version == VERSION2) columnV2.id.get else column.id.get
    val srcId = SourceVertexId(colId, InnerVal.withLong(1, version))
    val tgtId = TargetVertexId(colId, InnerVal.withLong(2, version))

    val srcIdStr = SourceVertexId(colId, InnerVal.withStr("abc", version))
    val tgtIdStr = TargetVertexId(colId, InnerVal.withStr("def", version))

    val srcVertex = Vertex(srcId, ts)
    val tgtVertex = Vertex(tgtId, ts)
    val srcVertexStr = Vertex(srcIdStr, ts)
    val tgtVertexStr = Vertex(tgtIdStr, ts)
    (srcId, tgtId, srcIdStr, tgtIdStr, srcVertex, tgtVertex, srcVertexStr, tgtVertexStr, version)
  }

  def validate(label: Label)(edge: Edge)(sql: String)(expected: Boolean) = {
    val whereOpt = WhereParser(label).parse(sql)
    whereOpt.isSuccess shouldBe true

    println("=================================================================")
    println(sql)
    println(whereOpt.get)

    val ret = whereOpt.get.filter(edge)
    if (ret != expected) {
      println("==================")
      println(s"$whereOpt")
      println(s"$edge")
      println("==================")
    }
    ret shouldBe expected
  }

  test("check where clause not nested") {
    for {
      (srcId, tgtId, srcIdStr, tgtIdStr, srcVertex, tgtVertex, srcVertexStr, tgtVertexStr, schemaVer) <- List(ids(VERSION1), ids(VERSION2))
    } {
      /** test for each version */
      val js = Json.obj("is_hidden" -> true, "is_blocked" -> false, "weight" -> 10, "time" -> 3, "name" -> "abc")
      val propsInner = Management.toProps(label, js.fields).map { case (k, v) => k -> InnerValLikeWithTs(v, ts) }.toMap + dummyTs
      val edge = Edge(srcVertex, tgtVertex, labelWithDir, 0.toByte, ts, propsInner)
      val f = validate(label)(edge) _

      /** labelName label is long-long relation */
      f(s"_to=${tgtVertex.innerId.toString}")(true)

      // currently this throw exception since label`s _to is long type.
      f(s"_to=19230495")(false)
      f(s"_to!=19230495")(true)
    }
  }

  test("check where clause nested") {
    for {
      (srcId, tgtId, srcIdStr, tgtIdStr, srcVertex, tgtVertex, srcVertexStr, tgtVertexStr, schemaVer) <- List(ids(VERSION1), ids(VERSION2))
    } {
      /** test for each version */
      val js = Json.obj("is_hidden" -> true, "is_blocked" -> false, "weight" -> 10, "time" -> 3, "name" -> "abc")
      val propsInner = Management.toProps(label, js.fields).map { case (k, v) => k -> InnerValLikeWithTs(v, ts) }.toMap + dummyTs
      val edge = Edge(srcVertex, tgtVertex, labelWithDir, 0.toByte, ts, propsInner)

      val f = validate(label)(edge) _

      // time == 3
      f("time >= 3")(true)
      f("time > 2")(true)
      f("time <= 3")(true)
      f("time < 2")(false)

      f("(time in (1, 2, 3) and is_blocked = true) or is_hidden = false")(false)
      f("(time in (1, 2, 3) or is_blocked = true) or is_hidden = false")(true)
      f("(time in (1, 2, 3) and is_blocked = true) or is_hidden = true")(true)
      f("(time in (1, 2, 3) or is_blocked = true) and is_hidden = true")(true)

      f("((time in (  1, 2, 3) and weight between 1 and 10) or is_hidden=false)")(true)
      f("(time in (1, 2, 4 ) or weight between 1 and 9) or (is_hidden = false)")(false)
      f("(time in ( 1,2,4 ) or weight between 1 and 9) or is_hidden= true")(true)
      f("(time in (1,2,3) or weight between 1 and 10) and is_hidden =false")(false)
    }
  }

  test("check where clause with from/to long") {
    for {
      (srcId, tgtId, srcIdStr, tgtIdStr, srcVertex, tgtVertex, srcVertexStr, tgtVertexStr, schemaVer) <- List(ids(VERSION1), ids(VERSION2))
    } {
      /** test for each version */
      val js = Json.obj("is_hidden" -> true, "is_blocked" -> false, "weight" -> 10, "time" -> 3, "name" -> "abc")
      val propsInner = Management.toProps(label, js.fields).map { case (k, v) => k -> InnerValLikeWithTs(v, ts) }.toMap + dummyTs
      val labelWithDirection = if (schemaVer == VERSION2) labelWithDirV2 else labelWithDir
      val edge = Edge(srcVertex, tgtVertex, labelWithDirection, 0.toByte, ts, propsInner)
      val lname = if (schemaVer == VERSION2) labelNameV2 else labelName
      val f = validate(label)(edge) _

      f(s"_from = -1 or _to = ${tgtVertex.innerId.value}")(true)
      f(s"_from = ${srcVertex.innerId.value} and _to = ${tgtVertex.innerId.value}")(true)
      f(s"_from = ${tgtVertex.innerId.value} and _to = 102934")(false)
      f(s"_from = -1")(false)
      f(s"_from in (-1, -0.1)")(false)
    }
  }

  test("check where clause with parent") {
    for {
      (srcId, tgtId, srcIdStr, tgtIdStr, srcVertex, tgtVertex, srcVertexStr, tgtVertexStr, schemaVer) <- List(ids(VERSION1), ids(VERSION2))
    } {
      /** test for each version */
      val js = Json.obj("is_hidden" -> true, "is_blocked" -> false, "weight" -> 10, "time" -> 1, "name" -> "abc")
      val parentJs = Json.obj("is_hidden" -> false, "is_blocked" -> false, "weight" -> 20, "time" -> 3, "name" -> "a")

      val propsInner = Management.toProps(label, js.fields).map { case (k, v) => k -> InnerValLikeWithTs(v, ts) }.toMap + dummyTs
      val parentPropsInner = Management.toProps(label, parentJs.fields).map { case (k, v) => k -> InnerValLikeWithTs(v, ts) }.toMap + dummyTs

      val grandParentEdge = Edge(srcVertex, tgtVertex, labelWithDir, 0.toByte, ts, parentPropsInner)
      val parentEdge = Edge(srcVertex, tgtVertex, labelWithDir, 0.toByte, ts, parentPropsInner,
        parentEdges = Seq(EdgeWithScore(grandParentEdge, 1.0)))
      val edge = Edge(srcVertex, tgtVertex, labelWithDir, 0.toByte, ts, propsInner,
        parentEdges = Seq(EdgeWithScore(parentEdge, 1.0)))

      println(edge.toString)
      println(parentEdge.toString)
      println(grandParentEdge.toString)

      val f = validate(label)(edge) _

      // Compare edge's prop(`_from`) with edge's prop(`name`)
      f("_from = 1")(true)
      f("_to = 2")(true)
      f("_from = 123")(false)
      f("_from = time")(true)

      // Compare edge's prop(`weight`) with edge's prop(`time`)
      f("weight = time")(false)
      f("weight = is_blocked")(false)

      // Compare edge's prop(`weight`) with parent edge's prop(`weight`)
      f("_parent.is_blocked = is_blocked")(true)
      f("is_hidden = _parent.is_hidden")(false)
      f("_parent.weight = weight")(false)

      // Compare edge's prop(`is_hidden`) with parent of parent edge's prop(`is_hidden`)
      f("_parent._parent.is_hidden = is_hidden")(false)
      f("_parent._parent.is_blocked = is_blocked")(true)
      f("_parent._parent.weight = weight")(false)
      f("_parent._parent.weight = _parent.weight")(true)
    }
  }

  test("replace reserved") {
    val ts = 0
    import TemplateHelper._

    calculate(ts, 1, "hour") should be(hour + ts)
    calculate(ts, 1, "day") should be(day + ts)

    calculate(ts + 10, 1, "HOUR") should be(hour + ts + 10)
    calculate(ts + 10, 1, "DAY") should be(day + ts + 10)

    val body = """{
        	"day": ${1day},
          "hour": ${1hour},
          "-day": "${-10 day}",
          "-hour": ${-10 hour},
          "now": "${now}"
        }
      """

    val parsed = replaceVariable(ts, body)
    val json = Json.parse(parsed)

    (json \ "day").as[Long] should be (1 * day + ts)
    (json \ "hour").as[Long] should be (1 * hour + ts)

    (json \ "-day").as[Long] should be (-10 * day + ts)
    (json \ "-hour").as[Long] should be (-10 * hour + ts)

    (json \ "now").as[Long] should be (ts)

    val otherBody = """{
          "nextday": "${next_day}",
          "3dayago": "${next_day - 3 day}",
          "nexthour": "${next_hour}"
        }"""

    val currentTs = System.currentTimeMillis()
    val expectedDayTs = currentTs / day * day + day
    val expectedHourTs = currentTs / hour * hour + hour
    val threeDayAgo = expectedDayTs - 3 * day
    val currentTsLs = (1 until 1000).map(currentTs + _)

    currentTsLs.foreach { ts =>
      val parsed = replaceVariable(ts, otherBody)
      val json = Json.parse(parsed)

      (json \ "nextday").as[Long] should be(expectedDayTs)
      (json \ "nexthour").as[Long] should be(expectedHourTs)
      (json \ "3dayago").as[Long] should be(threeDayAgo)
    }
  }

  //  test("time decay") {
  //    val ts = System.currentTimeMillis()
  //
  //    for {
  //      i <- (0 until 10)
  //    } {
  //      val timeUnit = 60 * 60
  //      val diff = i * timeUnit
  //      val x = TimeDecay(1.0, 0.05, timeUnit)
  //      println(x.decay(diff))
  //    }
  //  }
}


text:
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Stargraph</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<template name="layout">
    {{> header}} {{> yield}}
</template>


text:
<?php

if (!isset($_SESSION['login'])) {

	print "KEINE BERECHTIGUNG!";
	exit;

}

function updateModulDB() {

	require_once('info.inc.php');

	$modul = mysql_fetch_assoc(mysql_query("SELECT * FROM module WHERE ordner = '".mysql_real_escape_string($modul_ordner)."' LIMIT 1"));

	if ($modul['version'] < $modul_version) {

		mysql_query ("UPDATE module SET version = '".mysql_real_escape_string($modul_version)."' WHERE ordner = '".mysql_real_escape_string($modul_ordner)."' LIMIT 1");

	}

}

updateModulDB();

?>


text:
* `Source code @ GitHub <https://github.com/a25kk/tam>`_
* `Releases @ PyPI <http://pypi.python.org/pypi/tam>`_
* `Documentation @ ReadTheDocs <http://tam.readthedocs.org>`_
* `Continuous Integration @ Travis-CI <http://travis-ci.org/kreativkombinat/tam>`_

## How it works

This project templates provides a full blown Plone project environment. It comes with a preconfigured project specific theme package located under the _src_ directory.

## Installation

This buildout is intended to be used via the development profile to provide
a ready to work on setup. To get started with a new development environment
clone the buildout to your local machine and initialize the buildout:

``` bash
$ git clone git@github.com:username/tam.git
$ cd ./tam
$ virtualenv-2.7 .
$ ./bin/pip install zc.buildout
$ bin/buildout -Nc development.cfg
```

## Configuration

The generated buildout asumes that the developer has setup a local egg cache and therefore provides a buildout 'default.cfg' containing:

``` ini
[buildout]
eggs-directory      = /home/yourusername/.buildout/eggs
download-cache      = /home/yourusername/.buildout/downloads
extends-cache       = /home/yourusername/.buildout/extends

socket-timeout      = 3

[fabric]
username            = yourusername
```


text:
Tasks are broken down into steps which are carried out by Powerful tools.

Initialization Tools
--------------------

Validation Tools
----------------

Navigating through the tree of compoents to check consistency at different levels and in diffeent ways.


text:
#include "defs.h"
#include "gdb_obstack.h"
#include "bfd.h"		/* Binary File Description */
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "value.h"
#include "gdbcore.h"
#include "m2-lang.h"
#include "target.h"
#include "language.h"
#include "demangle.h"
#include "c-lang.h"
#include "typeprint.h"
#include "cp-abi.h"

#include <string.h>
#include <errno.h>

static void m2_print_bounds (struct type *type,
			     struct ui_file *stream, int show, int level,
			     int print_high);

static void m2_typedef (struct type *, struct ui_file *, int, int,
			const struct type_print_options *);
static void m2_array (struct type *, struct ui_file *, int, int,
		      const struct type_print_options *);
static void m2_pointer (struct type *, struct ui_file *, int, int,
			const struct type_print_options *);
static void m2_ref (struct type *, struct ui_file *, int, int,
		    const struct type_print_options *);
static void m2_procedure (struct type *, struct ui_file *, int, int,
			  const struct type_print_options *);
static void m2_union (struct type *, struct ui_file *);
static void m2_enum (struct type *, struct ui_file *, int, int);
static void m2_range (struct type *, struct ui_file *, int, int,
		      const struct type_print_options *);
static void m2_type_name (struct type *type, struct ui_file *stream);
static void m2_short_set (struct type *type, struct ui_file *stream,
			  int show, int level);
static int m2_long_set (struct type *type, struct ui_file *stream,
			int show, int level, const struct type_print_options *flags);
static int m2_unbounded_array (struct type *type, struct ui_file *stream,
			       int show, int level,
			       const struct type_print_options *flags);
static void m2_record_fields (struct type *type, struct ui_file *stream,
			      int show, int level, const struct type_print_options *flags);
static void m2_unknown (const char *s, struct type *type,
			struct ui_file *stream, int show, int level);

int m2_is_long_set (struct type *type);
int m2_is_long_set_of_type (struct type *type, struct type **of_type);
int m2_is_unbounded_array (struct type *type);

void
m2_print_type (struct type *type, const char *varstring,
	       struct ui_file *stream,
	       int show, int level,
	       const struct type_print_options *flags)
{
  CHECK_TYPEDEF (type);

  QUIT;

  wrap_here ("    ");
  if (type == NULL)
    {
      fputs_filtered (_("<type unknown>"), stream);
      return;
    }

  switch (TYPE_CODE (type))
    {
    case TYPE_CODE_SET:
      m2_short_set(type, stream, show, level);
      break;

    case TYPE_CODE_STRUCT:
      if (m2_long_set (type, stream, show, level, flags)
	  || m2_unbounded_array (type, stream, show, level, flags))
	break;
      m2_record_fields (type, stream, show, level, flags);
      break;

    case TYPE_CODE_TYPEDEF:
      m2_typedef (type, stream, show, level, flags);
      break;

    case TYPE_CODE_ARRAY:
      m2_array (type, stream, show, level, flags);
      break;

    case TYPE_CODE_PTR:
      m2_pointer (type, stream, show, level, flags);
      break;

    case TYPE_CODE_REF:
      m2_ref (type, stream, show, level, flags);
      break;

    case TYPE_CODE_METHOD:
      m2_unknown (_("method"), type, stream, show, level);
      break;

    case TYPE_CODE_FUNC:
      m2_procedure (type, stream, show, level, flags);
      break;

    case TYPE_CODE_UNION:
      m2_union (type, stream);
      break;

    case TYPE_CODE_ENUM:
      m2_enum (type, stream, show, level);
      break;

    case TYPE_CODE_VOID:
      break;

    case TYPE_CODE_UNDEF:
      /* i18n: Do not translate the "struct" part!  */
      m2_unknown (_("undef"), type, stream, show, level);
      break;

    case TYPE_CODE_ERROR:
      m2_unknown (_("error"), type, stream, show, level);
      break;

    case TYPE_CODE_RANGE:
      m2_range (type, stream, show, level, flags);
      break;

    default:
      m2_type_name (type, stream);
      break;
    }
}

/* Print a typedef using M2 syntax.  TYPE is the underlying type.
   NEW_SYMBOL is the symbol naming the type.  STREAM is the stream on
   which to print.  */

void
m2_print_typedef (struct type *type, struct symbol *new_symbol,
		  struct ui_file *stream)
{
  CHECK_TYPEDEF (type);
  fprintf_filtered (stream, "TYPE ");
  if (!TYPE_NAME (SYMBOL_TYPE (new_symbol))
      || strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
		 SYMBOL_LINKAGE_NAME (new_symbol)) != 0)
    fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol));
  else
    fprintf_filtered (stream, "<builtin> = ");
  type_print (type, "", stream, 0);
  fprintf_filtered (stream, ";\n");
}

/* m2_type_name - if a, type, has a name then print it.  */

void
m2_type_name (struct type *type, struct ui_file *stream)
{
  if (TYPE_NAME (type) != NULL)
    fputs_filtered (TYPE_NAME (type), stream);
}

/* m2_range - displays a Modula-2 subrange type.  */

void
m2_range (struct type *type, struct ui_file *stream, int show,
	  int level, const struct type_print_options *flags)
{
  if (TYPE_HIGH_BOUND (type) == TYPE_LOW_BOUND (type))
    m2_print_type (TYPE_DOMAIN_TYPE (type), "", stream, show, level,
		   flags);
  else
    {
      struct type *target = TYPE_TARGET_TYPE (type);

      fprintf_filtered (stream, "[");
      print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
      fprintf_filtered (stream, "..");
      print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
      fprintf_filtered (stream, "]");
    }
}

static void
m2_typedef (struct type *type, struct ui_file *stream, int show,
	    int level, const struct type_print_options *flags)
{
  if (TYPE_NAME (type) != NULL)
    {
      fputs_filtered (TYPE_NAME (type), stream);
      fputs_filtered (" = ", stream);
    }
  m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
}

/* m2_array - prints out a Modula-2 ARRAY ... OF type.  */

static void m2_array (struct type *type, struct ui_file *stream,
		      int show, int level, const struct type_print_options *flags)
{
  fprintf_filtered (stream, "ARRAY [");
  if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
      && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
    {
      if (TYPE_INDEX_TYPE (type) != 0)
	{
	  m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 0);
	  fprintf_filtered (stream, "..");
	  m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1);
	}
      else
	fprintf_filtered (stream, "%d",
			  (TYPE_LENGTH (type)
			   / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
    }
  fprintf_filtered (stream, "] OF ");
  m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
}

static void
m2_pointer (struct type *type, struct ui_file *stream, int show,
	    int level, const struct type_print_options *flags)
{
  if (TYPE_CONST (type))
    fprintf_filtered (stream, "[...] : ");
  else
    fprintf_filtered (stream, "POINTER TO ");

  m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
}

static void
m2_ref (struct type *type, struct ui_file *stream, int show,
	int level, const struct type_print_options *flags)
{
  fprintf_filtered (stream, "VAR");
  m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
}

static void
m2_unknown (const char *s, struct type *type, struct ui_file *stream,
	    int show, int level)
{
  fprintf_filtered (stream, "%s %s", s, _("is unknown"));
}

static void m2_union (struct type *type, struct ui_file *stream)
{
  fprintf_filtered (stream, "union");
}

static void
m2_procedure (struct type *type, struct ui_file *stream,
	      int show, int level, const struct type_print_options *flags)
{
  fprintf_filtered (stream, "PROCEDURE ");
  m2_type_name (type, stream);
  if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
    {
      int i, len = TYPE_NFIELDS (type);

      fprintf_filtered (stream, " (");
      for (i = 0; i < len; i++)
	{
	  if (i > 0)
	    {
	      fputs_filtered (", ", stream);
	      wrap_here ("    ");
	    }
	  m2_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0, flags);
	}
      if (TYPE_TARGET_TYPE (type) != NULL)
	{
	  fprintf_filtered (stream, " : ");
	  m2_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, 0, flags);
	}
    }
}

static void
m2_print_bounds (struct type *type,
		 struct ui_file *stream, int show, int level,
		 int print_high)
{
  struct type *target = TYPE_TARGET_TYPE (type);

  if (TYPE_NFIELDS(type) == 0)
    return;

  if (print_high)
    print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
  else
    print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
}

static void
m2_short_set (struct type *type, struct ui_file *stream, int show, int level)
{
  fprintf_filtered(stream, "SET [");
  m2_print_bounds (TYPE_INDEX_TYPE (type), stream,
		   show - 1, level, 0);

  fprintf_filtered(stream, "..");
  m2_print_bounds (TYPE_INDEX_TYPE (type), stream,
		   show - 1, level, 1);
  fprintf_filtered(stream, "]");
}

int
m2_is_long_set (struct type *type)
{
  LONGEST previous_high = 0;  /* Unnecessary initialization
				 keeps gcc -Wall happy.  */
  int len, i;
  struct type *range;

  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
    {

      /* check if all fields of the RECORD are consecutive sets.  */

      len = TYPE_NFIELDS (type);
      for (i = TYPE_N_BASECLASSES (type); i < len; i++)
	{
	  if (TYPE_FIELD_TYPE (type, i) == NULL)
	    return 0;
	  if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) != TYPE_CODE_SET)
	    return 0;
	  if (TYPE_FIELD_NAME (type, i) != NULL
	      && (strcmp (TYPE_FIELD_NAME (type, i), "") != 0))
	    return 0;
	  range = TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i));
	  if ((i > TYPE_N_BASECLASSES (type))
	      && previous_high + 1 != TYPE_LOW_BOUND (range))
	    return 0;
	  previous_high = TYPE_HIGH_BOUND (range);
	}
      return len>0;
    }
  return 0;
}

/* m2_get_discrete_bounds - a wrapper for get_discrete_bounds which
                            understands that CHARs might be signed.
                            This should be integrated into gdbtypes.c
                            inside get_discrete_bounds.  */

static int
m2_get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
{
  CHECK_TYPEDEF (type);
  switch (TYPE_CODE (type))
    {
    case TYPE_CODE_CHAR:
      if (TYPE_LENGTH (type) < sizeof (LONGEST))
	{
	  if (!TYPE_UNSIGNED (type))
	    {
	      *lowp = -(1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1));
	      *highp = -*lowp - 1;
	      return 0;
	    }
	}
      /* fall through */
    default:
      return get_discrete_bounds (type, lowp, highp);
    }
}

/* m2_is_long_set_of_type - returns TRUE if the long set was declared as
                            SET OF <oftype> of_type is assigned to the
                            subtype.  */

int
m2_is_long_set_of_type (struct type *type, struct type **of_type)
{
  int len, i;
  struct type *range;
  struct type *target;
  LONGEST l1, l2;
  LONGEST h1, h2;

  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
    {
      len = TYPE_NFIELDS (type);
      i = TYPE_N_BASECLASSES (type);
      if (len == 0)
	return 0;
      range = TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i));
      target = TYPE_TARGET_TYPE (range);

      l1 = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i)));
      h1 = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, len-1)));
      *of_type = target;
      if (m2_get_discrete_bounds (target, &l2, &h2) >= 0)
	return (l1 == l2 && h1 == h2);
      error (_("long_set failed to find discrete bounds for its subtype"));
      return 0;
    }
  error (_("expecting long_set"));
  return 0;
}

static int
m2_long_set (struct type *type, struct ui_file *stream, int show, int level,
	     const struct type_print_options *flags)
{
  struct type *of_type;
  int i;
  int len = TYPE_NFIELDS (type);
  LONGEST low;
  LONGEST high;

  if (m2_is_long_set (type))
    {
      if (TYPE_TAG_NAME (type) != NULL)
	{
	  fputs_filtered (TYPE_TAG_NAME (type), stream);
	  if (show == 0)
	    return 1;
	}
      else if (TYPE_NAME (type) != NULL)
	{
	  fputs_filtered (TYPE_NAME (type), stream);
	  if (show == 0)
	    return 1;
	}

      if (TYPE_TAG_NAME (type) != NULL || TYPE_NAME (type) != NULL)
	fputs_filtered (" = ", stream);

      if (get_long_set_bounds (type, &low, &high))
	{
	  fprintf_filtered(stream, "SET OF ");
	  i = TYPE_N_BASECLASSES (type);
	  if (m2_is_long_set_of_type (type, &of_type))
	    m2_print_type (of_type, "", stream, show - 1, level, flags);
	  else
	    {
	      fprintf_filtered(stream, "[");
	      m2_print_bounds (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i)),
			       stream, show - 1, level, 0);

	      fprintf_filtered(stream, "..");

	      m2_print_bounds (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, len-1)),
			       stream, show - 1, level, 1);
	      fprintf_filtered(stream, "]");
	    }
	}
      else
	/* i18n: Do not translate the "SET OF" part!  */
	fprintf_filtered(stream, _("SET OF <unknown>"));

      return 1;
    }
  return 0;
}

/* m2_is_unbounded_array - returns TRUE if, type, should be regarded
                           as a Modula-2 unbounded ARRAY type.  */

int
m2_is_unbounded_array (struct type *type)
{
  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
    {
      /*
       *  check if we have a structure with exactly two fields named
       *  _m2_contents and _m2_high.  It also checks to see if the
       *  type of _m2_contents is a pointer.  The TYPE_TARGET_TYPE
       *  of the pointer determines the unbounded ARRAY OF type.
       */
      if (TYPE_NFIELDS (type) != 2)
	return 0;
      if (strcmp (TYPE_FIELD_NAME (type, 0), "_m2_contents") != 0)
	return 0;
      if (strcmp (TYPE_FIELD_NAME (type, 1), "_m2_high") != 0)
	return 0;
      if (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) != TYPE_CODE_PTR)
	return 0;
      return 1;
    }
  return 0;
}

/* m2_unbounded_array - if the struct type matches a Modula-2 unbounded
                        parameter type then display the type as an
                        ARRAY OF type.  Returns TRUE if an unbounded
                        array type was detected.  */

static int
m2_unbounded_array (struct type *type, struct ui_file *stream, int show,
		    int level, const struct type_print_options *flags)
{
  if (m2_is_unbounded_array (type))
    {
      if (show > 0)
	{
	  fputs_filtered ("ARRAY OF ", stream);
	  m2_print_type (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0)),
			 "", stream, 0, level, flags);
	}
      return 1;
    }
  return 0;
}

void
m2_record_fields (struct type *type, struct ui_file *stream, int show,
		  int level, const struct type_print_options *flags)
{
  /* Print the tag if it exists.  */
  if (TYPE_TAG_NAME (type) != NULL)
    {
      if (strncmp (TYPE_TAG_NAME (type), "$$", 2) != 0)
	{
	  fputs_filtered (TYPE_TAG_NAME (type), stream);
	  if (show > 0)
	    fprintf_filtered (stream, " = ");
	}
    }
  wrap_here ("    ");
  if (show < 0)
    {
      if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
	fprintf_filtered (stream, "RECORD ... END ");
      else if (TYPE_CODE (type) == TYPE_CODE_UNION)
	fprintf_filtered (stream, "CASE ... END ");
    }
  else if (show > 0)
    {
      int i;
      int len = TYPE_NFIELDS (type);

      if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
	fprintf_filtered (stream, "RECORD\n");
      else if (TYPE_CODE (type) == TYPE_CODE_UNION)
	/* i18n: Do not translate "CASE" and "OF".  */
	fprintf_filtered (stream, _("CASE <variant> OF\n"));

      for (i = TYPE_N_BASECLASSES (type); i < len; i++)
	{
	  QUIT;

	  print_spaces_filtered (level + 4, stream);
	  fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
	  fputs_filtered (" : ", stream);
	  m2_print_type (TYPE_FIELD_TYPE (type, i),
			 "",
			 stream, 0, level + 4, flags);
	  if (TYPE_FIELD_PACKED (type, i))
	    {
	      /* It is a bitfield.  This code does not attempt
		 to look at the bitpos and reconstruct filler,
		 unnamed fields.  This would lead to misleading
		 results if the compiler does not put out fields
		 for such things (I don't know what it does).  */
	      fprintf_filtered (stream, " : %d",
				TYPE_FIELD_BITSIZE (type, i));
	    }
	  fprintf_filtered (stream, ";\n");
	}

      fprintfi_filtered (level, stream, "END ");
    }
}

void
m2_enum (struct type *type, struct ui_file *stream, int show, int level)
{
  LONGEST lastval;
  int i, len;

  if (show < 0)
    {
      /* If we just printed a tag name, no need to print anything else.  */
      if (TYPE_TAG_NAME (type) == NULL)
	fprintf_filtered (stream, "(...)");
    }
  else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
    {
      fprintf_filtered (stream, "(");
      len = TYPE_NFIELDS (type);
      lastval = 0;
      for (i = 0; i < len; i++)
	{
	  QUIT;
	  if (i > 0)
	    fprintf_filtered (stream, ", ");
	  wrap_here ("    ");
	  fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
	  if (lastval != TYPE_FIELD_ENUMVAL (type, i))
	    {
	      fprintf_filtered (stream, " = %s",
				plongest (TYPE_FIELD_ENUMVAL (type, i)));
	      lastval = TYPE_FIELD_ENUMVAL (type, i);
	    }
	  lastval++;
	}
      fprintf_filtered (stream, ")");
    }
}


text:
@echo off

rem tools/copydir.bat
rem
rem   Copyright (C) 2012 Gregory Nutt. All rights reserved.
rem   Author: Gregory Nutt <gnutt@nuttx.org>
rem
rem Redistribution and use in source and binary forms, with or without
rem modification, are permitted provided that the following conditions
rem are met:
rem
rem 1. Redistributions of source code must retain the above copyright
rem    notice, this list of conditions and the following disclaimer.
rem 2. Redistributions in binary form must reproduce the above copyright
rem    notice, this list of conditions and the following disclaimer in
rem    the documentation and/or other materials provided with the
rem    distribution.
rem 3. Neither the name NuttX nor the names of its contributors may be
rem    used to endorse or promote products derived from this software
rem    without specific prior written permission.
rem
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
rem POSSIBILITY OF SUCH DAMAGE.
rem

rem
rem NuttX uses symbolic links to configure platform-specific directories into
rem the build system.  This works great except for when a Windows native
rem toolchain is used in a Cygwin environment.  In that case, symbolic
rem links do not work correctly when accessed from the Windows native toolchain;
rem rather, just look link files with the extension .lnk
rem
rem In this environment, the build system will work around this using this script
rem as a replacement for the 'ln' command.  This scrpt will simply copy the
rem directory into the expected positiion.
rem

set src=%1
set dest=%2

rem Verify that arguments were provided

if "%src%"=="" goto :MissingSrc
if "%dest%"=="" goto :MissingDest
goto CheckSrc

:MissingSrc

echo Missing ^<src^> and ^<dest^> arguments
goto :ShowUsage

:MissingDest

echo Missing ^<dest^> arguments
goto :ShowUsage

rem Verify that a directory exists at the source path

:CheckSrc

if exist %src% goto :CheckDest

echo No directory at %src%
goto :ShowUsage

:CheckDest

rem If something already exists at the destination path, remove it

if not exist %dest% goto :CopyDir

rmdir /q /s %dest%
if errorlevel 1 (
  echo Failed to remove existing object at %dest%
  goto :ShowUsage
)

rem Copy the directory

:CopyDir

xcopy %src% %dest% /c /q /s /e /y /i
echo FAKELNK >  %dest%\.fakelnk
goto :End

:ShowUsage
echo USAGE: %0 ^<src^> ^<dest^>
echo Where:
echo   ^<src^> is the source directory to be copied
echo   ^<dest^> is the destination directory to be created

:End


text:
> This Rails application has been intentionally broken!

In this lab you will dive into a mature rails application and attempt to fix some reported bugs. This lab will stretch your debugging skills and your ability to navigate a large rails project. It will also simulate a real-world scenario: contributing to an open source project.

We encourage you work together and tackle it in pairs.

### What's Publify?
You will be forking & cloning an open source (MIT LICENSE) blogging platform called Publify.

Publify is a simple but full featured web publishing software. It's built
around a blogging engine and a small message system connected to Twitter.

Publify follows the principles of the IndieWeb, which are self hosting your Web
site, and Publish On your Own Site, Syndicate Everywhere.

Publify has been around since 2004 and is the oldest Ruby on Rails open source
project alive.

#### Features

- A classic multi user blogging engine
- Short messages with a Twitter connection
- Text filters (Markdown, Textile, SmartyPants, @mention to link, #hashtag to link)
- A widgets system and a plugin API
- Custom themes
- Advanced SEO capabilities
- Multilingual : Publify is (more or less) translated in English, French,
  German, Danish, Norwegian, Japanese, Hebrew, Simplified Chinese, Mexican
  Spanish, Italian, Lithuanian, Dutch, Polish, Romanian…

#### Resources

- [Publify Repo](https://github.com/publify/publify/issues)
- [Publify blog](http://blog.publify.co)
- [Publify on Twitter](https://twitter.com/getpublify)
- IRC: \#publify on irc.freenode.net

[![Build Status](https://travis-ci.org/publify/publify.png?branch=master)](https://travis-ci.org/publify/publify)
[![Code Climate](https://codeclimate.com/github/publify/publify.png)](https://codeclimate.com/github/publify/publify)
[![Dependency Status](https://gemnasium.com/publify/publify.png)](https://gemnasium.com/publify/publify)

## Getting Started: Installing Publify Locally

To install Publify you need the following:

- [x] Ruby 2.0, 2.1 or 2.2
- [x] Ruby On Rails 4.2.0
- [x] A database engine, MySQL, PgSQL or SQLite3

- [x] A compatible JavaScript installation for asset compilation. See [the execjs readme](https://github.com/sstephenson/execjs#readme) for details.
- [ ] ImageMagick

#### Setup ImageMagick Dependency
Make sure that you have ImageMagick installed (used by mini_magick).

Check for imagemagick:
```bash
$ which convert
# /path/to/bin/convert
```

Install it if it's missing (this can take a few minutes):
```bash
$ brew update
$ brew link
$ brew install imagemagick
```

#### Setup Rails Application
Fork & Clone the Publify repo:

```bash
$ bundle install
$ rake db:setup
$ rake db:migrate
$ rails server
```

You can now launch you browser and access 127.0.0.1:3000.

You will be prompted to supply a blog title and email:

You will be signed in and issued a username and password:

#### Seed your blog with posts & tags
```bash
$ rake db:seed
# => Seeded 24 articles...
```

#### Look around!
* Visit your blog homepage at `localhost:3000/`
* Go to the `/admin` backend and poke around (it's similar to wordpress).
* Create your first blog post!

##The Bugs

A number of issues have been added to the main github repo. Please fix each bug on its own branch (e.g. `fix_sidebar_styles`).

> Make sure to visit the `issues` section of this repo for more detailed bug descriptions + screenshots.

####Issue \#1: Inconsistent Sidebar Styles
* All titles in the sidebar should have `monospace` style font
* All bullets should be circles.

####Issue \#8: Post tags are shown as "object"
The list of tags associated with a given blog post always display "tags object, object, object".

####Issue \#7: Sign-in form displays raw span html in input fields
The http://localhost:3000/users/sign_in page shows `<span class=` in the input fields, and other HTML "debris" below them.

####Issue \#2: Top Month Always Empty (Archive Sidebar)
* When I click on the top-most month in the Archive Sidebar it says "No posts found...".
* When I create a post in the _current month_ (e.g. February) it displays a link in the sidebar for _next month_ (e.g. March), and says "No posts found..."

####Issue \#3: Months sorted incorrectly (Archive Sidebar)
The sort order of months in the Archive Sidebar is off, with January 2015 appearing directly above December 2015:

### Resolving the Issue
Please fix each bug on its own branch (e.g. `fix_sidebar_styles`).

When you're finished with a bug, create a pull request from your fork back to the main repo.

> Before you push, make sure to run `rubocop` to lint your ruby code and ensure it meets the standards established by this project.

> Make sure to reference the issue you are resolving! (You can even close an issue from inside your commit message!)

## Helpful Hints
* Use **Rubber Duck Debugging** -- Make sure you understand the issue!
* Use frequent **Sanity Checks**
    - What are you testing / what are you expecting?
* **Follow the trail**
    - How do you work backwards from the view to the server?
    - How do you find specific files in your rails application?
    - How do you find specific keywords or method calls?
* Sometimes you need to **resart the server** if the views you are working with are being cached.


text:
<?php
// src/BackOffice/AdminBundle/Entity/User.php

namespace BackOffice\AdminBundle\Entity;

use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;

/**
 * User
 * @ORM\Entity
 * @ORM\Table(name="user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(name="image", type="blob", nullable=false)
     */
    protected $image;

    public function __construct()
    {
        parent::__construct();
        // your own logic
    }
    /**
     * Get image
     *
     * @return string
     */
    function getImage() {
        //$img = base64_encode(stream_get_contents());
        return $this->image;
    }
    /**
     * Set image
     *
     * @param string $image
     * @return User
     */
    function setImage($image) {
        $this->image = $image;
    }

}


text:
package com.iancaffey.x86.io.sse3;

/**
 * SSE3MultiplyAddPackedMixedBytesVisitor
 *

 * PMADDUBSW Multiplies each unsigned byte value with the corresponding signed byte value to produce
 * an intermediate, 16-bit signed integer. Each adjacent pair of 16-bit signed values are
 * added horizontally. The signed, saturated 16-bit results are packed to the destination
 * operand.
 *
 * @author Ian Caffey
 * @see Intel Developer's Manual
 * @since 1.0
 */
public interface SSE3MultiplyAddPackedMixedBytesVisitor {
}


text:
#ifndef TEXTUREVIEW_H
#define TEXTUREVIEW_H

GLboolean
_mesa_texture_view_compatible_format(struct gl_context *ctx,
                                     GLenum origInternalFormat,
                                     GLenum newInternalFormat);

extern void GLAPIENTRY
_mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture,
                  GLenum internalformat,
                  GLuint minlevel, GLuint numlevels,
                  GLuint minlayer, GLuint numlayers);

extern void
_mesa_set_texture_view_state(struct gl_context *ctx, struct gl_texture_object *texObj,
                       GLenum target, GLuint levels);

#endif /* TEXTUREVIEW_H */


text:
namespace IconsReminder
{
    using Windows.UI.Xaml.Controls;

    public sealed partial class PastReminders : Page
    {
        public PastReminders()
        {
            this.InitializeComponent();
        }
    }
}


text:
<?xml version="1.0"?>
<x:doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://xsdtesting" xsi:schemaLocation="http://xsdtesting particlesC039.xsd">
	<x:elem>
		<a:foo xmlns:a="foo"/>
	</x:elem>
</x:doc>


text:
<?php

add_filter( 'wen_associate_filter_default_theme_options', 'wen_associate_setting_default_options' );

/**
 * Settings defaults.
 *
 * @since  WEN Associate 1.0
 */
if( ! function_exists( 'wen_associate_setting_default_options' ) ):

  function wen_associate_setting_default_options( $input ){

    // Header
    $input['site_logo']          = '';
    $input['show_tagline']       = true;
    $input['social_in_header']   = false;
    $input['search_in_header']   = false;
    $input['header_layout']      = 'layout-1';

    // Icons
    $input['site_favicon']       = '';
    $input['site_web_clip_icon'] = '';

    // Layout
    $input['site_layout']            = 'fluid';
    $input['global_layout']          = 'right-sidebar';
    $input['archive_layout']         = 'excerpt';
    $input['single_image']           = 'large';
    $input['single_image_alignment'] = 'center';

    // Pagination
    $input['pagination_type'] = 'default';

    // Footer
    $input['copyright_text']                = __( 'Copyright. All rights reserved.', 'wen-associate' );
    $input['go_to_top']                     = true;

    // Blog
    $input['excerpt_length']       = 40;
    $input['read_more_text']       = __( 'Read More ...', 'wen-associate' );
    $input['exclude_categories']   = '';
    $input['author_bio_in_single'] = false;

    // Breadcrumb
    $input['breadcrumb_type']      = 'disabled';
    $input['breadcrumb_separator'] = '>';

    return $input;
  }

endif;

add_filter( 'wen_associate_theme_options_args', 'wen_associate_setting_theme_options_args' );

/**
 * Add settings options.
 *
 * @since  WEN Associate 1.0
 */
if( ! function_exists( 'wen_associate_setting_theme_options_args' ) ):

  function wen_associate_setting_theme_options_args( $args ){

    // Header Section
    $args['panels']['theme_option_panel']['sections']['section_header'] = array(
      'title'    => __( 'Header', 'wen-associate' ),
      'priority' => 40,
      'fields'   => array(
        'header_layout' => array(
          'title'             => __( 'Layout', 'wen-associate' ),
          'type'              => 'radio-image',
          'choices'           => wen_associate_get_header_layout_options(),
          'sanitize_callback' => 'sanitize_key',
        ),
        'site_logo' => array(
          'title'             => __( 'Logo', 'wen-associate' ),
          'type'              => 'image',
          'sanitize_callback' => 'esc_url_raw',
        ),
        'show_tagline' => array(
          'title'   => __( 'Show Tagline', 'wen-associate' ),
          'type'    => 'checkbox',
        ),
        'social_in_header' => array(
          'title'   => __( 'Show Social Icons', 'wen-associate' ),
          'type'    => 'checkbox',
        ),
        'search_in_header' => array(
          'title'   => __( 'Show Search Icons', 'wen-associate' ),
          'type'    => 'checkbox',
        ),
      )
    );

    // Icons Section
    $args['panels']['theme_option_panel']['sections']['section_icons'] = array(
      'title'    => __( 'Icons', 'wen-associate' ),
      'priority' => 60,
      'fields'   => array(
        'site_favicon' => array(
          'title'             => __( 'Favicon', 'wen-associate' ),
          'type'              => 'image',
          'sanitize_callback' => 'esc_url_raw',
        ),
        'site_web_clip_icon' => array(
          'title'             => __( 'Web Clip Icon', 'wen-associate' ),
          'type'              => 'image',
          'sanitize_callback' => 'esc_url_raw',
        ),
      )
    );

    // Layout Section
    $args['panels']['theme_option_panel']['sections']['section_layout'] = array(
      'title'    => __( 'Layout', 'wen-associate' ),
      'priority' => 70,
      'fields'   => array(
        'site_layout' => array(
          'title'             => __( 'Site Layout', 'wen-associate' ),
          'type'              => 'select',
          'choices'           => wen_associate_get_site_layout_options(),
          'sanitize_callback' => 'sanitize_key',
        ),
        'global_layout' => array(
          'title'             => __( 'Global Layout', 'wen-associate' ),
          'type'              => 'select',
          'choices'           => wen_associate_get_global_layout_options(),
          'sanitize_callback' => 'sanitize_key',
        ),
        'archive_layout' => array(
          'title'             => __( 'Archive Layout', 'wen-associate' ),
          'type'              => 'select',
          'choices'           => wen_associate_get_archive_layout_options(),
          'sanitize_callback' => 'sanitize_key',
        ),
        'single_image' => array(
          'title'             => __( 'Image in Single Post/Page', 'wen-associate' ),
          'type'              => 'select',
          'choices'           => wen_associate_get_image_sizes_options(),
          'sanitize_callback' => 'sanitize_key',
        ),
        'single_image_alignment' => array(
          'title'             => __( 'Alignment of Image in Single Post/Page', 'wen-associate' ),
          'type'              => 'select',
          'choices'           => wen_associate_get_single_image_alignment_options(),
          'sanitize_callback' => 'sanitize_key',
        ),
      )
    );

    // Pagination Section
    $args['panels']['theme_option_panel']['sections']['section_pagination'] = array(
      'title'    => __( 'Pagination', 'wen-associate' ),
      'priority' => 70,
      'fields'   => array(
        'pagination_type' => array(
          'title'             => __( 'Pagination Type', 'wen-associate' ),
          'description'       => sprintf( __( 'Numeric: Requires %sWP-PageNavi%s plugin', 'wen-associate' ), '','' ),
          'type'              => 'select',
          'sanitize_callback' => 'sanitize_key',
          'choices'           => wen_associate_get_pagination_type_options(),
        ),
      )
    );

    // Footer Section
    $args['panels']['theme_option_panel']['sections']['section_footer'] = array(
      'title'    => __( 'Footer', 'wen-associate' ),
      'priority' => 80,
      'fields'   => array(
        'copyright_text' => array(
          'title' => __( 'Copyright Text', 'wen-associate' ),
          'type'  => 'text',
        ),
        'go_to_top' => array(
          'title' => __( 'Show Go To Top', 'wen-associate' ),
          'type'  => 'checkbox',
        ),
      )
    );

    // Blog Section
    $args['panels']['theme_option_panel']['sections']['section_blog'] = array(
      'title'    => __( 'Blog', 'wen-associate' ),
      'priority' => 80,
      'fields'   => array(
        'excerpt_length' => array(
          'title'             => __( 'Excerpt Length (words)', 'wen-associate' ),
          'description'       => __( 'Default is 40 words', 'wen-associate' ),
          'type'              => 'number',
          'sanitize_callback' => 'wen_associate_sanitize_excerpt_length',
          'input_attrs'       => array(
                                  'min'   => 1,
                                  'max'   => 200,
                                  'style' => 'width: 55px;'
                                ),
        ),
        'read_more_text' => array(
          'title'             => __( 'Read More Text', 'wen-associate' ),
          'type'              => 'text',
          'sanitize_callback' => 'sanitize_text_field',
        ),
        'exclude_categories' => array(
          'title'             => __( 'Exclude Categories in Blog', 'wen-associate' ),
          'description'       => __( 'Enter category ID to exclude in Blog Page. Separate with comma if more than one', 'wen-associate' ),
          'type'              => 'text',
          'sanitize_callback' => 'sanitize_text_field',
        ),
        'author_bio_in_single' => array(
          'title'             => __( 'Show Author Bio', 'wen-associate' ),
          'type'              => 'checkbox',
        ),
      )
    );

    // Breadcrumb Section
    $args['panels']['theme_option_panel']['sections']['section_breadcrumb'] = array(
      'title'    => __( 'Breadcrumb', 'wen-associate' ),
      'priority' => 80,
      'fields'   => array(
        'breadcrumb_type' => array(
          'title'             => __( 'Breadcrumb Type', 'wen-associate' ),
          'description'       => sprintf( __( 'Advanced: Requires %sBreadcrumb NavXT%s plugin', 'wen-associate' ), '','' ),
          'type'              => 'select',
          'choices'           => wen_associate_get_breadcrumb_type_options(),
          'sanitize_callback' => 'sanitize_key',
        ),
        'breadcrumb_separator' => array(
          'title'           => __( 'Separator', 'wen-associate' ),
          'type'            => 'text',
          'input_attrs'     => array('style' => 'width: 55px;'),
          'active_callback' => 'wen_associate_is_simple_breadcrumb_active',
        ),
      )
    );

    return $args;
  }

endif;


text:
package net.bubuxi.mc.marriage.manager;

import java.io.File;
import java.io.IOException;

import net.bubuxi.mc.marriage.Logger;
import net.bubuxi.mc.marriage.Marriage;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.configuration.file.YamlConfiguration;

public class HomeLocationManager {

	private YamlConfiguration yml = new YamlConfiguration();

	public HomeLocationManager() {
		loadFromYml();
	}

	public Location getHomeLocaiton(String name) {
		String locationString = yml.getString(name);
		String [] locInfos = locationString.split(",");
		if(locInfos.length>=4){
			double x = Double.valueOf(locInfos[1]);
			double y = Double.valueOf(locInfos[2]);
			double z = Double.valueOf(locInfos[3]);
			if(Bukkit.getWorld(locInfos[0])!=null) {
				return new Location(Bukkit.getWorld(locInfos[0]), x, y, z);
			}
			Logger.warning("Home location world name error");
			return null;
		}
		Logger.warning("Home location format error");
		return null;
	}

	public void setHomeLocation(String name, Location loc) {
		yml.set(name, loc.getWorld().getName()+","+loc.getX()+","+loc.getY()+","+loc.getZ());
	}

	private void loadFromYml() {
		File dataDir = new File(Marriage.getInstance().getDataFolder(), "data");
		if(!dataDir.isDirectory()) {
			dataDir.mkdir();
		}
		File locationFile = new File(dataDir, "home-locations.yml");
		if(!locationFile.exists()) {
			try {
				locationFile.createNewFile();
			} catch (IOException e) {
				Logger.warning("Location file failed to create");
				return;
			}
		}
		try {
			yml.load(locationFile);
		} catch (Exception e) {
			Logger.warning("Load location file error");
		}
	}

	void saveToYml() {
		File locationFile = new File(new File(Marriage.getInstance().getDataFolder(), "data"),
				"home-locations.yml");
		try {
			yml.save(locationFile);
		} catch (IOException e) {
			Logger.warning("Failed to save home locations");
		}
	}

	public void removeHome(String name) {
		yml.set(name, null);
	}

}


text:
cask "godot" do
  version "3.3"
  sha256 "f490a91e840ada5f6cc1db030e2d6950ae58583b388e763484e9b5a16cbdcaf7"

  url "https://downloads.tuxfamily.org/godotengine/#{version}/Godot_v#{version}-stable_osx.universal.zip",
      verified: "downloads.tuxfamily.org/godotengine/"
  name "Godot Engine"
  desc "Game development engine"
  homepage "https://godotengine.org/"

  livecheck do
    url "https://github.com/godotengine/godot/releases"
    strategy :git
    regex(/^(\d+(?:\.\d+)*)-stable$/)
  end

  app "Godot.app"
end


text:
VERSION       = 0.1.3

SHELL         = /bin/sh

# Make will use the current date when inserting the release date into the
# generated compiled script and README file. To override with a specific
# date, pass a date on the command-line when calling make, i.e.,
# `make RELEASE_DATE=YYYY-MM-DD`
RELEASE_DATE := $(shell date "+%F")

# If run from a git repo, then override the version above with
# a version derived from git tags formatted as `v[0-9]*`.
ifneq (,$(wildcard .git))
VERSION := $(subst v,,$(shell git describe --match "v[0-9]*" --dirty --always))
# NOTE: Remove the `--always` option to exit if git can't find a tag
#       instead of falling back to an abbreviated commit hash.
endif

# Format:  full_month_name day, year
RELEASE_DATE_FULL := $(shell date -j -f "%F" "$(RELEASE_DATE)" "+%B %e, %Y" \
                     | tr -s ' ')

# File names
SOURCE        = log_page.applescript
BASENAME      = Log\ Page
PACKAGE       = log-page

# Locations
prefix        = $(HOME)/Library/Scripts/Applications
bindir       := $(prefix)/Safari
BUILD         = _build
DOC_DIR       = doc
TEST_TMP      = t/tmp

# Installation directories for alternate browsers
CHROMEDIR    := $(prefix)/Google\ Chrome
FIREFOXDIR   := $(prefix)/Firefox
WEBKITDIR    := $(prefix)/WebKit

# Output files
TARGET       := $(BASENAME).scpt
DOC_FILE     := $(BASENAME)\ README.rtfd
# Distribution archive file basename
ARCHIVE      := $(PACKAGE)-$(VERSION)

# Documentation source files (text files in concatenation order)
TEXT_FILES    = readme.md LICENSE
DOC_SRC      := $(patsubst %,$(DOC_DIR)/%,$(TEXT_FILES))
HTML_LAYOUT  := $(DOC_DIR)/layout.erb
# Temporary file
HTML_FILE    := $(DOC_DIR)/readme.html
# ed commands for tweaking RTF formatting
ED_COMMANDS  := $(DOC_DIR)/doc.ed.txt

# Output file paths
PROG         := $(BUILD)/$(TARGET)
DOC_TARGET   := $(BUILD)/$(DOC_FILE)

# For files or directories that have backslash-escaped spaces, make variables
# without the escapes to use for AppleScript (osascript)
TARGET_AS    := $(subst \,,$(TARGET))
CHROMEDIR_AS := $(subst \,,$(CHROMEDIR))

# Tools
RM            = rm -rf
ED            = ed -s
SED           = LC_ALL=C sed
MKDIR         = mkdir -p
MARKDOWN      = kramdown
MARKDOWN_OPT := --no-auto-ids --entity-output :numeric --template $(HTML_LAYOUT)
ARCHIVE_CMD   = ditto -c -k --sequesterRsrc --keepParent
PROVE         = prove -f

# Set the type (-t) and creator (-c) codes when compiling just like
# AppleScript Editor does. The codes are useful for Spotlight searches.
# If the -t and -c options are omitted, no codes are set.
OSACOMPILE = osacompile -t osas -c ToyS -o

# Install tool and options
INSTALL      = install
INSTDIR     := $(bindir)
INSTOPTS     = -pSv     # Don't use -b option; backups show up in script menu
INSTMODE     = -m 0600
INSTDIRMODE  = -m 0700

# ==== TARGETS ===============================================================

# ---- Default rule

all: $(PROG)

# ---- Default install

# The default install command installs the script for Safari and then makes
# aliases of the script for the other browsers

install: install-safari
	@echo "* The 'install' target installs the script for Safari and then"
	@echo "* creates aliases of the script for all the other browsers."
	@$(MKDIR) $(INSTDIRMODE) $(CHROMEDIR) $(FIREFOXDIR) $(WEBKITDIR)
	@echo "--->  Installing aliases for Chrome, Firefox and WebKit..."
	$(call trash-installed,$(CHROMEDIR_AS)/$(TARGET_AS))
	$(call make-alias,$(INSTDIR),$(TARGET_AS),$(CHROMEDIR_AS))
	$(call trash-installed,$(FIREFOXDIR)/$(TARGET_AS))
	$(call make-alias,$(INSTDIR),$(TARGET_AS),$(FIREFOXDIR))
	$(call trash-installed,$(WEBKITDIR)/$(TARGET_AS))
	$(call make-alias,$(INSTDIR),$(TARGET_AS),$(WEBKITDIR))

# ---- Individual installations

install-safari: all
	$(call trash-installed,$(INSTDIR)/$(TARGET_AS))
	@echo "--->  Installing '$(TARGET)' into '$(INSTDIR)'..."
	@$(INSTALL) -dv $(INSTDIRMODE) $(INSTDIR) && \
	$(INSTALL) $(INSTOPTS) $(INSTMODE) $(PROG) $(INSTDIR)

install-chrome: all
	$(call trash-installed,$(CHROMEDIR_AS)/$(TARGET_AS))
	@echo "--->  Installing '$(TARGET)' into '$(CHROMEDIR)'..."
	@$(INSTALL) -dv $(INSTDIRMODE) $(CHROMEDIR) && \
	$(INSTALL) $(INSTOPTS) $(INSTMODE) $(PROG) $(CHROMEDIR)

install-firefox: all
	$(call trash-installed,$(FIREFOXDIR)/$(TARGET_AS))
	@echo "--->  Installing '$(TARGET)' into '$(FIREFOXDIR)'..."
	@$(INSTALL) -dv $(INSTDIRMODE) $(FIREFOXDIR) && \
	$(INSTALL) $(INSTOPTS) $(INSTMODE) $(PROG) $(FIREFOXDIR)

install-webkit: all
	$(call trash-installed,$(WEBKITDIR)/$(TARGET_AS))
	@echo "--->  Installing '$(TARGET)' into '$(WEBKITDIR)'..."
	@$(INSTALL) -dv $(INSTDIRMODE) $(WEBKITDIR) && \
	$(INSTALL) $(INSTOPTS) $(INSTMODE) $(PROG) $(WEBKITDIR)

# ----

uninstall:
	@echo "--->  Uninstalling '$(TARGET)' from all locations..."
	$(call trash-installed,$(INSTDIR)/$(TARGET_AS))
	$(call trash-installed,$(CHROMEDIR_AS)/$(TARGET_AS))
	$(call trash-installed,$(FIREFOXDIR)/$(TARGET_AS))
	$(call trash-installed,$(WEBKITDIR)/$(TARGET_AS))

clean:
	@echo "--->  Deleting build files..."
	@[ -d "$(BUILD)" ] && $(RM) $(BUILD) || true
	@[ -f "$(HTML_FILE)" ] && $(RM) $(HTML_FILE) || true
	@echo "--->  Deleting distribution files..."
	@[ -d "$(ARCHIVE)" ] && $(RM) $(ARCHIVE) || true
	@$(RM) $(PACKAGE)-*.zip 2>/dev/null || true
	@echo "--->  Deleting temporary test files..."
	@[ -d "$(TEST_TMP)" ] && $(RM) $(TEST_TMP) || true
	@echo "--->  Deletion complete"

clean-test:
	@echo "--->  Deleting temporary test files in '$(TEST_TMP)'..."
	@[ -d "$(TEST_TMP)" ] && $(RM) $(TEST_TMP) || true
	@echo "--->  Deletion complete"

doc: $(DOC_TARGET)

dist: all doc
	@echo "--->  Making a release..."
	@[ -d "$(ARCHIVE)" ] && $(RM) $(ARCHIVE) || true
	@[ -f "$(ARCHIVE).zip" ] && $(RM) $(ARCHIVE).zip || true
	@$(MKDIR) $(ARCHIVE)
	@cp -a $(BUILD)/* $(ARCHIVE)
	@find $(ARCHIVE) -name .DS_Store -print0 | xargs -0 $(RM)
	@$(ARCHIVE_CMD) $(ARCHIVE) $(ARCHIVE).zip
	@$(RM) $(ARCHIVE)
	@echo "--->  Release distribution archive created"

test:
	@echo "--->  Running Log Page tests on source script..."
	@[ -d "$(TEST_TMP)" ] && $(RM) $(TEST_TMP) || true
	$(PROVE) -v ./t/[0-9][0-9][0-9][0-9]-*.sh :: SKIP_INFO:true
	@echo "--->  Deleting temporary test files in '$(TEST_TMP)'..."
	@$(RM) $(TEST_TMP)

test-quiet:
	@echo "--->  Running Log Page tests on source script..."
	@[ -d "$(TEST_TMP)" ] && $(RM) $(TEST_TMP) || true
	$(PROVE) ./t/[0-9][0-9][0-9][0-9]-*.sh :: SKIP_INFO:true
	@echo "--->  Deleting temporary test files in '$(TEST_TMP)'..."
	@$(RM) $(TEST_TMP)

test-compiled: all
	@echo "--->  Running Log Page tests on compiled script..."
	@[ -d "$(TEST_TMP)" ] && $(RM) $(TEST_TMP) || true
	$(PROVE) -v ./t/[0-9][0-9][0-9][0-9]-*.sh :: SKIP_INFO:true TEST_COMPILED:true
	@echo "--->  Deleting temporary test files in '$(TEST_TMP)'..."
	@$(RM) $(TEST_TMP)

test-compiled-quiet: all
	@echo "--->  Running Log Page tests on compiled script..."
	@[ -d "$(TEST_TMP)" ] && $(RM) $(TEST_TMP) || true
	$(PROVE) ./t/[0-9][0-9][0-9][0-9]-*.sh :: SKIP_INFO:true TEST_COMPILED:true
	@echo "--->  Deleting temporary test files in '$(TEST_TMP)'..."
	@$(RM) $(TEST_TMP)

check: test

check-quiet: test-quiet

check-compiled: test-compiled

check-compiled-quiet: test-compiled-quiet

help:
	@echo "$$HELPTEXT"

.PHONY: all install uninstall clean doc dist help \
        test test-quiet check check-quiet clean-test \
        install-safari install-chrome install-firefox install-webkit

# ==== DEPENDENCIES ==========================================================

$(PROG): $(SOURCE)
	@[ -d $(BUILD) ] || {                              \
		echo "--->  Creating directory '$(BUILD)'..."; \
		$(MKDIR) $(INSTDIRMODE) $(BUILD);              \
	}
	@if [ 0 = $$(grep -cm1 '@@VERSION@@' $<) ]; then                        \
		echo "--->  Stripping debug lines and compiling '$@' from '$<'..."; \
		$(call strip-debug,"$<") | $(OSACOMPILE) "$@";                      \
	else                                                                    \
		echo "--->  Stripping debug statements, inserting VERSION number,"; \
		echo "--->    and compiling '$@' from '$<'...";                     \
		$(call insert-version,"$<") | $(OSACOMPILE) "$@";                   \
	fi
	@touch -r "$<" "$@"

$(DOC_TARGET): $(HTML_FILE)
	@echo "--->  Generating RTFD file from HTML..."
	@[ -d $(DOC_TARGET) ] && $(RM) $(DOC_TARGET) || true
	@[ -d $(BUILD) ] || $(MKDIR) $(BUILD)
	@textutil -format html -convert rtfd -output "$@" $<
	@echo "--->  Removing temporary HTML file..."
	@$(RM) $<
	@echo "--->  Tweaking RTF documentation formatting with 'ed' commands..."
	@$(ED) $(DOC_TARGET)/TXT.rtf < $(ED_COMMANDS) >/dev/null 2>&1
	@touch -r "$(DOC_DIR)/readme.md" "$@"
	@touch -r "$(DOC_DIR)/readme.md" $(DOC_TARGET)/TXT.rtf
	@echo "--->  Deleting temporary scaled images..."
	@$(RM) "$(BUILD)/img"

$(HTML_FILE): $(DOC_SRC)
	@echo "--->  Scaling images to fit RTF document..."
	@[ -d $(BUILD)/img ] || $(MKDIR) $(BUILD)/img
	@for f in $(DOC_DIR)/img/*.png; do \
		sips --resampleWidth 640 $$f --out $(BUILD)/img >/dev/null 2>&1; \
	done
	@echo "--->  Concatenating Markdown files and generating temp HTML file..."
	@if ! which $(MARKDOWN) >/dev/null; then \
		echo "Can't find '$(MARKDOWN)' in PATH, needed for Markdown to HTML."; \
		false; \
	fi
	@# Make substitutions (version, etc.) before passing to Markdown parser
	@cat $^ | $(SED) -e 's/@@VERSION@@/$(VERSION)/g' -e 's/ (c) / \© /g' \
		-e 's/[[:<:]]\(20[0-9][0-9]\)-\(20[0-9][0-9]\)[[:>:]]/\1--\2/g' \
		-e 's/@@RELEASE_DATE@@/$(RELEASE_DATE_FULL)/g' \
		| $(MARKDOWN) $(MARKDOWN_OPT) > $@
	@# Center the images since textutil ignores CSS margin auto on p > img
	@printf "%s\n" H \
	    'g/^\(<p\)\(><img \)/s//\1 style="text-align:center"\2/' . w | \
	    $(ED) $@ >/dev/null 2>&1

# ==== FUNCTIONS =============================================================

define trash-installed
	@echo "--->  Deleting installed script: '$1'"
	@osascript                                  \
	-e "tell application \"Finder\""            \
	-e "	if exists (POSIX file \"$1\") then" \
	-e "		delete (POSIX file \"$1\")"     \
	-e "	end if"                             \
	-e "end tell" >/dev/null
endef

define make-alias
	@echo "--->  Making alias to '$1/$2' at '$3'"
	@osascript                                                            \
	-e "tell application \"Finder\""                                      \
	-e '	make new alias file to POSIX file "$1/$2" at POSIX file "$3"' \
	-e "end tell" >/dev/null
endef

define strip-debug
	$(SED) -e '/^[[:space:]]*\(my \(Util.s \)\{0,1\}\)\{0,1\}debug_log(/d' "$1"
endef

define insert-version
	$(call strip-debug,"$1") | $(SED) -e 's/@@VERSION@@/$(VERSION)/g' \
		-e 's/@@RELEASE_DATE@@/$(RELEASE_DATE)/g'
endef

# ==== TEXT VARIABLES ========================================================

define HELPTEXT

Make Commands for Log Page
--------------------------

make
make all
    Compile the script to the build directory, performing any
    substitutions such as inserting the version number and stripping
    debug statements.

make install
    Install the compiled script for all supported web browsers (Safari,
    Firefox, Google Chrome, WebKit Nightly). Only one actual copy of the
    script is installed -- for Safari. Aliases are created to that
    script for the other browsers.

make install-safari
make install-chrome
make install-firefox
make install-webkit
    Install the compiled script for only a specific web browser.

make uninstall
    Uninstall the script from all web browsers.

make test
    Run tests using the 'prove' command. There are over a thousand tests
    and it can take over ten minutes to run them all. Most of the tests
    are for the user interface (GUI windows), but the resulting data is
    also checked.

make test-quiet
    Run tests quietly (without the verbose flag to 'prove').

make test-compiled
    Test the compiled, final script instead of the source script which
    is tested by default.

make test-compiled-quiet
    Same as 'test-compiled' except without verbose output.

make doc
    Generate the RTFD documentation file for the distribution.

make dist
    Make a release distribution archive consisting of the compiled
    AppleScript program and the RTFD documentation file.

make clean
    Delete all build files, distribution files, and temporary test files.

make clean-test
    Delete all temporary test files.

make help
    Display this help.

endef
export HELPTEXT


text:
package wisekb.web.filesystem.s3.common;

public class S3Constansts {
    public static final String CANONICAL_GRANTEE_TYPE_ID = "id";
    public static final String GROUP_GRANTEE_TYPE_ID = "uri";
    public static final String DELIMITER = "/";
    public static final int MAX_PREVIEW_SIZE = 1024 * 10;

    public static final String BUCKETNAME = "bucketName";
    public static final String REGION = "region";
    public static final String KEY = "key";
    public static final String SRC_BUCKETNAME = "srcBucketName";
    public static final String DST_BUCKETNAME = "dstBucketName";
    public static final String SRC_KEY = "srcKey";
    public static final String DST_KEY = "dstKey";
    public static final String NEW_KEY = "newKey";
    public static final String FILE = "file";
    public static final String ISTRUNCATED = "isTruncated";
    public static final String CONTINUATIONTOKEN = "continuationToken";
}


text:
/*
 * Open Source Software published under the Apache Licence, Version 2.0.
 */

package io.github.vocabhunter.gui.model;

import io.github.vocabhunter.analysis.marked.MarkedWord;
import io.github.vocabhunter.analysis.marked.WordState;
import io.github.vocabhunter.gui.common.SequencedWord;
import javafx.beans.Observable;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.util.Callback;

import java.util.List;

public class WordModel implements MarkedWord, SequencedWord {
    public static final Callback<WordModel, Observable[]> PROPERTY_EXTRACTOR
            = w -> new Observable[] {w.identifier, w.state};

    private final int sequenceNo;

    private final List<Integer> lineNos;

    private final int useCount;

    private final SimpleStringProperty identifier;

    private final SimpleObjectProperty<WordState> state;

    private final SimpleStringProperty note;

    public WordModel(final int sequenceNo, final String word, final List<Integer> lineNos, final int useCount, final WordState state, final String note) {
        this.lineNos = List.copyOf(lineNos);
        this.useCount = useCount;
        this.identifier = new SimpleStringProperty(word);
        this.sequenceNo = sequenceNo;
        this.state = new SimpleObjectProperty<>(state);
        this.note = new SimpleStringProperty(note);
    }

    @Override
    public int getSequenceNo() {
        return sequenceNo;
    }

    @Override
    public String getWordIdentifier() {
        return identifier.get();
    }

    @Override
    public WordState getState() {
        return state.get();
    }

    public void setState(final WordState state) {
        this.state.set(state);
    }

    public SimpleObjectProperty<WordState> stateProperty() {
        return state;
    }

    public List<Integer> getLineNos() {
        return lineNos;
    }

    @Override
    public int getUseCount() {
        return useCount;
    }

    public SimpleStringProperty noteProperty() {
        return note;
    }

    public String getNote() {
        return note.get();
    }

    public void setNote(final String note) {
        this.note.set(note);
    }
}


text:
from django.conf import settings
from django.utils.translation import ugettext_lazy

class LoginAttemptStatus(object):

    values = ['LOGIN_SUCCEED','LOGIN_FAILED_SHOW_WARNING','LOGIN_FAILED_LOCK_USER', 'LOGIN_FAILED_PASS_USER']

    class __metaclass__(type):
        def __getattr__(self, name):
            return self.values.index(name)

def get_setting(variable, default=None):
    """ get the 'variable' from settings if not there use the
    provided default """
    return getattr(settings, variable, default)

# redis server host
DEFENDER_REDIS_URL = get_setting('DEFENDER_REDIS_URL')
REDIS_HOST = get_setting('REDIS_HOST')

MOCK_REDIS = get_setting('DEFENDER_MOCK_REDIS', False)

# see if the user has overridden the failure limit
FAILURE_LIMIT = get_setting('DEFENDER_LOGIN_FAILURE_LIMIT', 3)

# use a specific username field to retrieve from login POST data
USERNAME_FORM_FIELD = get_setting('DEFENDER_USERNAME_FORM_FIELD', 'username')

# see if the django app is sitting behind a reverse proxy
BEHIND_REVERSE_PROXY = get_setting('DEFENDER_BEHIND_REVERSE_PROXY', False)

ENABLE_IP_LOCK = get_setting('DEFENDER_ENABLE_IP_LOCK', True)

WARNING_LIMIT = get_setting('DEFENDER_LOGIN_WARNING_LIMIT')

# the prefix for these keys in your cache.
CACHE_PREFIX = get_setting('DEFENDER_CACHE_PREFIX', 'defender')

# if the django app is behind a reverse proxy, look for the
# ip address using this HTTP header value
REVERSE_PROXY_HEADER = get_setting('DEFENDER_REVERSE_PROXY_HEADER',
                                   'HTTP_X_FORWARDED_FOR')

try:
    # how long to wait before the bad login attempt gets forgotten. in seconds.
    COOLOFF_TIME = int(get_setting('DEFENDER_COOLOFF_TIME', 300))  # seconds
except ValueError:  # pragma: no cover
    raise Exception('COOLOFF_TIME needs to be an integer')  # pragma: no cover

LOCKOUT_TEMPLATE = get_setting('DEFENDER_LOCKOUT_TEMPLATE')

ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. "
                              "Note that both fields are case-sensitive.")

# use a specific username field to retrieve from login POST data
USERNAME_FORM_FIELD = get_setting('DEFENDER_USERNAME_FORM_FIELD', 'username')

LOCKOUT_URL = get_setting('DEFENDER_LOCKOUT_URL')

USE_CELERY = get_setting('DEFENDER_USE_CELERY', False)


text:
package lista_heranca;

public class Comida extends ItemDeCardapio {

	private float peso;

	public Comida(float preco, float peso) {
		super(preco);
		this.peso = peso;
	}

	// Sobrescrito
	@Override
	public float valorItem() {
		return super.getPreco() + 0.25f;
	}

	// Sobrecarregado
	public boolean cancelarItem(float peso, boolean clienteDecepicionado) {
		boolean sucesso = false;

		if (clienteDecepicionado || peso < 0.97f * this.peso) {
			super.setPreco(0.0f);
			sucesso = true;
		}

		return sucesso;
	}

	public float getPeso() {
		return peso;
	}

	public void setPeso(float peso) {
		this.peso = peso;
	}

	@Override
	public String toString() {
		return "Comida [peso=" + peso + "]";
	}

}


text:
  <button type="button" title="Cancel Changes" class="btn btn-primary pull-right" ng-click="cancel()"> Cancel</button>

Edit {{code.label}}

	<form class="form form-horizontal" name="myForm" style="margin-top:10px;" ng-submit="ok(myForm.$valid);">

      Label

        <input class="form-control" type="text" name="label" id="label" ng-model="code.label" ng-maxlength="255" maxlength="255" ng-minlength="1" minlength="1" placeholder="Label" ng-focus required/>

Label must be longer than 1 character in length.

Label must be shorter than 255 characters in length.

Label is required.

      Code

        <input class="form-control" type="text" name="code" id="code" ng-model="code.code" ng-maxlength="20" maxlength="20" ng-minlength="1" minlength="1" placeholder="Label" ng-focus required/>

Code must be longer than 1 character in length.

Code must be shorter than 20 characters in length.

Code is required.

      Security Type

        <select smartselect ng-disabled="!securityTypes.length" class="form-control" type="text" id="securityMarkingType" ng-model="code.securityMarkingType"  ng-options="code.code as code.description for code in securityTypes"><option style="display:none" value="">Select a Type</option></select>

      Description

        <textarea ckeditor="editorOptions" id="description" ng-model="code.description" ng-watch="editorContent"></textarea>

      Detail Url

        <input class="form-control" id="url" name="url" type="text" ng-model="code.detailUrl" ng-maxlength="1024" maxlength="1024" placeholder="External link" ng-minlength="1" minlength="1"/>

Url must be longer than 1 character in length.

Url must be shorter than 1024 characters in length.

Url is required.

      Group Code

        <input class="form-control" id="groupCode" name="groupCode" type="text" ng-model="code.groupCode" ng-maxlength="255" maxlength="255" placeholder="Group Code" ng-minlength="1" minlength="1"/>

Group Code must be longer than 1 character in length.

Group Code must be shorter than 255 characters in length.

      Sort Order

        <input  type="text"
        name="sortOrder"
        id="sortOrder"
        class="form-control"
        ng-model="code.sortOrder"
        onkeypress='return utils.isNumberKey(event);'
        onpaste="return false;"
        maxlength="5"
        max=5000
        min=1
        placeholder="Sort Order (#)"
        ng-focus />

Sort Order must be longer than 1 character in length.

Sort Order must be shorter than 1024 characters in length.

      Architecture Code

        <input class="form-control" id="architectureCode" name="architectureCode" type="text" ng-model="code.architectureCode" ng-maxlength="255" maxlength="255" placeholder="Architecture Code" ng-minlength="1" minlength="1"/>

Architecture Code must be longer than 1 character in length.

Architecture Code must be shorter than 255 characters in length.

      Badge Url

        <input class="form-control" id="badgeUrl" name="badgeUrl" type="text" ng-model="code.badgeUrl" ng-maxlength="255" maxlength="255" placeholder="Badge Url" ng-minlength="1" minlength="1"/>

Badge Url must be longer than 1 character in length.

Badge Url must be shorter than 255 characters in length.

      Highlight Class

        <select class="form-control" id="highlightStyle" name="highlightStyle" type="text" ng-model="code.highlightStyle" ng-options="item for item in highlights" ></select>

      <button type="submit" title="Save Changes" class="btn btn-default"> Save</button>

  </form>

	<button type="button" title="Cancel Changes" class="btn btn-primary ng-scope" ng-click="cancel()"> Cancel</button>


text:
import {KernelConfig, Relu} from '@tensorflow/tfjs-core';

import {createUnaryKernelConfig} from './unary_kernel';
export const reluConfig: KernelConfig = createUnaryKernelConfig(Relu);


text:
    (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
     (__GNUC__ >= 4))  // GCC supports "pragma once" correctly since 3.4
#pragma once
#endif

#include <ios>
#include <memory>

#include "yaml-cpp/dll.h"
#include "yaml-cpp/noncopyable.h"

namespace YAML {
class EventHandler;
class Node;
class Scanner;
struct Directives;
struct Token;

class YAML_CPP_API Parser : private noncopyable {
 public:
  Parser();
  Parser(std::istream& in);
  ~Parser();

  operator bool() const;

  void Load(std::istream& in);
  bool HandleNextDocument(EventHandler& eventHandler);

  void PrintTokens(std::ostream& out);

 private:
  void ParseDirectives();
  void HandleDirective(const Token& token);
  void HandleYamlDirective(const Token& token);
  void HandleTagDirective(const Token& token);

 private:
  std::auto_ptr<Scanner> m_pScanner;
  std::auto_ptr<Directives> m_pDirectives;
};
}

#endif  // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66


text:
<!DOCTYPE html>
<title>TWEEN Behavior Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tween.js/17.2.0/Tween.min.js"></script>
<script src="https://cdn.jsdelivr.net/combine/npm/three@0.95.0/build/three.min.js,npm/altspace@2.9.0/dist/altspace.min.js,npm/altspacevr-behaviors@1.1.5/js/altspaceutil.min.js"></script>
<script>
	altspaceutil.getFullspaceApp().then(app => {
		app.anchor.addBehavior(new altspaceutil.behaviors.TWEEN());

		let cube = new THREE.Mesh(new THREE.BoxBufferGeometry(2, 2, 2), new THREE.MeshBasicMaterial({ color: 'red' }));
		app.anchor.add(cube);

		let forward = new TWEEN.Tween(cube.position).to({ x: 2 }, 1000).easing(TWEEN.Easing.Back.Out);
		let reverse = new TWEEN.Tween(cube.position).to({ x: -2 }, 1000).easing(TWEEN.Easing.Back.Out);
		forward.chain(reverse);
		reverse.chain(forward);
		forward.start();
	});
</script>


text:
package com.wxweven.http;

/**
 * @author wxweven
 * @date 2017/8/18
 */
public class TPVO {
    private String appkey;
    private String spanname;
    private Integer costMean;
    private Integer count;
    private Integer countClient;
    private Integer failCount;
    private Integer failCountClient;
    private Integer upper;
    private Integer upper50;
    private Integer upper90;
    private Integer upper95;
    private Integer upper99;
    private Integer upper999;

    public String getAppkey() {
        return appkey;
    }

    public void setAppkey(String appkey) {
        this.appkey = appkey;
    }

    public String getSpanname() {
        return spanname;
    }

    public void setSpanname(String spanname) {
        this.spanname = spanname;
    }

    public Integer getCostMean() {
        return costMean;
    }

    public void setCostMean(Integer costMean) {
        this.costMean = costMean;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getCountClient() {
        return countClient;
    }

    public void setCountClient(Integer countClient) {
        this.countClient = countClient;
    }

    public Integer getFailCount() {
        return failCount;
    }

    public void setFailCount(Integer failCount) {
        this.failCount = failCount;
    }

    public Integer getFailCountClient() {
        return failCountClient;
    }

    public void setFailCountClient(Integer failCountClient) {
        this.failCountClient = failCountClient;
    }

    public Integer getUpper() {
        return upper;
    }

    public void setUpper(Integer upper) {
        this.upper = upper;
    }

    public Integer getUpper50() {
        return upper50;
    }

    public void setUpper50(Integer upper50) {
        this.upper50 = upper50;
    }

    public Integer getUpper90() {
        return upper90;
    }

    public void setUpper90(Integer upper90) {
        this.upper90 = upper90;
    }

    public Integer getUpper95() {
        return upper95;
    }

    public void setUpper95(Integer upper95) {
        this.upper95 = upper95;
    }

    public Integer getUpper99() {
        return upper99;
    }

    public void setUpper99(Integer upper99) {
        this.upper99 = upper99;
    }

    public Integer getUpper999() {
        return upper999;
    }

    public void setUpper999(Integer upper999) {
        this.upper999 = upper999;
    }

    @Override
    public String toString() {
        return "TPVO{" +
                "appkey='" + appkey + '\'' +
                ", spanname='" + spanname + '\'' +
                ", costMean=" + costMean +
                ", count=" + count +
                ", countClient=" + countClient +
                ", failCount=" + failCount +
                ", failCountClient=" + failCountClient +
                ", upper=" + upper +
                ", upper50=" + upper50 +
                ", upper90=" + upper90 +
                ", upper95=" + upper95 +
                ", upper99=" + upper99 +
                ", upper999=" + upper999 +
                '}';
    }
}


text:
        About posting a job

    |

        Your job posted

    |
    Your available coins

    <?php echo $employerCoins; ?>

                    Post your vacant position now! and get hire the best.

                    We will help to improve your business


text:
ARUSR=railway
ARDBN=fullrailway

. ${HOME}/bin/ar-env.sh

COLLECTION=`echo $@`
if [ $# = 0 ]; then
   COLLECTION=`cat -`
fi

node  <<- @EOF
Database = require('arangojs').Database;
db = new Database({url: 'http://${ARUSR}:${ARPWD}@${ARSVR}:8529', databaseName: '${ARDBN}' });

db.edgeCollection('${COLLECTION}').drop()
    .then(() => console.log("dropped ${COLLECTION}"),
          err => console.error("No ${COLLECTION}"))
    .then(() => {
        console.log("create ${COLLECTION}");
        db.edgeCollection('${COLLECTION}').create();
        console.log("created ${COLLECTION}");},
          err => console.error("cannot create ${COLLECTION}"));
@EOF