text:
using System.Collections.Generic;
using System.Net.Http;
using Google.Apis.Json;
using Newtonsoft.Json;

namespace FirebaseAdmin
{
    ///
    /// Base class for handling HTTP error responses returned by Google Cloud Platform APIs.
    /// See Errors for more details on
    /// how Google Cloud Platform APIs report back error codes and details. If this class fails
    /// to determine an error code or message from a given API response, it falls back to the
    /// error handling logic defined in the parent <see cref="HttpErrorHandler{T}"/> class.
    ///
    internal abstract class PlatformErrorHandler<T> : HttpErrorHandler<T>
    where T : FirebaseException
    {
        private static readonly IReadOnlyDictionary<string, ErrorCode> PlatformErrorCodes =
            new Dictionary<string, ErrorCode>()
            {
                { "INVALID_ARGUMENT", ErrorCode.InvalidArgument },
                { "INTERNAL", ErrorCode.Internal },
                { "PERMISSION_DENIED", ErrorCode.PermissionDenied },
                { "UNAUTHENTICATED", ErrorCode.Unauthenticated },
                { "UNAVAILABLE", ErrorCode.Unavailable },
            };

        protected sealed override FirebaseExceptionArgs CreateExceptionArgs(
            HttpResponseMessage response, string body)
        {
            var parsedResponse = this.ParseResponseBody(body);
            var status = parsedResponse.Error?.Status ?? string.Empty;
            var defaults = base.CreateExceptionArgs(response, body);

            ErrorCode code;
            if (!PlatformErrorCodes.TryGetValue(status, out code))
            {
                code = defaults.Code;
            }

            var message = parsedResponse.Error?.Message;
            if (string.IsNullOrEmpty(message))
            {
                message = defaults.Message;
            }

            return new FirebaseExceptionArgs()
            {
                Code = code,
                Message = message,
                HttpResponse = response,
                ResponseBody = body,
            };
        }

        private PlatformErrorResponse ParseResponseBody(string body)
        {
            try
            {
                return NewtonsoftJsonSerializer.Instance.Deserialize<PlatformErrorResponse>(body);
            }
            catch
            {
                // Ignore any error that may occur while parsing the error response. The server
                // may have responded with a non-json payload. Return an empty return value, and
                // let the base class logic come into play.
                return new PlatformErrorResponse();
            }
        }

        internal sealed class PlatformErrorResponse
        {
            [JsonProperty("error")]
            public PlatformError Error { get; set; }
        }

        internal class PlatformError
        {
            [JsonProperty("status")]
            public string Status { get; set; }

            [JsonProperty("message")]
            public string Message { get; set; }
        }
    }
}


text: HoganAssets.template_extension = "mustache"

redpajama_set_name: RedPajamaGithub


text:
\hypertarget{Map_8cpp}{\section{/home/zejiang/\-Acme-\/\-Robotics-\/\-Project/app/\-Map.cpp File Reference}
\label{Map_8cpp}\index{/home/zejiang/\-Acme-\/\-Robotics-\/\-Project/app/\-Map.\-cpp@{/home/zejiang/\-Acme-\/\-Robotics-\/\-Project/app/\-Map.\-cpp}}
}

This file define two functions of $<$\-Map$>$ class.

