text:
package ec.breed;
import ec.*;
import ec.util.*;

/*
 * MultiBreedingPipeline.java
 *
 * Created: December 28, 1999
 * By: Sean Luke
 */

/**
 * MultiBreedingPipeline is a BreedingPipeline stores some n child sources;
 * each time it must produce an individual or two,
 * it picks one of these sources at random and has it do the production.

Typical Number of Individuals Produced Per <tt>produce(...)</tt> call

 If by base.<tt>generate-max</tt> is <tt>true</tt>, then always the maximum
 number of the typical numbers of any child source.  If <tt>false</itt>, then varies
 depending on the child source picked.

Number of Sources

 Dynamic.  As many as the user specifies.

Parameters

base.<tt>generate-max</tt>

  bool = <tt>true</tt> (default) or <tt>false</tt>
 (Each time produce(...) is called, should the MultiBreedingPipeline
 force all its sources to produce exactly the same number of individuals as the largest
 typical number of individuals produced by any source in the group?)

Default Base

 breed.multibreed

 *
 * @author Sean Luke
 * @version 1.0
 */

public class MultiBreedingPipeline extends BreedingPipeline
    {
    public static final String P_GEN_MAX = "generate-max";
    public static final String P_MULTIBREED = "multibreed";

    public int maxGeneratable;
    public boolean generateMax;

    public Parameter defaultBase()
        {
        return BreedDefaults.base().push(P_MULTIBREED);
        }

    public int numSources() { return DYNAMIC_SOURCES; }

    public void setup(final EvolutionState state, final Parameter base)
        {
        super.setup(state,base);

        Parameter def = defaultBase();

        float total = 0.0f;

        for(int x=0;x<sources.length;x++)
            {
            // make sure the sources are actually breeding pipelines
            if (!(sources[x] instanceof BreedingPipeline))
                state.output.error("Source #" + x + "is not a BreedingPipeline",base);
            else if (sources[x].probability<0.0) // null checked from state.output.error above
                state.output.error("Pipe #" + x + " must have a probability >= 0.0",base);  // convenient that NO_PROBABILITY is -1...
            else total += sources[x].probability;
            }

        state.output.exitIfErrors();

        // Now check for nonzero probability (we know it's positive)
        if (total == 0.0)
            state.output.warning("MultiBreedingPipeline's children have all zero probabilities -- this will be treated as a uniform distribution.  This could be an error.", base);

        // allow all zero probabilities
        BreedingSource.setupProbabilities(sources);

        generateMax = state.parameters.getBoolean(base.push(P_GEN_MAX),def.push(P_GEN_MAX),true);
        maxGeneratable=0;  // indicates that I don't know what it is yet.
        }

    /** Returns the max of typicalIndsProduced() of all its children */
    public int typicalIndsProduced()
        {
        if (maxGeneratable==0) // not determined yet
            maxGeneratable = maxChildProduction();
        return maxGeneratable;
        }

    public int produce(final int min,
        final int max,
        final int start,
        final int subpopulation,
        final Individual[] inds,
        final EvolutionState state,
        final int thread)

        {
        BreedingSource s = sources[BreedingSource.pickRandom(
                sources,state.random[thread].nextFloat())];
        int total;

        if (generateMax)
            {
            if (maxGeneratable==0)
                maxGeneratable = maxChildProduction();
            int n = maxGeneratable;
            if (n < min) n = min;
            if (n > max) n = max;

            total = s.produce(
                n,n,start,subpopulation,inds,state,thread);
            }
        else
            {
            total = s.produce(
                min,max,start,subpopulation,inds,state,thread);
            }

        // clone if necessary
        if (s instanceof SelectionMethod)
            for(int q=start; q < total+start; q++)
                inds[q] = (Individual)(inds[q].clone());

        return total;
        }
    }


text:
require_relative('../../puppet/parameter/netscaler_name')
require_relative('../../puppet/property/netscaler_truthy')

Puppet::Type.newtype(:netscaler_snmpalarm) do
  @doc = 'Manage basic netscaler network IP objects.'

  apply_to_device
  ensurable do
    defaultto :present
    newvalue(:present) do
      provider.set_state(resource[:state])
    end
    newvalue(:absent) do
      provider.set_state('DISABLED')
    end
  end

  newparam(:name, :namevar => true) do #<String>
    desc "Name of the SNMP alarm."
    munge(&:upcase)
  end

  newproperty(:alarm_threshold) do #<Double>
    desc "Value for the high threshold. The NetScaler appliance generates an SNMP trap message when the value of the attribute associated with the alarm is greater than or equal to the specified high threshold value."
  end

  newproperty(:normal_threshold) do #<Double>
    desc "Value for the normal threshold. A trap message is generated if the value of the respective attribute falls to or below this value after exceeding the high threshold."
  end

  newproperty(:severity) do #<String>
    desc "Severity level assigned to trap messages generated by this alarm. The severity levels are, in increasing order of severity, Informational, Warning, Minor, Major, and Critical.
    Possible values = Critical, Major, Minor, Warning, Informational"
    munge(&:capitalize)
  end

  newproperty(:time_interval) do #<Double>
    desc "Interval, in seconds, at which the NetScaler appliance generates SNMP trap messages when the conditions specified in the SNMP alarm are met. Can be specified for the following alarms: SYNFLOOD, HA-VERSION-MISMATCH, HA-SYNC-FAILURE, HA-NO-HEARTBEATS, HA-BAD-SECONDARY-STATE, CLUSTER-NODE-HEALTH, CLUSTER-NODE-QUORUM, CLUSTER-VERSION-MISMATCH, PORT-ALLOC-FAILED and APPFW traps. Default trap time intervals: SYNFLOOD and APPFW traps = 1sec, PORT-ALLOC-FAILED = 3600sec(1 hour), Other Traps = 86400sec(1 day).
