text:
#import "UAURLProtocol.h"
#import "UAInbox.h"
#import "UAInboxMessage.h"
#import "UAInboxMessageList.h"
#import "UAHTTPRequest.H"
#import "UAHTTPConnection.h"
#import "UAirship.h"
#import "UAConfig.h"

@interface UAURLProtocol()

@property(nonatomic, strong) UAHTTPConnection *connection;

@end

@implementation UAURLProtocol

static NSMutableOrderedSet *cachableURLs = nil;
static NSURLCache *cache = nil;

+ (BOOL)canInitWithRequest:(NSURLRequest *)request {
    // The following conditions will return NO:
    // If the request header field contains kUASkipProtocolHeader
    // If the request HTTPMethod is not 'GET'
    // If the request URL scheme is not 'http' or 'https'
    if ([request valueForHTTPHeaderField:kUASkipProtocolHeader] || ![request.HTTPMethod isEqual:@"GET"]
        || !([[[request.URL scheme] lowercaseString] isEqualToString:@"http"] ||
             [[[request.URL scheme] lowercaseString] isEqualToString:@"https"])) {
        return NO;
    }

    return [[self cachableURLs] containsObject:request.URL]
            || [[self cachableURLs] containsObject:request.mainDocumentURL];

}

+ (NSMutableOrderedSet *)cachableURLs {
    @synchronized(self) {
        if (!cachableURLs) {
            cachableURLs = [NSMutableOrderedSet orderedSet];
        }
    }

    return cachableURLs;
}

+ (NSURLCache *)cache {
    @synchronized(self) {
        if (!cache) {

            NSString *diskCachePath = nil;
            NSArray *cachePaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
            if ([cachePaths count]) {
                NSString *cacheDirectory = [cachePaths objectAtIndex:0];
                diskCachePath = [NSString stringWithFormat:@"%@/%@", cacheDirectory, @"UAURLCache"];

                [[NSFileManager defaultManager] createDirectoryAtPath:diskCachePath
                                          withIntermediateDirectories:YES
                                                           attributes:nil error:NULL];
            }

            cache = [[NSURLCache alloc] initWithMemoryCapacity:kUACacheMemorySizeInMB
                                                  diskCapacity:[UAirship shared].config.cacheDiskSizeInMB
                                                      diskPath:diskCachePath];
        }
    }

    return cache;
}

+ (void)clearCache {
    [[self cache] removeAllCachedResponses];
}

+ (void)addCachableURL:(NSURL *)url {
    [[self cachableURLs] addObject:url];
}

+ (void)removeCachableURL:(NSURL *)url {
    [[self cachableURLs] removeObject:url];
}

+ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request {
    return request;
}

- (void)startLoading {
    __weak UAURLProtocol *weakSelf = self;

    UAHTTPConnectionSuccessBlock successBlock = ^(UAHTTPRequest *request){
        UA_LTRACE(@"Received %ld for request %@.", (long)[request.response statusCode], request.url);

        // 200, cache response
        if ([request.response statusCode] == 200) {
            UA_LTRACE(@"Caching response.");
            NSCachedURLResponse *cachedResponse = [[NSCachedURLResponse alloc]initWithResponse:request.response
                                                                                data:request.responseData];
            [[UAURLProtocol cache] storeCachedResponse:cachedResponse forRequest:weakSelf.request];

            [weakSelf finishRequest:request.response responseData:request.responseData];
        } else if (![weakSelf loadFromCache]) {
            [weakSelf finishRequest:request.response responseData:request.responseData];
        }
    };

    UAHTTPConnectionFailureBlock failureBlock = ^(UAHTTPRequest *request){
        UA_LTRACE(@"Error %@ for request %@, attempting to fall back to cache.", request.error, request.url);
        if (![weakSelf loadFromCache]) {
            [weakSelf finishRequest];
        }
    };

    self.connection = [UAHTTPConnection connectionWithRequest:[self createUAHTTPRequest]
                                                 successBlock:successBlock
                                                 failureBlock:failureBlock];

    [self.connection start];
}

- (void)stopLoading {
    [self.connection cancel];
}

- (BOOL)loadFromCache {
    NSCachedURLResponse *cachedResponse = [[UAURLProtocol cache] cachedResponseForRequest:self.request];
    if (cachedResponse) {
         UA_LTRACE(@"Loading response from cache.");
        [self finishRequest:cachedResponse.response responseData:cachedResponse.data];
        return YES;
    }

    UA_LTRACE(@"No cache for response %@", self.request.URL);
    return NO;
}

- (void)finishRequest {
    [self.client URLProtocol:self didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotConnectToHost userInfo:nil]];
}

