text:
/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  /*	vertical-align: baseline;*/ }

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block; }

body {
  line-height: 1; }

ol, ul {
  list-style: none; }

blockquote, q {
  quotes: none; }
  blockquote:before, blockquote:after, q:before, q:after {
    content: '';
    content: none; }

table {
  border-collapse: collapse;
  border-spacing: 0; }

.line-bottom {
  padding-bottom: 5px;
  border-bottom: 1px solid black; }

* {
  box-sizing: border-box; }

html, body {
  max-width: 100%;
  overflow-x: hidden; }

body {
  max-width: 100%; }

h1, h2, h3, h4, h5, h6 {
  font-family: "Playfair Display", serif; }

h1 {
  font-size: 3.5rem; }

h4 {
  font-size: 1.5rem; }

p {
  line-height: 2.0; }

ul, a, p {
  text-decoration: none;
  font-family: "Raleway", sans-serif; }

/************/
/* CLEARFIX */
/************/
.clearfix:after {
  content: "";
  display: table;
  clear: both; }

/****************/
/* FLOAT STYLES */
/****************/
.float-left {
  float: left; }

.float-right {
  float: right; }

/*****************/
/* FLEX SETTINGS */
/*****************/
.flex-row {
  display: flex;
  flex-direction: row; }

.flex-col {
  display: flex;
  flex-direction: column; }

.flex-row-wrap {
  display: flex;
  flex-wrap: wrap; }

.flex-row-wrap-reverse {
  display: flex;
  flex-wrap: wrap-reverse; }

.flex-col-wrap {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap; }

.flex-col-wrap-reverse {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap-reverse; }

.justify-content-flex-end {
  display: flex;
  justify-content: flex-end; }

.justify-content-space-between {
  display: flex;
  justify-content: space-between; }

.justify-content-space-around {
  display: flex;
  justify-content: space-around; }

.align-items-flex-end {
  display: flex;
  align-items: flex-end; }

.align-items-center {
  display: flex;
  align-items: center; }

.align-self-stretch {
  display: flex;
  align-self: stretch; }

.align-self-flex-start {
  display: flex;
  align-self: flex-start; }

.align-self-flex-end {
  display: flex;
  align-self: flex-end; }

.align-self-center {
  display: flex;
  align-self: center; }

.flex-center-center {
  display: flex;
  justify-content: center;
  align-items: center; }

.flex-center-end {
  display: flex;
  justify-content: center;
  align-items: flex-end; }

.flex-space-between-center {
  display: flex;
  justify-content: space-between;
  align-items: center; }

.flex-space-around-center {
  display: flex;
  justify-content: space-around;
  align-items: center; }

.flex-end-center {
  display: flex;
  justify-content: flex-end;
  align-items: center; }

.flex-end-end {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end; }

/*  extra small ie mobile     */
@media screen and (max-width: 767px) {
  .xs-flex-row {
    display: flex;
    flex-direction: row; }
  .xs-flex-col {
    display: flex;
    flex-direction: column; }
  .xs-flex-row-wrap {
    display: flex;
    flex-wrap: wrap; }
  .xs-flex-row-wrap-reverse {
    display: flex;
    flex-wrap: wrap-reverse; }
  .xs-flex-col-wrap {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap; }
  .xs-flex-col-wrap-reverse {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap-reverse; }
  .xs-justify-content-flex-end {
    display: flex;
    justify-content: flex-end; }
  .xs-justify-content-space-between {
    display: flex;
    justify-content: space-between; }
  .xs-justify-content-space-around {
    display: flex;
    justify-content: space-around; }
  .xs-align-items-flex-end {
    display: flex;
    align-items: flex-end; }
  .xs-align-items-center {
    display: flex;
    align-items: center; }
  .xs-align-self-stretch {
    display: flex;
    align-self: stretch; }
  .xs-align-self-flex-start {
    display: flex;
    align-self: flex-start; }
  .xs-align-self-flex-end {
    display: flex;
    align-self: flex-end; }
  .xs-align-self-center {
    display: flex;
    align-self: center; }
  .xs-flex-center-center {
    display: flex;
    justify-content: center;
    align-items: center; }
  .xs-flex-center-end {
    display: flex;
    justify-content: center;
    align-items: flex-end; }
  .xs-flex-space-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center; }
  .xs-flex-space-around-center {
    display: flex;
    justify-content: space-around;
    align-items: center; }
  .xs-flex-end-center {
    display: flex;
    justify-content: flex-end;
    align-items: center; }
  .xs-flex-end-end {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end; } }

/* small ie tablet*/
@media screen and (min-width: 768px) {
  .sm-flex-row {
    display: flex;
    flex-direction: row; }
  .sm-flex-col {
    display: flex;
    flex-direction: column; }
  .sm-flex-row-wrap {
    display: flex;
    flex-wrap: wrap; }
  .sm-flex-row-wrap-reverse {
    display: flex;
    flex-wrap: wrap-reverse; }
  .sm-flex-col-wrap {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap; }
  .sm-flex-col-wrap-reverse {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap-reverse; }
  .sm-justify-content-flex-end {
    display: flex;
    justify-content: flex-end; }
  .sm-justify-content-space-between {
    display: flex;
    justify-content: space-between; }
  .sm-justify-content-space-around {
    display: flex;
    justify-content: space-around; }
  .sm-align-items-flex-end {
    display: flex;
    align-items: flex-end; }
  .sm-align-items-center {
    display: flex;
    align-items: center; }
  .sm-align-self-stretch {
    display: flex;
    align-self: stretch; }
  .sm-align-self-flex-start {
    display: flex;
    align-self: flex-start; }
  .sm-align-self-flex-end {
    display: flex;
    align-self: flex-end; }
  .sm-align-self-center {
    display: flex;
    align-self: center; }
  .sm-flex-center-center {
    display: flex;
    justify-content: center;
    align-items: center; }
  .sm-flex-center-end {
    display: flex;
    justify-content: center;
    align-items: flex-end; }
  .sm-flex-space-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center; }
  .sm-flex-space-around-center {
    display: flex;
    justify-content: space-around;
    align-items: center; }
  .sm-flex-end-center {
    display: flex;
    justify-content: flex-end;
    align-items: center; }
  .sm-flex-end-end {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end; } }

/* medium ie desktop > 992  */
@media screen and (min-width: 768px) {
  .md-flex-row {
    display: flex;
    flex-direction: row; }
  .md-flex-col {
    display: flex;
    flex-direction: column; }
  .md-flex-row-wrap {
    display: flex;
    flex-wrap: wrap; }
  .md-flex-row-wrap-reverse {
    display: flex;
    flex-wrap: wrap-reverse; }
  .md-flex-col-wrap {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap; }
  .md-flex-col-wrap-reverse {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap-reverse; }
  .md-justify-content-flex-end {
    display: flex;
    justify-content: flex-end; }
  .md-justify-content-space-between {
    display: flex;
    justify-content: space-between; }
  .md-justify-content-space-around {
    display: flex;
    justify-content: space-around; }
  .md-align-items-flex-end {
    display: flex;
    align-items: flex-end; }
  .md-align-items-center {
    display: flex;
    align-items: center; }
  .md-align-self-stretch {
    display: flex;
    align-self: stretch; }
  .md-align-self-flex-start {
    display: flex;
    align-self: flex-start; }
  .md-align-self-flex-end {
    display: flex;
    align-self: flex-end; }
  .md-align-self-center {
    display: flex;
    align-self: center; }
  .md-flex-center-center {
    display: flex;
    justify-content: center;
    align-items: center; }
  .md-flex-center-end {
    display: flex;
    justify-content: center;
    align-items: flex-end; }
  .md-flex-space-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center; }
  .md-flex-space-around-center {
    display: flex;
    justify-content: space-around;
    align-items: center; }
  .md-flex-end-center {
    display: flex;
    justify-content: flex-end;
    align-items: center; }
  .md-flex-end-end {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end; } }

