text:
from dnload.glsl_block import GlslBlock
from dnload.glsl_block import extract_tokens
from dnload.glsl_block_layout import glsl_parse_layout
from dnload.glsl_block_member import glsl_parse_member_list

########################################
# GlslBlockInOut #######################
########################################

class GlslBlockInOut(GlslBlock):
    """Input (attribute / varying) declaration block."""

    def __init__(self, layout, inout):
        """Constructor."""
        GlslBlock.__init__(self)
        self._layout = layout
        self._inout = inout

    def formatBase(self, force):
        """Return base of formatted output."""
        ret = ""
        if self._layout:
            ret += self._layout.format(force)
        return ret + self._inout.format(force)

    def getInout(self):
        """Accessor."""
        return self._inout

    def getLayout(self):
        """Accessor."""
        return self._layout

    def format(self, force):
        """Return formatted output."""
        return self.formatBase(force) + ";"

    def __str__(self):
        """String representation."""
        return "InOut()"

########################################
# GlslBlockInOutStruct #################
########################################

class GlslBlockInOutStruct(GlslBlockInOut):
    """Input (attribute / varying) struct declaration block."""

    def __init__(self, layout, inout, type_name, members, name, size=0):
        """Constructor."""
        GlslBlockInOut.__init__(self, layout, inout)
        self.__type_name = type_name
        self.__members = members
        self.__name = name
        self.__size = size
        self.__member_accesses = []
        # Hierarchy.
        name.setType(type_name)
        self.addNamesDeclared(name)
        self.addNamesUsed(name)

    def format(self, force):
        """Return formatted output."""
        ret = self.formatBase(force)
        lst = "".join(map(lambda x: x.format(force), self.__members))
        ret += (" %s{%s}%s" % (self.__type_name.format(force), lst, self.__name.format(force)))
        if self.__size:
            ret += "[%s]" % (self.__size.format(force))
        return ret + ";"

    def getMembers(self):
        """Accessor."""
        return self.__members

    def getMemberAccesses(self):
        """Accessor."""
        return self.__member_accesses

    def getName(self):
        """Accessor."""
        return self.__name

    def getTypeName(self):
        """Accessor."""
        return self.__type_name

    def isMergableWith(self, op):
        """Tell if this inout block can be merged with given block."""
        if not is_glsl_block_inout_struct(op):
            return False
        if self.getTypeName() != op.getTypeName():
            return False
        members1 = sorted(op.getMembers())
        members2 = sorted(self.__members)
        if len(members1) != len(members2):
            return False
        for (ii, jj) in zip(members1, members2):
            if ii.getName() != jj.getName():
                return False
        return True

    def setMemberAccesses(self, lst):
        """Set collected member accesses."""
        self.__member_accesses = lst

    def __str__(self):
        """String representation."""
        return "InOutStruct('%s')" % (self.__name.getName())

########################################
# GlslBlockInOutTyped ##################
########################################

class GlslBlockInOutTyped(GlslBlockInOut):
    """Input (attribute / varying) struct declaration block."""

    def __init__(self, layout, inout, typeid, name):
        """Constructor."""
        GlslBlockInOut.__init__(self, layout, inout)
        self.__typeid = typeid
        self.__name = name
        # Hierarchy.
        name.setType(typeid)
        self.addNamesDeclared(name)
        self.addNamesUsed(name)

    def format(self, force):
        """Return formatted output."""
        ret = self.formatBase(force)
        return ret + (" %s %s;" % (self.__typeid.format(force), self.__name.format(force)))

    def getName(self):
        """Accessor."""
        return self.__name

    def getType(self):
        """Accessor."""
        return self.__typeid

    def isMergableWith(self, op):
        """Tell if this inout block can be merged with given block."""
        if is_glsl_block_inout_typed(op) and (op.getName() == self.__name) and (op.getType() == self.__typeid):
            return True
        return False

    def setImpliedPrecision(self, precision_state):
        """Sets the implied precision for this block."""
        self.__typeid.setImpliedPrecision(precision_state)

    def __str__(self):
        """String representation."""
        return "InOutTyped('%s %s')" % (self.__typeid.format(False), self.__name.getName())

########################################
# Functions ############################
########################################

def glsl_parse_inout(source):
    """Parse inout block."""
    (layout, content) = glsl_parse_layout(source)
    if not layout:
        content = source
    # It is possible to have an inout block without anything.
    (inout, remaining) = extract_tokens(content, ("?o", ";"))
    if inout:
        return (GlslBlockInOut(layout, inout), remaining)
    # Scoped version first.
    (inout, type_name, scope, name, intermediate) = extract_tokens(content, ("?o", "?n", "?{", "?n"))
    if inout and type_name and scope and name:
        members = glsl_parse_member_list(scope)
        if not members[0]:
            raise RuntimeError("wat?")
        if not members:
            raise RuntimeError("empty member list for inout struct")
        # May have an array.
        (size, remaining) = extract_tokens(intermediate, ("[", "?u", "]", ";"))
        if size:
            return (GlslBlockInOutStruct(layout, inout, type_name, members, name, size), remaining)
        # Did not have an array.
        (terminator, remaining) = extract_tokens(intermediate, "?|;")
        if terminator:
            return (GlslBlockInOutStruct(layout, inout, type_name, members, name), remaining)
    # Regular inout.
    (inout, typeid, name, remaining) = extract_tokens(content, ("?o", "?t", "?n", ";"))
    if not inout or not typeid or not name:
        return (None, source)
    return (GlslBlockInOutTyped(layout, inout, typeid, name), remaining)

def is_glsl_block_inout(op):
    """Tell if given object is GlslBlockInout."""
    return isinstance(op, GlslBlockInOut)

def is_glsl_block_inout_struct(op):
    """Tell if given object is GlslBlockInoutStruct."""
    return isinstance(op, GlslBlockInOutStruct)

def is_glsl_block_inout_typed(op):
    """Tell if given object is GlslBlockInoutTyped."""
    return isinstance(op, GlslBlockInOutTyped)


text:
@implementation HockeyWrapper

- (void)forceCheckForUpdate
{
    BITUpdateManager *um = [[BITHockeyManager sharedHockeyManager] updateManager];
    [um setUpdateSetting:BITUpdateCheckManually];
    [um checkForUpdate];
}

@end

redpajama_set_name: RedPajamaGithub


text:
	{{ csrf_field() }}
	<input type="hidden" id="accion" value="editar">
	<input type="hidden" name="banco_id" value="{{ $banco_id }}">

			Descripcion del banco
			<input type="text" value="{{ \App\Models\administracion\Banco::find($banco_id)->nombre_banco }}" class="form-control" maxlength="60" name="nombre_banco" id="nombre_banco">

			Codigo
			<input type="text" style="text-align: center;" value="{{ \App\Models\administracion\Banco::find($banco_id)->codigo_banco }}" name="codigo_banco" readonly="" class="form-control" id="codigo_banco">


text:
PROJECT_DIR=$(dirname "$0")
pushd $PROJECT_DIR
source ./common.sh

MACHINES_DIR=~/.docker/machine/machines

export MASTER_MACHINE_IP=$(docker-machine ip master)
export SLAVE_MACHINE_IP=$(docker-machine ip master)

if [ -z $(docker-machine inspect master | grep 'Host does not exist') ] ; then
   docker-machine stop master
   perl -lne '$line=$_; $line =~ s{\$(\w+)}{ exists $ENV{$1} ? $ENV{$1} : q/$/.$1 }ge; $line =~ s{\$\{(\w+)\}}{ exists $ENV{$1} ? $ENV{$1} : q/${/.$1.q/}/ }ge; print "$line";' master.json > "$MACHINES_DIR/master/config.json"
   docker-machine start master
else
   echo "Master doesn't exist. First you have to create machines."
fi

if [ -z $(docker-machine inspect slave | grep 'Host does not exist') ] ; then
   docker-machine stop slave
   perl -lne '$line=$_; $line =~ s{\$(\w+)}{ exists $ENV{$1} ? $ENV{$1} : q/$/.$1 }ge; $line =~ s{\$\{(\w+)\}}{ exists $ENV{$1} ? $ENV{$1} : q/${/.$1.q/}/ }ge; print "$line";' slave.json > "$MACHINES_DIR/slave/config.json"
   docker-machine start slave
else
   echo "Master doesn't exist. First you have to create machines."
fi


text:
/**
 * @file    ProjectToolbarWidget.hpp
 * @author  Marvin Smith
 * @date    8/6/2017
 */
#ifndef GEO_WIDGET_GUI_PROJECT_TOOLBAR_WIDGET_HPP
#define GEO_WIDGET_GUI_PROJECT_TOOLBAR_WIDGET_HPP

// C++ Libraries
#include <string>

// Qt Libraries
#include <QGridLayout>
#include <QStackedWidget>
#include <QWidget>

// GeoViewer Libraries
#include <GeoViewer/core/System_Configuration.hpp>

// Project Libraries
#include "PrimaryToolbarPane.hpp"

/**
 * @class ProjectToolbarWidget
 * @brief Main Class for Primary Toolbar
 */
class ProjectToolbarWidget : public QWidget
{
    Q_OBJECT

    public:

        /**
         * @brief Constructor
         */
        ProjectToolbarWidget( System_Configuration::ptr_t sys_config,
                              QWidget*                     parent = nullptr );

    public slots:

        /**
         * @brief Return to Primary Panel
         */
        void Change_Panel( int panel_id );

    protected:

        /**
         * @brief Initialize the GUI
         */
        void Initialize_GUI();

    private:

        /**
         * @brief Initialize the Configuration
         */
        void Initialize_Configuration();

        /**
         * @brief Build the Primary Panel
         */
        void Build_Primary_Panels();

        /// Class Name
        std::string m_class_name;

        /// System Configuration
        System_Configuration::ptr_t m_sys_config;

        /// Main Layout
        QVBoxLayout* m_main_layout;

        /// Stacked Widget
        QStackedWidget* m_main_widget;

        /// Primary Toolbar Panel
        PrimaryToolbarPane* m_primary_panel;

}; // End of MatchingToolbarWidget Class

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<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.openecard</groupId>
	<artifactId>app</artifactId>
	<version>1.1.0-pre1</version>
    </parent>

    <groupId>org.openecard</groupId>
    <artifactId>gui</artifactId>
    <packaging>pom</packaging>
    <name>GUI implementations</name>

    <modules>
	<module>about</module>
	<module>graphics</module>
	<module>gui-common</module>
	<module>swing</module>
    </modules>

    <profiles>
	<profile>
	    <id>android</id>
	    <activation>
		<!-- activate android when sdk path is defined -->
		<property>
		    <name>env.ANDROID_HOME</name>
		</property>
	    </activation>
	    <modules>
		<module>android-gui</module>
	    </modules>
	</profile>
    </profiles>

    <dependencies>
	<dependency>
	    <groupId>org.openecard</groupId>
	    <artifactId>common</artifactId>
	    <version>${project.version}</version>
	</dependency>
	<dependency>
	    <groupId>org.openecard.wsdef</groupId>
	    <artifactId>wsdef-client</artifactId>
	    <version>${project.version}</version>
	    <scope>provided</scope>
	</dependency>
    </dependencies>

