text:
from numscons.checkers.common import \
    save_and_set, restore, get_initialized_perflib_config

# Performance library checks
def _check_perflib(context, autoadd, info):
    context.Message("Checking for %s ... " % info.name)

    if info.disabled():
        context.Result('no - disabled from user environment')
        return 0

    saved = save_and_set(context.env, info._core, info._core.keys())
    ret = context.TryLink(info.test_code, extension='.c')
    if not ret or not autoadd:
        restore(context.env, saved)

    context.Result(ret)
    return ret

def CheckAtlas(context, autoadd=1, check_version=0):
    return _check_perflib(context, autoadd,
            get_initialized_perflib_config(context.env, 'Atlas'))

def CheckMkl(context, autoadd=1, check_version=0):
    return _check_perflib(context, autoadd,
            get_initialized_perflib_config(context.env, 'Mkl'))

def CheckAccelerate(context, autoadd=1, check_version=0):
    return _check_perflib(context, autoadd,
            get_initialized_perflib_config(context.env, 'Accelerate'))


text:
package org.eclipse.jnosql.artemis.document;

import jakarta.nosql.document.DocumentObserverParser;
import jakarta.nosql.mapping.reflection.ClassMapping;
import jakarta.nosql.mapping.reflection.ClassMappings;

import java.util.Optional;

final class DocumentMapperObserver  implements DocumentObserverParser {

    private final ClassMappings mappings;

    DocumentMapperObserver(ClassMappings mappings) {
        this.mappings = mappings;
    }

    @Override
    public String fireEntity(String entity) {
        Optional<ClassMapping> mapping = getClassMapping(entity);
        return mapping.map(ClassMapping::getName).orElse(entity);
    }

    @Override
    public String fireField(String entity, String field) {
        Optional<ClassMapping> mapping = getClassMapping(entity);
        return mapping.map(c -> c.getColumnField(field)).orElse(field);
    }

    private Optional<ClassMapping> getClassMapping(String entity) {
        Optional<ClassMapping> bySimpleName = mappings.findBySimpleName(entity);
        if (bySimpleName.isPresent()) {
            return bySimpleName;
        }
        return mappings.findByClassName(entity);
    }

}

redpajama_set_name: RedPajamaGithub


text:
class DirectoryLoader
	: public MinCOM::CommonImpl< TrainersManagerKit::ITrainersLoader >
{
public:
	DirectoryLoader();
	virtual ~DirectoryLoader();

	// ITrainersLoader declarations section
	virtual result SetArgumentName(const StringA& argName, const StringA& value);

	virtual ComponentsKit::IComponentLoader* LoadFirstTrainer();
	virtual ComponentsKit::IComponentLoader* LoadNextTrainer();

	// ICommon declarations section
	virtual result						QueryInterface(REFIID iid, void** ppObject);

private:

	typedef std::pair<const StringA, const StringA> ArgumentsPair;
	typedef std::map<ArgumentsPair::first_type, ArgumentsPair::second_type>::iterator ArgumentsIterator;

	std::map<ArgumentsPair::first_type, ArgumentsPair::second_type> arguments_;

	_finddata_t fileInfo_;
	intptr_t searchDone_;
	StringA folderName_;

};

#endif // !DIRECTORYLOADER_H__TRAINERSMANAGER__INCLUDED_


text:
package main

import (
	"fmt"
	"github.com/nocd5/gookmark/utils"
	"os"

	"github.com/codegangsta/cli"
)

func Contains(s []string, e string) bool {
	for _, _s := range s {
		if _s == e {
			return true
		}
	}
	return false
}

func ReplaceArgsByAlias(src []string) []string {
	var dest []string
	var subcommands []string

	config, err := LoadConfig()
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		return src
	}

	for _, cmd := range Commands {
		subcommands = append(subcommands, cmd.Name)
	}

	replaceEnd := false
	for _, arg := range src {
		if replaceEnd {
			dest = append(dest, arg)
			continue
		}

		if Contains(subcommands, arg) {
			replaceEnd = true
		}

		alias := config.Alias[arg]
		if len(alias) > 0 {
			result, err := utils.Split(alias, ' ', '"')
			if err != nil {
				fmt.Fprintln(os.Stderr, err)
				return src
			}
			dest = append(dest, result...)
			replaceEnd = true
		} else {
			dest = append(dest, arg)
		}
	}

	return dest
}

func main() {
	app := cli.NewApp()
	app.Name = "gookmark"
	app.Version = Version
	app.Usage = ""
	app.Author = "nocd5"
	app.Email = "nocd5rd@gmail.com"
	app.Commands = Commands

	app.Run(ReplaceArgsByAlias(os.Args))
}


text:
require 'backports/tools/alias_method_chain'

