text:
package javax.swing.text;

import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Shape;
import java.awt.Toolkit;

import javax.swing.event.DocumentEvent;

/**
 * A {@link GlyphView} that caches the textattributes for most effective
 * rendering.
 *
 * @author Roman Kennke (kennke@aicas.com)
 */
public class LabelView extends GlyphView
{

  /**
   * The background color.
   */
  Color background;

  /**
   * The foreground color.
   */
  Color foreground;

  /**
   * The background color.
   */
  Font font;

  /**
   * The strikethrough flag.
   */
  boolean strikeThrough;

  /**
   * The underline flag.
   */
  boolean underline;

  /**
   * The subscript flag.
   */
  boolean subscript;

  /**
   * The superscript flag.
   */
  boolean superscript;

  /**
   * Indicates if the attributes must be refetched.
   */
  private boolean valid;

  /**
   * Creates a new GlyphView for the given Element.
   *
   * @param element the element that is rendered by this GlyphView
   */
  public LabelView(Element element)
  {
    super(element);
    valid = false;
  }

  /**
   * Loads the properties of this label view from the element's text
   * attributes. This method is called from the constructor and the
   * {@link #changedUpdate} method
   */
  protected void setPropertiesFromAttributes()
  {
    AttributeSet atts = getAttributes();
    setStrikeThrough(StyleConstants.isStrikeThrough(atts));
    setSubscript(StyleConstants.isSubscript(atts));
    setSuperscript(StyleConstants.isSuperscript(atts));
    setUnderline(StyleConstants.isUnderline(atts));

    // Determine the font and colors.
    Document d = getDocument();
    if (d instanceof StyledDocument)
      {
        StyledDocument doc = (StyledDocument) d;
        font = doc.getFont(atts);
        if (atts.isDefined(StyleConstants.Background))
          background = doc.getBackground(atts);
        else
          background = null;
        foreground = doc.getForeground(atts);
      }
    valid = true;
  }

  /**
   * Receives notification when text attributes change in the chunk of
   * text that this view is responsible for. This simply calls
   * {@link #setPropertiesFromAttributes()}.
   *
   * @param e the document event
   * @param a the allocation of this view
   * @param vf the view factory to use for creating new views
   */
  public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf)
  {
    valid = false;
    super.changedUpdate(e, a, vf);
  }

  /**
   * Returns the background color for the glyphs.
   *
   * @return the background color for the glyphs
   */
  public Color getBackground()
  {
    if (! valid)
      setPropertiesFromAttributes();
    return background;
  }

  /**
   * Sets the background color for the glyphs. A value of null
   * means the background of the parent view should shine through.
   *
   * @param bg the background to set or null
   *
   * @since 1.5
   */
  protected void setBackground(Color bg)
  {
    background = bg;
  }

  /**
   * Returns the foreground color for the glyphs.
   *
   * @return the foreground color for the glyphs
   */
  public Color getForeground()
  {
    if (! valid)
      setPropertiesFromAttributes();
    return foreground;
  }

  /**
   * Returns the font for the glyphs.
   *
   * @return the font for the glyphs
   */
  public Font getFont()
  {
    if (! valid)
      setPropertiesFromAttributes();
    return font;
  }

  /**
   * Returns the font metrics of the current font.
   *
   * @return the font metrics of the current font
   *
   * @deprecated this is not used anymore
   */
  protected FontMetrics getFontMetrics()
  {
    if (! valid)
      setPropertiesFromAttributes();

    Container c = getContainer();
    FontMetrics fm;
    if (c != null)
      fm = c.getFontMetrics(font);
    else
      fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
    return fm;
  }

  /**
   * Returns true if the glyphs are rendered underlined,
   * false otherwise.
   *
   * @return true if the glyphs are rendered underlined,
   *         false otherwise
   */
  public boolean isUnderline()
  {
    if (! valid)
      setPropertiesFromAttributes();
    return underline;
  }

  /**
   * Sets the underline flag.
   *
   * @param flag true if the glyphs are rendered underlined,
   *             false otherwise
   */
  protected void setUnderline(boolean flag)
  {
    underline = flag;
  }

  /**
   * Returns true if the glyphs are rendered as subscript,
   * false otherwise.
   *
   * @return true if the glyphs are rendered as subscript,
   *         false otherwise
   */
  public boolean isSubscript()
  {
    if (! valid)
      setPropertiesFromAttributes();
    return subscript;
  }

  /**
   * Sets the subscript flag.
   *
   * @param flag true if the glyphs are rendered as subscript,
   *             false otherwise
   */
  protected void setSubscript(boolean flag)
  {
    subscript = flag;
  }

  /**
   * Returns true if the glyphs are rendered as superscript,
   * false otherwise.
   *
   * @return true if the glyphs are rendered as superscript,
   *         false otherwise
   */
  public boolean isSuperscript()
  {
    if (! valid)
      setPropertiesFromAttributes();
    return superscript;
  }

  /**
   * Sets the superscript flag.
   *
   * @param flag true if the glyphs are rendered as superscript,
   *             false otherwise
   */
  protected void setSuperscript(boolean flag)
  {
    superscript = flag;
  }

  /**
   * Returns true if the glyphs are rendered strike-through,
   * false otherwise.
   *
   * @return true if the glyphs are rendered strike-through,
   *         false otherwise
   */
  public boolean isStrikeThrough()
  {
    if (! valid)
      setPropertiesFromAttributes();
    return strikeThrough;
  }

  /**
   * Sets the strike-through flag.
   *
   * @param flag true if the glyphs are rendered strike-through,
   *             false otherwise
   */
  protected void setStrikeThrough(boolean flag)
  {
    strikeThrough = flag;
  }
}


