text:
package org.apereo.cas.pm.web.flow.actions;

import org.apereo.cas.authentication.MessageDescriptor;
import org.apereo.cas.authentication.support.password.PasswordExpiringWarningMessageDescriptor;
import org.apereo.cas.web.flow.CasWebflowConstants;

import lombok.val;
import org.springframework.webflow.action.AbstractAction;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;

import java.util.Collection;
import java.util.LinkedHashSet;

/**
 * This is {@link HandlePasswordExpirationWarningMessagesAction}.
 *
 * @author Misagh Moayyed
 * @since 5.3.0
 */
public class HandlePasswordExpirationWarningMessagesAction extends AbstractAction {
    /**
     * Attribute indicating password expiration warnings are found.
     */
    public static final String ATTRIBUTE_NAME_EXPIRATION_WARNING_FOUND = "passwordExpirationWarningFound";

    @Override
    public Event doExecute(final RequestContext context) {
        val attributes = context.getCurrentEvent().getAttributes();
        val warnings = (Collection<MessageDescriptor>)
            attributes.get(CasWebflowConstants.ATTRIBUTE_ID_AUTHENTICATION_WARNINGS, Collection.class, new LinkedHashSet<>());
        val found = warnings
            .stream()
            .filter(PasswordExpiringWarningMessageDescriptor.class::isInstance)
            .findAny();
        context.getFlowScope().put(ATTRIBUTE_NAME_EXPIRATION_WARNING_FOUND, found.isPresent());
        return null;
    }
}


text:
<?php namespace TeamWorkPm\Response;

use \TeamWorkPm\Helper\Str;
use \stdClass;
use \SimpleXMLElement;
use \DOMDocument;

class XML extends Model
{
    /**
     * Parsea un string type xml
     *
     * @param string $data
     * @param type $headers
     * @return mixed [bool, int, TeamWorkPm\Response\XML]
     * @throws \TeamWorkPm\Exception
     */
    public function parse($data, array $headers)
    {
        libxml_use_internal_errors(true);
        $this->string = $data;
        $source = simplexml_load_string($data);
        $errors = $this->getXmlErrors($source);
        //echo "\n", $data, "\n";
        if ($source) {
            if ($headers['Status'] === 201 || $headers['Status'] === 200) {
                switch($headers['Method']) {
                    case 'UPLOAD':
                        if (!empty($source->ref)) {
                            return (string) $source->ref;
                        }
                        break;
                    case 'POST':
                        if (!empty($headers['id'])) {
                            return $headers['id'];
                        } else {
                            $property = 0;
                            $value = (int) $source->$property;
                            // this case the fileid
                            if ($value > 0) {
                                return $value;
                            }
                        }
                        break;
                     case 'PUT':
                     case 'DELETE':
                        return true;
                     default:
                        if (!empty($source->files->file)) {
                            $source = $source->files->file;
                            $isArray = true;
                        } elseif (!empty($source->notebooks->notebook)) {
                            $source = $source->notebooks->notebook;
                            $isArray = true;
                        }  elseif(!empty($source->project->links)) {
                            $source = $source->project->links;
                              $isArray = true;
                        } else {
                            $attrs = $source->attributes();
                            $isArray = !empty($attrs->type) &&
                                            (string) $attrs->type === 'array';
                        }
                        $this->headers = $headers;

                        $_this = self::toStdClass($source, $isArray);

                        foreach ($_this as $key=>$value) {
                            $this->$key = $value;
                        }
                        return $this;
                }
            } else {
                if (!empty($source->error)) {
                    foreach($source as $error) {
                        $errors .= $error ."\n";
                    }
                } else {
                    $property = 0;
                    $errors .= $source->$property;
                }
            }
        }
        throw new \TeamWorkPm\Exception([
            'Message'=> $errors,
            'Response'=> $data,
            'Headers'=> $headers
        ]);
    }

    /**
     * Devuelve un xml formateado
     *
     * @return string
     */
    protected function getContent()
    {
        $dom = new DOMDocument('1.0');
        $dom->loadXML($this->string);
        $dom->preserveWhiteSpace = false;
        $dom->formatOutput = true;

        return $dom->saveXML();
    }

    /**
     * Convierte un objecto SimpleXMLElement a stdClass
     *
     * @param SimpleXMLElement $source
     * @param bool $isArray
     * @return stdClass
     */
    private static function toStdClass(
        SimpleXMLElement $source,
        $isArray = false
    ) {
        $destination = $isArray ? [] : new stdClass();
        foreach($source as $key=>$value) {
            $key = Str::camel($key);
            $attrs = $value->attributes();
            if (!empty($attrs->type)) {
                $type = (string) $attrs->type;
                switch($type) {
                    case 'integer':
                        $destination->$key = (int) $value;
                        break;
                    case 'boolean':
                        $value = (string) $value;
                        $destination->$key = (bool) $value === 'true';
                        break;
                    case 'array':
                        if (is_array($destination)) {
                            $destination[$key] = self::toStdClass($value, true);
                        } else {
                            $destination->$key = self::toStdClass($value, true);
                        }
                        break;
                    default:
                        $destination->$key = (string) $value;
                        break;
                }
            } else {
                $children = $value->children();
                if (!empty($children)) {
                    if ($isArray) {
                        $i               = count($destination);
                        $destination[$i] = self::toStdClass($value);
                    } else {
                        $destination->$key = self::toStdClass($value);
                    }
                } else {
                    $destination->$key = (string) $value;
                }
            }
        }

        return $destination;
    }

    private function getXmlErrors($xml)
    {
        $errors = '';
        foreach (libxml_get_errors() as $error) {
            $errors .= $this->getXmlError($error, $xml) . "\n";
        }
        libxml_clear_errors();
        return $errors;
    }

    private function getXmlError($error, $xml)
    {
        $return  = $xml[$error->line - 1] . "\n";
        $return .= str_repeat('-', $error->column) . "^\n";

        switch ($error->level) {
            case LIBXML_ERR_WARNING:
                $return .= "Warning $error->code: ";
                break;
             case LIBXML_ERR_ERROR:
                $return .= "Error $error->code: ";
                break;
            case LIBXML_ERR_FATAL:
                $return .= "Fatal Error $error->code: ";
                break;
        }

        $return .= trim($error->message) .
                   "\n  Line: $error->line" .
                   "\n  Column: $error->column";

        if ($error->file) {
            $return .= "\n  File: $error->file";
        }

        return "$return\n\n--------------------------------------------\n\n";
    }

}

redpajama_set_name: RedPajamaGithub


text:
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.littleshoot</groupId>
  <artifactId>littleproxy</artifactId>
  <packaging>bundle</packaging>
  <version>0.5-SNAPSHOT</version>
  <name>LittleProxy</name>
  <description>
    LittleProxy is a high performance HTTP proxy written in Java and using the Netty networking framework.
  </description>
  <url>http://www.littleshoot.org/littleproxy</url>

  <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <organization>
    <name>LittleShoot</name>
    <url>http://www.littleshoot.org</url>
  </organization>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <mailingLists>
    <mailingList>
      <archive>http://groups.google.com/group/littleproxy</archive>
      <name>littleproxy</name>
      <post>littleproxy@googlegroups.com</post>
      <subscribe>http://groups.google.com/group/littleproxy</subscribe>
      <unsubscribe>littleproxy+unsubscribe@googlegroups.com</unsubscribe>
    </mailingList>
  </mailingLists>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/adamfisk/LittleProxy/issues</url>
  </issueManagement>

  <scm>
    <connection>scm:git:https://adamfisk@github.com/adamfisk/LittleProxy.git</connection>
    <developerConnection>scm:git:https://adamfisk@github.com/adamfisk/LittleProxy.git</developerConnection>
    <url>https://adamfisk@github.com/adamfisk/LittleProxy.git</url>
  </scm>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <inceptionYear>2009</inceptionYear>

  <dependencies>

    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.5</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.0.1</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.1</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>8.1.1.v20120215</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.9.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>2.25.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.16</version>
      <optional>true</optional>
    </dependency>

