text:
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2017 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Realms.Exceptions;
using Realms.Helpers;

namespace Realms
{
    /// <summary>
    /// An object intended to be passed between threads containing a thread-safe reference to its
    /// thread-confined object.
    /// <para/>
    /// To resolve a thread-safe reference on a target <see cref="Realm"/> on a different thread, pass it to
    /// <c>Realm.ResolveReference</c>.
    /// </summary>
    /// <remarks>
    /// A <see cref="ThreadSafeReference"/> object must be resolved at most once.
    /// <para/>
    /// Failing to resolve a <see cref="ThreadSafeReference"/> will result in the source version of the
    /// Realm being pinned until the reference is deallocated.
    /// <para/>
    /// Prefer short-lived <see cref="ThreadSafeReference"/>s as the data for the version of the source Realm
    /// will be retained until all references have been resolved or deallocated.
    /// </remarks>
    public abstract class ThreadSafeReference
    {
        internal readonly ThreadSafeReferenceHandle Handle;

        internal readonly Metadata Metadata;

        internal readonly Type ReferenceType;

        internal ThreadSafeReference(IThreadConfined value, Type type)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            if (!value.IsManaged)
            {
                throw new RealmException("Cannot construct reference to unmanaged object, which can be passed across threads directly.");
            }

            if (!value.IsValid)
            {
                throw new RealmException("Cannot construct reference to invalidated object.");
            }

            Handle = value.Handle.GetThreadSafeReference();
            Metadata = value.Metadata;
            ReferenceType = type;
        }

        #region Factory

        /// <summary>
        /// Initializes a new instance of the <see cref="Query{T}"/> class.
        /// </summary>
        /// <param name="value">
        /// The thread-confined <see cref="IQueryable{T}"/> to create a thread-safe reference to. It must be a collection,
        /// obtained by calling <see cref="Realm.All"/> or a subsequent LINQ query.
        /// </param>
        /// <typeparam name="T">The type of the <see cref="RealmObject"/> or <see cref="EmbeddedObject"/> contained in the query.</typeparam>
        /// <returns>A <see cref="ThreadSafeReference"/> that can be passed to <see cref="Realm.ResolveReference{T}(Query{T})"/> on a different thread.</returns>
        public static Query<T> Create<T>(IQueryable<T> value)
            => new Query<T>(Argument.EnsureType<RealmResults<T>>(value, "value must be a managed Query (i.e. the result of realm.All<T>).", nameof(value)));

        /// <summary>
        /// Initializes a new instance of the <see cref="Object{T}"/> class.
        /// </summary>
        /// <param name="value">The thread-confined <see cref="RealmObject"/> or <see cref="EmbeddedObject"/> to create a thread-safe reference to.</param>
        /// <typeparam name="T">The type of the <see cref="RealmObject"/>/<see cref="EmbeddedObject"/>.</typeparam>
        /// <returns>A <see cref="ThreadSafeReference"/> that can be passed to <see cref="Realm.ResolveReference{T}(Object{T})"/> on a different thread.</returns>
        public static Object<T> Create<T>(T value)
            where T : IRealmObjectBase
        {
            return new Object<T>(value);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="List{T}"/> class.
        /// </summary>
        /// <param name="value">
        /// The thread-confined <see cref="IList{T}"/> to create a thread-safe reference to. It must be a collection
        /// that is a managed property of a <see cref="RealmObject"/> or an <see cref="EmbeddedObject"/>.
        /// </param>
        /// <typeparam name="T">The type of the objects contained in the list.</typeparam>
        /// <returns>A <see cref="ThreadSafeReference"/> that can be passed to <see cref="Realm.ResolveReference{T}(List{T})"/> on a different thread.</returns>
        public static List<T> Create<T>(IList<T> value)
            => new List<T>(Argument.EnsureType<RealmList<T>>(value, "value must be a managed List (i.e. property of a RealmObject).", nameof(value)));

        /// <summary>
        /// Initializes a new instance of the <see cref="Set{T}"/> class.
        /// </summary>
        /// <param name="value">
        /// The thread-confined <see cref="ISet{T}"/> to create a thread-safe reference to. It must be a collection
        /// that is a managed property of a <see cref="RealmObject"/> or an <see cref="EmbeddedObject"/>.
        /// </param>
        /// <typeparam name="T">The type of the objects contained in the set.</typeparam>
        /// <returns>A <see cref="ThreadSafeReference"/> that can be passed to <see cref="Realm.ResolveReference{T}(Set{T})"/> on a different thread.</returns>
        public static Set<T> Create<T>(ISet<T> value)
            => new Set<T>(Argument.EnsureType<RealmSet<T>>(value, "value must be a managed Set (i.e. property of a RealmObject).", nameof(value)));

        /// <summary>
        /// Initializes a new instance of the <see cref="Dictionary{TValue}"/> class.
        /// </summary>
        /// <param name="value">
        /// The thread-confined <see cref="IDictionary{String, TValue}"/> to create a thread-safe reference to. It must be a collection
        /// that is a managed property of a <see cref="RealmObject"/> or an <see cref="EmbeddedObject"/>.
        /// </param>
        /// <typeparam name="TValue">The type of the values contained in the dictionary.</typeparam>
        /// <returns>A <see cref="ThreadSafeReference"/> that can be passed to <see cref="Realm.ResolveReference{TValue}(Dictionary{TValue})"/> on a different thread.</returns>
        public static Dictionary<TValue> Create<TValue>(IDictionary<string, TValue> value)
            => new Dictionary<TValue>(Argument.EnsureType<RealmDictionary<TValue>>(value, "value must be a managed dictionary (i.e. property of a RealmObject).", nameof(value)));

        #endregion

        #region Implementations

        /// <summary>
        /// A reference to a <see cref="IQueryable{T}"/> intended to be passed between threads.
        /// <para/>
        /// To resolve a thread-safe reference on a target <see cref="Realm"/> on a different thread, pass it to
        /// <see cref="Realm.ResolveReference{T}(Query{T})"/>.
        /// </summary>
        /// <remarks>
        /// A <see cref="ThreadSafeReference"/> object must be resolved at most once.
        /// <para/>
        /// Failing to resolve a <see cref="ThreadSafeReference"/> will result in the source version of the
        /// Realm being pinned until the reference is deallocated.
        /// <para/>
        /// Prefer short-lived <see cref="ThreadSafeReference"/>s as the data for the version of the source Realm
        /// will be retained until all references have been resolved or deallocated.
        /// </remarks>
        /// <typeparam name="T">The type of the <see cref="RealmObject"/>/<see cref="EmbeddedObject"/> contained in the query.</typeparam>
        public class Query<T> : ThreadSafeReference
        {
            internal Query(RealmResults<T> value) : base(value, Type.Query)
            {
            }
        }

        /// <summary>
        /// A reference to a <see cref="RealmObject"/> or an <see cref="EmbeddedObject"/> intended to be passed between threads.
        /// <para/>
        /// To resolve a thread-safe reference on a target <see cref="Realm"/> on a different thread, pass it to
        /// <see cref="Realm.ResolveReference{T}(Object{T})"/>.
        /// </summary>
        /// <remarks>
        /// A <see cref="ThreadSafeReference"/> object must be resolved at most once.
        /// <para/>
        /// Failing to resolve a <see cref="ThreadSafeReference"/> will result in the source version of the
        /// Realm being pinned until the reference is deallocated.
        /// <para/>
        /// Prefer short-lived <see cref="ThreadSafeReference"/>s as the data for the version of the source Realm
        /// will be retained until all references have been resolved or deallocated.
        /// </remarks>
        /// <typeparam name="T">The type of the <see cref="RealmObject"/>/<see cref="EmbeddedObject"/>.</typeparam>
        [SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "A nested class with generic argument is unlikely to be confused with System.Object.")]
        [SuppressMessage("Naming", "CA1720:Identifier contains type name", Justification = "This is intentional as ThreadSafeReference.Object represents an object.")]
        public class Object<T> : ThreadSafeReference
            where T : IRealmObjectBase
        {
            internal Object(T value) : base(GetThreadConfined(value), Type.Object)
            {
            }

            private static IThreadConfined GetThreadConfined(IRealmObjectBase ro)
            {
                if (!ro.IsManaged)
                {
                    throw new RealmException("Cannot construct reference to unmanaged object, which can be passed across threads directly.");
                }

                return (ManagedAccessor)ro.Accessor;
            }
        }

