text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/welfare-humanitarian/food#welfare-square-606795" xml:lang="eng" locale="eng" status="publish" xmlns:its="http://www.w3.org/2005/11/its">
  <search-meta>
      <uri-title its:translate="no">welfare-square-606795</uri-title>
      <source>welfare-square-606795</source>
      <publication-type its:translate="no">image</publication-type>
      <media-type its:translate="no">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2013-04-11">2013-04-11</publication-date>
      <title/>
      <description/>
      <collections>
          <collection its:translate="no">global-search</collection>
          <collection its:translate="no">media</collection>
          <collection its:translate="no">images</collection>
      </collections>
      <subjects>
          <subject>Welfare square</subject>
          <subject>Programs</subject>
          <subject>Dairies</subject>
          <subject>Deseret Dairy Products</subject>
          <subject>Cheese</subject>
          <subject>Workers</subject>
          <subject>Volunteers</subject>
          <subject>Service</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/food/welfare-square-606795-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/welfare-humanitarian/food/welfare-square-606795-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>187 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/food/welfare-square-606795-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>208 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/food/welfare-square-606795-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>434 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/food/welfare-square-606795-print.jpg</path>
              </download-url>
              <download-url>
                  Wallpaper
                  <size>853 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/food/welfare-square-606795-wallpaper.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
</ldswebml>


text:
package jerryController;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

import messageManager.LogMessage;
import messageManager.StatusUpdateMessage;
import panel.Jerry.JerryLogin;
import panel.SSH.SshLogin;

/**
 * Manages the saving and loading of logins of JERRY and SSH.
 * @author Jackson Wilson (c) 2014
 */
public class LoadJerry {
	private static String calledFrom;
	private static String defaultJerryMessage;
	private static String defaultSshMessage;

	/**
	 * Reloads the appropriate JComboBox with an updated list of the logins for that JComboBox by removing all existing entries and replaces them with the ones in the login.txt file.
	 * @param calledFor
	 */
	public static void addLogins(final String calledFor) {
		calledFrom = calledFor;
		String[] lines;
		lines = readFile();
		switch(Jerry.getOperatingSystem()) {
		case "Windows":
			defaultJerryMessage = "---------------------- Load Save ----------------------";
			defaultSshMessage = "----------------------- Load Save -----------------------";
			break;
		case "Mac":
			defaultJerryMessage = "----------- Load Save ----------";
			defaultSshMessage = "---------- Load Save ----------";
			break;
		case "Default":
			defaultJerryMessage = "----------- Load Save ----------";
			defaultSshMessage = "---------- Load Save ----------";
			break;
		}
		String currentTcpHost = null;
		String currentTcpPort = null;
		String currentSshHost = null;
		String currentSshPort = null;
		String currentSshUser = null;
		char[] currentSshPass = null;

		switch(calledFrom) {
		case "JERRY":
			currentTcpHost = JerryLogin.hostF.getText();
			currentTcpPort = JerryLogin.portF.getText();
			JerryLogin.loadComboBox.removeAllItems();
			JerryLogin.loadComboBox.addItem(defaultJerryMessage);
			break;
		case "SSH":
			currentSshHost = SshLogin.hostF.getText();
			currentSshPort = SshLogin.portF.getText();
			currentSshUser = SshLogin.usernameF.getText();
			currentSshPass = SshLogin.passwordF.getPassword();
			SshLogin.loadComboBox.removeAllItems();
			SshLogin.loadComboBox.addItem(defaultSshMessage);
			break;
		}

		for (final String str: lines) {
			switch(calledFrom) {
			case "JERRY":
				JerryLogin.loadComboBox.addItem(str);
				break;
			case "SSH":
				SshLogin.loadComboBox.addItem(str);
				break;
			}
		}

		switch(calledFrom) {
		case "JERRY":
			JerryLogin.hostF.setText(currentTcpHost);
			JerryLogin.portF.setText(currentTcpPort);
			break;
		case "SSH":
			SshLogin.hostF.setText(currentSshHost);
			SshLogin.portF.setText(currentSshPort);
			SshLogin.usernameF.setText(currentSshUser);
			SshLogin.passwordF.setText(new String(currentSshPass));
			break;
		}
	}

	/**
	 * Reads the file and returns the contents of the file into a String.
	 * @return File entry
	 */
	private static String[] readFile() {
		final ArrayList<String> arr = new ArrayList<String>();
		FileInputStream fStream;
		BufferedReader bReader;
		String strLine;
		try {
			switch(calledFrom) {
			case "JERRY":
				fStream = new FileInputStream(SaveJerry.loginJERRY.getAbsoluteFile());
				bReader = new BufferedReader(new InputStreamReader(fStream));
				while ((strLine = bReader.readLine()) != null) {
					arr.add(strLine);
				}
				fStream.close();
				break;
			case "SSH":
				fStream = new FileInputStream(SaveJerry.loginSSH.getAbsoluteFile());
				bReader = new BufferedReader(new InputStreamReader(fStream));
				while ((strLine = bReader.readLine()) != null) {
					arr.add(strLine);
				}
				fStream.close();
				break;
			}
		} catch (final FileNotFoundException e) {
			SaveJerry.createLoginFile("JERRY");
		} catch (final IOException e) {
			new LogMessage("Error", "IOExcpetion in LeadJerry.readFile()");
			new StatusUpdateMessage("Error", "Could not load Jerrys");
		}
		return arr.toArray(new String[arr.size()]);
	}
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <title>PicoGL.js: Omni-directional Shadows</title>
    <meta charset="utf-8">

    <link rel="stylesheet" href="../site/css/picogl-example.css">

        PicoGL.js Example: Omni-directional Shadows

            Source code

