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

#endregion

namespace Prexonite
{
    /// <summary>
    ///     Represents a try-catch-finally block
    /// </summary>
    //[DebuggerNonUserCode]
    public class TryCatchFinallyBlock : IEquatable<TryCatchFinallyBlock>
    {
        /// <summary>
        ///     Creates a new try-catch-finally block.
        /// </summary>
        /// <remarks>
        ///     As there is no initialization with this overload, the resulting
        ///     instance will be invalid (<see cref = "IsValid" />) until you set <see cref = "BeginTry" /> and
        ///     <see cref = "EndTry" /> to appropriate values.
        /// </remarks>
        public TryCatchFinallyBlock()
        {
        }

        /// <summary>
        ///     Creates a new try-catch-finally block.
        /// </summary>
        /// <param name = "beginTry"></param>
        /// <param name = "endTry"></param>
        public TryCatchFinallyBlock(int beginTry, int endTry)
        {
            BeginTry = beginTry;
            EndTry = endTry;
        }

        /// <summary>
        ///     Used to store and retrieve try-catch-finally blocks from metadata.
        /// </summary>
        public const string MetaKey = @"\trycatchfinally";

        /// <summary>
        ///     The address of the first instruction inside the try-block.
        /// </summary>
        public int BeginTry
        {
            get { return _beginTry; }
            set
            {
                if ((_endTry > 0 ? value >= _endTry : false) ||
                    (HasFinally ? value >= _beginFinally : false) ||
                        (HasCatch ? value >= _beginCatch : false))
                    throw new ArgumentOutOfRangeException
                        (
                        "value",
                        "BeginTry(" + value +
                            ") has to be less than BeginFinally,BeginCatch and EndTry.");
                _beginTry = value;
            }
        }

        private int _beginTry = -1;

        /// <summary>
        ///     The address of the first instruction inside the finally-block.
        /// </summary>
        /// <remarks>
        ///     This property can have the value -1 if no finally-block has been specified.
        /// </remarks>
        public int BeginFinally
        {
            get { return _beginFinally; }
            set
            {
                if (value > 0 &&
                    ((_beginTry > 0 ? value <= _beginTry : false) ||
                        (_endTry > 0 ? value >= _endTry : false) ||
                            (HasCatch ? value >= _beginCatch : false)))
                    throw new ArgumentOutOfRangeException
                        (
                        "value",
                        "BeginFinally(" + value +
                            ") has to be within the whole try-catch-finally structure but before a catch-clause.");
                _beginFinally = value;
            }
        }

        private int _beginFinally = -1;

        /// <summary>
        ///     The address of the first instruction inside the catch-block.
        /// </summary>
        /// <remarks>
        ///     This property can have the value -1 if no catch-block has been specified.
        /// </remarks>
        public int BeginCatch
        {
            get { return _beginCatch; }
            set
            {
                if (value > 0 &&
                    ((_beginTry > 0 ? value <= _beginTry : false) ||
                        (_endTry > 0 ? value >= _endTry : false) ||
                            (HasFinally ? value <= _beginFinally : false)))
                    throw new ArgumentOutOfRangeException
                        (
                        "value",
                        "BeginCatch(" + value +
                            ") has to be within whole try-catch-finally structure but after a finally-clause.");
                _beginCatch = value;
            }
        }

        private int _beginCatch = -1;

        /// <summary>
        ///     The address of the first instruction after the try-catch-finally construct.
        /// </summary>
        /// <remarks>
        ///     This property might point to an invalid address after the last instruction of a function.
        /// </remarks>
        public int EndTry
        {
            get { return _endTry; }
            set
            {
                if ((_beginTry > 0 ? value <= _beginTry : false) ||
                    (HasCatch ? value <= _beginCatch : false) ||
                        (HasFinally ? value <= _beginFinally : false))
                    throw new ArgumentOutOfRangeException
                        (
                        "value",
                        "EndTry(" + value +
                            ") has to be greater than BeginTry, BeginFinally and BeginCatch.");
                _endTry = value;
            }
        }

        private int _endTry = -1;

        public bool UsesException { get; set; }

        /// <summary>
        ///     Indicates whether this instance has correctly been initialized.
        /// </summary>
        /// <remarks>
        ///     Requires <see cref = "BeginTry" /> and <see cref = "EndTry" /> to be set.
        /// </remarks>
        public bool IsValid
        {
            get { return _beginTry >= 0 && _endTry >= 0 && _beginTry < _endTry; }
        }

        /// <summary>
        ///     Indicates whether the try-catch-finally block has a finally-clause.
        /// </summary>
        public bool HasFinally
        {
            get { return _beginFinally > 0; }
        }

        /// <summary>
        ///     Indicates whether the try-catch-finally block has a catch-clause.
        /// </summary>
        public bool HasCatch
        {
            get { return _beginCatch > 0; }
        }

        /// <summary>
        ///     Returns the number of instructions covered by the block.
        /// </summary>
        /// <remarks>
        ///     Range only contains the instructions in the protected block. Catch- and finally-clauses are ignored.
        /// </remarks>
        public int Range
        {
            get
            {
                if (!IsValid)
                    return -1;
                else
                    return
                        (HasFinally ? _beginFinally : HasCatch ? _beginCatch : _endTry) - _beginTry -
                            1;
            }
        }

        /// <summary>
        ///     Determines whether a block handles exceptions at the supplied address.
        /// </summary>
        /// <param name = "address">An instruction address</param>
        /// <returns>True if the block handles exceptions at the supplied address, false otherwise.</returns>
        public bool Handles(int address)
        {
            return
                address >= _beginTry &&
                    address < (HasFinally ? _beginFinally : HasCatch ? _beginCatch : _endTry);
        }

        /// <summary>
        ///     Determines whether an address belongs to the "guarded block" (CIL). Use <see cref = "Handles" /> to determine whether a try-block provides handlers
        /// </summary>
        /// <param name = "address">An instruction address</param>
        /// <returns>True if the address falls into the "guarded block" (CIL), false otherwise.</returns>
        public bool Spans(int address)
        {
            return
                address >= _beginTry &&
                    address < _endTry;
        }

        /// <summary>
        ///     The address one has to jump to in order to skip (finish) the try block.
        /// </summary>
        public int SkipTry
        {
            get
            {
                if (HasFinally)
                    return BeginFinally;
                else
                    return EndTry;
            }
        }

        /// <summary>
        ///     Determines which of the supplied try-catch-finally blocks
        ///     is supposed to handle an exception at the supplied address.
        /// </summary>
        /// <param name = "address">The address where the excpetion has been caught.</param>
        /// <param name = "blocks">An collection of try-catch-finally candidates.</param>
        /// <returns>The block closest to the address or null if none of the blocks handles that specific address.</returns>
        public static TryCatchFinallyBlock Closest
            (
            int address, IEnumerable<TryCatchFinallyBlock> blocks)
        {
            if (blocks == null)
                throw new ArgumentNullException("blocks");
            if (address < 0)
                throw new ArgumentOutOfRangeException("address", "address must be positive.");

            return blocks
                .Where(block => block.Handles(address))
                .Aggregate<TryCatchFinallyBlock, TryCatchFinallyBlock>(null,
                    (current, block) =>
                        Closer(address, current, block));
        }

