text:
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}

module Hal where

import Control.Applicative
import Control.Monad
import Data.Either
import Data.Function
import Data.List
import Data.Maybe
import Data.Traversable
import Safe
import System.FilePath (takeFileName)
import Text.Show.Pretty (ppShow)

import Language.Java.Lexer
import Language.Java.Parser
import Language.Java.Pretty
import Language.Java.Syntax

import HalTypes

p :: Show a => a -> IO ()
p = putStrLn . ppShow

data E = Parse | Analyze deriving Show

parse = parser compilationUnit
compile path = (assert Parse . parse >=> assert Analyze . analyze) <$>
               readFile path
  where
    assert e = either (Left . (e, takeFileName path, ) . show) Right

pattern SingleInterfaceCU id' members <- CompilationUnit _ _ [InterfaceTypeDecl (ResourceInfoSubInterface id' members)]

pattern ResourceInfoSubInterface id' members <- InterfaceDecl _ (Ident id') [] [ClassRefType (ClassType [(Ident "ResourceInfo",[])])] (InterfaceBody members)

pattern SingleClassCU id' members <- CompilationUnit _ _ [ClassTypeDecl (ClassDecl [Public] (Ident id') [] Nothing [] (ClassBody members))]

pattern SingleEnumCU ident consts <- CompilationUnit _ _ [ClassTypeDecl (EnumDecl [Public] (Ident ident) [] (EnumBody consts _))]

pattern Relation k = (Ident "relation", EVVal (InitExp (Lit (String k))))

pattern HTTPMethod name = (Ident "method", EVVal (InitExp (ExpName (Name [Ident "HttpMethodName",Ident name]))))

pattern Link kvs = Annotation (NormalAnnotation {annName = Name [Ident "Link"], annKV = kvs})

pattern JMethod anns ty ident args <- MethodDecl anns [] ty (Ident ident) args [] _

pattern JSomeMethod ident <- MethodDecl _ _ _ (Ident ident) _ _ _

pattern JProperty ty ident <-
  MethodDecl [] [] ty (Ident ('g':'e':'t':ident)) [] [] (MethodBody _)

pattern JPrivateField ty ident = FieldDecl [Private] ty [VarDecl (VarId (Ident ident)) Nothing]

pattern URIParam name ty <- FormalParam
                    [ Annotation
                        NormalAnnotation
                          { annName = Name [ Ident "UriVariable" ]
                          , annKV =
                              [ ( Ident "name" , EVVal (InitExp (Lit (String name))) ) ]
                          }
                    ]
                    ty
                    False
                    _

pattern Param ty <- FormalParam [] ty False _

pattern ClassRef cs = ClassRefType (ClassType cs)
pattern TypeComponent s = (Ident s, [])
pattern ListOf t = [ ( Ident "java" , [] )
                   , ( Ident "util" , [] )
                   , ( Ident "List" , [ ActualType t ] )
                   ]
pattern MapOf k v = [ ( Ident "java" , [] )
                    , ( Ident "util" , [] )
                    , ( Ident "Map" , [ ActualType k, ActualType v ] )
                    ]

apiType :: Type -> APIType
apiType = \case
  RefType r -> ref r
  unk -> error $ "unknown type: " ++ show unk
  where
    ref = \case
      ClassRef (ListOf r) -> List (ref r)
      ClassRef (MapOf k v) -> Map (ref k) (ref v)
      ClassRef xs -> TypeRef (map components xs)
      unk -> error $ "unknown ref type: " ++ show unk

    components = \case
      TypeComponent x -> x
      unk -> error $ "unknown type component: " ++ show unk

analyze (SingleInterfaceCU rName members) = Right $ DeclResource Resource{..}
  where
    rProperties = lefts clsf
    rMethods = rights clsf
    clsf = flip map members $ \case
      (JProperty (Just ty) ident) -> Left (apiType ty, ident)
      (JMethod [Link links] (fmap apiType -> mRetType) mName args) ->
        let
          mRelName = headNote "expected relation in links" [s | Relation s <- links]
          body = case [ty | Param ty <- args] of
            [ty] -> Just (apiType ty)
            [] -> Nothing
            tys -> error $ "can't handle many potential body parameters: " ++ show tys
          needBody = maybe (error "need a body for this request type") id body
          mHTTPMethod = case headDef "GET" [s | HTTPMethod s <- links] of
            "GET" -> GET
            "POST" -> POST needBody
            "PATCH" -> PATCH needBody
            "PUT" -> PUT needBody
            "DELETE" -> DELETE
            unk -> error $ "unknown HTTP method: " ++ unk
          mURIArgs = [(apiType ty, name) | URIParam name ty <- args]
        in Right Method{..}
      member -> error $ "unknown interface member: " ++ show member

analyze (SingleClassCU name members) = Right $ DeclProductType $ APIProductType name props
  where
    -- due to java overloading, this may contain two properties
    -- with different types but equal names
    props = catMaybes $ flip map [m | MemberDecl m <- members] $ \case
      JMethod _ _ ('s':'e':'t':ident) [Param ty] -> Just (apiType ty, ident)
      JSomeMethod s | "with" `isPrefixOf` s ||
                      "get" `isPrefixOf` s ||
                      s `elem` ["hashCode", "toString", "equals"] -> Nothing
      JPrivateField _ _ -> Nothing -- relying from setters
      member -> error $ "unknown class member: " ++ show member

analyze (SingleEnumCU name consts) = Right $ DeclEnum $ APIEnum name members
  where
    members = [(k,v) | EnumConstant (Ident k) [Lit (String v)] _ <- consts]

analyze _ = Left "unknown class"

files = [
    "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Account.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ApiGateway.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ApiKey.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ApiKeys.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/BadRequestException.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/BasePathMapping.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/BasePathMappings.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CacheClusterSize.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CacheClusterStatus.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ClientCertificate.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ClientCertificates.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ConflictException.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateApiKeyInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateBasePathMappingInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateDeploymentInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateDomainNameInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateModelInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateResourceInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateRestApiInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/CreateStageInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Deployment.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Deployments.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/DomainName.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/DomainNames.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/GenerateClientCertificateInput.java"
  --, "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/GetSdkRequest.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Integration.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/IntegrationResponse.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/IntegrationType.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/LimitExceededException.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Method.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/MethodResponse.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/MethodSetting.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/MethodSnapshot.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Model.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Models.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/NotFoundException.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Op.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/PatchDocument.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/PatchOperation.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResponseInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/PutMethodInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/PutMethodResponseInput.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Resource.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Resources.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/RestApi.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/RestApis.java"
  --, "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/SdkResponse.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ServiceUnavailableException.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Stage.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/StageKey.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Stages.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/Template.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/TestInvokeMethodRequest.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/TestInvokeMethodResponse.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/ThrottleSettings.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/TooManyRequestsException.java"
  , "aws-apigateway-sdk-java/src/main/java/com/amazonaws/services/apigateway/model/UnauthorizedException.java"
  ]

redpajama_set_name: RedPajamaGithub


text:
CAD
===

Do you want to redesign any part of the printer? Here you have the CAD files. Easy as pie.

BCN3D is commited to the global Open Source Project REPRAP. It means you can download all the source files, even the designs of the mechanical pieces that compose the printer. The objective is to get faster and better feedback from the community using our printers. If you detect any error or have any improvements, please let us know by creating an Issue in the GitHub Repository.

You will find folders for the BCN3D+, the dual extruder and pretty soon other upgrades. In each folder there is a BOM (bill of materials), a complete Assembly and the printed parts.