</project>


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W29396_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">2) Power Generation — On Lease
(1, ' ,,'.r'

    <p class="styleSans3.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">,1',,,1

    <p class="styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">bavmgs lI current generation 5 Iuei supply 13 alesei Only a portion of gas is consumed operating the generator, remainder of gas will
be flared Due to gas quality, high NGL content, preference is to purchase power from the
M111 0141" fini- nnavofa nannrofinn n" D1+£I

    <p class="styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Ell-U CHI-U- llUI- UPULa-l-U ECU-Ulal-J-Ull U11 CHI-0
3) Compressed Natural Gas — On lease Well site compressors are required to fill CNG trailers Large capital outlay for equipment and operating cost, includes trucking of products, are expensive No gas would be flared, but might be uneconomical to operate when gas volume declines

    <p class="styleSans4.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<!--
 * Licensed to The Apereo Foundation under one or more contributor license
 * agreements. See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 *
 * The Apereo Foundation 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.
 *
 -->
<hibernate-mapping package="org.unitime.timetable.model">
    <class name="StudentAreaClassificationMajor" table="student_area_clasf_major">
        <cache include="non-lazy" usage="transactional"/>
        <id
            name="uniqueId"
            column="uniqueid"
            type="java.lang.Long">
            <generator class="org.unitime.commons.hibernate.id.UniqueIdGenerator">
                <param name="sequence">pref_group_seq</param>
            </generator>
        </id>

        <many-to-one
            name="student"
            class="Student"
            column="student_id"
            not-null="true"
            foreign-key="fk_student_acmaj_student"/>

        <many-to-one
            name="academicArea"
            class="AcademicArea"
            column="acad_area_id"
            not-null="true"
            foreign-key="fk_student_acmaj_area"/>

        <many-to-one
            name="academicClassification"
            class="AcademicClassification"
            column="acad_clasf_id"
            not-null="true"
            foreign-key="fk_student_acmaj_clasf"/>

        <many-to-one
            name="major"
            class="PosMajor"
            column="major_id"
            not-null="true"
            foreign-key="fk_student_acmaj_major"/>

        <many-to-one
            name="concentration"
            class="PosMajorConcentration"
            column="concentration_id"
            not-null="false"
            foreign-key="fk_student_acmaj_conc"/>

        <many-to-one
            name="degree"
            class="Degree"
            column="degree_id"
            not-null="false"
            foreign-key="fk_student_acmaj_deg"/>

        <many-to-one
            name="program"
            class="Program"
            column="program_id"
            not-null="false"
            foreign-key="fk_student_acmaj_prog"/>

        <many-to-one
            name="campus"
            class="Campus"
            column="campus_id"
            not-null="false"
            foreign-key="fk_student_acmaj_campus"/>

        <property
            name="weight"
            column="weight"
            type="java.lang.Double"
            not-null="false"/>
    </class>
    <class name="StudentAreaClassificationMinor" table="student_area_clasf_minor">
        <cache include="non-lazy" usage="transactional"/>
        <id
            name="uniqueId"
            column="uniqueid"
            type="java.lang.Long">
            <generator class="org.unitime.commons.hibernate.id.UniqueIdGenerator">
                <param name="sequence">pref_group_seq</param>
            </generator>
        </id>

        <many-to-one
            name="student"
            class="Student"
            column="student_id"
            not-null="true"
            foreign-key="fk_student_acmin_student"/>

        <many-to-one
            name="academicArea"
            class="AcademicArea"
            column="acad_area_id"
            not-null="true"
            foreign-key="fk_student_acmin_area"/>

        <many-to-one
            name="academicClassification"
            class="AcademicClassification"
            column="acad_clasf_id"
            not-null="true"
            foreign-key="fk_student_acmin_clasf"/>

        <many-to-one
            name="minor"
            class="PosMinor"
            column="minor_id"
            not-null="true"
            foreign-key="fk_student_acmin_minor"/>
    </class>
</hibernate-mapping>


text:
@interface RTFormInfoCell : RTFormBaseCell

@property (nonatomic, weak, readonly) UILabel *infoLabel;
@property (nonatomic, weak, readonly) UILabel *sideLabel;
@property (nonatomic, weak, readonly) UIView *separator;

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>All Classes (Solr 4.10.4 API)</title>
<meta name="date" content="2015-02-27">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

DetectedLanguage

LangDetectLanguageIdentifierUpdateProcessor

LangDetectLanguageIdentifierUpdateProcessorFactory

LangIdParams

LanguageIdentifierUpdateProcessor

TikaLanguageIdentifierUpdateProcessor

TikaLanguageIdentifierUpdateProcessorFactory


text:
package tscfg.example

final case class ScalaIssue62aCfg(
  foo       : ScalaIssue62aCfg.Foo
)
object ScalaIssue62aCfg {
  sealed trait FruitType
  object FruitType {
    object apple extends FruitType
    object banana extends FruitType
    object pineapple extends FruitType
    def $resEnum(name: java.lang.String, path: java.lang.String, $tsCfgValidator: $TsCfgValidator): FruitType = name match {
      case "apple" => FruitType.apple
      case "banana" => FruitType.banana
      case "pineapple" => FruitType.pineapple
      case v => $tsCfgValidator.addInvalidEnumValue(path, v, "FruitType")
                null
    }
  }
  final case class Foo(
    fruit : ScalaIssue62aCfg.FruitType
  )
  object Foo {
    def apply(c: com.typesafe.config.Config, parentPath: java.lang.String, $tsCfgValidator: $TsCfgValidator): ScalaIssue62aCfg.Foo = {
      ScalaIssue62aCfg.Foo(
        fruit = ScalaIssue62aCfg.FruitType.$resEnum(c.getString("fruit"), parentPath + "fruit", $tsCfgValidator)
      )
    }
  }

  def apply(c: com.typesafe.config.Config): ScalaIssue62aCfg = {
    val $tsCfgValidator: $TsCfgValidator = new $TsCfgValidator()
    val parentPath: java.lang.String = ""
    val $result = ScalaIssue62aCfg(
      foo       = ScalaIssue62aCfg.Foo(if(c.hasPathOrNull("foo")) c.getConfig("foo") else com.typesafe.config.ConfigFactory.parseString("foo{}"), parentPath + "foo.", $tsCfgValidator)
    )
    $tsCfgValidator.validate()
    $result
  }
  final class $TsCfgValidator {
    private val badPaths = scala.collection.mutable.ArrayBuffer[java.lang.String]()

    def addBadPath(path: java.lang.String, e: com.typesafe.config.ConfigException): Unit = {
      badPaths += s"'$path': ${e.getClass.getName}(${e.getMessage})"
    }

    def addInvalidEnumValue(path: java.lang.String, value: java.lang.String, enumName: java.lang.String): Unit = {
      badPaths += s"'$path': invalid value $value for enumeration $enumName"
    }

    def validate(): Unit = {
      if (badPaths.nonEmpty) {
        throw new com.typesafe.config.ConfigException(
          badPaths.mkString("Invalid configuration:\n    ", "\n    ", "")
        ){}
      }
    }
  }
}


text:
package org.codeyn.smartend.framework.util;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

/**
 * 通用工具类
 */
public class CommonUtils {

	/**
	 * 获取分页
	 */
	public static int[] getPager(Integer pageNo, Integer pageSize) {
		// 默认20条一页
		pageSize = (pageSize == null || pageSize <= 0) ? 20 : pageSize;

		// 默认页码
		pageNo = (pageNo == null || pageNo <= 0) ? 1 : pageNo;

		// 计算开始位置
		Integer start = (pageNo - 1) * pageSize;

		return new int[] { start, pageSize };
	}

	/**
	 * 获取子列表
	 */
	public static <T> List<T> getSubList(List<T> list, int start, int limit) {

		if (list == null || list.isEmpty()) {
			return new ArrayList<T>(0);
		}

		int listLength = list.size();
		if (start > listLength - 1) {
			return new ArrayList<T>();
		}

		limit = start + limit > listLength ? listLength - start : limit;
		return list.subList(start, start + limit);
	}

	/**
	 * 将字符串按分隔符分割并转成整型列表
	 */
	public static List<Integer> str2IntList(String ids, String separator) {
		List<Integer> idList = new ArrayList<Integer>();
		if (StringUtils.isBlank(ids)) {
			return idList;
		}

		String[] arrId = ids.split("\\" + separator);
		for (String id : arrId) {
			idList.add(Integer.parseInt(id));
		}
		return idList;
	}
}


text:
require_relative '../../../test_base'

class DirectTransactionTest < TestBase

  def setup
    @client = IntegrationTest.get_sandbox_client
    @transaction = EwayRapid::InputModelFactory.create_transaction
    customer = EwayRapid::InputModelFactory.create_customer
    address = EwayRapid::InputModelFactory.create_address
    payment_details = EwayRapid::InputModelFactory.create_payment_details
    card_details = EwayRapid::InputModelFactory.create_card_detail('12', '24')
    customer.card_details = card_details
    customer.address = address
    @transaction.customer = customer
    @transaction.payment_details = payment_details
    shipping_details = EwayRapid::InputModelFactory.create_shipping_detail
    @transaction.shipping_details = shipping_details
  end

  def test_valid_input
    response = @client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, @transaction)
    assert(response.transaction_status.status)
    assert_not_equal(0, response.transaction_status.transaction_id)
  end

  def test_blank_input
    transaction = EwayRapid::Models::Transaction.new
    customer = EwayRapid::Models::Customer.new
    card_detail = EwayRapid::Models::CardDetails.new
    customer.card_details = card_detail
    transaction.customer = customer
    transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE
    response = @client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, transaction)
    assert(!response.transaction_status.status)
    assert_equal(0, response.transaction_status.transaction_id)

    assert(response.errors.include?('V6021'))
    assert(response.errors.include?('V6022'))
    assert(response.errors.include?('V6101'))
    assert(response.errors.include?('V6102'))
  end

  def teardown

  end
end


text:
<?php

Class Console_Make_Index extends Console_Controller_Core {

	public function handler() {
		$this->info("This command help the user to auto create client and controller.");
		$this->warning("Syntax1: php lexi make:client clientname");
		$this->warning("Syntax2: php lexi make:controller clientname controllername");
		return true;
	}

	/**
	 *	get the template path
	 */
	public function getTemplatePath()  {
		return $this->getConsolePath() . "make" . DS . "template"  . DS;
	}
}


text:
@import Foundation;

@interface NSThread (CBPExtensions)

/**
 *  Creates and returns a new thread that is ready for events to be scheduled on it. To correctly stop it, call -cbp_stop.
 *
 *  @return a newly created thread
 */
+ (NSThread *)cbp_runningThread;