        /// <summary>
        ///     Determines which of the supplied try-catch-finally blocks
        ///     is supposed to handle an exception at the supplied address.
        /// </summary>
        /// <param name = "address">The address where the excpetion has been caught.</param>
        /// <param name = "blocks">An array of try-catch-finally candidates.</param>
        /// <returns>The block closest to the address or null if none of the blocks handles that specific address.</returns>
        public static TryCatchFinallyBlock Closest
            (
            int address, params TryCatchFinallyBlock[] blocks)
        {
            return Closest(address, (ICollection<TryCatchFinallyBlock>) blocks);
        }

        /// <summary>
        ///     Determines which of two try-catch-finally constructs is closer to an address.
        /// </summary>
        /// <param name = "address">The address where an exception has been thrown.</param>
        /// <param name = "a">A try-catch-finally block that handles the address.</param>
        /// <param name = "b">A try-catch-finally block that handles the address.</param>
        /// <returns>The try-catch-finally block that is closer to the address.
        ///     If neither <paramref name = "a" /> nor <paramref name = "b" /> handle the supplied address, null is returned.</returns>
        public static TryCatchFinallyBlock Closer
            (
            int address, TryCatchFinallyBlock a, TryCatchFinallyBlock b)
        {
            if (address < 0)
                throw new ArgumentOutOfRangeException("address", "address must be positive.");

            if (b == null)
                return a;
            else if (a == null)
                return b;

            if (ReferenceEquals(a, b) || a == b)
                return a;

            if ((!a.IsValid) || (!b.IsValid))
                throw new ArgumentException("One of the try-catch-finally blocks is not valid.");

            var aHandles = a.Handles(address);
            var bHandles = b.Handles(address);

            if (aHandles && (!bHandles))
                return a;
            else if (bHandles && (!aHandles))
                return b;
            else if ((!aHandles))
                return null; //None of the two blocks handles an exception at the given address.

            var aRange = a.Range;
            var bRange = b.Range;

            if (aRange < bRange)
                return a;
            else if (bRange < aRange)
                return b;
            else if (b.HasFinally)
                return b;
            else
                return b;
        }

        /// <summary>
        ///     Returns a human-readable representation of the try-catch-finally construct.
        /// </summary>
        /// <returns>A human-readable representation of the try-catch-finally construct.</returns>
        public override string ToString()
        {
            return
                "try{" + _beginTry + (!(HasFinally || HasCatch) ? ", " + (_beginTry + Range) : "") +
                    "}" +
                        (HasFinally
                            ? "finally{" + _beginFinally + (!HasCatch ? ", " + _endTry : "") + "}"
                            : "") +
                                (HasCatch ? "catch{" + _beginCatch + ", " + _endTry + "}" : "");
        }

        public MetaEntry ToMetaEntry()
        {
            return (MetaEntry) new MetaEntry[]
                {
                    BeginTry.ToString(),
                    BeginFinally.ToString(),
                    BeginCatch.ToString(),
                    EndTry.ToString(),
                    UsesException
                };
        }

        public static implicit operator MetaEntry(TryCatchFinallyBlock block)
        {
            if (block == null)
                return (MetaEntry) new MetaEntry[] {};
            else
                return block.ToMetaEntry();
        }

        #region Comparison

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (TryCatchFinallyBlock)) return false;
            return Equals((TryCatchFinallyBlock) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                var result = _beginTry;
                result = (result*397) ^ _beginFinally;
                result = (result*397) ^ _beginCatch;
                result = (result*397) ^ _endTry;
                result = (result*397) ^ UsesException.GetHashCode();
                return result;
            }
        }

        public bool Equals(TryCatchFinallyBlock other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._beginTry == _beginTry && other._beginFinally == _beginFinally &&
                other._beginCatch == _beginCatch && other._endTry == _endTry &&
                    other.UsesException.Equals(UsesException);
        }

        public static bool operator ==(TryCatchFinallyBlock a, TryCatchFinallyBlock b)
        {
            if (((object) a) == null && ((object) b) == null)
                return true;
            else if (((object) a) == null || ((object) b) == null)
                return false;
            else
                return a.Equals(b);
        }

        public static bool operator !=(TryCatchFinallyBlock a, TryCatchFinallyBlock b)
        {
            return !(a == b);
        }

        #endregion
    }
}


text:
"""Setup module"""

from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open  # pylint:disable=W0622
from os.path import abspath, dirname, join

README = join(abspath(dirname(__file__)), 'README.md')
try:
    import pypandoc
    DESCRIPTION = pypandoc.convert(README, 'rst')
except(IOError, ImportError):
    # Get the long description from the README file
    with open(README, encoding='utf-8') as fptr:
        DESCRIPTION = fptr.read()

setup(
    name='SimpleInterceptor',
    version='0.1',
    description='Simple interceptor related to concepts of AOP',
    long_description=DESCRIPTION,
    url='https://github.com/host-anshu/simpleInterceptor',
    author='Anshu Choubey',
    author_email='anshu.choubey@imaginea.com',
    license='MIT',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
    ],
    keywords='python interceptor aop call graph tree',
    packages=find_packages(),
    py_modules=['interceptor'],
    install_requires=['ansible>=2.0'],
    entry_points={
        'console_scripts': [
            'interceptor=interceptor:intercept',
        ],
    },
    test_suite="test"
)

redpajama_set_name: RedPajamaGithub


text:
from kubernetes import client, config, watch
import asyncio
from aiohttp.web import Application, run_app, Response
from functools import partial
import json
import cachetools
import sys
import os
import dateutil.parser as dp
import datetime

EVENT_TTL = 120  # Expire events after 2 minutes

class K8SEventTTLCache(cachetools.TTLCache):
    __epoch = datetime.datetime.utcfromtimestamp(0)

    def __setitem__(self, key, value, *args, **kwargs):
        cachetools.TTLCache.__setitem__(self, key, value, *args, **kwargs)
        link = self._TTLCache__getlink(key)
        link.expire = (dp.parse(value['lastTimestamp']).replace(tzinfo=None) - self.__epoch).total_seconds() + self.ttl

def flatten(y):
    out = {}

    def _flatten_inner(x, name=''):
        if type(x) is dict:
            for a in x:
                _flatten_inner(x[a], name + a + '_')
        elif type(x) is list:
            i = 0
            for a in x:
                _flatten_inner(a, name + str(i) + '_')
                i += 1
        else:
            out[name[:-1]] = x

    _flatten_inner(y)
    return out

async def metrics_handler(request, event_obj):
    header = "# TYPE kubernetes_events counter"
    metrics = "\n".join(
        'kubernetes_events{{{}}} {}'.format(
            ",".join([
                '{}={}'.format(label, json.dumps(str(value)))
                for label, value in flatten(event).items()]),
            event['count'])
        for event in event_obj.values()
    )
    return Response(text="\n".join([header, metrics, ""]))

async def watch_events_wrapper(event_obj, loop):
    try:
        await watch_events(event_obj)
    except Reconnecting:
        pass
    except Exception as e:
        current_count = 1 if 'k8s-event-metrics' not in event_obj else (event_obj['k8s-event-metrics']["count"] + 1)
        event_obj['kube-event-metrics'] = {
                "message": str(e), "type": "Error", "reason": "Exception in kube-event-metrics server",
                "involvedObject": {"name": "kube-event-metrics"}, "count": current_count,
                "lastTimestamp": datetime.datetime.now().isoformat()}
    await asyncio.sleep(10)
    asyncio.ensure_future(watch_events_wrapper(event_obj, loop=loop), loop=loop)

