text:
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;

namespace OpenDis.Enumerations.DistributedEmission.Iff
{
    /// <summary>
    /// Enumeration values for SystemName (der.iff.name, System Name,
    /// section 8.3.1.1.3)
    /// The enumeration values are generated from the SISO DIS XML EBV document (R35), which was
    /// obtained from http://discussions.sisostds.org/default.asp?action=10&fd=31
    /// </summary>
    [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
    [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
    [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
    [Serializable]
    public enum SystemName : ushort
    {
        /// <summary>
        /// Other.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("Other.")]
        Other = 0,

        /// <summary>
        /// Mark X.  applies-to: 1,2.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("Mark X.  applies-to: 1,2.")]
        MarkXAppliesTo12 = 1,

        /// <summary>
        /// Mark XII.  applies-to: 1,2.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("Mark XII.  applies-to: 1,2.")]
        MarkXIIAppliesTo12 = 2,

        /// <summary>
        /// ATCRBS.  applies-to: 2.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("ATCRBS.  applies-to: 2.")]
        ATCRBSAppliesTo2 = 3,

        /// <summary>
        /// Soviet.  applies-to: 3,4.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("Soviet.  applies-to: 3,4.")]
        SovietAppliesTo34 = 4,

        /// <summary>
        /// Mode S.  applies-to: 1,2.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("Mode S.  applies-to: 1,2.")]
        ModeSAppliesTo12 = 5,

        /// <summary>
        /// Mark X/XII/ATCRBS.  applies-to: 1,2.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("Mark X/XII/ATCRBS.  applies-to: 1,2.")]
        MarkXXIIATCRBSAppliesTo12 = 6,

        /// <summary>
        /// Mark X/XII/ATCRBS/Mode S.  applies-to: 1,2.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("Mark X/XII/ATCRBS/Mode S.  applies-to: 1,2.")]
        MarkXXIIATCRBSModeSAppliesTo12 = 7,

        /// <summary>
        /// ARI 5954.  applies-to: 5.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("ARI 5954.  applies-to: 5.")]
        ARI5954AppliesTo5 = 8,

        /// <summary>
        /// ARI 5983.  applies-to: 5.
        /// </summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Justification = "Due to SISO standardized naming.")]
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification = "Due to SISO standardized naming.")]
        [Description("ARI 5983.  applies-to: 5.")]
        ARI5983AppliesTo5 = 9
    }
}


text:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package me.imid.swipebacklayout.lib.test;

public final class R {
    public static final class attr {
        /**
Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
         */
        public static final int SwipeBackLayoutStyle=0x7f010000;
        /**
Must be one of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

left	0

right	1

bottom	2

all	3

         */
        public static final int edge_flag=0x7f010002;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int edge_size=0x7f010001;
        /**
Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
         */
        public static final int shadow_bottom=0x7f010005;
        /**
Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
         */
        public static final int shadow_left=0x7f010003;
        /**
Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
         */
        public static final int shadow_right=0x7f010004;
    }
    public static final class drawable {
        public static final int ic_launcher=0x7f020000;
        public static final int shadow_bottom=0x7f020001;
        public static final int shadow_left=0x7f020002;
        public static final int shadow_right=0x7f020003;
    }
    public static final class id {
        public static final int all=0x7f040003;
        public static final int bottom=0x7f040002;
        public static final int left=0x7f040000;
        public static final int right=0x7f040001;
        public static final int swipe=0x7f040004;
    }
    public static final class layout {
        public static final int swipeback_layout=0x7f030000;
    }
    public static final class style {
        public static final int SwipeBackLayout=0x7f050000;
    }
    public static final class styleable {
        /** Attributes that can be used with a SwipeBackLayout.

Includes the following attributes:

           <colgroup align="left" />
           <colgroup align="left" />

Attribute	Description

{@link #SwipeBackLayout_edge_flag me.imid.swipebacklayout.lib.test:edge_flag}

{@link #SwipeBackLayout_edge_size me.imid.swipebacklayout.lib.test:edge_size}

{@link #SwipeBackLayout_shadow_bottom me.imid.swipebacklayout.lib.test:shadow_bottom}

{@link #SwipeBackLayout_shadow_left me.imid.swipebacklayout.lib.test:shadow_left}

{@link #SwipeBackLayout_shadow_right me.imid.swipebacklayout.lib.test:shadow_right}

           @see #SwipeBackLayout_edge_flag
           @see #SwipeBackLayout_edge_size
           @see #SwipeBackLayout_shadow_bottom
           @see #SwipeBackLayout_shadow_left
           @see #SwipeBackLayout_shadow_right
         */
        public static final int[] SwipeBackLayout = {
            0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004,
            0x7f010005
        };
        /**

This symbol is the offset where the {@link me.imid.swipebacklayout.lib.test.R.attr#edge_flag}
          attribute's value can be found in the {@link #SwipeBackLayout} array.

Must be one of the following constant values.

<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />

Constant	Value	Description

left	0

right	1

bottom	2

all	3

          @attr name me.imid.swipebacklayout.lib.test:edge_flag
        */
        public static final int SwipeBackLayout_edge_flag = 1;
        /**

This symbol is the offset where the {@link me.imid.swipebacklayout.lib.test.R.attr#edge_size}
          attribute's value can be found in the {@link #SwipeBackLayout} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name me.imid.swipebacklayout.lib.test:edge_size
        */
        public static final int SwipeBackLayout_edge_size = 0;
        /**

This symbol is the offset where the {@link me.imid.swipebacklayout.lib.test.R.attr#shadow_bottom}
          attribute's value can be found in the {@link #SwipeBackLayout} array.

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
          @attr name me.imid.swipebacklayout.lib.test:shadow_bottom
        */
        public static final int SwipeBackLayout_shadow_bottom = 4;
        /**

This symbol is the offset where the {@link me.imid.swipebacklayout.lib.test.R.attr#shadow_left}
          attribute's value can be found in the {@link #SwipeBackLayout} array.

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
          @attr name me.imid.swipebacklayout.lib.test:shadow_left
        */
        public static final int SwipeBackLayout_shadow_left = 2;
        /**

This symbol is the offset where the {@link me.imid.swipebacklayout.lib.test.R.attr#shadow_right}
          attribute's value can be found in the {@link #SwipeBackLayout} array.

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".
          @attr name me.imid.swipebacklayout.lib.test:shadow_right
        */
        public static final int SwipeBackLayout_shadow_right = 3;
    };
}

redpajama_set_name: RedPajamaGithub


text:
Mixins are one of the most used features from the whole Sass language. They are the key to reusability and DRY components. And for good reason: mixins allow authors to define styles that can be reused throughout the stylesheet without needing to resort to non-semantic classes such as `.float-left`.

They can contain full CSS rules and pretty much everything that is allowed anywhere in a Sass document. They can even take arguments, just like functions. Needless to say, the possibilities are endless.

But I feel I must warn you against abusing the power of mixins. Again, the keyword here is *simplicity*. It might be tempting to build extremely powerful mixins with massive amounts of logic. It's called over-engineering and most developers suffer from it. Don't over think your code, and above all keep it simple. If a mixin ends up being longer than 20 lines or so, then it should be either split into smaller chunks or completely revised.

### Basics

That being said, mixins are extremely useful and you should be using some. The rule of thumb is that if you happen to spot a group of CSS properties that always appear together for a reason (i.e. not a coincidence), you can put them in a mixin instead. The [micro-clearfix hack from Nicolas Gallagher](http://nicolasgallagher.com/micro-clearfix-hack/) deserves to be put in a (argumentless) mixin for instance.

{% include snippets/mixins/01/index.html %}

Another valid example would be a mixin to size an element, defining both `width` and `height` at the same time. Not only would it make the code lighter to type, but also easier to read.

{% include snippets/mixins/02/index.html %}

For more complex examples of mixins, have a look at [this mixin to generate CSS triangles](https://www.sitepoint.com/sass-mixin-css-triangles/), [this mixin to create long shadows](https://www.sitepoint.com/ultimate-long-shadow-sass-mixin/) or [this mixin to polyfill CSS gradients for old browsers](https://www.sitepoint.com/building-linear-gradient-mixin-sass/).

### Argument-less mixins

Sometimes mixins are used only to avoid repeating the same group of declarations over and over again, yet do not need any parameter or have sensible enough defaults so that we don't necessarily have to pass arguments.

In such cases, we can safely omit the parentheses when calling them. The `@include` keyword (or `+` sign in indented-syntax) already acts as a indicator that the line is a mixin call; there is no need for extra parentheses here.

{% include snippets/mixins/08/index.html %}

### Arguments list

When dealing with an unknown number of arguments in a mixin, always use an `arglist` rather than a list. Think of `arglist` as the 8th hidden undocumented data type from Sass that is implicitly used when passing an arbitrary number of arguments to a mixin or a function whose signature contains `...`.

{% include snippets/mixins/03/index.html %}

Now, when building a mixin that accepts a handful of arguments (understand 3 or more), think twice before merging them out as a list or a map thinking it will be easier than passing them all one by one.

Sass is actually pretty clever with mixins and function declarations, so much so that you can actually pass a list or a map as an arglist to a function/mixin so that it gets parsed as a series of arguments.

{% include snippets/mixins/04/index.html %}

For more information on whether it is best to use multiple arguments, a list or an argument list, [SitePoint has a nice piece on the topic](https://www.sitepoint.com/sass-multiple-arguments-lists-or-arglist/).

### Mixins and vendor prefixes

It might be tempting to define custom mixins to handle vendor prefixes for unsupported or partially supported CSS properties. But we do not want to do this. First, if you can use [Autoprefixer](https://github.com/postcss/autoprefixer), use Autoprefixer. It will remove Sass code from your project, will always be up-to-date and will necessarily do a much better job than you at prefixing stuff.

Unfortunately, Autoprefixer is not always an option. If you use either [Bourbon](https://bourbon.io/) or [Compass](http://compass-style.org/), you may already know that they both provide a collection of mixins that handle vendor prefixes for you. Use those.

If you cannot use Autoprefixer and use neither Bourbon nor Compass, then and only then, you can have your own mixin for prefixing CSS properties. But. Please do not build a mixin per property, manually printing each vendor.

{% include snippets/mixins/05/index.html %}

Do it the clever way.

{% include snippets/mixins/06/index.html %}

Then using this mixin should be very straightforward:

{% include snippets/mixins/07/index.html %}

Please keep in mind this is a poor solution. For instance, it cannot deal with complex polyfills such as those required for Flexbox. In that sense, using Autoprefixer would be a far better option.


text:
package de.egore911.capacity.ui.dto;

import de.egore911.appframework.ui.dto.AbstractDto;

public class Widget extends AbstractDto {

    public String name;
    public String type;
    public String configuration;

}


text:
require 'rails/generators/base'

module Molecular
  class InstallGenerator < Rails::Generators::Base
    include Rails::Generators::Migration

    source_root File.expand_path("../../../templates", __FILE__)

    desc "Generates a molecular initializer at config/initializers." \
      "Generates a Molecular::Campaign model, copy migrations and add" \
      "molecular routes"

    def copy_initializer
      template "molecular.rb", "config/initializers/molecular.rb"
    end

    def copy_migrations
      copy_migration "create_molecular_campaigns"
      copy_migration "create_molecular_recipients"
      copy_migration "create_molecular_subscriptions"
      copy_migration "create_molecular_events"
    end

    def copy_campaign_decorator
      template "decorators/campaign_decorator.rb",
               "app/decorators/models/molecular/campaign_decorator.rb"
    end

    # def add_molecular_routes
    #   route "mount_molecular"
    # end

    def self.next_migration_number(number)
      if !@prev_migration_nr
        @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
      else
        @prev_migration_nr += 1
      end
      @prev_migration_nr.to_s
    end

    protected
      def copy_migration(filename)
        migration_template "migrations/#{filename}.rb",
                           "db/migrate/#{filename}.rb"
      end
  end
end


text:
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#ifdef HAVE_LIBLTDL
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sieve-priv.h>
#include <ltdl.h>
#include <mailutils/cctype.h>

typedef int (*sieve_module_init_t) (mu_sieve_machine_t mach);

#if 0
/* FIXME: See comment below */
static void
_free_loaded_module (void *data)
{
  lt_dlclose ((lt_dlhandle)data);
  lt_dlexit ();
}
#endif

static int _add_load_dir (void *, void *);

static int
sieve_init_load_path ()
{
  static int inited = 0;

  if (!inited)
    {
      if (lt_dlinit ())
	return 1;
#ifdef MU_SIEVE_MODDIR
      _add_load_dir (MU_SIEVE_MODDIR, NULL);
      inited = 1;
#endif
    }
  return 0;
}

static lt_dlhandle
load_module (mu_sieve_machine_t mach, const char *name)
{
  lt_dlhandle handle;

  if (sieve_init_load_path ())
    return NULL;

  handle = lt_dlopenext (name);
  if (handle)
    {
      sieve_module_init_t init = (sieve_module_init_t)
	                                lt_dlsym (handle, "init");
      if (init)
	{
	  init (mach);
	  /* FIXME: We used to have this:
  	       mu_sieve_machine_add_destructor (mach, _free_loaded_module,
 	                                        handle);
             However, unloading modules can lead to random segfaults in
	     case they allocated any global-access data (e.g. mach->msg).
	     In particular, this was the case with extensions/pipe.c.
	  */
	  return handle;
	}
      else
	{
	  lt_dlclose (handle);
	  handle = NULL;
	}
    }

  if (!handle)
    {
      mu_sieve_error (mach, "%s: %s", name, lt_dlerror ());
      lt_dlexit ();
    }
  return handle;
}

static void
fix_module_name (char *name)
{
  for (; *name; name++)
    {
      if (mu_isalnum (*name) || *name == '.' || *name == ',')
	continue;
      *name = '-';
    }
}

int
mu_sieve_load_ext (mu_sieve_machine_t mach, const char *name)
{
  lt_dlhandle handle;
  char *modname;

  modname = strdup (name);
  if (!modname)
    return 1;
  fix_module_name (modname);
  handle = load_module (mach, modname);
  free (modname);
  return handle == NULL;
}

static int
_add_load_dir (void *item, void *unused)
{
  return lt_dladdsearchdir (item);
}

int
mu_sv_load_add_path (mu_list_t path)
{
  if (sieve_init_load_path ())
    return 1;
  return mu_list_do (path, _add_load_dir, NULL);
}

int
mu_sv_load_add_dir (mu_sieve_machine_t mach, const char *name)
{
  if (sieve_init_load_path ())
    return 1;
  mu_sieve_machine_add_destructor (mach, (mu_sieve_destructor_t) lt_dlexit,
                                   NULL);
  return lt_dladdsearchdir (name);
}

#else
#include <sieve-priv.h>

int
mu_sieve_load_ext (mu_sieve_machine_t mach, const char *name)
{
  return 1;
}

int
mu_sv_load_add_path (mu_list_t path)
{
  return 1;
}

int
mu_sv_load_add_dir (mu_sieve_machine_t mach, const char *name)
{
  return 1;
}

#endif /* HAVE_LIBLTDL */


text:
<?php
namespace Concrete\Core\Entity;

trait PackageTrait
{
    /**
     * @ORM\ManyToOne(targetEntity="\Concrete\Core\Entity\Package", cascade={"persist"})
     * @ORM\JoinColumn(name="pkgID", referencedColumnName="pkgID", nullable=true)
     */
    protected $package = null;

    /**
     * @return mixed
     */
    public function getPackage()
    {
        return $this->package;
    }

    /**
     * @param mixed $package
     */
    public function setPackage($package)
    {
        $this->package = $package;
    }

    public function getPackageID()
    {
        if (is_object($this->package)) {
            return $this->package->getPackageID();
        }
    }

    public function getPackageHandle()
    {
        if (is_object($this->package)) {
            return $this->package->getPackageHandle();
        }
    }
}


text:
namespace boost {
namespace nowide {
    namespace detail {
        FILE* wfopen(const wchar_t* filename, const wchar_t* mode)
        {
#ifdef BOOST_WINDOWS
            // coverity[var_deref_model]
            return ::_wfopen(filename, mode);
#else
            const stackstring name(filename);
            const short_stackstring smode2(mode);
            return std::fopen(name.get(), smode2.get());
#endif
        }
    } // namespace detail

#ifdef BOOST_WINDOWS
    ///
    /// \brief Same as freopen but file_name and mode are UTF-8 strings
    ///
    FILE* freopen(const char* file_name, const char* mode, FILE* stream)
    {
        const wstackstring wname(file_name);
        const wshort_stackstring wmode(mode);
        return _wfreopen(wname.get(), wmode.get(), stream);
    }
    ///
    /// \brief Same as fopen but file_name and mode are UTF-8 strings
    ///
    FILE* fopen(const char* file_name, const char* mode)
    {
        const wstackstring wname(file_name);
        const wshort_stackstring wmode(mode);
        return detail::wfopen(wname.get(), wmode.get());
    }
    ///
    /// \brief Same as rename but old_name and new_name are UTF-8 strings
    ///
    int rename(const char* old_name, const char* new_name)
    {
        const wstackstring wold(old_name), wnew(new_name);
        return _wrename(wold.get(), wnew.get());
    }
    ///
    /// \brief Same as rename but name is UTF-8 string
    ///
    int remove(const char* name)
    {
        const wstackstring wname(name);
        return _wremove(wname.get());
    }
#endif
} // namespace nowide
} // namespace boost


text:
package com.krt.refreshcontainerdemo.view;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.animation.PathInterpolatorCompat;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.krt.refreshcontainerdemo.R;
import com.krt.refreshcontainerlib.IRefreshView;
import com.krt.refreshcontainerlib.RefreshContainer;

/**
 * Created by zehong.tang on 2017/4/20.
 * FlyRefreshView
 * MountainSceneView just copy from https://github.com/race604/FlyRefresh
 */

public class FlyRefreshView extends FrameLayout implements IRefreshView {
    private static final int PARK_VIEW_SIZE = 56; //dp
    private static final int FLY_DURATION = 800;

    private MountainSceneView mMountainSceneView;
    private ImageView mFlyView;
    private View mParkView;

    public FlyRefreshView(@NonNull Context context) {
        super(context);
        init(context);
    }

    public FlyRefreshView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    private void init(Context context){
        final float density = getResources().getDisplayMetrics().density;
        final int bottomMargin = (int) (5 * density);
        final int parkSize = (int)(PARK_VIEW_SIZE * density);

        mMountainSceneView = new MountainSceneView(context);
        LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        layoutParams.bottomMargin = parkSize / 2 + bottomMargin;
        addView(mMountainSceneView, layoutParams);

        View bottomBGView = new View(context);
        bottomBGView.setBackgroundColor(0xFFFFFFFF);
        layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, parkSize / 2 + bottomMargin);
        layoutParams.gravity = Gravity.BOTTOM;
        addView(bottomBGView, layoutParams);

        mParkView = new View(context);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            mParkView.setZ(10);
        }
        ShapeDrawable circle = new ShapeDrawable(new OvalShape());
        circle.getPaint().setColor(0xFF61B3DD);
        mParkView.setBackgroundDrawable(circle);
        layoutParams = new LayoutParams(parkSize, parkSize);
        layoutParams.gravity = Gravity.BOTTOM | Gravity.LEFT;
        layoutParams.leftMargin = (int)(17 * density);
        layoutParams.bottomMargin = bottomMargin;
        addView(mParkView, layoutParams);

        final int flySize = (int)(32 * density);
        mFlyView = new ImageView(context);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            mFlyView.setZ(10);
        }
        setFlyResource(R.mipmap.icon_send);
        layoutParams = new LayoutParams(flySize, flySize);
        layoutParams.gravity = Gravity.BOTTOM | Gravity.LEFT;
        layoutParams.leftMargin = (int)(29 * density);
        layoutParams.bottomMargin = (int)(12 * density) + bottomMargin;
        addView(mFlyView, layoutParams);
    }

    public void setFlyResource(int resId){
        mFlyView.setImageResource(resId);
    }

    public void updateParkViewY(int offset){
        mParkView.setY(mParkView.getY() + offset);
        mFlyView.setY(mFlyView.getY() + offset);
    }

    public void resetParkView(){
        mParkView.setY(mParkView.getTop());
        mFlyView.setY(mFlyView.getTop());
    }

    public void onPull(int state, float pullDistance, float threshold) {
        switch(state){
            case RefreshContainer.STATE_PREPARE:
            case RefreshContainer.STATE_PREPARE_CANCEL:
                break;
            case RefreshContainer.STATE_READY:
                float ratio = (Math.abs(pullDistance / threshold) - 1) * 2;
                mMountainSceneView.onPullProgress(state, ratio);
                rotationFlyView(ratio);
                break;
            case RefreshContainer.STATE_PREPARE_WORK:
                mMountainSceneView.onPullProgress(state, (Math.abs(pullDistance / threshold) - 1) * 2);
                startFly();
                break;
            case RefreshContainer.STATE_WORK:
                break;
            case RefreshContainer.STATE_COMPLETE:
                flyBack();
                break;
            case RefreshContainer.STATE_IDLE:
                isFlyBackRunning = false;
                break;
            default:
                break;
        }
    }

    private AnimatorSet mFlyAnimatorSet;
    private AnimatorSet mFlyBackAnimatorSet;
    private boolean isFlyBackRunning = false;
    private void startFly() {
        if(null == mFlyAnimatorSet){
            ObjectAnimator rotation = ObjectAnimator.ofFloat(mFlyView, "rotation", -45, 0);
            ObjectAnimator rotationX = ObjectAnimator.ofFloat(mFlyView, "rotationX", 0, 60);
            ObjectAnimator scaleX = ObjectAnimator.ofFloat(mFlyView, "scaleX", 1, 0.5f);
            ObjectAnimator scaleY = ObjectAnimator.ofFloat(mFlyView, "scaleY", 1, 0.5f);
            ObjectAnimator transX = ObjectAnimator.ofFloat(mFlyView, "translationX", 0, getWidth());
            ObjectAnimator transY = ObjectAnimator.ofFloat(mFlyView, "translationY", 0, -getHeight());
            transY.setInterpolator(PathInterpolatorCompat.create(0.7f, 1f));

            mFlyAnimatorSet = new AnimatorSet();
            mFlyAnimatorSet.setDuration(FLY_DURATION);
            mFlyAnimatorSet.playTogether(transX, transY, rotationX, scaleX, scaleY, rotation);
        }
        if(!mFlyAnimatorSet.isRunning()){
            clearAnimator(mFlyView);
            mFlyAnimatorSet.start();
        }
    }

    private void flyBack() {
        if(null == mFlyBackAnimatorSet){
            final int offDistX = -mFlyView.getRight();
            final int offDistY = -30;
            AnimatorSet flyDownAnim = new AnimatorSet();
            flyDownAnim.setDuration(FLY_DURATION);
            ObjectAnimator rotation = ObjectAnimator.ofFloat(mFlyView, "rotation", mFlyView.getRotation(), 0);
            ObjectAnimator scaleX = ObjectAnimator.ofFloat(mFlyView, "scaleX", 0.3f, 0.8f);
            ObjectAnimator scaleY = ObjectAnimator.ofFloat(mFlyView, "scaleY", 0.3f, 0.8f);
            ObjectAnimator transX = ObjectAnimator.ofFloat(mFlyView, "translationX", getWidth(), offDistX);
            ValueAnimator transY = ValueAnimator.ofFloat(-getHeight(), offDistY);
            transY.setInterpolator(PathInterpolatorCompat.create(0.1f, 1f));
            transY.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                public void onAnimationUpdate(ValueAnimator animation) {
                    float y = (float) animation.getAnimatedValue();
                    mFlyView.setTranslationY(y + mParkView.getTranslationY());
                }
            });

            flyDownAnim.playTogether(transX, transY, scaleX, scaleY, rotation);
            flyDownAnim.addListener(new AnimatorListenerAdapter() {
                public void onAnimationStart(Animator animation) {
                    mFlyView.setRotationY(180);
                }
                public void onAnimationEnd(Animator animation) {
                    mFlyView.setRotationY(0);
                }
            });

            AnimatorSet flyInAnim = new AnimatorSet();
            flyInAnim.setDuration(FLY_DURATION / 2);
            flyInAnim.setInterpolator(new DecelerateInterpolator());
            scaleX = ObjectAnimator.ofFloat(mFlyView, "scaleX", 0.8f, 1f);
            scaleY = ObjectAnimator.ofFloat(mFlyView, "scaleY", 0.8f, 1f);
            transX = ObjectAnimator.ofFloat(mFlyView, "translationX", offDistX, 0);
            transY = ValueAnimator.ofFloat(offDistY, 0);
            transY.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                public void onAnimationUpdate(ValueAnimator animation) {
                    float y = (float) animation.getAnimatedValue();
                    mFlyView.setTranslationY(y + mParkView.getTranslationY());
                }
            });
            ObjectAnimator rotationX = ObjectAnimator.ofFloat(mFlyView, "rotationX", 30, 0);
            flyInAnim.playTogether(transX, transY, rotationX, scaleX, scaleY);
            flyInAnim.setStartDelay(100);
            flyInAnim.addListener(new AnimatorListenerAdapter() {
                public void onAnimationStart(Animator animation) {
                    mFlyView.setRotationY(0);
                }
            });

            mFlyBackAnimatorSet = new AnimatorSet();
            mFlyBackAnimatorSet.playSequentially(flyDownAnim, flyInAnim);
        }
        if(!isFlyBackRunning){
            clearAnimator(mFlyView);
            mFlyBackAnimatorSet.start();
            isFlyBackRunning = true;
        }
    }

    private void rotationFlyView(float progress) {
        mFlyView.setRotation(Math.min(0, Math.max(-45, (-45) * progress)));
    }

    private void clearAnimator(View v) {
        ViewCompat.setAlpha(v, 1);
        ViewCompat.setScaleY(v, 1);
        ViewCompat.setScaleX(v, 1);
        ViewCompat.setTranslationY(v, 0);
        ViewCompat.setTranslationX(v, 0);
        ViewCompat.setRotation(v, 0);
        ViewCompat.setRotationY(v, 0);
        ViewCompat.setRotationX(v, 0);
        // to do https://code.google.com/p/android/issues/detail?id=80863
        // ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2);
        v.setPivotY(v.getMeasuredHeight() / 2);
        ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2);
        ViewCompat.animate(v).setInterpolator(null);
    }

    public int getDurationForCompletedAnimation() {
        return 800;
    }
}


