text:
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Management.WebSites;
using Microsoft.WindowsAzure.Management.WebSites.Models;

namespace Microsoft.WindowsAzure.Management.WebSites
{
    /// <summary>
    /// The Web Sites Management API provides a RESTful set of web services
    /// that interact with the Windows Azure Web Sites service to manage your
    /// web sites. The API has entities that capture the relationship between
    /// an end user and Windows Azure Web Sites service.  (see
    /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166981.aspx for
    /// more information)
    /// </summary>
    public static partial class WebHostingPlanOperationsExtensions
    {
        /// <summary>
        /// Creates a new Web Hosting Plan.  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='parameters'>
        /// Required. Web Hosting Plan Parameters.
        /// </param>
        /// <returns>
        /// The Create Web Web Hosting Plan operation response.
        /// </returns>
        public static WebHostingPlanCreateResponse Create(this IWebHostingPlanOperations operations, string webSpaceName, WebHostingPlanCreateParameters parameters)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IWebHostingPlanOperations)s).CreateAsync(webSpaceName, parameters);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Creates a new Web Hosting Plan.  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='parameters'>
        /// Required. Web Hosting Plan Parameters.
        /// </param>
        /// <returns>
        /// The Create Web Web Hosting Plan operation response.
        /// </returns>
        public static Task<WebHostingPlanCreateResponse> CreateAsync(this IWebHostingPlanOperations operations, string webSpaceName, WebHostingPlanCreateParameters parameters)
        {
            return operations.CreateAsync(webSpaceName, parameters, CancellationToken.None);
        }

        /// <summary>
        /// Deletes a Web Hosting Plan  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public static AzureOperationResponse Delete(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IWebHostingPlanOperations)s).DeleteAsync(webSpaceName, webHostingPlanName);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Deletes a Web Hosting Plan  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public static Task<AzureOperationResponse> DeleteAsync(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName)
        {
            return operations.DeleteAsync(webSpaceName, webHostingPlanName, CancellationToken.None);
        }

        /// <summary>
        /// Gets details of an existing Web Hosting Plan  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <returns>
        /// The Get Web Hosting Plan operation response.
        /// </returns>
        public static WebHostingPlanGetResponse Get(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IWebHostingPlanOperations)s).GetAsync(webSpaceName, webHostingPlanName);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Gets details of an existing Web Hosting Plan  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <returns>
        /// The Get Web Hosting Plan operation response.
        /// </returns>
        public static Task<WebHostingPlanGetResponse> GetAsync(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName)
        {
            return operations.GetAsync(webSpaceName, webHostingPlanName, CancellationToken.None);
        }

        /// <summary>
        /// You can retrieve historical usage metrics for a site by issuing an
        /// HTTP GET request.  (see
        /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <param name='parameters'>
        /// Required. Parameters supplied to the Get Historical Usage Metrics
        /// Web hosting plan operation.
        /// </param>
        /// <returns>
        /// The Get Historical Usage Metrics Web hosting plan operation
        /// response.
        /// </returns>
        public static WebHostingPlanGetHistoricalUsageMetricsResponse GetHistoricalUsageMetrics(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName, WebHostingPlanGetHistoricalUsageMetricsParameters parameters)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IWebHostingPlanOperations)s).GetHistoricalUsageMetricsAsync(webSpaceName, webHostingPlanName, parameters);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// You can retrieve historical usage metrics for a site by issuing an
        /// HTTP GET request.  (see
        /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <param name='parameters'>
        /// Required. Parameters supplied to the Get Historical Usage Metrics
        /// Web hosting plan operation.
        /// </param>
        /// <returns>
        /// The Get Historical Usage Metrics Web hosting plan operation
        /// response.
        /// </returns>
        public static Task<WebHostingPlanGetHistoricalUsageMetricsResponse> GetHistoricalUsageMetricsAsync(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName, WebHostingPlanGetHistoricalUsageMetricsParameters parameters)
        {
            return operations.GetHistoricalUsageMetricsAsync(webSpaceName, webHostingPlanName, parameters, CancellationToken.None);
        }

        /// <summary>
        /// You can list the web spaces under the current subscription by
        /// issuing a GET request.  (see
        /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166961.aspx
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <returns>
        /// The List Web Hosting Plans operation response.
        /// </returns>
        public static WebHostingPlanListResponse List(this IWebHostingPlanOperations operations, string webSpaceName)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IWebHostingPlanOperations)s).ListAsync(webSpaceName);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// You can list the web spaces under the current subscription by
        /// issuing a GET request.  (see
        /// http://msdn.microsoft.com/en-us/library/windowsazure/dn166961.aspx
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <returns>
        /// The List Web Hosting Plans operation response.
        /// </returns>
        public static Task<WebHostingPlanListResponse> ListAsync(this IWebHostingPlanOperations operations, string webSpaceName)
        {
            return operations.ListAsync(webSpaceName, CancellationToken.None);
        }

        /// <summary>
        /// Updates an existing Web Hosting Plan.  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <param name='parameters'>
        /// Required. Parameters supplied to the Update Web Hosting Plan
        /// operation.
        /// </param>
        /// <returns>
        /// The Create Web Hosting Plan operation response.
        /// </returns>
        public static WebHostingPlanUpdateResponse Update(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName, WebHostingPlanUpdateParameters parameters)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IWebHostingPlanOperations)s).UpdateAsync(webSpaceName, webHostingPlanName, parameters);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Updates an existing Web Hosting Plan.  (see
        /// http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/
        /// for more information)
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.WindowsAzure.Management.WebSites.IWebHostingPlanOperations.
        /// </param>
        /// <param name='webSpaceName'>
        /// Required. The name of the web space.
        /// </param>
        /// <param name='webHostingPlanName'>
        /// Required. The name of the web hosting plan.
        /// </param>
        /// <param name='parameters'>
        /// Required. Parameters supplied to the Update Web Hosting Plan
        /// operation.
        /// </param>
        /// <returns>
        /// The Create Web Hosting Plan operation response.
        /// </returns>
        public static Task<WebHostingPlanUpdateResponse> UpdateAsync(this IWebHostingPlanOperations operations, string webSpaceName, string webHostingPlanName, WebHostingPlanUpdateParameters parameters)
        {
            return operations.UpdateAsync(webSpaceName, webHostingPlanName, parameters, CancellationToken.None);
        }
    }
}


text:
@implementation HomePageApi

- (NSString *)requestUrl {
    return @"/test.php";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
    return @{
             @"userid":@"12",
             };
}

- (AFConstructingBlock)constructingBodyBlock {
    return ^(id<AFMultipartFormData> formData) {
        UIImage *image = [UIImage imageNamed:@"back_icon"];
        NSData *imageData = UIImagePNGRepresentation(image);
        [formData appendPartWithFileData:imageData name:@"image" fileName:@"1.png" mimeType:@"image/png"];
    };
}

@end

redpajama_set_name: RedPajamaGithub


text:
"""
.. See the NOTICE file distributed with this work for additional information
   regarding copyright ownership.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
"""

from flask import Flask
from flask_restful import Api, Resource

from rest.mg_auth import authorized

APP = Flask(__name__)

class TokenCheck(Resource):
    """
    Class to handle checking if the token returns a valid user name
    """

    @authorized
    def get(self, user_id):
        """
        Test to see if it is possible to get the user_id
        """
        msg = "Congratulations, welcome to the MuG VRE"
        if user_id is None:
            msg = "Are you sure that you have a valid token?"

        return {
            'user_id': user_id,
        }

# Define the URIs and their matching methods
REST_API = Api(APP)

#   Token Checker
REST_API.add_resource(TokenCheck, "/mug/api/check", endpoint='token-check')

# Initialise the server
if __name__ == "__main__":
    APP.run(port=5000, debug=True, use_reloader=False)


text:
import { IRemoteUser } from '../../../../models/entities/user';
import { IAdd } from '../../type';
import { resolveNote } from '../../models/note';
import { addPinned } from '../../../../services/i/pin';

export default async (actor: IRemoteUser, activity: IAdd): Promise<void> => {
	if ('actor' in activity && actor.uri !== activity.actor) {
		throw new Error('invalid actor');
	}

	if (activity.target == null) {
		throw new Error('target is null');
	}

	if (activity.target === actor.featured) {
		const note = await resolveNote(activity.object);
		if (note == null) throw new Error('note not found');
		await addPinned(actor, note.id);
		return;
	}

	throw new Error(`unknown target: ${activity.target}`);
};


text:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/**
 * @var yii\web\View $this
 * @var yii\widgets\ActiveForm $form
 * @var \frontend\models\SignupForm $model
 */
$this->title = 'Signup';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode("Register now") ?>

            <?php $form = ActiveForm::begin(['id' => 'form-signup']); ?>
                <?= $form->field($model, 'UserEmail') ?>
                <?= $form->field($model, 'UserPlainPassword')->passwordInput() ?>

                    <?= Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>

            <?php ActiveForm::end(); ?>


text:
const fs = require('fs');
const path = require('path');
const {graphql} = require('graphql');
const {introspectionQuery, printSchema} = require('graphql/utilities');

const schema = require('../schema');

const yourSchemaPath = path.join(__dirname, '../../data/schema');

module.exports = () => {
    // Save JSON of full schema introspection for Babel Relay Plugin to use
    graphql(schema, introspectionQuery).then(result => {
        fs.writeFileSync(
            `${yourSchemaPath}.json`,
            JSON.stringify(result, null, 2)
        );
    });

    // Save user readable type system shorthand of schema
    fs.writeFileSync(
        `${yourSchemaPath}.graphql`,
        printSchema(schema)
    );
};


