text:
package com.nms.ws.charging;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for responseBase complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="responseBase">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="content" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="detail" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="msisdn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="result" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "responseBase", propOrder = {
    "content",
    "detail",
    "msisdn",
    "result"
})
@XmlSeeAlso({
    ContentPurcharseRes.class
})
public class ResponseBase {

    protected String content;
    protected String detail;
    protected String msisdn;
    protected int result;

    /**
     * Gets the value of the content property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getContent() {
        return content;
    }

    /**
     * Sets the value of the content property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setContent(String value) {
        this.content = value;
    }

    /**
     * Gets the value of the detail property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDetail() {
        return detail;
    }

    /**
     * Sets the value of the detail property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDetail(String value) {
        this.detail = value;
    }

    /**
     * Gets the value of the msisdn property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getMsisdn() {
        return msisdn;
    }

    /**
     * Sets the value of the msisdn property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setMsisdn(String value) {
        this.msisdn = value;
    }

    /**
     * Gets the value of the result property.
     *
     */
    public int getResult() {
        return result;
    }

    /**
     * Sets the value of the result property.
     *
     */
    public void setResult(int value) {
        this.result = value;
    }

}


text:
class cBlockSaplingHandler :
	public cBlockHandler
{
public:
	cBlockSaplingHandler(BLOCKTYPE a_BlockType)
		: cBlockHandler(a_BlockType)
	{
	}

	virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
	{
		// Only the first 2 bits contain the display information, the others are for growing
		a_Pickups.push_back(cItem(E_BLOCK_SAPLING, 1, a_BlockMeta & 3));
	}

	virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
	{
		return (a_RelY > 0) && IsBlockTypeOfDirt(a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ));
	}

	virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
	{
		NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);

		if ((Meta & 0x08) != 0)
		{
			int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
			int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
			a_Chunk.GetWorld()->GrowTree(BlockX, a_RelY, BlockZ);
		}
		else
		{
			a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta | 0x08);
		}
	}

	virtual const char * GetStepSound(void) override
	{
		return "step.grass";
	}
} ;

redpajama_set_name: RedPajamaGithub


text:
#pragma once
#ifndef BRUCE_H
#define BRUCE_H

#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/ref.hpp>
#include <stdexcept>

#include <libbruce/be/be.h>
#include <libbruce/be/mem.h>
#include <libbruce/be/disk.h>
#include <libbruce/tree.h>

namespace libbruce {

bool finish_mutation(be::be &blockEngine, mutation &mut, bool success);

template<typename K, typename V>
class bruce
{
public:
    typedef typename tree<K, V>::ptr tree_ptr;
    typedef typename tree<K, V>::iterator iterator;

    bruce(be::be &blockEngine)
        : m_blockEngine(blockEngine)
    {
    }

    /**
     * Create a new bruce tree
     *
     * The empty tree will not be backed by any block, because that would be
     * silly.
     */
    tree_ptr create()
    {
        return boost::make_shared<tree<K,V> >(maybe_nodeid(), boost::ref(m_blockEngine));
    }

    /**
     * Open an existing bruce tree
     */
    tree_ptr edit(const nodeid_t &id)
    {
        return boost::make_shared<tree<K, V> >(id, boost::ref(m_blockEngine));
    }

    /**
     * Query an existing bruce tree
     */
    tree_ptr query(const nodeid_t &id)
    {
        return boost::make_shared<tree<K,V> >(id, boost::ref(m_blockEngine));
    }

    /**
     * Commit or abort a given mutation.
     *
     * This should ALWAYS be called after flushing a tree.
     *
     * The success flag is combined with the success flag of the mutation. Only
     * if both are true, all obsolete blocks are deleted. Otherwise, the newly
     * created blocks are deleted.
     *
     * The mutation record is changed to remove deleted blocks from the
     * appropriate lists (i.e., after this function returns, it will contain
     * only IDs that STILL need to be deleted).
     *
     * Returns true iff all deletes succeeded.
     */
    bool finish(mutation &mut, bool success)
    {
        return finish_mutation(m_blockEngine, mut, success);
    }

    static tree_functions fns;
private:
    be::be &m_blockEngine;
};

template<typename K, typename V>
tree_functions bruce<K, V>::fns(&traits::convert<K>::compare, &traits::convert<V>::compare, &traits::convert<K>::size, &traits::convert<V>::size);

}

#endif


text:
import os
from os import path
import shutil
import logging
import sys
import zipfile

from lib import task, cd, filter_filenames, filter_dirnames
from utils import run_shell, ensure_lib_available

LOG = logging.getLogger(__name__)

def _clean_firefox(build_type_dir):
	original_harness_options = os.path.join(build_type_dir, 'firefox', 'harness-options.json')
	backup_harness_options = os.path.join(build_type_dir, 'firefox', 'harness-options-bak.json')
	LOG.debug('Cleaning up after firefox run')
	if os.path.isfile(backup_harness_options):
		shutil.move(backup_harness_options, original_harness_options)

@task
def clean_firefox(build, build_type_dir):
	_clean_firefox(build_type_dir)

def _run_python_code(build, extra_path, entry_point):
	python_runner = ensure_lib_available(build, 'python_runner.py')

	if sys.platform.startswith("win"):
		runner = ensure_lib_available(build, 'python_runner_win.exe')
		run_shell(runner, extra_path, entry_point, command_log_level=logging.INFO, check_for_interrupt=True)
	elif sys.platform.startswith("darwin"):
		runner = ensure_lib_available(build, 'python_runner_darwin')
		run_shell(runner, extra_path, entry_point, command_log_level=logging.INFO, check_for_interrupt=True, create_process_group=True)
	else:
		python = sys.executable
		run_shell(python, python_runner, extra_path, entry_point, command_log_level=logging.INFO, check_for_interrupt=True)

@task
def run_firefox(build, build_type_dir):
	firefox_lib = ensure_lib_available(build, 'run-firefox.zip')

	try:
		_run_python_code(build, firefox_lib, 'firefox_runner.run')
	finally:
		_clean_firefox(build_type_dir)

def _generate_package_name(build):
	if "core" not in build.config:
		build.config["core"] = {}
	if "firefox" not in build.config["core"]:
		build.config["core"]["firefox"] = {}
	if "package_name" not in build.config["core"]["firefox"]:
		build.config["core"]["firefox"]["package_name"] = build.config["uuid"]
	return build.config["core"]["firefox"]["package_name"]

@task
def package_firefox(build):
	development_dir = path.join('development', 'firefox')
	release_dir = path.join('release', 'firefox')
	if not path.isdir(release_dir):
		os.makedirs(release_dir)

	xpi_filename = '{name}.xpi'.format(name=build.config['xml_safe_name'])
	IGNORED_FILES = ['.hgignore', '.DS_Store',
					 'application.ini', xpi_filename]

	with cd(development_dir):
		zipf = zipfile.ZipFile(xpi_filename, 'w', zipfile.ZIP_DEFLATED)
		for dirpath, dirnames, filenames in os.walk('.'):
			filenames = list(filter_filenames(filenames, IGNORED_FILES))
			dirnames[:] = filter_dirnames(dirnames)
			for filename in filenames:
				abspath = os.path.join(dirpath, filename)
				LOG.info('Adding: %s' % abspath)
				zipf.write(abspath)
		zipf.close()
	shutil.move(path.join(development_dir, xpi_filename), path.join(release_dir, xpi_filename))


text:
package com.xeiam.xchange.btce.v3.service.polling;

import java.io.IOException;

import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.btce.v3.BTCE;
import com.xeiam.xchange.btce.v3.dto.marketdata.BTCEDepthWrapper;
import com.xeiam.xchange.btce.v3.dto.marketdata.BTCEExchangeInfo;
import com.xeiam.xchange.btce.v3.dto.marketdata.BTCETickerWrapper;
import com.xeiam.xchange.btce.v3.dto.marketdata.BTCETradesWrapper;

/**
 * Author: brox
 * Since: 2014-02-12
 */
public class BTCEMarketDataServiceRaw extends BTCEBasePollingService<BTCE> {

  protected static final int FULL_SIZE = 2000;

  /**
   * Initialize common properties from the exchange specification
   *
   * @param exchangeSpecification The {@link com.xeiam.xchange.ExchangeSpecification}
   */
  public BTCEMarketDataServiceRaw(ExchangeSpecification exchangeSpecification) {

    super(BTCE.class, exchangeSpecification);
  }

  /**
   * @param pairs Dash-delimited string of currency pairs to retrieve (e.g. "btc_usd-ltc_btc")
   * @return BTCETickerWrapper object
   * @throws IOException
   */
  public BTCETickerWrapper getBTCETicker(String pairs) throws IOException {

    return btce.getTicker(pairs.toLowerCase(), 1);
  }

  /**
   * Get market depth from exchange
   *
   * @param pairs Dash-delimited string of currency pairs to retrieve (e.g. "btc_usd-ltc_btc")
   * @param size Integer value from 1 to 2000 -> get corresponding number of items
   * @return BTCEDepthWrapper object
   * @throws IOException
   */
  public BTCEDepthWrapper getBTCEDepth(String pairs, int size) throws IOException {

    if (size < 1) {
      size = 1;
    }

    if (size > FULL_SIZE) {
      size = FULL_SIZE;
    }

    return btce.getDepth(pairs.toLowerCase(), size, 1);
  }

  /**
   * Get recent trades from exchange
   *
   * @param pairs Dash-delimited string of currency pairs to retrieve (e.g. "btc_usd-ltc_btc")
   * @param size Integer value from 1 to 2000 -> get corresponding number of items
   * @return BTCETradesWrapper object
   * @throws IOException
   */
  public BTCETradesWrapper getBTCETrades(String pairs, int size) throws IOException {

    if (size < 1) {
      size = 1;
    }

    if (size > FULL_SIZE) {
      size = FULL_SIZE;
    }

    return btce.getTrades(pairs.toLowerCase(), size, 1);
  }

  /**
   * Get BTC-e exchange info
   *
   * @return BTCEExchangeInfo object
   * @throws IOException
   */
  public BTCEExchangeInfo getBTCEInfo() throws IOException {

    return btce.getInfo();
  }

}


