text:
<?xml version="1.0" encoding="UTF-8"?>
<dataSource name="d73u6atflfqjbf@ec2-23-21-96-159.compute-1.amazonaws.com">
  <database-model serializer="dbm" rdbms="POSTGRES" format-version="4.2">
    <root id="1"/>
    <database id="2" parent="1" name="d73u6atflfqjbf">
      <ObjectId>6580609</ObjectId>
      <Current>1</Current>
      <Visible>1</Visible>
    </database>
    <schema id="3" parent="2" name="public">
      <ObjectId>2200</ObjectId>
      <IntrospectionTimestamp>2017-09-02.21:46:16.618</IntrospectionTimestamp>
      <IntrospectionStateNumber>93433939</IntrospectionStateNumber>
      <Current>1</Current>
      <Visible>1</Visible>
    </schema>
    <schema id="4" parent="2" name="pg_catalog">
      <ObjectId>11</ObjectId>
    </schema>
    <schema id="5" parent="2" name="pg_toast">
      <ObjectId>99</ObjectId>
    </schema>
    <schema id="6" parent="2" name="pg_temp_1">
      <ObjectId>11848</ObjectId>
    </schema>
    <schema id="7" parent="2" name="pg_toast_temp_1">
      <ObjectId>11849</ObjectId>
    </schema>
    <schema id="8" parent="2" name="information_schema">
      <ObjectId>13003</ObjectId>
    </schema>
    <sequence id="9" parent="3" name="gasto_id_seq">
      <ObjectId>10809916</ObjectId>
      <StateNumber>18439219</StateNumber>
      <SequenceIdentity>1</SequenceIdentity>
      <BelongsToColumn>1</BelongsToColumn>
    </sequence>
    <sequence id="10" parent="3" name="gasto_seq">
      <ObjectId>7118100</ObjectId>
      <StateNumber>9815734</StateNumber>
      <SequenceIdentity>1</SequenceIdentity>
    </sequence>
    <sequence id="11" parent="3" name="realizado_id_seq">
      <ObjectId>10809924</ObjectId>
      <StateNumber>18439220</StateNumber>
      <SequenceIdentity>1</SequenceIdentity>
      <BelongsToColumn>1</BelongsToColumn>
    </sequence>

      <ObjectId>10809918</ObjectId>
      <StateNumber>18439220</StateNumber>

      <ObjectId>10809926</ObjectId>
      <StateNumber>18439220</StateNumber>

    <column id="14" parent="12" name="id">
      <Position>1</Position>
      <DataType>integer|0</DataType>
      <NotNull>1</NotNull>
      <StateNumber>18439219</StateNumber>
      <SequenceName>gasto_id_seq</SequenceName>
      <DefaultExpression>nextval('gasto_id_seq'::regclass)</DefaultExpression>
    </column>
    <column id="15" parent="12" name="descricao_previsto">
      <Position>2</Position>
      <DataType>varchar(255)|0</DataType>
      <StateNumber>93433868</StateNumber>
    </column>
    <column id="16" parent="12" name="valor_previsto">
      <Position>3</Position>
      <DataType>real|0</DataType>
      <StateNumber>93433869</StateNumber>
    </column>
    <column id="17" parent="12" name="total_realizado">
      <Position>4</Position>
      <DataType>real|0</DataType>
      <StateNumber>93433870</StateNumber>
    </column>
    <column id="18" parent="12" name="saldo">
      <Position>5</Position>
      <DataType>real|0</DataType>
      <StateNumber>93433871</StateNumber>
    </column>
    <column id="19" parent="12" name="created_at">
      <Position>6</Position>
      <DataType>date|0</DataType>
      <StateNumber>18439219</StateNumber>
    </column>
    <index id="20" parent="12" name="gasto_pkey">
      <ObjectId>10809922</ObjectId>
      <ColNames>id</ColNames>
      <Unique>1</Unique>
    </index>
    <key id="21" parent="12" name="gasto_pkey">
      <ObjectId>10809923</ObjectId>
      <ColNames>id</ColNames>
      <UnderlyingIndexName>gasto_pkey</UnderlyingIndexName>
      <Primary>1</Primary>
    </key>
    <column id="22" parent="13" name="id">
      <Position>1</Position>
      <DataType>integer|0</DataType>
      <NotNull>1</NotNull>
      <StateNumber>18439220</StateNumber>
      <SequenceName>realizado_id_seq</SequenceName>
      <DefaultExpression>nextval('realizado_id_seq'::regclass)</DefaultExpression>
    </column>
    <column id="23" parent="13" name="descricao">
      <Position>2</Position>
      <DataType>varchar(255)|0</DataType>
      <StateNumber>93433936</StateNumber>
    </column>
    <column id="24" parent="13" name="valor">
      <Position>3</Position>
      <DataType>real|0</DataType>
      <StateNumber>93433937</StateNumber>
    </column>
    <column id="25" parent="13" name="gasto_id">
      <Position>4</Position>
      <DataType>integer|0</DataType>
      <StateNumber>93433939</StateNumber>
    </column>
    <index id="26" parent="13" name="realizado_pkey">
      <ObjectId>10809930</ObjectId>
      <ColNames>id</ColNames>
      <Unique>1</Unique>
    </index>
    <index id="27" parent="13" name="realizado_gasto_id">
      <ObjectId>10809937</ObjectId>
      <ColNames>gasto_id</ColNames>
    </index>
    <key id="28" parent="13" name="realizado_pkey">
      <ObjectId>10809931</ObjectId>
      <ColNames>id</ColNames>
      <UnderlyingIndexName>realizado_pkey</UnderlyingIndexName>
      <Primary>1</Primary>
    </key>
    <foreign-key id="29" parent="13" name="realizado_gasto_id_fkey">
      <ObjectId>10809932</ObjectId>
      <ColNames>gasto_id</ColNames>
      <RefTableName>gasto</RefTableName>
      <RefKeyName>gasto_pkey</RefKeyName>
      <RefColNames>id</RefColNames>
    </foreign-key>
  </database-model>
</dataSource>


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<link rel="stylesheet" href="style.css" />
		<title>Inscription</title>

			<form action="connexion.php" method="post">
					Pseudo : <input type="text" name="user" required/>

					Mot de passe : <input type="password" name="password" required/>

					<input class="submit" type="submit" value="Valider" />
		    </form>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Robert430404\StatsyCli\Monitoring;

use League\CLImate\CLImate;
use Robert430404\StatsyCli\Contracts\Command;
use Tms157\Statsy\Cpu;
use Tms157\Statsy\Factories\CpuFactory;

/**
 * Class CpuMonitor
 *
 * @package Robert430404\StatsyCli\Monitoring
 */
class CpuMonitor implements Command
{
    /**
     * @var Cpu
     */
    private $cpu;

    /**
     * @var CLImate
     */
    private $climate;

    /**
     * CpuMonitor constructor.
     */
    public function __construct()
    {
        $this->climate = new CLImate();
        $this->cpu     = new Cpu(
            new CpuFactory()
        );
    }

    /**
     * Runs The Command
     *
     * This outputs an active display of memory information through the terminal for the purpose of monitoring the
     * memory usage.
     *
     * @return void
     */
    public function run(): void
    {
        while (true) {
            $this->refreshCpu();
            $this->displayOutput();
        }
    }

    /**
     * Refreshes The Memory Object With New Data
     *
     * TODO: Find A Better Way To Read Proc Updates
     *
     * @return void
     */
    private function refreshCpu(): void
    {
        $this->cpu = new Cpu(
            new CpuFactory()
        );
    }

    /**
     * Displays The Memory Monitoring Dashboard
     *
     * @return void
     */
    private function displayOutput(): void
    {
        $this->climate->clear();
        $this->climate->bold()->table([
            [
                'CPU Load'  => $this->cpu->getLoad()       . ' %',
                'CPU Model' => $this->cpu->getModel()      . ' GHz',
                'CPU Cores' => $this->cpu->getCores()      . ' GHz',
                'CPU Clock' => $this->cpu->getClockSpeed() . ' GHz',
                'CPU Cache' => $this->cpu->getCache()      . ' GHz',
            ],
        ]);
        sleep(1); // Forces A Refresh Every Second
    }
}


text:
#ifndef ZEPHYR_INCLUDE_PTP_CLOCK_H_
#define ZEPHYR_INCLUDE_PTP_CLOCK_H_

#include <stdint.h>
#include <device.h>
#include <misc/util.h>
#include <net/ptp_time.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Name of the PTP clock driver */
#if !defined(PTP_CLOCK_NAME)
#define PTP_CLOCK_NAME "PTP_CLOCK"
#endif

struct ptp_clock_driver_api {
	int (*set)(struct device *dev, struct net_ptp_time *tm);
	int (*get)(struct device *dev, struct net_ptp_time *tm);
	int (*adjust)(struct device *dev, int increment);
	int (*rate_adjust)(struct device *dev, float ratio);
};

/**
 * @brief Set the time of the PTP clock.
 *
 * @param dev PTP clock device
 * @param tm Time to set
 *
 * @return 0 if ok, <0 if error
 */
static inline int ptp_clock_set(struct device *dev, struct net_ptp_time *tm)
{
	const struct ptp_clock_driver_api *api = dev->driver_api;

	return api->set(dev, tm);
}

/**
 * @brief Get the time of the PTP clock.
 *
 * @param dev PTP clock device
 * @param tm Where to store the current time.
 *
 * @return 0 if ok, <0 if error
 */
