text:
using System;

using NUnit.Framework;

using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Utilities.Encoders;
using Org.BouncyCastle.Utilities.Test;

namespace Org.BouncyCastle.Tests
{
	/**
	 * CMAC tester - AES Official Test Vectors.
	 */
	[TestFixture]
	public class CMacTest
		:	SimpleTest
	{
		private static readonly byte[] keyBytes128 = Hex.Decode("2b7e151628aed2a6abf7158809cf4f3c");
		private static readonly byte[] keyBytes192 = Hex.Decode(
			  "8e73b0f7da0e6452c810f32b809079e5"
			+ "62f8ead2522c6b7b");
		private static readonly byte[] keyBytes256 = Hex.Decode(
			  "603deb1015ca71be2b73aef0857d7781"
			+ "1f352c073b6108d72d9810a30914dff4");

		private static readonly byte[] input0 = Hex.Decode("");
		private static readonly byte[] input16 = Hex.Decode("6bc1bee22e409f96e93d7e117393172a");
		private static readonly byte[] input40 = Hex.Decode(
			  "6bc1bee22e409f96e93d7e117393172a"
			+ "ae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411");
		private static readonly byte[] input64 = Hex.Decode(
			  "6bc1bee22e409f96e93d7e117393172a"
			+ "ae2d8a571e03ac9c9eb76fac45af8e51"
			+ "30c81c46a35ce411e5fbc1191a0a52ef"
			+ "f69f2445df4f9b17ad2b417be66c3710");

		private static readonly byte[] output_k128_m0 = Hex.Decode("bb1d6929e95937287fa37d129b756746");
		private static readonly byte[] output_k128_m16 = Hex.Decode("070a16b46b4d4144f79bdd9dd04a287c");
		private static readonly byte[] output_k128_m40 = Hex.Decode("dfa66747de9ae63030ca32611497c827");
		private static readonly byte[] output_k128_m64 = Hex.Decode("51f0bebf7e3b9d92fc49741779363cfe");

		private static readonly byte[] output_k192_m0 = Hex.Decode("d17ddf46adaacde531cac483de7a9367");
		private static readonly byte[] output_k192_m16 = Hex.Decode("9e99a7bf31e710900662f65e617c5184");
		private static readonly byte[] output_k192_m40 = Hex.Decode("8a1de5be2eb31aad089a82e6ee908b0e");
		private static readonly byte[] output_k192_m64 = Hex.Decode("a1d5df0eed790f794d77589659f39a11");

		private static readonly byte[] output_k256_m0 = Hex.Decode("028962f61b7bf89efc6b551f4667d983");
		private static readonly byte[] output_k256_m16 = Hex.Decode("28a7023f452e8f82bd4bf28d8c37c35c");
		private static readonly byte[] output_k256_m40 = Hex.Decode("aaf3d8f1de5640c232f5b169b9c911e6");
		private static readonly byte[] output_k256_m64 = Hex.Decode("e1992190549f6ed5696a2c056c315410");

		private static readonly byte[] output_des_ede = Hex.Decode("1ca670dea381d37c");

		public CMacTest()
		{
		}

		public override void PerformTest()
		{
//			Mac mac = Mac.getInstance("AESCMAC", "BC");
			IMac mac = MacUtilities.GetMac("AESCMAC");

			//128 bytes key

//			SecretKeySpec key = new SecretKeySpec(keyBytes128, "AES");
			KeyParameter key = new KeyParameter(keyBytes128);

			// 0 bytes message - 128 bytes key
			mac.Init(key);

			mac.BlockUpdate(input0, 0, input0.Length);

			byte[] output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k128_m0))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k128_m0)
					+ " got " + Hex.ToHexString(output));
			}

			// 16 bytes message - 128 bytes key
			mac.Init(key);

			mac.BlockUpdate(input16, 0, input16.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k128_m16))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k128_m16)
					+ " got " + Hex.ToHexString(output));
			}

			// 40 bytes message - 128 bytes key
			mac.Init(key);

			mac.BlockUpdate(input40, 0, input40.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k128_m40))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k128_m40)
					+ " got " + Hex.ToHexString(output));
			}

			// 64 bytes message - 128 bytes key
			mac.Init(key);

			mac.BlockUpdate(input64, 0, input64.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k128_m64))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k128_m64)
					+ " got " + Hex.ToHexString(output));
			}

			//192 bytes key

//			key = new SecretKeySpec(keyBytes192, "AES");
			key = new KeyParameter(keyBytes192);

			// 0 bytes message - 192 bytes key
			mac.Init(key);

			mac.BlockUpdate(input0, 0, input0.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k192_m0))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k192_m0)
					+ " got " + Hex.ToHexString(output));
			}

			// 16 bytes message - 192 bytes key
			mac.Init(key);

			mac.BlockUpdate(input16, 0, input16.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k192_m16))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k192_m16)
					+ " got " + Hex.ToHexString(output));
			}

			// 40 bytes message - 192 bytes key
			mac.Init(key);

			mac.BlockUpdate(input40, 0, input40.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k192_m40))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k192_m40)
					+ " got " + Hex.ToHexString(output));
			}

			// 64 bytes message - 192 bytes key
			mac.Init(key);

			mac.BlockUpdate(input64, 0, input64.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k192_m64))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k192_m64)
					+ " got " + Hex.ToHexString(output));
			}

			//256 bytes key

//			key = new SecretKeySpec(keyBytes256, "AES");
			key = new KeyParameter(keyBytes256);

			// 0 bytes message - 256 bytes key
			mac.Init(key);

			mac.BlockUpdate(input0, 0, input0.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k256_m0))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k256_m0)
					+ " got " + Hex.ToHexString(output));
			}

			// 16 bytes message - 256 bytes key
			mac.Init(key);

			mac.BlockUpdate(input16, 0, input16.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k256_m16))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k256_m16)
					+ " got " + Hex.ToHexString(output));
			}

			// 40 bytes message - 256 bytes key
			mac.Init(key);

			mac.BlockUpdate(input40, 0, input40.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k256_m40))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k256_m40)
					+ " got " + Hex.ToHexString(output));
			}

			// 64 bytes message - 256 bytes key
			mac.Init(key);

			mac.BlockUpdate(input64, 0, input64.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_k256_m64))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_k256_m64)
					+ " got " + Hex.ToHexString(output));
			}

//			mac = Mac.getInstance("DESedeCMAC", "BC");
			mac = MacUtilities.GetMac("DESedeCMAC");

			//DESede

//			key = new SecretKeySpec(keyBytes128, "DESede");
			key = new KeyParameter(keyBytes128);

			// 0 bytes message - 128 bytes key
			mac.Init(key);

			mac.BlockUpdate(input0, 0, input0.Length);

			output = MacUtilities.DoFinal(mac);

			if (!AreEqual(output, output_des_ede))
			{
				Fail("Failed - expected " + Hex.ToHexString(output_des_ede)
					+ " got " + Hex.ToHexString(output));
			}
		}

		public override string Name
		{
			get { return "CMac"; }
		}

		public static void Main(string[] args)
		{
			RunTest(new CMacTest());
		}

		[Test]
		public void TestFunction()
		{
			string resultText = Perform().ToString();

			Assert.AreEqual(Name + ": Okay", resultText);
		}
	}
}


text:
package com.ligong.actionbartab;

import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity  {

    private View mCustomView;
    private static String[] titles = new String[]{"首页","订阅","黄石","娱乐","全运动","生活","科技","财经"};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mCustomView = getLayoutInflater().inflate(R.layout.action_bar_display_options_custom, null);
        ActionBar bar = getSupportActionBar();
        bar.setTitle("人民日报");
        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        bar.setCustomView(mCustomView);

        addTabItem(bar);

    }

    private void addTabItem(ActionBar bar) {
        bar.addTab(bar.newTab().setText("首页").setTabListener( new TabListener(getTabContentFragment(titles[0]))));
        bar.addTab(bar.newTab().setText("订阅").setTabListener(new TabListener(getTabContentFragment(titles[1]))));
        bar.addTab(bar.newTab().setText("黄石").setTabListener(new TabListener(getTabContentFragment(titles[2]))));
        bar.addTab(bar.newTab().setText("娱乐").setTabListener(new TabListener(getTabContentFragment(titles[3]))));
        bar.addTab(bar.newTab().setText("全运动").setTabListener(new TabListener(getTabContentFragment(titles[4]))));
        bar.addTab(bar.newTab().setText("生活").setTabListener(new TabListener(getTabContentFragment(titles[5]))));
        bar.addTab(bar.newTab().setText("科技").setTabListener(new TabListener(getTabContentFragment(titles[6]))));
        bar.addTab(bar.newTab().setText("财经").setTabListener(new TabListener(getTabContentFragment(titles[7]))));
    }

    //创建一个fragment并传入值
    private TabContentFragment getTabContentFragment(String s) {
        TabContentFragment fragment = new TabContentFragment();
        Bundle b = new Bundle();
        b.putString("content",s);
        fragment.setArguments(b);
        return fragment;
    }

    public void clickme(View view) {
        if (getSupportActionBar() != null && getSupportActionBar().isShowing()) {
            getSupportActionBar().hide();
        } else {
            getSupportActionBar().show();
        }
    }

    //选项卡点击事件
    public class TabListener implements ActionBar.TabListener {
        private TabContentFragment mFragment;

        public TabListener(TabContentFragment fragment) {
            mFragment = fragment;
        }

        @Override
        public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
            if (!mFragment.isAdded()) {
                ft.add(R.id.fragment_content, mFragment, titles[tab.getPosition()]);
            } else {
                ft.show(mFragment);
            }

        }

        @Override
        public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
            //ft.remove(mFragment);
            ft.hide(mFragment);
        }

        @Override
        public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
            Toast.makeText(MainActivity.this, "Reselected!", Toast.LENGTH_SHORT).show();
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * PHP version 7.3
 *
 * @category Value
 * @package  RetailCrm\Api\Model\Entity\Settings
 */