class Reconnecting(Exception):
    pass

async def watch_events(event_obj):
    config.load_kube_config()
    v1 = client.CoreV1Api()
    w = watch.Watch()
    gen = w.stream(v1.list_event_for_all_namespaces)

    def next_event():
        try:
            return next(gen)
        except StopIteration:
            raise Reconnecting()

    while True:
        event = await loop.run_in_executor(None, next_event)
        event_object = event['object']
        event_obj[event_object.involved_object.name] = event['raw_object']

async def start_background_tasks(app, event_obj):
    asyncio.ensure_future(watch_events_wrapper(event_obj, loop=app.loop), loop=app.loop)

async def init(loop):
    event_obj = K8SEventTTLCache(sys.maxsize, EVENT_TTL)
    app = Application()
    app.router.add_get('/metrics', partial(metrics_handler, event_obj=event_obj))
    app.on_startup.append(partial(start_background_tasks, event_obj=event_obj))
    return app

loop = asyncio.get_event_loop()
app = loop.run_until_complete(init(loop))
run_app(app, host='0.0.0.0', port=int(os.environ.get("PORT", "8080")))


text:
class DeploymentsController < ApplicationController

  def index
    @list = Deployment.all
    respond_to do |format|
      format.html { }
      format.json { render api_index :deployment, @list }
    end
  end

  def show
    respond_to do |format|
      format.html { @deployment = Deployment.find_key params[:id] }
      format.json { render api_show :deployment, Deployment }
    end
  end

  def create
    @deployment = Deployment.create! params
    respond_to do |format|
      format.html { redirect_to deployment_path(@deployment.id)}
      format.json { render api_show :deployment, Deployment, @deployment.id.to_s, nil, @deployment }
    end
  end

  def destroy
    render api_delete Deployment
  end

  # return the committed snapshot
  def head
    deploy = Deployment.find_key params[:deployment_id]
    render_snaps(deploy.head)
  end

  # return the proposed snapshot
  def next
    deploy = Deployment.find_key params[:deployment_id]
    render_snaps(deploy.head.next)
  end

  def claim
    deploy = Deployment.find_key params[:deployment_id]
    node = Node.find_key params[:node_id]
    node.deployment_id = deploy.id
    node.save!
    node.reload
    render api_show :node, Node, nil, nil, node
  end

  private

  def render_snaps(snap)
    respond_to do |format|
      format.html { redirect_to snapshot_path(snap.id) }
      format.json { render api_show :snapshot, Snapshot, nil, nil, snap }
    end
  end

end


text:
/**
 * generated by Xtext
 */
package org.scribble.editor.dsl.ui.outline;

import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;

/**
 * Customization of the default outline structure.
 *
 * see http://www.eclipse.org/Xtext/documentation.html#outline
 */
@SuppressWarnings("all")
public class ScribbleDslOutlineTreeProvider extends DefaultOutlineTreeProvider {
}


text:
package org.takes.rq;

import java.io.IOException;
import org.takes.Request;

/**
 * Request decorator that decodes FORM data from
 * {@code application/x-www-form-urlencoded} format (RFC 1738).
 *
 *
For {@code multipart/form-data} format use
 * {@link org.takes.rq.multipart.RqMtBase}.
 *
 *
It is highly recommended to use {@link org.takes.rq.RqGreedy}
 * decorator before passing request to this class.
 *
 *
The class is immutable and thread-safe.
 *
 * @author Yegor Bugayenko (yegor@teamed.io)
 * @version $Id$
 * @see
 *     Forms in HTML
 * @see org.takes.rq.RqGreedy
 * @since 0.9
 */
public interface RqForm extends Request {

    /**
     * Get single parameter.
     * @param name Parameter name
     * @return List of values (can be empty)
     * @throws IOException if something fails reading parameters
     */
    Iterable<String> param(CharSequence name) throws IOException;

    /**
     * Get all parameter names.
     * @return All names
     * @throws IOException if something fails reading parameters
     */
    Iterable<String> names() throws IOException;

}


text:
/**
 */
package com.specmate.model.requirements.impl;

import com.specmate.model.base.impl.IModelConnectionImpl;

import com.specmate.model.requirements.CEGConnection;
import com.specmate.model.requirements.RequirementsPackage;

import org.eclipse.emf.ecore.EClass;

/**
 *
 * An implementation of the model object 'CEG Connection'.
 *
 *

 * The following features are implemented:
 *

 *

 *
{@link com.specmate.model.requirements.impl.CEGConnectionImpl#isNegate Negate}

 *

 *
 * @generated
 */
public class CEGConnectionImpl extends IModelConnectionImpl implements CEGConnection {
	/**
	 * The default value of the '{@link #isNegate() Negate}' attribute.
	 *
	 *
	 * @see #isNegate()
	 * @generated
	 * @ordered
	 */
	protected static final boolean NEGATE_EDEFAULT = false;