static inline int ptp_clock_get(struct device *dev, struct net_ptp_time *tm)
{
	const struct ptp_clock_driver_api *api = dev->driver_api;

	return api->get(dev, tm);
}

/**
 * @brief Adjust the PTP clock time.
 *
 * @param dev PTP clock device
 * @param increment Increment of the clock in nanoseconds
 *
 * @return 0 if ok, <0 if error
 */
static inline int ptp_clock_adjust(struct device *dev, int increment)
{
	const struct ptp_clock_driver_api *api = dev->driver_api;

	return api->adjust(dev, increment);
}

/**
 * @brief Adjust the PTP clock time change rate when compared to its neighbor.
 *
 * @param dev PTP clock device
 * @param rate Rate of the clock time change
 *
 * @return 0 if ok, <0 if error
 */
static inline int ptp_clock_rate_adjust(struct device *dev, float rate)
{
	const struct ptp_clock_driver_api *api = dev->driver_api;

	return api->rate_adjust(dev, rate);
}

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_PTP_CLOCK_H_ */


text:
package kantan.regex.scalaz

import kantan.codecs.scalaz.laws.discipline.ScalazDisciplineSuite
import kantan.regex.{DecodeError, GroupDecoder}
import kantan.regex.scalaz.arbitrary._
import kantan.regex.scalaz.equality._
import scalaz.Scalaz._
import scalaz.scalacheck.ScalazProperties.{monadError, plus}

class DecoderTests extends ScalazDisciplineSuite {

  // Note that we're not testing MatchDecoder instances - Match is mutable and using MatchDecoder as a purely functional
  // abstraction is wrong.

  checkAll("GroupDecoder", plus.laws[GroupDecoder])
  checkAll("GroupDecoder", monadError.laws[GroupDecoder, DecodeError])

}


text:
package org.springframework.boot.web.server;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.ResolvableType;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.util.Assert;

/**
 * {@link BeanPostProcessor} that applies all {@link WebServerFactoryCustomizer} beans
 * from the bean factory to {@link WebServerFactory} beans.
 *
 * @author Dave Syer
 * @author Phillip Webb
 * @author Stephane Nicoll
 * @since 2.0.0
 */
