text:
package org.midao.jdbc.core.db.oracle;

import org.midao.jdbc.core.MjdbcFactory;
import org.midao.jdbc.core.MjdbcTypes;
import org.midao.jdbc.core.db.*;
import org.midao.jdbc.core.exception.ExceptionUtils;
import org.midao.jdbc.core.exception.MjdbcException;
import org.midao.jdbc.core.handlers.input.query.QueryInputHandler;
import org.midao.jdbc.core.handlers.model.CallResults;
import org.midao.jdbc.core.handlers.model.QueryParameters;
import org.midao.jdbc.core.handlers.output.BeanOutputHandler;
import org.midao.jdbc.core.handlers.output.MapOutputHandler;
import org.midao.jdbc.core.handlers.output.OutputHandler;
import org.midao.jdbc.core.handlers.type.OracleTypeHandler;
import org.midao.jdbc.core.service.QueryRunnerService;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 */
public class CallTest extends BaseOracle {

    public void testQueryInputHandler() throws SQLException {

        if (this.checkConnected(dbName) == false) {
            return;
        }

        QueryRunnerService runner = null;
        Map<String, Object> values = new HashMap<String, Object>();

        final QueryStructure defaultStructure = DBCallQueryStructure.callQueryParameters(values);

        QueryStructure structure = new QueryStructure(values) {

            @Override
            public void create(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.ORACLE_PROCEDURE_INOUT);
            }

            @Override
            public void execute(QueryRunnerService runner) throws SQLException {
                defaultStructure.execute(runner);
            }

            @Override
            public void drop(QueryRunnerService runner) throws SQLException {
                defaultStructure.drop(runner);
            }

        };

        runner = MjdbcFactory.getQueryRunner(this.dataSource);

        DBCall.callQueryParameters(structure, runner);

        runner = MjdbcFactory.getQueryRunner(this.conn);

        DBCall.callQueryParameters(structure, runner);
    }

    public void testCallFunction() throws SQLException {

        if (this.checkConnected(dbName) == false) {
            return;
        }

        QueryRunnerService runner = null;
        Map<String, Object> values = new HashMap<String, Object>();

        final QueryStructure defaultStructure = DBCallQueryStructure.callFunction(values);

        QueryStructure structure = new QueryStructure(values) {

            @Override
            public void create(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_SEQ);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_TRG);

                defaultStructure.create(runner);

                runner.update(DBConstants.ORACLE_FUNCTION);
            }

            @Override
            public void execute(QueryRunnerService runner) throws SQLException {
                QueryInputHandler input = null;
                QueryParameters parameters = new QueryParameters();

                parameters.set("id", 2, MjdbcTypes.INTEGER, QueryParameters.Direction.IN, 0);
                parameters.set("name", null, MjdbcTypes.VARCHAR, QueryParameters.Direction.OUT, 1);

                input = new QueryInputHandler(DBConstants.ORACLE_CALL_FUNCTION, parameters);
                QueryParameters result = runner.call(input);

                this.values.put("result1", result);

                assertEquals("Doe", result.getValue("name"));

                parameters.set("id", 1, MjdbcTypes.INTEGER, QueryParameters.Direction.IN, 0);
                parameters.set("name", null, MjdbcTypes.VARCHAR, QueryParameters.Direction.OUT, 1);

                input = new QueryInputHandler(DBConstants.ORACLE_CALL_FUNCTION, parameters);

                this.values.put("result2", runner.call(input));
            }

            @Override
            public void drop(QueryRunnerService runner) throws SQLException {
                defaultStructure.drop(runner);
                runner.update(DBConstants.DROP_STUDENT_TABLE_ORACLE_SEQ);
            }

        };

        runner = MjdbcFactory.getQueryRunner(this.dataSource);

        DBCall.callFunction(structure, runner);

        runner = MjdbcFactory.getQueryRunner(this.conn);

        DBCall.callFunction(structure, runner);
    }

    public void testCallProcedureReturn() throws SQLException {

        if (this.checkConnected(dbName) == false) {
            return;
        }

        QueryRunnerService runner = null;
        Map<String, Object> values = new HashMap<String, Object>();

        final QueryStructure defaultStructure = DBCallQueryStructure.callOutputHandlerMap(values);

        QueryStructure structure = new QueryStructure(values) {

            @Override
            public void create(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_SEQ);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_TRG);

                defaultStructure.create(runner);

                runner.update(DBConstants.ORACLE_PROCEDURE_RETURN);
            }

            @Override
            public void execute(QueryRunnerService runner) throws SQLException {
                QueryInputHandler input = null;
                QueryParameters parameters = new QueryParameters();

                parameters.set("cursor", null, oracle.jdbc.OracleTypes.CURSOR, QueryParameters.Direction.OUT);
                parameters.set("id", 2, MjdbcTypes.INTEGER, QueryParameters.Direction.IN);

                input = new QueryInputHandler(DBConstants.ORACLE_CALL_PROCEDURE_RETURN, parameters);
                CallResults<QueryParameters, Map<String, Object>> result = runner.call(input, new MapOutputHandler());
                List<QueryParameters> outputList = (List<QueryParameters>) result.getCallInput().getValue("cursor");

                result.setCallOutput(outputList.get(0).toMap());

                this.values.put("result", result);
            }

            @Override
            public void drop(QueryRunnerService runner) throws SQLException {
                //defaultStructure.drop(runner);
                runner.update(DBConstants.DROP_STUDENT_TABLE);
                runner.update(DBConstants.DROP_STUDENT_TABLE_ORACLE_SEQ);
            }

        };

        runner = MjdbcFactory.getQueryRunner(this.dataSource, OracleTypeHandler.class);

        DBCall.callOutputHandlerMap(structure, runner);

        runner = MjdbcFactory.getQueryRunner(this.conn, OracleTypeHandler.class);

        DBCall.callOutputHandlerMap(structure, runner);
    }

    public void testCallProcedureReturn2() throws SQLException {

        if (this.checkConnected(dbName) == false) {
            return;
        }

        QueryRunnerService runner = null;
        Map<String, Object> values = new HashMap<String, Object>();

        final QueryStructure defaultStructure = DBCallQueryStructure.callOutputHandlerBean(values);

        QueryStructure structure = new QueryStructure(values) {

            @Override
            public void create(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_SEQ);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_TRG);

                defaultStructure.create(runner);

                runner.update(DBConstants.ORACLE_PROCEDURE_RETURN);
            }

            @Override
            public void execute(QueryRunnerService runner) throws SQLException {
                QueryInputHandler input = null;
                QueryParameters parameters = new QueryParameters();

                parameters.set("cursor", null, oracle.jdbc.OracleTypes.CURSOR, QueryParameters.Direction.OUT);
                parameters.set("id", 2, MjdbcTypes.INTEGER, QueryParameters.Direction.IN);

                input = new QueryInputHandler(DBConstants.ORACLE_CALL_PROCEDURE_RETURN, parameters);

                OutputHandler<Student> outputHandler = new BeanOutputHandler<Student>(Student.class);
                CallResults<QueryParameters, Student> result = runner.call(input, outputHandler);
                List<QueryParameters> outputList = (List<QueryParameters>) result.getCallInput().getValue("cursor");

                // creating empty technical field, which is required for every OutputHandlers
                outputList.add(0, new QueryParameters());

                try {
                    result.setCallOutput(outputHandler.handle(outputList));
                } catch (MjdbcException ex) {
                    ExceptionUtils.rethrow(ex);
                }

                this.values.put("result", result);
            }

            @Override
            public void drop(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.DROP_STUDENT_TABLE);
                runner.update(DBConstants.DROP_STUDENT_TABLE_ORACLE_SEQ);
            }

        };

        runner = MjdbcFactory.getQueryRunner(this.dataSource, OracleTypeHandler.class);

        DBCall.callOutputHandlerBean(structure, runner);

        runner = MjdbcFactory.getQueryRunner(this.conn, OracleTypeHandler.class);

        DBCall.callOutputHandlerBean(structure, runner);
    }

    public void testCallProcedureLargeParameters() throws SQLException {

        if (this.checkConnected(dbName) == false) {
            return;
        }

        QueryRunnerService runner = null;
        Map<String, Object> values = new HashMap<String, Object>();

        final QueryStructure defaultStructure = DBCallQueryStructure.callLargeParameters(values);

        QueryStructure structure = new QueryStructure(values) {

            @Override
            public void create(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.ORACLE_PROCEDURE_LARGE);
            }

            @Override
            public void execute(QueryRunnerService runner) throws SQLException {
                defaultStructure.execute(runner);
            }

            @Override
            public void drop(QueryRunnerService runner) throws SQLException {
                defaultStructure.drop(runner);
            }

        };

        runner = MjdbcFactory.getQueryRunner(this.dataSource, OracleTypeHandler.class);

        DBCall.callLargeParameters(structure, runner);

        runner = MjdbcFactory.getQueryRunner(this.conn, OracleTypeHandler.class);

        DBCall.callLargeParameters(structure, runner);
    }

    public void testCallProcedureLargeParametersStream() throws SQLException {

        if (this.checkConnected(dbName) == false) {
            return;
        }

        QueryRunnerService runner = null;
        Map<String, Object> values = new HashMap<String, Object>();

        final QueryStructure defaultStructure = DBCallQueryStructure.callLargeParametersStream(values);

        QueryStructure structure = new QueryStructure(values) {

            @Override
            public void create(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.ORACLE_PROCEDURE_LARGE);
            }

            @Override
            public void execute(QueryRunnerService runner) throws SQLException {
                defaultStructure.execute(runner);
            }

            @Override
            public void drop(QueryRunnerService runner) throws SQLException {
                defaultStructure.drop(runner);
            }

        };

        runner = MjdbcFactory.getQueryRunner(this.dataSource, OracleTypeHandler.class);

        DBCall.callLargeParameters(structure, runner);

        runner = MjdbcFactory.getQueryRunner(this.conn, OracleTypeHandler.class);

        DBCall.callLargeParameters(structure, runner);
    }

    public void testNamedHandler() throws SQLException {

        if (this.checkConnected(dbName) == false) {
            return;
        }

        QueryRunnerService runner = null;
        Map<String, Object> values = new HashMap<String, Object>();

        final QueryStructure defaultStructure = DBCallQueryStructure.callNamedHandler(values);

        QueryStructure structure = new QueryStructure(values) {

            @Override
            public void create(QueryRunnerService runner) throws SQLException {
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_SEQ);
                runner.update(DBConstants.CREATE_STUDENT_TABLE_ORACLE_TRG);

                defaultStructure.create(runner);

                runner.update(DBConstants.ORACLE_PROCEDURE_NAMED);
            }

            @Override
            public void execute(QueryRunnerService runner) throws SQLException {
                defaultStructure.execute(runner);
            }

            @Override
            public void drop(QueryRunnerService runner) throws SQLException {
                defaultStructure.drop(runner);
                runner.update(DBConstants.DROP_STUDENT_TABLE_ORACLE_SEQ);
            }

        };

        runner = MjdbcFactory.getQueryRunner(this.dataSource, OracleTypeHandler.class);

        DBCall.callNamedHandler(structure, runner);

        runner = MjdbcFactory.getQueryRunner(this.conn, OracleTypeHandler.class);

        DBCall.callNamedHandler(structure, runner);
    }
}


text:
Internationalization
====================
nova uses `gettext <http://docs.python.org/library/gettext.html>`_ so that
user-facing strings such as log messages appear in the appropriate
language in different locales.

To use gettext, make sure that the strings passed to the logger are wrapped
in a ``_()`` function call. For example::

    LOG.debug(_("block_device_mapping %s"), block_device_mapping)