namespace RetailCrm\Api\Model\Entity\Settings;

use RetailCrm\Api\Component\Serializer\Annotation as JMS;

/**
 * Class WorkTime
 *
 * @category WorkTime
 * @package  RetailCrm\Api\Model\Entity\Settings
 */
class WorkTime
{
    /**
     * @var string
     *
     * @JMS\Type("string")
     * @JMS\SerializedName("day_type")
     */
    public $dayType;

    /**
     * @var string
     *
     * @JMS\Type("string")
     * @JMS\SerializedName("start_time")
     */
    public $startTime;

    /**
     * @var string
     *
     * @JMS\Type("string")
     * @JMS\SerializedName("end_time")
     */
    public $endTime;

    /**
     * @var string
     *
     * @JMS\Type("string")
     * @JMS\SerializedName("lunch_start_time")
     */
    public $lunchStartTime;

    /**
     * @var string
     *
     * @JMS\Type("string")
     * @JMS\SerializedName("lunch_end_time")
     */
    public $lunchEndTime;
}


text:
<title>CreateVertexPoseKeyFrame</title>

CreateVertexPoseKeyFrame()

Syntax

Result = CreateVertexPoseKeyFrame(#Mesh, Animation$, Track, Time)

Description

Creates a new keyframe in the vertex animation. The animation should be already be created
with CreateVertexAnimation(), or be predefined in the mesh.

Parameters

#Mesh

The mesh to use.

Animation$

The animation name. This name is case-sensitive. The animation should be already be created
with CreateVertexAnimation().

Track

The track index. The track has to be previously created with CreateVertexTrack().

Time

The time in the animation to set the keyframe (in milliseconds). This value has to be between zero and the 'Length'
defined in CreateVertexAnimation().

Return value

Returns the new keyframe index.

See Also

CreateVertexAnimation(), CreateVertexTrack()

Supported OS
All

<- CreateVertexAnimation() - VertexAnimation Index - CreateVertexTrack() ->


text:
module JumpCloud
  ##
  ## Error class for network based errors
  ##
  class NetError < StandardError
  end
end


text:
import def from "./def.ts";
import prep from "./prep.ts";
import make from "./make.ts";
import mount from "./mount.ts";
import unmount from "./unmount.ts";
import get from "./get.ts";
import { addMountHook } from "./add_hidden_item.ts";
import {
  component,
  emits,
  innerHTML,
  is,
  on,
  pub,
  sub,
  wired,
} from "./decorators/index.ts";
import check from "./util/check.ts";
import __registry__ from "./registry.ts";

interface CapsidModule {
  // deno-lint-ignore ban-types
  install: Function;
}

/**
 * Installs the capsid module or plugin.
 *
 * @param capsidModule
 * @param options
 */
// deno-lint-ignore ban-types
const install = (capsidModule: CapsidModule, options?: object) => {
  check(
    typeof capsidModule.install === "function",
    "The given capsid module does not have `install` method. Please check the install call.",
  );

  capsidModule.install({
    def,
    prep,
    make,
    mount,
    unmount,
    get,
    install,
    addMountHook,
    component,
    emits,
    innerHTML,
    is,
    on,
    pub,
    sub,
    wired,
    __registry__,
  }, options || {});
};

export default install;


text:
@interface RosterController : NSWindowController <RosterDelegate, XMPPPresenceDisplay> {
	unsigned char presence;
	XMPPRoster * roster;
	XMPPAccount * account;
	__unsafe_unretained IBOutlet NSOutlineView * view;
	__unsafe_unretained IBOutlet NSTableColumn * avatarColumn;
	__unsafe_unretained IBOutlet NSTableColumn * column;
	__unsafe_unretained IBOutlet NSPopUpButton * presenceBox;
	__unsafe_unretained IBOutlet NSTextField * statusBox;
}
- (id) initWithNibName:(NSString*)_nib forAccount:(id)_account withRoster:(id)_roster;
- (void) updatePresence:(NSNotification*)_notification;
- (IBAction) click:(id)sender;
- (IBAction) changePresence:(id)sender;
- (IBAction) remove:(id)sender;
- (NSString*) currentStatusMessage;
@end


text:
package org.hisp.dhis.android.sdk.persistence.models.flow;

import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.ForeignKey;
import com.raizlabs.android.dbflow.annotation.ForeignKeyAction;
import com.raizlabs.android.dbflow.annotation.ForeignKeyReference;
import com.raizlabs.android.dbflow.annotation.Table;

import org.hisp.dhis.android.sdk.persistence.models.common.meta.DbDhis;
import org.hisp.dhis.android.sdk.models.dataset.DataSet;

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

@Table(databaseName = DbDhis.NAME)
public final class DataSet$Flow extends BaseIdentifiableObject$Flow {
    private static final String CATEGORY_COMBO_KEY = "categoryComboKey";

    @Column
    int version;

    @Column
    int expiryDays;

    @Column
    boolean allowFuturePeriods;

    @Column
    String periodType;

    @Column
    @ForeignKey(
            references = {
                    @ForeignKeyReference(columnName = CATEGORY_COMBO_KEY, columnType = String.class, foreignColumnName = "uId")
            }, saveForeignKeyModel = false, onDelete = ForeignKeyAction.CASCADE
    )
    CategoryCombo$Flow categoryCombo;

    public DataSet$Flow() {
    }

    public CategoryCombo$Flow getCategoryCombo() {
        return categoryCombo;
    }

    public void setCategoryCombo(CategoryCombo$Flow categoryCombo) {
        this.categoryCombo = categoryCombo;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public int getExpiryDays() {
        return expiryDays;
    }

    public void setExpiryDays(int expiryDays) {
        this.expiryDays = expiryDays;
    }

    public boolean isAllowFuturePeriods() {
        return allowFuturePeriods;
    }

    public void setAllowFuturePeriods(boolean allowFuturePeriods) {
        this.allowFuturePeriods = allowFuturePeriods;
    }

    public String getPeriodType() {
        return periodType;
    }

    public void setPeriodType(String periodType) {
        this.periodType = periodType;
    }

    public static DataSet$Flow fromModel(DataSet dataSet) {
        if (dataSet == null) {
            return null;
        }

        DataSet$Flow dataSetFlow = fromModel(dataSet);
        dataSetFlow.setVersion(dataSet.getVersion());
        dataSetFlow.setExpiryDays(dataSet.getExpiryDays());
        dataSetFlow.setAllowFuturePeriods(dataSet.isAllowFuturePeriods());
        dataSetFlow.setPeriodType(dataSet.getPeriodType());

        dataSetFlow.setCategoryCombo(null);

        return dataSetFlow;
    }

    public static DataSet toModel(DataSet$Flow dataSetFlow) {
        if (dataSetFlow == null) {
            return null;
        }

        DataSet dataSet = toModel(dataSetFlow);
        dataSet.setVersion(dataSetFlow.getVersion());
        dataSet.setExpiryDays(dataSetFlow.getExpiryDays());
        dataSet.setAllowFuturePeriods(dataSetFlow.isAllowFuturePeriods());
        dataSet.setPeriodType(dataSetFlow.getPeriodType());

        dataSet.setCategoryCombo(null);

        return dataSet;
    }

    public static List<DataSet> toModels(List<DataSet$Flow> dataSetFlows) {
        List<DataSet> dataSets = new ArrayList<>();

        if (dataSetFlows != null && !dataSetFlows.isEmpty()) {
            for (DataSet$Flow dataSetFlow : dataSetFlows) {
                dataSets.add(toModel(dataSetFlow));
            }
        }

        return dataSets;
    }

    public static List<DataSet$Flow> fromModels(List<DataSet> dataSets) {
        List<DataSet$Flow> dataSetFlows = new ArrayList<>();

        if (dataSets != null && !dataSets.isEmpty()) {
            for (DataSet dataSet : dataSets) {
                dataSetFlows.add(fromModel(dataSet));
            }
        }

        return dataSetFlows;
    }
}


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

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

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

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.jackrabbit</groupId>
        <artifactId>oak-parent</artifactId>
        <version>1.1.1</version>
    </parent>

    <groupId>com.github.tteofili</groupId>
    <artifactId>flexible-search-oak</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <name>oak search demo code</name>
    <description>Demo code for "Flexible search in Apache Jackrabbit Oak" talk</description>
    <packaging>bundle</packaging>

    <properties>
        <lucene.version>4.10.2</lucene.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Export-Package>
                            !*
                        </Export-Package>
                        <Import-Package>
                            com.sun.jna.*;resolution:=optional,
                            com.vividsolutions.jts.*;resolution:=optional,
                            groovy.lang.*;resolution:=optional,
                            groovy.util.*;resolution:=optional,
                            org.antlr.runtime.*;resolution:=optional,
                            org.apache.regexp.*;resolution:=optional,
                            org.apache.tomcat.jni.*;resolution:=optional,
                            org.bouncycastle.*;resolution:=optional,
                            org.codehaus.groovy.*;resolution:=optional,
                            org.eclipse.jetty.*;resolution:=optional,
                            org.hyperic.*;resolution:=optional,
                            org.jboss.*;resolution:=optional,
                            org.objectweb.*;resolution:=optional,
                            sun.*;resolution:=optional,
                            *
                        </Import-Package>
                        <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- TEST -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-core</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-commons</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>1.4.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <version>${lucene.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-common</artifactId>
            <version>${lucene.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queryparser</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queries</artifactId>
            <version>${lucene.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-misc</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-highlighter</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-sandbox</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-grouping</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-join</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-suggest</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-spatial</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-expressions</artifactId>
            <version>${lucene.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-classification</artifactId>
            <version>${lucene.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>2.6.1</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.spatial4j</groupId>
            <artifactId>spatial4j</artifactId>
            <version>0.4.1</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.opennlp</groupId>
            <artifactId>nlp-utils</artifactId>
            <version>0.1-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>biz.aQute.bnd</groupId>
            <artifactId>bndlib</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>

</project>


text:
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router'
import {RatingDemo} from './ratingdemo';

@NgModule({
	imports: [
		RouterModule.forChild([
			{path:'',component: RatingDemo}
		])
	],
	exports: [
		RouterModule
	]
})
export class RatingDemoRoutingModule {}


text:
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
import Prelude hiding (reverse, zip)
import qualified Prelude as P

import Control.Monad
import Control.Monad.Identity (Identity(..), runIdentity)

import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.FAlgebra.Tree.Splay
import Data.Proxy

import System.CPUTime
import System.Random

import Lens.Micro

-- Expand a functor to incorporate a bit indicating whether the structure
-- should be reversed when traversing it.
data RevF f a = RevF !Bool (f a) deriving (Eq, Show, Ord, Functor)

newtype RevM a = RevM { runRevM :: a -> a }

reverse :: Structured RevM a => a -> a
reverse = runRevM struct

instance IsoRespecting RevM where
    liftIso (Iso to from) = Iso revTo revFrom
        where
        revTo (RevM r) = RevM (to . r . from)
        revFrom (RevM r) = RevM (from . r . to)

instance Preserving RevM (TreeF a) where
    trans (RevM r) = RevM $ \t -> case t of
        Empty -> Empty
        Branch a b1 b2 -> Branch a (r b2) (r b1)

instance (Structured RevM a, Preserving RevM f) => Preserving RevM (AnnF a f) where
    trans rev = RevM $ \(AnnF a xs) ->
        AnnF (reverse a) (runRevM (trans rev) xs)

instance Structured RevM (RevF f a) where
    struct = RevM $ \(RevF r xs) -> RevF (not r) xs

-- RevF "captures" the reverse operation
instance Preserving RevM (RevF f) where
    trans (RevM _) = RevM reverse

instance Natural f f' => Natural f (RevF f') where
    nat = RevF False . nat

instance RestrictedNatural s f f' => RestrictedNatural s f (RevF f') where
    rnat s = RevF False . rnat s

-- For size annotations, reversing does not change their value.
instance Structured RevM Size where
    struct = RevM id

-- Type of the trees we use to do efficient reversing
type RevSizeTreeF a = AnnF Size (RevF (TreeF a))
type RevSizeTree a = Fix (RevSizeTreeF a)

-- The type equality constraint here allows GHC to infer more types
-- at the cost of expressiveness that we don't need here.
instance (a ~ a') => FAlgebra (TreeF a) (RevSizeTree a') where
    alg = algRNat (Proxy :: Proxy (AnnM Size))

instance (a ~ a') => FCoalgebra (TreeF a) (RevSizeTree a') where
    coalg = coalgRNat (Proxy :: Proxy RevM)

instance (Preserving RevM f', RestrictedConatural RevM f f') => RestrictedConatural RevM f (RevF f') where
    rconat rev (RevF False as) = rconat rev as
    rconat rev (RevF True as) = rconat rev $ runRevM (trans rev) as

-- Allows us to use our general reverse on lists
instance Structured RevM [a] where
    struct = RevM P.reverse

-- Naive implementation of range reversals with list
-- Reverses the range [l, r) assuming l <= r
listReverseRange :: Int -> Int -> [a] -> [a]
listReverseRange l r as = as1 ++ reverse as2 ++ as3
    where
    as1 = take l as
    as2 = drop l (take r as)
    as3 = drop r as

treeReverseRange :: Int -> Int -> RevSizeTree a -> RevSizeTree a
treeReverseRange l r = zip . over _here reverse . isolateInterval l r

treeFromList :: forall a t. (FAlgebra (TreeF a) t, FCoalgebra (TreeF a) t, Structured (AnnM Size) t) => [a] -> t
treeFromList = foldr (insertAt 0) e
    where
    e = alg (Empty :: TreeF a t)

treeToList :: FCoalgebra (TreeF a) t => t -> [a]
treeToList t = case coalg t of
    Empty -> []
    Branch a b1 b2 -> treeToList b1 ++ [a] ++ treeToList b2

data TestCase = TestCase
    { size :: Int
    , reversals :: [(Int, Int)]
    } deriving (Eq, Show)

runTestCase :: (Int -> a) -> (Int -> Int -> a -> a) -> TestCase -> a
runTestCase init revRange (TestCase { size = s, reversals = revs }) = go (init s) revs
    where
    go = foldl (flip (uncurry revRange))

listRunTestCase = runTestCase (\n -> [0..(n-1)]) listReverseRange
treeRunTestCase = runTestCase (\n -> treeFromList [0..(n-1)]) treeReverseRange

sampleTestCase :: TestCase
sampleTestCase = TestCase
    { size = 10
    , reversals =
        [ (1, 5)
        , (5, 10)
        , (0, 10)
        ]
    }

randomIntervalIO :: Int -> IO (Int, Int)
randomIntervalIO size = do
    i <- randomRIO (0, size)
    j <- randomRIO (0, size)
    if i < j
        then return (i, j)
        else return (j, i)

randomTestCase :: Int -> Int -> IO TestCase
randomTestCase size nrevs = do
    revs <- replicateM nrevs (randomIntervalIO size)
    return TestCase
        { size = size
        , reversals = revs
        }

asSeconds :: Integer -> Double
asSeconds p = fromInteger p / 10^12

runComparison :: Int -> Int -> IO ()
runComparison size nrevs = do
    putStrLn $ show size ++ " " ++ show nrevs
    testcase <- randomTestCase size nrevs
    -- print testcase
    listStart <- getCPUTime
    let listResult = listRunTestCase testcase
    -- Force entire list
    -- print listResult
    length listResult `seq` return ()
    listEnd <- getCPUTime
    print . asSeconds $ listEnd - listStart
    treeStart <- getCPUTime
    let treeResult = treeToList (treeRunTestCase testcase)
    -- print treeResult
    length treeResult `seq` return ()
    treeEnd <- getCPUTime
    print . asSeconds $ treeEnd - treeStart
    print $ listResult == treeResult

data Command
    = Set Int Bool
    | Get Int
    | Reverse Int Int
    deriving (Eq, Show, Ord)

readCommand :: ByteString -> Maybe Command
readCommand dat = case B.split ' ' dat of
    ["S", idx, val] -> do
        (idx', _) <- B.readInt idx
        let val' = val == "1"
        pure $ Set idx' val'
    ["G", idx] -> do
        (idx', _) <- B.readInt idx
        pure $ Get idx'
    ["R", idx1, idx2] -> do
        (idx1', _) <- B.readInt idx1
        (idx2', _) <- B.readInt idx2
        pure $ Reverse idx1' idx2'
    _ -> Nothing

runCommands :: Int -> [Command] -> [ByteString]
runCommands n comms = go (treeFromList (replicate n False)) comms []
    where
    go :: RevSizeTree Bool -> [Command] -> [ByteString] -> [ByteString]
    go tree comms acc = case comms of
        [] -> reverse acc
        c:cs -> case c of
            Set idx val ->
                let tree' = setIndex idx val tree
                in
                tree' `seq` go tree' cs acc
            Get idx ->
                let (Just v, tree') = getIndex idx tree
                in
                tree' `seq` go tree' cs ((if v then "1" else "0"):acc)
            Reverse idx1 idx2 ->
                let tree' = treeReverseRange idx1 idx2 tree
                in
                tree' `seq` go tree' cs acc

main :: IO ()
main = do
    lines <- B.lines <$> B.readFile "range_reverse.in"
    case lines of
        line1:commandLines -> do
            case traverse readCommand commandLines of
                Just commands -> do
                    case B.readInt line1 of
                        Just (n, _) -> do
                            let outLines = runCommands n commands
                            B.writeFile "range_reverse.out" . B.unlines $ outLines
                        Nothing -> do
                            putStrLn "Error reading input file"
                Nothing -> do
                    putStrLn "Error reading input file"
        _ -> do
            putStrLn "Malformed input"


text:
package org.jvnet.jaxb2_commons.plugin.jaxbindex;

import org.jvnet.jaxb2_commons.util.CodeModelUtils;
import org.xml.sax.ErrorHandler;

import com.sun.codemodel.fmt.JTextFile;
import com.sun.tools.xjc.Options;
import com.sun.tools.xjc.outline.ClassOutline;
import com.sun.tools.xjc.outline.Outline;
import com.sun.tools.xjc.outline.PackageOutline;

public class JaxbIndexPlugin extends com.sun.tools.xjc.Plugin {

	public String getOptionName() {
		return "Xjaxbindex";
	}

	public String getUsage() {
		return "-Xjaxbindex:	generate per-package jaxb.index file";
	}

	@Override
	public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {

		for (final PackageOutline packageOutline : outline
				.getAllPackageContexts()) {
			final StringBuilder sb = new StringBuilder();
			for (final ClassOutline classOutline : packageOutline.getClasses()) {
				sb.append(CodeModelUtils.getLocalClassName(classOutline.ref));
				sb.append("\n");
			}

			final JTextFile indexFile = new JTextFile("jaxb.index");
			indexFile.setContents(sb.toString());
			packageOutline._package().addResourceFile(indexFile);
		}
		return true;
	}
}


text:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <osl/extensions/textual.h>
#include <osl/extensions/comment.h>
#include <osl/extensions/null.h>
#include <osl/extensions/scatnames.h>
#include <osl/extensions/arrays.h>
#include <osl/extensions/coordinates.h>
#include <osl/extensions/clay.h>
#include <osl/extensions/dependence.h>
#include <osl/extensions/symbols.h>
#include <osl/extensions/irregular.h>
#include <osl/extensions/extbody.h>
#include <osl/extensions/loop.h>
#include <osl/extensions/pluto_unroll.h>
#include <osl/strings.h>
#include <osl/body.h>
#include <osl/relation.h>
#include <osl/interface.h>

/*+***************************************************************************
 *                          Structure display function                       *
 *****************************************************************************/

/**
 * osl_interface_idump function:
 * this function displays an osl_interface_t structure (*interface) into
 * a file (file, possibly stdout) in a way that trends to be understandable.
 * It includes an indentation level (level) in order to work with others
 * idump functions.
 * \param file      The file where the information has to be printed.
 * \param interface The interface structure which has to be printed.
 * \param level     Number of spaces before printing, for each line.
 */
void osl_interface_idump(FILE * file, osl_interface_p interface, int level) {
  int j, first = 1;

  // Go to the right level.
  for (j = 0; j < level; j++)
    fprintf(file, "|\t");

  if (interface != NULL)
    fprintf(file, "+-- osl_interface_t: URI = %s\n", interface->URI);
  else
    fprintf(file, "+-- NULL interface\n");

  while (interface != NULL) {
    if (!first) {
      // Go to the right level.
      for (j = 0; j < level; j++)
        fprintf(file, "|\t");

      if (interface->URI != NULL)
        fprintf(file, "|   osl_interface_t: URI = %s\n", interface->URI);
      else
        fprintf(file, "|   osl_interface_t: URI = (NULL)\n");
    }
    else
      first = 0;

    interface = interface->next;

    // Next line.
    if (interface != NULL) {
      for (j = 0; j <= level + 1; j++)
        fprintf(file, "|\t");
      fprintf(file, "\n");
      for (j = 0; j <= level; j++)
        fprintf(file, "|\t");
      fprintf(file, "V\n");
    }
  }

  // The last line.
  for (j = 0; j <= level; j++)
    fprintf(file, "|\t");
  fprintf(file, "\n");
}

/**
 * osl_interface_dump function:
 * this function prints the content of a osl_interface_t structure
 * (*interface) into a file (file, possibly stdout).
 * \param file      File where informations are printed.
 * \param interface The interface structure to print.
 */
void osl_interface_dump(FILE * file, osl_interface_p interface) {
  osl_interface_idump(file, interface, 0);
}

/*****************************************************************************
 *                               Reading function                            *
 *****************************************************************************/

/*+***************************************************************************
 *                    Memory allocation/deallocation function                *
 *****************************************************************************/

/**
 * osl_interface_add function:
 * this function adds an interface node (it may be a list as well) to a
 * list of interfaces provided as parameter (list). The new node
 * is inserted at the end of the list.
 * \param list      The list of interfaces to add a node (NULL if empty).
 * \param interface The interface to add to the list.
 */
void osl_interface_add(osl_interface_p * list, osl_interface_p interface) {
  osl_interface_p tmp = *list, check_interface;

  if (interface != NULL) {
    // First, check that the interface list is OK.
    check_interface = interface;
    while (check_interface != NULL) {
      if (check_interface->URI == NULL)
        OSL_error("no URI in an interface to add to a list");

      if (osl_interface_lookup(*list, check_interface->URI) != NULL)
        OSL_error("only one interface with a given URI is allowed");
      check_interface = check_interface->next;
    }

    if (*list != NULL) {
      while (tmp->next != NULL)
        tmp = tmp->next;
      tmp->next = interface;
    }
    else {
      *list = interface;
    }
  }
}

/**
 * osl_interface_malloc function:
 * This function allocates the memory space for a osl_interface_t
 * structure and sets its fields with default values. Then it returns a
 * pointer to the allocated space.
 * \return A pointer to an empty interface structure with fields set to
 *         default values.
 */
osl_interface_p osl_interface_malloc() {
  osl_interface_p interface;

  OSL_malloc(interface, osl_interface_p,
                  sizeof(osl_interface_t));
  interface->URI    = NULL;
  interface->idump  = NULL;
  interface->sprint = NULL;
  interface->sread  = NULL;
  interface->malloc = NULL;
  interface->free   = NULL;
  interface->clone  = NULL;
  interface->equal  = NULL;
  interface->next   = NULL;

  return interface;
}

/**
 * osl_interface_free function:
 * this function frees the allocated memory for an osl_interface_t
 * structure, and all the interfaces stored in the list.
 * \param[in] interface The pointer to the interface we want to free.
 */
void osl_interface_free(osl_interface_p interface) {
  osl_interface_p tmp;
  int i = 0;

  while (interface != NULL) {
    tmp = interface->next;
    if (interface->URI != NULL)
      free(interface->URI);
    free(interface);
    interface = tmp;
    i++;
  }
}

/*+***************************************************************************
 *                            Processing functions                           *
 *****************************************************************************/

/**
 * osl_interface_number function:
 * this function returns the number of statements in the interface list
 * provided as parameter.
 * \param[in] interface The first element of the interface list.
 * \return The number of statements in the interface list.
 */
int osl_interface_number(osl_interface_p interface) {
  int number = 0;

  while (interface != NULL) {
    number++;
    interface = interface->next;
  }
  return number;
}

/**
 * osl_interface_nclone function:
 * This function builds and returns a "hard copy" (not a pointer copy) of the
 * n first elements of an osl_interface_t list.
 * \param interface The pointer to the interface structure we want to clone.
 * \param n         The number of nodes we want to copy (-1 for infinity).
 * \return The clone of the n first nodes of the interface list.
 */
osl_interface_p osl_interface_nclone(osl_interface_p interface, int n) {
  osl_interface_p clone = NULL, new;
  int i = 0;

  while ((interface != NULL) && ((n == -1) || (i < n))) {
    new = osl_interface_malloc();
    OSL_strdup(new->URI, interface->URI);
    new->idump  = interface->idump;
    new->sprint = interface->sprint;
    new->sread  = interface->sread;
    new->malloc = interface->malloc;
    new->free   = interface->free;
    new->clone  = interface->clone;
    new->equal  = interface->equal;

    osl_interface_add(&clone, new);
    interface = interface->next;
    i++;
  }

  return clone;
}

/**
 * osl_interface_clone function:
 * This function builds and returns a "hard copy" (not a pointer copy) of an
 * osl_interface_t data structure.
 * \param interface The pointer to the interface structure we want to copy.
 * \return A pointer to the copy of the interface structure.
 */
osl_interface_p osl_interface_clone(osl_interface_p interface) {

  return osl_interface_nclone(interface, -1);
}

/**
 * osl_interface_equal function:
 * this function returns true if the two interface structures are the same,
 * (content-wise) false otherwise.
 * \param interface1 The first interface structure.
 * \param interface2 The second interface structure.
 * \return 1 if interface1 and interface2 are the same, 0 otherwise.
 */
int osl_interface_equal(osl_interface_p interface1,
                        osl_interface_p interface2) {

  if (interface1 == interface2)
    return 1;

  if (((interface1 == NULL) && (interface2 != NULL)) ||
      ((interface1 != NULL) && (interface2 == NULL)))
    return 0;

  if (strcmp(interface1->URI, interface2->URI)   ||
      (interface1->idump  != interface2->idump)  ||
      (interface1->sprint != interface2->sprint) ||
      (interface1->sread  != interface2->sread)  ||
      (interface1->malloc != interface2->malloc) ||
      (interface1->free   != interface2->free)   ||
      (interface1->clone  != interface2->clone)  ||
      (interface1->equal  != interface2->equal))
    return 0;

  return 1;
}

/**
 * osl_interface_lookup function:
 * this function returns the first interface with a given URI in the
 * interface list provided as parameter and NULL if it doesn't find such
 * an interface.
 * \param list The interface list where to search a given interface URI.
 * \param URI  The URI of the interface we are looking for.
 * \return The first interface of the requested URI in the list.
 */
osl_interface_p
osl_interface_lookup(osl_interface_p list, char * URI) {

  if (URI == NULL) {
    OSL_warning("lookup for a NULL URI");
  }
  else {
    while (list != NULL) {
      if ((list->URI != NULL) && (!strcmp(list->URI, URI)))
        return list;

      list = list->next;
    }
  }

  return NULL;
}

/**
 * osl_interface_get_default_registry function:
 * this function creates the list of known interfaces (of all generic types,
 * including extensions) and returns it.
 * \return The list of known interfaces.
 */
osl_interface_p osl_interface_get_default_registry() {
  osl_interface_p registry = NULL;

  // Internal generics
  osl_interface_add(&registry, osl_strings_interface());
  osl_interface_add(&registry, osl_body_interface());
  osl_interface_add(&registry, osl_relation_interface());

  // Extensions
  osl_interface_add(&registry, osl_textual_interface());
  osl_interface_add(&registry, osl_comment_interface());
  osl_interface_add(&registry, osl_null_interface());
  osl_interface_add(&registry, osl_scatnames_interface());
  osl_interface_add(&registry, osl_arrays_interface());
  osl_interface_add(&registry, osl_coordinates_interface());
  osl_interface_add(&registry, osl_clay_interface());
  osl_interface_add(&registry, osl_dependence_interface());
  osl_interface_add(&registry, osl_symbols_interface());
  osl_interface_add(&registry, osl_extbody_interface());
  osl_interface_add(&registry, osl_loop_interface());
  osl_interface_add(&registry, osl_pluto_unroll_interface());
  //osl_interface_add(&registry, osl_irregular_interface());

  return registry;
}


text:
module Language.Haskell.Liquid.Types.Specifications (specAnchor) where

-- | Gross hack, to force dependency and loading of module.
specAnchor :: Int
specAnchor = 7


text:
using System.Collections.Generic;
using Paratext.Data;

namespace HearThis.Script
{
	/// <summary>
	/// This exposes the things we care about out of ScrParserState, providing an
	/// anti-corruption layer between Paratext and HearThis and allowing us to test the code
	/// that calls Paratext.
	/// </summary>
	public interface IScrParserState
	{
		void UpdateState(List<UsfmToken> tokenList, int tokenIndex);
		ScrTag NoteTag { get; }
		ScrTag CharTag { get; }
		ScrTag ParaTag { get; }
		bool ParaStart { get; }
		/// <summary>
		/// The implementation of this property should ensure that figures are not considered "publishable" because in an audio recording they aren't.
		/// </summary>
		bool IsPublishable { get; }
	}
}


text:
// Copyright (c) MOSA Project. Licensed under the New BSD License.

namespace System.Reflection
{
	/// <summary>
	/// Property Attributes.
	/// </summary>
	[Flags]
	public enum PropertyAttributes : ushort
	{
		/// <summary>
		/// Property is special. Name describes how.
		/// </summary>
		SpecialName = 0x0200,

		/// <summary>
		/// Runtime(metadata internal APIs) should check name encoding.
		/// </summary>
		RTSpecialName = 0x0400,

		/// <summary>
		/// Property has default
		/// </summary>
		HasDefault = 0x1000,
	}
}


text:
xml_parser
==========

gem for parsing xml into db.

```
$> gem build xml_parser.gemspec
  Successfully built RubyGem
  Name: xml_parser
  Version: 0.0.0
  File: xml_parser-0.0.0.gem

$> gem install xml_parser-0.0.0.gem
  Successfully installed xml_parser-0.0.0
  1 gem installed

$> irb
  2.0.0-p247 :001 > require 'xml_parser'
  => true
```


text:
import React from 'react';
import { shallow } from 'enzyme';
import 'materialize-css/dist/js/materialize';
import LandingPage from '../../components/auth/LandingPage';

const enzymeWrapper = shallow(
  <LandingPage />
);

const wrapperInstance = enzymeWrapper.instance();

describe('Given the landing page is mounted', () => {
  it('should render component and sub-components', () => {
    expect(enzymeWrapper.exists()).toBe(true);
    expect(enzymeWrapper.find('#signin-form').exists()).toBe(true);
    expect(enzymeWrapper.find('#signup-form').exists()).toBe(true);
  });

  it('should have an initial state with property forgot as false', () => {
    expect(enzymeWrapper.state('forgot')).toEqual(false);
  });

  it('should not render ForgotPassword if state.forgot is false', () => {
    expect(enzymeWrapper.find('.forgot-password').exists()).toEqual(false);
  });

  it('should set state.forgot to true when forgotPassword is called', () => {
    wrapperInstance.forgotPassword();
    expect(enzymeWrapper.state('forgot')).toEqual(true);
  });

  it('should render ForgotPassword page when forgotPassword is called', () => {
    wrapperInstance.forgotPassword();
    expect(enzymeWrapper.find('.forgot-password').exists()).toBe(true);
    expect(enzymeWrapper.find('#signin-form').exists()).toBe(false);
    expect(enzymeWrapper.find('#signup-form').exists()).toBe(false);
  });

  it('should set state.forgot to false when revertForgotPassword is called',
    () => {
      wrapperInstance.revertForgotPassword();
      expect(enzymeWrapper.state('forgot')).toEqual(false);
    });
});


text:
import oslo_utils

class FakeCeilometerMetrics(object):
    NAME = 'ceilometer'

    def __init__(self):
        self.emptytype = ""

    def empty_one_metric(self, emptytype):
        self.emptytype = emptytype

    def mock_get_statistics(self, resource=None, resource_type=None,
                            meter_name=None, period=None, aggregate='mean',
                            granularity=None):
        result = 0
        if meter_name == 'host_cpu_usage':
            result = self.get_usage_compute_node_cpu(resource)
        elif meter_name == 'host_ram_usage':
            result = self.get_usage_compute_node_ram(resource)
        elif meter_name == 'host_outlet_temp':
            result = self.get_average_outlet_temp(resource)
        elif meter_name == 'host_inlet_temp':
            result = self.get_average_inlet_temp(resource)
        elif meter_name == 'host_airflow':
            result = self.get_average_airflow(resource)
        elif meter_name == 'host_power':
            result = self.get_average_power(resource)
        elif meter_name == 'instance_cpu_usage':
            result = self.get_average_usage_instance_cpu(resource)
        elif meter_name == 'instance_ram_usage':
            result = self.get_average_usage_instance_memory(resource)
        return result

    def mock_get_statistics_nn(self, resource=None, meter_name=None,
                               period=None, aggregate='mean', granularity=300):
        """Statistics for noisy neighbor strategy

        Signature should match DataSourceBase.get_instance_l3_cache_usage
        """

        result = 0.0
        if period == 100:
            result = self.get_average_l3_cache_current(resource)
        if period == 200:
            result = self.get_average_l3_cache_previous(resource)
        return result

    def mock_get_statistics_wb(self, resource=None, resource_type=None,
                               meter_name=None, period=None, aggregate='mean',
                               granularity=None):
        """Statistics for workload balance strategy"""

        result = 0.0
        if meter_name == 'instance_cpu_usage':
            result = self.get_average_usage_instance_cpu_wb(resource)
        elif meter_name == 'instance_ram_usage':
            result = self.get_average_usage_instance_memory_wb(resource)
        return result

    @staticmethod
    def get_average_l3_cache_current(resource):
        """The average l3 cache used by instance"""

        uuid = resource.uuid

        mock = {}
        mock['73b09e16-35b7-4922-804e-e8f5d9b740fc'] = 35 * oslo_utils.units.Ki
        mock['cae81432-1631-4d4e-b29c-6f3acdcde906'] = 30 * oslo_utils.units.Ki
        mock['INSTANCE_3'] = 40 * oslo_utils.units.Ki
        mock['INSTANCE_4'] = 35 * oslo_utils.units.Ki

        return mock[str(uuid)]

    @staticmethod
    def get_average_l3_cache_previous(resource):
        """The average l3 cache used by instance"""

        uuid = resource.uuid

        mock = {}
        mock['73b09e16-35b7-4922-804e-e8f5d9b740fc'] = 34.5 * (
            oslo_utils.units.Ki)
        mock['cae81432-1631-4d4e-b29c-6f3acdcde906'] = 30.5 * (
            oslo_utils.units.Ki)
        mock['INSTANCE_3'] = 60 * oslo_utils.units.Ki
        mock['INSTANCE_4'] = 22.5 * oslo_utils.units.Ki

        return mock[str(uuid)]

    @staticmethod
    def get_average_outlet_temp(resource):
        """The average outlet temperature for host"""

        uuid = resource.uuid
        mock = {}
        mock["fa69c544-906b-4a6a-a9c6-c1f7a8078c73"] = 30
        # use a big value to make sure it exceeds threshold
        mock["af69c544-906b-4a6a-a9c6-c1f7a8078c73"] = 100
        if uuid not in mock.keys():
            mock[uuid] = 100
        return float(mock[str(uuid)])

    @staticmethod
    def get_usage_compute_node_ram(resource):

        uuid = resource.uuid
        mock = {}
        # Ceilometer returns hardware.memory.used samples in KB.
        mock['Node_0'] = 7 * oslo_utils.units.Ki
        mock['Node_1'] = 5 * oslo_utils.units.Ki
        mock['Node_2'] = 29 * oslo_utils.units.Ki
        mock['Node_3'] = 8 * oslo_utils.units.Ki
        mock['Node_4'] = 4 * oslo_utils.units.Ki

        if uuid not in mock.keys():
            # mock[uuid] = random.randint(1, 4)
            mock[uuid] = 8

        return float(mock[str(uuid)])

    @staticmethod
    def get_average_airflow(resource):
        """The average outlet temperature for host"""

        uuid = resource.uuid
        mock = {}
        mock['Node_0'] = 400
        # use a big value to make sure it exceeds threshold
        mock['Node_1'] = 100
        if uuid not in mock.keys():
            mock[uuid] = 200
        return mock[str(uuid)]

    @staticmethod
    def get_average_inlet_temp(resource):
        """The average outlet temperature for host"""

        uuid = resource.uuid
        mock = {}
        mock['Node_0'] = 24
        mock['Node_1'] = 26
        if uuid not in mock.keys():
            mock[uuid] = 28
        return mock[str(uuid)]

    @staticmethod
    def get_average_power(resource):
        """The average outlet temperature for host"""

        uuid = resource.uuid
        mock = {}
        mock['Node_0'] = 260
        mock['Node_1'] = 240
        if uuid not in mock.keys():
            mock[uuid] = 200
        return mock[str(uuid)]

    @staticmethod
    def get_usage_compute_node_cpu(*args, **kwargs):
        """The last VM CPU usage values to average

        :param uuid:00
        :return:
        """

        resource = args[0]
        uuid = "%s_%s" % (resource.uuid, resource.hostname)

        measurements = {}
        # node 0
        measurements['Node_0_hostname_0'] = 7
        measurements['Node_1_hostname_1'] = 7
        measurements['fa69c544-906b-4a6a-a9c6-c1f7a8078c73_hostname_0'] = 7
        measurements['af69c544-906b-4a6a-a9c6-c1f7a8078c73_hostname_1'] = 7
        # node 1
        measurements['Node_2_hostname_2'] = 80
        # node 2
        measurements['Node_3_hostname_3'] = 5
        measurements['Node_4_hostname_4'] = 5
        measurements['Node_5_hostname_5'] = 10

        # node 3
        measurements['Node_6_hostname_6'] = 8
        # This node doesn't send metrics
        measurements['LOST_NODE_hostname_7'] = None
        measurements['Node_19_hostname_19'] = 10
        # node 4
        measurements['INSTANCE_7_hostname_7'] = 4

        result = measurements[uuid]
        return float(result) if result is not None else None

    @staticmethod
    def get_average_usage_instance_cpu_wb(resource):
        """The last VM CPU usage values to average

        :param resource:
        :return:
        """

        uuid = resource.uuid

        mock = {}
        # node 0
        mock['INSTANCE_1'] = 80
        mock['73b09e16-35b7-4922-804e-e8f5d9b740fc'] = 50
        # node 1
        mock['INSTANCE_3'] = 20
        mock['INSTANCE_4'] = 10

        return float(mock[str(uuid)])

    @staticmethod
    def get_average_usage_instance_memory_wb(resource):
        uuid = resource.uuid

        mock = {}
        # node 0
        mock['INSTANCE_1'] = 30
        mock['73b09e16-35b7-4922-804e-e8f5d9b740fc'] = 12
        # node 1
        mock['INSTANCE_3'] = 12
        mock['INSTANCE_4'] = 12

        return mock[str(uuid)]

    @staticmethod
    def get_average_usage_instance_cpu(*args, **kwargs):
        """The last VM CPU usage values to average

        :param uuid:00
        :return:
        """

        resource = args[0]
        uuid = resource.uuid

        mock = {}
        # node 0
        mock['INSTANCE_0'] = 7
        mock['INSTANCE_1'] = 7
        # node 1
        mock['INSTANCE_2'] = 10
        # node 2
        mock['INSTANCE_3'] = 5
        mock['INSTANCE_4'] = 5
        mock['INSTANCE_5'] = 10
        # node 3
        mock['INSTANCE_6'] = 8
        # node 4
        mock['INSTANCE_7'] = 4
        mock['LOST_INSTANCE'] = None

        # metrics might be missing in scenarios which do not do computations
        if uuid not in mock.keys():
            mock[uuid] = 0

        return mock[str(uuid)]

    @staticmethod
    def get_average_usage_instance_memory(resource):
        uuid = resource.uuid

        mock = {}
        # node 0
        mock['INSTANCE_0'] = 2
        mock['INSTANCE_1'] = 5
        # node 1
        mock['INSTANCE_2'] = 5
        # node 2
        mock['INSTANCE_3'] = 8
        mock['INSTANCE_4'] = 5
        mock['INSTANCE_5'] = 16
        # node 3
        mock['INSTANCE_6'] = 8
        # node 4
        mock['INSTANCE_7'] = 4

        return mock[str(uuid)]

    @staticmethod
    def get_average_usage_instance_disk(resource):
        uuid = resource.uuid

        mock = {}
        # node 0
        mock['INSTANCE_0'] = 2
        mock['INSTANCE_1'] = 2
        # node 1
        mock['INSTANCE_2'] = 2
        # node 2
        mock['INSTANCE_3'] = 10
        mock['INSTANCE_4'] = 15
        mock['INSTANCE_5'] = 20
        # node 3
        mock['INSTANCE_6'] = 8
        # node 4
        mock['INSTANCE_7'] = 4

        return mock[str(uuid)]


text: A iOS sample for UICollectionView and UICollectionViewFlowLayout


text:
'use strict';

/**
 * Exports variable helper
 */

module.exports = variable;

/**
 * Dyanimcally add JSON objects to the context.
 *
 * Register the helper with Handlebars
 *
 * ```js
 * var variable = require('handlebars-helper-variable');
 * var context = {};
 * Handlebars.registerHelper('variable', variable(context));
 * ```
 *
 * Use the helper in a Handlebars template.
 *
 * ```hbs
 * {{#variable "foo"}}
 *   { "foo": "bar" }
 * {{/variable}}
 * ```
 *
 * Compile and render the template with the given context.
 *
 * ```js
 * Handlebars.compile(template)(context);
 * //=> context = { foo: { foo: 'bar' } }
 * ```
 *
 * @param  {Object} `context` Context object to put the JSON object on.
 * @api public
 */

function variable (context) {
  return function variableHelper (name, options) {
    var content = options.fn(this);
    context[name] = JSON.parse(content);
  };
}


text:
package com.graphhopper.routing.weighting.custom;

import com.graphhopper.config.Profile;
import com.graphhopper.util.CustomModel;

public class CustomProfile extends Profile {

    public CustomProfile(Profile profile) {
        this(profile.getName());
        setVehicle(profile.getVehicle());
        setTurnCosts(profile.isTurnCosts());
        getHints().putAll(profile.getHints());
    }

    public CustomProfile(String name) {
        super(name);
        setWeighting(CustomWeighting.NAME);
    }

    public CustomProfile setCustomModel(CustomModel customModel) {
        customModel.internal();
        getHints().putObject(CustomModel.KEY, customModel);
        getHints().putObject("custom_model_file", "empty");
        return this;
    }

    public CustomModel getCustomModel() {
        return getHints().getObject(CustomModel.KEY, null);
    }
}


text:
/*
Currently only instantiated on init.js
To instantiate lookback selectors with varying values:

goldstone.globalLookbackRefreshSelectors = new GlobalLookbackRefreshButtonsView({
    lookbackValues: {
        lookback: [
            [15, 'lookback 15m'],
            [60, 'lookback 1h'],
            [360, 'lookback 6h'],
            [1440, 'lookback 1d'],
            [4320, 'lookback 3d'],
            [10080, 'lookback 7d']
        ],
        refresh: [
            [30, 'refresh 30s'],
            [60, 'refresh 1m'],
            [300, 'refresh 5m'],
            [-1, 'refresh off']
        ],
        selectedLookback: 60,
        selectedRefresh: 60
    }
});
$(selector).append(goldstone.globalLookbackRefreshSelectors.el);

Use selectedLookback back and selectedRefresh to set initial values, if desired.
If omitted, selector will default to the first value in the list.

*****************************
*****************************
sensible defaults, if needed:

lookback:
--------
'<option class="i18n" data-i18n="lookback 15m" value="15" selected>lookback 15m</option>' +
'<option class="i18n" data-i18n="lookback 1h" value="60">lookback 1h</option>' +
'<option class="i18n" data-i18n="lookback 6h" value="360">lookback 6h</option>' +
'<option class="i18n" data-i18n="lookback 1d" value="1440">lookback 1d</option>' +
'<option class="i18n" data-i18n="lookback 3d" value="4320">lookback 3d</option>' +
'<option class="i18n" data-i18n="lookback 7d" value="10080">lookback 7d</option>';

refresh:
-------
'<option class="i18n" data-i18n="refresh 30s" value="30" selected>refresh 30s</option>' +
'<option class="i18n" data-i18n="refresh 1m" value="60">refresh 1m</option>' +
'<option class="i18n" data-i18n="refresh 5m" value="300">refresh 5m</option>' +
'<option class="i18n" data-i18n="refresh off" value="-1">refresh off</option>';
*****************************
*****************************
*/

var GlobalLookbackRefreshButtonsView = GoldstoneBaseView.extend({

    instanceSpecificInit: function() {
        this.processOptions();
        this.render();
        this.processListeners();
    },

    render: function() {
        this.$el.html(this.template());
        return this;
    },

    renderDropdownContent: function(dropdownValues, initValue) {
        var result = '';
        _.each(dropdownValues, function(item) {
            result += '<option class="i18n" data-i18n="' + item[1] + '" value="' + item[0] + '"';

            // check for passed in start value
            if (item[0] === initValue) {
                result += ' selected';
            }
            result += '>' + item[1] + '</option>';
        });
        return result;
    },

    customLookback: function() {
        if (this.lookbackValues && this.lookbackValues.lookback && this.lookbackValues.lookback.length) {
            var values = this.lookbackValues;
            var initialLookback = values.selectedLookback;

            // check for persisted initial value
            var storedLookback = goldstone.userPrefsView.getUserPrefKey('lookback');
            if (storedLookback) {
                initialLookback = storedLookback;
            }
            return this.renderDropdownContent(values.lookback, parseInt(initialLookback, 10));
        }
    },

    customRefresh: function() {
        if (this.lookbackValues && this.lookbackValues.refresh && this.lookbackValues.refresh.length) {
            var values = this.lookbackValues;
            var initialRefresh = values.selectedRefresh;

            // check for persisted initial value
            var storedRefresh = goldstone.userPrefsView.getUserPrefKey('refresh');
            if (storedRefresh) {
                initialRefresh = storedRefresh;
            }
            return this.renderDropdownContent(values.refresh, parseInt(initialRefresh, 10));
        }
    },

    // persist value of changed selector
    storeValue: function(selector, value) {
        goldstone.userPrefsView.setUserPrefKey(selector, value);
    },

    processListeners: function() {
        var self = this;
        this.$el.find('#global-lookback-range').on('change', function() {
            self.trigger('globalLookbackChange');
            self.trigger('globalSelectorChange');
            self.storeValue('lookback', $(this).val());
        });
        this.$el.find('#global-refresh-range').on('change', function() {
            self.trigger('globalRefreshChange');
            self.trigger('globalSelectorChange');
            self.storeValue('refresh', $(this).val());
        });
    },

    template: _.template('' +
        '
 ' +
        '
' +

        '
' +
        '<form class="global-lookback-selector" role="form">' +
        '
' +
        '
' +
        '
' +
        '<select class="form-control" id="global-lookback-range">' +
        '<%= this.customLookback() %>' +
        // based on this.lookbackValues.lookback
        // '<option value="15" selected>lookback 15m</option>' +
        // '<option value="60">lookback 1h</option>' +
        // '<option value="360">lookback 6h</option>' +
        // '<option value="1440">lookback 1d</option>' +
        '</select>' +
        '
' +
        '
' +
        '
' +
        '</form>' +
        '
' +

        '
' +
        '<form class="global-refresh-selector" role="form">' +
        '
' +
        '
' +
        '
' +
        '<select class="form-control" id="global-refresh-range">' +
        '<%= this.customRefresh() %>' +
        // based on this.lookbackValues.refresh
        // '<option value="30" selected>refresh 30s</option>' +
        // '<option value="60">refresh 1m</option>' +
        // '<option value="300">refresh 5m</option>' +
        // '<option value="-1">refresh off</option>' +
        '</select>' +
        '
' +
        '
' +
        '
' +
        '</form>' +
        '
'

    )
});


text:
namespace views {

namespace {

class WidgetOwnsNativeBubble : public BubbleDelegateView {
 public:
  WidgetOwnsNativeBubble(View* content, BubbleBorder::Arrow arrow)
      : BubbleDelegateView(content, arrow) {
  }

  ~WidgetOwnsNativeBubble() override {}

 private:
  // BubbleDelegateView:
  void OnBeforeBubbleWidgetInit(Widget::InitParams* params,
                                Widget* widget) const override {
    params->ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
  }

  DISALLOW_COPY_AND_ASSIGN(WidgetOwnsNativeBubble);
};

}  // namespace

class BubbleWindowTargeterTest : public ViewsTestBase {
 public:
  BubbleWindowTargeterTest()
      : bubble_delegate_(NULL) {
  }
  ~BubbleWindowTargeterTest() override {}

  void SetUp() override {
    ViewsTestBase::SetUp();
    CreateAnchorWidget();
    CreateBubbleWidget();

    anchor_widget()->Show();
    bubble_widget()->Show();
  }

  void TearDown() override {
    bubble_delegate_ = NULL;
    bubble_widget_.reset();
    anchor_.reset();
    ViewsTestBase::TearDown();
  }

  Widget* anchor_widget() { return anchor_.get(); }
  Widget* bubble_widget() { return bubble_widget_.get(); }
  BubbleDelegateView* bubble_delegate() { return bubble_delegate_; }

 private:
  void CreateAnchorWidget() {
    anchor_.reset(new Widget());
    Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW);
    params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
    anchor_->Init(params);
  }

  void CreateBubbleWidget() {
    bubble_delegate_ = new WidgetOwnsNativeBubble(
        anchor_->GetContentsView(), BubbleBorder::NONE);
    bubble_delegate_->set_color(SK_ColorGREEN);
    bubble_widget_.reset(BubbleDelegateView::CreateBubble(bubble_delegate_));
  }

  scoped_ptr<Widget> anchor_;
  scoped_ptr<Widget> bubble_widget_;
  BubbleDelegateView* bubble_delegate_;

  DISALLOW_COPY_AND_ASSIGN(BubbleWindowTargeterTest);
};

TEST_F(BubbleWindowTargeterTest, HitTest) {
  ui::EventTarget* root = bubble_widget()->GetNativeWindow()->GetRootWindow();
  ui::EventTargeter* targeter = root->GetEventTargeter();
  aura::Window* bubble_window = bubble_widget()->GetNativeWindow();
  gfx::Rect bubble_bounds = bubble_window->GetBoundsInRootWindow();

  {
    bubble_delegate()->set_margins(gfx::Insets());
    ui::MouseEvent move1(ui::ET_MOUSE_MOVED, bubble_bounds.origin(),
                         bubble_bounds.origin(), ui::EventTimeForNow(),
                         ui::EF_NONE, ui::EF_NONE);
    EXPECT_EQ(bubble_window, targeter->FindTargetForEvent(root, &move1));
  }
  {
    bubble_delegate()->set_margins(gfx::Insets(20, 20, 20, 20));
    ui::MouseEvent move1(ui::ET_MOUSE_MOVED, bubble_bounds.origin(),
                         bubble_bounds.origin(), ui::EventTimeForNow(),
                         ui::EF_NONE, ui::EF_NONE);
    EXPECT_EQ(bubble_window, targeter->FindTargetForEvent(root, &move1));
  }

  bubble_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
      new BubbleWindowTargeter(bubble_delegate())));
  {
    bubble_delegate()->set_margins(gfx::Insets(20, 20, 20, 20));
    ui::MouseEvent move1(ui::ET_MOUSE_MOVED, bubble_bounds.origin(),
                         bubble_bounds.origin(), ui::EventTimeForNow(),
                         ui::EF_NONE, ui::EF_NONE);
    EXPECT_NE(bubble_window, targeter->FindTargetForEvent(root, &move1));
  }
}

}  // namespace views


text:
#todo-app {
  /*using fixed size as to overcome resizing problems*/
  width: 500px;
  margin: 20px auto;
}
#todo-app .isHidden{
  display: none;
}
#todo-app h3{
  margin : 0;
  text-align: center;
}
#todo-app #todo-box {
  border-bottom: 1px solid black;
  list-style: none;
  margin: 0;
  padding: 0px 3px 10px 0px;
}
#todo-app #todo-container #todo-box:first-child {
  border-top: 1px solid black;
}
#todo-app .active {
  border: 1px solid purple;
  border-radius: 5px;
}
#todo-app .strikeout {
  text-decoration: line-through;
  opacity: 0.5;
  filter: alpha(opacity=50);
  /* IE8 and earlier */
}
#todo-app li {
  position: relative;
  height: 1.5em;
  font-size: 1.5em;
}
#todo-app .view .remove-todo-close {
  display: none;
  position: absolute;
  right : 5px;
  top: 0;
}
#todo-app .view:hover .remove-todo-close {
  display: block;
}
#todo-app #todo-box li .view {
  display: inline-block;
  width: 100%;
  border-bottom: 1px solid #B6DAFD;
  padding-bottom: 4px;
}
#todo-app #todo-box li.editing .view {
  display: none;
}
#todo-app #todo-box .edit {
  display: none;
  width : 100%;
}
#todo-app #todo-box li.editing .edit {
  display: block;
}
/*as vertical align property does not inherit we need to add this property to all elements*/
#todo-app #check-all, #todo-app .view .check-hasCompleted, #todo-app .view .remove-todo-close, #todo-app .view .todo-title {
  vertical-align: middle;
}
#todo-app .view .todo-title, #todo-app #new-todo {
  margin-left: 3%;
}
#todo-app li:before{
    position: absolute;
    top: 0;
    left: 29px;
    z-index: 10;
    width: 3px;
    height: 100%;
    border: 1px solid #FCCDC7;
    border-width: 0 1px;
    content: '';
}
#todo-app li.editing:before{
  border: none;
}
#todo-app #new-todo, #todo-app .edit{
  font-size: 1.2em;
  padding-left: 10px;
}
#todo-app #new-todo{
  width: 92%;
  height : 40px;
}
#todo-app a {
  color: inherit;
  text-decoration: none;
}
#todo-app #todo-form{
  position: relative;
}
#todo-app #statusbar{
  margin-top:10px;
}
/*to override user agent style sheet*/
#todo-app form{
  margin-bottom: 10px;
}


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class PulsarCreateTableAction extends Migration
{
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		if(! Schema::hasTable('001_008_action'))
		{
			Schema::create('001_008_action', function (Blueprint $table) {
				$table->engine = 'InnoDB';

				$table->string('id_008', 25);
				$table->string('name_008');

				$table->primary('id_008', 'pk01_001_008_action');
			});
		}
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		if (Schema::hasTable('001_008_action'))
		{
			Schema::drop('001_008_action');
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <logger name="slick.compiler" level="WARN"/>
    <logger name="slick.ast" level="WARN"/>
    <logger name="akka.stream.impl" level="WARN"/>
    <logger name="slick.relational.ResultConverterCompiler" level="WARN"/>

    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>logs/server.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- daily rollover. Make sure the path matches the one in the file element or else
                 the rollover logs are placed in the working directory. -->
            <fileNamePattern>logs/archive/server_%d{yyyy-MM,aux}/%d-%i.log.gz</fileNamePattern>

            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <maxFileSize>100MB</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
            <!-- keep 30 days' worth of history -->
            <maxHistory>365</maxHistory>
        </rollingPolicy>
        <withJansi>true</withJansi>
        <encoder>
            <charset>UTF-8</charset>
            <pattern>%X{akkaTimestamp} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{akkaSource}) %X{authId} %X{sessionId} %msg%n</pattern>
        </encoder>
    </appender>

    <root level="DEBUG">
        <appender-ref ref="file"/>
    </root>
</configuration>


text:
angular.module('IssueTracker.common.service', [])

    .factory('mainService', [
        '$http',
        '$q',
        'BASE_URL',
        function($http, $q, BASE_URL) {

            function getAllUsers() {
                var deferred = $q.deferred;

                var request = {
                    method: 'GET',
                    url: BASE_URL + 'users/',
                    headers: {'Authorization' : 'Bearer ' + sessionStorage.authToken}
                };

                $http(request)
                    .then(
                        function(data) {
                            deferred.resolve(data.data)
                        }, function(err) {
                            deferred.reject(err);
                        });

                return deferred.promise();

            }
        }
    ]);


text:
<?php

namespace Symfony\Bridge\Doctrine\Form\Type;

use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader;

class EntityType extends DoctrineType
{
    /**
     * Return the default loader object.
     *
     * @param ObjectManager $manager
     * @param mixed         $queryBuilder
     * @param string        $class
     *
     * @return ORMQueryBuilderLoader
     */
    public function getLoader(ObjectManager $manager, $queryBuilder, $class)
    {
        return new ORMQueryBuilderLoader(
            $queryBuilder,
            $manager,
            $class
        );
    }

    public function getName()
    {
        return 'entity';
    }
}


text:
module Azure::MediaServices::Mgmt::V2018_03_30_preview
  module Models
    #
    # Base class for content key ID location. A derived class must be used to
    # represent the location.
    #
    class ContentKeyPolicyPlayReadyContentKeyLocation

      include MsRestAzure

      @@discriminatorMap = Hash.new
      @@discriminatorMap["#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"] = "ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"
      @@discriminatorMap["#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier"] = "ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier"

      def initialize
        @odatatype = "ContentKeyPolicyPlayReadyContentKeyLocation"
      end

      attr_accessor :odatatype

      #
      # Mapper for ContentKeyPolicyPlayReadyContentKeyLocation class as Ruby
      # Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ContentKeyPolicyPlayReadyContentKeyLocation',
          type: {
            name: 'Composite',
            polymorphic_discriminator: '@odata.type',
            uber_parent: 'ContentKeyPolicyPlayReadyContentKeyLocation',
            class_name: 'ContentKeyPolicyPlayReadyContentKeyLocation',
            model_properties: {
            }
          }
        }
      end
    end
  end
