text:
var app = angular.module('zeus.viz');

app.service('ToDoServiceDatos', function (localStorageService) {

	this.key = "angular-todolist";

	if(localStorageService.get(this.key)){
        this.datos  = localStorageService.get(this.key);
    }else{
        this.datos = [];
    }

    this.getAll = function(){
        return this.datos;
    }

    this.updateLocalStorage =  function () {
        localStorageService.set(this.key, this.datos);
    }

    this.add = function (newData) {
        this.datos.push(newData);
        this.updateLocalStorage();
    }

    this.clean = function () {
        this.datos = [];
        this.updateLocalStorage();
        return this.get()
    }

    this.get = function(){
        return this.datos[0];
    }

    this.findbyNombre = function (nombre) {
       var list = [];
       this.datos.filter(function (val) {
            if(nombre === val.nombre)
            	list.push(val);
        });
       return list;
    }
});

app.service('DatosServices', function ($http, ToDoServiceDatos) {

	this.getData = function(){
        if(ToDoServiceDatos.getAll().length === 0){
    		$http.get('src/data.json').then(function(res){
    			angular.forEach(res.data, function(value, key) {
    				ToDoServiceDatos.add({
    					nombre: value.apellido_nombre,
    					mes_id: value.mes,
    					asignacion_mensual : value.asignacion_mensual
    				});
    			});
    		});
        }
	}

 	this.getDistint = function(){
 		var uniqueNombre = [];
 		var data = ToDoServiceDatos.getAll();
		for(i = 0; i< data.length; i++){
		    if(uniqueNombre.indexOf(data[i].nombre) === -1){
		        uniqueNombre.push(data[i].nombre);
            }
		}
		return uniqueNombre;
 	}

    this.getValues  = function(nombre){
 		var nombres = this.getDistint();
		var dataNombre = ToDoServiceDatos.findbyNombre(nombre);
		var valuesNombre = [];
		for(var n = 0; n < dataNombre.length; n++){
			valuesNombre.push(dataNombre[n].asignacion_mensual);
		}
		return valuesNombre;
    };

});


text:
Cyanide Theme
===============

Thanks for downloading Cyanide Theme!
Feel free to open an issue on Github if you have any problem with the theme.

https://github.com/lefoy/cyanide-theme

** NEW: Cyanide Theme Builder **
More info: https://github.com/lefoy/cyanide-theme#cyanide-theme-builder

redpajama_set_name: RedPajamaGithub


text:
<resources>
    <string name="app_name">AwesomeRxJava</string>

    <string name="create_operator">This sample demonstrate `create` ,`just` and `from` operators.</string>

    <string name="flat_map">This sample demonstrate flatMap usage. How to get IPs from hosts. \n
        The task of getting IPs was executed in work thread. Consuming final result in main thread.</string>

    <string name="map">This sample demonstrate usage of map operator.
        Including the operator of flatMap use case and demonstrating how to transform data by map operator </string>

    <string name="compare_flatmap_concatmap">This sample demonstrate what difference between flatmap and concatmap.
        </string>
    <string name="multiple_observables">Retrieve data from Multiple Observables.
        For example, getting data from memory,disk,network.
        which layer data not null, will stop check the other layer</string>
    <string name="title_activity_login">Sign in</string>

    <!-- Strings related to login -->
    <string name="prompt_email">Email</string>
    <string name="prompt_password">Password (optional)</string>
    <string name="action_sign_in">Sign in or register</string>
    <string name="action_sign_in_short">Sign in</string>
    <string name="error_invalid_email">This email address is invalid</string>
    <string name="error_invalid_password">This password is too short</string>
    <string name="error_incorrect_password">This password is incorrect</string>
    <string name="error_field_required">This field is required</string>
    <string name="permission_rationale">"Contacts permissions are needed for providing email
        completions."
    </string>

</resources>


text:
import {Component, OnInit } from '@angular/core';
import {MessageService} from 'primeng/api';

@Component({
    selector: 'jhi-chips',
    templateUrl: './chipsdemo.component.html',
    styles: []
})
export class ChipsDemoComponent implements OnInit {

    contactnames: string[];

    contactsnotified: string[];

    complexcontacts: string[];

    disabledcontacts: string[];

    activeIndex = 0;

    constructor(private messageService: MessageService) {
        this.contactnames = [];
        this.contactsnotified = [];
        this.complexcontacts = [];
        this.disabledcontacts = ['PrimeTek', 'InfoTek'];
    }

    onAddContact(): void {
        this.messageService.add(
            {severity: 'info', summary: 'The contact is added'});
    }

    onRemoveContact(): void {
        this.messageService.add(
            {severity: 'info', summary: 'The contact is removed'});
    }

    onContactClick(): void {
        this.messageService.add(
            {severity: 'info', summary: 'The contact is clicked'});
    }

    onChangeStep(label: string): void {
        this.messageService.add({severity: 'info', summary: label});
    }

    ngOnInit(): void {

    }
}