public class WebServerFactoryCustomizerBeanPostProcessor
		implements BeanPostProcessor, BeanFactoryAware {

	private static final Log logger = LogFactory
			.getLog(WebServerFactoryCustomizerBeanPostProcessor.class);

	private ListableBeanFactory beanFactory;

	private List<WebServerFactoryCustomizer<?>> customizers;

	@Override
	public void setBeanFactory(BeanFactory beanFactory) {
		Assert.isInstanceOf(ListableBeanFactory.class, beanFactory,
				"WebServerCustomizerBeanPostProcessor can only be used "
						+ "with a ListableBeanFactory");
		this.beanFactory = (ListableBeanFactory) beanFactory;
	}

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName)
			throws BeansException {
		if (bean instanceof WebServerFactory) {
			postProcessBeforeInitialization((WebServerFactory) bean);
		}
		return bean;
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName)
			throws BeansException {
		return bean;
	}

	private void postProcessBeforeInitialization(WebServerFactory bean) {
		for (WebServerFactoryCustomizer<?> customizer : getCustomizers()) {
			Class<?> type = ResolvableType
					.forClass(WebServerFactoryCustomizer.class, customizer.getClass())
					.getGeneric().resolve(WebServerFactory.class);
			if (type.isInstance(bean)) {
				invokeCustomizer(customizer, bean);
			}
		}
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	private void invokeCustomizer(WebServerFactoryCustomizer customizer,
			WebServerFactory webServerFactory) {
		try {
			customizer.customize(webServerFactory);
		}
		catch (ClassCastException ex) {
			String msg = ex.getMessage();
			if (msg == null || msg.startsWith(webServerFactory.getClass().getName())) {
				// Possibly a lambda-defined WebServerFactoryCustomizer which we could not
				// resolve the
				// generic WebServerFactory type for
				logLambdaDebug(customizer, ex);
			}
			else {
				throw ex;
			}
		}
	}

	private void logLambdaDebug(WebServerFactoryCustomizer<?> customizer,
			ClassCastException ex) {
		if (logger.isDebugEnabled()) {
			logger.debug(
					"Non-matching WebServerFactory type for WebServerFactoryCustomizer: "
							+ customizer,
					ex);
		}
	}

	private Collection<WebServerFactoryCustomizer<?>> getCustomizers() {
		if (this.customizers == null) {
			// Look up does not include the parent context
			this.customizers = new ArrayList<>(getWebServerFactoryCustomizerBeans());
			this.customizers.sort(AnnotationAwareOrderComparator.INSTANCE);
			this.customizers = Collections.unmodifiableList(this.customizers);
		}
		return this.customizers;
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	private Collection<WebServerFactoryCustomizer<?>> getWebServerFactoryCustomizerBeans() {
		return (Collection) this.beanFactory
				.getBeansOfType(WebServerFactoryCustomizer.class, false, false).values();
	}

}


text:
@implementation MeterController {
    NSTimer *timer;
    id<MeterInterface> meterInterface;
}

-(void) addEntry:(float)value {
    //dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
        [TrackLytics addMeterEntryWithType:self.type withValue:[NSNumber numberWithFloat:value]];
    //});
}

-(void) addRepeatable:(id<MeterInterface>) interface withTimeInterval:(NSTimeInterval) interval{
    meterInterface = interface;
    timer = [NSTimer scheduledTimerWithTimeInterval:interval target:self selector:@selector(collectNewData) userInfo:nil repeats:YES];
}

-(void) collectNewData {
    //dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
        [self addEntry:[meterInterface getValue]];
    //});
}

-(void) stop {
    [timer invalidate];
}

@end


text:
package com.mycila.testing.core.api;

import java.lang.reflect.AccessibleObject;

/**
 * Utility class
 *
 * @author Mathieu Carbou (mathieu.carbou@gmail.com)
 */
public final class Ensure {
    private Ensure() {
    }

    /**
     * Check for not null parameters and throw and exception is null
     *
     * @param argName Argument name
     * @param arg     Argument
     * @throws IllegalArgumentException If the arg is null
     */
    public static void notNull(String argName, Object arg) throws IllegalArgumentException {
        if (arg == null) {
            throw new IllegalArgumentException(argName + " cannot be null");
        }
    }

    /**
     * Calls {@link java.lang.reflect.AccessibleObject#setAccessible(boolean)}
     * and returns the same object
     *
     * @param a   Object
     * @param <T> AccessibleObject instance
     * @return the same object beging 'accessible'
     */
    public static <T extends AccessibleObject> T accessible(T a) {
        if (!a.isAccessible()) {
            a.setAccessible(true);
        }
        return a;
    }

}


text:
<?xml version="1.0"?>
<!DOCTYPE project [
        <!ENTITY properties SYSTEM "../../../../xmls/properties.xml">
        <!ENTITY paths  SYSTEM "../../../../xmls/path_refs.xml">
        <!ENTITY taskdefs SYSTEM "../../../../xmls/taskdefs.xml">
        <!ENTITY taskdefs_post_compile SYSTEM "../../../../xmls/taskdefs_post_compile.xml">
        <!ENTITY targets SYSTEM "../../../../xmls/targets.xml">
]>

<!-- ===================================================================
<description>
   Test/Sample Component file for Axis

Notes:
   This is a build file for use with the Jakarta Ant build tool.

Prerequisites:

   jakarta-ant from http://jakarta.apache.org

Build Instructions:
   To compile
        ant compile
   To execute
        ant run

Author:
  Matt Seibert mseibert@us.ibm.com

Copyright:
  Copyright (c) 2002-2003 Apache Software Foundation.
</description>
==================================================================== -->

<project name="Round4" default="compile">
<property name="axis.home" location="../../../.." />
<property name="componentName" value="test/wsdl/interop4/groupi" />
        &properties;
        &paths;
        &taskdefs;
        &taskdefs_post_compile;
        &targets;
  <property name="root.dir" value="../../../.."/>

    <target name="clean">
        <echo message="Removing ${build.dir}/classes/${componentName} and ${build.dir}/work/${componentName}" />
        <delete dir="${build.dir}/classes/${componentName}"/>
        <delete dir="${build.dir}/work/${componentName}"/>
    </target>

  <target name="compile" depends="setenv">
    <property name="testname" value="groupi"/>

    <!-- generate skeletons -->
    <wsdl2java url="${axis.home}/test/wsdl/interop4/groupi/round4XSD.wsdl"
               output="${root.dir}/build/work" skeletonDeploy="no"
               wrapArrays="true"
               serverSide="yes">
        <mapping namespace="http://soapinterop.org/" package="test.wsdl.interop4.groupi"/>
        <mapping namespace="http://soapinterop.org/xsd" package="test.wsdl.interop4.groupi.xsd"/>
        <mapping namespace="http://soapinterop.org/echoheader/" package="test.wsdl.interop4.echo"/>
        <mapping namespace="http://soapinterop.org" package="test.wsdl.interop4.groupi"/>
        <mapping namespace="http://schemas.xmlsoap.org/soap/encoding/" package="test.wsdl.interop4.groupi.soap.encoding"/>
        <mapping namespace="http://schemas.xmlsoap.org/wsdl/mime/" package="test.wsdl.interop4.groupi.wsdl.mime"/>
        <mapping namespace="http://schemas.xmlsoap.org/wsdl/http/" package="test.wsdl.interop4.groupi.wsdl.http"/>
        <mapping namespace="http://schemas.xmlsoap.org/wsdl/soap/" package="test.wsdl.interop4.groupi.wsdl.soap"/>
    </wsdl2java>

    <mkdir dir="${build.dest}"/>

    <copy file="Round4XSDTestTestCase.java"
         todir="${root.dir}/build/work/test/wsdl/interop4/groupi/"
         overwrite="yes"/>
    <copy file="Round4XSDTestSoapImpl.java"
         todir="${root.dir}/build/work/test/wsdl/interop4/groupi/"
         overwrite="yes"/>

    <!-- compile the skeletons -->
    <javac srcdir="${build.dir}/work"
      destdir="${build.dest}" debug="on" source="${source}" nowarn="${nowarn}">
      <classpath refid="classpath" />
      <include name="test/wsdl/interop4/groupi/*.java" />
      <include name="test/wsdl/interop4/groupi/xsd/*.java" />
    </javac>
  </target>

  <target name="run" >
    <antcall target="execute-Component" />
  </target>

</project>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.kloia.eventapis</groupId>
        <artifactId>eventapis-parent</artifactId>
        <version>0.7.1-SNAPSHOT</version>
    </parent>

    <artifactId>java-api</artifactId>

    <properties>
        <commons-io.version>2.6</commons-io.version>
        <commons-collections4.version>4.4</commons-collections4.version>
        <commons-lang3.version>3.9</commons-lang3.version>
        <guava.version>28.2-jre</guava.version>
        <aspectjweaver.version>1.9.5</aspectjweaver.version>
        <throwing-function.version>1.3</throwing-function.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>${cassandra-driver.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons-collections4.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>${kafka-clients.version}</version>
        </dependency>
        <dependency>
            <groupId>pl.touk</groupId>
            <artifactId>throwing-function</artifactId>
            <version>${throwing-function.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectjweaver.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
        </dependency>
    </dependencies>

</project>


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class About_my_site extends CI_Controller {

	public function __construct()
    {
        parent::__construct();
        $this->curpage = "About My Site";
        $this->load->model('About_my_site_model');
        $this->load->model('Users_model');

        $this->nouser = $this->session->userdata('user_session')->NO;
    	date_default_timezone_set("Asia/Manila");
    	$this->date = date("F d, Y");
    	$this->time = date("g:i A");
    }

	public function index()
	{
		$user_session = $this->session->userdata('user_session');

		if ( $this->session->userdata('user_session')->ACCOUNT_TYPE == "Administrator" ) {
			$details = array (
				'get_admin_specific'		=>	$this->Users_model->get_admin_specific($user_session->NO),
				'get_all_aboutmysite'		=>	$this->About_my_site_model->get_all_aboutmysite(),
				'get_specific'				=>	$this->About_my_site_model->get_latest()
			);

			$data['content']	=	$this->load->view('admin/aboutmysite', $details, TRUE);
			$data['curpage']	= 	$this->curpage;
			$this->load->view('template1', $data);
		} else {
			redirect('/');
		}
	}

	public function information($no)
	{
		$user_session = $this->session->userdata('user_session');

		if ( $this->session->userdata('user_session')->ACCOUNT_TYPE == "Administrator" ) {
			$details = array (
				'get_admin_specific'		=>	$this->Users_model->get_admin_specific($user_session->NO),
				'get_all_aboutmysite'		=>	$this->About_my_site_model->get_all_aboutmysite(),
				'get_specific'				=>	$this->About_my_site_model->get_specific($no)
			);

			$data['content']	=	$this->load->view('admin/aboutmysite', $details, TRUE);
			$data['curpage']	= 	$this->curpage;
			$this->load->view('template1', $data);
		} else {
			redirect('/');
		}
	}

	public function insert()
	{
		$ams_title			=	$this->input->post('ams_title');
		$ams_description	=	$this->input->post('ams_description');

		if ( $this->session->userdata('user_session')->ACCOUNT_TYPE == "Administrator" ) {

			$params = array(
				'NO'			=>	'',
				'NOUSER'		=>	$this->nouser,
				'TITLE'			=>	$ams_title,
				'DESCRIPTION'	=>	$ams_description,
				'DATE'			=>	$this->date,
				'IMAGEURL'		=>	'',
				'ACTIVE'		=>	'0',
				'DELETION'		=>	'0'
			);

			$this->session->set_flashdata('success_message', 'New about my site added!');
			$this->About_my_site_model->insert($params);
		} else {
			redirect('/');
		}
	}

	public function update()
	{
		$ams_no_update			=	$this->input->post('ams_no_update');
		$ams_title_update		=	$this->input->post('ams_title_update');
		$ams_description_update	=	$this->input->post('ams_description_update');
		$ams_active_update		=	$this->input->post('ams_active_update');

		if ( $this->session->userdata('user_session')->ACCOUNT_TYPE == "Administrator" ) {

			if ( $ams_active_update == 'enabled' ) {
				$paramsAll = array(
					'ACTIVE'		=> 0
				);
				$this->About_my_site_model->updateAll($paramsAll);

				$params = array(
					'NOUSER'		=>	$this->nouser,
					'TITLE'			=>	$ams_title_update,
					'DESCRIPTION'	=>	$ams_description_update,
					'ACTIVE'		=>	1
				);
			} else {
				$params = array(
					'NOUSER'		=>	$this->nouser,
					'TITLE'			=>	$ams_title_update,
					'DESCRIPTION'	=>	$ams_description_update,
					'ACTIVE'		=>  0
				);
			}

			$this->session->set_flashdata('success_message', 'Updated the about my site!');
			$this->About_my_site_model->update($params, $ams_no_update);
		} else {
			redirect('/');
		}
	}

	public function delete($no)
	{
		$params = array(
			'DELETION'		=>	'1'
		);

		$this->session->set_flashdata('success_message', 'Item deleted!');
		$this->About_my_site_model->update($params, $no);
		redirect('/admin/about_my_site');
	}
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Fluid Calendar - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">

Fluid Calendar

This example shows how to set the width of calendar to a percentage of its parent container.

width: 50%, height: 250px

width: 30%, height: 40%


text:
<?php

namespace DesignPatterns\Structural\DependencyInjection;

/**
 * AbstractConfig 类
 */
abstract class AbstractConfig
{
    /**
     * @var 数据的存储
     */
    protected $storage;

    public function __construct($storage)
    {
        $this->storage=$storage;
    }
}


text:
<!DOCTYPE HTML>

<title>org.robolectric.pluginapi</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="declaration: package: org.robolectric.pluginapi">
<meta name="generator" content="javadoc/PackageWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../script-dir/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Robolectric 4.6 |

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

Package org.robolectric.pluginapi

Extension points for customizing Robolectric.

Robolectric has many components which can be customized or replaced using an extension
 mechanism based on Java Services.

Historically, customizing Robolectric required subclassing RobolectricTestRunner to override behavior at various ad-hoc extension points.
 This mechanism is now deprecated. The Plugin API provides a number of well documented and
 supported extension points allowing you to customize behavior for your organization's needs.

The interfaces listed below can be implemented with customizations suitable for your
 organization. To make your custom implementation visible to Robolectric, publish it as a service
 and include it in the test classpath.

Extension points:

ConfigurationStrategy (default HierarchicalConfigurationStrategy)

DependencyResolver (default LegacyDependencyResolver

GlobalConfigProvider (no default)

PerfStatsReporter (no default)

SdkPicker (default DefaultSdkPicker)

SdkProvider (default DefaultSdkProvider)

See Also:

Google AutoService for a
     helpful way to define Java Services.

Interface Summary

Interface
Description

SdkPicker

SdkProvider

A provider of known instances of Sdk.

TestEnvironmentLifecyclePlugin

Plugin which allows behaviour extension in TestEnvironment.

UsesSdk

Represents the contents of a uses-sdk element in an Android manifest file.

Class Summary

Class
Description

Sdk

Represents a unique build of the Android SDK.

Annotation Types Summary

Annotation Type
Description

ExtensionPoint

Marks a component of Robolectric that may be replaced with a custom implementation.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Robolectric 4.6 |


text:
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Rounded Rectangles</title>
    <link rel="stylesheet" href="../css/style.css">
    <script type="text/javascript" src="../../dist/paper-full.js"></script>
    <script type="text/paperscript" canvas="canvas">
        var mousePoint = view.center;
        var amount = 25;
        var colors = ['red', 'white', 'blue', 'white'];

        for (var i = 0; i < amount; i++) {
            var rect = new Rectangle([0, 0], [25, 25]);
            rect.center = mousePoint;
            var path = new Path.Rectangle(rect, 6);
            path.fillColor = colors[i % 4];
            var scale = (1 - i / amount) * 20;
            path.scale(scale);
        }

        function onMouseMove(event) {
            mousePoint = event.point;
        }

        var children = project.activeLayer.children;
        function onFrame(event) {
            for (var i = 0, l = children.length; i < l; i++) {
                var item = children[i];
                var delta = (mousePoint - item.position) / (i + 5);
                item.rotate(Math.sin((event.count + i) / 10) * 7);
                if (delta.length > 0.1)
                    item.position += delta;
            }
        }
    </script>
</head>
<body>
    <canvas id="canvas" resize hidpi="off"></canvas>
</body>
</html>


text:
$(document).ready(function() {
    var _$connect = $('#connect');
    var _$close = $('#close');
    var _$send = $('#send');
    var _$input = $('#data_input');
    var sendQueue = $({});
    var updateRoutine = null;
    // var server = 'ws://68.173.83.103:8383/';
    var server = 'ws://' + data.ip + ':' + data.port + '/';
    var connection = null;

    _$connect.click(function() {
        if ('WebSocket' in window) {
            connection = new WebSocket(server);
            bindconn();
            print_msg('Connecting to server: ' + server);
            _$close.removeAttr("disabled");
        } else {
            print_msg('Websockets not supported in this browser.');
        }

        _$connect.attr("disabled","disabled");
    });

    _$send.click(function() {
        if (connection) {
            //JSON.stringify/parse(text)
            // TEST http://jsbin.com/ozATAJI/3/

            // frames are being too quickly and the buffer is filling up
            // check connection.bufferedAmount, queue calls
            var data = (_$input.val()).replace( /\n/g, " " ).split( " " );
            $.each(data, function(i, msg) {
                if (msg.length > 2) {
                    msg = unescape( encodeURIComponent( msg ) );
                    console.log(msg + " : " + connection.bufferedAmount);
                    //connection.send(msg);

                    // add delay between each call
                    //setTimeout(connection.send(msg), 300 * (i+1));

                    sendQueue.queue(
                        function( next ) {
                            connection.send(msg);
                    });

                } else {
                    console.log('Message too small');
                }
            });

        } else {
            print_msg('Connection not ready yet.');
        }
    });

    _$close.click(function() {
        clearInterval(updateRoutine);

        if (connection) {
            connection.close();
            connection = null;
            _$connect.removeAttr("disabled");
            _$close.attr("disabled","disabled");
            print_msg('Server has been closed.');
        } else {
            print_msg('Connection not ready yet.');
        }
    });

    var bindconn = function() {
        connection.onopen = function(){
            print_msg('Connection open!');

            // regularly check for new data to send
            updateRoutine = setInterval( function() {
                if (connection.bufferedAmount == 0)
                    sendQueue.dequeue();
            }, 50);
        }
        connection.onclose = function(){
            print_msg('Connection closed.');
            clearInterval(updateRoutine);
        }
        connection.onerror = function(error){
            print_msg('Error detected: ' + error.data);
        }
        connection.onmessage = function(e) {
            print_data(e.data);
        };
    }

    var print_msg = function(msg) {
    /*    _$words.text(function(i, oldText) {
            return msg;
        });
    */
        console.log(msg);
    }
    var print_data = function(msg) {
    /*    _$words2.text(function(i, oldText) {
            return msg;
        });
    */
        console.log(msg);
    }

});


text:
int main(int argc, char *argv[])
{
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
    QApplication a(argc, argv);
    UI ui;
    ui.show();
    return a.exec();
}


text:
assert ([].toLocaleString() === "");
assert ([1].toLocaleString() === "1");
assert ([1,2].toLocaleString() === "1,2");
assert ([1,2,3].toLocaleString() === "1,2,3");

var test_ok = {
  length: 1,
  toLocaleString: function() { return "1"; }
};

assert ([3, test_ok, 4, test_ok].toLocaleString() === "3,1,4,1");

var obj = { toLocaleString: function() {} };
var test_non_str_locale = [undefined, obj, null, obj, obj];

assert(test_non_str_locale.toLocaleString() === ",undefined,,undefined,undefined");

var test_fail = {
  toLocaleString: "FAIL"
};

try {
  [test_fail].toLocaleString();
  assert (false);
} catch (e) {
  assert (e instanceof TypeError);
}

var test_fail_call = {
  toLocaleString: function() { throw new ReferenceError("foo"); }
};

try {
  [1, 2, test_fail_call].toLocaleString();
  assert (false);
} catch (e) {
  assert (e.message === "foo");
  assert (e instanceof ReferenceError);
}


text:
<?php

namespace spec\Gnugat\Bundle\WizardBundle\Command;

use PhpSpec\ObjectBehavior;

/**
 * @author Loïc Chardonnet <loic.chardonnet@gmail.com>
 */
class RegisterBundleCommandSpec extends ObjectBehavior
{
    public function it_is_initializable()
    {
        $this->shouldHaveType('Gnugat\Bundle\WizardBundle\Command\RegisterBundleCommand');
        $this->shouldHaveType('Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand');

        $this->getName()->shouldBe('wizard:register:bundle');
        $this->getDefinition()->hasArgument('fully-qualified-classname')->shouldBe(true);
    }
}


text:
#ifndef __HW_AUX_ANAIF_H__
#define __HW_AUX_ANAIF_H__

//*****************************************************************************
//
// This section defines the register offsets of
// AUX_ANAIF component
//
//*****************************************************************************
// ADC Control
#define AUX_ANAIF_O_ADCCTL                                          0x00000010

// ADC FIFO Status
#define AUX_ANAIF_O_ADCFIFOSTAT                                     0x00000014

// ADC FIFO
#define AUX_ANAIF_O_ADCFIFO                                         0x00000018

// ADC Trigger
#define AUX_ANAIF_O_ADCTRIG                                         0x0000001C

// Current Source Control
#define AUX_ANAIF_O_ISRCCTL                                         0x00000020

//*****************************************************************************
//
// Register: AUX_ANAIF_O_ADCCTL
//
//*****************************************************************************
// Field:    [13] START_POL
//
// Selected active edge for start event / Selected polarity for start event
// ENUMs:
// FALL                     Start on falling edge of event
// RISE                     Start on rising edge of event
#define AUX_ANAIF_ADCCTL_START_POL                                  0x00002000
#define AUX_ANAIF_ADCCTL_START_POL_BITN                                     13
#define AUX_ANAIF_ADCCTL_START_POL_M                                0x00002000
#define AUX_ANAIF_ADCCTL_START_POL_S                                        13
#define AUX_ANAIF_ADCCTL_START_POL_FALL                             0x00002000
#define AUX_ANAIF_ADCCTL_START_POL_RISE                             0x00000000

// Field:  [12:8] START_SRC
//
// Selected source for ADC conversion start event. The start source selected by
// this field is OR'ed with any trigger coming from writes to ADCTRIG.START. If
// it is desired to only trigger ADC conversions by writes to ADCTRIG.START one
// should select NO_EVENT<n> here
// ENUMs:
// ADC_IRQ                  Selects ADC_IRQ as start signal
// MCU_EV                   Selects MCU_EV as start signal
// ACLK_REF                 Selects ACLK_REF as start signal
// AUXIO15                  Selects AUXIO15 as start signal
// AUXIO14                  Selects AUXIO14 as start signal
// AUXIO13                  Selects AUXIO13 as start signal
// AUXIO12                  Selects AUXIO12 as start signal
// AUXIO11                  Selects AUXIO11 as start signal
// AUXIO10                  Selects AUXIO10 as start signal
// AUXIO9                   Selects AUXIO9 as start signal
// AUXIO8                   Selects AUXIO8 as start signal
// AUXIO7                   Selects AUXIO7 as start signal
// AUXIO6                   Selects AUXIO6 as start signal
// AUXIO5                   Selects AUXIO5 as start signal
// AUXIO4                   Selects AUXIO4 as start signal
// AUXIO3                   Selects AUXIO3 as start signal
// AUXIO2                   Selects AUXIO2 as start signal
// AUXIO1                   Selects AUXIO1 as start signal
// AUXIO0                   Selects AUXIO0 as start signal
// AON_PROG_WU              Selects AON_PROG_WU as start signal
// AON_SW                   Selects AON_SW as start signal
// NO_EVENT1                No event selected
// NO_EVENT0                No event selected
// RESERVED1                Reserved do not use
// RESERVED0                Reserved do not use
// SMPH_AUTOTAKE_DONE       Selects SMPH_AUTOTAKE_DONE as start signal
// TIMER1_EV                Selects TIMER1_EV as start signal
// TIMER0_EV                Selects TIMER0_EV as start signal
// TDC_DONE                 Selects TDC_DONE as start signal
// AUX_COMPB                Selects AUX_COMPB as start signal
// AUX_COMPA                Selects AUX_COMPA as start signal
// RTC_CH2_EV               Selects RTC_CH2_EV as start signal
#define AUX_ANAIF_ADCCTL_START_SRC_W                                         5
#define AUX_ANAIF_ADCCTL_START_SRC_M                                0x00001F00
#define AUX_ANAIF_ADCCTL_START_SRC_S                                         8
#define AUX_ANAIF_ADCCTL_START_SRC_ADC_IRQ                          0x00001F00
#define AUX_ANAIF_ADCCTL_START_SRC_MCU_EV                           0x00001E00
#define AUX_ANAIF_ADCCTL_START_SRC_ACLK_REF                         0x00001D00
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO15                          0x00001C00
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO14                          0x00001B00
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO13                          0x00001A00
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO12                          0x00001900
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO11                          0x00001800
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO10                          0x00001700
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO9                           0x00001600
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO8                           0x00001500
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO7                           0x00001400
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO6                           0x00001300
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO5                           0x00001200
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO4                           0x00001100
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO3                           0x00001000
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO2                           0x00000F00
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO1                           0x00000E00
#define AUX_ANAIF_ADCCTL_START_SRC_AUXIO0                           0x00000D00
#define AUX_ANAIF_ADCCTL_START_SRC_AON_PROG_WU                      0x00000C00
#define AUX_ANAIF_ADCCTL_START_SRC_AON_SW                           0x00000B00
#define AUX_ANAIF_ADCCTL_START_SRC_NO_EVENT1                        0x00000A00
#define AUX_ANAIF_ADCCTL_START_SRC_NO_EVENT0                        0x00000900
#define AUX_ANAIF_ADCCTL_START_SRC_RESERVED1                        0x00000800
#define AUX_ANAIF_ADCCTL_START_SRC_RESERVED0                        0x00000700
#define AUX_ANAIF_ADCCTL_START_SRC_SMPH_AUTOTAKE_DONE               0x00000600
#define AUX_ANAIF_ADCCTL_START_SRC_TIMER1_EV                        0x00000500
#define AUX_ANAIF_ADCCTL_START_SRC_TIMER0_EV                        0x00000400
#define AUX_ANAIF_ADCCTL_START_SRC_TDC_DONE                         0x00000300
#define AUX_ANAIF_ADCCTL_START_SRC_AUX_COMPB                        0x00000200
#define AUX_ANAIF_ADCCTL_START_SRC_AUX_COMPA                        0x00000100
#define AUX_ANAIF_ADCCTL_START_SRC_RTC_CH2_EV                       0x00000000

// Field:   [1:0] CMD
//
// ADC interface control command
// ENUMs:
// FLUSH                    ADC FIFO flush. Note that CMD needs to be set to
//                          'EN' again for FIFO to be functional after a
//                          flush. A flush takes two clock periods on the
//                          AUX clock to finish.
// EN                       ADC interface enabled
// DIS                      ADC interface disabled
#define AUX_ANAIF_ADCCTL_CMD_W                                               2
#define AUX_ANAIF_ADCCTL_CMD_M                                      0x00000003
#define AUX_ANAIF_ADCCTL_CMD_S                                               0
#define AUX_ANAIF_ADCCTL_CMD_FLUSH                                  0x00000003
#define AUX_ANAIF_ADCCTL_CMD_EN                                     0x00000001
#define AUX_ANAIF_ADCCTL_CMD_DIS                                    0x00000000

//*****************************************************************************
//
// Register: AUX_ANAIF_O_ADCFIFOSTAT
//
//*****************************************************************************
// Field:     [4] OVERFLOW
//
// FIFO overflow flag.
//
// 0: FIFO has not overflowed.
// 1: FIFO has overflowed, this flag is sticky until FIFO is flushed.
#define AUX_ANAIF_ADCFIFOSTAT_OVERFLOW                              0x00000010
#define AUX_ANAIF_ADCFIFOSTAT_OVERFLOW_BITN                                  4
#define AUX_ANAIF_ADCFIFOSTAT_OVERFLOW_M                            0x00000010
#define AUX_ANAIF_ADCFIFOSTAT_OVERFLOW_S                                     4

// Field:     [3] UNDERFLOW
//
// FIFO underflow flag.
//
// 0: FIFO has not underflowed
// 1: FIFO has underflowed, this flag is sticky until the FIFO is flushed
#define AUX_ANAIF_ADCFIFOSTAT_UNDERFLOW                             0x00000008
#define AUX_ANAIF_ADCFIFOSTAT_UNDERFLOW_BITN                                 3
#define AUX_ANAIF_ADCFIFOSTAT_UNDERFLOW_M                           0x00000008
#define AUX_ANAIF_ADCFIFOSTAT_UNDERFLOW_S                                    3

// Field:     [2] FULL
//
// FIFO full flag.
//
// 0: FIFO is not full, i.e. there is less than 4 samples in the FIFO.
// 1: FIFO is full, i.e. there are 4 samples in the FIFO
#define AUX_ANAIF_ADCFIFOSTAT_FULL                                  0x00000004
#define AUX_ANAIF_ADCFIFOSTAT_FULL_BITN                                      2
#define AUX_ANAIF_ADCFIFOSTAT_FULL_M                                0x00000004
#define AUX_ANAIF_ADCFIFOSTAT_FULL_S                                         2

// Field:     [1] ALMOST_FULL
//
// FIFO almost full flag.
//
// 0: There is less than 3 samples in the FIFO, or the FIFO is full in which
// case the FULL flag is asserted
// 1: There are 3 samples in the FIFO, i.e. there is room for one more sample
#define AUX_ANAIF_ADCFIFOSTAT_ALMOST_FULL                           0x00000002
#define AUX_ANAIF_ADCFIFOSTAT_ALMOST_FULL_BITN                               1
#define AUX_ANAIF_ADCFIFOSTAT_ALMOST_FULL_M                         0x00000002
#define AUX_ANAIF_ADCFIFOSTAT_ALMOST_FULL_S                                  1

// Field:     [0] EMPTY
//
// FIFO empty flag.
//
// 0: FIFO contains one or more samples
// 1: FIFO is empty
#define AUX_ANAIF_ADCFIFOSTAT_EMPTY                                 0x00000001
#define AUX_ANAIF_ADCFIFOSTAT_EMPTY_BITN                                     0
#define AUX_ANAIF_ADCFIFOSTAT_EMPTY_M                               0x00000001
#define AUX_ANAIF_ADCFIFOSTAT_EMPTY_S                                        0

//*****************************************************************************
//
// Register: AUX_ANAIF_O_ADCFIFO
//
//*****************************************************************************
// Field:  [11:0] DATA
//
// FIFO is popped when read. Data is pushed into FIFO when written. Writing is
// intended for debugging/code development purposes
#define AUX_ANAIF_ADCFIFO_DATA_W                                            12
#define AUX_ANAIF_ADCFIFO_DATA_M                                    0x00000FFF
#define AUX_ANAIF_ADCFIFO_DATA_S                                             0

//*****************************************************************************
//
// Register: AUX_ANAIF_O_ADCTRIG
//
//*****************************************************************************
// Field:     [0] START
//
// Writing to this register will trigger an ADC conversion given that
// ADCCTL.START_SRC is set to NO_EVENT0 or NO_EVENT1. If other setting is used
// in ADCCTL.START_SRC behavior can be unpredictable
#define AUX_ANAIF_ADCTRIG_START                                     0x00000001
#define AUX_ANAIF_ADCTRIG_START_BITN                                         0
#define AUX_ANAIF_ADCTRIG_START_M                                   0x00000001
#define AUX_ANAIF_ADCTRIG_START_S                                            0

//*****************************************************************************
//
// Register: AUX_ANAIF_O_ISRCCTL
//
//*****************************************************************************
// Field:     [0] RESET_N
//
// Current source control
//
// 0: Current source is clamped
// 1: Current source is active/charging
#define AUX_ANAIF_ISRCCTL_RESET_N                                   0x00000001
#define AUX_ANAIF_ISRCCTL_RESET_N_BITN                                       0
#define AUX_ANAIF_ISRCCTL_RESET_N_M                                 0x00000001
#define AUX_ANAIF_ISRCCTL_RESET_N_S                                          0

#endif // __AUX_ANAIF__


text:
export default {
  name: "collapsed",
  initialState: false,
  reducers: {
    toggle(state) {
      return !state;
    }
  }
}


text:
<!DOCTYPE html>

<meta charset="UTF-8">

<title>class ClustersController - RDoc Documentation</title>

<link href="./css/fonts.css" rel="stylesheet">
<link href="./css/rdoc.css" rel="stylesheet">

    Home

    Pages
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Parent

ApplicationController

Included Modules

DiscoHelper

ClusterHelper

Methods

#create

#destroy

#index

#new

#render_form

#show

    class ClustersController

ClusterController is responsible for the clusters' retrieval, creation,
and deletion.

Public Instance Methods

          create()

          click to toggle source

Creates new cluster entity and sends cluster create request to DISCO if
everything filled correctly(cluster parameters and infrastructure
password). After success redirects to the clusters page. After failure
redirects to the new cluster creation page. Failure may occure since:

1) Cluster parameters were not filled correctly,
   in this case: "Cluster details were not filled correctly" warning will show up.
2) Incorrect password was typed or DISCO connection problem occured,
   in this case: "DISCO connection error" warning will show up.

# File app/controllers/clusters_controller.rb, line 49
def create
  # Retrieves chosen infrastructure and creates new cluster entity which belongs to that infrastructure
  infrastructure = Infrastructure.find(params[:cluster][:infrastructure_id])
  cluster = infrastructure.clusters.build(cluster_params)
  # Retrieves chosen master and slave image from database to reference them from new cluster entity
  cluster.master_image = Image.find(params[:cluster][:master_image])
  cluster.slave_image  = Image.find(params[:cluster][:slave_image])
  # Retrieves chosen master and slave flavor from database to reference them from new cluster entity
  cluster.master_flavor = Flavor.find(params[:cluster][:master_flavor])
  cluster.slave_flavor  = Flavor.find(params[:cluster][:slave_flavor])
  # If new cluster is properly configured it will be saved in database
  if cluster.save
    # Then we send request to the DISCO to create a new cluster
    response = create_req(params[:cluster], infrastructure)
    if response.code == "201"
      # If the request was accepted, continues to add chosen framework(s) to the new cluster entity
      get_frameworks cluster
      # Gets cluster uuid, so we can get detailed information from the DISCO of the current cluster
      cluster.get_uuid response.header
      # Starts a background job which will update state of the cluster as deployment proceeds
      ClusterUpdateJob.perform_later(infrastructure, current_user[:id], cluster[:id], params[:cluster][:password])

      sleep(1)
      redirect_to clusters_path
      return
    else
      # In case of failed DISCO connection, new cluster is deleted from database
      cluster.delete
      flash[:danger] = "DISCO connection error"
      Rails.logger.debug "DISCO connection error"
    end
  else
    flash[:warning] = "Cluster details were not filled correctly"
    Rails.logger.debug "Cluster details were not filled correctly"
  end
  # Retrieves infrastructures and putting them to adapters so in case of failure in creation, we can render them again
  @infrastructures = current_user.infrastructures.all
  @adapters        = { "Choose" => 0 }
  @infrastructures.each { |inf| @adapters[inf.name] = inf.id } if @infrastructures
  redirect_to clusters_new_path
end

          destroy()

          click to toggle source

Deletes chosen cluster from stack and database if success response returned
from DISCO framework

# File app/controllers/clusters_controller.rb, line 92
def destroy
  # Chosen cluster is retrieved from the database according to its uuid
  uuid = params[:delete][:uuid]
  cluster = Cluster.find_by(uuid: uuid)
  # Retrieves cluster's infrastructure to get credentials
  infrastructure = Infrastructure.find(cluster.infrastructure_id)
  # Sends DISCO delete request using credentials, password, and cluster uuid
  response = delete_req(infrastructure, params[:delete][:password], uuid)

  if response.code != "200"
    flash[:danger] = "DISCO connection error"
  else
    # After a successful delete request cluster will be deleted from database
    cluster.delete
    flash[:success] = "The cluster is being deleted"
  end

  redirect_to clusters_path
end

          index()

          click to toggle source

Retrieves current user clusters and groups from database

# File app/controllers/clusters_controller.rb, line 18
def index
  @clusters = current_user.clusters.all
  @groups   = current_user.groups.all
end

          new()

          click to toggle source

Retrieves current user infrastructures and puts them to the adapter
dictionary(hash) so user can select needed infrastructure

# File app/controllers/clusters_controller.rb, line 26
def new
  @infrastructures = current_user.infrastructures.all
  @adapters        = { "Choose" => 0 }
  @infrastructures.each { |inf| @adapters[inf.name] = inf.id } if @infrastructures
end

          render_form()

          click to toggle source

Retrieves data and renders a form for a cluster creation Called by AJAX Get
request from dashboard

# File app/controllers/clusters_controller.rb, line 115
def render_form
  @infrastructure_id = params[:infrastructure_id]
  if @infrastructure_id != "0"
    @frameworks = Framework.all
    @images     = Image.where(infrastructure_id: @infrastructure_id)
    @flavors    = Flavor.where(infrastructure_id: @infrastructure_id)
    @keypairs   = Keypair.where(infrastructure_id: @infrastructure_id)
  end

  respond_to do |format|
    format.js
  end
end

          show()

          click to toggle source

(This is not used currently) Retrieves selected cluster from database

# File app/controllers/clusters_controller.rb, line 35
def show
  @cluster = Cluster.find(params[:cluster][:id])
end

Validate

Generated by RDoc 4.2.1.

Based on Darkfish by Michael Granger.


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = unique;

var _arrayContainsObject = require('./arrayContainsObject');

var _arrayContainsObject2 = _interopRequireDefault(_arrayContainsObject);

var _ParseObject = require('./ParseObject');

var _ParseObject2 = _interopRequireDefault(_ParseObject);

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

function unique(arr) {
  var uniques = [];
  arr.forEach(function (value) {
    if (value instanceof _ParseObject2.default) {
      if (!(0, _arrayContainsObject2.default)(uniques, value)) {
        uniques.push(value);
      }
    } else {
      if (uniques.indexOf(value) < 0) {
        uniques.push(value);
      }
    }
  });
  return uniques;
}


text:
namespace Permissions
{
	public interface IPermissionable<TUser> where TUser : class
	{
		bool HasPermissions(TUser user, string subscope = null);
	}
}


text:
package com.thoughtworks.go.plugin.domain.packagematerial;

import com.thoughtworks.go.plugin.api.info.PluginDescriptor;
import com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings;
import com.thoughtworks.go.plugin.domain.common.PluginConstants;
import com.thoughtworks.go.plugin.domain.common.PluginInfo;

public class PackageMaterialPluginInfo extends PluginInfo {

    private final PluggableInstanceSettings repositorySettings;
    private final PluggableInstanceSettings packageSettings;

    public PackageMaterialPluginInfo(PluginDescriptor descriptor, PluggableInstanceSettings repositorySettings, PluggableInstanceSettings packageSettings, PluggableInstanceSettings pluginSettings) {
        super(descriptor, PluginConstants.PACKAGE_MATERIAL_EXTENSION, pluginSettings, null);
        this.repositorySettings = repositorySettings;
        this.packageSettings = packageSettings;
    }

    public PluggableInstanceSettings getRepositorySettings() {
        return repositorySettings;
    }

    public PluggableInstanceSettings getPackageSettings() {
        return packageSettings;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        PackageMaterialPluginInfo that = (PackageMaterialPluginInfo) o;

        if (repositorySettings != null ? !repositorySettings.equals(that.repositorySettings) : that.repositorySettings != null)
            return false;
        return packageSettings != null ? packageSettings.equals(that.packageSettings) : that.packageSettings == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (repositorySettings != null ? repositorySettings.hashCode() : 0);
        result = 31 * result + (packageSettings != null ? packageSettings.hashCode() : 0);
        return result;
    }
}


text: from uw_kws import KWS


text:
namespace {

const char kDefaultTestUrl[] = "https://google.com";
const char kDefaultTestUrlAnchor[] = "https://google.com#samepage";
const char kDefaultTestUrl2[] = "https://whatever.com";

}  // namespace

class CorePageLoadMetricsObserverTest
    : public page_load_metrics::PageLoadMetricsObserverTestHarness {
 protected:
  void RegisterObservers(page_load_metrics::PageLoadTracker* tracker) override {
    tracker->AddObserver(make_scoped_ptr(new CorePageLoadMetricsObserver()));
  }

  void AssertNoHistogramsLogged() {
    histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded,
                                        0);
    histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 0);
    histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 0);
    histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 0);
  }

  void SetUp() override {
    page_load_metrics::PageLoadMetricsObserverTestHarness::SetUp();
    TestingBrowserProcess::GetGlobal()->SetRapporService(&rappor_tester_);
  }

  rappor::TestRapporService rappor_tester_;
};

