text:
package com.normation.ldap.sdk

import com.unboundid.ldap.sdk.Filter
import Filter._

object BuildFilter {

  /**
   * Create a non filtering filter
   * equivalent to (objectClass=*)
   */
  val ALL : Filter = HAS("objectClass")

  /**
   * Creates a new AND search filter with the provided components.
   *
   * @param  andComponents  The set of filter components to include in the AND
   *                        filter.  It must not be {@code null}.
   *
   * @return  The created AND search filter.
   */
  def AND(andComponents:Filter*) = createANDFilter(andComponents:_*)

  /**
   * Creates a new OR search filter with the provided components.
   *
   * @param  orComponents  The set of filter components to include in the OR
   *                       filter.  It must not be {@code null}.
   *
   * @return  The created OR search filter.
   */
  def OR(orComponents:Filter*) = createORFilter(orComponents:_*)

  /**
   * Creates a new NOT search filter with the provided component.
   *
   * @param  notComponent  The filter component to include in this NOT filter.
   *                       It must not be {@code null}.
   *
   * @return  The created NOT search filter.
   */
  def NOT(notComponent:Filter) = createNOTFilter(notComponent)

  /**
   * Creates a new equality search filter with the provided information.
   *
   * @param  attributeName   The attribute name for this equality filter.  It
   *                         must not be {@code null}.
   * @param  assertionValue  The assertion value for this equality filter.  It
   *                         must not be {@code null}.
   *
   * @return  The created equality search filter.
   */
  def EQ(attributeName:String, assertionValue:String) = createEqualityFilter(attributeName,assertionValue)

  /**
   * Creates a new equality search filter with the provided information.
   *
   * @param  attributeName   The attribute name for this equality filter.  It
   *                         must not be {@code null}.
   * @param  assertionValue  The assertion value for this equality filter.  It
   *                         must not be {@code null}.
   *
   * @return  The created equality search filter.
   */
  def EQ(attributeName:String, assertionValue:Array[Byte]) = createEqualityFilter(attributeName,assertionValue)

  /**
   * A special case of EQ for object class
   */
  def IS(assertionValue:String) = createEqualityFilter("objectClass",assertionValue)

  /**
   * Creates a new substring search filter with the provided information.  At
   * least one of the subInitial, subAny, and subFinal components must not be
   * {@code null}.
   *
   * @param  attributeName  The attribute name for this substring filter.  It
   *                        must not be {@code null}.
   * @param  subInitial     The subInitial component for this substring filter.
   * @param  subAny         The set of subAny components for this substring
   *                        filter.
   * @param  subFinal       The subFinal component for this substring filter.
   *
   * @return  The created substring search filter.
   */
  def SUB(attributeName:String, subInitial:String, subAny:Array[String],subFinal:String) =
    createSubstringFilter(attributeName, subInitial, subAny, subFinal)

  /**
   * Creates a new substring search filter with the provided information.  At
   * least one of the subInitial, subAny, and subFinal components must not be
   * {@code null}.
   *
   * @param  attributeName  The attribute name for this substring filter.  It
   *                        must not be {@code null}.
   * @param  subInitial     The subInitial component for this substring filter.
   * @param  subAny         The set of subAny components for this substring
   *                        filter.
   * @param  subFinal       The subFinal component for this substring filter.
   *
   * @return  The created substring search filter.
   */
  def SUB(attributeName:String, subInitial:Array[Byte], subAny:Array[Array[Byte]],subFinal:Array[Byte]) =
    createSubstringFilter(attributeName, subInitial, subAny, subFinal)

  /**
   * Creates a new greater-or-equal search filter with the provided information.
   *
   * @param  attributeName   The attribute name for this greater-or-equal
   *                         filter.  It must not be {@code null}.
   * @param  assertionValue  The assertion value for this greater-or-equal
   *                         filter.  It must not be {@code null}.
   *
   * @return  The created greater-or-equal search filter.
   */
  def GTEQ(attributeName:String, assertionValue:String) = createGreaterOrEqualFilter(attributeName,assertionValue)

  /**
   * Creates a new greater-or-equal search filter with the provided information.
   *
   * @param  attributeName   The attribute name for this greater-or-equal
   *                         filter.  It must not be {@code null}.
   * @param  assertionValue  The assertion value for this greater-or-equal
   *                         filter.  It must not be {@code null}.
   *
   * @return  The created greater-or-equal search filter.
   */
  def GTEQ(attributeName:String, assertionValue:Array[Byte]) = createGreaterOrEqualFilter(attributeName,assertionValue)

  /**
   * Creates a new less-or-equal search filter with the provided information.
   *
   * @param  attributeName   The attribute name for this less-or-equal
   *                         filter.  It must not be {@code null}.
   * @param  assertionValue  The assertion value for this less-or-equal
   *                         filter.  It must not be {@code null}.
   *
   * @return  The created less-or-equal search filter.
   */
  def LTEQ(attributeName:String, assertionValue:String) = createLessOrEqualFilter(attributeName,assertionValue)

  /**
   * Creates a new less-or-equal search filter with the provided information.
   *
   * @param  attributeName   The attribute name for this less-or-equal
   *                         filter.  It must not be {@code null}.
   * @param  assertionValue  The assertion value for this less-or-equal
   *                         filter.  It must not be {@code null}.
   *
   * @return  The created less-or-equal search filter.
   */
  def LTEQ(attributeName:String, assertionValue:Array[Byte]) = createLessOrEqualFilter(attributeName,assertionValue)

  /**
   * Creates a new presence search filter with the provided information.
   *
   * @param  attributeName   The attribute name for this presence filter.  It
   *                         must not be {@code null}.
   *
   * @return  The created presence search filter.
   */
  def HAS(attributeName:String) = createPresenceFilter(attributeName)

  /**
   * Creates a new approximate match search filter with the provided
   * information.
   *
   * @param  attributeName   The attribute name for this approximate match
   *                         filter.  It must not be {@code null}.
   * @param  assertionValue  The assertion value for this approximate match
   *                         filter.  It must not be {@code null}.
   *
   * @return  The created approximate match search filter.
   */
  def MATCH(attributeName:String, assertionValue:String) = createApproximateMatchFilter(attributeName,assertionValue)

  /**
   * Creates a new approximate match search filter with the provided
   * information.
   *
   * @param  attributeName   The attribute name for this approximate match
   *                         filter.  It must not be {@code null}.
   * @param  assertionValue  The assertion value for this approximate match
   *                         filter.  It must not be {@code null}.
   *
   * @return  The created approximate match search filter.
   */
  def MATCH(attributeName:String, assertionValue:Array[Byte]) = createApproximateMatchFilter(attributeName,assertionValue)

  /**
   * Creates a new extensible match search filter with the provided
   * information.  At least one of the attribute name and matching rule ID must
   * be specified, and the assertion value must always be present.
   *
   * @param  attributeName   The attribute name for this extensible match
   *                         filter.
   * @param  matchingRuleID  The matching rule ID for this extensible match
   *                         filter.
   * @param  dnAttributes    Indicates whether the match should be performed
   *                         against attributes in the target entry's DN.
   * @param  assertionValue  The assertion value for this extensible match
   *                         filter.  It must not be {@code null}.
   *
   * @return  The created extensible match search filter.
   */
  def MATCHEX(attributeName:String, matchingRuleID:String, dnAttributes:Boolean, assertionValue:Array[Byte]) =
    createExtensibleMatchFilter(attributeName, matchingRuleID, dnAttributes, assertionValue)

  /**
   * Creates a new search filter from the provided string representation.
   *
   * @param  filterString  The string representation of the filter to create.
   *                       It must not be {@code null}.
   *
   * @return  The search filter decoded from the provided filter string.
   *
   * @throws  LDAPException  If the provided string cannot be decoded as a valid
   *                         LDAP search filter.
   */
  def apply(filterString:String) = create(filterString)

}


text:
package com.google.code.validationframework.swing.dataprovider;

import com.google.code.validationframework.api.dataprovider.DataProvider;

import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import java.util.Enumeration;

/**
 * Data provider retrieving the selected index in a button group.
 *
 * @see DataProvider
 * @see ButtonGroup
 */
public class ButtonGroupSelectedIndexProvider implements DataProvider<Integer> {

    /**
     * Button group to retrieve the selected index from.
     */
    private final ButtonGroup buttonGroup;

    /**
     * Constructor specifying the button group to retrieve the selected index from.
     *
     * @param buttonGroup Button group to retrieve the selected index from.
     */
    public ButtonGroupSelectedIndexProvider(final ButtonGroup buttonGroup) {
        this.buttonGroup = buttonGroup;
    }

    /**
     * Gets the component providing the data to be validated.
     *
     * @return Component providing the data to be validated.
     */
    public ButtonGroup getComponent() {
        return buttonGroup;
    }

    /**
     * @see DataProvider#getData()
     */
    @Override
    public Integer getData() {
        int index = -1;

        final ButtonModel selection = buttonGroup.getSelection();
        if (selection != null) {
            final Enumeration<AbstractButton> buttons = buttonGroup.getElements();
            int i = 0;
            while (buttons.hasMoreElements()) {
                if (buttons.nextElement().getModel().equals(selection)) {
                    index = i;
                    break;
                }
                i++;
            }
        }

        return index;
    }
}

