text:
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.net;

import android.annotation.SuppressLint;
import android.content.Context;
import android.net.ConnectivityManager;
import android.os.Build;

import org.chromium.base.ContextUtils;
import org.chromium.base.ObserverList;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.NativeClassQualifiedName;
import org.chromium.base.compat.ApiHelperForM;

import java.util.ArrayList;

/**
 * Triggers updates to the underlying network state in Chrome.
 *
 * By default, connectivity is assumed and changes must be pushed from the embedder via the
 * forceConnectivityState function.
 * Embedders may choose to have this class auto-detect changes in network connectivity by invoking
 * the setAutoDetectConnectivityState function.
 *
 * WARNING: This class is not thread-safe.
 */
@JNINamespace("net")
public class NetworkChangeNotifier {
    /**
     * Alerted when the connection type of the network changes.
     * The alert is fired on the UI thread.
     */
    public interface ConnectionTypeObserver {
        public void onConnectionTypeChanged(int connectionType);
    }

    private final ArrayList<Long> mNativeChangeNotifiers;
    private final ObserverList<ConnectionTypeObserver> mConnectionTypeObservers;
    private final ConnectivityManager mConnectivityManager;
    private NetworkChangeNotifierAutoDetect mAutoDetector;
    // Last value broadcast via ConnectionTypeChange signal.
    private int mCurrentConnectionType = ConnectionType.CONNECTION_UNKNOWN;

    @SuppressLint("StaticFieldLeak")
    private static NetworkChangeNotifier sInstance;

    @VisibleForTesting
    protected NetworkChangeNotifier() {
        mNativeChangeNotifiers = new ArrayList<Long>();
        mConnectionTypeObservers = new ObserverList<ConnectionTypeObserver>();
        mConnectivityManager =
                (ConnectivityManager) ContextUtils.getApplicationContext().getSystemService(
                        Context.CONNECTIVITY_SERVICE);
    }

    /**
     * Initializes the singleton once.
     */
    @CalledByNative
    public static NetworkChangeNotifier init() {
        if (sInstance == null) {
            sInstance = new NetworkChangeNotifier();
        }
        return sInstance;
    }

    public static boolean isInitialized() {
        return sInstance != null;
    }

    static void resetInstanceForTests(NetworkChangeNotifier notifier) {
        sInstance = notifier;
    }

    @CalledByNative
    public int getCurrentConnectionType() {
        return mCurrentConnectionType;
    }

    @CalledByNative
    public int getCurrentConnectionSubtype() {
        return mAutoDetector == null
                ? ConnectionSubtype.SUBTYPE_UNKNOWN
                : mAutoDetector.getCurrentNetworkState().getConnectionSubtype();
    }

    /**
     * Returns NetID of device's current default connected network used for
     * communication. Only available on Lollipop and newer releases and when
     * auto-detection has been enabled, returns NetId.INVALID otherwise.
     */
    @CalledByNative
    public long getCurrentDefaultNetId() {
        return mAutoDetector == null ? NetId.INVALID : mAutoDetector.getDefaultNetId();
    }

    /**
     * Returns an array of all of the device's currently connected
     * networks and ConnectionTypes. Array elements are a repeated sequence of:
     *   NetID of network
     *   ConnectionType of network
     * Only available on Lollipop and newer releases and when auto-detection has
     * been enabled.
     */
    @CalledByNative
    public long[] getCurrentNetworksAndTypes() {
        return mAutoDetector == null ? new long[0] : mAutoDetector.getNetworksAndTypes();
    }

    /**
     * Adds a native-side observer.
     */
    @CalledByNative
    public void addNativeObserver(long nativeChangeNotifier) {
        mNativeChangeNotifiers.add(nativeChangeNotifier);
    }

    /**
     * Removes a native-side observer.
     */
    @CalledByNative
    public void removeNativeObserver(long nativeChangeNotifier) {
        mNativeChangeNotifiers.remove(nativeChangeNotifier);
    }

    /**
     * Returns {@code true} if NetworkCallback failed to register, indicating that network-specific
     * callbacks will not be issued.
     */
    @CalledByNative
    public boolean registerNetworkCallbackFailed() {
        return mAutoDetector == null ? false : mAutoDetector.registerNetworkCallbackFailed();
    }

    /**
     * Returns the singleton instance.
     */
    public static NetworkChangeNotifier getInstance() {
        assert sInstance != null;
        return sInstance;
    }

    /**
     * Enables auto detection of the current network state based on notifications from the system.
     * Note that passing true here requires the embedding app have the platform ACCESS_NETWORK_STATE
     * permission. Also note that in this case the auto detection is enabled based on the status of
     * the application (@see ApplicationStatus).
     *
     * @param shouldAutoDetect true if the NetworkChangeNotifier should listen for system changes in
     *    network connectivity.
     */
    public static void setAutoDetectConnectivityState(boolean shouldAutoDetect) {
        getInstance().setAutoDetectConnectivityStateInternal(
                shouldAutoDetect, new RegistrationPolicyApplicationStatus());
    }

    /**
     * Registers to always receive network change notifications no matter if
     * the app is in the background or foreground.
     * Note that in normal circumstances, chrome embedders should use
     * {@code setAutoDetectConnectivityState} to listen to network changes only
     * when the app is in the foreground, because network change observers
     * might perform expensive work depending on the network connectivity.
     */
    public static void registerToReceiveNotificationsAlways() {
        getInstance().setAutoDetectConnectivityStateInternal(
                true, new RegistrationPolicyAlwaysRegister());
    }

    /**
     * Registers to receive network change notification based on the provided registration policy.
     */
    public static void setAutoDetectConnectivityState(
            NetworkChangeNotifierAutoDetect.RegistrationPolicy policy) {
        getInstance().setAutoDetectConnectivityStateInternal(true, policy);
    }

    private void destroyAutoDetector() {
        if (mAutoDetector != null) {
            mAutoDetector.destroy();
            mAutoDetector = null;
        }
    }

    private void setAutoDetectConnectivityStateInternal(
            boolean shouldAutoDetect, NetworkChangeNotifierAutoDetect.RegistrationPolicy policy) {
        if (shouldAutoDetect) {
            if (mAutoDetector == null) {
                mAutoDetector = new NetworkChangeNotifierAutoDetect(
                        new NetworkChangeNotifierAutoDetect.Observer() {
                            @Override
                            public void onConnectionTypeChanged(int newConnectionType) {
                                updateCurrentConnectionType(newConnectionType);
                            }
                            @Override
                            public void onConnectionSubtypeChanged(int newConnectionSubtype) {
                                notifyObserversOfConnectionSubtypeChange(newConnectionSubtype);
                            }
                            @Override
                            public void onNetworkConnect(long netId, int connectionType) {
                                notifyObserversOfNetworkConnect(netId, connectionType);
                            }
                            @Override
                            public void onNetworkSoonToDisconnect(long netId) {
                                notifyObserversOfNetworkSoonToDisconnect(netId);
                            }
                            @Override
                            public void onNetworkDisconnect(long netId) {
                                notifyObserversOfNetworkDisconnect(netId);
                            }
                            @Override
                            public void purgeActiveNetworkList(long[] activeNetIds) {
                                notifyObserversToPurgeActiveNetworkList(activeNetIds);
                            }
                        },
                        policy);
                final NetworkChangeNotifierAutoDetect.NetworkState networkState =
                        mAutoDetector.getCurrentNetworkState();
                updateCurrentConnectionType(networkState.getConnectionType());
                notifyObserversOfConnectionSubtypeChange(networkState.getConnectionSubtype());
            }
        } else {
            destroyAutoDetector();
        }
    }

    /**
     * For testing, updates the perceived network state when not auto-detecting changes to
     * connectivity.
     *
     * @param networkAvailable True if the NetworkChangeNotifier should perceive a "connected"
     *    state, false implies "disconnected".
     */
    @CalledByNative
    public static void forceConnectivityState(boolean networkAvailable) {
        setAutoDetectConnectivityState(false);
        getInstance().forceConnectivityStateInternal(networkAvailable);
    }

    private void forceConnectivityStateInternal(boolean forceOnline) {
        boolean connectionCurrentlyExists =
                mCurrentConnectionType != ConnectionType.CONNECTION_NONE;
        if (connectionCurrentlyExists != forceOnline) {
            updateCurrentConnectionType(forceOnline ? ConnectionType.CONNECTION_UNKNOWN
                                                    : ConnectionType.CONNECTION_NONE);
            notifyObserversOfConnectionSubtypeChange(forceOnline ? ConnectionSubtype.SUBTYPE_UNKNOWN
                                                                 : ConnectionSubtype.SUBTYPE_NONE);
        }
    }

    // For testing, pretend a network connected.
    @CalledByNative
    public static void fakeNetworkConnected(long netId, int connectionType) {
        setAutoDetectConnectivityState(false);
        getInstance().notifyObserversOfNetworkConnect(netId, connectionType);
    }

    // For testing, pretend a network will soon disconnect.
    @CalledByNative
    public static void fakeNetworkSoonToBeDisconnected(long netId) {
        setAutoDetectConnectivityState(false);
        getInstance().notifyObserversOfNetworkSoonToDisconnect(netId);
    }

    // For testing, pretend a network disconnected.
    @CalledByNative
    public static void fakeNetworkDisconnected(long netId) {
        setAutoDetectConnectivityState(false);
        getInstance().notifyObserversOfNetworkDisconnect(netId);
    }

    // For testing, pretend a network lists should be purged.
    @CalledByNative
    public static void fakePurgeActiveNetworkList(long[] activeNetIds) {
        setAutoDetectConnectivityState(false);
        getInstance().notifyObserversToPurgeActiveNetworkList(activeNetIds);
    }

    // For testing, pretend a default network changed.
    @CalledByNative
    public static void fakeDefaultNetwork(long netId, int connectionType) {
        setAutoDetectConnectivityState(false);
        getInstance().notifyObserversOfConnectionTypeChange(connectionType, netId);
    }

    // For testing, pretend the connection subtype has changed.
    @CalledByNative
    public static void fakeConnectionSubtypeChanged(int connectionSubtype) {
        setAutoDetectConnectivityState(false);
        getInstance().notifyObserversOfConnectionSubtypeChange(connectionSubtype);
    }

    private void updateCurrentConnectionType(int newConnectionType) {
        mCurrentConnectionType = newConnectionType;
        notifyObserversOfConnectionTypeChange(newConnectionType);
    }

    /**
     * Alerts all observers of a connection change.
     */
    void notifyObserversOfConnectionTypeChange(int newConnectionType) {
        notifyObserversOfConnectionTypeChange(newConnectionType, getCurrentDefaultNetId());
    }

    private void notifyObserversOfConnectionTypeChange(int newConnectionType, long defaultNetId) {
        for (Long nativeChangeNotifier : mNativeChangeNotifiers) {
            nativeNotifyConnectionTypeChanged(
                    nativeChangeNotifier, newConnectionType, defaultNetId);
        }
        for (ConnectionTypeObserver observer : mConnectionTypeObservers) {
            observer.onConnectionTypeChanged(newConnectionType);
        }
    }

