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

namespace QS.Fx.Value
{
    [QS.Fx.Reflection.ValueClass(QS.Fx.Reflection.ValueClasses._c_property)]
    [XmlType("Property")]
    [QS.Fx.Printing.Printable("Property", QS.Fx.Printing.PrintingStyle.Expanded, QS.Fx.Printing.SelectionOption.Explicit)]
    public sealed class Property
    {
        #region Constructor

        public Property(int id, string name, string comment, QS.Fx.Reflection.Xml.ValueClass valueclass, string initialvalue, PropertyDependencyClass dependencyclass,
            PropertyBinding[] sources, PropertyBinding[] destinations)
        {
            this.id = id;
            this.name = name;
            this.comment = comment;
            this.valueclass = valueclass;
            this.initialvalue = initialvalue;
            this.dependencyclass = dependencyclass;
            this.sources = sources;
            this.destinations = destinations;
        }

        public Property()
        {
        }

        #endregion

        #region Fields

        [QS.Fx.Printing.Printable("id")]
        private int id;
        [QS.Fx.Printing.Printable("name")]
        private string name;
        [QS.Fx.Printing.Printable("comment")]
        private string comment;
        [QS.Fx.Printing.Printable("valueclass")]
        private QS.Fx.Reflection.Xml.ValueClass valueclass;
        [QS.Fx.Printing.Printable("initialvalue")]
        private string initialvalue;
        [QS.Fx.Printing.Printable("dependencyclass")]
        private PropertyDependencyClass dependencyclass;
        [QS.Fx.Printing.Printable("sources")]
        private PropertyBinding[] sources;
        [QS.Fx.Printing.Printable("destinations")]
        private PropertyBinding[] destinations;

        #endregion

        #region Accessors

        [XmlAttribute("id")]
        public int Id
        {
            get { return this.id; }
            set { this.id = value; }
        }

        [XmlElement("Name")]
        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }

        [XmlElement("Comment")]
        public string Comment
        {
            get { return this.comment; }
            set { this.comment = value; }
        }

        [XmlElement("DependencyClass")]
        public PropertyDependencyClass DependencyClass
        {
            get { return this.dependencyclass; }
            set { this.dependencyclass = value; }
        }

        [XmlElement("ValueClass")]
        public QS.Fx.Reflection.Xml.ValueClass ValueClass
        {
            get { return this.valueclass; }
            set { this.valueclass = value; }
        }

        [XmlElement("InitialValue")]
        public string InitialValue
        {
            get { return this.initialvalue; }
            set { this.initialvalue = value; }
        }

        [XmlElement("Source")]
        public PropertyBinding[] Sources
        {
            get { return this.sources; }
            set { this.sources = value; }
        }

        [XmlElement("Destination")]
        public PropertyBinding[] Destinations
        {
            get { return this.destinations; }
            set { this.destinations = value; }
        }

