text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2014-2015 Groupon, Inc
  ~ Copyright 2014-2015 The Billing Project, LLC
  ~
  ~ The Billing Project licenses this file to you under the Apache License, version 2.0
  ~ (the "License"); you may not use this file except in compliance with the
  ~ License.  You may obtain a copy of the License at:
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
  ~ License for the specific language governing permissions and limitations
  ~ under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>killbill-oss-parent</artifactId>
        <groupId>org.kill-bill.billing</groupId>
        <version>0.37</version>
    </parent>
    <groupId>org.kill-bill.billing.plugin.java</groupId>
    <artifactId>adyen-plugin</artifactId>
    <name>Kill Bill OSGI Adyen plugin</name>
    <version>0.2.2-SNAPSHOT</version>
    <packaging>bundle</packaging>
    <description>Kill Bill Adyen plugin</description>
    <url>http://github.com/killbill/killbill-adyen-plugin</url>
    <scm>
        <connection>scm:git:git://github.com/killbill/killbill-adyen-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:killbill/killbill-adyen-plugin.git</developerConnection>
        <url>http://github.com/killbill/killbill-adyen-plugin/tree/master</url>
    </scm>
    <issueManagement>
        <system>Github</system>
        <url>https://github.com/killbill/killbill-adyen-plugin/issues</url>
    </issueManagement>
    <properties>
        <cxf.version>3.0.4</cxf.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing</groupId>
            <artifactId>killbill-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing.plugin</groupId>
            <artifactId>killbill-plugin-api-payment</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing.plugin</groupId>
            <artifactId>killbill-plugin-api-notification</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing.plugin.java</groupId>
            <artifactId>killbill-base-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing.plugin.java</groupId>
            <artifactId>killbill-base-plugin</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.commons</groupId>
            <artifactId>killbill-clock</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing</groupId>
            <artifactId>killbill-platform-osgi-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing</groupId>
            <artifactId>killbill-platform-osgi-bundles-lib-killbill</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.billing</groupId>
            <artifactId>killbill-platform-osgi-bundles-lib-slf4j-osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kill-bill.commons</groupId>
            <artifactId>killbill-embeddeddb-mysql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jooq</groupId>
            <artifactId>jooq</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-core</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock</artifactId>
            <version>1.57</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${cxf.version}</version>
                <executions>
                    <execution>
                        <id>generate-wsdl-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceRoot>${basedir}/target/generated-sources/cxf-sources</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/cxf/Notification.wsdl</wsdl>
                                    <wsdlLocation>classpath:cxf/Notification.wsdl</wsdlLocation>
                                    <bindingFiles>
                                        <bindingFile>${basedir}/src/main/resources/cxf/jaxbNotification.xjb
                                        </bindingFile>
                                        <bindingFile>${basedir}/src/main/resources/cxf/jaxwsNotification.xjb
                                        </bindingFile>
                                    </bindingFiles>
                                    <extraargs>
                                        <extraarg>-xjc-extension</extraarg>
                                    </extraargs>
                                </wsdlOption>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/cxf/Payment.wsdl</wsdl>
                                    <wsdlLocation>classpath:cxf/Payment.wsdl</wsdlLocation>
                                    <bindingFiles>
                                        <bindingFile>${basedir}/src/main/resources/cxf/jaxbPayment.xjb</bindingFile>
                                        <bindingFile>${basedir}/src/main/resources/cxf/jaxwsPayment.xjb</bindingFile>
                                    </bindingFiles>
                                    <extraargs>
                                        <extraarg>-xjc-extension</extraarg>
                                    </extraargs>
                                </wsdlOption>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/cxf/OpenInvoiceDetail.wsdl</wsdl>
                                    <wsdlLocation>classpath:cxf/OpenInvoiceDetail.wsdl</wsdlLocation>
                                    <bindingFiles>
                                        <bindingFile>${basedir}/src/main/resources/cxf/jaxbOpenInvoice.xjb</bindingFile>
                                        <bindingFile>${basedir}/src/main/resources/cxf/jaxwsOpenInvoice.xjb
                                        </bindingFile>
                                    </bindingFiles>
                                    <extraargs>
                                        <extraarg>-xjc-extension</extraarg>
                                    </extraargs>
                                </wsdlOption>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/cxf/multiplus/PartnerTokenService-v1.wsdl</wsdl>
                                    <wsdlLocation>classpath:cxf/multiplus/PartnerTokenService-v1.wsdl</wsdlLocation>
                                    <bindingFiles>
                                        <bindingFile>
                                            ${basedir}/src/main/resources/cxf/multiplus/jaxbPartnerTokenService-v1.xjb
                                        </bindingFile>
                                        <bindingFile>
                                            ${basedir}/src/main/resources/cxf/multiplus/jaxwsPartnerTokenService-v1.xjb
                                        </bindingFile>
                                    </bindingFiles>
                                    <extraargs>
                                        <!-- extraarg>-xjc-Xlocator,-mark-generated</extraarg-->
                                        <extraarg>-xjc-extension</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>generate-wsdl-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <configuration>
                            <sourceRoot>${basedir}/target/generated-test-sources/cxf-sources</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/test/resources/cxf/Recurring.wsdl</wsdl>
                                    <wsdlLocation>classpath:cxf/Recurring.wsdl</wsdlLocation>
                                    <bindingFiles>
                                        <bindingFile>${basedir}/src/test/resources/cxf/jaxbRecurring.xjb</bindingFile>
                                        <bindingFile>${basedir}/src/test/resources/cxf/jaxwsRecurring.xjb</bindingFile>
                                    </bindingFiles>
                                    <extraargs>
                                        <extraarg>-xjc-extension</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${basedir}/target/generated-test-sources/cxf-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <archive>
                                <!-- use the manifest file created by the bundle plugin -->
                                <!--<useDefaultManifestFile>true</useDefaultManifestFile>-->
                                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                                <!-- bundle plugin already generated the maven descriptor -->
                                <addMavenDescriptor>false</addMavenDescriptor>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Activator>org.killbill.billing.plugin.adyen.core.AdyenActivator</Bundle-Activator>
                        <Export-Package />
                        <Private-Package>org.killbill.billing.plugin.adyen.*</Private-Package>
                        <!-- Optional resolution because exported by the Felix system bundle -->
                        <Import-Package>
                            org.killbill.billing.account.api;
                            org.killbill.billing.catalog.api;
                            org.killbill.billing.invoice.api;
                            org.killbill.billing.entitlement.api;
                            org.killbill.billing.notification.api;
                            org.killbill.billing.notification.plugin.api;
                            org.killbill.billing.notification.plugin;
                            org.killbill.billing.osgi.api;
                            org.killbill.billing.osgi.api.config;
                            org.killbill.billing.payment.api;
                            org.killbill.billing.payment.plugin.api;
                            org.killbill.billing.control.plugin.api;
                            org.killbill.billing.tenant.api;
                            org.killbill.billing.usage.api;
                            org.killbill.billing.util.api;
                            org.killbill.billing.currency.plugin.api;
                            org.killbill.billing.currency.api;
                            org.killbill.billing.security.api;
                            com.sun.xml.internal.ws;
                            com.sun.xml.internal.ws.addressing;
                            com.sun.xml.internal.ws.addressing.model;
                            com.sun.xml.internal.ws.addressing.policy;
                            com.sun.xml.internal.ws.addressing.v200408;
                            com.sun.xml.internal.ws.api;
                            com.sun.xml.internal.ws.api.addressing;
                            com.sun.xml.internal.ws.api.client;
                            com.sun.xml.internal.ws.api.config.management;
                            com.sun.xml.internal.ws.api.config.management.policy;
                            com.sun.xml.internal.ws.api.fastinfoset;
                            com.sun.xml.internal.ws.api.ha;
                            com.sun.xml.internal.ws.api.handler;
                            com.sun.xml.internal.ws.api.message;
                            com.sun.xml.internal.ws.api.message.stream;
                            com.sun.xml.internal.ws.api.model;
                            com.sun.xml.internal.ws.api.model.soap;
                            com.sun.xml.internal.ws.api.model.wsdl;
                            com.sun.xml.internal.ws.api.pipe;
                            com.sun.xml.internal.ws.api.pipe.helper;
                            com.sun.xml.internal.ws.api.policy;
                            com.sun.xml.internal.ws.api.server;
                            com.sun.xml.internal.ws.api.streaming;
                            com.sun.xml.internal.ws.api.wsdl.parser;
                            com.sun.xml.internal.ws.api.wsdl.writer;
                            com.sun.xml.internal.ws.binding;
                            com.sun.xml.internal.ws.client;
                            com.sun.xml.internal.ws.client.dispatch;
                            com.sun.xml.internal.ws.client.sei;
                            com.sun.xml.internal.ws.config.management.policy;
                            com.sun.xml.internal.ws.developer;
                            com.sun.xml.internal.ws.encoding;
                            com.sun.xml.internal.ws.encoding.fastinfoset;
                            com.sun.xml.internal.ws.encoding.policy;
                            com.sun.xml.internal.ws.encoding.soap;
                            com.sun.xml.internal.ws.encoding.soap.streaming;
                            com.sun.xml.internal.ws.encoding.xml;
                            com.sun.xml.internal.ws.fault;
                            com.sun.xml.internal.ws.handler;
                            com.sun.xml.internal.ws.message;
                            com.sun.xml.internal.ws.message.jaxb;
                            com.sun.xml.internal.ws.message.saaj;
                            com.sun.xml.internal.ws.message.source;
                            com.sun.xml.internal.ws.message.stream;
                            com.sun.xml.internal.ws.model;
                            com.sun.xml.internal.ws.model.soap;
                            com.sun.xml.internal.ws.model.wsdl;
                            com.sun.xml.internal.ws.org.objectweb.asm;
                            com.sun.xml.internal.ws.policy;
                            com.sun.xml.internal.ws.policy.jaxws;
                            com.sun.xml.internal.ws.policy.jaxws.spi;
                            com.sun.xml.internal.ws.policy.privateutil;
                            com.sun.xml.internal.ws.policy.sourcemodel;
                            com.sun.xml.internal.ws.policy.sourcemodel.attach;
                            com.sun.xml.internal.ws.policy.sourcemodel.wspolicy;
                            com.sun.xml.internal.ws.policy.spi;
                            com.sun.xml.internal.ws.policy.subject;
                            com.sun.xml.internal.ws.protocol.soap;
                            com.sun.xml.internal.ws.protocol.xml;
                            com.sun.xml.internal.ws.resources;
                            com.sun.xml.internal.ws.server;
                            com.sun.xml.internal.ws.server.provider;
                            com.sun.xml.internal.ws.server.sei;
                            com.sun.xml.internal.ws.spi;
                            com.sun.xml.internal.ws.streaming;
                            com.sun.xml.internal.ws.transport;
                            com.sun.xml.internal.ws.transport.http;
                            com.sun.xml.internal.ws.transport.http.client;
                            com.sun.xml.internal.ws.transport.http.server;
                            com.sun.xml.internal.ws.util;
                            com.sun.xml.internal.ws.util.exception;
                            com.sun.xml.internal.ws.util.localization;
                            com.sun.xml.internal.ws.util.pipe;
                            com.sun.xml.internal.ws.util.xml;
                            com.sun.xml.internal.ws.wsdl;
                            com.sun.xml.internal.ws.wsdl.parser;
                            com.sun.xml.internal.ws.wsdl.writer;
                            com.sun.xml.internal.ws.wsdl.writer.document;
                            com.sun.xml.internal.ws.wsdl.writer.document.http;
                            com.sun.xml.internal.ws.wsdl.writer.document.soap;
                            com.sun.xml.internal.ws.wsdl.writer.document.soap12;
                            com.sun.xml.internal.ws.wsdl.writer.document.xsd,
                            org.xml.sax.ext;
                            org.xml.sax.helpers;
                            org.xml.sax;
                            org.w3c.dom;
                            org.w3c.dom.ls;
                            javax.net.ssl;
                            javax.management;
                            javax.jws;
                            javax.jws.soap;
                            javax.annotation;
                            javax.activation;
                            javax.xml.soap;
                            javax.xml.ws;
                            javax.xml.ws.spi;
                            javax.xml.ws.handler.soap;
                            javax.xml.ws.handler;
                            javax.xml.ws.http;
                            javax.xml.ws.soap;
                            javax.xml.ws.wsaddressing;
                            javax.xml.stream;
                            javax.xml.stream.events;
                            javax.xml.stream.util;
                            javax.xml.bind.annotation.adapters;
                            javax.xml.bind;
                            javax.xml.bind.helpers;
                            javax.xml.bind.annotation;
                            javax.xml.bind.attachment;
                            javax.xml.datatype;
                            javax.xml.namespace;
                            javax.xml.parsers;
                            javax.xml.transform;
                            javax.xml.transform.sax;
                            javax.xml.transform.dom;
                            javax.xml.transform.stream;
                            javax.xml.xpath;
                            javax.naming.directory;
                            javax.naming.event;
                            javax.naming.ldap;
                            javax.naming.spi;
                            javax.naming;
                            version="[0,3)",
                            *;resolution:=optional
                        </Import-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <id>assemble-killbill-osgi-bundles-adyen-plugin</id>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <createSourcesJar>true</createSourcesJar>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
                            <filters>
                                <filter>
                                    <artifact>${project.groupId}:${project.artifactId}</artifact>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jar-with-dep</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assembly/jar-assembly.xml</descriptor>
                            </descriptors>
                            <archive>
                                <manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
