text:
#include "config.h"

#include <stdlib.h>
#include <math.h>

#include "AL/al.h"
#include "AL/alc.h"
#include "alMain.h"
#include "alAuxEffectSlot.h"
#include "alThunk.h"
#include "alError.h"
#include "alSource.h"

extern inline struct ALeffectslot *LookupEffectSlot(ALCcontext *context, ALuint id);
extern inline struct ALeffectslot *RemoveEffectSlot(ALCcontext *context, ALuint id);

static ALenum AddEffectSlotArray(ALCcontext *Context, ALeffectslot **start, ALsizei count);
static void RemoveEffectSlotArray(ALCcontext *Context, const ALeffectslot *slot);

static UIntMap EffectStateFactoryMap;
static inline ALeffectStateFactory *getFactoryByType(ALenum type)
{
    ALeffectStateFactory* (*getFactory)(void) = LookupUIntMapKey(&EffectStateFactoryMap, type);
    if(getFactory != NULL)
        return getFactory();
    return NULL;
}

AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots)
{
    ALCcontext *context;
    VECTOR(ALeffectslot*) slotvec;
    ALsizei cur;
    ALenum err;

    context = GetContextRef();
    if(!context) return;

    VECTOR_INIT(slotvec);

    if(!(n >= 0))
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
    if(!VECTOR_RESERVE(slotvec, n))
        SET_ERROR_AND_GOTO(context, AL_OUT_OF_MEMORY, done);

    for(cur = 0;cur < n;cur++)
    {
        ALeffectslot *slot = al_calloc(16, sizeof(ALeffectslot));
        err = AL_OUT_OF_MEMORY;
        if(!slot || (err=InitEffectSlot(slot)) != AL_NO_ERROR)
        {
            al_free(slot);
            alDeleteAuxiliaryEffectSlots(cur, effectslots);
            SET_ERROR_AND_GOTO(context, err, done);
        }

        err = NewThunkEntry(&slot->id);
        if(err == AL_NO_ERROR)
            err = InsertUIntMapEntry(&context->EffectSlotMap, slot->id, slot);
        if(err != AL_NO_ERROR)
        {
            FreeThunkEntry(slot->id);
            DELETE_OBJ(slot->EffectState);
            al_free(slot);

            alDeleteAuxiliaryEffectSlots(cur, effectslots);
            SET_ERROR_AND_GOTO(context, err, done);
        }

        aluInitEffectPanning(slot);

        VECTOR_PUSH_BACK(slotvec, slot);

        effectslots[cur] = slot->id;
    }
    err = AddEffectSlotArray(context, VECTOR_ITER_BEGIN(slotvec), n);
    if(err != AL_NO_ERROR)
    {
        alDeleteAuxiliaryEffectSlots(cur, effectslots);
        SET_ERROR_AND_GOTO(context, err, done);
    }

done:
    VECTOR_DEINIT(slotvec);

    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots)
{
    ALCcontext *context;
    ALeffectslot *slot;
    ALsizei i;

    context = GetContextRef();
    if(!context) return;

    if(!(n >= 0))
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
    for(i = 0;i < n;i++)
    {
        if((slot=LookupEffectSlot(context, effectslots[i])) == NULL)
            SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
        if(ReadRef(&slot->ref) != 0)
            SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
    }

    // All effectslots are valid
    for(i = 0;i < n;i++)
    {
        if((slot=RemoveEffectSlot(context, effectslots[i])) == NULL)
            continue;
        FreeThunkEntry(slot->id);

        RemoveEffectSlotArray(context, slot);
        DELETE_OBJ(slot->EffectState);

        memset(slot, 0, sizeof(*slot));
        al_free(slot);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot)
{
    ALCcontext *context;
    ALboolean  ret;

    context = GetContextRef();
    if(!context) return AL_FALSE;

    ret = (LookupEffectSlot(context, effectslot) ? AL_TRUE : AL_FALSE);

    ALCcontext_DecRef(context);

    return ret;
}

AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint value)
{
    ALCdevice *device;
    ALCcontext *context;
    ALeffectslot *slot;
    ALeffect *effect = NULL;
    ALenum err;

    context = GetContextRef();
    if(!context) return;

    device = context->Device;
    if((slot=LookupEffectSlot(context, effectslot)) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    case AL_EFFECTSLOT_EFFECT:
        effect = (value ? LookupEffect(device, value) : NULL);
        if(!(value == 0 || effect != NULL))
            SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);

        err = InitializeEffect(device, slot, effect);
        if(err != AL_NO_ERROR)
            SET_ERROR_AND_GOTO(context, err, done);
        ATOMIC_STORE(&context->UpdateSources, AL_TRUE);
        break;

    case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
        if(!(value == AL_TRUE || value == AL_FALSE))
            SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);

        slot->AuxSendAuto = value;
        ATOMIC_STORE(&context->UpdateSources, AL_TRUE);
        break;

    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *values)
{
    ALCcontext *context;

    switch(param)
    {
    case AL_EFFECTSLOT_EFFECT:
    case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
        alAuxiliaryEffectSloti(effectslot, param, values[0]);
        return;
    }

    context = GetContextRef();
    if(!context) return;

    if(LookupEffectSlot(context, effectslot) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat value)
{
    ALCcontext *context;
    ALeffectslot *slot;

    context = GetContextRef();
    if(!context) return;

    if((slot=LookupEffectSlot(context, effectslot)) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    case AL_EFFECTSLOT_GAIN:
        if(!(value >= 0.0f && value <= 1.0f))
            SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);

        slot->Gain = value;
        ATOMIC_STORE(&slot->NeedsUpdate, AL_TRUE);
        break;

    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *values)
{
    ALCcontext *context;

    switch(param)
    {
    case AL_EFFECTSLOT_GAIN:
        alAuxiliaryEffectSlotf(effectslot, param, values[0]);
        return;
    }

    context = GetContextRef();
    if(!context) return;

    if(LookupEffectSlot(context, effectslot) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *value)
{
    ALCcontext *context;
    ALeffectslot *slot;

    context = GetContextRef();
    if(!context) return;

    if((slot=LookupEffectSlot(context, effectslot)) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
        *value = slot->AuxSendAuto;
        break;

    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *values)
{
    ALCcontext *context;

    switch(param)
    {
    case AL_EFFECTSLOT_EFFECT:
    case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
        alGetAuxiliaryEffectSloti(effectslot, param, values);
        return;
    }

    context = GetContextRef();
    if(!context) return;

    if(LookupEffectSlot(context, effectslot) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *value)
{
    ALCcontext *context;
    ALeffectslot *slot;

    context = GetContextRef();
    if(!context) return;

    if((slot=LookupEffectSlot(context, effectslot)) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    case AL_EFFECTSLOT_GAIN:
        *value = slot->Gain;
        break;

    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *values)
{
    ALCcontext *context;

    switch(param)
    {
    case AL_EFFECTSLOT_GAIN:
        alGetAuxiliaryEffectSlotf(effectslot, param, values);
        return;
    }

    context = GetContextRef();
    if(!context) return;

    if(LookupEffectSlot(context, effectslot) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}

static ALenum AddEffectSlotArray(ALCcontext *context, ALeffectslot **start, ALsizei count)
{
    ALenum err = AL_NO_ERROR;

    LockContext(context);
    if(!VECTOR_INSERT(context->ActiveAuxSlots, VECTOR_ITER_END(context->ActiveAuxSlots), start, start+count))
        err = AL_OUT_OF_MEMORY;
    UnlockContext(context);

    return err;
}

static void RemoveEffectSlotArray(ALCcontext *context, const ALeffectslot *slot)
{
    ALeffectslot **iter;

    LockContext(context);
#define MATCH_SLOT(_i)  (slot == *(_i))
    VECTOR_FIND_IF(iter, ALeffectslot*, context->ActiveAuxSlots, MATCH_SLOT);
    if(iter != VECTOR_ITER_END(context->ActiveAuxSlots))
    {
        *iter = VECTOR_BACK(context->ActiveAuxSlots);
        VECTOR_POP_BACK(context->ActiveAuxSlots);
    }
#undef MATCH_SLOT
    UnlockContext(context);
}

void InitEffectFactoryMap(void)
{
    InitUIntMap(&EffectStateFactoryMap, ~0);

    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_NULL, ALnullStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_EAXREVERB, ALreverbStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_REVERB, ALreverbStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_AUTOWAH, ALautowahStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_CHORUS, ALchorusStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_COMPRESSOR, ALcompressorStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_DISTORTION, ALdistortionStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_ECHO, ALechoStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_EQUALIZER, ALequalizerStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_FLANGER, ALflangerStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_RING_MODULATOR, ALmodulatorStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_DEDICATED_DIALOGUE, ALdedicatedStateFactory_getFactory);
    InsertUIntMapEntry(&EffectStateFactoryMap, AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT, ALdedicatedStateFactory_getFactory);
}

void DeinitEffectFactoryMap(void)
{
    ResetUIntMap(&EffectStateFactoryMap);
}

ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *effect)
{
    ALenum newtype = (effect ? effect->type : AL_EFFECT_NULL);
    ALeffectStateFactory *factory;

    if(newtype != EffectSlot->EffectType)
    {
        ALeffectState *State;
        FPUCtl oldMode;

        factory = getFactoryByType(newtype);
        if(!factory)
        {
            ERR("Failed to find factory for effect type 0x%04x\n", newtype);
            return AL_INVALID_ENUM;
        }
        State = V0(factory,create)();
        if(!State)
            return AL_OUT_OF_MEMORY;

        SetMixerFPUMode(&oldMode);

        ALCdevice_Lock(Device);
        if(V(State,deviceUpdate)(Device) == AL_FALSE)
        {
            ALCdevice_Unlock(Device);
            RestoreFPUMode(&oldMode);
            DELETE_OBJ(State);
            return AL_OUT_OF_MEMORY;
        }

        State = ExchangePtr((XchgPtr*)&EffectSlot->EffectState, State);
        if(!effect)
        {
            memset(&EffectSlot->EffectProps, 0, sizeof(EffectSlot->EffectProps));
            EffectSlot->EffectType = AL_EFFECT_NULL;
        }
        else
        {
            memcpy(&EffectSlot->EffectProps, &effect->Props, sizeof(effect->Props));
            EffectSlot->EffectType = effect->type;
        }

        /* FIXME: This should be done asynchronously, but since the EffectState
         * object was changed, it needs an update before its Process method can
         * be called. */
        ATOMIC_STORE(&EffectSlot->NeedsUpdate, AL_FALSE);
        V(EffectSlot->EffectState,update)(Device, EffectSlot);
        ALCdevice_Unlock(Device);

        RestoreFPUMode(&oldMode);

        DELETE_OBJ(State);
        State = NULL;
    }
    else
    {
        if(effect)
        {
            ALCdevice_Lock(Device);
            memcpy(&EffectSlot->EffectProps, &effect->Props, sizeof(effect->Props));
            ALCdevice_Unlock(Device);
            ATOMIC_STORE(&EffectSlot->NeedsUpdate, AL_TRUE);
        }
    }

    return AL_NO_ERROR;
}

ALenum InitEffectSlot(ALeffectslot *slot)
{
    ALeffectStateFactory *factory;
    ALuint i, c;

    slot->EffectType = AL_EFFECT_NULL;

    factory = getFactoryByType(AL_EFFECT_NULL);
    if(!(slot->EffectState=V0(factory,create)()))
        return AL_OUT_OF_MEMORY;

    slot->Gain = 1.0;
    slot->AuxSendAuto = AL_TRUE;
    ATOMIC_INIT(&slot->NeedsUpdate, AL_FALSE);
    for(c = 0;c < 1;c++)
    {
        for(i = 0;i < BUFFERSIZE;i++)
            slot->WetBuffer[c][i] = 0.0f;
    }
    InitRef(&slot->ref, 0);

    return AL_NO_ERROR;
}

ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context)
{
    ALsizei pos;
    for(pos = 0;pos < Context->EffectSlotMap.size;pos++)
    {
        ALeffectslot *temp = Context->EffectSlotMap.array[pos].value;
        Context->EffectSlotMap.array[pos].value = NULL;

        DELETE_OBJ(temp->EffectState);

        FreeThunkEntry(temp->id);
        memset(temp, 0, sizeof(ALeffectslot));
        al_free(temp);
    }
}


text:
Deconspectrum
=============

Deconspectrum is a collection of sound-responsive cubes whose color represents parts of the aural spectrum around them.

Full installation description [here](http://log.liminastudio.com/projects/deconspectrum).

Individual units consist of the PCB in the /hardware directory (Eagle format) and the ATmega/Arduino software in the /software directory.

The software uses the [PlainFFT library by Didier Longueville](http://www.arduinoos.com/2010/10/fast-fourier-transform-fft/).  I have included the version of the library I used for completeness and accuracy; it is slightly modified to optimize compiled object size.

redpajama_set_name: RedPajamaGithub


text:
package org.xins.common.types;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.xins.common.MandatoryArgumentChecker;

/**
 * Item in a list or a set type.
 *
 * @version $Revision: 1.18 $ $Date: 2007/09/18 08:45:07 $
 * @author Anthony Goubard
 * @author Ernst de Haan
 *
 * @since XINS 1.0.0
 *
 * @see List
 */
public class ItemList {

   /**
    * The list that contains the items. Cannot be null.
    */
   private final java.util.List<Object> _list;

   /**
    * Indicates whether this list accepts equal objects.
    */
   private final boolean _setType;

   /**
    * Creates a new ItemList.
    * The list will be able to contain several instances of an object.
    */
   public ItemList() {
      this(false);
   }

   /**
    * Creates a new ItemList.
    *
    * @param setType
    *    if true an object can be added only once in the list,
    *    if false an object can be added several times in the list.
    */
   public ItemList(boolean setType) {
      _list = new java.util.ArrayList<Object>(10);
      _setType = setType;
   }

   /**
    * Adds a list of items to the list or set. The items are added at the end of the list.
    *
    * @param items
    *    the collection of items to add in the list, cannot be null.
    *
    * @throws IllegalArgumentException
    *    if items == null.
    *
    * @since XINS 2.0
    */
   public final void add(Collection<Object> items) throws IllegalArgumentException {

      // Check preconditions
      MandatoryArgumentChecker.check("items", items);

      // Loop over all items
      for (Object nextItem : items) {

         // A set can not have the same value twice
         if (!_setType || !_list.contains(nextItem)) {
            _list.add(nextItem);
         }
      }
   }

   /**
    * Gets the list of items as a collection.
    * A java.util.Set or a java.util.List is returned
    * depending on the type of this list.
    *
    * @return
    *    a List or a Set containing the items, never null.
    *    the collection returned cannot be modified.
    *
    * @since XINS 2.0
    */
   public final Collection<Object> get() {

      if (_setType) {
         HashSet<Object> set = new HashSet<Object>();
         set.addAll(_list);
         return Collections.unmodifiableSet(set);
      } else {
         return Collections.unmodifiableList(_list);
      }
   }

   /**
    * Adds an item to the list. The item is added at the end of the list.
    *
    * @param value
    *    the value of the item to add in the list, cannot be null.
    *
    * @throws IllegalArgumentException
    *    if value == null.
    */
   protected final void addItem(Object value) throws IllegalArgumentException {

      // Check preconditions
      MandatoryArgumentChecker.check("value", value);

      // A set can not have the same value twice
      if (_setType && _list.contains(value)) {
         return;
      }
      _list.add(value);
   }

   /**
    * Gets the item at the specified index as an Object.
    *
    * @param index
    *    the position of the required item,
    *    it should be >= 0 and < {@link #getSize()}.
    *
    * @return
    *    the item, not null.
    */
   protected final Object getItem(int index) {
      return _list.get(index);
   }

   /**
    * Gets the number of items included in the list.
    *
    * @return
    *    the size of the list.
    */
   public int getSize() {
      return _list.size();
   }

   /**
    * Converts this XINS string list to a Java Collections Framework
    * List.
    *
    * @return
    *    a {@link java.util.List}, never null.
    *
    * @since XINS 2.2
    */
   public java.util.List toList() {
      return Collections.unmodifiableList(_list);
   }
}


text:
export PYENV_ROOT="${XDG_CONFIG_HOME}/pyenv"

if dot::command_exists "pyenv"; then
  dot::eval pyenv init --path
fi

# (2) Python Package Manager -------------------------------------------- {{{1

if dot::command_exists "python"; then
  case "${SHELL}" in
    */bash) dot::eval python -m pip completion --bash;;
    */zsh)  dot::eval python -m pip completion --zsh;;
  esac
fi

# vim:foldmethod=marker:foldlevel=2


text:
module Yr
  class Location
    attr_reader :altitude, :details, :doc
    def initialize(lat, lng)
      @latitude     = lat
      @longitude    = lng
    end

    def current_weather
      return details_hash[Time.now.change(:min => 0, :sec => 0, :usec => 0)]
    end

    def details_hash
      @details ||= parse_time_slots(doc)
    end

    def details
      details_hash.values
    end

    def doc
      @doc ||= Raw::Locationforecast.parse(:lat => @latitude, :lon => @longitude)
    end

    protected

    def parse_time_slots(document)
      time_hash = {}
      time_slots = @doc.search('product time')
      time_slots.each do |node|
        hour = Time.at(Time.xmlschema(node[:from]) - Time.zone_offset("CET"))
        detail = time_hash[hour] ||= Detail.new
        detail.time_range = hour..hour #This should really be fixed. keeping it for backwards compatability

        unless @altitude
          loc = node.at("location")
          @altitude = loc[:altitude] if(loc)
        end

        if(wd = node.at("windDirection"))
          detail.wind ||= Wind.new
          detail.wind.direction = wd[:def].to_f
        end

        if ws = node.at('windSpeed')
         detail.wind ||= Wind.new
         detail.wind.speed_name = ws[:name]
         detail.wind.speed_mps = ws[:mps].to_f
        end

        if temp = node.at('temperature')
         detail.temperature = temp[:value].to_f
        end

        if sym = node.at('symbol')
         s = Symbol.new(sym[:number], sym[:id])
         detail.symbol = s
        end
      end
      time_hash
    end

  end
end


text:
static char out[2000];
static size_t outlen;

static bool
assert_enc (int flags, const char *src, const char *dst)
{
	size_t srclen = strlen(src);
	size_t dstlen = strlen(dst);

	base64_encode(src, srclen, out, &outlen, flags);

	if (outlen != dstlen) {
		printf("FAIL: encoding of '%s': length expected %lu, got %lu\n", src,
			(unsigned long)dstlen,
			(unsigned long)outlen
		);
		return true;
	}
	if (strncmp(dst, out, outlen) != 0) {
		out[outlen] = '\0';
		printf("FAIL: encoding of '%s': expected output '%s', got '%s'\n", src, dst, out);
		return true;
	}
	return false;
}

static bool
assert_dec (int flags, const char *src, const char *dst)
{
	size_t srclen = strlen(src);
	size_t dstlen = strlen(dst);

	if (!base64_decode(src, srclen, out, &outlen, flags)) {
		printf("FAIL: decoding of '%s': decoding error\n", src);
		return true;
	}
	if (outlen != dstlen) {
		printf("FAIL: encoding of '%s': "
			"length expected %lu, got %lu\n", src,
			(unsigned long)dstlen,
			(unsigned long)outlen
		);
		return true;
	}
	if (strncmp(dst, out, outlen) != 0) {
		out[outlen] = '\0';
		printf("FAIL: decoding of '%s': expected output '%s', got '%s'\n", src, dst, out);
		return true;
	}
	return false;
}

static int
assert_roundtrip (int flags, const char *src)
{
	char tmp[1500];
	size_t tmplen;
	size_t srclen = strlen(src);

	// Encode the input into global buffer:
	base64_encode(src, srclen, out, &outlen, flags);

	// Decode the global buffer into local temp buffer:
	if (!base64_decode(out, outlen, tmp, &tmplen, flags)) {
		printf("FAIL: decoding of '%s': decoding error\n", out);
		return true;
	}

	// Check that 'src' is identical to 'tmp':
	if (srclen != tmplen) {
		printf("FAIL: roundtrip of '%s': "
			"length expected %lu, got %lu\n", src,
			(unsigned long)srclen,
			(unsigned long)tmplen
		);
		return true;
	}
	if (strncmp(src, tmp, tmplen) != 0) {
		tmp[tmplen] = '\0';
		printf("FAIL: roundtrip of '%s': got '%s'\n", src, tmp);
		return true;
	}

	return false;
}

static int
test_char_table (int flags)
{
	bool fail = false;
	char chr[256];
	char enc[400], dec[400];
	size_t enclen, declen;

	// Fill array with all characters 0..255:
	for (int i = 0; i < 256; i++)
		chr[i] = (unsigned char)i;

	// Loop, using each char as a starting position to increase test coverage:
	for (int i = 0; i < 256; i++) {

		size_t chrlen = 256 - i;

		base64_encode(&chr[i], chrlen, enc, &enclen, BASE64_FORCE_PLAIN);

		if (!base64_decode(enc, enclen, dec, &declen, flags)) {
			printf("FAIL: decoding @ %d: decoding error\n", i);
			fail = true;
			continue;
		}
		if (declen != chrlen) {
			printf("FAIL: roundtrip @ %d: "
				"length expected %lu, got %lu\n", i,
				(unsigned long)chrlen,
				(unsigned long)declen
			);
			fail = true;
			continue;
		}
		if (strncmp(&chr[i], dec, declen) != 0) {
			printf("FAIL: roundtrip @ %d: decoded output not same as input\n", i);
			fail = true;
		}
	}

	return fail;
}

static int
test_streaming (int flags)
{
	bool fail = false;
	char chr[256];
	char ref[400], enc[400];
	size_t reflen;
	struct base64_state state;

	// Fill array with all characters 0..255:
	for (int i = 0; i < 256; i++)
		chr[i] = (unsigned char)i;

	// Create reference base64 encoding:
	base64_encode(chr, 256, ref, &reflen, BASE64_FORCE_PLAIN);

	// Encode the table with various block sizes and compare to reference:
	for (size_t bs = 1; bs < 255; bs++)
	{
		size_t inpos   = 0;
		size_t partlen = 0;
		size_t enclen  = 0;

		base64_stream_encode_init(&state, flags);
		memset(enc, 0, 400);
		for (;;) {
			base64_stream_encode(&state, &chr[inpos], (inpos + bs > 256) ? 256 - inpos : bs, &enc[enclen], &partlen);
			enclen += partlen;
			if (inpos + bs > 256) {
				break;
			}
			inpos += bs;
		}
		base64_stream_encode_final(&state, &enc[enclen], &partlen);
		enclen += partlen;

		if (enclen != reflen) {
			printf("FAIL: stream encoding gave incorrect size: "
				"%lu instead of %lu\n",
				(unsigned long)enclen,
				(unsigned long)reflen
			);
			fail = true;
		}
		if (strncmp(ref, enc, reflen) != 0) {
			printf("FAIL: stream encoding with blocksize %lu failed\n",
				(unsigned long)bs
			);
			fail = true;
		}
	}

	// Decode the reference encoding with various block sizes and
	// compare to input char table:
	for (size_t bs = 1; bs < 255; bs++)
	{
		size_t inpos   = 0;
		size_t partlen = 0;
		size_t enclen  = 0;

		base64_stream_decode_init(&state, flags);
		memset(enc, 0, 400);
		while (base64_stream_decode(&state, &ref[inpos], (inpos + bs > reflen) ? reflen - inpos : bs, &enc[enclen], &partlen)) {
			enclen += partlen;
			inpos += bs;
		}
		if (enclen != 256) {
			printf("FAIL: stream decoding gave incorrect size: "
				"%lu instead of 255\n",
				(unsigned long)enclen
			);
			fail = true;
		}
		if (strncmp(chr, enc, 256) != 0) {
			printf("FAIL: stream decoding with blocksize %lu failed\n",
				(unsigned long)bs
			);
			fail = true;
		}
	}

	return fail;
}

static int
test_invalid_dec_input (int flags)
{
	// Subset of invalid characters to cover all ranges
	static const char invalid_set[] = { '\0', -1, '!', '-', ';', '_', '|' };
	static const char* invalid_strings[] = {
		"Zm9vYg=",
		"Zm9vYg",
		"Zm9vY",
		"Zm9vYmF=Zm9v"
	};

	bool fail = false;
	char chr[256];
	char enc[400], dec[400];
	size_t enclen, declen;

	// Fill array with all characters 0..255:
	for (int i = 0; i < 256; i++)
		chr[i] = (unsigned char)i;

	// Create reference base64 encoding:
	base64_encode(chr, 256, enc, &enclen, BASE64_FORCE_PLAIN);

	// Test invalid strings returns error.
	for (size_t i = 0U; i < sizeof(invalid_strings) / sizeof(invalid_strings[0]); ++i) {
		if (base64_decode(invalid_strings[i], strlen(invalid_strings[i]), dec, &declen, flags)) {
			printf("FAIL: decoding invalid input \"%s\": no decoding error\n", invalid_strings[i]);
			fail = true;
		}
	}

	// Loop, corrupting each char to increase test coverage:
	for (size_t c = 0U; c < sizeof(invalid_set); ++c) {
		for (size_t i = 0U; i < enclen; i++) {
			char backup = enc[i];

			enc[i] = invalid_set[c];

			if (base64_decode(enc, enclen, dec, &declen, flags)) {
				printf("FAIL: decoding invalid input @ %d: no decoding error\n", (int)i);
				fail = true;
				enc[i] = backup;
				continue;
			}
			enc[i] = backup;
		}
	}

	// Loop, corrupting two chars to increase test coverage:
	for (size_t c = 0U; c < sizeof(invalid_set); ++c) {
		for (size_t i = 0U; i < enclen - 2U; i++) {
			char backup  = enc[i+0];
			char backup2 = enc[i+2];

			enc[i+0] = invalid_set[c];
			enc[i+2] = invalid_set[c];

			if (base64_decode(enc, enclen, dec, &declen, flags)) {
				printf("FAIL: decoding invalid input @ %d: no decoding error\n", (int)i);
				fail = true;
				enc[i+0] = backup;
				enc[i+2] = backup2;
				continue;
			}
			enc[i+0] = backup;
			enc[i+2] = backup2;
		}
	}

	return fail;
}

static int
test_one_codec (const char *codec, int flags)
{
	bool fail = false;

	printf("Codec %s:\n", codec);

	// Skip if this codec is not supported:
	if (!codec_supported(flags)) {
		puts("  skipping");
		return false;
	}

	// Test vectors:
	struct {
		const char *in;
		const char *out;
	} vec[] = {

		// These are the test vectors from RFC4648:
		{ "",		""         },
		{ "f",		"Zg=="     },
		{ "fo",		"Zm8="     },
		{ "foo",	"Zm9v"     },
		{ "foob",	"Zm9vYg==" },
		{ "fooba",	"Zm9vYmE=" },
		{ "foobar",	"Zm9vYmFy" },

		// The first paragraph from Moby Dick,
		// to test the SIMD codecs with larger blocksize:
		{ moby_dick_plain, moby_dick_base64 },
	};

	for (size_t i = 0; i < sizeof(vec) / sizeof(vec[0]); i++) {

		// Encode plain string, check against output:
		fail |= assert_enc(flags, vec[i].in, vec[i].out);

		// Decode the output string, check if we get the input:
		fail |= assert_dec(flags, vec[i].out, vec[i].in);

		// Do a roundtrip on the inputs and the outputs:
		fail |= assert_roundtrip(flags, vec[i].in);
		fail |= assert_roundtrip(flags, vec[i].out);
	}

	fail |= test_char_table(flags);
	fail |= test_streaming(flags);
	fail |= test_invalid_dec_input(flags);

	if (!fail)
		puts("  all tests passed.");

	return fail;
}

int
main ()
{
	bool fail = false;

	// Loop over all codecs:
	for (size_t i = 0; codecs[i]; i++) {

		// Flags to invoke this codec:
		int codec_flags = (1 << i);

		// Test this codec, merge the results:
		fail |= test_one_codec(codecs[i], codec_flags);
	}

	return (fail) ? 1 : 0;
}


text:
package org.drools.mvel.compiler;

public class MyUtil {

    public String transform(Object o) {
        return o.toString() + "-san";
    }
}


text:
package org.pentaho.di.www;

import static junit.framework.Assert.assertFalse;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;

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

import org.junit.Before;
import org.junit.Test;
import org.pentaho.di.core.gui.Point;
import org.pentaho.di.core.logging.KettleLogStore;
import org.pentaho.di.core.logging.LogChannelInterface;
import org.pentaho.di.job.Job;
import org.pentaho.di.job.JobMeta;

public class RemoveJobServletTest {
  private JobMap mockJobMap;

  private RemoveJobServlet removeJobServlet;

  @Before
  public void setup() {
    mockJobMap = mock( JobMap.class );
    removeJobServlet = new RemoveJobServlet( mockJobMap );
  }

  @Test
  public void testRemoveJobServletEscapesHtmlWhenTransNotFound() throws ServletException, IOException {
    HttpServletRequest mockHttpServletRequest = mock( HttpServletRequest.class );
    HttpServletResponse mockHttpServletResponse = mock( HttpServletResponse.class );

    StringWriter out = new StringWriter();
    PrintWriter printWriter = new PrintWriter( out );

    when( mockHttpServletRequest.getContextPath() ).thenReturn( RemoveJobServlet.CONTEXT_PATH );
    when( mockHttpServletRequest.getParameter( anyString() ) ).thenReturn( ServletTestUtils.BAD_STRING );
    when( mockHttpServletResponse.getWriter() ).thenReturn( printWriter );

    removeJobServlet.doGet( mockHttpServletRequest, mockHttpServletResponse );
    assertFalse( ServletTestUtils.hasBadText( ServletTestUtils.getInsideOfTag( "H1", out.toString() ) ) );
  }

  @Test
  public void testRemoveJobServletEscapesHtmlWhenTransFound() throws ServletException, IOException {
    KettleLogStore.init();
    HttpServletRequest mockHttpServletRequest = mock( HttpServletRequest.class );
    HttpServletResponse mockHttpServletResponse = mock( HttpServletResponse.class );
    Job mockJob = mock( Job.class );
    JobMeta mockJobMeta = mock( JobMeta.class );
    LogChannelInterface mockLogChannelInterface = mock( LogChannelInterface.class );
    mockJob.setName( ServletTestUtils.BAD_STRING );
    StringWriter out = new StringWriter();
    PrintWriter printWriter = new PrintWriter( out );

    when( mockHttpServletRequest.getContextPath() ).thenReturn( RemoveJobServlet.CONTEXT_PATH );
    when( mockHttpServletRequest.getParameter( anyString() ) ).thenReturn( ServletTestUtils.BAD_STRING );
    when( mockHttpServletResponse.getWriter() ).thenReturn( printWriter );
    when( mockJobMap.getJob( any( CarteObjectEntry.class ) ) ).thenReturn( mockJob );
    when( mockJob.getLogChannelId() ).thenReturn( ServletTestUtils.BAD_STRING );
    when( mockJob.getLogChannel() ).thenReturn( mockLogChannelInterface );
    when( mockJob.getJobMeta() ).thenReturn( mockJobMeta );
    when( mockJobMeta.getMaximum() ).thenReturn( new Point( 10, 10 ) );

    removeJobServlet.doGet( mockHttpServletRequest, mockHttpServletResponse );
    assertFalse( ServletTestUtils.hasBadText( ServletTestUtils.getInsideOfTag( "H3", out.toString() ) ) );
  }
}


text:
<?php

return array(
    'controllers' => array(
        'invokables' => array(
            'Category\Controller\Category' => 'Category\Controller\CategoryController',
        ),
    ),
    'router' => array(
        'routes' => array(
            'category' => array(
                'type' => 'segment',
                'options' => array(
                    // Change this to something specific to your module
                    'route' => '/category[/][:action][/][:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9]+',
                    ),
                    'defaults' => array(
                        // Change this value to reflect the namespace in which
                        // the controllers for your module are found
                        'controller' => 'Category\Controller\Category',
                        'action' => 'index',
                    ),
                ),
            ),
        ),
    ),
    'view_manager' => array(
        'template_path_stack' => array(
            'Category' => __DIR__ . '/../view',
        ),
    ),
    'doctrine' => array(
        'driver' => array(
            'category_module_entities' => array(
                'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
                'cache' => 'array',
                'paths' => array(__DIR__ . '/../src/Category/Model')
            ),
            'orm_default' => array(
                'drivers' => array(
                    'Category\Model' => 'category_module_entities'
                )
            )
        )
    ),
);


text:
Centinelas de Seguridad

Este módulo le permite configurar el conjunto de aplicaciones de seguridad
Trisentry, de Psionic Technologies. Estos tres programas
(<tt>portsentry</tt>,<tt>hostsentry</tt> y <tt>logcheck</tt>) se pueden
usar para detectar automáticamente violaciones de seguridad en su sistema y
notificar al administrador del sistema acerca de las mismas.


text:
sap.ui.define(["exports", "sap/ui/webc/common/thirdparty/base/util/PopupUtils", "./OpenedPopupsRegistry"], function (_exports, _PopupUtils, _OpenedPopupsRegistry) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.removeOpenedPopover = _exports.getRegistry = _exports.addOpenedPopover = void 0;
  let updateInterval = null;
  const intervalTimeout = 300;
  const openedRegistry = [];

  const repositionPopovers = event => {
    openedRegistry.forEach(popover => {
      popover.instance.reposition();
    });
  };

  const attachGlobalScrollHandler = () => {
    document.body.addEventListener("scroll", repositionPopovers, true);
  };

  const detachGlobalScrollHandler = () => {
    document.body.removeEventListener("scroll", repositionPopovers, true);
  };

  const runUpdateInterval = () => {
    updateInterval = setInterval(() => {
      repositionPopovers();
    }, intervalTimeout);
  };

  const stopUpdateInterval = () => {
    clearInterval(updateInterval);
  };

  const attachGlobalClickHandler = () => {
    document.addEventListener("mousedown", clickHandler);
  };

  const detachGlobalClickHandler = () => {
    document.removeEventListener("mousedown", clickHandler);
  };

  const clickHandler = event => {
    const openedPopups = (0, _OpenedPopupsRegistry.getOpenedPopups)();
    const isTopPopupPopover = openedPopups[openedPopups.length - 1].instance.showAt;

    if (openedPopups.length === 0 || !isTopPopupPopover) {
      return;
    } // loop all open popovers

    for (let i = openedPopups.length - 1; i !== -1; i--) {
      const popup = openedPopups[i].instance; // if popup is modal, opener is clicked, popup is dialog skip closing

      if (popup.isModal || popup.isOpenerClicked(event)) {
        return;
      }

      if ((0, _PopupUtils.isClickInRect)(event, popup.getBoundingClientRect())) {
        break;
      }

      popup.close();
    }
  };

  const attachScrollHandler = popover => {
    popover && popover.shadowRoot.addEventListener("scroll", repositionPopovers, true);
  };

  const detachScrollHandler = popover => {
    popover && popover.shadowRoot.removeEventListener("scroll", repositionPopovers);
  };

  const addOpenedPopover = instance => {
    const parentPopovers = getParentPopoversIfNested(instance);
    (0, _OpenedPopupsRegistry.addOpenedPopup)(instance, parentPopovers);
    openedRegistry.push({
      instance,
      parentPopovers
    });
    attachScrollHandler(instance);

    if (openedRegistry.length === 1) {
      attachGlobalScrollHandler();
      attachGlobalClickHandler();
      runUpdateInterval();
    }
  };

  _exports.addOpenedPopover = addOpenedPopover;

  const removeOpenedPopover = instance => {
    const popoversToClose = [instance];

    for (let i = 0; i < openedRegistry.length; i++) {
      const indexOfCurrentInstance = openedRegistry[i].parentPopovers.indexOf(instance);

      if (openedRegistry[i].parentPopovers.length > 0 && indexOfCurrentInstance > -1) {
        popoversToClose.push(openedRegistry[i].instance);
      }
    }

    for (let i = popoversToClose.length - 1; i >= 0; i--) {
      for (let j = 0; j < openedRegistry.length; j++) {
        let indexOfItemToRemove;

        if (popoversToClose[i] === openedRegistry[j].instance) {
          indexOfItemToRemove = j;
        }

        if (indexOfItemToRemove >= 0) {
          (0, _OpenedPopupsRegistry.removeOpenedPopup)(openedRegistry[indexOfItemToRemove].instance);
          detachScrollHandler(openedRegistry[indexOfItemToRemove].instance);
          const itemToClose = openedRegistry.splice(indexOfItemToRemove, 1);
          itemToClose[0].instance.close(false, true);
        }
      }
    }

    if (!openedRegistry.length) {
      detachGlobalScrollHandler();
      detachGlobalClickHandler();
      stopUpdateInterval();
    }
  };

  _exports.removeOpenedPopover = removeOpenedPopover;

  const getRegistry = () => {
    return openedRegistry;
  };

  _exports.getRegistry = getRegistry;

  const getParentPopoversIfNested = instance => {
    let currentElement = instance.parentNode;
    const parentPopovers = [];

    while (currentElement.parentNode) {
      for (let i = 0; i < openedRegistry.length; i++) {
        if (currentElement && currentElement === openedRegistry[i].instance) {
          parentPopovers.push(currentElement);
        }
      }

      currentElement = currentElement.parentNode;
    }

    return parentPopovers;
  };
});


text:
#ifndef lint
#if 0
static char sccsid[] = "@(#)exec.c	8.4 (Berkeley) 6/8/95";
#endif
#endif /* not lint */
/*
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/bin/sh/exec.c,v 1.24.2.1 2004/09/30 04:41:55 des Exp $");
*/

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>

/*
 * When commands are first encountered, they are entered in a hash table.
 * This ensures that a full path search will not have to be done for them
 * on each invocation.
 *
 * We should investigate converting to a linear search, even though that
 * would make the command name "hash" a misnomer.
 */

#include "shell.h"
#include "main.h"
#include "nodes.h"
#include "parser.h"
#include "redir.h"
#include "eval.h"
#include "exec.h"
#include "builtins.h"
#include "var.h"
#include "options.h"
#include "input.h"
#include "output.h"
#include "syntax.h"
#include "memalloc.h"
#include "error.h"
#include "init.h"
#include "mystring.h"
#include "show.h"
#include "jobs.h"
#include "alias.h"

#define CMDTABLESIZE 31		/* should be prime */
#define ARB 1			/* actual size determined at run time */

struct tblentry {
	struct tblentry *next;	/* next entry in hash chain */
	union param param;	/* definition of builtin function */
	short cmdtype;		/* index identifying command */
	char rehash;		/* if set, cd done since entry created */
	char cmdname[ARB];	/* name of command */
};

STATIC struct tblentry *cmdtable[CMDTABLESIZE];
STATIC int builtinloc = -1;		/* index in path of %builtin, or -1 */
int exerrno = 0;			/* Last exec error */

STATIC void tryexec(char *, char **, char **);
STATIC void printentry(struct tblentry *, int);
STATIC struct tblentry *cmdlookup(char *, int);
STATIC void delete_cmd_entry(void);
STATIC void addcmdentry(char *, struct cmdentry *);

/*
 * Exec a program.  Never returns.  If you change this routine, you may
 * have to change the find_command routine as well.
 */

void
shellexec(char **argv, char **envp, char *path, int index)
{
	char *cmdname;
	int e;

	if (strchr(argv[0], '/') != NULL) {
		tryexec(argv[0], argv, envp);
		e = errno;
	} else {
		e = ENOENT;
		while ((cmdname = padvance(&path, argv[0])) != NULL) {
			if (--index < 0 && pathopt == NULL) {
				tryexec(cmdname, argv, envp);
				if (errno != ENOENT && errno != ENOTDIR)
					e = errno;
			}
			stunalloc(cmdname);
		}
	}

	/* Map to POSIX errors */
	switch (e) {
	case EACCES:
		exerrno = 126;
		break;
	case ENOENT:
		exerrno = 127;
		break;
	default:
		exerrno = 2;
		break;
	}
	if (e == ENOENT || e == ENOTDIR)
		exerror(EXEXEC, "%s: not found", argv[0]);
	exerror(EXEXEC, "%s: %s", argv[0], strerror(e));
}

STATIC void
tryexec(char *cmd, char **argv, char **envp)
{
	int e;

	execve(cmd, argv, envp);
#if !__minix_vmd
	e = errno;
	if (e == ENOEXEC) {
		initshellproc();
		setinputfile(cmd, 0);
		commandname = arg0 = savestr(argv[0]);
		setparam(argv + 1);
		exraise(EXSHELLPROC);
		/*NOTREACHED*/
	}
	errno = e;
#endif
}

/*
 * Do a path search.  The variable path (passed by reference) should be
 * set to the start of the path before the first call; padvance will update
 * this value as it proceeds.  Successive calls to padvance will return
 * the possible path expansions in sequence.  If an option (indicated by
 * a percent sign) appears in the path entry then the global variable
 * pathopt will be set to point to it; otherwise pathopt will be set to
 * NULL.
 */

char *pathopt;

char *
padvance(char **path, char *name)
{
	char *p, *q;
	char *start;
	int len;

	if (*path == NULL)
		return NULL;
	start = *path;
	for (p = start ; *p && *p != ':' && *p != '%' ; p++);
	len = p - start + strlen(name) + 2;	/* "2" is for '/' and '\0' */
	while (stackblocksize() < len)
		growstackblock();
	q = stackblock();
	if (p != start) {
		memcpy(q, start, p - start);
		q += p - start;
		*q++ = '/';
	}
	strcpy(q, name);
	pathopt = NULL;
	if (*p == '%') {
		pathopt = ++p;
		while (*p && *p != ':')  p++;
	}
	if (*p == ':')
		*path = p + 1;
	else
		*path = NULL;
	return stalloc(len);
}

/*** Command hashing code ***/

int
hashcmd(int argc __unused, char **argv __unused)
{
	struct tblentry **pp;
	struct tblentry *cmdp;
	int c;
	int verbose;
	struct cmdentry entry;
	char *name;

	verbose = 0;
	while ((c = nextopt("rv")) != '\0') {
		if (c == 'r') {
			clearcmdentry(0);
		} else if (c == 'v') {
			verbose++;
		}
	}
	if (*argptr == NULL) {
		for (pp = cmdtable ; pp < &cmdtable[CMDTABLESIZE] ; pp++) {
			for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
				if (cmdp->cmdtype == CMDNORMAL)
					printentry(cmdp, verbose);
			}
		}
		return 0;
	}
	while ((name = *argptr) != NULL) {
		if ((cmdp = cmdlookup(name, 0)) != NULL
		 && (cmdp->cmdtype == CMDNORMAL
		     || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0)))
			delete_cmd_entry();
		find_command(name, &entry, 1, pathval());
		if (verbose) {
			if (entry.cmdtype != CMDUNKNOWN) {	/* if no error msg */
				cmdp = cmdlookup(name, 0);
				if (cmdp != NULL)
					printentry(cmdp, verbose);
				else
					outfmt(&errout, "%s: not found\n", name);
			}
			flushall();
		}
		argptr++;
	}
	return 0;
}