text:
import buildModuleUrl from "../Core/buildModuleUrl.js";
import createWorldImagery from "../Scene/createWorldImagery.js";
import Cartesian3 from "../Core/Cartesian3.js";
import Clock from "../Core/Clock.js";
import defaultValue from "../Core/defaultValue.js";
import defined from "../Core/defined.js";
import destroyObject from "../Core/destroyObject.js";
import DeveloperError from "../Core/DeveloperError.js";
import Ellipsoid from "../Core/Ellipsoid.js";
import FeatureDetection from "../Core/FeatureDetection.js";
import formatError from "../Core/formatError.js";
import getElement from "../DataSources/getElement.js";
import Globe from "../Scene/Globe.js";
import Moon from "../Scene/Moon.js";
import Scene from "../Scene/Scene.js";
import SceneMode from "../Scene/SceneMode.js";
import ScreenSpaceEventHandler from "../Core/ScreenSpaceEventHandler.js";
import ShadowMode from "../Scene/ShadowMode.js";
import SkyAtmosphere from "../Scene/SkyAtmosphere.js";
import SkyBox from "../Scene/SkyBox.js";
import Sun from "../Scene/Sun.js";

function getDefaultSkyBoxUrl(suffix) {
  return buildModuleUrl(`Assets/Textures/SkyBox/tycho2t3_80_${suffix}.jpg`);
}

