text:
#include "pebble.h"
#include "morpheuz.h"
#include "language.h"
#include "rootui.h"

#ifdef PBL_RECT

VERSION_EXTERNAL;

// Constants
#define BED_FINISH GRect(8, 17, 127, 70)
#define SLEEPER_FINISH GRect(25, 24, 110, 29)
#define HEAD_FINISH GRect(25, 24, 19, 16)
#define TEXT_FINISH GRect(26, 72, 92, 15)
#define BLOCK_FINISH GRect(0,169,144,78)
#define BED_START GRect(-144-8, 17, 127, 70)
#define SLEEPER_START GRect(25+144, 24, 110, 29)
#define HEAD_START GRect(25, -24, 19, 16)
#define TEXT_START GRect(26, 25, 92, 15)
#define BLOCK_START GRect(0,91,144,78)

#define LOGO_BED_ANIMATION 0
#define LOGO_SLEEPER_ANIMATION 1
#define LOGO_HEAD_ANIMATION 2
#define LOGO_TEXT_ANIMATION 3
#define BLOCK_ANIMATION 4
#define MAX_ANIMATIONS 5

// Private
static BitmapLayerComp logo_bed;
static BitmapLayerComp logo_sleeper;
static BitmapLayerComp logo_text;
static BitmapLayerComp logo_head;
static TextLayer *block_layer;
static struct PropertyAnimation *animations[MAX_ANIMATIONS];
#ifdef PBL_COLOR
static uint8_t text_color_count = 0;
#endif
static char version_txt[5];

// Shared with rootui, rectui, roundui, primary_window with main and notice_font with noticewindows
extern UiCommon ui;

static void animation_stopped(Animation *animation, bool finished, void *data);

/*
 * Set up a single animation
 */
static void build_an_animate(Layer *layer, GRect *start, GRect *finish, uint32_t duration, uint8_t id) {
  animations[id] = property_animation_create_layer_frame(layer, start, finish);
  animation_set_duration((Animation*) animations[id], duration);
  animation_set_handlers((Animation*) animations[id], (AnimationHandlers ) { .stopped = (AnimationStoppedHandler) animation_stopped, }, NULL /* callback data */);
  animation_schedule((Animation*) animations[id]);
}

/*
 * End of initial animation sequence - occurs 4 then 5 times
 */
static void animation_stopped(Animation *animation, bool finished, void *data) {
  ui.animation_count++;
  if (ui.animation_count == 4) {
    light_enable_interaction();
    build_an_animate(bitmap_layer_get_layer_jf(logo_head.layer), &HEAD_START, &HEAD_FINISH, ANIMATE_HEAD_DURATION, LOGO_HEAD_ANIMATION);
  } else if (ui.animation_count == 5) {
    analogue_visible(get_config_data()->analogue, true);
  }
}

/*
 * Start title animation sequence
 */
static void start_animate(void *data) {
  light_enable_interaction();

  build_an_animate(bitmap_layer_get_layer_jf(logo_bed.layer), &BED_START, &BED_FINISH, ANIMATE_MAIN_DURATION, LOGO_BED_ANIMATION);
  build_an_animate(bitmap_layer_get_layer_jf(logo_sleeper.layer), &SLEEPER_START, &SLEEPER_FINISH, ANIMATE_MAIN_DURATION, LOGO_SLEEPER_ANIMATION);
  build_an_animate(bitmap_layer_get_layer_jf(logo_text.layer), &TEXT_START, &TEXT_FINISH, ANIMATE_MAIN_DURATION, LOGO_TEXT_ANIMATION);
  build_an_animate(text_layer_get_layer_jf(block_layer), &BLOCK_START, &BLOCK_FINISH, ANIMATE_MAIN_DURATION, BLOCK_ANIMATION);
  text_layer_destroy(ui.version_text);
  text_layer_set_text(block_layer, "");
}

#ifdef PBL_COLOR
/*
 * Move copyright text through color cycle
 */
static void text_color_cycle(void *data) {
  if (text_color_count >= 8) {
    start_animate(NULL);
    return;
  }
  text_layer_set_text_color(block_layer, bar_color(text_color_count));
  text_color_count++;
  app_timer_register(INTER_TEXT_COLOR_MS, text_color_cycle, NULL);
}
#endif

/*
 * Load on window load
 */
EXTFN void morpheuz_load(Window *window) {

  ui.animation_count = 0;

  window_set_background_color(window, BACKGROUND_COLOR);

  ui.notice_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_DIGITAL_16));
  ui.time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_DIGITAL_38));

  Layer *window_layer = window_get_root_layer(window);

  ui.powernap_layer = macro_text_layer_create(GRect(5, -3, 20, 19), window_layer, GColorWhite, BACKGROUND_COLOR, fonts_get_system_font(FONT_KEY_GOTHIC_14), GTextAlignmentCenter);

  macro_bitmap_layer_create(&logo_bed, BED_START, window_layer, RESOURCE_ID_IMAGE_LOGO_BED, true);

  macro_bitmap_layer_create(&logo_sleeper, SLEEPER_START, window_layer, RESOURCE_ID_IMAGE_LOGO_SLEEPER, true);

  macro_bitmap_layer_create(&logo_text, TEXT_START, window_layer, RESOURCE_ID_IMAGE_LOGO_TEXT, true);

  macro_bitmap_layer_create(&logo_head, HEAD_START, window_layer, RESOURCE_ID_IMAGE_LOGO_HEAD, true);

  ui.version_text = macro_text_layer_create(GRect(26, 43, 92, 30), window_layer, GColorWhite, GColorClear, ui.notice_font, GTextAlignmentCenter);
  snprintf(version_txt, sizeof version_txt, "%d.%d", VERSION_MAJOR, VERSION_MINOR);
  text_layer_set_text(ui.version_text, version_txt);

  #ifdef PBL_COLOR
      ui.text_time_shadow_layer = macro_text_layer_create(GRect(4, 113, 144, 42), window_layer, GColorOxfordBlue, BACKGROUND_COLOR, ui.time_font, GTextAlignmentCenter);
  #endif

  ui.text_time_layer = macro_text_layer_create(GRect(0, 109, 144, 42), window_layer, GColorWhite, GColorClear, ui.time_font, GTextAlignmentCenter);

  ui.text_date_smart_alarm_range_layer = macro_text_layer_create(GRect(0, 86, 144, 31), window_layer, GColorWhite, BACKGROUND_COLOR, fonts_get_system_font(FONT_KEY_GOTHIC_24), GTextAlignmentCenter);

  init_icon_cache();
  ui.icon_bar = macro_layer_create(GRect(26, ICON_TOPS, ICON_BAR_WIDTH, 12), window_layer, &icon_bar_update_callback);

  ui.progress_layer = macro_layer_create(GRect(11, 157, 121, 9), window_layer, &progress_layer_update_callback);

  block_layer = macro_text_layer_create(BLOCK_START, window_layer, COPYRIGHT_COLOR, BACKGROUND_COLOR, ui.notice_font, GTextAlignmentCenter);
  text_layer_set_text(block_layer, COPYRIGHT);

  analogue_window_load(window);

  macro_bitmap_layer_create(&ui.alarm_button_top, GRect(114, 17, 30, 30), window_layer, RESOURCE_ID_BUTTON_ALARM_TOP, false);
  macro_bitmap_layer_create(&ui.alarm_button_button, GRect(114, 120, 30, 30), window_layer, RESOURCE_ID_BUTTON_ALARM_BOTTOM, false);

  morpheuz_load_standard_postamble();

  #ifndef PBL_COLOR
    app_timer_register(PRE_ANIMATE_DELAY, start_animate, NULL);
  #else
    app_timer_register(INTER_TEXT_COLOR_MS, text_color_cycle, NULL);
  #endif
}

/*
 * Shutdown
 */
EXTFN void morpheuz_unload(Window *window) {

  hide_notice_layer(NULL);

  // Save space by not clearing up on close on aplite. Feels bad, but so do crashes for no heap.
  #ifndef PBL_PLATFORM_APLITE

  tick_timer_service_unsubscribe();
  battery_state_service_unsubscribe();
  bluetooth_connection_service_unsubscribe();
  accel_data_service_unsubscribe();

  #endif

  save_config_data(NULL);
  save_internal_data();

  // Save space by not clearing up on close on aplite. Feels bad, but so do crashes for no heap.
  #ifndef PBL_PLATFORM_APLITE

  analogue_window_unload();

  layer_destroy(ui.progress_layer);
  layer_destroy(ui.icon_bar);
  destroy_icon_cache();

  text_layer_destroy(ui.text_time_layer);
  text_layer_destroy(ui.text_date_smart_alarm_range_layer);
  text_layer_destroy(ui.powernap_layer);

  #ifdef PBL_COLOR
    text_layer_destroy(ui.text_time_shadow_layer);
  #endif

  macro_bitmap_layer_destroy(&logo_bed);
  macro_bitmap_layer_destroy(&logo_sleeper);
  macro_bitmap_layer_destroy(&logo_text);
  macro_bitmap_layer_destroy(&logo_head);
  macro_bitmap_layer_destroy(&ui.alarm_button_top);
  macro_bitmap_layer_destroy(&ui.alarm_button_button);

  fonts_unload_custom_font(ui.time_font);
  fonts_unload_custom_font(ui.notice_font);

  #ifdef VOICE_SUPPORTED
    tidy_voice();
  #endif

  #endif
}

/*
 * Hide the bed when making the analogue face visible
 */
EXTFN void bed_visible(bool value) {
  layer_set_hidden(bitmap_layer_get_layer_jf(logo_bed.layer), !value);
  layer_set_hidden(bitmap_layer_get_layer_jf(logo_head.layer), !value);
}

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<environment>
  <environ>
    <!--  <var name='PENV1_LOC' value='/private/var/acrisel/sand/environ/environdev/environ/example/penv1/' />  -->
    <import name='PENV1' path='${PWD}/../penv1/' comment='Import local penv1 sandbox'/>
    <var name='PENV2_PROJ_LOC' value='/private/var/acrisel/sand/environ/environdev/environ/example/penv2/' export='True' virtual='True'/>
    <var name='ENV_NAME' value='atest' export='True'/>
  </environ>
</environment>

redpajama_set_name: RedPajamaGithub


text:
package com.oberasoftware.home.zwave.eventhandlers.events;

import com.oberasoftware.base.event.Event;
import com.oberasoftware.base.event.EventSubscribe;
import com.oberasoftware.home.zwave.api.ZWaveConverter;
import com.oberasoftware.home.zwave.api.events.SupportsConversion;
import com.oberasoftware.home.zwave.api.events.controller.ApplicationCommandEvent;
import com.oberasoftware.home.zwave.api.events.devices.MultiInstanceDiscoveryEvent;
import com.oberasoftware.home.zwave.api.messages.types.CommandClass;
import com.oberasoftware.home.zwave.core.utils.MessageUtil;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;

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

import static org.slf4j.LoggerFactory.getLogger;

/**
 * @author renarj
 */
@Component
public class MultiInstanceConverter implements ZWaveConverter {
    private static final Logger LOG = getLogger(MultiInstanceConverter.class);

    private static final int MULTI_CHANNEL_ENCAP = 0x0d;
    private static final int MULTI_CHANNEL_ENDPOINT_REPORT = 0x08;

