text:
// MS compatible compilers support #pragma once

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif

//
//  detail/sp_counted_base_w32.hpp
//
//  Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
//  Copyright 2004-2005 Peter Dimov
//
//  Distributed under the Boost Software License, Version 1.0. (See
//  accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
//
//  Lock-free algorithm by Alexander Terekhov
//
//  Thanks to Ben Hitchings for the #weak + (#shared != 0)
//  formulation
//

#include <boost/detail/interlocked.hpp>
#include <boost/detail/workaround.hpp>
#include <typeinfo>

namespace boost
{

namespace detail
{

class sp_counted_base
{
private:

    sp_counted_base( sp_counted_base const & );
    sp_counted_base & operator= ( sp_counted_base const & );

    long use_count_;        // #shared
    long weak_count_;       // #weak + (#shared != 0)

public:

    sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
    {
    }

    virtual ~sp_counted_base() // nothrow
    {
    }

    // dispose() is called when use_count_ drops to zero, to release
    // the resources managed by *this.

    virtual void dispose() = 0; // nothrow

    // destroy() is called when weak_count_ drops to zero.

    virtual void destroy() // nothrow
    {
        delete this;
    }

    virtual void * get_deleter( std::type_info const & ti ) = 0;

    void add_ref_copy()
    {
        BOOST_INTERLOCKED_INCREMENT( &use_count_ );
    }

    bool add_ref_lock() // true on success
    {
        for( ;; )
        {
            long tmp = static_cast< long const volatile& >( use_count_ );
            if( tmp == 0 ) return false;

#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1200 )

            // work around a code generation bug

            long tmp2 = tmp + 1;
            if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp2, tmp ) == tmp2 - 1 ) return true;

#else

            if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true;

#endif
        }
    }

    void release() // nothrow
    {
        if( BOOST_INTERLOCKED_DECREMENT( &use_count_ ) == 0 )
        {
            dispose();
            weak_release();
        }
    }

    void weak_add_ref() // nothrow
    {
        BOOST_INTERLOCKED_INCREMENT( &weak_count_ );
    }

    void weak_release() // nothrow
    {
        if( BOOST_INTERLOCKED_DECREMENT( &weak_count_ ) == 0 )
        {
            destroy();
        }
    }

    long use_count() const // nothrow
    {
        return static_cast<long const volatile &>( use_count_ );
    }
};

} // namespace detail

} // namespace boost

#endif  // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED


text:
<?php

namespace Yaoi\Database\Tests\PHPUnit\Definition;

use Yaoi\Database\Definition\Column;
use Yaoi\Test\PHPUnit\TestCase;