STATIC void
printentry(struct tblentry *cmdp, int verbose)
{
	int index;
	char *path;
	char *name;

	if (cmdp->cmdtype == CMDNORMAL) {
		index = cmdp->param.index;
		path = pathval();
		do {
			name = padvance(&path, cmdp->cmdname);
			stunalloc(name);
		} while (--index >= 0);
		out1str(name);
	} else if (cmdp->cmdtype == CMDBUILTIN) {
		out1fmt("builtin %s", cmdp->cmdname);
	} else if (cmdp->cmdtype == CMDFUNCTION) {
		out1fmt("function %s", cmdp->cmdname);
		if (verbose) {
			INTOFF;
			name = commandtext(cmdp->param.func);
			out1c(' ');
			out1str(name);
			ckfree(name);
			INTON;
		}
#if DEBUG
	} else {
		error("internal error: cmdtype %d", cmdp->cmdtype);
#endif
	}
	if (cmdp->rehash)
		out1c('*');
	out1c('\n');
}

/*
 * Resolve a command name.  If you change this routine, you may have to
 * change the shellexec routine as well.
 */

void
find_command(char *name, struct cmdentry *entry, int printerr, char *path)
{
	struct tblentry *cmdp;
	int index;
	int prev;
	char *fullname;
	struct stat statb;
	int e;
	int i;

	/* If name contains a slash, don't use the hash table */
	if (strchr(name, '/') != NULL) {
		entry->cmdtype = CMDNORMAL;
		entry->u.index = 0;
		return;
	}

	/* If name is in the table, and not invalidated by cd, we're done */
	if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->rehash == 0)
		goto success;

	/* If %builtin not in path, check for builtin next */
	if (builtinloc < 0 && (i = find_builtin(name)) >= 0) {
		INTOFF;
		cmdp = cmdlookup(name, 1);
		cmdp->cmdtype = CMDBUILTIN;
		cmdp->param.index = i;
		INTON;
		goto success;
	}

	/* We have to search path. */
	prev = -1;		/* where to start */
	if (cmdp) {		/* doing a rehash */
		if (cmdp->cmdtype == CMDBUILTIN)
			prev = builtinloc;
		else
			prev = cmdp->param.index;
	}

	e = ENOENT;
	index = -1;
