text:
<?xml version='1.0' encoding='utf-8'?>
<Jobs>
  <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="53f03920-5baf-4413-9229-221f50601f68">
    <SourceTemplate><![CDATA[<Jobs>
  <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="0fb30714-8ed0-4611-8f1b-cb8fec9dae91">
    <WebsiteUrl />
    <UserAgent>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19</UserAgent>
    <UserNotes />
    <LastFileSize>384846</LastFileSize>
    <LastFileDate>2012-05-23T02:09:37.7748325</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Default</DownloadBeta>
    <DownloadDate xsi:nil="true" />
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <CanBeShared>true</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>StartEnd</VariableType>
            <Regex />
            <Url><placeholder name="Url with version information" value="http://get.adobe.com/es/shockwave/" /></Url>
            <StartText>

    7-Zip </StartText>
            <EndText>
</EndText>
            <TextualContent />
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>url64</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>""</TextualContent>
            <Name>url64</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category />
    <SourceType>FixedUrl</SourceType>
    <DeletePreviousFile>false</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2012-05-23T02:09:37.7748325</LastUpdated>
    <TargetPath>C:\Chocolatey\_work\</TargetPath>
    <FixedDownloadUrl><placeholder name="Download Url - Optional" value="http://fpdownload.macromedia.com/get/shockwave/default/english/win95nt/latest/Shockwave_Installer_Slim.exe" /></FixedDownloadUrl>
    <Name><placeholder name="Name" value="adobeshockwaveplayer" /></Name>
  </ApplicationJob>
</Jobs>]]></SourceTemplate>
    <WebsiteUrl />
    <UserAgent>Mozilla/5.0 (Windows NT 6.1; WOW64)</UserAgent>
    <UserNotes />
    <LastFileSize>2231296</LastFileSize>
    <LastFileDate>2015-06-02T04:33:31.5312566</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Avoid</DownloadBeta>
    <DownloadDate xsi:nil="true" />
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <HashVariable />
    <HashType>None</HashType>
    <CanBeShared>true</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>{appname}\s*?([\d\.]+)</Regex>
            <Url>http://www.filehippo.com/download_adwcleaner/</Url>
            <StartText><title>Descargar Shockwave Player </StartText>
            <EndText> - FileHippo.com</title>
</EndText>
            <TextualContent>12.1.4.1542</TextualContent>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>url</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(?<=ResponseUri: )[^\r\n]+</Regex>
            <Url>http://www.filehippo.com{filePath}</Url>
            <TextualContent />
            <Name>url</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>fileHippoId</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(?<=data-href=")(.*?)(?=")</Regex>
            <Url>http://www.filehippo.com/download_{appname}/</Url>
            <Name>fileHippoId</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>downloadPath</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(?<=green button-link.*?href=")(.*?)(?=")</Regex>
            <Url>{fileHippoId}</Url>
            <Name>downloadPath</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>filePath</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(?<=
[\r\n]*<a href="?)(/.*?[A-Fa-f0-9]{64}/*)(?=")</Regex>
            <Url>{downloadPath}</Url>
            <Name>filePath</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>nopush</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>--nopush</TextualContent>
            <Name>nopush</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>cscript</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>2</TextualContent>
            <Name>cscript</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category />
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation>F:\exe\adwcleaner_4.206.exe</PreviousLocation>
    <DeletePreviousFile>false</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2015-06-02T04:33:31.5312566</LastUpdated>
    <TargetPath>{workdir}\</TargetPath>
    <FixedDownloadUrl>{url}</FixedDownloadUrl>
    <Name>adwcleaner</Name>
  </ApplicationJob>
</Jobs>


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <scale android:fromXScale="100%p"
           android:toXScale="80%p"
           android:fromYScale="100%p"
           android:toYScale="80%p"
           android:pivotX="50%p"
           android:pivotY="50%p"
           android:duration="@android:integer/config_mediumAnimTime" />
    <alpha android:fromAlpha="1"
           android:toAlpha="0.0"
           android:duration="@android:integer/config_mediumAnimTime" />
</set>

redpajama_set_name: RedPajamaGithub


text:
{- |
Types for Automaton
-}
module FST.AutomatonTypes (

  -- * Types
  StateTy, FirstState, LastState, InitialStates, FinalStates,
  Transitions, TransitionTable,
  Sigma,

  -- * Type class
  AutomatonFunctions (..)
  ) where

-- | A state
type StateTy = Int

-- | First state
type FirstState = Int

-- | Last state
type LastState = Int

-- | Initial states
type InitialStates = [StateTy]

-- | Final states
type FinalStates = [StateTy]

-- | Transitions
type Transitions a = [(a, StateTy)]

-- | Table of transitions
type TransitionTable a = [(StateTy, Transitions a)]

-- | The alphabet of an automaton
type Sigma a = [a]

