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

using System.Configuration;
using System.Linq;
using AzureUtilities.Storage;
using ConcreteDataStore;
using DataAccessLayer;
using Diagnostics;
using Microsoft.Practices.Unity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Queuing;
using Queuing.Azure;
using RuntimeIoc.WebRole;
using TestUtilities;
using Utilities.IdentityFederation;
using Utilities.Storage;

namespace RuntimeIoc.WebRole.IntegrationTests
{
    ///
    /// Test fixture for default Lucy UnityContainer
    ///
    [TestClass]
    public class RuntimeIocContainerFixture
    {
        /// Singleton instance of IOC container
        private static IUnityContainer container;

        /// One time initialization for all tests in fixture.
        /// <param name="context">The context.</param>
        [AssemblyInitialize]
        public static void FixtureAssemblyInitialize(TestContext context)
        {
            ConfigurationManager.AppSettings["Index.ConnectionString"] = "SomeConnectionString";
            ConfigurationManager.AppSettings["Entity.ConnectionString"] = "SomeConnectionString";
            ConfigurationManager.AppSettings["Queue.WorkItemStoreName"] = "someaddress";
            ConfigurationManager.AppSettings["Logging.BlobContainer"] = "quotalogs";
            ConfigurationManager.AppSettings["Logging.RootPath"] = "quotalogs";
            ConfigurationManager.AppSettings["Logging.MaximumSizeInMegabytes"] = "1024";
            ConfigurationManager.AppSettings["Logging.ScheduledTransferPeriodMinutes"] = "5";
            ConfigurationManager.AppSettings["Testing.HttpHeaderClaimOverrides"] = "false";
            ConfigurationManager.AppSettings["AppNexus.IsApp"] = "false";

            // Start up azure storage emulator
            // This is required for classes that create persistent dictionaries during initialization
            var emulatorRunnerPath = ConfigurationManager.AppSettings["AzureEmulatorExe"];
            AzureEmulatorHelper.StartStorageEmulator(emulatorRunnerPath);

            container = RuntimeIocContainer.Instance;
        }

        /// Verify singleton behavior.
        [TestMethod]
        public void IocContainerIsSingleton()
        {
            var newContainer = RuntimeIocContainer.Instance;

            Assert.AreSame(container, newContainer);
        }

        /// Verify object resolutions mappings are correct.
        [TestMethod]
        public void IocContainerMappings()
        {
            // ILogger
            var quotaLogger = container.Resolve<ILogger>("QuotaLogger");
            Assert.IsInstanceOfType(quotaLogger, typeof(QuotaLogger));
            var traceLogger = container.Resolve<ILogger>("TraceLogger");
            Assert.IsInstanceOfType(traceLogger, typeof(TraceLogger));
            LogManager.Initialize(container.ResolveAll<ILogger>());

            // IIndexStoreFactory
            var defaultIndexStoreFactory = container.Resolve<IIndexStoreFactory>();
            Assert.IsInstanceOfType(defaultIndexStoreFactory, typeof(SqlIndexStoreFactory));

            // IEntityStoreFactory
            var defaultEntityStoreFactory = container.Resolve<IEntityStoreFactory>();
            Assert.IsInstanceOfType(defaultEntityStoreFactory, typeof(AzureEntityStoreFactory));

            // IKeyRuleFactory
            var defaultKeyRuleFactory = container.Resolve<IKeyRuleFactory>();
            Assert.IsInstanceOfType(defaultKeyRuleFactory, typeof(KeyRuleFactory));

            // IStorageKeyFactory
            var defaultStorageKeyFactory = container.Resolve<IStorageKeyFactory>();
            Assert.IsInstanceOfType(defaultStorageKeyFactory, typeof(AzureStorageKeyFactory));

            // IBlobStoreFactory
            var defaultBlobStoreFactory = container.Resolve<IBlobStoreFactory>();
            Assert.IsInstanceOfType(defaultBlobStoreFactory, typeof(AzureBlobStoreFactory));

            // IEntityRepository
            var defaultEntityRepository = container.Resolve<IEntityRepository>();
            Assert.IsInstanceOfType(defaultEntityRepository, typeof(ConcreteEntityRepository));

            // IUserAccessStoreFactory
            var defaultUserAccessStoreFactory = container.Resolve<IUserAccessStoreFactory>();
            Assert.IsInstanceOfType(defaultUserAccessStoreFactory, typeof(SqlUserAccessStoreFactory));

            // IUserAccessRepository
            var defaultUserAccessRepository = container.Resolve<IUserAccessRepository>();
            Assert.IsInstanceOfType(defaultUserAccessRepository, typeof(ConcreteUserAccessRepository));

            // ICategorizedAzureQueue
            var defaultCategorizedQueue = container.Resolve<ICategorizedQueue>();
            Assert.IsInstanceOfType(defaultCategorizedQueue, typeof(CategorizedAzureQueue));

            // IPersistentDictionary Factories
            var defaultPersistentDictionaryFactories = container.ResolveAll<IPersistentDictionaryFactory>();
            Assert.AreEqual(2, defaultPersistentDictionaryFactories.Count());
            Assert.IsNotNull(defaultPersistentDictionaryFactories.SingleOrDefault(d => d.DictionaryType == PersistentDictionaryType.Cloud));
            Assert.IsNotNull(defaultPersistentDictionaryFactories.SingleOrDefault(d => d.DictionaryType == PersistentDictionaryType.Sql));

            // IQueuer
            var defaultQueuer = container.Resolve<IQueuer>();
            Assert.IsInstanceOfType(defaultQueuer, typeof(Queue));

            // IClaimRetriever
            var defaultClaimRetriever = container.Resolve<IClaimRetriever>();
            Assert.IsInstanceOfType(defaultClaimRetriever, typeof(HttpContextClaimRetriever));
        }
    }
}


text:
// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="Akka.NET Project">
//      Copyright (C) 2013 - 2020 .NET Foundation <https://github.com/akkadotnet/hocon>
// </copyright>
// -----------------------------------------------------------------------

using System;
using Hocon;

namespace SimpleSubstitutions
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var hocon = @"
root {
  some-value = ""Hello""
  simple-string = ${root.some-value} ""Hocon""
}
";
            var config = HoconParser.Parse(hocon);
            var val = config.GetString("root.simple-string");
            Console.WriteLine("Hocon says: " + val);
            Console.ReadKey();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
layout: post-en
title: PPLAAF: Genuine efforts of Nigerian parliamentarians to protect whistleblowers welcomed
excerpt_separator:
image: pressrelease.png
excerpt: PPLAAF participated to a two-days stakeholders' seminar on whistleblowing and legal protection.
introduction: PPLAAF participated to a two-days stakeholders' seminar on whistleblowing and legal protection.
tag: [pressrelease]
---