text:
/*
 * Copyright 1999-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * $Id: Function.java,v 1.2.4.1 2005/09/14 20:18:43 jeffsuttor Exp $
 */
package com.sun.org.apache.xpath.internal.functions;

import com.sun.org.apache.xalan.internal.res.XSLMessages;
import com.sun.org.apache.xpath.internal.Expression;
import com.sun.org.apache.xpath.internal.ExpressionOwner;
import com.sun.org.apache.xpath.internal.XPathContext;
import com.sun.org.apache.xpath.internal.XPathVisitor;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
import com.sun.org.apache.xpath.internal.objects.XObject;

/**
 * This is a superclass of all XPath functions.  This allows two
 * ways for the class to be called. One method is that the
 * super class processes the arguments and hands the results to
 * the derived class, the other method is that the derived
 * class may process it's own arguments, which is faster since
 * the arguments don't have to be added to an array, but causes
 * a larger code footprint.
 * @xsl.usage advanced
 */
public abstract class Function extends Expression
{
    static final long serialVersionUID = 6927661240854599768L;

  /**
   * Set an argument expression for a function.  This method is called by the
   * XPath compiler.
   *
   * @param arg non-null expression that represents the argument.
   * @param argNum The argument number index.
   *
   * @throws WrongNumberArgsException If the argNum parameter is beyond what
   * is specified for this function.
   */
  public void setArg(Expression arg, int argNum)
          throws WrongNumberArgsException
  {
                        // throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null));
      reportWrongNumberArgs();
  }

  /**
   * Check that the number of arguments passed to this function is correct.
   * This method is meant to be overloaded by derived classes, to check for
   * the number of arguments for a specific function type.  This method is
   * called by the compiler for static number of arguments checking.
   *
   * @param argNum The number of arguments that is being passed to the function.
   *
   * @throws WrongNumberArgsException
   */
  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
  {
    if (argNum != 0)
      reportWrongNumberArgs();
  }

  /**
   * Constructs and throws a WrongNumberArgException with the appropriate
   * message for this function object.  This method is meant to be overloaded
   * by derived classes so that the message will be as specific as possible.
   *
   * @throws WrongNumberArgsException
   */
  protected void reportWrongNumberArgs() throws WrongNumberArgsException {
      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null));
  }

  /**
   * Execute an XPath function object.  The function must return
   * a valid object.
   * @param xctxt The execution current context.
   * @return A valid XObject.
   *
   * @throws javax.xml.transform.TransformerException
   */
  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
  {

    // Programmer's assert.  (And, no, I don't want the method to be abstract).
    System.out.println("Error! Function.execute should not be called!");

    return null;
  }

  /**
   * Call the visitors for the function arguments.
   */
  public void callArgVisitors(XPathVisitor visitor)
  {
  }

  /**
   * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
   */
  public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
  {
        if(visitor.visitFunction(owner, this))
        {
                callArgVisitors(visitor);
        }
  }

  /**
   * @see Expression#deepEquals(Expression)
   */
  public boolean deepEquals(Expression expr)
  {
        if(!isSameClass(expr))
                return false;

        return true;
  }

  /**
   * This function is currently only being used by Position()
   * and Last(). See respective functions for more detail.
   */
  public void postCompileStep(Compiler compiler)
  {
    // no default action
  }
}


text:
import { window as Window } from 'vscode';
import { packageExists, pickPackageJson } from './utils';
import * as Messages from './messages';
import { runCommand } from './run-command';

export async function yarnAddPackages() {
	let packageJson = await pickPackageJson()
	if (!packageExists(packageJson)) {
		Messages.noPackageError();
		return;
	}

	runCommand(['add'], packageJson);
}

export function yarnAddPackage() {
	return _addPackage(false);
}

export function yarnAddPackageDev() {
	return _addPackage(true);
}

const _addPackage = async function (dev: boolean) {
	let packageJson = await pickPackageJson()
	if (!packageExists(packageJson)) {
		Messages.noPackageError();
		return;
	}

	Window.showInputBox({
		prompt: 'Package to add',
		placeHolder: 'lodash, underscore, ...'
	})
		.then((value) => {

			if (!value) {
				Messages.noValueError();
				return;
			}

			const packages = value.split(' ');

			const hasSaveOption = packages.find((value) => {

				return value === '-D' ||
					value === '--dev' ||
					value === '-O' ||
					value === '--optional' ||
					value === '-E' ||
					value === '--exact';
			});

			const args = ['add', ...packages];

			if (hasSaveOption) {
				runCommand(args, packageJson);
			}
			else {
				const save = dev ? '--dev' : '';
				runCommand([...args, save], packageJson);
			}
		});
};


text:
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="Component/Foodie_bucket.css">

Welcome! Choose a track to get started.

Welcome!

Choose a track to get started.

                            {{x.countryName}}

{{x.status}} %

{{x.desc}}

                        Duration: {{x.time}}


text:
Tile = {}
Tile_mt = { __index = Tile }

----------------------------------------------------------------------------------------------------
----									CLASS VARIABLES											----
----------------------------------------------------------------------------------------------------

Tile.version = 3.4

----------------------------------------------------------------------------------------------------
----									LOCALISED VARIABLES										----
----------------------------------------------------------------------------------------------------

local contentWidth = display.contentWidth
local contentHeight = display.contentHeight

local abs = math.abs
local floor = math.floor
local ceil = math.ceil

----------------------------------------------------------------------------------------------------
----									PRIVATE METHODS											----
----------------------------------------------------------------------------------------------------

local newSpriteSequenceFromString = function(tile, sequenceName, string)
	if(string) then
		local sequence = {}
		string = utils:splitString(string, ",")

		for i=1, #string, 1 do
			local param = utils:splitString(string[i], "=")
			sequence[param[1]] = param[2]
		end

		sequence.name = sequenceName
		sequence.start = sequence.start or sequence.startFrame or 1
		return sequence
	end
end

----------------------------------------------------------------------------------------------------
----									PUBLIC METHODS											----
----------------------------------------------------------------------------------------------------

--- Create a new instance of a Tile object.
-- @param data The XML data.
-- @param map The current Map object.
-- @param layer The TileLayer the the Tile resides on.
-- @return The newly created tile.
function Tile:new(data, map, layer)

    local self = {}    -- the new instance

    setmetatable( self, Tile_mt ) -- all instances share the same metatable

    self.properties = {}
    self.map = map
    self.layer = layer

    self.mapTileWidth = self.map.tilewidth
    self.mapTileHeight = self.map.tileheight

    -- This means it has been manually created. Currently just used in the TileLayer:createTile() function but may be useful for other situations.
    if data.isGenerated then

    	local name = ""
    	local value = ""

    	for i = 1, #data.properties, 1 do

    		name = data.properties[i].name
    		value = data.properties[i].value

    		if name == "gid" then
				self[name] = utils:decodeJsonSafely(value)
			else
				self:setProperty(name, value)
			end
    	end

	else

		-- Pull out all the details off this tile, currently it just seems to be the GID however Tiled may add more later.
		for key, value in pairs(data['Attributes']) do
			if key == "gid" then
				self[key] = utils:decodeJsonSafely(value)
			else
				self:setProperty(key, value)
			end
		end
	end
	-- Absolutely make sure the gid is a number
	self.gid = utils:convertStringToNumberSafely( self.gid )
	return self
end

--- Sets the image of the Tile from a Tileset.
-- @param gid The gid of the tile image.
-- @usage Originally created by Mattguest - http://developer.anscamobile.com/forum/2011/02/02/settile-function
function Tile:setImage(gid)

	local visual = self:getVisual()

	-- Make sure there is a visual
	if visual then

		-- Calculate the tile index
		--local index = self.map.width * ( tile.row - 1 ) + tile.column
		local index = self.index

		local map = self.map
		local tileLayer = self.layer

		-- Destroy the tile
		self:destroy()

		-- Fake the XML data
		local data = {}
		data["Attributes"] = {}
		data["Attributes"].gid = gid

		data["Attributes"].gid = tonumber(data["Attributes"].gid)

		-- Create the tile object
		self = Tile:new(data, map, tileLayer)

		-- Add the tile to the tile list
		tileLayer.tiles[index] = tile

		-- Create the tile visual
		self:create(index)

		-- Build the tile physical
		self:build()

		-- Bring the new tile into focus
		self:getVisual():toFront()
		self:getVisual().isVisible = true

	end

end

--- Sets the value of a Property of the Tile.
-- Will create a new Property if none found.
-- @param name The name of the Property.
-- @param value The new value.
function Tile:setProperty(name, value)

	local property = self:getProperty(name)

	if property then
		property:setValue(value)
	else
		self:addProperty(Property:new(name, value))
	end

	self[name] = self:getPropertyValue(name)
end

--- Gets a Property of the Tile.
-- @param name The name of the Property.
-- @return The Property. nil if no Property found.
function Tile:getProperty(name)

	if not self.properties then
		self.properties = {}
	end

	return self.properties[name]
end

--- Gets the value of a Property of the Tile.
-- @param name The name of the Property.
-- @return The Property value. nil if no Property found.
function Tile:getPropertyValue(name)

	local property = self:getProperty(name)

	if property then
		return property:getValue()
	end

end

--- Gets a list of all Properties of the Tile.
-- @return The list of Properties.
function Tile:getProperties()
	return self.properties
end

--- Gets a count of how many properties the Tile has.
-- @return The Property count.
function Tile:getPropertyCount()

	if not self.properties then
		self.properties = {}
	end

	local count = 0

	for _k, _v in pairs(self.properties) do
		count = count + 1
	end

	return count