/**
 *  Cleanly stops a thread returned by cbp_runningThread.
 */
- (void)cbp_stop;

/**
 *  Performs a block synchronously on the receiving thread.
 *
 *  @param block the block to perform
 */
- (void)cbp_performBlockSync:(dispatch_block_t)block;

/**
 *  Performs a block asynchronously on the receiving thread. If the target thread and the current thread are the same, the block will be performed on the next iteration of the runloop.
 *
 *  @param block the block to perform
 */
- (void)cbp_performBlockAsync:(dispatch_block_t)block;

@end


text: CScript /nologo ichitaro-to-text.vbs /normalize %*


text:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>uk.gov.gchq.gaffer</groupId>
        <artifactId>example</artifactId>
        <version>1.21.1</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>road-traffic</artifactId>
    <packaging>pom</packaging>

    <modules>
        <module>road-traffic-generators</module>
        <module>road-traffic-model</module>
        <module>road-traffic-rest</module>
        <module>road-traffic-demo</module>
    </modules>
</project>


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

namespace Microsoft.Build.BuildEngine
{
    internal interface INodeDescription
    {
        // UNDONE
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Nav2API - The Navigation library: ImageInterface.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Classes

Files

Related Pages

ImageInterface.h

00001
00013
00014 #ifndef WFAPI_IMAGE_INTERFACE_H
00015 #define WFAPI_IMAGE_INTERFACE_H
00016
00017 #include "WFAPIConfig.h"
00018 #include "Interface.h"
00019 #include "RequestID.h"
00020 #include "WFString.h"
00021 #include "AsynchronousStatus.h"
00022
00023 namespace WFAPI {
00024
00025 // Forward declarations
00026 class ImageListener;
00027 class Nav2APIImpl;
00028 class ImageInterfaceImpl;
00029
00035 class ImageInterface : public Interface
00036 {
00037
00038 public:
00039
00043    virtual ~ImageInterface();
00044
00060    AsynchronousStatus getImage(const WFString& imageName, bool getAsBuffer);
00061
00070    void addImageListener(ImageListener* listener);
00071
00079    void removeImageListener(ImageListener* listener);
00080
00086    void setImagePath(const WFString& imagePath);
00087
00093    WFString& getImagePath();
00094
00100    void setImageExtension(const WFString& imageExtension);
00101
00107    WFString& getImageExtension();
00108
00112    ImageInterfaceImpl* getImpl();
00113
00114 private:
00118    ImageInterface(Nav2APIImpl* nav2APIimpl);
00119
00123    ImageInterface(const ImageInterface&);
00124    const ImageInterface& operator=(const ImageInterface&);
00125
00126    friend class Nav2APIImpl;
00127
00128    struct impl;
00129
00130    impl* m_impl;
00131 };
00132
00133 } // End namespace WFAPI
00134
00135 #endif // End WFAPI_IMAGE_INTERFACE_H
00136

<address style="align: right;">Generated on Mon Jun 28 20:50:17 2010 for Nav2API - The Navigation library by

 1.4.7 </address>


text:
/**
 *
 */
package org.yaourtcorp.kafka.producer.example;

import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author jaguiar
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={SpringConfig.class})
public abstract class AbstractTestBase {

	@BeforeClass
	public static void setUpBeforeClass(){
		System.setProperty(SpringConfig.EVENT_TO_PRODUCE_ENV_PROPERTY, "yogurt");
		System.setProperty(SpringConfig.SERIALIZATION_FORMAT_ENV_PROPERTY, "json");
	}
}


text:
title: Including the JavaScript controls in your project
---

All the JS controls are built using (RequireJS)[] you can include the AMD
compatible controls using the following method.

## Step 1: Install via Bower

DataSift bootstrap is a public respository, however we don't publically list it
in Bower. To include DataSift Bootstrap run the following command.

`bower install git@github.com:datasift/bootstrap.git --save`

## Step 2: Create a link via path directory

In your RequireJS config file you can create a shortcut to the path.

{% highlight javascript %}
requirejs.config({
	paths: {
		'bootstrap': '<bower-install-directory>/datasift-bootstrap/dist/scripts'
	}
}
});
{% endhighlight %}

Please remember to replace `<bower-install-directory>` with the directory where
bower installs the repository.

## Step 3: Require in the define call

Now we have a shortcut to the file we can easily require the controls.

{% highlight javascript %}
define([
	'bootstrap/ToolTip'
], function (ToolTip) {
	...
});
{% endhighlight %}


text:
etsa.github.io
==============

My github page.


text:
package org.blueo.db.vo;

public class DbColumn {

	private String name;
	private boolean pk;
	private boolean nullable;
	private String comment;
	private boolean enumType;
	private DbType dbType;

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("DbColumn [name=");
		builder.append(name);
		builder.append(", pk=");
		builder.append(pk);
		builder.append(", nullable=");
		builder.append(nullable);
		builder.append(", comment=");
		builder.append(comment);
		builder.append(", enumType=");
		builder.append(enumType);
		builder.append(", dbType=");
		builder.append(dbType);
		builder.append("]");
		return builder.toString();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isPk() {
		return pk;
	}

	public void setPk(boolean pk) {
		this.pk = pk;
	}

	public boolean isNullable() {
		return nullable;
	}

	public void setNullable(boolean nullable) {
		this.nullable = nullable;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public boolean isEnumType() {
		return enumType;
	}

	public void setEnumType(boolean enumType) {
		this.enumType = enumType;
	}

	public DbType getDbType() {
		return dbType;
	}

	public void setDbType(DbType dbType) {
		this.dbType = dbType;
	}

}


text:
package org.apache.kafka.common.requests;

import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.types.Field;
import org.apache.kafka.common.protocol.types.Schema;
import org.apache.kafka.common.protocol.types.Struct;
import org.apache.kafka.common.security.auth.KafkaPrincipal;

import java.nio.ByteBuffer;
import java.util.Map;

import static org.apache.kafka.common.protocol.CommonFields.ERROR_CODE;
import static org.apache.kafka.common.protocol.CommonFields.PRINCIPAL_NAME;
import static org.apache.kafka.common.protocol.CommonFields.PRINCIPAL_TYPE;
import static org.apache.kafka.common.protocol.CommonFields.THROTTLE_TIME_MS;
import static org.apache.kafka.common.protocol.types.Type.BYTES;
import static org.apache.kafka.common.protocol.types.Type.INT64;
import static org.apache.kafka.common.protocol.types.Type.STRING;

public class CreateDelegationTokenResponse extends AbstractResponse {

    private static final String OWNER_KEY_NAME = "owner";
    private static final String ISSUE_TIMESTAMP_KEY_NAME = "issue_timestamp";
    private static final String EXPIRY_TIMESTAMP_NAME = "expiry_timestamp";
    private static final String MAX_TIMESTAMP_NAME = "max_timestamp";
    private static final String TOKEN_ID_KEY_NAME = "token_id";
    private static final String HMAC_KEY_NAME = "hmac";

    private final Errors error;
    private final long issueTimestamp;
    private final long expiryTimestamp;
    private final long maxTimestamp;
    private final String tokenId;
    private final ByteBuffer hmac;
    private final int throttleTimeMs;
    private KafkaPrincipal owner;

    private static final Schema TOKEN_CREATE_RESPONSE_V0 = new Schema(
        ERROR_CODE,
        new Field(OWNER_KEY_NAME, new Schema(PRINCIPAL_TYPE, PRINCIPAL_NAME), "token owner."),
        new Field(ISSUE_TIMESTAMP_KEY_NAME, INT64, "timestamp (in msec) when this token was generated."),
        new Field(EXPIRY_TIMESTAMP_NAME, INT64, "timestamp (in msec) at which this token expires."),
        new Field(MAX_TIMESTAMP_NAME, INT64, "max life time of this token."),
        new Field(TOKEN_ID_KEY_NAME, STRING, "UUID to ensure uniqueness."),
        new Field(HMAC_KEY_NAME, BYTES, "HMAC of the delegation token."),
        THROTTLE_TIME_MS);

    /**
     * The version number is bumped to indicate that on quota violation brokers send out responses before throttling.
     */
    private static final Schema TOKEN_CREATE_RESPONSE_V1 = TOKEN_CREATE_RESPONSE_V0;

    public CreateDelegationTokenResponse(int throttleTimeMs,
                                         Errors error,
                                         KafkaPrincipal owner,
                                         long issueTimestamp,
                                         long expiryTimestamp,
                                         long maxTimestamp,
                                         String tokenId,
                                         ByteBuffer hmac) {
        this.throttleTimeMs = throttleTimeMs;
        this.error = error;
        this.owner = owner;
        this.issueTimestamp = issueTimestamp;
        this.expiryTimestamp = expiryTimestamp;
        this.maxTimestamp = maxTimestamp;
        this.tokenId = tokenId;
        this.hmac = hmac;
    }

    public CreateDelegationTokenResponse(int throttleTimeMs, Errors error, KafkaPrincipal owner) {
        this(throttleTimeMs, error, owner, -1, -1, -1, "", ByteBuffer.wrap(new byte[] {}));
    }

    public CreateDelegationTokenResponse(Struct struct) {
        error = Errors.forCode(struct.get(ERROR_CODE));
        Struct ownerStruct = (Struct) struct.get(OWNER_KEY_NAME);
        String principalType = ownerStruct.get(PRINCIPAL_TYPE);
        String principalName = ownerStruct.get(PRINCIPAL_NAME);
        owner = new KafkaPrincipal(principalType, principalName);
        issueTimestamp = struct.getLong(ISSUE_TIMESTAMP_KEY_NAME);
        expiryTimestamp = struct.getLong(EXPIRY_TIMESTAMP_NAME);
        maxTimestamp = struct.getLong(MAX_TIMESTAMP_NAME);
        tokenId = struct.getString(TOKEN_ID_KEY_NAME);
        hmac = struct.getBytes(HMAC_KEY_NAME);
        this.throttleTimeMs = struct.getOrElse(THROTTLE_TIME_MS, DEFAULT_THROTTLE_TIME);
    }

    public static CreateDelegationTokenResponse parse(ByteBuffer buffer, short version) {
        return new CreateDelegationTokenResponse(ApiKeys.CREATE_DELEGATION_TOKEN.responseSchema(version).read(buffer));
    }

    public static Schema[] schemaVersions() {
        return new Schema[] {TOKEN_CREATE_RESPONSE_V0, TOKEN_CREATE_RESPONSE_V1};
    }

    @Override
    public Map<Errors, Integer> errorCounts() {
        return errorCounts(error);
    }