/* large ie desktop > 1200px     */
@media screen and (min-width: 768px) {
  .lg-flex-row {
    display: flex;
    flex-direction: row; }
  .lg-flex-col {
    display: flex;
    flex-direction: column; }
  .lg-flex-row-wrap {
    display: flex;
    flex-wrap: wrap; }
  .lg-flex-row-wrap-reverse {
    display: flex;
    flex-wrap: wrap-reverse; }
  .lg-flex-col-wrap {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap; }
  .lg-flex-col-wrap-reverse {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap-reverse; }
  .lg-justify-content-flex-end {
    display: flex;
    justify-content: flex-end; }
  .lg-justify-content-space-between {
    display: flex;
    justify-content: space-between; }
  .lg-justify-content-space-around {
    display: flex;
    justify-content: space-around; }
  .lg-align-items-flex-end {
    display: flex;
    align-items: flex-end; }
  .lg-align-items-center {
    display: flex;
    align-items: center; }
  .lg-align-self-stretch {
    display: flex;
    align-self: stretch; }
  .lg-align-self-flex-start {
    display: flex;
    align-self: flex-start; }
  .lg-align-self-flex-end {
    display: flex;
    align-self: flex-end; }
  .lg-align-self-center {
    display: flex;
    align-self: center; }
  .lg-flex-center-center {
    display: flex;
    justify-content: center;
    align-items: center; }
  .lg-flex-center-end {
    display: flex;
    justify-content: center;
    align-items: flex-end; }
  .lg-flex-space-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center; }
  .lg-flex-space-around-center {
    display: flex;
    justify-content: space-around;
    align-items: center; }
  .lg-flex-end-center {
    display: flex;
    justify-content: flex-end;
    align-items: center; }
  .lg-flex-end-end {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end; } }

/***************/
/* FONT STYLES */
/***************/
.serif {
  font-family: 'Playfair Display', serif; }

.italic {
  font-size: 2.5em;
  font-style: italic; }

.bold {
  font-family: 'Playfair Display', serif;
  font-size: 2.5em;
  font-weight: 700; }

.sans-serif {
  font-family: 'Raleway', sans-serif;
  font-size: 1.0em;
  font-weight: 300; }

.font-weight-300 {
  font-weight: 300; }

.font-weight-400 {
  font-weight: 400; }

.font-weight-500 {
  font-weight: 500; }

.font-weight-700 {
  font-weight: 700; }

.color-white {
  color: white; }