loop:
	while ((fullname = padvance(&path, name)) != NULL) {
		stunalloc(fullname);
		index++;
		if (pathopt) {
			if (prefix("builtin", pathopt)) {
				if ((i = find_builtin(name)) < 0)
					goto loop;
				INTOFF;
				cmdp = cmdlookup(name, 1);
				cmdp->cmdtype = CMDBUILTIN;
				cmdp->param.index = i;
				INTON;
				goto success;
			} else if (prefix("func", pathopt)) {
				/* handled below */
			} else {
				goto loop;	/* ignore unimplemented options */
			}
		}
		/* if rehash, don't redo absolute path names */
		if (fullname[0] == '/' && index <= prev) {
			if (index < prev)
				goto loop;
			TRACE(("searchexec \"%s\": no change\n", name));
			goto success;
		}
		if (stat(fullname, &statb) < 0) {
			if (errno != ENOENT && errno != ENOTDIR)
				e = errno;
			goto loop;
		}
		e = EACCES;	/* if we fail, this will be the error */
		if (!S_ISREG(statb.st_mode))
			goto loop;
		if (pathopt) {		/* this is a %func directory */
			stalloc(strlen(fullname) + 1);
			readcmdfile(fullname);
			if ((cmdp = cmdlookup(name, 0)) == NULL || cmdp->cmdtype != CMDFUNCTION)
				error("%s not defined in %s", name, fullname);
			stunalloc(fullname);
			goto success;
		}
#ifdef notdef
		if (statb.st_uid == geteuid()) {
			if ((statb.st_mode & 0100) == 0)
				goto loop;
		} else if (statb.st_gid == getegid()) {
			if ((statb.st_mode & 010) == 0)
				goto loop;
		} else {
			if ((statb.st_mode & 01) == 0)
				goto loop;
		}
#endif
		TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname));
		INTOFF;
		cmdp = cmdlookup(name, 1);
		cmdp->cmdtype = CMDNORMAL;
		cmdp->param.index = index;
		INTON;
		goto success;
	}

	/* We failed.  If there was an entry for this command, delete it */
	if (cmdp)
		delete_cmd_entry();
	if (printerr) {
		if (e == ENOENT || e == ENOTDIR)
			outfmt(out2, "%s: not found\n", name);
		else
			outfmt(out2, "%s: %s\n", name, strerror(e));
	}
	entry->cmdtype = CMDUNKNOWN;
	return;

