text:
package com.faceunity.entity;

import java.util.List;

/**
 * @author Richie on 2019.03.22
 * Avatar 组件,脸型、鼻子、眼睛等等
 */
public class AvatarComponent {
    public static final int CUSTOM = 1;
    public static final int NOT_CUSTOM = 0;
    private int type;
    private int iconId;
    private boolean isCustom;
    private List<AvatarFaceAspect> avatarFaceAspects;
    private String bundlePath;

    public AvatarComponent(String bundlePath, int type, int iconId) {
        this.bundlePath = bundlePath;
        this.type = type;
        this.iconId = iconId;
    }

    public AvatarComponent(int type, int iconId, List<AvatarFaceAspect> avatarFaceAspects) {
        this(type, iconId, avatarFaceAspects, false);
    }

    public AvatarComponent(int type, int iconId, List<AvatarFaceAspect> avatarFaceAspects, boolean isCustom) {
        this.type = type;
        this.iconId = iconId;
        this.avatarFaceAspects = avatarFaceAspects;
        this.isCustom = isCustom;
    }

    public String getBundlePath() {
        return bundlePath;
    }

    public void setBundlePath(String bundlePath) {
        this.bundlePath = bundlePath;
    }

    public boolean isCustom() {
        return isCustom;
    }

    public void setCustom(boolean custom) {
        isCustom = custom;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getIconId() {
        return iconId;
    }

    public void setIconId(int iconId) {
        this.iconId = iconId;
    }

    public List<AvatarFaceAspect> getAvatarFaceAspects() {
        return avatarFaceAspects;
    }

    public void setAvatarFaceAspects(List<AvatarFaceAspect> avatarFaceAspects) {
        this.avatarFaceAspects = avatarFaceAspects;
    }

    @Override
    public String toString() {
        return "AvatarComponent{" +
                "type=" + type +
                ", iconId=" + iconId +
                ", bundlePath='" + bundlePath + '\'' +
                ", avatarFaceAspects=" + avatarFaceAspects +
                '}';
    }

}


text:
namespace Kentico.Kontent.Delivery.Benchmarks.ContentTypes
{
    public partial class Accessory
    {
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.sparkcommerce.common.persistence;

import org.sparkcommerce.common.presentation.AdminPresentation;
import org.sparkcommerce.common.presentation.client.VisibilityEnum;
import org.sparkcommerce.common.sandbox.SandBoxNonProductionSkip;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * @author J Dasari
 */
@Embeddable
public class ArchiveStatus implements Serializable, SandBoxNonProductionSkip {

    @Column(name = "ARCHIVED")
    @AdminPresentation(friendlyName = "archived", visibility = VisibilityEnum.HIDDEN_ALL, group = "ArchiveStaobjus")
    protected Character archived = 'N';

    public Character getArchived() {
        return archived;
    }

    public void setArchived(Character archived) {
        this.archived = archived;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null) return false;
        if (!getClass().isAssignableFrom(o.getClass())) return false;

        ArchiveStatus that = (ArchiveStatus) o;

        if (archived != null ? !archived.equals(that.archived) : that.archived != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return archived != null ? archived.hashCode() : 0;
    }
}


text:
import os
import re

from zope.interface import implements
from twisted.internet import reactor
from thrift.transport import TTwisted

from db import Connection
from log import Logger
from settings import Setting

current_dir = os.path.dirname(os.path.abspath(__file__))

from gen.today import TodayInternalApiService
from gen.today.ttypes import *

class TodayInternalApiServiceHandler:
    implements(TodayInternalApiService.Iface)

    def __init__(self):
        Logger.info('LetterApiService started.')

    def __getattr__(self, item):
        Logger.info(item)
        item = re.split('_', item)
        module_name, mthd = item[0], '_'.join(item[1:])

        class_name = module_name.capitalize() + 'Controller'

        module = __import__('controllers.%s' % module_name)
        instance = getattr(getattr(module, module_name), class_name)()

        return getattr(instance, mthd)

if __name__ == '__main__':
    setting = Setting()
    setting.initialize(os.path.join(current_dir, 'settings.cfg'))

    conn = Connection()
    conn.connect(setting.config)

    # initialize logger
    Logger.init(**setting.config.twisted.logging)

    # setup server
    handler = TodayInternalApiServiceHandler()
    processor = TodayInternalApiService.Processor(handler)
    pfactory = TBinaryProtocol.TBinaryProtocolFactory()
    server = reactor.listenTCP(setting.config.twisted.port,
                               TTwisted.ThriftServerFactory(processor, pfactory),
                               interface=setting.config.twisted.interface)

    reactor.run()


text:
<?php
  require_once('layout/layout_head.php');
  require_once('layout/layout_menu.php');
?>

                   Tulis Pesan

                <form class="form-horizontal" action="<?php echo base_url(); ?>pilihalumni/do_pesan" method="post">

                      Kirim ke
                      <input class="form-control" type="text" id="inputPenerima" name="inputPenerima" value="A001" readonly>

                      Pesan
                      <textarea class="form-control" rows="5" id="inputPesan" name="inputPesan" placeholder="Kirimkan pesan, kritik atau saran Anda :)"></textarea>

                      <button type="submit" class="btn btn-primary">Kirim Pesan</button>

                  </form>

                   Kotak Masuk

Kotak Masuk (Inbox)

                          Dari
                          Pesan
                          Waktu

                        <?php foreach ($kotakmasuk->result() as $row){ ?>

                        <tr   data-toggle="modal" data-target="#myModal<?php echo $row->IdPesan; ?>">
                          <?php echo $row->Pengirim; ?>
                          <?php echo (SUBSTR($row->Pesan, 0, 30)).'...'; ?>
                          <?php echo $row->Waktu; ?>

                        <div id="myModal<?php echo $row->IdPesan; ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Lihat Pesan Masuk

                                Dari
                                <input class="form-control" id="pengirim" type="text" value="Admin" disabled>

                                Pesan
                                  <textarea class="form-control" id="pesan" disabled><?php echo $row->Pesan; ?></textarea>

                                <button class="btn btn-large btn-block btn-primary" class="close" data-dismiss="modal">OK</button>

                        <?php } ?>

                   Kotak Keluar

Kotak Keluar (Outbox)

                          Kepada
                          Pesan
                          Waktu

                        <?php foreach ($kotakkeluar->result() as $row){ ?>

                        <tr   data-toggle="modal" data-target="#myModal<?php echo $row->IdPesan; ?>">
                          <?php echo $row->Penerima; ?>
                          <?php echo (SUBSTR($row->Pesan, 0, 30)).'...'; ?>
                          <?php echo $row->Waktu; ?>

                        <div id="myModal<?php echo $row->IdPesan; ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Lihat Pesan Keluar

                                Kepada
                                <input class="form-control" id="pengirim" type="text" value="Admin" disabled>

                                Pesan
                                  <textarea class="form-control" id="pesan" disabled><?php echo $row->Pesan; ?></textarea>

                                <button class="btn btn-large btn-block btn-primary" class="close" data-dismiss="modal">OK</button>

                        <?php } ?>

<?php require_once('layout/layout_script.php'); ?>

<?php
if ($kirim_pesan_berhasil) echo "";
?>

<?php require_once('layout/layout_footer.php'); ?>


text:
import React from 'react';

import BuildingWithPoetic from './BuildingWithPoetic';
import ProjectInfoList from './ProjectInfoList';

const poeticUrl = 'http://www.poeticsystems.com';

class ProjectItem extends React.Component {
  shouldComponentUpdate() {
    return false;
  }

