text:
#region Apache Notice

#endregion

using System;
using System.Runtime.Serialization;

namespace IBatisNet.Common.Exceptions
{
	/// <summary>
	/// A DALForeignKeyException is thrown when foreign key error occured in a sql statement.
	/// </summary>
	/// <remarks>
	/// This exception is not used by the framework.
	/// </remarks>
	[Serializable]
	public class ForeignKeyException : IBatisNetException
	{
		/// <summary>
		/// Initializes a new instance of the <b>DalException</b> class.
		/// </summary>
		/// <remarks>
		/// This constructor initializes the <para>Message</para> property of the new instance
		/// to a system-supplied message that describes the error.
		/// </remarks>
		public ForeignKeyException() : base("A foreign key conflict has occurred.") { }

		/// <summary>
		/// Initializes a new instance of the <see cref="IBatisNet.Common.Exceptions.ForeignKeyException"/>
		/// class with a reference to the inner exception that is the cause of this exception.
		/// </summary>
		/// <remarks>
		/// This constructor initializes the Message property of the new instance to the Message property
		/// of the passed in exception.
		/// </remarks>
		/// <param name="ex">
		/// The exception that is the cause of the current exception.
		/// If the innerException parameter is not a null reference (Nothing in Visual Basic),
		/// the current exception is raised in a catch block that handles the inner exception.
		/// </param>
		public ForeignKeyException(Exception ex) : base (ex.Message,ex) {}

		/// <summary>
		/// Initializes a new instance of the <see cref="IBatisNet.Common.Exceptions.ForeignKeyException"/>
		/// class with a specified error message.
		/// </summary>
		/// <remarks>
		/// This constructor initializes the Message property of the new instance using
		/// the message parameter.
		/// </remarks>
		/// <param name="message">The message that describes the error.</param>
		public ForeignKeyException( string message ) : base ( message ) { }

		/// <summary>
		/// Initializes a new instance of the <see cref="IBatisNet.Common.Exceptions.ForeignKeyException"/>
		/// class with a specified error message and a reference to the inner exception that is the cause of this exception.
		/// </summary>
		/// <remarks>
		/// An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property.
		/// The InnerException property returns the same value that is passed into the constructor, or a null reference (Nothing in Visual Basic) if the InnerException property does not supply the inner exception value to the constructor.
		/// </remarks>
		/// <param name="message">The message that describes the error.</param>
		/// <param name="inner">The exception that caused the error</param>
		public ForeignKeyException( string message, Exception inner ) : base ( message, inner ) { }

		/// <summary>
		/// Initializes a new instance of the Exception class with serialized data.
		/// </summary>
		/// <remarks>
		/// This constructor is called during deserialization to reconstitute the exception
		/// object transmitted over a stream.
		/// </remarks>
		/// <param name="info">
		/// The <see cref="System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.
		/// </param>
		/// <param name="context">
		/// The <see cref="System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.
		/// </param>
		protected ForeignKeyException(SerializationInfo info, StreamingContext context) : base (info, context) {}

	}
}


text:
<?php
/**
 * CMS specific Newsitem feed builder
 *
 * @author pekkis
 * @package Emerald_Cms
 *
 */
class Emerald_Cms_Feed_Builder_NewsChannel implements Zend_Feed_Builder_Interface
{

    private $_channel;

    public function __construct(EmCore_Model_NewsChannelItem $channel)
    {
        $this->_channel = $channel;
        $this->_channel->items_per_page = 9999;
    }

    public function getHeader()
    {

        $request = Zend_Controller_Front::getInstance()->getRequest();

        $feedUrl = 'http://' . $request->getServer('HTTP_HOST') . $request->getRequestUri();

        $header = new Zend_Feed_Builder_Header($this->_channel->title, $feedUrl);
        $header->setDescription($this->_channel->description);
        $header->setGenerator("Emerald " . Emerald_Cms_Version::VERSION);

        $date = new DateTime($this->_channel->modified);

        $header->pubDate = $header->lastUpdate = $header->lastModified = $date->format('U');

        return $header;
    }

    public function getEntries()
    {
        $entries = array();

        $pageModel = new EmCore_Model_Page();
        $page = $pageModel->find($this->_channel->page_id);

        $request = Zend_Controller_Front::getInstance()->getRequest();

        foreach($this->_channel->getItems() as $item)
        {
            if(!$item->isValid()) {
                // Xml doesn't include invalids
                continue;
            }

            $link = 'http://' . $request->getServer('HTTP_HOST') . '/' . $page->beautifurl . '?a=view&id=' . $item->id;

            $entry = new Zend_Feed_Builder_Entry($item->title, $link, $item->description);

            $date = new DateTime($item->valid_start);

            $entry->pubDate = $entry->lastUpdate = $date->format('U');

            $entries[] = $entry;
        }

        return $entries;
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>Developing an Electricity-specific Mixed-unit Input-output Model for Life Cycle Assessment and Energy Policy Evaluation</AwardTitle>
    <AwardEffectiveDate>07/01/2010</AwardEffectiveDate>
    <AwardExpirationDate>06/30/2015</AwardExpirationDate>
    <AwardAmount>298159</AwardAmount>
    <AwardInstrument>
      <Value>Standard Grant</Value>
    </AwardInstrument>
    <Organization>
      07020000
      <Directorate>
        <LongName>Directorate For Engineering</LongName>
      </Directorate>
      <Division>
        <LongName>Div Of Chem, Bioeng, Env, & Transp Sys</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Bruce K. Hamilton</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>The objective of this proposal is to develop and verify a mixed unit life cycle analysis model of the US electric industry that includes environmental effects and the relationships to many major industries. The model will include both economic and energy/electricity flows. It is anticipated that this model will be a useful tool in energy and environmental policy decisions. Advances in the model will be due to including more interactions with other industries and a disaggregated (i.e. source-specific) power generation sector in the US. The model, if successful, will be an important tool for planners and policy makers.<br/><br/>Bruce K. Hamilton<br/>2/24/10</AbstractNarration>
    <MinAmdLetterDate>06/28/2010</MinAmdLetterDate>
    <MaxAmdLetterDate>05/12/2014</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>0967353</AwardID>
    <Investigator>
      <FirstName>Joe</FirstName>
      <LastName>Marriott</LastName>
      <EmailAddress>marriott@pitt.edu</EmailAddress>
      <StartDate>06/28/2010</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Gregory</FirstName>
      <LastName>Reed</LastName>
      <EmailAddress>gfr3@pitt.edu</EmailAddress>
      <StartDate>06/28/2010</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Vikas</FirstName>
      <LastName>Khanna</LastName>
      <EmailAddress>khannav@pitt.edu</EmailAddress>
      <StartDate>05/22/2013</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>University of Pittsburgh</Name>
      <CityName>Pittsburgh</CityName>
      <ZipCode>152132303</ZipCode>
      <PhoneNumber>4126247400</PhoneNumber>
      <StreetAddress>University Club</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>Pennsylvania</StateName>
      <StateCode>PA</StateCode>
    </Institution>
  </Award>
</rootTag>


text:
package us.ihmc.util;

import java.util.concurrent.atomic.AtomicLong;

/**
 * Padding atomic long class
 *
 * @see http://mechanical-sympathy.blogspot.com/2011/07/false-sharing.html
 * @see http://mechanical-sympathy.blogspot.com/2011/08/false-sharing-java-7.html
 *
 *
 * @author Jesper Smith
 *
 */
@SuppressWarnings("serial")
public class PaddedAtomicLong extends AtomicLong
{
   public volatile long p1, p2, p3, p4, p5, p6, p7 = 8L;

   public PaddedAtomicLong()
   {
      super();
   }

   public PaddedAtomicLong(long initialValue)
   {
      super(initialValue);
   }

   /**
    * Public function to avoid removal of padding
    *
    * @return sum of p
    *
    */
   public long avoidPaddingRemoval()
   {
      return p1 + p2 + p3 + p4 + p5 + p6 + p7;
   }
}


text:
package com.example;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class DemoResource {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String content;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}


text:
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* ioctl.c --- wrappers for Windows ioctl function

   Copyright (C) 2008-2011 Free Software Foundation, Inc.

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

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

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/* Written by Paolo Bonzini */

#include <config.h>

#include <sys/ioctl.h>

#include <stdarg.h>

#if HAVE_IOCTL

/* Provide a wrapper with the POSIX prototype.  */
# undef ioctl
int
rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */)
{
  void *buf;
  va_list args;

  va_start (args, request);
  buf = va_arg (args, void *);
  va_end (args);

  return ioctl (fd, request, buf);
}

#else /* mingw */

# define WIN32_LEAN_AND_MEAN
/* Get winsock2.h. */
# include <sys/socket.h>

/* Get set_winsock_errno, FD_TO_SOCKET etc. */
# include "w32sock.h"

int
ioctl (int fd, int req, ...)
{
  void *buf;
  va_list args;
  SOCKET sock;
  int r;

  va_start (args, req);
  buf = va_arg (args, void *);
  va_end (args);

  sock = FD_TO_SOCKET (fd);
  r = ioctlsocket (sock, req, buf);
  if (r < 0)
    set_winsock_errno ();

  return r;
}

#endif


text:
package org.ppwcode.vernacular.persistence_III.sql.mysql;

import static org.ppwcode.metainfo_I.License.Type.APACHE_V2;

import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.ppwcode.metainfo_I.Copyright;
import org.ppwcode.metainfo_I.License;
import org.ppwcode.metainfo_I.vcs.SvnInfo;
import org.ppwcode.vernacular.exception_II.ExternalError;
import org.ppwcode.vernacular.persistence_III.sql.SqlExceptionHandler;

/**
 * Growing implementation for handling general {@link SQLException SQLExceptions}
 * generated by MySQL.
 *
 * @author    Jan Dockx
 * @author    PeopleWare n.v.
 *
 * @mudo i18n
 */
@Copyright("2004 - $Date$, PeopleWare n.v.")
@License(APACHE_V2)
@SvnInfo(revision = "$Revision$",
         date     = "$Date$")
public class MySqlExceptionHandler implements SqlExceptionHandler {

  private static final Log LOG = LogFactory.getLog(MySqlExceptionHandler.class);

