text:
namespace llvm {
class error_code;
namespace sys {

  // TODO: Add operations to communicate with the process, redirect its I/O,
  // etc.

  /// This class provides an abstraction for programs that are executable by the
  /// operating system. It provides a platform generic way to find executable
  /// programs from the path and to execute them in various ways. The sys::Path
  /// class is used to specify the location of the Program.
  /// @since 1.4
  /// @brief An abstraction for finding and executing programs.
  class Program {
    /// Opaque handle for target specific data.
    void *Data_;

    // Noncopyable.
    Program(const Program& other) LLVM_DELETED_FUNCTION;
    Program& operator=(const Program& other) LLVM_DELETED_FUNCTION;

    /// @name Methods
    /// @{

    Program();
    ~Program();

    /// This function executes the program using the \p arguments provided.  The
    /// invoked program will inherit the stdin, stdout, and stderr file
    /// descriptors, the environment and other configuration settings of the
    /// invoking program. If Path::executable() does not return true when this
    /// function is called then a std::string is thrown.
    /// @returns false in case of error, true otherwise.
    /// @see FindProgramByName
    /// @brief Executes the program with the given set of \p args.
    bool Execute
    ( const Path& path,  ///< sys::Path object providing the path of the
      ///< program to be executed. It is presumed this is the result of
      ///< the FindProgramByName method.
      const char** args, ///< A vector of strings that are passed to the
      ///< program.  The first element should be the name of the program.
      ///< The list *must* be terminated by a null char* entry.
      const char ** env = 0, ///< An optional vector of strings to use for
      ///< the program's environment. If not provided, the current program's
      ///< environment will be used.
      const sys::Path** redirects = 0, ///< An optional array of pointers to
      ///< Paths. If the array is null, no redirection is done. The array
      ///< should have a size of at least three. If the pointer in the array
      ///< are not null, then the inferior process's stdin(0), stdout(1),
      ///< and stderr(2) will be redirected to the corresponding Paths.
      ///< When an empty Path is passed in, the corresponding file
      ///< descriptor will be disconnected (ie, /dev/null'd) in a portable
      ///< way.
      unsigned memoryLimit = 0, ///< If non-zero, this specifies max. amount
      ///< of memory can be allocated by process. If memory usage will be
      ///< higher limit, the child is killed and this call returns. If zero
      ///< - no memory limit.
      std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string
      ///< instance in which error messages will be returned. If the string
      ///< is non-empty upon return an error occurred while invoking the
      ///< program.
      );

    /// This function waits for the program to exit. This function will block
    /// the current program until the invoked program exits.
    /// @returns an integer result code indicating the status of the program.
    /// A zero or positive value indicates the result code of the program.
    /// -1 indicates failure to execute
    /// -2 indicates a crash during execution or timeout
    /// @see Execute
    /// @brief Waits for the program to exit.
    int Wait
    ( const Path& path, ///< The path to the child process executable.
      unsigned secondsToWait, ///< If non-zero, this specifies the amount
      ///< of time to wait for the child process to exit. If the time
      ///< expires, the child is killed and this call returns. If zero,
      ///< this function will wait until the child finishes or forever if
      ///< it doesn't.
      std::string* ErrMsg ///< If non-zero, provides a pointer to a string
      ///< instance in which error messages will be returned. If the string
      ///< is non-empty upon return an error occurred while waiting.
      );

  public:
    /// This static constructor (factory) will attempt to locate a program in
    /// the operating system's file system using some pre-determined set of
    /// locations to search (e.g. the PATH on Unix). Paths with slashes are
    /// returned unmodified.
    /// @returns A Path object initialized to the path of the program or a
    /// Path object that is empty (invalid) if the program could not be found.
    /// @brief Construct a Program by finding it by name.
    static Path FindProgramByName(const std::string& name);

    // These methods change the specified standard stream (stdin, stdout, or
    // stderr) to binary mode. They return errc::success if the specified stream
    // was changed. Otherwise a platform dependent error is returned.
    static error_code ChangeStdinToBinary();
    static error_code ChangeStdoutToBinary();
    static error_code ChangeStderrToBinary();

    /// A convenience function equivalent to Program prg; prg.Execute(..);
    /// prg.Wait(..);
    /// @see Execute, Wait
    static int ExecuteAndWait(const Path& path,
                              const char** args,
                              const char ** env = 0,
                              const sys::Path** redirects = 0,
                              unsigned secondsToWait = 0,
                              unsigned memoryLimit = 0,
                              std::string* ErrMsg = 0,
                              bool *ExecutionFailed = 0);

    /// A convenience function equivalent to Program prg; prg.Execute(..);
    /// @see Execute
    static void ExecuteNoWait(const Path& path,
                              const char** args,
                              const char ** env = 0,
                              const sys::Path** redirects = 0,
                              unsigned memoryLimit = 0,
                              std::string* ErrMsg = 0);

    /// @}

  };

  // Return true if the given arguments fit within system-specific
  // argument length limits.
  bool argumentsFitWithinSystemLimits(ArrayRef<const char*> Args);
}
}

#endif