    /**
     * Alerts all observers of a bandwidth change.
     */
    void notifyObserversOfConnectionSubtypeChange(int connectionSubtype) {
        for (Long nativeChangeNotifier : mNativeChangeNotifiers) {
            nativeNotifyMaxBandwidthChanged(nativeChangeNotifier, connectionSubtype);
        }
    }

    /**
     * Alerts all observers of a network connect.
     */
    void notifyObserversOfNetworkConnect(long netId, int connectionType) {
        for (Long nativeChangeNotifier : mNativeChangeNotifiers) {
            nativeNotifyOfNetworkConnect(nativeChangeNotifier, netId, connectionType);
        }
    }

    /**
     * Alerts all observers of a network soon to be disconnected.
     */
    void notifyObserversOfNetworkSoonToDisconnect(long netId) {
        for (Long nativeChangeNotifier : mNativeChangeNotifiers) {
            nativeNotifyOfNetworkSoonToDisconnect(nativeChangeNotifier, netId);
        }
    }

    /**
     * Alerts all observers of a network disconnect.
     */
    void notifyObserversOfNetworkDisconnect(long netId) {
        for (Long nativeChangeNotifier : mNativeChangeNotifiers) {
            nativeNotifyOfNetworkDisconnect(nativeChangeNotifier, netId);
        }
    }

    /**
     * Alerts all observers to purge cached lists of active networks, of any
     * networks not in the accompanying list of active networks. This is
     * issued if a period elapsed where disconnected notifications may have
     * been missed, and acts to keep cached lists of active networks accurate.
     */
    void notifyObserversToPurgeActiveNetworkList(long[] activeNetIds) {
        for (Long nativeChangeNotifier : mNativeChangeNotifiers) {
            nativeNotifyPurgeActiveNetworkList(nativeChangeNotifier, activeNetIds);
        }
    }

    /**
     * Adds an observer for any connection type changes.
     */
    public static void addConnectionTypeObserver(ConnectionTypeObserver observer) {
        getInstance().addConnectionTypeObserverInternal(observer);
    }

    private void addConnectionTypeObserverInternal(ConnectionTypeObserver observer) {
        mConnectionTypeObservers.addObserver(observer);
    }

    /**
     * Removes an observer for any connection type changes.
     */
    public static void removeConnectionTypeObserver(ConnectionTypeObserver observer) {
        getInstance().removeConnectionTypeObserverInternal(observer);
    }

    private void removeConnectionTypeObserverInternal(ConnectionTypeObserver observer) {
        mConnectionTypeObservers.removeObserver(observer);
    }

    /**
     * Is the process bound to a network?
     */
    private boolean isProcessBoundToNetworkInternal() {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
            return false;
        } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
            @SuppressWarnings("deprecation")
            boolean returnValue = ConnectivityManager.getProcessDefaultNetwork() != null;
            return returnValue;
        } else {
            return ApiHelperForM.getBoundNetworkForProcess(mConnectivityManager) != null;
        }
    }

    /**
     * Is the process bound to a network?
     */
    @CalledByNative
    public static boolean isProcessBoundToNetwork() {
        return getInstance().isProcessBoundToNetworkInternal();
    }

    @NativeClassQualifiedName("NetworkChangeNotifierDelegateAndroid")
    private native void nativeNotifyConnectionTypeChanged(
            long nativePtr, int newConnectionType, long defaultNetId);

    @NativeClassQualifiedName("NetworkChangeNotifierDelegateAndroid")
    private native void nativeNotifyMaxBandwidthChanged(long nativePtr, int subType);

    @NativeClassQualifiedName("NetworkChangeNotifierDelegateAndroid")
    private native void nativeNotifyOfNetworkConnect(
            long nativePtr, long netId, int connectionType);

    @NativeClassQualifiedName("NetworkChangeNotifierDelegateAndroid")
    private native void nativeNotifyOfNetworkSoonToDisconnect(long nativePtr, long netId);

    @NativeClassQualifiedName("NetworkChangeNotifierDelegateAndroid")
    private native void nativeNotifyOfNetworkDisconnect(long nativePtr, long netId);

    @NativeClassQualifiedName("NetworkChangeNotifierDelegateAndroid")
    private native void nativeNotifyPurgeActiveNetworkList(long nativePtr, long[] activeNetIds);

    // For testing only.
    public static NetworkChangeNotifierAutoDetect getAutoDetectorForTest() {
        return getInstance().mAutoDetector;
    }

    /**
     * Checks if there currently is connectivity.
     */
    public static boolean isOnline() {
        int connectionType = getInstance().getCurrentConnectionType();
        return connectionType != ConnectionType.CONNECTION_NONE;
    }
}


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

<TITLE>
org.dcm4che.server
</TITLE>

<META NAME="date" CONTENT="2017-05-17">

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

org.dcm4che.server

½Ó¿Ú

DcmHandler

HL7Handler

PollDirSrv

PollDirSrv.Handler

Server

Server.Handler

SyslogService

UDPServer

UDPServer.Handler

Àà

PollDirSrvFactory

ServerFactory

redpajama_set_name: RedPajamaGithub


text:
<?php

	/**
	 * glue
	 *
	 * Provides an easy way to map URLs to classes. URLs can be literal
	 * strings or regular expressions.
	 *
	 * When the URLs are processed:
	 *	  * deliminators (/) are automatically escaped: (\/)
	 *	  * The beginning and end are anchored (^ $)
	 *	  * An optional end slash is added (/?)
	 *		* The i option is added for case-insensitive searches
	 *
	 * Example:
	 *
	 * $urls = array(
	 *	 '/' => 'index',
	 *	 '/page/(\d+) => 'page'
	 * );
	 *
	 * class page {
	 *	  function GET($matches) {
	 *		  echo "Your requested page " . $matches[1];
	 *	  }
	 * }
	 *
	 * glue::stick($urls);
	 *
	 */
	class glue {

		/**
		 * stick
		 *
		 * the main static function of the glue class.
		 *
		 * @param   array		$urls  		The regex-based url to class mapping
		 * @param   string		$base  		Base url if not at root
		 * @throws  Exception			   Thrown if corresponding class is not found
		 * @throws  Exception			   Thrown if no match is found
		 * @throws  BadMethodCallException  Thrown if a corresponding GET,POST is not found
		 *
		 */
		static function stick ($urls, $base = NULL) {
			$method = strtoupper($_SERVER['REQUEST_METHOD']);
			$path = $_SERVER['REQUEST_URI'];

			// Trim any manual GET parameters off.
			$path = explode('?', $path);
			$path = $path[0];

			if($base != NULL) {
				$path = substr($path, strpos($path, $base)+strlen($base));
			}

			$found = false;

			krsort($urls);

			foreach ($urls as $regex => $class) {
				$regex = str_replace('/', '\/', $regex);
				$regex = '^' . $regex . '\/?$';

				if (preg_match("/$regex/i", $path, $matches)) {
					$found = true;
					if (class_exists($class)) {
						$obj = new $class;
						if (method_exists($obj, $method)) {
							$obj->$method($matches);
						} else {
							throw new GlueMethodException("Could not find specified method in the class", $path, $class, $method);
						}
					} else {
						throw new GlueInternalException("Could not find specified class", $path, $class, $method);
					}
					break;
				}
			}
			if (!$found) {
				throw new GlueURLException("The URL accessed does not match any URL in the glue", $path);
			}
		}
	}


text: Code for LBCC's High Altitude Balloon program during 2016-2017


text:
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Debug Elasticsearch" type="Remote">
    <option name="USE_SOCKET_TRANSPORT" value="true" />
    <option name="SERVER_MODE" value="true" />
    <option name="SHMEM_ADDRESS" />
    <option name="HOST" value="localhost" />
    <option name="PORT" value="5005" />
    <option name="AUTO_RESTART" value="true" />
    <RunnerSettings RunnerId="Debug">
      <option name="DEBUG_PORT" value="5005" />
      <option name="LOCAL" value="false" />
    </RunnerSettings>
    <method v="2" />
  </configuration>
</component>


text:
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.Office365.Discovery;
using Microsoft.Office365.OutlookServices;
using Microsoft.Office365.SharePoint.CoreServices;
using O365_APIs_Start_ASPNET_MVC.Utils;
using O365_APIs_Start_ASPNET_MVC.Models;
using System;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Linq;

namespace O365_APIs_Start_ASPNET_MVC.Helpers
{
    // Provides a valid OutlookServices client that contains the bearer token for issuing requests against Calendar, Mail, and Contact resources.
    internal class AuthenticationHelper
    {
        internal static async Task<OutlookServicesClient> EnsureOutlookServicesClientCreatedAsync(string capabilityName)
        {

            var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
            var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;

            AuthenticationContext authContext = new AuthenticationContext(SettingsHelper.Authority, new ADALTokenCache(signInUserId));

            try
            {
                DiscoveryClient discClient = new DiscoveryClient(SettingsHelper.DiscoveryServiceEndpointUri,
                    async () =>
                    {
                        var authResult = await authContext.AcquireTokenSilentAsync(SettingsHelper.DiscoveryServiceResourceId,
                                                                                new ClientCredential(SettingsHelper.ClientId,
                                                                                SettingsHelper.ClientSecret),
                                                                                new UserIdentifier(userObjectId,
                                                                                UserIdentifierType.UniqueId));

                        return authResult.AccessToken;
                    });

                var dcr = await discClient.DiscoverCapabilityAsync(capabilityName);

                return new OutlookServicesClient(dcr.ServiceEndpointUri,
                    async () =>
                    {
                        var authResult = await authContext.AcquireTokenSilentAsync(dcr.ServiceResourceId,
                                                                                new ClientCredential(SettingsHelper.ClientId,
                                                                                SettingsHelper.ClientSecret),
                                                                                new UserIdentifier(userObjectId,
                                                                                UserIdentifierType.UniqueId));

                        return authResult.AccessToken;
                    });
            }
            catch (AdalException exception)
            {
                //Handle token acquisition failure
                if (exception.ErrorCode == AdalError.FailedToAcquireTokenSilently)
                {
                    authContext.TokenCache.Clear();
                    throw exception;
                }
                return null;
            }
        }