success:
	cmdp->rehash = 0;
	entry->cmdtype = cmdp->cmdtype;
	entry->u = cmdp->param;
}

/*
 * Search the table of builtin commands.
 */

int
find_builtin(char *name)
{
	const struct builtincmd *bp;

	for (bp = builtincmd ; bp->name ; bp++) {
		if (*bp->name == *name && equal(bp->name, name))
			return bp->code;
	}
	return -1;
}

/*
 * Called when a cd is done.  Marks all commands so the next time they
 * are executed they will be rehashed.
 */

void
hashcd(void)
{
	struct tblentry **pp;
	struct tblentry *cmdp;

	for (pp = cmdtable ; pp < &cmdtable[CMDTABLESIZE] ; pp++) {
		for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
			if (cmdp->cmdtype == CMDNORMAL
			 || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))
				cmdp->rehash = 1;
		}
	}
}

/*
 * Called before PATH is changed.  The argument is the new value of PATH;
 * pathval() still returns the old value at this point.  Called with
 * interrupts off.
 */

void
changepath(const char *newval)
{
	const char *old, *new;
	int index;
	int firstchange;
	int bltin;

	old = pathval();
	new = newval;
	firstchange = 9999;	/* assume no change */
	index = 0;
	bltin = -1;
	for (;;) {
		if (*old != *new) {
			firstchange = index;
			if ((*old == '\0' && *new == ':')
			 || (*old == ':' && *new == '\0'))
				firstchange++;
			old = new;	/* ignore subsequent differences */
		}
		if (*new == '\0')
			break;
		if (*new == '%' && bltin < 0 && prefix("builtin", new + 1))
			bltin = index;
		if (*new == ':') {
			index++;
		}
		new++, old++;
	}
	if (builtinloc < 0 && bltin >= 0)
		builtinloc = bltin;		/* zap builtins */
	if (builtinloc >= 0 && bltin < 0)
		firstchange = 0;
	clearcmdentry(firstchange);
	builtinloc = bltin;
}

