text:
package egovframework.com.sym.bat.web;
import java.util.List;

import egovframework.com.cmm.EgovMessageSource;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
import egovframework.com.sym.bat.service.BatchOpert;
import egovframework.com.sym.bat.service.EgovBatchOpertService;
import egovframework.com.sym.bat.validation.BatchOpertValidator;

import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import egovframework.rte.fdl.property.EgovPropertyService;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springmodules.validation.commons.DefaultBeanValidator;

/**
 * 배치작업관리에 대한 controller 클래스를 정의한다.
 *
 * 배치작업관리에 대한 등록, 수정, 삭제, 조회 기능을 제공한다.
 * 배치작업관리의 조회기능은 목록조회, 상세조회로 구분된다.
 * @author 김진만
 * @since 2010.06.17
 * @version 1.0
 * @updated 17-6-2010 오전 10:27:13
 * @see
 * <pre>
 * == 개정이력(Modification Information) ==
 *
 *   수정일       수정자           수정내용
 *  -------     --------    ---------------------------
 *  2010.06.17   김진만     최초 생성
 *  2011.8.26	정진오			IncludedInfo annotation 추가
 * </pre>
 */

@Controller
public class EgovBatchOpertController {

	/** egovBatchOpertService */
	@Resource(name = "egovBatchOpertService")
	private EgovBatchOpertService egovBatchOpertService;

	/* Property 서비스 */
    @Resource(name="propertiesService")
    private EgovPropertyService propertyService;

    /* 메세지 서비스 */
    @Resource(name="egovMessageSource")
    private EgovMessageSource egovMessageSource;

    /* common validator */
    @Autowired
    private DefaultBeanValidator beanValidator;

    /* batchOpert bean validator */
    @Resource(name="batchOpertValidator")
    private BatchOpertValidator batchOpertValidator;

    /** ID Generation */
	@Resource(name="egovBatchOpertIdGnrService")
	private EgovIdGnrService idgenService;

	/** logger */
	private static final Logger LOGGER = LoggerFactory.getLogger(EgovBatchOpertController.class);

    /**
	 * 배치작업을 삭제한다.
	 * @return 리턴URL
	 *
	 * @param batchOpert 삭제대상 배치작업model
	 * @param model		ModelMap
	 * @exception Exception Exception
	 */
    @RequestMapping("/sym/bat/deleteBatchOpert.do")
	public String deleteBatchOpert(BatchOpert batchOpert, ModelMap model)
	  throws Exception{
		Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    	if(!isAuthenticated) {
    		model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
        	return "egovframework/com/uat/uia/EgovLoginUsr";
    	}

    	egovBatchOpertService.deleteBatchOpert(batchOpert);

    	return "forward:/sym/bat/getBatchOpertList.do";
	}

	/**
	 * 배치작업을 등록한다.
	 * @return 리턴URL
	 *
	 * @param batchOpert 등록대상 배치작업model
	 * @param bindingResult	BindingResult
	 * @param model			ModelMap
	 * @exception Exception Exception
	 */
    @RequestMapping("/sym/bat/addBatchOpert.do")
	public String insertBatchOpert(BatchOpert batchOpert, BindingResult bindingResult, ModelMap model)
	  throws Exception{
    	// 0. Spring Security 사용자권한 처리
    	Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    	if(!isAuthenticated) {
    		model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
        	return "egovframework/com/uat/uia/EgovLoginUsr";
    	}

		//로그인 객체 선언
		LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();

        beanValidator.validate(batchOpert, bindingResult);
        batchOpertValidator.validate(batchOpert, bindingResult);
    	if (bindingResult.hasErrors()){
    		return "egovframework/com/sym/bat/EgovBatchOpertRegist";
		}else{
			batchOpert.setBatchOpertId(idgenService.getNextStringId());
    		//아이디 설정
			batchOpert.setLastUpdusrId(loginVO.getUniqId());
			batchOpert.setFrstRegisterId(loginVO.getUniqId());

			egovBatchOpertService.insertBatchOpert(batchOpert);
	        //Exception 없이 진행시 등록성공메시지
	        model.addAttribute("resultMsg", "success.common.insert");
		}
    	return "forward:/sym/bat/getBatchOpertList.do";
	}

	/**
	 * 배치작업정보을 상세조회한다.
	 * @return 리턴URL
	 *
	 * @param batchOpert 조회대상 배치작업model
	 * @param model		ModelMap
	 * @exception Exception Exception
	 */
    @RequestMapping("/sym/bat/getBatchOpert.do")
	public String selectBatchOpert(@ModelAttribute("searchVO")BatchOpert batchOpert, ModelMap model)
	  throws Exception{
    	LOGGER.debug(" 조회조건 : {}", batchOpert);
		BatchOpert result = egovBatchOpertService.selectBatchOpert(batchOpert);
		model.addAttribute("resultInfo", result);
		LOGGER.debug(" 결과값 : {}", result);

		return "egovframework/com/sym/bat/EgovBatchOpertDetail";
	}

	/**
	 * 등록화면을 위한 배치작업정보을 조회한다.
	 * @return 리턴URL
	 *
	 * @param batchOpert 조회대상 배치작업model
	 * @param model		ModelMap
	 * @exception Exception Exception
	 */
	@RequestMapping("/sym/bat/getBatchOpertForRegist.do")
	public String selectBatchOpertForRegist(@ModelAttribute("searchVO")BatchOpert batchOpert, ModelMap model)
	  throws Exception{
        model.addAttribute("batchOpert", batchOpert);

        return "egovframework/com/sym/bat/EgovBatchOpertRegist";
	}

	/**
	 * 수정화면을 위한 배치작업정보을 조회한다.
	 * @return 리턴URL
	 *
	 * @param batchOpert 조회대상 배치작업model
	 * @param model		ModelMap
	 * @exception Exception Exception
	 */
	@RequestMapping("/sym/bat/getBatchOpertForUpdate.do")
	public String selectBatchOpertForUpdate(@ModelAttribute("searchVO")BatchOpert batchOpert, ModelMap model)
	  throws Exception{
		LOGGER.debug(" 조회조건 : {}", batchOpert);
		BatchOpert result = egovBatchOpertService.selectBatchOpert(batchOpert);
		model.addAttribute("batchOpert", result);
		LOGGER.debug(" 결과값 : {}", result);

		return "egovframework/com/sym/bat/EgovBatchOpertUpdt";
	}

	/**
	 * 배치작업 목록을 조회한다.
	 * @return 리턴URL
	 *
	 * @param searchVO 목록조회조건VO
	 * @param model		ModelMap
	 * @param popupAt	팝업여부
	 * @exception Exception Exception
	 */
	@SuppressWarnings("unchecked")
	@IncludedInfo(name="배치작업관리", listUrl="/sym/bat/getBatchOpertList.do", order = 1120 ,gid = 60)
	@RequestMapping("/sym/bat/getBatchOpertList.do")
	public String selectBatchOpertList(@ModelAttribute("searchVO")BatchOpert searchVO, ModelMap model, @RequestParam(value="popupAt", required=false)String popupAt)
	  throws Exception{
		searchVO.setPageUnit(propertyService.getInt("pageUnit"));
		searchVO.setPageSize(propertyService.getInt("pageSize"));

		PaginationInfo paginationInfo = new PaginationInfo();
		paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
		paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
		paginationInfo.setPageSize(searchVO.getPageSize());

		searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
		searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
		searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());

		List<BatchOpert> resultList = (List<BatchOpert>) egovBatchOpertService.selectBatchOpertList(searchVO);
		int totCnt = egovBatchOpertService.selectBatchOpertListCnt(searchVO);

		paginationInfo.setTotalRecordCount(totCnt);

		model.addAttribute("resultList", resultList);
		model.addAttribute("resultCnt", totCnt);
		model.addAttribute("paginationInfo", paginationInfo);
		if ("Y".equals(popupAt)) {
			// Popup 화면이면
			return "egovframework/com/sym/bat/EgovBatchOpertListPopup";
		} else {
			// 메인화면 호출이면
			return "egovframework/com/sym/bat/EgovBatchOpertList";
		}

	}

	/**
	 * 배치작업을 수정한다.
	 * @return 리턴URL
	 *
	 * @param batchOpert 수정대상 배치작업model
	 * @param bindingResult		BindingResult
	 * @param model				ModelMap
	 * @exception Exception Exception
	 */
	@RequestMapping("/sym/bat/updateBatchOpert.do")
	public String updateBatchOpert(BatchOpert batchOpert, BindingResult bindingResult, ModelMap model)
	  throws Exception{
    	// 0. Spring Security 사용자권한 처리
    	Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    	if(!isAuthenticated) {
    		model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
        	return "egovframework/com/uat/uia/EgovLoginUsr";
    	}
		//로그인 객체 선언
		LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();

		beanValidator.validate(batchOpert, bindingResult);
        batchOpertValidator.validate(batchOpert, bindingResult);
		if (bindingResult.hasErrors()) {
			model.addAttribute("batchOpert", batchOpert);
		    return "egovframework/com/sym/bat/EgovBatchOpertUpdt";
		}

		// 정보 업데이트
		batchOpert.setLastUpdusrId(loginVO.getUniqId());
	    egovBatchOpertService.updateBatchOpert(batchOpert);

		return "forward:/sym/bat/getBatchOpertList.do";

	}

	/**
	 * 배치작업 조회팝업을 실행한다.
	 * @return 리턴URL
	 *
	 * @param searchVO 목록조회조건VO
	 * @param model		ModelMap
	 * @exception Exception Exception
	 */
	@RequestMapping("/sym/bat/getBatchOpertListPopup.do")
	public String openPopupWindow(@ModelAttribute("searchVO") BatchOpert searchVO, ModelMap model)
	  throws Exception{
		return "egovframework/com/sym/bat/EgovBatchOpertListPopupFrame";
	}

}

redpajama_set_name: RedPajamaGithub


text:
package main

import (
	"fmt"

	goz "github.com/20tab/gozmo"
)

// CrossMove is a behaviour allowing movements with arrow keys.
type CrossMove struct {
	kbd   *goz.Keyboard
	speed float32
}

func (cross *CrossMove) Start(gameObject *goz.GameObject) {
	// 5 units per second.
	cross.speed = 5
}