Default value: 1"
  end

  newproperty(:state, :parent => Puppet::Property::NetscalerTruthy) do #<String>
    truthy_property("Current state of the SNMP alarm. The NetScaler appliance generates trap messages only for SNMP alarms that are enabled.
Possible values = ENABLED, DISABLED","ENABLED","DISABLED")
  end

  newproperty(:logging, :parent => Puppet::Property::NetscalerTruthy) do #<String>
    truthy_property("Logging status of the alarm. When logging is enabled, the NetScaler appliance logs every trap message that is generated for this alarm.
Default value: ENABLED
Possible values = ENABLED, DISABLED","ENABLED","DISABLED")
  end
end

redpajama_set_name: RedPajamaGithub


text:
#include <Array.hpp>

namespace opencl
{
namespace cpu
{
    template<typename T>
    void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot, const Array<T> &in);

    template<typename T>
    Array<int> lu_inplace(Array<T> &in, const bool convert_pivot = true);
}
}


text: Add Help Here


text:
package xbps

import (
	"bytes"
	"exec"
	"fmt"
	"io"
	"log"
	"os"
	"path/filepath"
	"strings"
)

var (
	xbpsBin   = "xbps-bin.static -c %s -Ayr %s %s %s"
	xbpsSrc   = "xbps-src -C -m %s %s %s"
	mkIdx     = "xbps-src make-repoidx %s"
	binCache  = "/home/strings/bincache"
	lfmt      = "%-10.10s %s"
	SRCPKGDIR string
	pkgfmt    = "%s-%s.x86_64.xbps"
	bufout    = new(bytes.Buffer)
)

func init() {
	argv0 := os.Args[0]
	log.SetPrefix(argv0 + ": ")
	log.SetFlags(log.Lshortfile)

	SRCPKGDIR = os.Getenv("XBPS_SRCPKGDIR")
	if SRCPKGDIR == "" {
		srcerror()
	}
	_, err := os.Stat(SRCPKGDIR)
	if err != nil {
		srcerror()
	}
}

func srcerror() {
	log.Fatal("you must set XBPS_SRCPKGDIR enviroment variable to use xbps-go")
}

func HandleError(err os.Error) {
	log.Print(err)
	log.Print(strings.Repeat("*", 80-len(log.Prefix())))
	io.Copy(os.Stderr, bufout)
	log.Print(strings.Repeat("*", 80-len(log.Prefix())))
}

func Seed(md *MasterDir) (err os.Error) {
	err = Install("base-chroot", md)
	if err != nil {
		return err
	}
	return
}

func Install(pack string, md *MasterDir) (err os.Error) {
	if IsInstalled(pack, md) {
		log.Printf(lfmt, "skip", pack)
		return
	}
	log.Printf(lfmt, "install", pack)
	err = NewCommand(xbpsBin, binCache, md.TargetPath, "install", pack).Run()
	if err != nil {
		return
	}
	return
}

func RmPackFile(pkg string) (err os.Error) {
	tmpl, err := FindTemplate(pkg, SRCPKGDIR)
	if err != nil {
		return err
	}
	pkgname := fmt.Sprintf(pkgfmt, pkg, tmpl.Version)
	glob := fmt.Sprintf("%s/pkg-binpkgs/*/%s-*", hostPath, pkgname)
	files, err := filepath.Glob(glob)
	if err != nil {
		return
	}
	switch len(files) {
	case 0:
		log.Printf(lfmt, "no package", pkg)
		return
	case 1:
		log.Printf(lfmt, "remove", unExpand(files[0]))
		err = os.Remove(files[0])
		return err
	default:
		for _, f := range files {
			log.Printf(lfmt, "packages", unExpand(f))
		}
		return fmt.Errorf("expected one package to remove found %v", len(files))
	}
	panic("Should not reach here")
}

func Build(tmpl string, md *MasterDir) (err os.Error) {
	depends, err := GetAllDepends(tmpl)
	if err != nil {
		return err
	}
	log.Printf(lfmt, "depends", tmpl)
	for _, d := range depends {
		err = Install(d, md)
		if err != nil {
			return err
		}
	}
	log.Printf(lfmt, "build", tmpl)
	cmd := NewCommand(xbpsSrc, md.TargetPath, "install", tmpl)
	err = cmd.Run()
	if err != nil {
		return
	}
	return
}

func Package(tmpl string, md *MasterDir) (err os.Error) {
	if err = RmPackFile(tmpl); err != nil {
		return
	}
	log.Printf(lfmt, "package", tmpl)
	err = NewCommand(xbpsSrc, md.TargetPath, "build-pkg", tmpl).Run()
	if err != nil {
		return
	}

	log.Printf(lfmt, "index", tmpl)
	err = NewCommand(mkIdx, tmpl).Run()
	if err != nil {
		return
	}
	err = Clean(md)
	if err != nil {
		return
	}
	log.Printf(lfmt, "done", tmpl)
	return
}

func Clean(md *MasterDir) (err os.Error) {
	log.Printf(lfmt, "clean", md.TargetPath)
	if err = os.RemoveAll(md.TargetPath); err != nil {
		return
	}
	return
}

func IsInstalled(pack string, md *MasterDir) bool {
	cmd := NewCommand(xbpsBin, binCache, md.TargetPath, "show", TrimOp(pack))
	err := cmd.Run()
	if err != nil {
		return false
	}
	return true
}

// Creates a new exec.Cmd from a Printf style format
func NewCommand(format string, i ...interface{}) (cmd *exec.Cmd) {
	args := strings.Split(fmt.Sprintf(format, i...), " ")
	cmd = exec.Command(args[0], args[1:]...)
	bufout.Reset()
	bufout.WriteString(fmt.Sprintf("%s\n", strings.Join(cmd.Args, " ")))
	cmd.Stdout = bufout
	cmd.Stderr = bufout
	return
}

// Get all dependancies for a template
func GetAllDepends(tmpl string) (depends []string, err os.Error) {
	rd, err := GetDepends("run", tmpl)
	if err != nil {
		return
	}
	bd, err := GetDepends("build", tmpl)
	if err != nil {
		return
	}
	depends = append(rd, bd...)
	return
}

// Get run/build depends for a template
func GetDepends(kind, tmpl string) (depends []string, err os.Error) {
	b, err := Sh([]string{kind, tmpl})
	if err != nil {
		return
	}
	if len(b) == 0 {
		return
	}
	b = bytes.Trim(b, " ")
	b = bytes.Trim(b, "\n")
	depends = strings.Split(string(b), " ")
	TrimOps(depends)
	return
}

func ChkDupDepends(name string) (required []string, err os.Error) {
	fmt.Printf("**** Checking Depends For (%s) ****\n", name)
	var (
		mreq    = make(map[string]bool)
		visited = make(map[string]string)
		depends = []string{}
	)
	if isSubTmpl(name) {
		depends, err = GetDepends("run", name)
	} else {
		depends, err = GetDepends("build", name)
	}
	if err != nil {
		return
	}
	// walk each depend
	for _, d := range depends {
		var c []string
		c, err = GetDepends("run", d)
		if err != nil {
			return
		}
		// walk each sub depend and mark it as visited
		for _, sc := range c {
			visited[sc] = d
			// if this sub depend is in required remove it
			if mreq[sc] {
				fmt.Printf("%-20.20s provided by %s\n", sc, visited[sc])
				mreq[sc] = false, false
			}
		}
		// if we visited this depend before it is not required
		_, exist := visited[d]
		if !exist {
			mreq[d] = true
		} else {
			fmt.Printf("%-20.20s provided by %s\n", d, visited[d])
		}
	}
	for r, _ := range mreq {
		required = append(required, r)
	}
	fmt.Printf("\n*** The following lines must be removed from (%s) *** \n\n", name)
	for _, d := range depends {
		if !sContains(required, d) {
			fmt.Println("Add_dependancy build", d)
		}
	}
	fmt.Println()
	return
}

// Remove all version chars from package name
func TrimOp(pack string) string {
	var (
		name    []int
		version []int
	)
	var prefix = true
	for _, c := range pack {
		switch c {
		case '<', '>', '=', '[', ']', '*', '.':
			version = append(version, c)
			prefix = false
		case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
			if prefix {
				name = append(name, c)
			} else {
				version = append(version, c)
			}
		default:
			name = append(name, c)
		}
	}
	return string(name)
}

func TrimOps(depends []string) {
	for i, d := range depends {
		depends[i] = TrimOp(d)
	}
}

func isSubTmpl(tmpl string) bool {
	file := fmt.Sprintf("%s/%s/%s.template", SRCPKGDIR, tmpl, tmpl)
	return fileExists(file)
}

func Sh(args []string) (output []byte, err os.Error) {
	helper := "/usr/local/libexec/getdeps-helper"
	cmd := exec.Command(helper, args...)
	output, err = cmd.CombinedOutput()
	if err != nil {
		return nil, fmt.Errorf("%s: %s %s", helper, err, output)
	}
	return
}


text:
namespace base {
namespace debug {
class TracedValue;
}
}

namespace cc {

class PictureLayerTiling;
class PicturePileImpl;

class CC_EXPORT PictureLayerTilingClient {
 public:
  // Create a tile at the given content_rect (in the contents scale of the
  // tiling) This might return null if the client cannot create such a tile.
  virtual scoped_refptr<Tile> CreateTile(
    PictureLayerTiling* tiling,
    const gfx::Rect& content_rect) = 0;
  virtual PicturePileImpl* GetPile() = 0;
  virtual gfx::Size CalculateTileSize(
    const gfx::Size& content_bounds) const = 0;
  virtual const Region* GetInvalidation() = 0;
  virtual const PictureLayerTiling* GetTwinTiling(
      const PictureLayerTiling* tiling) const = 0;
  virtual PictureLayerTiling* GetRecycledTwinTiling(
      const PictureLayerTiling* tiling) = 0;
  virtual size_t GetMaxTilesForInterestArea() const = 0;
  virtual float GetSkewportTargetTimeInSeconds() const = 0;
  virtual int GetSkewportExtrapolationLimitInContentPixels() const = 0;
  virtual WhichTree GetTree() const = 0;

 protected:
  virtual ~PictureLayerTilingClient() {}
};

class CC_EXPORT PictureLayerTiling {
 public:
  enum EvictionCategory {
    EVENTUALLY,
    EVENTUALLY_AND_REQUIRED_FOR_ACTIVATION,
    SOON,
    SOON_AND_REQUIRED_FOR_ACTIVATION,
    NOW,
    NOW_AND_REQUIRED_FOR_ACTIVATION
  };

  class CC_EXPORT TilingRasterTileIterator {
   public:
    TilingRasterTileIterator();
    TilingRasterTileIterator(PictureLayerTiling* tiling, WhichTree tree);
    ~TilingRasterTileIterator();

    operator bool() const { return !!current_tile_; }
    const Tile* operator*() const { return current_tile_; }
    Tile* operator*() { return current_tile_; }
    TilePriority::PriorityBin get_type() const {
      switch (phase_) {
        case VISIBLE_RECT:
          return TilePriority::NOW;
        case SKEWPORT_RECT:
        case SOON_BORDER_RECT:
          return TilePriority::SOON;
        case EVENTUALLY_RECT:
          return TilePriority::EVENTUALLY;
      }
      NOTREACHED();
      return TilePriority::EVENTUALLY;
    }

    TilingRasterTileIterator& operator++();

   private:
    enum Phase {
      VISIBLE_RECT,
      SKEWPORT_RECT,
      SOON_BORDER_RECT,
      EVENTUALLY_RECT
    };

    void AdvancePhase();
    bool TileNeedsRaster(Tile* tile) const {
      RasterMode mode = tile->DetermineRasterModeForTree(tree_);
      return !tile->is_occluded(tree_) && tile->NeedsRasterForMode(mode);
    }

    PictureLayerTiling* tiling_;

    Phase phase_;
    WhichTree tree_;

    Tile* current_tile_;
    TilingData::Iterator visible_iterator_;
    TilingData::SpiralDifferenceIterator spiral_iterator_;
  };

  class CC_EXPORT TilingEvictionTileIterator {
   public:
    TilingEvictionTileIterator();
    TilingEvictionTileIterator(PictureLayerTiling* tiling,
                               TreePriority tree_priority,
                               EvictionCategory category);
    ~TilingEvictionTileIterator();

    operator bool() const;
    const Tile* operator*() const;
    Tile* operator*();
    TilingEvictionTileIterator& operator++();

   private:
    const std::vector<Tile*>* eviction_tiles_;
    size_t current_eviction_tiles_index_;
  };

  ~PictureLayerTiling();

  // Create a tiling with no tiles.  CreateTiles must be called to add some.
  static scoped_ptr<PictureLayerTiling> Create(
      float contents_scale,
      const gfx::Size& layer_bounds,
      PictureLayerTilingClient* client);
  gfx::Size layer_bounds() const { return layer_bounds_; }
  void UpdateTilesToCurrentPile(const Region& layer_invalidation,
                                const gfx::Size& new_layer_bounds);
  void CreateMissingTilesInLiveTilesRect();
  void RemoveTilesInRegion(const Region& layer_region);

  void SetClient(PictureLayerTilingClient* client);
  void set_resolution(TileResolution resolution) { resolution_ = resolution; }
  TileResolution resolution() const { return resolution_; }

  gfx::Size tiling_size() const { return tiling_data_.tiling_size(); }
  gfx::Rect live_tiles_rect() const { return live_tiles_rect_; }
  gfx::Size tile_size() const { return tiling_data_.max_texture_size(); }
  float contents_scale() const { return contents_scale_; }

  Tile* TileAt(int i, int j) const {
    TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j));
    return (iter == tiles_.end()) ? NULL : iter->second.get();
  }

  void CreateAllTilesForTesting() {
    SetLiveTilesRect(gfx::Rect(tiling_data_.tiling_size()));
  }

  const TilingData& TilingDataForTesting() const { return tiling_data_; }

  std::vector<Tile*> AllTilesForTesting() const {
    std::vector<Tile*> all_tiles;
    for (TileMap::const_iterator it = tiles_.begin();
         it != tiles_.end(); ++it)
      all_tiles.push_back(it->second.get());
    return all_tiles;
  }

  std::vector<scoped_refptr<Tile> > AllRefTilesForTesting() const {
    std::vector<scoped_refptr<Tile> > all_tiles;
    for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
      all_tiles.push_back(it->second);
    return all_tiles;
  }

  const gfx::Rect& GetCurrentVisibleRectForTesting() const {
    return current_visible_rect_;
  }

  // Iterate over all tiles to fill content_rect.  Even if tiles are invalid
  // (i.e. no valid resource) this tiling should still iterate over them.
  // The union of all geometry_rect calls for each element iterated over should
  // exactly equal content_rect and no two geometry_rects should intersect.
  class CC_EXPORT CoverageIterator {
   public:
    CoverageIterator();
    CoverageIterator(const PictureLayerTiling* tiling,
        float dest_scale,
        const gfx::Rect& rect);
    ~CoverageIterator();

    // Visible rect (no borders), always in the space of content_rect,
    // regardless of the contents scale of the tiling.
    gfx::Rect geometry_rect() const;
    // Texture rect (in texels) for geometry_rect
    gfx::RectF texture_rect() const;
    gfx::Size texture_size() const;

    // Full rect (including borders) of the current tile, always in the space
    // of content_rect, regardless of the contents scale of the tiling.
    gfx::Rect full_tile_geometry_rect() const;

    Tile* operator->() const { return current_tile_; }
    Tile* operator*() const { return current_tile_; }

    CoverageIterator& operator++();
    operator bool() const { return tile_j_ <= bottom_; }

    int i() const { return tile_i_; }
    int j() const { return tile_j_; }

   private:
    const PictureLayerTiling* tiling_;
    gfx::Rect dest_rect_;
    float dest_to_content_scale_;

    Tile* current_tile_;
    gfx::Rect current_geometry_rect_;
    int tile_i_;
    int tile_j_;
    int left_;
    int top_;
    int right_;
    int bottom_;

    friend class PictureLayerTiling;
  };

  void Reset();

  void UpdateTilePriorities(WhichTree tree,
                            const gfx::Rect& viewport_in_layer_space,
                            float ideal_contents_scale,
                            double current_frame_time_in_seconds,
                            const Occlusion& occlusion_in_layer_space);

  // Copies the src_tree priority into the dst_tree priority for all tiles.
  // The src_tree priority is reset to the lowest priority possible.  This
  // also updates the pile on each tile to be the current client's pile.
  void DidBecomeActive();

  // Resets the active priority for all tiles in a tiling, when an active
  // tiling is becoming recycled. This may include some tiles which are
  // not in the the pending tiling (due to invalidations). This must
  // be called before DidBecomeActive, as it resets the active priority
  // while DidBecomeActive promotes pending priority on a similar set of tiles.
  void DidBecomeRecycled();

  bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) {
    return frame_time_in_seconds != last_impl_frame_time_in_seconds_;
  }

  void GetAllTilesForTracing(std::set<const Tile*>* tiles) const;
  void AsValueInto(base::debug::TracedValue* array) const;
  size_t GPUMemoryUsageInBytes() const;

  struct RectExpansionCache {
    RectExpansionCache();

    gfx::Rect previous_start;
    gfx::Rect previous_bounds;
    gfx::Rect previous_result;
    int64 previous_target;
  };

  static
  gfx::Rect ExpandRectEquallyToAreaBoundedBy(
      const gfx::Rect& starting_rect,
      int64 target_area,
      const gfx::Rect& bounding_rect,
      RectExpansionCache* cache);

  bool has_ever_been_updated() const {
    return last_impl_frame_time_in_seconds_ != 0.0;
  }

 protected:
  friend class CoverageIterator;
  friend class TilingRasterTileIterator;
  friend class TilingEvictionTileIterator;

  typedef std::pair<int, int> TileMapKey;
  typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap;

  PictureLayerTiling(float contents_scale,
                     const gfx::Size& layer_bounds,
                     PictureLayerTilingClient* client);
  void SetLiveTilesRect(const gfx::Rect& live_tiles_rect);
  void VerifyLiveTilesRect();
  Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling);
  // Returns true if the Tile existed and was removed from the tiling.
  bool RemoveTileAt(int i, int j, PictureLayerTiling* recycled_twin);

  // Computes a skewport. The calculation extrapolates the last visible
  // rect and the current visible rect to expand the skewport to where it
  // would be in |skewport_target_time| seconds. Note that the skewport
  // is guaranteed to contain the current visible rect.
  gfx::Rect ComputeSkewport(double current_frame_time_in_seconds,
                            const gfx::Rect& visible_rect_in_content_space)
      const;

  void UpdateEvictionCacheIfNeeded(TreePriority tree_priority);
  const std::vector<Tile*>* GetEvictionTiles(TreePriority tree_priority,
                                             EvictionCategory category);

  void Invalidate(const Region& layer_region);

  void DoInvalidate(const Region& layer_region,
                    bool recreate_invalidated_tiles);

  // Given properties.
  float contents_scale_;
  gfx::Size layer_bounds_;
  TileResolution resolution_;
  PictureLayerTilingClient* client_;

  // Internal data.
  TilingData tiling_data_;
  TileMap tiles_;  // It is not legal to have a NULL tile in the tiles_ map.
  gfx::Rect live_tiles_rect_;

  // State saved for computing velocities based upon finite differences.
  double last_impl_frame_time_in_seconds_;
  gfx::Rect last_visible_rect_in_content_space_;

  // Iteration rects in content space
  gfx::Rect current_visible_rect_;
  gfx::Rect current_skewport_rect_;
  gfx::Rect current_soon_border_rect_;
  gfx::Rect current_eventually_rect_;

  bool has_visible_rect_tiles_;
  bool has_skewport_rect_tiles_;
  bool has_soon_border_rect_tiles_;
  bool has_eventually_rect_tiles_;

  // TODO(reveman): Remove this in favour of an array of eviction_tiles_ when we
  // change all enums to have a consistent way of getting the count/last
  // element.
  std::vector<Tile*> eviction_tiles_now_;
  std::vector<Tile*> eviction_tiles_now_and_required_for_activation_;
  std::vector<Tile*> eviction_tiles_soon_;
  std::vector<Tile*> eviction_tiles_soon_and_required_for_activation_;
  std::vector<Tile*> eviction_tiles_eventually_;
  std::vector<Tile*> eviction_tiles_eventually_and_required_for_activation_;

  bool eviction_tiles_cache_valid_;
  TreePriority eviction_cache_tree_priority_;

 private:
  DISALLOW_ASSIGN(PictureLayerTiling);

  RectExpansionCache expansion_cache_;
};

}  // namespace cc

