text:
<?php
namespace WebDeploy\Repository;

use WebDeploy\Exception;
use WebDeploy\Shell\Shell;

class Composer extends Repository
{
    public static function check()
    {
        Shell::check();

        if (!(new Shell)->exec('which composer')->getLog()['success']) {
            throw new Exception\BadFunctionCallException(__('composer command is not installed'));
        }
    }

    public function __construct($path = null, $log = false)
    {
        parent::__construct($path, $log);

        $this->shell->baseCommand('export COMPOSER_HOME="'.$path.'";');

        return $this;
    }

    public function install()
    {
        return $this->exec('composer install --optimize-autoloader --no-dev');
    }

    public function getInstall()
    {
        return $this->install()->getShellAndLog();
    }
}


text:
package com.brysonm.uconomy;

import org.bukkit.configuration.file.FileConfiguration;

import java.util.UUID;

public class BalanceUtils {

    public static double getBalance(UUID playerUUID) {

        FileConfiguration config = uConomy.getBalancesYML().getConfig();

        return config.contains(playerUUID.toString()) ? config.getDouble(playerUUID.toString()) : 0.0D;

    }

    public static void depositAmount(UUID playerUUID, double amount) {

        double balance = getBalance(playerUUID);

        balance += amount;

        uConomy.getBalancesYML().getConfig().set(playerUUID.toString(), balance);

    }

    public static void withdrawAmount(UUID playerUUID, double amount) {

        double balance = getBalance(playerUUID);

        balance -= amount;

        uConomy.getBalancesYML().getConfig().set(playerUUID.toString(), balance);

    }

}

redpajama_set_name: RedPajamaGithub


text:
#pragma once
#include "kernel/expr.h"
namespace lean {
namespace blast {
/** \brief Return true iff \c e is of the form (not a) or (a -> false), and false otherwise */
bool is_not(expr const & e, expr & a);
bool is_not(expr const & e);
bool is_false(expr const & e);
}}


text:
"""\
Paster create template for creating your own authentication methods.
"""
from paste.script.templates import BasicPackage

class AuthenticatePlugin(BasicPackage):
    _template_dir = 'authenticate'
    summary = "An AuthKit authenticate middleware plugin"


text:
(function ($) {
	"use strict";

	$(window).load(function() {
		$("#preloader").delay(100).fadeOut("slow");
		$("#load").delay(100).fadeOut("slow");
	});

	//jQuery to collapse the navbar on scroll
	$(window).scroll(function() {
		if($(".navbar").length){
			if ($(".navbar").offset().top > 50) {
				$(".navbar-fixed-top").addClass("top-nav-collapse");
			} else {
				$(".navbar-fixed-top").removeClass("top-nav-collapse");
			}
		}
	});

	//jQuery for page scrolling feature - requires jQuery Easing plugin
	$(function() {
		$('.navbar-nav li a,.page-scroll a').bind('click', function(event) {
			var anchor = $(this).attr('href');
			var top = $(anchor).offset().top;
			if(anchor=='#home'){
				top = 0;
			}else{
				top -= $('#header').height();
			}
			$('html, body').stop().animate({
				scrollTop: top
			}, 1500, 'easeInOutExpo');
			event.preventDefault();
		});

	});

})(jQuery);


text:
gsui-patternroll {
	display: flex;
	height: 100%;
}

.gsuiPatternroll-block {
	display: flex;
	flex-direction: column;
	white-space: nowrap;
	color: var( --gsuiPatterns-pattern-color );
	--gsuiPatterns-pattern-color: #223;
}
.gsui-mute .gsuiPatternroll-block {
	opacity: .5;
}
.gsuiPatternroll-block-header {
	position: relative;
	box-sizing: border-box;
	z-index: 1;
	display: flex;
	border-radius: inherit;
	flex-direction: column;
	justify-content: center;
	padding: 0 4px;
	font-size: 11px;
	font-weight: bold;
	background-color: #fff3;
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
}
.gsuiPatternroll-block-name {
	overflow: hidden;
	text-overflow: ellipsis;
}
.gsuiPatternroll-block-content {
	flex: 1;
	position: relative;
	pointer-events: none;
}
.gsuiPatternroll-block[ data-missing ] .gsuiPatternroll-block-content {
	display: none;
}
.gsuiPatternroll-block-content svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: .8;
	fill: currentColor;
}

.gsui-row-small .gsuiPatternroll-block-header {
	background-color: inherit;
}
.gsui-row-small .gsuiPatternroll-block-header,
.gsui-row-small .gsuiPatternroll-block-content {
	position: absolute;
	width: 100%;
	height: 100%;
}

.gsuiPatternroll-block-placeholder {
	flex: 1;
	display: none;
	align-items: center;
	pointer-events: none;
	font-size: 14px;
	opacity: .5;
}
.gsuiPatternroll-block[ data-missing ] .gsuiPatternroll-block-placeholder {
	display: flex;
}
.gsuiPatternroll-block-placeholderIcon {
	margin: 0 8px;
}
.gsuiPatternroll-block-placeholderText {
	overflow: hidden;
	text-overflow: ellipsis;
	user-select: none;
	-webkit-user-select: none;
}


text: [Eggheads (the Eggdrop community)](%%GITHUB-REPO%%)


text:
package de.epiceric.shopchest.event;

import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;

import de.epiceric.shopchest.shop.Shop;

/**
 * Called when a player buys or sells something from or to a shop
 */
public class ShopBuySellEvent extends ShopEvent implements Cancellable {
    private Type type;
    private int newAmount;
    private double newPrice;
    private boolean cancelled;

    public ShopBuySellEvent(Player player, Shop shop, Type type, int newAmount, double newPrice) {
        super(player, shop);
        this.type = type;
        this.newAmount = newAmount;
        this.newPrice = newPrice;
    }

    /**
     * @return Whether the player buys or sells something
     */
    public Type getType() {
        return type;
    }

    /**
     * @return The amount which might be modified because of automatic item amount calculation
     */
    public int getNewAmount() {
        return newAmount;
    }

    /**
     * @return The price which might be modified because of automatic item amount calculation
     */
    public double getNewPrice() {
        return newPrice;
    }

    @Override
    public boolean isCancelled() {
        return cancelled;
    }

    @Override
    public void setCancelled(boolean cancel) {
        cancelled = cancel;
    }

    public enum Type {
        BUY,
        SELL;
    }
}


text:
package ly.whisk.storage;

import java.util.UUID;

import ly.whisk.db.RemoteTable;
import ly.whisk.db.RemotedTable;
import ly.whisk.db.RemotedTableMarshaller;

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMarshalling;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;

@DynamoDBTable(tableName = IngredientAndAmount.TABLE_NAME)
public class IngredientAndAmount implements RemotedTable {

	public static final String TABLE_NAME = "IngredientsAndAmounts";

	private UUID id;
	private Ingredient ingredient;
	private double value;
	private UnitTag unit;

	@RemoteTable
	@DynamoDBMarshalling(marshallerClass = RemotedTableMarshaller.class)
	public Ingredient getIngredient() {
		return ingredient;
	}

	public void setIngredient(Ingredient ingredient) {
		this.ingredient = ingredient;
	}

	@Override
	@DynamoDBHashKey
	public String getId() {
		return this.id.toString();
	}

	@Override
	public void setId(String id) {
		this.id = UUID.fromString(id);
	}

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

	public double getValue() {
		return value;
	}

	public void setValue(double value) {
		this.value = value;
	}

	@RemoteTable
	@DynamoDBMarshalling(marshallerClass = RemotedTableMarshaller.class)
	public UnitTag getUnit() {
		return unit;
	}