text:
[![Build Status](https://travis-ci.org/10by10pixel/portfolio.svg)](https://travis-ci.org/10by10pixel/portfolio)

#### Needs and Opportunities
 * Creating a video or series of videos to help remarket the school.
 * Teaches working with clients and writing on a deadline
 * Could lead to working on similar styles of video for internship
 * Try to output something out of my usual "format"

#### Clients/Audience
 * Principal Willis as primary client
 * Potential students/parents as primary audience

#### Benchmarks
 * Script
 * Storyboard/Shotlist
 * Shooting Schedule
 * Rough Cut
 * Final Cut

#### Products/Resources
 * Primary product is a video or series of videos
 * Resources needed are:
  * Time
  * Students(/actors)
  * Patience

#### To Conclude...
 * Creating a video or series of videos to help remarket the school.
 * Principal Willis as primary client
 * Unique style of filmmaking combined with more professional techniques
 * No funding or school resources needed

redpajama_set_name: RedPajamaGithub


text:
module Types
  class QueryType < Types::BaseObject
    field :categories, resolver: Resolvers::CategorySearch
    field :posts, resolver: Resolvers::PostSearch
  end
end


text:
package org.apache.ivy.ant;

import org.apache.ivy.core.module.descriptor.DefaultIncludeRule;
import org.apache.ivy.core.module.id.ArtifactId;
import org.apache.ivy.core.module.id.ModuleId;
import org.apache.ivy.core.settings.IvySettings;
import org.apache.ivy.plugins.matcher.PatternMatcher;

public class IvyDependencyInclude {

    private String name;

    private String type;

    private String ext;

    private String matcher;

    public void setName(String name) {
        this.name = name;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    public void setMatcher(String matcher) {
        this.matcher = matcher;
    }

    DefaultIncludeRule asRule(IvySettings settings) {
        String matcherName = matcher == null ? PatternMatcher.EXACT : matcher;
        String namePattern = name == null ? PatternMatcher.ANY_EXPRESSION : name;
        String typePattern = type == null ? PatternMatcher.ANY_EXPRESSION : type;
        String extPattern = ext == null ? typePattern : ext;
        ArtifactId aid = new ArtifactId(new ModuleId(PatternMatcher.ANY_EXPRESSION,
                PatternMatcher.ANY_EXPRESSION), namePattern, typePattern, extPattern);
        return new DefaultIncludeRule(aid, settings.getMatcher(matcherName), null);
    }

}


text:
require 'unit/spec_helper'
require 'dns-propagation'
require 'dns-propagation/domain'
require 'dns-propagation/snapshot'

module DnsPropagation
  describe Snapshot do
    before(:each) do
      @domain = Domain.new(:name => 'test.bikepimp.co.uk')
      @domain.stub(:primary_nameserver_ip).and_return('127.0.0.1')
    end

    subject(:snapshot) do
      Snapshot.new(:domain => @domain)
    end

    it { should have_many :lookups }
    it { should belong_to :domain }

    describe '#snapshot!' do
      before(:each) do
        @nameservers = ['127.0.0.1', '127.0.0.2']
        snapshot.should_receive(:nameservers).and_return(@nameservers)
      end

      it 'should create lookups' do
        lookup = mock(:save => true, :resolves_to => ['127.0.0.1'], :answer => ['answer']); lookup.stub(:resolve).and_return(lookup)
        snapshot.lookups.should_receive(:build).with(:domain => @domain, :ns => @domain.primary_nameserver_ip).and_return(lookup)
        @nameservers.each do |ns|
          snapshot.lookups.should_receive(:build).with(:domain => @domain, :ns => ns).and_return(lookup)
        end
        snapshot.snapshot!
        snapshot.at.should be_a DateTime
      end
    end

  end
end


text:
class Dx11DemoBase {

	protected:
		HINSTANCE hInstance_;
		HWND hwnd_;
		D3D_DRIVER_TYPE driverType_;
		D3D_FEATURE_LEVEL featureLevel_;
		ID3D11Device* d3dDevice_;
		ID3D11DeviceContext* d3dContext_;
		IDXGISwapChain* swapChain_;
		ID3D11RenderTargetView* backBufferTarget_;

	public:
		Dx11DemoBase();
		virtual ~Dx11DemoBase();
		bool Initialize(HINSTANCE hInstance, HWND hwnd);
		void Shutdown();
		//bool CompileD3DShader( char* filePath, char* entry, char* shaderModel, ID3DBlob** buffer );
		bool CompileD3DShader(LPCWSTR filePath, char* entry, char* shaderModel, ID3DBlob** buffer);
		virtual bool LoadContent();
		virtual void UnloadContent();
		virtual void Update(float dt) = 0;
		virtual void Render() = 0;

};

#endif


text:
// This file is part of JavaSMT,
// an API wrapper for a collection of SMT solvers:
// https://github.com/sosy-lab/java-smt
//
// SPDX-FileCopyrightText: 2022 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0

package org.sosy_lab.java_smt.test;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;
import static org.sosy_lab.java_smt.test.ProverEnvironmentSubject.assertThat;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import org.sosy_lab.java_smt.SolverContextFactory.Solvers;
import org.sosy_lab.java_smt.api.ArrayFormula;
import org.sosy_lab.java_smt.api.BitvectorFormula;
import org.sosy_lab.java_smt.api.FormulaType;
import org.sosy_lab.java_smt.api.FormulaType.BitvectorType;
import org.sosy_lab.java_smt.api.Model;
import org.sosy_lab.java_smt.api.NumeralFormula.IntegerFormula;
import org.sosy_lab.java_smt.api.ProverEnvironment;
import org.sosy_lab.java_smt.api.SolverContext.ProverOptions;
import org.sosy_lab.java_smt.api.SolverException;

/**
 * Tests bitvectors for all solvers that support it. Notice: Boolector does not support integer
 * theory or bitvectors length 1.
 */
@RunWith(Parameterized.class)
public class BitvectorFormulaManagerTest extends SolverBasedTest0 {

  private static final BitvectorType bvType4 = FormulaType.getBitvectorTypeWithSize(4);

  @Parameters(name = "{0}")
  public static Object[] getAllSolvers() {
    return Solvers.values();
  }

  @Parameter(0)
  public Solvers solver;

  @Override
  protected Solvers solverToUse() {
    return solver;
  }

  @Before
  public void init() {
    requireBitvectors();
  }

  @Test
  public void bvType() {
    int[] testValues;
    if (solver == Solvers.BOOLECTOR) {
      testValues = new int[] {2, 4, 32, 64, 1000};
    } else {
      testValues = new int[] {1, 2, 4, 32, 64, 1000};
    }
    for (int i : testValues) {
      BitvectorType type = FormulaType.getBitvectorTypeWithSize(i);
      assertWithMessage("bitvector type size").that(type.getSize()).isEqualTo(i);
      BitvectorFormula var = bvmgr.makeVariable(type, "x" + i);
      BitvectorType result = (BitvectorType) mgr.getFormulaType(var);
      assertWithMessage("bitvector size").that(result.getSize()).isEqualTo(i);
    }
  }

  @Test
  public void bvOne() throws SolverException, InterruptedException {
    int[] testValues;
    if (solver == Solvers.BOOLECTOR) {
      testValues = new int[] {2, 4, 32, 64, 1000};
    } else {
      testValues = new int[] {1, 2, 4, 32, 64, 1000};
    }
    for (int i : testValues) {
      BitvectorFormula var = bvmgr.makeVariable(i, "x" + i);
      BitvectorFormula num0 = bvmgr.makeBitvector(i, 0);
      BitvectorFormula num1 = bvmgr.makeBitvector(i, 1);
      assertThatFormula(bvmgr.equal(var, num0)).isSatisfiable();
      assertThatFormula(bvmgr.equal(var, num1)).isSatisfiable();
    }
  }

  @Test(expected = IllegalArgumentException.class)
  @SuppressWarnings("CheckReturnValue")
  public void bvTooLargeNum() {
    bvmgr.makeBitvector(2, 4); // value 4 is too large for size 2
    if (solver != Solvers.BOOLECTOR) {
      bvmgr.makeBitvector(1, 2); // value 2 is too large for size 1
    }
  }

  @Test
  @SuppressWarnings("CheckReturnValue")
  public void bvLargeNum() {
    bvmgr.makeBitvector(2, 3); // value 3 should be possible for size 2
    if (solver != Solvers.BOOLECTOR) {
      bvmgr.makeBitvector(1, 1); // value 1 should be possible for size 1
    }
  }

  @Test
  @SuppressWarnings("CheckReturnValue")
  public void bvSmallNum() {
    bvmgr.makeBitvector(2, -1); // value -1 should be possible for size 2
    if (solver != Solvers.BOOLECTOR) {
      bvmgr.makeBitvector(1, -1); // value -1 should be possible for size 1
    }
  }

  @Test
  public void bvTooSmallNum() {
    // value -4 is too small for size 2
    assertThrows(IllegalArgumentException.class, () -> bvmgr.makeBitvector(2, -4));
    if (solver != Solvers.BOOLECTOR) {
      // value -2 is too small for size 1
      assertThrows(IllegalArgumentException.class, () -> bvmgr.makeBitvector(1, -2));
    }
  }

  @Test
  public void bvModelValue32bit() throws SolverException, InterruptedException {
    BitvectorFormula var = bvmgr.makeVariable(32, "var");

    Map<Long, Long> values = new LinkedHashMap<>();
    long int32 = 1L << 32;

    // positive signed values stay equal
    values.put(0L, 0L);
    values.put(1L, 1L);
    values.put(2L, 2L);
    values.put(123L, 123L);
    values.put((long) Integer.MAX_VALUE, (long) Integer.MAX_VALUE);

    // positive unsigned values stay equal
    values.put(Integer.MAX_VALUE + 1L, Integer.MAX_VALUE + 1L);
    values.put(Integer.MAX_VALUE + 2L, Integer.MAX_VALUE + 2L);
    values.put(Integer.MAX_VALUE + 123L, Integer.MAX_VALUE + 123L);
    values.put(int32 - 1L, int32 - 1);
    values.put(int32 - 2L, int32 - 2);
    values.put(int32 - 123L, int32 - 123);

    // negative signed values are converted to unsigned
    values.put(-1L, int32 - 1);
    values.put(-2L, int32 - 2);
    values.put(-123L, int32 - 123);
    values.put((long) Integer.MIN_VALUE, 1L + Integer.MAX_VALUE);

    try (ProverEnvironment prover =
        context.newProverEnvironment(
            ProverOptions.GENERATE_MODELS, ProverOptions.GENERATE_UNSAT_CORE)) {
      for (Map.Entry<Long, Long> entry : values.entrySet()) {
        prover.push(bvmgr.equal(var, bvmgr.makeBitvector(32, entry.getKey())));
        assertThat(prover).isSatisfiable();
        try (Model model = prover.getModel()) {
          Object value = model.evaluate(var);
          assertThat(value).isEqualTo(BigInteger.valueOf(entry.getValue()));
        }
        prover.pop();
      }
    }
  }

  @Test
  public void bvToInt() throws SolverException, InterruptedException {
    requireBitvectorToInt();
    requireIntegers();

    for (int size : new int[] {1, 2, 4, 8}) {
      int max = 1 << size;
      // number is in range of bitsize
      for (int i = -max / 2; i < max; i++) {
        BitvectorFormula bv = bvmgr.makeBitvector(size, i);
        IntegerFormula num = imgr.makeNumber(i);
        assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, num))).isTautological();
        IntegerFormula nSigned = bvmgr.toIntegerFormula(bv, true);
        IntegerFormula nUnsigned = bvmgr.toIntegerFormula(bv, false);
        if (i < max / 2) {
          assertThatFormula(imgr.equal(num, nSigned)).isTautological();
          assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, nSigned))).isTautological();
        }
        if (i >= 0) {
          assertThatFormula(imgr.equal(num, nUnsigned)).isTautological();
          assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, nUnsigned))).isTautological();
        }
      }
    }
  }

  @Test
  public void bvToIntEquality() throws SolverException, InterruptedException {
    requireBitvectorToInt();
    requireIntegers();

    for (int size : new int[] {10, 16, 20, 32, 64}) {
      for (int i : new int[] {1, 2, 4, 32, 64, 100}) {
        // number is in range of bitsize
        BitvectorFormula bv = bvmgr.makeBitvector(size, i);
        IntegerFormula num = imgr.makeNumber(i);
        assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, num))).isTautological();
        IntegerFormula nSigned = bvmgr.toIntegerFormula(bv, true);
        IntegerFormula nUnsigned = bvmgr.toIntegerFormula(bv, false);
        assertThatFormula(imgr.equal(num, nSigned)).isTautological();
        assertThatFormula(imgr.equal(num, nUnsigned)).isTautological();
        assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, nSigned))).isTautological();
        assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, nUnsigned))).isTautological();
      }
    }
  }

  private static final int[] SOME_SIZES = new int[] {1, 2, 4, 10, 16, 20, 32, 60};
  private static final int[] SOME_NUMBERS =
      new int[] {
        0, 1, 2, 3, 4, 5, 6, 7, 8, 32, 64, 100, 150, 512, 1024, 100000, 1000000, Integer.MAX_VALUE,
      };

  @Test
  public void bvToIntEqualityWithOverflow() throws SolverException, InterruptedException {
    requireBitvectorToInt();
    requireIntegers();

    for (int size : SOME_SIZES) {
      for (int i : SOME_NUMBERS) {
        // number might be larger than range of bitsize
        long upperBound = 1L << size;
        long iMod = i % upperBound;
        IntegerFormula num = imgr.makeNumber(i);
        IntegerFormula nUnsigned = imgr.makeNumber(iMod);
        IntegerFormula nSigned = imgr.makeNumber(iMod < upperBound / 2 ? iMod : iMod - upperBound);
        BitvectorFormula bv = bvmgr.makeBitvector(size, iMod);
        assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, num))).isTautological();
        assertThat(mgr.getFormulaType(bvmgr.toIntegerFormula(bv, true)))
            .isEqualTo(FormulaType.IntegerType);
        assertThatFormula(imgr.equal(nSigned, bvmgr.toIntegerFormula(bv, true))).isTautological();
        assertThatFormula(imgr.equal(nUnsigned, bvmgr.toIntegerFormula(bv, false)))
            .isTautological();
      }
    }
  }

  @Test
  public void bvToIntEqualityWithOverflowNegative() throws SolverException, InterruptedException {
    requireBitvectorToInt();
    requireIntegers();

    for (int size : SOME_SIZES) {
      for (int i : SOME_NUMBERS) {
        // make number negative
        int negI = -i;
        // number might be larger than range of bitsize
        long upperBound = 1L << size;
        long iMod = negI % upperBound;
        IntegerFormula num = imgr.makeNumber(negI);
        IntegerFormula nUnsigned = imgr.makeNumber(iMod >= 0 ? iMod : iMod + upperBound);
        IntegerFormula nSigned = imgr.makeNumber(iMod < -upperBound / 2 ? iMod + upperBound : iMod);
        BitvectorFormula bv =
            bvmgr.makeBitvector(size, iMod >= -upperBound / 2 ? iMod : iMod + upperBound);
        assertThatFormula(bvmgr.equal(bv, bvmgr.makeBitvector(size, num))).isTautological();
        assertThatFormula(imgr.equal(nSigned, bvmgr.toIntegerFormula(bv, true))).isTautological();
        assertThatFormula(imgr.equal(nUnsigned, bvmgr.toIntegerFormula(bv, false)))
            .isTautological();
      }
    }
  }

  @Test
  public void bvToIntEqualityWithSymbols() throws SolverException, InterruptedException {
    requireBitvectorToInt();
    requireIntegers();

    for (int size : new int[] {1, 2, 4, 8}) {
      IntegerFormula var = imgr.makeVariable("x_" + size);

      // x == int(bv(x)) is sat for small values
      assertThatFormula(
              imgr.equal(var, bvmgr.toIntegerFormula(bvmgr.makeBitvector(size, var), true)))
          .isSatisfiable();

      // x == int(bv(x)) is unsat for large values
      assertThatFormula(
              bmgr.not(
                  imgr.equal(var, bvmgr.toIntegerFormula(bvmgr.makeBitvector(size, var), true))))
          .isSatisfiable();

      BitvectorFormula bvar = bvmgr.makeVariable(size, "y_" + size);

      // y == bv(int(y)) is sat for all values
      assertThatFormula(
              bvmgr.equal(bvar, bvmgr.makeBitvector(size, bvmgr.toIntegerFormula(bvar, true))))
          .isTautological();
    }
  }

  @Test
  public void bvExtractTooLargeNumEndSigned() {
    // Use bv > 1 because of Boolector
    BitvectorFormula bv = bvmgr.makeBitvector(4, 4);
    assertThrows(IllegalArgumentException.class, () -> bvmgr.extract(bv, 5, 0));
  }

  @Test
  public void bvExtractTooLargeNumStartSigned() {
    // Use bv > 1 because of Boolector
    BitvectorFormula bv = bvmgr.makeBitvector(4, 4);
    assertThrows(IllegalArgumentException.class, () -> bvmgr.extract(bv, 4, 5));
  }

  @Test
  public void bvExtractTooLargeNumStartAltSigned() {
    // Use bv > 1 because of Boolector
    BitvectorFormula bv = bvmgr.makeBitvector(4, 4);
    assertThrows(IllegalArgumentException.class, () -> bvmgr.extract(bv, 3, 4));
  }

  @Test
  public void bvExtractNegNumEnd() {
    // Use bv > 1 because of Boolector
    BitvectorFormula bv = bvmgr.makeBitvector(4, 4);
    assertThrows(IllegalArgumentException.class, () -> bvmgr.extract(bv, -1, 0));
  }

  @Test
  public void bvExtractNegNumStart() {
    // Use bv > 1 because of Boolector
    BitvectorFormula bv = bvmgr.makeBitvector(4, 4);
    assertThrows(IllegalArgumentException.class, () -> bvmgr.extract(bv, 1, -1));
  }

  @Test
  public void bvExtractNegNumStartEnd() {
    // Use bv > 1 because of Boolector
    BitvectorFormula bv = bvmgr.makeBitvector(4, 4);
    assertThrows(IllegalArgumentException.class, () -> bvmgr.extract(bv, -1, -1));
  }

  @Test
  public void bvExtendNegNum() {
    // Use bv > 1 because of Boolector
    BitvectorFormula bv = bvmgr.makeBitvector(4, 4);
    assertThrows(IllegalArgumentException.class, () -> bvmgr.extend(bv, -1, true));
  }

  @Test
  public void bvIntArray() {
    requireArrays();
    assume()
        .withMessage("Solver %s does not support arrays with integer index", solverToUse())
        .that(solverToUse())
        .isNotEqualTo(Solvers.BOOLECTOR);

    BitvectorFormula bv = bvmgr.makeBitvector(4, 3);
    ArrayFormula<IntegerFormula, BitvectorFormula> arr =
        amgr.makeArray("arr", FormulaType.IntegerType, bvType4);
    IntegerFormula index = imgr.makeNumber(12);
    arr = amgr.store(arr, index, bv);

    assertThat(mgr.getFormulaType(arr))
        .isEqualTo(FormulaType.getArrayType(FormulaType.IntegerType, bvType4));
  }

  @Test
  public void bvBvArray() {
    requireArrays();

    BitvectorFormula bv = bvmgr.makeBitvector(4, 3);
    ArrayFormula<BitvectorFormula, BitvectorFormula> arr = amgr.makeArray("arr", bvType4, bvType4);
    BitvectorFormula index = bvmgr.makeBitvector(4, 2);
    arr = amgr.store(arr, index, bv);

    assertThat(mgr.getFormulaType(arr)).isEqualTo(FormulaType.getArrayType(bvType4, bvType4));
  }

  @Test
  public void bvDistinct() throws SolverException, InterruptedException {
    for (int bitsize : new int[] {2, 4, 6}) {
      if (solverToUse() == Solvers.CVC5 && bitsize > 4) {
        // CVC5 runs endlessly for > 4; A issue is open for this as CVC4 can solve this in less than
        // a second. See: https://github.com/cvc5/cvc5/discussions/8361
        break;
      }
      List<BitvectorFormula> bvs = new ArrayList<>();
      for (int i = 0; i < 1 << bitsize; i++) {
        bvs.add(bvmgr.makeVariable(bitsize, "a" + i + "_" + bitsize));
      }
      assertThatFormula(bvmgr.distinct(bvs.subList(0, 1 << (bitsize - 1)))).isSatisfiable();
      assertThatFormula(bvmgr.distinct(bvs)).isSatisfiable();
      bvs.add(bvmgr.makeVariable(bitsize, "b" + "_" + bitsize));
      assertThatFormula(bvmgr.distinct(bvs)).isUnsatisfiable();
    }
  }

  @Test
  public void bvVarDistinct() throws SolverException, InterruptedException {
    BitvectorFormula a = bvmgr.makeVariable(4, "a");
    BitvectorFormula num3 = bvmgr.makeBitvector(4, 3);

    assertThatFormula(bvmgr.distinct(List.of(a, num3))).isSatisfiable();
    assertThatFormula(bvmgr.distinct(List.of(a, a))).isUnsatisfiable();
    assertThatFormula(bvmgr.distinct(List.of(num3, num3))).isUnsatisfiable();
  }
}