#endif  // CC_RESOURCES_PICTURE_LAYER_TILING_H_


text:
<?php

abstract class Sitengine_Newsletter_Frontend_Campaigns_Entity
{

	protected $_controller = null;
    protected $_started = false;
    protected $_row = null;

    public function __construct(Sitengine_Newsletter_Frontend_Campaigns_Controller $controller)
    {
        $this->_controller = $controller;
    }

    public function getRow()
    {
    	if(!$this->_started) {
    		require_once 'Sitengine/Newsletter/Frontend/Campaigns/Exception.php';
    		throw new Sitengine_Newsletter_Frontend_Campaigns_Exception('entity not started');
    	}
		return $this->_row;
    }

    public function refresh(array $updatedData)
    {
    	if(!$this->_started) {
    		require_once 'Sitengine/Newsletter/Frontend/Campaigns/Exception.php';
    		throw new Sitengine_Newsletter_Frontend_Campaigns_Exception('entity not started');
    	}
    	foreach($updatedData as $field => $val)
    	{
    		$this->_row->$field = $val;
    	}
    }

    public function start()
    {
        try {
            if($this->_started) { return true; }
            else { $this->_started = true; }

            $id = $this->_controller->getRequest()->get(Sitengine_Env::PARAM_ID);
            $table = $this->_controller->getFrontController()->getNewsletterPackage()->getCampaignsTable();
            $select = $table->select()->where('id = ?', $id);
        	$row = $table->fetchRow($select);
        	if($row !== null) { $this->_row = $row; }
			else {
				require_once 'Zend/Log.php';
				require_once 'Sitengine/Newsletter/Frontend/Campaigns/Exception.php';
				throw new Sitengine_Newsletter_Frontend_Campaigns_Exception(
                    'resource not found',
                    Sitengine_Env::ERROR_NOT_FOUND,
                    null,
                    Zend_Log::INFO
                );
			}
            if(!$this->_controller->getPermiso()->getDac()->readAccessGranted($this->_row->toArray())) { return false; }
            else { return true; }
        }
        catch (Sitengine_Newsletter_Frontend_Campaigns_Exception $exception) {
            throw $exception;
        }
        catch (Exception $exception) {
            require_once 'Sitengine/Newsletter/Frontend/Campaigns/Exception.php';
            throw new Sitengine_Newsletter_Frontend_Campaigns_Exception('start entity error', $exception);
        }
    }
}
?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <artifactId>hawkular-alerts-netty-poc</artifactId>
    <groupId>org.hawkular.alerts</groupId>
    <version>1.7.0.Final-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>hawkular-alerts-commons</artifactId>
  <packaging>jar</packaging>

  <name>Hawkular Alerting: Commons</name>

  <dependencies>
    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-core</artifactId>
      <scope>provided</scope>
      <version>${version.org.infinispan.wildfly}</version>
    </dependency>

    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <version>${version.org.jboss.logging}</version>
    </dependency>

    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging-annotations</artifactId>
      <version>${version.org.jboss.logging.jboss-logging-annotations}</version>
    </dependency>

    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging-processor</artifactId>
      <version>${version.org.jboss.logging.jboss-logging-processor}</version>
    </dependency>

  </dependencies>

</project>


text:
export default class User {
  fname: string;
  lname: string;
  age: number;
}


text:
using System;
using System.Collections.Generic;
using DddDemo.Issues.Comments;

namespace DddDemo.Issues
{
    public class IssueRepository : IIssueRepository
    {
        public Issue Get(string id)
        {
            throw new NotImplementedException();
        }

        public int GetOpenIssueCountOfUser(string userId)
        {
            throw new NotImplementedException();
        }

        public void Update(Issue issue)
        {
            throw new NotImplementedException();
        }

        public List<IssueCommentWithCreatorUser> GetCommentsWithCreatorUsers(string issueId)
        {
            throw new NotImplementedException();
        }
    }
}


text:
package org.simpleflatmapper.jdbc.impl;

import org.simpleflatmapper.jdbc.JdbcColumnKey;
import org.simpleflatmapper.map.mapper.MapperKey;
import org.simpleflatmapper.map.mapper.MapperKeyComparator;

public final class JdbcColumnKeyMapperKeyComparator extends MapperKeyComparator<JdbcColumnKey> {

    public final static JdbcColumnKeyMapperKeyComparator INSTANCE = new JdbcColumnKeyMapperKeyComparator();

    private JdbcColumnKeyMapperKeyComparator() {
    }

    @Override
    public int compare(MapperKey<JdbcColumnKey> m1, MapperKey<JdbcColumnKey> m2) {
        JdbcColumnKey[] keys1 = m1.getColumns();
        JdbcColumnKey[] keys2 = m2.getColumns();
        int d = keys1.length - keys2.length;
        if (d != 0) {
            return d;
        }
        return compareKeys(keys1, keys2);
    }

    private int compareKeys(JdbcColumnKey[] keys1, JdbcColumnKey[] keys2) {
        for (int i = 0; i < keys1.length; i++) {
            int d = compare(keys1[i], keys2[i]);
            if (d != 0) {
                return d;
            }
        }
        return 0;
    }

    protected int compare(JdbcColumnKey k1, JdbcColumnKey k2) {
        int d = k1.getIndex() - k2.getIndex();
        if (d != 0) return d;
        d = k1.getName().compareTo(k2.getName());
        if (d != 0) return d;
        return k1.getSqlType(null) - k2.getSqlType(null);
    }
}


text:
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def setup():
    autotools.rawConfigure('--prefix-dir=/usr \
                            --install-dir=/usr \
                            --without-allegro \
                            --with-zlib \
                            --with-sdl \
                            --with-png \
                            --with-freetype \
                            --with-fontconfig \
                            --with-icu \
                            --with-liblzo2 \
                            --without-iconv \
                            --binary-dir="bin" \
                            --data-dir="share/openttd"')

def build():
    autotools.make()

def install():
    autotools.rawInstall("INSTALL_DIR=%s" % get.installDIR())
    pisitools.dodoc("changelog.txt", "readme.txt", "COPYING")


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Annls Sci. Nat. , Bot. , sér. 4 3: 169 (1855)

#### Original name
Arthonia trachylioides Nyl.

### Remarks
null


text:
title: createWebsite.ps1 - CreateVirtualDirectory
linkText: CreateVirtualDirectory
description: Details about the CreateVirtualDirectory function in createWebsite.ps1 helper script
---

# CreateVirtualDirectory

```PowerShell
{% raw %}
CreateVirtualDirectory
    [-webSite] <String>
    [-virtualDir] <String>
    [-physicalPath] <String>
{% endraw %}
```

## Description

Create new virtual directory under an existing website

## Example

```PowerShell
{% raw %}
CreateVirtualDirectory -webSite "MySite" -virtualDir "SubDir" -physicalPath "C:\Site\SubDir"
{% endraw %}
```


text:
SimulationSystem::SimulationSystem()
{}

SimulationSystem::~SimulationSystem()
{}

void SimulationSystem::planning(const ModelTime& time, const LPIEvent& event)
{
	futureList.insert(EventList::value_type(time, event));
}

const ModelTime& SimulationSystem::timeNow() const
{
	return modelTime;
}

void SimulationSystem::run(const LPModel& model)
{
	std::cout << "start model: " << model->getName() << std::endl;

	EventContext contex(LPIModelTimeService(this), LPIPlanningService(this), model);
	while (true)
	{
		if (futureList.empty())
			break;

		EventList::iterator it = futureList.begin();
		ModelTime time = it->first;
		modelTime = time;
		LPIEvent event = it->second;
		futureList.erase(it);
		event->onEvent(contex);
	}

	std::cout << "stop model: " << model->getName() << std::endl;
	int i = 1;
}