'use strict';

describe('client', function () {

  var $scope, element, $routeParams, clientFactory, q, location, $location,
  deferred, $httpBackend, networkFactory, zoneFactory, reportFactory, groupPolicyFactory;

  beforeEach(module('templates'));

  beforeEach(module('myApp', function($provide) {
    clientFactory = {
      get: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
      query: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
      create: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
      update: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
      destroy: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
    };
    groupPolicyFactory = {
      get: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
    };
    reportFactory = {
      clientstats: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
    };
    networkFactory = {
      get: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
    };
    zoneFactory = {
      get: function () {
        deferred = q.defer();
        return {$promise: deferred.promise};
      },
    };
    $provide.value("Report", reportFactory);
    $provide.value("Zone", zoneFactory);
    $provide.value("Network", networkFactory);
    $provide.value("Client", clientFactory);
    $provide.value("GroupPolicy", groupPolicyFactory);
  }));

  beforeEach(inject(function($injector) {
    $httpBackend = $injector.get('$httpBackend');
    $httpBackend.whenGET('/translations/en_GB.json').respond("");
  }));

  describe('lists the clients', function() {
    beforeEach(inject(function($compile, $rootScope, $q, _$routeParams_, $injector, _$location_) {
      $scope = $rootScope;
      q = $q;
      $location = _$location_;
      $routeParams = _$routeParams_;
      $routeParams.id = 'xxx';
      $routeParams.period = 'my-period';
      $routeParams.per = 100;
      $routeParams.page = 10;
      $routeParams.fn = 'my-fn';
      $routeParams.type = 'my-type';
      $routeParams.ap_mac = 'ap-mac';
      $routeParams.client_mac = 'client-mac';
      $routeParams.period = '1d';
      $routeParams.policy_id = '1';
      $scope.loading = true;
      $scope.location = { slug: 123 }
      var elem = angular.element('<clients-index><clients location="location" loading="loading"></clients></clients-index>');
      element = $compile(elem)($rootScope);
      element.scope().$digest();
    }));

    it("should set the default scopes vals", function() {
      var clientScope = element.find('clients').isolateScope()
      spyOn(clientFactory, 'query').and.callThrough();
      expect(clientScope.selected.length).toEqual(0);
      expect(clientScope.options.autoSelect).toEqual(true);
      expect(clientScope.options.boundaryLinks).toEqual(false);
      expect(clientScope.options.largeEditDialog).toEqual(false);
      expect(clientScope.options.pageSelector).toEqual(false);
      expect(clientScope.options.rowSelection).toEqual(true);
      // expect(clientScope.query.order).toEqual('-lastseen');
      expect(clientScope.query.order).toEqual('updated_at');
      expect(clientScope.query.limit).toEqual(100);
      expect(clientScope.query.page).toEqual(10);
      expect(clientScope.toggleSearch).toEqual(false);
      expect(clientScope.type).toEqual('my-type');
      expect(clientScope.ap_mac).toEqual('ap-mac');
      expect(clientScope.client_mac).toEqual('client-mac');
      expect(clientScope.policy_id).toEqual('1');
      expect(clientScope.period).toEqual('1d');

      var d = new Date();
      d.setHours(d.getHours()-2);
      var t = parseInt(d) / 1000;
      expect(clientScope.start).toEqual(t);

      expect(clientScope.menu.length).toEqual(1);
      expect(clientScope.menu[0].type).toEqual('view');
    });

    it("should trigger the menu action", function() {
      var clientScope = element.find('clients').isolateScope()
      spyOn(clientFactory, 'query').and.callThrough();
      var client = { id: 123 };
      clientScope.menuAction('view', client)
      expect($location.path()).toEqual('/locations/123/clients/123')
    });

    it("should update the search params", function() {
      var clientScope = element.find('clients').isolateScope()
      spyOn(clientFactory, 'query').and.callThrough();

      clientScope.updatePage();
      var s = $location.search();
      expect(s.ap_mac).toEqual('ap-mac');
      expect(s.client_mac).toEqual('client-mac')
    });

    it("should have the default search columns", function() {
      var clientScope = element.find('clients').isolateScope()
      spyOn(clientFactory, 'query').and.callThrough();

      expect(clientScope.columns.device_name).toEqual(true);
      expect(clientScope.columns.client_mac).toEqual(true);
      expect(clientScope.columns.ssid).toEqual(true);
      expect(clientScope.columns.txbps).toEqual(true);
      expect(clientScope.columns.rxbps).toEqual(false);
      expect(clientScope.columns.expected_throughput).toEqual(false);
      expect(clientScope.columns.tx).toEqual(true);
      expect(clientScope.columns.txbitrate).toEqual(false);
      expect(clientScope.columns.rxbitrate).toEqual(false);
      expect(clientScope.columns.snr).toEqual(true);
      expect(clientScope.columns.signal).toEqual(false);
      expect(clientScope.columns.ip).toEqual(true);
      expect(clientScope.columns.lastseen).toEqual(true);
      expect(clientScope.columns.capabilities).toEqual(false);
      expect(clientScope.columns.manufacturer).toEqual(false);
      expect(clientScope.columns.splash_username).toEqual(false);
      expect(clientScope.columns.type).toEqual(true);
    });

    it("should fetch the clients", function() {
      var clientScope = element.find('clients').isolateScope()
      spyOn(clientFactory, 'query').and.callThrough();

      var res = { clients: [{ id: 123 } ], _links: {} };
      deferred.resolve(res);
      $scope.$apply();

      expect(clientScope.clients[0].id).toEqual(123);
      expect(clientScope._links).toEqual({});
    });

    // Keeps failing since we added the group policies fn
    it("should load the timelines", function() {
      var clientScope = element.find('clients').isolateScope()
      spyOn(clientFactory, 'query').and.callThrough();
      spyOn(groupPolicyFactory, 'get').and.callThrough();
      spyOn(reportFactory, 'clientstats').and.callThrough();

      var res = { clients: [{ id: 123 } ], _links: {} };
      deferred.resolve(res);
      $scope.$apply();

      expect(clientScope.clients[0].id).toEqual(123);
      expect(clientScope.loadingChart).toEqual(true);

      var data = { timeline: 'my-timeline' };
      deferred.resolve(data);
      $scope.$apply();

      // expect(clientScope.loadingChart).toEqual(undefined);
    });

    // Keeps failing since we added the group policies fn
    xit("should load the group policies and filter", function() {
      var clientScope = element.find('clients').isolateScope()
      spyOn(clientFactory, 'query').and.callThrough();
      spyOn(groupPolicyFactory, 'get').and.callThrough();

      var res = { clients: [{ id: 123 } ], _links: {} };
      deferred.resolve(res);
      $scope.$apply();

      expect(clientScope.clients[0].id).toEqual(123);

      var data = { timeline: [] };
      deferred.resolve(data);
      $scope.$apply();

      var gp = { group_policies: [{id: 1111}] };
      deferred.resolve(data);
      $scope.$apply();

      expect(clientScope.group_policies[0].id).toEqual(111111111111);
    });

    it("should create a client", function() {
      var clientScope = element.find('client-detail').isolateScope()
      spyOn(clientFactory, 'create').and.callThrough();

      // clientScope.update();
      // expect(clientScope.client.updating).toEqual(true);
      // var client = { id: 123 };
      // deferred.resolve(client);
      // $scope.$apply();

      // expect(clientScope.client.updating).toEqual(undefined);
    });

  });

  describe('displays the client', function() {
    beforeEach(inject(function($compile, $rootScope, $q, _$routeParams_, $injector) {
      $scope = $rootScope;
      q = $q;
      $routeParams = _$routeParams_;
      $routeParams.id = 'xxx';
      $routeParams.period = 'my-period';
      $routeParams.fn = 'my-fn';
      $routeParams.ap_mac = 'ap-mac';
      $scope.loading = true;
      var elem = angular.element('<client-chart><client-detail loading="loading"></client-detail></client-chart>');
      element = $compile(elem)($rootScope);
      element.scope().$digest();
    }));

    it("should set the default scopes vals", function() {
      var clientScope = element.find('client-detail').isolateScope()
      spyOn(clientFactory, 'get').and.callThrough();
      expect(clientScope.location.slug).toEqual('xxx');
      expect(clientScope.ap_mac).toEqual('ap-mac');
      expect(clientScope.fn).toEqual('my-fn');
      expect(clientScope.period).toEqual('my-period');

      var client = { id: 123 };
      deferred.resolve(client);
      $scope.$apply();

      expect(clientScope.client.id).toEqual(123);
    });

    it("should fetch the group policies", function() {
      // var clientScope = element.find('client-detail').isolateScope()
      // spyOn(clientFactory, 'update').and.callThrough();

      // clientScope.update();
      // expect(clientScope.client.updating).toEqual(true);
      // var client = { id: 123 };
      // deferred.resolve(client);
      // $scope.$apply();

      // expect(clientScope.client.updating).toEqual(undefined);
    });

    it("should update a client", function() {
      // var clientScope = element.find('client-detail').isolateScope()
      // spyOn(clientFactory, 'update').and.callThrough();

      // clientScope.update();
      // expect(clientScope.client.updating).toEqual(true);
      // var client = { id: 123 };
      // deferred.resolve(client);
      // $scope.$apply();

      // expect(clientScope.client.updating).toEqual(undefined);
    });

  });

});

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<title>WiFi Photobooth</title>

    <meta http-equiv="refresh" content="0; URL=slideshow">

	Open slideshow