  /**
   * If the message of the given sql exception contains the string
   *   "Duplicate key or integrity constraint violation,  message from server: \"Duplicate entry"
   * or
   *   "Duplicate entry"
   * return a {@link MySqlException}.
   *
   * If the message of the given sql exception contains the string
   * "Duplicate key or integrity constraint violation,  "
   *             + "message from server: \"Cannot delete or update a "
   *             + "parent row: a foreign key constraint fails\""
   * return a {@link MySqlException}.
   *
   * Never return null.
   *
   * @mudo walk through the chain of exceptions to find a match
   */
  public MySqlException handle(final SQLException sqlExc) {
    assert sqlExc != null;
    if (sqlExc.getMessage()
              .indexOf("Duplicate key or integrity constraint violation,  "
                       + "message from server: \"Duplicate entry") >= 0
        || sqlExc.getMessage().indexOf("Duplicate entry") >= 0) {
      // WATCH OUT: SQL Error message contains 'dual space' after ','.
      MySqlException dkExc = new MySqlException("VALUE_NOT_UNIQUE", sqlExc);
      LOG.debug("recognized MySQL duplicate key exception", dkExc);
      return dkExc;
    }
    if (sqlExc.getMessage()
        .indexOf("Duplicate key or integrity constraint violation,  "
                 + "message from server: \"Cannot delete or update a "
                 + "parent row: a foreign key constraint fails\"") >= 0) {
      // WATCH OUT: SQL Error message contains 'dual space' after ','.
      MySqlException cExc = new MySqlException("CONSTRAINT_FAILURE", sqlExc);
      LOG.debug("recognized MySQL constraint violation exception", cExc);
      return cExc;
    }
    throw new ExternalError("MySQL error not recognized as internal", sqlExc);
  }

}


text:
  position: relative;
  float: right;
}
#tabzilla a {
  position: relative;
  display: block;
  width: 147px;
  height: 37px;
  text-indent: 120%;
  white-space: nowrap;
  overflow: hidden;
  background-image: url("/static/base/img/tabzilla/tabzilla-static.png");
  background-repeat: no-repeat;
  z-index: 2;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx) {
  #tabzilla a {
    background-image: url("/static/base/img/tabzilla/tabzilla-static-high-res.png");
    -webkit-background-size: 147px 37px;
    background-size: 147px 37px;
  }
}
#tabzilla:before {
  position: absolute;
  display: block;
  left: 28px;
  top: 0;
  width: 88px;
  height: 26px;
  content: '';
  background-color: transparent;
  z-index: 1;
}


text:
ALTER TABLE environment ADD COLUMN IF NOT EXISTS freeipaenablemultiaz boolean NOT NULL DEFAULT false;

-- //@UNDO
-- SQL to undo the change goes here.

ALTER TABLE environment DROP COLUMN IF EXISTS freeipaenablemultiaz;


text:
using System;
using XenAdmin.Diagnostics.Checks;
using XenAPI;
using XenAdmin.Actions;
using System.Collections.Generic;
using XenAdmin.Actions.VMActions;
using XenAdmin.Commands;
using System.Linq;

namespace XenAdmin.Diagnostics.Problems.PoolProblem
{
    class CPUIncompatibilityProblem : PoolProblem
    {
        private Dictionary<VM, XenRef<Host>> vmsOnHosts = new Dictionary<VM, XenRef<Host>>();

        public CPUIncompatibilityProblem(Check check, Pool pool)
            : base(check, pool)
        {
            foreach (var vm in pool.Connection.Cache.VMs.Where(vm => vm.is_a_real_vm() && vm.power_state != vm_power_state.Halted))
            {
                vmsOnHosts.Add(vm, vm.resident_on);
            }
        }

        protected override AsyncAction CreateAction(out bool cancelled)
        {
            cancelled = false;
            var actions = new List<AsyncAction>();
            foreach (var vm in vmsOnHosts.Keys)
            {
                if (vm.power_state == vm_power_state.Halted)
                    continue;
                if (vm.allowed_operations.Contains(vm_operations.clean_shutdown))
                    actions.Add(new VMCleanShutdown(vm));
                else
                    actions.Add(new VMHardShutdown(vm));
            }
            if (actions.Count > 0)
                return new MultipleAction(Pool.Connection, Messages.ACTION_VMS_SHUTTING_DOWN_TITLE,
                                      Messages.ACTION_VMS_SHUTTING_DOWN_TITLE, Messages.ACTION_SHUT_DOWN, actions, true, false, true);
            return null;
        }

        public override AsyncAction UnwindChanges()
        {

            var actions = new List<AsyncAction>();
            foreach (var vmOnHost in vmsOnHosts)
            {
                var vm = vmOnHost.Key;

                // check if the vm is still in the cache and is halted
                if (vm.Connection.Resolve(new XenRef<VM>(vm.opaque_ref)) == null || vm.power_state != vm_power_state.Halted)
                    continue;

                var startOn = vm.Connection.Resolve(vmOnHost.Value);

                if (startOn != null)
                    actions.Add(new VMStartOnAction(vm, startOn, VMOperationCommand.WarningDialogHAInvalidConfig, VMOperationCommand.StartDiagnosisForm));
                else
                    actions.Add(new VMStartAction(vm, VMOperationCommand.WarningDialogHAInvalidConfig, VMOperationCommand.StartDiagnosisForm));
            }

            if (actions.Count > 0)
                return new MultipleAction(Pool.Connection, Messages.ACTION_VMS_STARTING_ON_TITLE,
                                      Messages.ACTION_VMS_STARTING_ON_TITLE, Messages.ACTION_VM_STARTED, actions, true, false, true);
            return null;
        }

        public override string Description
        {
            get
            {
                return String.Format(Messages.UPGRADEWIZARD_PROBLEM_INCOMPATIBLE_CPUS, Pool);
            }
        }

        public override string HelpMessage
        {
            get
            {
                return Messages.UPGRADEWIZARD_PROBLEM_INCOMPATIBLE_CPUS_HELPMESSAGE;
            }
        }
    }

    class CPUCIncompatibilityWarning : Warning
    {
        private readonly Pool pool;
        private readonly Host host;

        public CPUCIncompatibilityWarning(Check check, Pool pool, Host host)
            : base(check)
        {
            this.pool = pool;
            this.host = host;
        }

        public override string Title
        {
            get { return Check.Description; }
        }

        public override string Description
        {
            get
            {
                return string.Format(Messages.UPGRADEWIZARD_WARNING_INCOMPATIBLE_CPUS, host, pool);
            }
        }
    }
}


text:
package org.eclipse.tm4e.markdown.marked;

import static org.eclipse.tm4e.markdown.marked.Helpers.escape;
import static org.eclipse.tm4e.markdown.marked.Helpers.isEmpty;

import java.util.regex.Matcher;

public class InlineLexer {

	private Options options;
	private InlineRules rules;
	private final IRenderer renderer;

	public InlineLexer(Object links, Options options, IRenderer renderer) {
		this.options = options != null ? options : Options.DEFAULTS;
		// this.links = links;
		this.rules = InlineRules.normal;
		this.renderer = renderer != null ? renderer : new HTMLRenderer();
		// this.renderer = this.options.renderer || new Renderer;
		// this.renderer.options = this.options;

		// if (!this.links) {
		// throw new
		// Error('Tokens array requires a `links` property.');
		// }

		if (this.options.isGfm()) {
			if (this.options.isBreaks()) {
				this.rules = InlineRules.breaks;
			} else {
				this.rules = InlineRules.gfm;
			}
		} else if (this.options.isPedantic()) {
			this.rules = InlineRules.pedantic;
		}
	}

	public void output(String src) {
		Matcher cap = null;
		while (!isEmpty(src)) {

			// strong
			if ((cap = this.rules.strong.exec(src)) != null) {
				src = src.substring(cap.group(0).length());
				this.renderer.startStrong();
				this.output(!isEmpty(cap.group(2)) ? cap.group(2) : cap.group(1));
				this.renderer.endStrong();
				continue;
			}

			// em
			if ((cap = this.rules.em.exec(src)) != null) {
				src = src.substring(cap.group(0).length());
				this.renderer.startEm();
				this.output(!isEmpty(cap.group(2)) ? cap.group(2) : cap.group(1));
				this.renderer.endEm();
				continue;
			}

			// code
			if ((cap = this.rules.code.exec(src)) != null) {
				src = src.substring(cap.group(0).length());
				this.renderer.codespan(escape(cap.group(2), true));
				continue;
			}

			// text
			if ((cap = this.rules.text.exec(src)) != null) {
				src = src.substring(cap.group(0).length());
				this.renderer.text(escape(this.smartypants(cap.group(0))));
				continue;
			}
		}
	}

	private String smartypants(String text) {
		return text;
	}

}


text:
namespace PhotoShare.Models.Enumerations
{
    public enum Role
    {
        Owner,
        Viewer
    }
}