        internal static async Task<SharePointClient> EnsureSharePointClientCreatedAsync(string capabilityName)
        {

            var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
            var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;

            AuthenticationContext authContext = new AuthenticationContext(SettingsHelper.Authority, new ADALTokenCache(signInUserId));

            try
            {
                DiscoveryClient discClient = new DiscoveryClient(SettingsHelper.DiscoveryServiceEndpointUri,
                    async () =>
                    {
                        var authResult = await authContext.AcquireTokenSilentAsync(SettingsHelper.DiscoveryServiceResourceId,
                                                                                new ClientCredential(SettingsHelper.ClientId,
                                                                                SettingsHelper.ClientSecret),
                                                                                new UserIdentifier(userObjectId,
                                                                                UserIdentifierType.UniqueId));
                        return authResult.AccessToken;
                    });

                var dcr = await discClient.DiscoverCapabilityAsync(capabilityName);

                return new SharePointClient(dcr.ServiceEndpointUri,
                    async () =>
                    {
                        var authResult = await authContext.AcquireTokenSilentAsync(dcr.ServiceResourceId,
                                                                                new ClientCredential(SettingsHelper.ClientId,
                                                                                SettingsHelper.ClientSecret),
                                                                                new UserIdentifier(userObjectId,
                                                                                UserIdentifierType.UniqueId));

                        return authResult.AccessToken;
                    });
            }
            catch (AdalException exception)
            {
                //Partially handle token acquisition failure here and bubble it up to the controller
                if (exception.ErrorCode == AdalError.FailedToAcquireTokenSilently)
                {
                    authContext.TokenCache.Clear();
                    throw exception;
                }
                return null;
            }
        }
    }
}
//*********************************************************
//
//O365 APIs Starter Project for ASPNET MVC, https://github.com/OfficeDev/Office-365-APIs-Starter-Project-for-ASPNETMVC
//
//Copyright (c) Microsoft Corporation
//All rights reserved.
//
//MIT License:
//
//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.
//
//*********************************************************


text:
SGL is short for **Seeed Graphics Library**. It is the core graphics for displays which provide a common set of graphics primitives(points, lines, circles, etc.).

### Interface Introduction
**we offer some userful functions as follow:**
```c
//draw a line between two points
virtual void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);
//draw a vertical line
virtual void drawVerticalLine(uint16_t x, uint16_t y, uint16_t height,uint16_t color);
//draw a horizontal line
virtual void drawHorizontalLine(uint16_t x, uint16_t y, uint16_t width, uint16_t color);
//draw a rectangle
virtual void drawRectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color);
//fill a rectangle area
virtual void fillRectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color);
//draw a circle
virtual void drawCircle(uint16_t x, uint16_t y, uint16_t r, uint16_t color);
//fill a circle
virtual void fillCircle(uint16_t x, uint16_t y, uint16_t r, uint16_t color);
//draw a traingle
virtual void drawTraingle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
//fill a traingle area
virtual void fillTraingle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
//draw char like 'a','b','c'
virtual void drawChar(uint8_t ascii, uint16_t x, uint16_t y, uint16_t size, uint16_t color);
//draw a string like "hello"
virtual void drawString(char* string, uint16_t x, uint16_t y, uint16_t size, uint16_t color);
//draw bit map
virtual void drawBitMap(uint16_t x, uint16_t y, const uint8_t *bitmap, uint16_t width, int16_t height, uint16_t color);
//fill the whole screen with one color
virtual void fillScreen(uint16_t color);
```

----
This software is written by lawliet zou ([wei.zou@seeedstudio.com](wei.zou@seeedstudio.com)) for seeed studio