module Backports
  # Metaprogramming utility to make block optional.
  # Tests first if block is already optional when given options
  def self.make_block_optional(mod, *methods)
    mod = class << mod; self; end unless mod.is_a? Module
    options = methods.last.is_a?(Hash) ? methods.pop : {}
    methods.each do |selector|
      unless mod.method_defined? selector
        warn "#{mod}##{selector} is not defined, so block can't be made optional"
        next
      end
      unless options[:force]
        # Check if needed
        test_on = options.fetch(:test_on)
        result =  begin
                    test_on.send(selector, *options.fetch(:arg, []))
                  rescue LocalJumpError
                    false
                  end
        next if result.class.name =~ /Enumerator$/
      end
      require 'enumerator'
      arity = mod.instance_method(selector).arity
      last_arg = []
      if arity < 0
        last_arg = ["*rest"]
        arity = -1-arity
      end
      arg_sequence = ((0...arity).map{|i| "arg_#{i}"} + last_arg + ["&block"]).join(", ")

      alias_method_chain(mod, selector, :optional_block) do |aliased_target, punctuation|
        mod.module_eval <<-end_eval, __FILE__, __LINE__ + 1
          def #{aliased_target}_with_optional_block#{punctuation}(#{arg_sequence})
            return to_enum(:#{aliased_target}_without_optional_block#{punctuation}, #{arg_sequence}) unless block_given?
            #{aliased_target}_without_optional_block#{punctuation}(#{arg_sequence})
          end
        end_eval
      end
    end
  end
end


text:
package org.axonframework.test.matchers;

import org.axonframework.test.FixtureExecutionException;

import java.lang.reflect.Field;

/**
 * FieldFilter implementation that rejects a given Field
 *
 * @author Allard Buijze
 * @since 2.4.1
 */
public class IgnoreField implements FieldFilter {

    private Field ignoredField;

    /**
     * Initialize an instance that ignores the given {@code field}
     *
     * @param field The field to ignore
     */
    public IgnoreField(Field field) {
        this.ignoredField = field;
    }

    /**
     * Initialize an instance that ignores the a field with given {@code fieldName}, which is declared on the
     * given
     * {@code clazz}.
     *
     * @param clazz     The type that declares the field
     * @param fieldName The name of the field
     * @throws FixtureExecutionException when the given fieldName is not declared on given clazz.
     */
    public IgnoreField(Class<?> clazz, String fieldName) {
        try {
            ignoredField = clazz.getDeclaredField(fieldName);
        } catch (NoSuchFieldException e) {
            throw new FixtureExecutionException("The given field does not exist", e);
        }
    }

    @Override
    public boolean accept(Field field) {
        return !field.equals(ignoredField);
    }
}


text:
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2016-2017 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0

package com.google.appinventor.client.editor.simple.components;

import com.google.appinventor.client.ComponentsTranslation;
import com.google.appinventor.client.editor.simple.SimpleEditor;
import com.google.appinventor.client.editor.simple.components.utils.SVGPanel;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.json.client.JSONObject;

public class MockLineString extends MockMapFeatureBase {
  public static final String TYPE = "LineString";
  private static final String PROPERTY_NAME_POINTS = "PointsFromString";
  private JavaScriptObject svgContent = null;

  public MockLineString(SimpleEditor editor) {
    super(editor, TYPE, images.linestring());

    SVGPanel svgpanel = new SVGPanel();
    svgpanel.setPixelSize(42, 42);
    svgpanel.setInnerSVG("<path d=\"M0 0L42.4264 42.4624\" stroke-width=\"3\" stroke=\"black\" />");
    panel.setWidget(svgpanel);
    panel.setWidth("42px");
    panel.setHeight("42px");

    initLine();
  }

  static MockLineString fromGeoJSON(MockFeatureCollection parent, JSONObject properties, JavaScriptObject layer) {
    MockLineString line = new MockLineString(parent.editor);
    line.feature = layer;
    line.preserveLayerData();
    line.processFromGeoJSON(parent, properties);
    return line;
  }

  @Override
  public boolean onDrop(MockMap map, int x, int y, int offsetX, int offsetY) {
    MockMap.LatLng nw = map.projectFromXY(x - offsetX, y - offsetY);
    MockMap.LatLng se = map.projectFromXY(x - offsetX + 42, y - offsetY + 42);
    setPoints2(nw.toNative(), se.toNative());
    String pointstr = "[[" + nw.latitude + "," + nw.longitude + "],[" + se.latitude + "," + se.longitude + "]]";
    getProperties().changePropertyValue(PROPERTY_NAME_POINTS, pointstr);
    super.onPropertyChange(PROPERTY_NAME_POINTS, pointstr);
    return true;
  }

  @Override
  public void onPropertyChange(String propertyName, String newValue) {
    super.onPropertyChange(propertyName, newValue);

    if (propertyName.equals(PROPERTY_NAME_POINTS)) {
      setPointsStr(newValue);
    }
  }

  @Override
  public int getPreferredWidth() {
    return 42;
  }

  @Override
  public int getPreferredHeight() {
    return 42;
  }

  @Override
  protected boolean isPropertyVisible(String propertyName) {
    if (propertyName.equals(PROPERTY_NAME_WIDTH) ||
        propertyName.equals(PROPERTY_NAME_HEIGHT)) {
      return false;
    }
    return super.isPropertyVisible(propertyName);
  }

  private void updatePointsStr(String points) {
    getProperties().changePropertyValue(PROPERTY_NAME_POINTS, points);
    super.onPropertyChange(PROPERTY_NAME_POINTS, points);
  }

  // JSNI methods
  private native void initLine()/*-{
    this.@com.google.appinventor.client.editor.simple.components.MockMapFeatureBase::feature =
      top.L.polyline([], {
        className: 'leaflet-interactive',
        weight: 3,
        color: '#000',
        draggable: true,
        pointerEvents: 'auto'
      });
  }-*/;

  private native void setPoints2(JavaScriptObject nw, JavaScriptObject se)/*-{
    var polyline = this.@com.google.appinventor.client.editor.simple.components.MockMapFeatureBase::feature;
    polyline.setLatLngs([nw, se]);
  }-*/;

  private native void setPointsStr(String values)/*-{
    try {
      if (values != '') {
        var points = JSON.parse(values);
        var polyline = this.@com.google.appinventor.client.editor.simple.components.MockMapFeatureBase::feature;
        polyline.setLatLngs(points);
        if (polyline.editor) polyline.editor.reset();  // reset vertices of the editor
      }
    } catch(e) {
      // pass
    }
  }-*/;

  protected native void addToMap(JavaScriptObject map)/*-{
    var el = this.@com.google.appinventor.client.editor.simple.components.MockLineString::getElement()();
    var polyline = this.@com.google.appinventor.client.editor.simple.components.MockMapFeatureBase::feature;
    map.addLayer(polyline);
    if (!polyline.clickHandler) {
      while (el.lastChild) el.removeChild(el.lastChild);  // clear the div
      polyline.clickHandler = function(e) {
        this.@com.google.appinventor.client.editor.simple.components.MockLineString::select()();
        if (e.originalEvent) e.originalEvent.stopPropagation();
      };
      polyline.dragHandler = function() {
        var points = polyline.getLatLngs();
        var str = '[';
        for (var i = 0; i < points.length; i++) {
          if (i > 0) str += ',';
          str += '[' + points[i].lat + ',' + points[i].lng + ']';
        }
        str += ']';
        if (str == '[]') str = '';
        this.@com.google.appinventor.client.editor.simple.components.MockLineString::updatePointsStr(*)(str);
      };
      polyline.on('click dragstart editable:dragstart editable:vertex:dragstart editable:vertex:clicked',
        polyline.clickHandler, this);
      polyline.on('dragend editable:dragend editable:vertex:dragend editable:vertex:deleted',
        polyline.dragHandler, this);
    }
    el = polyline.getElement();
    el.style['pointer-events'] = 'auto';
    el.style['cursor'] = 'pointer';
    this.@com.google.appinventor.client.editor.simple.components.MockMapFeatureBase::setNativeTooltip(*)(
      this.@com.google.appinventor.client.editor.simple.components.MockMapFeatureBase::getTooltip()()
    );
  }-*/;

  private native void preserveLayerData()/*-{
    var line = this.@com.google.appinventor.client.editor.simple.components.MockMapFeatureBase::feature;
    if (line) {
      var latlngs = line.getLatLngs();
      var resultJson = [];
      if (latlngs[0] instanceof top.L.LatLng) {
        for (var i = 0; i < latlngs.length; i++) {
          resultJson.push([latlngs[i].lat, latlngs[i].lng]);
        }
      } else if (latlngs[0][0] instanceof top.L.LatLng) {
        for (var i = 0; i < latlngs[0].length; i++) {
          resultJson.push([latlngs[0][i].lat, latlngs[0][i].lng]);
        }
      } else {
        for (var i = 0; i < latlngs.length; i++) {
          var part = [];
          for (var j = 0; j < latlngs[i].length; j++) {
            part.push([latlngs[i][j].lat, latlngs[i][j].lng]);
          }
          resultJson.push(part);
        }
      }
    }
    this.@com.google.appinventor.client.editor.simple.components.MockLineString::updatePointsStr(*)(JSON.stringify(resultJson));
  }-*/;

}


text:
title: Telerik.Web.UI.ImageEditor.SavedEventArgs
description: Telerik.Web.UI.ImageEditor.SavedEventArgs
slug: Telerik.Web.UI.ImageEditor.SavedEventArgs
---

# Telerik.Web.UI.ImageEditor.SavedEventArgs : Sys.EventArgs

## Inheritance Hierarchy

* Sys.EventArgs
* *[Telerik.Web.UI.ImageEditor.SavedEventArgs]({%slug Telerik.Web.UI.ImageEditor.SavedEventArgs%})*

## Methods

###  get_fileName

Returns the current ImageOperation client object.

#### Parameters

#### Returns

`Telerik.Web.UI.ImageEditor.ImageOperation`

### get_argument

Returns the argument passed through the server-side ImageSaving event.

#### Parameters

#### Returns

`String`

### get_isSaved

Returns the image saving result.

#### Parameters

#### Returns

`Boolean`

### get_message

Returns the save action applied on the image.

#### Parameters

#### Returns

`String` The possible values for the save action are "SaveClient", "SaveServer" and "ApplyChanges".


text:
"""
"""
from make_juypter_toc import headers_to_table

def test_headers_to_tables_no_headers():
    table = headers_to_table(None, "test")
    assert table is None

def test_headers_to_tables_one_level_nesting():
    example_data = [
            u'#Introduction',
            u'#Why Flask?\n',
            u'#Topics Not Covered\n']
    table = headers_to_table(example_data, "test_name")
    expected_table = [
            u'* [Introduction](http://localhost:8888/notebooks/test_name#Introduction)',
            u'* [Why Flask?](http://localhost:8888/notebooks/test_name#Why-Flask?)',
            u'* [Topics Not Covered](http://localhost:8888/notebooks/test_name#Topics-Not-Covered)',]
    assert table == expected_table

def test_headers_to_tables_two_level_nesting():
    example_data = [
            u'#Introduction',
            u'##Why Flask?\n',
            u'#Topics Not Covered\n']
    table = headers_to_table(example_data, "test_name")
    expected_table = [
            u'* [Introduction](http://localhost:8888/notebooks/test_name#Introduction)',
            u'    * [Why Flask?](http://localhost:8888/notebooks/test_name#Why-Flask?)',
            u'* [Topics Not Covered](http://localhost:8888/notebooks/test_name#Topics-Not-Covered)',]
    assert table == expected_table

def test_headers_to_tables_three_level_nesting():
    example_data = [
            u'#Introduction',
            u'##Why Flask?\n',
            u'###Topics Not Covered\n',
            u'#Routes\n',]
    table = headers_to_table(example_data, "test_name")
    expected_table = [
            u'* [Introduction](http://localhost:8888/notebooks/test_name#Introduction)',
            u'    * [Why Flask?](http://localhost:8888/notebooks/test_name#Why-Flask?)',
            u'        * [Topics Not Covered](http://localhost:8888/notebooks/test_name#Topics-Not-Covered)',
            u'* [Routes](http://localhost:8888/notebooks/test_name#Routes)',]
    assert table == expected_table


text:
System.register([], function (_export) {
  "use strict";

  _export("isClass", isClass);

  function isUpperCase(char) {
    return char.toUpperCase() === char;
  }

  function isClass(clsOrFunction) {
    if (clsOrFunction.name) {
      return isUpperCase(clsOrFunction.name.charAt(0));
    }

    return Object.keys(clsOrFunction.prototype).length > 0;
  }
  return {
    setters: [],
    execute: function () {
      if (!(function f() {}).name) {
        Object.defineProperty(Function.prototype, "name", {
          get: function () {
            var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
            Object.defineProperty(this, "name", { value: name });
            return name;
          }
        });
      }
    }
  };
});


text:
<?php
/**
 * Created by PhpStorm.
 * User: vanstr
 * Date: 13.12.12
 * Time: 22:14
 */

class Aboutus extends Model{

    public $tplName = 'aboutus';

    public function __construct() {
        d_Echo("Model class constructed : ". get_class ($this) );
    }

    public function getModelHeaderHTML() {
        return '<link rel="stylesheet" href="' . DIR_WEB_VIEW . 'css/about.css" type="text/css" media="screen" />';
    }

    public function render() {

        $this->tpl->assign("aboutusHeader", $this->getTextByName("aboutusHeader"));
        $this->tpl->assign("aboutusInfo", $this->getTextByName("aboutusInfo"));
        $this->tpl->assign("aboutusTeamHeader", $this->getTextByName("aboutusTeamHeader"));
        $this->tpl->assign("aboutusTeam", $this->getTextByName("aboutusTeam"));

        // add header scripts
        $this->tpl->assign("modelHeader", $this->getModelHeaderHTML());

        $modelHTML = $this->tpl->draw($this->tplName, $return_string = true);

        return $modelHTML;
    }

}


text:
<chapter name="Flavour Selection">

Flavour Selection

The StringFlav class handles the choice of a new flavour
in the fragmentation process, and the production of a new hadron
from a set of input flavours. It is mainly used by the string
fragmentation machinery (including ministrings), but also e.g.
in some particle decays and for some beam-remnant cases. The basic
concepts are in agreement with <ref>And83</ref>. The baryon-sector
implementation is based on the MSTJ(12)=3 option of
PYTHIA 6, i.e. new SU(6) weights scheme with at most one popcorn meson.

The relative production rates of different particle species is
influenced by the parameters below. Some have only an impact on
one specific quantity, but most directly or indirectly have
consequences for many observables. Therefore the values to use have
to be viewed in the context of a complete <aloc href="Tunes">tune</aloc>.

New flavours

The main parameters of the selection of a new flavour are

<parm name="StringFlav:probStoUD" default="0.217" min="0.0" max="1.0">
the suppression of <ei>s</ei> quark production relative to ordinary
<ei>u</ei> or <ei>d</ei> one.
</parm>

<parm name="StringFlav:probQQtoQ" default="0.081" min="0.0" max="1.0">
the suppression of diquark production relative to quark production,
i.e. of baryon relative to meson production.
</parm>

<parm name="StringFlav:probSQtoQQ" default="0.915" min="0.0" max="1.0">
the suppression of strange diquark production relative to light
diquark production, over and above the one already given by
probStoU.
</parm>

<parm name="StringFlav:probQQ1toQQ0" default="0.0275" min="0.0" max="1.0">
the suppression of spin 1 diquark production relative to spin 0 one,
apart from the factor of 3 enhancement of spin 1 from counting the
number of states.
</parm>

<pvec name="StringFlav:probQQ1toQQ0join" default="0.5,0.7,0.9,1.0"
min="0.0" max="1.0">
when two already produced quarks are to be combined to a diquark,
e.g. in the junction framework, these numbers give the suppression
of spin 1 diquark production relative to spin 0 one, apart from the
factor of 3 enhancement of spin 1 from counting the number of states.
The four components give the suppression when the heaviest quark is
<ei>u/d</ei>, <ei>s</ei>, <ei>c</ei> or <ei>b</ei>, respectively.
These parameters are seldom used and currently not constrained by any
data, so very much a guesswork. Character-string input of this vector
should be as a comma-separated list, without any blanks.
</pvec>

Standard-meson production

The bulk of the particle production corresponds to the lowest-lying
pseudoscalar and vector multiplets. Their production rates are
determined by the parameters in this section.

For a given set of flavours, produced according to the probabilities
outlined above, the ratio of vector-to-pseudocalar meson production
is described by the parameters below.
The maximum allowed rate for each case has been set according to
spin-counting rules, but we expect the real rates to be lower,
especially for lighter mesons, owing to the vector-pseudoscalar
mass splitting.

<parm name="StringFlav:mesonUDvector" default="0.50" min="0." max="3.">
the relative production ratio vector/pseudoscalar for light
(<ei>u</ei>, <ei>d</ei>) mesons.
</parm>
<parm name="StringFlav:mesonSvector" default="0.55" min="0." max="3.">
the relative production ratio vector/pseudoscalar for strange mesons.
</parm>
<parm name="StringFlav:mesonCvector" default="0.88" min="0." max="3.">
the relative production ratio vector/pseudoscalar for charm mesons.
</parm>
<parm name="StringFlav:mesonBvector" default="2.20" min="0." max="3.">
the relative production ratio vector/pseudoscalar for bottom mesons.
</parm>

Inside each light-quark meson nonet, an octet-singlet mixing angle
describes the mixing of the two flavour-diagonal isoscalar = 0 states.
(For terminology and details see <ref>Yao06</ref>, chapter 14 on the
quark model.)
This angle is needed to specify the probability for such a <ei>q qbar</ei>
state to project onto a specific meson. More transparent formulae are
obtained by introducing the angle <ei>alpha = theta + 54.7</ei> degrees:
<eq>
   f  = (uubar + ddbar)/sqrt(2) * sin(alpha) + ssbar * cos(alpha)

   f' = (uubar + ddbar)/sqrt(2) * cos(alpha) - ssbar * sin(alpha)
</eq>

<parm name="StringFlav:thetaPS" default="-15." min="-90." max="90.">
gives the mixing angle <ei>theta_PS</ei> in the pseudoscalar meson sector
(which is rather poorly determined), expressed in degrees.
Here <ei>f</ei> is associated with <ei>eta'</ei> and <ei>f'</ei> with
<ei>eta</ei>. (This standard but counterintuitive choice is fixed up
in the code by replacing <ei>alpha → 90^0 - alpha</ei> so that
<ei>eta ↔ eta'</ei>; relative signs do not matter since we are
interested in probabilities only.)
</parm>

<parm name="StringFlav:thetaV" default="36." min="-90." max="90.">
gives the mixing angle <ei>theta_V</ei> in the vector meson sector
(which is somewhat better determined), expressed in degrees.
Here <ei>f</ei> is associated with <ei>omega</ei> and <ei>f'</ei>
with <ei>phi</ei>.
</parm>

Further, the simple model overestimates the production of <ei>eta</ei>
and, in particular, <ei>eta'</ei> mesons, which can be rectified by

<parm name="StringFlav:etaSup" default="0.60" min="0." max="1.">
the additional suppression of <ei>eta</ei> production, multiplying the
normal production probability. Thus 0 means no <ei>eta</ei> at all
are produced, while 1 means full rate.
</parm>

<parm name="StringFlav:etaPrimeSup" default="0.12" min="0." max="1.">
the additional suppression of <ei>eta'</ei> production, multiplying the
normal production probability. Thus 0 means no <ei>eta'</ei> at all
are produced, while 1 means full rate.
</parm>

Excited-meson production

Several excited mesons, ie. with radial or orbital excitations, have been
observed at non-negligible production rates. Extrapolated to all states
a fair fraction of all particle production might proceed through such
states. There are big uncertainties, however, since these excited
mesons in many cases are extremely poorly known. This also means that
the modeling of their production and decay is very primitive, and
even that the inclusion of the production of such states may lead to a
degraded agreement with data. Currently the default is that all such
production is switched off.

Parameters are provided to switch them on. By demand, this machinery
has been made more flexible than in the past. Therefore one parameter is
provided for each combination of heaviest flavour
(<ei>u/d</ei>, <ei>s</ei>, <ei>c</ei> or <ei>b</ei>) and
multiplet produced. In each case the production rate is normalized to
that of the lowest-lying pseudoscalar of the same flavour content, as for
the vector-meson rates introduced above. The multiplets available are the
four obtained for one unit of orbital angular momentum, in the
nonrelativistic classification. Using <ei>J</ei> to denote the sum of
quark spin <ei>S</ei> and orbital angular momentum <ei>L</ei>, i.e. what
would normally be called the spin of the meson, one has:

a pseudovector multiplet with <ei>L=1, S=0, J=1</ei>;

a scalar multiplet with <ei>L=1, S=1, J=0</ei>;

a pseudovector multiplet with <ei>L=1, S=1, J=1</ei>;

a tensor multiplet with <ei>L=1, S=1, J=2</ei>.

The maximum allowed rate for each case has been set according to
spin-counting rules, but we expect the real rates to be significantly
lower, owing to mass suppression.

<parm name="StringFlav:mesonUDL1S0J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=0,J=1)</ei>/pseudoscalar
for light (<ei>u</ei>, <ei>d</ei>) mesons.
</parm>

<parm name="StringFlav:mesonUDL1S1J0" default="0.0" min="0." max="1.">
the relative scalar production ratio
<ei>(L=1,S=1,J=0)</ei>/pseudoscalar
for light (<ei>u</ei>, <ei>d</ei>) mesons.
</parm>

<parm name="StringFlav:mesonUDL1S1J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=1,J=1)</ei>/pseudoscalar
for light (<ei>u</ei>, <ei>d</ei>) mesons.
</parm>

<parm name="StringFlav:mesonUDL1S1J2" default="0.0" min="0." max="5.">
the relative tensor production ratio
<ei>(L=1,S=1,J=2)</ei>/pseudoscalar
for light (<ei>u</ei>, <ei>d</ei>) mesons.
</parm>

<parm name="StringFlav:mesonSL1S0J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=0,J=1)</ei>/pseudoscalar
for strange mesons.
</parm>

<parm name="StringFlav:mesonSL1S1J0" default="0.0" min="0." max="1.">
the relative scalar production ratio
<ei>(L=1,S=1,J=0)</ei>/pseudoscalar
for strange mesons.
</parm>

<parm name="StringFlav:mesonSL1S1J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=1,J=1)</ei>/pseudoscalar
for strange mesons.
</parm>

<parm name="StringFlav:mesonSL1S1J2" default="0.0" min="0." max="5.">
the relative tensor production ratio
<ei>(L=1,S=1,J=2)</ei>/pseudoscalar
for strange mesons.
</parm>

<parm name="StringFlav:mesonCL1S0J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=0,J=1)</ei>/pseudoscalar
for charm mesons.
</parm>

<parm name="StringFlav:mesonCL1S1J0" default="0.0" min="0." max="1.">
the relative scalar production ratio
<ei>(L=1,S=1,J=0)</ei>/pseudoscalar
for charm mesons.
</parm>

<parm name="StringFlav:mesonCL1S1J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=1,J=1)</ei>/pseudoscalar
for charm mesons.
</parm>

<parm name="StringFlav:mesonCL1S1J2" default="0.0" min="0." max="5.">
the relative tensor production ratio
<ei>(L=1,S=1,J=2)</ei>/pseudoscalar
for charm mesons.
</parm>

<parm name="StringFlav:mesonBL1S0J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=0,J=1)</ei>/pseudoscalar
for bottom mesons.
</parm>

<parm name="StringFlav:mesonBL1S1J0" default="0.0" min="0." max="1.">
the relative scalar production ratio
<ei>(L=1,S=1,J=0)</ei>/pseudoscalar
for bottom mesons.
</parm>

<parm name="StringFlav:mesonBL1S1J1" default="0.0" min="0." max="3.">
the relative pseudovector production ratio
<ei>(L=1,S=1,J=1)</ei>/pseudoscalar
for bottom mesons.
</parm>

<parm name="StringFlav:mesonBL1S1J2" default="0.0" min="0." max="5.">
the relative tensor production ratio
<ei>(L=1,S=1,J=2)</ei>/pseudoscalar
for bottom mesons.
</parm>

In addition, an octet-singlet mixing angle is needed for each multiplet,
as for the pseudoscalar and vector multiplets above. Only for the
tensor multiplet does any determination exist; for the other multiplets
default has been chose so that <ei>ssbar</ei> does not mix with the light
quarks, and so that the <ei>ssbar</ei> state is the heavier of the two.

<parm name="StringFlav:thetaL1S0J1" default="35.3" min="-90." max="90.">
gives the mixing angle <ei>theta</ei> in the <ei>(L=1,S=0,J=1)</ei>
pseudovector meson sector, expressed in degrees.
</parm>

<parm name="StringFlav:thetaL1S1J0" default="35.3" min="-90." max="90.">
gives the mixing angle <ei>theta</ei> in the <ei>(L=1,S=1,J=0)</ei>
scalar meson sector, expressed in degrees.
</parm>

<parm name="StringFlav:thetaL1S1J1" default="35.3" min="-90." max="90.">
gives the mixing angle <ei>theta</ei> in the <ei>(L=1,S=1,J=1)</ei>
pseudovector meson sector, expressed in degrees.
</parm>

<parm name="StringFlav:thetaL1S1J2" default="28.0" min="-90." max="90.">
gives the mixing angle <ei>theta</ei> in the <ei>(L=1,S=1,J=2)</ei>
tensor meson sector, expressed in degrees.
</parm>

Baryon production

The relative rate of baryon production is mainly given by the quark
and diquark production parameters above, plus SU(6) Clebsch-Gordans.
The one modifiable parameter related to these coefficients is

<parm name="StringFlav:decupletSup" default="1.0" min="0.0" max="1.0">
the suppression, relative to default SU(6) factors, of decuplet
baryon production. Default corresponds to no suppression, while 0
corresponds to no decuplet production at all.
</parm>

In addition, if popcorn production is allowed, wherein a set of mesons
(<ei>M</ei>) may be produced in between the baryon (<ei>B</ei>) and
the antibaryon (<ei>Bbar</ei>), a set of further parameters is introduced.
Currently only the simplest scenario is implemented, wherein at most
one intermediate meson may be produced.

<parm name="StringFlav:popcornRate" default="0.5" min="0." max="2.0">
gives the relative rates of <ei>B Bbar</ei> and <ei>B M Bbar</ei>
production, roughly as
<eq>
Prob(B M Bbar) / (Prob(B Bbar) + Prob(B M Bbar)) =
popcornRate / (0.5 + popcornRate)
</eq>
(the complete expression depends on all the quark and diquark production
parameters and is therefore not so useful).
</parm>

<parm name="StringFlav:popcornSpair" default="0.9" min="0." max="1.0">
extra suppression for having an <ei>s sbar</ei> pair shared between
the <ei>B</ei> and <ei>Bbar</ei> in a <ei>B M Bbar</ei> configuration.
</parm>

<parm name="StringFlav:popcornSmeson" default="0.5" min="0." max="1.0">
extra suppression for having a strange meson <ei>M</ei> in a
<ei>B M Bbar</ei> configuration.
</parm>

Finally, there are some indications that leading-baryon production
may be further suppressed. A proper description should probably be
based on a suppression of early production times <ref>Ede97</ref>,
but we here only implement a simpler version where production near
the end of a string, as defined by rank, is suppressed. The more
detailed studies suggest that leading <ei>c</ei> and <ei>b</ei> baryon
production will be less suppressed, so we leave it open to set
light- and heavy-baryon suppression separately.

<flag name="StringFlav:suppressLeadingB" default="off">
Suppress leading-baryon production.
<option value="off">No suppression.</option>
<option value="on">Suppress the production of a diquark in the string
breaking closest to a quark end of a string, by either of the factors
below. This suppresses the production of first-rank baryons by the same
amount. Indirectly also the second-rank and, if popcorn production is
switched on, third-rank (anti)baryon production is affected. </option>
</flag>

<parm name="StringFlav:lightLeadingBSup" default="0.5" min="0." max="1.0">
extra suppression of leading-baryon production for a light-quark
jet, i.e. <ei>d</ei>, <ei>u</ei> or <ei>s</ei>, when
suppressLeadingB = on. Thus 0 means no leading-baryon
production at all, while 1 means full rate.
</parm>

<parm name="StringFlav:heavyLeadingBSup" default="0.9" min="0." max="1.0">
extra suppression of leading-baryon production for a heavy-quark
jet, i.e. <ei>c</ei> or <ei>b</ei>, when
suppressLeadingB = on. Thus 0 means no leading-baryon
production at all, while 1 means full rate.
</parm>

</chapter>


text:
using System;

namespace Adaptive.Arp.Api
{
     /**
        Object for reporting orientation change events for device and display.

        @author Carlos Lozano Diez
        @since v2.0.5
        @version 1.0
     */
     public class RotationEvent : APIBean
     {

          /**
             The orientation we're rotating to. This is the future orientation when the state of the event is
WillStartRotation. This will be the current orientation when the rotation is finished with the state
DidFinishRotation.
          */
          public ICapabilitiesOrientation Destination { get; set; }
          /**
             The orientation we're rotating from. This is the current orientation when the state of the event is
WillStartRotation. This will be the previous orientation when the rotation is finished with the state
DidFinishRotation.
          */
          public ICapabilitiesOrientation Origin { get; set; }
          /**
             The state of the event to indicate the start of the rotation and the end of the rotation event. This allows
for functions to be pre-emptively performed (veto change, re-layout, etc.) before rotation is effected and
concluded.
          */
          public RotationEventState State { get; set; }
          /**
             The timestamps in milliseconds when the event was fired.
          */
          public long Timestamp { get; set; }

          /**
             Default constructor.

             @since V2.0.5
          */
          public RotationEvent()  {
          }

          /**
             Convenience constructor.

             @param Origin      Source orientation when the event was fired.
             @param Destination Destination orientation when the event was fired.
             @param State       State of the event (WillBegin, DidFinish).
             @param Timestamp   Timestamp in milliseconds when the event was fired.
             @since V2.0.5
          */
          public RotationEvent(ICapabilitiesOrientation origin, ICapabilitiesOrientation destination, RotationEventState state, long timestamp) : base () {
               this.Origin = Origin;
               this.Destination = Destination;
               this.State = State;
               this.Timestamp = Timestamp;
          }

          /**
             Gets the destination orientation of the event.

             @return Destination orientation.
             @since V2.0.5
          */
          public ICapabilitiesOrientation GetDestination() {
               return this.Destination;
          }

          /**
             Sets the destination orientation of the event.

             @param Destination Destination orientation.
             @since V2.0.5
          */
          public void SetDestination(ICapabilitiesOrientation Destination) {
               this.Destination = Destination;
          }

          /**
             Get the origin orientation of the event.

             @return Origin orientation.
             @since V2.0.5
          */
          public ICapabilitiesOrientation GetOrigin() {
               return this.Origin;
          }

          /**
             Set the origin orientation of the event.

             @param Origin Origin orientation
             @since V2.0.5
          */
          public void SetOrigin(ICapabilitiesOrientation Origin) {
               this.Origin = Origin;
          }

          /**
             Gets the current state of the event.

             @return State of the event.
             @since V2.0.5
          */
          public RotationEventState GetState() {
               return this.State;
          }

          /**
             Sets the current state of the event.

             @param State The state of the event.
             @since V2.0.5
          */
          public void SetState(RotationEventState State) {
               this.State = State;
          }

          /**
             Gets the timestamp in milliseconds of the event.

             @return Timestamp of the event.
             @since V2.0.5
          */
          public long GetTimestamp() {
               return this.Timestamp;
          }

          /**
             Sets the timestamp in milliseconds of the event.

             @param Timestamp Timestamp of the event.
             @since V2.0.5
          */
          public void SetTimestamp(long Timestamp) {
               this.Timestamp = Timestamp;
          }

     }
}

/**
------------------------------------| Engineered with ♥ in Barcelona, Catalonia |--------------------------------------
*/


text:
import { bindActionCreators, compose } from 'redux'
import { connect } from 'react-redux'
import Detail from './Detail'
import * as ToastActions from '../../redux/actions/toast'
import { firebaseConnect, getVal, populate } from 'react-redux-firebase'

function mapDispatchToProps(dispatch) {
  return bindActionCreators(ToastActions, dispatch)
}

const populates = [
  { child: 'product', root: 'products' },
  { child: 'version', root: 'versions' }
]
export default compose(
  firebaseConnect([{ path: 'assets', populates }]),
  connect(
    ({ firebase }) => ({
      assets: populate(firebase, 'assets', populates, undefined),
      auth: getVal(firebase, 'auth', undefined)
    }),
    mapDispatchToProps
  )
)(Detail)


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GestionFacturas.Dominio
{
    [Serializable]
    public  class FiltroBusquedaFactura
    {
        public FiltroBusquedaFactura()
        {
            LineasPorPagina = 25;
        }

        public int? IdCliente { get; set; }

        public string NombreOEmpresaCliente { get; set; } = string.Empty;

        public DateTime? FechaDesde { get; set; }

        public DateTime? FechaHasta { get; set; }

        public string SerieFactura { get; set; } = string.Empty;

        public string Conceptos { get; set; } = string.Empty;

        public string Comando { get; set; } = string.Empty;

        private int _indicePagina;

        public int IndicePagina
        {
            get { return _indicePagina <= 0 ? 1 : _indicePagina; }
            set { _indicePagina = value; }
        }

        public int LineasPorPagina { get; set; }

        public OrdenFacturasEnum OrdenarPorEnum { get; set; }

        public bool TieneValores
        {
            get
            {
                return !string.IsNullOrEmpty(NombreOEmpresaCliente) ||
                    FechaDesde.HasValue || FechaHasta.HasValue ||
                    !string.IsNullOrEmpty(Comando) ||
                    IdCliente.HasValue;
            }
        }
    }
    public enum OrdenFacturasEnum
    {
        [Display(Name = @"Número")]
        NumeroDesc = 0,
        [Display(Name = @"Número (antiguas)")]
        NumeroAsc = 1,
        [Display(Name = @"Fecha")]
        FechaDesc = 2,
        [Display(Name = @"Fecha (antiguas)")]
        FechaAsc = 3,

    }
}


text:
import csv
from locus.models import Location, DataSet, Category
from random import choice

""" just a dirty script for importing csv location data from http://www.poi-factory.com/ for testing """

categories = [
    ('Trains','trains'),
    ('Planes','planes'),
    ('Brains','brains'),
]
for category in categories:
    c = Category()
    c.name = category[0]
    c.shortname = category[1]
    c.save()

categories = list(Category.objects.all())

dataset = DataSet()
dataset.name = "Wal-Mart"
dataset.shortname = "walmart"
dataset.save()

with open('walmart.csv','r') as csvfile:
    reader = csv.reader(csvfile, delimiter=',', quotechar='"')
    for row in reader:
        try:
            loc = Location()

            loc.longitude = float(row[0])
            loc.latitude = float(row[1])
            loc.name = row[2]

            address = row[3].split(',')

            loc.addr1 = address[0]

            if len(address) > 6:
                # there is an addr2+
                loc.addr2 = address[1]

            loc.city = address[-5]
            loc.state = address[-4]
            loc.zip = address[-3]
            loc.phone = address[-2]

            loc.save()

            loc.datasets.add(dataset)
            loc.categories.add(choice(categories))
            loc.categories.add(choice(categories))

        except Exception as e:
            print e


text:
//
//  ZOEAlertView.m
//  AiyoyouCocoapods
//
//  Created by aiyoyou on 2017/2/7.
//  Copyright © 2017年 zoenet. All rights reserved.
//

#import "ZOEAlertView.h"
#import "ZOECommonHead.h"

#define kalertViewW (300*_scale)

//默认属性参数
#define klineSpacing                (5*_scale)
#define kmessageFontSize            (15*_scale)
#define kmessageTextColor           [UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1]
#define koKButtonTitleTextColor     [UIColor colorWithRed:0 green:162/255.0 blue:1 alpha:1]

@interface ZOEAlertView()<UITextFieldDelegate,UITextViewDelegate>
{
    BOOL _keyboardIsVisible;
}
@property (nonatomic,strong) UIView                     *alertContentView;
@property (nonatomic,strong) UILabel                    *titleLabel;
@property (nonatomic,strong) MessageContentView         *messageContentView;
@property (nonatomic,strong) UIView                     *operationalView;

@property (nonatomic,copy)   NSString                   *title;
@property (nonatomic,copy)   NSString                   *message;
@property (nonatomic,copy)   NSString                   *cancelButtonTitle;
@property (nonatomic,strong) NSMutableArray             *otherButtonTitles;
@property (nonatomic,assign) BOOL                       animated;
@property (nonatomic,assign) NSInteger                  clickButtonIndex;
@property (nonatomic,assign) BOOL                       isVisible;//控件可见性
@property (nonatomic,assign) ZOEStyle                   zoeStyle;
@property (nonatomic,copy) void(^myBlock)(NSInteger buttonIndex);
@property (nonatomic,copy) BOOL(^shouldDisBlock)(NSInteger buttonIndex);
@property (nonatomic,copy) void(^didDisBlock)(NSInteger buttonIndex);
@property (nonatomic,assign) BOOL                       isRedraw_showWithBlock;//调用showWithBlock 方法时是否需要重绘,默认不需要重绘。
@property (nonatomic,strong) UILabel                    *tipLabel;//提示性信息
@end

@implementation ZOEAlertView
@synthesize buttonHeight = _buttonHeight;
@synthesize scale   = _scale;
//初始化

- (instancetype)initWithTitle:(NSString*)title message:(NSString*)message  cancelButtonTitle:(NSString*)cancelButtonTitle otherButtonTitles:(NSString*)otherButtonTitles, ...
{
    self = [super initWithFrame:[UIScreen mainScreen].bounds];
    if (self) {
        //默认参数初始化
        [self scale];
        self.backgroundColor    = [UIColor colorWithWhite:0 alpha:0.3];
        NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
        [center  addObserver:self selector:@selector(keyboardWillShow)  name:UIKeyboardWillShowNotification  object:nil];
        [center addObserver:self selector:@selector(keyboardWillHide)  name:UIKeyboardWillHideNotification object:nil];
        _keyboardIsVisible = NO;
        _lineSpacing            = klineSpacing;
        _titleFontSize          = ktitleFontSize;
        _messageFontSize        = kmessageFontSize;
        _buttonFontSize         = kbuttonFontSize;
        _titleTextColor         = ktitleTextColor;
        _messageTextColor       = kmessageTextColor;
        _buttonTextColor        = kbuttonTextColor;
        _messageTextAlignment   = NSTextAlignmentCenter;
        _cancelButtonIndex      = 0;
        _title                  = title;
        _message                = message;
        _cancelButtonTitle      = cancelButtonTitle;
        _textFieldPlaceholder   = @"";
        _disAble                = YES;
        _zoeStyle               = ZOEAlertViewStyleAlert;

        //添加子控件
        [self addSubview:self.alertContentView];
        //添加titleLabel
        if (_title&&_title.length>0) {
            [_alertContentView addSubview:self.titleLabel];
            _titleLabel.text = _title;
        }
        //添加消息详细Label
        if (_message&&_message.length>0) {
            self.messageContentView.messageLabel.font           = [UIFont systemFontOfSize:_messageFontSize];
            self.messageContentView.messageLabel.textColor      = _messageTextColor;
            self.messageContentView.paragraphStyle.lineSpacing  = _lineSpacing;
            [self.messageContentView attrStrWithMessage:_message];
            [self.messageContentView addSubview:self.messageContentView.messageLabel];
            [_alertContentView addSubview:self.messageContentView];
        }

        //取消按钮
        if (_cancelButtonTitle&&_cancelButtonTitle.length>0) {
            UIButton *cancelButton = [ZOEAlertView createButton];
            [cancelButton setTitle:_cancelButtonTitle forState:UIControlStateNormal];
            [cancelButton addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
            [cancelButton setTitleColor:_buttonTextColor forState:UIControlStateNormal];
            [cancelButton.titleLabel setFont:[UIFont systemFontOfSize:_buttonFontSize]];
            [self.otherButtonTitles addObject:cancelButton];
        }
        //添加other按钮
        if (otherButtonTitles) {
            [self addButtonWithTitle:otherButtonTitles];
            va_list argList;  //定义一个 argList 指针来访问参数表
            va_start(argList, otherButtonTitles);  //初始化 argList,让它指向第一个变参,otherButtonTitles 这里是第一个参数,虽然加了s,它不是数组。
            id arg;
            while ((arg = va_arg(argList, id))) //调用 argList 依次取出 参数,它会自带指向下一个参数
            {
                [self addButtonWithTitle:arg];
            }
            va_end(argList); // 收尾,记得关闭关闭 va_list
        }
        [self.alertContentView addSubview:self.operationalView];
        _isRedraw_showWithBlock = NO;
        [self drawLine];
        //配置frame
        [self configFrame];
    }

    return self;
}

- (void)setDelegate:(id<ZOEAlertViewDelegate>)delegate {
    _delegate = delegate;
    if ([self.delegate respondsToSelector:@selector(messageContentViewWithZOEAlertView:)]) {
        if (_messageContentView) {
            [_messageContentView removeFromSuperview];
            _messageContentView = nil;
        }
        _messageContentView = [self.delegate messageContentViewWithZOEAlertView:self];
        [self configFrame];
        [_alertContentView addSubview:self.messageContentView];
    }
}

//展示控件
- (void)showWithBlock:(void (^)(NSInteger))block {
    _myBlock = block;
    _animated = NO;
    if (self.otherButtonTitles.count) {
        if (_isRedraw_showWithBlock) {
            _isRedraw_showWithBlock = NO;
            [self drawLine];
            [self configFrame];
        }
        if (!_isVisible) {
            UIWindow *window = [[[UIApplication sharedApplication]delegate]window];
            [window endEditing:YES];
        }
        if (_alertViewStyle == ZOEAlertViewStyleDefault) {
            if (!_isVisible)[[ZOEWindow shareInstance] endEditing:NO];
        }else {
            [self.messageContentView.textField becomeFirstResponder];
        }
        _isVisible = YES;
        //如果alertView重复调用show方法,先将数组中原来的对象移除,然后继续添加到数组的最后面,
        for (UIView *alertVeiw in [ZOEWindow shareStackArray]) {
            if (alertVeiw == self) {
                alertVeiw.hidden = NO;
                [[ZOEWindow shareStackArray] removeObject:alertVeiw];
                break;
            }
        }
        [[ZOEWindow shareStackArray] addObject:self];
        [[ZOEWindow shareInstance].rootViewController.view addSubview:self];
        [ZOEWindow shareInstance].hidden = NO;
        //有新的alertView被展现,所以要将前一个alertView暂时隐藏
        if ([ZOEWindow shareStackArray].count-1>0) {
            UIView *alertView = [ZOEWindow shareStackArray][[ZOEWindow shareStackArray].count-2];
            alertView.hidden = YES;
        }

        //设置延迟解决UILabel渲染缓慢的问题。
        self.alertContentView.alpha = 0;
        [UIView animateWithDuration:0 delay:0.00001 options:UIViewAnimationOptionTransitionNone animations:^{
            self.alertContentView.alpha = 1;
        } completion:^(BOOL finished) {
        }];
    }else {
        [ZOEWindow shareInstance].hidden = YES;
    }
}

- (void)showWithBlock:(void(^)(NSInteger buttonIndex))block animated:(BOOL)animated {
    [self showWithBlock:block];
    _animated = animated;
    if (_animated) {
        if (self.otherButtonTitles.count) {
            __block CGPoint center = self.alertContentView.center;
            center.y -= 100;
            self.alertContentView.center = center;
            /**
             usingSpringWithDamping 弹动比率 0~1,数值越小,弹动效果越明显
             initialSpringVelocity 则表示初始的速度,数值越大一开始移动越快,值得注意的是,初始速度取值较高而时间较短时,也会出现反弹情况
             **/
            [UIView animateWithDuration:1 delay:0.00001 usingSpringWithDamping:0.3 initialSpringVelocity:10 options:UIViewAnimationOptionTransitionNone animations:^{
                center.y += 100;
                self.alertContentView.center = center;
            } completion:^(BOOL finished) {
            }];
        }
    }
}

//动态配置子控件的位置及大小
- (void)configFrame {
    //必须至少有一个操作按钮才能展现控件
    if (self.otherButtonTitles.count) {
        CGFloat allBtnH = _otherButtonTitles.count<3?self.buttonHeight:self.buttonHeight*_otherButtonTitles.count;
        CGFloat alertViewH = allBtnH+21*_scale;//底部按钮操作区域高度+21点的空白

        //title区域frame设置
        if (_titleLabel) {
            alertViewH += 21*_scale+_titleLabel.font.pointSize;
            _titleLabel.frame = CGRectMake(15*_scale,21*_scale,kalertViewW-30*_scale,_titleLabel.font.pointSize);
        }

        //message区域frame设置
        if ([self.delegate respondsToSelector:@selector(heightForMessageContentView)]) {
            //代理对象自定的messageContentView模板frame设置
            CGFloat y = 28*_scale;
            alertViewH += 28*_scale;
            if (_titleLabel) {
                y = (21+28)*_scale+_titleLabel.font.pointSize;
            }
            CGFloat msgContentViewheight = [self.delegate heightForMessageContentView];
            self.messageContentView.frame = CGRectMake(28*_scale,y,kalertViewW-56*_scale,msgContentViewheight);
            alertViewH += msgContentViewheight;
        }else {
            //默认messageContentView模板frame设置
            if (_message&&_message.length>0) {
                CGFloat y = 28*_scale;
                alertViewH += 28*_scale;
                if (_titleLabel) {
                    y = (21+28)*_scale+_titleLabel.font.pointSize;
                }
                self.messageContentView.frame = CGRectMake(28*_scale,y,kalertViewW-56*_scale,0);
                self.messageContentView.messageLabel.frame = self.messageContentView.bounds;
                [self.messageContentView attrStrWithMessage:_message];
                [self.messageContentView.messageLabel sizeToFit];
                CGFloat textFieldH = 0;
                if (self.alertViewStyle != ZOEAlertViewStyleDefault) {
                    textFieldH =44*_scale;
                }
                //alertViewH大于屏幕高度-200,那么对这个判断做等法判断出相等时messageContentView的高度
                if (self.messageContentView.messageLabel.frame.size.height+alertViewH+textFieldH>self.frame.size.height-200*_scale) {
                    self.messageContentView.frame = CGRectMake(28*_scale,y,kalertViewW-56*_scale,self.frame.size.height-200*_scale-alertViewH);
                    if (self.alertViewStyle != ZOEAlertViewStyleDefault) {
                        self.messageContentView.messageLabel.frame =CGRectMake(0,0,kalertViewW-56*_scale,self.frame.size.height-200*_scale-alertViewH-textFieldH);
                        [self textFieldConfigByAlertViewStyleWithY:CGRectGetMaxY(self.messageContentView.messageLabel.frame)];
                    }else {
                        self.messageContentView.messageLabel.frame =CGRectMake(0,0,kalertViewW-56*_scale,self.frame.size.height-200*_scale-alertViewH);
                    }
                }else {
                    self.messageContentView.frame = CGRectMake(28*_scale,y,kalertViewW-56*_scale,self.messageContentView.messageLabel.frame.size.height+textFieldH);
                    if (self.alertViewStyle != ZOEAlertViewStyleDefault) {
                        self.messageContentView.messageLabel.frame =CGRectMake(0,0,kalertViewW-56*_scale,self.messageContentView.frame.size.height-textFieldH);
                        [self textFieldConfigByAlertViewStyleWithY:CGRectGetMaxY(self.messageContentView.messageLabel.frame)];
                    }else {
                        self.messageContentView.messageLabel.frame =CGRectMake(0,0,kalertViewW-56*_scale,self.messageContentView.messageLabel.frame.size.height);
                    }
                }

                //使用sizeToFit之后对齐方式失效,
                self.messageContentView.messageLabel.lineBreakMode = NSLineBreakByTruncatingTail;
                self.messageContentView.messageLabel.textAlignment = _messageTextAlignment;
                alertViewH += self.messageContentView.frame.size.height;
            }else {
                if (self.alertViewStyle != ZOEAlertViewStyleDefault) {
                    CGFloat y = 28*_scale;
                    alertViewH += 28*_scale;
                    if (_titleLabel) {
                        y = (21+28)*_scale+_titleLabel.font.pointSize;
                    }
                    self.messageContentView.frame = CGRectMake(28*_scale,y,kalertViewW-56*_scale,34*_scale);
                    [self textFieldConfigByAlertViewStyleWithY:-10*_scale];
                    self.messageContentView.messageLabel.lineBreakMode = NSLineBreakByTruncatingTail;
                    self.messageContentView.messageLabel.textAlignment = _messageTextAlignment;
                    alertViewH += self.messageContentView.frame.size.height;
                }
            }
        }

        //按钮操作区frame设置
        self.operationalView.frame = CGRectMake(0,alertViewH-allBtnH,kalertViewW,allBtnH);
        if (_otherButtonTitles.count == 2) {
            UIButton *btn = _otherButtonTitles[0];
            UIButton *btn1 = _otherButtonTitles[1];
            btn.frame = CGRectMake(0,0,kalertViewW/2.0,self.buttonHeight);
            btn1.frame = CGRectMake(kalertViewW/2.0,0,kalertViewW/2.0,self.buttonHeight);
        }else {
            for (int i=0;i<_otherButtonTitles.count;i++) {
                UIButton *btn = _otherButtonTitles[i];
                btn.frame = CGRectMake(0,(_otherButtonTitles.count-1-i)*self.buttonHeight,kalertViewW,self.buttonHeight);
            }
        }
        _alertContentView.frame = CGRectMake(0,0,kalertViewW,alertViewH);
        self.alertContentView.center = self.center;
    }
}

- (void)textFieldConfigByAlertViewStyleWithY:(CGFloat)y {
    if (self.alertViewStyle == ZOEAlertViewStylePlainTextInput) {
        self.messageContentView.textField.secureTextEntry = NO;
        self.messageContentView.textField.placeholder = _textFieldPlaceholder;
        self.messageContentView.textField.font = [UIFont systemFontOfSize:_messageFontSize];
        self.messageContentView.textField.frame = CGRectMake(0,y+10*_scale,kalertViewW-56*_scale,34*_scale);
    }else if (self.alertViewStyle == ZOEAlertViewStyleSecureTextInput) {
        self.messageContentView.textField.secureTextEntry = YES;
        self.messageContentView.textField.placeholder = _textFieldPlaceholder;
        self.messageContentView.textField.font = [UIFont systemFontOfSize:_messageFontSize];
        self.messageContentView.textField.frame = CGRectMake(0,y+10*_scale,kalertViewW-56*_scale,34*_scale);
    }
}

//设置button索引及绘制分割线
- (void)drawLine {
    for (UIView *view in [self.operationalView subviews]) {
        if (view.tag == 74129)[view removeFromSuperview];
    }
    int buttonIndex = (_cancelButtonTitle&&_cancelButtonTitle.length>0)?0:1;
    if (_otherButtonTitles.count==2) {
        for (int i=0; i<self.otherButtonTitles.count; i++) {
            UIButton *btn = _otherButtonTitles[i];
            btn.tag = kBtnTagAppend+buttonIndex++;
            [self.operationalView addSubview:btn];
        }
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0,0,kalertViewW,0.5)];
        line.backgroundColor = [UIColor colorWithRed:207/255.0 green:210/255.0 blue:213/255.0 alpha:1];
        line.tag = 74129;
        [self.operationalView addSubview:line];
        UIView *line1 = [[UIView alloc]initWithFrame:CGRectMake(kalertViewW/2.0,0,0.5,self.buttonHeight)];
        line1.backgroundColor = [UIColor colorWithRed:207/255.0 green:210/255.0 blue:213/255.0 alpha:1];
        [self.operationalView addSubview:line1];

    }else {
        for (int i=0; i<self.otherButtonTitles.count; i++) {
            UIButton *btn = _otherButtonTitles[i];
            btn.tag = kBtnTagAppend+buttonIndex++;
            [self.operationalView addSubview:btn];
            UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0,0+i*self.buttonHeight,kalertViewW,0.5)];
            line.backgroundColor = [UIColor colorWithRed:207/255.0 green:210/255.0 blue:213/255.0 alpha:1];
            line.tag = 74129;
            [self.operationalView addSubview:line];
        }
    }
}

