text:
void define_data_transfer_opcodes();
void define_arithmetic_opcodes();
void define_logical_opcodes();
void define_branch_opcodes();
void define_miscellaneous_opcodes();

void define_opcodes()
{
    define_data_transfer_opcodes();
    define_arithmetic_opcodes();
    define_logical_opcodes();
    define_branch_opcodes();
    define_miscellaneous_opcodes();
}

void define_data_transfer_opcodes()
{
    InstructionTemplate move_register_template = new_instruction_template("01DDDSSS", &move_register);
    add_instruction_template(move_register_template);

    InstructionTemplate move_from_memory_template = new_instruction_template("01DDD110", &move_from_memory);
    add_instruction_template(move_from_memory_template);

    InstructionTemplate move_to_memory_template = new_instruction_template("01110SSS", &move_to_memory);
    add_instruction_template(move_to_memory_template);

    InstructionTemplate move_immediate_template = new_instruction_template("00DDD110", &move_immediate);
    add_instruction_template(move_immediate_template);

    InstructionTemplate move_to_memory_immediate_template = new_instruction_template("00110110", &move_to_memory_immediate);
    add_instruction_template(move_to_memory_immediate_template);

    InstructionTemplate load_register_pair_immediate_template = new_instruction_template("00RP0001", &load_register_pair_immediate);
    add_instruction_template(load_register_pair_immediate_template);

    InstructionTemplate load_accumulator_direct_template = new_instruction_template("00111010", &load_accumulator_direct);
    add_instruction_template(load_accumulator_direct_template);

    InstructionTemplate store_accumulator_direct_template = new_instruction_template("00110010", &store_accumulator_direct);
    add_instruction_template(store_accumulator_direct_template);

    InstructionTemplate load_HL_direct_template = new_instruction_template("00101010", &load_HL_direct);
    add_instruction_template(load_HL_direct_template);

    InstructionTemplate store_HL_direct_template = new_instruction_template("00100010", &store_HL_direct);
    add_instruction_template(store_HL_direct_template);

    InstructionTemplate load_accumulator_indirect_template = new_instruction_template("00RP1010", &load_accumulator_indirect);
    add_instruction_template(load_accumulator_indirect_template);

    InstructionTemplate store_accumulator_indirect_template = new_instruction_template("00RP0010", &store_accumulator_indirect);
    add_instruction_template(store_accumulator_indirect_template);

    InstructionTemplate exchange_HL_DE_template = new_instruction_template("11101011", &exchange_HL_DE);
    add_instruction_template(exchange_HL_DE_template);
}

void define_arithmetic_opcodes()
{
    // add
    InstructionTemplate add_register_template = new_instruction_template("10000SSS", &add_register);
    add_instruction_template(add_register_template);

    InstructionTemplate add_memory_template = new_instruction_template("10000110", &add_memory);
    add_instruction_template(add_memory_template);

    InstructionTemplate add_immediate_template = new_instruction_template("11000110", &add_immediate);
    add_instruction_template(add_immediate_template);

    InstructionTemplate add_register_with_carry_template = new_instruction_template("10001SSS", &add_register_with_carry);
    add_instruction_template(add_register_with_carry_template);

    InstructionTemplate add_memory_with_carry_template = new_instruction_template("10001110", &add_memory_with_carry);
    add_instruction_template(add_memory_with_carry_template);

    InstructionTemplate add_immediate_with_carry_template = new_instruction_template("11001110", &add_immediate_with_carry);
    add_instruction_template(add_immediate_with_carry_template);

    // sub
    InstructionTemplate sub_register_template = new_instruction_template("10010SSS", &sub_register);
    add_instruction_template(sub_register_template);

    InstructionTemplate sub_memory_template = new_instruction_template("10010110", &sub_memory);
    add_instruction_template(sub_memory_template);

    InstructionTemplate sub_immediate_template = new_instruction_template("11010110", &sub_immediate);
    add_instruction_template(sub_immediate_template);

    InstructionTemplate sub_register_with_borrow_template = new_instruction_template("10011SSS", &sub_register_with_borrow);
    add_instruction_template(sub_register_with_borrow_template);

    InstructionTemplate sub_memory_with_borrow_template = new_instruction_template("10011110", &sub_memory_with_borrow);
    add_instruction_template(sub_memory_with_borrow_template);

    InstructionTemplate sub_immediate_with_borrow_template = new_instruction_template("10011110", &sub_immediate_with_borrow);
    add_instruction_template(sub_immediate_with_borrow_template);

    // increment
    InstructionTemplate increment_register_template = new_instruction_template("00DDD100", &increment_register);
    add_instruction_template(increment_register_template);

    InstructionTemplate increment_memory_template = new_instruction_template("00110100", &increment_memory);
    add_instruction_template(increment_memory_template);

    InstructionTemplate decrement_register_template = new_instruction_template("00DDD101", &decrement_register);
    add_instruction_template(decrement_register_template);

    InstructionTemplate decrement_memory_template = new_instruction_template("00110101", &decrement_memory);
    add_instruction_template(decrement_memory_template);

    InstructionTemplate increment_register_pair_template = new_instruction_template("00RP0011", &increment_register_pair);
    add_instruction_template(increment_register_pair_template);

    InstructionTemplate decrement_register_pair_template = new_instruction_template("00RP1011", &decrement_register_pair);
    add_instruction_template(decrement_register_pair_template);

    InstructionTemplate add_register_pair_to_HL_template = new_instruction_template("00RP1001", &add_register_pair_to_HL);
    add_instruction_template(add_register_pair_to_HL_template);

    InstructionTemplate decimal_adjust_accumulator_template = new_instruction_template("00100111", &decimal_adjust_accumulator);
    add_instruction_template(decimal_adjust_accumulator_template);
}

void define_logical_opcodes()
{
    InstructionTemplate and_register_template = new_instruction_template("10100SSS", &and_register);
    add_instruction_template(and_register_template);

    InstructionTemplate and_memory_template = new_instruction_template("10100110", &and_memory);
    add_instruction_template(and_memory_template);

    InstructionTemplate and_immediate_template = new_instruction_template("11100110", &and_immediate);
    add_instruction_template(and_immediate_template);

    InstructionTemplate exclusive_or_register_template = new_instruction_template("10101SSS", &exclusive_or_register);
    add_instruction_template(exclusive_or_register_template);

    InstructionTemplate exclusive_or_memory_template = new_instruction_template("10101110", &exclusive_or_memory);
    add_instruction_template(exclusive_or_memory_template);

    InstructionTemplate exclusive_or_immediate_template = new_instruction_template("11101110", &exclusive_or_immediate);
    add_instruction_template(exclusive_or_immediate_template);

    InstructionTemplate or_register_template = new_instruction_template("10110SSS", &or_register);
    add_instruction_template(or_register_template);

    InstructionTemplate or_memory_template = new_instruction_template("10101110", &or_memory);
    add_instruction_template(or_memory_template);

    InstructionTemplate or_immediate_template = new_instruction_template("11101110", &or_immediate);
    add_instruction_template(or_immediate_template);

    InstructionTemplate compare_register_template = new_instruction_template("10111SSS", &compare_register);
    add_instruction_template(compare_register_template);

    InstructionTemplate compare_memory_template = new_instruction_template("10111110", &compare_memory);
    add_instruction_template(compare_memory_template);

    InstructionTemplate compare_immediate_template = new_instruction_template("11111110", &compare_immediate);
    add_instruction_template(compare_immediate_template);

    InstructionTemplate rotate_left_template = new_instruction_template("00000111", &rotate_left);
    add_instruction_template(rotate_left_template);

    InstructionTemplate rotate_right_template = new_instruction_template("00001111", &rotate_right);
    add_instruction_template(rotate_right_template);

    InstructionTemplate rotate_left_through_carry_template = new_instruction_template("00010111", &rotate_left_through_carry);
    add_instruction_template(rotate_left_through_carry_template);

    InstructionTemplate rotate_right_through_carry_template = new_instruction_template("00011111", &rotate_right_through_carry);
    add_instruction_template(rotate_right_through_carry_template);

    InstructionTemplate complement_accumulator_template = new_instruction_template("00101111", &complement_accumulator);
    add_instruction_template(complement_accumulator_template);

    InstructionTemplate complement_carry_template = new_instruction_template("00111111", &complement_carry);
    add_instruction_template(complement_carry_template);

    InstructionTemplate set_carry_template = new_instruction_template("00110111", &set_carry);
    add_instruction_template(set_carry_template);
}

void define_branch_opcodes()
{
    InstructionTemplate jump_template = new_instruction_template("11000011", &jump);
    add_instruction_template(jump_template);

    InstructionTemplate jump_condition_template = new_instruction_template("11CCC011", &jump_condition);
    add_instruction_template(jump_condition_template);

    InstructionTemplate call_template = new_instruction_template("11000011", &call);
    add_instruction_template(call_template);

    InstructionTemplate call_condition_template = new_instruction_template("11CCC100", &call_condition);
    add_instruction_template(call_condition_template);

    InstructionTemplate return_plain_template = new_instruction_template("11001001", &return_plain);
    add_instruction_template(return_plain_template);

    InstructionTemplate return_condition_template = new_instruction_template("11CCC000", &return_condition);
    add_instruction_template(return_condition_template);

    InstructionTemplate restart_template = new_instruction_template("11CCC111", &restart);
    add_instruction_template(restart_template);

    InstructionTemplate jump_HL_indirect_template = new_instruction_template("11101001", &jump_HL_indirect);
    add_instruction_template(jump_HL_indirect_template);
}