    @EventSubscribe
    @SupportsConversion(commandClass = CommandClass.MULTI_INSTANCE)
    public Event convert(ApplicationCommandEvent event) {
        int nodeId = event.getNodeId();
        byte[] payload = event.getPayload();

        int command = payload[0];
        switch(command) {
            case MULTI_CHANNEL_ENCAP:
                int endpointId = payload[1];
                CommandClass commandClass = MessageUtil.getCommandClass(payload[3]);

                LOG.debug("Received multi instance command for node: {} and endpoint: {} for commandClass: {}", nodeId, endpointId, commandClass);

                return new ApplicationCommandEvent(nodeId, endpointId, commandClass, Arrays.copyOfRange(payload, 4, payload.length + 1));
            case MULTI_CHANNEL_ENDPOINT_REPORT:
                boolean endpointsAreTheSameDeviceClass = (payload[1] & 0x40) != 0;
                int endpoints = payload[2] & 0x7F;

                LOG.debug("Endpoints being reported amount: {} for node: {}", endpoints, nodeId);

                List<Integer> foundEndpoints = new ArrayList<>();
                for (int i=1; i <= endpoints; i++) {
                    LOG.debug("Endpoint reported: {} for node: {}", i, nodeId);
                    foundEndpoints.add(i);
                }

                LOG.debug("Received a multi channel endpoint report from node: {}", nodeId);
                return new MultiInstanceDiscoveryEvent(nodeId, foundEndpoints);
            default:
                LOG.debug("Command: {} not supported for multi instance command from node: {}", command, nodeId);
                return null;
        }

    }
}


text:
package org.wrml.server;

/**
 * A place-holder for this package's design.
 */
public interface Server {

}


text:
package br.com.salomao.smarttictactoe.view;

import android.app.Application;

public class SmartTicTacToeApplication extends Application {

}


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy

#def prepare_input(filename, num_components):
#    """Read in from file of averages and output them as new .thin
#    files that are compatible with the expected format:
#    mu_i, ... , mu_N, T, beta, gc energy, low temp expansion
#
#
#    :filename: file name, presumably casm output
#    :num_components: integer of how many components are in your system (how many chemical potentials)
#    :returns: void, but you'll end up with a new file
#
#    """
#    datadump=numpy.loadtxt(filename, comments='#')
#
#    desiredcolumns=[]
#    for compind in range(0,num_components):
#        mucolumnind=3+num_components+3+compind
#        desiredcolumns.append(datadump[:, mucolumnind])
#
#    for compind in range(0,num_components):
#        speciescolumnind=3+compind
#        desiredcolumns.append(datadump[:, speciescolumnind])
#
#    tempcolumnind=3+num_components+1
#    desiredcolumns.append(datadump[:, tempcolumnind])
#
#    betacolumnind=tempcolumnind+1
#    desiredcolumns.append(datadump[:, betacolumnind])
#
#    gcecolumnind=3+num_components
#    desiredcolumns.append(datadump[:, gcecolumnind])
#
#    lowtexpcolumnind=0  #not really
#    desiredcolumns.append(datadump[:, gcecolumnind])    #make this a real thing to actually account for low T expansion
#
#
#
#    #column for free energy
#    emptyfreeenergy=numpy.empty(numpy.shape(desiredcolumns[-1]))
#    emptyfreeenergy.fill(numpy.nan)
#    desiredcolumns.append(emptyfreeenergy)
#
#    desireddata=numpy.array(desiredcolumns)
#    desireddata=numpy.transpose(desireddata)
#
#    outputname=filename+".thin"
#    numpy.savetxt(outputname, desireddata)
#
#    return

def mu_ind(component, num_components):
    """Return index into chemical potential column of specified component

    :data: double numpy array of all monte values
    :component: index into component of interest. Start counting at 0.
    :num_components: integer of total number of components
    :returns: integer

    """
    return component

def species_ind(component, num_components):
    """Return index into column of number of species
    for the specified component

    :component: ind
    :num_components: ind
    """
    return num_components+component

def temperature_ind(num_components):
    """Return index into temperature column

    :num_components: integer of total number of components
    :returns: integer

    """
    return 2*num_components

def beta_ind(num_components):
    """Return index into beta column

    :num_components: integer of total number of components
    :returns: integer

    """
    return temperature_ind(num_components)+1

def energy_ind(num_components):
    """Return index into energy column

    :num_components: integer of total number of components
    :returns: integer

    """
    return beta_ind(num_components)+1

def energy2_ind(num_components):
    """Return index into average of square energy column

    :num_components: integer of total number of components
    :returns: integer

    """
    return energy_ind(num_components)+1

def low_T_expansion_ind(num_components):
    """Return index into low temperature expansion column

    :num_components: integer of total number of components
    :returns: integer

    """
    return energy2_ind(num_components)+1

def free_energy_ind(num_components):
    """Return index into free energy column

    :num_components: integer of total number of components
    :returns: integer

    """
    return low_T_expansion_ind(num_components)+1

def mu(data, component, num_components):
    """Fetch values for the specified component chemical potential

    :data: double numpy array of all monte values
    :component: index into component of interest. Start counting at 0.
    :num_components: integer of total number of components
    :returns: numpy array of chemical potentials

    """
    return data[:,mu_ind(component, num_components)]

def species(data, component, num_components):
    """Fetch values for the specified component number of species

    :data: double numpy array of all monte values
    :component: index into component of interest. Start counting at 0.
    :num_components: integer of total number of components
    :returns: numpy array of chemical potentials

    """
    return data[:,species_ind(component, num_components)]

def temperature(data, num_components):
    """Fetch values for temperature

    :data: double numpy array of all monte values
    :num_components: integer of total number of components
    :returns: numpy array of temperature

    """
    return data[:, temperature_ind(num_components)]

def beta(data, num_components):
    """Fetch values for beta

    :data: double numpy array of all monte values
    :num_components: integer of total number of components
    :returns: numpy array of beta

    """
    return data[:, beta_ind(num_components)]

def energy(data, num_components):
    """Fetch values for grand canonical energy

    :data: double numpy array of all monte values
    :num_components: integer of total number of components
    :returns: numpy array of grand canonical energy

    """
    return data[:, energy_ind(num_components)]

def energy2(data, num_components):
    """Fetch average values for the square of the grand
    canonical energy

    :data: double numpy array of all monte values
    :num_components: integer of total number of components
    :returns: numpy array of grand canonical energy

    """
    return data[:, energy2_ind(num_components)]

def low_T_expansion(data, num_components):
    """Fetch values for low temperature expansion

    :data: double numpy array of all monte values
    :num_components: integer of total number of components
    :returns: numpy array of low temperature expansion

    """
    return data[:, low_T_expansion_ind(num_components)]

def free_energy(data, num_components):
    """Fetch values for grand canonical free energy

    :data: double numpy array of all monte values
    :num_components: integer of total number of components
    :returns: numpy array of grand canonical energy

    """
    return data[:, free_energy_ind(num_components)]

def backwards(data):
    """Invert the order of your data and return a view.

    :data: double numpy array of all monte values
    :num_components: integer of total number of components
    :returns: numpy array in new order

    """
    data=data[::-1]
    return data


text:
[@google-github-actions/actions-utils](../README.md) / [Exports](../modules.md) / errors

# Module: errors

## Table of contents

### Functions

