text:
import { Observable } from 'rxjs/Observable';
export interface DeeplinkMatch {
    /**
     * The route info for the matched route
     */
    $route: any;
    /**
     * Any arguments passed either through route parameters or GET parameters
     */
    $args: any;
    /**
     * The deeplink object processed from the plugin, along with any
     * any internal native data available as "extras" at the time
     * the route was matched (for example, Facebook sometimes adds extra data)
     */
    $link: any;
}
/**
 * @name Ionic Deeplinks
 * @description This plugin handles deeplinks on iOS and Android for both custom URL scheme links
 * and Universal App Links.
 *
 * @usage
 * ```typescript
 * import { Deeplinks } from 'ionic-native';
 *
 * Deeplinks.route({
      '/about-us': AboutPage,
      '/universal-links-test': AboutPage,
      '/products/:productId': ProductPage
    }).subscribe((match) => {
      // match.$route - the route we matched, which is the matched entry from the arguments to route()
      // match.$args - the args passed in the link
      // match.$link - the full link data
      console.log('Successfully matched route', match);
    }, (nomatch) => {
      // nomatch.$link - the full link data
      console.error('Got a deeplink that didn\'t match', nomatch);
    });
 * ```
 *
 * Alternatively, if you're using Ionic 2, there's a convenience method that takes a reference to a `NavController` and handles
 * the actual navigation for you:
 *
 * ```typescript
 * Deeplinks.routeWithNavController(this.navController, {
    '/about-us': AboutPage,
    '/products/:productId': ProductPage
  }).subscribe((match) => {
      // match.$route - the route we matched, which is the matched entry from the arguments to route()
      // match.$args - the args passed in the link
      // match.$link - the full link data
      console.log('Successfully matched route', match);
    }, (nomatch) => {
      // nomatch.$link - the full link data
      console.error('Got a deeplink that didn\'t match', nomatch);
    });
 * ```
 *
 * See the [Ionic 2 Deeplinks Demo](https://github.com/driftyco/ionic2-deeplinks-demo/blob/master/app/app.ts) for an example of how to
 * retrieve the `NavController` reference at runtime.
 *
 * @interfaces
 * DeeplinkMatch
 */
export declare class Deeplinks {
    /**
     * Define a set of paths to match against incoming deeplinks.
     *
     * @param {paths} Define a set of paths to match against incoming deeplinks.
     * paths takes an object of the form { 'path': data }. If a deeplink
     * matches the path, the resulting path-data pair will be returned in the
     * promise result which you can then use to navigate in the app as you see fit.
     * @returns {Observable<DeeplinkMatch>} Returns an Observable that is called each time a deeplink comes through, and
     * errors if a deeplink comes through that does not match a given path.
     */
    static route(paths: any): Observable<DeeplinkMatch>;
    /**
     *
     * This is a convenience version of `route` that takes a reference to a NavController
     * from Ionic 2, or a custom class that conforms to this protocol:
     *
     * NavController.push = function(View, Params){}
     *
     * This handler will automatically navigate when a route matches. If you need finer-grained
     * control over the behavior of a matching deeplink, use the plain `route` method.
     *
     * @param {paths} Define a set of paths to match against incoming deeplinks.
     * paths takes an object of the form { 'path': data }. If a deeplink
     * matches the path, the resulting path-data pair will be returned in the
     * promise result which you can then use to navigate in the app as you see fit.
     *
     * @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
     * errors if a deeplink comes through that does not match a given path.
     */
    static routeWithNavController(navController: any, paths: any): Observable<DeeplinkMatch>;
}


text:
from __future__ import unicode_literals

import os

from mopidy import config, ext

__version__ = '1.0.4'

class MusicBoxExtension(ext.Extension):

    dist_name = 'Mopidy-MusicBox-Webclient'
    ext_name = 'musicbox_webclient'
    version = __version__

    def get_default_config(self):
        conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
        return config.read(conf_file)

    def get_config_schema(self):
        schema = super(MusicBoxExtension, self).get_config_schema()
        return schema

    def setup(self, registry):
        registry.add('http:static', {
            'name': self.ext_name,
            'path': os.path.join(os.path.dirname(__file__), 'static'),
        })

redpajama_set_name: RedPajamaGithub


text:
package com.fasterxml.jackson.databind.convert;

import java.util.Collections;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonCreator;

import com.fasterxml.jackson.core.type.TypeReference;

import com.fasterxml.jackson.databind.BaseMapTest;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.cfg.CoercionAction;
import com.fasterxml.jackson.databind.cfg.CoercionInputShape;
import org.junit.Assert;

// [databind#3418]: Coercion from empty String to Collection<String>, with
// `DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY`
public class EmptyStringAsSingleValueTest extends BaseMapTest
{
    static final class StringWrapper {
        private final String s;

        @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
        public StringWrapper(String s) {
            this.s = s;
        }

        @Override
        public String toString() {
            return "StringWrapper{" + s + "}";
        }

        @Override
        public boolean equals(Object obj) {
            return obj instanceof StringWrapper && ((StringWrapper) obj).s.equals(s);
        }

        @Override
        public int hashCode() {
            return s.hashCode();
        }
    }

    private final ObjectMapper NORMAL_MAPPER = jsonMapperBuilder()
            .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
            .build();

    private final ObjectMapper COERCION_MAPPER = jsonMapperBuilder()
            .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
        // same as XmlMapper
            .withCoercionConfigDefaults(h -> {
                h.setAcceptBlankAsEmpty(true)
                    .setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsEmpty);
            })
            .build();

    public void testEmptyToList() throws Exception {
        // NO coercion + empty string input + StringCollectionDeserializer
        assertEquals(Collections.singletonList(""),
                NORMAL_MAPPER.readValue("\"\"", new TypeReference<List<String>>() {}));
    }

    public void testEmptyToListWrapper() throws Exception {
        // NO coercion + empty string input + normal CollectionDeserializer
        assertEquals(Collections.singletonList(new StringWrapper("")),
                NORMAL_MAPPER.readValue("\"\"", new TypeReference<List<StringWrapper>>() {}));
    }

    public void testCoercedEmptyToList() throws Exception {
        // YES coercion + empty string input + StringCollectionDeserializer
        assertEquals(Collections.emptyList(), COERCION_MAPPER.readValue("\"\"",
                new TypeReference<List<String>>() {}));
    }

    public void testCoercedEmptyToListWrapper() throws Exception {
        // YES coercion + empty string input + normal CollectionDeserializer
        assertEquals(Collections.emptyList(),
                COERCION_MAPPER.readValue("\"\"", new TypeReference<List<StringWrapper>>() {}));
    }

    public void testCoercedListToList() throws Exception {
        // YES coercion + empty LIST input + StringCollectionDeserializer
        assertEquals(Collections.emptyList(),
                COERCION_MAPPER.readValue("[]", new TypeReference<List<String>>() {}));
    }

    public void testCoercedListToListWrapper() throws Exception {
        // YES coercion + empty LIST input + normal CollectionDeserializer
        assertEquals(Collections.emptyList(),
                COERCION_MAPPER.readValue("[]", new TypeReference<List<StringWrapper>>() {}));
    }

    public void testBlankToList() throws Exception {
        // NO coercion + empty string input + StringCollectionDeserializer
        assertEquals(Collections.singletonList(" "),
                NORMAL_MAPPER.readValue("\" \"", new TypeReference<List<String>>() {}));
    }

    public void testBlankToListWrapper() throws Exception {
        // NO coercion + empty string input + normal CollectionDeserializer
        assertEquals(Collections.singletonList(new StringWrapper(" ")),
                NORMAL_MAPPER.readValue("\" \"", new TypeReference<List<StringWrapper>>() {}));
    }

    public void testCoercedBlankToList() throws Exception {
        // YES coercion + empty string input + StringCollectionDeserializer
        assertEquals(Collections.emptyList(),
                COERCION_MAPPER.readValue("\" \"", new TypeReference<List<String>>() {}));
    }

    public void testCoercedBlankToListWrapper() throws Exception {
        // YES coercion + empty string input + normal CollectionDeserializer
        assertEquals(Collections.emptyList(),
                COERCION_MAPPER.readValue("\" \"", new TypeReference<List<StringWrapper>>() {}));
    }

    public void testEmptyToArray() throws Exception {
        // NO coercion + empty string input + StringCollectionDeserializer
        Assert.assertArrayEquals(new String[]{""},
                NORMAL_MAPPER.readValue("\"\"", new TypeReference<String[]>() {}));
    }

    public void testEmptyToArrayWrapper() throws Exception {
        // NO coercion + empty string input + normal CollectionDeserializer
        Assert.assertArrayEquals(new StringWrapper[]{new StringWrapper("")},
                NORMAL_MAPPER.readValue("\"\"", new TypeReference<StringWrapper[]>() {}));
    }

    public void testCoercedEmptyToArray() throws Exception {
        // YES coercion + empty string input + StringCollectionDeserializer
        Assert.assertArrayEquals(new String[0], COERCION_MAPPER.readValue("\"\"",
                new TypeReference<String[]>() {}));
    }

    public void testCoercedEmptyToArrayWrapper() throws Exception {
        // YES coercion + empty string input + normal CollectionDeserializer
        Assert.assertArrayEquals(new StringWrapper[0],
                COERCION_MAPPER.readValue("\"\"", new TypeReference<StringWrapper[]>() {}));
    }

    public void testCoercedListToArray() throws Exception {
        // YES coercion + empty LIST input + StringCollectionDeserializer
        Assert.assertArrayEquals(new String[0],
                COERCION_MAPPER.readValue("[]", new TypeReference<String[]>() {}));
    }

    public void testCoercedListToArrayWrapper() throws Exception {
        // YES coercion + empty LIST input + normal CollectionDeserializer
        Assert.assertArrayEquals(new StringWrapper[0],
                COERCION_MAPPER.readValue("[]", new TypeReference<StringWrapper[]>() {}));
    }

    public void testBlankToArray() throws Exception {
        // NO coercion + empty string input + StringCollectionDeserializer
        Assert.assertArrayEquals(new String[]{" "},
                NORMAL_MAPPER.readValue("\" \"", new TypeReference<String[]>() {}));
    }

    public void testBlankToArrayWrapper() throws Exception {
        // NO coercion + empty string input + normal CollectionDeserializer
        Assert.assertArrayEquals(new StringWrapper[]{new StringWrapper(" ")},
                NORMAL_MAPPER.readValue("\" \"", new TypeReference<StringWrapper[]>() {}));
    }

    public void testCoercedBlankToArray() throws Exception {
        // YES coercion + empty string input + StringCollectionDeserializer
        Assert.assertArrayEquals(new String[0],
                COERCION_MAPPER.readValue("\" \"", new TypeReference<String[]>() {}));
    }

    public void testCoercedBlankToArrayWrapper() throws Exception {
        // YES coercion + empty string input + normal CollectionDeserializer
        Assert.assertArrayEquals(new StringWrapper[0],
                COERCION_MAPPER.readValue("\" \"", new TypeReference<StringWrapper[]>() {}));
    }
}


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.securitydevops.models;