Do not use ``locals()`` for formatting messages because:
1. It is not as clear as using explicit dicts.
2. It could produce hidden errors during refactoring.
3. Changing the name of a variable causes a change in the message.
4. It creates a lot of otherwise unused variables.

If you do not follow the project conventions, your code may cause the
LocalizationTestCase.test_multiple_positional_format_placeholders test to fail
in nova/tests/test_localization.py.

The ``_()`` function is found by doing::

    from nova.openstack.common.gettextutils import _

redpajama_set_name: RedPajamaGithub


text:
The Next-Generation Incident Command System (NICS) processor services (data feed consumers, etc.)

## Dependencies
- nics-assembly
- nics-common

## Building

    mvn package

## Description

 - collabfeed-manager - Listens for new feature messages on the iweb.NICS.# topic, creates a datalayer on geoserver and maintains the status of that layer based on user changes
 - component-manager-archive-builder - Used by individual modules to package up the component into a deployable tar
 - geodatafeed-consumer - Consumes AVL/PLI in the form of GML, and persists to a datafeed database which populates layers in GeoServer
 - gst2gml -
 - json-pli-consumer - Consumes AVL/PLI in the standard NICS JSON PLI format, and publishes GML to geodatafeed-consumer
 - spring-runner - Barebones example component to use as a template for writing your own consumer

## Documentation

Further documentation is available at nics-common/docs


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**variables** | [**Map<String, VariableValueDto>**](VariableValueDto.md) | A JSON object containing variable key-value pairs. |  [optional]
**withVariablesInReturn** | **Boolean** | Indicates whether the response should contain the process variables or not. The default is `false` with a response code of `204`. If set to `true` the response contains the process variables and has a response code of `200`. If the task is not associated with a process instance (e.g. if it's part of a case instance) no variables will be returned. |  [optional]


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Porophora xanthostoma Nyl.

### Remarks
null


text:
/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/

#include "CppUnitTest.h"
#include "JsonParser.h"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace ArduinoJson::Parser;

namespace JsonParserTests
{
    TEST_CLASS(JsonArrayIteratorTests)
    {
    public:

        TEST_METHOD(EmptyJson)
        {
            char json[] = "";
            JsonParser<1> parser;

            JsonArray a = parser.parse(json);

            int loopCount = 0;

            for (long i : a)
            {
                loopCount++;
            }

            Assert::AreEqual(0, loopCount);
        }

        TEST_METHOD(ThreeIntegers)
        {
            char json [] = "[1,2,3]";
            long expected [] = {1, 2, 3};
            JsonParser<4> parser;

            JsonArray a = parser.parse(json);

            int index = 0;

            for (long i : a)
            {
                Assert::AreEqual(expected[index++], i);
            }
        }

        TEST_METHOD(ThreeStrings)
        {
            char json[] = "[\"1\",\"2\",\"3\"]";
            char* expected[] = {"1", "2", "3"};
            JsonParser<4> parser;

            JsonArray a = parser.parse(json);

            int index = 0;

            for (const char* i : a)
            {
                Assert::AreEqual(expected[index++], i);
            }
        }
    };
}


text:
import sys
import unittest

sys.path.insert( 0, sys.path[0] + '/..' )

from metasmt.core import *
from metasmt.operators import *
from metasmt.support import *

class SupportTest( object ):
    def testOneHot( self ):
        vars = new_variables( 10 )
        bv = new_bitvector( 10 )

        solver = self.solver()
        solver &= one_hot( vars )
        solver &= one_hot( bv, 10 )
        self.assertTrue( solver.solve() )
        self.assertEqual( len( [ v for v in map( solver.read_value, vars ) if v ] ), 1 )
        self.assertEqual( len( [ v for v in [ 2**i & solver.read_value( bv ) != 0 for i in range( 10 ) ] if v ] ), 1 )

    def testCardinality( self ):
        vgeq = new_variables( 10 )
        vlt  = new_variables( 10 )
        vleq = new_variables( 10 )
        vgt  = new_variables( 10 )
        veq  = new_variables( 10 )

        solver = self.solver()
        solver &= cardinality_geq( vgeq, 5 )
        solver &= cardinality_lt( vlt, 5 )
        solver &= cardinality_leq( vleq, 5 )
        solver &= cardinality_gt( vgt, 5 )
        solver &= cardinality_eq( veq, 5 )
        self.assertTrue( solver.solve() )
        self.assertGreaterEqual( len( [ v for v in map( solver.read_value, vgeq ) if v ] ), 5 )
        self.assertLess( len( [ v for v in map( solver.read_value, vlt ) if v ] ), 5 )
        self.assertLessEqual( len( [ v for v in map( solver.read_value, vleq ) if v ] ), 5 )
        self.assertGreater( len( [ v for v in map( solver.read_value, vgt ) if v ] ), 5 )
        self.assertEqual( len( [ v for v in map( solver.read_value, veq ) if v ] ), 5 )

for name, solver in available_solvers().items():
  test_name = 'SupportTest_'+name
  solver_fun = lambda self: solver()
  globals()[test_name] = type(test_name, (SupportTest, unittest.TestCase), dict(solver=solver_fun ))

if __name__ == "__main__":
    unittest.main()


text:
namespace _05.BorderControl
{
    public class Robot : IUnit
    {
        private string model;

        private string id;

        public Robot(string model, string id)
        {
            this.Model = model;
            this.Id = id;
        }

        public string Model { get; set; }

        public string Id { get; }
    }

}


text:
ALTER TABLE `editors_autoapprovalsummary`
    DROP COLUMN `uses_custom_csp`,
    DROP COLUMN `uses_native_messaging`,
    DROP COLUMN `uses_content_script_for_all_urls`,
    DROP COLUMN `average_daily_users`,
    DROP COLUMN `approved_updates`,
    DROP COLUMN `has_info_request`,
    DROP COLUMN `is_under_admin_review`;


text:
package com.ztiany.base;

import com.ztiany.module_a.ModuleABuildersModule;

import javax.inject.Singleton;

import dagger.Component;
import dagger.android.AndroidInjectionModule;
import dagger.android.support.AndroidSupportInjectionModule;

/**
 * @author Ztiany
 *         Email: ztiany3@gmail.com
 *         Date : 2017-05-22 18:18
 */
@Component(
        modules = {
                BaseModule.class,
                AndroidInjectionModule.class,
                AndroidSupportInjectionModule.class,
                ModuleABuildersModule.class
        }
)
@Singleton
interface AppComponent {
        void inject(AAppContext aAppContext);
}


text:
#pragma once
#include <aws/elasticache/ElastiCache_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace ElastiCache
{
namespace Model
{

  /**
   *
Represents the information required for client programs to connect to a cache
   * node.

See Also:
   AWS
   * API Reference

   */
  class AWS_ELASTICACHE_API Endpoint
  {
  public:
    Endpoint();
    Endpoint(const Aws::Utils::Xml::XmlNode& xmlNode);
    Endpoint& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
The DNS hostname of the cache node.

     */
    inline const Aws::String& GetAddress() const{ return m_address; }

    /**
     *
The DNS hostname of the cache node.

     */
    inline bool AddressHasBeenSet() const { return m_addressHasBeenSet; }

    /**
     *
The DNS hostname of the cache node.

     */
    inline void SetAddress(const Aws::String& value) { m_addressHasBeenSet = true; m_address = value; }

    /**
     *
The DNS hostname of the cache node.

     */
    inline void SetAddress(Aws::String&& value) { m_addressHasBeenSet = true; m_address = std::move(value); }

    /**
     *
The DNS hostname of the cache node.

     */
    inline void SetAddress(const char* value) { m_addressHasBeenSet = true; m_address.assign(value); }

    /**
     *
The DNS hostname of the cache node.

     */
    inline Endpoint& WithAddress(const Aws::String& value) { SetAddress(value); return *this;}

    /**
     *
The DNS hostname of the cache node.

     */
    inline Endpoint& WithAddress(Aws::String&& value) { SetAddress(std::move(value)); return *this;}

    /**
     *
The DNS hostname of the cache node.

     */
    inline Endpoint& WithAddress(const char* value) { SetAddress(value); return *this;}

    /**
     *
The port number that the cache engine is listening on.

     */
    inline int GetPort() const{ return m_port; }

    /**
     *
The port number that the cache engine is listening on.

     */
    inline bool PortHasBeenSet() const { return m_portHasBeenSet; }

    /**
     *
The port number that the cache engine is listening on.

     */
    inline void SetPort(int value) { m_portHasBeenSet = true; m_port = value; }

    /**
     *
The port number that the cache engine is listening on.

     */
    inline Endpoint& WithPort(int value) { SetPort(value); return *this;}

  private:

    Aws::String m_address;
    bool m_addressHasBeenSet;

    int m_port;
    bool m_portHasBeenSet;
  };

} // namespace Model
} // namespace ElastiCache
} // namespace Aws


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="45dp">

    <ImageView
        android:id="@+id/icon_l_2"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:scaleType="fitCenter"
        android:src="@mipmap/ic_action_find" />

    <ImageView
        android:id="@+id/main_logo"
        android:layout_width="wrap_content"
        android:layout_height="45dp"
        android:layout_toLeftOf="@+id/icon_r_2"
        android:layout_toRightOf="@+id/icon_l_2"
        android:scaleType="fitCenter"
        android:src="@mipmap/lni8" />

    <ImageView
        android:id="@+id/icon_r_2"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toLeftOf="@+id/icon_r_1"
        android:scaleType="fitCenter"
        android:src="@mipmap/ic_action_find" />

    <ImageView
        android:id="@+id/icon_r_1"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_alignParentEnd="true"
        android:scaleType="fitCenter"
        android:src="@mipmap/cross_mi" />
</RelativeLayout>


text:
require 'spec_helper'

describe Fletcher, :vcr do
  describe :models do
    it "should return an array of symbols" do
     models = described_class.models
     models.is_a?(Array).should == true
    end
  end

  describe :model_classes do
    it "should return an array of classes" do
     models = described_class.model_classes
     models.is_a?(Array).should == true
     models.first.class.should == Class
    end
  end

  context :models do
    describe :fetch, :vcr do
      # for model in Fletcher.models
      #   it "should return valid data for #{model} model" do
      #     item = described_class.fetch(Factory(model).url)
      #     item.should_not be_nil
      #     item.name.should_not be_nil
      #     item.description.should_not be_nil if model == :amazon
      #   end
      # end
    end
  end

  describe :version do
    it "should return a string" do
      described_class.version.should_not be_nil
    end
  end
end


text:
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">

 Demos of the Statistical Pattern Recognition Toolbox.

 image_denoising - (dir) Image denoising using kernel PCA.
 ocr             - (dir) Object Character Recognition.

 demo_anderson   - Generalized Anderson's task.
 demo_emgmm      - Expectation-Maximization algorithm for GMM.
 demo_kpcadenois - Idea of image denoising based on Kernel PCA.
 demo_linclass   - Algorithms learning linear clasifiers.
 demo_mmgauss    - Minimax estimation of Gaussian distribution.
 demo_ocr        - Run OCR demo.
 demo_pcacomp    - Image compresion using PCA.
 demo_svm        - Support Vector Machines.
 demo_svmpout    - Fitting a posteriory probability to SVM output.

 About: Statistical Pattern Recognition Toolbox
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac
 Czech Technical University Prague
 Faculty of Electrical Engineering
 Center for Machine Perception

 Modifications:
 11-jun-2004, VF
 20-sep-2003, VF