<!--
    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-core</artifactId>
      <version>2.2.0</version>
    </dependency>
-->

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.1.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty</artifactId>
      <version>3.5.5.Final</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.littleshoot</groupId>
      <artifactId>dnssec4j</artifactId>
      <version>0.1-SNAPSHOT</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.6.1</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.6.1</version>
    </dependency>

  </dependencies>

  <prerequisites>
    <maven>2.2.1</maven>
  </prerequisites>

  <build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh-external</artifactId>
        <version>1.0-beta-6</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>deploy</phase>
            <goals><goal>jar-no-fork</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>deploy</phase>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- explicitly define maven-deploy-plugin after other to force exec order -->
        <artifactId>maven-deploy-plugin</artifactId>
        <executions>
          <execution>
            <id>deploy</id>
            <phase>deploy</phase>
            <goals><goal>deploy</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
        <version>0.5</version>
        <configuration>
          <message>Building site for ${project.version}</message>
          <repositoryName>LittleProxy</repositoryName>
          <repositoryOwner>adamfisk</repositoryOwner>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>site</goal>
            </goals>
            <phase>site</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
              <version>2.2</version>
              <configuration>
                <dependencyDetailsEnabled>true</dependencyDetailsEnabled>
                <dependencyLocationsEnabled>true</dependencyLocationsEnabled>
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>2.7</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-report-plugin</artifactId>
              <version>2.6</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-checkstyle-plugin</artifactId>
              <version>2.6</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-changelog-plugin</artifactId>
              <version>2.2</version>
            </plugin>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>findbugs-maven-plugin</artifactId>
              <version>2.4.0</version>
              <configuration>
                <!-- Optional directory to put findbugs xml report -->
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jxr-plugin</artifactId>
              <version>2.3</version>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-pmd-plugin</artifactId>
              <version>2.7.1</version>
              <configuration>
                <linkXref>true</linkXref>
                <sourceEncoding>utf-8</sourceEncoding>
                <minimumTokens>100</minimumTokens>
                <targetJdk>1.5</targetJdk>
              </configuration>
            </plugin>
          </reportPlugins>
        </configuration>
      </plugin>

      <!-- Compiling with java 1.5 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
          <!-- The following force compilation with full warnings. -->
          <!--
            <fork>true</fork>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <compilerArguments><Xlint /></compilerArguments>
          -->
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2-beta-5</version>
        <executions>
          <execution>
            <id>latest-build</id>
            <phase>package</phase>
            <configuration>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>

              <archive>
                <manifest>
                  <mainClass>org.littleshoot.proxy.Launcher</mainClass>
                </manifest>
              </archive>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>2.2</version>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.6</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Export-Package>org.littleshoot.proxy</Export-Package>
          </instructions>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>2.3.1</version>
      </plugin>

      <!-- Standard maven site report -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.4</version>
      </plugin>

      <!-- Style report -->
      <!--  <plugin>   error - heap space problem
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>-->

      <!-- Report code metrics using JDepend. -->
      <!--  <plugin>  error - could not download
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jdepend-maven-plugin</artifactId>
        <version>2.0-beta-1-SNAPSHOT</version>
      </plugin>-->

      <!-- Tag Report -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <multipleLineComments>true</multipleLineComments>
           <tags>
            <tag>mudo</tag>
            <tag>todo</tag>
            <tag>idea</tag>
            <tag>MUDO</tag>
            <tag>TODO</tag>
            <tag>IDEA</tag>
            </tags>
        </configuration>
      </plugin>

      <!-- Unit Test Report -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>surefire-report-maven-plugin</artifactId>
        <version>2.0-beta-1</version>
      </plugin>

      <!-- Changes Report -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>changes-maven-plugin</artifactId>
        <version>2.0-beta-1</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>changes-report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <!-- SCM activity report -->
<!--
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>changelog-maven-plugin</artifactId>
        <reportSets>
          <reportSet>
            <id>dual-report</id>
            <configuration>
              <type>range</type>
              <range>30</range>
            </configuration>
            <reports>
              <report>changelog</report>
              <report>file-activity</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
-->

      <!-- Javadoc report -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.8.1</version>
        <configuration>
          <source>1.5</source>
        </configuration>
      </plugin>

      <!-- Source ref plugin -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jxr-maven-plugin</artifactId>
        <version>2.0-beta-1</version>
      </plugin>
    </plugins>
  </reporting>

  <developers>
    <developer>
      <id>afisk</id>
      <name>Adam fisk</name>
      <email>a@littleshoot.org</email>
      <organization>LittleShoot</organization>
      <organizationUrl>http://www.littleshoot.org/</organizationUrl>
      <roles><role>Developer</role></roles>
      <timezone>-5</timezone>
    </developer>
  </developers>

  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <repositories>
    <repository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
</project>


text:
@implementation ClassicGameHelpScene

- (id)init {
    self = [super init];
    if (self) {

		// load all resouce for the paticular scene
		[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"mainmenuhelp.plist"];

		// init all layers
        [self addChild:[ClassicGameHelpLayer node]];
    }
    return self;
}

@end


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.facebook.presto.tests.querystats;

import com.facebook.airlift.http.client.HttpStatus;
import com.facebook.airlift.http.client.Response;
import com.facebook.airlift.http.client.testing.TestingHttpClient;
import com.facebook.airlift.http.client.testing.TestingResponse;
import com.facebook.airlift.json.JsonObjectMapperProvider;
import com.facebook.presto.execution.QueryStats;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.io.Resources;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.Optional;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;

@Test(singleThreaded = true)
public class TestHttpQueryStatsClient
{
    private static final URI BASE_URL = URI.create("http://presto.host");
    private Response httpResponse;
    private HttpQueryStatsClient queryStatsClient;

    private static final String SINGLE_QUERY_INFO = resourceAsString("com/facebook/presto/tests/querystats/single_query_info_response.json");

