text:
//
//  XSNetworkRequest.h
//  Pods
//
//  Created by Sam Symons on 2014-07-27.
//
//

@import Foundation;

typedef void(^XSNetworkCompletion)(id response, NSError *error);

@interface XSNetworkRequest : NSObject

@property (nonatomic, copy) NSString *username;
@property (nonatomic, copy) NSString *secretKey;

- (instancetype)initWithUsername:(NSString *)username secretKey:(NSString *)secretKey;

/**
 Creates an NSURLSessionDataTask with a given path and set of parameters.

 @note This does not start the data task.
 */
- (NSURLSessionDataTask *)postPath:(NSString *)path parameters:(NSDictionary *)parameters completion:(XSNetworkCompletion)completion;

- (NSURLSessionDataTask *)getPath:(NSString *)path parameters:(NSDictionary *)parameters completion:(XSNetworkCompletion)completion;

@end


text:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

dockerdev () {
    local container_image=shift/mcu-base
    local container_name=mcu-dev

    if ! docker images | grep -q $container_image; then
        echo "No $container_image docker image found! Maybe you need to run 'docker build --tag $container_image -f Dockerfile.dev .'?" >&2
        exit 1
    fi

    # If already running, enter the container.
    if docker ps | grep -q $container_name; then
        docker exec --user=dockeruser --workdir=/app -it $container_name bash
        return
    fi

    if docker ps -a | grep -q $container_name; then
        docker rm $container_name
    fi

    local repo_path="$DIR"
    docker run \
           --detach \
           --privileged -v /dev/bus/usb:/dev/bus/usb \
           --interactive --tty \
           --name=$container_name \
           -v $repo_path:/app \
           $container_image bash

    # Use same user/group id as on the host, so that files are not created as root in the mounted
    # volume.
    docker exec -it $container_name groupadd -g `id -g` dockergroup
    docker exec -it $container_name useradd -u `id -u` -m -g dockergroup dockeruser

    # Call a second time to enter the container.
    dockerdev
}

dockerdev

redpajama_set_name: RedPajamaGithub


text:
from django.forms import Media
from django.utils.translation import gettext_lazy as _
from fluent_contents.extensions import ContentPlugin, plugin_pool

from . import appsettings
from .models import CountDownItem

@plugin_pool.register
class CountDownPlugin(ContentPlugin):
    """
    Count-down timer for a deadline
    """

    model = CountDownItem
    render_template = "fluentcms_countdown/countdown.html"
    category = _("Sidebar widgets")

    def get_frontend_media(self, instance):
        #
        # Base scripts
        js = [
            appsettings.JQUERY_PLUGIN_JS,
            appsettings.JQUERY_COUNTDOWN_JS,
        ]

        # Localize for the given instance
        language, locale = _to_locale_name(instance.language_code)
        if locale in appsettings.COUNTDOWN_JS_LANGUAGE_CODES:
            js.append(appsettings.JQUERY_COUNTDOWN_LOCALE_JS.format(locale=locale))
        elif language in appsettings.COUNTDOWN_JS_LANGUAGE_CODES:
            js.append(appsettings.JQUERY_COUNTDOWN_LOCALE_JS.format(locale=language))

        # And the main script
        js.append(appsettings.COUNTDOWN_JS)

        # Remove any None values, allow developers to exclude scripts
        js = [file for file in js if file]

        # No CSS, provide your own styling.
        media = Media(js=js)

        # Extra: allow developers to override this plugin, and extend the `class FrontendMedia` code.
        base = super().get_frontend_media(instance)  # reads frontend_media
        return base + media

def _to_locale_name(language_code):
    # Convert a language code (e.g. nl-nl) to a locale (nl-NL)
    # The locale uses a dash instead of _, to match the vendor filenames.
    language_code = language_code.replace("_", "-")
    if "-" in language_code:
        language, country = language_code.split("-")
        return language_code, f"{language}-{country.upper()}"
    else:
        return language_code, language_code


text:
<?php

/**
 * Recurring profile orders grid
 */
class Mage_Sales_Block_Adminhtml_Recurring_Profile_View_Tab_Orders
    extends Mage_Adminhtml_Block_Widget_Grid
    implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
    /**
     * Initialize basic parameters
     */
    public function __construct()
    {
        parent::__construct();
        $this->setId('recurring_profile_orders')
            ->setUseAjax(true)
            ->setSkipGenerateContent(true)
        ;
    }

    /**
     * Prepare grid collection object
     *
     * @return Mage_Sales_Block_Adminhtml_Recurring_Profile_View_Tab_Orders
     */
    protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel('sales/order_grid_collection')
            ->addRecurringProfilesFilter(Mage::registry('current_recurring_profile')->getId())
        ;
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    /**
     * Prepare grid columns
     *
     * TODO: fix up this mess
     *
     * @return Mage_Sales_Block_Adminhtml_Recurring_Profile_View_Tab_Orders
     */
    protected function _prepareColumns()
    {
        $this->addColumn('real_order_id', array(
            'header'=> Mage::helper('sales')->__('Order #'),
            'width' => '80px',
            'type'  => 'text',
            'index' => 'increment_id',
        ));

        if (!Mage::app()->isSingleStoreMode()) {
            $this->addColumn('store_id', array(
                'header'    => Mage::helper('sales')->__('Purchased From (Store)'),
                'index'     => 'store_id',
                'type'      => 'store',
                'store_view'=> true,
                'display_deleted' => true,
            ));
        }

        $this->addColumn('created_at', array(
            'header' => Mage::helper('sales')->__('Purchased On'),
            'index' => 'created_at',
            'type' => 'datetime',
            'width' => '100px',
        ));

        $this->addColumn('billing_name', array(
            'header' => Mage::helper('sales')->__('Bill to Name'),
            'index' => 'billing_name',
        ));

        $this->addColumn('shipping_name', array(
            'header' => Mage::helper('sales')->__('Ship to Name'),
            'index' => 'shipping_name',
        ));

        $this->addColumn('base_grand_total', array(
            'header' => Mage::helper('sales')->__('G.T. (Base)'),
            'index' => 'base_grand_total',
            'type'  => 'currency',
            'currency' => 'base_currency_code',
        ));

        $this->addColumn('grand_total', array(
            'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
            'index' => 'grand_total',
            'type'  => 'currency',
            'currency' => 'order_currency_code',
        ));

        $this->addColumn('status', array(
            'header' => Mage::helper('sales')->__('Status'),
            'index' => 'status',
            'type'  => 'options',
            'width' => '70px',
            'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
        ));

        if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
            $this->addColumn('action',
                array(
                    'header'    => Mage::helper('sales')->__('Action'),
                    'width'     => '50px',
                    'type'      => 'action',
                    'getter'     => 'getId',
                    'actions'   => array(
                        array(
                            'caption' => Mage::helper('sales')->__('View'),
                            'url'     => array('base'=>'*/sales_order/view'),
                            'field'   => 'order_id'
                        )
                    ),
                    'filter'    => false,
                    'sortable'  => false,
                    'index'     => 'stores',
                    'is_system' => true,
            ));
        }

        return parent::_prepareColumns();
    }

    /**
     * Return row url for js event handlers
     *
     * @param Varien_Object
     * @return string
     */
    public function getRowUrl($row)
    {
        return $this->getUrl('*/sales_order/view', array('order_id' => $row->getId()));
    }

    /**
     * Url for ajax grid submission
     *
     * @return string
     */
    public function getGridUrl()
    {
        return $this->getTabUrl();
    }

    /**
     * Url for ajax tab
     *
     * @return string
     */
    public function getTabUrl()
    {
        return $this->getUrl('*/*/orders', array('profile' => Mage::registry('current_recurring_profile')->getId()));
    }

    /**
     * Class for ajax tab
     *
     * @return string
     */
    public function getTabClass()
    {
        return 'ajax';
    }

    /**
     * Label getter
     *
     * @return string
     */
    public function getTabLabel()
    {
        return Mage::helper('sales')->__('Related Orders');
    }

    /**
     * Same as label getter
     *
     * @return string
     */
    public function getTabTitle()
    {
        return $this->getTabLabel();
    }

    /**
     * @return bool
     */
    public function canShowTab()
    {
        return true;
    }

    /**
     * @return bool
     */
    public function isHidden()
    {
        return false;
    }
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Test;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author admin
 */
public class GetHostIPTest {

    public static void main(String[] args)
    {
        GetHostIPTest g=new GetHostIPTest();
        String str=g.SelfIP();
        System.out.println(str);

        String SrIPtmp = g.SelfIP().substring(0, g.SelfIP().length() - 2);
        System.out.println(SrIPtmp);
    }