void define_miscellaneous_opcodes()
{
    InstructionTemplate push_register_pair_template = new_instruction_template("11RP0101", &push_register_pair);
    add_instruction_template(push_register_pair_template);

    InstructionTemplate push_processor_status_word_template = new_instruction_template("11110101", &push_processor_status_word);
    add_instruction_template(push_processor_status_word_template);

    InstructionTemplate pop_register_pair_template = new_instruction_template("11RP0001", &pop_register_pair);
    add_instruction_template(pop_register_pair_template);

    InstructionTemplate pop_processor_status_word_template = new_instruction_template("11110001", &pop_processor_status_word);
    add_instruction_template(pop_processor_status_word_template);

    InstructionTemplate exchange_stack_top_with_HL_template = new_instruction_template("11100011", &exchange_stack_top_with_HL);
    add_instruction_template(exchange_stack_top_with_HL_template);

    InstructionTemplate move_HL_to_SP_template = new_instruction_template("11111001", &move_HL_to_SP);
    add_instruction_template(move_HL_to_SP_template);

    InstructionTemplate input_template = new_instruction_template("11011011", &input);
    add_instruction_template(input_template);

    InstructionTemplate output_template = new_instruction_template("11010011", &output);
    add_instruction_template(output_template);

    InstructionTemplate enable_interrupts_template = new_instruction_template("11111011", &enable_interrupts);
    add_instruction_template(enable_interrupts_template);

    InstructionTemplate disable_interrupts_template = new_instruction_template("11110011", &disable_interrupts);
    add_instruction_template(disable_interrupts_template);

    InstructionTemplate halt_template = new_instruction_template("01110110", &halt);
    add_instruction_template(halt_template);

    InstructionTemplate nop_template = new_instruction_template("00000000", &nop);
    add_instruction_template(nop_template);
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

		<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
		<title>Jetty Server Project 6.1.22 Reference Package org.mortbay.jetty.client</title>
		<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="style" />

        	org.mortbay.jetty.client

Classes

            	Address

            	CachedExchange

            	Connector

            	ContentExchange

            	Handler

            	HttpClient

            	HttpConnection

            	HttpDestination

            	HttpEventListener

            	HttpEventListenerWrapper

            	HttpExchange

            	Listener

            	Manager

            	SelectConnector

            	SocketConnector

            	TimeoutTask

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

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

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling</artifactId>
        <version>30</version>
        <relativePath />
    </parent>

    <artifactId>org.apache.sling.jcr.resource</artifactId>
    <version>3.0.5-SNAPSHOT</version>
    <packaging>bundle</packaging>

    <name>Apache Sling JCR Resource Resolver</name>
    <description>
        This bundle provides the JCR based ResourceProvider.
    </description>

    <scm>
        <connection>
            scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource
        </connection>
        <developerConnection>
            scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource
        </developerConnection>
        <url>
            http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource
        </url>
    </scm>

    <properties>
        <site.jira.version.id>12314286</site.jira.version.id>
        <site.javadoc.exclude>**.internal.**</site.javadoc.exclude>
        <oak.version>1.5.15</oak.version>
        <jackrabbit.version>2.13.4</jackrabbit.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>maven-sling-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-adapter-metadata</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>generate-adapter-metadata</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Import-Package>
                            org.apache.sling.scripting.api.*;resolution:=optional,
                            *
                        </Import-Package>

                        <!-- Include utility classes from Jackrabbit JCR Commons -->
                        <Embed-Dependency>
                            jackrabbit-jcr-commons;inline="org/apache/jackrabbit/util/ISO8601.*|org/apache/jackrabbit/util/ISO9075.*|org/apache/jackrabbit/name/QName.*|org/apache/jackrabbit/util/XMLChar.*|org/apache/jackrabbit/util/Text.*",
                        </Embed-Dependency>

                        <Sling-Namespaces>
                            sling=http://sling.apache.org/jcr/sling/1.0
                        </Sling-Namespaces>

                        <Sling-Nodetypes>
                            SLING-INF/nodetypes/folder.cnd,
                            SLING-INF/nodetypes/resource.cnd,
                            SLING-INF/nodetypes/vanitypath.cnd,
                            SLING-INF/nodetypes/redirect.cnd,
                            SLING-INF/nodetypes/mapping.cnd
                        </Sling-Nodetypes>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
    <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

    <!-- JCR -->
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
        </dependency>

    <!-- OSGi -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component</artifactId>
            <version>1.3.0</version>
            <scope>provided</scope>
        </dependency>
    <!-- Jackrabbit / Oak -->
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>jackrabbit-api</artifactId>
            <version>${jackrabbit.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-jcr</artifactId>
            <version>${oak.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-core</artifactId>
            <version>${oak.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>jackrabbit-jcr-commons</artifactId>
            <version>${jackrabbit.version}</version>
            <scope>provided</scope>
        </dependency>

    <!-- Sling -->
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.jcr.api</artifactId>
            <version>2.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.api</artifactId>
            <version>2.16.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.api</artifactId>
            <version>2.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.classloader</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>adapter-annotations</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.serviceusermapper</artifactId>
            <version>1.3.4</version>
            <scope>provided</scope>
        </dependency>

        <!-- Findbugs annotations -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- For the Console Plugin of the JcrResourceResolverFactoryImpl -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.testing</artifactId>
            <version>2.0.24</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit-addons</groupId>
            <artifactId>junit-addons</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.api</artifactId>
            <version>2.16.3-SNAPSHOT</version>
        </dependency>
    </dependencies>
</project>


text:
<?php
namespace Jaculus;

class Exception extends \Exception {}


text:
module Conversys
  module FlyerServices
    module Image
      # GET {organizationCode}/{bannerCode}/Images/{Id}/{dimension}
      def get_images(org_code, banner_code, image_id, dimension)
        get "/#{org_code}/#{banner_code}/Images/#{image_id}/#{dimension}"
      end
    end
  end
end


text:
<?php
include_once("sql_connect.php");

$sql = new SQL_CONNECT();//实例化连接类
$sql->connection();//连接到数据库
$sql->set_laugue();//设置编码
$sql->choice();//选择数据库

error_reporting(E_ALL^E_NOTICE^E_WARNING);//关闭所有notice 和 warning 级别的错误
?>
<?php
$detailID = intval($_GET['detailID']);
$author_id = $_GET['author_id'];

$query = mysql_query("select * from member WHERE id='$author_id' limit 1");
while ($row = mysql_fetch_array($query)) {
    $all_collection = $row['collection'];
}

$domain = strstr($all_collection, "&$detailID");
if($domain){
    $arr['status']=true;
    mysql_query("update member set collection=replace(collection,'&$detailID','') WHERE `member`.`id` = '$author_id' limit 1");
    mysql_query("UPDATE `example`.`panorama` SET `collection` = `collection`-1 WHERE `panorama`.`id` = $detailID");
}else {
    $arr['status']=false;
    mysql_query("update member set collection=CONCAT(collection,'&$detailID') WHERE `member`.`id` = '$author_id' limit 1");
    mysql_query("UPDATE `example`.`panorama` SET `collection` = `collection`+1 WHERE `panorama`.`id` = $detailID");
}

$query2 = mysql_query("select collection from panorama where id=$detailID limit 1");

while ($row = mysql_fetch_array($query2)) {
    $arr['collection']=$row['collection'];
}

//print_r($arr);
echo json_encode($arr);


text:
package replicationcontroller

import (
	"github.com/astaxie/beego"
	"github.com/cloudawan/cloudone_gui/controllers/identity"
	"github.com/cloudawan/cloudone_utility/restclient"
)

type DeleteController struct {
	beego.Controller
}

// @Title delete
// @Description delete the replication controller
// @Param namespace path string true "The name of namespace"
// @Param replicationcontroller path string true "The name of replication controller"
// @Success 200 {string} {}
// @Failure 404 error reason
// @router /:namespace/:replicationcontroller [delete]
func (c *DeleteController) Delete() {
	namespace := c.GetString(":namespace")
	replicationcontroller := c.GetString(":replicationcontroller")

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/replicationcontrollers/" + namespace + "/" + replicationcontroller

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestDelete(url, nil, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		c.Data["json"] = make(map[string]interface{})
		c.Data["json"].(map[string]interface{})["error"] = err.Error()
		c.Ctx.Output.Status = 404
		c.ServeJSON()
		return
	} else {
		c.Data["json"] = make(map[string]interface{})
		c.ServeJSON()
	}
}


text:
<?php

namespace Neutron\Widget\SocialNetworksBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;

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
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
 */
class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritDoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('neutron_social_networks');

        $this->addGeneralConfigurations($rootNode);
        $this->addWidgetOptionsSection($rootNode);
        $this->addFormSection($rootNode);

        return $treeBuilder;
    }

    private function addGeneralConfigurations(ArrayNodeDefinition $node)
    {
        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->booleanNode('enable')->defaultFalse()->end()
                ->scalarNode('controller_administration')->defaultValue('neutron_social_networks.controller.administration.default')->end()
                ->scalarNode('controller_front')->defaultValue('neutron_social_networks.controller.front.default')->end()
                ->scalarNode('manager')->defaultValue('neutron_social_networks.manager.default')->end()
                ->scalarNode('translation_domain')->defaultValue('NeutronSocialNetworksBundle')->end()
                ->scalarNode('grid')->defaultValue('social_network_management')->end()
                ->scalarNode('social_network_class')->isRequired()->cannotBeEmpty()->end()
                ->scalarNode('template')->isRequired()->cannotBeEmpty()->end()
            ->end()
        ;
    }

    private function addWidgetOptionsSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->arrayNode('widget_options')
                    ->addDefaultsIfNotSet()
                        ->children()
                            ->booleanNode('plugin_aware')->defaultFalse()->end()
                            ->booleanNode('panel_aware')->defaultFalse()->end()
                            ->arrayNode('allowed_plugins')
                                ->prototype('scalar')->end()
                                ->defaultValue(array())
                            ->end()
                            ->arrayNode('allowed_panels')
                                ->prototype('scalar')->end()
                                ->defaultValue(array())
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }

    private function addFormSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->arrayNode('form')
                    ->addDefaultsIfNotSet()
                        ->children()
                            ->scalarNode('type')->defaultValue('neutron_social_network')->end()
                            ->scalarNode('handler')->defaultValue('neutron_social_networks.form.handler.social_network.default')->end()
                            ->scalarNode('name')->defaultValue('neutron_social_network')->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
}


text:
<?php

	namespace apf\iface\convertible{

		interface Vector{

			public function toArray();

		}

	}


text:
API listing follows standard diff formatting.
Lines preceded by a '+' are additions and a '-' indicates removal.

* [Microsoft.Win32](7.0-rc1_Microsoft.Win32.md)
* [System](7.0-rc1_System.md)
* [System.Buffers](7.0-rc1_System.Buffers.md)
* [System.ComponentModel](7.0-rc1_System.ComponentModel.md)
* [System.Data.SqlTypes](7.0-rc1_System.Data.SqlTypes.md)
* [System.Diagnostics](7.0-rc1_System.Diagnostics.md)
* [System.Diagnostics.CodeAnalysis](7.0-rc1_System.Diagnostics.CodeAnalysis.md)
* [System.Formats.Asn1](7.0-rc1_System.Formats.Asn1.md)
* [System.IO](7.0-rc1_System.IO.md)
* [System.Linq](7.0-rc1_System.Linq.md)
* [System.Net.Http.Json](7.0-rc1_System.Net.Http.Json.md)
* [System.Net.NetworkInformation](7.0-rc1_System.Net.NetworkInformation.md)
* [System.Numerics](7.0-rc1_System.Numerics.md)
* [System.Reflection](7.0-rc1_System.Reflection.md)
* [System.Reflection.Emit](7.0-rc1_System.Reflection.Emit.md)
* [System.Runtime](7.0-rc1_System.Runtime.md)
* [System.Runtime.InteropServices](7.0-rc1_System.Runtime.InteropServices.md)
* [System.Runtime.Serialization](7.0-rc1_System.Runtime.Serialization.md)
* [System.Runtime.Serialization.DataContracts](7.0-rc1_System.Runtime.Serialization.DataContracts.md)
* [System.Runtime.Serialization.Json](7.0-rc1_System.Runtime.Serialization.Json.md)
* [System.Runtime.Versioning](7.0-rc1_System.Runtime.Versioning.md)
* [System.Security.Cryptography](7.0-rc1_System.Security.Cryptography.md)
* [System.Security.Cryptography.X509Certificates](7.0-rc1_System.Security.Cryptography.X509Certificates.md)
* [System.Text.Json.Serialization](7.0-rc1_System.Text.Json.Serialization.md)
* [System.Text.Json.Serialization.Metadata](7.0-rc1_System.Text.Json.Serialization.Metadata.md)
* [System.Text.RegularExpressions](7.0-rc1_System.Text.RegularExpressions.md)
* [System.Transactions](7.0-rc1_System.Transactions.md)
* [System.Xml](7.0-rc1_System.Xml.md)
* [System.Xml.Serialization](7.0-rc1_System.Xml.Serialization.md)


text:
A configure tools supporting dynamic change of config for Erlang/OTP

## Overview

## Usage

### Use as a library
Add the following settings.

```erlang
%% rebar (rebar.config)

{deps,
  [
   {confoot, ".*", {git, "git://github.com/soranoba/confoot.git", {branch, "master"}}}
  ]}.

%% rebar3 (rebar.config)

{deps, [confoot]}.
```

## Contribute
Pull request is welcome =D

## License

[MIT License](LICENSE)


text:
package liquibase.command;

/**
 * Builder for configuring {@link CommandStep} settings, such as {@link CommandArgumentDefinition}s and {@link CommandResultDefinition}s
 */
public class CommandBuilder {

    private final String[][] commandNames;

    /**
     * Creates a builder for the given command name
     */
    public CommandBuilder(String[]... commandNames) {
        this.commandNames = commandNames;
    }

    /**
     * Starts the building of a new {@link CommandArgumentDefinition}.
     */
    public <DataType> CommandArgumentDefinition.Building<DataType> argument(String name, Class<DataType> type) {
        return new CommandArgumentDefinition.Building<>(commandNames, new CommandArgumentDefinition<>(name, type));
    }

    /**
     * Starts the building of a new {@link CommandResultDefinition}.
     */
    public <DataType> CommandResultDefinition.Building<DataType> result(String name, Class<DataType> type) {
        return new CommandResultDefinition.Building<>(new CommandResultDefinition<>(name, type));
    }
}


text:
using Nest;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace DataMartESImporter
{
    /// <summary>
    /// Main engine for inserting a list of "records" into an ElasticSearch db
    /// </summary>
    public class DataMartESImporter
    {
        //TODO: Maybe allow this to be toggled with a config setting
        private bool stopThisBusiness = false;
        private IList<string> filePathsToBeProcessed = new List<string>();
        private DateTime lastProcessedTimeRun;
        private DateTime lastProcessedTime
        {
            get
            {
                return this.lastProcessedTimeRun;
            }

            set
            {
                this.lastProcessedTimeRun = value;
            }
        }
        /// <summary>
        /// Initialize the DataMartESImporter
        /// </summary>
        public DataMartESImporter()
            : this(Log.GetLastRunTime())
        { }

        /// <summary>
        /// Initialize the DataMartESImporter
        /// </summary>
        public DataMartESImporter(DateTime lastProcessedTime)
        {
            this.lastProcessedTime = lastProcessedTime;
        }

        /// <summary>
        /// Start pulling data out of the files from the drop share and importing it into ElasticSearch
        /// </summary>
        public void StartSynchronization()
        {
            //Make sure you run this synchronously
            while (!stopThisBusiness)
            {
                Log runLog = Log.StartLog();
                StartDataImporterRunAsync(runLog);

                //Sleep
                System.Threading.Thread.Sleep(1000 * 60 * DataMartAppSettings.Default.SleepTimeInMinutes);
            }
        }

        private async Task StartDataImporterRunAsync(Log runLog)
        {
            try
            {
                runLog.LogMessage("Checking for new records to process");

                this.filePathsToBeProcessed = new List<string>();

                runLog.LogMessage("Finding all files in directory: " + ElasticSearchConnection.DropShare);

                //TODO: We should really sort files by DATE Ascending ideally so we process the older records first
                this.filePathsToBeProcessed = this.BuildUpListOfFilesToProcess(ElasticSearchConnection.DropShare, runLog);
                this.lastProcessedTime = DateTime.Now.ToUniversalTime(); //Mark our last processed time now

                foreach (string filePath in this.filePathsToBeProcessed)
                {
                    runLog.LogMessage("Generating list of records for file: " + filePath);

                    //Get all the Record objects from the specified file
                    //Records should formatted like the sample JSON file in solutino
                    IEnumerable<Record> recordsInAFile = Record.GenerateListOfRecordsFromJSONFile(filePath, runLog);
                    int recordsIndexedSuccessfully = 0;
                    int recordsNotIndexed = 0;
                    bool checkIndex = true;
                    runLog.LogMessage("Done generating records, preparing to index any records found in : " + filePath);

                    foreach (Record r in recordsInAFile)
                    {
                        //Only need to check to see if index exists the first time around
                        bool successfullyIndexed = await this.InsertAsync(r, filePath, runLog, checkIndex);
                        checkIndex = false;
                        if (successfullyIndexed)
                        {
                            recordsIndexedSuccessfully++;
                        }
                        else
                        {
                            recordsNotIndexed++;
                        }
                    }
                    runLog.LogMessage("Finished indexing " + recordsIndexedSuccessfully + " records in file: " + filePath);
                    if (recordsNotIndexed > 0)
                    {
                        runLog.LogMessage("Error - unable to index  " + recordsNotIndexed + " records in file: " + filePath, Log.MessageType.Error);
                    }
                }
                this.filePathsToBeProcessed.Clear();
                runLog.LogMessage("All done - Sleeping ");
            }

            finally
            {
                Log.LogLastRunTime(this.lastProcessedTime);
            }
        }

        /// <summary>
        /// Insert the record into the ElasticSearch Server now
        /// </summary>
        private async Task<bool> InsertAsync(Record recordToIndex, string filePath, Log runLog, bool checkIndex = true)
        {

            //If the index doesn't exist, we'll create it
            if (checkIndex)
            {
                if (!ElasticSearchConnection.ESClient.IndexExists(recordToIndex.indexName).Exists)
                {
                    var keywordA = new KeywordAnalyzer();
                    //We set the Default analyzer here to be "Keyword" type - so it will treat strings as "whole strings" and not as separate keywords
                    //very important for strings like "C#" or "Some long string"
                    ElasticSearchConnection.ESClient.CreateIndex(recordToIndex.indexName, x => x.Analysis(a => a.Analyzers(an => an.Add("default", keywordA))));
                }
            }

            Elasticsearch.Net.ElasticsearchResponse<Elasticsearch.Net.DynamicDictionary> response = null;
            JObject myObj = null;
            try
            {
                // See if we can parse the JSON and try to retrieve the _id field out of it
                myObj = JObject.Parse(recordToIndex.jsonString);
                if (myObj["_id"] != null)
                {
                    //If _id was specified then we'll just udpate the previous record automatically if there was one
                    string id = myObj["_id"].Value<String>();
                    response = await ElasticSearchConnection.ESClient.Raw.IndexAsync(recordToIndex.indexName, recordToIndex.typeName, id, recordToIndex.jsonString);
                    if (response.Success == false)
                    {
                        //The _id field of the JSON document is often problematic, so letting ES generate it's own ID field instead here might fix it
                        recordToIndex.jsonString = recordToIndex.jsonString.Replace("_id", "old_id");
                        // Try one more time to index now after renaming the _id field
                        response = await ElasticSearchConnection.ESClient.Raw.IndexAsync(recordToIndex.indexName, recordToIndex.typeName, recordToIndex.jsonString);
                        if (response.Success == true)
                        {
                            //renaming the _id field fixed the problem
                            runLog.LogMessage("Recovered from ERROR - But had to rename _id field to old_id to index record in " + filePath);
                        }
                    }
                }
                else
                {
                    // If they didn't specify an "_id" then that's fine just index it anyway
                    response = await ElasticSearchConnection.ESClient.Raw.IndexAsync(recordToIndex.indexName, recordToIndex.typeName, recordToIndex.jsonString);
                }
            }
            catch
            {
                //just couldn't parse the JSON, try to index it anyway
                response = ElasticSearchConnection.ESClient.Raw.Index(recordToIndex.indexName, recordToIndex.typeName, recordToIndex.jsonString);
            }

            if (response.Success == false)
            {
                //Failed to index a record
                runLog.LogMessage("Error: Failed to index a record in " + filePath, Log.MessageType.Error);
            }
            return response.Success;
        }

        /// <summary>
        /// Get a list of all JSON files in the drop share
        /// </summary>
        private IList<string> BuildUpListOfFilesToProcess(string path, Log runLog)
        {
            IList<string> listOfFilesToProcess = new List<string>();
            try
            {
                string[] allFiles = Directory.GetFiles(path, "*.json", SearchOption.AllDirectories);
                foreach (string file in allFiles)
                {
                    FileSystemInfo fileDetail = new FileInfo(file);
                    DateTime lastWriteTime = fileDetail.LastWriteTime;
                    if (lastWriteTime.ToUniversalTime() > this.lastProcessedTime)
                    { listOfFilesToProcess.Add(file); }
                }
            }
            catch (Exception e)
            {
                runLog.LogMessage("Exception - caught when building up a list of files to process: " + e.Message, Log.MessageType.Error);
            }
            return listOfFilesToProcess;
        }
    }
}


text:
struct ParametricSubmodularIBFS {
    typedef int NodeId;
    struct Clique {
        int Size() const;
        const std::vector<REAL>& AlphaCi() const;
        std::vector<REAL>& EnergyTable();
        const std::vector<REAL>& EnergyTable() const;
    };
    struct CliqueVec {
        Clique& operator[](int n);
        const Clique& operator[](int n) const;
    };
    void AddNode(int n);
    void AddConstantTerm(REAL c);
    void AddUnaryTerm(NodeId i, REAL E0, REAL E1);
    void AddClique(const std::vector<NodeId>& nodes, const std::vector<REAL>& energyTable, bool normalize);
    void GraphInit();
    void ClearUnaries();
    REAL GetConstantTerm();
    CliqueVec& GetCliques();

    void Solve();
    int GetLabel(NodeId i);
};

#endif


text:
			Posted on

			by


text:
<!DOCTYPE html>
<html>
  <head>
    <link href='/assets/css/{{ page.name }}.css' rel='stylesheet' type='text/css'>

    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Kanit:400,800,900' rel='stylesheet' type='text/css'>
    <link href="https://d1azc1qln24ryf.cloudfront.net/114779/Socicon/style-cf.css?u8vidh" rel='stylesheet' type='text/css'>

    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-120650974-1"></script>

    <title>Luis Vasconcellos</title>
  </head>

  <body>
    <section class="main">
      {{ content }}
    </section>

    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'UA-120650974-1');
    </script>
  </body>