text:
// Copyright 2016 Twitter. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.twitter.heron.healthmgr.common;

import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.microsoft.dhalion.metrics.ComponentMetrics;
import com.microsoft.dhalion.metrics.InstanceMetrics;

import org.apache.commons.math3.stat.regression.SimpleRegression;

import com.twitter.heron.healthmgr.sensors.BaseSensor;

import static com.twitter.heron.healthmgr.sensors.BaseSensor.MetricName.METRIC_BACK_PRESSURE;
import static com.twitter.heron.healthmgr.sensors.BaseSensor.MetricName.METRIC_BUFFER_SIZE;
import static com.twitter.heron.healthmgr.sensors.BaseSensor.MetricName.METRIC_WAIT_Q_GROWTH_RATE;

/**
 * A helper class to compute and hold metrics derived from component metrics
 */
public class ComponentMetricsHelper {
  private final ComponentMetrics componentMetrics;

  private List<InstanceMetrics> boltsWithBackpressure = new ArrayList<>();
  private double maxBufferChangeRate = 0;
  private double totalBackpressure = 0;

  public ComponentMetricsHelper(ComponentMetrics compMetrics) {
    this.componentMetrics = compMetrics;
  }

  public void computeBpStats() {
    for (InstanceMetrics instanceMetrics : componentMetrics.getMetrics().values()) {
      double bpValue = instanceMetrics.getMetricValueSum(METRIC_BACK_PRESSURE.text());
      if (bpValue > 0) {
        boltsWithBackpressure.add(instanceMetrics);
        totalBackpressure += bpValue;
      }
    }
  }

  public void computeBufferSizeTrend() {
    for (InstanceMetrics instanceMetrics : componentMetrics.getMetrics().values()) {
      Map<Instant, Double> bufferMetrics
          = instanceMetrics.getMetrics().get(METRIC_BUFFER_SIZE.text());
      if (bufferMetrics == null || bufferMetrics.size() < 3) {
        // missing of insufficient data for creating a trend line
        continue;
      }

      SimpleRegression simpleRegression = new SimpleRegression(true);
      for (Instant timestamp : bufferMetrics.keySet()) {
        simpleRegression.addData(timestamp.getEpochSecond(), bufferMetrics.get(timestamp));
      }

      double slope = simpleRegression.getSlope();
      instanceMetrics.addMetric(METRIC_WAIT_Q_GROWTH_RATE.text(), slope);

      if (maxBufferChangeRate < slope) {
        maxBufferChangeRate = slope;
      }
    }
  }

  public MetricsStats computeMinMaxStats(BaseSensor.MetricName metric) {
    return computeMinMaxStats(metric.text());
  }

  public MetricsStats computeMinMaxStats(String metric) {
    double metricMax = 0;
    double metricMin = Double.MAX_VALUE;
    for (InstanceMetrics instance : componentMetrics.getMetrics().values()) {

      Double metricValue = instance.getMetricValueSum(metric);
      if (metricValue == null) {
        continue;
      }
      metricMax = metricMax < metricValue ? metricValue : metricMax;
      metricMin = metricMin > metricValue ? metricValue : metricMin;
    }
    return new MetricsStats(metricMin, metricMax);
  }

  public double getTotalBackpressure() {
    return totalBackpressure;
  }

  public double getMaxBufferChangeRate() {
    return maxBufferChangeRate;
  }

  public List<InstanceMetrics> getBoltsWithBackpressure() {
    return boltsWithBackpressure;
  }
}


text:
( function($) {
	ET_PageBuilder.Theme_Compat_Make = window.wp.Backbone.View.extend({
		initialize : function() {
			this.listenTo( Backbone.Events, 'et-activate-builder', this.activateDiviBuilder );
			this.listenTo( Backbone.Events, 'et-deactivate-builder', this.deactivateDiviBuilder );
		},

		activateDiviBuilder : function() {
			this.toggleMakeBuilder( 'off' );
		},

		deactivateDiviBuilder : function() {
			this.toggleMakeBuilder( 'on' );
		},

		toggleMakeBuilder : function( toggle ) {
			var $make_builder      = $('#ttfmake-builder'),
				$template_selector = $('#page_template'),
				$template_selector_builder = $template_selector.find('option[value="template-builder.php"]');

			if ( toggle === 'on' ) {
				$make_builder.show();
				$template_selector_builder.attr({ 'selected' : 'selected' }).removeAttr( 'disabled' );
			} else {
				$make_builder.hide();
				$template_selector_builder.attr({ 'disabled' : 'disabled' }).removeAttr( 'selected' );
			}

			$template_selector.trigger( 'change' );
		}
	});

	// Initialize view
	var ET_PageBuilder_Theme_Compat = new ET_PageBuilder.Theme_Compat_Make;

	// On page load, disable Make Builder if Divi Builder is already used
	if ( $('#et_pb_toggle_builder.et_pb_builder_is_used').length ) {
		ET_PageBuilder_Theme_Compat.activateDiviBuilder();
	}
} )(jQuery);


text:
var should = require('should'),
    cex = require('../lib/engine.js');

describe('cex', function() {
  describe('attributes', function() {
    it('has version attribute', function() {
      cex.should.have.property('version');
    })

    it('has Game attribute', function() {
      cex.should.have.property('Game', cex.Game);
    })

    it('has Board attribute', function() {
      cex.should.have.property('Board', cex.Board);
    })

    it('has Player attribute', function() {
      cex.should.have.property('Player', cex.Player);
    })

    it('has Piece attribute', function() {
      cex.should.have.property('Piece', cex.Piece);
    })

    it('has Move attribute', function() {
      cex.should.have.property('Move', cex.Move);
    })
  })
})


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/C:/Users/CK/AndroidStudioProjects/OMGAndroid/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-port/values-port.xml -->
    <eat-comment/>
    <bool name="abc_action_bar_embed_tabs">false</bool>
</resources>


text:
package org.apache.syncope.fit.console;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
import org.apache.syncope.client.console.pages.Types;
import org.apache.syncope.client.console.panels.AjaxDataTablePanel;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AjaxFallbackDataTable;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.client.console.wicket.markup.html.form.IndicatingOnConfirmAjaxLink;
import org.apache.wicket.Component;
import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.util.tester.FormTester;
import org.junit.Test;

public class AnyTypeClassesITCase extends AbstractTypesITCase {

    @Test
    public void read() {
        browsingToAnyTypeClasses();

        Component result = findComponentByProp(KEY, DATATABLE_PATH, "csv");
        TESTER.assertLabel(
                result.getPageRelativePath() + ":cells:1:cell", "csv");

        TESTER.assertComponent(
                result.getPageRelativePath() + ":cells:6:cell:panelEdit:editLink", IndicatingAjaxLink.class);

        TESTER.clickLink(result.getPageRelativePath() + ":cells:6:cell:panelEdit:editLink");

        TESTER.assertComponent(
                "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", BaseModal.class);
    }