text:
#pragma once
#include <aws/qldb/QLDB_EXPORTS.h>
#include <aws/qldb/QLDBRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Http
{
    class URI;
} //namespace Http
namespace QLDB
{
namespace Model
{

  /**
   */
  class AWS_QLDB_API ListJournalS3ExportsForLedgerRequest : public QLDBRequest
  {
  public:
    ListJournalS3ExportsForLedgerRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "ListJournalS3ExportsForLedger"; }

    Aws::String SerializePayload() const override;

    void AddQueryStringParameters(Aws::Http::URI& uri) const override;

    /**
     *
The name of the ledger.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The name of the ledger.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
The name of the ledger.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
The name of the ledger.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
The name of the ledger.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
The name of the ledger.

     */
    inline ListJournalS3ExportsForLedgerRequest& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The name of the ledger.

     */
    inline ListJournalS3ExportsForLedgerRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The name of the ledger.

     */
    inline ListJournalS3ExportsForLedgerRequest& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The maximum number of results to return in a single
     * ListJournalS3ExportsForLedger request. (The actual number of
     * results returned might be fewer.)

     */
    inline int GetMaxResults() const{ return m_maxResults; }

    /**
     *
The maximum number of results to return in a single
     * ListJournalS3ExportsForLedger request. (The actual number of
     * results returned might be fewer.)

     */
    inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }

    /**
     *
The maximum number of results to return in a single
     * ListJournalS3ExportsForLedger request. (The actual number of
     * results returned might be fewer.)

     */
    inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }

    /**
     *
The maximum number of results to return in a single
     * ListJournalS3ExportsForLedger request. (The actual number of
     * results returned might be fewer.)

     */
    inline ListJournalS3ExportsForLedgerRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline ListJournalS3ExportsForLedgerRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline ListJournalS3ExportsForLedgerRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
A pagination token, indicating that you want to retrieve the next page of
     * results. If you received a value for NextToken in the response from
     * a previous ListJournalS3ExportsForLedger call, then you should use
     * that value as input here.

     */
    inline ListJournalS3ExportsForLedgerRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:

    Aws::String m_name;
    bool m_nameHasBeenSet = false;

    int m_maxResults;
    bool m_maxResultsHasBeenSet = false;

    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet = false;
  };

} // namespace Model
} // namespace QLDB
} // namespace Aws


text:
using System;
using System.Linq;