- [errorMessage](errors.md#errormessage)
- [isNotFoundError](errors.md#isnotfounderror)

## Functions

### errorMessage

▸ **errorMessage**(`err`): `string`

errorMessage extracts the error message from the given error. It does this
via best effort and makes the error embeddable in other errors. It discards
any error details including stacktraces.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `err` | `unknown` | Error input. |

#### Returns

`string`

Error information as a string.

#### Defined in

[errors.ts:26](https://github.com/google-github-actions/actions-utils/blob/main/src/errors.ts#L26)

___

### isNotFoundError

▸ **isNotFoundError**(`err`): `boolean`

isNotFoundError determines if the given error is "not found". Since there's
literally no way to actually do this in Node, it inspects the string output
for "ENOENT".

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `err` | `unknown` | The error result to check. |

#### Returns

`boolean`

Boolean, true if the error represents NotFound, false otherwise.

#### Defined in

[errors.ts:75](https://github.com/google-github-actions/actions-utils/blob/main/src/errors.ts#L75)


text:
package eu.spaziodati.batchrefine.core.split;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

public class SplitLogicFactory {

	public ISplitLogic getSplitter(String name, String parameter) {

		if (name.equals("LINE"))
			return new LineNumberSplit(parameter);
		else if (name.equals("CHUNK"))
			return new ChunkSplit(parameter);
		else
			throw new RuntimeException("Split logic is not identified: " + name);
	}

	public interface ISplitLogic {
		public ArrayList<TransformTask> splitFile(File inputFile,
				File tmpDirectory) throws IOException;

		public class TransformTask {

			private Future<Object> future;
			private final int fTaskId;
			private final File fInput;
			private final File fOutput;
			private int failCount =0;

			public TransformTask(File input, int taskId, File tmpFolder) {
				fInput = input;
				fOutput = new File(tmpFolder, "/out/part" + taskId);
				fTaskId = taskId;
			}

			public void setFuture(Future<Object> f) {
				future = f;
			}

			public void failed(Exception e) throws Exception {
				if (failCount == 0)
				failCount ++;
				else throw e;
			}

			public void get() throws InterruptedException, ExecutionException {
				future.get();
			}

			public URI getOutput() {
				return fOutput.toURI();
			}

			public URI getInput() {
				return fInput.toURI();
			}

			public int getTaskId() {
				return fTaskId;
			}
		}
	}

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class gov.nih.nci.cabig.caaers.domain.StudyOrganization
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
gov.nih.nci.cabig.caaers.domain.StudyOrganization

Packages that use StudyOrganization

gov.nih.nci.cabig.caaers.dao

gov.nih.nci.cabig.caaers.domain

gov.nih.nci.cabig.caaers.domain.repository

gov.nih.nci.cabig.caaers.resolver

Uses of StudyOrganization in gov.nih.nci.cabig.caaers.dao

Methods in gov.nih.nci.cabig.caaers.dao that return types with arguments of type StudyOrganization

 java.util.List<StudyOrganization>
StudyDao.getStudyOrganizations(AbstractQuery query)

          This method return all the StudyOrganiations for a given Organization ID.

Method parameters in gov.nih.nci.cabig.caaers.dao with type arguments of type StudyOrganization

 void
StudyDao.reassociateStudyOrganizations(java.util.List<StudyOrganization> studyOrgs)

          This utility method is used to lock the study.

Uses of StudyOrganization in gov.nih.nci.cabig.caaers.domain

Subclasses of StudyOrganization in gov.nih.nci.cabig.caaers.domain

 class
StudyCoordinatingCenter

          This class represents the StudyCoordinatingCenter domain object associated with the Adverse event
 report.

 class
StudyFundingSponsor

          This class represents the StudyFundingSponsor domain object associated with the Adverse event
 report.

 class
StudySite

          This class represents the StudySite domain object associated with the Adverse event report.

Fields in gov.nih.nci.cabig.caaers.domain with type parameters of type StudyOrganization

protected  java.util.List<StudyOrganization>
Study.studyOrganizations

          The study organizations.

protected  java.util.List<StudyOrganization>
Organization.studyOrganizations

          The study organizations.

Methods in gov.nih.nci.cabig.caaers.domain that return StudyOrganization

 StudyOrganization
StudyPersonnel.getStudyOrganization()

 StudyOrganization
StudyOrganizationChild.getStudyOrganization()

          Gets the study organization.

 StudyOrganization
StudyInvestigator.getStudyOrganization()

abstract  StudyOrganization
AbstractSponsor.getStudyOrganization()

          Gets the study organization.

Methods in gov.nih.nci.cabig.caaers.domain that return types with arguments of type StudyOrganization

 java.util.List<StudyOrganization>
Study.getActiveStudyOrganizations()

          Will return the StudyOrganizations that are not retired.

 java.util.List<StudyOrganization>
Study.getStudyOrganizations()

          Gets the study organizations.

 java.util.List<StudyOrganization>
Organization.getStudyOrganizations()

          Gets the study organizations.

 java.util.List<StudyOrganization>
Study.getUniqueStudyOrganizations()

          Gets the unique study organizations.

Methods in gov.nih.nci.cabig.caaers.domain with parameters of type StudyOrganization

 void
Study.addStudyOrganization(StudyOrganization so)

          Adds the study organization.

 void
Organization.addStudyOrganization(StudyOrganization studyOrg)

          Adds the study organization.

 void
Study.removeStudyOrganization(StudyOrganization so)

          Removes the study organization.

 void
StudyPersonnel.setStudyOrganization(StudyOrganization studyOrganization)

 void
StudyOrganizationChild.setStudyOrganization(StudyOrganization studyOrg)

          Sets the study organization.

 void
StudyInvestigator.setStudyOrganization(StudyOrganization studyOrganization)

Method parameters in gov.nih.nci.cabig.caaers.domain with type arguments of type StudyOrganization

 void
Study.setStudyOrganizations(java.util.List<StudyOrganization> studyOrganizations)

          Sets the study organizations.

 void
Organization.setStudyOrganizations(java.util.List<StudyOrganization> studyOrganizations)

          Sets the study organizations.

Constructors in gov.nih.nci.cabig.caaers.domain with parameters of type StudyOrganization

StudyOrganizationChildInstantiateFactory(StudyOrganization studyOrg,
                                         java.lang.Class<T> classToInit)

          Instantiates a new study organization child instantiate factory.

Uses of StudyOrganization in gov.nih.nci.cabig.caaers.domain.repository

Methods in gov.nih.nci.cabig.caaers.domain.repository that return types with arguments of type StudyOrganization

 java.util.List<StudyOrganization>
OrganizationRepositoryImpl.getApplicableOrganizationsFromStudyOrganizations(java.lang.String text,
                                                 java.lang.Integer studyId)

 java.util.List<StudyOrganization>
OrganizationRepository.getApplicableOrganizationsFromStudyOrganizations(java.lang.String text,
                                                 java.lang.Integer studyId)

          Gets the applicable organizations from study organizations.

Methods in gov.nih.nci.cabig.caaers.domain.repository with parameters of type StudyOrganization

 void
StudyRepository.clearStudyInvestigators(StudyOrganization so)

          Clear study investigators.

 void
StudyRepository.clearStudyPersonnel(StudyOrganization so)

          Clear study personnel.

Uses of StudyOrganization in gov.nih.nci.cabig.caaers.resolver

Methods in gov.nih.nci.cabig.caaers.resolver with parameters of type StudyOrganization

 void
RemoteStudyResolver.populateIdentifer(RemoteStudy remoteStudy,
                  StudyOrganization studyOrganization,
                  java.lang.String identifierValue,
                  java.lang.String organizationRole)

          This method creates a OrganizationAssignedIdentifer and assign's it to the Study.

 void
RemoteStudyResolver.populateStudyInvestigators(gov.nih.nci.coppa.services.pa.StudySite coppaStudySite,
                           StudyOrganization studyOrganization)

          This method invokes STUDY_SITE_CONTACT.getByStudySite to fetch Site Investigator for a Study.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
package lebah.portal;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;

/**
 * @author Shamsul Bahrin Abd Mutalib
 * @version 1.01
 */
public class Footer extends lebah.portal.velocity.VTemplate {

	public Footer(VelocityEngine engine, VelocityContext context, HttpServletRequest req, HttpServletResponse res) {
		super(engine, context, req, res);
	}

	public Template doTemplate() throws Exception {
		Template template = engine.getTemplate("vtl/main/footer.vm");
		return template;
	}
}


text:
#region License
// The MIT License (MIT)
//
// Copyright (c) 2016 João Simões
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#endregion
namespace SimpleSOAPClient.Models.Headers.Oasis.Security
{
    using System;
    using System.Xml.Serialization;

    /// <summary>
    /// Represents a SOAP Security timestamp
    /// </summary>
    [XmlType("Timestamp",
        Namespace = Constant.Namespace.OrgOpenOasisDocsWss200401Oasis200401WssWssecurityUtility10)]
    public class Timestamp
    {
        /// <summary>
        /// The timestamp id
        /// </summary>
        [XmlAttribute("Id",
            Namespace = Constant.Namespace.OrgOpenOasisDocsWss200401Oasis200401WssWssecurityUtility10)]
        public string Id { get; set; }

        /// <summary>
        /// The date and time when the timestamp was created
        /// </summary>
        [XmlElement("Created",
            Namespace = Constant.Namespace.OrgOpenOasisDocsWss200401Oasis200401WssWssecurityUtility10)]
        public DateTime Created { get; set; }

        /// <summary>
        /// The date and time when the timestamp expired
        /// </summary>
        [XmlElement("Expires",
            Namespace = Constant.Namespace.OrgOpenOasisDocsWss200401Oasis200401WssWssecurityUtility10)]
        public DateTime Expires { get; set; }
    }
}


text:
module Ramsey
  class Index
    class Configuration < Ramsey::Configuration
      config_attr :properties
      config_attr :type
      config_attr :path
    end
  end
end


text:
package org.slc.sli.dashboard.security;

import org.scribe.builder.api.DefaultApi20;
import org.scribe.extractors.AccessTokenExtractor;
import org.scribe.model.OAuthConfig;
import org.scribe.utils.OAuthEncoder;
import org.scribe.utils.Preconditions;

/**
 * Class has the information needed for integrating with OAuth to which implement for the Scribe library.
 *
 * @author jnanney
 *
 */
public class SliApi extends DefaultApi20 {

    private static String apiUrl;
    private String authorizeUrl = apiUrl.replaceAll("/$", "") + "/api/oauth/authorize?response_type=code&client_id=%s&redirect_uri=%s";

    @Override
    public String getAccessTokenEndpoint() {
        return apiUrl.replaceAll("/$", "") + "/api/oauth/token?grant_type=authorization_code";
    }

    @Override
    public String getAuthorizationUrl(OAuthConfig config) {
        Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback.");

        return String.format(authorizeUrl, config.getApiKey(), OAuthEncoder.encode(config.getCallback()));
    }

    @Override
    public AccessTokenExtractor getAccessTokenExtractor() {
      return new SliTokenExtractor();
    }

    public String getApiUrl() {
        return apiUrl;
    }

    public static void setBaseUrl(String baseUrl) {
        apiUrl = baseUrl;
    }

}


text:
from __future__ import unicode_literals

import six

from django.db import models

class OptionsLazy(object):

    def __init__(self, name, klass):
        self.name = name
        self.klass = klass

    def __get__(self, instance=None, owner=None):
        return self.klass(owner)

class OptionsBase(type):
    def __new__(cls, *args, **kwargs):
        new_class = super(OptionsBase, cls).__new__(cls, *args, **kwargs)
        if new_class.model_class and new_class.meta_name:
            setattr(new_class.model_class, new_class.meta_name, OptionsLazy(new_class.meta_name, new_class))
        return new_class

class Options(six.with_metaclass(OptionsBase, object)):

    meta_class_name = None
    meta_name = None
    attributes = None
    model_class = None

    def __init__(self, model):
        self.model = model

        for key, default_value in self._get_attributes(model).items():
            setattr(self, key, self._getattr(key, default_value))

    def _get_attributes(self, model):
        return self.attributes

    def _getattr(self, name, default_value):
        meta_models = [b for b in self.model.__mro__ if issubclass(b, models.Model)]
        for model in meta_models:
            meta = getattr(model, self.meta_class_name, None)
            if meta:
                value = getattr(meta, name, None)
                if value is not None:
                    return value
        return default_value


text:
using System;
using Gtk;

using ShadowrunLogic;
using ShadowrunCoreContent;
using System.Collections.Generic;
using ShadowrunGui;

public partial class ShadowrunToolMainWindow: Gtk.Window
{
	private List<IManifest<IManifestItem>> rangedWeaponManifests;
	private List<IManifest<IManifestItem>> meleeWeaponManifests;
	private List<IManifest<IManifestItem>> attributeManifests;

	private List<Character> characterList;

	public ShadowrunToolMainWindow (): base (Gtk.WindowType.Toplevel)
	{
		Build ();
		rangedWeaponManifests = new List<IManifest<IManifestItem>>();
		meleeWeaponManifests = new List<IManifest<IManifestItem>>();
		attributeManifests = new List<IManifest<IManifestItem>>();
		LoadContentFromManifests();
	}

	private void LoadContentFromManifests ()
	{
		rangedWeaponManifests.Add(new ShadowrunCoreContent.RangedWeaponsManifest());
		meleeWeaponManifests.Add (new ShadowrunCoreContent.MeleeWeaponsManifest());
		attributeManifests.Add(new ShadowrunCoreContent.AttributesManifest());
	}

	private AbstractAttributes attributesFromFormInput(){
		return new CustomAttributes(
			Int32.Parse(Body_Textbox.Text),
			Int32.Parse(Agility_Textbox.Text),
			Int32.Parse(Reaction_Textbox.Text),
			Int32.Parse(Strength_Textbox.Text),
			Int32.Parse (Willpower_Textbox.Text),
			Int32.Parse (Logic_Textbox.Text),
			Int32.Parse (Intuition_Textbox.Text),
			Int32.Parse (Charisma_Textbox.Text),
			Int32.Parse (InitiativeDiceCount_Textbox.Text),
			Int32.Parse (InitiativeModifier_Textbox.Text),
			Int32.Parse (Armor_Textbox.Text),
			Name_Textbox.Text,
			AttributeType.Custom,
			(int)Archery_Spinbox.Value,
			(int)AutomaticsSpinbox.Value,
			(int)Blades_Spinbox.Value,
			(int)Clubs_Spinbox.Value,
			(int)HeavyWeapons_Spinbox.Value,
			(int)Longarms_Spinbox.Value,
			(int)Pistols_Spinbox.Value,
			(int)ThrowingWeapons_Spinbox.Value,
			(int)UnarmedCombat_Spinbox.Value);
	}

	#region FormEvents
	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}

	protected void AttributeImport_Click (object sender, EventArgs e)
	{
		var attributesImportWindow = new ImportWindow(attributeManifests,"Attribute Import");
		attributesImportWindow.TransientFor = this;

		attributesImportWindow.Destroyed+= delegate {
			if(attributesImportWindow.selectedItem == null)
				return;
			var selectedAttributes = (AbstractAttributes)attributesImportWindow.selectedItem;
			SetRenderedAttributes(selectedAttributes);
		};

	}

	protected void RangedWeaponImport_Click (object sender, EventArgs e)
	{
		var rangedImportWeaponWindow = new ImportWindow(rangedWeaponManifests,"Ranged Weapon Import");
		rangedImportWeaponWindow.TransientFor = this;

		rangedImportWeaponWindow.Destroyed+= delegate {
			if(rangedImportWeaponWindow.selectedItem == null)
				return;
			var selectedRangedWeapon = (AbstractRangedWeapon)rangedImportWeaponWindow.selectedItem;
			SetRenderedRangedWeapon(selectedRangedWeapon);
		};
	}

	protected void MeleeWeaponImport_Click (object sender, EventArgs e)
	{
		var meleeImportWeaponWindow = new ImportWindow(meleeWeaponManifests,"Melee Weapon Import");
		meleeImportWeaponWindow.TransientFor = this;

		meleeImportWeaponWindow.Destroyed+= delegate {
			if(meleeImportWeaponWindow.selectedItem == null)
				return;
			var selectedMeleeWeapon = (AbstractMeleeWeapon)meleeImportWeaponWindow.selectedItem;
			SetRenderedMeleeWeapon(selectedMeleeWeapon);
		};
	}
	#endregion

	#region DisplayStuff
	protected void SetRenderedRangedWeapon (AbstractRangedWeapon r)
	{
		RangedWeaponName_Textbox.Text = r.Name ();
		RangedDamage_Textbox.Text = r.Damage ().ToString ();
		if (r.DamageType () == DamageType.Stun)
			RangedStunDamage_Radio.Activate ();
		else
			RangedPhysicalDamage_Radio.Activate ();
		RangedAccuracy_Textbox.Text = r.Accuracy ().ToString ();
		RangedWeaponAP_Textbox.Text = r.AP ().ToString ();
		RangedRecoil_Textbox.Text = r.Recoil ().ToString ();

		var modes = r.FiringModes ();
		SingleShot_Checkbox.Active = modes.SingleShot;
		SemiAutomatic_Checkbox.Active = modes.SemiAutomatic;
		SemiAutomaticBurst_Checkbox.Active = modes.SemiAutomaticBurst;
		BurstFire_Checkbox.Active = modes.BurstFire;
		LongBurst_Checkbox.Active = modes.LongBurst;
		FullAuto_Checkbox.Active = modes.FullAuto;

		switch (r.Skill ()) {
		case RangedWeaponSkills.Archery:
			Archery_Radio.Activate ();
			break;
		case RangedWeaponSkills.Automatics:
			Automatics_Radio.Activate ();
			break;
		case RangedWeaponSkills.HeavyWeapons:
			HeavyWeapons_Radio.Activate ();
			break;
		case RangedWeaponSkills.Longarms:
			Longarms_Radio.Activate ();
			break;
		case RangedWeaponSkills.Pistols:
			Pistols_Radio.Activate ();
			break;
		case RangedWeaponSkills.ThrowingWeapons:
			ThrowingWeapons_Radio.Activate ();
			break;
		}
	}

	protected void SetRenderedMeleeWeapon (AbstractMeleeWeapon m)
	{
		MeleeWeaponName_Textbox.Text = m.Name ();
		MeleeAP_Textbox.Text = m.AP ().ToString ();

		if (m.DamageType () == DamageType.Stun)
			MeleeStunDamage_Radio.Activate ();
		else
			MeleePhysicalDamage_Radio.Activate ();

		MeleeDamage_Textbox.Text = m.Damage ().ToString ();

		switch (m.Skill ()) {
		case MeleeWeaponSkills.Blades:
			Blades_Radio.Activate();
			break;
		case MeleeWeaponSkills.Clubs:
			Clubs_Radio.Activate();
			break;
		case MeleeWeaponSkills.UnarmedCombat:
			Unarmed_Radio.Activate();
			break;
		}

	}

	protected void SetRenderedAttributes(AbstractAttributes a){

		this.Armor_Textbox.Text = a.Armor().ToString();

		//attributes
		this.Body_Textbox.Text = a.Body().ToString();
		this.Agility_Textbox.Text = a.Agility().ToString();
		this.Charisma_Textbox.Text = a.Charisma().ToString();
		this.InitiativeDiceCount_Textbox.Text = a.InitiativeDice().ToString();
		this.InitiativeModifier_Textbox.Text = a.InitiativeModifier().ToString();
		this.Intuition_Textbox.Text = a.Intuition().ToString();
		this.Logic_Textbox.Text = a.Logic().ToString();
		this.Reaction_Textbox.Text = a.Reaction().ToString();
		this.Strength_Textbox.Text = a.Strength().ToString();
		this.Willpower_Textbox.Text = a.Willpower().ToString();

		this.Name_Textbox.Text = a.Name();
		//combat skills
		this.Archery_Spinbox.Value = a.Archery();
		this.AutomaticsSpinbox.Value = a.Automatics();
		this.Blades_Spinbox.Value = a.Blades();
		this.Clubs_Spinbox.Value = a.Clubs();
		this.HeavyWeapons_Spinbox.Value = a.HeavyWeapons();
		this.Longarms_Spinbox.Value = a.Longarms();
		this.Pistols_Spinbox.Value = a.Pistols();
		this.ThrowingWeapons_Spinbox.Value = a.ThrowingWeapons();
		this.UnarmedCombat_Spinbox.Value = a.UnarmedCombat();
	}
	#endregion
}


text:
package ly.count.unity.push_fcm;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.unity3d.player.UnityPlayer;

import org.json.JSONObject;

import java.util.Map;

public class RemoteNotificationsService extends FirebaseMessagingService {

    private void createNotificationChannel() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            // Register the channel with the system; you can't change the importance
            // or other notification behaviors after this
            NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
            if (notificationManager != null) {
                // Create the NotificationChannel
                NotificationChannel channel =
                        new NotificationChannel(CountlyPushPlugin.CHANNEL_ID, getString(R.string.countly_hannel_name), NotificationManager.IMPORTANCE_DEFAULT);
                channel.setDescription(getString(R.string.countly_channel_description));

                channel.setLightColor(Color.GREEN);
                notificationManager.createNotificationChannel(channel);

                CountlyPushPlugin.log("NotificationChannel Created", CountlyPushPlugin.LogLevel.DEBUG);
            }
        }
    }

    public void getToken() {
        FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
            @Override
            public void onComplete(Task<InstanceIdResult> task) {
                if (!task.isSuccessful()) {
                    CountlyPushPlugin.log("getInstanceId failed", task.getException(), CountlyPushPlugin.LogLevel.DEBUG);
                    return;
                }

                // Get new Instance ID token
                String token = task.getResult().getToken();
                CountlyPushPlugin.log("Firebase token: " + token, CountlyPushPlugin.LogLevel.DEBUG);
                UnityPlayer.UnitySendMessage(CountlyPushPlugin.UNITY_ANDROID_BRIDGE, "OnTokenResult", token);
            }
        });
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        Map<String, String> data = remoteMessage.getData();

        CountlyPushPlugin.log("Message id: " + remoteMessage.getMessageId(), CountlyPushPlugin.LogLevel.DEBUG);
        CountlyPushPlugin.log("Message type: " + remoteMessage.getMessageType(), CountlyPushPlugin.LogLevel.DEBUG);
        CountlyPushPlugin.log("Message from: " + remoteMessage.getFrom(), CountlyPushPlugin.LogLevel.DEBUG);
        if (!data.isEmpty()) {
            JSONObject jsonObject = new JSONObject(remoteMessage.getData());
            UnityPlayer.UnitySendMessage(CountlyPushPlugin.UNITY_ANDROID_BRIDGE, "OnNotificationReceived", jsonObject.toString());
            CountlyPushPlugin.log("Message data: " + jsonObject.toString(), CountlyPushPlugin.LogLevel.DEBUG);
        }

        if (!data.isEmpty())
            ProcessData(data);
    }

    private void ProcessData(Map<String, String> data) {

        CountlyPushPlugin.Message message = CountlyPushPlugin.decodeMessage(data);
        CountlyPushPlugin.log("Message Impl " + message.toString(), CountlyPushPlugin.LogLevel.DEBUG);
        sendNotification(message);
    }

    private void sendNotification(CountlyPushPlugin.Message message) {
        Uri notificationSound = RingtoneManager.getDefaultUri(R.raw.boing);
        NotificationManager notificationManager =
                (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        Notification.Builder notificationBuilder;
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
            NotificationChannel channel = notificationManager.getNotificationChannel(CountlyPushPlugin.CHANNEL_ID);
            if (channel == null) {
                createNotificationChannel();
            }
            notificationBuilder = new Notification.Builder(this, CountlyPushPlugin.CHANNEL_ID);
        } else {
            notificationBuilder = new Notification.Builder(this);
        }

        Bitmap largeIconBitmap = BitmapFactory.decodeResource(getResources(),
                R.drawable.ic_stat);

        Intent notificationIntent = new Intent(this.getApplicationContext(), NotificationBroadcastReceiver.class);

        String messageId = message.getId();
        notificationIntent.putExtra(CountlyPushPlugin.KEY_ID, messageId);
        notificationIntent.putExtra(CountlyPushPlugin.EXTRA_MESSAGE, message);
        notificationIntent.putExtra(CountlyPushPlugin.EXTRA_ACTION_INDEX, 0);

        PendingIntent pendingIntent = PendingIntent.getBroadcast(this.getApplicationContext(), message.hashCode(), notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);

        notificationBuilder
                .setAutoCancel(true)
                .setSound(notificationSound)
                .setLargeIcon(largeIconBitmap)
                .setContentIntent(pendingIntent)
                .setSmallIcon(R.drawable.ic_stat)
                .setContentTitle(message.getTitle())
                .setContentText(message.getMessage());

        if (android.os.Build.VERSION.SDK_INT > 21) {
            notificationBuilder.setColor(getResources().getColor(R.color.color_notification));
        }

        for (int i = 0; i < message.getButtons().size(); i++) {
            CountlyPushPlugin.Message.Button button = message.getButtons().get(i);
            Intent buttonIntent = (Intent) notificationIntent.clone();
            buttonIntent.putExtra(CountlyPushPlugin.EXTRA_ACTION_INDEX, i + 1);

            if (android.os.Build.VERSION.SDK_INT > 16) {
                notificationBuilder.addAction(button.getIcon(), button.getTitle(), PendingIntent.getBroadcast(this.getApplicationContext(), message.hashCode() + i + 1, buttonIntent, PendingIntent.FLAG_CANCEL_CURRENT));
            }
        }

        notificationManager.notify(messageId, 0, notificationBuilder.build());
    }
}