- (void)finishRequest:(NSURLResponse *)response responseData:(NSData *)data {
    // NSURLCacheStorageNotAllowed - we handle the caching ourselves.
    [self.client URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
    [self.client URLProtocol:self didLoadData:data];
    [self.client URLProtocolDidFinishLoading:self];
}

- (UAHTTPRequest *)createUAHTTPRequest {
    UAHTTPRequest *request = [UAHTTPRequest requestWithURL:self.request.URL];

    for (NSString *header in [self.request allHTTPHeaderFields]) {
        [request addRequestHeader:header value:[self.request valueForHTTPHeaderField:header]];
    }

    NSHTTPURLResponse *cachedResponse = (NSHTTPURLResponse *)[[UAURLProtocol cache] cachedResponseForRequest:self.request].response;
    if (cachedResponse) {
        NSString *cachedDate = [[cachedResponse allHeaderFields] valueForKey:@"Date"];
        [request addRequestHeader:@"If-Modified-Since" value:cachedDate];

        UA_LTRACE(@"Request %@ previously cached %@", request.url, cachedDate);
    }

    // Add a special header to tell our protocol to ignore it so a different
    // protocol will handle the request.
    [request addRequestHeader:kUASkipProtocolHeader value:@""];

    return request;
}

@end


text:
package com.griddynamics.jagger.jaas.service;

import com.griddynamics.jagger.jaas.storage.TestEnvironmentDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class TestEnvironmentExpirationService {

    private static final Logger LOGGER = LoggerFactory.getLogger(TestEnvironmentExpirationService.class);

    private TestEnvironmentDao testEnvironmentDao;

    @Autowired
    public TestEnvironmentExpirationService(TestEnvironmentDao testEnvironmentDao) {
        this.testEnvironmentDao = testEnvironmentDao;
    }

    @Scheduled(fixedRateString = "${environments.cleaning.job.periodicity.milliseconds}")
    public void deleteExpiredEnvironmentsTask() {
        int deleted = testEnvironmentDao.deleteExpired(System.currentTimeMillis());
        if (deleted > 0) {
            LOGGER.info("{} expired test environments has been deleted.", deleted);
        } else {
            LOGGER.debug("{} expired test environments has been deleted.", deleted);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
(() => {

  const $SearchInputContainer = N.$SearchInput.parentNode;
  const $ReplaceInputContainer = N.$ReplaceInput.parentNode;
  const $SwitchCaseSensitive = N.$SearchDialog.querySelector('[for="switch-search-case-sensitive_unc2741"]');

  let LastSearchRegExp;
  let Search = {};

  const funcMakeSearchRegExp = () => {
    let strRegExpFlags = 'g';
    if ( ! $SwitchCaseSensitive.classList.contains('is-checked')) {
      strRegExpFlags += 'i';
    }
    LastSearchRegExp = new RegExp(`(${N.Functions.Utils.funcEscapeStringRegexp({ strRegExp: N.$SearchInput.value })})`, strRegExpFlags);
  };

  const funcFindAll = () => {
    Search = findAndReplaceDOMText(N.DocActive.$ContentEditable, {
      find: LastSearchRegExp,

      replace: function(Portion, Match) {
        const $Searchresult = document.createElement('searchresult');
        $Searchresult.dataset.match = Match.index;
        $Searchresult.textContent = Portion.text;
        return $Searchresult;
      }
    });
  };

  const funcReplaceAll = () => {
    let strReplace = N.$ReplaceInput.value;
    if (! strReplace) {
      // findAndReplaceDOMText() doesn't accept empty value, but replace ' ' by an empty value
      strReplace = ' ';
    }

    findAndReplaceDOMText(N.DocActive.$ContentEditable, {
      find: LastSearchRegExp,
      replace: strReplace
    });
  };

  const funcFindReplaceController = (Parameter) => {
    if (N.$SearchInput.value) {
      $SearchInputContainer.classList.remove('is-invalid');

      if (Parameter.strMode === 'find-all') {
        N.Functions.Content.funcCleanSearch({ Document: N.DocActive });
        funcMakeSearchRegExp();
        funcFindAll();
        N.$SearchResultsTotal.textContent = Search.reverts.length;
      }

      else if (Parameter.strMode === 'replace-all') {
        N.Functions.Content.funcCleanSearch({ Document: N.DocActive });
        funcMakeSearchRegExp();
        funcReplaceAll();

        N.Functions.Utils.funcTriggerEvent({
          strEvent: 'input',
          $Element: N.DocActive.$ContentEditable
        });

        N.$SearchResultsTotal.textContent = '0';
      }
    }
    else {
      $SearchInputContainer.classList.add('is-invalid');
    }
  };

  N.$SearchDialog.getElementsByClassName('find-all-button')[0].addEventListener('click', () => {
    funcFindReplaceController({ strMode: 'find-all' });
  });
  N.$SearchDialog.getElementsByClassName('replace-all-button')[0].addEventListener('click', () => {
    funcFindReplaceController({ strMode: 'replace-all' });
  });

})();


text:
set -x #Print every line of commands out

export KS_INST_DIR=~/ks_inst
export KS_INST_SOURCE_DIR=~/ks-installation

if [ ! -d "$KS_INST_DIR" ]; then
   sudo mkdir $KS_INST_DIR
fi
if [ -f "$KS_INST_DIR/ks-inst.log" ]; then
   sudo rm $KS_INST_DIR/ks-inst.log
fi

sudo chown stack $KS_INST_DIR
# Set fd 1 and 2 to write the log file
exec 1> >( tools/outfilter.py -v -o "$KS_INST_DIR/ks-inst.log" ) 2>&1

#Downloading kinetic-swift source
cd ~
sudo apt-get install -y git
git clone https://github.com/swiftstack/kinetic-swift.git
export KS_SOURCE_DIR=~/kinetic-swift
cd $KS_SOURCE_DIR
git pull
git submodule update --init
read -p "Microwise: Downloaded kinetic-swift source." var

sudo apt-get update
sudo apt-get -y upgrade

sudo apt-get install -y ntp

cd $KS_INST_DIR

#Prerequisites
if [ ! -f "ez_setup.py" ]; then
    wget https://bootstrap.pypa.io/ez_setup.py
fi
sudo python ez_setup.py
if [ ! -f "get-pip.py" ]; then
    wget https://bootstrap.pypa.io/get-pip.py
fi
sudo python get-pip.py

read -p "Microwise: ez_setup and get-pip." var

sudo apt-get install -y python-dev
sudo apt-get install -y build-essential   #尽管上一步会安装gcc等安装包,但是还是需要安装build-essentials比较好
sudo apt-get install -y libffi-dev
sudo apt-get install -y protobuf-compiler
sudo apt-get install -y memcached
sudo apt-get install -y unzip
sudo apt-get install -y autoconf automake libtool
read -p "Microwise: Prerequisites." var

#Install protobuf 3.0 . 默认安装是2.5,太low了,对于新的kinetic固件不支持

#wget protobuf3.0 and gmock 1.7.0 from qslab website
cd $KS_INST_SOURCE_DIR

if [ ! -f "$KS_INST_SOURCE_DIR/protobuf.3.0.tar" ]; then
   #wget ......
fi
if [ ! -f "$KS_INST_SOURCE_DIR/gmock-1.7.0.zip" ]; then
   #wget ......
fi

cp $KS_INST_SOURCE_DIR/protobuf.3.0.tar $KS_INST_DIR
cd $KS_INST_DIR
tar -xf protobuf.3.0.tar
cp $KS_INST_SOURCE_DIR/gmock-1.7.0.zip $KS_INST_DIR/protobuf/
cd $KS_INST_DIR/protobuf/
unzip -q gmock-1.7.0.zip
mv gmock-1.7.0 gmock
./autogen.sh
./configure
make
sudo make check
sudo make install
read -p "Microwise: Installed protobuf 3.0." var

#Install kinetic-java source
#KS(kinetic-swift) need kinetic-java to communicate with kinetic devices
cd ~
export JAVA_HOME=~/jdk1.8.0_45
if [ ! -d "$JAVA_HOME" ]; then
	if [ ! -f "~/jdk-8u45-linux-x64.tar.gz" ]; then
		wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz
	fi
	tar -xf jdk-8u45-linux-x64.tar.gz
fi
read -p "Microwise: Installed jdk." var

sudo apt-get install -y maven
read -p "Microwise: Installed maven." var

cd $KS_SOURCE_DIR
cd kinetic-java
mvn clean package
read -p "Microwise: Installed kinetic-java." var

cd bin
screen -dmS kinjava ./startSimulator.sh
read -p "Microwise: a simulator is launched." var


text:
create table DDCRD_DIAGNOSE_EXECUTION_LOG (
    ID uuid,
    VERSION integer not null,
    CREATE_TS timestamp,
    CREATED_BY varchar(50),
    UPDATE_TS timestamp,
    UPDATED_BY varchar(50),
    DELETE_TS timestamp,
    DELETED_BY varchar(50),
    --
    EXECUTION_SUCCESSFUL boolean not null,
    EXECUTION_TIMESTAMP timestamp not null,
    EXECUTION_USER varchar(255),
    EXECUTION_RESULT_FILE_ID uuid,
    DIAGNOSE_TYPE varchar(255) not null,
    EXECUTION_TYPE varchar(255) not null,
    --
    primary key (ID)
)^
-- end DDCRD_DIAGNOSE_EXECUTION_LOG


text:
layout: post
title: "Astro Divine"
date: 02-02-2017
---

Website for vedic astrology resources. The site is launching soon


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

using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text;
using ImpromptuInterface.Internal.Support;
using Microsoft.CSharp;
using Microsoft.CSharp.RuntimeBinder;
using ImpromptuInterface.Optimization;
namespace ImpromptuInterface.Dynamic
{

    /// <summary>
    /// Get access to target of original proxy
    /// </summary>
    public interface IForwarder
    {
        /// <summary>
        /// Gets the target.
        /// </summary>
        /// <value>The target.</value>
        object Target { get; }
    }

    /// <summary>
    /// Proxies Calls allows subclasser to override do extra actions before or after base invocation
    /// </summary>
    /// <remarks>
    /// This may not be as efficient as other proxies that can work on just static objects or just dynamic objects...
    /// Consider this when using.
    /// </remarks>
    [Serializable]
    public abstract class ImpromptuForwarder : ImpromptuObject, IForwarder
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ImpromptuForwarder"/> class.
        /// </summary>
        /// <param name="target">The target.</param>
        protected ImpromptuForwarder(object target)
        {
            Target = target;
        }

#if !SILVERLIGHT
        /// <summary>
        /// Initializes a new instance of the <see cref="ImpromptuForwarder"/> class.
        /// </summary>
        /// <param name="info">The info.</param>
        /// <param name="context">The context.</param>
        protected ImpromptuForwarder(SerializationInfo info,
           StreamingContext context):base(info,context)
        {

            Target = info.GetValue<IDictionary<string, object>>("Target");
        }

        /// <summary>
        /// Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo"/> with the data needed to serialize the target object.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> to populate with data.</param>
        /// <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext"/>) for this serialization.</param>
        /// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info,context);
            info.AddValue("Target", Target);
        }
#endif

        /// <summary>
        /// Returns the enumeration of all dynamic member names.
        /// </summary>
        /// <returns>
        /// A sequence that contains dynamic member names.
        /// </returns>
        public override IEnumerable<string> GetDynamicMemberNames()
        {
            if (!KnownInterfaces.Any())
            {
                var tDyanmic = Impromptu.GetMemberNames(CallTarget, dynamicOnly: true);
                if (!tDyanmic.Any())
                {
                    return Impromptu.GetMemberNames(CallTarget);
                }
            }
            return base.GetDynamicMemberNames();
        }

        /// <summary>
        /// Gets or sets the target.
        /// </summary>
        /// <value>The target.</value>
        protected object Target {  get;  set; }

        object IForwarder.Target{get { return Target; }}

        /// <summary>
        /// Gets the call target.
        /// </summary>
        /// <value>The call target.</value>
        protected virtual object CallTarget
        {
            get { return Target; }
        }

        /// <summary>
        /// Provides the implementation for operations that get member values. Classes derived from the <see cref="T:System.Dynamic.DynamicObject"/> class can override this method to specify dynamic behavior for operations such as getting a value for a property.
        /// </summary>
        /// <param name="binder">Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the <see cref="T:System.Dynamic.DynamicObject"/> class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive.</param>
        /// <param name="result">The result of the get operation. For example, if the method is called for a property, you can assign the property value to <paramref name="result"/>.</param>
        /// <returns>
        /// true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.)
        /// </returns>
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            if (CallTarget == null)
            {
                result = null;
                return false;
            }

            if (Impromptu.InvokeIsEvent(CallTarget, binder.Name))
            {
                result = new ImpromptuForwarderAddRemove();
                return true;
            }

            try
            {
                result = Impromptu.InvokeGet(CallTarget, binder.Name);
            }
            catch (RuntimeBinderException)
            {
                result = null;
                return false;
            }

            return true;

        }

        /// <summary>
        /// Provides the implementation for operations that invoke an object. Classes derived from the <see cref="T:System.Dynamic.DynamicObject"/> class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate.
        /// </summary>
        /// <param name="binder">Provides information about the invoke operation.</param>
        /// <param name="args">The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the <see cref="T:System.Dynamic.DynamicObject"/> class, <paramref name="args[0]"/> is equal to 100.</param>
        /// <param name="result">The result of the object invocation.</param>
        /// <returns>
        /// true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.
        /// </returns>
        public override bool TryInvoke(InvokeBinder binder, object[] args, out object result)
        {
            if (CallTarget == null)
            {
                result = null;
                return false;
            }

            var tArgs = Util.NameArgsIfNecessary(binder.CallInfo, args);

            try
            {
                result = Impromptu.Invoke(CallTarget, tArgs);

            }
            catch (RuntimeBinderException)
            {
                result = null;
                try
                {
                    Impromptu.InvokeAction(CallTarget, tArgs);
                }
                catch (RuntimeBinderException)
                {

                    return false;
                }
            }
            return true;
        }

        public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
        {
            if (CallTarget == null)
            {
                result = null;
                return false;
            }

            object[] tArgs = Util.NameArgsIfNecessary(binder.CallInfo, args);

            try
            {
                result = Impromptu.InvokeMember(CallTarget, binder.Name, tArgs);

            }
            catch (RuntimeBinderException)
            {
                result = null;
                try
                {
                    Impromptu.InvokeMemberAction(CallTarget, binder.Name, tArgs);
                }
                catch (RuntimeBinderException)
                {

                    return false;
                }
            }
            return true;
        }

        public override bool TrySetMember(SetMemberBinder binder, object value)
        {
            if (CallTarget == null)
            {
                return false;
            }

            if (Impromptu.InvokeIsEvent(CallTarget, binder.Name) && value is ImpromptuForwarderAddRemove)
            {
                var tValue = value as ImpromptuForwarderAddRemove;

                if (tValue.IsAdding)
                {
                    Impromptu.InvokeAddAssignMember(CallTarget, binder.Name, tValue.Delegate);
                }
                else
                {
                    Impromptu.InvokeSubtractAssignMember(CallTarget, binder.Name, tValue.Delegate);
                }

                return true;
            }

            try
            {
                Impromptu.InvokeSet(CallTarget, binder.Name, value);

                return true;
            }
            catch (RuntimeBinderException)
            {
                return false;
            }
        }

        public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
        {
            if (CallTarget == null)
            {
                result = null;
                return false;
            }

            object[] tArgs = Util.NameArgsIfNecessary(binder.CallInfo, indexes);

            try
            {
                result = Impromptu.InvokeGetIndex(CallTarget, tArgs);
                return true;
            }
            catch (RuntimeBinderException)
            {
                result = null;
                return false;
            }
        }

        public override bool TrySetIndex(SetIndexBinder binder, object[] indexes, object value)
        {
            if (CallTarget == null)
            {
                return false;
            }

            var tCombinedArgs = indexes.Concat(new[] { value }).ToArray();
            object[] tArgs = Util.NameArgsIfNecessary(binder.CallInfo, tCombinedArgs);
            try
            {

                Impromptu.InvokeSetIndex(CallTarget, tArgs);
                return true;
            }
            catch (RuntimeBinderException)
            {
                return false;
            }
        }

        /// <summary>
        /// Equals the specified other.
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns></returns>
        public bool Equals(ImpromptuForwarder other)
        {
            if (ReferenceEquals(null, other)) return ReferenceEquals(null, CallTarget);
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.CallTarget, CallTarget);
        }

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

        public override int GetHashCode()
        {
            return (CallTarget != null ? CallTarget.GetHashCode() : 0);
        }
    }
}


text:
"use strict";

exports.f = Object.getOwnPropertySymbols;
//# sourceMappingURL=_object-gops.js.map


text:
namespace android.util
{
	[global::MonoJavaBridge.JavaClass()]
	public partial class TimeFormatException : java.lang.RuntimeException
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		protected TimeFormatException(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		static TimeFormatException()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.util.TimeFormatException.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/util/TimeFormatException"));
		}
	}
}


text:
let xslt = {
	/**
	* @param {string} xsl
	*/
	init: function(xsl)
	{
		xslt.proc = new XSLTProcessor;
		xslt.proc['importStylesheet'](xslt.loadXML(xsl));
	},

	/**
	* @param  {string} xml
	* @return {!Document}
	*/
	loadXML: function(xml)
	{
		const dom = (new DOMParser).parseFromString(xml, 'text/xml');
		if (!dom)
		{
			throw 'Cannot parse ' + xml;
		}

		return dom;
	},

	/**
	* @param {string} paramName  Parameter name
	* @param {string} paramValue Parameter's value
	*/
	setParameter: function(paramName, paramValue)
	{
		xslt.proc['setParameter'](null, paramName, paramValue);
	},

	/**
	* @param  {string}    xml
	* @param  {!Document} targetDoc
	* @return {!DocumentFragment}
	*/
	transformToFragment: function(xml, targetDoc)
	{
		return xslt.proc['transformToFragment'](xslt.loadXML(xml), targetDoc);
	}
};
xslt.init(xsl);