text:
Travis CI test matrix
=====================

GCE instances
-------------

Here is the test matrix for the CI gates:

|           Network plugin|                  OS type|               GCE region|             Nodes layout|
|-------------------------|-------------------------|-------------------------|-------------------------|
|                    canal|       debian-8-kubespray|             asia-east1-a|                 ha-scale|
|                   calico|       debian-8-kubespray|           europe-west1-c|                  default|
|                  flannel|                 centos-7|        asia-northeast1-c|                  default|
|                   calico|                 centos-7|            us-central1-b|                       ha|
|                    weave|                   rhel-7|               us-east1-c|                  default|
|                    canal|            coreos-stable|               us-west1-b|                 ha-scale|
|                    canal|                   rhel-7|        asia-northeast1-b|                 separate|
|                    weave|       ubuntu-1604-xenial|           europe-west1-d|                 separate|
|                   calico|            coreos-stable|            us-central1-f|                 separate|

Node Layouts
------------

There are four node layout types: `default`, `separate`, `ha`, and `scale`.

`default` is a non-HA two nodes setup with one separate `kube-node`
and the `etcd` group merged with the `kube-master`.

`separate` layout is when there is only node of each type, which includes
 a kube-master, kube-node, and etcd cluster member.

`ha` layout consists of two etcd nodes, two masters and a single worker node,
with role intersection.

`scale` layout can be combined with above layouts. It includes 200 fake hosts
in the Ansible inventory. This helps test TLS certificate generation at scale
to prevent regressions and profile certain long-running tasks. These nodes are
never actually deployed, but certificates are generated for them.

Note, the canal network plugin deploys flannel as well plus calico policy controller.

Hint: the command
```
bash scripts/gen_matrix.sh
```
will (hopefully) generate the CI test cases from the current ``.travis.yml``.

Gitlab CI test matrix
=====================

GCE instances
-------------

|               Stage|      Network plugin|             OS type|          GCE region|        Nodes layout
|--------------------|--------------------|--------------------|--------------------|--------------------|
|               part1|              calico|       coreos-stable|          us-west1-b|            separate|
|               part1|               canal|  debian-8-kubespray|          us-east1-b|                  ha|
|               part1|               weave|              rhel-7|      europe-west1-b|             default|
|               part2|             flannel|            centos-7|          us-west1-a|             default|
|               part2|              calico|  debian-8-kubespray|       us-central1-b|             default|
|               part2|               canal|       coreos-stable|          us-east1-b|             default|
|             special|               canal|              rhel-7|          us-east1-b|            separate|
|             special|               weave|  ubuntu-1604-xenial|       us-central1-b|             default|
|             special|              calico|            centos-7|      europe-west1-b|            ha-scale|
|             special|               weave|        coreos-alpha|          us-west1-a|            ha-scale|

The "Stage" means a build step of the build pipeline. The steps are ordered as `part1->part2->special`.


text:
layout: post
title:  Inspirations
date:   2017-06-25 14:30:04
categories: inspiration essentialism
---

It is a bit complex to decode where my inspirations come from, but here is a list of people or books that deserve credit and has had a great influence on my journey of thoughts.

Greg Mckeown's book [Essentiallism](https://www.amazon.co.uk/s/?ie=UTF8&keywords=essentialism+book&tag=googhydr-21&index=aps&hvadid=188168530934&hvpos=1t2&hvnetw=g&hvrand=6014460201855702075&hvpone=&hvptwo=&hvqmt=e&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9045987&hvtargid=kwd-69300721192&ref=pd_sl_8z7vonf769_e) which is one of many seeds to my journal, about how we need to filter our a lot of noise in our lives and focus on what matters.