function startRenderLoop(widget) {
  widget._renderLoopRunning = true;

  let lastFrameTime = 0;
  function render(frameTime) {
    if (widget.isDestroyed()) {
      return;
    }

    if (widget._useDefaultRenderLoop) {
      try {
        const targetFrameRate = widget._targetFrameRate;
        if (!defined(targetFrameRate)) {
          widget.resize();
          widget.render();
          requestAnimationFrame(render);
        } else {
          const interval = 1000.0 / targetFrameRate;
          const delta = frameTime - lastFrameTime;

          if (delta > interval) {
            widget.resize();
            widget.render();
            lastFrameTime = frameTime - (delta % interval);
          }
          requestAnimationFrame(render);
        }
      } catch (error) {
        widget._useDefaultRenderLoop = false;
        widget._renderLoopRunning = false;
        if (widget._showRenderLoopErrors) {
          const title =
            "An error occurred while rendering.  Rendering has stopped.";
          widget.showErrorPanel(title, undefined, error);
        }
      }
    } else {
      widget._renderLoopRunning = false;
    }
  }

  requestAnimationFrame(render);
}

function configurePixelRatio(widget) {
  let pixelRatio = widget._useBrowserRecommendedResolution
    ? 1.0
    : window.devicePixelRatio;
  pixelRatio *= widget._resolutionScale;
  if (defined(widget._scene)) {
    widget._scene.pixelRatio = pixelRatio;
  }

  return pixelRatio;
}

function configureCanvasSize(widget) {
  const canvas = widget._canvas;
  let width = canvas.clientWidth;
  let height = canvas.clientHeight;
  const pixelRatio = configurePixelRatio(widget);

  widget._canvasClientWidth = width;
  widget._canvasClientHeight = height;

  width *= pixelRatio;
  height *= pixelRatio;

  canvas.width = width;
  canvas.height = height;

  widget._canRender = width !== 0 && height !== 0;
  widget._lastDevicePixelRatio = window.devicePixelRatio;
}

