text:
package com.trevorgowing.projectlog.log.issue;

import static com.trevorgowing.projectlog.log.constant.Category.COMMITTED_PEOPLE;
import static com.trevorgowing.projectlog.log.constant.Impact.MODERATE;
import static com.trevorgowing.projectlog.log.constant.LogStatus.NEW;
import static com.trevorgowing.projectlog.log.issue.IdentifiedIssueDTOBuilder.anIdentifiedIssueDTO;
import static com.trevorgowing.projectlog.log.issue.IssueBuilder.anIssue;
import static com.trevorgowing.projectlog.project.IdentifiedProjectDTOBuilder.anIdentifiedProjectDTO;
import static com.trevorgowing.projectlog.project.ProjectBuilder.aProject;
import static com.trevorgowing.projectlog.user.IdentifiedUserDTOBuilder.anIdentifiedUserDTO;
import static com.trevorgowing.projectlog.user.UserBuilder.aUser;
import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.samePropertyValuesAs;

import com.trevorgowing.projectlog.common.types.AbstractRepositoryIntegrationTests;
import com.trevorgowing.projectlog.project.IdentifiedProjectDTO;
import com.trevorgowing.projectlog.project.Project;
import com.trevorgowing.projectlog.user.IdentifiedUserDTO;
import com.trevorgowing.projectlog.user.User;
import java.time.LocalDate;
import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class IssueRepositoryTests extends AbstractRepositoryIntegrationTests {

  @Autowired private IssueRepository issueRepository;

  @Test
  public void testFindIdentifiedIssueDTOsWithNoExistingIssues_shouldReturnNoIdentifiedIssuesDTOs() {
    // Exercise SUT
    List<IdentifiedIssueDTO> actualIdentifiedIssueDTOs = issueRepository.findIdentifiedIssueDTOs();

    // Verify results
    assertThat(actualIdentifiedIssueDTOs, is(empty()));
  }

  @Test
  public void testFindIdentifiedIssueDTOsWithExistingIssues_shouldReturnIdentifiedIssueDTOs() {
    // Set up fixture
    LocalDate date = LocalDate.now();

    User ownerOne =
        aUser().email("owner.one@trevorgowing.com").firstName("One").lastName("Owner").build();
    Project projectOne =
        aProject()
            .code("P1")
            .name("Project One")
            .owner(ownerOne)
            .startDate(LocalDate.now())
            .build();

    Issue issueOne =
        anIssue()
            .summary("Issue One Summary")
            .description("Issue One Description")
            .category(COMMITTED_PEOPLE)
            .impact(MODERATE)
            .status(NEW)
            .dateClosed(date)
            .project(projectOne)
            .owner(ownerOne)
            .buildAndPersist(entityManager);

    IdentifiedIssueDTO identifiedIssueOneDTO =
        anIdentifiedIssueDTO()
            .id(issueOne.getId())
            .summary("Issue One Summary")
            .description("Issue One Description")
            .category(COMMITTED_PEOPLE)
            .impact(MODERATE)
            .status(NEW)
            .dateClosed(date)
            .project(
                anIdentifiedProjectDTO()
                    .id(projectOne.getId())
                    .code("P1")
                    .name("Project One")
                    .build())
            .owner(
                anIdentifiedUserDTO()
                    .id(ownerOne.getId())
                    .email("owner.one@trevorgowing.com")
                    .firstName("One")
                    .lastName("Owner")
                    .build())
            .build();

    User ownerTwo =
        aUser().email("owner.two@trevorgowing.com").firstName("Two").lastName("Owner").build();
    Project projectTwo =
        aProject()
            .code("P2")
            .name("Project Two")
            .owner(ownerOne)
            .startDate(LocalDate.now())
            .build();

    Issue issueTwo =
        anIssue()
            .summary("Issue Two Summary")
            .description("Issue Two Description")
            .category(COMMITTED_PEOPLE)
            .impact(MODERATE)
            .status(NEW)
            .dateClosed(date)
            .project(projectTwo)
            .owner(ownerTwo)
            .buildAndPersist(entityManager);

    IdentifiedIssueDTO identifiedIssueTwoDTO =
        anIdentifiedIssueDTO()
            .id(issueTwo.getId())
            .summary("Issue Two Summary")
            .description("Issue Two Description")
            .category(COMMITTED_PEOPLE)
            .impact(MODERATE)
            .status(NEW)
            .dateClosed(date)
            .project(
                anIdentifiedProjectDTO()
                    .id(projectTwo.getId())
                    .code("P2")
                    .name("Project Two")
                    .build())
            .owner(
                anIdentifiedUserDTO()
                    .id(ownerTwo.getId())
                    .email("owner.two@trevorgowing.com")
                    .firstName("Two")
                    .lastName("Owner")
                    .build())
            .build();

    List<IdentifiedIssueDTO> expectedIdentifiedIssueDTOs =
        asList(identifiedIssueOneDTO, identifiedIssueTwoDTO);

    // Exercise SUT
    List<IdentifiedIssueDTO> actualIdentifiedIssueDTOs = issueRepository.findIdentifiedIssueDTOs();

    // Verify results
    assertThat(actualIdentifiedIssueDTOs, is(expectedIdentifiedIssueDTOs));
  }

  @Test
  public void testFindIdentifiedIssueDTOByIdWithNoMatchingIssue_shouldReturnNull() {
    // Exercise SUT
    IdentifiedIssueDTO actualIdentifiedIssueDTO = issueRepository.findIdentifiedIssueDTOById(1L);

    // Verify results
    assertThat(actualIdentifiedIssueDTO, is(nullValue()));
  }

  @Test
  public void testFindIdentifiedIssueDTOWithMatchingIssue_shouldReturnIdentifiedIssueDTO() {
    // Set up fixture
    LocalDate date = LocalDate.now();
    User owner = aUser().email("owner@owner.com").password("password").build();
    Project project = aProject().code("P").owner(owner).startDate(date).build();

    Issue issue =
        anIssue()
            .summary("Summary")
            .description("Description")
            .category(COMMITTED_PEOPLE)
            .impact(MODERATE)
            .status(NEW)
            .dateClosed(date)
            .project(project)
            .owner(owner)
            .buildAndPersist(entityManager);

    IdentifiedUserDTO ownerDTO =
        anIdentifiedUserDTO().id(owner.getId()).email("owner@owner.com").build();
    IdentifiedProjectDTO projectDTO =
        anIdentifiedProjectDTO().id(project.getId()).code("P").build();

    IdentifiedIssueDTO expectedIdentifiedIssueDTO =
        anIdentifiedIssueDTO()
            .id(issue.getId())
            .summary("Summary")
            .description("Description")
            .category(COMMITTED_PEOPLE)
            .impact(MODERATE)
            .status(NEW)
            .dateClosed(date)
            .project(projectDTO)
            .owner(ownerDTO)
            .build();

    // Exercise SUT
    IdentifiedIssueDTO actualIdentifiedIssueDTO =
        issueRepository.findIdentifiedIssueDTOById(issue.getId());

    // Verify results
    assertThat(actualIdentifiedIssueDTO, samePropertyValuesAs(expectedIdentifiedIssueDTO));
  }
}


text:
// Generated from /Users/royce/Idea/src/main/antlr/Apex.g4 by ANTLR 4.7
package com.ncino.apex.grammar;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;

/**
 * This interface defines a complete generic visitor for a parse tree produced
 * by {@link ApexParser}.
 *
 * @param <T> The return type of the visit operation. Use {@link Void} for
 * operations with no return type.
 */