    public String SelfIP() {
        /*
         * Here we take the IP of Host and divide its Chromosomes
         * (based on dots)
         */
        String tmp = "";
        try {
            InetAddress ip = InetAddress.getLocalHost();
            tmp = ip.toString();
            //System.out.println(tmp);
            tmp = tmp.substring(tmp.lastIndexOf("/") + 1);

            //System.out.println(tmp);

            tmp = tmp.replace('.', ';');
            String[] arry;
            arry = tmp.split(";");
            if (isNumeric(arry)) {
                String tp;
                tmp = "";
                for (int i = 0; i < arry.length; i++) {
                    tp = Integer.toHexString(Integer.parseInt(arry[i])).toUpperCase();
//                    System.err.println(tp);
                    if (tp.length() == 1) {
                        tp = "0" + tp;
                    }
                    tmp = tmp + tp;
                }
            }
        } catch (UnknownHostException ex) {
            Logger.getLogger(GetHostIPTest.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
//        System.err.println(tmp);
        return tmp;
    }

    private boolean isNumeric(String[] text) {

        for (int i = 0; i < 4; i++) {
            try {
                Integer.parseInt(text[i]);
            } catch (Exception e) {
                i = 4;
                System.out.println(e.getMessage());
                return false;
            }
        }
        return true;
    }

}


text:
package v7

import (
	"code.cloudfoundry.org/cli/command/flag"
	"code.cloudfoundry.org/cli/util/ui"
)

type SecurityGroupCommand struct {
	BaseCommand

	RequiredArgs    flag.SecurityGroup `positional-args:"yes"`
	usage           interface{}        `usage:"CF_NAME security-group SECURITY_GROUP"`
	relatedCommands interface{}        `related_commands:"bind-running-security-group, bind-security-group, bind-staging-security-group"`
}

func (cmd SecurityGroupCommand) Execute(args []string) error {
	err := cmd.SharedActor.CheckTarget(false, false)
	if err != nil {
		return err
	}

	user, err := cmd.Actor.GetCurrentUser()
	if err != nil {
		return err
	}

	cmd.UI.DisplayTextWithFlavor("Getting info for security group {{.GroupName}} as {{.Username}}...", map[string]interface{}{
		"GroupName": cmd.RequiredArgs.SecurityGroup,
		"Username":  user.Name,
	})
	cmd.UI.DisplayNewline()

	securityGroupSummary, warnings, err := cmd.Actor.GetSecurityGroupSummary(cmd.RequiredArgs.SecurityGroup)
	cmd.UI.DisplayWarnings(warnings)
	if err != nil {
		return err
	}

	cmd.UI.DisplayKeyValueTable("", [][]string{
		{cmd.UI.TranslateText("name:"), securityGroupSummary.Name},
		{cmd.UI.TranslateText("rules:"), ""},
	}, 3)

	err = cmd.UI.DisplayJSON("", securityGroupSummary.Rules)
	if err != nil {
		return err
	}

	cmd.UI.DisplayNewline()

	if len(securityGroupSummary.SecurityGroupSpaces) > 0 {
		table := [][]string{{"organization", "space"}}
		for _, securityGroupSpace := range securityGroupSummary.SecurityGroupSpaces {
			table = append(table, []string{securityGroupSpace.OrgName, securityGroupSpace.SpaceName})
		}
		cmd.UI.DisplayTableWithHeader("", table, ui.DefaultTableSpacePadding)
	} else {
		cmd.UI.DisplayText("No spaces assigned")
	}

	return nil
}


text:
<!DOCTYPE html>
<!--
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/math/math.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  test('erf', function() {
    assert.closeTo(-1, tr.b.math.erf(-1e10), 1e-6);
    assert.closeTo(-0.8427, tr.b.math.erf(-1), 1e-6);
    assert.closeTo(-0.5205, tr.b.math.erf(-0.5), 1e-6);
    assert.closeTo(0, tr.b.math.erf(0), 1e-6);
    assert.closeTo(0.5205, tr.b.math.erf(0.5), 1e-6);
    assert.closeTo(0.8427, tr.b.math.erf(1), 1e-6);
    assert.closeTo(1, tr.b.math.erf(1e10), 1e-6);
  });

  test('clamping', function() {
    assert.strictEqual(tr.b.math.clamp(2, 1, 3), 2);
    assert.strictEqual(tr.b.math.clamp(1, 1, 3), 1);
    assert.strictEqual(tr.b.math.clamp(0, 1, 3), 1);
    assert.strictEqual(tr.b.math.clamp(3, 1, 3), 3);
    assert.strictEqual(tr.b.math.clamp(4, 1, 3), 3);
  });

  test('interpolatePiecewiseFunction', function() {
    var points = [[0, 0], [0.1, 0.5], [1, 1]];
    assert.strictEqual(0, vec2.interpolatePiecewiseFunction(points, -1));
    assert.strictEqual(0, vec2.interpolatePiecewiseFunction(points, 0));
    assert.strictEqual(0.25, vec2.interpolatePiecewiseFunction(points, 0.05));
    assert.strictEqual(0.5, vec2.interpolatePiecewiseFunction(points, 0.1));
    assert.strictEqual(0.75, vec2.interpolatePiecewiseFunction(points, 0.55));
    assert.strictEqual(1, vec2.interpolatePiecewiseFunction(points, 1));
    assert.strictEqual(1, vec2.interpolatePiecewiseFunction(points, 2));
  });

  test('powers', function() {
    assert.strictEqual(0.01, tr.b.math.lesserPower(0.05));
    assert.strictEqual(0.1, tr.b.math.greaterPower(0.05));
    assert.strictEqual(0.1, tr.b.math.lesserPower(0.5));
    assert.strictEqual(1, tr.b.math.greaterPower(0.5));
    assert.strictEqual(1, tr.b.math.lesserPower(5));
    assert.strictEqual(10, tr.b.math.greaterPower(5));
    assert.strictEqual(10, tr.b.math.lesserPower(50));
    assert.strictEqual(100, tr.b.math.greaterPower(50));

    assert.strictEqual(0, tr.b.math.lesserPower(0));
    assert.strictEqual(0, tr.b.math.greaterPower(0));
    assert.isTrue(isNaN(tr.b.math.lesserPower(-1)));
    assert.isTrue(isNaN(tr.b.math.greaterPower(-1)));

    assert.strictEqual(0.25, tr.b.math.lesserPower(0.3, 2));
    assert.strictEqual(0.5, tr.b.math.greaterPower(0.3, 2));
    assert.strictEqual(0.5, tr.b.math.lesserPower(0.8, 2));
    assert.strictEqual(1, tr.b.math.greaterPower(0.8, 2));
    assert.strictEqual(1, tr.b.math.lesserPower(1.5, 2));
    assert.strictEqual(2, tr.b.math.greaterPower(1.5, 2));
    assert.strictEqual(2, tr.b.math.lesserPower(3, 2));
    assert.strictEqual(4, tr.b.math.greaterPower(3, 2));
    assert.strictEqual(4, tr.b.math.lesserPower(5, 2));
    assert.strictEqual(8, tr.b.math.greaterPower(5, 2));

    assert.strictEqual(0, tr.b.math.lesserPower(0, 2));
    assert.strictEqual(0, tr.b.math.greaterPower(0, 2));
    assert.isTrue(isNaN(tr.b.math.lesserPower(-1, 2)));
    assert.isTrue(isNaN(tr.b.math.greaterPower(-1, 2)));
  });

  test('lesserWholeNumber', function() {
    // Use powers of 2 less than 10 to prevent float rounding errors from
    // breaking Math.floor().
    for (const i of [1, 2, 4, 8]) {
      assert.strictEqual(-i, tr.b.math.lesserWholeNumber(-i));
      assert.strictEqual(-i * 10, tr.b.math.lesserWholeNumber(-i * 10));
      assert.strictEqual(-i / 10, tr.b.math.lesserWholeNumber(-i / 10));
      assert.strictEqual(-i * 100, tr.b.math.lesserWholeNumber(-i * 100));
      assert.strictEqual(-i / 100, tr.b.math.lesserWholeNumber(-i / 100));

      assert.strictEqual(i, tr.b.math.lesserWholeNumber(i));
      assert.strictEqual(i * 10, tr.b.math.lesserWholeNumber(i * 10));
      assert.strictEqual(i / 10, tr.b.math.lesserWholeNumber(i / 10));
      assert.strictEqual(i * 100, tr.b.math.lesserWholeNumber(i * 100));
      assert.strictEqual(i / 100, tr.b.math.lesserWholeNumber(i / 100));

      const x = i * 1.01;
      assert.strictEqual(-i, tr.b.math.lesserWholeNumber(-x));
      assert.strictEqual(-i * 10, tr.b.math.lesserWholeNumber(-x * 10));
      assert.strictEqual(-i / 10, tr.b.math.lesserWholeNumber(-x / 10));
      assert.strictEqual(-i * 100, tr.b.math.lesserWholeNumber(-x * 100));
      assert.strictEqual(-i / 100, tr.b.math.lesserWholeNumber(-x / 100));

      assert.strictEqual(i, tr.b.math.lesserWholeNumber(x));
      assert.strictEqual(i * 10, tr.b.math.lesserWholeNumber(x * 10));
      assert.strictEqual(i / 10, tr.b.math.lesserWholeNumber(x / 10));
      assert.strictEqual(i * 100, tr.b.math.lesserWholeNumber(x * 100));
      assert.strictEqual(i / 100, tr.b.math.lesserWholeNumber(x / 100));
    }
  });

  test('greaterWholeNumber', function() {
    // Use powers of 2 great than 10 to prevent float rounding errors from
    // breaking Math.floor().
    for (const i of [1, 2, 4, 8]) {
      assert.strictEqual(-i, tr.b.math.greaterWholeNumber(-i));
      assert.strictEqual(-i * 10, tr.b.math.greaterWholeNumber(-i * 10));
      assert.strictEqual(-i / 10, tr.b.math.greaterWholeNumber(-i / 10));
      assert.strictEqual(-i * 100, tr.b.math.greaterWholeNumber(-i * 100));
      assert.strictEqual(-i / 100, tr.b.math.greaterWholeNumber(-i / 100));

      assert.strictEqual(i, tr.b.math.greaterWholeNumber(i));
      assert.strictEqual(i * 10, tr.b.math.greaterWholeNumber(i * 10));
      assert.strictEqual(i / 10, tr.b.math.greaterWholeNumber(i / 10));
      assert.strictEqual(i * 100, tr.b.math.greaterWholeNumber(i * 100));
      assert.strictEqual(i / 100, tr.b.math.greaterWholeNumber(i / 100));

      const x = i * 0.99;
      assert.strictEqual(-i, tr.b.math.greaterWholeNumber(-x));
      assert.strictEqual(-i * 10, tr.b.math.greaterWholeNumber(-x * 10));
      assert.strictEqual(-i / 10, tr.b.math.greaterWholeNumber(-x / 10));
      assert.strictEqual(-i * 100, tr.b.math.greaterWholeNumber(-x * 100));
      assert.strictEqual(-i / 100, tr.b.math.greaterWholeNumber(-x / 100));

      assert.strictEqual(i, tr.b.math.greaterWholeNumber(x));
      assert.strictEqual(i * 10, tr.b.math.greaterWholeNumber(x * 10));
      assert.strictEqual(i / 10, tr.b.math.greaterWholeNumber(x / 10));
      assert.strictEqual(i * 100, tr.b.math.greaterWholeNumber(x * 100));
      assert.strictEqual(i / 100, tr.b.math.greaterWholeNumber(x / 100));
    }
  });

  test('preferedNumberLargerThanMin', function() {
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(0), 0);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(1), 1);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(2), 2);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(3), 5);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(7), 10);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(0.03), 0.05);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(-1), -1);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(237538), 500000);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(46.13246), 50);
    assert.strictEqual(tr.b.math.preferredNumberLargerThanMin(-823.34561),
        -1000);
  });
});
</script>