        /// <summary>
        /// A reference to a <see cref="IList{T}"/> intended to be passed between threads.
        /// <para/>
        /// To resolve a thread-safe reference on a target <see cref="Realm"/> on a different thread, pass it to
        /// <see cref="Realm.ResolveReference{T}(List{T})"/>.
        /// </summary>
        /// <remarks>
        /// A <see cref="ThreadSafeReference"/> object must be resolved at most once.
        /// <para/>
        /// Failing to resolve a <see cref="ThreadSafeReference"/> will result in the source version of the
        /// Realm being pinned until the reference is deallocated.
        /// <para/>
        /// Prefer short-lived <see cref="ThreadSafeReference"/>s as the data for the version of the source Realm
        /// will be retained until all references have been resolved or deallocated.
        /// </remarks>
        /// <typeparam name="T">The type of the objects contained in the list.</typeparam>
        public class List<T> : ThreadSafeReference
        {
            internal List(RealmList<T> value) : base(value, Type.List)
            {
            }
        }

        /// <summary>
        /// A reference to a <see cref="ISet{T}"/> intended to be passed between threads.
        /// <para/>
        /// To resolve a thread-safe reference on a target <see cref="Realm"/> on a different thread, pass it to
        /// <see cref="Realm.ResolveReference{T}(Set{T})"/>.
        /// </summary>
        /// <remarks>
        /// A <see cref="ThreadSafeReference"/> object must be resolved at most once.
        /// <para/>
        /// Failing to resolve a <see cref="ThreadSafeReference"/> will result in the source version of the
        /// Realm being pinned until the reference is deallocated.
        /// <para/>
        /// Prefer short-lived <see cref="ThreadSafeReference"/>s as the data for the version of the source Realm
        /// will be retained until all references have been resolved or deallocated.
        /// </remarks>
        /// <typeparam name="T">The type of the objects contained in the set.</typeparam>
        [SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "A nested class with generic argument is unlikely to be confused with a property setter.")]
        public class Set<T> : ThreadSafeReference
        {
            internal Set(RealmSet<T> value) : base(value, Type.Set)
            {
            }
        }

        /// <summary>
        /// A reference to a <see cref="IDictionary{String, TValue}"/> intended to be passed between threads.
        /// <para/>
        /// To resolve a thread-safe reference on a target <see cref="Realm"/> on a different thread, pass it to
        /// <see cref="Realm.ResolveReference{TValue}(Dictionary{TValue})"/>.
        /// </summary>
        /// <remarks>
        /// A <see cref="ThreadSafeReference"/> object must be resolved at most once.
        /// <para/>
        /// Failing to resolve a <see cref="ThreadSafeReference"/> will result in the source version of the
        /// Realm being pinned until the reference is deallocated.
        /// <para/>
        /// Prefer short-lived <see cref="ThreadSafeReference"/>s as the data for the version of the source Realm
        /// will be retained until all references have been resolved or deallocated.
        /// </remarks>
        /// <typeparam name="TValue">The type of the dictionary values.</typeparam>
        public class Dictionary<TValue> : ThreadSafeReference
        {
            internal Dictionary(RealmDictionary<TValue> value) : base(value, Type.Dictionary)
            {
            }
        }

        #endregion

        internal enum Type : byte
        {
            Object,
            List,
            Query,
            Set,
            Dictionary,
        }
    }
}


text:
package org.mobilitydata.gtfsvalidator.testgtfs;

import org.mobilitydata.gtfsvalidator.table.GtfsEntity;

/** Test class to avoid dependency on the real GtfsStop and annotation processor. */
public class GtfsStop implements GtfsEntity {

