text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class InvalidRangeException<T> : ApplicationException
{
    private T min;
    private T max;

    public T Min
    {
        get { return this.min; }
        set { this.min = value; }
    }
    public T Max
    {
        get { return this.max; }
        set { this.max = value; }
    }

    public InvalidRangeException(T min, T max)
    {
        this.Min = min;
        this.Max = max;
    }

    public override string Message
    {
        get
        {
            string result = string.Format("The value is out of the range {0} - {1}", this.Min, this.Max);
            return result;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="A clientel management website for Judy's Speech">
    <meta name="author" content="Scott C. Lewis">

    <title>Client Manager</title>

    <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">

    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">

    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target=".navbar-collapse">
					Toggle navigation
				</button>
				Client Manager

										Task 1 40%
											Complete

											40% Complete (success)

 See
									All Tasks

									 New Comment 4 minutes ago

 See
									All Alerts

 User
								Profile

 Settings

								Logout

								<input type="text" class="form-control" placeholder="Search...">

									<button class="btn btn-default" type="button">

									</button>

								Schedule

								Clients

								Sessions

								Finances

 Overview

 Income

 Bills

								Statistics

 Overview

 Clients

 Sessions

								Notes

								To-Do

Forms

                            Basic Form Elements

                                    <form role="form">

                                            Text Input
                                            <input class="form-control">

Example block-level help text here.

                                            Text Input with Placeholder
                                            <input class="form-control" placeholder="Enter text">

                                            Static Control

email@example.com

                                            File input
                                            <input type="file">

                                            Text area
                                            <textarea class="form-control" rows="3"></textarea>

                                            Checkboxes

                                                    <input type="checkbox" value="">Checkbox 1

                                                    <input type="checkbox" value="">Checkbox 2

                                                    <input type="checkbox" value="">Checkbox 3

                                            Inline Checkboxes

                                                <input type="checkbox">1

                                                <input type="checkbox">2

                                                <input type="checkbox">3

                                            Radio Buttons

                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>Radio 1

                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">Radio 2

                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="option3">Radio 3

                                            Inline Radio Buttons

                                                <input type="radio" name="optionsRadiosInline" id="optionsRadiosInline1" value="option1" checked>1

                                                <input type="radio" name="optionsRadiosInline" id="optionsRadiosInline2" value="option2">2

                                                <input type="radio" name="optionsRadiosInline" id="optionsRadiosInline3" value="option3">3

                                            Selects
                                            <select class="form-control">
                                                <option>1</option>
                                                <option>2</option>
                                                <option>3</option>
                                                <option>4</option>
                                                <option>5</option>
                                            </select>

                                            Multiple Selects
                                            <select multiple class="form-control">
                                                <option>1</option>
                                                <option>2</option>
                                                <option>3</option>
                                                <option>4</option>
                                                <option>5</option>
                                            </select>

                                        <button type="submit" class="btn btn-default">Submit Button</button>
                                        <button type="reset" class="btn btn-default">Reset Button</button>
                                    </form>

Disabled Form States

                                    <form role="form">
                                        <fieldset disabled>

                                                Disabled input
                                                <input class="form-control" id="disabledInput" type="text" placeholder="Disabled input" disabled>

                                                Disabled select menu
                                                <select id="disabledSelect" class="form-control">
                                                    <option>Disabled select</option>
                                                </select>

                                                    <input type="checkbox">Disabled Checkbox

                                            <button type="submit" class="btn btn-primary">Disabled Button</button>
                                        </fieldset>
                                    </form>

Form Validation States

                                    <form role="form">

                                            Input with success
                                            <input type="text" class="form-control" id="inputSuccess">

                                            Input with warning
                                            <input type="text" class="form-control" id="inputWarning">

                                            Input with error
                                            <input type="text" class="form-control" id="inputError">

                                    </form>

Input Groups

                                    <form role="form">

                                            @
                                            <input type="text" class="form-control" placeholder="Username">

                                            <input type="text" class="form-control">
                                            .00

                                            <input type="text" class="form-control" placeholder="Font Awesome Icon">

                                            $
                                            <input type="text" class="form-control">
                                            .00

                                            <input type="text" class="form-control">

                                                <button class="btn btn-default" type="button">
                                                </button>

                                    </form>

redpajama_set_name: RedPajamaGithub


text:
package com.epam.ta.reportportal.core.events.activity;

import com.epam.ta.reportportal.core.events.ActivityEvent;
import com.epam.ta.reportportal.entity.activity.Activity;
import com.epam.ta.reportportal.ws.converter.builders.ActivityBuilder;
import com.epam.ta.reportportal.ws.model.activity.PatternTemplateActivityResource;

import static com.epam.ta.reportportal.entity.activity.Activity.ActivityEntityType.PATTERN;
import static com.epam.ta.reportportal.entity.activity.ActivityAction.CREATE_PATTERN;

/**
 * @author Ivan Budayeu
 */
public class PatternCreatedEvent extends AbstractEvent implements ActivityEvent {

	private PatternTemplateActivityResource patternTemplateActivityResource;

	public PatternCreatedEvent() {
	}

	public PatternCreatedEvent(Long userId, String userLogin, PatternTemplateActivityResource patternTemplateActivityResource) {
		super(userId, userLogin);
		this.patternTemplateActivityResource = patternTemplateActivityResource;
	}

	public PatternTemplateActivityResource getPatternTemplateActivityResource() {
		return patternTemplateActivityResource;
	}

	public void setPatternTemplateActivityResource(PatternTemplateActivityResource patternTemplateActivityResource) {
		this.patternTemplateActivityResource = patternTemplateActivityResource;
	}

	@Override
	public Activity toActivity() {
		return new ActivityBuilder().addCreatedNow()
				.addActivityEntityType(PATTERN)
				.addAction(CREATE_PATTERN)
				.addObjectId(patternTemplateActivityResource.getId())
				.addObjectName(patternTemplateActivityResource.getName())
				.addProjectId(patternTemplateActivityResource.getProjectId())
				.addUserId(getUserId())
				.addUserName(getUserLogin())
				.get();
	}
}


text:
import java.util.Scanner;

public class p05_SquareFrame {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        int n = Integer.parseInt(console.nextLine());

        System.out.print("+");
        System.out.print(repeatStr(" -", n - 2));
        System.out.println(" +");

        for (int i = 0; i < n - 2; i++) {
            System.out.print("|");
            System.out.print(repeatStr(" -", n - 2));
            System.out.println(" |");
        }
        System.out.print("+");
        System.out.print(repeatStr(" -", n - 2));
        System.out.println(" +");

    }
    static StringBuilder repeatStr(String text, int count) {
        StringBuilder result = new StringBuilder();

        for (int i = 0; i < count; i++) {
            result.append(text);
        }
        return result;
    }
}


text:
include(AddLLVM)
include(LLVMExternalProjectUtils)

function(llvm_create_cross_target project_name target_name toolchain buildtype)

  if(NOT DEFINED ${project_name}_${target_name}_BUILD)
    set(${project_name}_${target_name}_BUILD
      "${CMAKE_CURRENT_BINARY_DIR}/${target_name}")
    set(${project_name}_${target_name}_BUILD
      ${${project_name}_${target_name}_BUILD} PARENT_SCOPE)
    message(STATUS "Setting native build dir to " ${${project_name}_${target_name}_BUILD})
  endif(NOT DEFINED ${project_name}_${target_name}_BUILD)

  if (EXISTS ${LLVM_MAIN_SRC_DIR}/cmake/platforms/${toolchain}.cmake)
    set(CROSS_TOOLCHAIN_FLAGS_INIT
      -DCMAKE_TOOLCHAIN_FILE=\"${LLVM_MAIN_SRC_DIR}/cmake/platforms/${toolchain}.cmake\")
  else()
    set(CROSS_TOOLCHAIN_FLAGS_INIT
      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
      )
  endif()
  set(CROSS_TOOLCHAIN_FLAGS_${target_name} ${CROSS_TOOLCHAIN_FLAGS_INIT}
    CACHE STRING "Toolchain configuration for ${target_name}")

  # project specific version of the flags up above
  set(CROSS_TOOLCHAIN_FLAGS_${project_name}_${target_name} ""
    CACHE STRING "Toolchain configuration for ${Pproject_name}_${target_name}")

  if (buildtype)
    set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
  endif()
  if (LLVM_USE_LINKER AND NOT CMAKE_CROSSCOMPILING)
    set(linker_flag "-DLLVM_USE_LINKER=${LLVM_USE_LINKER}")
  endif()
  if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
    # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
    set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
  endif()

  add_custom_command(OUTPUT ${${project_name}_${target_name}_BUILD}
    COMMAND ${CMAKE_COMMAND} -E make_directory ${${project_name}_${target_name}_BUILD}
    COMMENT "Creating ${${project_name}_${target_name}_BUILD}...")

  add_custom_target(CREATE_${project_name}_${target_name}
    DEPENDS ${${project_name}_${target_name}_BUILD})

  # Escape semicolons in the targets list so that cmake doesn't expand
  # them to spaces.
  string(REPLACE ";" "$<SEMICOLON>" targets_to_build_arg
         "${LLVM_TARGETS_TO_BUILD}")
  string(REPLACE ";" "$<SEMICOLON>" experimental_targets_to_build_arg
         "${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}")

  string(REPLACE ";" "$<SEMICOLON>" llvm_enable_projects_arg
         "${LLVM_ENABLE_PROJECTS}")
  string(REPLACE ";" "$<SEMICOLON>" llvm_external_projects_arg
         "${LLVM_EXTERNAL_PROJECTS}")

  set(external_project_source_dirs)
  foreach(project ${LLVM_EXTERNAL_PROJECTS})
    canonicalize_tool_name(${project} name)
    list(APPEND external_project_source_dirs
         "-DLLVM_EXTERNAL_${name}_SOURCE_DIR=${LLVM_EXTERNAL_${name}_SOURCE_DIR}")
  endforeach()

  add_custom_command(OUTPUT ${${project_name}_${target_name}_BUILD}/CMakeCache.txt
    COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
        -DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
        ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_CURRENT_SOURCE_DIR}
        ${CROSS_TOOLCHAIN_FLAGS_${project_name}_${target_name}}
        -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
        -DLLVM_TARGETS_TO_BUILD="${targets_to_build_arg}"
        -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${experimental_targets_to_build_arg}"
        -DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET_TRIPLE}"
        -DLLVM_TARGET_ARCH="${LLVM_TARGET_ARCH}"
        -DLLVM_ENABLE_PROJECTS="${llvm_enable_projects_arg}"
        -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}"
        ${external_project_source_dirs}
        -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
        ${build_type_flags} ${linker_flag} ${external_clang_dir}
        ${ARGN}
    WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}
    DEPENDS CREATE_${project_name}_${target_name}
    COMMENT "Configuring ${target_name} ${project_name}...")

  add_custom_target(CONFIGURE_${project_name}_${target_name}
    DEPENDS ${${project_name}_${target_name}_BUILD}/CMakeCache.txt)