// gameObject.Position is a Vector2 struct: 0 is x, 1 is y.
func (cross *CrossMove) Update(gameObject *goz.GameObject) {
	if cross.kbd.GetKey(goz.KeyRight) {
		gameObject.Position[0] += cross.speed * gameObject.DeltaTime
	}

	if cross.kbd.GetKey(goz.KeyLeft) {
		gameObject.Position[0] -= cross.speed * gameObject.DeltaTime
	}

	if cross.kbd.GetKey(goz.KeyUp) {
		gameObject.Position[1] += cross.speed * gameObject.DeltaTime
	}

	if cross.kbd.GetKey(goz.KeyDown) {
		gameObject.Position[1] -= cross.speed * gameObject.DeltaTime
	}
}

type DrawCallsPrinter struct {
	lastValue float64
}

func (dcp *DrawCallsPrinter) Start(gameObject *goz.GameObject) {}
func (dcp *DrawCallsPrinter) Update(gameObject *goz.GameObject) {
	newValue := goz.GetPerFrameStats("GL.DrawCalls")
	if newValue != dcp.lastValue {
		fmt.Println("GL.DrawCalls =", newValue)
	}
	dcp.lastValue = newValue
}

func main() {

	window := goz.OpenWindow(1024, 768, "Gozmo")

	scene001 := goz.NewScene("Scene 1")

	// Load a texture into the scene.
	scene001.NewTextureFromFilename("spyke_red", "assets/spyke_red.png")

	fmt.Println("scene", scene001.Name, "created")

	spyke := scene001.NewGameObject("Player001")
	// Add a component by name.
	spyke.AddComponentByName("render", "Renderer", nil)
	// Set a component attribute with SetAttr.
	spyke.SetAttr("render", "texture", "spyke_red")

	keyboard := goz.NewKeyboard()
	spyke.AddComponent("kbd", keyboard)

	// Add another component by reference.
	spyke.AddComponent("move_with_arrows", &CrossMove{kbd: keyboard})

	stats := scene001.NewGameObject("Stats")
	// Ensure stats are managed last.
	stats.SetOrder(9999)
	stats.AddComponent("stats", &DrawCallsPrinter{})

	window.SetScene(scene001)
	window.Run()

}


text:
using ServiceStack.FluentValidation;

namespace Demo.Application.ServiceStack.Accounting.Account.Validators
{
    public class Destroy : AbstractValidator<Services.Destroy>
    {
        public Destroy()
        {
            RuleFor(x => x.AccountId).NotEmpty();
        }
    }
}


text:
// -*- C++ -*-
// $Id: io_decorators.h,v 1.5 2002/07/02 22:10:51 t1mpy Exp $

// id3lib: a software library for creating and manipulating id3v1/v2 tags
// Copyright 1999, 2000  Scott Thomas Haug

// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Library General Public License as published by
// the Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
// License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with this library; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

// The id3lib authors encourage improvements and optimisations to be sent to
// the id3lib coordinator.  Please see the README file for details on where to
// send such submissions.  See the AUTHORS file for a list of people who have
// contributed to id3lib.  See the ChangeLog file for a list of changes to
// id3lib.  These files are distributed with id3lib at
// http://download.sourceforge.net/id3lib/

#ifndef _ID3LIB_READER_DECORATORS_H_
#define _ID3LIB_READER_DECORATORS_H_

#include "readers.h"
#include "io_helpers.h"
#include "id3/utils.h" // has <config.h> "id3/id3lib_streams.h" "id3/globals.h" "id3/id3lib_strings.h"

namespace dami
{
  namespace io
  {
    /**
     * Set a window on the buffer.  Characters can only be read within this
     * window.
     */
    class ID3_CPP_EXPORT WindowedReader : public ID3_Reader
    {
      typedef ID3_Reader SUPER;

      ID3_Reader& _reader;
      pos_type _beg, _end;

      bool inWindow(pos_type cur)
      { return this->getBeg() <= cur && cur < this->getEnd(); }

     public:
      explicit WindowedReader(ID3_Reader& reader)
        : _reader(reader), _beg(reader.getBeg()), _end(reader.getEnd()) { ; }

      WindowedReader(ID3_Reader& reader, size_type size)
        : _reader(reader), _beg(reader.getBeg()), _end(reader.getEnd())
      { this->setWindow(this->getCur(), size); }

      WindowedReader(ID3_Reader& reader, pos_type beg, size_type size)
        : _reader(reader), _beg(reader.getBeg()), _end(reader.getEnd())
      { this->setWindow(beg, size); }

      void setWindow(pos_type beg, size_type size);

      pos_type setBeg(pos_type);
      pos_type setCur(pos_type cur)
      {
        return _reader.setCur(mid(this->getBeg(), cur, this->getEnd()));
      }
      pos_type setEnd(pos_type);

      pos_type getCur() { return _reader.getCur(); }
      pos_type getBeg() { return _beg; }
      pos_type getEnd() { return _end; }

      bool inWindow() { return this->inWindow(this->getCur()); }

      int_type readChar();
      int_type peekChar();

      size_type readChars(char_type buf[], size_type len);
      size_type readChars(char buf[], size_type len)
      {
        return this->readChars((char_type*) buf, len);
      }

      void close() { ; }
    };

    class ID3_CPP_EXPORT CharReader : public ID3_Reader
    {
      typedef ID3_Reader SUPER;

     protected:
      ID3_Reader& _reader;

    public:

      CharReader(ID3_Reader& reader) : _reader(reader) { }
      virtual ~CharReader() { ; }

      /**
       * Read \c len characters into the array \c buf.  Since the stream needs
       * might have been unsynced, this function copies the characters one at a
       * time.
       */
      size_type readChars(char_type buf[], size_type len);
      size_type readChars(char buf[], size_type len)
      {
        return this->readChars((char_type*) buf, len);
      }

      void close() { ; }
      int_type peekChar() { return _reader.peekChar(); }

      pos_type getBeg() { return _reader.getBeg(); }
      pos_type getCur() { return _reader.getCur(); }
      pos_type getEnd() { return _reader.getEnd(); }

      pos_type setCur(pos_type cur) { return _reader.setCur(cur); }
    };

    class ID3_CPP_EXPORT LineFeedReader : public CharReader
    {
      typedef CharReader SUPER;

     public:
      LineFeedReader(ID3_Reader& reader) : SUPER(reader) { ; }
      int_type readChar();
    };

    class ID3_CPP_EXPORT UnsyncedReader : public CharReader
    {
      typedef CharReader SUPER;

     public:
      UnsyncedReader(ID3_Reader& reader) : SUPER(reader) { }
      int_type readChar();
    };

    class ID3_CPP_EXPORT CompressedReader : public ID3_MemoryReader
    {
      char_type* _uncompressed;
     public:
      CompressedReader(ID3_Reader& reader, size_type newSize);
      virtual ~CompressedReader();
    };

    class ID3_CPP_EXPORT UnsyncedWriter : public ID3_Writer
    {
      typedef ID3_Writer SUPER;

      ID3_Writer& _writer;
      int_type _last;
      size_type _numSyncs;

     public:
      UnsyncedWriter(ID3_Writer& writer)
        : _writer(writer), _last('\0'), _numSyncs(0)
      { ; }

      size_type getNumSyncs() const { return _numSyncs; }
      int_type writeChar(char_type ch);
      void flush();

      /**
       * Write \c len characters into the array \c buf.  Since the stream needs
       * might have been unsynced, this function copies the characters one at a
       * time.
       */
      size_type writeChars(const char_type[], size_type len);
      size_type writeChars(const char buf[], size_type len)
      {
        return this->writeChars(reinterpret_cast<const char_type *>(buf), len);
      }

      void close() { ; }

      pos_type getBeg() { return _writer.getBeg(); }
      pos_type getCur() { return _writer.getCur(); }
      pos_type getEnd() { return _writer.getEnd(); }
    };

    class CompressedWriter : public ID3_Writer
    {
      typedef ID3_Writer SUPER;

      ID3_Writer& _writer;
      BString _data;
      size_type _origSize;
     public:

      explicit CompressedWriter(ID3_Writer& writer)
        : _writer(writer), _data(), _origSize(0)
      { ; }
      virtual ~CompressedWriter() { this->flush(); }

      size_type getOrigSize() const { return _origSize; }

      void flush();

      size_type writeChars(const char_type buf[], size_type len);
      size_type writeChars(const char buf[], size_type len)
      {
        return this->writeChars(reinterpret_cast<const char_type*>(buf), len);
      }

      pos_type getCur() { return _data.size(); }
      void close() { ; }
    };
  };
};

#endif /* _ID3LIB_READER_DECORATORS_H_ */


text:
<?php
/**
 * This is the template for generating the model class of a specified table.
 * DO NOT EDIT THIS FILE! It may be regenerated with Gii.
 *
 * @var yii\web\View $this
 * @var schmunk42\giiant\generators\model\Generator $generator
 * @var string $tableName full table name
 * @var string $className class name
 * @var yii\db\TableSchema $tableSchema
 * @var string[] $labels list of attribute labels (name => label)
 * @var string[] $rules list of validation rules
 * @var array $relations list of relations (name => relation declaration)
 */

echo "<?php\n";
?>

namespace <?= $generator->ns ?>\base;

use Yii;
<?php if (isset($translation)): ?>
use dosamigos\translateable\TranslateableBehavior;
<?php endif; ?>

/**
 * This is the base-model class for table "<?= $tableName ?>".
 *
<?php foreach ($tableSchema->columns as $column): ?>
 * @property <?= "{$column->phpType} \${$column->name}\n" ?>
<?php endforeach; ?>
<?php if (!empty($relations)): ?>
 *
<?php foreach ($relations as $name => $relation): ?>
 * @property \<?=$ns?>\<?= $relation[1] . ($relation[2] ? '[]' : '') . ' $' . lcfirst($name) . "\n" ?>
<?php endforeach; ?>
<?php endif; ?>
 */
class <?= $className ?> extends <?= '\\' . ltrim($generator->baseClass, '\\') . "\n" ?>
{

<?php
    $traits = $generator->baseTraits;
    if ($traits) {
        echo "use {$traits};";
    }
?>

<?php
if(!empty($enum)){
?>
    /**
    * ENUM field values
    */
<?php
    foreach($enum as $column_name => $column_data){
        foreach ($column_data['values'] as $enum_value){
            echo '    const ' . $enum_value['const_name'] . ' = \'' . $enum_value['value'] . '\';' . PHP_EOL;
        }
    }
?>
    var $enum_labels = false;
<?php
}
?>
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '<?= $tableName ?>';
    }