    @Override
    protected Struct toStruct(short version) {
        Struct struct = new Struct(ApiKeys.CREATE_DELEGATION_TOKEN.responseSchema(version));
        struct.set(ERROR_CODE, error.code());
        Struct ownerStruct = struct.instance(OWNER_KEY_NAME);
        ownerStruct.set(PRINCIPAL_TYPE, owner.getPrincipalType());
        ownerStruct.set(PRINCIPAL_NAME, owner.getName());
        struct.set(OWNER_KEY_NAME, ownerStruct);
        struct.set(ISSUE_TIMESTAMP_KEY_NAME, issueTimestamp);
        struct.set(EXPIRY_TIMESTAMP_NAME, expiryTimestamp);
        struct.set(MAX_TIMESTAMP_NAME, maxTimestamp);
        struct.set(TOKEN_ID_KEY_NAME, tokenId);
        struct.set(HMAC_KEY_NAME, hmac);
        struct.setIfExists(THROTTLE_TIME_MS, throttleTimeMs);
        return struct;
    }

    public Errors error() {
        return error;
    }

    public KafkaPrincipal owner() {
        return owner;
    }

    public long issueTimestamp() {
        return issueTimestamp;
    }

    public long expiryTimestamp() {
        return expiryTimestamp;
    }

    public long maxTimestamp() {
        return maxTimestamp;
    }

    public String tokenId() {
        return tokenId;
    }

    public byte[] hmacBytes() {
        byte[] byteArray = new byte[hmac.remaining()];
        hmac.get(byteArray);
        return byteArray;
    }

    @Override
    public int throttleTimeMs() {
        return throttleTimeMs;
    }

    public boolean hasError() {
        return this.error != Errors.NONE;
    }

    @Override
    public boolean shouldClientThrottle(short version) {
        return version >= 1;
    }
}


text:
<?php

namespace Phalcon\Annotations;

/**
 * Phalcon\Annotations\Reader
 *
 * Parses docblocks returning an array with the found annotations
 */
interface ReaderInterface
{

    /**
     * Reads annotations from the class dockblocks, its methods and/or properties
     *
     * @param string $className
     * @return array
     */
    public function parse($className);

    /**
     * Parses a raw doc block returning the annotations found
     *
     * @param string $docBlock
     * @param mixed $file
     * @param mixed $line
     * @return array
     */
    public static function parseDocBlock($docBlock, $file = null, $line = null);

}


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://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.

import { google } from 'googleapis';

let _authClient;

/**
 * Initializes the Google credentials for calling the
 * Business Messages API.
 */
export async function initCredentials() {
  if (_authClient) {
    return _authClient;
  }

  // Configure a JWT auth client
  const authClient = new google.auth.JWT({
    keyFile: './bm-agent-service-account-credentials.json',
    scopes: ['https://www.googleapis.com/auth/businessmessages'],
  });

  return new Promise(function (resolve, reject) {
    // authenticate request
    authClient.authorize(function (err, credentials) {
      if (err) {
        reject(err);
      } else {
        _authClient = authClient;
        resolve(authClient);
      }
    });
  });
}


text:
<?php namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateArticleRequest extends FormRequest
{
	public function authorize () {
		return true;
	}

	public function rules () {
		return [
			'title'   => 'max:100|required_without_all:content,tags',
			'content' => 'max:10000|required_without_all:title,tags',
			'tags'    => 'array|max:5|required_without_all:content,title',
			'tags.*'  => 'required|max:20',
		];
	}
}


text:
import {TournamentGame} from '../model/tournament-game';

export class SwapGames {

  gameOne: TournamentGame;
  gameTwo: TournamentGame;

}


text:
package com.github.dockerjava.core.util;

import java.io.IOException;
import java.io.InputStream;

import javax.ws.rs.client.ClientRequestContext;
import javax.ws.rs.client.ClientResponseContext;
import javax.ws.rs.client.ClientResponseFilter;
import javax.ws.rs.core.Response;

/**
 * Default implementation of RedirectStrategy honors the restrictions on automatic redirection of entity enclosing
 * methods such as POST and PUT imposed by the HTTP specification. 302 Moved Temporarily, 301 Moved Permanently and 307
 * Temporary Redirect status codes will result in an automatic redirect of HEAD and GET methods only.
 *
 * {@link org.apache.http.impl.client.DefaultRedirectStrategy}
 *
 * This filter allows arbitrary redirection for other methods.
 */
public class FollowRedirectsFilter implements ClientResponseFilter {

    @Override
    public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
        if (!responseContext.getStatusInfo().getFamily().equals(Response.Status.Family.REDIRECTION)) {
            return;
        }

        Response resp = requestContext.getClient().target(responseContext.getLocation()).request()
                .method(requestContext.getMethod());
        responseContext.setEntityStream((InputStream) resp.getEntity());
        responseContext.setStatusInfo(resp.getStatusInfo());
        responseContext.setStatus(resp.getStatus());
    }
}


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.identifiers;

/**
 * @author smorgrav
 */
public class ApplicationId extends NonDefaultIdentifier {

    public ApplicationId(String id) {
        super(id);
    }

    @Override
    public void validate() {
        super.validate();
        validateNoUpperCase();
    }

    public static void validate(String id) {
        if ( ! strictPattern.matcher(id).matches())
            throwInvalidId(id, strictPatternExplanation);
        new ApplicationId(id); // validate
    }

}


text:
#include "tcpsocket.h"
#include "tcperror.h"
#include <memory.h>

#ifdef	UNIX

	#include <unistd.h>

#endif

////////////////////////////////////////////////////////////////////////////////
// class tcpsocket

// tcpsocket::tcpsocket()
//
// Purpose:
//		Default constructor
//
// Exceptions:
//		Throws a tcperror if the socket cannot be created.
//
// Comments:
//		The default constructor creates a new, unconnected socket. Use the
//		member functions connect() or accept() to make a connection.
//
tcpsocket::tcpsocket()
: m_socket(socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))
{
	// Check if the socket was created successfully
	if (m_socket == INVALID_SOCKET)
	{ throw tcperror(); }
}

// tcpsocket::tcpsocket(const char* host, unsigned short port)
//
// Purpose:
//		Create a socket and open a connection
//
// Parameters:
//		host				Host name or TCP/IP address separated by dots
//		port				Port number
//
// Exceptions:
//		Throws a tcperror if the socket cannot be created or the connection
//		cannot be opened.
//
// Comments:
//		This constructor creates a new socket and makes a connection by
//		calling the member function connect().
//
tcpsocket::tcpsocket(const char* host, unsigned short port)
: m_socket(socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))
{
	// Check if the socket was created successfully
	if (m_socket == INVALID_SOCKET)
	{ throw tcperror(); }

	// Open the connection
	connect(host, port);
}

// tcpsocket::~tcpsocket() throw()
//
// Purpose:
//		Destructor
//
// Comments:
//		The destructor destroys the socket. Normally the socket should not
//		be connected when it is destroyed. If it is, the connection is
//		teminated immediately.
//
tcpsocket::~tcpsocket() throw()
{
	// Destroy the socket
	if (m_socket != INVALID_SOCKET)
	{
		shutdown(m_socket, SD_SEND);

#ifdef	UNIX

		// Unix
		close(m_socket);
#else

		// Windows
		closesocket(m_socket);
#endif
	}
}

// void tcpsocket::connect(const char* host, unsigned short port)
//
// Purpose:
//		Open a connection
//
// Parameters:
//		host				Host name or TCP/IP address separated by dots
//		port				Port number
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function opens a connection with the specified host. The host may
//		be specified by name, or with an IP address which consists of four
//		numbers separated by dots.
//
void tcpsocket::connect(const char* host, unsigned short port)
{
	// Initialise the address structure
	SOCKADDR_IN addr;
	make_addr(host, port, addr);

	// Open the connection
	if (::connect(m_socket, reinterpret_cast<SOCKADDR*>(&addr), sizeof(addr)))
	{ throw tcperror(); }
}

// void tcpsocket::disconnect()
//
// Purpose:
//		Close the currently open connection
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function gracefully closes the currently open connection.
//
void tcpsocket::disconnect()
{

	// Shutdown the socket
	if (shutdown(m_socket, SD_SEND))
	{
		throw tcperror();
	}

#ifdef	UNIX

		// Unix
	if	(close(m_socket))

#else

		// Windows
	if  (closesocket(m_socket))

#endif

	{ throw tcperror(); }

	// Bart Beumer CHANGE: als disconnect succesvol is, dan moet de handle
	// wel op INVALID SOCKET gezet worden. Anders wordt gepoogd de socket
	// ook in de destructor te sluiten.
	//
	m_socket = INVALID_SOCKET;
}

// void tcpsocket::accept(const tcpsocket& source)
//
// Purpose:
//		Open a connection by accepting it from the given socket
//
// Parameters:
//		source				Socket to accept a connection from
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function is meant to be used by server applications to accept
//		connections from clients. The socket 'source' must have been set to
//		listen mode before calling this function.
//
//		Note, the socket on which accept() is called should not be connected
//		when you call accept() on it. If it is, the connection is terminated
//		immediately.
//
//		This function blocks until a connection becomes available to be
//		accepted.
//
void tcpsocket::accept(const tcpsocket& source)
{
	// Destroy the current socket (terminates any open connection)

#ifdef	UNIX

	// Unix
	if ((m_socket != INVALID_SOCKET) && close (m_socket))
#else

	// Windows
	if ((m_socket != INVALID_SOCKET) && closesocket(m_socket))
#endif

	{ throw tcperror(); }

	// Accept a connection from the given socket
	m_socket = ::accept(source.m_socket, 0, 0);
	if (m_socket == INVALID_SOCKET)
	{ throw tcperror(); }
}

// void tcpsocket::listen(unsigned short port)
//
// Purpose:
//		Make this socket listen for clients on the specified port
//
// Parameters:
//		port				Port number
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function puts the socket into listening mode, so that it can be
//		used in a call to accept().
//
void tcpsocket::listen(unsigned short port)
{
	// Initialise the address structure
	SOCKADDR_IN addr;
	make_addr(0, port, addr);

#ifdef	UNIX

	// Unix
	// Socket option enable
	int nSetValue = 1;

	// Reuse socket
	setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (char*) &nSetValue, sizeof(int));
#endif

	// Bind the address
	if (bind(m_socket, reinterpret_cast<SOCKADDR*>(&addr), sizeof(addr)))
	{ throw tcperror(); }

	// Make the socket listen
	if (::listen(m_socket, SOMAXCONN))
	{ throw tcperror(); }
}

// unsigned long tcpsocket::recv(void* buffer, unsigned long size)
//
// Purpose:
//		Receive data
//
// Parameters:
//		buffer				Buffer to store data into
//		size				Size of the buffer
//
// Return value:
//		The number of bytes actually received.
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function receives data from the currently open connection.
//		Note that the actual number of bytes received may be less than the
//		size of the buffer. If this function is called while no data is ready
//		to be received, this function blocks until data is available.
//
unsigned long tcpsocket::recv(void* buffer, unsigned long size)
{
	// Receive data (possibly blocks)
	int count = ::recv(m_socket, static_cast<char*>(buffer), size, 0);
	if (count == SOCKET_ERROR)
	{ throw tcperror(); }

	// Return the number of bytes received
	return count;
}