endfunction()

# Sets up a native build for a tool, used e.g. for cross-compilation and
# LLVM_OPTIMIZED_TABLEGEN. Always builds in Release.
# - target: The target to build natively
# - output_path_var: A variable name which receives the path to the built target
# - DEPENDS: Any additional dependencies for the target
function(build_native_tool target output_path_var)
  cmake_parse_arguments(ARG "" "" "DEPENDS" ${ARGN})

  if(CMAKE_CONFIGURATION_TYPES)
    set(output_path "${${PROJECT_NAME}_NATIVE_BUILD}/Release/bin/${target}")
  else()
    set(output_path "${${PROJECT_NAME}_NATIVE_BUILD}/bin/${target}")
  endif()

  llvm_ExternalProject_BuildCmd(build_cmd ${target} ${${PROJECT_NAME}_NATIVE_BUILD}
                                CONFIGURATION Release)
  add_custom_command(OUTPUT "${output_path}"
                     COMMAND ${build_cmd}
                     DEPENDS CONFIGURE_${PROJECT_NAME}_NATIVE ${ARG_DEPENDS}
                     WORKING_DIRECTORY "${${PROJECT_NAME}_NATIVE_BUILD}"
                     COMMENT "Building native ${target}..."
                     USES_TERMINAL)
  set(${output_path_var} "${output_path}" PARENT_SCOPE)
endfunction()


text:
package bnet

// ProfileService has OAuth Profile APIs. See Client.
type ProfileService struct {
	client *Client
}

// SC2Profile represents the profile information for a user's Starcraft 2 profile.
type SC2Profile struct {
	Characters []SC2Character `json:"characters"`
}