TEST_F(CorePageLoadMetricsObserverTest, NoMetrics) {
  AssertNoHistogramsLogged();
}

TEST_F(CorePageLoadMetricsObserverTest, SamePageNoTriggerUntilTrueNavCommit) {
  base::TimeDelta first_layout = base::TimeDelta::FromMilliseconds(1);

  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_layout = first_layout;
  PopulateRequiredTimingFields(&timing);

  NavigateAndCommit(GURL(kDefaultTestUrl));
  SimulateTimingUpdate(timing);

  NavigateAndCommit(GURL(kDefaultTestUrlAnchor));
  // A same page navigation shouldn't trigger logging UMA for the original.
  AssertNoHistogramsLogged();

  // But we should keep the timing info and log it when we get another
  // navigation.
  NavigateAndCommit(GURL(kDefaultTestUrl2));
  histogram_tester().ExpectTotalCount(internal::kHistogramCommit, 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 1);
  histogram_tester().ExpectBucketCount(internal::kHistogramFirstLayout,
                                       first_layout.InMilliseconds(), 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 0);
}

TEST_F(CorePageLoadMetricsObserverTest, SingleMetricAfterCommit) {
  base::TimeDelta first_layout = base::TimeDelta::FromMilliseconds(1);

  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_layout = first_layout;
  PopulateRequiredTimingFields(&timing);

  NavigateAndCommit(GURL(kDefaultTestUrl));
  SimulateTimingUpdate(timing);

  AssertNoHistogramsLogged();

  // Navigate again to force histogram recording.
  NavigateAndCommit(GURL(kDefaultTestUrl2));

  histogram_tester().ExpectTotalCount(internal::kHistogramCommit, 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 1);
  histogram_tester().ExpectBucketCount(internal::kHistogramFirstLayout,
                                       first_layout.InMilliseconds(), 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 0);
}