</html>


text:
<BroadcastMonitor>
  <updated>2015-08-03T13:17:17</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime></startTime>
    <itemId></itemId>
    <titleId></titleId>
    <itemCode></itemCode>
    <itemReference></itemReference>
    <titleName></titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode></CategoryCode>
    <CategoryName></CategoryName>
    <itemDuration></itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-03T13:19:58</startTime>
    <itemId>1000080508:1240907</itemId>
    <titleId>216136440</titleId>
    <itemCode>10591</itemCode>
    <itemReference></itemReference>
    <titleName>El Miraglo</titleName>
    <artistName>Jungle by Night</artistName>
    <albumName></albumName>
    <CategoryCode>737</CategoryCode>
    <CategoryName>JAZZ</CategoryName>
    <itemDuration>226</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
package org.apache.directory.server.core.avltree;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import java.util.Comparator;

import org.apache.directory.api.ldap.model.cursor.InvalidCursorPositionException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

/**
 * Tests the ArrayTreeCursor class.
 *
 * @author Apache Directory Project
 */
@Execution(ExecutionMode.CONCURRENT)
public class ArrayTreeCursorTest
{
    @Test
    public void testEmptyCursor() throws Exception
    {
        ArrayTree<Integer> tree = new ArrayTree<Integer>( new IntegerComparator() );
        ArrayTreeCursor<Integer> cursor = new ArrayTreeCursor<Integer>( tree );

        assertFalse( cursor.isClosed() );
        assertFalse( cursor.available() );

        try
        {
            cursor.get();
            fail( "Should not get here" );
        }
        catch ( InvalidCursorPositionException e )
        {
            assertNotNull( e );
        }

        cursor.beforeFirst();
        assertFalse( cursor.available() );

        cursor.afterLast();
        assertFalse( cursor.available() );

        assertFalse( cursor.first() );
        assertFalse( cursor.available() );

        assertFalse( cursor.last() );
        assertFalse( cursor.available() );

        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        cursor.before( 3 );
        assertFalse( cursor.available() );

        cursor.after( 3 );
        assertFalse( cursor.available() );

        cursor.close();
        assertTrue( cursor.isClosed() );
    }