and is licensed under [The MIT License](http://opensource.org/licenses/mit-license.php). Check License.txt for more information.

Contributing to this software is warmly welcomed. You can do this basically by

[forking](https://help.github.com/articles/fork-a-repo), committing modifications and then [pulling requests](https://help.github.com/articles/using-pull-requests) (follow the links above

for operating guide). Adding change log and your contact into file header is encouraged.

Thanks for your contribution.

Seeed Studio is an open hardware facilitation company based in Shenzhen, China.

Benefiting from local manufacture power and convenient global logistic system,

we integrate resources to serve new era of innovation. Seeed also works with

global distributors and partners to push open hardware movement.

[![Analytics](https://ga-beacon.appspot.com/UA-46589105-3/SGL)](https://github.com/igrigorik/ga-beacon)


text:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <artifactId>keycloak-parent</artifactId>
        <groupId>org.keycloak</groupId>
        <version>1.6.0.Final-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>keycloak-undertow-adapter-spi</artifactId>
    <name>Keycloak Undertow Integration</name>
    <description/>

    <dependencies>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>${jboss.logging.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-adapter-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-servlet</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
package com.google.cloud.logging.v2.samples;

// [START logging_v2_generated_ConfigServiceV2_GetSink_Logsinkname_sync]
import com.google.cloud.logging.v2.ConfigClient;
import com.google.logging.v2.LogSink;
import com.google.logging.v2.LogSinkName;

public class SyncGetSinkLogsinkname {

  public static void main(String[] args) throws Exception {
    syncGetSinkLogsinkname();
  }

  public static void syncGetSinkLogsinkname() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (ConfigClient configClient = ConfigClient.create()) {
      LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
      LogSink response = configClient.getSink(sinkName);
    }
  }
}
// [END logging_v2_generated_ConfigServiceV2_GetSink_Logsinkname_sync]


text:
using System.ComponentModel;

namespace System.Web.UI.WebControls
{
	public class GridViewSortEventArgs : CancelEventArgs
	{
		private string sortExpression;
		private SortDirection sortDirection;

		public GridViewSortEventArgs (string expression, SortDirection sortDirection)
		{
			this.sortExpression = expression;
			this.sortDirection = sortDirection;
		}

		public string SortExpression {
			get { return sortExpression; }
			set { sortExpression = value;}
		}

		public SortDirection SortDirection {
			get { return sortDirection; }
			set { sortDirection = value;}
		}
	}
}

#endif


text:
/* Authors: Lutong Wang and Bangqi Xu */
/*
 * Copyright (c) 2019, The Regents of the University of California
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the University nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _FR_FLEXGC_IMPL_H_
#define _FR_FLEXGC_IMPL_H_

#include <memory>

#include "db/gcObj/gcNet.h"
#include "dr/FlexDR.h"
#include "frDesign.h"
#include "gc/FlexGC.h"

namespace odb {
class dbTechLayerCutSpacingTableDefRule;
}

namespace fr {
class FlexGCWorkerRegionQuery
{
 public:
  FlexGCWorkerRegionQuery(FlexGCWorker* in);
  ~FlexGCWorkerRegionQuery();
  FlexGCWorker* getGCWorker() const;
  void addPolygonEdge(gcSegment* edge);
  void addMaxRectangle(gcRect* rect);
  void addSpcRectangle(gcRect* rect);
  void removePolygonEdge(gcSegment* connFig);
  void removeMaxRectangle(gcRect* connFig);
  void removeSpcRectangle(gcRect* rect);
  void queryPolygonEdge(
      const box_t& box,
      const frLayerNum layerNum,
      std::vector<std::pair<segment_t, gcSegment*>>& result) const;
  void queryPolygonEdge(
      const Rect& box,
      const frLayerNum layerNum,
      std::vector<std::pair<segment_t, gcSegment*>>& result) const;
  void queryMaxRectangle(const box_t& box,
                         const frLayerNum layerNum,
                         std::vector<rq_box_value_t<gcRect*>>& result) const;
  void querySpcRectangle(const box_t& box,
                         const frLayerNum layerNum,
                         std::vector<rq_box_value_t<gcRect>>& result) const;
  void queryMaxRectangle(const Rect& box,
                         const frLayerNum layerNum,
                         std::vector<rq_box_value_t<gcRect*>>& result) const;
  void queryMaxRectangle(const gtl::rectangle_data<frCoord>& box,
                         const frLayerNum layerNum,
                         std::vector<rq_box_value_t<gcRect*>>& result) const;
  void init(int numLayers);
  void addToRegionQuery(gcNet* net);
  void removeFromRegionQuery(gcNet* net);

 private:
  struct Impl;
  std::unique_ptr<Impl> impl_;
};

class FlexGCWorker::Impl
{
  friend class FlexGCWorker;

 public:
  // constructors
  Impl();  // for serialization
  Impl(frTechObject* techIn,
       Logger* logger,
       FlexDRWorker* drWorkerIn,
       FlexGCWorker* gcWorkerIn);
  frLayerNum getMinLayerNum()  // inclusive
  {
    return std::max((frLayerNum) (getTech()->getBottomLayerNum()),
                    minLayerNum_);
  }
  frLayerNum getMaxLayerNum()  // inclusive
  {
    return std::min((frLayerNum) (getTech()->getTopLayerNum()), maxLayerNum_);
  }
  gcNet* addNet(frBlockObject* owner = nullptr)
  {
    auto uNet = std::make_unique<gcNet>(getTech()->getLayers().size());
    auto net = uNet.get();
    net->setOwner(owner);
    net->setId(nets_.size());
    nets_.push_back(std::move(uNet));
    owner2nets_[owner] = net;
    return net;
  }
  void addMarker(std::unique_ptr<frMarker> in);
  void clearMarkers()
  {
    mapMarkers_.clear();
    markers_.clear();
  }
  void addPAObj(frConnFig* obj, frBlockObject* owner);
  // getters
  frTechObject* getTech() const { return tech_; }
  FlexDRWorker* getDRWorker() const { return drWorker_; }
  const Rect& getExtBox() const { return extBox_; }
  std::vector<std::unique_ptr<gcNet>>& getNets() { return nets_; }
  // others
  void init(const frDesign* design);
  int main();
  void end();
  // initialization from FlexPA, initPA0 --> addPAObj --> initPA1
  void initPA0(const frDesign* design);
  void initPA1();
  void initNetsFromDesign(const frDesign* design);
  // update
  void updateGCWorker();

 private:
  frTechObject* tech_;
  Logger* logger_;
  FlexDRWorker* drWorker_;

  Rect extBox_;
  Rect drcBox_;

  std::map<frBlockObject*, gcNet*> owner2nets_;  // no order is assumed
  std::vector<std::unique_ptr<gcNet>> nets_;

  std::vector<std::unique_ptr<frMarker>> markers_;
  std::map<std::tuple<Rect,
                      frLayerNum,
                      frConstraint*,
                      frBlockObject*,
                      frBlockObject*>,
           frMarker*>
      mapMarkers_;
  std::vector<std::unique_ptr<drPatchWire>> pwires_;

  FlexGCWorkerRegionQuery rq_;
  bool printMarker_;

  // temps
  std::vector<drNet*> modifiedDRNets_;

  // parameters
  gcNet* targetNet_;
  frLayerNum minLayerNum_;
  frLayerNum maxLayerNum_;

  // for pin prep
  std::set<frBlockObject*> targetObjs_;
  bool ignoreDB_;
  bool ignoreMinArea_;
  bool ignoreLongSideEOL_;
  bool ignoreCornerSpacing_;
  bool surgicalFixEnabled_;

  FlexGCWorkerRegionQuery& getWorkerRegionQuery() { return rq_; }

  // init
  gcNet* getNet(frBlockObject* obj);
  gcNet* getNet(frNet* net);
  void initObj(const Rect& box,
               frLayerNum layerNum,
               frBlockObject* obj,
               bool isFixed);
  gcNet* initDRObj(drConnFig* obj, gcNet* currNet = nullptr);
  gcNet* initRouteObj(frBlockObject* obj, gcNet* currNet = nullptr);
  void initDesign(const frDesign* design, bool skipDR = false);
  bool initDesign_skipObj(frBlockObject* obj);
  void initDRWorker();
  void initNets();
  void initNet(gcNet* net);
  void initNet_pins_polygon(gcNet* net);
  void initNet_pins_polygonEdges(gcNet* net);
  void initNet_pins_polygonEdges_getFixedPolygonEdges(
      gcNet* net,
      std::vector<std::set<std::pair<Point, Point>>>& fixedPolygonEdges);
  void initNet_pins_polygonEdges_helper_outer(
      gcNet* net,
      gcPin* pin,
      gcPolygon* poly,
      frLayerNum i,
      const std::vector<std::set<std::pair<Point, Point>>>& fixedPolygonEdges);
  void initNet_pins_polygonEdges_helper_inner(
      gcNet* net,
      gcPin* pin,
      const gtl::polygon_90_data<frCoord>& hole_poly,
      frLayerNum i,
      const std::vector<std::set<std::pair<Point, Point>>>& fixedPolygonEdges);
  void initNet_pins_polygonCorners(gcNet* net);
  void initNet_pins_polygonCorners_helper(gcNet* net, gcPin* pin);
  void initNet_pins_maxRectangles(gcNet* net);
  void initNet_pins_maxRectangles_getFixedMaxRectangles(
      gcNet* net,
      std::vector<std::set<std::pair<Point, Point>>>& fixedMaxRectangles);
  void initNet_pins_maxRectangles_helper(
      gcNet* net,
      gcPin* pin,
      const gtl::rectangle_data<frCoord>& rect,
      frLayerNum i,
      const std::vector<std::set<std::pair<Point, Point>>>& fixedMaxRectangles);

  void initRegionQuery();

  void checkMetalSpacing();
  frCoord checkMetalSpacing_getMaxSpcVal(frLayerNum layerNum,
                                         bool checkNDRs = true);
  void myBloat(const gtl::rectangle_data<frCoord>& rect,
               frCoord val,
               box_t& box);
  void checkMetalSpacing_main(gcRect* rect,
                              bool checkNDRs = true,
                              bool isSpcRect = false);
  void checkMetalSpacing_main(gcRect* rect1,
                              gcRect* rect2,
                              bool checkNDRs = true,
                              bool isSpcRect = false);
  void checkMetalSpacing_short(gcRect* rect1,
                               gcRect* rect2,
                               const gtl::rectangle_data<frCoord>& markerRect);

  bool checkMetalSpacing_short_skipFixed(
      gcRect* rect1,
      gcRect* rect2,
      const gtl::rectangle_data<frCoord>& markerRect);

  bool checkMetalSpacing_short_skipSameNet(
      gcRect* rect1,
      gcRect* rect2,
      const gtl::rectangle_data<frCoord>& markerRect);

  void checkMetalSpacing_short_obs(
      gcRect* rect1,
      gcRect* rect2,
      const gtl::rectangle_data<frCoord>& markerRect);
  frCoord checkMetalSpacing_prl_getReqSpcVal(gcRect* rect1,
                                             gcRect* rect2,
                                             frCoord prl);
  bool checkMetalSpacing_prl_hasPolyEdge(
      gcRect* rect1,
      gcRect* rect2,
      const gtl::rectangle_data<frCoord>& markerRect,
      int type,
      frCoord prl);
  void checkMetalSpacing_prl(gcRect* rect1,
                             gcRect* rect2,
                             const gtl::rectangle_data<frCoord>& markerRect,
                             frCoord prl,
                             frCoord distX,
                             frCoord distY,
                             bool checkNDRs = true,
                             bool checkPolyEdge = true);
  box_t checkMetalCornerSpacing_getQueryBox(gcCorner* corner,
                                            frCoord& maxSpcValX,
                                            frCoord& maxSpcValY);
  void checkMetalCornerSpacing();
  void checkMetalCornerSpacing_getMaxSpcVal(frLayerNum layerNum,
                                            frCoord& maxSpcValX,
                                            frCoord& maxSpcValY);

  void checkMetalCornerSpacing_main(gcCorner* corner);
  void checkMetalCornerSpacing_main(gcCorner* corner,
                                    gcRect* rect,
                                    frLef58CornerSpacingConstraint* con);

  void checkMetalShape();
  void checkMetalShape_main(gcPin* pin);
  void checkMetalShape_minWidth(const gtl::rectangle_data<frCoord>& rect,
                                frLayerNum layerNum,
                                gcNet* net,
                                bool isH);
  void checkMetalShape_offGrid(gcPin* pin);
  void checkMetalShape_minEnclosedArea(gcPin* pin);
  void checkMetalShape_minStep(gcPin* pin);
  void checkMetalShape_minStep_helper(const Rect& markerBox,
                                      frLayerNum layerNum,
                                      gcNet* net,
                                      frMinStepConstraint* con,
                                      bool hasInsideCorner,
                                      bool hasOutsideCorner,
                                      int currEdges,
                                      frCoord currLength,
                                      bool hasRoute);
  void checkMetalShape_rectOnly(gcPin* pin);
  void checkMetalShape_minArea(gcPin* pin);

  void checkMetalEndOfLine();
  void checkMetalEndOfLine_main(gcPin* pin);
  void checkMetalEndOfLine_eol(gcSegment* edge, frConstraint* constraint);
  void getMetalEolExtQueryRegion(gcSegment* edge,
                                 const gtl::rectangle_data<frCoord>& extRect,
                                 frCoord spacing,
                                 box_t& queryBox,
                                 gtl::rectangle_data<frCoord>& queryRect);
  void getMetalEolExtRect(gcSegment* edge,
                          frCoord extension,
                          gtl::rectangle_data<frCoord>& rect);
  void checkMetalEndOfLine_ext_helper(
      gcSegment* edge1,
      gcSegment* edge2,
      const gtl::rectangle_data<frCoord>& rect1,
      const gtl::rectangle_data<frCoord>& queryRect,
      frLef58EolExtensionConstraint* constraint);
  void checkMetalEndOfLine_ext(gcSegment* edge,
                               frLef58EolExtensionConstraint* constraint);
  void checkMetalEOLkeepout_helper(gcSegment* edge,
                                   gcRect* rect,
                                   gtl::rectangle_data<frCoord> queryRect,
                                   frLef58EolKeepOutConstraint* constraint);
  void checkMetalEOLkeepout_main(gcSegment* edge,
                                 frLef58EolKeepOutConstraint* constraint);
  void getEolKeepOutExceptWithinRects(gcSegment* edge,
                                      frLef58EolKeepOutConstraint* constraint,
                                      gtl::rectangle_data<frCoord>& rect1,
                                      gtl::rectangle_data<frCoord>& rect2);
  void getEolKeepOutQueryBox(gcSegment* edge,
                             frLef58EolKeepOutConstraint* constraint,
                             box_t& queryBox,
                             gtl::rectangle_data<frCoord>& queryRect);
  bool checkMetalEndOfLine_eol_isEolEdge(gcSegment* edge,
                                         frConstraint* constraint);
  bool checkMetalEndOfLine_eol_hasMinMaxLength(gcSegment* edge,
                                               frConstraint* constraint);
  bool checkMetalEndOfLine_eol_hasEncloseCut(gcSegment* edge1,
                                             gcSegment* edge2,
                                             frConstraint* constraint);
  void checkMetalEndOfLine_eol_hasEncloseCut_getQueryBox(
      gcSegment* edge,
      frLef58SpacingEndOfLineWithinEncloseCutConstraint* constraint,
      box_t& queryBox);
  bool checkMetalEndOfLine_eol_hasParallelEdge(gcSegment* edge,
                                               frConstraint* constraint,
                                               bool& hasRoute);
  bool checkMetalEndOfLine_eol_hasParallelEdge_oneDir(gcSegment* edge,
                                                      frConstraint* constraint,
                                                      bool isSegLow,
                                                      bool& hasRoute);
  void checkMetalEndOfLine_eol_hasParallelEdge_oneDir_getQueryBox(
      gcSegment* edge,
      frConstraint* constraint,
      bool isSegLow,
      box_t& queryBox,
      gtl::rectangle_data<frCoord>& queryRect);
  void checkMetalEndOfLine_eol_hasParallelEdge_oneDir_getParallelEdgeRect(
      gcSegment* edge,
      gtl::rectangle_data<frCoord>& rect);
  void checkMetalEndOfLine_eol_hasEol(gcSegment* edge,
                                      frConstraint* constraint,
                                      bool hasRoute);
  void checkMetalEndOfLine_eol_hasEol_getQueryBox(
      gcSegment* edge,
      frConstraint* constraint,
      box_t& queryBox,
      gtl::rectangle_data<frCoord>& queryRect,
      frCoord& eolNonPrlSpacing,
      frCoord& endPrlSpacing,
      frCoord& endPrl);
  void checkMetalEndOfLine_eol_hasEol_helper(gcSegment* edge1,
                                             gcSegment* edge2,
                                             frConstraint* constraint);
  bool checkMetalEndOfLine_eol_hasEol_endToEndHelper(gcSegment* edge1,
                                                     gcSegment* edge2,
                                                     frConstraint* constraint);

  void checkCutSpacing();
  void checkCutSpacing_main(gcRect* rect);
  void checkLef58CutSpacingTbl(gcRect* viaRect,
                               frLef58CutSpacingTableConstraint* con);
  bool checkLef58CutSpacingTbl_prlValid(
      const gtl::rectangle_data<frCoord>& viaRect1,
      const gtl::rectangle_data<frCoord>& viaRect2,
      const gtl::rectangle_data<frCoord>& markerRect,
      std::string cutClass1,
      std::string cutClass2,
      frCoord& prl,
      odb::dbTechLayerCutSpacingTableDefRule* dbRule);
  bool checkLef58CutSpacingTbl_sameMetal(gcRect* viaRect1, gcRect* viaRect2);
  bool checkLef58CutSpacingTbl_stacked(gcRect* viaRect1, gcRect* viaRect2);
  void checkLef58CutSpacingTbl_main(gcRect* viaRect1,
                                    gcRect* viaRect2,
                                    frLef58CutSpacingTableConstraint* con);
  bool checkLef58CutSpacingTbl_helper(
      gcRect* viaRect1,
      gcRect* viaRect2,
      frString cutClass1,
      frString cutClass2,
      const frDirEnum dir,
      frSquaredDistance distSquare,
      frSquaredDistance c2cSquare,
      bool prlValid,
      frCoord prl,
      odb::dbTechLayerCutSpacingTableDefRule* dbRule);
  void checkCutSpacing_main(gcRect* rect, frCutSpacingConstraint* con);
  bool checkCutSpacing_main_hasAdjCuts(gcRect* rect,
                                       frCutSpacingConstraint* con);
  frCoord checkCutSpacing_getMaxSpcVal(frCutSpacingConstraint* con);
  void checkCutSpacing_main(gcRect* ptr1,
                            gcRect* ptr2,
                            frCutSpacingConstraint* con);
  void checkCutSpacing_short(gcRect* rect1,
                             gcRect* rect2,
                             const gtl::rectangle_data<frCoord>& markerRect);
  void checkCutSpacing_spc(gcRect* rect1,
                           gcRect* rect2,
                           const gtl::rectangle_data<frCoord>& markerRect,
                           frCutSpacingConstraint* con,
                           frCoord prl);
  void checkCutSpacing_spc_diff_layer(
      gcRect* rect1,
      gcRect* rect2,
      const gtl::rectangle_data<frCoord>& markerRect,
      frCutSpacingConstraint* con);
  frCoord checkCutSpacing_spc_getReqSpcVal(gcRect* ptr1,
                                           gcRect* ptr2,
                                           frCutSpacingConstraint* con);

  // LEF58
  void checkLef58CutSpacing_main(gcRect* rect);
  void checkLef58CutSpacing_main(gcRect* rect,
                                 frLef58CutSpacingConstraint* con,
                                 bool skipSameNet = false);
  void checkLef58CutSpacing_main(gcRect* rect1,
                                 gcRect* rect2,
                                 frLef58CutSpacingConstraint* con);
  void checkLef58CutSpacing_spc_layer(
      gcRect* rect1,
      gcRect* rect2,
      const gtl::rectangle_data<frCoord>& markerRect,
      frLef58CutSpacingConstraint* con);
  void checkLef58CutSpacing_spc_adjCut(
      gcRect* rect1,
      gcRect* rect2,
      const gtl::rectangle_data<frCoord>& markerRect,
      frLef58CutSpacingConstraint* con);
  bool checkLef58CutSpacing_spc_hasAdjCuts(gcRect* rect,
                                           frLef58CutSpacingConstraint* con);
  bool checkLef58CutSpacing_spc_hasTwoCuts(gcRect* rect1,
                                           gcRect* rect2,
                                           frLef58CutSpacingConstraint* con);
  bool checkLef58CutSpacing_spc_hasTwoCuts_helper(
      gcRect* rect,
      frLef58CutSpacingConstraint* con);
  frCoord checkLef58CutSpacing_spc_getReqSpcVal(
      gcRect* ptr1,
      gcRect* ptr2,
      frLef58CutSpacingConstraint* con);
  frCoord checkLef58CutSpacing_getMaxSpcVal(frLef58CutSpacingConstraint* con);
  void checkMetalShape_lef58MinStep(gcPin* pin);
  void checkMetalShape_lef58MinStep_noBetweenEol(gcPin* pin,
                                                 frLef58MinStepConstraint* con);
  void checkMetalSpacingTableInfluence();
  void checkPinMetSpcTblInf(gcPin*);
  void checkRectMetSpcTblInf(gcRect*, frSpacingTableInfluenceConstraint*);
  void checkOrthRectsMetSpcTblInf(const std::vector<gcRect*>& rects,
                                  const gtl::rectangle_data<frCoord>& queryRect,
                                  const frCoord spacing,
                                  const gtl::orientation_2d orient);
  void checkRectMetSpcTblInf_queryBox(const gtl::rectangle_data<frCoord>& rect,
                                      const frCoord dist,
                                      const frDirEnum dir,
                                      box_t& box);
  void checkMetalShape_lef58Area(gcPin* pin);
  bool checkMetalShape_lef58Area_exceptRectangle(
      gcPolygon* poly,
      odb::dbTechLayerAreaRule* db_rule);
  bool checkMetalShape_lef58Area_rectWidth(gcPolygon* poly,
                                           odb::dbTechLayerAreaRule* db_rule,
                                           bool& check_rect_width);
  void checkMetalShape_addPatch(gcPin* pin, int min_area);

  void checkMetalWidthViaTable();
  void checkMetalWidthViaTable_main(gcRect* rect);
  // surgical fix
  void patchMetalShape();
  void patchMetalShape_minStep();
  void patchMetalShape_cornerSpacing();

  // utility
  bool isCornerOverlap(gcCorner* corner, const Rect& box);
  bool isCornerOverlap(gcCorner* corner,
                       const gtl::rectangle_data<frCoord>& rect);
  bool isOppositeDir(gcCorner* corner, gcSegment* seg);
  bool isWrongDir(gcSegment* edge);
};
}  // namespace fr

#endif


text:
.container_insert_j{
    padding-top: 20px;
    text-align:center;
    line-height: 30px;
    overflow: scroll;
    background-color: #a7a7a7;
}
textarea {
    resize: none;
}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Package org.apache.commons.math3.ode (Apache Commons Math 3.3 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
org.apache.commons.math3.ode

Packages that use org.apache.commons.math3.ode

Package
Description

org.apache.commons.math3.ode

 This package provides classes to solve Ordinary Differential Equations problems.

org.apache.commons.math3.ode.events

 This package provides classes to handle discrete events occurring during
 Ordinary Differential Equations integration.

org.apache.commons.math3.ode.nonstiff

 This package provides classes to solve non-stiff Ordinary Differential Equations problems.

org.apache.commons.math3.ode.sampling

 This package provides classes to handle sampling steps during
 Ordinary Differential Equations integration.

Classes in org.apache.commons.math3.ode used by org.apache.commons.math3.ode

Class and Description

AbstractIntegrator

Base class managing common boilerplate for all integrators.

ContinuousOutputModel

This class stores all information provided by an ODE integrator
 during the integration process and build a continuous model of the
 solution from this.

EquationsMapper

Class mapping the part of a complete state or derivative that pertains
 to a specific differential equation.

ExpandableStatefulODE

This class represents a combined set of first order differential equations,
 with at least a primary set of equations expandable by some sets of secondary
 equations.

FirstOrderDifferentialEquations

This interface represents a first order differential equations set.

FirstOrderIntegrator

This interface represents a first order integrator for
 differential equations.

JacobianMatrices.MismatchedEquations

Special exception for equations mismatch.

MainStateJacobianProvider

Interface expanding first order
  differential equations in order to compute exactly the main state jacobian
  matrix for partial derivatives equations.

ODEIntegrator

This interface defines the common parts shared by integrators
 for first and second order differential equations.

Parameterizable

This interface enables to process any parameterizable object.

ParameterizedODE

Interface to compute by finite difference Jacobian matrix for some parameter
  when computing partial derivatives equations.

ParameterJacobianProvider

Interface to compute exactly Jacobian matrix for some parameter
  when computing partial derivatives equations.

SecondaryEquations

This interface allows users to add secondary differential equations to a primary
 set of differential equations.

SecondOrderDifferentialEquations

This interface represents a second order differential equations set.

UnknownParameterException

Exception to be thrown when a parameter is unknown.

Classes in org.apache.commons.math3.ode used by org.apache.commons.math3.ode.events

Class and Description

ExpandableStatefulODE

This class represents a combined set of first order differential equations,
 with at least a primary set of equations expandable by some sets of secondary
 equations.

Classes in org.apache.commons.math3.ode used by org.apache.commons.math3.ode.nonstiff

Class and Description

AbstractIntegrator

Base class managing common boilerplate for all integrators.

ExpandableStatefulODE

This class represents a combined set of first order differential equations,
 with at least a primary set of equations expandable by some sets of secondary
 equations.

FirstOrderDifferentialEquations

This interface represents a first order differential equations set.

FirstOrderIntegrator

This interface represents a first order integrator for
 differential equations.

MultistepIntegrator

This class is the base class for multistep integrators for Ordinary
 Differential Equations.

ODEIntegrator

This interface defines the common parts shared by integrators
 for first and second order differential equations.

Classes in org.apache.commons.math3.ode used by org.apache.commons.math3.ode.sampling

Class and Description

EquationsMapper

Class mapping the part of a complete state or derivative that pertains
 to a specific differential equation.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.


text:
/**
 * This file is part of the CernVM File System.
 */

#include "cvmfs_config.h"
#include "cmd_commit.h"

#include <errno.h>

#include <ctime>
#include <string>
#include <vector>

#include "publish/cmd_util.h"
#include "publish/except.h"
#include "publish/repository.h"
#include "publish/settings.h"
#include "util/logging.h"
#include "util/posix.h"
#include "util/string.h"
#include "whitelist.h"

namespace publish {

int CmdCommit::Main(const Options &options) {
  // Repository name and lease path are submitted as a single argument
  // for historical reasons
  std::string fqrn;

  if (!options.plain_args().empty()) {
    std::vector<std::string> tokens =
      SplitStringBounded(2, options.plain_args()[0].value_str, '/');
    fqrn = tokens[0];
  }

  SettingsBuilder builder;
  std::string session_dir = Env::GetEnterSessionDir();
  builder.SetConfigPath(session_dir);

  UniquePtr<SettingsPublisher> settings;
  try {
    settings = builder.CreateSettingsPublisher(fqrn, true /* needs_managed */);
  } catch (const EPublish &e) {
    if (e.failure() == EPublish::kFailRepositoryNotFound) {
      LogCvmfs(kLogCvmfs, kLogStderr | kLogSyslogErr, "CernVM-FS error: %s",
               e.msg().c_str());
      return 1;
    }
    throw;
  }

  if (!SwitchCredentials(settings->owner_uid(), settings->owner_gid(),
                         false /* temporarily */))
  {
    throw EPublish("No write permission to repository");
  }

  FileSystemInfo fs_info = GetFileSystemInfo("/cvmfs");
  if (fs_info.type == kFsTypeAutofs)
    throw EPublish("Autofs on /cvmfs has to be disabled");

  UniquePtr<Publisher> publisher;
  try {
    publisher = new Publisher(*settings);
    if (publisher->whitelist()->IsExpired()) {
      throw EPublish("Repository whitelist for $name is expired",
                     EPublish::kFailWhitelistExpired);
    }
  } catch (const EPublish &e) {
    if (e.failure() == EPublish::kFailLayoutRevision ||
        e.failure() == EPublish::kFailWhitelistExpired)
    {
      LogCvmfs(kLogCvmfs, kLogStderr | kLogSyslogErr, "%s", e.msg().c_str());
      return EINVAL;
    }
  }

  double whitelist_valid_s =
    difftime(publisher->whitelist()->expires(), time(NULL));
  if (whitelist_valid_s < (12 * 60 * 60)) {
    LogCvmfs(kLogCvmfs, kLogStdout,
      "Warning: Repository whitelist stays valid for less than 12 hours!");
  }

  publisher->Sync();
  SafeWriteToFile("commit", session_dir + "/shellaction.marker", 0600);
  LogCvmfs(kLogCvmfs, kLogStdout, "Changes saved!");
  publisher->ExitShell();

  return 0;
}

}  // namespace publish


text:
<?php
// This is global bootstrap for autoloading

use AspectMock\Kernel;

require_once __DIR__.'/../var/bootstrap.php.cache';
require_once __DIR__.'/../vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php';

$kernel = Kernel::getInstance();
$kernel->init([
    'debug' => true,
    'appDir' => __DIR__.'/../app',
    'cacheDir' => __DIR__.'/../var/cache',
    'includePaths' => [__DIR__.'/../src'],
    'excludePaths' => [__DIR__], // tests dir should be excluded
]);


text:
package allow.simulator.mobility.data.gtfs;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)

/**
 * Utility class describing a public transportation agency from GTFS.
 * (https://developers.google.com/transit/gtfs/reference)
 *
 * @author Andreas Poxrucker (DFKI)
 *
 */
public final class GTFSAgency {
	// Id of agency.
	private final String id;

	// Name of agency.
	private final String name;

	/**
	 * Constructor.
	 * Creates a new agency info class describing a transportation agency from GTFS.
	 *
	 * @param id Id of the agency.
	 * @param name Name of the agency.
	 */
	@JsonCreator
	public GTFSAgency(@JsonProperty("id") String id,
			@JsonProperty("name") String name) {
		this.id = id;
		this.name = name;
	}

	/**
	 * Returns the Id of the agency.
	 *
	 * @return Id of the agency.
	 */
	public String getId() {
		return id;
	}

	/**
	 * Returns the name of the agency.
	 *
	 * @return Name of the agency.
	 */
	public String getName() {
		return name;
	}

	// Constants when agency is read from a GTFS file directly.
	private static int AGENCY_ID = 0;
	private static int AGENCY_NAME = 1;

	/**
	 * Parses a GTFSAgency from a line in the corresponding GTFS file (agency.txt).
	 *
	 * @param line Line from GTFS file (agency.txt).
	 * @return GTFSAgency parsed from GTFS file.
	 */
	public static GTFSAgency fromGTFS(String line) {
		String tokens[] = line.split(",");
		return new GTFSAgency(tokens[AGENCY_ID], tokens[AGENCY_NAME]);
	}
}


text:
var querystring = require('querystring');
var serializer = require('serializer');
var debug = require('./../utils/debug');

// Sublibs
var token = require('./token');
var authorize = require('./authorize');

module.exports = function (app, options) {

    app.post('/oauth/login', function (req, res) {
        login(options, req, res)
    });
    app.get(options.authorize_uri, function (req, res) {
        authorize(options, req, res)
    });
    app.post(options.authorize_uri, function (req, res) {
        authorize(options, req, res)
    });
    app.post(options.access_token_uri, function (req, res) {
        token(options, req, res)
    });

    //return function (req, res, next) {
    //    var uri = ~req.url.indexOf('?') ? req.url.substr(0, req.url.indexOf('?')) : req.url;
    //    if ('/oauth/login' == uri) {
    //        login(options, req, res);
    //    } else if (options.authorize_uri == uri) {
    //        authorize(options, req, res);
    //    } else if (options.access_token_uri == uri) {
    //        token(options, req, res);
    //    }
    //    else {
    //        return next();
    //    }
    //}
};

function login(options, req, res) {
    options.storage.loginUser(req, function (user) {
        var redirection = querystring.stringify({
            client_id: req.query.client_id,
            redirect_uri: req.query.redirect_uri
        });
        decodeURIComponent(req.body.next);
        return res.redirect(decodeURIComponent(req.body.next));
    });
};


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

<TITLE>
B-Index
</TITLE>

<META NAME="date" CONTENT="2011-01-03">

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

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I J L M N O P Q R S T U V W X Y Z

B

b -
Variable in class toxi.geom.Line2D

b -
Variable in class toxi.geom.Line3D

b -
Variable in class toxi.geom.mesh.Face

b -
Variable in class toxi.geom.Triangle2D

b -
Variable in class toxi.geom.Triangle3D

b0 -
Variable in class toxi.geom.BernsteinPolynomial

b1 -
Variable in class toxi.geom.BernsteinPolynomial

b2 -
Variable in class toxi.geom.BernsteinPolynomial

b3 -
Variable in class toxi.geom.BernsteinPolynomial

beginSave(OutputStream) -
Method in class toxi.geom.mesh.OBJWriter

beginSave(String) -
Method in class toxi.geom.mesh.OBJWriter

beginSave(OutputStream, int) -
Method in class toxi.geom.mesh.STLWriter

beginSave(String, int) -
Method in class toxi.geom.mesh.STLWriter

bernstein -
Variable in class toxi.geom.Spline2D

bernstein -
Variable in class toxi.geom.Spline3D

BernsteinPolynomial - Class in toxi.geom
Helper class for the spline3d classes in this package.
BernsteinPolynomial(int) -
Constructor for class toxi.geom.BernsteinPolynomial

BezierInterpolation - Class in toxi.math
Bezier curve interpolation with configurable coefficients.
BezierInterpolation(float, float) -
Constructor for class toxi.math.BezierInterpolation

BezierPatch - Class in toxi.geom.mesh
4x4 bezier patch implementation with tesselation support (dynamic resolution)
 for generating triangle mesh representations.
BezierPatch() -
Constructor for class toxi.geom.mesh.BezierPatch

BezierPatch(Vec3D[][]) -
Constructor for class toxi.geom.mesh.BezierPatch

bi -
Variable in class toxi.geom.Spline2D

bi -
Variable in class toxi.geom.Spline3D

bias -
Variable in class toxi.util.datatypes.BiasedIntegerRange

BiasedFloatRange - Class in toxi.util.datatypes

BiasedFloatRange() -
Constructor for class toxi.util.datatypes.BiasedFloatRange

BiasedFloatRange(float, float, float, float) -
Constructor for class toxi.util.datatypes.BiasedFloatRange

BiasedIntegerRange - Class in toxi.util.datatypes

BiasedIntegerRange() -
Constructor for class toxi.util.datatypes.BiasedIntegerRange

BiasedIntegerRange(int, int, int, float) -
Constructor for class toxi.util.datatypes.BiasedIntegerRange

bilinear(double, double, double, double, double, double, float, float, float, float) -
Static method in class toxi.math.Interpolation2D

bilinear(Vec2D, Vec2D, Vec2D, float, float, float, float) -
Static method in class toxi.math.Interpolation2D

bisect(Vec2D) -
Method in interface toxi.geom.ReadonlyVec2D

Computes the perpendicular bisector of two points.

bisect(Vec2D) -
Method in class toxi.geom.Vec2D

bisector(DelaunayVertex) -
Method in class toxi.geom.mesh2d.DelaunayVertex

Perpendicular bisector of two Pnts.

box -
Variable in class toxi.geom.mesh.BoxSelector

BoxSelector - Class in toxi.geom.mesh
A VertexSelector implementation for selecting vertices within a given
 AABB.
BoxSelector(Mesh3D, AABB) -
Constructor for class toxi.geom.mesh.BoxSelector

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I J L M N O P Q R S T U V W X Y Z


text:
@implementation LBStoreDetailAdressTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.Bobt.layer.cornerRadius = 4;
    self.Bobt.clipsToBounds = YES;

}
//打电话
- (IBAction)phonebuttonEvent:(UIButton *)sender {

    [self.delegete takePhne];
}
//去这里
- (IBAction)gowhereButtonEvent:(UIButton *)sender {

    [self.delegete gotheremap];

}

@end


text:
package org.apache.hyracks.control.cc.work;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.hyracks.api.job.JobId;
import org.apache.hyracks.control.cc.ClusterControllerService;
import org.apache.hyracks.control.cc.NodeControllerState;
import org.apache.hyracks.control.cc.job.JobRun;
import org.apache.hyracks.control.common.work.AbstractWork;

public class RemoveDeadNodesWork extends AbstractWork {
    private static Logger LOGGER = Logger.getLogger(RemoveDeadNodesWork.class.getName());

    private final ClusterControllerService ccs;

    public RemoveDeadNodesWork(ClusterControllerService ccs) {
        this.ccs = ccs;
    }

    @Override
    public void run() {
        Set<String> deadNodes = new HashSet<String>();
        Map<String, NodeControllerState> nodeMap = ccs.getNodeMap();
        for (Map.Entry<String, NodeControllerState> e : nodeMap.entrySet()) {
            NodeControllerState state = e.getValue();
            if (state.incrementLastHeartbeatDuration() >= ccs.getConfig().maxHeartbeatLapsePeriods) {
                deadNodes.add(e.getKey());
                LOGGER.info(e.getKey() + " considered dead");
            }
        }
        Set<JobId> affectedJobIds = new HashSet<JobId>();
        for (String deadNode : deadNodes) {
            NodeControllerState state = nodeMap.remove(deadNode);

            // Deal with dead tasks.
            affectedJobIds.addAll(state.getActiveJobIds());
        }
        int size = affectedJobIds.size();
        if (size > 0) {
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.info("Number of affected jobs: " + size);
            }
            for (JobId jobId : affectedJobIds) {
                JobRun run = ccs.getActiveRunMap().get(jobId);
                if (run != null) {
                    run.getScheduler().notifyNodeFailures(deadNodes);
                }
            }
        }
        if (deadNodes != null && deadNodes.size() > 0) {
            ccs.getApplicationContext().notifyNodeFailure(deadNodes);
        }
    }

    @Override
    public Level logLevel() {
        return Level.FINE;
    }
}