	public void setUnit(UnitTag unit) {
		this.unit = unit;
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-cache-path
        name="my_cache"
        path="." />
    <external-files-path
        name="external_files"
        path="Pictures/" />

    <external-files-path
        name="external_video_files"
        path="Movies/" />
</paths>


text:
User interfaces for simple jabber.  An attempt to produces some easy-to-use
front ends for simple jabber.  Of course it depends on and requires
[sj](https://github.com/younix/sj).

## Getting, building, installing

To download, `git clone https://github.com/GReagle/sjt`.  All programs are
interpreted, so there is no need to build/compile.  I add the sjt directory
to my $PATH, and that is the only step in installation.  If you want to,
you can copy the programs to /usr/local/bin or whatever you fancy; I don't
bother with that since I change the programs so much.

## Runtime dependencies

Some of the scripts are written in rc, which you can get from [9base](http://tools.suckless.org/9base) or [Plan 9 from User Space](https://github.com/9fans/plan9port).  The [version of rc written by Byron Rakitzis](http://tobold.org/article/rc) is, unfortunately, incompatible (`else` versus `if not`).

sj-many-windows requires [runit](http://smarden.org/runit/) to ensure that
there is at most one window per chat.

Some of the sjfs commands can use notify-send (on my system in package
libnotify-bin), but it is optional.  Unset the environment variable
note_time to disable.

## sjfs - Simple Jabber From Shell

The sjfs commands are a command line interface (CLI) for simple jabber.
Some of them happen to be written in shell script, but that is not what
"from shell" means; it means that they are intended to be used *from your
shell*.

### Using sjfs

Start with `sjfs-connect` (which runs `sj`), and keep that running as long as
you want to be connected.  It will ask for your pasword (because it runs
sj).  Don't forget to set the SJ_ variables or use the drsu options; `man
sj` for details.  `sjfs-connect` will not automtically run in the background
(i.e. it stays in the foreground), so if you need to get your shell prompt
back while staying connected, run it in its own terminal emulator window or
use a tool like dvtm, tmux, dtach, or abduco.  When you want to close
the connection, interrupt/kill `sjfs-connect` by hitting Control-C.

Once you are connected, you can run the rest of the sjfs commands at will.

## sj-many-windows - using the window manager for the GUI

`sj-many-windows` creates a new terminal emulator window (e.g. xterm or st)
for every function and chat.  This takes advantage of the fact that a
window manager can make a window blink when a bell character (Control-g or
code 7) is displayed, so this is a form of notification for new messages.
In xterm, this is controlled by "Enable Bell Urgency", and on my system is
off by default.

If you interrupt/kill `sj-many-windows`, it will shut down everything.
However, you can close any of the other windows that pop up if you wish.
Of course if you close the "connect" window you will lose your connection.

`sj-many-windows` interoperates well with sjfs commands in general; you can
mix them together.  For example, if you have started `sj-many-windows`, you
can still run `sjfs-online-buddies` or `sjfs-chat` whenever you want.

## runtime configuration via environment variables

Many of the commands use environment variables for runtime configuration.
See the beginning of the script for such variables.  For example: `env
DEBUG=1 note_time=200 sjfs-monitor-all-chats`


text:
package org.apache.felix.ipojo.runtime.test.dependencies.timeout;

import org.ow2.chameleon.testing.helpers.BaseTest;

/**
 * Bootstrap the test from this project
 */
public class Common extends BaseTest {

}


text:
package com.mynotes.model;

public class Note {

    private long id;
    private String title;
    private String description;

    public long getId() {
        return id;
    }

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

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

}


text:
set -u;
# Stop on first error.
set -e;

# Copies game and content folders from this repository into the appropriate location in your Steam installation.

# Requires a Unix-like environment (try Git bash).
# Requires the DOTA2_FOLDER environment variable to have been set (this is usually something like "<<path-to-steam>>/steamapps/common/dota 2", but sometimes ends in "dota 2 beta" instead).
# For example, on my machine I run the following from inside Powershell:
# DOTA2_FOLDER="C:/Games/Steam/steamapps/common/dota 2 beta" ./install.sh;

# You may need to run this as admin depending on the permissions of your Dota 2 folder.

test -d "${DOTA2_FOLDER}";

CUSTOM_GAME="card-draft";

GAME="${DOTA2_FOLDER}/game/dota_addons/${CUSTOM_GAME}";
CONTENT="${DOTA2_FOLDER}/content/dota_addons/${CUSTOM_GAME}";

GAME_ORIGIN="${PWD}/game/dota_addons/${CUSTOM_GAME}";
CONTENT_ORIGIN="${PWD}/content/dota_addons/${CUSTOM_GAME}";

test -d "${GAME_ORIGIN}";
test -d "${CONTENT_ORIGIN}";

rm -rf "${GAME}";
rm -rf "${CONTENT}";

cp -r "${GAME_ORIGIN}" "${GAME}";
cp -r "${CONTENT_ORIGIN}" "${CONTENT}";


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<context>
    <name>QObject</name>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="44"/>
        <source>There is nothing to generate, diagram doesn't have Initial Node</source>
        <translation>Генерация невозможна, на диаграмме нет начальных блоков</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="49"/>
        <source>Initial node must not have incoming links</source>
        <translation>В блок "Начало" не должны входить связи</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="83"/>
        <source>This element must have exactly ONE outgoing link</source>
        <translation>От этого элемента должна отходить в точности одна связь</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="93"/>
        <source>Final node must not have outgoing links</source>
        <oldsource>Final node must not have outgioing links</oldsource>
        <translation>От блока "Конец" не должно отходить связей</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="101"/>
        <source>If block must have exactly TWO outgoing links</source>
        <translation>От условного блока должно отходить в точности две связи</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="116"/>
        <source>Two outgoing links marked with 'true' found</source>
        <translation>Обе связи помечены меткой "истина"</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="125"/>
        <source>Two outgoing links marked with 'false' found</source>
        <translation>Обе связи помечены меткой "ложь"</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="134"/>
        <source>There must be at least one link with "true" or "false" marker on it</source>
        <translation>Должна быть как минимум одна связь с маркером "истина" или "ложь"</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="163"/>
        <source>Loop block must have exactly TWO outgoing links</source>
        <translation>От блока "Цикл" должно отходить в точности две связи</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="177"/>
        <source>Two outgoing links marked with "body" found</source>
        <translation>Обе связи помечены меткой "тело цикла"</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="185"/>
        <source>There must be a link with "body" marker on it</source>
        <translation>Из блока "Цикл" должна выходить связь с маркером "тело цикла"</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="218"/>
        <source>There must be exactly one link without marker on it (default branch)</source>
        <translation>Ветка без маркера должна быть в точности одна (ветка "default")</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="234"/>
        <source>There must be a link without marker on it (default branch)</source>
        <translation>Должна быть связь без маркера (ветка "default")</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="195"/>
        <source>Outgoing links from loop block must be connected to different blocks</source>
        <translation>Исходящие связи должны быть присоединены к разным блокам</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="208"/>
        <source>There must be at list TWO links outgoing from switch block</source>
        <translation>От блока выбора должно отходить минимум ДВЕ связи</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="225"/>
        <source>Duplicate case branch: '%1'</source>
        <translation>Найдено более одной ветки '%1'</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="247"/>
        <source>Fork block must have at least TWO outgoing links</source>
        <translation>Из блок "Параллельные задачи" должно выходить как минимум две связи</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="241"/>
        <source>Unknown block type</source>
        <translation>Неизвестный блок</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/masterGeneratorBase.cpp" line="77"/>
        <source>There is no opened diagram</source>
        <translation>Сначала откройте диаграмму </translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/primaryControlFlowValidator.cpp" line="273"/>
        <source>Outgoing link is not connected</source>
        <translation>Исходящая связь ни к чему не подключена</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/parts/subprograms.cpp" line="83"/>
        <source>Graphical diagram instance not found</source>
        <translation>Графическая модель диаграммы с подпрограммой не найдена</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/parts/subprograms.cpp" line="208"/>
        <source>Please enter valid c-style name for subprogram "</source>
        <translation>Введите корректный идентификатор подпрограммы "</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/parts/subprograms.cpp" line="214"/>
        <source>Duplicate identifier: </source>
        <translation>Такой идентификатор уже используется: </translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/converters/reservedVariablesConverter.cpp" line="64"/>
        <source>Device on port %1 is not configured. Please select it on the "Configure devices" panel on the right-hand side.</source>
        <translation>Сенсор на порту %1 не сконфигурирован. Выберите его тип на панели "Настройки сенсоров" справа.</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/converters/reservedVariablesConverter.cpp" line="68"/>
        <source>/* ERROR: SELECT DEVICE TYPE */</source>
        <translation>/* ОШИБКА: ВЫБЕРИТЕ ТИП СЕНСОРА */</translation>
    </message>
</context>
<context>
    <name>generatorBase::MasterGeneratorBase</name>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/masterGeneratorBase.cpp" line="115"/>
        <source>This diagram cannot be generated into the structured code. Generating it into the code with 'goto' statements.</source>
        <translation>Данная диаграмма не может быть сгенерирована в структурированный код. Генерирую код с 'goto'.</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/masterGeneratorBase.cpp" line="130"/>
        <source>This diagram cannot be even generated into the code with 'goto'statements. Please contact the developers.</source>
        <translation>Данная диаграмма не может быть сгенерирована даже в код с 'goto'. Пожалуйста, обратитесь к разработчикам.</translation>
    </message>
    <message>
        <location filename="../../../../plugins/robots/generators/generatorBase/src/masterGeneratorBase.cpp" line="132"/>
        <source>This diagram cannot be generated into the structured code.</source>
        <translation>Данная диаграмма не может быть сгенерирована в структурированный код.</translation>
    </message>
</context>
</TS>


text:
// Java Genetic Algorithm Library.
// Copyright (c) 2017 Franz Wilhelmstötter
//
// 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.
//
// Author:
//    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)

using System;
using System.Collections.Generic;
using Jenetics.Util;

namespace Jenetics
{
    ///
    ///     Implementation of a BitGene.
    ///
    public class BitGene : IGene<bool, BitGene>, IComparable<BitGene>
    {
        public static readonly BitGene True = new BitGene(true);
        public static readonly BitGene False = new BitGene(false);
        public static readonly BitGene Zero = False;
        public static readonly BitGene One = True;

        private BitGene(bool value)
        {
            Allele = value;
        }

        /// <inheritdoc />
        public int CompareTo(BitGene other)
        {
            return Comparer<bool>.Default.Compare(Allele, other.Allele);
        }

        /// <inheritdoc />
        ///
        ///     Return alwas <c>true.</c>
        ///
        /// <returns>always <c>true</c>.</returns>
        public bool IsValid => true;

        /// <inheritdoc />
        ///
        ///     Create a new, random gene.
        ///
        public BitGene NewInstance()
        {
            return RandomRegistry.GetRandom().Next(1) == 1 ? True : False;
        }

        /// <inheritdoc />
        ///
        ///     Create a new gene from the given <c>value</c>.
        ///
        public BitGene NewInstance(bool value)
        {
            return Of(value);
        }

        /// <inheritdoc />
        public bool Allele { get; }

        ///
        ///     Return the <c>boolean</c> value of this gene.
        ///
        /// <see cref="Allele" />
        /// <returns>the <c>boolean</c> value of this gene.></returns>
        public bool BooleanValue()
        {
            return Allele;
        }

        /// <inheritdoc />
        public override string ToString()
        {
            return $"{Allele}";
        }

        ///
        ///     Return the corresponding <c>BitGene</c> for the given <c>boolean</c> value.
        ///
        /// <param name="value">the value of the returned <c>BitGene</c>.</param>
        /// <returns>the <c>BitGene</c> for the given <c>boolean</c> value.</returns>
        public static BitGene Of(bool value)
        {
            return value ? True : False;
        }

        ///
        ///     Return the value of the BitGene.
        ///
        /// <returns>The value of the BitGene.</returns>
        public bool GetBit()
        {
            return Allele;
        }
    }
}


text:
package logbook.api;

import javax.json.JsonObject;

import logbook.bean.Mapinfo;
import logbook.internal.JsonHelper;
import logbook.proxy.RequestMetaData;
import logbook.proxy.ResponseMetaData;

/**
 * /kcsapi/api_get_member/mapinfo
 *
 */
@API("/kcsapi/api_get_member/mapinfo")
public class ApiGetMemberMapinfo implements APIListenerSpi {

    @Override
    public void accept(JsonObject json, RequestMetaData req, ResponseMetaData res) {
        JsonObject object = json.getJsonObject("api_data");
        if (object != null) {
            Mapinfo mapinfo = Mapinfo.get();

            // 海域
            if (object.getJsonArray("api_map_info") != null) {
                mapinfo.setMapInfo(JsonHelper.toList(object.getJsonArray("api_map_info"), Mapinfo.MapInfo::toMapInfo));
            }
            // 基地航空隊
            if (object.getJsonArray("api_air_base") != null) {
                mapinfo.setAirBase(JsonHelper.toList(object.getJsonArray("api_air_base"), Mapinfo.AirBase::toAirBase));
            } else {
                mapinfo.getAirBase().clear();
            }
            mapinfo.setLastModified(System.currentTimeMillis());
        }
    }

}


text:
package io.sarl.lang.tests.general.parsing.aop;

import static io.sarl.tests.api.tools.TestEObjects.file;
import static io.sarl.tests.api.tools.TestUtils.multilineString;
import static io.sarl.tests.api.tools.TestValidator.validate;

import org.eclipse.xtext.xbase.XbasePackage;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import io.sarl.lang.sarl.SarlScript;
import io.sarl.lang.validation.IssueCodes;
import io.sarl.tests.api.AbstractSarlTest;

/**
 * @author $Author: sgalland$
 * @version $Name$ $Revision$ $Date$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 */
@SuppressWarnings("all")
@DisplayName("Syntax: @DefaultSkill")
@Tag("core")
public class DefaultSkillTest extends AbstractSarlTest {

	@Test
	@Tag("sarlValidation")
	public void valid() throws Exception {
		SarlScript mas = file(getParseHelper(), multilineString(
				"import io.sarl.lang.core.DefaultSkill",
				"@DefaultSkill(typeof(S1))",
				"capacity C1 {",
				"  def myFct",
				"}",
				"skill S1 implements C1 {",
				"  def myFct {}",
				"}"
				));
		validate(getValidationHelper(), getInjector(), mas).assertNoErrors();
	}

	@Test
	@Tag("sarlValidation")
	public void notASkill() throws Exception {
		SarlScript mas = file(getParseHelper(), multilineString(
				"import io.sarl.lang.core.DefaultSkill",
				"@DefaultSkill(typeof(S1))",
				"capacity C1 {",
				"  def myFct",
				"}",
				"class S1 {",
				"}"
				));
		validate(getValidationHelper(), getInjector(), mas).assertError(
				XbasePackage.eINSTANCE.getXTypeLiteral(),
				org.eclipse.xtext.xbase.validation.IssueCodes.INCOMPATIBLE_TYPES,
				"Type mismatch");
	}

	@Test
	@Tag("sarlValidation")
	public void notACapacityImplementation() throws Exception {
		SarlScript mas = file(getParseHelper(), multilineString(
				"import io.sarl.lang.core.DefaultSkill",
				"@DefaultSkill(typeof(S1))",
				"capacity C1 {",
				"  def myFct",
				"}",
				"capacity C2 {",
				"  def myFct2",
				"}",
				"skill S1 implements C2 {",
				"  def myFct2 {}",
				"}"
				));
		validate(getValidationHelper(), getInjector(), mas).assertError(
				XbasePackage.eINSTANCE.getXTypeLiteral(),
				IssueCodes.INVALID_DEFAULT_SKILL_ANNOTATION,
				"Invalid annotation value. S1 is not an implementation of C1");
	}

	@Test
	@Tag("sarlValidation")
	public void validSubType() throws Exception {
		SarlScript mas = file(getParseHelper(), multilineString(
				"import io.sarl.lang.core.DefaultSkill",
				"@DefaultSkill(typeof(S1))",
				"capacity C1 {",
				"  def myFct",
				"}",
				"capacity C2 extends C1 {",
				"  def myFct2",
				"}",
				"skill S1 implements C2 {",
				"  def myFct {}",
				"  def myFct2 {}",
				"}"
				));
		validate(getValidationHelper(), getInjector(), mas).assertNoErrors();
	}

}


text:
package singlepoll

import "context"

var backgroundctx, backgroundcancel = context.WithCancel(context.Background())

func CloseBackgroundProcesses() {
	backgroundcancel()
}


text:
import { fromEvent, FunctionEvent } from 'graphcool-lib'
import { GraphQLClient } from 'graphql-request'

interface User {
  id: string
}

export default async (event: FunctionEvent<{}>) => {
  console.log(event)

  try {
    // no logged in user
    if (!event.context.auth || !event.context.auth.nodeId) {
      return { data: null }
    }

    const userId = event.context.auth.nodeId
    const graphcool = fromEvent(event)
    const api = graphcool.api('simple/v1')

    // get user by id
    const user: User = await getUser(api, userId)
      .then(r => r.User)

    // no logged in user
    if (!user || !user.id) {
      return { data: null }
    }

    return { data: { id: user.id } }
  } catch (e) {
    console.log(e)
    return { error: 'An unexpected error occured during authentication.' }
  }
}

async function getUser(api: GraphQLClient, id: string): Promise<{ User }> {
  const query = `
    query getUser($id: ID!) {
      User(id: $id) {
        id
      }
    }
  `

  const variables = {
    id,
  }

  return api.request<{ User }>(query, variables)
}


text:
using FluentNHibernate.Mapping;
using LNF.Impl.Repository.Scheduler;

namespace LNF.Impl.Mappings.Scheduler
{
    internal class ReservationOnTheFlyMap : ClassMap<ReservationOnTheFly>
    {
        internal ReservationOnTheFlyMap()
        {
            Schema("sselScheduler.dbo");
            Id(x => x.ReservationOnTheFlyID);
            References(x => x.Reservation);
            Map(x => x.CardNumber);
            Map(x => x.OnTheFlyName);
			Map(x => x.IPAddress);
			Map(x => x.CardReaderName);
        }
    }
}


text:
Changes
=========

10.0.7, 2019-09-18
------------------
- Merged bugfix pull requests 21--24 and 26--27.

10.0.6, 2019-08-21
------------------
- Updated dependencies and loosened their requirements.

10.0.5, 2019-08-21
------------------
- Changed ``read_gtfs`` to ignore files that don't end with ``.txt``.

10.0.4, 2019-08-07
------------------
- Bugfixed the 'restrict_to' functions in ``miscellany.py``.
  In particular, i fixed the transfers table slices by replacing the logical ors with logical ands.
- Updated dependencies.

10.0.3, 2019-05-29
------------------
- Set the time series frequency at the end of the function ``downsample``.

10.0.2, 2019-05-29
------------------
- Changed ``<`` to ``<=`` at the start of the function ``downsample`` as a tiny optimization.
- Fixed Pytest warning.

10.0.1, 2019-05-22
------------------
- Added Python 3.7 support (by simply updating the Travis configuration).

10.0.0, 2019-05-22
------------------
- Simplified and made more robust the function ``compute_center``.
- Simplified the functions ``compute_stop_stats``, ``compute_route_stats``, and ``compute_feed_stats``.
- Added the function ``get_week``, a generalization of the function ``get_first_week``.
- Breaking change: renamed the function ``restrict_dates`` to ``subset_dates``, so as not to be confused with the function ``restrict_to_dates``. Also changed the signature of ``restrict_dates``.

9.6.3, 2019-05-16
-----------------
- Bugfixed warning about stops with no stop times in the function ``check_stops``.
- Bugfixed removing stations in the ``restrict_to_*`` functions.

9.6.2, 2019-05-16
-----------------
- Bugfixed parent station cleaning in the function ``drop_zombies``.

9.6.1, 2019-05-15
-----------------
- Checked for undefined parent stations in the module ``validators.py`` and added functionality to remove them in the module ``cleaners.py``.

9.6.0, 2019-05-01
-----------------
- Added ``split_route_types`` flag to the functions ``compute_feed_stats`` and ``compute_feed_time_series``.
- Added helper functions ``unstack_time_series`` and ``restack_time_series``.
- Named time series axis ``"datetime"``.
- Bugfixed Feed instance printing.
- Replaced NaN service speeds in time series with service distance (0 or NaN).
- Bugfixed function ``downsample`` to preserve all-NaN sections.

9.5.1, 2019-04-29
-----------------
- Merged `Pull request 13 <https://github.com/mrcagney/gtfstk/pull/13>`_ to handle stops without geocoordinates.

9.5.0, 2019-04-16
-----------------
- Merged `Pull request 11 <https://github.com/mrcagney/gtfstk/pull/11>`_ to update validators to accept pathways according to the latest GTFS.

9.4.0, 2019-04-02
-----------------
- Added ``stops.map_stops``.
- Replaced library ``json2html`` with ``json2table``.
- Switched to using f-strings.
- Added type hints

9.3.5, 2019-02-26
-----------------
- Handled the edge case of no stop stats in ``miscellany.compute_center``.

9.3.4, 2018-12-05
------------------
- Switched from Pipenv to Poetry.

9.3.3, 2018-09-25
------------------
- Stopped reading GTFS tables with no data.

9.3.2, 2018-09-14
------------------
- Fixed `Issue 10 <https://github.com/mrcagney/gtfstk/issues/10>`_.
- Fixed some deprecation warnings.

9.3.1, 2018-08-24
-----------------
- Bugfixed validators with `Pull Request 8 <https://github.com/mrcagney/gtfstk/pull/8>`_.

9.3.0, 2018-08-01
------------------
- Replaced ``count_active_trips`` with cjer's faster ``get_active_trips_df``, yielding a ~6x speed up on ``compute_route_stats``.
- Autoformated code with Black.
- Added ``restrict_to_dates``.
- Dropped support for Python < 3.6.

9.2.3, 2018-05-25
------------------
- Bugfixed ``geometrize_stops`` which was putting some NaNs in the geometry column.

9.2.2, 2018-05-24
------------------
- Added trip direction arrows to maps produced by ``map_trips``.

9.2.1, 2018-05-24
------------------
- Fixed bug HTML-escaping apostrophes in ``make_html``.

9.2.0, 2018-05-23
------------------
- Added ``map_trips`` which works like ``map_routes``.

9.1.0, 2018-05-02
------------------
- Changed ``route_to_geojson`` to return LineStrings instead of a MultiLineString and added a date keyword argurment.
- Changed ``shapes_to_geojson`` to accept an optional list of shape IDs to restrict to.
- Added ``map_routes`` function to draw routes and their stops on a Folium map, if Folium is installed.
- Inserted stars in function signatures to separate boolean keyword arguments. Is this a breaking change? I say no, but it's debatable.
- Changed ``compute_trip_stats`` to accept an optional list of route IDs to restrict to.
- Clarified the doctstrings of ``compute_route_stats`` and ``compute_route_time_series`` to note that those functions can accept slices of trip stats.
- Changed ``compute_stop_stats`` and ``compute_stop_time_series`` to accept an optional list of stop IDs.

9.0.3, 2018-03-21
------------------
- Stopped ``drop_zombies`` from dropping stops with location type 1 or 2.
- Changed ``CRS_WGS84`` to ``WGS84`` and removed the ``no_defs`` key to agree with GeoPandas's WGS84 CRS.
- Replaced some ``None`` outputs with empty dictionary outputs where appropriate, e.g. in ``build_shape_by_geometry``.

9.0.2, 2017-07-12
-------------------
- Bugfixed the ``get_dates()`` function. It was throwing an error when the calendar or calendar_dates table was empty.

9.0.1, 2017-07-06
-------------------
- Bugfixed the stats and time series functions. They were throwing errors in the edge case where all the given dates had no active trips.
- Bugfixed ``combine_time_series()``. Its direction ID column names were ``'0'`` and ``'1'`` but should be ``0`` and ``1``.

9.0.0, 2017-07-04
-------------------
- Added informative printing for Feeds.
- Removed the ``time_it`` decorator in favor of IPython's ``%time`` magic .
- Inspired by the `Transitland Dispatcher <https://transit.land/dispatcher/feed-versions/eb0cbe5ab41c9cfde0ebae42471ab5b3f712b008>`_, added the ``summarize`` function and the ``list_gtfs`` function.
- Extended several functions to accept date lists, a breaking change for the outputs of those functions. For example, now you can compute feed stats for the entire feed period more easily and quickly (by memoizing active trip IDs) than computing the stats separately for each date.
- By popular demand, redefined the ``num_trips`` indicator in route and feed time series to be the number of unique trips active in a time bin instead of the time weighted average thereof.
- Removed columns from empty DataFrames returned by ``compute_route_stats`` etc.
- Elaborated docstrings.

8.0.2, 2017-05-09
-------------------
- Updated the installation requirements in ``setup.py``.

8.0.1, 2017-04-26
-------------------
- Fixed the bug where ``setup.py`` could not find the license file.

8.0.0, 2017-04-21
-----------------
- Finally knuckled down and wrote a GTFS validator: ``validators.py``.  It's basic, easy to read, and, thanks to Pandas, fast.  It checks `this 31 MB Southeast Queensland feed <http://transitfeeds.com/p/translink/21/20170310>`_ in 22 seconds on my 2.8-GHz-processor-16-GB-memory computer.  With the same computer and feed and in fast mode (``--memory_db``), `Google's GTFS validator <https://github.com/google/transitfeed>`_ takes 420 seconds. That's about 19 times slower. Part of the latter validator's slowness is its many checks beyond the GTFS, such as checks for too fast travel between every pair of stop times.
- Moved all but the most basic ``Feed`` methods into other modules grouped by theme, ``routes.py``, ``stops.py``, etc.  Eases reading and additionally exposes the methods as functions on feeds, like in the GTFSTK versions before 7.0.0.
- Speeded up ``asssess_quality``.
- Refactored ``constants.py``.
- Renamed some functions.

7.0.0, 2017-04-07
-----------------
- Rewrote most feed functions as ``Feed`` methods.
- Rewrote tests for pytest.
- Removed some miscellaneous functions, such as plotting functions.

6.1.0, 2016-11-24
-----------------
- Changed ``feed.read_gtfs`` to unzip to temporary directory.
- Enabled ``feed.write_gtfs`` to write to a directory.

6.0.0, 2016-10-17
-----------------
- Improved function names, e.g. ``compute_trips_stats`` -> ``compute_trip_stats``.
- Added functions to ``cleaner.py`` and changed cleaning function outputs to feed instances.
- Made ``feed.copy`` a method.
- Simplified Feed objects and added auto-updates to secondary attributes.
- Changed the signatures of a few functions, e.g. ``calculator.append_dist_to_shapes`` now returns a feed instead of a shapes data frame.
- Fixed formatting of properties field in ``calculator.trip_to_geojson`` and ``calculator.route_to_geojson``.

5.1.1, 2016-09-01
-----------------
- Bugfix: Added ``'from_stop_id'`` and ``'to_stop_id'`` to list of string data types in ``constants.py``. Previously, they were sometimes getting interpreted as floats, which stripped leading zeros from the IDs, which then did not match the IDs in the stops data frame.

5.1.0, 2016-08-31
-----------------
- Added trip ID parameter to ``calculator.get_stops``.
- Created ``calculator.trip_to_geojson``.
- Added whitespace stripping to ``cleaner.clean_route_short_names``.

5.0.0, 2016-07-08
-----------------
- Renamed the function ``calculator.get_feed_intersecting_polygon`` to ``calculator.restrict_by_polygon``.
- Added the function ``calculator.restrict_by_routes``.

4.3.0, 2016-07-04
-----------------
- Added the function ``calculator.get_start_and_end_times``.

4.2.0, 2016-07-04
-----------------
- Added the functions ``calculator.compute_center``, ``calculator. compute_bounds``, ``calculator.route_to_geojson``.
- Extended the function ``calculator.get_stops`` to accept an optional route ID.
- Extended the function ``calculator.build_geometry_by_shape`` to accept and optional set of shape IDs.
- Extended the function ``calculator.build_geometry_by_stop`` to accept and optional set of stop IDs.

4.1.2, 2016-07-01
------------------
- Improved distance sanity checks in ``calculator.compute_trip_stats`` and ``calculator.append_dist_to_stop_times``.

4.1.1, 2016-07-01
------------------
- Bugfixed ``feed.copy`` so that the ``dist_units_in`` of the copy equals ``dist_units_out`` of the original.
- Added some more distance sanity checks to ``calculator.compute_trip_stats`` and ``calculator.append_dist_to_stop_times``.

4.1.0, 2016-05-23
------------------
- Improved ``cleaner.clean_route_short_names``.
- Removed ``utilities.clean_series``.
- Improved ``cleaner.aggregate_routes``.
- Removed some unnecessary print statements.

4.0.0, 2016-05-11
------------------
- Deleted an extraneous print statement in ``calculator.create_shapes``.
- Added ``utilities.is_not_null``.
- Changed ``calculator.shapes_to_geojson`` to return a dictionary instead of a string.
- Upgraded to Pandas 0.18.1 and fixed ``calculator.downsample`` accordingly
- Added ``cleaner.aggregate_routes``.

3.0.1, 2015-12-16
------------------
- Bugfix: formatted ``parent_station`` as a string in ``constants.DTYPE``.

3.0.0, 2015-12-15
------------------
- Changed signature and behavior of ``create_shapes``.
- Added duplicate route short name count to ``assess``.
- Changed the behavior of ``clean_route_short_names``.
- Changed ``INT_COLS`` to ``INT_COLUMNS``.
- Moved some functions.
- Added some functions, such as a function to copy feeds.

2.1, 2015-12-08
------------------
- Added more functions to ``calculator.py``, some of which are optional and depend on GeoPandas.
- Documented more.
- Made ``read_gtfs`` raise a more helpful error when an input path does not exist.

2.0.1, 2015-11-19
--------------------
- Made Matplotlib import optional.
- Updated plotter function chart colors.

2.0.0, 2015-11-06
-------------------
- Moved the ``Feed`` class into a separate file.
- Fixed a fatal bug in ``plot_routes_time_series`` and renamed it ``plot_feed_time_series``.
- Added ``route_type`` to trips stats and routes stats.
- Added more functions to the ``cleaner`` module.

1.0.0, 2015-11-04
--------------------
- Modularized more
- Refactored the Feed class, exporting most methods to functions.
- Changed function names, favoring a ``compute_`` prefix over a ``get_`` prefix for complex functions.
- Bug fix: in ``INT_COLUMNS`` changed ``'dropoff_type'`` to ``'drop_off_type'``.

0.12.3, 2015-07-18
--------------------
- Changed to return empty data frames instead of ``None`` where appropriate
- Added ``Feed.clean_route_short_names``.
- Changed the inputs and outputs of ``get_stops_stats`` and ``get_stops_time_series``.
- Replaced ``assert`` statements with exceptions.

0.12.2, 2015-07-06
--------------------
- Changed name to ``gtfstk``.

0.12.1, 2015-06-24
--------------------
- Added ``route_short_name`` and ``min_headway`` to trips stats and routes stats.
- Changed the default handling of distance units in ``Feed``.

0.12.0, 2015-04-21
--------------------
- Assembled ``feed.py`` and ``utils.py`` into a unified top-level package by tweaking ``__init__.py``.
- Renamed ``get_linestring_by_shape`` and ``get_point_by_stop`` to ``get_geometry_by_shape`` and ``get_geometry_by_stop``, respectively.

0.11.16, 2015-04-20
---------------------
- Added ``min_transfer_time`` to ``INT_COLUMNS``.

0.11.15, 2015-04-14
---------------------
- Fixed ``get_route_timetable`` sort order.

0.11.14, 2015-04-14
---------------------
- Added data frame empty checks to ``Feed.__init__``, because i was getting errors on feeds with empty ``calendar.txt`` files.

0.11.13, 2015-04-14
---------------------
- Removed ``parent_station`` from ``INT_COLUMNS``, which should have never been there in the first place.

0.11.12, 2015-04-13
---------------------
- Now you can specify the output distance units.

0.11.11, 2015-04-08
---------------------
- Changed most functions to return an empty data frame instead of ``None``.
- Fixed ``export`` so that integer columns, such as 'bike_allowed', that have at least on NaN value no longer get formatted as floats in the output CSVs.

0.11.10, 2015-04-03
---------------------
- Reduced columns in ``get_trips_activity``.
- Added ``clean_series``.

0.11.9, 2015-04-03
---------------------
- Fixed a bug/typo in the computation of the ``service_distance`` and ``service_duration`` columns of feed stats.

0.11.8, 2015-03-27
---------------------
- Fixed a bug in the computation of the ``peak_start_time`` and ``peak_end_time`` columns of routes stats and feed stats.

0.11.7, 2015-03-27
---------------------
- Added more columns to ``get_routes_stats``.
- Added ``get_feed_stats`` and ``get_feed_time_series`` and removed the similar ``agg_routes_stats`` and ``agg_routes_time_series``.
- Removed ``dump_all_stats``, because it wasn't very useful.
- Replaced ``get_busiest_date_of_first_week`` with ``get_busiest_date``.

0.11.6, 2015-03-16
---------------------
- Cleaned code slightly.
- Added 'speed' column in trips stats.
- Added 'is_loop' column in trips stats and routes stats.
- Added more tests.

0.11.5, 2015-03-13
---------------------
- Added route and stop timetable methods.
- Improved tests slightly.
- Tidied code slightly.
- Change occurrences of 'vehicle' to 'trips', because that's clearer.
- Updated some packages.

0.11.4, 2015-03-12
---------------------
- Changed name to gtfs-tk.

0.11.3, 2015-03-02
----------------------
- Add ``get_shapes_geojson``.
- Renamed ``get_active_trips`` and ``get_active_stops`` to ``get_trips`` and ``get_stops``.
- Upgraded to Pandas 0.15.2.

0.11.2, 2014-12-10
----------------------
- Scooped out main logic from ``Feed.get_stops_stats`` and ``Feed.get_stops_time_series`` and put it into top level functions for the sake of greater flexibility.  Similar to what i did for ``Feed.get_routes_stats`` and ``Feed.get_routes_time_series``.
- Fixed a bug in computing the last stop of each trip in ``get_trips_stats``.
- Improved the accuracy of trip distances in ``get_trips_stats``.
- Upgraded to Pandas 0.15.1.

0.11.1, 2014-11-12
----------------------
- Added ``fill_nan_route_short_names``.
- Switched back to version numbering in the style of major.minor.micro, because that seems more useful.

0.11, 2014-11-10
----------------------
- Fixed a bug in ``Feed.get_routes_stats`` that modified the input data frame and therefore affected the same data frame outside of the function (dumb Pandas gotcha). Changed it to operate on a copy of the data frame instead.

0.10, 2014-11-06
----------------------
- Speeded up time series computations by at least a factor of 10.
- Switched from representing dates as ``datetime.date`` objects to '%Y%m%d' strings (the GTFS way of representing dates), because that's simpler and faster. Added an export method to feed objects.
- Minor tweaks to ``append_dist_to_stop_times``.

0.9, 2014-10-29
----------------------
- Scooped out main logic from ``Feed.get_routes_stats`` and ``Feed.get_routes_time_series`` and put it into top level functions for the sake of greater flexibility.  I at least need that flexibility to plug into another project.

0.8, 2014-10-24
----------------------
- Simplified methods to accept a single date instead of a list of dates.

0.7, 2014-10-08
----------------------
- Whoops, lost track of the changes for this version.

0.6, 2014-10-08
----------------------
- Changed ``seconds_to_time`` to ``timestr_to_seconds.``.  Added ``get_busiest_date_of_first_week``.

0.5, 2014-10-02
----------------------
- Converted headways to minutes
- Added option to change headway start and end time cutoffs in ``get_stops_stats`` and ``get_stations_stats``

0.4, 2014-10-02
---------------------
- Fixed a bug in get_trips_stats that caused a failure when a trip was missing a shape ID.

0.3, 2014-09-29
----------------------
- Switched from major.minor.micro version numbering to major.minor numbering
- Added ``get_vehicle_locations``.

0.2.3, 2014-08-22
----------------------
- Added ``append_dist_to_stop_times`` and ``append_dist_to_shapes``.

0.2.2, 2014-08-17
----------------------
- Changed ``get_xy_by_stop`` name and output type.

0.2.1, 2014-07-22
----------------------
- Changed from period indices to timestamp indices for time series, because the latter are better supported in Pandas.
- Upgraded to Pandas 0.14.1.

0.2.0, 2014-07-22
----------------------
- Restructured modules.

0.1.12, 2014-07-21
----------------------
- Created stats and time series aggregating functions.

0.1.11, 2014-07-17
----------------------
- Added ``get_dist_from_shapes`` keyword to ``get_trips_stats``.

0.1.10, 2014-07-17
----------------------
- Fixed some typos and cleaned up the directory.

0.1.9, 2014-07-17
----------------------
- Changed ``get_routes_stats`` headway calculation.
- Fixed inconsistent outputs in time series functions.

0.1.8, 2014-07-16
----------------------
- Minor tweak to ``downsample``.

0.1.7, 2014-07-16
----------------------
- Improved ``get_trips_stats`` and cleaned up code.

0.1.6, 2014-07-04
----------------------
- Changed time series format.

0.1.5, 2014-06-23
----------------------
- Added documentation.

0.1.4, 2014-06-20
----------------------
- Upgraded to Python 3.4.

0.1.3, 2014-06-01
----------------------
- Created ``utils.py`` and updated Pandas to 0.14.0.

0.1.2, 2014-05-26
----------------------
-Minor refactoring and tweaks to packaging.

0.1.1, 2014-05-26
----------------------
- Minor tweaks to packaging.

0.1.0, 2014-05-26
----------------------
- Initial version.


text:
@extends('layout.default')
@section('page-meta')
<title>Tasks - Javul.org</title>
@endsection
@section('content')

        @include('elements.user-menu',['page'=>'tasks'])

Tasks

                                        <select name="task_skill_search" class="form-control" id="task_skill_search"></select>

                                        <select name="task_status_search" class="form-control" id="task_status_search">
                                            <option value="">Search by status</option>
                                            <?php $task_status = \App\SiteConfigs::task_status(); asort($task_status); ?>
                                            @foreach($task_status as $index=>$status)
                                                <option value="{{$index}}">{{ $status }}</option>
                                            @endforeach
                                        </select>

                                    Search

                                    Reset

                            Task Name
                            Objective Name
                            Unit Name
                            Skills
                            Assigned to
                            Status
                            Action

                        @if(count($tasks) > 0 )
                            @foreach($tasks as $task)
                                @include('tasks.partials.task_listing',['task'=>$task])
                            @endforeach
                        @else

                            No record(s) found.

                        @endif

                                @if($tasks->lastPage() > 1 && $tasks->lastPage() != $tasks->currentPage())
                                    url($tasks->currentPage()+1) }}" class="btn more-black-btn more-tasks"
                                       id="add_unit_btn"
                                       type="button">
                                        MORE TASKS ...

                                @endif

                    @include('elements.site_activities',['ajax'=>false])

@include('elements.footer')
@stop
@section('page-scripts')

@endsection


text:
import { Component, OnChanges, Input, Output, EventEmitter, SimpleChanges, Inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ApiService } from '../api/api.service';
import { ContactDialogComponent } from './contact-dialog.component';

@Component({
  selector: 'contact',
  template: '

'
})
export class ContactComponent implements OnChanges {
  @Input() open: any;
  @Input() info: any;
  @Input() strategy: any;
  @Input() api: any;
  @Output() onContactClose = new EventEmitter<void>();

  constructor(
    public dialog: MatDialog,
    @Inject(ApiService) public apiService: ApiService) {
  }

  ngOnChanges(changes: SimpleChanges): void {
    if (this.open && this.open.opened && this.dialog.openDialogs.length === 0) {
      if (this.api) {
        this.openContactDialog();
      } else {
        this.apiService.getApi().subscribe((api: any) => {
          this.api = api;
          this.openContactDialog();
        }, () => {
          //TODO error
        });
      }
    }
  }

  openContactDialog(): void {

    const data = {
      info: this.info,
      strategy: this.strategy,
      api: this.api
    };

    this.dialog.open(ContactDialogComponent, {
      width: '500px',
      data: data
    }).afterClosed().subscribe(result => {
      if (!result || result === 'closeAction') {
        this.onContactClose.emit();
      }
    });
  }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v12/services/merchant_center_link_service.proto

namespace Google\Ads\GoogleAds\V12\Services;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A single update on a Merchant Center link.
 *
 * Generated from protobuf message google.ads.googleads.v12.services.MerchantCenterLinkOperation
 */
class MerchantCenterLinkOperation extends \Google\Protobuf\Internal\Message
{
    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3;
     */
    protected $update_mask = null;
    protected $operation;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           FieldMask that determines which resource fields are modified in an update.
     *     @type \Google\Ads\GoogleAds\V12\Resources\MerchantCenterLink $update
     *           Update operation: The merchant center link is expected to have a valid
     *           resource name.
     *     @type string $remove
     *           Remove operation: A resource name for the removed merchant center link is
     *           expected, in this format:
     *           `customers/{customer_id}/merchantCenterLinks/{merchant_center_id}`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V12\Services\MerchantCenterLinkService::initOnce();
        parent::__construct($data);
    }

    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3;
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3;
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

    /**
     * Update operation: The merchant center link is expected to have a valid
     * resource name.
     *
     * Generated from protobuf field .google.ads.googleads.v12.resources.MerchantCenterLink update = 1;
     * @return \Google\Ads\GoogleAds\V12\Resources\MerchantCenterLink|null
     */
    public function getUpdate()
    {
        return $this->readOneof(1);
    }

    public function hasUpdate()
    {
        return $this->hasOneof(1);
    }

    /**
     * Update operation: The merchant center link is expected to have a valid
     * resource name.
     *
     * Generated from protobuf field .google.ads.googleads.v12.resources.MerchantCenterLink update = 1;
     * @param \Google\Ads\GoogleAds\V12\Resources\MerchantCenterLink $var
     * @return $this
     */
    public function setUpdate($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V12\Resources\MerchantCenterLink::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Remove operation: A resource name for the removed merchant center link is
     * expected, in this format:
     * `customers/{customer_id}/merchantCenterLinks/{merchant_center_id}`
     *
     * Generated from protobuf field string remove = 2 [(.google.api.resource_reference) = {
     * @return string
     */
    public function getRemove()
    {
        return $this->readOneof(2);
    }

    public function hasRemove()
    {
        return $this->hasOneof(2);
    }

    /**
     * Remove operation: A resource name for the removed merchant center link is
     * expected, in this format:
     * `customers/{customer_id}/merchantCenterLinks/{merchant_center_id}`
     *
     * Generated from protobuf field string remove = 2 [(.google.api.resource_reference) = {
     * @param string $var
     * @return $this
     */
    public function setRemove($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getOperation()
    {
        return $this->whichOneof("operation");
    }

}


text:
@protocol DVTLocking
- (void)dvt_asyncPerformLockedBlock:(void (^)(void))arg1;
- (void)dvt_performLockedBlock:(void (^)(void))arg1;
@end


text:
/// <reference path="jquery-3.4.1.js" />
/// <autosync enabled="true" />
/// <reference path="bootstrap.min.js" />
/// <reference path="jquery-3.1.1.min.js" />
/// <reference path="jquery-3.1.1.slim.min.js" />
/// <reference path="modernizr-2.8.3.js" />
/// <reference path="respond.js" />
/// <reference path="respond.matchmedia.addListener.js" />


text:
class Node:
    def __init__(self, info):
        self.info = info
        self.left = None
        self.right = None
        self.level = None

    def __str__(self):
        return str(self.info)

def preOrder(root):
    if root == None:
        return
    print (root.info, end=" ")
    preOrder(root.left)
    preOrder(root.right)

class BinarySearchTree:
    def __init__(self):
        self.root = None

    #Node is defined as
    #self.left (the left child of the node)
    #self.right (the right child of the node)
    #self.info (the value of the node)
    def insert(self, val):
        if self.root == None:
            self.root = Node(val)
        else:
            current = self.root
            while True:
                if current.info > val:
                    if current.left:
                        current = current.left
                    else:
                        current.left = Node(val)
                        break
                elif current.info < val:
                    if current.right:
                        current = current.right
                    else:
                        current.right = Node(val)
                        break
                else:
                    break

tree = BinarySearchTree()
t = int(input())
arr = list(map(int, input().split()))
for i in range(t):
    tree.insert(arr[i])
preOrder(tree.root)


text:
<?php

namespace App\Exception;

class InvalidTaskCurrencyException extends \Exception
{
}


text:
package mvm.rya.reasoning;

/**
 * Represents the OWL RL/RDF rules used in reasoning.
 */
public enum OwlRule {
    // Schema rules, handled by Schema:
    SCM_CLS,
    SCM_SCO,
    SCM_EQC1,
    SCM_EQC2,
    SCM_OP,
    SCM_DP,
    SCM_SPO,
    SCM_EQP1,
    SCM_EQP2,
    SCM_DOM1,
    SCM_DOM2,
    SCM_RNG1,
    SCM_RNG2,
    SCM_HV,
    SCM_SVF1,
    SCM_SVF2,
    SCM_AVF1,
    SCM_AVF2,

    // Instance rules, handled by LocalReasoner:
    CLS_NOTHING2("No resource can have type owl:Nothing"),
    PRP_IRP("owl:IrreflexiveProperty -- Resource can't be related to itself via irreflexive property"),
    PRP_DOM("rdfs:domain -- Predicate's domain implies subject's type"),
    PRP_RNG("rdfs:range -- Predicate's range implies object's type"),
    CAX_SCO("owl:subClassOf -- Infer supertypes"),
    // Combine prp-inv1 and prp-inv2, since inverseOf is symmetric:
    PRP_INV("owl:inverseOf -- Relation via one property implies reverse relation via the inverse property"),
    PRP_SPO1("rdfs:subPropertyOf -- Relation via subproperty implies relation via superproperty"),
    PRP_SYMP("owl:SymmetricProperty -- Relation via this property is always bidirectional"),
    CLS_SVF2("owl:someValuesFrom(owl:Thing) -- Infer membership in the set of resources related via this property to anything"),
    CLS_HV2("owl:hasValue -- Infer membership in the set of all resources having a specific property+value"),
    CLS_HV1("owl:hasValue -- Infer a specific property+value from the subject's membership in the set of resources with that property+value"),

    // Combine multiple instance triples, handled by LocalReasoner:
    PRP_ASYP("owl:AsymmetricProperty -- Asymmetric property can't be bidirectional"),
    PRP_PDW("owl:propertyDisjointWith -- Two disjoint properties can't relate the same subject and object"),
    CAX_DW("owl:disjointWith -- Resource can't belong to two disjoint classes"),
    CLS_COM("owl:complementOf -- Resource can't belong to both a class and its complement"),
    CLS_MAXC1("owl:maxCardinality(0) -- Max cardinality 0 for this property implies subject can't have any relation via the property"),
    CLS_MAXQC2("owl:maxQualifiedCardinality(0/owl:Thing) -- Max cardinality 0 (with respect to owl:Thing) implies subject can't have any relation via the property"),
    PRP_TRP("owl:TransitiveProperty -- Infer transitive relation"),
    CLS_SVF1("owl:someValuesFrom -- Infer membership in the set of resources related via this property to an instance of the appropriate type"),
    CLS_AVF("owl:allValuesFrom -- Infer the object's type from the subject's membership in the set of resources whose values for this property all belong to one type"),

    NONE("No rule given");

    public String desc;
    OwlRule() { desc = this.toString(); }
    OwlRule(String desc) {
        this.desc = desc;
    }
}


text:
ONOS Web UI - Topo2Label Documentation
====================================

This is a base class for creating a label

#Exposed methods

## initialize()
## onChange()
By default:
updates the label text if `this.set({label: 'value'})` is called
updates the position if `this.set({x: 'value', y: 'value'})` is called

## applyStyles()
Applies the style property (`this.get('styles')`) to the DOM elements

## renderText()
Creates the default rendering for the text

## renderIcon()
Creates the default rendering for the icon

## render()
Creates the default DOM structure for the entire label.
Calls `this.renderIcon()` and `this.renderText()`

## remove()
Removes the label from the DOM

# Overrides
## setPosition()
Must set properties x and y
```Javascript
this.set({
    x: 10,
    y: 20,
})
```

## setScale()
Called whenever a user scales the topology view

## beforeRender()
## afterRender()


text:
require('shelljs/global');
const gulp = require('gulp4');
const developServer = require('gulp-develop-server');
const newer = require('gulp-newer');
const notifier = require('node-notifier');

const notify = message => {
  notifier.notify({
    title: 'Koa for rest notify!',
    message
  });
};
const distFolder = 'dist';

gulp.task('clean', done => {
  rm('-rf', distFolder);
  done();
});

gulp.task('clean.routes', done => {
  rm('-rf', `${distFolder}/routes`);
  done();
});

gulp.task('copy', () => {
  return gulp.src([
    'src/**/*',
    'package.json'
  ])
    .pipe(newer(distFolder))
    .pipe(gulp.dest(distFolder));
});

gulp.task('serve', done => {
  developServer.listen({ path: 'dist/index.js' }, err => {
    err && console.error(err);
    notify('Server started, begin watching...');
    done();
  });
});

gulp.task('restart', done => {
  developServer.restart(err => {
    err && console.error(err);
    notify('Restart successfully.');
    done();
  });
});

gulp.task('watch', done => {
  gulp.watch([
    'src/**/*'
  ], { debounceDelay: 2000 }, gulp.series('clean.routes', 'copy', 'restart'));
  done();
});

gulp.task('dev', gulp.series(
  'clean',
  'copy',
  gulp.parallel('serve', 'watch')
));

gulp.task('installDeps', done => {
  cd('dist');
  exec('npm i --production');
  done();
});

gulp.task('build', gulp.series(
  'clean',
  'copy',
  'installDeps'
));


text:
package org.qcri.rheem.profiler.java;

import org.qcri.rheem.java.operators.JavaTextFileSource;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.function.Supplier;

/**
 * {@link OperatorProfiler} for sources.
 */
public class JavaTextFileSourceProfiler extends SourceProfiler {

    private File tempFile;

    public JavaTextFileSourceProfiler(Supplier<String> dataQuantumGenerator, String fileUrl) {
        super(() -> new JavaTextFileSource(fileUrl), dataQuantumGenerator);
    }

    @Override
    void setUpSourceData(long cardinality) throws Exception {
        if (this.tempFile != null) {
            if (!this.tempFile.delete()) {
                this.logger.warn("Could not delete {}.", this.tempFile);
            }
        }
        this.tempFile = File.createTempFile("rheem-java", "txt");
        this.tempFile.deleteOnExit();

        // Create input data.
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(this.tempFile))) {
            final Supplier<?> supplier = this.dataQuantumGenerators.get(0);
            for (int i = 0; i < cardinality; i++) {
                writer.write(supplier.get().toString());
                writer.write('\n');
            }
        }
    }

    @Override
    protected long provideDiskBytes() {
        return this.tempFile.length();
    }

}


text:
'use strict';
require('rootpath')();

const server = require('src/server');

beforeAll(function (done) {
    server.start().then(done);
});


text:
package com.freetymekiyan.algorithms.level.medium;

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

/**
 * 294. Flip Game II
 *

 * You are playing the following Flip Game with your friend: Given a string that contains only these two characters: +
 * and -, you and your friend take turns to flip two consecutive "++" into "--". The game ends when a person can no
 * longer make a move and therefore the other person will be the winner.
 *

 * Write a function to determine if the starting player can guarantee a win.
 *

 * Example:
 *

 * Input: s = "++++"
 * Output: true
 * Explanation: The starting player can guarantee a win by flipping the middle "++" to become "+--+".
 * Follow up:
 * Derive your algorithm's runtime complexity.
 *

 * Companies: Google
 *

 * Related Topics: Backtracking, Minimax
 *

 * Similar Questions: (E) Nim Game, (E) Flip Game, (M) Guess Number Higher or Lower II, (M) Can I Win
 */
public class FlipGame2 {

  public boolean canWin(String s) {
    if (s == null || s.length() < 2) return false;
    Map<String, Boolean> map = new HashMap<>();
    return canWin(s, map);
  }

  public boolean canWin(String s, Map<String, Boolean> map) {
    if (map.containsKey(s)) return map.get(s);
    for (int i = 0; i < s.length() - 1; i++) {
      if (s.charAt(i) == '+' && s.charAt(i + 1) == '+') {
        String opponent = s.substring(0, i) + "--" + s.substring(i + 2);
        if (!canWin(opponent, map)) {
          map.put(s, true);
          return true;
        }
      }
    }
    map.put(s, false);
    return false;
  }
}


text:
package com.vladium.jcd.cls.constant;

import java.io.IOException;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;

// ----------------------------------------------------------------------------
/**
 * The CONSTANT_Integer_info and CONSTANT_Float_info structures represent
 * four-byte numeric (int and float) constants.<P>
 *
 * The bytes item of the CONSTANT_Integer_info structure contains the value of
 * the int constant. The bytes of the value are stored in big-endian (high byte
 * first) order.
 *
 * @author (C) 2001, Vlad Roubtsov
 */
public
final class CONSTANT_Integer_info extends CONSTANT_literal_info
{
    // public: ................................................................

    public static final byte TAG = 3;

    public int m_value;

    public CONSTANT_Integer_info (final int value)
    {
        m_value = value;
    }

    public final byte tag ()
    {
        return TAG;
    }

    // Visitor:

    public Object accept (final ICONSTANTVisitor visitor, final Object ctx)
    {
        return visitor.visit (this, ctx);
    }

    public String toString ()
    {
        return Integer.toString (m_value);
    }

    // Cloneable: inherited clone() is Ok

    // IClassFormatOutput:

    public void writeInClassFormat (final UDataOutputStream out) throws IOException
    {
        super.writeInClassFormat (out);

        out.writeInt (m_value);
    }

    // protected: .............................................................

    protected CONSTANT_Integer_info (final UDataInputStream bytes) throws IOException
    {
        m_value = bytes.readInt ();
    }

    // package: ...............................................................

    // private: ...............................................................

} // end of class
// ----------------------------------------------------------------------------


text:
package storm

import (
	"fmt"
	"reflect"

	"github.com/boltdb/bolt"
	"github.com/fatih/structs"
)

// Find returns one or more records by the specified index
func (n *Node) Find(fieldName string, value interface{}, to interface{}, options ...func(q *queryOptions)) error {
	ref := reflect.ValueOf(to)

	if ref.Kind() != reflect.Ptr || reflect.Indirect(ref).Kind() != reflect.Slice {
		return ErrSlicePtrNeeded
	}

	typ := reflect.Indirect(ref).Type().Elem()
	newElem := reflect.New(typ)

	d := structs.New(newElem.Interface())
	bucketName := d.Name()
	if bucketName == "" {
		return ErrNoName
	}

	field, ok := d.FieldOk(fieldName)
	if !ok {
		return fmt.Errorf("field %s not found", fieldName)
	}

	tag := field.Tag("storm")
	if tag == "" {
		return fmt.Errorf("index %s not found", fieldName)
	}

	val, err := toBytes(value, n.s.Codec)
	if err != nil {
		return err
	}

	opts := newQueryOptions()
	for _, fn := range options {
		fn(opts)
	}

	if n.tx != nil {
		return n.find(n.tx, bucketName, fieldName, tag, &ref, val, opts)
	}

	return n.s.Bolt.View(func(tx *bolt.Tx) error {
		return n.find(tx, bucketName, fieldName, tag, &ref, val, opts)
	})
}

func (n *Node) find(tx *bolt.Tx, bucketName, fieldName, tag string, ref *reflect.Value, val []byte, opts *queryOptions) error {
	bucket := n.GetBucket(tx, bucketName)
	if bucket == nil {
		return fmt.Errorf("bucket %s not found", bucketName)
	}

	idx, err := getIndex(bucket, tag, fieldName)
	if err != nil {
		return err
	}

	list, err := idx.All(val, opts)
	if err != nil {
		return err
	}

	results := reflect.MakeSlice(reflect.Indirect(*ref).Type(), len(list), len(list))

	for i := range list {
		raw := bucket.Get(list[i])
		if raw == nil {
			return ErrNotFound
		}

		err = n.s.Codec.Decode(raw, results.Index(i).Addr().Interface())
		if err != nil {
			return err
		}
	}

	reflect.Indirect(*ref).Set(results)
	return nil
}

// Find returns one or more records by the specified index
func (s *DB) Find(fieldName string, value interface{}, to interface{}, options ...func(q *queryOptions)) error {
	return s.root.Find(fieldName, value, to, options...)
}


text:
<!-- RadarGun 2.0 benchmark -->
<benchmark xmlns="urn:radargun:benchmark:2.0">

   <!-- The  benchmark will be executed within single JVM -->
   <local/>

   <!-- List of configurations of the services -->
   <configurations>
      <config name="Infinispan 5.2 - local">
         <!-- All slaves use the same configuration -->
         <setup plugin="infinispan52">
            <embedded xmlns="urn:radargun:plugins:infinispan52:2.0" file="local.xml"/>
         </setup>
      </config>
      <config name="Infinispan 6.0 - local">
         <setup plugin="infinispan60">
            <embedded xmlns="urn:radargun:plugins:infinispan60:2.0" file="local.xml"/>
         </setup>
      </config>
   </configurations>

   <!-- Sequence of stages executed on the cluster -->
   <scenario>
      <!-- Start services on all nodes -->
      <service-start />
      <!-- Begin monitoring of CPU, memory usage and GC -->
      <jvm-monitor-start />

      <!-- Preload the cache with data -->
      <load-data num-entries="5000"/>

      <!-- 5 threads will execute total of 10,000,000 random requests against the default cache ('testCache')-->
      <!-- As the test is called 'warmup', performance statistics won't be reported -->
      <basic-operations-test test-name="warmup"
                             num-requests="10000000" num-threads-per-node="5">
         <key-selector>
            <concurrent-keys total-entries="5000" />
         </key-selector>
      </basic-operations-test>

      <!-- 10 will execute random requests for 1 minute against the default cache ('testCache') -->
      <basic-operations-test test-name="stress-test"
                             duration="1m" num-threads-per-node="10">
         <key-selector>
            <concurrent-keys total-entries="5000"/>
         </key-selector>
      </basic-operations-test>

      <!-- Stop JVM monitoring -->
      <jvm-monitor-stop />
   </scenario>

   <!-- How the statistics are reported -->
   <reports>
      <!-- Produce CSV statistics report -->
      <reporter type="csv"/>
      <!-- Produce HTML statistics report -->
      <reporter type="html"/>
   </reports>

</benchmark>


text:
Pattern: Direct variable interpolation

Issue: -

## Description

This rule checks for variable interpolation (like `#@ivar`).

## Examples

```ruby
class Person
  attr_reader :first_name, :last_name

  def initialize(first_name, last_name)
    @first_name = first_name
    @last_name = last_name
  end

  # bad - valid, but awkward
  def to_s
    "#@first_name #@last_name"
  end

  # good
  def to_s
    "#{@first_name} #{@last_name}"
  end
end

$global = 0
# bad
puts "$global = #$global"

# good
puts "$global = #{$global}"
```

## Further Reading

* [RuboCop - Style/VariableInterpolation](https://rubocop.readthedocs.io/en/latest/cops_style/#stylevariableinterpolation)
* [https://github.com/bbatsov/ruby-style-guide#curlies-interpolate](https://github.com/bbatsov/ruby-style-guide#curlies-interpolate)


text:
package io.digdag.cli.client;

import java.io.PrintStream;
import java.util.List;

import javax.ws.rs.NotFoundException;
import io.digdag.cli.SystemExitException;
import io.digdag.client.DigdagClient;
import io.digdag.client.api.RestWorkflowDefinition;
import io.digdag.client.api.RestProject;
import io.digdag.core.Version;

import static io.digdag.cli.SystemExitException.systemExit;

public class ShowWorkflow
    extends ClientCommand
{
    public ShowWorkflow(Version version, PrintStream out, PrintStream err)
    {
        super(version, out, err);
    }

    @Override
    public void mainWithClientException()
        throws Exception
    {
        switch (args.size()) {
        case 0:
            showWorkflows(null);
            break;
        case 1:
            showWorkflows(args.get(0));
            break;
        case 2:
            showWorkflowDetails(args.get(0), args.get(1));
            break;
        default:
            throw usage(null);
        }
    }

    public SystemExitException usage(String error)
    {
        err.println("Usage: digdag workflows [project-name] [name]");
        showCommonOptions();
        return systemExit(error);
    }

    private void showWorkflows(String projName)
        throws Exception
    {
        DigdagClient client = buildClient();

        if (projName != null) {
            RestProject proj = client.getProject(projName);
            ln("  %s", proj.getName());
            for (RestWorkflowDefinition def : client.getWorkflowDefinitions(proj.getId())) {
                ln("    %s", def.getName());
            }
        }
        else {
            for (RestProject proj : client.getProjects()) {
                try {
                    List<RestWorkflowDefinition> defs = client.getWorkflowDefinitions(proj.getId());
                    ln("  %s", proj.getName());
                    for (RestWorkflowDefinition def : defs) {
                        ln("    %s", def.getName());
                    }
                }
                catch (NotFoundException ex) {
                }
            }
        }
        ln("");
        err.println("Use `digdag workflows <project-name> <name>` to show details.");
    }

    private void showWorkflowDetails(String projName, String defName)
        throws Exception
    {
        DigdagClient client = buildClient();

        if (projName != null) {
            RestProject proj = client.getProject(projName);
            RestWorkflowDefinition def = client.getWorkflowDefinition(proj.getId(), defName);
            String yaml = yamlMapper().toYaml(def.getConfig());
            ln("%s", yaml);
        }
        else {
            for (RestProject proj : client.getProjects()) {
                try {
                    RestWorkflowDefinition def = client.getWorkflowDefinition(proj.getId(), defName);
                    String yaml = yamlMapper().toYaml(def.getConfig());
                    ln("%s", yaml);
                    return;
                }
                catch (NotFoundException ex) {
                }
            }
            throw systemExit("Workflow definition '" + defName + "' does not exist.");
        }
    }
}


text:
#ifndef itkImageScanlineIterator_h
#define itkImageScanlineIterator_h

#include "itkImageScanlineConstIterator.h"

namespace itk
{
/** \class ImageScanlineIterator
 * \brief A multi-dimensional iterator templated over image type that walks a
 * region of pixels, scanline by scanline or in the direction of the
 * fastest axis.
 *
 * The itk::ImageScanlineIterator is optimized for iteration speed and is the
 * first choice for pixel-wise operations on an image.
 * This iterator is preferred over the older ImageRegionIterator even when knowledge
 * of the current line state is not desired because of its speed.
 *
 * \sa ImageScanlineConstIterator
 * \sa ImageRegionIterator
 * \ingroup ImageIterators
 * \ingroup ITKCommon
 *
 */
template< typename TImage >
class ITK_TEMPLATE_EXPORT ImageScanlineIterator:public ImageScanlineConstIterator< TImage >
{
public:
  /** Standard class type aliases. */
  using Self = ImageScanlineIterator;
  using Superclass = ImageScanlineConstIterator< TImage >;

  /** Types inherited from the Superclass */
  using IndexType = typename Superclass::IndexType;
  using SizeType = typename Superclass::SizeType;
  using OffsetType = typename Superclass::OffsetType;
  using RegionType = typename Superclass::RegionType;
  using ImageType = typename Superclass::ImageType;
  using PixelContainer = typename Superclass::PixelContainer;
  using PixelContainerPointer = typename Superclass::PixelContainerPointer;
  using InternalPixelType = typename Superclass::InternalPixelType;
  using PixelType = typename Superclass::PixelType;
  using AccessorType = typename Superclass::AccessorType;

  /** Default constructor. Needed since we provide a cast constructor. */
  ImageScanlineIterator();

  /** Constructor establishes an iterator to walk a particular image and a
   * particular region of that image. */
  ImageScanlineIterator(ImageType *ptr, const RegionType & region);

  /** Constructor that can be used to cast from an ImageIterator to an
   * ImageScanlineIterator. Many routines return an ImageIterator but for a
   * particular task, you may want an ImageScanlineIterator.  Rather than
   * provide overloaded APIs that return different types of Iterators, itk
   * returns ImageIterators and uses constructors to cast from an
   * ImageIterator to a ImageScanlineIterator. */
  ImageScanlineIterator(const ImageIterator< TImage > & it);

  /** Set the pixel value */
  void Set(const PixelType & value) const
  {
    this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >(
                                          this->m_Buffer + this->m_Offset ) ), value);
  }

  /** Return a reference to the pixel
   * This method will provide the fastest access to pixel
   * data, but it will NOT support ImageAdaptors. */
  PixelType & Value()
  { return *( const_cast< InternalPixelType * >( this->m_Buffer + this->m_Offset ) ); }

protected:
  /** the construction from a const iterator is declared protected
      in order to enforce const correctness. */
  ImageScanlineIterator(const ImageScanlineConstIterator< TImage > & it);
  Self & operator=(const ImageScanlineConstIterator< TImage > & it);
};
} // end namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkImageScanlineIterator.hxx"
#endif

#endif


text:
using System;
using System.Collections.Generic;

namespace Zenject
{
    public class FromBinderNonGeneric : FromBinder
    {
        public FromBinderNonGeneric(
            BindInfo bindInfo,
            BindFinalizerWrapper finalizerWrapper)
            : base(bindInfo, finalizerWrapper)
        {
        }

        public ScopeArgConditionCopyNonLazyBinder FromFactory<TConcrete, TFactory>()
            where TFactory : IFactory<TConcrete>
        {
            return FromFactoryBase<TConcrete, TFactory>();
        }

        public ScopeArgConditionCopyNonLazyBinder FromMethod<TConcrete>(Func<InjectContext, TConcrete> method)
        {
            return FromMethodBase<TConcrete>(method);
        }

        public ScopeArgConditionCopyNonLazyBinder FromMethodMultiple<TConcrete>(Func<InjectContext, IEnumerable<TConcrete>> method)
        {
            return FromMethodMultipleBase<TConcrete>(method);
        }

        public ScopeConditionCopyNonLazyBinder FromResolveGetter<TObj, TContract>(Func<TObj, TContract> method)
        {
            return FromResolveGetter<TObj, TContract>(null, method);
        }

        public ScopeConditionCopyNonLazyBinder FromResolveGetter<TObj, TContract>(object identifier, Func<TObj, TContract> method)
        {
            return FromResolveGetterBase<TObj, TContract>(identifier, method);
        }

        public ScopeConditionCopyNonLazyBinder FromInstance(object instance)
        {
            return FromInstanceBase(instance);
        }
    }
}


text:
namespace orbit_linux_tracing {

// Wrapper around unwindstack::Maps that simplifies keeping the initial snapshot up to date when new
// mappings are created. It also handles the case of new mappings overlapping existing ones.
class LibunwindstackMaps {
 public:
  virtual ~LibunwindstackMaps() = default;

  virtual std::shared_ptr<unwindstack::MapInfo> Find(uint64_t pc) = 0;
  virtual unwindstack::Maps* Get() = 0;
  virtual void AddAndSort(uint64_t start, uint64_t end, uint64_t offset, uint64_t flags,
                          const std::string& name) = 0;

  static std::unique_ptr<LibunwindstackMaps> ParseMaps(const std::string& maps_buffer);
};

}  // namespace orbit_linux_tracing

#endif  // LINUX_TRACING_LIBUNWINDSTACK_MAPS_H_


text:
<?php

declare(strict_types=1);

namespace Sylius\Component\Core\Test\Services;

interface EmailCheckerInterface
{
    /**
     * @param string $recipient
     *
     * @return bool
     */
    public function hasRecipient(string $recipient): bool;

    /**
     * @param string $message
     * @param string $recipient
     *
     * @return bool
     */
    public function hasMessageTo(string $message, string $recipient): bool;

    /**
     * @param string $recipient
     *
     * @return int
     */
    public function countMessagesTo(string $recipient): int;

    /**
     * @return string
     */
    public function getSpoolDirectory(): string;
}