        #endregion
    }
}


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.Security.AccessControl
{
  sealed public partial class MutexSecurity : NativeObjectSecurity
  {
    #region Methods and constructors
    public override AccessRule AccessRuleFactory(System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
    {
      return default(AccessRule);
    }

    public void AddAccessRule(MutexAccessRule rule)
    {
    }

    public void AddAuditRule(MutexAuditRule rule)
    {
    }

    public override AuditRule AuditRuleFactory(System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
    {
      return default(AuditRule);
    }

    public MutexSecurity() : base (default(bool), default(ResourceType))
    {
      Contract.Ensures(false);
    }

    public MutexSecurity(string name, AccessControlSections includeSections) : base (default(bool), default(ResourceType))
    {
      Contract.Ensures(false);
    }

    public bool RemoveAccessRule(MutexAccessRule rule)
    {
      return default(bool);
    }

    public void RemoveAccessRuleAll(MutexAccessRule rule)
    {
    }

    public void RemoveAccessRuleSpecific(MutexAccessRule rule)
    {
    }

    public bool RemoveAuditRule(MutexAuditRule rule)
    {
      return default(bool);
    }

    public void RemoveAuditRuleAll(MutexAuditRule rule)
    {
    }

    public void RemoveAuditRuleSpecific(MutexAuditRule rule)
    {
    }

    public void ResetAccessRule(MutexAccessRule rule)
    {
    }

    public void SetAccessRule(MutexAccessRule rule)
    {
    }

    public void SetAuditRule(MutexAuditRule rule)
    {
    }
    #endregion

    #region Properties and indexers
    public override Type AccessRightType
    {
      get
      {
        return default(Type);
      }
    }

    public override Type AccessRuleType
    {
      get
      {
        return default(Type);
      }
    }

    public override Type AuditRuleType
    {
      get
      {
        return default(Type);
      }
    }
    #endregion
  }
}

redpajama_set_name: RedPajamaGithub


text:
package org.edx.mobile.shadows;

import android.os.Handler;

import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;
import org.robolectric.android.util.concurrent.RoboExecutorService;

import roboguice.util.SafeAsyncTask;

/**
 * Shadow for {@link SafeAsyncTask} to ensure that it runs on
 * the Robolectric background @{link org.robolectric.util.Scheduler}
 * to enable instrumentation.
 */
@Implements(SafeAsyncTask.class)
@SuppressWarnings({"unused", "deprecation"})
public class ShadowSafeAsyncTask<ResultT> {
    @RealObject
    private SafeAsyncTask<ResultT> realSafeAsyncTask;

    public void __constructor__() {
        realSafeAsyncTask.executor(new RoboExecutorService());
    }

    public void __constructor__(Handler handler) {
        __constructor__();
        realSafeAsyncTask.handler(handler);
    }
}


text:
package com.fit2cloud.aliyun.rds.model.response;

import com.fit2cloud.aliyun.Response;
import com.fit2cloud.aliyun.rds.model.Databases;

public class DescribeDatabasesResponse extends Response {
	private Databases Databases;

	public Databases getDatabases() {
		return Databases;
	}

	public void setDatabases(Databases databases) {
		Databases = databases;
	}
}


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

using Couchbase.Lite.Internal;
using Couchbase.Lite.Store;
using Couchbase.Lite.Util;

namespace Couchbase.Lite {
    // TODO: Either remove or update the API defs to indicate the enum value changes, and global scope.
    /// <summary>
    /// Indicates the collation to use for sorted items in the view
    /// </summary>
    [Serializable]
    public enum ViewCollation
    {
        /// <summary>
        /// Sort via the unicode standard
        /// </summary>
        Unicode,
        /// <summary>
        /// Raw binary sort
        /// </summary>
        Raw,
        /// <summary>
        /// Sort via ASCII comparison
        /// </summary>
        ASCII
    }

    /// <summary>
    /// A Couchbase Lite <see cref="Couchbase.Lite.View"/>.
    /// A <see cref="Couchbase.Lite.View"/> defines a persistent index managed by map/reduce.
    /// </summary>
    public sealed class View : IViewStoreDelegate {

        #region Constants

        internal const string TAG = "View";
        private const int REDUCE_BATCH_SIZE = 100;

        #endregion

        #region Variables

        private TypedEventHandler<View, EventArgs> _changed;
        internal event TypedEventHandler<View, EventArgs> Changed
        {
            add { _changed = (TypedEventHandler<View, EventArgs>)Delegate.Combine(_changed, value); }
            remove { _changed = (TypedEventHandler<View, EventArgs>)Delegate.Remove(_changed, value); }
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets an object that can compile source code into map and reduce delegates.
        /// </summary>
        public static IViewCompiler Compiler { get; set; }

        /// <summary>
        /// Get the <see cref="Couchbase.Lite.Database"/> that owns the <see cref="Couchbase.Lite.View"/>.
        /// </summary>
        public Database Database { get; private set; }

        /// <summary>
        /// Gets the <see cref="Couchbase.Lite.View"/>'s name.
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// Gets if the <see cref="Couchbase.Lite.View"/>'s indices are currently out of date.
        /// </summary>
        /// <value><c>true</c> if this instance is stale; otherwise, <c>false</c>.</value>
        public bool IsStale { get { return (LastSequenceIndexed < Database.GetLastSequenceNumber()); } }

        /// <summary>
        /// Gets the last sequence number indexed so far.
        /// </summary>
        public long LastSequenceIndexed {
            get {
                return Storage.LastSequenceIndexed;
            }
        }

        /// <summary>
        /// Gets the last sequence that there was a change in the view
        /// </summary>
        public long LastSequenceChangedAt
        {
            get {
                return Storage.LastSequenceChangedAt;
            }
        }

        /// <summary>
        /// Gets the total number of rows present in the view
        /// </summary>
        public int TotalRows {
            get {
                return Storage.TotalRows;
            }
        }

        internal IViewStore Storage { get; private set; }

        internal ViewCollation Collation { get; set; }

        #endregion

        #region Constructors

        internal static View MakeView(Database database, string name, bool create)
        {
            var storage = database.Storage.GetViewStorage(name, create);
            if (storage == null) {
                return null;
            }

            var view = new View();
            view.Storage = storage;
            view.Database = database;
            storage.Delegate = view;
            view.Name = name;

            // means 'unknown'
            view.Collation = ViewCollation.Unicode;
            return view;
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// Defines the <see cref="Couchbase.Lite.View"/>'s <see cref="Couchbase.Lite.MapDelegate"/> and sets
        /// its <see cref="Couchbase.Lite.ReduceDelegate"/> to null.
        /// </summary>
        /// <returns>
        /// True if the <see cref="Couchbase.Lite.MapDelegate"/> was set, otherwise false. If the values provided are
        /// identical to the values that are already set, then the values will not be updated and false will be returned.
        /// In addition, if true is returned, the index was deleted and will be rebuilt on the next
        /// <see cref="Couchbase.Lite.Query"/> execution.
        /// </returns>
        /// <param name="mapDelegate">The <see cref="Couchbase.Lite.MapDelegate"/> to set</param>
        /// <param name="version">
        /// The key of the property value to return. The value of this parameter must change when
        /// the <see cref="Couchbase.Lite.MapDelegate"/> is changed in a way that will cause it to
        /// produce different results.
        /// </param>
        public Boolean SetMap(MapDelegate mapDelegate, string version) {
            return SetMapReduce(mapDelegate, null, version);
        }

        /// <summary>
        /// Defines the View's <see cref="Couchbase.Lite.MapDelegate"/>
        /// and <see cref="Couchbase.Lite.ReduceDelegate"/>.
        /// </summary>
        /// <remarks>
        /// Defines a view's functions.
        /// The view's definition is given as a class that conforms to the Mapper or
        /// Reducer interface (or null to delete the view). The body of the block
        /// should call the 'emit' object (passed in as a paramter) for every key/value pair
        /// it wants to write to the view.
        /// Since the function itself is obviously not stored in the database (only a unique
        /// string idenfitying it), you must re-define the view on every launch of the app!
        /// If the database needs to rebuild the view but the function hasn't been defined yet,
        /// it will fail and the view will be empty, causing weird problems later on.
        /// It is very important that this block be a law-abiding map function! As in other
        /// languages, it must be a "pure" function, with no side effects, that always emits
        /// the same values given the same input document. That means that it should not access
        /// or change any external state; be careful, since callbacks make that so easy that you
        /// might do it inadvertently!  The callback may be called on any thread, or on
        /// multiple threads simultaneously. This won't be a problem if the code is "pure" as
        /// described above, since it will as a consequence also be thread-safe.
        /// </remarks>
        /// <returns>
        /// <c>true</c> if the <see cref="Couchbase.Lite.MapDelegate"/>
        /// and <see cref="Couchbase.Lite.ReduceDelegate"/> were set, otherwise <c>false</c>.
        /// If the values provided are identical to the values that are already set,
        /// then the values will not be updated and <c>false</c> will be returned.
        /// In addition, if <c>true</c> is returned, the index was deleted and
        /// will be rebuilt on the next <see cref="Couchbase.Lite.Query"/> execution.
        /// </returns>
        /// <param name="map">The <see cref="Couchbase.Lite.MapDelegate"/> to set.</param>
        /// <param name="reduce">The <see cref="Couchbase.Lite.ReduceDelegate"/> to set.</param>
        /// <param name="version">
        /// The key of the property value to return. The value of this parameter must change
        /// when the <see cref="Couchbase.Lite.MapDelegate"/> and/or <see cref="Couchbase.Lite.ReduceDelegate"/>
        /// are changed in a way that will cause them to produce different results.
        /// </param>
        public bool SetMapReduce(MapDelegate map, ReduceDelegate reduce, string version) {
            System.Diagnostics.Debug.Assert(map != null);
            System.Diagnostics.Debug.Assert(version != null); // String.Empty is valid.

            var changed = version != MapVersion;
            var shared = Database.Shared;
            shared.SetValue("map", Name, Database.Name, map);
            shared.SetValue("mapVersion", Name, Database.Name, version);
            shared.SetValue("reduce", Name, Database.Name, reduce);

            if (changed) {
                Storage.SetVersion(version);
                if (_changed != null) {
                    _changed(this, null);
                }
            }

            return changed;
        }

        /// <summary>
        /// Deletes the <see cref="Couchbase.Lite.View"/>'s persistent index.
        /// The index is regenerated on the next <see cref="Couchbase.Lite.Query"/> execution.
        /// </summary>
        public void DeleteIndex()
        {
            Storage.DeleteIndex();
        }

        /// <summary>
        /// Updates the <see cref="Couchbase.Lite.View"/>'s persistent index.  Indexing
        /// scans all documents that have changed since the last time the index was updated.
        /// The body of each document is passed to the view's map callback, and any emitted
        /// rows are added to the index.  Any existing rows previously emitted by those documents,
        /// that weren't re-emitted this time, are removed.
        /// </summary>
        public void UpdateIndex()
        {
            var status = UpdateIndex_Internal();
            if(status.IsError) {
                Log.To.View.W(TAG, "Error updating index of {0} ({1})", Name, status);
            }
        }

        /// <summary>
        /// Deletes the <see cref="Couchbase.Lite.View"/>.
        /// </summary>
        public void Delete()
        {
            Storage.DeleteView();
            Database.ForgetView(Name);
            //_updateQueueLock.Release();
            Close();
        }

        /// <summary>
        /// Creates a new <see cref="Couchbase.Lite.Query"/> for this view.
        /// </summary>
        /// <returns>A new <see cref="Couchbase.Lite.Query"/> for this view.</returns>
        public Query CreateQuery() {
            return new Query(Database, this);
        }

        #endregion

        #region Internal Methods

        internal void Close()
        {
            Storage.Close();
            Storage = null;
            Database = null;
        }

        internal Status UpdateIndex_Internal()
        {
            var status = new Status(StatusCode.Unknown);
            try {
                status.Code = Storage.UpdateIndexes(ViewsInGroup().Select(x => x.Storage)) ? StatusCode.Ok :
                    StatusCode.DbError;
            } catch(Exception e) {
                var innerException = Misc.Flatten(e).First() as CouchbaseLiteException;
                if (innerException != null) {
                    status.Code = innerException.Code;
                } else {
                    status.Code = StatusCode.Exception;
                }
            }

            return status;
        }

        /// <summary>Queries the view.</summary>
        /// <remarks>Queries the view. Does NOT first update the index.</remarks>
        /// <param name="options">The options to use.</param>
        /// <returns>An array of QueryRow objects.</returns>
        /// <exception cref="Couchbase.Lite.CouchbaseLiteException"></exception>
        internal IEnumerable<QueryRow> QueryWithOptions(QueryOptions options)
        {
            if (options == null) {
                options = new QueryOptions();
            }

            IEnumerable<QueryRow> iterator = null;
            if (false) {
                //TODO: Full text
            } else if (GroupOrReduce(options)) {
                iterator = Storage.ReducedQuery(options);
            } else {
                iterator = Storage.RegularQuery(options);
            }

            if (iterator != null) {
                Log.To.Query.I(TAG, "Query {0}: Returning iterator", Name);
            } else {
                Log.To.Query.I(TAG, "Query {0}: Failed", Name);
            }

            return iterator;
        }

        internal Status CompileFromDesignDoc()
        {
            MapDelegate map;
            if (Database.Shared.TryGetValue("map", Name, Database.Name, out map)) {
                return new Status(StatusCode.Ok);
            }

            string language = null;
            var viewProps = Database.GetDesignDocFunction(Name, "views", out language).AsDictionary<string, object>();
            if (viewProps == null) {
                return new Status(StatusCode.NotFound);
            }

            Log.To.View.I(TAG, "{0}: Attempting to compile {1} from design doc", Name, language);
            if (Compiler == null) {
                return new Status(StatusCode.NotImplemented);
            }

            return Compile(viewProps, language);
        }

        internal Status Compile(IDictionary<string, object> viewProps, string language)
        {
            language = language ?? "javascript";
            string mapSource = viewProps.Get("map") as string;
            if (mapSource == null) {
                return new Status(StatusCode.NotFound);
            }

            MapDelegate mapDelegate = Compiler.CompileMap(mapSource, language);
            if (mapDelegate == null) {
                Log.To.View.W(TAG, "{0} could not compile {1} map fn: {2}", Name, language,
                    new SecureLogString(mapSource, LogMessageSensitivity.PotentiallyInsecure));
                return new Status(StatusCode.CallbackError);
            }

            string reduceSource = viewProps.Get("reduce") as string;
            ReduceDelegate reduceDelegate = null;
            if (reduceSource != null) {
                reduceDelegate = Compiler.CompileReduce(reduceSource, language);
                if (reduceDelegate == null) {
                    Log.To.View.W(TAG, "{0} could not compile {1} reduce fn: {2}", Name, language,
                        new SecureLogString(reduceSource, LogMessageSensitivity.PotentiallyInsecure));
                    return new Status(StatusCode.CallbackError);
                }
            }

            string version = Misc.HexSHA1Digest(Manager.GetObjectMapper().WriteValueAsBytes(viewProps));
            SetMapReduce(mapDelegate, reduceDelegate, version);
            DocumentType = viewProps.GetCast<string>("documentType");

            var options = viewProps.Get("options").AsDictionary<string, object>();
            Collation = ViewCollation.Unicode;
            if (options != null && options.ContainsKey("collation")) {
                string collation = options["collation"] as string;
                if (collation.ToLower().Equals("raw")) {
                    Collation = ViewCollation.Raw;
                }
            }

            return new Status(StatusCode.Ok);
        }

        #endregion

        #region Private Methods

        private IEnumerable<View> ViewsInGroup()
        {
            var groupName = GroupName();
            if(groupName != null) {
                return Database.GetAllViews().Where(v => v.Name.StartsWith(groupName));
            } else {
                return new List<View> { this };
            }
        }

        private string GroupName()
        {
            var slash = Name.IndexOf('/');
            if (slash != -1) {
                return Name.Substring(0, slash);
            }

            return null;
        }

        private bool GroupOrReduce(QueryOptions options) {
            if (options.Group|| options.GroupLevel> 0) {
                return true;
            }

            if (options.ReduceSpecified) {
                return options.Reduce;
            }

            return Reduce != null;
        }

        #endregion

        #region IViewStoreDelegate
        #pragma warning disable 1591

        public MapDelegate Map
        {
            get
            {
                MapDelegate map;
                if (!Database.Shared.TryGetValue("map", Name, Database.Name, out map)) {
                    map = null;
                    if (CompileFromDesignDoc().IsSuccessful) {
                        map = Map;
                    }
                }

                return map;
            }
        }

        public ReduceDelegate Reduce
        {
            get {
                ReduceDelegate retVal;
                if (!Database.Shared.TryGetValue("reduce", Name, Database.Name, out retVal)) {
                    return null;
                }

                return retVal;
            }
        }

        public string MapVersion
        {
            get {
                string retVal;
                if (!Database.Shared.TryGetValue("mapVersion", Name, Database.Name, out retVal)) {
                    return null;
                }

                return retVal;
            }
        }

        public string DocumentType {
            get {
                string retVal;
                if(!Database.Shared.TryGetValue("docType", Name, Database.Name, out retVal)) {
                    return null;
                }

                return retVal;
            }
            set {
                Database.Shared.SetValue("docType", Name, Database.Name, value);
            }
        }

        #pragma warning restore 1591
        #endregion

    }

    /// <summary>
    /// An object that can be used to compile source code into map and reduce delegates.
    /// </summary>
    public interface IViewCompiler
    {

        //Methods
        /// <summary>
        /// Compiles source code into a <see cref="Couchbase.Lite.MapDelegate"/>.
        /// </summary>
        /// <returns>A compiled <see cref="Couchbase.Lite.MapDelegate"/>.</returns>
        /// <param name="source">The source code to compile into a <see cref="Couchbase.Lite.MapDelegate"/>.</param>
        /// <param name="language">The language of the source.</param>
        MapDelegate CompileMap(string source, string language);

        /// <summary>
        /// Compiles source code into a <see cref="Couchbase.Lite.ReduceDelegate"/>.
        /// </summary>
        /// <returns>A compiled <see cref="Couchbase.Lite.ReduceDelegate"/>.</returns>
        /// <param name="source">The source code to compile into a <see cref="Couchbase.Lite.ReduceDelegate"/>.</param>
        /// <param name="language">The language of the source.</param>
        ReduceDelegate CompileReduce(string source, string language);

    }

    #region Global Delegates

    /// <summary>
    /// A delegate that is invoked when a <see cref="Couchbase.Lite.Document"/>
    /// is being added to a <see cref="Couchbase.Lite.View"/>.
    /// </summary>
    /// <param name="document">The <see cref="Couchbase.Lite.Document"/> being mapped.</param>
    /// <param name="emit">The delegate to use to add key/values to the <see cref="Couchbase.Lite.View"/>.</param>
    public delegate void MapDelegate(IDictionary<string, object> document, EmitDelegate emit);

    /// <summary>
    /// A delegate that can be invoked to add key/values to a <see cref="Couchbase.Lite.View"/>
    /// during a <see cref="Couchbase.Lite.MapDelegate"/> call.
    /// </summary>
    /// <param name="key">The key.</param>
    /// <param name="value">The value.</param>
    public delegate void EmitDelegate(object key, object value);

    /// <summary>
    /// A delegate that can be invoked to summarize the results of a <see cref="Couchbase.Lite.View"/>.
    /// </summary>
    /// <param name="keys">A list of keys to be reduced, or null if this is a rereduce.</param>
    /// <param name="values">A parallel array of values to be reduced, corresponding 1-to-1 with the keys.</param>
    /// <param name="rereduce"><c>true</c> if the input values are the results of previous reductions, otherwise <c>false</c>.</param>
    public delegate object ReduceDelegate(IEnumerable<object> keys, IEnumerable<object> values, Boolean rereduce);

    #endregion
}


text:
class SeriesController < ApplicationController
  def index
    @series = Series.all.order(series_sequence: :asc)
  end

  def show
    @series = Series.includes([:seasons]).find(params[:id])
    @seasons = @series.seasons
  end
end


text:
package org.kie.workbench.common.screens.datasource.management.backend.core.wildfly;

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

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.kie.workbench.common.screens.datasource.management.backend.core.DataSourceProviderBaseTest;
import org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef;
import org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceManagementClient;
import org.kie.workbench.common.screens.datasource.management.model.DataSourceDef;
import org.kie.workbench.common.screens.datasource.management.model.DataSourceDeploymentInfo;
import org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

@RunWith(MockitoJUnitRunner.class)
public class WildflyDataSourceProviderTest
        extends DataSourceProviderBaseTest {

    @Mock
    private WildflyDataSourceManagementClient managementClient;

    @Mock
    private WildflyDriverProvider wfDriverProvider;

    private List< WildflyDataSourceDef > wfDataSources;

    @Mock
    protected DriverDeploymentInfo driverDeploymentInfo;

    @Mock
    protected DataSourceDeploymentInfo dataSourceDeploymentInfo;

    @Mock
    protected javax.sql.DataSource sqlDataSource;

    @Before
    public void setup() throws Exception {
        super.setup();
        driverProvider = wfDriverProvider;
        dataSourceProvider = new WildflyDataSourceProvider(wfDriverProvider) {
            @Override
            protected Object jndiLookupDataSource(String jndi) {
                return sqlDataSource;
            }

            @Override
            protected String generateRandomUUID() {
                return RANDOM_UUID;
            }
        };

        ((WildflyDataSourceProvider) dataSourceProvider).setDataSourceMgmtClient(managementClient);

        wfDataSources = createWFDataSources();
    }

    @Override
    public void testDeployDataSource() throws Exception {
        super.testDeployDataSource();
        // additional check
        // expected WF data source definition that should be created in the WF server.
        WildflyDataSourceDef wfDataSource = new WildflyDataSourceDef();
        wfDataSource.setName(DeploymentIdGenerator.generateDeploymentId(dataSourceDef));
        wfDataSource.setConnectionURL(dataSourceDef.getConnectionURL());
        wfDataSource.setUser(dataSourceDef.getUser());
        wfDataSource.setPassword(dataSourceDef.getPassword());
        wfDataSource.setDriverName(DRIVER1_DEPLOYMENT_ID);
        wfDataSource.setJndi(JndiNameGenerator.generateJNDIName(dataSourceDef));

        // the expected WF data source definition should have been created in the WF server.
        ArgumentCaptor< WildflyDataSourceDef > argumentCaptor = ArgumentCaptor.forClass(WildflyDataSourceDef.class);
        verify(managementClient,
               times(1)).createDataSource(argumentCaptor.capture());
        if (!areTheSame(wfDataSource,
                        argumentCaptor.getValue())) {
            fail("Data source definition wasn't properly created in the WF server: " + wfDataSource);
        }
    }

    @Override
    protected void setupDrivers() throws Exception {
        // driver information that will be returned for this case.
        when(driverProvider.getDeploymentInfo(DRIVER1_UUID)).thenReturn(driverDeploymentInfo);
        when(driverDeploymentInfo.getDriverDeploymentId()).thenReturn(DRIVER1_DEPLOYMENT_ID);
    }

    @Override
    protected void deployDataSource(DataSourceDef dataSourceDef) throws Exception {
        when(managementClient.getDataSources()).thenReturn(wfDataSources);
        dataSourceProvider.deploy(dataSourceDef);
    }

    @Override
    protected void unDeployDataSource(DataSourceDeploymentInfo deploymentInfo) throws Exception {
        // un-deploy the data source.
        dataSourceProvider.undeploy(deploymentInfo);
        wfDataSources.remove(0);
    }

    /**
     * Tests a data source un-deployment.
     */
    @Test
    public void testUnDeployDataSource() throws Exception {
        super.testUnDeployDataSource();
        // additional check
        // the data source should have been deleted from the WF server by using the management client.
        ArgumentCaptor< String > argumentCaptor = ArgumentCaptor.forClass(String.class);
        verify(managementClient,
               times(1)).deleteDataSource(argumentCaptor.capture());
        assertEquals(DS1_DEPLOYMENT_ID,
                     argumentCaptor.getValue());
    }

    /**
     * Tests the resync of a data source.
     */
    @Test
    public void testDataSourceResync() throws Exception {
        when(managementClient.getDataSources()).thenReturn(wfDataSources);
        when(dataSourceDeploymentInfo.getJndi()).thenReturn(DS1_JNID);
        when(dataSourceDeploymentInfo.getDeploymentId()).thenReturn(DS1_DEPLOYMENT_ID);

        DataSourceDeploymentInfo deploymentInfo = dataSourceProvider.getDeploymentInfo(DS1_UUID);

        // the data source deployment info should exist, but it's not managed.
        assertNotNull(deploymentInfo);
        assertFalse(deploymentInfo.isManaged());

        dataSourceProvider.resync(dataSourceDef,
                                  dataSourceDeploymentInfo);
        deploymentInfo = dataSourceProvider.getDeploymentInfo(DS1_UUID);
        // after the resync the data source should have been tagged as managed.
        assertNotNull(deploymentInfo);
        assertTrue(deploymentInfo.isManaged());
    }

    /**
     * Tests that the provider is properly initialized.
     */
    @Test
    public void testHasStartedOk() throws Exception {
        when(managementClient.testConnection()).thenReturn(METHOD_EXECUTION_OK);
        when(managementClient.getDataSources()).thenReturn(Collections.EMPTY_LIST);
        dataSourceProvider.hasStarted();
        verify(managementClient,
               times(1)).testConnection();
        verify(managementClient,
               times(1)).getDataSources();
    }

    /**
     * Tests the case when the connection fails.
     */
    @Test
    public void testHasStartedWithError1() throws Exception {
        when(managementClient.testConnection()).thenThrow(new Exception(METHOD_EXECUTION_FAILED));
        when(managementClient.getDataSources()).thenReturn(Collections.EMPTY_LIST);
        expectedException.expectMessage(METHOD_EXECUTION_FAILED);
        dataSourceProvider.hasStarted();
        verify(managementClient,
               times(1)).testConnection();
        verify(managementClient,
               never()).getDataSources();
    }

    /**
     * Tests the case when the data sources retrieval fails.
     */
    @Test
    public void testHasStartedWithError2() throws Exception {
        when(managementClient.testConnection()).thenReturn(METHOD_EXECUTION_OK);
        when(managementClient.getDataSources()).thenThrow(new Exception(METHOD_EXECUTION_FAILED));
        expectedException.expectMessage(METHOD_EXECUTION_FAILED);
        dataSourceProvider.hasStarted();
        verify(managementClient,
               times(1)).testConnection();
        verify(managementClient,
               times(1)).getDataSources();
    }

    private boolean areTheSame(WildflyDataSourceDef expectedDef,
                               WildflyDataSourceDef currentDef) {
        return currentDef != null &&
                currentDef.getName().startsWith(expectedDef.getName()) &&
                currentDef.getDriverName().equals(expectedDef.getDriverName()) &&
                currentDef.getJndi().startsWith(expectedDef.getJndi()) &&
                currentDef.getConnectionURL().equals(expectedDef.getConnectionURL()) &&
                currentDef.getUser().equals(expectedDef.getUser()) &&
                currentDef.isUseJTA() == currentDef.isUseJTA();
    }

    private List< WildflyDataSourceDef > createWFDataSources() {
        // emulates the data sources deployments information returned by the WF server.
        List< WildflyDataSourceDef > result = new ArrayList<>();

        WildflyDataSourceDef dataSourceDef = new WildflyDataSourceDef();
        dataSourceDef.setName(DS1_DEPLOYMENT_ID);
        dataSourceDef.setDriverName(DRIVER1_DEPLOYMENT_ID);
        dataSourceDef.setConnectionURL(DS1_CONNECTION_URL);
        dataSourceDef.setPassword(DS1_PASSWORD);
        dataSourceDef.setUser(DS1_USER);
        dataSourceDef.setJndi(DS1_JNID);
        result.add(dataSourceDef);

        dataSourceDef = new WildflyDataSourceDef();
        dataSourceDef.setName(DS2_DEPLOYMENT_ID);
        dataSourceDef.setDriverName(DRIVER1_DEPLOYMENT_ID);
        dataSourceDef.setConnectionURL(DS2_CONNECTION_URL);
        dataSourceDef.setPassword(DS2_PASSWORD);
        dataSourceDef.setUser(DS2_USER);
        dataSourceDef.setJndi(DS2_JNID);

        result.add(dataSourceDef);
        return result;
    }
}


text:
.small-popup-processes {
    position: absolute;
    z-index: 2000;
    background-color: #404345;
    width: 540px;
    left: 50%;
    margin-left: -276px;
  }

  .small-popup-processes > header {
    text-align: center;
    height: 34px;
    background-color: #5d5f61;
    cursor: default;
  }

  .small-popup-processes > header h2 {
    margin: 0;
    line-height: 34px;
    font-size: 16px;
    color: #d1d1d1;
    font-weight: normal;
  }

  .small-popup-processes > header i {
    width: 36px;
    text-align: center;
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    height: 34px;
    line-height: 34px;
    font-size: 13px;
    cursor: pointer;
    color: #393b3d;
  }

  .small-popup-processes > header i:hover {
    color: #9e9c9c;
  }

  .small-popup-processes > section {
    padding: 25px 33px;
    border-bottom: 1px solid #323436;
  }

  .small-popup-processes > footer {
    padding: 20px 29px;
    text-align: right;
  }

  .small-popup-processes > footer button {
    vertical-align: middle;
  }

  .small-popup-processes > footer button:first-child {
    margin-right: 4px;
  }

  .small-popup-processes[role="small-popup-processes"] {
    top: 47px;
  }

  .small-popup-processes[role="small-popup-processes"] [role="actions"] > h3 {
    font-size: 14px;
    color: #000;
    margin: 0 0 3px;
  }

  .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table {
    margin-bottom: 10px;
  }

  .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .thead .tr .cell:first-of-type, .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .thead .tr .cell:nth-of-type(2), .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .tbody .tr .cell:first-of-type, .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .tbody .tr .cell:nth-of-type(2) {
    width: 130px;
  }

  .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .tbody .tr .cell:nth-of-type(3) {
    width: 63px;
  }

  .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .tbody .tr .cell:nth-of-type(7), .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .tbody .tr .cell:nth-of-type(8) {
    width: 18px;
  }

  .small-popup-processes[role="small-popup-processes"] [role="actions"] .pmap-table .tbody .tr .cell:last-child {
    padding-right: 10px;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-group {
    margin-bottom: 18px;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-checkbox {
    margin-right: 56px;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-checkbox {
    padding-left: 158px;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-checkbox:before, .small-popup-processes[role="small-popup-processes"] section .has-checkbox:after {
    content: " ";
    display: table;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-checkbox:after {
    clear: both;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-checkbox .form-checkbox {
    float: left;
    margin-left: -158px;
    width: 158px;
    margin-right: 0;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-checkbox .form-control {
    float: left;
    width: 100%;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-form-label:before, .small-popup-processes[role="small-popup-processes"] section .has-form-label:after {
    content: " ";
    display: table;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-form-label:after {
    clear: both;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-form-label .form-label {
    width: 100%;
    float: left;
  }

  .small-popup-processes[role="small-popup-processes"] section .has-form-label .form-control {
    width: 100%;
    float: left;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-horizontal .form-group:first-child {
    width: 100%;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-horizontal .form-group:before, .small-popup-processes[role="small-popup-processes"] section .form-horizontal .form-group:after {
    content: " ";
    display: table;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-horizontal .form-group:after {
    clear: both;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-horizontal .form-group .col {
    float: left;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-horizontal .form-group .col:first-child {
    width: 330px;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-horizontal .form-group .col:first-child + .col {
    width: 212px;
    text-align: right;
  }

  .small-popup-processes[role="small-popup-processes"] section:nth-of-type(2) {
    padding-top: 16px;
  }

  .small-popup-processes[role="small-popup-processes"] section:nth-of-type(3) {
    padding-top: 14px;
  }

  .small-popup-processes[role="small-popup-processes"] section .form-group:last-child {
    margin-bottom: 0;
  }


text:
This is a system for the sales staff in your company to add their customer leads and log thier activities while they can edit the customer details and their log activity details.

## Built With

I have used the following technologies and libraries/frameworks to complete this project:
* MVC, Codeigniter- frameworks used
* Jquery, Angular JS, bootstraps - Libraries used
* PHP, MySQL, HTML 5, AJAX, CSS, JAVASCRIPT - Technologies used

## Deployment

This is system consists of two interfaces :

### Interface One

* This interface shows you the customer search bar
* Then you can search the customer by name and there will appear a table including customer details ,
* Secondly , you will see only the customer details , but at the end of each raw there will be seperate links for the contact and activities as well
* If you go each link, then you will be able to view contacts table and the activity table too.

### Interface Two

* This interface consists of all the editing forms of above three categories , which are customer, contact and activities.
* At the end of each raw in each table , there will be an edit button , this button will lead you to second interface which are edit sections of each table .

## Authors

* **Tharini Wickramapala** -
* [ThariniDil](https://github.com/ThariniDil/thdilw)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
{% extends "_layout.html" %}
{% load compressed %}
{% block page_title %}{{ choropleth.name }}{% endblock page_title %}

{% block header %}{{ choropleth.name }}{% endblock header %}

{% block control-btns %}
    {% if choropleth.dataset.published or choropleth.owner == user %}

            <button class="btn navigate"> Dataset</button>

    {% endif %}

    {% if choropleth.owner.id == user.id %}

            <button class="btn action"> Edit</button>

    {% endif %}
{% endblock control-btns %}

{% block content %}
    {% with noHorizontalRule=True %}
    {{ block.super }}
    {% endwith %}

        <form ng-controller="ViewController" ng-init="init({{ choropleth.id }})">
            {% include  'choropleths/_choropleth.html' %}
            <markdown description="choropleth.description"></markdown>
        </form>

{% endblock content %}

{% block scripts %}
    {% compressed_js 'map-vendor' %}
    {% compressed_js 'map' %}
{% endblock scripts %}


text:
/*
 * This file is generated by jOOQ.
 */
package com.epam.ta.reportportal.jooq.tables;

import com.epam.ta.reportportal.jooq.Indexes;
import com.epam.ta.reportportal.jooq.JPublic;
import com.epam.ta.reportportal.jooq.Keys;
import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord;

import java.util.Arrays;
import java.util.List;

import javax.annotation.processing.Generated;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row4;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.TableImpl;

/**
 * This class is generated by jOOQ.
 */
@Generated(
    value = {
        "http://www.jooq.org",
        "jOOQ version:3.12.4"
    },
    comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class JOauthRegistrationRestriction extends TableImpl<JOauthRegistrationRestrictionRecord> {

    private static final long serialVersionUID = -973937527;

    /**
     * The reference instance of public.oauth_registration_restriction
     */
    public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = new JOauthRegistrationRestriction();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<JOauthRegistrationRestrictionRecord> getRecordType() {
        return JOauthRegistrationRestrictionRecord.class;
    }

    /**
     * The column public.oauth_registration_restriction.id.
     */
    public final TableField<JOauthRegistrationRestrictionRecord, Integer> ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_registration_restriction_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, "");

    /**
     * The column public.oauth_registration_restriction.oauth_registration_fk.
     */
    public final TableField<JOauthRegistrationRestrictionRecord, String> OAUTH_REGISTRATION_FK = createField(DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, "");

    /**
     * The column public.oauth_registration_restriction.type.
     */
    public final TableField<JOauthRegistrationRestrictionRecord, String> TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, "");

    /**
     * The column public.oauth_registration_restriction.value.
     */
    public final TableField<JOauthRegistrationRestrictionRecord, String> VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, "");

    /**
     * Create a public.oauth_registration_restriction table reference
     */
    public JOauthRegistrationRestriction() {
        this(DSL.name("oauth_registration_restriction"), null);
    }

    /**
     * Create an aliased public.oauth_registration_restriction table reference
     */
    public JOauthRegistrationRestriction(String alias) {
        this(DSL.name(alias), OAUTH_REGISTRATION_RESTRICTION);
    }

    /**
     * Create an aliased public.oauth_registration_restriction table reference
     */
    public JOauthRegistrationRestriction(Name alias) {
        this(alias, OAUTH_REGISTRATION_RESTRICTION);
    }

    private JOauthRegistrationRestriction(Name alias, Table<JOauthRegistrationRestrictionRecord> aliased) {
        this(alias, aliased, null);
    }

    private JOauthRegistrationRestriction(Name alias, Table<JOauthRegistrationRestrictionRecord> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""));
    }

    public <O extends Record> JOauthRegistrationRestriction(Table<O> child, ForeignKey<O, JOauthRegistrationRestrictionRecord> key) {
        super(child, key, OAUTH_REGISTRATION_RESTRICTION);
    }

    @Override
    public Schema getSchema() {
        return JPublic.PUBLIC;
    }

    @Override
    public List<Index> getIndexes() {
        return Arrays.<Index>asList(Indexes.OAUTH_REGISTRATION_RESTRICTION_PK, Indexes.OAUTH_REGISTRATION_RESTRICTION_UNIQUE);
    }

    @Override
    public Identity<JOauthRegistrationRestrictionRecord, Integer> getIdentity() {
        return Keys.IDENTITY_OAUTH_REGISTRATION_RESTRICTION;
    }

    @Override
    public UniqueKey<JOauthRegistrationRestrictionRecord> getPrimaryKey() {
        return Keys.OAUTH_REGISTRATION_RESTRICTION_PK;
    }

    @Override
    public List<UniqueKey<JOauthRegistrationRestrictionRecord>> getKeys() {
        return Arrays.<UniqueKey<JOauthRegistrationRestrictionRecord>>asList(Keys.OAUTH_REGISTRATION_RESTRICTION_PK, Keys.OAUTH_REGISTRATION_RESTRICTION_UNIQUE);
    }

    @Override
    public List<ForeignKey<JOauthRegistrationRestrictionRecord, ?>> getReferences() {
        return Arrays.<ForeignKey<JOauthRegistrationRestrictionRecord, ?>>asList(Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY);
    }

    public JOauthRegistration oauthRegistration() {
        return new JOauthRegistration(this, Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY);
    }

    @Override
    public JOauthRegistrationRestriction as(String alias) {
        return new JOauthRegistrationRestriction(DSL.name(alias), this);
    }

    @Override
    public JOauthRegistrationRestriction as(Name alias) {
        return new JOauthRegistrationRestriction(alias, this);
    }

    /**
     * Rename this table
     */
    @Override
    public JOauthRegistrationRestriction rename(String name) {
        return new JOauthRegistrationRestriction(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public JOauthRegistrationRestriction rename(Name name) {
        return new JOauthRegistrationRestriction(name, null);
    }

    // -------------------------------------------------------------------------
    // Row4 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row4<Integer, String, String, String> fieldsRow() {
        return (Row4) super.fieldsRow();
    }
}


text:
package NestedLoops.Lab;

public class MultiplicationTable {
    public static void main(String[] args) {
        for (int multiplicand = 1; multiplicand <= 10; multiplicand++){
            for (int multiplier = 1; multiplier <= 10; multiplier++){
                int product = multiplicand * multiplier;
                System.out.printf("%d * %d = %d%n", multiplicand, multiplier, product);
            }
        }
    }
}


text:
chancecoin
===========

A coin for betting in a decentralized casino

See http://chancecoin.com


text:
import Control.Arrow

-- HOWTO run through GHC interactive:
-- ghci > :l 01-terse.hs > main

main = do
    text <- readFile "input.txt"
    (lines >>> map (read :: String -> Int) >>> searchSumTwo >>> show >>> putStrLn) $ text

searchSumTwo :: [Int] -> Int
searchSumTwo (x:xs) = if (2020 - x) `elem` xs then (2020 - x) * x else searchSumTwo xs


text:
- upgrade to new version of `tmux-test`
- bug: when using `emacs` copy mode, Enter does not quit screen after tpm
  installation/update. Fix by making `Escape` the key for emacs mode.
- add a doc with troubleshooting instructions
- add `.gitattributes` file that forces linefeed characters (classic `\n`) as
  line endings - helps with misconfigured git on windows/cygwin
- readme update: announce Cygwin support
- un-deprecate old plugin definition syntax: `set -g @tpm_plugins`

### v3.0.0, 2015-08-03
- refactor `shared_set_tpm_path_constant` function
- move all instructions to `docs/` dir
- add `bin/install_plugins` cli executable script
- improved test runner function
- switch to using [tmux-test](https://github.com/tmux-plugins/tmux-test)
  framework
- add `bin/update_plugins` cli executable script
- refactor test `expect` scripts, make them simpler and ensure they properly
  assert expectations
- refactor code that sets 'TMUX_PLUGIN_MANAGER_PATH' global env var
- stop using global variable for 'tpm path'
- support defining plugins via `set -g @plugin` in sourced files as well

### v2.0.0, 2015-07-07
- enable overriding default key bindings
- start using `C-c` to clear screen
- add uninstall/clean procedure and keybinding (prefix+alt+u) (@chilicuil)
- add new `set @plugin 'repo'` plugin defintion syntax (@chilicuil)
- revert back to using `-g` flag in new plugin definition syntax
- permit leading whitespace with new plugin definition syntax (thanks @chilicuil)
- make sure `TMUX_PLUGIN_MANAGER_PATH` always has trailng slash
- ensure old/deprecated plugin syntax `set -g @tpm_plugins` works alongside new
  `set -g @plugin` syntax

### v1.2.2, 2015-02-08
- set GIT_TERMINAL_PROMPT=0 when doing `git clone`, `pull` or `submodule update`
  to ensure git does not prompt for username/password in any case

### v1.2.1, 2014-11-21
- change the way plugin name is expanded. It now uses the http username
  and password by default, like this: `https://git::@github.com/`. This prevents
  username and password prompt (and subsequently tmux install hanging) with old
  git versions. Fixes #7.

### v1.2.0, 2014-11-20
- refactor tests so they can be used on travis
- add travis.yml, add travis badge to the readme

### v1.1.0, 2014-11-19
- if the plugin is not downloaded do not source it
- remove `PLUGINS.md`, an obsolete list of plugins
- update readme with instructions about uninstalling plugins
- tilde char and `$HOME` in `TMUX_SHARED_MANAGER_PATH` couldn't be used because
  they are just plain strings. Fixing the problem by manually expanding them.
- bugfix: fragile `*.tmux` file globbing (@majutsushi)

### v1.0.0, 2014-08-05
- update readme because of github organization change to
  [tmux-plugins](https://github.com/tmux-plugins)
- update tests to pass
- update README to suggest different first plugin
- update list of plugins in the README
- remove README 'about' section
- move key binding to the main file. Delete `key_binding.sh`.
- rename `display_message` -> `echo_message`
- installing plugins installs just new plugins. Already installed plugins aren't
  updated.
- add 'update plugin' binding and functionality
- add test for updating a plugin

### v0.0.2, 2014-07-17
- run all *.tmux plugin files as executables
- fix all redirects to /dev/null
- fix bug: TPM shared path is created before sync (cloning plugins from github
  is done)
- add test suite running in Vagrant
- add Tmux version check. `TPM` won't run if Tmux version is less than 1.9.

### v0.0.1, 2014-05-21
- get TPM up and running


text:
<button class="button action-preview {% if icon %}icon icon-view{% endif %}"
    data-action="{% url 'wagtailadmin_pages:preview_on_edit' page.id %}{% if mode %}?mode={{ mode|urlencode }}{% endif %}"
    data-placeholder="{% url 'wagtailadmin_pages:preview' %}">{{ label }}</button>


text:
__1. Who is the audience? (e.g. project manager, contributor, project user, visitor, etc.)__

Visitors are the main audience - the visitor can get an idea about the overall activity of the entire project by the frequency of the commits over time, as well as the level of involvement by the individual contributors.

__2. What data have been used? How can you get the data using the GitHub API? (Note that it can be the combination of multiple queries and their processing).__

Repositories/Collaborators data is used to get all the users. Stats for commit counts.

GitHub API:

GET /repos/:owner/:repo/collaborators
GET /repos/:owner/:repo/stats/contributors

__3. Those visualizations are updated over time. What happens if suddenly a contributor pushes many commits in a short time interval? How would you address this particular issue?__

A spike in the graph will increase the y-axis range, flattening the features of other commits.  One way to solve this is to use log scale, so the rest of the commit patterns with the lower frequencies can be visible.

### Commits

__1. Who is the audience?__

As with the "Contributors" page, visitors are the main audience here, allowing the exact number of commits during certain time period (binned days by histogram, commits on a particular day on line plot).

__2. What data have been used?__

Contributors and commit activity stats were used to draw the activities.

GET /repos/:owner/:repo/stats/contributors
GET /repos/:owner/:repo/stats/commit_activity
GET /repos/:owner/:repo/stats/participation

__3. What happens if suddenly a contributor pushes many commits in a short time interval?__

As with the Contributors, a spike in the graph will increase the y-axis range, obscuring the smaller features.  As with the solution above, log scale will help.

### Code Frequency

__1. Who is the audience?__

Both project manager and visitors will benefit from this graph.  The amount of added/deleted code will show both the magnitude of the change and how much of the existing code has been replaced versus how much code was added.

__2. What data have been used?__

There is a code frequency data from stats API.

GET /repos/:owner/:repo/stats/code_frequency

__3. What happens if suddenly a contributor pushes many commits in a short time interval?__

As with the Contributors and Commits, a spike in the graph will increase the y-axis range, obscuring the smaller features.  As with the solution above, log scale will help.

### Punch Card

__1. Who is the audience?__

This view is more useful for the project manager and contributor - it shows the working patterns of the team.

__2. What data have been used?__

There is a summary statistics of commit numbers for days and hours of a week.

GET /repos/:owner/:repo/stats/punch_card

__3. What happens if suddenly a contributor pushes many commits in a short time interval?__

A concentrated spot on the punchcard will have much larger dots than others.  One way of solving this is to have the median commits for that time period of that week to have a more robust indicator of the pattern of activities.

### Network graph

__1. Who is the audience?__

The view is mainly for the manager and contributors, allowing the developers to see the history of features being added and branches being developed at the time.

__2. What data have been used?__

Commits by branch gives detailed information about each branches' commit activity, as well as individual commits' parent commits.

GET /repos/:owner/:repo/commits

__3. What happens if suddenly a contributor pushes many commits in a short time interval?__

A concentrated commit by a single persion will have a local effect on the network graph, where the rows of that user will have many consecutive dots.  This will elongate that particular day to an extent all other contributer for that particular day to look sparse.

The segment will look monotonous with many commits in a row

normal day
-o--o-
---o--
-o----
busy day
-o-----------o-
-o-o-o-o-o-o-o-

One solution is to collapse consecutive commits witout another contributor into a single node with a number of commits made, e.g,

-o---o-
--o:7---

There will be a need to make the collapsed node to expand in order to allow the user to access the individual commits. User should be able to expand by clicking on the collapsed node (and also allow the user to collapse again).

__4. What is the role of interaction for this visualization? Would a static graph have been sufficient?__

The role of interaction for this visualization is to allow the user to access the individual commits by clicking on the nodes.  This will allow the user to look at what has been changed in that commit.

Static graph would have been sufficient, with link into static elements of the visualization.  The network visualization will need to be paginated, with the link/buttons to redraw the new segments of the graph.  The user will likely to be less engaged with the data, however.

__5. What happens if many new developers suddenly join the project and push commits for the first time? How would you preserve the graph's readability in such a situation?__

If many new developers join and commit, there will be many merges, increasing the height of the graph, possibly overwhelming the rest of the graph.

Again, collapsing an overly complicated/large section of the graph into a single specialized node (perhaps based on the vertial size of that segment of the graph) will clean up the graph.

-o-\
----o-\
-------o-\
----------o------

to

-o[merge:4]-


text:
/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
 * Copyright 2008-2013 Pelican Mapping
 * http://osgearth.org
 *
 * osgEarth is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
#include <osgEarthFeatures/AltitudeFilter>
#include <osgEarth/ElevationQuery>
#include <osgEarth/GeoData>

#define LC "[AltitudeFilter] "

using namespace osgEarth;
using namespace osgEarth::Features;
using namespace osgEarth::Symbology;

//---------------------------------------------------------------------------

AltitudeFilter::AltitudeFilter() :
_maxRes ( 0.0f )
{
    //NOP
}

void
AltitudeFilter::setPropertiesFromStyle( const Style& style )
{
    _altitude = style.get<AltitudeSymbol>();
    if ( _altitude )
    {
        setMaxResolution( *_altitude->clampingResolution() );
    }
}

FilterContext
AltitudeFilter::push( FeatureList& features, FilterContext& cx )
{
    bool clampToMap =
        _altitude.valid()                                          &&
        _altitude->clamping()  != AltitudeSymbol::CLAMP_NONE       &&
        _altitude->technique() == AltitudeSymbol::TECHNIQUE_MAP    &&
        //_altitude->technique() != AltitudeSymbol::TECHNIQUE_SCENE  &&
        cx.getSession()        != 0L                               &&
        cx.profile()           != 0L;

    if ( clampToMap )
        pushAndClamp( features, cx );
    else
        pushAndDontClamp( features, cx );

    return cx;
}

void
AltitudeFilter::pushAndDontClamp( FeatureList& features, FilterContext& cx )
{
    NumericExpression scaleExpr;
    if ( _altitude.valid() && _altitude->verticalScale().isSet() )
        scaleExpr = *_altitude->verticalScale();

    NumericExpression offsetExpr;
    if ( _altitude.valid() && _altitude->verticalOffset().isSet() )
        offsetExpr = *_altitude->verticalOffset();

    for( FeatureList::iterator i = features.begin(); i != features.end(); ++i )
    {
        Feature* feature = i->get();

        double minHAT       =  DBL_MAX;
        double maxHAT       = -DBL_MAX;

        double scaleZ = 1.0;
        if ( _altitude.valid() && _altitude->verticalScale().isSet() )
            scaleZ = feature->eval( scaleExpr, &cx );

        double offsetZ = 0.0;
        if ( _altitude.valid() && _altitude->verticalOffset().isSet() )
            offsetZ = feature->eval( offsetExpr, &cx );

        GeometryIterator gi( feature->getGeometry() );
        while( gi.hasMore() )
        {
            Geometry* geom = gi.next();
            for( Geometry::iterator g = geom->begin(); g != geom->end(); ++g )
            {
                g->z() *= scaleZ;
                g->z() += offsetZ;

                if ( g->z() < minHAT )
                    minHAT = g->z();
                if ( g->z() > maxHAT )
                    maxHAT = g->z();
            }
        }

        if ( minHAT != DBL_MAX )
        {
            feature->set( "__min_hat", minHAT );
            feature->set( "__max_hat", maxHAT );
        }
    }
}

void
AltitudeFilter::pushAndClamp( FeatureList& features, FilterContext& cx )
{
    const Session* session = cx.getSession();

    // the map against which we'll be doing elevation clamping
    //MapFrame mapf = session->createMapFrame( Map::ELEVATION_LAYERS );
    MapFrame mapf = session->createMapFrame( Map::TERRAIN_LAYERS );

    const SpatialReference* mapSRS = mapf.getProfile()->getSRS();
    osg::ref_ptr<const SpatialReference> featureSRS = cx.profile()->getSRS();

    // establish an elevation query interface based on the features' SRS.
    ElevationQuery eq( mapf );

    NumericExpression scaleExpr;
    if ( _altitude->verticalScale().isSet() )
        scaleExpr = *_altitude->verticalScale();

    NumericExpression offsetExpr;
    if ( _altitude->verticalOffset().isSet() )
        offsetExpr = *_altitude->verticalOffset();

    // whether to record the min/max height-above-terrain values.
    bool collectHATs =
        _altitude->clamping() == AltitudeSymbol::CLAMP_RELATIVE_TO_TERRAIN ||
        _altitude->clamping() == AltitudeSymbol::CLAMP_ABSOLUTE;

    // whether to clamp every vertex (or just the centroid)
    bool perVertex =
        _altitude->binding() == AltitudeSymbol::BINDING_VERTEX;

    // whether the SRS's have a compatible vertical datum.
    bool vertEquiv =
        featureSRS->isVertEquivalentTo( mapSRS );

    for( FeatureList::iterator i = features.begin(); i != features.end(); ++i )
    {
        Feature* feature = i->get();
        double maxTerrainZ  = -DBL_MAX;
        double minTerrainZ  =  DBL_MAX;
        double minHAT       =  DBL_MAX;
        double maxHAT       = -DBL_MAX;

        double scaleZ = 1.0;
        if ( _altitude.valid() && _altitude->verticalScale().isSet() )
            scaleZ = feature->eval( scaleExpr, &cx );

        double offsetZ = 0.0;
        if ( _altitude.valid() && _altitude->verticalOffset().isSet() )
            offsetZ = feature->eval( offsetExpr, &cx );

        GeometryIterator gi( feature->getGeometry() );
        while( gi.hasMore() )
        {
            Geometry* geom = gi.next();

            // Absolute heights in Z. Only need to collect the HATs; the geometry
            // remains unchanged.
            if ( _altitude->clamping() == AltitudeSymbol::CLAMP_ABSOLUTE )
            {
                if ( perVertex )
                {
                    std::vector<double> elevations;
                    elevations.reserve( geom->size() );

                    if ( eq.getElevations( geom->asVector(), featureSRS, elevations, _maxRes ) )
                    {
                        for( unsigned i=0; i<geom->size(); ++i )
                        {
                            osg::Vec3d& p = (*geom)[i];

                            p.z() *= scaleZ;
                            p.z() += offsetZ;

                            double z = p.z();

                            if ( !vertEquiv )
                            {
                                osg::Vec3d tempgeo;
                                if ( !featureSRS->transform(p, mapSRS->getGeographicSRS(), tempgeo) )
                                    z = tempgeo.z();
                            }

                            double hat = z - elevations[i];

                            if ( hat > maxHAT )
                                maxHAT = hat;
                            if ( hat < minHAT )
                                minHAT = hat;

                            if ( elevations[i] > maxTerrainZ )
                                maxTerrainZ = elevations[i];
                            if ( elevations[i] < minTerrainZ )
                                minTerrainZ = elevations[i];
                        }
                    }
                }
                else // per centroid
                {
                    osgEarth::Bounds bounds = geom->getBounds();
                    const osg::Vec2d& center = bounds.center2d();
                    GeoPoint centroid(featureSRS, center.x(), center.y());
                    double   centroidElevation;

                    if ( eq.getElevation( centroid, centroidElevation, _maxRes ) )
                    {
                        for( unsigned i=0; i<geom->size(); ++i )
                        {
                            osg::Vec3d& p = (*geom)[i];
                            p.z() *= scaleZ;
                            p.z() += offsetZ;

                            double z = p.z();
                            if ( !vertEquiv )
                            {
                                osg::Vec3d tempgeo;
                                if ( !featureSRS->transform(p, mapSRS->getGeographicSRS(), tempgeo) )
                                    z = tempgeo.z();
                            }

                            double hat = z - centroidElevation;

                            if ( hat > maxHAT )
                                maxHAT = hat;
                            if ( hat < minHAT )
                                minHAT = hat;
                        }

                        if ( centroidElevation > maxTerrainZ )
                            maxTerrainZ = centroidElevation;
                        if ( centroidElevation < minTerrainZ )
                            minTerrainZ = centroidElevation;
                    }
                }
            }

            // Heights-above-ground in Z. Need to resolve this to an absolute number
            // and record HATs along the way.
            else if ( _altitude->clamping() == AltitudeSymbol::CLAMP_RELATIVE_TO_TERRAIN )
            {
                osg::ref_ptr<const SpatialReference> featureSRSwithMapVertDatum = !vertEquiv ?
                    SpatialReference::create(featureSRS->getHorizInitString(), mapSRS->getVertInitString()) : 0L;

                if ( perVertex )
                {
                    std::vector<double> elevations;
                    elevations.reserve( geom->size() );

                    if ( eq.getElevations( geom->asVector(), featureSRS, elevations, _maxRes ) )
                    {
                        for( unsigned i=0; i<geom->size(); ++i )
                        {
                            osg::Vec3d& p = (*geom)[i];

                            p.z() *= scaleZ;
                            p.z() += offsetZ;

                            double hat = p.z();
                            p.z() = elevations[i] + p.z();

                            // if necessary, convert the Z value (which is now in the map's SRS) back to
                            // the feature's SRS.
                            if ( !vertEquiv )
                            {
                                featureSRSwithMapVertDatum->transform(p, featureSRS, p);
                            }

                            if ( hat > maxHAT )
                                maxHAT = hat;
                            if ( hat < minHAT )
                                minHAT = hat;

                            if ( elevations[i] > maxTerrainZ )
                                maxTerrainZ = elevations[i];
                            if ( elevations[i] < minTerrainZ )
                                minTerrainZ = elevations[i];
                        }
                    }
                }
                else // per-centroid
                {
                    osgEarth::Bounds bounds = geom->getBounds();
                    const osg::Vec2d& center = bounds.center2d();
                    GeoPoint centroid(featureSRS, center.x(), center.y());
                    double   centroidElevation;

                    if ( eq.getElevation( centroid, centroidElevation, _maxRes ) )
                    {
                        for( unsigned i=0; i<geom->size(); ++i )
                        {
                            osg::Vec3d& p = (*geom)[i];
                            p.z() *= scaleZ;
                            p.z() += offsetZ;

                            double hat = p.z();
                            p.z() = centroidElevation + p.z();

                            // if necessary, convert the Z value (which is now in the map's SRS) back to
                            // the feature's SRS.
                            if ( !vertEquiv )
                            {
                                featureSRSwithMapVertDatum->transform(p, featureSRS, p);
                            }

                            if ( hat > maxHAT )
                                maxHAT = hat;
                            if ( hat < minHAT )
                                minHAT = hat;
                        }

                        if ( centroidElevation > maxTerrainZ )
                            maxTerrainZ = centroidElevation;
                        if ( centroidElevation < minTerrainZ )
                            minTerrainZ = centroidElevation;
                    }
                }
            }

            // Clamp - replace the geometry's Z with the terrain height.
            else // CLAMP_TO_TERRAIN
            {
                if ( perVertex )
                {
                    eq.getElevations( geom->asVector(), featureSRS, true, _maxRes );

                    // if necessary, transform the Z values (which are now in the map SRS) back
                    // into the feature's SRS.
                    if ( !vertEquiv )
                    {
                        osg::ref_ptr<const SpatialReference> featureSRSwithMapVertDatum =
                            SpatialReference::create(featureSRS->getHorizInitString(), mapSRS->getVertInitString());

                        osg::Vec3d tempgeo;
                        for( unsigned i=0; i<geom->size(); ++i )
                        {
                            osg::Vec3d& p = (*geom)[i];
                            featureSRSwithMapVertDatum->transform(p, featureSRS, p);
                        }
                    }
                }
                else // per-centroid
                {
                    osgEarth::Bounds bounds = geom->getBounds();
                    const osg::Vec2d& center = bounds.center2d();
                    GeoPoint centroid(featureSRS, center.x(), center.y());
                    double   centroidElevation;

                    osg::ref_ptr<const SpatialReference> featureSRSWithMapVertDatum;
                    if ( !vertEquiv )
                        featureSRSWithMapVertDatum = SpatialReference::create(featureSRS->getHorizInitString(), mapSRS->getVertInitString());

                    if ( eq.getElevation( centroid, centroidElevation, _maxRes ) )
                    {
                        for( unsigned i=0; i<geom->size(); ++i )
                        {
                            osg::Vec3d& p = (*geom)[i];
                            p.z() = centroidElevation;
                            if ( !vertEquiv )
                            {
                                featureSRSWithMapVertDatum->transform(p, featureSRS, p);
                            }
                        }
                    }
                }
            }

            if ( !collectHATs )
            {
                for( Geometry::iterator i = geom->begin(); i != geom->end(); ++i )
                {
                    i->z() *= scaleZ;
                    i->z() += offsetZ;
                }
            }
        }

        if ( minHAT != DBL_MAX )
        {
            feature->set( "__min_hat", minHAT );
            feature->set( "__max_hat", maxHAT );
        }

        if ( minTerrainZ != DBL_MAX )
        {
            feature->set( "__min_terrain_z", minTerrainZ );
            feature->set( "__max_terrain_z", maxTerrainZ );
        }
    }
}


text:
define("ace/snippets/curly",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="curly"});                (function() {
                    window.require(["ace/snippets/curly"], function(m) {
                        if (typeof module == "object" && typeof exports == "object" && module) {
                            module.exports = m;
                        }
                    });
                })();


text:
namespace base {

TEST(LaunchWinTest, GetAppOutputWithExitCodeShouldReturnExitCode) {
  CommandLine cl(FilePath(FILE_PATH_LITERAL("cmd")));
  cl.AppendArg("/c");
  cl.AppendArg("this-is-not-an-application");
  std::string output;
  int exit_code;
  ASSERT_TRUE(GetAppOutputWithExitCode(cl, &output, &exit_code));
  ASSERT_TRUE(output.empty());
  ASSERT_EQ(1, exit_code);
}

}  // namespace


text:
package com.app.qunadai.content.contract.bbs;

import com.app.qunadai.bean.bbs.StrategyBean;
import com.app.qunadai.content.base.BaseModel;
import com.app.qunadai.content.base.BasePresenter;
import com.app.qunadai.content.base.BaseView;

/**
 * Created by wayne on 2017/7/8.
 */

public interface BBSHomeContract {

    interface View extends BaseView {
        void postList(StrategyBean bean);

        void postListMore(StrategyBean bean);

        void postListFail(String error);
    }

    interface Presenter extends BasePresenter {
        void getPostList(int page, int size);
    }

    interface Model extends BaseModel {
        void getPostList(int page, int size);
    }
}


text:
layout: page
title: Terrell Banner Music Dinner
date: 2016-05-24
author: Jacob Gill
tags: weekly links, java
status: published
summary: Nam sit amet molestie velit. Aliquam urna ex.
banner: images/banner/office-01.jpg
booking:
  startDate: 06/15/2019
  endDate: 06/19/2019
  ctyhocn: RKSHHHX
  groupCode: TBMD
published: true
---
Donec porttitor vestibulum sapien, sed ultricies enim posuere nec. Morbi orci justo, tincidunt ut bibendum non, interdum posuere est. Nam rutrum nisi sed sapien efficitur, sed pharetra felis lobortis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam in elit risus. Donec mattis laoreet elit consequat eleifend. Fusce et quam ut turpis tincidunt vestibulum. Nam dignissim lobortis lacus a scelerisque. Vivamus at velit a sapien volutpat porta. Cras lobortis vel nunc eget scelerisque. Etiam lacus augue, consequat quis eros at, mollis volutpat diam.

* Ut fringilla ex id sem scelerisque porta
* In bibendum lorem sed est molestie, tempus sollicitudin justo auctor
* Nunc ullamcorper massa aliquet finibus eleifend
* Pellentesque efficitur felis at ultricies convallis
* Ut ultrices magna a blandit dapibus.

Cras auctor nulla gravida pulvinar gravida. Cras volutpat erat at sodales facilisis. Proin eu felis id dolor porttitor placerat. Suspendisse eu augue eget nibh blandit ornare. Morbi luctus enim in pretium volutpat. Integer eu mi pretium leo interdum tincidunt. Fusce a elit quam. Curabitur nulla enim, gravida eu pellentesque ac, commodo sed diam.


text:
package org.trustedanalytics.sparktk.frame.internal.ops.statistics.descriptives

import org.trustedanalytics.sparktk.frame.DataTypes
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.Row
import org.scalatest.Matchers
import org.trustedanalytics.sparktk.testutils.TestingSparkContextWordSpec

/**
 * Exercises the column statistics functions. Primarily checks that correct column indices and options are piped
 * through to the underlying statistics engines. Thorough evaluation of the statistical operations is done by the
 * tests for the respective statistics engines.
 */
class ColumnStatisticsITest extends TestingSparkContextWordSpec with Matchers {

  trait ColumnStatisticsTest {

    val epsilon = 0.000000001

    // Input data
    val row0 = Row("A", 1, 2.0f, 2, 3, 1.0f, 0, 0)
    val row1 = Row("B", 1, 2.0f, 1, 3, 2.0f, 0, 0)
    val row2 = Row("C", 1, 2.0f, 3, 2, 0.0f, 10, 0)
    val row3 = Row("D", 1, 2.0f, 6, 1, 1.0f, 0, 0)
    val row4 = Row("E", 1, 2.0f, 7, 1, 2.0f, 0, 0)

    val rowRDD: RDD[Row] = sparkContext.parallelize(List(row0, row1, row2, row3, row4))
  }

  "ColumnStatistics.columnMode" should {
    "with no net weight, return none as json" in new ColumnStatisticsTest() {
      val testMode = ColumnStatistics.columnMode(0, DataTypes.string, Some(7, DataTypes.int32), None, rowRDD)

      testMode.modes shouldBe Array.empty[String]
    }

    "support weighted mode" in new ColumnStatisticsTest() {

      val testMode = ColumnStatistics.columnMode(0, DataTypes.string, Some(3, DataTypes.int32), None, rowRDD)

      testMode.modes shouldBe Array("E")
    }
  }

  "ColumnStatistics.columnSummaryStatistics" should {
    "support unweighted summary statistics" in new ColumnStatisticsTest() {

      val stats: ColumnSummaryStatisticsReturn = ColumnStatistics.columnSummaryStatistics(2,
        DataTypes.float32,
        None,
        None,
        rowRDD,
        usePopulationVariance = false)

      Math.abs(stats.mean - 2.0) should be < epsilon
    }

    "support weighted summary statistics" in new ColumnStatisticsTest() {

      val stats: ColumnSummaryStatisticsReturn =
        ColumnStatistics.columnSummaryStatistics(5, DataTypes.float32, Some(4), Some(DataTypes.int32), rowRDD, usePopulationVariance = false)

      Math.abs(stats.mean - 1.2) should be < epsilon
    }
  }

  "ColumnStatistics.columnMedian" should {
    "support unweighted float median" in new ColumnStatisticsTest() {
      val median: ColumnMedianReturn = ColumnStatistics.columnMedian(2, DataTypes.float32, None, rowRDD)

      median.value shouldBe 2.0
    }

    "support weighted float median" in new ColumnStatisticsTest() {
      val median: ColumnMedianReturn =
        ColumnStatistics.columnMedian(5, DataTypes.float32, Some(6, DataTypes.int32), rowRDD)

      median.value shouldBe 0.0
    }

    "support unweighted integer median" in new ColumnStatisticsTest() {
      val median: ColumnMedianReturn =
        ColumnStatistics.columnMedian(4, DataTypes.int32, None, rowRDD)

      median.value shouldBe 2
    }

    "support weighted integer median" in new ColumnStatisticsTest() {
      val median: ColumnMedianReturn =
        ColumnStatistics.columnMedian(4, DataTypes.int32, Some(1, DataTypes.int32), rowRDD)

      median.value shouldBe 2
    }

    "with no net weights should return none" in new ColumnStatisticsTest() {
      val median = ColumnStatistics.columnMedian(0, DataTypes.string, Some(7, DataTypes.int32), rowRDD)

      median.value shouldBe None
    }
  }
}


text:
Login

        <form name="form" (ngSubmit)="f.form.valid && login()" #f="ngForm" novalidate>

                <input type="text" class="form-control" name="username" [(ngModel)]="model.username" #username="ngModel" required placeholder="User Name"/>

Username is required

                <input type="password" class="form-control" name="password" [(ngModel)]="model.password" #password="ngModel" required data-toggle="password" placeholder="Password" />

Password is required

                <select name="type" class="form-control" [(ngModel)]="model.type">
                  <option *ngFor="let type of authTypes" [value]="type">{{type}}</option>
                </select>

                <button [disabled]="loading" class="btn btn-success btn-md"> Login</button>
                <img *ngIf="loading" src="data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==" />

        </form>


text:
layout: page
title: "Toolkit"
description: "Get Started"
header-img: "img/Local History.JPG"
---

There are many ways to get started with the murals.

Check out the map and look around and find out more about the collections.

Download the data and try it out in a tool like Palladio or Carto. Palladio helps you to better understand how you might map and visualize the data for your own project. Carto allows for quick and easy mapping.

Data is provided under a Creative Commons Attribution [version 4.0] License. If you have any questions about using this data please contact me [arutkowski at library.ucla.edu].

Getting started with Palladio tutorial from Miriam Posner.

Palladio tutorial from a workshop by the UCLA Library and the UCLA Institute for Digital Research and Education.

A Carto workshop by the UCLA Library and the UCLA Institute for Digital Research and Education.

Contact Andy Rutkowski (arutkowski at library.ucla.edu) to talk more about ideas for using the data and/or request a consultation or workshop

Image source: UCLA Digital Library. Local History, 1974 More info


text:
package org.apache.etch.bindings.java.transport;

import org.apache.etch.bindings.java.msg.Message;
import org.apache.etch.bindings.java.support.DeliveryService;
import org.apache.etch.bindings.java.support.Mailbox;
import org.apache.etch.util.core.Who;

/**
 * Interface to the mailbox manager as needed by {@link DeliveryService} and
 * {@link Mailbox} implementors.
 */
public interface MailboxManager extends SessionMessage, TransportMessage
{
	/**
	 * Sends a message which begins a call after allocating a Mailbox to
	 * receive any responses.
	 * @param recipient specifies the recipient when there is the possibility
	 * of more than one.
	 * @param msg the message which begins the call.
	 * @return the mailbox which will receive responses to this call.
	 * @throws Exception
	 */
	public Mailbox transportCall( Who recipient, Message msg ) throws Exception;

	/**
	 * Removes the mailbox from the set of mailboxes receiving responses to
	 * messages.
	 * @param mb a mailbox as returned by {@link #transportCall(Who, Message)}.
	 */
	public void unregister( Mailbox mb );

	/**
	 * Re-delivers dead letter messages from a closed mailbox.
	 * @param sender
	 * @param msg
	 * @throws Exception
	 */
	public void redeliver( Who sender, Message msg ) throws Exception;
}


text:
@interface RPLViewController () <RPLPhotoLibraryView_assetSelectionDelegate>

#pragma mark - selectedImageView
@property (nonatomic, readonly, strong, nullable) UIImageView* selectedImageView;
-(CGRect)selectedImageView_frame;

#pragma mark - photoLibraryView
@property (nonatomic, readonly, strong, nullable) RPLPhotoLibraryView* photoLibraryView;
-(CGRect)photoLibraryView_frame;

@end

@implementation RPLViewController

#pragma mark - UIViewController
-(void)viewDidLoad
{
	[super viewDidLoad];

	[self.view setBackgroundColor:[UIColor whiteColor]];

	[self setEdgesForExtendedLayout:UIRectEdgeNone];

	_selectedImageView = [UIImageView new];
	[self.selectedImageView setBackgroundColor:[UIColor clearColor]];
	[self.selectedImageView setContentMode:UIViewContentModeScaleAspectFill];
	[self.selectedImageView setClipsToBounds:YES];
	[self.view addSubview:self.selectedImageView];

	_photoLibraryView = [RPLPhotoLibraryView new];
	[self.photoLibraryView setAssetSelectionDelegate:self];
	[self.photoLibraryView setBackgroundColor:[UIColor clearColor]];
	[self.view addSubview:self.photoLibraryView];
}

-(void)viewWillLayoutSubviews
{
	[super viewWillLayoutSubviews];

	[self.selectedImageView setFrame:self.selectedImageView_frame];
	[self.photoLibraryView setFrame:self.photoLibraryView_frame];
}

#pragma mark - selectedImageView
-(CGRect)selectedImageView_frame
{
	CGFloat const dimensionLength = 100.0f;

	return CGRectCeilOrigin((CGRect){
		.origin.x		= CGRectGetHorizontallyAlignedXCoordForWidthOnWidth(dimensionLength, CGRectGetWidth(self.view.bounds)),
		.size.width		= dimensionLength,
		.size.height	= dimensionLength,
	});
}

#pragma mark - photoLibraryView
-(CGRect)photoLibraryView_frame
{
	CGRect const selectedImageView_frame = self.selectedImageView_frame;

	return CGRectCeilOrigin(UIEdgeInsetsInsetRect(self.view.bounds, (UIEdgeInsets){
		.top	= CGRectGetMaxY(selectedImageView_frame),
	}));
}

#pragma mark - RPLPhotoLibraryView_assetSelectionDelegate
-(void)photoLibraryView:(RPLPhotoLibraryView*)photoLibraryView didSelectAsset:(ALAsset*)asset
{
	[self.selectedImageView setImage:[UIImage imageWithCGImage:asset.aspectRatioThumbnail]];
}

@end


text:
namespace starboard {
namespace loader_app {

// Checks whether there is a pending restart.
// The function is signal-safe to call.
bool IsPendingRestart();

// Set the pending restart flag.
void SetPendingRestart(bool value);

}  // namespace loader_app
}  // namespace starboard

#endif  // STARBOARD_LOADER_APP_PENDING_RESTART_H_


text:
layout: meetup
title: DevLaunchers - world's most FUN experiment to help teenagers learn game development!
author: kkipp
when: 2019-11-19T19:30:00-06:00
speakers:
  - name: Chung-Ting Huang
    title: Systems Engineer at Cloudflare
    avatar: https://avatars1.githubusercontent.com/u/7826979?s=460&v=4
    bio: At Cloudflare, Chung-Ting is building tunnels to securely expose webservers on the internet.
    email:
    homepage:
    twitter:
    github: chungthuang
    linkedin:
  - name: Kris Gano
    title:
    avatar: https://avatars1.githubusercontent.com/u/46331884?s=460&v=4
    bio: Kris is an entrepreneur who has built two game companies and is an adviser for several non-profits. His bio is also available on [pyxld.com](https://pyxld.com/#/about).
    email:
    homepage:
    twitter:
    github: pyxld-kris
    linkedin:
sponsor: cloudflare
venue: cloudflare
after: lavaca
organizers:
  - lingram
  - astacy
---

Join us for an introduction to [DevLaunchers](https://devlaunchers.com/), an initiative to teach high school students in under-served communities about game development. We'll dive into how we build the website, activities, internal tools and slack event handlers on Cloudflare Workers, CodeSandbox, GitHub Pages and Travis CI.