redpajama_set_name: RedPajamaGithub


text:
class AddAssignStateToCode < ActiveRecord::Migration
  def change
    add_column :codes, :assign_state, :string
  end
end


text:
require 'fog/core'
require 'fog/fogdocker/errors'

module Fog
  module Fogdocker
    extend Fog::Provider
    service(:compute, 'Compute')
  end
end


text:
using System;
using Glass.Mapper.Sc.Configuration;
using NUnit.Framework;
using Sitecore.Data;
using Sitecore.FakeDb;

namespace Glass.Mapper.Sc.FakeDb.DataMappers
{
    [TestFixture]
    public class SitecoreTypeConfigurationFixture
    {
        #region ResolveItem

        [Test]
        public void ResolveItem()
        {
            //Arrange

            using (Db database = new Db
            {
                new Sitecore.FakeDb.DbItem("TestItem")
            })
            {
                var config = new SitecoreTypeConfiguration();
                config.ItemUriConfig = new SitecoreInfoConfiguration();
                config.ItemUriConfig.PropertyInfo = typeof(StubClass).GetProperty("ItemUri");

                string path = "/sitecore/content/TestItem";
                var expected = database.GetItem(path);

                var instance = new StubClass();
                instance.ItemUri = new ItemUri(expected.ID, expected.Language, expected.Version, expected.Database);

                //Act
                var result = config.ResolveItem(instance, database.Database);

                //Assert
                Assert.AreEqual(expected.ID, result.ID);
                Assert.AreEqual(expected.Version, result.Version);
                Assert.AreEqual(expected.Language, result.Language);
            }

        }

        [Test]
        public void ResolveItem_NoId_ThrowsException()
        {
            //Arrange
            using (Db database = new Db
            {
                new Sitecore.FakeDb.DbItem("TestItem")
            })
            {
                var config = new SitecoreTypeConfiguration();
                config.Type = typeof(StubClassNoId);

                config.AddProperty(
                    new SitecoreFieldConfiguration()
                    {
                        PropertyInfo = typeof(StubClassNoId).GetProperty("Field")
                    });

                var instance = new StubClassNoId();

                //Act
                Assert.Throws<NotSupportedException>(() => config.ResolveItem(instance, database.Database));

                //Assert
            }

        }

        #endregion

        #region Stubs

        public class StubClassNoId : StubInterface
        {
            public virtual string Field { get; set; }
        }

        public interface StubInterface
        {

        }
        public class StubClass
        {

            public virtual ItemUri ItemUri { get; set; }

        }

        #endregion

    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.hannesdorfmann.collection" android:versionCode="1" android:versionName="1.0.0">

  <uses-sdk android:minSdkVersion="8"
            android:targetSdkVersion="16" />

  <application android:icon="@drawable/ic_launcher" android:label="AndroidCollections">

  	<uses-library android:name="android.test.runner" />

  </application>

</manifest>


text:
<?php

namespace Nails\Invoice\Interfaces\Driver;

use Nails\Currency\Resource\Currency;
use Nails\Invoice\Exception\DriverException;
use Nails\Invoice\Factory\ChargeRequest;
use Nails\Invoice\Factory\ChargeResponse;
use Nails\Invoice\Factory\CompleteResponse;
use Nails\Invoice\Factory\RefundResponse;
use Nails\Invoice\Factory\ScaResponse;
use Nails\Invoice\Resource;
use stdClass;

/**
 * Interface Payment
 *
 * @package Nails\Invoice\Interfaces\Driver
 */
interface Payment
{
    /**
     * Determines whether the driver supports the specified currency
     *
     * @param Currency|string $mCurrency The currency
     *
     * @return bool
     */
    public function supportsCurrency($mCurrency): bool;

    // --------------------------------------------------------------------------

    /**
     * Prepares a ChargeRequest object
     *
     * @param ChargeRequest $oChargeRequest The ChargeRequest object to prepare
     * @param array         $aData          Any data which was requested by getPaymentFields()
     */
    public function prepareChargeRequest(
        ChargeRequest $oChargeRequest,
        array $aData
    ): void;

    // --------------------------------------------------------------------------

    /**
     * Returns whether the driver is available to be used against the selected invoice
     *
     * @param Resource\Invoice $oInvoice The invoice being charged
     *
     * @return bool
     */
    public function isAvailable(Resource\Invoice $oInvoice): bool;

    // --------------------------------------------------------------------------

    /**
     * Returns the currencies which this driver supports, it will only be presented
     * when attempting to pay an invoice in a supported currency
     *
     * @return string[]|null
     */
    public function getSupportedCurrencies(): ?array;

    // --------------------------------------------------------------------------

    /**
     * Returns whether the driver uses a redirect payment flow or not.
     *
     * @return bool
     */
    public function isRedirect(): bool;

    // --------------------------------------------------------------------------

    /**
     * Returns the payment fields the driver requires, use static::PAYMENT_FIELDS_CARD
     * for basic credit card details.
     *
     * @return mixed
     */
    public function getPaymentFields();

    // --------------------------------------------------------------------------

    /**
     * Returns any assets to load during checkout
     *
     * @return array
     */
    public function getCheckoutAssets(): array;

    // --------------------------------------------------------------------------

    /**
     * Initiate a payment
     *
     * @param int                           $iAmount          The payment amount
     * @param Currency                      $oCurrency        The payment currency
     * @param stdClass                      $oData            An array of driver data
     * @param Resource\Invoice\Data\Payment $oPaymentData     The payment data object
     * @param string                        $sDescription     The charge description
     * @param Resource\Payment              $oPayment         The payment object
     * @param Resource\Invoice              $oInvoice         The invoice object
     * @param string                        $sSuccessUrl      The URL to go to after successful payment
     * @param string                        $sErrorUrl        The URL to go to after failed payment
     * @param bool                          $bCustomerPresent Whether the customer is present
     * @param Resource\Source|null          $oSource          The saved payment source to use
     *
     * @return ChargeResponse
     */
    public function charge(
        int $iAmount,
        Currency $oCurrency,
        stdClass $oData,
        Resource\Invoice\Data\Payment $oPaymentData,
        string $sDescription,
        Resource\Payment $oPayment,
        Resource\Invoice $oInvoice,
        string $sSuccessUrl,
        string $sErrorUrl,
        bool $bCustomerPresent,
        Resource\Source $oSource = null
    ): ChargeResponse;

    // --------------------------------------------------------------------------

    /**
     * Handles any SCA requests
     *
     * @param ScaResponse $oScaResponse The SCA Response object
     * @param array       $aData        Any saved SCA data
     * @param string      $sSuccessUrl  The URL to redirect to after authorisation
     *
     * @return ScaResponse
     */
    public function sca(
        ScaResponse $oScaResponse,
        array $aData,
        string $sSuccessUrl
    ): ScaResponse;

    // --------------------------------------------------------------------------

    /**
     * Complete the payment
     *
     * @param Resource\Payment $oPayment  The Payment object
     * @param Resource\Invoice $oInvoice  The Invoice object
     * @param array            $aGetVars  Any $_GET variables passed from the redirect flow
     * @param array            $aPostVars Any $_POST variables passed from the redirect flow
     *
     * @return CompleteResponse
     */
    public function complete(
        Resource\Payment $oPayment,
        Resource\Invoice $oInvoice,
        array $aGetVars,
        array $aPostVars
    ): CompleteResponse;

    // --------------------------------------------------------------------------

    /**
     * Issue a refund for a payment
     *
     * @param string                        $sTransactionId The transaction's ID
     * @param int                           $iAmount        The amount to refund
     * @param Currency                      $oCurrency      The currency in which to refund
     * @param Resource\Invoice\Data\Payment $oPaymentData   The payment data object
     * @param string                        $sReason        The refund's reason
     * @param Resource\Payment              $oPayment       The payment object
     * @param Resource\Invoice              $oInvoice       The invoice object
     *
     * @return RefundResponse
     */
    public function refund(
        string $sTransactionId,
        int $iAmount,
        Currency $oCurrency,
        Resource\Invoice\Data\Payment $oPaymentData,
        string $sReason,
        Resource\Payment $oPayment,
        Resource\Invoice $oInvoice
    ): RefundResponse;

    // --------------------------------------------------------------------------

    /**
     * Creates a new payment source on the gateway, semi-populates the source resource with data
     *
     * @param Resource\Source $oResource The Resouce object to update
     * @param array           $aData     Data passed from the caller
     *
     * @throws DriverException
     */
    public function createSource(
        Resource\Source &$oResource,
        array $aData
    ): void;

    // --------------------------------------------------------------------------

    /**
     * Updates a payment source on the gateway
     *
     * @param Resource\Source $oResource The Resource being updated
     */
    public function updateSource(
        Resource\Source $oResource
    ): void;

    // --------------------------------------------------------------------------

    /**
     * Deletes a payment source from the gateway
     *
     * @param Resource\Source $oResource The Resource being deleted
     */
    public function deleteSource(
        Resource\Source $oResource
    ): void;

    // --------------------------------------------------------------------------

    /**
     * Convinience method for creating a new customer on the gateway
     *
     * @param array $aData The driver specific customer data
     */
    public function createCustomer(array $aData = []);

    // --------------------------------------------------------------------------