/**
* Parse a given text and render it into given HTML element
*
* @param  {string} text
* @param  {!HTMLElement} target
* @return {!Node}
*/
function preview(text, target)
{
	let targetDoc = target.ownerDocument;
	if (!targetDoc)
	{
		throw 'Target does not have a ownerDocument';
	}

	let resultFragment = xslt.transformToFragment(parse(text).replace(/<[eis]>[^<]*<\/[eis]>/g, ''), targetDoc),
		lastUpdated    = target;

	// https://bugs.chromium.org/p/chromium/issues/detail?id=266305
	if (typeof window !== 'undefined' && 'chrome' in window)
	{
		resultFragment.querySelectorAll('script').forEach(
			function (oldScript)
			{
				let newScript = document.createElement('script');
				for (let attribute of oldScript['attributes'])
				{
					newScript['setAttribute'](attribute.name, attribute.value);
				}
				newScript.textContent = oldScript.textContent;

				oldScript.parentNode.replaceChild(newScript, oldScript);
			}
		);
	}

	// Compute and refresh hashes
	if (HINT.hash)
	{
		computeHashes(resultFragment);
	}

	// Apply post-processing
	if (HINT.onRender)
	{
		executeEvents(resultFragment, 'render');
	}

	/**
	* Compute and set all hashes in given document fragment
	*
	* @param {!DocumentFragment} fragment
	*/
	function computeHashes(fragment)
	{
		let nodes = fragment.querySelectorAll('[data-s9e-livepreview-hash]'),
			i     = nodes.length;
		while (--i >= 0)
		{
			nodes[i]['setAttribute']('data-s9e-livepreview-hash', hash(nodes[i].outerHTML));
		}
	}

	/**
	* Execute an event's code on a given node
	*
	* @param {!Element} node
	* @param {string}   eventName
	*/
	function executeEvent(node, eventName)
	{
		let code     = node.getAttribute('data-s9e-livepreview-on' + eventName),
			codeHash = hash(code);
		if (!functionCache[codeHash])
		{
			functionCache[codeHash] = new Function(code);
		}

		functionCache[codeHash]['call'](node);
	}

	/**
	* Locate and execute an event on given document fragment or element
	*
	* @param {!DocumentFragment|!Element} root
	* @param {string}                     eventName
	*/
	function executeEvents(root, eventName)
	{
		// Execute the event on the root node, as there is no self-or-descendant selector in CSS
		if (root instanceof Element && root['hasAttribute']('data-s9e-livepreview-on' + eventName))
		{
			executeEvent(root, eventName);
		}

		let nodes = root.querySelectorAll('[data-s9e-livepreview-on' + eventName + ']'),
			i     = nodes.length;
		while (--i >= 0)
		{
			executeEvent(nodes[i], eventName);
		}
	}

	/**
	* Update the content of given node oldParent to match node newParent
	*
	* @param {!Node} oldParent
	* @param {!Node} newParent
	*/
	function refreshElementContent(oldParent, newParent)
	{
		let oldNodes = oldParent.childNodes,
			newNodes = newParent.childNodes,
			oldCnt   = oldNodes.length,
			newCnt   = newNodes.length,
			oldNode,
			newNode,
			left     = 0,
			right    = 0;

		// Skip the leftmost matching nodes
		while (left < oldCnt && left < newCnt)
		{
			oldNode = oldNodes[left];
			newNode = newNodes[left];
			if (!refreshNode(oldNode, newNode))
			{
				break;
			}

			++left;
		}

		// Skip the rightmost matching nodes
		let maxRight = Math.min(oldCnt - left, newCnt - left);
		while (right < maxRight)
		{
			oldNode = oldNodes[oldCnt - (right + 1)];
			newNode = newNodes[newCnt - (right + 1)];
			if (!refreshNode(oldNode, newNode))
			{
				break;
			}

			++right;
		}

		// Remove the old dirty nodes in the middle of the tree
		let i = oldCnt - right;
		while (--i >= left)
		{
			oldParent.removeChild(oldNodes[i]);
			lastUpdated = oldParent;
		}

		// Test whether there are any nodes in the new tree between the matching nodes at the left
		// and the matching nodes at the right
		let rightBoundary = newCnt - right;
		if (left >= rightBoundary)
		{
			return;
		}

		// Clone the new nodes
		let newNodesFragment = targetDoc.createDocumentFragment();
		i = left;
		do
		{
			newNode = newNodes[i];
			if (HINT.onUpdate && newNode instanceof Element)
			{
				executeEvents(newNode, 'update');
			}
			lastUpdated = newNodesFragment.appendChild(newNode);
		}
		while (i < --rightBoundary);

		// If we haven't skipped any nodes to the right, we can just append the fragment
		if (!right)
		{
			oldParent.appendChild(newNodesFragment);
		}
		else
		{
			oldParent.insertBefore(newNodesFragment, oldParent.childNodes[left]);
		}
	}

	/**
	* Update given node oldNode to make it match newNode
	*
	* @param {!Node} oldNode
	* @param {!Node} newNode
	* @return {boolean} Whether the node can be skipped
	*/
	function refreshNode(oldNode, newNode)
	{
		if (oldNode.nodeName !== newNode.nodeName || oldNode.nodeType !== newNode.nodeType)
		{
			return false;
		}

		if (oldNode instanceof HTMLElement && newNode instanceof HTMLElement)
		{
			if (!oldNode.isEqualNode(newNode) && !elementHashesMatch(oldNode, newNode))
			{
				if (HINT.onUpdate && newNode['hasAttribute']('data-s9e-livepreview-onupdate'))
				{
					executeEvent(newNode, 'update');
				}
				syncElementAttributes(oldNode, newNode);
				refreshElementContent(oldNode, newNode);
			}
		}
		// Node.TEXT_NODE || Node.COMMENT_NODE
		else if (oldNode.nodeType === 3 || oldNode.nodeType === 8)
		{
			if (oldNode.nodeValue !== newNode.nodeValue)
			{
				oldNode.nodeValue = newNode.nodeValue;
				lastUpdated = oldNode;
			}
		}

		return true;
	}

	/**
	* Test whether both given elements have a hash value and both match
	*
	* @param  {!HTMLElement} oldEl
	* @param  {!HTMLElement} newEl
	* @return {boolean}
	*/
	function elementHashesMatch(oldEl, newEl)
	{
		if (!HINT.hash)
		{
			// Hashes can never match if there are no hashes in any template
			return false;
		}
		const attrName = 'data-s9e-livepreview-hash';

		return oldEl['hasAttribute'](attrName) && newEl['hasAttribute'](attrName) && oldEl['getAttribute'](attrName) === newEl['getAttribute'](attrName);
	}

	/**
	* Hash given string
	*
	* @param  {string} text
	* @return {number}
	*/
	function hash(text)
	{
		let pos = text.length, s1 = 0, s2 = 0;
		while (--pos >= 0)
		{
			s1 = (s1 + text.charCodeAt(pos)) % 0xFFFF;
			s2 = (s1 + s2) % 0xFFFF;
		}

		return (s2 << 16) | s1;
	}

	/**
	* Make the set of attributes of given element oldEl match newEl's
	*
	* @param {!HTMLElement} oldEl
	* @param {!HTMLElement} newEl
	*/
	function syncElementAttributes(oldEl, newEl)
	{
		let oldAttributes = oldEl['attributes'],
			newAttributes = newEl['attributes'],
			oldCnt        = oldAttributes.length,
			newCnt        = newAttributes.length,
			i             = oldCnt,
			ignoreAttrs   = ' ' + oldEl.getAttribute('data-s9e-livepreview-ignore-attrs') + ' ';

		while (--i >= 0)
		{
			let oldAttr      = oldAttributes[i],
				namespaceURI = oldAttr['namespaceURI'],
				attrName     = oldAttr['name'];

			if (HINT.ignoreAttrs && ignoreAttrs.indexOf(' ' + attrName + ' ') > -1)
			{
				continue;
			}
			if (!newEl.hasAttributeNS(namespaceURI, attrName))
			{
				oldEl.removeAttributeNS(namespaceURI, attrName);
				lastUpdated = oldEl;
			}
		}

		i = newCnt;
		while (--i >= 0)
		{
			let newAttr      = newAttributes[i],
				namespaceURI = newAttr['namespaceURI'],
				attrName     = newAttr['name'],
				attrValue    = newAttr['value'];

			if (HINT.ignoreAttrs && ignoreAttrs.indexOf(' ' + attrName + ' ') > -1)
			{
				continue;
			}
			if (attrValue !== oldEl.getAttributeNS(namespaceURI, attrName))
			{
				oldEl.setAttributeNS(namespaceURI, attrName, attrValue);
				lastUpdated = oldEl;
			}
		}
	}

	refreshElementContent(target, resultFragment);

	return lastUpdated;
}

/**
* Set the value of a stylesheet parameter
*
* @param {string} paramName  Parameter name
* @param {string} paramValue Parameter's value
*/
function setParameter(paramName, paramValue)
{
	xslt.setParameter(paramName, paramValue);
}


text:
@interface ASPOSEPDocumentData : JSONModel

@property(nonatomic, strong) ASPOSEPHrefToDocumentArray<Optional> *DocumentProperties;
@property(nonatomic, strong) ASPOSEPHrefToDocumentArray<Optional> *Pages;
@property(nonatomic, strong) NSArray<ASPOSEHrefToDocument, Optional> *Links;

@end


text:
import logging

# modules are only imported once -- make sure that we don't have > 1
# because subsequent tunnels will block waiting to acquire the port

server = None

def get_or_create_tunnel(host, port, user, remote_host, remote_port, timeout):
    pass


text:
//-----------------------------------------------------------------------
// <copyright file="EnumHelper.cs" company="None">
// Copyright (c) IIHOSHI Yoshinori.
// Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information.
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Globalization;
using ThScoreFileConverter.Core.Extensions;

namespace ThScoreFileConverter.Core.Helpers;

/// <summary>
/// Provides helper functions for enum.
/// </summary>
public static class EnumHelper
{
    /// <summary>
    /// Converts the string representation of the name or numeric value of one or more enumerated
    /// constants to an equivalent enumerated instance.
    /// </summary>
    /// <typeparam name="TEnum">The enumeration type.</typeparam>
    /// <param name="value">A string containing the name or value to convert.</param>
    /// <returns>
    /// An instance of <typeparamref name="TEnum"/> whose value is represented by
    /// <paramref name="value"/>.
    /// </returns>
    [CLSCompliant(false)]
    public static TEnum Parse<TEnum>(string value)
        where TEnum : struct, Enum
    {
        return Parse<TEnum>(value, false);
    }

    /// <summary>
    /// Converts the string representation of the name or numeric value of one or more enumerated
    /// constants to an equivalent enumerated instance.
    /// </summary>
    /// <typeparam name="TEnum">The enumeration type.</typeparam>
    /// <param name="value">A string containing the name or value to convert.</param>
    /// <param name="ignoreCase"><c>true</c> if ignore case; <c>false</c> to regard case.</param>
    /// <returns>
    /// An instance of <typeparamref name="TEnum"/> whose value is represented by
    /// <paramref name="value"/>.
    /// </returns>
    [CLSCompliant(false)]
    public static TEnum Parse<TEnum>(string value, bool ignoreCase)
        where TEnum : struct, Enum
    {
        return (TEnum)Enum.Parse(typeof(TEnum), value, ignoreCase);
    }

    /// <summary>
    /// Converts a given integral value to an equivalent enumerated instance.
    /// </summary>
    /// <typeparam name="TEnum">The enumeration type.</typeparam>
    /// <param name="value">An integral value to convert.</param>
    /// <returns>
    /// An instance of <typeparamref name="TEnum"/> whose value is represented by
    /// <paramref name="value"/>.
    /// </returns>
    /// <exception cref="InvalidCastException">No enumerator equal to <paramref name="value"/> exists.</exception>
    [CLSCompliant(false)]
    public static TEnum To<TEnum>(object value)
        where TEnum : struct, Enum
    {
        var underlying = Convert.ChangeType(
            value, typeof(TEnum).GetEnumUnderlyingType(), CultureInfo.InvariantCulture);
        return Enum.IsDefined(typeof(TEnum), underlying) ? (TEnum)underlying : throw new InvalidCastException();
    }

    /// <summary>
    /// Creates the Cartesian product of two enums.
    /// </summary>
    /// <typeparam name="T1">The enum type of the first sequence.</typeparam>
    /// <typeparam name="T2">The enum type of the second sequence.</typeparam>
    /// <returns>The Cartesian product of <typeparamref name="T1"/> and <typeparamref name="T2"/>.</returns>
    public static IEnumerable<(T1 First, T2 Second)> Cartesian<T1, T2>()
        where T1 : struct, Enum
        where T2 : struct, Enum
    {
        return EnumHelper<T1>.Enumerable.Cartesian(EnumHelper<T2>.Enumerable);
    }
}