    <canvas id="gl-canvas"></canvas>


text:
In computing, hyperscale is the ability of an architecture to scale appropriately as increased demand is added to the system.

## :a: SDN - [Software Defined Network](https://en.wikipedia.org/wiki/Software-defined_networking)

SDN is meant to address the fact that the static architecture of traditional networks is decentralized and complex while current networks require more flexibility and easy troubleshooting.

## :b: SDS - [Software Defined Storage](https://en.wikipedia.org/wiki/Software-defined_storage)

- [ ] [Storage Virtualization](https://searchstorage.techtarget.com/definition/storage-virtualization)

- [ ] [SAN](https://en.wikipedia.org/wiki/Storage_area_network) - Storage Area Network

<video src="https://www.youtube.com/watch?v=sBgN8mBN1rE"></video>

- [ ] [LUN](https://en.wikipedia.org/wiki/Logical_unit_number)  - Logical Unit Number

# References

https://www.datacenterknowledge.com/cloud/analysts-there-are-now-more-500-hyperscale-data-centers-world

https://en.wikipedia.org/wiki/File:SDN-architecture-overview-transparent.png

https://upload.wikimedia.org/wikipedia/commons/0/05/SANvsNAS.svg

https://www.infoworld.com/article/3321176/14-ways-aws-beats-microsoft-azure-and-google-cloud.html


text:
.class public final Landroid/provider/Contacts$Photos;
.super Ljava/lang/Object;
.source "Contacts.java"

# interfaces
.implements Landroid/provider/BaseColumns;
.implements Landroid/provider/Contacts$PhotosColumns;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/provider/Contacts;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "Photos"
.end annotation

.annotation runtime Ljava/lang/Deprecated;
.end annotation

# static fields
.field public static final CONTENT_DIRECTORY:Ljava/lang/String; = "photo"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation
.end field

.field public static final CONTENT_URI:Landroid/net/Uri;
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation
.end field

.field public static final DEFAULT_SORT_ORDER:Ljava/lang/String; = "person ASC"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation
.end field

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 1878
    const-string/jumbo v0, "content://contacts/photos"

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Landroid/provider/Contacts$Photos;->CONTENT_URI:Landroid/net/Uri;

    .line 1867
    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .prologue
    .line 1871
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


text:
package com.ignition.frame

import scala.io.Source
import scala.xml.{ Elem, Node }

import org.apache.spark.sql.{ DataFrame, Row }
import org.apache.spark.sql.types.StructType
import org.json4s.JValue
import org.json4s.JsonDSL.{ jobject2assoc, option2jvalue, pair2Assoc, pair2jvalue, string2jvalue }
import org.json4s.jvalue2monadic

import com.ignition.types.{ fieldToStructType, string }
import com.ignition.util.JsonUtils.RichJValue
import com.ignition.util.XmlUtils.RichNodeSeq

/**
 * Reads the text file into a data frame with a single column.
 * If the separator is specified, splits the file into multiple rows, otherwise
 * the data frame will contain only one row.
 *
 * @author Vlad Orzhekhovskiy
 */
case class TextFileInput(path: String, separator: Option[String] = None, dataField: String = "content")
  extends FrameProducer {

  import TextFileInput._

  def separator(sep: String): TextFileInput = copy(separator = Some(sep))
  def field(f: String): TextFileInput = copy(dataField = f)

  val schema: StructType = string(dataField)
  val regex = separator map (_.r)

  protected def compute(implicit runtime: SparkRuntime): DataFrame = {
    val path = injectGlobals(this.path)

    val src = Source.fromFile(path)
    val lines = try src.getLines.mkString("\n") finally src.close

    val fragments = regex map (_.split(lines)) getOrElse Array(lines)
    val rdd = sc.parallelize(fragments map (Row(_)))

    val df = ctx.createDataFrame(rdd, schema)
    optLimit(df, runtime.previewMode)
  }

  override protected def buildSchema(index: Int)(implicit runtime: SparkRuntime): StructType = schema

  def toXml: Elem =
    <node>
      <path>{ path }</path>
      { separator map (s => <separator>{ s }</separator>) toList }
      <dataField>{ dataField }</dataField>
    </node>.copy(label = tag)

  def toJson: JValue = ("tag" -> tag) ~ ("path" -> path) ~ ("separator" -> separator) ~ ("dataField" -> dataField)
}

/**
 * Text File Input companion object.
 */
object TextFileInput {
  val tag = "text-file-input"

  def fromXml(xml: Node) = {
    val path = xml \ "path" asString
    val separator = xml \ "separator" getAsString
    val dataField = xml \ "dataField" asString

    apply(path, separator, dataField)
  }

  def fromJson(json: JValue) = {
    val path = json \ "path" asString
    val separator = json \ "separator" getAsString
    val dataField = json \ "dataField" asString

    apply(path, separator, dataField)
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <camelContext xmlns="http://camel.apache.org/schema/spring">

        <!-- define a custom thread pool -->
        <threadPool id="lowPool" poolSize="1" maxPoolSize="5" threadName="LowPool"/>

        <route>
            <from uri="direct:start"/>
            <log message="Incoming message ${body}"/>
            <!-- which we want the WireTap to use -->
            <wireTap uri="direct:tap" executorServiceRef="lowPool"/>
            <to uri="mock:result"/>
        </route>

        <route>
            <from uri="direct:tap"/>
            <log message="Tapped message ${body}"/>
            <to uri="mock:tap"/>
        </route>

    </camelContext>

</beans>


text:
using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Input
{
    [AddComponentMenu("Scripts/MRTK/SDK/WindowsMixedRealityControllerVisualizer")]
    public class WindowsMixedRealityControllerVisualizer : MixedRealityControllerVisualizer
    {
        private readonly Quaternion inverseRotation = Quaternion.Euler(0f, 180f, 0f);

        /// <inheritdoc />
        public override void OnSourcePoseChanged(SourcePoseEventData<MixedRealityPose> eventData)
        {
            if (UseSourcePoseData &&
                eventData.SourceId == Controller?.InputSource.SourceId)
            {
                base.OnSourcePoseChanged(eventData);
                transform.localRotation *= inverseRotation;
            }
        }
    }
}


text:
import Framework7 from 'framework7/lite';
import componentsRouter from './components-router';
import { f7, f7ready, theme, f7initEvents, setTheme } from './f7';

const Framework7Svelte = {
  name: 'sveltePlugin',
  installed: false,
  install(params = {}) {
    if (Framework7Svelte.installed) return;
    Framework7Svelte.installed = true;

    f7initEvents();

    const { theme: paramsTheme, userAgent } = params;

    if (paramsTheme === 'md') theme.md = true;
    if (paramsTheme === 'ios') theme.ios = true;
    if (paramsTheme === 'aurora') theme.aurora = true;

    // eslint-disable-next-line
    const needThemeCalc = typeof window === 'undefined' ? !!userAgent : true;
    if (needThemeCalc && (!paramsTheme || paramsTheme === 'auto')) {
      const device = Framework7.getDevice({ userAgent }, true);
      theme.ios = !!device.ios;
      theme.aurora = device.desktop && device.electron;
      theme.md = !theme.ios && !theme.aurora;
    }
    f7ready(() => {
      setTheme();
    });

    Framework7.Router.use(componentsRouter);
  },
};

export { f7ready, f7, theme };
export default Framework7Svelte;


text:
@interface SesameAuthViewController ()
//真实姓名
@property (weak, nonatomic) IBOutlet QMUITextField *realNameTextField;
//身份证号码
@property (weak, nonatomic) IBOutlet QMUITextField *idCardTextField;

@end

@implementation SesameAuthViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)confirmButtonClick:(id)sender {

    if (self.realNameTextField.text.length <= 0) {
        [QMUITips showWithText:@"请输入您的姓名" inView:self.view hideAfterDelay:2];
        return;
    }
    if (self.idCardTextField.text.length <= 0) {
        [QMUITips showWithText:@"请输入您的身份证" inView:self.view hideAfterDelay:2];
        return;
    }
    if (![Helper justIdentityCard:self.idCardTextField.text.qmui_trim]) {
        [QMUITips showWithText:@"请输入正确的身份证号码" inView:self.view hideAfterDelay:2];
        return;
    }
    YYUserauthRequest *request = [[YYUserauthRequest alloc] init];
    request.nh_url = [NSString stringWithFormat:@"%@%@",kBaseURL,kUserAuthAPI];
    request.idcard = self.idCardTextField.text.qmui_trim;
    request.name = self.realNameTextField.text.qmui_trim;
    __weak __typeof(self)weakSelf = self;
    [request nh_sendRequestWithCompletion:^(id response, BOOL success, NSString *message) {
        if (success) {
            QMUILog(@"%@",response);
            if ([response integerValue] == 1) {
                [weakSelf performSegueWithIdentifier:@"next" sender:weakSelf];
            }else{
               [QMUITips showWithText:message inView:weakSelf.view hideAfterDelay:2];
            }
        }else{
            [QMUITips showWithText:message inView:weakSelf.view hideAfterDelay:2];
        }
    } error:^(NSError *error) {

    }];
}

- (BOOL)shouldCustomNavigationBarTransitionIfBarHiddenable
{
    return YES;
}

-(BOOL) preferredNavigationBarHidden
{
    return YES;
}

-(BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
{

    return YES;
}

@end


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Ceská Mykol. 36(2): 81 (1982)

#### Original name
Boletus scaber var. melaneus Smotl., 1951

### Remarks
null


text:
package ee.telekom.workflow.util.el;

import java.util.Date;

import javax.el.ELProcessor;

import org.junit.Assert;
import org.junit.Test;

import ee.telekom.workflow.graph.core.EnvironmentImpl;
import ee.telekom.workflow.graph.el.ElUtil;

/**
 * http://docs.oracle.com/javaee/7/api/javax/el/package-summary.html
 *
 * @author Erko Hansar
 */
public class ExpressionLanguageTest{

    @Test
    public void testBean(){
        ELProcessor processor = ElUtil.initNewELProcessor( new EnvironmentImpl(), null );

        processor.defineBean( "client", new Client( 1, "Heli Kopter" ) );
        String name = (String)processor.eval( "client.name" );

        Assert.assertEquals( name, "Heli Kopter" );
    }

    @Test
    public void testConditions(){
        ELProcessor processor = ElUtil.initNewELProcessor( new EnvironmentImpl(), null );

        processor.defineBean( "client", new Client( 1, "Heli Kopter" ) );
        boolean result = (boolean)processor.eval( "not empty client.name and client.id > 0" );

        Assert.assertTrue( result );
    }

    @Test
    public void testValue(){
        ELProcessor processor = ElUtil.initNewELProcessor( new EnvironmentImpl(), null );

        processor.setValue( "throwException", false );
        boolean success = (boolean)processor.eval( "not throwException" );

        Assert.assertTrue( success );
    }

    @Test
    public void testEnvironmentBean(){
        EnvironmentImpl environment = new EnvironmentImpl();
        environment.setAttribute( "testAtr1", true );
        environment.setAttribute( "testAtr2", "33" );
        environment.setAttribute( "testAtr3", null );

        ELProcessor processor = ElUtil.initNewELProcessor( environment, null );
        // this way all the parameters must be prefixed with "env.", but we will at least be able to check unmapped attributes without an exception
        processor.defineBean( "env", environment.getAttributes() );

        boolean result = (boolean)processor.eval( "empty env.testAtr3 && env.testAtr1 && empty env.unknownAtr" );

        Assert.assertTrue( result );
    }

    @Test
    public void testEnvironmentResolver(){
        EnvironmentImpl environment = new EnvironmentImpl();
        environment.setAttribute( "testAtr1", true );
        environment.setAttribute( "testAtr2", "33" );
        environment.setAttribute( "testAtr3", null );

        ELProcessor processor = ElUtil.initNewELProcessor( environment, null );

        boolean result = (boolean)processor.eval( "empty testAtr3 && testAtr1" );

        // this again fails: "ELResolver cannot handle a null base Object with identifier 'unknownAtr'"
        //boolean result = (boolean)processor.eval( "empty testAtr3 && testAtr1 && empty unknownAtr" );

        Assert.assertTrue( result );
    }

    @Test
    public void testEnvironmentResolverNull(){
        EnvironmentImpl environment = new EnvironmentImpl();
        environment.setAttribute( "testDate1", null );

        ELProcessor processor = ElUtil.initNewELProcessor( environment, null );

        // in EL, null.fieldName does not throw a nullpointer, and null in conditions always returns false
        boolean result = (boolean)processor.eval( "testDate1.time < System.currentTimeMillis()" );
        Assert.assertFalse( result );
        result = (boolean)processor.eval( "testDate1.whatever > System.currentTimeMillis()" );
        Assert.assertFalse( result );
    }

    @Test
    public void testEnvironmentResolverDate(){
        Date start = new Date();

        EnvironmentImpl environment = new EnvironmentImpl();
        environment.setAttribute( "currentMillis", System.currentTimeMillis() );

        try{
            Thread.sleep( 30 );
        }
        catch( InterruptedException e ){
        }

        ELProcessor processor = ElUtil.initNewELProcessor( environment, null );

        boolean result = (boolean)processor.eval( "NOW.time > currentMillis" );
        Assert.assertTrue( result );

        Date now = (Date)processor.eval( "NOW" );
        Assert.assertTrue( now.after( start ) );
    }

    @Test
    public void testEnvironmentResolverInstanceIdNull(){
        EnvironmentImpl environment = new EnvironmentImpl();

        ELProcessor processor = ElUtil.initNewELProcessor( environment, null );

        Long instanceId = (Long)processor.eval( "WORKFLOW_INSTANCE_ID" );
        Assert.assertEquals( null, instanceId );
    }

    @Test
    public void testEnvironmentResolverInstanceId(){
        EnvironmentImpl environment = new EnvironmentImpl();

        ELProcessor processor = ElUtil.initNewELProcessor( environment, 55L );

        long instanceId = (long)processor.eval( "WORKFLOW_INSTANCE_ID" );
        Assert.assertEquals( 55, instanceId );
    }

    public class Client{
        private int id;
        private String name;

        public Client( int id, String name ){
            this.id = id;
            this.name = name;
        }

        public int getId(){
            return id;
        }

        public String getName(){
            return name;
        }

    }

}


text:
(function(){
  angular
    .module("BetterMe")
    .factory('RegimenService', RegimenService);

  function RegimenService($http) {

    var api = {
      "createRegimen": createRegimen,
      "findAllRegimens": findAllRegimens,
      "findRegimenById": findRegimenById,
      "updateRegimen": updateRegimen,
      "deleteRegimen": deleteRegimen
    };
    return api;

    function createRegimen(regimen) {
      return $http.post("/api/regimen", regimen);
    }

    function findAllRegimens() {
      return $http.get("/api/regimen");
    }

    function findRegimenById(regimenId) {
      return $http.get("/api/regimen/" + regimenId);
    }

    function updateRegimen(regimenId, regimen) {
      return $http.put("/api/regimen/" + regimenId, regimen);
    }

    function deleteRegimen(regimenId) {
      return $http.delete("/api/regimen/" + regimenId);
    }

  }
})();


text:
require 'spec_helper'

on_supported_os.each do |os, f|
  describe 'ntp' do
    let(:facts) { { is_virtual: false } }

    let(:conf_path) do
      if os.include?('solaris')
        '/etc/inet/ntp.conf'
      else
        '/etc/ntp.conf'
      end
    end

    context "on #{os}" do
      let(:facts) do
        f.merge(super())
      end

      it { is_expected.to compile.with_all_deps }

      it { is_expected.to contain_class('ntp::install') }
      it { is_expected.to contain_class('ntp::config') }
      it { is_expected.to contain_class('ntp::service') }

      describe 'ntp::config' do
        it { is_expected.to contain_file(conf_path).with_owner('0') }
        it { is_expected.to contain_file(conf_path).with_group('0') }
        it { is_expected.to contain_file(conf_path).with_mode('0644') }

        if f[:os]['family'] == 'RedHat'
          it { is_expected.to contain_file('/etc/ntp/step-tickers').with_owner('0') }
          it { is_expected.to contain_file('/etc/ntp/step-tickers').with_group('0') }
          it { is_expected.to contain_file('/etc/ntp/step-tickers').with_mode('0644') }
        end

        if f[:os]['family'] == 'Suse' && f[:os]['release']['major'] == '12'
          it { is_expected.to contain_file('/var/run/ntp/servers-netconfig').with_ensure_absent }
        end

        describe 'allows template to be overridden with erb template' do
          let(:params) { { config_template: 'my_ntp/ntp.conf.erb' } }

          it { is_expected.to contain_file(conf_path).with_content(%r{erbserver1}) }
        end

        describe 'allows template to be overridden with epp template' do
          let(:params) { { config_epp: 'my_ntp/ntp.conf.epp' } }

          it { is_expected.to contain_file(conf_path).with_content(%r{eppserver1}) }
        end

        describe 'broadcastclient' do
          context 'when set to true' do
            let(:params) do
              {
                broadcastclient: true,
              }
            end

            it 'contains broadcastclient setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^broadcastclient\n})
            end
          end
          context 'when set to false' do
            let(:params) do
              {
                broadcastclient: false,
              }
            end

            it 'does not contain broadcastclient setting' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{^broadcastclient\n})
            end
          end
        end

        describe 'burst' do
          context 'when set to true' do
            let(:params) do
              {
                burst: true,
              }
            end

            it do
              is_expected.to contain_file(conf_path).with('content' => %r{ burst\n})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                burst: false,
              }
            end

            it do
              is_expected.not_to contain_file(conf_path).with('content' => %r{ burst\n})
            end
          end
        end

        context 'config_dir' do
          context 'when set to custom dir' do
            let(:params) do
              {
                keys_enable: true,
                config_dir: '/tmp/foo',
                keys_file: '/tmp/foo/ntp.keys',
              }
            end

            it 'contains custom config directory' do
              is_expected.to contain_file('/tmp/foo').with(
                'ensure' => 'directory', 'owner' => '0', 'group' => '0', 'mode' => '0775', 'recurse' => 'false',
              )
            end
          end
        end

        context 'config_file_mode' do
          context 'when set to custom mode' do
            let(:params) do
              {
                config_file_mode: '0777',
              }
            end

            it 'contains file mode of 0777' do
              is_expected.to contain_file(conf_path).with_mode('0777')
            end
          end
        end

        context 'default pool servers' do # rubocop:disable RSpec/EmptyExampleGroup
          case f[:os]['family']
          when 'RedHat'
            it 'uses the centos ntp servers' do
              is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.centos.pool.ntp.org})
            end
            it do
              is_expected.to contain_file('/etc/ntp/step-tickers').with('content' => %r{\d.centos.pool.ntp.org})
            end
          when 'Debian'
            it 'uses the debian ntp servers' do
              is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.debian.pool.ntp.org iburst\n})
            end
          when 'Suse'
            it 'uses the opensuse ntp servers' do
              is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.opensuse.pool.ntp.org})
            end
          when 'FreeBSD'
            it 'uses the freebsd ntp servers' do
              is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.freebsd.pool.ntp.org iburst maxpoll 9})
            end
          when 'Solaris'
            it 'uses the generic NTP pool servers' do
              is_expected.to contain_file('/etc/inet/ntp.conf').with('content' => %r{server \d.pool.ntp.org})
            end
          when 'AIX'
            it 'uses the generic NTP pool servers on AIX' do
              is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.pool.ntp.org})
            end
          else
            it {
              expect { catalogue }.to raise_error(
                %r{The ntp module is not supported on an unsupported based system.},
              )
            }
          end
        end

        describe 'disable_auth' do
          context 'when set to true' do
            let(:params) do
              {
                disable_auth: true,
              }
            end

            it 'contains disable auth setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^disable auth\n})
            end
          end
          context 'when set to false' do
            let(:params) do
              {
                disable_auth: false,
              }
            end

            it 'does not contain disable auth setting' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{^disable auth\n})
            end
          end
        end

        describe 'disable_dhclient' do
          context 'when set to true' do
            let(:params) do
              {
                disable_dhclient: true,
              }
            end

            it 'contains disable ntp-servers setting' do
              is_expected.to contain_augeas('disable ntp-servers in dhclient.conf')
            end
            it 'contains dhcp file' do
              is_expected.to contain_file('/var/lib/ntp/ntp.conf.dhcp').with_ensure('absent')
            end
            it 'contains ntp.sh file' do
              is_expected.to contain_file('/etc/dhcp/dhclient.d/ntp.sh').with_ensure('absent')
            end
          end
          context 'when set to false' do
            let(:params) do
              {
                disable_dhclient: false,
              }
            end

            it 'does not contain disable ntp-servers setting' do
              is_expected.not_to contain_augeas('disable ntp-servers in dhclient.conf')
            end
            it 'does not contain dhcp file' do
              is_expected.not_to contain_file('/var/lib/ntp/ntp.conf.dhcp').with_ensure('absent')
            end
          end
        end

        describe 'disable_kernel' do
          context 'when set to true' do
            let(:params) do
              {
                disable_kernel: true,
              }
            end

            it 'contains disable kernel setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^disable kernel\n})
            end
          end
          context 'when set to false' do
            let(:params) do
              {
                disable_kernel: false,
              }
            end

            it 'does not contain disable kernel setting' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{^disable kernel\n})
            end
          end
        end

        describe 'disable_monitor' do
          context 'when default' do
            let(:params) do
              {
              }
            end

            it 'contains disable monitor setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^disable monitor\n})
            end
          end
          context 'when set to true' do
            let(:params) do
              {
                disable_monitor: true,
              }
            end

            it 'contains disable monitor setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^disable monitor\n})
            end
          end
          context 'when set to false' do
            let(:params) do
              {
                disable_monitor: false,
              }
            end

            it 'does not contain disable monitor setting' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{^disable monitor\n})
            end
          end
        end

        describe 'driftfile' do
          context 'when not set' do
            it 'contains default driftfile' do
              is_expected.to contain_file(conf_path).with('content' => %r{^driftfile})
            end
          end

          context 'when set' do
            let(:params) do
              {
                driftfile: '/tmp/driftfile',
              }
            end

            it 'contains driftfile value' do
              is_expected.to contain_file(conf_path).with('content' => %r{^driftfile /tmp/driftfile\n})
            end
          end
        end

        describe 'enable_mode7' do
          context 'when default' do
            let(:params) do
              {
              }
            end

            it 'does not contain enable mode7 setting' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{^enable mode7\n})
            end
          end
          context 'when set to true' do
            let(:params) do
              {
                enable_mode7: true,
              }
            end

            it 'contains enable mode7 setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^enable mode7\n})
            end
          end
          context 'when set to false' do
            let(:params) do
              {
                enable_mode7: false,
              }
            end

            it 'does not contain enable mode7 setting' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{^enable mode7\n})
            end
          end
        end

        describe 'interfaces' do
          context 'when set' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                interfaces: ['127.0.0.1', 'a.b.c.d'],
              }
            end

            it {
              is_expected.to contain_file(conf_path).with('content' => %r{interface ignore wildcard\ninterface listen 127.0.0.1\ninterface listen a.b.c.d})
            }
          end
          context 'when not set' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
              }
            end

            it {
              is_expected.not_to contain_file(conf_path).with('content' => %r{interface ignore wildcard})
            }
          end
        end

        describe 'interfaces_ignore' do
          context 'when set' do
            let(:params) do
              {
                interfaces: ['a.b.c.d'],
                interfaces_ignore: ['wildcard', 'ipv6'],
              }
            end

            it {
              is_expected.to contain_file(conf_path).with('content' => %r{interface ignore wildcard\ninterface ignore ipv6\ninterface listen a.b.c.d})
            }
          end
          context 'when not set' do
            let(:params) do
              {
                interfaces: ['127.0.0.1'],
                servers: ['a', 'b', 'c', 'd'],
              }
            end

            it {
              is_expected.to contain_file(conf_path).with('content' => %r{interface ignore wildcard\ninterface listen 127.0.0.1})
            }
          end
        end

        describe 'keys' do
          context 'when enabled' do
            let(:params) do
              {
                keys_enable: true,
                keys_trusted: [1, 2, 3],
                keys_controlkey: 2,
                keys_requestkey: 3,
                keys: ['1 M AAAABBBB'],
              }
            end

            let(:keys_file) do
              if os.match?(%r{redhat|centos|oracle|scientific})
                '/etc/ntp/keys'
              elsif os.include?('solaris')
                '/etc/inet/ntp.keys'
              else
                '/etc/ntp.keys'
              end
            end

            it {
              is_expected.to contain_file(conf_path).with('content' => %r{trustedkey 1 2 3})
            }
            it {
              is_expected.to contain_file(conf_path).with('content' => %r{controlkey 2})
            }
            it {
              is_expected.to contain_file(conf_path).with('content' => %r{requestkey 3})
            }
            it {
              is_expected.to contain_file(keys_file).with('content' => %r{1 M AAAABBBB})
            }
          end
        end

        context 'when disabled' do
          let(:params) do
            {
              keys_enable: false,
              keys_trusted: [1, 2, 3],
              keys_controlkey: 2,
              keys_requestkey: 3,
            }
          end

          it {
            is_expected.not_to contain_file(conf_path).with('content' => %r{trustedkey 1 2 3})
          }
          it {
            is_expected.not_to contain_file(conf_path).with('content' => %r{controlkey 2})
          }
          it {
            is_expected.not_to contain_file(conf_path).with('content' => %r{requestkey 3})
          }
        end

        describe 'noselect servers' do
          context 'when set' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                noselect_servers: ['a', 'b'],
                iburst_enable: false,
              }
            end

            it {
              is_expected.to contain_file(conf_path).with('content' => %r{server a (maxpoll 9 )?noselect\nserver b (maxpoll 9 )?noselect\nserver c( maxpoll 9)?\nserver d( maxpoll 9)?})
            }
          end
          context 'when not set' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                noselect_servers: [],
              }
            end

            it {
              is_expected.not_to contain_file(conf_path).with('content' => %r{server a noselect})
            }
          end
        end

        describe 'preferred servers' do
          context 'when set' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                preferred_servers: ['a', 'b'],
                iburst_enable: false,
              }
            end

            it {
              is_expected.to contain_file(conf_path).with('content' => %r{server a prefer( maxpoll 9)?\nserver b prefer( maxpoll 9)?\nserver c( maxpoll 9)?\nserver d( maxpoll 9)?})
            }
          end
          context 'when not set' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                preferred_servers: [],
              }
            end

            it {
              is_expected.not_to contain_file(conf_path).with('content' => %r{server a prefer})
            }
          end
        end

        describe 'restrict' do
          context 'when not set' do
            it 'does not contain restrict value' do
              is_expected.to contain_file(conf_path).without_content(%r{^restrict test restrict})
            end
          end

          context 'when set' do
            let(:params) do
              {
                restrict: ['test restrict'],
              }
            end

            it 'contains restrict value' do
              is_expected.to contain_file(conf_path).with_content(%r{^restrict test restrict})
            end
          end
        end

        describe 'slewalways' do
          context 'when absent' do
            if f[:kernel] == 'AIX'
              it 'on AIX does contain "slewalways no"' do
                is_expected.to contain_file(conf_path).with_content(%r{^slewalways no})
              end
            else
              it 'on non-AIX does not contain a slewalways' do
                is_expected.to contain_file(conf_path).without_content(%r{^slewalways})
              end
            end
          end

          context 'when "no"' do
            let(:params) do
              {
                slewalways: 'no',
              }
            end

            it 'does contain "slewalways no"' do
              is_expected.to contain_file(conf_path).with_content(%r{^slewalways no})
            end
          end

          context 'when "yes"' do
            let(:params) do
              {
                slewalways: 'yes',
              }
            end

            it 'does contain "slewalways yes"' do
              is_expected.to contain_file(conf_path).with_content(%r{^slewalways yes})
            end
          end
        end

        describe 'statistics' do
          context 'when not set' do
            it 'does not contain statistics' do
              is_expected.to contain_file(conf_path).without_content(%r{^filegen loopstats file loopstats type day enable})
            end
          end

          context 'when set' do
            let(:params) do
              {
                statistics: ['loopstats'],
                disable_monitor: false,
              }
            end

            it 'contains statistics value' do
              is_expected.to contain_file(conf_path).with_content(%r{^filegen loopstats file loopstats type day enable})
              is_expected.to contain_file(conf_path).with_content(%r{^statsdir /var/log/ntpstats})
            end
          end
        end

        describe 'udlc' do
          context 'when not set' do
            it 'does not contain udlc' do
              is_expected.to contain_file(conf_path).without_content(%r{127.127.1.0})
            end
          end

          context 'when set' do
            let(:params) do
              {
                udlc: true,
              }
            end

            it 'contains udlc value' do
              is_expected.to contain_file(conf_path).with_content(%r{127.127.1.0})
            end
          end
        end

        describe 'udlc_stratum' do
          context 'when not set' do
            it 'does not contain udlc_stratum' do
              is_expected.to contain_file(conf_path).without_content(%r{stratum 10})
            end
          end

          context 'when set' do
            let(:params) do
              {
                udlc: true,
                udlc_stratum: 10,
              }
            end

            it 'contains udlc_stratum value' do
              is_expected.to contain_file(conf_path).with_content(%r{stratum 10})
            end
          end
        end
      end

      describe 'ntp::install' do
        let(:params) { { package_ensure: 'present', package_name: ['ntp'], package_manage: true } }

        it {
          is_expected.to contain_package('ntp').with(
            ensure: 'present',
          )
        }

        describe 'should allow package ensure to be overridden' do
          let(:params) { { package_ensure: 'latest', package_name: ['ntp'], package_manage: true } }

          it { is_expected.to contain_package('ntp').with_ensure('latest') }
        end

        describe 'should allow the package name to be overridden' do
          let(:params) { { package_ensure: 'present', package_name: ['hambaby'], package_manage: true } }

          it { is_expected.to contain_package('hambaby') }
        end

        describe 'should allow the package to be unmanaged' do
          let(:params) { { package_manage: false, package_name: ['ntp'] } }

          it { is_expected.not_to contain_package('ntp') }
        end
      end

      describe 'ntp::service' do
        let(:params) do
          {
            service_manage: true,
            service_enable: true,
            service_ensure: 'running',
            service_name: 'ntp',
          }
        end

        describe 'with defaults' do
          it {
            is_expected.to contain_service('ntp').with(
              enable: true,
              ensure: 'running',
              name: 'ntp',
              hasstatus: true,
              hasrestart: true,
            )
          }
        end

        describe 'authprov' do
          context 'when set to true' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                authprov: '/opt/novell/xad/lib64/libw32time.so 131072:4294967295 global',
              }
            end

            it 'contains authprov setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^authprov /opt/novell/xad/lib64/libw32time.so 131072:4294967295 global\n})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
              }
            end

            it 'does not contain a authprov line' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{authprov })
            end
          end
        end

        describe 'for physical machines' do
          let :facts do
            super().merge(is_virtual: false)
          end

          it 'disallows large clock skews' do
            is_expected.not_to contain_file(conf_path).with('content' => %r{tinker panic 0})
          end
        end

        describe 'for virtual machines' do
          let :facts do
            super().merge(is_virtual: true)
          end

          it 'does not use local clock as a time source' do
            is_expected.not_to contain_file(conf_path).with('content' => %r{server.*127.127.1.0.*fudge.*127.127.1.0 stratum 10})
          end

          it 'allows large clock skews' do
            is_expected.to contain_file(conf_path).with('content' => %r{tinker panic 0})
          end
        end

        describe 'iburst_enable' do
          context 'when set to true' do
            let(:params) do
              {
                iburst_enable: true,
              }
            end

            it do
              is_expected.to contain_file(conf_path).with('content' => %r{iburst})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                iburst_enable: false,
              }
            end

            it do
              is_expected.not_to contain_file(conf_path).with('content' => %r{iburst\n})
            end
          end
        end

        describe 'leapfile' do
          context 'when set to true' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                leapfile: '/etc/leap-seconds.3629404800',
              }
            end

            it 'contains leapfile setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^leapfile \/etc\/leap-seconds\.3629404800\n})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
              }
            end

            it 'does not contain a leapfile line' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{leapfile })
            end
          end
        end

        describe 'logfile' do
          context 'when set to true' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                logfile: '/var/log/foobar.log',
              }
            end

            it 'contains logfile setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^logfile \/var\/log\/foobar\.log\n})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
              }
            end

            it 'does not contain a logfile line' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{logfile })
            end
          end
        end

        describe 'logconfig' do
          context 'when set to true' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                logconfig: '=syncall +peerinfo',
              }
            end

            it 'contains logconfig setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^logconfig =syncall \+peerinfo\n})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
              }
            end

            it 'does not contain a logconfig line' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{logconfig })
            end
          end
        end

        describe 'minpoll and maxpoll' do
          context 'when minpoll changed from default' do
            let(:params) do
              {
                minpoll: 6,
              }
            end

            it do
              is_expected.to contain_file(conf_path).with('content' => %r{minpoll 6})
            end
          end

          context 'when maxpoll changed from default' do
            let(:params) do
              {
                maxpoll: 12,
              }
            end

            it do
              is_expected.to contain_file(conf_path).with('content' => %r{maxpoll 12\n})
            end
          end

          context 'when minpoll and maxpoll changed from default simultaneously' do
            let(:params) do
              {
                minpoll: 6,
                maxpoll: 12,
              }
            end

            it do
              is_expected.to contain_file(conf_path).with('content' => %r{minpoll 6 maxpoll 12\n})
            end
          end
        end

        describe 'ntpsigndsocket' do
          context 'when set to true' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
                ntpsigndsocket: '/usr/local/samba/var/lib/ntp_signd',
              }
            end

            it 'contains ntpsigndsocket setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^ntpsigndsocket /usr/local/samba/var/lib/ntp_signd\n})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                servers: ['a', 'b', 'c', 'd'],
              }
            end

            it 'does not contain a ntpsigndsocket line' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{ntpsigndsocket })
            end
          end
        end

        describe 'peers' do
          context 'when empty' do
            let(:params) do
              {
                peers: [],
              }
            end

            it 'does not contain a peer line' do
              is_expected.to contain_file(conf_path).without_content(%r{^peer})
            end
          end

          context 'when set' do
            let(:params) do
              {
                peers: ['foo', 'bar'],
              }
            end

            it 'contains the peer lines - expectation one' do
              is_expected.to contain_file(conf_path).with_content(%r{peer foo})
            end
            it 'contains the peer lines - expectation two' do
              is_expected.to contain_file(conf_path).with_content(%r{peer bar})
            end
          end
        end

        describe 'pool' do
          context 'when empty' do
            let(:params) do
              {
                pool: [],
              }
            end

            it 'does not contain a pool line' do
              is_expected.to contain_file(conf_path).without_content(%r{^pool})
            end
          end

          context 'when set' do
            let(:params) do
              {
                pool: ['foo', 'bar'],
              }
            end

            it 'contains the pool lines - expectation one' do
              is_expected.to contain_file(conf_path).with_content(%r{pool foo})
            end
            it 'contains the pool lines - expectation two' do
              is_expected.to contain_file(conf_path).with_content(%r{pool bar})
            end
          end
        end

        describe 'service_ensure' do
          describe 'when overridden' do
            let(:params) { { service_name: 'ntp', service_ensure: 'stopped' } }

            it { is_expected.to contain_service('ntp').with_ensure('stopped') }
          end
        end

        describe 'service_hasstatus' do
          describe 'when overridden' do
            let(:params) { { service_name: 'ntp', service_hasstatus: false } }

            it { is_expected.to contain_service('ntp').with_hasstatus(false) }
          end
        end

        describe 'service_hasrestart' do
          describe 'when overridden' do
            let(:params) { { service_name: 'ntp', service_hasrestart: false } }

            it { is_expected.to contain_service('ntp').with_hasrestart(false) }
          end
        end

        describe 'service_manage' do
          let(:params) do
            {
              service_manage: false,
              service_enable: true,
              service_ensure: 'running',
              service_name: 'ntpd',
            }
          end

          it 'when set to false' do
            is_expected.not_to contain_service('ntp').with('enable' => true,
                                                           'ensure' => 'running',
                                                           'name'   => 'ntpd')
          end
        end

        describe 'tinker' do
          describe 'when set to false' do
            context 'when panic or stepout not overriden' do
              let(:params) do
                {
                  tinker: false,
                }
              end

              it do
                is_expected.not_to contain_file(conf_path).with('content' => %r{^tinker })
              end
            end

            context 'when panic overriden' do
              let(:params) do
                {
                  tinker: false,
                  panic: 257,
                }
              end

              it do
                is_expected.not_to contain_file(conf_path).with('content' => %r{^tinker })
              end
            end

            context 'when stepout overriden' do
              let(:params) do
                {
                  tinker: false,
                  stepout: 5,
                }
              end

              it do
                is_expected.not_to contain_file(conf_path).with('content' => %r{^tinker })
              end
            end

            context 'when panic and stepout overriden' do
              let(:params) do
                {
                  tinker: false,
                  panic: 257,
                  stepout: 5,
                }
              end

              it do
                is_expected.not_to contain_file(conf_path).with('content' => %r{^tinker })
              end
            end
          end

          describe 'when set to true' do
            context 'when only tinker set to true' do
              let(:params) do
                {
                  tinker: true,
                }
              end

              it do
                is_expected.not_to contain_file(conf_path).with('content' => %r{^tinker })
              end
            end

            context 'when panic changed' do
              let(:params) do
                {
                  tinker: true,
                  panic: 257,
                }
              end

              it do
                is_expected.to contain_file(conf_path).with('content' => %r{^tinker panic 257\n})
              end
            end

            context 'when stepout changed' do
              let(:params) do
                {
                  tinker: true,
                  stepout: 5,
                }
              end

              it do
                is_expected.to contain_file(conf_path).with('content' => %r{^tinker stepout 5\n})
              end
            end

            context 'when panic and stepout changed' do
              let(:params) do
                {
                  tinker: true,
                  panic: 257,
                  stepout: 5,
                }
              end

              it do
                is_expected.to contain_file(conf_path).with('content' => %r{^tinker panic 257 stepout 5\n})
              end
            end
          end
        end

        describe 'tos' do
          context 'when set to true' do
            let(:params) do
              {
                tos: true,
              }
            end

            it 'contains tos setting' do
              is_expected.to contain_file(conf_path).with('content' => %r{^tos})
            end
          end

          context 'when set to false' do
            let(:params) do
              {
                tos: false,
              }
            end

            it 'does not contain tos setting' do
              is_expected.not_to contain_file(conf_path).with('content' => %r{^tos})
            end
          end
        end
      end
    end
  end