text:
package org.elasticsearch.xpack.core.watcher.support;

import org.elasticsearch.common.Strings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentType;
import org.joda.time.DateTime;

import java.io.IOException;
import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

import static org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils.formatDate;

public final class WatcherUtils {

    private static final Pattern NO_WS_PATTERN = Pattern.compile("\\S+");

    private WatcherUtils() {
    }

    public static Map<String, Object> responseToData(ToXContentObject response) throws IOException {
        return XContentHelper.convertToMap(XContentHelper.toXContent(response, XContentType.JSON, false), false, XContentType.JSON).v2();
    }

    public static Map<String, Object> flattenModel(Map<String, Object> map) {
        Map<String, Object> result = new HashMap<>();
        flattenModel("", map, result);
        return result;
    }

    private static void flattenModel(String key, Object value, Map<String, Object> result) {
        if (value == null) {
            result.put(key, null);
            return;
        }
        if (value instanceof Map) {
            for (Map.Entry<String, Object> entry : ((Map<String, Object>) value).entrySet()) {
                if ("".equals(key)) {
                    flattenModel(entry.getKey(), entry.getValue(), result);
                } else {
                    flattenModel(key + "." + entry.getKey(), entry.getValue(), result);
                }
            }
            return;
        }
        if (value instanceof Iterable) {
            int i = 0;
            for (Object item : (Iterable) value) {
                flattenModel(key + "." + i++, item, result);
            }
            return;
        }
        if (value.getClass().isArray()) {
            for (int i = 0; i < Array.getLength(value); i++) {
                flattenModel(key + "." + i, Array.get(value, i), result);
            }
            return;
        }
        if (value instanceof DateTime) {
            result.put(key, formatDate((DateTime) value));
            return;
        }
        if (value instanceof TimeValue) {
            result.put(key, String.valueOf(((TimeValue) value).getMillis()));
            return;
        }
        result.put(key, String.valueOf(value));
    }

    public static boolean isValidId(String id) {
        return Strings.isEmpty(id) == false && NO_WS_PATTERN.matcher(id).matches();
    }
}


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

<routes xmlns="http://symfony.com/schema/routing"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

    <route id="blog_show" pattern="/blog/{slug}" hostname-pattern="{locale}.example.com">
        <default key="_controller">MyBundle:Blog:show</default>
        <requirement key="_method">GET</requirement>
        <option key="compiler_class">RouteCompiler</option>
    </route>
</routes>


text:
// Copyright 2007 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.

package org.apache.tapestry5.util;

import org.apache.tapestry5.OptionGroupModel;
import org.apache.tapestry5.OptionModel;
import org.apache.tapestry5.SelectModel;
import org.apache.tapestry5.SelectModelVisitor;

import java.util.List;

/**
 * Base class for {@link SelectModel} implementations, whose primary job is to provide the {@link
 * #visit(SelectModelVisitor)} method.
 */
public abstract class AbstractSelectModel implements SelectModel
{
    public final void visit(SelectModelVisitor visitor)
    {
        List<OptionGroupModel> groups = getOptionGroups();

        if (groups != null)
        {
            for (OptionGroupModel groupModel : groups)
            {
                visitor.beginOptionGroup(groupModel);

                visitOptions(groupModel.getOptions(), visitor);

                visitor.endOptionGroup(groupModel);
            }
        }

        visitOptions(getOptions(), visitor);
    }

    private void visitOptions(List<OptionModel> options, SelectModelVisitor vistor)
    {
        if (options != null)
        {
            for (OptionModel optionModel : options)
                vistor.option(optionModel);
        }
    }

}


text:
USE BookStoreTest
GO

CREATE PROC spBooks
as
BEGIN
	SELECT * FROM Book
END
GO

CREATE PROC spBookAuthors
@BookId int
AS
BEGIN
	SELECT A.AuthorId, A.AuthorFName + ' ' + A.AuthorLName AS Authors
	FROM Author A, BookAuthor BA
	WHERE BA.BookId = @BookId AND  BA.AuthorId = A.AuthorId
END
GO

CREATE PROC [dbo].[spAuthorBooks]
@AuthorId int
AS
BEGIN
	SELECT B.BookId, B.BookName, B.Published, B.PublisherId
	FROM Book B, BookAuthor BA
	WHERE B.BookId=BA.BookId AND BA.AuthorId=@AuthorId
END
GO

CREATE PROC spBookAdd
@BookName nvarchar(50),
@Published datetime,
@PublisherId int,
@Authors nvarchar(MAX)
AS
BEGIN
	DECLARE @newid int

	INSERT INTO Book VALUES (@BookName, @Published, @PublisherId)
	select @newid = scope_identity()
	EXECUTE spAddNewAuthors @Authors, @newid
	EXECUTE spLog 'spBookAdd'
END
GO

-- Book Update

CREATE PROC spBookUpdate
@BookName nvarchar(50),
@Published date,
@PublisherId int,
@Authors nvarchar(MAX),
@BookId int
AS
BEGIN TRAN

    UPDATE Book SET BookName=@BookName, Published=@Published, PublisherId=@PublisherId WHERE BookId=@BookId

	If @@ERROR <> 0 GoTo ErrorHandler

	IF LEN(@Authors)>0
	BEGIN
		EXECUTE spUpdateBookAuthors @Authors, @BookId
		EXECUTE spLog 'spBookUpdate'
	END

	If @@ERROR <> 0 GoTo ErrorHandler

	ErrorHandler:
	ROLLBACK TRAN
    Return(@@ERROR)
COMMIT TRAN
GO

CREATE PROC spUpdateBookAuthors
@Authors nvarchar(MAX),
@BookId int
AS
BEGIN TRAN
	EXECUTE spDeleteAuthors @Authors, @BookId
	If @@ERROR <> 0
		return
	EXECUTE spAddAuthors @Authors, @BookId
	If @@ERROR <> 0
		return
	EXECUTE spLog 'spUpdateBookAuthors'
COMMIT TRAN
GO

CREATE PROC spDeleteAuthors
@Authors nvarchar(MAX),
@BookId int
AS
BEGIN
		DELETE FROM BookAuthor
		WHERE AuthorId NOT IN
		(
			SELECT AuthorId FROM dbo.fnSplitString(@Authors,',')
		) AND BookId = @BookId
END
GO

CREATE PROC spAddAuthors
@Authors nvarchar(MAX),
@BookId int
AS
BEGIN
	INSERT INTO BookAuthor (BookId,AuthorId)
	SELECT Id=@BookId, AuthorId FROM dbo.fnSplitString(@Authors,',')
	WHERE AuthorId NOT IN(SELECT AuthorId FROM dbo.fc_BookAuthors(@BookId))
END
GO

-- Author

CREATE PROC spAuthor
@AuthorId int
AS
BEGIN
	SELECT *
	FROM Author
	WHERE AuthorId=@AuthorId
END
GO

CREATE PROC spAuthors
AS
BEGIN
	SELECT AuthorId, AuthorFName + ' ' + AuthorLName as Authors FROM Author
END
GO

CREATE PROC spExceptAuthors
@Authors nvarchar(MAX)
AS
BEGIN
	SELECT AuthorId, AuthorFName + ' ' + AuthorLName as Authors FROM Author WHERE AuthorId NOT IN
	(
		SELECT AuthorId FROM dbo.fnSplitString(@Authors,',')
	)
END
GO

CREATE PROC spAddNewAuthors
@Authors nvarchar(MAX),
@BookId int
AS
BEGIN
	INSERT INTO BookAuthor (BookId,AuthorId)
	SELECT Id=@BookId, AuthorId FROM dbo.fnSplitString(@Authors,',')
END
GO

CREATE PROC spAuthorUpdate
@AuthorFName nvarchar(50),
@AuthorLName nvarchar(50),
@DOB datetime,
@AuthorId int
AS
BEGIN
	UPDATE Author SET AuthorFName=@AuthorFName, AuthorLName=@AuthorLName, [Date of Birth]=@DOB WHERE AuthorId=@AuthorId
	EXECUTE spLog 'spAuthorUpdate'
END
GO

--Dynamic procs

CREATE PROC spAuthorInsert
@VALUES nvarchar(100)
AS
BEGIN
	if @VALUES is not null
	BEGIN
		DECLARE @TableName nvarchar(50), @query nvarchar(MAX)
		SET @TableName = 'Author'
		SET @query = 'INSERT INTO ' + @TableName + ' VALUES(' + @VALUES + ')'
		EXECUTE(@query)
	END
END
GO

CREATE PROCEDURE spAuthorAdd
@AuthorFName nvarchar(50),
@AuthorLName nvarchar(50),
@DOB datetime
AS
BEGIN
	DECLARE @TableName nvarchar(50), @Params nvarchar(MAX), @query nvarchar(MAX)
	SET @TableName = 'Author'
	SET @query = 'INSERT INTO ' + @TableName + '(AuthorFName, AuthorLName, [Date of Birth]) values('

	IF LEN(@AuthorFName) > 0
		SET @query = @query + '@AuthorFName'
	ELSE
		RETURN

	IF LEN(@AuthorLName) > 0
		SET @query = @query + ',@AuthorLName'
	ELSE
		RETURN

	IF @DOB is not null
		SET @query = @query + ',@DOB'
	ELSE
		RETURN

	SET @query = @query + ')'
	SET @Params = '	@AuthorFName nvarchar(50),
					@AuthorLName nvarchar(50),
					@DOB datetime'

	EXECUTE sp_executesql @query, @Params, @AuthorFName, @AuthorLName, @DOB

	EXECUTE spLog 'spAuthorAdd'

	If @@ERROR <> 0 GoTo ErrorHandler
    Set NoCount OFF
    Return(0)

	ErrorHandler:
    Return(@@ERROR)

END
GO

--Log

CREATE PROC spLog
@sp nvarchar(100)
AS
BEGIN
	INSERT INTO LogTable values(@sp, SUSER_NAME(), @@ROWCOUNT, GETDATE())
END
GO


text:
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var workspaceSchema = new Schema({
	name: String,
	updated: { type: Date, default: Date.now },
	workspaceTrackAudios: {type:Array, default: []}
});

module.exports = mongoose.model('workspace', workspaceSchema);