	/**
	 *
	 *
	 * @generated
	 */
	protected CEGConnectionImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return RequirementsPackage.Literals.CEG_CONNECTION;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public boolean isNegate() {
		return (Boolean)eDynamicGet(RequirementsPackage.CEG_CONNECTION__NEGATE, RequirementsPackage.Literals.CEG_CONNECTION__NEGATE, true, true);
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setNegate(boolean newNegate) {
		eDynamicSet(RequirementsPackage.CEG_CONNECTION__NEGATE, RequirementsPackage.Literals.CEG_CONNECTION__NEGATE, newNegate);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case RequirementsPackage.CEG_CONNECTION__NEGATE:
				return isNegate();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case RequirementsPackage.CEG_CONNECTION__NEGATE:
				setNegate((Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case RequirementsPackage.CEG_CONNECTION__NEGATE:
				setNegate(NEGATE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case RequirementsPackage.CEG_CONNECTION__NEGATE:
				return isNegate() != NEGATE_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

} //CEGConnectionImpl


text:
from paddle.trainer.PyDataProvider2 import *

def hook(settings, dictionary, **kwargs):
    settings.word_dict = dictionary
    settings.input_types = [
        integer_value_sequence(len(settings.word_dict)), integer_value(2)
    ]
    settings.logger.info('dict len : %d' % (len(settings.word_dict)))

@provider(init_hook=hook)
def process(settings, file_name):
    with open(file_name, 'r') as fdata:
        for line_count, line in enumerate(fdata):
            label, comment = line.strip().split('\t\t')
            label = int(label)
            words = comment.split()
            word_slot = [
                settings.word_dict[w] for w in words if w in settings.word_dict
            ]
            yield word_slot, label


text:
describe('physics', function() {
    it('exists', function() {
        expect(physics).toBeDefined();
    });

    it('has expected classes', function() {
        expect(physics.Entity).toBe(Entity);
        expect(physics.CircleEntity).toBe(CircleEntity);
        expect(physics.RectangleEntity).toBe(RectangleEntity);
        expect(physics.CircleBounds).toBe(CircleBounds);
        expect(physics.RectangleBounds).toBe(RectangleBounds);
        expect(physics.Engine).toBe(Engine);
        expect(physics.EntityUpdater).toBe(EntityUpdater);
        expect(physics.CollisionDetector).toBe(CollisionDetector);
    });
});


text:
**Note:** This repo is archived and no longer actively maintained. Security vulnerabilities may exist in the project, or its dependencies. If you plan to reuse or run any code from this repo, be sure to perform appropriate security checks on the code or dependencies first. Do not use this project as the starting point of a production Office Add-in. Always start your production code by using the Office/SharePoint development workload in Visual Studio, or the [Yeoman generator for Office Add-ins](https://github.com/OfficeDev/generator-office), and follow security best practices as you develop the add-in.

This repository shows how you can build a library of clauses that can be added to a word document.
These clauses can then be reused within documents. The clauses can be stored to any SharePoint library
that contains the app.

The solution demonstrates authenticating of users via the Azure AD.
It utilizes the Office 365 Discovery Client to identify a users' SharePoint Online resource, and uses REST
calls to communicate to SharePoint.  The Office Add-In is then constructed with an Angular
application demonstrating some of the capabilities of the Office JS libraries.

**Note: If possible, please use this sample with a "non-work" or test account in Office 365. With the
current version of the project, it does not clean up the created lists within any connected SharePoint
Online subsite. At this time you'll have to manually remove these artifacts, for example, the clauses, groups,
and tags lists.**

# How to Run This Sample #
To run this sample, you need:

1. Visual Studio 2015, with Office Developer Tools installed.
	* If Office Developer Tools are not installed, the **ClauseLibrary.OfficeApp** may be unable to load.
	* If this happens, simply right-click on the project and select 'Reload Project'. Follow the instructions to install the Office Developer Tools.

![Office app unavailable](gh-docs/visual-studio-office-developer-tools.png)

2. Office Word 2013 or higher

3.  A Microsoft Azure subscription with a Microsoft Azure Active Directory (AD) tenant to register your application. Azure AD provides identity services that applications use for authentication and authorization. A trial subscription can be acquired
here: [Microsoft Azure](https://account.windowsazure.com/SignUp).

4. Office 365 Developer account.  You can [join the Office 365 Developer Program and get a free 1 year subscription to Office 365](https://aka.ms/devprogramsignup). Create a new subsite under your SharePoint
Online subscription. You will also need to ensure that you are under the First Release update path. To check this on your
Office 365 subscription, navigate to https://portal.office.com as an administrator.  Under the Admin view, navigate to Service Settings -> Updates.
Ensure that you are on First release.  This may take up to 24 hours to be activated.
![Office 365 Portal Updates](gh-docs/o365-portal-first-release.png)

## Before You get the Code ##

### Create a SharePoint Subsite ###

1. Log on to your SharePoint online site.
2. Click on the settings cog in the navigation header. Navigate to Site Contents.

![Create new subsite](gh-docs/sharepoint-sitecontents.png)

3. Scroll down until the Subsites section is visible.  Click on the "new subsite" link.
![Create new subsite](gh-docs/sharepoint-add-subsite.png)

4. Enter a title and description for the subsite.  Enter a new URL for the subsite.  Remember this address.
![Create new subsite](gh-docs/sharepoint-add-subsite-details.png)

5. Leave the template as the default (Collaboration/Team Site).  Scroll to the bottom and click Create to finalize the subsite.

## Running the Solution ##

### Step 1: Clone or download this repository ###

From your Git Shell or Command line:

`git clone https://github.com/OfficeDev/Word-Add-in-ClauseLibrary-Code-Sample`

### Step 2: Build and Deploy the Project ###

1. Open the project in Visual Studio 2015.
2. Check that all projects have loaded.  If the **ClauseLibrary.OfficeApp** project is unavailable, please refer to the section above.
3. Right-click on the **ClauseLibrary.Web** project and then click on Properties.
4. Under the Web section, copy the URL from the Project Url field.

![Create new website](gh-docs/web-app-url.png)

### Step 3. Create an Azure AD Application ###

1. Connect to the Azure Management Portal and navigate to the Azure AD tenant.
2. Navigate to the Applications Section, and then click on the Add button on the command bar.
![Add an app](gh-docs/azure-ad-add-an-app.png)
3. When prompted by the wizard, select "Add an application my organization is developing".
On the next screen, type in a name for the Azure AD Application.

![Add an app, step 1](gh-docs/azure-ad-add-an-app-wizard-1.png)
![Add an app, step 2](gh-docs/azure-ad-add-an-app-wizard-2.png)

4. Give the application a valid URL for the Sign-on URL property,
and a unique App ID URI (e.g. http://clauselibrary).  These URLs do not need to exist.
Create the application.
![Add an app, step 3](gh-docs/azure-ad-add-an-app-wizard-3.png)

5. Your Azure AD Application should now be created.
Navigate to Configure.
![Configure application](gh-docs/azure-ad-configure.png)

6. Under the Reply URL settings, add the URL of the authentication callback path.
This should be the Project URL (copied earlier), with the route */authentication/processcode*
i.e.
`http://localhost:57697/Authentication/ProcessCode`
![Reply URL](gh-docs/azure-ad-reply-url.png)

7. This AD application must also be granted specific permissions for SharePoint Online:
	* Windows Azure Active Directory
		* *Sign in and read user profile* delegated permission.
	* Office 365 SharePoint Online
		* *Read and write items and lists in all site collections* delegated permission.
		* *Have full control of all site collections* application permission.
![Permissions](gh-docs/azure-ad-permissions.png)

8. Take note of the Client ID value for the application.
9. Create a new key secret.  This will be provided after the application configuration has been saved.
![Client credentials](gh-docs/azure-ad-client-id-secret.png)
10. Save the application.  You should now be able to retrieve the generated key.
Take note of this key secret.

### Step 4: Build and Run the Office Application ###

1. Open the project in Visual Studio 2015.
2. Build the project to restore NuGet packages.
3. Locate the **web.config** file under the **ClauseLibrary.Web** project.
4. Replace the *{ida:ClientId}* app setting with the client ID of your registered Azure application.
5. Replace the *{ida:ClientKey}* app setting with the key secret of your registered Azure application.
6. Press F5 to run the solution.
7. On the **Home** ribbon, click the **Open** button in the **Clause Library** group. The Clause Library app should now appear in Word, pointing to the Clause Library app running in IIS Express.

### Step 5: Using the Clause Library ###

1. Click the *Log in to Clause Library* link and enter your Azure AD credentials in the corresponding dialog.
![Application login](gh-docs/app-login.png)

If a login error occurs, try some of the following:
	* Double checking that the Azure AD settings (clientid and secret) have been correctly entered.
	* Changing the token storage to not use cookies.  Open the **web.config**, and set the *UseCookieForTokenStorage* app setting to false.
	* Ensure Discovery Service is available.  Follow the instructions at the top of this guide to update Office 365 to First release.

2. You will be prompted to create a library.  In the SharePoint URL field, enter the full URL
of the SharePoint Online subsite that you have created earlier.  E.g. `https://{your-sharepoint-tenant}.sharepoint.com/clauselibrary`
3. Enter a name and description for your new clause library, and finish by clicking Create.
![Application login](gh-docs/app-create-library.png)

4. The Clause Library application will create the necessary lists at the specified SharePoint subsite,
and will connect the application.  Clauses can now be remembered and recalled.

## Extra for Experts ##

The above instructions leverage IIS Express.  To turn things up a notch, why not try [running this in Azure.](AZURE.md)

## Copyright ##

Copyright (c) 2015 Microsoft. All rights reserved.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.


text:
СМИ о нас

  <form class="form-inline lsv-form lsv-form--date-filter">

      Архив публикаций
      <select name="month" id="lsv-filter-select-month" class="lsv-select filter-select">
        <option value="all" class="lsv-option">Месяц</option>
        <option value="january" class="lsv-option">Январь</option>
        <option value="february" class="lsv-option">Февраль</option>
        <option value="march" class="lsv-option">Март</option>
        <option value="april" class="lsv-option">Апрель</option>
        <option value="may" class="lsv-option">Май</option>
        <option value="june" class="lsv-option">Июнь</option>
        <option value="july" class="lsv-option">Июль</option>
        <option value="august" class="lsv-option">Август</option>
        <option value="september" class="lsv-option">Сентябрь</option>
        <option value="october" class="lsv-option">Октябрь</option>
        <option value="november" class="lsv-option">Ноябрь</option>
        <option value="december" class="lsv-option">Декабрь</option>
      </select>
      <select name="year" id="lsv-filter-select-year" class="lsv-select filter-select">
        <option value="all" class="lsv-option">Год</option>
        <option value="2012" class="lsv-option">2012</option>
        <option value="2013" class="lsv-option">2013</option>
        <option value="2014" class="lsv-option">2014</option>
        <option value="2015" class="lsv-option">2015</option>
      </select>

  </form>

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html

    This will be replaced by the content of press_about_us-mini.html


text:
namespace caffe {

template <typename Dtype>
class MemoryDataLayerTest : public ::testing::Test {
 protected:
  MemoryDataLayerTest()
    : data_(new Blob<Dtype>()),
      labels_(new Blob<Dtype>()),
      data_blob_(new Blob<Dtype>()),
      label_blob_(new Blob<Dtype>()) {}
  virtual void SetUp() {
    batch_size_ = 8;
    batches_ = 12;
    channels_ = 4;
    height_ = 7;
    width_ = 11;
    blob_top_vec_.push_back(data_blob_);
    blob_top_vec_.push_back(label_blob_);
    // pick random input data
    FillerParameter filler_param;
    GaussianFiller<Dtype> filler(filler_param);
    data_->Reshape(batches_ * batch_size_, channels_, height_, width_);
    labels_->Reshape(batches_ * batch_size_, 1, 1, 1);
    filler.Fill(this->data_);
    filler.Fill(this->labels_);
  }

  virtual ~MemoryDataLayerTest() {
    delete data_blob_;
    delete label_blob_;
    delete data_;
    delete labels_;
  }
  int batch_size_;
  int batches_;
  int channels_;
  int height_;
  int width_;
  // we don't really need blobs for the input data, but it makes it
  //  easier to call Filler
  Blob<Dtype>* const data_;
  Blob<Dtype>* const labels_;
  // blobs for the top of MemoryDataLayer
  Blob<Dtype>* const data_blob_;
  Blob<Dtype>* const label_blob_;
  vector<Blob<Dtype>*> blob_bottom_vec_;
  vector<Blob<Dtype>*> blob_top_vec_;
};

typedef ::testing::Types<float, double> Dtypes;
TYPED_TEST_CASE(MemoryDataLayerTest, Dtypes);

TYPED_TEST(MemoryDataLayerTest, TestSetup) {
  LayerParameter layer_param;
  MemoryDataParameter* md_param = layer_param.mutable_memory_data_param();
  md_param->set_batch_size(this->batch_size_);
  md_param->set_channels(this->channels_);
  md_param->set_height(this->height_);
  md_param->set_width(this->width_);
  shared_ptr<Layer<TypeParam> > layer(
      new MemoryDataLayer<TypeParam>(layer_param));
  layer->SetUp(this->blob_bottom_vec_, &(this->blob_top_vec_));
  EXPECT_EQ(this->data_blob_->num(), this->batch_size_);
  EXPECT_EQ(this->data_blob_->channels(), this->channels_);
  EXPECT_EQ(this->data_blob_->height(), this->height_);
  EXPECT_EQ(this->data_blob_->width(), this->width_);
  EXPECT_EQ(this->label_blob_->num(), this->batch_size_);
  EXPECT_EQ(this->label_blob_->channels(), 1);
  EXPECT_EQ(this->label_blob_->height(), 1);
  EXPECT_EQ(this->label_blob_->width(), 1);
}

// run through a few batches and check that the right data appears
TYPED_TEST(MemoryDataLayerTest, TestForward) {
  LayerParameter layer_param;
  MemoryDataParameter* md_param = layer_param.mutable_memory_data_param();
  md_param->set_batch_size(this->batch_size_);
  md_param->set_channels(this->channels_);
  md_param->set_height(this->height_);
  md_param->set_width(this->width_);
  shared_ptr<MemoryDataLayer<TypeParam> > layer(
      new MemoryDataLayer<TypeParam>(layer_param));
  layer->SetUp(this->blob_bottom_vec_, &(this->blob_top_vec_));
  layer->Reset(this->data_->mutable_cpu_data(),
      this->labels_->mutable_cpu_data(), this->data_->num());
  for (int i = 0; i < this->batches_ * 6; ++i) {
    int batch_num = i % this->batches_;
    layer->Forward(this->blob_bottom_vec_, &(this->blob_top_vec_));
    for (int j = 0; j < this->data_blob_->count(); ++j) {
      EXPECT_EQ(this->data_blob_->cpu_data()[j],
          this->data_->cpu_data()[
              this->data_->offset(1) * this->batch_size_ * batch_num + j]);
    }
    for (int j = 0; j < this->label_blob_->count(); ++j) {
      EXPECT_EQ(this->label_blob_->cpu_data()[j],
          this->labels_->cpu_data()[this->batch_size_ * batch_num + j]);
    }
  }
}

}  // namespace caffe


text:
=======
ionic-playground
================

Just a place for me to test out different ionic features - there will likely be very ugly code.

below is the default ionic readme.

-yitz..

Ionic App Base
=====================

A starting project for Ionic that optionally supports
using custom SCSS.

## Using this project

We recommend using the `ionic` utility to create new Ionic projects that are based on this project but use a ready-made starter template.

For example, to start a new Ionic project with the default tabs interface, make sure the `ionic` utility is installed:

```bash
$ sudo npm install -g ionic
```

Then run:

```bash
$ sudo npm install -g ionic
$ ionic start myProject tabs
```

More info on this can be found on the Ionic [Getting Started](http://ionicframework.com/getting-started) page.

## Installation

While we recommend using the `ionic` utility to create new Ionic projects, you can use this repo as a barebones starting point to your next Ionic app.

To use this project as is, first clone the repo from GitHub, then run:

```bash
$ cd ionic-app-base
$ sudo npm install -g cordova ionic gulp
$ npm install
$ gulp install
```

## Using Sass (optional)

This project makes it easy to use Sass (the SCSS syntax) in your projects. This enables you to override styles from Ionic, and benefit from
Sass's great features.

Just update the `./scss/ionic.app.scss` file, and run `gulp` or `gulp watch` to rebuild the CSS files for Ionic.

Note: if you choose to use the Sass method, make sure to remove the included `ionic.css` file in `index.html`, and then uncomment
the include to your `ionic.app.css` file which now contains all your Sass code and Ionic itself:

```html
<!-- IF using Sass (run gulp sass first), then remove the CSS include above
<link href="css/ionic.app.css" rel="stylesheet">
-->
```

## Updating Ionic

To update to a new version of Ionic, open bower.json and change the version listed there.

For example, to update from version `1.0.0-beta.4` to `1.0.0-beta.5`, open bower.json and change this:

```
"ionic": "driftyco/ionic-bower#1.0.0-beta.4"
```

To this:

```
"ionic": "driftyco/ionic-bower#1.0.0-beta.5"
```

After saving the update to bower.json file, run `gulp install`.

Alternatively, install bower globally with `npm install -g bower` and run `bower install`.

#### Using the Nightly Builds of Ionic

If you feel daring and want use the bleeding edge 'Nightly' version of Ionic, change the version of Ionic in your bower.json to this:

```
"ionic": "driftyco/ionic-bower#master"
```

Warning: the nightly version is not stable.


text:
require 'test/unit'
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'mapricot'))

class Response < Mapricot::Base
  has_one   :location, :xml
end

class Location < Mapricot::Base
  has_one         :city
  has_one         :state
  has_attribute   :code
  has_attribute   :id,    :integer
end

class TestResponse < Test::Unit::TestCase

  def setup
    @parsers = [:hpricot, :nokogiri, :libxml]
    @xml = %(
      <response>
        <location code='nyc' id='100'>
          <city>New York</city>
          <state>NY</state>
        </location>
      </response>
    )
  end

  def test_response
    @parsers.each do |parser|
      Mapricot.parser = parser
      response = Response.new(@xml)
      assert_equal  "New York",     response.location.city
      assert_equal  "NY",           response.location.state
      assert_equal  "nyc",          response.location.code
      assert_equal  100,            response.location.id
    end
  end

end


text:
namespace ash {

namespace device_sync {

// Provides the ID of the current device. In this context, "device ID" refers to
// the |long_device_id| field of the cryptauth::GcmDeviceInfo proto which is
// sent to the CryptAuth back-end during device enrollment.
class CryptAuthDeviceIdProvider {
 public:
  CryptAuthDeviceIdProvider() = default;

  CryptAuthDeviceIdProvider(const CryptAuthDeviceIdProvider&) = delete;
  CryptAuthDeviceIdProvider& operator=(const CryptAuthDeviceIdProvider&) =
      delete;

  virtual ~CryptAuthDeviceIdProvider() = default;

  virtual std::string GetDeviceId() const = 0;
};

}  // namespace device_sync

}  // namespace ash

#endif  // CHROMEOS_ASH_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CRYPTAUTH_DEVICE_ID_PROVIDER_H_


text:
/**
 *
 */
package com.qiyi.usercloud.carve.config.provider;

import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import com.qiyi.usercloud.carve.config.ConfigProvider;
import com.qiyi.usercloud.carve.server.NettyServer;
import com.qiyi.usercloud.carve.zk.ZkClient;

/**
 * @author duxinyun
 *
 */
public class AbstractServiceProvider extends ConfigProvider implements InitializingBean,DisposableBean{

	private transient final Map<String,NettyServer> serverMap = new ConcurrentHashMap<String, NettyServer>();
	static final Logger logger = LoggerFactory.getLogger(AbstractServiceProvider.class);

	public Map<String, NettyServer> getServerMap() {
		return serverMap;
	}

	public NettyServer getServerMap(String server) {
		return serverMap.get(server);
	}

	@Override
	public void destroy() throws Exception {
		close();
	}

	protected synchronized void close(){
		for(Entry<String, NettyServer> server : serverMap.entrySet()){
			if(!server.getValue().isClosed()){
				server.getValue().close();
			}
		}

		ZkClient zk = getZkInstance();
		if(zk != null){
			zk.close();
		}
	}

	void export(){
		Class<?> interfaceCls = getInterfaceClass();
		Method[] methods = interfaceCls.getMethods();
		Set<String> vMethodName = new HashSet<String>();
		for(Method mt : methods){
			if(Void.class.getName().equals(mt.getReturnType().getName())){
				vMethodName.add(mt.getName());
			}
		}
		setNoreturnMethod(vMethodName);
		setExported(true);
		String path = toServicePath();
		logger.info("xcarve start to export service. service={}",path);
		getZkInstance().createPath(path, true);
		logger.info("xcarve export service to zookeeper successfull, service={}",path);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		if( getInterfaceClass() == null && StringUtils.isBlank(this.getInterfaceName()) ){
			throw new IllegalStateException("interfaceClass or interfaceName is null.");
		}
		if( getInterfaceClass() == null){
			this.setInterfaceClass(Class.forName(getInterfaceName(), true, Thread.currentThread().getContextClassLoader()));
		}
		if( !getInterfaceClass().isInterface() ){
			throw new IllegalStateException(" this field[interfaceClass] value ="+ getInterfaceClass() +"is not a interface.");
		}
		if( getUser() == null || ( StringUtils.isBlank(getUser().getUsername()) && StringUtils.isBlank(getUser().getUserEmail()) ) ){
			throw new IllegalArgumentException("must set the service user config. username|useremail");
		}
		if( getUser().getIsProvider() == null)
			throw new IllegalArgumentException("service user config field=[isProvider] must be set true|false.");
		if(StringUtils.isBlank(getDomain()))
			throw new IllegalArgumentException("service about config field=[domain] must be set.");

	}
}


text:
package sync

import (
	"sync"
)

// Aliases of standard library types.
type (
	// Cond is an alias of sync.Cond.
	Cond = sync.Cond

	// Locker is an alias of sync.Locker.
	Locker = sync.Locker

	// Once is an alias of sync.Once.
	Once = sync.Once

	// Pool is an alias of sync.Pool.
	Pool = sync.Pool

	// WaitGroup is an alias of sync.WaitGroup.
	WaitGroup = sync.WaitGroup

	// Map is an alias of sync.Map.
	Map = sync.Map
)

// NewCond is a wrapper around sync.NewCond.
func NewCond(l Locker) *Cond {
	return sync.NewCond(l)
}


text:
This is a project to handle the [2dfGRS](http://www2.aao.gov.au/2dfgrs/) data using [NodeJS](http://nodejs.org/) server and [MongoDB](http://www.mongodb.org/) database engine to take advantage of the [Biga Data technologies](http://en.wikipedia.org/wiki/Big_data).

It uses the NodeJS module FITS, and processes the data locally or through a browser.

## Usage:

To read and get the FITS headers (HDU):

	var fits = require('FITS');

	fits.readFile(file, function(err, FITS){
		if(err) return console.error(err);
		console.log(FITS.HDU.primary);
	});

## License:
The MIT License (MIT)

Copyright � 2014 Joe Rosa


text:
package com.lambdazen.pixy.pipes;

import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;

import com.lambdazen.pixy.PipeVisitor;
import com.lambdazen.pixy.PixyPipe;

public class SaveInputPipe implements PixyPipe, NamedOutputPipe {
	private String namedStep;

	public SaveInputPipe(String namedStep) {
		this.namedStep = namedStep;
	}

	public String toString() {
		return (namedStep == null) ? "" : "as('" + namedStep + "')";
	}

	@Override
	public GraphTraversal pixyStep(GraphTraversal inputPipe) {
		if (namedStep == null) {
			return inputPipe;
		} else {
			return inputPipe.as(namedStep);
		}
	}

	@Override
	public String getOutputNamedStep() {
		return namedStep;
	}

	@Override
	public void clearOutputNamedStep() {
		this.namedStep = null;
	}

	@Override
	public void visit(PipeVisitor visitor) {
		visitor.visit(this);
	}
}


text:
namespace OpenTelemetry.Tests.Stress;

internal class Payload
{
    public int Field001 = 0;
    public float Field002 = 2.718281828f;
    public double Field003 = 3.141592653589793d;
    public string Field004 = "Hello, World!";
    public bool Field005 = true;
    public int Field006 = 6;
    public int Field007 = 7;
    public int Field008 = 8;
    public int Field009 = 9;
    public int Field010 = 10;
    public int Field011 = 11;
    public int Field012 = 12;
    public int Field013 = 13;
    public int Field014 = 14;
    public int Field015 = 15;
    public int Field016 = 16;
    public int Field017 = 17;
    public int Field018 = 18;
    public int Field019 = 19;
    public int Field020 = 20;
    public int Field021 = 21;
    public int Field022 = 22;
    public int Field023 = 23;
    public int Field024 = 24;
    public int Field025 = 25;
    public int Field026 = 26;
    public int Field027 = 27;
    public int Field028 = 28;
    public int Field029 = 29;
    public int Field030 = 30;
    public int Field031 = 31;
    public int Field032 = 32;
    public int Field033 = 33;
    public int Field034 = 34;
    public int Field035 = 35;
    public int Field036 = 36;
    public int Field037 = 37;
    public int Field038 = 38;
    public int Field039 = 39;
    public int Field040 = 40;
    public int Field041 = 41;
    public int Field042 = 42;
    public int Field043 = 43;
    public int Field044 = 44;
    public int Field045 = 45;
    public int Field046 = 46;
    public int Field047 = 47;
    public int Field048 = 48;
    public int Field049 = 49;
    public int Field050 = 50;
    public int Field051 = 51;
    public int Field052 = 52;
    public int Field053 = 53;
    public int Field054 = 54;
    public int Field055 = 55;
    public int Field056 = 56;
    public int Field057 = 57;
    public int Field058 = 58;
    public int Field059 = 59;
    public int Field060 = 60;
    public int Field061 = 61;
    public int Field062 = 62;
    public int Field063 = 63;
    public int Field064 = 64;
    public int Field065 = 65;
    public int Field066 = 66;
    public int Field067 = 67;
    public int Field068 = 68;
    public int Field069 = 69;
    public int Field070 = 70;
    public int Field071 = 71;
    public int Field072 = 72;
    public int Field073 = 73;
    public int Field074 = 74;
    public int Field075 = 75;
    public int Field076 = 76;
    public int Field077 = 77;
    public int Field078 = 78;
    public int Field079 = 79;
    public int Field080 = 80;
    public int Field081 = 81;
    public int Field082 = 82;
    public int Field083 = 83;
    public int Field084 = 84;
    public int Field085 = 85;
    public int Field086 = 86;
    public int Field087 = 87;
    public int Field088 = 88;
    public int Field089 = 89;
    public int Field090 = 90;
    public int Field091 = 91;
    public int Field092 = 92;
    public int Field093 = 93;
    public int Field094 = 94;
    public int Field095 = 95;
    public int Field096 = 96;
    public int Field097 = 97;
    public int Field098 = 98;
    public int Field099 = 99;
}


text:
            Copyright Dark Overlord of Data 2012 - 2014

{% if site.isdev == true %}
    {% bundle %}
    - /_assets/jquery-2.0.2.min.js
    - /_assets/bootstrap.min.js
    {% endbundle %}
{% else %}

{% endif %}


text:
Creating a Derived Theme
========================

**Lesson 1**

A derived theme takes most of the settings from its "parent" theme and lets you change a few things to your liking without creating an entire theme package.

To create a derived theme, first choose a name. For our example we'll call our theme 'mytheme'. Hopefully you'll be a bit more creative. But throughout this document, wherever you see 'mytheme', replace that with the name you chose.

**Directory Structure**

First you need to create a theme directory structure. We'll keep it simple. We need a php directory and a css directory. Here are the Unix/Linux commands to do this. Assume that 'mywebsite' is your top level Red Matrix folder.

    cd mywebsite
    mkdir view/theme/mytheme
    mkdir view/theme/mytheme/css
    mkdir view/theme/mytheme/php

Great. Now we need a couple of files. The first one is your theme info file, which describes the theme.

It will be called view/theme/mytheme/php/theme.php (clever name huh?)

Inside it, put the following information - edit as needed

    <?php

    /**
     *   * Name: Mytheme
     *   * Description: Sample Derived theme
     *   * Version: 1.0
     *   * Author: Your Name
     *   * Compat: Red [*]
     *
     */

    function mytheme_init(&$a) {

        $a->theme_info['extends'] = 'redbasic';

    }

Remember to rename the mytheme_init function with your theme name. In this case we will be extending the theme 'redbasic'.

Now create another file. We call this a PCSS file, but it's really a PHP file.

The file is called view/theme/mytheme/php/style.php

In it, put the following:

    <?php

    require_once('view/theme/redbasic/php/style.php');

    echo @file_get_contents('view/theme/mytheme/css/style.css');

That's it. This tells the software to read the PCSS information for the redbasic theme first, and then read our CSS file which will just consist of changes we want to make from our parent theme (redbasic).

Now create the actual CSS file for your theme.  Put it in view/theme/mytheme/css/style.css (where we just told the software to look for it). For our example, we'll just change the body background color so you can see that it works. You can use any CSS you'd like.

    body {
        background-color: #DDD;
    }

You've just successfully created a derived theme. This needs to be enabled in the admin "themes" panel, and then anybody on the site can use it by selecting it in Settings->Display Settings as their default theme.

#include doc/macros/main_footer.bb;


text:
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
import withObservables from '@nozbe/with-observables';
import {combineLatest, of as of$} from 'rxjs';
import {switchMap} from 'rxjs/operators';

import {General, Permissions} from '@constants';
import {MAX_MESSAGE_LENGTH_FALLBACK} from '@constants/post_draft';
import {observeChannel, observeCurrentChannel} from '@queries/servers/channel';
import {queryAllCustomEmojis} from '@queries/servers/custom_emoji';
import {observePermissionForChannel} from '@queries/servers/role';
import {observeConfigBooleanValue, observeConfigIntValue, observeCurrentUserId} from '@queries/servers/system';
import {observeUser} from '@queries/servers/user';

import SendHandler from './send_handler';

import type {WithDatabaseArgs} from '@typings/database/database';

type OwnProps = {
    rootId: string;
    channelId: string;
    channelIsArchived?: boolean;
}

const enhanced = withObservables([], (ownProps: WithDatabaseArgs & OwnProps) => {
    const database = ownProps.database;
    const {rootId, channelId} = ownProps;
    let channel;
    if (rootId) {
        channel = observeChannel(database, channelId);
    } else {
        channel = observeCurrentChannel(database);
    }

    const currentUserId = observeCurrentUserId(database);
    const currentUser = currentUserId.pipe(
        switchMap((id) => observeUser(database, id),
        ));
    const userIsOutOfOffice = currentUser.pipe(
        switchMap((u) => of$(u?.status === General.OUT_OF_OFFICE)),
    );

    const enableConfirmNotificationsToChannel = observeConfigBooleanValue(database, 'EnableConfirmNotificationsToChannel');
    const isTimezoneEnabled = observeConfigBooleanValue(database, 'ExperimentalTimezone');
    const maxMessageLength = observeConfigIntValue(database, 'MaxPostSize', MAX_MESSAGE_LENGTH_FALLBACK);

    const useChannelMentions = combineLatest([channel, currentUser]).pipe(
        switchMap(([c, u]) => {
            if (!c) {
                return of$(true);
            }

            return u ? observePermissionForChannel(database, c, u, Permissions.USE_CHANNEL_MENTIONS, false) : of$(false);
        }),
    );

    const channelInfo = channel.pipe(switchMap((c) => (c ? c.info.observe() : of$(undefined))));
    const membersCount = channelInfo.pipe(
        switchMap((i) => (i ? of$(i.memberCount) : of$(0))),
    );

    const customEmojis = queryAllCustomEmojis(database).observe();

    return {
        currentUserId,
        enableConfirmNotificationsToChannel,
        isTimezoneEnabled,
        maxMessageLength,
        membersCount,
        userIsOutOfOffice,
        useChannelMentions,
        customEmojis,
    };
});

export default withDatabase(enhanced(SendHandler));


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.jboss.netty.handler.codec.http.websocketx.WebSocketVersion (The Netty Project API Reference (3.3.1.Final))
</TITLE>

<META NAME="date" CONTENT="2012-02-05">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.jboss.netty.handler.codec.http.websocketx.WebSocketVersion

Packages that use WebSocketVersion

org.jboss.netty.handler.codec.http.websocketx
Encoder, decoder, handshakers and their related message types for
 Web Socket data frames.

Uses of WebSocketVersion in org.jboss.netty.handler.codec.http.websocketx

Methods in org.jboss.netty.handler.codec.http.websocketx that return WebSocketVersion

 WebSocketVersion
WebSocketServerHandshaker.getVersion()

          Returns the version of the specification being supported

 WebSocketVersion
WebSocketClientHandshaker.getVersion()

          Version of the web socket specification that is being used

static WebSocketVersion
WebSocketVersion.valueOf(String name)

          Returns the enum constant of this type with the specified name.

static WebSocketVersion[]
WebSocketVersion.values()

          Returns an array containing the constants of this enum type, in
the order they are declared.

Methods in org.jboss.netty.handler.codec.http.websocketx with parameters of type WebSocketVersion

 WebSocketClientHandshaker
WebSocketClientHandshakerFactory.newHandshaker(URI webSocketURL,
              WebSocketVersion version,
              String subprotocol,
              boolean allowExtensions,
              Map<String,String> customHeaders)

          Instances a new handshaker

Constructors in org.jboss.netty.handler.codec.http.websocketx with parameters of type WebSocketVersion

WebSocketClientHandshaker(URI webSocketUrl,
                          WebSocketVersion version,
                          String subprotocol,
                          Map<String,String> customHeaders)

          Base constructor

WebSocketClientHandshaker00(URI webSocketURL,
                            WebSocketVersion version,
                            String subprotocol,
                            Map<String,String> customHeaders)

          Constructor specifying the destination web socket location and version to initiate

WebSocketClientHandshaker08(URI webSocketURL,
                            WebSocketVersion version,
                            String subprotocol,
                            boolean allowExtensions,
                            Map<String,String> customHeaders)

          Constructor specifying the destination web socket location and version to initiate

WebSocketClientHandshaker13(URI webSocketURL,
                            WebSocketVersion version,
                            String subprotocol,
                            boolean allowExtensions,
                            Map<String,String> customHeaders)

          Constructor specifying the destination web socket location and version to initiate

WebSocketServerHandshaker(WebSocketVersion version,
                          String webSocketUrl,
                          String subprotocols)

          Constructor specifying the destination web socket location

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2008-2012 The Netty Project. All Rights Reserved.


text:
var observable_1 = require("data/observable");
var image_source_1 = require("image-source");
var reddit_app_view_model_1 = require("./reddit-app-view-model");
var firstThumbnailImageSource = image_source_1.fromFile("~/res/first-image.png");
var defaultImageSource = image_source_1.fromFile("~/res/reddit-logo-transparent.png");
var ISLOADING = "isLoading";
var THUMBNAIL_IMAGE = "thumbnailImage";
var IMAGE_SOURCE = "imageSource";
var RedditViewModel = (function (_super) {
    __extends(RedditViewModel, _super);
    function RedditViewModel(source) {
        _super.call(this);
        this._isLoading = false;
        this._source = source;
        if (this._source) {
            var property;
            for (property in this._source) {
                this.set(property, this._source[property]);
            }
        }
    }
    Object.defineProperty(RedditViewModel.prototype, "source", {
        get: function () {
            return this._source;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RedditViewModel.prototype, "isLoading", {
        get: function () {
            return this._isLoading;
        },
        set: function (value) {
            if (this._isLoading !== value) {
                this._isLoading = value;
                this.notify({ object: this, eventName: observable_1.Observable.propertyChangeEvent, propertyName: ISLOADING, value: value });
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RedditViewModel.prototype, "thumbnailImage", {
        get: function () {
            var _this = this;
            if (!this._source) {
                return reddit_app_view_model_1.defaultThumbnailImageSource;
            }
            if (this._source.title === "reddit 101") {
                return firstThumbnailImageSource;
            }
            var url = this._source.thumbnail;
            if (!_isValidImageUrl(url)) {
                return reddit_app_view_model_1.defaultNoThumbnailImageSource;
            }
            var image = reddit_app_view_model_1.cache.get(url);
            if (image) {
                return image;
            }
            this.isLoading = true;
            reddit_app_view_model_1.cache.push({
                key: url,
                url: url,
                completed: function (image, key) {
                    if (url === key) {
                        _this.isLoading = false;
                        _this.notify({ object: _this, eventName: observable_1.Observable.propertyChangeEvent, propertyName: THUMBNAIL_IMAGE, value: image });
                    }
                }
            });
            return reddit_app_view_model_1.defaultThumbnailImageSource;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RedditViewModel.prototype, "imageSource", {
        get: function () {
            var _this = this;
            if (this._source) {
                var url;
                try {
                    url = this._source.preview.images[0].source.url;
                }
                catch (e) {
                    url = this._source.url;
                }
                if (_isValidImageUrl(url)) {
                    this.isLoading = true;
                    image_source_1.fromUrl(url).then(function (result) {
                        _this.isLoading = false;
                        _this.notify({ object: _this, eventName: observable_1.Observable.propertyChangeEvent, propertyName: IMAGE_SOURCE, value: result });
                    });
                }
            }
            return defaultImageSource;
        },
        enumerable: true,
        configurable: true
    });
    return RedditViewModel;
})(observable_1.Observable);
exports.RedditViewModel = RedditViewModel;
function _isValidImageUrl(url) {
    return url && (url.indexOf(".png") !== -1 || url.indexOf(".jpg") !== -1);
}


text:
Rails.application.routes.draw do
  root to: 'base#index', only: [:show]
  get '/robots.txt', to: 'base#robots', defaults: { format: 'text' }

  resources :searchs, only: [], path: 'search' do
    collection do
      get :judges
      get :prosecutors
    end
  end

  get 'about', to: 'base#about', as: :about
end