Joshua and Ryan from [theminimalists.com](http://www.theminimalists.com) — A very brave story about stepping away  from a "successful" careers and pursuing a different path.

Leo Babauta's [zenhabits.com](http://zenhabits.com) which focuses on how we can change the little things in our lives the make a big difference over time.

<!--more-->

And many other random sources on understanding what matters, on strategy, purpose, vision, on philosophy, history, buddhism as well as coaching approaches I have encountered in my work.

* Simon Sinek - [Start with why](https://startwithwhy.com)
* Richard Rumelt - [Good strategy, bad strategy](http://goodbadstrategy.com)
* Clayton Christensen - [How will you measure your life](http://www.claytonchristensen.com/books/how-will-you-measure-your-life/)
* Yuval Noah Harari - [Sapiens](http://www.ynharari.com/book/sapiens/)
* The Dalai Lama & Laurens van den Muyzenberg - [The Leader's Way: Business, Buddhism and Happiness in an Interconnected World](https://www.amazon.co.uk/Leaders-Way-Business-Happiness-Interconnected/dp/185788518X)
* [Kaospilots](http://kaospilot.dk) - Creative leadership course


text:
#ifndef UTIL_TIME_H
#define UTIL_TIME_H

#include <time.h>

/**
 * Get the current time, in milliseconds.
 */
uint32_t get_current_time_msec(void);

/**
 * Convert a timespec to milliseconds.
 */
int64_t timespec_to_msec(const struct timespec *a);

/**
 * Convert nanoseconds to a timespec.
 */
void timespec_from_nsec(struct timespec *r, int64_t nsec);

/**
 * Subtracts timespec `b` from timespec `a`, and stores the difference in `r`.
 */
void timespec_sub(struct timespec *r, const struct timespec *a,
		const struct timespec *b);

#endif


text:
<!DOCTYPE html>

    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">


text:
from nailgun.objects.plugin import PluginCollection

from nailgun.plugins.attr_plugin import ClusterAttributesPlugin

class PluginManager(object):

    @classmethod
    def process_cluster_attributes(cls, cluster, attrs, query=None):
        if query is None:
            query = PluginCollection.all()
        for plugin_db in query:
            attr_plugin = ClusterAttributesPlugin(plugin_db)
            attr_plugin.process_cluster_attributes(cluster, attrs)

    @classmethod
    def get_plugin_attributes(cls, cluster):
        plugins_attrs = {}
        for plugin_db in PluginCollection.all_newest():
            attr_plugin = ClusterAttributesPlugin(plugin_db)
            attrs = attr_plugin.get_plugin_attributes(cluster)
            plugins_attrs.update(attrs)
        return plugins_attrs

    @classmethod
    def get_cluster_plugins_with_tasks(cls, cluster):
        attr_plugins = []
        for plugin_db in cluster.plugins:
            attr_pl = ClusterAttributesPlugin(plugin_db)
            attr_pl.set_cluster_tasks(cluster)
            attr_plugins.append(attr_pl)
        return attr_plugins


text:
set -euo pipefail
IFS=$'\n\t'

appName=${1:-}
if [[ -z "$appName" ]]; then
  echo "Usage: $0 <unique_app_name>"
  exit 1
fi

heroku create $appName
heroku config:set 'NO_PRE_DEPLOY=true'
heroku buildpacks:set https://github.com/energizedwork/heroku-buildpack-runnable-jar

git push heroku master
sleep 2

wiremockUri=http://${appName}.herokuapp.com

curl ${wiremockUri}/__admin/mappings/new \
-d '{ "request": { "url": "/", "method": "GET" }, "response": { "body": "**********\nWireMock is now  running on Heroku at '$wiremockUri'\n**********\n" }}'

echo ''
curl $wiremockUri
echo ''


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

public final class TestGroups
{
    public static final String CREATE_TABLE = "create_table";
    public static final String CREATE_DROP_VIEW = "create_drop_view";
    public static final String ALTER_TABLE = "alter_table";
    public static final String COMMENT = "comment";
    public static final String SIMPLE = "simple";
    public static final String FUNCTIONS = "functions";
    public static final String CLI = "cli";
    public static final String SYSTEM_CONNECTOR = "system";
    public static final String CONFIGURED_FEATURES = "configured_features";
    public static final String JMX_CONNECTOR = "jmx";
    public static final String BLACKHOLE_CONNECTOR = "blackhole";
    public static final String SMOKE = "smoke";
    public static final String JDBC = "jdbc";
    public static final String OAUTH2 = "oauth2";
    public static final String OAUTH2_REFRESH = "oauth2_refresh";
    public static final String MYSQL = "mysql";
    public static final String TRINO_JDBC = "trino_jdbc";
    public static final String QUERY_ENGINE = "qe";
    public static final String COMPARISON = "comparison";
    public static final String LOGICAL = "logical";
    public static final String JSON_FUNCTIONS = "json_functions";
    public static final String STORAGE_FORMATS = "storage_formats";
    public static final String STORAGE_FORMATS_DETAILED = "storage_formats_detailed";
    public static final String HMS_ONLY = "hms_only";
    public static final String PROFILE_SPECIFIC_TESTS = "profile_specific_tests";
    public static final String HDFS_IMPERSONATION = "hdfs_impersonation";
    public static final String HDFS_NO_IMPERSONATION = "hdfs_no_impersonation";
    public static final String HIVE_PARTITIONING = "hive_partitioning";
    public static final String HIVE_SPARK = "hive_spark";
    public static final String HIVE_COMPRESSION = "hive_compression";
    public static final String HIVE_TRANSACTIONAL = "hive_transactional";
    public static final String HIVE_VIEWS = "hive_views";
    public static final String HIVE_VIEW_COMPATIBILITY = "hive_view_compatibility";
    public static final String HIVE_CACHING = "hive_caching";
    public static final String HIVE_ICEBERG_REDIRECTIONS = "hive_iceberg_redirections";
    public static final String AUTHORIZATION = "authorization";
    public static final String HIVE_COERCION = "hive_coercion";
    public static final String AZURE = "azure";
    public static final String CASSANDRA = "cassandra";
    public static final String SQL_SERVER = "sqlserver";
    public static final String LDAP = "ldap";
    public static final String LDAP_AND_FILE = "ldap_and_file";
    public static final String LDAP_CLI = "ldap_cli";
    public static final String LDAP_AND_FILE_CLI = "ldap_and_file_cli";
    public static final String LDAP_MULTIPLE_BINDS = "ldap_multiple_binds";
    public static final String HDP3_ONLY = "hdp3_only";
    public static final String TLS = "tls";
    public static final String ROLES = "roles";
    public static final String CANCEL_QUERY = "cancel_query";
    public static final String LARGE_QUERY = "large_query";
    public static final String KAFKA = "kafka";
    public static final String TWO_HIVES = "two_hives";
    public static final String ICEBERG = "iceberg";
    public static final String ICEBERG_FORMAT_VERSION_COMPATIBILITY = "iceberg_format_version_compatibility";
    public static final String AVRO = "avro";
    public static final String PHOENIX = "phoenix";
    public static final String CLICKHOUSE = "clickhouse";
    public static final String KUDU = "kudu";
    public static final String MARIADB = "mariadb";
    public static final String DELTA_LAKE_OSS = "delta-lake-oss";
    public static final String DELTA_LAKE_HDFS = "delta-lake-hdfs";
    public static final String DELTA_LAKE_MINIO = "delta-lake-minio";
    public static final String DELTA_LAKE_GCS = "delta-lake-gcs";
    public static final String DELTA_LAKE_DATABRICKS = "delta-lake-databricks";
    public static final String DELTA_LAKE_EXCLUDE_73 = "delta-lake-exclude-73";
    public static final String DELTA_LAKE_EXCLUDE_91 = "delta-lake-exclude-91";

    private TestGroups() {}
}


text:
<!DOCTYPE html>

		<title>three.js webgl - dashed lines</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<link type="text/css" rel="stylesheet" href="main.css">

three.js - dashed lines example


text:
import os
import pygame as pg

TILE_SIZE = 32
TS2 = TILE_SIZE*4
TS4 = TS2*2
GRID = (160, 96)
SCREEN_SIZE = (1024, 768)

MAX_ROOM_W = 16
MAX_ROOM_H = 12
MIN_ROOM_W = 12
MIN_ROOM_H = 6

CONTROLS = {
    pg.K_w:  "UP",
    pg.K_s: "DOWN",
    pg.K_a:  "LEFT",
    pg.K_d: "RIGHT"
}

DIR_VECTORS = {
    "UP":  (0, -1),
    "DOWN":  (0, 1),
    "LEFT":  (-1, 0),
    "RIGHT":  (1, 0)
}

def load_all_gfx(directory, colorkey=(0, 0, 0), accept=(".png", ".jpg", ".bmp")):
    """
    Load all graphics with extensions in the accept argument.  If alpha
    transparency is found in the image the image will be converted using
    convert_alpha().  If no alpha transparency is detected image will be
    converted using convert() and colorkey will be set to colorkey.
    """
    graphics = {}
    for pic in os.listdir(directory):
        name, ext = os.path.splitext(pic)
        if ext.lower() in accept:
            img = pg.image.load(os.path.join(directory, pic))
            img = img.convert_alpha()
            img.set_colorkey(colorkey)
            graphics[name] = img
    return graphics

def load_all_music(directory, accept=(".wav", ".mp3", ".ogg", ".mdi")):
    """
    Create a dictionary of paths to music files in given directory
    if their extensions are in accept.
    """
    songs = {}
    for song in os.listdir(directory):
        name, ext = os.path.splitext(song)
        if ext.lower() in accept:
            songs[name] = os.path.join(directory, song)
    return songs

def load_all_fonts(directory, accept=(".ttf",)):
    """
    Create a dictionary of paths to font files in given directory
    if their extensions are in accept.
    """
    return load_all_music(directory, accept)

def split_sheet(sheet, size, columns, rows):
    """
    Divide a loaded sprite sheet into subsurfaces.

    The argument size is the width and height of each frame (w,h)
    columns and rows are the integer number of cells horizontally and
    vertically.
    """
    subsurfaces = []
    for y in range(rows):
        row = []
        for x in range(columns):
            rect = pg.Rect((x*size[0], y*size[1]), size)
            row.append(sheet.subsurface(rect))
        subsurfaces.append(row)
    return subsurfaces

# Initialization
pg.init()
SCREEN = pg.display.set_mode(SCREEN_SIZE)
SCREEN_RECT = SCREEN.get_rect()
BULLETS_GROUP = pg.sprite.Group()
ENEMIES_GROUP = pg.sprite.LayeredDirty()
DECORATOR_GROUP = pg.sprite.LayeredDirty()
ALL_SPRITES = pg.sprite.LayeredDirty()

os.environ['SDL_VIDEO_CENTERED'] = '1'

# load resources
# FONTS = load_all_fonts(os.path.join('resources', 'fonts'))
GFX = load_all_gfx("resources/sprites")
# SFX = load_all_music(os.path.join('resources', 'music'))


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * RoundRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class GameRepository extends EntityRepository
{
    public function findByRoundId( $idRound )
    {
        $sql = sprintf( "
        SELECT
            r.date,
            ta.id AS id_team_a,
            tb.id AS id_team_b,
            pata.id AS id_player_a_team_a, pata.name AS name_player_a_team_a,
            pbta.id AS id_player_b_team_a, pbta.name AS name_player_b_team_a,
            patb.id AS id_player_a_team_b, patb.name AS name_player_a_team_b,
            pbtb.id AS id_player_b_team_b, pbtb.name AS name_player_b_team_b,
            g.team_a_score,
            g.team_b_score
        FROM round r
        JOIN game AS g ON g.id_round = r.id
        JOIN team AS ta ON ta.id = g.id_team_a
        JOIN team AS tb ON tb.id = g.id_team_b
        JOIN player AS pata ON pata.id = ta.id_player_a
        JOIN player AS pbta ON pbta.id = ta.id_player_b
        JOIN player AS patb ON patb.id = tb.id_player_a
        JOIN player AS pbtb ON pbtb.id = tb.id_player_b
        WHERE r.id = %u
        ORDER BY g.id ASC;
        ", $idRound );

        $stmt = $this->getEntityManager()->getConnection()->prepare($sql);
        $stmt->execute();
        return $stmt->fetchAll();
    }
}


text:
namespace pdfium {
namespace base {
namespace internal {

struct PartitionDirectMapExtent {
  PartitionDirectMapExtent* next_extent;
  PartitionDirectMapExtent* prev_extent;
  PartitionBucket* bucket;
  size_t map_size;  // Mapped size, not including guard pages and meta-data.

  ALWAYS_INLINE static PartitionDirectMapExtent* FromPage(PartitionPage* page);
};

ALWAYS_INLINE PartitionDirectMapExtent* PartitionDirectMapExtent::FromPage(
    PartitionPage* page) {
  DCHECK(page->bucket->is_direct_mapped());
  return reinterpret_cast<PartitionDirectMapExtent*>(
      reinterpret_cast<char*>(page) + 3 * kPageMetadataSize);
}

}  // namespace internal
}  // namespace base
}  // namespace pdfium

#endif  // THIRD_PARTY_BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_DIRECT_MAP_EXTENT_H_


text:
<?php
header('Content-type: application/json');

$client = "0072f330b5d449cf8fe3820dcc5e5476";
$query = $_POST['q'];
$clnum = mt_rand(1,3);

$api = "https://api.instagram.com/v1/tags/".$query."/media/recent?client_id=".$client;

function get_curl($url) {
    if(function_exists('curl_init')) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        $output = curl_exec($ch);
        echo curl_error($ch);
        curl_close($ch);
        return $output;
    } else{
        return file_get_contents($url);
    }
}

$response = get_curl($api);
$images = array();

if($response){
	foreach(json_decode($response)->data as $item){
        $src = $item->images->standard_resolution->url;
        $thumb = $item->images->thumbnail->url;
		$url = $item->link;

        $images[] = array(
        "src" => htmlspecialchars($src),
        "thumb" => htmlspecialchars($thumb),
        "url" => htmlspecialchars($url)
        );

    }
}

print_r(str_replace('\\/', '/', json_encode($images)));
die();
?>


text:
import { putResolve } from 'redux-saga/effects';
import testSaga from 'testSaga';

function* mainSaga() {
  yield putResolve({ type: 'FOO' });
}

test('handles putResolve', () => {
  testSaga(mainSaga)
    .next()
    .putResolve({ type: 'FOO' });
});

test('throws if arg wrong', () => {
  expect(_ => {
    testSaga(mainSaga)
      .next()
      .putResolve({ type: 'BAR' });
  }).toThrow();
});


text:
package com.baosight.sts.st.zy.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.soa.SoaManager;
import com.baosight.iplat4j.core.threadlocal.UserSession;
import com.baosight.iplat4j.ef.ui.tree.TreeService;
import com.baosight.iplat4j.ep.util.MethodParamConstants;
import com.baosight.sts.st.zy.domain.STZY0101;
import com.baosight.sts.st.zy.domain.STZY0104;
import com.baosight.sts.util.BizConstants;
import com.baosight.sts.util.CodeValueUtil;

public class ServiceSTZY0101 extends TreeService {

	public EiInfo initLoad(EiInfo inInfo){
		STZY0101 stzy0101 = new STZY0101();
		EiInfo outInfo = super.initLoad(inInfo);
		outInfo.addBlock("shopsign").addRow(stzy0101);
		outInfo.getBlock("shopsign").setBlockMeta(stzy0101.eiMetadata);

		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
		outInfo = CodeValueUtil.procEiInfo(outInfo, "QUOTE_TYPE",segNo);
		outInfo = CodeValueUtil.procEiInfoOther(outInfo, "IF_SHOW", "IF_SHOWCode", null);

		String segType=getSegType(segNo);
		List data=new ArrayList();
		outInfo.addBlock("main").addRow(data);
		outInfo.getBlock("main").getRow(0).put("segType", segType);

		return outInfo;
    }

	public List getTopNodes() {
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
		Map param = new HashMap();
		param.put("segNo", segNo);
		List resList = dao.query("ST00.select_t_r_product_type_list1", param);
		List all = new ArrayList();
		all.addAll(resList);
		return all;
	}

	public EiBlockMeta initMetaData() {
		EiBlockMeta eiMetadata = new EiBlockMeta();

		EiColumn eiColumn = new EiColumn("label");
		eiColumn.setDescName("label");
		eiColumn.setNullable(false);
		eiColumn.setPrimaryKey(false);
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("text");
		eiColumn.setDescName("text");
		eiColumn.setNullable(false);
		eiColumn.setPrimaryKey(false);
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("leaf");
		eiColumn.setDescName("leaf");
		eiColumn.setType(EiConstant.COLUMN_TYPE_NUMBER);
		eiColumn.setNullable(false);
		eiColumn.setPrimaryKey(false);
		eiMetadata.addMeta(eiColumn);
		return eiMetadata;
	}

	public List getChildNodes(String parent) {
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
		Map param = new HashMap();
		param.put("segNo", segNo);
		param.put("productTypeId", parent);
		List resList = dao.query("ST00.select_t_r_product_type_list2", param);
		List authorized = new ArrayList();
		for (int i = 0; i < resList.size(); i++) {
			Map node = (Map) resList.get(i);
			authorized.add(node);
		}
		return authorized;
	}

	// 父节点树
	public Object getParentNode(String element) {
		// String gfUnit_id = "00000";
		// Map param = new HashMap();
		// param.put("withinSegNo", gfUnit_id);
		// List resList =
		// dao.query("ST00.select_t_ss_segment_infor_list2",param);
		// List authorized = new ArrayList();
		// if(resList.size() > 0){
		// return resList.get(0);
		// }else{
		// return null;
		// }
		return null;
	}

	public EiInfo queryByProductTypeId(EiInfo inInfo){
		inInfo.set(EiConstant.serviceName,"STZY0101");
		inInfo.set(EiConstant.methodName, "queryProductType");
		inInfo.setMethodParam(MethodParamConstants.inDataBlock, "edit_status");
		inInfo.setMethodParam(MethodParamConstants.outDataBlock, "edit_status");

		EiInfo outInfo = SoaManager.call(inInfo);
		outInfo.setMsg("查看成功.\n");
		return outInfo;
    }

	public EiInfo queryProductType(EiInfo inInfo){
		STZY0104 stzy0104 = new STZY0104();
		EiInfo outInfo = inInfo;
		List query = null;
		Map param = new HashMap();
		String productTypeId = (String)inInfo.get("productTypeId");
		param.put("productTypeId", productTypeId);
		param.put("segNo", UserSession.getInSessionProperty(BizConstants.ORG_ID));
		query = dao.query("STZY0104.select", param);

		if(query != null){
			outInfo.addBlock("edit_status");
			outInfo.getBlock("edit_status").setBlockMeta(stzy0104.eiMetadata);
			outInfo.getBlock("edit_status").setRows(query);
		}
		return outInfo;
	}

	public EiInfo select(EiInfo inInfo){
		STZY0101 stzy0101 = new STZY0101();
		inInfo.setCell("inqu_status", 0,"segNo",UserSession.getInSessionProperty(BizConstants.ORG_ID));
		if(String.valueOf(inInfo.getCell("inqu_status", 0, "productTypeId")).trim().length() == 0){
			inInfo.setCell("inqu_status", 0,"productTypeId"," ");
		}
		inInfo.setMethodParam(MethodParamConstants.sqlName, "STZY0101.select");//查询出"品种名称"、"牌号"、"技术标准"
		inInfo.setMethodParam(MethodParamConstants.daoEPBaseBean, stzy0101);
		inInfo.setMethodParam(MethodParamConstants.inDataBlock, "shopsign");
		inInfo.setMethodParam(MethodParamConstants.outDataBlock, "shopsign");

		EiInfo outInfo = super.query(inInfo,true);

		if(inInfo.getMsg() != null && inInfo.getMsg().toString().length()>0){
			outInfo.setMsg(inInfo.getMsg());
		}

		outInfo = CodeValueUtil.procEiInfoOther(outInfo, "IF_SHOW", "IF_SHOWCode", null);
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
		String segType=getSegType(segNo);
		List data=new ArrayList();
		outInfo.addBlock("main").addRow(data);
		outInfo.getBlock("main").getRow(0).put("segType", segType);

		return outInfo;
	}

	public EiInfo save(EiInfo inInfo){
		inInfo.set(EiConstant.serviceName,"STZY0101");
		inInfo.set(EiConstant.methodName, "saveProductType");
		inInfo.setMethodParam(MethodParamConstants.inDataBlock, "edit_status");
		inInfo.setMethodParam(MethodParamConstants.outDataBlock, "edit_status");

		EiInfo outInfo = SoaManager.call(inInfo);
		return outInfo;
	}

	public EiInfo saveProductType(EiInfo inInfo){
		EiInfo outInfo = inInfo;
		Map param = new HashMap();
		List query = null;

		param = outInfo.getBlock("edit_status").getRow(0);
		param.put("segNo", UserSession.getInSessionProperty(BizConstants.ORG_ID));
		if(param.get("ifEnd") == null){
			param.put("ifEnd", "0");
		}
		if(param.get("ifShow") == null){
			param.put("ifShow", "0");
		}
		if(String.valueOf(param.get("flag")).equals("new")){
			query = dao.query("STZY0104.query", param);
			if(query.size() != 0){
				inInfo.set("status", "0");
			}else{
				dao.insert("STZY0104.addProductType1", param);
				inInfo.set("status", "1");
				inInfo.setMsg("新增当前级品种成功.\n");
			}
		}else if(String.valueOf(param.get("flag")).equals("update")){
			param.put("modiPerson", UserSession.getInSessionProperty(BizConstants.USER_ID));
			param.put("prodTypeLevel", "");
			String prodTypeLevel = dao.query("STZY0104.queryLevel",param).get(0).toString();//查询分支
			String productTypeId = String.valueOf(param.get("productTypeId"));
			productTypeId = productTypeId.substring(0,Integer.valueOf(prodTypeLevel));

			dao.update("STZY0104.updateProduct_type1", param);
			param.put("productTypeId", productTypeId);
			param.put("prodTypeLevel", prodTypeLevel);
			dao.update("STZY0104.updateProduct_type2", param);
			inInfo.set("status", "2");
			inInfo.setMsg("修改品种成功.\n");
		}

		return inInfo;
	}

	//修改牌号
	public EiInfo update(EiInfo inInfo){
		EiBlock eiBlock;
		Map param = new HashMap();
		Map map = new HashMap();
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));

		try{
			eiBlock = inInfo.getBlock("shopsign");
			if(eiBlock != null&&eiBlock.getRowCount() >0){
				for(int i=0;i<eiBlock.getRowCount();i++){
					param = eiBlock.getRow(i);
					map.put("segNo", segNo);
					map.put("productTypeId", param.get("productTypeId"));
					map.put("shopsign", param.get("shopsign"));
					map.put("techStandard", param.get("techStandard"));
					map.put("remark", param.get("remark"));
					map.put("ifShow", param.get("ifShow"));
					dao.update("STZY0101.updateProductShopsign1", map);
				}
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		inInfo.setMsg("修改成功.\n");
		return select(inInfo);
	}

	//新增牌号
	public EiInfo addShopsign(EiInfo inInfo){
		EiBlock eiBlock;
		Map param = new HashMap();
		Map map = new HashMap();
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));
		String productTypeId = String.valueOf(inInfo.getBlock("inqu_status").getCell(0, "productTypeId"));
		try{
			eiBlock = inInfo.getBlock("shopsign");
			if(eiBlock != null&&eiBlock.getRowCount() >0){
				for(int i=0;i<eiBlock.getRowCount();i++){
					param = eiBlock.getRow(i);
					map.put("segNo", segNo);
					map.put("techStandard", "待定");
					map.put("productTypeId", productTypeId);
					map.put("shopsign", param.get("shopsign"));
					map.put("remark", param.get("remark"));
					map.put("ifShow", param.get("ifShow"));
					dao.update("STZY0101.addProductShopsign1", map);
				}
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		return select(inInfo);
	}

	//删除牌号
	public EiInfo deleteShopsign(EiInfo inInfo){
		EiBlock eiBlock;
		Map param = new HashMap();
		Map map = new HashMap();
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));

		try{
			eiBlock = inInfo.getBlock("shopsign");
			if(eiBlock != null&&eiBlock.getRowCount() >0){
				for(int i=0;i<eiBlock.getRowCount();i++){
					param = eiBlock.getRow(i);
					map.put("segNo", segNo);
					map.put("productTypeId", param.get("productTypeId"));
					map.put("shopsign", param.get("shopsign"));
					map.put("techStandard", param.get("techStandard"));
					List query = dao.query("STZY0101.queryshopsign", map);
					if(query!= null && query.size() > 0){  //牌号已在货号中使用,不可以删除
						inInfo.setMsg("牌号已使用,不能删除!\n");
						return select(inInfo);
					}
					dao.update("STZY0101.delete1", map);
				}
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		return select(inInfo);
	}

	public EiInfo updateSave(EiInfo inInfo){
		EiBlock eiBlock;
		Map param = new HashMap();
		Map map = new HashMap();
		String segNo = String.valueOf(UserSession.getInSessionProperty(BizConstants.ORG_ID));

		try{
			eiBlock = inInfo.getBlock("shopsign");
			if(eiBlock != null&&eiBlock.getRowCount() >0){
				for(int i=0;i<eiBlock.getRowCount();i++){
					param = eiBlock.getRow(i);
					if(!this.isNew(param)){
						map.put("segNo", segNo);
						map.put("productTypeId", param.get("productTypeId"));
						map.put("shopsign", param.get("shopsign"));
						map.put("techStandard", param.get("techStandard"));
						map.put("remark", param.get("remark"));
						map.put("ifShow", param.get("ifShow"));
						dao.update("STZY0101.updateProductShopsign1", map);
					}else{
						map.put("segNo", segNo);
						map.put("techStandard", "待定");
						map.put("productTypeId", param.get("productTypeId"));
						map.put("shopsign", param.get("shopsign"));
						map.put("remark", param.get("remark"));
						map.put("ifShow", param.get("ifShow"));
						dao.update("STZY0101.addProductShopsign1", map);
					}
				}
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		inInfo.setMsg("修改成功.\n");
		return select(inInfo);
	}
	public boolean isNew(Map map) {
		return "isNew".equals(map.get("_rowcheck"));
	}
	private String getSegType(String segNo) {
		String result=null;
		Map map=new HashMap();
		map.put("segNo", segNo);
		List list=dao.query("STXT0201.getSegType", map);
		if(list!=null){
			result=(String) list.get(0);
		}
		return result;
	}
}


text:
<?php namespace DreamFactory\Core\Enums;

use Symfony\Component\HttpFoundation\Request;

/**
 * All the HTTP verbs in a single place!
 */
class Verbs extends FactoryEnum
{
    //******************************************************************************
    //* Constants
    //******************************************************************************

    /**
     * @type string
     */
    const GET = Request::METHOD_GET;
    /**
     * @type string
     */
    const PUT = Request::METHOD_PUT;
    /**
     * @type string
     */
    const HEAD = Request::METHOD_HEAD;
    /**
     * @type string
     */
    const POST = Request::METHOD_POST;
    /**
     * @type string
     */
    const DELETE = Request::METHOD_DELETE;
    /**
     * @type string
     */
    const OPTIONS = Request::METHOD_OPTIONS;
    /**
     * @type string
     */
    const COPY = 'COPY';
    /**
     * @type string
     */
    const PATCH = Request::METHOD_PATCH;
    /**
     * @type string
     */
    const TRACE = Request::METHOD_TRACE;
    /**
     * @type string
     */
    const CONNECT = Request::METHOD_CONNECT;
}


text:
<?php

/*********************************************************************************************************************\
 * LAST UPDATE
 * ============
 * March 22, 2007
 *
 *
 * AUTHOR
 * =============
 * Kwaku Otchere
 * ospinto@hotmail.com
 *
 * Thanks to Andrew Hewitt (rudebwoy@hotmail.com) for the idea and suggestion
 *
 * All the credit goes to ColdFusion's brilliant cfdump tag
 * Hope the next version of PHP can implement this or have something similar
 * I love PHP, but var_dump BLOWS!!!
 *
 * FOR DOCUMENTATION AND MORE EXAMPLES: VISIT http://dbug.ospinto.com
 *
 *
 * PURPOSE
 * =============
 * Dumps/Displays the contents of a variable in a colored tabular format
 * Based on the idea, javascript and css code of Macromedia's ColdFusion cfdump tag
 * A much better presentation of a variable's contents than PHP's var_dump and print_r functions
 *
 *
 * USAGE
 * =============
 * new dBug ( variable [,forceType] );
 * example:
 * new dBug ( $myVariable );
 *
 *
 * if the optional "forceType" string is given, the variable supplied to the
 * function is forced to have that forceType type.
 * example: new dBug( $myVariable , "array" );
 * will force $myVariable to be treated and dumped as an array type,
 * even though it might originally have been a string type, etc.
 *
 * NOTE!
 * ==============
 * forceType is REQUIRED for dumping an xml string or xml file
 * new dBug ( $strXml, "xml" );
 *
 * \*********************************************************************************************************************/
class dBug {

    var $xmlDepth     = [];
    var $xmlCData;
    var $xmlSData;
    var $xmlDData;
    var $xmlCount     = 0;
    var $xmlAttrib;
    var $xmlName;
    var $arrType      = ["array", "object", "resource", "boolean", "NULL"];
    var $bInitialized = false;
    var $bCollapsed   = false;
    var $arrHistory   = [];

    //constructor
    function __construct($var, $forceType = "", $bCollapsed = false) {
        //include js and css scripts
        if (!defined('BDBUGINIT')) {
            define("BDBUGINIT", true);
            $this->initJSandCSS();
        }
        $arrAccept        = ["array", "object", "xml"]; //array of variable types that can be "forced"
        $this->bCollapsed = $bCollapsed;
        if (in_array($forceType, $arrAccept)) {
            $this->{"varIs" . ucfirst($forceType)}($var);
        } else {
            $this->checkType($var);
        }
    }

    //get variable name
    function getVariableName() {
        $arrBacktrace = debug_backtrace();

        //possible 'included' functions
        $arrInclude = ["include", "include_once", "require", "require_once"];

        //check for any included/required files. if found, get array of the last included file (they contain the right line numbers)
        for ($i = count($arrBacktrace) - 1; $i >= 0; $i--) {
            $arrCurrent = $arrBacktrace[$i];
            if (array_key_exists("function", $arrCurrent) && (in_array($arrCurrent["function"], $arrInclude) || (0 != strcasecmp($arrCurrent["function"], "dbug")))) {
                continue;
            }

            $arrFile = $arrCurrent;

            break;
        }

        if (isset($arrFile)) {
            $arrLines = file($arrFile["file"]);
            $code     = $arrLines[($arrFile["line"] - 1)];

            //find call to dBug class
            preg_match('/\bnew dBug\s*\(\s*(.+)\s*\);/i', $code, $arrMatches);

            return isset($arrMatches[1]) ? $arrMatches[1] : '';
        }

        return "";
    }

    //create the main table header
    function makeTableHeader($type, $header, $colspan = 2) {
        if (!$this->bInitialized) {
            $header             = $this->getVariableName() . " (" . $header . ")";
            $this->bInitialized = true;
        }
        $str_i = ($this->bCollapsed) ? "style=\"font-style:italic\" " : "";

        echo "

					" . $header . "

";
    }

    //create the table row header
    function makeTDHeader($type, $header) {
        $str_d = ($this->bCollapsed) ? " style=\"display:none\"" : "";
        echo "

				" . $header . "
				";
    }

    //close table row
    function closeTDRow() {
        return "
\n";
    }

    //error
    function error($type) {
        $error = "Error: Variable cannot be a";
        // this just checks if the type starts with a vowel or "x" and displays either "a" or "an"
        if (in_array(substr($type, 0, 1), ["a", "e", "i", "o", "u", "x"])) {
            $error .= "n";
        }

        return ($error . " " . $type . " type");
    }

    //check variable type
    function checkType($var) {
        switch (gettype($var)) {
            case "resource":
                $this->varIsResource($var);
            break;
            case "object":
                $this->varIsObject($var);
            break;
            case "array":
                $this->varIsArray($var);
            break;
            case "NULL":
                $this->varIsNULL();
            break;
            case "boolean":
                $this->varIsBoolean($var);
            break;
            default:
                $var = ($var == "") ? "[empty string]" : $var;
                echo "

\n" . $var . "	\n
\n
\n";
            break;
        }
    }

    //if variable is a NULL type
    function varIsNULL() {
        echo "NULL";
    }

    //if variable is a boolean type
    function varIsBoolean($var) {
        $var = ($var == 1) ? "TRUE" : "FALSE";
        echo $var;
    }

    //if variable is an array type
    function varIsArray($var) {
        $var_ser = serialize($var);
        array_push($this->arrHistory, $var_ser);

        $this->makeTableHeader("array", "array");
        if (is_array($var)) {
            foreach ($var as $key => $value) {
                $this->makeTDHeader("array", $key);

                //check for recursion
                if (is_array($value)) {
                    $var_ser = serialize($value);
                    if (in_array($var_ser, $this->arrHistory, true)) {
                        $value = "*RECURSION*";
                    }
                }

                if (in_array(gettype($value), $this->arrType)) {
                    $this->checkType($value);
                } else {
                    $value = (trim($value) == "") ? "[empty string]" : $value;
                    echo $value;
                }
                echo $this->closeTDRow();
            }
        } else {
            echo "
" . $this->error("array") . $this->closeTDRow();
        }
        array_pop($this->arrHistory);
        echo "
";
    }

    //if variable is an object type
    function varIsObject($var) {
        $var_ser = serialize($var);
        array_push($this->arrHistory, $var_ser);
        $this->makeTableHeader("object", "object");

        if (is_object($var)) {
            $arrObjVars = get_object_vars($var);
            foreach ($arrObjVars as $key => $value) {

                $value = (!is_object($value) && !is_array($value) && trim($value) == "") ? "[empty string]" : $value;
                $this->makeTDHeader("object", $key);

                //check for recursion
                if (is_object($value) || is_array($value)) {
                    $var_ser = serialize($value);
                    if (in_array($var_ser, $this->arrHistory, true)) {
                        $value = (is_object($value)) ? "*RECURSION* -> $" . get_class($value) : "*RECURSION*";

                    }
                }
                if (in_array(gettype($value), $this->arrType)) {
                    $this->checkType($value);
                } else {
                    echo $value;
                }
                echo $this->closeTDRow();
            }
            $arrObjMethods = get_class_methods(get_class($var));
            foreach ($arrObjMethods as $key => $value) {
                $this->makeTDHeader("object", $value);
                echo "[function]" . $this->closeTDRow();
            }
        } else {
            echo "
" . $this->error("object") . $this->closeTDRow();
        }
        array_pop($this->arrHistory);
        echo "
";
    }

    //if variable is a resource type
    function varIsResource($var) {
        $this->makeTableHeader("resourceC", "resource", 1);
        echo "
\n\n";
        switch (get_resource_type($var)) {
            case "fbsql result":
            case "mssql result":
            case "msql query":
            case "pgsql result":
            case "sybase-db result":
            case "sybase-ct result":
            case "mysql result":
                $db = current(explode(" ", get_resource_type($var)));
                $this->varIsDBResource($var, $db);
            break;
            case "gd":
                $this->varIsGDResource($var);
            break;
            case "xml":
                $this->varIsXmlResource($var);
            break;
            default:
                echo get_resource_type($var) . $this->closeTDRow();
            break;
        }
        echo $this->closeTDRow() . "
\n";
    }

    //if variable is a database resource type
    function varIsDBResource($var, $db = "mysql") {
        if ($db == "pgsql") {
            $db = "pg";
        }
        if ($db == "sybase-db" || $db == "sybase-ct") {
            $db = "sybase";
        }
        $arrFields = ["name", "type", "flags"];
        $numrows   = call_user_func($db . "_num_rows", $var);
        $numfields = call_user_func($db . "_num_fields", $var);
        $this->makeTableHeader("resource", $db . " result", $numfields + 1);
        echo "
 	";
        for ($i = 0; $i < $numfields; $i++) {
            $field_header = "";
            for ($j = 0; $j < count($arrFields); $j++) {
                $db_func = $db . "_field_" . $arrFields[$j];
                if (function_exists($db_func)) {
                    $fheader = call_user_func($db_func, $var, $i) . " ";
                    if ($j == 0) {
                        $field_name = $fheader;
                    } else {
                        $field_header .= $fheader;
                    }
                }
            }
            $field[$i] = call_user_func($db . "_fetch_field", $var, $i);
            echo "" . $field_name . "	";
        }
        echo "
";
        for ($i = 0; $i < $numrows; $i++) {
            $row = call_user_func($db . "_fetch_array", $var, constant(strtoupper($db) . "_ASSOC"));
            echo "
\n";
            echo "" . ($i + 1) . "	";
            for ($k = 0; $k < $numfields; $k++) {
                $tempField = $field[$k]->name;
                $fieldrow  = $row[($field[$k]->name)];
                $fieldrow  = ($fieldrow == "") ? "[empty string]" : $fieldrow;
                echo "" . $fieldrow . "	\n";
            }
            echo "
\n";
        }
        echo "
";
        if ($numrows > 0) {
            call_user_func($db . "_data_seek", $var, 0);
        }
    }

    //if variable is an image/gd resource type
    function varIsGDResource($var) {
        $this->makeTableHeader("resource", "gd", 2);
        $this->makeTDHeader("resource", "Width");
        echo imagesx($var) . $this->closeTDRow();
        $this->makeTDHeader("resource", "Height");
        echo imagesy($var) . $this->closeTDRow();
        $this->makeTDHeader("resource", "Colors");
        echo imagecolorstotal($var) . $this->closeTDRow();
        echo "
";
    }

    //if variable is an xml type
    function varIsXml($var) {
        $this->varIsXmlResource($var);
    }

    //if variable is an xml resource type
    function varIsXmlResource($var) {
        $xml_parser = xml_parser_create();
        xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
        xml_set_element_handler($xml_parser, [&$this, "xmlStartElement"], [&$this, "xmlEndElement"]);
        xml_set_character_data_handler($xml_parser, [&$this, "xmlCharacterData"]);
        xml_set_default_handler($xml_parser, [&$this, "xmlDefaultHandler"]);

        $this->makeTableHeader("xml", "xml document", 2);
        $this->makeTDHeader("xml", "xmlRoot");

        //attempt to open xml file
        $bFile = (!($fp = @fopen($var, "r"))) ? false : true;

        //read xml file
        if ($bFile) {
            while ($data = str_replace("\n", "", fread($fp, 4096))) {
                $this->xmlParse($xml_parser, $data, feof($fp));
            }
        } //if xml is not a file, attempt to read it as a string
        else {
            if (!is_string($var)) {
                echo $this->error("xml") . $this->closeTDRow() . "
\n";

                return;
            }
            $data = $var;
            $this->xmlParse($xml_parser, $data, 1);
        }

        echo $this->closeTDRow() . "
\n";

    }

    //parse xml
    function xmlParse($xml_parser, $data, $bFinal) {
        if (!xml_parse($xml_parser, $data, $bFinal)) {
            die(sprintf("XML error: %s at line %d\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));
        }
    }

    //xml: inititiated when a start tag is encountered
    function xmlStartElement($parser, $name, $attribs) {
        $this->xmlAttrib[$this->xmlCount] = $attribs;
        $this->xmlName[$this->xmlCount]   = $name;
        $this->xmlSData[$this->xmlCount]  = '$this->makeTableHeader("xml","xml element",2);';
        $this->xmlSData[$this->xmlCount]  .= '$this->makeTDHeader("xml","xmlName");';
        $this->xmlSData[$this->xmlCount]  .= 'echo "' . $this->xmlName[$this->xmlCount] . '".$this->closeTDRow();';
        $this->xmlSData[$this->xmlCount]  .= '$this->makeTDHeader("xml","xmlAttributes");';
        if (count($attribs) > 0) {
            $this->xmlSData[$this->xmlCount] .= '$this->varIsArray($this->xmlAttrib[' . $this->xmlCount . ']);';
        } else {
            $this->xmlSData[$this->xmlCount] .= 'echo " ";';
        }
        $this->xmlSData[$this->xmlCount] .= 'echo $this->closeTDRow();';
        $this->xmlCount++;
    }

    //xml: initiated when an end tag is encountered
    function xmlEndElement($parser, $name) {
        for ($i = 0; $i < $this->xmlCount; $i++) {
            eval($this->xmlSData[$i]);
            $this->makeTDHeader("xml", "xmlText");
            echo (!empty($this->xmlCData[$i])) ? $this->xmlCData[$i] : " ";
            echo $this->closeTDRow();
            $this->makeTDHeader("xml", "xmlComment");
            echo (!empty($this->xmlDData[$i])) ? $this->xmlDData[$i] : " ";
            echo $this->closeTDRow();
            $this->makeTDHeader("xml", "xmlChildren");
            unset($this->xmlCData[$i], $this->xmlDData[$i]);
        }
        echo $this->closeTDRow();
        echo "
";
        $this->xmlCount = 0;
    }

    //xml: initiated when text between tags is encountered
    function xmlCharacterData($parser, $data) {
        $count = $this->xmlCount - 1;
        if (!empty($this->xmlCData[$count])) {
            $this->xmlCData[$count] .= $data;
        } else {
            $this->xmlCData[$count] = $data;
        }
    }

    //xml: initiated when a comment or other miscellaneous texts is encountered
    function xmlDefaultHandler($parser, $data) {
        //strip '' off comments
        $data  = str_replace(["<!--", "-->"], "", htmlspecialchars($data));
        $count = $this->xmlCount - 1;
        if (!empty($this->xmlDData[$count])) {
            $this->xmlDData[$count] .= $data;
        } else {
            $this->xmlDData[$count] = $data;
        }
    }

    function initJSandCSS() {
        echo <<

SCRIPTS;
    }

}

?>


text:
using namespace std;
using namespace engine;

Player::Player() : SDLGameObject(){
	m_fireRate = 500;
	m_isShieldActive = false;
	m_bulletVenemous = false;
	for(int i=1; i<7; i++){
		TextureManager::Instance().load("assets/player_health" + to_string(i) + ".png", "health" + to_string(i), Game::Instance().getRenderer());
	}
	TextureManager::Instance().load("assets/ataque_protagonista_preto.png", "bullet", Game::Instance().getRenderer());
	TextureManager::Instance().load("assets/health.png", "health", Game::Instance().getRenderer());
	TextureManager::Instance().load("assets/circle.png", "instance", Game::Instance().getRenderer());
	TextureManager::Instance().load("assets/Cadeira_frente.png", "chairBullet", Game::Instance().getRenderer());

	INFO("Player inicializado");
	m_life = 6;
	canMove = true;
}

void Player::load(const LoaderParams* pParams){
	SDLGameObject::load(pParams);
}

void Player::draw(){
	TextureManager::Instance().draw("instance", 100, 600, 100, 100, Game::Instance().getRenderer());
	if(m_isShieldActive){
		TextureManager::Instance().draw("shield", getPosition().getX()-17, getPosition().getY()-10, 110, 110, Game::Instance().getRenderer());
		TextureManager::Instance().draw("brownskill", 110, 610, 80, 80, Game::Instance().getRenderer());
	}
	if(m_fireRate != 500){
		TextureManager::Instance().draw("redskill", 110, 610, 80, 80, Game::Instance().getRenderer());
	}

	if(bullet!= NULL && bullet->getVenemous() == true){
		TextureManager::Instance().draw("greenskill", 110, 610, 80, 80, Game::Instance().getRenderer());
	}
	TextureManager::Instance().draw("health" +to_string(m_life), 1000, 620, 180, 80, Game::Instance().getRenderer());
	SDLGameObject::draw();
}

void Player::update(){
	//std::cout << "Player top: " << getPosition().getX() << std::endl;

	if(m_life <= 0){
		Game::Instance().getStateMachine()->changeState(new GameOverState());
	}
	if(Game::Instance().getStateMachine()->currentState()->getStateID() == "PLAY"){
		PlayState *playState = dynamic_cast<PlayState*>(Game::Instance().getStateMachine()->currentState());
		if(playState->getLevel() != NULL && m_boss == NULL){
			INFO("Xuxa is set");
			m_boss = playState->getLevel()->getXuxa();
		}
	}

	if(!canMove){
		int time = Timer::Instance().step() - getStunTime();
		if(time >= 700){
			canMove = true;
		}

		rotateTowards();
	}

	if(shieldHits > 5 && m_isShieldActive){
		TextureManager::Instance().clearFromTextureMap("shield");
		shieldHits = 0;
		m_isShieldActive = false;
	}
	setPoison();

	if(canMove){
		handleInput();
	}

	// if(m_bulletVenemous == true)
	// 	INFO("FOI");

	SDLGameObject::update();
}

void Player::setBulletVenemous(bool isVenemous){
	m_bulletVenemous = isVenemous;
	bullet->setVenemous(isVenemous);
	if(isVenemous == false){
		uint8_t* pixels = new uint8_t[3];
		pixels[0] = 255;
		pixels[1] = 255;
		pixels[2] = 255;
		TheTextureManager::Instance().changeColorPixels(pixels, "RAG");
	}

}

void Player::setPoison(){
	if(bullet != NULL && bullet->getVenemous() && bullet->isActive()){
		if(Timer::Instance().step() <= m_boss->getEnemyTime() && bullet->m_collided){
			m_boss->takeDamage(1);
			int score = Game::Instance().getScore();
			Game::Instance().setScore(score + 5);
			TextureManager::Instance().loadText(std::to_string(Game::Instance().getScore()), "assets/fonts/Lato-Regular.ttf", "score", {255,255,255}, 50, Game::Instance().getRenderer());
			INFO(m_boss->getHealth());
		}else if(Timer::Instance().step() >= m_boss->getEnemyTime()){
			//bullet->m_collided = false;
			//bullet->setVenemous(false);
		}
	}
}

void Player::clean(){
	SDLGameObject::clean();
}

void Player::handleInput(){
	move();

	m_numFrames = 4;
	m_currentFrame = 1;

	if(m_velocity == Vector2D(0, 0)){
		rotateTowards();
	} else {
		Vector2D vec[] = {Vector2D(0,-1), Vector2D(1, -1).norm(), Vector2D(1, 0), Vector2D(1, 1).norm(), Vector2D(0, 1), Vector2D(-1, 1).norm(), Vector2D(-1, 0), Vector2D(-1, -1).norm()};
		for(int i=0; i<8; i++){
			if(m_velocity.norm() == vec[i]){
				changeSprite(i);
			}
		}
		int tmp = m_currentFrame;
		m_currentFrame = 1 + int(((SDL_GetTicks() / 100) % (m_numFrames-1)));
	}
	useSkill();
	if(InputHandler::Instance().getMouseButtonState(LEFT, m_fireRate)){
		count = Timer::Instance().step() + 300;
		AudioManager::Instance().playChunk("assets/sounds/spray.wav");
		INFO("FIRE RATE: " + m_fireRate);
		Vector2D pivot = Vector2D(m_width/2+m_position.getX(), m_height/2 + m_position.getY());
		Vector2D target = InputHandler::Instance().getMousePosition() - pivot;
		target = target.norm();
		bullet =  bulletCreator.create(m_boss);
		//bullet->setVenemous(m_bulletVenemous);
		bullet->load(target, Vector2D(m_width/2+m_position.getX(), m_height/2 + m_position.getY()));
		Game::Instance().getStateMachine()->currentState()->addGameObject(bullet);
	}
}

bool inside(double angle, double value){
	return value > angle - 22.5 && value < angle + 22.5;
}

void Player::changeSprite(int index){
	m_flip = false;
	switch(index){
		case 0: // UP
			m_textureID = "up";
			break;
		case 1: // UP-RIGHT
			m_textureID = "upright";
			break;
		case 2: // RIGHT
			m_flip = true;
			m_textureID = "left";
			break;
		case 3: // DOWN-RIGHT
			m_flip = true;
			m_textureID = "downleft";
			break;
		case 4: // DOWN
			m_textureID = "down";
			break;
		case 5: // DOWN-LEFT
			m_textureID = "downleft";
			break;
		case 6: // LEFT
			m_textureID = "left";
			break;
		case 7: // UP-LEFT
			m_flip = true;
			m_textureID = "upright";
			break;
	}
	if(!canMove){
		m_textureID += "stun";
	} else if(Timer::Instance().step() < count){
		m_textureID += "attack";
	}
}

void Player::rotateTowards(){
	m_numFrames = 1;
	m_currentFrame = 0;
	Vector2D pivot = Vector2D(m_width/2+m_position.getX(), m_height/2 + m_position.getY());

	Vector2D target = InputHandler::Instance().getMousePosition() - pivot;
	target = target.norm();

	double angle = Vector2D::angle(target, Vector2D(0, 1));

	for(int i=0; i<8; i++){
		if(inside(45 * i, angle)){
			changeSprite(i);
			break;
		}
	}

}

void Player::move(){
	Vector2D movement(0, 0);

	if(InputHandler::Instance().isKeyDown("w")){
		movement += Vector2D(0, -1);
	}

	if(InputHandler::Instance().isKeyDown("s")){
		movement += Vector2D(0, +1);
	}

	if(InputHandler::Instance().isKeyDown("d")){
		movement += Vector2D(1, 0);
	}

	if(InputHandler::Instance().isKeyDown("a")){
		movement += Vector2D(-1, 0);
	}
	movement = movement.norm();
	if(!m_isDashing){
		m_velocity = movement * 2;
	}

	dash();

	if(getPosition().getY() + getHeight() >= 705){
		if(m_velocity.getY() > 0)
			m_velocity.setY(0);
	} else if(getPosition().getY() <= 20){
		if(m_velocity.getY() < 0)
			m_velocity.setY(0);
	}

	if(getPosition().getX() + getWidth() >= 1365){
		if(m_velocity.getX() > 0)
			m_velocity.setX(0);
	} else if(getPosition().getX() <= -6){
		if(m_velocity.getX() < 0)
			m_velocity.setX(0);
	}

	m_position += m_velocity;
	if(Physics::Instance().checkCollision(this, m_boss)){
		m_position -= m_velocity;
		setLife(m_life - 1);
	}

	for(auto x: engine::Game::Instance().getStateMachine()->currentState()->getShieldObjects()){
		if(Physics::Instance().checkCollision(this, x)){
			if(dynamic_cast<Childmaiden*>(x)->getVisibility())
				m_position -= m_velocity;
			//setLife(m_life - 1);
		}
	}
}

void Player::useSkill(){

	if(InputHandler::Instance().isKeyDown("1", 200)){
		m_skillManager.setSkillPair(&m_pSkills, RED, &isFirstSkill);
	}

	if(InputHandler::Instance().isKeyDown("2", 200)){
		m_skillManager.setSkillPair(&m_pSkills, GREEN, &isFirstSkill);
	}

	if(InputHandler::Instance().isKeyDown("3", 200)){
		m_skillManager.setSkillPair(&m_pSkills, BLUE, &isFirstSkill);
	}

	if(InputHandler::Instance().isKeyDown("r", 100)){
		std::map<std::pair<default_inks, default_inks>, bool>::iterator it = m_skillManager.getCoolDownMap()->find(m_pSkills);
		if(it != m_skillManager.getCoolDownMap()->end()){
			if(it->second == false){
				m_skillManager.setCoolDownTrigger(m_pSkills);
				if(m_pSkills.first != BLANK and m_pSkills.second != BLANK){
					pixelColors = m_skillManager.getSkill(m_pSkills)();
					TheTextureManager::Instance().changeColorPixels(pixelColors, "bullet");
					//TheTextureManager::Instance().changeColorPixels(pixelColors, "instance");
				}
			}
			else
				INFO("TA EM CD");

			m_pSkills.first = BLANK;
			m_pSkills.second = BLANK;
			isFirstSkill = true;
		}
	}
}

void Player::dash(){

	if(InputHandler::Instance().isKeyDown("space", 1000)){
		m_dashTime = Timer::Instance().step();
		m_velocity = (m_velocity.norm() * 15);
		m_isDashing = true;
	}

	if(m_isDashing && Timer::Instance().step() >= m_dashTime + 100){
		m_isDashing = false;
	}

}

void Player::setPlayerMoves(bool value){
	canMove = value;

}


text:
<!--
   This file is part of the X12Parser library that provides tools to
   manipulate X12 messages using Ruby native syntax.

   http://x12parser.rubyforge.org

   Copyright (C) 2009 APP Design, Inc.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

   $Id: F14.xml 78 2009-05-12 22:27:26Z ikk $
-->

<Segment name="F14" comment="To identify the specific reasons why individual line items of a claim or part of a claim are rejected">
  <Field name="AssignedNumber" type="long" min="1" max="6" comment="Number assigned for differentiation within a transaction set"/>
  <Field name="DeclineAmendReasonCode" min="3" max="3" validation="T548" comment="Code indicating the reason for declination or amendment"/>
</Segment>


text:
@interface PodsDummy_Pods_TypographyKit_Example : NSObject
@end
@implementation PodsDummy_Pods_TypographyKit_Example
@end


text:
package com.payneteasy.superfly.security;

import com.payneteasy.superfly.api.SSOService;
import com.payneteasy.superfly.security.authentication.EmptyAuthenticationToken;
import com.payneteasy.superfly.security.authentication.SSOAuthenticationRequest;
import com.payneteasy.superfly.security.authentication.UsernamePasswordAuthRequestInfoAuthenticationToken;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;

import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.*;

public class SuperflySSOAuthenticationProviderTest extends
        AbstractSuperflyAuthenticationProviderTest {

    private SuperflySSOAuthenticationProvider provider;
    private SSOService ssoService;

    @Before
    public void setUp() {
        ssoService = EasyMock.createMock(SSOService.class);
        provider = new SuperflySSOAuthenticationProvider();
        provider.setSsoService(ssoService);
    }

    @Test
    public void testSupports() {
        assertTrue(provider.supports(SSOAuthenticationRequest.class));
        assertFalse(provider.supports(UsernamePasswordAuthRequestInfoAuthenticationToken.class));
        assertFalse(provider.supports(UsernamePasswordAuthenticationToken.class));
    }

    @Test
    public void testSuccess() {
        expect(ssoService.exchangeSubsystemToken("token"))
                .andReturn(createSSOUserWithOneRole());
        replay(ssoService);
        Authentication auth = provider.authenticate(createSSOAuthenticationRequest());
        assertNotNull(auth);
    }

    private SSOAuthenticationRequest createSSOAuthenticationRequest() {
        return new SSOAuthenticationRequest("token");
    }

    @Test
    public void testBadCredentials() {
        expect(ssoService.exchangeSubsystemToken("bad-token")).andReturn(null);
        replay(ssoService);
        try {
            provider.authenticate(new SSOAuthenticationRequest("bad-token"));
            Assert.fail();
        } catch (BadCredentialsException e) {
            // expected
        }
    }

    @Test
    public void testUnsupportedAuthentication() {
        assertNull(provider.authenticate(new EmptyAuthenticationToken()));
    }

    @Test
    public void testNullCredentials() {
        try {
            provider.authenticate(new SSOAuthenticationRequest(null));
            fail();
        } catch (BadCredentialsException e) {
            // expected
        }
    }

    @Test
    public void testNoRoles() {
        expect(ssoService.exchangeSubsystemToken("token")).andReturn(createSSOUserWithNoRoles());
        replay(ssoService);
        try {
            provider.authenticate(createSSOAuthenticationRequest());
            fail();
        } catch (BadCredentialsException e) {
            // expected
        }
    }
}


text:
import * as registerSuite from 'intern!object';
import * as assert from 'intern/chai!assert';
import { stub, SinonStub } from 'sinon';
import { getCommandsMap, getYargsStub, GroupDef } from '../support/testHelper';

const { 'default': registerCommands } = require('intern/dojo/node!../../src/registerCommands');
const defaultCommandWrapper = require('intern/dojo/node!../support/test-prefix-foo-bar');

const groupDef: GroupDef = [
	{
		groupName: 'group1',
		commands: [ { commandName: 'command1' } ]
	},
	{
		groupName: 'group2',
		commands: [ { commandName: 'command1' }, { commandName: 'command2' }  ]
	}
];
let commandsMap: any;
let yargsStub: any;
let defaultRegisterStub: SinonStub;
let defaultRunStub: SinonStub;
let consoleErrorStub: SinonStub;
const errorMessage = 'test error message';

function createYargsCommandNames(obj: any): Map<string, Set<any>> {
	const map = new Map();
	for ( let key in obj ) {
		map.set(key, obj[key]);
	}
	return map;
}

registerSuite({
	name: 'registerCommands',
	'beforeEach'() {
		yargsStub = getYargsStub();
		commandsMap = getCommandsMap(groupDef);
	},
	'Should setup correct yargs arguments'() {
		const yargsArgs = [ 'demand', 'usage', 'epilog', 'help', 'strict' ];
		registerCommands(yargsStub, commandsMap, new Map());
		yargsArgs.forEach((arg) => {
			assert.isTrue(yargsStub[arg].calledOnce);
		});
		assert.isTrue(yargsStub.alias.calledOnce, 'Should be called for help aliases');
	},
	'Should call strict for all commands'() {
		registerCommands(yargsStub, commandsMap, createYargsCommandNames({
			'group1': new Set([ 'group1-command1' ]),
			'group2': new Set([ 'group2-command1', 'group2-command2' ])
		}));
		assert.equal(yargsStub.strict.callCount, 4);
	},
	'Should call yargs.command once for each yargsCommandName passed and once for the default command'() {
		const key = 'group1-command1';
		const { group, description } = commandsMap.get(key);
		registerCommands(yargsStub, commandsMap, createYargsCommandNames({'group1': new Set([ key ])}));
		assert.isTrue(yargsStub.command.calledTwice);
		assert.isTrue(yargsStub.command.firstCall.calledWith(group, description), 'First call is for parent');
		assert.isTrue(yargsStub.command.secondCall.calledWith('command1', key), 'Second call is sub-command');
	},
	'Should run the passed command when yargs called with group name and command'() {
		const key = 'group1-command1';
		const { run } = commandsMap.get(key);
		registerCommands(yargsStub, commandsMap, createYargsCommandNames({'group1': new Set([ key ])}));
		yargsStub.command.secondCall.args[3]();
		assert.isTrue(run.calledOnce);
	},
	'default command': {
		'beforeEach'() {
			defaultRegisterStub = stub(defaultCommandWrapper, 'register');
			defaultRunStub = stub(defaultCommandWrapper, 'run').returns(Promise.resolve());
			commandsMap.set('group1', defaultCommandWrapper);
			const key = 'group1-command1';
			registerCommands(yargsStub, commandsMap, createYargsCommandNames({'group1': new Set([ key ])}));
		},
		'afterEach'() {
			defaultRegisterStub.restore();
			defaultRunStub .restore();
		},
		'Should register the default command'() {
			assert.isTrue(defaultRegisterStub.calledOnce);
		},
		'Should run default command when yargs called with only group name'() {
			yargsStub.command.firstCall.args[3]({'_': ['group']});
			assert.isTrue(defaultRunStub.calledOnce);
		},
		'Should not run default command when yargs called with group name and command'() {
			yargsStub.command.firstCall.args[3]({'_': ['group', 'command']});
			assert.isFalse(defaultRunStub.called);
		},
		'error message': {
			'beforeEach'() {
				consoleErrorStub = stub(console, 'error');
				defaultRunStub.returns(Promise.reject(new Error(errorMessage)));
			},
			'afterEach'() {
				consoleErrorStub.restore();
			},
			async 'Should show error message if the run command rejects'() {
				await yargsStub.command.firstCall.args[3]({'_': ['group']});
				assert.isTrue(consoleErrorStub.calledOnce);
				assert.isTrue(consoleErrorStub.firstCall.calledWithMatch(errorMessage));
			}
		}
	}
});


text:
import PropTypes from "prop-types"
import block from "bem-cn-lite"
import renderTemplate from "../../utils/renderTemplate"
import { connect } from "react-redux"
import { first } from "underscore"

function Footer(props) {
  const { articles, footerItem, showArticles, showFooterItems, sd } = props

  const b = block("auction-Footer")

  if (!showArticles) {
    return null
  }

  return (
    <footer
      className={b
        .builder()({ without: false })
        .mix("auction-page-section")
        .mix(articles.length ? "has-articles" : "has-no-articles")()}
    >
      {showArticles && (
        <div className={b("auction-articles")}>
          {articles.models.map((article, key) => {
            let articleFigureHTML

            // Serverside
            if (typeof window === "undefined") {
              const path = require("path")

              articleFigureHTML = renderTemplate(
                path.resolve(
                  __dirname,
                  "../../../../components/article_figure/template.jade"
                ),
                { locals: { article, sd } }
              )

              // Client
            } else {
              articleFigureHTML = require("../../../../components/article_figure/template.jade")(
                { article, ...sd }
              )
            }

            return (
              <div
                key={key}
                dangerouslySetInnerHTML={{ __html: articleFigureHTML }}
              />
            )
          })}
        </div>
      )}
    </footer>
  )
}

Footer.propTypes = {
  articles: PropTypes.object,
  showArticles: PropTypes.bool,
  sd: PropTypes.object.isRequired,
}

Footer.defaultProps = {
  articles: {},
  footerItems: [],
}

const mapStateToProps = state => {
  const { auction, articles, sd } = state.app
  const showArticles = Boolean(articles.length)

  return {
    articles,
    showArticles,
    sd,
  }
}

export default connect(mapStateToProps)(Footer)

// Helpers

export const test = { Footer }


text:
angular.module('pledgr.signin', [])

.controller('SignInController', function($scope, $window, $state, $location, Auth) {
  $scope.user = {
    username: 'someone@example.com',
    password: 'Password'
  };

  $scope.signin = function() {
    Auth.signin($scope.user)
      .then(function() {
        var token = $window.sessionStorage.token;
        if (Auth.isAuthenticated(token)) {
          $state.go('profile');
        } else {
          $state.go('signin');
        }
      })
      .catch(function(error) {
        console.error(error);
      });
  };
});


text:
from __future__ import unicode_literals

from django.db import migrations, models
import cms.models.fields

class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0013_urlconfrevision'),
    ]

    operations = [
        migrations.CreateModel(
            name='SearchResults',
            fields=[
                ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
                ('placeholder', cms.models.fields.PlaceholderField(editable=False, null=True, slotname='search_results', to='cms.Placeholder')),
            ],
            options={
                'verbose_name_plural': 'Search results',
                'verbose_name': 'Search result',
            },
        ),
        migrations.CreateModel(
            name='SearchResultsTranslation',
            fields=[
                ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=64)),
                ('language_code', models.CharField(db_index=True, max_length=15)),
                ('master', models.ForeignKey(editable=False, null=True, to='searcher.SearchResults', related_name='translations')),
            ],
            options={
                'abstract': False,
                'db_table': 'searcher_searchresults_translation',
                'managed': True,
                'default_permissions': (),
                'db_tablespace': '',
            },
        ),
        migrations.AlterUniqueTogether(
            name='searchresultstranslation',
            unique_together=set([('language_code', 'master')]),
        ),
    ]


text:
class TXsheet;

//=============================================================================
// TKeyframeData
//-----------------------------------------------------------------------------

class TKeyframeData final : public DvMimeData {
public:
  typedef TKeyframeSelection::Position Position;
  typedef std::map<Position, TStageObject::Keyframe> KeyData;
  typedef std::map<Position, TStageObject::Keyframe>::const_iterator Iterator;

  KeyData m_keyData;
  int m_columnSpanCount;
  int m_rowSpanCount;

  // Numero di colonna della pegbar associato al booleano isCycleEnabled della
  // pegbar
  std::map<int, bool> m_isPegbarsCycleEnabled;

  TKeyframeData();
  TKeyframeData(const TKeyframeData *src);
  ~TKeyframeData();

  TKeyframeData *clone() const override { return new TKeyframeData(this); }

  // data <- xsh
  void setKeyframes(std::set<Position> positions, TXsheet *xsh);

  // data -> xsh
  bool getKeyframes(std::set<Position> &positions, TXsheet *xsh) const;

  // Reads data keyframes and fills in positions set. The first element
  // passed with the set is automatically added to stored positions.
  void getKeyframes(std::set<Position> &positions) const;

  TKeyframeData *clone() {
    TKeyframeData *data = new TKeyframeData(this);
    return data;
  }

  int getColumnSpanCount() const { return m_columnSpanCount; }
  int getRowSpanCount() const { return m_rowSpanCount; }
};

#endif  // KEYFRAMEDATA_INCLUDED


text:
$nuget = $env:NuGet

#parse the version number out of package.json
$pversion = ((Get-Content $env:SourcesPath\package.json) -join "`n" | ConvertFrom-Json).version

#create packages
& $nuget pack "nuget\vendor-icons.nuspec" -Verbosity detailed -NonInteractive -NoPackageAnalysis -BasePath $env:SourcesPath -Version $pversion