{\ttfamily \#include \char`\"{}Map.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}Astar.\-h\char`\"{}}\\*
{\ttfamily \#include $<$utility$>$}\\*

\subsection{Detailed Description}
This file define two functions of $<$\-Map$>$ class. (C) 2017 Zejiang Zeng -\/ All Rights Reserved You may use, distribute and modify this code under the terms of the M\-I\-T license, please visit \-: \href{https://github.com/zzjkf2009/Acme-Robotics-Project/blob/master/LICENSE}{\tt https\-://github.\-com/zzjkf2009/\-Acme-\/\-Robotics-\/\-Project/blob/master/\-L\-I\-C\-E\-N\-S\-E}


text:
adduser -h /keepass -D keepass
chown -R keepass:keepass /keepass

su keepass -c "cd /keepass && npm start"


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

<title>EscherStm (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.poi.hpbf.model

Class EscherStm

java.lang.Object

org.apache.poi.hpbf.model.HPBFPart

org.apache.poi.hpbf.model.EscherPart

org.apache.poi.hpbf.model.EscherStm

public final class EscherStm
extends EscherPart

Field Summary

Fields inherited from class org.apache.poi.hpbf.model.HPBFPart

data

Constructor Summary

Constructors

Constructor and Description

EscherStm(DirectoryNode baseDir)

Method Summary

Methods inherited from class org.apache.poi.hpbf.model.EscherPart

generateData, getEscherRecords

Methods inherited from class org.apache.poi.hpbf.model.HPBFPart

getData, getPath, writeOut

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EscherStm

public EscherStm(DirectoryNode baseDir)
          throws java.io.IOException

Throws:

java.io.IOException

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

                Copyright 2016 The Apache Software Foundation or
        its licensors, as applicable.


text:
import {
  document,
  location,
  Math
} from '@/globals'

describe('Globals', () => {
  it('should export an alias for window.document', () => {
    expect(document)
      .to.equal(window.document)
  })

  it('should export an alias for window.document', () => {
    expect(location)
      .to.equal(document.location)
  })

  it('should export an alias for window.Math', () => {
    expect(Math)
      .to.equal(window.Math)
  })
})


text:
import unittest
import numpy as np
from op_test import OpTest
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.framework import _test_eager_guard

class TestUniqueOp(OpTest):
    def setUp(self):
        self.op_type = "unique"
        self.init_config()

    def test_check_output(self):
        self.check_output()

    def init_config(self):
        self.inputs = {
            'X': np.array([2, 3, 3, 1, 5, 3], dtype='int64'),
        }
        self.attrs = {'dtype': int(core.VarDesc.VarType.INT32)}
        self.outputs = {
            'Out': np.array([2, 3, 1, 5], dtype='int64'),
            'Index': np.array([0, 1, 1, 2, 3, 1], dtype='int32'),
        }

class TestOne(TestUniqueOp):
    def init_config(self):
        self.inputs = {
            'X': np.array([2], dtype='int64'),
        }
        self.attrs = {'dtype': int(core.VarDesc.VarType.INT32)}
        self.outputs = {
            'Out': np.array([2], dtype='int64'),
            'Index': np.array([0], dtype='int32'),
        }

class TestRandom(TestUniqueOp):
    def init_config(self):
        self.inputs = {'X': np.random.randint(0, 100, (150,), dtype='int64')}
        self.attrs = {'dtype': int(core.VarDesc.VarType.INT64)}
        np_unique, np_index, reverse_index = np.unique(
            self.inputs['X'], True, True
        )
        np_tuple = [(np_unique[i], np_index[i]) for i in range(len(np_unique))]
        np_tuple.sort(key=lambda x: x[1])
        target_out = np.array([i[0] for i in np_tuple], dtype='int64')
        target_index = np.array(
            [list(target_out).index(i) for i in self.inputs['X']], dtype='int64'
        )

        self.outputs = {'Out': target_out, 'Index': target_index}

class TestUniqueRaiseError(unittest.TestCase):
    def test_errors(self):
        def test_type():
            fluid.layers.unique([10])

        self.assertRaises(TypeError, test_type)

        def test_dtype():
            data = fluid.data(shape=[10], dtype="float16", name="input")
            fluid.layers.unique(data)

        self.assertRaises(TypeError, test_dtype)

@unittest.skipIf(
    not core.is_compiled_with_cuda(), "core is not compiled with CUDA"
)
class TestOneGPU(TestUniqueOp):
    def init_config(self):
        self.inputs = {
            'X': np.array([2], dtype='int64'),
        }
        self.attrs = {'dtype': int(core.VarDesc.VarType.INT32)}
        self.outputs = {
            'Out': np.array([2], dtype='int64'),
            'Index': np.array([0], dtype='int32'),
        }

    def test_check_output(self):
        if core.is_compiled_with_cuda():
            place = core.CUDAPlace(0)
            self.check_output_with_place(place, atol=1e-5)

@unittest.skipIf(
    not core.is_compiled_with_cuda(), "core is not compiled with CUDA"
)
class TestRandomGPU(TestUniqueOp):
    def init_config(self):
        self.inputs = {'X': np.random.randint(0, 100, (150,), dtype='int64')}
        self.attrs = {'dtype': int(core.VarDesc.VarType.INT64)}
        np_unique, np_index, reverse_index = np.unique(
            self.inputs['X'], True, True
        )
        np_tuple = [(np_unique[i], np_index[i]) for i in range(len(np_unique))]
        np_tuple.sort(key=lambda x: x[1])
        target_out = np.array([i[0] for i in np_tuple], dtype='int64')
        target_index = np.array(
            [list(target_out).index(i) for i in self.inputs['X']], dtype='int64'
        )

        self.outputs = {'Out': target_out, 'Index': target_index}

    def test_check_output(self):
        if core.is_compiled_with_cuda():
            place = core.CUDAPlace(0)
            self.check_output_with_place(place, atol=1e-5)

class TestSortedUniqueOp(TestUniqueOp):
    def init_config(self):
        self.inputs = {'X': np.array([2, 3, 3, 1, 5, 3], dtype='int64')}
        unique, indices, inverse, count = np.unique(
            self.inputs['X'],
            return_index=True,
            return_inverse=True,
            return_counts=True,
            axis=None,
        )
        self.attrs = {
            'dtype': int(core.VarDesc.VarType.INT32),
            "return_index": True,
            "return_inverse": True,
            "return_counts": True,
            "axis": None,
            "is_sorted": True,
        }
        self.outputs = {
            'Out': unique,
            'Indices': indices,
            "Index": inverse,
            "Counts": count,
        }

class TestUniqueOpAxisNone(TestUniqueOp):
    def init_config(self):
        self.inputs = {'X': np.random.random((4, 7, 10)).astype('float64')}
        unique, indices, inverse, counts = np.unique(
            self.inputs['X'],
            return_index=True,
            return_inverse=True,
            return_counts=True,
            axis=None,
        )
        self.attrs = {
            'dtype': int(core.VarDesc.VarType.INT32),
            "return_index": True,
            "return_inverse": True,
            "return_counts": True,
            "axis": None,
            "is_sorted": True,
        }
        self.outputs = {
            'Out': unique,
            'Indices': indices,
            "Index": inverse,
            "Counts": counts,
        }

class TestUniqueOpAxis1(TestUniqueOp):
    def init_config(self):
        self.inputs = {'X': np.random.random((3, 8, 8)).astype('float64')}
        unique, indices, inverse, counts = np.unique(
            self.inputs['X'],
            return_index=True,
            return_inverse=True,
            return_counts=True,
            axis=1,
        )
        self.attrs = {
            'dtype': int(core.VarDesc.VarType.INT32),
            "return_index": True,
            "return_inverse": True,
            "return_counts": True,
            "axis": [1],
            "is_sorted": True,
        }
        self.outputs = {
            'Out': unique,
            'Indices': indices,
            "Index": inverse,
            "Counts": counts,
        }

class TestUniqueAPI(unittest.TestCase):
    def test_dygraph_api_out(self):
        paddle.disable_static()
        x_data = x_data = np.random.randint(0, 10, (120))
        x = paddle.to_tensor(x_data)
        out = paddle.unique(x)
        expected_out = np.unique(x_data)
        self.assertTrue((out.numpy() == expected_out).all(), True)
        paddle.enable_static()

    def test_dygraph_api_attr(self):
        paddle.disable_static()
        x_data = np.random.random((3, 5, 5)).astype("float32")
        x = paddle.to_tensor(x_data)
        out, index, inverse, counts = paddle.unique(
            x,
            return_index=True,
            return_inverse=True,
            return_counts=True,
            axis=0,
        )
        np_out, np_index, np_inverse, np_counts = np.unique(
            x_data,
            return_index=True,
            return_inverse=True,
            return_counts=True,
            axis=0,
        )
        self.assertTrue((out.numpy() == np_out).all(), True)
        self.assertTrue((index.numpy() == np_index).all(), True)
        self.assertTrue((inverse.numpy() == np_inverse).all(), True)
        self.assertTrue((counts.numpy() == np_counts).all(), True)
        paddle.enable_static()

    def test_dygraph_attr_dtype(self):
        paddle.disable_static()
        x_data = x_data = np.random.randint(0, 10, (120))
        x = paddle.to_tensor(x_data)
        out, indices, inverse, counts = paddle.unique(
            x,
            return_index=True,
            return_inverse=True,
            return_counts=True,
            dtype="int32",
        )
        expected_out, np_indices, np_inverse, np_counts = np.unique(
            x_data, return_index=True, return_inverse=True, return_counts=True
        )
        self.assertTrue((out.numpy() == expected_out).all(), True)
        self.assertTrue((indices.numpy() == np_indices).all(), True)
        self.assertTrue((inverse.numpy() == np_inverse).all(), True)
        self.assertTrue((counts.numpy() == np_counts).all(), True)
        paddle.enable_static()

    def test_dygraph_api(self):
        with _test_eager_guard():
            self.test_dygraph_api_out()
            self.test_dygraph_api_attr()
            self.test_dygraph_attr_dtype()

    def test_static_graph(self):
        with paddle.static.program_guard(
            paddle.static.Program(), paddle.static.Program()
        ):
            x = paddle.fluid.data(name='x', shape=[3, 2], dtype='float64')
            unique, inverse, counts = paddle.unique(
                x, return_inverse=True, return_counts=True, axis=0
            )
            place = paddle.CPUPlace()
            exe = paddle.static.Executor(place)
            x_np = np.array([[1, 2], [3, 4], [1, 2]]).astype('float64')
            result = exe.run(
                feed={"x": x_np}, fetch_list=[unique, inverse, counts]
            )
        np_unique, np_inverse, np_counts = np.unique(
            x_np, return_inverse=True, return_counts=True, axis=0
        )
        np.testing.assert_allclose(result[0], np_unique, rtol=1e-05)
        np.testing.assert_allclose(result[1], np_inverse, rtol=1e-05)
        np.testing.assert_allclose(result[2], np_counts, rtol=1e-05)

class TestUniqueError(unittest.TestCase):
    def test_input_dtype(self):
        def test_x_dtype():
            with paddle.static.program_guard(
                paddle.static.Program(), paddle.static.Program()
            ):
                x = paddle.fluid.data(name='x', shape=[10, 10], dtype='float16')
                result = paddle.unique(x)

            self.assertRaises(TypeError, test_x_dtype)

    def test_attr(self):
        x = paddle.fluid.data(name='x', shape=[10, 10], dtype='float64')

        def test_return_index():
            result = paddle.unique(x, return_index=0)

        self.assertRaises(TypeError, test_return_index)

        def test_return_inverse():
            result = paddle.unique(x, return_inverse='s')

        self.assertRaises(TypeError, test_return_inverse)

        def test_return_counts():
            result = paddle.unique(x, return_counts=3)

        self.assertRaises(TypeError, test_return_counts)

        def test_axis():
            result = paddle.unique(x, axis='12')

        def test_dtype():
            result = paddle.unique(x, dtype='float64')

        self.assertRaises(TypeError, test_axis)

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


text:
package com.test.groups;
/*
  Source code:
     https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example
*/
import kafka.consumer.ConsumerIterator;
import kafka.consumer.KafkaStream;

public class ConsumerTest implements Runnable {
    private KafkaStream m_stream;
    private int m_threadNumber;

    public ConsumerTest(KafkaStream a_stream, int a_threadNumber) {
        m_threadNumber = a_threadNumber;
        m_stream = a_stream;
    }

    public void run() {
        ConsumerIterator<byte[], byte[]> it = m_stream.iterator();
        while (it.hasNext())
            System.out.println("Thread " + m_threadNumber + ": " + new String(it.next().message()));
        System.out.println("Shutting down Thread: " + m_threadNumber);
    }
}


text:
<?php
namespace Infopub;

class Assets
{
    public static function get($file)
    {
        return get_stylesheet_directory_uri().'/dist/'.$file;
    }

    public static function enqueueScripts()
    {
        $version = time();
        if (!WP_DEBUG) {
            $theme = wp_get_theme();
            $version = $theme->version;
        }

        wp_enqueue_style('all-css', Assets::get('css/all.css'), [], $version);
        wp_enqueue_script('all-js', Assets::get('js/all.js'), [], $version, true);

        $data = [
            'waiting_message' => __('Please, wait for response...', 'newsflow'),
            'ajax_url'        => admin_url('admin-ajax.php'),
            'nonce'           => wp_create_nonce('gatekeeper'),
        ];
        wp_localize_script('all-js', 'wpdata', $data);
    }
}


text:
#pragma once

#include "Audaspace.h"

#ifdef __cplusplus
using namespace aud;
#endif

#ifdef AUD_CAPI_IMPLEMENTATION
#include "ISound.h"
#include "devices/IHandle.h"
#include "devices/IDevice.h"
#include "sequence/SequenceEntry.h"
#include "fx/PlaybackManager.h"
#include "fx/DynamicMusic.h"
#include "fx/Source.h"
#include "util/ThreadPool.h"
#ifdef WITH_CONVOLUTION
#include "fx/ImpulseResponse.h"
#include "fx/HRTF.h"
#endif

typedef std::shared_ptr<aud::ISound> AUD_Sound;
typedef std::shared_ptr<aud::IHandle> AUD_Handle;
typedef std::shared_ptr<aud::IDevice> AUD_Device;
typedef std::shared_ptr<aud::SequenceEntry> AUD_SequenceEntry;
typedef std::shared_ptr<aud::PlaybackManager> AUD_PlaybackManager;
typedef std::shared_ptr<aud::DynamicMusic> AUD_DynamicMusic;
typedef std::shared_ptr<aud::ThreadPool> AUD_ThreadPool;
typedef std::shared_ptr<aud::Source> AUD_Source;
#ifdef WITH_CONVOLUTION
typedef std::shared_ptr<aud::ImpulseResponse> AUD_ImpulseResponse;
typedef std::shared_ptr<aud::HRTF> AUD_HRTF;
#endif
#else
typedef void AUD_Sound;
typedef void AUD_Handle;
typedef void AUD_Device;
typedef void AUD_SequenceEntry;
typedef void AUD_PlaybackManager;
typedef void AUD_DynamicMusic;
typedef void AUD_ThreadPool;
typedef void AUD_Source;
#ifdef WITH_CONVOLUTION
typedef void AUD_ImpulseResponse;
typedef void AUD_HRTF;
#endif
#endif

/// Container formats for writers.
typedef enum
{
	AUD_CONTAINER_INVALID = 0,
	AUD_CONTAINER_AC3,
	AUD_CONTAINER_FLAC,
	AUD_CONTAINER_MATROSKA,
	AUD_CONTAINER_MP2,
	AUD_CONTAINER_MP3,
	AUD_CONTAINER_OGG,
	AUD_CONTAINER_WAV
} AUD_Container;

/// Audio codecs for writers.
typedef enum
{
	AUD_CODEC_INVALID = 0,
	AUD_CODEC_AAC,
	AUD_CODEC_AC3,
	AUD_CODEC_FLAC,
	AUD_CODEC_MP2,
	AUD_CODEC_MP3,
	AUD_CODEC_PCM,
	AUD_CODEC_VORBIS,
	AUD_CODEC_OPUS
} AUD_Codec;

/**
 * The format of a sample.
 * The last 4 bit save the byte count of the format.
 */
typedef enum
{
	AUD_FORMAT_INVALID = 0x00,		/// Invalid sample format.
	AUD_FORMAT_U8      = 0x01,		/// 1 byte unsigned byte.
	AUD_FORMAT_S16     = 0x12,		/// 2 byte signed integer.
	AUD_FORMAT_S24     = 0x13,		/// 3 byte signed integer.
	AUD_FORMAT_S32     = 0x14,		/// 4 byte signed integer.
	AUD_FORMAT_FLOAT32 = 0x24,		/// 4 byte float.
	AUD_FORMAT_FLOAT64 = 0x28		/// 8 byte float.
} AUD_SampleFormat;

/// The channel count.
typedef enum
{
	AUD_CHANNELS_INVALID    = 0,	/// Invalid channel count.
	AUD_CHANNELS_MONO       = 1,	/// Mono.
	AUD_CHANNELS_STEREO     = 2,	/// Stereo.
	AUD_CHANNELS_STEREO_LFE = 3,	/// Stereo with LFE channel.
	AUD_CHANNELS_SURROUND4  = 4,	/// 4 channel surround sound.
	AUD_CHANNELS_SURROUND5  = 5,	/// 5 channel surround sound.
	AUD_CHANNELS_SURROUND51 = 6,	/// 5.1 surround sound.
	AUD_CHANNELS_SURROUND61 = 7,	/// 6.1 surround sound.
	AUD_CHANNELS_SURROUND71 = 8	/// 7.1 surround sound.
} AUD_Channels;

/**
 * The sample rate tells how many samples are played back within one second.
 * Some exotic formats may use other sample rates than provided here.
 */
typedef enum
{
	AUD_RATE_INVALID = 0,			/// Invalid sample rate.
	AUD_RATE_8000    = 8000,		/// 8000 Hz.
	AUD_RATE_16000   = 16000,		/// 16000 Hz.
	AUD_RATE_11025   = 11025,		/// 11025 Hz.
	AUD_RATE_22050   = 22050,		/// 22050 Hz.
	AUD_RATE_32000   = 32000,		/// 32000 Hz.
	AUD_RATE_44100   = 44100,		/// 44100 Hz.
	AUD_RATE_48000   = 48000,		/// 48000 Hz.
	AUD_RATE_88200   = 88200,		/// 88200 Hz.
	AUD_RATE_96000   = 96000,		/// 96000 Hz.
	AUD_RATE_192000  = 192000		/// 192000 Hz.
} AUD_DefaultSampleRate;

/// Sample rate type.
typedef double AUD_SampleRate;

/// Specification of a sound source.
typedef struct
{
	/// Sample rate in Hz.
	AUD_SampleRate rate;

	/// Channel count.
	AUD_Channels channels;
} AUD_Specs;

/// Specification of a sound device.
typedef struct
{
	/// Sample format.
	AUD_SampleFormat format;

	union
	{
		struct
		{
			/// Sample rate in Hz.
			AUD_SampleRate rate;

			/// Channel count.
			AUD_Channels channels;
		};
		AUD_Specs specs;
	};
} AUD_DeviceSpecs;

/// Sound information structure.
typedef struct
{
	AUD_Specs specs;
	float length;
} AUD_SoundInfo;


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

<title>Uses of Class org.maltparser.core.flow.spec.ChartItemSpecification (MaltParser 1.8)</title>
<meta name="date" content="2014-05-05">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

MaltParser 1.8

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.maltparser.core.flow.spec.ChartItemSpecification

Packages that use ChartItemSpecification

Package
Description

org.maltparser.core.config

Contains classes and an interface for handling parsing scenarios.

org.maltparser.core.flow

org.maltparser.core.flow.item

org.maltparser.core.flow.spec

org.maltparser.core.syntaxgraph

org.maltparser.core.syntaxgraph.reader

org.maltparser.core.syntaxgraph.writer

org.maltparser.parser

The top package for Single Malt Parser.

org.maltparser.transform.pseudo

Contains classes for performing pre-processing and post-processing transformations on dependency graphs.

Uses of ChartItemSpecification in org.maltparser.core.config

Methods in org.maltparser.core.config with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
ConfigDirChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

Uses of ChartItemSpecification in org.maltparser.core.flow

Methods in org.maltparser.core.flow with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

protected ChartItem
FlowChartInstance.initChartItem(ChartItemSpecification chartItemSpecification)

Uses of ChartItemSpecification in org.maltparser.core.flow.item

Fields in org.maltparser.core.flow.item declared as ChartItemSpecification

Modifier and Type
Field and Description

protected ChartItemSpecification
ChartItem.chartItemSpecification

Methods in org.maltparser.core.flow.item that return ChartItemSpecification

Modifier and Type
Method and Description

ChartItemSpecification
ChartItem.getChartItemSpecification()

Returns a chart item specification

Methods in org.maltparser.core.flow.item with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
ChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

Initialize the chart item

void
ChartItem.setChartItemSpecification(ChartItemSpecification chartItemSpecification)

Sets the specification of the chart item

Uses of ChartItemSpecification in org.maltparser.core.flow.spec

Methods in org.maltparser.core.flow.spec that return types with arguments of type ChartItemSpecification

Modifier and Type
Method and Description

LinkedHashSet<ChartItemSpecification>
ChartSpecification.getPostProcessChartItemSpecifications()

LinkedHashSet<ChartItemSpecification>
ChartSpecification.getPreProcessChartItemSpecifications()

LinkedHashSet<ChartItemSpecification>
ChartSpecification.getProcessChartItemSpecifications()

Methods in org.maltparser.core.flow.spec with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
ChartSpecification.addPostProcessChartItemSpecifications(ChartItemSpecification chartItemSpecification)

void
ChartSpecification.addPreProcessChartItemSpecifications(ChartItemSpecification chartItemSpecification)

void
ChartSpecification.addProcessChartItemSpecifications(ChartItemSpecification chartItemSpecification)

void
ChartSpecification.removePostProcessChartItemSpecifications(ChartItemSpecification chartItemSpecification)

void
ChartSpecification.removePreProcessChartItemSpecifications(ChartItemSpecification chartItemSpecification)

void
ChartSpecification.removeProcessChartItemSpecifications(ChartItemSpecification chartItemSpecification)

Uses of ChartItemSpecification in org.maltparser.core.syntaxgraph

Methods in org.maltparser.core.syntaxgraph with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
GraphAnalyzerChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

void
CopyChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

void
SyntaxGraphChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

Uses of ChartItemSpecification in org.maltparser.core.syntaxgraph.reader

Methods in org.maltparser.core.syntaxgraph.reader with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
ReadChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

Uses of ChartItemSpecification in org.maltparser.core.syntaxgraph.writer

Methods in org.maltparser.core.syntaxgraph.writer with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
WriteChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

Uses of ChartItemSpecification in org.maltparser.parser

Methods in org.maltparser.parser with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
SingleMaltChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

Uses of ChartItemSpecification in org.maltparser.transform.pseudo

Methods in org.maltparser.transform.pseudo with parameters of type ChartItemSpecification

Modifier and Type
Method and Description

void
PseudoProjChartItem.initialize(FlowChartInstance flowChartinstance,
                    ChartItemSpecification chartItemSpecification)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

MaltParser 1.8

Prev

Next

Frames

No Frames

All Classes

Copyright 2007-2014 Johan Hall, Jens Nilsson and Joakim Nivre.


text:
OPTIONS=$(cat <<EOF
Lock Screen
Logout
------
Shutdown
EOF
)

A=$(printf "$OPTIONS" | rofi -dmenu -p leave -location 3 -yoffset 25 -lines 5 -width 400 -i)
if [ $? -ne 0]; then
    exit 0
fi

if [ "$A" = "Lock Screen" ]; then
    xdotool key ctrl+alt+l
elif [ "$A" = "Logout" ]; then
    mate-session-save --logout-dialog
elif [ "$A" = "Shutdown" ]; then
    mate-session-save --shutdown-dialog
fi


text:
( function ( root, factory ){
  if( typeof define === 'function' && define.amd ){
    define([], factory );
  }else if( typeof exports === 'object' ){
    module.exports = factory();
  }else{
    root.inflection = factory();
  }
}( this, function (){

  /**
   * @description This is a list of nouns that use the same form for both singular and plural.
   *              This list should remain entirely in lower case to correctly match Strings.
   * @private
   */
  var uncountable_words = [
    'equipment', 'information', 'rice', 'money', 'species',
    'series', 'fish', 'sheep', 'moose', 'deer', 'news'
  ];

  /**
   * @description These rules translate from the singular form of a noun to its plural form.
   * @private
   */
  var plural_rules = [

    // do not replace if its already a plural word
    [ new RegExp( '(m)en$',      'gi' )],
    [ new RegExp( '(pe)ople$',   'gi' )],
    [ new RegExp( '(child)ren$', 'gi' )],
    [ new RegExp( '([ti])a$',    'gi' )],
    [ new RegExp( '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$','gi' )],
    [ new RegExp( '(hive)s$',           'gi' )],
    [ new RegExp( '(tive)s$',           'gi' )],
    [ new RegExp( '(curve)s$',          'gi' )],
    [ new RegExp( '([lr])ves$',         'gi' )],
    [ new RegExp( '([^fo])ves$',        'gi' )],
    [ new RegExp( '([^aeiouy]|qu)ies$', 'gi' )],
    [ new RegExp( '(s)eries$',          'gi' )],
    [ new RegExp( '(m)ovies$',          'gi' )],
    [ new RegExp( '(x|ch|ss|sh)es$',    'gi' )],
    [ new RegExp( '([m|l])ice$',        'gi' )],
    [ new RegExp( '(bus)es$',           'gi' )],
    [ new RegExp( '(o)es$',             'gi' )],
    [ new RegExp( '(shoe)s$',           'gi' )],
    [ new RegExp( '(cris|ax|test)es$',  'gi' )],
    [ new RegExp( '(octop|vir)i$',      'gi' )],
    [ new RegExp( '(alias|status)es$',  'gi' )],
    [ new RegExp( '^(ox)en',            'gi' )],
    [ new RegExp( '(vert|ind)ices$',    'gi' )],
    [ new RegExp( '(matr)ices$',        'gi' )],
    [ new RegExp( '(quiz)zes$',         'gi' )],

    // original rule
    [ new RegExp( '(m)an$', 'gi' ),                 '$1en' ],
    [ new RegExp( '(pe)rson$', 'gi' ),              '$1ople' ],
    [ new RegExp( '(child)$', 'gi' ),               '$1ren' ],
    [ new RegExp( '^(ox)$', 'gi' ),                 '$1en' ],
    [ new RegExp( '(ax|test)is$', 'gi' ),           '$1es' ],
    [ new RegExp( '(octop|vir)us$', 'gi' ),         '$1i' ],
    [ new RegExp( '(alias|status)$', 'gi' ),        '$1es' ],
    [ new RegExp( '(bu)s$', 'gi' ),                 '$1ses' ],
    [ new RegExp( '(buffal|tomat|potat)o$', 'gi' ), '$1oes' ],
    [ new RegExp( '([ti])um$', 'gi' ),              '$1a' ],
    [ new RegExp( 'sis$', 'gi' ),                   'ses' ],
    [ new RegExp( '(?:([^f])fe|([lr])f)$', 'gi' ),  '$1$2ves' ],
    [ new RegExp( '(hive)$', 'gi' ),                '$1s' ],
    [ new RegExp( '([^aeiouy]|qu)y$', 'gi' ),       '$1ies' ],
    [ new RegExp( '(x|ch|ss|sh)$', 'gi' ),          '$1es' ],
    [ new RegExp( '(matr|vert|ind)ix|ex$', 'gi' ),  '$1ices' ],
    [ new RegExp( '([m|l])ouse$', 'gi' ),           '$1ice' ],
    [ new RegExp( '(quiz)$', 'gi' ),                '$1zes' ],

    [ new RegExp( 's$', 'gi' ), 's' ],
    [ new RegExp( '$', 'gi' ),  's' ]
  ];

  /**
   * @description These rules translate from the plural form of a noun to its singular form.
   * @private
   */
  var singular_rules = [

    // do not replace if its already a singular word
    [ new RegExp( '(m)an$',                 'gi' )],
    [ new RegExp( '(pe)rson$',              'gi' )],
    [ new RegExp( '(child)$',               'gi' )],
    [ new RegExp( '^(ox)$',                 'gi' )],
    [ new RegExp( '(ax|test)is$',           'gi' )],
    [ new RegExp( '(octop|vir)us$',         'gi' )],
    [ new RegExp( '(alias|status)$',        'gi' )],
    [ new RegExp( '(bu)s$',                 'gi' )],
    [ new RegExp( '(buffal|tomat|potat)o$', 'gi' )],
    [ new RegExp( '([ti])um$',              'gi' )],
    [ new RegExp( 'sis$',                   'gi' )],
    [ new RegExp( '(?:([^f])fe|([lr])f)$',  'gi' )],
    [ new RegExp( '(hive)$',                'gi' )],
    [ new RegExp( '([^aeiouy]|qu)y$',       'gi' )],
    [ new RegExp( '(x|ch|ss|sh)$',          'gi' )],
    [ new RegExp( '(matr|vert|ind)ix|ex$',  'gi' )],
    [ new RegExp( '([m|l])ouse$',           'gi' )],
    [ new RegExp( '(quiz)$',                'gi' )],

    // original rule
    [ new RegExp( '(m)en$', 'gi' ),                                                       '$1an' ],
    [ new RegExp( '(pe)ople$', 'gi' ),                                                    '$1rson' ],
    [ new RegExp( '(child)ren$', 'gi' ),                                                  '$1' ],
    [ new RegExp( '([ti])a$', 'gi' ),                                                     '$1um' ],
    [ new RegExp( '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$','gi' ), '$1$2sis' ],
    [ new RegExp( '(hive)s$', 'gi' ),                                                     '$1' ],
    [ new RegExp( '(tive)s$', 'gi' ),                                                     '$1' ],
    [ new RegExp( '(curve)s$', 'gi' ),                                                    '$1' ],
    [ new RegExp( '([lr])ves$', 'gi' ),                                                   '$1f' ],
    [ new RegExp( '([^fo])ves$', 'gi' ),                                                  '$1fe' ],
    [ new RegExp( '(m)ovies$', 'gi' ),                                                    '$1ovie' ],
    [ new RegExp( '([^aeiouy]|qu)ies$', 'gi' ),                                           '$1y' ],
    [ new RegExp( '(s)eries$', 'gi' ),                                                    '$1eries' ],
    [ new RegExp( '(x|ch|ss|sh)es$', 'gi' ),                                              '$1' ],
    [ new RegExp( '([m|l])ice$', 'gi' ),                                                  '$1ouse' ],
    [ new RegExp( '(bus)es$', 'gi' ),                                                     '$1' ],
    [ new RegExp( '(o)es$', 'gi' ),                                                       '$1' ],
    [ new RegExp( '(shoe)s$', 'gi' ),                                                     '$1' ],
    [ new RegExp( '(cris|ax|test)es$', 'gi' ),                                            '$1is' ],
    [ new RegExp( '(octop|vir)i$', 'gi' ),                                                '$1us' ],
    [ new RegExp( '(alias|status)es$', 'gi' ),                                            '$1' ],
    [ new RegExp( '^(ox)en', 'gi' ),                                                      '$1' ],
    [ new RegExp( '(vert|ind)ices$', 'gi' ),                                              '$1ex' ],
    [ new RegExp( '(matr)ices$', 'gi' ),                                                  '$1ix' ],
    [ new RegExp( '(quiz)zes$', 'gi' ),                                                   '$1' ],
    [ new RegExp( 'ss$', 'gi' ),                                                          'ss' ],
    [ new RegExp( 's$', 'gi' ),                                                           '' ]
  ];

  /**
   * @description This is a list of words that should not be capitalized for title case.
   * @private
   */
  var non_titlecased_words = [
    'and', 'or', 'nor', 'a', 'an', 'the', 'so', 'but', 'to', 'of', 'at','by',
    'from', 'into', 'on', 'onto', 'off', 'out', 'in', 'over', 'with', 'for'
  ];

  /**
   * @description These are regular expressions used for converting between String formats.
   * @private
   */
  var id_suffix         = new RegExp( '(_ids|_id)$', 'g' );
  var underbar          = new RegExp( '_', 'g' );
  var space_or_underbar = new RegExp( '[\ _]', 'g' );
  var uppercase         = new RegExp( '([A-Z])', 'g' );
  var underbar_prefix   = new RegExp( '^_' );

  var inflector = {

  /**
   * A helper method that applies rules based replacement to a String.
   * @private
   * @function
   * @param {String} str String to modify and return based on the passed rules.
   * @param {Array: [RegExp, String]} rules Regexp to match paired with String to use for replacement
   * @param {Array: [String]} skip Strings to skip if they match
   * @param {String} override String to return as though this method succeeded (used to conform to APIs)
   * @returns {String} Return passed String modified by passed rules.
   * @example
   *
   *     this._apply_rules( 'cows', singular_rules ); // === 'cow'
   */
    _apply_rules : function ( str, rules, skip, override ){
      if( override ){
        str = override;
      }else{
        var ignore = ( inflector.indexOf( skip, str.toLowerCase()) > -1 );

        if( !ignore ){
          var i = 0;
          var j = rules.length;

          for( ; i < j; i++ ){
            if( str.match( rules[ i ][ 0 ])){
              if( rules[ i ][ 1 ] !== undefined ){
                str = str.replace( rules[ i ][ 0 ], rules[ i ][ 1 ]);
              }
              break;
            }
          }
        }
      }

      return str;
    },

  /**
   * This lets us detect if an Array contains a given element.
   * @public
   * @function
   * @param {Array} arr The subject array.
   * @param {Object} item Object to locate in the Array.
   * @param {Number} from_index Starts checking from this position in the Array.(optional)
   * @param {Function} compare_func Function used to compare Array item vs passed item.(optional)
   * @returns {Number} Return index position in the Array of the passed item.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.indexOf([ 'hi','there' ], 'guys' ); // === -1
   *     inflection.indexOf([ 'hi','there' ], 'hi' ); // === 0
   */
    indexOf : function ( arr, item, from_index, compare_func ){
      if( !from_index ){
        from_index = -1;
      }

      var index = -1;
      var i     = from_index;
      var j     = arr.length;

      for( ; i < j; i++ ){
        if( arr[ i ]  === item || compare_func && compare_func( arr[ i ], item )){
          index = i;
          break;
        }
      }

      return index;
    },

  /**
   * This function adds pluralization support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {String} plural Overrides normal output with said String.(optional)
   * @returns {String} Singular English language nouns are returned in plural form.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.pluralize( 'person' ); // === 'people'
   *     inflection.pluralize( 'octopus' ); // === 'octopi'
   *     inflection.pluralize( 'Hat' ); // === 'Hats'
   *     inflection.pluralize( 'person', 'guys' ); // === 'guys'
   */
    pluralize : function ( str, plural ){
      return inflector._apply_rules( str, plural_rules, uncountable_words, plural );
    },

  /**
   * This function adds singularization support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {String} singular Overrides normal output with said String.(optional)
   * @returns {String} Plural English language nouns are returned in singular form.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.singularize( 'people' ); // === 'person'
   *     inflection.singularize( 'octopi' ); // === 'octopus'
   *     inflection.singularize( 'Hats' ); // === 'Hat'
   *     inflection.singularize( 'guys', 'person' ); // === 'person'
   */
    singularize : function ( str, singular ){
      return inflector._apply_rules( str, singular_rules, uncountable_words, singular );
    },

  /**
   * This function will pluralize or singularlize a String appropriately based on an integer value
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {Number} count The number to base pluralization off of.
   * @param {String} singular Overrides normal output with said String.(optional)
   * @param {String} plural Overrides normal output with said String.(optional)
   * @returns {String} English language nouns are returned in the plural or singular form based on the count.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.inflect( 'people' 1 ); // === 'person'
   *     inflection.inflect( 'octopi' 1 ); // === 'octopus'
   *     inflection.inflect( 'Hats' 1 ); // === 'Hat'
   *     inflection.inflect( 'guys', 1 , 'person' ); // === 'person'
   *     inflection.inflect( 'person', 2 ); // === 'people'
   *     inflection.inflect( 'octopus', 2 ); // === 'octopi'
   *     inflection.inflect( 'Hat', 2 ); // === 'Hats'
   *     inflection.inflect( 'person', 2, null, 'guys' ); // === 'guys'
   */
    inflect : function ( str, count, singular, plural ){
      count = parseInt( count, 10 );

      if( isNaN( count )) return str;

      if( count === 0 || count > 1 ){
        return inflector._apply_rules( str, plural_rules, uncountable_words, plural );
      }else{
        return inflector._apply_rules( str, singular_rules, uncountable_words, singular );
      }
    },

  /**
   * This function adds camelization support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {Boolean} low_first_letter Default is to capitalize the first letter of the results.(optional)
   *                                 Passing true will lowercase it.
   * @returns {String} Lower case underscored words will be returned in camel case.
   *                  additionally '/' is translated to '::'
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.camelize( 'message_properties' ); // === 'MessageProperties'
   *     inflection.camelize( 'message_properties', true ); // === 'messageProperties'
   */
    camelize : function ( str, low_first_letter ){
      var str_path = str.split( '/' );
      var i        = 0;
      var j        = str_path.length;
      var str_arr, init_x, k, l, first;

      for( ; i < j; i++ ){
        str_arr = str_path[ i ].split( '_' );
        k       = 0;
        l       = str_arr.length;

        for( ; k < l; k++ ){
          if( k !== 0 ){
            str_arr[ k ] = str_arr[ k ].toLowerCase();
          }

          first = str_arr[ k ].charAt( 0 );
          first = low_first_letter && i === 0 && k === 0
            ? first.toLowerCase() : first.toUpperCase();
          str_arr[ k ] = first + str_arr[ k ].substring( 1 );
        }

        str_path[ i ] = str_arr.join( '' );
      }

      return str_path.join( '::' );
    },

  /**
   * This function adds underscore support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {Boolean} all_upper_case Default is to lowercase and add underscore prefix.(optional)
   *                  Passing true will return as entered.
   * @returns {String} Camel cased words are returned as lower cased and underscored.
   *                  additionally '::' is translated to '/'.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.underscore( 'MessageProperties' ); // === 'message_properties'
   *     inflection.underscore( 'messageProperties' ); // === 'message_properties'
   *     inflection.underscore( 'MP', true ); // === 'MP'
   */
    underscore : function ( str, all_upper_case ){
      if( all_upper_case && str === str.toUpperCase()) return str;

      var str_path = str.split( '::' );
      var i        = 0;
      var j        = str_path.length;

      for( ; i < j; i++ ){
        str_path[ i ] = str_path[ i ].replace( uppercase, '_$1' );
        str_path[ i ] = str_path[ i ].replace( underbar_prefix, '' );
      }

      return str_path.join( '/' ).toLowerCase();
    },

  /**
   * This function adds humanize support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {Boolean} low_first_letter Default is to capitalize the first letter of the results.(optional)
   *                                 Passing true will lowercase it.
   * @returns {String} Lower case underscored words will be returned in humanized form.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.humanize( 'message_properties' ); // === 'Message properties'
   *     inflection.humanize( 'message_properties', true ); // === 'message properties'
   */
    humanize : function ( str, low_first_letter ){
      str = str.toLowerCase();
      str = str.replace( id_suffix, '' );
      str = str.replace( underbar, ' ' );

      if( !low_first_letter ){
        str = inflector.capitalize( str );
      }

      return str;
    },

  /**
   * This function adds capitalization support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @returns {String} All characters will be lower case and the first will be upper.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.capitalize( 'message_properties' ); // === 'Message_properties'
   *     inflection.capitalize( 'message properties', true ); // === 'Message properties'
   */
    capitalize : function ( str ){
      str = str.toLowerCase();

      return str.substring( 0, 1 ).toUpperCase() + str.substring( 1 );
    },

  /**
   * This function adds dasherization support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @returns {String} Replaces all spaces or underbars with dashes.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.dasherize( 'message_properties' ); // === 'message-properties'
   *     inflection.dasherize( 'Message Properties' ); // === 'Message-Properties'
   */
    dasherize : function ( str ){
      return str.replace( space_or_underbar, '-' );
    },

  /**
   * This function adds titleize support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @returns {String} Capitalizes words as you would for a book title.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.titleize( 'message_properties' ); // === 'Message Properties'
   *     inflection.titleize( 'message properties to keep' ); // === 'Message Properties to Keep'
   */
    titleize : function ( str ){
      str         = str.toLowerCase().replace( underbar, ' ' );
      var str_arr = str.split( ' ' );
      var i       = 0;
      var j       = str_arr.length;
      var d, k, l;

      for( ; i < j; i++ ){
        d = str_arr[ i ].split( '-' );
        k = 0;
        l = d.length;

        for( ; k < l; k++){
          if( inflector.indexOf( non_titlecased_words, d[ k ].toLowerCase()) < 0 ){
            d[ k ] = inflector.capitalize( d[ k ]);
          }
        }

        str_arr[ i ] = d.join( '-' );
      }

      str = str_arr.join( ' ' );
      str = str.substring( 0, 1 ).toUpperCase() + str.substring( 1 );

      return str;
    },

  /**
   * This function adds demodulize support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @returns {String} Removes module names leaving only class names.(Ruby style)
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.demodulize( 'Message::Bus::Properties' ); // === 'Properties'
   */
    demodulize : function ( str ){
      var str_arr = str.split( '::' );

      return str_arr[ str_arr.length - 1 ];
    },

  /**
   * This function adds tableize support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @returns {String} Return camel cased words into their underscored plural form.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.tableize( 'MessageBusProperty' ); // === 'message_bus_properties'
   */
    tableize : function ( str ){
      str = inflector.underscore( str );
      str = inflector.pluralize( str );

      return str;
    },

  /**
   * This function adds classification support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @returns {String} Underscored plural nouns become the camel cased singular form.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.classify( 'message_bus_properties' ); // === 'MessageBusProperty'
   */
    classify : function ( str ){
      str = inflector.camelize( str );
      str = inflector.singularize( str );

      return str;
    },

  /**
   * This function adds foreign key support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {Boolean} drop_id_ubar Default is to seperate id with an underbar at the end of the class name,
                                 you can pass true to skip it.(optional)
   * @returns {String} Underscored plural nouns become the camel cased singular form.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.foreign_key( 'MessageBusProperty' ); // === 'message_bus_property_id'
   *     inflection.foreign_key( 'MessageBusProperty', true ); // === 'message_bus_propertyid'
   */
    foreign_key : function ( str, drop_id_ubar ){
      str = inflector.demodulize( str );
      str = inflector.underscore( str ) + (( drop_id_ubar ) ? ( '' ) : ( '_' )) + 'id';

      return str;
    },

  /**
   * This function adds ordinalize support to every String object.
   * @public
   * @function
   * @param {String} str The subject string.
   * @returns {String} Return all found numbers their sequence like '22nd'.
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.ordinalize( 'the 1 pitch' ); // === 'the 1st pitch'
   */
    ordinalize : function ( str ){
      var str_arr = str.split( ' ' );
      var i       = 0;
      var j       = str_arr.length;

      for( ; i < j; i++ ){
        var k = parseInt( str_arr[ i ], 10 );

        if( !isNaN( k )){
          var ltd = str_arr[ i ].substring( str_arr[ i ].length - 2 );
          var ld  = str_arr[ i ].substring( str_arr[ i ].length - 1 );
          var suf = 'th';

          if( ltd != '11' && ltd != '12' && ltd != '13' ){
            if( ld === '1' ){
              suf = 'st';
            }else if( ld === '2' ){
              suf = 'nd';
            }else if( ld === '3' ){
              suf = 'rd';
            }
          }

          str_arr[ i ] += suf;
        }
      }

      return str_arr.join( ' ' );
    },

  /**
   * This function performs multiple inflection methods on a string
   * @public
   * @function
   * @param {String} str The subject string.
   * @param {Array} arr An array of inflection methods.
   * @returns {String}
   * @example
   *
   *     var inflection = require( 'inflection' );
   *
   *     inflection.transform( 'all job', [ 'pluralize', 'capitalize', 'dasherize' ]); // === 'All-jobs'
   */
    transform : function ( str, arr ){
      var i = 0;
      var j = arr.length;

      for( ;i < j; i++ ){
        var method = arr[ i ];

        if( this.hasOwnProperty( method )){
          str = this[ method ]( str );
        }
      }

      return str;
    }
  };

/**
 * @public
 */
  inflector.version = '1.4.0';

  return inflector;
}));


text:
```purescript
data Bool = True | False

derive instance showBool :: Show Bool
```

## Cause

This error shows up when you're attempting to derive an instance for a class
for which compiler support does not exist. There is a [fixed list of classes
which can be derived by the compiler][derivable]; for any class not on this
list, however, you'll need to find another way of obtaining an instance.

## Fix

- You will need to write an instance yourself.
- For many classes (including `Show`), you can use [Generics][generics] to obtain the
  instances you want with less effort.

[generics]: https://pursuit.purescript.org/packages/purescript-generics-rep
[derivable]: https://github.com/purescript/documentation/blob/master/language/Type-Classes.md#type-class-deriving


text:
//
//  ASTipProvider.h
//  Texture
//
//  Copyright (c) Facebook, Inc. and its affiliates.  All rights reserved.
//  Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc.  All rights reserved.
//  Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <Foundation/Foundation.h>
#import <AsyncDisplayKit/ASBaseDefines.h>

#if AS_ENABLE_TIPS

@class ASDisplayNode, ASTip;

NS_ASSUME_NONNULL_BEGIN

/**
 * An abstract superclass for all tip providers.
 */
@interface ASTipProvider : NSObject

/**
 * The provider looks at the node's current situation and
 * generates a tip, if any, to add to the node.
 *
 * Subclasses must override this.
 */
- (nullable ASTip *)tipForNode:(ASDisplayNode *)node;

@end

@interface ASTipProvider (Lookup)

@property (class, nonatomic, copy, readonly) NSArray<__kindof ASTipProvider *> *all;

@end

NS_ASSUME_NONNULL_END

#endif // AS_ENABLE_TIPS


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.cagrid</groupId>
		<artifactId>cagrid-service-registration</artifactId>
		<version>2.1.0-SNAPSHOT</version>
	</parent>
	<artifactId>cagrid-service-registration-api</artifactId>
	<packaging>bundle</packaging>
	<name>caGrid Service Registration API</name>

	<properties>
		<wsdl.path>schema/org/cagrid/serviceregistration/ServiceGroupRegistrationClient.wsdl</wsdl.path>
	</properties>

	<profiles>
		<profile>
			<id>wsdl2java</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-codegen-plugin</artifactId>
						<!-- Don't copy *Fault.java generated with -xjc-XtoString, etc. -->
						<!-- types/AdminAlreadyExists.java -->
						<dependencies>
							<dependency>
								<groupId>org.jvnet.jaxb2_commons</groupId>
								<artifactId>jaxb2-basics</artifactId>
								<version>${jaxb2.basics.version}</version>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<id>generate-sources</id>
								<phase>generate-sources</phase>
								<configuration>
									<wsdlOptions>
										<wsdlOption>
											<wsdl>work/${wsdl.path}</wsdl>
											<wsdlLocation>/${wsdl.path}</wsdlLocation>
											<extraargs>
												<extraarg>-autoNameResolution</extraarg>
												<extraarg>-verbose</extraarg>
												<extraarg>-impl</extraarg>
												<extraarg>-client</extraarg>
												<extraarg>-p</extraarg>
												<extraarg>http://mds.globus.org/servicegroup/client=org.cagrid.serviceregistration.model</extraarg>
												<extraarg>-p</extraarg>
												<extraarg>http://mds.globus.org/bigindex/2008/11/24=org.cagrid.serviceregistration.model.mds</extraarg>
												<extraarg>-p</extraarg>
												<extraarg>http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd=org.cagrid.serviceregistration.model.rl</extraarg>
												<extraarg>-xjc-XtoString</extraarg>
												<extraarg>-xjc-XhashCode</extraarg>
												<extraarg>-xjc-Xequals</extraarg>
											</extraargs>
											<bindingFiles>
												<bindingFile>work/schema/jaxb-binding.xjb</bindingFile>
											</bindingFiles>
										</wsdlOption>
									</wsdlOptions>
								</configuration>
								<goals>
									<goal>wsdl2java</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<resources>
			<resource>
				<directory>work/schema</directory>
				<excludes>
					<exclude>jaxb-binding.xjb</exclude>
				</excludes>
				<targetPath>schema</targetPath>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<configuration>
					<filesets>
						<fileset>
							<directory>work</directory>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-schema</id>
						<phase>initialize</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>work/schema</outputDirectory>
							<resources>
								<resource>
									<directory>src/main/resources/schema</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>initialize</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>${wsrf.group}</groupId>
									<artifactId>ws-model</artifactId>
									<version>${wsrf.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>work</outputDirectory>
									<includes>schema/**/*.xsd</includes>
								</artifactItem>
								<artifactItem>
									<groupId>${wsrf.group}</groupId>
									<artifactId>wsrf-faults-api</artifactId>
									<version>${wsrf.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>work</outputDirectory>
									<includes>schema/**/*.xsd,schema/**/*.wsdl</includes>
								</artifactItem>
								<artifactItem>
									<groupId>${wsrf.group}</groupId>
									<artifactId>wsrf-properties-api</artifactId>
									<version>${wsrf.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>work</outputDirectory>
									<includes>schema/**/*.xsd,schema/**/*.wsdl</includes>
								</artifactItem>
								<artifactItem>
									<groupId>${wsrf.group}</groupId>
									<artifactId>wsrf-servicegroup-api</artifactId>
									<version>${wsrf.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>work</outputDirectory>
									<includes>schema/**/*.xsd,schema/**/*.wsdl</includes>
								</artifactItem>
								<artifactItem>
									<groupId>${project.groupId}</groupId>
									<artifactId>cagrid-metadata-model</artifactId>
									<version>${project.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>work</outputDirectory>
									<includes>schema/**/*.xsd,schema/**/*.wsdl</includes>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
						<Export-Package>
							schema.org.cagrid.serviceregistration,
							org.cagrid.serviceregistration,
							org.cagrid.serviceregistration.model,
							org.cagrid.serviceregistration.model.mds
						</Export-Package>
						<Import-Package>
							schema.org.cagrid.serviceregistration,
							org.cagrid.serviceregistration,
							org.cagrid.serviceregistration.model,
							org.cagrid.serviceregistration.model.mds,
							*
						</Import-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>cagrid-metadata-model</artifactId>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>cagrid-core</artifactId>
		</dependency>
		<dependency>
			<groupId>${wsrf.group}</groupId>
			<artifactId>ws-model</artifactId>
		</dependency>
		<dependency>
			<groupId>${wsrf.group}</groupId>
			<artifactId>wsrf-faults-api</artifactId>
		</dependency>
		<dependency>
			<groupId>${wsrf.group}</groupId>
			<artifactId>wsrf-properties-api</artifactId>
		</dependency>
		<dependency>
			<groupId>${wsrf.group}</groupId>
			<artifactId>wsrf-servicegroup-api</artifactId>
		</dependency>
		<dependency>
			<groupId>${wsrf.group}</groupId>
			<artifactId>wsrf-lifetime-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jvnet.jaxb2_commons</groupId>
			<artifactId>jaxb2-basics-runtime</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-commonj_1.1_spec</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<groupId>org.opensymphony.quartz</groupId>
			<artifactId>quartz</artifactId>
			<version>1.6.1</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.1.3</version>
		</dependency>
		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
			<version>3.2.2</version>
		</dependency>
	</dependencies>
</project>


text:
<?php

/**
 * @file
 * Contains \Drupal\migrate\Plugin\migrate\process\DefaultValue.
 */

namespace Drupal\migrate\Plugin\migrate\process;

use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Row;

/**
 * This plugin sets missing values on the destination.
 *
 * @MigrateProcessPlugin(
 *   id = "default_value"
 * )
 */
class DefaultValue extends ProcessPluginBase {

  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (!empty($this->configuration['strict'])) {
      return isset($value) ? $value : $this->configuration['default_value'];
    }
    return $value ?: $this->configuration['default_value'];
  }
}


text:
@implementation Utils

#pragma mark - 处理API返回信息

+ (NSAttributedString *)getAppclient:(int)clientType
{
    NSMutableAttributedString *clientString = [NSMutableAttributedString new];
    if (clientType > 1 && clientType <= 6) {
        NSTextAttachment *textAttachment = [NSTextAttachment new];
        textAttachment.image = [UIImage imageNamed:@"phone"];
        [textAttachment adjustY:-2];

        NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:textAttachment];
        [clientString appendAttributedString:attachmentString];

        NSArray *clients = @[@"", @"", @"手机", @"Android", @"iPhone", @"Windows Phone", @"微信"];
        [clientString appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];
        [clientString appendAttributedString:[[NSAttributedString alloc] initWithString:clients[clientType]]];
    } else {
        [clientString appendAttributedString:[[NSAttributedString alloc] initWithString:@""]];
    }

    return clientString;
}

+ (NSString *)generateRelativeNewsString:(NSArray *)relativeNews
{
    if (relativeNews == nil || [relativeNews count] == 0) {
        return @"";
    }

    NSString *middle = @"";
    for (NSArray *news in relativeNews) {
        middle = [NSString stringWithFormat:@"%@%@
", middle, news[1], news[0]];
    }
    return [NSString stringWithFormat:@"
相关文章

%@
", middle];
}

+ (NSString *)GenerateTags:(NSArray *)tags
{
    if (tags == nil || tags.count == 0) {
        return @"";
    } else {
        NSString *result = @"";
        for (NSString *tag in tags) {
            result = [NSString stringWithFormat:@"%@ %@   ", result, tag, tag];
        }
        return result;
    }
}

+ (void)analysis:(NSString *)url andNavController:(UINavigationController *)navigationController {
    //判断是否包含 oschina.net 来确定是不是站内链接
    NSRange range = [url rangeOfString:@"oschina.net"];
    if (range.length <= 0) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
    } else {
        //站内链接

        url = [url substringFromIndex:7];
        NSArray *pathComponents = [url pathComponents];
        NSString *prefix = [pathComponents[0] componentsSeparatedByString:@"."][0];
        UIViewController *viewController;

        if ([prefix isEqualToString:@"my"]) {

            if (pathComponents.count == 2) {
                //个人专页 my.oschina.net/dong706
                viewController = [[UserDetailsViewController alloc] initWithUserName:pathComponents[1]];
                viewController.navigationItem.title = @"用户详情";
            } else if (pathComponents.count == 3) {
                //个人专页 my.oschina.net/u/12
                if ([pathComponents[1] isEqualToString:@"u"]) {
                    viewController = [[UserDetailsViewController alloc] initWithUserID:[pathComponents[2] longLongValue]];
                    viewController.navigationItem.title = @"用户详情";
                }
            } else if (pathComponents.count == 4) {
                NSString *type = pathComponents[2];
                if ([type isEqualToString:@"blog"]) {
                    OSCNews *news = [OSCNews new];
                    news.type = NewsTypeBlog;
                    news.attachment = pathComponents[3];
                    viewController = [[DetailsViewController alloc] initWithNews:news];
                    viewController.navigationItem.title = @"博客详情";
                } else if ([type isEqualToString:@"tweet"]) {
                    OSCTweet *tweet = [OSCTweet new];
                    tweet.tweetID = [pathComponents[3] longLongValue];
                    viewController = [[TweetDetailsWithBottomBarViewController alloc] initWithTweetID:tweet.tweetID];
                    viewController.navigationItem.title = @"动弹详情";
                }
            } else if (pathComponents.count == 5) {
                NSString *type = pathComponents[3];
                if ([type isEqualToString:@"blog"]) {
                    OSCNews *news = [OSCNews new];
                    news.type = NewsTypeBlog;
                    news.attachment = pathComponents[4];
                    viewController = [[DetailsViewController alloc] initWithNews:news];
                    viewController.navigationItem.title = @"博客详情";
                }
            }
        } else if ([prefix isEqualToString:@"www"]) {
            //新闻、软件、问答
            NSArray *urlComponents = [url componentsSeparatedByString:@"/"];
            NSUInteger count = urlComponents.count;
            if (count >= 3) {
                NSString *type = urlComponents[1];
                if ([type isEqualToString:@"news"]) {
                    //新闻
                    //www.oschina.net/news/27259/mobile-internet-market-is-small

                    int64_t newsID = [urlComponents[2] longLongValue];
                    OSCNews *news = [OSCNews new];
                    news.type = NewsTypeStandardNews;
                    news.newsID = newsID;
                    viewController = [[DetailsViewController alloc] initWithNews:news];
                    viewController.navigationItem.title = @"资讯详情";
                } else if ([type isEqualToString:@"p"]) {
                    //软件 www.oschina.net/p/jx
                    OSCNews *news = [OSCNews new];
                    news.type = NewsTypeSoftWare;
                    news.attachment = urlComponents[2];
                    viewController = [[DetailsViewController alloc] initWithNews:news];
                    viewController.navigationItem.title = @"软件详情";
                } else if ([type isEqualToString:@"question"]) {
                    //问答
                    if (count == 3) {
                        //问答 www.oschina.net/question/12_45738
                        NSArray *IDs = [urlComponents[2] componentsSeparatedByString:@"_"];
                        if (IDs.count >= 2) {
                            OSCPost *post = [OSCPost new];
                            post.postID = [IDs[1] longLongValue];
                            viewController = [[DetailsViewController alloc] initWithPost:post];
                            viewController.navigationItem.title = @"帖子详情";
                        } else if (IDs.count == 4) {
                            //问答-标签 www.oschina.net/question/tag/python

                            NSString *tag = urlComponents.lastObject;

                            viewController = [PostsViewController new];
                            ((PostsViewController *)viewController).generateURL = ^NSString *(NSUInteger page) {
                                return [NSString stringWithFormat:@"%@%@?tag=%@&pageIndex=0&%@", OSCAPI_PREFIX, OSCAPI_POSTS_LIST, tag, OSCAPI_SUFFIX];
                            };
                            ((PostsViewController *)viewController).objClass = [OSCPost class];
                            viewController.navigationItem.title = [tag stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
                        } else if ([type isEqualToString:@"tweet-topic"]) {
                            //话题
                            url = [url stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
                            urlComponents = [url componentsSeparatedByString:@"/"];

                            viewController = [[TweetTopicViewController alloc] initWithTopic:urlComponents[2]];
                        }
                    }
                }
            }
        } else if ([prefix isEqualToString:@"static"]) {

            ImageViewController *imageViewerVC = [[ImageViewController alloc] initWithImageURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", url]]];
            [navigationController presentViewController:imageViewerVC animated:YES completion:nil];
           return;

        }

        if (viewController) {
            [navigationController pushViewController:viewController animated:YES];
        } else {
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", url]]];
        }

    }
}

#pragma mark - 通用

#pragma mark - 信息处理

+ (NSDictionary *)timeIntervalArrayFromString:(NSString *)dateStr {
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

    NSDate *date = [dateFormatter dateFromString:dateStr];

    NSUInteger unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitWeekOfYear | NSCalendarUnitWeekday | NSCalendarUnitDay  | NSCalendarUnitHour  | NSCalendarUnitMinute;
    NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    NSDateComponents *compsPast = [calendar components:unitFlags fromDate:date];
    NSDateComponents *compsNow = [calendar components:unitFlags fromDate:[NSDate date]];

    NSInteger years = compsNow.year - compsPast.year;
    NSInteger months = compsNow.month - compsPast.month + years * 12;
    NSInteger days = compsNow.day - compsPast.day + months * 30;
    NSInteger hours = compsNow.hour - compsPast.hour + days * 24;
    NSInteger minutes = compsNow.minute - compsPast.minute + hours * 60;

    return @{
             kKeyYears: @(years),
             kKeyMonths: @(months),
             kKeyDays: @(days),
             kKeyHours: @(hours),
             kKeyMinutes:@(minutes)
             };
}

+ (NSDateComponents *)getDateComponentsFromDate:(NSDate *)date {
    NSUInteger unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitWeekday | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute;
    NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    return [calendar components:unitFlags fromDate:date];
}

+ (NSString *)getWeekdayFromDateComponents:(NSDateComponents *)dateComps {
    switch (dateComps.weekday) {
        case 1: return @"星期天";
        case 2: return @"星期一";
        case 3: return @"星期二";
        case 4: return @"星期三";
        case 5: return @"星期四";
        case 6: return @"星期五";
        case 7: return @"星期六";
        default: return @"";
    }
}

+ (NSAttributedString *)attributedTimeString:(NSString *)dateStr {
    NSMutableAttributedString *attributedTime;

    NSTextAttachment *textAttachment = [NSTextAttachment new];
    textAttachment.image = [UIImage imageNamed:@"time"];
    [textAttachment adjustY:-1];

    NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:textAttachment];
    attributedTime = [[NSMutableAttributedString alloc] initWithAttributedString:attachmentString];
    [attributedTime appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];
    [attributedTime appendAttributedString:[[NSAttributedString alloc] initWithString:[self intervalSinceNow:dateStr]]];

    return attributedTime;
}

+ (NSAttributedString *)attributedCommentCount:(int)commentCount {
    NSMutableAttributedString *attributedCommentCount;

    NSTextAttachment *textAttachment = [NSTextAttachment new];
    textAttachment.image = [UIImage imageNamed:@"comment"];
    [textAttachment adjustY:-2];

    NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:textAttachment];
    attributedCommentCount = [[NSMutableAttributedString alloc] initWithAttributedString:attachmentString];
    [attributedCommentCount appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];
    [attributedCommentCount appendAttributedString:[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", commentCount]]];

    return attributedCommentCount;
}

+ (NSString *)intervalSinceNow:(NSString *)dateStr
{
    NSDictionary *dic = [Utils timeIntervalArrayFromString:dateStr];
    //NSInteger years = [[dic objectForKey:kKeyYears] integerValue];
    NSInteger months = [[dic objectForKey:kKeyMonths] integerValue];
    NSInteger days = [[dic objectForKey:kKeyDays] integerValue];
    NSInteger hours = [[dic objectForKey:kKeyHours] integerValue];
    NSInteger minutes = [[dic objectForKey:kKeyMinutes] integerValue];

    if (minutes < 1) {
        return @"刚刚";
    } else if (minutes < 60) {
        return [NSString stringWithFormat:@"%ld分钟前", (long)minutes];
    } else if (hours < 24) {
        return [NSString stringWithFormat:@"%ld小时前", (long)hours];
    } else if (hours < 48 && days == 1) {
        return @"昨天";
    } else if (days < 30) {
        return [NSString stringWithFormat:@"%ld天前", (long)days];
    } else if (days < 60) {
        return @"一个月前";
    } else if (months < 12) {
        return [NSString stringWithFormat:@"%ld个月前", (long)months];
    } else {
        NSArray *arr = [dateStr componentsSeparatedByString:@"T"];
        return arr.firstObject;
    }
}

// 参考 http://www.cnblogs.com/ludashi/p/3962573.html
+ (NSAttributedString *)emojiStringFromRawString:(NSString *)rawString {
    NSMutableAttributedString *emojiString = [[NSMutableAttributedString alloc] initWithString:rawString];

    NSBundle *bundle = [NSBundle mainBundle];
    NSString *path = [bundle pathForResource:@"emoji" ofType:@"plist"];
    NSDictionary *emoji = [[NSDictionary alloc] initWithContentsOfFile:path];

    NSString *pattern = @"\\[[a-zA-Z0-9\\u4e00-\\u9fa5]+\\]|:[a-zA-Z0-9\\u4e00-\\u9fa5_]+:";
    NSError *error = nil;
    NSRegularExpression *re = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:&error];

    NSArray *resultsArray = [re matchesInString:rawString options:0 range:NSMakeRange(0, rawString.length)];

    NSMutableArray *emojiArray = [NSMutableArray arrayWithCapacity:resultsArray.count];

    for (NSTextCheckingResult *math in resultsArray) {
        NSRange range = [math range];
        NSString *emojiName = [rawString substringWithRange:range];

        if ([emojiName hasPrefix:@"["] && emoji[emojiName]) {
                NSTextAttachment *textAttachment = [NSTextAttachment new];
                textAttachment.image = [UIImage imageNamed:emoji[emojiName]];
                NSAttributedString *emojiAttributedString = [NSAttributedString attributedStringWithAttachment:textAttachment];
                NSDictionary *emojiToReplace = @{@"image": emojiAttributedString, @"range": [NSValue valueWithRange:range]};
                [emojiArray addObject:emojiToReplace];
        } else if ([emojiName hasPrefix:@":"] && emoji[emojiName]) {
            NSDictionary *emojiToReplace = @{@"text": emoji[emojiName], @"range": [NSValue valueWithRange:range]};
            [emojiArray addObject:emojiToReplace];
        }
    }

    for (NSInteger i = emojiArray.count - 1; i >= 0; i--) {
        NSRange range;
        [emojiArray[i][@"range"] getValue:&range];
        if (emojiArray[i][@"image"]) {
            [emojiString replaceCharactersInRange:range withAttributedString:emojiArray[i][@"image"]];
        } else {
            [emojiString replaceCharactersInRange:range withString:emojiArray[i][@"text"]];
        }
    }

    return emojiString;
}

+ (NSMutableAttributedString *)attributedStringFromHTML:(NSString *)HTML {
    return [[NSMutableAttributedString alloc] initWithData:[HTML dataUsingEncoding:NSUnicodeStringEncoding]
                                                   options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType}
                                        documentAttributes:nil
                                                     error:nil];
}

+ (NSData *)compressImage:(UIImage *)image {
    CGSize size = [self scaleSize:image.size];
    UIGraphicsBeginImageContext(size);
    [image drawInRect:CGRectMake(0, 0, size.width, size.height)];
    UIImage * scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    NSUInteger maxFileSize = 500*1024;
    CGFloat compressRatio = 0.7f;
    CGFloat maxCompressionRatio = 0.1f;

    NSData *imageData = UIImageJPEGRepresentation(scaledImage, compressRatio);
    while (imageData.length > maxFileSize && compressRatio > maxCompressionRatio) {
        compressRatio -= 0.1f;

        imageData = UIImageJPEGRepresentation(image, compressRatio);
    }

    return imageData;
}

+ (CGSize)scaleSize:(CGSize)sourceSize {
    float width = sourceSize.width;
    float height = sourceSize.height;
    if (width >= height) {
        return CGSizeMake(800, 800 * height / width);
    } else {
        return CGSizeMake(800 * width / height, 800);
    }
}

+ (NSString *)escapeHTML:(NSString *)originalHTML {
    if (!originalHTML) {
        return @"";
    }

    NSMutableString *result = [[NSMutableString alloc] initWithString:originalHTML];
    [result replaceOccurrencesOfString:@"&"  withString:@"&"  options:NSLiteralSearch range:NSMakeRange(0, [result length])];
    [result replaceOccurrencesOfString:@"<"  withString:@"<"   options:NSLiteralSearch range:NSMakeRange(0, [result length])];
    [result replaceOccurrencesOfString:@">"  withString:@">"   options:NSLiteralSearch range:NSMakeRange(0, [result length])];
    [result replaceOccurrencesOfString:@"\"" withString:@""" options:NSLiteralSearch range:NSMakeRange(0, [result length])];
    [result replaceOccurrencesOfString:@"'"  withString:@"'"  options:NSLiteralSearch range:NSMakeRange(0, [result length])];

    return result;
}

+ (NSString *)deleteHTMLTag:(NSString *)HTML
{
    NSMutableString *trimmedHTML = [[NSMutableString alloc] initWithString:HTML];

    NSString *styleTagPattern = @"


text:
class Translator
  def initialize(language)
    @language = language
  end

  def hi
    case @language
    when "spanish"
      "¡Hola matiasdim!"
    else
      "Hello matiasdim!"
    end
  end
end


text:
package io.dropwizard.jersey.params;

import javax.annotation.Nullable;

/**
 * A parameter encapsulating boolean values. If the query parameter value is {@code "true"},
 * regardless of case, the returned value is {@link Boolean#TRUE}. If the query parameter value is
 * {@code "false"}, regardless of case, the returned value is {@link Boolean#FALSE}. All other
 * values will return a {@code 400 Bad Request} response.
 *
 * @deprecated As of release 2.0.0, will be removed in 3.0.0. Please use {@link java.util.Optional} instead.
 */
@Deprecated
public class BooleanParam extends AbstractParam<Boolean> {
    public BooleanParam(@Nullable String input) {
        super(input);
    }

    public BooleanParam(@Nullable String input, String parameterName) {
        super(input, parameterName);
    }

    @Override
    protected String errorMessage(Exception e) {
        return "%s must be \"true\" or \"false\".";
    }

    @Override
    protected Boolean parse(@Nullable String input) throws Exception {
        if ("true".equalsIgnoreCase(input)) {
            return Boolean.TRUE;
        }
        if ("false".equalsIgnoreCase(input)) {
            return Boolean.FALSE;
        }
        throw new Exception();
    }
}


text:
package com.marklogic.hub.web.web;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.marklogic.hub.impl.HubConfigImpl;
import com.marklogic.hub.web.model.SJSSearchQuery;
import com.marklogic.hub.web.model.SearchQuery;
import com.marklogic.hub.web.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping(value = "/api/search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    @Autowired
    private HubConfigImpl hubConfig;

    @Bean
    @Scope(proxyMode = ScopedProxyMode.TARGET_CLASS, value = "request")
    SearchService searchService() {
        return new SearchService(hubConfig);
    }

    @RequestMapping(method = RequestMethod.POST)
    @ResponseBody
    public String search(@RequestBody SearchQuery searchQuery) throws JsonProcessingException {
        return searchService.search(searchQuery).get();
    }

    @RequestMapping(value = "/sjsSearch", method = RequestMethod.POST)
    @ResponseBody
    public JsonNode sjsSearch(@RequestBody SJSSearchQuery SJSSearchQuery) {
        return searchService.sjsSearch(SJSSearchQuery);
    }

    @RequestMapping(value = "/doc", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<String> getDoc(@RequestParam String database, @RequestParam String docUri) {
        HttpHeaders headers = new HttpHeaders();
        String body = searchService.getDoc(database, docUri);
        if (body.startsWith("<")) {
            headers.setContentType(MediaType.APPLICATION_XML);
        }
        else {
            headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
        }
        return new ResponseEntity<>(body, headers, HttpStatus.OK);
    }
}


text: ::: humanize.filesize


text:
    PDFDATA.io is an API providing PDF data extraction as a
    service. This library, pdfdata-java,
    is our official Java client, providing an
    efficient, easy-to-use model for interacting with and using PDFDATA.io from Java, as well as
    from any JVM-based programming language, including Scala, Clojure, Groovy,
    Kotlin, JRuby, Jython, and others.

    This Javadoc provides useful hints and important Java-specific documentation for
    pdfdata-java, but our primary API
    reference is the authoritative source for both introductory overview and advanced detailed
    information on the PDFDATA.io API itself, as well as this library.


text:
namespace Packets
{
	namespace BNet
	{
		DECLARE_PACKET_BNET_BEGIN(BNetFriendsList, 0x65FF)
			Core::Client * cl;
		DECLARE_PACKET_BNET_END()
	}
}

#endif // _BNETFRIENDSLIST_H_


text:
function first(xs) {
    for (let x of xs) {
        return x;
    }
}

export default first;


text:
package org.n52.iceland.response;

import org.n52.shetland.ogc.ows.service.OwsServiceResponse;

public class TestResponse extends OwsServiceResponse {

}


text:
using System;
using System.IO;
using System.Windows.Forms;
using System.Text;

class Script
{
	const string usage = "Usage: cscscript cutFile filename [size]\n"+
						 "Cuts file in pieces and prepares batch file to reassemble the original file.\n"+
						 "\n"+
						 "Size can be specified in units (etc. 1024K, 500, 2M):\n"+
						 "  <no unit> - bytes\n"+
						 "  K		 - kilobytes\n"+
						 "  M		 - megabytes\n"+
						 "Default single piece size is 1024K (1M)\n"+
						 "\n"+
						 "Note:\n"+
						 "No script is required to reassemble the original file. Just run <filename>.bat.\n";

	static public void Main(string[] args)
	{
		if (args.Length == 0 || (args.Length == 1 && (args[0] == "?" || args[0] == "/?" || args[0] == "-?" || args[0].ToLower() == "help")))
		{
			Console.WriteLine(usage);
		}
		else
		{
			try
			{
				string file = args[0];
				int size = 1024*1024; //1M
				if (args.Length > 1)
				{
					string sizeStr = args[1].Trim();
					int factor = 1;
					if (sizeStr.EndsWith("M") || sizeStr.EndsWith("m"))
					{
						sizeStr = sizeStr.Substring(0, sizeStr.Length-1);
						factor = 1024*1024;
					}
					else if (sizeStr.EndsWith("K") || sizeStr.EndsWith("k"))
					{
						sizeStr = sizeStr.Substring(0, sizeStr.Length-1);
						factor = 1024;
					}
					size = Convert.ToInt32(sizeStr) * factor;
				}

				string ressembleCmd = "copy /b ";
				using (FileStream fin = new FileStream(file, FileMode.Open, FileAccess.Read))
				{
					byte[] buffer = new byte[1024*100]; //100K
					int bytesRead = 0, bytesReadTotal = 0, bytesWritten = 0, fileCount = 0;

					do
					{
						string currFileName = file+"."+fileCount.ToString("####0000");
						using (FileStream fout = new FileStream(currFileName, FileMode.OpenOrCreate, FileAccess.Write))
						{
							do
							{
								int bytesToRead = (bytesWritten + buffer.Length) <= size ?
									buffer.Length :
									size - bytesWritten;

								bytesRead = fin.Read(buffer, 0, bytesToRead);
								if (bytesRead != 0)
								{
									fout.Write(buffer, 0, bytesRead);
									bytesWritten += bytesRead;
									bytesReadTotal += bytesRead;
								}
								if (bytesWritten >= size)
								{
									bytesWritten = 0;
									break;
								}
							}
							while(bytesRead != 0);
						}
						Console.WriteLine(Path.GetFileName(currFileName));

						if (fileCount > 0)
							ressembleCmd += "+\""+Path.GetFileName(currFileName)+"\"";
						else
							ressembleCmd += "\""+Path.GetFileName(currFileName)+"\"";

						fileCount++;
					}
					while (bytesRead != 0);
				}

				ressembleCmd += " "+Path.GetFileName(file);

				using (StreamWriter sw = new StreamWriter(file+".bat"))
				{
					sw.WriteLine(ressembleCmd);
				}
			}
			catch (Exception e)
			{
				Console.WriteLine(e);
			}
		}
	}
}


text:
The Code of Conduct governs how we behave in public or in private
whenever the project will be judged by our actions.
We expect it to be honored by everyone who represents the project
officially or informally,
claims affiliation with the project,
or participates directly.

We strive to:

* **Be open**: We invite anybody to participate in any aspect of our projects.
  Our community is open, and any responsibility can be carried
  by any contributor who demonstrates the required capacity and competence.
* **Be empathetic**: We work together to resolve conflict,
  assume good intentions,
  and do our best to act in an empathic fashion.
  By understanding that humanity drops a few packets in online interactions,
  and adjusting accordingly,
  we can create a comfortable environment for everyone to share their ideas.
* **Be collaborative**: We prefer to work transparently
  and to involve interested parties early on in the process.
  Wherever possible, we work closely with others in the open source community
  to coordinate our efforts.
* **Be decisive**: We expect participants in the project to resolve disagreements constructively.
  When they cannot, we escalate the matter to structures
  with designated leaders to arbitrate and provide clarity and direction.
* **Be responsible**: We hold ourselves accountable for our actions.
  When we make mistakes, we take responsibility for them.
  When we need help, we reach out to others.
  When it comes time to move on from a project,
  we take the proper steps to ensure that others can pick up where we left off.

This code is not exhaustive or complete.
It serves to distill our common understanding of a
collaborative, shared environment and goals.
We expect it to be followed in spirit as much as in the letter.

---

*The FlightAnimator Code of Conduct is licensed under the [Creative Commons Attribution-Share Alike 3.0 License](https://creativecommons.org/licenses/by-sa/3.0/us/).*

*The wording and ideas for the statements above were based on work by [Alamorefire](https://github.com/Alamofire/Foundation/blob/master/CONDUCT.md), [Mozilla](https://wiki.mozilla.org/Code_of_Conduct/Draft), [Ubuntu](http://www.ubuntu.com/about/about-ubuntu/conduct), and [Twitter](https://github.com/twitter/code-of-conduct).*


text:
package jdepend.server.service.user;

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

import jdepend.framework.exception.JDependException;
import jdepend.framework.log.Operation;
import jdepend.server.service.user.User;
import jdepend.server.service.user.UserActionItem;
import jdepend.server.service.user.UserStateChangeListener;

public final class UserDomainService {

	private UserStateChangeListener listener;

	private final static String ADMIN = "admin";

	public void processCredits(User user, Operation operation) throws JDependException {
		if (!user.getName().equals(ADMIN) && operationToIntegral.get(operation) != null) {
			user.changeIntegral(operationToIntegral.get(operation));
			user.save();
			if (listener != null) {
				listener.onChange(user);
			}
		}
	}

	public void saveUserAction(List<UserActionItem> items) throws JDependException {
		UserActionRepository.insertUserActions(items);
	}

	public List<UserActionItem> getAllUserActions() throws JDependException {
		return UserActionRepository.getAllUserActions();
	}

	public List<UserActionItem> getTheUserActions(String username) throws JDependException {
		return UserActionRepository.getTheUserActions(username);
	}

	public List<User> findUsers() throws JDependException {
		return UserRepository.findUsers();
	}

	public static final Map<Operation, Integer> operationToIntegral = new HashMap<Operation, Integer>();
	static {
		operationToIntegral.put(Operation.login, 10);

		operationToIntegral.put(Operation.uploadAnalyzer, 500);
		operationToIntegral.put(Operation.downloadAnalyzer, -100);
		operationToIntegral.put(Operation.executeAnalyzer, 10);

		operationToIntegral.put(Operation.executeCommand, 5);
		operationToIntegral.put(Operation.createGroup, 50);
		operationToIntegral.put(Operation.createCommand, 10);

		operationToIntegral.put(Operation.moveToClass, -5);
		operationToIntegral.put(Operation.uniteComponent, -5);
		operationToIntegral.put(Operation.saveTextReport, -10);
	}

	public void setListener(UserStateChangeListener listener) {
		this.listener = listener;
	}
}


text:
"""
    Swaggy Jenkins

    Jenkins API clients generated from Swagger / Open API specification  # noqa: E501

    The version of the OpenAPI document: 1.5.1-pre.0
    Contact: blah@cliffano.com
    Generated by: https://openapi-generator.tech
"""

import unittest

import openapi_client
from openapi_client.model.disk_space_monitor_descriptor_disk_space import DiskSpaceMonitorDescriptorDiskSpace

class TestDiskSpaceMonitorDescriptorDiskSpace(unittest.TestCase):
    """DiskSpaceMonitorDescriptorDiskSpace unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_DiskSpaceMonitorDescriptorDiskSpace(self):
        """Test DiskSpaceMonitorDescriptorDiskSpace"""
        # FIXME: construct object with mandatory attributes with example values
        # model = DiskSpaceMonitorDescriptorDiskSpace()  # noqa: E501
        pass

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


text:
//
//  GX.hpp
//  GX
//
//  Created by Manuel Deneu on 23/05/2017.
//  Copyright © 2017 Unlimited Development. All rights reserved.
//

#ifndef GX_h
#define GX_h

#define GX_VERSION_MIN (int) 5
#define GX_VERSION_MAJ (int) 0

#include <GXDisplay.hpp>
#include <GXContext.hpp>
#include <GXLayer.hpp>
#include <GXColor.hpp>

#endif /* GX_h */


text:
A Kolla Cluster with Heat
=========================

These [Heat][] templates will deploy an *N*-node [Kolla][] cluster,
where *N* is the value of the `number_of_nodes` parameter you
specify when creating the stack.

Kolla has recently undergone a considerable design change. The details
of the design change is addressed in this [spec][]. As part of the
design change, containers share pid and networking namespaces with
the Docker host. Therefore, containers no longer connect to a docker0
bridge and have separate networking from the host. As a result, Kolla
networking has a configuration similar to:

![Image](https://raw.githubusercontent.com/stackforge/kolla/master/devenv/kollanet.png)

Sharing pid and networking namespaces is detailed in the
[super privileged containers][] concept.

The Kolla cluster is based on Fedora 21, requires the Docker 1.5.0-dev
[binary][] and runs a newer version of `docker-compose` that includes
pid: host support. One of the authors of Kolla has a pull request
outstanding that the docker-compose maintainers have said they
would merge shortly.

The pull request is:

    https://github.com/docker/compose/pull/1011

These templates are designed to work with the Icehouse or Juno
versions of Heat. If using Icehouse Heat, this [patch][] is
required to correct a bug with template validation when using the
"Fn::Join" function).

[heat]: https://wiki.openstack.org/wiki/Heat
[kolla]: https://launchpad.net/kolla
[binary]: https://docs.docker.com/installation/binaries/
[copr]: https://copr.fedoraproject.org/
[spec]: https://review.openstack.org/#/c/153798/
[super privileged containers]: http://sdake.io/2015/01/28/an-atomic-upgrade-process-for-openstack-compute-nodes/
[patch]: https://review.openstack.org/#/c/121139/

Create the Glance Image
=======================

After cloning the project, run the get-image.sh script from the project's
devenv directory:

    $ ./get-image.sh

The script will create a Fedora 21 image with the required modifications.

Add the image to your Glance image store:

    $ glance image-create --name "fedora-21-x86_64" \
    --file /var/lib/libvirt/images/fedora-21-x86_64 \
    --disk-format qcow2 --container-format bare \
    --is-public True --progress

Create the Stack
================

Copy local.yaml.example to local.yaml and edit the contents to match
your deployment environment. Here is an example of a customized
local.yaml:

    parameters:
      ssh_key_name: admin-key
      external_network_id: 028d70dd-67b8-4901-8bdd-0c62b06cce2d
      container_external_network_id: 028d70dd-67b8-4901-8bdd-0c62b06cce2d
      container_external_subnet_id: 575770dd-6828-1101-34dd-0c62b06fjf8s
      dns_nameserver: 192.168.200.1

The external_network_id is used by Heat to automatically assign
floating IP's to your Kolla nodes. You can then access your Kolla nodes
directly using the floating IP. The network ID is derived from the
`neutron net-list` command.

The container_external_network_id is used by the nova-network container
within the Kolla node as the FLAT_INTERFACE. The FLAT_INTERFACE tells Nova what
device to use (i.e. eth1) to pass network traffic between Nova instances
across Kolla nodes. This network should be seperate from the external_network_id
above and is derived from the 'neutron net-list' command.

The container_external_subnet_id: is the subnet equivalent to
container_external_network_id

Review the parameters section of kollacluster.yaml for a full list of
configuration options. **Note:** You must provide values for:

- `ssh_key_name`
- `external_network_id`
- `container_external_network_id`
- `container_external_subnet_id`

And then create the stack, referencing that environment file:

    $ heat stack-create -f kollacluster.yaml -e local.yaml kolla-cluster

Access the Kolla Nodes
======================

You can get the ip address of the Kolla nodes using the `heat
output-show` command:

    $ heat output-show kolla-cluster kolla_node_external_ip
    "192.168.200.86"

You can ssh into that server as the `fedora` user:

    $ ssh fedora@192.168.200.86

Once logged into your Kolla node, setup your environment.
The basic starting environment will be created using `docker-compose`.
This environment will start up the openstack services listed in the
compose directory.

To start, setup your environment variables.

    $ cd kolla
    $ ./tools/genenv

The `genenv` script will create a compose/openstack.env file
and an openrc file in your current directory. The openstack.env
file contains all of your initialized environment variables, which
you can edit for a different setup.

Next, run the start script.

    $ ./tools/start

The `start` script is responsible for starting the containers
using `docker-compose -f <osp-service-container> up -d`.

If you want to start a container set by hand use this template

    $ docker-compose -f glance-api-registry.yml up -d

Debugging
==========

All Docker commands should be run from the directory of the Docker binaray,
by default this is `/`.

A few commands for debugging the system.

```
$ sudo ./docker images
```
Lists all images that have been pulled from the upstream kollaglue repository
thus far.  This can be run on the node during the `./start` operation to
check on the download progress.

```
$ sudo ./docker ps -a
```
This will show all processes that docker has started.  Removing the `-a` will
show only active processes.  This can be run on the node during the `./start`
operation to check that the containers are orchestrated.

```
$ sudo ./docker logs <containerid>
```
```
$ curl http://<NODE_IP>:3306
```
You can use curl to test connectivity to a container. This example demonstrates
the Mariadb service is running on the node.  Output should appear as follows

```
$ curl http://10.0.0.4:3306
Trying 10.0.0.4...
Connected to 10.0.0.4.
Escape character is '^]'.

```


text: void push(const uint16_t registers);