end


text:
package com.google.cloud.compute.v1;

import com.google.api.core.BetaApi;
import com.google.api.pathtemplate.PathTemplate;
import com.google.api.resourcenames.ResourceName;
import com.google.api.resourcenames.ResourceNameFactory;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Generated;

@Generated("by GAPIC")
@BetaApi
public final class ProjectZoneNodeTypeName implements ResourceName {
  private final String nodeType;
  private final String project;
  private final String zone;
  private static final PathTemplate PATH_TEMPLATE =
      PathTemplate.createWithoutUrlEncoding("{project}/zones/{zone}/nodeTypes/{nodeType}");

  public static final String SERVICE_ADDRESS = "https://www.googleapis.com/compute/v1/projects/";

  private volatile Map<String, String> fieldValuesMap;

  public static Builder newBuilder() {
    return new Builder();
  }

  public Builder toBuilder() {
    return new Builder(this);
  }

  private ProjectZoneNodeTypeName(Builder builder) {
    nodeType = Preconditions.checkNotNull(builder.getNodeType());
    project = Preconditions.checkNotNull(builder.getProject());
    zone = Preconditions.checkNotNull(builder.getZone());
  }

  public static ProjectZoneNodeTypeName of(String nodeType, String project, String zone) {
    return newBuilder().setNodeType(nodeType).setProject(project).setZone(zone).build();
  }