end

--- Checks whether the Tile has a certain Property.
-- @param name The name of the property to check for.
-- @return True if the Tile has the Property, false if not.
function Tile:hasProperty(name)
	return self:getProperty(name) ~= nil
end

--- Adds a Property to the Tile.
-- @param property The Property to add.
-- @return The added Property.
function Tile:addProperty(property)

	if not self.properties then
		self.properties = {}
	end

	self.properties[property:getName()] = property

	self[property:getName()] = property:getValue()

	return property
end

--- Removes a Property from the Tile.
-- @param name The name of the Property to remove.
function Tile:removeProperty(name)

	if not self.properties then
		self.properties = {}
	end

	self.properties[name] = nil
end

--- Moves the Tile.
-- @param x The amount to move the Tile along the X axis.
-- @param y The amount to move the Tile along the Y axis.
function Tile:move(x, y)
	utils:moveObject( self:getVisual(), x, y)
	self:updateGridPosition()
end

--- Drags the Tile.
-- @param The Touch event.
function Tile:drag(event)
	utils:dragObject( self:getVisual(), event)
	self:updateGridPosition()
end

--- Updates the grid position of the Tile. Called automatically, nothing to see here.
function Tile:updateGridPosition()

	local visual = self:getVisual()

	if visual then
		self.column = floor( visual.x / self.mapTileWidth ) + 1
		self.row = floor( visual.y / self.mapTileHeight ) + 1
	end
end

--- Sets the position of the Tile.
-- @param x The new X position.
-- @param y The new Y position.
function Tile:setPosition(x, y)

	local visual = self:getVisual()

	if visual then
		visual.x = x
		visual.y = y
	end

	if self.body then
		self.body.x = x
		self.body.y = y
	end

	self:updateGridPosition()
end

--- Slides the Tile to a new position.
-- @param x The new X position of the Tile.
-- @param y The new Y position of the Tile.
-- @param slideTime The time it will take to slide the Tile to the new position.
-- @param onCompleteHandler Event handler to be called on movement completion. Optional.
function Tile:slideToPosition(x, y, slideTime, onCompleteHandler)

	local visual = self:getVisual()

	if visual then
		utils:slideObjectToPosition(self, visual, x, y, slideTime, onCompleteHandler)
	end

end

--- Fades the Tile to a new position.
-- @param x The new X position of the Tile.
-- @param y The new Y position of the Tile.
-- @param fadeTime The time it will take to fade the Tile out or in. Optional, default is 1000.
-- @param moveDelay The time inbetween both fades. Optional, default is 0.
-- @param onCompleteHandler Event handler to be called on movement completion. Optional.
function Tile:fadeToPosition(x, y, fadeTime, moveDelay, onCompleteHandler)

	local visual = self:getVisual()

	if visual then
		utils:fadeObjectToPosition(self, visual, x, y, fadeTime, moveDelay, onCompleteHandler)
	end

end

--- Fades the Tile to a new alpha amount.
-- @param alpha The new alpha for the Tile.
-- @param fadeTime The time it will take to fade the Tile. Optional, default is 1000.
-- @param onCompleteHandler Event handler to be called on fade completion. Optional.
function Tile:fadeToAmount( alpha, fadeTime, onCompleteHandler )

	local visual = self:getVisual()

	if visual then
		utils:fadeObjectToAmount( self, visual, alpha, fadeTime, onCompleteHandler )
	end

end

--- Slides the Tile along a path of points.
-- @param path List of points to move the Object along. Must be a list of tables that have an X and Y value.
-- @param slideTime The time it will take to slide the Object to the next point.
-- @param cycles The amount of times to loop through the path. Optional. Default is unlimited.
function Tile:slideAlongPath(path, slideTime, cycles)

	local visual = self:getVisual()

	if visual then
		utils:slideObjectAlongPath(self, visual, path, slideTime, cycles)
	end

end

--- Sets the rotation of the Tile.
-- @param angle The new rotation.
function Tile:setRotation(angle)

	local visual = self:getVisual()

	if visual then
		visual.rotation = angle
	end

	if self.body then
		self.body.rotation = angle
	end

end

--- Rotates the Tile.
-- @param angle The angle to rotate by.
function Tile:rotate(angle)

	local visual = self:getVisual()

	if visual then
		visual.rotation = visual.rotation + angle
	end

	if self.body then
		self.body.rotation = self.body.rotation + angle
	end

end

--- Shows the Tile.
function Tile:show()

	local visual = self:getVisual()

	if visual then
		visual.isVisible = true
	end

end

--- Hides the Tile.
function Tile:hide()

	local visual = self:getVisual()

	if visual then
		visual.isVisible = false
	end

end

--- Adjusts the alpha of the tile by a specified amount.
-- @param amount The amount to adjust the alpha by.
function Tile:adjustAlpha( amount )

	local visual = self:getVisual()

	if visual then
		visual.alpha = visual.alpha + amount
	end

end

--- Sets the alpha of the tile to a specified amount.
-- @param alpha The new alpha for the tile.
function Tile:setAlpha( alpha )

	local visual = self:getVisual()

	if visual then
		visual.alpha = alpha
	end

end

--- Gets the Tiles visual.
function Tile:getVisual()
	return self.sprite
end

--- Gets the world position of the Tile.
-- @return The X position of the Tile or nil if there is no sprite
-- @return The Y position of the Tile or nil if there is no sprite
function Tile:getWorldPosition()

	local visual = self:getVisual()

	-- Extra checks suggested by Pavel Nakaznenko
	if(visual and visual.parent and visual.isVisible) then

		local x = visual.x + self.map:getVisual().x
		local y = visual.y + self.map:getVisual().y

		return x, y

	end

	return nil
end

--- Gets the grid position of the Tile.
-- @return The Row of the Tile.
-- @return The Column of the Tile.
function Tile:getGridPosition()
	return self.row, self.column
end

--- Checks whether the Tile is currently on screen.
-- @return True if the Tile is on screen, false if not.
function Tile:isOnScreen()

	local visual = self:getVisual()

	if visual then

		local worldX, worldY = self:getWorldPosition()

		if worldX and worldY then
			if ( ( worldX + visual.width ) < 0 or ( worldX - visual.width ) > contentWidth ) then
				return false
			elseif ( ( worldY + visual.height ) < 0 or ( worldY - visual.height ) > contentHeight ) then
				return false
			end

			return true
		end

	end

	return nil
end