text:
<?php

namespace Poznet\ConfigBundle\Repository;

/**
 * ConfigRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ConfigRepository extends \Doctrine\ORM\EntityRepository
{
}


text:
<?php namespace GovTribe\LaravelKinvey;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Session;
use Illuminate\Auth\AuthServiceProvider;
use GovTribe\LaravelKinvey\Auth\AuthManager;
use GovTribe\LaravelKinvey\Database\Eloquent\User;

class LaravelKinveyAuthServiceProvider extends AuthServiceProvider {

	/**
	 * Bootstrap the application events.
	 *
	 * @return void
	 */
	public function boot()
	{
		$app = $this->app;

		$this->app->bind('auth', function($app)
		{
			return new AuthManager($app);
		});

		$this->registerEvents();

		parent::boot();
	}

	/**
	 * Register events for this service provider.
	 *
	 * @return void
	 */
	public function registerEvents()
	{
		//Store the Kinvey auth token in the user's session, and clear it on logout.
		Event::listen('auth.login', function($user)
		{
			Session::put('kinvey', $user->_kmd['authtoken']);
		});

		Event::listen('auth.logout', function($user)
		{
			Session::forget('kinvey');
		});
	}

}


text:
package edu.virginia.iath.oxygenplugins.juel.helpers;

public class ComboBoxObject {
	public String name;
	public String id;
	public ComboBoxObject(String name, String id) {
		this.name = name; this.id = id;
	}
	public String toString() {
		return this.name;
	}
	public String debugInfo() {
		return this.name + "::" + this.id;
	}
}


text:
package org.elasticsearch.index.search.geo;

import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.FieldComparator;
import org.apache.lucene.search.SortField;
import org.elasticsearch.ElasticSearchIllegalArgumentException;
import org.elasticsearch.common.unit.DistanceUnit;
import org.elasticsearch.index.cache.field.data.FieldDataCache;
import org.elasticsearch.index.field.data.FieldDataType;
import org.elasticsearch.index.mapper.FieldMapper;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.mapper.geo.GeoPointFieldData;
import org.elasticsearch.index.mapper.geo.GeoPointFieldDataType;

import java.io.IOException;

/**
 *
 */
// LUCENE MONITOR: Monitor against FieldComparator.Double
public class GeoDistanceDataComparator extends FieldComparator<Double> {

    public static FieldDataType.ExtendedFieldComparatorSource comparatorSource(String fieldName, double lat, double lon, DistanceUnit unit, GeoDistance geoDistance,
                                                                               FieldDataCache fieldDataCache, MapperService mapperService) {
        return new InnerSource(fieldName, lat, lon, unit, geoDistance, fieldDataCache, mapperService);
    }

    static class InnerSource extends FieldDataType.ExtendedFieldComparatorSource {

        protected final String fieldName;

        protected final double lat;

        protected final double lon;

        protected final DistanceUnit unit;

        protected final GeoDistance geoDistance;

        protected final FieldDataCache fieldDataCache;

        private final MapperService mapperService;

        private InnerSource(String fieldName, double lat, double lon, DistanceUnit unit, GeoDistance geoDistance,
                            FieldDataCache fieldDataCache, MapperService mapperService) {
            this.fieldName = fieldName;
            this.lat = lat;
            this.lon = lon;
            this.unit = unit;
            this.geoDistance = geoDistance;
            this.fieldDataCache = fieldDataCache;
            this.mapperService = mapperService;
        }

        @Override
        public FieldComparator newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException {
            return new GeoDistanceDataComparator(numHits, fieldname, lat, lon, unit, geoDistance, fieldDataCache, mapperService);
        }

        @Override
        public SortField.Type reducedType() {
            return SortField.Type.DOUBLE;
        }
    }

    protected final String fieldName;

    protected final String indexFieldName;

    protected final double lat;

    protected final double lon;

    protected final DistanceUnit unit;

    protected final GeoDistance geoDistance;
    protected final GeoDistance.FixedSourceDistance fixedSourceDistance;

    protected final FieldDataCache fieldDataCache;

    protected GeoPointFieldData fieldData;

    private final double[] values;
    private double bottom;

    public GeoDistanceDataComparator(int numHits, String fieldName, double lat, double lon, DistanceUnit unit, GeoDistance geoDistance,
                                     FieldDataCache fieldDataCache, MapperService mapperService) {
        values = new double[numHits];

        this.fieldName = fieldName;
        this.lat = lat;
        this.lon = lon;
        this.unit = unit;
        this.geoDistance = geoDistance;
        this.fieldDataCache = fieldDataCache;

        this.fixedSourceDistance = geoDistance.fixedSourceDistance(lat, lon, unit);

        FieldMapper mapper = mapperService.smartNameFieldMapper(fieldName);
        if (mapper == null) {
            throw new ElasticSearchIllegalArgumentException("No mapping found for field [" + fieldName + "] for geo distance sort");
        }
        if (mapper.fieldDataType() != GeoPointFieldDataType.TYPE) {
            throw new ElasticSearchIllegalArgumentException("field [" + fieldName + "] is not a geo_point field");
        }
        this.indexFieldName = mapper.names().indexName();
    }

    @Override
    public GeoDistanceDataComparator setNextReader(AtomicReaderContext context) throws IOException {
        fieldData = (GeoPointFieldData) fieldDataCache.cache(GeoPointFieldDataType.TYPE, context.reader(), indexFieldName);
        return this;
    }

    @Override
    public int compare(int slot1, int slot2) {
        final double v1 = values[slot1];
        final double v2 = values[slot2];
        if (v1 > v2) {
            return 1;
        } else if (v1 < v2) {
            return -1;
        } else {
            return 0;
        }
    }

    @Override
    public int compareBottom(int doc) {
        double distance;
        if (!fieldData.hasValue(doc)) {
            // is this true? push this to the "end"
            distance = Double.MAX_VALUE;
        } else {
            distance = fixedSourceDistance.calculate(fieldData.latValue(doc), fieldData.lonValue(doc));
        }
        final double v2 = distance;
        if (bottom > v2) {
            return 1;
        } else if (bottom < v2) {
            return -1;
        } else {
            return 0;
        }
    }

    @Override
    public int compareDocToValue(int doc, Double distance2) throws IOException {
        double distance1;
        if (!fieldData.hasValue(doc)) {
            // is this true? push this to the "end"
            distance1 = Double.MAX_VALUE;
        } else {
            distance1 = fixedSourceDistance.calculate(fieldData.latValue(doc), fieldData.lonValue(doc));
        }
        return (int) (distance1 - distance2);
    }

    @Override
    public void copy(int slot, int doc) {
        double distance;
        if (!fieldData.hasValue(doc)) {
            // is this true? push this to the "end"
            distance = Double.MAX_VALUE;
        } else {
            distance = fixedSourceDistance.calculate(fieldData.latValue(doc), fieldData.lonValue(doc));
        }
        values[slot] = distance;
    }

    @Override
    public void setBottom(final int bottom) {
        this.bottom = values[bottom];
    }

    @Override
    public Double value(int slot) {
        return values[slot];
    }
}


text:
module.exports = {
	useCompression: true,
	builderCache: true,
	minify : true,
};


text:
A database that keeps track of all your brews, recipes, costs, and includes some other handy tools for the home wine brewer.