text:
@import SafariServices;
#else
#import <SafariServices/SafariServices.h>
#endif
#endif

static NSString *const VTDefaultAcknowledgementsPlistName = @"Pods-acknowledgements";
static NSString *const VTDefaultHeaderText                = @"This application makes use of the following third party libraries:";
static NSString *const VTDefaultFooterText                = @"Generated by CocoaPods - https://cocoapods.org";
static NSString *const VTDefaultFooterTextLegacy          = @"Generated by CocoaPods - http://cocoapods.org"; // For CocoaPods 0.x
static NSString *const VTCocoaPodsURLString               = @"https://cocoapods.org";
static NSString *const VTCellIdentifier                   = @"Cell";

static const CGFloat VTLabelMargin = 20;
static const CGFloat VTFooterBottomMargin = 20;

@interface VTAcknowledgementsViewController ()

+ (NSString *)acknowledgementsPlistPathForName:(NSString *)name;
+ (NSString *)defaultAcknowledgementsPlistPath;
+ (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)defaultString;
+ (NSString *)localizedCocoaPodsFooterText;

- (void)configureHeaderView;
- (void)configureFooterView;
- (UIFont *)headerFooterFont;
- (CGFloat)heightForLabelWithText:(NSString *)labelText andWidth:(CGFloat)labelWidth;