    private static String resourceAsString(String resourcePath)
    {
        try {
            URL resourceUrl = Resources.getResource(resourcePath);
            return Resources.toString(resourceUrl, UTF_8);
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @BeforeMethod
    public void setUp()
    {
        ObjectMapper objectMapper = new JsonObjectMapperProvider().get();
        TestingHttpClient httpClient = new TestingHttpClient(httpRequest -> httpResponse);
        this.queryStatsClient = new HttpQueryStatsClient(httpClient, objectMapper, BASE_URL);
    }

    @Test
    public void testGetInfoForQuery()
    {
        mockHttpResponse(SINGLE_QUERY_INFO);
        Optional<QueryStats> infoForQuery = queryStatsClient.getQueryStats("20150505_160116_00005_sdzex");
        assertThat(infoForQuery).isPresent();
        assertThat(infoForQuery.get().getTotalCpuTime().getValue()).isEqualTo(1.19);
    }

    @Test
    public void testGetInfoForUnknownQuery()
    {
        mockErrorHttpResponse(HttpStatus.GONE);
        Optional<QueryStats> infoForQuery = queryStatsClient.getQueryStats("20150505_160116_00005_sdzex");
        assertThat(infoForQuery).isEmpty();
    }

    private void mockHttpResponse(String answerJson)
    {
        httpResponse = new TestingResponse(HttpStatus.OK, ImmutableListMultimap.of(), answerJson.getBytes());
    }

    private void mockErrorHttpResponse(HttpStatus statusCode)
    {
        httpResponse = new TestingResponse(statusCode, ImmutableListMultimap.of(), new byte[0]);
    }
}


text:
package org.eurekaJ.manager.util;

import static org.junit.Assert.*;

import org.eurekaj.api.datatypes.LiveStatistics;
import org.eurekaj.api.datatypes.basic.BasicLiveStatistics;
import org.eurekaj.manager.util.ChartUtil;
import org.jsflot.xydata.XYDataList;
import org.jsflot.xydata.XYDataSetCollection;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

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

/**
 * Created by IntelliJ IDEA.
 * User: joahaa
 * Date: 1/20/11
 * Time: 4:21 PM
 * To change this template use File | Settings | File Templates.
 */
public class ChartUtilTest {

    /*
{"label": "% Used", "data":

[[1295540055000,6], [1295540070000,8], [1295540085000,7],
[1295540100000,9], [1295540115000,11], [1295540130000,7],
[1295540145000,12], [1295540160000,8], [1295540175000,10],

[1295540190000,12], [1295540205000,11], [1295540220000,7],
[1295540235000,9], [1295540250000,11], [1295540265000,10],
[1295540280000,12], [1295540295000,8], [1295540310000,10],

[1295540325000,9], [1295540340000,11], [1295540355000,7],
[1295540370000,9], [1295540385000,9], [1295540400000,11],
[1295540415000,7], [1295540430000,9], [1295540445000,9],

[1295540460000,11], [1295540475000,7], [1295540490000,10],
[1295540505000,9], [1295540520000,10]]}
     */

    private List<LiveStatistics> liveStatisticsList;
    private Date dateFrom = new Date(1295540055000l);
    private Date dateTo = new Date(1295540520000l);

    @Before
    @Ignore
    public void setUp() {
        liveStatisticsList = new ArrayList<LiveStatistics>();

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540055000l / 15000, 6d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540070000l / 15000, 8d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540085000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540100000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540115000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540130000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540145000l / 15000, 12d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540160000l / 15000, 8d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540175000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540190000l / 15000, 12d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540205000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540220000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540235000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540250000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540265000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540280000l / 15000, 12d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540295000l / 15000, 8d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540310000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540325000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540340000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540355000l / 15000, 7d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540370000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540385000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540400000l / 15000, 11d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540415000l / 15000, 7d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540430000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540445000l / 15000, 9d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540460000l / 15000, 11d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540475000l / 15000, 7d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540490000l / 15000, 10d));

        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540505000l / 15000, 9d));
        liveStatisticsList.add(new BasicLiveStatistics("guipath", "ACCOUNT", 1295540520000l / 15000, 10d));
    }

    @Test
    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_no_holes_and_15_second_resolution() {
        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(liveStatisticsList, "name", dateFrom.getTime(), dateTo.getTime(), 15);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());
        assertEquals(32, xyDataList.size());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), new Double(1295540055000d), 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 6d);
        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540070000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540085000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540100000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540115000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540130000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540160000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540175000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540190000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(10).getX().doubleValue(), 1295540205000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(10).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(11).getX().doubleValue(), 1295540220000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(11).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(12).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(12).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(13).getX().doubleValue(), 1295540250000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(13).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(14).getX().doubleValue(), 1295540265000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(14).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(15).getX().doubleValue(), 1295540280000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(15).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(16).getX().doubleValue(), 1295540295000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(16).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(17).getX().doubleValue(), 1295540310000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(17).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(18).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(18).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(19).getX().doubleValue(), 1295540340000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(19).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(20).getX().doubleValue(), 1295540355000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(20).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(21).getX().doubleValue(), 1295540370000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(21).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(22).getX().doubleValue(), 1295540385000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(22).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(23).getX().doubleValue(), 1295540400000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(23).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(24).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(24).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(25).getX().doubleValue(), 1295540430000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(25).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(26).getX().doubleValue(), 1295540445000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(26).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(27).getX().doubleValue(), 1295540460000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(27).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(28).getX().doubleValue(), 1295540475000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(28).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(29).getX().doubleValue(), 1295540490000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(29).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(30).getX().doubleValue(), 1295540505000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(30).getY(), 9d);

        //The last tick is not included to account for lag between agent and server
        assertEquals(xyDataList.getDataPointList().get(31).getX().doubleValue(), 1295540520000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(31).getY(), 10d);

    }

    @Test
    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_no_holes_and_30_second_resolution() {
        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(liveStatisticsList, "name", dateFrom.getTime(), dateTo.getTime(), 30);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540085000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540115000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540175000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540205000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540265000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540295000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(10).getX().doubleValue(), 1295540355000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(10).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(11).getX().doubleValue(), 1295540385000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(11).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(12).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(12).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(13).getX().doubleValue(), 1295540445000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(13).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(14).getX().doubleValue(), 1295540475000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(14).getY(), 8d);

        //The last tick is not included to account for lag between agent and server
        //assertEquals(xyDataList.getDataPointList().get(15).getX().doubleValue(), 1295540505000d, 0.0d);
        //assertEquals(xyDataList.getDataPointList().get(15).getY(), 9d);
    }

    @Test
    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_no_holes_and_180_second_resolution() {
        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(liveStatisticsList, "name", dateFrom.getTime(), dateTo.getTime(), 180);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        //108 / 12 = 9
        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 9d);

        // 116 / 12 = 9
        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 9d);

        //The last tick is not included to account for lag between agent and server

    }

    @Test
    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_holes_and_15_second_resolution() {
        List<LiveStatistics> newStats = new ArrayList<LiveStatistics>();
        for (int i = 0; i < liveStatisticsList.size(); i += 2) {
            newStats.add(liveStatisticsList.get(i));
        }

        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(newStats, "name", dateFrom.getTime(), dateTo.getTime(), 15);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 6d);
        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540070000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540085000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540100000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540115000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540130000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540160000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540175000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540190000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(10).getX().doubleValue(), 1295540205000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(10).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(11).getX().doubleValue(), 1295540220000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(11).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(12).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(12).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(13).getX().doubleValue(), 1295540250000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(13).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(14).getX().doubleValue(), 1295540265000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(14).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(15).getX().doubleValue(), 1295540280000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(15).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(16).getX().doubleValue(), 1295540295000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(16).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(17).getX().doubleValue(), 1295540310000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(17).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(18).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(18).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(19).getX().doubleValue(), 1295540340000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(19).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(20).getX().doubleValue(), 1295540355000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(20).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(21).getX().doubleValue(), 1295540370000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(21).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(22).getX().doubleValue(), 1295540385000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(22).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(23).getX().doubleValue(), 1295540400000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(23).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(24).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(24).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(25).getX().doubleValue(), 1295540430000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(25).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(26).getX().doubleValue(), 1295540445000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(26).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(27).getX().doubleValue(), 1295540460000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(27).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(28).getX().doubleValue(), 1295540475000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(28).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(29).getX().doubleValue(), 1295540490000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(29).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(30).getX().doubleValue(), 1295540505000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(30).getY(), 9d);

        //The last tick is not included to account for lag between agent and server
        //assertEquals(xyDataList.getDataPointList().get(31).getX().doubleValue(), 1295540520000d, 0.0d);
        //assertEquals(xyDataList.getDataPointList().get(31).getY(), 10d);

    }

    @Test
    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_holes_and_45_second_resolution() {
        List<LiveStatistics> newStats = new ArrayList<LiveStatistics>();
        for (int i = 0; i < liveStatisticsList.size(); i += 2) {
            newStats.add(liveStatisticsList.get(i));
        }

        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(newStats, "name", dateFrom.getTime(), dateTo.getTime(), 45);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 6d);

        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540100000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540190000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540280000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540370000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540460000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), 7d);

        //The last tick is not included to account for lag between agent and server

    }
}