  @Override
  public int csvRowNumber() {
    return 0;
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:ignore="HardcodedText"
    tools:parentTag="android.widget.FrameLayout"
    >

  <View
      android:id="@+id/argbView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      />

  <LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:gravity="center"
      android:orientation="horizontal"
      >

    <TextView
        android:id="@+id/hexPrefixView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-medium"
        android:text="#"
        />

    <com.afollestad.materialdialogs.color.view.ObservableEditText
        android:id="@+id/hexValueView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:digits="0123456789ABCDEFabcdef"
        android:fontFamily="sans-serif-medium"
        android:hint="000000"
        android:inputType="text"
        android:maxLength="8"
        tools:ignore="Autofill"
        />

  </LinearLayout>

</merge>


text:
layout: post
title: Specify Gem Versions in your Gemfile
date: 2015-03-24
excerpt: Sometimes it can be a good idea to asks bundler to give you specific versions of gems. Here's how to do that.
modified:
tags: [learning]
comments: true
image:
  feature:
  credit:
  creditlink:
---

Previously I've always just added a new gem by going to my gemfile and adding the line:

```
gem 'gemname'
```

to the bottom. I got as far as grouping development specific gems together but that's about it. I knew that it was possible to use specific versions of gems but I didn't know why you'd want to do that.

Then recently I encountered problems when I started working on something I hadn't worked on in a while and my gems suddenly stopped working. It wasn't a nightmare, but it was a slight hassle as I had to go figure out what versions of each gem I needed in order to keep everybody happy. This hassle could (possibly) have been avoided by locking down gem versions when I first add them. If everything works when you set it up, and you're always using the same versions of a gem, then subsequent bundle installs won't install versions of gems that are incompatible with each other.

For instance if you're using rspec you can add it like this:

```
  gem 'rspec-rails', '~> 3.1.0'
```
and the little squiggly arrow will say "go grab the latest version of rspec that's greater than or equal to 3.1.0 but less than version 3.2.0". Now sure maybe at some point you want the latest version of this gem, and obviously you want minor bug fixes but this is a good compromise for making sure that you'll get the newest version that isn't likely to break your setup. Because of the way versions are set, they're basically set so that within the second number things shouldn't break.

So if you just add the latest version of the gem when you first add it you can be confident that it will keep working in the future. If you want an upgraded version you can always do that, but this is a sensible default. The [rubygems](http://www.rubygems.org) site makes this easy since you can just type in the name of a gem and it will give you something you can click on and automatically copy the code for adding the latest version of the gem to your gemfile. Nice and easy.

## Gemrat
In case you're lazy there's actually a gem called gemrat which will do this for you. Install it with ```gem install gemrat``` and then when you need to add a new gem to your project you just call ```gemrat gemname``` and you'll get the latest version. You can specify options to make it pessimistic (the setting I used above) or optimistic. Upon running the command the gem will be added to your gemfile and bundle will be run so that the gem will automatically be installed.


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest>
	<application>
		<provider android:name="testprovider">
			<grant-uri-permission
				android:path="/test"
				android:pathPattern=".*"
				android:pathPrefix="ti" />

			<grant-uri-permission
				android:path="/sample"
				android:pathPattern=".*"
				android:pathPrefix="test_" />
		</provider>
	</application>
</manifest>


text:
namespace opencv_apps
{

  class Point2DArrayStamped : public ros::Msg
  {
    public:
      std_msgs::Header header;
      uint8_t points_length;
      opencv_apps::Point2D st_points;
      opencv_apps::Point2D * points;

    Point2DArrayStamped():
      header(),
      points_length(0), points(NULL)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      offset += this->header.serialize(outbuffer + offset);
      *(outbuffer + offset++) = points_length;
      *(outbuffer + offset++) = 0;
      *(outbuffer + offset++) = 0;
      *(outbuffer + offset++) = 0;
      for( uint8_t i = 0; i < points_length; i++){
      offset += this->points[i].serialize(outbuffer + offset);
      }
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      offset += this->header.deserialize(inbuffer + offset);
      uint8_t points_lengthT = *(inbuffer + offset++);
      if(points_lengthT > points_length)
        this->points = (opencv_apps::Point2D*)realloc(this->points, points_lengthT * sizeof(opencv_apps::Point2D));
      offset += 3;
      points_length = points_lengthT;
      for( uint8_t i = 0; i < points_length; i++){
      offset += this->st_points.deserialize(inbuffer + offset);
        memcpy( &(this->points[i]), &(this->st_points), sizeof(opencv_apps::Point2D));
      }
     return offset;
    }

    const char * getType(){ return "opencv_apps/Point2DArrayStamped"; };
    const char * getMD5(){ return "06c8694bd7b07dbc04014c86ef9991a2"; };

  };

}
#endif


text: Place your css/js files and your images here.


text:
package org.intellij.ibatis.util;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.xml.XmlTag;
import com.intellij.psi.xml.XmlText;
import com.intellij.util.xml.DomManager;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.intellij.ibatis.dom.sqlMap.Sql;
import org.intellij.ibatis.facet.IbatisFacet;
import org.intellij.ibatis.facet.IbatisFacetConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * utility class in iBATIS plug-in
 */
public class IbatisUtil {
    /**
     * get the table name with schema
     *
     * @param tableName table name
     * @return clear table name
     */
    public static String getTableNameWithoutSchema(String tableName) {
        return tableName.indexOf('.') != -1 ? tableName.substring(tableName.indexOf('.') + 1) : tableName;
    }

    /**
     * get the SQL code in xml tag
     *
     * @param xmlTag xml tag
     * @return SQL in xml tag
     */
    @SuppressWarnings({"ConstantConditions"})
    @NotNull
    public static String getSQLForXmlTag(XmlTag xmlTag) {
        StringBuilder sql = new StringBuilder();
        PsiElement[] children = xmlTag.getChildren();
        for (PsiElement child : children) {
            if (child instanceof XmlTag) {
                XmlTag tag = (XmlTag) child;
                if (tag.getName().equals("include")) {
                    XmlAttribute refid = tag.getAttribute("refid");
                    if (refid != null && StringUtil.isNotEmpty(refid.getText())) {
                        PsiElement psiElement = refid.getValueElement().getReference().resolve();
                        if (psiElement != null && psiElement instanceof XmlTag) {
                            Sql sqlDom = (Sql) DomManager.getDomManager(psiElement.getProject()).getDomElement((XmlTag) psiElement);
                            if (sqlDom != null)
                                sql.append(" ").append(sqlDom.getSQL());
                        }
                    }
                }
            } else if (child instanceof XmlText) {
                sql.append(" ").append(((XmlText) child).getValue());
            }
        }
        return sql.toString();
    }

    /**
     * tools just like unix's grep
     *
     * @param input   input string
     * @param pattern regex pattern
     * @return scanned  string list
     */
    public static List<String> grep(String input, String pattern) {
        List<String> matchedResults = new ArrayList<String>();
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(input);
        while (m.find()) {
            matchedResults.add(m.group());
        }
        return matchedResults;
    }

    /**
     * get the configuration for iBATIS
     *
     * @param elements element list
     * @return iBATIS configuration
     */
    @Nullable
    public static IbatisFacetConfiguration getConfig(PsiElement... elements) {
        if (null == elements || elements.length == 0) {
            return null;
        }

        for (PsiElement e : elements) {
            if (null != e) {
                Module module = ModuleUtil.findModuleForPsiElement(e);
                if (null != module) {
                    IbatisFacet facet = IbatisFacet.getInstance(module);
                    if (facet != null) {
                        return facet.getConfiguration();
                    }
                }
            }
        }
        return null;
    }

    /**
     * evaluate velocity template
     *
     * @param context  context
     * @param template template content
     * @return output
     * @throws Exception exception
     */
    public static String evaluateVelocityTemplate(VelocityContext context, String template) throws Exception {
        StringWriter sw = new StringWriter();
        getVelocityEngine().evaluate(context, sw, "iBATIS Plugin", template);
        return sw.toString();
    }

    /**
     * get the velocity engine
     *
     * @return engine object
     * @throws Exception exception
     */
    public static VelocityEngine getVelocityEngine() throws Exception {
        VelocityEngine engine = new VelocityEngine();
        engine.init();
        return engine;
    }

    /**
     * convert to underscore string, just like personId to person_id
     *
     * @param name string
     * @return converted string
     */
    public static String convertToUnderscore(String name) {
        StringBuilder builder = new StringBuilder();
        char[] characters = name.toCharArray();
        for (int i = 0; i < characters.length; i++) {
            char character = characters[i];
            String temp = String.valueOf(character).toLowerCase();
            if (character >= 'A' && character <= 'Z' && i > 0 ) {
                builder.append("_");
            }
            builder.append(temp);
        }
        return builder.toString();
    }

    /**
     * convert to  underscore to capital style
     *
     * @param name name
     * @return converted string
     */
    public static String convertToCapital(String name) {
        StringBuilder builder = new StringBuilder();
        String[] parts = name.split("_");
        for (int i = 0; i < parts.length; i++) {
            String part = parts[i];
            if (i > 0) {
                builder.append(StringUtil.capitalize(part));
            } else {
                builder.append(StringUtil.decapitalize(part));
            }
        }
        return builder.toString();
    }
}


text:
Leaflet Magnifying Glass
========================

This plugin allows you to add a "magnifying glass" effect to a Leaflet map, able to display a portion of the map in a different zoom (and actually display different content).

See it in action:

* [Default behavior, following mouse movement](http://bbecquet.github.io/Leaflet.MagnifyingGlass/examples/example.html)
* [Activated with a control button](http://bbecquet.github.io/Leaflet.MagnifyingGlass/examples/example_button.html)
* [Multiple fixed glasses, with different map looks](http://bbecquet.github.io/Leaflet.MagnifyingGlass/examples/example_multi.html)

Support
-------
The development version of the plugin (on the `master` branch) is targeted at the 1.* version of Leaflet.

For a version of the plugin compatible with the 0.7.* Leaflet releases, use the `leaflet-0.7.2` branch.

Not tested on mobile browsers.

Screenshot
----------
![screenshot](https://raw.github.com/bbecquet/Leaflet.MagnifyingGlass/master/screenshot.png "Default look of the magnifying glass")

Default look of the magnifying glass, using the same tile background as the main map and a zoom level offset set to 3.

Usage
-----

* Add the style sheet and script file to your page;
* Instantiate a magnifying glass and add it to the map like any other layer:

```javascript
var magnifyingGlass = L.magnifyingGlass({
    layers: [ ... ]
});

map.addLayer(magnifyingGlass);
```

### Inner layers

For it to display something, you need to pass layers to the constructor. You can simply give a `L.TileLayer`, but any other type of layers too.

Leaflet layer objets can't be shared between maps. So, __don't re-use layer objects already in use by the main map__. For example, if you want to use the same tile background on your main map and in the magnifying glass, you need to instantiate two different `L.TileLayer` objects:

```javascript
// Share the same tile url...
var tileUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
// but use two independant TileLayer objects
var mapTiles = L.tileLayer(tileUrl),
    magnifiedTiles = L.tileLayer(tileUrl);

var map = L.map('map', {
    center: [0, 0],
    zoom: 5,
    layers: [ mapTiles ]
});

var magnifyingGlass = L.magnifyingGlass({
    layers: [ magnifiedTiles ]
}).addTo(map);
```

### Options

| Option          |  Type       | Default   | Description |
| ---             | ---         | ---       | --- |
| `radius`        | `Integer`   | `100`     | The radius of the magnifying glass, in pixels. |
| `zoomOffset`    | `Integer`   | `3`       | The zoom level offset between the main map zoom and the magnifying glass. |
| `fixedZoom`     | `Integer`   | `-1`      | If different than `-1`, defines a fixed zoom level to always use in the magnifying glass, ignoring the main map zoom and the `zoomOffet` value. |
| `fixedPosition` | `Boolean`   | `false`   | If `true`, the magnifying glass will stay at the same position on the map, not following the mouse cursor. |
| `latLng`        | `LatLng`    | `[0, 0]`  | The initial position of the magnifying glass, both on the main map and as the center of the magnified view. If `fixedPosition` is `true`, it will always keep this position. |
| `layers`        | `ILayer[]`  | `[]`      | Set of layers to display in the magnified view. These layers shouldn't be already added to a map instance (see note above). |

### Methods

| Method | Description |
| ---    | ---         |
| `getMap()` | Returns the `L.Map` instance used by the magnifying glass. You can use it for example to add/remove magnified layers on the fly. |

License
-------

MIT.


text:
Run Spark load tests using tweaked ML/MLLib algorithms

To run :
   mvn exec:java  -DskipTests -Dexec.mainClass="com.blazedb.spark.perf.LBFGSRunner" -Dexec.args="local[4] 100000 4"


text:
package org.gwtnode.core.node.readline;

import org.gwtnode.core.JavaScriptFunctionArguments;
import org.gwtnode.core.JavaScriptReturningFunctionWrapper;

import com.google.gwt.core.client.JsArrayString;

/**
 * @author Chad Retz
 */
public abstract class Completer extends JavaScriptReturningFunctionWrapper<JsArrayString> {

    @Override
    public JsArrayString call(JavaScriptFunctionArguments args) {
        return onSubstring((String) args.get(0));
    }

    public abstract JsArrayString onSubstring(String substring);
}


text:
<?php

namespace kije\HTMLTags;

/**
 * Class Option
 * @package kije\HTMLTags
 */
class Option extends Formfield
{
    protected $tagname = 'option';
    protected $selfclosing = false;
    protected $requiredAttributes = array();

    /**
     * @param string $caption
     * @param null  $value
     * @param bool   $selected
     * @param array $attributes
     */
    public function __construct($caption, $value = null, $selected = false, array $attributes = array())
    {
        $attrs = array();

        if ($value !== null) {
            $attrs['value'] = $value;
        }

        if ($selected) {
            $attrs['selected'] = 'selected';
        }

        $attrs = array_merge($attributes, $attrs);
        parent::__construct($attrs);
        $this->innerHTML = $caption;
    }

    public function getAllowedAttributes()
    {
        return array_unique(
            array_merge(
                parent::getAllowedAttributes(),
                array(
                    'disabled',
                    'label',
                    'selected',
                    'value'
                )
            )
        );
    }

    /**
     * Sets the Text of the option
     * @param string $text
     */
    public function setText($text)
    {
        $this->setInnerHTML(strip_tags($text));
    }

    /**
     * @return string
     */
    public function getText()
    {
        return strip_tags($this->getInnerHTML());
    }
}


text:
public abstract class Test {
    /**
     * Summary for Function
     * @param name is String parameter
     * @param value is int parameter
     */
    protected final void fn(String name, int value) {

    }

    protected void openFn() {}
}


text:
package kubelet

import (
	"testing"

	"k8s.io/kubernetes/pkg/api"
)

func TestPodVolumesExist(t *testing.T) {
	testKubelet := newTestKubelet(t, false /* controllerAttachDetachEnabled */)
	kubelet := testKubelet.kubelet

	pods := []*api.Pod{
		{
			ObjectMeta: api.ObjectMeta{
				Name: "pod1",
				UID:  "pod1uid",
			},
			Spec: api.PodSpec{
				Volumes: []api.Volume{
					{
						Name: "vol1",
						VolumeSource: api.VolumeSource{
							GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
								PDName: "fake-device1",
							},
						},
					},
				},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				Name: "pod2",
				UID:  "pod2uid",
			},
			Spec: api.PodSpec{
				Volumes: []api.Volume{
					{
						Name: "vol2",
						VolumeSource: api.VolumeSource{
							GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
								PDName: "fake-device2",
							},
						},
					},
				},
			},
		},
		{
			ObjectMeta: api.ObjectMeta{
				Name: "pod3",
				UID:  "pod3uid",
			},
			Spec: api.PodSpec{
				Volumes: []api.Volume{
					{
						Name: "vol3",
						VolumeSource: api.VolumeSource{
							GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
								PDName: "fake-device3",
							},
						},
					},
				},
			},
		},
	}

	stopCh := runVolumeManager(kubelet)
	defer func() {
		close(stopCh)
	}()

	kubelet.podManager.SetPods(pods)
	for _, pod := range pods {
		err := kubelet.volumeManager.WaitForAttachAndMount(pod)
		if err != nil {
			t.Errorf("Expected success: %v", err)
		}
	}

	for _, pod := range pods {
		podVolumesExist := kubelet.podVolumesExist(pod.UID)
		if !podVolumesExist {
			t.Errorf(
				"Expected to find volumes for pod %q, but podVolumesExist returned false",
				pod.UID)
		}
	}
}


text:
/// <reference path='../../lib/tslint.d.ts' />

export class Rule extends Lint.Rules.AbstractRule {
    static FAILURE_STRING = "consecutive blank lines are disallowed";

    public apply(syntaxTree: TypeScript.SyntaxTree): Lint.RuleFailure[] {
        return this.applyWithWalker(new BlankLinesWalker(syntaxTree, this.getOptions()));
    }
}

class BlankLinesWalker extends Lint.RuleWalker {
    // starting with 1 to cover the case where the file starts with two blank lines
    private newLinesInARowSeenSoFar = 1;

    public visitToken(token: TypeScript.ISyntaxToken): void {
        this.findConsecutiveBlankLinesFromTriva(token.leadingTrivia().toArray(), this.position());
        this.newLinesInARowSeenSoFar = 0;
        this.findConsecutiveBlankLinesFromTriva(token.trailingTrivia().toArray(),
            this.position() + token.leadingTriviaWidth() + token.width());

        super.visitToken(token);
    }

    private findConsecutiveBlankLinesFromTriva(triviaList: TypeScript.ISyntaxTrivia[], currentPosition: number) {
        triviaList.forEach((triviaItem) => {
            if (triviaItem.isNewLine()) {
                this.newLinesInARowSeenSoFar += 1;
                if (this.newLinesInARowSeenSoFar >= 3) {
                    var failure = this.createFailure(currentPosition, 1, Rule.FAILURE_STRING);
                    this.addFailure(failure);
                }
            } else {
                this.newLinesInARowSeenSoFar = 0;
            }
            currentPosition += triviaItem.fullWidth();
        });
    }

}


text:
<!--
  ~ Copyright 2012 JBoss Inc
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
             xmlns:b="urn:import:org.gwtbootstrap3.client.ui">

    <b:Container fluid="true">
        <b:Row>
            <b:Column size="MD_12">
                <b:Form type="HORIZONTAL">
                    <b:FieldSet>
                        <b:Legend>Import Information
                            <small>* is required</small>
                        </b:Legend>
                        <b:FormGroup ui:field="importTypeGroup">
                            <b:FormLabel for="importType" showRequiredIndicator="true" text="Import" addStyleNames="col-md-3"/>
                            <b:Column size="MD_9">
                                <b:TextBox b:id="importType" ui:field="importTypeTextBox" placeholder="Import type..."/>
                                <b:HelpBlock ui:field="importTypeHelpInline"/>
                            </b:Column>
                        </b:FormGroup>
                    </b:FieldSet>
                </b:Form>
            </b:Column>
        </b:Row>
    </b:Container>
</ui:UiBinder>


text:
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Classes_model extends MY_Model {

	/**
     * This model's default database table. Automatically
     * guessed by pluralising the model name.
     */
    protected $_table = 'project_level';

    /**
     * This model's default primary key or unique identifier.
     * Used by the get(), update() and delete() functions.
     */
    protected $primary_key = 'id';

    public function __construct()
    {
    	parent::__construct();
    }

}

/* End of file Classes_model.php */
/* Location: .//opt/lampp/htdocs/project/app/models/Classes_model.php */


text:
qc::default
===========

part of [Docs](../index.md)

Usage
-----
`default varName defaultValue ?varName defaultValue? ...`

Description
-----------
If a variable does not exists then set its value to <i>defaultValue</i>

Examples
--------
```tcl

% set foo 1
% default foo 2
1
# foo is unaffected
%
% default bar Yes
Yes
% set bar
Yes

```

----------------------------------
*[Qcode Software Limited] [qcode]*

[qcode]: http://www.qcode.co.uk "Qcode Software"


text:
package org.jacpfx.controls.optionPane;

import org.jacpfx.controls.util.ResourceBundleUtil;

/**
 * The Enum JACPDialogButton.
 *
 * @author Patrick Symmangk (pete.jacp@gmail.com)
 */
public enum JACPDialogButton {

    /** The OK-Button. */
    OK(1, "btn.dialog.ok"),
    /** The CANCEL-Button. */
    CANCEL(2, "btn.dialog.cancel"),
    /** The YES-Button. */
    YES(3, "btn.dialog.yes"),
    /** The NO-Button. */
    NO(4, "btn.dialog.no");

    /** The id. */
    private int id;

    /** The label. */
    private String label;

    /**
     * Instantiates a new jACP dialog button.
     *
     * @param id
     *            the id
     * @param label
     *            the label
     */
    JACPDialogButton(final int id, final String label) {
        this.id = id;
        this.label = label;
    }

    /**
     * From id.
     *
     * @param id
     *            the id
     * @return the jACP dialog button
     */
    public static JACPDialogButton fromId(final int id) {
        JACPDialogButton currentButton;
        switch (id) {
        case 1:
            currentButton = JACPDialogButton.OK;
            break;
        case 2:
            currentButton = JACPDialogButton.CANCEL;
            break;
        case 3:
            currentButton = JACPDialogButton.YES;
            break;
        case 4:
            currentButton = JACPDialogButton.NO;
            break;
        default:
            currentButton = JACPDialogButton.OK;
            break;
        }
        return currentButton;
    }

    /**
     * Gets the id.
     *
     * @return the id
     */
    public int getId() {
        return this.id;
    }

    /**
     * Sets the id.
     *
     * @param id
     *            the new id
     */
    public void setId(final int id) {
        this.id = id;
    }

    /**
     * Gets the label.
     *
     * @return the label
     */
    public String getLabel() {
        return ResourceBundleUtil.getBundle().getString(this.label);
    }

    /**
     * Sets the label.
     *
     * @param label
     *            the new label
     */
    public void setLabel(final String label) {
        this.label = label;
    }

}


text:
{-# LANGUAGE DeriveDataTypeable #-}
module Penny.NonNegative.Internal where

import Data.Data (Data)
import Text.Show.Pretty (PrettyVal)
import qualified Text.Show.Pretty as Pretty

-- | Values that must not be negative.  (They can be zero.)
newtype NonNegative = NonNegative { c'Integer'NonNegative :: Integer }
  deriving (Eq, Ord, Show, Data)

instance PrettyVal NonNegative where
  prettyVal (NonNegative i) = Pretty.Con "Penny.NonNegative"
    [Pretty.Integer (show i)]


text:
@interface SQEssenceViewController : UIViewController

@end


text:
typedef struct {
    mat4 transform;
    int vertices_count;
    VertexAttrib index;
    VertexAttrib attributes[MESH_VERTEX_ATTRIB_COUNT];
} Mesh;

Mesh* mesh_create();
void mesh_destroy(Mesh* mesh);

void mesh_draw(Mesh* mesh, const mat4* view, GLuint umatrix_id);

#endif


text:
use activation_code;
CREATE TABLE MyGenerateCode
(
	SerialNumber int(5) NOT NULL,
    ActivationCode char(30) NOT NULL
);
ALTER TABLE MyGenerateCode ADD PRIMARY KEY (SerialNumber);


text:
'use strict';

const EventEmitter = require('EventEmitter');
const EventSubscriptionVendor = require('EventSubscriptionVendor');
const BatchedBridge = require('BatchedBridge');

import type EmitterSubscription from 'EmitterSubscription';

/**
 * Deprecated - subclass NativeEventEmitter to create granular event modules instead of
 * adding all event listeners directly to RCTDeviceEventEmitter.
 */
class RCTDeviceEventEmitter extends EventEmitter {

  sharedSubscriber: EventSubscriptionVendor;

  constructor() {
    const sharedSubscriber = new EventSubscriptionVendor();
    super(sharedSubscriber);
    this.sharedSubscriber = sharedSubscriber;
  }

  _nativeEventModule(eventType: ?string) {
    if (eventType) {
      if (eventType.lastIndexOf('statusBar', 0) === 0) {
        console.warn('`%s` event should be registered via the StatusBarIOS module', eventType);
        return require('StatusBarIOS');
      }
      if (eventType.lastIndexOf('keyboard', 0) === 0) {
        console.warn('`%s` event should be registered via the Keyboard module', eventType);
        return require('Keyboard');
      }
      if (eventType === 'appStateDidChange' || eventType === 'memoryWarning') {
        console.warn('`%s` event should be registered via the AppState module', eventType);
        return require('AppState');
      }
    }
    return null;
  }

  addListener(eventType: string, listener: Function, context: ?Object): EmitterSubscription {
    const eventModule = this._nativeEventModule(eventType);
    return eventModule ? eventModule.addListener(eventType, listener, context)
                       : super.addListener(eventType, listener, context);
  }

  removeAllListeners(eventType: ?string) {
    const eventModule = this._nativeEventModule(eventType);
    (eventModule && eventType) ? eventModule.removeAllListeners(eventType)
                               : super.removeAllListeners(eventType);
  }

  removeSubscription(subscription: EmitterSubscription) {
    if (subscription.emitter !== this) {
      subscription.emitter.removeSubscription(subscription);
    } else {
      super.removeSubscription(subscription);
    }
  }
}

RCTDeviceEventEmitter = new RCTDeviceEventEmitter();

BatchedBridge.registerCallableModule(
  'RCTDeviceEventEmitter',
  RCTDeviceEventEmitter
);

module.exports = RCTDeviceEventEmitter;


text:
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

// ------------------------------------------------------------------------
class Base_Controller extends CI_Controller {

    protected $flash_array = array();
    private $title;
    private $description;
    private $keywords;
    private $key;
    private $menu = array();
    private $user_id = NULL;

    public function __construct() {
        parent::__construct();
        $key = 'wert34567@#sd234|45z67';
        $this->key = hash('sha256', $key, true);
        $this->load->model('Common_model');
        $this->menu = $this->Common_model->getMenus();
        if ($this->session->userdata('user_id')) {
            $this->user_id = $this->session->userdata('user_id');
        }
        if (!$this->user_id && $this->router->class != 'login') {
            $this->redirect('', 'index.php/login/index');
        }
//        $this->output->cache(500);
//        date_default_timezone_set("asia/singapore");
    }

    public function view($path, $data) {
        $data = $this->getCommonVariables($data);
        $data = $this->setAlertData($data);
        $data['menu'] = $this->menu;
        $this->ci_smarty->display('common/header.tpl', $data);
        $this->ci_smarty->display('common/page_header.tpl', $data);
        $this->ci_smarty->display('common/menu.tpl', $data);
        $this->ci_smarty->display($path . '.tpl', $data);
        $this->ci_smarty->display('common/page_footer.tpl', $data);
        $this->ci_smarty->display('common/footer.tpl', $data);
    }

    public function setTitle($title) {
        $this->title = $title;
    }

    public function setDescription($description) {
        $this->description = $description;
    }

    public function setKeywords($keywords) {
        $this->keywords = $keywords;
    }

    public function getCommonVariables($data) {
        $data['keywords'] = $this->keywords;
        $data['description'] = $this->description;
        $data['title'] = $this->title;
        return $data;
    }

    public function setFlash($msg, $type = FALSE) {
        if ($msg) {
            $MSG_ARR["MESSAGE"]["DETAIL"] = $msg;
            $MSG_ARR["MESSAGE"]["TYPE"] = $type;
            $MSG_ARR["MESSAGE"]["STATUS"] = TRUE;
        } else {
            $MSG_ARR["MESSAGE"]["STATUS"] = FALSE;
        }
        $this->session->set_flashdata('MSG_ARR', $MSG_ARR);
    }

    public function setAlertData($data) {
        $alert_msg_arr = $this->session->flashdata('MSG_ARR');
        if (isset($alert_msg_arr)) {
            $data['alert_msg'] = $alert_msg_arr["MESSAGE"]["DETAIL"];
            $data['alert_type'] = $alert_msg_arr["MESSAGE"]["TYPE"];
            $data['alert_status'] = $alert_msg_arr["MESSAGE"]["STATUS"];
        } else {
            $data['alert_status'] = FALSE;
        }
        return $data;
    }

    public function encrypt($value) {
        return strtr(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, hash('sha256', $this->key, true), $value, MCRYPT_MODE_ECB)), '+/=', '-_,');
    }

    public function decrypt($value) {
        return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, hash('sha256', $this->key, true), base64_decode(strtr($value, '-_,', '+/=')), MCRYPT_MODE_ECB));
    }