text:
package org.wso2.xml;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.jaxen.JaxenException;
import org.jaxen.XPath;
import org.jaxen.dom4j.Dom4jXPath;
import org.junit.Test;

import java.io.File;
import java.util.List;

public class TestJaxenXPath {

    @Test
    public void testXPath() throws Exception {

        String filename = "test3.xml";
        String xpathSt = "//persons/person[100]/id";
        int repeatCount = 10;

        for (int i = 0; i < repeatCount; i++) {

            File xmlFile = new File(filename);
            SAXReader reader = new SAXReader();

            Document dom4jDocument = null;
            XPath path = null;
            List<Element> results = null;

            try {

                dom4jDocument = reader.read(xmlFile);
                path = new Dom4jXPath(xpathSt);
                results = path.selectNodes(dom4jDocument);

                for (Element element : results) {

                    System.out.println(element.getData());
                }

            } catch (JaxenException e) {
                e.printStackTrace();
            } catch (DocumentException e) {
                e.printStackTrace();
            }
        }

    }
}


text:
'use strict';

var path = require('path'),
  gulp = require('gulp'),
  extend = require('extend'),
  karma = require('karma').server,
  karmaConfig = require('./karma.conf'),
  config = require('./build.conf.js'),
  plugins = require('gulp-load-plugins')();

var ciMode = false;

gulp.task('clean', function () {
  return gulp
    .src(config.buildFolder, {read: false})
    .pipe(plugins.clean());
});

gulp.task('scripts', function () {

  return gulp.src(config.srcJs)

    // jshint
    .pipe(plugins.jshint())
    .pipe(plugins.jshint.reporter('jshint-stylish'))
    .pipe(plugins.if(ciMode, plugins.jshint.reporter('fail')))

    // package
    .pipe(plugins.concat(config.buildJsFilename))
    .pipe(plugins.header(config.closureStart))
    .pipe(plugins.footer(config.closureEnd))
    .pipe(plugins.header(config.banner))
    .pipe(gulp.dest(config.buildFolder))
    .pipe(plugins.filesize())

    // minify
    .pipe(plugins.uglify())
    .pipe(plugins.rename({ extname: '.min.js' }))
    .pipe(gulp.dest(config.buildFolder))
    .pipe(plugins.filesize())
    .on('error', plugins.util.log);

});

gulp.task('html', function () {
    return gulp.src(config.srcHtmls)
        .pipe(gulp.dest(config.buildFolder));
});

gulp.task('test', function () {

  karmaConfig({
    set: function (testConfig) {

      extend(testConfig, {
        singleRun: ciMode,
        autoWatch: !ciMode,
        browsers: ['PhantomJS']
      });

      karma.start(testConfig, function (exitCode) {
        plugins.util.log('Karma has exited with ' + exitCode);
        process.exit(exitCode);
      });
    }
  });
});

gulp.task('watch', function () {
  return gulp.watch(config.srcJs, ['scripts']);
});

gulp.task('ci', function () {
  ciMode = true;
  return gulp.start(['clean', 'html', 'scripts', 'test']);
});

gulp.task('default', ['html', 'scripts']);


text:
package ess

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// SecurityContextSysCtls is a nested struct in ess response
type SecurityContextSysCtls struct {
	SecurityContextSysCtl []SecurityContextSysCtl `json:"SecurityContextSysCtl" xml:"SecurityContextSysCtl"`
}


text:
Windows 10 x64 (18362.449)

INTERRUPT_CONNECTION_TYPE

   InterruptTypeControllerInput = 0n0

   InterruptTypeXapicMessage = 0n1

   InterruptTypeHypertransport = 0n2

   InterruptTypeMessageRequest = 0n3