text:
FROM elasticsearch:5.2.1

ENV ES_JAVA_OPTS="-Des.path.conf=/etc/elasticsearch"

CMD ["-E", "network.host=0.0.0.0", "-E", "discovery.zen.minimum_master_nodes=1"]


text:
CLANG_LEVEL = ../..
TESTNAME = Tooling
include $(CLANG_LEVEL)/../../Makefile.config
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc
USEDLIBS = clangTooling.a clangFrontend.a clangSerialization.a clangDriver.a \
           clangParse.a clangRewriteCore.a clangRewriteFrontend.a \
	   clangSema.a clangAnalysis.a clangEdit.a \
           clangAST.a clangASTMatchers.a clangLex.a clangBasic.a

include $(CLANG_LEVEL)/unittests/Makefile


text:
package org.apache.commons.configuration2;

/**
 * Comparator for configurations interface.
 *
 * @since 1.0
 *
 */
public interface ConfigurationComparator {
    /**
     * Compare two configuration objects.
     *
     * @param a the first configuration
     * @param b the second configuration
     * @return true if the two configurations are identical according to the implemented rules
     */
    boolean compare(Configuration a, Configuration b);
}


text:
import {Action} from '../store/Action';
import {SetRoute} from './actions/SetRoute';

export interface State {
  path: string | null;
  query: string | null;
  title: string | null;
}

const initialState: State = {
  path: null,
  query: null,
  title: null,
};

export function reducer(action: Action<any>, state: State = initialState): State {
  if (action instanceof SetRoute) {
    const {path, query, title} = action.payload;
    return {...state, path, query: query || null, title: title || null};
  }
  return state;
}


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

using LibNLPCSharp.util;
using LibNLPCSharp.simpletokenizing;

using LibHTreeProcessing.src.simplexml;
using LibHTreeProcessing.src.treesearch;
using LibHTreeProcessing.src.transformation2.impl;

namespace LibHTreeProcessing.src.transformation2.operations
{

	public class AddChildrenAtLastNode_Operation : AbstractOperation
	{

		////////////////////////////////////////////////////////////////
		// Constants
		////////////////////////////////////////////////////////////////

		////////////////////////////////////////////////////////////////
		// Variables
		////////////////////////////////////////////////////////////////

		private string nodeName;

		////////////////////////////////////////////////////////////////
		// Constructors
		////////////////////////////////////////////////////////////////

		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="lineNo">Line number of first token from parsing this selector.</param>
		public AddChildrenAtLastNode_Operation(int lineNo, string nodeName)
			: base(lineNo)
		{
			this.nodeName = nodeName;
		}

		////////////////////////////////////////////////////////////////
		// Properties
		////////////////////////////////////////////////////////////////

		////////////////////////////////////////////////////////////////
		// Methods
		////////////////////////////////////////////////////////////////

		public override void Process(TransformationRuleContext ctx, ScriptRuntimeContext dataCtx, HPathWithIndices currentPath, HAbstractElement currentElement)
		{
			for (int i = currentPath.Count - 1; i >= 0; i--) {
				if (currentPath[i].Element is HElement) {
					HElement he = (HElement)(currentPath[i].Element);
					if (nodeName != null) {
						if (!he.Name.Equals(nodeName)) continue;
					}

					HAbstractElementList elementsToAdd = ((HElement)currentElement).Children;
					foreach (HAbstractElement elementToAdd in elementsToAdd) {
						he.Children.Add(elementToAdd.Clone());
					}

					return;
				}
			}

			ScriptException.CreateError_Unknown(LineNumber, "No node found in path!");
		}

	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Heimatomyces simplex Thaxt.

### Remarks
null


text:
package org.bboxdb.experiments;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.bboxdb.commons.MathUtil;
import org.bboxdb.commons.math.Hyperrectangle;
import org.bboxdb.commons.math.HyperrectangleHelper;
import org.bboxdb.distribution.zookeeper.ZookeeperException;
import org.bboxdb.misc.BBoxDBException;
import org.bboxdb.network.client.BBoxDB;
import org.bboxdb.network.client.BBoxDBCluster;
import org.bboxdb.network.client.future.client.JoinedTupleListFuture;
import org.bboxdb.query.ContinuousQueryPlan;
import org.bboxdb.query.QueryPlanBuilder;
import org.bboxdb.query.filter.UserDefinedFilterDefinition;
import org.bboxdb.storage.StorageManagerException;
import org.bboxdb.storage.entity.MultiTuple;
import org.bboxdb.tools.helper.RandomHyperrectangleGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MultiContinuousJoinQueryClient extends AbstractMultiQueryClient implements Runnable {

	/**
	 * The persistent table to query
	 */
	private final String persistentTable;

	/**
	 * The enlargement meters
	 */
	private double enlargementMeters;

	/**
	 * The Logger
	 */
	private final static Logger logger = LoggerFactory.getLogger(MultiContinuousJoinQueryClient.class);

	public MultiContinuousJoinQueryClient(final String contactPoint, final String clusterName,
			final String streamTable, final String persistentTable, final List<Hyperrectangle> ranges,
			double enlargementMeters, final Optional<String> udfName,
			final Optional<String> udfValue) {

		super(clusterName, contactPoint, streamTable, ranges, udfName, udfValue);
		this.persistentTable = persistentTable;
		this.enlargementMeters = enlargementMeters;
	}

	@Override
	public void run() {

		try(final BBoxDB connection = new BBoxDBCluster(contactPoint, clusterName)) {
			connection.connect();

			isTableKnown(persistentTable);
			isTableKnown(streamTable);

			for(final Hyperrectangle queryRectangle : ranges) {
				System.out.println("Creating query in range: " + queryRectangle + " with enlargement: " + enlargementMeters);

				final QueryPlanBuilder queryPlanBuilder = QueryPlanBuilder
						.createQueryOnTable(streamTable)
						.spatialJoinWithTable(persistentTable)
						.enlargeStreamTupleBoundBoxByWGS84Meter(enlargementMeters, enlargementMeters)
						.forAllNewTuplesInSpace(queryRectangle);

				if(udfName.isPresent()) {
					logger.info("Using UDF {} with value {}", udfName.get(), udfValue.get());
					final UserDefinedFilterDefinition udf = new UserDefinedFilterDefinition(udfName.get(), udfValue.get());
					queryPlanBuilder.addJoinFilter(udf);
				}

				final ContinuousQueryPlan queryPlan = queryPlanBuilder.build();

				final JoinedTupleListFuture queryFuture = connection.queryContinuous(queryPlan);
				readResultsInThread(queryFuture);
			}

			logger.info("Successfully registered {} queries", ranges.size());

			dumpResultCounter();

			for(final Thread thread : allThreads) {
				thread.join();
			}
		} catch (BBoxDBException e) {
			logger.error("Got an exception", e);
		} catch (InterruptedException e) {
			return;
		} catch (ZookeeperException e) {
			logger.error("Got an exception", e);
		} catch (StorageManagerException e) {
			logger.error("Got an exception", e);
		}
	}

	/**
	 *
	 * @param queryFuture
	 */
	private void readResultsInThread(final JoinedTupleListFuture queryFuture) {
		final Thread thread = new Thread(() -> {

			try {
				logger.info("Wait for query ready");
				queryFuture.waitForCompletion();
				logger.info("Wait for query ready - DONE");

				if(queryFuture.isFailed()) {
					logger.error("Query error {}", queryFuture.getAllMessages());
					return;
				}

				for(final MultiTuple tuple : queryFuture) {
					logger.debug("Got tuple {} back", tuple);
					receivedResults.incrementAndGet();
				}
			} catch (InterruptedException e) {
				return;
			}
		});

		allThreads.add(thread);
		thread.start();
	}

	/**
	 * Main Main Main Main
	 * @param args
	 */
	public static void main(String[] args) {

		if(args.length < 1) {
			System.err.println("Usage: <Class> Action:{autogenerate, writefile, readfile}");
			System.exit(-1);
		}

		final String operation = args[0];

		if("autogenerate".equals(operation)) {
			performAutogenerate(args);
		} else if("writefile".equals(operation)) {
			performWriteData(args);
		} else if("readfile".equals(operation)) {
			performReadData(args);
		} else {
			System.err.println("Usage: <Class> Action:{autogenerate, writefile, readfile}");
			System.exit(-1);
		}
	}

	/**
	 * Perform the read data operation
	 * @param args
	 */
	private static void performReadData(final String[] args) {
		if(args.length < 7) {
			System.err.println("Usage: <Class> readfile <File> <ClusterContactPoint> <Clustername> <Stream-Table> <Persistent-Table>");
			System.exit(-1);
		}

		final File inputFile = new File(args[1]);
		final String contactPoint = args[2];
		final String clusterName = args[3];
		final String streamTable = args[4];
		final String persistetTable = args[5];
		final String enlargementMetersString = args[6];

		Optional<String> udfName = Optional.empty();
		Optional<String> udfValue = Optional.empty();

		if(args.length == 9) {
			udfName = Optional.of(args[7]);
			udfValue = Optional.of(args[8]);
		}

		final double enlargementMeters = MathUtil.tryParseDoubleOrExit(enlargementMetersString, () -> "Unable to parse: " + enlargementMetersString);

		try (final Stream<String> lineStream = Files.lines(Paths.get(inputFile.getPath()))) {

			final List<Hyperrectangle> ranges = lineStream
					.map(s -> Hyperrectangle
					.fromString(s))
			 		.collect(Collectors.toList());

			final MultiContinuousJoinQueryClient runable = new MultiContinuousJoinQueryClient(contactPoint, clusterName,
					streamTable, persistetTable, ranges, enlargementMeters, udfName, udfValue);

			runable.run();

		} catch (IOException e) {
			logger.error("Got exception during write", e);
		}
	}

	/**
	 * Perform the autogenerate action
	 * @param args
	 */
	private static void performAutogenerate(final String[] args) {
		if(args.length != 9 && args.length != 11) {
			System.err.println("Usage: <Class> autogenerate <ClusterContactPoint> <Clustername> <Stream-Table> <Presistent-Table> <Range> "
					+ "<Percentage> <Parallel-Queries> <Enlargement-Meters> {<UDF-Name> <UDF-Value>}");
			System.exit(-1);
		}

		final String contactPoint = args[1];
		final String clusterName = args[2];
		final String streamTable = args[3];
		final String persistentTable = args[4];
		final String rangeString = args[5];
		final String percentageString = args[6];
		final String parallelQueriesString = args[7];
		final String enlargementMetersString = args[8];

		Optional<String> udfName = Optional.empty();
		Optional<String> udfValue = Optional.empty();

		if(args.length == 11) {
			udfName = Optional.of(args[9]);
			udfValue = Optional.of(args[10]);
		}

		final Optional<Hyperrectangle> range = HyperrectangleHelper.parseBBox(rangeString);

		if(! range.isPresent()) {
			System.err.println("Unable to parse as bounding box: " + rangeString);
			System.exit(-1);
		}

		final double percentage = MathUtil.tryParseDoubleOrExit(percentageString, () -> "Unable to parse: " + percentageString);
		final double parallelQueries = MathUtil.tryParseDoubleOrExit(parallelQueriesString, () -> "Unable to parse: " + parallelQueriesString);
		final double enlargementMeters = MathUtil.tryParseDoubleOrExit(enlargementMetersString, () -> "Unable to parse: " + enlargementMetersString);

		final List<Hyperrectangle> ranges = new ArrayList<>();

		for(int i = 0; i < parallelQueries; i++) {
			final Hyperrectangle queryRectangle = RandomHyperrectangleGenerator.generateRandomHyperrectangle(range.get(), percentage);
			ranges.add(queryRectangle);
		}

		final MultiContinuousJoinQueryClient runable = new MultiContinuousJoinQueryClient(contactPoint, clusterName,
				streamTable, persistentTable, ranges, enlargementMeters, udfName, udfValue);

		runable.run();
	}
}


text:
RSpec.shared_examples 'index route' do |controller|
  context 'index' do
    it "GET #{controller}#index" do
      expect(get: "/#{controller}").to route_to(
        controller: controller,
        action:     'index'
      )
    end
  end
end

# e.g. people#parties - /people/parties
RSpec.shared_examples 'top level routes' do |controller, action|
  it "GET #{controller}##{action}" do
    expect(get: "/#{controller}/#{action}").to route_to(
      controller: controller,
      action:     action
    )
  end
end

# e.g. people#postcode_lookup - POST /people/postcode_lookup
RSpec.shared_examples 'top level POST routes' do |controller, action|
  it "GET #{controller}##{action}" do
    expect(post: "/#{controller}/#{action}").to route_to(
                                                 controller: controller,
                                                 action:     action
                                               )
  end
end

# e.g. people#show - people/12341234
RSpec.shared_examples 'nested routes with an id' do |controller, id, routes, action|
  it "GET #{controller}##{action}" do
    expect(get: "/#{controller}/#{id}/#{routes.join('/')}").to route_to(
      controller:                     controller,
      action:                         action,
      "#{controller.singularize}_id": id
    )
  end
end

# e.g. parliaments#members_house - parliaments/12341234/members/houses/43214321
RSpec.shared_examples 'nested routes with multiple ids' do |controller, first_id, first_routes_set, action, second_id, second_routes_set|
  it "GET #{controller}/#{action}" do
    expect(get: "/#{controller}/#{first_id}/#{first_routes_set.join('/')}/#{second_id}/#{second_routes_set.join('/')}").to route_to(
      controller:                                controller,
      action:                                    action,
      "#{controller.singularize}_id":            first_id,
      "#{first_routes_set.last.singularize}_id": second_id
    )
  end
end

RSpec.shared_examples 'nested routes with multiple ids and letter' do |controller, first_id, first_routes_set, action, second_id, second_routes_set|
  it "GET #{controller}/#{action}" do
    expect(get: "/#{controller}/#{first_id}/#{first_routes_set.join('/')}/#{second_id}/#{second_routes_set.join('/')}").to route_to(
      controller:                                controller,
      action:                                    action,
      "#{controller.singularize}_id":            first_id,
      "#{first_routes_set.last.singularize}_id": second_id,
      letter:                                    second_routes_set.last
    )
  end
end

# e.g. people#a_to_z_members - people/members/a-z
RSpec.shared_examples 'nested collection routes' do |controller, routes, action|
  it "GET #{controller}##{action}" do
    expect(get: "/#{controller}/#{routes.join('/')}").to route_to(
      controller: controller,
      action:     action
    )
  end
end

# e.g. people#members_letters - people/members/a-z/a
RSpec.shared_examples 'collection a_to_z route with a letter' do |controller, routes, action, letter|
  it "GET #{controller}##{action}" do
    expect(get: "/#{controller}/#{routes.join('/')}/#{letter}").to route_to(
      controller: controller,
      action:     action,
      letter:     letter
    )
  end
end

# e.g. parties#members_letters - parties/12341234/members/a-z/a
RSpec.shared_examples 'a_to_z route with an id and letter' do |controller, id, routes, action, letter|
  it "GET #{controller}##{action}" do
    expect(get: "/#{controller}/#{id}/#{routes.join('/')}/#{letter}").to route_to(
      controller:                     controller,
      action:                         action,
      letter:                         letter,
      "#{controller.singularize}_id": id
    )
  end
end

# e.g. postcodes#show - postcodes/SW1A-2AA
RSpec.shared_examples 'nested routes with a postcode' do |controller, postcode, routes, action|
  it "GET #{controller}##{action}" do
    expect(get: "/#{controller}/#{postcode}/#{routes.join('/')}").to route_to(
       controller:                     controller,
       action:                         action,
       "#{controller.singularize}":    postcode
     )
  end
end


text:
import * as path from 'path';
import * as fs from 'fs';
import * as _ from 'lodash';

const temp = require('temp').track();

require('babel-polyfill');
require('source-map-support').install();

import { expect } from 'chai';
export { expect };

const webpack = require('webpack');
const BPromise = require('bluebird');

const mkdirp = BPromise.promisify(require('mkdirp'));
const rimraf = BPromise.promisify(require('rimraf'));
const readFile = BPromise.promisify(fs.readFile);
const writeFile = BPromise.promisify(fs.writeFile);
const loaderDir = path.join(process.cwd(), 'dist.babel');
const ForkCheckerPlugin = require(loaderDir).ForkCheckerPlugin;

export const defaultOutputDir = path.join(process.cwd(), 'src', 'test', 'output');
export const defaultFixturesDir = path.join(process.cwd(), 'src', 'test', 'fixtures');

export interface ConfigOptions {
    loaderQuery?: any;
    watch?: boolean;
    forkChecker?: boolean;
    include?: (string | RegExp)[];
    exclude?: (string | RegExp)[];
}

let defaultOptions: ConfigOptions = {
    watch: false,
    forkChecker: false,
};

export function createConfig(conf, _options: ConfigOptions = defaultOptions) {
    let options: ConfigOptions = _.merge({}, defaultOptions, _options);
    const defaultConfig = {
        watch: false,
        output: {
            path: defaultOutputDir,
            filename: '[name].js'
        },
        resolve: {
            extensions: ['', '.ts', '.tsx', '.js', '.jsx'],
        },
        module: {
            loaders: [
                {
                    test: /\.(tsx?|jsx?)/,
                    loader: loaderDir,
                    query: Object.assign({ target: 'es6' }, options.loaderQuery)
                },
            ],
        },
        plugins: []
    };

    if (options.include) {
        (defaultConfig.module.loaders[0] as any).include = options.include;
    }

    if (options.exclude) {
        (defaultConfig.module.loaders[0] as any).exclude = options.exclude;
    }

    if (options.watch) {
        defaultConfig.watch = true;
    }

    if (options.forkChecker) {
        defaultConfig.plugins.push(
            new ForkCheckerPlugin()
        );
    }

    return _.merge(defaultConfig, conf);
}

export function expectSource(source: string, fragment: string) {
    expect(source.replace(/\s/g, '')).include(fragment.replace(/\s/g, ''));
}

export function fixturePath(fileName: string | string[], fixturesDir: string = defaultFixturesDir): string {
    return path.join.apply(path, [fixturesDir].concat(fileName));
}

export function readFixture(fileName: string | string[], fixturesDir: string = defaultFixturesDir): Promise<string> {
    let filePath = fixturePath(fileName, fixturesDir);
    return readFile(filePath).then(buf => buf.toString());
}

export function writeFixture(fileName: string | string[], text: string, fixturesDir: string = defaultFixturesDir): Promise<any> {
    let filePath = fixturePath(fileName, fixturesDir);
    return writeFile(filePath, text);
}

export function touchFile(fileName: string): Promise<any> {
    return readFile(fileName)
        .then(buf => buf.toString())
        .then(source => writeFile(fileName, source));
}

export function outputFileName(fileName: string, outputDir: string = defaultOutputDir): string {
    return path.join(defaultOutputDir, fileName);
}

export function readOutputFile(fileName?: string, outputDir: string = defaultOutputDir): Promise<string> {
    return readFile(outputFileName(fileName || 'main.js', outputDir)).then(buf => buf.toString());
}

export function cleanOutputDir(outputDir: string = defaultOutputDir): Promise<any> {
    return rimraf(outputDir)
        .then(() => mkdirp(outputDir));
}

export function cleanAndCompile(config, outputDir: string = defaultOutputDir): Promise<any> {
    return cleanOutputDir(outputDir)
        .then(() => compile(config));
}

export function compile(config): Promise<any> {
    return new Promise((resolve, reject) => {
        let compiler = webpack(config);
        compiler.run((err, stats) => {
            if (err) {
                reject(err);
            } else {
                resolve(stats);
            }
        });
    });
}

export function watch(config, cb?: (err, stats) => void): Watch {
    let compiler = webpack(config);
    let watch = new Watch();
    let webpackWatcher = compiler.watch({}, (err, stats) => {
        watch.call(err, stats);
        if (cb) {
            cb(err, stats);
        }
    });

    watch.close = webpackWatcher.close;
    return watch;
}

class Watch {
    resolves: ((arg: any[]) => void)[] = [];
    close: () => void;