  render() {
    const { project } = this.props;

    return (

{project.name}

{project.description}

          <ProjectInfoList subtitle="Languages" list={project.languages} />
          <ProjectInfoList subtitle="Tools" list={project.tools} />

            {project.url ? 'View' : <BuildingWithPoetic />}

    );
  }
}

ProjectItem.propTypes = {
  project: React.PropTypes.object.isRequired,
};

export default ProjectItem;


text:
var puntiraccoltaApp = angular.module('puntiraccolta', ['DataService']);

var puntiraccoltaCtrl = puntiraccoltaApp.controller('userCtrl', function($scope, $http, $q, DataService) {
	DataService.getProfile().then(
	function(p) {
		$scope.initData(p);
	},
	function(e) {
		console.log(e);
		$scope.error = true;
		$scope.errorMsg = e.errorMsg;
	});

	$scope.selectedMenu = "relazioni";
	$scope.selectedTab = "menu-puntiraccolta";
	$scope.language = "it";
	$scope.draft = true;
	$scope.defaultLang = "it";
	$scope.itemToDelete = "";

	$scope.edit = false;
	$scope.create = false;
	$scope.view = false;
	$scope.search = "";
	$scope.incomplete = false;

	$scope.error = false;
	$scope.errorMsg = "";

	$scope.ok = false;
	$scope.okMsg = "";

	$scope.data = null;
	$scope.status = 200;

	$scope.selectedArea = null;
	$scope.selectedCrm = null;
	$scope.selectedTipologiaPuntoRaccolta = null;
	$scope.selectedTipologiaUtenza = null;
	$scope.crmList = [];
	$scope.areaList = [];
	$scope.tipologiaUtenzaList = [];
	$scope.tipologiaPuntoRaccoltaList = [];
	$scope.puntoRaccoltaList = [];

	$scope.crmNameMap = {};
	$scope.areaNameMap = {};
	$scope.tipologiaPuntoRaccoltaNameMap = {};

	$scope.initData = function(profile) {
		$scope.profile = profile;

		var urlCrm = "api/crm/" + $scope.profile.appInfo.ownerId + "?draft=" + $scope.draft;
		$http.get(urlCrm, {headers: {'X-ACCESS-TOKEN': $scope.profile.appInfo.token}}).then(
		function (response) {
			$scope.crmList = response.data;
			$scope.crmNameMap = $scope.setCrmNameMap($scope.crmList);
		},
		function(response) {
			console.log(response.data);
			$scope.error = true;
			$scope.errorMsg = response.data.errorMsg;
		});

		var urlTipologiaUtenza = "api/tipologia/utenza/" + $scope.profile.appInfo.ownerId + "?draft=" + $scope.draft;
		$http.get(urlTipologiaUtenza, {headers: {'X-ACCESS-TOKEN': $scope.profile.appInfo.token}}).then(
		function (response) {
			$scope.tipologiaUtenzaList = response.data;
		},
		function(response) {
			console.log(response.data);
			$scope.error = true;
			$scope.errorMsg = response.data.errorMsg;
		});

		var urlTipologiaPuntoRaccolta = "api/tipologia/puntoraccolta/" + $scope.profile.appInfo.ownerId + "?draft=" + $scope.draft;
		$http.get(urlTipologiaPuntoRaccolta, {headers: {'X-ACCESS-TOKEN': $scope.profile.appInfo.token}}).then(
		function (response) {
			for (var d = 0, len = response.data.length; d < len; d += 1) {
				var element = response.data[d];
				if(element.type == "CR") {
					$scope.tipologiaPuntoRaccoltaList.push(element);
				}
			}
			$scope.tipologiaPuntoRaccoltaNameMap = $scope.setLocalNameMap($scope.tipologiaPuntoRaccoltaList);
		},
		function(response) {
			console.log(response.data);
			$scope.error = true;
			$scope.errorMsg = response.data.errorMsg;
		});

		var urlArea = "api/area/" + $scope.profile.appInfo.ownerId + "?draft=" + $scope.draft;
		$http.get(urlArea, {headers: {'X-ACCESS-TOKEN': $scope.profile.appInfo.token}}).then(
		function (response) {
			$scope.areaList = response.data;
			$scope.areaNameMap = $scope.setNameMap($scope.areaList);
		},
		function(response) {
			console.log(response.data);
			$scope.error = true;
			$scope.errorMsg = response.data.errorMsg;
		});

		var urlPuntoRaccolta = "api/puntoraccolta/" + $scope.profile.appInfo.ownerId + "?draft=" + $scope.draft;
		$http.get(urlPuntoRaccolta, {headers: {'X-ACCESS-TOKEN': $scope.profile.appInfo.token}}).then(
		function (response) {
			$scope.puntoRaccoltaList = response.data;
		},
		function(response) {
			console.log(response.data);
			$scope.error = true;
			$scope.errorMsg = response.data.errorMsg;
		});
	};

	$scope.doSearch = function(item) {
		var q = $scope.search.toLowerCase();
		var text;
		if($scope.getAreaName(item.area)) {
			text = $scope.getAreaName(item.area).toLowerCase();
			if(text.indexOf(q) != -1) {
				return true;
			}
		}
		if(item.tipologiaUtenza) {
			text = item.tipologiaUtenza.toLowerCase();
			if(text.indexOf(q) != -1) {
				return true;
			}
		}
		if(item.tipologiaPuntoRaccolta) {
			text = item.tipologiaPuntoRaccolta.toLowerCase();
			if(text.indexOf(q) != -1) {
				return true;
			}
		}
		if($scope.getCrmName(item.crm)) {
			text = $scope.getCrmName(item.crm).toLowerCase();
			if(text.indexOf(q) != -1) {
				return true;
			}
		}
		return false;
	};

	$scope.getCrmName = function(id) {
		return $scope.crmNameMap[id];
	};

	$scope.getAreaName = function(id) {
		return $scope.areaNameMap[id];
	};

	$scope.getTipologiaPuntoRaccoltaName = function(id) {
		return $scope.tipologiaPuntoRaccoltaNameMap[id];
	};

	$scope.setNameMap = function(array) {
		var map = {};
		for (var d = 0, len = array.length; d < len; d += 1) {
			var key = array[d].objectId;
			var name = array[d].nome;
			map[key] = name;
		}
		return map;
	};

	$scope.setLocalNameMap = function(array) {
		var map = {};
		for (var d = 0, len = array.length; d < len; d += 1) {
			var key = array[d].objectId;
			var name = array[d].nome[$scope.language];
			map[key] = name;
		}
		return map;
	};

	$scope.setCrmNameMap = function(array) {
		var map = {};
		for (var d = 0, len = array.length; d < len; d += 1) {
			var key = array[d].objectId;
			var name = array[d].zona + " - " + array[d].dettagliZona;
			map[key] = name;
		}
		return map;
	};
	$scope.resetError = function() {
		$scope.error = false;
		$scope.errorMsg = "";
	};

	$scope.resetOk = function() {
		$scope.ok = false;
		$scope.okMsg = "";
	};

	$scope.getModalHeaderClass = function() {
		if($scope.view) {
			return "view";
		}
		if($scope.edit) {
			return "edit";
		}
		if($scope.create) {
			return "create";
		}
	};

	$scope.setItemToDelete = function(id) {
		$scope.itemToDelete = id;
	};

	$scope.getActualName = function() {
		return "";
	};

	$scope.changeLanguage = function(language) {
		$scope.language = language;
		$scope.areaNameMap = $scope.setNameMap($scope.areaList);
		$scope.crmNameMap = $scope.setCrmNameMap($scope.crmList);
		$scope.tipologiaPuntoRaccoltaNameMap = $scope.setLocalNameMap($scope.tipologiaPuntoRaccoltaList);
	};

	$scope.resetUI = function() {
		$scope.search = "";
		$scope.incomplete = false;
		$('html,body').animate({scrollTop:0},0);
	};

	$scope.resetForm = function() {
		$scope.selectedArea = null;
		$scope.selectedCrm = null;
		$scope.selectedTipologiaPuntoRaccolta = null;
		$scope.selectedTipologiaUtenza = null;
	};

	$scope.newItem = function() {
		$scope.edit = false;
		$scope.create = true;
		$scope.incomplete = true;
		$scope.itemToDelete = "";
		$scope.language = "it";
		$scope.resetForm();
	};

	$scope.saveItem = function() {
		var element = {
			crm: '',
			area: '',
			tipologiaUtenza: '',
			tipologiaPuntoRaccolta: ''
		};
		element.crm = $scope.selectedCrm.objectId;
		element.area = $scope.selectedArea.objectId;
		element.tipologiaUtenza = $scope.selectedTipologiaUtenza.objectId;
		element.tipologiaPuntoRaccolta = $scope.selectedTipologiaPuntoRaccolta.objectId;

		var url = "api/puntoraccolta/" + $scope.profile.appInfo.ownerId + "?draft=" + $scope.draft;
		$http.post(url, element, {headers: {'X-ACCESS-TOKEN': $scope.profile.appInfo.token}}).then(
		function(response) {
			// this callback will be called asynchronously
			// when the response is available
			$scope.status = response.status;
			$scope.data = response.data;
			$scope.ok = true;
			$scope.okMsg = "Operazione eseguita con successo";
			$scope.puntoRaccoltaList.unshift($scope.data);
			$scope.resetUI();
			console.log("savePuntoRaccolta:" + response.status + " - " + response.data);
		},
		function(response) {
			// called asynchronously if an error occurs
			// or server returns response with an error status.
	  	console.log(response.data);
	  	$scope.error = true;
	  	$scope.errorMsg = response.data.errorMsg || "Request failed";
	  	$scope.status = response.status;
		});
	};

	$scope.deleteItem = function() {
		var index = $scope.findIndex($scope.puntoRaccoltaList, $scope.itemToDelete);
		if(index >= 0) {
			var element = $scope.puntoRaccoltaList[index];
			if(element != null) {
				var url = "api/puntoraccolta/" + $scope.profile.appInfo.ownerId + "/" +
				encodeURIComponent(element.objectId) + "/?draft=" + $scope.draft;
				$http.delete(url, {headers: {'X-ACCESS-TOKEN': $scope.profile.appInfo.token}}).then(
				function(response) {
					// this callback will be called asynchronously
					// when the response is available
					$scope.status = response.status;
					$scope.data = response.data;
					$scope.ok = true;
					$scope.okMsg = "Operazione eseguita con successo";
					$scope.puntoRaccoltaList.splice(index, 1);
					$scope.resetUI();
					console.log("deletePuntoRaccolta:" + response.status + " - " + response.data);
				},
				function(response) {
				  // called asynchronously if an error occurs
					// or server returns response with an error status.
			  	console.log(response.data);
			  	$scope.error = true;
			  	$scope.errorMsg = response.data.errorMsg || "Request failed";
			  	$scope.status = response.status;
				});
			}
		}
	};

	$scope.$watch('selectedArea',function() {$scope.test();}, true);
	$scope.$watch('selectedCrm',function() {$scope.test();}, true);
	$scope.$watch('selectedTipologiaPuntoRaccolta',function() {$scope.test();}, true);
	$scope.$watch('selectedTipologiaUtenza',function() {$scope.test();}, true);

	$scope.test = function() {
		if(($scope.selectedArea == null) ||
		($scope.selectedCrm == null) ||
		($scope.selectedTipologiaPuntoRaccolta == null) ||
		($scope.selectedTipologiaUtenza == null)) {
			$scope.incomplete = true;
		} else {
			$scope.incomplete = false;
		}
	};

	$scope.findByObjectId = function(array, id) {
    for (var d = 0, len = array.length; d < len; d += 1) {
      if (array[d].objectId === id) {
          return array[d];
      }
    }
    return null;
	};

	$scope.findIndex = function(array, id) {
		for (var d = 0, len = array.length; d < len; d += 1) {
			if (array[d].objectId === id) {
				return d;
			}
		}
		return -1;
	};

});


text:
<?php

declare(strict_types=1);

namespace Picodexter\ParameterEncryptionBundle\DependencyInjection\Service;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Reference;

/**
 * ReferenceFactory.
 */
class ReferenceFactory implements ReferenceFactoryInterface
{
    /**
     * @inheritDoc
     */
    public function createReference($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
    {
        return new Reference($id, $invalidBehavior);
    }
}


text:
package kfs.csv;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author pavedrim
 */
public class TimestampConvertor implements CsvStrConvertor {