- (IBAction)dismissViewController:(id)sender;
- (void)commonInitWithAcknowledgementsPlistPath:(NSString *)acknowledgementsPlistPath;
- (void)openCocoaPodsWebsite:(id)sender;

@end

@implementation VTAcknowledgementsViewController

+ (NSString *)acknowledgementsPlistPathForName:(NSString *)name
{
    return [[NSBundle mainBundle] pathForResource:name ofType:@"plist"];
}

+ (NSString *)defaultAcknowledgementsPlistPath
{
    return [self acknowledgementsPlistPathForName:VTDefaultAcknowledgementsPlistName];
}

+ (instancetype)acknowledgementsViewController
{
    NSString *path = self.defaultAcknowledgementsPlistPath;
    return [[self.class alloc] initWithAcknowledgementsPlistPath:path];
}

- (instancetype)initWithPath:(NSString *)acknowledgementsPlistPath
{
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (self) {
        [self commonInitWithAcknowledgementsPlistPath:acknowledgementsPlistPath];
    }

    return self;
}

- (instancetype)initWithAcknowledgementsPlistPath:(NSString *)acknowledgementsPlistPath
{
    return [self initWithPath:acknowledgementsPlistPath];
}

- (nullable instancetype)initWithFileNamed:(nonnull NSString *)acknowledgementsFileName
{
    NSString *path = [[NSBundle mainBundle] pathForResource:acknowledgementsFileName ofType:@"plist"];
    return [self initWithPath:path];
}