  public static String format(String nodeType, String project, String zone) {
    return of(nodeType, project, zone).toString();
  }

  public String getNodeType() {
    return nodeType;
  }

  public String getProject() {
    return project;
  }

  public String getZone() {
    return zone;
  }

  @Override
  public Map<String, String> getFieldValuesMap() {
    if (fieldValuesMap == null) {
      synchronized (this) {
        if (fieldValuesMap == null) {
          ImmutableMap.Builder<String, String> fieldMapBuilder = ImmutableMap.builder();
          fieldMapBuilder.put("nodeType", nodeType);
          fieldMapBuilder.put("project", project);
          fieldMapBuilder.put("zone", zone);
          fieldValuesMap = fieldMapBuilder.build();
        }
      }
    }
    return fieldValuesMap;
  }

  public String getFieldValue(String fieldName) {
    return getFieldValuesMap().get(fieldName);
  }

  public static ResourceNameFactory<ProjectZoneNodeTypeName> newFactory() {
    return new ResourceNameFactory<ProjectZoneNodeTypeName>() {
      public ProjectZoneNodeTypeName parse(String formattedString) {
        return ProjectZoneNodeTypeName.parse(formattedString);
      }
    };
  }

  public static ProjectZoneNodeTypeName parse(String formattedString) {
    String resourcePath = formattedString;
    if (formattedString.startsWith(SERVICE_ADDRESS)) {
      resourcePath = formattedString.substring(SERVICE_ADDRESS.length());
    }
    Map<String, String> matchMap =
        PATH_TEMPLATE.validatedMatch(
            resourcePath, "ProjectZoneNodeTypeName.parse: formattedString not in valid format");
    return of(matchMap.get("nodeType"), matchMap.get("project"), matchMap.get("zone"));
  }