-- | Class of AutomatonFunctions
class AutomatonFunctions f where
  -- | Get the states of an automaton
  states          :: f a -> [StateTy]
  -- | Is the given state a final state?
  isFinal         :: f a -> StateTy -> Bool
  -- | Get the final states of an automaton
  finals          :: f a -> FinalStates
  -- | Get the initial states of an automaton
  initials        :: f a -> InitialStates
  -- | Get the transitions w.r.t. a state
  transitionList  :: f a -> StateTy -> Transitions a
  -- | Get the transitionTable
  transitionTable :: f a -> TransitionTable a
  -- | Get the transitions  w.r.t. a state and a symbol
  transitions     :: Eq a => f a -> (StateTy, a) -> [StateTy]
  -- | Get the first state of a automaton
  firstState      :: Eq a => f a -> StateTy
  -- | Get the last state of a automaton
  lastState       :: Eq a => f a -> StateTy
  -- | Get the alphabet of an automaton
  alphabet        :: f a -> Sigma a


text:
package org.keycloak.models.map.storage.hotRod.singleUseObject;

import org.infinispan.protostream.GeneratedSchema;
import org.infinispan.protostream.annotations.AutoProtoSchemaBuilder;
import org.infinispan.protostream.annotations.ProtoDoc;
import org.infinispan.protostream.annotations.ProtoField;
import org.keycloak.models.map.annotations.GenerateHotRodEntityImplementation;
import org.keycloak.models.map.annotations.IgnoreForEntityImplementationGenerator;
import org.keycloak.models.map.singleUseObject.MapSingleUseObjectEntity;
import org.keycloak.models.map.storage.hotRod.common.AbstractHotRodEntity;
import org.keycloak.models.map.storage.hotRod.common.CommonPrimitivesProtoSchemaInitializer;
import org.keycloak.models.map.storage.hotRod.common.HotRodPair;
import org.keycloak.models.map.storage.hotRod.common.UpdatableHotRodEntityDelegateImpl;

import java.util.Set;

@GenerateHotRodEntityImplementation(
        implementInterface = "org.keycloak.models.map.singleUseObject.MapSingleUseObjectEntity",
        inherits = "org.keycloak.models.map.storage.hotRod.singleUseObject.HotRodSingleUseObjectEntity.AbstractHotRodSingleUseObjectEntityDelegate",
        topLevelEntity = true,
        modelClass = "org.keycloak.models.SingleUseObjectValueModel"
)
@ProtoDoc("@Indexed")
@ProtoDoc("schema-version: " + HotRodSingleUseObjectEntity.VERSION)
public class HotRodSingleUseObjectEntity extends AbstractHotRodEntity {

    @IgnoreForEntityImplementationGenerator
    public static final int VERSION = 1;

    @AutoProtoSchemaBuilder(
            includeClasses = {
                    HotRodSingleUseObjectEntity.class
            },
            schemaFilePath = "proto/",
            schemaPackageName = CommonPrimitivesProtoSchemaInitializer.HOT_ROD_ENTITY_PACKAGE,
            dependsOn = {CommonPrimitivesProtoSchemaInitializer.class}
    )
    public interface HotRodSingleUseObjectEntitySchema extends GeneratedSchema {
        HotRodSingleUseObjectEntitySchema INSTANCE = new HotRodSingleUseObjectEntitySchemaImpl();
    }

    @ProtoDoc("@Field(index = Index.YES, store = Store.YES)")
    @ProtoField(number = 1)
    public Integer entityVersion = VERSION;

    @ProtoField(number = 2)
    public String id;

    @ProtoField(number = 3)
    public String objectKey;

    @ProtoField(number = 7)
    public Long expiration;

    @ProtoField(number = 8)
    public Set<HotRodPair<String, String>> notes;

    public static abstract class AbstractHotRodSingleUseObjectEntityDelegate extends UpdatableHotRodEntityDelegateImpl<HotRodSingleUseObjectEntity> implements MapSingleUseObjectEntity {

        @Override
        public String getId() {
            HotRodSingleUseObjectEntity hotRodEntity = getHotRodEntity();
            return hotRodEntity != null ? hotRodEntity.id : null;
        }

        @Override
        public void setId(String id) {
            HotRodSingleUseObjectEntity entity = getHotRodEntity();
            if (entity.id != null) throw new IllegalStateException("Id cannot be changed");
            entity.id = id;
            entity.updated |= id != null;
        }
    }

    @Override
    public boolean equals(Object o) {
        return HotRodSingleUseObjectEntityDelegate.entityEquals(this, o);
    }

