text:
require "test_helper"

class DocumentIndexingJobTest < ActiveSupport::TestCase
  include Remets::MockAmazonS3
  self.use_transactional_tests = true

  test "#perform does nothing when no documents are fingerprinted" do
    assert_no_difference("DocumentMatch.count", "Match.count") do
      DocumentIndexingJob.perform_now(submitted_documents(:platypus))
    end
  end

  test "#perform add a match with the intersection of fingerprints" do
    [SubmittedDocument, DocumentMatch, Match].each(&:destroy_all)

    reference = submissions(:log121_lab1_1).submitted_documents.create!(
      file_ptr: @empty_file,
      windows: [[0, 1234], [1, 9876], [4, 5678]],
    )
    compared = submissions(:log121_lab1_2).submitted_documents.create!(
      file_ptr: @empty_file,
      windows: [[0, 1234], [1, 3456], [4, 6666]],
    )

    assert_difference("DocumentMatch.count", 2) do
      assert_difference("Match.count", 1) do
        DocumentIndexingJob.perform_now(reference)
      end
    end

    match = Match.first
    document_match1 = DocumentMatch.first
    document_match2 = DocumentMatch.second

    assert_equal [1234], match.fingerprints

    assert_equal document_match1.match, document_match1.match
    assert_equal reference, document_match1.reference_document
    assert_equal compared, document_match1.compared_document

    assert_equal document_match2.match, document_match2.match
    assert_equal compared, document_match2.reference_document
    assert_equal reference, document_match2.compared_document
  end

  test "#perform does not add a match when the intersection is empty" do
    [SubmittedDocument, DocumentMatch, Match].each(&:destroy_all)

    reference = submissions(:log121_lab1_1).submitted_documents.create!(
      file_ptr: @empty_file,
      windows: [[0, 1234], [1, 9876], [4, 5678]],
    )
    _compared = submissions(:log121_lab1_2).submitted_documents.create!(
      file_ptr: @empty_file,
      windows: [[0, 4321], [1, 3456], [4, 6666]],
    )

    assert_no_difference("DocumentMatch.count", "Match.count") do
      DocumentIndexingJob.perform_now(reference)
    end
  end

  test "#perform delete previous matches" do
    DocumentMatch.create!(
      reference_document: submitted_documents(:platypus),
      compared_document: submitted_documents(:fraudulent_platypus),
      match: Match.create!(fingerprints: [1234, 4567]),
      similarity: 0.5,
    )

    SubmittedDocument.stubs(:all_fingerprinted_except).returns(SubmittedDocument.none)

    assert_difference("DocumentMatch.count", -1) do
      DocumentIndexingJob.perform_now(submitted_documents(:platypus))
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.amazonaws.services.dynamodbv2.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Represents the auto scaling settings of a global secondary index for a replica that will be modified.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReplicaGlobalSecondaryIndexAutoScalingUpdate implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The name of the global secondary index.
     *

     */
    private String indexName;

    private AutoScalingSettingsUpdate provisionedReadCapacityAutoScalingUpdate;

    /**
     *

     * The name of the global secondary index.
     *

     *
     * @param indexName
     *        The name of the global secondary index.
     */

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    /**
     *

     * The name of the global secondary index.
     *

     *
     * @return The name of the global secondary index.
     */

    public String getIndexName() {
        return this.indexName;
    }

    /**
     *

     * The name of the global secondary index.
     *

     *
     * @param indexName
     *        The name of the global secondary index.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ReplicaGlobalSecondaryIndexAutoScalingUpdate withIndexName(String indexName) {
        setIndexName(indexName);
        return this;
    }

    /**
     * @param provisionedReadCapacityAutoScalingUpdate
     */

    public void setProvisionedReadCapacityAutoScalingUpdate(AutoScalingSettingsUpdate provisionedReadCapacityAutoScalingUpdate) {
        this.provisionedReadCapacityAutoScalingUpdate = provisionedReadCapacityAutoScalingUpdate;
    }

    /**
     * @return
     */

    public AutoScalingSettingsUpdate getProvisionedReadCapacityAutoScalingUpdate() {
        return this.provisionedReadCapacityAutoScalingUpdate;
    }

    /**
     * @param provisionedReadCapacityAutoScalingUpdate
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ReplicaGlobalSecondaryIndexAutoScalingUpdate withProvisionedReadCapacityAutoScalingUpdate(
            AutoScalingSettingsUpdate provisionedReadCapacityAutoScalingUpdate) {
        setProvisionedReadCapacityAutoScalingUpdate(provisionedReadCapacityAutoScalingUpdate);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getIndexName() != null)
            sb.append("IndexName: ").append(getIndexName()).append(",");
        if (getProvisionedReadCapacityAutoScalingUpdate() != null)
            sb.append("ProvisionedReadCapacityAutoScalingUpdate: ").append(getProvisionedReadCapacityAutoScalingUpdate());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ReplicaGlobalSecondaryIndexAutoScalingUpdate == false)
            return false;
        ReplicaGlobalSecondaryIndexAutoScalingUpdate other = (ReplicaGlobalSecondaryIndexAutoScalingUpdate) obj;
        if (other.getIndexName() == null ^ this.getIndexName() == null)
            return false;
        if (other.getIndexName() != null && other.getIndexName().equals(this.getIndexName()) == false)
            return false;
        if (other.getProvisionedReadCapacityAutoScalingUpdate() == null ^ this.getProvisionedReadCapacityAutoScalingUpdate() == null)
            return false;
        if (other.getProvisionedReadCapacityAutoScalingUpdate() != null
                && other.getProvisionedReadCapacityAutoScalingUpdate().equals(this.getProvisionedReadCapacityAutoScalingUpdate()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getIndexName() == null) ? 0 : getIndexName().hashCode());
        hashCode = prime * hashCode + ((getProvisionedReadCapacityAutoScalingUpdate() == null) ? 0 : getProvisionedReadCapacityAutoScalingUpdate().hashCode());
        return hashCode;
    }

    @Override
    public ReplicaGlobalSecondaryIndexAutoScalingUpdate clone() {
        try {
            return (ReplicaGlobalSecondaryIndexAutoScalingUpdate) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.dynamodbv2.model.transform.ReplicaGlobalSecondaryIndexAutoScalingUpdateMarshaller.getInstance().marshall(this,
                protocolMarshaller);
    }
}


text:
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: __dirname + '/src/js/main.js',
  output: {
    path: __dirname + '/dist',
    filename: 'js/main.min.js',
  },
  module: {
    loaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: 'babel-loader',
    }, {
      test: /\.scss$/,
      loader: ExtractTextPlugin.extract({
        fallback: 'style-loader', // backup loader when not building .css file
        use: 'css-loader!sass-loader', // loaders to preprocess CSS
      }),
    }],
  },
  plugins: [
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: '"production"',
      },
    }),
    new ExtractTextPlugin('css/[name].min.css'),
    new webpack.optimize.UglifyJsPlugin(),
    new OptimizeCssAssetsPlugin({
      cssProcessorOptions: { discardComments: { removeAll: true } },
    }),
    new HtmlWebpackPlugin({
      template: './src/index.html',
    }),
  ],
};


text:
package com.linxiao.framework.architecture;

import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import android.text.TextUtils;
import android.util.Log;

import com.linxiao.framework.notification.NotificationManager;

/**
 * 启动Activity基类
 * <p>执行App启动的预处理,此处用于执行框架模块的预处理操作。
 * </p>
 * Created by linxiao on 2016/12/5.
 */
public abstract class BaseSplashActivity extends BaseActivity {

    protected boolean isHandleNotification;
    private Bundle notificationExtra;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        notificationExtra = intent.getBundleExtra(NotificationManager.KEY_NOTIFICATION_EXTRA);
        isHandleNotification = notificationExtra != null;

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        handleNotification();
    }

    protected void handleNotification() {
        if (!isHandleNotification) {
            return;
        }
        String targetKey = notificationExtra.getString(NotificationManager.KEY_TARGET_ACTIVITY_NAME);
        if (TextUtils.isEmpty(targetKey)) {
            Log.e(TAG, "handleNotification: target key is null !");
            return;
        }
        try {
            Class<?> destActivityClass = Class.forName(targetKey);
            Intent destIntent = new Intent(this, destActivityClass);
            destIntent.putExtras(notificationExtra);
            startActivity(destIntent);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            Log.e(TAG, "handleNotification: reflect to get activity class failed !");
        }
    }

    @Override
    public void startActivity(Intent intent) {
        super.startActivity(intent);
    }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datamigration.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.Map;