end


text:
class ApacheGeode < Formula
  desc "In-memory Data Grid for fast transactional data processing"
  homepage "https://geode.apache.org/"
  url "https://www.apache.org/dyn/closer.cgi?path=geode/1.7.0/apache-geode-1.7.0.tgz"
  sha256 "91eec04420f46e949d32104479c4a4b5b34a4e5570dca7b98ca067a30d5a783d"

  bottle :unneeded

  # Geode does not work with Java 1.9 (see https://issues.apache.org/jira/browse/GEODE-3)
  depends_on :java => "1.8"

  def install
    rm_f "bin/gfsh.bat"
    bash_completion.install "bin/gfsh-completion.bash" => "gfsh"
    libexec.install Dir["*"]
    (bin/"gfsh").write_env_script libexec/"bin/gfsh", Language::Java.java_home_env("1.8")
  end

  test do
    begin
      flags = "--dir #{testpath} --name=geode_locator_brew_test"
      output = shell_output("#{bin}/gfsh start locator #{flags}")
      assert_match "Cluster configuration service is up and running", output
    ensure
      quiet_system "pkill", "-9", "-f", "geode_locator_brew_test"
    end
  end
end


text:
class JournalsController < ApplicationController
  before_action :authenticate_user!

  respond_to :json

  def index
    respond_with Journal.all
  end

  def show
    respond_with journal
  end

  private

  def journal
    Journal.find(params[:id])
  end