text:
# WordPress Foundation
>Helper classes for building WordPress theme in the LIN3S way

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/9d974f76-3f53-487b-b6ed-92d3b328a450/mini.png)](https://insight.sensiolabs.com/projects/9d974f76-3f53-487b-b6ed-92d3b328a450)
[![Build Status](https://travis-ci.org/LIN3S/WPFoundation.svg?branch=master)](https://travis-ci.org/LIN3S/WPFoundation)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/LIN3S/WPFoundation/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/LIN3S/WPFoundation/?branch=master)
[![Total Downloads](https://poser.pugx.org/lin3s/wp-foundation/downloads)](https://packagist.org/packages/lin3s/wp-foundation)

[![Latest Stable Version](https://poser.pugx.org/lin3s/wp-foundation/v/stable.svg)](https://packagist.org/packages/lin3s/wp-foundation)
[![Latest Unstable Version](https://poser.pugx.org/lin3s/wp-foundation/v/unstable.svg)](https://packagist.org/packages/lin3s/wp-foundation)

## Why?
After implementing several WordPress themes, we built what we think can be considered as best practices building this
kind of projects in a clean, consistent and fast way: thus was born [LIN3S][1]'s [WordPress Standard Edition][2]. We are
really happy with it, but there are some tasks that are very repetitive and tedious, furthermore each developer usually
implements in a different way so, with this library we try to avoid these kind of troubles. At this moment, WPFoundation
only contains a set of **interfaces** and **abstract classes** (in the future who knows :)) to force all developers to
follow the same way becoming our code more consistent.

## Installation
The recommended and the most suitable way to install is through [Composer][3]. Be sure that the tool is installed
in your system and execute the following command:

```
$ composer require lin3s/wp-foundation
```

## Usage examples
The following code snippets are representative code samples of how can it use this library:

1. Ajax
  * [Ajax](#ajax)
2. Configuration
  * [ACF](#acf)
  * [Assets](#assets)
  * [Mailer](#mailer)
  * [Menus](#menus)
  * [Theme](#theme)
  * [Translations](#translations)
3. PostTypes
  * [PostType](#posttype)
  * [Fields](#fields)
  * [RewriteRules](#rewriterules)
4. Twig
  * [TagManagerTwig](#tagmanagertwig)
  * [TranslationTwig](#translationtwig)
5. Widgets
  * [Widget](#widget)
  * [Widget Areas](#widget-areas)

### Ajax
```php
(...)

use LIN3S\WPFoundation\Ajax\Ajax;

final class MyAwesomeAjax extends Ajax
{
    /**
     * {@inheritdoc}
     */
    protected $action = 'my_awesome_ajax';

    /**
     * {@inheritdoc}
     */
    public function ajax()
    {
        (...)

        die('returning data');
    }
}
```

### ACF
ACF configuration class, this class is responsible for all the logic about this WordPress plugin. A this moment this
API only has one method that allows to have seamlessly multiple WYSWYG configuration for this type field used by ACF.
```php
(...)

use LIN3S\WPFoundation\Configuration\Acf\Acf;

final class Acf extends BaseAcf
{
    /**
     * {@inheritdoc}
     */
    public function wyswygToolbars()
    {
        return [
            'basic' => [1 => ['bold', 'italic']],
            'lin3s' => [1 => ['bold', 'italic', 'bullist', 'numlist', 'link', 'unlink']],
        ];
    }
}
```

### Assets
```php
(...)

use LIN3S\WPFoundation\Configuration\Assets\Assets as BaseAssets;

final class Assets extends BaseAssets
{
    /**
     * {@inheritdoc}
     */
    public function productionAssets()
    {
        $this
            ->addScript('app.min', self::BUILD_JS, ['jquery', 'jquery.counterup', 'sidr']);
    }

    /**
     * {@inheritdoc}
     */
    public function developmentAssets()
    {
            $this
                ->addScript('jquery.sidr.min', self::VENDOR . '/sidr')
                ->addScript('waypoints', self::VENDOR . '/jquery-waypoints')
                ->addScript('jquery.counterup', self::VENDOR . '/Counter-Up')

                ->addScript('counter', self::ASSETS_JS, ['jquery', 'jquery.sidr.min', 'waypoints', 'jquery.counterup'])
                ->addScript('typekit', self::ASSETS_JS, [], '1.0.0', false)

                ->addScript('menu')
                ->addScript('accordion')

                ->addScript('post-ajax', self::ASSETS_JS, [], '1.0.0', false, 'postsAjax')
    }

    /**
     * {@inheritdoc}
     */
    public function adminAssets()
    {
        $this->addStylesheet('adminCss');
        $this->addScript('adminScript');
    }
}
```

### Mailer
`Mailer` class configures the way that emails are sent using `wp_mail()`. You should configure the mailer parameters
editing the WordPress config file. Default parameters are given for the localhost smtp delivery.

You can define your own custom mailer that implements `MailInterface` and uses `wp_mail()` configuration selected
creating an instance of one of the two strategies above.
```php
(...)

use LIN3S\WPFoundation\Configuration\Mailer\MailInterface;
use Timber;

final class ContactMail implements MailInterface
{
    /**
     * {@inheritdoc}
     */
    public static function mail($request)
    {
        wp_mail(
            MAILER_TO,
            'Contact'
            Timber::compile('mail/mail.twig', ['request' => $request]),
            ['Content-Type: text/html; charset=UTF-8']
        );
    }
}
```

> `MailerInterface` is deprecated and will be removed in v2.0.0. Use wp_mail() directly to send the emails

### Menus

```php
// src/App/App.php

use LIN3S\WPFoundation\Configuration\Menus\Menus

class App extends Theme {
    public function classes() {
        (...)
        new Menus([
            self::MENU_AWESOME => 'Awesome menu'
        ]
    }
}
```

### Theme
```php
(...)

use LIN3S\WPFoundation\Configuration\Theme\Theme;

final class AwesomeTheme extends Theme
{
    /**
     * {@inheritdoc}
     */
    public function classes()
    {
        new Assets();
        new Acf();
        new Mailer();
        new Menus();

        new CustomPostType();
    }

    /**
     * {@inheritdoc}
     */
    public function templates($templates)
    {
        return array_merge($templates, [
            'index'    => 'Index',
            'customs' => 'Customs',
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function context(array $context)
    {
        $context['mainMenu'] = new TimberMenu('main-menu');
        $data['lang'] = ICL_LANGUAGE_CODE;

        return $context;
    }
}
```

### Translations
```php
\LIN3S\WPFoundation\Configuration\Translations\Translations::trans('Your awesome string');
```

### PostType

Declaring a post type is as easy as creating a new instance of `PostType`.

```php
// src/App/App.php

class App extends Theme {
    public function classes() {
        (...)
        new PostType(
            PostTypes::CUSTOM_POST_TYPE,
            [
                'labels'             => [
                    'name'          => Translations::trans('Exhibitions'),
                    'singular_name' => Translations::trans('Exhibition'),
                ],
                'has_archive'        => true,
                'public'             => true,
                'publicly_queryable' => true,
                'query_var'          => true,
                'show_in_rest'       => true,
                'show_ui'            => true,
                'supports'           => ['title', 'editor', 'thumbnail'],
            ]
        )
    }
}
```

To add custom fields to a custom post type just create a `Fields` instance:

```php
// src/App/App.php

class App extends Theme {
    public function classes() {
        (...)
        new Fields(
            PostTypes::CUSTOM_POST_TYPE,
            [
                Fully\Qualified\Namespace\Components\CustomFieldComponent::class,
            ],
            new PostTypeFieldConnector(PostTypes::CUSTOM_POST_TYPE)
            ['editor'],
            ['comments']
        );
    }
}
```

### Fields
```php
(...)

use LIN3S\WPFoundation\PostTypes\Field\FieldComponent;

final class CustomFieldComponent extends FieldComponent
{
    /**
     * {@inheritdoc}
     */
    public static function definition($aName)
    {
        return [
            'key' => sprintf('field_%s_component', $aName),

            (...)
        ]);
    }
}
```

```php
(...)

use LIN3S\WPFoundation\PostTypes\Fields\PageFields as BasePageFields;

final class PageFields extends BasePageFields
{
    /**
     * {@inheritdoc}
     */
    private $name = 'my_awesome_template;

    /**
     * {@inheritdoc}
     */
    public function components()
    {
        return [
            'Fully\Qualified\Namespace\Components\CustomFieldComponent',
        ];
    ];
}
```

### RewriteRules
```php
(...)

use LIN3S\WPFoundation\PostTypes\RewriteRules\RewriteRules;

final class CustomRewriteRules extends RewriteRules
{
    /**
     * {@inheritdoc}
     */
    public function rewriteRules()
    {
        add_rewrite_rule(
            '^custom-base-url/([^/]*)/([^/]*)/([^/]*)/?$',
            'index.php?category=$matches[1]&subcategory=$matches[2]&custom=$matches[3]',
            'top'
        );

        add_rewrite_rule(
            '^custom-base-url/([^/]*)/([^/]*)/?$',
            'index.php?category=$matches[1]&subcategory=$matches[2]',
            'top'
        );
    }

    /**
     * {@inheritdoc}
     */
    public function rewriteTags()
    {
        add_rewrite_tag('%category%', '([^/]*)');
        add_rewrite_tag('%subcategory%', '([^/]*)');
        add_rewrite_tag('%custom%', '([^/]*)');
    }

    /**
     * {@inheritdoc}
     */
    public function templateInclude($template)
    {
        $controller = new CustomController();

        $method = '';
        if (get_query_var('category') !== ''
            && get_query_var('subcategory') !== ''
            && get_query_var('custom') != ''
        ) {
            $method = 'showAction';
        } elseif (get_query_var('category') !== ''
            && get_query_var('subcategory') !== ''
        ) {
            $method = 'listAction';
        }

        return $method === '' ? $template : $controller->$method();
    }
}
```

### TagManagerTwig
After instantiate the the `TagManagerTwig` in your theme, you can just call as following:
```twig
(...)
{% block tagManager %}
    {{ tagManager('GTM-XXXXXX') }}
{% endblock %}
```

### TranslationTwig
After instantiate the the `TranslationTwig` in your theme, you can just call as following:
```twig
(...)
{{ trans('Your awesome string') }}
```

### Widget
```php
(...)

use LIN3S\WPFoundation\Widgets\Widget;

final class SocialNetworksWidget extends Widget
{
    /**
     * {@inheritdoc}
     */
    public function widget($args, $instance)
    {
        $data = [
            'beforeWidget' => $args['before_widget'],
            'afterWidget'  => $args['after_widget'],
            'beforeTitle'  => $args['before_title'],
            'afterTitle'   => $args['after_title'],
            'twitterUrl'   => (!empty($instance['twitterUrl'])) ? strip_tags($instance['twitterUrl']) : '',
            'facebookUrl'  => (!empty($instance['facebookUrl'])) ? strip_tags($instance['facebookUrl']) : '',
            'pinterestUrl' => (!empty($instance['pinterestUrl'])) ? strip_tags($instance['pinterestUrl']) : '',
            'youtubeUrl'   => (!empty($instance['youtubeUrl'])) ? strip_tags($instance['youtubeUrl']) : '',
            'rssUrl'       => (!empty($instance['rssUrl'])) ? strip_tags($instance['rssUrl']) : '',
        ];

        return Timber::render('widgets/front/socialNetworks.twig', $data);
    }

    /**
     * {@inheritdoc}
     */
    public function form($instance)
    {
        $instance['widgetNumber'] = $this->number();
        $instance['widgetName'] = $this->name();

        return Timber::render('widgets/admin/socialNetworks.twig', $instance);
    }

    /**
     * {@inheritdoc}
     */
    public function update($newInstance)
    {
        $instance = [
            'twitterUrl'   => (!empty($newInstance['twitterUrl'])) ? strip_tags($newInstance['twitterUrl']) : '',
            'facebookUrl'  => (!empty($newInstance['facebookUrl'])) ? strip_tags($newInstance['facebookUrl']) : '',
            'pinterestUrl' => (!empty($newInstance['pinterestUrl'])) ? strip_tags($newInstance['pinterestUrl']) : '',
            'youtubeUrl'   => (!empty($newInstance['youtubeUrl'])) ? strip_tags($newInstance['youtubeUrl']) : '',
            'rssUrl'       => (!empty($newInstance['rssUrl'])) ? strip_tags($newInstance['rssUrl']) : '',
        ];

        return $instance;
    }
}
```

### Widget Areas
```php
(...)

use LIN3S\WPFoundation\Widgets\Areas\WidgetArea;

final class CustomWidgetArea extends WidgetArea
{
    /**
     * {@inheritdoc}
     */
    public function widgetArea()
    {
        register_sidebar([
            'name'          => 'Custom widgets',
            'id'            => 'custom-widgets',
            'before_widget' => '<section class="custom-widget">',
            'after_widget'  => '</section>',
            'before_title'  => '<h5>',
            'after_title'   => '</h5>',
        ]);
    }
}
```
##Licensing Options
[![License](https://poser.pugx.org/lin3s/wp-foundation/license.svg)](https://github.com/LIN3S/WPFoundation/blob/master/LICENSE)

[1]: http://lin3s.com
[2]: https://github.com/LIN3S/WordpressStandard
[3]: https://getcomposer.org/download/


text:
<?php

namespace Magento\Framework\Validator\Test\Unit;

class ObjectTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Framework\Validator\DataObject
     */
    protected $_model;

    protected function setUp()
    {
        $this->_model = new \Magento\Framework\Validator\DataObject();

        $fieldOneExactValue = new \Zend_Validate_Identical('field_one_value');
        $fieldOneExactValue->setMessage("'field_one' does not match expected value");
        $fieldOneLength = new \Zend_Validate_StringLength(['min' => 10]);

        $fieldTwoExactValue = new \Zend_Validate_Identical('field_two_value');
        $fieldTwoExactValue->setMessage("'field_two' does not match expected value");
        $fieldTwoLength = new \Zend_Validate_StringLength(['min' => 5]);

        $entityValidity = new \Zend_Validate_Callback([$this, 'isEntityValid']);
        $entityValidity->setMessage('Entity is not valid.');

        $this->_model->addRule(
            $fieldOneLength,
            'field_one'
        )->addRule(
            $fieldOneExactValue,
            'field_one'
        )->addRule(
            $fieldTwoLength,
            'field_two'
        )->addRule(
            $fieldTwoExactValue,
            'field_two'
        )->addRule(
            $entityValidity
        );
    }

    protected function tearDown()
    {
        $this->_model = null;
    }

    /**
     * Entity validation routine to be used as a callback
     *
     * @param \Magento\Framework\DataObject $entity
     * @return bool
     */
    public function isEntityValid(\Magento\Framework\DataObject $entity)
    {
        return (bool)$entity->getData('is_valid');
    }

    public function testAddRule()
    {
        $actualResult = $this->_model->addRule(new \Zend_Validate_Identical('field_one_value'), 'field_one');
        $this->assertSame($this->_model, $actualResult, 'Methods chaining is broken.');
    }

    public function testGetMessages()
    {
        $messages = $this->_model->getMessages();
        $this->assertInternalType('array', $messages);
    }

    /**
     * @param array $inputEntityData
     * @param array $expectedErrors
     * @dataProvider validateDataProvider
     */
    public function testIsValid(array $inputEntityData, array $expectedErrors)
    {
        $entity = new \Magento\Framework\DataObject($inputEntityData);
        $isValid = $this->_model->isValid($entity);
        $this->assertFalse($isValid, 'Validation is expected to fail.');

        $actualMessages = $this->_model->getMessages();
        $this->assertCount(count($expectedErrors), $actualMessages, 'Number of messages does not meet expectations.');
        foreach ($expectedErrors as $errorIndex => $expectedErrorMessage) {
            /** @var $actualMessage \Magento\Framework\Message\AbstractMessage */
            $actualMessage = $actualMessages[$errorIndex];
            $this->assertEquals($expectedErrorMessage, $actualMessage);
        }
    }

    public function validateDataProvider()
    {
        return [
            'only "field_one" is invalid' => [
                ['field_one' => 'one_value', 'field_two' => 'field_two_value', 'is_valid' => true],
                ["'one_value' is less than 10 characters long", "'field_one' does not match expected value"],
            ],
            'only "field_two" is invalid' => [
                ['field_one' => 'field_one_value', 'field_two' => 'two_value', 'is_valid' => true],
                ["'field_two' does not match expected value"],
            ],
            'entity as a whole is invalid' => [
                ['field_one' => 'field_one_value', 'field_two' => 'field_two_value'],
                ['Entity is not valid.'],
            ],
            'errors aggregation' => [
                ['field_one' => 'one_value', 'field_two' => 'two'],
                [
                    "'one_value' is less than 10 characters long",
                    "'field_one' does not match expected value",
                    "'two' is less than 5 characters long",
                    "'field_two' does not match expected value",
                    'Entity is not valid.'
                ],
            ]
        ];
    }
}


text:
#ifndef BRAINFUCK_H
#define BRAINFUCK_H

#define BRAINFUCK_VERSION "2.6.5"
#define BRAINFUCK_TAPE_SIZE 30000

#define BRAINFUCK_TOKEN_PLUS '+'
#define BRAINFUCK_TOKEN_MINUS '-'
#define BRAINFUCK_TOKEN_PREVIOUS '<'
#define BRAINFUCK_TOKEN_NEXT '>'
#define BRAINFUCK_TOKEN_OUTPUT '.'
#define BRAINFUCK_TOKEN_INPUT ','
#define BRAINFUCK_TOKEN_LOOP_START '['
#define BRAINFUCK_TOKEN_LOOP_END ']'
#ifdef BRAINFUCK_EXTENSION_DEBUG
#	define BRAINFUCK_TOKEN_BREAK '#'
#else
#	define BRAINFUCK_TOKEN_BREAK -10
#endif

/*
 * Represents a brainfuck instruction.
 */
typedef struct BrainfuckInstruction {
	/*
	 * The difference between the value of the byte at the currect pointer and
	 *   the value we want.
	 */
	int difference;
	/*
	 * The type of this instruction.
	 */
	char type;
	/*
	 * The next instruction in the linked list.
	 */
	struct BrainfuckInstruction *next;
	/*
 	 * The previous instruction in the linked list.
 	 */
	struct BrainfuckInstruction *previous;
	/*
	 * The first instruction of a loop if this instruction is a loop. Otherwise
	 * 	NULL
	 */
	struct BrainfuckInstruction *loop;
} BrainfuckInstruction;

/*
 * The state structure contains the head and the root of the linked list containing
 * 	the instructions of the program.
 */
typedef struct BrainfuckState {
	/*
	 * The root instruction of the instruction linked list.
	 */
	struct BrainfuckInstruction *root;
	/*
 	 * The head instruction of the instruction linked list.
 	 */
	struct BrainfuckInstruction *head;
} BrainfuckState;

/*
 * The callback that will be invoked when the BRAINFUCK_TOKEN_OUTPUT token is found.
 *
 * @param chr The value of the current cell.
 */
typedef int (*BrainfuckOutputHandler) (int chr);

/*
 * The callback that will be invoked when the BRAINFUCK_TOKEN_INPUT token is found.
 *
 * @return The character that is read.
 */
typedef int (*BrainfuckInputHandler) (void);

/*
 * This structure is used as a layer between a brainfuck program and
 * 	the outside. It allows control over input, output and memory.
 */
typedef struct BrainfuckExecutionContext {
	/*
	 * The callback that will be invoked when the BRAINFUCK_TOKEN_OUTPUT token is found.
	 */
	BrainfuckOutputHandler output_handler;
	/*
	 * The callback that will be invoked when the BRAINFUCK_TOKEN_INPUT token is found.
	 */
	BrainfuckInputHandler input_handler;
	/*
	 * An array containing the memory cells the program can use.
	 */
	unsigned char *tape;
	/*
	 * Index into tape. Modified during execution.
	 */
	int tape_index;
	/*
	 * size of the tape in umber of cells.
	 */
	size_t tape_size;
	/*
	 * A flag that, if set to true, indicates that execution should stop.
	 */
	int shouldStop;
} BrainfuckExecutionContext;

/*
 * Creates a new state.
 */
BrainfuckState * brainfuck_state();

/*
 * Creates a new context.
 *
 * @param size The size of the tape.
 */
BrainfuckExecutionContext * brainfuck_context(int);

/*
 * Removes the given instruction from the linked list.
 *
 * @param state The state
 * @param instruction The instruction to remove.
 * @return The instruction that is removed.
 */
BrainfuckInstruction * brainfuck_remove(struct BrainfuckState *, struct BrainfuckInstruction *);

/*
 * Adds an instruction to the instruction list.
 *
 * @param state The state.
 * @param instruction The instruction to add.
 * @return The instruction that is given.
 */
BrainfuckInstruction * brainfuck_add(struct BrainfuckState *state, struct BrainfuckInstruction *);

/*
 * Adds an instruction to the front of the instruction list.
 *
 * @param state The state.
 * @param instruction The instruction to add.
 * @return The instruction that is given.
 */
BrainfuckInstruction * brainfuck_add_first(struct BrainfuckState *state, struct BrainfuckInstruction *);

/*
 * Adds an instruction to the instruction list.
 *
 * @param state The state.
 * @param before The instruction you want to add another instruction before.
 * @param instruction The instruction to add.
 * @return The instruction that is given.
 */
BrainfuckInstruction * brainfuck_insert_before(struct BrainfuckState *, struct BrainfuckInstruction *,
	struct BrainfuckInstruction *);

/*
 * Adds an instruction to the instruction list.
 *
 * @param state The state.
 * @param after The instruction you want to add another instruction after.
 * @param instruction The instruction to add.
 * @return The instruction that is given.
 */
BrainfuckInstruction * brainfuck_insert_after(struct BrainfuckState *, struct BrainfuckInstruction *,
	struct BrainfuckInstruction *);

/*
 * Reads a character, converts it to an instruction and repeats until the EOF character
 * 	occurs and will then return a linked list containing all instructions.
 *
 * @param stream The stream to read from.
 * @param The head of the linked list containing the instructions.
 */
BrainfuckInstruction * brainfuck_parse_stream(FILE *);

/*
 * Reads a character, converts it to an instruction and repeats until the given character
 * 	occurs and will then return a linked list containing all instructions.
 *
 * @param stream The stream to read from.
 * @param until If this character is found in the stream, we will quit reading and return.
 * @param The head of the linked list containing the instructions.
 */
BrainfuckInstruction * brainfuck_parse_stream_until(FILE *, int);

/*
 * Reads a character, converts it to an instruction and repeats until the string ends
 *	and will then return a linked list containing all instructions.
 *
 * @param str The string to read from.
 * @param The head of the linked list containing the instructions.
 */
BrainfuckInstruction * brainfuck_parse_string(char *);

/*
 * Reads a character, converts it to an instruction and repeats until the string ends
 *	and will then return a linked list containing all instructions.
 *
 * @param str The string to read from.
 * @param begin The index you want to start parsing at.
 * @param end The index you want to stop parsing at.
 *	When -1 is given, it will stop at the end of the string.
 * @param The head of the linked list containing the instructions.
 */
BrainfuckInstruction * brainfuck_parse_substring(char *, int, int);

/*
 * Reads a character, converts it to an instruction and repeats until the string ends
 *	and will then return a linked list containing all instructions.
 * This method is special because it uses the begin index as counter, so this variable
 * 	will increase.
 *
 * @param str The string to read from.
 * @param ptr The pointer to the integer holding the index you want to start parsing at.
 *	Since this will be used as counter, the value of the pointer will be increased.
 * @param end The index you want to stop parsing at.
 *	When -1 is given, it will stop at the end of the string.
 * @param The head of the linked list containing the instructions.
 */
BrainfuckInstruction * brainfuck_parse_substring_incremental(char *, int *, int);

/*
 * Converts the given character to an instruction.
 *
 * @param c The character to convert.
 * @param The character that's converted into an instruction.
 */
BrainfuckInstruction * brainfuck_parse_character(char);

/*
 * Destroys the given instruction.
 *
 * @param instruction The instruction to destroy.
 */
void brainfuck_destroy_instruction(struct BrainfuckInstruction *);

/*
 * Destroys a linked list containing instructions.
 *
 * @param head The start of the instruction list.
 */
void brainfuck_destroy_instructions(struct BrainfuckInstruction *);

/*
 * Destroys a state.
 *
 * @param state The state to destroy
 */
void brainfuck_destroy_state(struct BrainfuckState *);

/*
 * Destroys a context.
 *
 * @param context The context to destroy
 */
void brainfuck_destroy_context(struct BrainfuckExecutionContext *);

/*
 * Executes the given linked list containing instructions.
 *
 * @param root The start of the linked list of instructions you want
 * 	to execute.
 * @param context The context of this execution that contains the tape and
 *	other execution related variables.
 */
void brainfuck_execute(struct BrainfuckInstruction *, struct BrainfuckExecutionContext *);

/*
 * Stops the currently running program referenced by the given execution context.
 *
 * @param context The context of this execution that contains the tape and
 *	other execution related variables.
 */
void brainfuck_execution_stop(BrainfuckExecutionContext *);

#endif /* BRAINFUCK_H */


text:
// ***********************************************************************
// Assembly         : StarMath
// Author           : MICampbell
// Created          : 05-14-2015
//
// Last Modified By : MICampbell
// Last Modified On : 07-07-2015
// ***********************************************************************
// <copyright file="find functions.cs" company="Design Engineering Lab -- MICampbell">
//     2014
// </copyright>
// <summary></summary>
// ***********************************************************************
using System.Collections.Generic;
using System.Linq;

namespace StarMathLib
{
    public static partial class StarMath
    {
        #region Max matrix functions.

        /// <summary>
        /// Finds the maximum value in the given 2D double array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>A double value that is the maximum of A</returns>
        public static double Max(this double[,] A)
        {
            var max = double.NegativeInfinity;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (max < A[i, j]) max = A[i, j];
            return max;
        }

        /// <summary>
        /// Finds the maximum value in the given 2D double array and returns the row and column indices along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="rowIndex">Index of the row.</param>
        /// <param name="colIndex">Index of the col.</param>
        /// <returns>the maximum value</returns>
        public static double Max(this double[,] A, out int rowIndex, out int colIndex)
        {
            var max = double.NegativeInfinity;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            rowIndex = colIndex = -1;
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (max < A[i, j])
                    {
                        max = A[i, j];
                        rowIndex = i;
                        colIndex = j;
                    }
            return max;
        }

        /// <summary>
        /// Finds the maximum value in the given 2D integer array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>An integer value that is the maximum of A</returns>
        public static int Max(this int[,] A)
        {
            var max = int.MinValue;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (max < A[i, j]) max = A[i, j];
            return max;
        }

        /// <summary>
        /// Finds the maximum value in the given 2D double array and returns the row and column indices along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="rowIndex">Index of the row.</param>
        /// <param name="colIndex">Index of the col.</param>
        /// <returns>the maximum value</returns>
        public static int Max(this int[,] A, out int rowIndex, out int colIndex)
        {
            var max = int.MinValue;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            rowIndex = colIndex = -1;
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (max < A[i, j])
                    {
                        max = A[i, j];
                        rowIndex = i;
                        colIndex = j;
                    }
            return max;
        }

        #endregion

        #region Min matrix functions.

        /// <summary>
        /// Finds the minimum value in the given 2D double array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>A double value that is the minimum of A</returns>
        public static double Min(this double[,] A)
        {
            var min = double.PositiveInfinity;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (min > A[i, j]) min = A[i, j];
            return min;
        }

        /// <summary>
        /// Finds the minimum value in the given 2D double array and returns the row and column indices along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="rowIndex">Index of the row.</param>
        /// <param name="colIndex">Index of the col.</param>
        /// <returns>the minimum value</returns>
        public static double Min(this double[,] A, out int rowIndex, out int colIndex)
        {
            var min = double.PositiveInfinity;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            rowIndex = colIndex = -1;
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (min > A[i, j])
                    {
                        min = A[i, j];
                        rowIndex = i;
                        colIndex = j;
                    }
            return min;
        }

        /// <summary>
        /// Finds the minimum value in the given 2D integer array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>An integer value that is the minimum of A</returns>
        public static int Min(this int[,] A)
        {
            var min = int.MaxValue;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (min > A[i, j]) min = A[i, j];
            return min;
        }

        /// <summary>
        /// Finds the minimum value in the given 2D double array and returns the row and column indices along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="rowIndex">Index of the row.</param>
        /// <param name="colIndex">Index of the col.</param>
        /// <returns>the minimum value</returns>
        public static int Min(this int[,] A, out int rowIndex, out int colIndex)
        {
            var min = int.MaxValue;
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            rowIndex = colIndex = -1;
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (min > A[i, j])
                    {
                        min = A[i, j];
                        rowIndex = i;
                        colIndex = j;
                    }
            return min;
        }

        #endregion

        #region Min and max vector functions.

        /// <summary>
        /// Finds the maximum value in the given 1D integer array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>An integer value that is the maximum of A</returns>
        public static int Max(this IList<int> A)
        {
            var max = int.MinValue;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (max < A[i]) max = A[i];
            return max;
        }

        /// <summary>
        /// Finds the minimum value in the given 1D integer array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>An integer value that is the minimum of A</returns>
        public static int Min(this IList<int> A)
        {
            var min = int.MaxValue;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (min > A[i]) min = A[i];
            return min;
        }

        /// <summary>
        /// Finds the maximum value in the given 1D double array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>An double value that is the maximum of A</returns>
        public static double Max(this IList<double> A)
        {
            var max = double.NegativeInfinity;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (max < A[i]) max = A[i];
            return max;
        }

        /// <summary>
        /// Finds the minimum value in the given 1D double array
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <returns>An double value that is the minimum of A</returns>
        public static double Min(this IList<double> A)
        {
            var min = double.PositiveInfinity;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (min > A[i]) min = A[i];
            return min;
        }

        /// <summary>
        /// Finds the minimum value in the given 1D double array and returns its index along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="index">The index.</param>
        /// <returns>the minimum value</returns>
        public static double Min(this IList<double> A, out int index)
        {
            index = -1;
            var min = double.PositiveInfinity;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (min > A[i])
                {
                    min = A[i];
                    index = i;
                }
            return min;
        }

        /// <summary>
        /// Finds the minimum value in the given 1D double array and returns its index along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="index">The index.</param>
        /// <returns>the maximum value</returns>
        public static double Max(this IList<double> A, out int index)
        {
            index = -1;
            var max = double.NegativeInfinity;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (max < A[i])
                {
                    max = A[i];
                    index = i;
                }
            return max;
        }

        /// <summary>
        /// Finds the minimum value in the given 1D double array and returns its index along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="index">The index.</param>
        /// <returns>the minimum value</returns>
        public static int Min(this IList<int> A, out int index)
        {
            index = -1;
            var min = int.MaxValue;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (min > A[i])
                {
                    min = A[i];
                    index = i;
                }
            return min;
        }

        /// <summary>
        /// Finds the minimum value in the given 1D double array and returns its index along with it.
        /// </summary>
        /// <param name="A">The array to be searched for</param>
        /// <param name="index">The index.</param>
        /// <returns>the maximum value</returns>
        public static int Max(this IList<int> A, out int index)
        {
            index = -1;
            var max = int.MinValue;
            var numElts = A.Count;
            for (var i = 0; i < numElts; i++)
                if (max < A[i])
                {
                    max = A[i];
                    index = i;
                }
            return max;
        }

        #endregion

        #region Find where a particular value is in a vector or matrix.

        /// <summary>
        /// Finds all the indices for the specified find value.
        /// </summary>
        /// <param name="A">The A.</param>
        /// <param name="FindVal">The find value.</param>
        /// <returns>IList<System.Int32>.</returns>
        public static IList<int> find(this IList<double> A, double FindVal)
        {
            return find(FindVal, A);
        }

        /// <summary>
        /// Finds all the indices for the specified find value.
        /// </summary>
        /// <param name="FindVal">The find value.</param>
        /// <param name="A">The A.</param>
        /// <returns>IList<System.Int32>.</returns>
        public static IList<int> find(double FindVal, IList<double> A)
        {
            return A.Select((value, index) => new { Item = value, Position = index })
                .Where(x => x.Item == FindVal).Select(a => a.Position).ToList();
        }

        /// <summary>
        /// Finds all the indices for the specified find value.
        /// </summary>
        /// <param name="A">The A.</param>
        /// <param name="FindVal">The find value.</param>
        /// <returns>IList<System.Int32>.</returns>
        public static IList<int> find(this IList<int> A, int FindVal)
        {
            return find(FindVal, A);
        }

        /// <summary>
        /// Finds all the indices for the specified find value.
        /// </summary>
        /// <param name="FindVal">The find value.</param>
        /// <param name="A">The A.</param>
        /// <returns>IList<System.Int32>.</returns>
        public static IList<int> find(int FindVal, IList<int> A)
        {
            return A.Select((value, index) => new { Item = value, Position = index })
                .Where(x => x.Item == FindVal).Select(a => a.Position).ToList();
        }

        /// <summary>
        /// Finds the [rowIndex, colIndex] for the specified find value.
        /// </summary>
        /// <param name="A">The A.</param>
        /// <param name="FindVal">The find value.</param>
        /// <returns>System.Int32[].</returns>
        public static int[] find(this double[,] A, double FindVal)
        {
            return find(FindVal, A);
        }

        /// <summary>
        /// Finds the [rowIndex, colIndex] for the specified find value.
        /// </summary>
        /// <param name="FindVal">The find value.</param>
        /// <param name="A">The A.</param>
        /// <returns>System.Int32[].</returns>
        public static int[] find(double FindVal, double[,] A)
        {
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (FindVal == A[i, j])
                        return new[] { i, j };
            return null;
        }

        /// <summary>
        /// Finds the [rowIndex, colIndex] for the specified find value.
        /// </summary>
        /// <param name="A">The A.</param>
        /// <param name="FindVal">The find value.</param>
        /// <returns>System.Int32[].</returns>
        public static int[] find(this int[,] A, int FindVal)
        {
            return find(FindVal, A);
        }

        /// <summary>
        /// Finds the [rowIndex, colIndex] for the specified find value.
        /// </summary>
        /// <param name="FindVal">The find value.</param>
        /// <param name="A">The A.</param>
        /// <returns>System.Int32[].</returns>
        public static int[] find(int FindVal, int[,] A)
        {
            var numRows = A.GetLength(0);
            var numCols = A.GetLength(1);
            for (var i = 0; i < numRows; i++)
                for (var j = 0; j < numCols; j++)
                    if (FindVal == A[i, j])
                        return new[] { i, j };
            return null;
        }

        #endregion
    }
}


text:
package tests;
import junit.framework.*;

public class SmppsimTests extends TestCase {

    public static Test suite() {
        TestSuite suite = new TestSuite(SmppsimBindTests.class);
        suite.addTestSuite(SmppsimSubmitSmTests.class);
        suite.addTestSuite(SmppsimDeliverSmTests.class);
        suite.addTestSuite(SmppsimEnquireLinkTests.class);
        suite.addTestSuite(SmppsimQuerySmTests.class);
        suite.addTestSuite(SmppsimCancelSmTests.class);
        suite.addTestSuite(SmppsimReplaceSmTests.class);
        suite.addTestSuite(SmppsimSubmitMultiTests.class);
        return suite;
    }

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }
}


text:
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <qstringlist.h>
#include <qstring.h>
#include <dcopobject.h>
#include <dcopclient.h>
#include <kapplication.h>
#include <klocale.h>

#include "artsclient.h"

#include <config.h>
#include <lineak/lconfig.h>
#include <lineak/lkbd.h>
#include <lineak/lkey.h>
#include <lineak/plugin_definitions.h>
#ifdef HAVE_XOSD
#include <lineak/xosdctrl.h>
#endif

#include <iostream>
#include <sstream>
#include <stdlib.h>
using namespace std;

#include "kdemiscplugin.h"

/** These are required */
#define NUM_MACROS 2
string misc_symbols[NUM_MACROS] = { "ARTS_SUSPEND","ADHOC_DCOP" };
macro_info* misc_macinfo = NULL;
bool verbose = false;
bool enable;
xosdCtrl* misc_Xosd = NULL;
ARTSClient *arts = NULL;
DCOPClient* misc_dcop;

extern "C" int initialize(init_info init) {
        verbose = init.verbose;
	enable = init.global_enable;
	misc_dcop = new DCOPClient();
	if (!(misc_dcop->registerAs( "misclineakdcop" )))
            if (verbose) cerr << "Could not register" << endl;
	if (!misc_dcop->attach()) {
            if (verbose) cerr << "Could not attach misc_dcop to dcop server" << endl;
        } else
            if (verbose) cout << "Registered" << endl;

	return true;
}
extern "C" const char* identifier() {
	const char* pluginname = "kdemiscplugin";
	return pluginname;
}

extern "C" int exec(LKey* imyKey) {
	LCommand command = imyKey->getCommand();
	string dname = imyKey->getDisplayName();
	/* Give verbose output about the command and display name */
	if (verbose) {
		cout << "----------------------------------------" << endl;
		//cout << "For keycode: " << keycode << endl;
		cout << " Key: " << endl << *(imyKey) << endl;
	  	cout << "	XOSD Display: " << dname << endl;
		cout << "	Command: " << command << endl;
		cout << "----------------------------------------" << endl;
	}
        //cout << "enable = " << enable << endl;
        //cout << "Executing " << imyKey->getCommand() << endl;
        if (command.getMacroType() == "ARTS_SUSPEND") { /* Suspend ARTS */
                if (arts == NULL)
                        arts = new ARTSClient();
                macroARTS_SUSPEND(command);
        } else if (command.getMacroType() == "ADHOC_DCOP") { /* Process a DCOP query, adhoc, with dcop */
                macroADHOC_DCOP(command);
/*        } else if (command.getMacroType() == "ARTS_VOLDOWN") {
                if (arts == NULL)
                        arts = new ARTSClient();
                macroARTS_VOLDOWN(command);
        } else if (command.getMacroType() == "ARTS_MUTE") {
                if (arts == NULL)
                        arts = new ARTSClient();
                macroARTS_MUTE(command); */
        } else if (command.isMacro())  /** If we are a macro, but we can't find one that matches, return false. */
                return false;

	if (imyKey->isUsedAsToggle())
		imyKey->toggleKeyState();

        return true;
}
extern "C" macro_info* macrolist() {
	misc_macinfo = new (macro_info);
	misc_macinfo->num_macros = NUM_MACROS;
	misc_macinfo->macro_list = misc_symbols;
        return misc_macinfo;
}
extern "C" void cleanup() {
        if (verbose) cout << "Cleaning up plugin kde_misc" << endl;
	if (misc_macinfo != NULL) {
		delete (misc_macinfo);
		misc_macinfo = NULL;
	}
 	if (misc_dcop != NULL) {
		misc_dcop->detach();
 		delete(misc_dcop);
 		misc_dcop = NULL;
 	}
        if (arts != NULL) {
                delete(arts);
		arts = NULL;
	}
	if (verbose) cout << "Done cleaning up plugin kde_misc" << endl;
}
#ifdef HAVE_XOSD
extern "C" void initialize_xosd(xosdCtrl *imyXosd) {
        if (verbose) cout << "Initializing xosd!" << endl;
        misc_Xosd = imyXosd;
}
#endif

bool macroADHOC_DCOP(LCommand& command) {
   if (enable) {
	QString comm = (command.getCommand()).c_str();
	command.setSeparator(" ");
	const vector<std::string>& args = command.getArgs();

	if (args.size() < 3)
		return false;

	// The application
	QCString app = (args[0]).c_str();
	// The interface
	QCString objid = (args[1]).c_str();
	// The dcop command.
	QCString function = (args[2]).c_str();
	// The rest of the arguments.
	QCStringList params;
	for (unsigned int i = 3; i != (args.size()-1); i++)
		params.append( (args[i]).c_str());

	if (!misc_dcop->isApplicationRegistered(app)) {
		if (KApplication::startServiceByDesktopName(app)) {
			cout << i18n(QString("No running instance of %1 found.").arg(app));
			return false;
		}
	}
	QByteArray data, replyData;
	QCString replyType;
	QDataStream arg( data, IO_WriteOnly );
	//arg << arg0; //to
	/*  bool call(const QCString &remApp, const QCString &remObj,
			const QCString &remFun, const QByteArray &data,
			QCString& replyType, QByteArray &replyData,
			bool useEventLoop=false);
	*/
	if (verbose) cout << "Executing dcop->send(" << app << "," << objid << "," << function << "," << data << ")" << endl;
	if (!misc_dcop->send(app, objid, function, data ) )
	   if (verbose) cerr << "dcop call " << app << " " << objid << " " << function << " " << data << " failed." << endl;
        return true;
   }
   return false;
}

void macroARTS_SUSPEND(LCommand& command) {
   if (enable) {
        #ifdef HAVE_XOSD
        if (misc_Xosd != NULL)
                misc_Xosd->show(string("Suspending ARTS Sound System."));
        #endif
        ARTSClient arts;
        arts.suspend();
   }
}

/*
void macroARTS_VOLUP(LCommand& command) {
   if (enable) {
        float ret = 0;
        const vector<std::string>& args = command.getArgs();
        if (args.size() == 0) {
                ret = arts->volumeUp();
        } else {
                float value = atol(args[0].c_str());
                ret = arts->volumeUp(fabsf(value));
        }
        #ifdef HAVE_XOSD
        if (misc_Xosd != NULL) {
                //float maxaudio = misc_Xosd->getMaxAudio();
                //misc_Xosd->setMaxAudio(100);
                //misc_Xosd->volume(ret);
                //misc_Xosd->setMaxAudio(maxaudio);
		int sign;
		int dp;
		string s = "Volume ";
		string ss= string(fcvt(ret,3,&dp,&sign));
		if (sign == 0)
                   s+="+";
                else
                   s+="-";
		if (dp >= 0) {
		   string rm = ss.substr(ss.size()-3,3);
		   string dec = ss.substr(0,ss.size()-3);
		   if (dec == "") dec = "0";
		   s+=dec;
		   s+='.';
		   s+=rm;
		} else {
		  s+= "0.";
		  s+= ss;
		}
		misc_Xosd->show(s);
        }
        #endif
   }
}
void macroARTS_VOLDOWN(LCommand& command) {
   if (enable) {
        const vector<std::string>& args = command.getArgs();
        float ret = 0;
        if (args.size() == 0) {
                ret = arts->volumeDown();
        } else {
                float value = atol(args[0].c_str());
                ret = arts->volumeDown(fabsf(value));
        }
        #ifdef HAVE_XOSD
        if (myXosd != NULL) {
                // float maxaudio = myXosd->getMaxAudio();
                //myXosd->setMaxAudio(10);
                //myXosd->volume(ret);
                //myXosd->setMaxAudio(maxaudio);
		int sign;
		int dp;
		string s = "Volume ";
		string ss = string(fcvt(ret,3,&dp,&sign));
	        if (sign == 0)
			s+="+";
		else
			s+="-";
		cout << "Getting there\n";
		if (dp >= 0) {
                   string rm = ss.substr(ss.size()-3,3);
	           string dec = ss.substr(0,ss.size()-3);
		   cout << "Almost" << endl;
		   if (dec == "") dec = "0";
	           s+=dec;
                   s+='.';
                   s+=rm;
		} else {
		   s+= "0.";
		   s+= ss;
		}
		myXosd->show(s);
        }
        #endif
   }
}
void macroARTS_MUTE(LCommand& command) {
   if (enable) {
         const vector<std::string>& args = command.getArgs();
         float ret = 0;
        if (args.size() == 0) {
                ret = arts->mute();
        } else {
                float vol = atol(args[0].c_str());
                ret = arts->mute(fabsf(vol));
        }
         #ifdef HAVE_XOSD
        if (myXosd != NULL) {
                if (ret == xosdCtrl::MUTE)
                        myXosd->volume(xosdCtrl::MUTE);
		else
			myXosd->volume(ret);

        }
         #endif
   }
}
*/


text:
<?php

use yii\helpers\Html;

use app\models\general\GeneralLabel;

/* @var $this yii\web\View */
/* @var $model app\models\FarmasiPermohonanLiputanPerubatanSukan */

$this->title = GeneralLabel::createTitle . ' ' . GeneralLabel::permohonan_liputan_perubatan_sukan;
$this->params['breadcrumbs'][] = ['label' => GeneralLabel::permohonan_liputan_perubatan_sukan, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?= $this->render('_form', [
        'model' => $model,
        'readonly' => $readonly,
    ]) ?>


text:
<?php

/**
 * This file provides a class for making authentication
 * with the AptomaApp API a breeze:
 *
 * To use it, create a new object representing your app:
 * $app = new AptomaApp('my-app', 'superfish', 'http://myhost.com:80');
 *
 * Now, to check that incoming token from DrPublish is valid
 * (which you should check!), do:
 * $dpdata = $app->validate($_GET['auth'], $_GET['iv']);
 *
 * If $dpdata === false, then the validation failed
 * Otherwise, $dpdata is an object containing information
 * about the DrPublish session (@see AptomaApp.validate)
 *
 * Now, to get the token to return to DrPublish to authenticate, do:
 * $token = $app->getAuthenticationToken();
 *
 * $token will now contain two indices, 'signature' and 'iv'.
 * Both have to be sent to DrPublish for successful authentication!
 *
 * If you think you have found a bug, please report it on
 * the issue tracker here:
 * https://github.com/aptoma/no.aptoma.app-api
 */

/**
 * ======================================================
 *   YOU SHOULD NOT NEED TO TOUCH ANYTHING BELOW HERE!
 * ======================================================
 */

class AptomaApp {

    protected $_name;
    protected $_key;

    /**
     * @param string $name The app's name as defined in DrPublish
     * @param string $key The API key for this app, default is DrPublish
     * @param URL $host The scheme, host and port of the app.
     *      Note that this must be in accordance with the URL given
     *      in the DrPublish setup
     *      The default is the  URL of the current page
     *      Format: scheme://host:port
     */
    public function __construct($name, $key, $host = '') {
        $this->_name = $name;

        $urlParts = parse_url($host);

        if(!$urlParts || empty($urlParts['scheme']) || empty($urlParts['host'])) {
            $urlParts = array (
                'scheme' => 'http' .(empty($_SERVER['HTTPS']) ? '' : 's'),
                'host' => $_SERVER["SERVER_NAME"],
                'port' => $_SERVER["SERVER_PORT"]
            );
        }

        $this->_key = $key . $urlParts['scheme'] . '://' . $urlParts['host'] . ':' .(empty($urlParts['port']) ? '80' : $urlParts['port']);
    }

    /**
     * Checks the DrPublish authentication token and
     * returns false on failure, and an object containing the following
     * on success:
     *  drpublish: URL to DrPublish installation
     *  time: When the signature was created
     *  app: Name of the app
     *  user: The username of the current user
     *  publication: The currently active publication ID
     *
     * All three of these parameters are normally added to the query
     * string of the iframe the app is loaded with, and should
     * thus be available in $_GET
     *
     * @param string $appName Name of the app
     * @param string $auth The authentication token received from DrPublish
     * @param string $iv The IV received from DrPublish
     */
    public function validate($auth, $iv) {
        if(!$auth || !$iv) {
            return false;
        }

        // fix the conversion between + and ' ' that happens when passing stuff through an url
        $auth = str_replace(' ', '+', $auth);
        $incoming = $this->_decryptAppData( base64_decode($auth), $iv);

        if(is_null($incoming)) {
            return false;
        }

        // Make sure we're not being replayed
        if(!property_exists($incoming, 'time') || time() - $incoming->time > 60) {
            return false;
        }

        // Make sure the auth is for the correct app
        if(!property_exists($incoming, 'app') || $incoming->app !== $this->_name) {
            return false;
        }

        // No need to expose the salt to the end user
        unset($incoming->salt);

        return $incoming;
    }

    /**
     * Creates an encrypted token with various information
     * about the app to be sent to the DrPublish API
     *
     * Returns an object containing two indexes that both
     * have to be sent to authenticate:
     *  signature: An encrypted string
     *  iv: An IV for the signature
     */
    function getAuthenticationToken() {
        $outgoing = $this->_encryptAppData (
            array (
                'app' => $this->_name,
                'time' => time(),
                'salt' => self::_getSalt(128)
            )
        );

        return array (
            'signature' => base64_encode($outgoing['data']),
            'iv' => $outgoing['iv']
        );
    }

    /**
     * Decrypts the given data block using the given key and IV
     * Expects the result to be a valid JSON block
     */
    protected function _decryptAppData($data, $iv) {
        /**
         * Servers that do not have mcrypt installed will get a dummy object
         * Avoid this at all costs!
         * Note especially that the path to DrPublish is then unknown, making all
         * non-AFW modules break.
         * cross-check in DrPublishController
         */
        if (!function_exists('mcrypt_module_open')) {
            return (object) array(
                'iv' => 'trust',
                'data' => 'always',
                'time' => time(),
                'app' => $this->_name,
                'drpublish' => ''
            );
        }
        /* Open the cipher */
        $td = mcrypt_module_open('rijndael-128', '', 'cbc', '');

        /* Initialize encryption module for decryption */
        mcrypt_generic_init($td, self::_cutKey($td, $this->_key), $iv);

        /* Decrypt encrypted string */
        $decrypted = mdecrypt_generic($td, $data);

        /* Terminate decryption handle and close module */
        mcrypt_generic_deinit($td);
        mcrypt_module_close($td);

        return json_decode(trim($decrypted));
    }

    /**
     * Encrypts a JSON representation of the given data
     * using the given key, and returns both the encrypted
     * data and the used IV
     */
    protected function _encryptAppData($data) {
        /**
         * Servers that do not have mcrypt installed will get a dummy object
         * Avoid this at all costs!
         * Note especially that the path to DrPublish is then unknown, making all
         * non-AFW modules break.
         * cross-check in DrPublishController
         */
        if (!function_exists('mcrypt_module_open')) {
            return array(
                'iv' => 'trust',
                'data' => 'always'
            );
        }

        /* Open the cipher */
        $td = mcrypt_module_open('rijndael-128', '', 'cbc', '');

        /* Create the IV and determine the keysize length   */
        $iv = substr(sha1(mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_DEV_URANDOM)), 0, mcrypt_enc_get_iv_size($td));

        /* Intialize encryption */
        mcrypt_generic_init($td, self::_cutKey($td, $this->_key), $iv);

        /* Encrypt data */
        $encrypted = mcrypt_generic($td, json_encode($data));

        /* Terminate encryption handler */
        mcrypt_generic_deinit($td);
        mcrypt_module_close($td);

        return array('iv' => $iv, 'data' => $encrypted);
    }

    /**
     * Makes the a key a certain length
     */
    protected static function _cutKey($td, $key) {
        return substr(sha1($key), 0, mcrypt_enc_get_key_size($td));
    }

    /**
     * Generates a random salt of the given size
     */
    protected static function _getSalt($saltSize) {
        $salt = "";
        while(@$c++ * 16 < $saltSize) {
            @$salt .= sha1( mt_rand(), false);
        }
        return substr( $salt, 0, $saltSize);
    }
}


text:
<?php
//======================================================================================================================
// This file is part of the Mudpuppy PHP framework, released under the MIT License. See LICENSE for full details.
//======================================================================================================================
defined('MUDPUPPY') or die('Restricted');
use Mudpuppy\Config;

?>
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title><?php print Config::$appTitle; ?> | Install</title>
	<link rel="stylesheet" href="/mudpuppy/content/bootstrap/css/bootstrap.min.css"/>
	<link rel="stylesheet" href="/mudpuppy/content/bootstrap/css/bootstrap-theme.min.css"/>
	<link rel="stylesheet" href="/mudpuppy/content/css/styles.css"/>

	<?php print Config::$appTitle; ?> | Install

<form id="installSettings" role="form">

		<legend>Application</legend>

			Title
			<input type="text" class="form-control" id="appTitle" name="appTitle" value="Mudpuppy Sample"/>

			Class Name
			<input type="text" class="form-control" id="appClass" name="appClass" value="SampleApp"/>

		<legend>Database</legend>

				<input id="dbEnabled" name="dbEnabled" type="checkbox" checked/> This application has a
					database

			Host
			<input type="text" class="form-control dbField" id="dbHost" name="dbHost" value="localhost"/>

			Port
			<input type="text" class="form-control dbField" id="dbPort" name="dbPort" value="3306"/>

			Database Name
			<input type="text" class="form-control dbField" id="dbDatabase" name="dbDatabase" value="MudpuppySample"/>

			Username
			<input type="text" class="form-control dbField" id="dbUser" name="dbUser" value="root"/>

			Password
			<input type="password" class="form-control dbField" id="dbPass" name="dbPass" value=""/>

		<legend>Logging</legend>

			<select id="logLevel" name="logLevel" class="form-control">
				<option value="3" selected>Always write logs</option>
				<option value="2">Only write logs when an error occurs</option>
				<option value="1">Never write logs</option>
			</select>

				<input id="logQueries" name="logQueries" type="checkbox" class="dbField" checked/> Log
					queries

				<input id="logToDatabase" name="logToDatabase" type="checkbox" class="dbField" checked/> Write to
					database

				<input id="logToDir" name="logToDir" type="checkbox"/> Write to directory:

			<input type="text" class="form-control" id="logFileDir" name="logFileDir" value="" disabled/>

		<legend>Admin</legend>

				<input id="adminBasicAuth" name="adminBasicAuth" type="checkbox" checked/> Protect admin area with
					HTTP Basic Authentication

			Username
			<input type="text" class="form-control" id="adminUser" name="adminUser" value="admin"/>

			Password
			<input type="password" class="form-control" id="adminPass" name="adminPass" value=""/>

			<button id="install" class="btn btn-primary pull-right">Install</button>

</form>


text:
FROM unicon/grouper-demo:2.3.0

MAINTAINER jgasper@unicon.net

ADD libs/ /opt/apache-tomcat-6.0.44/webapps/grouper/WEB-INF/lib/
ADD classes/ /opt/apache-tomcat-6.0.44/webapps/grouper/WEB-INF/classes/
ADD /testCaseSetup.gsh /
COPY run-grouper.sh /opt/container-scripts

RUN set -x; \
    service mysql start \
    && service slapd start \
    && cd /opt/grouper.apiBinary-2.3.0/ \
    && bin/gsh /testCaseSetup.gsh \
    && chmod -R +x /opt/container-scripts/

EXPOSE 389 3306 8080 5005

ENV DEBUGGER_ENABLED=true

CMD ["run-grouper.sh"]


text:
'use strict';

var d3 = require('d3-queue');
var path = require('path');
var mkdirp = require('mkdirp');
var rimraf = require('rimraf');
var OSM = require('../lib/osm');
var OSRMLoader = require('../lib/osrm_loader');

module.exports = function () {
    this.registerHandler('BeforeFeatures', {timeout: 30000},  (features, callback) => {
        this.osrmLoader = new OSRMLoader(this);
        this.OSMDB = new OSM.DB();

        let queue = d3.queue(1);
        queue.defer(this.initializeEnv.bind(this));
        queue.defer(this.verifyOSRMIsNotRunning.bind(this));
        queue.defer(this.verifyExistenceOfBinaries.bind(this));
        queue.defer(this.initializeCache.bind(this));
        queue.defer(this.setupFeatures.bind(this, features));
        queue.awaitAll(callback);
    });

    this.BeforeFeature((feature, callback) => {
        this.profile = this.OSRM_PROFILE || this.DEFAULT_PROFILE;
        this.profileFile = path.join(this.PROFILES_PATH, this.profile + '.lua');
        this.setupFeatureCache(feature);
        callback();
    });

    this.Before((scenario, callback) => {
        this.osrmLoader.setLoadMethod(this.DEFAULT_LOAD_METHOD);
        this.setGridSize(this.DEFAULT_GRID_SIZE);
        this.setOrigin(this.DEFAULT_ORIGIN);
        this.queryParams = {};
        this.extractArgs = '';
        this.contractArgs = '';
        this.partitionArgs = '';
        this.customizeArgs = '';
        this.environment = Object.assign(this.DEFAULT_ENVIRONMENT);
        this.resetOSM();

        this.scenarioID = this.getScenarioID(scenario);
        this.setupScenarioCache(this.scenarioID);

        // setup output logging
        let logDir = path.join(this.LOGS_PATH, this.featureID);
        this.scenarioLogFile = path.join(logDir, this.scenarioID) + '.log';
        d3.queue(1)
            .defer(mkdirp, logDir)
            .defer(rimraf, this.scenarioLogFile)
            .awaitAll(callback);
    });

    this.After((scenario, callback) => {
        this.resetOptionsOutput();
        callback();
    });

    this.AfterFeatures((features, callback) => {
        callback();
    });
};


text:
NS_ASSUME_NONNULL_BEGIN
@class MDTabBarViewController;

@protocol MDTabBarViewControllerDelegate <NSObject>

- (UIViewController *)tabBarViewController:
                          (MDTabBarViewController *)viewController
                     viewControllerAtIndex:(NSUInteger)index;

@optional
- (void)tabBarViewController:(MDTabBarViewController *)viewController
              didMoveToIndex:(NSUInteger)index;
@end

@interface MDTabBarViewController : UIViewController

@property(nonatomic, readonly) MDTabBar *tabBar;
@property(nonatomic, weak) id<MDTabBarViewControllerDelegate> delegate;
@property(nonatomic) NSUInteger selectedIndex;

- (instancetype)initWithDelegate:(id<MDTabBarViewControllerDelegate>)delegate;
- (void)setItems:(NSArray<id> *)items;

@end
NS_ASSUME_NONNULL_END


text:
<?xml version="1.0" encoding="utf-8"?>
<DexEntry>
  <General>
    <Name>Raikou</Name>
    <SpeciesName>Thunder</SpeciesName>
    <GrowthGroup>Slow</GrowthGroup>
    <EggGroup1>Undiscovered</EggGroup1>
    <EggGroup2>Undiscovered</EggGroup2>
  </General>
</DexEntry>


text:
/* eslint jsdoc/require-jsdoc: off */
'use strict'

interface SdPathPartProp {
  type: 'property'
  path: string
}

interface SdPathPartIndex {
  type: 'index'
  index: number
}

type SdPathPart = SdPathPartProp | SdPathPartIndex

export class SdUtils {
  private static _parsePath(path: string): SdPathPart[] {
    if (!path) {
      return []
    }

    let identifier = ''
    const parts: SdPathPart[] = []

    for (let i = 0; i < path.length; ++i) {
      if (path[i] === '[') {
        // Starting an array, use the previous bit as a property
        if (identifier) {
          parts.push({ type: 'property', path: identifier })
          identifier = ''
        }
      } else if (path[i] === ']') {
        // array path of identifier;
        parts.push({ type: 'index', index: parseInt(identifier) })
        identifier = ''
        // skip the `.` that follows, if there is one
        ++i
      } else if (path[i] === '.') {
        parts.push({ type: 'property', path: identifier })
        identifier = ''
      } else {
        identifier += path[i]
      }
    }

    if (identifier) {
      parts.push({ type: 'property', path: identifier })
    }

    return parts
  }

  private static _insertByPath(
    root: any,
    parts: SdPathPart[],
    value: any
  ): any {
    if (parts.length === 0) {
      return value
    }

    const firstPart = parts.shift() as SdPathPart
    if (firstPart.type === 'property') {
      if (!root) {
        root = {}
      }
      if (Array.isArray(root)) {
        throw new Error('expected object, found array')
      }

      root[firstPart.path] = this._insertByPath(
        root[firstPart.path],
        parts,
        value
      )
    } else if (firstPart.type === 'index') {
      if (!root) {
        root = []
      }
      if (!Array.isArray(root)) {
        throw new Error('expected array, found object')
      }

      root[firstPart.index] = this._insertByPath(
        root[firstPart.index],
        parts,
        value
      )
    } else {
      throw new Error('encountered unexpected path type')
    }

    return root
  }

  static insertByPath(root: any, path: string, value: any): any {
    const parts = this._parsePath(path)
    return this._insertByPath(root, parts, value)
  }

  private static _getByPath(value: any, parts: SdPathPart[]): any {
    if (parts.length === 0) {
      return value
    }

    const firstPart = parts.shift() as SdPathPart
    if (firstPart.type === 'property') {
      if (!value) {
        return undefined
      }
      if (Array.isArray(value)) {
        throw new Error('expected object, found array')
      }

      return this._getByPath(value[firstPart.path], parts)
    } else if (firstPart.type === 'index') {
      if (!value) {
        return undefined
      }
      if (!Array.isArray(value)) {
        throw new Error('expected array, found object')
      }

      return this._getByPath(value[firstPart.index], parts)
    } else {
      throw new Error('encountered unexpected path type')
    }
  }

  static getByPath(value: any, path: string): any {
    const parts = this._parsePath(path)
    return this._getByPath(value, parts)
  }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">

    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <title>login</title>

<form action="" method="post" role="form">
    <lengend>会员登录</lengend>

        账号
        <input type="text" class="form-control" name="" id="uesername" placeholder="账号">

        密码
        <input type="text" class="form-control" name="" id="password" placeholder="密码">

        验证码
        <input type="text" class="form-control" name="" id="code" placeholder="验证码">

    <button type="submit" class="btn btn-primary">Submit</button>
</form>


text:
namespace Bmz.Framework.Notifications
{
    /// <summary>
    /// Used as a context while defining notifications.
    /// </summary>
    public interface INotificationDefinitionContext
    {
        /// <summary>
        /// Gets the notification definition manager.
        /// </summary>
        INotificationDefinitionManager Manager { get; }
    }
}