    private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss.SSS");

    @Override
    public String export(Object obj) {
        if (obj == null) {
            return "";
        }
        if (obj instanceof Date) {
            return sdf.format((Date) obj);
        }
        throw new CsvException("Cannot convert " + obj.getClass().getSimpleName());
    }

}


text:
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User, Group
from django.db import models
from mezzanine.pages.models import Page, RichText,Displayable
from mezzanine.core.fields import FileField, RichTextField
from mezzanine.core.models import Ownable
from mezzanine.generic.models import  Orderable
from mezzanine.generic.fields import KeywordsField
from hs_core.models import AbstractResource
from django.db.models.signals import  post_save
from datetime import date
from uuid import uuid4
from django.db.models.signals import post_save,pre_save,post_init
from django.contrib.auth.signals import user_logged_in
from django.dispatch import receiver
from django.core.exceptions import ObjectDoesNotExist,ValidationError
from django.core.urlresolvers import reverse
from django.core.exceptions import NON_FIELD_ERRORS

from party import Party
from party_types import PartyEmailModel,\
    PartyGeolocation,PartyPhoneModel,\
    PartyLocationModel,ExternalIdentifierCodeList,\
    NameAliasType,AddressCodeList,PhoneCodeList,EmailCodeList
from person import Person

__author__ = 'valentin'

#=======================================================================================
# ORGANIZATION
# ======================================================================================
# make consistent with CUAHSI

class OrganizationCodeList(models.Model):
    # these are classes, so changing the model means you change this
    code = models.CharField(primary_key=True,verbose_name="Acronym for Organization Type", max_length=24, blank=False)
    name = models.CharField(verbose_name="Brief Name or Organization Type",max_length=255, blank=False)
    order = models.IntegerField(verbose_name="Optional Order", blank=True)
    url = models.CharField(verbose_name="Optional Url pointing to provider",max_length=255, blank=True)

    def __unicode__(self):
        return self.name

    class Meta:
        app_label = 'hs_party'
    pass

class Organization(Displayable,Party):
    ORG_TYPES_CHOICES = (
    ("commercial", "Commercial/Professional")
    , ("university","University")
    , ("college", "College")
    , ("gov", "Government Organization")
    , ("nonprofit", "Non-profit Organization")
    , ("k12", "School  Kindergarten to 12th Grade")
    , ("cc", "Community College ")
    , ("other", "Other")
    , ("Unspecified", "Unspecified")
    )
    logoUrl = models.ImageField(blank=True, upload_to='orgLogos')
    #smallLogoUrl = models.ImageField()
    parentOrganization = models.ForeignKey('self', null=True,blank=True)
    organizationType = models.ForeignKey(OrganizationCodeList,)
    # externalIdentifiers from ExternalOrgIdentifiers
    specialities = KeywordsField()
    persons = models.ManyToManyField(Person, verbose_name="Organizations",
                                           through="OrganizationAssociation", blank=True, null=True,
                                           related_name="organizations",symmetrical=False
    ,)

    #businessAddress = models.CharField(max_length='100', blank=True, verbose_name="business Address", help_text="business Mailing or Street, if known")
    #businessTelephone = models.CharField(max_length='30', blank=True, verbose_name="business Telephone",help_text="business Telephone, if known")

    def get_businessAddress(self):
        paddr = self.mail_addresses.filter(address_type='primary')
        if (paddr):
            return paddr.first().address
        else:
            return None

    def set_businessAddress(self, value):
        paddr = self.mail_addresses.filter(address_type='primary')
        if (paddr):
            firstOne = paddr.first()
            firstOne.address = value
            firstOne.save()
        else:
            primaryType = AddressCodeList.objects.get(code='primary')
            address =  OrganizationLocation(address_type=primaryType,address=value)
            self.mail_addresses.add(address)
            self.save()

    businessAddress = property(get_businessAddress,set_businessAddress)

    def get_businessTelephone(self):
        phone1 = self.phone_numbers.filter(phone_type='primary')
        if (phone1):
            return phone1.first().phone_number
        else:
            return None

    def set_businessTelephone(self, value):
        phone1 = self.phone_numbers.filter(phone_type='primary')
        if (phone1):
            firstOne = phone1.first()
            firstOne.phone_number = value
            firstOne.save()
        else:
            primaryType = PhoneCodeList.objects.get(code='primary')
            phone =  OrganizationPhone(phone_type=primaryType,phone_number=value)
            self.phone_numbers.add(phone)
            self.save()

    businessTelephone = property(get_businessTelephone,set_businessTelephone)

    def get_businessEmail(self):
        paddr = self.email_addresses.filter(email_type='primary')
        if (paddr):
            return paddr.first().email
        else:
            return None

    def set_businessEmail(self, value):
        paddr = self.email_addresses.filter(email_type='primary')
        if (paddr):
            firstOne = paddr.first()
            firstOne.email = value
            firstOne.save()
        else:
            primaryType = EmailCodeList.objects.get(code='primary')
            address =  OrganizationEmail(email_type=primaryType,email=value)
            self.email_addresses.add(address)
            self.save()

    businessEmail = property(get_businessEmail,set_businessEmail)

    def get_absolute_url(self):
        return reverse('organization_detail', kwargs={'pk': self.pk})