// void tcpsocket::send(const void* buffer, unsigned long size)
//
// Purpose:
//		Send data
//
// Parameters:
//		buffer				Buffer to store data into
//		size				Size of the buffer
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function sends data through the currently open connection.
//
void tcpsocket::send(const void* buffer, unsigned long size)
{
	// Send data
	if (::send(m_socket, static_cast<const char*>(buffer), size, 0) == SOCKET_ERROR)
	{ throw tcperror(); }
}

// bool tcpsocket::recv_ready(long timeout)
//
// Purpose:
//		Check if this socket has data ready to be received
//
// Parameters:
//		timeout				Timeout value in milliseconds
//
// Return value:
//		true if data becomes available within the timeout period,
//		false if no data becomes available
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function checks if data is available to be received. If data
//		is available, the next call to recv() is guaranteerd not to block.
//
//		When called on a socket that has been put into listening mode, this
//		function will mark the socket as readable if a connection is waiting
//		to be accepted, which means that accept() is guaranteed not to block.
//
//		If the connection is closed gracefully while this function is waiting,
//		the socket will be marked readable, this function returns and the
//		next call to recv() will immediately return with 0 bytes received.
//
//		The default value for 'timeout' is 0, which means the function does
//		not wait. If -1 is specified, the function blocks until data is
//		available for receiving.
//
bool tcpsocket::recv_ready(long timeout)
{
	// Initialise the timeout structure if necessary
	timeval tv;
	if (timeout != -1)
	{
		tv.tv_sec = timeout / 1000;
		tv.tv_usec = (timeout % 1000) * 1000;
	}

	// TODO: In Windows sockets, the first parameter of select() is not used.
	// What should the value be when using another socket library?
	fd_set fds;
	FD_ZERO(&fds);
	FD_SET(m_socket, &fds);

	// Check if data is available to be received

#ifdef	UNIX

	// Unix
	int result = select((m_socket+1), &fds, 0, 0, (timeout != -1 ? &tv : 0));

#else

	// Windows
	int result = select(0, &fds, 0, 0, (timeout != -1 ? &tv : 0));

#endif
	if (result == SOCKET_ERROR)
	{ throw tcperror(); }

	// Return true if data is available, false otherwise
	return (result != 0);
}

// void tcpsocket::make_addr(const char* host, unsigned short port,
//     SOCKADDR_IN& addr)
//
// Purpose:
//		Initialise an address structure
//
// Parameters:
//		host				Host name or TCP/IP address separated by dots
//		port				Port number
//		addr				Address structure to initialise
//
// Exceptions:
//		Throws a tcperror if any socket error occurs.
//
// Comments:
//		This function uses the given host name and port number to initialse
//		the address structure. The host name may be a null pointer or a pointer
//		to an empty string, in which case the address is set to a "don't care"
//		value.
//
void tcpsocket::make_addr(const char* host, unsigned short port,
	SOCKADDR_IN& addr)
{
	// Initialise the address structure
	memset(&addr, 0, sizeof(addr));
	addr.sin_family = AF_INET;
	addr.sin_port = htons(port);

	if (host && host[0])
	{
		// Try to convert the dotted format string to an address
		addr.sin_addr.s_addr = inet_addr(host);

#ifdef	UNIX

		// Unix
		if (addr.sin_addr.s_addr != -1)
#else

		// Windows
		if (addr.sin_addr.s_addr == htonl(INADDR_NONE))
#endif
		{
			// Try to convert the host name to an address
			PHOSTENT phe = gethostbyname(host);
			if (!phe)
			{ throw tcperror(); }

			// Copy it into the address structure
			memcpy(&addr.sin_addr, phe->h_addr, phe->h_length);
		}
	}
	else
	{
		// No address specified, use a "don't care" value
		addr.sin_addr.s_addr = htonl(INADDR_ANY);
	}
}

////////////////////////////////////////////////////////////////////////////////
// class winsock_init

tcpsocket::winsock_init tcpsocket::m_winsock_init;
int tcpsocket::winsock_init::m_init_count = 0;

// tcpsocket::winsock_init::winsock_init()
//
// Purpose:
//		Initialise Windows sockets
//
tcpsocket::winsock_init::winsock_init()
{
	if (!m_init_count++)
	{
#ifdef	UNIX
#else
		// Windows

		WSADATA wsadata;
		WSAStartup(MAKEWORD(2, 0), &wsadata);
#endif
	}
}

// tcpsocket::winsock_init::~winsock_init()
//
// Purpose:
//		Cleanup Windows sockets
//
tcpsocket::winsock_init::~winsock_init()
{
	if (!--m_init_count)
	{
#ifdef	UNIX
#else
		// Windows
		WSACleanup();
#endif
	}
}

////////////////////////////////////////////////////////////////////////////////


text:
var assert = require('nodetk/testing/custom_assert')
  , server = require('../../lib/server')
  , tools = require('nodetk/testing/tools')
  , extend = require('nodetk/utils').extend
  , expect_oauth_error = require('./tools').expect_oauth_error
  ;

// To reinit faked/mocked stuff in the end:
var initial_oauth_error = server.oauth_error;
var initial_Model = server.Model;
var initial_valid_grant = server.valid_grant;
exports.module_close = function(callback) {
  server.oauth_error = initial_oauth_error;
  server.Model = initial_Model;
  server.valid_grant = initial_valid_grant;
  callback();
};

exports.tests = [

['no req.form', 3, function() {
  var res = 'resobj';
  var req = {};
  expect_oauth_error(res, 'oat', 'invalid_request');
  server.token_endpoint(req, res);
}],

['req.form with err', 3, function() {
  var res = 'resobj';
  var req = {form: {complete: function(callback){callback('error')}}};
  expect_oauth_error(res, 'oat', 'invalid_request');
  server.token_endpoint(req, res);
}],

['Missing parameter', 12, function() {
  server.Model = {};
  var res = 'resobj';
  var params = {grant_type: 1, client_id: 1, code: 1, redirect_uri: 1};
  Object.keys(params).forEach(function(missing) {
    var mparams = extend({}, params);
    delete mparams[missing];
    var req = {form: {complete: function(callback){callback(null, mparams)}}};
    expect_oauth_error(res, 'oat', 'invalid_request');
    server.token_endpoint(req, res);
  });
}],

['Unsupported grant_type', 12, function() {
  server.Model = {};
  var res = 'resobj';
  var params = {client_id: 1, code: 1, redirect_uri: 1};
  [ "password"
  , "assertion"
  , "refresh_token"
  , "none"].forEach(function(grant_type) {
    var params2 = extend({grant_type: grant_type}, params);
    var req = {form: {complete: function(callback){callback(null, params2)}}};
    expect_oauth_error(res, 'oat', 'unsupported_grant_type');
    server.token_endpoint(req, res);
  });
}],

['client_secret given twice', 3, function() {
  server.Model = {};
  var res = 'resobj';
  var params = {
    client_id: 1, code: 1, redirect_uri: 1,
    grant_type: 'authorization_code',
    client_secret: 'somesecret'
  };
  var req = {
    headers: {authorization: 'Basic somesecret'}
  , form: {complete: function(callback){callback(null, params)}}
  };
  expect_oauth_error(res, 'oat', 'invalid_request');
  server.token_endpoint(req, res);
}],

['Unexisting client', 4, function() {
  server.Model = {Client: {getById: function(id, callback) {
    assert.equal(id, 'cid');
    callback(null, null);
  }}};
  var res = 'resobj';
  var params = {
    client_id: 'cid', code: 1, redirect_uri: 1,
    grant_type: 'authorization_code',
  };
  var req = {
    headers: {authorization: 'Basic somesecret'}
  , form: {complete: function(callback){callback(null, params)}}
  };
  expect_oauth_error(res, 'oat', 'invalid_client');
  server.token_endpoint(req, res);
}],

['Incorrect secret (in headers)', 4, function() {
  server.Model = {Client: {getById: function(id, callback) {
    assert.equal(id, 'cid');
      callback(null, {secret: 'someothersecret'});
  }}};
  var res = 'resobj';
  var params = {
    client_id: 'cid', code: 1, redirect_uri: 1,
    grant_type: 'authorization_code',
    //client_secret: 'somesecret'
  };
  var req = {
    headers: {authorization: 'Basic somesecret'}
  , form: {complete: function(callback){callback(null, params)}}
  };
  expect_oauth_error(res, 'oat', 'invalid_client');
  server.token_endpoint(req, res);
}],

['Incorrect secret (in params)', 4, function() {
  server.Model = {Client: {getById: function(id, callback) {
    assert.equal(id, 'cid');
    callback(null, {secret: 'someothersecret'});
  }}};
  var res = 'resobj';
  var params = {
    client_id: 'cid', code: 1, redirect_uri: 1,
    grant_type: 'authorization_code',
    client_secret: 'somesecret'
  };
  var req = {
    headers: {}
  , form: {complete: function(callback){callback(null, params)}}
  };
  expect_oauth_error(res, 'oat', 'invalid_client');
  server.token_endpoint(req, res);
}],

['Invalid grant', 3, function() {
  server.Model = {Client: {getById: function(id, callback) {
      callback(null, {secret: 'somesecret', redirect_uri: 'http://client/process'});
  }}};
  server.valid_grant = function(_, _, callback){callback(null)};
  var res = 'resobj';
  var params = {
    client_id: 'cid', code: 1, redirect_uri: 'http://client/process',
    grant_type: 'authorization_code',
    client_secret: 'somesecret'
  };
  var req = {
    headers: {}
  , form: {complete: function(callback){callback(null, params)}}
  };
  expect_oauth_error(res, 'oat', 'invalid_grant');
  server.token_endpoint(req, res);
}],

['Error retrieving client', 3, function() {
  server.Model = {Client: {getById: function(id, callback) {
    callback('error');
  }}};
  var params = {
    client_id: 'cid', code: 1, redirect_uri: 'http://client/process',
    grant_type: 'authorization_code',
    client_secret: 'somesecret'
  };
  var req = {
    headers: {}
  , form: {complete: function(callback){callback(null, params)}}
  };
  var res = tools.get_expected_res(500);
  server.token_endpoint(req, res);
}],

['Error while validating grant', 3, function() {
  server.Model = {Client: {getById: function(id, callback) {
      callback(null, {secret: 'somesecret', redirect_uri: 'http://client/process'});
  }}};
  server.valid_grant = function(_, _, callback){callback('error')};
  var params = {
    client_id: 'cid', code: 1, redirect_uri: 'http://client/process',
    grant_type: 'authorization_code',
    client_secret: 'somesecret'
  };
  var req = {
    headers: {}
  , form: {complete: function(callback){callback(null, params)}}
  };
  var res = tools.get_expected_res(500);
  server.token_endpoint(req, res);
}],

['Valid grant', 3, function() {
  server.Model = {Client: {getById: function(id, callback) {
    callback(null, {secret: 'somesecret', redirect_uri: 'http://client/process'});
  }}};
    server.valid_grant = function(_, _, callback){callback(null, {'a': 'b'})};
  var params = {
    client_id: 'cid', code: 1, redirect_uri: 'http://client/process',
    grant_type: 'authorization_code',
    client_secret: 'somesecret'
  };
  var req = {
    headers: {}
  , form: {complete: function(callback){callback(null, params)}}
  };
  var res = {
    writeHead: function(status_code, headers) {
      assert.equal(status_code, 200);
      assert.deepEqual(headers, {
        'Content-Type': 'application/json'
      , 'Cache-Control': 'no-store'
      });
    }
  , end: function(body) {
      assert.equal(body, '{"a":"b"}');
    }
  };
  expect_oauth_error(res, 'oat', 'invalid_grant');
  server.token_endpoint(req, res);
}],

];