function Tile:getSequenceData()
	if type(self.sequences) == "string" then
		self.sequences = utils:splitString(self.sequences, ",")
	elseif type(self.sequences) == "table" then

	end

	-- Create all the sprite sequences
	local sequenceData = {}
	for i=1, #self.sequences, 1 do
		if(self[self.sequences[i]]) then
			local seqData = newSpriteSequenceFromString(self, self.sequences[i], self[self.sequences[i]])
			if self.startFrame and not seqData.start then seqData.start = self.startFrame end
			sequenceData[#sequenceData+1] = seqData
		end
	end
	return sequenceData
end

--- Creates the visual representation of the Tile.
-- @param index The Tile number. Not the gid.
function Tile:create(index)

	self.index = index

	if(self.gid) then

		if(self.gid ~= 0) then -- If it is 0 then there is no tile in this spot

			-- Check for flipped tiles.
			self.flippedHorizontally = false
			self.flippedVertically = false
			self.flippedDiagonally = false

			if self.gid >= 0x80000000 then
				self.flippedHorizontally = true
				self.gid = self.gid - 0x80000000
			end
			if self.gid >= 0x40000000 then
				self.flippedVertically = true
				self.gid = self.gid - 0x40000000
			end

			if self.gid >= 0x20000000 then
				self.flippedDiagonally = true
				self.gid = self.gid - 0x20000000
			end

			local tileSetIndex = 1
			local tileSet = self.map:getTileSet(tileSetIndex)

			if(tileSet) then
				-- If the GID is higher then the amount of tiles in this tileset then it must be in the next tileset (and so on)
				while(self.gid + 1 > tileSet.tileCount + tileSet.firstgid) do
					tileSetIndex = tileSetIndex + 1
					tileSet = self.map.tileSets[tileSetIndex]
				end
			end

			if(tileSet) then

				self.tileSet = tileSet

				-- Get all the properties this tile should have from the tileset
				local properties = tileSet:getPropertiesForTile(self.gid)

				for i=1, #properties, 1 do

					-- Read in the Config file data if it has one, otherwise it is a normal property
					if properties[i].name == "configFile" then
						utils:readInConfigFile(properties[i].value, self)
					else
						self:addProperty(properties[i])
					end

				end

				-- Is this tile animated?
				if(self.IsAnimated) then

					if self.dataFile and self.spriteSheet then

						self.spriteData = require( self.dataFile ).getSpriteSheetData()

						if(self.sequences) then
							local sequenceData = self:getSequenceData()
						end

						if self.spriteData then
							self.spriteSheet = newSpriteSheetFromData( self.spriteSheet, self.spriteData )
							self.spriteSet = newSpriteSet( self.spriteSheet, 1, #self.spriteData.frames )
							sprite.add( self.spriteSet, self.dataFile, 1, #self.spriteData.frames, self.time or 1000, self.loopCount )
							self.sprite = newSprite( self.spriteSet )
							self.sprite:play()
						end

					else
						self.startFrame = self.startFrame or (self.gid - (tileSet.firstgid) + 1)

						-- Does this tile have a set of sequences?
						if(self.sequences) then
							local sequenceData = self:getSequenceData()
							self.sprite = display.newSprite(tileSet.imageSheet, sequenceData)
						else
							local sequenceData = {
								name="animation1",
								start=self.startFrame,
								count=(self.frameCount or (tileSet.tileCount - self.startFrame)),
								loopCount=self.loopCount
							}
							self.sprite = display.newSprite(tileSet.imageSheet, sequenceData)
							-- If the tile has a "frameTime" then create a single sequence allowing it to be time based, otherwise it will just be frame based.
							if self.frameTime then
								sprite.add( self.spriteSet, "DEFAULT", 1, self.frameCount, self.frameTime or 1000, self.loopCount)
								self.sprite:setSequence("DEFAULT")
							end

							self.sprite:play()
						end

					end

				else
					-- Create the actual Corona image object
					self.sprite = display.newImage(tileSet.imageSheet, self.gid - (tileSet.firstgid) + 1)
				end

				-- Calculate and set the row position of this tile in the map
				self.row = floor((index + self.layer.width - 1) / self.layer.width)

				-- Calculate and set the column position of this tile in the map
				self.column = index - (self.row - 1) * self.layer.width

				if (self.xReference or self.yReference) then
					utils:setAnchorPoint(self.sprite, self.xReference, self.yReference)
				end

				if(self.map.orientation == "orthogonal" ) then

					-- Place this tile in the right X position
					self.sprite.x = ( ( self.column - 1 ) * self.map.tilewidth ) + self.sprite.width  * 0.5

					-- Place this tile in the right Y position
					self.sprite.y = ( self.row * self.map.tileheight ) - self.sprite.height * 0.5

				elseif(self.map.orientation == "isometric") then

					-- Correct the row/column numbers
					self.column = self.column - 1
					self.row = self.row - 1

					-- Place this tile in the right X position
					self.sprite.x = (self.column - self.row) * (self.map.tilewidth * 0.5)

					-- Place this tile in the right Y position
					self.sprite.y = (self.column + self.row) * (self.map.tileheight * 0.5)

				end

				-- Apply sprite properties
				self.sprite.alpha = self.alpha or 1
				self.sprite.isHitTestable = utils:stringToBool(self.isHitTestable) or true

				self.sprite.xOrigin = self.xOrigin or self.sprite.xOrigin
				self.sprite.yOrigin = self.yOrigin or self.sprite.yOrigin

				self.sprite.rotation = self.rotation or 0
				self.sprite.x = (self.x or self.sprite.x) + (self.xOffset or 0)
				self.sprite.y = (self.y or self.sprite.y) + (self.yOffset or 0)

				self.sprite.xScale = self.xScale or 1
				self.sprite.yScale = self.yScale or 1

				if _G.limeScreenCullingEnabled then
					self.sprite.isVisible = false
				else
					self.sprite.isVisible = utils:stringToBool(self.isVisible) or true
				end

				if self.xTileOffset then
					self.sprite.x = self.sprite.x + (self.xTileOffset * self.sprite.width)
				end

				if self.yTileOffset then
					self.sprite.y = self.sprite.y + (self.yTileOffset * self.sprite.height)
				end

				-- Correctly add the tile to the tileGrid of the layer
				if(self.gid ~= 0) then

					if(not self.layer.tileGrid) then
						self.layer.tileGrid = {}
					end

					if self.column and self.row then

						if(not self.layer.tileGrid[self.column]) then
							self.layer.tileGrid[self.column] = {}
						end

						if(not self.layer.tileGrid[self.column][self.row]) then
							self.layer.tileGrid[self.column][self.row] = {}
						end

						self.layer.tileGrid[self.column][self.row] = self
					end

				end

				-- Add the sprite to the layer group
				if self.layer.group then
					self.layer.group:insert(self.sprite)
				end

				-- Make sure these are fired after the tile is created so that there is a sprite object
				for key, value in pairs(self.properties) do
					self.map:firePropertyListener(self.properties[key], "tile", self)
				end

				-- Convert HasBody to a boolean value allowing explicit true/false setting. Blank is considered true as to not break old code.
				if self.HasBody then

					if self.HasBody == "" then
						self.HasBody = "true"
					end

					self.HasBody = utils:stringToBool( self.HasBody )
				end

				self.sprite.isVisible = false

				if self.ignoreCulling == true then
					self.sprite.isVisible = true
				end

				-- Tint the sprite if required
				utils:setSpriteFillColor( self.sprite, self.fillColor )

				-- Flip the sprite horizontally if required
				if self.flippedHorizontally then
					self.sprite.xScale = -self.sprite.xScale
				end

				-- Flip the sprite vertically if required
				if self.flippedVertically then
					self.sprite.yScale = -self.sprite.yScale
				end

			end
		end
	end

end

--- Builds the physical representation of the Tile.
function Tile:build()

	local visual = self:getVisual()

	if(self.HasBody and visual) then

		visual.owner = self

		local body = visual

		if(self.shape) then

			if type(self.shape) == "table" then

			elseif type(self.shape) == "string" or type(self.shape) == "number" then

				local jsonVersion = "[0,-37,37,-10,23,34,-23,34,-37,-10]"
				print("Lime-Banana: Using strings to define the shapes of Tile bodies is currently depreceated as Lime 3.0 and beyond is moving over to Json values for properties. Instead, define it similar to this - " .. jsonVersion)

				--[[
				local splitShape = utils:splitString(self.shape, ",")

				if #splitShape > 1 then

					local shape = {}

					for i = 1, #splitShape, 1 do
						shape[#shape + 1] = tonumber(splitShape[i])
					end

					self.shape = shape

				end

				--]]
			end
		end

		-- Now that tiles can be set at runtime it is important to make sure physics is loaded as it may not have been at load time
		if not physics then
			require("physics")
			physics.start()
		end

		self.isSensor = utils:stringToBool(self.isSensor)

		-- If using Retina, half the tile size so the physics body is correct
		if self.tileSet.tileXScale ~= 1 or self.tileSet.tileXScale ~= 1 then

			visual.width = visual.width / self.tileSet.tileXScale
			visual.height = visual.height / self.tileSet.tileYScale

		end

		utils:addCollisionFilterToBody( self )

		physics.addBody( body, self )

		utils:applyPhysicalParametersToBody(body, self)

		utils:addPropertiesToBody(body, self)

		-- If using Retina, set the size back to original
		if  self.tileSet.tileXScale ~= 1 or self.tileSet.tileXScale ~= 1 then

			visual.width = visual.width * self.tileSet.tileXScale
			visual.height = visual.height * self.tileSet.tileYScale

		end
	end

end

--- Completely removes all visual and physical objects associated with the Tile.
function Tile:destroy()

	-- Destroy the properties
 	if self.properties then
 		self.properties = nil
    end

 	-- Destroy the visual object

 	local visual = self:getVisual()

	if visual and visual["removeSelf"] then
		visual:removeSelf()
	end

	visual = nil

end


text:
require File.dirname(__FILE__) + '/../test_helper'

class InboxTest < ActiveSupport::TestCase

  should_belong_to  :user
  should_have_many  :bookmarks
  should_protect_attributes :user_id

  def setup
    @bob = users(:bob)
  end

  context 'Testing fixture data and factory methods' do

    should 'have an inbox' do
      assert @bob.inbox
    end

  end

  context 'Testing inbox association for bob' do

    setup { @inbox = @bob.inbox }

    should 'be destroyed when user is' do
      assert_difference 'Inbox.count', -1 do
        @bob.destroy
      end
    end

    should 'destroy bookmarks along with itself' do
      assert_difference 'Bookmark.count', -3 do
        @inbox.destroy
      end
    end

  end

  context 'Testing optgroup construction' do

    should 'have an OptGroup constant for a new struct responding to :id and :title' do
      assert defined?(Inbox::OptGroup), 'should have Inbox::OptGroup defined'
      optgroup = Inbox::OptGroup.new
      assert_instance_of Inbox::OptGroup, optgroup
      assert optgroup.respond_to?(:id)
      assert optgroup.respond_to?(:title)
    end

    should 'build an box optgroup with inbox suitable for all users' do
      optgroup = Inbox.optgroup
      assert_equal 'INBOX', optgroup.col_name
      assert_equal 1, optgroup.boxes.size, 'should have one Inbox::OptGroup object'
      assert_equal 'inbox', optgroup.boxes.first.id
      assert_equal 'My Inbox', optgroup.boxes.first.title
    end

  end

end


text:
<?php

namespace Concrete\Core\Express\Formatter;

interface FormatterInterface
{
    /**
     * Format a mask using the standard format given a callable
     *
     * Ex: if you have attributes with handles `student_first_name` and `student_last_name`
     * `%student_last_name%, %student_first_name%`
     *
     * @param $mask
     * @param callable $matchHandler
     * @return mixed
     */
    public function format($mask, callable $matchHandler);
}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms").   Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.

/*---
es5id: 15.4.4.21-9-b-1
description: >
    Array.prototype.reduce returns initialvalue when Array is empty
    and initialValue is present
includes: [runTestCase.js]
---*/

function testcase() {

  function callbackfn(prevVal, curVal, idx, obj)
  {
  }

  var arr = new Array(10);

  if(arr.reduce(callbackfn,5) === 5)
      return true;

 }
runTestCase(testcase);


text:
const filepress = require('../filepress')

const frontmatter = filepress.frontmatter
const markdown = filepress.markdown
const themes = filepress.themes
const buildIndex = filepress.buildIndex
const write = filepress.write
const permalinks = filepress.permalinks
const excerpt = filepress.excerpt
const buildArchive = filepress.buildArchive
const settings = filepress.settings
const prevNextPost = filepress.prevNextPost

//Define a logger which can have it's formatting configured.
const logger = (indents) => (obj) => {
    console.log('logging:', JSON.stringify(obj, null, indents))
    return obj
}

module.exports = () => {
	filepress
		.use(frontmatter())
		.use(permalinks())
		.use(markdown())
		.use(excerpt())
		.collect()
		.use(buildIndex())
		.use(buildArchive())
		.use(prevNextPost())
		.seperate()
		.use(themes())
		.use(write(settings.destinationFolder))
		.start(settings.sourceFolder)
}


text:
package gui.create;

import gui.Gui;
import lang.Lang;

import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.List;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.border.EmptyBorder;

import controller.Controller;

@SuppressWarnings("serial")
public class NoWalletFrame extends JFrame {

	private JRadioButton createButton;
	private JRadioButton recoverButton;
	private Gui parent;

	public NoWalletFrame(Gui parent) throws Exception
	{
		super(Lang.getInstance().translate("Qora") + " - " + Lang.getInstance().translate("No Wallet"));

		//ICON
		List<Image> icons = new ArrayList<Image>();
		icons.add(Toolkit.getDefaultToolkit().getImage("images/icons/icon16.png"));
		icons.add(Toolkit.getDefaultToolkit().getImage("images/icons/icon32.png"));
		icons.add(Toolkit.getDefaultToolkit().getImage("images/icons/icon64.png"));
		icons.add(Toolkit.getDefaultToolkit().getImage("images/icons/icon128.png"));
		this.setIconImages(icons);

		//PARENT
		this.parent = parent;

		//LAYOUT
		this.setLayout(new GridBagLayout());

		//PADDING
		((JComponent) this.getContentPane()).setBorder(new EmptyBorder(5, 5, 5, 5));

		//LABEL GBC
		GridBagConstraints labelGBC = new GridBagConstraints();
		labelGBC.insets = new Insets(5,5,5,5);
		labelGBC.fill = GridBagConstraints.HORIZONTAL;
		labelGBC.anchor = GridBagConstraints.NORTHWEST;
		labelGBC.weightx = 1;
		labelGBC.gridwidth = 2;
		labelGBC.gridx = 0;

		//OPTIONS GBC
		GridBagConstraints optionsGBC = new GridBagConstraints();
		//optionsGBC.insets = new Insets(5,5,5,5);
		optionsGBC.fill = GridBagConstraints.NONE;
		optionsGBC.anchor = GridBagConstraints.NORTHWEST;
		optionsGBC.weightx = 1;
		optionsGBC.gridwidth = 2;
		optionsGBC.gridx = 0;
		optionsGBC.gridy = 2;

		//BUTTON GBC
		GridBagConstraints buttonGBC = new GridBagConstraints();
		buttonGBC.insets = new Insets(5,5,0,5);
		buttonGBC.fill = GridBagConstraints.NONE;
		buttonGBC.anchor = GridBagConstraints.NORTHWEST;
		buttonGBC.gridwidth = 1;
		buttonGBC.gridx = 0;

		//LABEL
		labelGBC.gridy = 0;
		JLabel label1 = new JLabel(Lang.getInstance().translate("No existing wallet was found."));
		this.add(label1, labelGBC);

		//LABEL
      	labelGBC.gridy = 1;
      	JLabel label2 = new JLabel(Lang.getInstance().translate("What would you like to do?"));
      	this.add(label2, labelGBC);

      	//ADD OPTIONS
      	this.createButton = new JRadioButton(Lang.getInstance().translate("Create a new wallet."));
      	this.add(this.createButton, optionsGBC);

      	optionsGBC.gridy = 3;
      	this.recoverButton = new JRadioButton(Lang.getInstance().translate("Recover a wallet using an existing seed"));
      	this.add(this.recoverButton, optionsGBC);

      	ButtonGroup group = new ButtonGroup();
      	group.add(this.createButton);
      	group.add(this.recoverButton);

      	 //BUTTON NEXT
        buttonGBC.gridy = 4;
        JButton nextButton = new JButton(Lang.getInstance().translate("Next"));
        nextButton.addActionListener(new ActionListener()
		{
		    public void actionPerformed(ActionEvent e)
		    {
		        onNextClick();
		    }
		});
        nextButton.setPreferredSize(new Dimension(80, 25));
    	this.add(nextButton, buttonGBC);

    	//BUTTON CANCEL
    	buttonGBC.gridx = 1;
    	buttonGBC.gridy = 4;
        JButton cancelButton = new JButton(Lang.getInstance().translate("Cancel"));
        cancelButton.addActionListener(new ActionListener()
		{
		    public void actionPerformed(ActionEvent e)
		    {
		        onCancelClick();
		    }
		});
        cancelButton.setPreferredSize(new Dimension(80, 25));
    	this.add(cancelButton, buttonGBC);

    	//CLOSE NICELY
        this.addWindowListener(new WindowAdapter()
        {
            public void windowClosing(WindowEvent e)
            {
            	Controller.getInstance().stopAll();
            	System.exit(0);
            }
        });

        //CALCULATE HEIGHT WIDTH
      	this.pack();
      	this.setSize(500, this.getHeight());

      	this.setResizable(false);
		this.setLocationRelativeTo(null);
		this.setVisible(true);
	}

	public void onNextClick()
	{
		if(createButton.isSelected())
		{
			//OPEN CREATE WALLET FRAME
			this.setVisible(false);

			new CreateWalletFrame(this);
		}

		if(recoverButton.isSelected())
		{
			//OPEN RECOVER WALLET FRAME
			this.setVisible(false);

			new RecoverWalletFrame(this);
		}
	}

	public void onCancelClick()
	{
		this.parent.onCancelCreateWallet();

		this.dispose();
	}

	public void onWalletCreated()
	{
		Controller.getInstance().forgingStatusChanged(Controller.getInstance().getForgingStatus());

		this.parent.onWalletCreated();

		this.dispose();
	}
}


text:
module EasyCRUD
  module Extensions
    module PageTitle
      extend ActiveSupport::Concern

      private

        def set_page_title
          @page_title = page_title_for(action: action_name)
        end

        def page_title_for(action:)
          method = "page_title_for_#{action}".to_sym
          self.respond_to?(method, true) ? self.send(method) : [t('.title')]
        end

        def page_title_for_index
          [_crud_model.klass.model_name.human(count: 2)]
        end

        def page_title_for_show
          [_crud_model.klass.model_name.human(count: 1), _crud_object.to_s]
        end

        def page_title_for_edit
          [t('.title'), _crud_object.to_s]
        end

        def page_title_for_new
          [t('.title')]
        end

        def page_title_for_create
          page_title_for_new
        end

        def page_title_for_update
          page_title_for_edit
        end

    end
  end
end


text:
<?php

use yii\helpers\Html;
use kartik\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\TopicSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Topics');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="topic-index">
    <?= \frontend\widgets\Alert::widget() ?>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider'=> $dataProvider,
        'filterModel' => $searchModel,
        'columns' => $gridColumns,
        'export' => false,
        'responsive'=>true,
        'hover'=>true
    ]) ?>

</div>


text:
package client

import (
	. "atlantis/manager/rpc/types"
)

type ContainerMaintenanceCommand struct {
	ContainerID string `short:"c" long:"container" description:"the container to set maintenance for"`
	Maintenance bool   `short:"m" long:"maintenance" description:"true to set maintenance mode"`
	Arg         ManagerContainerMaintenanceArg
	Reply       ManagerContainerMaintenanceReply
}

type IdleCommand struct {
	Properties string `noauth:"true"`
	Arg        ManagerIdleArg
	Reply      ManagerIdleReply
}


text:
#pragma once
#include <aws/elasticmapreduce/EMR_EXPORTS.h>
#include <aws/elasticmapreduce/EMRRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>

namespace Aws
{
namespace EMR
{
namespace Model
{

  /**
   */
  class AWS_EMR_API UpdateStudioRequest : public EMRRequest
  {
  public:
    UpdateStudioRequest();

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

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline const Aws::String& GetStudioId() const{ return m_studioId; }

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline bool StudioIdHasBeenSet() const { return m_studioIdHasBeenSet; }

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline void SetStudioId(const Aws::String& value) { m_studioIdHasBeenSet = true; m_studioId = value; }

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline void SetStudioId(Aws::String&& value) { m_studioIdHasBeenSet = true; m_studioId = std::move(value); }

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline void SetStudioId(const char* value) { m_studioIdHasBeenSet = true; m_studioId.assign(value); }

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline UpdateStudioRequest& WithStudioId(const Aws::String& value) { SetStudioId(value); return *this;}

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline UpdateStudioRequest& WithStudioId(Aws::String&& value) { SetStudioId(std::move(value)); return *this;}

    /**
     *
The ID of the Amazon EMR Studio to update.

     */
    inline UpdateStudioRequest& WithStudioId(const char* value) { SetStudioId(value); return *this;}

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A descriptive name for the Amazon EMR Studio.

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

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline UpdateStudioRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline UpdateStudioRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
A detailed description to assign to the Amazon EMR Studio.

     */
    inline UpdateStudioRequest& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline const Aws::Vector<Aws::String>& GetSubnetIds() const{ return m_subnetIds; }

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline bool SubnetIdsHasBeenSet() const { return m_subnetIdsHasBeenSet; }

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline void SetSubnetIds(const Aws::Vector<Aws::String>& value) { m_subnetIdsHasBeenSet = true; m_subnetIds = value; }

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline void SetSubnetIds(Aws::Vector<Aws::String>&& value) { m_subnetIdsHasBeenSet = true; m_subnetIds = std::move(value); }

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline UpdateStudioRequest& WithSubnetIds(const Aws::Vector<Aws::String>& value) { SetSubnetIds(value); return *this;}

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline UpdateStudioRequest& WithSubnetIds(Aws::Vector<Aws::String>&& value) { SetSubnetIds(std::move(value)); return *this;}

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline UpdateStudioRequest& AddSubnetIds(const Aws::String& value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(value); return *this; }

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline UpdateStudioRequest& AddSubnetIds(Aws::String&& value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(std::move(value)); return *this; }

    /**
     *
A list of subnet IDs to associate with the Amazon EMR Studio. The list can
     * include new subnet IDs, but must also include all of the subnet IDs previously
     * associated with the Studio. The list order does not matter. A Studio can have a
     * maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
     *

     */
    inline UpdateStudioRequest& AddSubnetIds(const char* value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(value); return *this; }

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline const Aws::String& GetDefaultS3Location() const{ return m_defaultS3Location; }

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline bool DefaultS3LocationHasBeenSet() const { return m_defaultS3LocationHasBeenSet; }

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline void SetDefaultS3Location(const Aws::String& value) { m_defaultS3LocationHasBeenSet = true; m_defaultS3Location = value; }

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline void SetDefaultS3Location(Aws::String&& value) { m_defaultS3LocationHasBeenSet = true; m_defaultS3Location = std::move(value); }

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline void SetDefaultS3Location(const char* value) { m_defaultS3LocationHasBeenSet = true; m_defaultS3Location.assign(value); }

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline UpdateStudioRequest& WithDefaultS3Location(const Aws::String& value) { SetDefaultS3Location(value); return *this;}

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline UpdateStudioRequest& WithDefaultS3Location(Aws::String&& value) { SetDefaultS3Location(std::move(value)); return *this;}

    /**
     *
The Amazon S3 location to back up Workspaces and notebook files for the
     * Amazon EMR Studio.

     */
    inline UpdateStudioRequest& WithDefaultS3Location(const char* value) { SetDefaultS3Location(value); return *this;}

  private:

    Aws::String m_studioId;
    bool m_studioIdHasBeenSet = false;

    Aws::String m_name;
    bool m_nameHasBeenSet = false;

    Aws::String m_description;
    bool m_descriptionHasBeenSet = false;

    Aws::Vector<Aws::String> m_subnetIds;
    bool m_subnetIdsHasBeenSet = false;

    Aws::String m_defaultS3Location;
    bool m_defaultS3LocationHasBeenSet = false;
  };

} // namespace Model
} // namespace EMR
} // namespace Aws


text:
package ws.epigraph.schema.parser.psi.stubs;

import ws.epigraph.schema.parser.psi.SchemaRecordTypeDef;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @author Konstantin Sobolev
 */
public interface SchemaRecordTypeDefStub extends SchemaTypeDefStubBase<SchemaRecordTypeDef> {
  @Nullable
  List<SerializedFqnTypeRef> getSupplementedTypeRefs();
}


text:
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const inversify_1 = require("inversify");
const socketServer_1 = require("../../common/net/socket/socketServer");
const fileSystem_1 = require("../../common/platform/fileSystem");
const platformService_1 = require("../../common/platform/platformService");
const types_1 = require("../../common/platform/types");
const currentProcess_1 = require("../../common/process/currentProcess");
const decoder_1 = require("../../common/process/decoder");
const types_2 = require("../../common/process/types");
const types_3 = require("../../common/types");
const container_1 = require("../../ioc/container");
const serviceManager_1 = require("../../ioc/serviceManager");
const types_4 = require("../../ioc/types");
const debugStreamProvider_1 = require("./Common/debugStreamProvider");
const processServiceFactory_1 = require("./Common/processServiceFactory");
const protocolLogger_1 = require("./Common/protocolLogger");
const protocolParser_1 = require("./Common/protocolParser");
const protocolWriter_1 = require("./Common/protocolWriter");
const types_5 = require("./types");
function initializeIoc() {
    const cont = new inversify_1.Container();
    const serviceManager = new serviceManager_1.ServiceManager(cont);
    const serviceContainer = new container_1.ServiceContainer(cont);
    serviceManager.addSingletonInstance(types_4.IServiceContainer, serviceContainer);
    registerTypes(serviceManager);
    return serviceContainer;
}
exports.initializeIoc = initializeIoc;
function registerTypes(serviceManager) {
    serviceManager.addSingleton(types_3.ICurrentProcess, currentProcess_1.CurrentProcess);
    serviceManager.addSingleton(types_5.IDebugStreamProvider, debugStreamProvider_1.DebugStreamProvider);
    serviceManager.addSingleton(types_5.IProtocolLogger, protocolLogger_1.ProtocolLogger);
    serviceManager.add(types_5.IProtocolParser, protocolParser_1.ProtocolParser);
    serviceManager.addSingleton(types_1.IFileSystem, fileSystem_1.FileSystem);
    serviceManager.addSingleton(types_1.IPlatformService, platformService_1.PlatformService);
    serviceManager.addSingleton(types_3.ISocketServer, socketServer_1.SocketServer);
    serviceManager.addSingleton(types_5.IProtocolMessageWriter, protocolWriter_1.ProtocolMessageWriter);
    serviceManager.addSingleton(types_2.IBufferDecoder, decoder_1.BufferDecoder);
    serviceManager.addSingleton(types_2.IProcessServiceFactory, processServiceFactory_1.DebuggerProcessServiceFactory);
}
//# sourceMappingURL=serviceRegistry.js.map


text:
package com.fsck.k9.preferences;

import java.util.HashMap;
import java.util.Map;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import android.os.SystemClock;

import androidx.annotation.NonNull;
import com.fsck.k9.helper.Utility;
import com.fsck.k9.preferences.migrations.StorageMigrations;
import com.fsck.k9.preferences.migrations.StorageMigrationsHelper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import timber.log.Timber;

public class K9StoragePersister implements StoragePersister {
    private static final int DB_VERSION = 19;
    private static final String DB_NAME = "preferences_storage";

    private final Context context;

    public K9StoragePersister(Context context) {
        this.context = context;
    }

    private SQLiteDatabase openDB() {
        SQLiteDatabase db = context.openOrCreateDatabase(DB_NAME, Context.MODE_PRIVATE, null);

        db.beginTransaction();
        try {
            if (db.getVersion() > DB_VERSION) {
                throw new AssertionError("Database downgrades are not supported. " +
                        "Please fix the database '" + DB_NAME + "' manually or clear app data.");
            }

            if (db.getVersion() < 1) {
                createStorageDatabase(db);
            } else {
                StorageMigrations.upgradeDatabase(db, migrationsHelper);
            }

            db.setVersion(DB_VERSION);
            db.setTransactionSuccessful();
        } finally {
            db.endTransaction();
        }

        if (db.getVersion() != DB_VERSION) {
            throw new RuntimeException("Storage database upgrade failed!");
        }

        return db;
    }

    private void createStorageDatabase(SQLiteDatabase db) {
        Timber.i("Creating Storage database");

        db.execSQL("DROP TABLE IF EXISTS preferences_storage");
        db.execSQL("CREATE TABLE preferences_storage " +
                "(primkey TEXT PRIMARY KEY ON CONFLICT REPLACE, value TEXT)");
        db.setVersion(DB_VERSION);
    }

    void doInTransaction(StoragePersistOperationCallback operationCallback) {
        HashMap<String, String> workingStorage = new HashMap<>();
        SQLiteDatabase workingDb = openDB();

        try {
            operationCallback.beforePersistTransaction(workingStorage);

            StoragePersistOperations storagePersistOperations = new StoragePersistOperations(workingStorage, workingDb);
            workingDb.beginTransaction();
            operationCallback.persist(storagePersistOperations);
            storagePersistOperations.close();
            workingDb.setTransactionSuccessful();

            operationCallback.onPersistTransactionSuccess(workingStorage);
        } finally {
            workingDb.endTransaction();
            workingDb.close();
        }
    }

    @NonNull
    @Override
    public StorageEditor createStorageEditor(@NonNull StorageUpdater storageUpdater) {
        return new K9StorageEditor(storageUpdater, this);
    }

    static class StoragePersistOperations {
        private Map<String, String> workingStorage;
        private final SQLiteStatement deleteStatement;
        private final SQLiteStatement insertStatement;

        private StoragePersistOperations(Map<String, String> workingStorage, SQLiteDatabase database) {
            this.workingStorage = workingStorage;

            insertStatement = database.compileStatement(
                    "INSERT INTO preferences_storage (primkey, value) VALUES (?, ?)");
            deleteStatement = database.compileStatement(
                    "DELETE FROM preferences_storage WHERE primkey = ?");
        }

        void put(String key, String value) {
            insertStatement.bindString(1, key);
            insertStatement.bindString(2, value);
            insertStatement.execute();
            insertStatement.clearBindings();

            workingStorage.put(key, value);
        }

        void remove(String key) {
            deleteStatement.bindString(1, key);
            deleteStatement.executeUpdateDelete();
            deleteStatement.clearBindings();

            workingStorage.remove(key);
        }

        private void close() {
            insertStatement.close();
            deleteStatement.close();
        }
    }

    interface StoragePersistOperationCallback {
        void beforePersistTransaction(Map<String, String> workingStorage);
        void persist(StoragePersistOperations ops);
        void onPersistTransactionSuccess(Map<String, String> workingStorage);
    }

    @NonNull
    @Override
    public Storage loadValues() {
        long startTime = SystemClock.elapsedRealtime();
        Timber.i("Loading preferences from DB into Storage");

        try (SQLiteDatabase database = openDB()) {
            return new Storage(readAllValues(database));
        } finally {
            long endTime = SystemClock.elapsedRealtime();
            Timber.i("Preferences load took %d ms", endTime - startTime);
        }
    }

    private Map<String, String> readAllValues(SQLiteDatabase database) {
        HashMap<String, String> loadedValues = new HashMap<>();
        Cursor cursor = null;
        try {
            cursor = database.rawQuery("SELECT primkey, value FROM preferences_storage", null);
            while (cursor.moveToNext()) {
                String key = cursor.getString(0);
                String value = cursor.getString(1);
                Timber.d("Loading key '%s', value = '%s'", key, value);
                loadedValues.put(key, value);
            }
        } finally {
            Utility.closeQuietly(cursor);
        }

        return loadedValues;
    }

    private String readValue(SQLiteDatabase mDb, String key) {
        Cursor cursor = null;
        String value = null;
        try {
            cursor = mDb.query(
                    "preferences_storage",
                    new String[] {"value"},
                    "primkey = ?",
                    new String[] {key},
                    null,
                    null,
                    null);

            if (cursor.moveToNext()) {
                value = cursor.getString(0);
                Timber.d("Loading key '%s', value = '%s'", key, value);
            }
        } finally {
            Utility.closeQuietly(cursor);
        }

        return value;
    }

    private void writeValue(SQLiteDatabase mDb, String key, String value) {
        if (value == null) {
            mDb.delete("preferences_storage", "primkey = ?", new String[] { key });
            return;
        }

        ContentValues cv = new ContentValues();
        cv.put("primkey", key);
        cv.put("value", value);

        long result = mDb.update("preferences_storage", cv, "primkey = ?", new String[] { key });

        if (result == -1) {
            Timber.e("Error writing key '%s', value = '%s'", key, value);
        }
    }

    private void insertValue(SQLiteDatabase mDb, String key, String value) {
        if (value == null) {
            return;
        }

        ContentValues cv = new ContentValues();
        cv.put("primkey", key);
        cv.put("value", value);

        long result = mDb.insert("preferences_storage", null, cv);

        if (result == -1) {
            Timber.e("Error writing key '%s', value = '%s'", key, value);
        }
    }

    private StorageMigrationsHelper migrationsHelper = new StorageMigrationsHelper() {
        @Override
        public void writeValue(@NotNull SQLiteDatabase db, @NotNull String key, String value) {
            K9StoragePersister.this.writeValue(db, key, value);
        }

        @NotNull
        @Override
        public Map<String, String> readAllValues(@NotNull SQLiteDatabase db) {
            return K9StoragePersister.this.readAllValues(db);
        }

        @Override
        public String readValue(@NotNull SQLiteDatabase db, @NotNull String key) {
            return K9StoragePersister.this.readValue(db, key);
        }

        @Override
        public void insertValue(@NotNull SQLiteDatabase db, @NotNull String key, @Nullable String value) {
            K9StoragePersister.this.insertValue(db, key, value);
        }
    };
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycoscience 42(4): 373 (2001)

#### Original name
Lasiosphaeria alexandricola Joanne E. Taylor, J. Fröhl. & K.D. Hyde

### Remarks
null


text:
require 'ffi'

MemoryPointer = FFI::MemoryPointer

describe "MemoryPointer#total" do
  it "MemoryPointer.new(:char, 1).total == 1" do
    expect(MemoryPointer.new(:char, 1).total).to eq 1
  end
  it "MemoryPointer.new(:short, 1).total == 2" do
    expect(MemoryPointer.new(:short, 1).total).to eq 2
  end
  it "MemoryPointer.new(:int, 1).total == 4" do
    expect(MemoryPointer.new(:int, 1).total).to eq 4
  end
  it "MemoryPointer.new(:long_long, 1).total == 8" do
    expect(MemoryPointer.new(:long_long, 1).total).to eq 8
  end
  it "MemoryPointer.new(1024).total == 1024" do
    expect(MemoryPointer.new(1024).total).to eq 1024
  end
end
describe "MemoryPointer#read_array_of_long" do
  it "foo" do
    ptr = MemoryPointer.new(:long, 1024)
    ptr[0].write_long 1234
    ptr[1].write_long 5678
    l = ptr.read_array_of_long(2)
    expect(l[0]).to eq 1234
    expect(l[1]).to eq 5678
  end
end
describe "MemoryPointer argument" do
  module Ptr
    extend FFI::Library
    ffi_lib FFI::Platform::LIBC
    attach_function :memset, [ :pointer, :int, :ulong ], :pointer
    attach_function :memcpy, [ :pointer, :pointer, :ulong ], :pointer
  end
  it "Pointer passed correctly" do
    p = MemoryPointer.new :int, 1
    ret = Ptr.memset(p, 0, p.total)
    expect(ret).to eq p
  end
  it "Data passed to native function" do
    p = MemoryPointer.new :int, 1
    p2 = MemoryPointer.new :int, 1
    p2.put_int(0, 0x5eadbeef)
    Ptr.memcpy(p, p2, p.total)
    expect(p.get_int(0)).to eq p2.get_int(0)
    expect(p2.get_int(0)).not_to eql 0
  end
end
describe "MemoryPointer return value" do
  module Stdio
    extend FFI::Library
    ffi_lib FFI::Platform::LIBC
    attach_function :fopen, [ :string, :string ], :pointer
    attach_function :fclose, [ :pointer ], :int
    attach_function :fwrite, [ :pointer, :ulong, :ulong, :string ], :ulong
  end
  it "fopen returns non-nil" do
    fp = Stdio.fopen("/dev/null", "w")
    expect(fp).to_not be_nil
    expect(Stdio.fclose(fp)).to  eq 0 unless fp.nil? or fp.null?
  end
end


text:
require 'mida/vocabulary'

module Mida
  module SchemaOrg

    autoload :Thing, 'mida/vocabularies/schemaorg/thing'
    autoload :CreativeWork, 'mida/vocabularies/schemaorg/creativework'
    autoload :MediaObject, 'mida/vocabularies/schemaorg/mediaobject'

    # A music video file.
    class MusicVideoObject < Mida::Vocabulary
      itemtype %r{http://schema.org/MusicVideoObject}i
      include_vocabulary Mida::SchemaOrg::Thing
      include_vocabulary Mida::SchemaOrg::CreativeWork
      include_vocabulary Mida::SchemaOrg::MediaObject
    end

  end
end


text:
""" A unified interface for performing and debugging optimization problems.

Only L-BFGS-B and Powell is supported in this class for versions of
Scipy < 0.12. All optimizers are available for scipy >= 0.12.
"""
import abc
from distutils.version import LooseVersion
import numpy as np
import scipy
import scipy.sparse as sps
import scipy.optimize as opt
from dipy.utils.six import with_metaclass

SCIPY_LESS_0_12 = LooseVersion(scipy.version.short_version) < '0.12'

if not SCIPY_LESS_0_12:
    from scipy.optimize import minimize
else:
    from scipy.optimize import fmin_l_bfgs_b, fmin_powell

class Optimizer(object):

    def __init__(self, fun,  x0, args=(), method='L-BFGS-B', jac=None,
                 hess=None, hessp=None, bounds=None, constraints=(),
                 tol=None, callback=None, options=None, evolution=False):
        """ A class for handling minimization of scalar function of one or more
        variables.

        Parameters
        ----------
        fun : callable
            Objective function.

        x0 : ndarray
            Initial guess.

        args : tuple, optional
            Extra arguments passed to the objective function and its
            derivatives (Jacobian, Hessian).

        method : str, optional
            Type of solver.  Should be one of

                - 'Nelder-Mead'
                - 'Powell'
                - 'CG'
                - 'BFGS'
                - 'Newton-CG'
                - 'Anneal'
                - 'L-BFGS-B'
                - 'TNC'
                - 'COBYLA'
                - 'SLSQP'
                - 'dogleg'
                - 'trust-ncg'

        jac : bool or callable, optional
            Jacobian of objective function. Only for CG, BFGS, Newton-CG,
            dogleg, trust-ncg.
            If `jac` is a Boolean and is True, `fun` is assumed to return the
            value of Jacobian along with the objective function. If False, the
            Jacobian will be estimated numerically.
            `jac` can also be a callable returning the Jacobian of the
            objective. In this case, it must accept the same arguments
            as `fun`.

        hess, hessp : callable, optional
            Hessian of objective function or Hessian of objective function
            times an arbitrary vector p.  Only for Newton-CG,
            dogleg, trust-ncg.
            Only one of `hessp` or `hess` needs to be given.  If `hess` is
            provided, then `hessp` will be ignored.  If neither `hess` nor
            `hessp` is provided, then the hessian product will be approximated
            using finite differences on `jac`. `hessp` must compute the Hessian
            times an arbitrary vector.

        bounds : sequence, optional
            Bounds for variables (only for L-BFGS-B, TNC and SLSQP).
            ``(min, max)`` pairs for each element in ``x``, defining
            the bounds on that parameter. Use None for one of ``min`` or
            ``max`` when there is no bound in that direction.

        constraints : dict or sequence of dict, optional
            Constraints definition (only for COBYLA and SLSQP).
            Each constraint is defined in a dictionary with fields:
                type : str
                    Constraint type: 'eq' for equality, 'ineq' for inequality.
                fun : callable
                    The function defining the constraint.
                jac : callable, optional
                    The Jacobian of `fun` (only for SLSQP).
                args : sequence, optional
                    Extra arguments to be passed to the function and Jacobian.
            Equality constraint means that the constraint function result is to
            be zero whereas inequality means that it is to be non-negative.
            Note that COBYLA only supports inequality constraints.

        tol : float, optional
            Tolerance for termination. For detailed control, use
            solver-specific options.

        callback : callable, optional
            Called after each iteration, as ``callback(xk)``, where ``xk`` is
            the current parameter vector. Only available using Scipy >= 0.12.

        options : dict, optional
            A dictionary of solver options. All methods accept the following
            generic options:
                maxiter : int
                    Maximum number of iterations to perform.
                disp : bool
                    Set to True to print convergence messages.
            For method-specific options, see
            `show_options('minimize', method)`.

        evolution : bool, optional
            save history of x for each iteration. Only available using Scipy
            >= 0.12.

        See also
        ---------
        scipy.optimize.minimize
        """

        self.size_of_x = len(x0)
        self._evol_kx = None

        _eps = np.finfo(float).eps

        if SCIPY_LESS_0_12:

            if evolution is True:
                print('Saving history is available only with Scipy >= 0.12.')

            if method == 'L-BFGS-B':
                default_options = {'maxcor': 10, 'ftol': 1e-7, 'gtol': 1e-5,
                                   'eps': 1e-8, 'maxiter': 1000}

                if jac is None:
                    approx_grad = True
                else:
                    approx_grad = False

                if options is None:
                    options = default_options

                if options is not None:
                    for key in options:
                        default_options[key] = options[key]
                    options = default_options

                try:
                    out = fmin_l_bfgs_b(fun, x0, args,
                                        approx_grad=approx_grad,
                                        bounds=bounds,
                                        m=options['maxcor'],
                                        factr=options['ftol']/_eps,
                                        pgtol=options['gtol'],
                                        epsilon=options['eps'],
                                        maxiter=options['maxiter'])
                except TypeError:

                    msg = 'In Scipy ' + scipy.__version__ + ' `maxiter` '
                    msg += 'parameter is not available for L-BFGS-B. \n Using '
                    msg += '`maxfun` instead with value twice of maxiter.'

                    print(msg)
                    out = fmin_l_bfgs_b(fun, x0, args,
                                        approx_grad=approx_grad,
                                        bounds=bounds,
                                        m=options['maxcor'],
                                        factr=options['ftol']/_eps,
                                        pgtol=options['gtol'],
                                        epsilon=options['eps'],
                                        maxfun=options['maxiter'] * 2)

                res = {'x': out[0], 'fun': out[1], 'nfev': out[2]['funcalls']}
                try:
                    res['nit'] = out[2]['nit']
                except KeyError:
                    res['nit'] = None

            elif method == 'Powell':

                default_options = {'xtol': 0.0001, 'ftol': 0.0001,
                                   'maxiter': None}

                if options is None:
                    options = default_options

                if options is not None:
                    for key in options:
                        default_options[key] = options[key]
                    options = default_options

                out = fmin_powell(fun, x0, args,
                                  xtol=options['xtol'],
                                  ftol=options['ftol'],
                                  maxiter=options['maxiter'],
                                  full_output=True,
                                  disp=False,
                                  retall=True)

                xopt, fopt, direc, iterations, funcs, warnflag, allvecs = out
                res = {'x': xopt, 'fun': fopt,
                       'nfev': funcs, 'nit': iterations}

            else:

                msg = 'Only L-BFGS-B and Powell is supported in this class '
                msg += 'for versions of Scipy < 0.12.'
                raise ValueError(msg)

        if not SCIPY_LESS_0_12:

            if evolution is True:

                self._evol_kx = []

                def history_of_x(kx):
                    self._evol_kx.append(kx)
                res = minimize(fun, x0, args, method, jac, hess, hessp, bounds,
                               constraints, tol, callback=history_of_x,
                               options=options)

            else:

                res = minimize(fun, x0, args, method, jac, hess, hessp, bounds,
                               constraints, tol, callback, options)

        self.res = res

    @property
    def xopt(self):

        return self.res['x']

    @property
    def fopt(self):

        return self.res['fun']

    @property
    def nit(self):

        return self.res['nit']

    @property
    def nfev(self):

        return self.res['nfev']

    @property
    def message(self):

        return self.res['message']

    def print_summary(self):

        print(self.res)

    @property
    def evolution(self):
        if self._evol_kx is not None:
            return np.asarray(self._evol_kx)
        else:
            return None

def spdot(A, B):
    """The same as np.dot(A, B), except it works even if A or B or both
    are sparse matrices.

    Parameters
    ----------
    A, B : arrays of shape (m, n), (n, k)

    Returns
    -------
    The matrix product AB. If both A and B are sparse, the result will be a
    sparse matrix. Otherwise, a dense result is returned

    See discussion here:
    http://mail.scipy.org/pipermail/scipy-user/2010-November/027700.html
    """
    if sps.issparse(A) and sps.issparse(B):
        return A * B
    elif sps.issparse(A) and not sps.issparse(B):
        return (A * B).view(type=B.__class__)
    elif not sps.issparse(A) and sps.issparse(B):
        return (B.T * A.T).T.view(type=A.__class__)
    else:
        return np.dot(A, B)

def sparse_nnls(y, X,
                momentum=1,
                step_size=0.01,
                non_neg=True,
                check_error_iter=10,
                max_error_checks=10,
                converge_on_sse=0.99):
    """

    Solve y=Xh for h, using gradient descent, with X a sparse matrix

    Parameters
    ----------

    y : 1-d array of shape (N)
        The data. Needs to be dense.

    X : ndarray. May be either sparse or dense. Shape (N, M)
       The regressors

    momentum : float, optional (default: 1).
        The persistence of the gradient.

    step_size : float, optional (default: 0.01).
        The increment of parameter update in each iteration

    non_neg : Boolean, optional (default: True)
        Whether to enforce non-negativity of the solution.

    check_error_iter : int (default:10)
        How many rounds to run between error evaluation for
        convergence-checking.

    max_error_checks : int (default: 10)
        Don't check errors more than this number of times if no improvement in
        r-squared is seen.

    converge_on_sse : float (default: 0.99)
      a percentage improvement in SSE that is required each time to say
      that things are still going well.

    Returns
    -------
    h_best : The best estimate of the parameters.

    """
    num_regressors = X.shape[1]
    # Initialize the parameters at the origin:
    h = np.zeros(num_regressors)
    # If nothing good happens, we'll return that:
    h_best = h
    gradient = np.zeros(num_regressors)
    iteration = 1
    ss_residuals_min = np.inf  # This will keep track of the best solution
    sse_best = np.inf   # This will keep track of the best performance so far
    count_bad = 0  # Number of times estimation error has gone up.
    error_checks = 0  # How many error checks have we done so far

    while 1:
        if iteration > 1:
            # The sum of squared error given the current parameter setting:
            sse = np.sum((y - spdot(X, h)) ** 2)
            # The gradient is (Kay 2008 supplemental page 27):
            gradient = spdot(X.T, spdot(X, h) - y)
            gradient += momentum * gradient
            # Normalize to unit-length
            unit_length_gradient = (gradient /
                                    np.sqrt(np.dot(gradient, gradient)))
            # Update the parameters in the direction of the gradient:
            h -= step_size * unit_length_gradient
            if non_neg:
                # Set negative values to 0:
                h[h < 0] = 0

        # Every once in a while check whether it's converged:
        if np.mod(iteration, check_error_iter):
            # This calculates the sum of squared residuals at this point:
            sse = np.sum((y - spdot(X, h)) ** 2)
            # Did we do better this time around?
            if sse < ss_residuals_min:
                # Update your expectations about the minimum error:
                ss_residuals_min = sse
                h_best = h  # This holds the best params we have so far
                # Are we generally (over iterations) converging on
                # sufficient improvement in r-squared?
                if sse < converge_on_sse * sse_best:
                    sse_best = sse
                    count_bad = 0
                else:
                    count_bad += 1
            else:
                count_bad += 1

            if count_bad >= max_error_checks:
                return h_best
            error_checks += 1
        iteration += 1

class SKLearnLinearSolver(with_metaclass(abc.ABCMeta, object)):
    """
    Provide a sklearn-like uniform interface to algorithms that solve problems
    of the form: $y = Ax$ for $x$

    Sub-classes of SKLearnLinearSolver should provide a 'fit' method that have
    the following signature: `SKLearnLinearSolver.fit(X, y)`, which would set
    an attribute `SKLearnLinearSolver.coef_`, with the shape (X.shape[1],),
    such that an estimate of y can be calculated as:
    `y_hat = np.dot(X, SKLearnLinearSolver.coef_.T)`
    """
    def __init__(self, *args, **kwargs):
        self._args = args
        self._kwargs = kwargs

    @abc.abstractmethod
    def fit(self, X, y):
        """Implement for all derived classes """

    def predict(self, X):
        """
        Predict using the result of the model

        Parameters
        ----------
        X : array-like (n_samples, n_features)
            Samples.

        Returns
        -------
        C : array, shape = (n_samples,)
            Predicted values.
        """
        X = np.asarray(X)
        return np.dot(X, self.coef_.T)

class NonNegativeLeastSquares(SKLearnLinearSolver):
    """
    A sklearn-like interface to scipy.optimize.nnls

    """
    def fit(self, X, y):
        """
        Fit the NonNegativeLeastSquares linear model to data

        Parameters
        ----------

        """
        coef, rnorm = opt.nnls(X, y)
        self.coef_ = coef
        return self