text:
license: Licensed to the Apache Software Foundation (ASF) under one
         or more contributor license agreements.  See the NOTICE file
         distributed with this work for additional information
         regarding copyright ownership.  The ASF licenses this file
         to you under the Apache License, Version 2.0 (the
         "License"); you may not use this file except in compliance
         with the License.  You may obtain a copy of the License at

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

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

---

# The Command-line Interface

This guide shows you how to create applications and deploy them to
various native mobile platforms using the `cordova` command-line
interface (CLI). This tool allows you to create new projects, build
them on different platforms, and run them within an emulator. You can
also use the CLI to initialize project code, after which you use
various platforms' SDKs to develop them further.

## Prerequisites

Before running any command-line tools, you need to install SDKs for
each platform you wish to target.
(See the Platform Guides for more details.)

To add support or rebuild a project for any platform, you need to run
the command-line interface from the same machine that supports the
platform's SDK. The CLI supports the following combinations:

* iOS             (Mac)
* Android         (Mac, Linux, Windows)
* BlackBerry 10   (Mac, Linux, Windows)
* Windows Phone 7 (Windows)
* Windows Phone 8 (Windows)
* Windows 8       (Windows)
* Firefox OS      (Mac, Linux, Windows)

On the Mac, the command-line is available via the _Terminal_
application. On the PC, it's available as _Command Prompt_ under
_Accessories_.

The more likely it is that you run the CLI from different machines,
the more it makes sense to maintain a remote source code repository,
whose assets you pull down to local working directories.

To install the `cordova` command-line tool, follow these steps:

1. Download and install [Node.js](http://nodejs.org/). Following
   installation, you should be able to invoke `node` or `npm` on your
   command line.

1. Install the `cordova` utility. In Unix, prefixing the additional
   `sudo` command may be necessary to install development utilities in
   otherwise restricted directories:

        $ sudo npm install -g cordova

   The installation log may produce errors for any uninstalled
   platform SDKs.  Following installation, you should be able to run
   `cordova` on the command line.

## Create the App

Go to the directory where you maintain your source code, and run a
command such as the following:

        $ cordova create hello com.example.hello HelloWorld

It may take some time for the command to complete, so be patient. Run
the `cordova -d` to see information about progress.

The first argument specifies a _hello_ directory to be generated
for your project. Its `www` subdirectory houses your application's
home page, along with various resources under `css`, `js`, and `img`,
which follow common web development file-naming conventions. The
`config.xml` file contains important metadata needed to generate and
distribute the application.

The other two arguments are optional: the `com.example.hello` argument
provides your project with a reverse domain-style identifier, and the
`HelloWorld` provides the application's display text. You can edit
both of these values later in the `config.xml` file.

## Add Platforms

All subsequent commands need to be run within the project's directory,
or any subdirectories within its scope:

        $ cd hello

Before you can build the project, you need to specify a set of target
platforms. Your ability to run these commands depends on whether your
machine supports each SDK, and whether you have already installed each
SDK.  Run any of these from a Mac:

        $ cordova platform add ios
        $ cordova platform add android
        $ cordova platform add blackberry10
        $ cordova platform add firefoxos

Run any of these from a Windows machine, where _wp_ refers to
different versions of the Windows Phone operating system:

        $ cordova platform add wp7
        $ cordova platform add wp8
        $ cordova platform add windows8
        $ cordova platform add android
        $ cordova platform add blackberry10
        $ cordova platform add firefoxos

Run this to check your current set of platforms:

        $ cordova platforms ls

(Note the `platform` and `platforms` commands are synonymous.)

Run either of the following synonymous commands to remove a platform:

        $ cordova platform remove blackberry10
        $ cordova platform rm android

Running commands to add or remove platforms affects the contents of
the project's _platforms_ directory, where each specified platform
appears as a subdirectory. The _www_ source directory is reproduced
within each platform's subdirectory, appearing for example in
`platforms/ios/www` or `platforms/android/assets/www`.  By default,
each platform's configuration file is set up to be able to access all
of Cordova's APIs.

If you wish, you can use an SDK at this point to open the project you
created. However, any edits you make to the project within an SDK
affect the derivative set of assets, not the original cross-platform
source files. Use this approach if you simply want to initialize a
project.
(See the Platform Guides for information on how to develop applications within each SDK.)
Read on if you wish to use command-line tools for the entire
development cycle.

## Build the App

By default, the `cordova create` script generates a skeletal web-based
application whose home page is the project's `www/index.html` file.
Edit this application however you want, but any initialization should
be specified as part of the `deviceready` event handler, referenced by
default from `www/js/index.js`.
<!-- XREF
(See the Application Development Guide for details.)
XREF -->

Run the following command to iteratively build the project:

        $ cordova build

This generates platform-specific code within the project's `platforms`
subdirectory.  You can optionally limit the scope of each build to
specific platforms:

        $ cordova build ios

The `cordova build` command is a shorthand for the following, which in
this example is also targeted to a single platform:

        $ cordova prepare ios
        $ cordova compile ios

In this case, once you run `prepare`, you can use Apple's Xcode SDK as
an alternative to modify and compile the platform-specific code that
Cordova generates within `platforms/ios`. You can use the same
approach with other platforms' SDKs.

## Test the App on an Emulator or Device

SDKs for mobile platforms often come bundled with emulators that
execute a device image, so that you can launch the app from the home
screen and see how it interacts with many platform features.  Run a
command such as the following to rebuild the app and view it within a
specific platform's emulator:

        $ cordova emulate android

Some mobile platforms emulate a particular device by default, such as
the iPhone for iOS projects. For other platforms, you may need to
first associate a device with an emulator.
(See the Platform Guides for details.)
For example, you may first run the `android` command to launch the
Android SDK, then run a particular device image, which launches it
according to its default behavior:

![](img/guide/cli/android_emulate_init.png)

Following up with the `cordova emulate` command refreshes the emulator
image to display the latest application, which is now available for
launch from the home screen:

![](img/guide/cli/android_emulate_install.png)

Alternately, you can plug the handset into your computer and test the
app directly:

        $ cordova run android

Before running this command, you need to set up the device for
testing, following procedures that vary for each platform. In
Android's case, you would have to enable a __USB debugging__ option on
the device, and perhaps add a USB driver depending on your development
environmnent.
See Platform Guides for details on each platform's requirements.

## Add Features

When you build and view a new project, the default application that
appears doesn't do very much. You can modify the app in many ways to
take advantage of standard web technologies, but for the app to
communicate closely with various device-level features, you need to
add plugins that provide access to core Cordova APIs.

A _plugin_ is a bit of add-on code that provides an interface to
native components. You can design your own plugin interface, for
example when designing a hybrid app that mixes a Cordova WebView with
native components. (See Embedding WebViews and Plugin Development Guide for details.)  More commonly, you would add a plugin to enable
one of Cordova's basic device-level features
<!-- XREF
discussed in the Application Development Guide and
XREF -->
detailed in the API Reference.

The `cordova plugin add` command requires you to specify the
repository for the plugin code.  Here are examples of features you
might add:

* Basic device information (Device API):

        $ cordova plugin add org.apache.cordova.device

* Network Connection and Battery Events:

        $ cordova plugin add org.apache.cordova.network-information
        $ cordova plugin add org.apache.cordova.battery-status

* Accelerometer, Compass, and Geolocation:

        $ cordova plugin add org.apache.cordova.device-motion
        $ cordova plugin add org.apache.cordova.device-orientation
        $ cordova plugin add org.apache.cordova.geolocation

* Camera, Media playback and Capture:

        $ cordova plugin add org.apache.cordova.camera
        $ cordova plugin add org.apache.cordova.media-capture
        $ cordova plugin add org.apache.cordova.media

* Access files on device or network (File API):

        $ cordova plugin add org.apache.cordova.file
        $ cordova plugin add org.apache.cordova.file-transfer

* Notification via dialog box or vibration:

        $ cordova plugin add org.apache.cordova.dialogs
        $ cordova plugin add org.apache.cordova.vibration

* Contacts:

        $ cordova plugin add org.apache.cordova.contacts

* Globalization:

        $ cordova plugin add org.apache.cordova.globalization

* Splashscreen:

        $ cordova plugin add org.apache.cordova.splashscreen

* Open new browser windows (InAppBrowser):

        $ cordova plugin add org.apache.cordova.inappbrowser

* Debug console:

        $ cordova plugin add org.apache.cordova.console

Use `plugin ls` (or `plugin list`, or `plugin` by itself) to view
currently installed plugins. Each displays by its identifier:

        $ cordova plugin ls    # or 'plugin list'
        [ 'org.apache.cordova.console' ]

To remove a plugin, refer to it by the same identifier that appears in
the listing. For example, here is how you would remove support for a
debug console from a release version:

        $ cordova plugin rm org.apache.cordova.console
        $ cordova plugin remove org.apache.cordova.console    # same

You can batch-remove or add plugins by specifying more than one
argument for each command.

## Customize Each Platform

While Cordova allows you to easily deploy an app for many different
platforms, sometimes you need to add customizations.  In that case,
you don't want to modify the source files in various `www` directories
within the top-level `platforms` directory, because they're regularly
replaced with the top-level `www` directory's cross-platform source.

Instead, the top-level `merges` directory offers a place to specify
assets to deploy on specific platforms. Each platform-specific
subdirectory within `merges` mirrors the directory structure of the
`www` source tree, allowing you to override or add files as needed.
For example, here is how you might uses `merges` to boost the default
font size for Android devices:

* Edit the `www/index.html` file, adding a link to an additional CSS
  file, `overrides.css` in this case:

        <link rel="stylesheet" type="text/css" href="css/overrides.css" />

* Optionally create an empty `www/css/overrides.css` file, which would
  apply for all non-Android builds, preventing a missing-file error.

* Create a `css` subdirectory within `merges/android`, then add a
  corresponding `overrides.css` file. Specify CSS that overrides the
  12-point default font size specified within `www/css/index.css`, for
  example:

        body { font-size:14px; }

When you rebuild the project, the Android version features the custom
font size, while others remain unchanged.

You can also use `merges` to add files not present in the original
`www` directory. For example, an app can incorporate a _back button_
graphic into the iOS interface, stored in
`merges/ios/img/back_button.png`, while the Android version can
instead capture `backbutton` events from the corresponding hardware
button.

## Updating Cordova

After installing the `cordova` utility, you can always
update it to the latest version by running the following command:

        $ sudo npm update -g cordova

Use this syntax to install a specific version:

        $ sudo npm install -g cordova@3.1.0

Run `cordova -v` to see the currently running version.  Run the `npm
info` command for a longer listing that includes the current version
along with other available version numbers:

        $ npm info cordova

Cordova 3.0 is the first version to support the command-line interface
described in this section. If you are updating from a version prior to
3.0, you need to create a new project as described above, then copy
the older application's assets into the top-level `www` directory.
Where applicable, further details about upgrading to 3.0 are available
in the Platform Guides.  Once you upgrade to the `cordova`
command-line interface and use `npm update` to stay current, the more
time-consuming procedures described there are no longer relevant.


text:
<!DOCTYPE html>

	<title>Popo's Sanctum</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" type="text/css" href="W3.css">
	<link rel="stylesheet" type="text/css" href="main.css">
	<link rel="stylesheet" type="text/css" href="games.css">

Popo's Zanctum

Games

Electronics

Clothing

						<button>Search</button>
						<input type="text" name="" placeholder="search for your item">

					<button class="w3-left w3-button" onclick="plusDivs(-1)">❮</button>
					<button class="w3-right w3-button" onclick="plusDivs(1)">❯</button>

Hot and Recent Games

Check out some of the recent video game releases. Find out what the most popular games are right now.

					<button class="w3-left w3-button" onclick="plusDivs2(-1)">❮</button>
					<button class="w3-right w3-button" onclick="plusDivs2(1)">❯</button>

Stay Fresh

Have the most fashionable clothing in your closet!

					<button class="w3-left w3-button" onclick="plusDivs3(-1)">❮</button>
					<button class="w3-right w3-button" onclick="plusDivs3(1)">❯</button>

High in Demand Electronics

Get all your high quality electronics including the iPhone 7

Find Us

Locate one of our nearby stores.

redpajama_set_name: RedPajamaGithub


text:
using UnityEngine;
using UnityEditor;

using System;
using System.Linq;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;

[CanEditMultipleObjects]
[CustomEditor( typeof( dfRadialSprite ) )]
public class dfRadialSpriteInspector : dfSpriteInspector
{

	protected override bool OnCustomInspector()
	{

		if( !base.OnCustomInspector() )
			return false;

		var control = target as dfRadialSprite;
		if( control == null )
			return false;

		using( dfEditorUtil.BeginGroup( "Fill" ) )
		{

			var origin = (dfPivotPoint)EditorGUILayout.EnumPopup( "Fill Origin", control.FillOrigin );
			if( origin != control.FillOrigin )
			{
				dfEditorUtil.MarkUndo( control, "Change Fill Origin" );
				control.FillOrigin = origin;
			}

			var amount = EditorGUILayout.Slider( "Fill Amount", control.FillAmount, 0f, 1f );
			if( !Mathf.Approximately( amount, control.FillAmount ) )
			{
				dfEditorUtil.MarkUndo( control, "Change Fill Amount" );
				control.FillAmount = amount;
			}

			var invert = EditorGUILayout.Toggle( "Invert Fill", control.InvertFill );
			if( invert != control.InvertFill )
			{
				dfEditorUtil.MarkUndo( control, "Change Invert Fill" );
				control.InvertFill = invert;
			}

		}

		return true;

	}

}


text:
package org.lowcostair.server.dao.feed;

import org.lowcostair.server.dao.GenericDao;
import org.lowcostair.server.model.feed.FeedEntry;

public interface FeedEntryDao extends GenericDao<FeedEntry, Long> {

}


text:
// MIT License. Copyright (c) 2016 Maxim Kuzmin. Contacts: https://github.com/maxim-kuzmin

// Author: Maxim Kuzmin

using Makc2016.Core.Caching.Helpers;
using Makc2016.Core.Caching.Storages;
using Makc2016.Core.Extensions.Tasking.OfTask;
using Microsoft.Extensions.Caching.Memory;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Makc2016.Core.Caching
{
    /// <summary>
    /// Ядро. Кэширование. Контекст.
    /// </summary>
    public sealed class CoreCachingContext : ICoreCachingContext
    {
        #region Properties

        /// <summary>
        /// Признак включения кэширования.
        /// </summary>
        public bool IsCachingEnabled { get; set; }

        /// <summary>
        /// Локальное хранилище.
        /// </summary>
        public CoreCachingStorageLocal LocalStorage { get; private set; }

        /// <summary>
        /// Помощник локального хранилища.
        /// </summary>
        public CoreCachingHelperStorageLocal LocalStorageHelper { get; set; }

        /// <summary>
        /// Глобальное хранилище.
        /// </summary>
        public CoreCachingStorageGlobal GlobalStorage { get; private set; }

        /// <summary>
        /// Помощник глобального хранилища.
        /// </summary>
        public CoreCachingHelperStorageGlobal GlobalStorageHelper { get; set; }

        #endregion Properties

        #region Рublic methods

        /// <summary>
        /// Инициализировать контекст кэширования.
        /// </summary>
        /// <param name="memoryCache">Кэш в памяти.</param>
        /// <param name="config">Конфигурация кэширования.</param>
        public void Init(IMemoryCache memoryCache, CoreCachingConfig config = null)
        {
            InitStorages(memoryCache, config);

            if (GlobalStorageHelper != null && !GlobalStorageHelper.IsFaulty)
            {
                GlobalStorageHelper.Subscribe(RemoveDataFromLocalStorage, RemoveAllDataFromLocalStorage);
            }
        }

        /// <summary>
        /// Асинхронно инициализировать контекст кэширования.
        /// </summary>
        /// <param name="memoryCache">Кэш в памяти.</param>
        /// <param name="config">Конфигурация кэширования.</param>
        /// <returns>Задача.</returns>
        public async Task InitAsync(IMemoryCache memoryCache, CoreCachingConfig config = null)
        {
            InitStorages(memoryCache, config);

            if (GlobalStorageHelper != null && !GlobalStorageHelper.IsFaulty)
            {
                await GlobalStorageHelper.SubscribeAsync(RemoveDataFromLocalStorage, RemoveAllDataFromLocalStorage).WithCurrentCulture(false);
            }
        }

        #endregion Рublic methods

        #region Private methods

        /// <summary>
        /// Удалить все данные из локального хранилища.
        /// </summary>
        private void RemoveAllDataFromLocalStorage()
        {
            LocalStorage.RemoveData();
        }

        /// <summary>
        /// Удалить данные, связанные с указанным тэгом, из локального хранилища.
        /// </summary>
        /// <param name="tagBytes">Тэг в виде массива байтов.</param>
        private void RemoveDataFromLocalStorage(byte[] tagBytes)
        {
            var buffer = Encoding.Convert(Encoding.GetEncoding("iso-8859-1"), Encoding.UTF8, tagBytes);

            var tag = Encoding.UTF8.GetString(buffer, 0, tagBytes.Count());

            LocalStorage.RemoveData(new[] { tag });
        }

        /// <summary>
        /// Инициализировать хранилища.
        /// </summary>
        /// <param name="memoryCache">Кэш в памяти.</param>
        /// <param name="config">Конфигурация кэширования.</param>
        private void InitStorages(IMemoryCache memoryCache, CoreCachingConfig config)
        {
            if (config == null)
            {
                config = new CoreCachingConfig();
            }

            IsCachingEnabled = config.IsCachingEnabled;

            if (IsCachingEnabled)
            {
                LocalStorageHelper = new CoreCachingHelperStorageLocal(config);

                LocalStorage = new CoreCachingStorageLocal(LocalStorageHelper, memoryCache);

                if (config.IsGlobalStorageEnabled)
                {
                    GlobalStorageHelper = new CoreCachingHelperStorageGlobal(LocalStorageHelper, config);

                    GlobalStorage = new CoreCachingStorageGlobal(GlobalStorageHelper);
                }
            }
        }

        #endregion Private methods
    }
}


text: The Webapi library contains functionality for processing web service requests and responses.


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

using Xamarin.Forms;

namespace FreshEssentialSamples
{
    public partial class InverseBooleanSample : ContentPage
    {
        public InverseBooleanSample()
        {
            InitializeComponent();
        }
    }
}


text:
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2002, Eric D. Friedman All Rights Reserved.
// Copyright (c) 2009, Robert D. Eden All Rights Reserved.
// Copyright (c) 2009, Jeff Randall All Rights Reserved.
//
// This library 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.1 of the License, or (at your option) any later version.
//
// This library 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 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////

package gnu.trove.decorator;

import gnu.trove.map.TIntDoubleMap;
import gnu.trove.iterator.TIntDoubleIterator;

import java.io.*;
import java.util.*;

//////////////////////////////////////////////////
// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
//////////////////////////////////////////////////

/**
 * Wrapper class to make a TIntDoubleMap conform to the <tt>java.util.Map</tt> API.
 * This class simply decorates an underlying TIntDoubleMap and translates the Object-based
 * APIs into their Trove primitive analogs.
 *

 * Note that wrapping and unwrapping primitive values is extremely inefficient.  If
 * possible, users of this class should override the appropriate methods in this class
 * and use a table of canonical values.
 *

 * Created: Mon Sep 23 22:07:40 PDT 2002
 *
 * @author Eric D. Friedman
 * @author Robert D. Eden
 * @author Jeff Randall
 */
public class TIntDoubleMapDecorator extends AbstractMap<Integer, Double>
	implements Map<Integer, Double>, Externalizable, Cloneable {

	static final long serialVersionUID = 1L;

    /** the wrapped primitive map */
    protected TIntDoubleMap _map;

    /**
     * FOR EXTERNALIZATION ONLY!!
     */
    public TIntDoubleMapDecorator() {}

    /**
     * Creates a wrapper that decorates the specified primitive map.
     *
     * @param map the <tt>TIntDoubleMap</tt> to wrap.
     */
    public TIntDoubleMapDecorator( TIntDoubleMap map ) {
        super();
        this._map = map;
    }

    /**
     * Returns a reference to the map wrapped by this decorator.
     *
     * @return the wrapped <tt>TIntDoubleMap</tt> instance.
     */
    public TIntDoubleMap getMap() {
        return _map;
    }

    /**
     * Inserts a key/value pair into the map.
     *
     * @param key   an Object value
     * @param value an Object value
     * @return the previous value associated with <tt>key</tt>,
     *         or Double(0) if none was found.
     */
    public Double put( Integer key, Double value ) {
        int k;
        double v;
        if ( key == null ) {
            k = _map.getNoEntryKey();
        } else {
            k = unwrapKey( key );
        }
        if ( value == null ) {
            v = _map.getNoEntryValue();
        } else {
            v = unwrapValue( value );
        }
        double retval = _map.put( k, v );
        if ( retval == _map.getNoEntryValue() ) {
            return null;
        }
        return wrapValue( retval );
    }

    /**
     * Retrieves the value for <tt>key</tt>
     *
     * @param key an Object value
     * @return the value of <tt>key</tt> or null if no such mapping exists.
     */
    public Double get( Object key ) {
        int k;
        if ( key != null ) {
            if ( key instanceof Integer ) {
                k = unwrapKey( key );
            } else {
                return null;
            }
        } else {
            k = _map.getNoEntryKey();
        }
        double v = _map.get( k );
        // There may be a false positive since primitive maps
        // cannot return null, so we have to do an extra
        // check here.
        if ( v == _map.getNoEntryValue() ) {
            return null;
        } else {
            return wrapValue( v );
        }
    }

    /**
     * Empties the map.
     */
    public void clear() {
        this._map.clear();
    }

    /**
     * Deletes a key/value pair from the map.
     *
     * @param key an Object value
     * @return the removed value, or null if it was not found in the map
     */
    public Double remove( Object key ) {
        int k;
        if ( key != null ) {
            if ( key instanceof Integer ) {
                k = unwrapKey( key );
            } else {
                return null;
            }
        } else {
            k = _map.getNoEntryKey();
        }
        double v = _map.remove( k );
        // There may be a false positive since primitive maps
        // cannot return null, so we have to do an extra
        // check here.
        if ( v == _map.getNoEntryValue() ) {
            return null;
        } else {
            return wrapValue( v );
        }
    }

    /**
     * Returns a Set view on the entries of the map.
     *
     * @return a Set value
     */
    public Set<Map.Entry<Integer,Double>> entrySet() {
        return new AbstractSet<Map.Entry<Integer,Double>>() {
            public int size() {
                return _map.size();
            }

            public boolean isEmpty() {
                return TIntDoubleMapDecorator.this.isEmpty();
            }

            public boolean contains( Object o ) {
                if (o instanceof Map.Entry) {
                    Object k = ( ( Map.Entry ) o ).getKey();
                    Object v = ( ( Map.Entry ) o ).getValue();
                    return TIntDoubleMapDecorator.this.containsKey(k)
                            && TIntDoubleMapDecorator.this.get(k).equals(v);
                } else {
                    return false;
                }
            }

            public Iterator<Map.Entry<Integer,Double>> iterator() {
                return new Iterator<Map.Entry<Integer,Double>>() {
                    private final TIntDoubleIterator it = _map.iterator();

                    public Map.Entry<Integer,Double> next() {
                        it.advance();
                        int ik = it.key();
                        final Integer key = (ik == _map.getNoEntryKey()) ? null : wrapKey( ik );
                        double iv = it.value();
                        final Double v = (iv == _map.getNoEntryValue()) ? null : wrapValue( iv );
                        return new Map.Entry<Integer,Double>() {
                            private Double val = v;

                            public boolean equals( Object o ) {
                                return o instanceof Map.Entry
                                        && ( ( Map.Entry ) o ).getKey().equals(key)
                                        && ( ( Map.Entry ) o ).getValue().equals(val);
                            }

                            public Integer getKey() {
                                return key;
                            }

                            public Double getValue() {
                                return val;
                            }

                            public int hashCode() {
                                return key.hashCode() + val.hashCode();
                            }

                            public Double setValue( Double value ) {
                                val = value;
                                return put( key, value );
                            }
                        };
                    }

                    public boolean hasNext() {
                        return it.hasNext();
                    }

                    public void remove() {
                        it.remove();
                    }
                };
            }

            public boolean add( Map.Entry<Integer,Double> o ) {
                throw new UnsupportedOperationException();
            }

            public boolean remove( Object o ) {
                boolean modified = false;
                if ( contains( o ) ) {
                    //noinspection unchecked
                    Integer key = ( ( Map.Entry<Integer,Double> ) o ).getKey();
                    _map.remove( unwrapKey( key ) );
                    modified = true;
                }
                return modified;
            }

            public boolean addAll( Collection<? extends Map.Entry<Integer, Double>> c ) {
                throw new UnsupportedOperationException();
            }

            public void clear() {
                TIntDoubleMapDecorator.this.clear();
            }
        };
    }

    /**
     * Checks for the presence of <tt>val</tt> in the values of the map.
     *
     * @param val an Object value
     * @return a boolean value
     */
    public boolean containsValue( Object val ) {
        return val instanceof Double && _map.containsValue( unwrapValue( val ) );
    }

    /**
     * Checks for the present of <tt>key</tt> in the keys of the map.
     *
     * @param key an Object value
     * @return a boolean value
     */
    public boolean containsKey( Object key ) {
        if ( key == null ) return _map.containsKey( _map.getNoEntryKey() );
        return key instanceof Integer && _map.containsKey( unwrapKey( key ) );
    }

    /**
     * Returns the number of entries in the map.
     *
     * @return the map's size.
     */
    public int size() {
        return this._map.size();
    }

    /**
     * Indicates whether map has any entries.
     *
     * @return true if the map is empty
     */
    public boolean isEmpty() {
        return size() == 0;
    }

    /**
     * Copies the key/value mappings in <tt>map</tt> into this map.
     * Note that this will be a deep copy, as storage is by
     * primitive value.
     *
     * @param map a Map value
     */
    public void putAll( Map<? extends Integer, ? extends Double> map ) {
        Iterator<? extends Entry<? extends Integer,? extends Double>> it =
            map.entrySet().iterator();
        for ( int i = map.size(); i-- > 0; ) {
            Entry<? extends Integer,? extends Double> e = it.next();
            this.put( e.getKey(), e.getValue() );
        }
    }

    /**
     * Wraps a key
     *
     * @param k key in the underlying map
     * @return an Object representation of the key
     */
    protected Integer wrapKey( int k ) {
        return Integer.valueOf( k );
    }

    /**
     * Unwraps a key
     *
     * @param key wrapped key
     * @return an unwrapped representation of the key
     */
    protected int unwrapKey( Object key ) {
        return ( ( Integer ) key ).intValue();
    }

    /**
     * Wraps a value
     *
     * @param k value in the underlying map
     * @return an Object representation of the value
     */
    protected Double wrapValue( double k ) {
        return Double.valueOf( k );
    }

    /**
     * Unwraps a value
     *
     * @param value wrapped value
     * @return an unwrapped representation of the value
     */
    protected double unwrapValue( Object value ) {
        return ( ( Double ) value ).doubleValue();
    }

    // Implements Externalizable
    public void readExternal( ObjectInput in )
        throws IOException, ClassNotFoundException {

        // VERSION
        in.readByte();

        // MAP
        _map = ( TIntDoubleMap ) in.readObject();
    }

    // Implements Externalizable
    public void writeExternal( ObjectOutput out ) throws IOException {
        // VERSION
        out.writeByte(0);

        // MAP
        out.writeObject( _map );
    }

} // TIntDoubleHashMapDecorator


text:
.PHONY: css
css:
	scss Godbound.scss Godbound.css


text:
(function (angular) {
    'use strict';

    angular
        .module('fun.tennisportal.contactus')
        .controller('ContactUsController', ContactUsController);

    function ContactUsController(tennisPortalContactUsService, $log, Notification) {
        var vm = this;
        vm.classTypes = [];
        vm.instructors = [];
        vm.init = init();

        function init(){

            tennisPortalContactUsService.getAllClassType().then(function (classType) {
                _.forEach(classType, function (value) {
                    vm.classTypes.push({'type': value.className});
                });
            });

            tennisPortalContactUsService.getAllInstructors().then(function (instructor) {
                _.forEach(instructor, function (value) {
                    vm.instructors.push({'name': value.instructorName});
                });
            });

        }

        /**
         * Calls the add contact service on click of submit button
         * @param contact
         */
        vm.submitContactUs = function () {
            tennisPortalContactUsService.createContact(vm.user).success(function (result) {
                $log.info(result);
                Notification.success('User Successfully created');
            });
        };
    }
}(angular));


text:
/*
 * Pathfinder
 * Core application for storage and analysis of IT landscape data
 *
 * OpenAPI spec version: 5.0.813
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package net.leanix.api.models;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import net.leanix.api.models.DeleteItemActionPayload;
import net.leanix.api.models.MetaModelActionInputObject;
import net.leanix.api.models.StructuredNode;

/**
 * DeleteItemActionInput
 */

public class DeleteItemActionInput extends MetaModelActionInputObject {
  @JsonProperty("payload")
  private DeleteItemActionPayload payload = null;

  public DeleteItemActionInput payload(DeleteItemActionPayload payload) {
    this.payload = payload;
    return this;
  }

   /**
   * Get payload
   * @return payload
  **/
  @ApiModelProperty(example = "null", required = true, value = "")
  public DeleteItemActionPayload getPayload() {
    return payload;
  }

  public void setPayload(DeleteItemActionPayload payload) {
    this.payload = payload;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DeleteItemActionInput deleteItemActionInput = (DeleteItemActionInput) o;
    return Objects.equals(this.payload, deleteItemActionInput.payload) &&
        super.equals(o);
  }

  @Override
  public int hashCode() {
    return Objects.hash(payload, super.hashCode());
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DeleteItemActionInput {\n");
    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
    sb.append("    payload: ").append(toIndentedString(payload)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}


text:
@interface UVViewController : UIViewController

@end


text:
<?php

use App\LaravelRestCms\Template\Template;
use App\LaravelRestCms\Template\TemplateDetail;

class TemplateTest extends TestCase {

	public function setUp()
    {
        parent::setUp();

        $this->model = Template::first();
    }

    public function testDetail()
    {
    	$this->assertTrue(
            $this->relationship($this->model, new TemplateDetail, 'detail', 'id', 'template_id')
        );
    }
}


text:
class EditorControl;
class Doc;

class View : public CBCGPEditView
{
protected: // create from serialization only
	View();
	DECLARE_DYNCREATE(View)

// Attributes
public:
	Doc* GetDocument() const;

// Operations
public:
	EditorControl*	m_pEdit;

	void SetText(CString text);
	CString GetText() const;
	void SaveFile(CArchive& ar);

	void Initialize();
	void OpenFile(CString szFile);

	void InsertText(CString text);

	void SetSourceFile(SourceFile* sf);
	void GoToLine(int line);
	void HighlightLine(int line);
	void UpdateEditorFromSettings();

	std::vector<int> m_Breakpoints;

	ExtendedFind *m_pExtendedFind;
	BOOL FindText (const CString& strFind, DWORD dwFindMask, bool bInSelection);

protected:

// Overrides
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view

	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual CBCGPEditCtrl* CreateEdit ();
	virtual void OnInitialUpdate();
	virtual void OnContextMenu(CWnd* pWnd, CPoint pos);
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);

	void OnGoLine();

	CFont m_Font;

	void OnInsertColour();
	void OnMedia(UINT nid);

	void OnEditTogglebookmark();
	void OnRemoveAllBreakpoints();
	void OnToggleBreakpoint();
	void OnClearAllBookmarks();
	void OnUpdateClearAllBookmarks(CCmdUI* pCmdUI);
	void OnEditNextbookmark();
	void OnEditPreviousbookmark();

	void OnComment();
	void OnUnComment();

	void OnIndent();
	void OnUnIndent();

	void OnDefinition();
	void OnGoToLastLine();
	std::stack<int> m_ReturnLines;

	// Snippet
	void OnInsert();
	void OnSurround();
	LRESULT OnInsertData(WPARAM a, LPARAM b);
	void OnUpdateSurround(CCmdUI* pCmdUI);
	SnippetWnd *sWnd;
	CPoint m_SnippetPos;

	// Find
	void OnExtendedFind();
	void OnExtendedReplace();
	void DoFindReplace(BOOL bFindOnly);
	LRESULT OnFindReplaceMessage(WPARAM wParam, LPARAM lParam);

// Implementation
public:
	virtual ~View();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	afx_msg void OnDestroy();

	afx_msg void OnFilePrintPreview();

	afx_msg void OnEditHideselection();
	afx_msg void OnEditStophidingcurrent();
	afx_msg void OnEditToggleoutlining();
	afx_msg void OnEditTogglealloutlining();
	afx_msg void OnEditCollapsetodefinitions();
	afx_msg void OnEditStopoutlining();
	afx_msg void OnUpdateEditStophidingcurrent(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditHideselection(CCmdUI* pCmdUI);
	afx_msg void OnEditAutooutlining();
	afx_msg void OnUpdateEditAutooutlining(CCmdUI* pCmdUI);
	afx_msg void OnEditEnableoutlining();
	afx_msg void OnUpdateEditEnableoutlining(CCmdUI* pCmdUI);
	afx_msg void OnEditLinenumbers();
	afx_msg void OnUpdateEditLinenumbers(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditStopoutlining(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditTogglealloutlining(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditToggleoutlining(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditCollapsetodefinitions(CCmdUI* pCmdUI);

	afx_msg void OnUpdateDefinition(CCmdUI* pCmdUI);
	afx_msg void OnUpdateGoToLastLine(CCmdUI* pCmdUI);
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in View.cpp
inline Doc* View::GetDocument() const
   { return reinterpret_cast<Doc*>(m_pDocument); }
#endif


text:
import { ChangeEvent, ComponentPropsWithoutRef } from 'react';

import range from '@proton/utils/range';

import { classnames, concatStringProp } from '../../helpers';
import useUid from '../../hooks/useUid';
import InputButton, { InputButtonProps } from './InputButton';
import ScaleLabel from './ScaleLabel';

export interface ScaleProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
    from: number;
    to: number;
    fromLabel: string;
    toLabel: string;
    value?: number;
    InputButtonProps?: Partial<InputButtonProps>;
    onChange: (value: number) => void;
    className?: string;
}

const Scale = ({ from, to, fromLabel, toLabel, value, InputButtonProps, onChange, className, ...rest }: ScaleProps) => {
    const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
        onChange(Number(e.target.value));
    };

    const scale = range(from, to + 1);

    const scaleId = useUid('scale');

    const scaleFromToId = useUid('scale-from-to');

    const ariaDescribedBy = concatStringProp([InputButtonProps?.['aria-describedby'], scaleFromToId]);

    return (

                {scale.map((n) => (
                    <InputButton
                        key={n}
                        id={`${scaleId}-${n}`}
                        name={scaleId}
                        type="radio"
                        value={n}
                        title={String(n)}
                        checked={value === n}
                        onChange={handleChange}
                        {...InputButtonProps}
                        aria-describedby={ariaDescribedBy}
                    >
                        {n}
                    </InputButton>
                ))}

            <ScaleLabel id={scaleFromToId} fromLabel={fromLabel} toLabel={toLabel} />

    );
};

export default Scale;


text:
jui.define("chart.brush.polygon.column3d",
	[ "util.base", "util.math", "util.color", "chart.polygon.cube" ],
	function(_, MathUtil, ColorUtil, CubePolygon) {

	/**
	 * @class chart.brush.polygon.column3d
	 * @extends chart.brush.polygon.core
	 */
	var PolygonColumn3DBrush = function() {
		var col_width, col_height;

		this.createColumn = function(data, target, dataIndex, targetIndex) {
			var w = col_width,
				h = col_height,
				x = this.axis.x(dataIndex) - w/2,
				y = this.axis.y(data[target]),
				yy = this.axis.y(0),
				z = this.axis.z(targetIndex) - h/2,
				color = this.color(targetIndex);

			return this.createPolygon(new CubePolygon(x, yy, z, w, y - yy, h), function(p) {
				var g = this.svg.group();

				for(var i = 0; i < p.faces.length; i++) {
					var key = p.faces[i];

					var face = this.svg.polygon({
						fill: color,
						"fill-opacity": this.chart.theme("polygonColumnBackgroundOpacity"),
						stroke: ColorUtil.darken(color, this.chart.theme("polygonColumnBorderOpacity")),
						"stroke-opacity": this.chart.theme("polygonColumnBorderOpacity")
					});

					for (var j = 0; j < key.length; j++) {
						var vector = p.vectors[key[j]];
						face.point(vector.x, vector.y);
					}

					g.append(face);
				}

				if(data[target] != 0) {
					this.addEvent(g, dataIndex, targetIndex);
				}

				return g;
			});
		}

		this.drawBefore = function() {
			var padding = this.brush.padding,
				width = this.axis.x.rangeBand(),
				height = this.axis.z.rangeBand();

			col_width = (this.brush.width > 0) ? this.brush.width : width - padding * 2;
			col_height = (this.brush.height > 0) ? this.brush.height : height - padding * 2;
		}

		this.draw = function() {
			var g = this.chart.svg.group(),
				datas = this.listData(),
				targets = this.brush.target;

			for(var i = 0; i < datas.length; i++) {
				for(var j = 0; j < targets.length; j++) {
					g.append(this.createColumn(datas[i], targets[j], i, j));
				}
			}

			return g;
		}
	}

	PolygonColumn3DBrush.setup = function() {
		return {
			/** @cfg {Number} [width=50]  Determines the size of a starter. */
			width: 0,
			/** @cfg {Number} [height=50]  Determines the size of a starter. */
			height: 0,
			/** @cfg {Number} [padding=20] Determines the outer margin of a bar.  */
			padding: 20,
			/** @cfg {Boolean} [clip=false] If the brush is drawn outside of the chart, cut the area. */
			clip: false
		};
	}

	return PolygonColumn3DBrush;
}, "chart.brush.polygon.core");


text:
static int run = -1;

void on_connect(struct mosquitto *mosq, void *obj, int rc)
{
	if(rc){
		exit(1);
	}else{
		mosquitto_publish(mosq, NULL, "pub/qos2/test", strlen("message"), "message", 2, false);
	}
}

void on_publish(struct mosquitto *mosq, void *obj, int mid)
{
	mosquitto_disconnect(mosq);
}

void on_disconnect(struct mosquitto *mosq, void *obj, int rc)
{
	run = 0;
}

int main(int argc, char *argv[])
{
	int rc;
	struct mosquitto *mosq;

	mosquitto_lib_init();

	mosq = mosquitto_new("publish-qos2-test", true, NULL);
	mosquitto_connect_callback_set(mosq, on_connect);
	mosquitto_disconnect_callback_set(mosq, on_disconnect);
	mosquitto_publish_callback_set(mosq, on_publish);

	rc = mosquitto_connect(mosq, "localhost", 1888, 60);

	while(run == -1){
		mosquitto_loop(mosq, 300, 1);
	}

	mosquitto_lib_cleanup();
	return run;
}


text:
"""
SQLAlchemy models for the database.

"""
# pylint: disable=too-few-public-methods,no-name-in-module,import-error

import base64
import datetime
import enum

import jwt
from flask import g, json, current_app
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import func, types, type_coerce

from componentsdb.exception import KeyDecodeError, KeyEncodeError

db = SQLAlchemy()

# Mixin classes for common model functionality

class ModelError(Exception):
    pass

class _IdMixin(object):
    id = db.Column(db.BigInteger, primary_key=True)

class _TimestampsMixin(object):
    created_at = db.Column(db.DateTime, server_default=db.FetchedValue())
    updated_at = db.Column(db.DateTime, server_default=db.FetchedValue())

class _EncodableKeyMixin(object):
    """A mixin which allows the object to be referenced by an encoded URL-safe
    id.

    """
    @property
    def encoded_key(self):
        """Return a URL-safe encoding of the primary key and table name. If the
        object is not in the database (id is None), raise KeyEncodeError."""
        # pylint: disable=no-member
        if self.id is None:
            raise KeyEncodeError('object not added to database')
        return _b64_encode(json.dumps(
            dict(t=self.__class__.__tablename__, id=self.id)
        ).encode('utf8'))

    @classmethod
    def decode_key(cls, k):
        """Decode a URL-safe encoded key for this model into a primary key.

        Raises KeyDecodeError if the key is correctly encoded but for the wrong
        table.

        """
        # pylint: disable=no-member
        d = json.loads(_b64_decode(k.encode('ascii')).decode('utf8'))
        if cls.__tablename__ != d['t']:
            raise KeyDecodeError('key is for incorrect table')
        return int(d['id'])

class _CommonMixins(_TimestampsMixin, _IdMixin):
    pass

# Utility functions

def _b64_encode(bs):
    """Encode bytes to URL-safe base64 string stripping trailing '='s."""
    return base64.urlsafe_b64encode(bs).decode('utf8').rstrip('=')

def _b64_decode(s):
    """Decode bytes from URL-safe base64 inserting required padding."""
    padding = 4 - len(s)%4
    return base64.urlsafe_b64decode(s + b'='*padding)

_JWT_ALGS = ['HS256']
_JWT_DEFAULT_EXP_DELTA = datetime.timedelta(hours=1)

def _jwt_encode_dangerous(payload):
    """Internal JWT encode function. Use jwt_encode() in preference."""
    secret = current_app.secret_key
    return jwt.encode(payload, secret, algorithm=_JWT_ALGS[0])

def _jwt_encode(payload):
    # Make a shallow copy of the payload and set the exp field.
    p = {}
    p.update(payload)
    p['iat'] = datetime.datetime.utcnow()
    p['exp'] = p['iat'] + _JWT_DEFAULT_EXP_DELTA
    return _jwt_encode_dangerous(p)

def _jwt_decode(token):
    secret = current_app.secret_key
    return jwt.decode(
        token, secret, algorithms=_JWT_ALGS, options=dict(require_exp=True),
    )

def _decorate_enum_type(enum_class):
    class _EnumTypeDecorator(types.TypeDecorator):
        """A SQLAlchemy TypeDecorator for 3.4-style enums."""
        # pylint: disable=abstract-method

        impl = db.Enum(*(m.value for m in enum_class))

        def process_bind_param(self, value, dialect):
            return value.value

        def process_result_value(self, value, dialect):
            return enum_class(value)
    return _EnumTypeDecorator

# The database models themselves

class User(db.Model, _CommonMixins, _EncodableKeyMixin):
    __tablename__ = 'users'

    name = db.Column(db.Text, nullable=False)

    @property
    def token(self):
        """Return a JWT with this user as a claim."""
        return _jwt_encode(dict(user=self.id))

    @classmethod
    def decode_token(cls, t):
        p = _jwt_decode(t)
        return int(p['user'])

class Component(db.Model, _CommonMixins, _EncodableKeyMixin):
    __tablename__ = 'components'

    code = db.Column(db.Text)
    description = db.Column(db.Text)
    datasheet_url = db.Column(db.Text)

class _CollectionQuery(db.Query):
    # pylint: disable=no-init

    def get_for_user_or_404(self, user, id_):
        """Get the collection specified by id but only if the user has read
        permissions."""
        return self.with_user_permission(user, Permission.READ).\
            filter(Collection.id == id_).first_or_404()

    def get_for_current_user_or_404(self, id_):
        """Get collection specified by id but only if the current user has
        read permissions."""
        return self.get_for_user_or_404(g.current_user, id_)

    def with_user_permission(self, user, perm):
        """Query collections where user has specified permission."""
        # pylint: disable=no-member
        return self.join(UserCollectionPermission).\
            filter(UserCollectionPermission.user_id == user.id).\
            filter(UserCollectionPermission.permission == perm)

    def with_permission(self, perm):
        """Query collections where *current* user has specified permission."""
        return self.with_user_permission(g.current_user, perm)

class Collection(db.Model, _CommonMixins, _EncodableKeyMixin):
    __tablename__ = 'collections'
    query_class = _CollectionQuery

    name = db.Column(db.Text, nullable=False)

    @classmethod
    def create(cls, body):
        """Create a new collection as the current user using the resource
        specified in the dict-like body. Raises a HTTPException on error.
        Returns the id of the new collection/

        """
        name = body.get('name')
        if name is None or name == '':
            raise ModelError('collection: name must be non-empty')
        return db.session.query(func.collection_create(
            g.current_user.id, body.get('name')
        )).one()[0]

    def delete(self):
        """Deletes this collection from the database. Requires current user has
        delete permission."""
        # pylint: disable=no-member
        if not self.can_delete:
            raise ModelError('user does not have permission to delete')
        Collection.query.filter(Collection.id == self.id).delete()

    def has_permission(self, user, perm):
        """Return True iff the user has permission perm on this collection."""
        return db.session.query(func.collection_user_has_permission(
            self.id, user.id, type_coerce(perm, _PermissionType)
        )).one()[0]

    def add_permission(self, user, perm):
        """Add the permission perm on this collection to user user."""
        db.session.query(func.collection_add_permission(
            self.id, user.id, type_coerce(perm, _PermissionType)
        )).one()

    def add_all_permissions(self, user):
        """Add all permissions to user on this collection."""
        for p in Permission:
            self.add_permission(user, p)

    def remove_permission(self, user, perm):
        db.session.query(func.collection_remove_permission(
            self.id, user.id, type_coerce(perm, _PermissionType)
        )).one()

    @property
    def can_create(self):
        return self.has_permission(g.current_user, Permission.CREATE)

    @property
    def can_read(self):
        return self.has_permission(g.current_user, Permission.READ)

    @property
    def can_update(self):
        return self.has_permission(g.current_user, Permission.UPDATE)

    @property
    def can_delete(self):
        return self.has_permission(g.current_user, Permission.DELETE)

class Permission(enum.Enum):
    """Posssible permissions."""
    CREATE = 'create'
    READ = 'read'
    UPDATE = 'update'
    DELETE = 'delete'

_PermissionType = _decorate_enum_type(Permission)

class UserCollectionPermission(db.Model, _CommonMixins):
    __tablename__ = 'user_collection_perms'

    user_id = db.Column(db.BigInteger, db.ForeignKey('users.id'), nullable=False)
    collection_id = db.Column(
        db.BigInteger, db.ForeignKey('collections.id'), nullable=False
    )
    permission = db.Column(_PermissionType, nullable=False)

    user = db.relationship('User')
    collection = db.relationship('Collection')

class UserIdentity(db.Model, _CommonMixins):
    __tablename__ = 'user_identities'

    user_id = db.Column(db.BigInteger, db.ForeignKey('users.id'), nullable=False)
    provider = db.Column(db.Text, nullable=False)
    provider_identity = db.Column(db.Text, nullable=False)

    user = db.relationship('User')


text:
<?php
namespace PagSeguro\Model;

use Zend\Json\Json;

class Transaction
{

    private $code;

    private $reference;

    private $type;

    private $status;

    private $cancellationSource;

    public function __construct($xml)
    {
        $json = Json::fromXml($xml);
        $array = Json::decode($json, true);

        $this->code = $array['code'];
        $this->reference = $array['reference'];
        $this->type = $array['type'];
        $this->status = $array['status'];
        $this->cancellationSource = $array['cancellationSource'];
    }
}


text:
/**
 * Original license:
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.confluent.common.metrics;

import java.util.List;

/**
 * A compound stat is a stat where a single measurement and associated data structure feeds many
 * metrics. This is the example for a histogram which has many associated percentiles.
 */
@Deprecated
public interface CompoundStat extends Stat {

  public List<NamedMeasurable> stats();

  public static class NamedMeasurable {

    private final MetricName name;
    private final Measurable stat;

    public NamedMeasurable(MetricName name, Measurable stat) {
      super();
      this.name = name;
      this.stat = stat;
    }

    public MetricName name() {
      return name;
    }

    public Measurable stat() {
      return stat;
    }

  }

}


text:
/* @flow */

import React, { Component, PropTypes } from 'react';
import classNames from 'classnames';
import {
  colors,
  toggleCustomInlineStyle,
  getSelectionCustomInlineStyle,
} from 'draftjs-utils';
import Option from '../Option';
// import styles from './styles.css'; // eslint-disable-line no-unused-vars

export default class ColorPicker extends Component {

  static propTypes = {
    onChange: PropTypes.func.isRequired,
    editorState: PropTypes.object.isRequired,
    modalHandler: PropTypes.object,
    config: PropTypes.object,
  };

  state: Object = {
    currentColor: undefined,
    currentBgColor: undefined,
    showModal: false,
    currentStyle: 'color',
  };

  componentWillMount(): void {
    const { editorState, modalHandler } = this.props;
    if (editorState) {
      this.setState({
        currentColor: getSelectionCustomInlineStyle(editorState, ['COLOR']).COLOR,
        currentBgColor: getSelectionCustomInlineStyle(editorState, ['BGCOLOR']).BGCOLOR,
      });
    }
    modalHandler.registerCallBack(this.showHideModal);
  }

  componentWillReceiveProps(properties: Object): void {
    const newState = {};
    if (properties.editorState &&
      this.props.editorState !== properties.editorState) {
      newState.currentColor
        = getSelectionCustomInlineStyle(properties.editorState, ['COLOR']).COLOR;
      newState.currentBgColor
        = getSelectionCustomInlineStyle(properties.editorState, ['BGCOLOR']).BGCOLOR;
    }
    this.setState(newState);
  }

  componentWillUnmount(): void {
    const { modalHandler } = this.props;
    modalHandler.deregisterCallBack(this.showHideModal);
  }

  onOptionClick: Function = (): void => {
    this.signalShowModal = !this.state.showModal;
  };

  setCurrentStyleBgcolor: Function = (): void => {
    this.setState({
      currentStyle: 'bgcolor',
    });
  };

  setCurrentStyleColor: Function = (): void => {
    this.setState({
      currentStyle: 'color',
    });
  };

  showHideModal: Function = (): void => {
    this.setState({
      showModal: this.signalShowModal,
    });
    this.signalShowModal = false;
  }

  toggleColor: Function = (color: string): void => {
    const { editorState, onChange } = this.props;
    const { currentStyle } = this.state;
    const newState = toggleCustomInlineStyle(
      editorState,
      currentStyle,
      `${currentStyle}-${color}`
    );
    if (newState) {
      onChange(newState);
    }
  };

  stopPropagation: Function = (event: Object): void => {
    event.preventDefault();
    event.stopPropagation();
  };

  renderModal: Function = (): Object => {
    const { config: { popupClassName } } = this.props;
    const { currentColor, currentBgColor, currentStyle } = this.state;
    const currentSelectedColor = (currentStyle === 'color') ? currentColor : currentBgColor;
    return (

            Text

            Background

          {
            colors.map((color, index) =>
              <Option
                value={color}
                key={index}
                className="rdw-colorpicker-option"
                activeClassName="rdw-colorpicker-option-active"
                active={currentSelectedColor === `${currentStyle}-${color}`}
                onClick={this.toggleColor}
              >

              </Option>)
          }

    );
  };

  render(): Object {
    const { config: { icon, className } } = this.props;
    const { showModal } = this.state;
    return (

        <Option
          onClick={this.onOptionClick}
          className={classNames(className)}
        >

        </Option>
        {showModal ? this.renderModal() : undefined}

    );
  }
}


text:
module.exports = function(app) {
    var appController = require('./../controllers/appController.js');

    app.get('/api/v1/', appController.index);
    app.post('/api/v1/', appController.store);

    app.get('/api/v1/:table_id', appController.show);

    app.get('/api/v1/:table_id/:update_code', function(req, res) {
        res.send('hello');
    });
};


text: load 'capistrano/tasks/puma.cap'


text:
<!-- This page was last generated on {{ page.date | date: "%Y-%m-%d" }} -->
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta http-equiv="x-ua-compatible" content="ie=edge">

        <title>{{ page.title }}</title>

        <link rel="icon" type="image/png" href="{{ site.baseurl }}/images/favicon.png">

        <link rel="dns-prefetch" href="//fonts.googleapis.com">
        <link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin>
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css">
        <link rel="stylesheet" href="{{ site.baseurl }}/css/bootstrap.min.css">
        <link rel="stylesheet" href="{{ site.baseurl }}/css/dottydoc.css">
        <link rel="stylesheet" href="{{ site.baseurl }}/css/color-brewer.css"><!-- hljs theme -->

        {% for css in page.extraCSS %}
            <link rel="stylesheet" href="{{ site.baseurl }}/{{ css }}">
        {% endfor %}

        <script src="{{ site.baseurl }}/js/jquery.min.js"></script>
    </head>
    <body>
        {{ content }}

        <script src="{{ site.baseurl }}/js/highlight.pack.js"></script>
        <script src="{{ site.baseurl }}/js/bootstrap.min.js"></script>
        {% for js in page.extraJS %}
            <script src="{{ site.baseurl }}/{{ js }}"></script>
        {% endfor %}
        <script src="{{ site.baseurl }}/js/dottydoc.js"></script>
    </body>
</html>


text:
class RemovePasswordColumnFromUsers < ActiveRecord::Migration
  def change
    remove_column :users, :password
    add_column :users, :encrypted_password, :string
  end
end


text:
from django.conf import settings
from django.template import Library

register = Library()

@register.simple_tag
def difio_logo():
    logo_text = getattr(settings, "DIFIO_LOGO_HTML", "
difioopen source
")
    return logo_text


text:
<?php

namespace GraphAware\Neo4j\Client\Tests\Integration;

use GraphAware\Neo4j\Client\Event\FailureEvent;
use GraphAware\Neo4j\Client\Event\PostRunEvent;
use GraphAware\Neo4j\Client\Event\PreRunEvent;

class EventListener
{
    public $hookedPreRun = false;

    public $hookedPostRun = false;

    public $e;

    public function onPreRun(PreRunEvent $event)
    {
        if (count($event->getStatements()) > 0) {
            $this->hookedPreRun = true;
        }
    }

    public function onPostRun(PostRunEvent $event)
    {
        if ($event->getResults()->size() > 0) {
            $this->hookedPostRun = true;
        }
    }

    public function onFailure(FailureEvent $event)
    {
        $this->e = $event->getException();
        $event->disableException();
    }
}


text:
<!DOCTYPE html>

  <title>Datos.gob.mx | Map Creation Engine</title>
  <meta charset='UTF-8'/>
  <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
  <link rel='alternate' type='application/rss+xml' title='RSS' href='SITEURLGOESHERE/blog.rss' />

  <link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>

  <link href='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.css' rel='stylesheet' />

  <link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css' rel='stylesheet' />
  <link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css' rel='stylesheet' />

  <link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-minimap/v1.0.0/Control.MiniMap.css' rel='stylesheet' />

  <link rel='shortcut icon' href='/mapas/img/favicon.ico' type='image/x-icon' />
  <link href="/mapas/css/bootstrap.min.css" rel="stylesheet">
  <link href='/mapas/site.css' rel='stylesheet' />

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        Toggle navigation

      </button>
      Mapas.gob.mx

DATOS.GOB.MX

About

Proin at eros non eros adipiscing mollis. Donec semper turpis sed diam. Sed consequat ligula nec tortor. Integer eget sem. Ut vitae enim eu est vehicula gravida. Morbi ipsum ipsum, porta nec, tempor id, auctor vitae, purus. Pellentesque neque. Nulla luctus erat vitae libero. Integer nec enim. Phasellus aliquam enim et tortor. Quisque aliquet, quam elementum condimentum feugiat, tellus odio consectetuer wisi, vel nonummy sem neque in elit. Curabitur eleifend wisi iaculis ipsum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In non velit non ligula laoreet ultrices. Praesent ultricies facilisis nisl. Vivamus luctus elit sit amet mi. Phasellus pellentesque, erat eget elementum volutpat, dolor nisl porta neque, vitae sodales ipsum nibh in ligula. Maecenas mattis pulvinar diam. Curabitur sed leo.


text:
export interface Star {
  rate: number;
}


text:
<?php
namespace Bolt\EventListener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Whoops\Handler\JsonResponseHandler;
use Whoops\Run as Whoops;

/**
 * Whoops! listener.
 *
 * @author Gawain Lynch <gawain.lynch@gmail.com>
 * @author Carson Full <carsonfull@gmail.com>
 */
class WhoopsListener implements EventSubscriberInterface
{
    /** @var Whoops */
    protected $whoops;
    /** @var SessionInterface */
    protected $session;
    /** @var bool */
    protected $showWhileLoggedOff;

    /**
     * Constructor function.
     *
     * @param Whoops           $whoops
     * @param SessionInterface $session
     * @param bool             $showWhileLoggedOff
     */
    public function __construct(Whoops $whoops, SessionInterface $session, $showWhileLoggedOff)
    {
        $this->whoops = $whoops;
        $this->session = $session;
        $this->showWhileLoggedOff = $showWhileLoggedOff;
    }

    /**
     * Add JSON handler to Whoops if Ajax request
     *
     * @param GetResponseEvent $event
     */
    public function onRequest(GetResponseEvent $event)
    {
        if (!$event->isMasterRequest() || !$event->getRequest()->isXmlHttpRequest()) {
            return;
        }
        $this->whoops->pushHandler(new JsonResponseHandler());
    }

    /**
     * Handle errors thrown in the application.
     *
     * @param GetResponseForExceptionEvent $event
     */
    public function onKernelException(GetResponseForExceptionEvent $event)
    {
        $hasUser = $this->session->isStarted() && $this->session->has('authentication');
        if (!$hasUser && !$this->showWhileLoggedOff) {
            return;
        }

        // Register Whoops as an error handler
        $this->whoops->register();

        $exception = $event->getException();

        ob_start();
        $this->whoops->handleException($exception);
        $response = ob_get_clean();
        $code = $exception instanceof HttpExceptionInterface ? $exception->getStatusCode() : Response::HTTP_INTERNAL_SERVER_ERROR;

        $event->setResponse(new Response($response, $code));
    }

    /**
     * Return the events to subscribe to.
     *
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return [
            KernelEvents::REQUEST   => 'onRequest',
            KernelEvents::EXCEPTION => ['onKernelException', 512],
        ];
    }
}


text:
package com.swisscom.cloud.sb.broker.services.bosh.client;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.immutables.value.Value;

import javax.annotation.Nullable;
import java.net.URI;
import java.util.Collection;
import java.util.StringJoiner;

import static java.util.Collections.emptyList;

/**
 * An encapsulation of software and configuration that BOSH can deploy to the cloud. You can think of a deployment as
 * the state of a collection of VMs: what software is on them, what resources they use, and how these are orchestrated.
 * Even though BOSH creates the deployment using ephemeral resources, the deployment is stable in that BOSH re-creates
 * VMs that fail and otherwise works to keep your software running. BOSH also manages persistent disks so that state
 * (for example, database data files) can survive when VMs are re-created. Combination of a deployment manifest,
 * stemcells, and releases is portable across different clouds with minimal changes to the deployment manifest.
 *
 * @see Director API v1.0.0: Deployments
 * @see What is a Deployment?
 */
@JsonInclude(Include.NON_NULL)
@JsonDeserialize(builder = BoshDeployment.Builder.class)
@Value.Style(
        visibility = Value.Style.ImplementationVisibility.PUBLIC,
        overshadowImplementation = true,
        deepImmutablesDetection = true,
        depluralize = true,
        allParameters = true)
@Value.Immutable
public abstract class BoshDeployment {

    public static final BoshDeployment EMPTY = boshDeployment().build();

    @Value.Default
    public BoshDeploymentRequest getBoshDeploymentRequest(){
        return BoshDeploymentRequest.EMPTY;
    }

    @Value.Default
    public String getName() {
        return "";
    }

    @Value.Default
    public Collection<String> getTeams() {
        return emptyList();
    }

    @JsonProperty("cloud_config")
    @Value.Default
    public String getCloudConfig() {
        return "none";
    }

    @Value.Default
    public Collection<VersionedName> getStemcells() {
        return emptyList();
    }

    @Value.Default
    public Collection<VersionedName> getReleases() {
        return emptyList();
    }

    @JsonDeserialize(builder = ImmutableVersionedName.Builder.class)
    @Value.Immutable
    public static abstract class VersionedName {

        public abstract String getName();

        public abstract String getVersion();

        @Override
        public String toString() {
            return new StringJoiner(" ", "[", "]")
                    .add(getName())
                    .add("v" + getVersion())
                    .toString();
        }

    }

    @Value.Default
    public URI getTaskUri() {
        return URI.create("");
    }

    @Value.Default
    @Nullable
    public String getManifest() {
        return "";
    }

    @Value.Lazy
    public String getTaskId() {
        return getTaskUri().getPath().substring(getTaskUri().getPath().lastIndexOf("/") + 1);
    }

    public boolean isEmpty() {
        return this.equals(EMPTY);
    }

    public static class Builder extends ImmutableBoshDeployment.Builder {

    }

    public static Builder boshDeployment() {
        return new BoshDeployment.Builder();
    }

}


text:
    <bk-language-logo
        name="{{getEvaluator().shortName}}"
        bg-color="{{getEvaluator().bgColor}}"
        fg-color="{{getEvaluator().fgColor}}"
        border-color="{{getEvaluator().borderColor}}">
    </bk-language-logo>
    {{cellmodel.evaluator}}

          <bk-language-menu-item
                  key="{{evaluatorName}}"
                  bg-color="{{getEvaluatorDetails(evaluatorName).bgColor}}"
                  name="{{getEvaluatorDetails(evaluatorName).shortName}}"
                  fg-color="{{getEvaluatorDetails(evaluatorName).fgColor}}"
                  border-color="{{getEvaluatorDetails(evaluatorName).borderColor}}"></bk-language-menu-item>


text:
local self = {}
local ctor = GLib.MakeConstructor (self, GLib.Vector)

function GLib.RowVector (w, ...)
	return ctor (w, 1, ...)
end

function self:SetElementCount (elementCount)
	self.Width = elementCount
end


text:
package com.azmotors.store.model;

public final class ElementNull extends Element
{
    public final static ElementNull SINGLETON = new ElementNull();

    private ElementNull()
    {
        super();
    }

    @Override
    public String toString()
    {
        return Constants.TOKEN_NULL;
    }
}


text:
require 'spec_helper'
require 'gringotts'

describe Gringotts::Persistence do

  it "should fail if session is blank" do
    Gringotts::Persistence.valid?({}).should == false
  end

  it "should fail if expiration is missing" do
    Gringotts::Persistence.valid?(Gringotts::Persistence.signed_session({})).should == false
  end

  it "should fail if signature is missing" do
    Gringotts::Persistence.valid?({ Gringotts::Persistence::EXPIRATION => (Time.now.to_i + 100000) }).should == false
  end

  it "should fail if expiration is old" do
    session = {
      Gringotts::Persistence::EXPIRATION => (Time.now.to_i - 1).to_i
    }
    Gringotts::Persistence.valid?(Gringotts::Persistence.signed_session(session)).should == false
  end

  it "should actually encrypt/sign the signature, not provide it plaintext" do
    Gringotts::Persistence.sign({:harry => "potter"}).include?("harry").should == false
  end

  it "should fail if signature is incorrect" do
    incorrectly_signed_session = {
      Gringotts::Persistence::EXPIRATION => (Time.now.to_i - 1).to_i,
      Gringotts::Persistence::SIGNATURE  => "quientusabes"
    }
    Gringotts::Persistence.valid?(incorrectly_signed_session).should == false
  end

  it "should pass if both are y4y" do
    session = {
      Gringotts::Persistence::EXPIRATION => (Time.now.to_i + 100000).to_i
    }
    Gringotts::Persistence.valid?(Gringotts::Persistence.signed_session(session)).should == true
  end

end


text:
TEST(Logger, simple) {
    InitConfig("test/data/s3test.conf", "default");
    InitLog();
    fprintf(stderr, "Hello, log type %d\n", s3ext_logtype);
    S3DEBUG("Hello, DEBUG");
    S3ERROR("Hello, ERROR");
}

TEST(Logger, getstr) {
    EXPECT_EQ(EXT_DEBUG, getLogLevel("DEBUG"));
    EXPECT_EQ(EXT_WARNING, getLogLevel("WARNING"));
    EXPECT_EQ(EXT_INFO, getLogLevel("INFO"));
    EXPECT_EQ(EXT_ERROR, getLogLevel("ERROR"));
    EXPECT_EQ(EXT_FATAL, getLogLevel("FATAL"));
    EXPECT_EQ(EXT_FATAL, getLogLevel("XX"));
    EXPECT_EQ(EXT_FATAL, getLogLevel(NULL));

    EXPECT_EQ(STDERR_LOG, getLogType("STDERR"));
    EXPECT_EQ(REMOTE_LOG, getLogType("REMOTE"));
    EXPECT_EQ(LOCAL_LOG, getLogType("LOCAL"));
    EXPECT_EQ(INTERNAL_LOG, getLogType("INTERNAL"));
    EXPECT_EQ(STDERR_LOG, getLogType(""));
    EXPECT_EQ(STDERR_LOG, getLogType(NULL));
}


text:
cask "ultimaker-cura" do
  version "4.10.0"
  sha256 "820eb00d9f74de4f0f47555223ff08bb09ee6b6fe21d146112e7facbf32601c7"

  url "https://github.com/Ultimaker/Cura/releases/download/#{version}/Ultimaker_Cura-#{version}-Darwin.dmg",
      verified: "https://github.com/Ultimaker/Cura"
  name "Ultimaker Cura"
  name "Cura"
  desc "3D printer and slicing GUI"
  homepage "https://ultimaker.com/en/products/cura-software"

  livecheck do
    url "https://github.com/Ultimaker/Cura"
    strategy :github_latest
  end

  app "Ultimaker Cura.app"

  uninstall quit: "nl.ultimaker.cura"

  zap trash: [
    "~/.cura",
    "~/Library/Application Support/cura",
    "~/Library/Preferences/nl.ultimaker.cura.Ultimaker Cura.plist",
    "~/Library/Saved Application State/nl.ultimaker.cura.savedState",
  ]
end


text:
package kmeans;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;

import ibis.satin.Spawnable;

public class KMeans extends ibis.satin.SatinObject {
    private static final long serialVersionUID = 1L;
    public static final double THRESHOLD = 0.01;
    public static final int MAXITER = 500;

    private static double centers[][];

    private static final double[] parseVector(String line) {
	String[] numbers = line.split(" ");
	double[] output = new double[numbers.length];
	for (int i = 0; i < output.length; ++i) {
	    output[i] = Double.valueOf(numbers[i]);
	}
	return output;
    }

    // Read initial "centers" file.
    private static final double[][] readCenters(String file) throws Exception {
	BufferedReader buffer = new BufferedReader(new FileReader(file));
	ArrayList<double[]> c = new ArrayList<double[]>();
	String line;
	while ((line = buffer.readLine()) != null) {
	    c.add(parseVector(line));
	}
	buffer.close();
	return c.toArray(new double[c.size()][]);
    }

    // Read "points" directory.
    private static final double[][] readPoints(String dir) throws Exception {
	File d = new File(dir);
	File[] files = d.listFiles();
	if (files != null) {
	    ArrayList<double[]> c = new ArrayList<double[]>();
	    for (File f : files) {
		BufferedReader buffer = new BufferedReader(new FileReader(f));
		String line;
		while ((line = buffer.readLine()) != null) {
		    c.add(parseVector(line));
		}
		buffer.close();
	    }
	    return c.toArray(new double[c.size()][]);
	} else {
	    throw new Exception("Could not open directory " + dir);
	}
    }

    // A single iteration of the clustering algorithm.
    @Spawnable public KMeansResult kMeanCluster(double[][] centers, Points points, int lo,
	    int high) {
	int[] counts = new int[centers.length];
	double[][] newCenters = new double[centers.length][];
	KMeansResult result = new KMeansResult(newCenters, counts);

	// Initialize new centers
	for (int i = 0; i < newCenters.length; i++) {
	    newCenters[i] = new double[centers[i].length];
	}

	double totalMinimum = 0.0;

	// For each point, determine the closest center
	for (int pIndex = lo; pIndex < high; pIndex++) {
	    double[] point = points.getPoint(pIndex);
	    double minimum = Double.MAX_VALUE;
	    int cluster = -1;
	    for (int i = 0; i < centers.length; i++) {
		double distance = eucledianDistance(point, centers[i]);
		if (distance < minimum) {
		    minimum = distance;
		    cluster = i;
		}
	    }
	    totalMinimum += minimum;

	    // Update new center sum
	    sum(newCenters[cluster], point);
	    counts[cluster]++;
	}

	System.out.println("Sum distance = " + totalMinimum);
	return result;
    }

    /***** SUPPORT METHODS *****/
    private static final double eucledianDistance(double[] set1, double[] set2) {
	double sum = 0;
	int length = set1.length;
	for (int i = 0; i < length; i++) {
	    double diff = set2[i] - set1[i];
	    sum += (diff * diff);
	}
	return Math.sqrt(sum);
    }

    static final void sum(double[] s1, double[] s2) {
	for (int i = 0; i < s1.length; ++i) {
	    long el1 = Math.round(s1[i] * 100);
	    long el2 = Math.round(s2[i] * 100);
	    s1[i] = (el1 + el2) / 100.0;
	}
    }

    public static void main(String[] args) throws Exception {
	int numTasks = 1;
	centers = readCenters(args[0]);
	Points points = new Points();
	points.initializePoints(readPoints(args[1]));
	if (args.length > 2) {
	    numTasks = Integer.parseInt(args[2]);
	}
	points.exportObject();

	KMeans m = new KMeans();

	int iteration = 0;
	double total;
	KMeansResult[] results = new KMeansResult[numTasks];
	int pointsPerTask = points.size() / numTasks;
	int p1 = points.size() - numTasks * pointsPerTask;
	// Spawn tasks in Master-worker fashion.
	do {
	    int begin = 0;
	    for (int i = 0; i < p1; i++) {
		int end = begin + pointsPerTask + 1;
		results[i] = m.kMeanCluster(centers, points, begin, end);
		begin = end;
	    }
	    for (int i = p1; i < numTasks; i++) {
		int end = begin + pointsPerTask;
		results[i] = m.kMeanCluster(centers, points, begin, end);
		begin = end;
	    }
	    m.sync();
	    iteration++;

	    for (int i = 1; i < numTasks; i++) {
		results[0].add(results[i]);
	    }
	    results[0].avg();

	    total = 0.0;
	    // Compute new centers
	    for (int i = 0; i < centers.length; i++) {
		if (results[0].counts[i] > 0) {
		    total += eucledianDistance(centers[i],
			    results[0].centers[i]);
		    centers[i] = results[0].centers[i];
		}
	    }
	    System.out.println("Iteration " + iteration + ", total diff = "
		    + total);
	} while (total >= THRESHOLD);

	// Print out centroid results.
	System.out.println("Centers:");
	for (int i = 0; i < centers.length; i++) {
	    System.out.print("(");
	    for (int j = 0; j < centers[i].length; j++) {
		System.out.print(centers[i][j]);
		if (j < centers[i].length - 1) {
		    System.out.print(", ");
		}
	    }
	    System.out.println(")");
	}
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>http::dynamic_body</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
<link rel="prev" href="boost__beast__http__fields.html" title="http::fields">
<link rel="next" href="boost__beast__http__chunk_extensions.html" title="http::chunk_extensions">

Home
Libraries
People
FAQ
More

http::dynamic_body

        A dynamic message body represented by a multi_buffer.

        Synopsis

        Defined in header <boost/beast/http/dynamic_body.hpp>

using dynamic_body = basic_dynamic_body< multi_buffer >;

        Types

<colgroup>
<col>
<col>
</colgroup>

                  Name

                  Description

                  reader

                  The algorithm for parsing the body.

                  value_type

                  The type of container used for the body.

                  writer

                  The algorithm for serializing the body.

        Static
        Members

<colgroup>
<col>
<col>
</colgroup>

                  Name

                  Description

                  size

                  Returns the payload size of the body.

        This body uses a DynamicBuffer as a memory-based container
        for holding message payloads. Messages using this body type may be serialized
        and parsed.

        Description

        Meets the requirements of Body.

Copyright © 2016-2019 Vinnie
      Falco

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
from django.conf.urls import patterns, include, url

from django.conf.urls.defaults import patterns, url

from djangorestframework.mixins import ListModelMixin, CreateModelMixin
from djangorestframework.views import View, ModelView

from djangorestframework.resources import ModelResource
from djangorestframework.views import ListOrCreateModelView, InstanceModelView
from reaper.models import RoomConfig, RoomStatus, ReaperLog, PseudoRoomMotion, PseudoRoomResv

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

class RoomConfigResource(ModelResource):
    model = RoomConfig

class RoomStatusResource(ModelResource):
    model = RoomStatus

class ReaperLogResource(ModelResource):
    model = ReaperLog

class PseudoRoomMotionResource(ModelResource):
    model = PseudoRoomMotion

class PseudoRoomResvResource(ModelResource):
    model = PseudoRoomResv

class RMStatusView(ListModelMixin, CreateModelMixin, ModelView):

    def initial(self, request, *args, **kargs):
        print "In RMStatusView ..initial..."
        print (request.GET)

        if 'jsonpCallback' in request.GET or 'callback' in request.GET:
            #hack around jquery's inability to set accept headers on cross origin json requests
            #django rest framework needs a specific Accept: parameter to render jsonp
            #print "request is probably a JSONP request"
            #print request.META
            request.META['HTTP_ACCEPT'] = 'application/json-p'

    """
    @classmethod
    def as_view(cls, **initkwargs):
        view = super(View, cls).as_view(**initkwargs)
        view.cls_instance = cls(**initkwargs)
        return view
    """

class RoomConfigView(ListModelMixin, CreateModelMixin, ModelView):

    def initial(self, request, *args, **kargs):
        print "In RoomConfigView ..initial..."
        print (request.GET)

        if 'jsonpCallback' in request.GET or 'callback' in request.GET:
            #hack around jquery's inability to set accept headers on cross origin json requests
            #django rest framework needs a specific Accept: parameter to render jsonp
            #print "request is probably a JSONP request"
            #print request.META
            request.META['HTTP_ACCEPT'] = 'application/json-p'

class ReaperLogView(ListModelMixin, CreateModelMixin, ModelView):

    def initial(self, request, *args, **kargs):
        print "In ReaperLogView ..initial..."
        print (request.GET)

        if 'jsonpCallback' in request.GET or 'callback' in request.GET:
            #hack around jquery's inability to set accept headers on cross origin json requests
            #django rest framework needs a specific Accept: parameter to render jsonp
            #print "request is probably a JSONP request"
            #print request.META
            request.META['HTTP_ACCEPT'] = 'application/json-p'

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'mysite.views.home', name='home'),
    # url(r'^mysite/', include('mysite.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^api/rmconfig$', RoomConfigView.as_view(resource=RoomConfigResource)),
    url(r'^api/rmconfig/(?P<pk>[^/]+)/$', InstanceModelView.as_view(resource=RoomConfigResource)),

    #url(r'^api/rmstatus$', ListOrCreateModelView.as_view(resource=RoomStatusResource)),
    url(r'^api/rmstatus$', RMStatusView.as_view(resource=RoomStatusResource)),
    url(r'^api/rmstatus/(?P<pk>[^/]+)/$', InstanceModelView.as_view(resource=RoomStatusResource)),

    url(r'^api/reaperlog$', ReaperLogView.as_view(resource=ReaperLogResource)),
    url(r'^api/reaperlog$/(?P<pk>[^/]+)/$', InstanceModelView.as_view(resource=ReaperLogResource)),

)


text:
package com.dw.ftp.cmd;

import com.dw.ftp.FtpCommandHandler;

public class UserCommandHandler extends FtpCommandHandler {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}


text:
package ro.lrg.xcore.metametamodel;

import java.lang.annotation.Target;
import java.lang.annotation.ElementType;

@Target(ElementType.TYPE)
public @interface PropertyComputer {

}


text:
author: sivel
categories:
- News
- Plugins
- WordPress
date: '2009-10-01'
description: 2 More WordPress Plugins Have New Homes
slug: 2-more-wordpress-plugins-have-new-homes
title: 2 More WordPress Plugins Have New Homes
type: post
---

Since my [announcement][1] on Twitter and my [interview][2] on [WPTavern][3], most of you likely know that I decided to cease development and support for several of my plugins. Part of the process of doing so is finding new homes for these plugins so that they can live on. Two more plugins have found their new home with [Travis Ballard][4], who many of you know from Twitter or IRC as ansimation or ansi.

The specific posts for each of these plugins are:

*   <http://www.travisballard.com/wordpress/dynamic-favorites-wordpress-plugin/>
*   <http://www.travisballard.com/wordpress/possibly-related-recent-posts-wordpress-plugin/>

Please head on over and check out Travis' [site][4] and his [announcement][5] of taking over the plugins. With that being said, good luck Travis and these plugins are now 100% yours.

 [1]: http://twitter.com/sivel/status/4454649535
 [2]: http://www.wptavern.com/conversation-with-matt-martz
 [3]: http://wptavern.com
 [4]: http://www.travisballard.com/
 [5]: http://www.travisballard.com/wordpress/newly-inherited-wordpress-plugins/


text:
package org.elasticsearch.plugin.python;

import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.script.ScriptEngineRegistry;
import org.elasticsearch.script.ScriptModule;
import org.elasticsearch.script.python.PythonScriptEngineService;

/**
 *
 */
public class PythonPlugin extends Plugin {

    @Override
    public String name() {
        return "lang-python";
    }

    @Override
    public String description() {
        return "Adds support for writing scripts in Python";
    }

    public void onModule(ScriptModule module) {
        module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(PythonScriptEngineService.class, PythonScriptEngineService.TYPES));
    }
}