text:
require 'mv/core/constraint/description'

module Mv
  module Core
    module Route
      class Base
        attr_reader :validation

        def initialize(validation)
          @validation = validation
        end

        def route
          [Mv::Core::Constraint::Description.new(validation.index_name, :index)]
        end

        protected

        def description(name, type, opts = {})
          Mv::Core::Constraint::Description.new(name, type, opts)
        end
      end
    end
  end
end


text:
package trasmapi.genAPI.mas;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Mas {
	private int nextAgent = 0;
	private List<Agent> agents;
	private List<Thread> threads;

	private int timestep = 0;

	ArrayList<LinkedList<Message>> messages;

	public Mas() {
		agents = new ArrayList<Agent>();
		threads = new ArrayList<Thread>();
		messages = new ArrayList<LinkedList<Message>>();
	}

	/**
	 * Adds a new agent to the simulation
	 * @param newAgent the agent to be added
	 */
	public void addAgent(Agent newAgent) {
		newAgent.reportTo(this);
		newAgent.setId(nextAgent++);
		threads.add(new Thread(newAgent));
		agents.add(newAgent);
		messages.add(new LinkedList<Message>());
	}

	/**
	 * Starts the Multi-Agent system.
	 * Agents are run individually and its init() method is called
	 */
	public void start() {
		for (Thread a : threads)
			a.start();
	}

	/**
	 * Returns the number of active agents in the Multi-Agent System
	 * @return the number of active agents
	 */
	public int getNumAgents() {
		return agents.size();
	}

	/**
	 * Returns an array of ids identifying the active agents in the Multi-Agent System
	 * @return an array of ids identifying the active agents
	 */
	public int[] getAgents() {
		int[] v = new int[agents.size()];
		for (int i = 0; i<agents.size(); i++) {
			v[i] = agents.get(i).getId();
		}
		return v;
	}

	/**
	 * Closes the Multi-Agent System, killing every agent.
	 * Please note that agents must save important information before this method is called.
	 */
	@SuppressWarnings("deprecation")
	public void close() {
		for (Thread a : threads)
			a.stop(); // stop is deprecated, but the reason isn't real issue in your case
	}

	/**
	 * Returns the current time step
	 * @return the current time step
	 */
	public int getTimeStep() {
		return timestep;
	}

	/**
	 * advances N time steps in the simulation
	 * @param k the number of timesteps
	 */
	public void step(int k) {
		for (int ss = 0; ss < k; ss++) {
			timestep++;
			for (int i = 0; i<threads.size(); i++) {
				agents.get(i).setReady(false);
				threads.get(i).interrupt();
			}

			/*
			 * could be made faster by checking the last agent that was not ready
			 * instead of starting from the beginning
			 */
			boolean someoneNotReady;
			do {
				someoneNotReady = false;
				sendMessages();
				for (int i = 0; i<agents.size(); i++)
					if (!agents.get(i).isReady() && threads.get(i).isAlive()) {
						someoneNotReady = true;
						break;
					}
				if (someoneNotReady)
					try {
						Thread.sleep(10);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}

			} while (someoneNotReady && !areThereNewMessages());
		}
	}

	synchronized void broadcast(Message message, int id) {
		for (int i = 0; i<agents.size(); i++) {
			if (agents.get(i).getId() != id) {
				message.to = agents.get(i).getId();
				send(message);
			}
		}
	}

	synchronized void send(Message m) {
		messages.get(m.to).add(m);
	}

	synchronized private void sendMessages() {
		for (int i = 0; i<agents.size(); i++) {
			if (!messages.get(i).isEmpty()) {
				for (Message m : messages.get(i)) {
					agents.get(i).deliverMessage(m);
				}
				messages.get(i).clear();
				threads.get(i).interrupt();
			}
		}
	}

	synchronized private boolean areThereNewMessages() {
		for (LinkedList<Message> v : messages) {
			if (!v.isEmpty())
				return true;
		}
		return false;
	}
}


text:
require File.expand_path('../boot', __FILE__)

require 'rails/all'

Bundler.require(:default, Rails.env)

module EarthdataSearchClient
  class Application < Rails::Application
    #Tilt::CoffeeScriptTemplate.default_bare = true

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Custom directories with classes and modules you want to be autoloadable.
    config.autoload_paths += Dir["#{config.root}/lib", "#{config.root}/lib/**/"]
    config.eager_load_paths += Dir["#{config.root}/lib", "#{config.root}/lib/**/"]

    config.autoload_paths += Dir["#{config.root}/app/services", "#{config.root}/app/services/**/"]
    config.eager_load_paths += Dir["#{config.root}/app/services", "#{config.root}/app/services/**/"]

    # Only load the plugins named here, in the order given (default is alphabetical).
    # :all can be used as a placeholder for all plugins not explicitly named.
    # config.plugins = [ :exception_notification, :ssl_requirement, :all ]

    # Activate observers that should always be running.
    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :en
    config.i18n.enforce_available_locales = false

    # Configure the default encoding used in templates for Ruby 1.9.
    config.encoding = "utf-8"

    # Configure sensitive parameters which will be filtered from the log file.
    config.filter_parameters += [:password]

    # Enable escaping HTML in JSON.
    config.active_support.escape_html_entities_in_json = true

    # Use SQL instead of Active Record's schema dumper when creating the database.
    # This is necessary if your schema can't be completely dumped by the schema dumper,
    # like if you have constraints or database-specific column types
    # config.active_record.schema_format = :sql

    # Enable the asset pipeline
    config.assets.enabled = true

    # Precompile application.js, application.css, and any file that's not
    config.assets.precompile += ['application.js', 'application.css', 'splash.css']
    config.assets.precompile << Proc.new do |path|
      !%w(.js .css).include?(File.extname(path))
    end

    config.log_tags = [:uuid]

    # Version of your assets, change this if you want to expire all your assets
    config.assets.version = '1.0'

    # Add FontAwesome to the asset pipeline
    config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
    config.assets.precompile += %w(.svg .eot .woff .ttf)
    config.assets.initialize_on_precompile = false

    config.gather_metrics = false

    config.generators do |g|
      # Avoid generating assets for new controllers.  They encourage bad practices.
      g.assets false
    end

    def self.load_version
      version_file = "#{config.root}/version.txt"
      if File.exist?(version_file)
        return IO.read(version_file)
      elsif File.exist?('.git/config') && `which git`.size > 0
        version = `git rev-parse --short HEAD`
        return version
      end
      "(unknown)"
    end

    config.version = load_version
    config.feedback_url = nil

    config.services = YAML.load_file(Rails.root.join('config/services.yml'))
    config.gibs = JSON.parse(IO.read(Rails.root.join('config/gibs.json')))
    config.echo_env = 'ops'
  end
end


text:
module GitCompound
  shared_examples 'local changes guard worker' do
    let(:destination) { component.path }

    context 'repository is clean' do
      it 'should not raise error if repository is clean' do
        expect { subject.call }.to_not raise_error
      end
    end

    context 'repository has uncommited changes' do
      before do
        Dir.chdir(destination) do
          File.open('.gitcompound', 'w') { |f| f.puts 'tracked file editted' }
        end
      end

      it 'should raise error if local changes are detected' do
        expect { subject.call }.to raise_error(Exception,
                                               /contains uncommited changes/)
      end
    end

    context 'repository has untracked files' do
      it 'should raise error if untracked file is detected' do
        Dir.chdir(destination) do
          File.open('untracked_file_1', 'w') { |f| f.puts 'added untracked file' }
          Dir.mkdir('untracked_dir')
          File.open('untracked_dir/untracked_file_2', 'w') { |f| f.puts 'untracked' }
        end

        expect { subject.call }.to raise_error(Exception,
                                               /contains untracked files/)
      end

      it 'should not raise error if untracked files belong to locked components' do
        %w(untracked_component_1 untracked_component_2).each do |dst|
          component_dir = component.origin
          destination_dir = "#{destination}/#{dst}"
          tmp_component = Component.new(:tmp) do
            branch 'master'
            source component_dir
            destination destination_dir
          end
          lock.lock_component(tmp_component)
          tmp_component.build!
        end
        lock.write

        expect { subject.call }.to_not raise_error
      end
    end
  end
end


text:
"""
>>> from django.test import Client
>>> from basic.bookmarks.models import Bookmark

>>> client = Client()

>>> response = client.get('/bookmarks/')
>>> response.status_code
200

>>> bookmark = Bookmark(url='http://www.djangobook.com', description='Django book', extended='Great resource!')
>>> bookmark.save()
>>> response = client.get(bookmark.get_absolute_url())
>>> response.status_code
200
"""


text:
#include <str.h>
#include <value.h>

#include <buffer.h>

#include <basic.h>
#include <crypto.h>
#include <stdio.h>
#include <string.h> /* strcmp */
#include <type_bn.h>
#include <type_buf.h>
#include <type_cmp.h>
#include <type_crypto.h>
#include <type_file.h>
#include <type_hex.h>
#include <type_istr.h>
#include <type_lib.h>
#include <type_limit.h>
#include <type_math.h>
#include <type_num.h>
#include <type_output.h>
#include <type_parse.h>
#include <type_rand.h>
#include <type_run.h>
#include <type_signal.h>
#include <type_standard.h>
#include <type_str.h>
#include <type_stream.h>
#include <type_sym.h>
#include <type_time.h>
#include <type_tuple.h>
#include <type_var.h>
#include <type_with.h>

static const char *cur_name;

static int match(const char *other)
	{
	return strcmp(cur_name,other) == 0;
	}