##Latest Version
v1.3.2 - [https://github.com/pbellchambers/winebrewdb/releases/](https://github.com/pbellchambers/winebrewdb/releases/)

Changelog - [https://github.com/pbellchambers/winebrewdb/blob/master/CHANGELOG.md](https://github.com/pbellchambers/winebrewdb/blob/master/CHANGELOG.md)

##System Requirements
[Java 8 update 40+](http://java.com/download)

##Screenshots
![Screenshot 1](http://i.imgur.com/AKLYz.png) ![Screenshot 2](http://i.imgur.com/NexZl.png)

![Screenshot 3](http://i.imgur.com/NbP8C.png) ![Screenshot 4](http://i.imgur.com/F17wp.png)

![Screenshot 5](http://i.imgur.com/auRnf.png) ![Screenshot 6](http://i.imgur.com/jylHd.png)

##Instructions for Running

Unzip and run the jar or exe file to launch the application.

You require Java 8 update 40 (or newer) to run this. (http://java.com/download)

##Instructions for Building

The project is built using gradle (tested with v2.3):

```
gradle build
```

##License
Licensed under the Apache v2.0 License

Copyright (c) 2012-2015 Paul Bellchambers

https://github.com/pbellchambers/winebrewdb/


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
    android:startColor="@android:color/transparent"
    android:endColor="#26333333"
    android:angle="90"/>
</shape>


text:
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Title>
		<v8:item>
			<v8:lang>ru</v8:lang>
			<v8:content>Взаимосвязи</v8:content>
		</v8:item>
	</Title>
	<AutoTitle>false</AutoTitle>
	<VerticalScroll>useIfNecessary</VerticalScroll>
	<AutoCommandBar name="ФормаКоманднаяПанель" id="-1">
		<Autofill>false</Autofill>
		<ChildItems>
			<ButtonGroup name="ГруппаКоманднаяПанель" id="18">
				<Title>
					<v8:item>
						<v8:lang>ru</v8:lang>
						<v8:content>Группа командная панель</v8:content>
					</v8:item>
				</Title>
				<ToolTip>
					<v8:item>
						<v8:lang>ru</v8:lang>
						<v8:content>Группа командная панель</v8:content>
					</v8:item>
				</ToolTip>
				<CommandSource>Item.Список</CommandSource>
				<ExtendedTooltip name="ГруппаКоманднаяПанельExtendedTooltip" id="19"/>
			</ButtonGroup>
		</ChildItems>
	</AutoCommandBar>
	<Events>
		<Event name="OnCreateAtServer">ПриСозданииНаСервере</Event>
	</Events>
	<ChildItems>
		<Table name="Список" id="1">
			<UseAlternationRowColor>true</UseAlternationRowColor>
			<EnableStartDrag>true</EnableStartDrag>
			<DataPath>Список</DataPath>
			<SearchStringLocation>None</SearchStringLocation>
			<ViewStatusLocation>None</ViewStatusLocation>
			<SearchControlLocation>None</SearchControlLocation>
			<AutoRefresh>false</AutoRefresh>
			<AutoRefreshPeriod>60</AutoRefreshPeriod>
			<Period xsi:type="v8:StandardPeriod">
				<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
				<v8:startDate>0001-01-01T00:00:00</v8:startDate>
				<v8:endDate>0001-01-01T00:00:00</v8:endDate>
			</Period>
			<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
			<RestoreCurrentRow>false</RestoreCurrentRow>
			<TopLevelParent xsi:nil="true"/>
			<ShowRoot>true</ShowRoot>
			<AllowRootChoice>false</AllowRootChoice>
			<UpdateOnDataChange>Auto</UpdateOnDataChange>
			<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
			<AutoCommandBar name="СписокКоманднаяПанель" id="3">
				<Autofill>false</Autofill>
			</AutoCommandBar>
			<ExtendedTooltip name="СписокExtendedTooltip" id="20"/>
			<SearchStringAddition name="СписокSearchString" id="21">
				<Source>
					<lf:elementId>1</lf:elementId>
					<lf:additionId>0</lf:additionId>
				</Source>
				<ContextMenu name="СписокSearchStringContextMenu" id="22"/>
				<ExtendedTooltip name="СписокSearchStringExtendedTooltip" id="23"/>
			</SearchStringAddition>
			<ViewStatusAddition name="СписокViewStatus" id="24">
				<Source>
					<lf:elementId>1</lf:elementId>
					<lf:additionId>1</lf:additionId>
				</Source>
				<ContextMenu name="СписокViewStatusContextMenu" id="25"/>
				<ExtendedTooltip name="СписокViewStatusExtendedTooltip" id="26"/>
			</ViewStatusAddition>
			<SearchControlAddition name="СписокSearchControl" id="27">
				<Source>
					<lf:elementId>1</lf:elementId>
					<lf:additionId>2</lf:additionId>
				</Source>
				<ContextMenu name="СписокSearchControlContextMenu" id="28"/>
				<ExtendedTooltip name="СписокSearchControlExtendedTooltip" id="29"/>
			</SearchControlAddition>
			<Events>
				<Event name="BeforeAddRow">СписокПередНачаломДобавления</Event>
			</Events>
			<ChildItems>
				<LabelField name="СписокПартнер" id="10">
					<DataPath>Список.Партнер</DataPath>
					<ContextMenu name="СписокПартнерКонтекстноеМеню" id="11"/>
					<ExtendedTooltip name="СписокПартнерExtendedTooltip" id="30"/>
				</LabelField>
				<LabelField name="СписокПредставлениеВидаСвязи" id="6">
					<DataPath>Список.ПредставлениеВидаСвязи</DataPath>
					<Title>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Вид связи</v8:content>
						</v8:item>
					</Title>
					<ContextMenu name="СписокПредставлениеВидаСвязиКонтекстноеМеню" id="7"/>
					<ExtendedTooltip name="СписокПредставлениеВидаСвязиExtendedTooltip" id="31"/>
				</LabelField>
				<LabelField name="СписокАвтор" id="4">
					<DataPath>Список.Автор</DataPath>
					<ContextMenu name="СписокАвторКонтекстноеМеню" id="5"/>
					<ExtendedTooltip name="СписокАвторExtendedTooltip" id="32"/>
				</LabelField>
				<LabelField name="СписокКомментарий" id="8">
					<DataPath>Список.Комментарий</DataPath>
					<ContextMenu name="СписокКомментарийКонтекстноеМеню" id="9"/>
					<ExtendedTooltip name="СписокКомментарийExtendedTooltip" id="33"/>
				</LabelField>
				<LabelField name="СписокПервыйПартнер" id="12">
					<DataPath>Список.ПервыйПартнер</DataPath>
					<UserVisible>
						<xr:Common>false</xr:Common>
					</UserVisible>
					<ContextMenu name="СписокПервыйПартнерКонтекстноеМеню" id="13"/>
					<ExtendedTooltip name="СписокПервыйПартнерExtendedTooltip" id="34"/>
				</LabelField>
				<LabelField name="СписокВторойПартнер" id="14">
					<DataPath>Список.ВторойПартнер</DataPath>
					<UserVisible>
						<xr:Common>false</xr:Common>
					</UserVisible>
					<ContextMenu name="СписокВторойПартнерКонтекстноеМеню" id="15"/>
					<ExtendedTooltip name="СписокВторойПартнерExtendedTooltip" id="35"/>
				</LabelField>
				<LabelField name="СписокВидСвязи" id="16">
					<DataPath>Список.ВидСвязи</DataPath>
					<UserVisible>
						<xr:Common>false</xr:Common>
					</UserVisible>
					<ContextMenu name="СписокВидСвязиКонтекстноеМеню" id="17"/>
					<ExtendedTooltip name="СписокВидСвязиExtendedTooltip" id="36"/>
				</LabelField>
			</ChildItems>
		</Table>
	</ChildItems>
	<Attributes>
		<Attribute name="Список" id="1">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Список</v8:content>
				</v8:item>
			</Title>
			<Type>
				<v8:Type>cfg:DynamicList</v8:Type>
			</Type>
			<Settings xsi:type="DynamicList">
				<ManualQuery>true</ManualQuery>
				<DynamicDataRead>true</DynamicDataRead>
				<QueryText>ВЫБРАТЬ
	ВЫБОР
		КОГДА СвязиМеждуПартнерами.ПервыйПартнер = &Партнер
			ТОГДА СвязиМеждуПартнерами.ВторойПартнер
		ИНАЧЕ СвязиМеждуПартнерами.ПервыйПартнер
	КОНЕЦ КАК Партнер,
	ВЫБОР
		КОГДА СвязиМеждуПартнерами.ПервыйПартнер = &Партнер
			ТОГДА ВидыСвязейМеждуПартнерами.Наименование
		ИНАЧЕ ВидыСвязейМеждуПартнерами.ОбратноеНаименование
	КОНЕЦ КАК ПредставлениеВидаСвязи,
	СвязиМеждуПартнерами.Автор,
	СвязиМеждуПартнерами.Комментарий,
	СвязиМеждуПартнерами.ПервыйПартнер,
	СвязиМеждуПартнерами.ВторойПартнер,
	СвязиМеждуПартнерами.ВидСвязи КАК ВидСвязи
ИЗ
	РегистрСведений.СвязиМеждуПартнерами КАК СвязиМеждуПартнерами
		ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ВидыСвязейМеждуПартнерами КАК ВидыСвязейМеждуПартнерами
		ПО СвязиМеждуПартнерами.ВидСвязи = ВидыСвязейМеждуПартнерами.Ссылка
ГДЕ
	(СвязиМеждуПартнерами.ПервыйПартнер = &Партнер
			ИЛИ СвязиМеждуПартнерами.ВторойПартнер = &Партнер)</QueryText>
				<MainTable>InformationRegister.СвязиМеждуПартнерами</MainTable>
				<ListSettings>
					<dcsset:filter>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>dfcece9d-5077-440b-b6b3-45a5cb4538eb</dcsset:userSettingID>
					</dcsset:filter>
					<dcsset:order>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>88619765-ccb3-46c6-ac52-38e9c992ebd4</dcsset:userSettingID>
					</dcsset:order>
					<dcsset:conditionalAppearance>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>b75fecce-942b-4aed-abc9-e6a02e460fb3</dcsset:userSettingID>
					</dcsset:conditionalAppearance>
				</ListSettings>
			</Settings>
		</Attribute>
		<Attribute name="Партнер" id="2">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Партнер</v8:content>
				</v8:item>
			</Title>
			<Type>
				<v8:Type>cfg:CatalogRef.Партнеры</v8:Type>
			</Type>
		</Attribute>
	</Attributes>
</Form>


text:
package org.arakhne.afc.agentmotion.common;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import org.arakhne.afc.math.AbstractMathTestCase;
import org.arakhne.afc.math.geometry.d2.d.Point2d;

@SuppressWarnings("all")
public class FleeingAlgorithmTest extends AbstractMathTestCase {

	private FleeingAlgorithm flee;

	@Before
	public void setUp() {
		this.flee = new FleeingAlgorithm();
	}

	@After
	public void tearDown() {
		this.flee = null;
	}

	@Test
	public void calculate() {
		assertFpVectorEquals(-3.42997, -2.05798, this.flee.calculate(new Point2d(1, 2),  3, 4, new Point2d(6, 5)));
	}

}


text:
namespace content {
class BrowserContext;
}

namespace performance_manager {

// This class serves as an interface between a SiteDataCache living on the PM
// sequence and the UI thread. This is meant to be used by a
// BrowserContextKeyedServiceFactory to manage the lifetime of this cache.
//
// Instances of this class are expected to live on the UI thread.
class SiteDataCacheFacade : public KeyedService,
                            public history::HistoryServiceObserver {
 public:
  explicit SiteDataCacheFacade(content::BrowserContext* browser_context);
  ~SiteDataCacheFacade() override;

  void IsDataCacheRecordingForTesting(base::OnceCallback<void(bool)> cb);

  void WaitUntilCacheInitializedForTesting();

  // history::HistoryServiceObserver:
  void OnURLsDeleted(history::HistoryService* history_service,
                     const history::DeletionInfo& deletion_info) override;
  void HistoryServiceBeingDeleted(
      history::HistoryService* history_service) override;

 private:
  // The browser context associated with this cache.
  content::BrowserContext* browser_context_;

  ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
      history_observer_{this};

  DISALLOW_COPY_AND_ASSIGN(SiteDataCacheFacade);
};

}  // namespace performance_manager

#endif  // CHROME_BROWSER_PERFORMANCE_MANAGER_PERSISTENCE_SITE_DATA_SITE_DATA_CACHE_FACADE_H_


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\c\AEfectivosBancos;

/**
 * AEfectivosBancosSearch represents the model behind the search form about `common\models\c\AEfectivosBancos`.
 */
class AEfectivosBancosSearch extends AEfectivosBancos
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'banco_contratista_id', 'tipo_moneda_id', 'creado_por', 'contratista_id', 'total_id'], 'integer'],
            [['saldo_segun_b', 'nd_no_cont', 'depo_transito', 'nc_no_cont', 'cheques_transito', 'saldo_al_cierre', 'intereses_act_eco', 'monto_moneda_extra', 'tipo_cambio_cierre'], 'number'],
            [['sys_status'], 'boolean'],
            [['sys_creado_el', 'sys_actualizado_el', 'sys_finalizado_el', 'anho'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = AEfectivosBancos::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'banco_contratista_id' => $this->banco_contratista_id,
            'saldo_segun_b' => $this->saldo_segun_b,
            'nd_no_cont' => $this->nd_no_cont,
            'depo_transito' => $this->depo_transito,
            'nc_no_cont' => $this->nc_no_cont,
            'cheques_transito' => $this->cheques_transito,
            'saldo_al_cierre' => $this->saldo_al_cierre,
            'intereses_act_eco' => $this->intereses_act_eco,
            'tipo_moneda_id' => $this->tipo_moneda_id,
            'monto_moneda_extra' => $this->monto_moneda_extra,
            'tipo_cambio_cierre' => $this->tipo_cambio_cierre,
            'creado_por' => $this->creado_por,
            'sys_status' => $this->sys_status,
            'sys_creado_el' => $this->sys_creado_el,
            'sys_actualizado_el' => $this->sys_actualizado_el,
            'sys_finalizado_el' => $this->sys_finalizado_el,
            'contratista_id' => Yii::$app->user->identity->contratista_id,
            'total_id' => $this->total_id,
        ]);

        $query->andFilterWhere(['like', 'anho', $this->anho]);

        return $dataProvider;
    }
}


text:
. "${srcdir=.}/init.sh"; path_prepend_ ../parted

require_root_
require_scsi_debug_module_

grep '^#define USE_BLKID 1' "$CONFIG_HEADER" > /dev/null ||
  skip_ 'this system lacks a new-enough libblkid'

echo 'Sector size (logical/physical): 4096B/4096B' > exp || framework_failure

# create memory-backed device
scsi_debug_setup_ dev_size_mb=8 sector_size=4096 > dev-name ||
  skip_ 'failed to create scsi_debug device'
scsi_dev=$(cat dev-name)

# create partition table and print
parted -s $scsi_dev mklabel gpt print > out 2>&1 || fail=1
grep '^Sector' out > k 2>&1 || fail=1
mv k out || fail=1

compare out exp || fail=1

Exit $fail


text:
var fs = require('fs'),
    path = require('path'),
    logger = require('log4js').getLogger("config");

var base_dir = path.resolve(__dirname, "..");
var modules_dir = path.join(base_dir, "node_modules");
var scrap_dir = path.join(base_dir, ".scrapbooks");

exports.title = 'i.js';
exports.base_dir = base_dir;
exports.modules_dir = modules_dir;
exports.scrap_dir = scrap_dir;

exports.setup = function () {
    logger.info("setup()");
    if (fs.existsSync(scrap_dir)) {
        if (!fs.statSync(scrap_dir).isDirectory()) {
            throw new Error(scrap_dir + " should be a directory");
        }
    } else {
        fs.mkdirSync(scrap_dir);
    }
}


text:
package com.google.moviestvsentiments.webscrape;

import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.google.api.client.http.*;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.util.Key;
import com.google.moviestvsentiments.assetSentiment.Asset;
import com.google.moviestvsentiments.assetSentiment.AssetType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import java.io.IOException;
import java.time.Clock;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * Provides functions to support scraping Assets from OMDB.
 */
@Configuration
public class AssetScraper {

    /**
     * Represents a response from the OMDB API.
     */
    public static class OmdbResponse {

        public static class Rating {
            @Key("Source") public String source;
            @Key("Value") public String value;
        }

        @Key("imdbID") public String assetId;
        @Key("Type") public String assetType;
        @Key("Title") public String title;
        @Key("Poster") public String poster;
        @Key public String imdbRating;
        @Key("Ratings") List<Rating> ratings;
        @Key("Plot") public String plot;
        @Key("Runtime") public String runtime;
        @Key("Year") public String year;
    }

    /**
     * Represents a response from the Google custom search for banner images.
     */
    public static class ImageSearchResponse {
        public static class Item {
            @Key public String link;
        }
        @Key public List<Item> items;
    }

    private static final String IMDB_ASSET_XPATH = "//td[@class='titleColumn']/a";
    private static final String IMDB_ASSET_URL_PREFIX = "/title/";
    private static final String OMDB_MOVIE_TYPE = "movie";
    private static final String OMDB_SHOW_TYPE = "series";
    private static final String OMDB_ROTTEN_TOMATOES_SOURCE = "Rotten Tomatoes";
    private static final String BANNER_SEARCH_FORMAT = "https://www.googleapis.com/customsearch/v1?num=1&" +
            "imgSize=large&searchType=image&cx=014855773548463262652:6dh_g-lgcra&key=%s&q=%s+banner+image";

    private final Clock clock;
    private final HttpRequestFactory requestFactory;
    private final Logger logger;

    // Public default constructor is required for Spring to autowire AssetScraper in AssetScrapeController.
    public AssetScraper() {
        clock = Clock.systemUTC();
        requestFactory = defaultRequestFactory();
        logger = LoggerFactory.getLogger(AssetScraper.class);
    }

    /**
     * Returns the default HttpRequestFactory that uses NetHttpTransport to send HTTP requests and Jackson to parse
     * JSON responses.
     */
    private static HttpRequestFactory defaultRequestFactory() {
        HttpTransport httpTransport = new NetHttpTransport();
        JsonFactory jsonFactory = new JacksonFactory();
        return httpTransport.createRequestFactory(new HttpRequestInitializer() {
            @Override
            public void initialize(HttpRequest request) {
                request.setParser(new JsonObjectParser(jsonFactory));
            }
        });
    }

    /**
     * Returns a list of IMDB asset ids scraped from the provided url.
     * @param url The url of the IMDB page to scrape asset ids from.
     * @return A list of IDMB asset ids.
     * @throws IOException If fetching the page at the given url fails.
     */
    public List<String> scrapeIds(String url) throws IOException {
        WebClient client = new WebClient();
        client.getOptions().setCssEnabled(false);
        client.getOptions().setJavaScriptEnabled(false);
        HtmlPage page = client.getPage(url);
        List<HtmlAnchor> assetLinks = page.getByXPath(IMDB_ASSET_XPATH);

        List<String> assetIds = new ArrayList<>();
        for (HtmlAnchor assetLink : assetLinks) {
            String assetUrl = assetLink.getHrefAttribute();
            int startPosition = IMDB_ASSET_URL_PREFIX.length();
            int endPosition = assetUrl.lastIndexOf("/");
            assetIds.add(assetUrl.substring(startPosition, endPosition));
        }
        return assetIds;
    }

    /**
     * Returns a list of Assets scraped from OMDB. The given OMDB api key and the list of Asset ids is used to query
     * OMDB for the Assets.
     * @param assetIds The list of Asset ids to query OMDB for.
     * @param omdbApiKey The api key to use when querying OMDB.
     * @return A list of Assets scraped from OMDB.
     * @throws IOException If the OMDB query fails.
     */
    public List<Asset> scrapeAssets(List<String> assetIds, String omdbApiKey) throws IOException {
        List<Asset> assets = new ArrayList<>();
        for (String assetId : assetIds) {
            String url = "http://www.omdbapi.com/?plot=full&apikey=" + omdbApiKey + "&i=" + assetId;
            HttpRequest request = requestFactory.buildGetRequest(new GenericUrl(url));
            OmdbResponse response = request.execute().parseAs(OmdbResponse.class);
            createAsset(response).ifPresent(asset -> assets.add(asset));
        }
        return assets;
    }

    /**
     * Creates a new Asset from the given OmdbResponse. The Asset's timestamp is set to the current time.
     * @param omdbResponse The OmdbResponse to use when creating the Asset.
     * @return A new Asset created using the OmdbResponse.
     */
    private Optional<Asset> createAsset(OmdbResponse omdbResponse) {
        Asset asset = new Asset();
        asset.setAssetId(omdbResponse.assetId);
        asset.setTitle(omdbResponse.title);
        asset.setPoster(omdbResponse.poster);
        asset.setImdbRating(omdbResponse.imdbRating);
        asset.setPlot(omdbResponse.plot);
        asset.setRuntime(omdbResponse.runtime);
        asset.setYear(omdbResponse.year);
        asset.setTimestamp(Instant.now(clock));

        if (OMDB_MOVIE_TYPE.equals(omdbResponse.assetType)) {
            asset.setAssetType(AssetType.MOVIE);
        } else if (OMDB_SHOW_TYPE.equals(omdbResponse.assetType)) {
            asset.setAssetType(AssetType.SHOW);
        } else {
            logger.warn("Unknown OMDB asset type: " + omdbResponse.assetType);
            return Optional.empty();
        }

        omdbResponse.ratings.stream().filter(rating -> OMDB_ROTTEN_TOMATOES_SOURCE.equals(rating.source))
                .findAny().ifPresent(rating -> asset.setRottenTomatoesRating(rating.value));

        return Optional.of(asset);
    }

    /**
     * Returns the banner image URL for the given Asset. Uses the Google Custom Search JSON API to search for the Asset
     * title, along with the phrase "banner image" and returns the URL of the first image result.
     * @param apiKey The Google Cloud API key to use when invoking the Custom Search API.
     * @param asset The Asset to find banner images for.
     * @return The banner image URL for the given Asset.
     * @throws IOException If calling the Custom Search API fails.
     */
    public String scrapeBannerUrl(String apiKey, Asset asset) throws IOException {
        WebClient client = new WebClient();
        client.getOptions().setCssEnabled(false);
        client.getOptions().setJavaScriptEnabled(false);

        String searchUrl = String.format(BANNER_SEARCH_FORMAT, apiKey, asset.getTitle());
        HttpRequest request = requestFactory.buildGetRequest(new GenericUrl(searchUrl));
        ImageSearchResponse responseList = request.execute().parseAs(ImageSearchResponse.class);

        return responseList.items.get(0).link;
    }
}


text:
{% extends "admin/change_list.html" %}
{% load i18n %}

{% block object-tools-items %}
  {{ block.super }}

      {% trans "Upload a zip archive" %}

{% endblock %}


text:
<div xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1" t:render="survey">
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLScqjG_981_RahpjS9Sr2HzB1Y6K_EUiks0_QhP4kPj6AHu6cQ/viewform?embedded=true" width="640" height="3274" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>

</div>


text:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="bc.css">

### Markdown, the Fusion Accelerator, Revisions and Bulk Upgrade

Today, I discuss my new Markdown blog post format, Fusion 360, the Fusion accelerator and a couple of Revit issues:

- [Using the Markdown blog post format](#2)
- [Fusion 360](#3)
- [Fusion 360 for game artists](#4)
- [Fusion 360 accelerator](#5)
- [The Revit Revision API](#6)
- [Running a background bulk upgrade batch](#7)
- [Banksy's Dismaland bemusement park](#8)

#### Using the Markdown Blog Post Format

This is my first post on The Building Coder using
[Markdown](http://daringfireball.net/projects/markdown) instead
of handcrafted HTML.

I tested it yesterday on
[The 3D Web Coder](http://the3dwebcoder.typepad.com),
where I also explain some of the
[motivation behind this change](http://the3dwebcoder.typepad.com/blog/2015/08/hackergarten-chromium-and-markdown.html#4).

Suffice to say, it is saving me some time today.

For instance, here is the markdown source code of this section you are reading:

#### <a name="2"></a>Using the Markdown Blog Post Format

This is my first post on The Building Coder using
[Markdown](http://daringfireball.net/projects/markdown) instead
of handcrafted HTML.

I tested it yesterday on
[The 3D Web Coder](http://the3dwebcoder.typepad.com),
where I also explain some of the
[motivation behind this change](http://the3dwebcoder.typepad.com/blog/2015/08/hackergarten-chromium-and-markdown.html#4).

Suffice to say, it is saving me some time today.

The equivalent HTML looks like this:

<h4><a name="2"></a>Using the Markdown Blog Post Format</h4>
<p>This is my first post on The Building Coder using
<a href="http://daringfireball.net/projects/markdown">Markdown</a> instead
of handcrafted HTML.</p>
<p>I tested it yesterday on
<a href="http://the3dwebcoder.typepad.com">The 3D Web Coder</a>,
where I also explain some of the motivation behind this change.</p>
<p>Suffice to say, it is saving me some time today.</p>

Typepad supports markdown right out of the box:

Unfortunately, I discovered yesterday that
[its excerpt generation machinery does not](http://the3dwebcoder.typepad.com/blog/2015/08/hackergarten-chromium-and-markdown.html#4),
so I now have to add that myself by hand.

#### Fusion 360

As an architect, you may not be aware of
[Fusion 360](http://www.autodesk.com/products/fusion-360),
a cloud-based design, test, fabrication and collaboration tool targeted primarily at the manufacturing side of CAD.

#### Fusion 360 for Game Artists

That is not all, however, as Lester Bank's article on
[Fusion 360 for Game Artists](http://lesterbanks.com/2015/08/fusion-360-for-game-artists) explains:

> Solid modellers are just better at some things. Solid modellers are great for knocking out quick forms, and really make short work of Boolean operations, bevels, chamfers and building complex components.

> The problem with Solid modelling applications is that they are typically CAD/CAM, CAE tools not really meant for artists. One application is kind of changing that, and that is Autodesk's Fusion 360. The application was built from the ground up to be an easy to use solid modeller for conceptual design, engineering, matching and sharing CAD content... using Autodesk's Fusion 360 in a game art pipeline... get started with Fusion 360's interface and tools... put together some game art assets... completely affordable... free for students, enthusiasts, hobbyists, and startups...

Maybe you will discover that it is a powerful and useful tool for architects as well?

#### Fusion 360 Accelerator

If you are interested in taking a closer look at Fusion 360, you might as well hit the ground running and earn some money with it right away, in this once in a decade opportunity:

Build your first Fusion 360 app using JavaScript, Python or C++ by participating in the upcoming
[Fusion 360 Hackathon](http://fusion360hackathon.com).

$500

Build and publish a Fusion 360 app in the
[Autodesk App Store](https://apps.exchange.autodesk.com/FUSION/en/Home/Index) during
the Hackathon, and you earn a $500 reward, too!

For more information, you can also head over to Adam Nagy's take on the
[Fusion 360 hackathon site](http://adndevblog.typepad.com/manufacturing/2015/08/fusion-360-hackathon-site-live.html) and
follow the event tweets at [#Fusion360Hackathon](https://twitter.com/hashtag/fusion360hackathon).

Good luck and have fun!

#### The Revit Revision API

**Question:** I would like to develop a custom operator in Revit with the same
functionality as Revit's Revision cloud but with our custom cloud design
(the cloud design something like Revision cloud of AutoCAD).
Does the Revit API provide the facility to draw these, or free-hand sketching
using the mouse with our custom operator?

**Answer:**
Revit 2015 provides programmatic access to this area, so the
[What's New in the Revit 2015 API](http://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html) documentation
for that version covers just about all there is to know about the
[Revision API](http://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html#3.04).

You may also be interested in the
[GetRevisionData Revit add-in](http://thebuildingcoder.typepad.com/blog/2014/06/the-revision-api-and-a-form-on-the-fly.html).

I just upgraded it to Revit 2016 for you; check it out in the
[GetRevisionData GitHub repository](https://github.com/jeremytammik/GetRevisionData).

#### Running a Background Bulk Upgrade Batch

**Question:** I am working on a Revit plugin to bulk upgrade Revit's old
version files to a new version. I need to run this process in the background
so that other tasks can be performed in Revit during this upgrade process.
Can you please guide me on how to run an upgrade process in the background?

**Answer:**
The topic of driving Revit from outside or other background threads has been discussed extensively in the
[Revit API discussion forum](http://forums.autodesk.com/t5/revit-api/bd-p/160) and on The Building Coder blog,
so all the information that I am aware of on this topic is already sitting there waiting for your perusal.

Please check out the topic group on
[driving Revit from outside](http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28) and
explore that material.

I would recommend starting at the end, since the last two entries in that topic list provide a good overview.

Regarding the bulk upgrade, you will probably also be interested in taking a look at Saikat Bhattacharya's
[File Upgrader add-in](http://thebuildingcoder.typepad.com/blog/2011/06/file-upgrader-plugin-of-the-month.html).

It was originally written for Revit 2012 and updated several times for later Revit versions.

For a while, it was also available from the [Autodesk Exchange AppStore](https://apps.exchange.autodesk.com).

I am including the most recent version that I happen to have at hand here, in
[FileUpgrader_2015-08-27.zip](zip/FileUpgrader_2015-08-27.zip).

#### Banksy's Dismaland Bemusement Park

Let's finish off with something unrelated to the Revit API.

Are you interested in modern art or culture?

Somehow, both always seem to include and almost require a certain provocative tinge.

If you are, you are probably aware of the world's most renowned and valued – both artistically and $-wise – graffiti artist,
[Banksy](https://en.wikipedia.org/wiki/Banksy).

Check out his newest project, the
[Dismaland Bemusement Park](http://www.banksy.co.uk),
a 'family theme park unsuitable for small children'.

Here is a
[Channel4 news item](http://www.channel4.com/news/dismaland-banksy-bemusement-park-shocking-funny-extraordinary) and two-minute
[YouTube video](https://www.youtube.com/watch?v=PTr9SZTtCHo) to give you a first impression:


text:
package storage.s3sdk;

// [START storage_s3_sdk_list_objects]
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.ObjectListing;
import com.amazonaws.services.s3.model.S3ObjectSummary;

public class ListGcsObjects {
  public static void listGcsObjects(
      String googleAccessKeyId, String googleAccessKeySecret, String bucketName) {

    // String googleAccessKeyId = "your-google-access-key-id";
    // String googleAccessKeySecret = "your-google-access-key-secret";
    // String bucketName = "bucket-name";

    // Create a BasicAWSCredentials using Cloud Storage HMAC credentials.
    BasicAWSCredentials googleCreds =
        new BasicAWSCredentials(googleAccessKeyId, googleAccessKeySecret);

    // Create a new client and do the following:
    // 1. Change the endpoint URL to use the Google Cloud Storage XML API endpoint.
    // 2. Use Cloud Storage HMAC Credentials.
    AmazonS3 interopClient =
        AmazonS3ClientBuilder.standard()
            .withEndpointConfiguration(
                new AwsClientBuilder.EndpointConfiguration(
                    "https://storage.googleapis.com", "auto"))
            .withCredentials(new AWSStaticCredentialsProvider(googleCreds))
            .build();

    // Call GCS to list current objects
    ObjectListing objects = interopClient.listObjects(bucketName);

    // Print objects names
    System.out.println("Objects:");
    for (S3ObjectSummary object : objects.getObjectSummaries()) {
      System.out.println(object.getKey());
    }

    // Explicitly clean up client resources.
    interopClient.shutdown();
  }
}
// [END storage_s3_sdk_list_objects]


text:
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("RPH.Utilities.AI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("alexguirre")]
[assembly: AssemblyProduct("RPH.Utilities.AI")]
[assembly: AssemblyCopyright("Copyright ©  2017 alexguirre")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("a81a63c1-a0cc-4385-ba9c-a1531069a75c")]
[assembly: AssemblyVersion("0.0.1.*")]
[assembly: AssemblyFileVersion("0.0.1.0")]


text:
package nl.tudelft.watchdog.eclipse.logic.interval;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Set;

import nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase;
import nl.tudelft.watchdog.core.util.WatchDogLogger;

import org.mapdb.DB;
import org.mapdb.DBMaker;

/**
 * Support for storing and querying intervals. The intervals are saved with a
 * long key, thus the maximum number of intervals that any single WatchDog
 * instance can record before the database breaks is {@link Long#MAX_VALUE}.
 */
public class IntervalPersister {

	private static final String INTERVALS = "intervals";

	private DB database;

	/** In memory representation of the interval store */
	private Set<IntervalBase> set;

	private File databaseFile;

	/**
	 * Create a new interval persister. If file points to an existing database
	 * of intervals, it will be reused.
	 */
	public IntervalPersister(final File file) {
		this.databaseFile = file;
		try {
			initalizeDatabase(file);
		} catch (Error e) {
			// MapDB wraps every exception inside an Error, so this code is
			// unfortunately necessary.
			try {
				recreateDatabase(file);
			} catch (Error innerError) {
				WatchDogLogger.getInstance().logSevere(innerError);
			}
		}
		try {
			// Compact database on every 10th new interval.
			if (!set.isEmpty() && set.size() % 10 == 0) {
				database.compact();
			}
		} catch (Error e) {
			// intentionally left empty.
		}
	}

	private void initalizeDatabase(File file) {
		try {
			database = createDatabase(file);
			set = createSet();
		} catch (RuntimeException e) {
			recreateDatabase(file);
		}
	}

	private Set<IntervalBase> createSet() {
		return database.getTreeSet(INTERVALS);
	}

	private DB createDatabase(final File file) {
		return DBMaker.newFileDB(file).closeOnJvmShutdown().make();
	}

	private void recreateDatabase(final File file) {
		closeDatabase();
		// Happens when an update to the serializables in the database
		// was made, and the new objects cannot be created from the old data
		deleteDatabaseFile();
		initalizeDatabase(file);
	}

	private void deleteDatabaseFile() {
		deleteOrOverwriteFileEmpty(null);
		deleteOrOverwriteFileEmpty(".p");
		deleteOrOverwriteFileEmpty(".t");
	}

	private void deleteOrOverwriteFileEmpty(String extension) {
		File auxiliaryFile = databaseFile;
		if (extension != null) {
			auxiliaryFile = new File(databaseFile + extension);
		}

		if (!auxiliaryFile.delete()) {
			FileOutputStream fileOutputStream = null;
			try {
				fileOutputStream = new FileOutputStream(databaseFile);
				fileOutputStream.write(new byte[] {});
			} catch (IOException exception) {
				WatchDogLogger.getInstance().logSevere(exception);
			} finally {
				try {
					fileOutputStream.close();
				} catch (IOException | NullPointerException exception) {
					// intentionally empty
				}
			}
		}
	}

	/** Reads all intervals and returns them as a List. */
	public Set<IntervalBase> readIntervals() {
		return set;
	}

	/** Saves one interval to persistent storage */
	public void saveInterval(IntervalBase interval) {
		try {
			set.add(interval);
			// persist changes to disk
			database.commit();
		} catch (Error error) {
			try {
				recreateDatabase(databaseFile);
			} catch (Error innerError) {
				WatchDogLogger.getInstance().logSevere(innerError);
			}
		}

	}

	/** Removes the intervals from the database.. */
	public void removeIntervals(List<IntervalBase> intervalsToRemove) {
		for (IntervalBase interval : intervalsToRemove) {
			set.remove(interval);
		}
		database.commit();
	}

	/** @return The highest key in the database. -1, if the database is empty */
	public long getSize() {
		try {
			return set.size();
		} catch (Error | RuntimeException e) {
			return -1;
		}
	}

	/**
	 * Properly close the database. Note: The database should be ACID even when
	 * not properly closed.
	 */
	public void closeDatabase() {
		if (database != null && !database.isClosed()) {
			database.close();
		}
	}

	/** Clears the database on the computer and resets it. */
	public void clearAndResetMap() {
		if (database != null && !database.isClosed()) {
			database.delete(INTERVALS);
			database.commit();
			set = createSet();
		}
	}
}


text:
Groups with Categories

<p data-devise="color5, color, Color, Group with Categories, Category 1, backgroundColor" style="background-color: <?= $page->color5->color('blue') ?>;">
	Showing the color <?= $page->color5->color('pink') ?>

    <?= $page->text5->text('This is some default text') ?>

<?= htmlentities('
<p data-devise="color5, color, Color, Group with Categories, Category 1, backgroundColor" style="background-color: <?= $page->color5->color(\'pink\') ?>;">
	Showing the color <?= $page->color5->color(\'pink\') ?>

    <?= $page->text5->text(\'This is some default text\') ?>

') ?>


text:
license: >
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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.
---

# Konfiguracije blackBerry 10

V `config.xml` datoteko nadzira app's osnovne nastavitve, ki veljajo za vsako uporabo in CordovaWebView stopnje. Ta odsek podrobnosti nastavitve, ki veljajo le za BlackBerry 10 gradi. Glej config.xml datoteke za informacije na globalno konfiguracijo možnosti.

*   `ChildBrowser`( `disable` ali privzeto `enable` ): Onemogoči otrok okna brskalnika. Privzeto, apps splavitev sekundarni obrv okno razpoložiti vire, dostopne prek `window.open()` ali z določitvijo a `_blank` sidro target. Določite `disable` premostitve tega privzetega vedenja.

        <preference name="ChildBrowser" value="disable"/>

*   `PopupBlocker`( `enable` ali privzeto `disable` ): omogoča popup blocker, ki preprečuje klice na `window.open()` . Privzeto, ljudstvo prikazati v oknu brskalnika otrok. Postavljanje ugodnost v `enable` preprečuje prikaz sploh.

        <preference name="PopupBlocker" value="enable"/>

*   `WebSecurity`( `disable` ali privzeto `enable` ): nastavite na `disable` preglasiti spletnih varnostnih nastavitev, ki omogoča dostop do oddaljenih vsebine iz neznanega vira. Ta nastavitev je namenjena kot razvoj udobje samo, torej premestitev to spredaj pakiranje vaš app za distribucijo. Za izpust app, vse URIs mora biti znana in whitelisted uporabo je `<access>` element, opisana v priročniku Whitelist domene.

        <preference name="WebSecurity" value="disable"/>


text:
package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
	"os"
	"os/signal"
	"path/filepath"
	"syscall"
	"time"

	"github.com/BurntSushi/toml"
	"github.com/djavorszky/ddn/common/inet"
	"github.com/djavorszky/ddn/common/logger"
	"github.com/djavorszky/ddn/common/model"
)

const version = "3"

var (
	conf       Config
	db         Database
	port       string
	hostname   string
	startup    time.Time
	registered bool
	workdir    string
	agent      model.Agent
)

func main() {
	defer func() {
		if p := recover(); p != nil {
			logger.Error("Panic... Unregistering")
			unregisterAgent()
		}
	}()

	c := make(chan os.Signal, 2)
	signal.Notify(c, os.Interrupt, syscall.SIGTERM)
	go func() {
		<-c
		unregisterAgent()
		os.Exit(1)
	}()

	logger.Level = logger.INFO

	var err error
	filename := flag.String("p", "ddnc.conf", "Specify the configuration file's name")
	logname := flag.String("l", "std", "Specify the log's filename. If set to std, logs to the terminal.")

	flag.Parse()

	loadProperties(*filename)

	if _, err := os.Stat(conf.Exec); os.IsNotExist(err) {
		logger.Fatal("database executable doesn't exist: %v", conf.Exec)
	}

	if *logname != "std" {
		if _, err := os.Stat(*logname); err == nil {
			rotated := fmt.Sprintf("%s.%s", *logname, time.Now().Format("2006-01-02_03:04"))
			logger.Debug("Rotating logfile to %s", rotated)

			os.Rename(*logname, rotated)
		}

		logOut, err := os.OpenFile(*logname, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
		if err != nil {
			fmt.Printf("error opening file %s, will continue logging to stderr: %s", *logname, err.Error())
			logOut = os.Stderr
		}
		defer logOut.Close()

		log.SetOutput(logOut)
	}

	hostname, err = os.Hostname()
	if err != nil {
		logger.Fatal("couldn't get hostname: ", err.Error())
	}

	logger.Debug("Hostname: %s", hostname)

	db, err = GetDB(conf.Vendor)
	if err != nil {
		logger.Fatal("couldn't get database instance:", err)
	}

	logger.Info("Starting with properties:")
	conf.Print()

	err = db.Connect(conf)
	if err != nil {
		logger.Fatal("couldn't establish database connection:", err.Error())
	}
	defer db.Close()
	logger.Info("Database connection established")

	ver, err := db.Version()
	if err != nil {
		logger.Fatal("database: %v", err)
	}

	if ver != conf.Version {
		logger.Warn("Database version mismatch: Config: %q, Actual: %q", conf.Version, ver)

		conf.Version = ver
	}

	workdir, err = os.Getwd()
	if err != nil {
		logger.Fatal("could not determine current directory")
	}

	// Check and create the 'dumps' folder
	dumps := filepath.Join(workdir, "dumps")
	if _, err = os.Stat(dumps); os.IsNotExist(err) {
		err = os.Mkdir(dumps, os.ModePerm)
		if err != nil {
			logger.Fatal("Couldn't create dumps folder, please create it manually: %v", err)
		}

		logger.Info("Created 'dumps' folder")
	}

	// Check and create the 'exports' folder
	exports := filepath.Join(workdir, "exports")
	if _, err = os.Stat(exports); os.IsNotExist(err) {
		err = os.Mkdir(exports, os.ModePerm)
		if err != nil {
			logger.Fatal("Couldn't create 'exports' folder, please create it manually: %v", err)
		}

		logger.Info("Created 'exports' folder")
	}

	// For Oracle, create or replace the stored procedure that executes the import, by running the sql/oracle/import_procedure.sql file
	if odb, ok := db.(*oracle); ok {
		logger.Info("Creating or replacing the import_dump stored procedure.")
		err := odb.RefreshImportStoredProcedure()
		if err != nil {
			logger.Fatal("oracle: %v", err)
		}

		logger.Info("Creating or replacing the EXP_DIR directory object.")
		err = odb.CreateExpDir(filepath.Join(workdir, "exports"))
		if err != nil {
			logger.Fatal("Error creating or replacing the EXP_DIR directory object: %v", err)
		}
	}

	err = registerAgent()
	if err != nil {
		logger.Error("Could not register agent, will keep trying: %s", err.Error())
	}

	go keepAlive()
	go checkExports()

	logger.Info("Starting to listen on port %s", conf.AgentPort)

	port = fmt.Sprintf(":%s", conf.AgentPort)

	startup = time.Now()

	logger.Debug("Started up at %s", startup.Round(time.Millisecond))

	logger.Fatal("server: %v", http.ListenAndServe(port, Router()))
}

func loadProperties(filename string) {
	logger.Debug("Loading properties")

	if _, err := os.Stat(filename); os.IsNotExist(err) {
		logger.Warn("Couldn't find properties file, trying to download one.")

		tmpConfig, err := inet.DownloadFile(".", "https://raw.githubusercontent.com/djavorszky/ddn/master/agent/default.conf")
		if err != nil {
			logger.Fatal("Could not fetch configuration file, please download it manually from https://github.com/djavorszky/ddn")
		}

		os.Rename(tmpConfig, filename)

		logger.Info("Continuing with default configuration...")
	}

	if _, err := toml.DecodeFile(filename, &conf); err != nil {
		logger.Fatal("couldn't read configuration file: ", err.Error())
	}
}


text:
@implementation UIButton (NightVersion)

#pragma mark - ChangeColor

- (void)changeColorWithDuration:(CGFloat)duration {
    if ([DKNightVersionUtility shouldChangeColor:self]) {

        [UIView animateWithDuration:duration animations:^{
            [self setTitleColor:([DKNightVersionManager currentThemeVersion] == DKThemeVersionNight) ? self.nightTitleColor : self.normalTitleColor forState:UIControlStateNormal];
            [self setBackgroundColor:([DKNightVersionManager currentThemeVersion] == DKThemeVersionNight) ? self.nightBackgroundColor : self.normalBackgroundColor];

        }];
    }
}

- (void)changeColor {
    if ([DKNightVersionUtility shouldChangeColor:self]) {
        [self setTitleColor:([DKNightVersionManager currentThemeVersion] == DKThemeVersionNight) ? self.nightTitleColor : self.normalTitleColor forState:UIControlStateNormal];
        [self setBackgroundColor:([DKNightVersionManager currentThemeVersion] == DKThemeVersionNight) ? self.nightBackgroundColor : self.normalBackgroundColor];

    }
}

@end


text:
<?php

namespace Drupal\rp_cms_steve_integration_se_fodbald\Plugin\Block\SteveBasePlugin\Program;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Cache\Cache;

/**
 * Provides a 'sefodbaldprogramheadplugin' block.
 *
 * @Block(
 *  id = "sefodbaldprogramheadplugin",
 *  admin_label = @Translation("Se Fodbald Program Head Plugin"),
 * )
 */
class SeFodbaldProgramHeadPlugin extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    $data =  [
      '#theme' => 'sefodbaldprogramheadplugin',
      '#tags' => [],
      '#background' => [],
      '#colors' => []
    ];
    return $data;
  }

  public function getCacheTags() {
    if ($node = \Drupal::routeMatch()->getParameter('node')) {
      return Cache::mergeTags(parent::getCacheTags(), ['node:' . $node->id()]);
    }
    else {
      //Return default tags instead.
      return parent::getCacheTags();
    }
  }
  public function getCacheContexts() {
    return Cache::mergeContexts(parent::getCacheContexts(), ['route']);
  }
}


text:
package org.apache.hadoop.mapred.lib.db;

/**
 * @deprecated
 * Use {@link org.apache.hadoop.mapreduce.lib.db.DBWritable} instead
 */
@Deprecated
public interface DBWritable
    extends org.apache.hadoop.mapreduce.lib.db.DBWritable {

}


text:
require 'test_helper'

class TwoCheckoutModuleTest < Test::Unit::TestCase
  include ActiveMerchant::Billing::Integrations

  def test_notification_method
    assert_instance_of TwoCheckout::Notification, TwoCheckout.notification('name=cody')
  end

  def test_return_method
    assert_instance_of TwoCheckout::Return, TwoCheckout.return('name=cody')
  end
end


text:
@interface InAppSettingsReaderRegisterDefaults : NSObject

@property (nonatomic, strong) NSMutableArray *files;
@property (nonatomic, strong) NSMutableDictionary *values;

@end

@interface InAppSettingsReader : NSObject

@property (nonatomic, copy) NSString *file;
@property (nonatomic, strong) NSMutableArray *headersAndFooters, *settings;

- (id)initWithFile:(NSString *)inputFile;

@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;

namespace ICSharpCode.WpfDesign.XamlDom
{
	public static class XamlFormatter
	{
		public static char IndentChar = ' ';
		public static int Indenation = 2;
		public static int LengthBeforeNewLine = 60;

		static StringBuilder sb;
		static int currentColumn;
		static int nextColumn;
		static int lineNumber;

		public static string Format(string xaml)
		{
			Dictionary<XamlElementLineInfo, XamlElementLineInfo> dict;
			return Format(xaml, out dict);
		}

		public static string Format(string xaml, out Dictionary<XamlElementLineInfo, XamlElementLineInfo> mappingOldNewLineInfo)
		{
			sb = new StringBuilder();
			lineNumber = 1;
			mappingOldNewLineInfo = new Dictionary<XamlElementLineInfo, XamlElementLineInfo>();

			currentColumn = 0;
			nextColumn = 0;

			try {
				var doc = XDocument.Parse(xaml, LoadOptions.SetLineInfo);
				WalkContainer(doc, mappingOldNewLineInfo);
				return sb.ToString();
			}
			catch {
				return xaml;
			}
		}

		static void WalkContainer(XContainer node, Dictionary<XamlElementLineInfo, XamlElementLineInfo> mappingOldNewLineInfo)
		{
			foreach (var c in node.Nodes()) {
				if (c is XElement)  {
					WalkElement(c as XElement, mappingOldNewLineInfo);
				} else {
					NewLine();
					Append(c.ToString().Trim());
				}
			}
		}

		static void WalkElement(XElement e, Dictionary<XamlElementLineInfo, XamlElementLineInfo> mappingOldNewLineInfo)
		{
			var info = (IXmlLineInfo)e;
			var newLineInfo = new XamlElementLineInfo(lineNumber, currentColumn);
			mappingOldNewLineInfo.Add(new XamlElementLineInfo(info.LineNumber, info.LinePosition), newLineInfo);

			Console.WriteLine(info.LinePosition);
			NewLine();
			string prefix1 = e.GetPrefixOfNamespace(e.Name.Namespace);
			string name1 = prefix1 == null ? e.Name.LocalName : prefix1 + ":" + e.Name.LocalName;
			newLineInfo.Position = sb.Length;
			Append("<" + name1);

			List<AttributeString> list = new List<AttributeString>();
			int length = name1.Length;

			foreach (var a in e.Attributes()) {
				string prefix2 = e.GetPrefixOfNamespace(a.Name.Namespace);
				var g = new AttributeString() { Name = a.Name, Prefix = prefix2, Value = a.Value };
				list.Add(g);
				length += g.FinalString.Length;
			}

			list.Sort(AttributeComparrer.Instance);

			if (length > LengthBeforeNewLine) {
				nextColumn = currentColumn + 1;
				for (int i = 0; i < list.Count; i++) {
					if (i > 0)  {
						NewLine();
					}
					else {
						Append(" ");
					}
					Append(list[i].FinalString);
				}
				nextColumn -= name1.Length + 2;
			}
			else {
				foreach (var a in list) {
					Append(" " + a.FinalString);
				}
			}

			if (e.Nodes().Count() > 0) {
				Append(">");
				nextColumn += Indenation;

				WalkContainer(e, mappingOldNewLineInfo);

				nextColumn -= Indenation;
				NewLine();
				Append("</" + name1 + ">");
			}
			else {
				Append(" />");
			}

			newLineInfo.Length = sb.Length - newLineInfo.Position;
		}

		static void NewLine()
		{
			if (sb.Length > 0)
			{
				lineNumber++;
				sb.AppendLine();
				sb.Append(new string(' ', nextColumn));
				currentColumn = nextColumn;
			}
		}

		static void Append(string s)
		{
			sb.Append(s);
			currentColumn += s.Length;
		}

		enum AttributeLayout
		{
			X,
			XmlnsMicrosoft,
			Xmlns,
			XmlnsWithClr,
			SpecialOrder,
			ByName,
			Attached,
			WithPrefix
		}

		class AttributeString
		{
			public XName Name;
			public string Prefix;
			public string Value;

			public string LocalName {
				get { return Name.LocalName; }
			}

			public string FinalName {
				get  {
					return Prefix == null ? Name.LocalName : Prefix + ":" + Name.LocalName;
				}
			}

			public string FinalString {
				get {
					return FinalName + "=\"" + Value + "\"";
				}
			}

			public AttributeLayout GetAttributeLayout()
			{
				if (Prefix == "xmlns" || LocalName == "xmlns")  {
					if (Value.StartsWith("http://schemas.microsoft.com")) return AttributeLayout.XmlnsMicrosoft;
					if (Value.StartsWith("clr")) return AttributeLayout.XmlnsWithClr;
					return AttributeLayout.Xmlns;
				}
				if (Prefix == "x") return AttributeLayout.X;
				if (Prefix != null) return AttributeLayout.WithPrefix;
				if (LocalName.Contains(".")) return AttributeLayout.Attached;
				if (AttributeComparrer.SpecialOrder.Contains(LocalName)) return AttributeLayout.SpecialOrder;
				return AttributeLayout.ByName;
			}
		}

		class AttributeComparrer : IComparer<AttributeString>
		{
		    public static AttributeComparrer Instance = new AttributeComparrer();

		    public int Compare(AttributeString a1, AttributeString a2)
		    {
				var y1 = a1.GetAttributeLayout();
				var y2 = a2.GetAttributeLayout();
				if (y1 == y2) {
					if (y1 == AttributeLayout.SpecialOrder) {
						return
							Array.IndexOf(SpecialOrder, a1.LocalName).CompareTo(
							Array.IndexOf(SpecialOrder, a2.LocalName));
					}
					return a1.FinalName.CompareTo(a2.FinalName);
				}
				return y1.CompareTo(y2);
		    }

			public static string[] SpecialOrder = new string[]  {
				"Name",
				"Content",
				"Command",
				"Executed",
				"CanExecute",
				"Width",
				"Height",
				"Margin",
				"HorizontalAlignment",
				"VerticalAlignment",
				"HorizontalContentAlignment",
				"VerticalContentAlignment",
				"StartPoint",
				"EndPoint",
				"Offset",
				"Color"
			};
		}
	}
}