    /**
     * Convinience method for retrieving an existing customer from the gateway
     *
     * @param mixed $mCustomerId The gateway's customer ID
     * @param array $aData       Any driver specific data
     *
     * @return mixed
     */
    public function getCustomer($mCustomerId, array $aData = []);

    // --------------------------------------------------------------------------

    /**
     * Convinience method for updating an existing customer on the gateway
     *
     * @param mixed $mCustomerId The gateway's customer ID
     * @param array $aData       The driver specific customer data
     */
    public function updateCustomer($mCustomerId, array $aData = []);

    // --------------------------------------------------------------------------

    /**
     * Convinience method for deleting an existing customer on the gateway
     *
     * @param mixed $mCustomerId The gateway's customer ID
     */
    public function deleteCustomer($mCustomerId);
}


text:
package com.sequenceiq.freeipa.api.v1.progress.docs;

public class ProgressOperationDescriptions {

    public static final String NOTES = "Flow operation progress";
    public static final String GET_LAST_FLOW_PROGRESS = "Get last flow operation progress details for resource by resource crn";
    public static final String LIST_FLOW_PROGRESS = "List recent flow operations progress details for resource by resource crn";

    private ProgressOperationDescriptions() {
    }
}


text:
"use strict";

var passportLocalSequelize = require('passport-local-sequelize');

module.exports = function(sequelize, DataTypes) {
  var User = passportLocalSequelize.defineUser(sequelize, {
    stravaID: { type: DataTypes.INTEGER, allowNull: true, defaultValue: null },
    stravaAuthToken: { type: DataTypes.STRING, allowNull: true, defaultValue: null },
  }, {
    classMethods: {
      associate: function(models) {
        User.hasMany(models.Task)
      }
    }
  });

  return User;
}


text:
title: Telerik.Web.UI.PivotGridDataZone
page_title: Telerik.Web.UI.PivotGridDataZone
description: Telerik.Web.UI.PivotGridDataZone
---

# Telerik.Web.UI.PivotGridDataZone

Represents the row fields zone of Telerik.Web.UI.RadPivotGrid .

## Inheritance Hierarchy

* System.Object
* System.Web.UI.Control
* System.Web.UI.WebControls.WebControl
* System.Web.UI.WebControls.TableCell
* Telerik.Web.UI.PivotGridTableCell
* Telerik.Web.UI.PivotGridCell
* Telerik.Web.UI.PivotGridZone
* Telerik.Web.UI.PivotGridDataZone


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff">

    <com.handmark.pulltorefresh.library.PullToRefreshListView
        android:id="@+id/expand_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>


text:
using System.Collections.Generic;
using Newtonsoft.Json;
using TMDbLib.Objects.General;

namespace TMDbLib.Objects.TvShows
{
    public class TvEpisode : TvEpisodeBase
    {
        [JsonProperty("account_states")]
        public TvAccountState AccountStates { get; set; }

        [JsonProperty("credits")]
        public CreditsWithGuestStars Credits { get; set; }

        [JsonProperty("crew")]
        public List<Crew> Crew { get; set; }

        [JsonProperty("external_ids")]
        public ExternalIdsTvEpisode ExternalIds { get; set; }

        [JsonProperty("guest_stars")]
        public List<Cast> GuestStars { get; set; }

        [JsonProperty("images")]
        public StillImages Images { get; set; }

        [JsonProperty("videos")]
        public ResultContainer<Video> Videos { get; set; }
    }
}


text:
Rails.application.routes.draw do

  resources :pictures

end


text:
        <input class="form-control component-filter-input">

            <button type="button" class="btn btn-primary">Search</button>

    <button type="button" class="btn btn-success newcomponent" style="float:right">

        New Component
    </button>

                Component Name
                Version


text:
package com.turkcell.gelecegiyazanlar.fragments;

import android.animation.Animator;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.turkcell.gelecegiyazanlar.R;
import com.turkcell.gelecegiyazanlar.activities.EgitimBaslikActivity;
import com.turkcell.gelecegiyazanlar.designs.SlidingTabLayoutIcon;
import com.turkcell.gelecegiyazanlar.models.Egitim;

/**
 * Web Sayfasýnýn Fragmentý
 */

public class OyunFragment extends Fragment implements View.OnClickListener {

    LinearLayout ust_layout, oyun, oyunIcerik;

    LinearLayout oyun101, oyun101Layout, oyun201, oyun201Layout;

    SlidingTabLayoutIcon tablar;
    ImageView oyunSagOk, oyun101AsagiOk, oyun201AsagiOk, egitimiAl101, egitimiAl201;
    Toolbar toolbar;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        toolbar = (Toolbar) getActivity().findViewById(R.id.tool_bar);
        View rootView = inflater.inflate(R.layout.fragment_oyun, container, false);

        oyun = (LinearLayout) rootView.findViewById(R.id.oyun);
        oyunIcerik = (LinearLayout) rootView.findViewById(R.id.layout_oyun_icerik);
        oyunSagOk = (ImageView) rootView.findViewById(R.id.oyunsagok);

        oyun101AsagiOk = (ImageView) rootView.findViewById(R.id.asagi_image_101_oyun);
        oyun101 = (LinearLayout) rootView.findViewById(R.id.egitimal_oyun_101);
        oyun101Layout = (LinearLayout) rootView.findViewById(R.id.layout_oyun_101);

        oyun201AsagiOk = (ImageView) rootView.findViewById(R.id.asagi_image_201_oyun);
        oyun201 = (LinearLayout) rootView.findViewById(R.id.egitimal_oyun_201);
        oyun201Layout = (LinearLayout) rootView.findViewById(R.id.layout_oyun_201);

        ust_layout = (LinearLayout) getActivity().findViewById(R.id.ustekran);
        tablar = (SlidingTabLayoutIcon) getActivity().findViewById(R.id.tabs);

        oyun.setOnClickListener(this);
        oyun101Layout.setOnClickListener(this);
        oyun201Layout.setOnClickListener(this);
        oyun101.setOnClickListener(this);
        oyun201.setOnClickListener(this);

        return rootView;
    }

    @Override
    public void onClick(View v) {
        Intent i = null;
        switch (v.getId()) {

            case R.id.oyun:
                if (oyunIcerik.getVisibility() == View.VISIBLE) {
                    oyunIcerik.setVisibility(View.GONE);
                    goster();
                    tablar.setVisibility(View.VISIBLE);
                    oyunSagOk.setImageDrawable(getResources().getDrawable(R.drawable.sagok));
                } else {
                    oyunIcerik.setVisibility(View.VISIBLE);
                    sakla();
                    tablar.setVisibility(View.GONE);
                    oyunSagOk.setImageDrawable(getResources().getDrawable(R.drawable.asagiok));
                }
                break;

            case R.id.layout_oyun_101:
                if (oyun101.getVisibility() == View.VISIBLE) {
                    oyun101.setVisibility(View.GONE);
                    oyun101AsagiOk.setImageResource(R.drawable.asagiikon);
                } else {
                    oyun101.setVisibility(View.VISIBLE);
                    oyun101AsagiOk.setImageResource(R.drawable.yukariikon);
                }
                break;

            case R.id.layout_oyun_201:
                if (oyun201.getVisibility() == View.VISIBLE) {
                    oyun201.setVisibility(View.GONE);
                    oyun201AsagiOk.setImageResource(R.drawable.asagiikon);
                } else {
                    oyun201.setVisibility(View.VISIBLE);
                    oyun201AsagiOk.setImageResource(R.drawable.yukariikon);
                }
                break;
            case R.id.egitimal_oyun_101:
                i = new Intent(getActivity(), EgitimBaslikActivity.class);
                i.putExtra(Egitim.TITLE_TAG, "Oyun Geliþtirme 101");
                i.putExtra(Egitim.COLOR_TAG, "oyun");
                i.putExtra(Egitim.NODE_ID, getResources().getString(R.string.oyun101));
                startActivity(i);
                break;

            case R.id.egitimal_oyun_201:
                i = new Intent(getActivity(), EgitimBaslikActivity.class);
                i.putExtra(Egitim.TITLE_TAG, "Oyun Geliþtirme 201");
                i.putExtra(Egitim.COLOR_TAG, "oyun");
                i.putExtra(Egitim.NODE_ID, getResources().getString(R.string.oyun201));
                startActivity(i);
                break;

        }

    }

    public void sakla() {
        ust_layout.animate().translationY(-ust_layout.getBottom() - toolbar.getBottom()).setInterpolator(new AccelerateInterpolator(2))
                .setListener(new Animator.AnimatorListener() {
                    @Override
                    public void onAnimationStart(Animator animation) {

                    }

                    @Override
                    public void onAnimationEnd(Animator animation) {
                        ust_layout.setVisibility(View.GONE);
                    }

                    @Override
                    public void onAnimationCancel(Animator animation) {

                    }

                    @Override
                    public void onAnimationRepeat(Animator animation) {

                    }
                }).start();
    }