    public function redirect($msg, $page, $message_type = FALSE) {
        $MSG_ARR["MESSAGE"]["DETAIL"] = $msg;
        $MSG_ARR["MESSAGE"]["TYPE"] = $message_type;
        $MSG_ARR["MESSAGE"]["STATUS"] = true;
        $this->session->set_flashdata('MSG_ARR', $MSG_ARR);
        $path = base_url() . $page;
        redirect($path, 'refresh');
        exit();
    }

    public function sendMail($email, $content) {
        $site_info = $this->Common_model->getSiteInfo();
        $this->load->library('email');
        $this->email->from($site_info['email'], 'realestateae.com');
        $this->email->to($email);
        $this->email->subject('Password reset');
        $this->email->message($content);
        $this->email->set_mailtype('html');
        $this->email->send();
    }

}


text:
<?php

declare(strict_types=1);

namespace Documents;

use DateTime;
use DateTimeInterface;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\File */
class FileWithoutChunkSize
{
    /**
     * @ODM\Id
     *
     * @var string|null
     */
    private $id;

    /**
     * @ODM\File\Filename
     *
     * @var string|null
     */
    private $filename;

    /**
     * @ODM\File\ChunkSize
     *
     * @var int|null
     */
    private $chunkSize;

    /**
     * @ODM\File\Length
     *
     * @var int|null
     */
    private $length;