function configureCameraFrustum(widget) {
  const canvas = widget._canvas;
  const width = canvas.width;
  const height = canvas.height;
  if (width !== 0 && height !== 0) {
    const frustum = widget._scene.camera.frustum;
    if (defined(frustum.aspectRatio)) {
      frustum.aspectRatio = width / height;
    } else {
      frustum.top = frustum.right * (height / width);
      frustum.bottom = -frustum.top;
    }
  }
}

/**
 * A widget containing a Cesium scene.
 *
 * @alias CesiumWidget
 * @constructor
 *
 * @param {Element|String} container The DOM element or ID that will contain the widget.
 * @param {Object} [options] Object with the following properties:
 * @param {Clock} [options.clock=new Clock()] The clock to use to control current time.
 * @param {ImageryProvider | false} [options.imageryProvider=createWorldImagery()] The imagery provider to serve as the base layer. If set to false, no imagery provider will be added.
 * @param {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider] The terrain provider.
 * @param {SkyBox| false} [options.skyBox] The skybox used to render the stars.  When undefined, the default stars are used. If set to false, no skyBox, Sun, or Moon will be added.
 * @param {SkyAtmosphere | false} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb.  Set to false to turn it off.
 * @param {SceneMode} [options.sceneMode=SceneMode.SCENE3D] The initial scene mode.
 * @param {Boolean} [options.scene3DOnly=false] When true, each geometry instance will only be rendered in 3D to save GPU memory.
 * @param {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.
 * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.
 * @param {Globe | false} [options.globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene.  If set to false, no globe will be added.
 * @param {Boolean} [options.useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise.
 * @param {Boolean} [options.useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore window.devicePixelRatio.
 * @param {Number} [options.targetFrameRate] The target frame rate when using the default render loop.
 * @param {Boolean} [options.showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.
 * @param {ContextOptions} [options.contextOptions] Context and WebGL creation properties passed to {@link Scene}.
 * @param {Element|String} [options.creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}.  If not specified, the credits are added
 *        to the bottom of the widget itself.
 * @param {Element|String} [options.creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}.  If not specified, it will appear over the widget itself.
 * @param {Boolean} [options.shadows=false] Determines if shadows are cast by light sources.
 * @param {ShadowMode} [options.terrainShadows=ShadowMode.RECEIVE_ONLY] Determines if the terrain casts or receives shadows from light sources.
 * @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
 * @param {Boolean} [options.blurActiveElementOnCanvasFocus=true] If true, the active element will blur when the viewer's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element.
 * @param {Boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
 * @param {Number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
 * @param {Number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
 *
 * @exception {DeveloperError} Element with id "container" does not exist in the document.
 *
 * @demo {@link https://sandcastle.cesium.com/index.html?src=Cesium%20Widget.html|Cesium Sandcastle Cesium Widget Demo}
 *
 * @example
 * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,
 * // and in the body, include:

 *
 * //Widget with no terrain and default Bing Maps imagery provider.
 * const widget = new Cesium.CesiumWidget('cesiumContainer');
 *
 * //Widget with ion imagery and Cesium World Terrain.
 * const widget2 = new Cesium.CesiumWidget('cesiumContainer', {
 *     imageryProvider : Cesium.createWorldImagery(),
 *     terrainProvider : Cesium.createWorldTerrain(),
 *     skyBox : new Cesium.SkyBox({
 *         sources : {
 *           positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
 *           negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
 *           positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
 *           negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
 *           positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
 *           negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
 *         }
 *     }),
 *     // Show Columbus View map with Web Mercator projection
 *     sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
 *     mapProjection : new Cesium.WebMercatorProjection()
 * });
 */
function CesiumWidget(container, options) {
  //>>includeStart('debug', pragmas.debug);
  if (!defined(container)) {
    throw new DeveloperError("container is required.");
  }
  //>>includeEnd('debug');

  container = getElement(container);

  options = defaultValue(options, defaultValue.EMPTY_OBJECT);

  //Configure the widget DOM elements
  const element = document.createElement("div");
  element.className = "cesium-widget";
  container.appendChild(element);

  const canvas = document.createElement("canvas");
  const supportsImageRenderingPixelated = FeatureDetection.supportsImageRenderingPixelated();
  this._supportsImageRenderingPixelated = supportsImageRenderingPixelated;
  if (supportsImageRenderingPixelated) {
    canvas.style.imageRendering = FeatureDetection.imageRenderingValue();
  }

  canvas.oncontextmenu = function () {
    return false;
  };
  canvas.onselectstart = function () {
    return false;
  };

  // Interacting with a canvas does not automatically blur the previously focused element.
  // This leads to unexpected interaction if the last element was an input field.
  // For example, clicking the mouse wheel could lead to the value in  the field changing
  // unexpectedly. The solution is to blur whatever has focus as soon as canvas interaction begins.
  // Although in some cases the active element needs to stay active even after interacting with the canvas,
  // for example when clicking on it only for getting the data of a clicked position or an entity.
  // For this case, the `blurActiveElementOnCanvasFocus` can be passed with false to avoid blurring
  // the active element after interacting with the canvas.
  function blurActiveElement() {
    if (canvas !== canvas.ownerDocument.activeElement) {
      canvas.ownerDocument.activeElement.blur();
    }
  }

  const blurActiveElementOnCanvasFocus = defaultValue(
    options.blurActiveElementOnCanvasFocus,
    true
  );

  if (blurActiveElementOnCanvasFocus) {
    canvas.addEventListener("mousedown", blurActiveElement);
    canvas.addEventListener("pointerdown", blurActiveElement);
  }

  element.appendChild(canvas);

  const innerCreditContainer = document.createElement("div");
  innerCreditContainer.className = "cesium-widget-credits";

  const creditContainer = defined(options.creditContainer)
    ? getElement(options.creditContainer)
    : element;
  creditContainer.appendChild(innerCreditContainer);

  const creditViewport = defined(options.creditViewport)
    ? getElement(options.creditViewport)
    : element;

  const showRenderLoopErrors = defaultValue(options.showRenderLoopErrors, true);

  const useBrowserRecommendedResolution = defaultValue(
    options.useBrowserRecommendedResolution,
    true
  );

  this._element = element;
  this._container = container;
  this._canvas = canvas;
  this._canvasClientWidth = 0;
  this._canvasClientHeight = 0;
  this._lastDevicePixelRatio = 0;
  this._creditViewport = creditViewport;
  this._creditContainer = creditContainer;
  this._innerCreditContainer = innerCreditContainer;
  this._canRender = false;
  this._renderLoopRunning = false;
  this._showRenderLoopErrors = showRenderLoopErrors;
  this._resolutionScale = 1.0;
  this._useBrowserRecommendedResolution = useBrowserRecommendedResolution;
  this._forceResize = false;
  this._clock = defined(options.clock) ? options.clock : new Clock();

  configureCanvasSize(this);

  try {
    const scene = new Scene({
      canvas: canvas,
      contextOptions: options.contextOptions,
      creditContainer: innerCreditContainer,
      creditViewport: creditViewport,
      mapProjection: options.mapProjection,
      orderIndependentTranslucency: options.orderIndependentTranslucency,
      scene3DOnly: defaultValue(options.scene3DOnly, false),
      shadows: options.shadows,
      mapMode2D: options.mapMode2D,
      requestRenderMode: options.requestRenderMode,
      maximumRenderTimeChange: options.maximumRenderTimeChange,
      depthPlaneEllipsoidOffset: options.depthPlaneEllipsoidOffset,
      msaaSamples: options.msaaSamples,
    });
    this._scene = scene;

    scene.camera.constrainedAxis = Cartesian3.UNIT_Z;

    configurePixelRatio(this);
    configureCameraFrustum(this);

    const ellipsoid = defaultValue(
      scene.mapProjection.ellipsoid,
      Ellipsoid.WGS84
    );

    let globe = options.globe;
    if (!defined(globe)) {
      globe = new Globe(ellipsoid);
    }
    if (globe !== false) {
      scene.globe = globe;
      scene.globe.shadows = defaultValue(
        options.terrainShadows,
        ShadowMode.RECEIVE_ONLY
      );
    }

    let skyBox = options.skyBox;
    if (!defined(skyBox)) {
      skyBox = new SkyBox({
        sources: {
          positiveX: getDefaultSkyBoxUrl("px"),
          negativeX: getDefaultSkyBoxUrl("mx"),
          positiveY: getDefaultSkyBoxUrl("py"),
          negativeY: getDefaultSkyBoxUrl("my"),
          positiveZ: getDefaultSkyBoxUrl("pz"),
          negativeZ: getDefaultSkyBoxUrl("mz"),
        },
      });
    }
    if (skyBox !== false) {
      scene.skyBox = skyBox;
      scene.sun = new Sun();
      scene.moon = new Moon();
    }

    // Blue sky, and the glow around the Earth's limb.
    let skyAtmosphere = options.skyAtmosphere;
    if (!defined(skyAtmosphere)) {
      skyAtmosphere = new SkyAtmosphere(ellipsoid);
    }
    if (skyAtmosphere !== false) {
      scene.skyAtmosphere = skyAtmosphere;
    }

    //Set the base imagery layer
    let imageryProvider =
      options.globe === false ? false : options.imageryProvider;
    if (!defined(imageryProvider)) {
      imageryProvider = createWorldImagery();
    }

    if (imageryProvider !== false) {
      scene.imageryLayers.addImageryProvider(imageryProvider);
    }

    //Set the terrain provider if one is provided.
    if (defined(options.terrainProvider) && options.globe !== false) {
      scene.terrainProvider = options.terrainProvider;
    }

    this._screenSpaceEventHandler = new ScreenSpaceEventHandler(canvas);

    if (defined(options.sceneMode)) {
      if (options.sceneMode === SceneMode.SCENE2D) {
        this._scene.morphTo2D(0);
      }
      if (options.sceneMode === SceneMode.COLUMBUS_VIEW) {
        this._scene.morphToColumbusView(0);
      }
    }

    this._useDefaultRenderLoop = undefined;
    this.useDefaultRenderLoop = defaultValue(
      options.useDefaultRenderLoop,
      true
    );

    this._targetFrameRate = undefined;
    this.targetFrameRate = options.targetFrameRate;

    const that = this;
    this._onRenderError = function (scene, error) {
      that._useDefaultRenderLoop = false;
      that._renderLoopRunning = false;
      if (that._showRenderLoopErrors) {
        const title =
          "An error occurred while rendering.  Rendering has stopped.";
        that.showErrorPanel(title, undefined, error);
      }
    };
    scene.renderError.addEventListener(this._onRenderError);
  } catch (error) {
    if (showRenderLoopErrors) {
      const title = "Error constructing CesiumWidget.";
      const message =
        'Visit http://get.webgl.org to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:';
      this.showErrorPanel(title, message, error);
    }
    throw error;
  }
}