    @Override
    public int hashCode() {
        return HotRodSingleUseObjectEntityDelegate.entityHashCode(this);
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.13"/>

        <title>CubbyFlow: CubbyFlow::VectorGridBuilder< N > Class Template Reference</title>

        <link href="search/search.css" rel="stylesheet" type="text/css"/>

        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">

                    CubbyFlow v0.71

CubbyFlow

VectorGridBuilder

Public Member Functions |
List of all members

CubbyFlow::VectorGridBuilder< N > Class Template Referenceabstract

Abstract base class for N-D vector grid builder.
 More...

#include <Core/Grid/VectorGrid.hpp>

Inheritance diagram for CubbyFlow::VectorGridBuilder< N >:

  <map id="CubbyFlow::VectorGridBuilder_3C_20N_20_3E_map" name="CubbyFlow::VectorGridBuilder_3C_20N_20_3E_map">
<area href="class_cubby_flow_1_1_cell_centered_vector_grid_1_1_builder.html" title="Front-end to create CellCenteredVectorGrid objects step by step. " alt="CubbyFlow::CellCenteredVectorGrid< N >::Builder" shape="rect" coords="0,56,312,80"/>
<area href="class_cubby_flow_1_1_face_centered_grid_1_1_builder.html" title="Front-end to create FaceCenteredGrid objects step by step. " alt="CubbyFlow::FaceCenteredGrid< N >::Builder" shape="rect" coords="322,56,634,80"/>
<area href="class_cubby_flow_1_1_vertex_centered_vector_grid_1_1_builder.html" title="A grid builder class that returns N-D vertex-centered vector grid. " alt="CubbyFlow::VertexCenteredVectorGrid< N >::Builder" shape="rect" coords="644,56,956,80"/>
</map>

Public Member Functions

 	VectorGridBuilder ()=default

 	Creates a builder.  More...

virtual 	~VectorGridBuilder ()=default

 	Default virtual destructor.  More...

 	VectorGridBuilder (const VectorGridBuilder &other)=delete

 	Deleted copy constructor.  More...

 	VectorGridBuilder (VectorGridBuilder &&other) noexcept=delete

 	Deleted move constructor.  More...

VectorGridBuilder & 	operator= (const VectorGridBuilder &other)=delete

 	Deleted copy assignment operator.  More...

VectorGridBuilder & 	operator= (VectorGridBuilder &&other) noexcept=delete

 	Deleted move assignment operator.  More...

virtual std::shared_ptr< VectorGrid< N > > 	Build (const Vector< size_t, N > &resolution, const Vector< double, N > &gridSpacing, const Vector< double, N > &gridOrigin, const Vector< double, N > &initialVal) const =0

 	Returns N-D vector grid with given parameters.  More...

Detailed Description

template<size_t N>

class CubbyFlow::VectorGridBuilder< N >

Abstract base class for N-D vector grid builder.

Constructor & Destructor Documentation

◆ VectorGridBuilder() [1/3]

template<size_t N>

          CubbyFlow::VectorGridBuilder< N >::VectorGridBuilder
          (
          	)

default

Creates a builder.

◆ ~VectorGridBuilder()

template<size_t N>

          virtual CubbyFlow::VectorGridBuilder< N >::~VectorGridBuilder
          (
          	)

virtualdefault

Default virtual destructor.

◆ VectorGridBuilder() [2/3]

template<size_t N>

          CubbyFlow::VectorGridBuilder< N >::VectorGridBuilder
          (
          const VectorGridBuilder< N > &
          other	)

delete

Deleted copy constructor.

◆ VectorGridBuilder() [3/3]

template<size_t N>

          CubbyFlow::VectorGridBuilder< N >::VectorGridBuilder
          (
          VectorGridBuilder< N > &&
          other	)

deletenoexcept

Deleted move constructor.

Member Function Documentation

◆ Build()

template<size_t N>

          virtual std::shared_ptr<VectorGrid<N> > CubbyFlow::VectorGridBuilder< N >::Build
          (
          const Vector< size_t, N > &
          resolution,

          const Vector< double, N > &
          gridSpacing,

          const Vector< double, N > &
          gridOrigin,

          const Vector< double, N > &
          initialVal

          )
          	 const

pure virtual

Returns N-D vector grid with given parameters.

Implemented in CubbyFlow::FaceCenteredGrid< N >::Builder, CubbyFlow::CellCenteredVectorGrid< N >::Builder, and CubbyFlow::VertexCenteredVectorGrid< N >::Builder.

◆ operator=() [1/2]

template<size_t N>

          VectorGridBuilder& CubbyFlow::VectorGridBuilder< N >::operator=
          (
          const VectorGridBuilder< N > &
          other	)

delete

Deleted copy assignment operator.

◆ operator=() [2/2]

template<size_t N>

          VectorGridBuilder& CubbyFlow::VectorGridBuilder< N >::operator=
          (
          VectorGridBuilder< N > &&
          other	)

deletenoexcept

Deleted move assignment operator.

The documentation for this class was generated from the following file:

Core/Grid/VectorGrid.hpp

<address class="footer">
Generated on Thu Jul 15 2021 02:18:16 for CubbyFlow by

 1.8.13
</address>


text:
from lettuce import step, world
from survey.features.page_objects.question_module import QuestionModuleList, NewQuestionModule, EditQuestionModulePage
from survey.models import QuestionModule

@step(u'And I have two question modules')
def and_i_have_two_question_modules(step):
    world.health_module = QuestionModule.objects.create(name="Health")
    world.education_module = QuestionModule.objects.create(name="Education")

@step(u'When I visit the list questions modules page')
def when_i_visit_the_list_questions_modules_page(step):
    world.page = QuestionModuleList(browser=world.browser)
    world.page.visit()

@step(u'Then I should see the questions modules listed')
def then_i_should_see_the_questions_modules_listed(step):
    fields = [world.health_module.name, world.education_module.name,
              'Number', 'Module Name', 'Module Lists']
    world.page.validate_fields_present(fields)

@step(u'When I visit the create questions module page')
def when_i_visit_the_create_questions_module_page(step):
    world.page = NewQuestionModule(world.browser)
    world.page.visit()
    world.page.validate_url()

@step(u'And I fill in the question module details')
def and_i_fill_in_the_question_module_details(step):
    world.page.fill_valid_values({'name': 'Education'})

@step(u'Then I should see that the question module on the listing page')
def then_i_should_see_that_the_question_module_on_the_listing_page(step):
    world.page = QuestionModuleList(browser=world.browser)
    fields = ['Education', 'Number', 'Module Name', 'Module Lists']
    world.page.validate_fields_present(fields)

@step(u'And I click delete module')
def and_i_click_delete_module(step):
    world.page.click_by_css("#delete-question-module_%s" %
                            world.health_module.id)

@step(u'I should see a delete module confirmation modal')
def i_should_see_a_confirmation_modal(step):
    world.page.see_confirm_modal_message(world.health_module.name)

@step(u'When I confirm delete')
def when_i_confirm_delete(step):
    world.page.click_by_css("#delete-module-%s" % world.health_module.id)

@step(u'Then I should see the module was deleted')
def then_i_should_see_the_module_was_deleted(step):
    world.page.see_success_message("Module", "deleted")

@step(u'And I click edit module')
def and_i_click_edit_module(step):
    world.page.click_by_css("#edit-module_%s" % world.health_module.id)

@step(u'I should see a edit module page')
def i_should_see_a_edit_module_page(step):
    world.page = EditQuestionModulePage(world.browser, world.health_module)
    world.page.validate_url()

@step(u'When I fill in valid values')
def when_i_fill_in_valid_values(step):
    world.page.fill_valid_values({'name': 'Edited Module'})

@step(u'Then I should see the edited question module')
def then_i_should_see_the_edited_question_module(step):
    world.page = QuestionModuleList(world.browser)
    assert not world.page.browser.find_link_by_text(world.health_module.name)
    world.page.is_text_present('Edited Module')
    world.page.see_success_message("Question module", "edited")


text:
function [out_spikes,out_freq] = psr_stimulus_window(spikes,freq,stimtimes,parameters)

% PSR_STIMULUS_WINDOW - Extract data window around stimulus onsets.
%
% Syntax:  [out_spikes,out_freq] = psr_stimulus_window(spikes,freq,stimtimes,parameters)
%
% Inputs:
%    spikes     - See README
%    freq       - See README
%    stimtimes  - Two-element cell array, structured as followed:
%                 stimtimes{1}: stimulus timings [sec]
%                 stimtimes{2}: 'onset' or 'interval'
%
%                 ## If stimtimes{2} = 'onset',
%                    then stimtimes{1} should be a column vector containing
%                    each stimulus onset
%
%                 ## If stimtimes{2} = 'interval',
%                    then stimtimes{1} should be a two-column matrix
%                    containing the stimulus onsets in the first column and
%                    the stimulus offsets in the second column
%
%    parameters - See README and PSR_PARAMETERS_GENERAL
%
% Outputs:
%    out_spikes - Contains the "trials" field, which indicates the stimulus
%                 windows
%    out_freq   - LFP data aligned to stimulus onset

% PASER: Processing and Analysis Schemes for Extracellular Recordings
% https://github.com/tbrouns/paser

% Author: Terence Brouns
% Radboud University, Neurophysiology Dept.
% E-mail address: t.s.n.brouns@gmail.com
% Date: 2018

%------------- BEGIN CODE --------------

% Output
out_spikes = [];
out_freq   = [];

% Extract stimulus windows

stimulusTimes  = stimtimes{1};
stimulusType   = stimtimes{2};
stimulusOnset  = [];
stimulusOffset = [];
stimTimesTemp  = [];

if (~isempty(stimulusTimes))
    stimulusOnset  = stimulusTimes(:,1) + parameters.analysis.stimoffset;
    keep = ~isnan(stimulusOnset);
    stimulusOnset = stimulusOnset(keep);
    stimTimesTemp = stimulusOnset;
end

if (~isempty(stimulusTimes) && size(stimulusTimes,2) >= 2)
    stimulusOffset = stimulusTimes(:,2);
    stimulusOffset = stimulusOffset(keep);
    stimTimesTemp  = [stimulusOnset,stimulusOffset];
end

stimulusTimes = stimTimesTemp;
nOnsets = size(stimulusTimes,1); % number of stimulus onsets

if (~isempty(stimulusTimes))

    %% Local field potential
    if (~isempty(freq)); out_freq = psr_ft_convert2trials(freq,parameters,stimulusTimes,stimulusType); end

    %% Spikes
    if (~isempty(spikes))

        spikeTimes = spikes.spiketimes;

        % Initialize
        spikes.info.trialtime  = [];
        spikes.info.trialonset = [];
        spikes.info.stimdur    = [];

        switch stimulusType
            case 'onset'
                tPre  = parameters.analysis.spk.t_win(1);
                tPost = parameters.analysis.spk.t_win(2);
                tPost = repmat(tPost,nOnsets,1);
            case 'interval'
                tPre  = 0;
                tPost = stimulusOffset - stimulusOnset;
        end

        spikes.info.trialonset = stimulusOnset;
        spikes.info.trialtime  = [repmat(tPre,length(tPost),1),tPost];

        trials = false(nOnsets,length(spikeTimes));

        if (~isempty(spikeTimes))
            for iTrial = 1:nOnsets
                tOnset = stimulusOnset(iTrial);
                spikeIDs = spikeTimes >= tOnset + tPre & spikeTimes <= tOnset + tPost(iTrial);
                trials(iTrial,spikeIDs) = true;
            end
            keep = any(trials,1); % only keep spikes inside of trials
            spikes = psr_sst_remove_spikes(spikes,keep,'keep');
            spikes.trials = trials(:,keep);
        end

        out_spikes = spikes;
    end
end

end


text:
A tool to create a UDF hard drive or usb drive that will be properly
mounted on Windows, OSX, and Linux.

UDF has the potential to replace FAT32 or NTFS on USB drives, it has a lot
of modern features and is supported by all OSes for Read/Write at v2.01 of UDF

This tool is based on the Perl script by Pieter @ http://sipa.ulyssis.org/2010/02/filesystems-for-portable-disks/

### Usage

Install globally:
```
npm install -g udfhd
```

or run locally after cloning.

To format a drive, use the following command as root.
WARNING: There is no protection on what drive you choose. Be careful which path you provide.
I am not responsible if you wipe your entire drive.
This is a destructive operation.

```
udfhd /dev/sda AwesomeHD
```

udfhd takes 2 parameters. A required device and an optional label for the drive.
I default to "UDF" if you don't provide a label.

### TODO
After making sure it works on Linux, I plan to make it work on Windows.
Theoretically it should work just fine with \\.\PhysicalDriveX pathes on Windows.

### License
This is released on the MIT License. For full details, read the LICENSE file.


text:
package net.exoego.stream;

import java.util.List;
import java.util.Random;
import java.util.stream.Stream;

import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;

import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

@RunWith(Enclosed.class)
public class MoreStreamsTest {
    @Test
    public void Grouped_creates_sequence_where_elements_are_grouped_elements_of_base_stream() {
        Stream<String> alphabetChars = asList("abcdefghijklmnopqrstuvwxyz".split("")).stream();
        Stream<List<String>> grouped = MoreStreams.grouped(alphabetChars, 5);
        List<String> result = grouped.map(l -> String.join("", l)).collect(toList());
        assertThat(result, is(asList("abcde", "fghij", "klmno", "pqrst", "uvwxy", "z")));
    }

    @Test
    public void Grouped_sequence_of_single_list_if_group_size_is_greater_than_stream_size() {
        Stream<String> alphabetChars = asList("abcdefghijklmnopqrstuvwxyz".split("")).stream();
        Stream<List<String>> grouped = MoreStreams.grouped(alphabetChars, 1000);
        List<String> result = grouped.map(l -> String.join("", l)).collect(toList());
        assertThat(result, is(asList("abcdefghijklmnopqrstuvwxyz")));
    }

    @Test(expected = NullPointerException.class)
    public void Grouped_fail_fast_if_0_given() {
        MoreStreams.grouped(Stream.empty(), 0);
    }

    @Test(expected = NullPointerException.class)
    public void Grouped_fail_fast_if_null_stream_given() {
        final Stream<Object> empty = null;
        MoreStreams.grouped(empty, 5);
    }

    @Test(expected = IllegalArgumentException.class)
    public void Grouped_fail_fast_if_negative_given() {
        final int r = new Random().nextInt();
        final int negative = (r == Integer.MIN_VALUE) ? r : Math.negateExact(r);
        MoreStreams.grouped(Stream.empty(), negative);
    }
}


text:
package org.ovirt.engine.core.common.action;

import java.util.logging.Logger;

import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.core.compat.Guid;

public class AddVmTemplateParameters_CustomFieldSerializer {
	private static Logger logger = Logger.getLogger(AddVmTemplateParameters.class.getName());

	public static void deserialize(SerializationStreamReader streamReader,
			AddVmTemplateParameters instance) throws SerializationException {
	}

	public static AddVmTemplateParameters instantiate(
			SerializationStreamReader streamReader)
			throws SerializationException {
		logger.severe("Instantiating AddVmTemplateParameters via custom serializer.");
		AddVmTemplateParameters instance = new AddVmTemplateParameters((VM)streamReader.readObject(), streamReader.readString(), streamReader.readString());
		instance.setVmTemplateID((Guid)streamReader.readObject());
		instance.setPublicUse(streamReader.readBoolean());
		instance.setDestinationStorageDomainId((Guid)streamReader.readObject());
		return instance;
	}

	public static void serialize(SerializationStreamWriter streamWriter,
			AddVmTemplateParameters instance) throws SerializationException {
		logger.severe("Serializing AddVmTemplateParameters.");
		streamWriter.writeObject(instance.getVm());
		streamWriter.writeString(instance.getName());
		streamWriter.writeString(instance.getDescription());
		streamWriter.writeObject(instance.getVmTemplateId());
		streamWriter.writeBoolean(instance.isPublicUse());
		streamWriter.writeObject(instance.getDestinationStorageDomainId());
	}
}


text:
declare -A params=$6       # Create an associative array
declare -A headers=${9}    # Create an associative array
declare -A rewrites=${10}  # Create an associative array
paramsTXT=""
if [ -n "$6" ]; then
   for element in "${!params[@]}"
   do
      paramsTXT="${paramsTXT}
      fastcgi_param ${element} ${params[$element]};"
   done
fi
headersTXT=""
if [ -n "${9}" ]; then
   for element in "${!headers[@]}"
   do
      headersTXT="${headersTXT}
      add_header ${element} ${headers[$element]};"
   done
fi
rewritesTXT=""
if [ -n "${10}" ]; then
   for element in "${!rewrites[@]}"
   do
      rewritesTXT="${rewritesTXT}
      location ~ ${element} { if (!-f \$request_filename) { return 301 ${rewrites[$element]}; } }"
   done
fi

if [ "$7" = "true" ]
then configureXhgui="
location /xhgui {
        try_files \$uri \$uri/ /xhgui/index.php?\$args;
}
"
else configureXhgui=""
fi

block="server {
    listen ${3:-80};
    listen ${4:-443} ssl http2;
    server_name .$1;
    root \"$2\";

    index index.php index.html index.htm;

    charset utf-8;

    $rewritesTXT

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { allow all; access_log off; log_not_found off; }

    location ~ /.*\.(jpg|jpeg|png|js|css)$ {
        try_files \$uri =404;
    }

    location / {
        try_files \$uri \$uri/ /index.php?\$query_string;
    }

    if (!-e \$request_filename) {
        # Add trailing slash to */wp-admin requests.
        rewrite /wp-admin$ \$scheme://\$host\$uri/ permanent;

        # WordPress in a subdirectory rewrite rules
        rewrite ^/([_0-9a-zA-Z-]+/)?(wp-.*|xmlrpc.php) /wp/\$2 break;
    }

    location ~ \.php$ {
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
        fastcgi_pass unix:/var/run/php/php$5-fpm.sock;
        fastcgi_intercept_errors on;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
    }

    $configureXhgui

    access_log off;
    error_log  /var/log/nginx/$1-error.log error;

    sendfile off;

    location ~ /\.ht {
        deny all;
    }

    ssl_certificate     /etc/nginx/ssl/$1.crt;
    ssl_certificate_key /etc/nginx/ssl/$1.key;
}
"

echo "$block" > "/etc/nginx/sites-available/$1"
ln -fs "/etc/nginx/sites-available/$1" "/etc/nginx/sites-enabled/$1"

# Additional constants to define in wp-config.php
wpConfigSearchStr="\$table_prefix = 'wp_';"
wpConfigReplaceStr="\$table_prefix = 'wp_';\\n\
\\n\
// Define the default HOME/SITEURL constants and set them to our root domain\\n\
if ( ! defined( 'WP_HOME' ) ) {\\n\
	define( 'WP_HOME', 'http://$1' );\\n\
}\\n\
if ( ! defined( 'WP_SITEURL' ) ) {\\n\
	define( 'WP_SITEURL', WP_HOME );\\n\
}\\n\
\\n\
if ( ! defined( 'WP_CONTENT_DIR' ) ) {\\n\
	define( 'WP_CONTENT_DIR', __DIR__ . '/wp-content' );\\n\
}\\n\
if ( ! defined( 'WP_CONTENT_URL' ) ) {\\n\
	define( 'WP_CONTENT_URL', WP_HOME . '/wp-content' );\\n\
}\\n\
"

# If wp-cli is installed, try and update it
if [ -f /usr/local/bin/wp ]
then
    wp cli update --stable --yes
fi

# If WP is not installed then download it
if [ -d "$2/wp" ]
then
    echo "WordPress is already installed."
else
    sudo -i -u vagrant -- mkdir "$2/wp"
    sudo -i -u vagrant -- wp core download --path="$2/wp" --version=latest
    sudo -i -u vagrant -- cp -R $2/wp/wp-content $2/wp-content
    sudo -i -u vagrant -- cp $2/wp/index.php $2/index.php
    sudo -i -u vagrant -- sed -i "s|/wp-blog-header|/wp/wp-blog-header|g" $2/index.php
    sudo -i -u vagrant -- echo "path: $2/wp/" > $2/wp-cli.yml
    sudo -i -u vagrant -- wp config create --path=$2/wp/ --dbname=${1/./_} --dbuser=homestead --dbpass=secret --dbcollate=utf8_general_ci
    sudo -i -u vagrant -- mv $2/wp/wp-config.php $2/wp-config.php
    sudo -i -u vagrant -- sed -i 's|'"$wpConfigSearchStr"'|'"$wpConfigReplaceStr"'|g' $2/wp-config.php
    sudo -i -u vagrant -- sed -i "s|define( 'ABSPATH', dirname( __FILE__ ) . '/' );|define( 'ABSPATH', __DIR__ . '/wp/' );|g" $2/wp-config.php