text:
module.exports = {
  "inputs": {
    "criteria": {
      "friendlyName": "criteria",
      "typeclass": "dictionary",
      "description": "Waterline search criteria to use in retrieving Authsession instances"
    },
    "limit": {
      "friendlyName": "limit",
      "example": 123,
      "description": "The maximum number of records to return"
    },
    "skip": {
      "friendlyName": "skip",
      "example": 123,
      "description": "The number of records to skip in the result"
    },
    "sort": {
      "friendlyName": "sort",
      "typeclass": "dictionary",
      "description": "Sort options for results, as a dictionary where the keys are attribute names and values are 1 (ascending) or 0 (descending)"
    }
  },
  "exits": {
    "success": {
      "friendlyName": "then",
      "example": [{
        "userid": 123,
        "sid": "abcde12345",
        "expires": 12345,
        "id": 123,
        "createdAt": "2016-01-06T18:05:51.154Z",
        "updatedAt": "2016-01-06T18:05:51.154Z"
      }]
    },
    "error": {
      "example": undefined
    }
  },
  "sync": false,
  "cacheable": false,
  "defaultExit": undefined,
  "fn": function(inputs, exits, env) {
    var query = env.sails.models.authsession.find(env.sails.util.objCompact(inputs.criteria));
    if (inputs.skip) {
      query = query.skip(inputs.skip);
    }
    if (inputs.limit) {
      query = query.limit(inputs.limit);
    }
    if (inputs.sort) {
      query = query.sort(inputs.sort);
    }
    query.exec(function(err, records) {
      if (err) {
        return exits.error(err);
      }
      return exits.success(records);
    });
  },
  "identity": "find_session"
};

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Core;

use PHPUnit\Framework\TestCase;

class ApplicationTest extends TestCase
{
    private function getConfig1()
    {
        return [
            'url' => '/prob/',
            'publicPath' => '/prob/public/',
        ];
    }

    private function getConfig2()
    {
        return [
            'url' => '/prob',
            'publicPath' => '/prob/public',
        ];
    }

    public function testRootUrl()
    {
        Application::setConfig($this->getConfig1());
        $this->assertEquals('/prob/', Application::getUrl());
        $this->assertEquals('/prob/', Application::getUrl('/'));

        Application::setConfig($this->getConfig2());
        $this->assertEquals('/prob/', Application::getUrl());
        $this->assertEquals('/prob/', Application::getUrl('/'));
    }

    public function testUrl()
    {
        Application::setConfig($this->getConfig1());
        $this->assertEquals('/prob/test/ok', Application::getUrl('test/ok'));
        $this->assertEquals('/prob/test/ok', Application::getUrl('/test/ok'));

        Application::setConfig($this->getConfig2());
        $this->assertEquals('/prob/test/ok', Application::getUrl('test/ok'));
        $this->assertEquals('/prob/test/ok', Application::getUrl('/test/ok'));
    }

    public function testPublicUrl()
    {
        Application::setConfig($this->getConfig1());
        $this->assertEquals('/prob/public/style.css', Application::getPublicUrl('style.css'));
        $this->assertEquals('/prob/public/style.css', Application::getPublicUrl('/style.css'));

        Application::setConfig($this->getConfig2());
        $this->assertEquals('/prob/public/style.css', Application::getPublicUrl('style.css'));
        $this->assertEquals('/prob/public/style.css', Application::getPublicUrl('/style.css'));
    }
}


text:
/*
 * reserved comment block
 * DO NOT REMOVE OR ALTER!
 */
/*
 * 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.
 */

package com.sun.org.apache.bcel.internal.generic;

/**
 * Denotes an unparameterized instruction to pop a value on top from the stack,
 * such as ISTORE, POP, PUTSTATIC.
 *
 * @see ISTORE
 * @see POP
 */
public interface PopInstruction extends StackConsumer {
}


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