    def __init__(self, *args, **kwargs):
        super(Organization, self).__init__(*args, **kwargs)
        nameField = self._meta.get_field('name')
        nameField.verbose_name="Organization Name"
        nameField.help_text="Organization Name"
        notesField = self._meta.get_field('notes')
        notesField.verbose_name="Description"
        notesField.help_text="Brief Description of organizaiton"
        urlField = self._meta.get_field('url')
        urlField.verbose_name="Web Page for Organization"
        urlField.help_text="Organizaiton web page"

    def __unicode__(self):
        return unicode(self.name)

    class Meta:
        app_label = 'hs_party'
    pass

class OrganizationEmail(PartyEmailModel):
    organization = models.ForeignKey(to=Organization, related_name="email_addresses", blank=True,null=True)

    class Meta:
        app_label = 'hs_party'

    def validate_unique(self, exclude=None):
        try:
            dupes = OrganizationEmail.objects.filter(organization=self.organization,email_type='primary')

            if (dupes.count() > 1):
                raise ValidationError(
                     {
                            NON_FIELD_ERRORS:
                            ("Only one primary type allowed ",)
                        }
                )
            else:
                return
        except ObjectDoesNotExist:
            return

    def save(self, *args, **kwargs):
        self.validate_unique()
        super(OrganizationEmail,self).save( *args, **kwargs)

    pass

class OrganizationLocation(PartyLocationModel):
    organization = models.ForeignKey(to=Organization, related_name="mail_addresses", blank=True,null=True)

    class Meta:
        app_label = 'hs_party'

    def validate_unique(self, exclude=None):
        try:
            dupes = OrganizationLocation.objects.filter(organization=self.organization,address_type='primary')

            if (dupes.count() > 1):
                raise ValidationError(
                     {
                            NON_FIELD_ERRORS:
                            ("Only one primary type allowed ",)
                        }
                )
            else:
                return
        except ObjectDoesNotExist:
            return

    def save(self, *args, **kwargs):
        self.validate_unique()
        super(OrganizationLocation,self).save( *args, **kwargs)

    pass

class OrganizationPhone(PartyPhoneModel):
    organization = models.ForeignKey(to=Organization, related_name="phone_numbers", blank=True,null=True)

    class Meta:
        app_label = 'hs_party'

    def validate_unique(self, exclude=None):
        try:
            dupes = OrganizationPhone.objects.filter(organization=self.organization,phone_type='primary')

            if (dupes.count() > 1):
                raise ValidationError(
                     {
                            NON_FIELD_ERRORS:
                            ("Only one primary type allowed ",)
                        }
                )
            else:
                return
        except ObjectDoesNotExist:
            return

    def save(self, *args, **kwargs):
        self.validate_unique()
        super(OrganizationPhone,self).save( *args, **kwargs)
    pass

class OrganizationName(NameAliasType):
    organization = models.ForeignKey(to=Organization, related_name="alternate_names", blank=True,null=True)

    class Meta:
        app_label = 'hs_party'
    pass

class ExternalOrgIdentifier(models.Model):
    organization = models.ForeignKey(to=Organization, related_name='externalIdentifiers')
    IDENTIFIER_CHOICE = (
                         ("LOC", "Library of Congress")
                         , ("NSF", "National Science Foundation")
                         , ("linked","linked Data URL")
                         , ("twitter", "twitterHandle")
                         , ("ProjectPage", "page for project")
                         , ("other", "other")
    )
    identifierName = models.ForeignKey(ExternalIdentifierCodeList, verbose_name="User Identities",
                                      help_text="User identities from external sites",max_length='10')
    otherName = models.CharField(verbose_name="If other is selected, type of identifier", blank=True,max_length='255')
    identifierCode = models.CharField(verbose_name="Username or Identifier for site",max_length='255')
    createdDate = models.DateField(auto_now_add=True)
    # validation needed. if identifierName =='other' then otherName must be populated.

    class Meta:
        app_label = 'hs_party'


text:
module DTK; class Attribute
  class Pattern; class Type
    module CommonNodeComponentLevel
      def attribute_name
        attribute_stack()[:attribute][:display_name]
      end

      def attribute_id
        attribute_stack()[:attribute].id()
      end

      def component_instance
        attribute_stack()[:component]
      end

      def component_instances
        @attribute_stacks.map { |as| as[:component] }.compact
      end

      def node
        attribute_stack()[:node]
      end

      def attribute_idhs
        @attribute_stacks.map { |r| r[:attribute].id_handle() }
      end

      def node_group_member_attribute_idhs
        ret = []
        @attribute_stacks.each do |r|
          if r[:node].is_node_group?()
            ret += attribute_idhs_on_node_group(r[:attribute])
          end
        end
        ret
      end

      private

      def create_attributes(attr_parents)
        attribute_idhs = []
        attr_properties = attribute_properties().inject({}) { |h, (k, v)| h.merge(k.to_s => v) }
        field_def =
          { 'display_name' => pattern_attribute_name() }.merge(attr_properties)
        attr_parents.each do |attr_parent|
          attribute_idhs += Attribute.create_or_modify_field_def(attr_parent, field_def)
        end

        return attribute_idhs if attribute_idhs.empty?

        # TODO: can make more efficient by having create_or_modify_field_def return object with cols, rather than id_handles
        sp_hash = {
          cols: [:id, :group_id, :display_name, :description, :component_component_id, :data_type, :semantic_type, :required, :dynamic, :external_ref, :semantic_data_type],
          filter: [:oneof, :id, attribute_idhs.map(&:get_id)]
        }
        attr_mh = attribute_idhs.first.createMH()
        Model.get_objs(attr_mh, sp_hash)
      end

      def attribute_idhs_on_node_group(node_group_attribute)
        sp_hash = {
          cols: [:id, :display_name, :group_id],
          filter: [:eq, :ancestor_id, node_group_attribute.id()]
        }
        attr_mh = node_group_attribute.model_handle()
        Model.get_objs(attr_mh, sp_hash).map(&:id_handle)
      end

      def pattern_attribute_name
        first_name_in_fragment(pattern_attribute_fragment())
      end

      def first_name_in_fragment(fragment)
        fragment =~ NameInFragmentRegexp
        Regexp.last_match(1)
      end
      NameInFragmentRegexp = /[^<]*<([^>]*)>/
    end
  end; end
end; end


text:
html.loading * {
  -webkit-transition-duration: 0 !important;
}

html:not(.focus-outline-visible)
:enabled:focus:-webkit-any(input[type='checkbox'], input[type='radio']) {
  /* Cancel border-color for :focus specified in widgets.css. */
  border-color: rgba(0, 0, 0, 0.25);
}

.no-scroll {
  overflow-y: hidden;
}

/* Developer mode */

#dev-controls {
  -webkit-margin-end: 20px;
  -webkit-transition: padding 100ms, height 100ms, opacity 100ms;
  border-bottom: 1px solid #eee;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

#dev-controls .buttons-container {
  -webkit-padding-end: 3px;
  -webkit-padding-start: 4px;
}

#dev-controls .buttons-container {
  display: -webkit-box;
  padding-top: 13px;
}

#dev-controls button {
  white-space: nowrap;
}

#apps-developer-tools-promo {
  -webkit-margin-before: 15px;
  -webkit-padding-before: 5px;
  -webkit-padding-end: 3px;
  align-items: center;
  border-top: 1px solid #eee;
  display: flex;
  font-size: 13px;
}

#apps-developer-tools-promo img {
  content: url(apps_developer_tools_promo_48.png);
}

#apps-developer-tools-promo-text {
  -webkit-margin-start: 5px;
}

#apps-developer-tools-promo-close-wrapper {
  display: flex;
  flex-grow: 1;
  justify-content: flex-end;
}

#apps-developer-tools-promo .close-button {
  background: url(chrome://theme/IDR_CLOSE_DIALOG) no-repeat center center;
  border: 0;
  height: 14px;
  width: 14px;
  z-index: 1;
}

#apps-developer-tools-promo .close-button:hover {
  background-image: url(chrome://theme/IDR_CLOSE_DIALOG_H);
}

#apps-developer-tools-promo .close-button:active {
  background-image: url(chrome://theme/IDR_CLOSE_DIALOG_P);
}

#extension-settings.dev-mode #dev-controls {
  -webkit-transition-duration: 250ms;
  height: 45px;
  opacity: 1;
  padding-bottom: 7px;
}

#extension-settings.dev-mode.adt-promo #dev-controls {
  height: 105px;  /* Allow more height for the Apps Developer Tools promo. */
}