TEST_F(CorePageLoadMetricsObserverTest, MultipleMetricsAfterCommits) {
  base::TimeDelta first_layout_1 = base::TimeDelta::FromMilliseconds(10);
  base::TimeDelta first_layout_2 = base::TimeDelta::FromMilliseconds(20);
  base::TimeDelta response = base::TimeDelta::FromMilliseconds(10);
  base::TimeDelta first_text_paint = base::TimeDelta::FromMilliseconds(30);
  base::TimeDelta dom_content = base::TimeDelta::FromMilliseconds(40);
  base::TimeDelta load = base::TimeDelta::FromMilliseconds(100);

  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_layout = first_layout_1;
  timing.response_start = response;
  timing.first_text_paint = first_text_paint;
  timing.dom_content_loaded_event_start = dom_content;
  timing.load_event_start = load;
  PopulateRequiredTimingFields(&timing);

  NavigateAndCommit(GURL(kDefaultTestUrl));
  SimulateTimingUpdate(timing);

  NavigateAndCommit(GURL(kDefaultTestUrl2));

  page_load_metrics::PageLoadTiming timing2;
  timing2.navigation_start = base::Time::FromDoubleT(200);
  timing2.first_layout = first_layout_2;
  PopulateRequiredTimingFields(&timing2);

  SimulateTimingUpdate(timing2);

  NavigateAndCommit(GURL(kDefaultTestUrl));

  histogram_tester().ExpectTotalCount(internal::kHistogramCommit, 2);
  histogram_tester().ExpectBucketCount(internal::kHistogramFirstLayout,
                                       first_layout_1.InMilliseconds(), 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 2);
  histogram_tester().ExpectBucketCount(internal::kHistogramFirstLayout,
                                       first_layout_1.InMilliseconds(), 1);
  histogram_tester().ExpectBucketCount(internal::kHistogramFirstLayout,
                                       first_layout_2.InMilliseconds(), 1);

  histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 1);
  histogram_tester().ExpectBucketCount(internal::kHistogramFirstTextPaint,
                                       first_text_paint.InMilliseconds(), 1);

  histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded, 1);
  histogram_tester().ExpectBucketCount(internal::kHistogramDomContentLoaded,
                                       dom_content.InMilliseconds(), 1);

  histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 1);
  histogram_tester().ExpectBucketCount(internal::kHistogramLoad,
                                       load.InMilliseconds(), 1);
}