text:
* gps: Add satisfiability check for case variants (#1079)
* Validate Project Roots in manifest (#1116)
* gps: Properly separate sources for different gopkg.in versions & github
(#1132)
* gps: Add persistent BoltDB cache (#1098)
* gps: Increase default subcommand timeout to 30s (#1087)
* Fix importer [issue](https://github.com/golang/dep/issues/939) where the
importer would drop the imported version of a project (#1100)
* Import analyzer now always uses the same name, fixing the lock mismatch
immediately after dep init issue (#1099)
* Add support for importing from [govend](https://github.com/govend/govend)
(#1040) and [LK4D4/vndr](https://github.com/LK4D4/vndr) (#978) based projects
* gps: gps no longer assumes that every git repo has a HEAD (#1053)
* `os.Chmod` failures on Windows due to long path length has been fixed (#925)
* Add `version` command (#996)
* Drop support for building with go1.7 (#714)
* gps: Parse abbreviated git revisions (#1027)
* gps: Parallelize writing dep tree (#1021)
* `status` now shows the progress in verbose mode (#1009, #1037)
* Fix empty `Constraint` and `Version` in `status` json output (#976)
* `status` table output now shows override constraints (#918)
* gps: Display warning message every 15 seconds when lockfile is busy (#958)
* gps: Hashing directory tree and tree verification (#959)
* `ensure` now has `-vendor-only` mode to populate vendor/ without updating
Gopkg.lock (#954)
* Use fork of Masterminds/semver until
Masterminds/semver [issue#59](https://github.com/Masterminds/semver/issues/59)
is fixed upstream (#938)
* gps: Ensure packages are deducible before attempting to solve (#697)


text:
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
    <script>
        window.hdjs = {};
        window.hdjs.base = '../';
        window.hdjs.uploader = 'php/uploader.php?';
        window.hdjs.filesLists = 'php/filesLists.php?';
    </script>
    <script src="../require.js"></script>
    <script src="../config.js"></script>
</head>
<body style="padding: 50px;">
<button onclick="upFile(this)" class="btn btn-success" type="button">选择文件</button>
<script>
    require(['bootstrap']);
    //上传图片
    function upFile() {
        require(['hdjs','bootstrap'], function (hdjs) {
            let options = {
                extensions: 'txt,php',
                //data是向后台服务器提交的POST数据
                data:{name:'后盾人',year:2099},
                //单个文件允许为5MB
                fileSingleSizeLimit:5 * 1024 * 1024
            };
            hdjs.file(function (files) {
                //上传成功的文件,数组类型
                console.log(files);
            }, options)
        });
    }
</script>
</body>
</html>


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

    <include layout="@layout/toolbar_sm1" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:padding="16dp">

        <TextView
            android:id="@+id/back_home"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="32dp"
            android:text="Back to home."
            android:textColor="#49A1FF"
            android:textSize="16sp"
            android:textStyle="bold" />

    </LinearLayout>

</LinearLayout>


text:
import os
import click
from . import commands

class LazyCLI(click.MultiCommand):
    '''Lazily imports interfaces from cgutils.commands package.'''

    def list_commands(self, ctx):
        cmds = [cmd for cmd in dir(commands) if not cmd.startswith('__')]
        return sorted(cmds)

    def get_command(self, ctx, name):
        cmd_module = getattr(commands, name)
        return cmd_module.cli

@click.group(cls=LazyCLI)
@click.pass_context
def cli(ctx):
    '''Command Line Tools for common tasks'''
    pass

if __name__ == '__main__':
    cli()


text: require_relative 'bs/application'


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item type="id" name="framLayoutId">false</item>
</resources>


text:
import { provide } from '@angular/core';
import { EVENT_MANAGER_PLUGINS } from '@angular/platform-browser';
import { DOMOutsideEventPlugin } from './src/dom-outside-event.plugin';

export const CUSTOM_EVENTS_PLUGINS = [
  provide(EVENT_MANAGER_PLUGINS, { multi: true, useClass: DOMOutsideEventPlugin })
];


text: [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.XPath.Extensions))]


text:
package com.sap.prd.mobile.ios.mios;

public interface IEffectiveBuildSettings
{
  static final String PRODUCT_NAME = "PRODUCT_NAME";
  static final String SRC_ROOT = "SRCROOT";
  static final String GCC_GENERATE_DEBUGGING_SYMBOLS = "GCC_GENERATE_DEBUGGING_SYMBOLS";
  static final String DEBUG_INFORMATION_FORMAT = "DEBUG_INFORMATION_FORMAT";
  static final String CODE_SIGN_IDENTITY = "CODE_SIGN_IDENTITY";
  static final String CODESIGNING_FOLDER_PATH = "CODESIGNING_FOLDER_PATH";
  static final String INFOPLIST_FILE = "INFOPLIST_FILE";
  static final String PUBLIC_HEADERS_FOLDER_PATH = "PUBLIC_HEADERS_FOLDER_PATH";
  static final String BUILT_PRODUCTS_DIR = "BUILT_PRODUCTS_DIR";
  static final String CONFIGURATION_BUILD_DIR = "CONFIGURATION_BUILD_DIR";

  String getBuildSettingByKey(IXCodeContext context, String key);
}


text:
package org.zstack.test.deployer.schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;

/**
 *
Java class for ZoneUnion complex type.
 *

 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <complexType name="ZoneUnion">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="zone" type="{http://zstack.org/schema/zstack}ZoneConfig" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ZoneUnion", propOrder = {
        "zone"
})
public class ZoneUnion {

    protected List<ZoneConfig> zone;

    /**
     * Gets the value of the zone property.
     *

     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the zone property.
     *

     *

     * For example, to add a new item, do as follows:
     *

     *    getZone().add(newItem);
     *

     *

     *

     *

     * Objects of the following type(s) are allowed in the list
     * {@link ZoneConfig }
     */
    public List<ZoneConfig> getZone() {
        if (zone == null) {
            zone = new ArrayList<ZoneConfig>();
        }
        return this.zone;
    }

}


text:
package org.apache.axis.client ;

import javax.xml.namespace.QName;
import javax.xml.rpc.handler.HandlerChain;

import org.apache.axis.AxisEngine;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
import org.apache.axis.EngineConfiguration;
import org.apache.axis.Handler;
import org.apache.axis.MessageContext;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.configuration.EngineConfigurationFactoryFinder;
import org.apache.axis.handlers.HandlerInfoChainFactory;
import org.apache.axis.handlers.soap.MustUnderstandChecker;
import org.apache.axis.handlers.soap.SOAPService;
import org.apache.axis.utils.Messages;
import org.apache.commons.logging.Log;

/**
 * Provides the equivalent of an "Axis engine" on the client side.
 * Subclasses hardcode initialization & setup logic for particular
 * client-side transports.
 *
 * @author Rob Jellinghaus (robj@unrealities.com)
 * @author Doug Davis (dug@us.ibm.com)
 * @author Glen Daniels (gdaniels@allaire.com)
 */
public class AxisClient extends AxisEngine {
    protected static Log log =
            LogFactory.getLog(AxisClient.class.getName());

    MustUnderstandChecker checker = new MustUnderstandChecker(null);

    public AxisClient(EngineConfiguration config) {
        super(config);
    }

    public AxisClient() {
        this(EngineConfigurationFactoryFinder.newFactory().
                getClientEngineConfig());
    }

    /**
     * @return this instance, as this is the client engine
     */
    public AxisEngine getClientEngine () {
        return this;
    }

    /**
     * Main routine of the AXIS engine.  In short we locate the appropriate
     * handler for the desired service and invoke() it.
     *
     * @param msgContext the MessageContext to invoke relative
     *                   to
     * @throws AxisFault if anything goes wrong during invocation
     */
    public void invoke(MessageContext msgContext) throws AxisFault {
        if (log.isDebugEnabled()) {
            log.debug("Enter: AxisClient::invoke");
        }
        String hName = null;
        Handler h = null;
        HandlerChain handlerImpl = null;

        // save previous context
        MessageContext previousContext = getCurrentMessageContext();
        try {
            // set active context
            setCurrentMessageContext(msgContext);
            hName = msgContext.getStrProp(MessageContext.ENGINE_HANDLER);
            if (log.isDebugEnabled()) {
                log.debug("EngineHandler: " + hName);
            }
            if (hName != null) {
                h = getHandler(hName);
                if (h != null)
                    h.invoke(msgContext);
                else
                    throw new AxisFault("Client.error",
                            Messages.getMessage("noHandler00",
                                    hName),
                            null, null);
            } else {
                /* Now we do the 'real' work.  The flow is basically:         */
                /*                                                            */
                /*   Service Specific Request Chain                           */
                /*   Global Request Chain                                     */
                /*   Transport Request Chain - must have a send at the end    */
                /*   Transport Response Chain                                 */
                /*   Global Response Chain                                    */
                /*   Service Specific Response Chain                          */
                /*   Protocol Specific-Handler/Checker                        */
                /**************************************************************/
                SOAPService service = null;
                msgContext.setPastPivot(false);

                /* Process the Service Specific Request Chain */
                /**********************************************/
                service = msgContext.getService();
                if (service != null) {
                    h = service.getRequestHandler();
                    if (h != null)
                        h.invoke(msgContext);
                }

                /* Process the Global Request Chain */
                /**********************************/
                if ((h = getGlobalRequest()) != null)
                    h.invoke(msgContext);

                /* Process the JAX-RPC Handlers  - handleRequest.
                 * Make sure to set the pastPivot to true if this returns a
                 * false. In that case we do not invoke the transport request
                 * chain. Also note that if a a false was returned from the
                 * JAX-RPC handler chain, then the chain still holds the index
                 * of the handler that returned false. So when we invoke the
                 * handleResponse method of the chain, it will correctly call
                 * the handleResponse from that specific handler instance. So
                 * do not destroy the chain at this point - the chain will be
                 * destroyed in the finally block.
                 */
                handlerImpl = getJAXRPChandlerChain(msgContext);
                if (handlerImpl != null) {
                    try {
                        if (!handlerImpl.handleRequest(msgContext)) {
                            msgContext.setPastPivot(true);
                        }
                    } catch (RuntimeException re) {
                        handlerImpl.destroy();  // WS4EE 1.1 6.2.2.1 Handler Life Cycle. "RuntimeException" --> destroy handler
                        throw re;
                    }
                }

                /** Process the Transport Specific stuff
                 *
                 * NOTE: Somewhere in here there is a handler which actually
                 * sends the message and receives a response.  Generally
                 * this is the pivot point in the Transport chain. But invoke
                 * this only if pivot point has not been set to false. This
                 * can be set to false if any of the JAX-RPC handler's
                 * handleRequest returned false.
                 */
                if (!msgContext.getPastPivot()) {
                    hName = msgContext.getTransportName();
                    if (hName != null && (h = getTransport(hName)) != null) {
                        try {
                            h.invoke(msgContext);
                        } catch (AxisFault e) {
                            throw e;
                        }
                    } else {
                        throw new AxisFault(Messages.getMessage("noTransport00",
                                hName));
                    }
                }

                msgContext.setPastPivot(true);
                if (!msgContext.isPropertyTrue(Call.ONE_WAY)) {
                    if ((handlerImpl != null) &&
                            !msgContext.isPropertyTrue(Call.ONE_WAY)) {
                        try {
                            handlerImpl.handleResponse(msgContext);
                        } catch (RuntimeException ex) {
                            handlerImpl.destroy();  // WS4EE 1.1 6.2.2.1 Handler Life Cycle. "RuntimeException" --> destroy handler
                            throw ex;
                        }
                    }

                    /* Process the Global Response Chain */
                    /***********************************/
                    if ((h = getGlobalResponse()) != null) {
                        h.invoke(msgContext);
                    }

                    /* Process the Service-Specific Response Chain */
                    /***********************************************/
                    if (service != null) {
                        h = service.getResponseHandler();
                        if (h != null) {
                            h.invoke(msgContext);
                        }
                    }

                    // Do SOAP Semantics checks here - this needs to be a call
                    // to a pluggable object/handler/something
                    if (msgContext.isPropertyTrue(Call.CHECK_MUST_UNDERSTAND,
                            true)) {
                        checker.invoke(msgContext);
                    }
                }
            }
        } catch (Exception e) {
            // Should we even bother catching it ?
            if (e instanceof AxisFault) {
                throw (AxisFault) e;
            } else {
                log.debug(Messages.getMessage("exception00"), e);
                throw AxisFault.makeFault(e);
            }
        } finally {
            if (handlerImpl != null) {
                handlerImpl.destroy();
            }
            // restore previous state
            setCurrentMessageContext(previousContext);
        }
        if (log.isDebugEnabled()) {
            log.debug("Exit: AxisClient::invoke");
        }
    }

    /**
     * @param context Stores the Service, port QName and optionnaly a HandlerInfoChainFactory
     * @return Returns a HandlerChain if one has been specified
     */
    protected HandlerChain getJAXRPChandlerChain(MessageContext context) {
        java.util.List chain = null;
        HandlerInfoChainFactory hiChainFactory = null;
        boolean clientSpecified = false;

        Service service = (Service) context.getProperty(Call.WSDL_SERVICE);
        if(service == null) {
            return null;
        }

        QName portName = (QName) context.getProperty(Call.WSDL_PORT_NAME);
        if(portName == null) {
            return null;
        }

        javax.xml.rpc.handler.HandlerRegistry registry;
        registry = service.getHandlerRegistry();
        if(registry != null) {
            chain = registry.getHandlerChain(portName);
            if ((chain != null) && (!chain.isEmpty())) {
                hiChainFactory = new HandlerInfoChainFactory(chain);
                clientSpecified = true;
            }
        }

        // Otherwise, use the container support
        if (!clientSpecified) {
            SOAPService soapService = context.getService();
            if (soapService != null) {
                // A client configuration exists for this service.  Check
                // to see if there is a HandlerInfoChain configured on it.
                hiChainFactory = (HandlerInfoChainFactory)
                        soapService.getOption(Constants.ATTR_HANDLERINFOCHAIN);
            }
        }

        if (hiChainFactory == null) {
            return null;
        }

        return hiChainFactory.createHandlerChain();
    }

}


text:
#include <aws/ec2/model/DescribeIdentityIdFormatRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::EC2::Model;
using namespace Aws::Utils;

DescribeIdentityIdFormatRequest::DescribeIdentityIdFormatRequest() :
    m_principalArnHasBeenSet(false),
    m_resourceHasBeenSet(false)
{
}

Aws::String DescribeIdentityIdFormatRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=DescribeIdentityIdFormat&";
  if(m_principalArnHasBeenSet)
  {
    ss << "PrincipalArn=" << StringUtils::URLEncode(m_principalArn.c_str()) << "&";
  }

  if(m_resourceHasBeenSet)
  {
    ss << "Resource=" << StringUtils::URLEncode(m_resource.c_str()) << "&";
  }

  ss << "Version=2016-11-15";
  return ss.str();
}

void  DescribeIdentityIdFormatRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}


text:
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace BusinessModel.Core.Models.Mapping
{
    public class saleMap : EntityTypeConfiguration<sale>
    {
        public saleMap()
        {
            // Primary Key
            this.HasKey(t => new { t.stor_id, t.ord_num, t.title_id });

            // Properties
            this.Property(t => t.stor_id)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.ord_num)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.payterms)
                .IsRequired()
                .HasMaxLength(12);

            this.Property(t => t.title_id)
                .IsRequired()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("sales");
            this.Property(t => t.stor_id).HasColumnName("stor_id");
            this.Property(t => t.ord_num).HasColumnName("ord_num");
            this.Property(t => t.ord_date).HasColumnName("ord_date");
            this.Property(t => t.qty).HasColumnName("qty");
            this.Property(t => t.payterms).HasColumnName("payterms");
            this.Property(t => t.title_id).HasColumnName("title_id");

            // Relationships
            this.HasRequired(t => t.store)
                .WithMany(t => t.sales)
                .HasForeignKey(d => d.stor_id);
            this.HasRequired(t => t.title)
                .WithMany(t => t.sales)
                .HasForeignKey(d => d.title_id);

        }
    }
}


text:
export default function ucFirst(str) {
	return str[0].toUpperCase() + str.substring(1);
}


text:
/*******************************************************************************
 jquery.raphael.spinner
 email: hunterae@gmail.com
 site: http://captico.com

 Licences: MIT, GPL
 http://www.opensource.org/licenses/mit-license.php
 http://www.gnu.org/licenses/gpl.html
 ******************************************************************************/

/*
    VERSION: Raphael Spinner jQuery Plugin 1.0

    REQUIRES: jquery.js (tested with 1.4.2), Raphael JS (tested with 1.5.2)

    SYNTAX: $(selector).spinner(options);     // Creates new spinner

    OPTIONS:

    innerRadius : integer (default = 6)
    outerRadius : integer (default = 12)
    dashes      : integer (default = 12)
    strokeWidth : integer (default = 2)
    color       : string (default = "#333")

  See http://raphaeljs.com/spin-spin-spin.html for a demo usage of these parameters
  (innerRadius is called "Radius 1" there and outerRadius is called "Radius 2" there)

    The innerRadius parameter specifies the distance between the inner most point in the
    spinner and the start of the dashes.

    The outerRadius parameter specifies the length of the dashes.

    The dashes parameter specifies the number of dashes that make up the spinner.

    The strokeWidth parameter specifies how thick the dashes of the spinner are.

    The color parameter specifies the color of the spinner.

    EXPLANATION:

    This jQuery plug-in leverages Raphaël (http://raphaeljs.com/) to very easily
    create custom-tailored spinners that have your desired color, radii, stroke
    widths, and number of dashes.

  A sample usage of this plugin would be:

  $(".some-spinner-class").spinner({innerRadius: 50, outerRadius: 100, dashes: 40, strokeWidth: 4});

  Please note that whatever element you specify in the jQuery selector will not be replaced with the spinner;
  rather it will merely draw the Raphael canvas within that element.

    AUTHOR: Andrew Hunter (hunterae@gmail.com) and Todd Fisher (todd@captico.com)
    Thanks to RaphaelJS!!!!
    This work is in the public domain, and it is not supported in any way. Use it at your own risk.
*/

(function($) {
  // thanks to RaphaelJS!!!!
  function spinner(holderid, R1, R2, count, stroke_width, colour) {
    var sectorsCount = count || 12,
        color = colour || "#fff",
        width = stroke_width || 15,
        r1 = Math.min(R1, R2) || 35,
        r2 = Math.max(R1, R2) || 60,
        cx = r2 + width,
        cy = r2 + width,
        r = Raphael(holderid, r2 * 2 + width * 2, r2 * 2 + width * 2),

        sectors = [],
        opacity = [],
        beta = 2 * Math.PI / sectorsCount,

        pathParams = {stroke: color, "stroke-width": width, "stroke-linecap": "round"};
        Raphael.getColor.reset();
    for (var i = 0; i < sectorsCount; i++) {
        var alpha = beta * i - Math.PI / 2,
            cos = Math.cos(alpha),
            sin = Math.sin(alpha);
        opacity[i] = 1 / sectorsCount * i;
        sectors[i] = r.path([["M", cx + r1 * cos, cy + r1 * sin], ["L", cx + r2 * cos, cy + r2 * sin]]).attr(pathParams);
        if (color == "rainbow") {
            sectors[i].attr("stroke", Raphael.getColor());
        }
    }
    (function ticker() {
        opacity.unshift(opacity.pop());
        for (var i = 0; i < sectorsCount; i++) {
            sectors[i].attr("opacity", opacity[i]);
        }
        r.safari();
        tick = setTimeout(ticker, 2000 / sectorsCount);
    })();
    return function () {
        clearTimeout(tick);
        r.remove();
    };
  }

  $.fn.spinner = function(options) {
    options = $.extend({
      innerRadius: 6,
      outerRadius: 12,
      dashes: 12,
      strokeWidth: 2,
      color: "#333"
    }, options);

    $(this).each(function() {
      spinner(this, options['innerRadius'], options['outerRadius'], options['dashes'], options['strokeWidth'], options['color']);
    });

    return this;
  }
})(jQuery);


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/specific-reproductions/the-prophet-joseph-smith-picture" xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-reproductions/the-prophet-joseph-smith-picture</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object datatype="xsd:string" xml:lang="eng">The Prophet Joseph Smith (Picture)</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-reproductions/the-prophet-joseph-smith-picture</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-reproductions/the-prophet-joseph-smith-picture</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object>
  </sem:triple>
</sem:triples>


text:
package com.felipecsl.asymmetricgridview.library.widget;

import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.ListAdapter;
import android.widget.ListView;

import com.felipecsl.asymmetricgridview.library.Utils;

public class AsymmetricGridView extends ListView {

  private static final int DEFAULT_COLUMN_COUNT = 2;
  private static final String TAG = "AsymmetricGridView";
  protected int numColumns = DEFAULT_COLUMN_COUNT;
  protected int requestedHorizontalSpacing;
  protected int requestedColumnWidth;
  protected int requestedColumnCount;
  protected boolean allowReordering;
  protected boolean debugging;
  protected AsymmetricGridViewAdapter gridAdapter;
  protected OnItemClickListener onItemClickListener;
  protected OnItemLongClickListener onItemLongClickListener;

  public AsymmetricGridView(Context context, AttributeSet attrs) {
    super(context, attrs);

    requestedHorizontalSpacing = Utils.dpToPx(context, 5);

    final ViewTreeObserver vto = getViewTreeObserver();
    if (vto != null) {
      vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override @SuppressWarnings("deprecation") public void onGlobalLayout() {
          getViewTreeObserver().removeGlobalOnLayoutListener(this);
          determineColumns();
          if (gridAdapter != null) {
            gridAdapter.recalculateItemsPerRow();
          }
        }
      });
    }
  }

  @Override public void setOnItemClickListener(OnItemClickListener listener) {
    onItemClickListener = listener;
  }

  protected void fireOnItemClick(int position, View v) {
    if (onItemClickListener != null) {
      onItemClickListener.onItemClick(this, v, position, v.getId());
    }
  }

  @Override public void setOnItemLongClickListener(OnItemLongClickListener listener) {
    onItemLongClickListener = listener;
  }

  protected boolean fireOnItemLongClick(int position, View v) {
    return onItemLongClickListener != null && onItemLongClickListener
        .onItemLongClick(this, v, position, v.getId());
  }

  @Override
  @SuppressWarnings("unchecked")
  public void setAdapter(@NonNull ListAdapter adapter) {
    if (!(adapter instanceof AsymmetricGridViewAdapter)) {
      throw new UnsupportedOperationException(
          "Adapter must be an instance of AsymmetricGridViewAdapter");
    }

    gridAdapter = (AsymmetricGridViewAdapter) adapter;
    super.setAdapter(adapter);

    gridAdapter.recalculateItemsPerRow();
  }

  public void setRequestedColumnWidth(int width) {
    requestedColumnWidth = width;
  }

  public void setRequestedColumnCount(int requestedColumnCount) {
    this.requestedColumnCount = requestedColumnCount;
  }

  public int getRequestedHorizontalSpacing() {
    return requestedHorizontalSpacing;
  }

  public void setRequestedHorizontalSpacing(int spacing) {
    requestedHorizontalSpacing = spacing;
  }

  @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    determineColumns();
  }

  public int determineColumns() {
    int numColumns;
    int availableSpace = getAvailableSpace();

    if (requestedColumnWidth > 0) {
      numColumns = (availableSpace + requestedHorizontalSpacing) /
                   (requestedColumnWidth + requestedHorizontalSpacing);
    } else if (requestedColumnCount > 0) {
      numColumns = requestedColumnCount;
    } else {
      // Default to 2 columns
      numColumns = DEFAULT_COLUMN_COUNT;
    }

    if (numColumns <= 0) {
      numColumns = 1;
    }

    this.numColumns = numColumns;

    return numColumns;
  }

  @Override @NonNull
  public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SavedState ss = new SavedState(superState);
    ss.allowReordering = allowReordering;
    ss.debugging = debugging;
    ss.numColumns = numColumns;
    ss.requestedColumnCount = requestedColumnCount;
    ss.requestedColumnWidth = requestedColumnWidth;
    ss.requestedHorizontalSpacing = requestedHorizontalSpacing;

//        if (gridAdapter != null)
//            ss.adapterState = gridAdapter.saveState();

    return ss;
  }

  @Override
  public void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof SavedState)) {
      super.onRestoreInstanceState(state);
      return;
    }

    SavedState ss = (SavedState) state;
    super.onRestoreInstanceState(ss.getSuperState());

    allowReordering = ss.allowReordering;
    debugging = ss.debugging;
    numColumns = ss.numColumns;
    requestedColumnCount = ss.requestedColumnCount;
    requestedColumnWidth = ss.requestedColumnWidth;
    requestedHorizontalSpacing = ss.requestedHorizontalSpacing;

//        if (gridAdapter != null)
//            gridAdapter.restoreState(ss.adapterState);

    setSelectionFromTop(20, 0);
  }

  public int getNumColumns() {
    return numColumns;
  }

  public int getColumnWidth() {
    return (getAvailableSpace() - ((numColumns - 1) * requestedHorizontalSpacing)) / numColumns;
  }

  public int getAvailableSpace() {
    return getMeasuredWidth() - getPaddingLeft() - getPaddingRight();
  }

  public boolean isAllowReordering() {
    return allowReordering;
  }

  public void setAllowReordering(boolean allowReordering) {
    this.allowReordering = allowReordering;
    if (gridAdapter != null) {
      gridAdapter.recalculateItemsPerRow();
    }
  }

  public boolean isDebugging() {
    return debugging;
  }

  public void setDebugging(boolean debugging) {
    this.debugging = debugging;
  }

  public static class SavedState extends BaseSavedState {

    int numColumns;
    int requestedColumnWidth;
    int requestedColumnCount;
    int requestedVerticalSpacing;
    int requestedHorizontalSpacing;
    int defaultPadding;
    boolean debugging;
    boolean allowReordering;
    Parcelable adapterState;
    ClassLoader loader;

    public SavedState(Parcelable superState) {
      super(superState);
    }

    SavedState(Parcel in) {
      super(in);

      numColumns = in.readInt();
      requestedColumnWidth = in.readInt();
      requestedColumnCount = in.readInt();
      requestedVerticalSpacing = in.readInt();
      requestedHorizontalSpacing = in.readInt();
      defaultPadding = in.readInt();
      debugging = in.readByte() == 1;
      allowReordering = in.readByte() == 1;
      adapterState = in.readParcelable(loader);
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
      super.writeToParcel(dest, flags);

      dest.writeInt(numColumns);
      dest.writeInt(requestedColumnWidth);
      dest.writeInt(requestedColumnCount);
      dest.writeInt(requestedVerticalSpacing);
      dest.writeInt(requestedHorizontalSpacing);
      dest.writeInt(defaultPadding);
      dest.writeByte((byte) (debugging ? 1 : 0));
      dest.writeByte((byte) (allowReordering ? 1 : 0));
      dest.writeParcelable(adapterState, flags);
    }

    public static final Parcelable.Creator<SavedState> CREATOR =
        new Parcelable.Creator<SavedState>() {
          @Override
          public SavedState createFromParcel(@NonNull Parcel in) {
            return new SavedState(in);
          }

          @Override @NonNull
          public SavedState[] newArray(int size) {
            return new SavedState[size];
          }
        };
  }
}


text:
/**
 * @file mali_osk_notification.c
 * Implementation of the OS abstraction layer for the kernel device driver
 */

#include "mali_osk.h"
#include "mali_kernel_common.h"

#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>

/**
 * Declaration of the notification queue object type
 * Contains a linked list of notification pending delivery to user space.
 * It also contains a wait queue of exclusive waiters blocked in the ioctl
 * When a new notification is posted a single thread is resumed.
 */
struct _mali_osk_notification_queue_t_struct {
	spinlock_t mutex; /**< Mutex protecting the list */
	wait_queue_head_t receive_queue; /**< Threads waiting for new entries to the queue */
	struct list_head head; /**< List of notifications waiting to be picked up */
};

typedef struct _mali_osk_notification_wrapper_t_struct {
	struct list_head list;           /**< Internal linked list variable */
	_mali_osk_notification_t data;   /**< Notification data */
} _mali_osk_notification_wrapper_t;

_mali_osk_notification_queue_t *_mali_osk_notification_queue_init( void )
{
	_mali_osk_notification_queue_t *	result;

	result = (_mali_osk_notification_queue_t *)kmalloc(sizeof(_mali_osk_notification_queue_t), GFP_KERNEL);
	if (NULL == result) return NULL;

	spin_lock_init(&result->mutex);
	init_waitqueue_head(&result->receive_queue);
	INIT_LIST_HEAD(&result->head);

	return result;
}

_mali_osk_notification_t *_mali_osk_notification_create( u32 type, u32 size )
{
	/* OPT Recycling of notification objects */
	_mali_osk_notification_wrapper_t *notification;

	notification = (_mali_osk_notification_wrapper_t *)kmalloc( sizeof(_mali_osk_notification_wrapper_t) + size,
	               GFP_KERNEL | __GFP_HIGH | __GFP_REPEAT);
	if (NULL == notification) {
		MALI_DEBUG_PRINT(1, ("Failed to create a notification object\n"));
		return NULL;
	}

	/* Init the list */
	INIT_LIST_HEAD(&notification->list);

	if (0 != size) {
		notification->data.result_buffer = ((u8*)notification) + sizeof(_mali_osk_notification_wrapper_t);
	} else {
		notification->data.result_buffer = NULL;
	}

	/* set up the non-allocating fields */
	notification->data.notification_type = type;
	notification->data.result_buffer_size = size;

	/* all ok */
	return &(notification->data);
}

void _mali_osk_notification_delete( _mali_osk_notification_t *object )
{
	_mali_osk_notification_wrapper_t *notification;
	MALI_DEBUG_ASSERT_POINTER( object );

	notification = container_of( object, _mali_osk_notification_wrapper_t, data );

	/* Free the container */
	kfree(notification);
}

void _mali_osk_notification_queue_term( _mali_osk_notification_queue_t *queue )
{
	_mali_osk_notification_t *result;
	MALI_DEBUG_ASSERT_POINTER( queue );

	while (_MALI_OSK_ERR_OK == _mali_osk_notification_queue_dequeue(queue, &result)) {
		_mali_osk_notification_delete( result );
	}

	/* not much to do, just free the memory */
	kfree(queue);
}
void _mali_osk_notification_queue_send( _mali_osk_notification_queue_t *queue, _mali_osk_notification_t *object )
{
#if defined(MALI_UPPER_HALF_SCHEDULING)
	unsigned long irq_flags;
#endif

	_mali_osk_notification_wrapper_t *notification;
	MALI_DEBUG_ASSERT_POINTER( queue );
	MALI_DEBUG_ASSERT_POINTER( object );

	notification = container_of( object, _mali_osk_notification_wrapper_t, data );

#if defined(MALI_UPPER_HALF_SCHEDULING)
	spin_lock_irqsave(&queue->mutex, irq_flags);
#else
	spin_lock(&queue->mutex);
#endif

	list_add_tail(&notification->list, &queue->head);

#if defined(MALI_UPPER_HALF_SCHEDULING)
	spin_unlock_irqrestore(&queue->mutex, irq_flags);
#else
	spin_unlock(&queue->mutex);
#endif

	/* and wake up one possible exclusive waiter */
	wake_up(&queue->receive_queue);
}

_mali_osk_errcode_t _mali_osk_notification_queue_dequeue( _mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result )
{
#if defined(MALI_UPPER_HALF_SCHEDULING)
	unsigned long irq_flags;
#endif

	_mali_osk_errcode_t ret = _MALI_OSK_ERR_ITEM_NOT_FOUND;
	_mali_osk_notification_wrapper_t *wrapper_object;

#if defined(MALI_UPPER_HALF_SCHEDULING)
	spin_lock_irqsave(&queue->mutex, irq_flags);
#else
	spin_lock(&queue->mutex);
#endif

	if (!list_empty(&queue->head)) {
		wrapper_object = list_entry(queue->head.next, _mali_osk_notification_wrapper_t, list);
		*result = &(wrapper_object->data);
		list_del_init(&wrapper_object->list);
		ret = _MALI_OSK_ERR_OK;
	}

#if defined(MALI_UPPER_HALF_SCHEDULING)
	spin_unlock_irqrestore(&queue->mutex, irq_flags);
#else
	spin_unlock(&queue->mutex);
#endif

	return ret;
}

_mali_osk_errcode_t _mali_osk_notification_queue_receive( _mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result )
{
	/* check input */
	MALI_DEBUG_ASSERT_POINTER( queue );
	MALI_DEBUG_ASSERT_POINTER( result );

	/* default result */
	*result = NULL;

	if (wait_event_interruptible(queue->receive_queue,
	                             _MALI_OSK_ERR_OK == _mali_osk_notification_queue_dequeue(queue, result))) {
		return _MALI_OSK_ERR_RESTARTSYSCALL;
	}

	return _MALI_OSK_ERR_OK; /* all ok */
}


text:
namespace MySqlTest
{
    partial class frmDataSet
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.gridControl1 = new DevExpress.XtraGrid.GridControl();
            this.datasetBindingSource = new System.Windows.Forms.BindingSource(this.components);
            this.esmeenvironmentDataSetBindingSource = new System.Windows.Forms.BindingSource(this.components);
            this.esme_environmentDataSet = new MySqlTest.esme_environmentDataSet();
            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.colidDataSet = new DevExpress.XtraGrid.Columns.GridColumn();
            this.colidDataType = new DevExpress.XtraGrid.Columns.GridColumn();
            this.colName = new DevExpress.XtraGrid.Columns.GridColumn();
            this.datasetTableAdapter = new MySqlTest.esme_environmentDataSetTableAdapters.datasetTableAdapter();
            ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.datasetBindingSource)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.esmeenvironmentDataSetBindingSource)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.esme_environmentDataSet)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
            this.SuspendLayout();
            //
            // gridControl1
            //
            this.gridControl1.DataSource = this.datasetBindingSource;
            this.gridControl1.Location = new System.Drawing.Point(13, 13);
            this.gridControl1.MainView = this.gridView1;
            this.gridControl1.Name = "gridControl1";
            this.gridControl1.Size = new System.Drawing.Size(400, 200);
            this.gridControl1.TabIndex = 0;
            this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
            this.gridView1});
            //
            // datasetBindingSource
            //
            this.datasetBindingSource.DataMember = "dataset";
            this.datasetBindingSource.DataSource = this.esmeenvironmentDataSetBindingSource;
            //
            // esmeenvironmentDataSetBindingSource
            //
            this.esmeenvironmentDataSetBindingSource.DataSource = this.esme_environmentDataSet;
            this.esmeenvironmentDataSetBindingSource.Position = 0;
            //
            // esme_environmentDataSet
            //
            this.esme_environmentDataSet.DataSetName = "esme_environmentDataSet";
            this.esme_environmentDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
            //
            // gridView1
            //
            this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.colidDataSet,
            this.colidDataType,
            this.colName});
            this.gridView1.GridControl = this.gridControl1;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsCustomization.AllowColumnMoving = false;
            this.gridView1.OptionsCustomization.AllowColumnResizing = false;
            this.gridView1.OptionsCustomization.AllowFilter = false;
            this.gridView1.OptionsCustomization.AllowGroup = false;
            this.gridView1.OptionsCustomization.AllowSort = false;
            this.gridView1.OptionsMenu.EnableColumnMenu = false;
            this.gridView1.OptionsMenu.EnableFooterMenu = false;
            this.gridView1.OptionsMenu.EnableGroupPanelMenu = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            //
            // colidDataSet
            //
            this.colidDataSet.Caption = "idDataSet";
            this.colidDataSet.FieldName = "idDataSet";
            this.colidDataSet.Name = "colidDataSet";
            //
            // colidDataType
            //
            this.colidDataType.Caption = "idDataType";
            this.colidDataType.FieldName = "idDataType";
            this.colidDataType.Name = "colidDataType";
            //
            // colName
            //
            this.colName.Caption = "Data Set";
            this.colName.FieldName = "Name";
            this.colName.Name = "colName";
            this.colName.Visible = true;
            this.colName.VisibleIndex = 0;
            //
            // datasetTableAdapter
            //
            this.datasetTableAdapter.ClearBeforeFill = true;
            //
            // frmDataSet
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(421, 266);
            this.Controls.Add(this.gridControl1);
            this.Name = "frmDataSet";
            this.Text = "frmDataSet";
            this.Load += new System.EventHandler(this.frmDataSet_Load);
            ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.datasetBindingSource)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.esmeenvironmentDataSetBindingSource)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.esme_environmentDataSet)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private DevExpress.XtraGrid.GridControl gridControl1;
        private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
        private System.Windows.Forms.BindingSource esmeenvironmentDataSetBindingSource;
        private esme_environmentDataSet esme_environmentDataSet;
        private System.Windows.Forms.BindingSource datasetBindingSource;
        private MySqlTest.esme_environmentDataSetTableAdapters.datasetTableAdapter datasetTableAdapter;
        private DevExpress.XtraGrid.Columns.GridColumn colidDataSet;
        private DevExpress.XtraGrid.Columns.GridColumn colidDataType;
        private DevExpress.XtraGrid.Columns.GridColumn colName;
    }
}