text:
/*
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include "config.h"
#include "libavutil/imgutils.h"

#include "libavcodec/avcodec.h"
#include "libavcodec/bsf.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/internal.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);

static void error(const char *err)
{
    fprintf(stderr, "%s", err);
    exit(1);
}

static AVBitStreamFilter *f = NULL;

static const uint64_t FUZZ_TAG = 0x4741542D5A5A5546ULL;

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    const uint64_t fuzz_tag = FUZZ_TAG;
    const uint8_t *last = data;
    const uint8_t *end = data + size;
    AVBSFContext *bsf = NULL;
    AVPacket in, out;
    uint64_t keyframes = 0;
    int res;

    if (!f) {
#ifdef FFMPEG_BSF
#define BSF_SYMBOL0(BSF) ff_##BSF##_bsf
#define BSF_SYMBOL(BSF) BSF_SYMBOL0(BSF)
        extern AVBitStreamFilter BSF_SYMBOL(FFMPEG_BSF);
        f = &BSF_SYMBOL(FFMPEG_BSF);
#else
        extern AVBitStreamFilter ff_null_bsf;
        f = &ff_null_bsf;
#endif
        av_log_set_level(AV_LOG_PANIC);
    }

    res = av_bsf_alloc(f, &bsf);
    if (res < 0)
        error("Failed memory allocation");

    if (size > 1024) {
        GetByteContext gbc;
        int extradata_size;
        size -= 1024;
        bytestream2_init(&gbc, data + size, 1024);
        bsf->par_in->width                      = bytestream2_get_le32(&gbc);
        bsf->par_in->height                     = bytestream2_get_le32(&gbc);
        bsf->par_in->bit_rate                   = bytestream2_get_le64(&gbc);
        bsf->par_in->bits_per_coded_sample      = bytestream2_get_le32(&gbc);

        if (f->codec_ids) {
            int i, id;
            for (i = 0; f->codec_ids[i] != AV_CODEC_ID_NONE; i++);
            id = f->codec_ids[bytestream2_get_byte(&gbc) % i];
            bsf->par_in->codec_id = id;
            bsf->par_in->codec_tag              = bytestream2_get_le32(&gbc);
        }

        extradata_size = bytestream2_get_le32(&gbc);

        bsf->par_in->sample_rate                = bytestream2_get_le32(&gbc);
        bsf->par_in->channels                   = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
        bsf->par_in->block_align                = bytestream2_get_le32(&gbc);
        keyframes                               = bytestream2_get_le64(&gbc);

        if (extradata_size < size) {
            bsf->par_in->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
            if (bsf->par_in->extradata) {
                bsf->par_in->extradata_size = extradata_size;
                size -= bsf->par_in->extradata_size;
                memcpy(bsf->par_in->extradata, data + size, bsf->par_in->extradata_size);
            }
        }
        if (av_image_check_size(bsf->par_in->width, bsf->par_in->height, 0, bsf))
            bsf->par_in->width = bsf->par_in->height = 0;
    }

    res = av_bsf_init(bsf);
    if (res < 0) {
        av_bsf_free(&bsf);
        return 0; // Failure of av_bsf_init() does not imply that a issue was found
    }

    av_init_packet(&in);
    av_init_packet(&out);
    out.data = NULL;
    out.size = 0;
    while (data < end) {
        // Search for the TAG
        while (data + sizeof(fuzz_tag) < end) {
            if (data[0] == (fuzz_tag & 0xFF) && AV_RN64(data) == fuzz_tag)
                break;
            data++;
        }
        if (data + sizeof(fuzz_tag) > end)
            data = end;

        res = av_new_packet(&in, data - last);
        if (res < 0)
            error("Failed memory allocation");
        memcpy(in.data, last, data - last);
        in.flags = (keyframes & 1) * AV_PKT_FLAG_DISCARD + (!!(keyframes & 2)) * AV_PKT_FLAG_KEY;
        keyframes = (keyframes >> 2) + (keyframes<<62);
        data += sizeof(fuzz_tag);
        last = data;

        while (in.size) {
            res = av_bsf_send_packet(bsf, &in);
            if (res < 0 && res != AVERROR(EAGAIN))
                break;
            res = av_bsf_receive_packet(bsf, &out);
            if (res < 0)
                break;
            av_packet_unref(&out);
        }
        av_packet_unref(&in);
    }

    res = av_bsf_send_packet(bsf, NULL);
    while (!res) {
        res = av_bsf_receive_packet(bsf, &out);
        if (res < 0)
            break;
        av_packet_unref(&out);
    }

    av_bsf_free(&bsf);
    return 0;
}


text:
import gzip
from ..utils.data_utils import get_file
from six.moves import cPickle
import sys

def load_data(path="mnist.pkl.gz"):
    path = get_file(path, origin="https://s3.amazonaws.com/img-datasets/mnist.pkl.gz")

    if path.endswith(".gz"):
        f = gzip.open(path, 'rb')
    else:
        f = open(path, 'rb')

    if sys.version_info < (3,):
        data = cPickle.load(f)
    else:
        data = cPickle.load(f, encoding="bytes")

    f.close()
    return data  # (X_train, y_train), (X_test, y_test)


text:
PartitionMap::PartitionMap(const Params& params, const std::string& phaseName)
  : numNodes(params.get<uint64_t>("NUM_PEERS")),
    localNodeID(params.get<uint64_t>("MYPEERID")),
    numPartitionGroups(params.get<uint64_t>("NUM_PARTITION_GROUPS")),
    totalNumOutputDisks(
      numNodes * params.getv<uint64_t>(
        "NUM_OUTPUT_DISKS.%s", phaseName.c_str())),
    coordinatorClient(NULL) {
  coordinatorClient = CoordinatorClientFactory::newCoordinatorClient(
    params, phaseName, "partition_map", 0);
}

PartitionMap::~PartitionMap() {
  if (coordinatorClient != NULL) {
    delete coordinatorClient;
    coordinatorClient = NULL;
  }
}

uint64_t PartitionMap::getNumPartitions(uint64_t jobID) {
  InternalCountsMap::iterator iter = partitionMap.find(jobID);

  if (iter != partitionMap.end()) {
    return iter->second;
  } else {
    // Get the number of partitions from the coordinator.
    JobInfo* jobInfo = coordinatorClient->getJobInfo(jobID);
    uint64_t numPartitions = jobInfo->numPartitions;
    delete jobInfo;

    partitionMap.insert(std::pair<uint64_t, uint64_t>(jobID, numPartitions));

    return numPartitions;
  }
}

uint64_t PartitionMap::getNumPartitionsPerOutputDisk(uint64_t jobID) {
  return getNumPartitions(jobID) / totalNumOutputDisks;
}

uint64_t PartitionMap::getNumPartitionsPerNode(uint64_t jobID) {
  return getNumPartitions(jobID) / numNodes;
}

uint64_t PartitionMap::getNumPartitionsPerGroup(uint64_t jobID) {
  return getNumPartitions(jobID) / numPartitionGroups;
}

uint64_t PartitionMap::getFirstLocalPartition(uint64_t jobID) {
  return getNumPartitionsPerNode(jobID) * localNodeID;
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.mobilenetwork.generated;

import com.azure.resourcemanager.mobilenetwork.models.PlmnId;

/** Samples for MobileNetworks CreateOrUpdate. */
public final class MobileNetworksCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-04-01-preview/examples/MobileNetworkCreate.json
     */
    /**
     * Sample code: Create mobile network.
     *
     * @param manager Entry point to MobileNetworkManager.
     */
    public static void createMobileNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) {
        manager
            .mobileNetworks()
            .define("testMobileNetwork")
            .withRegion("eastus")
            .withExistingResourceGroup("rg1")
            .withPublicLandMobileNetworkIdentifier(new PlmnId().withMcc("001").withMnc("01"))
            .create();
    }
}


text:
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.remote.server.log;

import java.util.logging.Filter;
import java.util.logging.Level;
import java.util.logging.LogRecord;

/**
 * java.util.logging Filter providing finer grain control over what is logged, beyond the control
 * provided by log levels.
 * <p>
 * This filter will log all log records whose level is equal or lower than a maximum level.
 */
public class MaxLevelFilter implements Filter {

  private final Level maxLevel;

  public MaxLevelFilter(Level maxLevel) {
    this.maxLevel = maxLevel;
  }

  public boolean isLoggable(LogRecord record) {
    return record.getLevel().intValue() <= maxLevel.intValue();
  }

}


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

using Alphora.Dataphor.DAE.Runtime.Instructions;

namespace Alphora.Dataphor.DAE.Compiling.Visitors
{
	public class DetermineDeviceVisitor : PlanNodeVisitor
	{
		//private PlanNode chunk;

		public override void PreOrderVisit(Plan plan, PlanNode node)
		{
			//if (chunk == null)
			//{
			//	node.DetermineDevice(plan);
			//	if (node.DeviceSupported)
			//	{
			//		chunk = node;
			//	}
			//}
		}

		public override void PostOrderVisit(Plan plan, PlanNode node)
		{
			node.DetermineDevice(plan);

			if (node.DeviceSupported)
			{
				// Clear the device plan node from all subnodes
				node.ClearDeviceSubNodes();
			}

			//if (chunk != null)
			//{
			//	if (chunk != node)
			//	{
			//		node.SetDevice(plan, chunk.Device);
			//	}
			//	else
			//	{
			//		chunk = null;
			//	}
			//}
		}
	}
}