Object.defineProperties(CesiumWidget.prototype, {
  /**
   * Gets the parent container.
   * @memberof CesiumWidget.prototype
   *
   * @type {Element}
   * @readonly
   */
  container: {
    get: function () {
      return this._container;
    },
  },

  /**
   * Gets the canvas.
   * @memberof CesiumWidget.prototype
   *
   * @type {HTMLCanvasElement}
   * @readonly
   */
  canvas: {
    get: function () {
      return this._canvas;
    },
  },

  /**
   * Gets the credit container.
   * @memberof CesiumWidget.prototype
   *
   * @type {Element}
   * @readonly
   */
  creditContainer: {
    get: function () {
      return this._creditContainer;
    },
  },

  /**
   * Gets the credit viewport
   * @memberof CesiumWidget.prototype
   *
   * @type {Element}
   * @readonly
   */
  creditViewport: {
    get: function () {
      return this._creditViewport;
    },
  },

  /**
   * Gets the scene.
   * @memberof CesiumWidget.prototype
   *
   * @type {Scene}
   * @readonly
   */
  scene: {
    get: function () {
      return this._scene;
    },
  },

  /**
   * Gets the collection of image layers that will be rendered on the globe.
   * @memberof CesiumWidget.prototype
   *
   * @type {ImageryLayerCollection}
   * @readonly
   */
  imageryLayers: {
    get: function () {
      return this._scene.imageryLayers;
    },
  },

  /**
   * The terrain provider providing surface geometry for the globe.
   * @memberof CesiumWidget.prototype
   *
   * @type {TerrainProvider}
   */
  terrainProvider: {
    get: function () {
      return this._scene.terrainProvider;
    },
    set: function (terrainProvider) {
      this._scene.terrainProvider = terrainProvider;
    },
  },

  /**
   * Gets the camera.
   * @memberof CesiumWidget.prototype
   *
   * @type {Camera}
   * @readonly
   */
  camera: {
    get: function () {
      return this._scene.camera;
    },
  },

  /**
   * Gets the clock.
   * @memberof CesiumWidget.prototype
   *
   * @type {Clock}
   * @readonly
   */
  clock: {
    get: function () {
      return this._clock;
    },
  },

  /**
   * Gets the screen space event handler.
   * @memberof CesiumWidget.prototype
   *
   * @type {ScreenSpaceEventHandler}
   * @readonly
   */
  screenSpaceEventHandler: {
    get: function () {
      return this._screenSpaceEventHandler;
    },
  },

  /**
   * Gets or sets the target frame rate of the widget when useDefaultRenderLoop
   * is true. If undefined, the browser's requestAnimationFrame implementation
   * determines the frame rate.  If defined, this value must be greater than 0.  A value higher
   * than the underlying requestAnimationFrame implementation will have no effect.
   * @memberof CesiumWidget.prototype
   *
   * @type {Number}
   */
  targetFrameRate: {
    get: function () {
      return this._targetFrameRate;
    },
    set: function (value) {
      //>>includeStart('debug', pragmas.debug);
      if (value <= 0) {
        throw new DeveloperError(
          "targetFrameRate must be greater than 0, or undefined."
        );
      }
      //>>includeEnd('debug');
      this._targetFrameRate = value;
    },
  },

  /**
   * Gets or sets whether or not this widget should control the render loop.
   * If true the widget will use requestAnimationFrame to
   * perform rendering and resizing of the widget, as well as drive the
   * simulation clock. If set to false, you must manually call the
   * resize, render methods as part of a custom
   * render loop.  If an error occurs during rendering, {@link Scene}'s
   * renderError event will be raised and this property
   * will be set to false.  It must be set back to true to continue rendering
   * after the error.
   * @memberof CesiumWidget.prototype
   *
   * @type {Boolean}
   */
  useDefaultRenderLoop: {
    get: function () {
      return this._useDefaultRenderLoop;
    },
    set: function (value) {
      if (this._useDefaultRenderLoop !== value) {
        this._useDefaultRenderLoop = value;
        if (value && !this._renderLoopRunning) {
          startRenderLoop(this);
        }
      }
    },
  },

  /**
   * Gets or sets a scaling factor for rendering resolution.  Values less than 1.0 can improve
   * performance on less powerful devices while values greater than 1.0 will render at a higher
   * resolution and then scale down, resulting in improved visual fidelity.
   * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
   * will cause the scene to be rendered at 320x240 and then scaled up while setting
   * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
   * @memberof CesiumWidget.prototype
   *
   * @type {Number}
   * @default 1.0
   */
  resolutionScale: {
    get: function () {
      return this._resolutionScale;
    },
    set: function (value) {
      //>>includeStart('debug', pragmas.debug);
      if (value <= 0) {
        throw new DeveloperError("resolutionScale must be greater than 0.");
      }
      //>>includeEnd('debug');
      if (this._resolutionScale !== value) {
        this._resolutionScale = value;
        this._forceResize = true;
      }
    },
  },

  /**
   * Boolean flag indicating if the browser's recommended resolution is used.
   * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
   * effectively rendering based on CSS pixels instead of device pixels. This can improve
   * performance on less powerful devices that have high pixel density. When false, rendering
   * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether
   * this flag is true or false.
   * @memberof CesiumWidget.prototype
   *
   * @type {Boolean}
   * @default true
   */
  useBrowserRecommendedResolution: {
    get: function () {
      return this._useBrowserRecommendedResolution;
    },
    set: function (value) {
      if (this._useBrowserRecommendedResolution !== value) {
        this._useBrowserRecommendedResolution = value;
        this._forceResize = true;
      }
    },
  },
});

/**
 * Show an error panel to the user containing a title and a longer error message,
 * which can be dismissed using an OK button.  This panel is displayed automatically
 * when a render loop error occurs, if showRenderLoopErrors was not false when the
 * widget was constructed.
 *
 * @param {String} title The title to be displayed on the error panel.  This string is interpreted as text.
 * @param {String} [message] A helpful, user-facing message to display prior to the detailed error information.  This string is interpreted as HTML.
 * @param {String} [error] The error to be displayed on the error panel.  This string is formatted using {@link formatError} and then displayed as text.
 */
CesiumWidget.prototype.showErrorPanel = function (title, message, error) {
  const element = this._element;
  const overlay = document.createElement("div");
  overlay.className = "cesium-widget-errorPanel";

  const content = document.createElement("div");
  content.className = "cesium-widget-errorPanel-content";
  overlay.appendChild(content);

  const errorHeader = document.createElement("div");
  errorHeader.className = "cesium-widget-errorPanel-header";
  errorHeader.appendChild(document.createTextNode(title));
  content.appendChild(errorHeader);

  const errorPanelScroller = document.createElement("div");
  errorPanelScroller.className = "cesium-widget-errorPanel-scroll";
  content.appendChild(errorPanelScroller);
  function resizeCallback() {
    errorPanelScroller.style.maxHeight = `${Math.max(
      Math.round(element.clientHeight * 0.9 - 100),
      30
    )}px`;
  }
  resizeCallback();
  if (defined(window.addEventListener)) {
    window.addEventListener("resize", resizeCallback, false);
  }

  const hasMessage = defined(message);
  const hasError = defined(error);

  if (hasMessage || hasError) {
    const errorMessage = document.createElement("div");
    errorMessage.className = "cesium-widget-errorPanel-message";
    errorPanelScroller.appendChild(errorMessage);

    if (hasError) {
      let errorDetails = formatError(error);
      if (!hasMessage) {
        if (typeof error === "string") {
          error = new Error(error);
        }

        message = formatError({
          name: error.name,
          message: error.message,
        });
        errorDetails = error.stack;
      }

      //IE8 does not have a console object unless the dev tools are open.
      if (typeof console !== "undefined") {
        console.error(`${title}\n${message}\n${errorDetails}`);
      }

      const errorMessageDetails = document.createElement("div");
      errorMessageDetails.className =
        "cesium-widget-errorPanel-message-details collapsed";

      const moreDetails = document.createElement("span");
      moreDetails.className = "cesium-widget-errorPanel-more-details";
      moreDetails.appendChild(document.createTextNode("See more..."));
      errorMessageDetails.appendChild(moreDetails);

      errorMessageDetails.onclick = function (e) {
        errorMessageDetails.removeChild(moreDetails);
        errorMessageDetails.appendChild(document.createTextNode(errorDetails));
        errorMessageDetails.className =
          "cesium-widget-errorPanel-message-details";
        content.className = "cesium-widget-errorPanel-content expanded";
        errorMessageDetails.onclick = undefined;
      };

      errorPanelScroller.appendChild(errorMessageDetails);
    }

    errorMessage.innerHTML = `<p>${message}</p>`;
  }

  const buttonPanel = document.createElement("div");
  buttonPanel.className = "cesium-widget-errorPanel-buttonPanel";
  content.appendChild(buttonPanel);

  const okButton = document.createElement("button");
  okButton.setAttribute("type", "button");
  okButton.className = "cesium-button";
  okButton.appendChild(document.createTextNode("OK"));
  okButton.onclick = function () {
    if (defined(resizeCallback) && defined(window.removeEventListener)) {
      window.removeEventListener("resize", resizeCallback, false);
    }
    element.removeChild(overlay);
  };

  buttonPanel.appendChild(okButton);

  element.appendChild(overlay);
};