text:
package weifen.com.common.utils;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhurencong on 2017/7/31.
 * 一键退出app
 */
public class ActivityCollector {

    public static List<Activity> activities=new ArrayList<>();

    public static void addActivity(Activity activity){
        activities.add(activity);
    }

    public static void removeActivity(Activity activity){
        activities.remove(activity);
    }

    public static void finishActivity(Activity activity){
        if(!activity.isFinishing()){
            activity.finish();
        }
    }

    public static void finishAll(){
        for(Activity activity:activities){
            if(!activity.isFinishing()){
                activity.finish();
            }
        }
    }
}


text:
<!DOCTYPE>

    <link href="/stylesheet/bootstrap.min.css" rel="stylesheet">
    <link href="/stylesheet/style.css" rel="stylesheet">
    <link href="/stylesheet/stylePost.css" rel="stylesheet">
    <link href="stylesheet/addPost.css" rel="stylesheet">

Hot

Trending

Random

                        Tags

Funny

Animals

Anime and manga

Movies and TV

WTF

Savage

                <form class="navbar-form navbar-left" role="search" action="/search" method="POST">

                        <input type="text" class="form-control" placeholder="Type to search" name="searchedPost">

                    <button type="submit" class="btn btn-default">  </button>
                </form>

Add post

                        {{#currentUser}}
                        {{username}}
                        {{/currentUser}}

Profile

Tools

Log out

E-mail {{numEmail}}

	{{#currentUser}}

{{username}}

    {{/currentUser}}

Home

Subir post

                    	<form action="/uploadPost" method="post"
		enctype="multipart/form-data">

Título del post

                                    <input type="text" id="postTitle" name="imageTitleFileUploader" placeholder="" class="input-xlarge">

Imagen del post

                                    Subir imagen
                                    <input type="file" id="postURL" name="file" placeholder="" class="input-xlarge">

Choose a tag:

                                    	<input type="radio" value="funny" name="op" checked="checked">Funny

                                    	<input type="radio" value="animals" name="op">Animals

                                    	<input type="radio" value="anime" name="op">Anime and Manga

                                    	<input type="radio" value="movies" name="op">Movies and TV

                                    	<input type="radio" value="wtf" name="op">WTF

                                    	<input type="radio" value="savage" name="op">Savage

                    	<input type='submit' class="btn btn-primary" name='enviar' value='Enviar' />
                    </form>

                Siguenos en


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title><hot-table></title>

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

  <link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="examples/css/main.css"/>

  <link rel="import" href="hot-table.html">

<hot-table>

Polymer Element wrapper for Handsontable data grid editor

Some stuff does not work yet. For now it is not ready for production!

    But feel free to submit issues on GitHub.

Install

  Install the component using Bower:

    $ bower install hot-table --save

  Or download as ZIP.

Usage

  1. Import Web Components' polyfill:

    <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>

  2. Import Custom Element:

    <link rel="import" href="bower_components/hot-table/hot-table.html">

  3. Start using it!

    <hot-table datarows="{{ itemsArray }}"></hot-table>

Simple Example

    <dom-bind>
      <template>

          Name of first person: {{ people.0.name.first }} | Highlighted row: {{ highlightedRow }}

        <hot-table width="655" height="295" datarows="{{ people }}" context-menu max-rows="{{ people.length }}"
                   highlighted-row="{{ highlightedRow }}" class="htLeft">
          <hot-column width="30" read-only value="id" header="ID"></hot-column>
          <hot-column value="name.first" header="First Name">
            <template data-hot-role="renderer" is="dom-template">{{ value }}...</template>
          </hot-column>
          <hot-column width="100" value="name.last" header="Last Name"></hot-column>
          <hot-column width="100" type="date" value="date" header="Birthday"></hot-column>
          <hot-column value="gender" header="Gender" source="[[ genderSource ]]" type="dropdown"></hot-column>
          <hot-column type="numeric" value="age" header="Age"></hot-column>
          <hot-column type="checkbox" value="languages.english" header="English" checked-template="Yes"
                      unchecked-template="No"></hot-column>
          <hot-column type="checkbox" value="languages.spanish" header="Spanish" checked-template="Yes"
                      unchecked-template="No"></hot-column>
          <hot-column type="checkbox" value="languages.french" header="French" checked-template="Yes"
                      unchecked-template="No"></hot-column>
          <hot-column type="numeric" value="salary" header="Salary" format="$ 0,0.00"></hot-column>
        </hot-table>
      </template>
    </dom-bind>

Code

<dom-bind>
  <template>
    <p>
      Name of first person: <strong>{{ people.0.name.first }}</strong> | Highlighted row: <strong>{{ highlightedRow }}</strong>
    </p>
    <hot-table width="655" height="295" datarows="{{ people }}" context-menu max-rows="{{ people.length }}"
               highlighted-row="{{ highlightedRow }}" class="htLeft">
      <hot-column width="30" read-only value="id" header="ID"></hot-column>
      <hot-column value="name.first" header="First Name">
        <template data-hot-role="renderer" is="dom-template"><span>{{ value }}</span>...</template>
      </hot-column>
      <hot-column width="100" value="name.last" header="Last Name"></hot-column>
      <hot-column width="100" type="date" value="date" header="Birthday"></hot-column>
      <hot-column value="gender" header="Gender" source="[[ genderSource ]]" type="dropdown"></hot-column>
      <hot-column type="numeric" value="age" header="Age"></hot-column>
      <hot-column type="checkbox" value="languages.english" header="English" checked-template="Yes"
                  unchecked-template="No"></hot-column>
      <hot-column type="checkbox" value="languages.spanish" header="Spanish" checked-template="Yes"
                  unchecked-template="No"></hot-column>
      <hot-column type="checkbox" value="languages.french" header="French" checked-template="Yes"
                  unchecked-template="No"></hot-column>
      <hot-column type="numeric" value="salary" header="Salary" format="$ 0,0.00"></hot-column>
    </hot-table>
  </template>
</dom-bind>

Demos

Custom Renderers

Custom Editors

Dashboard

Saving table state (persistent state)

Dynamically generated context menu

PRO features

    To install Handsontable PRO follow by this instructions.

  Install the component using Bower:

    $ bower install hot-table --save

  Overwrite handsontable version with handsontable PRO:

    $ bower install handsontable=git@github.com:handsontable/handsontable-pro.git --save

  If you don't have license for Pro yet, please click here for more info.

PRO features demos

Data filtering

Bind rows with headers

Fixing bottom rows


text:
from .fetchers import NUMetadatasFetcher

from .fetchers import NUGlobalMetadatasFetcher

from bambou import NURESTObject

class NUOSPFInterface(NURESTObject):
    """ Represents a OSPFInterface in the VSD

        Notes:
            The OSPF interface represents the connection of a router to the OSPF network. The OSPF interface defines the protocol metrics and security parameters for OSPF traffic on a V-Port on the specified subnet. An OSPF interface can exist in only one OSPF area.
    """

    __rest_name__ = "ospfinterface"
    __resource_name__ = "ospfinterfaces"

    ## Constants

    CONST_ENTITY_SCOPE_GLOBAL = "GLOBAL"

    CONST_INTERFACE_TYPE_POINT_TO_POINT = "POINT_TO_POINT"

    CONST_ENTITY_SCOPE_ENTERPRISE = "ENTERPRISE"

    CONST_ADMIN_STATE_DOWN = "DOWN"

    CONST_AUTHENTICATION_TYPE_MESSAGE_DIGEST = "MESSAGE_DIGEST"

    CONST_ADMIN_STATE_UP = "UP"

    CONST_INTERFACE_TYPE_BROADCAST = "BROADCAST"

    CONST_AUTHENTICATION_TYPE_PASSWORD = "PASSWORD"

    CONST_AUTHENTICATION_TYPE_NONE = "NONE"

    def __init__(self, **kwargs):
        """ Initializes a OSPFInterface instance

            Notes:
                You can specify all parameters while calling this methods.
                A special argument named `data` will enable you to load the
                object from a Python dictionary

            Examples:
                >>> ospfinterface = NUOSPFInterface(id=u'xxxx-xxx-xxx-xxx', name=u'OSPFInterface')
                >>> ospfinterface = NUOSPFInterface(data=my_dict)
        """

        super(NUOSPFInterface, self).__init__()

        # Read/Write Attributes

        self._name = None
        self._passive_enabled = None
        self._last_updated_by = None
        self._admin_state = None
        self._dead_interval = None
        self._hello_interval = None
        self._description = None
        self._message_digest_keys = None
        self._metric = None
        self._interface_type = None
        self._entity_scope = None
        self._priority = None
        self._associated_subnet_id = None
        self._mtu = None
        self._authentication_key = None
        self._authentication_type = None
        self._external_id = None

        self.expose_attribute(local_name="name", remote_name="name", attribute_type=str, is_required=True, is_unique=False)
        self.expose_attribute(local_name="passive_enabled", remote_name="passiveEnabled", attribute_type=bool, is_required=False, is_unique=False)
        self.expose_attribute(local_name="last_updated_by", remote_name="lastUpdatedBy", attribute_type=str, is_required=False, is_unique=False)
        self.expose_attribute(local_name="admin_state", remote_name="adminState", attribute_type=str, is_required=False, is_unique=False, choices=[u'DOWN', u'UP'])
        self.expose_attribute(local_name="dead_interval", remote_name="deadInterval", attribute_type=int, is_required=False, is_unique=False)
        self.expose_attribute(local_name="hello_interval", remote_name="helloInterval", attribute_type=int, is_required=False, is_unique=False)
        self.expose_attribute(local_name="description", remote_name="description", attribute_type=str, is_required=False, is_unique=False)
        self.expose_attribute(local_name="message_digest_keys", remote_name="messageDigestKeys", attribute_type=list, is_required=False, is_unique=False)
        self.expose_attribute(local_name="metric", remote_name="metric", attribute_type=int, is_required=False, is_unique=False)
        self.expose_attribute(local_name="interface_type", remote_name="interfaceType", attribute_type=str, is_required=False, is_unique=False, choices=[u'BROADCAST', u'POINT_TO_POINT'])
        self.expose_attribute(local_name="entity_scope", remote_name="entityScope", attribute_type=str, is_required=False, is_unique=False, choices=[u'ENTERPRISE', u'GLOBAL'])
        self.expose_attribute(local_name="priority", remote_name="priority", attribute_type=int, is_required=False, is_unique=False)
        self.expose_attribute(local_name="associated_subnet_id", remote_name="associatedSubnetID", attribute_type=str, is_required=True, is_unique=False)
        self.expose_attribute(local_name="mtu", remote_name="mtu", attribute_type=int, is_required=False, is_unique=False)
        self.expose_attribute(local_name="authentication_key", remote_name="authenticationKey", attribute_type=str, is_required=False, is_unique=False)
        self.expose_attribute(local_name="authentication_type", remote_name="authenticationType", attribute_type=str, is_required=False, is_unique=False, choices=[u'MESSAGE_DIGEST', u'NONE', u'PASSWORD'])
        self.expose_attribute(local_name="external_id", remote_name="externalID", attribute_type=str, is_required=False, is_unique=True)

        # Fetchers

        self.metadatas = NUMetadatasFetcher.fetcher_with_object(parent_object=self, relationship="child")

        self.global_metadatas = NUGlobalMetadatasFetcher.fetcher_with_object(parent_object=self, relationship="child")

        self._compute_args(**kwargs)

    # Properties

    @property
    def name(self):
        """ Get name value.

            Notes:
                Name of the OSPF Interface. The name has to be unique within the OSPFArea.

        """
        return self._name

    @name.setter
    def name(self, value):
        """ Set name value.

            Notes:
                Name of the OSPF Interface. The name has to be unique within the OSPFArea.

        """
        self._name = value

    @property
    def passive_enabled(self):
        """ Get passive_enabled value.

            Notes:
                Enable the passive property of the interface.

                This attribute is named `passiveEnabled` in VSD API.

        """
        return self._passive_enabled

    @passive_enabled.setter
    def passive_enabled(self, value):
        """ Set passive_enabled value.

            Notes:
                Enable the passive property of the interface.

                This attribute is named `passiveEnabled` in VSD API.

        """
        self._passive_enabled = value

    @property
    def last_updated_by(self):
        """ Get last_updated_by value.

            Notes:
                ID of the user who last updated the object.

                This attribute is named `lastUpdatedBy` in VSD API.

        """
        return self._last_updated_by

    @last_updated_by.setter
    def last_updated_by(self, value):
        """ Set last_updated_by value.

            Notes:
                ID of the user who last updated the object.

                This attribute is named `lastUpdatedBy` in VSD API.

        """
        self._last_updated_by = value

    @property
    def admin_state(self):
        """ Get admin_state value.

            Notes:
                Admin state of this OSPF interface

                This attribute is named `adminState` in VSD API.

        """
        return self._admin_state

    @admin_state.setter
    def admin_state(self, value):
        """ Set admin_state value.

            Notes:
                Admin state of this OSPF interface

                This attribute is named `adminState` in VSD API.

        """
        self._admin_state = value

    @property
    def dead_interval(self):
        """ Get dead_interval value.

            Notes:
                Time OSPF waits without receiving hello packets before declaring a neighbor down. If specified, it must be at least twice as long as 'helloInterval'.

                This attribute is named `deadInterval` in VSD API.

        """
        return self._dead_interval

    @dead_interval.setter
    def dead_interval(self, value):
        """ Set dead_interval value.

            Notes:
                Time OSPF waits without receiving hello packets before declaring a neighbor down. If specified, it must be at least twice as long as 'helloInterval'.

                This attribute is named `deadInterval` in VSD API.

        """
        self._dead_interval = value

    @property
    def hello_interval(self):
        """ Get hello_interval value.

            Notes:
                Time interval between OSPF hellos issued on the interface.

                This attribute is named `helloInterval` in VSD API.

        """
        return self._hello_interval

    @hello_interval.setter
    def hello_interval(self, value):
        """ Set hello_interval value.

            Notes:
                Time interval between OSPF hellos issued on the interface.

                This attribute is named `helloInterval` in VSD API.

        """
        self._hello_interval = value

    @property
    def description(self):
        """ Get description value.

            Notes:
                Description of this OSPF Interface.

        """
        return self._description

    @description.setter
    def description(self, value):
        """ Set description value.

            Notes:
                Description of this OSPF Interface.

        """
        self._description = value

    @property
    def message_digest_keys(self):
        """ Get message_digest_keys value.

            Notes:
                This attribute applies only when 'authenticationType' is 'MESSAGE_DIGEST'. In that case, this attribute is a list of pairs of key ID/password used for MD5 authentication. The key ID must by an integer between 1 and 255, and the value is a password (of 16 charachters maximum) used to generate an MD5 hash. The MD5 has is then used as authentication data in the OSPF packets. No duplicate key IDs are allowed. The format for each pair is 'keyID:password' (e.g. '1:foobar')

                This attribute is named `messageDigestKeys` in VSD API.

        """
        return self._message_digest_keys

    @message_digest_keys.setter
    def message_digest_keys(self, value):
        """ Set message_digest_keys value.

            Notes:
                This attribute applies only when 'authenticationType' is 'MESSAGE_DIGEST'. In that case, this attribute is a list of pairs of key ID/password used for MD5 authentication. The key ID must by an integer between 1 and 255, and the value is a password (of 16 charachters maximum) used to generate an MD5 hash. The MD5 has is then used as authentication data in the OSPF packets. No duplicate key IDs are allowed. The format for each pair is 'keyID:password' (e.g. '1:foobar')

                This attribute is named `messageDigestKeys` in VSD API.

        """
        self._message_digest_keys = value

    @property
    def metric(self):
        """ Get metric value.

            Notes:
                Configure an explicit route cost metric for the interface.

        """
        return self._metric

    @metric.setter
    def metric(self, value):
        """ Set metric value.

            Notes:
                Configure an explicit route cost metric for the interface.

        """
        self._metric = value

    @property
    def interface_type(self):
        """ Get interface_type value.

            Notes:
                Can be BROADCAST or POINT_TO_POINT

                This attribute is named `interfaceType` in VSD API.

        """
        return self._interface_type

    @interface_type.setter
    def interface_type(self, value):
        """ Set interface_type value.

            Notes:
                Can be BROADCAST or POINT_TO_POINT

                This attribute is named `interfaceType` in VSD API.

        """
        self._interface_type = value

    @property
    def entity_scope(self):
        """ Get entity_scope value.

            Notes:
                Specify if scope of entity is Data center or Enterprise level

                This attribute is named `entityScope` in VSD API.

        """
        return self._entity_scope

    @entity_scope.setter
    def entity_scope(self, value):
        """ Set entity_scope value.

            Notes:
                Specify if scope of entity is Data center or Enterprise level

                This attribute is named `entityScope` in VSD API.

        """
        self._entity_scope = value

    @property
    def priority(self):
        """ Get priority value.

            Notes:
                Determines which routers are selected as the designated router and backup designated router of the area.

        """
        return self._priority

    @priority.setter
    def priority(self, value):
        """ Set priority value.

            Notes:
                Determines which routers are selected as the designated router and backup designated router of the area.

        """
        self._priority = value

    @property
    def associated_subnet_id(self):
        """ Get associated_subnet_id value.

            Notes:
                ID of the Subnet which is associated to the current OSPFInterface. Once the OSPF interface is created, the associated subnet ID cannot be updated. The interface must be deleted and re-created with a different subnet ID.

                This attribute is named `associatedSubnetID` in VSD API.

        """
        return self._associated_subnet_id

    @associated_subnet_id.setter
    def associated_subnet_id(self, value):
        """ Set associated_subnet_id value.

            Notes:
                ID of the Subnet which is associated to the current OSPFInterface. Once the OSPF interface is created, the associated subnet ID cannot be updated. The interface must be deleted and re-created with a different subnet ID.

                This attribute is named `associatedSubnetID` in VSD API.

        """
        self._associated_subnet_id = value

    @property
    def mtu(self):
        """ Get mtu value.

            Notes:
                MTU to be used by OSPF for this logical interface

        """
        return self._mtu

    @mtu.setter
    def mtu(self, value):
        """ Set mtu value.

            Notes:
                MTU to be used by OSPF for this logical interface

        """
        self._mtu = value

    @property
    def authentication_key(self):
        """ Get authentication_key value.

            Notes:
                The authentication key that is used on the interface.

                This attribute is named `authenticationKey` in VSD API.

        """
        return self._authentication_key

    @authentication_key.setter
    def authentication_key(self, value):
        """ Set authentication_key value.

            Notes:
                The authentication key that is used on the interface.

                This attribute is named `authenticationKey` in VSD API.

        """
        self._authentication_key = value

    @property
    def authentication_type(self):
        """ Get authentication_type value.

            Notes:
                Authentication Type used for this OSPFInterface

                This attribute is named `authenticationType` in VSD API.

        """
        return self._authentication_type

    @authentication_type.setter
    def authentication_type(self, value):
        """ Set authentication_type value.

            Notes:
                Authentication Type used for this OSPFInterface

                This attribute is named `authenticationType` in VSD API.

        """
        self._authentication_type = value

    @property
    def external_id(self):
        """ Get external_id value.

            Notes:
                External object ID. Used for integration with third party systems

                This attribute is named `externalID` in VSD API.

        """
        return self._external_id

    @external_id.setter
    def external_id(self, value):
        """ Set external_id value.

            Notes:
                External object ID. Used for integration with third party systems

                This attribute is named `externalID` in VSD API.

        """
        self._external_id = value


text:
require File.expand_path('../application', __FILE__)

# Initialize the rails application
FrontendTestingForSkeptics::Application.initialize!


text:
Bookshelf is a JavaScript ORM for Node.js, built on the [Knex](http://knexjs.org) SQL query builder. Featuring both promise based and traditional callback interfaces, it follows the Model & Collection patterns seen in [Backbone.js](http://backbonejs.com), providing transaction support, eager/nested-eager relation loading, polymorphic associations, and support for one-to-one, one-to-many, and many-to-many relations.

It is designed to work well with PostgreSQL, MySQL, and SQLite3.

The project is [hosted on GitHub](http://github.com/tgriesser/bookshelf/), and has a comprehensive [test suite](https://travis-ci.org/tgriesser/bookshelf).

## Introduction

Bookshelf aims to provide a simple library for common tasks when querying databases in JavaScript, and forming relations between these objects, taking a lot of ideas from the the [Data Mapper Pattern](http://en.wikipedia.org/wiki/Data_mapper_pattern). With a concise, literate codebase, Bookshelf is simple to read, understand, and extend. It doesn't force you to use any specific validation scheme, provides flexible and efficient relation/nested-relation loading, and first class transaction support. It's a lean Object Relational Mapper, allowing you to drop down to the raw knex interface whenever you need a custom query that doesn't quite fit with the stock conventions.

Bookshelf follows the excellent foundation provided by Backbone.js Models and Collections, using similar patterns, naming conventions, and philosophies to build a lightweight, easy to navigate ORM. If you know how to use Backbone, you probably already know how to use Bookshelf.

## Installation

You'll need to install a copy of [knex.js](http://knexjs.org/), and either mysql, pg, or sqlite3 from npm.

```js
$ npm install knex --save
$ npm install bookshelf --save

# Then add one of the following:
$ npm install pg
$ npm install mysql
$ npm install mariasql
$ npm install sqlite3
```

The Bookshelf library is initialized by passing an initialized [Knex](http://knexjs.org/) client instance. The [knex documentation](http://knexjs.org/) provides a number of examples for different databases.

```js
var knex = require('knex')({
  client: 'mysql',
  connection: {
    host     : '127.0.0.1',
    user     : 'your_database_user',
    password : 'your_database_password',
    database : 'myapp_test',
    charset  : 'utf8'
  }
});

var bookshelf = require('bookshelf')(knex);

var User = bookshelf.Model.extend({
  tableName: 'users'
});
```

This initialization should likely only ever happen once in your application. As it creates a connection pool for the current database, you should use the `bookshelf` instance returned throughout your library. You'll need to store this instance created by the initialize somewhere in the application so you can reference it. A common pattern to follow is to initialize the client in a module so you can easily reference it later:

```js
// In a file named something like bookshelf.js
var knex = require('knex')(dbConfig);
module.exports require('bookshelf')(knex);

// elsewhere, to use the bookshelf client:
var bookshelf = require('./bookshelf');

var Post = bookshelf.Model.extend({
  // ...
});
```

## Examples

Here is an example to get you started:

```js
var knex = require('knex')({client: 'mysql', connection: process.env.MYSQL_DATABASE_CONNECTION });
var bookshelf = require('bookshelf')(knex);

var User = bookshelf.Model.extend({
  tableName: 'users',
  messages: function() {
    return this.hasMany(Posts);
  }
});

var Posts = bookshelf.Model.extend({
  tableName: 'messages',
  tags: function() {
    return this.belongsToMany(Tag);
  }
});

var Tag = bookshelf.Model.extend({
  tableName: 'tags'
})

User.where('id', 1).fetch({withRelated: ['posts.tags']}).then(function(user) {

  console.log(user.related('posts').toJSON());

}).catch(function(err) {

  console.error(err);

});
```


text:
namespace MonkVG {	// Internal Implementation
	VGint IFont::getParameteri( const VGint p ) const {
		switch (p) {
			default:
				SetError( VG_ILLEGAL_ARGUMENT_ERROR );
				return -1;	//todo: set error
				break;
		}
	}

	VGfloat IFont::getParameterf( const VGint p ) const {
		switch (p) {
			default:
				SetError( VG_ILLEGAL_ARGUMENT_ERROR );
				return -1;	//todo: set error
				break;
		}
	}

	void IFont::getParameterfv( const VGint p, VGfloat *fv ) const {
		switch (p) {
			default:
				SetError( VG_ILLEGAL_ARGUMENT_ERROR );
				break;
		}

	}

	void IFont::setParameter( const VGint p, const VGint v ) {
		switch (p) {
			default:
				SetError( VG_ILLEGAL_ARGUMENT_ERROR );
				break;
		}
	}

	void IFont::setParameter( const VGint p, const VGfloat v ) {
		switch (p) {
			default:
				SetError( VG_ILLEGAL_ARGUMENT_ERROR );
				break;
		}
	}

	void IFont::setParameter( const VGint p, const VGfloat* fv, const VGint cnt ) {
		switch (p) {
			default:
				SetError( VG_ILLEGAL_ARGUMENT_ERROR );
				break;
		}
	}

	void IFont::addGlyphImage( VGuint index_, IImage* image_, VGfloat glyphOrigin_[2], VGfloat escapement_[2] ) {
		_glyphs[index_] = std::shared_ptr<IFont::GlyphImage>( new IFont::GlyphImage( index_, image_, glyphOrigin_, escapement_ ) );
	}
	void IFont::addGlyphPath( VGuint index_, IPath* path_, VGfloat glyphOrigin_[2], VGfloat escapement_[2] ) {
		_glyphs[index_] = std::shared_ptr<IFont::GlyphPath>( new IFont::GlyphPath( index_, path_, glyphOrigin_, escapement_ ));
	}

	void IFont::drawGlyph( VGuint index, VGfloat adj_x, VGfloat adj_y, VGbitfield paintModes ) {
		std::unordered_map<VGuint, std::shared_ptr<Glyph> >::iterator it =  _glyphs.find( index );
		if ( it != _glyphs.end() ) {
			std::shared_ptr<Glyph> glyph = it->second;
			VGfloat origin[2];
			IContext::instance().getGlyphOrigin( origin );
//			vgTranslate( origin[0], origin[1] );
			glyph->draw( paintModes, adj_x, adj_y );
			origin[0] += glyph->escapement[0];
			IContext::instance().setGlyphOrigin( origin );
		}
	}

	void IFont::GlyphImage::draw( VGbitfield paintModes, VGfloat adj_x, VGfloat adj_y ) {
		//image->drawSubRect( glyphOrigin[0], glyphOrigin[1], escapement[0], escapement[1], paintModes );
		//image->draw( );
		VGfloat origin[2];
		IContext::instance().getGlyphOrigin( origin );
		origin[0] += adj_x;
		origin[1] += adj_y;

		image->drawAtPoint( origin[0], origin[1], paintModes );
	}

}

///// OpenVG API Implementation /////

using namespace MonkVG;

VG_API_CALL VGFont VG_API_ENTRY vgCreateFont(VGint glyphCapacityHint) VG_API_EXIT {
	return (VGFont)IContext::instance().createFont();
}
VG_API_CALL void VG_API_ENTRY vgDestroyFont(VGFont font) VG_API_EXIT {
	IContext::instance().destroyFont( (IFont*)font );
}
VG_API_CALL void VG_API_ENTRY vgSetGlyphToPath(VGFont font,
											   VGuint glyphIndex,
											   VGPath path,
											   VGboolean isHinted,
											   VGfloat glyphOrigin [2],
											   VGfloat escapement[2]) VG_API_EXIT {
	if ( font == VG_INVALID_HANDLE ) {
		SetError( VG_BAD_HANDLE_ERROR );
		return;
	}

	IFont* f = (IFont*)font;
	f->addGlyphPath( glyphIndex, (IPath*)path, glyphOrigin, escapement );

}
VG_API_CALL void VG_API_ENTRY vgSetGlyphToImage(VGFont font,
												VGuint glyphIndex,
												VGImage image,
												VGfloat glyphOrigin [2],
												VGfloat escapement[2]) VG_API_EXIT {
	if ( font == VG_INVALID_HANDLE ) {
		SetError( VG_BAD_HANDLE_ERROR );
		return;
	}

	IFont* f = (IFont*)font;
	f->addGlyphImage( glyphIndex, (IImage*)image, glyphOrigin, escapement );

}
VG_API_CALL void VG_API_ENTRY vgClearGlyph(VGFont font,VGuint glyphIndex) VG_API_EXIT {

}
VG_API_CALL void VG_API_ENTRY vgDrawGlyph(VGFont font,
										  VGuint glyphIndex,
										  VGbitfield paintModes,
										  VGboolean allowAutoHinting) VG_API_EXIT {
	if ( font == VG_INVALID_HANDLE ) {
		SetError( VG_BAD_HANDLE_ERROR );
		return;
	}

	// force glyph matrix mode
	if( IContext::instance().getMatrixMode() != VG_MATRIX_GLYPH_USER_TO_SURFACE ) {
		IContext::instance().setMatrixMode( VG_MATRIX_GLYPH_USER_TO_SURFACE );
	}
	IFont* f = (IFont*)font;
	f->drawGlyph( glyphIndex, 0,0, paintModes );

}
VG_API_CALL void VG_API_ENTRY vgDrawGlyphs(VGFont font,
										   VGint glyphCount,
										   VGuint *glyphIndices,
										   VGfloat *adjustments_x,
										   VGfloat *adjustments_y,
										   VGbitfield paintModes,
										   VGboolean allowAutoHinting) VG_API_EXIT {

	if ( font == VG_INVALID_HANDLE ) {
		SetError( VG_BAD_HANDLE_ERROR );
		return;
	}

	IFont* f = (IFont*)font;

	// force glyph matrix mode
	if( IContext::instance().getMatrixMode() != VG_MATRIX_GLYPH_USER_TO_SURFACE ) {
		IContext::instance().setMatrixMode( VG_MATRIX_GLYPH_USER_TO_SURFACE );
	}

	for( int i = 0; i < glyphCount; i++ ) {
		VGfloat ax = 0, ay = 0;
		if ( adjustments_x ) {
			ax = adjustments_x[i];
		}
		if ( adjustments_y ) {
			ay = adjustments_y[i];
		}

		f->drawGlyph( glyphIndices[i], ax, ay, paintModes );
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="generator" content="Powered by Python, and django-content-placeholders." />
    <title>{% block headtitle %}{% endblock %}</title>
    <link rel="stylesheet" href="{{ STATIC_URL }}theme1/site.css" type="text/css" />
    {% block extrahead %}{% endblock %}
    {% block scripts %}{% endblock %}

Example site

Home

Admin

          {% block main %}{% endblock %}

        {% block after_main %}{% endblock %}