text:
import * as baseData from './base-data';
import * as baseStats from './base-stats';
import * as compare from './compare';
import * as geolocation from './geolocation';
import * as projects from './projects';
import * as location from './location';
import * as locations from './locations';
import * as measurements from './measurements';
import * as locationsByCountry from './locations-by-country';
import * as downloadModal from './download-modal';
import * as voteModal from './vote-modal';

module.exports = Object.assign(
  {},
  baseData,
  baseStats,
  compare,
  geolocation,
  projects,
  location,
  locations,
  measurements,
  locationsByCountry,
  downloadModal,
  voteModal
);


text:
namespace RoomMeasurer.Client.ViewModels
{
    using System;
    using System.Linq;
    using System.Windows.Input;

    using Logic;
    using Models;
    using Pages;
    using Utilities;

    public class CalculationResultViewModel : BaseViewModel
    {
        private double calculatedHeight;
        private Edge edge;

        public CalculationResultViewModel()
        {
            this.GoToMeasureNextEdgeCommand = new DelegateCommand(this.HandleGoToMeasureNextEdge);
            this.Finish = new DelegateCommand(this.HandleGoToFinishPage);
        }

        public double CalculatedHeight
        {
            get
            {
                return this.calculatedHeight;
            }
            set
            {
                this.calculatedHeight = value;
                this.RaisePropertyChanged("CalculatedHeight");
            }
        }

        public Room Room { get; internal set; }

        public Edge Edge
        {
            get
            {
                return this.edge;
            }
            set
            {
                this.edge = value;
                this.RaisePropertyChanged("Edge");
            }
        }

        public ICommand GoToMeasureNextEdgeCommand { get; set; }

        public ICommand Finish { get; set; }

        public void CalculateHeight(Room room)
        {
            this.Edge = room.Edges.Last();

            this.CalculatedHeight = Measurer.GetRealHeight(this.Edge.ProjectedHeight, room.ProjectedReferenceHeight, room.ActualReferenceHeight);
        }

        private void HandleGoToMeasureNextEdge()
        {
            this.NavigationService.Navigate(typeof(MeasureWithoutReferencePage), this.Room);
        }

        private void HandleGoToFinishPage()
        {
            this.NavigationService.Navigate(typeof(FinishMeasurementPage), this.Room);
        }
    }
}


text:
"""Top-level package for acqpack."""

__author__ = """Scott Longwell"""
__email__ = 'longwell@stanford.edu'
__version__ = '1.2.0'

import gui
import utils
from log import Log
from asicontroller import AsiController
from autosampler import Autosampler
from fractioncollector import FractionCollector
from manifold import Manifold
from mfcs import Mfcs
from motor import Motor


text:
'use strict';
define([
	'angular',
], function(angular) {

return angular.module('myApp.directive',[]).directive('tmsTable', function () {
	return {
		restrict: 'E',
		templateUrl: 'components/tmstable/tmsTable.html',
		$scope: {

		 },
		replace: false,
		controller: function($scope, $attrs, $element) {

		}
	};
});

});


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.facebook.presto.memory;

import com.facebook.presto.Session;
import com.facebook.presto.execution.QueryId;
import com.facebook.presto.execution.QueryInfo;
import com.facebook.presto.execution.TaskInfo;
import com.facebook.presto.operator.DriverStats;
import com.facebook.presto.server.testing.TestingPrestoServer;
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.DistributedQueryRunner;
import com.facebook.presto.tpch.TpchPlugin;
import com.google.common.collect.ImmutableMap;
import org.intellij.lang.annotations.Language;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

import static com.facebook.presto.SystemSessionProperties.RESOURCE_OVERCOMMIT;
import static com.facebook.presto.execution.QueryState.FINISHED;
import static com.facebook.presto.execution.StageInfo.getAllStages;
import static com.facebook.presto.memory.LocalMemoryManager.GENERAL_POOL;
import static com.facebook.presto.memory.LocalMemoryManager.RESERVED_POOL;
import static com.facebook.presto.memory.LocalMemoryManager.SYSTEM_POOL;
import static com.facebook.presto.operator.BlockedReason.WAITING_FOR_MEMORY;
import static com.facebook.presto.spi.StandardErrorCode.CLUSTER_OUT_OF_MEMORY;
import static com.facebook.presto.testing.TestingSession.testSessionBuilder;
import static java.util.concurrent.Executors.newCachedThreadPool;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

@Test(singleThreaded = true)
public class TestMemoryManager
{
    private static final Session SESSION = testSessionBuilder()
            .setCatalog("tpch")
            // Use sf1000 to make sure this takes at least one second, so that the memory manager will fail the query
            .setSchema("sf1000")
            .build();

    private static final Session TINY_SESSION = testSessionBuilder()
            .setCatalog("tpch")
            .setSchema("tiny")
            .build();

    private final ExecutorService executor = newCachedThreadPool();