/*
 * Clear out command entries.  The argument specifies the first entry in
 * PATH which has changed.
 */

void
clearcmdentry(int firstchange)
{
	struct tblentry **tblp;
	struct tblentry **pp;
	struct tblentry *cmdp;

	INTOFF;
	for (tblp = cmdtable ; tblp < &cmdtable[CMDTABLESIZE] ; tblp++) {
		pp = tblp;
		while ((cmdp = *pp) != NULL) {
			if ((cmdp->cmdtype == CMDNORMAL &&
			     cmdp->param.index >= firstchange)
			 || (cmdp->cmdtype == CMDBUILTIN &&
			     builtinloc >= firstchange)) {
				*pp = cmdp->next;
				ckfree(cmdp);
			} else {
				pp = &cmdp->next;
			}
		}
	}
	INTON;
}

/*
 * Delete all functions.
 */

#ifdef mkinit
INCLUDE "exec.h"
SHELLPROC {
	deletefuncs();
}
#endif

void
deletefuncs(void)
{
	struct tblentry **tblp;
	struct tblentry **pp;
	struct tblentry *cmdp;

	INTOFF;
	for (tblp = cmdtable ; tblp < &cmdtable[CMDTABLESIZE] ; tblp++) {
		pp = tblp;
		while ((cmdp = *pp) != NULL) {
			if (cmdp->cmdtype == CMDFUNCTION) {
				*pp = cmdp->next;
				freefunc(cmdp->param.func);
				ckfree(cmdp);
			} else {
				pp = &cmdp->next;
			}
		}
	}
	INTON;
}

/*
 * Locate a command in the command hash table.  If "add" is nonzero,
 * add the command to the table if it is not already present.  The
 * variable "lastcmdentry" is set to point to the address of the link
 * pointing to the entry, so that delete_cmd_entry can delete the
 * entry.
 */

STATIC struct tblentry **lastcmdentry;

STATIC struct tblentry *
cmdlookup(char *name, int add)
{
	int hashval;
	char *p;
	struct tblentry *cmdp;
	struct tblentry **pp;

	p = name;
	hashval = *p << 4;
	while (*p)
		hashval += *p++;
	hashval &= 0x7FFF;
	pp = &cmdtable[hashval % CMDTABLESIZE];
	for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
		if (equal(cmdp->cmdname, name))
			break;
		pp = &cmdp->next;
	}
	if (add && cmdp == NULL) {
		INTOFF;
		cmdp = *pp = ckmalloc(sizeof (struct tblentry) - ARB
					+ strlen(name) + 1);
		cmdp->next = NULL;
		cmdp->cmdtype = CMDUNKNOWN;
		cmdp->rehash = 0;
		strcpy(cmdp->cmdname, name);
		INTON;
	}
	lastcmdentry = pp;
	return cmdp;
}

/*
 * Delete the command entry returned on the last lookup.
 */

STATIC void
delete_cmd_entry(void)
{
	struct tblentry *cmdp;

	INTOFF;
	cmdp = *lastcmdentry;
	*lastcmdentry = cmdp->next;
	ckfree(cmdp);
	INTON;
}

/*
 * Add a new command entry, replacing any existing command entry for
 * the same name.
 */

static void
addcmdentry(char *name, struct cmdentry *entry)
{
	struct tblentry *cmdp;

	INTOFF;
	cmdp = cmdlookup(name, 1);
	if (cmdp->cmdtype == CMDFUNCTION) {
		freefunc(cmdp->param.func);
	}
	cmdp->cmdtype = entry->cmdtype;
	cmdp->param = entry->u;
	INTON;
}

/*
 * Define a shell function.
 */

void
defun(char *name, union node *func)
{
	struct cmdentry entry;

	INTOFF;
	entry.cmdtype = CMDFUNCTION;
	entry.u.func = copyfunc(func);
	addcmdentry(name, &entry);
	INTON;
}

/*
 * Delete a function if it exists.
 */

int
unsetfunc(char *name)
{
	struct tblentry *cmdp;

	if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->cmdtype == CMDFUNCTION) {
		freefunc(cmdp->param.func);
		delete_cmd_entry();
		return (0);
	}
	return (0);
}

/*
 * Locate and print what a word is...
 */

int
typecmd(int argc, char **argv)
{
	struct cmdentry entry;
	struct tblentry *cmdp;
	char **pp;
	struct alias *ap;
	int i;
	int error = 0;
	extern char *const parsekwd[];

	for (i = 1; i < argc; i++) {
		out1str(argv[i]);
		/* First look at the keywords */
		for (pp = (char **)parsekwd; *pp; pp++)
			if (**pp == *argv[i] && equal(*pp, argv[i]))
				break;

		if (*pp) {
			out1str(" is a shell keyword\n");
			continue;
		}

		/* Then look at the aliases */
		if ((ap = lookupalias(argv[i], 1)) != NULL) {
			out1fmt(" is an alias for %s\n", ap->val);
			continue;
		}

		/* Then check if it is a tracked alias */
		if ((cmdp = cmdlookup(argv[i], 0)) != NULL) {
			entry.cmdtype = cmdp->cmdtype;
			entry.u = cmdp->param;
		}
		else {
			/* Finally use brute force */
			find_command(argv[i], &entry, 0, pathval());
		}

		switch (entry.cmdtype) {
		case CMDNORMAL: {
			if (strchr(argv[i], '/') == NULL) {
				char *path = pathval(), *name;
				int j = entry.u.index;
				do {
					name = padvance(&path, argv[i]);
					stunalloc(name);
				} while (--j >= 0);
				out1fmt(" is%s %s\n",
				    cmdp ? " a tracked alias for" : "", name);
			} else {
				if (access(argv[i], X_OK) == 0)
					out1fmt(" is %s\n", argv[i]);
				else
					out1fmt(": %s\n", strerror(errno));
			}
			break;
		}
		case CMDFUNCTION:
			out1str(" is a shell function\n");
			break;

		case CMDBUILTIN:
			out1str(" is a shell builtin\n");
			break;

		default:
			out1str(": not found\n");
			error |= 127;
			break;
		}
	}
	return error;
}

/*
 * $PchId: exec.c,v 1.6 2006/04/10 14:47:03 philip Exp $
 */


text:
package br.com.trein.bachelor.job.validation;

import org.junit.Before;
import org.junit.Test;

import br.com.trein.bachelor.job.validation.EANValidator;
import br.com.trein.bachelor.job.validation.InvalidEANException;

public class EANValidatorTest {

    private final static String INVALID_CODE_WITH_LETTERS = "VALDIR ANTONIO PAVANELLO";
    private final static String INVALID_CODE_WITH_HEX = "78911500039A";
    private final static String INVALID_CODE_LENGTH = "7891150A";
    private final static String VALID_CODE = "7891150006133";