    @Test
    public void create() {
        browsingToAnyTypeClasses();
        final String anyTypeClassTest = "anyTypeClassTest";

        TESTER.clickLink("body:content:tabbedPanel:panel:container:content:add");

        TESTER.assertComponent(
                "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);

        FormTester formTester =
                TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
        formTester.setValue("content:anyTypeClassDetailsPanel:form:key:textField", anyTypeClassTest);
        formTester.setValue(
                "content:anyTypeClassDetailsPanel:form:container:derSchemas:paletteField:recorder", "mderiveddata");

        TESTER.clearFeedbackMessages();
        TESTER.clickLink(
                "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
        TESTER.assertInfoMessages("Operation executed successfully");

        TESTER.clearFeedbackMessages();
        TESTER.assertRenderedPage(Types.class);

        TESTER.clickLink("body:content:tabbedPanel:tabs-container:tabs:2:link");
        TESTER.assertComponent(DATATABLE_PATH + ":tablePanel:groupForm:checkgroup:dataTable",
                AjaxFallbackDataTable.class);

        TESTER.assertComponent(DATATABLE_PATH, AjaxDataTablePanel.class);

        Component result = findComponentByProp(KEY, DATATABLE_PATH, anyTypeClassTest);

        TESTER.assertLabel(result.getPageRelativePath() + ":cells:3:cell", "[mderiveddata]");
    }

    @Test
    public void update() {
        final String plainSchema = "anyPlainSchema";
        createPlainSchema(plainSchema);
        browsingToAnyTypeClasses();

        TESTER.assertComponent(
                DATATABLE_PATH
                + ":tablePanel:groupForm:checkgroup:dataTable:"
                + "body:rows:1:cells:6:cell:panelEdit:editLink", IndicatingAjaxLink.class);

        TESTER.clickLink(
                DATATABLE_PATH
                + ":tablePanel:groupForm:checkgroup:dataTable:body:rows:1:cells:6:cell:panelEdit:editLink");

        final FormTester formTester =
                TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
        formTester.setValue(
                "content:anyTypeClassDetailsPanel:form:container:plainSchemas:paletteField:recorder", plainSchema);

        TESTER.clickLink(
                "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
        TESTER.assertInfoMessages("Operation executed successfully");
    }

    @Test
    public void delete() {
        final String anyTypeClassName = "zStringDelete";
        createAnyTypeClassWithoutSchema(anyTypeClassName);
        browsingToAnyTypeClasses();
        TESTER.assertComponent(DATATABLE_PATH, AjaxDataTablePanel.class);

        Component result = findComponentByProp(KEY, DATATABLE_PATH, anyTypeClassName);

        assertNotNull(result);
        TESTER.assertComponent(
                result.getPageRelativePath() + ":cells:6:cell:panelDelete:deleteLink",
                IndicatingOnConfirmAjaxLink.class);

        TESTER.getRequest().addParameter("confirm", "true");
        TESTER.clickLink(TESTER.getComponentFromLastRenderedPage(
                result.getPageRelativePath() + ":cells:6:cell:panelDelete:deleteLink"));

        TESTER.executeAjaxEvent(TESTER.getComponentFromLastRenderedPage(
                result.getPageRelativePath() + ":cells:6:cell:panelDelete:deleteLink"), "click");
        TESTER.assertInfoMessages("Operation executed successfully");

        TESTER.cleanupFeedbackMessages();
        result = findComponentByProp(KEY, DATATABLE_PATH, anyTypeClassName);

        assertNull(result);
    }
}


text:
<!DOCTYPE HTML>

	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>FacetFilter - sap.ui.ux3</title>

	<link rel="stylesheet" href="../../../../../resources/sap/ui/thirdparty/qunit.css" type="text/css" media="screen">

QUnit tests: sap.ui.ux3.FacetFilter


text:
package controllers.api

import controllers.KafkaManagerContext
import features.ApplicationFeatures
import models.navigation.Menus
import play.api.i18n.{ I18nSupport, MessagesApi }
import play.api.libs.json._
import play.api.mvc._
import scala.concurrent.Future
import org.json4s.jackson.Serialization
import org.json4s.scalaz.JsonScalaz.toJSON

/**
 * @author jisookim0513
 */

class KafkaStateCheck (val messagesApi: MessagesApi, val kafkaManagerContext: KafkaManagerContext)
                      (implicit af: ApplicationFeatures, menus: Menus) extends Controller with I18nSupport {

  import play.api.libs.concurrent.Execution.Implicits.defaultContext

  private[this] val kafkaManager = kafkaManagerContext.getKafkaManager

  def brokers(c: String) = Action.async { implicit request =>
    kafkaManager.getBrokerList(c).map { errorOrBrokerList =>
      errorOrBrokerList.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        brokerList => Ok(Json.obj("brokers" -> brokerList.list.map(bi => bi.id).sorted))
      )
    }
  }

  def topics(c: String) = Action.async { implicit request =>
    kafkaManager.getTopicList(c).map { errorOrTopicList =>
      errorOrTopicList.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        topicList => Ok(Json.obj("topics" -> topicList.list.sorted))
      )
    }
  }

  def topicIdentities(c: String) = Action.async { implicit request =>
    implicit val formats = org.json4s.DefaultFormats
    kafkaManager.getTopicListExtended(c).map { errorOrTopicListExtended =>
      errorOrTopicListExtended.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        topicListExtended => Ok(Serialization.writePretty("topicIdentities" -> topicListExtended.list.flatMap(_._2).map(toJSON(_))))
      )
    }
  }

  def clusters = Action.async { implicit request =>
    implicit val formats = org.json4s.DefaultFormats
    kafkaManager.getClusterList.map { errorOrClusterList =>
      errorOrClusterList.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        clusterList => Ok(Serialization.writePretty("clusters" -> errorOrClusterList.toOption))
      )
    }
  }

  def underReplicatedPartitions(c: String, t: String) = Action.async { implicit request =>
    kafkaManager.getTopicIdentity(c, t).map { errorOrTopicIdentity =>
      errorOrTopicIdentity.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        topicIdentity => Ok(Json.obj("topic" -> t, "underReplicatedPartitions" -> topicIdentity.partitionsIdentity.filter(_._2.isUnderReplicated).map{case (num, pi) => pi.partNum}))
      )
    }
  }

  def unavailablePartitions(c: String, t: String) = Action.async { implicit request =>
    kafkaManager.getTopicIdentity(c, t).map { errorOrTopicIdentity =>
      errorOrTopicIdentity.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        topicIdentity => Ok(Json.obj("topic" -> t, "unavailablePartitions" -> topicIdentity.partitionsIdentity.filter(_._2.isr.isEmpty).map { case (num, pi) => pi.partNum })))
    }
  }

  def topicSummaryAction(cluster: String, consumer: String, topic: String, consumerType: String) = Action.async { implicit request =>
    getTopicSummary(cluster, consumer, topic, consumerType).map { errorOrTopicSummary =>
      errorOrTopicSummary.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        topicSummary => {
          Ok(topicSummary)
        })
    }
  }

  def getTopicSummary(cluster: String, consumer: String, topic: String, consumerType: String) = {
    kafkaManager.getConsumedTopicState(cluster, consumer, topic, consumerType).map { errorOrTopicSummary =>
      errorOrTopicSummary.map(
        topicSummary => {
          Json.obj("totalLag" -> topicSummary.totalLag, "percentageCovered" -> topicSummary.percentageCovered, "partitionOffsets" -> topicSummary.partitionOffsets.map {case (pnum, offset) => offset}, "partitionLatestOffsets" -> topicSummary.partitionLatestOffsets.map {case (pnum, latestOffset) => latestOffset}, "owners" -> topicSummary.partitionOwners.map {case (pnum, owner) => owner}   )
        })
    }
  }

  def groupSummaryAction(cluster: String, consumer: String, consumerType: String) = Action.async { implicit request =>
    kafkaManager.getConsumerIdentity(cluster, consumer, consumerType).flatMap { errorOrConsumedTopicSummary =>
      errorOrConsumedTopicSummary.fold(
        error =>
          Future.successful(BadRequest(Json.obj("msg" -> error.msg))),
        consumedTopicSummary => getGroupSummary(cluster, consumer, consumedTopicSummary.topicMap.keys, consumerType).map { topics =>
          Ok(JsObject(topics))
        })
    }
  }

  def getGroupSummary(cluster: String, consumer: String, groups: Iterable[String], consumerType: String): Future[Map[String, JsObject]] = {
    val cosumdTopicSummary: List[Future[(String, JsObject)]] = groups.toList.map { group =>
      getTopicSummary(cluster, consumer, group, consumerType)
        .map(topicSummary => group -> topicSummary.getOrElse(Json.obj()))
    }
    Future.sequence(cosumdTopicSummary).map(_.toMap)
  }

  def consumersSummaryAction(cluster: String) = Action.async { implicit request =>
    implicit val formats = org.json4s.DefaultFormats
    kafkaManager.getConsumerListExtended(cluster).map { errorOrConsumersSummary =>
      errorOrConsumersSummary.fold(
        error => BadRequest(Json.obj("msg" -> error.msg)),
        consumersSummary => Ok(Serialization.writePretty("consumers" -> consumersSummary.list.map{case ((consumer, consumerType), consumerIdentity) => Map("name" -> consumer, "type" -> consumerType.toString, "topics" -> consumerIdentity.map(_.topicMap.keys))}))
        )
    }
  }

}


text:
package at.magiun.core

import at.magiun.core.model._
import at.magiun.core.repository.{BlockEntity, MagiunDataSetEntity}

object TestData {

  val titanicCsvPath: String = getClass.getClassLoader.getResource("titanic.csv").getFile
  val titanicCsvUrl = s"file://$titanicCsvPath"

  val incomeCsvPath: String = getClass.getClassLoader.getResource("income.csv").getFile
  val incomeCsvUrl = s"file://$incomeCsvPath"

  lazy val bigCsvPath: String = getClass.getClassLoader.getResource("big.csv").getFile
  lazy val bigCsvUrl = s"file://$bigCsvPath"

  val titanicDataSetSource = DataSetSource(SourceType.FileCsv, titanicCsvUrl)
  val incomeDataSetSource = DataSetSource(SourceType.FileCsv, incomeCsvUrl)
  lazy val bigDataSetSource = DataSetSource(SourceType.FileCsv, bigCsvUrl)
  val mongoDataSource = DataSetSource(SourceType.Mongo, "mongodb://127.0.0.1/testDb/testCollection")