text:
<!DOCTYPE html>

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

            Media Query Game

            This is an extremely simple proof of concept game based on media queries and resizing the window to move the main character. To play resize your window to its smallest size. The game will start. Attempt to get to the hole in the opposite corner without the slow lasers touching you. All levels are css sytlesheets and when you beat one you move to the next one. The animation of the player is also my first steps towards making a spriting library.

            Level Completed!

            Great Job! Resize your window to its smallest size to play the next level.

            Good Try!

            Avoid the lasers and going off the board. Sometimes you have to resize the window in diffent ways to stop the lasers from hitting you. Resize your window to its smallest size to play again.

            You Win!

            You beat all the stylesheets! Great job!


text:
@interface GHTestViewController : NSViewController {
	NSSplitView *splitView_;
	NSView *statusView_;
	NSView *detailsView_;

	NSTextField *statusLabel_;
	NSProgressIndicator *progressIndicator_;
	NSOutlineView *outlineView_;

	NSSegmentedControl *textSegmentedControl_;
	NSTextView *textView_;

	BOOL wrapInTextView_;

	GHTestViewModel *model_;
}

// Assign since they are retained as subviews
@property (assign, nonatomic) IBOutlet NSSplitView *splitView;
@property (assign, nonatomic) IBOutlet NSView *statusView;
@property (assign, nonatomic) IBOutlet NSView *detailsView;
@property (assign, nonatomic) IBOutlet NSTextField *statusLabel;
@property (assign, nonatomic) IBOutlet NSProgressIndicator *progressIndicator;
@property (assign, nonatomic) IBOutlet NSOutlineView *outlineView;
@property (assign, nonatomic) IBOutlet NSSegmentedControl *textSegmentedControl;
@property (assign, nonatomic) IBOutlet NSTextView *textView;
@property (assign, nonatomic) BOOL wrapInTextView;
@property (readonly, nonatomic) id<GHTest> selectedTest;

@property (copy, nonatomic) NSString *status;

- (void)log:(NSString *)log;
- (void)test:(id<GHTest>)test didLog:(NSString *)message;

- (void)updateTest:(id<GHTest>)test;

- (void)setRoot:(id<GHTestGroup>)root;

- (void)selectFirstFailure;

- (GHTestNode *)findFailure;
- (GHTestNode *)findFailureFromNode:(GHTestNode *)node;

- (IBAction)copy:(id)sender;

@end


text:
package boofcv.struct.image;

import boofcv.core.image.FactoryGImageSingleBand;
import boofcv.core.image.GImageSingleBand;
import boofcv.core.image.GeneralizedImageOps;
import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import org.junit.Test;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Random;

import static org.junit.Assert.*;

/**
 * Standard tests for children of {@link ImageSingleBand}.  Ensures that they contain
 * all the expected functions and that they have the expected behavior.  This is done
 * through extensive use of reflections.
 *
 * @author Peter Abeles
 */
public abstract class StandardSingleBandTests {

	public Random rand = new Random(234);

	public abstract ImageSingleBand createImage(int width, int height);

	public abstract Number randomNumber();

	/**
	 * Sets each element in the image to a random value.
	 */
	public void setRandom(ImageSingleBand img) {
		Object data = img._getData();

		int N = Array.getLength(data);
		for (int i = 0; i < N; i++) {
			Array.set(data, i, randomNumber());
		}
	}

	/**
	 * Check for a positive case of get() and set()
	 */
	@Test
	public void get_set() {
		ImageSingleBand img = createImage(10, 20);
		setRandom(img);

		Number expected = randomNumber();
		Number orig = (Number) call(img, "get", 0, null, 1, 1);

		// make sure the two are not equal
		assertFalse(expected.equals(orig));

		// set the expected to the point in the image
		call(img, "set", 1, expected, 1, 1);
		Number found = (Number) call(img, "get", 0, null, 1, 1);
		if (!img.getDataType().isInteger())
			assertEquals(expected.doubleValue(), found.doubleValue(), 1e-4);
		else {
			if( img.getDataType().isSigned() )
				assertTrue(expected.intValue() == found.intValue());
			else
				assertTrue((expected.intValue() & 0xFFFF) == found.intValue());
		}
	}

	/**
	 * Check for a positive case of get() and set()
	 */
	@Test
	public void unsafe_get_set() {
		ImageSingleBand img = createImage(10, 20);
		setRandom(img);

		Number expected = randomNumber();
		Number orig = (Number) call(img, "unsafe_get", 0, null, 1, 1);

		// make sure the two are not equal
		assertFalse(expected.equals(orig));

		// set the expected to the point in the image
		call(img, "unsafe_set", 1, expected, 1, 1);
		Number found = (Number) call(img, "unsafe_get", 0, null, 1, 1);
		if (!img.getDataType().isInteger())
			assertEquals(expected.doubleValue(), found.doubleValue(), 1e-4);
		else {
			if( img.getDataType().isSigned() )
				assertTrue(expected.intValue() == found.intValue());
			else
				assertTrue((expected.intValue() & 0xFFFF) == found.intValue());
		}
	}

	/**
	 * Makes sure all the accessors do proper bounds checking
	 */
	@Test
	public void accessorBounds() {
		ImageSingleBand img = createImage(10, 20);

		checkBound(img, "get", 0, null);
		checkBound(img, "set", 1, randomNumber());
	}

	private void checkBound(ImageSingleBand img, String method,
							int type, Object typeData) {
		checkException(img, method, type, typeData, -1, 0);
		checkException(img, method, type, typeData, 0, -1);
		checkException(img, method, type, typeData, img.getWidth(), 0);
		checkException(img, method, type, typeData, 0, img.getHeight());
	}

	private void checkException(ImageSingleBand img, String method,
								int type, Object typeData, int... where) {
		boolean found = false;
		try {
			call(img, method, type, typeData, where);
		} catch (ImageAccessException e) {
			found = true;
		}

		assertTrue("No exception was thrown", found);
	}

	private Object call(ImageSingleBand img, String method,
						int type, Object typeData, int... where) {
		try {
			Class<?>[] paramTypes = type == 0 ?
					new Class<?>[where.length] : new Class<?>[where.length + 1];
			Object[] args = new Object[paramTypes.length];

			int index;

			for (index = 0; index < where.length; index++) {
				paramTypes[index] = int.class;
				args[index] = where[index];
			}
			if (type == 1) {
				paramTypes[index] = img.getDataType().getSumType();
				args[index] = typeData;
			} else if (type == 2) {
				String name = "[" + img.getDataType().getDataType().getName().toUpperCase().charAt(0);
				paramTypes[index] = Class.forName(name);
				args[index] = typeData;
			}

			Method m = img.getClass().getMethod(method, paramTypes);

			return m.invoke(img, args);
		} catch (ClassNotFoundException e) {
			throw new RuntimeException(e);
		} catch (NoSuchMethodException e) {
			fail("The method " + method + " needs to be implemented");
		} catch (IllegalAccessException e) {
			throw new RuntimeException(e);
		} catch (InvocationTargetException e) {
			throw (RuntimeException) e.getCause();
		}
		throw new RuntimeException("Shouldn't be here");
	}

	@Test
	public void subimage() {
		ImageSingleBand img = createImage(10, 20);
		setRandom(img);

		ImageSingleBand sub = img.subimage(2,3,3,5, null);

		assertTrue(img.getImageType() == sub.getImageType());
		assertEquals(1, sub.getWidth());
		assertEquals(2, sub.getHeight());

		GImageSingleBand a = FactoryGImageSingleBand.wrap(img);
		GImageSingleBand b = FactoryGImageSingleBand.wrap(sub);

		assertEquals(a.get(2, 3), b.get(0, 0));
		assertEquals(a.get(2, 4), b.get(0, 1));
	}

	@Test
	public void reshape() {
		ImageSingleBand img = createImage(10, 20);

		// reshape to something smaller
		img.reshape(5,4);
		assertEquals(5, img.getWidth());
		assertEquals(4, img.getHeight());

		// reshape to something larger
		img.reshape(15,21);
		assertEquals(15, img.getWidth());
		assertEquals(21, img.getHeight());
	}

	@Test
	public void serialize() throws IOException, ClassNotFoundException {

		// randomly fill the image
		ImageSingleBand imgA = createImage(10, 20);
		GImageSingleBand a = FactoryGImageSingleBand.wrap(imgA);
		for (int i = 0; i < imgA.getHeight(); i++) {
			for (int j = 0; j < imgA.getWidth(); j++) {
				a.set(j,i,rand.nextDouble()*200);
			}
		}

		// make a copy of the original
		ImageSingleBand imgB = (ImageSingleBand)imgA.clone();

		ByteOutputStream streamOut = new ByteOutputStream(1000);
		ObjectOutputStream out = new ObjectOutputStream(streamOut);
		out.writeObject(imgA);
		out.close();

		ByteInputStream streamIn = new ByteInputStream(streamOut.getBytes(),streamOut.getCount());
		ObjectInputStream in = new ObjectInputStream(streamIn);

		ImageSingleBand found = (ImageSingleBand)in.readObject();

		// see if everything is equals
		checkEquals(imgA, imgB);
		checkEquals(imgA, found);
	}

	private void checkEquals(ImageSingleBand imgA, ImageSingleBand imgB) {
		for (int i = 0; i < imgA.getHeight(); i++) {
			for (int j = 0; j < imgA.getWidth(); j++) {
				double valA = GeneralizedImageOps.get(imgA, j, i);
				double valB = GeneralizedImageOps.get(imgB, j, i);

				assertEquals(valA, valB, 1e-8);
			}
		}
	}
}


text:
package org.wso2.carbon.event.stream.core;

import org.wso2.carbon.databridge.commons.Event;
import org.wso2.carbon.databridge.commons.StreamDefinition;
import org.wso2.carbon.event.stream.core.exception.EventStreamConfigurationException;

import java.util.List;

public interface EventStreamService {

    /**
     * @param name
     * @param version
     * @return
     */
    public StreamDefinition getStreamDefinition(String name, String version)
            throws EventStreamConfigurationException;

    /**
     * @param streamId
     * @return
     */
    public StreamDefinition getStreamDefinition(String streamId)
            throws EventStreamConfigurationException;