    /**
     * @ODM\File\UploadDate
     *
     * @var DateTime|null
     */
    private $uploadDate;

    /**
     * @ODM\File\Metadata(targetDocument=FileMetadata::class)
     *
     * @var FileMetadata|null
     */
    private $metadata;

    public function getId(): ?string
    {
        return $this->id;
    }

    public function getFilename(): ?string
    {
        return $this->filename;
    }

    public function getChunkSize(): ?int
    {
        return $this->chunkSize;
    }

    public function getLength(): ?int
    {
        return $this->length;
    }

    public function getUploadDate(): ?DateTimeInterface
    {
        return $this->uploadDate;
    }

    public function getMetadata(): ?FileMetadata
    {
        return $this->metadata;
    }

    public function getOrCreateMetadata(): FileMetadata
    {
        if (! $this->metadata) {
            $this->metadata = new FileMetadata();
        }

        return $this->metadata;
    }
}


text:
package com.frameworkset.common.tag.html;

import java.io.Serializable;

import javax.servlet.jsp.JspException;

import com.frameworkset.platform.search.SearchService;
import com.frameworkset.common.tag.BaseTag;

public class ListTag extends BaseTag {
	/////////////////////////////////////////////////////////

	private String name;

	private String type;
	private String datasource;
	private int left;
	private int top;
	private int width;