//操作按钮点击事件
- (void)clickButton:(UIButton *)sender {
    _clickButtonIndex = sender.tag-kBtnTagAppend;
    [self removeFromSuperview];
    if (_myBlock&&!_isVisible) {
        _myBlock(_clickButtonIndex);
    }
}

//重写父类方法(移除当前ZOEAlertView的同时将上一个ZOEAlertView显示出来)
- (void)removeFromSuperview {
    if ((_shouldDisBlock&&!_shouldDisBlock(_clickButtonIndex))) {
        _isVisible = YES;
        [self showWithBlock:self.myBlock];
        NSLog(@"Instance method 'shouldDismissWithBlock:' return NO" );
        return;
    }else {
        _isVisible = NO;
    }
    [super removeFromSuperview];
    if (_didDisBlock)_didDisBlock(_clickButtonIndex);

    //有可能不是按照数组倒序的顺序移除,所以需要遍历数组
    //执行[[ZOEWindow shareStackArray] removeObject:alertVeiw];_myBlock引用会消失(只出现在某个系统),所以这边做一下缓存。
    void(^myBlockTemp)(NSInteger buttonIndex) = _myBlock;
    for (UIView *alertVeiw in [ZOEWindow shareStackArray]) {
        if (alertVeiw == self) {
            [[ZOEWindow shareStackArray] removeObject:alertVeiw];
            break;
        }
    }
    _myBlock = myBlockTemp;

    //将数组的最后一个alertView显示出来
    if ([ZOEWindow shareStackArray].count>0) {
        ZOEAlertView *alertView = [ZOEWindow shareStackArray][[ZOEWindow shareStackArray].count-1];
        if ([ZOEAlertView isKindOfClass:[alertView class]]) {
            [alertView showWithBlock:alertView.myBlock animated:alertView.animated];
        }else {
            [alertView showWithBlock:alertView.myBlock];
        }
    }

    //当数组中没有alertView时将父容器隐藏。
    if (![ZOEWindow shareStackArray].count) {
        [ZOEWindow shareInstance].hidden = YES;
    }

}