    public void goster() {
        ust_layout.animate().translationY(0).setInterpolator(new DecelerateInterpolator(2))
                .setListener(new Animator.AnimatorListener() {
                    @Override
                    public void onAnimationStart(Animator animation) {
                        ust_layout.setVisibility(View.VISIBLE);
                    }

                    @Override
                    public void onAnimationEnd(Animator animation) {

                    }

                    @Override
                    public void onAnimationCancel(Animator animation) {

                    }

                    @Override
                    public void onAnimationRepeat(Animator animation) {

                    }
                }).start();
    }
}


text:
package com.foc.vaadin.gui.components.tableAndTree;

import com.foc.Globals;
import com.foc.vaadin.gui.components.FVTableColumn;
import com.vaadin.ui.Table;

@SuppressWarnings("serial")
public class FVColGen_TreeNodeTitle extends FVColumnGenerator {

	public FVColGen_TreeNodeTitle(FVTableColumn tableColumn) {
		super(tableColumn);
	}

	@Override
	public Object generateCell(Table source, Object itemId, Object columnId) {
		String propertyString = null;
		try{
//			FTree tree = null;
//			tree = ((FVTreeTable) getTreeOrTable()).getFTree();
//			FNode node = tree.vaadin_FindNode(itemId);
//			FProperty property = tree != null && node != null ? tree.getTreeSpecialProperty(node) : null;
//			if(property != null){
//				propertyString = (String) property.vaadin_TableDisplayObject(null, null);
//			}else if(node != null){
//				propertyString = node.getDisplayTitle();
//			}
			propertyString = getTableTreeDelegate() != null ? getTableTreeDelegate().getNodeTitleDisplayStringForObjectRef(itemId) : null;
		}catch (Exception e){
			Globals.logException(e);
		}
		return propertyString;
	}
}


text:
<?php
$meta = $data['meta'];
$id = $meta['ID'];

$the_content = $data['the_content'];

//$placement_class = empty( $meta['aside-image-placement'] ) ? '' : 'mab-aside-' . $meta['aside-image-placement'];

$placement_class = '';
if( !empty( $meta['aside-image-placement'] ) || !empty( $meta['aside']['placement'] ) ){
	$placement_class = 'mab-aside-';
	$placement_class .= empty( $meta['aside']['placement'] ) ? $meta['aside-image-placement'] : $meta['aside']['placement'];
}

/*$image_width = empty( $meta['aside-image-width'] ) ? '' : 'width="' . $meta['aside-image-width'] . '"';
$image_height = empty( $meta['aside-image-height'] ) ? '' : 'height="' . $meta['aside-image-height'] . '"';*/
if( isset( $meta['aside']['type'] ) ){
	$placement_class .= ' mab-aside-type-' . $meta['aside']['type'];
} else {
	$placement_class .= !empty( $meta['aside-image-url'] ) ? ' mab-aside-type-image' : ' mab-aside-type-none';
}

//this to have unique ID of the main containing div in case there is more than action box with the same id
$html_id = $data['mab-html-id'];

$mab_classes = $data['class'];

$html_data = $data['html-data'];

$inline_style = $data['inline-style'];

?><div id="mab-<?php echo $html_id; ?>" <?php echo $mab_classes; ?> <?php echo $html_data; ?> <?php echo $inline_style; ?>>
	<div class="mab-pad mab-wrap <?php echo $placement_class; ?>">
		<?php include 'aside.php'; ?>

			<?php if( !empty( $meta['main-heading'] ) ) : //HEADING ?>

<?php echo do_shortcode($meta['main-heading']); ?>

			<?php endif; ?>
			<?php if( !empty( $meta['subheading'] ) ) : ?>

<?php echo do_shortcode($meta['subheading']); //SUBHEADING ?>

			<?php endif; ?>
			<?php if( !empty( $meta['main-copy'] ) ) : //MAIN COPY ?>

<?php echo do_shortcode(wpautop($meta['main-copy'])); ?>

			<?php endif; ?>

				<?php echo $the_content; ?>

			<?php if( !empty( $meta['secondary-copy'] ) ) : //SECONDARY COPY?>

<?php echo do_shortcode(wpautop($meta['secondary-copy'])); ?>

			<?php endif; ?>

		<?php
		$clearing_div = '

';
		echo apply_filters( 'mab_clearing_div', $clearing_div ); ?>

	<?php if(current_user_can('manage_options')): ?>
	<a class="mab-edit" href="<?php echo get_edit_post_link($id); ?>" target="_blank">edit
	<?php endif; ?>


text:
package com.adgear.anoa.read;

import com.google.protobuf.Message;

import com.adgear.anoa.AnoaReflectionUtils;

class ProtobufReader<R extends Message> extends AbstractRecordReader<R, ProtobufFieldWrapper> {

  final private Message.Builder clearBuilderInstance;

  ProtobufReader(Message.Builder builder) {
    super(builder.clone().clear().getDescriptorForType().getFields().stream()
              .map(field -> new ProtobufFieldWrapper(field, builder)));
    this.clearBuilderInstance = builder.clone().clear();
  }

  ProtobufReader(Class<R> recordClass) {
    this((Message.Builder) AnoaReflectionUtils.getProtobufBuilder(recordClass));
  }

  @Override
  protected RecordWrapper<R, ProtobufFieldWrapper> newWrappedInstance() {
    return new ProtobufRecordWrapper<>(clearBuilderInstance);
  }
}


text:
"""This module implements a loader and dumper for the svmlight format

This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.

The first element of each line can be used to store a target variable to
predict.

This format is used as the default format for both svmlight and the
libsvm command line programs.
"""

# Authors: Mathieu Blondel <mathieu@mblondel.org>
#          Lars Buitinck
#          Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause

from contextlib import closing
import io
import os.path

import numpy as np
import scipy.sparse as sp

from .. import __version__

from ..utils import check_array, IS_PYPY
from ..utils.validation import _deprecate_positional_args

if not IS_PYPY:
    from ._svmlight_format_fast import _load_svmlight_file
else:
    def _load_svmlight_file(*args, **kwargs):
        raise NotImplementedError(
                'load_svmlight_file is currently not '
                'compatible with PyPy (see '
                'https://github.com/scikit-learn/scikit-learn/issues/11543 '
                'for the status updates).')

@_deprecate_positional_args
def load_svmlight_file(f, *, n_features=None, dtype=np.float64,
                       multilabel=False, zero_based="auto", query_id=False,
                       offset=0, length=-1):
    """Load datasets in the svmlight / libsvm format into sparse CSR matrix

    This format is a text-based format, with one sample per line. It does
    not store zero valued features hence is suitable for sparse dataset.

    The first element of each line can be used to store a target variable
    to predict.

    This format is used as the default format for both svmlight and the
    libsvm command line programs.

    Parsing a text based source can be expensive. When working on
    repeatedly on the same dataset, it is recommended to wrap this
    loader with joblib.Memory.cache to store a memmapped backup of the
    CSR results of the first call and benefit from the near instantaneous
    loading of memmapped structures for the subsequent calls.

    In case the file contains a pairwise preference constraint (known
    as "qid" in the svmlight format) these are ignored unless the
    query_id parameter is set to True. These pairwise preference
    constraints can be used to constraint the combination of samples
    when using pairwise loss functions (as is the case in some
    learning to rank problems) so that only pairs with the same
    query_id value are considered.

    This implementation is written in Cython and is reasonably fast.
    However, a faster API-compatible loader is also available at:

      https://github.com/mblondel/svmlight-loader

    Parameters
    ----------
    f : str, file-like or int
        (Path to) a file to load. If a path ends in ".gz" or ".bz2", it will
        be uncompressed on the fly. If an integer is passed, it is assumed to
        be a file descriptor. A file-like or file descriptor will not be closed
        by this function. A file-like object must be opened in binary mode.

    n_features : int, default=None
        The number of features to use. If None, it will be inferred. This
        argument is useful to load several files that are subsets of a
        bigger sliced dataset: each subset might not have examples of
        every feature, hence the inferred shape might vary from one
        slice to another.
        n_features is only required if ``offset`` or ``length`` are passed a
        non-default value.

    dtype : numpy data type, default=np.float64
        Data type of dataset to be loaded. This will be the data type of the
        output numpy arrays ``X`` and ``y``.

    multilabel : bool, default=False
        Samples may have several labels each (see
        https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html)

    zero_based : bool or "auto", default="auto"
        Whether column indices in f are zero-based (True) or one-based
        (False). If column indices are one-based, they are transformed to
        zero-based to match Python/NumPy conventions.
        If set to "auto", a heuristic check is applied to determine this from
        the file contents. Both kinds of files occur "in the wild", but they
        are unfortunately not self-identifying. Using "auto" or True should
        always be safe when no ``offset`` or ``length`` is passed.
        If ``offset`` or ``length`` are passed, the "auto" mode falls back
        to ``zero_based=True`` to avoid having the heuristic check yield
        inconsistent results on different segments of the file.

    query_id : bool, default=False
        If True, will return the query_id array for each file.

    offset : int, default=0
        Ignore the offset first bytes by seeking forward, then
        discarding the following bytes up until the next new line
        character.

    length : int, default=-1
        If strictly positive, stop reading any new line of data once the
        position in the file has reached the (offset + length) bytes threshold.

    Returns
    -------
    X : scipy.sparse matrix of shape (n_samples, n_features)

    y : ndarray of shape (n_samples,), or, in the multilabel a list of
        tuples of length n_samples.

    query_id : array of shape (n_samples,)
       query_id for each sample. Only returned when query_id is set to
       True.

    See also
    --------
    load_svmlight_files: similar function for loading multiple files in this
                         format, enforcing the same number of features/columns
                         on all of them.

    Examples
    --------
    To use joblib.Memory to cache the svmlight file::

        from joblib import Memory
        from .datasets import load_svmlight_file
        mem = Memory("./mycache")

        @mem.cache
        def get_data():
            data = load_svmlight_file("mysvmlightfile")
            return data[0], data[1]

        X, y = get_data()
    """
    return tuple(load_svmlight_files([f], n_features=n_features,
                                     dtype=dtype,
                                     multilabel=multilabel,
                                     zero_based=zero_based,
                                     query_id=query_id,
                                     offset=offset,
                                     length=length))

def _gen_open(f):
    if isinstance(f, int):  # file descriptor
        return io.open(f, "rb", closefd=False)
    elif not isinstance(f, str):
        raise TypeError("expected {str, int, file-like}, got %s" % type(f))