- (nullable instancetype)initWithAcknowledgementsFileNamed:(nullable NSString *)acknowledgementsFileName
{
    return [self initWithFileNamed:acknowledgementsFileName];
}

- (void)awakeFromNib
{
    [super awakeFromNib];

    NSString *path;
    if (self.acknowledgementsPlistName) {
        path = [self.class acknowledgementsPlistPathForName:self.acknowledgementsPlistName];
    }
    else {
        path = self.class.defaultAcknowledgementsPlistPath;
    }

    [self commonInitWithAcknowledgementsPlistPath:path];
}

- (void)commonInitWithAcknowledgementsPlistPath:(NSString *)acknowledgementsPlistPath
{
    self.title = self.class.localizedTitle;

    VTAcknowledgementsParser *parser = [[VTAcknowledgementsParser alloc] initWithAcknowledgementsPlistPath:acknowledgementsPlistPath];

    if ([parser.header isEqualToString:VTDefaultHeaderText]) {
        self.headerText = nil;
    }
    else if (![parser.header isEqualToString:@""]) {
        self.headerText = parser.header;
    }

    if ([parser.footer isEqualToString:VTDefaultFooterText] ||
        [parser.footer isEqualToString:VTDefaultFooterTextLegacy]) {
        self.footerText = [VTAcknowledgementsViewController localizedCocoaPodsFooterText];
    }
    else if (![parser.footer isEqualToString:@""]) {
        self.footerText = parser.footer;
    }

    NSMutableArray *acknowledgements = [parser.acknowledgements mutableCopy];

    [acknowledgements sortUsingComparator:^NSComparisonResult(VTAcknowledgement *obj1, VTAcknowledgement *obj2) {
        return [obj1.title compare:obj2.title
                           options:kNilOptions
                             range:NSMakeRange(0, obj1.title.length)
                            locale:[NSLocale currentLocale]];
    }];

    self.acknowledgements = acknowledgements;
}

#pragma mark - Localization

+ (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)defaultString
{
    static NSBundle *bundle = nil;
    if (!bundle) {
        NSString *bundlePath = [NSBundle.mainBundle pathForResource:@"VTAcknowledgementsViewController" ofType:@"bundle"];
        bundle = [NSBundle bundleWithPath:bundlePath];

        NSString *language = NSLocale.preferredLanguages.count? NSLocale.preferredLanguages.firstObject: @"en";
        if (![bundle.localizations containsObject:language]) {
            language = [language componentsSeparatedByString:@"-"].firstObject;
        }
        if ([bundle.localizations containsObject:language]) {
            bundlePath = [bundle pathForResource:language ofType:@"lproj"];
        }

        bundle = [NSBundle bundleWithPath:bundlePath] ?: NSBundle.mainBundle;
    }

    defaultString = [bundle localizedStringForKey:key value:defaultString table:nil];
    return [NSBundle.mainBundle localizedStringForKey:key value:defaultString table:nil];
}

+ (NSString *)localizedTitle
{
    return [self localizedStringForKey:@"VTAckAcknowledgements" withDefault:@"Acknowledgements"];
}

+ (NSString *)localizedCocoaPodsFooterText
{
    return [NSString stringWithFormat:@"%@\n%@",
            [self.class localizedStringForKey:@"VTAckGeneratedByCocoaPods" withDefault:@"Generated by CocoaPods"],
            VTCocoaPodsURLString];
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    if (self.headerText) {
        [self configureHeaderView];
    }

    if (self.footerText) {
        [self configureFooterView];
    }

#if TARGET_OS_TV
    self.view.layoutMargins = UIEdgeInsetsMake(60.0, 90.0, 60.0, 90.0); // Margins from tvOS HIG
#endif

    if (self.presentingViewController && self == [self.navigationController.viewControllers firstObject]) {
        UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
                                                                                target:self
                                                                                action:@selector(dismissViewController:)];
#if !TARGET_OS_TV
        self.navigationItem.leftBarButtonItem = doneItem;
#else
        // Add a spacer item because the leftBarButtonItem is misplaced on tvOS (doesn't obey the HIG)
        UIBarButtonItem *spacerItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
                                                                                target:self
                                                                                action:nil];
        spacerItem.width = 90.0;
        self.navigationItem.leftBarButtonItems = @[spacerItem, doneItem];
#endif
    }
}

- (UIFont *)headerFooterFont
{
    if ([UIFont respondsToSelector:@selector(preferredFontForTextStyle:)]) {
        return [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote];
    }
    else {
        return [UIFont systemFontOfSize:12];
    }
}

- (void)configureHeaderView
{
    UIFont *font = [self headerFooterFont];
    CGFloat labelWidth = CGRectGetWidth(self.view.frame) - 2 * VTLabelMargin;
    CGFloat labelHeight = [self heightForLabelWithText:self.headerText andWidth:labelWidth];

    CGRect labelFrame = CGRectMake(VTLabelMargin, VTLabelMargin, labelWidth, labelHeight);

    UILabel *label = [[UILabel alloc] initWithFrame:labelFrame];
    label.text             = self.headerText;
    label.font             = font;
    label.textColor        = [UIColor grayColor];
    label.backgroundColor  = [UIColor clearColor];
    label.numberOfLines    = 0;
    label.textAlignment    = NSTextAlignmentCenter;
    label.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin);

    CGRect headerFrame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(label.frame) + 2 * VTLabelMargin);
    UIView *headerView = [[UIView alloc] initWithFrame:headerFrame];
    [headerView addSubview:label];
    self.tableView.tableHeaderView = headerView;
}

- (void)configureFooterView
{
    UIFont *font = [self headerFooterFont];
    CGFloat labelWidth = CGRectGetWidth(self.view.frame) - 2 * VTLabelMargin;
    CGFloat labelHeight = [self heightForLabelWithText:self.footerText andWidth:labelWidth];

    CGRect labelFrame = CGRectMake(VTLabelMargin, 0, labelWidth, labelHeight);

    UILabel *label = [[UILabel alloc] initWithFrame:labelFrame];
    label.text             = self.footerText;
    label.font             = font;
    label.textColor        = [UIColor grayColor];
    label.backgroundColor  = [UIColor clearColor];
    label.numberOfLines    = 0;
    label.textAlignment    = NSTextAlignmentCenter;
    label.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin);
    label.userInteractionEnabled = YES;

    if ([self.footerText rangeOfString:[NSURL URLWithString:VTCocoaPodsURLString].host].location != NSNotFound) {
        UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(openCocoaPodsWebsite:)];
        [label addGestureRecognizer:tapGestureRecognizer];
    }

    CGRect footerFrame = CGRectMake(0, 0, CGRectGetWidth(label.frame), CGRectGetHeight(label.frame) + VTFooterBottomMargin);
    UIView *footerView = [[UIView alloc] initWithFrame:footerFrame];
    footerView.userInteractionEnabled = YES;
    [footerView addSubview:label];
    label.frame = CGRectMake(0, 0, CGRectGetWidth(label.frame), CGRectGetHeight(label.frame));
    self.tableView.tableFooterView = footerView;
}

- (CGFloat)heightForLabelWithText:(NSString *)labelText andWidth:(CGFloat)labelWidth
{
    UIFont *font = self.headerFooterFont;
    CGFloat labelHeight;

    if ([labelText respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) {
        NSStringDrawingOptions options = (NSLineBreakByWordWrapping | NSStringDrawingUsesLineFragmentOrigin);
        CGRect labelBounds = [labelText boundingRectWithSize:CGSizeMake(labelWidth, CGFLOAT_MAX)
                                                     options:options
                                                  attributes:@{NSFontAttributeName: font}
                                                     context:nil];
        labelHeight = CGRectGetHeight(labelBounds);
    }
    else {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if !TARGET_OS_TV
        CGSize size = [labelText sizeWithFont:font constrainedToSize:(CGSize){labelWidth, CGFLOAT_MAX}];
#else
        CGSize size = CGSizeMake(labelWidth, font.pointSize); // This is probably wrong logically, but it works/looks fine on tvOS
#endif
#pragma GCC diagnostic pop
        labelHeight = size.height;
    }

    return ceilf(labelHeight);
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow
                                  animated:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    if (self.acknowledgements.count == 0) {
        NSLog(@"** VTAcknowledgementsViewController Warning **");
        NSLog(@"No acknowledgements found.");
        NSLog(@"This probably means that you didn't import the `Pods-acknowledgements.plist` to your main target.");
        NSLog(@"Please take a look at https://github.com/vtourraine/VTAcknowledgementsViewController for instructions.");
    }
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    [super didRotateFromInterfaceOrientation:fromInterfaceOrientation];

    if (self.headerText) {
        [self configureHeaderView];
    }

    if (self.footerText) {
        [self configureFooterView];
    }
}

#pragma mark - Actions

- (void)openCocoaPodsWebsite:(id)sender
{
#if !TARGET_OS_TV
    NSURL *URL = [NSURL URLWithString:VTCocoaPodsURLString];

    if ([SFSafariViewController class]) {
        SFSafariViewController *viewController = [[SFSafariViewController alloc] initWithURL:URL];
        [self presentViewController:viewController animated:YES completion:nil];
    }
    else {
        [[UIApplication sharedApplication] openURL:URL];
    }
#endif
}

- (IBAction)dismissViewController:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.acknowledgements.count;
}

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewAutomaticDimension;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:VTCellIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:VTCellIdentifier];
    }

    VTAcknowledgement *acknowledgement = self.acknowledgements[indexPath.row];
    cell.textLabel.text = acknowledgement.title;
    cell.accessoryType  = UITableViewCellAccessoryDisclosureIndicator;

    return cell;
}

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    VTAcknowledgement *acknowledgement = self.acknowledgements[indexPath.row];
    VTAcknowledgementViewController *viewController = [[VTAcknowledgementViewController alloc] initWithTitle:acknowledgement.title text:acknowledgement.text];

    [self.navigationController pushViewController:viewController animated:YES];
}

@end


text:
package com.hyperfresh.mcuniverse.server.networked;

import com.hyperfresh.mcuniverse.UniverseVersion;
import com.hyperfresh.mcuniverse.minecraft.MinecraftServer;
import com.hyperfresh.mcuniverse.server.ServerProperty;

import java.io.Serializable;
import java.util.Map;

/**
 * @author Octopod - octopodsquad@gmail.com
 */
public interface UniverseServer extends Serializable, MinecraftServer
{
	/**
	 * Gets the username of this server.
	 *
	 * @return
	 */
	public String getServerUsername();

	/**
	 * Gets the display name of this server.
	 * If there is no display name, the username will be used instead.
	 *
	 * @return
	 */
	public String getServerName();

	public UniverseVersion getPluginVersion();

	public Map<ServerProperty, Object> getPropertyMap();

	public <T> T getProperty(ServerProperty<T> key);

	/**
	 * Sets a property of a server.
	 * This method should fail if:
	 *   - The value does not match the expected type of the ServerProperty
	 *   - A duplicate instance of an existing ServerProperty is used
	 *
	 * @param key
	 * @param value
	 * @param <T>
	 */
	public <T> void setProperty(ServerProperty<T> key, T value) throws IllegalArgumentException;