    @Test
    public void testOneEntryCursor() throws Exception
    {
        ArrayTree<Integer> tree = new ArrayTree<Integer>( new IntegerComparator() );
        tree.insert( 7 );
        ArrayTreeCursor<Integer> cursor = new ArrayTreeCursor<Integer>( tree );

        assertFalse( cursor.isClosed() );
        assertFalse( cursor.available() );

        try
        {
            cursor.get();
            fail( "Should not get here" );
        }
        catch ( InvalidCursorPositionException e )
        {
            assertNotNull( e );
        }

        cursor.beforeFirst();
        assertFalse( cursor.available() );
        assertFalse( cursor.previous() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.afterLast();
        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        assertTrue( cursor.first() );
        assertTrue( cursor.available() );

        assertTrue( cursor.last() );
        assertTrue( cursor.available() );

        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );

        cursor.before( 3 );
        assertFalse( cursor.available() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.before( 3 );
        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        cursor.after( 3 );
        assertFalse( cursor.available() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.after( 3 );
        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        cursor.before( 7 );
        assertFalse( cursor.available() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.before( 7 );
        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        cursor.after( 7 );
        assertFalse( cursor.available() );
        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        cursor.after( 7 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.before( 9 );
        assertFalse( cursor.available() );
        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        cursor.before( 9 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.close();
    }

    @Test
    public void testManyEntriesCursor() throws Exception
    {
        ArrayTree<Integer> tree = new ArrayTree<Integer>( new IntegerComparator() );
        tree.insert( 3 );
        tree.insert( 7 );
        tree.insert( 10 );
        tree.insert( 11 );
        ArrayTreeCursor<Integer> cursor = new ArrayTreeCursor<Integer>( tree );

        assertFalse( cursor.isClosed() );
        assertFalse( cursor.available() );
        assertEquals( 4, tree.size() );

        try
        {
            cursor.get();
            fail( "Should not get here" );
        }
        catch ( InvalidCursorPositionException e )
        {
            assertNotNull( e );
        }

        cursor.beforeFirst();
        assertFalse( cursor.available() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 10, ( int ) cursor.get() );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 11, ( int ) cursor.get() );
        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        cursor.afterLast();
        assertFalse( cursor.available() );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 11, ( int ) cursor.get() );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 10, ( int ) cursor.get() );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );
        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        assertTrue( cursor.first() );
        assertTrue( cursor.available() );

        assertTrue( cursor.last() );
        assertTrue( cursor.available() );

        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );

        // position before first object
        cursor.after( 2 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );

        cursor.after( 2 );
        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        // position on first object
        cursor.after( 3 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.after( 3 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );

        // position after first object
        cursor.after( 5 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.after( 5 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );

        // position before last object
        cursor.after( 10 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 11, ( int ) cursor.get() );

        cursor.after( 10 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 10, ( int ) cursor.get() );

        // position on last object
        cursor.after( 11 );
        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        cursor.after( 11 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 11, ( int ) cursor.get() );

        // position after last object
        cursor.after( 20 );
        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        cursor.after( 20 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 11, ( int ) cursor.get() );

        // position after last object
        cursor.before( 20 );
        assertFalse( cursor.next() );
        assertFalse( cursor.available() );

        cursor.before( 20 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 11, ( int ) cursor.get() );

        // position on last object
        cursor.before( 11 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 11, ( int ) cursor.get() );

        cursor.before( 11 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 10, ( int ) cursor.get() );

        // position before last object
        cursor.before( 10 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 10, ( int ) cursor.get() );

        cursor.before( 10 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        // position after first object
        cursor.before( 5 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 7, ( int ) cursor.get() );

        cursor.before( 5 );
        assertTrue( cursor.previous() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );

        // position on first object
        cursor.before( 3 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );

        cursor.before( 3 );
        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        // position before first object
        cursor.before( 2 );
        assertTrue( cursor.next() );
        assertTrue( cursor.available() );
        assertEquals( 3, ( int ) cursor.get() );

        cursor.before( 2 );
        assertFalse( cursor.previous() );
        assertFalse( cursor.available() );

        cursor.close();
    }

    class IntegerComparator implements Comparator<Integer>
    {
        public int compare( Integer o1, Integer o2 )
        {
            return o1.compareTo( o2 );
        }
    }
}


text:
<!doctype html>

	<title>Modulation - Web Audio Assembler</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="initial-scale=1., user-scalable=no, width=device-width"/>
  <link rel="stylesheet" href="assets/ss.css"/>

Web Audio Assembler Examples

4. Tremolo

		<canvas nx="keyboard"></canvas>


text:
/**
* Dependencies.
*/
var Hapi = require('hapi'),
    settings = require('./config/settings'),
    config = require('../../config');

// Create a server with a host, port, and options
var server = Hapi.createServer(config.gui.host, config.gui.port, settings.hapi.options);

// Bootstrap Hapi Server Plugins, passes the server object to the plugins
require('./config/plugins')(server, config);

// Require the routes and pass the server object.
var routes = require('./config/routes')(server);
// Add the server routes
server.route(routes);

if (!module.parent) {
    server.start(function() {
        var message = 'GUI started at: ' + server.info.uri;
        console.log(message);
    });
}

module.exports = server;


text:
/*
 *
 */
package net.community.chest.ui.components.dialog;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Frame;
import java.awt.GridLayout;
import java.lang.reflect.Method;
import java.util.Map;

import javax.swing.JPanel;
import javax.swing.text.JTextComponent;

import net.community.chest.awt.TypedComponentAssignment;
import net.community.chest.lang.ExceptionUtil;
import net.community.chest.reflect.AttributeAccessor;
import net.community.chest.reflect.AttributeMethodType;
import net.community.chest.ui.helpers.dialog.LRInputTextFieldsDialog;
import net.community.chest.ui.helpers.panel.input.LRFieldWithLabelInput;

import org.w3c.dom.Document;

/**
 *
Copyright as per GPLv2

 *
Uses reflection API to extract all fields that are of type {@link String}

 * @param <V> Type of value being reflected
 * @author Lyor G.
 * @since Nov 10, 2010 1:38:51 PM
 *
 */
public abstract class TextFieldsOptionsDialog<V> extends LRInputTextFieldsDialog<V> implements TypedComponentAssignment<V> {
    /**
     *
     */
    private static final long serialVersionUID = -5826457867445062220L;
    protected TextFieldsOptionsDialog (Frame owner, V value, Document doc, boolean autoInit)
    {
        super(owner, doc, autoInit);

        if (autoInit)
            setContent(value);
        else
            setAssignedValue(value);
    }

    protected TextFieldsOptionsDialog (Frame owner, V value, boolean autoInit)
    {
        this(owner, value, (Document) null, autoInit);
    }

    protected TextFieldsOptionsDialog (Frame owner, V value)
    {
        this(owner, value, true);
    }
    /*
     * @see net.community.chest.ui.helpers.dialog.LRInputTextFieldsDialog#layoutComponent()
     */
    @Override
    public void layoutComponent () throws RuntimeException
    {
        super.layoutComponent();
        layoutTextFieldsAccessors(getAccessorsMap(true));
    }

    protected void layoutTextFieldsAccessors (final Map<String,? extends AttributeAccessor> accsMap)
    {
        if ((accsMap == null) || (accsMap.size() <= 0))
            return;

        for (final Map.Entry<String,? extends AttributeAccessor> ae : accsMap.entrySet())
        {
            final String            name=(ae == null) ? null : ae.getKey();
            final AttributeAccessor    a=(ae == null) ? null : ae.getValue();
            final Method            g=(a == null) ? null : a.getGetter(),
                                    s=(a == null) ? null : a.getSetter();
            if ((name == null) || (name.length() <= 0) || (g == null))    // ignore write-only fields
                continue;

            final Class<?>    t=a.getType();
            if (t != String.class)    // ignore non-string fields
                continue;

            final LRFieldWithLabelInput    fld=createTextField(name, (s == null)),
                                        prev=addTextField(name, fld);
            if (prev != null)
                throw new IllegalStateException("Duplicate fields: " + name);
        }

        layoutTextFields(getFieldsMap(false));
    }

    protected void layoutTextFields (final Map<String,? extends LRFieldWithLabelInput>    fieldsMap)
    {
        if ((fieldsMap == null) || (fieldsMap.size() <= 0))
            return;

        final JPanel    optsPanel=new JPanel(new GridLayout(0, 1, 0, 5));
        for (final LRFieldWithLabelInput fld : fieldsMap.values())
        {
            if (fld == null)
                continue;
            optsPanel.add(fld);
        }

        final Container    ct=getContentPane();
        ct.add(optsPanel, BorderLayout.CENTER);
    }

    protected LRFieldWithLabelInput createTextField (final String name, final boolean readOnly)
    {
        final LRFieldWithLabelInput    fld=new LRFieldWithLabelInput();
        fld.setName(name);
        fld.setTitle(AttributeMethodType.getSpacedAttributeName(name));
        if (readOnly)
            fld.setEditable(false);

        return fld;
    }

    private V    _value;
    /*
     * @see net.community.chest.awt.TypedComponentAssignment#getAssignedValue()
     */
    @Override
    public V getAssignedValue ()
    {
        return _value;
    }
    /* NOTE: does not update the UI !!!
     * @see net.community.chest.awt.TypedComponentAssignment#setAssignedValue(java.lang.Object)
     */
    @Override
    public void setAssignedValue (V value)
    {
        _value = value;
    }
    /*
     * @see net.community.chest.ui.helpers.dialog.SettableDialog#setContent(java.lang.Object)
     */
    @Override
    public void setContent (final V value)
    {
        setAssignedValue(value);
        fromCurrentSettings(value);
    }

    protected abstract Map<String,AttributeAccessor> getAccessorsMap (boolean createIfNotExist);

    protected void fromCurrentSettings (final V value)
    {
        final Map<String,? extends LRFieldWithLabelInput>    fieldsMap=getFieldsMap(false);
        final Map<String,AttributeAccessor>                    accsMap=getAccessorsMap(true);
        if ((fieldsMap == null) || (fieldsMap.size() <= 0)
         || (accsMap == null) || (accsMap.size() <= 0))
            return;

        for (final Map.Entry<String,? extends LRFieldWithLabelInput> fe : fieldsMap.entrySet())
        {
            final String            name=fe.getKey();
            final AttributeAccessor    a=accsMap.get(name);
            final Method            g=(a == null) ? null : a.getGetter();
            if (g == null)    // no support for write-only fields
                throw new IllegalStateException("No getter for field=" + name);

            final LRFieldWithLabelInput    iField=fe.getValue();
            final JTextComponent        tField=iField.getTextField();
            try
            {
                final String    s=(String) g.invoke(value);
                tField.setText((s == null) ? "" : s);
            }
            catch(Exception e)
            {
                throw ExceptionUtil.toRuntimeException(e);
            }
        }
    }

    protected void toCurrentSettings (final V value)
    {
        final Map<String,? extends LRFieldWithLabelInput>    fieldsMap=getFieldsMap(false);
        final Map<String,AttributeAccessor>                    accsMap=getAccessorsMap(true);
        if ((fieldsMap == null) || (fieldsMap.size() <= 0)
         || (accsMap == null) || (accsMap.size() <= 0))
            return;

        for (final Map.Entry<String,? extends LRFieldWithLabelInput> fe : fieldsMap.entrySet())
        {
            final String            name=fe.getKey();
            final AttributeAccessor    a=accsMap.get(name);
            final Method            s=(a == null) ? null : a.getSetter();
            if (s == null)    // means it is a read-only attribute
                continue;

            final LRFieldWithLabelInput    iField=fe.getValue();
            final JTextComponent        tField=iField.getTextField();
            final String                txtValue=tField.getText();
            try
            {
                s.invoke(value, txtValue);
            }
            catch(Exception e)
            {
                throw ExceptionUtil.toRuntimeException(e);
            }
        }
    }
    /*
     * @see net.community.chest.ui.helpers.dialog.SettableDialog#clearContent()
     */
    @Override
    public void clearContent ()
    {
        setContent(null);
    }
    /*
     * @see net.community.chest.ui.helpers.dialog.SettableDialog#refreshContent(java.lang.Object)
     */
    @Override
    public void refreshContent (V value)
    {
        setContent(value);
    }
}


text:
module VagrantPlugins
  module Sakura
    module Action
      class MessageDown
        def initialize(app, env)
          @app = app
        end

        def call(env)
          env[:ui].info(I18n.t("vagrant_sakura.down"))
          @app.call(env)
        end
      end
    end
  end
end


text:
<?php

namespace salopot\attach\actions;

use Yii;
use salopot\attach\behaviors\AttachFileBehavior;
use yii\base\Action;
use yii\base\InvalidConfigException;
use yii\db\BaseActiveRecord;
use yii\web\NotFoundHttpException;

//url rule 'upload/images/<controller:company>/<behavior:\w+><levelPath:(/(\d|[a-f]){2}){0,16}>/<name:(\d|[a-f]){32}>_<type:\w+>.<ext>' => '<controller>/image',
class RenderImageAction extends Action {

    /**
     * @var ActiveRecord
     */
    public $modelClass = null;

    public function init()
    {
        if (!is_a($this->modelClass, BaseActiveRecord::className(), true) ) {
            throw new InvalidConfigException('ModelClass must be a subclass off BaseActiveRecord');
        }
    }

    public function run($name, $behavior, $type) {
        $levelPath = Yii::$app->request->get('levelPath', false);
        if ($levelPath) {
            $dirs = explode('/', trim($levelPath, '/'));
            for($i=0; $i<count($dirs); $i++) {
                if ($dirs[$i] !== substr($name, $i*2, 2) ) {
                    throw new NotFoundHttpException('The requested page does not exist.');
                }
            }
        }

        $baseModel = (new $this->modelClass);
        $baseBehavior = $baseModel->getBehavior($behavior);
        if ($baseBehavior && ($baseBehavior instanceof AttachFileBehavior)) {

            $model = $baseModel::find()
                //for using index
                ->andWhere(['LIKE' , $baseBehavior->attributeName, strtr($name,['%'=>'\%', '_'=>'\_', '\\'=>'\\\\']).'%', false])
                ->one();
            if ($model && $model->getBehavior($behavior)->hasType($type)) {
                return $model->getBehavior($behavior)->render($type);
            }
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

}


text:
<project name="build-dp" default="build-dp" basedir="../../../../">

	<target name="build-dp">
    	<echo message="Building DP in ${basedir}" />

		<!-- Create the manifest -->
		<echo file="${project.build.directory}/dp_stage/META-INF/MANIFEST.MF" append="false">Manifest-Version: 1.0
DeploymentPackage-SymbolicName: org.darugna.kura.weblog
DeploymentPackage-Version: 1.1.1

Name: bundles/org.darugna.kura.weblog_1.1.1.jar
Bundle-SymbolicName: org.darugna.kura.weblog;singleton:=true
Bundle-Version: 1.1.1
</echo>

		<!-- move everything into place -->
		<echo message="Copying org.darugna.kura.weblog" />
        <copy    file="${basedir}/../org.darugna.kura.weblog/target/org.darugna.kura.weblog_1.1.1.jar"
                 todir="${project.build.directory}/dp_stage/bundles/" />

		<!-- Files MUST be included in the jar in the same order as they are declared in the DP MANIFEST.
			I used alphabetical order. -->
		<!-- https://ant.apache.org/manual/Tasks/jar.html -->
		<local name="sortedFiles"/>
		<pathconvert property="sortedFiles" pathsep="${line.separator}">
			<sort>
				<fileset dir="${project.build.directory}/dp_stage/" includes="bundles/*"/>
			</sort>
		</pathconvert>

		 <echo message="Generating DP with files:${line.separator}${sortedFiles}" />

		<!-- http://stackoverflow.com/questions/6341285/ant-sort-files-in-generated-jar
		https://github.com/apache/felix/blob/b2fbc90c5cbcba405c8392c70c808c02728f6dc1/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/UpdateCommand.java
		-->
		<!-- Do NOT include directory entries in the JAR, only the files.
			First, the MANIFEST.
			Then, bundles in the correct order -->
		<jar destfile="${basedir}/../org.darugna.kura.weblog_1.1.1.dp"
				manifest="${project.build.directory}/dp_stage/META-INF/MANIFEST.MF"
				includes="" filesonly="true">
			<filelist dir="${project.build.directory}/dp_stage/" files="${sortedFiles}"/>
		</jar>

    </target>

</project>


text:
int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([CBCAppDelegate class]));
    }
}


text:
import React from 'react';
import { GenericDataType, t, validateNumber } from '@superset-ui/core';
import { FaAlignLeft } from '@react-icons/all-files/fa/FaAlignLeft';
import { FaAlignRight } from '@react-icons/all-files/fa/FaAlignRight';
import { FaAlignCenter } from '@react-icons/all-files/fa/FaAlignCenter';
import {
  D3_FORMAT_DOCS,
  D3_FORMAT_OPTIONS,
  D3_TIME_FORMAT_DOCS,
  D3_TIME_FORMAT_OPTIONS,
} from '../../../utils';
import { ControlFormItemSpec } from '../../../components/ControlForm';
import { ColumnConfigFormLayout } from './types';

export type SharedColumnConfigProp =
  | 'alignPositiveNegative'
  | 'colorPositiveNegative'
  | 'columnWidth'
  | 'fractionDigits'
  | 'emitTarget'
  | 'd3NumberFormat'
  | 'd3SmallNumberFormat'
  | 'd3TimeFormat'
  | 'horizontalAlign'
  | 'truncateLongCells'
  | 'showCellBars';

const emitTarget: ControlFormItemSpec<'Input'> = {
  controlType: 'Input',
  label: t('Emit Target'),
  description: t(
    'If you wish to specify a different target column than the original column, it can be entered here',
  ),
  defaultValue: '',
  debounceDelay: 500,
  validators: undefined,
};

const d3NumberFormat: ControlFormItemSpec<'Select'> = {
  controlType: 'Select',
  label: t('D3 format'),
  description: D3_FORMAT_DOCS,
  options: D3_FORMAT_OPTIONS,
  defaultValue: D3_FORMAT_OPTIONS[0][0],
  creatable: true,
  minWidth: '14em',
  debounceDelay: 500,
};

const d3TimeFormat: ControlFormItemSpec<'Select'> = {
  controlType: 'Select',
  label: t('D3 format'),
  description: D3_TIME_FORMAT_DOCS,
  options: D3_TIME_FORMAT_OPTIONS,
  defaultValue: D3_TIME_FORMAT_OPTIONS[0][0],
  creatable: true,
  minWidth: '10em',
  debounceDelay: 500,
};

const fractionDigits: ControlFormItemSpec<'Slider'> = {
  controlType: 'Slider',
  label: t('Fraction digits'),
  description: t('Number of decimal digits to round numbers to'),
  min: 0,
  step: 1,
  max: 100,
  defaultValue: 100,
};

const columnWidth: ControlFormItemSpec<'InputNumber'> = {
  controlType: 'InputNumber',
  label: t('Min Width'),
  description: t(
    "Default minimal column width in pixels, actual width may still be larger than this if other columns don't need much space",
  ),
  width: 120,
  placeholder: 'auto',
  debounceDelay: 400,
  validators: [validateNumber],
};

const horizontalAlign: ControlFormItemSpec<'RadioButtonControl'> & {
  value?: 'left' | 'right' | 'center';
  defaultValue?: 'left' | 'right' | 'center';
} = {
  controlType: 'RadioButtonControl',
  label: t('Text align'),
  description: t('Horizontal alignment'),
  width: 130,
  debounceDelay: 50,
  defaultValue: 'left',
  options: [
    ['left', <FaAlignLeft title={t('Left')} />],
    ['center', <FaAlignCenter title={t('Center')} />],
    ['right', <FaAlignRight title={t('Right')} />],
  ],
};

const showCellBars: ControlFormItemSpec<'Checkbox'> = {
  controlType: 'Checkbox',
  label: t('Show cell bars'),
  description: t('Whether to display a bar chart background in table columns'),
  defaultValue: true,
  debounceDelay: 200,
};

const alignPositiveNegative: ControlFormItemSpec<'Checkbox'> = {
  controlType: 'Checkbox',
  label: t('Align +/-'),
  description: t(
    'Whether to align positive and negative values in cell bar chart at 0',
  ),
  defaultValue: false,
  debounceDelay: 200,
};

const colorPositiveNegative: ControlFormItemSpec<'Checkbox'> = {
  controlType: 'Checkbox',
  label: t('Color +/-'),
  description: t(
    'Whether to colorize numeric values by if they are positive or negative',
  ),
  defaultValue: false,
  debounceDelay: 200,
};

const truncateLongCells: ControlFormItemSpec<'Checkbox'> = {
  controlType: 'Checkbox',
  label: t('Truncate Cells'),
  description: t('Truncate long cells to the "min width" set above'),
  defaultValue: false,
  debounceDelay: 400,
};

/**
 * All configurable column formatting properties.
 */
export const SHARED_COLUMN_CONFIG_PROPS = {
  d3NumberFormat,
  emitTarget,
  d3SmallNumberFormat: {
    ...d3NumberFormat,
    label: t('Small number format'),
    description: t(
      'D3 number format for numbers between -1.0 and 1.0, ' +
        'useful when you want to have different siginificant digits for small and large numbers',
    ),
  },
  d3TimeFormat,
  fractionDigits,
  columnWidth,
  truncateLongCells,
  horizontalAlign,
  showCellBars,
  alignPositiveNegative,
  colorPositiveNegative,
};

export type SharedColumnConfig = {
  [key in SharedColumnConfigProp]?: typeof SHARED_COLUMN_CONFIG_PROPS[key]['value'];
};

export const DEFAULT_CONFIG_FORM_LAYOUT: ColumnConfigFormLayout = {
  [GenericDataType.STRING]: [
    [
      'columnWidth',
      { name: 'horizontalAlign', override: { defaultValue: 'left' } },
    ],
    ['truncateLongCells'],
  ],
  [GenericDataType.NUMERIC]: [
    [
      'columnWidth',
      { name: 'horizontalAlign', override: { defaultValue: 'right' } },
    ],
    ['d3NumberFormat'],
    ['d3SmallNumberFormat'],
    ['alignPositiveNegative', 'colorPositiveNegative'],
    ['showCellBars'],
  ],
  [GenericDataType.TEMPORAL]: [
    [
      'columnWidth',
      { name: 'horizontalAlign', override: { defaultValue: 'left' } },
    ],
    ['d3TimeFormat'],
  ],
  [GenericDataType.BOOLEAN]: [
    [
      'columnWidth',
      { name: 'horizontalAlign', override: { defaultValue: 'left' } },
    ],
  ],
};


text:
package com.lnidigitalmarketing.aacc.core;

import java.io.Serializable;

public class News implements Serializable {

    private static final long serialVersionUID = -6641292855569752036L;

    private String title;
    private String content;
    private String objectId;

    public String getTitle() {
        return title;
    }

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

    public String getContent() {
        return content;
    }

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

    public String getObjectId() {
        return objectId;
    }

    public void setObjectId(final String objectId) {
        this.objectId = objectId;
    }
}


text:
/*
 *
 */

module.exports = function (tabList) {

  "use strict";

	//create module instance
	var self = Ti.UI.createTabGroup();

	var idx, max;

	for (idx = 0, max = tabList.length; idx < max; idx += 1) {

    var tabInfo = tabList[idx],
		    label = L(tabInfo.name),
		    win = new tabInfo.window(label);

		var tab = Ti.UI.createTab({
			title: label,
			icon: tabInfo.icon,
			window: win
		});

		win.containingTab = tab;
		self.addTab(tab);
	}

  // close the tab group on logout
  Ti.App.addEventListener("authentication:logout", function (e) {
    self.close();
  });

	return self;
}


text:
{% extends 'feedback_base.html' %}

{% load jsonify %}

{% block header_block %}{% endblock %}

{% block content_block %}
    {% if help_text %}

Documentation

        {{ help_text|safe }}
    {% endif %}

Emulate POST request

    <form class="pure-form pure-form-stacked" action="" method="post" enctype='application/json'>
        <fieldset>
            <legend>Feedback</legend>
            <input type="text" name="username" placeholder="User Name">
            <input type="text" name="email" placeholder="E-mail">
            <textarea name="text" cols="60" rows="10"></textarea>
            <button type="submit" class="pure-button pure-button-primary">Send</button>
        </fieldset>
        {% csrf_token %}
    </form>
{% endblock %}


text:
<title>PowerPC Features - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Standard-Target-Features.html#Standard-Target-Features" title="Standard Target Features">
<link rel="prev" href="M68K-Features.html#M68K-Features" title="M68K Features">
<link rel="next" href="TIC6x-Features.html#TIC6x-Features" title="TIC6x Features">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Next: TIC6x Features,
Previous: M68K Features,
Up: Standard Target Features

G.4.6 PowerPC Features

The ‘<samp>org.gnu.gdb.power.core</samp>’ feature is required for PowerPC
targets.  It should contain registers ‘<samp>r0</samp>’ through ‘<samp>r31</samp>’,
‘<samp>pc</samp>’, ‘<samp>msr</samp>’, ‘<samp>cr</samp>’, ‘<samp>lr</samp>’, ‘<samp>ctr</samp>’, and
‘<samp>xer</samp>’.  They may be 32-bit or 64-bit depending on the target.

The ‘<samp>org.gnu.gdb.power.fpu</samp>’ feature is optional.  It should
contain registers ‘<samp>f0</samp>’ through ‘<samp>f31</samp>’ and ‘<samp>fpscr</samp>’.

The ‘<samp>org.gnu.gdb.power.altivec</samp>’ feature is optional.  It should
contain registers ‘<samp>vr0</samp>’ through ‘<samp>vr31</samp>’, ‘<samp>vscr</samp>’,
and ‘<samp>vrsave</samp>’.

The ‘<samp>org.gnu.gdb.power.vsx</samp>’ feature is optional.  It should
contain registers ‘<samp>vs0h</samp>’ through ‘<samp>vs31h</samp>’.  gdb
will combine these registers with the floating point registers
(‘<samp>f0</samp>’ through ‘<samp>f31</samp>’) and the altivec registers (‘<samp>vr0</samp>’
through ‘<samp>vr31</samp>’) to present the 128-bit wide registers ‘<samp>vs0</samp>’
through ‘<samp>vs63</samp>’, the set of vector registers for POWER7.

The ‘<samp>org.gnu.gdb.power.spe</samp>’ feature is optional.  It should
contain registers ‘<samp>ev0h</samp>’ through ‘<samp>ev31h</samp>’, ‘<samp>acc</samp>’, and
‘<samp>spefscr</samp>’.  SPE targets should provide 32-bit registers in
‘<samp>org.gnu.gdb.power.core</samp>’ and provide the upper halves in
‘<samp>ev0h</samp>’ through ‘<samp>ev31h</samp>’.  gdb will combine
these to present registers ‘<samp>ev0</samp>’ through ‘<samp>ev31</samp>’ to the
user.


text:
using MazeGenAndPathFinding.Models;

namespace MazeGenAndPathFinding.Extensions
{
    public static class Extensions
    {
        /// <summary>
        /// Finds the opposite <see cref="Direction"/> of <paramref name="direction"/>.
        /// </summary>
        /// <param name="direction">The <see cref="Direction"/> to find the opposite of.</param>
        /// <returns>The direction opposite of <paramref name="direction"/>.</returns>
        public static Direction GetOpposite(this Direction direction)
        {
            return (Direction)(((int)direction + 2) % 4);
        }
    }
}


text:
from . import default

ANGULAR_TOKENS = {
    'VARIABLE_OPEN': '{{ ',
    'VARIABLE_CLOSE': ' }}'
}

DEFAULT_SERIALIZER_CLASS = default.Serializer
DEFAULT_RENDERER_CLASS = default.Renderer


text:
#include "QmitkRegisterClasses.h"
#include "QmitkRenderWindow.h"

#include <mitkStandaloneDataStorage.h>
#include <mitkProperties.h>
#include <mitkTransferFunction.h>
#include <mitkTransferFunctionProperty.h>
#include <mitkRenderingManager.h>
#include <mitkIOUtil.h>

#include <itksys/SystemTools.hxx>

#include <QApplication>

//##Documentation
//## @brief Change the type of display to 3D
//##
//## As in Step2, load one or more data sets (many image, surface
//## and other formats), but display it in a 3D view.
//## The QmitkRenderWindow is now used for displaying a 3D view, by
//## setting the used mapper-slot to Standard3D.
//## Since volume-rendering is a (rather) slow procedure, the default
//## is that images are not displayed in the 3D view. For this example,
//## we want volume-rendering, thus we switch it on by setting
//## the Boolean-property "volumerendering" to "true".
int main(int argc, char* argv[])
{
  QApplication qtapplication( argc, argv );
  if(argc<2)
  {
    fprintf( stderr, "Usage:   %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str() );
    return 1;
  }

  // Register Qmitk-dependent global instances
  QmitkRegisterClasses();

  //*************************************************************************
  // Part I: Basic initialization
  //*************************************************************************

  // Create a DataStorage
  mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();

  //*************************************************************************
  // Part II: Create some data by reading files
  //*************************************************************************
  int i;
  for(i=1; i<argc; ++i)
  {
    // For testing
    if(strcmp(argv[i], "-testing")==0) continue;

      //*********************************************************************
      // Part III: Put the data into the datastorage
      //*********************************************************************
    // Load datanode (eg. many image formats, surface formats, etc.)
    mitk::StandaloneDataStorage::SetOfObjects::Pointer dataNodes = mitk::IOUtil::Load(argv[i],*ds);

    if(dataNodes->empty())
    {
      fprintf( stderr, "Could not open file %s \n\n", argv[i] );
      exit(2);
    }
    mitk::DataNode::Pointer node = dataNodes->at(0);

      // *********************************************************
      // ****************** START OF NEW PART 1 ******************
      // *********************************************************

      //*********************************************************************
      // Part IV: We want all images to be volume-rendered
      //*********************************************************************

      // Check if the data is an image by dynamic_cast-ing the data
      // contained in the node. Warning: dynamic_cast's are rather slow,
      // do not use it too often!
      mitk::Image::Pointer image = dynamic_cast<mitk::Image*>(node->GetData());
      if(image.IsNotNull())
      {
        // Set the property "volumerendering" to the Boolean value "true"
        node->SetProperty("volumerendering", mitk::BoolProperty::New(true));

        // Create a transfer function to assign optical properties (color and opacity) to grey-values of the data
        mitk::TransferFunction::Pointer tf = mitk::TransferFunction::New();
        tf->InitializeByMitkImage ( image );

        // Set the color transfer function AddRGBPoint(double x, double r, double g, double b)
        tf->GetColorTransferFunction()->AddRGBPoint ( tf->GetColorTransferFunction()->GetRange() [0], 1.0, 0.0, 0.0 );
        tf->GetColorTransferFunction()->AddRGBPoint ( tf->GetColorTransferFunction()->GetRange() [1], 1.0, 1.0, 0.0 );

        // Set the piecewise opacity transfer function AddPoint(double x, double y)
        tf->GetScalarOpacityFunction()->AddPoint ( 0, 0 );
        tf->GetScalarOpacityFunction()->AddPoint ( tf->GetColorTransferFunction()->GetRange() [1], 1 );

        node->SetProperty ( "TransferFunction", mitk::TransferFunctionProperty::New ( tf.GetPointer() ) );
      }

      // *********************************************************
      // ******************* END OF NEW PART 1 *******************
      // *********************************************************
  }

  //*************************************************************************
  // Part V: Create window and pass the tree to it
  //*************************************************************************

  // Create a renderwindow
  QmitkRenderWindow renderWindow;

  // Tell the renderwindow which (part of) the datastorage to render
  renderWindow.GetRenderer()->SetDataStorage(ds);

  // *********************************************************
  // ****************** START OF NEW PART 2 ******************
  // *********************************************************
  // Use it as a 3D view!
  renderWindow.GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard3D);

  // *********************************************************
  // ******************* END OF NEW PART 2 *******************
  // *********************************************************

  //*************************************************************************
  // Part VI: Qt-specific initialization
  //*************************************************************************
  renderWindow.show();
  renderWindow.resize( 256, 256 );

  mitk::RenderingManager::GetInstance()->RequestUpdateAll();

  // for testing
  #include "QtTesting.h"
  if(strcmp(argv[argc-1], "-testing")!=0)
    return qtapplication.exec();
  else
    return QtTesting();
}

/**
\example Step3.cpp
*/


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

-->
<web-app id="eSolutions_web_source" version="3.0"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

    <display-name>eSolutions_web_source</display-name>
    <description>eSolutions_web_source</description>
    <distributable />

    <context-param>
        <param-name>eSolutionsCoreConfig</param-name>
        <param-value>eSolutionsCore/config/ServiceConfig.xml</param-value>
    </context-param>
    <context-param>
        <param-name>eSolutionsCoreLogger</param-name>
        <param-value>eSolutionsCore/logging/logging.xml</param-value>
    </context-param>
    <context-param>
        <param-name>SecurityServiceConfig</param-name>
        <param-value>SecurityService/config/ServiceConfig.xml</param-value>
    </context-param>
    <context-param>
        <param-name>SecurityServiceLogger</param-name>
        <param-value>SecurityService/logging/logging.xml</param-value>
    </context-param>
    <context-param>
        <param-name>defaultHtmlEscape</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.locale</param-name>
        <param-value>en</param-value>
    </context-param>
    <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
        <param-value>en</param-value>
    </context-param>

    <listener>
        <listener-class>com.cws.esolutions.security.listeners.SecurityServiceListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.cws.esolutions.core.listeners.CoreServiceListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>

    <filter id="ResponseTimeFilter">
        <description>Response Timing Filter</description>
        <display-name>ResponseTimeFilter</display-name>
        <filter-name>ResponseTimeFilter</filter-name>
        <filter-class>com.cws.esolutions.core.filters.ResponseTimeFilter</filter-class>
    </filter>
    <filter id="SessionFixationFilter">
        <description>Session Fixation Filter</description>
        <display-name>SessionFixationFilter</display-name>
        <filter-name>SessionFixationFilter</filter-name>
        <filter-class>com.cws.esolutions.security.filters.SessionFixationFilter</filter-class>
    </filter>
    <filter id="SpringEncodingFilter">
        <description>Spring Encoding Filter</description>
        <display-name>SpringEncodingFilter</display-name>
        <filter-name>encoding-filter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>

    <filter-mapping id="ResponseTimeFilter_mapping">
        <filter-name>ResponseTimeFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping id="SessionFixationFilter_mapping">
        <filter-name>SessionFixationFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping id="SpringEncodingFilter_mapping">
        <filter-name>encoding-filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <servlet id="eSolutions_servlet">
        <display-name>eSolutions</display-name>
        <servlet-name>eSolutions</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:eSolutions/eSolutions-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping id="eSolutions_mapping">
        <servlet-name>eSolutions</servlet-name>
        <url-pattern>/ui/*</url-pattern>
    </servlet-mapping>

    <resource-ref id="esolutions">
        <description>Application Datasource</description>
        <res-ref-name>jdbc/esolutions</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Unshareable</res-sharing-scope>
    </resource-ref>
    <resource-ref id="esolutionssvc">
        <description>Application Datasource</description>
        <res-ref-name>jdbc/esolutionssvc</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Unshareable</res-sharing-scope>
    </resource-ref>
    <resource-ref id="cwssec">
        <description>Application Datasource</description>
        <res-ref-name>jdbc/cwssec</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Unshareable</res-sharing-scope>
    </resource-ref>
    <resource-ref id="mail">
        <description>Mail Service</description>
        <res-ref-name>mail/MailSession</res-ref-name>
        <res-type>javax.mail.Session</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Unshareable</res-sharing-scope>
    </resource-ref>

    <error-page>
        <error-code>400</error-code>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>
    <error-page>
        <error-code>401</error-code>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>
    <error-page>
        <error-code>405</error-code>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>
    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/theme/cws/html/en/jsp/errHandler.jsp</location>
    </error-page>

    <welcome-file-list>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>

    <jsp-config>
        <jsp-property-group>
            <description>jsp-group</description>
            <display-name>jsp-group</display-name>
            <url-pattern>/*</url-pattern>
            <page-encoding>UTF-8</page-encoding>
            <include-prelude>/theme/cws/html/en/jsp/header.jsp</include-prelude>
            <include-coda>/theme/cws/html/en/jsp/footer.jsp</include-coda>
        </jsp-property-group>
    </jsp-config>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>JSP-NoAccess</web-resource-name>
            <description>No access to JSP files</description>
            <url-pattern>*.jsp</url-pattern>
        </web-resource-collection>
        <web-resource-collection>
            <web-resource-name>Secure URLs</web-resource-name>
            <description>Enforce SSL</description>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <!--<user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>-->
    </security-constraint>

    <session-config>
        <session-timeout>15</session-timeout>
        <cookie-config>
            <http-only>true</http-only>
            <secure>true</secure>
            <max-age>900</max-age>
        </cookie-config>
        <tracking-mode>COOKIE</tracking-mode>
    </session-config>
</web-app>


text:
from gaiatest import GaiaTestCase

class TestFMRadioTurnOnOff(GaiaTestCase):

    _power_button_locator = ('id', 'power-switch')

    def setUp(self):
        GaiaTestCase.setUp(self)

        # launch the FM Radio app
        self.app = self.apps.launch('FM Radio')

    def test_turn_radio_on_off(self):
        """ Turn off and then Turn on the radio

        https://moztrap.mozilla.org/manage/case/1930/
        https://moztrap.mozilla.org/manage/case/1931/

        """
        # check the headphone is plugged-in or not
        self.assertTrue(self.data_layer.is_antenna_available, 'Antenna (headphones) not plugged in')

        # wait for the radio start-up
        self.wait_for_condition(lambda m: self.data_layer.is_fm_radio_enabled)

        # turn the radio off
        power_button = self.marionette.find_element(*self._power_button_locator)
        self.marionette.tap(power_button)

        # check the radio is off
        self.wait_for_condition(lambda m: power_button.get_attribute('data-enabled') == 'false')
        self.assertFalse(self.data_layer.is_fm_radio_enabled)

        # turn the radio on
        self.marionette.tap(power_button)
        self.wait_for_condition(lambda m: self.data_layer.is_fm_radio_enabled)

        # check the radio is on
        self.assertEqual(power_button.get_attribute('data-enabled'), 'true')
        self.assertTrue(self.data_layer.is_fm_radio_enabled)

    def tearDown(self):
        # turn off the radio
        power_button = self.marionette.find_element(*self._power_button_locator)
        self.marionette.tap(power_button)

        # close the app
        if self.app:
            self.apps.kill(self.app)

        GaiaTestCase.tearDown(self)


text:
package de.otto.edison.status.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import net.jcip.annotations.Immutable;

import java.time.OffsetDateTime;

import static java.time.Duration.between;
import static java.time.OffsetDateTime.now;
import static java.time.format.DateTimeFormatter.ISO_DATE_TIME;

@Immutable
@JsonIgnoreProperties(ignoreUnknown = true)
public class SystemInfo {

    private static final OffsetDateTime START_TIME = now();

    public final String hostname;
    public final int port;

    private SystemInfo(final String hostname, final int port) {
        this.hostname = hostname;
        this.port = port;
    }

    public static SystemInfo systemInfo(final String hostname, final int port) {
        return new SystemInfo(hostname, port);
    }

    public String getHostname() {
        return hostname;
    }

    public String getSystemTime() {
        return now().format(ISO_DATE_TIME);
    }

    public String getSystemStartTime() {
        return START_TIME.format(ISO_DATE_TIME);
    }

    public String getSystemUpTime() {
        final long seconds = between(START_TIME, now()).getSeconds();
        return String.format("%d:%02d:%02d", seconds / 3600, (seconds % 3600) / 60, (seconds % 60));
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemInfo that = (SystemInfo) o;

        if (port != that.port) return false;
        return !(hostname != null ? !hostname.equals(that.hostname) : that.hostname != null);

    }

    @Override
    public int hashCode() {
        int result = hostname != null ? hostname.hashCode() : 0;
        result = 31 * result + port;
        return result;
    }

    @Override
    public String toString() {
        return "SystemInfo{" +
                "hostname='" + hostname + '\'' +
                ", port=" + port +
                '}';
    }
}


text:
namespace glm
{
	/// 4 columns of 4 components matrix of low qualifier floating-point numbers.
	/// There is no guarantee on the actual qualifier.
	///
	/// @see GLSL 4.20.8 specification, section 4.1.6 Matrices
	/// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier
	typedef mat<4, 4, float, lowp>		lowp_mat4;

	/// 4 columns of 4 components matrix of medium qualifier floating-point numbers.
	/// There is no guarantee on the actual qualifier.
	///
	/// @see GLSL 4.20.8 specification, section 4.1.6 Matrices
	/// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier
	typedef mat<4, 4, float, mediump>		mediump_mat4;

	/// 4 columns of 4 components matrix of high qualifier floating-point numbers.
	/// There is no guarantee on the actual qualifier.
	///
	/// @see GLSL 4.20.8 specification, section 4.1.6 Matrices
	/// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier
	typedef mat<4, 4, float, highp>		highp_mat4;

	/// 4 columns of 4 components matrix of low qualifier floating-point numbers.
	/// There is no guarantee on the actual qualifier.
	///
	/// @see GLSL 4.20.8 specification, section 4.1.6 Matrices
	/// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier
	typedef mat<4, 4, float, lowp>		lowp_mat4x4;

	/// 4 columns of 4 components matrix of medium qualifier floating-point numbers.
	/// There is no guarantee on the actual qualifier.
	///
	/// @see GLSL 4.20.8 specification, section 4.1.6 Matrices
	/// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier
	typedef mat<4, 4, float, mediump>		mediump_mat4x4;

	/// 4 columns of 4 components matrix of high qualifier floating-point numbers.
	/// There is no guarantee on the actual qualifier.
	///
	/// @see GLSL 4.20.8 specification, section 4.1.6 Matrices
	/// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier
	typedef mat<4, 4, float, highp>		highp_mat4x4;

}//namespace glm


text:
module Day4.Test where

import           Day4
import           Test.Hspec

tests :: SpecWith ()
tests = do
  describe "Part1" $ do
    it "Test1" $ do
      part1 test1 `shouldBe` 1514
  describe "Part2" $ do
    it "Test1" $ do
      breakCode (RoomCode ["qzmt","zixmtkozy","ivhz"] 343 "") `shouldBe` "very encrypted name"