<?php if (isset($translation)): ?>
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'translatable' => [
                'class' => TranslateableBehavior::className(),
                // in case you renamed your relation, you can setup its name
                // 'relation' => 'translations',
<?php if ($generator->languageCodeColumn !== 'language'): ?>
                'languageField' => '<?= $generator->languageCodeColumn ?>',
<?php endif; ?>
                'translationAttributes' => [
                    <?= "'" . implode("',\n                    '", $translation['fields']) . "'\n" ?>
                ]
            ],
        ];
    }
<?php endif; ?>

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [<?= "\n            " . implode(",\n            ", $rules) . "\n        " ?>];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
<?php foreach ($labels as $name => $label): ?>
            <?= "'$name' => " . $generator->generateString($label) . ",\n" ?>
<?php endforeach; ?>
        ];
    }
<?php foreach ($relations as $name => $relation): ?>

    /**
     * @return \yii\db\ActiveQuery
     */
    public function get<?= $name ?>()
    {
        <?= $relation[0] . "\n" ?>
    }
<?php endforeach; ?>

<?php if (isset($translation)): ?>
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTranslations()
    {
        <?= $translation['code'] . "\n"?>
    }
<?php endif; ?>

<?php if ($queryClassName): ?>
    <?php
    $queryClassFullName = ($generator->ns === $generator->queryNs) ? $queryClassName : '\\' . $generator->queryNs . '\\' . $queryClassName;
    echo "\n";
    ?>
    /**
     * @inheritdoc
     * @return <?= $queryClassFullName ?> the active query used by this AR class.
     */
    public static function find()
    {
        return new <?= $queryClassFullName ?>(get_called_class());
    }
<?php endif; ?>

<?php
    foreach($enum as $column_name => $column_data){
?>

    /**
     * get column <?php echo $column_name?> enum value label
     * @param string $value
     * @return string
     */
    public static function <?php echo $column_data['func_get_label_name']?>($value){
        $labels = self::<?php echo $column_data['func_opts_name']?>();
        if(isset($labels[$value])){
            return $labels[$value];
        }
        return $value;
    }

    /**
     * column <?php echo $column_name?> ENUM value labels
     * @return array
     */
    public static function <?php echo $column_data['func_opts_name']?>()
    {
        return [
<?php
        foreach($column_data['values'] as $k => $value){
?>
            self::<?php echo $value['const_name'];?> => <?php echo $generator->generateString($value['label'])?>,
<?php
        }
?>
        ];
    }
<?php
    }

?>

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         version="2.5">
    <display-name>wsa.fromwsdl.custom</display-name>
    <description>wsa.fromwsdl.custom</description>
    <listener>
        <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>client.jaxws21.epr_get_port</servlet-name>
        <display-name>client.jaxws21.epr_get_port</display-name>
        <description>JAX-WS endpoint - custom</description>
        <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>client.jaxws21.epr_get_port</servlet-name>
        <url-pattern>/hello</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>60</session-timeout>
    </session-config>
</web-app>


text:
package org.jboss.pnc.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.validation.constraints.NotNull;

/**
 * @author avibelli
 *
 */
@Entity
public class Product implements GenericEntity<Integer> {

    private static final long serialVersionUID = -9022966336791211855L;

    public static final String DEFAULT_SORTING_FIELD = "name";
    public static final String SEQUENCE_NAME = "product_id_seq";

    @Id
    @SequenceGenerator(name = SEQUENCE_NAME, sequenceName = SEQUENCE_NAME, allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQUENCE_NAME)
    private Integer id;

    @NotNull
    private String name;

    private String description;

    private String abbreviation;

    private String productCode;

    private String pgmSystemName;

    @OneToMany(mappedBy = "product", cascade = { CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.DETACH,
            CascadeType.REMOVE })
    private Set<ProductVersion> productVersions;

    /**
     * Instantiates a new product.
     */
    public Product() {
        productVersions = new HashSet<>();
    }