end


text:
<!doctype html>

		<title>three.js canvas - interactive - cubes</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">


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

<TITLE>
XListView (MyMusic
1.0
     API Reference)
</TITLE>

<META NAME="date" CONTENT="2014-10-13">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

me.maxwin.view

Class XListView

java.lang.Object
  ListView
      me.maxwin.view.XListView

public class XListView
extends ListView

The Class XListView.

Nested Class Summary

static interface
XListView.IXListViewListener

          implements this interface to get refresh/load more event.

static interface
XListView.OnXScrollListener

          you can listen ListView.OnScrollListener or this one.

Field Summary

static int
LOAD_ALL

          The Constant LOAD_ALL.

Constructor Summary

XListView(Context context)

          Instantiates a new x list view.

XListView(Context context,
          AttributeSet attrs)

          Instantiates a new x list view.

XListView(Context context,
          AttributeSet attrs,
          int defStyle)

          Instantiates a new x list view.

Method Summary

 void
computeScroll()

 Title: computeScroll

 void
LoadAll()

          Load all.

 void
onScroll(AbsListView view,
         int firstVisibleItem,
         int visibleItemCount,
         int totalItemCount)

 Title: onScroll

 void
onScrollStateChanged(AbsListView view,
                     int scrollState)

 Title: onScrollStateChanged

 boolean