    echo "WordPress has been downloaded and config file has been generated, install it manually."
fi


text:
<?php

namespace OLAP4PHP\Common;

// Interfaces used
use OLAP4PHP\Metadata\INamed;
use OLAP4PHP\MetaData\INamedList;

// Classes used
use \ArrayObject;
use \InvalidArgumentException;

/**
 *
 */
class NamedList extends ArrayObject implements INamedList
{
   public function get( $index )
   {
      if ( parent::offsetExists( $index ) ) return parent::offsetGet( $index );

      // trying to get by index
      if ( is_string( $index ) )
      {
         return parent::offsetExists( $index ) ? parent::offsetGet( $index ) : NULL;
      }
      else {
         if ( is_numeric( $index ) )
         {
            $index = (int)$index;
            if ( $index < 0 || $index >= parent::count() ) return NULL;

            $indexedArray = array_values( parent::getArrayCopy() );
            return $indexedArray[$index];
            //return $obj;
         }
      }

      throw new InvalidArgumentException ("Index $index does not exist in NamedList.");
   }

   public function indexOfName( $name )
   {
      $indexedKeys = array_keys( parent::getArrayCopy() );
      $key         = array_search( $name, $indexedKeys );
      if ( $key !== FALSE )
      {
         return $key;
      }
      else
      {
         return NULL;
      }
   }