    _, ext = os.path.splitext(f)
    if ext == ".gz":
        import gzip
        return gzip.open(f, "rb")
    elif ext == ".bz2":
        from bz2 import BZ2File
        return BZ2File(f, "rb")
    else:
        return open(f, "rb")

def _open_and_load(f, dtype, multilabel, zero_based, query_id,
                   offset=0, length=-1):
    if hasattr(f, "read"):
        actual_dtype, data, ind, indptr, labels, query = \
            _load_svmlight_file(f, dtype, multilabel, zero_based, query_id,
                                offset, length)
    else:
        with closing(_gen_open(f)) as f:
            actual_dtype, data, ind, indptr, labels, query = \
                _load_svmlight_file(f, dtype, multilabel, zero_based, query_id,
                                    offset, length)

    # convert from array.array, give data the right dtype
    if not multilabel:
        labels = np.frombuffer(labels, np.float64)
    data = np.frombuffer(data, actual_dtype)
    indices = np.frombuffer(ind, np.longlong)
    indptr = np.frombuffer(indptr, dtype=np.longlong)   # never empty
    query = np.frombuffer(query, np.int64)

    data = np.asarray(data, dtype=dtype)    # no-op for float{32,64}
    return data, indices, indptr, labels, query

@_deprecate_positional_args
def load_svmlight_files(files, *, n_features=None, dtype=np.float64,
                        multilabel=False, zero_based="auto", query_id=False,
                        offset=0, length=-1):
    """Load dataset from multiple files in SVMlight format

    This function is equivalent to mapping load_svmlight_file over a list of
    files, except that the results are concatenated into a single, flat list
    and the samples vectors are constrained to all have the same number of
    features.

    In case the file contains a pairwise preference constraint (known
    as "qid" in the svmlight format) these are ignored unless the
    query_id parameter is set to True. These pairwise preference
    constraints can be used to constraint the combination of samples
    when using pairwise loss functions (as is the case in some
    learning to rank problems) so that only pairs with the same
    query_id value are considered.

    Parameters
    ----------
    files : array-like, dtype=str, file-like or int
        (Paths of) files to load. If a path ends in ".gz" or ".bz2", it will
        be uncompressed on the fly. If an integer is passed, it is assumed to
        be a file descriptor. File-likes and file descriptors will not be
        closed by this function. File-like objects must be opened in binary
        mode.

    n_features : int, default=None
        The number of features to use. If None, it will be inferred from the
        maximum column index occurring in any of the files.

        This can be set to a higher value than the actual number of features
        in any of the input files, but setting it to a lower value will cause
        an exception to be raised.

    dtype : numpy data type, default=np.float64
        Data type of dataset to be loaded. This will be the data type of the
        output numpy arrays ``X`` and ``y``.

    multilabel : bool, default=False
        Samples may have several labels each (see
        https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html)

    zero_based : bool or "auto", default="auto"
        Whether column indices in f are zero-based (True) or one-based
        (False). If column indices are one-based, they are transformed to
        zero-based to match Python/NumPy conventions.
        If set to "auto", a heuristic check is applied to determine this from
        the file contents. Both kinds of files occur "in the wild", but they
        are unfortunately not self-identifying. Using "auto" or True should
        always be safe when no offset or length is passed.
        If offset or length are passed, the "auto" mode falls back
        to zero_based=True to avoid having the heuristic check yield
        inconsistent results on different segments of the file.

    query_id : bool, default=False
        If True, will return the query_id array for each file.

    offset : int, default=0
        Ignore the offset first bytes by seeking forward, then
        discarding the following bytes up until the next new line
        character.

    length : int, default=-1
        If strictly positive, stop reading any new line of data once the
        position in the file has reached the (offset + length) bytes threshold.

    Returns
    -------
    [X1, y1, ..., Xn, yn]
    where each (Xi, yi) pair is the result from load_svmlight_file(files[i]).

    If query_id is set to True, this will return instead [X1, y1, q1,
    ..., Xn, yn, qn] where (Xi, yi, qi) is the result from
    load_svmlight_file(files[i])

    Notes
    -----
    When fitting a model to a matrix X_train and evaluating it against a
    matrix X_test, it is essential that X_train and X_test have the same
    number of features (X_train.shape[1] == X_test.shape[1]). This may not
    be the case if you load the files individually with load_svmlight_file.

    See also
    --------
    load_svmlight_file
    """
    if (offset != 0 or length > 0) and zero_based == "auto":
        # disable heuristic search to avoid getting inconsistent results on
        # different segments of the file
        zero_based = True

    if (offset != 0 or length > 0) and n_features is None:
        raise ValueError(
            "n_features is required when offset or length is specified.")

    r = [_open_and_load(f, dtype, multilabel, bool(zero_based), bool(query_id),
                        offset=offset, length=length)
         for f in files]

    if (zero_based is False or
            zero_based == "auto" and all(len(tmp[1]) and np.min(tmp[1]) > 0
                                         for tmp in r)):
        for _, indices, _, _, _ in r:
            indices -= 1

    n_f = max(ind[1].max() if len(ind[1]) else 0 for ind in r) + 1

    if n_features is None:
        n_features = n_f
    elif n_features < n_f:
        raise ValueError("n_features was set to {},"
                         " but input file contains {} features"
                         .format(n_features, n_f))

    result = []
    for data, indices, indptr, y, query_values in r:
        shape = (indptr.shape[0] - 1, n_features)
        X = sp.csr_matrix((data, indices, indptr), shape)
        X.sort_indices()
        result += X, y
        if query_id:
            result.append(query_values)

    return result

def _dump_svmlight(X, y, f, multilabel, one_based, comment, query_id):
    X_is_sp = int(hasattr(X, "tocsr"))
    y_is_sp = int(hasattr(y, "tocsr"))
    if X.dtype.kind == 'i':
        value_pattern = "%d:%d"
    else:
        value_pattern = "%d:%.16g"

    if y.dtype.kind == 'i':
        label_pattern = "%d"
    else:
        label_pattern = "%.16g"

    line_pattern = "%s"
    if query_id is not None:
        line_pattern += " qid:%d"
    line_pattern += " %s\n"

    if comment:
        f.write(("# Generated by dump_svmlight_file from scikit-learn %s\n"
                % __version__).encode())
        f.write(("# Column indices are %s-based\n"
                % ["zero", "one"][one_based]).encode())

        f.write(b"#\n")
        f.writelines(b"# %s\n" % line for line in comment.splitlines())

    for i in range(X.shape[0]):
        if X_is_sp:
            span = slice(X.indptr[i], X.indptr[i + 1])
            row = zip(X.indices[span], X.data[span])
        else:
            nz = X[i] != 0
            row = zip(np.where(nz)[0], X[i, nz])

        s = " ".join(value_pattern % (j + one_based, x) for j, x in row)

        if multilabel:
            if y_is_sp:
                nz_labels = y[i].nonzero()[1]
            else:
                nz_labels = np.where(y[i] != 0)[0]
            labels_str = ",".join(label_pattern % j for j in nz_labels)
        else:
            if y_is_sp:
                labels_str = label_pattern % y.data[i]
            else:
                labels_str = label_pattern % y[i]

        if query_id is not None:
            feat = (labels_str, query_id[i], s)
        else:
            feat = (labels_str, s)

        f.write((line_pattern % feat).encode('ascii'))

@_deprecate_positional_args
def dump_svmlight_file(X, y, f, *, zero_based=True, comment=None,
                       query_id=None,
                       multilabel=False):
    """Dump the dataset in svmlight / libsvm file format.

    This format is a text-based format, with one sample per line. It does
    not store zero valued features hence is suitable for sparse dataset.

    The first element of each line can be used to store a target variable
    to predict.

    Parameters
    ----------
    X : {array-like, sparse matrix} of shape (n_samples, n_features)
        Training vectors, where n_samples is the number of samples and
        n_features is the number of features.

    y : {array-like, sparse matrix}, shape = [n_samples (, n_labels)]
        Target values. Class labels must be an
        integer or float, or array-like objects of integer or float for
        multilabel classifications.

    f : string or file-like in binary mode
        If string, specifies the path that will contain the data.
        If file-like, data will be written to f. f should be opened in binary
        mode.

    zero_based : boolean, optional
        Whether column indices should be written zero-based (True) or one-based
        (False).

    comment : string, optional
        Comment to insert at the top of the file. This should be either a
        Unicode string, which will be encoded as UTF-8, or an ASCII byte
        string.
        If a comment is given, then it will be preceded by one that identifies
        the file as having been dumped by scikit-learn. Note that not all
        tools grok comments in SVMlight files.

    query_id : array-like of shape (n_samples,)
        Array containing pairwise preference constraints (qid in svmlight
        format).

    multilabel : boolean, optional
        Samples may have several labels each (see
        https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html)

        .. versionadded:: 0.17
           parameter *multilabel* to support multilabel datasets.
    """
    if comment is not None:
        # Convert comment string to list of lines in UTF-8.
        # If a byte string is passed, then check whether it's ASCII;
        # if a user wants to get fancy, they'll have to decode themselves.
        # Avoid mention of str and unicode types for Python 3.x compat.
        if isinstance(comment, bytes):
            comment.decode("ascii")  # just for the exception
        else:
            comment = comment.encode("utf-8")
        if b"\0" in comment:
            raise ValueError("comment string contains NUL byte")