    public EventStreamConfiguration getEventStreamConfiguration(String streamId);

    /**
     * @return
     * @throws EventStreamConfigurationException
     */
    public List<StreamDefinition> getAllStreamDefinitions()
            throws EventStreamConfigurationException;

    public List<EventStreamConfiguration> getAllEventStreamConfigurations()
            throws EventStreamConfigurationException;
    /**
     * @param streamDefinition
     * @throws EventStreamConfigurationException
     */
    public void addEventStreamDefinition(StreamDefinition streamDefinition) throws
            EventStreamConfigurationException;

    /**
     * @param streamName
     * @param streamVersion
     * @throws EventStreamConfigurationException
     */
    public void removeEventStreamDefinition(String streamName, String streamVersion)
            throws EventStreamConfigurationException;

    /**
     * @return
     * @throws EventStreamConfigurationException
     */
    public List<String> getStreamIds() throws EventStreamConfigurationException;

    public String generateSampleEvent(String streamId, String eventType)
            throws EventStreamConfigurationException;

    public void subscribe(SiddhiEventConsumer siddhiEventConsumer) throws EventStreamConfigurationException;

    public void subscribe(EventProducer eventProducer) throws EventStreamConfigurationException;

    public void subscribe(WSO2EventConsumer wso2EventConsumer) throws EventStreamConfigurationException;

    public void subscribe(WSO2EventListConsumer wso2EventListConsumer) throws EventStreamConfigurationException;

    public void unsubscribe(SiddhiEventConsumer siddhiEventConsumer);

    public void unsubscribe(EventProducer eventProducer);

    public void unsubscribe(WSO2EventConsumer wso2EventConsumer);

    public void unsubscribe(WSO2EventListConsumer wso2EventConsumer);

    public void publish(Event event);

}


text:
namespace chromeos {

class ShillThirdPartyVpnObserver;

// ShillThirdPartyVpnDriverClient is used to communicate with the Shill
// ThirdPartyVpnDriver service.
// All methods should be called from the origin thread which initializes the
// DBusThreadManager instance.
class CHROMEOS_EXPORT ShillThirdPartyVpnDriverClient : public DBusClient {
 public:
  class TestInterface {
   public:
    virtual void OnPacketReceived(const std::string& object_path_value,
                                  const std::vector<char>& packet) = 0;
    virtual void OnPlatformMessage(const std::string& object_path_value,
                                   uint32_t message) = 0;

   protected:
    virtual ~TestInterface() {}
  };

  ~ShillThirdPartyVpnDriverClient() override;

  // Factory function, creates a new instance which is owned by the caller.
  // For normal usage, access the singleton via DBusThreadManager::Get().
  static ShillThirdPartyVpnDriverClient* Create();

  // Adds an |observer| for the third party vpn driver at |object_path_value|.
  virtual void AddShillThirdPartyVpnObserver(
      const std::string& object_path_value,
      ShillThirdPartyVpnObserver* observer) = 0;

  // Removes an |observer| for the third party vpn driver at
  // |object_path_value|.
  virtual void RemoveShillThirdPartyVpnObserver(
      const std::string& object_path_value) = 0;

  // Calls SetParameters method.
  // |callback| is called after the method call succeeds.
  virtual void SetParameters(
      const std::string& object_path_value,
      const base::DictionaryValue& parameters,
      const ShillClientHelper::StringCallback& callback,
      const ShillClientHelper::ErrorCallback& error_callback) = 0;

  // Calls UpdateConnectionState method.
  // |callback| is called after the method call succeeds.
  virtual void UpdateConnectionState(
      const std::string& object_path_value,
      const uint32_t connection_state,
      const base::Closure& callback,
      const ShillClientHelper::ErrorCallback& error_callback) = 0;

  // Calls SendPacket method.
  // |callback| is called after the method call succeeds.
  virtual void SendPacket(
      const std::string& object_path_value,
      const std::vector<char>& ip_packet,
      const base::Closure& callback,
      const ShillClientHelper::ErrorCallback& error_callback) = 0;

  // Returns an interface for testing (stub only), or returns nullptr.
  virtual ShillThirdPartyVpnDriverClient::TestInterface* GetTestInterface() = 0;

 protected:
  friend class ShillThirdPartyVpnDriverClientTest;

  // Create() should be used instead.
  ShillThirdPartyVpnDriverClient();

 private:
  DISALLOW_COPY_AND_ASSIGN(ShillThirdPartyVpnDriverClient);
};

}  // namespace chromeos

#endif  // CHROMEOS_DBUS_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_


text:
require File.dirname(__FILE__) + "/../../spec_helper"

describe Lingua::IT::Syllable do

  subject { Lingua::IT::Syllable }

  describe "#syllables" do
    let(:input) { "Andiamo alla farmacia, leggendo geografia." }
    let(:output) { subject.syllables(input) }

    it "should correctly hyphenate the sentence" do
      expect(output.length).to eq(17)
      expect(output[0]).to eq "An"
      expect(output[1]).to eq "dia"
      expect(output[2]).to eq "mo"
      expect(output[3]).to eq "al"
      expect(output[4]).to eq "la"
      expect(output[5]).to eq "far"
      expect(output[6]).to eq "ma"
      expect(output[7]).to eq "ci"
      expect(output[8]).to eq "a"
      expect(output[9]).to eq "leg"
      expect(output[10]).to eq "gen"
      expect(output[11]).to eq "do"
      expect(output[12]).to eq "ge"
      expect(output[13]).to eq "o"
      expect(output[14]).to eq "gra"
      expect(output[15]).to eq "fi"
      expect(output[16]).to eq "a"
    end

    let(:case_1_input) { "Finestra" }
    let(:case_1_output) { subject.syllables(case_1_input) }

    it "should correctly hyphenate the word 'finestra'" do
      expect(case_1_output.length).to eq(3)
      expect(case_1_output[0]).to eq "Fi"
      expect(case_1_output[1]).to eq "ne"
      expect(case_1_output[2]).to eq "stra"
    end

    let(:case_2_input) { "Attività" }
    let(:case_2_output) { subject.syllables(case_2_input) }

    it "should correctly hyphenate the word 'attività'" do
      expect(case_2_output.length).to eq(4)
      expect(case_2_output[0]).to eq "At"
      expect(case_2_output[1]).to eq "ti"
      expect(case_2_output[2]).to eq "vi"
      expect(case_2_output[3]).to eq "tà"
    end
  end
end


text:
import http from './http';
import state from './state';
import { createError } from './error';

function query(userId, options) {
  if(!userId) {
    return Promise.reject(createError('Not Authenticated: missing userId', 401));
  }

  const parts = ['count', 'page_info { end_cursor, has_next_page }'];

  if(options.nodes) {
    parts.push(`nodes{${options.nodes.join(',')}}`);
  }

  const count = options.cursor ? `after(${options.cursor}, ${options.count})` : `first(${options.count})`;
  const q = `ig_user(${userId}) {
    ${options.type}.${count} {
      ${parts.join(',')}
    }
  }`;

  return http.post('/query/', { q, ref: options.ref });
}

export default query;


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item><shape android:shape="rectangle">
            <solid android:color="@color/signme_dark_green" />
        </shape></item>

</selector>


text:
#include "trap.h"
#include "c66xx.h"

#include <rthw.h>
#include <rtdef.h>
#include <rtthread.h>

#define RT_SYS_STACK_SIZE    4096

rt_uint8_t rt_system_stack[RT_SYS_STACK_SIZE];
rt_uint8_t *rt_system_stack_top;

void rt_trap_init(void)
{
    rt_system_stack_top = &rt_system_stack[RT_SYS_STACK_SIZE-1];
    rt_system_stack_top  = (rt_uint8_t *)RT_ALIGN_DOWN((rt_uint32_t)rt_system_stack_top, 8);

    ack_exception(EXCEPT_TYPE_NXF);
    ack_exception(EXCEPT_TYPE_EXC);
    ack_exception(EXCEPT_TYPE_IXF);
    ack_exception(EXCEPT_TYPE_SXF);
    rt_hw_enable_exception();
}

void show_regs(struct rt_hw_exp_stack_register *regs)
{
    rt_kprintf("\n");
    rt_kprintf("PC: %08lx SP: %08lx\n",
           regs->pc, regs->hw_register.sp);
    rt_kprintf("Status: %08lx ORIG_A4: %08lx\n",
           regs->csr, regs->orig_a4);
    rt_kprintf("A0: %08lx  B0: %08lx\n",
           regs->hw_register.a0, regs->hw_register.b0);
    rt_kprintf("A1: %08lx  B1: %08lx\n",
           regs->hw_register.a1, regs->hw_register.b1);
    rt_kprintf("A2: %08lx  B2: %08lx\n",
           regs->hw_register.a2, regs->hw_register.b2);
    rt_kprintf("A3: %08lx  B3: %08lx\n",
           regs->hw_register.a3, regs->hw_register.b3);
    rt_kprintf("A4: %08lx  B4: %08lx\n",
           regs->hw_register.a4, regs->hw_register.b4);
    rt_kprintf("A5: %08lx  B5: %08lx\n",
           regs->hw_register.a5, regs->hw_register.b5);
    rt_kprintf("A6: %08lx  B6: %08lx\n",
           regs->hw_register.a6, regs->hw_register.b6);
    rt_kprintf("A7: %08lx  B7: %08lx\n",
           regs->hw_register.a7, regs->hw_register.b7);
    rt_kprintf("A8: %08lx  B8: %08lx\n",
           regs->hw_register.a8, regs->hw_register.b8);
    rt_kprintf("A9: %08lx  B9: %08lx\n",
           regs->hw_register.a9, regs->hw_register.b9);
    rt_kprintf("A10: %08lx  B10: %08lx\n",
           regs->hw_register.a10, regs->hw_register.b10);
    rt_kprintf("A11: %08lx  B11: %08lx\n",
           regs->hw_register.a11, regs->hw_register.b11);
    rt_kprintf("A12: %08lx  B12: %08lx\n",
           regs->hw_register.a12, regs->hw_register.b12);
    rt_kprintf("A13: %08lx  B13: %08lx\n",
           regs->hw_register.a13, regs->hw_register.b13);
    rt_kprintf("A14: %08lx  B14: %08lx\n",
           regs->hw_register.a14, regs->hw_register.dp);
    rt_kprintf("A15: %08lx  B15: %08lx\n",
           regs->hw_register.a15, regs->hw_register.sp);
    rt_kprintf("A16: %08lx  B16: %08lx\n",
           regs->hw_register.a16, regs->hw_register.b16);
    rt_kprintf("A17: %08lx  B17: %08lx\n",
           regs->hw_register.a17, regs->hw_register.b17);
    rt_kprintf("A18: %08lx  B18: %08lx\n",
           regs->hw_register.a18, regs->hw_register.b18);
    rt_kprintf("A19: %08lx  B19: %08lx\n",
           regs->hw_register.a19, regs->hw_register.b19);
    rt_kprintf("A20: %08lx  B20: %08lx\n",
           regs->hw_register.a20, regs->hw_register.b20);
    rt_kprintf("A21: %08lx  B21: %08lx\n",
           regs->hw_register.a21, regs->hw_register.b21);
    rt_kprintf("A22: %08lx  B22: %08lx\n",
           regs->hw_register.a22, regs->hw_register.b22);
    rt_kprintf("A23: %08lx  B23: %08lx\n",
           regs->hw_register.a23, regs->hw_register.b23);
    rt_kprintf("A24: %08lx  B24: %08lx\n",
           regs->hw_register.a24, regs->hw_register.b24);
    rt_kprintf("A25: %08lx  B25: %08lx\n",
           regs->hw_register.a25, regs->hw_register.b25);
    rt_kprintf("A26: %08lx  B26: %08lx\n",
           regs->hw_register.a26, regs->hw_register.b26);
    rt_kprintf("A27: %08lx  B27: %08lx\n",
           regs->hw_register.a27, regs->hw_register.b27);
    rt_kprintf("A28: %08lx  B28: %08lx\n",
           regs->hw_register.a28, regs->hw_register.b28);
    rt_kprintf("A29: %08lx  B29: %08lx\n",
           regs->hw_register.a29, regs->hw_register.b29);
    rt_kprintf("A30: %08lx  B30: %08lx\n",
           regs->hw_register.a30, regs->hw_register.b30);
    rt_kprintf("A31: %08lx  B31: %08lx\n",
           regs->hw_register.a31, regs->hw_register.b31);
}