text:
module Onoma
  # An item of a nomenclature is the core data.
  class Item
    attr_reader :nomenclature, :left, :right, :depth, :aliases, :parent_name
    attr_accessor :name, :attributes
    alias properties attributes

    # New item
    def initialize(nomenclature, name, options = {})
      @nomenclature = nomenclature
      @name = name.to_s
      @left, @right = @nomenclature.new_boundaries
      @depth = 0
      @parent = nil
      @parent_name = nil
      parent = options.delete(:parent)
      if parent.is_a?(Symbol) || parent.is_a?(String)
        @parent_name = parent.to_s
      else
        self.parent = parent
      end
      @attributes = ActiveSupport::HashWithIndifferentAccess.new
      @children = Set.new
      options.each do |k, v|
        set(k, v)
      end
    end

    def root?
      !parent
    end

    def parent=(item)
      old_parent_name = @parent_name
      old_parent = @parent
      if item.nil?
        @parent = nil
        @parent_name = nil
      else
        if item.is_a?(Symbol) || item.is_a?(String)
          item = nomenclature.find!(item.to_s)
        end
        if item.nomenclature != nomenclature
          raise 'Item must come from same nomenclature'
        end
        if item.parents.any? { |p| self == p } || self == item
          raise 'Circular dependency. Item can be parent of itself.'
        end
        @parent = item
        @parent_name = @parent.name.to_s
      end
      if old_parent_name != @parent_name
        old_parent.delete_child(self) if old_parent
        @parent.add_child(self) if @parent
        @nomenclature.rebuild_tree!
      end
    end

    def add_child(item)
      @children << item
    end

    def delete_child(item)
      @children.delete(item)
    end

    # Changes parent without rebuilding
    def parent_name=(name)
      @parent = nil
      @parent_name = name.to_s
    end

    def parent?
      parent.present?
    end

    def parent
      return @parent if @parent
      @parent = find_parent
      @parent.add_child(self) if @parent
      @parent
    end
    alias fetch_parent parent

    def find_parent
      @nomenclature.find(@parent_name)
    end

    def degree_of_kinship_with(other)
      other_item = item_for_comparison(other)
      a = self_and_parents.reverse
      b = other_item.self_and_parents.reverse
      return nil if a.first != b.first
      common_lineage = 0
      a.size.times do |index|
        break if a[index].nil? || b[index].nil? || a[index] != b[index]
        common_lineage += 1
      end
      a.size + b.size - 2 * common_lineage
    end

    def original_nomenclature_name
      return parent.name.to_sym unless root?
      nil
    end

    # Returns children recursively by default
    def children(options = {})
      if options[:index].is_a?(FalseClass)
        if options[:recursively].is_a?(FalseClass)
          @children.to_a
        else
          children(index: false, recursive: false).each_with_object([]) do |item, list|
            list << item
            list += item.children(index: false, recursive: true)
            list
          end
        end
      else
        if options[:recursively].is_a?(FalseClass)
          nomenclature.list.select do |item|
            @left < item.left && item.right < @right && item.depth == @depth + 1
          end
        else
          # @children ||=
          nomenclature.list.select do |item|
            @left < item.left && item.right < @right
          end
        end
      end
    end

    def root
      parent? ? parent.root : self
    end

    # Returns direct parents from the closest to the farthest
    def parents
      @parents ||= (parent.nil? ? [] : [parent] + parent.parents)
    end

    def self_and_children(options = {})
      [self] + children(options)
    end

    def self_and_parents
      [self] + parents
    end

    def rise(&block)
      result = yield(self)
      return result if result
      parent ? parent.rise(&block) : nil
    end

    # Computes left/right value for nested set
    # Returns right index
    def rebuild_tree!
      @nomenclature.forest_right = rebuild_tree(@nomenclature.forest_right + 1)
    end

    # Computes left/right value for nested set
    # Returns right index
    def rebuild_tree(left = 0, depth = 0)
      @depth = depth
      @left = left
      @right = @left + 1
      children(index: false, recursively: false).each do |child|
        @right = child.rebuild_tree(@right, @depth + 1) + 1
      end
      @right
    end

    # Returns true if the given item name match the current item or its children
    def include?(other)
      self >= other
    end

    # Return human name of item
    def human_name(options = {})
      I18n.translate("nomenclatures.#{nomenclature.name}.items.#{name}", options.merge(default: ["items.#{name}".to_sym, "enumerize.#{nomenclature.name}.#{name}".to_sym, "labels.#{name}".to_sym, name.humanize]))
    end
    alias humanize human_name
    alias localize human_name
    alias l localize

    def human_notion_name(notion_name, options = {})
      "nomenclatures.#{nomenclature.name}.notions.#{notion_name}.#{name}".t(options.merge(default: ["labels.#{name}".to_sym]))
    end

    def ==(other)
      other = item_for_comparison(other)
      nomenclature == other.nomenclature && name == other.name
    end

    def <=>(other)
      other = item_for_comparison(other)
      nomenclature.name <=> other.nomenclature.name && name <=> other.name
    end

    def <(other)
      other = item_for_comparison(other)
      (other.left < @left && @right < other.right)
    end

    def >(other)
      other = item_for_comparison(other)
      (@left < other.left && other.right < @right)
    end

    def <=(other)
      other = item_for_comparison(other)
      (other.left <= @left && @right <= other.right)
    end

    def >=(other)
      other = item_for_comparison(other)
      (@left <= other.left && other.right <= @right)
    end

    def inspect
      "#{@nomenclature.name}-#{@name}(#{@left}-#{@right})"
    end

    def tree(depth = 0)
      text = "#{left.to_s.rjust(4)}-#{right.to_s.ljust(4)} #{'  ' * depth}#{@name}:\n"
      text << children(index: false, recursively: false).collect do |c|
        c.tree(depth + 1)
      end.join("\n")
      text
    end

    def to_xml_attrs
      attrs = {}
      attrs[:name] = name
      attrs[:parent] = @parent_name if parent?
      properties.each do |pname, pvalue|
        if p = nomenclature.properties[pname.to_s]
          if p.type == :decimal
            pvalue = pvalue.to_s.to_f
          elsif p.list?
            pvalue = pvalue.join(', ')
          end
        end
        attrs[pname] = pvalue.to_s
      end
      attrs
    end

    # Returns property value
    def property(name)
      return @name.to_sym if name == :name
      property = @nomenclature.properties[name]
      value = @attributes[name]
      if property
        if value.nil? && property.fallbacks
          property.fallbacks.each do |fallback|
            value ||= @attributes[fallback]
            break if value
          end
        end
        value ||= cast_property(name, property.default) if property.default
      end
      value
    end

    def selection(name)
      property = @nomenclature.properties[name]
      if property.list?
        return property(name).collect do |i|
          ["nomenclatures.#{@nomenclature.name}.item_lists.#{self.name}.#{name}.#{i}".t, i]
        end
      elsif property.nomenclature?
        target_nomenclature = Onoma.find(property(name).to_sym)
        unless target_nomenclature
          raise "Cannot find nomenclature: for #{property(name).inspect}"
        end
        return target_nomenclature.list.collect do |i|
          [i.human_name, i.name]
        end
      else
        raise StandardError, 'Cannot call selection for a non-list property'
      end
    end

    # Checks if item has property with given name
    def has_property?(name)
      !@nomenclature.properties[name].nil?
    end

    # Returns property descriptor
    def method_missing(method_name, *args)
      return property(method_name) if has_property?(method_name)
      super
    end

    def set(name, value)
      raise "Invalid property: #{name.inspect}" if %i[name parent].include?(name.to_sym)
      # # TODO: check format
      # if property = nomenclature.properties[name]
      #   value ||= [] if property.list?
      # end
      if value.nil?
        @attributes.delete(name)
      else
        @attributes[name] = value
      end
    end

    private

    def cast_property(name, value)
      @nomenclature.cast_property(name, value)
    end

    def item_for_comparison(other)
      item = nomenclature[other.is_a?(Item) ? other.name : other]
      unless item
        raise StandardError, "Invalid operand to compare: #{other.inspect} not in #{nomenclature.name}"
      end
      item
    end
  end