class ColumnTest extends TestCase
{
    public function testNullCast()
    {
        $this->assertSame(null, Column::castField(null, Column::INTEGER));
        $this->assertSame(0, Column::castField(null, Column::INTEGER | Column::NOT_NULL));
        $this->assertSame('', Column::castField(null, Column::STRING | Column::NOT_NULL));
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php //include('header.php'); ?>

Log in to your eCommerce store

Log in  your Account!

   <?php echo validation_errors(); ?>
  <?php echo $this->session->flashdata('login_error');?>

   <form method="post" action="<?php echo base_url();?>login/auth" class="registerPage">
    <input type="email" name="email" placeholder="Email" />
	<input type="text" name="password" placeholder="Password" />
	Forget Password?
	<a href="<?php echo base_url();?>register">New User?
	 <input type="submit" name="submit" value="Log In" />
   </form>

<input type="checkbox" />Remember me

Have multiple stores?

<?php //include('footer.php'); ?>


text:
layout: post
status: publish
published: true
title: The Blinded By The Light Project
author:
  display_name: Trott
  login: admin
  email: rtrott@gmail.com
  url: http://musicroutes.com/
author_login: admin
author_email: rtrott@gmail.com
author_url: http://musicroutes.com/
wordpress_id: 264
wordpress_url: http://blog.musicroutes.com/?p=264
date: '2009-03-15 12:38:14 -0700'
date_gmt: '2009-03-15 19:38:14 -0700'
tags:
- bruce springsteen
- cure
- dexy's midnight runners
- manfred mann
- steve miller
- chris slade
- david sancious
- usa for africa
comments:
- id: 109
  author: 'Music Routes » Blog Archive » Blinded By The Light Project:
    1 of 3 Goals Achieved!'
  author_email: ''
  author_url: http://blog.musicroutes.com/?p=347
  date: '2009-04-11 00:18:09 -0700'
  date_gmt: '2009-04-11 07:18:09 -0700'
  content: '[...] On March 15, the three goals for The Blinded By The Light Project
    were explained and announced. [...]'
- id: 115
  author: 'Music Routes » Blog Archive » Blinded By The Light Project:
    2 of 3 Goals Achieved!'
  author_email: ''
  author_url: http://blog.musicroutes.com/?p=352
  date: '2009-04-18 00:14:28 -0700'
  date_gmt: '2009-04-18 07:14:28 -0700'
  content: '[...] may recall the three goals of the Blinded By The Light Project.
    OK, actually, you probably got here through a Google search and have no idea what
    I'm [...]'
---

Not too long ago, I used a rant about people who have the wrong metadata associated with their mp3s as a jumping-off point.  (Note to world: The Cure did not perform "Come On, Eileen", kthxbai.)  I looked at routes between Bruce Springsteen (who wrote and first recorded "Blinded By The Light"), Manfred Mann (who had the biggest hit with the song), and Steve Miller (to whom that hit version is often erroneously attributed).

Since then, various combinations involving the phrase blinded by the light and the term miller have been the most common Google queries by which people find this blog.  In a cheap attempt to further drive people who are looking for the bass tablature to the song onto this site the hope of supplying further edification for the curious, I wish to introduce The Blinded By The Light Project.

The completely pointless goals of this project are:

To get "Blinded By The Light" by Bruce Springsteen two steps away from "Blinded By The Light" by Manfred Mann

To get Steve Miller two steps away from both versions

Let's see how we're doing.

The two "Blinded By The Light" tracks are four steps apart.  It would seem to me that the most promising prospects for getting the route shortened are to look for possibilities with Chris Slade (who is on the Manfred Mann version) and David Sancious (who is on the Bruce Springsteen version).

Steve Miller to Bruce Springsteen's version is three steps.  I suspect that it may be possible to get it down to two steps by using the fact that Springsteen sang on "We Are The World".

Steve Miller to Manfred Mann's version is five steps.  This will probably be the most challenging route to shorten.  I'm guessing Chris Slade may be the key here too.


text:
require 'spec_helper'
require 'active_record'
require 'support/active_record/mysql_setup'
require 'database_cleaner/active_record/truncation'
require 'database_cleaner/active_record/truncation/shared_fast_truncation'

module ActiveRecord
  module ConnectionAdapters
    describe do
      before(:all) { active_record_mysql_setup }

      let(:adapter) { MysqlAdapter }
      let(:connection) { active_record_mysql_connection }

      describe "#truncate_table" do
        it "should truncate the table" do
          2.times { User.create }

          connection.truncate_table('users')
          User.count.should == 0
        end

        it "should reset AUTO_INCREMENT index of table" do
          2.times { User.create }
          User.delete_all

          connection.truncate_table('users')

          User.create.id.should == 1
        end
      end

      it_behaves_like "an adapter with pre-count truncation" do
        let(:adapter) { MysqlAdapter }
        let(:connection) { active_record_mysql_connection }
      end
    end
  end
end


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/bigtable/v1/bigtable_data.proto

package com.google.bigtable.v1;

public interface ValueRangeOrBuilder extends
    // @@protoc_insertion_point(interface_extends:google.bigtable.v1.ValueRange)
    com.google.protobuf.MessageOrBuilder {

  /**
   * optional bytes start_value_inclusive = 1;
   *
   *

   * Used when giving an inclusive lower bound for the range.
   *

   */
  com.google.protobuf.ByteString getStartValueInclusive();

  /**
   * optional bytes start_value_exclusive = 2;
   *
   *

   * Used when giving an exclusive lower bound for the range.
   *

   */
  com.google.protobuf.ByteString getStartValueExclusive();

  /**
   * optional bytes end_value_inclusive = 3;
   *
   *

   * Used when giving an inclusive upper bound for the range.
   *

   */
  com.google.protobuf.ByteString getEndValueInclusive();

  /**
   * optional bytes end_value_exclusive = 4;
   *
   *

   * Used when giving an exclusive upper bound for the range.
   *

   */
  com.google.protobuf.ByteString getEndValueExclusive();
}


text:
/**
 * @file
 */
package com.codemelon.chesswithhumans;

/**
 * @author Marshall Farrier
 * @version 0.1 3/10/11
 * Utility class for working with challenges
 * Challenge objects are immutable
 */
public class Challenge {
	private int challengeId;
	private int sourceId;
	private String sourceHandle;
	private int targetId;
	private int status;

	public Challenge(int challId, int srcId, String srcHandle, int targId, int stat) {
		challengeId = challId;
		sourceId = srcId;
		sourceHandle = srcHandle;
		targetId = targId;
		status = stat;
	}

	public int challengeId() { return challengeId; }
	public int sourceId() { return sourceId; }
	public String sourceHandle() { return sourceHandle; }
	public int targetId() { return targetId; }
	public int status() { return status; }
}


text:
var typing_data = (function () {
var exports = {};

var typist_dct = new Dict();
var inbound_timer_dict = new Dict();

function to_int(s) {
    return parseInt(s, 10);
}

function sorted(user_ids) {
    // This mapping makes sure we are using ints, and
    // it also makes sure we don't mutate the list.
    var id_list = _.map(user_ids, to_int);
    id_list.sort(function (a, b) {
        return a - b;
    });
    id_list = _.uniq(id_list, true);

    return id_list;
}

function get_key(group) {
    var ids = sorted(group);
    return ids.join(',');
}

exports.add_typist = function (group, typist) {
    var key = get_key(group);
    var current = typist_dct.get(key) || [];
    typist = to_int(typist);
    if (!_.contains(current, typist)) {
        current.push(typist);
    }
    typist_dct.set(key, sorted(current));
};

exports.remove_typist = function (group, typist) {
    var key = get_key(group);
    var current = typist_dct.get(key) || [];

    typist = to_int(typist);
    if (!_.contains(current, typist)) {
        return false;
    }

    current = _.reject(current, function (user_id) {
        return to_int(user_id) === to_int(typist);
    });

    typist_dct.set(key, current);
    return true;
};

exports.get_group_typists = function (group) {
    var key = get_key(group);
    return typist_dct.get(key) || [];
};

exports.get_all_typists = function () {
    var typists = _.flatten(typist_dct.values(), true);
    typists = sorted(typists);
    typists = _.uniq(typists, true);
    return typists;
};

// The next functions aren't pure data, but it is easy
// enough to mock the setTimeout/clearTimeout functions.
exports.clear_inbound_timer = function (group) {
    var key = get_key(group);
    var timer = inbound_timer_dict.get(key);
    if (timer) {
        clearTimeout(timer);
        inbound_timer_dict.set(key, undefined);
    }
};

exports.kickstart_inbound_timer = function (group, delay, callback) {
    var key = get_key(group);
    exports.clear_inbound_timer(group);
    var timer = setTimeout(callback, delay);
    inbound_timer_dict.set(key, timer);
};

return exports;
}());

if (typeof module !== 'undefined') {
    module.exports = typing_data;
}


text:
#include <stdio.h>

// PREFACE:
//
// I'm perfectly aware that the code below does not make any sense and
// is way to complicate for such a simple task. But it should explain how to use
// function pointers.
//
// Here, a simple function which achieves the same thing:
/*
void DriveTesla(char* model, double speed) {
    printf("Driving a Model %s with %f km/h\n", model, speed);
}
*/

/* the function pointer */
typedef void (*fp)(double);

/**
The various implementations
*/

void DriveTeslaModelS(double speed) {
    printf("Driving a Model S with %f km/h\n", speed);
}

void DriveTeslaModelE(double speed) {
    printf("The Model E has just been announced. It isn't ready yet :(\n");
}

void DriveTeslaModelX(double speed) {
    printf("Driving a Model X with %f km/h\n", speed);
}

void UnknownModel(double speed) {
    printf("Sorry! The requested model has not yet been developed.\n");
}

/**
 * Decide which implementation should be used.
 * Return the function as a function pointer ('fp')
 */
fp DriveTesla(char model) {
    if (model == 'S') {
        return (*DriveTeslaModelS);
    }
    if (model == 'E') {
        return (*DriveTeslaModelE);
    }
    if (model == 'X') {
        return (*DriveTeslaModelX);
    }
    return (*UnknownModel);
}

int main(void) {
    // DriveTesla returns a function pointer. So, simply invoke it :)
    DriveTesla('S')(200.0);
    DriveTesla('E')(-1.0);
    DriveTesla('X')(180.0);
    DriveTesla('Y')(-1.0);
    // That's it. Easy, huh?
}


text:
package radlab.rain.workload.riak;

import com.basho.riak.client.IRiakObject;

import radlab.rain.Generator;
import radlab.rain.IScoreboard;
import radlab.rain.LoadProfile;
import radlab.rain.Operation;

public abstract class RiakOperation extends Operation
{
	protected String _bucket = "";
	protected String _key = "";
	protected byte[] _value = null;
	protected RiakTransport _riak = null;

	public RiakOperation( boolean interactive, IScoreboard scoreboard )
	{
		super( interactive, scoreboard );
	}

	@Override
	public void cleanup()
	{
		this._bucket = "";
		this._key = "";
		this._value = null;
		this._bucket = "";
	}

	@Override
	public void prepare(Generator generator)
	{
		this._generator = generator;
		RiakGenerator riakGenerator = (RiakGenerator) generator;

		this._riak = riakGenerator.getRiakTransport();

		LoadProfile currentLoadProfile = generator.getLatestLoadProfile();
		if( currentLoadProfile != null )
			this.setGeneratedDuringProfile( currentLoadProfile );

		// Bucket to use
		this._bucket = riakGenerator._bucket;
	}

	public IRiakObject doFetch( String bucket, String key ) throws Exception
	{
		IRiakObject response = this._riak.fetch( bucket, key );
		// Check whether the fetch failed because the object doesn't exist
		if( response != null )
			return response;
		else throw new Exception( "Fetch failed." );
	}

	public IRiakObject doStore( String bucket, String key, byte[] value ) throws Exception
	{
		IRiakObject response = this._riak.store( bucket, key, value );
		//if( response != null )
		//	return response;
		//else throw new Exception( "Store bytes failed." );
		return response;
	}

	public void doDelete( String bucket, String key ) throws Exception
	{
		this._riak.delete( bucket, key );
	}

	public Iterable<String> doListBucket( String bucket ) throws Exception
	{
		Iterable<String> response = this._riak.listBucket( bucket );
		if( response != null )
			return response;
		else throw new Exception( "List bucket failed." );
	}
}


text:
import { HttpIpEndPoint, BusinessService } from '../services/index';

describe('A BusinessService', function() {
  let sut;

  beforeEach(() => {
    sut = new BusinessService(new HttpIpEndPoint('localhost:3400'))
  });

  it('should return all elements stored in the underlying data source.', function() {
    const dataFromService = sut.getData({ async: false });
    expect(dataFromService).not.toBeNull();
  });
});


text:
package org.hisp.dhis.dxf2.events.aggregates;

import static java.util.concurrent.CompletableFuture.allOf;
import static java.util.concurrent.CompletableFuture.supplyAsync;
import static org.hisp.dhis.dxf2.events.aggregates.ThreadPoolManager.getPool;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

import lombok.NonNull;
import lombok.RequiredArgsConstructor;

import org.hisp.dhis.dxf2.events.event.DataValue;
import org.hisp.dhis.dxf2.events.event.Event;
import org.hisp.dhis.dxf2.events.event.Note;
import org.hisp.dhis.dxf2.events.trackedentity.Relationship;
import org.hisp.dhis.dxf2.events.trackedentity.store.EventStore;
import org.springframework.stereotype.Component;

import com.google.common.collect.Multimap;

/**
 * @author Luciano Fiandesio
 */
@Component
@RequiredArgsConstructor
public class EventAggregate
    extends
    AbstractAggregate
{
    @NonNull
    private final EventStore eventStore;

    /**
     * Key: enrollment uid -> Value: Event
     *
     * @param ids a List of {@see Enrollment} Primary Keys
     * @param ctx the {@see AggregateContext}
     * @return a Map where the key is a Program Instance Primary Key, and the
     *         value is a List of {@see Event}
     */
    Multimap<String, Event> findByEnrollmentIds( List<Long> ids, AggregateContext ctx )
    {
        // Fetch all the Events that are linked to the given Enrollment IDs

        Multimap<String, Event> events = this.eventStore.getEventsByEnrollmentIds( ids, ctx );

        if ( events.isEmpty() )
        {
            return events;
        }

        List<Long> eventIds = events.values().stream().map( Event::getId ).collect( Collectors.toList() );

        /*
         * Async fetch Relationships for the given Event ids (only if
         * isIncludeRelationships = true)
         */
        final CompletableFuture<Multimap<String, Relationship>> relationshipAsync = conditionalAsyncFetch(
            ctx.getParams().isIncludeRelationships(), () -> eventStore.getRelationships( eventIds, ctx ), getPool() );

        /*
         * Async fetch Notes for the given Event ids
         */
        final CompletableFuture<Multimap<String, Note>> notesAsync = asyncFetch(
            () -> eventStore.getNotes( eventIds ), getPool() );

        /*
         * Async fetch DataValues for the given Event ids
         */
        final CompletableFuture<Map<String, List<DataValue>>> dataValuesAsync = supplyAsync(
            () -> eventStore.getDataValues( eventIds ), getPool() );

        return allOf( dataValuesAsync, notesAsync, relationshipAsync ).thenApplyAsync( fn -> {

            Map<String, List<DataValue>> dataValues = dataValuesAsync.join();
            Multimap<String, Note> notes = notesAsync.join();
            Multimap<String, Relationship> relationships = relationshipAsync.join();

            for ( Event event : events.values() )
            {
                if ( ctx.getParams().isIncludeRelationships() )
                {
                    event.setRelationships( new HashSet<>( relationships.get( event.getEvent() ) ) );
                }

                List<DataValue> dataValuesForEvent = dataValues.get( event.getEvent() );
                if ( dataValuesForEvent != null && !dataValuesForEvent.isEmpty() )
                {
                    event.setDataValues( new HashSet<>( dataValues.get( event.getEvent() ) ) );
                }
                event.setNotes( new ArrayList<>( notes.get( event.getEvent() ) ) );
            }

            return events;

        }, getPool() ).join();
    }
}


text:
using namespace swift;

Witness::Witness(ValueDecl *decl, SubstitutionList substitutions,
                 GenericEnvironment *syntheticEnv,
                 SubstitutionList reqToSynthesizedEnvSubs) {
  auto &ctx = decl->getASTContext();

  auto declRef = ConcreteDeclRef(ctx, decl, substitutions);
  auto storedMem = ctx.Allocate(sizeof(StoredWitness), alignof(StoredWitness));
  auto stored = new (storedMem)
      StoredWitness{declRef, syntheticEnv,
                    ctx.AllocateCopy(reqToSynthesizedEnvSubs)};
  ctx.addDestructorCleanup(*stored);

  storage = stored;
}

void Witness::dump() const { dump(llvm::errs()); }

void Witness::dump(llvm::raw_ostream &out) const {
  // FIXME: Implement!
}

ProtocolConformanceRef::ProtocolConformanceRef(ProtocolDecl *protocol,
                                               ProtocolConformance *conf) {
  assert(protocol != nullptr &&
         "cannot construct ProtocolConformanceRef with null protocol");
  if (conf) {
    assert(protocol == conf->getProtocol() && "protocol conformance mismatch");
    Union = conf;
  } else {
    Union = protocol;
  }
}

ProtocolDecl *ProtocolConformanceRef::getRequirement() const {
  if (isConcrete()) {
    return getConcrete()->getProtocol();
  } else {
    return getAbstract();
  }
}

ProtocolConformanceRef
ProtocolConformanceRef::getInherited(ProtocolDecl *parent) const {
  assert((getRequirement() == parent ||
          getRequirement()->inheritsFrom(parent)) &&
         "not a parent of this protocol");

  if (parent == getRequirement())
    return *this;

  // For an abstract requirement, simply produce a new abstract requirement
  // for the parent.
  if (isAbstract()) {
    return ProtocolConformanceRef(parent);
  }

  // Navigate concrete conformances.
  if (isConcrete()) {
    return ProtocolConformanceRef(
      getConcrete()->getInheritedConformance(parent));
  }

  llvm_unreachable("unhandled ProtocolConformanceRef");
}

ProtocolConformanceRef
ProtocolConformanceRef::subst(Type origType,
                              TypeSubstitutionFn subs,
                              LookupConformanceFn conformances) const {
  auto substType = origType.subst(subs, conformances,
                                  SubstFlags::UseErrorType);

  if (substType->isOpenedExistential())
    return *this;

  // If we have a concrete conformance, we need to substitute the
  // conformance to apply to the new type.
  if (isConcrete())
    return ProtocolConformanceRef(
      getConcrete()->subst(substType, subs, conformances));

  auto *proto = getRequirement();

  // If the original type was an archetype, check the conformance map.
  if (origType->is<SubstitutableType>()
      || origType->is<DependentMemberType>()) {
    if (auto result = conformances(origType->getCanonicalType(),
                                   substType,
                                   proto->getDeclaredType())) {
      return *result;
    }
  }

  // If that didn't find anything, we can still synthesize AnyObject
  // conformances from thin air.  FIXME: gross.
  if (proto->isSpecificProtocol(KnownProtocolKind::AnyObject)) {
    if (substType->isExistentialType())
      return *this;

    ClassDecl *classDecl = nullptr;
    auto archetype = substType->getAs<ArchetypeType>();

    if (archetype) {
      if (archetype->getSuperclass())
        classDecl = archetype->getSuperclass()->getClassOrBoundGenericClass();

      // A class-constrained archetype without a superclass constraint
      // conforms to AnyObject abstractly.
      if (!classDecl && archetype->requiresClass())
        return ProtocolConformanceRef(proto);
    } else {
      classDecl = substType->getClassOrBoundGenericClass();
    }

    assert(classDecl);

    // Create a concrete conformance based on the conforming class.
    SmallVector<ProtocolConformance *, 1> lookupResults;
    classDecl->lookupConformance(classDecl->getParentModule(), proto,
                                 lookupResults);
    return ProtocolConformanceRef(lookupResults.front());
  }

  // FIXME: Rip this out once ConformanceAccessPaths are plumbed through
  auto *M = proto->getParentModule();
  return *M->lookupConformance(substType, proto, nullptr);
}

Type
ProtocolConformanceRef::getTypeWitnessByName(Type type,
                                             ProtocolConformanceRef conformance,
                                             Identifier name,
                                             LazyResolver *resolver) {
  // For an archetype, retrieve the nested type with the appropriate
  // name. There are no conformance tables.
  if (auto archetype = type->getAs<ArchetypeType>()) {
    return archetype->getNestedType(name);
  }

  // Find the named requirement.
  AssociatedTypeDecl *assocType = nullptr;
  auto members = conformance.getRequirement()->lookupDirect(name);
  for (auto member : members) {
    assocType = dyn_cast<AssociatedTypeDecl>(member);
    if (assocType)
      break;
  }

  // FIXME: Shouldn't this be a hard error?
  if (!assocType)
    return nullptr;

  if (conformance.isAbstract())
    return DependentMemberType::get(type, assocType);

  auto concrete = conformance.getConcrete();
  if (!concrete->hasTypeWitness(assocType, resolver)) {
    return nullptr;
  }
  return concrete->getTypeWitness(assocType, resolver);
}

void *ProtocolConformance::operator new(size_t bytes, ASTContext &context,
                                        AllocationArena arena,
                                        unsigned alignment) {
  return context.Allocate(bytes, alignment, arena);

}

#define CONFORMANCE_SUBCLASS_DISPATCH(Method, Args)                          \
switch (getKind()) {                                                         \
  case ProtocolConformanceKind::Normal:                                      \
    static_assert(&ProtocolConformance::Method !=                            \
                    &NormalProtocolConformance::Method,                      \
                  "Must override NormalProtocolConformance::" #Method);      \
    return cast<NormalProtocolConformance>(this)->Method Args;               \
  case ProtocolConformanceKind::Specialized:                                 \
    static_assert(&ProtocolConformance::Method !=                            \
                    &SpecializedProtocolConformance::Method,                 \
                  "Must override SpecializedProtocolConformance::" #Method); \
    return cast<SpecializedProtocolConformance>(this)->Method Args;          \
  case ProtocolConformanceKind::Inherited:                                   \
    static_assert(&ProtocolConformance::Method !=                            \
                    &InheritedProtocolConformance::Method,                   \
                  "Must override InheritedProtocolConformance::" #Method);   \
    return cast<InheritedProtocolConformance>(this)->Method Args;            \
}                                                                            \
llvm_unreachable("bad ProtocolConformanceKind");

/// Get the protocol being conformed to.
ProtocolDecl *ProtocolConformance::getProtocol() const {
  CONFORMANCE_SUBCLASS_DISPATCH(getProtocol, ())
}

DeclContext *ProtocolConformance::getDeclContext() const {
  CONFORMANCE_SUBCLASS_DISPATCH(getDeclContext, ())
}

/// Retrieve the state of this conformance.
ProtocolConformanceState ProtocolConformance::getState() const {
  CONFORMANCE_SUBCLASS_DISPATCH(getState, ())
}

bool
ProtocolConformance::hasTypeWitness(AssociatedTypeDecl *assocType,
                                    LazyResolver *resolver) const {
  CONFORMANCE_SUBCLASS_DISPATCH(hasTypeWitness, (assocType, resolver));
}

std::pair<Type, TypeDecl *>
ProtocolConformance::getTypeWitnessAndDecl(AssociatedTypeDecl *assocType,
                                                LazyResolver *resolver) const {
  CONFORMANCE_SUBCLASS_DISPATCH(getTypeWitnessAndDecl, (assocType, resolver))
}

Type ProtocolConformance::getTypeWitness(AssociatedTypeDecl *assocType,
                                         LazyResolver *resolver) const {
  return getTypeWitnessAndDecl(assocType, resolver).first;
}

Witness ProtocolConformance::getWitness(ValueDecl *requirement,
                                        LazyResolver *resolver) const {
  CONFORMANCE_SUBCLASS_DISPATCH(getWitness, (requirement, resolver))
}

/// Determine whether the witness for the given requirement
/// is either the default definition or was otherwise deduced.
bool ProtocolConformance::
usesDefaultDefinition(AssociatedTypeDecl *requirement) const {
  CONFORMANCE_SUBCLASS_DISPATCH(usesDefaultDefinition, (requirement))
}

bool ProtocolConformance::hasFixedLayout() const {
  // A conformance/witness table has fixed layout if type has a fixed layout in
  // all resilience domains, and the conformance is externally visible.
  if (auto nominal = getInterfaceType()->getAnyNominal())
    if (nominal->hasFixedLayout() &&
        getProtocol()->getEffectiveAccess() >= Accessibility::Public &&
        nominal->getEffectiveAccess() >= Accessibility::Public)
      return true;

  return false;
}

GenericEnvironment *ProtocolConformance::getGenericEnvironment() const {
  switch (getKind()) {
  case ProtocolConformanceKind::Inherited:
  case ProtocolConformanceKind::Normal:
    // If we have a normal or inherited protocol conformance, look for its
    // generic parameters.
    return getDeclContext()->getGenericEnvironmentOfContext();

  case ProtocolConformanceKind::Specialized:
    // If we have a specialized protocol conformance, since we do not support
    // currently partial specialization, we know that it cannot have any open
    // type variables.
    //
    // FIXME: We could return a meaningful GenericEnvironment here
    return nullptr;
  }

  llvm_unreachable("Unhandled ProtocolConformanceKind in switch.");
}

GenericSignature *ProtocolConformance::getGenericSignature() const {
  switch (getKind()) {
  case ProtocolConformanceKind::Inherited:
  case ProtocolConformanceKind::Normal:
    // If we have a normal or inherited protocol conformance, look for its
    // generic signature.
    return getDeclContext()->getGenericSignatureOfContext();

  case ProtocolConformanceKind::Specialized:
    // If we have a specialized protocol conformance, since we do not support
    // currently partial specialization, we know that it cannot have any open
    // type variables.
    return nullptr;
  }

  llvm_unreachable("Unhandled ProtocolConformanceKind in switch.");
}

bool ProtocolConformance::isBehaviorConformance() const {
  return getRootNormalConformance()->isBehaviorConformance();
}

AbstractStorageDecl *ProtocolConformance::getBehaviorDecl() const {
  return getRootNormalConformance()->getBehaviorDecl();
}

void NormalProtocolConformance::setSignatureConformances(
                               ArrayRef<ProtocolConformanceRef> conformances) {
  auto &ctx = getProtocol()->getASTContext();
  SignatureConformances = ctx.AllocateCopy(conformances);

#if !NDEBUG
  unsigned idx = 0;
  for (auto req : getProtocol()->getRequirementSignature()->getRequirements()) {
    if (req.getKind() == RequirementKind::Conformance) {
      assert(idx < conformances.size());
      assert(conformances[idx].getRequirement() ==
               req.getSecondType()->castTo<ProtocolType>()->getDecl());
      ++idx;
    }
  }
  assert(idx == conformances.size() && "Too many conformances");
#endif
}

void NormalProtocolConformance::resolveLazyInfo() const {
  assert(Resolver);
  assert(isComplete());

  auto *resolver = Resolver;
  auto *mutableThis = const_cast<NormalProtocolConformance *>(this);
  mutableThis->Resolver = nullptr;
  mutableThis->setState(ProtocolConformanceState::Incomplete);
  resolver->finishNormalConformance(mutableThis, ResolverContextData);
  mutableThis->setState(ProtocolConformanceState::Complete);
}

void NormalProtocolConformance::setLazyLoader(LazyMemberLoader *resolver,
                                              uint64_t contextData) {
  assert(!Resolver && "already has a resolver");
  Resolver = resolver;
  ResolverContextData = contextData;
}

bool NormalProtocolConformance::hasTypeWitness(AssociatedTypeDecl *assocType,
                                               LazyResolver *resolver) const {
  if (Resolver)
    resolveLazyInfo();

  if (TypeWitnesses.find(assocType) != TypeWitnesses.end()) {
    return true;
  }
  if (resolver) {
    resolver->resolveTypeWitness(this, assocType);
    if (TypeWitnesses.find(assocType) != TypeWitnesses.end()) {
      return true;
    }
  }
  return false;
}

std::pair<Type, TypeDecl *>
NormalProtocolConformance::getTypeWitnessAndDecl(AssociatedTypeDecl *assocType,
                                                 LazyResolver *resolver) const {
  if (Resolver)
    resolveLazyInfo();

  auto known = TypeWitnesses.find(assocType);
  if (known == TypeWitnesses.end()) {
    assert(resolver && "Unable to resolve type witness");
    resolver->resolveTypeWitness(this, assocType);
    known = TypeWitnesses.find(assocType);
    assert(known != TypeWitnesses.end() && "Didn't resolve witness?");
  }

  return known->second;
}

void NormalProtocolConformance::setTypeWitness(AssociatedTypeDecl *assocType,
                                               Type type,
                                               TypeDecl *typeDecl) const {
  assert(getProtocol() == cast<ProtocolDecl>(assocType->getDeclContext()) &&
         "associated type in wrong protocol");
  assert(TypeWitnesses.count(assocType) == 0 && "Type witness already known");
  assert((!isComplete() || isInvalid()) && "Conformance already complete?");
  TypeWitnesses[assocType] = std::make_pair(type, typeDecl);
}

Type ProtocolConformance::getAssociatedType(Type assocType,
                                            LazyResolver *resolver) const {
  assert(assocType->isTypeParameter() &&
         "associated type must be a type parameter");

  ProtocolConformanceRef ref(const_cast<ProtocolConformance*>(this));
  return ref.getAssociatedType(getType(), assocType, resolver);
}

Type ProtocolConformanceRef::getAssociatedType(Type conformingType,
                                               Type assocType,
                                               LazyResolver *resolver) const {
  assert(!isConcrete() || getConcrete()->getType()->isEqual(conformingType));

  auto type = assocType->getCanonicalType();
  auto proto = getRequirement();

#if false
  // Fast path for generic parameters.
  if (isa<GenericTypeParamType>(type)) {
    assert(type->isEqual(proto->getSelfInterfaceType()) &&
           "type parameter in protocol was not Self");
    return getType();
  }

  // Fast path for dependent member types on 'Self' of our associated types.
  auto memberType = cast<DependentMemberType>(type);
  if (memberType.getBase()->isEqual(proto->getProtocolSelfType()) &&
      memberType->getAssocType()->getProtocol() == proto)
    return getTypeWitness(memberType->getAssocType(), nullptr);
#endif

  // General case: consult the substitution map.
  auto substMap =
    SubstitutionMap::getProtocolSubstitutions(proto, conformingType, *this);
  return type.subst(substMap);
}

ProtocolConformanceRef
ProtocolConformanceRef::getAssociatedConformance(Type conformingType,
                                                 Type assocType,
                                                 ProtocolDecl *protocol,
                                                 LazyResolver *resolver) const {
  // If this is a concrete conformance, look up the associated conformance.
  if (isConcrete()) {
    auto conformance = getConcrete();
    assert(conformance->getType()->isEqual(conformingType));
    return conformance->getAssociatedConformance(assocType, protocol, resolver);
  }

  // Otherwise, apply the substitution {self -> conformingType}
  // to the abstract conformance requirement laid upon the dependent type
  // by the protocol.
  auto subMap =
    SubstitutionMap::getProtocolSubstitutions(getRequirement(),
                                              conformingType, *this);
  auto abstractConf = ProtocolConformanceRef(protocol);
  return abstractConf.subst(assocType,
                            QuerySubstitutionMap{subMap},
                            LookUpConformanceInSubstitutionMap(subMap));
}

ProtocolConformanceRef
ProtocolConformance::getAssociatedConformance(Type assocType,
                                               ProtocolDecl *protocol,
                                               LazyResolver *resolver) const {
  CONFORMANCE_SUBCLASS_DISPATCH(getAssociatedConformance,
                                (assocType, protocol, resolver))
}

ProtocolConformanceRef
NormalProtocolConformance::getAssociatedConformance(Type assocType,
                                                    ProtocolDecl *protocol,
                                                LazyResolver *resolver) const {
  assert(assocType->isTypeParameter() &&
         "associated type must be a type parameter");
  assert(!getSignatureConformances().empty() &&
         "signature conformances not yet computed");

  unsigned conformanceIndex = 0;
  for (auto &reqt :
         getProtocol()->getRequirementSignature()->getRequirements()) {
    if (reqt.getKind() == RequirementKind::Conformance) {
      // Is this the conformance we're looking for?
      if (reqt.getFirstType()->isEqual(assocType) &&
          reqt.getSecondType()->castTo<ProtocolType>()->getDecl() == protocol)
        return getSignatureConformances()[conformanceIndex];

      ++conformanceIndex;
    }
  }

  llvm_unreachable(
    "requested conformance was not a direct requirement of the protocol");
}

  /// Retrieve the value witness corresponding to the given requirement.
Witness NormalProtocolConformance::getWitness(ValueDecl *requirement,
                                              LazyResolver *resolver) const {
  assert(!isa<AssociatedTypeDecl>(requirement) && "Request type witness");
  assert(requirement->isProtocolRequirement() && "Not a requirement");

  if (Resolver)
    resolveLazyInfo();

  auto known = Mapping.find(requirement);
  if (known == Mapping.end()) {
    assert(resolver && "Unable to resolve witness without resolver");
    resolver->resolveWitness(this, requirement);
    known = Mapping.find(requirement);
  }
  if (known != Mapping.end()) {
    return known->second;
  } else {
    assert((!isComplete() || isInvalid()) &&
           "Resolver did not resolve requirement");
    return Witness();
  }
}

void NormalProtocolConformance::setWitness(ValueDecl *requirement,
                                           Witness witness) const {
  assert(!isa<AssociatedTypeDecl>(requirement) && "Request type witness");
  assert(getProtocol() == cast<ProtocolDecl>(requirement->getDeclContext()) &&
         "requirement in wrong protocol");
  assert(Mapping.count(requirement) == 0 && "Witness already known");
  assert((!isComplete() || isInvalid() ||
          requirement->getAttrs().hasAttribute<OptionalAttr>() ||
          requirement->getAttrs().isUnavailable(
                                        requirement->getASTContext())) &&
         "Conformance already complete?");
  Mapping[requirement] = witness;
}

SpecializedProtocolConformance::SpecializedProtocolConformance(
    Type conformingType,
    ProtocolConformance *genericConformance,
    SubstitutionList substitutions)
  : ProtocolConformance(ProtocolConformanceKind::Specialized, conformingType,
                        // FIXME: interface type should be passed in.
                        // assumes specialized conformance is always fully
                        // specialized
                        conformingType),
    GenericConformance(genericConformance),
    GenericSubstitutions(substitutions)
{
  assert(genericConformance->getKind() != ProtocolConformanceKind::Specialized);
}

bool SpecializedProtocolConformance::hasTypeWitness(
                      AssociatedTypeDecl *assocType,
                      LazyResolver *resolver) const {
  return TypeWitnesses.find(assocType) != TypeWitnesses.end() ||
         GenericConformance->hasTypeWitness(assocType, resolver);
}

std::pair<Type, TypeDecl *>
SpecializedProtocolConformance::getTypeWitnessAndDecl(
                      AssociatedTypeDecl *assocType,
                      LazyResolver *resolver) const {
  // If we've already created this type witness, return it.
  auto known = TypeWitnesses.find(assocType);
  if (known != TypeWitnesses.end()) {
    return known->second;
  }

  // Otherwise, perform substitutions to create this witness now.
  auto *genericEnv = GenericConformance->getGenericEnvironment();

  auto substitutionMap =
      genericEnv->getSubstitutionMap(GenericSubstitutions);

  auto genericWitnessAndDecl
    = GenericConformance->getTypeWitnessAndDecl(assocType, resolver);

  auto &genericWitness = genericWitnessAndDecl.first;
  auto *typeDecl = genericWitnessAndDecl.second;

  // Apply the substitution we computed above
  auto specializedType
    = genericWitness.subst(substitutionMap);
  if (!specializedType)
    specializedType = ErrorType::get(genericWitness);

  // If the type witness was unchanged, just copy it directly.
  if (specializedType.getPointer() == genericWitness.getPointer()) {
    TypeWitnesses[assocType] = genericWitnessAndDecl;
    return TypeWitnesses[assocType];
  }

  TypeWitnesses[assocType] = std::make_pair(specializedType, typeDecl);
  return TypeWitnesses[assocType];
}

Witness
SpecializedProtocolConformance::getWitness(ValueDecl *requirement,
                                           LazyResolver *resolver) const {
  // FIXME: Apply substitutions here!
  return GenericConformance->getWitness(requirement, resolver);
}

ProtocolConformanceRef
SpecializedProtocolConformance::getAssociatedConformance(Type assocType,
                                                ProtocolDecl *protocol,
                                                LazyResolver *resolver) const {
  ProtocolConformanceRef conformance =
    GenericConformance->getAssociatedConformance(assocType, protocol, resolver);

  auto genericEnv = GenericConformance->getGenericEnvironment();
  auto subMap = genericEnv->getSubstitutionMap(GenericSubstitutions);

  Type origType =
    (conformance.isConcrete()
       ? conformance.getConcrete()->getType()
       : GenericConformance->getAssociatedType(assocType, resolver));

  return conformance.subst(origType,
                           QuerySubstitutionMap{subMap},
                           LookUpConformanceInSubstitutionMap(subMap));
}

ProtocolConformanceRef
InheritedProtocolConformance::getAssociatedConformance(Type assocType,
                         ProtocolDecl *protocol,
                         LazyResolver *resolver) const {
  auto underlying =
    InheritedConformance->getAssociatedConformance(assocType, protocol,
                                                   resolver);

  // If the conformance is for Self, return an inherited conformance.
  if (underlying.isConcrete() &&
      assocType->isEqual(getProtocol()->getSelfInterfaceType())) {
    auto subclassType = getType();
    ASTContext &ctx = subclassType->getASTContext();
    return ProtocolConformanceRef(
             ctx.getInheritedConformance(subclassType,
                                         underlying.getConcrete()));
  }

  return underlying;
}

const NormalProtocolConformance *
ProtocolConformance::getRootNormalConformance() const {
  const ProtocolConformance *C = this;
  while (!isa<NormalProtocolConformance>(C)) {
    switch (C->getKind()) {
    case ProtocolConformanceKind::Normal:
      llvm_unreachable("should have broken out of loop");
    case ProtocolConformanceKind::Inherited:
      C = cast<InheritedProtocolConformance>(C)
          ->getInheritedConformance();
      break;
    case ProtocolConformanceKind::Specialized:
      C = cast<SpecializedProtocolConformance>(C)
        ->getGenericConformance();
      break;
    }
  }
  return cast<NormalProtocolConformance>(C);
}

bool ProtocolConformance::isVisibleFrom(const DeclContext *dc) const {
  // FIXME: Implement me!
  return true;
}

ProtocolConformance *
ProtocolConformance::subst(Type substType,
                           TypeSubstitutionFn subs,
                           LookupConformanceFn conformances) const {
  if (getType()->isEqual(substType))
    return const_cast<ProtocolConformance *>(this);

  switch (getKind()) {
  case ProtocolConformanceKind::Normal:
    if (substType->isSpecialized()) {
      assert(getType()->isSpecialized()
             && "substitution mapped non-specialized to specialized?!");
      assert(getType()->getNominalOrBoundGenericNominal()
               == substType->getNominalOrBoundGenericNominal()
             && "substitution mapped to different nominal?!");

      // Since this is a normal conformance, the substitution maps archetypes
      // in the environment of the conformance to types containing archetypes
      // of some other generic environment.
      //
      // ASTContext::getSpecializedConformance() wants a substitution map
      // with interface types as keys, so do the mapping here.
      //
      // Once the type of a normal conformance becomes an interface type,
      // we can remove this.
      SubstitutionMap subMap;
      if (auto *genericSig = getGenericSignature()) {
        auto *genericEnv = getGenericEnvironment();
        subMap = genericSig->getSubstitutionMap(
          [&](SubstitutableType *t) -> Type {
            return genericEnv->mapTypeIntoContext(
              t).subst(subs, conformances, SubstFlags::UseErrorType);
          },
          [&](CanType origType, Type substType, ProtocolType *protoType)
            -> Optional<ProtocolConformanceRef> {
            origType = CanType(
              genericEnv->mapTypeIntoContext(
                origType)->castTo<ArchetypeType>());
            return conformances(origType, substType, protoType);
          });
      }

      return substType->getASTContext()
        .getSpecializedConformance(substType,
                                   const_cast<ProtocolConformance *>(this),
                                   subMap);
    }
    assert(substType->isEqual(getType())
           && "substitution changed non-specialized type?!");
    return const_cast<ProtocolConformance *>(this);

  case ProtocolConformanceKind::Inherited: {
    // Substitute the base.
    auto inheritedConformance
      = cast<InheritedProtocolConformance>(this)->getInheritedConformance();
    ProtocolConformance *newBase;
    if (inheritedConformance->getType()->isSpecialized()) {
      newBase = inheritedConformance->subst(substType, subs, conformances);
    } else {
      newBase = inheritedConformance;
    }

    return substType->getASTContext()
      .getInheritedConformance(substType, newBase);
  }
  case ProtocolConformanceKind::Specialized: {
    // Substitute the substitutions in the specialized conformance.
    auto spec = cast<SpecializedProtocolConformance>(this);
    auto genericConformance
      = cast<SpecializedProtocolConformance>(this)->getGenericConformance();
    auto subMap =
      genericConformance->getGenericSignature()
        ->getSubstitutionMap(spec->getGenericSubstitutions());

    return substType->getASTContext()
      .getSpecializedConformance(substType, genericConformance,
                                 subMap.subst(subs, conformances));
  }
  }
  llvm_unreachable("bad ProtocolConformanceKind");
}

ProtocolConformance *
ProtocolConformance::getInheritedConformance(ProtocolDecl *protocol) const {
  auto result =
    getAssociatedConformance(getProtocol()->getSelfInterfaceType(), protocol);
  return result.isConcrete() ? result.getConcrete() : nullptr;
}

#pragma mark Protocol conformance lookup
void NominalTypeDecl::prepareConformanceTable() const {
  if (ConformanceTable)
    return;

  auto mutableThis = const_cast<NominalTypeDecl *>(this);
  ASTContext &ctx = getASTContext();
  auto resolver = ctx.getLazyResolver();
  ConformanceTable = new (ctx) ConformanceLookupTable(ctx, mutableThis,
                                                      resolver);

  // If this type declaration was not parsed from source code or introduced
  // via the Clang importer, don't add any synthesized conformances.
  if (!getParentSourceFile() && !hasClangNode())
    return;

  // Add any synthesized conformances.
  if (isa<ClassDecl>(this)) {
    if (auto anyObject = getASTContext().getProtocol(
                           KnownProtocolKind::AnyObject)) {
      ConformanceTable->addSynthesizedConformance(mutableThis, anyObject);
    }
  } else if (auto theEnum = dyn_cast<EnumDecl>(mutableThis)) {
    if (theEnum->hasOnlyCasesWithoutAssociatedValues()) {
      // Simple enumerations conform to Equatable.
      if (auto equatable = ctx.getProtocol(KnownProtocolKind::Equatable)) {
        ConformanceTable->addSynthesizedConformance(mutableThis, equatable);
      }

      // Simple enumerations conform to Hashable.
      if (auto hashable = getASTContext().getProtocol(
                            KnownProtocolKind::Hashable)) {
        ConformanceTable->addSynthesizedConformance(mutableThis, hashable);
      }
    }

    // Enumerations with a raw type conform to RawRepresentable.
    if (resolver)
      resolver->resolveRawType(theEnum);
    if (theEnum->hasRawType()) {
      if (auto rawRepresentable =
            ctx.getProtocol(KnownProtocolKind::RawRepresentable)) {
        ConformanceTable->addSynthesizedConformance(mutableThis,
                                                    rawRepresentable);
      }
    }
  }

  // Add protocols for any synthesized protocol attributes.
  for (auto attr : getAttrs()) {
    if (auto synthesizedProto = dyn_cast<SynthesizedProtocolAttr>(attr)) {
      if (auto proto = getASTContext().getProtocol(
                         synthesizedProto->getProtocolKind())) {
        ConformanceTable->addSynthesizedConformance(mutableThis, proto);
      }
    }
  }
}

bool NominalTypeDecl::lookupConformance(
       ModuleDecl *module, ProtocolDecl *protocol,
       SmallVectorImpl<ProtocolConformance *> &conformances) const {
  prepareConformanceTable();
  return ConformanceTable->lookupConformance(
           module,
           const_cast<NominalTypeDecl *>(this),
           protocol,
           getASTContext().getLazyResolver(),
           conformances);
}

SmallVector<ProtocolDecl *, 2> NominalTypeDecl::getAllProtocols() const {
  prepareConformanceTable();
  SmallVector<ProtocolDecl *, 2> result;
  ConformanceTable->getAllProtocols(const_cast<NominalTypeDecl *>(this),
                                    getASTContext().getLazyResolver(),
                                    result);
  return result;
}

SmallVector<ProtocolConformance *, 2> NominalTypeDecl::getAllConformances(
                                        bool sorted) const
{
  prepareConformanceTable();
  SmallVector<ProtocolConformance *, 2> result;
  ConformanceTable->getAllConformances(const_cast<NominalTypeDecl *>(this),
                                       getASTContext().getLazyResolver(),
                                       sorted,
                                       result);
  return result;
}

void NominalTypeDecl::getImplicitProtocols(
       SmallVectorImpl<ProtocolDecl *> &protocols) {
  prepareConformanceTable();
  ConformanceTable->getImplicitProtocols(this, protocols);
}

void NominalTypeDecl::registerProtocolConformance(
       ProtocolConformance *conformance) {
  prepareConformanceTable();
  ConformanceTable->registerProtocolConformance(conformance);
}

ArrayRef<ValueDecl *>
NominalTypeDecl::getSatisfiedProtocolRequirementsForMember(
                                             const ValueDecl *member,
                                             bool sorted) const {
  assert(member->getDeclContext()->getAsNominalTypeOrNominalTypeExtensionContext()
           == this);
  assert(!isa<ProtocolDecl>(this));
  prepareConformanceTable();
  return ConformanceTable->getSatisfiedProtocolRequirementsForMember(member,
                                           const_cast<NominalTypeDecl *>(this),
                                           getASTContext().getLazyResolver(),
                                           sorted);
}

SmallVector<ProtocolDecl *, 2>
DeclContext::getLocalProtocols(
  ConformanceLookupKind lookupKind,
  SmallVectorImpl<ConformanceDiagnostic> *diagnostics,
  bool sorted) const
{
  SmallVector<ProtocolDecl *, 2> result;

  // Dig out the nominal type.
  NominalTypeDecl *nominal = getAsNominalTypeOrNominalTypeExtensionContext();
  if (!nominal)
    return result;

  // Update to record all potential conformances.
  nominal->prepareConformanceTable();
  nominal->ConformanceTable->lookupConformances(
    nominal,
    const_cast<DeclContext *>(this),
    getASTContext().getLazyResolver(),
    lookupKind,
    &result,
    nullptr,
    diagnostics);

  // Sort if required.
  if (sorted) {
    llvm::array_pod_sort(result.begin(), result.end(),
                         &ProtocolType::compareProtocols);
  }

  return result;
}

SmallVector<ProtocolConformance *, 2>
DeclContext::getLocalConformances(
  ConformanceLookupKind lookupKind,
  SmallVectorImpl<ConformanceDiagnostic> *diagnostics,
  bool sorted) const
{
  SmallVector<ProtocolConformance *, 2> result;

  // Dig out the nominal type.
  NominalTypeDecl *nominal = getAsNominalTypeOrNominalTypeExtensionContext();
  if (!nominal)
    return result;

  // Protocols don't have conformances.
  if (isa<ProtocolDecl>(nominal))
    return { };

  // Update to record all potential conformances.
  nominal->prepareConformanceTable();
  nominal->ConformanceTable->lookupConformances(
    nominal,
    const_cast<DeclContext *>(this),
    nominal->getASTContext().getLazyResolver(),
    lookupKind,
    nullptr,
    &result,
    diagnostics);

  // If requested, sort the results.
  if (sorted) {
    llvm::array_pod_sort(result.begin(), result.end(),
                         &ConformanceLookupTable::compareProtocolConformances);
  }

  return result;
}


text:
layout: doc-api.html
tags: argument-list
---

# ally.element.blur

Shifts focus away from an element if it currently has focus.

## Description

The [`blur()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur) method is available on all [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement). But this is not necessarily true for [`SVGElement`](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement). Only Blink and WebKit expose the `blur()` method on SVG elements, Gecko, Trident and Edge do not. This will likely change once [SVG 2](https://www.w3.org/TR/SVG2/interact.html#Focus) is a thing. Until then `ally.element.blur()` tries to apply `HTMLElement.prototoype.blur` to `SVGElement`s. This only works for Internet Explorer 9 - 11, as Gecko and Edge actively prevent this.

According to [jQuery Bug 9420](https://bugs.jqueryui.com/ticket/9420) calling `blur()` on the `body` element may make the browser window lose focus. `ally.element.blur()` guards against this.

## Usage

```js
var element = document.getElementById('victim');
var result = ally.element.blur(element);
```

### Arguments

| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| element | [`<selector>`](../concepts.md#selector) | *required* | The Element to blur. First element of the collections is used. |

### Returns

[`HTMLElement`](https://developer.mozilla.org/en/docs/Web/API/HTMLElement) that received focus (usually `document.body`) or `null` if focus could not be shifted.

### Throws

[`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) if `element` argument does not resolve to an `HTMLElement`.

## Examples

## Changes

* Added in `v1.3.0`.
* Since `v1.4.0` can blur SVG elements in Firefox, Internet Explorer and Edge.

## Notes

:::warning
Cannot blur SVG and MathML elements when they're not children of an HTML document.
:::

## Related resources

* [`ally.element.focus`](./focus.md) shifts focus to an element if it does not already have focus.

## Contributing

* [module source](https://github.com/medialize/ally.js/blob/master/src/element/blur.js)
* [document source](https://github.com/medialize/ally.js/blob/master/docs/api/element/blur.md)
* [unit test](https://github.com/medialize/ally.js/blob/master/test/unit/element.blur.test.js)


text:
<!--
id: 19969129192
link: http://tumblr.atmos.org/post/19969129192/tales-from-the-trenches-github-online-collaboration
slug: tales-from-the-trenches-github-online-collaboration
date: Mon Mar 26 2012 14:02:58 GMT-0700 (PDT)
publish: 2012-03-026
tags:
title: Tales from the Trenches: GitHub — Online Collaboration
-->

Tales from the Trenches: GitHub — Online Collaboration
======================================================

[http://gigaom.com/collaboration/tales-from-the-trenches-github/](http://gigaom.com/collaboration/tales-from-the-trenches-github/)


text:
<?php

namespace GoogleAPI\Helper;

/**
 * Helper class that can be used to create the required cURL headers for each call
 * to Google's API as well as parsing an HTTP response and returning the data as an
 * associative array.
 *
 * @author   Yorick Peterse, Isset Internet Professionals
 * @link     http://yorickpeterse.com/ Website of Yorick Peterse
 * @link     http://isset.nl/ Website of Isset Internet Professionals
 * @license  https://github.com/isset/codeigniter-google-apis/blob/master/license.txt The MIT license
 * @version  0.1
 */
class HTTP
{
	/**
	 * Parses a given HTTP response and turns it into an array.
	 * The format of this array looks like the following:
	 *
	 *     array(
	 *         'headers' => array(
	 *             'Content-Type' => 'application/atom+xml',
	 *             'status'       => array(
	 *                 'code'    => 200,
	 *                 'message' => 'OK'
	 *             )
	 *         ),
	 *         'body' => '...'
	 *     )
	 *
	 * @author Yorick Peterse
	 * @since  0.1
	 * @static
	 * @access public
	 * @param  string $response The raw HTTP resonse to turn into an array.
	 * @return array
	 */
	public static function parse_response($response)
	{
		// [0] contains the headers, [1] contains the body
		$response = explode("\r\n\r\n", $response);
		$result   = array(
			'headers' => array(),
			'body'    => ''
		);

		// Parse the headers
		if ( isset($response[0]) )
		{
			foreach ( explode("\r\n", $response[0]) as $header )
			{
				// Regular headers such as Content-Type
				if ( stristr($header, ':') !== FALSE )
				{
					$header = explode(':', $header);
					$result['headers'][$header[0]] = $header[1];
				}
				// The HTTP status code doesn't include a colon
				else
				{
					$header                      = explode(' ', $header, 3);
					$result['headers']['status'] = array(
						'code'    => (int)$header[1],
						'message' => $header[2]
					);
				}
			}
		}

		// Parse the body, piece of cake
		if ( isset($response[1]) )
		{
			$result['body'] = $response[1];
		}

		return $result;
	}

	/**
	 * When using custom headers in a cURL request they should be supplied as a regular
	 * array where each value is the actual header. This method can convert an associative
	 * array into a regular array making the use of custom headers a bit easier. For example,
	 * the following array:
	 *
	 *     array(
	 *         'Content-Type' => 'application/atom+xml'
	 *     )
	 *
	 * would be converted into the following:
	 *
	 *     array(
	 *         'Content-Type: application/atom+xml'
	 *     )
	 *
	 * @author Yorick Peterse
	 * @since  0.1
	 * @static
	 * @access public
	 * @param  array $headers Associative array containing all headers to set.
	 * @return array
	 */
	public static function convert_headers($headers)
	{
		$headers_array = array();

		foreach ( $headers as $header => $value )
		{
			$headers_array[] = "$header: $value";
		}

		return $headers_array;
	}

	/**
	 * Sets the content type header, the Google API version and optionally the content
	 * length (useful for POST and PUT requests).
	 *
	 * @author Yorick Peterse
	 * @since  0.1
	 * @static
	 * @param  int $content_length The length of the POST/PUT body.
	 * @return array
	 */
	public static function default_headers($content_length = NULL)
	{
		$headers = array(
			'Content-Type'  => 'application/atom+xml',
			'GData-Version' => '2.0'
		);

		if ( isset($content_length) AND !empty($content_length) )
		{
			$headers['Content-Length'] = $content_length;
		}

		return self::convert_headers($headers);
	}
}


text:
(async function () {
	const playlistUrl = await hls.createHlsStream(request.param.id, request.query);

	if (!playlistUrl) return response.error(404);

	response.head(200);
	response.end(JSON.stringify({
		playlistUrl: 'http://' + request.headers.host + playlistUrl
	}, null, '  '));

	return;
})();


text:
<?php

namespace Phpatterns\Behavioral\ChainOfResponsibility\OrderNotification;

use Phpatterns\Behavioral\ChainOfResponsibility;

class ShippedOrderNotification extends ChainOfResponsibility\AbstractOrderNotification
{
    public function __construct()
    {
        $this->orderStatus = ChainOfResponsibility\Order::ORDER_STATUS_SHIPPED;
        $this->followingOrderNotification = null;
    }

    /**
     * @param ChainOfResponsibility\Order $order
     * @return string
     */
    public function sendNotification(ChainOfResponsibility\Order $order)
    {
        return sprintf(
            'Dear %s %s, your order has been shipped! Your tracking number: %s',
            $order->getCustomerFirstName(),
            $order->getCustomerLastName(),
            $order->getTrackingNumber()
        );
    }
}


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

  <parent>
    <groupId>com.googlecode.forplay</groupId>
    <artifactId>forplay-manualtests-project</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <groupId>com.googlecode.forplay</groupId>
  <artifactId>forplay-manualtests-core</artifactId>
  <name>Forplay ManualTests Core</name>

  <dependencies>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>${gwtversion}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.googlecode.forplay</groupId>
      <artifactId>core</artifactId>
      <version>${coreversion}</version>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src</sourceDirectory>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>${basedir}/src</directory>
      </resource>
      <resource>
        <directory>${basedir}/war/WEB-INF/classes</directory>
      </resource>
    </resources>
  </build>
</project>


text:
'''@file speller.py
contains the speller functionality'''

from functools import partial
import tensorflow as tf
from nabu.neuralnetworks.classifiers.asr.asr_decoders import asr_decoder

class Speller(asr_decoder.AsrDecoder):
    '''a speller decoder for the LAS architecture'''

    def decode(self, hlfeat, encoder_inputs, initial_state, first_step,
               is_training):
        '''
        Get the logits and the output state
        Args:
            hlfeat: the high level features of shape
                [batch_size x hl_seq_length x feat_dim]
            encoder_inputs: the training targets of shape
                [batch_size x target_seq_length] (not yet one hot encoded).
            initial_state: the initial decoder state, could be usefull for
                decoding
            first_step: bool that determines if this is the first step
            is_training: whether or not the network is in training mode
        Returns:
            - the output logits of the listener as a
                [batch_size x target_seq_length x numlabels] tensor
            - the final state of the listener
        '''

        #one hot encode the targets
        one_hot_inputs = tf.one_hot(encoder_inputs, self.output_dim,
                                    dtype=tf.float32)

        #put targets in time major
        time_major_inputs = tf.transpose(one_hot_inputs, [1, 0, 2])

        #convert targets to list
        input_list = tf.unstack(time_major_inputs)

        #create the rnn cell
        rnn_cell = self.create_rnn(is_training)

        #create the loop functions
        lf = partial(loop_function, time_major_inputs,
                     float(self.conf['speller_sample_prob']))

        #use the attention decoder
        logit_list, state = tf.contrib.legacy_seq2seq.attention_decoder(
            decoder_inputs=input_list,
            initial_state=initial_state,
            attention_states=hlfeat,
            cell=rnn_cell,
            output_size=self.output_dim,
            loop_function=lf,
            scope='attention_decoder',
            initial_state_attention=not first_step)

        logits = tf.transpose(tf.stack(logit_list), [1, 0, 2])

        return logits, state

    def create_rnn(self, is_training=False):
        '''created the decoder rnn cell
        Args:
            is_training: whether or not the network is in training mode
        Returns:
            an rnn cell'''

        #create the multilayered rnn cell
        rnn_cell = tf.contrib.rnn.BasicLSTMCell(
            int(self.conf['speller_numunits']))

        if float(self.conf['speller_dropout']) < 1 and is_training:
            rnn_cell = tf.contrib.rnn.DropoutWrapper(
                rnn_cell, output_keep_prob=float(self.conf['speller_dropout']))

        rnn_cell = tf.contrib.rnn.MultiRNNCell(
            [rnn_cell]*int(self.conf['speller_numlayers']))

        return rnn_cell

    def zero_state(self, batch_size):
        '''get the listener zero state
        Returns:
            an rnn_cell zero state'''

        return self.create_rnn().zero_state(batch_size, tf.float32)

def loop_function(decoder_inputs, sample_prob, prev, i):
    '''the loop function used in the attention decoder_inputs, used for
    scheduled sampling
    Args:
        decoder_inputs: the ground truth labels as a tensor of shape
            [seq_length, batch_size, numlabels] (time_major)
        sample_prob: the probability that the network will sample the output
        prev: the outputs of the previous steps
        i: the current decoding step
    returns:
        the input for the nect time step
    '''

    batch_size = int(decoder_inputs.get_shape()[1])
    numlabels = decoder_inputs.get_shape()[2]

    #get the most likely characters as the sampled output
    next_input_sampled = tf.one_hot(tf.argmax(prev, 1), numlabels)

    #get the current ground truth labels
    next_input_truth = tf.gather(decoder_inputs, i)

    #creat a boolean vector of where to sample
    sample = tf.less(tf.random_uniform([batch_size]), sample_prob)

    next_input = tf.where(sample, next_input_sampled, next_input_truth)

    return next_input


text:
class Ishizue::InstallGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)

  def create_misc_directories
    empty_directory 'misc/ssh_keys'
  end

  def copy_itamae_templates
    directory 'itamae', 'misc/itamae'
  end

  def copy_capistrano_templates
    directory 'capistrano', 'misc/capistrano'
  end

  def generate_templates
    @app_name = Rails.application.class.name.gsub(/^(\w+)::Application$/, '\1').underscore
    empty_directory "misc/itamae/cookbooks/#{@app_name}"
    template 'erbs/default.rb.erb', "misc/itamae/cookbooks/#{@app_name}/default.rb"
    directory 'files', "misc/itamae/cookbooks/#{@app_name}/files"
    template 'erbs/monitor.conf.erb', "misc/itamae/cookbooks/#{@app_name}/files/etc/nginx/conf.d/monitor.conf"
    template 'erbs/deploy.rb.erb', 'misc/capistrano/config/deploy.rb'
    template 'erbs/staging.rb.erb', 'misc/itamae/roles/staging.rb'
    template 'erbs/ishizue.rake.erb', 'misc/capistrano/lib/capistrano/tasks/ishizue.rake'
  end

  def append_gems
    gem 'sinatra'
    gem 'sidekiq'
    gem 'figaro'
    gem 'whenever'
    gem 'puma'
  end
end


text:
title: My Sixth lesson on Python
layout: post
author: milen.kortman
permalink: /my-sixth-lesson-on-python/
source-id: 1Qict464xOQQ5kvOQaM6jGh2YtMv20U0Xb4M-rBAP1rI
published: true
---

    Title
    My Sixth lesson on Python
    Date
    30/06/18

    Starting point:
    I've finished stage 4 and I'm halfway through stage 5.

    Target for this lesson?
    To get halfway through project 5.

    Did I reach my target?
(add details to "Lesson Review")
    Yes I was able to get to the middle of stage 5 before the lesson was over..

    Lesson Review

    How did I learn? What strategies were effective?

    Like I did last week I didn't rely so much on the instructions and I figured out almost all of it without using the hint so that was good. I also didn't have any distractions in this lesson and I was able to get to work really quick and then do it more efficiently as I wasn't getting into any sort of conversation.

    What limited my learning? Which habits do I need to work on?

    On this lesson as well nothing really limited my learning and besides the little mishap I had at the beginning of the lesson with the wifi and the fact I couldn't get onto codecademy. I was also very good with not starting a conversation as I mentioned before so nothing really limited my learning.

    What will I change for next time? How will I improve my learning?

    And also as the same as last week there isn't much that I would change for this lesson as there wasn't much that went wrong. I achieved my target and I didn't get into any conversations and I got on with the work early on so overall it was a very smooth lesson.


text:
package com.github.dynamicextensionsalfresco.osgi.spring;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.util.Assert;

/**
 * Abstract base class for {@link FactoryBean}s that use configuration files.
 *
 * @author Laurens Fridael
 *
 * @param <T>
 */
public abstract class AbstractConfigurationFileFactoryBean<T> implements FactoryBean<T>, ResourceLoaderAware {

	/* Dependencies */

	private ResourcePatternResolver resourcePatternResolver;

	/* Configuration */

	private List<Resource> configurations = Collections.emptyList();

	private List<String> configurationLocations = Collections.emptyList();

	/* Dependencies */

	@Override
	public void setResourceLoader(final ResourceLoader resourceLoader) {
		Assert.isInstanceOf(ResourcePatternResolver.class, resourceLoader);
		this.resourcePatternResolver = (ResourcePatternResolver) resourceLoader;
	}

	protected ResourcePatternResolver getResourcePatternResolver() {
		return resourcePatternResolver;
	}

	/* Utility operations */

	protected List<Resource> resolveConfigurations() throws IOException {
		final List<Resource> configurations = new ArrayList<Resource>(this.configurations);
		for (final String location : getConfigurationLocations()) {
			configurations.addAll(Arrays.asList(getResourcePatternResolver().getResources(location)));
		}
		return configurations;
	}

	/* Configuration */

	public void setConfigurations(final List<Resource> configurations) {
		Assert.notNull(configurations);
		this.configurations = configurations;
	}

	protected List<Resource> getConfigurations() {
		return configurations;
	}

	public void setConfigurationLocations(final List<String> configurationLocations) {
		this.configurationLocations = configurationLocations;
	}

	protected List<String> getConfigurationLocations() {
		return configurationLocations;
	}
}


text:
<!DOCTYPE html>

	<title>

            EDP Software -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      EDP Software Inc

Legal Name:

EDP Software Inc

Operating Name:

EDP Software

http://www.edpsoftware.com

spro@edpsoftware.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   101-887 Great Northern Way

                    VANCOUVER,

                    British Columbia

                  V5T 4T5

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   101-887 Great Northern Way

                    VANCOUVER,

                    British Columbia

                  V5T 4T5

                         </address>

Tel.:
		      (506) 454-7776

Tel.:
			      (877) 501-7776

Fax:

Logo

Company Profile

            EDP Software has been in business since 1981.  We have two products – SchedulePro, employee scheduling software (available in various editions) and JIS Pro, a court case management system.

Schedule Pro is a sophisticated yet easy-to-use automated employee scheduling software package.  This powerful system saves time, money and frustration.  It saves up to 80% in scheduling time costs and simplifies the scheduling process.  Please visit http://www.edpsoftware.com for more information.

JIS Pro is a proven Court Case Management System that is currently being used by all New Brunswick provincial courts.  It provides fast, simple access to data, and enhances productivity, accuracy & efficiency. By producing various forms and reports, case processing is accelerated.  Warrants, court dockets and many other forms can be printed with the touch of a button. Tracking of fines and restitutions reduces costs and increases revenue by ensuring collection of all outstanding balances.

JIS Pro improves the administration of justice through the creation and operation of a comprehensive integrated management information system. The JIS Pro system manages justice information using the latest in database and network technology.  Seamlessly integrating resources from several justice agencies, JIS Pro streamlines their coordination and communication work.  Please visit http://www.edpsoftware.com for more information.

EDP Software also specializing in the design and development of custom computer based information systems.  EDP Software has used the most sophisticated design techniques, methodologies and tools in developing systems for our clients.

Our specialties lay in the development of custom software solutions, legacy system conversion and information system consulting services.  We also specialize in the development of bilingual/multilingual systems.

We have a long list of customers who are very satisfied with our services.

				Full profile

				Full profile

				Contact information

                Anand
                Kishore

                  Title:

                President

                    Area of Responsibility:

                    Management Executive.

                  Telephone:

                (506) 454-7776

                    Email:

                  akishore@edpsoftware.com

  top of page

				Company description

            Country of Ownership:

              Canada

              Year Established:

            1981

            Exporting:

              Yes

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Alternate Industries (NAICS):

            511210 - Software Publishers

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Product Name:

                            SchedulePro (Staff Scheduling Software)

                            SchedulePro is available in Standard, Enterprise and Web editions.  Web edition is offered as a fully hosted service (SaaS).

This software is ideal for manufacturing, correctional institutions, EMS, nursing homes, hospitals, utility companies, fire departments, law enforcement agencies, 911, call centres, service companies such as restaurants, hotels stc.  Schedule Pro can export data file for your payroll package.  It prints large number of management reports to aid in cost analysis and forecasting.

SchedulePro is easy to use and very user friendly.  It can take care of your headaches associated with the preparation and maintenance of staff schedules.

Schedule Pro can operate in a multi-lingual environment.  Currently, it operates in English and French and user can change the language of operation at demand.  Other languages can be added.

Please visit http://www.edpsoftware.com or http://www.scheduelpeoweb.com  for more information.

                              Product Name:

                            Court Case Management System (JIS Pro)

                            JIS Pro improves the administration of justice through the creation and operation of a comprehensive integrated management information system. The JIS Pro system mamanges justice information using the latest in database and network technology.

Providing fast, simple access to data enhances productivity, accuracy and efficiency.  By producing various forms and reports, case processing is accelerated.

JIS Pro is a proven Case Management System that is currently being used by all New Brunswick provincial courts.  Based on the Windows platform and using client-server technology, JIS Pro provides a comprehensive solution for justice officials. With an easy to use interface, multi-lingual support, and a highly scalable architecture, JIS Pro is ideal for all justice institutions.

              FSC Code:

              7030-ADP Software

              D308-Programming Services

              D311-ADP Data Conversion Services

  top of page

					Technology profile

            EDP Software has extensive experience in the following

areas:

1. Legacy system conversion

2. Windows application development

3. Development of client/server systems

4. Oracle/SQL Server database

5. Microsoft Access for Windows

6. Visual Basic

7. Conversion of Clipper systems into MS Access or Visual Basic

8. COBOL on mainframe & Micro Focus COBOL on UNIX machines and

PCs

					Market profile

                        Alliances:

Sales/Marketing

Technology

                          Strategic alliances:

                        EDP is very much interested in forming alliances with companies

to market our products in their jurisdiction.  We are also open for

co-development of the products as well as investment for

marketing SchedulePro and JIS Pro.

                          Industry sector market interests:

Information Technology and Telecommunications

Manufacturing

Medical/Biotechnology/Chemical

Service Industry

              Geographic markets:

                  Export experience:

Australia

Panama

United States

California

Colorado

Connecticut

District of Columbia

Florida

Illinois

Maine

Maryland

Massachusetts

New Hampshire

New Jersey

New York

Ohio

Pennsylvania

Texas

Utah

Vermont

Virginia

Wisconsin

                  Actively pursuing:

Bermuda

France

Germany

India

Mexico

New Zealand

Sweden

Switzerland

Trinidad and Tobago

United Kingdom

Virgin Islands (British)

Virgin Islands (U.S.)

Alabama

Alaska

Arizona

Arkansas

Delaware

Georgia

Hawaii

Idaho

Indiana

Iowa

Kansas

Kentucky

Louisiana

Michigan

Minnesota

Mississippi

Missouri

Montana

Nebraska

Nevada

New Mexico

North Carolina

North Dakota

Oklahoma

Oregon

Rhode Island

South Carolina

South Dakota

Tennessee

Washington

West Virginia

Wyoming

  top of page

					Sector information

                Unique applications:

              <BR>

<BR>

                Key / Major clients:

              Ford Motor Company

Oil and Gas Refineries

Nuclear Power Generation

Province of Quebec Correctional facilities

EMC Data Domain

Province of New Brusnwick

Medavie Blue Cross

Ally Bank

Province of Ontario

Sodexo

Dept of Youth and Rehabilitation Services, Washington, DC

and many more such as hospitals, nursing homes, police & Fire etc.

                Success stories:

              Province of New Brunswick is using our JIS Pro since November 1999.  It has streamlined the record keeping in their provincial courts, easy tracking of criminal history, fine collection, monitoring of all financial data for bail, restitution, fine etc.

Medavie Blue Cross has been using SchedulePro since 2006 to manage the scheduling of about 2000 paramedics in Nova Scotia, New Brunswick, PEI and Ontario.  Now they have a very good control over their staffing as they can create the schedules very easitly, monitor staffing levels etc.  Finding a replacement paramedics is very easy according to all the union rules.

A Nuclear Power Plant has been using SchedulePro Since 2007 to manage the scheduling of their workforce.  Hours of work rules can be enforced as it was a nightmare to enforce them before this software.  Easily find replacement worker that would meet all the rules.

                Testimonial:

              "Schedule Pro has enabled us to standardize our scheduling processes across both Nova Scotia and New Brunswick. Between the two locations we have over 120 Bases and more than 2000 employees. Schedule Pro allows our staff to easily schedule according to the staffing needs of each area.  Filling of open shifts is performed easily allowing us to maintain the correct staffing levels.

Schedule Pro keeps track of the employees' vacation time, sick time, etc and provides management with employee statistics at their fingertips.

EDP Software has been very receptive to our specific scheduling needs and has adjusted the software accordingly.  We are very satisfied with the Schedule Pro product."

Jennifer Bevan

Business Analyst

Medavie EMS

The Department of Justice in New Brunswick had a very complex and specific requirements for a Provincial Court system.  The RFP submitted required the system to automate all processes within the Provincial Court and provide court orders, management reports, financial reports, and court reports for decision-making.  (…)  In summary, we are very satisfied with JIS Pro.

Rod MacKenzie Q.C.

Department of Justice

Province of New Brunswick

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Anand
                Kishore

                  Title:

                President

                    Area of Responsibility:

                    Management Executive.

                  Telephone:

                (506) 454-7776

                    Email:

                  akishore@edpsoftware.com

				Description

				Company description

            Country of Ownership:

              Canada

              Year Established:

            1981

            Exporting:

              Yes

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Alternate Industries (NAICS):

            511210 - Software Publishers

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Product Name:

                            SchedulePro (Staff Scheduling Software)

                            SchedulePro is available in Standard, Enterprise and Web editions.  Web edition is offered as a fully hosted service (SaaS).

This software is ideal for manufacturing, correctional institutions, EMS, nursing homes, hospitals, utility companies, fire departments, law enforcement agencies, 911, call centres, service companies such as restaurants, hotels stc.  Schedule Pro can export data file for your payroll package.  It prints large number of management reports to aid in cost analysis and forecasting.

SchedulePro is easy to use and very user friendly.  It can take care of your headaches associated with the preparation and maintenance of staff schedules.

Schedule Pro can operate in a multi-lingual environment.  Currently, it operates in English and French and user can change the language of operation at demand.  Other languages can be added.

Please visit http://www.edpsoftware.com or http://www.scheduelpeoweb.com  for more information.

                              Product Name:

                            Court Case Management System (JIS Pro)

                            JIS Pro improves the administration of justice through the creation and operation of a comprehensive integrated management information system. The JIS Pro system mamanges justice information using the latest in database and network technology.

Providing fast, simple access to data enhances productivity, accuracy and efficiency.  By producing various forms and reports, case processing is accelerated.

JIS Pro is a proven Case Management System that is currently being used by all New Brunswick provincial courts.  Based on the Windows platform and using client-server technology, JIS Pro provides a comprehensive solution for justice officials. With an easy to use interface, multi-lingual support, and a highly scalable architecture, JIS Pro is ideal for all justice institutions.

              FSC Code:

              7030-ADP Software

              D308-Programming Services

              D311-ADP Data Conversion Services

							Technology

							Technology profile

            EDP Software has extensive experience in the following

areas:

1. Legacy system conversion

2. Windows application development

3. Development of client/server systems

4. Oracle/SQL Server database

5. Microsoft Access for Windows

6. Visual Basic

7. Conversion of Clipper systems into MS Access or Visual Basic

8. COBOL on mainframe & Micro Focus COBOL on UNIX machines and

PCs

					Market

					Market profile

                        Alliances:

Sales/Marketing

Technology

                          Strategic alliances:

                        EDP is very much interested in forming alliances with companies

to market our products in their jurisdiction.  We are also open for

co-development of the products as well as investment for

marketing SchedulePro and JIS Pro.

                          Industry sector market interests:

Information Technology and Telecommunications

Manufacturing

Medical/Biotechnology/Chemical

Service Industry

              Geographic markets:

                  Export experience:

Australia

Panama

United States

California

Colorado

Connecticut

District of Columbia

Florida

Illinois

Maine

Maryland

Massachusetts

New Hampshire

New Jersey

New York

Ohio

Pennsylvania

Texas

Utah

Vermont

Virginia

Wisconsin

                  Actively pursuing:

Bermuda

France

Germany

India

Mexico

New Zealand

Sweden

Switzerland

Trinidad and Tobago

United Kingdom

Virgin Islands (British)

Virgin Islands (U.S.)

Alabama

Alaska

Arizona

Arkansas

Delaware

Georgia

Hawaii

Idaho

Indiana

Iowa

Kansas

Kentucky

Louisiana

Michigan

Minnesota

Mississippi

Missouri

Montana

Nebraska

Nevada

New Mexico

North Carolina

North Dakota

Oklahoma

Oregon

Rhode Island

South Carolina

South Dakota

Tennessee

Washington

West Virginia

Wyoming

					Sector

					Sector information

                Unique applications:

              <BR>

<BR>

                Key / Major clients:

              Ford Motor Company

Oil and Gas Refineries

Nuclear Power Generation

Province of Quebec Correctional facilities

EMC Data Domain

Province of New Brusnwick

Medavie Blue Cross

Ally Bank

Province of Ontario

Sodexo

Dept of Youth and Rehabilitation Services, Washington, DC

and many more such as hospitals, nursing homes, police & Fire etc.

                Success stories:

              Province of New Brunswick is using our JIS Pro since November 1999.  It has streamlined the record keeping in their provincial courts, easy tracking of criminal history, fine collection, monitoring of all financial data for bail, restitution, fine etc.

Medavie Blue Cross has been using SchedulePro since 2006 to manage the scheduling of about 2000 paramedics in Nova Scotia, New Brunswick, PEI and Ontario.  Now they have a very good control over their staffing as they can create the schedules very easitly, monitor staffing levels etc.  Finding a replacement paramedics is very easy according to all the union rules.

A Nuclear Power Plant has been using SchedulePro Since 2007 to manage the scheduling of their workforce.  Hours of work rules can be enforced as it was a nightmare to enforce them before this software.  Easily find replacement worker that would meet all the rules.

                Testimonial:

              "Schedule Pro has enabled us to standardize our scheduling processes across both Nova Scotia and New Brunswick. Between the two locations we have over 120 Bases and more than 2000 employees. Schedule Pro allows our staff to easily schedule according to the staffing needs of each area.  Filling of open shifts is performed easily allowing us to maintain the correct staffing levels.

Schedule Pro keeps track of the employees' vacation time, sick time, etc and provides management with employee statistics at their fingertips.

EDP Software has been very receptive to our specific scheduling needs and has adjusted the software accordingly.  We are very satisfied with the Schedule Pro product."

Jennifer Bevan

Business Analyst

Medavie EMS

The Department of Justice in New Brunswick had a very complex and specific requirements for a Provincial Court system.  The RFP submitted required the system to automate all processes within the Provincial Court and provide court orders, management reports, financial reports, and court reports for decision-making.  (…)  In summary, we are very satisfied with JIS Pro.

Rod MacKenzie Q.C.

Department of Justice

Province of New Brunswick

    Last Update Date 2016-06-15

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>