    @Test(timeOut = 240_000)
    public void testResourceOverCommit()
            throws Exception
    {
        Map<String, String> properties = ImmutableMap.<String, String>builder()
                .put("task.operator-pre-allocated-memory", "0B")
                .put("query.max-memory-per-node", "1kB")
                .put("query.max-memory", "1kB")
                .build();

        try (DistributedQueryRunner queryRunner = createQueryRunner(TINY_SESSION, properties)) {
            try {
                queryRunner.execute("SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
                fail();
            }
            catch (RuntimeException e) {
                // expected
            }
            Session session = TINY_SESSION.withSystemProperty(RESOURCE_OVERCOMMIT, "true");
            queryRunner.execute(session, "SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
        }
    }

    @Test(timeOut = 240_000, expectedExceptions = ExecutionException.class, expectedExceptionsMessageRegExp = ".*The cluster is out of memory, and your query was killed. Please try again in a few minutes.")
    public void testOutOfMemoryKiller()
            throws Exception
    {
        Map<String, String> properties = ImmutableMap.<String, String>builder()
                .put("task.verbose-stats", "true")
                .put("task.operator-pre-allocated-memory", "0B")
                .put("query.low-memory-killer.delay", "5s")
                .put("query.low-memory-killer.enabled", "true")
                .build();

        try (DistributedQueryRunner queryRunner = createQueryRunner(TINY_SESSION, properties)) {
            // Reserve all the memory
            QueryId fakeQueryId = new QueryId("fake");
            for (TestingPrestoServer server : queryRunner.getServers()) {
                for (MemoryPool pool : server.getLocalMemoryManager().getPools()) {
                    assertTrue(pool.tryReserve(fakeQueryId, pool.getMaxBytes()));
                }
            }

            List<Future<?>> queryFutures = new ArrayList<>();
            for (int i = 0; i < 2; i++) {
                queryFutures.add(executor.submit(() -> queryRunner.execute("SELECT COUNT(*), clerk FROM orders GROUP BY clerk")));
            }

            // Wait for one of the queries to die
            boolean queryDone = false;
            while (!queryDone) {
                for (QueryInfo info : queryRunner.getCoordinator().getQueryManager().getAllQueryInfo()) {
                    if (info.getState().isDone()) {
                        assertEquals(info.getErrorCode().getCode(), CLUSTER_OUT_OF_MEMORY.toErrorCode().getCode());
                        queryDone = true;
                        break;
                    }
                }
                MILLISECONDS.sleep(10);
            }

            // Release the memory in the reserved pool
            for (TestingPrestoServer server : queryRunner.getServers()) {
                MemoryPool reserved = server.getLocalMemoryManager().getPool(RESERVED_POOL);
                // Free up the entire pool
                reserved.free(fakeQueryId, reserved.getMaxBytes());
                assertTrue(reserved.getFreeBytes() > 0);
            }

            for (Future<?> query : queryFutures) {
                query.get();
            }
        }
    }

    @Test(timeOut = 240_000)
    public void testNoLeak()
            throws Exception
    {
        testNoLeak("SELECT clerk FROM orders"); // TableScan operator
        testNoLeak("SELECT COUNT(*), clerk FROM orders WHERE orderstatus='O' GROUP BY clerk"); // ScanFilterProjectOperator, AggregationOperator
    }

    private void testNoLeak(@Language("SQL") String query)
            throws Exception
    {
        Map<String, String> properties = ImmutableMap.<String, String>builder()
                .put("task.verbose-stats", "true")
                .put("task.operator-pre-allocated-memory", "0B")
                .build();

        try (DistributedQueryRunner queryRunner = createQueryRunner(TINY_SESSION, properties)) {
            executor.submit(() -> queryRunner.execute(query)).get();

            List<QueryInfo> queryInfos = queryRunner.getCoordinator().getQueryManager().getAllQueryInfo();
            for (QueryInfo info : queryInfos) {
                assertEquals(info.getState(), FINISHED);
            }

            // Make sure we didn't leak any memory on the workers
            for (TestingPrestoServer worker : queryRunner.getServers()) {
                MemoryPool reserved = worker.getLocalMemoryManager().getPool(RESERVED_POOL);
                assertEquals(reserved.getMaxBytes(), reserved.getFreeBytes());
                MemoryPool general = worker.getLocalMemoryManager().getPool(GENERAL_POOL);
                assertEquals(general.getMaxBytes(), general.getFreeBytes());
                MemoryPool system = worker.getLocalMemoryManager().getPool(SYSTEM_POOL);
                assertEquals(system.getMaxBytes(), system.getFreeBytes());
            }
        }
    }

    @Test(timeOut = 240_000)
    public void testClusterPools()
            throws Exception
    {
        Map<String, String> properties = ImmutableMap.<String, String>builder()
                .put("task.verbose-stats", "true")
                .put("task.operator-pre-allocated-memory", "0B")
                .build();

        try (DistributedQueryRunner queryRunner = createQueryRunner(TINY_SESSION, properties)) {
            // Reserve all the memory
            QueryId fakeQueryId = new QueryId("fake");
            for (TestingPrestoServer server : queryRunner.getServers()) {
                for (MemoryPool pool : server.getLocalMemoryManager().getPools()) {
                    assertTrue(pool.tryReserve(fakeQueryId, pool.getMaxBytes()));
                }
            }

            List<Future<?>> queryFutures = new ArrayList<>();
            for (int i = 0; i < 2; i++) {
                queryFutures.add(executor.submit(() -> queryRunner.execute("SELECT COUNT(*), clerk FROM orders GROUP BY clerk")));
            }

            ClusterMemoryManager memoryManager = queryRunner.getCoordinator().getClusterMemoryManager();
            ClusterMemoryPool reservedPool;
            while ((reservedPool = memoryManager.getPools().get(RESERVED_POOL)) == null) {
                MILLISECONDS.sleep(10);
            }

            ClusterMemoryPool generalPool = memoryManager.getPools().get(GENERAL_POOL);
            assertNotNull(generalPool);

            // Wait for the queries to start running and get assigned to the expected pools
            while (generalPool.getAssignedQueries() != 1 || reservedPool.getAssignedQueries() != 1 || generalPool.getBlockedNodes() != 2 || reservedPool.getBlockedNodes() != 2) {
                MILLISECONDS.sleep(10);
            }

            // Make sure the queries are blocked
            List<QueryInfo> currentQueryInfos = queryRunner.getCoordinator().getQueryManager().getAllQueryInfo();
            for (QueryInfo info : currentQueryInfos) {
                assertFalse(info.getState().isDone());
            }
            assertEquals(currentQueryInfos.size(), 2);
            // Check that the pool information propagated to the query objects
            assertNotEquals(currentQueryInfos.get(0).getMemoryPool(), currentQueryInfos.get(1).getMemoryPool());

            while (!allQueriesBlocked(currentQueryInfos)) {
                MILLISECONDS.sleep(10);
                currentQueryInfos = queryRunner.getCoordinator().getQueryManager().getAllQueryInfo();
                for (QueryInfo info : currentQueryInfos) {
                    assertFalse(info.getState().isDone());
                }
            }

            // Release the memory in the reserved pool and the system pool
            for (TestingPrestoServer server : queryRunner.getServers()) {
                MemoryPool reserved = server.getLocalMemoryManager().getPool(RESERVED_POOL);
                // Free up the entire pool
                reserved.free(fakeQueryId, reserved.getMaxBytes());
                assertTrue(reserved.getFreeBytes() > 0);

                MemoryPool system = server.getLocalMemoryManager().getPool(SYSTEM_POOL);
                // Free up the entire pool
                system.free(fakeQueryId, system.getMaxBytes());
                assertTrue(system.getFreeBytes() > 0);
            }

            // Make sure both queries finish now that there's memory free in the reserved pool.
            // This also checks that the query in the general pool is successfully moved to the reserved pool.
            for (Future<?> query : queryFutures) {
                query.get();
            }

            List<QueryInfo> queryInfos = queryRunner.getCoordinator().getQueryManager().getAllQueryInfo();
            for (QueryInfo info : queryInfos) {
                assertEquals(info.getState(), FINISHED);
            }

            // Make sure we didn't leak any memory on the workers
            for (TestingPrestoServer worker : queryRunner.getServers()) {
                MemoryPool reserved = worker.getLocalMemoryManager().getPool(RESERVED_POOL);
                assertEquals(reserved.getMaxBytes(), reserved.getFreeBytes());
                MemoryPool general = worker.getLocalMemoryManager().getPool(GENERAL_POOL);
                // Free up the memory we reserved earlier
                general.free(fakeQueryId, general.getMaxBytes());
                assertEquals(general.getMaxBytes(), general.getFreeBytes());
                MemoryPool system = worker.getLocalMemoryManager().getPool(SYSTEM_POOL);
                assertEquals(system.getMaxBytes(), system.getFreeBytes());
            }
        }
    }

    private static boolean allQueriesBlocked(List<QueryInfo> current)
    {
        boolean allDriversBlocked = current.stream()
                .flatMap(query -> getAllStages(query.getOutputStage()).stream())
                .flatMap(stage -> stage.getTasks().stream())
                .flatMap(task -> task.getStats().getPipelines().stream())
                .flatMap(pipeline -> pipeline.getDrivers().stream())
                .allMatch(DriverStats::isFullyBlocked);
        boolean waitingForMemory = current.stream().allMatch(TestMemoryManager::atLeastOneOperatorWaitingForMemory);

        return allDriversBlocked && waitingForMemory;
    }

    private static boolean atLeastOneOperatorWaitingForMemory(QueryInfo query)
    {
        return getAllStages(query.getOutputStage()).stream()
                .flatMap(stage -> stage.getTasks().stream())
                .map(TaskInfo::getStats)
                .anyMatch(task -> task.getBlockedReasons().contains(WAITING_FOR_MEMORY));
    }

    @Test(timeOut = 240_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Query exceeded max memory size of 1kB.*")
    public void testQueryMemoryLimit()
            throws Exception
    {
        Map<String, String> properties = ImmutableMap.<String, String>builder()
                .put("query.max-memory", "1kB")
                .put("task.operator-pre-allocated-memory", "0B")
                .build();
        try (QueryRunner queryRunner = createQueryRunner(SESSION, properties)) {
            queryRunner.execute(SESSION, "SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
        }
    }

    @Test(timeOut = 240_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Query exceeded local memory limit of 1kB.*")
    public void testQueryMemoryPerNodeLimit()
            throws Exception
    {
        Map<String, String> properties = ImmutableMap.<String, String>builder()
                .put("query.max-memory-per-node", "1kB")
                .put("task.operator-pre-allocated-memory", "0B")
                .build();
        try (QueryRunner queryRunner = createQueryRunner(SESSION, properties)) {
            queryRunner.execute(SESSION, "SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
        }
    }

    @AfterClass(alwaysRun = true)
    public void shutdown()
    {
        executor.shutdownNow();
    }

    public static DistributedQueryRunner createQueryRunner(Session session, Map<String, String> properties)
            throws Exception
    {
        DistributedQueryRunner queryRunner = new DistributedQueryRunner(session, 2, properties);

        try {
            queryRunner.installPlugin(new TpchPlugin());
            queryRunner.createCatalog("tpch", "tpch");
            return queryRunner;
        }
        catch (Exception e) {
            queryRunner.close();
            throw e;
        }
    }
}


text:
* do not remove `result` attribute from filter primitives (fix [#122](https://github.com/svg/svgo/issues/122))
* plugins/cleanupAttrs: replace newline with space when needed (fix [#119](https://github.com/svg/svgo/issues/119))
* lib/coa: look for config file in current folder
* lib/coa: always traverse all files in the given folder
* deprecate svgo-grunt in favor of [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin)
* re-enable node-coveralls

### [ [>](https://github.com/svg/svgo/tree/v0.3.6) ] 0.3.6 / 06.06.2013
* plugins/removeNonInheritableGroupAttrs: more attrs groups to exclude (fix [#116](https://github.com/svg/svgo/issues/116) & [#118](https://github.com/svg/svgo/issues/118))
* lib/coa: optimize folder file by file (temp fix [#114](https://github.com/svg/svgo/issues/114))
* `.jshintrc`: JSHint 2.0
* temporarily disable node-coveralls

### [ [>](https://github.com/svg/svgo/tree/v0.3.5) ] 0.3.5 / 07.05.2013
* plugins/transformsWithOnePath: fix curves bounding box calculation
* plugins/transformsWithOnePath: fix possible c+t or q+s bug

### [ [>](https://github.com/svg/svgo/tree/v0.3.4) ] 0.3.4 / 06.05.2013
* plugins/convertPathData: fix m->M bug in some cases
* plugins/transformsWithOnePath: fix last point calculation for C/S/Q/T
* plugins/mergePaths: add space delimiter between z and m

### [ [>](https://github.com/svg/svgo/tree/v0.3.3) ] 0.3.3 / 05.05.2013
* plugins/convertPathData: convert very first m to M, fix applyTransforms with translate() (fix [#112](https://github.com/svg/svgo/issues/112))
* plugins/transformsWithOnePath: fix real width/height rounding; fix scale transform origin; reorder transforms
* plugins/transformsWithOnePath: ability to set new width or height independently with auto rescaling

### [ [>](https://github.com/svg/svgo/tree/v0.3.2) ] 0.3.2 / 03.05.2013
* new plugin [plugins/sortAttrs](https://github.com/svg/svgo/blob/master/plugins/sortAttrs.js)
* plugins/transformsWithOnePath: buggy hcrop (fix [#111](https://github.com/svg/svgo/issues/111))
* Impossible to set output presision to 0 (no fractional part) (fix [#110](https://github.com/svg/svgo/issues/110))
* Istanbul + coveralls.io
* update README with NPM version from badge.fury.io
* update README with dependency status from gemnasium.com
* npmignore unneeded files
* reoptimized project logo

### [ [>](https://github.com/svg/svgo/tree/v0.3.1) ] 0.3.1 / 15.04.2013
* plugins/transformsWithOnePath: resize SVG and automatically rescale inner Path
* better errors handling

### [ [>](https://github.com/svg/svgo/tree/v0.3.0) ] 0.3.0 / 12.04.2013
* global refactoring: getting rid of the many dependencies
* new plugin [plugins/mergePaths](https://github.com/svg/svgo/blob/master/plugins/mergePaths.js)
* new plugin [plugins/transformsWithOnePath](https://github.com/svg/svgo/blob/master/plugins/transformsWithOnePath.js) (renamed and featured `cropAndCenterAlongPath`)
* config: replace default config with `full: true`
* coa: JSON string as value of `--config`
* coa: different types of Data URI strings (close [#105](https://github.com/svg/svgo/issues/105))
* plugins/_transforms: allow spaces at the beginning of transform
* Travis CI: Nodejs 0.10 & 0.11
* `node.extend` → `whet.extend`
* update `.gitignore`
* update docs

### [ [>](https://github.com/svg/svgo/tree/v0.2.4) ] 0.2.4 / 05.04.2013
* new plugin [plugins/cropAndCenterAlongPath](https://github.com/svg/svgo/blob/master/plugins/cropAndCenterAlongPath.js) for the [Fontello](https://github.com/fontello) project

### [ [>](https://github.com/svg/svgo/tree/v0.2.3) ] 0.2.3 / 22.02.2013
* new plugin [plugins/removeNonInheritableGroupAttrs](https://github.com/svg/svgo/blob/master/plugins/removeNonInheritableGroupAttrs.js) (fix [#101](https://github.com/svg/svgo/issues/101))
* new plugin [plugins/removeRasterImages](https://github.com/svg/svgo/blob/master/plugins/removeRasterImages.js) (close [#98](https://github.com/svg/svgo/issues/98))
* plugins/convertTransform: bug with trailing spaces in transform value string (fix [#103](https://github.com/svg/svgo/issues/103))

### [ [>](https://github.com/svg/svgo/tree/v0.2.2) ] 0.2.2 / 09.02.2013
* plugins/convertTransforms: wrong translate() shorthand (fix [#94](https://github.com/svg/svgo/issues/94))
* [yaml.js](https://github.com/jeremyfa/yaml.js) → [js-yaml](https://github.com/nodeca/js-yaml)
* update outdated deps

### [ [>](https://github.com/svg/svgo/tree/v0.2.1) ] 0.2.1 / 18.01.2013
* plugins/moveElemsAttrsToGroup + plugins/moveGroupAttrsToElems: move or just leave transform attr from Group to the inner Path Elems (close [#86](https://github.com/svg/svgo/issues/86))
* plugins/removeViewBox: doesn't catch floating-point numbers (fix [#88](https://github.com/svg/svgo/issues/88))
* plugins/cleanupEnableBackground: doesn't catch floating-point numbers (fix [#89](https://github.com/svg/svgo/issues/89))
* plugins/cleanupNumericValues: wrong floating-point numbers regexp (fix [#92](https://github.com/svg/svgo/issues/92))
* SVG file generated by fontcustom.com not properly compressed (fix [#90](https://github.com/svg/svgo/issues/90))
* `README.ru.md`: стилизация русского языка, улучшение языковых конструкций, правка ошибок (close [#91](https://github.com/svg/svgo/issues/91))
* minor JSHint warning fix

### [ [>](https://github.com/svg/svgo/tree/v0.2.0) ] 0.2.0 / 23.12.2012
* plugins/convertPathData: apply transforms to Path pata (close [#33](https://github.com/svg/svgo/issues/33))
* plugins/convertPathData: `-1.816-9.278.682-13.604` parsing error (fix [#85](https://github.com/svg/svgo/issues/85))
* plugins/convertTransform: `translate(10, 0)` eq `translate(10)`, but not `translate(10, 10)` eq `translate(10)` (fix [#83](https://github.com/svg/svgo/issues/83))
* run plugins/cleanupIDs before plugins/collapseGroups (fix [#84](https://github.com/svg/svgo/issues/84))
* update `.gitignore`

### [ [>](https://github.com/svg/svgo/tree/v0.1.9) ] 0.1.9 / 17.12.2012
* plugins/cleanupIDs: renamed from removeUnusedIDs; minify used IDs (fix [#7](https://github.com/svg/svgo/issues/7))
* lib/svgo/js2svg: restore HTML entities back (fix [#80](https://github.com/svg/svgo/issues/80) + [#81](https://github.com/svg/svgo/issues/81))
* plugins/removeDoctype: do not remove if custom XML entities presents (fix [#77](https://github.com/svg/svgo/issues/77))
* lib/svgo/coa: refactoring, colors and fix [#70](https://github.com/svg/svgo/issues/70)
* lib/svgo: store elapsed time in result object
* usage examples with SVGZ (close [#18](https://github.com/svg/svgo/issues/18))
* more optimized logo
* update `.gitignore`

### [ [>](https://github.com/svg/svgo/tree/v0.1.8) ] 0.1.8 / 11.12.2012
* new plugin [plugins/removeUselessStrokeAndFill](https://github.com/svg/svgo/blob/master/plugins/removeUselessStrokeAndFill.js) (close [#75](https://github.com/svg/svgo/issues/75))
* new plugin [plugins/removeUnusedIDs](https://github.com/svg/svgo/blob/master/plugins/removeUnusedIDs.js) (close [#76](https://github.com/svg/svgo/issues/76))
* plugins/convertPathData: wrong M interpretation in some cases (fix [#73](https://github.com/svg/svgo/issues/73))
* plugins/cleanupAttrs: use `isElem()` API
* `.travis.yml`: check all branches

### [ [>](https://github.com/svg/svgo/tree/v0.1.7) ] 0.1.7 / 08.12.2012
* plugins/convertPathData: incorrect interpretation of `z + m` (fix [#69](https://github.com/svg/svgo/issues/69))
* plugins/convertTransform: do a more accurate floating numbers rounding in `matrixToTransform()` (fix [#68](https://github.com/svg/svgo/issues/68))

### [ [>](https://github.com/svg/svgo/tree/v0.1.6) ] 0.1.6 / 07.12.2012
* plugins/convertPathData: collapse repeated instructions only after curveSmoothShorthands (fix [#64](https://github.com/svg/svgo/issues/64))
* lib/svgo/coa: handle 'there is nothing to optimize' case and display a message about it (fix [#61](https://github.com/svg/svgo/issues/61))
* plugins/cleanupSVGElem: delete as useless artefact

### [ [>](https://github.com/svg/svgo/tree/v0.1.5) ] 0.1.5 / 06.12.2012
* E-notated numbers in paths not recognised (fix [#63](https://github.com/svg/svgo/issues/63))
* update README with `svgo-grunt` and `svgo-osx-folder-action`
* fix `mocha-as-promised` plug in node 0.6

### [ [>](https://github.com/svg/svgo/tree/v0.1.4) ] 0.1.4 / 05.12.2012
* plugins/_collections: more defaults
* `README.ru.md`
* `docs/how-it-works/ru.md`
* mocha + mocha-as-promised + chai + chai-as-promised + should + istanbul = <3
* update dependencies semvers in `package.json`
* `v0.1.x` and `v0.2.x` milestones

### [ [>](https://github.com/svg/svgo/tree/v0.1.3) ] 0.1.3 / 30.11.2012
* new plugin [plugins/cleanupNumericValues](https://github.com/svg/svgo/blob/master/plugins/cleanupNumericValues.js) (close [#8](https://github.com/svg/svgo/issues/8))
* plugins/removeDefaultPx functionality now included in plugins/removeUnknownsAndDefaults
* plugins/removeUnknownsAndDefaults: refactoring and picking up the complete elems+attrs collection (close [#59](https://github.com/svg/svgo/issues/59))
* plugins/convertTransform: error in matrices multiplication (fix [#58](https://github.com/svg/svgo/issues/58))
* plugins/convertTransform: mark translate() and scale() as useless only with one param (fix [#57](https://github.com/svg/svgo/issues/57))
* plugins/convertPathData: drastic speed improvement with huge Path data
* plugins/convertPathData: fix the very first Mm with multiple points (fix [#56](https://github.com/svg/svgo/issues/56))
* plugins/moveElemsAttrsToGroup: additional check for transform attr
* brand-new project `logo.svg`
* `.travis.yml`: build only master branch
* global `'use strict'`
* `.jshintignore`
* README and CHANGELOG: minor corrections

### [ [>](https://github.com/svg/svgo/tree/v0.1.2) ] 0.1.2 / 24.11.2012
* lib/svgo/svg2js: correct 'onerror' failure (fix [#51](https://github.com/svg/svgo/issues/51))
* config: disable sax-js position tracking by default (fix [#52](https://github.com/svg/svgo/issues/52))
* lib/svgo: rename 'startBytes' to 'inBytes' and 'endBytes' to 'outBytes' (close [#53](https://github.com/svg/svgo/issues/53))
* plugins/removeUnknownsAndDefaults: remove SVG id attr (close [#54](https://github.com/svg/svgo/issues/54))

### [ [>](https://github.com/svg/svgo/tree/v0.1.1) ] 0.1.1 / 23.11.2012
* plugins/moveElemsAttrsToGroup: fix inheitable only attrs array (fix [#47](https://github.com/svg/svgo/issues/47))
* plugins/removeEmptyContainers: do not remove an empty 'svg' element (fix [#48](https://github.com/svg/svgo/issues/48))
* plugins/removeDefaultPx: should also understand a floating-numbers too (fix [#49](https://github.com/svg/svgo/issues/49))
* plugins/removeUnknownsAndDefaults: merge multiple groupDefaults attrs (close [#50](https://github.com/svg/svgo/issues/50))

### [ [>](https://github.com/svg/svgo/tree/v0.1.0) ] 0.1.0 / 22.11.2012
* new plugin [plugins/removeUnknownsAndDefaults](https://github.com/svg/svgo/blob/master/plugins/removeUnknownsAndDefaults.js) (close [#6](https://github.com/svg/svgo/issues/6))
* plugins/convertPathData: convert straight curves into lines segments (close [#17](https://github.com/svg/svgo/issues/17)); remove an absolute coords conversions
* plugins/convertPathData: convert quadratic Bézier curveto into smooth shorthand (close [#31](https://github.com/svg/svgo/issues/31))
* plugins/convertPathData: convert curveto into smooth shorthand (close [#30](https://github.com/svg/svgo/issues/30))
* lib/svgo: global API refactoring (close [#37](https://github.com/svg/svgo/issues/37))
* lib/svgo: fatal and stupid error in stream chunks concatenation (fix [#40](https://github.com/svg/svgo/issues/40))
* lib/coa: batch folder optimization (close [#29](https://github.com/svg/svgo/issues/29))
* lib/coa: support arguments as aliases to `--input` and `--output` (close [#28](https://github.com/svg/svgo/issues/28))
* project logo by [Egor Bolhshakov](http://xizzzy.ru/)
* move modules to `./lib/svgo/`
* rename and convert `config.json` to `.svgo.yml`
* add [./docs/](https://github.com/svg/svgo/tree/master/docs)
* plugins/convertPathData: don't remove first `M` even if it's `0,0`
* plugins/convertPathData: stronger defense from infinite loop
* plugins/moveElemsAttrsToGroup: should affect only inheritable attributes (fix [#46](https://github.com/svg/svgo/issues/46))*
* plugins/removeComments: ignore comments which starts with '!' (close [#43](https://github.com/svg/svgo/issues/43))
* config: `cleanupAttrs` should be before `convertStyleToAttrs` (fix [#44](https://github.com/svg/svgo/issues/44))*
* lib/svgo/jsAPI: add `eachAttr()` optional context param
* temporarily remove PhantomJS and `--test` (close [#38](https://github.com/svg/svgo/issues/38))
* q@0.8.10 compatibility: 'end is deprecated, use done instead' fix
* add [Istanbul](https://github.com/gotwarlost/istanbul) code coverage
* update dependencies versions and gitignore
* README: add TODO section with versions milestones
* update README with License section
* update LICENSE with russian translation
* `.editorconfig`: 2 spaces for YAML

### [ [>](https://github.com/svg/svgo/tree/v0.0.9) ] 0.0.9 / 29.10.2012
* [plugins how-to](https://github.com/svg/svgo/tree/master/plugins#readme) (close [#27](https://github.com/svg/svgo/issues/27))
* allow any plugin of any type to go in any order (close [#14](https://github.com/svg/svgo/issues/14))
* allow to do a multiple optimizations with one init (close [#25](https://github.com/svg/svgo/issues/25))
* plugins/convertPathData: global refactoring
* plugins/convertPathData: do all the tricks with absolute coords too (fix [#22](https://github.com/svg/svgo/issues/22))
* plugins/convertPathData: accumulation of rounding errors (fix [#23](https://github.com/svg/svgo/issues/23))
* plugins/convertPathData: prevent an infinity loop on invalid path data (fix [#26](https://github.com/svg/svgo/issues/26))
* plugins/convertPathData: do not remove very first M from the path data (fix [#24](https://github.com/svg/svgo/issues/24))
* plugins/convertPathData: optimize path data in <glyph> and <missing-glyph> (close [#20](https://github.com/svg/svgo/issues/20))
* plugins/convertTransform: add patternTransform attribute to the process (close [#15](https://github.com/svg/svgo/issues/15))
* plugins/convertTransform: Firefox: removing extra space in front of negative number is alowed only in path data, but not in transform (fix [#12](https://github.com/svg/svgo/issues/12))
* plugins/removeXMLProcInst: remove only 'xml' but not 'xml-stylesheet' (fix [#21](https://github.com/svg/svgo/issues/15))
* plugins/collapseGroups: merge split-level transforms (fix [#13](https://github.com/svg/svgo/issues/13))
* jsdoc corrections

### [ [>](https://github.com/svg/svgo/tree/v0.0.8) ] 0.0.8 / 20.10.2012
* new plugin [convertTransform](plugins/convertTransform.js) (close [#5](https://github.com/svg/svgo/issues/5))
* new plugin [removeUnusedNS](plugins/removeUnusedNS.js)
* plugins/convertPathData: remove useless segments
* plugins/convertPathData: a lot of refactoring
* plugins/convertPathData: round numbers before conditions because of exponential notation (fix [#3](https://github.com/svg/svgo/issues/3))
* plugins/moveElemsAttrsToGroup: merge split-level transforms instead of replacing (fix [#10](https://github.com/svg/svgo/issues/10))
* lib/svg2js: catch and output xml parser errors (fix [#4](https://github.com/svg/svgo/issues/4))
* lib/coa: open file for writing only when we are ready (fix [#2](https://github.com/svg/svgo/issues/2))
* lib/tools: node.extend module
* lib/plugins: refactoring
* lib/js2svg: refactoring
* lib/jsAPI: simplification and refactoring
* absolute urls in README
* update .editorconfig
* update .travis.yml with nodejs 0.9

### [ [>](https://github.com/svg/svgo/tree/v0.0.7) ] 0.0.7 / 14.10.2012
* new plugin [convertPathData](plugins/convertPathData.js)
* --input data now can be a Data URI base64 string
* --output data now can be a Data URI base64 string with --datauri flag
* Travis CI
* JSHint corrections + .jshintrc
* [.editorconfig](http://editorconfig.org/)
* display time spent on optimization
* .svgo → config.json
* lib/phantom_wrapper.js → lib/phantom.js

### [ [>](https://github.com/svg/svgo/tree/v0.0.6) ] 0.0.6 / 04.10.2012
* add --test option to make a visual comparison of two files (PhantomJS pre-required)
* update README and CHANGELOG with the correct relative urls

### [ [>](https://github.com/svg/svgo/tree/v0.0.5) ] 0.0.5 / 03.10.2012
* every plugin now has [at least one test](plugins)
* removeViewBox, cleanupEnableBackground, removeEditorsNSData, convertStyleToAttrs and collapseGroups plugins fixes
* new --pretty option for the pretty printed SVG
* lib/config refactoring

### [ [>](https://github.com/svg/svgo/tree/v0.0.4) ] 0.0.4 / 30.09.2012
* new plugin [removeViewBox](plugins/removeViewBox.js)
* new plugin [cleanupEnableBackground](plugins/cleanupEnableBackground.js)
* display useful info after successful optimization
* 'npm test' with 'spec' mocha output by default

### [ [>](https://github.com/svg/svgo/tree/v0.0.3) ] 0.0.3 / 29.09.2012
* plugins/collapseGroups bugfix
* plugins/moveElemsAttrsToGroup bugfix
* svgo now display --help if running w/o arguments
* massive jsdoc updates
* plugins engine main filter function optimization

### [ [>](https://github.com/svg/svgo/tree/v0.0.2) ] 0.0.2 / 28.09.2012
* add --disable and --enable command line options
* add an empty values rejecting to coa.js
* update README

### [ [>](https://github.com/svg/svgo/tree/v0.0.1) ] 0.0.1 / 27.09.2012
* initial public version