//移除当前的alertView(不会触发block回调)
- (void)dismissZOEAlertView {
    _clickButtonIndex = -1;
    [self removeFromSuperview];
}

- (void)shouldDismissWithBlock:(BOOL(^)(NSInteger buttonIndex))shouldDisBlock {
    _shouldDisBlock = shouldDisBlock;
}

- (void)didDismissWithBlock:(void(^)(NSInteger buttonIndex))didDisBlock {
    _didDisBlock = didDisBlock;
}

- (void)setButtonTextColor:(UIColor *)color buttonIndex:(NSInteger)buttonIndex {
    UIButton *btn = [self.operationalView viewWithTag:buttonIndex+kBtnTagAppend];
    if (btn) {
        [btn setTitleColor:color forState:UIControlStateNormal];
    }
}

- (void)addButtonWithTitle:(NSString *)title {
    if (title == nil || title == NULL)return;
    UIButton *btn = [ZOEAlertView createButton];
    [btn setTitle:title forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
    [btn setTitleColor:_buttonTextColor forState:UIControlStateNormal];
    [btn.titleLabel setFont:[UIFont systemFontOfSize:_buttonFontSize]];
    [self.otherButtonTitles addObject:btn];
    _isRedraw_showWithBlock = YES;
}

//移除所有ZOEAlertView(不会触发block回调)
+ (void)dismissAllZOEAlertView {
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@" disAble=1 AND zoeStyle = 0 "];
    NSArray *data = [[ZOEWindow shareStackArray] filteredArrayUsingPredicate:predicate];
    for (ZOEAlertView *alertView in data) {
        [alertView dismissZOEAlertView];
    }
}