namespace _06_FoldAndSum
{
    public class Linq
    {
        public static void Main(string[] args)
        {
            int[] input = Console.ReadLine()
                .Split(' ')
                .Select(int.Parse)
                .ToArray();

            int k = input.Length / 4;

            int[] firstRowLeftSide = new int[k];
            int[] firstRowRightSide = new int[k];

            firstRowLeftSide = input
                .Take(k)
                .Reverse()
                .ToArray();

            firstRowRightSide = input
                .Reverse()
                .Take(k)
                .ToArray();

            int[] firstRow = firstRowLeftSide
                .Concat(firstRowRightSide)
                .ToArray();

            int[] secondRow = input
                .Skip(k)
                .Take(k * 2)
                .ToArray();

            int[] sum = new int[firstRow.Length];

            for (int i = 0; i < firstRow.Length; i++)
            {
                sum[i] = firstRow[i] + secondRow[i];
            }

            Console.WriteLine(string.Join(" ", sum));
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Patricks Software Blog</title>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <link href="<?php base_url(); ?> assets/css/style.css" rel="stylesheet">

          <?php echo $this->brand; ?>

<a href="<?php echo base_url(); ?>">Home

<a href="<?php echo base_url(); ?>pages/about">About

         <img src="<?php echo base_url('imgs/landing_page_img.jpg'); ?>" class="rounded" alt="Software Development" width="600" />

<?php echo $this->banner_heading; ?>

This blog has random articles on computer science concepts

          <?php $this->load->view($main); ?>


text:
using MasterDevs.ChromeDevTools;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace MasterDevs.ChromeDevTools.Protocol.Network
{
	/// <summary>
	/// Allows overriding user agent with the given string.
	/// </summary>
	[Command(ProtocolName.Network.SetUserAgentOverride)]
	public class SetUserAgentOverrideCommand
	{
		/// <summary>
		/// Gets or sets User agent to use.
		/// </summary>
		public string UserAgent { get; set; }
	}
}


text:
copy ..\..\..\style\base.css .
saxon date.day-abbreviation.xml ../../../style/function.xsl
wzzip -P -o date.day-abbreviation.zip @date.day-abbreviation.package.txt
wzzip -P -o date.day-abbreviation.use-cases.zip @date.day-abbreviation.use-cases.txt
cd ..
cd ..
saxon date.xml ../style/module.xsl
wzzip -P -o date.zip @date.package.txt
cd ..
saxon modules.xml style/package.xsl
wzzip -P -o all-exslt.zip @package.txt
saxon modules.xml style/xml-package.xsl
wzzip -P -o exslt.zip @xml-package.txt
cd date
cd functions
cd day-abbreviation


text:
<?php /*

[General]
#To activate this, you need bfdebug extension, and it will display the full set of rules and their aftermath in an array at the top of the page
Debug=0

#[ChildListing]
ExcludeTypes[]
#Then exclude any types that you don't want to see in your child list
#ExcludeTypes[]=bfpromoholder

#[ChildAddition]
#RuleSet=FullSiteChildAdd

#[ExtraChildlistColumns]
#Columns[]
#Columns[]=sunrise_date
#Columns[]=sunset_date

#[ExtraChildlistColumns_sunrise_date]
#Label=Sunrise
#Note: for extra formatting (not ToString()), use the following static method somewhere. We'll pass the attributename (so "sunrise_date"), and a full object to it (in case we need more info)
#If you don't specify this, we'll try to get an attribute with this identifier, we'll just run ToString() on it
#ValueGenerationStaticMethod=someclass::somemethod
#IsSortable=true
#IsResizable=true

#[ExtraChildlistColumn_sunset_date]
#Label=Sunset
#Note: for extra formatting (not ToString()), use the following static method somewhere. We'll pass the attributename (so "sunset_date"), and a full object to it (in case we need more info)
#If you don't specify this, we'll try to get an attribute with this identifier, we'll just run ToString() on it
#ValueGenerationStaticMethod=someclass::somemethod
#IsSortable=true
#IsResizable=true

*/ ?>


text:
This bundle binds and integrates Dropwizard's `HealthCheck`, `Metric`, `MetricSet`, `LifeCycle`, `LifeCycle.Listener`, and `Managed`
objects with HK2, allowing these components to be registered directly with Jersey and fully injected with any other services also known to
HK2. Additionally, it provides access to the Jersey `ServiceLocator` from the admin `ServletContext`, default bindings for many Dropwizard
components such as the `Validator`, `ObjectMapper`, `MetricRegistry`, `HealthCheckRegistry`, your `Application`, your `Configuration`, the
`Environment` and `LifecycleEnvironment`, as well as each bundle added to your application.

To use this bundle, add it to your application in the initialize method:

    @Override
    public void initialize(Bootstrap<YourConfig> bootstrap) {
        // This ensures there's only ever one HK2 bundle; don't use bootstrap.addBundle(new HK2Bundle<>());
        HK2Bundle.addTo(bootstrap);
    }

Then, update your health checks, metrics, and managed components to use the custom Jersey component marker interfaces:
`InjectableHealthCheck`, `InjectableManaged`, `InjectableLifeCycle`, `InjectableLifeCycleListener`, `InjectableMetric`, or
`InjectableMetricSet`. These are necessary for Jersey to identify the components as a valid Jersey component, and just extend the
Dropwizard interfaces of similar name. Here is an example health check:

    @Named("TestHealthCheck")
    public class TestInjectableHealthCheck extends InjectableHealthCheck {
        private final TestConfig config;

        @Inject
        public TestInjectableHealthCheck(TestConfig config) {
            this.config = config;
        }

        public TestConfig getConfig() {
            return config;
        }

        @Override
        protected Result check() throws Exception {
            return Result.healthy();
        }
    }

Health checks and Metrics can also make use of the `@Named()` annotation to identify the name under which the component should be
registered. If a name is not provided, a warning will be printed and a name generated in the format of `ClassName.RandomUUID` under which
the component will be registered.

Lastly, register your components directly with Jersey:

    @Override
    public void run(TestConfig testConfig, Environment environment) throws Exception {
        environment.jersey().register(YourInjectableHealthCheck.class);
        environment.jersey().register(YourInjectableLifeCycle.class);
    }

They will now be injected and registered properly with Dropwizard after HK2 and Jersey are initialized.

To access the `ServiceLocator` from the admin `ServletContext`, query the context attribute identified by `HK2Bundle.SERVICE_LOCATOR`:

    ServiceLocator locator = (ServiceLocator) getServletConfig().getServletContext().getAttribute(HK2Bundle.SERVICE_LOCATOR);

`RequestScoped` bindings are unavailable in the admin context, but singletons and other scopes are available.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Reactive.Threading.Tasks;
using System.Threading.Tasks;
using System.Windows.Input;
using ReactiveUIMicro;

namespace ReactiveUIMicro.Xaml
{
    /// <summary>
    /// IReactiveCommand is an Rx-enabled version of ICommand that is also an
    /// Observable. Its Observable fires once for each invocation of
    /// ICommand.Execute and its value is the CommandParameter that was
    /// provided.
    /// </summary>
    public class ReactiveCommand : ICommand, IObservable<object>, IDisposable, IEnableLogger
    {
        /// <summary>
        /// Creates a new ReactiveCommand object.
        /// </summary>
        /// <param name="canExecute">An Observable, often obtained via
        /// ObservableFromProperty, that defines when the Command can
        /// execute.</param>
        /// <param name="scheduler">The scheduler to publish events on - default
        /// is RxApp.DeferredScheduler.</param>
        /// <param name="initialCondition">Initial CanExecute state</param>
        public ReactiveCommand(IObservable<bool> canExecute = null, IScheduler scheduler = null, bool initialCondition = true)
        {
            canExecute = canExecute ?? Observable.Return(true).Concat(Observable.Never<bool>());
            canExecute = canExecute.ObserveOn(scheduler ?? RxApp.DeferredScheduler);
            commonCtor(scheduler, initialCondition);

            _inner = canExecute.Subscribe(
                _canExecuteSubject.OnNext,
                _exSubject.OnNext);

            ThrownExceptions = _exSubject;
        }

        protected ReactiveCommand(Func<object, Task<bool>> canExecuteFunc, IScheduler scheduler = null)
        {
            var canExecute = _canExecuteProbed.SelectMany(x => canExecuteFunc(x).ToObservable());

            commonCtor(scheduler);

            _inner = canExecute.Subscribe(
                _canExecuteSubject.OnNext,
                _exSubject.OnNext);
        }

        protected ReactiveCommand(Func<object, bool> canExecute, IScheduler scheduler = null)
        {
            _canExecuteExplicitFunc = canExecute;
            commonCtor(scheduler);
        }

        /// <summary>
        /// Creates a new ReactiveCommand object in an imperative, non-Rx way,
        /// similar to RelayCommand.
        /// </summary>
        /// <param name="canExecute">A function that determines when the Command
        /// can execute.</param>
        /// <param name="executed">A method that will be invoked when the
        /// Execute method is invoked.</param>
        /// <param name="scheduler">The scheduler to publish events on - default
        /// is RxApp.DeferredScheduler.</param>
        /// <returns>A new ReactiveCommand object.</returns>
        public static ReactiveCommand Create(
            Func<object, bool> canExecute,
            Action<object> executed = null,
            IScheduler scheduler = null)
        {
            var ret = new ReactiveCommand(canExecute, scheduler);
            if (executed != null) {
                ret.Subscribe(executed);
            }

            return ret;
        }

        /// <summary>
        /// Creates a new ReactiveCommand object in an imperative, non-Rx way,
        /// similar to RelayCommand, only via a TPL Async method
        /// </summary>
        /// <param name="canExecute">A function that determines when the Command
        /// can execute.</param>
        /// <param name="executed">A method that will be invoked when the
        /// Execute method is invoked.</param>
        /// <param name="scheduler">The scheduler to publish events on - default
        /// is RxApp.DeferredScheduler.</param>
        /// <returns>A new ReactiveCommand object.</returns>
        public static ReactiveCommand Create(
            Func<object, Task<bool>> canExecute,
            Action<object> executed = null,
            IScheduler scheduler = null)
        {
            var ret = new ReactiveCommand(canExecute, scheduler);
            if (executed != null) {
                ret.Subscribe(executed);
            }

            return ret;
        }

        public IObservable<Exception> ThrownExceptions { get; protected set; }

        void commonCtor(IScheduler scheduler, bool initialCondition = true)
        {
            this.scheduler = scheduler ?? RxApp.DeferredScheduler;

            _canExecuteSubject = new ScheduledSubject<bool>(RxApp.DeferredScheduler);
            canExecuteLatest = new ObservableAsPropertyHelper<bool>(_canExecuteSubject,
                b => { raiseCanExecuteChanged(EventArgs.Empty); },
                initialCondition, scheduler);

            _canExecuteProbed = new Subject<object>();
            executeSubject = new Subject<object>();

            _exSubject = new ScheduledSubject<Exception>(RxApp.DeferredScheduler, RxApp.DefaultExceptionHandler);
            ThrownExceptions = _exSubject;
        }

        Func<object, bool> _canExecuteExplicitFunc;
        protected ISubject<bool> _canExecuteSubject;
        protected Subject<object> _canExecuteProbed;
        IDisposable _inner = null;
        ScheduledSubject<Exception> _exSubject;

        /// <summary>
        /// Fires whenever the CanExecute of the ICommand changes.
        /// </summary>
        public IObservable<bool> CanExecuteObservable {
            get { return _canExecuteSubject.DistinctUntilChanged(); }
        }

        ObservableAsPropertyHelper<bool> canExecuteLatest;
        public virtual bool CanExecute(object parameter)
        {
            _canExecuteProbed.OnNext(parameter);
            if (_canExecuteExplicitFunc != null) {
                bool ret = _canExecuteExplicitFunc(parameter);
                _canExecuteSubject.OnNext(ret);
                return ret;
            }

            return canExecuteLatest.Value;
        }

        public event EventHandler CanExecuteChanged;

        IScheduler scheduler;
        Subject<object> executeSubject;

        public void Execute(object parameter)
        {
            this.Log().Debug("{0:X}: Executed", this.GetHashCode());
            executeSubject.OnNext(parameter);
        }

        public IDisposable Subscribe(IObserver<object> observer)
        {
            return executeSubject.ObserveOn(scheduler).Subscribe(
                Observer.Create<object>(
                    x => marshalFailures(observer.OnNext, x),
                    ex => marshalFailures(observer.OnError, ex),
                    () => marshalFailures(observer.OnCompleted)));
        }

        public void Dispose()
        {
            if (_inner != null) {
                _inner.Dispose();
            }
        }

        void marshalFailures<T>(Action<T> block, T param)
        {
            try {
                block(param);
            } catch (Exception ex) {
                _exSubject.OnNext(ex);
            }
        }

        void marshalFailures(Action block)
        {
            marshalFailures(_ => block(), Unit.Default);
        }

        protected virtual void raiseCanExecuteChanged(EventArgs e)
        {
            EventHandler handler = this.CanExecuteChanged;
            if (handler != null) {
                handler(this, e);
            }
        }
    }

    public static class ReactiveCommandMixins
    {
        /// <summary>
        /// ToCommand is a convenience method for returning a new
        /// ReactiveCommand based on an existing Observable chain.
        /// </summary>
        /// <param name="scheduler">The scheduler to publish events on - default
        /// is RxApp.DeferredScheduler.</param>
        /// <returns>A new ReactiveCommand whose CanExecute Observable is the
        /// current object.</returns>
        public static ReactiveCommand ToCommand(this IObservable<bool> This, IScheduler scheduler = null)
        {
            return new ReactiveCommand(This, scheduler);
        }

        /// <summary>
        /// A utility method that will pipe an Observable to an ICommand (i.e.
        /// it will first call its CanExecute with the provided value, then if
        /// the command can be executed, Execute() will be called)
        /// </summary>
        /// <param name="command">The command to be executed.</param>
        /// <returns>An object that when disposes, disconnects the Observable
        /// from the command.</returns>
        public static IDisposable InvokeCommand<T>(this IObservable<T> This, ICommand command)
        {
            return This.ObserveOn(RxApp.DeferredScheduler).Subscribe(x => {
                if (!command.CanExecute(x)) {
                    return;
                }
                command.Execute(x);
            });
        }
    }
}

// vim: tw=120 ts=4 sw=4 et :


text:
var ghostBookshelf = require('./base'),
    Session,
    Sessions;

Session = ghostBookshelf.Model.extend({

    tableName: 'sessions',

    permittedAttributes: ['id', 'expires', 'sess'],

    saving: function () {
        // Remove any properties which don't belong on the session model
        this.attributes = this.pick(this.permittedAttributes);
    }
}, {
    destroyAll:  function (options) {
        options = options || {};
        return ghostBookshelf.Collection.forge([], {model: this}).fetch().
            then(function (collection) {
                collection.invokeThen('destroy', options);
            });
    }
});

Sessions = ghostBookshelf.Collection.extend({
    model: Session
});

module.exports = {
    Session: Session,
    Sessions: Sessions
};


text:
define([ "Body", "ui/BodyUI" ], function(Body, BodyUI)
{
    "use strict";
    QUnit.module("BodyUI");

    QUnit.test("BodyUI() Venus", function(assert)
    {
        // Setup.
        var bodyKey = Body.VENUS;
        var body = Body.properties[bodyKey];
        var isBump = false;
        var isSpecular = false;
        var callback = function(bodyUI)
        {
            // Verify.
            assert.ok(true, "test resumed from async operation");
            assert.ok(bodyUI);
            assert.equal(bodyUI.name, body.name);
            assert.equal(bodyUI.bodyKey, bodyKey);
            assert.equal(bodyUI.children.length, 1); // axis helper
            done();
        };

        // Run.
        var done = assert.async();
        new BodyUI(body, isBump, isSpecular, callback);
    });

    QUnit.test("BodyUI() Earth", function(assert)
    {
        // Setup.
        var bodyKey = Body.EARTH;
        var body = Body.properties[bodyKey];
        var isBump = true;
        var isSpecular = true;
        var callback = function(bodyUI)
        {
            // Verify.
            assert.ok(true, "test resumed from async operation");
            assert.ok(bodyUI);
            assert.equal(bodyUI.name, body.name);
            assert.equal(bodyUI.bodyKey, bodyKey);
            assert.equal(bodyUI.children.length, 1); // axis helper
            done();
        };

        // Run.
        var done = assert.async();
        new BodyUI(body, isBump, isSpecular, callback);
    });

    QUnit.test("BodyUI() Saturn", function(assert)
    {
        // Setup.
        var bodyKey = Body.SATURN;
        var body = Body.properties[bodyKey];
        var isBump = false;
        var isSpecular = false;
        var callback = function(bodyUI)
        {
            // Verify.
            assert.ok(true, "test resumed from async operation");
            assert.ok(bodyUI);
            assert.equal(bodyUI.name, body.name);
            assert.equal(bodyUI.bodyKey, bodyKey);
            assert.equal(bodyUI.children.length, 2); // ring and axis helper
            done();
        };

        // Run.
        var done = assert.async();
        new BodyUI(body, isBump, isSpecular, callback);
    });
});


text:
package alluxio.client.file.cache;

import static org.junit.Assert.assertThrows;

import alluxio.client.file.cache.evictor.CacheEvictorOptions;
import alluxio.client.file.cache.evictor.FIFOCacheEvictor;
import alluxio.client.file.cache.store.PageStoreDir;
import alluxio.client.file.cache.store.PageStoreOptions;
import alluxio.conf.AlluxioConfiguration;
import alluxio.conf.Configuration;
import alluxio.exception.PageNotFoundException;
import alluxio.metrics.MetricKey;
import alluxio.metrics.MetricsSystem;

import com.codahale.metrics.Gauge;
import com.google.common.collect.ImmutableList;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.nio.file.Paths;

/**
 * Tests for the {@link DefaultPageMetaStore} class.
 */
public class DefaultMetaStoreTest {
  protected final PageId mPage = new PageId("1L", 2L);
  protected final AlluxioConfiguration mConf = Configuration.global();
  protected PageStoreDir mPageStoreDir;
  protected PageInfo mPageInfo;
  protected DefaultPageMetaStore mMetaStore;
  protected Gauge mCachedPageGauge;

  @Rule
  public TemporaryFolder mTempFolder = new TemporaryFolder();

  /**
   * Sets up the instances.
   */
  @Before
  public void before() {
    MetricsSystem.clearAllMetrics();
    mPageStoreDir =
        PageStoreDir.createPageStoreDir(
            new CacheEvictorOptions().setEvictorClass(FIFOCacheEvictor.class),
            new PageStoreOptions().setRootDir(
                Paths.get(mTempFolder.getRoot().getAbsolutePath())));
    mPageInfo = new PageInfo(mPage, 1024,
        mPageStoreDir);
    mMetaStore = new DefaultPageMetaStore(ImmutableList.of(mPageStoreDir));
    mCachedPageGauge =
        MetricsSystem.METRIC_REGISTRY.getGauges().get(MetricKey.CLIENT_CACHE_PAGES.getName());
  }

  @Test
  public void addNew() {
    mMetaStore.addPage(mPage, mPageInfo);
    Assert.assertTrue(mMetaStore.hasPage(mPage));
    Assert.assertEquals(1, mCachedPageGauge.getValue());
  }

  @Test
  public void addExist() {
    mMetaStore.addPage(mPage, mPageInfo);
    mMetaStore.addPage(mPage, mPageInfo);
    Assert.assertTrue(mMetaStore.hasPage(mPage));
    Assert.assertEquals(1, mCachedPageGauge.getValue());
  }

  @Test
  public void removeExist() throws Exception {
    mMetaStore.addPage(mPage, mPageInfo);
    Assert.assertTrue(mMetaStore.hasPage(mPage));
    mMetaStore.removePage(mPage);
    Assert.assertFalse(mMetaStore.hasPage(mPage));
    Assert.assertEquals(0, mCachedPageGauge.getValue());
  }

  @Test
  public void removeNotExist() throws Exception {
    assertThrows(PageNotFoundException.class, () -> {
      Assert.assertEquals(mPageInfo, mMetaStore.removePage(mPage));
    });
    Assert.assertEquals(0, mCachedPageGauge.getValue());
  }

  @Test
  public void hasPage() {
    Assert.assertFalse(mMetaStore.hasPage(mPage));
    mMetaStore.addPage(mPage, mPageInfo);
    Assert.assertTrue(mMetaStore.hasPage(mPage));
  }

  @Test
  public void getPageInfo() throws Exception {
    mMetaStore.addPage(mPage, mPageInfo);
    Assert.assertEquals(mPageInfo, mMetaStore.getPageInfo(mPage));
  }

  @Test
  public void getPageInfoNotExist() throws Exception {
    assertThrows(PageNotFoundException.class, () -> mMetaStore.getPageInfo(mPage));
  }

  @Test
  public void evict() throws Exception {
    mMetaStore.addPage(mPage, mPageInfo);
    Assert.assertEquals(mPageInfo, mMetaStore.evict(mPageStoreDir));
    mMetaStore.removePage(mPageInfo.getPageId());
    Assert.assertNull(mMetaStore.evict(mPageStoreDir));
    Assert.assertEquals(0, mCachedPageGauge.getValue());
  }
}


text:
sshrc works just like ssh, but it also sources the ~/.sshrc on your local computer after logging in remotely.

    $ echo "echo welcome" >> ~/.sshrc
    $ sshrc me@myserver
    welcome

    $ echo "alias ..='cd ..'" >> ~/.sshrc
    $ sshrc me@myserver
    $ type ..
    .. is aliased to `cd ..'

You can use this to set environment variables, define functions, and run post-login commands. It's that simple, and it won't impact other users on the server - even if they use sshrc too. This makes sshrc very useful if you share a server with multiple users and can't edit the server's ~/.bashrc without affecting them, or if you have several servers that you don't want to configure independently.

## Installation

#### OS X

    $ brew install sshrc

#### Ubuntu (12.04 or 14.04+)

    $ sudo add-apt-repository ppa:russell-s-stewart/ppa
    $ sudo apt-get update
    $ sudo apt-get install sshrc

#### Everything else

    $ wget https://raw.githubusercontent.com/Russell91/sshrc/master/sshrc &&
    chmod +x sshrc &&
    sudo mv sshrc /usr/local/bin #or anywhere else on your PATH

## Advanced configuration

Your most import configuration files (e.g. vim, inputrc) may not be bash scripts. Put them in ~/.sshrc.d and sshrc will copy them to a (guaranteed) unique folder in the server's /tmp directory after login. You can find them at `$SSHHOME/.sshrc.d`. You can usually tell programs to load their configuration from the $SSHHOME/.sshrc.d directory by setting the right environment variables. Putting too much data in ~/.sshrc.d will slow down your login times. If the folder contents are > 64kB, the server may block your sshrc attempts.

### Vim

    $ mkdir -p ~/.sshrc.d
    $ echo ':imap <special> jk <Esc>' >> ~/.sshrc.d/.vimrc
    $ cat << 'EOF' >> ~/.sshrc
    export VIMINIT="let \$MYVIMRC='$SSHHOME/.sshrc.d/.vimrc' | source \$MYVIMRC"
    EOF
    $ sshrc me@myserver
    $ vim # jk -> normal mode will work

### Tmux

If you use tmux frequently, you can make sshrc work there as well. The following seems complicated, but hopefully it should just work.

    $ cat << 'EOF' >> ~/.sshrc
    alias foo='echo I work with tmux, too'

    tmuxrc() {
        local TMUXDIR=/tmp/russelltmuxserver
        if ! [ -d $TMUXDIR ]; then
            rm -rf $TMUXDIR
            mkdir -p $TMUXDIR
        fi
        rm -rf $TMUXDIR/.sshrc.d
        cp -r $SSHHOME/.sshrc $SSHHOME/bashsshrc $SSHHOME/sshrc $SSHHOME/.sshrc.d $TMUXDIR
        SSHHOME=$TMUXDIR SHELL=$TMUXDIR/bashsshrc /usr/bin/tmux -S $TMUXDIR/tmuxserver $@
    }
    export SHELL=`which bash`
    EOF
    $ sshrc me@myserver
    $ tmuxrc
    $ foo
    I work with tmux, too

The -S option will start a separate tmux server. You can still safely access the vanilla tmux server with `tmux`. Tmux servers can persist for longer than your ssh session, so the above `tmuxrc` function copies your configs to the more permenant /tmp/russelltmuxserver, which won't be deleted when you close your ssh session. Starting tmux with the SHELL environment variable set to bashsshrc will take care of loading your configs with each new terminal. Setting SHELL back to /bin/bash when you're done is important to prevent quirks due to tmux sessions having a non-default SHELL variable.

### Specializing .sshrc to individual servers

You may have different configurations for different servers. I recommend the following structure for your ~/.sshrc control flow:

    if [ $(hostname | grep server1 | wc -l) == 1 ]; then
        echo 'server1'
    fi
    if [ $(hostname | grep server2 | wc -l) == 1 ]; then
        echo 'server2'
    fi

### Tips

* I don't recommend trying to throw your entire .vim folder into ~/.sshrc.d. It will more than likely be too big.

* You can avoid duplication of dotfiles using symlinks (e.g. $ cd ~/.sshrc.d && ln -s ../.tmux.conf .tmux.conf/ ).

* For larger configurations, consider copying files to an obscure folder on the server and using ~/.sshrc to automatically source those configurations on login.

* To enable tab completion in zsh, add `compdef sshrc=ssh` to your .zshrc file:

[sshrc-git]: https://aur.archlinux.org/packages/sshrc-git


text:
package ru.mipt.acsl.geotarget.ui.layers;

import com.sun.javafx.geom.Vec3f;
import ru.mipt.acsl.geotarget.ui.ColoredSphere;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.layers.RenderableLayer;

/**
 * @author Artem Shein
 */
public class BlueSphereLayer extends RenderableLayer
{

    public static final double EARTH_RADIUS = 6_371_000.0;

    public BlueSphereLayer()
    {
        addRenderable(ColoredSphere.newInstance(Position.ZERO, EARTH_RADIUS - 1, new Vec3f(0.3f, 0.5f, 1f)));
    }
}


text:
import Evaluator from '../../../utils/Evaluator';

export default [
  {
    key: 'placeholder',
    ignore: true,
  },
  {
    type: 'checkbox',
    label: 'Open First Row when Empty',
    key: 'openWhenEmpty',
    tooltip: 'Check this if you would like to open up the first row when the EditGrid is empty',
    weight: 1000,
    input: true,
    conditional: {
      json: { '!==': [{ var: 'data.modal' }, true] },
    }
  },
  {
    type: 'checkbox',
    label: 'Disable Adding / Removing Rows',
    key: 'disableAddingRemovingRows',
    tooltip: 'Check if you want to hide Add Another button and Remove Row button',
    weight: 1001,
    input: true,
    clearOnHide: false,
    calculateValue: 'value = data.disableAddingRemovingRows;',
  },
  {
    type: 'checkbox',
    label: 'Display EditGrid as Table',
    key: 'displayAsTable',
    tooltip: 'use Table Template',
    weight: 1002,
    input: false,
    customConditional() {
      return !Evaluator.noeval;
    },
  },
  {
    weight: 1010,
    type: 'textarea',
    input: true,
    key: 'conditionalAddButton',
    label: 'Conditional Add Button',
    placeholder: 'show = ...',
    tooltip: 'Specify condition when Add Button should be displayed.',
    editor: 'ace',
    as: 'javascript',
    wysiwyg: {
      minLines: 3,
    },
  },
];


text:
<link rel="import" href="../../../bower_components/polymer/polymer.html">

<dom-module id="user-login">
  <template>
    <style is="custom-element">
      :host {
        @apply(--layout-vertical);
      }
    </style>
    <form></form>
  </template>
</dom-module>
<script>
  Polymer({
    is: 'user-login'
  });
</script>


text:
layout: model
title: Recognize Entities DL Pipeline for Swedish - Medium
author: John Snow Labs
name: entity_recognizer_md
date: 2021-03-22
tags: [open_source, swedish, entity_recognizer_md, pipeline, sv]
supported: true
task: [Named Entity Recognition, Lemmatization, Part of Speech Tagging]
language: sv
edition: Spark NLP 3.0.0
spark_version: 3.0
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

The entity_recognizer_md is a pretrained pipeline that we can use to process text with a simple pipeline that performs basic processing steps.
It performs most of the common text processing tasks on your dataframe

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
[Open in Colab](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/2da56c087da53a2fac1d51774d49939e05418e57/jupyter/annotation/english/explain-document-dl/Explain%20Document%20DL.ipynb){:.button.button-orange.button-orange-trans.co.button-icon}
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/models/entity_recognizer_md_sv_3.0.0_3.0_1616452368340.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python

from sparknlp.pretrained import PretrainedPipelinein
pipeline = PretrainedPipeline('entity_recognizer_md', lang = 'sv')
annotations =  pipeline.fullAnnotate(""Hej från John Snow Labs! "")[0]
annotations.keys()

```
```scala

val pipeline = new PretrainedPipeline("entity_recognizer_md", lang = "sv")
val result = pipeline.fullAnnotate("Hej från John Snow Labs! ")(0)

```

{:.nlu-block}
```python

import nlu
text = [""Hej från John Snow Labs! ""]
result_df = nlu.load('sv.ner.md').predict(text)
result_df

```
</div>

## Results

```bash
|    | document                      | sentence                     | token                                    | embeddings                   | ner                                   | entities            |
|---:|:------------------------------|:-----------------------------|:-----------------------------------------|:-----------------------------|:--------------------------------------|:--------------------|
|  0 | ['Hej från John Snow Labs! '] | ['Hej från John Snow Labs!'] | ['Hej', 'från', 'John', 'Snow', 'Labs!'] | [[0.4006600081920624,.,...]] | ['O', 'O', 'B-PER', 'I-PER', 'I-PER'] | ['John Snow Labs!'] |
```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|entity_recognizer_md|
|Type:|pipeline|
|Compatibility:|Spark NLP 3.0.0+|
|License:|Open Source|
|Edition:|Official|
|Language:|sv|


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:background="@drawable/ll_login_bg_shape"
              android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="10dp"
        android:background="@drawable/ll_login_box_bg"
        android:orientation="vertical">

        <EditText
            android:id="@+id/edt_loginPhone"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="@dimen/ll_text_margin_left_right"
            android:background="@null"
            android:ems="11"
            android:hint="@string/ll_hint_login_input_phone"
            android:inputType="number"
            android:singleLine="true"
            android:textColor="@color/ll_edt_input_color"
            android:textColorHint="@color/ll_hint_edt_color"
            android:textSize="@dimen/ll_edit_text_size"/>

        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_marginLeft="@dimen/ll_text_margin_left_right"
            android:layout_marginRight="@dimen/ll_text_margin_left_right"
            android:background="@color/ll_color_login_box_gb"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <EditText
                android:id="@+id/edt_loginPhoneVerify"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_marginLeft="@dimen/ll_text_margin_left_right"
                android:layout_weight="1"
                android:background="@null"
                android:hint="@string/ll_hint_login_phone_verify"
                android:inputType="number"
                android:singleLine="true"
                android:maxLength="6"
                android:textColor="@color/ll_edt_input_color"
                android:textColorHint="@color/ll_hint_edt_color"
                android:textSize="@dimen/ll_edit_text_size"/>

            <Button
                android:id="@+id/btn_phoneResendVerify"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:layout_marginRight="@dimen/ll_login_padding_left_right"
                android:background="@drawable/ll_get_code_btn_bg_normal"
                android:text="获取验证码"
                android:textColor="@color/ll_white"
                android:textSize="15sp"
                android:textStyle="bold"/>

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:background="@color/ll_color_login_box_gb"/>

        <EditText
            android:id="@+id/edt_loginPhonePassword"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:layout_marginLeft="@dimen/ll_text_margin_left_right"
            android:background="@null"
            android:hint="@string/ll_hint_login_user_password"
            android:singleLine="true"
            android:inputType="textPassword"
            android:maxLength="20"
            android:minEms="6"
            android:textColor="@color/ll_edt_input_color"
            android:textColorHint="@color/ll_hint_edt_color"
            android:textSize="@dimen/ll_edit_text_size"/>
    </LinearLayout>

    <Button
        android:id="@+id/btn_loginPhone"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="@drawable/ll_select_common_btn"
        android:text="注册登录"
        android:textColor="#ffffff"
        android:textSize="@dimen/ll_title_btn_text_size"
        android:textStyle="bold"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:text="@string/ll_warm_prompt"
        android:textColor="@color/ll_edt_input_color"
        android:textSize="12sp"/>

</LinearLayout>


text:
{% load inlines %}

{% if flatblock.header %}

{{ flatblock.header }}

{% endif %}

{{ flatblock.content|render_inlines|safe }}


text:
import random

def get_0_or_1():
    return random.getrandbits(1)

def get_random(limit):
    """

    get random number under limit,
    using only get_0_or_1function.

    :param limit: max number it generates
    :return: random number under limit
    """
    pass


text:
from __future__ import unicode_literals, absolute_import
import os
from django.test import override_settings
from mock import patch
from client.JobGetter import JobGetter
from client import settings
import subprocess
from client.tests import LiveClientTester, utils
import threading
import time
from ci import views
from ci.tests import utils as test_utils

@override_settings(INSTALLED_GITSERVERS=[test_utils.github_config()])
class Tests(LiveClientTester.LiveClientTester):
    def create_client_and_job(self, recipes_dir, name, sleep=1):
        c = utils.create_inl_client()
        os.environ["BUILD_ROOT"] = "/foo/bar"
        c.client_info["single_shot"] = True
        c.client_info["update_step_time"] = 1
        c.client_info["ssl_cert"] = False # not needed but will get another line of coverage
        c.client_info["server"] = self.live_server_url
        job = utils.create_client_job(recipes_dir, name=name, sleep=sleep)
        settings.SERVERS = [(self.live_server_url, job.event.build_user.build_key, False)]
        settings.CONFIG_MODULES[job.config.name] = ["moose-dev-gcc"]
        c.client_info["servers"] = [self.live_server_url]
        c.client_info["build_configs"] = [job.config.name]
        c.client_info["build_key"] = job.recipe.build_user.build_key
        return c, job

    def test_run_success(self):
        with test_utils.RecipeDir() as recipe_dir:
            c, job = self.create_client_and_job(recipe_dir, "RunSuccess", sleep=2)
            self.set_counts()
            c.run(single=True)
            self.compare_counts(num_clients=1, num_events_completed=1, num_jobs_completed=1, active_branches=1)
            utils.check_complete_job(self, job)

    def test_run_graceful(self):
        with test_utils.RecipeDir() as recipe_dir:
            c, job = self.create_client_and_job(recipe_dir, "Graceful", sleep=2)
            self.set_counts()
            c.client_info["poll"] = 1
            # graceful signal, should complete
            script = "sleep 3 && kill -USR2 %s" % os.getpid()
            proc = subprocess.Popen(script, shell=True, executable="/bin/bash", stdout=subprocess.PIPE)
            c.run()
            proc.wait()
            self.compare_counts(num_clients=1, num_events_completed=1, num_jobs_completed=1, active_branches=1)
            utils.check_complete_job(self, job)
            self.assertEqual(c.graceful_signal.triggered, True)
            self.assertEqual(c.cancel_signal.triggered, False)

    def test_run_cancel(self):
        with test_utils.RecipeDir() as recipe_dir:
            c, job = self.create_client_and_job(recipe_dir, "Cancel", sleep=4)
            self.set_counts()
            c.client_info["poll"] = 1
            # cancel signal, should stop
            script = "sleep 3 && kill -USR1 %s" % os.getpid()
            proc = subprocess.Popen(script, shell=True, executable="/bin/bash", stdout=subprocess.PIPE)
            c.run()
            proc.wait()
            self.compare_counts(num_clients=1, canceled=1, num_events_completed=1, num_jobs_completed=1, active_branches=1, events_canceled=1)
            self.assertEqual(c.cancel_signal.triggered, True)
            self.assertEqual(c.graceful_signal.triggered, False)
            utils.check_canceled_job(self, job)

    def test_run_job_cancel(self):
        with test_utils.RecipeDir() as recipe_dir:
            c, job = self.create_client_and_job(recipe_dir, "JobCancel", sleep=4)
            self.set_counts()
            # cancel response, should cancel the job
            thread = threading.Thread(target=c.run, args=(True,))
            thread.start()
            time.sleep(4)
            job.refresh_from_db()
            views.set_job_canceled(job)
            thread.join()
            self.compare_counts(num_clients=1, canceled=1, num_events_completed=1, num_jobs_completed=1, active_branches=1, events_canceled=1)
            self.assertEqual(c.cancel_signal.triggered, False)
            self.assertEqual(c.graceful_signal.triggered, False)
            utils.check_canceled_job(self, job)

    def test_run_job_invalidated_basic(self):
        with test_utils.RecipeDir() as recipe_dir:
            c, job = self.create_client_and_job(recipe_dir, "JobInvalidated", sleep=40)
            # stop response, should stop the job
            self.set_counts()
            thread = threading.Thread(target=c.run, args=(True,))
            thread.start()
            start_time = time.time()
            time.sleep(4)
            job.refresh_from_db()
            job.set_invalidated("Test invalidation", check_ready=True)
            thread.join()
            end_time = time.time()
            self.assertGreater(15, end_time-start_time)
            self.compare_counts(num_clients=1, invalidated=1, num_changelog=1)
            utils.check_stopped_job(self, job)

    def test_run_job_invalidated_nested_bash(self):
        with test_utils.RecipeDir() as recipe_dir:
            c, job = self.create_client_and_job(recipe_dir, "JobInvalidated", sleep=40)
            job.delete()
            job = utils.create_job_with_nested_bash(recipe_dir, name="JobWithNestedBash", sleep=40)
            # stop response, should stop the job
            self.set_counts()
            thread = threading.Thread(target=c.run, args=(True,))
            start_time = time.time()
            thread.start()
            time.sleep(4)
            job.refresh_from_db()
            job.set_invalidated("Test invalidation", check_ready=True)
            thread.join()
            end_time = time.time()
            self.assertGreater(15, end_time-start_time)
            self.compare_counts(num_clients=1, invalidated=1, num_changelog=1)
            utils.check_stopped_job(self, job)

    @patch.object(JobGetter, 'find_job')
    def test_exception(self, mock_getter):
        with test_utils.RecipeDir() as recipe_dir:
            # check exception handler
            mock_getter.side_effect = Exception("oh no!")
            c, job = self.create_client_and_job(recipe_dir, "JobStop", sleep=4)
            self.set_counts()
            c.run(single=True)
            self.compare_counts()

    def test_check_server_no_job(self):
        with test_utils.RecipeDir() as recipe_dir:
            # check no jobs
            c, job = self.create_client_and_job(recipe_dir, "JobStop", sleep=4)
            job.complete = True
            job.save()
            self.set_counts()
            c.check_server(settings.SERVERS[0])
            self.compare_counts(num_clients=1)

    @patch.object(JobGetter, 'find_job')
    def test_runner_error(self, mock_getter):
        with test_utils.RecipeDir() as recipe_dir:
            mock_getter.return_value = None
            c, job = self.create_client_and_job(recipe_dir, "JobError")
            self.set_counts()
            c.runner_error = True
            c.run()
            self.compare_counts()


text:
//
// Generated by fetch-leetcode-submission project on GitHub.
// https://github.com/gitzhou/fetch-leetcode-submission
// Contact Me: aaron67[AT]aaron67.cc
//
// Wildcard Matching
// https://leetcode.com/problems/wildcard-matching/
//

class Solution {
    public boolean isMatch(String s, String p) {
        /*
        Use a 2D array dp, and calculate the decision one by one. Again, the most tricky thing is
to decide the result when * is hit. There are three possibilities:

dp[i - 1][j]: * matches nothing
dp[i][j - 1]: * matches current char plus one or more previous chars of input string. It means, the pattern string p[0..i] (the latest char p[i] is *) matches the input string s[0..j-1]. Since * can match any char, of course p[0..i] can matches s[0..j] as well.
dp[i - 1][j - 1]: * matches current char of input string
Only one of the three possibilities is needed. The relevant code:

dp[i][j] = dp[i - 1][j] || dp[i][j - 1] || dp[i - 1][j - 1];
We can find case #2 includes case 3#: when p[0..i-1] matches s[0..j-1], and p[i] is '*', it's actually one of the possibilities of case #2. So the code can be simplified to:

dp[i][j] = dp[i - 1][j] || dp[i][j - 1];
        */

        int n = s.length(), m = p.length();
        // If both input string and pattern are empty, they are matched
        boolean[][] dp = new boolean[m + 1][n + 1];
        dp[0][0] = true;
        // For the first row (pattern is empty, and input string is not), the results are false by default
        // For the first column (input string is empty, and pattern is not):
        // If current pattern char is not '*', the result is false;
        // If current pattern char is '*', the result is previous row (dp[i - 1][0])
        for(int i = 1;i <= m;i++)dp[i][0] = p.charAt(i - 1) == '*' ? dp[i - 1][0] : false;
        for(int i = 1;i <= m;i++) {
            char pChr = p.charAt(i - 1);
            for(int j = 1;j <= n;j++) {
                char chr = s.charAt(j - 1);
                if(pChr == '?')dp[i][j] = dp[i - 1][j - 1];
                else if(pChr == '*')dp[i][j] = dp[i - 1][j] || dp[i][j - 1];
                else dp[i][j] = pChr == chr && dp[i - 1][j - 1];
            }
        }
        return dp[m][n];
    }
}


text:
package io.reactivex.rxjava3.testsupport;

import java.util.concurrent.TimeUnit;

import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.disposables.*;

/**
 * Basic scheduler that produces an ever increasing {@link #now(TimeUnit)} value.
 * Use this scheduler only as a time source!
 */
public final class TimesteppingScheduler extends Scheduler {

    final class TimesteppingWorker extends Worker {
        @Override
        public void dispose() {
        }

        @Override
        public boolean isDisposed() {
            return false;
        }

        @Override
        public Disposable schedule(Runnable run, long delay, TimeUnit unit) {
            run.run();
            return Disposable.disposed();
        }

        @Override
        public long now(TimeUnit unit) {
            return TimesteppingScheduler.this.now(unit);
        }
    }

    public long time;

    public boolean stepEnabled = true;

    @Override
    public Worker createWorker() {
        return new TimesteppingWorker();
    }

    @Override
    public long now(TimeUnit unit) {
        if (stepEnabled) {
            return time++;
        }
        return time;
    }
}


text:
layout: docs
title: 'DBCoreMutateRequest'
---

```ts
export type DBCoreMutateRequest =
  DBCoreAddRequest |
  DBCorePutRequest |
  DBCoreDeleteRequest |
  DBCoreDeleteRangeRequest;
```

Input argument to [DBCoreTable](DBCoreTable).mutate().

## See Also
* [DBCoreAddRequest](DBCoreAddRequest)
* [DBCorePutRequest](DBCorePutRequest)
* [DBCoreDeleteRequest](DBCoreDeleteRequest)
* [DBCoreDeleteRangeRequest](DBCoreDeleteRangeRequest)


text:
// Original file: deps/envoy-api/envoy/config/overload/v3/overload.proto

import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any';

export interface ResourceMonitor {
  /**
   * The name of the resource monitor to instantiate. Must match a registered
   * resource monitor type.
   * See the :ref:`extensions listed in typed_config below <extension_category_envoy.resource_monitors>` for the default list of available resource monitor.
   */
  'name'?: (string);
  'typed_config'?: (_google_protobuf_Any | null);
  /**
   * Configuration for the resource monitor being instantiated.
   * [#extension-category: envoy.resource_monitors]
   */
  'config_type'?: "typed_config";
}

export interface ResourceMonitor__Output {
  /**
   * The name of the resource monitor to instantiate. Must match a registered
   * resource monitor type.
   * See the :ref:`extensions listed in typed_config below <extension_category_envoy.resource_monitors>` for the default list of available resource monitor.
   */
  'name': (string);
  'typed_config'?: (_google_protobuf_Any__Output | null);
  /**
   * Configuration for the resource monitor being instantiated.
   * [#extension-category: envoy.resource_monitors]
   */
  'config_type': "typed_config";
}


text:
package com.bernardomg.example.jpa.test.config.criteria.collection;

import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

import com.bernardomg.example.jpa.model.collection.CollectionEntity;
import com.bernardomg.example.jpa.model.collection.CollectionEntity_;

/**
 * Factory for creating criteria API queries for the {@link CollectionEntity}.
 *
 * @author Bernardo Martínez Garrido
 */
public class CollectionEntityCriteriaFactory {

    /**
     * Generates a query to find all the entities with a specified value.
     *
     * @param entityManager
     *            the entity manager with the entity's data
     * @param value
     *            the value to search for
     * @return the query to find all the entities with the specified value
     */
    public static final CriteriaQuery<CollectionEntity> findAllWithValue(
            final EntityManager entityManager, final Integer value) {
        final CriteriaBuilder builder;               // Builder
        final CriteriaQuery<CollectionEntity> query; // Query
        final Root<CollectionEntity> entity;         // Root entity

        // Prepares the criteria API query
        builder = entityManager.getCriteriaBuilder();
        query = builder.createQuery(CollectionEntity.class);
        entity = query.from(CollectionEntity.class);

        // Generates a select query
        query.select(entity);
        query.where(
                builder.isMember(value, entity.get(CollectionEntity_.values)));

        // Orders by the id
        query.orderBy(builder.asc(entity.get(CollectionEntity_.id)));

        return query;
    }

    /**
     * Private constructor to avoid initialization.
     */
    private CollectionEntityCriteriaFactory() {
        super();
    }

}


text:
'''
Created on 21.01.2016

@author: fabian
'''
import unittest
import os

from pyvcsshark.config import Config

class ConfigTest(unittest.TestCase):

    def test_load_config_from_file(self):
        config = Config()
        config.load_from_file(os.path.dirname(os.path.realpath(__file__))+"/data/testconfig.cfg")

        self.assertEqual("admin", config.db_authentication)
        self.assertEqual("mongo", config.db_driver)
        self.assertEqual("root", config.db_user)
        self.assertEqual("test", config.db_password)
        self.assertEqual("testRun", config.db_database)
        self.assertEqual("localhost", config.db_hostname)
        self.assertEqual(27017, config.db_port)
        self.assertEqual("..", config.uri)

    def test_config_default(self):
        config = Config()

        self.assertEqual("admin", config.db_authentication)
        self.assertEqual("mongo", config.db_driver)
        self.assertEqual("root", config.db_user)
        self.assertEqual("root", config.db_password)
        self.assertEqual("vcsSHARK", config.db_database)
        self.assertEqual("localhost", config.db_hostname)
        self.assertEqual(27017, config.db_port)
        self.assertEqual(".", config.uri)

if __name__ == "__main__":
    unittest.main()


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/menu_manage_manager_cancel_bg_pressed" android:state_pressed="true"/>
    <item android:drawable="@drawable/menu_manage_manager_cancel_bg_normal" />

</selector>


text:
(function($) {
	// Set the utilities plugin
	$.glamUtilities = function(settings)
	{
		settings = $.extend({}, $.glamUtilities.defaults, settings);

		// Method to search for all links and add a target='_blank' to it
		function changeExternalLinks()
		{
			var links = $('a');
			var l_length = links.length;
			var external_links = [];
			for (var i=0;i<l_length;i++)
			{
				var href = $(links[i]).attr('href');

				if (href !== undefined && href.match(/^https?\:/i) && !href.match(document.domain))
				{
					external_links.push(links[i]);
				}
			}
			var $extlinks = $(external_links);

			if(settings.externalLinks === true)
			{
				$extlinks.attr('target','_blank');
			}

			if(settings.externalClass !== false)
			{
				$extlinks.addClass(settings.externalClass);
			}
		}

		// Method to set defaultValue as a inside label for text inputs and textareas
		function setInsideLabels(text_inputs)
		{
			var $inputs = (text_inputs === true) ? $("form input[type=text], form textarea, form input[type=email]") : text_inputs;

			$inputs.each(function(){
				var input = $(this);
				input.click(function(){
					if(input.val() == this.defaultValue){
						input.val("");
					}
				});
				input.blur(function(){
					if(input.val() == ""){
						input.val(this.defaultValue);
					}
				});
			});

		}

		// Method to extend the jQuery Validate plugin with a rule for defaultValue
		function setValidateDefault(presets)
		{
			// Test if validator is not undefined
			if(jQuery.validator !== undefined)
			{
				var method = (presets.name !== undefined) ? presets.name : settings.validateDefaultMethod;
				var error = (presets.error !== undefined) ? presets.error : settings.validateDefaultErrorMessage;

				jQuery.validator.addMethod(method, function(value, element) {
					return this.optional(element) || element.defaultValue != value;
				}, error);
			}
		}

		// Look which custom methods has to be called
		function init()
		{
			if(settings.externalClass !== false || settings.externalLinks === true){changeExternalLinks();}
			if(settings.defaultValueAsLabel !== false){setInsideLabels(settings.defaultValueAsLabel);}
			if(settings.validateDefaultValue !== false){setValidateDefault(settings.validateDefaultValue);}
		}

		init();
	};

	// Default settings for Utilities plugin
	$.glamUtilities.defaults =
	{
		debug: false,
		externalLinks: true,
		externalClass: 'external',
		defaultValueAsLabel: false,
		validateDefaultValue: false,
		validateDefaultMethod: 'defaultValue',
		validateDefaultErrorMessage: 'The field can\'t be the default value'
	};

	// Glamorous SCROLLING
	$.glamScroll = function(selector, speed)
	{
		speed = (speed !== undefined) ? speed : 500;
		$('html,body').animate({
			scrollTop: $(selector).offset().top
		}, speed);
	};

	// Glamorous LOGGING
	$.glamLog = function(message, type, plugin)
	{
		var msg = '['+type+'] '+plugin+' - '+message;
		if(window.console !== undefined) {
			switch(type)
			{
				case 'DEBUG':
					console.debug(msg);
					break;
				case 'INFO':
					console.info(msg);
					break;
				case 'WARN':
					console.warn(msg);
					break;
				case 'ERROR':
					console.error(msg);
					break;
				default:
				case 'LOG':
					console.log(msg);
					break;
			}
		} else {
			alert(msg);
		}
	};

	// Extend Array to have a "unique"-function to remove duplicates
	Array.prototype.unique = function()
	{
		var arr = [];
		loop:for(var i=0, m=this.length; i<m; i++)
		{
			for(var j=0, n=arr.length; j<n; j++)
			{
				if(arr[j]==this[i])
				{
					continue loop;
				}
			}
			arr[arr.length] = this[i];
		}
		return arr;
	};
})(jQuery);

// Method to test if a variable or jQuery object exists
function isset(element, checkempty)
{
	if(typeof element == 'string')
	{
		return (typeof window[element] != 'undefined');
	}
	else if(typeof element == 'undefined')
	{
		return false;
	}
	else
	{
		return (checkempty != false) ? element.length > 0 : true;
	}
}


text:
<?php

/**
 * @var $this yii\web\View
 * @var $model \skeeks\cms\models\CmsContentElement
 */

$image = null;
if (isset($model->image)) {
    $image = $model->image;
} elseif (isset($model->cmsImage)) {
    $image = $model->cmsImage;
}
/**
 * @var $controller \skeeks\cms\backend\controllers\BackendModelController
 */
$controller = $this->context;

$isEmpty = \skeeks\cms\backend\helpers\BackendUrlHelper::createByParams()->setBackendParamsByCurrentRequest()->isEmptyLayout;
?>
<?php if (!$isEmpty) : ?>

        <a href="<?php echo \yii\helpers\Url::to([$controller->defaultAction]); ?>" style="    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 26px;
    color: #656464;">
            ← Вернуться назад

<?php endif; ?>

    <? if ($image) : ?>

            <img style="border: 2px solid #ededed; border-radius: 5px;" src="<?php echo \Yii::$app->imaging->getImagingUrl($image->src,
                new \skeeks\cms\components\imaging\filters\Thumbnail()); ?>"/>

