text:
// *****************************************************************************
//
//  © Component Factory Pty Ltd 2012. All rights reserved.
//	The software and associated documentation supplied hereunder are the
//  proprietary information of Component Factory Pty Ltd, PO Box 1504,
//  Glen Waverley, Vic 3150, Australia and are supplied subject to licence terms.
//
//  Version 4.4.0.0 	www.ComponentFactory.com
// *****************************************************************************

using System;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using ComponentFactory.Krypton.Toolkit;

namespace ExpandingHeaderGroupsSplitters
{
    public partial class Form1 : KryptonForm
    {
        private int _heightUpDown;
        private int _widthLeftRight;

        public Form1()
        {
            InitializeComponent();

            // Hook into the click events on the header buttons
            kryptonHeaderGroupRightBottom.ButtonSpecs[0].Click += new EventHandler(OnUpDown);
            kryptonHeaderGroupLeft.ButtonSpecs[0].Click += new EventHandler(OnLeftRight);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // Set position of caret in the text boxes, so it looks nicer at runtime!
            textBoxLeft.SelectionStart = textBoxRightTop.SelectionStart = textBoxRightBottom.SelectionStart = 0;
            textBoxLeft.SelectionLength = textBoxRightTop.SelectionLength = textBoxRightBottom.SelectionLength = 0;
        }

        private void OnUpDown(object sender, EventArgs e)
        {
            // Suspend layout changes until all splitter properties have been updated
            kryptonSplitContainerVertical.SuspendLayout();

            // Is the bottom right header group currently expanded?
            if (kryptonSplitContainerVertical.FixedPanel == FixedPanel.None)
            {
                // Make the bottom panel of the splitter fixed in size
                kryptonSplitContainerVertical.FixedPanel = FixedPanel.Panel2;
                kryptonSplitContainerVertical.IsSplitterFixed = true;

                // Remember the current height of the header group (to restore later)
                _heightUpDown = kryptonHeaderGroupRightBottom.Height;

                // Find the new height to use for the header group
                int newHeight = kryptonHeaderGroupRightBottom.PreferredSize.Height;

                // Make the header group fixed to the new height
                kryptonSplitContainerVertical.Panel2MinSize = newHeight;
                kryptonSplitContainerVertical.SplitterDistance = kryptonSplitContainerVertical.Height;
            }
            else
            {
                // Make the bottom panel not-fixed in size anymore
                kryptonSplitContainerVertical.FixedPanel = FixedPanel.None;
                kryptonSplitContainerVertical.IsSplitterFixed = false;

                // Put back the minimise size to the original
                kryptonSplitContainerVertical.Panel2MinSize = 100;

                // Calculate the correct splitter we want to put back
                kryptonSplitContainerVertical.SplitterDistance = kryptonSplitContainerVertical.Height - _heightUpDown - kryptonSplitContainerVertical.SplitterWidth;
            }

            kryptonSplitContainerVertical.ResumeLayout();
        }

        private void OnLeftRight(object sender, EventArgs e)
        {
            // Suspend layout changes until all splitter properties have been updated
            kryptonSplitContainerHorizontal.SuspendLayout();

            // Is the left header group currently expanded?
            if (kryptonSplitContainerHorizontal.FixedPanel == FixedPanel.None)
            {
                // Make the left panel of the splitter fixed in size
                kryptonSplitContainerHorizontal.FixedPanel = FixedPanel.Panel1;
                kryptonSplitContainerHorizontal.IsSplitterFixed = true;

                // Remember the current height of the header group
                _widthLeftRight = kryptonHeaderGroupLeft.Width;

                // We have not changed the orientation of the header yet, so the width of
                // the splitter panel is going to be the height of the collapsed header group
                int newWidth = kryptonHeaderGroupLeft.PreferredSize.Height;

                // Make the header group fixed just as the new height
                kryptonSplitContainerHorizontal.Panel1MinSize = newWidth;
                kryptonSplitContainerHorizontal.SplitterDistance = newWidth;

                // Change header to be vertical and button to near edge
                kryptonHeaderGroupLeft.HeaderPositionPrimary = VisualOrientation.Right;
                kryptonHeaderGroupLeft.ButtonSpecs[0].Edge = PaletteRelativeEdgeAlign.Near;
            }
            else
            {
                // Make the bottom panel not-fixed in size anymore
                kryptonSplitContainerHorizontal.FixedPanel = FixedPanel.None;
                kryptonSplitContainerHorizontal.IsSplitterFixed = false;

                // Put back the minimise size to the original
                kryptonSplitContainerHorizontal.Panel1MinSize = 100;

                // Calculate the correct splitter we want to put back
                kryptonSplitContainerHorizontal.SplitterDistance = _widthLeftRight;

                // Change header to be horizontal and button to far edge
                kryptonHeaderGroupLeft.HeaderPositionPrimary = VisualOrientation.Top;
                kryptonHeaderGroupLeft.ButtonSpecs[0].Edge = PaletteRelativeEdgeAlign.Far;
            }

            kryptonSplitContainerHorizontal.ResumeLayout();
        }

        private void UpdateCollapsedSizing()
        {
            // Is the bottom right header group currently collapsed?
            if (kryptonSplitContainerVertical.FixedPanel == FixedPanel.Panel2)
            {
                // Suspend layout changes until all splitter properties have been updated
                kryptonSplitContainerHorizontal.SuspendLayout();

                // Get the new preferred height of the header group and apply it
                int newHeight = kryptonHeaderGroupRightBottom.PreferredSize.Height;
                kryptonSplitContainerVertical.Panel2MinSize = newHeight;
                kryptonSplitContainerVertical.SplitterDistance = kryptonSplitContainerVertical.Height;

                kryptonSplitContainerHorizontal.ResumeLayout();
            }

            // Is the left header group currently collapsed?
            if (kryptonSplitContainerHorizontal.FixedPanel == FixedPanel.Panel1)
            {
                // Suspend layout changes until all splitter properties have been updated
                kryptonSplitContainerVertical.SuspendLayout();

                // Get the new preferred width of the header group and apply it
                int newWidth = kryptonHeaderGroupLeft.PreferredSize.Width;
                kryptonSplitContainerHorizontal.Panel1MinSize = newWidth;
                kryptonSplitContainerHorizontal.SplitterDistance = newWidth;

                kryptonSplitContainerVertical.ResumeLayout();
            }
        }

        private void toolOffice2010_Click(object sender, EventArgs e)
        {
            if (!toolOffice2010.Checked)
            {
                kryptonManager.GlobalPaletteMode = PaletteModeManager.Office2010Blue;
                toolOffice2010.Checked = menuOffice2010.Checked = true;
                toolOffice2007.Checked = menuOffice2007.Checked = false;
                toolSystem.Checked = menuSystem.Checked = false;
                toolSparkle.Checked = menuSparkle.Checked = false;
                UpdateCollapsedSizing();
            }
        }

        private void toolOffice2007_Click(object sender, EventArgs e)
        {
            if (!toolOffice2007.Checked)
            {
                kryptonManager.GlobalPaletteMode = PaletteModeManager.Office2007Blue;
                toolOffice2010.Checked = menuOffice2010.Checked = false;
                toolOffice2007.Checked = menuOffice2007.Checked = true;
                toolSystem.Checked = menuSystem.Checked = false;
                toolSparkle.Checked = menuSparkle.Checked = false;
                UpdateCollapsedSizing();
            }
        }

        private void toolSystem_Click(object sender, EventArgs e)
        {
            if (!toolSystem.Checked)
            {
                kryptonManager.GlobalPaletteMode = PaletteModeManager.ProfessionalSystem;
                toolOffice2010.Checked = menuOffice2010.Checked = false;
                toolOffice2007.Checked = menuOffice2007.Checked = false;
                toolSystem.Checked = menuSystem.Checked = true;
                toolSparkle.Checked = menuSparkle.Checked = false;
                UpdateCollapsedSizing();
            }
        }

        private void toolSparkle_Click(object sender, EventArgs e)
        {
            if (!toolSparkle.Checked)
            {
                kryptonManager.GlobalPaletteMode = PaletteModeManager.SparkleBlue;
                toolOffice2010.Checked = menuOffice2010.Checked = false;
                toolOffice2007.Checked = menuOffice2007.Checked = false;
                toolSystem.Checked = menuSystem.Checked = false;
                toolSparkle.Checked = menuSparkle.Checked = true;
                UpdateCollapsedSizing();
            }
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}


text:
from sfepy import data_dir

filename_mesh = data_dir + '/meshes/3d/cylinder.mesh'

#! Materials
#! ---------
#$ Here we define just a constant coefficient $c$ of the Poisson equation,
#$ using the 'values' attribute. Other possible attribute is 'function', for
#$ material coefficients computed/obtained at runtime.

material_2 = {
    'name' : 'coef',
    'values' : {'val' : 1.0},
}

#! Fields
#! ------
#! A field is used mainly to define the approximation on a (sub)domain, i.e. to
#$ define the discrete spaces $V_h$, where we seek the solution.
#!
#! The Poisson equation can be used to compute e.g. a temperature distribution,
#! so let us call our field 'temperature'. On a region called 'Omega'
#! (see below) it will be approximated using P1 finite elements.

field_1 = {
    'name' : 'temperature',
    'dtype' : 'real',
    'shape' : (1,),
    'region' : 'Omega',
    'approx_order' : 1,
}

#! Variables
#! ---------
#! One field can be used to generate discrete degrees of freedom (DOFs) of
#! several variables. Here the unknown variable (the temperature) is called
#! 't', it's associated DOF name is 't.0' --- this will be referred to
#! in the Dirichlet boundary section (ebc). The corresponding test variable of
#! the weak formulation is called 's'. Notice that the 'dual' item of a test
#! variable must specify the unknown it corresponds to.

variable_1 = {
    'name' : 't',
    'kind' : 'unknown field',
    'field' : 'temperature',
    'order' : 0, # order in the global vector of unknowns
}

variable_2 = {
    'name' : 's',
    'kind' : 'test field',
    'field' : 'temperature',
    'dual' : 't',
}

#! Regions
#! -------
region_1000 = {
    'name' : 'Omega',
    'select' : 'elements of group 6',
}

region_03 = {
    'name' : 'Gamma_Left',
    'select' : 'nodes in (x < 0.00001)',
}

region_4 = {
    'name' : 'Gamma_Right',
    'select' : 'nodes in (x > 0.099999)',
}

#! Boundary Conditions
#! -------------------
#! Essential (Dirichlet) boundary conditions can be specified as follows:
ebc_1 = {
    'name' : 't1',
    'region' : 'Gamma_Left',
    'dofs' : {'t.0' : 2.0},
}

ebc_2 = {
    'name' : 't2',
    'region' : 'Gamma_Right',
    'dofs' : {'t.0' : -2.0},
}

#! Equations
#! ---------
#$ The weak formulation of the Poisson equation is:
#$ \begin{center}
#$ Find $t \in V$, such that
#$ $\int_{\Omega} c\ \nabla t : \nabla s = f, \quad \forall s \in V_0$.
#$ \end{center}
#$ The equation below directly corresponds to the discrete version of the
#$ above, namely:
#$ \begin{center}
#$ Find $\bm{t} \in V_h$, such that
#$ $\bm{s}^T (\int_{\Omega_h} c\ \bm{G}^T G) \bm{t} = 0, \quad \forall \bm{s}
#$ \in V_{h0}$,
#$ \end{center}
#$ where $\nabla u \approx \bm{G} \bm{u}$. Below we use $f = 0$ (Laplace
#$ equation).
#! We also define an integral here: 'gauss_o1_d3' says that we wish to use
#! quadrature of the first order in three space dimensions.
integral_1 = {
    'name' : 'i1',
    'kind' : 'v',
    'quadrature' : 'gauss_o2_d3',
}

equations = {
    'Temperature' : """dw_laplace.i1.Omega( coef.val, s, t ) = 0"""
}

#! Linear solver parameters
#! ---------------------------
#! Use umfpack, if available, otherwise superlu.
solver_0 = {
    'name' : 'ls',
    'kind' : 'ls.scipy_direct',
    'method' : 'auto',
}

#! Nonlinear solver parameters
#! ---------------------------
#! Even linear problems are solved by a nonlinear solver (KISS rule) - only one
#! iteration is needed and the final rezidual is obtained for free.
solver_1 = {
    'name' : 'newton',
    'kind' : 'nls.newton',

    'i_max'      : 1,
    'eps_a'      : 1e-10,
    'eps_r'      : 1.0,
    'macheps'   : 1e-16,
    'lin_red'    : 1e-2, # Linear system error < (eps_a * lin_red).
    'ls_red'     : 0.1,
    'ls_red_warp' : 0.001,
    'ls_on'      : 1.1,
    'ls_min'     : 1e-5,
    'check'     : 0,
    'delta'     : 1e-6,
    'is_plot'    : False,
    'problem'   : 'nonlinear', # 'nonlinear' or 'linear' (ignore i_max)
}

#! Options
#! -------
#! Use them for anything you like... Here we show how to tell which solvers
#! should be used - reference solvers by their names.
options = {
    'nls' : 'newton',
    'ls' : 'ls',
}

#! FE assembling parameters
#! ------------------------
#! 'chunk_size' is now unused, deprecated, and will be removed.
fe = {
    'chunk_size' : 1000
}

redpajama_set_name: RedPajamaGithub


text:
\documentclass{article}
\begin{document}
Same-author references are cool [Foo10, Foo11a, Foo11b, Foo12, Foo11c, Bar13].
citet is pretty awesome too, according to [Foo10] (and later confirmed by [Bar13]).
Prenote only [e.g. Foo11a].
Pre- and postnote [e.g. Foo11b, Foo11c, and references therein].
Postnote only [Foo10, and references therein].
\bibliography{input}
\nocite{foo2010,foo2011lorem,foo2011ipsum,foo2012,foo2011dolor,bar2013}
\end{document}


text:
module Azure::DataFactory::Mgmt::V2017_09_01_preview
  module Models
    #
    # A list of pipeline resources.
    #
    class PipelineListResponse