   public function size()
   {
      return parent::count();
   }

   public function add( INamed $obj )
   {
      parent::offsetSet( $obj->getName(), $obj );
   }

   /**
    * Add all array object elements to object.
    *
    * @param ArrayObject $list
    */
   public function addAll( ArrayObject $list )
   {
      foreach ( $list as $key => $value )
      {
         parent::offsetSet( $key, $value );
      }
   }
}


text:
package org.apache.spark.scheduler.cluster.k8s

import java.lang.Math.sqrt
import java.util.{Map => JMap}
import java.util.concurrent.{ScheduledExecutorService, TimeUnit}

import scala.collection.JavaConverters._

import org.apache.spark.SparkContext
import org.apache.spark.api.plugin.{DriverPlugin, ExecutorPlugin, PluginContext, SparkPlugin}
import org.apache.spark.deploy.k8s.Config.{EXECUTOR_ROLL_INTERVAL, EXECUTOR_ROLL_POLICY, ExecutorRollPolicy, MINIMUM_TASKS_PER_EXECUTOR_BEFORE_ROLLING}
import org.apache.spark.internal.Logging
import org.apache.spark.internal.config.DECOMMISSION_ENABLED
import org.apache.spark.scheduler.ExecutorDecommissionInfo
import org.apache.spark.status.api.v1
import org.apache.spark.util.ThreadUtils

/**
 * Spark plugin to roll executor pods periodically.
 * This is independent from ExecutorPodsAllocator and aims to decommission executors
 * one by one in both static and dynamic allocation.
 *
 * To use this plugin, we assume that a user has the required maximum number of executors + 1
 * in both static and dynamic allocation configurations.
 */
class ExecutorRollPlugin extends SparkPlugin {
  override def driverPlugin(): DriverPlugin = new ExecutorRollDriverPlugin()