onTouchEvent(MotionEvent ev)

 Title: onTouchEvent

 void
setAdapter(ListAdapter adapter)

 Title: setAdapter

 void
setOnScrollListener(OnScrollListener l)

 Title: setOnScrollListener

 void
setPullLoadEnable(boolean enable)

          enable or disable pull up load more feature.

 void
setPullRefreshEnable(boolean enable)

          enable or disable pull down refresh feature.

 void
setRefreshTime(java.lang.String time)

          set last refresh time.

 void
setXListViewListener(XListView.IXListViewListener l)

          Sets the x list view listener.

 void
stopLoadMore()

          stop load more, reset footer view.

 void
stopRefresh()

          stop refresh, reset header view.

Methods inherited from class java.lang.Object

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

Field Detail

LOAD_ALL

public static final int LOAD_ALL

The Constant LOAD_ALL.

See Also:
Constant Field Values

Constructor Detail

XListView

public XListView(Context context)

Instantiates a new x list view.

Parameters:
context - the context

XListView

public XListView(Context context,
                 AttributeSet attrs)

Instantiates a new x list view.

Parameters:
context - the context
attrs - the attrs

XListView

public XListView(Context context,
                 AttributeSet attrs,
                 int defStyle)

Instantiates a new x list view.

Parameters:
context - the context
attrs - the attrs
defStyle - the def style

Method Detail

computeScroll

public void computeScroll()

 Title: computeScroll

 Description:

See Also:
android.view.View#computeScroll()

LoadAll

public void LoadAll()

Load all.

onScroll

public void onScroll(AbsListView view,
                     int firstVisibleItem,
                     int visibleItemCount,
                     int totalItemCount)

 Title: onScroll

 Description:

Parameters:
view -
firstVisibleItem -
visibleItemCount -
totalItemCount -
See Also:
android.widget.AbsListView.OnScrollListener#onScroll(android.widget.AbsListView,
      int, int, int)

onScrollStateChanged

public void onScrollStateChanged(AbsListView view,
                                 int scrollState)

 Title: onScrollStateChanged

 Description:

Parameters:
view -
scrollState -
See Also:
android.widget.AbsListView.OnScrollListener#onScrollStateChanged(android.widget.AbsListView,
      int)

onTouchEvent

public boolean onTouchEvent(MotionEvent ev)

 Title: onTouchEvent

 Description:

Parameters:
ev -

Returns:

See Also:
android.widget.AbsListView#onTouchEvent(android.view.MotionEvent)

setAdapter

public void setAdapter(ListAdapter adapter)

 Title: setAdapter

 Description:

Parameters:
adapter -
See Also:
android.widget.ListView#setAdapter(android.widget.ListAdapter)

setOnScrollListener

public void setOnScrollListener(OnScrollListener l)

 Title: setOnScrollListener

 Description:

Parameters:
l -
See Also:
android.widget.AbsListView#setOnScrollListener(android.widget.AbsListView.OnScrollListener)

setPullLoadEnable

public void setPullLoadEnable(boolean enable)

enable or disable pull up load more feature.

Parameters:
enable - the new pull load enable

setPullRefreshEnable

public void setPullRefreshEnable(boolean enable)

enable or disable pull down refresh feature.

Parameters:
enable - the new pull refresh enable

setRefreshTime

public void setRefreshTime(java.lang.String time)

set last refresh time.

Parameters:
time - the new refresh time

setXListViewListener

public void setXListViewListener(XListView.IXListViewListener l)

Sets the x list view listener.

Parameters:
l - the new x list view listener

stopLoadMore

public void stopLoadMore()

stop load more, reset footer view.

stopRefresh

public void stopRefresh()

stop refresh, reset header view.

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
package io.nodus.util.var;

import io.nodus.util.field.DescriptorType;

/**
 * Created by erwolff on 8/14/2014.
 */
public class FirstLastEmailMatch {

  private String first;
  private String last;
  private String fullName;
  private String emailHost;
  private String email;

  public FirstLastEmailMatch() {

  }

  public FirstLastEmailMatch(String first, String last, String email) {
    this.first = first;
    this.last = last;
    this.email = email;
  }

  public String getFirst() {
    return first;
  }

  public void setFirst(String first) {
    this.first = first;
  }

  public String getLast() {
    return last;
  }