      include MsRestAzure

      include MsRest::JSONable
      # @return [Array<PipelineResource>] List of pipelines.
      attr_accessor :value

      # @return [String] The link to the next page of results, if any remaining
      # results exist.
      attr_accessor :next_link

      # return [Proc] with next page method call.
      attr_accessor :next_method

      #
      # Gets the rest of the items for the request, enabling auto-pagination.
      #
      # @return [Array<PipelineResource>] operation results.
      #
      def get_all_items
        items = @value
        page = self
        while page.next_link != nil && !page.next_link.strip.empty? do
          page = page.get_next_page
          items.concat(page.value)
        end
        items
      end

      #
      # Gets the next page of results.
      #
      # @return [PipelineListResponse] with next page content.
      #
      def get_next_page
        response = @next_method.call(@next_link).value! unless @next_method.nil?
        unless response.nil?
          @next_link = response.body.next_link
          @value = response.body.value
          self
        end
      end

      #
      # Mapper for PipelineListResponse class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'PipelineListResponse',
          type: {
            name: 'Composite',
            class_name: 'PipelineListResponse',
            model_properties: {
              value: {
                client_side_validation: true,
                required: true,
                serialized_name: 'value',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'PipelineResourceElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'PipelineResource'
                      }
                  }
                }
              },
              next_link: {
                client_side_validation: true,
                required: false,
                serialized_name: 'nextLink',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
/* random.hpp provides a crypto secure Random Number Generator using an OS
   specific seed
*/

#ifndef TAO_CRYPT_RANDOM_HPP
#define TAO_CRYPT_RANDOM_HPP

#include "arc4.hpp"
#include "error.hpp"

namespace TaoCrypt {

// OS specific seeder
class OS_Seed {
public:
    OS_Seed();
    ~OS_Seed();

    void   GenerateSeed(byte*, word32 sz);
    Error  GetError() const { return error_; }
private:
#if defined(_WIN32)
    #if defined(_WIN64)
        typedef unsigned __int64 ProviderHandle;
        // type HCRYPTPROV, avoid #include <windows.h>
    #else
        typedef unsigned long ProviderHandle;
    #endif
    ProviderHandle handle_;
#else
    int fd_;
#endif
    Error error_;

    OS_Seed(const OS_Seed&);              // hide copy
    OS_Seed& operator=(const OS_Seed&);   // hide assign
};

// secure Random Nnumber Generator
class RandomNumberGenerator {
public:
    RandomNumberGenerator();
    ~RandomNumberGenerator() {}

    void GenerateBlock(byte*, word32 sz);
    byte GenerateByte();

    ErrorNumber GetError() const { return seed_.GetError().What(); }
private:
    OS_Seed seed_;
    ARC4    cipher_;

    RandomNumberGenerator(const RandomNumberGenerator&);           // hide copy
    RandomNumberGenerator operator=(const RandomNumberGenerator&); // && assign
};

}  // namespace

#endif // TAO_CRYPT_RANDOM_HPP


text:
var Tccc;
(function (Tccc) {
    var ScheduleService = /** @class */ (function () {
        function ScheduleService(apiService) {
            this.apiService = apiService;
        }
        ScheduleService.prototype.getScheduleForEvent = function (eventId) {
            var args = { eventId: eventId };
            var selector = function (s) { return s ? new Tccc.Schedule(s) : null; };
            return this.apiService.query("/schedules/getscheduleforevent", args, selector);
        };
        ScheduleService.prototype.getAll = function () {
            var selector = function (results) { return results.map(function (r) { return new Tccc.Schedule(r); }); };
            return this.apiService.query("/schedules/getAll", null, selector);
        };
        ScheduleService.prototype.save = function (schedule) {
            var selector = function (s) { return new Tccc.Schedule(s); };
            return this.apiService.post("/schedules/save", schedule, selector);
        };
        ScheduleService.$inject = ["apiService"];
        return ScheduleService;
    }());
    Tccc.ScheduleService = ScheduleService;
    Tccc.App.service("scheduleApi", ScheduleService);
})(Tccc || (Tccc = {}));
//# sourceMappingURL=ScheduleService.js.map


text:
package org.pentaho.hadoop.shim.common;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URL;
import java.util.List;
import java.util.Properties;

import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil;
import org.apache.pig.impl.util.PropertiesUtil;
import org.apache.pig.tools.grunt.GruntParser;
import org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor;
import org.apache.pig.tools.parameters.ParseException;
import org.pentaho.hadoop.shim.ShimVersion;
import org.pentaho.hadoop.shim.api.Configuration;
import org.pentaho.hadoop.shim.spi.PigShim;

public abstract class CommonPigShim implements PigShim {
  private static final String[] EMPTY_STRING_ARRAY = new String[ 0 ];

  @Override
  public ShimVersion getVersion() {
    return new ShimVersion( 1, 0 );
  }

  @Override
  public boolean isLocalExecutionSupported() {
    return true;
  }

  @Override
  public void configure( Properties properties, Configuration configuration ) {
    PropertiesUtil.loadDefaultProperties( properties );
    if ( configuration != null ) {
      properties.putAll( ConfigurationUtil.toProperties( ShimUtils.asConfiguration( configuration ) ) );
    }
  }

  @Override
  public String substituteParameters( URL pigScript, List<String> paramList ) throws IOException, ParseException {
    final InputStream inStream = pigScript.openStream();
    StringWriter writer = new StringWriter();
    // do parameter substitution
    ParameterSubstitutionPreprocessor psp = new ParameterSubstitutionPreprocessor( 50 );
    psp.genSubstitutedFile( new BufferedReader( new InputStreamReader( inStream ) ),
      writer,
      paramList.size() > 0 ? paramList.toArray( EMPTY_STRING_ARRAY ) : null, null );
    return writer.toString();
  }

  /**
   * Convert {@link ExecutionMode} to {@link ExecType}
   *
   * @param mode Execution mode
   * @return Type of execution for mode
   */
  protected ExecType getExecType( ExecutionMode mode ) {
    switch( mode ) {
      case LOCAL:
        return ExecType.LOCAL;
      case MAPREDUCE:
        return ExecType.MAPREDUCE;
      default:
        throw new IllegalStateException( "unknown execution mode: " + mode );
    }
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/KLTN.iml" filepath="$PROJECT_DIR$/KLTN.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
    </modules>
  </component>
</project>


text:
package org.deeplearning4j.datasets.iterator.callbacks;

import org.nd4j.linalg.api.concurrency.AffinityManager;
import org.nd4j.linalg.dataset.api.DataSet;
import org.nd4j.linalg.dataset.api.MultiDataSet;
import org.nd4j.linalg.factory.Nd4j;

@Deprecated
public class DefaultCallback extends org.nd4j.linalg.dataset.callbacks.DefaultCallback {

}


text:
namespace blink {

class MODULES_EXPORT CSSAnimationWorklet final
    : public GarbageCollected<CSSAnimationWorklet>,
      public Supplement<LocalDOMWindow>,
      public ExecutionContextLifecycleObserver {
 public:
  static const char kSupplementName[];

  static AnimationWorklet* animationWorklet(ScriptState*);

  explicit CSSAnimationWorklet(LocalDOMWindow&);

  void ContextDestroyed() override;

  void Trace(Visitor*) const override;

 private:
  static CSSAnimationWorklet& From(LocalDOMWindow&);

  Member<AnimationWorklet> animation_worklet_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_ANIMATIONWORKLET_CSS_ANIMATION_WORKLET_H_


text:
<?php

namespace REBELinBLUE\Deployer\Events;

use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Lang;
use REBELinBLUE\Deployer\Contracts\Events\HasSlackPayloadInterface;
use REBELinBLUE\Deployer\Heartbeat;

/**
 * Event class which is thrown when the heartbeat recovers.
 **/
class HeartbeatRecovered extends Event implements HasSlackPayloadInterface
{
    use SerializesModels;

    /**
     * @var Heartbeat
     */
    public $heartbeat;

    /**
     * HeartbeatRecovered constructor.
     *
     * @param Heartbeat $heartbeat
     */
    public function __construct(Heartbeat $heartbeat)
    {
        $this->heartbeat = $heartbeat;
    }

    /**
     * @return array
     */
    public function notificationPayload()
    {
        $message = Lang::get('heartbeats.recovered_message', ['job' => $this->heartbeat->name]);
        $url     = route('projects', ['id' => $this->heartbeat->project_id]);

        $payload = [
            'attachments' => [
                [
                    'fallback' => $message,
                    'text'     => $message,
                    'color'    => 'good',
                    'fields'   => [
                        [
                            'title' => Lang::get('notifications.project'),
                            'value' => sprintf('<%s|%s>', $url, $this->heartbeat->project->name),
                            'short' => true,
                        ],
                    ],
                    'footer' => Lang::get('app.name'),
                    'ts'     => time(),
                ],
            ],
        ];

        return $payload;
    }
}


text:
class OpenStruct
  #
  # Creates a new OpenStruct object.  By default, the resulting OpenStruct
  # object will have no attributes.
  #
  # The optional +hash+, if given, will generate attributes and values.
  # For example:
  #
  #   require 'ostruct'
  #   hash = { "country" => "Australia", :population => 20_000_000 }
  #   data = OpenStruct.new(hash)
  #
  #   p data        # -> <OpenStruct country="Australia" population=20000000>
  #
  # You may also define the hash in the initialization call:
  #
  #   australia = OpenStruct.new(:country => "Australia",
  #                              :population => 20_000_000)
  #   p australia   # -> <OpenStruct country="Australia" population=20000000>
  #
  def initialize(hash=nil)
    @table = {}
    if hash
      for k,v in hash
        @table[k.to_sym] = v
        new_ostruct_member(k)
      end
    end
  end

  # Duplicate an OpenStruct object members.
  def initialize_copy(orig)
    super
    @table = @table.dup
  end

  #
  # Provides marshalling support for use by the Marshal library. Returning the
  # underlying Hash table that contains the functions defined as the keys and
  # the values assigned to them.
  #
  #    require 'ostruct'
  #
  #    person = OpenStruct.new
  #    person.name = 'John Smith'
  #    person.age  = 70
  #
  #    person.marshal_dump # => { :name => 'John Smith', :age => 70 }
  #
  def marshal_dump
    @table
  end

  #
  # Provides marshalling support for use by the Marshal library. Accepting
  # a Hash of keys and values which will be used to populate the internal table
  #
  #    require 'ostruct'
  #
  #    event = OpenStruct.new
  #    hash = { 'time' => Time.now, 'title' => 'Birthday Party' }
  #    event.marshal_load(hash)
  #    event.title # => 'Birthday Party'
  #
  def marshal_load(x)
    @table = x
    @table.each_key{|key| new_ostruct_member(key)}
  end

  #
  # #modifiable is used internally to check if the OpenStruct is able to be
  # modified before granting access to the internal Hash table to be augmented.
  #
  def modifiable
    begin
      @modifiable = true
    rescue
      raise TypeError, "can't modify frozen #{self.class}", caller(3)
    end
    @table
  end
  protected :modifiable

  #
  # new_ostruct_member is used internally to defined properties on the
  # OpenStruct. It does this by using the metaprogramming function
  # define_method for both the getter method and the setter method.
  #
  def new_ostruct_member(name)
    name = name.to_sym
    unless self.respond_to?(name)
      class << self; self; end.class_eval do
        define_method(name) { @table[name] }
        define_method("#{name}=") { |x| modifiable[name] = x }
      end
    end
    name
  end

  def method_missing(mid, *args) # :nodoc:
    mname = mid.id2name
    len = args.length
    if mname.chomp!('=') && mid != :[]=
      if len != 1
        raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1)
      end
      modifiable[new_ostruct_member(mname)] = args[0]
    elsif len == 0 && mid != :[]
      @table[mid]
    else
      raise NoMethodError, "undefined method `#{mid}' for #{self}", caller(1)
    end
  end

  #
  # Remove the named field from the object. Returning the value that the field
  # contained if it has defined.
  #
  #   require 'ostruct'
  #
  #   person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
  #
  #   person.delete_field('name')  # => 'John Smith'
  #
  def delete_field(name)
    sym = name.to_sym
    @table.delete sym
    singleton_class.__send__(:remove_method, sym, "#{name}=")
  end

  InspectKey = :__inspect_key__ # :nodoc:

  #
  # Returns a string containing a detailed summary of the keys and values.
  #
  def inspect
    str = "#<#{self.class}"

    ids = (Thread.current[InspectKey] ||= [])
    if ids.include?(object_id)
      return str << ' ...>'
    end

    ids << object_id
    begin
      first = true
      for k,v in @table
        str << "," unless first
        first = false
        str << " #{k}=#{v.inspect}"
      end
      return str << '>'
    ensure
      ids.pop
    end
  end
  alias :to_s :inspect

  attr_reader :table # :nodoc:
  protected :table

  #
  # Compares this object and +other+ for equality.  An OpenStruct is equal to
  # +other+ when +other+ is an OpenStruct and the two object's Hash tables are
  # equal.
  #
  def ==(other)
    return false unless(other.kind_of?(OpenStruct))
    return @table == other.table
  end
end


text:
<!doctype html>

    <meta charset="utf-8">
    <link rel="icon" type="image/png" href="/icon16.png">
    <link rel="stylesheet" href="ar_main.css">
    <link rel="stylesheet" href="ar_dialog.css">
    <link rel="stylesheet" href="connection_stats.css">
    <link rel="stylesheet" href="context_menu.css">
    <link rel="stylesheet" href="main.css">
    <link rel="stylesheet" href="menu_button.css">
    <link rel="stylesheet" href="open_sans.css">

    <meta-include type="javascript"/>

    <link rel="import" href="/arv_main.html">

    <title i18n-content="PRODUCT_NAME_APP_STREAMING"></title>

      <meta-include src="webapp/base/html/client_plugin.html"/>

    <meta-include src="webapp/app_remoting/html/context_menu.html"/>
    <meta-include src="webapp/app_remoting/html/idle_dialog.html"/>
    <meta-include src="webapp/base/html/connection_dropped_dialog.html"/>


text:
<!doctype html>

  <title>npm-config</title>
  <meta http-equiv="content-type" value="text/html;utf-8">
  <link rel="stylesheet" type="text/css" href="../../static/style.css">
  <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-config.html">

npm-config

Manage the npm configuration files

SYNOPSIS

npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]

DESCRIPTION

npm gets its config settings from the command line, environment
variables, npmrc files, and in some cases, the package.json file.

See npmrc(5) for more information about the npmrc files.

See npm-config(7) for a more thorough discussion of the mechanisms
involved.

The npm config command can be used to update and edit the contents
of the user and global npmrc files.

Sub-commands

Config supports the following sub-commands:

set

npm config set key value

Sets the config key to the value.

If value is omitted, then it sets it to "true".

get

npm config get key

Echo the config value to stdout.

list

npm config list

Show all the config settings.

delete

npm config delete key

Deletes the key from all configuration files.

edit

npm config edit

Opens the config file in an editor.  Use the --global flag to edit the
global config.

SEE ALSO

npm-folders(5)

npm-config(7)

package.json(5)

npmrc(5)

npm(1)

npm-config — npm@3.7.2


text:
<!DOCTYPE html>

	<title>403 Forbidden</title>

Directory access is forbidden.


text:
package whisk.core.dispatcher

import scala.concurrent.Future
import whisk.common.TransactionId
import whisk.core.connector.{ ActivationMessage => Message }

/**
 * Abstract base class for a handler for a connector (e.g., Kafka) message.
 */
abstract class MessageHandler(val name: String) {

    /**
     * Runs handler for a Kafka message. This method is run inside a future.
     * If the method fails with an exception, the exception completes
     * the wrapping future within which the method is run.
     *
     * @param msg the Message object to process
     * @param transid the transaction id for the Kafka message
     * @return Future that executes the handler
     */
    def onMessage(msg: Message)(implicit transid: TransactionId): Future[Any]
}


text:
const { DataTypes, Model } = require('sequelize');
const Joi = require('joi');
const { ConnectionInformationSchema } = require('./connection-information');
const { AssociationChangesSchema } = require('./association-changes');

/**
 * This class represents a special account (e.g.: admin).
 */
class SpecialAccount extends Model {
  /**
   * Initialization function.
   *
   * @param sequelize
   * @returns {Model}
   */
  static init(sequelize) {
    return super.init({
      id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
      },

      code: {
        type: DataTypes.STRING,
        allowNull: false,
      },

      description: {
        type: DataTypes.TEXT,
      },
    }, {
      sequelize,
    });
  }

  /**
   * Set associations for the model.
   *
   * @param models
   */
  static associate({ ConnectionInformation, Permission }) {
    this.belongsTo(ConnectionInformation, { as: 'connection' });

    this.belongsToMany(Permission, { through: 'SpecialAccountPermissions', as: 'permissions' });
  }
}

const SpecialAccountSchema = Joi.object({
  id: Joi.number().integer(),
  code: Joi.string().regex(/^[0-9]{4,}$/),
  description: Joi.string(),
  connection: ConnectionInformationSchema,

  _embedded: Joi.object({
    permissions: AssociationChangesSchema,
  }),
});

module.exports = {
  SpecialAccount,
  SpecialAccountSchema,
};


text:
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import todo from './reducers';
import App from './components/App';

let store = createStore(todo);

ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('app')
);


text:
package org.pac4j.saml.metadata;

import org.junit.Test;
import org.pac4j.saml.config.SAML2Configuration;
import org.pac4j.saml.util.ConfigurationManager;
import org.pac4j.saml.util.DefaultConfigurationManager;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;

import static org.junit.Assert.*;

/**
 * This is {@link SAML2FileSystemMetadataGeneratorTests}.
 *
 * @author Misagh Moayyed
 */
public class SAML2FileSystemMetadataGeneratorTests {
    @Test
    public void verifyGeneration() throws Exception {
        final ConfigurationManager mgr = new DefaultConfigurationManager();
        mgr.configure();

        final var configuration = new SAML2Configuration();
        configuration.setForceKeystoreGeneration(true);
        configuration.setKeystorePath("target/keystore.jks");
        configuration.setKeystorePassword("pac4j");
        configuration.setPrivateKeyPassword("pac4j");
        configuration.setSignMetadata(true);
        configuration.setServiceProviderMetadataResource(new FileSystemResource("target/out.xml"));
        configuration.setIdentityProviderMetadataResource(new ClassPathResource("idp-metadata.xml"));
        configuration.init();

        var metadataGenerator = new SAML2FileSystemMetadataGenerator(configuration.getServiceProviderMetadataResource());
        final var entity = metadataGenerator.buildEntityDescriptor();
        assertNotNull(entity);
        final var metadata = metadataGenerator.getMetadata(entity);
        assertNotNull(metadata);

        metadataGenerator.storeMetadata(metadata, true);
        assertNotNull(metadataGenerator.buildMetadataResolver());
    }

}


text:
(function (enyo, scope) {

	var kind = enyo.kind;

	var ProxyObject = enyo.ProxyObject,
		Component = enyo.Component,
		ComputedSupport = enyo.ComputedSupport,
		EventEmitter = enyo.EventEmitter,
		oObject = enyo.Object;

	/**
	* Only necessary because of the order in which mixins are applied.
	*
	* @class
	* @private
	*/
	var BaseModelController = kind({
		kind: Component,
		mixins: [ComputedSupport, EventEmitter, ProxyObject]
	});

	/**
	* A controller designed to proxy an underlying {@link enyo.Model}. Other
	* [kinds]{@glossary kind} may [bind]{@link enyo.BindingSupport.bindings} to this
	* controller as if it were an `enyo.Model`. Using the
	* [model]{@link enyo.ModelController#model} reserved property, the actual model
	* may be changed without the bindings' needing to know. It will also propagate
	* events [emitted]{@link enyo.EventEmitter.emit} by the underlying model.
	*
	* It is important to note that `"model"` is a reserved property name. Also
	* note that bindings should **never** bind through the controller to the model
	* directly.
	*
	* **Rules of property resolution**
	*
	* If the controller can call [hasOwnProperty()]{@glossary Object.hasOwnProperty}
	* and it returns `true`, it will look locally; if the property is resolved to
	* be a computed property, the requested property will be proxied from the given
	* model, when available.
	*
	* @class enyo.ModelController
	* @extends enyo.Component
	* @mixes enyo.ComputedSupport
	* @mixes enyo.EventEmitter
	* @mixes enyo.ProxyObject
	* @public
	*/
	kind(
		/** @lends enyo.ModelController.prototype */ {

		/**
		* @private
		*/
		name: 'enyo.ModelController',

		/**
		* @private
		*/
		kind: BaseModelController,

		/**
		* The {@link enyo.Model} to proxy. If this is set to an instance of `enyo.Model`,
		* the [controller]{@link enyo.ModelController} will propagate `enyo.Model`
		* [events]{@glossary event} and [notifications]{@link enyo.ObserverSupport.notify}.
		* **No bindings should ever bind directly to attributes of this property.**
		*
		* Also note that this is a reserved property name and will collide with any
		* [attribute]{@link enyo.Model#attributes} named `"model"`. This scenario should
		* be avoided.
		*
		* @type enyo.Model
		* @default null
		* @public
		*/
		model: null,

		/**
		* @private
		*/
		proxyObjectKey: 'model',

		/**
		* @method
		* @private
		*/
		get: enyo.inherit(function (sup) {
			return function (path) {

				if (this.hasOwnProperty(path) || this.isComputed(path)) {
					return this._getComputed(path);
				}

				return sup.apply(this, arguments);
			};
		}),

		/**
		* @method
		* @private
		*/
		set: enyo.inherit(function (sup) {
			return function (path) {

				if (typeof path == 'string') {
					if (this.hasOwnProperty(path)) {
						return this.isComputed(path) ? this : enyo.setPath.apply(this, arguments);
					}
				}

				return sup.apply(this, arguments);
			};
		}),

		/**
		* @method
		* @private
		*/
		_getComputed: ComputedSupport.get.fn(oObject.prototype.get),

		/**
		* @type enyo.ObserverSupport~Observer
		* @private
		*/
		modelChanged: function (was, is, path) {
			// unregister previous model if any
			if (was) was.off('*', this._modelEvent, this);
			// register for events on new model if any
			if (is) is.on('*', this._modelEvent, this);

			// either way we need to update any observers that might be related
			// to the model
			var props = this.modelObservedProperties();
			for (var key in props) {
				if ((!was && is) || (was && !is) || (was && is && was.attributes[key] !== is.attributes[key])) {
					this.notify(key, was && was.get(key), is && is.get(key));
				}
			}

			this.emit('model', {was: was, is: is});
		},

		/**
		* @method
		* @private
		*/
		_modelEvent: function (model, e, props) {
			// re-emit the event as expected with the only change being the originator (first param)
			// will be this controller but all listeners should expect to use the third parameter as
			// is the convention for model listeners
			this.emit(e, props, model);

			switch (e) {
			case 'change':
				if (props) for (var key in props) this.notify(key, model.previous[key], props[key]);
				break;
			case 'destroy':
				this.set('model', null);
				break;
			}
		},

		/**
		* @method
		* @private
		*/
		modelObservedProperties: function () {
			return this._observedProps || (this._observedProps = {});
		},

		/**
		* @method
		* @private
		*/
		observe: enyo.inherit(function (sup) {
			return function (path) {
				var part = path
					, parts;

				if (path.indexOf('.') > -1) {
					parts = path.split('.');
					part = parts.shift();
				}

				if (!this.hasOwnProperty(part) && !this.isComputed(part)) this.modelObservedProperties()[path] = null;
				return sup.apply(this, arguments);
			};
		}),

		/**
		* @private
		*/
		addObserver: function () {
			return this.observe.apply(this, arguments);
		},

		/**
		* @private
		*/
		constructor: enyo.inherit(function (sup) {
			return function (props) {
				// ensure we have our own model property
				this.model = null;

				// adhere to normal approach to constructor properties hash
				props && enyo.mixin(this, props);
				sup.apply(this, arguments);
			};
		}),

		/**
		* @method
		* @private
		*/
		destroy: enyo.inherit(function (sup) {
			return function () {
				sup.apply(this, arguments);
				this.model && this.model.off('*', this._modelEvent, this);
			};
		})

	});

})(enyo, this);


text:
#ifndef REALM_UTIL_BASE64_HPP
#define REALM_UTIL_BASE64_HPP

#include <vector>
#include <realm/string_data.hpp>
#include <realm/util/optional.hpp>

namespace realm {
namespace util {

/// base64_encode() encodes the bnary data in \param in_buffer of size \param in_buffer_size .
/// The encoded data is placed in \param out_buffer . The size of \param \out_buffer is passed in
/// \param out_buffer_size . The output buffer out_buffer must be
/// large enough to hold the base64 encoded data. The size can be obtained from the function
/// base64_encoded_size. out_buffer_size is only used to assert that the output buffer is
/// large enough.
size_t base64_encode(const char *in_buffer, size_t in_buffer_size, char* out_buffer, size_t out_buffer_size) noexcept;

/// base64_encoded_size() returns the exact size of the base64 encoded
/// data as a function of the size of the input data.
inline size_t base64_encoded_size(size_t in_buffer_size) noexcept
{
    return 4 * ((in_buffer_size + 2) / 3);
}

/// Decode base64-encoded string in input, and places the result in out_buffer.
/// The length of the out_buffer must be at least 3 * input.size() / 4.
///
/// The input must be padded base64 (i.e. the number of non-whitespace
/// characters in the input must be a multiple of 4). Whitespace (spaces, tabs,
/// newlines) is ignored.
///
/// The algorithm stops when the first character not in the base64 character
/// set is encountered, or when the end of the input is reached.
///
/// \returns the number of successfully decoded bytes written to out_buffer, or
/// none if the whole input was not valid base64.
Optional<size_t> base64_decode(StringData input, char* out_buffer, size_t out_buffer_len) noexcept;

/// Return an upper bound on the decoded size of a Base64-encoded data
/// stream of length \a base64_size. The returned value is suitable for
/// allocation of buffers containing decoded data.
inline size_t base64_decoded_size(size_t base64_size) noexcept
{
    return (base64_size * 3 + 3) / 4;
}

/// base64_decode_to_vector() is a convenience function that decodes \param
/// encoded and returns the result in a std::vector<char> with the correct size.
/// This function returns none if the input is invalid.
Optional<std::vector<char>> base64_decode_to_vector(StringData encoded);

} // namespace util
} // namespace realm

#endif // REALM_UTIL_BASE64_HPP


text:
//Rip off vtkLineAnnotation

#ifndef __vtkBoneRepresentation_h
#define __vtkBoneRepresentation_h

#include "vtkLineRepresentation.h"
#include "vtkBoneWidgetHeader.h"

class vtkPointHandleRepresentation3D;

class VTK_BONEWIDGETS_EXPORT vtkBoneRepresentation : public vtkLineRepresentation
{
public:
  // Description:
  // Instantiate the class.
  static vtkBoneRepresentation *New();

  // Description:
  // Standard methods for the class.
  vtkTypeMacro(vtkBoneRepresentation,vtkWidgetRepresentation);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Methods to Set/Get the coordinates of the two points defining
  // this representation. Note that methods are available for both
  // display and world coordinates.
  void GetHeadWorldPosition(double pos[3]);
  double* GetHeadWorldPosition();
  void GetHeadDisplayPosition(double pos[3]);
  double* GetHeadDisplayPosition();
  virtual void SetHeadWorldPosition(double pos[3]);
  virtual void SetHeadDisplayPosition(double pos[3]);
  void GetTailDisplayPosition(double pos[3]);
  double* GetTailDisplayPosition();
  void GetTailWorldPosition(double pos[3]);
  double* GetTailWorldPosition();
  virtual void SetTailWorldPosition(double pos[3]);
  virtual void SetTailDisplayPosition(double pos[3]);

  vtkPointHandleRepresentation3D* GetHeadRepresentation();
  vtkPointHandleRepresentation3D* GetTailRepresentation();

  virtual void Highlight(int highlight)
    {
    this->HighlightLine(highlight);
    this->HighlightPoint(0, highlight);
    this->HighlightPoint(1, highlight);
    }

protected:
  vtkBoneRepresentation();
  ~vtkBoneRepresentation();

private:
  vtkBoneRepresentation(const vtkBoneRepresentation&);  //Not implemented
  void operator=(const vtkBoneRepresentation&);  //Not implemented
};

#endif


text:
FOUNDATION_EXPORT double Pods_RoadTripPlannerUITestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_RoadTripPlannerUITestsVersionString[];


text:
require 'sinatra/base'
require 'sinatra_more'
require 'haml'

class MarkupDemo < Sinatra::Base
  register SinatraMore::MarkupPlugin

  configure do
    set :root, File.dirname(__FILE__)
  end

  get '/:engine/:file' do
    show(params[:engine], params[:file].to_sym)
  end

  helpers do
    # show :erb, :index
    # show :haml, :index
    def show(kind, template)
      send kind.to_sym, template.to_sym
    end

    def captured_content(&block)
      content_html = capture_html(&block)
      "
#{content_html}
"
    end

    def concat_in_p(content_html)
      concat_content "
#{content_html}
"
    end

    def ruby_not_template_block
      determine_block_is_template('ruby') do
        content_tag(:span, "This not a template block")
      end
    end

    def determine_block_is_template(name, &block)
      concat_content "
The #{name} block passed in is a template
" if block_is_template?(block)
    end
  end
end

class MarkupUser
  def errors; Errors.new; end
  def session_id; 45; end
  def gender; 'male'; end
  def remember_me; '1'; end
  def permission; Permission.new; end
end

class Permission
  def can_edit; true; end
  def can_delete; false; end
end

class Errors < Array
  def initialize; self << [:fake, :second, :third]; end
  def full_messages
    ["This is a fake error", "This is a second fake error", "This is a third fake error"]
  end
end

module Outer
  class UserAccount; end
end


text:
import Ember from 'ember';
import { extent as d3Extent } from 'd3-array';

const { Helper: { helper } } = Ember;

export function extent([array, accessor]) {
  if (accessor) {
    return d3Extent(array, accessor);
  }
  return d3Extent(array);
}

export default helper(extent);


text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Classes/SNSTopicUnmarshaller.html">

		<Token>
			<TokenIdentifier>//apple_ref/occ/cl/SNSTopicUnmarshaller</TokenIdentifier>
			<Abstract type="html">Topic Unmarshaller</Abstract>
			<DeclaredIn>SNSTopicUnmarshaller.h</DeclaredIn>

			<NodeRef refid="1252"/>
		</Token>

	</File>
</Tokens>


text:
package net.minecraft.util;

public interface IObjectIntIterable<T> extends Iterable<T>
{
}


text:
/* include/config.h.  Generated by configure.  */
/************************************************************************
 *
 * Nagios Config Header File
 * Written By: Ethan Galstad (egalstad@nagios.org)
 * Last Modified: 11-02-2008
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 ************************************************************************/

/***** NAGIOS STUFF *****/

#define DEFAULT_NAGIOS_USER "nagios"
#define DEFAULT_NAGIOS_GROUP "nagios"

/* stop gcc from bitching about implicit asprintf declarations */
#define _GNU_SOURCE 1

/* Event broker integration */
#define USE_EVENT_BROKER 1

/* Embed a PERL interpreter into Nagios with optional cache for compiled code (contributed by Stephen Davies) */
/* #undef EMBEDDEDPERL */
/* #undef THREADEDPERL */
/* 0 = cache, 1 = do not cache */
#define DO_CLEAN "1"

/* commands used by CGIs */
#define TRACEROUTE_COMMAND "/usr/bin/traceroute"
/* #undef PING_COMMAND */
/* #undef PING_PACKETS_FIRST */

/* Debugging options */
/* function entry and exit */
/* #undef DEBUG0 */
/* general info messages */
/* #undef DEBUG1 */
/* warning messages */
/* #undef DEBUG2 */
/* service and host checks, other events */
/* #undef DEBUG3 */
/* service and host notifications */
/* #undef DEBUG4 */
/* SQL queries (defunct) */
/* #undef DEBUG5 */

/* I/O implementations */
#define USE_XSDDEFAULT 1
#define USE_XCDDEFAULT 1
#define USE_XRDDEFAULT 1
#define USE_XODTEMPLATE 1
#define USE_XPDDEFAULT 1
#define USE_XDDDEFAULT 1

/***** FUNCTION DEFINITIONS *****/

#define HAVE_SETENV 1
#define HAVE_UNSETENV 1
/* #undef HAVE_SOCKET */
#define HAVE_STRDUP 1
#define HAVE_STRSTR 1
#define HAVE_STRTOUL 1
#define HAVE_INITGROUPS 1
/* #undef HAVE_GETLOADAVG */
#define HAVE_GDIMAGECREATETRUECOLOR 1

/***** ASPRINTF() AND FRIENDS *****/

/* #undef HAVE_VSNPRINTF */
/* #undef HAVE_SNPRINTF */
/* #undef HAVE_ASPRINTF */
/* #undef HAVE_VASPRINTF */
#define HAVE_C99_VSNPRINTF 1
#define HAVE_VA_COPY 1
/* #undef HAVE___VA_COPY */

/***** MISC DEFINITIONS *****/

#define USE_NANOSLEEP 1
#define STDC_HEADERS 1
#define HAVE_TM_ZONE 1
/* #undef HAVE_TZNAME */
/* #undef USE_PROC */
#define SOCKET_SIZE_TYPE size_t
#define GETGROUPS_T gid_t
#define RETSIGTYPE void

/***** HEADER FILES *****/

#include <stdio.h>
#include <stdlib.h>

/* needed for the time_t structures we use later... */
/* this include must come before sys/resource.h or we can have problems on some OSes */
#define TIME_WITH_SYS_TIME 1
#define HAVE_SYS_TIME_H 1
#if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif

#define HAVE_SYS_RESOURCE_H 1
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif

#define HAVE_LIMITS_H 1
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif

#define HAVE_PWD_H 1
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif

#define HAVE_GRP_H 1
#ifdef HAVE_GRP_H
#include <grp.h>
#endif

#define HAVE_STRINGS_H 1
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif

#define HAVE_STRING_H 1
#ifdef HAVE_STRINGS_H
#include <string.h>
#endif

#define HAVE_UNISTD_H 1
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#define HAVE_SYSLOG_H 1
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif

#define HAVE_SIGNAL_H 1
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif

#define HAVE_SYS_STAT_H 1
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif

#define HAVE_SYS_MMAN_H 1
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif

#define HAVE_FCNTL_H 1
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

#define HAVE_STDARG_H 1
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif

#define HAVE_SYS_TYPES_H 1
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#define HAVE_SYS_WAIT_H 1
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif

#define HAVE_ERRNO_H 1
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif

#define HAVE_SYS_TIMEB_H 1
#if HAVE_SYS_TIMEB_H
#include <sys/timeb.h>
#endif

#define HAVE_SYS_IPC_H 1
#ifdef HAVE_SYS_IPC_H
#include <sys/ipc.h>
#endif

#define HAVE_SYS_MSG_H 1
#ifdef HAVE_SYS_MSG_H
#include <sys/msg.h>
#endif

#define HAVE_MATH_H 1
#ifdef HAVE_MATH_H
#include <math.h>
#endif

#define HAVE_CTYPE_H 1
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif

#define HAVE_DIRENT_H 1
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif

#define HAVE_PTHREAD_H 1
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif

#define HAVE_REGEX_H 1
#ifdef HAVE_REGEX_H
#include <regex.h>

#define HAVE_SYS_SOCKET_H 1
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif

/* #undef HAVE_SOCKET */
#ifdef HAVE_SOCKET_H
#include <socket.h>
#endif

#define HAVE_NETINET_IN_H 1
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

#define HAVE_ARPA_INET_H 1
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

#define HAVE_NETDB_H 1
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

#define HAVE_LIBGEN_H 1
#ifdef HAVE_LIBGEN_H
#include <libgen.h>
#endif

#define HAVE_SYS_UN_H 1
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif

#define HAVE_SYS_POLL_H 1
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif

/* #define HAVE_GETOPT_H 1 */
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif

/* #undef HAVE_LINUX_MODULE_H */
#ifdef HAVE_LINUX_MODULE_H
#include <linux/module.h>
#endif

/* configure script should allow user to override ltdl choice, but this will do for now... */
/* #undef USE_LTDL */

#ifdef HAVE_LTDL_H
#define USE_LTDL
#endif

#ifdef USE_LTDL
#include <ltdl.h>
#else
/* #undef HAVE_DLFCN_H */
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#endif

/* moved to end to prevent AIX compiler warnings */
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif

#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif

/***** MARO DEFINITIONS *****/

/* this needs to come after all system include files, so we don't accidentally attempt to redefine it */
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif

#endif


text:
<!DOCTYPE html>

<title>CalendarManager_getDefaultCalendar_CalendarTask</title>
<meta charset="utf-8">


text:
<?php

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts;

use Illuminate\Contracts\Database\Eloquent\CastsAttributes;

class CustomCasterWithDocblockReturn implements CastsAttributes
{
    /**
     * @inheritDoc
     * @return CastedProperty
     */
    public function get($model, string $key, $value, array $attributes)
    {
        return new CastedProperty();
    }

    /**
     * @inheritDoc
     */
    public function set($model, string $key, $value, array $attributes)
    {
        // TODO: Implement set() method.
    }
}


text:
console.error("Running hook to add iOS Keychain Sharing entitlements");

var xcode = require('xcode'),
    fs = require('fs'),
    path = require('path'),
    plist = require('plist'),
    util = require('util');

module.exports = function (context) {
  var Q = context.requireCordovaModule('q');
  var deferral = new Q.defer();

  if (context.opts.cordova.platforms.indexOf('ios') < 0) {
    throw new Error('This plugin expects the ios platform to exist.');
  }

  var iosPlatform = path.join(context.opts.projectRoot, 'platforms/ios/');
  var iosFolder = fs.existsSync(iosPlatform) ? iosPlatform : context.opts.projectRoot;
  console.log("iosFolder: " + iosFolder);

  fs.readdir(iosFolder, function (err, data) {
    if (err) {
      throw err;
    }

    var projFolder;
    var projName;

    // Find the project folder by looking for *.xcodeproj
    if (data && data.length) {
      data.forEach(function (folder) {
        if (folder.match(/\.xcodeproj$/)) {
          projFolder = path.join(iosFolder, folder);
          projName = path.basename(folder, '.xcodeproj');
        }
      });
    }

    if (!projFolder || !projName) {
      throw new Error("Could not find an .xcodeproj folder in: " + iosFolder);
    }

    var destFile = path.join(iosFolder, projName, 'Resources', projName + '.entitlements');
    if (fs.existsSync(destFile)) {
      console.error("File exists, not doing anything: " + destFile);
    } else {
      console.log("Will add iOS Keychain Sharing entitlements to project '" + projName + "'");

      //var projectPlistPath = path.join(context.opts.projectRoot, 'platforms/ios', projName, util.format('%s-Info.plist', projName));
      var projectPlistPath = path.join(iosFolder, projName, util.format('%s-Info.plist', projName));
      var projectPlistJson = plist.parse(fs.readFileSync(projectPlistPath, 'utf8'));
      var sharedBundleID = projectPlistJson.KeychainSharingBundleID;
      console.log("KeychainSharingBundleID passed in as variable: " + sharedBundleID);

      // create a new entitlements plist file
      //var sourceFile = 'plugins/cordova-plugin-keychainsharing/src/ios/resources/KeychainSharing.entitlements';
      var sourceFile = path.join(context.opts.plugin.pluginInfo.dir, 'src/ios/resources/KeychainSharing.entitlements');
      fs.readFile(sourceFile, 'utf8', function (err, data) {
        data = data.replace(/__KEYCHAIN_ACCESS_GROUP__/g, sharedBundleID);

        fs.writeFileSync(destFile, data);

        var projectPath = path.join(projFolder, 'project.pbxproj');

        var pbxProject;
        if (context.opts.cordova.project) {
          pbxProject = context.opts.cordova.project.parseProjectFile(context.opts.projectRoot).xcode;
        } else {
          pbxProject = xcode.project(projectPath);
          pbxProject.parseSync();
        }

        pbxProject.addResourceFile(projName + ".entitlements");

        var configGroups = pbxProject.hash.project.objects['XCBuildConfiguration'];
        for (var key in configGroups) {
          var config = configGroups[key];
          if (config.buildSettings !== undefined) {
            config.buildSettings.CODE_SIGN_ENTITLEMENTS = '"' + projName + '/Resources/' + projName + '.entitlements"';
            //console.log("Adding iOS Keychain Sharing entitlements to project '" + projName + "'");
          }
        }

        // write the updated project file
        fs.writeFileSync(projectPath, pbxProject.writeSync());
        console.warn("OK, added iOS Keychain Sharing entitlements to project '" + projName + "'");

        deferral.resolve();
      });
    }
  });

  return deferral.promise;
};


text:
import {Component} from '@angular/core';
import {MD_GRID_LIST_DIRECTIVES} from '@angular2-material/grid-list/grid-list';
import {MdButton} from '@angular2-material/button/button';
import {MD_CARD_DIRECTIVES} from '@angular2-material/card/card';
import {MdIcon, MdIconRegistry} from '@angular2-material/icon/icon';

@Component({
  moduleId: module.id,
  selector: 'grid-list-demo',
  templateUrl: 'grid-list-demo.html',
  styleUrls: ['grid-list-demo.css'],
  directives: [MD_GRID_LIST_DIRECTIVES, MdButton, MD_CARD_DIRECTIVES, MdIcon],
  providers: [MdIconRegistry]
})
export class GridListDemo {
  tiles: any[] = [
    {text: 'One', cols: 3, rows: 1, color: 'lightblue'},
    {text: 'Two', cols: 1, rows: 2, color: 'lightgreen'},
    {text: 'Three', cols: 1, rows: 1, color: 'lightpink'},
    {text: 'Four', cols: 2, rows: 1, color: '#DDBDF1'},
  ];

  dogs: Object[] = [
    { name: 'Porter', human: 'Kara' },
    { name: 'Mal', human: 'Jeremy' },
    { name: 'Koby', human: 'Igor' },
    { name: 'Razzle', human: 'Ward' },
    { name: 'Molly', human: 'Rob' },
    { name: 'Husi', human: 'Matias' },
  ];

  fixedCols: number = 4;
  fixedRowHeight: number = 100;
  ratioGutter: number = 1;
  fitListHeight: string = '400px';
  ratio: string = '4:1';

  addTileCols() { this.tiles[2].cols++; }
}


text:
package herd

import (
	"fmt"
)

func (status subStatus) string() string {
	switch status {
	case statusUnknown:
		return "unknown"
	case statusConnecting:
		return "connecting"
	case statusDNSError:
		return "DNS error"
	case statusConnectionRefused:
		return "connection refused"
	case statusNoRouteToHost:
		return "no route to host"
	case statusConnectTimeout:
		return "connect timeout"
	case statusMissingCertificate:
		return "connect failed: missing certificate"
	case statusBadCertificate:
		return "connect failed: bad certificate"
	case statusFailedToConnect:
		return "connect failed"
	case statusWaitingToPoll:
		return "waiting to poll"
	case statusPolling:
		return "polling"
	case statusPollDenied:
		return "poll denied"
	case statusFailedToPoll:
		return "poll failed"
	case statusSubNotReady:
		return "sub not ready"
	case statusImageUndefined:
		return "image undefined"
	case statusImageNotReady:
		return "image not ready"
	case statusNotEnoughFreeSpace:
		return "insufficient space"
	case statusFetching:
		return "fetching"
	case statusFetchDenied:
		return "fetch denied"
	case statusFailedToFetch:
		return "fetch failed"
	case statusPushing:
		return "pushing"
	case statusPushDenied:
		return "push denied"
	case statusFailedToPush:
		return "failed to push"
	case statusFailedToGetObject:
		return "failed to get object"
	case statusComputingUpdate:
		return "computing update"
	case statusSendingUpdate:
		return "sending update"
	case statusMissingComputedFile:
		return "missing computed file"
	case statusUpdatesDisabled:
		return "updates disabled"
	case statusUnsafeUpdate:
		return "unsafe update"
	case statusUpdating:
		return "updating"
	case statusUpdateDenied:
		return "update denied"
	case statusFailedToUpdate:
		return "update failed"
	case statusWaitingForNextFullPoll:
		return "waiting for next full poll"
	case statusSynced:
		return "synced"
	default:
		panic(fmt.Sprintf("unknown status: %d", status))
	}
}

func (status subStatus) html() string {
	switch status {
	case statusUnsafeUpdate:
		return `<font color="red">` + status.String() + "</font>"
	default:
		return status.String()
	}
}


text:
import * as Rx from 'rxjs';

import { AppActionCreator } from '../../intent/action/AppActionCreator';
import { UIActionCreator } from '../../intent/action/UIActionCreator';

import { DomainState } from '../../domain/DomainState';

export class SidebarFooterView implements EventListenerObject {

    _appAction: AppActionCreator;
    _uiAction: UIActionCreator;

    _element: Element;
    _signinElement: HTMLElement;
    _signoutElement: HTMLElement;
    _connectElement: HTMLElement;
    _settingElement: HTMLElement;

    _lastSelectedElement: HTMLElement | void;

    _disposableSignIn: Rx.Subscription;
    _disposableSignout: Rx.Subscription;
    _disposableShowConnect: Rx.Subscription;
    _disposableShowSetting: Rx.Subscription;
    _disposableSelectChannel: Rx.Subscription;

    constructor(domain: DomainState, element: Element, appAction: AppActionCreator, uiAction: UIActionCreator) {
        this._appAction = appAction;
        this._uiAction = uiAction;
        this._element = element;
        this._signinElement = element.querySelector('.sign-in') as HTMLElement;
        this._signoutElement = element.querySelector('.sign-out') as HTMLElement;
        this._connectElement = element.querySelector('.connect') as HTMLElement;
        this._settingElement = element.querySelector('.settings') as HTMLElement;

        this._lastSelectedElement = undefined;

        this._disposableSignIn = uiAction.dispatcher().showSignIn.subscribe(() => {
            // tslint:disable-next-line:no-non-null-assertion
            this.selectElement(this._lastSelectedElement!, this._signinElement);
        });

        this._disposableSignout = this._appAction.dispatcher().signout.subscribe(() => {
            // tslint:disable-next-line:no-non-null-assertion
            this.selectElement(this._lastSelectedElement!, this._signoutElement);
        });

        this._disposableShowConnect = domain.getSelectedSetting().filter(function (id) {
            return (id === 'connect');
        }).subscribe(() => {
            // tslint:disable-next-line:no-non-null-assertion
            this.selectElement(this._lastSelectedElement!, this._connectElement);
        });

        this._disposableShowSetting = domain.getSelectedSetting().filter(function (id) {
            return (id === 'settings');
        }).subscribe(() => {
            // tslint:disable-next-line:no-non-null-assertion
            this.selectElement(this._lastSelectedElement!, this._settingElement);
        });

        this._disposableSelectChannel = domain.getSelectedChannel().subscribe(() => {
            // tslint:disable-next-line:no-non-null-assertion
            this.selectElement(this._lastSelectedElement!, undefined);
        });

        element.addEventListener('click', this);
    }

    destroy(): void {
        this._element.removeEventListener('click', this);

        this._disposableSignIn.unsubscribe();
        this._disposableSignout.unsubscribe();
        this._disposableShowConnect.unsubscribe();
        this._disposableShowSetting.unsubscribe();
        this._disposableSelectChannel.unsubscribe();
    }

    handleEvent(aEvent: Event): void {
        switch (aEvent.type) {
            case 'click':
                this.onClick(aEvent);
                break;
        }
    }

    onClick(aEvent: Event): void {
        const target = aEvent.target as Element;
        if (target.localName !== 'button') {
            return;
        }

        if (target === this._connectElement) {
            this._uiAction.showConnectSetting();
        }
        else if (target === this._settingElement) {
            this._uiAction.showGeneralSetting();
        }
        else if (target === this._signoutElement) {
            this._appAction.signout();
        }
        else if (target === this._signinElement) {
            this._uiAction.showSignIn();
        }
    }

    selectElement(last: HTMLElement, current: HTMLElement | void): void {
        if (last !== undefined) {
            this.deactivate(last);
        }

        if (current !== undefined) {
            this.activate(current);
        }

        this._lastSelectedElement = current;
    }

    deactivate(element: HTMLElement): void {
        element.classList.remove('active');
    }

    activate(element: HTMLElement): void {
        element.classList.add('active');
    }
}


text:
import copy

from flask import flash

from ..same import *
from app.models import User, Overview

from .forms import OverviewForm
from .custom import CustomValidator

now = "overview"
endpoint = '.overview_search'
start_thead = [
    [0, u'标题','title', False, False], [1, u'图形ID', 'graph_id', False, False],
    [2, u'操作', 'setting', True], [3, u'批量处理', 'batch', True]
]
check_field = ['title', 'graph_id']

@monitor.route('/monitor/overview/traffic',  methods=['GET'])
@login_required
@permission_validation(Permission.ADVANCED_QUERY)
def mon():
    sidebar = monitor_sidebar()
    task_info = ticket_status()
    result = Overview.query.all()
    site_info = [(item.title, [id for id in getattr(item,'graph_id').split(';') if id ])
            for item in result]
    return render_template('monitor/monitor.html', task_info=task_info, sidebar=sidebar,
                            site_info=site_info)

@monitor.route('/monitor/overview/search',  methods=['GET'])
@login_required
@permission_validation(Permission.ALTER)
def overview_search():
    task_info = ticket_status()
    sidebar = monitor_sidebar()
    thead = copy.deepcopy(start_thead)
    search_value = request.args.get('search', '')
    checkbox = request.args.getlist('hidden') or request.args.get('hiddens', '')

    if search_value:
        thead = init_checkbox(thead, checkbox)
        page = int(request.args.get('page', 1))
        result = search(Overview, 'title' , search_value)
        result = result.search_return()
        if result:
            pagination = result.paginate(page, 100, False)
            items = pagination.items
            return render_template(
                'monitor/overview_search.html', task_info=task_info, sidebar=sidebar,
                search_value=search_value, checkbox=str(checkbox),
                thead=thead, pagination=pagination, now=now,
                endpoint=endpoint, items=items
            )
    return render_template('monitor/overview_search.html',  task_info=task_info, sidebar=sidebar,
                           search_value=search_value, thead=thead)

@monitor.route('/monitor/overview/add',  methods=['GET', 'POST'])
@login_required
@permission_validation(Permission.ALTER)
def overview_add():
    overview_form = OverviewForm()
    task_info = ticket_status()
    sidebar = monitor_sidebar()

    if overview_form.validate_on_submit():
        overview = Overview(
            title=overview_form.title.data,
            graph_id=overview_form.graph_id.data,
        )
        add_sql = edit(overview, "overview", record=False)
        add_sql.run('add')
        flash(u'概览 *** %s *** 添加成功' % overview_form.title.data)
    else:
        for key in check_field:
            if overview_form.errors.get(key, None):
                flash(overview_form.errors[key][0])
                break

    return render_template('monitor/overview_add.html', task_info=task_info, sidebar=sidebar,
                            item_form=overview_form)

@monitor.route('/monitor/overview/delete',  methods=['POST'])
@login_required
@permission_validation(Permission.ALTER)
def overview_delete():
    del_id = int(request.form["id"])
    reason = request.form["reason"]
    overview = Overview.query.filter_by(id=del_id).first()

    if overview:
        delete_sql = edit(overview, "overview", reason, record=False)
        delete_sql.run('delete')
        return "OK"
    return u"删除失败 没有找到这个概览"

@monitor.route('/monitor/overview/change',  methods=['POST'])
@login_required
@permission_validation(Permission.ALTER)
def overview_change():
    change_id = int(request.form["id"])
    item = request.form["item"]
    value = request.form["value"]
    overview = Overview.query.filter_by(id=change_id).first()

    if overview:
        verify = CustomValidator(item, value)
        result = verify.validate_return()
        if result == "OK":
            change_sql = edit(overview, item, value, record=False)
            change_sql.run('change')
            return "OK"
        return result
    return u"更改失败没有找到这个概览"

# 批量删除
@monitor.route('/monitor/overview/batchdelete',  methods=['POST'])
@login_required
@permission_validation(Permission.ALTER)
def overview_batch_delete():
    list_id = eval(request.form["list_id"])
    reason = request.form["reason"]

    for id in list_id:
        overview = Overview.query.filter_by(id=id).first()
        if not overview:
            return u"删除失败没有这些概览"

    for id in list_id:
        overview = Overview.query.filter_by(id=id).first()
        delete_sql = edit(overview, "client", reason, record=False)
        delete_sql.run('delete')
    return "OK"

# 批量修改
@monitor.route('/monitor/overview/batchchange',  methods=['POST'])
@login_required
@permission_validation(Permission.ALTER)
def overview_batch_change():
    list_id = eval(request.form["list_id"])
    item = request.form["item"]
    value = request.form["value"]

    for id in list_id:
        overview = Overview.query.filter_by(id=id).first()
        if overview:
            verify = CustomValidator(item, value)
            result = verify.validate_return()
            if not result == "OK":
                return result
        else:
            return u"更改失败没有找到这些概览"

    for id in list_id:
        overview = Overview.query.filter_by(id=id).first()
        change_sql = edit(overview, item, value, record=False)
        change_sql.run('change')
    return "OK"


text:
import settings
import citizen

import praw

# Returns a dict of accessed submissions
def get_accessed_submissions():
    # Returns an empty dict until the DB works.
    return []

# Polls subreddit for new posts, matches against filters and processes
def process_new_posts():
    r = praw.Reddit(user_agent=settings.USER_AGENT)
    r.login(settings.USERNAME, settings.PASSWORD)

    submissions = r.get_subreddit(settings.TARGET_SUBREDDIT).get_new(limit=10)
    accessed_submissions = get_accessed_submissions()

    for submission in submissions:
        # Prevents repeated submission processing
        if submission.id in accessed_submissions:
            break

        # Convert submission.title into something we can query
        details = submission.title.lower().split()

        # Types of submission
        if 'c' in details[0]:
            if "remove" in details[1]:
                citizen.remove(details[2])
            elif "add" in details[1]:
                citizen.add(details[2])

        if 'l' in details[0]:
            if 'revoke' in details[1]:
                print "remove law", details[2]
            else:
                # They wish to create a new law!
                # Try to parse the string as the law title.
                print "create a new law:", submission.title[4:]

        # Prevent duplicates
        accessed_submissions.append(submission.id)

process_new_posts()


text:
ref_prefix=$1
sample=$2
poretools_dir=$3
sample_tag=$4
second_batch=$5
read_type=$6

tmp=`tempfile`
poretools fastq --type 2D ../data/$poretools_dir/pass > $tmp
poretools fasta --type 2D ../data/$poretools_dir/pass > "$tmp".fasta
if [ "$read_type" == "hq" ];
then
	poretools fastq --type 2D --high-quality ../data/$poretools_dir/fail >> $tmp
	poretools fasta --type 2D --high-quality ../data/$poretools_dir/fail >> "$tmp".fasta
elif [ "$read_type" == "pass" ]
then
	echo "nothing"
fi

if [ ! "$second_batch" == "na" ]
then
	poretools fastq --type 2D ../data/$second_batch/pass >> $tmp
	poretools fasta --type 2D ../data/$second_batch/pass >> "$tmp".fasta
	if [ "$read_type" == "hq" ];
	then
        	poretools fastq --type 2D --high-quality ../data/$second_batch/fail >> $tmp
        	poretools fasta --type 2D --high-quality ../data/$second_batch/fail >> "$tmp".fasta
	elif [ "$read_type" == "pass" ]
	then
        	echo "nothing"
	fi
fi
#head -20000 $tmp > $tmp.20000
#mv $tmp.20000 "$sample_tag".fasta
mv $tmp "$sample_tag".fastq
mv "$tmp".fasta "$sample_tag".fasta

if [ ! -e ../refs/"$ref_prefix".fasta.amb ]
then
    bwa index ../refs/"$ref_prefix".fasta
fi
#bwa mem -t 1 -x ont2d ../refs/"$ref_prefix".fasta "$sample_tag".fasta  | samtools view -bS - | samtools sort - "$ref_prefix"_"$sample_tag"_bwa.sorted
#coverageBed -abam "$ref_prefix"_"$sample_tag"_bwa.sorted.bam -b ../metadata/11_rx_v3.bed -d | groupBy -g 1,2,3,4 -c 6 -o mean > "$ref_prefix"_"$sample_tag".bedtools_11rx_bwa.txt
#coverageBed -abam "$ref_prefix"_"$sample_tag"_bwa.sorted.bam -b ../metadata/19_rx.bed -d | groupBy -g 1,2,3,4 -c 6 -o mean > "$ref_prefix"_"$sample_tag".bedtools_19rx_bwa.txt
#samtools index "$ref_prefix"_"$sample_tag"_bwa.sorted.bam

rm -rf jobTree_align_"$ref_prefix"_"$sample_tag"
marginAlign "$sample_tag".fastq ../refs/"$ref_prefix".fasta "$ref_prefix"_"$sample_tag".sam --jobTree jobTree_align_"$ref_prefix"_"$sample_tag" --inputModel ../models/input_10_04.hmm
align_trim.py < "$ref_prefix"_"$sample_tag".sam | samtools view -bS - | samtools sort - "$ref_prefix"_"$sample_tag"_marginalign.sorted
samtools index "$ref_prefix"_"$sample_tag"_marginalign.sorted.bam

rm "$sample_tag".fasta.fast5.fofn
nanopolish eventalign --reads "$sample_tag".fasta -b "$ref_prefix"_"$sample_tag"_marginalign.sorted.bam -g ../refs/"$ref_prefix".fasta --sam | samtools view -bS - | samtools sort - "$ref_prefix"_"$sample_tag"_np.sorted
samtools index "$ref_prefix"_"$sample_tag"_np.sorted.bam
nanopolish variants -m 0.2 --models-fofn offset_models.fofn --progress -t 1 --reads "$sample_tag".fasta -o np_"$ref_prefix"_"$sample_tag".m02.vcf -b "$ref_prefix"_"$sample_tag"_marginalign.sorted.bam -e "$ref_prefix"_"$sample_tag"_np.sorted.bam -g ../refs/"$ref_prefix".fasta -vv -w "EM_079517:0-20000" --snp
nanopolish variants -m 0.1 --models-fofn offset_models.fofn --progress -t 1 --reads "$sample_tag".fasta -o np_"$ref_prefix"_"$sample_tag".m02.vcf -b "$ref_prefix"_"$sample_tag"_marginalign.sorted.bam -e "$ref_prefix"_"$sample_tag"_np.sorted.bam -g ../refs/"$ref_prefix".fasta -vv -w "EM_079517:0-20000" --snp


text:
import chalk from 'chalk';
import * as inquirer from 'inquirer';
import {publishPackagesToNpm, WorkspaceRepo} from 'polymer-workspaces';
import {logRepoError} from './util';

export default async function run(reposToConvert: WorkspaceRepo[]) {
  console.log(
      chalk.dim('[1/3] ') + chalk.magenta(`Setting up publish to npm...`));

  const whoAmI = await reposToConvert[0].npm.whoami();
  console.log(`npm whoami: ${whoAmI}`);
  const {publishTag} = await inquirer.prompt([
    {
      type: 'input',
      name: 'publishTag',
      message: 'publish to npm tag:',
      default: 'next',
    },
  ]);

  console.log('');
  console.log('Ready to publish:');
  for (const repo of reposToConvert) {
    const packageInfo = await repo.npm.getPackageManifest();
    console.log(`  - ${chalk.cyan(publishTag)}: ${packageInfo.name}${
        chalk.dim('@')}${packageInfo.version}`);
  }
  console.log('');

  const {confirmPublish} = (await inquirer.prompt([{
    type: 'confirm',
    name: 'confirmPublish',
    message: 'start?',
    default: true,
  }]));

  if (!confirmPublish) {
    return;
  }

  console.log(chalk.dim('[2/3] ') + chalk.magenta(`Publishing to npm...`));
  const publishResults = await publishPackagesToNpm(reposToConvert, publishTag);
  publishResults.successes.forEach((_result, repo) => {
    console.log(`  - ${chalk.cyan(repo.dir)}: success!`);
  });
  publishResults.failures.forEach(logRepoError);

  console.log(chalk.dim('[3/3]') + ' 🎉  ' + chalk.magenta(`Publish Complete!`));
}


text:
Admin connect - invalid password
--SKIPIF--
<?php include('skip_enterprise.inc'); ?>
--FILE--
<?php
include dirname(__FILE__)."/../../astestframework/astest-phpt-loader.inc";
aerospike_phpt_runtest("AdminConnect", "testConnectInvalidPassword");
--EXPECTREGEX--
(ERR_INVALID_PASSWORD|ERR_CLIENT)


text:
package org.onosproject.isis.io.isispacket.tlv.subtlv;

import com.google.common.base.MoreObjects;
import com.google.common.primitives.Bytes;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.isis.io.isispacket.tlv.TlvHeader;
import org.onosproject.isis.io.util.IsisUtil;

/**
 * Representation of an administrative group.
 */
public class AdministrativeGroup extends TlvHeader implements TrafficEngineeringSubTlv {

    private int administrativeGroup;

    /**
     * Creates an administrative group instance.
     *
     * @param header Tlv Header instance
     */
    public AdministrativeGroup(TlvHeader header) {
        this.setTlvType(header.tlvType());
        this.setTlvLength(header.tlvLength());
    }

    /**
     * Returns administrative group value.
     *
     * @return administrative group value
     */
    public int administrativeGroup() {
        return administrativeGroup;
    }

    /**
     * Sets administrative group value.
     *
     * @param administrativeGroup value
     */
    public void setAdministrativeGroup(int administrativeGroup) {
        this.administrativeGroup = administrativeGroup;
    }

    /**
     * Returns administrative group value.
     *
     * @return administrativeGroup value
     */
    public int getAdministrativeGroupValue() {
        return this.administrativeGroup;
    }

    /**
     * Reads bytes from channel buffer.
     *
     * @param channelBuffer Channel buffer instance
     */
    public void readFrom(ChannelBuffer channelBuffer) {
        byte[] tempByteArray = new byte[tlvLength()];
        channelBuffer.readBytes(tempByteArray, 0, tlvLength());
        this.setAdministrativeGroup(IsisUtil.byteToInteger(tempByteArray));
    }

    /**
     * Returns administrative group as byte array.
     *
     * @return administrative group instance as byte array
     */
    public byte[] asBytes() {
        byte[] linkSubType = null;

        byte[] linkSubTlvHeader = tlvHeaderAsByteArray();
        byte[] linkSubTlvBody = tlvBodyAsBytes();
        linkSubType = Bytes.concat(linkSubTlvHeader, linkSubTlvBody);

        return linkSubType;
    }

    /**
     * Returns administrative group body as byte array.
     *
     * @return byte array of sub tlv administrative group
     */
    public byte[] tlvBodyAsBytes() {

        byte[] linkSubTypeBody;
        linkSubTypeBody = IsisUtil.convertToFourBytes(this.administrativeGroup);

        return linkSubTypeBody;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(getClass())
                .add("administrativeGroup", administrativeGroup)
                .toString();
    }
}


text:
<html>
    <body contenteditable='true'></body>
</html>


text:
Bucket::Bucket(char * owner)
{
	this->setOwner(owner);
	this->elementsCount = 0;
	this->containerSize = 1;
	this->container = new Egg[containerSize];
}

Bucket::Bucket()
{
	this->setOwner("");
	this->elementsCount = 0;
	this->containerSize = 1;
	this->container = new Egg[containerSize];
}

Bucket::~Bucket()
{
	delete[] this->container;
}

Bucket::Bucket(const Bucket & rhs)
{
	strcpy(this->owner, rhs.getOwner());
	this->containerSize = rhs.containerSize;
	this->elementsCount = rhs.elementsCount;

	this->container = new Egg[rhs.containerSize];
	memcpy(this->container, rhs.container, rhs.elementsCount * sizeof(Egg));
}

Bucket & Bucket::operator=(const Bucket & rhs)
{
	if (this != &rhs)
	{
		strcpy(this->owner, rhs.getOwner());
		this->containerSize = rhs.containerSize;

		this->container = new Egg[rhs.containerSize];
		memcpy(this->container, rhs.container, rhs.elementsCount * sizeof(Egg));
	}

	return *this;
}

void Bucket::addEgg(const Egg & egg)
{
	if (this->elementsCount == this->containerSize)
		addTwiceSpace(this->container);

	this->container[this->elementsCount] = egg;
	this->elementsCount++;
}

void Bucket::removeEgg(const char * name)
{
	for (size_t i = 0; i < this->elementsCount; i++)
	{
		if (strcmp(this->container[i].getName(), name) == 0)
		{
			//Shift left all remaining elements
			for (size_t j = i + 1; j < this->elementsCount; j++)
			{
				this->container[j - 1] = this->container[j];
			}

			this->elementsCount--;

			if (this->elementsCount * 2 < this->containerSize)
				removeHalfSpace(this->container);

			return;
		}
	}
}

void Bucket::print() const
{
	for (size_t i = 0; i < this->elementsCount; i++)
		this->container[i].print();
}

void Bucket::setOwner(char * owner)
{
	strcpy(this->owner, owner);
}

const char* Bucket::getOwner() const
{
	return this->owner;
}

const Egg * Bucket::getContainer() const
{
	return this->container;
}

int Bucket::getSize() const
{
	return this->containerSize;
}

int Bucket::getElementsCount() const
{
	return this->elementsCount;
}

void Bucket::removeHalfSpace(Egg * container)
{
	Egg* newContainer = new Egg[this->containerSize / 2];
	memcpy(newContainer, this->container, this->containerSize / 2 * sizeof(Egg));

	delete[] this->container;
	this->container = newContainer;
	this->containerSize /= 2;
}

void Bucket::addTwiceSpace(Egg * container)
{
	Egg* newContainer = new Egg[this->containerSize * 2];
	memcpy(newContainer, this->container, this->containerSize * sizeof(Egg));

	delete[] this->container;
	this->container = newContainer;
	this->containerSize *= 2;
}


text:
package nl.knaw.dans.dccd.rest.archival;

/**
 * Metadata not in the TRiDaS file but needed for the DCCD Archive
 * Note that TRiDaS already has all dendrochronological metadata and data
 *
 * Maybe it will be something like this:
 *
 * <?xml version="1.0" encoding="UTF-8"?>
 * <dccdmetadata>
 *  <state></state>
 *  <owner>
 *    <id></id>
 *  </owner>
 *  <permission>
 *   <defaultLevel></defaultLevel>
 *  </permission>
 *  <language></language>
 *  <values>
 *   <format></format>
 *  </values>
 * </dccdmetadata>
 *
 * Default values can be used right now,
 * But absolutely minimal for uploading is the values file format
 * and the language, because you need to specify them in the GUI as well.
 *
 * @author paulboon
 *
 */
public class DccdArchivalMetaData {
	private String valuesFormat;
	private String language; // main language used in TRiDaS and vocabulary

	public String getValuesFormat() {
		return valuesFormat;
	}

	public void setValuesFormat(String valuesFormat) {
		this.valuesFormat = valuesFormat;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <actions>
      <actionTypeCounts>
        <introducedInTheHouse>1</introducedInTheHouse>
        <introducedInHouse>1</introducedInHouse>
        <billReferrals>1</billReferrals>
      </actionTypeCounts>
      <actionByCounts>
        <houseOfRepresentatives>3</houseOfRepresentatives>
      </actionByCounts>
      <item>
        <sourceSystem>
          2
          <name>House floor actions</name>
        </sourceSystem>
        <actionCode>H11100</actionCode>
        <text>Referred to the House Committee on Energy and Commerce.</text>
        <links />
        <type>IntroReferral</type>
        <committee>
          <systemCode>hsif00</systemCode>
          <name>Energy and Commerce Committee</name>
        </committee>
        <actionDate>2017-10-10</actionDate>
      </item>
      <item>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <actionCode>Intro-H</actionCode>
        <text>Introduced in House</text>
        <links />
        <type>IntroReferral</type>
        <committee />
        <actionDate>2017-10-10</actionDate>
      </item>
      <item>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <actionCode>1000</actionCode>
        <text>Introduced in House</text>
        <links />
        <type>IntroReferral</type>
        <committee />
        <actionDate>2017-10-10</actionDate>
      </item>
    </actions>
    <updateDate>2017-10-13T14:30:13Z</updateDate>
    <latestAction>
      <actionDate>2017-10-10</actionDate>
      <text>Referred to the House Committee on Energy and Commerce.</text>
      <links />
    </latestAction>
    <notes />
    <summaries>
      <billSummaries />
    </summaries>
    <laws />
    <titles>
      <item>
        <titleType>Short Titles as Introduced</titleType>
        <title>Medicaid Reentry Act</title>
        <chamberCode />
        <parentTitleType />
        <chamberName />
      </item>
      <item>
        <titleType>Official Title as Introduced</titleType>
        <title>To amend title XIX of the Social Security Act to allow for medical assistance under Medicaid for inmates during the 30-day period preceding release from a public institution.</title>
        <chamberCode />
        <parentTitleType />
        <chamberName />
      </item>
      <item>
        <titleType>Display Title</titleType>
        <title>Medicaid Reentry Act</title>
        <chamberCode />
        <parentTitleType />
        <chamberName />
      </item>
      <item>
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <title>Medicaid Reentry Act</title>
        <chamberCode />
        <parentTitleType />
        <chamberName />
      </item>
    </titles>
    <committees>
      <billCommittees>
        <item>
          <chamber>House</chamber>
          <systemCode>hsif00</systemCode>
          <name>Energy and Commerce Committee</name>
          <subcommittees />
          <activities>
            <item>
              <date>2017-10-10T16:00:48Z</date>
              <name>Referred to</name>
            </item>
          </activities>
          <type>Standing</type>
        </item>
      </billCommittees>
    </committees>
    <recordedVotes />
    <createDate>2017-10-11T03:11:20Z</createDate>
    <cosponsors />
    <amendments />
    <committeeReports />
    <introducedDate>2017-10-10</introducedDate>
    <billType>HR</billType>
    <title>Medicaid Reentry Act</title>
    <subjects>
      <billSubjects>
        <legislativeSubjects />
      </billSubjects>
    </subjects>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mr. TONKO:H.R. 4005.Congress has the power to enact this legislation pursuantto the following:Article 1, Section 8, Clause 1:``The Congress shall have Power To lay and collect Taxes,Duties, Imposts and Excises, to pay the Debts and provide forthe common Defence and general Welfare of the United States''____________________[Page H7918]
]]></constitutionalAuthorityStatementText>
    <policyArea />
    <sponsors>
      <item>
        <firstName>Paul</firstName>
        <middleName />
        <bioguideId>T000469</bioguideId>
        <byRequestType />
        <lastName>Tonko</lastName>
        <state>NY</state>
        <fullName>Rep. Tonko, Paul [D-NY-20]</fullName>
        <identifiers>
          <bioguideId>T000469</bioguideId>
          <lisID>1942</lisID>
          <gpoId>8082</gpoId>
        </identifiers>
        <party>D</party>
        <district>20</district>
      </item>
    </sponsors>
    <billNumber>4005</billNumber>
    <originChamber>House</originChamber>
    <version>1.0.0</version>
    <cboCostEstimates />
    <congress>115</congress>
    <relatedBills />
    <calendarNumbers />
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
// ------------------------------------------------------------------------------
//                                                                              |
//   Copyright 2012 Mahi Fernando.                                              |
//                                                                              |
//   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.                                             |
//                                                                              |
// ------------------------------------------------------------------------------

using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;

namespace GaugesNet.Core
{
    /// <summary>
    /// Implements HTTP methods (GET,POST,PUT,DELETE) to communicate with the Gaug.es API.
    /// This class cannot be inherited.
    /// </summary>
    internal sealed class Curl
    {
        private HttpWebRequest _request = null;

        private void GetCredentials()
        {
            _request.Credentials = CredentialCache.DefaultCredentials;
            _request.Proxy.Credentials = CredentialCache.DefaultCredentials;
        }

        private string GetResponse(HttpWebRequest request)
        {
            StringBuilder output = new StringBuilder();
            using (StreamReader stream = new StreamReader(request.GetResponse().GetResponseStream()))
            {
                char[] c = null;

                while (!stream.EndOfStream)
                {
                    c = new char[100];
                    stream.ReadBlock(c, 0, c.Length);
                    output.Append(c);
                }
            }
            return output.ToString();
        }

        public string Get(string url, string token)
        {
            _request = (HttpWebRequest)WebRequest.Create(url);
            _request.Headers["X-Gauges-Token"] = token;
            _request.Method = "GET";
            GetCredentials();

            return GetResponse(_request);
        }

        public string Post(string url, string token, Dictionary<string, string> data)
        {
            StringBuilder putDataBulder = new StringBuilder();
            foreach (KeyValuePair<string, string> item in data)
            {
                putDataBulder.Append(item.Key + "=" + item.Value + "&");
            }

            byte[] putDataArray = Encoding.UTF8.GetBytes(putDataBulder.ToString().TrimEnd('&'));

            _request = (HttpWebRequest)WebRequest.Create(url);
            _request.Headers["X-Gauges-Token"] = token;
            _request.Method = "POST";
            _request.ContentType = "application/x-www-form-urlencoded";
            _request.ContentLength = putDataArray.Length;
            GetCredentials();

            using (Stream requestStream = _request.GetRequestStream())
            {
                requestStream.Write(putDataArray, 0, putDataArray.Length);
            }

            return GetResponse(_request);
        }

        public string Put(string url, string token, Dictionary<string,string> data)
        {
            StringBuilder putDataBulder = new StringBuilder();
            foreach (KeyValuePair<string,string> item in data)
            {
                putDataBulder.Append(item.Key + "=" + item.Value + "&");
            }

            byte[] putDataArray = Encoding.UTF8.GetBytes(putDataBulder.ToString().TrimEnd('&'));

            _request = (HttpWebRequest)WebRequest.Create(url);
            _request.Headers["X-Gauges-Token"] = token;
            _request.Method = "PUT";
            _request.ContentType = "application/x-www-form-urlencoded";
            _request.ContentLength = putDataArray.Length;
            GetCredentials();

            using (Stream requestStream = _request.GetRequestStream())
            {
                requestStream.Write(putDataArray, 0, putDataArray.Length);
            }

            return GetResponse(_request);
        }

        public string Delete(string url, string token)
        {
            _request = (HttpWebRequest)WebRequest.Create(url);
            _request.Headers["X-Gauges-Token"] = token;
            _request.Method = "DELETE";
            GetCredentials();

            return GetResponse(_request);
        }
    }
}