/**
 * @returns {Boolean} true if the object has been destroyed, false otherwise.
 */
CesiumWidget.prototype.isDestroyed = function () {
  return false;
};

/**
 * Destroys the widget.  Should be called if permanently
 * removing the widget from layout.
 */
CesiumWidget.prototype.destroy = function () {
  if (defined(this._scene)) {
    this._scene.renderError.removeEventListener(this._onRenderError);
    this._scene = this._scene.destroy();
  }
  this._container.removeChild(this._element);
  this._creditContainer.removeChild(this._innerCreditContainer);
  destroyObject(this);
};

/**
 * Updates the canvas size, camera aspect ratio, and viewport size.
 * This function is called automatically as needed unless
 * useDefaultRenderLoop is set to false.
 */
CesiumWidget.prototype.resize = function () {
  const canvas = this._canvas;
  if (
    !this._forceResize &&
    this._canvasClientWidth === canvas.clientWidth &&
    this._canvasClientHeight === canvas.clientHeight &&
    this._lastDevicePixelRatio === window.devicePixelRatio
  ) {
    return;
  }
  this._forceResize = false;

  configureCanvasSize(this);
  configureCameraFrustum(this);

  this._scene.requestRender();
};

/**
 * Renders the scene.  This function is called automatically
 * unless useDefaultRenderLoop is set to false;
 */
CesiumWidget.prototype.render = function () {
  if (this._canRender) {
    this._scene.initializeFrame();
    const currentTime = this._clock.tick();
    this._scene.render(currentTime);
  } else {
    this._clock.tick();
  }
};
export default CesiumWidget;


text:
require 'spec_helper'
require 'puppet/confine/exists'

provider_class = Puppet::Type.type(:firewall).provider(:ip6tables)
describe 'ip6tables' do
  let(:params) { { name: '000 test foo', action: 'accept' } }
  let(:provider) { provider_class }
  let(:resource) { Puppet::Type.type(:firewall) }
  let(:ip6tables_version) { '1.4.0' }

  before :each do
  end

  def stub_iptables
    allow(Puppet::Type::Firewall).to receive(:defaultprovider).and_return provider
    # Stub confine facts
    allow(provider).to receive(:command).with(:iptables_save).and_return '/sbin/iptables-save'

    allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux')
    allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('Debian')
    allow(Facter.fact('ip6tables_version')).to receive(:value).and_return(ip6tables_version)
    allow(Puppet::Util::Execution).to receive(:execute).and_return ''
    allow(Puppet::Util).to receive(:which).with('iptables-save')
                                          .and_return '/sbin/iptables-save'
  end

  shared_examples 'raise error' do
    it {
      stub_iptables
      expect {
        provider.new(resource.new(params))
      }.to raise_error(Puppet::DevError, error_message)
    }
  end
  shared_examples 'run' do
    it {
      stub_iptables
      provider.new(resource.new(params))
    }
  end
  context 'when iptables 1.3' do
    let(:params) { { name: '000 test foo', action: 'accept' } }
    let(:error_message) { %r{The ip6tables provider is not supported on version 1\.3 of iptables} }
    let(:ip6tables_version) { '1.3.10' }

    it_behaves_like 'raise error'
  end
  context 'when ip6tables nil' do
    let(:params) { { name: '000 test foo', action: 'accept' } }
    let(:error_message) { %r{The ip6tables provider is not supported on version 1\.3 of iptables} }
    let(:ip6tables_version) { nil }

    it_behaves_like 'run'
  end
end


text:
package kms

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// UpdateAlias invokes the kms.UpdateAlias API synchronously
func (client *Client) UpdateAlias(request *UpdateAliasRequest) (response *UpdateAliasResponse, err error) {
	response = CreateUpdateAliasResponse()
	err = client.DoAction(request, response)
	return
}