/* Resolve standard names. */
static value standard(const char *name)
	{
	cur_name = name;

	if (match("put")) return hold(Qput);
	if (match("nl")) return hold(Qnl);
	if (match("say")) return Q(type_say);
	if (match("fput")) return hold(Qfput);
	if (match("fnl")) return hold(Qfnl);
	if (match("fsay")) return Q(type_fsay);
	if (match("fflush")) return Q(type_fflush);

	if (match("+")) return Q(type_add);
	if (match("-")) return Q(type_sub);
	if (match("*")) return Q(type_mul);
	if (match("/")) return Q(type_div);
	if (match("^")) return Q(type_pow);
	if (match("xor")) return Q(type_xor);
	if (match("round")) return Q(type_round);
	if (match("ceil")) return Q(type_ceil);
	if (match("trunc")) return Q(type_trunc);
	if (match("abs")) return Q(type_abs);
	if (match("sqrt")) return Q(type_sqrt);
	if (match("exp")) return Q(type_exp);
	if (match("log")) return Q(type_log);
	if (match("sin")) return Q(type_sin);
	if (match("cos")) return Q(type_cos);
	if (match("pi")) return Qnum(num_pi);

	if (match("lt")) return Q(type_lt);
	if (match("le")) return Q(type_le);
	if (match("eq")) return Q(type_eq);
	if (match("ne")) return Q(type_ne);
	if (match("ge")) return Q(type_ge);
	if (match("gt")) return Q(type_gt);

	if (match("I")) return hold(QI);
	if (match("T")) return hold(QT);
	if (match("F")) return hold(QF);
	if (match("@")) return hold(QY);
	if (match("void")) return hold(Qvoid);
	if (match("cons")) return hold(Qcons);
	if (match("null")) return hold(Qnull);
	if (match("eval")) return hold(Qeval);
	if (match("yield")) return hold(Qyield);

	if (match("is_defined")) return Q(type_is_defined);
	if (match("is_undef")) return Q(type_is_undef);
	if (match("is_void")) return Q(type_is_void);
	if (match("is_good")) return Q(type_is_good);
	if (match("is_bool")) return Q(type_is_bool);
	if (match("is_list")) return Q(type_is_list);

	if (match(".")) return Q(type_concat);
	if (match("length")) return Q(type_length);
	if (match("slice")) return Q(type_slice);
	if (match("search")) return Q(type_search);
	if (match("str_num")) return Q(type_str_num);
	if (match("ord")) return Q(type_ord);
	if (match("chr")) return Q(type_chr);
	if (match("char_width")) return Q(type_char_width);
	if (match("dirname")) return Q(type_dirname);
	if (match("basename")) return Q(type_basename);
	if (match("length_common")) return Q(type_length_common);
	if (match("is_str")) return Q(type_is_str);
	if (match("with")) return Q(type_with);
	if (match("is_obj")) return Q(type_is_obj);
	if (match("split_obj")) return Q(type_split_obj);
	if (match("fetch")) return Q(type_fetch);

	if (match("num_str")) return Q(type_num_str);
	if (match("is_num")) return Q(type_is_num);

	if (match("is_tuple")) return Q(type_is_tuple);
	if (match("tuple_to_list")) return Q(type_tuple_to_list);
	if (match("list_to_tuple")) return Q(type_list_to_tuple);

	if (match("stdin")) return hold(Qstdin);
	if (match("stdout")) return hold(Qstdout);
	if (match("stderr")) return hold(Qstderr);
	if (match("fopen")) return Q(type_fopen);
	if (match("fclose")) return Q(type_fclose);
	if (match("fgetc")) return Q(type_fgetc);
	if (match("fget")) return Q(type_fget);
	if (match("clearerr")) return Q(type_clearerr);
	if (match("feof")) return Q(type_feof);
	if (match("flook")) return Q(type_flook);
	if (match("remove")) return Q(type_remove);
	if (match("is_newer")) return Q(type_is_newer);
	if (match("is_file")) return Q(type_is_file);
	if (match("is_dir")) return Q(type_is_dir);
	if (match("flock_ex")) return Q(type_flock_ex);
	if (match("flock_sh")) return Q(type_flock_sh);
	if (match("flock_un")) return Q(type_flock_un);
	if (match("readlink")) return Q(type_readlink);
	if (match("mkdir")) return Q(type_mkdir);
	if (match("rmdir")) return Q(type_rmdir);
	if (match("ftruncate")) return Q(type_ftruncate);
	if (match("fseek_set")) return Q(type_fseek_set);
	if (match("fseek_cur")) return Q(type_fseek_cur);
	if (match("fseek_end")) return Q(type_fseek_end);
	if (match("ftell")) return Q(type_ftell);
	if (match("fileno")) return Q(type_fileno);
	if (match("fread")) return Q(type_fread);
	if (match("mkfile")) return Q(type_mkfile);
	if (match("dir_names")) return Q(type_dir_names);
	if (match("mod_time")) return Q(type_mod_time);
	if (match("file_size")) return Q(type_file_size);
	if (match("symlink")) return Q(type_symlink);
	if (match("rename")) return Q(type_rename);

	/* stream */
	if (match("at_eof")) return Q(type_at_eof);
	if (match("at_white")) return Q(type_at_white);
	if (match("skip_white")) return Q(type_skip_white);
	if (match("at_eol")) return Q(type_at_eol);
	if (match("at_ch")) return Q(type_at_ch);
	if (match("look")) return Q(type_look);
	if (match("skip")) return Q(type_skip);
	if (match("line")) return Q(type_line);
	if (match("buf_keep")) return Q(type_buf_keep);
	if (match("collect_to_ch")) return Q(type_collect_to_ch);
	if (match("collect_tilde_string")) return Q(type_collect_tilde_string);
	if (match("read_stream")) return Q(type_read_stream);

	if (match("time")) return Q(type_time);
	if (match("localtime")) return Q(type_localtime);
	if (match("gmtime")) return Q(type_gmtime);
	if (match("timelocal")) return Q(type_timelocal);
	if (match("timegm")) return Q(type_timegm);
	if (match("microtime")) return Q(type_microtime);

	if (match("die")) return Q(type_die);
	if (match("argv")) return Q(type_argv);
	if (match("sleep")) return Q(type_sleep);
	if (match("usleep")) return Q(type_usleep);
	if (match("run_process")) return Q(type_run_process);
	if (match("spawn")) return Q(type_spawn);
	if (match("exec")) return Q(type_exec);
	if (match("fexl_benchmark")) return Q(type_fexl_benchmark);

	if (match("seed_rand")) return Q(type_seed_rand);
	if (match("rand")) return Q(type_rand);

	if (match("parse")) return Q(type_parse);
	if (match("use_file")) return Q(type_use_file);

	if (match("is_closed")) return Q(type_is_closed);
	if (match("def")) return Q(type_def);
	if (match("std")) return Q(type_std);
	if (match("value")) return Q(type_value);
	if (match("resolve")) return Q(type_resolve);

	if (match("buf_new")) return Q(type_buf_new);
	if (match("buf_put")) return Q(type_buf_put);
	if (match("buf_get")) return Q(type_buf_get);

	if (match("readstr")) return Q(type_readstr);
	if (match("sgetc")) return Q(type_sgetc);
	if (match("sget")) return Q(type_sget);
	if (match("slook")) return Q(type_slook);

	if (match("var_new")) return Q(type_var_new);
	if (match("var_get")) return Q(type_var_get);
	if (match("var_put")) return Q(type_var_put);
	if (match("is_var")) return Q(type_is_var);

	if (match("limit_time")) return Q(type_limit_time);
	if (match("limit_memory")) return Q(type_limit_memory);
	if (match("limit_stack")) return Q(type_limit_stack);

	if (match("unpack")) return Q(type_unpack);
	if (match("pack")) return Q(type_pack);

	/* crypto functions */
	if (match("random_bytes")) return Q(type_random_bytes);
	if (match("random_nonce")) return Q(type_random_nonce);
	if (match("random_secret_key")) return Q(type_random_secret_key);
	if (match("nacl_box_public")) return Q(type_nacl_box_public);
	if (match("nacl_box_prepare")) return Q(type_nacl_box_prepare);
	if (match("nacl_box_seal")) return Q(type_nacl_box_seal);
	if (match("nacl_box_open")) return Q(type_nacl_box_open);
	if (match("nacl_sign_public")) return Q(type_nacl_sign_public);
	if (match("nacl_sign_seal")) return Q(type_nacl_sign_seal);
	if (match("nacl_sign_open")) return Q(type_nacl_sign_open);
	if (match("sha256")) return Q(type_sha256);
	if (match("sha512")) return Q(type_sha512);
	if (match("pack64")) return Q(type_pack64);
	if (match("unpack64")) return Q(type_unpack64);
	if (match("hmac_sha512")) return Q(type_hmac_sha512);
	if (match("hmac_sha256")) return Q(type_hmac_sha256);

	/* big numbers */
	if (match("bn_eq0")) return Q(type_bn_eq0);
	if (match("bn_is_neg")) return Q(type_bn_is_neg);
	if (match("bn_neg")) return Q(type_bn_neg);
	if (match("bn_cmp")) return Q(type_bn_cmp);
	if (match("bn_lt")) return Q(type_bn_lt);
	if (match("bn_le")) return Q(type_bn_le);
	if (match("bn_eq")) return Q(type_bn_eq);
	if (match("bn_ne")) return Q(type_bn_ne);
	if (match("bn_ge")) return Q(type_bn_ge);
	if (match("bn_gt")) return Q(type_bn_gt);
	if (match("bn_from_dec")) return Q(type_bn_from_dec);
	if (match("bn_to_dec")) return Q(type_bn_to_dec);
	if (match("bn_add")) return Q(type_bn_add);
	if (match("bn_sub")) return Q(type_bn_sub);
	if (match("bn_mul")) return Q(type_bn_mul);
	if (match("bn_mod")) return Q(type_bn_mod);
	if (match("bn_div")) return Q(type_bn_div);
	if (match("is_bn")) return Q(type_is_bn);

	if (match("set_alarm")) return Q(type_set_alarm);
	if (match("start_server")) return Q(type_start_server);
	if (match("kill")) return Q(type_kill);
	if (match("connect")) return Q(type_connect);
	if (match("receive_keystrokes")) return Q(type_receive_keystrokes);

	/* dynamic libraries */
	if (match("dlopen")) return Q(type_dlopen);
	if (match("dlsym")) return Q(type_dlsym);

	return 0;
	}

value type_std(value f)
	{
	return op_resolve(f,standard);
	}

static void beg_const(void)
	{
	/* basic */
	QI = Q(type_I);
	QT = Q(type_T);
	QF = Q(type_F);
	QY = Q(type_Y);
	Qvoid = Q(type_void);
	Qlist = Q(type_list);
	Qcons = Q(type_cons);
	Qnull = Q(type_null);
	Qeval = Q(type_eval);
	Qonce = Q(type_once);
	Qyield = Q(type_yield);

	/* type_sym */
	Qsubst = Q(type_subst);

	/* type_file */
	Qstdin = Qfile(stdin);
	Qstdout = Qfile(stdout);
	Qstderr = Qfile(stderr);

	/* type_output */
	Qput = Q(type_put);
	Qnl = Q(type_nl);
	Qfput = Q(type_fput);
	Qfnl = Q(type_fnl);

	/* type_tuple */
	Qtuple = Q(type_tuple);

	/* type_signal */
	init_signal();
	}

static void end_const(void)
	{
	/* basic */
	drop(QI);
	drop(QT);
	drop(QF);
	drop(QY);
	drop(Qvoid);
	drop(Qlist);
	drop(Qcons);
	drop(Qnull);
	drop(Qeval);
	drop(Qonce);
	drop(Qyield);

	/* type_sym */
	drop(Qsubst);

	/* type_file */
	drop(Qstdin);
	drop(Qstdout);
	drop(Qstderr);

	/* type_output */
	drop(Qput);
	drop(Qnl);
	drop(Qfput);
	drop(Qfnl);

	/* type_tuple */
	drop(Qtuple);

	close_random();
	}

/*
Evaluate the user's script.  Read the script from the file named by argv[1] if
present, or from stdin otherwise.

If this program is running as "fexl0", it runs your script directly.  If it is
running as "fexl", it first runs the local script "src/main.fxl", which then
runs your script within an extended library context.

The purpose of "fexl0" is to give you the option of bypassing src/main.fxl
altogether, defining any extensions beyond the built-in C standard context as
you please.

In a future release I will make fexl0 the default behavior, so it always reads
your script directly without loading any default library.  Predefined libraries
such as the current main.fxl will be provided in the lib directory so you can
pull them in with a one-liner.

I am making this change because the one-size-fits-all approach to a standard
library is a losing proposition.  Eventually I might even factor out the
currently built-in C functions into independent libraries loaded on demand.
Then you could build an entirely separate C library, put it in your own
directory somewhere, and load it from within Fexl.  That would even give you
the power to generate binary code on the fly and run it immediately.
*/
static void eval_script(void)
	{
	value f;
	unsigned long len = strlen(main_argv[0]);
	if (len >= 5 && strcmp(main_argv[0]+len-5,"fexl0") == 0)
		{
		/* Running as fexl0, so run the user's script directly. */
		const char *name = main_argc > 1 ? main_argv[1] : "";
		f = Qstr0(name);
		}
	else
		{
		/* Get the name of the currently running executable. */
		f = Qstr0(main_argv[0]);
		/* Go two directories up, right above the bin directory. */
		f = AV(Q(type_dirname),f);
		f = AV(Q(type_dirname),f);
		/* Concatenate the name of the main script. */
		f = AV(AV(Q(type_concat),f),Qstr0("/src/main.fxl"));
		}

	/* Now evaluate the script. */
	f = AV(Q(type_use_file),f);
	f = AV(Q(type_std),f);
	f = AV(Q(type_value),f);
	f = eval(f);
	drop(f);
	}