void do_trap(struct rt_exception_info *except_info, struct rt_hw_exp_stack_register *regs)
{
    rt_kprintf("Enter exception: %s\n", except_info->kernel_str);

    show_regs(regs);

    for(;;){}
}

static struct rt_exception_info iexcept_table[10] = {
    { " - instruction fetch",         ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - fetch packet",              ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - execute packet",            ABORT_TYPE_UNDDEF, ABORT_OPCODE_ILL },
    { " - undefined instruction",     ABORT_TYPE_UNDDEF, ABORT_OPCODE_ILL },
    { " - resource conflict",         ABORT_TYPE_UNDDEF, ABORT_OPCODE_ILL },
    { " - resource access",           ABORT_TYPE_UNDDEF, ABORT_PRVREG_ILL },
    { " - privilege",                 ABORT_TYPE_UNDDEF, ABORT_PRVOPC_ILL },
    { " - loops buffer",              ABORT_TYPE_UNDDEF, ABORT_PRVOPC_ILL },
    { " - software exception",        ABORT_TYPE_UNDDEF, ABORT_ILLTRP_ILL },
    { " - unknown exception",         ABORT_TYPE_UNDDEF, ABORT_PRVOPC_ILL }
};

/*
 * Process an internal exception (non maskable)
 */
static int process_iexcept(struct rt_hw_exp_stack_register *regs)
{
    unsigned int iexcept_report = get_iexcept();
    unsigned int iexcept_num = 0;

    ack_exception(EXCEPT_TYPE_IXF);

    while(iexcept_report)
    {
        iexcept_num = ffs(iexcept_report);
        iexcept_report &= ~(1 << iexcept_num);
        set_iexcept(iexcept_report);

        if (*(unsigned int *)regs->pc == BKPT_OPCODE)
        {
            /* This is a breakpoint */
            struct rt_exception_info bkpt_exception = \
                                     { " - undefined instruction",\
                                     ABORT_TYPE_UNDDEF, ABORT_BRKPT_ILL };
            do_trap(&bkpt_exception, regs);
            iexcept_report &= ~(0xFF);
            set_iexcept(iexcept_report);
            continue;
        }
        do_trap(&iexcept_table[iexcept_num], regs);
    }
    return 0;
}

static struct rt_exception_info eexcept_table[128] = {
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },

    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },

    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },

    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },
    { " - external exception", ABORT_TYPE_BUS, ABORT_BUS_ADDRERR },

    { " - CPU memory protection fault",        ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - CPU memory protection fault in L1P", ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - DMA memory protection fault in L1P", ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - CPU memory protection fault in L1D", ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - DMA memory protection fault in L1D", ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - CPU memory protection fault in L2",  ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - DMA memory protection fault in L2",  ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - EMC CPU memory protection fault",    ABORT_TYPE_MAP, ABORT_BUS_ACCERR },
    { " - EMC bus error",                      ABORT_TYPE_MAP, ABORT_BUS_ADDRERR }
};

/*
 * Process an external exception (maskable)
 */
static void process_eexcept(struct rt_hw_exp_stack_register *regs)
{
    int except_num = 0;
    int bank = 0;
    int i = 0;

    for (i = 0; i <= 3; i++)
    {
        while (INTC_MEXPMASK[i])
       {
            __dint();
            except_num = ffs(INTC_MEXPMASK[i]);
            INTC_MEXPMASK[i] &= ~(1 << except_num); /* ack the external exception */
            __rint();
            do_trap(&eexcept_table[except_num + (bank << 5)], regs);
        }
        bank++;
    }

    ack_exception(EXCEPT_TYPE_EXC);
}

extern void hw_nmi_handler(struct rt_hw_exp_stack_register *regs);
/*
 * Main exception processing
 */
int rt_hw_process_exception(struct rt_hw_exp_stack_register *regs)
{
    int type = 0;
    int type_num = 0;
    int ie_num = 9; /* default is unknown exception */

    while ((type = get_except_type()) != 0) {
        type_num = fls(type) - 1;

        switch(type_num) {
        case EXCEPT_TYPE_NXF:                   /* NMI exception   */
            ack_exception(EXCEPT_TYPE_NXF);     /* clear exception */
            if (hw_nmi_handler != RT_NULL)
            {
                hw_nmi_handler(regs);
            }
            break;

        case EXCEPT_TYPE_IXF:                   /* internal exception */
            if (process_iexcept(regs))
            {
                return 1;
            }
            break;

        case EXCEPT_TYPE_EXC:                   /* external exception  */
            process_eexcept(regs);
            break;

        case EXCEPT_TYPE_SXF:                   /* software exception */
            ie_num = 8;
            ack_exception(type_num);
            break;
        default:                                /* clear exception */
            ack_exception(type_num);
            do_trap(&iexcept_table[ie_num], regs);
            break;
        }
    }
    return 0;
}


text:
package org.jugbd.mnet.service;

import org.jugbd.mnet.domain.ChiefComplaint;
import org.jugbd.mnet.domain.enums.RegistrationType;
import org.springframework.stereotype.Service;

/**
 * @author Bazlur Rahman Rokon
 * @date 11/29/2014.
 */
@Service
public interface ChiefComplaintService {
    ChiefComplaint save(ChiefComplaint chiefComplaint);

    ChiefComplaint findOne(Long id);

    ChiefComplaint save(ChiefComplaint chiefComplaint, RegistrationType registrationType);
}


text:
using System.Collections.Generic;
using System.Linq;
using NetTypeS.Elements.Primitives;
using NetTypeS.Interfaces;

namespace NetTypeS.Elements
{
    /// <summary>
    /// TypeScript code interface element
    /// </summary>
    public class TypeScriptInterface : EmptyElement
    {
        private readonly TypeNameElement _name;
        private readonly IReadOnlyCollection<TypeLinkElement> _extends;
        private readonly IReadOnlyCollection<ITypeProperty> _properties;
        private readonly ITypeScriptElement _body;
        private readonly bool _export;
        private readonly bool _declaration;

        public TypeScriptInterface(IComplexType type, bool declaration = false, bool export = false)
            : this(new TypeNameElement(type.Type), GetExtensionsIfInterface(type), type.Properties, declaration, export)
        {
        }

        public TypeScriptInterface(TypeNameElement name, IEnumerable<PropertyElement> members,
            bool declaration = false, bool export = false)
            : this(name, null, members, declaration, export)
        {
        }

        public TypeScriptInterface(TypeNameElement name, IEnumerable<ITypeProperty> properties,
            bool declaration = false, bool export = false)
            : this(name, null, properties, null, declaration, export)
        {
        }

        public TypeScriptInterface(TypeNameElement name, IEnumerable<TypeLinkElement> extends,
            IEnumerable<PropertyElement> members,
            bool declaration = false, bool export = false)
            : this(name, extends, (IEnumerable<ITypeScriptElement>)members, declaration, export)
        {
        }

        public TypeScriptInterface(TypeNameElement name, IEnumerable<ITypeScriptElement> members,
            bool declaration = false, bool export = false)
            : this(name, null, members, declaration, export)
        {
        }

        public TypeScriptInterface(TypeNameElement name, IEnumerable<TypeLinkElement> extends,
            IEnumerable<ITypeProperty> properties,
            bool declaration = false, bool export = false)
            : this(name, extends, properties, null, declaration, export)
        {
        }

        public TypeScriptInterface(TypeNameElement name, IEnumerable<TypeLinkElement> extends,
            IEnumerable<ITypeScriptElement> members,
            bool declaration = false, bool export = false)
            : this(name, extends, null, members, declaration, export)
        {
        }

        public TypeScriptInterface(TypeNameElement name, IEnumerable<TypeLinkElement> extends,
            IEnumerable<ITypeProperty> properties,
            IEnumerable<ITypeScriptElement> members, bool declaration = false, bool export = false)
        {
            _name = name;
            _properties = properties?.ToArray();
            _body = members == null ? null : new BlockElement(AppendSemicolon(members));
            _extends = extends?.ToArray();
            _export = export;
            _declaration = declaration;
        }

        private static IEnumerable<TypeLinkElement> GetExtensionsIfInterface(IComplexType complexType)
        {
            if (!complexType.IsInterface || complexType.Interfaces.Length == 0)
                return null;
            return complexType.Interfaces.Select(i => new TypeLinkElement(i));
        }

        private static IEnumerable<ITypeScriptElement> AppendSemicolon(IEnumerable<ITypeScriptElement> members)
        {
            return members == null ? null : members.Select(m => new FixedElement(m, new TextElement(";")));
        }

        public override void Generate(IGeneratorModuleContext context)
        {
            var b = context.Builder;
            if (_declaration)
                b.Append("declare ");
            else if (_export)
                b.Append("export ");
            b.Append("interface ");
            _name.Generate(context);
            b.Append(" ");
            if (_extends != null && _extends.Count > 0)
            {
                b.Append("extends ");
                int extIdx = 0;
                foreach (var extEl in _extends)
                {
                    extEl.Generate(context);
                    extIdx++;
                    if (extIdx != _extends.Count)
                        b.Append(", ");
                }
                b.Append(" ");
            }
            var bd = _properties == null
                ? _body
                : new BlockElement(AppendSemicolon(_properties.Where(p => context.Filter.IsPropertyIncluded(p))
                    .Select(p => context.AllPropertiesAreOptional ? new PropertyElement(p, false) : new PropertyElement(p))));
            bd.Generate(context);
        }
    }
}