// SC2() calls the /sc2/profile/user endpoint. This endpoint uses OAuth2
// to retrieve a user's Starcraft 2 profile. See Battle.net docs.
func (s *ProfileService) SC2() (*SC2Profile, *Response, error) {
	req, err := s.client.NewRequest("GET", "sc2/profile/user", nil)
	if err != nil {
		return nil, nil, err
	}

	var profile SC2Profile
	resp, err := s.client.Do(req, &profile)
	if err != nil {
		return nil, resp, err
	}

	return &profile, resp, nil
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>ca.krasnay</groupId>
  <artifactId>javautils</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Utilities Library</name>
  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <dependencies>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>true</downloadJavadocs>
        </configuration>
      </plugin>

    </plugins>

  </build>

</project>


text:
#include "talk/base/gunit.h"
#include "talk/base/macutils.h"

TEST(MacUtilsTest, GetOsVersionName) {
  talk_base::MacOSVersionName ver = talk_base::GetOSVersionName();
  EXPECT_NE(talk_base::kMacOSUnknown, ver);
}

TEST(MacUtilsTest, GetQuickTimeVersion) {
  std::string version;
  EXPECT_TRUE(talk_base::GetQuickTimeVersion(&version));
}

TEST(MacUtilsTest, RunAppleScriptCompileError) {
  std::string script("set value to to 5");
  EXPECT_FALSE(talk_base::RunAppleScript(script));
}

TEST(MacUtilsTest, RunAppleScriptRuntimeError) {
  std::string script("set value to 5 / 0");
  EXPECT_FALSE(talk_base::RunAppleScript(script));
}

TEST(MacUtilsTest, RunAppleScriptSuccess) {
  std::string script("set value to 5");
  EXPECT_TRUE(talk_base::RunAppleScript(script));
}


text:
package batch

import (
	"github.com/watermint/toolbox/domain/dropbox/api/dbx_auth"
	"github.com/watermint/toolbox/domain/dropbox/api/dbx_conn"
	"github.com/watermint/toolbox/domain/dropbox/model/mo_group"
	"github.com/watermint/toolbox/domain/dropbox/service/sv_group"
	"github.com/watermint/toolbox/infra/control/app_control"
	"github.com/watermint/toolbox/infra/feed/fd_file"
	"github.com/watermint/toolbox/infra/recipe/rc_exec"
	"github.com/watermint/toolbox/infra/recipe/rc_recipe"
	"github.com/watermint/toolbox/infra/report/rp_model"
	"github.com/watermint/toolbox/infra/ui/app_msg"
	"github.com/watermint/toolbox/quality/infra/qt_file"
)

type GroupName struct {
	Name string `json:"name"`
}

type Delete struct {
	rc_recipe.RemarkIrreversible
	ErrGroupNotFound    app_msg.Message
	ErrUnableToDelete   app_msg.Message
	File                fd_file.RowFeed
	OperationLog        rp_model.TransactionReport
	Peer                dbx_conn.ConnScopedTeam
	ProgressDeleteGroup app_msg.Message
}

func (z *Delete) Exec(c app_control.Control) error {
	ui := c.UI()
	if err := z.OperationLog.Open(); err != nil {
		return err
	}

	svg := sv_group.New(z.Peer.Client())

	groups, err := svg.List()
	if err != nil {
		return err
	}
	groupByName := make(map[string]*mo_group.Group)
	for _, group := range groups {
		groupByName[group.GroupName] = group
	}

	return z.File.EachRow(func(m interface{}, rowIndex int) error {
		r := m.(*GroupName)
		ui.Info(z.ProgressDeleteGroup.With("Name", r.Name))

		group, ok := groupByName[r.Name]
		if !ok {
			ui.Error(z.ErrGroupNotFound.With("Name", r.Name))
			z.OperationLog.Failure(err, r)
			return nil
		}

		if err = svg.Remove(group.GroupId); err != nil {
			ui.Error(z.ErrUnableToDelete.With("Name", r.Name).With("Error", err.Error()))
			z.OperationLog.Failure(err, r)
			return nil
		}
		z.OperationLog.Success(r, group)
		return nil
	})
}

func (z *Delete) Test(c app_control.Control) error {
	return rc_exec.ExecMock(c, &Delete{}, func(r rc_recipe.Recipe) {
		tf, err := qt_file.MakeTestFile("group-batch-delete", "Marketing\nSales\n")
		if err != nil {
			return
		}
		m := r.(*Delete)
		m.File.SetFilePath(tf)
	})
}

func (z *Delete) Preset() {
	z.Peer.SetScopes(
		dbx_auth.ScopeGroupsWrite,
	)
	z.File.SetModel(&GroupName{})
	z.OperationLog.SetModel(&GroupName{}, &mo_group.Group{},
		rp_model.HiddenColumns(
			"result.group_id",
			"result.group_external_id",
		),
	)
}


text:
package org.keycloak.models.sessions.jpa;

import org.keycloak.models.ClientModel;
import org.keycloak.models.ClientSessionModel;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.RealmModel;
import org.keycloak.models.UserModel;
import org.keycloak.models.UserSessionModel;
import org.keycloak.models.sessions.jpa.entities.ClientSessionAuthStatusEntity;
import org.keycloak.models.sessions.jpa.entities.ClientSessionEntity;
import org.keycloak.models.sessions.jpa.entities.ClientSessionNoteEntity;
import org.keycloak.models.sessions.jpa.entities.ClientSessionProtocolMapperEntity;
import org.keycloak.models.sessions.jpa.entities.ClientSessionRoleEntity;
import org.keycloak.models.sessions.jpa.entities.ClientUserSessionNoteEntity;
import org.keycloak.models.sessions.jpa.entities.UserSessionEntity;

import javax.persistence.EntityManager;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * @author Stian Thorgersen
 */
public class ClientSessionAdapter implements ClientSessionModel {

    private KeycloakSession session;
    private ClientSessionEntity entity;
    private EntityManager em;
    private RealmModel realm;

    public ClientSessionAdapter(KeycloakSession session, EntityManager em, RealmModel realm, ClientSessionEntity entity) {
        this.session = session;
        this.em = em;
        this.realm = realm;
        this.entity = entity;
    }

    @Override
    public RealmModel getRealm() {
        return session.realms().getRealm(entity.getRealmId());
    }

    @Override
    public void setNote(String name, String value) {
        for (ClientSessionNoteEntity attr : entity.getNotes()) {
            if (attr.getName().equals(name)) {
                attr.setValue(value);
                return;
            }
        }
        ClientSessionNoteEntity attr = new ClientSessionNoteEntity();
        attr.setName(name);
        attr.setValue(value);
        attr.setClientSession(entity);
        em.persist(attr);
        entity.getNotes().add(attr);
    }

    @Override
    public void removeNote(String name) {
        Iterator<ClientSessionNoteEntity> it = entity.getNotes().iterator();
        while (it.hasNext()) {
            ClientSessionNoteEntity attr = it.next();
            if (attr.getName().equals(name)) {
                it.remove();
                em.remove(attr);
            }
        }
    }

    @Override
    public String getNote(String name) {
        for (ClientSessionNoteEntity attr : entity.getNotes()) {
            if (attr.getName().equals(name)) {
                return attr.getValue();
            }
        }
        return null;
    }

    @Override
    public Map<String, String> getNotes() {
        Map<String, String> copy = new HashMap<>();
        for (ClientSessionNoteEntity attr : entity.getNotes()) {
            copy.put(attr.getName(), attr.getValue());
        }

        return copy;
    }

    @Override
    public void setUserSessionNote(String name, String value) {
        for (ClientUserSessionNoteEntity attr : entity.getUserSessionNotes()) {
            if (attr.getName().equals(name)) {
                attr.setValue(value);
                return;
            }
        }
        ClientUserSessionNoteEntity attr = new ClientUserSessionNoteEntity();
        attr.setName(name);
        attr.setValue(value);
        attr.setClientSession(entity);
        em.persist(attr);
        entity.getUserSessionNotes().add(attr);

    }

    @Override
    public Map<String, String> getUserSessionNotes() {
        Map<String, String> copy = new HashMap<>();
        for (ClientUserSessionNoteEntity attr : entity.getUserSessionNotes()) {
            copy.put(attr.getName(), attr.getValue());
        }
        return copy;
    }

    @Override
    public void clearUserSessionNotes() {
        Iterator<ClientUserSessionNoteEntity> it = entity.getUserSessionNotes().iterator();
        while (it.hasNext()) {
            ClientUserSessionNoteEntity attr = it.next();
            it.remove();
            em.remove(attr);
        }

    }

    @Override
    public String getId() {
        return entity.getId();
    }

    @Override
    public ClientModel getClient() {
        return realm.getClientById(entity.getClientId());
    }

    public ClientSessionEntity getEntity() {
        return entity;
    }

    @Override
    public void setUserSession(UserSessionModel userSession) {
        if (userSession == null) {
            if (entity.getSession() != null) {
                entity.getSession().getClientSessions().remove(entity);
            }
            entity.setSession(null);
        } else {
            UserSessionAdapter adapter = (UserSessionAdapter) userSession;
            UserSessionEntity userSessionEntity = adapter.getEntity();
            entity.setSession(userSessionEntity);
            userSessionEntity.getClientSessions().add(entity);
        }
    }

    @Override
    public void setRedirectUri(String uri) {
       entity.setRedirectUri(uri);
    }

    @Override
    public void setRoles(Set<String> roles) {
        if (roles != null) {
            for (String r : roles) {
                ClientSessionRoleEntity roleEntity = new ClientSessionRoleEntity();
                roleEntity.setClientSession(entity);
                roleEntity.setRoleId(r);
                em.persist(roleEntity);

                entity.getRoles().add(roleEntity);
            }
        } else {
            if (entity.getRoles() != null) {
                for (ClientSessionRoleEntity r : entity.getRoles()) {
                    em.remove(r);
                }
                entity.getRoles().clear();
            }
        }
    }

    @Override
    public String getAuthMethod() {
        return entity.getAuthMethod();
    }

    @Override
    public void setAuthMethod(String method) {
        entity.setAuthMethod(method);
    }

    @Override
    public UserSessionModel getUserSession() {
        if (entity.getSession() == null) return null;
        return new UserSessionAdapter(session, em, realm, entity.getSession());
    }

    @Override
    public String getRedirectUri() {
        return entity.getRedirectUri();
    }

    @Override
    public int getTimestamp() {
        return entity.getTimestamp();
    }

    @Override
    public void setTimestamp(int timestamp) {
        entity.setTimestamp(timestamp);
    }

    @Override
    public String getAction() {
        return entity.getAction();
    }

    @Override
    public void setAction(String action) {
        entity.setAction(action);
    }

    @Override
    public Set<String> getRoles() {
        Set<String> roles = new HashSet<String>();
        if (entity.getRoles() != null) {
            for (ClientSessionRoleEntity e : entity.getRoles()) {
                roles.add(e.getRoleId());
            }
        }
        return roles;
    }

    @Override
    public Set<String> getProtocolMappers() {
        Set<String> protMappers = new HashSet<String>();
        if (entity.getProtocolMappers() != null) {
            for (ClientSessionProtocolMapperEntity e : entity.getProtocolMappers()) {
                protMappers.add(e.getProtocolMapperId());
            }
        }
        return protMappers;
    }

    @Override
    public void setProtocolMappers(Set<String> protocolMappers) {
        if (protocolMappers != null) {
            for (String pm : protocolMappers) {
                ClientSessionProtocolMapperEntity protMapperEntity = new ClientSessionProtocolMapperEntity();
                protMapperEntity.setClientSession(entity);
                protMapperEntity.setProtocolMapperId(pm);
                em.persist(protMapperEntity);

                entity.getProtocolMappers().add(protMapperEntity);
            }
        } else {
            if (entity.getProtocolMappers() != null) {
                for (ClientSessionProtocolMapperEntity pm : entity.getProtocolMappers()) {
                    em.remove(pm);
                }
                entity.getProtocolMappers().clear();
            }
        }
    }

    @Override
    public Map<String, ExecutionStatus> getExecutionStatus() {
        Map<String, ExecutionStatus> result = new HashMap<>();
        for (ClientSessionAuthStatusEntity status : entity.getAuthanticatorStatus()) {
            result.put(status.getAuthenticator(), status.getStatus());
        }
        return result;
    }

    @Override
    public void setExecutionStatus(String authenticator, ExecutionStatus status) {
        boolean exists = false;
        for (ClientSessionAuthStatusEntity authStatus : entity.getAuthanticatorStatus()) {
            if (authStatus.getAuthenticator().equals(authenticator)) {
                authStatus.setStatus(status);
                exists = true;
            }
        }

        if (!exists) {
            ClientSessionAuthStatusEntity authStatus = new ClientSessionAuthStatusEntity();
            authStatus.setAuthenticator(authenticator);
            authStatus.setClientSession(entity);
            authStatus.setStatus(status);
            em.persist(authStatus);
            entity.getAuthanticatorStatus().add(authStatus);
        }
        em.flush();

    }

    @Override
    public void clearExecutionStatus() {
        Iterator<ClientSessionAuthStatusEntity> iterator = entity.getAuthanticatorStatus().iterator();
        while (iterator.hasNext()) {
            ClientSessionAuthStatusEntity authStatus = iterator.next();
            iterator.remove();
            em.remove(authStatus);
        }
    }

    @Override
    public UserModel getAuthenticatedUser() {
        return entity.getUserId() == null ? null : session.users().getUserById(entity.getUserId(), realm);
    }

    @Override
    public void setAuthenticatedUser(UserModel user) {
        if (user == null) entity.setUserId(null);
        else entity.setUserId(user.getId());
    }
}


text:
class Vcloud
  module Compute
    module TestSupport

      if Fog.mocking?
        def self.template
          'mock_template'
        end
      else
        def self.template
          template_name = ENV['VCLOUD_TEMPLATE']
          raise "Specify VApp template name in VCLOUD_TEMPLATE env var" unless template_name
          template_res = Vcloud.catalogs.item_by_name template_name
          raise "URI Not found for specified template - check template name" unless template_res
          template_res.href
        end
      end

    end

    module Formats
    end

  end
end


text:
Provides check function for [`health`](http://npmjs.com/@maxdome/health) performing HTTP requests.

# Usage

```
app.get('/health', require('@maxdome/health').controller({
  example: require('@maxdome/health-got')('http://example.com/'),
}));
```

# Example response

```
{
  "example": {
    "method": "GET",
    "options": {
      "json": true
    },
    "status": "UP",
    "url": "http://example.com/"
  },
  "status": "UP"
}
```


text:
package org.datacontract.schemas._2004._07.EEN_Merlin_Backend_Core_BO_PODService;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for profileReferenceInput complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="profileReferenceInput">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="createdby" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="internal" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "profileReferenceInput", propOrder = {
    "createdby",
    "internal",
    "type"
})
public class ProfileReferenceInputType {

    @XmlElement(required = true, nillable = true)
    protected String createdby;
    @XmlElementRef(name = "internal", namespace = "http://schemas.datacontract.org/2004/07/EEN.Merlin.Backend.Core.BO.PODService", type = JAXBElement.class, required = false)
    protected JAXBElement<String> internal;
    @XmlElement(required = true, nillable = true)
    protected String type;

    /**
     * Gets the value of the createdby property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getCreatedby() {
        return createdby;
    }

    /**
     * Sets the value of the createdby property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setCreatedby(String value) {
        this.createdby = value;
    }

    /**
     * Gets the value of the internal property.
     *
     * @return
     *     possible object is
     *     {@link JAXBElement }{@code <}{@link String }{@code >}
     *
     */
    public JAXBElement<String> getInternal() {
        return internal;
    }

    /**
     * Sets the value of the internal property.
     *
     * @param value
     *     allowed object is
     *     {@link JAXBElement }{@code <}{@link String }{@code >}
     *
     */
    public void setInternal(JAXBElement<String> value) {
        this.internal = value;
    }

    /**
     * Gets the value of the type property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getType() {
        return type;
    }

    /**
     * Sets the value of the type property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setType(String value) {
        this.type = value;
    }

}


text:
@interface UIView (Color)
+ (UIView *)viewWithColor:(UIColor *)color;
@end


text:
// flow-typed signature: f1015b4058088a70464b6abe8b2ab82c
// flow-typed version: <<STUB>>/eslint-config-i-am-meticulous_v^11.0.0/flow_v0.87.0

/**
 * This is an autogenerated libdef stub for:
 *
 *   'eslint-config-i-am-meticulous'
 *
 * Fill this stub out by replacing all the `any` types.
 *
 * Once filled out, we encourage you to share your work with the
 * community by sending a pull request to:
 * https://github.com/flowtype/flow-typed
 */

declare module "eslint-config-i-am-meticulous" {
  declare module.exports: any;
}

/**
 * We include stubs for each file inside this npm package in case you need to
 * require those files directly. Feel free to delete any files that aren't
 * needed.
 */
declare module "eslint-config-i-am-meticulous/_flow-globals" {
  declare module.exports: any;
}

declare module "eslint-config-i-am-meticulous/ava" {
  declare module.exports: any;
}

declare module "eslint-config-i-am-meticulous/es5" {
  declare module.exports: any;
}

declare module "eslint-config-i-am-meticulous/flow" {
  declare module.exports: any;
}

declare module "eslint-config-i-am-meticulous/react-flow" {
  declare module.exports: any;
}

declare module "eslint-config-i-am-meticulous/react-native" {
  declare module.exports: any;
}

declare module "eslint-config-i-am-meticulous/react" {
  declare module.exports: any;
}

// Filename aliases
declare module "eslint-config-i-am-meticulous/_flow-globals.js" {
  declare module.exports: $Exports<
    "eslint-config-i-am-meticulous/_flow-globals",
  >;
}
declare module "eslint-config-i-am-meticulous/ava.js" {
  declare module.exports: $Exports<"eslint-config-i-am-meticulous/ava">;
}
declare module "eslint-config-i-am-meticulous/es5.js" {
  declare module.exports: $Exports<"eslint-config-i-am-meticulous/es5">;
}
declare module "eslint-config-i-am-meticulous/flow.js" {
  declare module.exports: $Exports<"eslint-config-i-am-meticulous/flow">;
}
declare module "eslint-config-i-am-meticulous/index" {
  declare module.exports: $Exports<"eslint-config-i-am-meticulous">;
}
declare module "eslint-config-i-am-meticulous/index.js" {
  declare module.exports: $Exports<"eslint-config-i-am-meticulous">;
}
declare module "eslint-config-i-am-meticulous/react-flow.js" {
  declare module.exports: $Exports<"eslint-config-i-am-meticulous/react-flow">;
}
declare module "eslint-config-i-am-meticulous/react-native.js" {
  declare module.exports: $Exports<
    "eslint-config-i-am-meticulous/react-native",
  >;
}
declare module "eslint-config-i-am-meticulous/react.js" {
  declare module.exports: $Exports<"eslint-config-i-am-meticulous/react">;
}


text:
/*
* 用于放置所有header信息的测试数据
*
*/

// Get 和 Post共有的header信息
/*eslint max-len: ["off"]*/
const CommonRequestHeader = {
  Accept: 'application/json;charset=utf-8,text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  'Accept-Charset': 'utf-8',
  'Accept-Encoding': 'gzip, deflate',
  'Accept-Language': 'zh-CN',
  'Accept-Datetime': 'Thu, 31 May 2007 20:35:00 GMT',
  Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==',
  'Cache-Control': 'no-cache',
  Connection: 'keep-alive',
  Cookie: 'testCookie1=cookie1; testCookie2=cookie2',
  'Content-Type': 'application/x-www-form-urlencoded',
  Date: 'Tue, 15 Nov 1994 08:12:31 GMT',
  Origin: 'http://localhost',
  Pragma: 'no-cache',
  some_thing: 'only_to_test_letter_case',
  'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'
};

module.exports = {
  CommonRequestHeader
};


text:
var should = require('chai').should();
var IndexSet = require('../src/indexset.js');

describe('IndexSet', function() {

    describe('new IndexSet()', function () {
        it('should create a set from a string rep', function () {
            var set = new IndexSet('1-2,5-10,11-14');
            set.count().should.equal(12);
        });
        it('should create a set from a string rep', function () {
            var set = new IndexSet('1-2');
            set.count().should.equal(2);
        });
        it('should create a set from a range', function () {
            var range = new IndexRange(23, 24);
            var set = new IndexSet(range);
            set.count().should.equal(2);
        });
        it('should create a set from indexes', function () {
            var set = new IndexSet([3, 4]);
            set.count().should.equal(2);
        });
        it('should create a set from emtpy array', function () {
            var set = new IndexSet([]);
            set.count().should.equal(0);
        });
    });

    describe('.fromString()', function () {
        it('should create a set from a string rep', function () {
            var set = IndexSet.fromString('1-2,5-10,11-14');
            set.count().should.equal(12);
        });
        it('should fail to create a set from an invalid string rep', function () {
            (function(){
                IndexSet.fromString('1-2,,5-10');
            }).should.throw(Error);
            (function(){
                IndexSet.fromString('A-2,5-10');
            }).should.throw(Error);
        });
    });

    describe('#addRanges()', function () {
        it('should add one range', function () {
            var range = new IndexRange(23, 24);
            var set = new IndexSet();
            set.addRanges(range);
            set.count().should.equal(2);
        });
        it('should add two ranges', function () {
            var range0 = new IndexRange(23, 24);
            var range1 = new IndexRange(37, 40);
            var set = new IndexSet();
            set.addRanges([range0, range1]);
            set.count().should.equal(6);
        });
    });

    describe('#removeRange()', function () {
        it('should remove one range', function () {
            var range = new IndexRange(23, 24);
            var set = new IndexSet();
            set.addRanges(range);
            set.count().should.equal(2);
            set.removeRange(range);
            set.count().should.equal(0);
        });
        it('should split a range in set', function () {
            var range0 = new IndexRange(0, 20);
            var range1 = new IndexRange(1, 19);
            var set = new IndexSet();
            set.addRanges(range0);
            set.count().should.equal(21);
            set.removeRange(range1);
            set.count().should.equal(2);
        });
    });

    describe('#addIndexes()', function () {
        it('should add an index as string', function () {
            var set = new IndexSet();
            set.addIndexes('1');
            set.count().should.equal(1);
        });
        it('should add an array of indexes as numbers', function () {
            var set = new IndexSet();
            set.addIndexes([0,1,2,3]);
            set.count().should.equal(4);
        });
        it('should add an array of indexes as strings', function () {
            var set = new IndexSet();
            set.addIndexes(['0','1','2','3']);
            set.count().should.equal(4);
        });
        it('should add an array non-contiguous indexes', function () {
            var set = new IndexSet();
            set.addIndexes([0, 1, 3, 4, 6]);
            set.count().should.equal(5);
        });
        it('should add a large array of indexes', function () {
            var idxs = [];
            for (var i=0; i<1000; i++) {
                idxs.push(i);
            }
            var set = new IndexSet();
            set.addIndexes(idxs);
            set.count().should.equal(1000);
        });
    });

    describe('#removeIndexes()', function () {
        it('should remove one index', function () {
            var range = new IndexRange(0, 9);
            var set = new IndexSet();
            set.addRanges(range);
            set.count().should.equal(10);
            set.removeIndexes(5);
            set.count().should.equal(9);
        });
        it('should remove two indexes', function () {
            var range = new IndexRange(1, 20);
            var set = new IndexSet();
            set.addRanges(range);
            set.count().should.equal(20);
            set.removeIndexes([4,8]);
            set.contains(4).should.equal(false);
            set.contains(8).should.equal(false);
        });
    });

    describe('#count()', function () {
        it('should return count', function () {
            var set = IndexSet.fromString('1-5,10-15');
            set.count().should.equal(11);
        });
    });

    describe('#indexAt()', function () {
        it('should return correct index at index', function () {
            var set = IndexSet.fromString('1-5,20-25,40-41');
            set.count().should.equal(13);
            set.indexAt(0).should.equal(1);
            set.indexAt(3).should.equal(4);
            set.indexAt(5).should.equal(20);
            set.indexAt(10).should.equal(25);
            set.indexAt(11).should.equal(40);
        });
    });

    describe('#firstIndex()', function () {
        it('should return first index', function () {
            var range = new IndexRange(3, 9);
            var set = new IndexSet();
            set.addRanges(range);
            set.firstIndex().should.equal(3);
        });
        it('should return undefined', function () {
            var set = new IndexSet();
            (typeof set.firstIndex()).should.equal('undefined');
        });
    });

    describe('#lastIndex()', function () {
        it('should return last index', function () {
            var range = new IndexRange(3, 9);
            var set = new IndexSet();
            set.addRanges(range);
            set.lastIndex().should.equal(9);
        });
        it('should return undefined', function () {
            var set = new IndexSet();
            (typeof set.lastIndex()).should.equal('undefined');
        });
    });

    describe('#pagedRanges()', function () {
        it('should page set into ranges', function () {
            var set = IndexSet.fromString('0-21');
            var ranges = set.pagedRanges(5);
            ranges[0].start().should.equals(0)
            ranges[4].end().should.equals(21)
        });
        it('should page set into ranges', function () {
            var set = IndexSet.fromString('0-3,5-10,11-12,15-18');
            var ranges = set.pagedRanges(2);
            ranges[0].start().should.equals(0)
            ranges[0].end().should.equals(1)
            ranges[7].start().should.equals(17)
            ranges[7].end().should.equals(18)
        });
    });

    describe('#toString()', function () {
        it('should create string rep of set', function () {
            var range0 = new IndexRange(0, 10);
            var range1 = new IndexRange(15, 20);
            var set = new IndexSet();
            set.addRanges([range0, range1]);
            set.toString().should.equal('0-10,15-20');
        });
    });

});


text:
package com.fyp.hongqiaoservice.utils;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.afollestad.materialdialogs.MaterialDialog;
import com.fyp.hongqiaoservice.R;
import com.fyp.hongqiaoservice.main.MainActivity;
import com.squareup.timessquare.CalendarPickerView;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.Set;

/**
 * Created by Yaozhong on 2015/2/13.
 */
public class CalendarDialogViewHelper extends FragmentActivity {

    MaterialDialog dialog;
    private Date currentDate = new Date();
     Context context;

    public CalendarDialogViewHelper(Context context, final CalendarPickerView calendarDialogView, final TextView tvDate, final TextView tvWeek) {

       this.context = context;

        Calendar NextMonth = Calendar.getInstance();
        NextMonth.add(Calendar.MONTH, 4);
        calendarDialogView.init(new Date(), NextMonth.getTime())
                .inMode(CalendarPickerView.SelectionMode.SINGLE)
                .withSelectedDate(new Date());

        dialog =  new MaterialDialog.Builder(context)
                .title("请选择日期")
                .customView(calendarDialogView, false)
                .negativeText("取消")
                .positiveText("确定")
                .backgroundColorRes(R.color.white)
                .callback(new MaterialDialog.ButtonCallback() {
                    @Override
                    public void onNegative(MaterialDialog dialog) {
                        dialog.dismiss();

                  }
                    @Override
                    public void onPositive(MaterialDialog dialog) {
                        super.onPositive(dialog);
                        dialog.dismiss();

                    }
                }).build();

        calendarDialogView.setOnDateSelectedListener(new CalendarPickerView.OnDateSelectedListener() {
            @Override
            public void onDateSelected(Date date) {
                tvDate.setText(getStringDateFormat(date));
                tvWeek.setText(getStringWeekFormat(date));
                dialog.dismiss();
            }
            @Override
            public void onDateUnselected(Date date) {

            }
        });

        tvDate.setText(getStringDateFormat(currentDate));
        tvWeek.setText(getStringWeekFormat(currentDate));

    }

    public AlertDialog getCalendarDialog() {
        return dialog;
    }

    //转换日期格式
    public  String getStringDateFormat(Date date) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(date);
    }
    public  String getStringWeekFormat(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        int day = c.get(Calendar.DAY_OF_WEEK)-1;
        String dayNames[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五","星期六" };
        if(day <0)day=0;
        String week = dayNames[day];
        if(getStringDateFormat(date).equals(getStringDateFormat(currentDate))){
            week="今天";
        }
        return week;
    }

}


text:
 - [git](http://git-scm.com/)
 - [nodejs](https://nodejs.org/)
  - Ensure that you select installer options so that `node` and `npm` are added to the system path
 - bower and gulp :

 ```
 npm install bower gulp -g
 ```

###Optionally###
 - If you want do syntax-checking on a JavaScript file on-demand, install `jshint` :

 ```
 npm install -g jshint
 ```
 Subsequently you can check the syntax of a JavaScript file by running :
 ```
 jshint YOUR_FILENAME_HERE
 ```

###Set up the App###
 - Fork and clone this repository.
 - Change to the directory where you cloned.
 - Now you will install system-level packages required by this project. These packages help automate our development tasks. For example: `wiredep` (More on that later). Run:
```
npm install
```
 - Now you will install web packages. These are JavaScript or CSS libraries that we build our application on top of. For example: bootstrap.
```
bower install
```
 - Now you will build the project. This performs automatic tasks like Less->CSS compilation, JavaScript linting, and running tests.
```
gulp build
```

 - Now you will run the project in the browser.
```
gulp serve
```
The command keeps running until you stop it with Ctl+C / Cmd+C. The command watches your source files for changes and refreshes the browser automatically.

####Adding New Libraries####
Below we recommend a way to add JS or CSS browser dependencies to the project. We'd like contributors to give it an honest try, but we don't want it to be a barrier to contribution. If you find yourself getting unduly held up by the process, go ahead and check the JS/CSS library files into the repo just as you would in a project where the dependencies are managed ad-hoc. Someone else can formalize your new dependencies after the pull request has been merged.

We are using bower to manage web packages. Find the library you want at the [Bower Package Registry](http://bower.io/search/). Once you have the name of the package, install it:
```
bowser install YOUR_PACKAGE_NAME_HERE --save
```
The ```--save``` option is important because it will automatically update *bower.json*. Recording all of the project's bower dependencies in this file is important because it keeps everyone on the same page -- after people pull your updated *bower.json* they can simply run ```bower install``` to use the same dependencies as you.

Now that you have the library's files, you can automatically include a reference to them in *index.html* by running:
```
gulp wiredep
```

####Debugging Less Files####
To debug Less, follow [these instructions](http://robdodson.me/debug-less-with-chrome-developer-tools/#settingupchromeahrefidsettingupchromea) to enable CSS source maps in chrome. You only need to do the instructions under the 'Setting Up Chrome' section. The rest is already taken care of for you.


text:
<?php

namespace Hadonra\Bundle\TransactionBundle\DataFixtures\MongoDB;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Hadonra\Bundle\TransactionBundle\Document\Account;

class AccountData extends AbstractFixture implements OrderedFixtureInterface
{
    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        $bankBprdp = $manager->getRepository('HadonraTransactionBundle:Bank')->findOneBy(array('code' => 'Bprdp')) ;
        $bankSgen = $manager->getRepository('HadonraTransactionBundle:Bank')->findOneBy(array('code' => 'Sgen')) ;
        $account1 = new Account();
        $account1
            ->setNumber('20195136759')
            ->setBank($bankBprdp)
        ;

        $account2 = new Account();
        $account2
            ->setNumber('11111111111')
            ->setBank($bankSgen)
        ;

        $manager->persist($account1);
        $manager->persist($account2);
        $manager->flush();
    }

    /**
     * {@inheritDoc}
     */
    public function getOrder()
    {
        return 2;
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>ontop</artifactId>
		<groupId>it.unibz.inf.ontop</groupId>
		<version>1.17.1</version>
	</parent>
	<artifactId>ontop-quest-sesame</artifactId>
	<name>ontop-quest-sesame</name>
	<description>This is the Sesame API implementation based on Quest</description>

	<dependencies>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<artifactId>ontop-obdalib-core</artifactId>
			<groupId>${project.groupId}</groupId>
			<version>${project.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>slf4j-log4j12</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<artifactId>ontop-obdalib-owlapi</artifactId>
			<groupId>${project.groupId}</groupId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<artifactId>ontop-obdalib-sesame</artifactId>
			<groupId>${project.groupId}</groupId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<artifactId>ontop-reformulation-core</artifactId>
			<groupId>${project.groupId}</groupId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<artifactId>ontop-quest-owlapi</artifactId>
			<groupId>${project.groupId}</groupId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<artifactId>ontop-quest-db</artifactId>
			<groupId>${project.groupId}</groupId>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>net.sourceforge.owlapi</groupId>
			<artifactId>owlapi-apibinding</artifactId>
		</dependency>
		<!-- These will download some of the sources -->
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-repository-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-queryresultio-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-queryparser-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-queryparser-sparql</artifactId>
		</dependency>

		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-repository-manager</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-queryresultio-text</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-rio-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-rio-turtle</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-rio-rdfxml</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-rio-n3</artifactId>
		</dependency>
		<dependency>
			<groupId>org.openrdf.sesame</groupId>
			<artifactId>sesame-rio-ntriples</artifactId>
		</dependency>

		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Optique R2RML API -->
		<dependency>
			<groupId>eu.optique-project</groupId>
			<artifactId>r2rml-api</artifactId>
		</dependency>

		<dependency>
			<groupId>eu.optique-project</groupId>
			<artifactId>r2rml-api-sesame-bridge</artifactId>
		</dependency>
    </dependencies>

</project>


text:
* 7.1-apache-ubuntu [(7.1/apache/ubuntu/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/7.1/apache/ubuntu/Dockerfile)
* 7.0-apache-oraclelinux [(7.0/apache/oraclelinux/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/7.0/apache/oraclelinux/Dockerfile)
* 5.6-apache-oraclelinux [(5.6/apache/oraclelinux/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/5.6/apache/oraclelinux/Dockerfile)
* 5.5-apache-oraclelinux [(5.5/apache/oraclelinux/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/5.5/apache/oraclelinux/Dockerfile)
* 5.3-apache-centos-5 [(5.3/apache/centos-5/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/5.3/apache/centos-5/Dockerfile)

#### FPM

* 7.0-fpm-oraclelinux [(7.0/fpm/oraclelinux/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/7.0/fpm/oraclelinux/Dockerfile)
* 7.0-fpm-alpine [(7.0/fpm/alpine/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/7.0/fpm/alpine/Dockerfile)
* 7.1-fpm-alpine [(7.1/fpm/alpine/Dockerfile)](https://github.com/zimmo-be/docker-php/blob/master/7.1/fpm/alpine/Dockerfile)

# How to use this image

#### Apache

    php:
      image: zimmobe/php:7.0-apache-oraclelinux
      volumes:
        - .:/var/www/project/
      environment:
        - SYMFONY_ENV=dev
        - SYMFONY_DEBUG=1
      links:
        - mongodb
      ports:
        - 80

    mongodb:
      image: mongo:3.2

#### FPM

    php:
      image: zimmobe/php:7.0-fpm-alpine
      volumes:
        - .:/var/www/project/
      environment:
        - SYMFONY_ENV=dev
        - SYMFONY_DEBUG=1
      links:
        - mongodb

    nginx:
      image: nginx:1.10-alpine
      volumes:
          - .:/var/www/project/
      links:
        - php
      ports:
        - 80

    mongodb:
      image: mongo:3.2


text:
package mypi;

import mypi.diplayEventPanel.DisplayEvents;
import mypi.calendarPanel.CalendarPanel;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.Timer;
import javax.swing.event.ChangeEvent;
import mypi.service.CurrentTime;
import mypi.quote.QuotesLibrary;
import mypi.service.EventLinkedList;

/**
 *
 * @author trav Main class that runs the calendar
 *
 */
public class CalendarApp extends JFrame {

    private final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    private final JTabbedPane TABS;
    private final QuotesLibrary THE_QUOTE_BOOK = new QuotesLibrary();
    private int countForQuotePick=0;
    private final int NUMBER_OF_QUOTES =THE_QUOTE_BOOK.getLibrarySize()-1;
    private CalendarPanel calendarTab;
    private GregorianCalendar tempCalendar;

    public CalendarApp() {
        tempCalendar=new GregorianCalendar();
        TABS = new JTabbedPane();
        DisplayEvents eventTab = new DisplayEvents();
        calendarTab = new CalendarPanel(TABS, eventTab, tempCalendar);
        TABS.add("Calendar", calendarTab);
        TABS.add("Events", eventTab);

        //listener that listens for when calendar tab is clicked. when it is clicked
        //the tab will update with events
        TABS.addChangeListener((ChangeEvent e) -> {
            JTabbedPane tabSource = (JTabbedPane) e.getSource();
            //tabb selected grabs the name of the tab selected
            String tabSelected = tabSource.getTitleAt(tabSource.getSelectedIndex());
            if (tabSelected.equals("Calendar")) {
                calendarTab.refreshGUI();
            } else if (tabSelected.equals("Events")) {
                eventTab.refreshGUI();
            }
        });

        CurrentTime theCurrentTimeNow = new CurrentTime();
        int TIME_TICK = 60000;
        new Timer(TIME_TICK, (ActionEvent e) -> {
            timerEvent(theCurrentTimeNow);
        }).start();

        add(TABS);
        this.setSize(screenSize);
        this.setVisible(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);

    }

    /**
     * every minute <timer> will fire off this method the strings listed in here
     * are checked against the @param theCurrentTimeNow if they are equal the
     * according action will perform
     *
     * Possible actions that can take place are 1) nothing - if
     * <theCurrentTimeNow> doesnt equal any of the Strings 2) a popup that will
     * display a daily quote 3) a text reminder will be sent to your phone if
     * you set up <SendText.Java> properly
     *
     * @throws HeadlessException
     */
    private void timerEvent(CurrentTime theCurrentTimeNow) throws HeadlessException {
        String afterWorkQuoteTime = "4:30 PM";
        String travmorningQuoteTime = "4:30 AM";
        String colleenMorningQuoteTime = "6:00 AM";
        String beforeBedQuoteTime = "7:00 PM";
        String midnight = "12:00 AM";
        String sendTextReminder = "1:29 AM";

        if (isItQuoteTime(theCurrentTimeNow, travmorningQuoteTime, colleenMorningQuoteTime, afterWorkQuoteTime, beforeBedQuoteTime)) {
            createDialogDisplayingQuote();
        }else
        if (theCurrentTimeNow.getTime().equals(sendTextReminder)) {
            calendarTab.sendReminder.primeTextToBeSent();
            calendarTab.refreshGUI();
        }else
        if(theCurrentTimeNow.getTime().equals(midnight)){
            tempCalendar.add(Calendar.DATE, 1);
            calendarTab.refreshGUI();
        }
    }

    /**
     * Creates a custom dialog setting modal to false for dialog doesn't block thread
     * @throws HeadlessException
     */
    private void createDialogDisplayingQuote() throws HeadlessException {
        String theMessageToDisplay = THE_QUOTE_BOOK.getQuote(countForQuotePick);
        JOptionPane pane=new JOptionPane(theMessageToDisplay);
        JDialog dialog = pane.createDialog(calendarTab,"Daily Quote");
        dialog.setModal(false);
        dialog.setVisible(true);
        countForQuotePick++;
        if (countForQuotePick > NUMBER_OF_QUOTES) {
            countForQuotePick = 0;
        }
    }

    /**
     * if any of these parameters is the current time
     * @param theCurrentTimeNow
     * @param travmorningQuoteTime
     * @param colleenMorningQuoteTime
     * @param afterWorkQuoteTime
     * @param beforeBedQuoteTime
     * @return
     */
    private static boolean isItQuoteTime(CurrentTime theCurrentTimeNow, String travmorningQuoteTime, String colleenMorningQuoteTime, String afterWorkQuoteTime, String beforeBedQuoteTime) {
        return theCurrentTimeNow.getTime().equals(travmorningQuoteTime) || theCurrentTimeNow.getTime().equals(colleenMorningQuoteTime)
                || theCurrentTimeNow.getTime().equals(afterWorkQuoteTime) || theCurrentTimeNow.getTime().equals(beforeBedQuoteTime);
    }

    public static void main(String[] args) {
        if (EventLinkedList.instanceOf().getFile().getName().equalsIgnoreCase("Planned_Events_POJO.txt")) {
            new CalendarApp();
        } else {
            System.err.println("YOU NEED TO CHANGE TEST_FILE CHECK FileReadAndWrite.java");
            System.exit(1);
        }
    }

}//end of CalendarApp


text:
layout: page
title: Forms and Links Web page
permalink: /links/
---

![link image](../images/chain.png)

###Get Started with Drake MTB

* Student Registration Form

* Drake Waiver and Agreement to Participate Form

* Field Trip Form

* Join our team EMAIL list, send a request to join

* Scholarship Form Download

* Kit Order Link **COMING SOON!**

* Parent Rider Handbook Download

* FAQs

* Race Packing List Download

* Race Food Sign up sheet **COMING SOON! Feb 2016**

* Race Volunteer Sign up Sheet **COMING SOON! Feb 2016**

* Team Photos **More COMING SOON!**

* Team Videos **More COMING SOON!**

****

####NorCal and NICA Information

* NorCal League Mountain Bike Race Registration Login

* The NICA Rule Book

* Coaches Resources NICA

* The NorCal High School Cycling League website

* NICA Race Day Preparation Information

* Mountain Bike Clinic and Camps information


text:
package org.saiku.olap.dto;

import java.util.HashMap;
import java.util.Map;

/**
 * SaikuLevel.
 */
public class SaikuLevel extends AbstractSaikuObject {

  private final Map<String, String> annotations;
  private String levelType;
  private String caption;
  private String hierarchyUniqueName;
  private String dimensionUniqueName;
  //private transient List<SaikuMember> members;
  private boolean visible;
  private String description;

  public SaikuLevel(String name, String uniqueName, String caption, String description, String s, String uniqueName1,
                    boolean visible) {
    super(null, null);
    throw new RuntimeException("Unsupported Constructor. Serialization only");
  }

  public SaikuLevel(
      String name,
      String uniqueName,
      String caption,
      String description,
      String dimensionUniqueName,
      String hierarchyUniqueName,
      boolean visible,
      String levelType,
      Map<String, String> annotations) {
    super(uniqueName, name);
    this.caption = caption;
    this.hierarchyUniqueName = hierarchyUniqueName;
    this.dimensionUniqueName = dimensionUniqueName;
    this.visible = visible;
    this.description = description;
    this.annotations = annotations;
    if(levelType!=null) {
      this.levelType = levelType;
    }
    //this.members = members;
  }

  public String getCaption() {
    return caption;
  }

  public String getHierarchyUniqueName() {
    return hierarchyUniqueName;
  }

  public String getDimensionUniqueName() {
    return dimensionUniqueName;
  }

  public boolean isVisible() {
    return visible;
  }

  public String getDescription() {
    return description;
  }

  public Map<String, String> getAnnotations() {
    Map<String, String> m = null;
    if (annotations != null) {
      m = new HashMap<>();
      for (Map.Entry<String, String> entry : annotations.entrySet()) {
        m.put(entry.getKey(), entry.getValue());
      }
    }

    return m;
  }

  public String getLevelType() {
    return levelType;
  }
  //public List<SaikuMember> getMembers() {
  //return members;
  //}
}


text:
angular.module('blogAdmin').controller('ToolsController', ["$rootScope", "$scope", "$filter", "dataService", function ($rootScope, $scope, $filter, dataService) {
    $scope.items = [];
    $scope.security = $rootScope.security;
    $scope.userIdentity = {};

    $scope.load = function () {
        if (!$scope.security.canManageUsers == true) {
            window.location.replace("../Account/Login.aspx");
        }
        spinOn();
        dataService.getItems('/api/tools/check1')
        .success(function (data) {
            $scope.userIdentity = data.replace(/["']/g, "");
            spinOff();
        })
        .error(function () {
            toastr.error($rootScope.lbl.errorLoadingUsers);
            spinOff();
        });
    }

    $scope.check = function () {
        if (!$scope.security.canManageUsers == true) {
            window.location.replace("../Account/Login.aspx");
        }
        $("#msgList").empty();

        dataService.getItems('/api/tools/trust')
            .success(function (data) { $scope.addMsg(data); })
            .error(function (data) { toastr.error($rootScope.lbl.Error); });

        dataService.getItems('/api/tools/data')
            .success(function (data) { $scope.addMsg(data); })
            .error(function (data) { toastr.error($rootScope.lbl.Error); });

        dataService.getItems('/api/tools/root')
            .success(function (data) { $scope.addMsg(data); })
            .error(function (data) { toastr.error($rootScope.lbl.Error); });

        dataService.getItems('/api/tools/Custom')
            .success(function (data) { $scope.addMsg(data); })
            .error(function () { toastr.error($rootScope.lbl.Error); });
    }

    $scope.addMsg = function (data) {
        if (data.success === true) {
            $("#msgList").append('
 ' + data.msg + '
');
        }
        else {
            $("#msgList").append('
 ' + data.msg + '
');
        }
    }

    $scope.load();
}]);


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lithogen.Core
{
    public abstract class LoggerBase : ILogger
    {
        public string Prefix { get { return Prefixes.Peek(); } }
        DateTime StartTime;
        DateTime LastTime;

        public LoggerBase()
        {
            StartTime = DateTime.Now;
            LastTime = StartTime;
            Prefixes = new Stack<string>();
        }

        public void PushPrefix(string prefix)
        {
            Prefixes.Push(prefix);
        }

        public void PopPrefix()
        {
            Prefixes.Pop();
        }
        Stack<string> Prefixes;

        /// <summary>
        /// Logs a standard message, including time formatting.
        /// This is completely free-format.
        /// </summary>
        /// <param name="msg">Format text of the message.</param>
        /// <param name="args">Any parameters.</param>
        public virtual void Msg(string msg, params object[] args)
        {
            msg = FormatMessage(msg, args);
            LastTime = DateTime.Now;
            WriteLine(msg);
        }

        public virtual void Error(string origin, string code, string msg, params object[] args)
        {
            Write(origin);
            Write(" : error ");
            Write(code);
            Write(" ");
            msg = String.Format(msg, args);
            WriteLine(msg);
            LastTime = DateTime.Now;
        }

        public abstract void Write(string msg);
        public abstract void WriteLine(string msg);

        protected virtual string FormatMessage(string msg, params object[] args)
        {
            if (args != null && args.Length > 0)
                msg = String.Format(msg, args);

            var sb = new StringBuilder();
            DateTime now = DateTime.Now;
            double thisSecs = (now - LastTime).TotalSeconds;
            double totalSecs = (now - StartTime).TotalSeconds;
            string thisSecsFormatted = String.Format("{0,6:##0.00}", thisSecs);
            if (thisSecsFormatted.Equals("  0.00", StringComparison.OrdinalIgnoreCase)) {
                sb.Append("[       ");
            }
            else
            {
                sb.Append("[");
                sb.Append(thisSecsFormatted);
                sb.Append(",");
            }

            sb.AppendFormat("{0,6:##0.00}] {1}{2}", totalSecs, Prefix ?? "", msg ?? "" );

            return sb.ToString();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<get_console_output length="50" />


text:
NSString *const MCLMessageListFrameStyleTableViewCellIdentifier = @"FrameStyleMessageCell";

@implementation MCLMessageListFrameStyleTableViewCell

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

- (void)setMessage:(MCLMessage *)message
{

}

- (void)markRead
{
    self.readSymbolView.hidden = YES;
    self.messageSubjectLabel.font = [UIFont systemFontOfSize:15.0f];
    [self setNeedsLayout];
    [self layoutIfNeeded];
}

- (void)markUnread
{
    self.readSymbolView.hidden = NO;
    self.messageSubjectLabel.font = [UIFont systemFontOfSize:15.0f weight:UIFontWeightSemibold];
}

@end


text:
const expect   = require('chai').expect;
const Currency = require('../currency_base');

describe('Currency', () => {
    const currencies_config = {
        currencies_config: {
            AUD: { fractional_digits: 2, type: 'fiat' },
            EUR: { fractional_digits: 2, type: 'fiat' },
            GBP: { fractional_digits: 2, type: 'fiat' },
            USD: { fractional_digits: 2, type: 'fiat', transfer_between_accounts: { limits: { max: 2500, min: 1.00 } } },
            BTC: { fractional_digits: 8, type: 'crypto' },
        }
    };
    before(() => {
        Currency.setCurrencies(currencies_config);
    });

    describe('.formatMoney()', () => {
        it('works as expected', () => {
            expect(Currency.formatMoney('USD', '123.55')).to.eq(`123.55${Currency.formatCurrency('USD')}`);
            expect(Currency.formatMoney('GBP', '123.55')).to.eq(`123.55${Currency.formatCurrency('GBP')}`);
            expect(Currency.formatMoney('EUR', '123.55')).to.eq(`123.55${Currency.formatCurrency('EUR')}`);
            expect(Currency.formatMoney('AUD', '123.55')).to.eq(`123.55${Currency.formatCurrency('AUD')}`);
            expect(Currency.formatMoney('BTC', '0.005432110')).to.eq(`0.00543211${Currency.formatCurrency('BTC')}`);
            expect(Currency.formatMoney('BTC', '0.005432116')).to.eq(`0.00543212${Currency.formatCurrency('BTC')}`);
            expect(Currency.formatMoney('BTC', '0.00000001')).to.eq(`0.00000001${Currency.formatCurrency('BTC')}`);
            // don't remove trailing zeroes for now
            expect(Currency.formatMoney('BTC', '0.00010000')).to.eq(`0.00010000${Currency.formatCurrency('BTC')}`);
        });

        it('works with negative values', () => {
            expect(Currency.formatMoney('USD', '-123.55')).to.eq(`-123.55${Currency.formatCurrency('USD')}`);
        });

        it('works when exclude currency', () => {
            expect(Currency.formatMoney('USD', '123.55', 1)).to.eq('123.55');
        });
    });

    describe('.formatCurrency()', () => {
        it('works as expected', () => {
            expect(Currency.formatCurrency('USD')).to.eq(' USD');
        });
    });

    describe('.addComma()', () => {
        it('works as expected', () => {
            expect(Currency.addComma('123')).to.eq('123');
            expect(Currency.addComma('1234567')).to.eq('1,234,567');
        });

        it('works with decimal places', () => {
            expect(Currency.addComma('1234.5678')).to.eq('1,234.5678');
            expect(Currency.addComma('1234.5678', 2)).to.eq('1,234.57');
            expect(Currency.addComma('1234', 2)).to.eq('1,234.00');
            expect(Currency.addComma('1234.45', 0)).to.eq('1,234');
            expect(Currency.addComma('1234.56', 0)).to.eq('1,235');
        });

        it('works with negative numbers', () => {
            expect(Currency.addComma('-1234')).to.eq('-1,234');
        });

        it('handles null values', () => {
            expect(Currency.addComma()).to.eq('0');
            expect(Currency.addComma(null)).to.eq('0');
            expect(Currency.addComma(undefined)).to.eq('0');
            expect(Currency.addComma('')).to.eq('0');
        });
    });

    describe('.getDecimalPlaces()', () => {
        it('works as expected', () => {
            expect(Currency.getDecimalPlaces('AUD')).to.eq(2);
            expect(Currency.getDecimalPlaces('EUR')).to.eq(2);
            expect(Currency.getDecimalPlaces('GBP')).to.eq(2);
            expect(Currency.getDecimalPlaces('USD')).to.eq(2);
            expect(Currency.getDecimalPlaces('BTC')).to.eq(8);
        });

        it('works with undefined currencies', () => {
            expect(Currency.getDecimalPlaces('ZZZ')).to.eq(2);
        });
    });

    describe('.getCurrencies()', () => {
        it('works as expected', () => {
            expect(Currency.getCurrencies()).to.deep.eq(currencies_config.currencies_config);
        });
    });

    describe('.isCryptocurrency()', () => {
        it('works as expected', () => {
            expect(Currency.isCryptocurrency('AUD')).to.eq(false);
            expect(Currency.isCryptocurrency('EUR')).to.eq(false);
            expect(Currency.isCryptocurrency('GBP')).to.eq(false);
            expect(Currency.isCryptocurrency('USD')).to.eq(false);
            expect(Currency.isCryptocurrency('BTC')).to.eq(true);
        });

        it('works with undefined currencies', () => {
            expect(Currency.isCryptocurrency('ZZZ')).to.eq(false);
        });
    });

    describe('.getTransferLimits()', () => {
        it('returns limits based on input', () => {
            expect(Currency.getTransferLimits('USD')).to.eq('1.00');
            expect(Currency.getTransferLimits('USD', 'max')).to.eq('2500.00');
            expect(Currency.getTransferLimits('BTC')).to.eq(undefined);
            expect(Currency.getTransferLimits('BTC', 'max')).to.eq(undefined);
        })
    })
});


text:
package org.openkilda.tools.mininet;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.projectfloodlight.openflow.types.IPv4Address;
import org.projectfloodlight.openflow.types.TransportPort;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "name",
    "ip",
    "port",
    "of-version"
    })

public class MininetController implements IMininetController {
  @JsonProperty("host")
  private String host;
  @JsonProperty("port")
  private Integer port;
  @JsonProperty("of-version")
  private String ofVersion;
  @JsonProperty("name")
  private String name;

  @Override
  @JsonProperty("host")
  public IMininetController setIP(String host) {
    this.host = host;
    return this;
  }

  @Override
  @JsonProperty("host")
  public String getIP() {
    return host;
  }

  @Override
  @JsonProperty("port")
  public IMininetController setPort(TransportPort port) {
    this.port = port.getPort();
    return this;
  }

  @Override
  @JsonProperty("port")
  public Integer getPort() {
    return port;
  }

  @Override
  @JsonProperty("of-version")
  public IMininetController setVersion(OFVersion version) {
    this.ofVersion = version.toString();
    return this;
  }

  @Override
  @JsonProperty("of-version")
  public String getOfVersion() {
    return ofVersion;
  }

  @Override
  @JsonProperty("name")
  public IMininetController setName(String name) {
    this.name = name;
    return this;
  }

  @Override
  @JsonProperty("name")
  public String getName() {
    return name;
  }

  @Override
  public IMininetController build() {
    return this;
  }

}


text:
package com.koma.music.base;

import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.koma.music.R;

import butterknife.BindView;

/**
 * Created by koma on 4/22/17.
 */

public abstract class BaseSongInfoViewHolder extends BaseViewHolder implements View.OnClickListener {
    protected static final int DOUBLE_CLICK_TIME = 600;
    protected static final int MESSAGE_ITEM_CLICK = 0x00;
    @BindView(R.id.iv_album)
    public ImageView mAlbum;
    @BindView(R.id.iv_more)
    public ImageView mMoreMenu;
    @BindView(R.id.tv_title)
    public TextView mTitle;
    @BindView(R.id.tv_info)
    public TextView mInfo;

    protected Handler mHandler;

    public BaseSongInfoViewHolder(View view) {
        super(view);

        this.itemView.setOnClickListener(this);
    }
}


text:
/**
 *
 */

package cn.zhucongqi.issuer;

/**
 *
 * @author BruceZCQ [zcq@zhucongqi.cn]
 * @version
 */
public interface AuthIssuer {

    public String accessToken();

    public String authorizationCode();

    public String refreshToken();
}


text:
package armsecurity

import (
	"context"
	"errors"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
	armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
	"net/http"
	"net/url"
	"strings"
)

// AssessmentsClient contains the methods for the Assessments group.
// Don't use this type directly, use NewAssessmentsClient() instead.
type AssessmentsClient struct {
	host string
	pl   runtime.Pipeline
}

// NewAssessmentsClient creates a new instance of AssessmentsClient with the specified values.
// credential - used to authorize requests. Usually a credential from azidentity.
// options - pass nil to accept the default values.
func NewAssessmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AssessmentsClient, error) {
	if options == nil {
		options = &arm.ClientOptions{}
	}
	ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint
	if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok {
		ep = c.Endpoint
	}
	pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options)
	if err != nil {
		return nil, err
	}
	client := &AssessmentsClient{
		host: ep,
		pl:   pl,
	}
	return client, nil
}

// CreateOrUpdate - Create a security assessment on your resource. An assessment metadata that describes this assessment must
// be predefined with the same name before inserting the assessment result
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2021-06-01
// resourceID - The identifier of the resource.
// assessmentName - The Assessment Key - Unique key for the assessment type
// assessment - Calculated assessment on a pre-defined assessment metadata
// options - AssessmentsClientCreateOrUpdateOptions contains the optional parameters for the AssessmentsClient.CreateOrUpdate
// method.
func (client *AssessmentsClient) CreateOrUpdate(ctx context.Context, resourceID string, assessmentName string, assessment Assessment, options *AssessmentsClientCreateOrUpdateOptions) (AssessmentsClientCreateOrUpdateResponse, error) {
	req, err := client.createOrUpdateCreateRequest(ctx, resourceID, assessmentName, assessment, options)
	if err != nil {
		return AssessmentsClientCreateOrUpdateResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return AssessmentsClientCreateOrUpdateResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) {
		return AssessmentsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp)
	}
	return client.createOrUpdateHandleResponse(resp)
}

// createOrUpdateCreateRequest creates the CreateOrUpdate request.
func (client *AssessmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceID string, assessmentName string, assessment Assessment, options *AssessmentsClientCreateOrUpdateOptions) (*policy.Request, error) {
	urlPath := "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"
	urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
	if assessmentName == "" {
		return nil, errors.New("parameter assessmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{assessmentName}", url.PathEscape(assessmentName))
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2021-06-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, runtime.MarshalAsJSON(req, assessment)
}

// createOrUpdateHandleResponse handles the CreateOrUpdate response.
func (client *AssessmentsClient) createOrUpdateHandleResponse(resp *http.Response) (AssessmentsClientCreateOrUpdateResponse, error) {
	result := AssessmentsClientCreateOrUpdateResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.AssessmentResponse); err != nil {
		return AssessmentsClientCreateOrUpdateResponse{}, err
	}
	return result, nil
}

// Delete - Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined
// with the same name before inserting the assessment result
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2021-06-01
// resourceID - The identifier of the resource.
// assessmentName - The Assessment Key - Unique key for the assessment type
// options - AssessmentsClientDeleteOptions contains the optional parameters for the AssessmentsClient.Delete method.
func (client *AssessmentsClient) Delete(ctx context.Context, resourceID string, assessmentName string, options *AssessmentsClientDeleteOptions) (AssessmentsClientDeleteResponse, error) {
	req, err := client.deleteCreateRequest(ctx, resourceID, assessmentName, options)
	if err != nil {
		return AssessmentsClientDeleteResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return AssessmentsClientDeleteResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) {
		return AssessmentsClientDeleteResponse{}, runtime.NewResponseError(resp)
	}
	return AssessmentsClientDeleteResponse{}, nil
}

// deleteCreateRequest creates the Delete request.
func (client *AssessmentsClient) deleteCreateRequest(ctx context.Context, resourceID string, assessmentName string, options *AssessmentsClientDeleteOptions) (*policy.Request, error) {
	urlPath := "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"
	urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
	if assessmentName == "" {
		return nil, errors.New("parameter assessmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{assessmentName}", url.PathEscape(assessmentName))
	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2021-06-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// Get - Get a security assessment on your scanned resource
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2021-06-01
// resourceID - The identifier of the resource.
// assessmentName - The Assessment Key - Unique key for the assessment type
// options - AssessmentsClientGetOptions contains the optional parameters for the AssessmentsClient.Get method.
func (client *AssessmentsClient) Get(ctx context.Context, resourceID string, assessmentName string, options *AssessmentsClientGetOptions) (AssessmentsClientGetResponse, error) {
	req, err := client.getCreateRequest(ctx, resourceID, assessmentName, options)
	if err != nil {
		return AssessmentsClientGetResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return AssessmentsClientGetResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return AssessmentsClientGetResponse{}, runtime.NewResponseError(resp)
	}
	return client.getHandleResponse(resp)
}

// getCreateRequest creates the Get request.
func (client *AssessmentsClient) getCreateRequest(ctx context.Context, resourceID string, assessmentName string, options *AssessmentsClientGetOptions) (*policy.Request, error) {
	urlPath := "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"
	urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
	if assessmentName == "" {
		return nil, errors.New("parameter assessmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{assessmentName}", url.PathEscape(assessmentName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2021-06-01")
	if options != nil && options.Expand != nil {
		reqQP.Set("$expand", string(*options.Expand))
	}
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// getHandleResponse handles the Get response.
func (client *AssessmentsClient) getHandleResponse(resp *http.Response) (AssessmentsClientGetResponse, error) {
	result := AssessmentsClientGetResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.AssessmentResponse); err != nil {
		return AssessmentsClientGetResponse{}, err
	}
	return result, nil
}

// NewListPager - Get security assessments on all your scanned resources inside a scope
// Generated from API version 2021-06-01
// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
// (/providers/Microsoft.Management/managementGroups/mgName).
// options - AssessmentsClientListOptions contains the optional parameters for the AssessmentsClient.List method.
func (client *AssessmentsClient) NewListPager(scope string, options *AssessmentsClientListOptions) *runtime.Pager[AssessmentsClientListResponse] {
	return runtime.NewPager(runtime.PagingHandler[AssessmentsClientListResponse]{
		More: func(page AssessmentsClientListResponse) bool {
			return page.NextLink != nil && len(*page.NextLink) > 0
		},
		Fetcher: func(ctx context.Context, page *AssessmentsClientListResponse) (AssessmentsClientListResponse, error) {
			var req *policy.Request
			var err error
			if page == nil {
				req, err = client.listCreateRequest(ctx, scope, options)
			} else {
				req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)
			}
			if err != nil {
				return AssessmentsClientListResponse{}, err
			}
			resp, err := client.pl.Do(req)
			if err != nil {
				return AssessmentsClientListResponse{}, err
			}
			if !runtime.HasStatusCode(resp, http.StatusOK) {
				return AssessmentsClientListResponse{}, runtime.NewResponseError(resp)
			}
			return client.listHandleResponse(resp)
		},
	})
}

// listCreateRequest creates the List request.
func (client *AssessmentsClient) listCreateRequest(ctx context.Context, scope string, options *AssessmentsClientListOptions) (*policy.Request, error) {
	urlPath := "/{scope}/providers/Microsoft.Security/assessments"
	urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2021-06-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// listHandleResponse handles the List response.
func (client *AssessmentsClient) listHandleResponse(resp *http.Response) (AssessmentsClientListResponse, error) {
	result := AssessmentsClientListResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.AssessmentList); err != nil {
		return AssessmentsClientListResponse{}, err
	}
	return result, nil
}


text:
from unittest import TestCase

from remote_host_event_logging.public import RemoteHostEventLogger

from ..command import Command

class ErrorCommand(Command):
    def _execute(self):
        self._failing_method()

    @Command._collect_errors
    def _failing_method(self):
        raise Exception('FAILED')

class NoErrorCommand(Command):
    def _execute(self):
        pass

    @Command._collect_errors
    def not_failing_method(self):
        return 'NOT_FAILED'

class TestCommand(TestCase):
    def test_collect_errors(self):
        command = ErrorCommand()
        try:
            with RemoteHostEventLogger.DisableLoggingContextManager():
                command.execute()
        except:
            pass

        self.assertEqual(command.get_error_report(), 'FAILED')

    def test_collect_errors__throws_command_execution_exception(self):
        command = ErrorCommand()

        with RemoteHostEventLogger.DisableLoggingContextManager():
            with self.assertRaises(Command.CommandExecutionException):
                command.execute()

    def test_collect_errors__not_failed(self):
        command = NoErrorCommand()
        command.execute()
        self.assertEqual(command.not_failing_method(), 'NOT_FAILED')
        self.assertEqual(command.get_error_report(), '')


text:
require 'digest/sha1'

module Qless
  LuaScriptError = Class.new(Qless::Error)

  # Wraps a lua script. Knows how to reload it if necessary
  class LuaScript
    SCRIPT_ROOT = File.expand_path('../lua', __FILE__)

    def initialize(name, redis)
      @name  = name
      @redis = redis
      @sha   = Digest::SHA1.hexdigest(script_contents)
    end

    attr_reader :name, :redis, :sha

    def reload
      @sha = @redis.script(:load, script_contents)
    end

    def call(*argv)
      handle_no_script_error do
        _call(*argv)
      end
    rescue Redis::CommandError => err
      if match = err.message.match('user_script:\d+:\s*(\w+.+$)')
        raise LuaScriptError.new(match[1])
      else
        raise err
      end
    end

  private

    if USING_LEGACY_REDIS_VERSION
      def _call(*argv)
        @redis.evalsha(@sha, 0, *argv)
      end
    else
      def _call(*argv)
        @redis.evalsha(@sha, keys: [], argv: argv)
      end
    end

    def handle_no_script_error
      yield
    rescue ScriptNotLoadedRedisCommandError
      reload
      yield
    end

    # Module for notifying when a script hasn't yet been loaded
    module ScriptNotLoadedRedisCommandError
      MESSAGE = 'NOSCRIPT No matching script. Please use EVAL.'

      def self.===(error)
        error.is_a?(Redis::CommandError) && error.message == MESSAGE
      end
    end

    def script_contents
      @script_contents ||= File.read(File.join(SCRIPT_ROOT, "#{@name}.lua"))
    end
  end

  # Provides a simple way to load and use lua-based Qless plugins.
  # This combines the qless-lib.lua script plus your custom script
  # contents all into one script, so that your script can use
  # Qless's lua API.
  class LuaPlugin < LuaScript
    def initialize(name, redis, plugin_contents)
      @name  = name
      @redis = redis
      @plugin_contents = plugin_contents.gsub(COMMENT_LINES_RE, '')
      super(name, redis)
    end

  private

    def script_contents
      @script_contents ||= [QLESS_LIB_CONTENTS, @plugin_contents].join("\n\n")
    end

    COMMENT_LINES_RE = /^\s*--.*$\n?/

    QLESS_LIB_CONTENTS = File.read(
      File.join(SCRIPT_ROOT, 'qless-lib.lua')
    ).gsub(COMMENT_LINES_RE, '')
  end
end


text:
require 'rails_helper'

describe PagerDutyReportsController do
  describe 'GET #index' do
    it 'requires login' do
      get :index
      expect(response).to redirect_to '/users/sign_in'
    end
  end
end

feature 'Logged in access to pager duty reports', type: :feature do
  scenario 'visitor finds incident through links' do
    FactoryGirl.create(:domain)
    user = FactoryGirl.create(:confirmed_user)
    login_as(user, scope: :user)
    FactoryGirl.create(:business_unit)
    FactoryGirl.create(:pager_duty_config)
    FactoryGirl.create(:pager_duty_incident)
    FactoryGirl.create(:pager_duty_report)
    visit root_path
    expect(page).to have_content 'MyString'
    click_link 'Show'
    expect(page).to have_content 'MyString'
  end
end


text:
'use strict';

const userMetaService = require('../../services/userMetaService');
const _ = require('lodash');

const RPC_EMULATOR_MODEL = [
    {
        id: 'ORWTPD1_GETEDATS',
        name: 'ORWTPD1 GETEDATS',
        function: 'GETEDATS^ORWTPD1',
        parameters: ['ORQQEAPT ENC APPT START', 'ORQQEAPT ENC APPT STOP'],
        files: [],
        domain: 'ORDER',
        labels: ['META'],
        services: ['userMetaService.lookupAppointmentDateRange'],
        rpcType: 'READ',
        complexity: 'MEDIUM',
        description: 'Get user's (all levels) Encounter app't date range params.',
        returnType: 'SINGLE VALUE',
        inputParameters: [],
        invokeRPC: (rpcArgs, session, callback) => {
            userMetaService.lookupAppointmentDateRange(session, callback);
        },
        formatResult: (res) => {
            const startDate = _.isNil(res.startDate) ? '' : res.startDate;
            const stopDate = _.isNil(res.stopDate) ? '' : res.stopDate;

            return `${startDate}^${stopDate}`;
        },
    },
];

module.exports.rpcEmulatorModel = RPC_EMULATOR_MODEL;