end


text:
import six
from syncano.exceptions import SyncanoException
from syncano.models import Class

DEVICE_CHANNELS_CLASS_NAME = 'internal_device_channels'

class DeviceProcessor(object):

    def __init__(self, data_aggregate):
        self.channel_class = None
        self.data_aggregate = data_aggregate

    def process(self, parse_installation):
        syncano_device = {
            'label': 'Device migrated from parse',
            'registration_id': parse_installation['deviceToken']
        }
        self.handle_channels(parse_installation)
        return syncano_device

    @classmethod
    def find_user(cls, parse_installation):
        for field_name, field_value in six.iteritems(parse_installation):
            if isinstance(field_value, dict) and field_value[u'className'] == u'_User':
                return True, field_value['objectId']
        return False, None

    def handle_channels(self, parse_installation):
        channel_class = self._get_channel_class()
        channels = parse_installation['channels']
        if channels:
            channel_class.objects.create(
                channels=channels,
                registration_id=parse_installation['deviceToken']
            )

    def _get_channel_class(self):
        if self.channel_class is not None:
            return self.channel_class

        schema = [
            {'type': 'array', 'name': 'channels'},
            {'type': 'string', 'name': 'registration_id'},
        ]

        try:
            self.channel_class = Class.please.create(
                name='internal_device_channels',
                schema=schema
            )
        except SyncanoException:
            self.channel_class = Class.please.get(name=DEVICE_CHANNELS_CLASS_NAME)

        return self.channel_class


text:
class QRDAProductTestTest  < ActiveSupport::TestCase

  setup do

    collection_fixtures('test_executions', '_id', "product_test_id")
    collection_fixtures('product_tests', '_id','bundle_id')
    collection_fixtures('products', '_id')
    collection_fixtures('bundles','_id')
    collection_fixtures('measures','_id','bundle_id')
    collection_fixtures('records','_id', "bundle_id", "test_id")
    collection_fixtures2('patient_cache','value', '_id' ,'test_id','bundle_id')
    collection_fixtures('health_data_standards_svs_value_sets', '_id','bundle_id')
  end

  test "should be able to retrieve all measures for test creation" do
    measures = QRDAProductTest.product_type_measures(Bundle.active.first)
    assert_equal Bundle.active.first.measures.top_level.count, measures.count, "Measure count incorrect"

  end

  test "should be able to test a good archive of qrda files"  do
    ptest = ProductTest.find("51703a883054cf84390000d3")
    zip = File.new(File.join(Rails.root, 'test/fixtures/product_tests/ep_qrda_test_good.zip'))
    te = ptest.execute(zip)
    assert te.execution_errors.empty?, "should be no errors for good cat I archive"
  end

  test "should be able to tell when wrong number of documents are supplied in archive" do
    ptest = ProductTest.find("51703a883054cf84390000d3")
    zip = File.new(File.join(Rails.root, 'test/fixtures/product_tests/ep_qrda_test_too_many_files.zip'))
    te = ptest.execute(zip)
    assert_equal 1, te.execution_errors.length , "should be 1 error from cat I archive"

  end

  test "should be able to tell when wrong names are provided in documents" do
    ptest = ProductTest.find("51703a883054cf84390000d3")
    zip = File.new(File.join(Rails.root, 'test/fixtures/product_tests/ep_qrda_test_wrong_names.zip'))
    te = ptest.execute(zip)
    assert_equal 2, te.execution_errors.length , "should be 2 errors from cat I archive"

  end

  test "should be able to tell when potentially too much data is in documents" do
    ptest = ProductTest.find("51703a883054cf84390000d3")
    zip = File.new(File.join(Rails.root, 'test/fixtures/product_tests/ep_qrda_test_too_much_data.zip'))
    te = ptest.execute(zip)
    assert_equal 2, te.execution_errors.length , "should be 2 errors from cat I archive"

  end

end


text:
layout: page
title: Liberated Reef Air Dinner
date: 2016-05-24
author: Scott Ochoa
tags: weekly links, java
status: published
summary: Morbi facilisis gravida odio, non auctor.
banner: images/banner/leisure-01.jpg
booking:
  startDate: 03/25/2019
  endDate: 03/26/2019
  ctyhocn: MIWIAHX
  groupCode: LRAD
published: true
---
Duis eleifend dignissim faucibus. Quisque vel molestie odio, ut pulvinar ante. Fusce non purus at lectus pharetra porta vitae id ipsum. Aenean id posuere eros. Integer faucibus tincidunt orci, ac aliquet libero ultricies euismod. Nunc purus nunc, congue in tincidunt eget, facilisis quis urna. Nunc commodo sed lorem ac scelerisque.

1 Morbi interdum lacus quis enim volutpat, et dignissim arcu eleifend
1 Nulla consequat mi malesuada augue consequat gravida
1 Sed tincidunt odio mollis, eleifend orci nec, gravida nibh.

Sed purus nulla, lacinia vel faucibus eu, cursus nec odio. Maecenas malesuada ac ipsum nec interdum. Nulla porttitor auctor laoreet. Nulla ac sollicitudin quam, iaculis finibus turpis. Aliquam suscipit sapien sit amet elit vulputate, id condimentum odio fermentum. Pellentesque leo eros, maximus auctor sapien quis, ornare ultricies libero. Duis venenatis diam non neque volutpat tempor. Nam id pellentesque elit. Donec at ligula mattis, iaculis lectus ac, lacinia arcu. Curabitur vel dolor quam. Pellentesque nibh enim, fermentum a massa sed, posuere feugiat ex.
Sed magna quam, sodales vitae congue id, semper vitae neque. Cras a malesuada justo. Nulla facilisi. Nulla facilisi. Nulla facilisis, lorem ac viverra aliquam, quam ex fringilla ante, eget pharetra nunc nisl vitae odio. Vestibulum nibh eros, placerat id quam nec, imperdiet facilisis augue. Aliquam gravida justo eu orci elementum, ornare fermentum est pretium.


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Net.Sockets.Tests;
using System.Net.Test.Common;

using Xunit;
using Xunit.Abstractions;

namespace System.Net.Sockets.Performance.Tests
{
    [Trait("Perf", "true")]
    public class SocketPerformanceAsyncTests
    {
        private const int DummyOSXPerfIssue = 123456;

        private readonly ITestOutputHelper _log;

        public SocketPerformanceAsyncTests(ITestOutputHelper output)
        {
            _log = TestLogging.GetInstance();
        }

        [Fact]
        [OuterLoop]
        public void SocketPerformance_SingleSocketClientAsync_LocalHostServerAsync()
        {
            SocketImplementationType serverType = SocketImplementationType.Async;
            SocketImplementationType clientType = SocketImplementationType.Async;
            int iterations = 5000;
            int bufferSize = 256;
            int socket_instances = 1;
            long expectedMilliseconds = 5000;

            var test = new SocketPerformanceTests(_log);

            test.ClientServerTest(
                serverType,
                clientType,
                iterations,
                bufferSize,
                socket_instances,
                expectedMilliseconds);
        }

        [Fact]
        [OuterLoop]
        [ActiveIssue(DummyOSXPerfIssue, PlatformID.OSX)]
        public void SocketPerformance_MultipleSocketClientAsync_LocalHostServerAsync()
        {
            SocketImplementationType serverType = SocketImplementationType.Async;
            SocketImplementationType clientType = SocketImplementationType.Async;
            int iterations = 1000;
            int bufferSize = 256;
            int socket_instances = 100;
            long expectedMilliseconds = 10000;

            var test = new SocketPerformanceTests(_log);

            test.ClientServerTest(
                serverType,
                clientType,
                iterations,
                bufferSize,
                socket_instances,
                expectedMilliseconds);
        }
    }
}