    public Product(String name, String description) {
        this();
        this.name = name;
        this.description = description;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return Shortened informal name of the product
     */
    public String getAbbreviation() {
        return abbreviation;
    }

    public void setAbbreviation(String abbreviation) {
        this.abbreviation = abbreviation;
    }

    /**
     * @return Product code in internal systems
     */
    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    /**
     * @return Name of the product used by program management planning system
     */
    public String getPgmSystemName() {
        return pgmSystemName;
    }

    public void setPgmSystemName(String pgmSystemName) {
        this.pgmSystemName = pgmSystemName;
    }

    /**
     * @return the productVersions
     */
    public Set<ProductVersion> getProductVersions() {
        return productVersions;
    }

    /**
     * @param productVersions the productVersions to set
     */
    public void setProductVersions(Set<ProductVersion> productVersions) {
        this.productVersions = productVersions;
    }

    /**
     * Add a version for the Product
     *
     * @param version Associate a new version with this product
     * @return True if the product did not already contain this version
     */
    public boolean addVersion(ProductVersion version) {
        return productVersions.add(version);
    }

    public static class Builder {

        private Integer id;

        private String name;

        private String description;

        private String abbreviation;

        private String productCode;

        private String pgmSystemName;

        private Set<ProductVersion> productVersions;

        private Builder() {
            productVersions = new HashSet<>();
        }

        public static Builder newBuilder() {
            return new Builder();
        }

        public Product build() {
            Product product = new Product();
            product.setId(id);
            product.setName(name);
            product.setDescription(description);
            product.setAbbreviation(abbreviation);
            product.setProductCode(productCode);
            product.setPgmSystemName(pgmSystemName);

            // Set the bi-directional mapping
            for (ProductVersion productVersion : productVersions) {
                productVersion.setProduct(product);
            }
            product.setProductVersions(productVersions);

            return product;
        }

        public Builder id(Integer id) {
            this.id = id;
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder description(String description) {
            this.description = description;
            return this;
        }

        public Builder abbreviation(String abbreviation) {
            this.abbreviation = abbreviation;
            return this;
        }

        public Builder productCode(String productCode) {
            this.productCode = productCode;
            return this;
        }

        public Builder pgmSystemName(String pgmSystemName) {
            this.pgmSystemName = pgmSystemName;
            return this;
        }

        public Builder productVersion(ProductVersion productVersion) {
            this.productVersions.add(productVersion);
            return this;
        }

        public Builder productVersions(Set<ProductVersion> productVersions) {
            this.productVersions = productVersions;
            return this;
        }

        public Builder productVersion(ProductVersion.Builder productVersionBuilder) {
            this.productVersions.add(productVersionBuilder.build());
            return this;
        }

    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.spi.type;

import com.facebook.presto.spi.ConnectorSession;
import com.facebook.presto.spi.block.BlockBuilder;
import com.facebook.presto.spi.block.BlockBuilderStatus;
import com.facebook.presto.spi.block.BlockCursor;
import com.facebook.presto.spi.block.BlockEncodingFactory;
import com.facebook.presto.spi.block.FixedWidthBlockUtil.FixedWidthBlockBuilderFactory;
import io.airlift.slice.Slice;
import io.airlift.slice.SliceOutput;

import static com.facebook.presto.spi.block.FixedWidthBlockUtil.createIsolatedFixedWidthBlockBuilderFactory;
import static com.facebook.presto.spi.type.DateTimeEncoding.unpackMillisUtc;
import static io.airlift.slice.SizeOf.SIZE_OF_LONG;

public final class TimestampWithTimeZoneType
        implements FixedWidthType
{
    public static final TimestampWithTimeZoneType TIMESTAMP_WITH_TIME_ZONE = new TimestampWithTimeZoneType();

    public static TimestampWithTimeZoneType getInstance()
    {
        return TIMESTAMP_WITH_TIME_ZONE;
    }

    private static final FixedWidthBlockBuilderFactory BLOCK_BUILDER_FACTORY = createIsolatedFixedWidthBlockBuilderFactory(TIMESTAMP_WITH_TIME_ZONE);
    public static final BlockEncodingFactory<?> BLOCK_ENCODING_FACTORY = BLOCK_BUILDER_FACTORY.getBlockEncodingFactory();

    private TimestampWithTimeZoneType()
    {
    }

    @Override
    public String getName()
    {
        return "timestamp with time zone";
    }

    @Override
    public Class<?> getJavaType()
    {
        return long.class;
    }

    @Override
    public int getFixedSize()
    {
        return (int) SIZE_OF_LONG;
    }

    @Override
    public Object getObjectValue(ConnectorSession session, Slice slice, int offset)
    {
        return new SqlTimestampWithTimeZone(slice.getLong(offset));
    }

    @Override
    public BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus)
    {
        return BLOCK_BUILDER_FACTORY.createFixedWidthBlockBuilder(blockBuilderStatus);
    }

    @Override
    public BlockBuilder createFixedSizeBlockBuilder(int positionCount)
    {
        return BLOCK_BUILDER_FACTORY.createFixedWidthBlockBuilder(positionCount);
    }

    @Override
    public boolean getBoolean(Slice slice, int offset)
    {
        throw new UnsupportedOperationException();
    }

    @Override
    public void writeBoolean(SliceOutput sliceOutput, boolean value)
    {
        throw new UnsupportedOperationException();
    }

    @Override
    public long getLong(Slice slice, int offset)
    {
        return slice.getLong(offset);
    }

    @Override
    public void writeLong(SliceOutput sliceOutput, long value)
    {
        sliceOutput.writeLong(value);
    }

    @Override
    public double getDouble(Slice slice, int offset)
    {
        throw new UnsupportedOperationException();
    }

    @Override
    public void writeDouble(SliceOutput sliceOutput, double value)
    {
        throw new UnsupportedOperationException();
    }

    @Override
    public Slice getSlice(Slice slice, int offset)
    {
        return slice.slice(offset, getFixedSize());
    }

    @Override
    public void writeSlice(SliceOutput sliceOutput, Slice value, int offset)
    {
        sliceOutput.writeBytes(value, offset, SIZE_OF_LONG);
    }

    public boolean equalTo(Slice leftSlice, int leftOffset, Slice rightSlice, int rightOffset)
    {
        long leftValue = unpackMillisUtc(leftSlice.getLong(leftOffset));
        long rightValue = unpackMillisUtc(rightSlice.getLong(rightOffset));
        return leftValue == rightValue;
    }

    public boolean equalTo(Slice leftSlice, int leftOffset, BlockCursor rightCursor)
    {
        long leftValue = unpackMillisUtc(leftSlice.getLong(leftOffset));
        long rightValue = unpackMillisUtc(rightCursor.getLong());
        return leftValue == rightValue;
    }

    public int hash(Slice slice, int offset)
    {
        long value = unpackMillisUtc(slice.getLong(offset));
        return (int) (value ^ (value >>> 32));
    }

    public int compareTo(Slice leftSlice, int leftOffset, Slice rightSlice, int rightOffset)
    {
        long leftValue = unpackMillisUtc(leftSlice.getLong(leftOffset));
        long rightValue = unpackMillisUtc(rightSlice.getLong(rightOffset));
        return Long.compare(leftValue, rightValue);
    }

    public void appendTo(Slice slice, int offset, BlockBuilder blockBuilder)
    {
        long value = slice.getLong(offset);
        blockBuilder.appendLong(value);
    }

    @Override
    public void appendTo(Slice slice, int offset, SliceOutput sliceOutput)
    {
        sliceOutput.writeBytes(slice, offset, (int) SIZE_OF_LONG);
    }

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


text: apt update && apt upgrade && apt autoremove


text:
// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

// Description: VSTS Constants class

#region Using directives

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
#endregion

namespace Microsoft.TeamFoundation.Converters.WorkItemTracking
{
    internal enum ConverterSource
    {
        MIN = 0,
        PS = MIN,
        CQ = 1,
        MAX = CQ + 1
    }

    internal static class VSTSConstants
    {
        /*
         * fix for bug#11206
         * there is additional constraint that some of the core fields names are internal
         * and cannot be used by the user... for temporary solution listing out all those
         * core fields.. shall go out once there is some better solution from currituck
         */
        private static Dictionary<string, bool> m_tfsInternalFields;
        internal static Dictionary<string, bool> TfsInternalFields
        {
            get
            {
                if (m_tfsInternalFields == null)
                {
                    m_tfsInternalFields = new Dictionary<string, bool>(TFStringComparer.WorkItemFieldReferenceName);

                    // add all the internal field ref names from Currituck
                    foreach (string internalRefName in InternalFields.RefNamesAll)
                    {
                        m_tfsInternalFields.Add(internalRefName, false);
                    }

                    // now manually add the field names as well
                    string[] hiddenFields = { "attached files",
                        "changed set",
                        "inadminonlytreeflag",
                        "indeletedtreeflag",
                        "linked files",
                        "node type",
                        "not a field",
                        "personid",
                        "projectid",
                        "related links",
                        "tf server",
                        "tree",
                        "work item form",
                        "work item formid",
                        "workitem",
                        "area level 1",
                        "area level 2",
                        "area level 3",
                        "area level 4",
                        "area level 5",
                        "area level 6",
                        "area level 7",
                        "iteration level 1",
                        "iteration level 2",
                        "iteration level 3",
                        "iteration level 4",
                        "iteration level 5",
                        "iteration level 6",
                        "iteration level 7",
                        "bis links" };
                    foreach (string hiddenField in hiddenFields)
                    {
                        m_tfsInternalFields.Add(hiddenField, false);
                    }
                }

                return m_tfsInternalFields;
            }
        }

        //originally defined in vset\scm\workitemtracking\common\psdbdal.ch
        internal const string BisProjectPrepend = @"$Project:";
        internal const string HistoryFieldRefName = @"System.History";
        internal const string AreaIdFieldRefName = @"System.AreaId";
        internal const string IterationIdFieldRefName = @"System.IterationId";
        internal const string WorkItemTypeFieldRefName = @"System.WorkItemType";
        internal const string CreatedDateFieldRefName = @"System.CreatedDate";
        internal const string CreatedByFieldRefName = @"System.CreatedBy";
        internal const string StateFieldRefName = @"System.State";
        internal const string ReasonFieldRefName = @"System.Reason";
        internal const string ChangedDateFieldRefName = @"System.ChangedDate";
        internal static string MigrationStatusField = String.Empty;

        // following field names are fetched from TFS sevrer
        // as they may be localized
        private static string m_AreaPathField;
        internal static string AreaPathField
        {
            get
            {
                if (m_AreaPathField == null)
                {
                    m_AreaPathField = VstsConn.store.FieldDefinitions["System.AreaPath"].Name;
                }
                return m_AreaPathField;
            }
        }

        private static string m_IterationPathField;
        internal static string IterationPathField
        {
            get
            {
                if (m_IterationPathField == null)
                {
                    m_IterationPathField = VstsConn.store.FieldDefinitions["System.IterationPath"].Name;
                }
                return m_IterationPathField;
            }
        }

        private static string m_AreaIdField;
        internal static string AreaIdField
        {
            get
            {
                if (m_AreaIdField == null)
                {
                    m_AreaIdField = VstsConn.store.FieldDefinitions["System.AreaId"].Name;
                }
                return m_AreaIdField;
            }
        }

        private static string m_IterationIdField;
        internal static string IterationIdField
        {
            get
            {
                if (m_IterationIdField == null)
                {
                    m_IterationIdField = VstsConn.store.FieldDefinitions["System.IterationId"].Name;
                }
                return m_IterationIdField;
            }
        }

        private static string m_DescriptionField;
        internal static string DescriptionField
        {
            get
            {
                if (m_DescriptionField == null)
                {
                    m_DescriptionField = VstsConn.store.FieldDefinitions["System.Description"].Name;
                }
                return m_DescriptionField;
            }
        }

        internal const int MaxStringFieldLength = 255;

        private static string m_CurrentDate;
        internal static string CurrentDate
        {
            get
            {
                if (m_CurrentDate == null)
                {
                    m_CurrentDate = Microsoft.TeamFoundation.Converters.WorkItemTracking.Common.CommonConstants.ConvertDateToString(TimeZone.CurrentTimeZone.ToUniversalTime(DateTime.Now));
                }
                return m_CurrentDate;
            }
        }

        // fields to be skipped while building initial snapshot
        private static Dictionary<string, bool> m_skipFields;
        internal static Dictionary<string, bool> SkipFields
        {
            get
            {
                if (m_skipFields == null)
                {
                    // initialize while first call
                    m_skipFields = new Dictionary<string, bool>(TFStringComparer.WIConverterFieldRefName);

                    // first add all the inrernal fields which are not visible
                    // using OM but are disallowed to be used by end customer
                    foreach (string internalFld in TfsInternalFields.Keys)
                    {
                        m_skipFields.Add(internalFld, false);
                    }

                    // internal field ref names
                    m_skipFields.Add("System.AttachedFileCount", false);
                    m_skipFields.Add("System.AuthorizedAs", false);
                    m_skipFields.Add("System.ChangedDate", false);
                    m_skipFields.Add("System.ExternalLinkCount", false);
                    m_skipFields.Add("System.HyperLinkCount", false);
                    m_skipFields.Add("System.Id", false);
                    m_skipFields.Add("System.IterationPath", false);
                    m_skipFields.Add("System.NodeName", false);
                    m_skipFields.Add("System.RelatedLinkCount", false);
                    m_skipFields.Add("System.Rev", false);
                    m_skipFields.Add("System.TeamProject", false);
                    m_skipFields.Add("System.RevisedDate", false);

                    // internal field names
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.AttachedFileCount"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.AuthorizedAs"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.ChangedDate"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.ExternalLinkCount"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.HyperLinkCount"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.Id"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.NodeName"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.RelatedLinkCount"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.Rev"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.TeamProject"].Name, false);
                    m_skipFields.Add(VstsConn.store.FieldDefinitions["System.RevisedDate"].Name, false);
                }

                return m_skipFields;
            }
        }

        internal static VSTSConnection VstsConn;

        private static char[] m_unsupportedCSSChars;
        internal static char[] UnsupportedCSSChars
        {
            get
            {
                if (m_unsupportedCSSChars == null)
                {
                    m_unsupportedCSSChars = new char[] { '/', '$', '?', '&', '*', '"', '<', '>', '|', '#', '%', ':', '\t'};
                }
                return m_unsupportedCSSChars;
            }
        }

        internal const string AreaRoot = "ProjectModelHierarchy";
        internal const string IterationRoot = "ProjectLifeCycle";
    } // end of class VSTSConstants
}


text:
package org.apache.zookeeper.test;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.TestableZooKeeper;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.Watcher.Event.KeeperState;
import org.apache.zookeeper.ZooDefs.Ids;
import org.junit.Test;
import org.junit.Assert;

public class SaslAuthFailTest extends ClientBase {
    static {
        System.setProperty("zookeeper.authProvider.1","org.apache.zookeeper.server.auth.SASLAuthenticationProvider");
        System.setProperty("zookeeper.allowSaslFailedClients","true");

        try {
            File tmpDir = createTmpDir();
            File saslConfFile = new File(tmpDir, "jaas.conf");
            FileWriter fwriter = new FileWriter(saslConfFile);

            fwriter.write("" +
                    "Server {\n" +
                    "          org.apache.zookeeper.server.auth.DigestLoginModule required\n" +
                    "          user_super=\"test\";\n" +
                    "};\n" +
                    "Client {\n" +
                    "       org.apache.zookeeper.server.auth.DigestLoginModule required\n" +
                    "       username=\"super\"\n" +
                    "       password=\"test1\";\n" + // NOTE: wrong password ('test' != 'test1') : this is to test SASL authentication failure.
                    "};" + "\n");
            fwriter.close();
            System.setProperty("java.security.auth.login.config",saslConfFile.getAbsolutePath());
        }
        catch (IOException e) {
            // could not create tmp directory to hold JAAS conf file.
        }
    }

    private AtomicInteger authFailed = new AtomicInteger(0);

    @Override
    protected TestableZooKeeper createClient(String hp)
    throws IOException, InterruptedException
    {
        MyWatcher watcher = new MyWatcher();
        return createClient(watcher, hp);
    }

    private class MyWatcher extends CountdownWatcher {
        @Override
        public synchronized void process(WatchedEvent event) {
            if (event.getState() == KeeperState.AuthFailed) {
                synchronized(authFailed) {
                    authFailed.incrementAndGet();
                    authFailed.notify();
                }
            }
            else {
                super.process(event);
            }
        }
    }

    @Test
    public void testBadSaslAuthNotifiesWatch() throws Exception {
        ZooKeeper zk = createClient();
        // wait for authFailed event from client's EventThread.
        synchronized(authFailed) {
            authFailed.wait();
        }
        Assert.assertEquals(authFailed.get(),1);
        zk.close();
    }

    @Test
    public void testAuthFail() throws Exception {
        ZooKeeper zk = createClient();
        try {
            zk.create("/path1", null, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT);
            Assert.fail("Should have gotten exception.");
        } catch(Exception e ) {
            // ok, exception as expected.
            LOG.info("Got exception as expected: " + e);
        } finally {
            zk.close();
        }
    }
}


text:
package com.zyw.horrarndoo.sdk.utils;

import android.text.TextUtils;
import android.text.format.DateFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

/**
 * Created by Horrarndoo on 2017/8/31.
 * <p>
 * 日期时间工具类
 */
public class DateUtils {

    public static final long ONE_SECOND_MILLIONS = 1000;
    public static final long ONE_MINUTE_MILLIONS = 60 * ONE_SECOND_MILLIONS;
    public static final long ONE_HOUR_MILLIONS = 60 * ONE_MINUTE_MILLIONS;
    public static final long ONE_DAY_MILLIONS = 24 * ONE_HOUR_MILLIONS;
    public static final int DAY_OF_YEAR = 365;

    // 日期格式为 2016-02-03 17:04:58
    public static final String PATTERN_DATE = "yyyy年MM月dd日";
    public static final String PATTERN_TIME = "HH:mm:ss";
    public static final String PATTERN_SPLIT = " ";
    public static final String PATTERN = PATTERN_DATE + PATTERN_SPLIT + PATTERN_TIME;

    public static String getShortTime(String dateStr) {
        String str;

        Date date = str2date(dateStr);
        Date curDate = new Date();

        long durTime = curDate.getTime() - date.getTime();
        int dayDiff = calculateDayDiff(date, curDate);

        if (durTime <= 10 * ONE_MINUTE_MILLIONS) {
            str = "刚刚";
        } else if (durTime < ONE_HOUR_MILLIONS) {
            str = durTime / ONE_MINUTE_MILLIONS + "分钟前";
        } else if (dayDiff == 0) {
            str = durTime / ONE_HOUR_MILLIONS + "小时前";
        } else if (dayDiff == -1) {
            str = "昨天" + DateFormat.format("HH:mm", date);
        } else if (isSameYear(date, curDate) && dayDiff < -1) {
            str = DateFormat.format("MM-dd", date).toString();
        } else {
            str = DateFormat.format("yyyy-MM", date).toString();
        }

        return str;
    }

    /**
     * 获取日期 PATTERN_DATE 部分
     */
    public static String getDate(String date) {
        if (TextUtils.isEmpty(date) || !date.contains(PATTERN_SPLIT)) {
            return "";
        }
        return date.split(PATTERN_SPLIT)[0];
    }

    /**
     * 原有日期上累加月
     *
     * @return 累加后的日期 PATTERN_DATE 部分
     */
    public static String addMonth(String date, int moonCount) {
        //如果date为空 就用当前时间
        if (TextUtils.isEmpty(date)) {
            SimpleDateFormat df = new SimpleDateFormat(PATTERN_DATE + PATTERN_SPLIT + PATTERN_TIME);
            date = df.format(new Date());
        }
        Calendar calendar = str2calendar(date);
        calendar.add(Calendar.MONTH, moonCount);
        return getDate(calendar2str(calendar));
    }

    /**
     * 计算天数差
     */
    public static int calculateDayDiff(Date targetTime, Date compareTime) {
        boolean sameYear = isSameYear(targetTime, compareTime);
        if (sameYear) {
            return calculateDayDiffOfSameYear(targetTime, compareTime);
        } else {
            int dayDiff = 0;

            // 累计年数差的整年天数
            int yearDiff = calculateYearDiff(targetTime, compareTime);
            dayDiff += yearDiff * DAY_OF_YEAR;

            // 累计同一年内的天数
            dayDiff += calculateDayDiffOfSameYear(targetTime, compareTime);

            return dayDiff;
        }
    }

    /**
     * 计算同一年内的天数差
     */
    public static int calculateDayDiffOfSameYear(Date targetTime, Date compareTime) {
        if (targetTime == null || compareTime == null) {
            return 0;
        }

        Calendar tarCalendar = Calendar.getInstance();
        tarCalendar.setTime(targetTime);
        int tarDayOfYear = tarCalendar.get(Calendar.DAY_OF_YEAR);

        Calendar compareCalendar = Calendar.getInstance();
        compareCalendar.setTime(compareTime);
        int comDayOfYear = compareCalendar.get(Calendar.DAY_OF_YEAR);

        return tarDayOfYear - comDayOfYear;
    }

    /**
     * 计算年数差
     */
    public static int calculateYearDiff(Date targetTime, Date compareTime) {
        if (targetTime == null || compareTime == null) {
            return 0;
        }

        Calendar tarCalendar = Calendar.getInstance();
        tarCalendar.setTime(targetTime);
        int tarYear = tarCalendar.get(Calendar.YEAR);

        Calendar compareCalendar = Calendar.getInstance();
        compareCalendar.setTime(compareTime);
        int comYear = compareCalendar.get(Calendar.YEAR);

        return tarYear - comYear;
    }

    /**
     * 计算月数差
     *
     * @param targetTime
     * @param compareTime
     * @return
     */
    public static int calculateMonthDiff(String targetTime, String compareTime) {
        return calculateMonthDiff(str2date(targetTime, PATTERN_DATE),
                str2date(compareTime, PATTERN_DATE));
    }

    /**
     * 计算月数差
     *
     * @param targetTime
     * @param compareTime
     * @return
     */
    public static int calculateMonthDiff(Date targetTime, Date compareTime) {
        Calendar tarCalendar = Calendar.getInstance();
        tarCalendar.setTime(targetTime);
        int tarYear = tarCalendar.get(Calendar.YEAR);
        int tarMonth = tarCalendar.get(Calendar.MONTH);

        Calendar compareCalendar = Calendar.getInstance();
        compareCalendar.setTime(compareTime);
        int comYear = compareCalendar.get(Calendar.YEAR);
        int comMonth = compareCalendar.get(Calendar.MONTH);
        return ((tarYear - comYear) * 12 + tarMonth - comMonth);

    }

    /**
     * 是否为同一年
     */
    public static boolean isSameYear(Date targetTime, Date compareTime) {
        if (targetTime == null || compareTime == null) {
            return false;
        }

        Calendar tarCalendar = Calendar.getInstance();
        tarCalendar.setTime(targetTime);
        int tarYear = tarCalendar.get(Calendar.YEAR);

        Calendar compareCalendar = Calendar.getInstance();
        compareCalendar.setTime(compareTime);
        int comYear = compareCalendar.get(Calendar.YEAR);

        return tarYear == comYear;
    }

    public static Date str2date(String str, String format) {
        Date date = null;
        try {
            if (str != null) {
                SimpleDateFormat sdf = new SimpleDateFormat(format);
                date = sdf.parse(str);
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }

    public static Date str2date(String str) {
        return str2date(str, PATTERN);
    }

    public static String date2str(Date date) {
        return date2str(date, PATTERN);
    }

    public static String date2str(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.CHINA);
        return sdf.format(date);
    }

    public static Calendar str2calendar(String str) {
        Calendar calendar = null;
        Date date = str2date(str);
        if (date != null) {
            calendar = Calendar.getInstance();
            calendar.setTime(date);
        }
        return calendar;
    }

    public static Calendar str2calendar(String str, String format) {
        Calendar calendar = null;
        Date date = str2date(str, format);
        if (date != null) {
            calendar = Calendar.getInstance();
            calendar.setTime(date);
        }
        return calendar;
    }

    public static String calendar2str(Calendar calendar) {
        return date2str(calendar.getTime());
    }

    public static String calendar2str(Calendar calendar, String format) {
        return date2str(calendar.getTime(), format);
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Man. pl. Transvaal 1:50. 1926

#### Original name
null

### Remarks
null


text:
class AddClFieldsToCraigslistRawCars < ActiveRecord::Migration
  def change
    add_column :craigslist_raw_cars, :condition, :string
    add_column :craigslist_raw_cars, :cylinders, :string
    add_column :craigslist_raw_cars, :drive, :string
    add_column :craigslist_raw_cars, :fuel, :string
    add_column :craigslist_raw_cars, :paint_color, :string
    add_column :craigslist_raw_cars, :size, :string
    add_column :craigslist_raw_cars, :title_status, :string
    add_column :craigslist_raw_cars, :transmission, :string
    add_column :craigslist_raw_cars, :type, :string
  end
end


text:
package types

import (
	"github.com/elastic/go-elasticsearch/v8/typedapi/types/enums/jobblockedreason"
)

// JobBlocked type.
//
// https://github.com/elastic/elasticsearch-specification/blob/4ca0cc05d3ae3fa06c2cd7be91905b656a474334/specification/ml/_types/Job.ts#L169-L172
type JobBlocked struct {
	Reason jobblockedreason.JobBlockedReason `json:"reason"`
	TaskId *TaskId                           `json:"task_id,omitempty"`
}

// NewJobBlocked returns a JobBlocked.
func NewJobBlocked() *JobBlocked {
	r := &JobBlocked{}

	return r
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plugin PUBLIC "-//JPF//Java Plug-in Manifest 1.0" "http://jpf.sourceforge.net/plugin_1_0.dtd">
<plugin id="com.tle.admin.controls.universal" version="1">
  <extension-point id="editor">
    <parameter-def id="nameKey" />
    <parameter-def id="configPanel" multiplicity="none-or-one" />
  </extension-point>
  <extension-point id="universalvalidator">
    <parameter-def id="id" multiplicity="one" />
    <parameter-def id="class" multiplicity="one">
      <doc>
        <doc-text>Must extend UniversalPanelValidator</doc-text>
      </doc>
    </parameter-def>
  </extension-point>
</plugin>


text:
// This file is automatically generated.

package adila.db;

/*
 * Schok mini_SM7216
 *
 * DEVICE: SM7216
 * MODEL: SM7216
 */
final class sm7216_sm7216 {
    public static final String DATA = "Schok|mini_SM7216|";
}


text:
package org.apache.camel.component.aws2.translate;

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * For working with Amazon Translate SDK v2.
 */
@Component("aws2-translate")
public class Translate2Component extends DefaultComponent {

    private static final Logger LOG = LoggerFactory.getLogger(Translate2Component.class);

    @Metadata
    private Translate2Configuration configuration = new Translate2Configuration();

    public Translate2Component() {
        this(null);
    }

    public Translate2Component(CamelContext context) {
        super(context);

        registerExtension(new Translate2ComponentVerifierExtension());
    }

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        Translate2Configuration configuration
                = this.configuration != null ? this.configuration.copy() : new Translate2Configuration();

        Translate2Endpoint endpoint = new Translate2Endpoint(uri, this, configuration);
        setProperties(endpoint, parameters);
        if (!configuration.isUseDefaultCredentialsProvider() && configuration.getTranslateClient() == null
                && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
            throw new IllegalArgumentException(
                    "useDefaultCredentialsProvider is set to false, Amazon translate client or accessKey and secretKey must be specified");
        }
        return endpoint;
    }

    public Translate2Configuration getConfiguration() {
        return configuration;
    }

    /**
     * Component configuration
     */
    public void setConfiguration(Translate2Configuration configuration) {
        this.configuration = configuration;
    }
}


text:
.blogShort{ border-bottom:1px solid #ddd;}
.add{background: #333; padding: 10%; height: 300px;}

.nav-sidebar {
    width: 100%;
    padding: 8px 0;
    border-right: 1px solid #ddd;
}
.nav-sidebar a {
    color: #333;
    -webkit-transition: all 0.08s linear;
    -moz-transition: all 0.08s linear;
    -o-transition: all 0.08s linear;
    transition: all 0.08s linear;
}
.nav-sidebar .active a {
    cursor: default;
    background-color: #34ca78;
    color: #fff;
}
.nav-sidebar .active a:hover {
    background-color: #37D980;
}
.nav-sidebar .text-overflow a,
.nav-sidebar .text-overflow .media-body {
    white-space: nowrap;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
}

.btn-blog {
    color: #ffffff;
    background-color: #37d980;
    border-color: #37d980;
    border-radius:0;
    margin-bottom:10px
}
.btn-blog:hover,
.btn-blog:focus,
.btn-blog:active,
.btn-blog.active,
.open .dropdown-toggle.btn-blog {
    color: white;
    background-color:#34ca78;
    border-color: #34ca78;
}
 h2{color:#34ca78;}
 .margin10{margin-bottom:10px; margin-right:10px;}

#blog img {
    max-height: 150px;
}


text:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <artifactId>keycloak-parent</artifactId>
        <groupId>org.keycloak</groupId>
        <version>1.6.0.Final-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>keycloak-model-api</artifactId>
    <name>Keycloak Model API</name>
    <description/>

    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.iharder</groupId>
            <artifactId>base64</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
   </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
package com.github.ojdcheck.test.missing;

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

import com.github.ojdcheck.test.AbstractOJDCheckTest;
import com.github.ojdcheck.test.IClassDocTester;
import com.github.ojdcheck.test.ITestReport;
import com.github.ojdcheck.test.TestReport;
import com.github.ojdcheck.util.JavaDocHelper;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.MethodDoc;

/**
 * Test that verifies that classes and methods have JavaDoc.
 */
public class MissingDescriptionTest extends AbstractOJDCheckTest implements IClassDocTester {

    public String getDescription() {
        return "Checks if the class or method is missing a JavaDoc " +
        		"description";
    }

    public String getName() {
        return "Missing JavaDoc Description";
    }

    public List<ITestReport> test(ClassDoc classDoc) {
        List<ITestReport> reports = new ArrayList<ITestReport>();
        String classJavaDoc = classDoc.commentText();
        if (classJavaDoc == null || classJavaDoc.length() == 0) {
            if (classDoc.tags("inheritDoc").length == 0) {
                reports.add(
                    new TestReport(
                        this, classDoc,
                        "No class documentation given.",
                        classDoc.position().line(),
                        null
                    )
                );
            }
        }
        MethodDoc[] methods = classDoc.methods();
        for (MethodDoc method : methods) {
            String methodDoc = method.commentText();
            if (methodDoc == null || methodDoc.length() == 0) {
                if (classDoc.isEnum() &&
                    ("values".equals(method.name()) ||
                     "valueOf".equals(method.name()))
                   ) {
                    // screen out the valueOf()
                    // method from Enum types since they are not overridden and
                    // do not need javadoc comments.
                } else if (method.tags("inheritDoc").length == 0) {
                    reports.add(
                        new TestReport(
                            this, classDoc,
                            "No documentation given for the method " +
                            method.name() + "().",
                            method.position().line(),
                            null
                        )
                    );
                }
            }
        }
        FieldDoc[] fields = classDoc.fields();
        for (FieldDoc field : fields) {
        	if (!JavaDocHelper.hasJavaDoc(field) &&
        		!JavaDocHelper.hasInheritedDoc(field)) {
        		reports.add(
        			new TestReport(
        				this, classDoc,
        				"No documentation given for the method " +
        				field.name() + "().",
        				field.position().line(),
        				null
        			)
        		);
        	}
        }
        return reports;
    }

    public Priority getPriority() {
        return Priority.ERROR;
    }

}


text:
#ifndef SUM_SQUARED_ERROR_H__
#define SUM_SQUARED_ERROR_H__

#include <tesseract/base/types.h>

namespace tesseract
{

/** @brief computes the sum of squares error as \f$\sigma=\sqrt{\frac{(Z-Z')^2}{N-2}}\f$.
 * where \f$Z\f$ is the labels and \f$Z'\f$ is the prediction according to regression
 * model.
 */
template <typename T>
struct SumSquaredError
{
	/**
	 * @param Z the original regressands \f$Z\f$
	 * @param Zp the predicted regressands according to model \f$Z'\f$
	 * @return the sum of squares error (see class documentation)
	 */
	float64_t compute(const Eigen::Ref<const Vector<T>>& Z, const Eigen::Ref<const Vector<T>>& Zp);
};

}

#endif // SUM_SQUARED_ERROR_H__


text:
`XHEAP <https://pypi.python.org/pypi/xheap>`_
=============================================

It's like `heapq <https://docs.python.org/3.5/library/heapq.html>`_ (blazingly fast) but object-oriented + more features.

`Read more here for the background story <http://srkunze.blogspot.com/2016/01/fast-object-oriented-heap-implementation.html>`_.

Why?
----

Less code.

What are heaps good for anyway?
-------------------------------

When you need the smallest item of a large list—fast and with no overhead.

How?
----

Let's suppose you have a heap, you can use ``pop`` to get its smallest item.

.. code:: python

    from xheap import Heap

    heap = Heap(['H', 'D', 'B', 'A', 'E', 'C', 'L', 'J', 'I'])
    heap.pop()   # returns A
    heap.pop()   # returns B
    heap.pop()   # returns C
    heap.pop()   # returns D

`Heapsort <https://en.wikipedia.org/wiki/Heapsort>`_ works this way.

Can I insert an item?
---------------------

Indeed and it's as fast as pop. Use ``push`` for insertion.

.. code:: python

    heap = Heap(['A', 'D', 'B', 'H', 'E', 'C', 'L', 'J', 'I'])
    heap.push('Z')

Can I remove an item from the middle of a heap?
-----------------------------------------------

Yes, that's what ``RemovalHeap.remove`` is supposed to do.

.. code:: python

    from xheap import RemovalHeap

    heap = RemovalHeap(['A', 'D', 'B', 'H', 'E', 'C', 'L', 'J', 'I'])
    heap.remove('L')

Can I specify the order of the heap?
------------------------------------

Just imagine two heaps of the very same set of items but you need different sorting for each heap. Or
you need a max-heap instead of a min-heap. That is what ``OrderHeap`` is designed for:

.. code:: python

    from xheap import OrderHeap

    items = [date(2016, 1, 1), date(2016, 1, 2),  date(2016, 1, 3),  date(2016, 1, 4)]

    day_heap = OrderHeap(items, key=lambda date: date.day)
    day_heap.peek()      # returns date(2016, 1, 1)

    weekday_heap = OrderHeap(items, key=lambda date: date.weekday())
    weekday_heap.peek()  # returns date(2016, 1, 4)

What about both remove+order?
-----------------------------

No problem. Use ``XHeap``.

If you wonder why there are 4 distinct heap implementations, it's a matter of speed.
Each additional feature slows a heap down. Thus, you could always use XHeap but beware
of the slowdown.

Checking Heap Invariant
-----------------------

A heap is just a list. So, if you tinker with it, you can check whether its invariant still holds:

.. code:: python

    heap = Heap([4, 3, 7, 6, 1, 2, 9, 8, 5])
    heap[3] = 10           # I know what I am doing here
    heap.check_invariant() # but better check... ooops

Conclusion
----------

Good
****

- uses C implementation if available (i.e. fast)
- object-oriented
- no slowdown if you don't need more than a simple heap
- removal possible
- custom orders possible
- works with Python2 and Python3

Bad
***

- no drawbacks discovered so far ;-)
- needs fix/work:

  - item wrapper which allows duplicate items
  - decrease-key+increase-key: another missing use-case of `heapq <https://docs.python.org/3.5/library/heapq.html>`_
  - merge heaps

- ideas are welcome :-)


text:
function BuildAndTestBinary
{
    $output = (msbuild /t:rebuild,test /p:Outerloop=true)
    if ($lastexitcode -ne 0)
    {
        throw "Build/test failed."
    }

    return $output
}

function TileWindows
{
    $shell = New-Object -ComObject Shell.Application
    $shell.TileHorizontally()
}

function ParseTestExecutionCommand($msBuildOutput)
{
    $pathPattern = "*Executing in*"
    $commandPattern = "*call *"
    $runtimeFolderPattern = "*Using * as the test runtime folder.*"

    $cmdLine = ""
    $pathLine = ""
    $runtimeLine = ""

    foreach ($line in $msBuildOutput)
    {
        if ($line -like $pathPattern)
        {
            $pathLine = $line.Split()[4]
            $foundPath = $true
        }
        elseif ($line -like $commandPattern)
        {
            $foundcommandPattern = $true
            $cmdLine = $line
        }
        elseif ($line -like $runtimeFolderPattern)
        {
            $runtimeLine = $line
        }
    }

    if (-not $foundcommandPattern)
    {
        throw "Cannot parse MSBuild output: please ensure that the current folder contains a test."
    }

    $Global:TestPath = $pathLine.Trim()
    $Global:TestCommand = $cmdLine.Trim() -replace ("call ", "")

    $runtimePath = $runtimeLine.Split()[3]

    $Global:TestCommand = $Global:TestCommand -replace ("%RUNTIME_PATH%", $runtimePath);
    $Global:TestCommand = [System.Environment]::ExpandEnvironmentVariables($Global:TestCommand)
}

function Initialize
{
    Write-Host -NoNewline "Initializing tests . . . "

    try
    {
        $output = BuildAndTestBinary
        ParseTestExecutionCommand($output)

        Write-Host -ForegroundColor Green "OK"
    }
    catch
    {
        Write-Host -ForegroundColor Red "Failed"
        throw
    }
}

function RunOne($testPath, $testCommand)
{
    if (-not [string]::IsNullOrWhiteSpace($testPath))
    {
        $Global:TestPath = $testPath
    }

    if (-not [string]::IsNullOrWhiteSpace($testCommand))
    {
        $Global:TestCommand = $testCommand
    }

    if ($Global:TestCommand -eq $null)
    {
        throw "Run Initialize first or pass the test command line as a parameter."
    }

    Write-Host "Path: $($Global:TestPath) Command: $($Global:TestCommand)"

    Push-Location
    cd $Global:TestPath
    Invoke-Expression $Global:TestCommand
    if ($lastexitcode -ne 0)
    {
        throw "Test execution failed."
    }

    Pop-Location
}

function RunUntilFailed($testPath, $testCommand, $delayVarianceMilliseconds = 0)
{
    try
    {
        while($true)
        {
            RunOne $testPath $testCommand

            if ($delayVarianceMilliseconds -ne 0)
            {
                $sleepMilliseconds = Get-Random -Minimum 0 -Maximum $delayVarianceMilliseconds
                Write-Host -ForegroundColor Cyan "Sleeping $sleepMilliseconds"
                Start-Sleep -Milliseconds $sleepMilliseconds
            }
        }
    }
    catch
    {
        Write-Host -ForegroundColor Red "Test execution failed!"
        Read-Host "Press ENTER to continue..."
    }
}

function RunMultiple(
    [int]$n = 2,
    [int]$RandomDelayVarianceMilliseconds = 0,
    [switch]$UntilFailed = $false,
    [switch]$Tile = $true)
{
    if ($Global:TestCommand -eq $null)
    {
        Initialize
    }

    $script = $PSCommandPath

    if ($UntilFailed)
    {
        $executionMethod = "RunUntilFailed"
    }
    else
    {
        $executionMethod = "RunOne"
    }

    $cmdArguments = "-Command `"&{. $script; $executionMethod '$Global:TestPath' '$Global:TestCommand' $RandomDelayVarianceMilliseconds}`""

    $processes = @()

    for ($i=0; $i -lt $n; $i++)
    {
        $thisCmdArguments = $cmdArguments -replace ("testResults.xml", "testResults$i.xml")
        $process = Start-Process -PassThru powershell -ArgumentList $thisCmdArguments
        $processes += $process
    }

    $processesExited = $false
    while (-not ([console]::KeyAvailable -or $processesExited))
    {
        Clear-Host

        Write-Host -ForegroundColor Cyan "Active test processes:"
        Write-Host
        Write-Host "[Press any key to close.]"
        Write-Host
        $processes | Format-Table -Property Id, CPU, Handles, WS, ExitCode

        $processesExited = $true
        foreach($p in $processes)
        {
            if (-not $p.HasExited)
            {
                $processesExited = $false
            }
        }

        Start-Sleep -Milliseconds 1000
        if ($Tile)
        {
            TileWindows
        }
    }

    if (-not $processesExited)
    {
        Write-Host -ForegroundColor Cyan "Terminating all processes."
        foreach ($p in $processes)
        {
            if (-not $p.HasExited)
            {
                $p.Kill()
            }
        }
    }

    Write-Host "Done."
}


text:
package volume

import (
	"strconv"

	"testing"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/openebs/maya/tests"
	"github.com/openebs/maya/tests/artifacts"
	"github.com/openebs/maya/tests/jiva"

	apis "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1"
	ns "github.com/openebs/maya/pkg/kubernetes/namespace/v1alpha1"
	sc "github.com/openebs/maya/pkg/kubernetes/storageclass/v1alpha1"
	corev1 "k8s.io/api/core/v1"
	storagev1 "k8s.io/api/storage/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

	// auth plugins
	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)

var (
	namespace             = "jiva-volume-ns"
	scName                = "jiva-volume-sc"
	openebsCASConfigValue = "- name: ReplicaCount\n  Value: "
	openebsProvisioner    = "openebs.io/provisioner-iscsi"
	namespaceObj          *corev1.Namespace
	scObj                 *storagev1.StorageClass
	annotations           = map[string]string{}
	err                   error
)

func TestSource(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "Test jiva volume provisioning")
}

func init() {
	jiva.ParseFlags()
}

var ops *tests.Operations

var _ = BeforeSuite(func() {

	ops = tests.NewOperations(tests.WithKubeConfigPath(jiva.KubeConfigPath))

	annotations[string(apis.CASTypeKey)] = string(apis.JivaVolume)
	annotations[string(apis.CASConfigKey)] = openebsCASConfigValue + strconv.Itoa(jiva.ReplicaCount)

	By("waiting for maya-apiserver pod to come into running state")
	podCount := ops.GetPodRunningCountEventually(
		string(artifacts.OpenebsNamespace),
		string(artifacts.MayaAPIServerLabelSelector),
		1,
	)
	Expect(podCount).To(Equal(1))

	By("waiting for openebs-provisioner pod to come into running state")
	podCount = ops.GetPodRunningCountEventually(
		string(artifacts.OpenebsNamespace),
		string(artifacts.OpenEBSProvisionerLabelSelector),
		1,
	)
	Expect(podCount).To(Equal(1))

	By("building a namespace")
	namespaceObj, err = ns.NewBuilder().
		WithGenerateName(namespace).
		APIObject()
	Expect(err).ShouldNot(HaveOccurred(), "while building namespace {%s}", namespace)

	By("building a storageclass")
	scObj, err = sc.NewBuilder().
		WithGenerateName(scName).
		WithAnnotations(annotations).
		WithProvisioner(openebsProvisioner).Build()
	Expect(err).ShouldNot(HaveOccurred(), "while building storageclass {%s}", scName)

	By("creating a namespace")
	namespaceObj, err = ops.NSClient.Create(namespaceObj)
	Expect(err).To(BeNil(), "while creating namespace {%s}", namespaceObj.GenerateName)

	By("creating a storageclass")
	scObj, err = ops.SCClient.Create(scObj)
	Expect(err).To(BeNil(), "while creating storageclass {%s}", scObj.GenerateName)

})

var _ = AfterSuite(func() {

	By("deleting storageclass")
	err = ops.SCClient.Delete(scObj.Name, &metav1.DeleteOptions{})
	Expect(err).To(BeNil(), "while deleting storageclass {%s}", scObj.Name)

	By("deleting namespace")
	err = ops.NSClient.Delete(namespaceObj.Name, &metav1.DeleteOptions{})
	Expect(err).To(BeNil(), "while deleting namespace {%s}", namespaceObj.Name)

})


text:
using System;
using System.Security;
using System.Security.Permissions;
using System.Windows.Input;

using MS.Internal.PresentationCore; // for FriendAccessAllowed

namespace MS.Internal
{
    [FriendAccessAllowed]
    internal static class CommandLibraryHelper
    {
        internal static RoutedUICommand CreateUICommand(string name, Type ownerType, byte commandId, PermissionSet ps)
        {
            RoutedUICommand routedUICommand;

            if (ps != null)
            {
                routedUICommand = new SecureUICommand(ps, name, ownerType, commandId);
            }
            else
            {
                routedUICommand = new RoutedUICommand(name, ownerType, commandId);
            }

            routedUICommand.AreInputGesturesDelayLoaded = true;
            return routedUICommand;
        }
     }
}


text:
package staffstutorial2;

import java.util.ArrayList;

/**
 *
 * @author Alexandre Ravaux
 */
public class Deck {
    private ArrayList<Card> deck;
    public Deck(){
        deck=new ArrayList<Card>();
        for(Suit s:Suit.values()){
            for(Rank r:Rank.values()){
                deck.add(new Card(r,s));
            }
        }
    }
    public String toString(){
        String out="";
        for(Card card:deck){
            out+=card.toString()+"\n";
        }
        if(out.equals("")) { out="No cards";}
        return out;
    }
}


text:
- Stephen King. *Buick 8: un coche perverso*. Sudamericana, 2010.

- Isaac Asimov. *Cuentos Completos I*. Ediciones B, 2008.

- Isaac Asimov. *Cuentos Completos II*. Ediciones B, 2008.

- Seferino Reato. *Doce noches*. Sudamericana, 2015.

- Frank Herbert. *Dune*. Debolsillo, 2013.

- Isaac Asimov. *El Cercano Oriente*. Alianza, 2010.

- Stephen King. *El resplandor*. Debolsillo, 2014.

- Simon Singh. *El último teorema de Fermat*. Páprika, 2014.

- Greg Bear. *La Fragua de Dios*. Desconocida, 1986.

- Stephen King. *La Niebla*. Sudamericana, 2010.

- Isaac Asimov. *Las palabras y los mitos*. Desconocida, 2010.

- Isaac Asimov. *Los egipcios*. Alianza, 2011.

- Boris y Arkadi Strugatsky. *Picnic junto al camino*. Desconocida, 2010.

- Thomas S. Kuhn. *The structure of scientific revolutions*. The University of Chicago Press, 2012.

- Alan F. Chalmers. *¿Qué es es cosa llamada ciencia?*. Siglo veintiuno editores, 1995.


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>document.lastModified</title>
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/#resource-metadata-management">


text:
Title: TinyDB the NoSQL alternative to SQLlite
Date: 2016-12-22 08:30
Modified: 2016-12-22 08:30
Category: Python
Tags: Databases, NoSQL
Slug: tinydb-intro
Authors: TJ Nel
Summary: A Introduction to Tinydb the NoSQL alternative to SQLite for a Self-contained, File Based, Document Oriented database, thats really small!

### A introduction to Tinydb the NoSQL alternative to SQLite for a self contained, serverless database.

Let face it the future of the internet revolves around APIs, we are in a data-driven world and the format that we move this data is JSON. So it would be logical to have a database that speaks JSON and NoSQL database often provide a JSON like syntax that work well with this data.

__enter TinyDB...__

[TinyDB](https://tinydb.readthedocs.io) is a Document oriented NoSQL database that was written with only about 1200 lines of code! Just like with SQLite, TinyDB is great for quick and small scoped projects and testing. The database is stored in a .json file which as you guessed it is a simple json file that you can query later.Best of all it is written in good 'ole Python.

#### Example: Storing API Responses with TinyDB
In this example I am going to show you how to store a json formatted API response to a TinyDB databate. From there you can add, remove and modify entries within the database.

#### Installing TinyDB
You can install TinyDB using PIP.
```python
pip install tinydb
```

#### Using TinyDB

Just like with any other python module you can import TinyDB but it is best practice to import the submodules TinyDB and Query (see below).
```python
from tinydb import TinyDB, Query
```
Then you will need to create a database object
```python
db = TinyDB('dbname.json')
```

After that you are all set, just work directly with the database object you just created.
#### Setting up your API Call
For this example we will be using the People In Space API available from [Open Notify](http://open-notify.org/Open-Notify-API/People-In-Space/). This API return a list of all of the members currently on the International Space Station. To use this API you need to sent a HTTP request to __http://api.open-notify.org/astros.json__ with no authentication or parameters required and you will get back a JSON formatted response with all of the current astronauts on the ISS. So in python the request to get the JSON back looks like this...
```python
import requests
response = requests.get("http://api.open-notify.org/astros.json")
data = response.json()
```

So if we print data we should get the following output:
```python
print(data)
```
>{'number': 6, 'people': [{'craft': 'ISS', 'name': 'Sergey Rizhikov'}, {'craft': >'ISS', 'name': 'Andrey Borisenko'}, {'craft': 'ISS', 'name': 'Shane Kimbrough'}, {'craft': 'ISS', 'name': 'Oleg Novitskiy'}, {'craft': 'ISS', 'name': 'Thomas Pesquet'}, {'craft': 'ISS', 'name': 'Peggy Whitson'}], 'message': 'success'}

#### Adding API Call Results to TinyDB
Now we want to put the people from that JSON response into a TinyDB database. So to do  this we need to learn how to add a entry into a TinyDB database. TinyDB has a couple of functions that allow you to modify the database file you are working with.

__Inserting Data__

To insert or add data into your database you would use ```db.insert(...)```

__Updating Data__

To update information in your database you would use ```db.update(fields, query)``` this works by updating all elements matching the query with fields.

Right now we want to add every entry from the list of people in space so we will be using insert. So if we wanted to add the Sergey Rizhikov from the data above we would use the syntax ```db.insert({'craft': 'ISS', 'name': 'Sergey Rizhikov'})```.  But we dont want to copy-paste every person in space, so iterating through the people section of the JSON output and putting that into the ```db.insert()``` statement using the below code should populate our database.
```python
for person in data['people']:
    db.insert(person)
```

and using ```db.all()``` which prints out the contents of your tiny database confirms the people were inserted into the database.
```python
db.all()
```
>{'craft': 'ISS', 'name': 'Sergey Rizhikov'}
{'craft': 'ISS', 'name': 'Andrey Borisenko'}
{'craft': 'ISS', 'name': 'Shane Kimbrough'}
{'craft': 'ISS', 'name': 'Oleg Novitskiy'}
{'craft': 'ISS', 'name': 'Thomas Pesquet'}
{'craft': 'ISS', 'name': 'Peggy Whitson'}
#### Querying the Database
Now that we have data in our database, it would be useful to be able to retieve from it. TinyDB allows you to query that data by using a Query() object. So if you wanted to get a list of all the people in space on the ISS you can use this code:
```python
Astro = Query()
db.search(Astro.craft == 'ISS')
```
Unsuprisingly you will get all of the entries put in with ISS as the craft (which is all of them). But what if you wanted to search for a speciifc person like Peggy? Well you could you use this code:
```python
db.search(Astro.name.search('Peggy'))
```
Which will return only people with Peggy in their name
>[{'craft': 'ISS', 'name': 'Peggy Whitson'}]

Modifying the code to search for anyone with ```'Pe'``` in their name with this syntax ```db.search(Astro.name.search('Pe'))``` returns the following:
>[{'craft': 'ISS', 'name': 'Thomas Pesquet'},
 {'craft': 'ISS', 'name': 'Peggy Whitson'}]

#### Updating the fields in the Database
Now what if one of the people in space changes the craft they are on from the ISS to Tiangong 1 (We will call it T1) we can update their data by following the syntax we previously talked about. So lets send Peggy Whitson to T1.
```python
db.update({'craft':'T1'}, Astro.name.search('Peggy') )
```
Now checking ```db.all()``` you should now see Peggy on the T1 craft.
>[{'craft': 'ISS', 'name': 'Sergey Rizhikov'},
 {'craft': 'ISS', 'name': 'Andrey Borisenko'},
 {'craft': 'ISS', 'name': 'Shane Kimbrough'},
 {'craft': 'ISS', 'name': 'Oleg Novitskiy'},
 {'craft': 'ISS', 'name': 'Thomas Pesquet'},
 {'craft': 'T1', 'name': 'Peggy Whitson'}]

#### Removing Data from the Database
Lets now send someone home, TinyDB allows you to remove entries in the database using ```db.remove()``` where it will remove all of the entries matching the query placed inside of the parenthesis. Lets send Shane home and remove him from the database with the following code:
```python
db.remove(Astro.name.search('Shane'))
```
Now checking ```db.all()``` we see that Shane is no longer in the database output.
>[{'craft': 'ISS', 'name': 'Sergey Rizhikov'},
 {'craft': 'ISS', 'name': 'Andrey Borisenko'},
 {'craft': 'ISS', 'name': 'Oleg Novitskiy'},
 {'craft': 'ISS', 'name': 'Thomas Pesquet'},
 {'craft': 'T1', 'name': 'Peggy Whitson'}]

#### Clearing the database

Last but not least if you want to clear out the database you can just run ```db.purge()``` and you will have a nice and empty database to work with.

 __For more TinyDB info:__

- [https://tinydb.readthedocs.io](https://tinydb.readthedocs.io)

- [https://github.com/msiemens/tinydb](https://github.com/msiemens/tinydb)

- [https://pypi.python.org/pypi/tinydb](https://pypi.python.org/pypi/tinydb)


text:
name             'dictionary'
maintainer       'The Open Data Institute'
maintainer_email 'tech@theodi.org'
license          'MIT'
description      'Installs /usr/share/dict/words'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '0.1.0'


text:
#include "common.hpp"
#include <boost/test/unit_test.hpp>

template <class IArchive, class OArchive>
void test_array()
{
  std::random_device rd;
  std::mt19937 gen(rd());

  for(int ii=0; ii<100; ++ii)
  {
    std::array<int, 100> o_podarray;
    for(auto & elem : o_podarray)
      elem = random_value<int>(gen);

    std::array<StructInternalSerialize, 100> o_iserarray;
    for(auto & elem : o_iserarray)
      elem = StructInternalSerialize( random_value<int>(gen), random_value<int>(gen) );

    std::array<StructInternalSplit, 100> o_isplarray;
    for(auto & elem : o_isplarray)
      elem = StructInternalSplit( random_value<int>(gen), random_value<int>(gen) );

    std::array<StructExternalSerialize, 100> o_eserarray;
    for(auto & elem : o_eserarray)
      elem = StructExternalSerialize( random_value<int>(gen), random_value<int>(gen) );

    std::array<StructExternalSplit, 100> o_esplarray;
    for(auto & elem : o_esplarray)
      elem = StructExternalSplit( random_value<int>(gen), random_value<int>(gen) );

    std::ostringstream os;
    {
      OArchive oar(os);

      oar(o_podarray);
      oar(o_iserarray);
      oar(o_isplarray);
      oar(o_eserarray);
      oar(o_esplarray);
    }

    std::array<int, 100> i_podarray;
    std::array<StructInternalSerialize, 100> i_iserarray;
    std::array<StructInternalSplit, 100>     i_isplarray;
    std::array<StructExternalSerialize, 100> i_eserarray;
    std::array<StructExternalSplit, 100>     i_esplarray;

    std::istringstream is(os.str());
    {
      IArchive iar(is);

      iar(i_podarray);
      iar(i_iserarray);
      iar(i_isplarray);
      iar(i_eserarray);
      iar(i_esplarray);
    }

    BOOST_CHECK_EQUAL_COLLECTIONS(i_podarray.begin(),    i_podarray.end(),    o_podarray.begin(),  o_podarray.end());
    BOOST_CHECK_EQUAL_COLLECTIONS(i_iserarray.begin(),   i_iserarray.end(),   o_iserarray.begin(), o_iserarray.end());
    BOOST_CHECK_EQUAL_COLLECTIONS(i_isplarray.begin(),   i_isplarray.end(),   o_isplarray.begin(), o_isplarray.end());
    BOOST_CHECK_EQUAL_COLLECTIONS(i_eserarray.begin(),   i_eserarray.end(),   o_eserarray.begin(), o_eserarray.end());
    BOOST_CHECK_EQUAL_COLLECTIONS(i_esplarray.begin(),   i_esplarray.end(),   o_esplarray.begin(), o_esplarray.end());
  }
}

BOOST_AUTO_TEST_CASE( binary_array )
{
  test_array<cereal::BinaryInputArchive, cereal::BinaryOutputArchive>();
}

BOOST_AUTO_TEST_CASE( portable_binary_array )
{
  test_array<cereal::PortableBinaryInputArchive, cereal::PortableBinaryOutputArchive>();
}

BOOST_AUTO_TEST_CASE( xml_array )
{
  test_array<cereal::XMLInputArchive, cereal::XMLOutputArchive>();
}

BOOST_AUTO_TEST_CASE( json_array )
{
  test_array<cereal::JSONInputArchive, cereal::JSONOutputArchive>();
}


text:
import {Expression, Statement, Type} from '@angular/compiler';
import * as ts from 'typescript';

import {Decorator} from '../../host';

/**
 * Provides the interface between a decorator compiler from @angular/compiler and the Typescript
 * compiler/transform.
 *
 * The decorator compilers in @angular/compiler do not depend on Typescript. The handler is
 * responsible for extracting the information required to perform compilation from the decorators
 * and Typescript source, invoking the decorator compiler, and returning the result.
 */
export interface DecoratorHandler<A> {
  /**
   * Scan a set of reflected decorators and determine if this handler is responsible for compilation
   * of one of them.
   */
  detect(decorator: Decorator[]): Decorator|undefined;

  /**
   * Perform analysis on the decorator/class combination, producing instructions for compilation
   * if successful, or an array of diagnostic messages if the analysis fails or the decorator
   * isn't valid.
   */
  analyze(node: ts.Declaration, decorator: Decorator): AnalysisOutput<A>;

  /**
   * Generate a description of the field which should be added to the class, including any
   * initialization code to be generated.
   */
  compile(node: ts.Declaration, analysis: A): CompileResult|CompileResult[];
}

/**
 * The output of an analysis operation, consisting of possibly an arbitrary analysis object (used as
 * the input to code generation) and potentially diagnostics if there were errors uncovered during
 * analysis.
 */
export interface AnalysisOutput<A> {
  analysis?: A;
  diagnostics?: ts.Diagnostic[];
}

/**
 * A description of the static field to add to a class, including an initialization expression
 * and a type for the .d.ts file.
 */
export interface CompileResult {
  name: string;
  initializer: Expression;
  statements: Statement[];
  type: Type;
}