    yval = check_array(y, accept_sparse='csr', ensure_2d=False)
    if sp.issparse(yval):
        if yval.shape[1] != 1 and not multilabel:
            raise ValueError("expected y of shape (n_samples, 1),"
                             " got %r" % (yval.shape,))
    else:
        if yval.ndim != 1 and not multilabel:
            raise ValueError("expected y of shape (n_samples,), got %r"
                             % (yval.shape,))

    Xval = check_array(X, accept_sparse='csr')
    if Xval.shape[0] != yval.shape[0]:
        raise ValueError(
            "X.shape[0] and y.shape[0] should be the same, got"
            " %r and %r instead." % (Xval.shape[0], yval.shape[0])
        )

    # We had some issues with CSR matrices with unsorted indices (e.g. #1501),
    # so sort them here, but first make sure we don't modify the user's X.
    # TODO We can do this cheaper; sorted_indices copies the whole matrix.
    if yval is y and hasattr(yval, "sorted_indices"):
        y = yval.sorted_indices()
    else:
        y = yval
        if hasattr(y, "sort_indices"):
            y.sort_indices()

    if Xval is X and hasattr(Xval, "sorted_indices"):
        X = Xval.sorted_indices()
    else:
        X = Xval
        if hasattr(X, "sort_indices"):
            X.sort_indices()

    if query_id is not None:
        query_id = np.asarray(query_id)
        if query_id.shape[0] != y.shape[0]:
            raise ValueError("expected query_id of shape (n_samples,), got %r"
                             % (query_id.shape,))

    one_based = not zero_based

    if hasattr(f, "write"):
        _dump_svmlight(X, y, f, multilabel, one_based, comment, query_id)
    else:
        with open(f, "wb") as f:
            _dump_svmlight(X, y, f, multilabel, one_based, comment, query_id)


text:
set -e

echo "-# Produce a NetCDF file from grib edition 1"
echo "\\verbatim"
echo ">grib_to_netcdf -o output.nc input.grib1"
echo "\\endverbatim"

echo "-# If your grib file has analysis and 6-hour forecast, then ignore keys 'type' and 'step'. Thus type=an/fc and step=00/06 will not be considered as netcdf dimensions."
echo "\\verbatim"
echo ">grib_to_netcdf -I type,step -o output.nc input.grib"
echo "\\endverbatim"

echo "-# Do not use time of validity. If time of validity is used, it means the 1D time coordinate is considered as date+time+step, otherwise 3 different dimensions are created."
echo "The default behaviour is to use the time of validity."
echo "\\verbatim"
echo ">grib_to_netcdf -T -o output.nc input.grib"
echo "\\endverbatim"

echo "-# Produce NetCDF with data type of FLOAT (32bit floating point, for higher precision)."
echo "Note these types were chosen to provide a reasonably wide range of trade-offs between data precision and number of bits required for each value"
echo "\\verbatim"
echo ">grib_to_netcdf -D NC_FLOAT -o output.nc input.grib"
echo "\\endverbatim"

echo "-# Set the netcdf dimension 'time' to be unlimited i.e. time can have unlimited length so variables using this dimension can grow along this dimension."
echo "\\verbatim"
echo ">grib_to_netcdf -u time -o output.nc input.grib"
echo "\\endverbatim"


text:
package org.apache.wicket.markup;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.WicketTestCase;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.RefreshingView;
import org.apache.wicket.markup.repeater.util.ModelIteratorAdapter;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.StringResourceStream;
import org.junit.Test;

/**
 * Tests child's {@link Component#onRemove} is on refresh
 *
 * @author igor
 */
public class RefreshingViewOnRemoveTest extends WicketTestCase
{
	private final List<TestComponent> components = new ArrayList<TestComponent>();
	private int round = 1;

	/**
	 * test()
	 */
	@Test
	public void test()
	{
		tester.startPage(new TestPage());

		// check everything was detached
		for (TestComponent c : components)
		{
			assertTrue("Component " + c + " is not detached.", c.detached);
		}

		round++;
		tester.startPage(tester.getLastRenderedPage());

		// check everything was detached
		for (TestComponent c : components)
		{
			assertTrue(c.detached);
		}

		// check we have round 1 and round 2 components
		boolean round1 = false;
		boolean round2 = false;
		for (TestComponent c : components)
		{
			if (c.round == 1)
				round1 = true;
			if (c.round == 2)
				round2 = true;
		}
		assertTrue(round1);
		assertTrue(round2);

		// check onremove was called on all round 1 components
		for (TestComponent c : components)
		{
			if (c.round == 1)
				assertTrue(c.removed);
		}

	}

	protected Component newComponent(String id)
	{
		TestComponent c = new TestComponent(id, round);
		components.add(c);
		return c;
	}

	static class TestComponent extends Label
	{
		private static final long serialVersionUID = 1L;
		public boolean detached = false;
		public boolean removed = false;
		public final int round;

		public TestComponent(String id, int round)
		{
			super(id, id);
			this.round = round;
		}

		@Override
		protected void onDetach()
		{
			super.onDetach();
			detached = true;
		}

		@Override
		protected void onRemove()
		{
			super.onRemove();
			removed = true;
		}
	}

	class TestPage extends WebPage implements IMarkupResourceStreamProvider
	{
		private static final long serialVersionUID = 1L;

		public TestPage()
		{
			add(new RefreshingView<Integer>("repeater")
			{
				private static final long serialVersionUID = 1L;

				@Override
				protected Iterator<IModel<Integer>> getItemModels()
				{
					return new ModelIteratorAdapter<Integer>(Arrays.asList(new Integer[] { 1, 2 })
						.iterator())
					{
						@Override
						protected IModel<Integer> model(Integer object)
						{
							return Model.of(object);
						}
					};
				}

				@Override
				protected void populateItem(Item<Integer> item)
				{
					item.add(newComponent("label"));
				}
			});
		}