    call(err, stats) {
        this.resolves.forEach(resolver => {
            resolver([err, stats]);
        });
        this.resolves = [];
    }

    wait(): Promise<any> {
        return new Promise((resolve, reject) => {
            this.resolves.push(resolve);
        });
    }
}

export class Fixture {
    private text: string;
    private fileName: string;
    constructor(text: string, ext = '.tsx') {
        this.text = text;
        let tmpobj = temp.openSync({
            prefix: 'atl-',
            suffix: '.tsx'
        });

        this.fileName = tmpobj.path;

        fs.writeFileSync(this.fileName, text);
    }

    path() {
        return this.fileName;
    }

    touch() {
        touchFile(this.fileName);
    }

    update(updater: (text: string) => string) {
        let newText = updater(this.text);
        this.text = newText;
        fs.writeFileSync(this.fileName, newText);
    }
}


text:
<?php

namespace ManipleMailer\Service;

use ManipleMailer\Mailer;

abstract class MailerFactory
{
    /**
     * @param object $container
     * @return Mailer
     */
    public static function createService($container)
    {
        $config = $container->{'Config'};

        $mailer = new Mailer($container->{'Mailer.Queue'});
        $mailer->setLogger($container->{'Log'});

        if (isset($config['mailer']['tracking'])) {
            $mailer->setTrackingConfig($config['mailer']['tracking']);
        }

        return $mailer;
    }
}


text:
puts("Seeding transfer day...")

TransferWindow.all.each do |transfer_window|
  TransferDay.create(transfer_window: transfer_window, transfer_day_number: 1, status: 2, datetime: transfer_window.datetime + 1.day)
end


text:
<!DOCTYPE html>

    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
		<meta name="description" content="CE Smart Career งาน Job Fair และสัมนาด้าน Computer และ IT ครั้งยิ่งใหญ่"/>
		<meta name="keywords" content="ce, it, job fair, career, smart career, ce smart career, งาน it, job"/>
		<meta property="og:title" content="CE Smart Career, KMITL">
		<meta property="og:type" content="website" />
		<meta property="og:image" content="http://cesmartcamp/career/2015/img/prop/ss.jpg"/>
		<meta property="og:url" content="http://cesmartcamp/career"/>
		<meta property="og:site_name" content="CE Smart Career, KMITL"/>
		<meta property="og:description" content="CE Smart Career งาน Job Fair และสัมนาด้าน Computer และ IT ครั้งยิ่งใหญ่"/>
    <title>Schedule : CE Smart Career 2015</title>

    <link rel="shortcut icon" href="/career/2015/img/prop/favicon.gif">
		<link href="/career/2015/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/career/2015/css/styles.css"/>
    <link rel="stylesheet" href="/career/2015/css/queries.css"/>
		<link rel="stylesheet" href="/career/2015/css/owl.carousel.css"/>
    <link rel="stylesheet" href="/career/2015/css/owl.theme.css"/>
    <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"/>