	public boolean isOnline();
}


text:
#import <Foundation/Foundation.h>

@class NSArray;

@interface SimRuntimePairingReuirements : NSObject
{
    unsigned int _minOSVersion;
    NSArray *_supportedProductFamilies;
    unsigned long long _maxPairs;
}

@property (nonatomic, assign) unsigned long long maxPairs;
@property (copy, nonatomic) NSArray *supportedProductFamilies;
@property (nonatomic, assign) unsigned int minOSVersion;

@end


text:
import tempfile
import shutil
from zipfile import ZipFile
import distutils.core

from github3 import GitHub

from mod import Mod

class mks(Mod):
    def __init__(self, path='.', git=None, repo = ("BobPalmer", "MKS")):
        self.path=path
        if git is None:
            self.git = GitHub()
        else:
            self.git = git
        self.reponame = repo

    def preUpdate(self):
        print "Performing pre update phase"

    def update(self):
        print "Performing update"
        dir = tempfile.mkdtemp()
        self.repo = self.git.repository(self.reponame[0], self.reponame[1])
        releases = [x for x in self.repo.releases()]
        assets = [x for x in releases[0].assets()]
        print "Got mod, version ",
        print assets[0]
        print "Downloading mod"
        assets[0].download(path=dir + "/mks.zip")
        print"Downloaded succesfully"
        with ZipFile(dir + '/mks.zip', 'r') as zip:
            zip.extractall(path=dir+ '/mks')
        distutils.dir_util.copy_tree(dir + '/mks/GameData', self.path)
        shutil.rmtree(dir)
        print "Update phase completed"

    def postUpdate(self):
        print "Performing post update phase"
        print "Mod update completed"


text:
package com.tectonica.jonix.onix3;

import java.io.Serializable;

import com.tectonica.jonix.JPU;
import com.tectonica.jonix.OnixComposite.OnixDataComposite;
import com.tectonica.jonix.codelist.RecordSourceTypes;
import com.tectonica.jonix.codelist.StockQuantityCodeTypes;
import com.tectonica.jonix.struct.JonixStockQuantityCoded;

/*
 * NOTE: THIS IS AN AUTO-GENERATED FILE, DON'T EDIT MANUALLY
 */

@SuppressWarnings("serial")
public class StockQuantityCoded implements OnixDataComposite, Serializable
{
	public static final String refname = "StockQuantityCoded";
	public static final String shortname = "stockquantitycoded";

	/**
	 * (type: dt.DateOrDateTime)
	 */
	public String datestamp;

	public RecordSourceTypes sourcetype;

	public String sourcename;

	/**
	 * (this field is required)
	 */
	public StockQuantityCodeType stockQuantityCodeType;

	/**
	 * (this field is optional)
	 */
	public StockQuantityCodeTypeName stockQuantityCodeTypeName;

	/**
	 * (this field is required)
	 */
	public StockQuantityCode stockQuantityCode;

	public StockQuantityCoded()
	{}

	public StockQuantityCoded(org.w3c.dom.Element element)
	{
		datestamp = JPU.getAttribute(element, "datestamp");
		sourcetype = RecordSourceTypes.byValue(JPU.getAttribute(element, "sourcetype"));
		sourcename = JPU.getAttribute(element, "sourcename");

		JPU.forElementsOf(element, new JPU.ElementListener()
		{
			@Override
			public void onElement(org.w3c.dom.Element element)
			{
				final String name = element.getNodeName();
				if (name.equals(StockQuantityCodeType.refname) || name.equals(StockQuantityCodeType.shortname))
					stockQuantityCodeType = new StockQuantityCodeType(element);
				else if (name.equals(StockQuantityCodeTypeName.refname)
						|| name.equals(StockQuantityCodeTypeName.shortname))
					stockQuantityCodeTypeName = new StockQuantityCodeTypeName(element);
				else if (name.equals(StockQuantityCode.refname) || name.equals(StockQuantityCode.shortname))
					stockQuantityCode = new StockQuantityCode(element);
			}
		});
	}

	public StockQuantityCodeTypes getStockQuantityCodeTypeValue()
	{
		return (stockQuantityCodeType == null) ? null : stockQuantityCodeType.value;
	}

	public String getStockQuantityCodeTypeNameValue()
	{
		return (stockQuantityCodeTypeName == null) ? null : stockQuantityCodeTypeName.value;
	}

	public String getStockQuantityCodeValue()
	{
		return (stockQuantityCode == null) ? null : stockQuantityCode.value;
	}

	public JonixStockQuantityCoded asJonixStockQuantityCoded()
	{
		JonixStockQuantityCoded x = new JonixStockQuantityCoded();
		x.stockQuantityCodeType = getStockQuantityCodeTypeValue();
		x.stockQuantityCode = getStockQuantityCodeValue();
		x.stockQuantityCodeTypeName = getStockQuantityCodeTypeNameValue();
		return x;
	}
}


text:
PHOENIX_VERSION=1.0.3

yes Y | mix local.hex >/dev/null 2>&1
yes Y | mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v$PHOENIX_VERSION/phoenix_new-$PHOENIX_VERSION.ez >/dev/null 2>&1


text:
import {Functions} from '../../block/Functions';
import {BlockFunction} from '../../block/BlockFunction';
import {BlockIO} from '../../block/BlockProperty';
import {ErrorEvent, WAIT} from '../../block/Event';
import {Block} from '../../block/Block';
import {BlockDeepProxy} from '../../block/BlockProxy';
import {FunctionDesc} from '../../block/Descriptor';
import {Logger} from '../../util/Logger';

const SCRIPT_ERROR = 'scriptError';

export class JsFunction extends BlockFunction {
  _compiledFunction: Function;
  _runFunction: Function;

  _proxy: object;

  constructor(block: Block) {
    super(block);
    this._proxy = new Proxy(block, BlockDeepProxy);
  }

  inputChanged(input: BlockIO, val: any): boolean {
    // ignore parent implementation of inputChanged
    if (input._name === 'script') {
      this._compiledFunction = null;
      this._runFunction = null;
      return val !== undefined;
    }
    return Boolean(this._runFunction);
  }

  parseFunction(script: string): Function {
    return new Function('__block__', script);
  }
  applyFunction(f: Function): any {
    return f.call(this._proxy, this._data);
  }

  run(): any {
    if (this._runFunction == null) {
      if (this._compiledFunction == null) {
        let script = this._data.getValue('script');
        if (typeof script === 'string') {
          try {
            this._compiledFunction = this.parseFunction(script);
          } catch (err) {
            return new ErrorEvent(SCRIPT_ERROR, err);
          }
        } else if (script === undefined) {
          return WAIT;
        } else {
          return new ErrorEvent(SCRIPT_ERROR, 'script is not string');
        }
      }
      let rslt;
      try {
        rslt = this.applyFunction(this._compiledFunction);
      } catch (err) {
        this._compiledFunction = null;
        return new ErrorEvent(SCRIPT_ERROR, err);
      }
      if (typeof rslt === 'function') {
        // let the function run again
        this._runFunction = rslt;
      } else {
        this._runFunction = this._compiledFunction;
        return rslt;
      }
    }
    let rslt: any;
    try {
      rslt = this.applyFunction(this._runFunction);
    } catch (err) {
      return new ErrorEvent(SCRIPT_ERROR, err);
    }
    return rslt;
  }

  static registerType(script: string, desc: FunctionDesc, namespace?: string): boolean {
    try {
      let compiledFunction = new Function(script);

      class CustomScriptFunction extends JsFunction {
        constructor(block: Block) {
          super(block);
          this._compiledFunction = compiledFunction;
        }
      }

      if (!desc.priority) {
        desc.priority = 1;
      }
      if (!desc.mode) {
        desc.mode = 'onLoad';
      }
      desc.src = 'js';

      Functions.add(CustomScriptFunction, desc, namespace);
      return true;
    } catch (err) {
      Logger.error(`invalid script:\n${script}`);
    }
    return false;
  }
}

Functions.add(JsFunction, {
  name: 'js',
  icon: 'txt:js',
  priority: 1,
  properties: [
    {
      name: 'script',
      type: 'string',
      mime: 'text/javascript',
      visible: 'high',
    },
  ],
});


text:
* Gestion compte utilisateur : envoi de photos, création d'albums
* Système de follow
* Système de messagerie interne
* Panneau d'administration
* Système de tags et de notation


text:
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    //void handleFinished();
    void redrawPreview(bool force=false);

private slots:
    void on_filesList_doubleClicked(const QModelIndex &index);

    void on_actionBack_triggered();

    void on_actionComposite_triggered();

    void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);

    void composing_finished(){

    }

    void on_actionUpdateFileList_triggered();

    void on_actionClearSelection_triggered();

    void announceProgress();

    void composingFinished();

    void on_action_Save_as_triggered();

    void on_actionE_xit_triggered();

    void on_action_About_triggered();

    void slot_compositeSelected();

    void on_actionClear_2_triggered();

    void on_actionAll_triggered();

    void on_actionSelectEach_2_triggered();

    void on_actionSelectEach_5th_triggered();

    void on_actionSelectEach_10th_triggered();

    void on_actionSelectEach_25th_triggered();

    void on_actionSelectEach_50th_triggered();

    void on_actionSelectEach_100_triggered();

    void on_actionAbout_Qt_triggered();

    void on_actionWithout_preview_triggered();

    void on_actionDifference_triggered();

    void on_actionPlay_triggered();

    void on_actionPreviewEach_1s_triggered();

    void on_actionPreviewEach_5s_triggered();

    void on_actionPreviewEach_2s_triggered();

    void on_actionPreviewEach_10s_triggered();

    void on_actionPreviewEach_15s_triggered();

    void on_actionPreviewEach_30s_triggered();

    void on_actionPreviewEach_60s_triggered();

protected:
    void closeEvent(QCloseEvent *event);

private:

    void compositeSelected();

    void selectEachNRow(int n);

    void drawImage(StarTrailer::Image &image);

    Ui::MainWindow *ui;
    QFileSystemModel *model;

    QGraphicsScene* scene;
    QGraphicsPixmapItem* item;

    volatile bool stopped;
    //Magick::Image *preview_image;
    QuteImage *preview_image;
    QMutex mutex_preview_image;

    QProgressBar *progress_bar;

//    StarTrailer st;
    Magick::CompositeOperator compose_op;
    int started_threads;
    int preview_each_n_ms;
    QActionGroup* preview_each_n_group;

    QElapsedTimer benchmark_timer;

    QItemSelection selected_items;

    QVector<int> chunkSizes(const int size, const int chunkCount)
    {
        Q_ASSERT(size > 0 && chunkCount > 0);
        if (chunkCount == 1)
            return QVector<int>() << size;
        QVector<int> result(chunkCount, size / chunkCount);
        if (int remainder = size % chunkCount) {
            int index = 0;
            for (int i = 0; i < remainder; ++i) {
                ++result[index];
                ++index;
                index %= chunkCount;
            }
        }
        return result;
    }
};

#endif // MAINWINDOW_H