+ (NSArray *)getAllAlertView {
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@" zoeStyle = 0 "];
    NSArray *data = [[ZOEWindow shareStackArray] filteredArrayUsingPredicate:predicate];
    return data;
}

//处理键盘遮挡输入框的问题
- (void)handleKeyboard:(UIView *)textFieldOrTextView {
    if ([textFieldOrTextView isKindOfClass:[UITextField class]]) {
        UITextField *textField = (UITextField *)textFieldOrTextView;
        textField.delegate = self;
    }else if ([textFieldOrTextView isKindOfClass:[UITextView class]]) {
        UITextView *textView = (UITextView *)textFieldOrTextView;
        textView.delegate = self;
    }
}

//展示提示性信息
- (void)showTipViewWithMessage:(NSString *)message {
    if (!message || !message.length) return;
    self.tipLabel.text  = message;
    [self.tipLabel sizeToFit];
    CGRect frame        = self.tipLabel.frame;
    frame.size.width    = frame.size.width +40;
    if (frame.size.width>([[UIScreen mainScreen] bounds].size.width-30)) {
        frame.size.width = [[UIScreen mainScreen] bounds].size.width-30;
    }
    frame.size.height   = frame.size.height+15;
    _tipLabel.layer.cornerRadius = frame.size.height/2.0;
    _tipLabel.frame     = frame;
    _tipLabel.center    = CGPointMake(self.frame.size.width/2.0, self.frame.size.height*0.8);
    self.tipLabel.alpha = 1;
    //键盘弹出需要时间,如果在键盘弹出之前就加载提示语,提示语会被键盘遮挡,所以这边做了一个延迟处理。
    [self performSelector:@selector(handleTipViewAnimate) withObject:nil afterDelay:0.01];
}