    private EANValidator validator;

    @Before
    public void setup() {
	this.validator = new EANValidator();
    }

    @Test(expected = InvalidEANException.class)
    public void shouldDiscartEntryWithInvalidCodeLength() throws InvalidEANException {
	// when
	this.validator.validate(INVALID_CODE_LENGTH);
    }

    @Test(expected = InvalidEANException.class)
    public void shouldDiscartEntryWithInvalidCodeFormatHEX() throws InvalidEANException {
	// when
	this.validator.validate(INVALID_CODE_WITH_HEX);
    }

    @Test(expected = InvalidEANException.class)
    public void shouldDiscartEntryWithInvalidCodeFormatLetters() throws InvalidEANException {
	// when
	this.validator.validate(INVALID_CODE_WITH_LETTERS);
    }

    @Test
    public void shouldValidateCompleteEntry() throws InvalidEANException {
	// when
	this.validator.validate(VALID_CODE);
    }

}


text:
/**
 */
package substationStandard.Dataclasses.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import substationStandard.Dataclasses.DataclassesPackage;
import substationStandard.Dataclasses.Point;

/**
 *
 * An implementation of the model object 'Point'.
 *
 *

 * The following features are implemented:
 *

 *

 *
{@link substationStandard.Dataclasses.impl.PointImpl#getXVal XVal}

 *
{@link substationStandard.Dataclasses.impl.PointImpl#getYVal YVal}

 *

 *
 * @generated
 */