#dev-controls-spacer {
  -webkit-box-flex: 1;
}

#dev-toggle {
  margin-top: 0;
  text-align: end;
}

.extension-code {
  border: 1px solid #ccc;
  display: flex;
  font-family: monospace;
  overflow: auto;
  white-space: pre;
}

.extension-code > * {
  padding: 3px;
}

.extension-code-line-numbers {
  align-self: flex-start;
  background-color: rgba(240, 240, 240, 1);
  border-right: 1px solid #ccc;
  color: rgba(128, 128, 128, 1);
  flex-shrink: 0;
  text-align: right;
}

#extension-settings:not(.dev-mode) .developer-extras {
  display: none;
}

.developer-extras > div,
.permanent-warnings > div {
  margin: 5px 0;
}

#extension-settings #page-header {
  /* These values match the .page values. */
  -webkit-margin-end: 24px;
  min-width: 576px;
}

/* Contents */

#extension-settings {
  max-width: 738px;
}

#no-extensions-message {
  font-weight: bold;
}

#suggest-gallery {
  -webkit-padding-start: 10px;
}

#footer-section {
  background: url(chrome://theme/IDR_WEBSTORE_ICON_32) no-repeat left center;
  background-size: 32px 32px;
  font-size: 1.25em;
}

html[dir=rtl] #footer-section {
  background: url(chrome://theme/IDR_WEBSTORE_ICON_32) no-repeat right center;
}

#footer-section > a {
  -webkit-margin-start: 42px;
  line-height: 32px;
}

.empty-extension-list {
  height: 3em;
}

.loading #no-extensions,
.loading #footer-section,
#extension-settings-list:not(.empty-extension-list) ~ #no-extensions,
.empty-extension-list ~ #footer-section {
  display: none;
}

.extension-list-item-wrapper {
  margin: 23px 0;
}

.extension-list-item {
  background-repeat: no-repeat;
  display: -webkit-box;
  min-height: 48px;
}

html[dir='rtl'] .extension-list-item {
  background-position: right;
}

.extension-title {
  -webkit-padding-end: 20px;
  color: rgb(48, 57, 66);
  font-size: 14px;
  font-weight: 500;
}

.inactive-extension .extension-title {
  color: inherit;
}

.extension-version {
  -webkit-padding-end: 7px;
  font-size: 13px;
  font-weight: 400;
}

.extension-description {
  -webkit-padding-end: 5px;
  font-size: 13px;
  margin: 5px 0;
  white-space: normal;
}

.extension-details {
  -webkit-box-flex: 1;
  -webkit-padding-start: 55px;
}

.extension-description,
.extension-list-item-wrapper.inactive-extension .extension-details,
.location-text,
.blacklist-text,
.enable-checkbox input:disabled + .enable-checkbox-text {
  color: rgb(151, 156, 160);
}

.enable-controls {
  /* Matches right: position of dev controls toggle. */
  -webkit-margin-end: 20px;
  position: relative;
}

.enable-checkbox-text {
  /* Matches width of trash. */
  -webkit-margin-end: 30px;
}

.checkbox {
  display: inline-block;
}

.enabled-text {
  font-weight: bold;
}

.extension-list-item-wrapper.inactive-extension .enabled-text,
.extension-list-item-wrapper:not(.inactive-extension) .enable-text,
.extension-list-item-wrapper.inactive-extension .optional-controls,
.extension-list-item-wrapper.inactive-extension .butter-bar {
  display: none;
}

.load-path > span {
  word-wrap: break-word;
}

.terminated-reload-link {
  -webkit-margin-end: 2.5em;
  padding-top: 7px;
}

.extension-list-item a {
  -webkit-margin-start: 0.5em;
  display: inline-block;
}

.install-warnings a {
  -webkit-margin-start: 0;
}

.butter-bar,
.install-warnings,
.extension-warnings {
  border-radius: 3px;
  margin-top: 5px;
  padding: 2px 5px;
}

.butter-bar {
  background: rgb(255, 242, 153);
}

.install-warnings,
.extension-warnings {
  background: pink;
}

.install-warnings ul,
.extension-warnings ul {
  margin: 0;
}

.error-collection-control {
  -webkit-margin-start: 5px;
  display: none;
}

#extension-settings.dev-mode .error-collection-control {
  display: initial;
}

#font-measuring-div {
  /* Remove from the flow and hide. */
  position: absolute;
  visibility: hidden;
}

.extension-commands-config {
  float: right;
}

html[dir=rtl] .extension-commands-config {
  float: left;
}

/* Overlays */

#overlay {
  z-index: 5;
}

#overlay .page:not(.showing) {
  display: none;
}

#drop-target-overlay {
  color: rgb(48, 57, 66);
  font-size: 18px;
  text-align: center;
}

#drop-target-overlay div {
  margin: 1em;
}

.location-text,
.blacklist-text {
  display: block;
  width: 100px;
}

/* Trash */

#extension-settings .trash {
  -webkit-transition: opacity 200ms;
  height: 22px;
  opacity: 0.8;
  position: absolute;
  right: 0;
  top: 3px;
  vertical-align: middle;
}

html[dir='rtl'] #extension-settings .trash {
  left: 0;
  right: auto;
}

.extension-list-item:not(:hover) .trash:not(:focus) {
  opacity: 0;
}

.extension-list-item-wrapper.may-not-remove .trash {
  visibility: hidden;
}

.extension-highlight {
  background: rgb(238, 238, 238);
  background-position: auto;
  background-repeat: auto;
  border-radius: 3px;
  padding: 5px 0 5px 5px;
}

.may-not-modify .optional-controls .optional-controls-disableable {
  display: none;
}

/* Supervised users */

.page:not(.profile-is-supervised) .profile-is-supervised-banner,
.profile-is-supervised .more-extensions-link {
  display: none;
}