void eval_standard(int argc, const char *argv[])
	{
	main_argc = argc;
	main_argv = argv;
	beg_const();
	eval_script();
	end_const();
	end_value();
	}


text:
package info.hossainkhan.dailynewsheadlines;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
<?php

namespace Magento\Catalog\Api;

use Magento\Eav\Api\Data\AttributeOptionInterface;
use Magento\Eav\Api\Data\AttributeOptionLabelInterface;
use Magento\TestFramework\TestCase\WebapiAbstract;

class ProductAttributeOptionManagementInterfaceTest extends WebapiAbstract
{
    const SERVICE_NAME = 'catalogProductAttributeOptionManagementV1';
    const SERVICE_VERSION = 'V1';
    const RESOURCE_PATH = '/V1/products/attributes';

    public function testGetItems()
    {
        $this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
        $testAttributeCode = 'quantity_and_stock_status';
        $expectedOptions = [
            [
                AttributeOptionInterface::VALUE => '1',
                AttributeOptionInterface::LABEL => 'In Stock',
            ],
            [
                AttributeOptionInterface::VALUE => '0',
                AttributeOptionInterface::LABEL => 'Out of Stock',
            ],
        ];

        $serviceInfo = [
            'rest' => [
                'resourcePath' => self::RESOURCE_PATH . '/' . $testAttributeCode . '/options',
                'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET,
            ],
            'soap' => [
                'service' => self::SERVICE_NAME,
                'serviceVersion' => self::SERVICE_VERSION,
                'operation' => self::SERVICE_NAME . 'getItems',
            ],
        ];

        $response = $this->_webApiCall($serviceInfo, ['attributeCode' => $testAttributeCode]);

        $this->assertTrue(is_array($response));
        $this->assertEquals($expectedOptions, $response);
    }

    /**
     * @magentoApiDataFixture Magento/Catalog/Model/Detail/Attribute/_files/select_attribute.php
     */
    public function testAdd()
    {
        $this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
        $testAttributeCode = 'select_attribute';
        $serviceInfo = [
            'rest' => [
                'resourcePath' => self::RESOURCE_PATH . '/' . $testAttributeCode . '/options',
                'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST,
            ],
            'soap' => [
                'service' => self::SERVICE_NAME,
                'serviceVersion' => self::SERVICE_VERSION,
                'operation' => self::SERVICE_NAME . 'add',
            ],
        ];

        $optionData = [
            AttributeOptionInterface::LABEL => 'new color',
            AttributeOptionInterface::SORT_ORDER => 100,
            AttributeOptionInterface::IS_DEFAULT => true,
            AttributeOptionInterface::STORE_LABELS => [
                [
                    AttributeOptionLabelInterface::LABEL => 'DE label',
                    AttributeOptionLabelInterface::STORE_ID => 1,
                ],
            ],
        ];

        $response = $this->_webApiCall(
            $serviceInfo,
            [
                'attributeCode' => $testAttributeCode,
                'option' => $optionData,
            ]
        );

        $this->assertTrue($response);
        $updatedData = $this->getAttributeOptions($testAttributeCode);
        $lastOption = array_pop($updatedData);
        $this->assertEquals(
            $optionData[AttributeOptionInterface::STORE_LABELS][0][AttributeOptionLabelInterface::LABEL],
            $lastOption['label']
        );
    }

    /**
     * @magentoApiDataFixture Magento/Catalog/Model/Detail/Attribute/_files/select_attribute.php
     */
    public function testDelete()
    {
        $this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
        $attributeCode = 'select_attribute';
        //get option Id
        $optionList = $this->getAttributeOptions($attributeCode);
        $this->assertGreaterThan(0, count($optionList));
        $lastOption = array_pop($optionList);
        $this->assertNotEmpty($lastOption['value']);
        $optionId = $lastOption['value'];

        $serviceInfo = [
            'rest' => [
                'resourcePath' => self::RESOURCE_PATH . '/' . $attributeCode . '/options/' . $optionId,
                'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE,
            ],
            'soap' => [
                'service' => self::SERVICE_NAME,
                'serviceVersion' => self::SERVICE_VERSION,
                'operation' => self::SERVICE_NAME . 'delete',
            ],
        ];
        $this->assertTrue($this->_webApiCall(
            $serviceInfo,
            [
                'attributeCode' => $attributeCode,
                'optionId' => $optionId,
            ]
        ));
        $updatedOptions = $this->getAttributeOptions($attributeCode);
        $this->assertEquals($optionList, $updatedOptions);
    }

    /**
     * @param $testAttributeCode
     * @return array|bool|float|int|string
     */
    private function getAttributeOptions($testAttributeCode)
    {
        $serviceInfo = [
            'rest' => [
                'resourcePath' => self::RESOURCE_PATH . '/' . $testAttributeCode . '/options',
                'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET,
            ],
            'soap' => [
                'service' => self::SERVICE_NAME,
                'serviceVersion' => self::SERVICE_VERSION,
                'operation' => self::SERVICE_NAME . 'getItems',
            ],
        ];
        return $this->_webApiCall($serviceInfo, ['attributeCode' => $testAttributeCode]);
    }
}


text:
extern NSString * const kTBSendAlbumKeyToHostingAppWhenCheckout;
extern NSString * const kTBUseExternalPrintProductInfo;
extern NSString * const kTBUseExternalCheckout;

@implementation SDKConfiguratorCustomCheckout

- (NSDictionary *)basicSettings {
    NSMutableDictionary * settings = [[super basicSettings] mutableCopy];

    NSDictionary * checkout = @{
                                kTBNoCover : @{                                  // (Optional) YES if you don't need a cover or the cover is not customizable
                                        @(TBProductType_Photobook) : @NO,
                                        @(TBProductType_Canvas) : @YES,
                                        @(TBProductType_Calendar) : @YES,
                                        @(TBProductType_Card) : @YES,
                                        },

                                // Only set YES to ONE of the following
                                // option 2, generate album pages and use your own checkout UI
                                kTBUseExternalCheckout : @NO,

                                // option 2, generate album JSON for 1 book
                                kTBSendAlbumKeyToHostingAppWhenCheckout : @NO,

                                // option 3, generate album JSON for all books in a shopping cart
                                kTBSendAlbumJSONDictToHostingApp : @NO,
                                kTBSendOrderInfoToHostingApp : @NO,
                                };

    [settings setObject:checkout forKey:kTBCheckoutCustomization];

    return settings;
}

@end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Options.Providers;

namespace Microsoft.CodeAnalysis.Simplification
{
    [ExportOptionProvider, Shared]
    internal class SimplificationOptionsProvider : IOptionProvider
    {
        [ImportingConstructor]
        public SimplificationOptionsProvider()
        {
        }

        public ImmutableArray<IOption> Options { get; } = ImmutableArray.Create<IOption>(
                SimplificationOptions.NamingPreferences);
    }
}


text:
      <title>font family tester</title>
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">

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

<input id="justifyBox" type="checkbox"></input>justify

<input id="hyphenBox" type="checkbox"></input>hyphens

<input id="balanceBox" type="checkbox"></input>balance

My Incredibly Interesting Story

Once there was a hornless unicorn, drawing tessellations and meandered aimlessly with all the forest creatures. There were frogs and bears and hippopotamuses. One day the fearless lion asked the hornless unicorn why he did not have a horn. Hearing this, the hornless unicorn replied, I was born without one.

The Plot Thickens

The bear then said, doesn't that just make you a horse? The hornless unicorn said, no. My parents were unicorns, their parents were unicorns, plus...

“You are what you believe.”

All the animals went about their business as though nothing had happened. Then one day the fearless lion asked the hornless unicorn why it didn't have a horn. To which, the hornless unicorn replied, I was born without it.


text:
package link.webarata3.common.helper;

import java.util.HashMap;
import java.util.Map;

import link.webarata3.common.enums.LineBreakType;
import link.webarata3.common.enums.TrimType;
import link.webarata3.common.enums.UseEmBlank;
import link.webarata3.common.enums.UseLineBreak;
import link.webarata3.common.util.NormalizedString;
import link.webarata3.common.util.NumberUtil;
import link.webarata3.common.util.RegexUtil;
import link.webarata3.common.util.StringUtil;

/**
 * Validation用のHelper
 *
 * @author webarata3
 *
 */
public class ValidationHelper {
    private TrimType trimType;
    private LineBreakType lineBreakType;

    // インスタンスのキャッシュ
    private static Map<TrimType, Map<LineBreakType, ValidationHelper>> instanceMap;

    static {
        instanceMap = new HashMap<>();
    }

    /**
     * コンストラクタ。
     *
     * @param trimType
     *            Validationの前に行うTrimの方向
     * @param lineBrekeType
     *            正規化する改行の種類
     */
    private ValidationHelper(TrimType trimType, LineBreakType lineBreakType) {
        this.trimType = trimType;
        this.lineBreakType = lineBreakType;
    }

    /**
     * インスタンスを取得する
     *
     * @param trimType
     *            Validationの前に行うTrimの方向
     * @param lineBreakType
     *            正規化する改行の種類
     * @return ValidationHelperのインスタンス
     */
    public static synchronized ValidationHelper getInstance(TrimType trimType, LineBreakType lineBreakType) {
        Map<LineBreakType, ValidationHelper> map = instanceMap.get(trimType);
        if (map == null) {
            map = new HashMap<LineBreakType, ValidationHelper>();
            instanceMap.put(trimType, map);
        }
        ValidationHelper validationHelper = map.get(lineBreakType);
        if (validationHelper == null) {
            validationHelper = new ValidationHelper(trimType, lineBreakType);
            map.put(lineBreakType, validationHelper);
        }
        return validationHelper;
    }

    /**
     * 必須チェックをする
     *
     * @param value
     *            検査する文字列
     * @return 空文字列かnullの場合false
     */
    public boolean required(String value) {
        if (value == null) {
            return false;
        }
        String trimValue = trimType.trim(value);

        return StringUtil.isNotEmpty(trimValue);
    }

    /**
     * 最小文字数のチェックをする
     *
     * @param value
     *            検査する文字列
     * @param length
     *            最小文字数
     * @return 最小文字数以上の場合true
     * @throws IllegalArgumentException
     *             lengthに負数の指定
     */
    public boolean minLength(String value, int length) throws IllegalArgumentException {
        if (length < 0) throw new IllegalArgumentException();

        // nullは空文字としてチェックする
        if (value == null) return 0 >= length;

        String trimValue = trimType.trim(value);
        String normalizeValue = StringUtil.normalizeLineBreak(trimValue, lineBreakType);
        NormalizedString normalizedString = new NormalizedString(normalizeValue);
        return normalizedString.length() >= length;
    }

    /**
     * 最大文字数のチェックをする
     *
     * @param value
     *            検査する文字列
     * @param length
     *            最大文字数
     * @return 最大文字数以下の場合true
     * @throws IllegalArgumentException
     *             lengthに負数の指定
     */
    public boolean maxLength(String value, int length) throws IllegalArgumentException {
        if (length < 0) throw new IllegalArgumentException();
        if (value == null) return true;

        String trimValue = trimType.trim(value);
        String normalizeString = StringUtil.normalizeLineBreak(trimValue, lineBreakType);
        NormalizedString normalizedString = new NormalizedString(normalizeString);
        return normalizedString.length() <= length;
    }

    /**
     * 整数であるかをチェックする
     *
     * @param value
     *            検査する文字列
     * @return 整数の場合true
     */
    public boolean isInt(String value) {
        String trimValue = trimType.trim(value);
        return NumberUtil.formatInt(trimValue) != null;
    }