//处理提示语信息动画
- (void)handleTipViewAnimate {
    if (self.keyboardIsVisible) {
        UIView *keyview=[self keyboardView];
        [keyview addSubview:self.tipLabel];
    }else {
        [self addSubview:self.tipLabel];
    }
    __weak typeof(self) weakSelf = self;
    [UIView animateWithDuration:0.5 delay:2 options:UIViewAnimationOptionShowHideTransitionViews animations:^{
        weakSelf.tipLabel.alpha = 0;
    } completion:^(BOOL finished) {

    }];
}

- (UIView *)keyboardView {
    UIWindow* tempWindow;
    UIView* keyboard;
    for(int c = 0; c < [[[UIApplication sharedApplication] windows] count]; c ++) {
        tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:c];
        for(int i = 0; i < [tempWindow.subviews count]; i++) {
            keyboard = [tempWindow.subviews objectAtIndex:i];
            if([[keyboard description] hasPrefix:@"(lessThen)UIKeyboard"] == YES) {
                return keyboard;
            }
        }

        for(UIView* potentialKeyboard in tempWindow.subviews)
            if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
                if([[potentialKeyboard description] hasPrefix:@"<UILayoutContainerView"] == YES)
                    keyboard = potentialKeyboard;
            }
            else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.2) {
                if([[potentialKeyboard description] hasPrefix:@"<UIPeripheralHost"] == YES)
                    keyboard = potentialKeyboard;
            }
            else {
                if([[potentialKeyboard description] hasPrefix:@"<UIKeyboard"] == YES)
                    keyboard = potentialKeyboard;
            }
    }
    return keyboard;
}

#pragma mark - UITextFieldDelegate
//开始编辑输入框的时候,软键盘出现,执行此事件
-(void)textFieldDidBeginEditing:(UITextField *)textField {
    //获取textField在屏幕上的坐标
    CGPoint textFieldPoint = [[textField superview]convertPoint:textField.frame.origin toView:[ZOEWindow shareInstance]];
    int offset = textFieldPoint.y + textField.frame.size.height - ([ZOEWindow shareInstance].frame.size.height-216.0)+90;//键盘高度216
    NSTimeInterval animationDuration = 0.30f;
    [UIView beginAnimations:@"ResizeForKeyboard" context:nil];
    [UIView setAnimationDuration:animationDuration];
    //将视图的Y坐标向上移动offset个单位,以使下面腾出地方用于软键盘的显示
    if(offset > 0) {
        CGPoint centerPoint = self.alertContentView.center;
        centerPoint.y = centerPoint.y-offset;
        self.alertContentView.center = centerPoint;
    }
    [UIView commitAnimations];
}
//输入框编辑完成以后,将视图恢复到原始状态
-(void)textFieldDidEndEditing:(UITextField *)textField {
    self.alertContentView.center = self.center;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [[ZOEWindow shareInstance] endEditing:YES];
    self.alertContentView.center = self.center;
    return YES;
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [[ZOEWindow shareInstance] endEditing:YES];
    self.alertContentView.center = self.center;
}

- (void)keyboardWillShow {
    _keyboardIsVisible = YES;
}

- (void)keyboardWillHide {
    _keyboardIsVisible = NO;
}

- (BOOL)keyboardIsVisible {
    return _keyboardIsVisible;
}

#pragma mark -textViewDelegate

- (void)textViewDidBeginEditing:(UITextView *)textView {
    //获取textField在屏幕上的坐标
    CGPoint textFieldPoint = [[textView superview]convertPoint:textView.frame.origin toView:[ZOEWindow shareInstance]];
    int offset = textFieldPoint.y + textView.frame.size.height - ([ZOEWindow shareInstance].frame.size.height - 216.0)+90;//键盘高度216

    NSTimeInterval animationDuration = 0.30f;
    [UIView beginAnimations:@"ResizeForKeyboard" context:nil];
    [UIView setAnimationDuration:animationDuration];
    //将视图的Y坐标向上移动offset个单位,以使下面腾出地方用于软键盘的显示
    if(offset > 0) {
        CGPoint centerPoint = self.alertContentView.center;
        centerPoint.y = centerPoint.y-offset;
        self.alertContentView.center = centerPoint;
    }
    [UIView commitAnimations];
}

- (void)textViewDidEndEditing:(UITextView *)textView {
    self.alertContentView.center = self.center;
}

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
    /**
    判断输入的字是否是回车,即按下return
    返回NO,就代表return键值失效,即页面上按下return,不会出现换行,如果为yes,则输入页面会换行
     **/
    if ([text isEqualToString:@"\n"]){ //
        [[ZOEWindow shareInstance] endEditing:YES];
        return NO;
    }

    return YES;
}

#pragma mark - Properties

//alertView内容父容器
- (UIView *)alertContentView {
    if (!_alertContentView) {
        _alertContentView = [[UIView alloc]init];
        _alertContentView.clipsToBounds = YES;
        _alertContentView.layer.cornerRadius = 10*_scale;
        _alertContentView.backgroundColor = [UIColor whiteColor];
    }
    return _alertContentView;
}

//title
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.backgroundColor = [UIColor clearColor];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.font = [UIFont systemFontOfSize:_titleFontSize];
        _titleLabel.textColor = _titleTextColor;
    }
    return _titleLabel;
}

- (MessageContentView *)messageContentView {
    if (!_messageContentView) {
        _messageContentView = [[MessageContentView alloc]init];
        _messageContentView.backgroundColor = [UIColor clearColor];
    }
    return _messageContentView;
}

- (UIView *)operationalView {
    if (!_operationalView) {
        _operationalView = [[UIView alloc]init];
        _operationalView.backgroundColor = [UIColor clearColor];
    }
    return _operationalView;
}

- (NSMutableArray *)otherButtonTitles {
    if (!_otherButtonTitles) {
        _otherButtonTitles = [[NSMutableArray alloc]init];
    }
    return _otherButtonTitles;
}

+ (UIButton *)createButton {
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.backgroundColor = [UIColor clearColor];

    return btn;
}

- (UILabel *)tipLabel {
    if (_tipLabel)return _tipLabel;
    _tipLabel = [[UILabel alloc]init];
    _tipLabel.numberOfLines = 0;
    _tipLabel.backgroundColor = [UIColor colorWithWhite:0 alpha:0.7];
    _tipLabel.textColor = [UIColor whiteColor];
    _tipLabel.bounds    = CGRectMake(0, 30,300,30);
    _tipLabel.center    = CGPointMake(self.alertContentView.frame.size.width/2.0, self.alertContentView.frame.size.height/2.0);
    _tipLabel.font      = [UIFont systemFontOfSize:15*_scale];
    _tipLabel.textAlignment = NSTextAlignmentCenter;
    _tipLabel.userInteractionEnabled = NO;
    _tipLabel.layer.cornerRadius = 15;
    _tipLabel.clipsToBounds = YES;
    return _tipLabel;
}

//屏幕比例
- (CGFloat)scale {
    if (_scale == 0) {
        _scale = ([UIScreen mainScreen].bounds.size.height>480?[UIScreen mainScreen].bounds.size.height/667.0:0.851574);
        if (_scale>1) _scale = 1;
//        _scale = [UIScreen mainScreen].bounds.size.width/375.0;
    }
    return _scale;
}

- (void)setScale:(CGFloat)scale {
    _scale = scale;
    _isRedraw_showWithBlock = YES;
}

#pragma mark - setter方法设置属性
//行高设置
- (void)setLineSpacing:(CGFloat)lineSpacing {
    _lineSpacing = lineSpacing;
    self.messageContentView.paragraphStyle.lineSpacing = _lineSpacing*_scale;
    [self configFrame];
}

- (void)setTitleFontSize:(CGFloat)titleFontSize {
    if (_titleLabel) {
        _titleFontSize = titleFontSize;
        _titleLabel.font = [UIFont systemFontOfSize:_titleFontSize*_scale];
        [self configFrame];
    }
}

- (void)setMessageFontSize:(CGFloat)messageFontSize {
    if (_message&&_message.length>0) {
        _messageFontSize = messageFontSize;
        self.messageContentView.messageLabel.font = [UIFont systemFontOfSize:_messageFontSize*_scale];
        [self configFrame];
    }
}