.profile-is-supervised-banner .page-banner-text {
  background-image: url(chrome://theme/IDR_WARNING);
}

/* Sideload Wipeout */

.sideload-wipeout-learn-more {
  text-decoration: none;
}

.sideload-wipeout-banner .page-banner-text {
  -webkit-padding-start: 8px;
  background-image: none;
}


text:
namespace ProgrammingLanguage {
    using namespace clang::ast_matchers;

    //match a simple funcion including method
    extern DeclarationMatcher funcMatcherPL;
    extern int countRef;

    class ParmPrinter : public MatchFinder::MatchCallback {
    public:
        virtual void run(const MatchFinder::MatchResult &Result);
    };
}

#endif


text:
// ReSharper disable PartialTypeWithSinglePart
namespace Apache.Ignite.Core.Impl.Unmanaged.Jni
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Security;
    using System.Threading;
    using Apache.Ignite.Core.Common;

    /// <summary>
    /// JVM holder. Should exist once per domain.
    /// </summary>
    [SuppressUnmanagedCodeSecurity]
    internal sealed unsafe partial class Jvm
    {
        /** */
        // ReSharper disable once InconsistentNaming
        private const int JNI_VERSION_1_8 = 0x00010008;

        /** */
        // ReSharper disable once InconsistentNaming
        private const int JNI_VERSION_9 = 0x00090000;

        /** Options to enable startup on Java 9. */
        public static readonly string[] Java9Options =
        {
            "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
            "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",
            "--add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED",
            "--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED",
            "--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED",
            "--illegal-access=permit"
        };

        /** */
        private readonly IntPtr _jvmPtr;

        /** */
        private readonly JvmDelegates.AttachCurrentThread _attachCurrentThread;

        /** */
        private readonly MethodId _methodId;

        /** Callbacks. */
        private readonly Callbacks _callbacks;

        /** Thread exit callback id. */
        private readonly int _threadExitCallbackId;

        /** Static instance */
        private static volatile Jvm _instance;

        /** Sync. */
        private static readonly object SyncRoot = new object();

        /** Console writer. */
        private static readonly ConsoleWriter ConsoleWriter = new ConsoleWriter();

        /** Env for current thread. */
        [ThreadStatic] private static Env _env;

        /** Console writer flag. */
        private int _isConsoleWriterEnabled;

        /// <summary>
        /// Initializes a new instance of the <see cref="_instance"/> class.
        /// </summary>
        private Jvm(IntPtr jvmPtr)
        {
            Debug.Assert(jvmPtr != IntPtr.Zero);

            _jvmPtr = jvmPtr;

            var funcPtr = (JvmInterface**)jvmPtr;
            var func = **funcPtr;
            GetDelegate(func.AttachCurrentThread, out _attachCurrentThread);

            // JVM is a singleton, so this is one-time subscription.
            // This is a shortcut - we pass DetachCurrentThread pointer directly as a thread exit callback,
            // because signatures happen to match exactly.
            _threadExitCallbackId = UnmanagedThread.SetThreadExitCallback(func.DetachCurrentThread);

            var env = AttachCurrentThread();

            _methodId = new MethodId(env);

            // Keep AppDomain check here to avoid JITting GetCallbacksFromDefaultDomain method on .NET Core.
            _callbacks = AppDomain.CurrentDomain.IsDefaultAppDomain()
                ? new Callbacks(env, this)
                : GetCallbacksFromDefaultDomain();
        }

        /// <summary>
        /// Gets the callbacks.
        /// </summary>
        [MethodImpl(MethodImplOptions.NoInlining)]
        private static Callbacks GetCallbacksFromDefaultDomain()
        {
            return GetCallbacksFromDefaultDomainImpl();
        }

        /// <summary>
        /// Gets or creates the JVM.
        /// </summary>
        /// <param name="options">JVM options.</param>
        public static Jvm GetOrCreate(IList<string> options)
        {
            lock (SyncRoot)
            {
                return _instance ?? (_instance = new Jvm(GetJvmPtr(options)));
            }
        }

        /// <summary>
        /// Gets the JVM.
        /// </summary>
        // ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Global
        public static Jvm Get(bool ignoreMissing = false)
        {
            var res = _instance;

            if (res == null && !ignoreMissing)
            {
                throw new IgniteException("JVM has not been created.");
            }

            return res;
        }

        /// <summary>
        /// Gets the method IDs.
        /// </summary>
        public MethodId MethodId
        {
            get { return _methodId; }
        }

        /// <summary>
        /// Attaches current thread to the JVM and returns JNIEnv.
        /// </summary>
        public Env AttachCurrentThread()
        {
            if (_env == null)
            {
                IntPtr envPtr;
                var res = _attachCurrentThread(_jvmPtr, out envPtr, IntPtr.Zero);

                if (res != JniResult.Success)
                {
                    throw new IgniteException("AttachCurrentThread failed: " + res);
                }

                _env = new Env(envPtr, this);
                UnmanagedThread.EnableCurrentThreadExitEvent(_threadExitCallbackId, _jvmPtr);
            }

            return _env;
        }

        /// <summary>
        /// Attaches current thread to the JVM using known envPtr and returns JNIEnv.
        /// </summary>
        public Env AttachCurrentThread(IntPtr envPtr)
        {
            if (_env == null || _env.EnvPtr != envPtr)
            {
                _env = new Env(envPtr, this);
            }

            return _env;
        }

        /// <summary>
        /// Registers the callbacks.
        /// </summary>
        public void RegisterCallbacks(UnmanagedCallbacks cbs)
        {
            var id = _callbacks.RegisterHandlers(cbs);
            cbs.SetContext(id);
        }

        /// <summary>
        /// Releases the callbacks.
        /// </summary>
        public void ReleaseCallbacks(long igniteId)
        {
            _callbacks.ReleaseHandlers(igniteId);
        }

        /// <summary>
        /// Enables the Java console output propagation.
        /// </summary>
        public void EnableJavaConsoleWriter()
        {
            if (Interlocked.CompareExchange(ref _isConsoleWriterEnabled, 1, 0) == 0)
            {
                var writerId = _callbacks.RegisterConsoleWriter(ConsoleWriter);
                AppDomain.CurrentDomain.DomainUnload += (s, a) => _callbacks.ReleaseConsoleWriter(writerId);
            }
        }

        /// <summary>
        /// Gets the JVM pointer.
        /// </summary>
        private static IntPtr GetJvmPtr(IList<string> options)
        {
            IntPtr jvm;
            int existingJvmCount;

            // Use existing JVM if present.
            var res = JvmDll.Instance.GetCreatedJvms(out jvm, 1, out existingJvmCount);
            if (res != JniResult.Success)
            {
                throw new IgniteException("JNI_GetCreatedJavaVMs failed: " + res);
            }

            if (existingJvmCount > 0)
            {
                return jvm;
            }

            return CreateJvm(options);
        }

        /// <summary>
        /// Determines whether we are on Java 9.
        /// </summary>
        public static bool IsJava9()
        {
            var args = new JvmInitArgs
            {
                version = JNI_VERSION_9
            };

            // Returns error on Java 8 and lower.
            var res = JvmDll.Instance.GetDefaultJvmInitArgs(&args);
            return res == JniResult.Success;
        }

        /// <summary>
        /// Creates the JVM.
        /// </summary>
        private static IntPtr CreateJvm(IList<string> options)
        {
            if (IsJava9())
            {
                options = options == null
                    ? Java9Options.ToList()
                    : new List<string>(options.Concat(Java9Options));
            }

            var args = new JvmInitArgs
            {
                version = JNI_VERSION_1_8,
                nOptions = options.Count
            };

            var opts = GetJvmOptions(options);

            try
            {
                JniResult res;
                IntPtr jvm;

                fixed (JvmOption* optPtr = &opts[0])
                {
                    args.options = optPtr;

                    IntPtr unused;
                    res = JvmDll.Instance.CreateJvm(out jvm, out unused, &args);
                }

                if (res != JniResult.Success)
                {
                    throw new IgniteException("JNI_CreateJavaVM failed: " + res);
                }

                return jvm;
            }
            finally
            {
                foreach (var opt in opts)
                {
                    Marshal.FreeHGlobal(opt.optionString);
                }
            }
        }

        /// <summary>
        /// Gets the JVM options.
        /// </summary>
        private static JvmOption[] GetJvmOptions(IList<string> options)
        {
            var opt = new JvmOption[options.Count];

            for (var i = 0; i < options.Count; i++)
            {
                opt[i].optionString = Marshal.StringToHGlobalAnsi(options[i]);
            }

            return opt;
        }

        /// <summary>
        /// Gets the delegate.
        /// </summary>
        private static void GetDelegate<T>(IntPtr ptr, out T del)
        {
            del = (T) (object) Marshal.GetDelegateForFunctionPointer(ptr, typeof(T));
        }
    }
}


text:
package org.bremersee.security.access;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.validation.constraints.NotNull;
import org.bremersee.common.model.AccessControlList;
import org.bremersee.security.core.AuthorityConstants;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;

/**
 * The access control list builder.
 *
 * @author Christian Bremer
 */
@Validated
public interface AclBuilder {

  /**
   * Instantiates a new access control list builder.
   *
   * @return the acl builder
   */
  static AclBuilder builder() {
    return new Impl();
  }

  /**
   * Reset acl builder.
   *
   * @return the acl builder
   */
  AclBuilder reset();

  /**
   * Add default access control entries for the given permissions.
   *
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder defaults(@Nullable String... permissions);

  /**
   * From access control list DTO.
   *
   * @param acl the acl dto
   * @return the acl builder
   */
  AclBuilder from(@Nullable AccessControlList acl);

  /**
   * From acl (entity).
   *
   * @param acl the acl (entity)
   * @return the acl builder
   */
  default AclBuilder from(@Nullable Acl<? extends Ace> acl) {
    return Optional.ofNullable(acl)
        .map(a -> from(a.getOwner(), a.entryMap()))
        .orElse(this);
  }

  /**
   * From acl (entity) values.
   *
   * @param owner the owner
   * @param map the acl (entity) entry map
   * @return the acl builder
   */
  AclBuilder from(String owner, Map<String, ? extends Ace> map);

  /**
   * Sets owner.
   *
   * @param owner the owner
   * @return the acl builder
   */
  AclBuilder owner(@Nullable String owner);

  /**
   * Sets guest.
   *
   * @param isPublic is public
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder guest(@Nullable Boolean isPublic, @Nullable String... permissions);

  /**
   * Adds user.
   *
   * @param user the user
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder addUser(@Nullable String user, @Nullable String... permissions);

  /**
   * Adds role.
   *
   * @param role the role
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder addRole(@Nullable String role, @Nullable String... permissions);

  /**
   * Adds group.
   *
   * @param group the group
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder addGroup(@Nullable String group, @Nullable String... permissions);

  /**
   * Removes user.
   *
   * @param user the user
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder removeUser(@Nullable String user, @Nullable String... permissions);

  /**
   * Removes role.
   *
   * @param role the role
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder removeRole(@Nullable String role, @Nullable String... permissions);

  /**
   * Removes group.
   *
   * @param group the group
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder removeGroup(@Nullable String group, @Nullable String... permissions);

  /**
   * Ensures admin access.
   *
   * @return the acl builder
   */
  default AclBuilder ensureAdminAccess() {
    return ensureAdminAccess(AuthorityConstants.ADMIN_ROLE_NAME);
  }