    /**
     * 全角カタカナであるかをチェックする
     *
     * @param value
     *            検査する文字列
     * @param useEmBlank
     *            全角ブランクを許可するか
     * @param useLineBreak
     *            改行を許可するか
     * @return パターンにマッチする場合true
     */
    public boolean isEmKatakana(String value, UseEmBlank useEmBlank, UseLineBreak useLineBreak) {
        if (StringUtil.isEmpty(value)) return true;

        String trimValue = trimType.trim(value);

        String pattern = RegexUtil.EM_KATAKANA;
        if (useEmBlank == UseEmBlank.ALLOW) {
            pattern = pattern + RegexUtil.EM_BLANK;
        }
        if (useLineBreak == UseLineBreak.ALLOW) {
            pattern = pattern + RegexUtil.LINE_BREAK;
        }

        return RegexUtil.perfectMatch(pattern, trimValue);
    }
}


text:
Isolation is done on running Docker container with iptables script
and environment variable `$firewallAllowedDestinations`

You can effectively disable network isolation by setting environment variable to
`firewallAllowedDestinations=all`

If you will omit the setting of environment variable, every network traffic will be dropped and docker container will be fully isolated from outside.

Example of container launching to allow only http and https connections to 10.16.36.64:

```
# CID=$(docker run --cap-add=NET_ADMIN -d --env firewallAllowedDestinations=10.16.36.64:80,10.16.36.64:443 -P -p 8080:8080 --name ssh-jenkins -v /var/jenkins_home pnc-builder-v0.5)

# docker exec $CID /tmp/isolate-with-iptables.sh
```

Check the non-permitted link to https://repo1.maven.org which translates to https://23.235.43.209

```
# docker exec $CID curl https://repo1.maven.org/maven2/ant/ant-junit/maven-metadata.xml
```

it should resulted in _Failed to connect to repo1.maven.org port 443: Connection refused_
while on

```
# docker exec $CID curl http://10.16.36.64/brewroot/repos/jb-wfk-2-rhel-6-build/latest/maven/ant/ant-junit/maven-metadata.xml
```

should pass with downloading and showing maven-metadata.xml file content on the console.


text:
//========================================================================
// GLFW 3.2 Linux - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2014 Jonas Ådahl <jadahl@gmail.com>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//    claim that you wrote the original software. If you use this software
//    in a product, an acknowledgment in the product documentation would
//    be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
//    be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
//    distribution.
//
//========================================================================

#ifndef _glfw3_linux_joystick_h_
#define _glfw3_linux_joystick_h_

#include <regex.h>

#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWjoylistLinux linux_js

// Linux-specific joystick data
//
typedef struct _GLFWjoystickLinux
{
    GLFWbool        present;
    int             fd;
    float*          axes;
    int             axisCount;
    unsigned char*  buttons;
    int             buttonCount;
    char*           name;
    char*           path;
} _GLFWjoystickLinux;

// Linux-specific joystick API data
//
typedef struct _GLFWjoylistLinux
{
    _GLFWjoystickLinux js[GLFW_JOYSTICK_LAST + 1];

#if defined(__linux__)
    int             inotify;
    int             watch;
    regex_t         regex;
#endif /*__linux__*/
} _GLFWjoylistLinux;

GLFWbool _glfwInitJoysticksLinux(void);
void _glfwTerminateJoysticksLinux(void);

void _glfwPollJoystickEvents(void);

#endif // _glfw3_linux_joystick_h_


text:
#ifndef TASKQUEUE_H_INCLUDED
#define TASKQUEUE_H_INCLUDED

///////////////////////////////////////////////////////////////////////////////
/**
    A simple queue to be used for executing ProgressiveTasks.
*/
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////

#endif//TASKQUEUE_H_INCLUDED


text:
template <class VulkanWrapper, class VulkanNative> class VulkanList {
protected:
    std::vector<std::reference_wrapper<VulkanWrapper>> m_wrapperList;
    std::vector<std::reference_wrapper<const VulkanWrapper>> m_constWrapperList;
    std::vector<VulkanNative> m_nativeList;

    VulkanList(const VulkanList &list);
    VulkanList();
    virtual ~VulkanList();
    virtual void add(VulkanWrapper &wrapper);

public:
    virtual void add(const VulkanWrapper &wrapper);
    virtual size_t size() const;
    virtual const VulkanWrapper &operator[](size_t idx) const;
    virtual VulkanWrapper &operator[](size_t idx);
    virtual const VulkanNative *operator()() const;
};

template <class VulkanKey, class VulkanValue> class VulkanMap {
protected:
    std::map<VulkanKey, VulkanValue> m_map;

    VulkanMap(const VulkanMap &map);
    VulkanMap();
    virtual ~VulkanMap();

public:
    void insert(const VulkanKey &key, VulkanValue &value);
    const VulkanValue &operator[](const VulkanKey &key) const;
    VulkanValue &operator[](const VulkanKey &key);
};

class VulkanPhysicalDeviceList
    : public VulkanList<VulkanPhysicalDevice, VkPhysicalDevice> {
    friend class VulkanInstance;

protected:
    VulkanPhysicalDeviceList(
        const VulkanPhysicalDeviceList &physicalDeviceList);

public:
    VulkanPhysicalDeviceList();
    virtual ~VulkanPhysicalDeviceList();
};

class VulkanQueueFamilyList : public VulkanList<VulkanQueueFamily, uint32_t> {
    friend class VulkanPhysicalDevice;

protected:
    VulkanQueueFamilyList(const VulkanQueueFamilyList &queueFamilyList);

public:
    VulkanQueueFamilyList();
    virtual ~VulkanQueueFamilyList();
};

class VulkanMemoryHeapList : public VulkanList<VulkanMemoryHeap, uint32_t> {
    friend class VulkanPhysicalDevice;

protected:
    VulkanMemoryHeapList(const VulkanMemoryHeapList &memoryHeapList);

public:
    VulkanMemoryHeapList();
    virtual ~VulkanMemoryHeapList();
};

class VulkanMemoryTypeList : public VulkanList<VulkanMemoryType, uint32_t> {
    friend class VulkanPhysicalDevice;
    friend class VulkanBuffer;
    friend class VulkanImage;

protected:
    VulkanMemoryTypeList(const VulkanMemoryTypeList &memoryTypeList);

public:
    VulkanMemoryTypeList();
    virtual ~VulkanMemoryTypeList();
};

class VulkanQueueFamilyToQueueCountMap : public VulkanMap<uint32_t, uint32_t> {
protected:
    VulkanQueueFamilyToQueueCountMap(
        const VulkanQueueFamilyToQueueCountMap &queueFamilyToQueueCountMap);

public:
    VulkanQueueFamilyToQueueCountMap(uint32_t numQueuesPerFamily = 0);
    virtual ~VulkanQueueFamilyToQueueCountMap();
};

class VulkanQueueList : public VulkanList<VulkanQueue, VkQueue> {
    friend class VulkanDevice;

protected:
    VulkanQueueList(const VulkanQueueList &queueList);

public:
    VulkanQueueList();
    virtual ~VulkanQueueList();
};

class VulkanQueueFamilyToQueueListMap
    : public VulkanMap<uint32_t, std::reference_wrapper<VulkanQueueList>> {
protected:
    VulkanQueueFamilyToQueueListMap(
        const VulkanQueueFamilyToQueueListMap &queueFamilyToQueueMap);

public:
    VulkanQueueFamilyToQueueListMap();
    virtual ~VulkanQueueFamilyToQueueListMap();
    void insert(uint32_t key, VulkanQueueList &queueList);
    VulkanQueueList &operator[](uint32_t key);
};

class VulkanDescriptorSetLayoutBindingList
    : public VulkanList<VulkanDescriptorSetLayoutBinding,
                        VkDescriptorSetLayoutBinding> {
protected:
    VulkanDescriptorSetLayoutBindingList(
        const VulkanDescriptorSetLayoutBindingList
            &descriptorSetLayoutBindingList);

public:
    VulkanDescriptorSetLayoutBindingList();
    VulkanDescriptorSetLayoutBindingList(
        size_t numDescriptorSetLayoutBindings,
        VulkanDescriptorType descriptorType, uint32_t descriptorCount = 1,
        VulkanShaderStage shaderStage = VULKAN_SHADER_STAGE_COMPUTE);
    VulkanDescriptorSetLayoutBindingList(
        VulkanDescriptorType descriptorType0, uint32_t descriptorCount0,
        VulkanDescriptorType descriptorType1, uint32_t descriptorCount1,
        VulkanShaderStage shaderStage = VULKAN_SHADER_STAGE_COMPUTE);
    virtual ~VulkanDescriptorSetLayoutBindingList();
};

class VulkanDescriptorSetLayoutList
    : public VulkanList<VulkanDescriptorSetLayout, VkDescriptorSetLayout> {
protected:
    VulkanDescriptorSetLayoutList(
        const VulkanDescriptorSetLayoutList &descriptorSetLayoutList);

public:
    VulkanDescriptorSetLayoutList();
    virtual ~VulkanDescriptorSetLayoutList();
};

class VulkanCommandBufferList
    : public VulkanList<VulkanCommandBuffer, VkCommandBuffer> {
protected:
    VulkanCommandBufferList(const VulkanCommandBufferList &commandBufferList);

public:
    VulkanCommandBufferList();
    VulkanCommandBufferList(size_t numCommandBuffers,
                            const VulkanDevice &device,
                            const VulkanCommandPool &commandPool);
    virtual ~VulkanCommandBufferList();
};

class VulkanBufferList : public VulkanList<VulkanBuffer, VkBuffer> {
protected:
    VulkanBufferList(const VulkanBufferList &bufferList);

public:
    VulkanBufferList(
        size_t numBuffers, const VulkanDevice &device, uint64_t size,
        VulkanExternalMemoryHandleType externalMemoryHandleType =
            VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_NONE,
        VulkanBufferUsage bufferUsage =
            VULKAN_BUFFER_USAGE_STORAGE_BUFFER_TRANSFER_SRC_DST,
        VulkanSharingMode sharingMode = VULKAN_SHARING_MODE_EXCLUSIVE,
        const VulkanQueueFamilyList &queueFamilyList =
            getEmptyVulkanQueueFamilyList());
    virtual ~VulkanBufferList();
};

class VulkanImage2DList : public VulkanList<VulkanImage2D, VkImage> {
protected:
    VulkanImage2DList(const VulkanImage2DList &image2DList);

public:
    VulkanImage2DList(
        size_t numImages, std::vector<VulkanDeviceMemory *> &deviceMemory,
        uint64_t baseOffset, uint64_t interImageOffset,
        const VulkanDevice &device, VulkanFormat format, uint32_t width,
        uint32_t height, uint32_t mipLevels,
        VulkanExternalMemoryHandleType externalMemoryHandleType =
            VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_NONE,
        VulkanImageCreateFlag imageCreateFlag = VULKAN_IMAGE_CREATE_FLAG_NONE,
        VulkanImageUsage imageUsage =
            VULKAN_IMAGE_USAGE_SAMPLED_STORAGE_TRANSFER_SRC_DST,
        VulkanSharingMode sharingMode = VULKAN_SHARING_MODE_EXCLUSIVE);
    VulkanImage2DList(
        size_t numImages, const VulkanDevice &device, VulkanFormat format,
        uint32_t width, uint32_t height, uint32_t mipLevels = 1,
        VulkanExternalMemoryHandleType externalMemoryHandleType =
            VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_NONE,
        VulkanImageCreateFlag imageCreateFlag = VULKAN_IMAGE_CREATE_FLAG_NONE,
        VulkanImageUsage imageUsage =
            VULKAN_IMAGE_USAGE_SAMPLED_STORAGE_TRANSFER_SRC_DST,
        VulkanSharingMode sharingMode = VULKAN_SHARING_MODE_EXCLUSIVE);
    virtual ~VulkanImage2DList();
};