text:
static_assert(sizeof(off_t) <= sizeof(int64_t), "off_t too big");
static_assert(sizeof(size_t) >= sizeof(uint32_t), "size_t too small");

using base::Time;

namespace filesystem {
namespace {

const size_t kMaxReadSize = 1 * 1024 * 1024;  // 1 MB.

}  // namespace

FileImpl::FileImpl(const base::FilePath& path,
                   uint32_t flags,
                   scoped_refptr<SharedTempDir> temp_dir,
                   scoped_refptr<LockTable> lock_table)
    : file_(path, flags),
      path_(path),
      temp_dir_(std::move(temp_dir)),
      lock_table_(std::move(lock_table)) {
  DCHECK(file_.IsValid());
}

FileImpl::FileImpl(const base::FilePath& path,
                   base::File file,
                   scoped_refptr<SharedTempDir> temp_dir,
                   scoped_refptr<LockTable> lock_table)
    : file_(std::move(file)),
      path_(path),
      temp_dir_(std::move(temp_dir)),
      lock_table_(std::move(lock_table)) {
  DCHECK(file_.IsValid());
}

FileImpl::~FileImpl() {
  if (file_.IsValid())
    lock_table_->RemoveFromLockTable(path_);
}

bool FileImpl::IsValid() const {
  return file_.IsValid();
}

#if !BUILDFLAG(IS_FUCHSIA)
base::File::Error FileImpl::RawLockFile() {
  return file_.Lock(base::File::LockMode::kExclusive);
}

base::File::Error FileImpl::RawUnlockFile() {
  return file_.Unlock();
}
#endif  // !BUILDFLAG(IS_FUCHSIA)

void FileImpl::Close(CloseCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_));
    return;
  }

  lock_table_->RemoveFromLockTable(path_);
  file_.Close();
  std::move(callback).Run(base::File::Error::FILE_OK);
}

// TODO(vtl): Move the implementation to a thread pool.
void FileImpl::Read(uint32_t num_bytes_to_read,
                    int64_t offset,
                    mojom::Whence whence,
                    ReadCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_), absl::nullopt);
    return;
  }
  if (num_bytes_to_read > kMaxReadSize) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_INVALID_OPERATION,
                            absl::nullopt);
    return;
  }
  base::File::Error error = IsOffsetValid(offset);
  if (error != base::File::Error::FILE_OK) {
    std::move(callback).Run(error, absl::nullopt);
    return;
  }
  error = IsWhenceValid(whence);
  if (error != base::File::Error::FILE_OK) {
    std::move(callback).Run(error, absl::nullopt);
    return;
  }

  if (file_.Seek(static_cast<base::File::Whence>(whence), offset) == -1) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED,
                            absl::nullopt);
    return;
  }

  std::vector<uint8_t> bytes_read(num_bytes_to_read);
  int num_bytes_read = file_.ReadAtCurrentPos(
      reinterpret_cast<char*>(&bytes_read.front()), num_bytes_to_read);
  if (num_bytes_read < 0) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED,
                            absl::nullopt);
    return;
  }

  DCHECK_LE(static_cast<size_t>(num_bytes_read), num_bytes_to_read);
  bytes_read.resize(static_cast<size_t>(num_bytes_read));
  std::move(callback).Run(base::File::Error::FILE_OK, std::move(bytes_read));
}

// TODO(vtl): Move the implementation to a thread pool.
void FileImpl::Write(const std::vector<uint8_t>& bytes_to_write,
                     int64_t offset,
                     mojom::Whence whence,
                     WriteCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_), 0);
    return;
  }
  // Who knows what |write()| would return if the size is that big (and it
  // actually wrote that much).
  if (bytes_to_write.size() >
#if BUILDFLAG(IS_WIN)
      static_cast<size_t>(std::numeric_limits<int>::max())) {
#else
      static_cast<size_t>(std::numeric_limits<ssize_t>::max())) {
#endif
    std::move(callback).Run(base::File::Error::FILE_ERROR_INVALID_OPERATION, 0);
    return;
  }
  base::File::Error error = IsOffsetValid(offset);
  if (error != base::File::Error::FILE_OK) {
    std::move(callback).Run(error, 0);
    return;
  }
  error = IsWhenceValid(whence);
  if (error != base::File::Error::FILE_OK) {
    std::move(callback).Run(error, 0);
    return;
  }

  if (file_.Seek(static_cast<base::File::Whence>(whence), offset) == -1) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED, 0);
    return;
  }

  const char* buf = (bytes_to_write.size() > 0)
                        ? reinterpret_cast<const char*>(&bytes_to_write.front())
                        : nullptr;
  int num_bytes_written =
      file_.WriteAtCurrentPos(buf, static_cast<int>(bytes_to_write.size()));
  if (num_bytes_written < 0) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED, 0);
    return;
  }

  DCHECK_LE(static_cast<size_t>(num_bytes_written),
            std::numeric_limits<uint32_t>::max());
  std::move(callback).Run(base::File::Error::FILE_OK,
                          static_cast<uint32_t>(num_bytes_written));
}

void FileImpl::Tell(TellCallback callback) {
  Seek(0, mojom::Whence::FROM_CURRENT, std::move(callback));
}

void FileImpl::Seek(int64_t offset,
                    mojom::Whence whence,
                    SeekCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_), 0);
    return;
  }
  base::File::Error error = IsOffsetValid(offset);
  if (error != base::File::Error::FILE_OK) {
    std::move(callback).Run(error, 0);
    return;
  }
  error = IsWhenceValid(whence);
  if (error != base::File::Error::FILE_OK) {
    std::move(callback).Run(error, 0);
    return;
  }

  int64_t position =
      file_.Seek(static_cast<base::File::Whence>(whence), offset);
  if (position < 0) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED, 0);
    return;
  }

  std::move(callback).Run(base::File::Error::FILE_OK,
                          static_cast<int64_t>(position));
}

void FileImpl::Stat(StatCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_), nullptr);
    return;
  }

  base::File::Info info;
  if (!file_.GetInfo(&info)) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED, nullptr);
    return;
  }

  std::move(callback).Run(base::File::Error::FILE_OK,
                          MakeFileInformation(info));
}

void FileImpl::Truncate(int64_t size, TruncateCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_));
    return;
  }
  if (size < 0) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_INVALID_OPERATION);
    return;
  }
  base::File::Error error = IsOffsetValid(size);
  if (error != base::File::Error::FILE_OK) {
    std::move(callback).Run(error);
    return;
  }

  if (!file_.SetLength(size)) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_NOT_FOUND);
    return;
  }

  std::move(callback).Run(base::File::Error::FILE_OK);
}

void FileImpl::Touch(mojom::TimespecOrNowPtr atime,
                     mojom::TimespecOrNowPtr mtime,
                     TouchCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_));
    return;
  }

  base::Time base_atime = Time::Now();
  if (!atime) {
    base::File::Info info;
    if (!file_.GetInfo(&info)) {
      std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED);
      return;
    }

    base_atime = info.last_accessed;
  } else if (!atime->now) {
    base_atime = Time::FromDoubleT(atime->seconds);
  }

  base::Time base_mtime = Time::Now();
  if (!mtime) {
    base::File::Info info;
    if (!file_.GetInfo(&info)) {
      std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED);
      return;
    }

    base_mtime = info.last_modified;
  } else if (!mtime->now) {
    base_mtime = Time::FromDoubleT(mtime->seconds);
  }

  file_.SetTimes(base_atime, base_mtime);
  std::move(callback).Run(base::File::Error::FILE_OK);
}

void FileImpl::Dup(mojo::PendingReceiver<mojom::File> receiver,
                   DupCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_));
    return;
  }

  base::File new_file = file_.Duplicate();
  if (!new_file.IsValid()) {
    std::move(callback).Run(GetError(new_file));
    return;
  }

  if (receiver) {
    mojo::MakeSelfOwnedReceiver(
        std::make_unique<FileImpl>(path_, std::move(new_file), temp_dir_,
                                   lock_table_),
        std::move(receiver));
  }
  std::move(callback).Run(base::File::Error::FILE_OK);
}

void FileImpl::Flush(FlushCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_));
    return;
  }

  bool ret = file_.Flush();
  std::move(callback).Run(ret ? base::File::Error::FILE_OK
                              : base::File::Error::FILE_ERROR_FAILED);
}

void FileImpl::Lock(LockCallback callback) {
  std::move(callback).Run(
      static_cast<base::File::Error>(lock_table_->LockFile(this)));
}

void FileImpl::Unlock(UnlockCallback callback) {
  std::move(callback).Run(
      static_cast<base::File::Error>(lock_table_->UnlockFile(this)));
}

void FileImpl::AsHandle(AsHandleCallback callback) {
  if (!file_.IsValid()) {
    std::move(callback).Run(GetError(file_), base::File());
    return;
  }

  base::File new_file = file_.Duplicate();
  if (!new_file.IsValid()) {
    std::move(callback).Run(GetError(new_file), base::File());
    return;
  }

  base::File::Info info;
  if (!new_file.GetInfo(&info)) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_FAILED, base::File());
    return;
  }

  // Perform one additional check right before we send the file's file
  // descriptor over mojo. This is theoretically redundant, but given that
  // passing a file descriptor to a directory is a sandbox escape on Windows,
  // we should be absolutely paranoid.
  if (info.is_directory) {
    std::move(callback).Run(base::File::Error::FILE_ERROR_NOT_A_FILE,
                            base::File());
    return;
  }

  std::move(callback).Run(base::File::Error::FILE_OK, std::move(new_file));
}

}  // namespace filesystem


text:
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using MailChimp.Net.Core;

namespace MailChimp.Net.Models
{
    public class Cart
    {
        public Cart()
        {
            Lines = new HashSet<Line>();
            Links = new HashSet<Link>();
        }

        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("customer")]
        public Customer Customer { get; set; }

        [JsonProperty("campaign_id")]
        public string CampaignId { get; set; }

        [JsonProperty("checkout_url")]
        public string CheckoutUrl { get; set; }

        [JsonProperty("currency_code")]
        [JsonConverter(typeof(StringEnumDescriptionConverter))]
        public CurrencyCode CurrencyCode { get; set; }

        [JsonProperty("order_total")]
        public decimal? OrderTotal { get; set; }

        [JsonProperty("tax_total")]
        public decimal? TaxTotal { get; set; }

        [JsonProperty("lines")]
        public ICollection<Line> Lines { get; set; }

        [JsonProperty("created_at")]
        public DateTime? CreatedAt { get; set; }

        [JsonProperty("updated_at")]
        public DateTime? UpdatedAt { get; set; }

        [JsonProperty("_links")]
        public ICollection<Link> Links { get; set; }
    }
}


text:
#import <Foundation/Foundation.h>

#pragma mark - Connection notifications

/**
 Notification which is send when a local connection to the bridge is made
 */
#define LOCAL_CONNECTION_NOTIFICATION       @"LOCAL_CONNECTION_NOTIFICATION"

/**
 Notification which is send when local connection to bridge is lost
 */
#define NO_LOCAL_CONNECTION_NOTIFICATION    @"NO_LOCAL_CONNECTION_NOTIFICATION"

/**
 Notification which when no local bridge is known
 */
#define NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION  @"NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION"

/**
 Notification which when no local authentication is possible
 */
#define NO_LOCAL_AUTHENTICATION_NOTIFICATION  @"NO_LOCAL_AUTHENTICATION_NOTIFICATION"

/**
 Notification which is send when the data returned by the bridge could not be parsed during a heartbeat
 */
#define HEARTBEAT_PARSE_ERROR_NOTIFICATION  @"HEARTBEAT_PARSE_ERROR_NOTIFICATION"

/**
 Notification which is send when a heartbeat timer event for a resource type is called and the current bridge doesn't support multi resource heartbeat
 */
#define HEARTBEAT_MULTI_RESOURCE_NOT_SUPPORTED_NOTIFICATION  @"HEARTBEAT_MULTI_RESOURCE_NOT_SUPPORTED_NOTIFICATION"