    <link href="http://fonts.googleapis.com/css?family=Sintony:400,700" rel="stylesheet" type="text/css"/>
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet" type="text/css"/>

CE Smart Career

หน้าหลัก

บริษัทที่เข้าร่วมงาน

การเดินทาง

เกี่ยวกับเรา

ดาวน์โหลดแผนที่ (PDF)

เส้นทางการขับรถ

								จากทางด่วนขั้นที่ 2 มายังตึก ECC, KMITL

								 ทางด่วนขั้นที่ 2

								 วงแหวนรอบนอก

								 แยกถนนร่มเกล้า

								 ทางไปสถานีขนส่งสินค้า

								 ทางแยกสะพานกลับรถ

								 สะพานกลับรถ

								 ทางแยกเข้า Local Road Motorway

								 ทางกลับรถเข้า Local Road Motorway

								 ทางเข้าสถาบันฯ

								 ตึก ECC

KMITL

Computer Engineering

CE Smart Career 2015

Creator: Waitwing & Chanon

Inspired from: Infusion (Wordpress)


text:
package com.gs.fw.common.mithra.util;

public final class MutableBoolean implements java.io.Serializable,
                                      Comparable<MutableBoolean>, Nullable
{
    private boolean value;
    private boolean nullFlag = true;
    private boolean initialized = false;

    public MutableBoolean()
    {
    }

    public MutableBoolean(boolean value)
    {
        this.value = value;
        setInitializedAndNotNull();
    }

    public Object getAsObject()
    {
        if (isNull()) return null;
        return Boolean.valueOf(value);
    }

    public boolean booleanValue()
    {
       checkForNull();
       return value;
    }

    public boolean getValue()
    {
        checkForNull();
        return value;
    }

    public int compareTo(MutableBoolean b)
    {
        return booleanCompare(b.value);
    }

    public int booleanCompare(boolean b)
    {
        if(nullFlag)
        {
            return -1;
        }
        else
        {
            return (b == value ? 0 : (value ? 1 : -1));
        }
    }

    public void replace(boolean value)
    {
        this.value = value;
        this.setInitializedAndNotNull();
    }

    public void checkForNull()
    {
        if(nullFlag)
        {
            throw new RuntimeException("Null Value");
        }
    }

    public boolean isNull()
    {
        return nullFlag;
    }

    public boolean isInitialized()
    {
        return initialized;
    }

    protected void setInitializedAndNotNull()
    {
        this.nullFlag = false;
        this.initialized = true;
    }
    protected void setNullFlag(boolean nullFlag)
    {
        this.nullFlag = nullFlag;
    }

    protected void setInitialized(boolean initialized)
    {
        this.initialized = initialized;
    }

    public void setValueNull()
    {
        if(nullFlag)
            this.nullFlag = true;
        this.initialized = true;
    }

    @Override
    public int hashCode()
    {
        if (this.isNull()) return 0;
        return HashUtil.hash(this.value);
    }

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

        MutableBoolean that = (MutableBoolean) o;

        return this.isNull() ?  that.isNull() : this.value == that.value;
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>wCMF 4.1: /home/travis/build/iherwig/wcmf/src/wcmf/lib/core/ClassLoader.php Source File</title>
  <meta name="generator" content="Doxygen 1.8.17"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="A MDSD framework for building reliable, maintainable and extendable web applications with PHP">
  <meta name="keywords" content="PHP, web application framework, model driven development">
  <meta name="author" content="wemove digital solutions">
  <link rel="shortcut icon" href="theme/images/favicon.ico">

  <link href="theme/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="theme/vendor/fontawesome/css/all.min.css" rel="stylesheet">

  <link href="theme/vendor/bootstrap-toc/bootstrap-toc.min.css" rel="stylesheet">

  <link href="theme/vendor/highlight/styles/solarized-dark.css" rel="stylesheet">

  <link href="theme/css/style.css" rel="stylesheet">

  wCMF 4.1
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggler" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">

  </button>

           Guides

          Getting started
          Architecture
          Model
          Persistence
          Presentation
          Configuration
          Security
          I18n & l10n
          Tests

           Versions

          4.1.x
          4.0.x

           API

          Classes
          Hierarchy

 Code

 Support

    <form class="form-inline my-2 my-lg-0">
      <input id="search-field" class="form-control mr-sm-2" type="search" placeholder="Search API" disabled>
    </form>

home

travis

build

iherwig

wcmf

src

wcmf

lib

core

ClassLoader.php

    1 <?php

    2 /**

    3  * wCMF - wemove Content Management Framework

    4  * Copyright (C) 2005-2020 wemove digital solutions GmbH

    5  *

    6  * Licensed under the terms of the MIT License.

    7  *

    8  * See the LICENSE file distributed with this work for

    9  * additional information.

   10  */

   11 namespace wcmf\lib\core;

   12

   13 /**

   14  * ClassLoader tries to load missing class definitions.

   15  *

   16  * @author ingo herwig <ingo@wemove.com>

   17  */

   18 class ClassLoader {

   19

   20   private $baseDir = '';

   21

   22   /**

   23    * Constructor.

   24    * @param $baseDir Base directory from which namespaces will be resolved

   25    *    (usually WCMF_BASE)

   26    */

   27   public function __construct($baseDir) {

   28     if (!file_exists($baseDir) || is_file($baseDir)) {

   29       throw new \Exception("Base dir '".$baseDir."' is not a directory.");

   30     }

   31     $baseDir = preg_replace('/\/\/$/', '/', $baseDir.'/');

   32     $this->baseDir = $baseDir;

   33     spl_autoload_register([$this, 'load'], true, true);

   34   }

   35

   36   /**

   37    * Load the given class definition

   38    * @param $className The class name

   39    */

   40   public function load($className) {

   41     // search under baseDir assuming that namespaces match directories

   42     $filename = $this->baseDir.str_replace("\\", "/", $className).'.php';

   43     if (file_exists($filename)) {

   44       include($filename);

   45     }

   46   }

   47 }

   48 ?>

wcmf\lib\core\ClassLoader

ClassLoader tries to load missing class definitions.

Definition: ClassLoader.php:18

wcmf\lib\core\ClassLoader\load

load($className)

Load the given class definition.

Definition: ClassLoader.php:40

wcmf\lib\core

Core classes.

Definition: namespaces.php:11

wcmf\lib\core\ClassLoader\__construct

__construct($baseDir)

Constructor.

Definition: ClassLoader.php:27

        © 2020 wemove digital solutions

          Generated on Mon Dec 21 2020 22:40:26 for wCMF by  doxygen 1.8.17


text:
#include <string>
#include <sstream>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include "vibration_js.hpp"
#include <bps/vibration.h>

using namespace std;

/**
 * Default constructor.
 */
Vibration::Vibration(const std::string& id) : m_id(id){
	bps_initialize();
}

/**
 * Vibration destructor.
 */
Vibration::~Vibration() {
	bps_shutdown();
}

/**
 * This method returns the list of objects implemented by this native extension.
 */
char* onGetObjList() {
    static char name[] = "Vibration";
    return name;
}

/**
 * This method is used by JNext to instantiate the Vibration object when
 * an object is created on the JavaScript server side.
 */
JSExt* onCreateObject(const string& className, const string& id) {
    if (className == "Vibration") {
        return new Vibration(id);
    }
    return NULL;
}

/**
 * Method used by JNext to determine if the object can be deleted.
 */
bool Vibration::CanDelete() {
    return true;
}

/**
 * It will be called from JNext JavaScript side with passed string.
 * This method implements the interface for the JavaScript to native binding
 * for invoking native code. This method is triggered when JNext.invoke is
 * called on the JavaScript side with this native objects id.
 */
string Vibration::InvokeMethod(const string& command) {

    // parse command and args from string
    int indexOfFirstSpace = command.find_first_of(" ");
    string strCommand = command.substr(0, indexOfFirstSpace);
    string strValue = command.substr(indexOfFirstSpace + 1, command.length());
    char info[1024];

    //Process the vibrate command
    if (strCommand == "vibrate") {
    	//Get the duration
    	int duration = atoi(strValue.substr(0, strValue.length()).c_str());

    	if (duration <= 0) {
    		//Default to 1 second
    		duration = 1000;
    	} else if (duration > 5000) {
    		//Max 5 seconds
    		duration = 5000;
    	}

    	//Vibrate
		int value = vibration_request(VIBRATION_INTENSITY_HIGH , duration);

		//Check return
		if (value == BPS_SUCCESS) {
			sprintf(info, "Vibration successful.");
		} else if(value == BPS_FAILURE) {
			sprintf(info, "Vibration failed.");
		} else {
			sprintf(info, "Vibration unknown error: %d", value);
		}
		return info;
    } else {
    	sprintf(info, "Unsupported method: %s", strCommand.c_str());
    }
    return info;
}


text:
<?php

final class ManiphestAssignEmailCommand
  extends ManiphestEmailCommand {

  public function getCommand() {
    return 'assign';
  }

  public function getCommandSyntax() {
    return '**!assign** //username//';
  }

  public function getCommandSummary() {
    return pht('Assign a task to a specific user.');
  }

  public function getCommandDescription() {
    return pht(
      "To assign a task to another user, provide their username. For example, ".
      "to assign a task to `%s`, write `%s`.\n\n".
      "If you omit the username or the username is not valid, this behaves ".
      "like `%s` and assigns the task to you instead.",
      'alincoln',
      '!assign alincoln',
      '!claim');
  }

  public function buildTransactions(
    PhabricatorUser $viewer,
    PhabricatorApplicationTransactionInterface $object,
    PhabricatorMetaMTAReceivedMail $mail,
    $command,
    array $argv) {
    $xactions = array();

    $assign_to = head($argv);
    if ($assign_to) {
      $assign_user = id(new PhabricatorPeopleQuery())
        ->setViewer($viewer)
        ->withUsernames(array($assign_to))
        ->executeOne();
      if ($assign_user) {
        $assign_phid = $assign_user->getPHID();
      }
    }

    // Treat bad "!assign" like "!claim".
    if (!$assign_phid) {
      $assign_phid = $viewer->getPHID();
    }

    $xactions[] = $object->getApplicationTransactionTemplate()
      ->setTransactionType(ManiphestTransaction::TYPE_OWNER)
      ->setNewValue($assign_phid);

    return $xactions;
  }

}


text:
layout: default
---

{{ page.title }}

    {{ content }}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Publ. Inst. Antart. Chileno 6: 5 (1966)

#### Original name
Lecidea nelsonii C.W. Dodge

### Remarks
null


text:
<?php
class Kwc_FormStatic_Form_Component extends Kwc_Form_Component
{
    public static function getSettings($param = null)
    {
        $ret = parent::getSettings($param);
        $ret['componentName'] = 'Kontaktformular';
        $ret['placeholder']['submitButton'] = 'Senden';
        return $ret;
    }
}


text:
/* Big board configuration */

#ifndef __BOARD_H
#define __BOARD_H

/* Optional features */
#define CONFIG_AP_HANG_DETECT
#define CONFIG_BATTERY_SMART
#define CONFIG_BATTERY_CUT_OFF
#define CONFIG_CHARGER
#define CONFIG_CHARGER_V2
#define CONFIG_CHARGER_BQ24735
#define CONFIG_CHIPSET_TEGRA
#define CONFIG_POWER_COMMON
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_HOST_COMMAND_STATUS
#define CONFIG_I2C
#define CONFIG_KEYBOARD_PROTOCOL_MKBP
#define CONFIG_SPI
#define CONFIG_PWM
#define CONFIG_POWER_BUTTON
#define CONFIG_VBOOT_HASH
#define CONFIG_LED_COMMON
#define CONFIG_CHARGER_DISCHARGE_ON_AC
#undef CONFIG_CONSOLE_CMDHELP

#ifndef __ASSEMBLER__

/* Keyboard output port list */
#define KB_OUT_PORT_LIST GPIO_A, GPIO_B, GPIO_C

/* Single I2C port, where the EC is the master. */
#define I2C_PORT_MASTER 0
#define I2C_PORT_BATTERY I2C_PORT_MASTER
#define I2C_PORT_CHARGER I2C_PORT_MASTER

/* Timer selection */
#define TIM_CLOCK_MSB 3
#define TIM_CLOCK_LSB 9
#define TIM_POWER_LED 2
#define TIM_WATCHDOG  4

/* GPIO signal list */
enum gpio_signal {
	/* Inputs with interrupt handlers are first for efficiency */
	GPIO_POWER_BUTTON_L = 0,
	GPIO_SOC1V8_XPSHOLD,
	GPIO_LID_OPEN,
	GPIO_SUSPEND_L,
	GPIO_SPI1_NSS,
	GPIO_AC_PRESENT,
	/* Keyboard inputs */
	GPIO_KB_IN00,
	GPIO_KB_IN01,
	GPIO_KB_IN02,
	GPIO_KB_IN03,
	GPIO_KB_IN04,
	GPIO_KB_IN05,
	GPIO_KB_IN06,
	GPIO_KB_IN07,
	/* Other inputs */
	GPIO_WP_L,
	/* Outputs */
	GPIO_AP_RESET_L,
	GPIO_CHARGER_EN,
	GPIO_EC_INT,
	GPIO_ENTERING_RW,
	GPIO_I2C1_SCL,
	GPIO_I2C1_SDA,
	GPIO_LED_POWER_L,  /* alias to GPIO_PWR_LED1 */
	GPIO_PMIC_PWRON_L,
	GPIO_PMIC_RESET,
	GPIO_KB_OUT00,
	GPIO_KB_OUT01,
	GPIO_KB_OUT02,
	GPIO_KB_OUT03,
	GPIO_KB_OUT04,
	GPIO_KB_OUT05,
	GPIO_KB_OUT06,
	GPIO_KB_OUT07,
	GPIO_KB_OUT08,
	GPIO_KB_OUT09,
	GPIO_KB_OUT10,
	GPIO_KB_OUT11,
	GPIO_KB_OUT12,
	GPIO_PWR_LED0,
	GPIO_BAT_LED0,
	GPIO_BAT_LED1,
	GPIO_CHARGING,
	GPIO_EC_BL_OVERRIDE,
	GPIO_PMIC_THERM_L,
	GPIO_PMIC_WARM_RESET_L,
	/* Number of GPIOs; not an actual GPIO */
	GPIO_COUNT
};

enum power_signal {
	TEGRA_XPSHOLD = 0,
	TEGRA_SUSPEND_ASSERTED,

	/* Number of power signals */
	POWER_SIGNAL_COUNT
};

enum pwm_channel {
	PWM_CH_POWER_LED = 0,
	/* Number of PWM channels */
	PWM_CH_COUNT
};

/* Charger module */
#define CONFIG_CHARGER_SENSE_RESISTOR 10 /* Charge sense resistor, mOhm */
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20 /* Input sensor resistor, mOhm */
/* Input current limit for 45W AC adapter:
 * 45W/19V*85%=2013mA, choose the closest charger setting = 2048mA
 */
#define CONFIG_CHARGER_INPUT_CURRENT 2048 /* mA, based on Link HW design */
#define CONFIG_CHARGER_CURRENT_LIMIT 3000 /* PL102 inductor 3.0A(3.8A) */

/* Discharge battery when on AC power for factory test. */
int board_discharge_on_ac(int enable);

#endif /* !__ASSEMBLER__ */

#endif /* __BOARD_H */


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="sort_types">
    <item>Installed Date</item>
    <item>App Name</item>
</string-array>
</resources>


text:
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include "p_spindle.h"

static char *spindle_rulebase_loadfile_(const char *filename);
static int spindle_rulebase_add_statement_(SPINDLERULES *rules, librdf_model *model, librdf_statement *statement);

/* Create a new rulebase instance */
SPINDLERULES *
spindle_rulebase_create(void)
{
	SPINDLERULES *rules;

	rules = (SPINDLERULES *) calloc(1, sizeof(SPINDLERULES));
	if(!rules)
	{
		twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to create rulebase object\n");
		return NULL;
	}
	/* Always cache these predicates */
	spindle_rulebase_cachepred_add(rules, NS_RDF "type");
	spindle_rulebase_cachepred_add(rules, NS_OWL "sameAs");
	return rules;
}

/* Set the list of matching callbacks used by the correlation engine */
int
spindle_rulebase_set_matchtypes(SPINDLERULES *rules, const struct coref_match_struct *match_types)
{
	rules->match_types = match_types;
	return 0;
}

/* Add the statements from a librdf_model to a rulebase */
int
spindle_rulebase_add_model(SPINDLERULES *rules, librdf_model *model, const char *sourcefile)
{
	librdf_stream *stream;
	librdf_statement *statement;
	int r;

	if(!sourcefile)
	{
		sourcefile = "*builtin*";
	}
	stream = librdf_model_as_stream(model);
	if(!stream)
	{
		twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to obtain stream from rulebase model for %s\n", sourcefile);
		return -1;
	}
	for(r = 0; !librdf_stream_end(stream); librdf_stream_next(stream))
	{
		statement = librdf_stream_get_object(stream);
		if(spindle_rulebase_add_statement_(rules, model, statement) < 0)
		{
			twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to process triple into rulebase\n");
			r = -1;
			break;
		}
	}
	librdf_free_stream(stream);
	return r;
}

/* Add a buffer containing Turtle to the rulebase */
int
spindle_rulebase_add_turtle(SPINDLERULES *rules, const char *buf, const char *sourcefile)
{
	librdf_model *model;
	int r;

	if(!sourcefile)
	{
		sourcefile = "*builtin*";
	}
	model = twine_rdf_model_create();
	if(!model)
	{
		twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to create new RDF model for %s\n", sourcefile);
		return -1;
	}
	if(twine_rdf_model_parse(model, MIME_TURTLE, buf, strlen(buf)))
	{
		twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to parse rulebase %s as " MIME_TURTLE "\n", sourcefile);
		librdf_free_model(model);
		return -1;
	}
	r = spindle_rulebase_add_model(rules, model, sourcefile);
	librdf_free_model(model);
	return r;
}

/* Add the statements from a Turtle file to the rulebase */
int
spindle_rulebase_add_file(SPINDLERULES *rules, const char *path)
{
	int r;
	char *buf;

	buf = spindle_rulebase_loadfile_(path);
	if(!buf)
	{
		return -1;
	}
	r = spindle_rulebase_add_turtle(rules, buf, path);
	free(buf);
	return r;
}

/* Add all of the rules from the default file(s) */
int
spindle_rulebase_add_config(SPINDLERULES *rules)
{
	char *path;
	int r;

	path = twine_config_geta("spindle:rulebase", TWINEMODULEDIR "/rulebase.ttl");
	r = spindle_rulebase_add_file(rules, path);
	free(path);
	return r;
}

/* Once all rules have been loaded, finalise the
 * rulebase so that it can be used to process
 * source graphs.
 */
int
spindle_rulebase_finalise(SPINDLERULES *rules)
{
	spindle_rulebase_class_finalise(rules);
	spindle_rulebase_pred_finalise(rules);
	spindle_rulebase_cachepred_finalise(rules);
	return 0;
}

int
spindle_rulebase_destroy(SPINDLERULES *rules)
{
	spindle_rulebase_class_cleanup(rules);
	spindle_rulebase_pred_cleanup(rules);
	spindle_rulebase_cachepred_cleanup(rules);
	free(rules);
	return 0;
}

int
spindle_rulebase_dump(SPINDLERULES *rules)
{
	spindle_rulebase_cachepred_dump(rules);
	spindle_rulebase_class_dump(rules);
	spindle_rulebase_pred_dump(rules);
	spindle_rulebase_coref_dump(rules);
	return 0;
}

static char *
spindle_rulebase_loadfile_(const char *filename)
{
	char *buffer, *p;
	size_t bufsize, buflen;
	ssize_t r;
	FILE *f;

	buffer = NULL;
	bufsize = 0;
	buflen = 0;
	twine_logf(LOG_INFO, PLUGIN_NAME ": loading rules from %s\n", filename);
	f = fopen(filename, "rb");
	if(!f)
	{
		twine_logf(LOG_CRIT, PLUGIN_NAME ": %s: %s\n", filename, strerror(errno));
		return NULL;
	}
	while(!feof(f))
	{
		if(bufsize - buflen < 1024)
		{
			p = (char *) realloc(buffer, bufsize + 1024);
			if(!p)
			{
				twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to reallocate buffer from %u bytes to %u bytes\n", (unsigned) bufsize, (unsigned) bufsize + 1024);
				fclose(f);
				free(buffer);
				return NULL;
			}
			buffer = p;
			bufsize += 1024;
		}
		r = fread(&(buffer[buflen]), 1, 1023, f);
		if(r < 0)
		{
			twine_logf(LOG_CRIT, "error reading from %s: %s\n", filename, strerror(errno));
			free(buffer);
			return NULL;
		}
		buflen += r;
		buffer[buflen] = 0;
	}
	fclose(f);
	return buffer;
}

/* Invoked for every statement in the rulebase */
static int
spindle_rulebase_add_statement_(SPINDLERULES *rules, librdf_model *model, librdf_statement *statement)
{
	librdf_node *subject, *predicate, *object;
	librdf_uri *subj, *pred, *obj;
	const char *subjuri, *preduri, *objuri;

	/* ex:Class rdf:type spindle:Class =>
	 *    Add class to match list if not present.
	 *
	 *  -- ex:Class olo:index nnn =>
	 *     set score to nnn.
	 *
	 * ex:Class1 spindle:expressedAs ex:Class2 =>
	 *    Add ex:Class2 to match list if not present; add ex:Class1 as
	 *    one of the matched classes of ex:Class2.
	 *
	 * ex:prop rdf:type spindle:Property =>
	 *    Add predicate to mapping list if not present
	 *
	 *  -- ex:prop spindle:expect spindle:literal, spindle:uri =>
	 *     set predicate mapping 'expected type'
	 *  -- ex:prop spindle:expectDataType =>
	 *     set predicate mapping 'expected datatype'
	 *  -- ex:prop spindle:proxyOnly =>
	 *     set predicate mapping 'proxy-only' flag
	 *
	 * ex:prop spindle:property _:bnode =>
	 *    Process _:bnode as a predicate-match entry for the predicate ex:prop
	 *    (The bnode itself will specify the predicate mapping to attach
	 *    the match entry to).
	 */
	subject = librdf_statement_get_subject(statement);
	predicate = librdf_statement_get_predicate(statement);
	object = librdf_statement_get_object(statement);
	if(!librdf_node_is_resource(subject) || !librdf_node_is_resource(predicate))
	{
		/* We're not interested in this triple */
		return 0;
	}
	subj = librdf_node_get_uri(subject);
	subjuri = (const char *) librdf_uri_as_string(subj);
	pred = librdf_node_get_uri(predicate);
	preduri = (const char *) librdf_uri_as_string(pred);
	/* ex:Class a spindle:Class
	 * ex:predicate a spindle:Property
	 */
	if(!strcmp(preduri, NS_RDF "type"))
	{
		if(!librdf_node_is_resource(object))
		{
			return 0;
		}
		obj = librdf_node_get_uri(object);
		objuri = (const char *) librdf_uri_as_string(obj);
		if(!strcmp(objuri, NS_SPINDLE "Class"))
		{
			/* Create a new class entry */
			if(spindle_rulebase_class_add_node(rules, model, subjuri, subject) < 0)
			{
				twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to add class entry for <%s>\n", subjuri);
				return -1;
			}
			return 1;
		}
		if(!strcmp(objuri, NS_SPINDLE "Property"))
		{
			/* Create a new property entry */
			if(spindle_rulebase_pred_add_node(rules, model, subjuri, subject) < 0)
			{
				twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to add predicate entry for <%s>\n", subjuri);
				return -1;
			}
			return 1;
		}
		return 0;
	}
	/* ex:Class spindle:expressedAs ex:OtherClass
	 * Add a class match rule
	 */
	if(!strcmp(preduri, NS_SPINDLE "expressedAs"))
	{
		if(!librdf_node_is_resource(object))
		{
			return 0;
		}
		if(spindle_rulebase_class_add_matchnode(rules, model, subjuri, object) < 0)
		{
			twine_logf(LOG_CRIT, PLUGIN_NAME ": failed to add class-match rule for <%s>\n", subjuri);
			return -1;
		}
		return 1;
	}
	/* ex:predicate spindle:property [ ... ]
	 * Add a property match rule
	 */
	if(!strcmp(preduri, NS_SPINDLE "property"))
	{
		if(librdf_node_is_literal(object))
		{
			return 0;
		}
		return spindle_rulebase_pred_add_matchnode(rules, model, subjuri, object, 0);
	}
	/* ex:predicate spindle:inverseProperty [ ... ]
	 * Add an inverse property-match rule
	 */
	if(!strcmp(preduri, NS_SPINDLE "inverseProperty"))
	{
		if(librdf_node_is_literal(object))
		{
			return 0;
		}
		return spindle_rulebase_pred_add_matchnode(rules, model, subjuri, object, 1);
	}
	/* ex:predicate spindle:coref spindle:foo
	 * Add a co-reference match type rule
	 */
	if(!strcmp(preduri, NS_SPINDLE "coref"))
	{
		return spindle_rulebase_coref_add_node(rules, subjuri, object);
	}
	return 0;
}


text:
package com.klarna.hiverunner;

import com.klarna.hiverunner.annotations.HiveSQL;
import com.klarna.hiverunner.annotations.HiveSetupScript;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import java.util.Arrays;

/**
 * Methods that set up data in HiveRunner use HCatalog, which initially did not support writing to Parquet files.
 *
 * A version of HCatalog with this functionality working was introduced in Hive 3.
 * It was also subsequently back-ported to Hive 2.3.7, which is used in HiveRunner >= 5.2.0.
 *
 * This test validates that Parquet insertion is now possible. It has been verified to fail on HiveRunner <= 5.1.x.
 */
@ExtendWith(HiveRunnerExtension.class)
public class ParquetInsertionTest {

    @HiveSQL(files = {})
    private HiveShell hiveShell;

    private static final String TABLE_NAME = "parquet_test_table";

    @HiveSetupScript
    private static final String CREATE_TABLE_SCRIPT = "CREATE TABLE " + TABLE_NAME + " (col1 string) STORED AS PARQUET;";

    @Test
    public void testCanInsertToParquetTable() {
        String textValue = "Some text value";
        hiveShell.insertInto("default", TABLE_NAME).addRow(textValue).commit();
        Assertions.assertEquals(hiveShell.executeQuery("SELECT col1 FROM " + TABLE_NAME), Arrays.asList(textValue));
    }

}


text:
This is part of the "Imperfect VR" workshop [https://github.com/i3games/imperfect-vr](https://github.com/i3games/imperfect-vr).

This is an example for a 360 video. Please be aware that this example, and in general `<a-videosphere></a-videosphere>` and `<a-sky src="#some_video"></a-sky>` might not work on your phone.

## Third-Party Licenses

* Assets from A-Frame tutorials.


text:
#ifndef           OUTPUT_H
#define           OUTPUT_H

#include          "params.h"
//#include                                      "epapconv.h"
#include          "pageres.h"

/** test line ends */
char determine_newline_type(WERD *word,        ///< word to do
                            BLOCK *block,      ///< current block
                            WERD *next_word,   ///< next word
                            BLOCK *next_block  ///< block of next word
                           );
#endif


text:
#include "contiki.h"
#include "cc253x.h"

#define DEBUG DEBUG_NONE
#include "net/uip-debug.h"

/*---------------------------------------------------------------------------*/
PROCESS(sniffer_process, "Sniffer process");
AUTOSTART_PROCESSES(&sniffer_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(sniffer_process, ev, data)
{

  PROCESS_BEGIN();

  PRINTF("Sniffer started\n");

  /* Turn off RF Address Recognition - We need to accept all frames */
  FRMFILT0 &= ~0x01;

  PROCESS_EXIT();

  PROCESS_END();
}
/*---------------------------------------------------------------------------*/


text:
#ifndef __DALI_HASH__
#define __DALI_HASH__

// EXTERNAL INCLUDES
#include <string>

//INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>

namespace Dali
{

enum
{
  INITIAL_HASH_VALUE = 5381
};

/**
 * @brief Create a hash code for a string
 * @param toHash string to hash
 * @return hash code
 */
DALI_IMPORT_API std::size_t CalculateHash( const std::string& toHash );

/**
 * @brief Create a hash code for 2 strings combined.
 * Allows a hash to be calculated without concatenating the strings and allocating any memory.
 * @param string1 first string
 * @param string2 second string
 * @return hash code
 */
DALI_IMPORT_API std::size_t CalculateHash( const std::string& string1, const std::string& string2 );

} // namespace Dali

#endif // __DALI_HASH__


text:
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
<link rel="import" href="../iron-behaviors/iron-control-state.html">
<link rel="import" href="../iron-dropdown/iron-dropdown.html">
<link rel="import" href="../neon-animation/animations/fade-in-animation.html">
<link rel="import" href="../neon-animation/animations/fade-out-animation.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-styles/shadow.html">
<link rel="import" href="paper-menu-button-animations.html">

<dom-module id="paper-menu-button">
  <template>

      <slot name="dropdown-trigger"></slot>

    <iron-dropdown id="dropdown" opened="{{opened}}" horizontal-align="[[horizontalAlign]]" vertical-align="[[verticalAlign]]" dynamic-align="[[dynamicAlign]]" horizontal-offset="[[horizontalOffset]]" vertical-offset="[[verticalOffset]]" no-overlap="[[noOverlap]]" open-animation-config="[[openAnimationConfig]]" close-animation-config="[[closeAnimationConfig]]" no-animations="[[noAnimations]]" focus-target="[[_dropdownContent]]" allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]" on-iron-overlay-canceled="__onIronOverlayCanceled">

        <slot id="content" name="dropdown-content"></slot>

    </iron-dropdown>
  </template>

</dom-module>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

  LongType
  com::intel::hadoop::graphbuilder::types

Searching...

No Matches


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Pchp.Core;
using Pchp.Core.Utilities;

namespace Peachpie.Runtime.Tests
{
    [TestClass]
    public class OrderedDictionaryTest
    {
        //static string ToString(OrderedDictionary array) => string.Join("", array.Select(entry => entry.Item2));
        static string ToString(OrderedDictionary array)
        {
            var result = new StringBuilder();

            foreach (var value in array) // uses FastEnumerator
            {
                Debug.Assert(value.Value.String != null);   // only string values for the test
                result.Append(value.Value.String);
            }

            return result.ToString();
        }

        [TestMethod]
        public void Test1()
        {
            var array = new OrderedDictionary();

            Assert.AreEqual(0, array.Count);

            array.Add("Hello");
            array.Add(" ");
            array.Add("World");

            Assert.AreEqual(3, array.Count);

            Assert.AreEqual("Hello World", ToString(array));

            Assert.AreEqual("Hello", array[0]);
            Assert.AreEqual("World", array[2]);

            array.Remove(1);

            Assert.AreEqual(2, array.Count);

            Assert.AreEqual("HelloWorld", ToString(array));

            Assert.AreEqual("World", array[2]);

            array.Add("!");

            Assert.AreEqual(3, array.Count);

            Assert.AreEqual("HelloWorld!", ToString(array));

            Assert.AreEqual("!", array[3]);

            Assert.IsTrue(array.ContainsKey(0));
            Assert.IsFalse(array.ContainsKey(1));
        }

        [TestMethod]
        public void Test2()
        {
            var array = new OrderedDictionary(100000);

            const int count = 1000000;

            for (int i = count; i > 0; i--)
            {
                array[i] = i.ToString("x4");
            }

            Assert.AreEqual(count, array.Count);

            int removed = 0;

            for (int i = 1; i < count; i += 3)
            {
                Assert.IsTrue(array.Remove(i));
                removed++;
            }

            Assert.AreEqual(count - removed, array.Count);
        }

        [TestMethod]
        public void TestPacked()
        {
            var array = new OrderedDictionary(100000);

            Assert.IsTrue(array.IsPacked);

            const int count = 1000000;

            for (int i = 0; i < count; i++)
            {
                array[i] = i.ToString("x4");
            }

            Assert.IsTrue(array.IsPacked);
            Assert.AreEqual(count, array.Count);

            for (int i = count - 1; i >= 0; i--)
            {
                Assert.IsTrue(array.Remove(i));
                Assert.IsTrue(array.IsPacked);
            }

            Assert.AreEqual(0, array.Count);
            Assert.AreEqual("", ToString(array)); // enumeration of empty array works

            for (int i = 0; i < count; i++)
            {
                array[i] = i.ToString("x4");
            }

            Assert.IsTrue(array.IsPacked);

            array.Add("last");

            Assert.IsTrue(array.IsPacked);
            Assert.AreEqual(count + 1, array.Count);
            Assert.IsTrue(array.ContainsKey(count));
            Assert.AreEqual("last", array[count]);
        }

        [TestMethod]
        public void TestShuffle()
        {
            // create array and check shuffle

            var array = new OrderedDictionary();

            const int count = 123;

            for (int i = 0; i < count; i++)
            {
                array.Add(i.ToString("x4"));
            }

            array.Remove(44);
            array.Remove(45);
            array.Remove(46);
            array.Remove(0);

            array.Shuffle(new Random());

            var set = new HashSet<long>();

            foreach (var pair in array)
            {
                Assert.IsTrue(set.Add(pair.Key.Integer));
            }

            Assert.AreEqual(array.Count, set.Count);
        }

        [TestMethod]
        public void TestReverse()
        {
            var array = new OrderedDictionary();

            const int count = 11;

            for (int i = 0; i < count; i++)
            {
                array.Add(i.ToString("x4"));
            }

            // reverse reverse -> must result in the same array as before

            var before = ToString(array);

            array.Reverse();
            array.Reverse();

            Assert.AreEqual(before, ToString(array));

            // expected count

            Assert.AreEqual(count, array.Count);

            // remove items and reverse array with holes:

            Assert.IsTrue(array.Remove(3));
            Assert.IsTrue(array.Remove(4));
            Assert.IsTrue(array.Remove(7));

            array.Reverse();

            var last = new KeyValuePair<IntStringKey, PhpValue>(int.MaxValue, default);

            foreach (var pair in array)
            {
                Assert.IsTrue(last.Key.Integer > pair.Key.Integer);
                Assert.AreEqual(pair.Value.String, pair.Key.Integer.ToString("x4"));

                last = pair;
            }
        }

        class KeyComparer : IComparer<KeyValuePair<IntStringKey, PhpValue>>
        {
            public int Compare(KeyValuePair<IntStringKey, PhpValue> x, KeyValuePair<IntStringKey, PhpValue> y)
            {
                return x.Key.Integer.CompareTo(y.Key.Integer);
            }
        }

        class ValueComparer : IComparer<KeyValuePair<IntStringKey, PhpValue>>
        {
            public int Compare(KeyValuePair<IntStringKey, PhpValue> x, KeyValuePair<IntStringKey, PhpValue> y)
            {
                return StringComparer.OrdinalIgnoreCase.Compare(x.Value.String, y.Value.String);
            }
        }

        [TestMethod]
        public void TestSort()
        {
            var array = new OrderedDictionary();

            const int count = 10;

            for (int i = count; i > 0; i--)
            {
                array[i] = i.ToString();
            }

            // remove items and reverse array with holes:

            Assert.IsTrue(array.Remove(3));
            Assert.IsTrue(array.Remove(4));
            Assert.IsTrue(array.Remove(7));

            array.Sort(new KeyComparer());

            Assert.AreEqual(count - 3, array.Count);

            var last = new KeyValuePair<IntStringKey, PhpValue>(0, default);

            foreach (var pair in array)
            {
                Assert.IsTrue(last.Key.Integer < pair.Key.Integer);
                Assert.AreEqual(pair.Value.String, pair.Key.Integer.ToString());

                last = pair;
            }
        }

        [TestMethod]
        public void TestDiff()
        {
            var array = new OrderedDictionary();

            const int count = 100;

            for (int i = 0; i < count; i++)
            {
                array[i] = i.ToString();
            }

            array.Shuffle(new Random());

            var array2 = new OrderedDictionary();
            array2.Add("3");
            array2.Add("4");
            array2.Add("7");

            var diff = array.SetOperation(SetOperations.Difference, new[] { new PhpArray(array2) }, new ValueComparer());

            Assert.AreEqual(array.Count - array2.Count, diff.Count);

            var diff_diff = array.SetOperation(SetOperations.Difference, new[] { new PhpArray(diff) }, new ValueComparer());

            Assert.AreEqual(diff_diff.Count, array2.Count);
        }

        [TestMethod]
        public void TestPrepend()
        {
            var array = new OrderedDictionary();
            array[0] = "0";
            array[1] = "1";

            array.AddFirst(-1, "-1");
            array.AddFirst(-2, "-2");

            Assert.AreEqual(4, array.Count);

            Assert.AreEqual("-2-101", ToString(array));
        }

        [TestMethod]
        public void TestUtils()
        {
            var array = new PhpArray()
            {
                { 1, "Hello" },
                { 2, "World" },
                { 3, "!" },
            };

            // array of values
            var values = array.ValuesToArray(value => value.ToString());

            Assert.IsInstanceOfType(values, typeof(string[]));
            Assert.AreEqual("!", values[2]);
            Assert.AreEqual(3, values.Length);

            // empty array of values
            Assert.AreSame(new PhpArray().ValuesToArray(value => value), Array.Empty<PhpValue>());

            // dictionary
            var dict = array.ToDictionary(key => key.ToString(), value => value.ToClr());
            Assert.IsInstanceOfType(dict, typeof(Dictionary<string, object>));
            Assert.IsTrue(dict.ContainsKey("3"));
        }
    }
}


text:
<!DOCTYPE html>
<html ng-app="component">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title>component example</title>
    <link rel="stylesheet" href="../index.css" />
  </head>
  <body>
    <component items="[1,2,3,4]"></component>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.js"></script>
    <script src="../dist/index.js"></script>
  </body>
</html>


text:
<web-app id="WebApp_ID" version="2.4"
	xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

	<display-name>Archetype Created Web Application</display-name>

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<!-- <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
		</filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>/*</url-pattern> </filter-mapping> -->

	<filter>
		<filter-name>encodingFilter</filter-name>
		<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- Configuration for the DispatcherServlet -->
	<servlet>
		<servlet-name>dispatcher</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>dispatcher</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>
	<error-page>
		<error-code>404</error-code>
		<location>/resource/404.jsp</location>
	</error-page>

</web-app>


text:
package umn.dcsg.wieralocalserver.storageinterfaces;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.security.InvalidKeyException;

import com.microsoft.azure.storage.*;
import com.microsoft.azure.storage.blob.*;

public class AzureStorageInterface extends StorageInterface {
	CloudBlobContainer m_container;

	//Azure Locations (17 regions for now)
	public static final String AS_US_EAST = "useast";                            // East US
	public static final String AS_US_EAST_KEY = "YOUR_OWN_KEY";
	public static final String AS_US_WEST = "uswest";
	public static final String AS_US_WEST_KEY = "YOUR_OWN_KEY";

	public AzureStorageInterface(String strAzureStorageName, String strAzureStoragekey, String strAzureStorageFolder) {
		String strStorageConnectionString = String.format("DefaultEndpointsProtocol=http;AccountName=%s;AccountKey=%s"
				, strAzureStorageName, strAzureStoragekey);

		try {
			CloudStorageAccount account = CloudStorageAccount.parse(strStorageConnectionString);
			CloudBlobClient serviceClient = account.createCloudBlobClient();
			m_container = serviceClient.getContainerReference(strAzureStorageFolder);
			m_container.createIfNotExists();
		} catch (URISyntaxException e) {
			e.printStackTrace();
		} catch (InvalidKeyException e) {
			e.printStackTrace();
		} catch (StorageException e) {
			e.printStackTrace();
		}
	}

	public boolean put(String key, byte[] value) {
		try {
			InputStream stream = new ByteArrayInputStream(value);

			// Upload an image file.
			CloudBlockBlob blob = m_container.getBlockBlobReference(key);
			blob.upload(stream, value.length);
		} catch (Exception e) {
			System.out.println("Write to Azure Storage failed");
			e.printStackTrace();
			return false;
		}

		return true;
	}

	public byte[] get(String key) {
		byte[] value = null;
		try {
			CloudBlockBlob blob = m_container.getBlockBlobReference(key);
			ByteArrayOutputStream output = new ByteArrayOutputStream(16384);
			blob.download(output);
			value = output.toByteArray();
		} catch (URISyntaxException e) {
			e.printStackTrace();
		} catch (StorageException e) {
			e.printStackTrace();
		}

		return value;
	}

	@Override
	public boolean rename(String oldKey, String newKey) {
		return false;
	}

	@Override
	public boolean copy(String oldKey, String newKey) {
		return false;
	}

	public boolean delete(String key) {
		try {
			CloudBlockBlob blob = m_container.getBlockBlobReference(key);
			blob.delete();

			return true;
		} catch (URISyntaxException e) {
			e.printStackTrace();
		} catch (StorageException e) {
			e.printStackTrace();
		}
		return false;
	}

	@Override
	public boolean growTier(int byPercent) {
		return true;
	}

	@Override
	public boolean shrinkTier(int byPercent) {
		return true;
	}
}


text:
namespace indexer
{
// Geometry index which stores base::GeoObjectId as object identifier.
// Used for geocoder server, stores only POIs and buildings which have address information.
// Based on IntervalIndex.
template <typename Reader, int DEPTH_LEVELS>
class LocalityIndex
{
public:
  using ProcessObject = std::function<void(base::GeoObjectId const &)>;

  LocalityIndex() = default;
  explicit LocalityIndex(Reader const & reader)
  {
    m_intervalIndex = std::make_unique<IntervalIndex<Reader, uint64_t>>(reader);
  }

  void ForEachInRect(ProcessObject const & processObject, m2::RectD const & rect) const
  {
    covering::CoveringGetter cov(rect, covering::CoveringMode::ViewportWithLowLevels);
    covering::Intervals const & intervals = cov.Get<DEPTH_LEVELS>(scales::GetUpperScale());

    for (auto const & i : intervals)
    {
      m_intervalIndex->ForEach(
            [&processObject](uint64_t storedId) {
        processObject(LocalityObject::FromStoredId(storedId));
      },
      i.first, i.second);
    }
  }

  // Applies |processObject| to the objects located within |radiusM| meters from |center|.
  // Application to the closest objects and only to them is not guaranteed and the order
  // of the objects is not specified.
  // However, the method attempts to process objects that are closer to |center| first
  // and stop after |sizeHint| objects have been processed. For stability, if an object from
  // an index cell has been processed, all other objects from this cell will be processed too,
  // thus probably overflowing the |sizeHint| limit.
  void ForClosestToPoint(ProcessObject const & processObject, m2::PointD const & center,
                         double radiusM, uint32_t sizeHint) const
  {
    auto const rect =
        MercatorBounds::RectByCenterXYAndSizeInMeters(center, radiusM);
    covering::CoveringGetter cov(rect, covering::CoveringMode::Spiral);
    covering::Intervals const & intervals = cov.Get<DEPTH_LEVELS>(scales::GetUpperScale());

    std::set<uint64_t> objects;
    auto processAll = [&objects, &processObject](uint64_t storedId) {
      if (objects.insert(storedId).second)
        processObject(LocalityObject::FromStoredId(storedId));
    };

    auto process = [&](uint64_t storedId) {
      if (objects.size() < sizeHint)
        processAll(storedId);
    };

    CHECK_EQUAL(intervals.begin()->first, intervals.begin()->second - 1, ());
    auto cellDepth = covering::GetCodingDepth<DEPTH_LEVELS>(scales::GetUpperScale());
    auto bestCell = m2::CellId<DEPTH_LEVELS>::FromInt64(intervals.begin()->first, cellDepth);
    std::set<int64_t> bestCells;
    while (bestCell.Level() > 0)
    {
      bestCells.insert(bestCell.ToInt64(cellDepth));
      bestCell = bestCell.Parent();
      --cellDepth;
    }

    for (auto const & i : intervals)
    {
      if (bestCells.find(i.first) != bestCells.end())
      {
        m_intervalIndex->ForEach(processAll, i.first, i.second);
      }
      else
      {
        m_intervalIndex->ForEach(process, i.first, i.second);
        if (objects.size() >= sizeHint)
          return;
      }
    }
  }

private:
  std::unique_ptr<IntervalIndex<Reader, uint64_t>> m_intervalIndex;
};

template <typename Reader>
using GeoObjectsIndex = LocalityIndex<Reader, kGeoObjectsDepthLevels>;

template <typename Reader>
using RegionsIndex = LocalityIndex<Reader, kRegionsDepthLevels>;

template <typename Reader>
struct GeoObjectsIndexBox
{
  static constexpr const char * kFileTag = GEO_OBJECTS_INDEX_FILE_TAG;

  using ReaderType = Reader;
  using IndexType = GeoObjectsIndex<ReaderType>;
};

template <typename Reader>
struct RegionsIndexBox
{
  static constexpr const char * kFileTag = REGIONS_INDEX_FILE_TAG;

  using ReaderType = Reader;
  using IndexType = RegionsIndex<ReaderType>;
};

template <typename IndexBox, typename Reader>
typename IndexBox::IndexType ReadIndex(std::string const & pathIndx)
{
  FilesContainerR cont(pathIndx);
  auto const offsetSize = cont.GetAbsoluteOffsetAndSize(IndexBox::kFileTag);
  Reader reader(pathIndx);
  typename IndexBox::ReaderType subReader(reader.CreateSubReader(offsetSize.first, offsetSize.second));
  typename IndexBox::IndexType index(subReader);
  return index;
}
}  // namespace indexer