  val testDs1 = MagiunDataSet("1", "gigi", DataSetSource(SourceType.Mongo, "url") , Option.empty)
  val testDsEntity1 = MagiunDataSetEntity(1, "gigi", "FileCsv", titanicCsvUrl)

  val testBlock2 = Block("id-2", BlockType.FileReader, Seq(BlockInput("1", 0)), params = Map("x" -> "4"))
  val testBlockEntity1 = BlockEntity("id-2", "FileReader", """{"inputs":[{"blockId":"1","index":0}],"params":{"x":"4"}}""")

  val fileReaderBlock = Block("id-3", BlockType.FileReader, Seq.empty, Map("fileName" -> titanicCsvPath))
  val dropColBlock = Block("id-2", BlockType.DropColumn, Seq(BlockInput("id-3", 0)), Map("columnName" -> "Parch"))

}


text:
[![Build Status](https://travis-ci.org/wibosco/PaginationCoreData-Example.svg)](https://travis-ci.org/wibosco/PaginationCoreData-Example)

# PaginationCoreData-Example
Pagination core data example as shown in the this article - https://williamboles.com/thinking-about-the-pages-when-paginating/


text:
<?php

namespace common\models\db;

use Yii;

/**
 * This is the model class for table "question_level".
 *
 * @property integer $id
 * @property string $name
 * @property string $code
 * @property string $description
 * @property integer $status
 * @property string $created_time
 * @property string $updated_time
 */
class QuestionLevelDB extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'question_level';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'code'], 'required'],
            [['status'], 'integer'],
            [['created_time', 'updated_time'], 'safe'],
            [['name', 'code', 'description'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'code' => 'Code',
            'description' => 'Description',
            'status' => 'Status',
            'created_time' => 'Created Time',
            'updated_time' => 'Updated Time',
        ];
    }
}