class VulkanImageViewList : public VulkanList<VulkanImageView, VkImageView> {
protected:
    VulkanImageViewList(const VulkanImageViewList &imageViewList);

public:
    VulkanImageViewList(const VulkanDevice &device,
                        const VulkanImage2DList &image2DList,
                        bool createImageViewPerMipLevel = true);
    virtual ~VulkanImageViewList();
};

class VulkanDeviceMemoryList
    : public VulkanList<VulkanDeviceMemory, VkDeviceMemory> {
protected:
    VulkanDeviceMemoryList(const VulkanDeviceMemoryList &deviceMemoryList);

public:
    VulkanDeviceMemoryList(
        size_t numImages, const VulkanImage2DList &image2DList,
        const VulkanDevice &device, const VulkanMemoryType &memoryType,
        VulkanExternalMemoryHandleType externalMemoryHandleType =
            VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_NONE);
    virtual ~VulkanDeviceMemoryList();
};

class VulkanSemaphoreList : public VulkanList<VulkanSemaphore, VkSemaphore> {
protected:
    VulkanSemaphoreList(const VulkanSemaphoreList &semaphoreList);

public:
    VulkanSemaphoreList();
    VulkanSemaphoreList(
        size_t numSemaphores, const VulkanDevice &device,
        VulkanExternalSemaphoreHandleType externalSemaphoreHandleType =
            VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NONE,
        const std::wstring namePrefix = L"");
    virtual ~VulkanSemaphoreList();
};

///////////////////////////////
// VulkanList implementation //
///////////////////////////////

template <class VulkanWrapper, class VulkanNative>
VulkanList<VulkanWrapper, VulkanNative>::VulkanList(const VulkanList &list)
    : m_wrapperList(list.m_wrapperList),
      m_constWrapperList(list.m_constWrapperList),
      m_nativeList(list.m_nativeList)
{}

template <class VulkanWrapper, class VulkanNative>
VulkanList<VulkanWrapper, VulkanNative>::VulkanList()
{}

template <class VulkanWrapper, class VulkanNative>
VulkanList<VulkanWrapper, VulkanNative>::~VulkanList()
{}

template <class VulkanWrapper, class VulkanNative>
void VulkanList<VulkanWrapper, VulkanNative>::add(VulkanWrapper &wrapper)
{

    if (m_constWrapperList.size() != size_t(0))
    {
        std::cout << "This list can only contain externally allocated objects"
                  << std::endl;
        return;
    }
    m_wrapperList.push_back(std::reference_wrapper<VulkanWrapper>(wrapper));
    m_nativeList.push_back((VulkanNative)wrapper);
}

template <class VulkanWrapper, class VulkanNative>
void VulkanList<VulkanWrapper, VulkanNative>::add(const VulkanWrapper &wrapper)
{
    if (m_wrapperList.size() != size_t(0))
    {
        std::cout << "This list cannot contain externally allocated objects"
                  << std::endl;
        return;
    }

    m_constWrapperList.push_back(
        std::reference_wrapper<const VulkanWrapper>(wrapper));
    m_nativeList.push_back((VulkanNative)wrapper);
}

template <class VulkanWrapper, class VulkanNative>
size_t VulkanList<VulkanWrapper, VulkanNative>::size() const
{
    return (m_wrapperList.size() > 0) ? m_wrapperList.size()
                                      : m_constWrapperList.size();
}

template <class VulkanWrapper, class VulkanNative>
const VulkanWrapper &
    VulkanList<VulkanWrapper, VulkanNative>::operator[](size_t idx) const
{
    if (idx < size())
    {
        // CHECK_LT(idx, size());
        return (m_wrapperList.size() > 0) ? m_wrapperList[idx].get()
                                          : m_constWrapperList[idx].get();
    }
}

template <class VulkanWrapper, class VulkanNative>
VulkanWrapper &VulkanList<VulkanWrapper, VulkanNative>::operator[](size_t idx)
{
    // CHECK_LT(idx, m_wrapperList.size());
    return m_wrapperList[idx].get();
}

template <class VulkanWrapper, class VulkanNative>
const VulkanNative *VulkanList<VulkanWrapper, VulkanNative>::operator()() const
{
    return m_nativeList.data();
}

//////////////////////////////
// VulkanMap implementation //
//////////////////////////////

template <class VulkanKey, class VulkanValue>
VulkanMap<VulkanKey, VulkanValue>::VulkanMap(const VulkanMap &map)
    : m_map(map.m_map)
{}

template <class VulkanKey, class VulkanValue>
VulkanMap<VulkanKey, VulkanValue>::VulkanMap()
{}

template <class VulkanKey, class VulkanValue>
VulkanMap<VulkanKey, VulkanValue>::~VulkanMap()
{}

template <class VulkanKey, class VulkanValue>
void VulkanMap<VulkanKey, VulkanValue>::insert(const VulkanKey &key,
                                               VulkanValue &value)
{
    m_map.insert(std::pair<VulkanKey, std::reference_wrapper<VulkanValue>>(
        key, std::reference_wrapper<VulkanValue>(value)));
}

template <class VulkanKey, class VulkanValue>
const VulkanValue &
    VulkanMap<VulkanKey, VulkanValue>::operator[](const VulkanKey &key) const
{
    return m_map.at(key);
}

template <class VulkanKey, class VulkanValue>
VulkanValue &VulkanMap<VulkanKey, VulkanValue>::operator[](const VulkanKey &key)
{
    return m_map.at(key);
}

#endif // _vulkan_list_map_hpp_


text:
require "cgi"
require "net/http"
require "octokit"

Net::OpenTimeout = Class.new(RuntimeError) unless Net.const_defined?(:OpenTimeout)
Net::ReadTimeout = Class.new(RuntimeError) unless Net.const_defined?(:ReadTimeout)

module Jekyll
  module Gist
    class GistTag < Liquid::Tag
      def render(context)
        @encoding = context.registers[:site].config["encoding"] || "utf-8"
        @settings = context.registers[:site].config["gist"]
        if (tag_contents = determine_arguments(@markup.strip))
          gist_id = tag_contents[0]
          filename = tag_contents[1]
          if context_contains_key?(context, gist_id)
            gist_id = context[gist_id]
          end
          if context_contains_key?(context, filename)
            filename = context[filename]
          end
          noscript_tag = gist_noscript_tag(gist_id, filename)
          script_tag = gist_script_tag(gist_id, filename)
          "#{noscript_tag}#{script_tag}"
        else
          raise ArgumentError, <<-EOS
  Syntax error in tag 'gist' while parsing the following markup:

    #{@markup}

  Valid syntax:
    {% gist user/1234567 %}
    {% gist user/1234567 foo.js %}
    {% gist 28949e1d5ee2273f9fd3 %}
    {% gist 28949e1d5ee2273f9fd3 best.md %}
  EOS
        end
      end

      private

      def determine_arguments(input)
        matched = input.match(%r!\A([\S]+|.*(?=\/).+)\s?(\S*)\Z!)
        [matched[1].strip, matched[2].strip] if matched && matched.length >= 3
      end

      private

      def context_contains_key?(context, key)
        if context.respond_to?(:has_key?)
          context.has_key?(key)
        else
          context.key?(key)
        end
      end

      def gist_script_tag(gist_id, filename = nil)
        url = "https://gist.github.com/#{gist_id}.js"
        url = "#{url}?file=#{filename}" unless filename.to_s.empty?
        ""
      end

      def gist_noscript_tag(gist_id, filename = nil)
        return if @settings && @settings["noscript"] == false
        code = fetch_raw_code(gist_id, filename)
        if !code.nil?
          code = code.force_encoding(@encoding)
          code = CGI.escapeHTML(code)

          # CGI.escapeHTML behavior differs in Ruby < 2.0
          # See https://github.com/jekyll/jekyll-gist/pull/28
          code = code.gsub("'", "'") if RUBY_VERSION < "2.0"

          "
#{code}
"
        else
          Jekyll.logger.warn "Warning:", "The  tag for your gist #{gist_id} "
          Jekyll.logger.warn "", "could not be generated. This will affect users who do "
          Jekyll.logger.warn "", "not have JavaScript enabled in their browsers."
        end
      end

      def fetch_raw_code(gist_id, filename = nil)
        return code_from_api(gist_id, filename) if ENV["JEKYLL_GITHUB_TOKEN"]

        url = "https://gist.githubusercontent.com/#{gist_id}/raw"
        url = "#{url}/#{filename}" unless filename.to_s.empty?
        uri = URI(url)
        Net::HTTP.start(uri.host, uri.port,
          :use_ssl => uri.scheme == "https",
          :read_timeout => 3, :open_timeout => 3) do |http|
          request = Net::HTTP::Get.new uri.to_s
          response = http.request(request)
          response.body
        end
      rescue SocketError, Net::HTTPError, Net::OpenTimeout, Net::ReadTimeout, TimeoutError
        nil
      end

      private

      def code_from_api(gist_id, filename = nil)
        gist = GistTag.client.gist gist_id

        file = if filename.to_s.empty?
                 # No file specified, return the value of the first key/value pair
                 gist.files.first[1]
               else
                 # .files is a hash of :"filename.extension" => data pairs
                 # Rather than using to_sym on arbitrary user input,
                 # Find our file by calling to_s on the keys
                 match = gist.files.find { |name, _data| name.to_s == filename }
                 match[1] if match
               end

        file[:content] if file
      end

      def self.client
        @client ||= Octokit::Client.new :access_token => ENV["JEKYLL_GITHUB_TOKEN"]
      end
    end
  end
end

Liquid::Template.register_tag("gist", Jekyll::Gist::GistTag)


text:
var networkGraph = {
    load: function(personId, jsonUrl) {
        sigma.parsers.json(jsonUrl, {
                renderer: {
                    container: 'network',
                    type: 'canvas'
                },
                settings: {
                    defaultNodeColor: '#607a7a',
                    defaultEdgeType: 'arrow',

                    minNodeSize: 1,
                    maxNodeSize: 10,
                    minEdgeSize: 1,
                    maxEdgeSize: 2,

                    enableEdgeHovering: true,
                    edgeHoverColor: 'edge',
                    defaultEdgeHoverColor: '#000',
                    edgeHoverSizeRatio: 2,
                    edgeHoverExtremities: true,

                    autoCurveRatio: 2
                }
            },
            function(s) {
                if (s.graph.nodes().length == 0) {
                    $('#network-container').hide();
                }

                // puts nodes in a circle
                s.graph.nodes().forEach(function(node, i, nodes) {
                    node.size = 3;

                    if (node.id == personId) {
                        node.color = '#363635';
                        node.x = 0;
                        node.y = 0;
                    } else {
                        node.x = -Math.cos(Math.PI * 2 * i / nodes.length);
                        node.y = Math.sin(Math.PI * 2 * i / nodes.length);
                    }
                });

                s.graph.edges().forEach(function(edge, i, edges) {
                    edge.size = 2;
                });

                sigma.canvas.edges.autoCurve(s);

                sigma.plugins.dragNodes(s, s.renderers[0]);

                sigma.plugins.tooltips(s, s.renderers[0], tooltipsConfig);

                s.refresh();

                // configure the ForceLink algorithm
                fa = sigma.layouts.configForceLink(s, {
                    worker: true,
                    autoStop: true,
                    background: true,
                    easing: 'cubicInOut'
                });

                // start the ForceLink algorithm
                sigma.layouts.startForceLink();
            });
    }
};

var tooltipsConfig = {
    node: [{
        show: 'clickNode',
        cssClass: 'sigma-tooltip',
        position: 'top',
        //autoadjust: true,
        template: '

' +
            '
{{ label }}
' +
            '
' +
            '
' +
            '
Name	 {{ label }}
' +
            '
' +
            '
' +
            '
Number of connections: {{ degree }}
',
        renderer: function(node, template) {
            // The function context is s.graph
            node.degree = this.degree(node.id);

            // Returns an HTML string:
            return Mustache.render(template, node);
        }
    }]
};