  public void setLast(String last) {
    this.last = last;
  }

  public String getFullName() {
    return fullName;
  }

  public void setFullName(String fullName) {
    this.fullName = fullName;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public void setEmailHost(String emailHost) {
    this.emailHost = emailHost;
  }

  public void buildFullName() {
    if (first != null && last != null) {
      fullName = first + " " + last;
    }
  }

  public void buildEmail() {
    if (first != null && last != null && emailHost != null) {
      email = first + "." + last + "@" + emailHost;
    }
  }

  public String resolveDescriptorTypeToVar(DescriptorType type) {
    switch (type) {
      case FIRST_NAME:
        return first;
      case LAST_NAME:
        return last;
      case FULL_NAME:
        return fullName;
      case EMAIL:
        return email;
    }
    return null;
  }

  public void clearVarFromDescriptorType(DescriptorType type) {
    switch (type) {
      case FIRST_NAME:
        first = null;
        break;
      case LAST_NAME:
        last = null;
        break;
      case FULL_NAME:
        fullName = null;
        break;
      case EMAIL:
        email = null;
        break;
    }
  }

  public FirstLastEmailMatch getCopy() {
    FirstLastEmailMatch copy = new FirstLastEmailMatch(first, last, email);
    copy.setFullName(fullName);
    copy.setEmailHost(emailHost);
    return copy;
  }
}


text:
'use strict';

var NS = {
  xlink: 'http://www.w3.org/1999/xlink',
  xml: 'http://www.w3.org/XML/1998/namespace',
};

// We use attributes for everything SVG so let's avoid some duplication and run
// code instead.
// The following are all specified in the HTML config already so we exclude here.
// - class (as className)
// - color
// - height
// - id
// - lang
// - max
// - media
// - method
// - min
// - name
// - style
// - target
// - type
// - width
var ATTRS = {
  accentHeight: 'accent-height',
  accumulate: 0,
  additive: 0,
  alignmentBaseline: 'alignment-baseline',
  allowReorder: 'allowReorder',
  alphabetic: 0,
  amplitude: 0,
  arabicForm: 'arabic-form',
  ascent: 0,
  attributeName: 'attributeName',
  attributeType: 'attributeType',
  autoReverse: 'autoReverse',
  azimuth: 0,
  baseFrequency: 'baseFrequency',
  baseProfile: 'baseProfile',
  baselineShift: 'baseline-shift',
  bbox: 0,
  begin: 0,
  bias: 0,
  by: 0,
  calcMode: 'calcMode',
  capHeight: 'cap-height',
  clip: 0,
  clipPath: 'clip-path',
  clipRule: 'clip-rule',
  clipPathUnits: 'clipPathUnits',
  colorInterpolation: 'color-interpolation',
  colorInterpolationFilters: 'color-interpolation-filters',
  colorProfile: 'color-profile',
  colorRendering: 'color-rendering',
  contentScriptType: 'contentScriptType',
  contentStyleType: 'contentStyleType',
  cursor: 0,
  cx: 0,
  cy: 0,
  d: 0,
  decelerate: 0,
  descent: 0,
  diffuseConstant: 'diffuseConstant',
  direction: 0,
  display: 0,
  divisor: 0,
  dominantBaseline: 'dominant-baseline',
  dur: 0,
  dx: 0,
  dy: 0,
  edgeMode: 'edgeMode',
  elevation: 0,
  enableBackground: 'enable-background',
  end: 0,
  exponent: 0,
  externalResourcesRequired: 'externalResourcesRequired',
  fill: 0,
  fillOpacity: 'fill-opacity',
  fillRule: 'fill-rule',
  filter: 0,
  filterRes: 'filterRes',
  filterUnits: 'filterUnits',
  floodColor: 'flood-color',
  floodOpacity: 'flood-opacity',
  focusable: 0,
  fontFamily: 'font-family',
  fontSize: 'font-size',
  fontSizeAdjust: 'font-size-adjust',
  fontStretch: 'font-stretch',
  fontStyle: 'font-style',
  fontVariant: 'font-variant',
  fontWeight: 'font-weight',
  format: 0,
  from: 0,
  fx: 0,
  fy: 0,
  g1: 0,
  g2: 0,
  glyphName: 'glyph-name',
  glyphOrientationHorizontal: 'glyph-orientation-horizontal',
  glyphOrientationVertical: 'glyph-orientation-vertical',
  glyphRef: 'glyphRef',
  gradientTransform: 'gradientTransform',
  gradientUnits: 'gradientUnits',
  hanging: 0,
  horizAdvX: 'horiz-adv-x',
  horizOriginX: 'horiz-origin-x',
  ideographic: 0,
  imageRendering: 'image-rendering',
  in: 0,
  in2: 0,
  intercept: 0,
  k: 0,
  k1: 0,
  k2: 0,
  k3: 0,
  k4: 0,
  kernelMatrix: 'kernelMatrix',
  kernelUnitLength: 'kernelUnitLength',
  kerning: 0,
  keyPoints: 'keyPoints',
  keySplines: 'keySplines',
  keyTimes: 'keyTimes',
  lengthAdjust: 'lengthAdjust',
  letterSpacing: 'letter-spacing',
  lightingColor: 'lighting-color',
  limitingConeAngle: 'limitingConeAngle',
  local: 0,
  markerEnd: 'marker-end',
  markerMid: 'marker-mid',
  markerStart: 'marker-start',
  markerHeight: 'markerHeight',
  markerUnits: 'markerUnits',
  markerWidth: 'markerWidth',
  mask: 0,
  maskContentUnits: 'maskContentUnits',
  maskUnits: 'maskUnits',
  mathematical: 0,
  mode: 0,
  numOctaves: 'numOctaves',
  offset: 0,
  opacity: 0,
  operator: 0,
  order: 0,
  orient: 0,
  orientation: 0,
  origin: 0,
  overflow: 0,
  overlinePosition: 'overline-position',
  overlineThickness: 'overline-thickness',
  paintOrder: 'paint-order',
  panose1: 'panose-1',
  pathLength: 'pathLength',
  patternContentUnits: 'patternContentUnits',
  patternTransform: 'patternTransform',
  patternUnits: 'patternUnits',
  pointerEvents: 'pointer-events',
  points: 0,
  pointsAtX: 'pointsAtX',
  pointsAtY: 'pointsAtY',
  pointsAtZ: 'pointsAtZ',
  preserveAlpha: 'preserveAlpha',
  preserveAspectRatio: 'preserveAspectRatio',
  primitiveUnits: 'primitiveUnits',
  r: 0,
  radius: 0,
  refX: 'refX',
  refY: 'refY',
  renderingIntent: 'rendering-intent',
  repeatCount: 'repeatCount',
  repeatDur: 'repeatDur',
  requiredExtensions: 'requiredExtensions',
  requiredFeatures: 'requiredFeatures',
  restart: 0,
  result: 0,
  rotate: 0,
  rx: 0,
  ry: 0,
  scale: 0,
  seed: 0,
  shapeRendering: 'shape-rendering',
  slope: 0,
  spacing: 0,
  specularConstant: 'specularConstant',
  specularExponent: 'specularExponent',
  speed: 0,
  spreadMethod: 'spreadMethod',
  startOffset: 'startOffset',
  stdDeviation: 'stdDeviation',
  stemh: 0,
  stemv: 0,
  stitchTiles: 'stitchTiles',
  stopColor: 'stop-color',
  stopOpacity: 'stop-opacity',
  strikethroughPosition: 'strikethrough-position',
  strikethroughThickness: 'strikethrough-thickness',
  string: 0,
  stroke: 0,
  strokeDasharray: 'stroke-dasharray',
  strokeDashoffset: 'stroke-dashoffset',
  strokeLinecap: 'stroke-linecap',
  strokeLinejoin: 'stroke-linejoin',
  strokeMiterlimit: 'stroke-miterlimit',
  strokeOpacity: 'stroke-opacity',
  strokeWidth: 'stroke-width',
  surfaceScale: 'surfaceScale',
  systemLanguage: 'systemLanguage',
  tableValues: 'tableValues',
  targetX: 'targetX',
  targetY: 'targetY',
  textAnchor: 'text-anchor',
  textDecoration: 'text-decoration',
  textRendering: 'text-rendering',
  textLength: 'textLength',
  to: 0,
  transform: 0,
  u1: 0,
  u2: 0,
  underlinePosition: 'underline-position',
  underlineThickness: 'underline-thickness',
  unicode: 0,
  unicodeBidi: 'unicode-bidi',
  unicodeRange: 'unicode-range',
  unitsPerEm: 'units-per-em',
  vAlphabetic: 'v-alphabetic',
  vHanging: 'v-hanging',
  vIdeographic: 'v-ideographic',
  vMathematical: 'v-mathematical',
  values: 0,
  vectorEffect: 'vector-effect',
  version: 0,
  vertAdvY: 'vert-adv-y',
  vertOriginX: 'vert-origin-x',
  vertOriginY: 'vert-origin-y',
  viewBox: 'viewBox',
  viewTarget: 'viewTarget',
  visibility: 0,
  widths: 0,
  wordSpacing: 'word-spacing',
  writingMode: 'writing-mode',
  x: 0,
  xHeight: 'x-height',
  x1: 0,
  x2: 0,
  xChannelSelector: 'xChannelSelector',
  xlinkActuate: 'xlink:actuate',
  xlinkArcrole: 'xlink:arcrole',
  xlinkHref: 'xlink:href',
  xlinkRole: 'xlink:role',
  xlinkShow: 'xlink:show',
  xlinkTitle: 'xlink:title',
  xlinkType: 'xlink:type',
  xmlBase: 'xml:base',
  xmlns: 0,
  xmlnsXlink: 'xmlns:xlink',
  xmlLang: 'xml:lang',
  xmlSpace: 'xml:space',
  y: 0,
  y1: 0,
  y2: 0,
  yChannelSelector: 'yChannelSelector',
  z: 0,
  zoomAndPan: 'zoomAndPan',
};

var SVGDOMPropertyConfig = {
  Properties: {},
  DOMAttributeNamespaces: {
    xlinkActuate: NS.xlink,
    xlinkArcrole: NS.xlink,
    xlinkHref: NS.xlink,
    xlinkRole: NS.xlink,
    xlinkShow: NS.xlink,
    xlinkTitle: NS.xlink,
    xlinkType: NS.xlink,
    xmlBase: NS.xml,
    xmlLang: NS.xml,
    xmlSpace: NS.xml,
  },
  DOMAttributeNames: {},
};

Object.keys(ATTRS).forEach((key) => {
  SVGDOMPropertyConfig.Properties[key] = 0;
  if (ATTRS[key]) {
    SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
  }
});

module.exports = SVGDOMPropertyConfig;


text:
{% extends "_base.html" %}
{% block content %}

{{ title }}