  // No-op
  override def executorPlugin(): ExecutorPlugin = null
}

class ExecutorRollDriverPlugin extends DriverPlugin with Logging {
  private var sparkContext: SparkContext = _

  private val periodicService: ScheduledExecutorService =
    ThreadUtils.newDaemonSingleThreadScheduledExecutor("executor-roller")

  private[k8s] var minTasks: Int = 0

  override def init(sc: SparkContext, ctx: PluginContext): JMap[String, String] = {
    val interval = sc.conf.get(EXECUTOR_ROLL_INTERVAL)
    if (interval <= 0) {
      logWarning(s"Disabled due to invalid interval value, '$interval'")
    } else if (!sc.conf.get(DECOMMISSION_ENABLED)) {
      logWarning(s"Disabled because ${DECOMMISSION_ENABLED.key} is false.")
    } else {
      minTasks = sc.conf.get(MINIMUM_TASKS_PER_EXECUTOR_BEFORE_ROLLING)
      // Scheduler is not created yet
      sparkContext = sc

      val policy = ExecutorRollPolicy.withName(sc.conf.get(EXECUTOR_ROLL_POLICY))
      periodicService.scheduleAtFixedRate(() => {
        try {
          sparkContext.schedulerBackend match {
            case scheduler: KubernetesClusterSchedulerBackend =>
              val executorSummaryList = sparkContext
                .statusStore
                .executorList(true)
              choose(executorSummaryList, policy) match {
                case Some(id) =>
                  // Use decommission to be safe.
                  logInfo(s"Ask to decommission executor $id")
                  val now = System.currentTimeMillis()
                  scheduler.decommissionExecutor(
                    id,
                    ExecutorDecommissionInfo(s"Rolling via $policy at $now"),
                    adjustTargetNumExecutors = false)
                case _ =>
                  logInfo("There is nothing to roll.")
              }
            case _ =>
              logWarning("This plugin expects " +
                s"${classOf[KubernetesClusterSchedulerBackend].getSimpleName}.")
          }
        } catch {
          case e: Throwable => logError("Error in rolling thread", e)
        }
      }, interval, interval, TimeUnit.SECONDS)
    }
    Map.empty[String, String].asJava
  }