    <? endif; ?>

            <?php echo $controller->modelShowName; ?>

             <?php echo $model->id; ?>
            <? if (isset($model->created_at) && $model->created_at) : ?>
                <span style="margin-left: 5px;" data-toggle="tooltip" title="Запись создана в базе: <?php echo \Yii::$app->formatter->asDatetime($model->created_at); ?>"> <?php echo \Yii::$app->formatter->asDate($model->created_at); ?>
            <? endif; ?>
            <? if (isset($model->created_by) && $model->created_by) : ?>
                <span style="margin-left: 5px;" data-toggle="tooltip" title="Запись создана пользователем с ID: <?php echo $model->createdBy->id; ?>"> <?php echo $model->createdBy->shortDisplayName; ?>
            <? endif; ?>

    <?php

    $modelActions = $controller->modelActions;
    $deleteAction = \yii\helpers\ArrayHelper::getValue($modelActions, "delete");

    if($deleteAction) : ?>
        <?php

            $actionData = [
                "url"               => $deleteAction->url,

                //TODO:// is deprecated
                "isOpenNewWindow"   => true,
                "confirm"           => isset($deleteAction->confirm) ? $deleteAction->confirm : "",
                "method"            => isset($deleteAction->method) ? $deleteAction->method : "",
                "request"           => isset($deleteAction->request) ? $deleteAction->request : "",
                "size"           => isset($deleteAction->size) ? $deleteAction->size : "",
            ];
            $actionData = \yii\helpers\Json::encode($actionData);

            $href = \yii\helpers\Html::a('', "#", [
                'onclick' => "new sx.classes.backend.widgets.Action({$actionData}).go(); return false;",
                'class' => "btn btn-default",
                'data-toggle' => "tooltip",
                'title' => "Удалить"
            ]);
        ?>

            <?php echo $href; ?>

    <?php endif; ?>