    There is no track with ID {{ track_id }} in the AcoustID database.

{% endblock %}


text:
/**
 * Application main package.
 */
package org.keyboardplaying.dailytasks;


text:
package org.apache.jackrabbit.test.api.version;

import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.UnsupportedRepositoryOperationException;
import javax.jcr.nodetype.NodeType;
import javax.jcr.version.Version;
import javax.jcr.version.VersionManager;

/**
 * ConfigurationsTest covers methods related to the Configurations
 * feature in Versioning.
 * @test
 * @sources ConfigurationsTest.java
 * @executeClass org.apache.jackrabbit.test.api.version.ConfigurationsTest
 * @keywords versioning
 * @since JCR 2.0
 */
public class ConfigurationsTest extends AbstractVersionTest {

    private VersionManager vm;

    private static String PREFIX = "/jcr:system/jcr:configurations/";

    private String ntConfiguration;

    private Node versionableNode2;

    protected void setUp() throws Exception {
        super.setUp();
        checkSupportedOption(Repository.OPTION_BASELINES_SUPPORTED);
        vm = superuser.getWorkspace().getVersionManager();

        versionableNode2 = createVersionableNode(testRootNode, nodeName4, versionableNodeType);

        ntConfiguration = superuser.getNamespacePrefix(NS_NT_URI) + ":configuration";

    }

    protected void tearDown() throws Exception {
        // remove configuration, otherwise
        // subsequent tests will fail when cleaning the test root
        if (versionableNode != null) {
            removeConfiguration(versionableNode);
        }
        removeConfiguration(versionableNode2);
        versionableNode2.remove();
        // save is called in super.tearDown()
        super.tearDown();
    }

    private void removeConfiguration(Node node) throws RepositoryException {
        if (node.hasProperty("jcr:configuration")) {
            node.getProperty("jcr:configuration").getNode().remove();
        }
    }

    public void testCreateConfiguration() throws Exception {
        Node config = vm.createConfiguration(versionableNode.getPath());
        assertNotNull(config);
        NodeType nt = config.getPrimaryNodeType();
        assertTrue("created node must be subtype of nt:configuration", nt.isNodeType(ntConfiguration));

        // check if the configuration points to the versionable
        assertTrue("jcr:root property of the configuration must reference the versionable node",
                config.getProperty("jcr:root").getNode().isSame(versionableNode));

        // check if the versionable points to the configuration
        assertTrue("jcr:configuration property of the versionable node must reference the configuration",
                versionableNode.getProperty("jcr:configuration").getNode().isSame(config));

    }

    public void testCreateConfigurationNotVersionableFails() throws Exception {
        try {
            vm.createConfiguration(nonVersionableNode.getPath());
            fail("Create configuration must fail for non-versionable node");
        } catch (UnsupportedRepositoryOperationException e) {
            // ignore
        }
    }

    public void testCreateConfigurationTwiceFails() throws Exception {
        vm.createConfiguration(versionableNode.getPath());
        try {
            vm.createConfiguration(versionableNode.getPath());
            fail("Create configuration must fail if versionable is already a configuration");
        } catch (UnsupportedRepositoryOperationException e) {
            // ignore
        }
    }

    public void testConfigurationsPath() throws Exception {
        Node config = vm.createConfiguration(versionableNode.getPath());
        assertNotNull(config);
        NodeType nt = config.getPrimaryNodeType();
        assertTrue("created node must be subtype of nt:configuration", nt.isNodeType(ntConfiguration));

        assertTrue("path for configuration must be below " + PREFIX + ", but was " +
                config.getPath(), config.getPath().startsWith(PREFIX));
    }

    public void testCheckinConfigFailsWithUnversionedChild() throws Exception {
        Node config = vm.createConfiguration(versionableNode.getPath());
        try {
            vm.checkin(config.getPath());
            fail("Checkin configuration must fail one of the recorded versions is not versioned.");
        } catch (UnsupportedRepositoryOperationException e) {
            // ignore
        }
    }

    public void testCheckinConfig() throws Exception {
        vm.checkin(versionableNode.getPath());
        Node config = vm.createConfiguration(versionableNode.getPath());
        vm.checkin(config.getPath());
    }

    public void testCreateConfigWithBaseline() throws Exception {
        // create configuration
        String path = versionableNode.getPath();
        Version baseVersion = vm.checkin(path);
        Node config = vm.createConfiguration(path);
        // record baseline
        Version baseline = vm.checkin(config.getPath());

        // remove workspace nodes
        removeConfiguration(versionableNode);
        versionableNode.remove();
        versionableNode = null;
        testRootNode.getSession().save();

        // and try to restore it
        vm.restore(path, baseline, true);

        versionableNode = testRootNode.getSession().getNode(path);
        Version baseVersion2 = vm.getBaseVersion(versionableNode.getPath());
        assertTrue("restored node must have former base version.", baseVersion.isSame(baseVersion2));

        config = versionableNode.getProperty("jcr:configuration").getNode();

        // base version of config must be baseline
        assertTrue("Baseversion of restored config must be given baseline.",
                vm.getBaseVersion(config.getPath()).isSame(baseline));

    }

    public void testCreateConfigWithNonExistentParentFails() throws Exception {
        // create configuration
        String path = versionableNode.getPath();
        vm.checkin(path);
        Node config = vm.createConfiguration(path);
        // record baseline
        Version baseline = vm.checkin(config.getPath());

        // remove workspace nodes
        removeConfiguration(versionableNode);
        versionableNode.remove();
        versionableNode = null;
        testRootNode.getSession().save();

        try {
            vm.restore("/non/existent/parent", baseline, true);
            fail("Create configuration must fail if parent does not exist.");
        } catch (RepositoryException e) {
            // ignore
        }
    }

    public void testCreateConfigWithExistentConfigFromBaselineFails() throws Exception {
        // create configuration
        String path = versionableNode.getPath();
        vm.checkin(path);
        Node config = vm.createConfiguration(path);
        // record baseline
        Version baseline = vm.checkin(config.getPath());

        try {
            vm.restore(testRoot + "/nonExisting", baseline, true);
            fail("Create configuration must fail if config recorded in baseline already exists.");
        } catch (RepositoryException e) {
            // ignore
        }
    }

    public void testRestoreBaseline() throws Exception {
        // create configuration
        String path = versionableNode.getPath();
        Version bv1 = vm.checkpoint(path);
        Node config = vm.createConfiguration(path);
        // record baseline 1 (should contain bv1)
        Version bl1 = vm.checkpoint(config.getPath());
        // create bv2
        Version bv2 = vm.checkpoint(path);
        // record baseline 2 (should contain bv2)
        Version bl2 = vm.checkpoint(config.getPath());

        // restore bl1
        vm.restore(bl1, true);
        Version bv = vm.getBaseVersion(path);
        assertTrue("restored node must have former base version V1.0.", bv.isSame(bv1));

        // restore bl2
        vm.restore(bl2, true);
        bv = vm.getBaseVersion(path);
        assertTrue("restored node must have former base version V1.1.", bv.isSame(bv2));
    }

    public void testRestoreConfig() throws Exception {
        // create configuration
        String path = versionableNode.getPath();
        Version bv1 = vm.checkpoint(path);
        Node config = vm.createConfiguration(path);
        String configPath = config.getPath();

        // record baseline 1 (should contain bv1)
        Version bl1 = vm.checkpoint(config.getPath());
        // create bv2
        Version bv2 = vm.checkpoint(path);
        // record baseline 2 (should contain bv2)
        Version bl2 = vm.checkpoint(config.getPath());

        // restore bl1
        vm.restore(configPath, bl1.getName(), true);
        Version bv = vm.getBaseVersion(path);
        assertTrue("restored node must have former base version V1.0.", bv.isSame(bv1));

        // restore bl2
        vm.restore(configPath, bl2.getName(), true);
        bv = vm.getBaseVersion(path);
        assertTrue("restored node must have former base version V1.1.", bv.isSame(bv2));
    }
}


text:
package org.jboss.weld.tests.extensions.lifecycle.processBean.annotated;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import jakarta.enterprise.event.Observes;
import jakarta.enterprise.inject.spi.Bean;
import jakarta.enterprise.inject.spi.Extension;
import jakarta.enterprise.inject.spi.ProcessBean;

public class VerifyingExtension implements Extension {

    private final Set<Bean<?>> invalidBeans = new HashSet<Bean<?>>();

    void observeBean(@Observes ProcessBean<?> event) {
        if (event.getAnnotated() == null) {
            invalidBeans.add(event.getBean());
        }
    }

    public Set<Bean<?>> getInvalidBeans() {
        return Collections.unmodifiableSet(invalidBeans);
    }
}


text:
@implementation UMERedView

- (id)initWithFrame:(NSRect)frame {
    if (self = [super initWithFrame:frame]) {

    }
    return self;
}

- (BOOL)isOpaque {
    return YES;
}

- (void)drawRect:(NSRect)r {
    NSDrawWindowBackground(r);
    [super drawRect:r];
//    [[NSColor redColor] set];
//    NSRectFill(r);
}

@end


text:
<?php

namespace Sonata\ProductBundle\Menu;

use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Sonata\ClassificationBundle\Model\CategoryInterface;
use Sonata\Component\Product\ProductCategoryManagerInterface;
use Sonata\Component\Product\ProductProviderInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouterInterface;

/**
 * Class ProductMenuBuilder
 *
 * @package Sonata\ProductBundle\Menu
 *
 * @author Hugo Briand <briand@ekino.com>
 */
class ProductMenuBuilder
{
    /**
     * @var FactoryInterface
     */
    protected $factory;

    /**
     * @var ProductCategoryManagerInterface
     */
    protected $categoryManager;

    /**
     * @var RouterInterface
     */
    protected $router;