public class PointImpl extends MinimalEObjectImpl.Container implements Point {
	/**
	 * The default value of the '{@link #getXVal() XVal}' attribute.
	 *
	 *
	 * @see #getXVal()
	 * @generated
	 * @ordered
	 */
	protected static final float XVAL_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getXVal() XVal}' attribute.
	 *
	 *
	 * @see #getXVal()
	 * @generated
	 * @ordered
	 */
	protected float xVal = XVAL_EDEFAULT;

	/**
	 * The default value of the '{@link #getYVal() YVal}' attribute.
	 *
	 *
	 * @see #getYVal()
	 * @generated
	 * @ordered
	 */
	protected static final float YVAL_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getYVal() YVal}' attribute.
	 *
	 *
	 * @see #getYVal()
	 * @generated
	 * @ordered
	 */
	protected float yVal = YVAL_EDEFAULT;

	/**
	 *
	 *
	 * @generated
	 */
	protected PointImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DataclassesPackage.Literals.POINT;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public float getXVal() {
		return xVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setXVal(float newXVal) {
		float oldXVal = xVal;
		xVal = newXVal;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataclassesPackage.POINT__XVAL, oldXVal, xVal));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public float getYVal() {
		return yVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setYVal(float newYVal) {
		float oldYVal = yVal;
		yVal = newYVal;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataclassesPackage.POINT__YVAL, oldYVal, yVal));
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case DataclassesPackage.POINT__XVAL:
				return getXVal();
			case DataclassesPackage.POINT__YVAL:
				return getYVal();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case DataclassesPackage.POINT__XVAL:
				setXVal((Float)newValue);
				return;
			case DataclassesPackage.POINT__YVAL:
				setYVal((Float)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case DataclassesPackage.POINT__XVAL:
				setXVal(XVAL_EDEFAULT);
				return;
			case DataclassesPackage.POINT__YVAL:
				setYVal(YVAL_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case DataclassesPackage.POINT__XVAL:
				return xVal != XVAL_EDEFAULT;
			case DataclassesPackage.POINT__YVAL:
				return yVal != YVAL_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (xVal: ");
		result.append(xVal);
		result.append(", yVal: ");
		result.append(yVal);
		result.append(')');
		return result.toString();
	}

} //PointImpl


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/state_header"
                android:onClick="gotoPrevious"
                android:id="@+id/btnPre"
                android:layout_weight="0"/>
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:id="@+id/txtCurrect"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:layout_weight="1" android:text="@string/table_header"
        />
        <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/picker_header"
                android:onClick="gotoNext"
                android:id="@+id/btnNext"
                android:layout_weight="0"/>
    </LinearLayout>
    <ListView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/tableListView"/>
</LinearLayout>


text:
# sdcc, the small devices C compiler for embedded systems,
#   http://sdcc.sourceforge.net  */
set(_compiler_id_pp_test "defined(SDCC)")

set(_compiler_id_version_compute "
  /* SDCC = VRP */
#  define COMPILER_VERSION_MAJOR @MACRO_DEC@(SDCC/100)
#  define COMPILER_VERSION_MINOR @MACRO_DEC@(SDCC/10 % 10)
#  define COMPILER_VERSION_PATCH @MACRO_DEC@(SDCC    % 10)")


text:
if [[ "$TRAVIS_OS_NAME" == "Linux" ]]; then
    sudo apt-get -q update
    sudo apt-get install -y wget \
       clang-3.8 libc6-dev make git libicu52 libicu-dev \
       git autoconf libtool pkg-config \
       libblocksruntime-dev \
       libkqueue-dev \
       libpthread-workqueue-dev \
       systemtap-sdt-dev \
       libbsd-dev libbsd0 libbsd0-dbg \
       curl libcurl4-openssl-dev \
       libssl-dev \
       libedit-dev \
       libpython2.7 \
       python2.7 python2.7-dev \
       libxml2

    sudo update-alternatives --quiet --install /usr/bin/clang clang /usr/bin/clang-3.8 100
    sudo update-alternatives --quiet --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 100
fi


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.qcert.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * Trivial file utilities
 */
public class FileUtil {
	/**
	 * Read text from a file into a String
	 * @param srcFile the input file
	 */
	public static String readFile(File srcFile) throws IOException {
		StringWriter swtr = new StringWriter();
		PrintWriter wtr = new PrintWriter(swtr);
		FileReader frdr = new FileReader(srcFile);
		BufferedReader rdr = new BufferedReader(frdr);
		String line = rdr.readLine();
		while (line != null) {
			wtr.println(line);
			line = rdr.readLine();
		}
		rdr.close();
		wtr.close();
		return swtr.toString();
	}

	/**
	 * Write text to a file
	 * @param file the file
	 * @param text the text to write
	 */
	public static void writeFile(File file, String text) throws IOException {
		PrintWriter wtr = new PrintWriter(new FileWriter(file));
		wtr.println(text);
		wtr.close();
	}

}


text:
using System;
using System.Runtime.InteropServices;
using System.Text;
using Realms.Exceptions;

namespace Realms
{
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe struct NativeException
    {
        public RealmExceptionCodes type;
        public byte* messageBytes;
        public IntPtr messageLength;
        public IntPtr detail;
        public IntPtr detailLength;

        internal Exception Convert(Func<RealmExceptionCodes, Exception> overrider = null)
        {
            try
            {
                var overridden = overrider?.Invoke(type);
                if (overridden != null)
                {
                    return overridden;
                }

                var message = (messageLength != IntPtr.Zero) ?
                    Encoding.UTF8.GetString(messageBytes, (int)messageLength)
                    : "No further information available";

                var innerException = GetInnerException();
                if (innerException != null)
                {
                    return new AggregateException(message, innerException);
                }

                var detailMessage = detail != IntPtr.Zero ? Encoding.UTF8.GetString((byte*)detail, (int)detailLength) : null;
                return RealmException.Create(type, message, detailMessage);
            }
            finally
            {
                NativeCommon.delete_pointer(messageBytes);
                if (type != RealmExceptionCodes.RealmDotNetExceptionDuringCallback && detail != IntPtr.Zero)
                {
                    NativeCommon.delete_pointer((byte*)detail);
                }
            }
        }

        private Exception GetInnerException()
        {
            if (type == RealmExceptionCodes.RealmDotNetExceptionDuringCallback)
            {
                var handle = GCHandle.FromIntPtr(detail);
                var result = (Exception)handle.Target;
                handle.Free();
                return result;
            }

            return null;
        }

        internal void ThrowIfNecessary(Func<RealmExceptionCodes, Exception> overrider = null)
        {
            if (type == RealmExceptionCodes.NoError)
            {
                return;
            }

            throw Convert(overrider);
        }
    }
}


text:
#if WINDOWS_UWP
using Windows.UI.Xaml;
#endif

namespace System.Windows
{
    public static class VisibilityExtensions
    {
#if DESKTOP || WINDOWS_UWP
        /// <summary>
        /// 如果 True,返回 Visible,否则返回 Collapsed
        /// </summary>
        /// <param name="value"></param>
        /// <returns>value ? Visibility.Visible : Visibility.Collapsed;</returns>
        public static Visibility VisibleIfTrue(this bool value) => value ? Visibility.Visible : Visibility.Collapsed;

        /// <summary>
        /// 如果 True,返回 Collapsed,否则返回 Visible
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static Visibility CollapsedIfTrue(this bool value) => value ? Visibility.Collapsed : Visibility.Visible;
#endif
    }
}


text:
exports.setUp = function(callback) {
  callback();
}

exports.tearDown = function(callback) {
  callback();
}

exports['Initialize a security Buffer Descriptor'] = function(test) {
  var SecurityBufferDescriptor = require('../../lib/sspi.js').SecurityBufferDescriptor
    SecurityBuffer = require('../../lib/sspi.js').SecurityBuffer;

  // Create descriptor with single Buffer
  var securityDescriptor = new SecurityBufferDescriptor(100);
  try {
    // Fail to work due to no valid Security Buffer
    securityDescriptor = new SecurityBufferDescriptor(["hello"]);
    test.ok(false);
  } catch(err){}

  // Should Correctly construct SecurityBuffer
  var buffer = new SecurityBuffer(SecurityBuffer.DATA, 100);
  securityDescriptor = new SecurityBufferDescriptor([buffer]);
  // Should correctly return a buffer
  var result = securityDescriptor.toBuffer();
  test.equal(100, result.length);

  // Should Correctly construct SecurityBuffer
  var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world"));
  securityDescriptor = new SecurityBufferDescriptor([buffer]);
  var result = securityDescriptor.toBuffer();
  test.equal("hello world", result.toString());

  // Test passing in more than one Buffer
  var buffer = new SecurityBuffer(SecurityBuffer.DATA, new Buffer("hello world"));
  var buffer2 = new SecurityBuffer(SecurityBuffer.STREAM, new Buffer("adam and eve"));
  securityDescriptor = new SecurityBufferDescriptor([buffer, buffer2]);
  var result = securityDescriptor.toBuffer();
  test.equal("hello worldadam and eve", result.toString());
  test.done();
}


text:
phpenv_type = node["phpenv"]["type"]
node["phpenv"][phpenv_type]["packages"].each do |pkg|
  package "phpenv-#{pkg}" do
    package_name pkg
    action :install
  end
end


text:
<?php

final class PhabricatorDaemonLogEventGarbageCollector
  extends PhabricatorGarbageCollector {

  public function collectGarbage() {
    $ttl = PhabricatorEnv::getEnvConfig('gcdaemon.ttl.daemon-logs');
    if ($ttl <= 0) {
      return false;
    }

    $table = new PhabricatorDaemonLogEvent();
    $conn_w = $table->establishConnection('w');

    queryfx(
      $conn_w,
      'DELETE FROM %T WHERE epoch < %d LIMIT 100',
      $table->getTableName(),
      time() - $ttl);

    return ($conn_w->getAffectedRows() == 100);
  }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>mathcomp-ssreflect: 1 m 57 s 🏆</title>
    <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
    <link href="../../../../../bootstrap.min.css" rel="stylesheet">
    <link href="../../../../../bootstrap-custom.css" rel="stylesheet">
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

             Coq bench

clean / released

8.6.1 / mathcomp-ssreflect - 1.6.1

            « Up

              mathcomp-ssreflect

                1.6.1
                1 m 57 s 🏆

📅  (2022-04-26 16:21:57 UTC)

Context

# Packages matching: installed
# Name              # Installed # Synopsis
base-bigarray       base
base-num            base        Num library distributed with the OCaml compiler
base-threads        base
base-unix           base
camlp5              7.14        Preprocessor-pretty-printer of OCaml
conf-findutils      1           Virtual package relying on findutils
conf-perl           2           Virtual package relying on perl
coq                 8.6.1       Formal proof management system
num                 0           The Num library for arbitrary-precision integer and rational arithmetic
ocaml               4.05.0      The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0      Official 4.05.0 release
ocaml-config        1           OCaml Switch Configuration
ocamlfind           1.9.3       A library manager for OCaml
# opam file:
opam-version: "2.0"
name: "coq-mathcomp-ssreflect"
version: "1.6.1"
maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
homepage: "http://ssr.msr-inria.inria.fr/"
bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
license: "CeCILL-B"
build: [ make "-C" "mathcomp/ssreflect" "-j" "%{jobs}%" ]
install: [ make "-C" "mathcomp/ssreflect" "install" ]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/mathcomp'" ]
depends: [
  "ocaml"
  "coq"
    {>= "8.4pl4" & < "8.7~" & != "8.4.6~camlp4"}
]
tags: [ "keyword:small scale reflection" "keyword:mathematical components" "keyword:odd order theorem" ]
authors: [ "Jeremy Avigad <>" "Andrea Asperti <>" "Stephane Le Roux <>" "Yves Bertot <>" "Laurence Rideau <>" "Enrico Tassi <>" "Ioana Pasca <>" "Georges Gonthier <>" "Sidi Ould Biha <>" "Cyril Cohen <>" "Francois Garillot <>" "Alexey Solovyev <>" "Russell O'Connor <>" "Laurent Théry <>" "Assia Mahboubi <>" ]
synopsis: "Small Scale Reflection"
description: """
This library includes the small scale reflection proof language
extension and the minimal set of libraries to take advantage of it.
This includes libraries on lists (seq), boolean and boolean
predicates, natural numbers and types with decidable equality,
finite types, finite sets, finite functions, finite graphs, basic arithmetics
and prime numbers, big operators"""
url {
  src: "http://github.com/math-comp/math-comp/archive/mathcomp-1.6.1.tar.gz"
  checksum: "md5=10d8a17134ddb509b4afa8d3243ee1a0"
}

Lint

Command

true

Return code

0

Dry install 🏜

Dry install with the current Coq version:

Command

opam install -y --show-action coq-mathcomp-ssreflect.1.6.1 coq.8.6.1

Return code

0

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

Command

true

Return code

0

Install dependencies

Command

opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-mathcomp-ssreflect.1.6.1 coq.8.6.1

Return code

0

Duration

12 s

Install 🚀

Command

opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-mathcomp-ssreflect.1.6.1 coq.8.6.1

Return code

0

Duration

1 m 57 s

Installation size

Total: 13 M

2 M ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssreflect_plugin.cmxs

639 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/seq.vo

619 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/finset.glob

561 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/finset.vo

514 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/seq.glob

510 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssreflect_plugin.cmo

502 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/bigop.glob

472 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/prime.glob

435 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/prime.vo

423 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/fintype.vo

414 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/fintype.glob

403 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/bigop.vo

364 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrnat.glob

309 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrnat.vo

292 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrbool.vo

281 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrbool.glob

280 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/div.glob

257 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/path.vo

246 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/binomial.vo

231 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/div.vo

223 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/binomial.glob

220 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/fingraph.vo

183 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/path.glob

168 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/choice.vo

163 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/fingraph.glob

157 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssreflect_plugin.cmi

157 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssreflect.cmi

144 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/generic_quotient.vo

126 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/tuple.vo

125 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/eqtype.vo

115 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/finfun.vo

113 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/eqtype.glob

105 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/choice.glob

103 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/generic_quotient.glob

88 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/seq.v

87 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrfun.vo

86 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrbool.v

83 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/finset.v

80 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/tuple.glob

76 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/fintype.v

72 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/bigop.v

63 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrfun.glob

57 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrnat.v

57 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/finfun.glob

56 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/prime.v

41 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssrfun.v

35 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssreflect.vo

34 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/div.v

33 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/path.v

31 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/eqtype.v

30 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/all_ssreflect.vo

27 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/choice.v

27 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/generic_quotient.v

26 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/fingraph.v

23 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/binomial.v

22 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssreflect.v

17 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/ssreflect.glob

15 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/tuple.v

12 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/finfun.v

1 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/all_ssreflect.glob

1 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/ssreflect/all_ssreflect.v

Uninstall 🧹

Command

opam remove -y coq-mathcomp-ssreflect.1.6.1

Return code

0

Missing removes

                none

Wrong removes

                none

          Sources are on GitHub © Guillaume Claret 🐣


text:
<!DOCTYPE html >

          <title>kernel - ML API - Apache Spark 0.7.2-SNAPSHOT API - net.sansa_stack.ml.spark.kernel</title>
          <meta name="description" content="kernel - ML API - Apache Spark 0.7.2 - SNAPSHOT API - net.sansa stack.ml.spark.kernel" />
          <meta name="keywords" content="kernel ML API Apache Spark 0.7.2 SNAPSHOT API net.sansa stack.ml.spark.kernel" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

net.sansa_stack.ml.spark

kernel

        package

        kernel

<input id="mbrsel-input" type="text" accesskey="/" />

            Visibility

Public

All

Type Members

        class

        RDFFastGraphKernel extends Serializable

        class

        RDFFastTreeGraphKernel extends Serializable

        class

        RDFFastTreeGraphKernel_v2 extends Serializable

Value Members

        object

        RDFFastGraphKernel extends Serializable

        object

        RDFFastTreeGraphKernel extends Serializable

        object

        RDFFastTreeGraphKernelApp

        object

        RDFFastTreeGraphKernelUtil

        object

        RDFFastTreeGraphKernel_v2 extends Serializable

        object

        Uri2Index

Ungrouped


text:
package uk.gov.phe.erdst.sc.awag.service.validation.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import uk.gov.phe.erdst.sc.awag.service.validation.impl.AssessmentScoreValidator;
import uk.gov.phe.erdst.sc.awag.service.validation.utils.ValidationConstants;

@Constraint(validatedBy = {AssessmentScoreValidator.class})
@Target({ElementType.TYPE})
@Retention(value = RetentionPolicy.RUNTIME)
public @interface ValidAssessmentScore
{
    String message() default ValidationConstants.VALID_ASSESSMENT_SCORE_ANNOT_DEFAULT_MSG;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}


text:
 [](#skip-navbar_top "Skip navigation links")

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

Overview
Package
 Class
Use
Tree
Deprecated
Index
Help

 PREV CLASS   NEXT CLASS
FRAMES    NO FRAMES
All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD

------------------------------------------------------------------------

org.apache.struts.faces.util
 Class MessagesMap
----------------------------

    java.lang.Object
      org.apache.struts.faces.util.MessagesMap

**All Implemented Interfaces:**
[Map](http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html.md?is-external=true "class or interface in java.util")

------------------------------------------------------------------------

    public class MessagesMap

extends [Object](http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html.md?is-external=true "class or interface in java.lang")

implements [Map](http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html.md?is-external=true "class or interface in java.util")

A limited immutable `Map` implementation that wraps the `MessageResources` instance for the specified `Locale`. Exposing the messages as a `Map` makes them easily accessible via value binding expressions, as well as JSP 2.0 expression language expressions.

------------------------------------------------------------------------

**Nested Class Summary**

| **Nested classes/interfaces inherited from interface java.util.[Map](http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html.md?is-external=true "class or interface in java.util")** |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Map.Entry<K,V>`                                                                                |

| **Constructor Summary**                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` MessagesMap(MessageResources messages, Locale locale)`
            Construct a new [`MessagesMap`](../../../../../org/apache/struts/faces/util/MessagesMap.html.md "class in org.apache.struts.faces.util") instance that wraps the specified `MessageResources` instance, and returns messages for the specified `Locale`.  |

**Method Summary**

` void`

` clear()`
           The `clear()` method is not supported.

` boolean`

` containsKey(Object key)`
           Return `true` if there is a message for the specified key.

` boolean`

` containsValue(Object value)`
           The `containsValue()` method is not supported.

` Set`

` entrySet()`
           The `entrySet()` method is not supported.

` boolean`

` equals(Object o)`
           The `equals` method checks whether equal `MessageResources` and `Locale` are being wrapped.

` Object`

` get(Object key)`
           Return the message string for the specified key.

` int`

` hashCode()`
           The `hashCode()` method returns values that will be identical if the `equals` method returns `true`.

` boolean`

` isEmpty()`
           The `isEmpty()` method returns `false`, on the assumption that there is always at least one message available.

` Set`

` keySet()`
           The `keySet()` method is not supported.

` Object`

` put(Object key, Object value)`
           The `put()` method is not supported.

` void`

` putAll(Map map)`
           The `putAll()` method is not supported.

` Object`

` remove(Object key)`
           The `remove()` method is not supported.

` int`

` size()`
           The `size()` method is not supported.

` Collection`

` values()`
           The `values()` method is not supported.

| **Methods inherited from class java.lang.[Object](http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html.md?is-external=true "class or interface in java.lang")** |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`                                                                                |

**Constructor Detail**

### MessagesMap

    public MessagesMap(MessageResources messages,
                       Locale locale)

Construct a new [`MessagesMap`](../../../../../org/apache/struts/faces/util/MessagesMap.html.md "class in org.apache.struts.faces.util") instance that wraps the specified `MessageResources` instance, and returns messages for the specified `Locale`.

**Parameters:**
`messages` - `MessageResources` instance to wrap

`locale` - `Locale` for which to retrieve messages, or `null` for the system default `Locale`

**Throws:**
`NullPointerException` - if `messages` is `null`

**Method Detail**

### clear

    public void clear()

The `clear()` method is not supported.

**Specified by:**
`clear` in interface `Map`

------------------------------------------------------------------------

### containsKey

    public boolean containsKey(Object key)

Return `true` if there is a message for the specified key.

**Specified by:**
`containsKey` in interface `Map`

**Parameters:**
`key` - Message key to evaluate

------------------------------------------------------------------------

### containsValue

    public boolean containsValue(Object value)

The `containsValue()` method is not supported.

**Specified by:**
`containsValue` in interface `Map`

**Parameters:**
`value` - Value to evaluate

------------------------------------------------------------------------

### entrySet

    public Set entrySet()

The `entrySet()` method is not supported.

**Specified by:**
`entrySet` in interface `Map`

------------------------------------------------------------------------

### equals

    public boolean equals(Object o)

The `equals` method checks whether equal `MessageResources` and `Locale` are being wrapped.

**Specified by:**
`equals` in interface `Map`

**Overrides:**
`equals` in class `Object`

**Parameters:**
`o` - The object to be compared

------------------------------------------------------------------------

### get

    public Object get(Object key)

Return the message string for the specified key.

**Specified by:**
`get` in interface `Map`

**Parameters:**
`key` - Key for message to return

------------------------------------------------------------------------

### hashCode

    public int hashCode()

The `hashCode()` method returns values that will be identical if the `equals` method returns `true`.

**Specified by:**
`hashCode` in interface `Map`

**Overrides:**
`hashCode` in class `Object`

------------------------------------------------------------------------

### isEmpty

    public boolean isEmpty()

The `isEmpty()` method returns `false`, on the assumption that there is always at least one message available.

**Specified by:**
`isEmpty` in interface `Map`

------------------------------------------------------------------------

### keySet

    public Set keySet()

The `keySet()` method is not supported.

**Specified by:**
`keySet` in interface `Map`

------------------------------------------------------------------------

### put

    public Object put(Object key,
                      Object value)

The `put()` method is not supported.

**Specified by:**
`put` in interface `Map`

**Parameters:**
`key` - Key to store

`value` - Value to store

------------------------------------------------------------------------

### putAll

    public void putAll(Map map)

The `putAll()` method is not supported.

**Specified by:**
`putAll` in interface `Map`

**Parameters:**
`map` - Keys and values to store

------------------------------------------------------------------------

### remove

    public Object remove(Object key)

The `remove()` method is not supported.

**Specified by:**
`remove` in interface `Map`

**Parameters:**
`key` - Key to remove

------------------------------------------------------------------------

### size

    public int size()

The `size()` method is not supported.

**Specified by:**
`size` in interface `Map`

------------------------------------------------------------------------

### values

    public Collection values()

The `values()` method is not supported.

**Specified by:**
`values` in interface `Map`

------------------------------------------------------------------------

 [](#skip-navbar_bottom "Skip navigation links")

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

Overview
Package
 Class
Use
Tree
Deprecated
Index
Help

 PREV CLASS   NEXT CLASS
FRAMES    NO FRAMES
All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD

------------------------------------------------------------------------

Copyright © 2000-2008 [Apache Software Foundation](http://www.apache.org/). All Rights Reserved.


text:
package owltools.solrj;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;

import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.common.SolrInputDocument;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLObject;
import owltools.graph.OWLGraphWrapper;

/**
 * A highly hard-wired class to specifically load the ontology graph into a set of hard-wired fields for the
 * AmiGO 2/GOlr general-config.yaml schema.
 */
public class OntologyGeneralSolrDocumentLoader extends AbstractSolrLoader {

	private static Logger LOG = Logger.getLogger(OntologyGeneralSolrDocumentLoader.class);
	int doc_limit_trigger = 1000; // the number of documents to add before pushing out to solr
	int current_doc_number;

	public OntologyGeneralSolrDocumentLoader(String url, OWLGraphWrapper graph) throws MalformedURLException {
		super(url);
		setGraph(graph);
		current_doc_number = 0;
	}

	@Override
	public void load() throws SolrServerException, IOException {

		LOG.info("Loading general ontology documents...");

		if( graph == null ){
			LOG.info("ERROR? OWLGraphWrapper graph is not apparently defined...");
		}else{
			for (OWLObject obj : graph.getAllOWLObjects()) {

				SolrInputDocument doc = collect(obj, graph);
				if( doc != null ){
					add(doc);

					// Incremental commits.
					current_doc_number++;
					if( current_doc_number % doc_limit_trigger == 0 ){
						LOG.info("Processed " + doc_limit_trigger + " general ontology docs at " + current_doc_number + " and committing...");
						incrementalAddAndCommit();
					}
				}
			}

			// Get the remainder of the docs in.
			LOG.info("Doing clean-up (final) commit at " + current_doc_number + " general ontology documents...");
			addAllAndCommit();
			LOG.info("Done.");
		}
	}

	// Main wrapping for adding ontology documents to GOlr.
	public SolrInputDocument collect(OWLObject obj, OWLGraphWrapper graph) {

		//
		if (obj instanceof OWLClass)
			 return collectClass(graph, (OWLClass)obj);
		else
			return null;
	}

	// Things special for ontology_class.
	private SolrInputDocument collectClass(OWLGraphWrapper graph, OWLClass c) {

		String def = graph.getDef(c);
		String com = graph.getComment(c);
		String syns = StringUtils.join(graph.getOBOSynonymStrings(c, null), " ");
		String subs = StringUtils.join(graph.getSubsets(c), " ");

		ArrayList<String> alt_pps = new ArrayList<String>();
		alt_pps.add("alt_id");
		String alts = StringUtils.join(graph.getAnnotationPropertyValues(c, alt_pps), " ");

		ArrayList<String> rep_pps = new ArrayList<String>();
		rep_pps.add("replaced_by");
		String reps = StringUtils.join(graph.getAnnotationPropertyValues(c, rep_pps), " ");

		ArrayList<String> con_pps = new ArrayList<String>();
		con_pps.add("consider");
		String cons = StringUtils.join(graph.getAnnotationPropertyValues(c, con_pps), " ");

		// Okay, pull out all of the variations on the ID for what people might expect in the ontology.
		String gid = graph.getIdentifier(c);
		String gid_no_namespace = StringUtils.substringAfter(gid, ":");
		String gid_no_namespace_or_leading_zeros = StringUtils.stripStart(gid_no_namespace, "0");

		// All together now.
		ArrayList<String> all = new ArrayList<String>();
		all.add(gid_no_namespace);
		all.add(gid_no_namespace_or_leading_zeros);
		all.add(def);
		all.add(com);
		all.add(syns);
		all.add(subs);
		all.add(alts);
		all.add(reps);
		all.add(cons);

		// Watch out for "id" collision!
		SolrInputDocument general_doc = new SolrInputDocument();
		general_doc.addField("id", "general_ontology_class_" + gid);
		general_doc.addField("entity", graph.getIdentifier(c));
		general_doc.addField("entity_label", graph.getLabel(c));
		general_doc.addField("document_category", "general");
		general_doc.addField("category", "ontology_class");
		general_doc.addField("general_blob", StringUtils.join(all, " "));

		return general_doc;
	}
}


text:
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid

class HUnitCity2TownHall_ConnectedLHS(HimesisPreConditionPatternLHS):
	def __init__(self):
		"""
		Creates the himesis graph representing the AToM3 model HUnitCity2TownHall_ConnectedLHS
		"""
		# Flag this instance as compiled now
		self.is_compiled = True

		super(HUnitCity2TownHall_ConnectedLHS, self).__init__(name='HUnitCity2TownHall_ConnectedLHS', num_nodes=0, edges=[])

		# Add the edges
		self.add_edges([])

		# Set the graph attributes
		self["mm__"] = ['MT_pre__FamiliesToPersonsMM', 'MoTifRule']
		self["MT_constraint__"] = """return True"""
		self["name"] = """"""
		self["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'HUnitCity2TownHall_ConnectedLHS')
		self["equations"] = []
		# Set the node attributes

		# match class City(City) node
		self.add_node()
		self.vs[0]["MT_pre__attr1"] = """return True"""
		self.vs[0]["MT_label__"] = """1"""
		self.vs[0]["mm__"] = """MT_pre__City"""
		self.vs[0]["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'City')

		# Add the edges
		self.add_edges([
		])

	# define evaluation methods for each match class.

	def eval_attr11(self, attr_value, this):
		return True

	# define evaluation methods for each match association.

	def constraint(self, PreNode, graph):
		return True


text:
STEP Project Summer 2020
Cade Crandall, Charlie Floeder, Vincent Stevenson, Ian Johnson, Jake Carlson


text:
/*** CSS for main plugin wrapper ***/

DIV#CTSA_NewRequest-mainDiv {
	padding: 0px;
}

/*** CSS for tab background ***/

DIV#CTSA_NewRequest-TABS DIV.yui-content {
	background: #FFF;
}
DIV#CTSA_NewRequest-TABS DIV.CTSA_NewRequest-MainContent {
    background:#FFF;
    border:solid #63758C;
    border-width:1px 0;
    overflow:auto;
    height:100%;
}
DIV#CTSA_NewRequest-TABS DIV.CTSA_NewRequest-MainContentPad {
    padding:10px 10px;
}

/*** CSS for the Specify Data tab ***/

DIV#CTSA_NewRequest-mainDiv DIV.qmidlbl {
	padding: 6px 0px;
	float: left;
	font-weight:bold;
	color:#666;
	margin: 15px 10px 0px 0px;
}
DIV#CTSA_NewRequest-mainDiv DIV.qmtrgt {
	padding: 5px 10px;
	background: #DEEBEF;
	margin-top: 15px;
	text-align:left;
	border: 1px solid #63758C;
	width:300px;
	overflow:hidden;
}

DIV#CTSA_NewRequest-mainDiv DIV.qxmllbl {
	padding: 6px 0px;
	float: left;
	font-weight:bold;
	color:#666;
	margin: 15px 10px 0px 0px;
}
DIV#CTSA_NewRequest-mainDiv DIV.qxmltrgt {
	padding: 5px 10px;
	background: #DEEBEF;
	margin-top: 15px;
	text-align:left;
	border: 1px solid #63758C;
	width:300px;
	overflow:hidden;
}