/** Validation result for Sql Server to Azure Sql DB migration. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType")
@JsonTypeName("MigrationValidationOutput")
@Fluent
public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends MigrateSqlServerSqlDbTaskOutput {
    @JsonIgnore
    private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputValidationResult.class);

    /*
     * Migration Identifier
     */
    @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY)
    private String migrationId;

    /*
     * Validation summary results for each database
     */
    @JsonProperty(value = "summaryResults")
    private Map<String, MigrationValidationDatabaseSummaryResult> summaryResults;

    /*
     * Current status of validation at the migration level. Status from the
     * database validation result status will be aggregated here.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private ValidationStatus status;

    /**
     * Get the migrationId property: Migration Identifier.
     *
     * @return the migrationId value.
     */
    public String migrationId() {
        return this.migrationId;
    }

    /**
     * Get the summaryResults property: Validation summary results for each database.
     *
     * @return the summaryResults value.
     */
    public Map<String, MigrationValidationDatabaseSummaryResult> summaryResults() {
        return this.summaryResults;
    }

    /**
     * Set the summaryResults property: Validation summary results for each database.
     *
     * @param summaryResults the summaryResults value to set.
     * @return the MigrateSqlServerSqlDbTaskOutputValidationResult object itself.
     */
    public MigrateSqlServerSqlDbTaskOutputValidationResult withSummaryResults(
        Map<String, MigrationValidationDatabaseSummaryResult> summaryResults) {
        this.summaryResults = summaryResults;
        return this;
    }

    /**
     * Get the status property: Current status of validation at the migration level. Status from the database validation
     * result status will be aggregated here.
     *
     * @return the status value.
     */
    public ValidationStatus status() {
        return this.status;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (summaryResults() != null) {
            summaryResults()
                .values()
                .forEach(
                    e -> {
                        if (e != null) {
                            e.validate();
                        }
                    });
        }
    }
}


text:
//
//  SinglyCache.h
//  SinglySDK
//
//  Copyright (c) 2012-2013 Singly, Inc. All rights reserved.
//
//  Redistribution and use in source and binary forms, with or without
//  modification, are permitted provided that the following conditions are met:
//
//  * Redistributions of source code must retain the above copyright notice,
//    this list of conditions and the following disclaimer.
//
//  * Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
//  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//  POSSIBILITY OF SUCH DAMAGE.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface SinglyCache : NSCache

/// ----------------------------------------------------------------------------
/// @name Accessing the Shared Cache
/// ----------------------------------------------------------------------------

/*!
 *
 * The singleton shared cache instance.
 *
 * @returns SinglyCache
 *
 * @available Available in Singly iOS SDK 1.1.0 and later.
 *
**/
+ (SinglyCache *)sharedCache;

/// ----------------------------------------------------------------------------
/// @name Manipulating Cache Contents
/// ----------------------------------------------------------------------------

/*!
 *
 * Adds the specified image to the cache for the given URL.
 *
 * @available Available in Singly iOS SDK 1.1.0 and later.
 *
**/
- (void)cacheImage:(UIImage *)image forURL:(NSString *)url;

/*!
 *
 * Looks in the cache for an image for the given URL. If available, it will be
 * returned. This will return a nil value if the image is not cached.
 *
 * @returns UIImage
 *
 * @available Available in Singly iOS SDK 1.1.0 and later.
 *
**/
- (UIImage *)cachedImageForURL:(NSString *)url;

/*!
 *
 * Checks the cache for the presence of an image for the given URL.
 *
 * @returns BOOL
 *
 * @available Available in Singly iOS SDK 1.1.0 and later.
 *
**/
- (BOOL)cachedImageExistsForURL:(NSString *)url;

@end


text:
define({
//begin v1.x content
redLabel: "c",
greenLabel: "z",
blueLabel: "p",
hueLabel: "n",
saturationLabel: "Z",
valueLabel: "v", /* aka intensity or brightness */
degLabel: "\u00B0",
hexLabel: "hex",
huePickerTitle: "Selektor nijanse",
saturationPickerTitle: "Selektor zasićenosti"
//end v1.x content
});


text:
angular.module('common.fabric.window', [])

.factory('FabricWindow', ['$window', function($window) {

	return $window.fabric;

}]);


text:
@interface FIRCLSNetworkOperation ()

@property(nonatomic, strong, readonly) NSString *googleAppID;

@end

@implementation FIRCLSNetworkOperation

- (instancetype)initWithGoogleAppID:(NSString *)googleAppID
                              token:(FIRCLSDataCollectionToken *)token {
  NSParameterAssert(googleAppID);
  if (!googleAppID) {
    return nil;
  }

  self = [super init];
  if (self) {
    _googleAppID = googleAppID;
    _token = token;
  }
  return self;
}

- (void)startWithToken:(FIRCLSDataCollectionToken *)token {
  // Settings is considered data collection, so we must only
  // call this with a valid token
  if (![token isValid]) {
    FIRCLSErrorLog(@"Skipping network operation with invalid data collection token");
    return;
  }

  [super start];
}

- (NSMutableURLRequest *)mutableRequestWithDefaultHTTPHeaderFieldsAndTimeoutForURL:(NSURL *)url {
  return [self mutableRequestWithDefaultHTTPHeadersForURL:url timeout:10.0];
}

- (NSMutableURLRequest *)mutableRequestWithDefaultHTTPHeadersForURL:(NSURL *)url
                                                            timeout:(NSTimeInterval)timeout {
  NSMutableURLRequest *request =
      [NSMutableURLRequest requestWithURL:url
                              cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
                          timeoutInterval:timeout];

  NSString *localeId = self.localeIdentifier;

  [request setValue:self.userAgentString forHTTPHeaderField:FIRCLSNetworkUserAgent];
  [request setValue:FIRCLSNetworkUTF8 forHTTPHeaderField:FIRCLSNetworkAcceptCharset];
  [request setValue:localeId forHTTPHeaderField:FIRCLSNetworkAcceptLanguage];
  [request setValue:localeId forHTTPHeaderField:FIRCLSNetworkContentLanguage];
  [request setValue:FIRCLSDeveloperToken forHTTPHeaderField:FIRCLSNetworkCrashlyticsDeveloperToken];
  [request setValue:FIRCLSApplicationGetSDKBundleID()
      forHTTPHeaderField:FIRCLSNetworkCrashlyticsAPIClientId];
  [request setValue:FIRCLSSDKVersion()
      forHTTPHeaderField:FIRCLSNetworkCrashlyticsAPIClientDisplayVersion];
  [request setValue:self.googleAppID forHTTPHeaderField:FIRCLSNetworkCrashlyticsGoogleAppId];

  return request;
}

- (NSString *)userAgentString {
  return
      [NSString stringWithFormat:@"%@/%@", FIRCLSApplicationGetSDKBundleID(), FIRCLSSDKVersion()];
}

- (NSString *)localeIdentifier {
  return NSLocale.currentLocale.localeIdentifier;
}

@end


text:
function goto_line(elem){
  var h = $(elem).position().top
  $(document.body).animate({scrollTop: h}, 'fast')
}