TEST_F(CorePageLoadMetricsObserverTest, BackgroundDifferentHistogram) {
  base::TimeDelta first_layout = base::TimeDelta::FromSeconds(2);

  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_layout = first_layout;
  PopulateRequiredTimingFields(&timing);

  // Simulate "Open link in new tab."
  web_contents()->WasHidden();
  NavigateAndCommit(GURL(kDefaultTestUrl));
  SimulateTimingUpdate(timing);

  // Simulate switching to the tab and making another navigation.
  web_contents()->WasShown();
  AssertNoHistogramsLogged();

  // Navigate again to force histogram recording.
  NavigateAndCommit(GURL(kDefaultTestUrl2));

  histogram_tester().ExpectTotalCount(internal::kBackgroundHistogramCommit, 1);
  histogram_tester().ExpectTotalCount(
      internal::kBackgroundHistogramDomContentLoaded, 0);
  histogram_tester().ExpectTotalCount(internal::kBackgroundHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kBackgroundHistogramFirstLayout,
                                      1);
  histogram_tester().ExpectBucketCount(
      internal::kBackgroundHistogramFirstLayout, first_layout.InMilliseconds(),
      1);
  histogram_tester().ExpectTotalCount(
      internal::kBackgroundHistogramFirstTextPaint, 0);

  histogram_tester().ExpectTotalCount(internal::kHistogramCommit, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 0);
}