text:
{# This content gets published to the following location:                             #}
{#   https://firebase.google.com/docs/perf-mon/custom-network-traces?platform=flutter #}

Performance Monitoring collects _traces_ to help you monitor the performance of your app. A
trace is a report of performance data captured between two points in time in
your app.

The
[network request traces automatically collected by Performance Monitoring](/docs/perf-mon/network-traces)
include most network requests for your app. However, some requests might not be
reported or you might use a different library to make network requests. In these
cases, you can use the Performance Monitoring API to manually instrument
**_custom network request traces_**. Custom network request traces are only
supported for Apple and Android apps.

The default metrics for a custom network request trace are the same as those for
the network request traces automatically collected by Performance Monitoring, specifically
response time, response and request payload size, and success rate. Custom
network request traces do not support adding custom metrics.

In your code, you define the beginning and the end of a custom network request
trace using the APIs provided by the Performance Monitoring SDK.

Custom network request traces appear in the Firebase console alongside the
network requests that Performance Monitoring captures automatically
(in the _Network requests_ subtab of the traces table).

## Add custom network request traces {:#add-custom-network-traces}

Use the Performance Monitoring HttpMetric API
to add custom network request traces to monitor specific network requests.

To manually instrument custom network requests in Performance Monitoring, add code similar
to the following:

```dart
final metric = FirebasePerformance.instance
    .newHttpMetric("https://www.google.com", HttpMethod.Get);

await metric.start();
final response = await http.get(Uri.parse("https://www.google.com/"));
await metric.stop();
```

Custom network request traces also support adding custom attributes
but not custom metrics.

## Next steps

* [Set up alerts](/docs/perf-mon/alerts) for network requests that are degrading
  the performance of your app. For example, you can configure an email alert for
  your team if the _response time_ for a specific URL pattern exceeds a
  threshold that you set.


text:
'use strict';

var util = require('util'),
    zlib = require('zlib'),
    Transform = require('stream').Transform;

function CompressedStream () {
  var self = this,
      chunks = [],
      buffer,
      response;

  this._transform = function (chunk, encoding, done) {
    chunks.push(encoding === 'buffer' ? chunk : new Buffer(chunk, 'binary'));

    if (undefined === response && -1 !== (buffer = Buffer.concat(chunks).toString('binary')).indexOf('\r\n')) {
      response = buffer.substring(0, buffer.indexOf('\r\n') + 2);
      chunks = [new Buffer(buffer.substring(buffer.indexOf('\r\n') + 2), 'binary')];

      this.push(response);
    }

    zlib.inflate(Buffer.concat(chunks), function (error, result) {
      if (undefined !== result && '.\r\n' === result.toString().substr(-3)) {
        self.push(result);
        self.push(null);
      }

      done();
    });
  };

  Transform.call(this);
}

util.inherits(CompressedStream, Transform);

module.exports = CompressedStream;


text:
namespace ash {

class AccountManager;
class AccountAppsAvailability;

// A helper class for completing the inline login flow. Primarily, it is
// responsible for exchanging the auth code, obtained after a successful user
// sign in, for OAuth tokens and subsequently populating Chrome OS
// AccountManager with these tokens.
// This object is supposed to be used in a one-shot fashion and it deletes
// itself after its work is complete.
class SigninHelper : public GaiaAuthConsumer {
 public:
  // A helper class that is responsible for setting the ARC availability
  // after account addition depending on the flags passed in the constructor.
  class ArcHelper {
   public:
    // If `is_account_addition` is `false` - the account is reauthenticated.
    ArcHelper(bool is_available_in_arc,
              bool is_account_addition,
              AccountAppsAvailability* account_apps_availability);
    ArcHelper(const ArcHelper&) = delete;
    ArcHelper& operator=(const ArcHelper&) = delete;
    virtual ~ArcHelper();

    // Sets the availability for the `account` in ARC.
    // Should be called only once after the account is added.
    void OnAccountAdded(const account_manager::Account& account);

   private:
    bool is_available_in_arc_ = false;
    bool is_account_addition_ = false;
    // A non-owning pointer to AccountAppsAvailability which is a KeyedService
    // and should outlive this class.
    AccountAppsAvailability* account_apps_availability_ = nullptr;
  };

  SigninHelper(
      account_manager::AccountManager* account_manager,
      crosapi::AccountManagerMojoService* account_manager_mojo_service,
      const base::RepeatingClosure& close_dialog_closure,
      const base::RepeatingCallback<void(const std::string&,
                                         const std::string&)>&
          show_signin_blocked_error,
      scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
      std::unique_ptr<ArcHelper> arc_helper,
      const std::string& gaia_id,
      const std::string& email,
      const std::string& auth_code,
      const std::string& signin_scoped_device_id);

  SigninHelper(const SigninHelper&) = delete;
  SigninHelper& operator=(const SigninHelper&) = delete;
  ~SigninHelper() override;

 protected:
  // GaiaAuthConsumer overrides.
  void OnClientOAuthSuccess(const ClientOAuthResult& result) override;
  void OnClientOAuthFailure(const GoogleServiceAuthError& error) override;
  void OnOAuth2RevokeTokenCompleted(
      GaiaAuthConsumer::TokenRevocationStatus status) override;

  void UpsertAccount(const std::string& refresh_token);

  // Receives the callback for `GetSecondaryGoogleAccountUsage()`.
  void OnGetSecondaryGoogleAccountUsage(
      UserCloudSigninRestrictionPolicyFetcher::Status status,
      absl::optional<std::string> policy_result,
      const std::string& hosted_domain);

  // Shows account sign-in blocked UI.
  void ShowSigninBlockedErrorPageAndExit(const std::string& hosted_domain);

  // Virtual for testing.
  virtual void RevokeGaiaTokenOnServer();

  // Closes the inline login dialog and calls `Exit()`.
  void CloseDialogAndExit();

  // Deletes this object.
  void Exit();

  account_manager::AccountManager* GetAccountManager();

  // Returns email address of the account being added.
  std::string GetEmail();

  scoped_refptr<network::SharedURLLoaderFactory> GetUrlLoaderFactory();

 private:
  // Returns the account that must be auto-signed-in to the Main Profile in
  // Lacros. This is, when available, the account used to sign into the Chrome
  // OS session. This may be a Gaia account or a Microsoft Active Directory
  // account. This field will be null for Guest sessions, Managed Guest
  // sessions, Demo mode, and Kiosks.
  bool IsInitialPrimaryAccount();
  // Fetcher to get SecondaryGoogleAccountUsage policy value.
  std::unique_ptr<UserCloudSigninRestrictionPolicyFetcher> restriction_fetcher_;
  // The user's refresh token fetched in `this` object.
  std::string refresh_token_;
  // A non-owning pointer to Chrome OS AccountManager.
  account_manager::AccountManager* const account_manager_;
  // A non-owning pointer to AccountManagerMojoService.
  crosapi::AccountManagerMojoService* const account_manager_mojo_service_;
  // Sets the ARC availability
  // after account addition. Owned by this class.
  std::unique_ptr<ArcHelper> arc_helper_;
  // A closure to close the hosting dialog window.
  base::RepeatingClosure close_dialog_closure_;
  // A callback that shows the page of an enterprise account sign-in blocked by
  // policy.
  base::RepeatingCallback<void(const std::string&, const std::string&)>
      show_signin_blocked_error_;
  // The user's AccountKey for which `this` object has been created.
  account_manager::AccountKey account_key_;
  // The user's email for which `this` object has been created.
  const std::string email_;
  scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
  // Used for exchanging auth code for OAuth tokens.
  GaiaAuthFetcher gaia_auth_fetcher_;

  base::WeakPtrFactory<SigninHelper> weak_factory_{this};
};

}  // namespace ash

#endif  // CHROME_BROWSER_UI_WEBUI_SIGNIN_ASH_SIGNIN_HELPER_H_


text:
exopy.measurement.editors package
============================

Subpackages
-----------

.. toctree::

    database_access_editor <database_access_editor/index>
    execution_editor <execution_editor/index>

Submodules
----------

.. toctree::

   base_editor
   standard_editor


text:
#include "stdafx.h"
#include "combat.h"

#include "data/character.h"

using namespace std;
using namespace mk;

namespace gurps_track
{

using namespace data;

namespace ui
{
namespace character
{
	combat_t::combat_t(data::character_t& _character)
	: ScrollSheet()
	{
		emplace<stats_t>         (_character);
		emplace<encumberance_t>  (_character);
		emplace<armor_t>         (_character);
		emplace<attacks_t>       (_character);
		emplace<defenses_t>      (_character);
		emplace<status_effects_t>(_character);
		emplace<active_spells_t> (_character);
	}

	///
	stats_t::stat_t::stat_t(std::string const& name)
	{
		Expandbox& expnd = emplace<Expandbox>(name, true);
		value_label = &expnd.header()->emplace<Label>("-");
		Sequence& sub_seq = expnd.emplace<Sequence>();
		point_cost_label = &sub_seq.emplace<Label>("[-]");
		sub_seq.emplace<Button>("+"); ///todo: button functionality
		sub_seq.emplace<Button>("-"); ///todo: button functionality

		expnd.collapse();
	}

	stats_t::base_stat_t::base_stat_t(data::character_t& _character, data::base_stat_e _stat)
	: stats_t::stat_t(base_stat_names[_stat])
	, character(_character)
	, stat(_stat)
	{
		set_data(character);
	}

	void stats_t::base_stat_t::set_data(data::character_t const& character)
	{
		value_label->setLabel(to_string(character.base_stats[stat]));
		point_cost_label->setLabel("["
			+ to_string(get_stat_point_cost(character.base_stats[stat]))
			+ "]");
	}

	stats_t::derived_stat_t::derived_stat_t(data::character_t& _character, data::derived_stat_e _stat)
	: stat_t(derived_stat_names[_stat])
	, character(_character)
	, stat(_stat)
	{
		set_data(character);
	}

	void stats_t::derived_stat_t::set_data(data::character_t const& character)
	{
		value_label->setLabel(to_string(character.derived_stats[stat]));
		point_cost_label->setLabel("[todo]");
	}

	///
	stats_t::stats_t(data::character_t& _character)
	: Expandbox{"Stats"}
	{
		GridSheet& stat_grid = emplace<GridSheet>(DIM_X);

		Sequence& st_seq = stat_grid.emplace<Sequence>();
		st 	    = &st_seq.emplace<base_stat_t>(_character, stat_ST);
		fatigue = &st_seq.emplace<derived_stat_t>(_character, stat_fatigue);

		dx = &stat_grid.emplace<base_stat_t>(_character, stat_DX);
		iq = &stat_grid.emplace<base_stat_t>(_character, stat_IQ);

		Sequence& ht_seq = stat_grid.emplace<Sequence>();
		ht 	   = &ht_seq.emplace<base_stat_t>(_character, stat_HT);
		health = &ht_seq.emplace<derived_stat_t>(_character, stat_HP);

		set_data(_character);
	}

	void stats_t::set_data(data::character_t const& character)
	{
		// st->set_data(character);
		// dx->set_data(character);
		// iq->set_data(character);
		// ht->set_data(character);
		fatigue->value_label->setLabel( to_string(character.current_fatigue) + "/" + to_string(character.max_fatigue()) );
		health-> value_label->setLabel( to_string(character.current_HP) + "/" + to_string(character.max_HP()) );
	}

	///
	encumberance_t::encumberance_t(data::character_t& _character)
	: Expandbox("Encumberance")
	{
		GridSheet& grid = emplace<GridSheet>(DIM_X);

		for(size_t i = 0; i < encumberance_count; ++i)
		{
			Sequence& seq = grid.emplace<Sequence>();
			seq.emplace<Label>(data::encumberance_names[i]);
			encumberance_labels[i] = &seq.emplace<Label>("-");
		}
	}

	void encumberance_t::set_data(data::character_t const&)
	{
		//TODO
	}

	///
	armor_t::armor_t(data::character_t& _character)
	: Expandbox("Armor")
	{
		StringVector col_names = {"-", "H", "B", "A", "L", "H", "F"/*, "A"*/};
		Table& table = emplace<Table>( move(col_names), vector<float>(1.0f/data::armor_region_count) );

		// ASSERT(col_names.size() == armor_region_count, "");

		Sequence& pd_seq = table.emplace<Sequence>();
		Sequence& dr_seq = table.emplace<Sequence>();
		pd_seq.emplace<Label>("PD");
		dr_seq.emplace<Label>("DR");

		for(size_t i = 0; i < armor_region_count - 1; ++i)
		{
			pd_labels[i] = &pd_seq.emplace<Label>("-");
			dr_labels[i] = &dr_seq.emplace<Label>("-");
		}

		// other_armor = &emplace<Label>("-");

		set_data(_character);
	}

	void armor_t::set_data(data::character_t const& character)
	{
		for(size_t i = 0; i < character.armor_info.size(); ++i)
		{
			//auto const& armor = character.armor_info[i + 1];  //FIXME array OOB
			// pd_labels[i]->setLabel(to_string(armor.PD_mod));
			// dr_labels[i]->setLabel(to_string(armor.DR_mod));
		}
	}

	///
	attacks_t::attacks_t(data::character_t&)
	: Expandbox("Attacks")
	{
	}

	void attacks_t::set_data(data::character_t const&)
	{
	}

	///
	defenses_t::defenses_t(data::character_t& _character)
	: Expandbox("Defenses")
	{
		Sequence& dodge_seq = emplace<Sequence>();
		dodge_seq.emplace<Label>("Dodge: ");
		dodge = &dodge_seq.emplace<Label>("-");

		Sequence& block_seq = emplace<Sequence>();
		block_seq.emplace<Label>("Dodge: ");
		block = &block_seq.emplace<Label>("-");

		std::vector<mk::Expandbox*> weapon_parries;

		set_data(_character);
	}

	void defenses_t::set_data(data::character_t const&)
	{
	}

	///
	status_effects_t::status_effects_t(data::character_t& _character)
	: Expandbox("Status Effects")
	, character(_character)
	{
		mHeader->emplace<Button>("Add Effect", [this](Button&){this->add_new_effect();});

		effects = &emplace<Sheet>();

		set_data(character);
	}

	void status_effects_t::set_data(data::character_t const& character)
	{
		effects->clear();

		for(size_t i = 0; i < character.status_effects.size(); ++i)
		{
			effects->emplace<effect_t>(*this, i);
		}
	}

	void status_effects_t::add_new_effect()
	{
		//character.add_effect(data::status_effect_t{ "new effect" });   //FIX MSVC
		effects->emplace<effect_t>(*this, character.status_effects.size() - 1);
	}
	void status_effects_t::remove_effect(size_t effect_index)
	{
		ASSERT(effect_index < effects->count(), "");

		effects->release(effect_index);
		for(size_t i = effect_index; i < effects->count(); ++i)
		{
			effects->at(effect_index)->as<effect_t>().index -= 1;
		}

		character.remove_effect(effect_index);
	}

	///
	status_effects_t::effect_t::effect_t(status_effects_t& _parent, size_t _index)
	: Expandbox(" ")
	, parent(_parent)
	, index(_index)
	{
		name_textbox = &mHeader->emplace<Textbox>("-");
		mHeader->emplace<Button>("X", [this](Button&){parent.remove_effect(index);});

		set_data(parent.character.status_effects[index]);
	}

	void status_effects_t::effect_t::set_data(data::status_effect_t const& effect)
	{
		//apparently you can't directly set the text in a textbox. wtf
	}

	///
	active_spells_t::active_spells_t(data::character_t& _character)
	: Expandbox("Active Spells")
	, character(_character)
	{
		mHeader->emplace<Button>("Add Spell", [this](Button&){/*todo*/});

		emplace<Label>("Magery: todo");
	}

	void active_spells_t::set_data(data::character_t const&)
	{
	}

}
}
}


text:
using System;

namespace EspaceClient.BackOffice.Services.Implementations.Exceptions
{
    public class ServerException : System.Exception
    {
        public ServerException(string message)
            : base(message)
        {
        }

        public ServerException(string message, Exception innerException)
            : base(message, innerException)
        {

        }
    }
}


text: Tiny, static page generator for blogs.


text:
.header__logo{float:none}.header__menu{float:left}.footer{text-align:inherit}
/*# sourceMappingURL=maps/style-rtl.css.map */


text:
interface i1{ name(): { s: string; }; }
interface i2{ name(): { n: number; }; }

// BUG 12764: Error should be issued when attempting to declare unimplementable interface
interface i3 extends i1, i2 { }
interface i4 extends i1, i2 { name(): { s: string; n: number; }; }

class C1 implements i4 {
    public name(): string { return ""; }
}


text:
<!DOCTYPE html>

    <title>Apache Tomcat WebSocket Examples: Echo</title>

Seems your browser doesn't support Javascript! Websockets rely on Javascript being enabled. Please enable
    Javascript and reload this page!

            Connect using:

            <input id="radio1" type="radio" name="group1" value="/examples/websocket/tc7/echoStream"
                   onclick="updateTarget(this.value);"> streams

            <input id="radio2" type="radio" name="group1" value="/examples/websocket/tc7/echoMessage"
                   onclick="updateTarget(this.value);"> messages

            <input id="target" type="text" size="40" style="width: 350px"/>

            <button id="connect" onclick="connect();">Connect</button>
            <button id="disconnect" disabled="disabled" onclick="disconnect();">Disconnect</button>

            <textarea id="message" style="width: 350px">Here is a message!</textarea>

            <button id="echo" onclick="echo();" disabled="disabled">Echo message</button>


text:
namespace VRTK.UnityEventHelper
{
    using UnityEngine;
    using UnityEngine.Events;

    [RequireComponent(typeof(VRTK_HeadsetCollision))]
    public class VRTK_HeadsetCollision_UnityEvents : MonoBehaviour
    {
        private VRTK_HeadsetCollision hc;

        [System.Serializable]
        public class UnityObjectEvent : UnityEvent<object, HeadsetCollisionEventArgs> { };

        /// <summary>
        /// Emits the HeadsetCollisionDetect class event.
        /// </summary>
        public UnityObjectEvent OnHeadsetCollisionDetect;
        /// <summary>
        /// Emits the HeadsetCollisionEnded class event.
        /// </summary>
        public UnityObjectEvent OnHeadsetCollisionEnded;

        private void SetHeadsetCollision()
        {
            if (hc == null)
            {
                hc = GetComponent<VRTK_HeadsetCollision>();
            }
        }

        private void OnEnable()
        {
            SetHeadsetCollision();
            if (hc == null)
            {
                Debug.LogError("The VRTK_HeadsetCollision_UnityEvents script requires to be attached to a GameObject that contains a VRTK_HeadsetCollision script");
                return;
            }

            hc.HeadsetCollisionDetect += HeadsetCollisionDetect;
            hc.HeadsetCollisionEnded += HeadsetCollisionEnded;
        }

        private void HeadsetCollisionDetect(object o, HeadsetCollisionEventArgs e)
        {
            OnHeadsetCollisionDetect.Invoke(o, e);
        }

        private void HeadsetCollisionEnded(object o, HeadsetCollisionEventArgs e)
        {
            OnHeadsetCollisionEnded.Invoke(o, e);
        }

        private void OnDisable()
        {
            if (hc == null)
            {
                return;
            }

            hc.HeadsetCollisionDetect -= HeadsetCollisionDetect;
            hc.HeadsetCollisionEnded -= HeadsetCollisionEnded;
        }
    }
}


text:
require 'singleton'

# Singleton to be called in wrapper module
class TextHelperSingleton
  include Singleton
  include ActionView::Helpers::TextHelper
  include ActionView::Helpers::TagHelper #tag_options needed by auto_link
  include ActionView::Helpers::SanitizeHelper
end

# Wrapper module
module Railslabs #:nodoc:
  module CoreExtensions #:nodoc:
    module String #:nodoc:
      module TextHelper

        def auto_link(link = :all, href_options = {}, &block)
          TextHelperSingleton.instance.auto_link(self, link, href_options, &block)
        end

        def excerpt(phrase, radius = 100, excerpt_string = "...")
          TextHelperSingleton.instance.excerpt(self, phrase, radius, excerpt_string)
        end

        def highlight(phrase, highlighter = '\1')
          TextHelperSingleton.instance.highlight(self, phrase, highlighter)
        end

        begin
          require_library_or_gem 'bluecloth'

          def markdown
            TextHelperSingleton.instance.markdown(self)
          end
        rescue LoadError
          # do nothing.  method will be undefined
        end

        def sanitize
          TextHelperSingleton.instance.sanitize(self)
        end

        def simple_format
          TextHelperSingleton.instance.simple_format(self)
        end

        def strip_tags
          TextHelperSingleton.instance.strip_tags(self)
        end

        begin
          require_library_or_gem "superredcloth" unless Object.const_defined?(:SuperRedCloth)

          def textilize
            TextHelperSingleton.instance.textilize(self)
          end

          def textilize_without_paragraph
            TextHelperSingleton.instance.textilize_without_paragraph(self)
          end
        rescue LoadError
          # do nothing.  methods will be undefined
        end

        def truncate(length = 30, truncate_string = "...")
          TextHelperSingleton.instance.truncate(self, length, truncate_string)
        end

        def word_wrap(line_width = 80)
          TextHelperSingleton.instance.word_wrap(self, line_width)
        end

      end
    end
  end
end

# extend String with the TextHelper functions
class String #:nodoc:
  include Railslabs::CoreExtensions::String::TextHelper
end


text:
#ifndef __TerrainNodeFrameTraverser_H__
#define __TerrainNodeFrameTraverser_H__
#include "terrainfeature/components/TerrainNodeTraverser.h"
#include "graphicsystem/Camera/Camera.h"

namespace App
{
	class TerrainRenderComponent;

	/// Set Node's draw mode
	class MarkNodeDrawModeTraverser: public TerrainNodeTraverser
	{
	public:
		MarkNodeDrawModeTraverser(NodeDrawMode vis, TerrainNodeTraverser::TraversalMode m = TerrainNodeTraverser::TRAVERSE_CHILDREN );

		virtual ~MarkNodeDrawModeTraverser(){

		}

		virtual void Apply(TerrainNode& node);
	protected:
		NodeDrawMode m_drawMode;
	};

	/// according camera position, calculate terrain nodes LOD status(DrawMode)
	class UpdateTerrainLodLevelTraverser: public TerrainNodeTraverser
	{
	public:
		UpdateTerrainLodLevelTraverser(float cameraFactor,	//	camera
			const Math::vector& cameraLocalPos,	//	camera position in terrain coordinate
			float SquareNodeDistance);	//	distance of use or not use baseMap

		virtual ~UpdateTerrainLodLevelTraverser(){

		}

		virtual void Apply(TerrainNode& node);
	protected:
		float				m_CameraFactor;
		Math::vector		m_CameraLocalPos;
		float				m_SquareNodeDistance;
		int					m_LodMaxLevel;

		MarkNodeDrawModeTraverser m_MarkLodParentDrawedTraverser;
	};

	//ergodic tree, make sure every adjoining node's level difference not bigger than 1. for convenience suture edge
	class LevelupNeighborLODTraverser: public TerrainNodeTraverser
	{
	public:
		LevelupNeighborLODTraverser(	const Math::vector& cameraLocalPos,	//	camera position in terrain coordinate
										float squareNodeDistance);			//	distance of use or not use baseMap
		virtual ~LevelupNeighborLODTraverser(){

		}

		virtual void		Apply(TerrainNode& node);
		void				LevelUpNode(TerrainNode& node);

	protected:
		Math::vector		m_CameraLocalPos;
		float				m_SquareNodeDistance;
		MarkNodeDrawModeTraverser m_MarkLodParentDrawedTraverser;
	};

	//ergodic every visible LOD node, if edge changed, rebuild PrimitiveHandle
	class BuildEdgeMaskTraverser: public TerrainNodeTraverser
	{
	public:
		BuildEdgeMaskTraverser();
		virtual ~BuildEdgeMaskTraverser(){

		}
		virtual void Apply(TerrainNode& node);
	};

	//ergodic every visible LOD node, rebuild PrimitiveHandle
	class BuildPrimitiveTraverser: public TerrainNodeTraverser
	{
	public:
		BuildPrimitiveTraverser(const GPtr<Terrain::TerrainDataSource>& terrainDataSource);
		virtual ~BuildPrimitiveTraverser(){

		}

		virtual void Apply(TerrainNode& node);

	protected:
		GPtr<Terrain::TerrainDataSource> m_TerrainDataSource;
	};

	/** ergodic every, remove unused GraphicOject, add useful GraphicObject
	*
	*/
	class BuildGraphicObjectTraverser: public TerrainNodeTraverser
	{
	public:
		BuildGraphicObjectTraverser(TerrainRenderComponent* comObj);
		virtual ~BuildGraphicObjectTraverser(){

		}
		virtual void Apply(TerrainNode& node);
	protected:
		TerrainRenderComponent* m_TerrainComponent;
	};

	/// set node and child node need rebuild PrimitiveHandle
	class RequestBuildNodeAndParentTraverser: public TerrainNodeTraverser
	{
	public:
		RequestBuildNodeAndParentTraverser(const GPtr<Terrain::TerrainDataSource>& terrainDataSource);
		virtual ~RequestBuildNodeAndParentTraverser(){

		}
		virtual void Apply(TerrainNode& node);
	protected:
		GPtr<Terrain::TerrainDataSource> m_TerrainDataSource;
	};
}

#endif // __TerrainNodeFrameTraverser_H__


text:
RESTMan
============

RESTMan lets you easily interact with RESTful (GET, POST, PUT, DELETE) web APIs by allowing you to reference **object type enums instead of URLs** within your code. No messy in-line URLs to maintain.

```objective-c
// GET {YOUR_BASE_URL}/book/1234
[RESTMan getObjectOfType:BOOK withID:@"1234" parameters:nil success:^(id responseData) {
    NSDictionary *book = responseData[@"book"];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    // handle error just as you would when using AFNetworking
}];
```

Define all of your endpoints in a single plist file and let RESTMan do the rest. RESTman uses ARC and is built on top of `AFNetworking`, but adds a layer of simplicity that lets you write more maintainable code.

## Getting Started

### Installation

Copy the RESTMan folder into your Xcode project (make sure the "Copy items..." box is selected).

#### Modify build phases

Go to the `Build Phases` tab for your target and add a `New Run Script Build Phase`

![Add Script](https://dl.dropbox.com/s/9cpy4nuhwihn67m/rest-machine-add-build-script.png)

Add the following text to the the script area...

    cd "${SRCROOT}/${PROJECT_NAME}/RESTMan/RESTMan"
    /bin/sh "restman-generator.sh"

It should now look like this:

![Edit Script](https://dl.dropbox.com/s/ot10lj4fa9qgrov/restman_run_script.png)

### Set Up

Open RESTMan.plist within your project. This file will be used to generate all of the endpoints used in your API.

##### Base URL
For `Base URL`, set the value as the base url of your applications web service.

  ![Example plist](https://dl.dropbox.com/s/hem7iggve7688gs/rest-machine-screen1.png)

##### Resources

Define all of your endpoints via `Resources`.  Add a new row for each resource in your web API that you want to use. Here is an example:

    user#users

The *first* part before the `#` defines the way you want to reference the object throughout your project. The *second* part **after** the `#` should be the corresponding path name used by your API. In the example above, this will allow to refer refer to USER when using RESTMan, meanwhile under-the-hood RESTMan will generate URLs that use the `/users` path.

  ![Example plist](https://dl.dropbox.com/s/cl2yy3ofopcqw1n/rest-machine-screen2.png)

In addition, RESTMan can support different kinds of nested paths. For example, if your APIs path for login is something like `POST /auth/users/login`, where it is just a series of nested resources without IDs, you could do something like this.

    session#auth/users/login

This would allow to make the following call using RESTMan...

```objective-c
[RESTMan createObjectOfType:SESSION parameters:loginCredentials success:^(id responseData) {
    // get token from response data, etc...
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    // handle invalid credentials, etc...
}];
```

For nested paths that combine 2 resources, use the RESTMan class methods that accept *nested* and *root* object types. See the documentation in RESTMan.h for the details, or just jump right in and start using it bc it's awesome.

**You're done!**

This script will automatically pull in your settings from `RESTMan.plist` and generate your endpoints each time your project builds. Hit `CMD-B` and then checkout `RESTManConfig.h` to see your generated config file.

#### Authentication

RESTMan lets you add your applications custom authentication logic via the RESTManAuthentication.h file.
To do this you will need to modify the implementation of the *authenticatedPath* method.

### Usage

Import RESTMan wherever you need to make API calls.

    #import "RESTMan.h"

Use the public methods in *RESTMan.h* to easily get what you need from your web service.

```objective-c
+ (void)getObjectsOfType:(RESOURCE_TYPE)type
      withParameters:(NSDictionary *)params
             success:(void(^)(id responseData))successBlock
             failure:(void(^)(AFHTTPRequestOperation *operation, NSError *error))failureBlock;
````

Check out [*RESTMan.h*](https://github.com/camclendenin/RESTMan/blob/master/RESTMan/RESTMan.h) too see all of the methods available to you and to see more documentation.

## Requirements

[AFNetworking 2.0](https://github.com/AFNetworking/AFNetworking)

### TODOs

- Cocoapods support
- Handling different types of authentication


text:
"""
Santa
    repeatedly sleeps
    until wakened by
        either all of his nine reindeer, back from their holidays,
        or by a group of three of his ten elves.

If awakened by the reindeer
    he harnesses each of them to his sleigh, delivers toys with them
    and finally unharnesses them (allowing them to go off on holiday).

If awakened by a group of elves,
    he shows each of the group into his study, consults with them on
    toy R&D and finally shows them each out (allowing them to go back
    to work).

Santa should give priority to the reindeer in the case that there is
both a group of elves and a group of reindeer waiting.
"""
import Axon
import time
from Axon.Ipc import WaitComplete
from Kamaelia.Chassis.Graphline import Graphline
from Kamaelia.Chassis.Pipeline import Pipeline
from Kamaelia.Util.Backplane import Backplane,SubscribeTo
from Kamaelia.Util.TwoWaySplitter import TwoWaySplitter
from Kamaelia.Util.Console import ConsoleEchoer
from Kamaelia.Util.PureTransformer import PureTransformer
from BackplaneTuner import TunableSubscriber, TunablePublisher

locations = "holiday", "santasworkshop", "deliveringtoys", "study", "elfworkshop"

for locale in locations:
    Backplane(locale).activate()

debugging = 1
def tagger(tag):
    print "creating tag", tag
    return PureTransformer(lambda x: str((tag,x))+"\n" )

def tagger2(tag):
    print "creating tag2", tag
    return PureTransformer(lambda x: (tag,x) )

if debugging:

    for place in locations:
        Pipeline(
            SubscribeTo(place),
            tagger(place),
            ConsoleEchoer(),
        ).activate()

class Santa(Axon.Component.component):
    Name = "Santa"
    Outboxes = [ "feet", "voicebox", ]

    def main(self):
        print "Santa's up and about!"
        self.send("santasworkshop", "feet")
        for i in xrange(4): yield 1 # Nasty hack - we need to here from our feet when we've arrived(!)
        self.send("Ho Ho Ho!", "voicebox")
        yield WaitComplete( self.doSleeping() )

    def doSleeping(self):
        self.send("Snore!", "voicebox")
        yield 1
        while 1:
            while not self.dataReady("inbox"):
                self.pause()
                yield 1
            if self.dataReady("inbox"):
                message = self.recv("inbox")
                print self.Name, "heard:", repr(message)

class Reindeer(Axon.Component.component):
    Name = "Reindeer"
    Outboxes = [ "feet", "voicebox", ]
    def main(self):
        print "Reindeer", self.Name, "is up and about!"
        self.send("holiday", "feet")
        for i in xrange(4): yield 1 # Nasty hack - we need to here from our feet when we've arrived(!)
        yield WaitComplete( self.onHoliday() )
        while 1:
            yield WaitComplete( self.doSantasWorkshop())

    def onHoliday(self):
        self.send("snort!", "voicebox")
        t = time.time()
        while time.time() -t < 2:
#            print time.time() -t
#            while not self.dataReady("inbox"):
#                self.pause()
#                yield 1
            yield 1
            if self.dataReady("inbox"):
                message = self.recv("inbox")
                print self.Name, "heard:", repr(message)

    def doSantasWorkshop(self):
        self.send("santasworkshop", "feet") ;
        for i in xrange(4): yield 1 # Nasty hack - we need to here from our feet when we've arrived(!)
        print self.Name, "entered santas workshop"
        self.send("snort!", "voicebox") # reindeer don't really say much
        while 1:
            while not self.dataReady("inbox"):
                self.pause()
                yield 1
            if self.dataReady("inbox"):
                message = self.recv("inbox")
                print self.Name, "heard:", repr(message)

def Presence(actor, actor_name):
    return Graphline(
        SANTA = actor,
        TAGGER = tagger2(actor_name),
        SPLIT = TwoWaySplitter(),
        SENSES = TunableSubscriber(),
        OUTPUT = TunablePublisher(),
        linkages = {
            ("SANTA","feet") : ("SPLIT", "inbox"),       # To change location
            ("SPLIT","outbox") : ("SENSES", "inbox"),    # So we can hear stuff in the location
            ("SPLIT","outbox2") : ("OUTPUT", "next"),    # To change location
            ("SENSES", "outbox") : ("SANTA","inbox"),    # To be influenced by location
            ("SANTA","voicebox") : ("TAGGER", "inbox"),  # To influence the location
            ("TAGGER","outbox") : ("OUTPUT", "inbox"),   # To influence the location
        }
    )
for name in ["Dasher", "Dancer", "Prancer", "Vixen", "Comet", "Cupid", "Donder", "Blitzen", "Rudolph" ]:
    Presence(Reindeer(Name=name), name).activate()
Presence(Santa(), "Santa").run()


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="apple-touch-icon" href="apple-touch-icon.png">

        <link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.css" />

        <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css' />
        <link rel="stylesheet" href="../bower_components/normalize-css/normalize.css" />

        <link rel="stylesheet" href="css/main.css">

              Jal-Stats

                Activities Home

                 Activity Page

              <ng-view />


text:
all:
	javac src/superTrunfo/card/Card.java
	javac src/superTrunfo/card/CardBuilder.java
	javac src/superTrunfo/player/Player.java
	javac src/superTrunfo/player/BasePlayer.java
	javac src/superTrunfo/player/LocalPlayer.java
	javac src/superTrunfo/player/ComputerPlayer.java
	javac src/superTrunfo/core/GameInterface.java
	javac src/superTrunfo/core/Round.java
	javac src/superTrunfo/Setup.java
	javac src/superTrunfo/core/MainGame.java

clean:
	rm -rf src/superTrunfo/*.class
	rm -rf src/superTrunfo/*/*.class

run:
	java src/superTrunfo/core/MainGame.class


text:
```scss
/// Helper to clear inner floats
/// @author Nicolas Gallagher
/// @link http://nicolasgallagher.com/micro-clearfix-hack/ Micro Clearfix
@mixin clearfix {
  &::after {
    content: '';
    display: table;
    clear: both;
  }
}
```

```sass
/// Helper to clear inner floats
/// @author Nicolas Gallagher
/// @link http://nicolasgallagher.com/micro-clearfix-hack/ Micro Clearfix
@mixin clearfix
  &::after
    content: ''
    display: table
    clear: both
```


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

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Use with Camel's bean component.
 *
 * @author stefan.schulze@accelsis.biz
 *
 */
public class BrokenService {

    private static final Logger LOG = LoggerFactory.getLogger(BrokenService.class);

    /**
     * Always throws an exception.
     *
     * the current Camel message
     *
     * @throws BrokenServiceException
     */
    public void alwaysFails() throws BrokenServiceException {
        LOG.info("{} called", this.getClass().getSimpleName());
        throw new BrokenServiceException("Provoked failure");
    }

}


text:
/**
 * This file is part of the CernVM File System.
 */

#define __STDC_FORMAT_MACROS

#include "swissknife_diff.h"
#include "cvmfs_config.h"

#include <inttypes.h>
#include <stdint.h>

#include <algorithm>
#include <cassert>
#include <string>
#include <vector>

#include "catalog.h"
#include "catalog_counters.h"
#include "catalog_mgr_ro.h"
#include "download.h"
#include "statistics.h"
#include "swissknife_assistant.h"
#include "swissknife_diff_tool.h"
#include "util/pointer.h"
#include "util/posix.h"
#include "util/string.h"

using namespace std;  // NOLINT

namespace swissknife {
CommandDiff::~CommandDiff() {}

ParameterList CommandDiff::GetParams() const {
  swissknife::ParameterList r;
  r.push_back(Parameter::Mandatory('r', "repository url"));
  r.push_back(Parameter::Mandatory('n', "repository name"));
  r.push_back(Parameter::Mandatory('k', "public key of the repository / dir"));
  r.push_back(Parameter::Mandatory('t', "directory for temporary files"));
  r.push_back(Parameter::Optional('s', "'from' tag name"));
  r.push_back(Parameter::Optional('d', "'to' tag name"));
  r.push_back(Parameter::Switch('m', "machine readable output"));
  r.push_back(Parameter::Switch('h', "show header"));
  // Used for testing
  r.push_back(Parameter::Switch('i', "ignore time stamp differences"));
  r.push_back(Parameter::Switch('L', "follow HTTP redirects"));
  return r;
}

int swissknife::CommandDiff::Main(const swissknife::ArgumentList &args) {
  const string fqrn = MakeCanonicalPath(*args.find('n')->second);
  const string tmp_dir = MakeCanonicalPath(*args.find('t')->second);
  const string repository = MakeCanonicalPath(*args.find('r')->second);
  const bool show_header = args.count('h') > 0;
  const bool machine_readable = args.count('m') > 0;
  const bool ignore_timediff = args.count('i') > 0;
  const bool follow_redirects = args.count('L') > 0;
  string pubkey_path = *args.find('k')->second;
  if (DirectoryExists(pubkey_path))
    pubkey_path = JoinStrings(FindFiles(pubkey_path, ".pub"), ":");
  string tagname_from = "trunk-previous";
  string tagname_to = "trunk";
  if (args.count('s') > 0) tagname_from = *args.find('s')->second;
  if (args.count('d') > 0) tagname_to = *args.find('d')->second;

  bool retval = this->InitDownloadManager(follow_redirects);
  assert(retval);
  if (!InitVerifyingSignatureManager(pubkey_path)) {
    LogCvmfs(kLogCvmfs, kLogStderr,
             "Error calling InitVerifyingSignatureManager");
    return 1;
  }
  UniquePtr<manifest::Manifest> manifest(FetchRemoteManifest(repository, fqrn));
  assert(manifest.IsValid());

  Assistant assistant(download_manager(), manifest, repository, tmp_dir);
  UniquePtr<history::History> history(
      assistant.GetHistory(Assistant::kOpenReadOnly));
  assert(history.IsValid());
  history::History::Tag tag_from;
  retval = history->GetByName(tagname_from, &tag_from);
  if (!retval) {
    LogCvmfs(kLogCvmfs, kLogStderr, "unknown tag: s", tagname_from.c_str());
    return 1;
  }
  history::History::Tag tag_to;
  retval = history->GetByName(tagname_to, &tag_to);
  if (!retval) {
    LogCvmfs(kLogCvmfs, kLogStderr, "unknown tag: s", tagname_to.c_str());
    return 1;
  }

  DiffTool diff_tool(repository, tag_from, tag_to, tmp_dir, download_manager(),
                     statistics(), machine_readable, ignore_timediff);
  if (!diff_tool.Init()) {
    return 1;
  }

  if (show_header) diff_tool.ReportHeader();
  diff_tool.ReportStats();
  diff_tool.Run(PathString(""));

  return 0;
}

}  // namespace swissknife