public interface ApexVisitor<T> extends ParseTreeVisitor<T> {
	/**
	 * Visit a parse tree produced by {@link ApexParser#compilationUnit}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitCompilationUnit(ApexParser.CompilationUnitContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#packageDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitPackageDeclaration(ApexParser.PackageDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#importDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitImportDeclaration(ApexParser.ImportDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeDeclaration(ApexParser.TypeDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#modifier}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitModifier(ApexParser.ModifierContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#classOrInterfaceModifier}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitClassOrInterfaceModifier(ApexParser.ClassOrInterfaceModifierContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#variableModifier}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitVariableModifier(ApexParser.VariableModifierContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#classDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitClassDeclaration(ApexParser.ClassDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeParameters}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeParameters(ApexParser.TypeParametersContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeParameter}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeParameter(ApexParser.TypeParameterContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeBound}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeBound(ApexParser.TypeBoundContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#enumDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitEnumDeclaration(ApexParser.EnumDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#enumConstants}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitEnumConstants(ApexParser.EnumConstantsContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#enumConstant}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitEnumConstant(ApexParser.EnumConstantContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#enumBodyDeclarations}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitEnumBodyDeclarations(ApexParser.EnumBodyDeclarationsContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#interfaceDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitInterfaceDeclaration(ApexParser.InterfaceDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeList}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeList(ApexParser.TypeListContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#classBody}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitClassBody(ApexParser.ClassBodyContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#interfaceBody}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitInterfaceBody(ApexParser.InterfaceBodyContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#classBodyDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitClassBodyDeclaration(ApexParser.ClassBodyDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#memberDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitMemberDeclaration(ApexParser.MemberDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#methodDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitMethodDeclaration(ApexParser.MethodDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#genericMethodDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitGenericMethodDeclaration(ApexParser.GenericMethodDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#constructorDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitConstructorDeclaration(ApexParser.ConstructorDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#genericConstructorDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitGenericConstructorDeclaration(ApexParser.GenericConstructorDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#fieldDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitFieldDeclaration(ApexParser.FieldDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#propertyDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitPropertyDeclaration(ApexParser.PropertyDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#propertyBodyDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitPropertyBodyDeclaration(ApexParser.PropertyBodyDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#interfaceBodyDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitInterfaceBodyDeclaration(ApexParser.InterfaceBodyDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#interfaceMemberDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitInterfaceMemberDeclaration(ApexParser.InterfaceMemberDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#constDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitConstDeclaration(ApexParser.ConstDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#constantDeclarator}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitConstantDeclarator(ApexParser.ConstantDeclaratorContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#interfaceMethodDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitInterfaceMethodDeclaration(ApexParser.InterfaceMethodDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#genericInterfaceMethodDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitGenericInterfaceMethodDeclaration(ApexParser.GenericInterfaceMethodDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#variableDeclarators}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitVariableDeclarators(ApexParser.VariableDeclaratorsContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#variableDeclarator}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitVariableDeclarator(ApexParser.VariableDeclaratorContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#variableDeclaratorId}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitVariableDeclaratorId(ApexParser.VariableDeclaratorIdContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#variableInitializer}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitVariableInitializer(ApexParser.VariableInitializerContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#arrayInitializer}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitArrayInitializer(ApexParser.ArrayInitializerContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#enumConstantName}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitEnumConstantName(ApexParser.EnumConstantNameContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#type}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitType(ApexParser.TypeContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#classOrInterfaceType}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitClassOrInterfaceType(ApexParser.ClassOrInterfaceTypeContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#primitiveType}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitPrimitiveType(ApexParser.PrimitiveTypeContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeArguments}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeArguments(ApexParser.TypeArgumentsContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeArgument}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeArgument(ApexParser.TypeArgumentContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#qualifiedNameList}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitQualifiedNameList(ApexParser.QualifiedNameListContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#formalParameters}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitFormalParameters(ApexParser.FormalParametersContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#formalParameterList}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitFormalParameterList(ApexParser.FormalParameterListContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#formalParameter}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitFormalParameter(ApexParser.FormalParameterContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#lastFormalParameter}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitLastFormalParameter(ApexParser.LastFormalParameterContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#methodBody}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitMethodBody(ApexParser.MethodBodyContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#constructorBody}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitConstructorBody(ApexParser.ConstructorBodyContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#qualifiedName}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitQualifiedName(ApexParser.QualifiedNameContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#literal}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitLiteral(ApexParser.LiteralContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotation}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotation(ApexParser.AnnotationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationName}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationName(ApexParser.AnnotationNameContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#elementValuePairs}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitElementValuePairs(ApexParser.ElementValuePairsContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#elementValuePair}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitElementValuePair(ApexParser.ElementValuePairContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#elementValue}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitElementValue(ApexParser.ElementValueContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#elementValueArrayInitializer}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitElementValueArrayInitializer(ApexParser.ElementValueArrayInitializerContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationTypeDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationTypeDeclaration(ApexParser.AnnotationTypeDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationTypeBody}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationTypeBody(ApexParser.AnnotationTypeBodyContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationTypeElementDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationTypeElementDeclaration(ApexParser.AnnotationTypeElementDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationTypeElementRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationTypeElementRest(ApexParser.AnnotationTypeElementRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationMethodOrConstantRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationMethodOrConstantRest(ApexParser.AnnotationMethodOrConstantRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationMethodRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationMethodRest(ApexParser.AnnotationMethodRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#annotationConstantRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitAnnotationConstantRest(ApexParser.AnnotationConstantRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#defaultValue}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitDefaultValue(ApexParser.DefaultValueContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#block}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitBlock(ApexParser.BlockContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#blockStatement}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitBlockStatement(ApexParser.BlockStatementContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#localVariableDeclarationStatement}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitLocalVariableDeclarationStatement(ApexParser.LocalVariableDeclarationStatementContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#localVariableDeclaration}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitLocalVariableDeclaration(ApexParser.LocalVariableDeclarationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#statement}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitStatement(ApexParser.StatementContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#propertyBlock}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitPropertyBlock(ApexParser.PropertyBlockContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#getter}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitGetter(ApexParser.GetterContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#setter}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitSetter(ApexParser.SetterContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#catchClause}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitCatchClause(ApexParser.CatchClauseContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#catchType}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitCatchType(ApexParser.CatchTypeContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#finallyBlock}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitFinallyBlock(ApexParser.FinallyBlockContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#resourceSpecification}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitResourceSpecification(ApexParser.ResourceSpecificationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#resources}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitResources(ApexParser.ResourcesContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#resource}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitResource(ApexParser.ResourceContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#forControl}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitForControl(ApexParser.ForControlContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#forInit}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitForInit(ApexParser.ForInitContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#enhancedForControl}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitEnhancedForControl(ApexParser.EnhancedForControlContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#forUpdate}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitForUpdate(ApexParser.ForUpdateContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#parExpression}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitParExpression(ApexParser.ParExpressionContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#expressionList}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitExpressionList(ApexParser.ExpressionListContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#statementExpression}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitStatementExpression(ApexParser.StatementExpressionContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#constantExpression}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitConstantExpression(ApexParser.ConstantExpressionContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#apexDbExpressionLong}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitApexDbExpressionLong(ApexParser.ApexDbExpressionLongContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#apexDbExpressionShort}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitApexDbExpressionShort(ApexParser.ApexDbExpressionShortContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#apexDbExpression}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitApexDbExpression(ApexParser.ApexDbExpressionContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#expression}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitExpression(ApexParser.ExpressionContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#primary}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitPrimary(ApexParser.PrimaryContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#creator}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitCreator(ApexParser.CreatorContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#createdName}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitCreatedName(ApexParser.CreatedNameContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#innerCreator}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitInnerCreator(ApexParser.InnerCreatorContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#arrayCreatorRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitArrayCreatorRest(ApexParser.ArrayCreatorRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#mapCreatorRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitMapCreatorRest(ApexParser.MapCreatorRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#setCreatorRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitSetCreatorRest(ApexParser.SetCreatorRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#classCreatorRest}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitClassCreatorRest(ApexParser.ClassCreatorRestContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#explicitGenericInvocation}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitExplicitGenericInvocation(ApexParser.ExplicitGenericInvocationContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#nonWildcardTypeArguments}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitNonWildcardTypeArguments(ApexParser.NonWildcardTypeArgumentsContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#typeArgumentsOrDiamond}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitTypeArgumentsOrDiamond(ApexParser.TypeArgumentsOrDiamondContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#nonWildcardTypeArgumentsOrDiamond}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitNonWildcardTypeArgumentsOrDiamond(ApexParser.NonWildcardTypeArgumentsOrDiamondContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#superSuffix}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitSuperSuffix(ApexParser.SuperSuffixContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#explicitGenericInvocationSuffix}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitExplicitGenericInvocationSuffix(ApexParser.ExplicitGenericInvocationSuffixContext ctx);
	/**
	 * Visit a parse tree produced by {@link ApexParser#arguments}.
	 * @param ctx the parse tree
	 * @return the visitor result
	 */
	T visitArguments(ApexParser.ArgumentsContext ctx);
}

redpajama_set_name: RedPajamaGithub


text:
Hydrogen provides a selection of commands for running code. Press ⌘-⇧-P to open the command palette and type "hydrogen" and they will come up.

## "Hydrogen: Run"
There are two ways to tell Hydrogen which code in your file to run.

1. **Selected code:** If you have code selected when you hit Run, Hydrogen will run exactly that code.
2. **Current block:** With no code selected, Hydrogen will try to find the complete block that's on or before the current line.

    - If the line you're on is already a complete expression (like `s = "abracadabra"`), Hydrogen will run just that line.

    - If the line you're on is the start of a block like a `for` loop, Hydrogen will run the whole block.

    - If the line you're on is blank, Hydrogen will run the first block above that line.

It's easiest to see these interactions visually:

![execute](https://cloud.githubusercontent.com/assets/13285808/20360915/a16efcba-ac03-11e6-9d5c-3489b3c3c85f.gif)

**"Hydrogen: Run And Move Down"** will run the the code as described above and move the cursor to the next executable line.

If your code starts getting cluttered up with results, run **"Hydrogen: Clear Results"** to remove them all at once.

## "Hydrogen: Run Cell"
A "code cell" is a block of lines to be executed at once. You can define them using inline comments. Hydrogen supports a
multitude of ways to define cells. Pick the one you like best.
The following is an example for `python` but it will work in any language, just replace `#` with the comment symbol for your desired language:

When you place the cursor inside a cell and hit **"Run Cell"**, Hydrogen will execute this cell. The command **"Hydrogen: Run Cell And Move Down"** will move the cursor to the next cell after execution.

## "Hydrogen: Run All" and "Hydrogen: Run All Above"
These commands will run all code inside the editor or all code above the cursor.

## "Hydrogen: Restart Kernel And Re Evaluate Bubbles"

Restart running kernel and re-evaluate all bubbles on editor.
This command works in following way.

1. Restart kernel to cleanup evaluation environment.
2. Run all code and update all existing bubbles.

## "Hydrogen: Toggle Bubble"

Toggle(add or remove) bobble at current cursor line.
You can **preset** bubble before executing code.
If executed with selection, toggle bubble on each selected line.

Typical workflow with this command is

1. Add bubble at line you want manually by `hydrogen:toggle-bubble`
2. Execute code cleanly by `restart-kernel-and-re-evaluate-bubbles`
3. Modify code, then repeat 1-3 until you fully understand/investigated code.

## Watch Expressions

After you've run some code with Hydrogen, you can use the **"Hydrogen: Toggle Watches"** command from the Command Palette to open the watch expression sidebar. Whatever code you write in watch expressions will be re-run after each time you send that kernel any other code.

![watch](https://cloud.githubusercontent.com/assets/13285808/20361086/4434ab3e-ac04-11e6-8298-1fb925de4e78.gif)

**IMPORTANT:** Be careful what you put in your watch expressions. If you write code that mutates state in a watch expression, that code will get run after every execute command and likely result in some _extremely confusing_ bugs.

You can re-run the watch expressions by using the normal run shortcut (⌘-↩ by default) inside a watch expression's edit field.

If you have multiple kernels running, you can switch between their watch expressions with the **"Hydrogen: Select Watch Kernel"** command (or just click on the "Kernel: <language>" text).

## Completion

Receive completions from the running kernel.

## Code Introspection

You can use the **"Hydrogen: Toggle Inspector"** command from the Command Palette to get metadata from the kernel about the object under the cursor.

## Managing kernels

Sometimes things go wrong. Maybe you've written an infinite loop, maybe the kernel has crashed, or maybe you just want to clear the kernel's namespace. Use the command palette to **interrupt** (think `Ctrl-C` in a REPL) or **restart** the kernel.

You can also access these commands by clicking on the kernel status in the status bar or via the command palette. It looks like this:

Additionally, if you have more kernels running, you can open the kernel monitor via **Hydrogen: Toggle Kernel Monitor** to see a list of all running kernels and shut them down if needed:

## Multiple kernels inside one rich document

If you are working in a markup file that supports highlighted code blocks, we can handle multiple kernels per file. This way you can write your documentation, readme or paper together with your code while retaining the interactivity of Hydrogen.

We support [markdown](https://github.com/burodepeper/language-markdown), [gfm](https://github.com/atom/language-gfm), [asciidoc](https://github.com/asciidoctor/atom-language-asciidoc), [reStructuredText](https://github.com/Lukasa/language-restructuredtext),
[Pweave](https://github.com/mpastell/language-weave),
[Weave.jl](https://github.com/mpastell/language-weave)
and [knitr](https://github.com/christophergandrud/language-knitr/).


text:
function navigateTab(url, expectedTabUrl, callback) {
  chrome.tabs.onUpdated.addListener(function updateCallback(_, info, tab) {
    if (info.status == 'complete' && tab.url == expectedTabUrl) {
      chrome.tabs.onUpdated.removeListener(updateCallback);
      callback(tab);
    }
  });

  chrome.tabs.update({url: url});
}

var matchedRules = [];
var onRuleMatchedDebugCallback = (rule) => {
  matchedRules.push(rule);
};

var testServerPort;
function getServerURL(host) {
  if (!testServerPort)
    throw new Error('Called getServerURL outside of runTests.');
  return `http://${host}:${testServerPort}/`;
}

function resetMatchedRules() {
  matchedRules = [];
}

function verifyExpectedRuleInfo(expectedRuleInfo) {
  chrome.test.assertEq(1, matchedRules.length);
  const matchedRule = matchedRules[0];

  // The request ID may not be known but should be populated.
  chrome.test.assertTrue(matchedRule.request.hasOwnProperty('requestId'));
  delete matchedRule.request.requestId;

  chrome.test.assertEq(expectedRuleInfo, matchedRule);
}

var tests = [
  function setup() {
    chrome.declarativeNetRequest.onRuleMatchedDebug.addListener(
        onRuleMatchedDebugCallback);

    // This test was known to flake as reported in crbug.com/1029233 due to a
    // race condition where a request was sent and a declarative rule was
    // matched before the onRuleMatchedDebug listener was properly added.
    // Sending the request after waiting for a round trip should fix the
    // flakiness.
    chrome.test.waitForRoundTrip('msg', chrome.test.succeed);
  },

  function testDynamicRule() {
    resetMatchedRules();

    const rule = {
      id: 1,
      priority: 1,
      condition: {urlFilter: 'def', 'resourceTypes': ['main_frame']},
      action: {type: 'block'},
    };

    chrome.declarativeNetRequest.updateDynamicRules(
        {addRules: [rule]}, function() {
          chrome.test.assertNoLastError();
          const url = getServerURL('def.com');
          navigateTab(url, url, (tab) => {
            const expectedRuleInfo = {
              request: {
                initiator: `chrome-extension://${chrome.runtime.id}`,
                method: 'GET',
                frameId: 0,
                parentFrameId: -1,
                tabId: tab.id,
                type: 'main_frame',
                url: url
              },
              rule: {
                ruleId: 1,
                rulesetId: chrome.declarativeNetRequest.DYNAMIC_RULESET_ID
              }
            };
            verifyExpectedRuleInfo(expectedRuleInfo);
            chrome.test.succeed();
          });
        });
  },

  function testBlockRule() {
    resetMatchedRules();

    const url = getServerURL('abc.com');
    navigateTab(url, url, (tab) => {
      const expectedRuleInfo = {
        request: {
          initiator: `chrome-extension://${chrome.runtime.id}`,
          method: 'GET',
          frameId: 0,
          parentFrameId: -1,
          tabId: tab.id,
          type: 'main_frame',
          url: url
        },
        rule: {ruleId: 1, rulesetId: 'rules1'}
      };
      verifyExpectedRuleInfo(expectedRuleInfo);
      chrome.test.succeed();
    });
  },

  // Ensure that requests that don't originate from a tab (such as those from
  // the extension background page) trigger the listener.
  function testBackgroundPageRequest() {
    function listenOnce(target, callback) {
      let innerCallback = function(info) {
        target.removeListener(innerCallback);
        callback(info);
      };
      target.addListener(innerCallback);
    }

    listenOnce(
        chrome.declarativeNetRequest.onRuleMatchedDebug,
        function(fetchPromise, info) {
          fetchPromise.then(function(response) {
            chrome.test.fail('Request should be blocked by rule with ID 1');
          }).catch(function(error) {
            chrome.test.assertEq(1, info.rule.ruleId);
            chrome.test.assertEq('rules1', info.rule.rulesetId);

            // Tab ID should be -1 since this request was made from a background
            // page.
            chrome.test.assertEq(-1, info.request.tabId);
            chrome.test.succeed();
          });
        }.bind(null, fetch(getServerURL('abc.com'), {method: 'GET'})));
  },

  function testNoRuleMatched() {
    resetMatchedRules();
    const url = getServerURL('nomatch.com');
    navigateTab(url, url, (tab) => {
      chrome.test.assertEq(0, matchedRules.length);
      chrome.test.succeed();
    });
  },

  function testAllowRule() {
    resetMatchedRules();

    const url = getServerURL('abcde.com');
    navigateTab(url, url, (tab) => {
      // The allow rule should not be matched twice despite it overriding both
      // a block and a redirect rule (rules with id 1 and 5).
      chrome.test.assertEq(1, matchedRules.length);
      const matchedRule = matchedRules[0];
      chrome.test.assertEq(4, matchedRule.rule.ruleId);
      chrome.test.assertEq('rules2', matchedRule.rule.rulesetId);

      chrome.test.succeed();
    });
  },

  function testMultipleRules() {
    resetMatchedRules();

    // redir1.com --> redir2.com --> abc.com (blocked)
    // 3 rules are matched from the above sequence of actions.
    navigateTab(getServerURL('redir1.com'), 'http://abc.com/', (tab) => {
      chrome.test.assertEq(3, matchedRules.length);

      const expectedMatches = [
        {ruleId: 2, rulesetId: 'rules1'}, {ruleId: 3, rulesetId: 'rules2'},
        {ruleId: 1, rulesetId: 'rules1'}
      ];
      for (let i = 0; i < matchedRules.length; ++i) {
        chrome.test.assertEq(
            expectedMatches[i].ruleId, matchedRules[i].rule.ruleId);
        chrome.test.assertEq(
            expectedMatches[i].rulesetId, matchedRules[i].rule.rulesetId);
      }

      chrome.test.succeed();
    });
  }
];

chrome.test.getConfig(function(config) {
  testServerPort = config.testServer.port;
  chrome.test.runTests(tests);
});


text:
![](img/stephen-colbert.jpg)

---

# About Me

![right,filtered](img/Me.jpg)

### Software Engineer @ IBM
### Continuous Delivery, SmartCloud Notes
### ![inline](img/Twitter.png) [ImDarinEgan](https://twitter.com/ImDarinEgan)

---

# TL;DR

![fit](img/sticky.png)

## Vagrant
### omnibus, cachier, berkshelf
## Chef Development Kit (ChefDK)
### Berkshelf
## Packer

---

# Definition of DevOps

![right,filtered](img/chefconf-2015-logo.png)

Chef Style DevOps Kung Fu
[https://github.com/chef/devops-kungfu](https://github.com/chef/devops-kungfu)

> "A cultural and professional movement, focused on how we build and operate high velocity organizations, born from the experiences of the it's practitioners."
-- Adam Jacob - ChefConf 2015 Keynote

---

# Infrastructure Is Code, And All Code Goes Through The Same Workflow

![](img/application.jpg)

* Applications Are Code
* Infrastructure Is Code
* All Code Goes Through The Same Workflow

---

# Culture
# Process
# Tools

![left](img/hashicorp-logo.jpg)
![right,fit](img/opscode-logo.png)

---

![inline](img/hashicorp-logo.jpg)

# Hashicorp

## Vagrant
## Packer
## Consul
## Atlas

---

![inline](img/opscode-logo.png)

# Opscode

## Chef

---

# Vagrant

![fit](img/vagrant.png)

## Create and configure lightweight, reproducible, and portable development environments.

### [https://www.vagrantup.com](https://www.vagrantup.com)

> In a world with Vagrant, developers can check out any repository from version control, run vagrant up, and have a fully running development environment without any human interaction.
-- [The Tao of Vagrant](http://mitchellh.com/the-tao-of-vagrant)

---

# vagrant init

![fit](img/vagrant.png)

```bash
$> vagrant init chef/ubuntu-14.04
```

A Vagrantfile has been placed in this directory. You are now ready to vagrant up your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on vagrantup.com for more information on using Vagrant.

```ruby
Vagrant.configure(2) do |config|
  config.vm.box = "chef/ubuntu-14.04"
end
```

---

# vagrant <up | status | ssh | destroy>

![fit](img/vagrant.png)

```bash
$> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'chef/ubuntu-14.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'chef/ubuntu-14.04' is up to date...
==> default: Setting the name of the VM: chefubuntu-1404_default_1435402982259_46392
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/darin/samples/chef.ubuntu-14.04
```

---

# Chef Development Kit (ChefDK)

![fit](img/opscode-logo.png)

> Chef Development Kit (ChefDK) brings Chef and the development tools developed by the Chef Community together and acts as the consistent interface to this awesomeness.
-- [https://downloads.chef.io/chef-dk](https://downloads.chef.io/chef-dk)

This awesomeness is composed of:
[Chef](https://github.com/chef/chef), [Berkshelf](http://berkshelf.com), [Test Kitchen](http://kitchen.ci), [ChefSpec](http://sethvargo.github.io/chefspec), [Foodcritic](http://www.foodcritic.io)

For even more awesomeness, check out:

[tailor](https://github.com/turboladen/tailor) and [RuboCop](https://github.com/bbatsov/rubocop)

---

# vagrant-omnibus

![fit](img/vagrant.png)

### A Vagrant plugin that ensures the desired version of Chef is installed via the platform-specific Omnibus packages.

### [https://github.com/chef/vagrant-omnibus](https://github.com/chef/vagrant-omnibus)

```bash
$> vagrant plugin install vagrant-omnibus
```

```ruby
if Vagrant.has_plugin?("vagrant-omnibus")
    config.omnibus.chef_version = :latest
end
```

---

# vagrant-cachier

![fit](img/vagrant.png)

### A Vagrant plugin that reduces the time for boxes to be provisioned by sharing a common package cache among similar instances, targeting multiple package managers and distros.

### [https://github.com/fgrehm/vagrant-cachier](https://github.com/fgrehm/vagrant-cachier)

```bash
$> vagrant plugin install vagrant-cachier
```

```ruby
if Vagrant.has_plugin?("vagrant-cachier")
    config.cache.scope = :machine
end
```

---

# Berkshelf

![right,fit](img/berks.jpg)

Manage a Cookbook or an Application's Cookbook dependencies.

[http://berkshelf.com](http://berkshelf.com)

The Berkshelf contains the installed cookbooks and their dependencies.

Dependencies are managed via the file `Berksfile`.

For more, see [The Berkshelf Way](https://www.chef.io/blog/chefconf-talks/the-berkshelf-way-jamie-winsor)

Berkshelf is now included as part of the ChefDK. This is the fastest, easiest and recommended installation method.

---

# berks <cookbook | init | package | vendor>

![](img/berks.jpg)

```bash
$> berks cookbook NAME
.
├── recipes/
│   └── default.rb
├── .kitchen.yml
├── .rubocop.yml
├── .rubocop_todo.yml
├── .tailor
├── Berksfile
├── CHANGELOG.md
├── Gemfile
├── LICENSE
├── README.md
├── Thorfile
├── Vagrantfile
├── chefignore
└── metadata.rb
```

---

# vagrant-berkshelf

![fit](img/vagrant.png)

### A Vagrant plugin that adds Berkshelf integration to the Chef provisioners. Vagrant Berkshelf will automatically download and install cookbooks onto the Vagrant Virtual Machine.

### [https://github.com/berkshelf/vagrant-berkshelf](https://github.com/berkshelf/vagrant-berkshelf)

```bash
$> vagrant plugin install vagrant-berkshelf
```

```ruby
if Vagrant.has_plugin?("vagrant-berkshelf")
    config.berkshelf.enabled = true
end
```

---

# Tao of Vagrant - Create Target

![](img/berks.jpg)

```bash
Bringing machine 'default' up with 'virtualbox' provider...
    default: The Berkshelf shelf is at "/Users/darin/.berkshelf/vagrant-berkshelf/shelves/..."
==> default: Sharing cookbooks with VM
==> default: Importing base box 'chef/ubuntu-14.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'chef/ubuntu-14.04' is up to date...
==> default: Setting the name of the VM: berkscookbookfoo_default_1436020179873_34644
==> default: Updating Vagrants Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Fetching 'berks.cookbook.foo' from source at .
==> default: Using berks.cookbook.foo (0.1.0) from source at .
==> default: Vendoring berks.cookbook.foo (0.1.0) to
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Mounting shared folders...
    default: /vagrant => /Users/darin/i-am-devops-and-so-can-you/samples/berks.cookbook.foo
    default: /tmp/vagrant-cache => /Users/darin/i-am-devops-and-so-can-you/samples/berks.cookbook.foo/.vagrant/machines/default/cache
    default: /tmp/vagrant-chef/.../cookbooks => /Users/darin/.berkshelf/vagrant-berkshelf/shelves/...
```

---

# Tao of Vagrant - Install Provisioners

![](img/berks.jpg)

```bash
==> default: Installing Chef 12.4.0 Omnibus package...
==> default: Downloading Chef 12.4.0 for ubuntu...
==> default: downloading https://www.getchef.com/chef/metadata?v=12.4.0&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64
==> default:   to file /tmp/install.sh.1636/metadata.txt
==> default: trying wget...
==> default: url    https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/10.04/x86_64/chef_12.4.0-1_amd64.deb
==> default: md5    630a8752be2cb45c69b7880adb2340f1
==> default: sha256 2d66c27884658f851d43cec850b4951b4d540492be521ae16f6941be80e8b1e6
==> default: downloaded metadata file looks valid...
==> default: /tmp/vagrant-cache/vagrant_omnibus/chef_12.4.0-1_amd64.deb already exists, verifiying checksum...
==> default: Comparing checksum with sha256sum...
==> default: checksum compare succeeded, using existing file!
==> default: Installing Chef 12.4.0
==> default: installing with dpkg...
==> default: Selecting previously unselected package chef.
==> default: (Reading database ... 32400 files and directories currently installed.)
==> default: Preparing to unpack .../chef_12.4.0-1_amd64.deb ...
==> default: Unpacking chef (12.4.0-1) ...
==> default: Setting up chef (12.4.0-1) ...
==> default: Thank you for installing Chef!
```

---

# Tao of Vagrant - Provision Target

![](img/berks.jpg)

```bash
==> default: Running provisioner: chef_zero...
==> default: Detected Chef (latest) is already installed
Generating chef JSON and uploading...
==> default: Running chef-zero...
==> default: stdin: is not a tty
==> default: [2015-07-04T14:30:28+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /tmp/vagrant-chef/...
==> default:   One version per cookbook
==> default: [2015-07-04T14:30:28+00:00] INFO: Forking chef instance to converge...
==> default: [2015-07-04T14:30:28+00:00] INFO: *** Chef 12.4.0 ***
==> default: [2015-07-04T14:30:28+00:00] INFO: Chef-client pid: 1785
==> default: [2015-07-04T14:30:32+00:00] INFO: Setting the run_list to ["recipe[berks.cookbook.foo::default]"] from CLI options
==> default: [2015-07-04T14:30:32+00:00] INFO: Run List is [recipe[berks.cookbook.foo::default]]
==> default: [2015-07-04T14:30:32+00:00] INFO: Run List expands to [berks.cookbook.foo::default]
==> default: [2015-07-04T14:30:32+00:00] INFO: Starting Chef Run for berks.cookbook.foo-berkshelf
==> default: [2015-07-04T14:30:32+00:00] INFO: Running start handlers
==> default: [2015-07-04T14:30:32+00:00] INFO: Start handlers complete.
==> default: [2015-07-04T14:30:32+00:00] INFO: berks.cookbook.foo Success
==> default: [2015-07-04T14:30:32+00:00] INFO: Chef Run complete in 0.060590805 seconds
==> default: [2015-07-04T14:30:32+00:00] INFO: Skipping removal of unused files from the cache
==> default: [2015-07-04T14:30:32+00:00] INFO: Running report handlers
==> default: [2015-07-04T14:30:32+00:00] INFO: Report handlers complete
```

---

# Vagrant Boxes

![fit](img/vagrant.png)

Boxes are the package format for Vagrant environments. A box can be used by anyone on any platform that Vagrant supports to bring up an identical working environment.

```bash
$> vagrant <init | box add> USER/BOX
```

_e.g._ `chef/ubuntu-14.04`

```ruby
Vagrant.configure(2) do |config|
  config.vm.box = "chef/ubuntu-14.04"
end
```

---

# Packer

![fit](img/packer.png)

### Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration.

### [https://packer.io](https://packer.io)

### Templates are JSON files that configure the various components of Packer in order to create one or more machine images.

```javascript
"builders": [],
"provisioners": [],
"post-processors": [{
  "output": "builds/{{user `box_basename`}}.{{.Provider}}.box",
  "type": "vagrant"}]
```

---

# Bento

![left,filtered,fit](img/packer.png)

## Modularized Packer definitions for building Vagrant baseboxes

> Bento is a project that encapsulates Packer templates for building Vagrant baseboxes. These boxes are used internally at Chef Software, Inc. for testing Hosted Chef, Chef Server and open source cookbooks via test-kitchen.
-- [http://chef.github.io/bento](http://chef.github.io/bento)

---

# Bento chef/ubuntu-14.04

![fit](img/packer.png)

```bash
$> packer build ubuntu-14.04-amd64.json

/Users/darin/.vagrant.d/boxes/chef-VAGRANTSLASH-ubuntu-14.04
├── 1.0.0/
│   └── virtualbox/
│       ├── Vagrantfile
│       ├── box.ovf
│       ├── metadata.json
│       └── packer-ubuntu-14.04-amd64-disk1.vmdk
└── metadata_url
```

---

# Boxcutter

![left,filtered,fit](img/packer.png)

Community-driven templates and tools for creating cloud, virtual machines, containers and metal operating system environments

## Packer templates for Windows

> This repository contains templates for Windows that can create Vagrant boxes using Packer.
-- [https://github.com/boxcutter/windows](https://github.com/boxcutter/windows)

---

# Q & A

![right,fit](img/i-am-devops-and-so-can-you.jpg)

### ![inline](img/Twitter.png) [ImDarinEgan](https://twitter.com/ImDarinEgan)


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

namespace EasyDatebook_Screens
{
    /// <summary>
    /// An implementation of the ICommand interface.
    /// </summary>
    public class RelayCommand : ICommand
    {
        private Action<object> execute;

        private Predicate<object> canExecute;

        private event EventHandler canExecuteChanged;

        /// <summary>
        /// Constructs a Command with a given Action for Execute, and a specified Predicate for CanExecute.
        /// </summary>
        /// <param name="execute">An Action for the Execute method of this Command.</param>
        /// <param name="canExecute">A Predicate for the CanExecute method of this Command.</param>
        public RelayCommand(Action<object> execute, Predicate<object> canExecute)
        {
            if (execute == null) throw new ArgumentNullException("execute");
            if (canExecute == null) throw new ArgumentNullException("canExecute");

            this.execute = execute;
            this.canExecute = canExecute;
        }

        /// <summary>
        /// Constructs a Command with a given Action for Execute.
        /// </summary>
        /// <param name="execute">An Action for the Execute method of this Command.</param>
        public RelayCommand(Action<object> execute)
            : this(execute, DefaultCanExecute) { }

        /// <inheritdoc/>
        public void Execute(object parameter) { this.execute(parameter); }

        /// <inheritdoc/>
        public bool CanExecute(object parameter)
        {
            return this.canExecute != null && this.canExecute(parameter);
        }

        private static bool DefaultCanExecute(object parameter) { return true; }

        /// <inheritdoc/>
        public event EventHandler CanExecuteChanged
        {
            add
            {
                CommandManager.RequerySuggested += value;
                this.canExecuteChanged += value;
            }
            remove
            {
                CommandManager.RequerySuggested -= value;
                this.canExecuteChanged -= value;
            }
        }

        /// <summary>
        /// Should be called when CanExecute has been changed to notify listeners.
        /// </summary>
        public void OnCanExecuteChanged()
        {
            EventHandler handler = this.canExecuteChanged;
            if (handler != null)
            {
                handler.Invoke(this, EventArgs.Empty);
            }
        }

        /// <summary>
        /// Cleans instance before garbage collection.
        /// </summary>
        public void Destroy()
        {
            canExecute = _ => false;
            execute = _ => { return; };
        }
    }
}


text:
/*	$NetBSD: mpu_cmpci.c,v 1.16 2011/11/23 23:07:35 jmcneill Exp $	*/

/*
 * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Lennart Augustsson (augustss@NetBSD.org).
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpu_cmpci.c,v 1.16 2011/11/23 23:07:35 jmcneill Exp $");

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/errno.h>
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/audioio.h>
#include <sys/midiio.h>

#include <sys/bus.h>

#include <dev/audio_if.h>
#include <dev/midi_if.h>

#include <dev/pci/pcivar.h>

#include <dev/ic/mpuvar.h>
#include <dev/pci/cmpcivar.h>

static int
mpu_cmpci_match(device_t parent, cfdata_t match, void *aux)
{
	struct audio_attach_args *aa = aux;
	struct cmpci_softc *ysc = device_private(parent);
	struct mpu_softc sc;

	if (aa->type != AUDIODEV_TYPE_MPU)
		return 0;
	memset(&sc, 0, sizeof sc);
	sc.iot = ysc->sc_iot;
	sc.ioh = ysc->sc_mpu_ioh;
	return mpu_find(&sc);
}

static void
mpu_cmpci_attach(device_t parent, device_t self, void *aux)
{
	struct cmpci_softc *ysc = device_private(parent);
	struct mpu_softc *sc = device_private(self);

	aprint_normal("\n");

	sc->iot = ysc->sc_iot;
	sc->ioh = ysc->sc_mpu_ioh;
	sc->model = "CMPCI MPU-401 MIDI UART";
	sc->sc_dev = self;
	sc->lock = &ysc->sc_intr_lock;

	mpu_attach(sc);
}

CFATTACH_DECL_NEW(mpu_cmpci, sizeof (struct mpu_softc),
    mpu_cmpci_match, mpu_cmpci_attach, NULL, NULL);


text:
package io.gravitee.rest.api.security.filter;

import static org.mockito.Mockito.*;

import io.gravitee.common.http.HttpHeaders;
import io.gravitee.common.http.HttpStatusCode;
import io.gravitee.repository.management.model.Token;
import io.gravitee.rest.api.model.UserEntity;
import io.gravitee.rest.api.security.cookies.CookieGenerator;
import io.gravitee.rest.api.security.utils.AuthoritiesProvider;
import io.gravitee.rest.api.service.TokenService;
import io.gravitee.rest.api.service.UserService;
import io.gravitee.rest.api.service.exceptions.UserNotFoundException;
import javax.servlet.FilterChain;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

/**
 * @author Eric LELEU (eric.leleu at graviteesource.com)
 * @author GraviteeSource Team
 */
@RunWith(MockitoJUnitRunner.class)
public class TokenAuthenticationFilterTest {

    @Mock
    private CookieGenerator cookieGenerator;

    @Mock
    private UserService userService;

    @Mock
    private TokenService tokenService;

    @Mock
    private AuthoritiesProvider authoritiesProvider;

    @Mock
    private HttpServletRequest request;

    @Mock
    private HttpServletResponse response;

    @Mock
    private FilterChain filterChain;

    @Test
    public void shouldGenerateAuthorities() throws Exception {
        final String USER_ID = "userid1";
        final String TOKEN = "b4c6102e-6c95-464f-8610-2e6c95064f02";
        final String BEARER = "Bearer " + TOKEN;

        TokenAuthenticationFilter filter = new TokenAuthenticationFilter(
            "JWT_SECRET_TOEKN_TEST",
            cookieGenerator,
            userService,
            tokenService,
            authoritiesProvider
        );

        when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(BEARER);

        final Token token = mock(Token.class);
        when(token.getReferenceId()).thenReturn(USER_ID);
        when(tokenService.findByToken(TOKEN)).thenReturn(token);

        UserEntity user = mock(UserEntity.class);
        when(user.getId()).thenReturn(USER_ID);
        when(userService.findById(USER_ID)).thenReturn(user);

        filter.doFilter(request, response, filterChain);

        verify(authoritiesProvider).retrieveAuthorities(USER_ID);
    }

    @Test
    public void shouldRejectRequest_UnknownToken() throws Exception {
        final String USER_ID = "SomeId";
        final String TOKEN = "b4c6102e-6c95-464f-8610-2e6c95064f02";
        final String BEARER = "Bearer " + TOKEN;

        TokenAuthenticationFilter filter = new TokenAuthenticationFilter(
            "JWT_SECRET_TOEKN_TEST",
            cookieGenerator,
            userService,
            tokenService,
            authoritiesProvider
        );

        when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(BEARER);

        when(tokenService.findByToken(TOKEN)).thenThrow(new IllegalStateException("Token not found"));

        filter.doFilter(request, response, filterChain);

        verify(response).sendError(HttpStatusCode.UNAUTHORIZED_401);
        verify(authoritiesProvider, never()).retrieveAuthorities(USER_ID);
    }

    @Test
    public void shouldRejectRequest_UnknownUser() throws Exception {
        final String USER_ID = "SomeId";
        final String TOKEN = "b4c6102e-6c95-464f-8610-2e6c95064f02";
        final String BEARER = "Bearer " + TOKEN;

        TokenAuthenticationFilter filter = new TokenAuthenticationFilter(
            "JWT_SECRET_TOEKN_TEST",
            cookieGenerator,
            userService,
            tokenService,
            authoritiesProvider
        );

        when(request.getHeader(HttpHeaders.AUTHORIZATION)).thenReturn(BEARER);

        final Token token = mock(Token.class);
        when(token.getReferenceId()).thenReturn(USER_ID);
        when(tokenService.findByToken(TOKEN)).thenReturn(token);

        when(userService.findById(USER_ID)).thenThrow(new UserNotFoundException(USER_ID));

        filter.doFilter(request, response, filterChain);

        verify(response).sendError(HttpStatusCode.UNAUTHORIZED_401);
        verify(authoritiesProvider, never()).retrieveAuthorities(USER_ID);
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Appleseed.DesktopModules.CoreModules.EvolutilityAdvanced.ModuleRenderer {

    public partial class EvolutilityAdvancedModuleRendererPage {

        /// <summary>
        /// vendormin control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlLink vendormin;

        /// <summary>
        /// evolutility control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlLink evolutility;

        /// <summary>
        /// form1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlForm form1;
    }
}


text:
var createViewModel = require("../../shared/main-view-model").createViewModel,
  emptySquare = require("../../shared/main-view-model").emptySquare,
  isValidMove = require("../../shared/main-view-model").isValidMove,
  isEmpty = require("../../shared/main-view-model").isEmpty,
  isGameSolved = require("../../shared/main-view-model").isGameSolved,
  updateViewModel = require("../../shared/main-view-model").updateViewModel,
  updateButtonColors = require("../../shared/main-view-model").updateColors,
  updateGameBoard = require("../../shared/main-view-model").updateGameBoard,
  frame = require('ui/frame'),
  Dialogs = require('ui/dialogs'),
  page = null,
  moves = 0;

function onPageLoaded(args) {
  page = args.object;
  page.bindingContext = createViewModel(4, 4);
  updateButtonColors(page.bindingContext);
}

function onResetClick(args) {
  btn = args.object;
  page.bindingContext = createViewModel(4, 4);
  updateButtonColors(page.bindingContext);
  moves = 0;
}

function onSquareClick(args) {
  var btn = args.object,
    idPieces = btn.id.split('-'),
    btnName = idPieces[0],
    btnRow = idPieces[1],
    btnCol = idPieces[2],
    btnCls = btnName + 'Cls',
    squareB = emptySquare(),
    squareA = {
      id: btnName,
      value: btn.text,
      row: btnRow,
      col: btnCol,
      class: btnCls
    };

  if (!isEmpty(squareA) && isValidMove(squareA, squareB)) {
    updateViewModel(squareA.id, squareB.value, page.bindingContext);
    updateGameBoard(squareA.id, squareB.value);
    updateViewModel(squareB.id, squareA.value, page.bindingContext);
    updateGameBoard(squareB.id, squareA.value);
    updateButtonColors(page.bindingContext);
    moves++;
    updateViewModel('moves', 'Moves: ' + moves, page.bindingContext);
    if(isGameSolved()) {
      Dialogs.alert({ title: 'W i n n e r', message: 'You solved the puzzle in ' + moves + ' moves!'}).then(function() {
        page.bindingContext = createViewModel(4, 4);
        updateButtonColors(page.bindingContext);
        moves = 0;
      });
    }
  }

}

exports.resetTap = onResetClick;
exports.squareTap = onSquareClick;
exports.pageLoaded = onPageLoaded;


text:
package com.m2049r.xmrwallet.util;

import com.m2049r.xmrwallet.data.NodeInfo;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import timber.log.Timber;

public class NodePinger {
    static final public int NUM_THREADS = 10;
    static final public long MAX_TIME = 5L; // seconds

    public interface Listener {
        void publish(NodeInfo node);
    }

    static public void execute(Collection<NodeInfo> nodes, final Listener listener) {
        final ExecutorService exeService = Executors.newFixedThreadPool(NUM_THREADS);
        List<Callable<Boolean>> taskList = new ArrayList<>();
        for (NodeInfo node : nodes) {
            taskList.add(() -> node.testRpcService(listener));
        }

        try {
            exeService.invokeAll(taskList, MAX_TIME, TimeUnit.SECONDS);
        } catch (InterruptedException ex) {
            Timber.w(ex);
        }
        exeService.shutdownNow();
    }
}


text:
using System.Net;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Microsoft.AspNetCore.Diagnostics.HealthChecks;

public class HealthCheckEndpointRouteBuilderExtensionsTest
{
    [Fact]
    public void ThrowFriendlyErrorWhenServicesNotRegistered()
    {
        using var host = new HostBuilder()
            .ConfigureWebHost(webHostBuilder =>
            {
                webHostBuilder
                .UseTestServer()
                .Configure(app =>
                {
                    app.UseRouting();
                    app.UseEndpoints(endpoints =>
                    {
                        endpoints.MapHealthChecks("/healthz");
                    });
                })
                .ConfigureServices(services =>
                {
                    services.AddRouting();
                });
            }).Build();

        var ex = Assert.Throws<InvalidOperationException>(() => host.Start());

        Assert.Equal(
            "Unable to find the required services. Please add all the required services by calling " +
            "'IServiceCollection.AddHealthChecks' inside the call to 'ConfigureServices(...)' " +
            "in the application startup code.",
            ex.Message);
    }

    [Fact]
    public async Task MapHealthChecks_ReturnsOk()
    {
        // Arrange
        using var host = new HostBuilder()
            .ConfigureWebHost(webHostBuilder =>
            {
                webHostBuilder
                .UseTestServer()
                .Configure(app =>
                {
                    app.UseRouting();
                    app.UseEndpoints(endpoints =>
                    {
                        endpoints.MapHealthChecks("/healthz");
                    });
                })
                .ConfigureServices(services =>
                {
                    services.AddRouting();
                    services.AddHealthChecks();
                });
            }).Build();

        await host.StartAsync();

        var server = host.GetTestServer();
        var client = server.CreateClient();

        // Act
        var response = await client.GetAsync("/healthz");

        // Assert
        Assert.Equal(HttpStatusCode.OK, response.StatusCode);
        Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString());
        Assert.Equal("Healthy", await response.Content.ReadAsStringAsync());
    }

    [Fact]
    public async Task MapHealthChecks_WithOptions_ReturnsOk()
    {
        // Arrange
        using var host = new HostBuilder()
            .ConfigureWebHost(webHostBuilder =>
            {
                webHostBuilder
                .UseTestServer()
                .Configure(app =>
                {
                    app.UseRouting();
                    app.UseEndpoints(endpoints =>
                    {
                        endpoints.MapHealthChecks("/healthz", new HealthCheckOptions
                        {
                            ResponseWriter = async (context, report) =>
                            {
                                context.Response.ContentType = "text/plain";
                                await context.Response.WriteAsync("Custom!");
                            }
                        });
                    });
                })
                .ConfigureServices(services =>
                {
                    services.AddRouting();
                    services.AddHealthChecks();
                });
            }).Build();

        await host.StartAsync();

        var server = host.GetTestServer();
        var client = server.CreateClient();

        // Act
        var response = await client.GetAsync("/healthz");

        // Assert
        Assert.Equal(HttpStatusCode.OK, response.StatusCode);
        Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString());
        Assert.Equal("Custom!", await response.Content.ReadAsStringAsync());
    }
}


text:
<code_scheme name="avast-android">
  <option name="OTHER_INDENT_OPTIONS">
    <value>
      <option name="INDENT_SIZE" value="4" />
      <option name="CONTINUATION_INDENT_SIZE" value="4" />
      <option name="TAB_SIZE" value="4" />
      <option name="USE_TAB_CHARACTER" value="false" />
      <option name="SMART_TABS" value="true" />
      <option name="LABEL_INDENT_SIZE" value="0" />
      <option name="LABEL_INDENT_ABSOLUTE" value="false" />
      <option name="USE_RELATIVE_INDENTS" value="false" />
    </value>
  </option>
  <option name="LINE_SEPARATOR" value="
" />
  <option name="FIELD_NAME_PREFIX" value="m" />
  <option name="STATIC_FIELD_NAME_PREFIX" value="s" />
  <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
    <value />
  </option>
  <option name="IMPORT_LAYOUT_TABLE">
    <value>
      <package name="java" withSubpackages="true" static="false" />
      <package name="javax" withSubpackages="true" static="false" />
      <emptyLine />
      <package name="android" withSubpackages="true" static="false" />
      <emptyLine />
      <package name="" withSubpackages="true" static="false" />
      <emptyLine />
      <package name="com.avast" withSubpackages="true" static="false" />
      <package name="eu.inmite" withSubpackages="true" static="false" />
      <emptyLine />
      <package name="" withSubpackages="true" static="true" />
      <emptyLine />
    </value>
  </option>
  <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
  <AndroidXmlCodeStyleSettings>
    <option name="USE_CUSTOM_SETTINGS" value="true" />
  </AndroidXmlCodeStyleSettings>
  <Objective-C-extensions>
    <option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" />
    <option name="RELEASE_STYLE" value="IVAR" />
    <option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" />
    <file>
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
    </file>
    <class>
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
      <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
    </class>
    <extensions>
      <pair source="cpp" header="h" />
      <pair source="c" header="h" />
    </extensions>
  </Objective-C-extensions>
  <XML>
    <option name="XML_ATTRIBUTE_WRAP" value="2" />
    <option name="XML_TEXT_WRAP" value="0" />
    <option name="XML_KEEP_LINE_BREAKS" value="false" />
    <option name="XML_ALIGN_ATTRIBUTES" value="false" />
    <option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
    <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
  </XML>
  <codeStyleSettings language="HTML">
    <indentOptions>
      <option name="CONTINUATION_INDENT_SIZE" value="4" />
      <option name="SMART_TABS" value="true" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="JAVA">
    <option name="FIELD_ANNOTATION_WRAP" value="1" />
    <indentOptions>
      <option name="CONTINUATION_INDENT_SIZE" value="4" />
      <option name="SMART_TABS" value="true" />
    </indentOptions>
  </codeStyleSettings>
  <codeStyleSettings language="XML">
    <indentOptions>
      <option name="CONTINUATION_INDENT_SIZE" value="4" />
      <option name="SMART_TABS" value="true" />
    </indentOptions>
    <arrangement>
      <rules>

          <rule>
            <match>
              <AND>
                <NAME>xmlns:android</NAME>
                <XML_NAMESPACE>Namespace:</XML_NAMESPACE>
              </AND>
            </match>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>xmlns:.*</NAME>
                <XML_NAMESPACE>Namespace:</XML_NAMESPACE>
              </AND>
            </match>
            <order>BY_NAME</order>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*:id</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*:name</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>name</NAME>
                <XML_NAMESPACE>^$</XML_NAMESPACE>
              </AND>
            </match>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>style</NAME>
                <XML_NAMESPACE>^$</XML_NAMESPACE>
              </AND>
            </match>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*</NAME>
                <XML_NAMESPACE>^$</XML_NAMESPACE>
              </AND>
            </match>
            <order>BY_NAME</order>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*:layout_width</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*:layout_height</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*:layout_.*</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
            <order>BY_NAME</order>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*:width</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
            <order>BY_NAME</order>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*:height</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
            <order>BY_NAME</order>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*</NAME>
                <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
              </AND>
            </match>
            <order>BY_NAME</order>
          </rule>

          <rule>
            <match>
              <AND>
                <NAME>.*</NAME>
                <XML_NAMESPACE>.*</XML_NAMESPACE>
              </AND>
            </match>
            <order>BY_NAME</order>
          </rule>

      </rules>
    </arrangement>
  </codeStyleSettings>
</code_scheme>


text:
using System.Collections.Generic;
using XenAdmin.Core;
using XenAPI;

namespace XenAdmin.Actions
{
    public class AddRemoveRolesAction : PureAsyncAction
    {
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        private readonly List<Role> toAdd;
        private readonly List<Role> toRemove;
        private readonly Subject subject;

        public AddRemoveRolesAction(
            Pool pool,
            Subject subject,
            List<Role> toAdd,
            List<Role> toRemove)
        : base(
            pool.Connection,
            string.Format(Messages.AD_ADDING_REMOVING_ROLES_ON, (subject.DisplayName ?? subject.SubjectName ?? subject.subject_identifier).Ellipsise(50)),
            Messages.AD_ADDING_REMOVING_ROLES,
            false)
        {
            this.Pool = pool;
            this.toAdd = toAdd;
            this.toRemove = toRemove;
            this.subject = subject;
        }

        protected override void Run()
        {
            int count = toAdd.Count + toRemove.Count;
            int done = 0;
            log.DebugFormat("Adding {0} roles on subject '{1}'", toAdd.Count, (subject.DisplayName ?? subject.SubjectName ?? subject.subject_identifier).Ellipsise(50));
            foreach (Role r in toAdd)
            {
                Subject.add_to_roles(Session, subject.opaque_ref, r.opaque_ref);
                done++;
                PercentComplete = (100 * done) / count;
            }

            log.DebugFormat("Removing {0} roles on subject '{1}'", toRemove.Count, (subject.DisplayName ?? subject.SubjectName ?? subject.subject_identifier).Ellipsise(50));
            foreach (Role r in toRemove)
            {
                Subject.remove_from_roles(Session, subject.opaque_ref, r.opaque_ref);
                done++;
                PercentComplete = (100 * done) / count;
            }
            Description = Messages.COMPLETED;
        }
    }
}


text:
/*!
 * Customization file for Fusion Table Mobile Templates
 * See maps_lib.js for license and repository
 *
 * REPLACE THE SETTINGS BELOW TO REFER TO YOUR OWN DATA.
 * COLUMN NAMES ARE CASE-SENSITIVE!
 *
 * Required:
 * 1. Fusion Table IDs
 *
 * Overrides (optional):
 * 2. Search Settings
 *     - Default is a field for every column if you don't set this
 * 3. Custom Content
 *     - Title
 *     - About Page
 *     - Infobox (popup when you click on a location)
 * 4. Map Preferences
 *     - How It Should Use Your Nearby Location
 */

var MapsLib = MapsLib || {}; MapsLib.schemaVersion = 2;

    /////////////////////////
    // 1. FUSION TABLE IDs //
    /////////////////////////

    // Using v1 Fusion Tables API
    // See https://developers.google.com/fusiontables/docs/v1/migration_guide for more info

    // The encrypted Table ID of your Fusion Table (found under File => About)
    MapsLib.fusionTableId = "1GBiESlYt_Lc9O5PLuLaii1L74HeY7G4O1fMh9OE";

    // *New Fusion Tables Requirement* API key. found at https://code.google.com/apis/console/
    // *Important* this key is for demonstration purposes. please register your own.
    MapsLib.googleApiKey ="AIzaSyAMVBSXes-6P-gWaxRj20GK8NT6WDVpozM";

    // YOU CAN DELETE EVERYTHING AFTER THIS POINT AND STILL HAVE A WORKING APP. //
    // EVERYTHING BELOW IS CUSTOM OVERRIDES TO MAKE YOUR APP EVEN MORE AWESOME. //

$.extend(MapsLib, {

    ////////////////////////
    // 2. SEARCH SETTINGS //
    ////////////////////////

    // By default, you will get a text or range field for each column in your table.
    // However, you can customize search settings using the following attributes:
    //
    //  - allColumns (default=true):             a text field will appear for each column.
    //
    //  - allColumnsExactMatch (default=false):  allColumns + exact matching of fields.
    //
    //  - addressShow (default=true):            show address field for centering search
    //
    //  - addressAutocomplete:                   autocomplete options for address field (set to false if you don't want autocomplete)
    //     - country (default="US"):             restrict autocomplete to search within said country (2-character country code)
    //     - useDefaultMapBounds (default=true): addresses within defaultMapBounds (see section 4) will be prioritized to the top of autocomplete results
    //
    //  - distanceFilter: drop-down for restricting search results by distance to address (or nearby).  Comment this out to have no such drop-down.
    //     - filterSearchResults (default=true): limit search results to those within distance
    //     - filterListResults (default=true):   limit list results to those within distance (otherwise they're just ordered nearest-first)
    //     - entries:                            array of drop-down entries for distance from address.  Each entry is an array of:
    //          1. drop-down text
    //          2. radius length as "X miles" or "X meters" if the drop-down text wasn't already in this format.
    //          3. true if this is the default selection
    //       - You can specify "0" for radius length to not filter by distance, and leave zoom as-is.
    //
    //
    //  - columns: array of search fields.  Each field has a type, and additional attributes that depend on the type:
    //
    //      type: "text"
    //       - label
    //       - column: name of column
    //       - exact_match (default=false): look for exact match instead of a contains match
    //
    //      type: "slider" (default for numbers and dates, automatically gets minimum and maximum values)
    //       - label
    //       - column: name of column
    //
    //      type: "checkbox"
    //       - label
    //       - is_checked (default=false): start out as checked
    //       - unchecked_query: filter to this Fusion Table SQL-style WHERE clause when unchecked
    //       - checked_query: filter to this Fusion Table SQL-style WHERE clause when checked
    //
    //      type: "dropdown"
    //       - label
    //       - entries: array of drop-down entries.  Each entry is an array of:
    //          1. drop-down text
    //          2. Fusion Table SQL-style WHERE clause (overrides template)
    //             - see https://developers.google.com/fusiontables/docs/v1/sql-reference for Fusion Table-friendly WHERE clauses
    //          3. true if this is the default selection
    //       - template (optional): template for WHERE clause, using {text} to insert drop-down text
    //          NOTE: if you use a template, a drop-down entry can be just the drop-down text instead of an array.
    //       - foreach (optional): populates drop-down with an entry for each unique value of the specified column
    //          NOTE: if you use foreach, you can still add entries under options (they will appear at the top of the dropdown).
    //
    //  If "allColumns" is true, "text" and "slider" columns will simply override label/match settings for the specified columns
    //  Text fields for numerical columns use exact match only.  (If you want range categories, create a drop-down)

    searchPage: {
        allColumns: false,
        distanceFilter: {
            entries: [ ["Anywhere", "0", true], ["2 miles"], ["8 miles"], ["100 miles"], ["500 miles"] ]
        },
        columns: [
            { label: "Organization Type", type: "dropdown", foreach: "Grantee Organization Type Description",
                entries: [
                    ["Any", "", true],
                ],
             },
            { label: "Name", type: "text", column: "Name" }
        ]
    },

    ///////////////////////
    // 3. CUSTOM CONTENT //
    ///////////////////////

    // Title bar (including title of website)
    title: "U.S. Health Centers",

    // Contents of the About Page.  You can use "{title}" to insert your title.
    aboutPage: " \

About {title}
 \

This is a demonstration of a Mobile Template using Fusion Tables.    Developed by SF Brigade for Code For America, it's an adaptation of Derek Eder's searchable Fusion Table template, licensed under the MIT License.    This particular application uses data from the HRSA.
 \

To use this template for your own Fusion Table data, clone this repository and replace the fields inside fusiontable_settings.js to match your content.
 \
        ",

    // If you already customized your marker styles and infoboxes within the Fusion Table,
    // you can use them by setting the style and template IDs here.
    // (You can find your IDs inside the link generated by the 'Publish' option in Fusion Tables.)
    // (for more details, see https://developers.google.com/fusiontables/docs/v1/using#WorkingStyles)
    //styleId: 2,
    //templateId: 3,

    // This will go in your style block.  Useful if customizing your infoboxes.
    customCSS: " \
        .infobox-header, .ui-li-desc, #entity-text { font-family: Arial, Helvetica, Geneva, sans-serif; white-space:normal;} \
        .infobox-subheader { padding-top: 5px; } \
        .infobox-map { width:220px; } \
        .infobox-header { display:inline; padding-right: 10px; } \
        .moreinfo { margin-left:7px; min-width:18px; position:absolute; \
                top:45%; bottom:45%; min-height:18px; } \
        .entity { float:left; font-size:medium; padding:5px; border:1px solid black; margin:2px 7px 5px 0px; } \
        .entity.blue_box { display: none; background-color: #0060ed; color: white; } \
        .entity.red_box { display: none; background-color: #fb6155; color: white; } \
        .entity.orange_box { background-color: #ff9c00; color: white; } \
        .entity.blue_box.Government { display: inherit; } \
        .entity.red_box.Corporate { display: inherit; } \
        .entity.orange_box.Government { display: none; } \
        .entity.orange_box.Corporate { display: none; } \
    ",

    // customInfoboxHtml can be defined as a string or a function:
    //    STRING:    You can embed Handlebars expressions and variables.
    //    FUNCTION:  Returns an HTML string and takes two params: row and isListView
    //    "":        No infobox.
    //    Default (leaving it undefined): falls back on the infobox format from Fusion Table
    //
    //    In either case, the variables are defined as follows:
    //    - row.COLUMN_NAME, returns value for given column in your FusionTable row
    //        - Note: COLUMN_NAME has periods omitted, and spaces replaced with underscores
    //        - Example: to get the value from the "U.S. Entity Type" column, use row.US_Entity_Type
    //    - isListView, which evaluates to:
    //        - false when populating a map infobox
    //        - true when populating a row in the "List" view

    // delimitedColumns (optional): specify delimiter per column, and row.COLUMN_NAME will return an array
    //delimitedColumns: {"Resources": ";"},

    // listViewSortByColumn (optional): specify column to sort by, instead of sorting by distance
    //                                  append "DESC" to sort in reverse
    //listViewSortByColumn: "Name",

    customInfoboxHtml: ' \
        {{#if isListView}} \

 \
        {{else}} \

 \
        {{/if}} \

.gov
 \

.com
 \

.org
 \

{{row.Name}}
 \
        {{#if isListView}} \

 \
            {{row.Grantee_Organization_Type_Description}}
 \
            {{row.Address}}
 \
        {{else}} \

 \
            {{row.Grantee_Organization_Type_Description}}
 \
            {{row.Address}}
 \
            {{#if row.URL}} \
                {{row.URL}}
 \
            {{/if}} \
            {{row.Telephone_Number}}
 \
        {{/if}} \

',

    // Infoboxes will also appear (unless blank) on your nearby or search address pins.
    // HTML is OK.  Use "{address}" to denote the entered address for addressPinInfobox.
    nearbyPinInfobox: "You are here.",
    addressPinInfobox: "{address}",

    ////////////////////////
    // 4. MAP PREFERENCES //
    ////////////////////////

    // Override the location column in your Fusion Table (useful if you have multiple columns)
    // NOTE: if you have "latitude" and "longitude" columns, just use "latitude"
    //locationColumn:  "Address",

    // Bounds and center that your map defaults to when location services are off.
    // If useDefaultMapBounds is true (see section 2), this also determines which addresses get priority with autocomplete
    defaultMapBounds: {

        // Use [latitude, longitude] or address
        center: "United States",

        // "X miles" or "X meters"
        radius: "1500 miles"
    },

    // Set useNearbyLocation to false if you don't want to get the user's location.
    useNearbyLocation: {
        startAtNearbyLocation:      true,

        // If true: use nearby location only if we're within default map bounds
        //          otherwise, post boundsExceededMessage (if non-empty) and use mapDefaultCenter.
        onlyWithinDefaultMapBounds: true,
        boundsExceededMessage:      "You're currently outside the continental United States.    Defaulting to geographical center.",

        // use this zoom radius if starting at nearby location
        nearbyZoomRadius:           "32 miles",

        // Snap to nearby zoom radius when user hits "Nearby"?    Options are:
        // true              = always snap to zoom level
        // false (default)   = never snap to zoom level
        // int               = snap to zoom level if ratio between current and nearby zoom radii
        //                       is greater than this (in either direction)
        snapToNearbyZoomIfRatioGreaterThan: 8
    },

    // mapOverlays is an array of overlays, where each overlay can be either of the following:
    // A. a FusionTable ID
    // B. an entry with the following attributes (representing a "ground overlay"):
    //       - imageURL: url to the image to overlay on the map
    //       - cornerNW: [latitude, longitude] of the overlay's NW corner
    //       - cornerSE: [latitude, longitude] of the overlay's SE corner
    //       - opacityPercent (default = 50):
    //            0 = completely invisible
    //            100 = completely opaque

    // mapOverlays: []

    // If needed, you can change the visibility of these layers by calling this in script:
    //    MapsLib.setLayerVisibility([array of indices from bottom to top])
    // Examples:
    //    MapsLib.setLayerVisibility([0,2]) will show only the first and third layers, and the third layer will be on top.
    //    MapsLib.setLayerVisibility([]) will hide all layers

});


text:
layout: publication
title: "Mass Cytometry Marker Panel Extension"
key: 2017_ksomics_tamim
type: poster
shortname:
image:
image_large:

authors:
- abdelaal
- mahfouz
- hollt
- vanunen
- koning
- lelieveldt
- reinders

journal: Poster Presentation, Keystone Symposia on Molecular and Cellular Biology; Single Cell Omics, Stockholm, Swe
jourunal-short:
page_start:
page_end:
volume:
issue:
year: 2017
award:

doi:
pdf: 2017_ksomics_tamim.pdf
poster:
video:

code:

abstract: "High-dimensional mass cytometry (CyTOF) permits the simultaneous measurement of many cellular markers, providing a system-wide view of immune phenotypes at the single-cell level1. Yet, the maximum number of markers that can be measure simultaneously is limited to ~50 due to several technical challenges. We propose a new method to integrate CyTOF data from several marker panels that include an overlapping set of markers, allowing for a deeper interrogation of the cellular composition of the immune system."

---


text:
<?php
	declare(strict_types=1);

	namespace Framework\Syscrack\Game\Computers;

	/**
	 * Lewis Lancaster 2017
	 *
	 * Class Download
	 *
	 * @package Framework\Syscrack\Game\Computers
	 */
	class Download extends Npc
	{

		/**
		 * Npc constructor.
		 */

		public function __construct()
		{

			parent::__construct();
		}

		/**
		 * The configuration of this computer
		 *
		 * @return array
		 */

		public function configuration()
		{

			return [
				'installable'   => false,
				'type'          => 'download',
				'data'          => true,
				'reloadable'    => true
			];
		}

		/**
		 * @param $computerid
		 * @param $userid
		 *
		 * @return array
		 */

		public function data($computerid, $userid)
		{

			return( ["downloads" => self::$software->getAnonDownloads( $computerid ) ]);
		}
	}


text:
author: robmyers
comments: true
date: 2009-02-25 18:33:14+00:00
layout: post
slug: freeing-users-not-copying-innovation
title: Freeing Users Not Copying Innovation
wordpress_id: 1732
categories:
- Free Culture
---

A complaint I read occasionally in opinion pieces is that Open Source (sic) software tends to just be copies of innovative new commercial software (sic).

This is another example of how "Open Source" leads people's thinking astray.

Free Software is not motivated by the desire to copy software of any kind. It is concerned with the freedom of individuals to use that software. If an "innovative" new piece of software is released that does not respect the freedom of its users and if that software becomes popular then it becomes important to produce an alternative that does respect users' freedom.

This is not copying software because Open Source can't innovate, it is producing a Free Software alternative because "innovators" don't respect freedom often enough.

Rather than demanding that Open Source software "innovate", demand that "innovators" produce Free Software and respect their users' rights.


text:
import React from 'react';
import { isArray } from 'lodash';
import { FormattedMessage } from 'react-intl';

export default function ErrorMessages(props) {
  if (!props.errors) return null;
  const { errors } = props;
  const name = props.name || (
    <FormattedMessage id="errors.this_field" defaultMessage="This field" />
  );
  let message = '';

  if (isArray(errors)) {
    message = errors
      .map((error, i) => (

          {error}

      ))
      .reduce((prev, curr) => [prev, ', ', curr]);
  } else {
    message = {errors};
  }

  return (

        {name} {message}.

  );
}