  /**
   * Adds admin access.
   *
   * @param adminRole the admin role
   * @param permissions the permissions
   * @return the acl builder
   */
  default AclBuilder ensureAdminAccess(
      @Nullable String adminRole,
      @Nullable String... permissions) {

    return ensureAdminAccess(
        StringUtils.hasText(adminRole) ? Collections.singleton(adminRole) : null, permissions);
  }

  /**
   * Adds admin access.
   *
   * @param adminRoles the admin roles
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder ensureAdminAccess(
      @Nullable Collection<String> adminRoles,
      @Nullable String... permissions);

  /**
   * Removes admin access.
   *
   * @return the acl builder
   */
  default AclBuilder removeAdminAccess() {
    return removeAdminAccess(AuthorityConstants.ADMIN_ROLE_NAME);
  }

  /**
   * Removes admin access.
   *
   * @param adminRole the admin role
   * @param permissions the permissions
   * @return the acl builder
   */
  default AclBuilder removeAdminAccess(
      @Nullable String adminRole,
      @Nullable String... permissions) {

    return removeAdminAccess(
        StringUtils.hasText(adminRole) ? Collections.singleton(adminRole) : null, permissions);
  }

  /**
   * Removes admin access.
   *
   * @param adminRoles the admin roles
   * @param permissions the permissions
   * @return the acl builder
   */
  AclBuilder removeAdminAccess(
      @Nullable Collection<String> adminRoles,
      @Nullable String... permissions);

  /**
   * Build acl.
   *
   * @param <T> the type of the acl
   * @param factory the factory
   * @return the acl
   */
  <T> T build(@NotNull AclFactory<T> factory);

  /**
   * Build acl.
   *
   * @return the acl
   */
  default Acl<? extends Ace> buildAcl() {
    return build((o, e) -> new AclImpl(o, new HashMap<>(e)));
  }

  /**
   * Build access control list.
   *
   * @return the access control list
   */
  default AccessControlList buildAccessControlList() {
    return build(AclFactory.dtoFactory());
  }

  /**
   * The default access control list builder implementation.
   */
  class Impl implements AclBuilder {

    private String owner;

    private Map<String, Ace> entries = new HashMap<>();

    @Override
    public AclBuilder reset() {
      this.owner = null;
      this.entries = new HashMap<>();
      return this;
    }

    @Override
    public AclBuilder defaults(final String... permissions) {
      if (permissions != null) {
        Arrays.stream(permissions).forEach(permission -> {
          if (!entries.containsKey(permission)) {
            entries.put(permission.toLowerCase(), new AceImpl());
          }
        });
      }
      return this;
    }

    @Override
    public AclBuilder from(final AccessControlList acl) {
      if (acl != null) {
        this.owner = acl.getOwner();
        if (acl.getEntries() != null) {
          acl.getEntries()
              .stream()
              .filter(Objects::nonNull)
              .filter(accessControlEntry -> StringUtils.hasText(accessControlEntry.getPermission()))
              .forEach(accessControlEntry -> {
                guest(accessControlEntry.getGuest(), accessControlEntry.getPermission());
                if (accessControlEntry.getGroups() != null) {
                  accessControlEntry
                      .getGroups()
                      .forEach(group -> addGroup(
                          group, accessControlEntry.getPermission().toLowerCase()));
                }
                if (accessControlEntry.getRoles() != null) {
                  accessControlEntry
                      .getRoles()
                      .forEach(role -> addRole(
                          role, accessControlEntry.getPermission().toLowerCase()));
                }
                if (accessControlEntry.getUsers() != null) {
                  accessControlEntry
                      .getUsers()
                      .forEach(user -> addUser(
                          user, accessControlEntry.getPermission().toLowerCase()));
                }
              });
        }
      }
      return this;
    }

    @Override
    public AclBuilder from(String owner, Map<String, ? extends Ace> map) {
      this.owner = owner;
      if (map != null) {
        map.entrySet()
            .stream()
            .filter(Objects::nonNull)
            .filter(entry -> StringUtils.hasText(entry.getKey()))
            .filter(entry -> entry.getValue() != null)
            .forEach(entry -> {
              final String permission = entry.getKey().toLowerCase();
              final Ace ace = entry.getValue();
              guest(ace.isGuest(), permission);
              ace.getGroups().forEach(group -> addGroup(group, permission));
              ace.getRoles().forEach(role -> addRole(role, permission));
              ace.getUsers().forEach(user -> addUser(user, permission));
            });
      }
      return this;
    }

    @Override
    public AclBuilder owner(final String owner) {
      this.owner = owner;
      return this;
    }

    @Override
    public AclBuilder guest(final Boolean isPublic, final String... permissions) {
      if (permissions != null) {
        final boolean guest = Boolean.TRUE.equals(isPublic);
        if (guest) {
          Arrays.stream(permissions)
              .filter(StringUtils::hasText)
              .map(String::toLowerCase)
              .forEach(permission -> entries
                  .computeIfAbsent(permission, p -> new AceImpl())
                  .setGuest(true));
        } else {
          Arrays.stream(permissions)
              .filter(StringUtils::hasText)
              .map(String::toLowerCase)
              .forEach(permission -> entries.computeIfPresent(permission,
                  (p, mongoAccessControlEntry) -> {
                    mongoAccessControlEntry.setGuest(false);
                    return mongoAccessControlEntry;
                  }));
        }
      }
      return this;
    }

    @Override
    public AclBuilder addUser(final String user, final String... permissions) {
      if (StringUtils.hasText(user) && permissions != null) {
        Arrays.stream(permissions)
            .filter(StringUtils::hasText)
            .map(String::toLowerCase)
            .forEach(permission -> entries
                .computeIfAbsent(permission, p -> new AceImpl())
                .getUsers()
                .add(user));
      }
      return this;
    }

    @Override
    public AclBuilder addRole(final String role, final String... permissions) {
      if (StringUtils.hasText(role) && permissions != null) {
        Arrays.stream(permissions)
            .filter(StringUtils::hasText)
            .map(String::toLowerCase)
            .forEach(permission -> entries
                .computeIfAbsent(permission, p -> new AceImpl())
                .getRoles()
                .add(role));
      }
      return this;
    }

    @Override
    public AclBuilder addGroup(final String group, final String... permissions) {
      if (StringUtils.hasText(group) && permissions != null) {
        Arrays.stream(permissions)
            .filter(StringUtils::hasText)
            .map(String::toLowerCase)
            .forEach(permission -> entries
                .computeIfAbsent(permission, p -> new AceImpl())
                .getGroups()
                .add(group));
      }
      return this;
    }

    @Override
    public AclBuilder removeUser(final String user, final String... permissions) {
      if (StringUtils.hasText(user) && permissions != null) {
        Arrays.stream(permissions)
            .filter(StringUtils::hasText)
            .map(String::toLowerCase)
            .forEach(permission -> entries.computeIfPresent(permission,
                (p, mongoAccessControlEntry) -> {
                  mongoAccessControlEntry.getUsers().remove(user);
                  return mongoAccessControlEntry;
                }));
      }
      return this;
    }

    @Override
    public AclBuilder removeRole(final String role, final String... permissions) {
      if (StringUtils.hasText(role) && permissions != null) {
        Arrays.stream(permissions)
            .filter(StringUtils::hasText)
            .map(String::toLowerCase)
            .forEach(permission -> entries.computeIfPresent(permission,
                (p, mongoAccessControlEntry) -> {
                  mongoAccessControlEntry.getRoles().remove(role);
                  return mongoAccessControlEntry;
                }));
      }
      return this;
    }

    @Override
    public AclBuilder removeGroup(final String group, final String... permissions) {
      if (StringUtils.hasText(group) && permissions != null) {
        Arrays.stream(permissions)
            .filter(StringUtils::hasText)
            .map(String::toLowerCase)
            .forEach(permission -> entries.computeIfPresent(permission,
                (p, mongoAccessControlEntry) -> {
                  mongoAccessControlEntry.getGroups().remove(group);
                  return mongoAccessControlEntry;
                }));
      }
      return this;
    }