TEST_F(CorePageLoadMetricsObserverTest, OnlyBackgroundLaterEvents) {
  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  // Set these events at 1 microsecond so they are definitely occur before we
  // background the tab later in the test.
  timing.response_start = base::TimeDelta::FromMicroseconds(1);
  timing.dom_content_loaded_event_start = base::TimeDelta::FromMicroseconds(1);

  NavigateAndCommit(GURL(kDefaultTestUrl));
  SimulateTimingUpdate(timing);

  // Background the tab, then forground it.
  web_contents()->WasHidden();
  web_contents()->WasShown();
  timing.first_layout = base::TimeDelta::FromSeconds(3);
  timing.first_text_paint = base::TimeDelta::FromSeconds(4);
  PopulateRequiredTimingFields(&timing);
  SimulateTimingUpdate(timing);

  // Navigate again to force histogram recording.
  NavigateAndCommit(GURL(kDefaultTestUrl2));

  histogram_tester().ExpectTotalCount(internal::kBackgroundHistogramCommit, 0);
  histogram_tester().ExpectTotalCount(
      internal::kBackgroundHistogramDomContentLoaded, 0);
  histogram_tester().ExpectTotalCount(internal::kBackgroundHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kBackgroundHistogramFirstLayout,
                                      1);
  histogram_tester().ExpectBucketCount(
      internal::kBackgroundHistogramFirstLayout,
      timing.first_layout.InMilliseconds(), 1);
  histogram_tester().ExpectTotalCount(
      internal::kBackgroundHistogramFirstTextPaint, 1);
  histogram_tester().ExpectBucketCount(
      internal::kBackgroundHistogramFirstTextPaint,
      timing.first_text_paint.InMilliseconds(), 1);

  histogram_tester().ExpectTotalCount(internal::kHistogramCommit, 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded, 1);
  histogram_tester().ExpectBucketCount(
      internal::kHistogramDomContentLoaded,
      timing.dom_content_loaded_event_start.InMilliseconds(), 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 0);
}

TEST_F(CorePageLoadMetricsObserverTest, DontBackgroundQuickerLoad) {
  // Set this event at 1 microsecond so it occurs before we foreground later in
  // the test.
  base::TimeDelta first_layout = base::TimeDelta::FromMicroseconds(1);

  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_layout = first_layout;
  PopulateRequiredTimingFields(&timing);

  web_contents()->WasHidden();

  // Open in new tab
  StartNavigation(GURL(kDefaultTestUrl));

  // Switch to the tab
  web_contents()->WasShown();

  // Start another provisional load
  StartNavigation(GURL(kDefaultTestUrl2));
  content::RenderFrameHostTester* rfh_tester =
      content::RenderFrameHostTester::For(main_rfh());
  rfh_tester->SimulateNavigationCommit(GURL(kDefaultTestUrl2));
  SimulateTimingUpdate(timing);
  rfh_tester->SimulateNavigationStop();

  // Navigate again to see if the timing updated for the foregrounded load.
  NavigateAndCommit(GURL(kDefaultTestUrl));

  histogram_tester().ExpectTotalCount(internal::kHistogramCommit, 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 1);
  histogram_tester().ExpectBucketCount(internal::kHistogramFirstLayout,
                                       first_layout.InMilliseconds(), 1);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 0);
}

TEST_F(CorePageLoadMetricsObserverTest, FailedProvisionalLoad) {
  GURL url(kDefaultTestUrl);
  content::RenderFrameHostTester* rfh_tester =
      content::RenderFrameHostTester::For(main_rfh());
  rfh_tester->SimulateNavigationStart(url);
  rfh_tester->SimulateNavigationError(url, net::ERR_TIMED_OUT);
  rfh_tester->SimulateNavigationStop();

  histogram_tester().ExpectTotalCount(internal::kHistogramCommit, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramDomContentLoaded, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramLoad, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstLayout, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFirstTextPaint, 0);
  histogram_tester().ExpectTotalCount(internal::kHistogramFailedProvisionalLoad,
                                      1);
}

TEST_F(CorePageLoadMetricsObserverTest, FailedBackgroundProvisionalLoad) {
  // Test that failed provisional event does not get logged in the
  // histogram if it happened in the background
  GURL url(kDefaultTestUrl);
  content::RenderFrameHostTester* rfh_tester =
      content::RenderFrameHostTester::For(main_rfh());
  rfh_tester->SimulateNavigationStart(url);
  web_contents()->WasHidden();
  rfh_tester->SimulateNavigationError(url, net::ERR_TIMED_OUT);
  rfh_tester->SimulateNavigationStop();

  histogram_tester().ExpectTotalCount(internal::kHistogramFailedProvisionalLoad,
                                      0);
}

TEST_F(CorePageLoadMetricsObserverTest, BackgroundBeforePaint) {
  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_paint = base::TimeDelta::FromSeconds(10);
  PopulateRequiredTimingFields(&timing);
  NavigateAndCommit(GURL(kDefaultTestUrl));
  // Background the tab and go for a coffee or something.
  web_contents()->WasHidden();
  SimulateTimingUpdate(timing);
  // Come back and start browsing again.
  web_contents()->WasShown();
  // Simulate the user performaning another navigation.
  NavigateAndCommit(GURL("https://www.example.com"));
  histogram_tester().ExpectTotalCount(internal::kHistogramBackgroundBeforePaint,
                                      1);
}

TEST_F(CorePageLoadMetricsObserverTest, NoRappor) {
  rappor::TestSample::Shadow* sample_obj =
      rappor_tester_.GetRecordedSampleForMetric(
          internal::kRapporMetricsNameCoarseTiming);
  EXPECT_EQ(sample_obj, nullptr);
}

TEST_F(CorePageLoadMetricsObserverTest, RapporLongPageLoad) {
  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_contentful_paint = base::TimeDelta::FromSeconds(40);
  PopulateRequiredTimingFields(&timing);
  NavigateAndCommit(GURL(kDefaultTestUrl));
  SimulateTimingUpdate(timing);

  // Navigate again to force logging RAPPOR.
  NavigateAndCommit(GURL(kDefaultTestUrl2));
  rappor::TestSample::Shadow* sample_obj =
      rappor_tester_.GetRecordedSampleForMetric(
          internal::kRapporMetricsNameCoarseTiming);
  const auto& string_it = sample_obj->string_fields.find("Domain");
  EXPECT_NE(string_it, sample_obj->string_fields.end());
  EXPECT_EQ(rappor::GetDomainAndRegistrySampleFromGURL(GURL(kDefaultTestUrl)),
            string_it->second);

  const auto& flag_it = sample_obj->flag_fields.find("IsSlow");
  EXPECT_NE(flag_it, sample_obj->flag_fields.end());
  EXPECT_EQ(1u, flag_it->second);
}