- (void)setButtonFontSize:(CGFloat)buttonFontSize {
    if (self.otherButtonTitles) {
        _buttonFontSize = buttonFontSize*_scale;
        for (UIButton *btn in _otherButtonTitles) {
            [btn.titleLabel setFont:[UIFont systemFontOfSize:_buttonFontSize]];
        }
    }
}

- (void)setTitleTextColor:(UIColor *)titleTextColor {
    if (_titleLabel) {
        _titleTextColor = titleTextColor;
        _titleLabel.textColor = _titleTextColor;
    }
}

- (void)setMessageTextColor:(UIColor *)messageTextColor {
    if (_message&&_message.length>0) {
        _messageTextColor = messageTextColor;
        self.messageContentView.messageLabel.textColor = _messageTextColor;
    }
}

- (void)setButtonTextColor:(UIColor *)buttonTextColor {
    if (self.otherButtonTitles) {
        _buttonTextColor = buttonTextColor;
        for (UIButton *btn in _otherButtonTitles) {
            [btn setTitleColor:_buttonTextColor forState:UIControlStateNormal];
        }
    }
}

- (void)setMessageTextAlignment:(NSTextAlignment)messageTextAlignment {
    _messageTextAlignment = messageTextAlignment;
    [self configFrame];
}

- (void)setAlertViewStyle:(ZOEAlertViewStyle)alertViewStyle {
    _alertViewStyle = alertViewStyle;
    if (_alertViewStyle != ZOEAlertViewStyleDefault) {
        self.messageContentView.textField.delegate = self;
        [self.alertContentView addSubview:self.messageContentView];
        [self.messageContentView addSubview:self.messageContentView.textField];
    }
    [self configFrame];
}

- (void)setTextFieldPlaceholder:(NSString *)textFieldPlaceholder {
    _textFieldPlaceholder = textFieldPlaceholder;
    if (self.alertViewStyle != ZOEAlertViewStyleDefault) {
        self.messageContentView.textField.placeholder = _textFieldPlaceholder;
    }
}

- (UITextField *)textField {
    if (self.alertViewStyle != ZOEAlertViewStyleDefault) {
        return self.messageContentView.textField;
    }
    NSLog(@"ZOEAlertViewStyle is ZOEAlertViewStyleDefault, so the textField returns nil");
    return nil;
}

- (void)setButtonHeight:(CGFloat)buttonHeight {
    _buttonHeight = buttonHeight;
    _isRedraw_showWithBlock = YES;
}