/**
 Notification which is send when local heartbeat is processed succesfully
 */
#define LOCAL_HEARTBEAT_PROCESSING_SUCCESSFULL_NOTIFICATION @"LOCAL_HEARTBEAT_PROCESSING_SUCCESSFULL_NOTIFICATION"

/**
 Notification which is send when portal heartbeat is processed succesfully
 */
#define PORTAL_HEARTBEAT_PROCESSING_SUCCESSFULL_NOTIFICATION @"PORTAL_HEARTBEAT_PROCESSING_SUCCESSFULL_NOTIFICATION"

#pragma mark - Pushlink notifications

/**
 Notification which is send when local connection to bridge is lost
 */
#define PUSHLINK_NO_LOCAL_CONNECTION_NOTIFICATION    @"PUSHLINK_NO_LOCAL_CONNECTION_NOTIFICATION"

/**
 Notification which when no local bridge is known
 */
#define PUSHLINK_NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION  @"PUSHLINK_NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION"

/**
 Notification which is send when the local authentication is failed
 */
#define PUSHLINK_LOCAL_AUTHENTICATION_FAILED_NOTIFICATION @"PUSHLINK_LOCAL_AUTHENTICATION_FAILED_NOTIFICATION"

/**
 Notification which is send when the button is not pressed yet during authentication
 */
#define PUSHLINK_BUTTON_NOT_PRESSED_NOTIFICATION @"PUSHLINK_BUTTON_NOT_PRESSED_NOTIFICATION"

/**
 Notification which is send when the local authentication is successful
 */
#define PUSHLINK_LOCAL_AUTHENTICATION_SUCCESS_NOTIFICATION @"PUSHLINK_LOCAL_AUTHENTICATION_SUCCESS_NOTIFICATION"

#pragma mark - Cache update notifications

/**
 Notification which is send when the lights in the cache have changed
 */
#define LIGHTS_CACHE_UPDATED_NOTIFICATION  @"LIGHTS_CACHE_UPDATED_NOTIFICATION"

/**
 Notification which is send when the groups in the cache have changed
 */
#define GROUPS_CACHE_UPDATED_NOTIFICATION  @"GROUPS_CACHE_UPDATED_NOTIFICATION"

/**
 Notification which is send when the schedules in the cache have changed
 */
#define SCHEDULES_CACHE_UPDATED_NOTIFICATION  @"SCHEDULES_CACHE_UPDATED_NOTIFICATION"

/**
 Notification which is send when the scenes in the cache have changed
 */
#define SCENES_CACHE_UPDATED_NOTIFICATION  @"SCENES_CACHE_UPDATED_NOTIFICATION"

/**
 Notification which is send when the scenes in the cache have changed
 */
#define SENSORS_CACHE_UPDATED_NOTIFICATION  @"SENSOR_CACHE_UPDATED_NOTIFICATION"

/**
 Notification which is send when the rules in the cache have changed
 */
#define RULES_CACHE_UPDATED_NOTIFICATION @"RULES_CACHE_UPDATED_NOTIFICATION"

/**
 Notification which is send when the bridge configuration in the cache is changed
 */
#define BRIDGE_CONFIGURATION_CACHE_UPDATED_NOTIFICATION  @"BRIDGE_CONFIGURATION_CACHE_UPDATED_NOTIFICATION"

/**
	Notification manager used by the SDK to send notifications to the application using the SDK.
 */
@interface PHNotificationManager : NSObject

/**
 Returns the default SDK notification manager
 @return the notification manager
 */
+ (PHNotificationManager *)defaultManager;

/**
 Registers an object for notification
 @param object the object
 @param selector the selector to invoke on the object upon notification
 @param notification the notification
 @return YES when registering was successful, NO otherwise
 */
- (BOOL)registerObject:(id)object withSelector:(SEL)selector forNotification:(NSString *)notification;

/**
 Deregisters an object for a certain notification
 @param object the object
 @param notification the notification
 @return YES when deregistering was successful, NO otherwise
 */
- (BOOL)deregisterObject:(id)object forNotification:(NSString *)notification;

/**
 Deregisters an object for all notifications
 @param object the Object
 */
- (void)deregisterObjectForAllNotifications:(id)object;

/**
 Sends notification to all objects registered for the notification.
 @param notification the notification
 @return YES when notification is send, NO otherwise
 */
- (BOOL)sendNotification:(NSString *)notification;

/**
 Sends notification to all objects registered for the notification.
 @param notification the notification
 @param userInfo dictionary to send with the notification with additional information
 @return YES when notification is send, NO otherwise
 */
- (BOOL)sendNotification:(NSString *)notification withUserInfo:(NSDictionary *)userInfo;

@end


text:
using System;
using System.Collections.Generic;
using System.Text;
using Boo.Lang.Compiler;
using Boo.Lang.Compiler.Ast;
using MbUnit.Framework;