(Abuja, June 15th, 2017) – Discussions conducted in the Nigerian House of Representatives between parliamentarians, stakeholders, civil society organizations and journalists are a genuine move toward adopting a progressive bill to protect whistleblowers, said [PPLAAF](https://pplaaf.org) (Platform to Protection Whistleblowers in Africa) today in Abuja.

Three representatives of PPLAAF were invited on June 13th and 14th by Honorable [Kayode Oladele](https://en.wikipedia.org/wiki/Kayode_Oladele), Chairman of the House of Representatives Committee on Financial Crimes, and [Olanrewaju Suraju](https://twitter.com/larryk371), President of the HEDA Resources Center, to introduce to the audience the international guidelines to protect whistleblowers.

_"I have the honor to express my profound gratitude to the participants who have deemed it fit to register their presence here today to contribute to the fashioning out of robust legal frameworks to shape Nigeria's anti-corruption efforts"_, declared Honorable Kayode Oladele at the opening of the seminar.

PPLAAF welcomes the efforts of the organizer of the conference and of the parliamentarians to have sought comments and expertise of the civil society organizations in order to draft a progressive bill before it being discussed by the House of Representatives.

_"Rarely have I seen so much interest from so many diverse people into building an efficient bill to protect whistleblowers"_, said [William Bourdon](https://pplaaf.org/who-we-are.html), Chairman of PPLAAF. _"The debates were of a very high level and PPLAAF teams are ready to support and help legislation aiming at helping these watchdogs of democracy who are desperately in need for help"_.

PPLAAF has been working with Nigerian civil society organizations in drafting a whistleblower protection bill project. This project's goals were to consolidate and merge two existing bills, to propose a largely amenable bill to respect local context, politics and environment and to elaborate a structure to protect whistleblowers which will not be capital intensive.

For PPLAAF, a genuine bill to protect whistleblowers must integrate the following fundamentals:

-	Consider public and private sectors as well as the non-profit sector,
-	Wide range of offenses that can be disclosed,
-	Coverage for all types of "employees" and "workers",
-	Legal protection from all forms of retaliation,
-	Access to secure internal and external disclosure channels,
-	Follow-up investigation of disclosures and retaliation,
-	Wide range of remedies for retaliation,
-	Public access to case outcomes, process and data,
-	Penalties for violations,
-	Address disclosures related to national security, official or military secrets and classified information.

All these requirements were included in the bill drafted by PPLAAF. PPLAAF will keep on working with its Nigerian partners to insure, at every step of the legislative process, that they remain as such.

[PPLAAF](https://pplaaf.org/faq.html) is a Senegalese NGO which was created in March 2017 to provide the full spectrum of needs catered specifically to whistleblowers: end-to-end encryption communication, free legal advice and legal representation, designed assistance with the press and research and advocacy to help authorities to adopt strong laws to protect whistleblowers.


text:
package com.fix.agent.commands;

import com.fix.agent.commands.common.Command;
import com.fix.agent.commands.common.PackageConstant;
import com.fix.agent.exceptions.CommandEndedAbnormallyException;
import com.fix.common.domain.configs.PackageConfig;
import com.fix.common.utils.PackageConfigParserUtil;

import java.nio.file.Paths;

/**
 * Created by OELABED on 08/10/2017.
 */
public class PreparePackageFolderCommand extends Command {

    private PackageConfig config;

    private String configFolderName;

    public PreparePackageFolderCommand(PackageConfig config, String configFolderName, String basePath) {
        super(basePath);
        this.config = config;
        this.configFolderName = configFolderName;

    }

    @Override
    public void execute() throws CommandEndedAbnormallyException {

        try {

            CommonTasks.createFolder(this.basePath);
            // create Settings.yml file
            CommonTasks.createFile(this.basePath, PackageConstant.FILE_CONFIG_NAME, PackageConfigParserUtil.serializePackageConfigToYamlFile(this.config));

            // create .tail folder
            CommonTasks.createFolder(Paths.get(this.basePath, PackageConstant.TAIL_FOLDER_NAME).toString());

            // create .tail folder
            CommonTasks.createFolder(Paths.get(this.basePath, this.configFolderName).toString());

        } catch (Exception exception) {
            throw new CommandEndedAbnormallyException(PreparePackageFolderCommand.class.getName(), "failed to create and prepare package folder", exception);
        }

    }
}


text:
namespace Homebase.Business.Services.Interfaces
{
    public interface IActionExecutor
    {
        void Execute();
    }
}


text:
import os

from setuptools import setup, find_packages

long_description = 'Baler is a tool that makes it easy to bundle and use resources (images, strings files, etc.) in a compiled static library.'
if os.path.exists('README.rst'):
    long_description = open('README.rst').read()

if os.path.exists('LICENSE'):
    license = open('LICENSE').read()

setup(name='baler',
      version='1.0.3',
      description='Bundle assets into iOS static libraries',
      long_description=long_description,
      keywords=['ios', 'objective-c', 'generation', 'static', 'resource', 'NSBundle', 'mobile'],
      author='PayPal SDK Team',
      author_email='brfitzgerald@paypal.com, jbleechersnyder@paypal.com',
      url='https://github.com/paypal/baler',
      scripts=['bale'],
      packages=find_packages(),
      package_dir={'baler': 'baler'},
      package_data={'baler': ['templates/*.j2']},
      license=license,
      install_requires=[
          'Jinja2 >= 2.6',
          'argparse >= 1.1',
          'biplist >= 0.5',
          'six >= 1.2.0',
          'wsgiref >= 0.1.2',
      ])


text:
<ion-view view-title="Groups" class="group-view">
    <ion-content>
        <ion-refresher pulling-text="Pull to refresh..." on-refresh="doRefresh()"></ion-refresher>
        <ion-list>
            <ion-item class="item item-divider">
                Number of groups : {{groups.length}}
            </ion-item>
            <ion-item class="item item-avatar item-icon-left item-icon-right" ng-repeat="group in groups" type="item-text-wrap"
                      href="#/tab/groups/{{group.id}}">

{{group.displayName}}

Domains : {{group.realmNbr}}

Members : {{group.userNbr}}

Permissions : {{group.permissionNbr}}

            </ion-item>
        </ion-list>
    </ion-content>
</ion-view>


text:
<?php

namespace Preferans\Oauth\Tests\Server\ResponseTypes;

use Preferans\Oauth\Entities\AccessTokenEntityInterface;
use Preferans\Oauth\Server\ResponseType\BearerTokenResponse;

class BearerTokenResponseWithParams extends BearerTokenResponse
{
    protected function getExtraParams(AccessTokenEntityInterface $accessToken)
    {
        return ['foo' => 'bar', 'token_type' => 'Should not overwrite'];
    }
}


text:
layout: archive
permalink: /models/
title: "EPN 5.0 Models and Configurations"
author_profile: true
author: "Cisco EPN Team"
---

{% include base_path %}

Service Yang Models

    <colgroup>
        <col width="70%" />
        <col width="30%" />
    </colgroup>

            NSO Service Models
            Download Link

            EPN 5.0 NSO Service Models and Packages
            Contact Account Team

Configurations

    <colgroup>
        <col width="70%" />
        <col width="30%" />
    </colgroup>

            Configuration
            Download Link

            EPN 5.0 Deployment Models and Configurations
            Contact Account Team


text:
<?php
    defined('BASEPATH') OR exit('No direct script access allowed');
?>

Outreach

School Wide Initiative

            Our team has had great opportunities to share robotics with other students this year. For example, the R2DTools presented at our school's STEM night where they demonstrated for other students how to build and drive the robots.  The R2DTools have also shared their experiences in robotics with the third grade and kindergarten classes at their school.


text:
require 'benchmark'
require 'English'

class Job::Service
  extend SS::Translation
  include SS::Document
  include SS::Task::Model

  attr_accessor :config

  DEFAULT_LOG_LEVEL = Logger::INFO

  class << self
    public
      def run(config = nil)
        config ||= SS.config.job.default
        with_lock(config) do |service|
          service.config = config
          service.run
        end
      end

    private
      def with_lock(config)
        model = config['model']
        num_workers = config["num_workers"]
        service = acquire_lock(model, num_workers == 0 ? 1 : num_workers)
        return unless service

        begin
          return yield service
        ensure
          release_lock(model)
        end
      end

      def acquire_lock(name, limits)
        # ensure that service is existed.
        service_id = Job::Service.find_or_create_by(name: name).id

        # increment atomically
        criteria = Job::Service.where(id: service_id)
        service = criteria.find_and_modify({ '$inc' => { current_count: 1 } }, new: true)
        if service.current_count > limits
          # already started a service
          Rails.logger.debug("already started a service")
          release_lock(name)
          return nil
        end

        if service.current_count == 1
          service.state = "running"
          service.started = Time.now
          service.save
        end

        service
      end

      def release_lock(name)
        service_id = Job::Service.find_or_create_by(name: name).id

        # decrement atomically
        criteria = Job::Service.where(id: service_id)
        criteria = criteria.gt(current_count: 0)
        service = criteria.find_and_modify({ '$inc' => { current_count: -1, total_count: 1 }}, new: true)
        if service && service.current_count == 0
          service.state = "stop"
          service.closed = Time.now
          service.save
        end
        service
      end
  end

  public
    def run
      open_logger
      begin
        execute_loop
      ensure
        close_logger
      end
    end

  private
    def execute_loop
      with_task do |task, job_log|
        begin
          Rails.logger.info("Started Job #{task.id}")
          job_log.state = "running"
          job_log.started = Time.now
          job_log.save

          time = Benchmark.realtime do
            job = create_job(task)
            job.call *(task.args)
          end

          job_log.state = "completed"
          job_log.closed = Time.now
          Rails.logger.info("Completed Job #{task.id} in #{time * 1000} ms")
        rescue Exception => e
          job_log.state = "failed"
          job_log.closed = Time.now
          Rails.logger.fatal("Failed Job #{task.id}: #{e.class} (#{e.message}):\n  #{e.backtrace.join('\n  ')}")
          raise if system_error?(e)
        end
      end
    end

    def system_error?(e)
      e.kind_of?(NoMemoryError) || e.kind_of?(SignalException) || e.kind_of?(SystemExit) || e.kind_of?(fatal)
    end

    def create_job(task)
      return task.class_name.constantize.new
    end

    def open_logger
      unless config["log_file"].blank?
        @logger = ::Logger.new(File.expand_path(config["log_file"], Rails.root))
        @logger.level = log_level
        Rails.logger.extend(ActiveSupport::Logger.broadcast(@logger))
      end
    end

    def close_logger
      @logger.close if @logger
    end

    def dequeue_task
      config["poll"].each do |queue_name|
        task = Job::Model.dequeue(queue_name)
        return task if task
      end

      nil
    end

    def with_task
      loop do
        task = dequeue_task
        break unless task

        begin
          with_job_log task do |job_log|
            yield task, job_log
          end
        ensure
          task.delete
        end
      end

      nil
    end

    def with_job_log(task)
      job_log = Job::Log.add(task)
      begin
        with_task_logger job_log do
          yield job_log
        end
      ensure
        job_log.save
      end
    end

    def with_task_logger(task)
      unless @task_logger
        @task_logger = Job::TaskLogger.new
        @task_logger.level = log_level
        Rails.logger.extend ActiveSupport::Logger.broadcast(@task_logger)
      end
      @task_logger.task = task

      begin
        return yield task
      ensure
        @task_logger.task = nil
      end
    end

    def log_level
      case config["log_level"]
      when /fatal/i then
        Logger::FATAL
      when /error/i then
        Logger::ERROR
      when /warn/i then
        Logger::WARN
      when /info/i then
        Logger::INFO
      when /debug/i then
        Logger::DEBUG
      else
        DEFAULT_LOG_LEVEL
      end
    end
end


text:
var Site    = require("../models/landingsite"),
    Comment = require("../models/comment")

var middleware = {

isLoggedIn: function(request, response, next){
                if(request.isAuthenticated()){
                    return next()
                } else {
                    request.flash("error", "You must be logged in to do that.")
                    response.redirect("/login")
                }
            },

isSiteAuthor:   function(request, response, next){
                    if(request.isAuthenticated()){
                        Site.findById(request.params.id, function(error, foundSite){
                            if(error){
                                console.log(error)
                                request.flash("error", "Error accessing landing site, please try again.")
                                response.redirect("back")
                            } else {
                                if(foundSite.author.id.equals(request.user._id)){
                                    next()
                                } else {
                                    request.flash("error", "Only the person who posted this Landing Site may do that.")
                                    response.redirect("/landingsites/" + request.params.id)
                                }
                            }
                        })
                    } else {
                        request.flash("error", "You must be logged in to do that.")
                        response.redirect("/login")
                    }
                },

isCommentAuthor:    function(request, response, next){
                        if(request.isAuthenticated()){
                            Comment.findById(request.params.commentID, function(error, foundComment){
                                if(error){
                                    console.log(error)
                                    request.flash("error", "There was an error accessing that comment, please try again.")
                                    response.redirect("/landingsites" + request.params.id)
                                } else {
                                    if(foundComment.author.id.equals(request.user._id)){
                                        next()
                                    } else {
                                        request.flash("error", "Only the comment's author may do that.")
                                        response.redirect("back")
                                    }
                                }
                            })
                        } else {
                            request.flash("error", "You must be logged in to do that.")
                            response.redirect("/login")
                        }
                    }

}

module.exports = middleware


text:
package net.nyvaria.openanalytics.bukkit.listener;

import net.nyvaria.openanalytics.bukkit.OpenAnalytics;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerQuitEvent;

/**
 * @author Paul Thompson
 */
public final class OpenAnalyticsListener implements Listener {
    private final OpenAnalytics plugin;

    public OpenAnalyticsListener(OpenAnalytics plugin) {
        Validate.notNull(plugin, "OpenAnalyticsListener cannot have a null plugin");
        this.plugin = plugin;
        Bukkit.getPluginManager().registerEvents(this, this.plugin);
    }

    @EventHandler(priority = EventPriority.MONITOR)
    public void onPlayerJoin(PlayerJoinEvent event) {
        plugin.getClientList().put(event.getPlayer());
        plugin.getTracker().trackPlayerJoin(plugin.getClientList().get(event.getPlayer()));
    }

    @EventHandler(priority = EventPriority.MONITOR)
    public void onPlayerQuit(PlayerQuitEvent event) {
        //When a PlayerQuitEvent is called following a PlayerKickEvent, we do not want to do this
        if (plugin.getClientList().containsKey(event.getPlayer())) {
            plugin.getTracker().trackPlayerQuit(plugin.getClientList().get(event.getPlayer()));
            plugin.getClientList().remove(event.getPlayer());
        }
    }

    @EventHandler(priority = EventPriority.MONITOR)
    public void onPlayerKick(PlayerKickEvent event) {
        plugin.getTracker().trackPlayerKick(plugin.getClientList().get(event.getPlayer()));
        plugin.getClientList().remove(event.getPlayer());
    }

    @EventHandler(priority = EventPriority.MONITOR)
    public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
        plugin.getTracker().trackPlayerChangedWorld(plugin.getClientList().get(event.getPlayer()));
    }
}


text:
import { Command, SpriteMultipleSettings, SpriteSingles } from "./types";

/**
 * Which direction a sprite is drawing in.
 */
export type ISpriteDirection = "corners" | "horizontal" | "vertical";

/**
 * Common pattern to all patterns: just the middle.
 */
export interface IBasicPatterns {
    /**
     * A middle canvas to draw.
     */
    middle?: CanvasPattern;
}

/**
 * Patterns to be drawn in a horizontal direction.
 */
export interface IHorizontalPatterns extends IBasicPatterns {
    /**
     * Direction to draw patterns in.
     */
    direction: "horizontal";

    /**
     * A left canvas to draw.
     */
    left?: CanvasPattern;

    /**
     * A right canvas to draw.
     */
    right?: CanvasPattern;
}

/**
 * Patterns to be drawn in a horizontal direction.
 */
export interface IVerticalPatterns extends IBasicPatterns {
    /**
     * Direction to draw patterns in.
     */
    direction: "vertical";

    /**
     * A left canvas to draw.
     */
    bottom?: CanvasPattern;

    /**
     * A right canvas to draw.
     */
    top?: CanvasPattern;
}

export interface ICornersPatterns extends IBasicPatterns {
    /**
     * Direction to draw patterns in.
     */
    direction: "corners";

    /**
     * A middle canvas to draw.
     */
    top?: CanvasPattern;

    /**
     * A right canvas to draw.
     */
    right?: CanvasPattern;

    /**
     * A bottom canvas to draw.
     */
    bottom?: CanvasPattern;

    /**
     * A left canvas to draw.
     */
    left?: CanvasPattern;

    /**
     * A top-right canvas to draw.
     */
    topRight?: CanvasPattern;

    /**
     * A bottom-right canvas to draw.
     */
    bottomRight?: CanvasPattern;

    /**
     * A bottom-left canvas to draw.
     */
    bottomLeft?: CanvasPattern;

    /**
     * A top-left canvas to draw.
     */
    topLeft?: CanvasPattern;
}

/**
 * For Actors with multiple sprites, the various sprite component canvases.
 */
export type IDirectionalPatterns = ICornersPatterns | IHorizontalPatterns | IVerticalPatterns;

/**
 * Container for multiple child sprites.
 */
export class SpriteMultiple {
    /**
     * Storage for each internal sprite, keyed by container.
     */
    public readonly sprites: SpriteSingles;

    /**
     * The direction of sprite, such as "horizontal".
     */
    public readonly direction: ISpriteDirection;

    /**
     * How many pixels tall the top section is, if it exists.
     */
    public readonly topHeight: number;

    /**
     * How many pixels wide the right section is, if it exists.
     */
    public readonly rightWidth: number;

    /**
     * How many pixels tall the bottom section is, if it exists.
     */
    public readonly bottomHeight: number;

    /**
     * How many pixels wide the left section is, if it exists.
     */
    public readonly leftWidth: number;

    /**
     * Whether the middle section should be stretched to fill the remaining
     * space instead of filling as a pattern.
     */
    public readonly middleStretch: boolean;

    /**
     * Canvases with the rendered sprite, once created.
     */
    private patterns: IDirectionalPatterns | undefined;

    /**
     * Initializes a new instance of the SpriteMultiple class.
     *
     * @param sprites   Data for each sprite to import, keyed by container.
     * @param sourceCommand    The original raw command that generated this sprite.
     */
    public constructor(sprites: SpriteSingles, sourceCommand: Command) {
        const sources: SpriteMultipleSettings = sourceCommand[2];

        this.sprites = sprites;
        this.direction = sourceCommand[1];

        if (this.direction === "vertical" || this.direction === "corners") {
            this.topHeight = (sources.topHeight ?? 0) | 0;
            this.bottomHeight = (sources.bottomHeight ?? 0) | 0;
        }

        if (this.direction === "horizontal" || this.direction === "corners") {
            this.rightWidth = (sources.rightWidth ?? 0) | 0;
            this.leftWidth = (sources.leftWidth ?? 0) | 0;
        }

        this.middleStretch = sources.middleStretch ?? false;
    }

    /**
     * Gets canvases for the rendered sprite, creating it if it didn't already exist.
     *
     * @param context   ???
     * @param width   Width of the canvas.
     * @param height   Height of the canvas.
     * @returns A canvas with the rendered sprite.
     */
    public getPatterns(
        context: CanvasRenderingContext2D,
        width: number,
        height: number
    ): IDirectionalPatterns {
        if (!this.patterns) {
            this.patterns = this.createPatterns(context, width, height);
        }

        return this.patterns;
    }

    /**
     * Creates canvases for the rendered sprite.
     *
     * @param context   ???
     * @param width   Width of the canvas.
     * @param height   Height of the canvas.
     * @returns A canvas with the rendered sprite.
     */
    private createPatterns(
        context: CanvasRenderingContext2D,
        width: number,
        height: number
    ): IDirectionalPatterns {
        const patterns: IDirectionalPatterns = {
            direction: this.direction,
        };

        for (const i in this.sprites) {
            patterns[i as keyof Omit<IDirectionalPatterns, "direction">] = this.sprites[
                i
            ].getPattern(context, width, height);
        }

        return patterns;
    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Helminthosporium eragrostielli A.P. Misra

### Remarks
null


text:
package thahn.java.agui.content;

import javax.security.auth.login.Configuration;

/**
 * The set of callback APIs that are common to all application components
 * ({@link android.app.Activity}, {@link android.app.Service},
 * {@link ContentProvider}, and {@link android.app.Application}).
 */
public interface ComponentCallbacks {
    /**
     * Called by the system when the device configuration changes while your
     * component is running.  Note that, unlike activities, other components
     * are never restarted when a configuration changes: they must always deal
     * with the results of the change, such as by re-retrieving resources.
     *
     *
At the time that this function has been called, your Resources
     * object will have been updated to return resource values matching the
     * new configuration.
     *
     * @param newConfig The new device configuration.
     */
//    void onConfigurationChanged(Configuration newConfig);

    /**
     * This is called when the overall system is running low on memory, and
     * would like actively running process to try to tighten their belt.  While
     * the exact point at which this will be called is not defined, generally
     * it will happen around the time all background process have been killed,
     * that is before reaching the point of killing processes hosting
     * service and foreground UI that we would like to avoid killing.
     *
     *
Applications that want to be nice can implement this method to release
     * any caches or other unnecessary resources they may be holding on to.
     * The system will perform a gc for you after returning from this method.
     */
    void onLowMemory();
}


text:
@implementation JasonComponent
+ (UIView *)build: (UIView*)component withJSON: (NSDictionary *)json withOptions: (NSDictionary *)options{
    // Override this
    return [[UIView alloc] init];
}
+ (void) stylize: (NSDictionary *)json component: (UIView *)component{
    NSDictionary *style = json[@"style"];
    if(style){
        // background
        if([component respondsToSelector:@selector(backgroundColor)]){
            if(style && style[@"background"]){
                NSString *colorHex = style[@"background"];
                if(colorHex){
                    component.backgroundColor = [JasonHelper colorwithHexString:colorHex alpha:1.0];
                } else {
                    component.backgroundColor = [UIColor clearColor];
                }
            } else {
                component.backgroundColor = [UIColor clearColor];
            }
        }

        // opacity
        if([component respondsToSelector:@selector(alpha)]){
            if(style && style[@"opacity"]){
                CGFloat opacity = [style[@"opacity"] floatValue];
                component.alpha = opacity;
            } else {
                component.alpha = 1.0;
            }
        }

        // color
        if(style[@"color"]){
            UIColor *color = [JasonHelper colorwithHexString:style[@"color"] alpha:1.0];
            if([component respondsToSelector:@selector(textColor)]){
                [component setValue:color forKey:@"textColor"];
            }else if([component respondsToSelector:@selector(tintColor)]){
                [component setValue:color forKey:@"tintColor"];
            }
        }

        // width
        if(style[@"width"]){
            NSString *widthStr = style[@"width"];
            CGFloat width = [JasonHelper pixelsInDirection:@"horizontal" fromExpression:widthStr];

            // Look for any width constraint
            NSLayoutConstraint *constraint_to_update = nil;
            for(NSLayoutConstraint *constraint in component.constraints){
                if([constraint.identifier isEqualToString:@"width"]){
                    constraint_to_update = constraint;
                    break;
                }
            }

            // if the width constraint exists, we just update. Otherwise create and add.
            if(constraint_to_update){
                constraint_to_update.constant = width;
            } else {
                NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:component
                                                                              attribute:NSLayoutAttributeWidth
                                                                              relatedBy:NSLayoutRelationEqual
                                                                                toItem:nil
                                                                              attribute:NSLayoutAttributeNotAnAttribute
                                                                             multiplier:1.0
                                                                               constant:width];
                constraint.identifier = @"width";
                [component addConstraint:constraint];
            }
            [component setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
            [component setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }

        // height
        if(style[@"height"]){
            NSString * heightStr = style[@"height"];
            CGFloat height = [JasonHelper pixelsInDirection:@"vertical" fromExpression:heightStr];

            // Look for any height constraint
            NSLayoutConstraint *constraint_to_update = nil;
            for(NSLayoutConstraint *constraint in component.constraints){
                if([constraint.identifier isEqualToString:@"height"]){
                    constraint_to_update = constraint;
                    break;
                }
            }

            // if the height constraint exists, we just update. Otherwise create and add.
            if(constraint_to_update){
                constraint_to_update.constant = height;
            } else {
                NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:component
                                                                              attribute:NSLayoutAttributeHeight
                                                                              relatedBy:NSLayoutRelationEqual
                                                                                toItem:nil
                                                                              attribute:NSLayoutAttributeNotAnAttribute
                                                                             multiplier:1.0
                                                                               constant:height];
                constraint.identifier = @"height";
                [component addConstraint:constraint];
            }
            [component setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
            [component setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
        }

        // corner radius
        if(style[@"corner_radius"]){
            CGFloat radius = [style[@"corner_radius"] floatValue];
            component.layer.cornerRadius = radius;
            component.clipsToBounds = YES;
        } else {
            component.layer.cornerRadius = 0;
        }

        // border width
        if(style[@"border_width"]){
            CGFloat borderWidth = [style[@"border_width"] floatValue];
            component.layer.borderWidth = borderWidth;
        } else {
            component.layer.borderWidth = 0;
        }

        // border color
        if(style[@"border_color"]){
            UIColor *color = [JasonHelper colorwithHexString:style[@"border_color"] alpha:1.0];
            component.layer.borderColor = color.CGColor;
        } else {
            component.layer.borderColor = nil;
        }

        // text styling
    }
    [self stylize:json text:component];

}
+ (void)stylize:(NSDictionary *)json text:(UIView *)el{
    NSDictionary *style = json[@"style"];
    if(style){

        // Alignment
        if(style[@"align"]){
            NSDictionary *alignment_map = @{
                                            @"left": @(NSTextAlignmentLeft),
                                            @"center": @(NSTextAlignmentCenter),
                                            @"right": @(NSTextAlignmentRight),
                                            @"justified": @(NSTextAlignmentJustified),
                                            @"natural": @(NSTextAlignmentNatural)
                                            };

            if([el respondsToSelector:@selector(textAlignment)]){
                NSTextAlignment align = [alignment_map[style[@"align"]] intValue];
                if([el isKindOfClass:[UITextView class]]){
                    ((UITextView *)el).textAlignment = align;
                } else if([el isKindOfClass:[UITextField class]]){
                    ((UITextField *)el).textAlignment = align;
                } else if([el isKindOfClass:[UILabel class]]){
                    ((UILabel *)el).textAlignment = align;
                }
            }
        }

        if(style[@"autocorrect"]){
            if([el isKindOfClass:[UITextView class]]){
                ((UITextView *)el).autocorrectionType = UITextAutocorrectionTypeYes;
            }
            if([el isKindOfClass:[UITextField class]]){
                ((UITextField *)el).autocorrectionType = UITextAutocorrectionTypeYes;
            }
        } else {
            if([el isKindOfClass:[UITextView class]]){
                ((UITextView *)el).autocorrectionType = UITextAutocorrectionTypeNo;
            }
            if([el isKindOfClass:[UITextField class]]){
                ((UITextField *)el).autocorrectionType = UITextAutocorrectionTypeNo;
            }
        }

        if(style[@"autocapitalize"]){
            if([el isKindOfClass:[UITextView class]]){
                ((UITextView *)el).autocapitalizationType = UITextAutocapitalizationTypeSentences;
            }
            if([el isKindOfClass:[UITextField class]]){
                ((UITextField *)el).autocapitalizationType = UITextAutocapitalizationTypeSentences;
            }
        } else {
            if([el isKindOfClass:[UITextView class]]){
                ((UITextView *)el).autocapitalizationType = UITextAutocapitalizationTypeNone;
            }
            if([el isKindOfClass:[UITextField class]]){
                ((UITextField *)el).autocapitalizationType = UITextAutocapitalizationTypeNone;
            }
        }

        if(style[@"spellcheck"]){
            if([el isKindOfClass:[UITextView class]]){
                ((UITextView *)el).spellCheckingType = UITextSpellCheckingTypeYes;
            }
            if([el isKindOfClass:[UITextField class]]){
                ((UITextField *)el).spellCheckingType = UITextSpellCheckingTypeYes;
            }
        } else {
            if([el isKindOfClass:[UITextView class]]){
                ((UITextView *)el).spellCheckingType = UITextSpellCheckingTypeNo;
            }
            if([el isKindOfClass:[UITextField class]]){
                ((UITextField *)el).spellCheckingType = UITextSpellCheckingTypeNo;
            }
        }

        if([el isKindOfClass:[UILabel class]] && [el respondsToSelector:@selector(textInsets)]){

            // Padding Handling
            NSString *padding_left = @"0";
            NSString *padding_right = @"0";
            NSString *padding_top = @"0";
            NSString *padding_bottom = @"0";
            if(style[@"padding"]){
                NSString *padding = style[@"padding"];
                padding_left = padding;
                padding_top = padding;
                padding_right = padding;
                padding_bottom = padding;
            }
            if(style[@"padding_left"]) padding_left = style[@"padding_left"];
            if(style[@"padding_right"]) padding_right = style[@"padding_right"];
            if(style[@"padding_top"]) padding_top = style[@"padding_top"];
            if(style[@"padding_bottom"]) padding_bottom = style[@"padding_bottom"];
            ((TTTAttributedLabel*)el).textInsets = UIEdgeInsetsMake([padding_top floatValue], [padding_left floatValue], [padding_bottom floatValue], [padding_right floatValue]);
            ((TTTAttributedLabel *)el).lineBreakMode = NSLineBreakByTruncatingTail;
        }

        // Font
        NSString *font;
        if(style[@"font"]){
            font = style[@"font"];
        }
        CGFloat size = 14.0;
        if(style[@"size"]){
            size = [style[@"size"] floatValue];
        }

        UIFont *f;
        if(font){
            f = [UIFont fontWithName:font size:size];
        } else {
            f = [UIFont systemFontOfSize:size];
        }

        if([el respondsToSelector:@selector(font)]){
            [el setValue:f forKey:@"font"];
        }

        // A hack for handling TTTAttributedLabel BUG
        // The text MUST be set AFTER setting the font.
        // Therefore we need to set the text one more time here.
        if([el isKindOfClass:[UILabel class]]){
            if(json[@"text"]){
                [el setValue:json[@"text"] forKey:@"text"];
            }
        }
    }
}
+ (void)updateForm:(NSDictionary *)kv{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"updateForm" object:nil userInfo:kv];
}
@end


text:
"use strict";
/**
 * A custom error class
 */
function MimeError () {
  this.init.apply(this, arguments);
  Error.call(this);
  Error.captureStackTrace(this, this.constructor);
}
/**
 * Extend the native error class.
 * @type {Object}
 */
MimeError.prototype = Object.create(Error.prototype, {
  constructor: {
    value: MimeError
  }
});

/**
 * The name of the error.
 * @type {String}
 */
MimeError.prototype.name = 'MimeError';

/**
 * Initializes the error, child classes can override this.
 * @param  {String} message the error message
 */
MimeError.prototype.init = function (message) {
  this.message = message;
};

/**
 * Inherit from the custom error class.
 * @param  {Function} init The init function, should have a name.
 * @return {Function}      The descendant error class.
 */
MimeError.inherit = function (init) {
  var parent = this;
  var child = function () { return parent.apply(this, arguments); };
  child.prototype = Object.create(parent.prototype, {
    constructor: {
      value: child
    }
  });

  child.prototype.init = init;
  child.prototype.name = init.name;
  child.inherit = parent.inherit;

  return child;
};

module.exports = MimeError;


text:
package pdms.components.pojo;

import java.sql.Clob;
import java.util.Date;

/**
 * 主题帖
 * @author LUSuo(atealxt@gmail.com)
 */
public class Topic {

    /** 主题ID */
    protected String id;
    /** 主题名 */
    protected String name;
    /** 主题内容 */
    protected Clob content;
    /** 所在专区 */
    protected Project project;
    /** 发表时间 */
    protected Date createtime;
    /** 发表人(会员) */
    protected User createuser;
    /** 状态 1:开放 0:关闭 -1:删除 */
    protected Integer status;
    /** 分类 1:private 0:public */
    protected Integer topictype;
    /** 等级(Position) 1:Position1 2:Position2 */
    protected Integer topiclevel;

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append(" 主题ID: ").append(getId());
        sb.append(" 主题名: ").append(getName());
        sb.append(" 发表时间: ").append(getCreatetime());
        sb.append(" 状态: ").append(getStatus());
        sb.append(" 分类: ").append(getTopictype());
        sb.append(" 等级: ").append(getTopiclevel());
        return sb.toString();
    }

    public Clob getContent() {
        return content;
    }

    public void setContent(Clob content) {
        this.content = content;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public User getCreateuser() {
        return createuser;
    }

    public void setCreateuser(User createuser) {
        this.createuser = createuser;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    /** 主题名 */
    public String getName() {
        return name;
    }

    /** 主题名 */
    public void setName(String name) {
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    /** 状态 1:开放 0:关闭 -1:删除 */
    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getTopiclevel() {
        return topiclevel;
    }

    /** 等级(Position) 1:Position1 2:Position2 */
    public void setTopiclevel(Integer topiclevel) {
        this.topiclevel = topiclevel;
    }

    public Integer getTopictype() {
        return topictype;
    }

    /** 分类 1:private 0:public */
    public void setTopictype(Integer topictype) {
        this.topictype = topictype;
    }

    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }
}


text:
{{definition.title}}

  <adf-widget-content model="definition" content="widget" />

  <button type="button" class="btn btn-primary" ng-click="closeDialog()">Close</button>


text:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="?attr/listPreferredItemHeightSmall"
          android:gravity="center_vertical|start"
          android:maxLines="1"
          android:paddingStart="?attr/listPreferredItemPaddingLeft"
          android:paddingEnd="?attr/listPreferredItemPaddingRight"
          android:textAppearance="?attr/textAppearanceListItem"
          android:textColor="?android:textColorSecondary"/>


text:
1. [Readme](https://github.com/shriuken/starcraft2ai/blob/master/README.md)
1. [Project Description](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#project-description)
1. [Test Plan and Results](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#test-plan-and-results)
1. [User Manual](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#user-manual)
    1. [Manual](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#manual)
    1. [FAQ](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#faq)
1. [Final PPT Presentation](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#final-ppt-presentation)
1. [Final Expo Poster](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#expo-poster)
1. [Self-Assessment Essays](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#self-assessment-essays)
    1. [Initial Assessments](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#fall-essays)
    1. [Final Assessments](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#spring-essays)
1. [Summary of Hours and Justification](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#summary-of-hours-and-justification)
1. [Budget](https://github.com/shriuken/starcraft2ai/blob/master/FinalDesignReport.md#budget)

## Project Description

There have been many recent advances in game-playing AIs, such as the Dota2 AI and AlphaGo. With this project, we explored the use of conventional and cutting edge ML techniques to create a self-learning Starcraft II (SC2) AI agent capable of defeating Blizzard's Very Easy AI.

We are scoping our project in the following manner:
  * the agent will play as [Terran](http://us.battle.net/sc2/en/game/race/terran/)
  * against a Very Easy Terran AI provided in the retail version of the game
  * on the maps Simple64 and flat64.

## Interface Specification

## Test Plan and Results

[Test Plan and Results Doc](https://github.com/shriuken/starcraft2ai/blob/master/TestPlans.md)

## User Manual

### [Manual](https://github.com/shriuken/starcraft2ai/blob/master/UserDocs.md#user-docs)
### [FAQ](https://github.com/shriuken/starcraft2ai/blob/master/UserDocs.md#faq)

## Final PPT Presentation
[Presentation](https://docs.google.com/presentation/d/1L0_xcz8vSwR03VdKzz51-6sj2Cy9ZGxO8XQKX-KbHcY/edit?usp=sharing).

## Expo Poster
[Poster PDF](https://github.com/shriuken/starcraft2ai/blob/master/Senior%20Design%20Poster.pdf)

## Self Assessment Essays

Each member wrote their own assesment essays.

### Fall Essays

* [Arens' Essay](https://github.com/shriuken/starcraft2ai/blob/master/capstone/KyleArens.md#fall-essay)
* [Benner's Essay](https://github.com/shriuken/starcraft2ai/blob/master/capstone/RyanBenner.md#fall-essay)
* [Deibel's Essay](https://github.com/shriuken/starcraft2ai/blob/master/capstone/JonDeibel.md#fall-essay)

### Spring Essays

* [Arens' Essay](https://github.com/shriuken/starcraft2ai/blob/master/capstone/KyleArens.md#spring-essay)
* [Benner's Essay](https://github.com/shriuken/starcraft2ai/blob/master/capstone/RyanBenner.md#spring-essay)
* [Deibel's Essay](https://github.com/shriuken/starcraft2ai/blob/master/capstone/JonDeibel.md#spring-essay)

## Summary of Hours and Justification

| Work | Time | Team Members |
| ---- | ---- | ------------ |
| **Fall Semester** |
| Learning the basics of Reinforcement Learning | 25 Hours | Kyle Arens, Jon Deibel, Ryan Benner |
| Understanding C++/Python API | 10 Hours | Jon Deibel, Ryan Benner, Kyle Arens |
| Creation of baseline AI/First RL based AI | 10 Hours | Jon Deibel, Ryan Benner |
| Documentation | 10 Hours | Ryan Benner, Kyle Arens, Jon Deibel |
| Reading + Understanding AlphaGo | 5 Hours | Ryan Benner, Kyle Arens, Jon Deibel |
| | | |
| **Spring Semester** |
| Model Improvements to AI | 50 Hours | Jon Deibel |
| Running Test Cases/Debugging | 25 Hours | Kyle Arens, Ryan Benner, Jon Deibel |
| Senior Design Expo | 4 Hours | Kyle Arens, Ryan Benner, Jon Deibel |
| Senior Design Poster | 25 Hours | Ryan Benner, Jon Deibel |
| Final Design Report | 4 Hours | Ryan Benner, Kyle Arens |
| Self Assessments | 2 Hours | Kyle Arens, Ryan Benner, Jon Deibel |
| Test Plans | 6 Hours | Kyle Arens, Ryan Benner, Jon Deibel |
| User Docs & FAQ | 10 Hours | Kyle Arens, Ryan Benner, Jon Deibel |

## Budget

There have been no expenses to date.


text:
var brain = require("brain");
var User = require("../models/user");
var _ = require("lodash");

module.exports = function (username, emotion, callback) {
    User.findOne({ name: username }, function (err, user) {
        if(err) {
            return callback(err);
        }

        if(!user.network) {
            return callback("No network");
        }

        var net = new brain.NeuralNetwork();
        net.fromJSON(user.network);

        var input = {
            angry : 0,
            sad : 0,
            happy : 0,
            excited : 0
        };

        input[emotion] = 1;

        var output = net.run(input);
        console.log(output);

        callback(null, output);
    });
};


text:
#pragma once

#include <QtCore/QObject>
#include <QtCore/QScopedPointer>

#include "fifoInterface.h"
#include "deviceState.h"

namespace trikKernel {
class Configurer;
}

namespace trikHal {
class HardwareAbstractionInterface;
class FifoInterface;
}

namespace trikControl {

/// Class that represents linux FIFO file, which is commonly used by various sensors.
class Fifo: public FifoInterface
{
	Q_OBJECT

public:
	/// Constructor.
	/// @param virtualPort - port in system-config.xml on which this FIFO file is configured.
	/// @param configurer - configurer object containing preparsed XML files with parameters.
	Fifo(const QString &virtualPort, const trikKernel::Configurer &configurer
			, const trikHal::HardwareAbstractionInterface &hardwareAbstraction);

	~Fifo() override;

	Status status() const override;

public slots:
	/// Reads data from this FIFO file, returning all available data as string.
	QString read() override;

	/// Returns true if FIFO has new data in it.
	bool hasData() const override;

private slots:
	void onNewData(const QString &data);
	void onReadError();

private:
	QScopedPointer<trikHal::FifoInterface> mFifo;

	/// Last line that was read from FIFO.
	QString mCurrent;

	/// State of a FIFO file as a device.
	DeviceState mState;
};

}


text:
.class final Landroid/os/StrictMode$6;
.super Landroid/os/StrictMode$Span;
.source "StrictMode.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/os/StrictMode;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

    invoke-direct {p0}, Landroid/os/StrictMode$Span;-><init>()V

    return-void
.end method

# virtual methods
.method public finish()V
    .locals 0

    return-void
.end method


text:
<!--
  #%L
  cache2k config file support
  %%
  Copyright (C) 2000 - 2022 headissue GmbH, Munich
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  #L%
  -->
<cache2k xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
         xmlns='https://cache2k.org/schema/v2.x'
         xsi:schemaLocation="https://cache2k.org/schema/v2.x  ../../../../cache2k-schema/src/main/resources/org/cache2k/schema/cache2k.xsd">
  <version>2.0</version>
  <ignoreMissingCacheConfiguration>true</ignoreMissingCacheConfiguration>
  <ignoreAnonymousCache>true</ignoreAnonymousCache>

  <defaults>
    <cache>
      <loaderThreadCount>5</loaderThreadCount>
    </cache>
  </defaults>
  <caches>
    <cache>
      <name>IntegrationTest-defaultAndIndividualIsApplied</name>
      <expireAfterWrite>47s</expireAfterWrite>
    </cache>
  </caches>
</cache2k>


text:
package com.huawei.esdk.sms.openapi.mas.cxf.gen.server;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;

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

 * <complexType name="MessageNotificationType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="CMAbility" type="{http://www.csapi.org/schema/common/v2_0}CMAbility"/>
 *         <element name="WSURI" type="{http://www.w3.org/2001/XMLSchema}anyURI" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MessageNotificationType", namespace = "http://www.csapi.org/schema/common/v2_0", propOrder = {
    "cmAbility",
    "wsuri"
})
public class MessageNotificationType {

    @XmlElement(name = "CMAbility", required = true)
    protected CMAbility cmAbility;
    @XmlElement(name = "WSURI")
    @XmlSchemaType(name = "anyURI")
    protected List<String> wsuri;

    /**
     * Gets the value of the cmAbility property.
     *
     * @return
     *     possible object is
     *     {@link CMAbility }
     *
     */
    public CMAbility getCMAbility() {
        return cmAbility;
    }

    /**
     * Sets the value of the cmAbility property.
     *
     * @param value
     *     allowed object is
     *     {@link CMAbility }
     *
     */
    public void setCMAbility(CMAbility value) {
        this.cmAbility = value;
    }

    /**
     * Gets the value of the wsuri property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the wsuri property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getWSURI().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getWSURI() {
        if (wsuri == null) {
            wsuri = new ArrayList<String>();
        }
        return this.wsuri;
    }

}


text:
<?php

require_once BASE_PATH.'/core/models/base/MetadataModelBase.php';

/** Pdo Model. */
class MetadataModel extends MetadataModelBase
{
    /**
     * Get all metadata types currently stored in the database.
     *
     * @return array
     */
    public function getMetadataTypes()
    {
        $rowset = $this->database->fetchAll(
            $this->database->select()->from('metadata', 'metadatatype')->group('metadatatype')
        );
        $types = array();
        foreach ($rowset as $row) {
            $types[] = $this->mapTypeToName($row['metadatatype']);
        }

        return $types;
    }

    /**
     * Get all the valid elements for a given metadata type.
     *
     * @param int $type
     * @return array
     */
    public function getMetadataElements($type)
    {
        $rowset = $this->database->fetchAll(
            $this->database->select()->from('metadata', 'element')->where('metadatatype=?', $type)->group('element')
        );
        $elements = array();
        foreach ($rowset as $row) {
            $elements[] = $row['element'];
        }

        return $elements;
    }

    /**
     * Get all of the valid qualifiers for a given type and element.
     *
     * @param int $type
     * @param string $element
     * @return array
     */
    public function getMetadataQualifiers($type, $element)
    {
        $rowset = $this->database->fetchAll(
            $this->database->select()->from('metadata', 'qualifier')->where('metadatatype=?', $type)->where(
                'element=?',
                $element
            )->group('qualifier')
        );
        $qualifiers = array();
        foreach ($rowset as $row) {
            $qualifiers[] = $row['qualifier'];
        }

        return $qualifiers;
    }

    /**
     * Return an item by its name.
     *
     * @param int $type
     * @param string $element
     * @param string $qualifier
     * @return false|MetadataDao
     */
    public function getMetadata($type, $element, $qualifier)
    {
        $row = $this->database->fetchRow(
            $this->database->select()->from('metadata')->where('metadatatype=?', $type)->where(
                'element=?',
                $element
            )->where('qualifier=?', $qualifier)
        );

        return $this->initDao('Metadata', $row);
    }

    /**
     * Get all the metadata.
     *
     * @return array
     */
    public function getAllMetadata()
    {
        $rowset = $this->database->fetchAll($this->database->select());

        $metadata = array('raw' => array(), 'sorted' => array());
        foreach ($rowset as $row) {
            $dao = $this->initDao('Metadata', $row);
            $metadata['raw'][] = $dao;
            $metadata['sorted'][$dao->getMetadatatype()][$dao->getElement()][] = $dao;
        }
        ksort($metadata['sorted']);
        foreach ($metadata['sorted'] as $key => $v) {
            ksort($metadata['sorted'][$key]);
        }

        return $metadata;
    }

    /**
     * Return the table name based on the type of metadata.
     *
     * @param int $metadatatype
     * @return string
     */
    public function getTableValueName($metadatatype)
    {
        return 'metadatavalue';
    }

    /**
     * Return true if a metadata value exists for this metadata.
     *
     * @param MetadataDao $metadataDao
     * @return bool
     * @throws Zend_Exception
     */
    public function getMetadataValueExists($metadataDao)
    {
        if (!$metadataDao instanceof MetadataDao) {
            throw new Zend_Exception('Should be a metadata.');
        }

        $row = $this->database->fetchRow(
            $this->database->select()->setIntegrityCheck(false)->from(
                $this->getTableValueName($metadataDao->getMetadatatype())
            )->where(
                'metadata_id=?',
                $metadataDao->getKey()
            )->where('itemrevision_id=?', $metadataDao->getItemrevisionId())
        );

        if (count($row) > 0) {
            return true;
        }

        return false;
    }

    /**
     * Save a metadata value, will update the row if it exists, otherwise insert.
     *
     * @param MetadataDao $metadataDao
     * @return bool
     * @throws Zend_Exception
     */
    public function saveMetadataValue($metadataDao)
    {
        if (!$metadataDao instanceof MetadataDao) {
            throw new Zend_Exception('Should be a metadata.');
        }

        $cols = array('metadata_id' => $metadataDao->getKey(), 'itemrevision_id' => $metadataDao->getItemrevisionId());

        $data['value'] = $metadataDao->getValue();
        $tablename = $this->getTableValueName($metadataDao->getMetadatatype());
        $table = new Zend_Db_Table(array('name' => $tablename, 'primary' => 'metadata_id'));
        if ($this->getMetadataValueExists($metadataDao)) {
            $wheres = array();
            foreach ($cols as $col => $val) {
                $wheres[$col.'=?'] = $val;
            }
            $table->update($data, $wheres);
        } else {
            foreach ($cols as $col => $val) {
                $data[$col] = $val;
            }
            $table->insert($data);
        }

        return true;
    }
}


text:
/*
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
*/

#ifndef HPQUADS_H
#define HPQUADS_H

#include "astrometry/an-bool.h"
#include "astrometry/starkd.h"
#include "astrometry/codefile.h"
#include "astrometry/quadfile.h"

int hpquads(startree_t* starkd,
			codefile_t* codes,
			quadfile_t* quads,
			int Nside,
			double scale_min_arcmin,
			double scale_max_arcmin,
			int dimquads,
			int passes,
			int Nreuses,
			int Nloosen,
			int id,
			anbool scanoccupied,

			void* sort_data,
			int (*sort_func)(const void*, const void*),
			int sort_size,

			char** args, int argc);

int hpquads_files(const char* skdtfn,
				  const char* codefn,
				  const char* quadfn,
				  int Nside,
				  double scale_min_arcmin,
				  double scale_max_arcmin,
				  int dimquads,
				  int passes,
				  int Nreuses,
				  int Nloosen,
				  int id,
				  anbool scanoccupied,

				  void* sort_data,
				  int (*sort_func)(const void*, const void*),
				  int sort_size,

				  char** args, int argc);

#endif


text:
{% extends sitebase.html %}
{% block head %}
{% end %}

{%block content %}

Welcome to LabControl!

{% end %}


text:
Create Session

    <form [formGroup]="newSessionForm" (ngSubmit)="saveSession(newSessionForm.value)" autocomplete="off">

        Session Name:
         Required
        <input formControlName="name" id="sessionName" type="text" class="form-control" placeholder="session name..." />

        Presenter:
         Required
        <input formControlName="presenter" id="presenter" type="text" class="form-control" placeholder="presenter..." />

        Duration:
         Required
        <select formControlName="duration" class="form-control">
          <option value="">select duration...</option>
          <option value="1">Half Hour</option>
          <option value="2">1 Hour</option>
          <option value="3">Half Day</option>
          <option value="4">Full Day</option>
        </select>

        Level:
         Required
        <select formControlName="level" class="form-control">
          <option value="">select level...</option>
          <option value="Beginner">Beginner</option>
          <option value="Intermediate">Intermediate</option>
          <option value="Advanced">Advanced</option>
        </select>

        Abstract:
         Required
         Max length 400 is allowed
        restricted words found: {{abstract.errors.restrictedWords}}
        <textarea formControlName="abstract" id="abstract" rows=3 class="form-control" placeholder="abstract..."></textarea>

      <button type="submit" [disabled] = "newSessionForm.invalid"class="btn btn-primary">Save</button>
      <button type="button" class="btn btn-default" (click)="cancel()">Cancel</button>
    </form>


text:
var backgroundPage = chrome.extension.getBackgroundPage();
var tabs           = backgroundPage.tabs;
var currentTabId   = backgroundPage.currentTabId;
var settings       = backgroundPage.settings;

// var options = chrome.storage.sync.get({
//         proxy_servers: []
//     }, function(obj) {
//         proxyServersDOM.value = obj.proxy_servers.join('\n');
//     })

document.addEventListener('DOMContentLoaded', function() {

    var mask = document.querySelector('.mask');
    var hostListDOM = document.querySelector('#hostList');
    var btnMainSwitch = document.querySelector('#mainSwitch');
    var btnOpenOptionPage = document.querySelector('#btnOpenOptionPage');

    var currentHost = null;
    var proxyRuleIndex = -1;

    // get rule list
    chrome.storage.sync.get({
        "proxy_servers": [],
        "proxy_rules": [],
        "switch": false
    }, function(obj) {
        var hosts      = tabs[currentTabId];
        var proxyRules = obj["proxy_rules"];
console.log(obj["proxy_servers"]);
        if (!obj["proxy_servers"].length) {
            mask.style.display = 'flex';
        } else {
            mask.style.display = 'none';
        }

        if (obj["switch"]) {
            btnMainSwitch.className = "on";
        } else {
            hostList.className = "disabled";
        }

        hostListHTML = hosts.map(function(host) {
            var inList = proxyRules.indexOf(host) >= 0;
            return `

                    ${host}

            `;
        })

        hostListDOM.innerHTML = hostListHTML.join('');
    });

    // host list change event
    hostListDOM.addEventListener('click', function(event) {
        var el = event.target;

        if (el.tagName !== 'I' && el.parentNode.tagName === 'I') {
            el = el.parentNode;
        }

        if (el.tagName === 'I') {
            var mode = !(el.className === "on");
            var host = el.parentNode.querySelector('span.host-name').innerText;

            changeProxyMode(host, mode, function() {
                el.className = mode ? "on" : "";
            });
        }
    }, false);

    // main switch envent
    btnMainSwitch.addEventListener('click', function(event) {
        var self = this;
        if (self.className === "on") {
            backgroundPage.stopProxy(function() {
                chrome.storage.sync.set({
                    "switch": false
                }, function() {
                    self.className = "";
                    hostList.className = "disabled";
                });
            });
        } else {
            backgroundPage.startProxy(function() {
                chrome.storage.sync.set({
                    "switch": true
                }, function() {
                    self.className = "on";
                    hostList.className = "";
                });
            })
        }
    }, false);

    // open options page
    btnOpenOptionPage.addEventListener('click', function() {
        chrome.runtime.openOptionsPage();
    })
})

function changeProxyMode(host, mode, fn) {
    var fuc = fn || function() {};

    chrome.storage.sync.get({
        "proxy_rules": []
    }, function(obj) {
        var rules = obj["proxy_rules"]
        var index = rules.indexOf(host);

        if (mode == 1 && index < 0) {
            rules.push(host);
        } else if (index >= 0) {
            rules.splice(index, 1);
        }

        chrome.storage.sync.set({
            "proxy_rules": rules
        }, function() {
            backgroundPage.startProxy();
            fuc();
        })
    })
}


text:
package com.blooms.kingsite.modules.act.rest.editor.model;

import org.activiti.editor.constants.ModelDataJsonConstants;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Model;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

/**
 * @author Tijs Rademakers
 */
@RestController
public class ModelEditorJsonRestResource implements ModelDataJsonConstants {

	protected static final Logger LOGGER = LoggerFactory.getLogger(ModelEditorJsonRestResource.class);

	@Autowired
	private RepositoryService repositoryService;

//	@Autowired
//	private ObjectMapper objectMapper;
	protected ObjectMapper objectMapper = new ObjectMapper();

	@RequiresPermissions("act:model:edit")
	@RequestMapping(value = "/act/service/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json")
	public ObjectNode getEditorJson(@PathVariable String modelId) {
		ObjectNode modelNode = null;

		Model model = repositoryService.getModel(modelId);

		if (model != null) {
			try {
				if (StringUtils.isNotEmpty(model.getMetaInfo())) {
					modelNode = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
				} else {
					modelNode = objectMapper.createObjectNode();
					modelNode.put(MODEL_NAME, model.getName());
				}
				modelNode.put(MODEL_ID, model.getId());
				ObjectNode editorJsonNode = (ObjectNode) objectMapper.readTree(new String(repositoryService.getModelEditorSource(model.getId()),
						"utf-8"));
				modelNode.put("model", editorJsonNode);

			} catch (Exception e) {
				LOGGER.error("Error creating model JSON", e);
				throw new ActivitiException("Error creating model JSON", e);
			}
		}
		return modelNode;
	}
}


text:
package com.alibaba.druid.sql.dialect.mysql.ast.statement;

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;

public class MySqlShowGrantsStatement extends MySqlStatementImpl implements MySqlShowStatement {

    private SQLExpr user;

    public void accept0(MySqlASTVisitor visitor) {
        if (visitor.visit(this)) {
            acceptChild(visitor, user);
        }
        visitor.endVisit(this);
    }

    public SQLExpr getUser() {
        return user;
    }

    public void setUser(SQLExpr user) {
        if (user != null) {
            user.setParent(this);
        }
        this.user = user;
    }

}


text:
require('../modules/core.binding');
module.exports = require('../modules/$').core.Function;


text:
[TOC]

    View source on GitHub

The tfgnn.keras.layers package.

## Classes

[`class AddSelfLoops`](../../tfgnn/keras/layers/AddSelfLoops.md): Adds
self-loops to scalar graphs.

[`class AnyToAnyConvolutionBase`](../../tfgnn/keras/layers/AnyToAnyConvolutionBase.md): Convenience base class for convolutions to nodes or to context.

[`class Broadcast`](../../tfgnn/keras/layers/Broadcast.md): Broadcasts a GraphTensor feature.

[`class ContextUpdate`](../../tfgnn/keras/layers/ContextUpdate.md): A context update with input from node sets and/or edge sets.

[`class EdgeSetUpdate`](../../tfgnn/keras/layers/EdgeSetUpdate.md): Computes the new state of an EdgeSet from select input features.

[`class GraphUpdate`](../../tfgnn/keras/layers/GraphUpdate.md): Applies one round of updates to EdgeSets, NodeSets and Context.

[`class MakeEmptyFeature`](../../tfgnn/keras/layers/MakeEmptyFeature.md): Returns an empty feature with a shape that fits the input graph piece.

[`class MapFeatures`](../../tfgnn/keras/layers/MapFeatures.md): Transforms features on a GraphTensor by user-defined callbacks.

[`class NextStateFromConcat`](../../tfgnn/keras/layers/NextStateFromConcat.md): Computes a new state by concatenating inputs and applying a Keras Layer.

[`class NodeSetUpdate`](../../tfgnn/keras/layers/NodeSetUpdate.md): A node state update with input from convolutions or other edge set inputs.

[`class PadToTotalSizes`](../../tfgnn/keras/layers/PadToTotalSizes.md): Applies tfgnn.pad_to_total_sizes() to a GraphTensor.

[`class ParseExample`](../../tfgnn/keras/layers/ParseExample.md): Applies tfgnn.parse_example(graph_tensor_spec, _) to a batch of strings.

[`class ParseSingleExample`](../../tfgnn/keras/layers/ParseSingleExample.md): Applies tfgnn.parse_single_example(graph_tensor_spec, _).

[`class Pool`](../../tfgnn/keras/layers/Pool.md): Pools a GraphTensor feature.

[`class Readout`](../../tfgnn/keras/layers/Readout.md): Reads a feature out of a GraphTensor.

[`class ReadoutFirstNode`](../../tfgnn/keras/layers/ReadoutFirstNode.md): Reads a feature from the first node of each graph conponent.

[`class ResidualNextState`](../../tfgnn/keras/layers/ResidualNextState.md): Updates a state with a residual block.

[`class SimpleConv`](../../tfgnn/keras/layers/SimpleConv.md): A convolution
layer that applies a passed-in message_fn.

[`class SingleInputNextState`](../../tfgnn/keras/layers/SingleInputNextState.md):
Replaces a state from a single input.


text:
package org.apache.pulsar.io.jdbc;

import org.apache.pulsar.io.core.annotations.Connector;
import org.apache.pulsar.io.core.annotations.IOType;

@Connector(
        name = "jdbc-openmldb",
        type = IOType.SINK,
        help = "A simple JDBC sink for OpenMLDB that writes pulsar messages to a database table",
        configClass = JdbcSinkConfig.class
)
public class OpenMLDBJdbcAutoSchemaSink extends BaseJdbcAutoSchemaSink {

}


text:
package OpenXPKI::Server::Workflow::Condition::Key;

use strict;
use warnings;
use base qw( Workflow::Condition );
use Workflow::Exception qw( condition_error configuration_error );
use OpenXPKI::Debug;
use OpenXPKI::Server::Context qw( CTX );
use English;

sub evaluate
{
    ##! 1: 'start'
    my ( $self, $wf ) = @_;

    my $context = $wf->context();
    my $ca      = $context->param('ca');

    $context->param('todo_kludge_wf_cond_key', 'workflow condition Key.pm is forced to return true');
    return 1;

=begin temporarily_disabled

    my $realm   = CTX('session')->get_pki_realm();

    ##! 16: 'realm: ' . $realm
    ##! 16: 'ca: ' . $ca
    my $certificate = CTX('pki_realm_by_cfg')->{$cfg_id}->{$realm}->{ca}->{id}->{$ca}->{certificate};
    my $ca_token = CTX('pki_realm_by_cfg')->{$cfg_id}->{$realm}->{ca}->{id}->{$ca}->{crypto};
    ##! 16: 'CA token retrieved'
    if (!defined $ca_token || ! $ca_token->key_usable()) {
        if (!defined $ca_token) {
            ##! 32: 'ca token undefined!'
        }
        ##! 16: 'key unusable condition error'
        condition_error("I18N_OPENXPKI_SERVER_WORKFLOW_CONDITION_KEY_UNUSABLE");
    }
    ##! 1: 'end'
    return 1;

=end

=cut

}

1;

__END__

=head1 NAME

OpenXPKI::Server::Workflow::Condition::Key

=head1 SYNOPSIS

<action name="do_something">
  <condition name="CA::key_is_usable"
             class="OpenXPKI::Server::Workflow::Condition::Key">
    <param name="key" value="ca"/>
  </condition>
</action>

=head1 DESCRIPTION

The condition checks if the specified key (token id) is usable.


text:
package edu.wpi.first.wpilibj.ultimateascent.commands;

import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.ultimateascent.OI;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.AngleShooter;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.DriveTrain;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.Intake;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.Shifter;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.Shooter;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.Intake;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.Loader;
import edu.wpi.first.wpilibj.ultimateascent.subsystems.Shooter;
import java.util.Random;
/**
 * The base for all commands. All atomic commands should subclass CommandBase.
 * CommandBase stores creates and stores each control system. To access a
 * subsystem elsewhere in your code in your code use CommandBase.exampleSubsystem
<<<<<<< HEAD
 * @author John
=======
 * @author Author
>>>>>>> ShooterWheel
 */
public abstract class CommandBase extends Command {

    public static OI oi;
    // Create a single static instance of all of your subsystems
    public static DriveTrain dt = new DriveTrain();
    public static Shifter shifter = new Shifter();
    public static AngleShooter angleShooter = new AngleShooter();
    public static Shooter shooter = new Shooter();
    public static Intake intake = new Intake();
    public static Loader loader = new Loader();

    public static void init() {
        // This MUST be here. If the OI creates Commands (which it very likely
        // will), constructing it during the construction of CommandBase (from
        // which commands extend), subsystems are not guaranteed to be
        // yet. Thus, their requires() statements may grab null pointers. Bad
        // news. Don't move it.
        oi = new OI();

        // Show what command your subsystem is running on the SmartDashboard
        SmartDashboard.putData(dt);
    }

    public CommandBase(String name) {
        super(name);
    }

    public CommandBase() {
        super();
    }
}


text:
"""
Copyright (c) 2011, 2012, Regents of the University of California
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

 - Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
 - Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the
   distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
"""

import numpy as np
from twisted.trial import unittest

from smap.ops.test.test_group import make_input_meta, make_test_data
from smap import operators
from smap.ops import arithmetic

class TestArithmetic(unittest.TestCase):
    def setUp(self):
        self.udata = make_test_data(5)
        self.jdata = operators.transpose_streams(self.udata)

    def test_max(self):
        # test axis 0
        for i in xrange(0, 5):
            rv = arithmetic.max.base_operator(self.udata[i], axis=0)
            self.assertEquals(np.sum(rv - self.udata[i][-1, :]), 0)

        # test axis 1
        rv = arithmetic.max.base_operator(self.jdata)
        self.assertEquals(np.sum(rv[:, 0] - self.jdata[:, 0]), 0)
        self.assertEquals(np.sum(rv[:, 1] - self.jdata[:, -1]), 0)

    def test_min(self):
        # test axis 0
        for i in xrange(0, 5):
            rv = arithmetic.min.base_operator(self.udata[i], axis=0)
            self.assertEquals(np.sum(rv - self.udata[i][0, :]), 0)

        # test axis 1
        rv = arithmetic.min.base_operator(self.jdata)
        self.assertEquals(np.sum(rv[:, 0] - self.jdata[:, 0]), 0)
        self.assertEquals(np.sum(rv[:, 1] - self.jdata[:, 1]), 0)

    def test_median(self):
        rv = arithmetic.median.base_operator(self.jdata, axis=1)
        self.assertEquals(np.sum(rv[:, 0] - self.jdata[:, 0]), 0)
        self.assertEquals(np.sum(rv[:, 1] - np.median(self.jdata[:, 1:], axis=1)), 0)

        for i in xrange(0, 5):
            rv = arithmetic.median.base_operator(self.udata[i], axis=0)
            self.assertEquals(rv[0][0], 0)
            self.assertEquals(rv[0][1], np.median(self.udata[i][:, 1]))

    def test_first(self):
        for i in xrange(0, 5):
            rv = arithmetic._first(self.udata[i], axis=1)
            self.assertEquals(rv[0][0], 0)
            self.assertEquals(rv[0][1], 0)

        rv = arithmetic._first(self.jdata, axis=0)
        self.assertEquals(np.sum(rv - self.jdata[0, :]), 0)

        rv = arithmetic._first(operators.null, axis=0)
        self.assertEquals(rv.size, operators.null.size)
        rv = arithmetic._first(operators.null, axis=1)
        self.assertEquals(rv.size, operators.null.size)

    def test_count(self):
        rv = arithmetic.count.base_operator(self.jdata, axis=0)
        self.assertEquals(np.sum(rv), 20)

        rv = arithmetic.count.base_operator(self.jdata, axis=1)
        self.assertEquals(np.sum(rv[:, 0] - self.jdata[:, 0]), 0)
        self.assertEquals(np.sum(rv[:, 1]), 5 * 20)

    def test_sum(self):
        rv = arithmetic.sum.base_operator(self.jdata, axis=0)
        self.assertEquals(rv.shape, (1, 6))


text:
layout: post
cover: 'assets/images/cover7.jpg'
title: The Start of Another Blog
date:   2016-03-08 10:18:00
tags: general
subclass: 'post tag-test tag-content'
categories: 'casper'
navigation: True
logo: 'assets/images/logo.png'
---

And so begins the start of another blog. I often find interesting things I would like to share, or even create a guide to help along other new developers, but there was a certain turn off I had with my wp site. But I hope to populate this with many useful topics that I could reference from time to time again.


text:
<!doctype html>

<meta charset="utf-8">
<title>Tag Archive – Let's Make Billions | Free comedy business podcast</title>
<meta name="description" content="An archive of posts sorted by tag.">

<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://www.letsmakebillions.com/images/">
<meta name="twitter:title" content="Tag Archive">
<meta name="twitter:description" content="An archive of posts sorted by tag.">
<meta name="twitter:creator" content="@simonbcumming">

<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="Tag Archive">
<meta property="og:description" content="An archive of posts sorted by tag.">
<meta property="og:url" content="http://www.letsmakebillions.com/tags/">
<meta property="og:site_name" content="Let's Make Billions | Free comedy business podcast">

<link rel="canonical" href="http://www.letsmakebillions.com/tags/">
<link href="http://www.letsmakebillions.com/feed.xml" type="application/atom+xml" rel="alternate" title="Let's Make Billions | Free comedy business podcast Feed">

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="http://www.letsmakebillions.com/assets/css/main.css">

<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">

<meta http-equiv="cleartype" content="on">

<link rel="shortcut icon" href="http://www.letsmakebillions.com/favicon.ico">

<link rel="shortcut icon" href="http://www.letsmakebillions.com/favicon.png">

<link rel="apple-touch-icon-precomposed" href="http://www.letsmakebillions.com/images/apple-touch-icon-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://www.letsmakebillions.com/images/apple-touch-icon-72x72-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://www.letsmakebillions.com/images/apple-touch-icon-114x114-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://www.letsmakebillions.com/images/apple-touch-icon-144x144-precomposed.png">

	<button class="dl-trigger">Open Menu</button>

Home

			About

Simon Cumming

Melbourne Comedian & Genius

Learn More

					 Email

					 Twitter

			Posts

All Posts

All Tags

Let's Make Billions

The Comedy podcast that starts a new business every week

           @billionspod

           @billionspod

           Let's Make Billions Podcast

       Subscribe (RSS)

       Subscribe (iTunes)

Aaron Gocs 1

Alex Ward 1

Blake Freeman 1

Daisy Berry 1

Jack Druce 1

Justin Sproules 1

Kate Dehnert 1

Lewis Dowell 1

Murphy McLachlan 3

Perri Cassie 1

Peter Jones 1

Rhi Down 1

Rose Callaghan 1

Tessa Ryan 2

Timothy Clark 1

blog-posts 2

episodes 17

podcast updates 5

Aaron Gocs

Ep 17 - Sports Conversation Assistant

Alex Ward

Ep9 - House Party Finder

Blake Freeman

Ep13 - Lying App w/ Blake Freeman

Daisy Berry

Ep 16 - Pool Sharing App

Jack Druce

Ep14 - Gifting Based Surveillance App w/ Jack Druce

Justin Sproules

Ep10 - Questionable Service Dog Prescriptions w/ Justin Sproules

Kate Dehnert

Ep2 - Keb-App: An App for Finding Great Kebabs w/ Kate Dehnert

Lewis Dowell

Ep11- Social Media Newspaper w/ Lewis Dowell

Murphy McLachlan

Bonus Episode! Simon and Murphy visit a dog cafe

Ep4 - Jim's Gym for Jims: a Gym for Life Skills

Ep1 - A Bar For Dogs w/ Murphy McLachlan

Perri Cassie

Ep7 - Public Toilet Directory App

Peter Jones

Ep8 - Hipster Tours Melbourne

Rhi Down

Ep12 - Pockets for Women's Clothing w/ Rhi Down

Rose Callaghan

Ep6 - Wholesome Dating App

Tessa Ryan

Ep 15 - Uber but for.......

Ep3 - The World's Most Profitable Baby Sitting / Team Building service

Timothy Clark

Ep5 - Mr. Beanie: A Craft Play Center for Adults

blog-posts

Like Uber but for hangovers

3 Times This Podcast Has Already Predicted the God Damn Future

episodes

Ep 17 - Sports Conversation Assistant

Ep 16 - Pool Sharing App

Ep 15 - Uber but for.......

Ep14 - Gifting Based Surveillance App w/ Jack Druce

Ep13 - Lying App w/ Blake Freeman

Ep12 - Pockets for Women's Clothing w/ Rhi Down

Ep11- Social Media Newspaper w/ Lewis Dowell

Ep10 - Questionable Service Dog Prescriptions w/ Justin Sproules

Ep9 - House Party Finder

Ep8 - Hipster Tours Melbourne

Ep7 - Public Toilet Directory App

Ep6 - Wholesome Dating App

Ep5 - Mr. Beanie: A Craft Play Center for Adults

Ep4 - Jim's Gym for Jims: a Gym for Life Skills

Ep3 - The World's Most Profitable Baby Sitting / Team Building service

Ep2 - Keb-App: An App for Finding Great Kebabs w/ Kate Dehnert

Ep1 - A Bar For Dogs w/ Murphy McLachlan

podcast updates

Launch date brought forward to Monday 8th of August

Podcast Trailer is Up

Now Live in iTunes Store

Launches August 15

Welcome to The Podcast

    © 2016 Simon Cumming. Powered by Jekyll using the HPSTR Theme.

    Twitter