$(document.body).ready(function(){
  var hash = window.location.hash
  var matched = hash.match(/#(\d+)/)
  if(!matched){
    return
  }
  var linum = matched[1]
  var elem = document.getElementById('L' + linum)
  if(elem){
    goto_line(elem)
  }
})


text:
<?php

declare(strict_types=1);

namespace CQRS\CommandHandling;

interface CommandHandlerLocatorInterface
{
    public function get(string $commandType): callable;
}


text:
package com.diozero.sampleapps;

import org.tinylog.Logger;

import com.diozero.api.RuntimeInterruptedException;
import com.diozero.devices.LedButton;
import com.diozero.util.Diozero;
import com.diozero.util.SleepUtil;

public class LedButtonTest {
	public static void main(String[] args) {
		if (args.length < 2) {
			Logger.error("Usage: {} <button-gpio> <led-gpio>");
			return;
		}

		int button_gpio = Integer.parseInt(args[0]);
		int led_gpio = Integer.parseInt(args[1]);

		int sleep_sec = 20;

		try (LedButton led_button = new LedButton(button_gpio, led_gpio)) {
			Logger.info("Sleeping for {} seconds", Integer.valueOf(sleep_sec));
			SleepUtil.sleepSeconds(sleep_sec);
		} catch (RuntimeInterruptedException e) {
			// Ignore
		} finally {
			Diozero.shutdown();
		}
	}
}


text:
package org.niklas.elemental.Elemental.client.elements;

import com.google.gwt.core.client.js.JsProperty;
import com.google.gwt.core.client.js.JsType;

@JsType(
    prototype = "HTMLTableColElement"
)
interface HTMLTableColElement extends HTMLElement {
  @JsProperty
  int getSpan();

  @JsProperty
  void setSpan(int value);

  @JsProperty
  String getAlign();

  @JsProperty
  void setAlign(String value);

  @JsProperty
  String getCh();

  @JsProperty
  void setCh(String value);

  @JsProperty
  String getChOff();

  @JsProperty
  void setChOff(String value);

  @JsProperty
  String getVAlign();

  @JsProperty
  void setVAlign(String value);

  @JsProperty
  String getWidth();

  @JsProperty
  void setWidth(String value);
}


text:
{- |
   Module     : Yuuko.Text.XML.HXT.DTDValidation.TypeDefs
   Copyright  : Copyright (C) 2008 Uwe Schmidt
   License    : MIT

   Maintainer : Uwe Schmidt (uwe@fh-wedel.de)
   Stability  : experimental
   Portability: portable

   This module provides functions for validating the DTD of XML documents
   represented as XmlTree.

   Unlike other popular XML validation tools the validation process returns
   a list of errors instead of aborting after the first error was found.

   Unlike validation of the document, the DTD branch is traversed four times:

    - Validation of Notations

    - Validation of Unparsed Entities

    - Validation of Element declarations

    - Validation of Attribute declarations

-}

-- ------------------------------------------------------------

module Yuuko.Text.XML.HXT.DTDValidation.DTDValidation
    ( removeDoublicateDefs
    , validateDTD
    )
where

import Yuuko.Text.XML.HXT.DTDValidation.TypeDefs
import Yuuko.Text.XML.HXT.DTDValidation.AttributeValueValidation

-- |
-- Validate a DTD.
--
--    - returns : a functions which takes the DTD subset of the XmlTree, checks
--                  if the DTD is valid and returns a list of errors

validateDTD :: XmlArrow
validateDTD -- dtdPart
    = isDTDDoctype
      `guards`
      ( listA getChildren
	>>>
	( validateParts $<< (getNotationNames &&& getElemNames) )
      )
    where
    validateParts notationNames elemNames
	= validateNotations
	  <+>
	  validateEntities notationNames
          <+>
	  validateElements elemNames
	  <+>
	  validateAttributes elemNames notationNames

    getNotationNames	:: LA [XmlTree] [String]
    getNotationNames	= listA $ unlistA >>> isDTDNotation >>> getDTDAttrValue a_name

    getElemNames	:: LA [XmlTree] [String]
    getElemNames	= listA $ unlistA >>> isDTDElement  >>> getDTDAttrValue a_name

-- ------------------------------------------------------------

checkName	:: String -> SLA [String] XmlTree XmlTree -> SLA [String] XmlTree XmlTree
checkName name msg
    = ifA ( getState
	    >>>
	    isA (name `elem`)
	  )
      msg
      (nextState (name:) >>> none)

-- ------------------------------------------------------------

-- |
-- Validation of Notations, checks if all notation names are unique.
-- Validity constraint: Unique Notation Name (4.7 \/ p.44 in Spec)
--
--    * 1.parameter dtdPart :  the children of the @DOCTYPE@ node
--
--    - returns : a list of errors

validateNotations :: LA XmlTrees XmlTree
validateNotations
    = fromSLA [] ( unlistA
		   >>>
		   isDTDNotation
		   >>>
		   (checkForUniqueNotation $< getDTDAttrl)
		 )
      where
      checkForUniqueNotation :: Attributes -> SLA [String] XmlTree XmlTree
      checkForUniqueNotation al
	  = checkName name $
	    err ( "Notation "++ show name ++ " was already specified." )
	  where
	  name = dtd_name al

-- |
-- Validation of Entities.
--
-- 1. Issues a warning if entities are declared multiple times.
--
--    Optional warning: (4.2 \/ p.35 in Spec)
--
--
-- 2. Validates that a notation is declared for an unparsed entity.
--
--    Validity constraint: Notation Declared (4.2.2 \/ p.36 in Spec)
--
--    * 1.parameter dtdPart :  the children of the @DOCTYPE@ node
--
--    - 2.parameter notationNames :  list of all notation names declared in the DTD
--
--    - returns : a list of errors

validateEntities	:: [String] -> LA XmlTrees XmlTree
validateEntities notationNames
    = ( fromSLA [] ( unlistA
		     >>>
		     isDTDEntity
		     >>>
		     (checkForUniqueEntity $< getDTDAttrl)
		   )
      )
      <+>
      ( unlistA
	>>>
	isUnparsedEntity
	>>>
	(checkNotationDecl $< getDTDAttrl)
      )
      where

      -- Check if entities are declared multiple times

      checkForUniqueEntity	:: Attributes -> SLA [String] XmlTree XmlTree
      checkForUniqueEntity al
	  = checkName name $
	    warn ( "Entity "++ show name ++ " was already specified. " ++
		    "First declaration will be used." )
	  where
	  name = dtd_name al

      -- Find unparsed entities for which no notation is specified

      checkNotationDecl		:: Attributes -> XmlArrow
      checkNotationDecl al
	  | notationName `elem` notationNames
	      = none
	  | otherwise
	      = err ( "The notation " ++ show notationName ++ " must be declared " ++
	              "when referenced in the unparsed entity declaration for " ++
		      show upEntityName ++ "."
		    )
	  where
	  notationName = lookup1 k_ndata al
	  upEntityName = dtd_name  al

-- |
-- Validation of Element declarations.
--
-- 1. Validates that an element is not declared multiple times.
--
--    Validity constraint: Unique Element Type Declaration (3.2 \/ p.21 in Spec)
--
--
-- 2. Validates that an element name only appears once in a mixed-content declaration.
--
--    Validity constraint: No Duplicate Types (3.2 \/ p.21 in Spec)
--
--
-- 3. Issues a warning if an element mentioned in a content model is not declared in the
--    DTD.
--
--    Optional warning: (3.2 \/ p.21 in Spec)
--
--    * 1.parameter dtdPart :  the children of the @DOCTYPE@ node
--
--    - 2.parameter elemNames :  list of all element names declared in the DTD
--
--    - returns : a list of errors

validateElements	:: [String] -> LA XmlTrees XmlTree
validateElements elemNames -- dtdPart
    = ( fromSLA [] ( unlistA
		     >>>
		     isDTDElement
		     >>>
		     (checkForUniqueElement $< getDTDAttrl)
		   )
      )
      <+>
      ( unlistA
	>>>
	isMixedContentElement
	>>>
	(checkMixedContent $< getDTDAttrl)
      )
      <+>
      ( unlistA
	>>>
	isDTDElement
	>>>
	(checkContentModel elemNames $< getDTDAttrl)
      )
      where

      -- Validates that an element is not declared multiple times

      checkForUniqueElement :: Attributes -> SLA [String] XmlTree XmlTree
      checkForUniqueElement al
	  = checkName name $
	    err ( "Element type " ++ show name ++
		  " must not be declared more than once." )
	  where
	  name = dtd_name al

      -- Validates that an element name only appears once in a mixed-content declaration

      checkMixedContent	:: Attributes -> XmlArrow
      checkMixedContent al
	  = fromSLA [] ( getChildren
			 >>>
			 getChildren
			 >>>
			 isDTDName
			 >>>
			 (check $< getDTDAttrl)
		       )
	    where
	    elemName = dtd_name al
	    check al'
		= checkName name $
		  err ( "The element type " ++ show name ++
			 " was already specified in the mixed-content model of the element declaration " ++
		         show elemName ++ "." )
		where
		name = dtd_name al'

      -- Issues a warning if an element mentioned in a content model is not
      -- declared in the DTD.
      checkContentModel :: [String] -> Attributes -> XmlArrow
      checkContentModel names al
	  | cm `elem` [v_children, v_mixed]
	      = getChildren >>> checkContent
	  | otherwise
	      = none
	  where
	  elemName = dtd_name al
	  cm       = dtd_type al

	  checkContent :: XmlArrow
	  checkContent
	      = choiceA
		[ isDTDName    :-> ( checkName' $< getDTDAttrl )
		, isDTDContent :-> ( getChildren >>> checkContent )
		, this         :-> none
		]
	      where
	      checkName' al'
		  | childElemName `elem` names
		      = none
		  | otherwise
		      = warn ( "The element type "++ show childElemName ++
			       ", used in content model of element "++ show elemName ++
			       ", is not declared."
			     )
		  where
		  childElemName = dtd_name al'

-- |
-- Validation of Attribute declarations.
--
-- (1) Issues a warning if an attribute is declared for an element type not itself
--    decared.
--
--    Optinal warning: (3.3 \/ p. 24 in Spec)
--
--
-- 2. Issues a warning if more than one definition is provided for the same
--    attribute of a given element type. Fist declaration is binding, later
--    definitions are ignored.
--
--    Optional warning: (3.3 \/ p.24 in Spec)
--
--
-- 3. Issues a warning if the same Nmtoken occures more than once in enumerated
--    attribute types of a single element type.
--
--    Optional warning: (3.3.1 \/ p.27 in Spec)
--
--
-- 4. Validates that an element type has not more than one ID attribute defined.
--
--    Validity constraint: One ID per Element Type (3.3.1 \/ p.26 in Spec)
--
--
-- 5. Validates that an element type has not more than one NOTATION attribute defined.
--
--    Validity constraint: One Notation per Element Type (3.3.1 \/ p.27 in Spec)
--
--
-- 6. Validates that an ID attributes has the type #IMPLIED or #REQUIRED.
--
--    Validity constraint: ID Attribute Default (3.3.1 \/ p.26 in Spec)
--
--
-- 7. Validates that all referenced notations are declared.
--
--    Validity constraint: Notation Attributes (3.3.1 \/ p.27 in Spec)
--
--
-- 8. Validates that notations are not declared for EMPTY elements.
--
--    Validity constraint: No Notation on Empty Element (3.3.1 \/p.27 in Spec)
--
--
-- 9. Validates that the default value matches the lexical constraints of it's type.
--
--    Validity constraint: Attribute default legal (3.3.2 \/ p.28 in Spec)
--
--
--    * 1.parameter dtdPart :  the children of the @DOCTYPE@ node
--
--    - 2.parameter elemNames :  list of all element names declared in the DTD
--
--    - 3.parameter notationNames :  list of all notation names declared in the DTD
--
--    - returns : a list of errors

validateAttributes :: [String] -> [String] -> LA XmlTrees XmlTree
validateAttributes elemNames notationNames
    = -- 1. Find attributes for which no elements are declared
      ( runCheck this (checkDeclaredElements elemNames) )
      <+>
      -- 2. Find attributes which are declared more than once
      ( runNameCheck this checkForUniqueAttributeDeclaration )
      <+>
      -- 3. Find enumerated attribute types which nmtokens are declared more than once
      ( runCheck (isEnumAttrType `orElse` isNotationAttrType) checkEnumeratedTypes )
      <+>
      -- 4. Validate that there exists only one ID attribute for an element
      ( runNameCheck isIdAttrType checkForUniqueId )
      <+>
      -- 5. Validate that there exists only one NOTATION attribute for an element
      ( runNameCheck isNotationAttrType checkForUniqueNotation )
      <+>
      -- 6. Validate that ID attributes have the type #IMPLIED or #REQUIRED
      ( runCheck isIdAttrType checkIdKindConstraint )
      <+>
      -- 7. Validate that all referenced notations are declared
      ( runCheck isNotationAttrType (checkNotationDeclaration notationNames) )
      <+>
      -- 8. Validate that notations are not declared for EMPTY elements
      ( checkNoNotationForEmptyElements $< listA ( unlistA
						   >>>
						   isEmptyElement
						   >>>
						   getDTDAttrValue a_name
						 )
      )
      <+>
      -- 9. Validate that the default value matches the lexical constraints of it's type
      ( checkDefaultValueTypes $< this )

      where
      -- ------------------------------------------------------------
      -- control structures

      runCheck select check
	  = unlistA >>> isDTDAttlist
	    >>>
	    select
	    >>>
	    (check $< getDTDAttrl)

      runNameCheck select check
	  = fromSLA [] $ runCheck select check

      --------------------------------------------------------------------------

      -- 1. Find attributes for which no elements are declared

      checkDeclaredElements :: [String] -> Attributes -> XmlArrow
      checkDeclaredElements elemNames' al
	  | en `elem` elemNames'
	      = none
	  | otherwise
	      = warn ( "The element type \""++ en ++ "\" used in dclaration "++
		       "of attribute \""++ an ++"\" is not declared."
		     )
	  where
	  en = dtd_name al
	  an = dtd_value al

      --------------------------------------------------------------------------

      -- 2. Find attributes which are declared more than once

      checkForUniqueAttributeDeclaration ::  Attributes -> SLA [String] XmlTree XmlTree
      checkForUniqueAttributeDeclaration al
	  = checkName name $
	    warn ( "Attribute \""++ aname ++"\" for element type \""++
		   ename ++"\" is already declared. First "++
		   "declaration will be used." )
	  where
	  ename = dtd_name al
	  aname = dtd_value al
	  name  = ename ++ "|" ++ aname

      --------------------------------------------------------------------------

      -- 3. Find enumerated attribute types which nmtokens are declared more than once

      checkEnumeratedTypes :: Attributes -> XmlArrow
      checkEnumeratedTypes al
          = fromSLA [] ( getChildren
			 >>>
			 isDTDName
			 >>>
			 (checkForUniqueType $< getDTDAttrl)
		       )
	  where
	  checkForUniqueType :: Attributes -> SLA [String] XmlTree XmlTree
          checkForUniqueType al'
	      = checkName nmtoken $
	        warn ( "Nmtoken \""++ nmtoken ++"\" should not "++
		       "occur more than once in attribute \""++ dtd_value al ++
		       "\" for element \""++ dtd_name al ++ "\"." )
	      where
	      nmtoken = dtd_name al'

      --------------------------------------------------------------------------

      -- 4. Validate that there exists only one ID attribute for an element

      checkForUniqueId :: Attributes -> SLA [String] XmlTree XmlTree
      checkForUniqueId al
	  = checkName ename $
	    err ( "Element \""++ ename ++ "\" already has attribute of type "++
		  "ID, another attribute \""++ dtd_value al ++ "\" of type ID is "++
		  "not permitted." )
	  where
	  ename = dtd_name al

      --------------------------------------------------------------------------

      -- 5. Validate that there exists only one NOTATION attribute for an element

      checkForUniqueNotation :: Attributes -> SLA [String] XmlTree XmlTree
      checkForUniqueNotation al
	  = checkName ename $
	    err ( "Element \""++ ename ++ "\" already has attribute of type "++
		  "NOTATION, another attribute \""++ dtd_value al ++ "\" of type NOTATION "++
		  "is not permitted." )
	  where
	  ename = dtd_name al

      --------------------------------------------------------------------------

      -- 6. Validate that ID attributes have the type #IMPLIED or #REQUIRED

      checkIdKindConstraint :: Attributes -> XmlArrow
      checkIdKindConstraint al
	  | attKind `elem` [k_implied, k_required]
	      = none
	  | otherwise
	      = err ( "ID attribute \""++ dtd_value al ++"\" must have a declared default "++
	              "of \"#IMPLIED\" or \"REQUIRED\"")
	  where
	  attKind = dtd_kind al

      --------------------------------------------------------------------------

      -- 7. Validate that all referenced notations are declared

      checkNotationDeclaration :: [String] -> Attributes -> XmlArrow
      checkNotationDeclaration notations al
          = getChildren
	    >>>
	    isDTDName
	    >>>
	    (checkNotations $< getDTDAttrl)
	  where
	  checkNotations :: Attributes -> XmlArrow
	  checkNotations al'
	      | notation `elem` notations
		  = none
	      | otherwise
		  = err ( "The notation \""++ notation ++"\" must be declared when "++
		          "referenced in the notation type list for attribute \""++ dtd_value al ++
			  "\" of element \""++ dtd_name al ++"\"."
			)
              where
	      notation = dtd_name al'

      --------------------------------------------------------------------------

      -- 8. Validate that notations are not declared for EMPTY elements

      checkNoNotationForEmptyElements :: [String] -> LA XmlTrees XmlTree
      checkNoNotationForEmptyElements emptyElems
	  = unlistA
	    >>>
	    isDTDAttlist
	    >>>
	    isNotationAttrType
	    >>>
	    (checkNoNotationForEmptyElement $< getDTDAttrl)
	  where
	  checkNoNotationForEmptyElement :: Attributes -> XmlArrow
	  checkNoNotationForEmptyElement al
	      | ename `elem` emptyElems
		  = err ( "Attribute \""++ dtd_value al ++"\" of type NOTATION must not be "++
			  "declared on the element \""++ ename ++"\" declared EMPTY."
			)
              | otherwise
		  = none
	      where
	      ename = dtd_name al

      --------------------------------------------------------------------------

      -- 9. Validate that default values meet the lexical constraints of the attribute types

      checkDefaultValueTypes :: XmlTrees -> LA XmlTrees XmlTree
      checkDefaultValueTypes dtdPart'
	  = unlistA >>> isDTDAttlist
	    >>>
	    isDefaultAttrKind
	    >>>
            (checkAttributeValue dtdPart' $< this)

-- ------------------------------------------------------------

-- |
-- Removes doublicate declarations from the DTD, which first declaration is
-- binding. This is the case for ATTLIST and ENTITY declarations.
--
--    - returns : A function that replaces the children of DOCTYPE nodes by a list
--               where all multiple declarations are removed.

removeDoublicateDefs :: XmlArrow
removeDoublicateDefs
    = replaceChildren
      ( fromSLA [] ( getChildren
		     >>>
		     choiceA [ isDTDAttlist :-> (removeDoubleAttlist $< getDTDAttrl)
			     , isDTDEntity  :-> (removeDoubleEntity  $< getDTDAttrl)
			     , this         :-> this
			     ]
		   )
      )
      `when`
      isDTDDoctype
    where
    checkName' n'
	= ifA ( getState
		>>>
		isA (n' `elem`)
	      )
	  none
	  (this >>> perform (nextState (n':)))

    removeDoubleAttlist :: Attributes -> SLA [String] XmlTree XmlTree
    removeDoubleAttlist al
	= checkName' elemAttr
	where
	elemAttr = elemName ++ "|" ++ attrName
	attrName = dtd_value al
	elemName = dtd_name al

    removeDoubleEntity	:: Attributes -> SLA [String] XmlTree XmlTree
    removeDoubleEntity al
        = checkName' (dtd_name al)

-- ------------------------------------------------------------


text:
export default function (store, bun, mayo) {
  return function consume(action) {
    return bun(store.dispatch(mayo(action)));
  };
}


text:
package main

import (
	"bufio"
	"database/sql"
	"encoding/csv"
	"fmt"
	"io"
	"log"
	"os"
	"regexp"
	"strconv"
	"strings"

	humanize "github.com/dustin/go-humanize"
	"github.com/lannonbr/MirrorBandwidthStats/models"
	_ "github.com/mattn/go-sqlite3"
)

func cleanupBytes(str string) string {
	return strings.TrimSuffix(str, ".0")
}

func loadBandwidthCSV(filename string) []models.BandwidthEntry {
	csvfile, _ := os.Open(filename)
	reader := csv.NewReader(bufio.NewReader(csvfile))
	reader.Comment = '"'

	entries := []models.BandwidthEntry{}

	for {
		line, err := reader.Read()
		if err == io.EOF {
			break
		}
		if err != nil {
			log.Fatalln("Error reading csv line", err)
		}

		recv, _ := strconv.ParseUint(cleanupBytes(line[0]), 10, 64)
		send, _ := strconv.ParseUint(cleanupBytes(line[1]), 10, 64)

		entries = append(entries, models.BandwidthEntry{
			Recv:      recv,
			Send:      send,
			Timestamp: line[2],
		})
	}

	return entries
}

func humanizeBits(bits uint64) string {
	str := humanize.Bytes(bits)
	strArr := strings.Split(str, " ")
	str = strArr[0] + string([]rune(strArr[1])[0]) + "b"
	return str
}

func analyzeFile(filename string, fullPrint bool) (uint64, uint64, uint64, uint64) {
	entries := loadBandwidthCSV(filename)

	var totalRecv, totalSend uint64

	for _, entry := range entries {
		totalRecv += entry.Recv
		totalSend += entry.Send
	}

	totalOverall := totalRecv + totalSend

	rate := ((totalRecv + totalSend) * 8) / 3550

	if fullPrint {
		humanRecv := humanize.Bytes(totalRecv)
		humanSend := humanize.Bytes(totalSend)
		humanOverall := humanize.Bytes(totalOverall)

		fmt.Println("Filename:", filename)

		fmt.Println("Total Received:", humanRecv)
		fmt.Println("Total Sent:", humanSend)
		fmt.Println("Total overall:", humanOverall)
		fmt.Println("Rate:", humanizeBits(rate)+"/sec")
		fmt.Println("------------")
	}

	return totalRecv, totalSend, totalOverall, rate
}

func prettyPrint(date string, totalRecv, totalSend, totalOverall, avgRate uint64) {
	fmt.Printf("Timestamp: %v\n", date)
	fmt.Println("------------")
	fmt.Println("Recieved:", humanize.Bytes(totalRecv))
	fmt.Println("Sent:", humanize.Bytes(totalSend))
	fmt.Println("Overall:", humanize.Bytes(totalOverall))
	fmt.Println("Rate:", humanizeBits(avgRate)+"/sec")
}

func csvPrint(date string, totalRecv, totalSend, totalOverall, avgRate uint64) {
	fmt.Printf("%s,%s,%s,%s,%s\n", date, humanize.Bytes(totalRecv), humanize.Bytes(totalSend), humanize.Bytes(totalOverall), humanizeBits(avgRate)+"/sec")
}

func csvPrintRaw(date string, totalRecv, totalSend, totalOverall, avgRate uint64) {
	fmt.Printf("%s,%d,%d,%d,%d\n", date, totalRecv, totalSend, totalOverall, avgRate)
}

func sqlOutputHour(date string, totalRecv, totalSend, avgRate uint64) {

	avgRateMB := float64(avgRate) / 1000000

	db, err := sql.Open("sqlite3", "./mirrorband.sqlite")
	if err != nil {
		fmt.Println(err)
	}

	sqlStr := fmt.Sprintf("INSERT INTO hour (time, rx, tx, rate) VALUES (\"%s\", %d, %d, %f)", date, totalRecv, totalSend, avgRateMB)
	if _, err = db.Exec(sqlStr); err != nil {
		fmt.Println(err)
	}
}

func sqlOutputDay(date string, totalRecv, totalSend, avgRate uint64) {

	avgRateMB := float64(avgRate) / 1000000
	var time, sqlStr string

	db, err := sql.Open("sqlite3", "./mirrorband.sqlite")
	if err != nil {
		fmt.Println(err)
	}

	row, err := db.Query("SELECT time FROM day ORDER BY id DESC LIMIT 1")
	if err != nil {
		fmt.Println(err)
	}

	if !row.Next() {
		// nothing in the database
		sqlStr = fmt.Sprintf("INSERT INTO day (time, rx, tx, rate) VALUES (\"%s\", %d, %d, %f)", date, totalRecv, totalSend, avgRateMB)
		if _, err = db.Exec(sqlStr); err != nil {
			fmt.Println(err)
		}
		row.Close()
	} else {
		if err = row.Scan(&time); err != nil {
			fmt.Println(err)
		}
		row.Close()

		if strings.Compare(time, date) == 0 {
			sqlStr = fmt.Sprintf("UPDATE day SET rx=%d, tx=%d, rate=%f WHERE time=\"%s\"", totalRecv, totalSend, avgRateMB, date)
			if _, err = db.Exec(sqlStr); err != nil {
				fmt.Println(err)
			}
		} else {
			sqlStr = fmt.Sprintf("INSERT INTO day (time, rx, tx, rate) VALUES (\"%s\", %d, %d, %f)", date, totalRecv, totalSend, avgRateMB)
			if _, err = db.Exec(sqlStr); err != nil {
				fmt.Println(err)
			}
		}
	}
}

func sqlOutputMonth(date string, totalRecv, totalSend, avgRate uint64) {

	avgRateMB := float64(avgRate) / 1000000
	var time, sqlStr string

	db, err := sql.Open("sqlite3", "./mirrorband.sqlite")
	if err != nil {
		fmt.Println(err)
	}

	row, err := db.Query("SELECT time FROM month ORDER BY id DESC LIMIT 1")
	if err != nil {
		fmt.Println("SELECT error:", err)
	}

	if !row.Next() {
		// nothing in the database
		sqlStr = fmt.Sprintf("INSERT INTO month (time, rx, tx, rate) VALUES (\"%s\", %d, %d, %f)", date, totalRecv, totalSend, avgRateMB)
		if _, err = db.Exec(sqlStr); err != nil {
			fmt.Println("Insert Err 1:", err)
		}
		row.Close()
	} else {
		if err = row.Scan(&time); err != nil {
			fmt.Println("Try grabbing time err:", err)
		}
		row.Close()

		if strings.Compare(time, date) == 0 {
			sqlStr = fmt.Sprintf("UPDATE month SET rx=%d, tx=%d, rate=%f WHERE time=\"%s\"", totalRecv, totalSend, avgRateMB, date)
			if _, err = db.Exec(sqlStr); err != nil {
				fmt.Println("Update err:", err)
			}
		} else {
			sqlStr = fmt.Sprintf("INSERT INTO month (time, rx, tx, rate) VALUES (\"%s\", %d, %d, %f)", date, totalRecv, totalSend, avgRateMB)
			fmt.Println(sqlStr)
			if _, err = db.Exec(sqlStr); err != nil {
				fmt.Println("Insert Err 2:", err)
			}
		}
	}
}

func sqlOutputAggregate(date string, totalOverall uint64) {
	var time, sqlStr string

	db, err := sql.Open("sqlite3", "./mirrorband.sqlite")
	if err != nil {
		fmt.Println(err)
	}

	row, err := db.Query("SELECT time FROM agg ORDER BY id DESC LIMIT 1")
	if err != nil {
		fmt.Println("Select error:", err)
	}

	if !row.Next() {
		//Nothing in table
		sqlStr = fmt.Sprintf("INSERT INTO agg (time, total) VALUES (\"%s\", %d)", date, totalOverall)
		if _, err = db.Exec(sqlStr); err != nil {
			fmt.Println("Insert Err 1:", err)
		}
		row.Close()
	} else {
		if err = row.Scan(&time); err != nil {
			fmt.Println("Error: Failed trying to grab time:", err)
		}
		row.Close()

		if strings.Compare(time, date) == 0 {
			sqlStr = fmt.Sprintf("UPDATE agg SET total=%d WHERE time=\"%s\"", totalOverall, date)
			if _, err = db.Exec(sqlStr); err != nil {
				fmt.Println("Update err:", err)
			}
		} else {
			sqlStr = fmt.Sprintf("INSERT INTO agg (time, total) VALUES (\"%s\", %d)", date, totalOverall)
			fmt.Println(sqlStr)
			if _, err = db.Exec(sqlStr); err != nil {
				fmt.Println("Insert Err 2:", err)
			}
		}
	}

}

func main() {

	if len(os.Args) < 3 {
		log.Fatalln("Error: Not enough arguments. (Format: './MirrorBandwidthStats <format> <files>')")
		os.Exit(1)
	}

	format := os.Args[1]
	files := os.Args[2:]

	dateRegex, _ := regexp.Compile("([A-Z][a-z]{2,3})-([\\d]{1,2})-([\\d]{4})_([\\d]{2})")

	arr := dateRegex.FindStringSubmatch(files[0])

	month, day, year, hour := arr[1], arr[2], arr[3], arr[4]

	date := fmt.Sprintf("%s/%s/%s", month, day, year)
	dateWithHour := fmt.Sprintf("%s/%s/%s %s:00", month, day, year, hour)
	dateMonth := fmt.Sprintf("%s/%s", month, year)

	fmt.Println(dateMonth)

	var counter int

	var totalRecv, totalSend, totalOverall, totalRate, avgRate uint64

	for _, arg := range files {
		recv, send, overall, rate := analyzeFile(arg, false)
		counter++

		totalRecv += recv
		totalSend += send
		totalOverall += overall

		totalRate += rate
	}

	avgRate = totalRate / uint64(counter)

	switch format {
	//Pretty Printed Formats
	case "pretty_month":
		prettyPrint(dateMonth, totalRecv, totalSend, totalOverall, avgRate)
	case "pretty_day":
		prettyPrint(date, totalRecv, totalSend, totalOverall, avgRate)
	case "pretty_hour":
		prettyPrint(dateWithHour, totalRecv, totalSend, totalOverall, avgRate)
	// CSV Formats
	case "csv_month":
		csvPrint(dateMonth, totalRecv, totalSend, totalOverall, avgRate)
	case "csv_day":
		csvPrint(date, totalRecv, totalSend, totalOverall, avgRate)
	case "csv_hour":
		csvPrint(dateWithHour, totalRecv, totalSend, totalOverall, avgRate)
	// Raw CSV (No humanized entries)
	case "csv_month_raw":
		csvPrintRaw(dateMonth, totalRecv, totalSend, totalOverall, avgRate)
	case "csv_day_raw":
		csvPrintRaw(date, totalRecv, totalSend, totalOverall, avgRate)
	case "csv_hour_raw":
		csvPrintRaw(dateWithHour, totalRecv, totalSend, totalOverall, avgRate)
	// Output to SQL
	case "sql_hour":
		sqlOutputHour(dateWithHour, totalRecv, totalSend, avgRate)
	case "sql_day":
		sqlOutputDay(date, totalRecv, totalSend, avgRate)
	case "sql_month":
		sqlOutputMonth(dateMonth, totalRecv, totalSend, avgRate)
	case "sql_agg":
		sqlOutputAggregate(dateMonth, totalOverall)
	}
}


text:
<?php

namespace DvsaMotApi\Factory;

use Doctrine\ORM\EntityManager;
use DvsaEntities\Entity\CertificateReplacementDraft;
use DvsaEntities\Repository\ReplacementCertificateDraftRepository;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

class ReplacementCertificateDraftRepositoryFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this($serviceLocator, ReplacementCertificateDraftRepository::class);
    }

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        return $container->get(EntityManager::class)->getRepository(CertificateReplacementDraft::class);
    }
}


text:
package org.minijax.undertow;

import java.util.List;

import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;

import org.minijax.rs.MinijaxHttpHeaders;

import io.undertow.util.HeaderMap;
import io.undertow.util.HttpString;

class MinijaxUndertowHttpHeaders extends MinijaxHttpHeaders {
    private final HeaderMap headerMap;
    private MultivaluedMap<String, String> requestHeaders;

    public MinijaxUndertowHttpHeaders(final HeaderMap headerMap) {
        this.headerMap = headerMap;
    }

    @Override
    public List<String> getRequestHeader(final String name) {
        return headerMap.get(name);
    }

    @Override
    public String getHeaderString(final String name) {
        return headerMap.getFirst(name);
    }

    @Override
    public MultivaluedMap<String, String> getRequestHeaders() {
        if (requestHeaders == null) {
            requestHeaders = new MultivaluedHashMap<>();
            for (final HttpString name : headerMap.getHeaderNames()) {
                requestHeaders.put(name.toString(), headerMap.get(name));
            }
        }
        return requestHeaders;
    }
}


text:
import AppStyle from '@dg/components/AppStyle';
import BaseApp, { AppContext, AppProps } from 'next/app';

/**
 * Responsible for injecting styles into the tree client-side.
 */
const App = ({ Component, pageProps }: AppProps) => (
  <>
    <AppStyle />
    <Component {...pageProps} />
  </>
);

// Helps Sentry via https://github.com/isaachinman/next-i18next/issues/615#issuecomment-575578375
export const getInitialProps = async (appContext: AppContext) => {
  const appProps = await BaseApp.getInitialProps(appContext);
  return { ...appProps };
};

export default App;


text:
namespace mas {
namespace mesh {

class TriangleIntersector;
class TriangleLineIntersection;
class TrianglePlaneIntersection;
class TriangleTriangleIntersection;
class BVIntersector;

using namespace bvtree;

class TriangleIntersector {
private:
	double epsilon;

private:
	int check_min_max (
      const Vector3d& p1, const Vector3d& q1, const Vector3d& r1,
		const Vector3d& p2, const Vector3d& q2, const Vector3d& r2) const;
	int construct_intersection (
      const Vector3d& p1, const Vector3d& q1, const Vector3d& r1,
		const Vector3d& p2, const Vector3d& q2, const Vector3d& r2,
		std::vector<Point3d>& pnts) const;
	int tri_tri_inter_3d (
      const Vector3d& p1, const Vector3d& q1, const Vector3d& r1,
		const Vector3d& p2, const Vector3d& q2, const Vector3d& r2,
		double dp2, double dq2, double dr2, std::vector<Point3d>& pnts) const;
public:
	TriangleIntersector();
	TriangleIntersector(double eps);

	void setEpsilon(double eps);
	double getEpsilon() const;

	int intersectTriangleTriangle (
		const Vector3d& p1, const Vector3d& q1, const Vector3d& r1,
		const Vector3d& p2, const Vector3d& q2, const Vector3d& r2,
		std::vector<Point3d>& pnts) const;
	int intersectTriangleLine (
      const Point3d& v0, const Point3d& v1, const Point3d& v2,
	  const Point3d& pos, const Vector3d& dir, Vector3d& duv) const;
	int intersectTrianglePlane(const Point3d& p0, const Point3d& p1,
      const Point3d& p2, const Plane& plane, std::vector<Point3d>& pnts) const;
	double nearestpoint (
      const Point3d& v0, const Point3d& v1, const Point3d& v2, const Point3d& p,
		Point3d& closest, Vector3d& duv) const;

};

class TriangleLineIntersection {
public:
	SharedPolygon face;
	std::shared_ptr<Line> line;
	std::vector<Point3d> points;

public:
	TriangleLineIntersection(const SharedPolygon& face, const std::shared_ptr<Line>& line,
		std::vector<Point3d>&& points);
};

class TrianglePlaneIntersection {
public:
	SharedPolygon face;
	std::shared_ptr<Plane> plane;
	std::vector<Point3d> points;

public:
	TrianglePlaneIntersection(const SharedPolygon& face, const std::shared_ptr<Plane>& plane,
		std::vector<Point3d>&& pnts);
};

class TriangleTriangleIntersection {
public:
	SharedPolygon triangle0;
	SharedPolygon triangle1;
	std::vector<Point3d> points;

public:
	TriangleTriangleIntersection(const SharedPolygon& tri0, const SharedPolygon& tri1,
		std::vector<Point3d>&& pnts);
};

class BVIntersector {
private:
 	double epsilon;
    TriangleIntersector myTriIntersector;

    // vectors for storing transformed triangle vertices
    Point3d myP0, myP1, myP2;
private:
    template<typename BV1, typename BV2>
	void intersectBoundingVolumeTriangles (
      std::vector<TriangleTriangleIntersection>& intersections,
      const BVNode<SharedBoundablePolygon,BV1>& node1,
      const BVNode<SharedBoundablePolygon,BV2>& node2) const;
    template<typename BV>
	void intersectBoundingVolumeTriangleLines (
      std::vector<TriangleLineIntersection>& intersections,
      const BVNode<SharedBoundablePolygon,BV>& node, const Line& l) const;
    template<typename BV>
	void intersectBoundingVolumeTrianglePlanes (
      std::vector<TrianglePlaneIntersection>& intersections,
      const BVNode<SharedBoundablePolygon,BV>& node, const Plane& p) const;

public:
	BVIntersector();
	BVIntersector(double epsilon);

	void setEpsilon(double eps);
	double getEpsilon();

	template<typename BV = OBB>
	std::vector<TriangleTriangleIntersection> intersectMeshMesh (
      const PolygonMesh& mesh1, const PolygonMesh& mesh2) const;

	template<typename BV1, typename BV2>
	std::vector<TriangleTriangleIntersection> intersectMeshMesh (
      const BVTree<SharedBoundablePolygon,BV1>& bvh1,
      const BVTree<SharedBoundablePolygon,BV2>& bvh2) const;

	template<typename BV = OBB>
    std::vector<TrianglePlaneIntersection> intersectMeshPlane (
      const PolygonMesh& mesh, const Plane& plane) const;
	template<typename BV>
    std::vector<TrianglePlaneIntersection> intersectMeshPlane (
      const BVTree<SharedBoundablePolygon,BV>& bvh, const Plane& plane) const;

	template<typename BV = OBB>
	std::vector<TriangleLineIntersection> intersectMeshLine (
	      const PolygonMesh& mesh, const Line& line) const;
	template<typename BV>
	std::vector<TriangleLineIntersection> intersectMeshLine (
    	const BVTree<SharedBoundablePolygon,BV>& bvh, const Line& line) const;

};

}
}

#include "mas/mesh/meshbv_intersector.hpp"

#endif


text:
package all

import (
	"context"
	"fmt"
	"testing"

	"github.com/benbjohnson/clock"
	"github.com/influxdata/influxdb/v2"
	"github.com/influxdata/influxdb/v2/inmem"
	"github.com/influxdata/influxdb/v2/kv"
	"github.com/influxdata/influxdb/v2/kv/migration"
	"go.uber.org/zap/zaptest"
)

func Test_(t *testing.T) {
	ctx, cancelFunc := context.WithCancel(context.Background())
	defer cancelFunc()

	ts := newService(t, ctx)

	taskBucket := []byte("tasksv1")
	id := "05da585043e02000"
	// create a task that has auth set and no ownerID
	err := ts.Store.Update(context.Background(), func(tx kv.Tx) error {
		b, err := tx.Bucket(taskBucket)
		if err != nil {
			t.Fatal(err)
		}
		taskBody := fmt.Sprintf(`{"id":"05da585043e02000","type":"system","orgID":"05d3ae3492c9c000","org":"whos","authorizationID":"%s","name":"asdf","status":"active","flux":"option v = {\n  bucket: \"bucks\",\n  timeRangeStart: -1h,\n  timeRangeStop: now()\n}\n\noption task = { \n  name: \"asdf\",\n  every: 5m,\n}\n\nfrom(bucket: \"_monitoring\")\n  |\u003e range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |\u003e filter(fn: (r) =\u003e r[\"_measurement\"] == \"boltdb_reads_total\")\n  |\u003e filter(fn: (r) =\u003e r[\"_field\"] == \"counter\")\n  |\u003e to(bucket: \"bucks\", org: \"whos\")","every":"5m","latestCompleted":"2020-06-16T17:01:26.083319Z","latestScheduled":"2020-06-16T17:01:26.083319Z","lastRunStatus":"success","createdAt":"2020-06-15T19:10:29Z","updatedAt":"0001-01-01T00:00:00Z"}`, ts.Auth.ID.String())
		err = b.Put([]byte(id), []byte(taskBody))

		if err != nil {
			t.Fatal(err)
		}
		return nil
	})
	if err != nil {
		t.Fatal(err)
	}

	err = Migration0003_TaskOwnerIDUpMigration.Up(context.Background(), ts.Store)
	if err != nil {
		t.Fatal(err)
	}

	idType, _ := influxdb.IDFromString(id)
	task, err := ts.Service.FindTaskByID(context.Background(), *idType)
	if err != nil {
		t.Fatal(err)
	}
	if task.OwnerID != ts.User.ID {
		t.Fatal("failed to fill in ownerID")
	}

	// create a task that has no auth or owner id but a urm exists
	err = ts.Store.Update(context.Background(), func(tx kv.Tx) error {
		b, err := tx.Bucket([]byte("tasksv1"))
		if err != nil {
			t.Fatal(err)
		}
		taskBody := fmt.Sprintf(`{"id":"05da585043e02000","type":"system","orgID":"%s","org":"whos","name":"asdf","status":"active","flux":"option v = {\n  bucket: \"bucks\",\n  timeRangeStart: -1h,\n  timeRangeStop: now()\n}\n\noption task = { \n  name: \"asdf\",\n  every: 5m,\n}\n\nfrom(bucket: \"_monitoring\")\n  |\u003e range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |\u003e filter(fn: (r) =\u003e r[\"_measurement\"] == \"boltdb_reads_total\")\n  |\u003e filter(fn: (r) =\u003e r[\"_field\"] == \"counter\")\n  |\u003e to(bucket: \"bucks\", org: \"whos\")","every":"5m","latestCompleted":"2020-06-16T17:01:26.083319Z","latestScheduled":"2020-06-16T17:01:26.083319Z","lastRunStatus":"success","createdAt":"2020-06-15T19:10:29Z","updatedAt":"0001-01-01T00:00:00Z"}`, ts.Org.ID.String())
		err = b.Put([]byte(id), []byte(taskBody))
		if err != nil {
			t.Fatal(err)
		}

		return nil
	})
	if err != nil {
		t.Fatal(err)
	}

	err = Migration0003_TaskOwnerIDUpMigration.Up(context.Background(), ts.Store)
	if err != nil {
		t.Fatal(err)
	}

	task, err = ts.Service.FindTaskByID(context.Background(), *idType)
	if err != nil {
		t.Fatal(err)
	}
	if task.OwnerID != ts.User.ID {
		t.Fatal("failed to fill in ownerID")
	}
}

type testService struct {
	Store   kv.SchemaStore
	Service *kv.Service
	Org     influxdb.Organization
	User    influxdb.User
	Auth    influxdb.Authorization
	Clock   clock.Clock
}

func newService(t *testing.T, ctx context.Context) *testService {
	t.Helper()

	var (
		ts = &testService{
			Store: inmem.NewKVStore(),
		}
		logger = zaptest.NewLogger(t)
	)

	// apply migrations up to (but not including) this one
	migrator, err := migration.NewMigrator(logger, ts.Store, Migrations[:2]...)
	if err != nil {
		t.Fatal(err)
	}

	if err := migrator.Up(ctx); err != nil {
		t.Fatal(err)
	}

	ts.Service = kv.NewService(logger, ts.Store)

	ts.User = influxdb.User{Name: t.Name() + "-user"}
	if err := ts.Service.CreateUser(ctx, &ts.User); err != nil {
		t.Fatal(err)
	}
	ts.Org = influxdb.Organization{Name: t.Name() + "-org"}
	if err := ts.Service.CreateOrganization(ctx, &ts.Org); err != nil {
		t.Fatal(err)
	}

	if err := ts.Service.CreateUserResourceMapping(ctx, &influxdb.UserResourceMapping{
		ResourceType: influxdb.OrgsResourceType,
		ResourceID:   ts.Org.ID,
		UserID:       ts.User.ID,
		UserType:     influxdb.Owner,
	}); err != nil {
		t.Fatal(err)
	}

	ts.Auth = influxdb.Authorization{
		OrgID:       ts.Org.ID,
		UserID:      ts.User.ID,
		Permissions: influxdb.OperPermissions(),
	}
	if err := ts.Service.CreateAuthorization(context.Background(), &ts.Auth); err != nil {
		t.Fatal(err)
	}

	return ts
}


text:
import React from 'react'
import Modal from 'react-modal'
const AddVideoModal = (props) => {
  return (
    <Modal isOpen={props.modalIsOpen} onRequestClose={() => props.onRequestClose()}>
      <div>
        <input type="text" onChange={ event => props.handleVideoSearchChange(event.target.value)} value={props.selectedVideo}/>
        <button type="button" onClick={() => props.selectVideo()}>Add Video</button>
      </div>
    </Modal>
  )
}

export default AddVideoModal


text:
import Enum from '../../lib/Enum';

export default new Enum([
  'idle',
  'connecting',
], 'softphone');


text:
require 'xdr'

# === xdr source ============================================================
#
#   enum AccountFlags
#   { // masks for each flag
#
#       // if set, TrustLines are created with authorized set to "false"
#       // requiring the issuer to set it for each TrustLine
#       AUTH_REQUIRED_FLAG = 0x1,
#       // if set, the authorized flag in TrustLines can be cleared
#       // otherwise, authorization cannot be revoked
#       AUTH_REVOCABLE_FLAG = 0x2
#   };
#
# ===========================================================================
module Stellar
  class AccountFlags < XDR::Enum
    member :auth_required_flag,  1
    member :auth_revocable_flag, 2

    seal
  end
end


text:
package edu.northwestern.bioinformatics.ctmssuite.authorization.ruby.internal;

import org.osgi.framework.Bundle;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedServiceFactory;

import java.util.Dictionary;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Rhett Sutphin
 */
@SuppressWarnings({ "RawUseOfParameterizedType" })
public class RubySuiteAuthorizationSourceFactory implements ManagedServiceFactory {
    public static final String FACTORY_PID = "ctmssuite.authorization.ruby";

    private Map<String, RubySuiteAuthorizationSourceManager> managers;
    private final Bundle homeBundle;

    public RubySuiteAuthorizationSourceFactory(Bundle homeBundle) {
        this.homeBundle = homeBundle;
        this.managers = new HashMap<String, RubySuiteAuthorizationSourceManager>();
    }

    @Override
    public String getName() {
        return "Factory for ruby-implemented SuiteAuthorizationSources";
    }

    @Override
    public void updated(String pid, Dictionary properties) throws ConfigurationException {
        String path = (String) properties.get("sourceScript");
        if (managers.containsKey(pid)) {
            managers.get(pid).updateSourceScript(path);
        } else {
            managers.put(pid, new RubySuiteAuthorizationSourceManager(homeBundle, path));
        }
    }

    @Override
    public void deleted(String pid) {
        if (managers.containsKey(pid)) {
            managers.remove(pid).stop();
        }
    }
}


text:
import proto  # type: ignore

from google.ads.googleads.v11.resources.types import billing_setup

__protobuf__ = proto.module(
    package="google.ads.googleads.v11.services",
    marshal="google.ads.googleads.v11",
    manifest={
        "MutateBillingSetupRequest",
        "BillingSetupOperation",
        "MutateBillingSetupResponse",
        "MutateBillingSetupResult",
    },
)

class MutateBillingSetupRequest(proto.Message):
    r"""Request message for billing setup mutate operations.

    Attributes:
        customer_id (str):
            Required. Id of the customer to apply the
            billing setup mutate operation to.
        operation (google.ads.googleads.v11.services.types.BillingSetupOperation):
            Required. The operation to perform.
    """

    customer_id = proto.Field(proto.STRING, number=1,)
    operation = proto.Field(
        proto.MESSAGE, number=2, message="BillingSetupOperation",
    )

class BillingSetupOperation(proto.Message):
    r"""A single operation on a billing setup, which describes the
    cancellation of an existing billing setup.

    This message has `oneof`_ fields (mutually exclusive fields).
    For each oneof, at most one member field can be set at the same time.
    Setting any member of the oneof automatically clears all other
    members.

    .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

    Attributes:
        create (google.ads.googleads.v11.resources.types.BillingSetup):
            Creates a billing setup. No resource name is
            expected for the new billing setup.

            This field is a member of `oneof`_ ``operation``.
        remove (str):
            Resource name of the billing setup to remove. A setup cannot
            be removed unless it is in a pending state or its scheduled
            start time is in the future. The resource name looks like
            ``customers/{customer_id}/billingSetups/{billing_id}``.

            This field is a member of `oneof`_ ``operation``.
    """

    create = proto.Field(
        proto.MESSAGE,
        number=2,
        oneof="operation",
        message=billing_setup.BillingSetup,
    )
    remove = proto.Field(proto.STRING, number=1, oneof="operation",)

class MutateBillingSetupResponse(proto.Message):
    r"""Response message for a billing setup operation.

    Attributes:
        result (google.ads.googleads.v11.services.types.MutateBillingSetupResult):
            A result that identifies the resource
            affected by the mutate request.
    """

    result = proto.Field(
        proto.MESSAGE, number=1, message="MutateBillingSetupResult",
    )

class MutateBillingSetupResult(proto.Message):
    r"""Result for a single billing setup mutate.

    Attributes:
        resource_name (str):
            Returned for successful operations.
    """

    resource_name = proto.Field(proto.STRING, number=1,)

__all__ = tuple(sorted(__protobuf__.manifest))


text:
Progress: 40%

        Reset

Characters Choose one

{[{character.characterName}]}

Corporation

{[{character.corporation}]}

Alliance

{[{character.alliance}]}

No alliance

                         Choose


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Botryodiplodia majuscula Sacc.

### Remarks
null


text:
package com.facebook.buck.jvm.java.lang.model;

import com.facebook.buck.util.liteinfersupport.Nullable;
import java.util.List;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;

/**
 * Wraps and extends {@link javax.lang.model.util.Elements} with methods that cannot be added as
 * pure extension methods on {@link MoreElements} because they require per-instance state.
 */
public interface ElementsExtended extends Elements {
  List<ExecutableElement> getDeclaredMethods(TypeElement owner, CharSequence name);

  List<ExecutableElement> getAllMethods(TypeElement owner, CharSequence name);

  List<BridgeMethod> getBridgeMethods(TypeElement owner, CharSequence name);

  List<BridgeMethod> getAllBridgeMethods(TypeElement type);

  @Nullable
  ExecutableElement getImplementation(ExecutableElement method, TypeElement inType);

  @Nullable
  TypeElement getBinaryImplementationOwner(ExecutableElement method, TypeElement inType);

  boolean isCompiledInCurrentRun(Element element);
}


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>BulkWorker (worker-framework 10.13.0-SNAPSHOT API)</title>
<meta name="date" content="2016-10-11">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.hpe.caf.api.worker

Interface BulkWorker

public interface BulkWorker

This interface should be implemented by CAF Workers which are able to process
 multiple tasks together.

 It is expected to be implemented by the WorkerFactory object which has been
 supplied by the getWorkerFactory() method of the WorkerFactoryProvider class.

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

void
processTasks(BulkWorkerRuntime runtime)

The Worker should begin processing the tasks.

Method Detail

processTasks

void processTasks(BulkWorkerRuntime runtime)
           throws InterruptedException

The Worker should begin processing the tasks.  It can use the runtime
 object to retrieve the tasks.

Parameters:

runtime - is used to retrieve the tasks

Throws:

InterruptedException - if the thread is interrupted by another
 thread

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2016. All rights reserved.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="0eae8155-302a-47c9-8840-0581cf64197e" name="Default" comment="" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="util.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/util.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="170">
              <caret line="10" column="40" lean-forward="false" selection-start-line="10" selection-start-column="40" selection-end-line="10" selection-end-column="40" />
              <folding>
                <element signature="e#0#13#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="hostAgent.py" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/hostAgent.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="306">
              <caret line="27" column="0" lean-forward="true" selection-start-line="27" selection-start-column="0" selection-end-line="27" selection-end-column="0" />
              <folding>
                <element signature="e#0#11#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Python Script" />
      </list>
    </option>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>.properties</find>
      <find>convert_to_dict</find>
      <find>psutil</find>
      <find>_pswindows</find>
      <find>scputimes</find>
    </findStrings>
    <replaceStrings>
      <replace />
    </replaceStrings>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/entity.py" />
        <option value="$PROJECT_DIR$/main.py" />
        <option value="$PROJECT_DIR$/util.py" />
        <option value="$PROJECT_DIR$/hostAgent.py" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="-8" />
    <option name="y" value="-8" />
    <option name="width" value="1936" />
    <option name="height" value="1056" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="Scratches" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="hostMonitoring" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="hostMonitoring" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="RunManager" selected="Python.hostAgent">
    <configuration default="false" name="util" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="hostMonitoring" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/util.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <option name="EMULATE_TERMINAL" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="main" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="hostMonitoring" />
      <option name="SCRIPT_NAME" value="E:\Source\Python\exe\hostMonitoring\hostAgent.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <option name="EMULATE_TERMINAL" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="hostAgent" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="hostMonitoring" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/hostAgent.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <option name="EMULATE_TERMINAL" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="hostMonitoring" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <option name="EMULATE_TERMINAL" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="Tox" factoryName="Tox">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="hostMonitoring" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Doctests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="hostMonitoring" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Unittests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="hostMonitoring" />
      <option name="_new_additionalArguments" value="""" />
      <option name="_new_target" value=""."" />
      <option name="_new_targetType" value=""PATH"" />
      <method />
    </configuration>
    <list size="3">
      <item index="0" class="java.lang.String" itemvalue="Python.util" />
      <item index="1" class="java.lang.String" itemvalue="Python.main" />
      <item index="2" class="java.lang.String" itemvalue="Python.hostAgent" />
    </list>
    <recent_temporary>
      <list size="3">
        <item index="0" class="java.lang.String" itemvalue="Python.hostAgent" />
        <item index="1" class="java.lang.String" itemvalue="Python.util" />
        <item index="2" class="java.lang.String" itemvalue="Python.main" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="0eae8155-302a-47c9-8840-0581cf64197e" name="Default" comment="" />
      <created>1505899342727</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1505899342727</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.104477614" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.23484848" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32894737" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
      <window_info id="Data View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <breakpoints-dialog>
        <breakpoints-dialog />
      </breakpoints-dialog>
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/util.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1377">
          <caret line="81" column="19" lean-forward="false" selection-start-line="81" selection-start-column="4" selection-end-line="81" selection-end-column="19" />
          <folding>
            <element signature="e#0#13#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/hostAgent.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="408">
          <caret line="28" column="45" lean-forward="true" selection-start-line="28" selection-start-column="45" selection-end-line="28" selection-end-column="45" />
          <folding>
            <element signature="e#0#11#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/util.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1309">
          <caret line="81" column="19" lean-forward="false" selection-start-line="81" selection-start-column="4" selection-end-line="81" selection-end-column="19" />
          <folding>
            <element signature="e#0#13#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python27/Lib/site-packages/psutil/__init__.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1938">
          <caret line="125" column="23" lean-forward="false" selection-start-line="125" selection-start-column="23" selection-end-line="125" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python27/Lib/site-packages/psutil/_pswindows.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="2397">
          <caret line="148" column="15" lean-forward="false" selection-start-line="148" selection-start-column="15" selection-end-line="148" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python27/Lib/collections.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="5151">
          <caret line="304" column="4" lean-forward="false" selection-start-line="304" selection-start-column="4" selection-end-line="304" selection-end-column="4" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/hostAgent.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="578">
          <caret line="34" column="5" lean-forward="true" selection-start-line="34" selection-start-column="5" selection-end-line="34" selection-end-column="5" />
          <folding>
            <element signature="e#0#11#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/entity.py" />
    <entry file="file://C:/Python27/Lib/site-packages/psutil/__init__.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1938">
          <caret line="125" column="23" lean-forward="false" selection-start-line="125" selection-start-column="23" selection-end-line="125" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python27/Lib/collections.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="5151">
          <caret line="304" column="4" lean-forward="false" selection-start-line="304" selection-start-column="4" selection-end-line="304" selection-end-column="4" />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python27/Lib/site-packages/psutil/_pswindows.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="2397">
          <caret line="148" column="15" lean-forward="false" selection-start-line="148" selection-start-column="15" selection-end-line="148" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/util.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="170">
          <caret line="10" column="40" lean-forward="false" selection-start-line="10" selection-start-column="40" selection-end-line="10" selection-end-column="40" />
          <folding>
            <element signature="e#0#13#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/hostAgent.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="306">
          <caret line="27" column="0" lean-forward="true" selection-start-line="27" selection-start-column="0" selection-end-line="27" selection-end-column="0" />
          <folding>
            <element signature="e#0#11#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
  </component>
</project>