		@Override
		public IResourceStream getMarkupResourceStream(MarkupContainer container,
			Class<?> containerClass)
		{
			return new StringResourceStream(
				"

");
		}
	}
}


text:
package com.amazonaws.services.certificatemanager.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ImportCertificateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The Amazon Resource Name
     * (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
     *

     */
    private String certificateArn;
    /**
     *

     * The certificate to import. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must contain a 1024-bit or 2048-bit RSA public key.
     *

     *

     *

     *

     * Must be valid at the time of import. You cannot import a certificate before its validity period begins (the
     * certificate's NotBefore date) or after it expires (the certificate's NotAfter date).
     *

     *

     *

     */
    private java.nio.ByteBuffer certificate;
    /**
     *

     * The private key that matches the public key in the certificate. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must be unencrypted. You cannot import a private key that is protected by a password or passphrase.
     *

     *

     *

     */
    private java.nio.ByteBuffer privateKey;
    /**
     *

     * The certificate chain. It must be PEM-encoded.
     *

     */
    private java.nio.ByteBuffer certificateChain;

    /**
     *

     * The Amazon Resource Name
     * (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
     *

     *
     * @param certificateArn
     *        The Amazon Resource
     *        Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
     */

    public void setCertificateArn(String certificateArn) {
        this.certificateArn = certificateArn;
    }

    /**
     *

     * The Amazon Resource Name
     * (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
     *

     *
     * @return The Amazon Resource
     *         Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
     */

    public String getCertificateArn() {
        return this.certificateArn;
    }

    /**
     *

     * The Amazon Resource Name
     * (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
     *

     *
     * @param certificateArn
     *        The Amazon Resource
     *        Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ImportCertificateRequest withCertificateArn(String certificateArn) {
        setCertificateArn(certificateArn);
        return this;
    }

    /**
     *

     * The certificate to import. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must contain a 1024-bit or 2048-bit RSA public key.
     *

     *

     *

     *

     * Must be valid at the time of import. You cannot import a certificate before its validity period begins (the
     * certificate's NotBefore date) or after it expires (the certificate's NotAfter date).
     *

     *

     *

     *

     * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
     * Users of the SDK should not perform Base64 encoding on this field.
     *

     *

     * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
     * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
     * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
     * major version of the SDK.
     *

     *
     * @param certificate
     *        The certificate to import. It must meet the following requirements:

     *

     *

     *

     *        Must be PEM-encoded.
     *

     *

     *

     *

     *        Must contain a 1024-bit or 2048-bit RSA public key.
     *

     *

     *

     *

     *        Must be valid at the time of import. You cannot import a certificate before its validity period begins
     *        (the certificate's NotBefore date) or after it expires (the certificate's
     *        NotAfter date).
     *

     *

     */

    public void setCertificate(java.nio.ByteBuffer certificate) {
        this.certificate = certificate;
    }

    /**
     *

     * The certificate to import. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must contain a 1024-bit or 2048-bit RSA public key.
     *

     *

     *

     *

     * Must be valid at the time of import. You cannot import a certificate before its validity period begins (the
     * certificate's NotBefore date) or after it expires (the certificate's NotAfter date).
     *

     *

     *

     *

     * {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
     * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
     * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
     * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
     * {@code position}.
     *

     *
     * @return The certificate to import. It must meet the following requirements:

     *

     *

     *

     *         Must be PEM-encoded.
     *

     *

     *

     *

     *         Must contain a 1024-bit or 2048-bit RSA public key.
     *

     *

     *

     *

     *         Must be valid at the time of import. You cannot import a certificate before its validity period begins
     *         (the certificate's NotBefore date) or after it expires (the certificate's
     *         NotAfter date).
     *

     *

     */

    public java.nio.ByteBuffer getCertificate() {
        return this.certificate;
    }

    /**
     *

     * The certificate to import. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must contain a 1024-bit or 2048-bit RSA public key.
     *

     *

     *

     *

     * Must be valid at the time of import. You cannot import a certificate before its validity period begins (the
     * certificate's NotBefore date) or after it expires (the certificate's NotAfter date).
     *

     *

     *

     *

     * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
     * Users of the SDK should not perform Base64 encoding on this field.
     *

     *

     * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
     * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
     * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
     * major version of the SDK.
     *

     *
     * @param certificate
     *        The certificate to import. It must meet the following requirements:

     *

     *

     *

     *        Must be PEM-encoded.
     *

     *

     *

     *

     *        Must contain a 1024-bit or 2048-bit RSA public key.
     *

     *

     *

     *

     *        Must be valid at the time of import. You cannot import a certificate before its validity period begins
     *        (the certificate's NotBefore date) or after it expires (the certificate's
     *        NotAfter date).
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ImportCertificateRequest withCertificate(java.nio.ByteBuffer certificate) {
        setCertificate(certificate);
        return this;
    }

    /**
     *

     * The private key that matches the public key in the certificate. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must be unencrypted. You cannot import a private key that is protected by a password or passphrase.
     *

     *

     *

     *

     * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
     * Users of the SDK should not perform Base64 encoding on this field.
     *

     *

     * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
     * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
     * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
     * major version of the SDK.
     *

     *
     * @param privateKey
     *        The private key that matches the public key in the certificate. It must meet the following
     *        requirements:

     *

     *

     *

     *        Must be PEM-encoded.
     *

     *

     *

     *

     *        Must be unencrypted. You cannot import a private key that is protected by a password or passphrase.
     *

     *

     */

    public void setPrivateKey(java.nio.ByteBuffer privateKey) {
        this.privateKey = privateKey;
    }

    /**
     *

     * The private key that matches the public key in the certificate. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must be unencrypted. You cannot import a private key that is protected by a password or passphrase.
     *

     *

     *

     *

     * {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
     * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
     * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
     * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
     * {@code position}.
     *

     *
     * @return The private key that matches the public key in the certificate. It must meet the following
     *         requirements:

     *

     *

     *

     *         Must be PEM-encoded.
     *

     *

     *

     *

     *         Must be unencrypted. You cannot import a private key that is protected by a password or passphrase.
     *

     *

     */

    public java.nio.ByteBuffer getPrivateKey() {
        return this.privateKey;
    }

    /**
     *

     * The private key that matches the public key in the certificate. It must meet the following requirements:
     *

     *

     *

     *

     * Must be PEM-encoded.
     *

     *

     *

     *

     * Must be unencrypted. You cannot import a private key that is protected by a password or passphrase.
     *

     *

     *

     *

     * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
     * Users of the SDK should not perform Base64 encoding on this field.
     *

     *

     * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
     * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
     * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
     * major version of the SDK.
     *

     *
     * @param privateKey
     *        The private key that matches the public key in the certificate. It must meet the following
     *        requirements:

     *

     *

     *

     *        Must be PEM-encoded.
     *

     *

     *

     *

     *        Must be unencrypted. You cannot import a private key that is protected by a password or passphrase.
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ImportCertificateRequest withPrivateKey(java.nio.ByteBuffer privateKey) {
        setPrivateKey(privateKey);
        return this;
    }

    /**
     *

     * The certificate chain. It must be PEM-encoded.
     *

     *

     * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
     * Users of the SDK should not perform Base64 encoding on this field.
     *

     *

     * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
     * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
     * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
     * major version of the SDK.
     *

     *
     * @param certificateChain
     *        The certificate chain. It must be PEM-encoded.
     */

    public void setCertificateChain(java.nio.ByteBuffer certificateChain) {
        this.certificateChain = certificateChain;
    }

    /**
     *

     * The certificate chain. It must be PEM-encoded.
     *

     *

     * {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
     * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
     * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
     * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
     * {@code position}.
     *

     *
     * @return The certificate chain. It must be PEM-encoded.
     */

    public java.nio.ByteBuffer getCertificateChain() {
        return this.certificateChain;
    }

    /**
     *

     * The certificate chain. It must be PEM-encoded.
     *

     *

     * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
     * Users of the SDK should not perform Base64 encoding on this field.
     *

     *

     * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
     * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
     * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
     * major version of the SDK.
     *

     *
     * @param certificateChain
     *        The certificate chain. It must be PEM-encoded.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ImportCertificateRequest withCertificateChain(java.nio.ByteBuffer certificateChain) {
        setCertificateChain(certificateChain);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCertificateArn() != null)
            sb.append("CertificateArn: ").append(getCertificateArn()).append(",");
        if (getCertificate() != null)
            sb.append("Certificate: ").append(getCertificate()).append(",");
        if (getPrivateKey() != null)
            sb.append("PrivateKey: ").append(getPrivateKey()).append(",");
        if (getCertificateChain() != null)
            sb.append("CertificateChain: ").append(getCertificateChain());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ImportCertificateRequest == false)
            return false;
        ImportCertificateRequest other = (ImportCertificateRequest) obj;
        if (other.getCertificateArn() == null ^ this.getCertificateArn() == null)
            return false;
        if (other.getCertificateArn() != null && other.getCertificateArn().equals(this.getCertificateArn()) == false)
            return false;
        if (other.getCertificate() == null ^ this.getCertificate() == null)
            return false;
        if (other.getCertificate() != null && other.getCertificate().equals(this.getCertificate()) == false)
            return false;
        if (other.getPrivateKey() == null ^ this.getPrivateKey() == null)
            return false;
        if (other.getPrivateKey() != null && other.getPrivateKey().equals(this.getPrivateKey()) == false)
            return false;
        if (other.getCertificateChain() == null ^ this.getCertificateChain() == null)
            return false;
        if (other.getCertificateChain() != null && other.getCertificateChain().equals(this.getCertificateChain()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getCertificateArn() == null) ? 0 : getCertificateArn().hashCode());
        hashCode = prime * hashCode + ((getCertificate() == null) ? 0 : getCertificate().hashCode());
        hashCode = prime * hashCode + ((getPrivateKey() == null) ? 0 : getPrivateKey().hashCode());
        hashCode = prime * hashCode + ((getCertificateChain() == null) ? 0 : getCertificateChain().hashCode());
        return hashCode;
    }

    @Override
    public ImportCertificateRequest clone() {
        return (ImportCertificateRequest) super.clone();
    }

}


text: "${SRCROOT}/Pods/Target Support Files/Pods-example/Pods-example-resources.sh"


text:
#ifndef WKWebArchiveResource_h
#define WKWebArchiveResource_h

#include <WebKit2/WKBase.h>

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

WK_EXPORT WKTypeID WKWebArchiveResourceGetTypeID();

WK_EXPORT WKWebArchiveResourceRef WKWebArchiveResourceCreate(WKDataRef data, WKURLRef URL, WKStringRef MIMEType, WKStringRef textEncoding);

WK_EXPORT WKDataRef WKWebArchiveResourceCopyData(WKWebArchiveResourceRef webArchiveResource);
WK_EXPORT WKURLRef WKWebArchiveResourceCopyURL(WKWebArchiveResourceRef webArchiveResource);
WK_EXPORT WKStringRef WKWebArchiveResourceCopyMIMEType(WKWebArchiveResourceRef webArchiveResource);
WK_EXPORT WKStringRef WKWebArchiveResourceCopyTextEncoding(WKWebArchiveResourceRef webArchiveResource);

#ifdef __cplusplus
}
#endif

#endif // WKWebArchiveResource_h


text:
#include "sfntly/table/bitmap/index_sub_table_format4.h"

#include "sfntly/table/bitmap/eblc_table.h"

namespace sfntly {

// static
int32_t IndexSubTableFormat4::GetDataLength(ReadableFontData* data,
                                            int32_t offset,
                                            int32_t first,
                                            int32_t last) {
  UNREFERENCED_PARAMETER(first);
  UNREFERENCED_PARAMETER(last);
  assert(data);
  return data->ReadULongAsInt(offset +
                              EblcTable::Offset::kIndexSubTable4_numGlyphs) *
         EblcTable::Offset::kCodeOffsetPairLength;
}

IndexSubTableFormat4::IndexSubTableFormat4(ReadableFontData* data,
                                           int32_t first,
                                           int32_t last)
    : IndexSubTable(data, first, last) {
}

IndexSubTableFormat4::~IndexSubTableFormat4() {
}

int32_t IndexSubTableFormat4::NumGlyphs() {
  return data_->ReadULongAsInt(EblcTable::Offset::kIndexSubTable4_numGlyphs);
}

int32_t IndexSubTableFormat4::GlyphOffset(int32_t glyph_id) {
  if (CheckGlyphRange(glyph_id)) {
    int32_t pair_index = FindCodeOffsetPair(glyph_id);
    if (pair_index < 0) {
      return -1;
    }
    return data_->ReadUShort(
               EblcTable::Offset::kIndexSubTable4_glyphArray +
               pair_index * EblcTable::Offset::kCodeOffsetPairLength +
               EblcTable::Offset::kCodeOffsetPair_offset);
  }
  return -1;
}

int32_t IndexSubTableFormat4::GlyphLength(int32_t glyph_id) {
  if (CheckGlyphRange(glyph_id)) {
    int32_t pair_index = FindCodeOffsetPair(glyph_id);
    if (pair_index < 0) {
      return -1;
    }
    return data_->ReadUShort(
               EblcTable::Offset::kIndexSubTable4_glyphArray +
               (pair_index + 1) * EblcTable::Offset::kCodeOffsetPairLength +
               EblcTable::Offset::kCodeOffsetPair_offset) -
           data_->ReadUShort(
               EblcTable::Offset::kIndexSubTable4_glyphArray +
               (pair_index) * EblcTable::Offset::kCodeOffsetPairLength +
               EblcTable::Offset::kCodeOffsetPair_offset);
  }
  return -1;
}

int32_t IndexSubTableFormat4::FindCodeOffsetPair(int32_t glyph_id) {
  return data_->SearchUShort(EblcTable::Offset::kIndexSubTable4_glyphArray,
                             EblcTable::Offset::kCodeOffsetPairLength,
                             NumGlyphs(),
                             glyph_id);
}

}  // namespace sfntly


text:
namespace RNCryptor.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            var tester = new TestRunner();
            tester.run();
        }
    }
}


text:
<?xml version="1.0" ?>
<!--
 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.
-->

<!-- Test schema file for DefaultSimilarityFactory -->

<schema name="test" version="1.0">
  <types>
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>

    <!-- TF/IDF -->
    <fieldType name="text" class="solr.TextField">
      <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
      <similarity class="solr.DefaultSimilarityFactory"/>
    </fieldType>

    <!-- TF/IDF -->
    <fieldType name="text_overlap" class="solr.TextField">
      <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
      <similarity class="solr.DefaultSimilarityFactory">
        <bool name="discountOverlaps">false</bool>
      </similarity>
    </fieldType>

  </types>

  <fields>
    <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
    <field name="text" type="text" indexed="true" stored="false"/>
    <field name="text_overlap" type="text_overlap" indexed="true" stored="false"/>
  </fields>

  <defaultSearchField>text</defaultSearchField>
  <uniqueKey>id</uniqueKey>
  <similarity class="solr.SchemaSimilarityFactory"/>
</schema>


text:
"""
Copyright (c) 2017, Battelle Memorial Institute
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.

This material was prepared as an account of work sponsored by an agency of the
United States Government. Neither the United States Government nor the United
States Department of Energy, nor Battelle, nor any of their employees, nor any
jurisdiction or organization that has cooperated in the development of these
materials, makes any warranty, express or implied, or assumes any legal
liability or responsibility for the accuracy, completeness, or usefulness or
any information, apparatus, product, software, or process disclosed, or
represents that its use would not infringe privately owned rights.

Reference herein to any specific commercial product, process, or service by
trade name, trademark, manufacturer, or otherwise does not necessarily
constitute or imply its endorsement, recommendation, or favoring by the
United States Government or any agency thereof, or Battelle Memorial Institute.
The views and opinions of authors expressed herein do not necessarily state or
reflect those of the United States Government or any agency thereof.

PACIFIC NORTHWEST NATIONAL LABORATORY
operated by
BATTELLE
for the
UNITED STATES DEPARTMENT OF ENERGY
under Contract DE-AC05-76RL01830
"""
from datetime import timedelta as td
from volttron.platform.agent.math_utils import mean
DX = '/diagnostic message'
"""Common functions used across multiple algorithms."""

def create_table_key(table_name, timestamp):
    return "&".join([table_name, timestamp.isoformat()])

def check_date(current_time, timestamp_array):
    """
    Check current timestamp with previous timestamp to verify that there are no large missing data gaps.
    :param current_time:
    :param timestamp_array:
    :return:
    """
    if not timestamp_array:
        return False
    if current_time.date() != timestamp_array[-1].date():
        if (timestamp_array[-1].date() + td(days=1) != current_time.date() or
                (timestamp_array[-1].hour != 23 and current_time.hour == 0)):
            return True
        return False

def check_run_status(timestamp_array, current_time, no_required_data, minimum_diagnostic_time=None,
                     run_schedule="hourly", minimum_point_array=None):
    """
    The diagnostics run at a regular interval (some minimum elapsed amount of time) and have a
    minimum data count requirement (each time series of data must contain some minimum number of points).
    :param timestamp_array:
    :param current_time:
    :param no_required_data:
    :param minimum_diagnostic_time:
    :param run_schedule:
    :param minimum_point_array:
    :return:
    """
    def minimum_data():
        min_data_array = timestamp_array if minimum_point_array is None else minimum_point_array
        if len(min_data_array) < no_required_data:
            return None
        return True

    if minimum_diagnostic_time is not None and timestamp_array:
        sampling_interval = td(minutes=
            round(((timestamp_array[-1] - timestamp_array[0]) / len(timestamp_array)).total_seconds() / 60))
        required_time = (timestamp_array[-1] - timestamp_array[0]) + sampling_interval
        if required_time >= minimum_diagnostic_time:
            return minimum_data()
        return False

    if run_schedule == "hourly":
        if timestamp_array and timestamp_array[-1].hour != current_time.hour:
            return minimum_data()
    elif run_schedule == "daily":
        if timestamp_array and timestamp_array[-1].date() != current_time.date():
            return minimum_data()
    return False

def setpoint_control_check(set_point_array, point_array, setpoint_deviation_threshold, dx_name, dx_offset, dx_result):
    """
    Verify that point if tracking with set point - identify potential control or sensor problems.
    :param set_point_array:
    :param point_array:
    :param allowable_deviation:
    :param dx_name:
    :param dx_offset:
    :param dx_result:
    :return:
    """
    avg_set_point = None
    diagnostic_msg = {}
    for key, threshold in setpoint_deviation_threshold.items():
        if set_point_array:
            avg_set_point = sum(set_point_array)/len(set_point_array)
            zipper = (set_point_array, point_array)
            set_point_tracking = [abs(x - y) for x, y in zip(*zipper)]
            set_point_tracking = mean(set_point_tracking)/avg_set_point*100.

            if set_point_tracking > threshold:
                # color_code = 'red'
                msg = '{} - {}: point deviating significantly from set point.'.format(key, dx_name)
                result = 1.1 + dx_offset
            else:
                # color_code = 'green'
                msg = " {} - No problem detected for {} set".format(key, dx_name)
                result = 0.0 + dx_offset
        else:
            # color_code = 'grey'
            msg = "{} - {} set point data is not available.".format(key, dx_name)
            result = 2.2 + dx_offset
        dx_result.log(msg)
        diagnostic_msg.update({key: result})
        dx_table = {dx_name + DX: diagnostic_msg}

    return avg_set_point, dx_table, dx_result

def pre_conditions(message, dx_list, analysis, cur_time, dx_result):
    """
    Check for persistence of failure to meet pre-conditions for diagnostics.
    :param message:
    :param dx_list:
    :param analysis:
    :param cur_time:
    :param dx_result:
    :return:
    """
    dx_msg = {'low': message, 'normal': message, 'high': message}
    for diagnostic in dx_list:
        dx_table = {diagnostic + DX: dx_msg}
        table_key = create_table_key(analysis, cur_time)
        dx_result.insert_table_row(table_key, dx_table)
    return dx_result


text:
package com.graphi.suicideintent.util;

import com.graphi.util.GraphObject;
import com.graphi.util.transformer.ObjectFillTransformer;
import edu.uci.ics.jung.visualization.picking.PickedInfo;
import java.awt.Color;
import java.awt.Paint;

public class SuicideFillTransformer<T extends GraphObject> extends ObjectFillTransformer<T>
{
    private Color deadColour;
    private Color deadSelectedColour;

    public SuicideFillTransformer(PickedInfo<T> pickedInfo)
    {
        super(pickedInfo);
        deadColour          =   new Color(214, 26, 45);
        deadSelectedColour  =   new Color(255, 87, 41);
    }

    @Override
    public Paint transform(T gObj)
    {
        if(((SuicideInt) gObj).isDeleted())
        {
            if(pickedInfo.isPicked(gObj)) return deadSelectedColour;
            else return deadColour;
        }

        else
            return super.transform(gObj);
    }
}