	public String getName() {
		return name;
	}

	public void setName(String name){

		this.name = name;
	}

	public int getLeft() {
		return left;
	}

	public void setLeft(int left) {
		this.left = left;
	}

	public int getTop() {
		return top;
	}

	public void setTop(int top) {
		this.top = top;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

  //////////////////////////////////////////////////////////
	public int doStartTag() throws JspException{

		try{

			StringBuffer buffer = new StringBuffer();
			buffer.append("<select name=\"select"+name+"\"  multiple  style=\"position:absolute; left: "+ left +"px; top: "+ top + "px; width:"+ width + "px;display:none\" id=\"select"+name+"\"  onclick='change(\"select"+name+"\",\""+name+"\",\"icon"+name+"\")' onkeydown='keydown(\"select"+name+"\",\""+name+"\",\"icon"+name+"\")'  onkeyup='keyup(\"select"+name+"\",\""+name+"\",\"icon"+name+"\",\""+type+"\",\""+datasource+"\");'>\n");
			String[] resultall = SearchService.search(type,"",datasource);
			for(int i = 0;i<resultall.length;i++)
			{
				buffer.append("<option value='"+ resultall[i] + "'>"+ resultall[i] + "</option>\n");
			}
			int top1,left1;
			top1=top - 20;
			left1=left + width - 17;
			buffer.append("</select>\n");
			buffer.append("<input type=\"text\" style=\"position:absolute; left: "+ left +"px; top: "+ top1 + "px; width:"+ width + "px; height: 20px\"   name=\""+ name +"\" onkeyup='keyup(\"select"+name+"\",\""+name+"\",\"icon"+name+"\",\""+type+"\",\""+datasource+"\");' onkeydown='keydown(\"select"+name+"\",\""+name+"\",\"icon"+name+"\")'>\n");
			buffer.append("<img src=\"cc.jpg\" name=\"icon"+name+"\" onclick='changestatus(\"select"+name+"\",\""+name+"\",\"icon"+name+"\")' style=\"position:absolute; left: "+ left1 +"px; top: "+ top1 + "px;\">\n");
			out.print(buffer.toString());
			return EVAL_BODY_INCLUDE;
		}catch(Exception e){

			throw new JspException(e.getMessage());
		}

	}
	public int doEndTag() throws JspException{
	try{

	   return EVAL_PAGE;//SKIP_PAGE;
	}catch(Exception e){

		throw new JspException(e.getMessage());
	}
 }
	public void release(){
		super.release();
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	public String getDatasource() {
		return datasource;
	}

	public void setDatasource(String datasource) {
		this.datasource = datasource;
	}

	@Override
	public void doFinally() {
		 name = null;

			 type= null;
			 datasource= null;
			 left= 0;
			 top= 0;
			  width= 0;
		super.doFinally();
	}

}


text:
package xworker.javafx.scene.shape;

import javafx.scene.shape.Arc;
import javafx.scene.shape.ArcType;
import org.xmeta.ActionContext;
import org.xmeta.Thing;

public class ArcActions {
    public static void init(Arc node, Thing thing, ActionContext actionContext){
        ShapeActions.init(node, thing, actionContext);

        if(thing.valueExists("centerX")){
            node.setCenterX(thing.getDouble("centerX"));
        }
        if(thing.valueExists("centerY")){
            node.setCenterY(thing.getDouble("centerY"));
        }
        if(thing.valueExists("length")){
            node.setLength(thing.getDouble("length"));
        }
        if(thing.valueExists("radiusX")){
            node.setRadiusX(thing.getDouble("radiusX"));
        }
        if(thing.valueExists("radiusY")){
            node.setRadiusY(thing.getDouble("radiusY"));
        }
        if(thing.valueExists("startAngle")){
            node.setStartAngle(thing.getDouble("startAngle"));
        }
        if(thing.valueExists("type")){
            node.setType(ArcType.valueOf(thing.getString("type")));
        }
    }

    public static Arc create(ActionContext actionContext){
        Thing self = actionContext.getObject("self");

        Arc node = new Arc();
        init(node, self, actionContext);
        actionContext.g().put(self.getMetadata().getName(), node);

        actionContext.peek().put("parent", node);
        for(Thing child : self.getChilds()){
            child.doAction("create", actionContext);
        }

        return node;
    }
}


text:
package com.github.stathvaille.marketimports.domain.ui;

import lombok.Data;

import java.util.List;

/**
 * Data for the bootstrap-table url
 */

@Data
public class BootstrapTableData {
    private int total;
    private List<BootstrapTableRow> rows;

}


text:
package pl.tomaszdziurko.jvm_bloggers.blog_posts;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.routing.RoundRobinPool;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import pl.tomaszdziurko.jvm_bloggers.blog_posts.domain.BlogPostRepository;
import pl.tomaszdziurko.jvm_bloggers.blogs.domain.Blog;
import pl.tomaszdziurko.jvm_bloggers.blogs.domain.BlogRepository;
import pl.tomaszdziurko.jvm_bloggers.utils.SyndFeedProducer;

import java.util.List;

@Component
public class BlogPostsFetcher {

    private final BlogRepository blogRepository;
    private final ActorRef rssCheckingActor;
    private final ActorRef blogPostStoringActor;

    @Autowired
    public BlogPostsFetcher(ActorSystem actorSystem, BlogRepository blogRepository,
                            BlogPostRepository blogPostRepository,
                            SyndFeedProducer syndFeedFactory) {
        this.blogRepository = blogRepository;
        blogPostStoringActor =
            actorSystem.actorOf(NewBlogPostStoringActor.props(blogPostRepository));
        rssCheckingActor = actorSystem.actorOf(new RoundRobinPool(10)
            .props(RssCheckingActor.props(blogPostStoringActor, syndFeedFactory)), "rss-checkers");
    }

    public void refreshPosts() {
        List<Blog> people = blogRepository.findAllActiveBlogs();
        people.stream()
            .forEach(person -> rssCheckingActor.tell(new RssLink(person), ActorRef.noSender()));
    }
}


text:
<?php

namespace Mage\Sales\Test\Constraint;

use Mage\Sales\Test\Page\Adminhtml\SalesOrderIndex;
use Mage\Sales\Test\Page\Adminhtml\SalesOrderView;
use Magento\Mtf\Constraint\AbstractConstraint;

/**
 * Assert that Orders Grand Total is correct on each order page in backend.
 */
class AssertOrdersGrandTotal extends AbstractConstraint
{
    /* tags */
    const SEVERITY = 'high';
    /* end tags */

    /**
     * Assert that Orders Grand Total is correct on each order page in backend.
     *
     * @param SalesOrderIndex $salesOrder
     * @param SalesOrderView $salesOrderView
     * @param array $grandTotal
     * @param array $ordersIds
     * @param AssertOrderGrandTotal $assertOrderGrandTotal
     * @return void
     */
    public function processAssert(
        SalesOrderIndex $salesOrder,
        SalesOrderView $salesOrderView,
        array $grandTotal,
        array $ordersIds,
        AssertOrderGrandTotal $assertOrderGrandTotal
    ) {
        foreach ($ordersIds as $key => $orderId) {
            $assertOrderGrandTotal->processAssert($salesOrder, $salesOrderView, $grandTotal[$key], $orderId);
        }
    }

    /**
     * Returns a string representation of the object.
     *
     * @return string
     */
    public function toString()
    {
        return 'Grand Total prices equals to prices from data set for orders.';
    }
}


text:
package org.apache.logging.log4j.perf.jmh;

import java.util.concurrent.ConcurrentHashMap;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;

/**
 * Compares performance of ThreadLocal, vs ConcurrentHashMap<Thread, Object>.
 */
// ============================== HOW TO RUN THIS TEST: ====================================
// (Quick build: mvn -DskipTests=true clean package -pl log4j-perf -am )
//
// single thread:
// java -jar log4j-perf/target/benchmarks.jar ".*ThreadLocalVsConcurrentHashMap.*" -f 1 -wi 10 -i 20 -tu ns -bm sample
//
// four threads:
// java -jar log4j-perf/target/benchmarks.jar ".*ThreadLocalVsConcurrentHashMap.*" -f 1 -wi 10 -i 20 -tu ns -bm sample
// -t 4
//
// Usage help:
// java -jar log4j-perf/target/benchmarks.jar -help
//
@State(Scope.Benchmark)
public class ThreadLocalVsConcurrentHashMapBenchmark {

    private static final String VALUE = "value";
    private static ConcurrentHashMap<Thread, StringBuilder> map = new ConcurrentHashMap<Thread, StringBuilder>();
    private static ThreadLocal<StringBuilder> threadLocal = new ThreadLocal<>();

    @Benchmark
    public String newInstance() {
        StringBuilder sb = getNew();
        sb.append(VALUE);
        return sb.toString();
    }

    @Benchmark
    public String threadLocal() {
        StringBuilder sb = getThreadLocal();
        sb.append(VALUE);
        return sb.toString();
    }

    @Benchmark
    public String concurrentHashMap() {
        StringBuilder sb = getConcurrentMap();
        sb.append(VALUE);
        return sb.toString();
    }

    private StringBuilder getNew() {
        final StringBuilder buf = new StringBuilder();
        return buf;
    }

    private StringBuilder getThreadLocal() {
        StringBuilder buf = threadLocal.get();
        if (buf == null) {
            buf = new StringBuilder();
            threadLocal.set(buf);
        }
        buf.setLength(0);
        return buf;
    }

    private StringBuilder getConcurrentMap() {
        StringBuilder buf = map.get(Thread.currentThread());
        if (buf == null) {
            buf = new StringBuilder();
            map.put(Thread.currentThread(), buf);
        }
        buf.setLength(0);
        return buf;
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Valsa aesculicola Cooke, 1885

### Remarks
null


text:
//
// MarketBase.cs
//
// Author:
//       Seyed Razavi <monkeyx@gmail.com>
//
// Copyright (c) 2015 Seyed Razavi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;

using SQLite.Net.Attributes;

namespace Phoenix.BL.Entities
{
	/// <summary>
	/// Market base.
	/// </summary>
	[Table("MarketBase")]
	public class MarketBase : EntityBase
	{
		/// <summary>
		/// Gets or sets the identifier.
		/// </summary>
		/// <value>The identifier.</value>
		[PrimaryKey]
		public override int Id { get; set; }

		/// <summary>
		/// Gets or sets the name.
		/// </summary>
		/// <value>The name.</value>
		[Indexed]
		public string Name { get; set; }

		/// <summary>
		/// Gets the name and identifier.
		/// </summary>
		/// <value>The name and identifier.</value>
		[Ignore]
		public string NameAndId {
			get {
				return Name + " (" + Id + ")";
			}
		}

		/// <summary>
		/// Gets the list text.
		/// </summary>
		/// <value>The list text.</value>
		[Ignore]
		public override string ListText { get { return NameAndId; } }

		/// <summary>
		/// Gets the list detail.
		/// </summary>
		/// <value>The list detail.</value>
		[Ignore]
		public override string ListDetail { get { return LocationText; } }

		/// <summary>
		/// Gets the group that the entity belongs to
		/// </summary>
		/// <value>The group.</value>
		[Ignore]
		public override string Group {
			get {
				return StarSystemName == null ? "None" : StarSystemName;
			}
		}

		/// <summary>
		/// Gets or sets the affiliation code.
		/// </summary>
		/// <value>The affiliation code.</value>
		[Indexed]
		public string AffiliationCode { get; set; }

		/// <summary>
		/// Gets or sets the star system identifier.
		/// </summary>
		/// <value>The star system identifier.</value>
		[Indexed]
		public int StarSystemId { get; set; }

		/// <summary>
		/// Gets or sets the name of the star system.
		/// </summary>
		/// <value>The name of the star system.</value>
		public string StarSystemName { get; set; }

		/// <summary>
		/// Gets or sets the star system.
		/// </summary>
		/// <value>The star system.</value>
		[Ignore]
		public StarSystem StarSystem { get; set; }

		/// <summary>
		/// Gets or sets the celestial body identifier.
		/// </summary>
		/// <value>The celestial body identifier.</value>
		public int CelestialBodyId { get; set; }

		/// <summary>
		/// Gets or sets the name of the celestial body.
		/// </summary>
		/// <value>The name of the celestial body.</value>
		public string CelestialBodyName { get; set; }

		/// <summary>
		/// Gets or sets the celestial body.
		/// </summary>
		/// <value>The celestial body.</value>
		[Ignore]
		public CelestialBody CelestialBody { get; set; }

		/// <summary>
		/// Gets or sets the hiport.
		/// </summary>
		/// <value>The hiport.</value>
		public int Hiport { get; set; }

		/// <summary>
		/// Gets or sets the patch price.
		/// </summary>
		/// <value>The patch price.</value>
		public int PatchPrice { get; set; }

		/// <summary>
		/// Gets or sets the dock capacity.
		/// </summary>
		/// <value>The dock capacity.</value>
		public int DockCapacity { get; set; }

		/// <summary>
		/// Gets or sets the maintenance complexes.
		/// </summary>
		/// <value>The maintenance complexes.</value>
		public int MaintenanceComplexes { get; set; }

		/// <summary>
		/// Gets or sets the items.
		/// </summary>
		/// <value>The items.</value>
		[Ignore]
		public List<MarketItem> Items { get ;set; } = new List<MarketItem>();

		/// <summary>
		/// Gets the selling.
		/// </summary>
		/// <value>The selling.</value>
		[Ignore]
		public IEnumerable<MarketItem> Selling {
			get {
				return from element in Items
				       where element.SellQuantity > 0
				       select element;
			}
		}

		/// <summary>
		/// Gets the buying.
		/// </summary>
		/// <value>The buying.</value>
		[Ignore]
		public IEnumerable<MarketItem> Buying {
			get {
				return from element in Items
						where element.BuyQuantity > 0
					select element;
			}
		}

		/// <summary>
		/// Gets the location text.
		/// </summary>
		/// <value>The location text.</value>
		[Ignore]
		public string LocationText {
			get {
				return CelestialBodyName + " (" + CelestialBodyId + ") in " + StarSystemName + " (" + StarSystemId + ")";
			}
		}

		/// <summary>
		/// Returns a <see cref="System.String"/> that represents the current <see cref="Phoenix.BL.Entities.MarketBase"/>.
		/// </summary>
		/// <returns>A <see cref="System.String"/> that represents the current <see cref="Phoenix.BL.Entities.MarketBase"/>.</returns>
		public override string ToString ()
		{
			return string.Format ("{0} {1} ({2})", AffiliationCode, Name, Id);
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="Phoenix.BL.Entities.MarketBase"/> class.
		/// </summary>
		public MarketBase ()
		{
		}
	}

	/// <summary>
	/// Market item.
	/// </summary>
	[Table("MarketItem")]
	public class MarketItem : EntityBase
	{
		/// <summary>
		/// Gets or sets the identifier.
		/// </summary>
		/// <value>The identifier.</value>
		[PrimaryKey, AutoIncrement]
		public override int Id { get; set; }

		/// <summary>
		/// Gets or sets the base identifier.
		/// </summary>
		/// <value>The base identifier.</value>
		[Indexed]
		public int BaseId { get; set; }

		/// <summary>
		/// Gets or sets the base.
		/// </summary>
		/// <value>The base.</value>
		[Ignore]
		public MarketBase Base { get; set; }

		/// <summary>
		/// Gets or sets the item identifier.
		/// </summary>
		/// <value>The item identifier.</value>
		[Indexed]
		public int ItemId { get; set; }

		/// <summary>
		/// Gets or sets the name of the item.
		/// </summary>
		/// <value>The name of the item.</value>
		public string ItemName { get; set; }

		/// <summary>
		/// Gets or sets the market.
		/// </summary>
		/// <value>The market.</value>
		[Ignore]
		public MarketBase Market { get; set; }

		/// <summary>
		/// Gets the name and identifier.
		/// </summary>
		/// <value>The name and identifier.</value>
		[Ignore]
		public string NameAndId {
			get {
				return ItemName + " (" + ItemId + ")";
			}
		}

		/// <summary>
		/// Gets the list text.
		/// </summary>
		/// <value>The list text.</value>
		[Ignore]
		public override string ListText { get { return NameAndId; } }

		/// <summary>
		/// Gets the list detail.
		/// </summary>
		/// <value>The list detail.</value>
		[Ignore]
		public override string ListDetail { get { return Details; } }

		/// <summary>
		/// Gets or sets the item.
		/// </summary>
		/// <value>The item.</value>
		[Ignore]
		public Item Item { get; set; }

		/// <summary>
		/// Gets or sets the sell quantity.
		/// </summary>
		/// <value>The sell quantity.</value>
		public int SellQuantity { get; set; }

		/// <summary>
		/// Gets or sets the sell price.
		/// </summary>
		/// <value>The sell price.</value>
		public float SellPrice { get; set; }

		/// <summary>
		/// Gets or sets the buy quantity.
		/// </summary>
		/// <value>The buy quantity.</value>
		public int BuyQuantity { get; set; }

		/// <summary>
		/// Gets or sets the buy price.
		/// </summary>
		/// <value>The buy price.</value>
		public float BuyPrice { get; set; }

		/// <summary>
		/// Gets the details.
		/// </summary>
		/// <value>The details.</value>
		[Ignore]
		public string Details {
			get {
				List<string> details = new List<string> ();
				if (BuyQuantity > 0) {
					details.Add("Buy: " + BuyQuantity + " @ $" + BuyPrice);
				}
				if (SellQuantity > 0) {
					details.Add("Sell: " + SellQuantity + " @ $" + SellPrice);
				}
				return string.Join (", ", details);
			}
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="Phoenix.BL.Entities.MarketItem"/> class.
		/// </summary>
		public MarketItem ()
		{
		}
	}
}


text:
@interface LoadOpeningBookCommand : CommandBase
{
}

@end


text:
  return vg;
})(d3, typeof topojson === "undefined" ? null : topojson);
// assumes D3 and topojson in global namespace


text:
Class that provide complete and simple to use color manupilation capabilities like:
- Modifiers
	- opacity
	- darken
	- lighten
	- desaturate
	- saturate
	- spin (change hue)
	- transparentize
	- alpha
	- grayscale
- Conversions
	- rgba
	- hsl
	- hsv
	- hex
- Print out formats
	- toRgbaString
	- toHslString
	- toHsvString
	- toHexString
	- toString(format = null)
- Support registered sugar colors names like:
	- ```new SColor('primary')```

### Example
```js
	import SColor from 'coffeekraken-sugar/js/classes/SColor'
let myColor = new SColor(#ff0000);
// get a lighter color
let ligtherColor = myColor.lighten(20);
// print the color to rgba
console.log(lighterColor.toRgbaString());
```
Author : Olivier Bossel [olivier.bossel@gmail.com](mailto:olivier.bossel@gmail.com) [https://olivierbossel.com](https://olivierbossel.com)

## Constructor

Constructor

## Properties

### toStringFormat

Default toString format

Type : **{ [String](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/String) }**

Values : **hex,hsl,hsv,rgba**

**Static**

Default : **rgba**

### r

Get the red value

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

### g

Get the green value

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

### b

Get the blue value

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

### a

Get the alpha value

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

### l

The luminence value

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

### s

The saturation value

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

### v

The value

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

### h

Get the hue

Type : **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**

## Methods

### convert2

Concert color

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
format  |  **{ string }**  |  The format wanted as output like (rgba,hsl,hsv and hex)  |  required  |

Return **{ object }** The color in wanted object format

### parseRgba

Parse RGBA

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
rgbaString  |  **{ string }**  |  The rgba string (rgba(r,g,b,a)) to parse  |  required  |

Return **{ object }** The rgba object representation

### parseHsl

Parse HSL

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
hslString  |  **{ string }**  |  The hsl string (hsl(h,s,l)) to parse  |  required  |

Return **{ object }** The hsl object representation

### parseHsv

Parse HSV

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
hsvString  |  **{ string }**  |  The hsv string (hsv(h,s,v)) to parse  |  required  |

Return **{ object }** The hsv object representation

### rgba2hex

RGBA to HEX

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
r  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The red value between 0-255  |  required  |
g  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The green value between 0-255  |  required  |
b  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The blue value between 0-255  |  required  |
a  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The alpha value between 0-100|0-1  |  required  |

Return **{ string }** The hex string representation like #ff004f

### rgba2rgba

RGBA to RGBA

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
r  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The red value between 0-255  |  required  |
g  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The green value between 0-255  |  required  |
b  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The blue value between 0-255  |  required  |
a  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The alpha value between 0-100|0-1  |  required  |

Return **{ object }** The rgba object representation

### hex2rgba

Hex to RGBA

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
hex  |  **{ string }**  |  The hex string to convert  |  required  |

Return **{ object }** The rgba object representation

### hsv2rgba

HSV to RGBA

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
h  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The hue value between 0-360  |  required  |
s  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The saturation value between 0-100|0-1  |  required  |
v  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The value value between 0-100|0-1  |  required  |
a  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The alpha value between 0-100|0-1  |  required  |

Return **{ object }** The rgba object representation

### hsl2rgba

HSL to RGBA

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
h  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The hue value between 0-360  |  required  |
s  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The saturation value between 0-100|0-1  |  required  |
l  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The luminence value between 0-100|0-1  |  required  |
a  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The alpha value between 0-100|0-1  |  required  |

Return **{ object }** The rgba object representation

### rgba2hsv

RGBA to HSV

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
r  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The red value between 0-255  |  required  |
g  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The green value between 0-255  |  required  |
b  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The blue value between 0-255  |  required  |
a  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The alpha value between 0-100|0-1  |  required  |

Return **{ object }** The hsv object representation

### rgba2hsl

RGBA to HSL

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
r  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The red value between 0-255  |  required  |
g  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The green value between 0-255  |  required  |
b  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The blue value between 0-255  |  required  |
a  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The alpha value between 0-100|0-1  |  required  |

Return **{ object }** The hsl object representation

### toHex

To hex

Return **{ string }** The hex string representation

### toHsl

To hsl

Return **{ object }** The hsl object representation

### toHsv

To hsv

Return **{ object }** The hsv object representation

### toRgba

To rgba

Return **{ object }** The rgba object representation

### reset

Reset to the original color

### desaturate

Desaturate

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
amount  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The amount of desaturation wanted between 0-100  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### saturate

Saturate

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
amount  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The amount of saturation wanted between 0-100  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### grayscale

Grayscale

Return **{ SColor }** A new SColor instance of the updated color

### spin

Spin

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
amount  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The amount of hue spin wanted between 0-360  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### transparentize

Transparentize

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
amount  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The amount of transparence to apply between 0-100|0-1  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### alpha

Set the alpha

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
alpha  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The new alpha value to apply between 0-100|0-1  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### opacity

Set the opacity (alias for alpha)

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
opacity  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The new opacity value to apply between 0-100|0-1  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### opacify

Opacify

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
amount  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The amount of transparence to remove between 0-100|0-1  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### darken

Darken

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
amount  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The amount of darkness (of the nightmare of the shadow) to apply between 0-100  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### lighten

Lighten

#### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
amount  |  **{ [Number](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number) }**  |  The amount of lightness (of the sky of the angels) to apply between 0-100  |  required  |

Return **{ SColor }** A new SColor instance of the updated color

### toHexString

To hex string

Return **{ string }** The hex string representation of the color

### toRgbaString

To rgba string

Return **{ string }** The rgba string representation of the color

### toHslString

To hsl string

Return **{ string }** The hsl string representation of the color

### toHsvString

To hsv string

Return **{ string }** The hsv string representation of the color

### toString

To string

Return **{ string }** The rgba string representation of the color