  override def shutdown(): Unit = periodicService.shutdown()

  private def choose(list: Seq[v1.ExecutorSummary], policy: ExecutorRollPolicy.Value)
      : Option[String] = {
    val listWithoutDriver = list
      .filterNot(_.id.equals(SparkContext.DRIVER_IDENTIFIER))
      .filter(_.totalTasks >= minTasks)
    val sortedList = policy match {
      case ExecutorRollPolicy.ID =>
        listWithoutDriver.sortBy(_.id)
      case ExecutorRollPolicy.ADD_TIME =>
        listWithoutDriver.sortBy(_.addTime)
      case ExecutorRollPolicy.TOTAL_GC_TIME =>
        listWithoutDriver.sortBy(_.totalGCTime).reverse
      case ExecutorRollPolicy.TOTAL_DURATION =>
        listWithoutDriver.sortBy(_.totalDuration).reverse
      case ExecutorRollPolicy.AVERAGE_DURATION =>
        listWithoutDriver.sortBy(e => e.totalDuration.toFloat / Math.max(1, e.totalTasks)).reverse
      case ExecutorRollPolicy.FAILED_TASKS =>
        listWithoutDriver.sortBy(_.failedTasks).reverse
      case ExecutorRollPolicy.OUTLIER =>
        // If there is no outlier we fallback to TOTAL_DURATION policy.
        outliersFromMultipleDimensions(listWithoutDriver) ++
          listWithoutDriver.sortBy(_.totalDuration).reverse
      case ExecutorRollPolicy.OUTLIER_NO_FALLBACK =>
        outliersFromMultipleDimensions(listWithoutDriver)
    }
    sortedList.headOption.map(_.id)
  }