.color-black {
  color: #373737; }

.color-red {
  color: #ff0f0f; }

.font-size-0-5rem {
  font-size: 0.5rem; }

.font-size-1rem {
  font-size: 1.0rem; }

.font-size-1-5rem {
  font-size: 1.5rem; }

.font-size-2rem {
  font-size: 2.0rem; }

.font-size-2-5rem {
  font-size: 2.5rem; }

.font-size-3rem {
  font-size: 3.0rem; }

.font-size-3-5rem {
  font-size: 3.5rem; }

.text-shadow {
  text-shadow: 1px 1px 20px rgba(0, 0, 0, 0.5); }

.text-center {
  text-align: center; }

/***************************/
/* BACKGROUND IMAGE STYLES */
/***************************/
.bg-cover-top {
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat; }

.bg-cover-center {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat; }

.bg-cover-bottom {
  background-size: cover;
  background-position: bottom;
  background-repeat: no-repeat; }

.bg-contain-top {
  background-size: contain;
  background-position: top;
  background-repeat: no-repeat; }

.bg-contain-center {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat; }

.bg-contain-bottom {
  background-size: contain;
  background-position: bottom;
  background-repeat: no-repeat; }

.bg-no-repeat {
  background-repeat: no-repeat; }

/*****************************************************************/
/*                         MOBILE STYLES                         */
/*****************************************************************/
@media screen and (max-width: 767px) {
  /**************************************************************/
  /*                       mobile HEADER                        */
  /**************************************************************/
  .navbar {
    order: 2;
    border-top: 1px solid #646464;
    padding: 15px 30px; } }

/* media query mobile end */
/****************************************/
/*            TABLET STYLES             */
/****************************************/
@media screen and (min-width: 768px) {
  .header {
    flex-wrap: wrap;
    padding: 5px; }
    .header .navbar ul li {
      padding: 0 15px; } }

/* TABLET END */
.header {
  flex-wrap: wrap;
  padding: 5px; }
  .header .image-container {
    height: 10vh; }
  .header .logo {
    background-image: url("../assets/images/aloha-logo.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat; }
  .header .cart {
    background-image: url("../assets/images/cart-icon.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    align-self: flex-end; }
    .header .cart .cart-total {
      width: 20px;
      height: 20px;
      font-size: 12px;
      padding: 4px 4px;
      border-radius: 50%;
      background-color: #ff0000;
      color: #fff;
      text-align: center;
      margin-left: -50px; }
  .header .quantity-input {
    width: 15%;
    outline: none;
    border: none; }

/*****************************************************************/
/*                         MOBILE STYLES                         */
/*****************************************************************/
@media screen and (max-width: 767px) {
  /************************************************************/
  /*                         mobile BANNER                    */
  /************************************************************/
  .banner {
    height: 90vh;
    padding: 0 50px; }
  .banner-girl {
    height: 83%; }
  .collection-info {
    line-height: 2.5;
    padding: 0 20%; }
  .collection-info h4 {
    font-size: 1.2rem;
    font-weight: 500; }
  .collection-info h1 {
    line-height: 1; } }

/* media query mobile end */
/****************************************/
/*            TABLET STYLES             */
/****************************************/
@media screen and (min-width: 768px) {
  /*************************************/
  /*               BANNER              */
  /*************************************/
  .banner {
    height: 60vh; }
  .banner-girl {
    height: 50%; }
  .banner h4 {
    font-size: 1.3rem;
    font-weight: 500; } }

/* TABLET END */
/*****************************************/
/*            DESKTOP STYLES             */
/*****************************************/
@media screen and (min-width: 1240px) {
  /* BANNER */
  .banner {
    height: 90vh; }
  .banner-girl {
    height: 80%; } }

/* DESKTOP END */
/**********/
/* BANNER */
/**********/
.banner {
  background-image: url("../../assets/images/banner.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat; }

.collection-info {
  height: 20%;
  z-index: 2; }

/*****************************************************************/
/*                         MOBILE STYLES                         */
/*****************************************************************/
@media screen and (max-width: 767px) {
  /*************************************************************/
  /*                           mobile ABOUT                    */
  /*************************************************************/
  .section-title {
    font-size: 1.0rem;
    padding: 3% 0; }
  .about p {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 2.5; } }

/* media query mobile end */
/****************************************/
/*            TABLET STYLES             */
/****************************************/
@media screen and (min-width: 768px) {
  /*******************************************************************/
  /*                               ABOUT                             */
  /*******************************************************************/
  .about {
    line-height: 1.5; }
  .about p {
    font-size: 1.2rem;
    font-weight: lighter; } }

/* TABLET END */
/*********/
/* ABOUT */
/*********/
.about {
  padding: 60px 0; }

/*****************************************************************/
/*                         MOBILE STYLES                         */
/*****************************************************************/
@media screen and (max-width: 767px) {
  /*************************************************************/
  /*                          mobile SHOP                      */
  /*************************************************************/
  .flex-row {
    flex-wrap: wrap; }
  .flex-2 {
    min-width: 100%; }
  .flex-1 {
    min-width: 50%; }
  .category {
    height: 300px;
    border: 3.5px solid white; } }

/* media query mobile end */
/*****************************************/
/*            DESKTOP STYLES             */
/*****************************************/
@media screen and (min-width: 1240px) {
  /*SHOP*/
  .category {
    height: 300px;
    border: 3.5px solid white; } }

/* DESKTOP END */
/********/
/* SHOP */
/********/
.category {
  border: 3.5px solid white; }

.flex-1 {
  flex: 1 1 25%; }

.flex-2 {
  flex: 2 1 50%;
  width: 50%; }

.laptops {
  background-image: url("../assets/images/laptop-category.jpg"); }

.4k-tvs {
  background-image: url("../assets/images/tv-category.jpg"); }

.home-audio {
  background-image: url("../assets/images/home-audio-category.jpg"); }

.tablets {
  background-image: url("../assets/images/tablet-category.jpg"); }

.desktops {
  background-image: url("../assets/images/desktop-category.jpg"); }

.cellphones {
  background-image: url("../assets/images/cell-category.jpg"); }

/*****************************************************************/
/*                         MOBILE STYLES                         */
/*****************************************************************/
@media screen and (max-width: 767px) {
  /****************************************************
 *                 mobile FEATURED                  *
 ****************************************************/
  .owl-item.active {
    width: 100%;
    display: flex;
    justify-content: center; } }

/* media query mobile end */
/************/
/* FEATURED */
/************/
.owl-item.active {
  max-width: 25%; }

.featured {
  margin-top: 50px;
  /*max-height: 20vh;*/ }

.slider {
  overflow-x: hidden; }

.ctg-type {
  /*height: auto;*/
  font-size: 0.9rem; }

.item-name {
  margin: 10px 0; }

/*****************************************************************/
/*                         MOBILE STYLES                         */
/*****************************************************************/
@media screen and (max-width: 767px) {
  /*****************************************************
                     mobile SIGNUP
******************************************************/
  .signup p {
    font-size: 0.9rem;
    padding: 0 20px; } }

/* media query mobile end */
/****************************************/
/*            TABLET STYLES             */
/****************************************/
@media screen and (min-width: 768px) {
  /*signup*/
  .signup p {
    font-size: 1.2rem;
    padding: 5%; } }

/* TABLET END */
/*****************************************/
/*            DESKTOP STYLES             */
/*****************************************/
@media screen and (min-width: 1240px) {
  /*SIGNUP*/
  .signup {
    background-size: cover;
    background-position: bottom; }
  .signup p {
    padding: 5%; } }

/* DESKTOP END */
/**********/
/* SIGNUP */
/**********/
.signup {
  background: #006e00;
  /* For browsers that do not support gradients */
  background: -webkit-linear-gradient(#006e00, darkgreen);
  /* For Safari 5.1 to 6.0 */
  background: -o-linear-gradient(#006e00, darkgreen);
  /* For Opera 11.1 to 12.0 */
  background: -moz-linear-gradient(#006e00, darkgreen);
  /* For Firefox 3.6 to 15 */
  background: linear-gradient(#006e00, darkgreen);
  /* Standard syntax */ }

.email-form {
  background-color: #fff;
  margin: 20px auto;
  padding: 3px; }

.submit-btn {
  background-color: #ff0f0f;
  color: #fff; }

/*****************************************************************/
/*                         MOBILE STYLES                         */
/*****************************************************************/
@media screen and (max-width: 767px) {
  /********************************************************
                       mobile footer
*********************************************************/
  .footer {
    text-align: center;
    padding-top: 20px; }
  .social-media span {
    display: none; }
  .social-media {
    padding: 10% 0;
    font-size: 1.5rem; }
  .icon {
    padding: 10px; } }

/* media query mobile end */
/****************************************/
/*            TABLET STYLES             */
/****************************************/
@media screen and (min-width: 768px) {
  /* footer */
  .footer {
    padding: 5% 0; }
  .footer ul {
    line-height: 2; }
  .info {
    padding: 0 20px; }
  .social-media {
    /*	padding: 40px;*/
    margin-right: 80px; } }

/* TABLET END */
/**********/
/* FOOTER */
/**********/
.footer {
  margin-top: 10px;
  background: black; }

.footer address a {
  text-decoration: underline; }

.social-media i {
  max-width: 5px;
  margin-right: 20px; }

.mail-addr {
  color: #fafafa; }

.addToCart-btn {
  background-color: #646464;
  transition: background-color 0.5s;
  padding: 5px 10px; }
  .addToCart-btn:hover {
    background-color: #646464; }

.cart-main {
  background-color: #fafafa;
  /*	padding: 20%;*/ }

.cart-box {
  background-color: #fafafa;
  padding: 20px; }

#cart-main {
  display: none; }


text:
package ie.cit.group3.service;

/**
 * @author John Murphy
 *
 * This interface defines the contract/methods that a TagName can use at the Service Layer.
 * Activities are:
 *  save		Save a object/record to the repository
 * 	List<TagName> findBychobject_id(String id);
	Page<TagName> findByTagwordLike(String tagword, Pageable pageable);
	long countByTagwordLike(String tagword);

 */

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import ie.cit.group3.entity.TagName;

public interface TagNameService {

//	@Query(value="SELECT * FROM TagName WHERE chobject_id = :id", nativeQuery = true)
//	public List<TagName> findBychobject_id(@Param("id") String id);
	public List<TagName> findBychobject_id(String id);

	public Page<TagName> findByTagwordLike(String tagword, Pageable pageable);
	long countByTagwordLike(String tagword);

	public void save(TagName tagname);

	}

redpajama_set_name: RedPajamaGithub


text:
package io.eels.component.parquet

import io.eels.{Frame, Row}
import io.eels.schema.{Field, StringType, StructType}
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.permission.FsPermission
import org.apache.hadoop.fs.{FileSystem, Path}
import org.scalatest.{FlatSpec, Matchers}

class ParquetSinkTest extends FlatSpec with Matchers {

  implicit val conf = new Configuration()
  implicit val fs = FileSystem.get(conf)

  "ParquetSink" should "handle nulls" in {

    val schema = StructType(
      Field("name", StringType, nullable = true),
      Field("job", StringType, nullable = true),
      Field("location", StringType, nullable = true)
    )

    val frame = Frame.fromValues(
      schema,
      Vector("clint eastwood", "actor", null),
      Vector("elton john", null, "pinner")
    )

    val path = new Path("test.pq")
    if (fs.exists(path))
      fs.delete(path, false)

    frame.to(ParquetSink(path))

    val rows = ParquetSource(path).toFrame().collect()
    rows shouldBe Seq(
      Row(schema, Vector("clint eastwood", "actor", null)),
      Row(schema, Vector("elton john", null, "pinner"))
    )
    fs.delete(path, false)
  }

  it should "support overwrite" in {

    val path = new Path("overwrite_test.pq")
    fs.delete(path, false)

    val schema = StructType(Field("a", StringType))
    val frame = Frame(schema,
      Row(schema, Vector("x")),
      Row(schema, Vector("y"))
    )

    frame.to(ParquetSink(path))
    frame.to(ParquetSink(path).withOverwrite(true))
    fs.delete(path, false)
  }

  it should "support permissions" in {

    val path = new Path("permissions.pq")

    val schema = StructType(Field("a", StringType))
    val frame = Frame(schema,
      Row(schema, Vector("x")),
      Row(schema, Vector("y"))
    )

    frame.to(ParquetSink(path).withOverwrite(true).withPermission(FsPermission.valueOf("-rw-r----x")))
    fs.getFileStatus(path).getPermission.toString shouldBe "rw-r----x"
    fs.delete(path, false)
  }
}


text:
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class ServiceCollectionExtensions
    {
        public static IServiceCollection AddWebMail(this IServiceCollection self)
        {
            return self.AddSingleton<WebMail>()
                .AddSingleton<IContentTypeProvider, FileExtensionContentTypeProvider>();
        }
    }
}


text:
require 'spec_helper'

describe MultiConfig::ORMs::ActiveRecord::Config do
  describe '#path' do
    before do
      Rails.stub(:root).and_return('/')
    end
    subject { MultiConfig::ORMs::ActiveRecord::Config.path('other_db.yml') }
    it { should == '/config/other_db.yml' }
  end

  describe '#load' do
    let!(:db_config) { load_namespaced_config('database.yml') }
    let!(:other_config) { load_namespaced_config('other.yml') }
    let!(:erb_config) { load_namespaced_config('erb.yml') }

    it "should load yaml and erb/yaml files correctly" do
      MultiConfig::ORMs::ActiveRecord::Config.load('other.yml', 'other').should == other_config
      MultiConfig::ORMs::ActiveRecord::Config.load('erb.yml', 'erb').should == erb_config
    end

    it "should raise an error if file is not in present" do
      lambda { MultiConfig::ORMs::ActiveRecord::Config.load('none.yml', 'none') }.should raise_error(RuntimeError)
    end

    it "should raise an error when I specify invalid config file" do
      lambda { MultiConfig::ORMs::ActiveRecord::Config.load('invalid.yml', 'invalid') }.should raise_error(RuntimeError)
    end
  end
end


text:
import { createActions, createReducer } from 'reduxsauce';
import { Record, List } from 'immutable';

export const { Types: GoogleTypes, Creators: GoogleActions } = createActions({
  choosePlaces: [],
  getPlaces: ['latitude', 'longitude', 'placeType', 'name'],
  getPlacesSuccess: ['data', 'placeType'],
  getPlacesFailure: ['error'],
}, { prefix: 'GOOGLE_' });

const GoogleRecord = new Record({
  places: {
    movie_theater: List(), // eslint-disable-line camelcase
    park: List(),
  },
});

export const INITIAL_STATE = new GoogleRecord({});

const getPlacesSuccessHandler = (state, { data: { results }, placeType }) =>
  state.merge({ places: { [placeType]: results } });

export const reducer = createReducer(INITIAL_STATE, {
  [GoogleTypes.GET_PLACES_SUCCESS]: getPlacesSuccessHandler,
});


text:
package com.chiralBehaviors.groo;

import java.io.IOException;

/**
 * @author hhildebrand
 *
 */
public interface GrooMBean {

    public String getDescription();

    public String[] getParentNames();

    public String[] getManagedNetworks();

    public String[] getNetworkBuilderFilters();

    public void stop() throws IOException;
}


text:
package org.unitime.timetable.form;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.unitime.localization.impl.Localization;
import org.unitime.localization.messages.CourseMessages;
import org.unitime.timetable.defaults.ApplicationProperty;
import org.unitime.timetable.model.CourseOffering;
import org.unitime.timetable.model.Preference;
import org.unitime.timetable.model.SubjectArea;
import org.unitime.timetable.model.TeachingResponsibility;
import org.unitime.timetable.model.dao.SubjectAreaDAO;
import org.unitime.timetable.util.DynamicList;
import org.unitime.timetable.util.DynamicListObjectFactory;

/**
 * MyEclipse Struts
 * Creation date: 07-25-2006
 *
 * XDoclet definition:
 * @struts:form name="courseOfferingEditForm"
 *
 * @author Tomas Muller, Stephanie Schluttenhofer, Zuzana Mullerova
 */
public class CourseOfferingEditForm extends ActionForm {

	protected final static CourseMessages MSG = Localization.create(CourseMessages.class);

	private static final long serialVersionUID = 5719027599139781262L;
	// --------------------------------------------------------- Instance Variables
    private String op;
    private boolean add = false;
    private Long subjectAreaId;
    private Long courseOfferingId;
    private Long instrOfferingId;
    private String courseName;
    private String courseNbr;
    private String title;
    private String scheduleBookNote;
    private Long demandCourseOfferingId;
    private boolean allowDemandCourseOfferings;
    private Long consent;
    private String creditFormat;
    private Long creditType;
    private Long creditUnitType;
    private Float units;
    private Float maxUnits;
    private Boolean fractionalIncrementsAllowed;
    private String creditText;
    private Boolean isControl;
    private Boolean ioNotOffered;
    private String catalogLinkLabel;
    private String catalogLinkLocation;
    private Boolean byReservationOnly;
    private List instructors;
    private List responsibilities;
    private List percentShares;
    private String wkEnroll, wkChange, wkDrop;
    private Integer wkEnrollDefault, wkChangeDefault, wkDropDefault;
    private String weekStartDayOfWeek;
    private String courseTypeId;
    private String externalId;
    private Long alternativeCourseOfferingId;
    private boolean allowAlternativeCourseOfferings;
    private String notes;
    private String defaultTeachingResponsibilityId;

    // --------------------------------------------------------- Methods

    /**
     * Method validate
     * @param mapping
     * @param request
     * @return ActionErrors
     */
    public ActionErrors validate(
        ActionMapping mapping,
        HttpServletRequest request) {

        ActionErrors errors = new ActionErrors();

        if (getCourseNbr() != null && ApplicationProperty.CourseOfferingNumberUpperCase.isTrue()) {
        	setCourseNbr(getCourseNbr().toUpperCase());
        }

		if (op.equals(MSG.actionUpdateCourseOffering()) || op.equals(MSG.actionSaveCourseOffering())) {
			if (subjectAreaId == null || subjectAreaId == 0) {
				errors.add("subjectAreaId", new ActionMessage("errors.generic", MSG.errorSubjectRequired()));
			} else if (courseNbr==null || courseNbr.trim().length()==0) {
				errors.add("courseNbr", new ActionMessage("errors.generic", MSG.errorCourseNumberRequired()));
			}
			else {

		    	String courseNbrRegex = ApplicationProperty.CourseOfferingNumberPattern.value();
		    	String courseNbrInfo = ApplicationProperty.CourseOfferingNumberPatternInfo.value();
		    	try {
			    	Pattern pattern = Pattern.compile(courseNbrRegex);
			    	Matcher matcher = pattern.matcher(courseNbr);
			    	if (!matcher.find()) {
				        errors.add("courseNbr", new ActionMessage("errors.generic", courseNbrInfo));
			    	}
		    	}
		    	catch (Exception e) {
			        errors.add("courseNbr", new ActionMessage("errors.generic", MSG.errorCourseNumberCannotBeMatched(courseNbrRegex,e.getMessage())));
		    	}

		    	if (ApplicationProperty.CourseOfferingNumberMustBeUnique.isTrue()){
					SubjectArea sa = new SubjectAreaDAO().get(subjectAreaId);
					CourseOffering co = CourseOffering.findBySessionSubjAreaAbbvCourseNbr(sa.getSessionId(), sa.getSubjectAreaAbbreviation(), courseNbr);
					if (add && co != null) {
						errors.add("courseNbr", new ActionMessage("errors.generic", MSG.errorCourseCannotBeCreated()));
					} else if (!add && co!=null && !co.getUniqueId().equals(courseOfferingId)) {
			            errors.add("courseNbr", new ActionMessage("errors.generic", MSG.errorCourseCannotBeRenamed()));
					}
		    	}

			}

			for (int i = 0; i < instructors.size(); i++) {
				String id1 = (String)instructors.get(i);
				String r1 = (String)responsibilities.get(i);
				if (Preference.BLANK_PREF_VALUE.equals(id1)) continue;

				for (int j = i + 1; j < instructors.size(); j++) {
					String id2 = (String)instructors.get(j);
					String r2 = (String)responsibilities.get(j);
					if (id1.equals(id2) && r1.equals(r2)) {
						errors.add("duplicateCoordinator", new ActionMessage("errors.generic", MSG.errorDuplicateCoordinator()));
					}
				}
			}
		}

        return errors;
    }

    protected DynamicListObjectFactory factory = new DynamicListObjectFactory() {
        public Object create() {
            return new String(Preference.BLANK_PREF_VALUE);
        }
    };

    /**
     * Method reset
     * @param mapping
     * @param request
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        op = "";
        subjectAreaId = null;
        courseOfferingId = null;
        instrOfferingId = null;
        courseName = "";
        title = "";
        scheduleBookNote = "";
        demandCourseOfferingId = null;
        consent = null;
        creditFormat = null; creditType = null;
        creditUnitType = null;
        units = null;
        maxUnits = null;
        fractionalIncrementsAllowed = new Boolean(false);
        creditText = "";
        courseNbr = "";
        ioNotOffered = null;
        catalogLinkLabel = null;
        catalogLinkLocation = null;
        instructors = DynamicList.getInstance(new ArrayList(), factory);
        responsibilities = DynamicList.getInstance(new ArrayList(), factory);
        percentShares = DynamicList.getInstance(new ArrayList(), new DynamicListObjectFactory() {
            public Object create() {
                return "";
            }
        });
        byReservationOnly = false;
        wkEnroll = null; wkChange = null; wkDrop = null;
        wkEnrollDefault = null; wkChangeDefault = null; wkDropDefault = null;
        weekStartDayOfWeek = null;
        courseTypeId = null;
        add = false;
        externalId = null;
        alternativeCourseOfferingId = null;
        notes = null;
        TeachingResponsibility tr = TeachingResponsibility.getDefaultCoordinatorTeachingResponsibility();
        if (tr != null)
        	defaultTeachingResponsibilityId = tr.getUniqueId().toString();
        else
        	defaultTeachingResponsibilityId = "";
    }

    public boolean isAdd() { return add; }
    public void setAdd(boolean add) { this.add = add; }

    public Long getCourseOfferingId() {
        return courseOfferingId;
    }
    public void setCourseOfferingId(Long courseOfferingId) {
        this.courseOfferingId = courseOfferingId;
    }

    public String getScheduleBookNote() {
        return scheduleBookNote;
    }
    public void setScheduleBookNote(String scheduleBookNote) {
        this.scheduleBookNote = scheduleBookNote;
    }

    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }

    public String getCourseName() {
        return courseName;
    }
    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }
    public Long getInstrOfferingId() {
        return instrOfferingId;
    }
    public void setInstrOfferingId(Long instrOfferingId) {
        this.instrOfferingId = instrOfferingId;
    }
    public String getOp() {
        return op;
    }
    public void setOp(String op) {
        this.op = op;
    }
    public Long getSubjectAreaId() {
        return subjectAreaId;
    }
    public void setSubjectAreaId(Long subjectAreaId) {
        this.subjectAreaId = subjectAreaId;
    }
    public Long getDemandCourseOfferingId() {
    	return demandCourseOfferingId;
    }
    public void setDemandCourseOfferingId(Long demandCourseOfferingId) {
    	this.demandCourseOfferingId = demandCourseOfferingId;
    }
    public boolean getAllowDemandCourseOfferings() {
    	return allowDemandCourseOfferings;
    }
    public void setAllowDemandCourseOfferings(boolean allowDemandCourseOfferings) {
    	this.allowDemandCourseOfferings = allowDemandCourseOfferings;
    }
    public Long getConsent() {
        return consent;
    }
    public void setConsent(Long consent) {
        this.consent = consent;
    }

	public String getCreditFormat() {
		return creditFormat;
	}

	public void setCreditFormat(String creditFormat) {
		this.creditFormat = creditFormat;
	}

	public String getCreditText() {
		return creditText;
	}

	public void setCreditText(String creditText) {
		this.creditText = creditText;
	}

	public Long getCreditType() {
		return creditType;
	}

	public void setCreditType(Long creditType) {
		this.creditType = creditType;
	}

	public Long getCreditUnitType() {
		return creditUnitType;
	}

	public void setCreditUnitType(Long creditUnitType) {
		this.creditUnitType = creditUnitType;
	}

	public Boolean getFractionalIncrementsAllowed() {
		return fractionalIncrementsAllowed;
	}

	public void setFractionalIncrementsAllowed(Boolean fractionalIncrementsAllowed) {
		this.fractionalIncrementsAllowed = fractionalIncrementsAllowed;
	}

	public Float getMaxUnits() {
		return maxUnits;
	}

	public void setMaxUnits(Float maxUnits) {
		this.maxUnits = maxUnits;
	}

	public Float getUnits() {
		return units;
	}

	public void setUnits(Float units) {
		this.units = units;
	}

	public String getCourseNbr() {
		return courseNbr;
	}

	public void setCourseNbr(String courseNbr) {
		if (ApplicationProperty.CourseOfferingNumberUpperCase.isTrue())
        	courseNbr = courseNbr.toUpperCase();
		this.courseNbr = courseNbr;
	}

	public Boolean getIsControl() {
		return isControl;
	}

	public void setIsControl(Boolean isControl) {
		this.isControl = isControl;
	}

	public Boolean getIoNotOffered() {
		return ioNotOffered;
	}

	public void setIoNotOffered(Boolean ioNotOffered) {
		this.ioNotOffered = ioNotOffered;
	}

	public String getCatalogLinkLabel() {
		return catalogLinkLabel;
	}

	public void setCatalogLinkLabel(String catalogLinkLabel) {
		this.catalogLinkLabel = catalogLinkLabel;
	}

	public String getCatalogLinkLocation() {
		return catalogLinkLocation;
	}

	public void setCatalogLinkLocation(String catalogLinkLocation) {
		this.catalogLinkLocation = catalogLinkLocation;
	}

    public List getInstructors() { return instructors; }
    public String getInstructors(int key) { return instructors.get(key).toString(); }
    public void setInstructors(int key, Object value) { this.instructors.set(key, value); }
    public void setInstructors(List instructors) { this.instructors = instructors; }

    public List getResponsibilities() { return responsibilities; }
    public String getResponsibilities(int key) { return responsibilities.get(key).toString(); }
    public void setResponsibilities(int key, Object value) { this.responsibilities.set(key, value); }
    public void setResponsibilities(List responsibilities) { this.responsibilities = responsibilities; }

    public List getPercentShares() { return percentShares; }
    public String getPercentShares(int key) { return percentShares.get(key).toString(); }
    public void setPercentShares(int key, Object value) { this.percentShares.set(key, value); }
    public void setPercentShares(List percentShares) { this.percentShares = percentShares; }

    public boolean isByReservationOnly() { return byReservationOnly; }
    public void setByReservationOnly(boolean byReservationOnly) { this.byReservationOnly = byReservationOnly; }

    public String getWkEnroll() { return wkEnroll; }
    public void setWkEnroll(String wkEnroll) { this.wkEnroll = wkEnroll; }
    public Integer getWkEnrollDefault() { return wkEnrollDefault; }
    public void setWkEnrollDefault(Integer wkEnrollDefault) { this.wkEnrollDefault = wkEnrollDefault; }

    public String getWkChange() { return wkChange; }
    public void setWkChange(String wkChange) { this.wkChange = wkChange; }
    public Integer getWkChangeDefault() { return wkChangeDefault; }
    public void setWkChangeDefault(Integer wkChangeDefault) { this.wkChangeDefault = wkChangeDefault; }

    public String getWkDrop() { return wkDrop; }
    public void setWkDrop(String wkDrop) { this.wkDrop = wkDrop; }
    public Integer getWkDropDefault() { return wkDropDefault; }
    public void setWkDropDefault(Integer wkDropDefault) { this.wkDropDefault = wkDropDefault; }

    public String getWeekStartDayOfWeek() { return weekStartDayOfWeek; }
    public void setWeekStartDayOfWeek(String weekStartDayOfWeek) { this.weekStartDayOfWeek = weekStartDayOfWeek; }

    public String getCourseTypeId() { return courseTypeId; }
    public void setCourseTypeId(String courseTypeId) { this.courseTypeId = courseTypeId; }

    public String getExternalId() { return externalId; }
    public void setExternalId(String externalId) { this.externalId = externalId; }

    public Long getAlternativeCourseOfferingId() { return alternativeCourseOfferingId; }
    public void setAlternativeCourseOfferingId(Long alternativeCourseOfferingId) { this.alternativeCourseOfferingId = alternativeCourseOfferingId; }

    public boolean getAllowAlternativeCourseOfferings() { return allowAlternativeCourseOfferings; }
    public void setAllowAlternativeCourseOfferings(boolean allowAlternativeCourseOfferings) { this.allowAlternativeCourseOfferings = allowAlternativeCourseOfferings; }

    public String getNotes() { return notes; }
    public void setNotes(String notes) { this.notes = notes; }

    public String getDefaultTeachingResponsibilityId() { return defaultTeachingResponsibilityId; }
    public void setDefaultTeachingResponsibilityId(String defaultTeachingResponsibilityId) { this.defaultTeachingResponsibilityId = defaultTeachingResponsibilityId; }
}


text:
import datetime

import django_filters

from django import forms
from django.db.models import Q, Subquery
from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as _

from wagtail.admin.filters import DateRangePickerWidget, WagtailFilterSet
from wagtail.core.log_actions import page_log_action_registry
from wagtail.core.models import Page, PageLogEntry, UserPagePermissionsProxy

from .base import ReportView

class SiteHistoryReportFilterSet(WagtailFilterSet):
    action = django_filters.ChoiceFilter(choices=page_log_action_registry.get_choices)
    hide_commenting_actions = django_filters.BooleanFilter(
        label=_('Hide commenting actions'),
        method='filter_hide_commenting_actions',
        widget=forms.CheckboxInput,
    )
    timestamp = django_filters.DateFromToRangeFilter(label=_('Date'), widget=DateRangePickerWidget)
    label = django_filters.CharFilter(label=_('Title'), lookup_expr='icontains')
    user = django_filters.ModelChoiceFilter(
        field_name='user', queryset=lambda request: PageLogEntry.objects.all().get_users()
    )

    def filter_hide_commenting_actions(self, queryset, name, value):
        if value:
            queryset = queryset.exclude(
                action__startswith='wagtail.comments'
            )
        return queryset

    class Meta:
        model = PageLogEntry
        fields = ['label', 'action', 'user', 'timestamp', 'hide_commenting_actions']

class LogEntriesView(ReportView):
    template_name = 'wagtailadmin/reports/site_history.html'
    title = _('Site history')
    header_icon = 'history'
    filterset_class = SiteHistoryReportFilterSet

    export_headings = {
        "object_id": _("ID"),
        "title": _("Title"),
        "object_verbose_name": _("Type"),
        "action": _("Action type"),
        "timestamp": _("Date/Time")
    }
    list_export = [
        "object_id",
        "label",
        "object_verbose_name",
        "action",
        "timestamp"
    ]

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        self.custom_field_preprocess['action'] = {
            self.FORMAT_CSV: self.get_action_label,
            self.FORMAT_XLSX: self.get_action_label
        }

    def get_filename(self):
        return "audit-log-{}".format(
            datetime.datetime.today().strftime("%Y-%m-%d")
        )

    def get_queryset(self):
        q = Q(page__in=UserPagePermissionsProxy(self.request.user).explorable_pages())

        root_page_permissions = Page.get_first_root_node().permissions_for_user(self.request.user)
        if (
            self.request.user.is_superuser
            or root_page_permissions.can_add_subpage() or root_page_permissions.can_edit()
        ):
            # Include deleted entries
            q = q | Q(page_id__in=Subquery(
                PageLogEntry.objects.filter(deleted=True).values('page_id')
            ))

        # Using prefech_related() on page, as select_related() generates an INNER JOIN,
        # which filters out entries for deleted pages
        return PageLogEntry.objects.filter(q).select_related(
            'user', 'user__wagtail_userprofile'
        ).prefetch_related('page')

    def get_action_label(self, action):
        from wagtail.core.log_actions import page_log_action_registry
        return force_str(page_log_action_registry.get_action_label(action))


text:
package com.antoniocappiello.curriculumvitae.presenter.event;

import android.widget.ImageView;

import com.antoniocappiello.curriculumvitae.model.Category;

public class CategoryClickedEvent {
    private final Category mCategory;
    private ImageView mImageView;

    public CategoryClickedEvent(Category category, ImageView imageView) {
        mCategory = category;
        mImageView = imageView;
    }

    public Category getCategory() {
        return mCategory;
    }

    public ImageView getImageView() {
        return mImageView;
    }

}


text:
define([
	'backbone', 'numeral',
	'tmpl!view/drive-item',
	'bootstrap'
], function(Backbone, numeral, TmplDrive) {

	var View = Backbone.View.extend({
		tagName: 'li',

		template: TmplDrive,

		initialize: function() {

			var tmpl = this.model.attributes;
			tmpl.percent = Math.round(this.model.get('used') / this.model.get('total') * 100);

			this.$el.html(this.template(tmpl)).addClass('media');

			this.listenTo(this.model, 'change', this.updateView);
			this.listenTo(this.model, 'change:offline', this.updateOffline);
			this.listenTo(this.model, 'change:used', this.updateSpaceText);

			this.buildView();
			this.updateView();

		},

		buildView: function() {
			var icon = this.model.get('icon');
			if(icon) {
				this.$('img').attr('src', Config.WebRoot + icon);
			}

			if(this.model.get('offline')) {
				this.updateOffline();
			} else {
				if(Config.IsLoggedIn) {
					this.updateSpaceText();
				} else {
					this.$('.loggedIn').hide();
				}
			}
		},

		updateOffline: function() {
			if(this.model.get('offline')) {
				this.$('.server-offline').show();
				this.$('.server-online').hide();
				this.$('.loggedIn').hide();

			} else {
				this.$('.server-offline').hide();
				this.$('.server-online').show();
			}
		},

		updateSpaceText: function() {
			if(Config.IsLoggedIn) {
				var usedSpace = this.model.get('used')
				  , totalSpace = this.model.get('total');

				this.$('.usedSpace').html(numeral(usedSpace).format('0.00 b'));
				this.$('.totalSpace').html(numeral(totalSpace).format('0.00 b'));
			}
		},

		getPercentageClass: function(percent) {
			var loadColor = '';
			if(percent >= 75 && 90 > percent) {
				loadColor = 'progress-bar-warning';
			} else if(percent>= 90) {
				loadColor = 'progress-bar-danger';
			}
			return loadColor;
		},

		updateView: function() {
			if(!this.model.get('offline')) {
				var total = this.model.get('total')
				  , used = this.model.get('used');

				var percent = Math.round(used / total * 100);

				this.$('.progress').attr('title', percent + '% Full').tooltip();
				var progress = this.$('.progress .progress-bar').css({width: percent + '%'});
				progress.removeClass('progress-bar-warning progress-bar-danger').addClass(this.getPercentageClass(percent));
			}
		},

		render: function() {
			return this.$el;
		}
	});

	return View;
});


text:
package org.kuali.rice.krad.devtools.maintainablexml;

import org.apache.commons.lang.StringUtils;
import org.kuali.rice.kns.bo.GlobalBusinessObject;
import org.kuali.rice.kns.bo.GlobalBusinessObjectDetail;
import org.kuali.rice.krad.bo.PersistableBusinessObject;
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;

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

/**
 * This class simply acts as a container to hold the List of Delegate Changes and the list of Account entries, for the Global
 * Delegate Change Document.
 */
public class TestDelegateGlobal extends PersistableBusinessObjectBase implements GlobalBusinessObject {

    protected String documentNumber;

    protected String modelName;
    protected String modelChartOfAccountsCode;
    protected String modelOrganizationCode;

    protected TestDelegateModel model;

    protected List<TestGlobalDetail> accountGlobalDetails;
    protected List<TestDelegateGlobalDetail> delegateGlobals;

    /**
     * Constructs a DelegateGlobal.java.
     */
    public TestDelegateGlobal() {
        super();
        accountGlobalDetails = new ArrayList<TestGlobalDetail>();
        delegateGlobals = new ArrayList<TestDelegateGlobalDetail>();
    }

    /**
     * This method adds a single TestGlobalDetail instance to the list. If one is already present in the list with the same
     * chartCode and accountNumber, then this new one will not be added.
     *
     * @param accountGlobalDetail - populated TestGlobalDetail instance
     */
    public void addAccount(TestGlobalDetail accountGlobalDetail) {

        // validate the argument
        if (accountGlobalDetail == null) {
            throw new IllegalArgumentException("The accountGlobalDetail instanced passed in was null.");
        }
        else if (StringUtils.isBlank(accountGlobalDetail.getChartOfAccountsCode())) {
            throw new IllegalArgumentException("The chartOfAccountsCode member of the accountGlobalDetail object was not populated.");
        }
        else if (StringUtils.isBlank(accountGlobalDetail.getAccountNumber())) {
            throw new IllegalArgumentException("The accountNumber member of the accountGlobalDetail object was not populated.");
        }

        // add the object if one doesnt already exist, otherwise silently do nothing
        TestGlobalDetail testObject = getAccount(accountGlobalDetail.getChartOfAccountsCode(), accountGlobalDetail.getAccountNumber());
        if (testObject == null) {
            this.accountGlobalDetails.add(accountGlobalDetail);
        }
    }

    /**
     * This method retrieves the specific TestGlobalDetail object that corresponds to your requested chartCode and accountNumber
     * (or a null object if there is no match).
     *
     * @param chartCode
     * @param accountNumber
     * @return returns the TestGlobalDetail instance matching the chartCode & accountNumber passed in, or Null if none match
     */
    public TestGlobalDetail getAccount(String chartCode, String accountNumber) {

        // validate the argument
        if (StringUtils.isBlank(chartCode)) {
            throw new IllegalArgumentException("The chartCode argument was null or empty.");
        }
        else if (StringUtils.isBlank(accountNumber)) {
            throw new IllegalArgumentException("The accountNumber argument was null or empty.");
        }

        // walk the list of TestGlobalDetail objects
        for (Iterator iter = this.accountGlobalDetails.iterator(); iter.hasNext();) {
            TestGlobalDetail accountGlobalDetail = (TestGlobalDetail) iter.next();

            // if this one is a match, then quit
            if (chartCode.equalsIgnoreCase(accountGlobalDetail.getChartOfAccountsCode()) && accountNumber.equalsIgnoreCase(accountGlobalDetail.getAccountNumber())) {
                return accountGlobalDetail;
            }
        }

        // we return null if one is not found
        return null;
    }

    public List<PersistableBusinessObject> generateDeactivationsToPersist() {

        return new ArrayList<PersistableBusinessObject>();
    }

    @SuppressWarnings("deprecation")
    public List<PersistableBusinessObject> generateGlobalChangesToPersist() {

        List<TestDelegateGlobalDetail> changeDocuments = this.getDelegateGlobals();
        List<TestGlobalDetail> accountDetails = this.getAccountGlobalDetails();

        return new ArrayList<PersistableBusinessObject>();
    }

    protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {

        LinkedHashMap m = new LinkedHashMap();
        return m;
    }

    public String getDocumentNumber() {
        return documentNumber;
    }

    public void setDocumentNumber(String documentNumber) {
        this.documentNumber = documentNumber;

    }

    /**
     * Gets the accountGlobalDetails attribute.
     *
     * @return Returns the accountGlobalDetails.
     */
    public final List<TestGlobalDetail> getAccountGlobalDetails() {
        return accountGlobalDetails;
    }

    /**
     * Sets the accountGlobalDetails attribute value.
     *
     * @param accountGlobalDetails The accountGlobalDetails to set.
     */
    public final void setAccountGlobalDetails(List<TestGlobalDetail> accountGlobalDetails) {
        this.accountGlobalDetails = accountGlobalDetails;
    }

    /**
     * Gets the delegateGlobals attribute.
     *
     * @return Returns the delegateGlobals.
     */
    public final List<TestDelegateGlobalDetail> getDelegateGlobals() {
        return delegateGlobals;
    }

    /**
     * Sets the delegateGlobals attribute value.
     *
     * @param delegateGlobals The delegateGlobals to set.
     */
    public final void setDelegateGlobals(List<TestDelegateGlobalDetail> delegateGlobals) {
        this.delegateGlobals = delegateGlobals;
    }

    public boolean isPersistable() {
        // fail if the PK for this object is emtpy

        // otherwise, its all good
        return true;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String loadModelName) {
        this.modelName = loadModelName;
    }

    public String getModelChartOfAccountsCode() {
        return modelChartOfAccountsCode;
    }

    public void setModelChartOfAccountsCode(String loadModelChartOfAccountsCode) {
        this.modelChartOfAccountsCode = loadModelChartOfAccountsCode;
    }

    public String getModelOrganizationCode() {
        return modelOrganizationCode;
    }

    public void setModelOrganizationCode(String loadModelOrganizationCode) {
        this.modelOrganizationCode = loadModelOrganizationCode;
    }

    public TestDelegateModel getModel() {
        return model;
    }

    public void setModel(TestDelegateModel loadModel) {
        this.model = loadModel;
    }

    public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() {
        ArrayList<GlobalBusinessObjectDetail> details = new ArrayList<GlobalBusinessObjectDetail>(accountGlobalDetails.size() + delegateGlobals.size());
        details.addAll(accountGlobalDetails);
        details.addAll(delegateGlobals);
        return details;
    }

    @Override
    public void linkEditableUserFields() {
        super.linkEditableUserFields();
        if (this == null) {
            throw new IllegalArgumentException("globalDelegate parameter passed in was null");
        }
        List<PersistableBusinessObject> bos = new ArrayList<PersistableBusinessObject>();
        bos.addAll(getDelegateGlobals());
    }

    /**
     * @see org.kuali.rice.krad.bo.PersistableBusinessObjectBase#buildListOfDeletionAwareLists()
     */
    @Override
    public List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists() {
        List<Collection<PersistableBusinessObject>> managedLists = super.buildListOfDeletionAwareLists();

        managedLists.add( new ArrayList<PersistableBusinessObject>( getAccountGlobalDetails() ) );
        managedLists.add( new ArrayList<PersistableBusinessObject>( getDelegateGlobals() ) );

        return managedLists;
    }
}


text:
package main

import (
	"log"
	"net"
	"os"
	"path"
	"strconv"
	"strings"
	"sync"

	dockerapi "github.com/fsouza/go-dockerclient"
)

type PublishedPort struct {
	HostPort    string
	HostIP      string
	HostName    string
	ExposedPort string
	ExposedIP   string
	PortType    string
	Container   *dockerapi.Container
}

type Service struct {
	ID   string
	Name string
	// HostName string
	Port  int
	IP    string
	Tags  []string
	Attrs map[string]string
	TTL   int

	pp PublishedPort
}

func CombineTags(tagParts ...string) []string {
	tags := make([]string, 0)
	for _, element := range tagParts {
		if element != "" {
			tags = append(tags, strings.Split(element, ",")...)
		}
	}
	return tags
}

func NewService(port PublishedPort, isgroup bool) *Service {
	container := port.Container
	defaultName := strings.Split(path.Base(container.Config.Image), ":")[0]
	if isgroup {
		defaultName = defaultName + "-" + port.ExposedPort
	}

	hostname, err := os.Hostname()
	if err != nil {
		hostname = port.HostIP
	} else {
		if port.HostIP == "0.0.0.0" {
			ip, err := net.ResolveIPAddr("ip", hostname)
			if err == nil {
				port.HostIP = ip.String()
			}
		}
	}

	if *hostIp != "" {
		port.HostIP = *hostIp
	}

	metadata := serviceMetaData(container.Config.Env, port.ExposedPort)

	ignore := mapdefault(metadata, "ignore", "")
	if ignore != "" {
		return nil
	}

	service := new(Service)
	service.pp = port
	if *internal {
		service.ID = port.HostName + ":" + container.Name[1:] + ":" + port.ExposedPort
	} else {
		service.ID = hostname + ":" + container.Name[1:] + ":" + port.ExposedPort
	}
	service.Name = mapdefault(metadata, "name", defaultName)
	var p int
	if *internal == true {
		service.IP = port.ExposedIP
		p, _ = strconv.Atoi(port.ExposedPort)
		// service.HostName = port.HostName
	} else {
		service.IP = port.HostIP
		p, _ = strconv.Atoi(port.HostPort)
	}
	service.Port = p

	if port.PortType == "udp" {
		service.Tags = CombineTags(mapdefault(metadata, "tags", ""), *forceTags, "udp")
		service.ID = service.ID + ":udp"
	} else {
		service.Tags = CombineTags(mapdefault(metadata, "tags", ""), *forceTags)
	}

	id := mapdefault(metadata, "id", "")
	if id != "" {
		service.ID = id
	}

	delete(metadata, "id")
	delete(metadata, "tags")
	delete(metadata, "name")
	service.Attrs = metadata

	service.TTL = *refreshTtl

	return service
}

func serviceMetaData(env []string, port string) map[string]string {
	metadata := make(map[string]string)
	for _, kv := range env {
		kvp := strings.SplitN(kv, "=", 2)
		if strings.HasPrefix(kvp[0], "SERVICE_") && len(kvp) > 1 {
			key := strings.ToLower(strings.TrimPrefix(kvp[0], "SERVICE_"))
			portkey := strings.SplitN(key, "_", 2)
			_, err := strconv.Atoi(portkey[0])
			if err == nil && len(portkey) > 1 {
				if portkey[0] != port {
					continue
				}
				metadata[portkey[1]] = kvp[1]
			} else {
				metadata[key] = kvp[1]
			}
		}
	}
	return metadata
}

type RegistryBridge struct {
	sync.Mutex
	docker   *dockerapi.Client
	registry ServiceRegistry
	services map[string][]*Service
}

func MakePublishedPort(container *dockerapi.Container, port dockerapi.Port, published []dockerapi.PortBinding) PublishedPort {
	var hp, hip string
	if len(published) > 0 {
		hp = published[0].HostPort
		hip = published[0].HostIP
	}
	if (hip == "") {
		hip = "0.0.0.0"
	}
	p := strings.Split(string(port), "/")
	return PublishedPort{
		HostPort:    hp,
		HostIP:      hip,
		HostName:    container.Config.Hostname,
		ExposedPort: p[0],
		ExposedIP:   container.NetworkSettings.IPAddress,
		PortType:    p[1],
		Container:   container,
	}
}

func (b *RegistryBridge) Add(containerId string) {
	b.Lock()
	defer b.Unlock()
	b.addInternal(containerId, false)
}

func (b *RegistryBridge) addInternal(containerId string, quiet bool) {
	if b.services[containerId] != nil {
		log.Println("registrator: container, ", containerId[:12], ", already exists, ignoring")
		// Alternatively, remove and readd or resubmit.
		return
	}

	container, err := b.docker.InspectContainer(containerId)
	if err != nil {
		log.Println("registrator: unable to inspect container:", containerId[:12], err)
		return
	}

	ports := make(map[string]PublishedPort)

	// Extract configured host port mappings, relevant when using --net=host
	for port, published := range container.HostConfig.PortBindings {
		ports[string(port)] = MakePublishedPort(container, port, published)
	}

	// Extract runtime port mappings, relevant when using e.g. --net=bridge
	for port, published := range container.NetworkSettings.Ports {
		ports[string(port)] = MakePublishedPort(container, port, published)
	}

	for _, port := range ports {
		if *internal != true && port.HostPort == "" {
			if !quiet {
				log.Println("registrator: ignored", container.ID[:12], "port", port.ExposedPort, "not published on host")
			}
			continue
		}
		service := NewService(port, len(ports) > 1)
		if service == nil {
			if !quiet {
				log.Println("registrator: ignored:", container.ID[:12], "service on port", port.ExposedPort)
			}
			continue
		}
		err := retry(func() error {
			return b.registry.Register(service)
		})
		if err != nil {
			log.Println("registrator: unable to register service:", service, err)
			continue
		}
		b.services[container.ID] = append(b.services[container.ID], service)
		log.Println("registrator: added:", container.ID[:12], service.ID)
	}

	if len(b.services[container.ID]) == 0 && !quiet {
		log.Println("registrator: ignored:", container.ID[:12], "no published ports")
	}
}

func (b *RegistryBridge) Remove(containerId string) {
	b.Lock()
	defer b.Unlock()
	for _, service := range b.services[containerId] {
		err := retry(func() error {
			return b.registry.Deregister(service)
		})
		if err != nil {
			log.Println("registrator: unable to deregister service:", service.ID, err)
			continue
		}
		log.Println("registrator: removed:", containerId[:12], service.ID)
	}
	delete(b.services, containerId)
}

func (b *RegistryBridge) Refresh() {
	b.Lock()
	defer b.Unlock()
	for containerId, services := range b.services {
		for _, service := range services {
			err := b.registry.Refresh(service)
			if err != nil {
				log.Println("registrator: unable to refresh service:", service.ID, err)
				continue
			}
			log.Println("registrator: refreshed:", containerId[:12], service.ID)
		}
	}
}

func (b *RegistryBridge) Sync(quiet bool) {
	b.Lock()
	defer b.Unlock()

	log.Println("registrator: resyncing services")

	containers, err := b.docker.ListContainers(dockerapi.ListContainersOptions{})
	if err != nil && quiet {
		log.Println("registrator: error listing containers, skipping sync")
		return
	} else if err != nil && !quiet {
		log.Fatal(err)
	}

	// NOTE: This assumes reregistering will do the right thing, i.e. nothing.
	// NOTE: This will NOT remove services.
	for _, listing := range containers {
		services := b.services[listing.ID]
		if services == nil {
			b.addInternal(listing.ID, quiet)
		} else {
			for _, service := range services {
				err := retry(func() error {
					return b.registry.Register(service)
				})
				if err != nil {
					log.Println("registrator: unable to sync service:", service, err)
				}
			}
		}
	}
}


text:
{% if page.image.file %}

  {% if page.image.author %}

Photo Credit:
    {{ page.image.author }}
  {% endif %}
{% endif %}