import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.securitydevops.fluent.models.GitHubRepoInner;

/** An immutable client-side representation of GitHubRepo. */
public interface GitHubRepo {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the properties property: GitHub Repo properties.
     *
     * @return the properties value.
     */
    GitHubRepoProperties properties();

    /**
     * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the name of the resource group.
     *
     * @return the name of the resource group.
     */
    String resourceGroupName();

    /**
     * Gets the inner com.azure.resourcemanager.securitydevops.fluent.models.GitHubRepoInner object.
     *
     * @return the inner object.
     */
    GitHubRepoInner innerModel();

    /** The entirety of the GitHubRepo definition. */
    interface Definition
        extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
    }
    /** The GitHubRepo definition stages. */
    interface DefinitionStages {
        /** The first stage of the GitHubRepo definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the GitHubRepo definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, gitHubConnectorName, gitHubOwnerName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @param gitHubConnectorName Name of the GitHub Connector.
             * @param gitHubOwnerName Name of the GitHub Owner.
             * @return the next definition stage.
             */
            WithCreate withExistingOwner(String resourceGroupName, String gitHubConnectorName, String gitHubOwnerName);
        }
        /**
         * The stage of the GitHubRepo definition which contains all the minimum required properties for the resource to
         * be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate extends DefinitionStages.WithProperties {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            GitHubRepo create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            GitHubRepo create(Context context);
        }
        /** The stage of the GitHubRepo definition allowing to specify properties. */
        interface WithProperties {
            /**
             * Specifies the properties property: GitHub Repo properties..
             *
             * @param properties GitHub Repo properties.
             * @return the next definition stage.
             */
            WithCreate withProperties(GitHubRepoProperties properties);
        }
    }
    /**
     * Begins update for the GitHubRepo resource.
     *
     * @return the stage of resource update.
     */
    GitHubRepo.Update update();

    /** The template for GitHubRepo update. */
    interface Update extends UpdateStages.WithProperties {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        GitHubRepo apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        GitHubRepo apply(Context context);
    }
    /** The GitHubRepo update stages. */
    interface UpdateStages {
        /** The stage of the GitHubRepo update allowing to specify properties. */
        interface WithProperties {
            /**
             * Specifies the properties property: GitHub Repo properties..
             *
             * @param properties GitHub Repo properties.
             * @return the next definition stage.
             */
            Update withProperties(GitHubRepoProperties properties);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    GitHubRepo refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    GitHubRepo refresh(Context context);
}


text:
The `TextAnnotation` directive add an annotation to the PDF

.. raw:: pdf

    TextAnnotation "This is an annotation"


text:
<?php

namespace Mmoreram\GearmanBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * This is the class that validates and merges configuration from your
 * app/config files
 *
 * @since 2.3.1
 */
class Configuration implements ConfigurationInterface
{
    /**
     * Generates the configuration tree builder.
     *
     * @return TreeBuilder The tree builder
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('gearman');

        $rootNode
            ->children()
                ->arrayNode('bundles')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('name')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->scalarNode('active')
                                ->defaultFalse()
                            ->end()
                            ->arrayNode('include')
                                ->prototype('scalar')->end()
                            ->end()
                            ->arrayNode('ignore')
                                ->prototype('scalar')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('servers')
                    ->performNoDeepMerging()
                    ->defaultValue(array(
                        'localhost' =>  array(
                            'host'  =>  '127.0.0.1',
                            'port'  =>  "4730",
                        )
                    ))
                    ->prototype('array')
                        ->children()
                            ->scalarNode('host')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->scalarNode('port')
                                ->defaultValue("4730")
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('defaults')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('iterations')
                            ->defaultValue(0)
                        ->end()
                        ->scalarNode('method')
                            ->defaultValue('doNormal')
                        ->end()
                        ->scalarNode('callbacks')
                            ->defaultTrue()
                        ->end()
                        ->scalarNode('job_prefix')
                            ->defaultNull()
                        ->end()
                        ->scalarNode('generate_unique_key')
                            ->defaultTrue()
                        ->end()
                        ->scalarNode('workers_name_prepend_namespace')
                            ->defaultTrue()
                        ->end()
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
}


text:
package main

import (
	"bufio"
	"bytes"
	"compress/gzip"
	"flag"
	"os"
	"runtime"
	"strings"
	"sync"

	"github.com/Sirupsen/logrus"
	"github.com/fvbock/trie"
)

var entities = flag.String("entities", "",
	"Gzipped file containing list of entities")
var rdf = flag.String("rdf", "",
	"Gzipped RDF data file.")
var output = flag.String("output", "",
	"Gzipped output file.")
var numroutines = flag.Int("numr", 10,
	"Number of goroutines to use for data processing.")
var glog = logrus.WithField("pkg", "namefinder")

func getScanner(fname string) (*os.File, *bufio.Scanner) {
	f, err := os.Open(fname)
	if err != nil {
		glog.WithError(err).Fatal("Unable to open file")
	}

	r, err := gzip.NewReader(f)
	if err != nil {
		glog.WithError(err).Fatal("Unable to open file")
	}

	return f, bufio.NewScanner(r)
}

type SyncWriter struct {
	sync.RWMutex
	wr *gzip.Writer
}

func (sw *SyncWriter) Write(buf []byte) {
	sw.Lock()
	defer sw.Unlock()
	_, err := sw.wr.Write(buf)
	if err != nil {
		glog.WithError(err).Fatal("Unable to write to writer.")
	}
}

func findAndWrite(idx int, tr trie.Trie, ch chan string,
	sw *SyncWriter, wg *sync.WaitGroup) {

	mlog := glog.WithField("routine", idx)
	buf := new(bytes.Buffer)
	buf.Grow(50 << 20) // 50 MB

	count := 0
	for l := range ch {
		count += 1
		if count%10000 == 3 {
			mlog.WithField("count", count).Debug("Processed rows.")
		}

		left := strings.Index(l, "<")
		if left < 0 {
			continue
		}
		right := strings.Index(l[left:], ">")
		e := l[left : right+1]

		if tr.Has(e) {
			buf.WriteString(l)
			buf.WriteRune('\n')
			if buf.Len() > 40<<20 { // 40 MB
				mlog.WithField("bytes", buf.Len()).Debug("Wrote bytes.")
				sw.Write(buf.Bytes())
				buf.Reset()
				if buf.Len() != 0 {
					mlog.Fatal("Length should be zero.")
				}
			}
		}
	}
	if buf.Len() > 0 {
		sw.Write(buf.Bytes())
	}
	wg.Done()
}

func grep(tr *trie.Trie) {
	f, scanner := getScanner(*rdf)
	defer f.Close()

	out, err := os.Create(*output)
	if err != nil {
		glog.WithError(err).Fatal("Unable to open output file.")
	}
	wr, err := gzip.NewWriterLevel(out, gzip.BestCompression)
	if err != nil {
		glog.WithError(err).Fatal("Unable to create gzip writer.")
	}
	sw := new(SyncWriter)
	sw.wr = wr

	ch := make(chan string, 100<<20) // 100 Million
	wg := new(sync.WaitGroup)
	for i := 0; i < *numroutines; i++ {
		wg.Add(1)
		go findAndWrite(i, *tr, ch, sw, wg)
	}
	for scanner.Scan() {
		ch <- scanner.Text()
	}
	close(ch)
	wg.Wait()

	if err := wr.Close(); err != nil {
		glog.WithError(err).Fatal("Unable to close output writer.")
	}
	if err := out.Close(); err != nil {
		glog.WithError(err).Fatal("Unable to close output file.")
	}
}

func main() {
	flag.Parse()
	logrus.SetLevel(logrus.DebugLevel)
	glog.WithField("numcpus", runtime.NumCPU()).Info("Number of cpus found.")

	procs := runtime.GOMAXPROCS(runtime.NumCPU())
	glog.WithField("prev_procs", procs).Info("Previous setting.")

	f, scanner := getScanner(*entities)
	defer f.Close()

	tr := trie.NewTrie()
	count := 0
	for scanner.Scan() {
		tr.Add(scanner.Text())
		count += 1
	}
	glog.WithField("count", count).Debug("Entities read.")
	grep(tr)

	/*
		var mstats runtime.MemStats
		runtime.ReadMemStats(&mstats)
		fmt.Printf("Memory Stats: %+v\n\n", mstats)
	*/
}


text:
'''
    Copyright 2014-2016 PTIN

    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.
'''
from .database import db

class Port(db.Model):
    id = db.Column(db.Integer, primary_key=True, nullable=False)
    switch = db.Column(db.String(50))
    port = db.Column(db.Integer, nullable=False)

    updated = db.Column(db.TIMESTAMP,
                        server_default=db.text(
                            'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))

    created = db.Column(db.TIMESTAMP, default=db.func.now())

    __table_args__ = (
        db.UniqueConstraint('switch', 'port', name='_switch_port_uc'),
    )

    def __init__(self, switch, port):
        self.switch = switch
        self.port = port


text:
<?php
/**
 * Your Inspiration Themes
 *
 * @package    WordPress
 * @subpackage Your Inspiration Themes
 * @author     Your Inspiration Themes Team <info@yithemes.com>
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */

if ( class_exists( 'YIT_Portfolio' ) && !class_exists( 'YIT_Widget_Portfolio' ) ) {

    class YIT_Widget_Portfolio extends WP_Widget {
        /**
         * constructor
         *
         * @access public
         * @return void
         */
        function YIT_Widget_Portfolio() {

            /* Widget settings. */
            $widget_ops = array( 'classname' => 'yit_portfolio', 'description' => __( 'Display a list of random items of your portfolio.', 'yit' ) );

            /* Create the widget. */
            WP_Widget::__construct( 'yit-portfolio', 'YIT Portfolio', $widget_ops );
        }

        /**
         * widget function.
         *
         * @see    WP_Widget
         * @access public
         *
         * @param array $args
         * @param array $instance
         *
         * @return void
         */
        function widget( $args, $instance ) {

            ob_start();
            extract( $args );

            $title = apply_filters( 'widget_title', $instance['title'] );
            if ( !$number = (int) $instance['number'] ) {
                $number = 6;
            }
            else {
                if ( $number < 1 ) {
                    $number = 3;
                }
                else {
                    if ( $number > 15 ) {
                        $number = 15;
                    }
                }
            }

            $current_portfolio = $instance['portfolio'];
            $portfolio         = YIT_Portfolio()->get_portfolio( $current_portfolio );
            $portfolio->init_query();

            if ( $portfolio->have_posts() ) : ?>

                <?php echo $before_widget; ?>

                    <?php if ( $title ) {
                        echo '
' . $title . '
';
                    } ?>

                        <?php while ( $portfolio->have_posts() ) : $portfolio->the_post();
                            $image = $portfolio->get_image( 'portfolio_thumb', array( 'class' => 'img-responsive' ) );
                            if ( strcmp( $image, '' ) != 0 ) :
                                ?>

                                    <a href="<?php echo $portfolio->get( 'permalink' ); ?>" class="with-tooltip project_img" title="<?php echo esc_attr( $portfolio->get( 'title' ) ); ?>">
                                        <?php echo $image; ?>

                            <?php endif ?>
                        <?php endwhile; ?>

                <?php echo $after_widget; ?>

            <?php endif;

            $content = ob_get_clean();

            if ( isset( $args['widget_id'] ) ) {
                $cache[$args['widget_id']] = $content;
            }

            echo $content;

            wp_reset_postdata();
        }

        /**
         * update function.
         *
         * @see    WP_Widget->update
         * @access public
         *
         * @param array $new_instance
         * @param array $old_instance
         *
         * @return array
         */
        function update( $new_instance, $old_instance ) {

            $instance              = $old_instance;
            $instance['title']     = strip_tags( $new_instance['title'] );
            $instance['number']    = (int) $new_instance['number'];
            $instance['portfolio'] = $new_instance['portfolio'];
            return $instance;
        }

        /**
         * form function.
         *
         * @see    WP_Widget->form
         * @access public
         *
         * @param array $instance
         *
         * @return void
         */
        function form( $instance ) {
            $portfolios = yit_get_portfolios();
            if ( empty ( $portfolios ) ): ?>

Before adding this widget, you should create a new portfolio

            <?php
            else:
                $defaults = array(
                    'title'     => '',
                    'number'    => 6,
                    'portfolio' => reset( $portfolios )
                );
                $instance = wp_parse_args( $instance, $defaults );
                ?>

<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'yit' ); ?>:
                    <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />

                    <label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php _e( 'Number of products to show', 'yit' ); ?>:
                    <input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['number'] ); ?>" size="3" />

                    <label for="<?php echo esc_attr( $this->get_field_id( 'portfolio' ) ); ?>"><?php _e( 'Portfolio', 'yit' ) ?>:
                        <select id="<?php echo esc_attr( $this->get_field_id( 'portfolio' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'portfolio' ) ); ?>">
                            <?php foreach ( $portfolios as $k => $name ): ?>
                                <option value="<?php echo esc_attr( $k ) ?>" <?php echo selected( $instance['portfolio'], $k ) ?>><?php echo $name ?></option>
                            <?php endforeach ?>
                        </select>

            <?php
            endif;
        }
    }
}


text:
<style type='text/css'>
  body { padding: 20px; font-family: Calibri, Helvetica, Arial; }
  h1 { border-bottom: 1px solid #ddd; font-size:120%; }
  #editor { margin: 0; padding: 0; border: 0; height: 600px; }
  /*.editor { margin: 0; padding: 0; border: 0; border: 10px solid #ddd; -moz-border-radius: 10px; -webkit-border-radius: 10px; } */
  .displaybutton { margin-top: 1em; }
  .app {
    -webkit-border-radius: 10px;
    background-color: #eeeeee;
    border: 1px solid #cccccc;
    padding: 10px;
    margin: 10px;
  }

  .enabled_app {
    -webkit-border-radius: 10px;
    background-color: #00ffff;
    border: 1px solid #cccccc;
    padding: 10px;
    margin: 10px;
  }
</style>


text:
module Vimus.MacroSpec (main, spec) where

import           Prelude hiding (getChar)
import           Test.Hspec

import           Vimus.Macro
import           Data.Default

import           Vimus.Input
import           Vimus.InputSpec hiding (main, spec)

shouldExpandTo :: String -> String -> Expectation
macro `shouldExpandTo` expected = expand macro macros `shouldBe` expected

expand :: String -> Macros -> String
expand m ms = runInput (userInput m >> expandMacro_ ms >> getUnGetBuffer)

expandMacro_ :: Monad m => Macros -> InputT m ()
expandMacro_ ms = getChar >>= expandMacro ms

macros :: Macros
macros =
    addMacro "bcd"   ":three-letter-macro\n"
  . addMacro "bccdd" ":five-letter-macro\n"
  . addMacro "q"     ":quit\n"
  . addMacro "gg"    ":move-first\n"
  $ def

main :: IO ()
main = hspec spec

spec :: Spec
spec = do

  describe "expandMacro" $ do
    it "expands a single-letter macro" $ do
      "q" `shouldExpandTo` ":quit\n"

    it "expands a two-letter macro" $ do
      "gg" `shouldExpandTo` ":move-first\n"

    it "expands a three-letter macro" $ do
      "bcd" `shouldExpandTo` ":three-letter-macro\n"

    it "expands a five-letter macro" $ do
      "bccdd" `shouldExpandTo` ":five-letter-macro\n"

    it "discards partial matches" $ do
      let ms = addMacro "foo" ":foo"
             . addMacro "bar" ":bar"
             $ def
      expand "foo" ms `shouldBe` ":foo"
      expand "bar" ms `shouldBe` ":bar"
      r <- return . runInput $ do
        userInput "fobar"
        expandMacro_ ms  -- discards 'f'
        expandMacro_ ms  -- discards 'o'
        expandMacro_ ms
        getUnGetBuffer
      r `shouldBe` ":bar"

  describe "expandMacro (regression tests)" $ do
    it "ignores input that does not match any macro" $ do
      let ms = addMacro "ab" "foo" def
      expand "ab" ms `shouldBe` "foo"
      r <- return . runInput $ do
        userInput "bab"
        expandMacro_ ms
        expandMacro_ ms
        getUnGetBuffer
      r `shouldBe` "foo"

  describe "removeMacro" $ do
    it "removes a macro" $ do
      expand "q" macros `shouldBe` ":quit\n"
      let Right ms = removeMacro "q" macros
      expand "q" ms     `shouldBe` ""


text:
package com.intellij.execution.junit2.info;

import com.intellij.execution.junit2.segments.ObjectReader;
import com.intellij.rt.execution.junit.segments.PoolOfTestTypes;
import com.intellij.util.containers.HashMap;
import org.jetbrains.annotations.NotNull;

import java.util.Map;

public abstract class TestInfoFactory {
  private static final Map<String,Class> KNOWN_PSI_LOCATOR_CLASSES = new HashMap<String, Class>();

  static {
    KNOWN_PSI_LOCATOR_CLASSES.put(PoolOfTestTypes.TEST_METHOD, TestCaseInfo.class);
    KNOWN_PSI_LOCATOR_CLASSES.put(PoolOfTestTypes.TEST_CLASS, TestClassInfo.class);
    KNOWN_PSI_LOCATOR_CLASSES.put(PoolOfTestTypes.ALL_IN_PACKAGE, AllInPackageInfo.class);
  }

  @NotNull
  public static TestInfo readInfoFrom(final ObjectReader reader) {
    final String testType = reader.readLimitedString();
    Class infoClass = KNOWN_PSI_LOCATOR_CLASSES.get(testType);
    if (infoClass == null)
      infoClass = DefaultTestInfo.class;
    final TestInfoImpl info;
    try {
      info = (TestInfoImpl)  infoClass.newInstance();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    info.readPacketFrom(reader);
    info.setTestCount(reader.readInt());
    return info;
  }
}


text:
package com.siyeh.ig.jdk;

import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.JavaFileCodeStyleFacade;
import com.intellij.psi.codeStyle.VariableKind;
import com.intellij.psi.util.InheritanceUtil;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.InspectionGadgetsFix;
import com.siyeh.ig.PsiReplacementUtil;
import com.siyeh.ig.psiutils.CommentTracker;
import com.siyeh.ig.psiutils.ParenthesesUtils;
import com.siyeh.ig.psiutils.VariableNameGenerator;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

public class ForeachStatementInspection extends BaseInspection {

  @Override
  @NotNull
  public String buildErrorString(Object... infos) {
    return InspectionGadgetsBundle.message("extended.for.statement.problem.descriptor");
  }

  @Override
  protected InspectionGadgetsFix buildFix(Object... infos) {
    return new ForEachFix();
  }

  private static class ForEachFix extends InspectionGadgetsFix {

    @Override
    @NotNull
    public String getFamilyName() {
      return InspectionGadgetsBundle.message("extended.for.statement.replace.quickfix");
    }

    @Override
    public void doFix(Project project, ProblemDescriptor descriptor) {
      final PsiElement element = descriptor.getPsiElement();
      final PsiForeachStatement statement = (PsiForeachStatement)element.getParent();
      assert statement != null;
      final PsiExpression iteratedValue = statement.getIteratedValue();
      if (iteratedValue == null) {
        return;
      }
      CommentTracker tracker = new CommentTracker();
      @NonNls final StringBuilder newStatement = new StringBuilder();
      final PsiParameter iterationParameter = statement.getIterationParameter();
      boolean generateFinalLocals = JavaFileCodeStyleFacade.forContext(element.getContainingFile()).isGenerateFinalLocals();
      tracker.markUnchanged(iteratedValue);
      if (iteratedValue.getType() instanceof PsiArrayType) {
        final PsiType type = iterationParameter.getType();
        final String index = new VariableNameGenerator(statement, VariableKind.LOCAL_VARIABLE)
          .byType(PsiType.INT).byName("i", "j", "k").generate(true);
        newStatement.append("for(int ").append(index).append(" = 0;");
        newStatement.append(index).append('<').append(iteratedValue.getText()).append(".length;");
        newStatement.append(index).append("++)").append("{ ");
        if (generateFinalLocals) {
          newStatement.append("final ");
        }
        newStatement.append(type.getCanonicalText()).append(' ').append(iterationParameter.getName());
        newStatement.append(" = ").append(iteratedValue.getText()).append('[').append(index).append("];");
      }
      else {
        @NonNls final StringBuilder methodCall = new StringBuilder();
        if (ParenthesesUtils.getPrecedence(iteratedValue) > ParenthesesUtils.METHOD_CALL_PRECEDENCE) {
          methodCall.append('(').append(iteratedValue.getText()).append(')');
        }
        else {
          methodCall.append(iteratedValue.getText());
        }
        methodCall.append(".iterator()");
        final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project);
        final PsiExpression iteratorCall = factory.createExpressionFromText(methodCall.toString(), iteratedValue);
        final PsiType variableType = GenericsUtil.getVariableTypeByExpressionType(iteratorCall.getType());
        if (variableType == null) {
          return;
        }
        final PsiType parameterType = iterationParameter.getType();
        final String typeText = parameterType.getCanonicalText();
        newStatement.append("for(").append(variableType.getCanonicalText()).append(' ');
        final String iterator = new VariableNameGenerator(statement, VariableKind.LOCAL_VARIABLE)
          .byName("iterator", "iter", "itr").generate(true);
        newStatement.append(iterator).append("=").append(iteratorCall.getText()).append(';');
        newStatement.append(iterator).append(".hasNext();){");
        if (generateFinalLocals) {
          newStatement.append("final ");
        }
        newStatement.append(typeText).append(' ').append(iterationParameter.getName()).append(" = ").append(iterator).append(".next();");
      }
      final PsiStatement body = statement.getBody();
      if (body instanceof PsiBlockStatement) {
        final PsiBlockStatement blockStatement = (PsiBlockStatement)body;
        final PsiCodeBlock block = blockStatement.getCodeBlock();
        final PsiElement[] children = block.getChildren();
        for (int i = 1; i < children.length - 1; i++) {
          //skip the braces
          newStatement.append(tracker.text(children[i]));
        }
      }
      else {
        final String bodyText;
        if (body == null) {
          bodyText = "";
        }
        else {
          bodyText = tracker.text(body);
        }
        newStatement.append(bodyText);
      }
      newStatement.append('}');

      PsiReplacementUtil.replaceStatementAndShortenClassNames(statement, newStatement.toString(), tracker);
    }
  }

  @Override
  public BaseInspectionVisitor buildVisitor() {
    return new ForeachStatementVisitor();
  }

  private static class ForeachStatementVisitor extends BaseInspectionVisitor {

    @Override
    public void visitForeachStatement(@NotNull PsiForeachStatement statement) {
      super.visitForeachStatement(statement);
      final PsiExpression iteratedValue = statement.getIteratedValue();
      if (iteratedValue == null || !InheritanceUtil.isInheritor(iteratedValue.getType(), CommonClassNames.JAVA_LANG_ITERABLE)) {
        return;
      }
      registerStatementError(statement);
    }
  }
}


text:
using System.ComponentModel;

namespace LinqAn.Google.Metrics
{
	/// <summary>
	/// 	The name of the requested custom metric, where 15 refers the number/index of the custom metric. Note that the data type of ga:metric15 can be INTEGER, CURRENCY or TIME.
	/// </summary>
	[Description("The name of the requested custom metric, where 15 refers the number/index of the custom metric. Note that the data type of ga:metric15 can be INTEGER, CURRENCY or TIME.")]
	public class Metric15: Metric<float>
	{
		/// <summary>
		/// 	Instantiates a <seealso cref="Metric15" />.
		/// </summary>
		public Metric15(): base("Custom Metric 15 Value",true,"ga:metric15")
		{

		}
	}
}


text:
============
Introduction
============

The `Django SaaS`_ project is a collection of reusable Django applications that
provides basic functionality for a subscription-driven website.

.. _Django SaaS: http://django-saas.info/

Objectives
==========

Django SaaS aims to provide building blocks that can be used to accelerate the
implementation of software-as-a-service Web applications.

The application capabilities can be leveraged and customized to meet business
needs such as service subscriptions, service level enforcement, service access,
security, billing and business metrics.

Features
========

Released
--------

* None yet.

Planned
-------

* Service plans with different service levels and pricing.
* Customer accounts with data separation.
* Service subscription.
* Subdomains for accounts (customer.service.com).
* Multiple users for customer account.
* Role-based security.
* Integration with billing application.


text:
package com.liferay.blade.basic.service.persistence;

import com.liferay.blade.basic.exception.NoSuchFooException;
import com.liferay.blade.basic.model.Foo;
import com.liferay.portal.kernel.service.persistence.BasePersistence;

import org.osgi.annotation.versioning.ProviderType;

/**
 * The persistence interface for the foo service.
 *
 *

 * Caching information and settings can be found in portal.properties
 *

 *
 * @author Brian Wing Shun Chan
 * @see FooUtil
 * @generated
 */
@ProviderType
public interface FooPersistence extends BasePersistence<Foo> {

	/**
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link FooUtil} to access the foo persistence. Modify service.xml and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	 * Returns all the foos where uuid = ?.
	 *
	 * @param uuid the uuid
	 * @return the matching foos
	 */
	public java.util.List<Foo> findByUuid(String uuid);

	/**
	 * Returns a range of all the foos where uuid = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param uuid the uuid
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @return the range of matching foos
	 */
	public java.util.List<Foo> findByUuid(String uuid, int start, int end);

	/**
	 * Returns an ordered range of all the foos where uuid = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param uuid the uuid
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @return the ordered range of matching foos
	 */
	public java.util.List<Foo> findByUuid(
		String uuid, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns an ordered range of all the foos where uuid = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param uuid the uuid
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @param useFinderCache whether to use the finder cache
	 * @return the ordered range of matching foos
	 */
	public java.util.List<Foo> findByUuid(
		String uuid, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo> orderByComparator,
		boolean useFinderCache);

	/**
	 * Returns the first foo in the ordered set where uuid = ?.
	 *
	 * @param uuid the uuid
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the first matching foo
	 * @throws NoSuchFooException if a matching foo could not be found
	 */
	public Foo findByUuid_First(
			String uuid,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Returns the first foo in the ordered set where uuid = ?.
	 *
	 * @param uuid the uuid
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the first matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByUuid_First(
		String uuid,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns the last foo in the ordered set where uuid = ?.
	 *
	 * @param uuid the uuid
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the last matching foo
	 * @throws NoSuchFooException if a matching foo could not be found
	 */
	public Foo findByUuid_Last(
			String uuid,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Returns the last foo in the ordered set where uuid = ?.
	 *
	 * @param uuid the uuid
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the last matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByUuid_Last(
		String uuid,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns the foos before and after the current foo in the ordered set where uuid = ?.
	 *
	 * @param fooId the primary key of the current foo
	 * @param uuid the uuid
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the previous, current, and next foo
	 * @throws NoSuchFooException if a foo with the primary key could not be found
	 */
	public Foo[] findByUuid_PrevAndNext(
			long fooId, String uuid,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Removes all the foos where uuid = ? from the database.
	 *
	 * @param uuid the uuid
	 */
	public void removeByUuid(String uuid);

	/**
	 * Returns the number of foos where uuid = ?.
	 *
	 * @param uuid the uuid
	 * @return the number of matching foos
	 */
	public int countByUuid(String uuid);

	/**
	 * Returns the foo where uuid = ? and groupId = ? or throws a NoSuchFooException if it could not be found.
	 *
	 * @param uuid the uuid
	 * @param groupId the group ID
	 * @return the matching foo
	 * @throws NoSuchFooException if a matching foo could not be found
	 */
	public Foo findByUUID_G(String uuid, long groupId)
		throws NoSuchFooException;

	/**
	 * Returns the foo where uuid = ? and groupId = ? or returns null if it could not be found. Uses the finder cache.
	 *
	 * @param uuid the uuid
	 * @param groupId the group ID
	 * @return the matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByUUID_G(String uuid, long groupId);

	/**
	 * Returns the foo where uuid = ? and groupId = ? or returns null if it could not be found, optionally using the finder cache.
	 *
	 * @param uuid the uuid
	 * @param groupId the group ID
	 * @param useFinderCache whether to use the finder cache
	 * @return the matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByUUID_G(String uuid, long groupId, boolean useFinderCache);

	/**
	 * Removes the foo where uuid = ? and groupId = ? from the database.
	 *
	 * @param uuid the uuid
	 * @param groupId the group ID
	 * @return the foo that was removed
	 */
	public Foo removeByUUID_G(String uuid, long groupId)
		throws NoSuchFooException;

	/**
	 * Returns the number of foos where uuid = ? and groupId = ?.
	 *
	 * @param uuid the uuid
	 * @param groupId the group ID
	 * @return the number of matching foos
	 */
	public int countByUUID_G(String uuid, long groupId);

	/**
	 * Returns all the foos where uuid = ? and companyId = ?.
	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @return the matching foos
	 */
	public java.util.List<Foo> findByUuid_C(String uuid, long companyId);

	/**
	 * Returns a range of all the foos where uuid = ? and companyId = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @return the range of matching foos
	 */
	public java.util.List<Foo> findByUuid_C(
		String uuid, long companyId, int start, int end);

	/**
	 * Returns an ordered range of all the foos where uuid = ? and companyId = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @return the ordered range of matching foos
	 */
	public java.util.List<Foo> findByUuid_C(
		String uuid, long companyId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns an ordered range of all the foos where uuid = ? and companyId = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @param useFinderCache whether to use the finder cache
	 * @return the ordered range of matching foos
	 */
	public java.util.List<Foo> findByUuid_C(
		String uuid, long companyId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo> orderByComparator,
		boolean useFinderCache);

	/**
	 * Returns the first foo in the ordered set where uuid = ? and companyId = ?.
	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the first matching foo
	 * @throws NoSuchFooException if a matching foo could not be found
	 */
	public Foo findByUuid_C_First(
			String uuid, long companyId,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Returns the first foo in the ordered set where uuid = ? and companyId = ?.
	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the first matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByUuid_C_First(
		String uuid, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns the last foo in the ordered set where uuid = ? and companyId = ?.
	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the last matching foo
	 * @throws NoSuchFooException if a matching foo could not be found
	 */
	public Foo findByUuid_C_Last(
			String uuid, long companyId,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Returns the last foo in the ordered set where uuid = ? and companyId = ?.
	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the last matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByUuid_C_Last(
		String uuid, long companyId,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns the foos before and after the current foo in the ordered set where uuid = ? and companyId = ?.
	 *
	 * @param fooId the primary key of the current foo
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the previous, current, and next foo
	 * @throws NoSuchFooException if a foo with the primary key could not be found
	 */
	public Foo[] findByUuid_C_PrevAndNext(
			long fooId, String uuid, long companyId,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Removes all the foos where uuid = ? and companyId = ? from the database.
	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 */
	public void removeByUuid_C(String uuid, long companyId);

	/**
	 * Returns the number of foos where uuid = ? and companyId = ?.
	 *
	 * @param uuid the uuid
	 * @param companyId the company ID
	 * @return the number of matching foos
	 */
	public int countByUuid_C(String uuid, long companyId);

	/**
	 * Returns all the foos where field2 = ?.
	 *
	 * @param field2 the field2
	 * @return the matching foos
	 */
	public java.util.List<Foo> findByField2(boolean field2);

	/**
	 * Returns a range of all the foos where field2 = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param field2 the field2
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @return the range of matching foos
	 */
	public java.util.List<Foo> findByField2(boolean field2, int start, int end);

	/**
	 * Returns an ordered range of all the foos where field2 = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param field2 the field2
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @return the ordered range of matching foos
	 */
	public java.util.List<Foo> findByField2(
		boolean field2, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns an ordered range of all the foos where field2 = ?.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param field2 the field2
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @param useFinderCache whether to use the finder cache
	 * @return the ordered range of matching foos
	 */
	public java.util.List<Foo> findByField2(
		boolean field2, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo> orderByComparator,
		boolean useFinderCache);

	/**
	 * Returns the first foo in the ordered set where field2 = ?.
	 *
	 * @param field2 the field2
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the first matching foo
	 * @throws NoSuchFooException if a matching foo could not be found
	 */
	public Foo findByField2_First(
			boolean field2,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Returns the first foo in the ordered set where field2 = ?.
	 *
	 * @param field2 the field2
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the first matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByField2_First(
		boolean field2,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns the last foo in the ordered set where field2 = ?.
	 *
	 * @param field2 the field2
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the last matching foo
	 * @throws NoSuchFooException if a matching foo could not be found
	 */
	public Foo findByField2_Last(
			boolean field2,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Returns the last foo in the ordered set where field2 = ?.
	 *
	 * @param field2 the field2
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the last matching foo, or null if a matching foo could not be found
	 */
	public Foo fetchByField2_Last(
		boolean field2,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns the foos before and after the current foo in the ordered set where field2 = ?.
	 *
	 * @param fooId the primary key of the current foo
	 * @param field2 the field2
	 * @param orderByComparator the comparator to order the set by (optionally null)
	 * @return the previous, current, and next foo
	 * @throws NoSuchFooException if a foo with the primary key could not be found
	 */
	public Foo[] findByField2_PrevAndNext(
			long fooId, boolean field2,
			com.liferay.portal.kernel.util.OrderByComparator<Foo>
				orderByComparator)
		throws NoSuchFooException;

	/**
	 * Removes all the foos where field2 = ? from the database.
	 *
	 * @param field2 the field2
	 */
	public void removeByField2(boolean field2);

	/**
	 * Returns the number of foos where field2 = ?.
	 *
	 * @param field2 the field2
	 * @return the number of matching foos
	 */
	public int countByField2(boolean field2);

	/**
	 * Caches the foo in the entity cache if it is enabled.
	 *
	 * @param foo the foo
	 */
	public void cacheResult(Foo foo);

	/**
	 * Caches the foos in the entity cache if it is enabled.
	 *
	 * @param foos the foos
	 */
	public void cacheResult(java.util.List<Foo> foos);

	/**
	 * Creates a new foo with the primary key. Does not add the foo to the database.
	 *
	 * @param fooId the primary key for the new foo
	 * @return the new foo
	 */
	public Foo create(long fooId);

	/**
	 * Removes the foo with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param fooId the primary key of the foo
	 * @return the foo that was removed
	 * @throws NoSuchFooException if a foo with the primary key could not be found
	 */
	public Foo remove(long fooId) throws NoSuchFooException;

	public Foo updateImpl(Foo foo);

	/**
	 * Returns the foo with the primary key or throws a NoSuchFooException if it could not be found.
	 *
	 * @param fooId the primary key of the foo
	 * @return the foo
	 * @throws NoSuchFooException if a foo with the primary key could not be found
	 */
	public Foo findByPrimaryKey(long fooId) throws NoSuchFooException;

	/**
	 * Returns the foo with the primary key or returns null if it could not be found.
	 *
	 * @param fooId the primary key of the foo
	 * @return the foo, or null if a foo with the primary key could not be found
	 */
	public Foo fetchByPrimaryKey(long fooId);

	/**
	 * Returns all the foos.
	 *
	 * @return the foos
	 */
	public java.util.List<Foo> findAll();

	/**
	 * Returns a range of all the foos.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @return the range of foos
	 */
	public java.util.List<Foo> findAll(int start, int end);

	/**
	 * Returns an ordered range of all the foos.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @return the ordered range of foos
	 */
	public java.util.List<Foo> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo>
			orderByComparator);

	/**
	 * Returns an ordered range of all the foos.
	 *
	 *

	 * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from FooModelImpl.
	 *

	 *
	 * @param start the lower bound of the range of foos
	 * @param end the upper bound of the range of foos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally null)
	 * @param useFinderCache whether to use the finder cache
	 * @return the ordered range of foos
	 */
	public java.util.List<Foo> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator<Foo> orderByComparator,
		boolean useFinderCache);

	/**
	 * Removes all the foos from the database.
	 */
	public void removeAll();

	/**
	 * Returns the number of foos.
	 *
	 * @return the number of foos
	 */
	public int countAll();

}


text:
/* $Id: sip_module.h 3553 2011-05-05 06:14:19Z nanang $ */
/*
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
 *
 * 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.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef __PJSIP_SIP_MODULE_H__
#define __PJSIP_SIP_MODULE_H__

/**
 * @file sip_module.h
 * @brief Module helpers
 */
#include <pjsip/sip_types.h>
#include <pj/list.h>

PJ_BEGIN_DECL

/**
 * @defgroup PJSIP_MOD Modules
 * @ingroup PJSIP_CORE_CORE
 * @brief Modules are the primary means to extend PJSIP!
 * @{
 * Modules are the primary means to extend PJSIP. Without modules, PJSIP
 * would not know how to handle messages, and will simply discard all
 * incoming messages.
 *
 * Modules are registered by creating and initializing #pjsip_module
 * structure, and register the structure to PJSIP with
 * #pjsip_endpt_register_module().
 *
 * The PJSIP Developer's Guide
 * has a thorough discussion on this subject, and readers are encouraged
 * to read the document for more information.
 */

/**
 * The declaration for SIP module. This structure would be passed to
 * #pjsip_endpt_register_module() to register the module to PJSIP.
 */
struct pjsip_module
{
    /** To allow chaining of modules in the endpoint. */
    PJ_DECL_LIST_MEMBER(struct pjsip_module);

    /**
     * Module name to identify the module.
     *
     * This field MUST be initialized before registering the module.
     */
    pj_str_t name;

    /**
     * Module ID. Application must initialize this field with -1 before
     * registering the module to PJSIP. After the module is registered,
     * this field will contain a unique ID to identify the module.
     */
    int id;

    /**
     * Integer number to identify module initialization and start order with
     * regard to other modules. Higher number will make the module gets
     * initialized later.
     *
     * This field MUST be initialized before registering the module.
     */
    int priority;

    /**
     * Optional function to be called to initialize the module. This function
     * will be called by endpoint during module registration. If the value
     * is NULL, then it's equal to returning PJ_SUCCESS.
     *
     * @param endpt	The endpoint instance.
     * @return		Module should return PJ_SUCCESS to indicate success.
     */
    pj_status_t (*load)(pjsip_endpoint *endpt);

    /**
     * Optional function to be called to start the module. This function
     * will be called by endpoint during module registration. If the value
     * is NULL, then it's equal to returning PJ_SUCCESS.
     *
     * @return		Module should return zero to indicate success.
     */
    pj_status_t (*start)(void);

    /**
     * Optional function to be called to deinitialize the module before
     * it is unloaded. This function will be called by endpoint during
     * module unregistration. If the value is NULL, then it's equal to
     * returning PJ_SUCCESS.
     *
     * @return		Module should return PJ_SUCCESS to indicate success.
     */
    pj_status_t (*stop)(void);

    /**
     * Optional function to be called to deinitialize the module before
     * it is unloaded. This function will be called by endpoint during
     * module unregistration. If the value is NULL, then it's equal to
     * returning PJ_SUCCESS.
     *
     * @param mod	The module.
     *
     * @return		Module should return PJ_SUCCESS to indicate success.
     */
    pj_status_t (*unload)(void);

    /**
     * Optional function to be called to process incoming request message.
     *
     * @param rdata	The incoming message.
     *
     * @return		Module should return PJ_TRUE if it handles the request,
     *			or otherwise it should return PJ_FALSE to allow other
     *			modules to handle the request.
     */
    pj_bool_t (*on_rx_request)(pjsip_rx_data *rdata);

    /**
     * Optional function to be called to process incoming response message.
     *
     * @param rdata	The incoming message.
     *
     * @return		Module should return PJ_TRUE if it handles the
     *			response, or otherwise it should return PJ_FALSE to
     *			allow other modules to handle the response.
     */
    pj_bool_t (*on_rx_response)(pjsip_rx_data *rdata);

    /**
     * Optional function to be called when transport layer is about to
     * transmit outgoing request message.
     *
     * @param tdata	The outgoing request message.
     *
     * @return		Module should return PJ_SUCCESS in all cases.
     *			If non-zero (or PJ_FALSE) is returned, the message
     *			will not be sent.
     */
    pj_status_t (*on_tx_request)(pjsip_tx_data *tdata);

    /**
     * Optional function to be called when transport layer is about to
     * transmit outgoing response message.
     *
     * @param tdata	The outgoing response message.
     *
     * @return		Module should return PJ_SUCCESS in all cases.
     *			If non-zero (or PJ_FALSE) is returned, the message
     *			will not be sent.
     */
    pj_status_t (*on_tx_response)(pjsip_tx_data *tdata);

    /**
     * Optional function to be called when this module is acting as
     * transaction user for the specified transaction, when the
     * transaction's state has changed.
     *
     * @param tsx	The transaction.
     * @param event	The event which has caused the transaction state
     *			to change.
     */
    void (*on_tsx_state)(pjsip_transaction *tsx, pjsip_event *event);

};

/**
 * Module priority guidelines.
 */
enum pjsip_module_priority
{
    /**
     * This is the priority used by transport layer.
     */
    PJSIP_MOD_PRIORITY_TRANSPORT_LAYER	= 8,

    /**
     * This is the priority used by transaction layer.
     */
    PJSIP_MOD_PRIORITY_TSX_LAYER	= 16,

    /**
     * This is the priority used by the user agent and proxy layer.
     */
    PJSIP_MOD_PRIORITY_UA_PROXY_LAYER	= 32,

    /**
     * This is the priority used by the dialog usages.
     */
    PJSIP_MOD_PRIORITY_DIALOG_USAGE	= 48,

    /**
     * This is the recommended priority to be used by applications.
     */
    PJSIP_MOD_PRIORITY_APPLICATION	= 64
};

/**
 * @}
 */

PJ_END_DECL

#endif	/* __PJSIP_SIP_MODULE_H__ */


text:
module Ebay # :nodoc:
  module Types # :nodoc:
    # == Attributes
    #  text_node :delivery_url_name, 'DeliveryURLName', :optional => true
    #  text_node :delivery_url, 'DeliveryURL', :optional => true
    #  text_node :status, 'Status', :optional => true
    class DeliveryURLDetail
      include XML::Mapping
      include Initializer
      root_element_name 'DeliveryURLDetail'
      text_node :delivery_url_name, 'DeliveryURLName', :optional => true
      text_node :delivery_url, 'DeliveryURL', :optional => true
      text_node :status, 'Status', :optional => true
    end
  end
end


text:
'use strict';

var gulp = require('gulp');
var debug = require('gulp-debug');

var $ = require('gulp-load-plugins')({
  pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license']
});

function handleError(err) {
  console.error(err.toString());
  this.emit('end');
}

gulp.task('styles', function () {
  return gulp.src('src/{app,components}/**/*.scss')
    .pipe($.rubySass({style: 'expanded'}))
    .on('error', handleError)
    .pipe($.autoprefixer('last 1 version'))
    .pipe(gulp.dest('.tmp'))
    .pipe($.size());
});

gulp.task('compass', function() {
  gulp.src('src/{app,components}/**/*.scss')
    .pipe(compass({
      css: 'assets/css',
      sass: 'assets/sass',
      image: 'assets/images',
      require: ['susy', 'modular-scale']
    }))
    .on('error', handleError)
    .pipe($.autoprefixer('last 1 version'))
    .pipe(gulp.dest('.tmp'))
    .pipe($.size());
});

gulp.task('scripts', function () {
  return gulp.src('src/{app,components}/**/*.js')
    .pipe($.jshint())
    .pipe($.jshint.reporter('jshint-stylish'))
    .pipe($.size());
});

gulp.task('partials', function () {
  return gulp.src('src/{app,components}/**/*.html')
    .pipe($.minifyHtml({
      empty: true,
      spare: true,
      quotes: true
    }))
    .pipe($.ngHtml2js({
      moduleName: 'app'
    }))
    .pipe(gulp.dest('.tmp'))
    .pipe($.size());
});

gulp.task('html', ['styles', 'scripts', 'partials'], function () {
  var htmlFilter = $.filter('*.html');
  var jsFilter = $.filter('**/*.js');
  var cssFilter = $.filter('**/*.css');
  var assets;

  return gulp.src('src/*.html')
    .pipe($.inject(gulp.src('.tmp/{app,components}/**/*.js'), {
      read: false,
      starttag: '<!-- inject:partials -->',
      addRootSlash: false,
      addPrefix: '../'
    }))
    .pipe(assets = $.useref.assets())
    .pipe($.rev())
    .pipe(jsFilter)
    .pipe($.ngAnnotate())
    .pipe($.uglify({preserveComments: $.uglifySaveLicense}))
    .pipe(jsFilter.restore())
    .pipe(cssFilter)
    .pipe($.csso())
    .pipe(cssFilter.restore())
    .pipe(assets.restore())
    .pipe($.useref())
    .pipe($.revReplace())
    .pipe(htmlFilter)
    .pipe($.minifyHtml({
      empty: true,
      spare: true,
      quotes: true
    }))
    .pipe(htmlFilter.restore())
    .pipe(gulp.dest('dist'))
    .pipe($.size());
});

gulp.task('images', function () {
  return gulp.src('src/assets/images/**/*')
    .pipe($.imagemin({
      optimizationLevel: 3,
      progressive: true,
      interlaced: true
    }))
    .pipe(gulp.dest('dist/assets/images'))
    .pipe($.size());
});

gulp.task('fonts', function () {
  return gulp.src($.mainBowerFiles())
    .pipe($.filter('**/*.{eot,svg,ttf,woff}'))
    .pipe($.flatten())
    .pipe(gulp.dest('dist/fonts'))
    .pipe($.size());
});

gulp.task('clean', function () {
  return gulp.src(['.tmp', 'dist'], { read: false }).pipe($.rimraf());
});

gulp.task('build', ['html', 'partials', 'images', 'fonts']);


text:
namespace MonoMac.AppKit {
	public partial class NSPopUpButtonCell {
		public NSMenuItem this [int idx] {
			get {
				return ItemAt (idx);
			}
		}

		public NSMenuItem this [string title]{
			get {
				return ItemWithTitle (title);
			}
		}
	}
}


text:
package org.apereo.cas.authorization;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.ldaptive.LdapEntry;
import org.ldaptive.SearchOperation;
import org.pac4j.core.authorization.generator.AuthorizationGenerator;
import org.pac4j.core.profile.UserProfile;

import java.util.Optional;

/**
 * Provides a simple {@link AuthorizationGenerator} implementation that obtains user roles from an LDAP search.
 * Searches are performed by this component for every user details lookup:
 *
 * @author Jerome Leleu
 * @author Marvin S. Addison
 * @author Misagh Moayyed
 * @since 4.0.0
 */
@Slf4j
@Getter
public class LdapUserAttributesToRolesAuthorizationGenerator extends BaseUseAttributesAuthorizationGenerator {

    private final String roleAttribute;
    private final String rolePrefix;

    /**
     * Creates a new instance with the given required parameters.
     *
     * @param userSearchOperation   Executes the LDAP search for user data.
     * @param allowMultipleResults allow multiple search results in which case the first result
     *                             returned is used to construct user details, or false to indicate that
     *                             a runtime exception should be raised on multiple search results for user details.
     * @param roleAttribute        the role attribute
     * @param rolePrefix           the role prefix
     */
    public LdapUserAttributesToRolesAuthorizationGenerator(final SearchOperation userSearchOperation,
                                                           final boolean allowMultipleResults,
                                                           final String roleAttribute,
                                                           final String rolePrefix) {
        super(userSearchOperation, allowMultipleResults);
        this.roleAttribute = roleAttribute;
        this.rolePrefix = rolePrefix;
    }

    @Override
    protected Optional<UserProfile> generateAuthorizationForLdapEntry(final UserProfile profile, final LdapEntry userEntry) {
        if (!userEntry.getAttributes().isEmpty()) {
            val attribute = userEntry.getAttribute(this.roleAttribute);
            if (attribute != null) {
                addProfileRoles(userEntry, profile, attribute, this.rolePrefix);
            } else {
                LOGGER.warn("Configured role attribute cannot be found for this user");
            }
        } else {
            LOGGER.warn("No attributes are retrieved for this user.");
        }
        return Optional.ofNullable(profile);
    }
}


text:
package org.uberfire.client.perspectives;

import javax.enterprise.context.ApplicationScoped;

import com.google.gwt.user.client.Window;
import org.uberfire.client.ShowcaseEntryPoint;
import org.uberfire.client.annotations.Perspective;
import org.uberfire.client.annotations.WorkbenchMenu;
import org.uberfire.client.annotations.WorkbenchPerspective;
import org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter;
import org.uberfire.mvp.Command;
import org.uberfire.workbench.model.PerspectiveDefinition;
import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl;
import org.uberfire.workbench.model.menu.MenuFactory;
import org.uberfire.workbench.model.menu.MenuPosition;
import org.uberfire.workbench.model.menu.Menus;

/**
 * A simple perspective with one tabbed panel.
 * To test access /showcase.html?standalone=true&perspective=SimplePerspectiveNoContext&header=AppNavBar
 */
@ApplicationScoped
@WorkbenchPerspective( identifier = SimplePerspectiveNoContext.SIMPLE_PERSPECTIVE_NO_CONTEXT, isTransient = false )
public class SimplePerspectiveNoContext {

    public static final String SIMPLE_PERSPECTIVE_NO_CONTEXT = "SimplePerspectiveNoContext";

    @Perspective
    public PerspectiveDefinition buildPerspective() {
        final PerspectiveDefinition p = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName() );
        p.setName( "Simple Perspective No Context" );
        p.getRoot().addPart("welcome");
        return p;
    }

    @WorkbenchMenu
    public Menus getMenus() {
        return MenuFactory
                .newTopLevelMenu( "Open" )
                        .withItems( ShowcaseEntryPoint.getScreens() )
                .endMenu()
                .newTopLevelMenu( "Command" ).respondsWith( new Command() {
                    @Override
                    public void execute() {
                        Window.alert( "Command!" );
                    }
                } )
                .endMenu()
                .newTopLevelMenu( "Create New" )
                    .menus()
                        .menu( "Command 1" )
                            .respondsWith( new Command() {
                            @Override
                            public void execute() {
                                Window.alert( "Command 1!" );
                            }
                        } )
                        .endMenu()
                        .menu( "Command 2" )
                            .respondsWith( new Command() {
                    @Override
                    public void execute() {
                        Window.alert( "Command 2!" );
                    }
                } )
                        .endMenu()
                    .endMenus()
                .endMenu()
                .newTopLevelMenu( "Find" )
                    .respondsWith( new Command() {
                        @Override
                        public void execute() {
                            Window.alert( "Find!" );
                        }
                    } )
                    .position( MenuPosition.RIGHT )
                .endMenu()
                .build();
    }
}


text:
title: Susiskaldymų priežastys
date: 06/10/2018
---

### Šios savaitės tyrinėjimui skaitykite
Įst 28, 1–14; Jer 3, 14–18; Ts 17, 6; 1 Kar 12, 1–16; 1 Kor 1, 10–17; Apd 20, 25–31.

>
Įsimintina eilutė:

> "Pagarbi Viešpaties baimė – išminties pradžia, o Šventojo pažinimas – protas" (Pat 9, 10).

Senojo Testamento pranašai pakartotinai ragino Izraelio tautą paklusti Dievo paliepimams. Nepaklusimas ir nerūpestingumas atves prie atsimetimo ir nevieningumo. Paklusnumas Dievo įsakams buvo skirtas kaip priemonė apsaugoti tautą nuo natūralių nuodėmės padarinių ir pašventinti juos tarp daugybės kitų tautų. Dievo valios laikymasis lems darną tarp žmonių ir sustiprins jų bendruomenės ryžtą atsispirti pagoniškiems ir nedoriems garbinimo papročiams, kurie supa juos beveik iš visų pusių. Dievas norėjo, kad Jo tauta būtų šventa ir liudytų aplinkinėms tautoms.

Kaip Viešpats jiems sakė, išvedęs žydus iš Egipto: "Žiūrėkite, kaip man Viešpats yra įsakęs, mokau dabar jus laikytis įstatų ir įsakų krašte, į kurį esate pasirengę įžengti ir jį paveldėti. Laikykitės jų ir vykdykite juos, nes tai parodys tautoms jūsų išmintį ir protingumą. Girdėdami apie visus šiuos įstatus, jie sakys: Iš tikrųjų išmintingi ir protingi yra žmonės šios didelės tautos!" (Įst 4, 5–6)

Neabejotina, jei būtų ištikima, jo tauta būtų labai palaiminta ir būtų palaima kitiems. Tačiau neištikimybė lems daugybę problemų, nevieningumas – tik viena iš daugelio.


text:
package jsystem.runner.agent.mediators;

import java.util.logging.Logger;

import jsystem.framework.fixture.Fixture;
import jsystem.framework.fixture.FixtureListener;
import jsystem.runner.agent.notifications.AboutToChangeToFixtureNotification;
import jsystem.runner.agent.notifications.EndFixturingNotification;
import jsystem.runner.agent.notifications.FixtureChangedNotification;
import jsystem.runner.agent.notifications.NotificationLevel;
import jsystem.runner.agent.notifications.StartFixturingNotification;
import jsystem.runner.agent.server.RunnerAgent;
/**
 * Listens for fixture navigation events, converts them to JMX notifications
 * and dispatches the notifications.
 * @author goland
 */
public class FixtureListenerMediator extends BaseMediator implements FixtureListener {
	private static Logger log = Logger.getLogger(FixtureListenerMediator.class.getName());

	public FixtureListenerMediator(RunnerAgent agent){
		super(agent);
	}

	public void aboutToChangeTo(Fixture fixture) {
		if (NotificationLevel.getCurrentNotificationLevel().equals(NotificationLevel.NO_TEST_INDICATION)){
			return;
		}
		log.finest("aboutToChangeTo(Fixture fixture)");
		sendNotification(new AboutToChangeToFixtureNotification(runnerAgent().getClass().getName(),fixture.getClass().getName()));
	}

	public void endFixturring() {
		if (NotificationLevel.getCurrentNotificationLevel().equals(NotificationLevel.NO_TEST_INDICATION)){
			return;
		}
		log.finest("endFixturring()");
		sendNotification(new EndFixturingNotification(runnerAgent().getClass().getName()));
	}

	public void fixtureChanged(Fixture fixture) {
		if (NotificationLevel.getCurrentNotificationLevel().equals(NotificationLevel.NO_TEST_INDICATION)){
			return;
		}
		log.finest("fixtureChanged(Fixture fixture)");
		sendNotification(new FixtureChangedNotification(runnerAgent().getClass().getName(),fixture.getClass().getName()));

	}

	public void startFixturring() {
		if (NotificationLevel.getCurrentNotificationLevel().equals(NotificationLevel.NO_TEST_INDICATION)){
			return;
		}
		log.finest("startFixturring()");
		sendNotification(new StartFixturingNotification(runnerAgent().getClass().getName()));
	}
}


text:
ALPHA VERSION

This catalog provides cattle orchestration templates for [Apache Mesos](https://mesos.apache.org/)
and [Mesos Frameworks](https://mesos.apache.org/documentation/latest/frameworks/).

# License
Copyright (c) 2014-2016 [Rancher Labs, Inc.](http://rancher.com)

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](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.


text:
B=node_modules/.bin
O=src/main/resources/www/steam

default:
	npm run build --output=../h2o-3/h2o-web/src/main/resources/www/flow

build:
	npm run build

clean:
	npm run clean

watch:
	npm run watch

check:

launch:
	java -Dwebdev=1 -Xmx4g -jar ../h2o-app/build/libs/h2o-app.jar

unit-test:
	$B/gulp build-test-script && node $O/js/steam-tests.js -u | $B/faucet

test-raw:
	$B/gulp build-test-script && node $O/js/steam-tests.js -s

test:
	$B/gulp build-test-script && node $O/js/steam-tests.js -s | $B/faucet

coverage:
	@mkdir -p $O/coverage
	$B/gulp build-test-script && $B/istanbul cover --dir $O/coverage -x "**/lib/**" $O/js/steam-tests.js && $B/istanbul report --dir $O/coverage cobertura

.PHONY: default watch clean unit-test test-raw test coverage launch


text:
layout: post
date:	2007-02-20 15:06:00
title:  The story of Mr and Mrs M. G. Hornbill
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
At Dandeli, this time, we were treated to a lovely family drama, more riveting than any soap opera one could see on the idiot box! Let me introduce the hero and heroine:

<lj-cut text="The rest of the Hornbill Story...click here!">

That's the Malabar Grey Hornbill...hornbills are an endangered species, but around the Dandeli area, one can sight four species! They are frugivores...they feed mainly on fruit; you can see the fruit in the beak of the one on the left. They have an amazing way of bringing up a family...after practising being in the nest for a while, Mrs. MGH actually seals herself in the nest for a few months, with only a small opening through which Mr MGH will feed her, and through which she will also eliminate her own, and her babies', waste. Hornbill nests are marked, apparently, by discarded feathers and droppings on the ground below the tree.

The scene of the story was the Timber Depot in Dandeli, where timber is cut and stacked and auctioned regularly. In fact, as all this happened, a timber auction was going on, with many people going around the various stacks of logs.

We found this tree and the nest right next to the road, and with the presence of traffic and people all the time,  did not feel that we were disturbing the birds, or attracting predators to their nest, in any way; in fact, this story has a happy ending, with the hornbills chasing away, not a predator, but an usurper!

Here's Mrs Hornbill, entering the nest:

You can see nothing now but her tail:

Mr Hornbill now arrives, with that delectable fruit in his mouth:

And he proceeds to practice what he will do later, and puts his head in to feed his missus:

Even as this is going on,  the villain (of this piece, anyway), the Jungle Myna, makes her appearance. Mynas make their nests in very much the same sort of holes in the tree trunks, and a ready-made home is a a great attraction for this one. Here Mrs M is, even as Mr H is concentrating on his home:

As the hornbills fly to a nearby tree, the mynas become bolder. The male is nearby, and the female, with some nesting material (call it soft furnishing!) in her beak, approaches the hole.Closer and closer (the mynah really did do it in a surreptitious way and we were laughing as we watched!):

Here she is, at the mouth of the nest:

And now she looks and sees if she can get into the nest:

The male also arrives to see if the nest can be usurped...

Oh, no, is the answer, as Mrs Hornbill comes back, shoos the Mynas away (the female, with the nesting material still in her beak), and goes in to check out what damage has been done:

This time, the hornbill takes no chances. She disappears promptly inside the nest and starts clearing out material just in case there is something there left by the myna. We couldn't get a picture of the small bits of the nesting material falling out, though:

Just when the hornbills flew around in earnest  to mob the mynas and  chase them off, KM fell over backwards over the large logs that were stacked everywhere on the ground, awaiting auction; checking that he, and the camera, were OK, took some time! (Both seemed none the worse for the fall...but it illustrates the dangers of photographing with one's head high in the air all the time, like that lovely poem,  "Little Johnny Head-in-air"!  )

Finally, Mrs Hornbill decides that to stay is the only option. The Mynas have been chased off for the present, but it's better to show them who's really in residence. So here she is, with just her beak showing, the way it will be very soon:

Having earned their victory, the couple then relax on a nearby tree, preparing for the next day, the next battle, the next hurdle on the way to raising their family....

</lj-cut>

We enjoyed this little drama so much...watching the birds and observing their behaviour is far more interesting than just spotting them!


text:
 import {set} from 'lodash';
import * as React from 'react';
import * as renderer from 'react-test-renderer';
import {Store} from '../../Store/Store';
import {Arkham} from './Arkham';

describe('Arkham', () => {
  let rendered;

  class TestStore extends Store {
    constructor() {
      super('test');
    }

    initialState(): object {
      return {
        item: 'default',
        testAction: 'default',
        testUpdate: 'default'
      };
    }

    onAction(type, data, state): object {
      switch(type) {
        case 'TEST_EVENT':
          return set(state, 'testAction', data.testVar);
        default:
          return state;
      }
    }
  }

  beforeAll(() => {
    // Render
    const props = {
      stores: [TestStore]
    };

    rendered = renderer.create(<Arkham {...props}/>);
  });

  it('should render null initially', () => {
    expect(rendered).toBeDefined();
  });
});