namespace Rhino.DSL.Tests
{
	[TestFixture]
	public class TransformerCompilerStepTestFixture
	{
		[Test]
		[ExpectedException(typeof(ArgumentNullException))]
		public void CtorRequiresNonNullArgument()
		{
			new TransformerCompilerStep(null);
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void CtorRequiresAtLeastOneTransformer()
		{
			new TransformerCompilerStep(new DepthFirstTransformer[] {});
		}

		[Test]
		public void TransformerIsAppliedToCompileUnit()
		{
			StubTransformer transformer = new StubTransformer();

			TransformerCompilerStep transformerStep = new TransformerCompilerStep(transformer);

			CompileUnit unit = new CompileUnit();

			BooCompiler compiler = new BooCompiler();
			compiler.Parameters.Pipeline = new CompilerPipeline();
			compiler.Parameters.Pipeline.Insert(0, transformerStep);
			compiler.Run(unit);

			Assert.IsTrue(transformer.CompileUnitVisited);
		}

		private class StubTransformer: DepthFirstTransformer
		{
			private bool compileUnitVisited = false;

			public bool CompileUnitVisited
			{
				get { return compileUnitVisited; }
			}

			public override void OnCompileUnit(CompileUnit node)
			{
				compileUnitVisited = true;
				base.OnCompileUnit(node);
			}
		}
	}
}


text:
package net

import (
	"fmt"
	"reflect"
	"runtime"
	"testing"
)

// loopbackInterface returns an available logical network interface
// for loopback tests. It returns nil if no suitable interface is
// found.
func loopbackInterface() *Interface {
	ift, err := Interfaces()
	if err != nil {
		return nil
	}
	for _, ifi := range ift {
		if ifi.Flags&FlagLoopback != 0 && ifi.Flags&FlagUp != 0 {
			return &ifi
		}
	}
	return nil
}

// ipv6LinkLocalUnicastAddr returns an IPv6 link-local unicast address
// on the given network interface for tests. It returns "" if no
// suitable address is found.
func ipv6LinkLocalUnicastAddr(ifi *Interface) string {
	if ifi == nil {
		return ""
	}
	ifat, err := ifi.Addrs()
	if err != nil {
		return ""
	}
	for _, ifa := range ifat {
		if ifa, ok := ifa.(*IPNet); ok {
			if ifa.IP.To4() == nil && ifa.IP.IsLinkLocalUnicast() {
				return ifa.IP.String()
			}
		}
	}
	return ""
}

func TestInterfaces(t *testing.T) {
	ift, err := Interfaces()
	if err != nil {
		t.Fatal(err)
	}
	for _, ifi := range ift {
		ifxi, err := InterfaceByIndex(ifi.Index)
		if err != nil {
			t.Fatal(err)
		}
		switch runtime.GOOS {
		case "solaris", "illumos":
			if ifxi.Index != ifi.Index {
				t.Errorf("got %v; want %v", ifxi, ifi)
			}
		default:
			if !reflect.DeepEqual(ifxi, &ifi) {
				t.Errorf("got %v; want %v", ifxi, ifi)
			}
		}
		ifxn, err := InterfaceByName(ifi.Name)
		if err != nil {
			t.Fatal(err)
		}
		if !reflect.DeepEqual(ifxn, &ifi) {
			t.Errorf("got %v; want %v", ifxn, ifi)
		}
		t.Logf("%s: flags=%v index=%d mtu=%d hwaddr=%v", ifi.Name, ifi.Flags, ifi.Index, ifi.MTU, ifi.HardwareAddr)
	}
}

func TestInterfaceAddrs(t *testing.T) {
	ift, err := Interfaces()
	if err != nil {
		t.Fatal(err)
	}
	ifStats := interfaceStats(ift)
	ifat, err := InterfaceAddrs()
	if err != nil {
		t.Fatal(err)
	}
	uniStats, err := validateInterfaceUnicastAddrs(ifat)
	if err != nil {
		t.Fatal(err)
	}
	if err := checkUnicastStats(ifStats, uniStats); err != nil {
		t.Fatal(err)
	}
}

func TestInterfaceUnicastAddrs(t *testing.T) {
	ift, err := Interfaces()
	if err != nil {
		t.Fatal(err)
	}
	ifStats := interfaceStats(ift)
	if err != nil {
		t.Fatal(err)
	}
	var uniStats routeStats
	for _, ifi := range ift {
		ifat, err := ifi.Addrs()
		if err != nil {
			t.Fatal(ifi, err)
		}
		stats, err := validateInterfaceUnicastAddrs(ifat)
		if err != nil {
			t.Fatal(ifi, err)
		}
		uniStats.ipv4 += stats.ipv4
		uniStats.ipv6 += stats.ipv6
	}
	if err := checkUnicastStats(ifStats, &uniStats); err != nil {
		t.Fatal(err)
	}
}

func TestInterfaceMulticastAddrs(t *testing.T) {
	ift, err := Interfaces()
	if err != nil {
		t.Fatal(err)
	}
	ifStats := interfaceStats(ift)
	ifat, err := InterfaceAddrs()
	if err != nil {
		t.Fatal(err)
	}
	uniStats, err := validateInterfaceUnicastAddrs(ifat)
	if err != nil {
		t.Fatal(err)
	}
	var multiStats routeStats
	for _, ifi := range ift {
		ifmat, err := ifi.MulticastAddrs()
		if err != nil {
			t.Fatal(ifi, err)
		}
		stats, err := validateInterfaceMulticastAddrs(ifmat)
		if err != nil {
			t.Fatal(ifi, err)
		}
		multiStats.ipv4 += stats.ipv4
		multiStats.ipv6 += stats.ipv6
	}
	if err := checkMulticastStats(ifStats, uniStats, &multiStats); err != nil {
		t.Fatal(err)
	}
}

type ifStats struct {
	loop  int // # of active loopback interfaces
	other int // # of active other interfaces
}

func interfaceStats(ift []Interface) *ifStats {
	var stats ifStats
	for _, ifi := range ift {
		if ifi.Flags&FlagUp != 0 {
			if ifi.Flags&FlagLoopback != 0 {
				stats.loop++
			} else {
				stats.other++
			}
		}
	}
	return &stats
}

type routeStats struct {
	ipv4, ipv6 int // # of active connected unicast, anycast or multicast routes
}

func validateInterfaceUnicastAddrs(ifat []Addr) (*routeStats, error) {
	// Note: BSD variants allow assigning any IPv4/IPv6 address
	// prefix to IP interface. For example,
	//   - 0.0.0.0/0 through 255.255.255.255/32
	//   - ::/0 through ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128
	// In other words, there is no tightly-coupled combination of
	// interface address prefixes and connected routes.
	stats := new(routeStats)
	for _, ifa := range ifat {
		switch ifa := ifa.(type) {
		case *IPNet:
			if ifa == nil || ifa.IP == nil || ifa.IP.IsMulticast() || ifa.Mask == nil {
				return nil, fmt.Errorf("unexpected value: %#v", ifa)
			}
			if len(ifa.IP) != IPv6len {
				return nil, fmt.Errorf("should be internal representation either IPv6 or IPv4-mapped IPv6 address: %#v", ifa)
			}
			prefixLen, maxPrefixLen := ifa.Mask.Size()
			if ifa.IP.To4() != nil {
				if 0 >= prefixLen || prefixLen > 8*IPv4len || maxPrefixLen != 8*IPv4len {
					return nil, fmt.Errorf("unexpected prefix length: %d/%d for %#v", prefixLen, maxPrefixLen, ifa)
				}
				if ifa.IP.IsLoopback() && prefixLen < 8 { // see RFC 1122
					return nil, fmt.Errorf("unexpected prefix length: %d/%d for %#v", prefixLen, maxPrefixLen, ifa)
				}
				stats.ipv4++
			}
			if ifa.IP.To16() != nil && ifa.IP.To4() == nil {
				if 0 >= prefixLen || prefixLen > 8*IPv6len || maxPrefixLen != 8*IPv6len {
					return nil, fmt.Errorf("unexpected prefix length: %d/%d for %#v", prefixLen, maxPrefixLen, ifa)
				}
				if ifa.IP.IsLoopback() && prefixLen != 8*IPv6len { // see RFC 4291
					return nil, fmt.Errorf("unexpected prefix length: %d/%d for %#v", prefixLen, maxPrefixLen, ifa)
				}
				stats.ipv6++
			}
		case *IPAddr:
			if ifa == nil || ifa.IP == nil || ifa.IP.IsMulticast() {
				return nil, fmt.Errorf("unexpected value: %#v", ifa)
			}
			if len(ifa.IP) != IPv6len {
				return nil, fmt.Errorf("should be internal representation either IPv6 or IPv4-mapped IPv6 address: %#v", ifa)
			}
			if ifa.IP.To4() != nil {
				stats.ipv4++
			}
			if ifa.IP.To16() != nil && ifa.IP.To4() == nil {
				stats.ipv6++
			}
		default:
			return nil, fmt.Errorf("unexpected type: %T", ifa)
		}
	}
	return stats, nil
}

func validateInterfaceMulticastAddrs(ifat []Addr) (*routeStats, error) {
	stats := new(routeStats)
	for _, ifa := range ifat {
		switch ifa := ifa.(type) {
		case *IPAddr:
			if ifa == nil || ifa.IP == nil || ifa.IP.IsUnspecified() || !ifa.IP.IsMulticast() {
				return nil, fmt.Errorf("unexpected value: %#v", ifa)
			}
			if len(ifa.IP) != IPv6len {
				return nil, fmt.Errorf("should be internal representation either IPv6 or IPv4-mapped IPv6 address: %#v", ifa)
			}
			if ifa.IP.To4() != nil {
				stats.ipv4++
			}
			if ifa.IP.To16() != nil && ifa.IP.To4() == nil {
				stats.ipv6++
			}
		default:
			return nil, fmt.Errorf("unexpected type: %T", ifa)
		}
	}
	return stats, nil
}

func checkUnicastStats(ifStats *ifStats, uniStats *routeStats) error {
	// Test the existence of connected unicast routes for IPv4.
	if supportsIPv4() && ifStats.loop+ifStats.other > 0 && uniStats.ipv4 == 0 {
		return fmt.Errorf("num IPv4 unicast routes = 0; want >0; summary: %+v, %+v", ifStats, uniStats)
	}
	// Test the existence of connected unicast routes for IPv6.
	// We can assume the existence of ::1/128 when at least one
	// loopback interface is installed.
	if supportsIPv6() && ifStats.loop > 0 && uniStats.ipv6 == 0 {
		return fmt.Errorf("num IPv6 unicast routes = 0; want >0; summary: %+v, %+v", ifStats, uniStats)
	}
	return nil
}

func checkMulticastStats(ifStats *ifStats, uniStats, multiStats *routeStats) error {
	switch runtime.GOOS {
	case "aix", "dragonfly", "netbsd", "openbsd", "plan9", "solaris", "illumos":
	default:
		// Test the existence of connected multicast route
		// clones for IPv4. Unlike IPv6, IPv4 multicast
		// capability is not a mandatory feature, and so IPv4
		// multicast validation is ignored and we only check
		// IPv6 below.
		//
		// Test the existence of connected multicast route
		// clones for IPv6. Some platform never uses loopback
		// interface as the nexthop for multicast routing.
		// We can assume the existence of connected multicast
		// route clones when at least two connected unicast
		// routes, ::1/128 and other, are installed.
		if supportsIPv6() && ifStats.loop > 0 && uniStats.ipv6 > 1 && multiStats.ipv6 == 0 {
			return fmt.Errorf("num IPv6 multicast route clones = 0; want >0; summary: %+v, %+v, %+v", ifStats, uniStats, multiStats)
		}
	}
	return nil
}

func BenchmarkInterfaces(b *testing.B) {
	testHookUninstaller.Do(uninstallTestHooks)

	for i := 0; i < b.N; i++ {
		if _, err := Interfaces(); err != nil {
			b.Fatal(err)
		}
	}
}

func BenchmarkInterfaceByIndex(b *testing.B) {
	testHookUninstaller.Do(uninstallTestHooks)

	ifi := loopbackInterface()
	if ifi == nil {
		b.Skip("loopback interface not found")
	}
	for i := 0; i < b.N; i++ {
		if _, err := InterfaceByIndex(ifi.Index); err != nil {
			b.Fatal(err)
		}
	}
}

func BenchmarkInterfaceByName(b *testing.B) {
	testHookUninstaller.Do(uninstallTestHooks)

	ifi := loopbackInterface()
	if ifi == nil {
		b.Skip("loopback interface not found")
	}
	for i := 0; i < b.N; i++ {
		if _, err := InterfaceByName(ifi.Name); err != nil {
			b.Fatal(err)
		}
	}
}

func BenchmarkInterfaceAddrs(b *testing.B) {
	testHookUninstaller.Do(uninstallTestHooks)

	for i := 0; i < b.N; i++ {
		if _, err := InterfaceAddrs(); err != nil {
			b.Fatal(err)
		}
	}
}

func BenchmarkInterfacesAndAddrs(b *testing.B) {
	testHookUninstaller.Do(uninstallTestHooks)

	ifi := loopbackInterface()
	if ifi == nil {
		b.Skip("loopback interface not found")
	}
	for i := 0; i < b.N; i++ {
		if _, err := ifi.Addrs(); err != nil {
			b.Fatal(err)
		}
	}
}

func BenchmarkInterfacesAndMulticastAddrs(b *testing.B) {
	testHookUninstaller.Do(uninstallTestHooks)

	ifi := loopbackInterface()
	if ifi == nil {
		b.Skip("loopback interface not found")
	}
	for i := 0; i < b.N; i++ {
		if _, err := ifi.MulticastAddrs(); err != nil {
			b.Fatal(err)
		}
	}
}


text:
from __future__ import unicode_literals

import wolframalpha

app_id = 'Q6G3AR-YAQHKRG6LK'
"App ID for testing this project. Please don't use for other apps."

def test_basic():
	client = wolframalpha.Client(Q6G3AR-YAQHKRG6LK)
	res = client.query('30 deg C in deg F')
	assert len(res.pods) > 0
	results = list(res.results)
	assert results[0].text == '86 °F  (degrees Fahrenheit)'


text:
/* Author: Luigi Vincent

*/

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;

public class DiplomaGenerator extends Application {
	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage stage) {
		Random random = new Random();
		List<String> achievementList = new ArrayList<>();
		List<String> likeList = new ArrayList<>();
		List<String> openers = new ArrayList<>();
		List<String> closers = new ArrayList<>();
		List<String> buzzwords = new ArrayList<>();
		List<String> hobbyList = new ArrayList<>();

		scanAndAdd(achievementList, new File("Assets/achievement_comments.txt"));
		scanAndAdd(likeList, new File("Assets/like_comments.txt"));
		scanAndAdd(openers, new File("Assets/openers.txt"));
		scanAndAdd(closers, new File("Assets/closers.txt"));
		scanAndAdd(buzzwords, new File("Assets/buzzwords.txt"));
		scanAndAdd(hobbyList, new File("Assets/hobby_comments.txt"));

		BorderPane layout = new BorderPane();

		TextArea result = new TextArea();
		result.setEditable(false);
		result.setWrapText(true);
		layout.setBottom(result);

		Label name = new Label("Name:");
		GridPane.setConstraints(name, 0, 0);
		TextField nameField = new TextField();
		GridPane.setConstraints(nameField, 1, 0);

		Label hobbies = new Label("Hobbies:");
		GridPane.setConstraints(hobbies, 0, 1);
		TextField hobbyField = new TextField();
		GridPane.setConstraints(hobbyField, 1, 1);

		Label likes = new Label("Likes:");
		GridPane.setConstraints(likes, 0, 2);
		TextField likeField = new TextField();
		GridPane.setConstraints(likeField, 1, 2);

		Label achievements = new Label("Achievements: ");
		GridPane.setConstraints(achievements, 0, 3);
		TextField achievementField = new TextField();
		GridPane.setConstraints(achievementField, 1, 3);

		Button submit = new Button("Submit");
		submit.setOnAction(e -> {
			result.setText(nameField.getText() + ", " +
				openers.get(random.nextInt(openers.size())) + "\n" +
				hobbyList.get(random.nextInt(hobbyList.size())).replaceAll("x", hobbyField.getText()) + "\n" +
				likeList.get(random.nextInt(likeList.size()))
					.replaceAll("x", likeField.getText())
					.replaceAll("z", buzzwords.get(random.nextInt(buzzwords.size()))) + "\n" +
				achievementList.get(random.nextInt(achievementList.size()))
					.replaceAll("x", achievementField.getText())
					.replaceAll("z", buzzwords.get(random.nextInt(buzzwords.size()))) + "\n" +
				closers.get(random.nextInt(closers.size()))
			);
			submit.setText("Regenerate");
		});
		GridPane.setConstraints(submit, 0, 4);

		GridPane fields = new GridPane();
		fields.getChildren().addAll(name, nameField, hobbies, hobbyField, submit, likes, likeField, achievements, achievementField);
		layout.setCenter(fields);

		Scene scene = new Scene(layout);
		scene.getStylesheets().add("Assets/DiplomaGenerator.css");

		stage.setScene(scene);
		stage.setTitle("Diploma Generator");
		stage.getIcons().add(
			new Image(getClass().getResourceAsStream("Assets/Icon.jpeg")));
		stage.show();
	}

	private static void scanAndAdd(List<String> list, File file) {
		try(Scanner input = new Scanner(file) ) {
			while (input.hasNextLine()) {
				list.add(input.nextLine());
			}
		} catch (FileNotFoundException notFound) {
			System.out.println("Cannot find: " + notFound);
		}
	}
}


text:
'use strict';

exports.type = 'perItem';

exports.active = false;

/**
 * Remove raster images references in <image>.
 *
 * @see https://bugs.webkit.org/show_bug.cgi?id=63548
 *
 * @param {Object} item current iteration item
 * @return {Boolean} if false, item will be filtered out
 *
 * @author Kir Belevich
 */
exports.fn = function(item) {

    if (
        item.isElem('image') &&
        item.hasAttr('xlink:href') &&
        /(\.|image\/)(jpg|png|gif)/.test(item.attr('xlink:href').value)
    ) {
        return false;
    }

};


text:
package org.earthtime.dataDictionaries;

/**
 *
 * @author James F. Bowring
 */
/*
 *
 *
 * Created July 2011 as part of major refactoring to control magic strings
 */
public enum SampleTypesEnum {

    // Sample Types
    /**
     *
     */
    ANALYSIS("ANALYSIS"),
    /**
     *
     */
    LEGACY( "LEGACY" ),

    /**
     *
     */
    LIVEWORKFLOW( "LIVEWORKFLOW" ),

    /**
     *
     */
    NONE( "NONE" ),

    /**
     *
     */
    SAMPLEFOLDER( "SAMPLEFOLDER" ),
    /**
     *
     */
    COMPILATION( "COMPILATION" ),
    /**
     * PROJECT is the sample type for COMPILATION after Sept 2012.
     * Support for COMPILATION will continue due to legacy redux files.
     */
    PROJECT( "PROJECT" );
    private String name;

    private SampleTypesEnum ( String name ) {
        this.name = name;
    }

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