TEST_F(CorePageLoadMetricsObserverTest, RapporQuickPageLoad) {
  page_load_metrics::PageLoadTiming timing;
  timing.navigation_start = base::Time::FromDoubleT(1);
  timing.first_contentful_paint = base::TimeDelta::FromSeconds(1);
  PopulateRequiredTimingFields(&timing);

  NavigateAndCommit(GURL(kDefaultTestUrl));
  SimulateTimingUpdate(timing);

  // Navigate again to force logging RAPPOR.
  NavigateAndCommit(GURL(kDefaultTestUrl2));
  rappor::TestSample::Shadow* sample_obj =
      rappor_tester_.GetRecordedSampleForMetric(
          internal::kRapporMetricsNameCoarseTiming);
  const auto& string_it = sample_obj->string_fields.find("Domain");
  EXPECT_NE(string_it, sample_obj->string_fields.end());
  EXPECT_EQ(rappor::GetDomainAndRegistrySampleFromGURL(GURL(kDefaultTestUrl)),
            string_it->second);

  const auto& flag_it = sample_obj->flag_fields.find("IsSlow");
  EXPECT_NE(flag_it, sample_obj->flag_fields.end());
  EXPECT_EQ(0u, flag_it->second);
}


text:
window.numberToText = function(number, sequence, onesOnly) {
	var numberText = {
		normal: {
			ones: [
				"zero",
				"one",
				"two",
				"three",
				"four",
				"five",
				"six",
				"seven",
				"eight",
				"nine",
				"ten"
			],
			teens: [
				"eleven",
				"twelve",
				"thirteen",
				"fourteen",
				"fifteen",
				"sixteen",
				"seventeen",
				"eighteen",
				"nineteen"
			],
			tens: [
				"twenty",
				"thirty",
				"fourty",
				"fifty",
				"sixty",
				"seventy",
				"eighty",
				"ninety"
			],
			hundred: "hundred",
			thousand: "thousand",
			million: "million",
			billion: "billion",
			trillion: "trillion",
			negative: "negative",
			point: "point"
		},
		sequence: {
			ones: [
				"zeroth",
				"first",
				"second",
				"third",
				"fourth",
				"fifth",
				"sixth",
				"seventh",
				"eighth",
				"nineth",
				"tenth"
			],
			teens: [
				"eleventh",
				"twelfth",
				"thirteenth",
				"fourteenth",
				"fifteenth",
				"sixteenth",
				"seventeenth",
				"eighteenth",
				"nineteenth"
			],
			tens: [
				"twenty",
				"thirty",
				"fourty",
				"fifty",
				"sixty",
				"seventy",
				"eighty",
				"ninety"
			],
			onlyTens: [
				"twentieth",
				"thirtieth",
				"fourtieth",
				"fiftieth",
				"sixtieth",
				"seventieth",
				"eightieth",
				"ninetieth"
			],
			hundred: "hundred",
			onlyHundred: "hundredth",
			thousand: "thousand",
			onlyThousand: "thousandth",
			million: "million",
			onlyMillion: "millionth",
			billion: "billion",
			onlyBillion: "billionth",
			trillion: "trillion",
			onlyTrillion: "trillionth"
		}
	};

	if (number < 0) {
		return numberText.normal.negative + " " + numberToText(number * -1, sequence);
	}
	if (number % 1 != 0) {
		return numberToText(Math.floor(number)) + " " + numberText.normal.point + " " + numberToText(parseInt(number.toString().replace(/\d*\./, "")), sequence, true);
	}
	if (onesOnly) {
		if (number < 10)
			return numberText.normal.ones[number];
		return numberText.normal.ones[number.toString()[0]] + " " + numberToText(parseInt(number.toString().slice(1)), sequence, true);
	}
	if (sequence) {
		if (number < 11) {
			return numberText.sequence.ones[number];
		} else if (number < 20) {
			return numberText.sequence.teens[number - 11];
		} else if (number % 10 == 0 && number < 100) {
			return numberText.sequence.onlyTens[(number / 10) - 2];
		} else if (number < 100) {
			return numberText.sequence.tens[Math.floor(number / 10) - 2] + "-" + numberText.sequence.ones[number % 10];
		} else if (number % 100 == 0 && number < 1000) {
			return numberText.normal.ones[number / 100] + " " + numberText.sequence.onlyHundred;
		} else if (number < 1000) {
			return numberText.normal.ones[Math.floor(number / 100)] + " " + numberText.sequence.hundred + " " + numberToText(number % 100, true);
		} else if (number % 1000 == 0 && number < 1000000) {
			return numberToText(number / 1000) + " " + numberText.sequence.onlyThousand;
		} else if (number < 1000000) {
			return numberToText(Math.floor(number / 1000)) + " " + numberText.sequence.thousand + " " + numberToText(number % 1000, true);
		}
	} else {
		if (number < 11) {
			return numberText.normal.ones[number];
		} else if (number < 20) {
			return numberText.normal.teens[number - 11];
		} else if (number % 10 == 0 && number < 100) {
			return numberText.normal.tens[(number / 10) - 2];
		} else if (number < 100) {
			return numberText.normal.tens[Math.floor(number / 10) - 2] + "-" + numberText.normal.ones[number % 10];
		} else if (number % 100 == 0 && number < 1000) {
			return numberText.normal.ones[number / 100] + " " + numberText.normal.hundred;
		} else if (number < 1000) {
			return numberText.normal.ones[Math.floor(number / 100)] + " " + numberText.normal.hundred + " " + numberToText(number % 100);
		} else if (number % 1000 == 0 && number < 1000000) {
			return numberToText(number / 1000) + " " + numberText.normal.onlyThousand;
		} else if (number < 1000000) {
			return numberToText(Math.floor(number / 1000)) + " " + numberText.normal.thousand + " " + numberToText(number % 1000);
		} else if (number % 1000000 == 0 && number < 1000000000) {
			return numberToText(number / 1000000) + " " + numberText.normal.onlyMillion;
		} else if (number < 1000000000) {
			return numberToText(Math.floor(number / 1000000)) + " " + numberText.normal.million + " " + numberToText(number % 1000000);
		} else if (number % 1000000000 == 0 && number < 1000000000000) {
			return numberToText(number / 1000000000) + " " + numberText.normal.onlyBillion;
		} else if (number < 1000000000000) {
			return numberToText(Math.floor(number / 1000000000)) + " " + numberText.normal.billion + " " + numberToText(number % 1000000000);
		} else if (number % 1000000000000 == 0 && number < 1000000000000000) {
			return numberToText(number / 1000000000000) + " " + numberText.normal.onlyTrillion;
		} else if (number < 1000000000000000) {
			return numberToText(Math.floor(number / 1000000000000)) + " " + numberText.normal.trillion + " " + numberToText(number % 1000000000000);
		}
	}
}


text:
@interface NSButton (Style)
- (void)setTitle:(NSString*)title withColor:(NSColor*)color;
- (void)setTitleColor:(NSColor*)color;
@end


text:
using GitTfs.Util;
using NDesk.Options;

namespace GitTfs.Commands
{
    [StructureMapSingleton]
    public class RemoteOptions
    {
        public OptionSet OptionSet
        {
            get
            {
                return new OptionSet
                {
                    { "ignore-regex=", "A regex of files to ignore",
                        v => IgnoreRegex = v },
                    { "except-regex=", "A regex of exceptions to '--ignore-regex'",
                        v => ExceptRegex = v},
                    { "gitignore:", "Use .gitignore to ignore files on download from TFS. Alternatively, provide path toward the .gitignore file which will be used to ignore files",
                        v => { GitIgnorePath = v; UseGitIgnore = true; } },
                    { "no-gitignore", "Do not use .gitignore to ignore files on download from TFS",
                        v => NoGitIgnore = v != null },
                    { "u|username=", "TFS username",
                        v => Username = v },
                    { "p|password=", "TFS password",
                        v => Password = v },
                    { "no-parallel", "Do not do parallel requests to TFS",
                        v => NoParallel = (v != null) },
                };
            }
        }

        public string IgnoreRegex { get; set; }
        public string ExceptRegex { get; set; }
        public string GitIgnorePath { get; set; }
        public bool UseGitIgnore { get; set; }
        public bool NoGitIgnore { get; set; }
        public string Username { get; set; }
        public string Password { get; set; }
        public bool NoParallel { get; set; }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 321905 $ -->

<phpdoc:classref xml:id="class.reflectionexception" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

 <title>The ReflectionException class</title>
 <titleabbrev>ReflectionException</titleabbrev>

 <partintro>

<!-- {{{ ReflectionException intro -->
  <section xml:id="reflectionexception.intro">
   &reftitle.intro;
   <para>
    The ReflectionException class.
   </para>
  </section>
<!-- }}} -->

  <section xml:id="reflectionexception.synopsis">
   &reftitle.classsynopsis;

<!-- {{{ Synopsis -->
   <classsynopsis>
    <ooclass><classname>ReflectionException</classname></ooclass>

<!-- {{{ Class synopsis -->
    <classsynopsisinfo>
     <ooclass>
      <classname>ReflectionException</classname>
     </ooclass>

     <ooclass>
      <modifier>extends</modifier>
      <classname>Exception</classname>
     </ooclass>
    </classsynopsisinfo>
<!-- }}} -->
    <classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('exception.synopsis')/db:classsynopsis/db:fieldsynopsis)" />

    <classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />

   </classsynopsis>
<!-- }}} -->

  </section>

 </partintro>

</phpdoc:classref>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->