  /**
   * We build multiple outlier lists and concat in the following importance order to find
   * outliers in various perspective:
   *   AVERAGE_DURATION > TOTAL_DURATION > TOTAL_GC_TIME > FAILED_TASKS
   * Since we will choose only first item, the duplication is okay.
   */
  private def outliersFromMultipleDimensions(listWithoutDriver: Seq[v1.ExecutorSummary]) =
    outliers(listWithoutDriver.filter(_.totalTasks > 0), e => e.totalDuration / e.totalTasks) ++
      outliers(listWithoutDriver, e => e.totalDuration) ++
      outliers(listWithoutDriver, e => e.totalGCTime) ++
      outliers(listWithoutDriver, e => e.failedTasks)

  /**
   * Return executors whose metrics is outstanding, '(value - mean) > 2-sigma'. This is
   * a best-effort approach because the snapshot of ExecutorSummary is not a normal distribution.
   * Outliers can be defined in several ways (https://en.wikipedia.org/wiki/Outlier).
   * Here, we borrowed 2-sigma idea from https://en.wikipedia.org/wiki/68-95-99.7_rule.
   * In case of normal distribution, this is known to be 2.5 percent roughly.
   */
  private def outliers(
      list: Seq[v1.ExecutorSummary],
      get: v1.ExecutorSummary => Float): Seq[v1.ExecutorSummary] = {
    if (list.isEmpty) {
      list
    } else {
      val size = list.size
      val values = list.map(get)
      val mean = values.sum / size
      val sd = sqrt(values.map(v => (v - mean) * (v - mean)).sum / size)
      list
        .filter(e => (get(e) - mean) > 2 * sd)
        .sortBy(e => get(e))
        .reverse
    }
  }
}