>The fun thing with the STL files is that you can preview the models directly within the browser.
Check the feature. [STL Visualization](https://github.com/reprapbcn/CAD/blob/master/upperVertex.STL)


text:
<resources>
    <string name="app_name">simpleplayer_arm64</string>
</resources>


text:
package com.rafamatias.moviest.presentation.view.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.rafamatias.moviest.R;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Reset Password</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="" />
    <meta name="author" content="" />

    <link href="css/bootstrap.css" rel="stylesheet" />
		<link href="css/bootstrap-responsive.css" rel="stylesheet" />
		<link href="css/intlTelInput.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
<link href="https://s3.amazonaws.com/rnfonts/demo.css" rel="stylesheet" type="text/css" />

<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/ico/apple-touch-icon-144-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/ico/apple-touch-icon-114-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/ico/apple-touch-icon-72-precomposed.png" />
<link rel="apple-touch-icon-precomposed" href="img/ico/apple-touch-icon-57-precomposed.png" />
<link rel="shortcut icon" href="img/ico/favicon.png" />

 Please provide new password below.

			<form id="reset-password-form" action="#" th:object="${resetPasswordInfo}" th:action="@{/resetPassword}" method="post">

2 or more letters

2 or more numbers

1 or more symbols

8 or more characters

				<input type="password"  class="inputFields smallMarg" name="newPassword" value="" id="newPassword" placeholder="new password" required="required" onFocus="clearText(this)" onBlur="clearText(this.className = 'onblurtext smallMarg')"  />

				<input type="password"  class="inputFields smallMarg" name="confirmPassword" value="" id="confirmPassword" placeholder="confirm password" required="required" onFocus="clearText(this)" onBlur="clearText(this.className = 'onblurtext smallMarg');confirmPass();" />

<input type="submit" class="button" id="submitBtn" value="Submit" />

						</form>

YOUR CLOUD SERVICE PROVIDER |


text:
lychee.define('game.entity.Terrain').includes([
	'lychee.app.Sprite'
]).exports(function(lychee, game, global, attachments) {

	var _texture = attachments["png"];
	var _config  = attachments["json"].buffer;

	var _TYPES   = {
		 1: 'dirt-bound',
		 2: 'dirt-free',
		 3: 'grass-bound',
		 4: 'grass-free',
		 5: 'lava-bound',
		 6: 'lava-free',
		 7: 'rock-bound',
		 8: 'rock-free',
		 9: 'sand-bound',
		10: 'sand-free',
		11: 'snow-bound',
		12: 'snow-free',
		13: 'stone-bound',
		14: 'stone-free',
		15: 'water-bound',
		16: 'water-free'
	};

	var Class = function(data) {

		var settings = lychee.extend({}, data);

		settings.texture = _texture;
		settings.width   = _config.width;
		settings.height  = _config.height;
		settings.map     = _config.map;
		settings.states  = _config.states;
		settings.state   = _TYPES[settings.type] || 'default';

		delete settings.type;

		lychee.app.Sprite.call(this, settings);

	};

	Class.prototype = {

		isFree: function() {

			var state = this.state;
			if (state.match(/free/) && !state.match(/water|lava/)) {
				return true;
			}

			return false;

		}

	};

	return Class;

});


text:
package com.google.cloud.spark.bigquery.integration;

import org.junit.Test;

public class Spark31ReadByFormatIntegrationTest extends ReadByFormatIntegrationTestBase {

  public Spark31ReadByFormatIntegrationTest() {
    super("ARROW", /* userProvidedSchemaAllowed */ false);
  }

  // tests are from the super-class

  @Test
  public void foo() {
    testCachedViewWithDifferentColumnsForSelectAndFilter();
  }
}


text:
#ifndef MBED_CMSIS_NVIC_H
#define MBED_CMSIS_NVIC_H

// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
// MCU Peripherals: 32 vectors = 128 bytes from 0x40 to 0xBF
// Total: 48 vectors = 192 bytes (0xC0) to be reserved in RAM
#define NVIC_NUM_VECTORS      48
#define NVIC_USER_IRQ_OFFSET  16

#include "cmsis.h"

#ifdef __cplusplus
extern "C" {
#endif

void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
uint32_t NVIC_GetVector(IRQn_Type IRQn);

#ifdef __cplusplus
}
#endif

#endif


text:
/**
 */
package org.afplib.afplib;

import org.afplib.base.SF;

/**
 *
 * A representation of the model object 'GAD'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link org.afplib.afplib.GAD#getGOCAdat GOC Adat}

 *

 *
 * @see org.afplib.afplib.AfplibPackage#getGAD()
 * @model
 * @generated
 */
public interface GAD extends SF {
	/**
	 * Returns the value of the 'GOC Adat' attribute.
	 *
	 *
	 *
	 *
optional
variable length

	 *
	 * @return the value of the 'GOC Adat' attribute.
	 * @see #setGOCAdat(byte[])
	 * @see org.afplib.afplib.AfplibPackage#getGAD_GOCAdat()
	 * @model
	 * @generated
	 */
	byte[] getGOCAdat();

	/**
	 * Sets the value of the '{@link org.afplib.afplib.GAD#getGOCAdat GOC Adat}' attribute.
	 *
	 *
	 * @param value the new value of the 'GOC Adat' attribute.
	 * @see #getGOCAdat()
	 * @generated
	 */
	void setGOCAdat(byte[] value);

} // GAD


text:
require 'pdf-reader'
require 'pdf/reader/patch/object_hash'
require 'pdf/reader/positional_text_receiver'

require 'pdf/reader/turtletext'
require 'pdf/reader/turtletext/version'
require 'pdf/reader/turtletext/textangle'


text:
**Location:** San Diego

**Favorite Location:** Los Angeles


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_Collections_Generic_EqualityCompar3879602895.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Collections.Generic.GenericEqualityComparer`1<System.Boolean>
struct  GenericEqualityComparer_1_t416144416  : public EqualityComparer_1_t3879602895
{
public:

public:
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
/***@@@ BEGIN LICENSE @@@***/
/*───────────────────────────────────────────────────────────────────────────*\
│  Copyright (C) 2013 eBay Software Foundation                                │
│                                                                             │
│hh ,'""`.                                                                    │
│  / _  _ \  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.                                            │
\*───────────────────────────────────────────────────────────────────────────*/
/***@@@ END LICENSE @@@***/

/*global exports:true*/

'use strict';

exports = module.exports = {

	_cache: {},

	_getLibForType: function (type) {
		var clazz = this._cache[type];
		if (!clazz) {
			clazz = this._cache[type] = require('./' + type);
		}
		return clazz;
	},

	buildDeserializer: function (type) {
		var Clazz = this._getLibForType(type).Reader;
		return new Clazz();
	},

	buildSerializer: function (type) {
		var Clazz = this._getLibForType(type).Writer;
		return new Clazz();
	},

	register: function (type, serializer) {
		var previous = this._cache[type];
		this._cache[type] = serializer;
		return previous;
	}

};


text:
package com.microsoft.dhalion.examples;

import com.microsoft.dhalion.conf.Config;
import com.microsoft.dhalion.conf.Key;
import com.microsoft.dhalion.core.Measurement;
import com.microsoft.dhalion.core.MeasurementsTable;
import org.junit.Test;

import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

import static com.microsoft.dhalion.core.MeasurementsTable.SortKey.TIME_STAMP;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class CSVMetricsProviderTest {
  private CSVMetricsProvider provider;

  @Test
  public void testCSVMetricsProvider() {

    Config conf = mock(Config.class);
    when(conf.get(Key.DATA_DIR.value())).thenReturn(CSVMetricsProvider.class.getClassLoader().getResource(".").getFile());
    provider = new CSVMetricsProvider(conf);

    Instant startTS = Instant.parse("2018-01-08T01:37:36.934Z");
    String metric = "Cpu";
    Duration duration = Duration.ofMinutes(2);
    String comp = "NodeA";

    Collection<String> metricNames = new ArrayList<>();
    metricNames.add(metric);
    Collection<String> components = new ArrayList<>();
    components.add(comp);

    MeasurementsTable metrics = MeasurementsTable.of(
        provider.getMeasurements(startTS, duration, metricNames, components));
    assertEquals(4, metrics.size());
    assertEquals(4, metrics.type(metric).size());
    assertEquals(2, metrics.component(comp).instance("1").size());
    assertEquals(2, metrics.component(comp).instance("3").size());

    Iterator<Measurement> measurements = metrics.component(comp).instance("1").sort(false, TIME_STAMP).get().iterator();
    assertEquals("2018-01-08T01:36:36.934Z", measurements.next().instant().toString());
    assertEquals("2018-01-08T01:37:36.934Z", measurements.next().instant().toString());
  }

  @Test
  public void testCSVMetricsProvider2() {

    Config conf = mock(Config.class);
    when(conf.get(Key.DATA_DIR.value())).thenReturn(CSVMetricsProvider.class.getClassLoader().getResource(".").getFile());
    provider = new CSVMetricsProvider(conf);

    Instant startTS = Instant.parse("2018-01-08T01:37:36.934Z");
    String metric = "Mem";
    Duration duration = Duration.ofMinutes(2);
    String comp = "NodeB";

    Collection<String> metricNames = new ArrayList<>();
    metricNames.add(metric);
    Collection<String> components = new ArrayList<>();
    components.add(comp);

    MeasurementsTable metrics = MeasurementsTable.of(
        provider.getMeasurements(startTS, duration, metricNames, components));
    assertEquals(4, metrics.size());
    assertEquals(4, metrics.type(metric).size());
    assertEquals(2, metrics.component(comp).instance("2").size());
    assertEquals(2, metrics.component(comp).instance("4").size());

    Iterator<Measurement> measurements = metrics.component(comp).instance("2").sort(false, TIME_STAMP).get()
                                                .iterator();
    assertEquals("2018-01-08T01:36:36.934Z", measurements.next().instant().toString());
    assertEquals("2018-01-08T01:37:36.934Z", measurements.next().instant().toString());
  }
}


text:
<?php

namespace Wzc\MainBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Iphp\FileStoreBundle\Mapping\Annotation as FileStore;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Publication
 *
 * @ORM\Table()
 * @ORM\Entity()
 * @FileStore\Uploadable
 */
class Publication extends BaseEntity
{
    /**
     * @ORM\Column(type="string")
     * @Assert\NotBlank( message = "поле Заголовок обязательно для заполнения" )
     */
    protected $title;

    /**
     * @ORM\Column(type="string", nullable=true)
     */
    protected $keywords;

    /**
     * @ORM\Column(type="string", nullable=true)
     */
    protected $description;

    /**
     * @ORM\Column(type="text")
     * @Assert\NotBlank( message = "поле Текст обязательно для заполнения" )
     */
    protected $body;

    /**
     * @ORM\Column(type="text")
     * @Assert\NotBlank( message = "поле Анонс обязательно для заполнения" )
     */
    protected $anons;

    /**
     * @Assert\File( maxSize="2M", uploadIniSizeErrorMessage = "Максимальный размер файла - 2 Мб")
     * @FileStore\UploadableField(mapping="publication")
     * @ORM\Column(type="array", nullable=true)
     **/
    protected $image;

    public function getId(){
        return $this->id;
    }

    public function __toString(){
        return $this->title;
    }

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

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

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

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

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

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

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

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

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

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

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

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

}


text:
AmazeKit is an image rendering library for iOS. Its goal is to retain the performance of using `.png`-formatted images in UIKit classes, while avoiding the chore of creating these images in Photoshop, as well as the extra download size of bundling the images in the app. Images are rendered according to a collection of "image effects," ranging from a simple gradient or corner radius to blurs, masks, and inner shadows. AmazeKit also offers convenient UIKit support, automatically using the correct images as your controls change size. Retina displays are supported automatically, and AmazeKit aggressively caches rendered images to maintain optimal performance levels.

## Getting Started
The recommended way to get AmazeKit is to use [CocoaPods](http://www.cocoapods.org).

**TODO**: Add instructions for bundling AmazeKit, using a static library, Xcode subproject, and as a Git submodule.

## Examples
The best way to see how AmazeKit works is to see it in action. Let's look at a couple of common use cases and see what they produce:

### Rendering an Individual Image
The following code sets up an `AKImageCoordinator`. This class is responsible for rendering an image into a `UIImageView`, automatically rendering it at the appropriate size:

    // Noise Effect
    AKNoiseImageEffect *noiseEffect =
    [[AKNoiseImageEffect alloc] initWithAlpha:0.05f
                                    blendMode:kCGBlendModeMultiply
                                    noiseType:AKNoiseTypeBlackAndWhite];

    // Gradient Effect
    UIColor *beginColor = [UIColor colorWithRed:144.0f / 255.0f
                                          green:144.0f / 255.0f
                                           blue:144.0f / 255.0f
                                          alpha:1.0f];

    UIColor *endColor = [UIColor colorWithRed:103.0f / 255.0f
                                        green:103.0f / 255.0f
                                         blue:103.0f / 255.0f
                                        alpha:1.0f];

    AKGradientImageEffect *gradientEffect =
    [[AKGradientImageEffect alloc] initWithAlpha:1.0f
                                       blendMode:kCGBlendModeMultiply
                                          colors:@[beginColor, endColor]
                                       direction:AKGradientDirectionVertical
                                       locations:nil];

    // Color Effect
    AKColorImageEffect *colorEffect =
    [[AKColorImageEffect alloc] initWithAlpha:1.0f
                                    blendMode:kCGBlendModeColor
                                        color:[UIColor blueColor]];

    // Create the image renderer
    AKImageRenderer *imageRenderer = [[AKImageRenderer alloc] init];

    [imageRenderer setImageEffects:@[
     noiseEffect,
     gradientEffect,
     colorEffect
     ]];

    AKImageCoordinator *imageCoordinator = [[AKImageCoordinator alloc] init];
    [imageCoordinator setImageRenderer:imageRenderer];

    [imageCoordinator addImageView:myImageView];

This produces the following image output (for an image view with a size of 250 x 100 on a Retina display):

![Example Image 1](readme_images/example_1.png)

### Rendering Button Images
The `AKButtonImageCoordinator` class is like the `AKImageCoordinator` class, but it takes two image renderers instead of one. The "off" image renderer is used for the button's normal control state, and the "on" image renderer is used for the button's highlighted control state. The `AKButtonImageCoordinator` takes care of rendering background images for your button and automatically renders them to the correct size. Here's an example:

    // The butons will have a noise effect, rounded corners, and a gradient in
    // common.
    AKNoiseImageEffect *noiseEffect =
    [[AKNoiseImageEffect alloc] initWithAlpha:0.05f
                                    blendMode:kCGBlendModeMultiply
                                    noiseType:AKNoiseTypeBlackAndWhite];

    UIColor *topColor = [UIColor colorWithRed:144.0f / 255.0f
                                        green:144.0f / 255.0f
                                         blue:144.0f / 255.0f
                                        alpha:1.0f];

    UIColor *bottomColor = [UIColor colorWithRed:103.0f / 255.0f
                                           green:103.0f / 255.0f
                                            blue:103.0f / 255.0f
                                           alpha:1.0f];

    AKGradientImageEffect *gradientImageEffect =
    [[AKGradientImageEffect alloc] initWithAlpha:1.0f
                                       blendMode:kCGBlendModeMultiply
                                          colors:@[topColor, bottomColor]
                                       direction:AKGradientDirectionVertical
                                       locations:nil];

    AKCornerRadii cornerRadii = AKCornerRadiiMake(4.0f, 4.0f, 4.0f, 4.0f);

    AKCornerRadiusImageEffect *cornerRadiusEffect =
    [[AKCornerRadiusImageEffect alloc] initWithAlpha:1.0f
                                           blendMode:kCGBlendModeNormal
                                         cornerRadii:cornerRadii];

    // The "off" state is blue, the "on" state is red.
    AKColorImageEffect *onColorEffect =
    [[AKColorImageEffect alloc] initWithAlpha:1.0f
                                    blendMode:kCGBlendModeColor
                                        color:[UIColor redColor]];

    AKColorImageEffect *offColorEffect =
    [[AKColorImageEffect alloc] initWithAlpha:1.0f
                                    blendMode:kCGBlendModeColor
                                        color:[UIColor blueColor]];

    // We create two image renderers, one for each state
    AKImageRenderer *offImageRenderer = [[AKImageRenderer alloc] init];
    AKImageRenderer *onImageRenderer = [[AKImageRenderer alloc] init];

    // And we assign the image effects for each.
    [offImageRenderer setImageEffects:@[
     noiseEffect,
     gradientImageEffect,
     offColorEffect,
     cornerRadiusEffect
     ]];

    [onImageRenderer setImageEffects:@[
     noiseEffect,
     gradientImageEffect,
     onColorEffect,
     cornerRadiusEffect
     ]];

    // Next we create the button image coordinator and assign the image
    // renderers to it
    AKButtonImageCoordinator *buttonImageCooordinator =
    [[AKButtonImageCoordinator alloc] init];

    [buttonImageCooordinator setOffImageRenderer:offImageRenderer];
    [buttonImageCooordinator setOnImageRenderer:onImageRenderer];

    // Finally, we add a button.
    [buttonImageCooordinator addButton:myButton];

This produces the following image output (for a button that's 150 x 44 on a Retina display):

Off: ![Example Image 2 (Off)](readme_images/example2_off.png)
On: ![Example Image 2 (On)](readme_images/example2_on.png)

## The `bin` Directory
In the `bin` directory are two scripts: `gen_docs.sh` and `publish_docs.sh`. These scripts are meant for me to run as a convenience to publish the appledoc docs. Use caution when running them.

## Build Status
[![Build Status](https://travis-ci.org/detroit-labs/AmazeKit.png)](https://travis-ci.org/detroit-labs/AmazeKit)

AmazeKit was developed in Detroit by [Jeff Kelley](http://github.com/SlaunchaMan) at [Detroit Labs](http://www.detroitlabs.com).


text: work commands


text:
<?xml version="1.0" encoding="utf-8" ?>
<asn:Sequence
  xmlns:asn="http://schemas.dot.net/asnxml/201808/"
  name="AlgorithmIdentifierAsn"
  namespace="System.Security.Cryptography.Asn1">

  <!--
    https://tools.ietf.org/html/rfc3280#section-4.1.1.2

    AlgorithmIdentifier ::= SEQUENCE {
        algorithm OBJECT IDENTIFIER,
        parameters ANY DEFINED BY algorithm OPTIONAL
    }
  -->
  <asn:ObjectIdentifier name="Algorithm" />
  <asn:AnyValue name="Parameters" optional="true" />
</asn:Sequence>


text:
    {{ $field['label'] }}
    <input
        type="datetime-local"
        class="form-control"

        @foreach ($field as $attribute => $value)
            @if ($attribute == 'value')
                value="{{ strftime('%Y-%m-%dT%H:%M:%S', strtotime($value)) }}"
            @else
                {{ $attribute }}="{{ $value }}"
            @endif
        @endforeach
        >


text:
package com.lousylynx.integrity.event;

import com.lousylynx.integrity.api.event.IEvent;
import com.lousylynx.integrity.api.event.IEventBus;
import com.lousylynx.integrity.api.event.IListener;
import com.lousylynx.integrity.api.event.IntegrationEvent;
import com.lousylynx.integrity.core.ILogger;
import lombok.Getter;
import org.apache.logging.log4j.Level;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;

public class EventBus extends IEventBus {

    @Getter
    private List<IListener> eventClasses = new ArrayList<>();

    @Override
    public void register(IListener events) {
        if (!eventClasses.contains(events))
            eventClasses.add(events);
    }

    @Override
    public void handle(IEvent event) {
        Map<IListener, List<Method>> methods = getValidMethods(event);

        for (IListener listener : methods.keySet()) {
            List<Method> ms = methods.get(listener);

            ms.forEach(m -> {
                try {
                    m.invoke(ms, event);
                } catch (IllegalAccessException | InvocationTargetException e) {
                    ILogger.log(Level.WARN, "There was an issue invoking an event");
                    ILogger.log(Level.WARN, e, e.getMessage());
                }
            });
        }
    }

    private Map<IListener, List<Method>> getValidMethods(IEvent event) {
        Map<IListener, List<Method>> output = new HashMap<>();

        for (IListener listener : eventClasses) {
            for (Method m : listener.getClass().getMethods()) {
                if (m.isAnnotationPresent(IntegrationEvent.class)) {
                    if (m.getParameterCount() == 1 && m.getParameters()[0].getClass().isInstance(event.getClass())) {
                        if (output.containsKey(listener)) {
                            List<Method> methods = output.get(listener);
                            methods.add(m);

                            output.put(listener, methods);
                        } else {
                            output.put(listener, Collections.singletonList(m));
                        }
                    }
                }
            }
        }

        return output;
    }
}


text:
package music

import (
	"encoding/gob"
	"math"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strings"
)

/* used to index musics and give tools to search by free text (sorted list and dicotomic search) */

const (
	tiFilename = "text_index.idx"
)

type Token struct {
	Value string
	// id of musics containing this token
	Musics []int
}

type Tokens []Token

func (t Tokens) Len() int           { return len(t) }
func (t Tokens) Less(i, j int) bool { return t[i].Value < t[j].Value }

// Swap swaps the elements with indexes i and j.
func (t Tokens) Swap(i, j int) { t[i], t[j] = t[j], t[i] }

type TextIndexer struct {
	// List must be sorted
	Index Tokens
	// temp map before creating list
	temp map[string][]int
}

func NewTextIndexer() TextIndexer {
	return TextIndexer{nil, make(map[string][]int)}
}

func LoadTextIndexer(folder string) TextIndexer {
	ti := TextIndexer{nil, make(map[string][]int)}
	if file, e := os.Open(filepath.Join(folder, tiFilename)); e == nil {
		dec := gob.NewDecoder(file)
		dec.Decode(&ti)
		file.Close()
	}
	return ti
}

var cleanChars = regexp.MustCompile("[-!/,\\.]|(mp3)")
var cleanSpaces = regexp.MustCompile("[ ]{2,}")

//Filter split sentence into words. Remove duplicates
func (ti TextIndexer) Filter(values ...string) []string {
	results := make([]string, 0)
	for _, value := range values {
		value = string(cleanSpaces.ReplaceAll(cleanChars.ReplaceAll([]byte(strings.ToLower(value)), []byte(" ")), []byte(" ")))
		splits := strings.Split(value, " ")
		sort.Strings(splits)

		for _, e := range splits {
			if len(e) > 2 {
				//t := transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC)
				//e, _, _ := transform.String(t, "e")
				// Check if equals previous to remove duplicates
				if len(results) == 0 || results[len(results)-1] != e {
					results = append(results, e)
				}
			}
		}
	}

	return results
}

func (ti *TextIndexer) Add(value string, idMusic int) {
	if list, ok := ti.temp[value]; !ok {
		ti.temp[value] = []int{idMusic}
	} else {
		ti.temp[value] = append(list, idMusic)
	}
}

// Parse map and create list
func (ti *TextIndexer) Build() {
	ti.Index = make([]Token, 0, len(ti.temp))
	for value, ids := range ti.temp {
		sort.Ints(ids)
		RemoveDuplicates(&ids)
		ti.Index = append(ti.Index, Token{value, ids})
	}
	sort.Sort(ti.Index)
}

// list is sorted
func RemoveDuplicates(list *[]int) {
	noDoubles := make([]int, 0, len(*list))
	last := 0
	for i, value := range *list {
		if i == 0 || value != last {
			noDoubles = append(noDoubles, value)
			last = value
		}
	}
	*list = noDoubles
}

func Intersect(a, b []int) []int {
	if len(a) == 0 || len(b) == 0 {
		return []int{}
	}
	results := make([]int, 0, int(math.Min(float64(len(a)), float64(len(b)))))
	j := 0
	for i := 0; i < len(a); i++ {
		for {
			stop := false
			switch {
			case j >= len(b) || a[i] < b[j]:
				stop = true
			case a[i] > b[j]:
				j++
			case a[i] == b[j]:
				results = append(results, a[i])
				j++
				stop = true
			}
			if stop {
				break
			}
		}
		if j >= len(b) {
			break
		}
	}
	return results
}

//Search text string into index and return founded musics
func (ti TextIndexer) Search(text string) []int {
	// Convert text
	text = strings.ToLower(text)
	results := make([]int, 0)
	for i, sub := range strings.Split(text, " ") {
		if sub != "" {
			r := ti.IntSearch(sub)
			if len(r) == 0 {
				return []int{}
			}
			if i == 0 {
				results = r
			} else {
				if results = Intersect(results, r); len(results) == 0 {
					return []int{}
				}
			}
		}
	}
	return results
}

func (ti TextIndexer) IntSearch(text string) []int {
	if pos := ti.searchPositionToken(ti.Index, text, 0); pos != -1 {
		// search other close value
		results := ti.Index[pos].Musics
		for i := pos - 1; i >= 0 && strings.HasPrefix(ti.Index[i].Value, text); i-- {
			results = append(results, ti.Index[i].Musics...)
		}
		for i := pos + 1; i < len(ti.Index) && strings.HasPrefix(ti.Index[i].Value, text); i++ {
			results = append(results, ti.Index[i].Musics...)
		}
		sort.Ints(results)
		return results
	}
	return []int{}
}

//Use dicotomy
func (ti TextIndexer) searchPositionToken(tokens Tokens, text string, pos int) int {
	if len(tokens) == 0 {
		return -1
	}
	center := len(tokens) / 2
	t := tokens[center]
	if strings.HasPrefix(t.Value, text) {
		return pos + center
	}
	if len(tokens) == 1 {
		return -1
	}
	if t.Value < text {
		return ti.searchPositionToken(tokens[center:], text, center+pos)
	}
	return ti.searchPositionToken(tokens[:center], text, pos)
}

func (ti TextIndexer) subSearch(tokens Tokens, text string) []int {
	if len(tokens) == 0 {
		return []int{}
	}
	center := len(tokens) / 2
	t := tokens[center]
	if strings.HasPrefix(t.Value, text) {
		return t.Musics
	}
	if len(tokens) == 1 {
		return []int{}
	}
	if t.Value < text {
		return ti.subSearch(tokens[center:], text)
	}
	return ti.subSearch(tokens[:center], text)
}

// Save with naive method, gob encoder
func (ti TextIndexer) Save(folder string) {
	file, _ := os.OpenFile(filepath.Join(folder, tiFilename), os.O_CREATE|os.O_TRUNC|os.O_RDWR, os.ModePerm)
	defer file.Close()
	enc := gob.NewEncoder(file)
	enc.Encode(ti)

}


text:
(taskwarrior time-of-day shell script)

is a taskwarrior extension designed to filter-out tasks that are not appropriate for the current (now) time of day, for 2 selected reports. Using the extension is as easy as adding +morn +aft +day +eve +night tags to any tasks that would be best performed at those times.

Status: core functions working well

See also: tod.txt for more requirements/ install/ config/ using ToD info

Caveat: Perpetual Proof-of-Concept until reviewed and tested by "real programmers". Lock up your daughters and backup your data!

### Features

- easily set preferred time-of-day for a task by adding a +morn +aft +day +eve +night tag
- easily re-set time-of-day with 'ToD [morn|aft|day|eve|night|none]'
- does not use or interfere with task context
- designed to work with tw-needs-hook (another persistent filter tw-extension)
- view help with 'ToD help'

#### Planned

- a cron-job that runs ToD.sh, changes rc.tod and applies tod filters.
- more easily customized times and hours
- applicable to any number of reports, not just 2 (ready and ls by default)
- on-add and on-modify hooks to act on any date-change, adding "+8hrs" (or whatever) to any task with a +morn tag (for example), if no hours were specified.

### Advantages

If you use taskwarrior, you could easily filter for all "evening tasks" with 'task +eve ready' but that over-simplification would hide any task without an +eve tag. That's potentially a problem, because many of the hidden tasks might well be actionable any time, including the evening, unless you were _meticulous_ with your tags.

Instead, what this extension does, is to filter selected reports with the _inverse_ of the rc.tod setting. When rc.tod=eve,  ( -morn -aft -day -night ) ia added to the "ready" and "ls" reports, concealing tasks specified for some other time-of-day.

### Benefits

De-selecting reports that are not actionable "now" can reduce a large list by half, dramatically improving the signal-to-noise ratio, and making it clearer which tasks can (and should) be done immediately.

### Issues

There are always bugs, and there could always be improvements. Contributions, ideas and comments are welcome at https://github.com/linuxcaffe/tw-tod-sh


text:
With [npm](https://www.npmjs.com/):

```sh
npm install --save currency.js
```

With [yarn](https://yarnpkg.com):

```sh
yarn add currency.js
```


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 The Chromium Authors. All rights reserved.
     Use of this source code is governed by a BSD-style license that can be
     found in the LICENSE file. -->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/launchpad_page"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/selectable_list_toolbar_height"
        style="@style/ModernToolbar" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/launchpad_recycler"
        android:background="@macro/default_bg_color"
        android:scrollbars="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/selectable_list_toolbar_height" />

    <org.chromium.components.browser_ui.widget.FadingShadowView
        android:id="@+id/shadow"
        android:layout_width="match_parent"
        android:layout_height="@dimen/action_bar_shadow_height"
        android:layout_marginTop="@dimen/selectable_list_toolbar_height" />
</FrameLayout>


text:
int main() {

  using agent::entity::Core;
  using agent::entity::Mover;
  using agent::entity::Manager;

  using EID = agent::enumerate::entity::id;
  using EType = agent::enumerate::entity::type;

  Mover* moverA = new Mover(EID::Cyan);
  moverA->SetType(EType::gaki);
  Manager::Instance()->RegisterEntity(moverA);

  std::vector<int> v;
  v.push_back( static_cast<int>(moverA->ID()) );
  v.push_back( static_cast<int>(moverA->Type()) );
  v.push_back( moverA->Velocity() );

  debugger::print(v);

  Manager::Instance()->RegisterEntity(moverA);

  Core* cyan = Manager::Instance()->GetEntityFromID(EID::Cyan);

  std::cout << "Type: " << static_cast<int>(cyan->Type()) << std::endl;

  Manager::Instance()->RemoveEntity(cyan);

  return 0;
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using Microsoft.Common.Core;
using Microsoft.Languages.Core.Text;
using Microsoft.Languages.Core.Tokens;

namespace Microsoft.R.Core.Tokens {
    /// <summary>
    /// Main R tokenizer. Used for colirization and parsing.
    /// Coloring of variables, function names and parameters
    /// is provided later by AST. Tokenizer only provides candidates.
    /// </summary>
    public sealed class RTokenizer : BaseTokenizer<RToken> {
        private readonly Stack<RTokenType> _squareBraceScope = new Stack<RTokenType>();
        private readonly List<RToken> _comments = new List<RToken>();
        private readonly bool _separateComments;

        public IReadOnlyList<RToken> CommentTokens => _comments;

        public RTokenizer() : this(false) { }

        public RTokenizer(bool separateComments = false) {
            // R parser needs comments separately
            // while colorizer all in one collection.
            _separateComments = separateComments;
        }

        /// <summary>
        /// Main tokenization method. Responsible for adding next token
        /// to the list, if any. Returns if it is at the end of the
        /// character stream. It is up to base class to terminate tokenization.
        /// </summary>
        public override void AddNextToken() {
            SkipWhitespace();

            if (_cs.IsEndOfStream()) {
                return;
            }

            // First look at the numbers. Note that it is hard to tell
            // 12 +1 if it is a sum of numbers or a sequence. Note that
            // R also supports complex numbers like 1.e+01+-37.5i
            if (IsPossibleNumber()) {
                var start = _cs.Position;

                var length = NumberTokenizer.HandleNumber(_cs);
                if (length > 0) {
                    // HandleNumber will stop at 'i' as it will stop
                    // at any other non-digit (decimal or hex). Also,
                    // it doesn't know if + or - is an operator or part
                    // of the complex number.
                    HandleNumber(start, length);
                    return;
                }
            }

            HandleCharacter();
        }

        private void HandleCharacter() {
            switch (_cs.CurrentChar) {
                case '\"':
                case '\'':
                    HandleString(_cs.CurrentChar);
                    break;

                case '#':
                    // R Comments are from # to the end of the line
                    HandleComment();
                    break;

                case '(':
                    AddToken(RTokenType.OpenBrace, _cs.Position, 1);
                    _cs.MoveToNextChar();
                    break;

                case ')':
                    AddToken(RTokenType.CloseBrace, _cs.Position, 1);
                    _cs.MoveToNextChar();
                    break;

                case '[':
                    HandleOpenSquareBracket();
                    break;

                case ']':
                    HandleCloseSquareBracket();
                    break;

                case '{':
                    AddToken(RTokenType.OpenCurlyBrace, _cs.Position, 1);
                    _cs.MoveToNextChar();
                    break;

                case '}':
                    AddToken(RTokenType.CloseCurlyBrace, _cs.Position, 1);
                    _cs.MoveToNextChar();
                    break;

                case ',':
                    AddToken(RTokenType.Comma, _cs.Position, 1);
                    _cs.MoveToNextChar();
                    break;

                case ';':
                    AddToken(RTokenType.Semicolon, _cs.Position, 1);
                    _cs.MoveToNextChar();
                    break;

                default:
                    if (_cs.CurrentChar == '.' && _cs.NextChar == '.' && _cs.LookAhead(2) == '.') {
                        AddToken(RTokenType.Ellipsis, _cs.Position, 3);
                        _cs.Advance(3);
                    } else if (_cs.CurrentChar == '=' && _cs.NextChar != '=') {
                        AddToken(RTokenType.Operator, _cs.Position, 1);
                        _cs.MoveToNextChar();
                    } else {
                        HandleOther();
                    }
                    break;
            }
        }

        internal bool IsPossibleNumber() {
            // It is hard to tell in 12 +1 if it is a sum of numbers or
            // a sequence. If operator or punctiation (comma, semicolon)
            // precedes the sign then sign is part of the number.
            // Note that if preceding token is one of the function ()
            // or indexing braces [] then sign is an operator like in x[1]+2.
            // In other cases plus or minus is also a start of the operator.
            // It important that in partial tokenization classifier removes
            // enough tokens so tokenizer can start its work early enough
            // in the stream to be able to figure out numbers properly.

            if (_cs.CurrentChar == '-' || _cs.CurrentChar == '+') {
                // Next character must be decimal or a dot otherwise
                // it is not a number. No whitespace is allowed.
                if (CharacterStream.IsDecimal(_cs.NextChar) || _cs.NextChar == '.') {
                    // Check what previous token is, if any
                    if (_tokens.Count == 0) {
                        // At the start of the file this can only be a number
                        return true;
                    }

                    var previousToken = _tokens[_tokens.Count - 1];

                    if (previousToken.TokenType == RTokenType.OpenBrace ||
                        previousToken.TokenType == RTokenType.OpenSquareBracket ||
                        previousToken.TokenType == RTokenType.Comma ||
                        previousToken.TokenType == RTokenType.Semicolon ||
                        previousToken.TokenType == RTokenType.Operator) {
                        return true;
                    }
                }

                return false;
            }

            // R only supports 0xABCD. x0A is not legal.
            if (_cs.CurrentChar == '0' && _cs.NextChar == 'x') {
                // Hex humber like 0xA1BC
                return true;
            }

            if (_cs.IsDecimal()) {
                return true;
            }

            if (_cs.CurrentChar == '.' && CharacterStream.IsDecimal(_cs.NextChar)) {
                return true;
            }

            return false;
        }
        private void HandleNumber(int numberStart, int length) {
            if (_cs.CurrentChar == 'i') {
                _cs.MoveToNextChar();
                AddToken(RTokenType.Complex, numberStart, _cs.Position - numberStart);
                return;
            }

            // Check if this is actually complex number
            var imaginaryStart = _cs.Position;

            var imaginaryLength = NumberTokenizer.HandleImaginaryPart(_cs);
            if (imaginaryLength > 0) {
                AddToken(RTokenType.Complex, numberStart, length + imaginaryLength);
                return;
            }

            _cs.Position = imaginaryStart;
            AddToken(RTokenType.Number, numberStart, length);
        }

        private void HandleOpenSquareBracket() {
            RTokenType tokenType;
            int length;

            if (_cs.NextChar == '[') {
                tokenType = RTokenType.OpenDoubleSquareBracket;
                length = 2;
            } else {
                tokenType = RTokenType.OpenSquareBracket;
                length = 1;
            }

            AddToken(tokenType, _cs.Position, length);
            _cs.Advance(length);

            _squareBraceScope.Push(tokenType);
        }

        private void HandleCloseSquareBracket() {
            if (_cs.NextChar == ']') {
                // ]] candidate. We need to handle a[b[c]]

                if (_squareBraceScope.Count > 0 && _squareBraceScope.Peek() == RTokenType.OpenDoubleSquareBracket) {
                    AddToken(RTokenType.CloseDoubleSquareBracket, _cs.Position, 2);
                    _cs.Advance(2);
                    _squareBraceScope.Pop();
                    return;
                }
            }

            AddToken(RTokenType.CloseSquareBracket, _cs.Position, 1);
            _cs.MoveToNextChar();

            if (_squareBraceScope.Count > 0 && _squareBraceScope.Peek() == RTokenType.OpenSquareBracket) {
                _squareBraceScope.Pop();
            }
        }

        private void HandleOther() {
            // Letter may be starting keyword, function or a variable name.
            // At this point we should be either right after whitespace or
            // at the beginning of the file.
            if (_cs.IsLetter() || _cs.CurrentChar == '.' || _cs.CurrentChar == '`') {
                // If this is not a keyword or a function name candidate
                HandleKeywordOrIdentifier();
                return;
            }

            // If character is not a letter and not start of a string it
            // cannot be a keyword, function or variable name. Try operators
            // first since they are longer than puctuation.
            if (HandleOperator()) {
                return;
            }

            // Something unknown. Skip to whitespace and file as unknown.
            // Note however, we should take # ito account as it starts comment
            var start = _cs.Position;
            if (Char.IsLetter(_cs.CurrentChar)) {
                if (AddIdentifier()) {
                    return;
                }
            }

            SkipUnknown();
            if (_cs.Position > start) {
                AddToken(RTokenType.Unknown, start, _cs.Position - start);
            } else {
                _cs.MoveToNextChar();
            }
        }

        /// <summary>
        /// Detemines if current position is at operator
        /// and adds the appropriate token if so.
        /// </summary>
        /// <returns></returns>
        internal bool HandleOperator() {
            var length = Operators.OperatorLength(_cs);
            if (length > 0) {
                AddToken(RTokenType.Operator, _cs.Position, length);
                _cs.Advance(length);
                return true;
            }

            return false;
        }

        /// <summary>
        /// Determines if current position is at a keyword or
        /// at a function name candidate. Function name candidate
        /// looks like 'identifier[whitespace](' sequence.
        /// </summary>
        /// <returns>
        /// True if it handled the sequence and it looked
        /// like either keyword or a function candidate.
        /// </returns>
        private void HandleKeywordOrIdentifier() {
            var start = _cs.Position;

            var s = this.GetIdentifier();
            if (s.Length == 0) {
                AddToken(RTokenType.Unknown, start, 1);
                _cs.MoveToNextChar();
                return;
            }

            if (s[0] == '`') {
                AddToken(RTokenType.Identifier, RTokenSubType.None, start, s.Length);
            } else if (Logicals.IsLogical(s)) {
                // Tell between F and F() and allow T = x or F <- 0.
                AddToken(VerifyLogical(s) ? RTokenType.Logical : RTokenType.Identifier, start, s.Length);
            } else if (s == "NULL") {
                AddToken(RTokenType.Null, RTokenSubType.BuiltinConstant, start, s.Length);
            } else if (s == "NA" || s == "NA_character_" || s == "NA_complex_" || s == "NA_integer_" || s == "NA_real_") {
                AddToken(RTokenType.Missing, RTokenSubType.BuiltinConstant, start, s.Length);
            } else if (s == "Inf") {
                AddToken(RTokenType.Infinity, RTokenSubType.BuiltinConstant, start, s.Length);
            } else if (s == "NaN") {
                AddToken(RTokenType.NaN, RTokenSubType.BuiltinConstant, start, s.Length);
            } else if (Builtins.IsBuiltin(s)) {
                AddToken(RTokenType.Identifier, RTokenSubType.BuiltinFunction, start, s.Length);
            } else if (s.StartsWith("as.", StringComparison.Ordinal) || s.StartsWith("is.", StringComparison.Ordinal)) {
                AddToken(RTokenType.Identifier, RTokenSubType.TypeFunction, start, s.Length);
            } else if (Keywords.IsKeyword(s)) {
                AddToken(RTokenType.Keyword, start, s.Length);
            } else {
                AddToken(RTokenType.Identifier, start, s.Length);
            }
        }

        /// <summary>
        /// Tries to determine if T/F are actually logical values.
        /// </summary>
        /// <remarks>This is not 100% reliable during tokenization since T or F may be
        /// part of expression such as T <- 0 and then, 100 lines later, `x = T + 2`.
        /// However, in the latter case we can leave T/F as logical and let expression
        /// parser figure out the context.</remarks>
        private bool VerifyLogical(string s) {
            if (s.Length == 1) {
                if (_tokens.Count > 0) {
                    var prevToken = _tokens[_tokens.Count - 1];
                    if (prevToken.TokenType == RTokenType.Operator &&
                        _cs.GetSubstringAt(prevToken.Start, prevToken.Length).EqualsOrdinal("->")) {
                        // 1 -> T
                        return false;
                    }
                }
                _cs.SkipWhitespace();
                switch (_cs.CurrentChar) {
                    case '(': // F(
                    case '=': // T = 2
                        return false;
                    case '<': // T <- 1
                        return _cs.NextChar != '-';
                }

            }
            return true;
        }

        internal string GetIdentifier() {
            var start = _cs.Position;
            var identifier = string.Empty;

            SkipIdentifier();

            var length = _cs.Position - start;
            if (length >= 0) {
                identifier = _cs.Text.GetText(new TextRange(start, length));
            }

            return identifier;
        }

        /// <summary>
        /// Handle R comment. Comment starts with #
        /// and goes to the end of the line.
        /// </summary>
        private void HandleComment() {
            Tokenizer.HandleEolComment(_cs, (start, length) => {
                if (_separateComments) {
                    _comments.Add(new RToken(RTokenType.Comment, start, length));
                } else {
                    AddToken(RTokenType.Comment, start, length);
                }
            });
        }

        /// <summary>
        /// Adds a token that represent a string
        /// </summary>
        /// <param name="openQuote"></param>
        private void HandleString(char openQuote)
            => Tokenizer.HandleString(openQuote, _cs, (start, length) => AddToken(RTokenType.String, start, length));

        private bool AddIdentifier() {
            // 10.3.2 Identifiers
            // Identifiers consist of a sequence of letters, digits, the period ('.') and the underscore.
            // They must not start with a digit or an underscore, or with a period followed by a digit.
            // The definition of a letter depends on the current locale: the precise set of characters
            // allowed is given by the C expression (isalnum(c) || c == '.' || c == '_') and will include
            // accented letters in many Western European locales.

            var start = _cs.Position;

            SkipIdentifier();

            if (_cs.Position > start) {
                AddToken(RTokenType.Identifier, start, _cs.Position - start);
                return true;
            }

            return false;
        }

        private void AddToken(RTokenType type, int start, int length) {
            var token = new RToken(type, start, length);
            _tokens.Add(token);
        }

        private void AddToken(RTokenType type, RTokenSubType subType, int start, int length) {
            var token = new RToken(type, start, length) { SubType = subType };
            _tokens.Add(token);
        }

        internal void SkipIdentifier() {
            // Handle backticks first. `anything` allow identifiers
            // to be of any syntax, not just standard names.
            if (_cs.CurrentChar == '`') {
                var closingBacktickIndex = _cs.IndexOf('`', _cs.Position + 1);
                if (closingBacktickIndex >= 0) {
                    _cs.Position = closingBacktickIndex + 1;
                } else {
                    _cs.Position = _cs.Length;
                }
            } else {
                Tokenizer.SkipIdentifier(
                    _cs,
                    (CharacterStream cs) => { return (_cs.IsLetter() || _cs.CurrentChar == '.'); },
                    (CharacterStream cs) => { return IsIdentifierCharacter(cs); });
            }
        }

        internal void SkipUnknown() {
            while (!_cs.IsEndOfStream() && !_cs.IsWhiteSpace()) {
                if (_cs.CurrentChar == '#') {
                    break;
                }

                _cs.MoveToNextChar();
            }
        }

        private static bool IsIdentifierCharacter(CharacterStream cs) => IsIdentifierCharacter(cs.CurrentChar);

        public static bool IsIdentifierCharacter(char ch)
            => (CharacterStream.IsLetter(ch) || CharacterStream.IsDecimal(ch) || ch == '.' || ch == '_' || ch == '`');

        private static bool IsOpenBraceFollow(CharacterStream cs, int position) {
            for (var i = position; i < cs.Length; i++) {
                if (!char.IsWhiteSpace(cs[i])) {
                    return cs[i] == '(';
                }
            }

            return false;
        }
    }
}


text:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;

namespace HookActions
{
    [Guid("97407C39-DB5B-4e84-B21A-3CF3A0902838")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("HookActions.hookActionsPan")]
    public sealed class hookActionsPan : BaseCommand
    {
        #region COM Registration Function(s)
        [ComRegisterFunction()]
        [ComVisible(false)]
        static void RegisterFunction(Type registerType)
        {
            // Required for ArcGIS Component Category Registrar support
            ArcGISCategoryRegistration(registerType);

            //
            // TODO: Add any COM registration code here
            //
        }

        [ComUnregisterFunction()]
        [ComVisible(false)]
        static void UnregisterFunction(Type registerType)
        {
            // Required for ArcGIS Component Category Registrar support
            ArcGISCategoryUnregistration(registerType);

            //
            // TODO: Add any COM unregistration code here
            //
        }

        #region ArcGIS Component Category Registrar generated code
        /// <summary>
        /// Required method for ArcGIS Component Category registration -
        /// Do not modify the contents of this method with the code editor.
        /// </summary>
        private static void ArcGISCategoryRegistration(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            GMxCommands.Register(regKey);
            MxCommands.Register(regKey);
            ControlsCommands.Register(regKey);
        }
        /// <summary>
        /// Required method for ArcGIS Component Category unregistration -
        /// Do not modify the contents of this method with the code editor.
        /// </summary>
        private static void ArcGISCategoryUnregistration(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            GMxCommands.Unregister(regKey);
            MxCommands.Unregister(regKey);
            ControlsCommands.Unregister(regKey);
        }

        #endregion
        #endregion

        private IHookHelper m_hookHelper = null;
        private IGlobeHookHelper m_globeHookHelper = null;

        public hookActionsPan()
        {
            base.m_category = "HookActions";
            base.m_caption = "Pan selected features";
            base.m_message = "Pan selected features";
            base.m_toolTip = "Pan selected features";
            base.m_name = "HookActions_Pan";
        }

        public override void OnCreate(object hook)
        {
            // Test the hook that calls this command and disable if nothing valid
            try
            {
                m_hookHelper = new HookHelperClass();
                m_hookHelper.Hook = hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }
            if (m_hookHelper == null)
            {
                //Can be globe
                try
                {
                    m_globeHookHelper = new GlobeHookHelperClass();
                    m_globeHookHelper.Hook = hook;
                    if (m_globeHookHelper.ActiveViewer == null)
                    {
                        //Nothing valid!
                        m_globeHookHelper = null;
                    }
                }
                catch
                {
                    m_globeHookHelper = null;
                }
            }

            if (m_globeHookHelper == null && m_hookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;
        }

        public override bool Enabled
        {
            get
            {
                IHookActions hookActions = null;
                IBasicMap basicMap = null;

                //Get basic map and set hook actions
                if (m_hookHelper != null)
                {
                    basicMap = m_hookHelper.FocusMap as IBasicMap;
                    hookActions = m_hookHelper as IHookActions;
                }
                else if (m_globeHookHelper != null)
                {
                    basicMap = m_globeHookHelper.Globe as IBasicMap;
                    hookActions = m_globeHookHelper as IHookActions;
                }

                //Disable if no features selected
                IEnumFeature enumFeature = basicMap.FeatureSelection as IEnumFeature;
                IFeature feature = enumFeature.Next();
                if (feature == null) return false;

                //Enable if action supported on first selected feature
                if (hookActions.get_ActionSupported(feature.Shape, esriHookActions.esriHookActionsPan))
                    return true;
                else
                    return false;
            }
        }

        public override void OnClick()
        {
            IHookActions hookActions = null;
            IBasicMap basicMap = null;

            //Get basic map and set hook actions
            if (m_hookHelper != null)
            {
                basicMap = m_hookHelper.FocusMap as IBasicMap;
                hookActions = m_hookHelper as IHookActions;
            }

            else if (m_globeHookHelper != null)
            {
                basicMap = m_globeHookHelper.Globe as IBasicMap;
                hookActions = m_globeHookHelper as IHookActions;
            }

            //Get feature selection
            ISelection selection = basicMap.FeatureSelection;
            //Get enumerator
            IEnumFeature enumFeature = selection as IEnumFeature;
            enumFeature.Reset();
            //Set first feature
            IFeature feature;
            feature = enumFeature.Next();

            //Loop though the features
            IArray array = new ESRI.ArcGIS.esriSystem.Array();
            while (feature != null)
            {
                //Add feature to array
                array.Add(feature.Shape);
                //Set next feature
                feature = enumFeature.Next();
            }

            //If the action is supported perform the action
            if (hookActions.get_ActionSupportedOnMultiple(array, esriHookActions.esriHookActionsPan))
                hookActions.DoActionOnMultiple(array, esriHookActions.esriHookActionsPan);
        }
    }
}


text:
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

/**
 * A class that listens for touch events and produces events when these
 * touches form gestures (e.g. pinching).
 */
class GestureDetector {
  /**
   * Constructs a GestureDetector.
   * @param {!Element} element The element to monitor for touch gestures.
   */
  constructor(element) {
    this.element_ = element;

    this.element_.addEventListener('touchstart', this.onTouchStart_.bind(this));
    this.element_.addEventListener('touchmove', this.onTouch_.bind(this));
    this.element_.addEventListener('touchend', this.onTouch_.bind(this));
    this.element_.addEventListener('touchcancel', this.onTouch_.bind(this));

    this.pinchStartEvent_ = null;
    this.lastEvent_ = null;

    this.listeners_ = new Map([
      ['pinchstart', []],
      ['pinchupdate', []],
      ['pinchend', []]
    ]);
  }

  /**
   * Add a |listener| to be notified of |type| events.
   * @param {string} type The event type to be notified for.
   * @param {Function} listener The callback.
   */
  addEventListener(type, listener) {
    if (this.listeners_.has(type)) {
      this.listeners_.get(type).push(listener);
    }
  }

  /**
   * Call the relevant listeners with the given |pinchEvent|.
   * @private
   * @param {!Object} pinchEvent The event to notify the listeners of.
   */
  notify_(pinchEvent) {
    let listeners = this.listeners_.get(pinchEvent.type);

    for (let l of listeners)
      l(pinchEvent);
  }

  /**
   * The callback for touchstart events on the element.
   * @private
   * @param {!TouchEvent} event Touch event on the element.
   */
  onTouchStart_(event) {
    // We must preventDefault if there is a two finger touch. By doing so
    // native pinch-zoom does not interfere with our way of handling the event.
    if (event.touches.length == 2) {
      event.preventDefault();
      this.pinchStartEvent_ = event;
      this.lastEvent_ = event;
      this.notify_({
        type: 'pinchstart',
        center: GestureDetector.center_(event)
      });
    }
  }

  /**
   * The callback for touch move, end, and cancel events on the element.
   * @private
   * @param {!TouchEvent} event Touch event on the element.
   */
  onTouch_(event) {
    if (!this.pinchStartEvent_)
      return;

    // Check if the pinch ends with the current event.
    if (event.touches.length < 2 ||
        this.lastEvent_.touches.length !== event.touches.length) {
      let startScaleRatio = GestureDetector.pinchScaleRatio_(
          this.lastEvent_, this.pinchStartEvent_);
      let center = GestureDetector.center_(this.lastEvent_);
      let endEvent = {
        type: 'pinchend',
        startScaleRatio: startScaleRatio,
        center: center
      };
      this.pinchStartEvent_ = null;
      this.lastEvent_ = null;
      this.notify_(endEvent);
      return;
    }

    let scaleRatio = GestureDetector.pinchScaleRatio_(event, this.lastEvent_);
    let startScaleRatio = GestureDetector.pinchScaleRatio_(
        event, this.pinchStartEvent_);
    let center = GestureDetector.center_(event);
    this.notify_({
      type: 'pinchupdate',
      scaleRatio: scaleRatio,
      direction: scaleRatio > 1.0 ? 'in' : 'out',
      startScaleRatio: startScaleRatio,
      center: center
    });

    this.lastEvent_ = event;
  }

  /**
   * Computes the change in scale between this touch event
   * and a previous one.
   * @private
   * @param {!TouchEvent} event Latest touch event on the element.
   * @param {!TouchEvent} prevEvent A previous touch event on the element.
   * @return {?number} The ratio of the scale of this event and the
   *     scale of the previous one.
   */
  static pinchScaleRatio_(event, prevEvent) {
    let distance1 = GestureDetector.distance_(prevEvent);
    let distance2 = GestureDetector.distance_(event);
    return distance1 === 0 ? null : distance2 / distance1;
  }

  /**
   * Computes the distance between fingers.
   * @private
   * @param {!TouchEvent} event Touch event with at least 2 touch points.
   * @return {number} Distance between touch[0] and touch[1].
   */
  static distance_(event) {
    let touch1 = event.touches[0];
    let touch2 = event.touches[1];
    let dx = touch1.clientX - touch2.clientX;
    let dy = touch1.clientY - touch2.clientY;
    return Math.sqrt(dx * dx + dy * dy);
  }

  /**
   * Computes the midpoint between fingers.
   * @private
   * @param {!TouchEvent} event Touch event with at least 2 touch points.
   * @return {!Object} Midpoint between touch[0] and touch[1].
   */
  static center_(event) {
    let touch1 = event.touches[0];
    let touch2 = event.touches[1];
    return {
      x: (touch1.clientX + touch2.clientX) / 2,
      y: (touch1.clientY + touch2.clientY) / 2
    };
  }
};


text:
========
Usage
========

To use SciScrapy in a project::

	import sciscrapy


text:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:map="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
    android:layout_height="match_parent" android:id="@+id/map"
    tools:context="com.xd6.googlemapstoy.MapsActivity"
    android:name="com.google.android.gms.maps.SupportMapFragment" />


text: export { RowInsert16 as default } from "../../";


text: Documentation via DocBlock comments as known from Javadoc.


text:
package service

import "github.com/mesosphere/tweeter-go/model"

type TweetRepo interface {
	Service
	Create(model.Tweet) (model.Tweet, error)
	FindByID(id string) (model.Tweet, bool, error)
	All() ([]model.Tweet, error)
}


text:
Kaitlyn McPartland Reflections
==============================

GPS 1.1
--------

#####What Git concepts were you struggling with prior to the GPS session?
Before the GPS session I had never seen a merge conflict before and wasn't clear on what the workflow to resolve them was.

#####What concepts were clarified during the GPS?
I definately have a better understanding of how to handle merge conflicts. I would benefit from a little more practice to feel truely comfortable but I know enough now to work on it on my own.

I also learned some new things about branching, I didn't realize that when you made a new branch it branches off of whatever branch you have checked out (I assumed they all came from the master).

#####What questions did you ask your pair and the guide?
I asked my guide/pair (they were the same person) to clarify the differences between git fetch, git merge, and git pull. I now understand that git fetch used with git merge can be equal to using git pull.

#####What still confuses you about Git?
There is nothing specific that I am confused about. I think that I need to practice resolving merge conflicts again but overall I feel pretty comfortable with Git at the moment.

#####How was your first experience of pairing in a GPS?
I had a great first GPS exerience. There was not another student so my guide, Sara, was my pair. I was pleasantly surprised that she was my partner, I felt a little less nervous pairing with her than I would have been with another student. Being the navigator felt a little weird, I felt like I was being a little bit bossy by giving the driver so many directions but Sara said I was doing well. It is just something I will have to get used to and I can work on giving direction while still collaborating with the driver.


text:
import { combineReducers } from 'redux';

import adminResourcesPageReducer from './adminResourcesPageReducer';
import modalsReducer from './modalsReducer';
import reservationInfoModalReducer from './reservationInfoModalReducer';
import reservationsReducer from './reservationsReducer';
import resourceMapReducer from './resourceMapReducer';
import accessibilityReducer from './accessibilityReducer';

const uiReducers = combineReducers({
  modals: modalsReducer,
  pages: combineReducers({ adminResources: adminResourcesPageReducer }),
  reservationInfoModal: reservationInfoModalReducer,
  reservations: reservationsReducer,
  resourceMap: resourceMapReducer,
  accessibility: accessibilityReducer,
});

export default uiReducers;


text:
layout: master
title: Posts
permalink: /posts/index.html
---

{{ site.title }}

{% include posts.html %}