    @Override
    public AclBuilder ensureAdminAccess(
        final Collection<String> adminRoles,
        final String... permissions) {

      if (adminRoles != null && !adminRoles.isEmpty()) {
        if (permissions == null || permissions.length == 0) {
          adminRoles.forEach(adminRole -> entries.keySet()
              .forEach(permission -> addRole(adminRole, permission)));
        } else {
          adminRoles.forEach(adminRole -> addRole(adminRole, permissions));
        }
      }
      return this;
    }

    @Override
    public AclBuilder removeAdminAccess(
        final Collection<String> adminRoles,
        final String... permissions) {

      if (adminRoles != null && !adminRoles.isEmpty()) {
        if (permissions == null || permissions.length == 0) {
          adminRoles.forEach(adminRole -> entries.keySet()
              .forEach(permission -> removeRole(adminRole, permission)));
        } else {
          adminRoles.forEach(adminRole -> removeRole(adminRole, permissions));
        }
      }
      return this;
    }

    @Override
    public <T> T build(AclFactory<T> factory) {
      return factory.createAccessControlList(owner, entries);
    }
  }
}


text:
<!DOCTYPE html>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/graphiql/0.11.5/graphiql.css"/>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/theme/solarized.css" />

Loading...


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!--加载框样式 dialog -->
    <style name="dialog" parent="@android:style/Theme.Dialog">
        <item name="android:windowFrame">@null</item>
        <!-- 边框 -->
        <item name="android:windowIsFloating">true</item>
        <!-- 是否浮现在activity之上 -->
        <item name="android:windowIsTranslucent">false</item>
        <!-- 半透明 -->
        <item name="android:windowNoTitle">true</item>
        <!-- 无标题 -->
        <item name="android:windowBackground">@android:color/transparent</item>
        <!-- 背景透明 -->
        <item name="android:backgroundDimEnabled">false</item>
        <!-- 模糊 -->
    </style>
</resources>


text:
local t = Def.ActorFrame {
	LoadActor( "_AnyRightFist Hold Explosion" ) .. {
		HoldingOnCommand=NOTESKIN:GetMetricA("HoldGhostArrow", "HoldingOnCommand");
		HoldingOffCommand=NOTESKIN:GetMetricA("HoldGhostArrow", "HoldingOffCommand");
		InitCommand=cmd(playcommand,"HoldingOff";finishtweening);
	};
	LoadActor( "_AnyRightFist Roll Explosion" ) .. {
		RollOnCommand=NOTESKIN:GetMetricA("HoldGhostArrow", "RollOnCommand");
		RollOffCommand=NOTESKIN:GetMetricA("HoldGhostArrow", "RollOffCommand");
		InitCommand=cmd(playcommand,"RollOff";finishtweening);
	};
	LoadActor( "_AnyRightFist Tap Explosion Dim" ) .. {
		InitCommand=cmd(diffusealpha,0);
		W5Command=NOTESKIN:GetMetricA("GhostArrowDim", "W5Command");
		W4Command=NOTESKIN:GetMetricA("GhostArrowDim", "W4Command");
		W3Command=NOTESKIN:GetMetricA("GhostArrowDim", "W3Command");
		W2Command=NOTESKIN:GetMetricA("GhostArrowDim", "W2Command");
		W1Command=NOTESKIN:GetMetricA("GhostArrowDim", "W1Command");
		HeldCommand=NOTESKIN:GetMetricA("GhostArrowDim", "HeldCommand");
		JudgmentCommand=cmd(finishtweening);
		BrightCommand=cmd(visible,false);
		DimCommand=cmd(visible,true);
	};
	LoadActor( "AnyRightFist HitMine Explosion" ) .. {
		InitCommand=cmd(blend,"BlendMode_Add";diffusealpha,0);
		HitMineCommand=NOTESKIN:GetMetricA("GhostArrowBright", "HitMineCommand");
	};
}
return t;


text:
class String
	def clean
		cleaned = self.gsub(/[!@$#%^&*()-=_+\[\]:;,.\/<>?\|]/, ' ').squeeze(" ")
	end
end

# Clean the string, arrayify it, and then push every other character to the return array
def alternate_words(string)
	ary = []
	word_ary = string.clean.split(/ /)
	word_ary.each_index do |idx|
		ary.push(word_ary[idx]) if idx.even?
	end
	ary
end


text:
(function () {
  "use strict";

  angular
    .module('mnSettingsAlerts', [
      'mnSettingsAlertsService',
      'mnHelper',
      'mnPromiseHelper',
      'mnAutocompleteOff'
    ])
    .controller('mnSettingsAlertsController', mnSettingsAlertsController)
    .filter('alertsLabel', alertsLabelFilter);

  function alertsLabelFilter(knownAlerts) {
    return function (name) {
      switch (name) {
        case knownAlerts[0]: return 'Node was auto-failed-over';
        case knownAlerts[1]: return 'Maximum number of auto-failed-over nodes was reached';
        case knownAlerts[2]: return 'Node wasn\'t auto-failed-over as other nodes are down at the same time';
        case knownAlerts[3]: return 'Node was not auto-failed-over as there are not enough nodes in the cluster running the same service';
        case knownAlerts[4]: return 'Node was not auto-failed-over as auto-failover for one or more services running on the node is disabled';
        case knownAlerts[5]: return 'Node\'s IP address has changed unexpectedly';
        case knownAlerts[6]: return 'Disk space used for persistent storage has reached at least 90% of capacity';
        case knownAlerts[7]: return 'Metadata overhead is more than 50%';
        case knownAlerts[8]: return 'Bucket memory on a node is entirely used for metadata';
        case knownAlerts[9]: return 'Writing data to disk for a specific bucket has failed';
        case knownAlerts[10]: return 'Writing event to audit log has failed';
        case knownAlerts[11]: return 'Approaching full Indexer RAM warning';
        case knownAlerts[12]: return 'Remote mutation timestamp exceeded drift threshold';
        case knownAlerts[13]: return 'Communication issues among some nodes in the cluster';
      }
    };
  }

  function mnSettingsAlertsController($scope, mnHelper, mnPromiseHelper, mnSettingsAlertsService) {
    var vm = this;
    vm.isFormElementsDisabled = isFormElementsDisabled;
    vm.testEmail = testEmail;
    vm.submit = submit;

    activate();

    function watchOnAlertsSettings(alertsSettings) {
      if (!$scope.rbac.cluster.settings.write) {
        return;
      }
      mnPromiseHelper(vm, mnSettingsAlertsService.saveAlerts(getParams(), {just_validate: 1}))
          .catchErrors();
    }
    function submit() {
      var params = getParams();
      mnPromiseHelper(vm, mnSettingsAlertsService.saveAlerts(params))
        .showErrorsSensitiveSpinner()
        .catchErrors()
        .reloadState();
    }
    function activate() {
      mnPromiseHelper(vm, mnSettingsAlertsService.getAlerts())
        .applyToScope("state")
        .onSuccess(function () {
          $scope.$watch('settingsAlertsCtl.state', _.debounce(watchOnAlertsSettings, 500, {leading: true}), true);
        });
    }
    function testEmail() {
      var params = getParams();
      params.subject = 'Test email from Couchbase Server';
      params.body = 'This email was sent to you to test the email alert email server settings.';

      mnPromiseHelper(vm, mnSettingsAlertsService.testMail(params))
        .showSpinner()
        .showGlobalSuccess('Test email was sent successfully!')
        .catchGlobalErrors('An error occurred during sending test email.');
    }
    function isFormElementsDisabled() {
      return !vm.state || !vm.state.enabled;
    }
    function getParams() {
      var params = _.clone(vm.state);
      params.alerts = mnHelper.checkboxesToList(params.alerts);
      params.recipients = params.recipients.replace(/\s+/g, ',');
      params.emailUser = params.emailServer.user;
      params.emailPass = params.emailServer.pass;
      params.emailHost = params.emailServer.host;
      params.emailPort = params.emailServer.port;
      params.emailEncrypt = params.emailServer.encrypt;
      delete params.emailServer;
      delete params.knownAlerts;
      return params;
    }
  }
})();


text:
package com.one.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionDB {
	public Connection ConnectDB() {
		Connection conn = null;
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			String url = "jdbc:oracle:thin:@localhost:1521:orcl";
			String user = "scott";
			String password = "tiger";
			conn = DriverManager.getConnection(url, user, password);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return conn;
	}
}