text:
@import url('https://fonts.googleapis.com/css?family=Sriracha');
*, *:before, *:after {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}
body {
	color: #202020;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
pre {
	border-left: .25rem solid #202020;
}
mark {
	margin: 0.75rem 0.5rem;
	padding: 2px 6px;
}
.center {
	text-align: center;
}
.container {
	max-width: 980px;
}
.logo {
	width: 180px;
}
.full-height {
	height: auto;
	min-height: 100vh;
}
.half-height {
	height: auto;
	min-height: 50vh;
}
.flex-container {
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	align-content: center;
}
.half-flex-container {
	min-height: 50vh;
	display: flex;
	justify-content: center;
	align-items: center;
	align-content: center;
}
.white-section {
	background-color: #FFFFFF;
}
.grey-section {
	background-color: #F8F8F8;
}
.body-text {
	margin-bottom: 2rem;
}
.footer-text {
	color: #888888;
	font-size: 0.8rem;
}
.main-title {
	font-family: 'Sriracha', cursive;
	font-size: 2.75rem;
}
.section-title {
	margin-top: 3rem;
	margin-bottom: 1rem;
}
.step-title {
	margin-top: 2rem;
	margin-bottom: 1rem;
}
.version {
	display: inline-block;
	border-radius: 4px;
	border: 1px solid #f46c0e;
	padding: 0 8px;
	color: #f46c0e;
}
[data-balloon][data-balloon-pos='down']:before {
	display: none;
}
[data-balloon][data-balloon-pos='down']:after {
	border-radius: 1.5rem;
}
[data-balloon][data-balloon-pos='down']:hover:after, [data-balloon][data-balloon-pos='down'][data-balloon-visible]:after {
	-webkit-transform: translate(-50%, 25%);
	-moz-transform: translate(-50%, 25%);
	-ms-transform: translate(-50%, 25%);
	transform: translate(-50%, 25%);
	opacity: 0.95;
}
.group {
	padding: 0 0 3rem 0;
}
.description {
	font-weight: 300;
}
.toast {
	opacity: 0;
	-webkit-transition: all .15s ease-in-out;
	-moz-transition: all .15s ease-in-out;
	-ms-transition: all .15s ease-in-out;
	-o-transition: all .15s ease-in-out;
	transition: all .15s ease-in-out;
}
.fa {
	padding-right: 7px;
	font-size: 1.5rem;
}
a.button {
	width: 200px;
	height: 50px;
	line-height: 2.2rem;
	font-size: 1.25rem;
	font-weight: 300;
	border-radius: 4px;
}
a.button-outline {
	display: inline-block;
	width: 200px;
	height: 50px;
	text-decoration: none;
	font-size: 1.25rem;
	font-weight: 300;
	border-radius: 4px;
	border: 1px solid #202020;
	color: #202020;
	background-color: transparent;
	line-height: 2.2rem;
	padding: 6px 12px;
}
a.button-outline:visited {
	color: #202020;
}
a.button-outline:hover, a.button-outline:focus {
	background-color: #202020;
	color: #ffffff;
	border-color: #fff;
	opacity: 1;
}
.toast.small {
	border-radius: 1.5rem;
	font-size: 1rem;
}
.demo-icon:hover {
	background: #2C3E50;
	background: -webkit-linear-gradient(to top, #ffa751, #ffe259);
	background: linear-gradient(to top, #ffa751, #ffe259);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	-webkit-transition: all 150ms ease-in;
	-webkit-transform: scale(1.25);
	-ms-transition: all 150ms ease-in;
	-ms-transform: scale(1.25);
	-moz-transition: all 150ms ease-in;
	-moz-transform: scale(1.25);
	transition: all 150ms ease-in;
	transform: scale(1.25);
}
.demo-icon {
	font-size: 4.75rem;
	margin: 1.75rem;
	display: inline-block;
	position: relative;
	-webkit-transition: all 150ms ease-in;
	-webkit-transform: scale(1);
	-ms-transition: all 150ms ease-in;
	-ms-transform: scale(1);
	-moz-transition: all 150ms ease-in;
	-moz-transform: scale(1);
	transition: all 150ms ease-in;
	transform: scale(1);
}


text:
package com.valtech.source.dependometer.app.core.elements;

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

/**
 * @author Dietmar Menges (dietmar.menges@valtech.de)
 */
public final class ParsedCompilationUnit extends CompilationUnit
{
   private static List<ParsedCompilationUnit> s_ParsedCompilationUnits = new ArrayList<ParsedCompilationUnit>();

   static int getNumberOfParsedCompilationUnits()
   {
      return s_ParsedCompilationUnits.size();
   }

   public static ParsedCompilationUnit[] getParsedCompilationUnits()
   {
      return s_ParsedCompilationUnits.toArray(new ParsedCompilationUnit[0]);
   }

   public ParsedCompilationUnit(String fullyQualifiedName, String packageName)
   {
      super(fullyQualifiedName, packageName);
      assert !s_ParsedCompilationUnits.contains(this);
      s_ParsedCompilationUnits.add(this);
   }

   public static void reset()
   {
      s_ParsedCompilationUnits.clear();
   }
}


text:
import Ember from 'ember';
import layout from '../templates/components/__componentname__';

export default Ember.Component.extend({
    layout: layout,
});


text:
<component name="libraryTable">
  <library name="support-core-utils-24.2.0">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
//========================================================================
//Copyright 2007-2010 David Yu dyuproject@gmail.com
//------------------------------------------------------------------------
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//http://www.apache.org/licenses/LICENSE-2.0
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//========================================================================

package io.protostuff.me;

import java.io.IOException;

/**
 * A schema (helper class) that wraps another schema and allows its subclasses to override certain methods for more
 * customization.
 *
 * @author David Yu
 * @created May 28, 2010
 */
public abstract class CustomSchema/* <T> */implements Schema/* <T> */
{

    protected final Schema/* <T> */schema;

    public CustomSchema(Schema/* <T> */schema)
    {
        this.schema = schema;
    }

    public String getFieldName(int number)
    {
        return schema.getFieldName(number);
    }

    public int getFieldNumber(String name)
    {
        return schema.getFieldNumber(name);
    }

    public boolean isInitialized(Object message)
    {
        return schema.isInitialized(message);
    }

    public void mergeFrom(Input input, Object message) throws IOException
    {
        schema.mergeFrom(input, message);
    }

    public String messageFullName()
    {
        return schema.messageFullName();
    }

    public String messageName()
    {
        return schema.messageName();
    }

    public Object newMessage()
    {
        return schema.newMessage();
    }

    public Class/* <? super T> */typeClass()
    {
        return schema.typeClass();
    }

    public void writeTo(Output output, Object message) throws IOException
    {
        schema.writeTo(output, message);
    }

}


text:
var http = require('http'),
        https = require('https'),
        fs = require('fs'),
        cheerio = require('cheerio'),
        util = require('util'),
        url = require('url'),
        path = require("path")
        ;

var MGR = {
	_res:0,
	_numReq:0,
	_onCompletion:null,
	init:function( numReq, onCompletion ) {
		this._numReq = numReq;
		this._onCompletion = onCompletion;
	},
	done:function(){
		if( ++this._res === this._numReq && this._onCompletion )
			this._onCompletion();
	}

};

var download = function(theUrl, dest, callback) {
    var file = fs.createWriteStream(dest);

    var parts = url.parse(theUrl);

    var onResponse = function(res) {
        // Detect a redirect
        if (res.statusCode > 300 && res.statusCode < 400 && res.headers.location) {
        	console.log( "redirect to [%s] detected! ", res.headers.location);
            // The location for some (most) redirects will only contain the path,  not the hostname;
            // detect this and add the host to the path.
            if (url.parse(res.headers.location).hostname) {
                  // Hostname included; make request to res.headers.location

            } else {
                  // Hostname not included; get host from requested URL (url.parse()) and prepend to location.
            }

            console.log( "redirect is not supported yet. Url will be skipped!");
            return;
        }
        res.pipe(file);
        file.on('finish', function() {
            file.close();
            if (callback)
                callback(dest);
            console.log("%s downloaded!", dest);
            MGR.done();
        });
    };

    //console.log( "get url [%s] protocol [%s]", parts.href, parts.protocol );

    var request = (parts.protocol === 'https:') ?
            https.get(theUrl, onResponse) :
            http.get(theUrl, onResponse);
};

/**
 * @param {string} baseUrl   url from start download
 * @param {string} targetDir output directory
 */
function downloadUrl(baseUrl, targetDir, callback ) {
	var javascripts = [];
	var links = [];

    var parts = url.parse(baseUrl, false, false);

    var theUrl = baseUrl;

    if (parts.hostname === "jsfiddle.net") {
        console.log("jsfiddle snippet detected!");

        if (parts.pathname.indexOf("show") === -1)
            theUrl = util.format((parts.pathname.slice(-1) === '/') ?
                    "%sshow/" :
                    "%s/show/", baseUrl);
    }

    fs.mkdir(targetDir, function() {

        download(theUrl,
                util.format("%s/%s", targetDir, "index.original.html"),
                function(fileName) {

                    console.log("read file [%s]", fileName);

                    fs.readFile(fileName, function(error, data) {

                        if (error)
                            throw error;

                        var html = data.toString("utf8");

                        $ = cheerio.load(html);

                        //console.log( $.html());

                        $("script").each(function(i) {

                            var src = this.attr("src");
                            if (src) {

                                var srcUrl = url.resolve(baseUrl, src);
                                var urlParts = url.parse(srcUrl);

                                //console.log("script src=%s", urlParts.href);

                                var elems = urlParts.pathname.split("/");

                                var fileName = elems.slice(-2);

                                this.attr("src", path.join(fileName[0], fileName[1]) );

                                //console.dir( urlParts );

                                javascripts.push( {url:srcUrl, file:{path:fileName[0], name:fileName[1]} });

                            }
                        });

                        $("link").each(function(i) {

                            var src = this.attr("href");
                            if (src) {

                                var srcUrl = url.resolve(baseUrl, src);
                                var urlParts = url.parse(srcUrl);

                                //console.log("link href=%s", urlParts.href);

                                var elems = urlParts.pathname.split("/");

                                var fileName = elems.slice(-2);
                                this.attr("href", path.join(fileName[0], fileName[1]) );

                                //console.dir( urlParts );
                                links.push( {url:srcUrl, file:{path:fileName[0], name:fileName[1]} });

                            }
                        });

                        $("img").each(function(i) {

                            var src = this.attr("src");
                            if (src) {

                                var srcUrl = url.resolve(baseUrl, src);
                                var urlParts = url.parse(srcUrl);

                                //console.log("link href=%s", urlParts.href);

                                var elems = urlParts.pathname.split("/");

                                var fileName = elems.slice(-2);
                                this.attr("src", path.join(fileName[0], fileName[1]) );

                                //console.dir( urlParts );
                                links.push( {url:srcUrl, file:{path:fileName[0], name:fileName[1]} });

                            }
                        });

                        fs.writeFile( path.join(targetDir, "index.html"), $.html(), function(err) {
                            if (err)
                                throw err;

                            //console.log( $.html() );
                            MGR.init( javascripts.length + links.length + 1, callback );

                           javascripts.forEach( function(info){
                                fs.mkdir( path.join(targetDir, info.file.path), function() {
                                    download( info.url, path.join( targetDir, info.file.path, info.file.name) );
                                });
                            });

                            links.forEach( function(info) {
                                fs.mkdir(path.join(targetDir,info.file.path ), function() {
                                    download(info.url, path.join( targetDir, info.file.path, info.file.name));
                                });
                            });

                        });
                    });
                });

    });

}

module.exports = downloadUrl;


text:
  Allières est
       un village
       géographiquement positionné dans le département de l'Ariège en Midi-Pyrénées. Elle totalisait 66 habitants en 2008.

Si vous pensez emmenager à Allières, vous pourrez aisément trouver une maison à vendre.

À proximité de Allières sont localisées les villes de
Gabre localisée à 5 km, 92 habitants,
Clermont localisée à 5 km, 82 habitants,
Larbont à 5 km, 41 habitants,
La Bastide-de-Sérou localisée à 5 km, 949 habitants,
Le Mas-d'Azil à 4 km, 1 219 habitants,
Montseron située à 3 km, 78 habitants,
 entre autres. De plus, Allières est située à seulement 21 km de Pamiers.

La ville propose quelques  aménagements, elle propose entre autres une boucle de randonnée.

Le parc de logements, à Allières, était réparti en 2011 en cinq appartements et 38 maisons soit
 un marché plutôt équilibré.


text:
package test

import (
	"github.com/stretchr/testify/mock"
)

// System Handler
type MockSystemHandler struct {
	mock.Mock
}

func (sh *MockSystemHandler) WriteFile(filePath string, data []byte) error {
	args := sh.Called(filePath, data)
	return args.Error(0)
}

func (sh *MockSystemHandler) ReadFile(filePath string) ([]byte, error) {
	args := sh.Called(filePath)

	if args.Get(0) == nil {
		return nil, args.Error(1)
	}
	return args.Get(0).([]byte), args.Error(1)
}

func (sh *MockSystemHandler) MoveFile(source, destination string) error {
	args := sh.Called(source, destination)
	return args.Error(0)
}

func (sh *MockSystemHandler) Remove(path string) error {
	args := sh.Called(path)
	return args.Error(0)
}

func (sh *MockSystemHandler) Executable() (string, error) {
	args := sh.Called()
	return args.Get(0).(string), args.Error(1)
}

func (sh *MockSystemHandler) Getenv(key string) string {
	args := sh.Called(key)
	return args.Get(0).(string)
}


text:
package cloudflare

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestAccessKeysConfig(t *testing.T) {
	setup()
	defer teardown()

	handler := func(w http.ResponseWriter, r *http.Request) {
		assert.Equal(t, http.MethodGet, r.Method, "Expected method 'GET', got %s", r.Method)
		w.Header().Set("content-type", "application/json")
		fmt.Fprintf(w, `{
			"success": true,
			"errors": [],
			"messages": [],
			"result": {
				"key_rotation_interval_days": 42,
				"last_key_rotation_at": "2014-01-01T05:20:00.12345Z",
				"days_until_next_rotation": 3
			}
		}`)
	}

	wantLastRotationAt, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00.12345Z")
	want := AccessKeysConfig{
		KeyRotationIntervalDays: 42,
		LastKeyRotationAt:       wantLastRotationAt,
		DaysUntilNextRotation:   3,
	}

	mux.HandleFunc("/accounts/"+testAccountID+"/access/keys", handler)

	actual, err := client.AccessKeysConfig(context.Background(), testAccountID)

	if assert.NoError(t, err) {
		assert.Equal(t, want, actual)
	}
}

func TestUpdateAccessKeysConfig(t *testing.T) {
	setup()
	defer teardown()

	wantRequest := AccessKeysConfigUpdateRequest{
		KeyRotationIntervalDays: 33,
	}

	handler := func(w http.ResponseWriter, r *http.Request) {
		var gotRequest AccessKeysConfigUpdateRequest
		assert.NoError(t, json.NewDecoder(r.Body).Decode(&gotRequest))
		assert.Equal(t, wantRequest, gotRequest)

		assert.Equal(t, http.MethodPut, r.Method, "Expected method 'PUT', got %s", r.Method)
		w.Header().Set("content-type", "application/json")
		fmt.Fprintf(w, `{
			"success": true,
			"errors": [],
			"messages": [],
			"result": {
				"key_rotation_interval_days": 42,
				"last_key_rotation_at": "2014-01-01T05:20:00.12345Z",
				"days_until_next_rotation": 3
			}
		}`)
	}

	wantLastRotationAt, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00.12345Z")
	want := AccessKeysConfig{
		KeyRotationIntervalDays: 42,
		LastKeyRotationAt:       wantLastRotationAt,
		DaysUntilNextRotation:   3,
	}
	mux.HandleFunc("/accounts/"+testAccountID+"/access/keys", handler)

	actual, err := client.UpdateAccessKeysConfig(context.Background(), testAccountID, wantRequest)

	if assert.NoError(t, err) {
		assert.Equal(t, want, actual)
	}
}

func TestRotateAccessKeys(t *testing.T) {
	setup()
	defer teardown()

	handler := func(w http.ResponseWriter, r *http.Request) {
		assert.Equal(t, http.MethodPost, r.Method, "Expected method 'POST', got %s", r.Method)
		w.Header().Set("content-type", "application/json")
		fmt.Fprintf(w, `{
			"success": true,
			"errors": [],
			"messages": [],
			"result": {
				"key_rotation_interval_days": 42,
				"last_key_rotation_at": "2014-01-01T05:20:00.12345Z",
				"days_until_next_rotation": 3
			}
		}`)
	}

	wantLastRotationAt, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00.12345Z")
	want := AccessKeysConfig{
		KeyRotationIntervalDays: 42,
		LastKeyRotationAt:       wantLastRotationAt,
		DaysUntilNextRotation:   3,
	}

	mux.HandleFunc("/accounts/"+testAccountID+"/access/keys/rotate", handler)

	actual, err := client.RotateAccessKeys(context.Background(), testAccountID)

	if assert.NoError(t, err) {
		assert.Equal(t, want, actual)
	}
}


text:
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.presidentio.testdatagenerator.model;

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

public class Schema {

    private List<Template> templates = new ArrayList<>();

    private List<String> root = new ArrayList<>();

    private List<Variable> variables = new ArrayList<>();

    private Output output;

    public List<Template> getTemplates() {
        return templates;
    }

    public void setTemplates(List<Template> templates) {
        this.templates = templates;
    }

    public List<String> getRoot() {
        return root;
    }

    public void setRoot(List<String> root) {
        this.root = root;
    }

    public List<Variable> getVariables() {
        return variables;
    }

    public void setVariables(List<Variable> variables) {
        this.variables = variables;
    }

    public Output getOutput() {
        return output;
    }

    public void setOutput(Output output) {
        this.output = output;
    }
}


text:
ACCEPTED

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

#### Published in
in Wiggers, Prim. fl. holsat. (Kiliae) 90 (1780)

#### Original name
Lichen rangiferinus L.

### Remarks
null


text:
package com.bt.pi.app.management;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import com.bt.pi.core.application.activation.SuperNodeApplicationCheckPoints;
import com.bt.pi.core.continuation.UpdateResolvingPiContinuation;
import com.bt.pi.core.id.PId;

@Component
public class SuperNodeSeeder extends SeederBase {
    private static final Log LOG = LogFactory.getLog(SuperNodeSeeder.class);

    public SuperNodeSeeder() {
    }

    public void configureNumberOfSuperNodes(final String applicationName, final int numberOfSuperNodes, final int offset) {

        final SuperNodeApplicationCheckPoints superNodeApplicationCheckPoints = new SuperNodeApplicationCheckPoints();
        PId id = getKoalaIdFactory().buildPId(superNodeApplicationCheckPoints.getUrl());

        getDhtClientFactory().createBlockingWriter().update(id, superNodeApplicationCheckPoints, new UpdateResolvingPiContinuation<SuperNodeApplicationCheckPoints>() {

            @Override
            public SuperNodeApplicationCheckPoints update(SuperNodeApplicationCheckPoints existingEntity, SuperNodeApplicationCheckPoints requestedEntity) {

                if (existingEntity == null) {
                    requestedEntity.setSuperNodeCheckPointsForApplication(applicationName, numberOfSuperNodes, offset);
                    return requestedEntity;
                }

                existingEntity.setSuperNodeCheckPointsForApplication(applicationName, numberOfSuperNodes, offset);
                return existingEntity;
            }

            @Override
            public void handleResult(SuperNodeApplicationCheckPoints result) {
                LOG.info(String.format("Super node record updated: %s", result));
            }
        });
    }
}


text:
using System;
using System.Collections.Generic;
using Microsoft.PythonTools.InteractiveWindow;

namespace Microsoft.PythonTools.Repl {
    interface IInteractiveEvaluatorProvider {
        IInteractiveEvaluator GetEvaluator(string evaluatorId);

        /// <summary>
        /// Returns a list of display name - evaluatorId pairs.
        /// </summary>
        IEnumerable<KeyValuePair<string, string>> GetEvaluators();

        /// <summary>
        /// The result of <see cref="GetEvaluators"/> has changed.
        /// </summary>
        event EventHandler EvaluatorsChanged;
    }
}


text:
A schema is a programmatically parsable description of a specificiation. It support independant validation without being restricted to any programming languages.

This directory stores the schemas for validating RESTful OA. The schemas are independant from language/format.

# json-schema.org
This is the first effort to define a parsable despcrition of RESTful OA specification.

## Files
json-schema-basic.json - The JSON Schema supports the core spec of OA.

json-schema.json - The Standard Schema is under development and will support the full spec of OA.

## Validation
Json-schema.org community has developed a number of tool to either validate a json-schema instance or validate a file against the instance [1]. They are available in different languages.

## Test examples
The following examples could be tested on [2], an online validator.

Example 1:

Correct:

	{
	    "target": "http://example.org",
	    "serializedAt": "2015-03-08T09:55:51",
	    "annotatedAt": "2015-03-08T09:55:51",
	    "@id": "54fc1ca77580581a828e0fa3"
	}

Wrong:

	{
	    "body": "http://example.org",
	    "serializedAt": "2015-03-08T09:55:51",
	    "annotatedAt": "2015-03-08T09:55:51",
	    "@id": "54fc1ca77580581a828e0fa3"
	}

A "target" is mandatory according OA specs.

Example 2:

Correct:

	{
	    "target": "http://example.org",
	    "body": {"@id": "http://xmlns.com/foaf/0.1/Person"},
	    "serializedAt": "2015-03-08T09:55:51",
	    "annotatedAt": "2015-03-08T09:55:51",
	    "@id": "54fc1ca77580581a828e0fa3"
	}

Wrong:

	{
	    "target": "http://example.org",
	    "body": 12345,
	    "serializedAt": "2015-03-08T09:55:51",
	    "annotatedAt": "2015-03-08T09:55:51",
	    "@id": "54fc1ca77580581a828e0fa3"
	}

A "body" has to be a URI or following Web Annotation WG context [3].

Example 3:

Correct:

	{
	    "target": "http://example.org",
	    "serializedAt": "2015-03-08T09:55:51",
	    "annotatedAt": "2015-03-08T09:55:51",
	    "@id": "54fc1ca77580581a828e0fa3"
	}

Wrong:

	{
	    "target": "http://example.org",
	    "serializedAt": "3 Aug 2015, 09:55:51",
	    "annotatedAt": "3 Aug 2015, 09:55:51",
	    "@id": "54fc1ca77580581a828e0fa3"
	}

The above example is because that an OA timestamp must be expressed in xsd:dateTime.

# References
[1] http://json-schema.org/implementations.html

[2] http://json-schema-validator.herokuapp.com/index.jsp

[3] http://www.w3.org/TR/2014/WD-annotation-model-20141211/#json-ld-context


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>com.github.rvesse.airline.parser.aliases (Airline - Library 2.1.1-SNAPSHOT API)</title>
<meta name="date" content="2016-01-19">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

com.github.rvesse.airline.parser.aliases

Classes

AliasArgumentsParser

AliasResolver

UserAliasesSource


text:
//
//  UIControlDefine.h
//  RACAPI
//
//  Created by 刘松洪 on 2016/11/25.
//  Copyright © 2016年 刘松洪. All rights reserved.
//

#ifndef UIControlDefine_h
#define UIControlDefine_h

#import "UITextField+textfieldDidChange.h"
#import "UIButton+BtnClick.h"
#endif /* UIControlDefine_h */


text:
When making changes to JavaScript, CSS, or HTML which could change the functionality or layout of a page, it's important to add corresponding [Cypress](https://docs.cypress.io) integration tests.

To learn how to write Cypress tests, or 'specs', please see Cypress' official [documentation](https://docs.cypress.io/guides/getting-started/writing-your-first-test.html).

## Where to add a test

- Cypress tests are in the `./cypress` directory.

- Cypress tests for a curriculum module are in the corresponding curriculum directory, i.e. `cypress/integration/learn/responsive-web-design/basic-css/index.js`.

## How to run tests

> [!NOTE]
> If using GitPod, please see [Cypress-GitPod Setup](/how-to-add-cypress-tests#cypress-gitpod-setup)

### 1. Ensure that MongoDB and client applications are running

- [Start MongoDB and seed the database](/how-to-setup-freecodecamp-locally#step-3-start-mongodb-and-seed-the-database)

- [Start the freeCodeCamp client application and API server](/how-to-setup-freecodecamp-locally#step-4-start-the-freecodecamp-client-application-and-api-server)

### 2. Run the cypress tests

To run tests against production builds, replace `dev` with `prd` below.

- To run all tests in the `./cypress` directory:

  ```console
  npm run cypress:dev:run
  ```

- To run a single test:

  ```console
  npm run cypress:dev:run -- --spec=cypress/pathToYourSpec/youSpecFileName.js
  ```

- To create a development build, start the development server, and run all existing cypress end-to-end tests:

  ```console
  npm run e2e:dev:run
  ```

## Cypress-GitPod Setup

### 1. Ensure Development Environment is Running

If starting the GitPod environment did not automatically develop the environment:

- Start the database

```console
mongod
```

- Seed the database

```console
npm run seed
```

- Develop the server and client

```console
npm run develop
```

### 2. Install Cypress Build Tools

```console
npm run cypress:install-build-tools
```

- When prompted in the terminal, select your keyboard layout by language/area

Now, [Cypress can be run](/how-to-add-cypress-tests#_2-run-the-cypress-tests)


text:
project = 'Tabs Examples'
version = ''
release = '1.1.7'
copyright = '2017, djungelorm'

master_doc = 'index'
source_suffix = '.rst'
extensions = ['sphinx_tabs.tabs']

pygments_style = 'sphinx'

import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]


text:
import React, { Component } from 'react'
import { connect } from 'react-redux'
import GoogleMap from '../components/google-map'
import SparklineChart from '../components/sparkline-chart'

class WeatherList extends Component {
	renderWeather(cityData) {
		const name = cityData.city.name
		const temps = cityData.list.map(weather => weather.main.temp).map(temperature => temperature - 273)
		const pressures = cityData.list.map(weather => weather.main.pressure)
		const humidities = cityData.list.map(weather => weather.main.humidity)
		const { lat, lon } = cityData.city.coord

		return (

					<GoogleMap lat={lat} lon={lon} zoom={8} />

					<SparklineChart data={temps} color="yellow" units="℃" />

					<SparklineChart data={pressures} color="orange" units=" hPa" />

					<SparklineChart data={humidities} color="blue" units="%" />

		)
	}

    render() {
        return(

                        City
                        Temperature (℃)
                        Pressure (hPa)
                        Humidity (%)

					{this.props.weather.map(this.renderWeather)}

        )
    }
}

function mapStateToProps({ weather }) {
	return { weather }
}

export default connect(mapStateToProps)(WeatherList)


text:
package sbt.android.mill

import sbt._
import sbt.Keys._
import sbt.android.mill.MillKeys._

object MillEclipse extends Mill {
  override def go = MillClassic.go ++ inConfig(millConf)(Seq(
    aaptApkName := "resources.ap_",
    aaptApkPath <<= (baseDirectory, aaptApkName)(_ / "bin" / _),
    dxProjectDexPath <<= (baseDirectory, dxProjectDexName)(_ / "bin" / _),
    mainAssetsPath <<= (baseDirectory, assetsDirectoryName)(_ / _),
    mainResPath <<= (baseDirectory, resDirectoryName) map (_ / _),
    managedJavaPath <<= (baseDirectory)(_ / "gen"),
    manifestPath <<= (baseDirectory, manifestName) map ((base, name) => Seq(base / name)),
    ndkJNIDirectoryPath <<= (baseDirectory, ndkJNIDirectoryName)(_ / "src" / _),
    nativeLibrariesPath <<= (baseDirectory)(_ / "src" / "libs"),
    packageApkName <<= (name) map ((a) => String.format("%s.apk", a)),
    packageApkPath <<= (baseDirectory, packageApkName) map (_ / "bin" / _),
    compileStageCore <<= eclipseSyncTask))
  def eclipseSyncTask =
    (compileStageCore in millConf, classDirectory in Compile, baseDirectory, streams) map {
      (compileStageCore, originalClassDirectory, baseDirectory, streams) =>
        MillStage.task(streams.log, Mill.tag, "eclipse-sync") {
          val eclipseClassDirectory = baseDirectory / "bin" / "classes"
          streams.log.debug("update " + originalClassDirectory + " -> " + eclipseClassDirectory)
          sbt.IO.copyDirectory(originalClassDirectory, eclipseClassDirectory, true)
        }
    }
}


text:
namespace miniMAT {
    namespace ast {
        struct CallExpr : public Expression
        {
            CallExpr(std::shared_ptr<Reference> functionref,
                     std::shared_ptr<ExprList> arglist);

            std::string ClassName() const;

            void VisitDisplay(const std::string& prefix) const;
            ast::Matrix VisitEvaluate(std::shared_ptr<std::map<std::string, ast::Matrix>> vars);
            void VisitCheck(std::shared_ptr<std::map<std::string, ast::Matrix>> vars,
                            std::shared_ptr<reporter::ErrorReporter> reporter) const;

            void PrintResult(std::shared_ptr<std::map<std::string, ast::Matrix>> vars,
                             ast::Matrix ans,
                             bool suppressed) const;

            const std::shared_ptr<Reference>& GetRefFromRefExpr() const;
            const std::shared_ptr<Literal>& GetLiteralFromLiteralExpr() const;

            std::shared_ptr<Reference> functionref;
            std::shared_ptr<ExprList>  arglist;
        };
    }
}

#endif


text:
package pe.com.equifax.insurance.logic.business.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import pe.com.equifax.insurance.bean.Tipo;
import pe.com.equifax.insurance.logic.business.TipoService;
import pe.com.equifax.insurance.model.dao.TipoDAO;
@Service
public class TipoServiceImpl implements TipoService {
//	private final Logger log = Logger.getLogger(getClass());
//	private final Log log = LogFactory.getLog(getClass());

	@Autowired
	TipoDAO tipoDAO;

	public List<Tipo> buscarTipoXCodTipo(Integer codTipo) throws Exception {
		List<Tipo>  lTipo = null;
			lTipo = tipoDAO.buscarTipoXCodTipo(codTipo);
		return lTipo;
	}

	public List<Tipo> buscarTipoXCodSubTipo(Integer codSubTipo)throws Exception {
		List<Tipo>  lTipo = null;
			lTipo = tipoDAO.buscarTipoXCodSubTipo(codSubTipo);
		return lTipo;
	}

	public List<Tipo> buscarTipoXCodSubTipoClave(Integer codSubTipo, String clave) throws Exception{
		List<Tipo>  lTipo = null;
			lTipo = tipoDAO.buscarTipoXCodSubTipoClave(codSubTipo, clave);
		return lTipo;
	}

}


text:
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ReactiveFormsModule} from '@angular/forms';
import {SharedModule} from '../../SharedModule';
import {ChangeEpisodeDialogComponent} from './ChangeEpisodeDialogComponent';
import {SubVisitCardModule} from '../../components/subvisit-card/SubVisitCardModule';

@NgModule({
  imports: [
    CommonModule,
    ReactiveFormsModule,
    SharedModule,
    SubVisitCardModule
  ],
  declarations: [
    ChangeEpisodeDialogComponent
  ],
  exports: [
    ChangeEpisodeDialogComponent
  ],
  entryComponents: [
    ChangeEpisodeDialogComponent
  ]
})
export class ChangeEpisodeDialogModule {

}


text:
facter_puppet_version = Facter.value(:puppetversion)
facter_is_pe = Facter.value(:is_pe)

if facter_is_pe
  facter_puppet_version = facter_puppet_version.to_s.split(' ')[0]
end

if (Puppet::Util::Package.versioncmp(facter_puppet_version, '3.6') >= 0)
  pkg = Puppet::Type.type(:package).new(:name => 'python-pip', :allow_virtual => 'false')
else
  pkg = Puppet::Type.type(:package).new(:name => 'python-pip')
end

Facter.add("pip_version") do
  has_weight 100
  setcode do
    if Facter::Util::Resolution.which('pip')
      Facter::Util::Resolution.exec('pip --version 2>&1').match(/^pip (\d+\.\d+\.?\d*).*$/)[1]
    end
  end
end

Facter.add("pip_version") do
  has_weight 50
  setcode do
    unless [:absent,:purged].include?(pkg.retrieve[pkg.property(:ensure)])
      pkg.retrieve[pkg.property(:ensure)]
    end
  end
end


text:
<?php

/**
 * User: Alex Gusev <flancer64@gmail.com>
 */

namespace dBEAR\Schema\Domain;

use dBEAR\Schema\Domain\Entity;

/**
 * @Entity
 * @Table(name="_b")
 */
class Base
{
    /** TODO: move to XML package */
    const XML_ENTITIES = 'entities';
    const XML_VERSION  = 'version';
    /** @var \dBEAR\Schema\Domain\Entity[] */
    private $entities = array();
    /** @Id @Column(type="integer") */
    private $version;
    /** @Column(type="text") */
    private $xmlSchema;
    /** @Column(type="text") */
    private $xmlVersions;

    /**
     * @return array
     */
    public function getEntities()
    {
        return $this->entities;
    }

    /**
     * @param array $entities
     */
    public function setEntities($entities)
    {
        $this->entities = $entities;
    }

    /**
     * @param $alias
     * @return Entity
     */
    public function getEntity($alias)
    {
        $result = isset($this->entities[$alias]) ? $this->entities[$alias] : null;
        return $result;
    }

    /**
     * @return mixed
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * @param mixed $version
     */
    public function setVersion($version)
    {
        $this->version = $version;
    }

    /**
     * @return mixed
     */
    public function getXmlSchema()
    {
        return $this->xmlSchema;
    }

    /**
     * @param mixed $schema
     */
    public function setXmlSchema($schema)
    {
        $this->xmlSchema = $schema;
    }

    /**
     * @return mixed
     */
    public function getXmlVersions()
    {
        return $this->xmlVersions;
    }

    /**
     * @param mixed $xmlVersions
     */
    public function setXmlVersions($xmlVersions)
    {
        $this->xmlVersions = $xmlVersions;
    }
}


text: export * from './statisticsView.component';


text:
---
uid: SolidEdgeAssembly.ItemNumbers.Regenerate
summary:
remarks:
---


text:
/*****************************************************************
 NSDictionary+M3Extensions.m
 M3Foundation

 Created by Martin Pilkington on 17/01/2012.

 Please read the LICENCE.txt for licensing information
*****************************************************************/

#import "NSDictionary+M3Extensions.h"

@implementation NSDictionary (M3Extensions)

- (NSDictionary *)m3_dictionaryBySettingObject:(id)aObject forKey:(id<NSCopying>)aKey {
	NSMutableDictionary *newDictionary = [self mutableCopy];
	newDictionary[aKey] = aObject;
	return [newDictionary copy];
}

@end


text:
// Type definitions for cli-cursor 2.1
// Project: https://github.com/sindresorhus/cli-cursor#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

/**
 * Show cursor.
 *
 * @param stream defaults to `process.stderr`
 */
export function show(stream?: NodeJS.WritableStream): void;

/**
 * Hide cursor.
 *
 * @param stream defaults to `process.stderr`
 */
export function hide(stream?: NodeJS.WritableStream): void;

/**
 * Toggle cursor visibility.
 *
 * @param force is useful to show or hide the cursor based on a boolean.
 * @param stream defaults to `process.stderr`
 */
export function toggle(force?: boolean, stream?: NodeJS.WritableStream): void;


text:
{% extends "base-layout.html" %}

{% block content %}
    This is the profile page
{% endblock %}


text:
title: "2020-07-15 - PNW Go - Virtual Talk Night"
draft: false
toc: false
location: "https://www.crowdcast.io/e/virtual-pnw-go-meetup--/"
---

## Agenda

Join Seattle Go Programmers and PDX Go for a virtual meetup! We will have 2 speakers presenting.

6:00 - 6:15 Audio/Video set up, welcome and introductions

6:15 - 6:45 Todd Kulesza - 2019 Go Developer Survey Results with Q&A

6:50 - 7:50 Bill Kennedy - Generics Draft Proposal Review

8:00 - 8:30 Additional questions and socializing in the #seattle or #portland Slack channels

## Recording

If you missed the meetup - the recording is available [here](https://www.crowdcast.io/e/virtual-pnw-go-meetup--/).


text:
namespace System.Xml.Schema {

    using System.Xml.Serialization;

    /// <include file='doc\XmlSchemaImport.uex' path='docs/doc[@for="XmlSchemaImport"]/*' />
    /// <devdoc>
    ///    <para>[To be supplied.]</para>
    /// </devdoc>
    public class XmlSchemaImport : XmlSchemaExternal {
        string ns;
        XmlSchemaAnnotation annotation;

		/// <include file='doc\XmlSchemaImport.uex' path='docs/doc[@for="XmlSchemaImport.XmlSchemaImport"]/*' />
        public XmlSchemaImport() {
            Compositor = Compositor.Import;
        }

        /// <include file='doc\XmlSchemaImport.uex' path='docs/doc[@for="XmlSchemaImport.Namespace"]/*' />
        [XmlAttribute("namespace", DataType="anyURI")]
        public string Namespace {
            get { return ns; }
            set { ns = value; }
        }

        /// <include file='doc\XmlSchemaImport.uex' path='docs/doc[@for="XmlSchemaImport.Annotation"]/*' />
        [XmlElement("annotation", typeof(XmlSchemaAnnotation))]
        public XmlSchemaAnnotation Annotation {
            get { return annotation; }
            set { annotation = value; }
        }

        internal override void AddAnnotation(XmlSchemaAnnotation annotation) {
            this.annotation = annotation;
        }
    }
}