  public static boolean isParsableFrom(String formattedString) {
    String resourcePath = formattedString;
    if (formattedString.startsWith(SERVICE_ADDRESS)) {
      resourcePath = formattedString.substring(SERVICE_ADDRESS.length());
    }
    return PATH_TEMPLATE.matches(resourcePath);
  }

  public static class Builder {
    private String nodeType;
    private String project;
    private String zone;

    public String getNodeType() {
      return nodeType;
    }

    public String getProject() {
      return project;
    }

    public String getZone() {
      return zone;
    }

    public Builder setNodeType(String nodeType) {
      this.nodeType = nodeType;
      return this;
    }

    public Builder setProject(String project) {
      this.project = project;
      return this;
    }

    public Builder setZone(String zone) {
      this.zone = zone;
      return this;
    }

    private Builder() {}

    public Builder(ProjectZoneNodeTypeName projectZoneNodeTypeName) {
      nodeType = projectZoneNodeTypeName.nodeType;
      project = projectZoneNodeTypeName.project;
      zone = projectZoneNodeTypeName.zone;
    }

    public ProjectZoneNodeTypeName build() {
      return new ProjectZoneNodeTypeName(this);
    }
  }

  @Override
  public String toString() {
    return SERVICE_ADDRESS
        + PATH_TEMPLATE.instantiate(
            "nodeType", nodeType,
            "project", project,
            "zone", zone);
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ProjectZoneNodeTypeName) {
      ProjectZoneNodeTypeName that = (ProjectZoneNodeTypeName) o;
      return Objects.equals(this.nodeType, that.getNodeType())
          && Objects.equals(this.project, that.getProject())
          && Objects.equals(this.zone, that.getZone());
    }
    return false;
  }

  @Override
  public int hashCode() {
    return Objects.hash(nodeType, project, zone);
  }
}