<title>org.canova.spark.functions.data</title>
<meta name="date" content="2016-06-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.canova.spark.functions.data

Class Summary

Class
Description

FilesAsBytesFunction

A PairFunction that simply loads bytes[] from a a PortableDataStream, and wraps it (and the String key)
 in Text and BytesWritable respectively.

RecordReaderBytesFunction

RecordReaderBytesFunction: Converts binary data (in the form of a BytesWritable) to Canova format data
 (Collection<Writable>) using a RecordReader

SequenceRecordReaderBytesFunction

SequenceRecordReaderBytesFunction: Converts binary data (in the form of a BytesWritable) to Canova format data
 (Collection<Collection<<Writable>>) using a SequenceRecordReader

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
'use strict';

var gulp = require('gulp'),
    gutil = require('gulp-util'),
    clean = require('gulp-clean'),
    path = require('path'),
    webpack = require('webpack'),
    webpackConf = require('./webpack.config.js');

gulp.task('default', ['build'], function () {});

gulp.task('clean', function () {
  gulp.src('js', { read: false })
    .pipe(clean());
});

gulp.task('build', ['webpack'], function () {});

gulp.task('webpack', function (callback) {
  webpack(webpackConf, function (err, stats) {
    if (err) {
      throw new gutil.PluginError('webpack:build', err);
    }

    gutil.log('[webpack:build]', stats.toString({
      color: true
    }));

    callback();
  });
});


text:
namespace JsonBuilder.Tests
{
    using NUnit.Framework;

    public class WhenTheRootContainsAListOfTwoValues : JsonSpecificationBase
    {
        private string firstvalue = "first value";

        private string secondvalue = "second value";

        private string collectionName = "collection";

        public override void Given()
        {
            this.SUT.WithCollection(this.collectionName)
                .WithValue(this.firstvalue)
                .WithValue(this.secondvalue);
        }

        [Test]
        public void ThenTheCollectionNameMustBeProvided()
        {
            StringAssert.Contains(this.firstvalue, this.result);
        }

        [Test]
        public void ThenTheFirstValueIsAvailable()
        {
            StringAssert.Contains(this.firstvalue, this.result);
        }

        [Test]
        public void ThenTheSecondValueIsAvailable()
        {
            StringAssert.Contains(this.secondvalue, this.result);
        }

        [Test]
        public void ThenTheCollectionMustBeAvailable()
        {
            StringAssert.Contains("[", this.result);
            StringAssert.Contains("]", this.result);
        }
    }
}


text:
A number of types are provided to handle different types of data.
Functions are provided to perform common operations on each type.


text:
public class J_2 {
       public static void main(String[] args) {
               BulkSearchInstance.searchFor(new UpRelation());
       }
}


text:
package com.fredhopper.core.connector.index.generate;

import java.io.File;
import java.io.IOException;

import com.fredhopper.core.connector.index.generate.collector.CategoryDataCollector;
import com.fredhopper.core.connector.index.generate.collector.MetaAttributeCollector;
import com.fredhopper.core.connector.index.generate.collector.ProductDataCollector;
import com.fredhopper.core.connector.index.generate.context.IndexingContext;

/**
 * Responsible for generating the output files using the Collector parameters
 *
 * @return location of the compressed data.zip
 */
@FunctionalInterface
public interface Generator
{
	public File generate(final MetaAttributeCollector metaAttributes, final CategoryDataCollector categories,
			final ProductDataCollector products, final IndexingContext context) throws IOException;
}


text:
/**
 *
 */
package de.saxsys.treasurehunting.common.models.playgrounds;

import org.junit.Test;

import de.saxsys.treasurehunting.common.models.BaseModelTest;

/**
 * Test for testing basic CRUD operations.
 *
 * @author stefan.illgen
 *
 */
public class PlaygroundTest extends BaseModelTest {

	/**
	 * Tests creation.
	 */
	@Test
	public void testCreate() {

	}

	/**
	 * Tests read.
	 */
	@Test
	public void testRead() {

	}

	/**
	 * Tests update.
	 */
	@Test
	public void testUpdate() {

	}

	/**
	 * Tests deletion.
	 */
	@Test
	public void testDelete() {

	}

}


text:
package nam.model.moduleType;

import java.io.Serializable;
import java.util.Collection;

import javax.enterprise.context.ApplicationScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import javax.inject.Named;

import org.aries.ui.validate.AbstractValidator;

import nam.model.ModuleType;
import nam.model.util.ModuleTypeUtil;

@ApplicationScoped
@Named("moduleTypeValidator")
public class ModuleTypeValidator extends AbstractValidator implements Validator, Serializable {

	@Override
	public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException {
		resetState();
		if (value != null) {
			if (value instanceof ModuleType == false)
				throwError("Unexpected value: "+value);
		}
	}

}