    /**
     * Constructor
     *
     * @param MenuFactory                     $factory
     * @param ProductCategoryManagerInterface $categoryManager
     * @param RouterInterface                 $router
     */
    public function __construct(FactoryInterface $factory, ProductCategoryManagerInterface $categoryManager, RouterInterface $router)
    {
        $this->factory         = $factory;
        $this->categoryManager = $categoryManager;
        $this->router          = $router;
    }

    /**
     * Generates the filters menu based on $productProvider
     *
     * @param ProductProviderInterface $productProvider
     * @param array                    $itemOptions
     * @param string                   $currentUri
     *
     * @return mixed
     */
    public function createFiltersMenu(ProductProviderInterface $productProvider, array $itemOptions = array(), $currentUri = null)
    {
        $menu = $this->factory->createItem('filters', $itemOptions);

        $filters = $productProvider->getFilters();

        foreach ($filters as $filter => $options) {
            $menuItem = $menu->addChild($filter, array_merge(array('attributes' => array('class' => 'nav-header')), $itemOptions));

            foreach ($options as $option) {
                $filterItemOptions = array_merge(array('uri' => $this->getFilterUri($currentUri, $filter, $option)), $itemOptions);

                $menuItem->addChild(
                    $this->getFilterName($filter, $option),
                    $filterItemOptions
                );
            }
            $menuItem->setCurrentUri($currentUri);
        }

        return $menu;
    }

    /**
     * @param array  $itemOptions The options given to the created menuItem
     * @param string $currentUri  The current URI
     *
     * @return \Knp\Menu\ItemInterface
     */
    public function createCategoryMenu(array $itemOptions = array(), $currentUri = null)
    {
        $menu = $this->factory->createItem('categories', $itemOptions);

        $this->buildCategoryMenu($menu, $itemOptions, $currentUri);

        return $menu;
    }

    /**
     * @param \Knp\Menu\ItemInterface $menu        The item to fill with $routes
     * @param array                   $options     The item options
     * @param string                  $currentUri  The current URI
     */
    public function buildCategoryMenu(ItemInterface $menu, array $options = array(), $currentUri = null)
    {
        $categories = $this->categoryManager->getCategoryTree();

        $this->fillMenu($menu, $categories, $options, $currentUri);
    }

    /**
     * Generates the name of the filter based on $filter and $option
     *
     * @param $filter
     * @param $option
     * @return string
     */
    protected function getFilterName($filter, $option)
    {
        return sprintf("%s_%s", $filter, $option);
    }

    /**
     * Generates the filter uri
     *
     * @param $currentUri
     * @param $filter
     * @param $option
     * @return string
     */
    protected function getFilterUri($currentUri, $filter, $option)
    {
        return sprintf("%s?filter=%s&option=%s", false !== ($pos = strpos($currentUri, '?')) ? substr($currentUri, 0, $pos) : $currentUri, $filter, $option);
    }

    /**
     * Recursive method to fill $menu with $categories
     *
     * @param ItemInterface $menu
     * @param array         $categories
     * @param array         $options
     * @param string        $currentUri
     */
    protected function fillMenu(ItemInterface $menu, $categories, array $options = array(), $currentUri = null)
    {
        foreach ($categories as $category) {
            if (false === $category->getEnabled()) {
                continue;
            }

            $fullOptions = array_merge(array(
                'attributes'      => array('class' => ""),      // Ensuring it is set
                'route'           => 'sonata_catalog_category',
                'routeParameters' => array(
                    'category_id'   => $category->getId(),
                    'category_slug' => $category->getSlug()
                ),
                'extras'           => array(
                    'safe_label' => true
                )
            ), $options);

            if (null === $category->getParent()) {
                $fullOptions['attributes']['class'] = 'lead '.$fullOptions['attributes']['class'];
            }

            $child = $menu->addChild(
                $this->getCategoryTitle($category),
                $fullOptions
            );

            if (count($category->getChildren()) > 0) {
                if (null === $category->getParent()) {
                    $this->fillMenu($menu, $category->getChildren(), $options, $currentUri);
                } else {
                    $this->fillMenu($child, $category->getChildren(), $options, $currentUri);
                }
            }
        }

        $menu->setCurrentUri($currentUri);
    }

    /**
     * Gets the HTML associated with the category menu title
     *
     * @param CategoryInterface $category A category instance
     * @param int               $limit    A limit for calculation (fixed to 500 by default)
     *
     * @return string
     */
    protected function getCategoryTitle(CategoryInterface $category, $limit = 500)
    {
        $count = $this->categoryManager->getProductCount($category, $limit);

        return sprintf("%s %d%s", $category->getName(), $count, $count > $limit ? '+' : '');
    }
}


text:
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using LINQPad;

namespace RedisStore
{
    public class Async<T> : ICustomMemberProvider
    {
        //So, either it's on it's way in, and it has the value to set...
        internal T _setValue;
        internal Task _setTask;

        //Or it's on it's way out
        internal Task<T> _task;

        public ConfiguredTaskAwaitable ConfigureAwait(bool continueOnCapturedContext)
        {
            return (_setTask ?? _task).ConfigureAwait(continueOnCapturedContext);
        }

        public static implicit operator Async<T>(T source)
        {
            return new Async<T> { _setValue = source };
        }

        public static implicit operator Task(Async<T> source)
        {
            return (source._setTask ?? source._task);
        }

        public static explicit operator Task<T>(Async<T> source)
        {
            return source._task;
        }

        public static explicit operator Async<T>(Task<T> source)
        {
            return new Async<T> {_task = source};
        }

        public IEnumerable<string> GetNames()
        {
            yield return "Value";
        }

        public IEnumerable<Type> GetTypes()
        {
            yield return typeof (Task<T>);
        }

        public IEnumerable<object> GetValues()
        {
            yield return _task;
        }
    }
}

namespace LINQPad
{
    public interface ICustomMemberProvider
    {
        // Each of these methods must return a sequence
        // with the same number of elements:
        IEnumerable<string> GetNames();
        IEnumerable<Type> GetTypes();
        IEnumerable<object> GetValues();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/text"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="5sp"
    android:textSize="25sp" >

</TextView><!-- From: file:/Users/afour/Desktop/Parse-Todo-Project-1/ToDoList/res/layout/todo_row.xml -->


text:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
    <groupId>com.splunk</groupId>
    <artifactId>mint-gradle-android-plugin</artifactId>
    <versioning>
        <release>5.2.1</release>
        <versions>
            <version>5.2.1</version>
        </versions>
        <lastUpdated>20161219213235</lastUpdated>
    </versioning>
</metadata>


text:
#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using SSGL.Core;
using SSGL.Entity.UI;
using System;
#endregion

namespace SSGL.Helper
{
    public class FPSCounter : BaseUI
    {
        public SpriteFont Font { get; set; }

        int frameRate = 0;
        int frameCounter = 0;
        TimeSpan elapsedTime = TimeSpan.Zero;

        public override void Update(GameTime gameTime)
        {
            elapsedTime += gameTime.ElapsedGameTime;

            if (elapsedTime > TimeSpan.FromSeconds(1))
            {
                elapsedTime -= TimeSpan.FromSeconds(1);
                frameRate = frameCounter;
                frameCounter = 0;
            }
        }

        public override void Draw(GameTime gameTime)
        {
            frameCounter++;
            string fps = string.Format("fps: {0} mem : {1}", frameRate, GC.GetTotalMemory(false));
            GameDirector.SpriteBatch.DrawString(Font, fps, new Vector2(1, 1), Color.Black);
            GameDirector.SpriteBatch.DrawString(Font, fps, new Vector2(0, 0), Color.Red);
        }
    }
}


text:
php-helpers
===========

A collection of helper functions written in PHP for PHP.

Full documentation is currently being worked on.
Class documentation available at http://duncan3dc.github.io/php-helpers/

[![Build Status](https://travis-ci.org/duncan3dc/php-helpers.svg?branch=master)](https://travis-ci.org/duncan3dc/php-helpers)
[![Latest Stable Version](https://poser.pugx.org/duncan3dc/helpers/version.svg)](https://packagist.org/packages/duncan3dc/helpers)


text:
/* eslint-disable global-require */
const rules = {
  ...{
    'block-no-empty': null,
    'comment-empty-line-before': null,
    'declaration-block-no-duplicate-properties': [
      true,
      { ignoreProperties: ['-styled-mixin'] },
    ],
    'declaration-empty-line-before': null,
    'number-leading-zero': null,
    'rule-empty-line-before': null,
    'property-no-vendor-prefix': null,
    // Bug exists in ts where it matches across different styled css rules
    'no-descending-specificity': null,
    // Bug exists in ts where interpolated values trigger these two rules
    'selector-type-case': null,
    'selector-type-no-unknown': null,
    'no-duplicate-selectors': null,

    'plugin/no-unsupported-browser-features': [true, { severity: 'warning' }],
  },
  ...require('./rules/a11y'),
  ...require('./rules/images'),
  ...require('./rules/order'),
};

module.exports = {
  processors: ['stylelint-processor-styled-components'],
  extends: [
    'stylelint-config-recommended',
    'stylelint-config-styled-components',
    'stylelint-no-unsupported-browser-features',
    'stylelint-config-prettier',
  ],
  plugins: [
    'stylelint-order',
    'stylelint-images',
    'stylelint-no-unsupported-browser-features',
    'stylelint-a11y',
  ],
  syntax: 'scss',
  rules,
};


text:
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using BodeAbp.Product.Attributes.Domain;

namespace BodeAbp.Product.Products.Domain
{
    /// <summary>
    /// 商品属性关系
    /// </summary>
    [Table("Product_ProductAttribute")]
    public class ProductAttributeMap : Entity<long>
    {
        /// <summary>
        /// 产品Id
        /// </summary>
        public long ProductId { get; set; }

        /// <summary>
        /// 产品
        /// </summary>
        [ForeignKey("ProductId")]
        public virtual Product Product { get; set; }

        /// <summary>
        /// 属性Id
        /// </summary>
        public int AttributeId { get; set; }

        /// <summary>
        /// 属性
        /// </summary>
        [ForeignKey("AttributeId")]
        public virtual ProductAttribute Attribute { get; set; }

        /// <summary>
        /// 属性值
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// 属性选项Id集合(当属性类型为Switch/Multiple时有效)
        /// </summary>
        public string AttributeOptionIds { get; set; }
    }
}


text:
/** Automatically generated file. DO NOT MODIFY */
package com.jk184.jksafe;

public final class BuildConfig {
    public final static boolean DEBUG = true;
}