- (CGFloat)buttonHeight {
    if (_buttonHeight) return _buttonHeight;
    _buttonHeight = kBtnH;
    return _buttonHeight;
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

@end


text:
/**
 * Вюха колекції моделей. Задає головний шаблон
 *
 * Івенти на які підписаний модуль:
 *      - renderCollection [ custom ]   потрібно перемалювати колекцію
 *      - show [ custom ]               відобразити вюху колекції
 *      - hide [ custom ]               приховати вюху колекції
 *
 * які генерить:
 *      - hide [ custom ]
 *      - reloadCollection [ custom ]   перегрузити дані колекції. Клік по кнопці оновити список
 *
 */

define(["text!/js/app/AcdSectionModule/tpl/AcdCollectionViewTpl.html"
        , "AcdModelView"
        , "AddAcdModelView"
        , "OpenAcdModelView"], function(AcdCollectionViewTpl
        , AcdModelView
        , AddAcdModelView
        , OpenAcdModelView) {

    var AcdCollView = (function(){
        return Backbone.View.extend({
            id: "acdSectionContainer",
            events: {
                "click .reload-acd-collection": "onRefresh",
                "click .add-acd-model": "onAdd"
            },
            template: _.template(AcdCollectionViewTpl),
            initialize: function() {
                this.prepareMarkup();

                this.listenTo(this.collection, "reset", this.onReset);

                console.info("AcdCollectionView has been initialized");
            },
            prepareMarkup: function() {
                this.$el.html(this.template());
                return this;
            },

            render: function() {
                _.each(this.collection.models, function(element, index, list) {
                    var acdModelView = new AcdModelView({ model: element });
                    this.$el.find("#acdSectionContent").append(acdModelView.render().el);
                }, this);

                //  якщо #acdSectionContent відсутній, вставити в розмітку вюху колекції
                if ( $("#page-content div.row #acdSectionContent").length === 0 ) {
                    $("#page-content div.row").html(this.$el);
                }

                return this;
            },

            show: function() {
                $(this.$el).show();
                this.collection.refresh();
            },
            hide: function() {
                $(this.$el).hide();
            },

            //  region Events handlers
            onReset: function() {
                this.render();
            },
            onRefresh: function() {
                this.collection.refresh();
            },
            onAdd: function() {
                //  створити вюху карточки нової черги
                var addAcdModelView = new AddAcdModelView({ parentView: this });

                $(this.$el).hide();

                $("#page-content .row:first-child").append(addAcdModelView.render().el);
            }
            //  endregion

        });
    }());

    return AcdCollView;
});


text:
/*
 * File Layout for: AP.AP_CDJ on 21-May-01
 *
 * Cash Disbursements Journal
 */

#pragma member_alignment save
#pragma nomember_alignment

struct ap_cdj_cdd
{
/* Element =
   Description = Vendor number */
	char vennum[10];
/* Element =
   Description = Transaction key */
	char trankey[6];
/* Element =
   Description = Invoice number */
	char invnum[15];
/* Element =
   Description = Invoice date */
	char invdat[8];
/* Element =
   Description = Invoice amount */
	double invamt;
/* Element =
   Description = Check amount */
	double ckamt;
/* Element =
   Description = Check number */
	char cknum[6];
/* Element =
   Description = Check date */
	char ckdat[8];
/* Element =
   Description = Check description */
	char ckdesc[20];
/* Element =
   Description = Discount date */
	char discdat[8];
/* Element =
   Description = Discount amount */
	double disamt;
/* Element =
   Description = Amount discount lost */
	double disc_lost_amt;
/* Element =
   Description = Discount lost to account */
	char disclost_acct[18];
/* Element =
   Description = Due date */
	char duedat[8];
/* Element =
   Description = Purchase order number */
	char ponum[10];
/* Element =
   Description = Accounts Payable Account */
	char ap_acct[18];
/* Element =
   Description = Cash Account */
	char cash_acct[18];
};
#pragma member_alignment restore


text:
<ion-modal-view class="new-report-modal">
    <ion-content class="new-report-scroll">

Editar perfil

Aquí puedes editar tus datos.

Correo electrónico *

                <input style="color: #ffffff; padding-left: 10px; padding-right: 10px;" class="text-input" type="email" placeholder="Proporcionar un correo válido" ng-model="profile.new_email">

Nombre y apellido *

                <textarea class="text-input" style="color: #ffffff; padding-left: 10px; padding-right: 10px; padding-top: 10px;" placeholder="Por favor, ingrese nombre y apellido" ng-model="profile.fullname"></textarea>

Cédula de Identidad *

                <textarea class="text-input" style="color: #ffffff; padding-left: 10px; padding-right: 10px; padding-top: 10px;" placeholder="Formato 0.000.000-0" ng-model="profile.id_doc"></textarea>

Teléfono (opcional)

                <textarea class="text-input" style="color: #ffffff; padding-left: 10px; padding-right: 10px; padding-top: 10px;" placeholder="Proporcione un teléfono de contacto" ng-model="profile.telephone"></textarea>

Si deseas, puedes reemplazar tu foto

o GALERÍA

El archivo no puede pesar más de 2MB. (JPG)

                <button class="form-button" ng-click="edit_profile_ok()">Guardar</button>

                <button class="form-button" ng-click="close_edit_profile_modal()">Cancelar</button>

    </ionic-scroll>

Aguarde por favor
<ion-spinner icon="spiral"></ion-spinner>
Enviado: 0%

</ion-modal-view>


text:
;(function () {
	angular.module("almundo.test.breadcrumb").component('breadcrumb', {
		templateUrl: 'js/components/breadcrumb/breadcrumb.tpl.html',
		controller: [function () {
			this.breadcrumbList = [
				'home', 'hoteles', 'madrid'
			];
		}]
	});
}());


text:
using namespace swganh::weather;

WeatherEvent::WeatherEvent(long minutes, Weather weather, glm::vec3 vector)
{
    duration = minutes;
    weather_type = weather;
    cloud_vector.x = vector.x;
    cloud_vector.y = vector.y;
    cloud_vector.z = vector.z;
}

long WeatherEvent::GetDuration()
{
    return duration;
}
void WeatherEvent::SetDuration(long minutes)
{
    duration = minutes;
}

Weather WeatherEvent::GetWeatherType()
{
    return weather_type;
}
void WeatherEvent::SetWeatherType(Weather weather)
{
    weather_type = weather;
}

glm::vec3 WeatherEvent::GetCloudVector()
{
    return cloud_vector;
}
void WeatherEvent::SetCloudVector(glm::vec3 vector)
{
    cloud_vector.x = vector.x;
    cloud_vector.y = vector.y;
    cloud_vector.z = vector.z;
}


text:
var ReactDOM = require('react-dom'),
    $ = require('jquery'),
    ComponentTree = require('react-component-tree'),
    ComponentPlayground = require('components/component-playground.jsx');

module.exports = function(fixture) {
  var container = document.createElement('div'),
      component,
      $component;

  component = ComponentTree.render({
    component: ComponentPlayground,
    snapshot: fixture,
    container: container
  });

  $component = $(ReactDOM.findDOMNode(component));

  return {
    container: container,
    component: component,
    $component: $component
  };
};


text:
<?php  namespace Verecom\Admin\User\Form;

use Verecom\Admin\Services\Validation\AbstractValidator;

class UserValidator extends AbstractValidator {

    /**
     * Validation rules
     *
     * @var Array
     */
    protected $rules = array(
        'first_name' => 'required',
        'last_name'  => 'required',
        'password'   => 'required|confirmed',
        'email'      => 'required|email'
    );

    /**
     * Test if validation passes before update
     *
     * @author ZZK
     * @link   http://verecom.com
     *
     * @return bool
     */
    public function validForUpdate()
    {
        if( empty($this->data['password']) AND empty($this->data['password_confirmation']) )
        {
            unset($this->rules['password']);
            unset($this->data['password']);
        }

        return parent::passes();
    }
}


text:
package ajitsingh.com.expensemanager.view;

import androidx.fragment.app.Fragment;

public interface NavigationDrawerItemView {
    void render(Fragment fragment);

    void goToHome();
}


text:
package com.dmdirc.addons.sessionlock;

import javax.inject.Inject;

import com.greboid.lock.LockAdapter;
import com.greboid.lock.LockListener;

public class SessionLockManager implements LockListener {

    /** Have we registered our actions? */
    private static boolean registered;
    /** Lock Adapter to detect session events. */
    private LockAdapter lockAdapter;

    @Inject
    public SessionLockManager() {
    }

    /**
     * Loads the manager, registering action types and the lock adapter.
     */
    public void load() {
        if (!registered) {
            registered = true;
        }

        lockAdapter = new LockAdapter();
        lockAdapter.addLockListener(this);
    }

    /**
     * Unloads the plugin, removing lock adapter, action types remain.
     */
    public void unload() {
        lockAdapter.removeLockListener(this);
        lockAdapter = null;
    }

    @Override
    public void locked() {
        // TODO: Raise an event
    }

    @Override
    public void unlocked() {
        // TODO: Raise an event
    }

}


text:
from __future__ import absolute_import

from ...server.logging import RequestLogHandler, REQUEST_LOG_ITEMS
from sqlalchemy import create_engine, Table, MetaData, Column
from sqlalchemy import Integer, Sequence, DateTime, String, Float
from sqlalchemy.exc import NoSuchTableError
from ...browser import string_to_drilldown, Drilldown
from .store import create_sqlalchemy_engine

import logging

class SQLRequestLogHandler(RequestLogHandler):
    def __init__(self, url=None, table=None, dimensions_table=None, **options):

        self.url = url
        self.engine = create_sqlalchemy_engine(url, options)

        metadata = MetaData(bind=self.engine)

        logging.getLogger('sqlalchemy.engine').setLevel("DEBUG")
        logging.getLogger('sqlalchemy.pool').setLevel("DEBUG")

        try:
            self.table = Table(table, metadata, autoload=True)

        except NoSuchTableError:
            columns = [
                Column('id', Integer, Sequence(table+"_seq"),
                       primary_key=True),
                Column('timestamp', DateTime),
                Column('method', String(50)),
                Column('cube', String(250)),
                Column('cell', String(2000)),
                Column('identity', String(250)),
                Column('elapsed_time', Float),
                Column('attributes', String(2000)),
                Column('split', String(2000)),
                Column('drilldown', String(2000)),
                Column('page', Integer),
                Column('page_size', Integer),
                Column('format', String(50)),
                Column('header', String(50)),
            ]

            self.table = Table(table, metadata, extend_existing=True, *columns)
            self.table.create()

        # Dimensions table: use of dimensions
        # Used-as: cut, split, drilldown
        # Value:
        #     cut: cut value
        #     split: cut value

        if dimensions_table:
            try:
                self.dims_table = Table(dimensions_table, metadata, autoload=True)

            except NoSuchTableError:
                columns = [
                    Column('id', Integer, Sequence(table+"_seq"),
                           primary_key=True),
                    Column('query_id', Integer),
                    Column('dimension', String(250)),
                    Column('hierarchy', String(250)),
                    Column('level', String(250)),
                    Column('used_as', String(50)),
                    Column('value', String(2000)),
                ]

                self.dims_table = Table(dimensions_table, metadata, extend_existing=True, *columns)
                self.dims_table.create()
        else:
            self.dims_table = None

    def write_record(self, cube, cell, record):
        drilldown = record.get("drilldown")

        if drilldown is not None:
            if cell:
                drilldown = Drilldown(drilldown, cell)
                record["drilldown"] = str(drilldown)
            else:
                drilldown = []
                record["drilldown"] = None

        connection = self.engine.connect()
        trans = connection.begin()

        insert = self.table.insert().values(record)
        result = connection.execute(insert)
        query_id = result.inserted_primary_key[0]

        if self.dims_table is not None:
            uses = []

            cuts = cell.cuts if cell else []
            cuts = cuts or []

            for cut in cuts:
                dim = cube.dimension(cut.dimension)
                depth = cut.level_depth()
                if depth:
                    level = dim.hierarchy(cut.hierarchy)[depth-1]
                    level_name = str(level)
                else:
                    level_name = None

                use = {
                    "query_id": query_id,
                    "dimension": str(dim),
                    "hierarchy": str(cut.hierarchy),
                    "level": str(level_name),
                    "used_as": "cell",
                    "value": str(cut)
                }
                uses.append(use)

            if drilldown:
                for item in drilldown:
                    (dim, hier, levels) = item[0:3]
                    if levels:
                        level = str(levels[-1])
                    else:
                        level = None

                    use = {
                        "query_id": query_id,
                        "dimension": str(dim),
                        "hierarchy": str(hier),
                        "level": str(level),
                        "used_as": "drilldown",
                        "value": None
                    }
                    uses.append(use)

            if uses:
                insert = self.dims_table.insert().values(uses)
                connection.execute(insert)

        trans.commit()
        connection.close()


text:
#ifndef APRINTER_LIST_COLLECT_H
#define APRINTER_LIST_COLLECT_H

#include <aprinter/meta/TypeList.h>
#include <aprinter/meta/TypeDict.h>
#include <aprinter/meta/FuncUtils.h>
#include <aprinter/meta/TypeListUtils.h>
#include <aprinter/meta/MemberType.h>

namespace APrinter {

namespace ListCollectImpl {
    APRINTER_DEFINE_MEMBER_TYPE(MemberType_Key, Key)
    APRINTER_DEFINE_MEMBER_TYPE(MemberType_Value, Value)
    APRINTER_DEFINE_MEMBER_TYPE(MemberType_Found, Found)

    template <typename Key>
    struct AddKeyFunc {
        template <typename X>
        struct Call {
            using Type = TypeDictEntry<Key, X>;
        };
    };

    template <typename MemberType>
    struct CollectHelper {
        template <typename NumberedEntry>
        using EnumerateMemberList = MapTypeList<
            FuncCall<typename MemberType::Get, typename NumberedEntry::Value>,
            AddKeyFunc<typename NumberedEntry::Key>
        >;
    };

    template <typename GroupFunc>
    struct GroupHelper {
        template <typename CurrentGroups, typename Element>
        struct AddToNewGroupFunc {
            template <typename FindResult>
            struct Call {
                using Type = ConsTypeList<
                    TypeDictEntry<
                        FuncCall<GroupFunc, Element>,
                        MakeTypeList<
                            Element
                        >
                    >,
                    CurrentGroups
                >;
            };
        };

        template <typename Element>
        struct PrependToGroupFunc {
            template <typename OldGroup>
            struct Call {
                using Type = TypeDictEntry<
                    typename OldGroup::Key,
                    ConsTypeList<
                        Element,
                        typename OldGroup::Value
                    >
                >;
            };
        };

        struct DontChangeGroupFunc {
            template <typename OldGroup>
            struct Call {
                using Type = OldGroup;
            };
        };

        template <typename CurrentGroups, typename Element>
        struct AddToExistingGroupFunc {
            template <typename FindResult>
            struct Call {
                using Type = MapTypeList<
                    CurrentGroups,
                    IfFunc<
                        ComposeFunctions<IsEqualFunc<FuncCall<GroupFunc, Element>>, typename MemberType_Key::Get>,
                        PrependToGroupFunc<Element>,
                        DontChangeGroupFunc
                    >
                >;
            };
        };

        template <typename Element, typename CurrentGroups>
        using GroupFoldFunc = FuncCall<
            IfFunc<
                IsEqualFunc<TypeDictNotFound>,
                AddToNewGroupFunc<CurrentGroups, Element>,
                AddToExistingGroupFunc<CurrentGroups, Element>
            >,
            TypeDictFind<CurrentGroups, FuncCall<GroupFunc, Element>>
        >;
    };
}

/**
 * Collect all the MemberType lists in the given List and return a
 * list of (index, element) pairs, where element is an element of one
 * of the MemberType lists, and index indicates which element of List
 * it comes from. Order is preserved.
 *
 * Example:
 *
 * \code
 * struct A { using X = MakeTypeList<int>; };
 * struct B { using X = MakeTypeList<float, int>; };
 *
 * APRINTER_DEFINE_MEMBER_TYPE(MemberType_X, X)
 *
 * ListCollect<MakeTypeList<A, B>, MemberType_X>
 * // produces
 * MakeTypeList<
 *     TypeDictEntry<WrapInt<0>, int>,
 *     TypeDictEntry<WrapInt<1>, float>,
 *     TypeDictEntry<WrapInt<1>, int>
 * >
 * \endcode
 */
template <typename List, typename MemberType>
using ListCollect = JoinTypeListList<
    MapTypeList<
        TypeListEnumerate<List>,
        IfFunc<
            ComposeFunctions<typename MemberType::Has, ListCollectImpl::MemberType_Value::Get>,
            TemplateFunc<ListCollectImpl::CollectHelper<MemberType>::template EnumerateMemberList>,
            ConstantFunc<EmptyTypeList>
        >
    >
>;

/**
 * Group the elements of List based on the function GroupFunc,
 * which given an element of List should return the group ID.
 * The order of the groups and group elements is unspecified.
 *
 * Example:
 *
 * \code
 * struct A { using Group = int; };
 * struct B { using Group = float; };
 * struct C { using Group = int; };
 *
 * template <typename X>
 * using GroupFunc = typename X::Group;
 *
 * ListGroup<MakeTypeList<A, B, C>, TemplateFunc<GroupFunc>>
 * // produces
 * MakeTypeList<
 *     TypeDictEntry<float, MakeTypeList<B>>,
 *     TypeDictEntry<int, MakeTypeList<C, A>>
 * >
 * \endcode
 */
template <typename List, typename GroupFunc>
using ListGroup = TypeListFold<List, EmptyTypeList, ListCollectImpl::template GroupHelper<GroupFunc>::template GroupFoldFunc>;

}

#endif


text:
class AddRatHost < ActiveRecord::Migration[5.1]
  def up
    return if HostGenome.find_by(name: "Rat")

    hg = HostGenome.new
    hg.name = "Rat"
    hg.s3_star_index_path = "s3://idseq-database/host_filter/rat/2019-07-24/rat_STAR_genome.tar"
    hg.s3_bowtie2_index_path = "s3://idseq-database/host_filter/rat/2019-07-24/rat_bowtie2_genome.tar"

    human_host = HostGenome.find_by(name: "Human")
    # For lack of a better default, use Human background.
    # In the future, consider asking rat users to make a background model
    # from their uninfected samples that we can substitute as the default.
    hg.default_background_id = human_host.default_background_id if human_host
    hg.save
  end

  def down
    hg = HostGenome.find_by(name: "Rat")
    hg.destroy if hg
  end
end


text:
class ActsAsRelatingTo::Organization::Role::TagAutoassignService < ActsAsRelatingTo::ServiceBase

  SERVICE_DETAILS = [
    {organization: [:id]},
    {role: [:id]},
    :token
  ].freeze

  REQUIRED_ARGS = %w(
    organization
    role
    token
  ).freeze

  REQUIRED_VALUES = %w(
    organization_id
    role_id
    token
  ).freeze

  delegate *%w(
    organization_id
    role_id
  ), to: :decorated_args

  use_peer_service_for  :autoassign_people,
                        :find_has_a

  #==============================================================================================
  # Instance Methods
  #==============================================================================================

    def call
      raise unless good_to_go?
      has_a_to_tag.set_tag_list_on :autoassign, 'true'
      has_a_to_tag.save
      autoassign_people(args)
    end

  private

    def has_a_to_tag
      @has_a_to_tag ||= find_has_a(args)
    end

end


text:
package org.bouncycastle.operator;

import org.bouncycastle.asn1.x509.AlgorithmIdentifier;

public interface DigestCalculatorProvider
{
    DigestCalculator get(AlgorithmIdentifier digestAlgorithmIdentifier)
        throws OperatorCreationException;
}


text:
dependencies = {
        layers: [
                {
			//name: "../dojox/analytics.js",
			name: "dojo.js",
                        dependencies: [
								"dojox.analytics",
								"dojox.analytics.plugins.dojo",
								"dojox.analytics.plugins.window",
								"dojox.analytics.plugins.consoleMessages",
								"dojox.analytics.plugins.mouseOver",
								"dojox.analytics.plugins.mouseClick",
								"dojox.analytics.plugins.touchPress",
								"dojox.analytics.plugins.touchMove",
								"dojox.analytics.plugins.gestureEvents",
								"dojox.analytics.plugins.idle"]
                }
	],

	prefixes: [
                [ "dojox", "../dojox" ],
                [ "dijit", "../dijit" ]
        ]
}


text:
[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Travis build](https://travis-ci.org/grumpycoders/papan.svg?branch=master)](https://travis-ci.org/grumpycoders/papan)

# [Papan](https://translate.google.com/#id/en/papan)

## What ?
This work is currently extremely early, and the repository only contains ideas and bikeshedding for now. The goal is to create a multiplayer board game engine where people can create game packages (such as [Poker](https://en.wikipedia.org/wiki/Poker) or [Game of the Goose](https://en.wikipedia.org/wiki/Game_of_the_Goose)) to play locally at home with your friends or remotely through a server.

## How ?
See the [current discussion](docs/architecture.md) for our plans on how we'd like to proceed.

## Who ?
 - https://github.com/nicolasnoble
 - https://github.com/RackhamLeNoir