// UpdateAliasWithChan invokes the kms.UpdateAlias API asynchronously
func (client *Client) UpdateAliasWithChan(request *UpdateAliasRequest) (<-chan *UpdateAliasResponse, <-chan error) {
	responseChan := make(chan *UpdateAliasResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.UpdateAlias(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// UpdateAliasWithCallback invokes the kms.UpdateAlias API asynchronously
func (client *Client) UpdateAliasWithCallback(request *UpdateAliasRequest, callback func(response *UpdateAliasResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *UpdateAliasResponse
		var err error
		defer close(result)
		response, err = client.UpdateAlias(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// UpdateAliasRequest is the request struct for api UpdateAlias
type UpdateAliasRequest struct {
	*requests.RpcRequest
	AliasName string `position:"Query" name:"AliasName"`
	KeyId     string `position:"Query" name:"KeyId"`
}

// UpdateAliasResponse is the response struct for api UpdateAlias
type UpdateAliasResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
}

// CreateUpdateAliasRequest creates a request to invoke UpdateAlias API
func CreateUpdateAliasRequest() (request *UpdateAliasRequest) {
	request = &UpdateAliasRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("Kms", "2016-01-20", "UpdateAlias", "kms", "openAPI")
	request.Method = requests.POST
	return
}

// CreateUpdateAliasResponse creates a response to parse from UpdateAlias response
func CreateUpdateAliasResponse() (response *UpdateAliasResponse) {
	response = &UpdateAliasResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
package com.android.email.mail.transport;

import com.android.email.mail.Sender;
import com.android.emailcommon.mail.MessagingException;
import com.android.emailcommon.provider.Account;

import android.content.Context;

/**
 * Our Exchange service does not use the sender/store model.  This class exists for exactly one
 * purpose, which is to return "null" for getSettingActivityClass().
 */
public class ExchangeSender extends Sender {

    /**
     * Factory method.
     */
    public static Sender newInstance(Account account, Context context) throws MessagingException {
        return new ExchangeSender(context, account);
    }

    private ExchangeSender(Context context, Account account) {
    }

    @Override
    public void close() {
    }

    @Override
    public void open() {
    }

    @Override
    public void sendMessage(long messageId) {
    }

    /**
     * Get class of SettingActivity for this Sender class.
     * @return Activity class that has class method actionEditOutgoingSettings(), or null if
     * outgoing settings should not be presented (e.g. they're handled by the incoming settings
     * screen).
     */
    @Override
    public Class<? extends android.app.Activity> getSettingActivityClass() {
        return null;
    }

}


text:
import React, { Component } from 'react';
import { Redirect } from 'react-router-dom';

import '../../styles/submit.css';
import '../../styles/comments.css';

import WithNotifications from '../../hocs/WithNotifications'
import requester from '../../infrastructure/requesterFetch';

class CreatePostBase extends Component {

    constructor(props) {
        super(props);
        this.state = {
            postData: {},
            view: null
        }

        this.handleSubmit = this.handleSubmit.bind(this);
        this.handleChange = this.handleChange.bind(this);
    }

    componentDidMount() {
        let view = <Redirect to="/" />;
        if (sessionStorage.getItem('username')) {
            view = (

Submit Link

Please, fill out the form. A thumbnail image is not required.

                    <form id="submitForm" className="submitForm" method='POST'>
                        Link URL:
                        <input name="url" type="text" onChange={this.handleChange} />
                        Link Title:
                        <input name="title" type="text" onChange={this.handleChange} />
                        Link Thumbnail Image (optional):
                        <input name="imageUrl" type="text" onChange={this.handleChange} />
                        Comment (optional):
                        <textarea name="description" onChange={this.handleChange}></textarea>
                        <input id="btnSubmitPost" value="Submit" type="submit" onClick={this.handleSubmit}/>
                    </form>

);
        }
        this.setState({ view });
    }

    handleSubmit(event) {
        event.preventDefault();
        if (this.state.postData.title < 5) {
            this.props.error('Title must be more than 5 symbols!');
            return;
        }
        if (this.state.postData.description < 5) {
            this.props.error('Description must be more than 5 symbols!');
            return;
        }
        let data = this.state.postData;
        data.author = sessionStorage.getItem('username');
        requester.post('appdata', 'posts', '', data)
        .then(res => res.json())
        .then(res => {
            this.props.info('Successfully added new post!');
            this.setState({postData: {}, view: <Redirect to="/catalog"/>});
        }).catch(err => this.props.error);
    }

    handleChange(event) {
        let postData = this.state.postData;
        postData[event.target.name] = event.target.value;
        this.setState({postData});
    }

    render () {
        return this.state.view
    }
}

const CreatePost = WithNotifications(CreatePostBase);

export default CreatePost;


text:
from django.conf import settings
from django.conf.urls.defaults import *

from pinax.apps.account.forms import SignupForm

if getattr(settings, "ACCOUNT_OPEN_SIGNUP", None):
    signup_view = "pinax.apps.account.views.signup"
else:
    signup_view = "pinax.apps.signup_codes.views.signup"

urlpatterns = patterns("",
    url(r"^email/$", "pinax.apps.account.views.email", name="acct_email"),
    url(r"^signup/$", signup_view, name="acct_signup"),
    url(r"^login/$", "pinax.apps.account.views.login", name="acct_login"),
    url(r"^login/openid/$", "pinax.apps.account.views.login", {"associate_openid": True},
        name="acct_login_openid"),
    url(r"^password_change/$", "pinax.apps.account.views.password_change", name="acct_passwd"),
    url(r"^password_set/$", "pinax.apps.account.views.password_set", name="acct_passwd_set"),
    url(r"^password_delete/$", "pinax.apps.account.views.password_delete", name="acct_passwd_delete"),
    url(r"^password_delete/done/$", "django.views.generic.simple.direct_to_template", {
        "template": "account/password_delete_done.html",
    }, name="acct_passwd_delete_done"),
    url(r"^timezone/$", "pinax.apps.account.views.timezone_change", name="acct_timezone_change"),
    url(r"^other_services/$", "pinax.apps.account.views.other_services", name="acct_other_services"),
    url(r"^other_services/remove/$", "pinax.apps.account.views.other_services_remove", name="acct_other_services_remove"),

    url(r"^language/$", "pinax.apps.account.views.language_change", name="acct_language_change"),
    url(r"^logout/$", "django.contrib.auth.views.logout", {"template_name": "account/logout.html"}, name="acct_logout"),

    url(r"^confirm_email/(\w+)/$", "emailconfirmation.views.confirm_email", name="acct_confirm_email"),

    # password reset
    url(r"^password_reset/$", "pinax.apps.account.views.password_reset", name="acct_passwd_reset"),
    url(r"^password_reset/done/$", "pinax.apps.account.views.password_reset_done", name="acct_passwd_reset_done"),
    url(r"^password_reset_key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$", "pinax.apps.account.views.password_reset_from_key", name="acct_passwd_reset_key"),

    # ajax validation
    (r"^validate/$", "ajax_validation.views.validate", {"form_class": SignupForm}, "signup_form_validate"),
)


text:
using Hanselman.Portable.ViewModels;
using Xamarin.Forms;

namespace Hanselman.Portable.Views
{
    public partial class PodcastPage : ContentPage
    {
        PodcastViewModel ViewModel => BindingContext as PodcastViewModel;

        public PodcastPage(MenuType item)
        {
            InitializeComponent();
            BindingContext = new PodcastViewModel(item);

            listView.ItemTapped += (sender, args) =>
            {
                if (listView.SelectedItem == null)
                    return;
                Navigation.PushAsync(new PodcastPlaybackPage
                  (listView.SelectedItem as FeedItem));
                listView.SelectedItem = null;
            };
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (ViewModel == null || !ViewModel.CanLoadMore || ViewModel.IsBusy || ViewModel.FeedItems.Count > 0)
                return;

            ViewModel.LoadItemsCommand.Execute(null);
        }
    }
}


text:
"""
Covariance estimators using shrinkage.

Shrinkage corresponds to regularising `cov` using a convex combination:
shrunk_cov = (1-shrinkage)*cov + shrinkage*structured_estimate.

"""

# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#         Gael Varoquaux <gael.varoquaux@normalesup.org>
#         Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD Style.

# avoid division truncation
from __future__ import division
import warnings
import numpy as np

from .empirical_covariance_ import empirical_covariance, EmpiricalCovariance
from ..externals.six.moves import xrange
from ..utils import array2d

###############################################################################
# ShrunkCovariance estimator

def shrunk_covariance(emp_cov, shrinkage=0.1):
    """Calculates a covariance matrix shrunk on the diagonal

    Parameters
    ----------
    emp_cov: array-like, shape (n_features, n_features)
      Covariance matrix to be shrunk

    shrinkage: float, 0 <= shrinkage <= 1
      coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Returns
    -------
    shrunk_cov: array-like
      shrunk covariance

    Notes
    -----
    The regularized (shrunk) covariance is given by

    (1 - shrinkage)*cov
      + shrinkage*mu*np.identity(n_features)

    where mu = trace(cov) / n_features

    """
    emp_cov = array2d(emp_cov)
    n_features = emp_cov.shape[0]

    mu = np.trace(emp_cov) / n_features
    shrunk_cov = (1. - shrinkage) * emp_cov
    shrunk_cov.flat[::n_features + 1] += shrinkage * mu

    return shrunk_cov

class ShrunkCovariance(EmpiricalCovariance):
    """Covariance estimator with shrinkage

    Parameters
    ----------
    store_precision : bool
      Specify if the estimated precision is stored

    shrinkage: float, 0 <= shrinkage <= 1
      coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Attributes
    ----------
    `covariance_` : array-like, shape (n_features, n_features)
        Estimated covariance matrix

    `precision_` : array-like, shape (n_features, n_features)
        Estimated pseudo inverse matrix.
        (stored only if store_precision is True)

    `shrinkage`: float, 0 <= shrinkage <= 1
      coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Notes
    -----
    The regularized covariance is given by

    (1 - shrinkage)*cov
      + shrinkage*mu*np.identity(n_features)

    where mu = trace(cov) / n_features

    """
    def __init__(self, store_precision=True, assume_centered=False,
                 shrinkage=0.1):
        EmpiricalCovariance.__init__(self, store_precision=store_precision,
                                     assume_centered=assume_centered)
        self.shrinkage = shrinkage

    def fit(self, X, y=None):
        """ Fits the shrunk covariance model
        according to the given training data and parameters.

        Parameters
        ----------
        X: array-like, shape = [n_samples, n_features]
          Training data, where n_samples is the number of samples
          and n_features is the number of features.
        y: not used, present for API consistence purpose.

        assume_centered: Boolean
          If True, data are not centered before computation.
          Useful to work with data whose mean is significantly equal to
          zero but is not exactly zero.
          If False, data are centered before computation.

        Returns
        -------
        self: object
          Returns self.

        """
        # Not calling the parent object to fit, to avoid a potential
        # matrix inversion when setting the precision
        if self.assume_centered:
            self.location_ = np.zeros(X.shape[1])
        else:
            self.location_ = X.mean(0)
        covariance = empirical_covariance(
            X, assume_centered=self.assume_centered)
        covariance = shrunk_covariance(covariance, self.shrinkage)
        self._set_covariance(covariance)

        return self

###############################################################################
# Ledoit-Wolf estimator

def ledoit_wolf_shrinkage(X, assume_centered=False, block_size=1000):
    """Estimates the shrunk Ledoit-Wolf covariance matrix.

    Parameters
    ----------
    X: array-like, shape (n_samples, n_features)
      Data from which to compute the Ledoit-Wolf shrunk covariance shrinkage

    assume_centered: Boolean
      If True, data are not centered before computation.
      Useful to work with data whose mean is significantly equal to
      zero but is not exactly zero.
      If False, data are centered before computation.

    block_size: int,
      Size of the blocks into which the covariance matrix will be split.

    Returns
    -------
    shrinkage: float
      Coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Notes
    -----
    The regularized (shrunk) covariance is:

    (1 - shrinkage)*cov
      + shrinkage * mu * np.identity(n_features)

    where mu = trace(cov) / n_features

    """
    X = np.asarray(X)
    # for only one feature, the result is the same whatever the shrinkage
    if len(X.shape) == 2 and X.shape[1] == 1:
        return 0.
    if X.ndim == 1:
        X = np.reshape(X, (1, -1))
        warnings.warn("Only one sample available. "
                      "You may want to reshape your data array")
        n_samples = 1
        n_features = X.size
    else:
        n_samples, n_features = X.shape

    # optionaly center data
    if not assume_centered:
        X = X - X.mean(0)

    # number of blocks to split the covariance matrix into
    n_splits = int(n_features / block_size)
    X2 = X ** 2
    emp_cov_trace = np.sum(X2, axis=0) / n_samples
    mu = np.sum(emp_cov_trace) / n_features
    beta_ = 0.  # sum of the coefficients of <X2.T, X2>
    delta_ = 0.  # sum of the *squared* coefficients of <X.T, X>
    # starting block computation
    for i in xrange(n_splits):
        for j in xrange(n_splits):
            rows = slice(block_size * i, block_size * (i + 1))
            cols = slice(block_size * j, block_size * (j + 1))
            beta_ += np.sum(np.dot(X2.T[rows], X2[:, cols]))
            delta_ += np.sum(np.dot(X.T[rows], X[:, cols]) ** 2)
        rows = slice(block_size * i, block_size * (i + 1))
        beta_ += np.sum(np.dot(X2.T[rows], X2[:, block_size * n_splits:]))
        delta_ += np.sum(
            np.dot(X.T[rows], X[:, block_size * n_splits:]) ** 2)
    for j in xrange(n_splits):
        cols = slice(block_size * j, block_size * (j + 1))
        beta_ += np.sum(np.dot(X2.T[block_size * n_splits:], X2[:, cols]))
        delta_ += np.sum(
            np.dot(X.T[block_size * n_splits:], X[:, cols]) ** 2)
    delta_ += np.sum(np.dot(X.T[block_size * n_splits:],
                            X[:, block_size * n_splits:]) ** 2)
    delta_ /= n_samples ** 2
    beta_ += np.sum(np.dot(X2.T[block_size * n_splits:],
                           X2[:, block_size * n_splits:]))
    # use delta_ to compute beta
    beta = 1. / (n_features * n_samples) * (beta_ / n_samples - delta_)
    # delta is the sum of the squared coefficients of (<X.T,X> - mu*Id) / p
    delta = delta_ - 2. * mu * emp_cov_trace.sum() + n_features * mu ** 2
    delta /= n_features
    # get final beta as the min between beta and delta
    beta = min(beta, delta)
    # finally get shrinkage
    shrinkage = beta / delta

    return shrinkage

def ledoit_wolf(X, assume_centered=False, block_size=1000):
    """Estimates the shrunk Ledoit-Wolf covariance matrix.

    Parameters
    ----------
    X: array-like, shape (n_samples, n_features)
      Data from which to compute the covariance estimate

    assume_centered: Boolean
      If True, data are not centered before computation.
      Usefull to work with data whose mean is significantly equal to
      zero but is not exactly zero.
      If False, data are centered before computation.

    block_size: int,
      Size of the blocks into which the covariance matrix will be split.
      If n_features > `block_size`, an error will be raised since the
      shrunk covariance matrix will be considered as too large regarding
      the available memory.

    Returns
    -------
    shrunk_cov: array-like, shape (n_features, n_features)
      Shrunk covariance.

    shrinkage: float
      Coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Notes
    -----
    The regularized (shrunk) covariance is:

    (1 - shrinkage)*cov
      + shrinkage * mu * np.identity(n_features)

    where mu = trace(cov) / n_features

    """
    X = np.asarray(X)
    # for only one feature, the result is the same whatever the shrinkage
    if len(X.shape) == 2 and X.shape[1] == 1:
        if not assume_centered:
            X = X - X.mean()
        return np.atleast_2d((X ** 2).mean()), 0.
    if X.ndim == 1:
        X = np.reshape(X, (1, -1))
        warnings.warn("Only one sample available. "
                      "You may want to reshape your data array")
        n_samples = 1
        n_features = X.size
    else:
        n_samples, n_features = X.shape

    if n_features > block_size:
        raise MemoryError("LW: n_features is too large, " +
                          "try increasing block_size")

    # get Ledoit-Wolf shrinkage
    shrinkage = ledoit_wolf_shrinkage(
        X, assume_centered=assume_centered, block_size=block_size)
    emp_cov = empirical_covariance(X, assume_centered=assume_centered)
    mu = np.sum(np.trace(emp_cov)) / n_features
    shrunk_cov = (1. - shrinkage) * emp_cov
    shrunk_cov.flat[::n_features + 1] += shrinkage * mu

    return shrunk_cov, shrinkage

class LedoitWolf(EmpiricalCovariance):
    """LedoitWolf Estimator

    Ledoit-Wolf is a particular form of shrinkage, where the shrinkage
    coefficient is computed using O. Ledoit and M. Wolf's formula as
    described in "A Well-Conditioned Estimator for Large-Dimensional
    Covariance Matrices", Ledoit and Wolf, Journal of Multivariate
    Analysis, Volume 88, Issue 2, February 2004, pages 365-411.

    Parameters
    ----------
    store_precision : bool
        Specify if the estimated precision is stored
    assume_centered: bool
        If True, data are not centered before computation.
        Useful when working with data whose mean is almost, but not exactly
        zero.
        If False (default), data are centered before computation.
    block_size: int,
        Size of the blocks into which the covariance matrix will be split
        during its Ledoit-Wolf estimation.
        If n_features > `block_size`, an error will be raised since the
        shrunk covariance matrix will be considered as too large regarding
        the available memory.

    Attributes
    ----------
    `covariance_` : array-like, shape (n_features, n_features)
        Estimated covariance matrix

    `precision_` : array-like, shape (n_features, n_features)
        Estimated pseudo inverse matrix.
        (stored only if store_precision is True)

    `shrinkage_`: float, 0 <= shrinkage <= 1
      coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Notes
    -----
    The regularised covariance is::

        (1 - shrinkage)*cov
                + shrinkage*mu*np.identity(n_features)

    where mu = trace(cov) / n_features
    and shinkage is given by the Ledoit and Wolf formula (see References)

    References
    ----------
    "A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices",
    Ledoit and Wolf, Journal of Multivariate Analysis, Volume 88, Issue 2,
    February 2004, pages 365-411.

    """
    def __init__(self, store_precision=True, assume_centered=False,
                 block_size=1000):
        EmpiricalCovariance.__init__(self, store_precision=store_precision,
                                     assume_centered=assume_centered)
        self.block_size = block_size

    def fit(self, X, y=None):
        """ Fits the Ledoit-Wolf shrunk covariance model
        according to the given training data and parameters.

        Parameters
        ----------
        X: array-like, shape = [n_samples, n_features]
          Training data, where n_samples is the number of samples
          and n_features is the number of features.
        y: not used, present for API consistence purpose.

        Returns
        -------
        self: object
          Returns self.

        """
        # Not calling the parent object to fit, to avoid computing the
        # covariance matrix (and potentially the precision)
        if self.assume_centered:
            self.location_ = np.zeros(X.shape[1])
        else:
            self.location_ = X.mean(0)
        covariance, shrinkage = ledoit_wolf(X - self.location_,
                                            assume_centered=True,
                                            block_size=self.block_size)
        self.shrinkage_ = shrinkage
        self._set_covariance(covariance)

        return self

###############################################################################
# OAS estimator

def oas(X, assume_centered=False):
    """Estimate covariance with the Oracle Approximating Shrinkage algorithm.

    Parameters
    ----------
    X: array-like, shape (n_samples, n_features)
        Data from which to compute the covariance estimate

    assume_centered: boolean
      If True, data are not centered before computation.
      Useful to work with data whose mean is significantly equal to
      zero but is not exactly zero.
      If False, data are centered before computation.

    Returns
    -------
    shrunk_cov: array-like, shape (n_features, n_features)
      Shrunk covariance

    shrinkage: float
      coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Notes
    -----
    The regularised (shrunk) covariance is:

    (1 - shrinkage)*cov
      + shrinkage * mu * np.identity(n_features)

    where mu = trace(cov) / n_features

    The formula we used to implement the OAS
    does not correspond to the one given in the article. It has been taken
    from the MATLAB program available from the author's webpage
    (https://tbayes.eecs.umich.edu/yilun/covestimation).

    """
    X = np.asarray(X)
    # for only one feature, the result is the same whatever the shrinkage
    if len(X.shape) == 2 and X.shape[1] == 1:
        if not assume_centered:
            X = X - X.mean()
        return np.atleast_2d((X ** 2).mean()), 0.
    if X.ndim == 1:
        X = np.reshape(X, (1, -1))
        warnings.warn("Only one sample available. "
                      "You may want to reshape your data array")
        n_samples = 1
        n_features = X.size
    else:
        n_samples, n_features = X.shape

    emp_cov = empirical_covariance(X, assume_centered=assume_centered)
    mu = np.trace(emp_cov) / n_features

    # formula from Chen et al.'s **implementation**
    alpha = np.mean(emp_cov ** 2)
    num = alpha + mu ** 2
    den = (n_samples + 1.) * (alpha - (mu ** 2) / n_features)

    shrinkage = min(num / den, 1.)
    shrunk_cov = (1. - shrinkage) * emp_cov
    shrunk_cov.flat[::n_features + 1] += shrinkage * mu

    return shrunk_cov, shrinkage

class OAS(EmpiricalCovariance):
    """
    Oracle Approximating Shrinkage Estimator

    OAS is a particular form of shrinkage described in
    "Shrinkage Algorithms for MMSE Covariance Estimation"
    Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010.

    The formula used here does not correspond to the one given in the
    article. It has been taken from the Matlab program available from the
    authors' webpage (https://tbayes.eecs.umich.edu/yilun/covestimation).

    Parameters
    ----------
    store_precision : bool
        Specify if the estimated precision is stored.
    assume_centered: bool
        If True, data are not centered before computation.
        Useful when working with data whose mean is almost, but not exactly
        zero.
        If False (default), data are centered before computation.

    Attributes
    ----------
    `covariance_` : array-like, shape (n_features, n_features)
        Estimated covariance matrix

    `precision_` : array-like, shape (n_features, n_features)
        Estimated pseudo inverse matrix.
        (stored only if store_precision is True)

    `shrinkage_`: float, 0 <= shrinkage <= 1
      coefficient in the convex combination used for the computation
      of the shrunk estimate.

    Notes
    -----
    The regularised covariance is::

        (1 - shrinkage)*cov
                + shrinkage*mu*np.identity(n_features)

    where mu = trace(cov) / n_features
    and shinkage is given by the OAS formula (see References)

    References
    ----------
    "Shrinkage Algorithms for MMSE Covariance Estimation"
    Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010.

    """
    def fit(self, X, y=None):
        """ Fits the Oracle Approximating Shrinkage covariance model
        according to the given training data and parameters.

        Parameters
        ----------
        X: array-like, shape = [n_samples, n_features]
          Training data, where n_samples is the number of samples
          and n_features is the number of features.
        y: not used, present for API consistence purpose.

        Returns
        -------
        self: object
          Returns self.

        """
        # Not calling the parent object to fit, to avoid computing the
        # covariance matrix (and potentially the precision)
        if self.assume_centered:
            self.location_ = np.zeros(X.shape[1])
        else:
            self.location_ = X.mean(0)

        covariance, shrinkage = oas(X - self.location_, assume_centered=True)
        self.shrinkage_ = shrinkage
        self._set_covariance(covariance)

        return self


text:
module Wallaby
  module RSpec
    module ControllerRoutes
      extend ActiveSupport::Concern
      included do
        routes { ::Wallaby::Engine.routes }
      end
    end
  end
end

RSpec.configure do |config|
  config.include Wallaby::RSpec::ControllerRoutes, type: :controller

  config.before :each, type: :controller do |example|
    controller.request.env['SCRIPT_NAME'] = example.metadata[:script_name] || '/admin'
  end
end


text:
angular
.module('myApp')
.controller('modelCtrl', function ($scope) {

    var scene = document.querySelector('a-scene');

    var camera = document.querySelector('#camera');

    var obj = document.querySelector('#tree-obj');
    var mtl = document.querySelector('#tree-mtl');
    var object3D = document.querySelector('#tree-mod');

    var wDelta = 0;
    var zBase = 8;

    $scope.model = 'shenron';
    $scope.switchModel = function (model) {
        $scope.setLoaded(false);
        obj.setAttribute('src', 'models/objects/' + model + '.obj');
        mtl.setAttribute('src', 'models/objects/' + model + '.mtl');
        object3D.setAttribute('obj-model', 'obj: #tree-obj; mtl: #tree-mtl');
    };
    $scope.zoom = function (val) {
        zBase += val;
        camera.setAttribute('position', {
            x: 0,
            y: 0,
            z: zBase
        });
    };
    scene.addEventListener('wheel', function zoom(e) {
        wDelta = e.wheelDelta < 0 ? +1 : -1;
        zBase += wDelta;
        camera.setAttribute('position', {
            x: 0,
            y: 0,
            z: zBase
        });
    });

    object3D.addEventListener('model-loaded', function (evt) {
    //    console.log(evt);
        $scope.setLoaded(true, true);
    })
});


text:
module CFDI.Types.Complement where

import CFDI.Types.PacStamp
import CFDI.Types.Payments
import CFDI.XmlNode
import Data.Maybe          (catMaybes)

data Complement = Complement
  { paymentsComplement :: Maybe Payments
  , stampComplement :: Maybe PacStamp
  } deriving (Eq, Show)

instance XmlNode Complement where
  children (Complement payments stamp) = catMaybes
    [ renderNode <$> payments
    , renderNode <$> stamp
    ]

  nodeName = const "Complemento"

  parseNode n = Complement
    <$> parseChild "Pagos" n
    <*> parseChild "TimbreFiscalDigital" n