DIV#CTSA_NewRequest-mainDiv DIV.droptrgtlbl {
	padding: 6px 0px;
	float: left;
	font-weight:bold;
	color:#666;
	margin: 15px 10px 0px 0px;
}
DIV#CTSA_NewRequest-mainDiv DIV.droptrgt {
	padding: 5px 10px;
	background: #DEEBEF;
	margin-top: 15px;
	text-align:left;
	border: 1px solid #63758C;
	width:300px;
	overflow:hidden;
}

/*** CSS for the View Results tab ***/

DIV#CTSA_NewRequest-TABS DIV.results-directions {
	padding: 10px;
	text-align:left;
}
DIV#CTSA_NewRequest-TABS DIV.results-text {
	margin:10px;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX TABLE {
	margin:0 10px 10px 10px;
	border-collapse:collapse;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX TABLE TH {
	width:150px;
	border:solid 1px #63758C;
	background-color:#CEDBEF;
	padding:5px;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX TABLE TD {
	width:300px;
	overflow:auto;
	border:solid 1px #63758C;
	background-color:#DEEBEF;
	padding:5px;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX .sdxOriginalXML {
	padding:0px;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX .originalXML {
	height:150px;
	overflow:hidden;
	padding:0px;
	margin:0px;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX .sdxResultsXML {
	padding:0px;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX .resultsXML {
	height:150px;
	overflow:scroll;
	padding:0px;
	margin:0px;
}
DIV#CTSA_NewRequest-mainDiv DIV#CTSA_NewRequest-InfoSDX TABLE TD DIV PRE {
	margin:0px;
	width:300px;
	height:140px;
	display:block;
	overflow:scroll;
	padding:5px;
}

/*** CSS for the Plugin Help tab ***/

DIV#CTSA_NewRequest-TABS H1 {
	margin:0 0 10px 0;
	font-size:16px;
	color:#42558C;
	font-weight:bold;
}
DIV#CTSA_NewRequest-TABS H2 {
	margin:10px 0 10px 0;
	font-size:13px;
	color:#42558C;
	font-weight:bold;
}
DIV#CTSA_NewRequest-TABS HR {
	margin:0;
}