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

<title>ApkLoader</title>
<meta name="date" content="2018-11-09">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.robolectric

Class ApkLoader

java.lang.Object

org.robolectric.ApkLoader

public class ApkLoader
extends java.lang.Object

Mediates loading of “APKs” in legacy mode.

Constructor Summary

Constructors

Modifier
Constructor and Description

protected
ApkLoader(DependencyResolver dependencyResolver)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

PackageResourceTable
getAppResourceTable(AndroidManifest appManifest)

java.net.URL
getArtifactUrl(DependencyJar dependency)

PackageResourceTable
getCompileTimeSdkResourceTable()

Returns the ResourceTable for the compile time SDK.

FsFile
getCompileTimeSystemResourcesFile(SdkEnvironment sdkEnvironment)

PackageResourceTable
getSystemResourceTable(SdkEnvironment sdkEnvironment)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ApkLoader

protected ApkLoader(DependencyResolver dependencyResolver)

Method Detail

getSystemResourceTable

public PackageResourceTable getSystemResourceTable(SdkEnvironment sdkEnvironment)

getAppResourceTable

public PackageResourceTable getAppResourceTable(AndroidManifest appManifest)

getCompileTimeSdkResourceTable

@Nonnull
public PackageResourceTable getCompileTimeSdkResourceTable()

Returns the ResourceTable for the compile time SDK.

getArtifactUrl

public java.net.URL getArtifactUrl(DependencyJar dependency)

getCompileTimeSystemResourcesFile

public FsFile getCompileTimeSystemResourcesFile(SdkEnvironment sdkEnvironment)

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package org.apache.druid.query.select;

import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import org.apache.druid.jackson.DefaultObjectMapper;
import org.apache.druid.query.CacheStrategy;
import org.apache.druid.query.Druids;
import org.apache.druid.query.QueryRunnerTestHelper;
import org.apache.druid.query.Result;
import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;

public class SelectQueryQueryToolChestTest
{
  private static final Supplier<SelectQueryConfig> configSupplier = Suppliers.ofInstance(new SelectQueryConfig(true));

  private static final SelectQueryQueryToolChest toolChest = new SelectQueryQueryToolChest(
      new DefaultObjectMapper(),
      QueryRunnerTestHelper.noopIntervalChunkingQueryRunnerDecorator(),
      configSupplier
  );

  @Test
  public void testComputeCacheKeyWithDifferentSortOrer()
  {
    final SelectQuery query1 = Druids.newSelectQueryBuilder()
                                     .dataSource("dummy")
                                     .dimensions(Collections.singletonList("testDim"))
                                     .intervals(SelectQueryRunnerTest.I_0112_0114_SPEC)
                                     .granularity(QueryRunnerTestHelper.allGran)
                                     .pagingSpec(PagingSpec.newSpec(3))
                                     .descending(false)
                                     .build();

    final SelectQuery query2 = Druids.newSelectQueryBuilder()
                                     .dataSource("dummy")
                                     .dimensions(Collections.singletonList("testDim"))
                                     .intervals(SelectQueryRunnerTest.I_0112_0114_SPEC)
                                     .granularity(QueryRunnerTestHelper.allGran)
                                     .pagingSpec(PagingSpec.newSpec(3))
                                     .descending(true)
                                     .build();

    final CacheStrategy<Result<SelectResultValue>, Object, SelectQuery> strategy1 = toolChest.getCacheStrategy(query1);
    Assert.assertNotNull(strategy1);
    final CacheStrategy<Result<SelectResultValue>, Object, SelectQuery> strategy2 = toolChest.getCacheStrategy(query2);
    Assert.assertNotNull(strategy2);

    Assert.assertFalse(Arrays.equals(strategy1.computeCacheKey(query1), strategy2.computeCacheKey(query2)));
  }
}

redpajama_set_name: RedPajamaGithub


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (Ballerina Native Features for API Manager - Parent 7.0.37-SNAPSHOT API)</title>
<meta name="date" content="2017-08-01">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

AbstractEventPublisherAction

BallerinaConnectorsProvider

BuiltinConnectorPackageRepository

Constants

EventPublisher

Init

Publish


text:
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script id="worker" type="javascript/worker">

var messageHandler = function(port, e) {
    var text_decoder = new TextDecoder;
    port.postMessage({
      content: text_decoder.decode(e.data),
      byteLength: e.data.byteLength
    });

    // Send back the array buffer.
    port.postMessage(e.data, [e.data.buffer]);

    port.postMessage({
     content: text_decoder.decode(e.data),
      byteLength: e.data.byteLength
    });
};

// For Worker.
self.addEventListener('message', e => {
    var port = e.ports[0];
    port.onmessage = messageHandler.bind(null, port);
});

// For SharedWorker.
self.addEventListener('connect', e => {
    var port = e.ports[0];
    port.onmessage = messageHandler.bind(null, port);
});

</script>

<script>

async_test(t => {
    var message = 'Hello, world!';
    var text_encoder = new TextEncoder;
    var text_decoder = new TextDecoder;

    var channel = new MessageChannel;
    channel.port1.onmessage = function(e) {
        assert_equals(e.data.byteLength, message.length);
        assert_equals(text_decoder.decode(e.data), message);
        t.done();
    };
    channel.port2.onmessage = function(e) {
        assert_equals(e.data.byteLength, message.length);
        assert_equals(text_decoder.decode(e.data), message);
        channel.port2.postMessage(e.data, [e.data.buffer]);
        assert_equals(e.data.byteLength, 0);
        assert_equals(text_decoder.decode(e.data), '');
    };

    var ab = text_encoder.encode(message);
    assert_equals(ab.byteLength, message.length);
    channel.port1.postMessage(ab, [ab.buffer]);
    assert_equals(ab.byteLength, 0);
    assert_equals(text_decoder.decode(ab.data), '');
}, 'Send a transferable ArrayBuffer within a same frame');

async_test(t => {
    var message = 'Hello, world!';
    var text_encoder = new TextEncoder;
    var text_decoder = new TextDecoder;

    var frame = document.createElement('iframe');
    frame.src = 'resources/empty.html';
    frame.onload = function() {
      frame.contentWindow.onmessage = function(evt) {
          var port = evt.data;
          port.onmessage = function(e) {
              assert_equals(e.data.byteLength, message.length);
              assert_equals(text_decoder.decode(e.data), message);
              port.postMessage(e.data, [e.data.buffer]);
              assert_equals(e.data.byteLength, 0);
              assert_equals(text_decoder.decode(e.data), '');
          };
      };

      var channel = new MessageChannel;
      channel.port1.onmessage = function(e) {
          assert_equals(e.data.byteLength, message.length);
          assert_equals(text_decoder.decode(e.data), message);
          t.done();
      };
      frame.contentWindow.postMessage(channel.port2, '*', [channel.port2]);

      var ab = text_encoder.encode(message);
      assert_equals(ab.byteLength, message.length);
      channel.port1.postMessage(ab, [ab.buffer]);
      assert_equals(ab.byteLength, 0);
      assert_equals(text_decoder.decode(ab), '');
    };
    document.body.appendChild(frame);
}, 'Send a transferable ArrayBuffer over frames');

promise_test(t => {
    var message = 'Hello, world!';
    var text_encoder = new TextEncoder;
    var text_decoder = new TextDecoder;
    var channel = new MessageChannel;

    var blob = new Blob([document.querySelector('#worker').textContent]);
    var worker = new Worker(URL.createObjectURL(blob));
    worker.postMessage(undefined, [channel.port2]);

    var ab = text_encoder.encode(message);
    assert_equals(ab.byteLength, message.length);
    channel.port1.postMessage(ab, [ab.buffer]);
    assert_equals(
      ab.byteLength, 0,
      'Byte length of a neutered buffer should be zero.');

    return new Promise(resolve => { channel.port1.onmessage = resolve; })
      .then(e => {
          // Verify the integrity of the transferred array buffer.
          assert_equals(e.data.content, message);
          assert_equals(e.data.byteLength, message.length);
          return new Promise(resolve => { channel.port1.onmessage = resolve; })
        })
      .then(e => {
          // Verify the integrity of the array buffer sent back from Worker via
          // MessagePort.
          assert_equals(text_decoder.decode(e.data), message);
          assert_equals(e.data.byteLength, message.length);
          return new Promise(resolve => { channel.port1.onmessage = resolve; })
        })
      .then(e => {
          // Verify that the array buffer on ServiceWorker is neutered.
          assert_equals(e.data.content, '');
          assert_equals(e.data.byteLength, 0);
        });
}, 'Send a transferable ArrayBuffer to Worker');

promise_test(t => {
    var message = 'Hello, world!';
    var text_encoder = new TextEncoder;
    var text_decoder = new TextDecoder;

    var blob = new Blob([document.querySelector('#worker').textContent]);
    var worker = new SharedWorker(URL.createObjectURL(blob));

    var ab = text_encoder.encode(message);
    assert_equals(ab.byteLength, message.length);
    worker.port.postMessage(ab, [ab.buffer]);
    assert_equals(
      ab.byteLength, 0,
      'Byte length of a neutered buffer should be zero.');

    return new Promise(resolve => { worker.port.onmessage = resolve; })
      .then(e => {
          // Verify the integrity of the transferred array buffer.
          assert_equals(e.data.content, message);
          assert_equals(e.data.byteLength, message.length);
          return new Promise(resolve => { worker.port.onmessage = resolve; })
        })
      .then(e => {
          // Verify the integrity of the array buffer sent back from Worker via
          // MessagePort.
          assert_equals(text_decoder.decode(e.data), message);
          assert_equals(e.data.byteLength, message.length);
          return new Promise(resolve => { worker.port.onmessage = resolve; })
        })
      .then(e => {
          // Verify that the array buffer on ServiceWorker is neutered.
          assert_equals(e.data.content, '');
          assert_equals(e.data.byteLength, 0);
        });
}, 'Send a transferable ArrayBuffer to SharedWorker');

</script>
</body>


text:
@interface WMLightView ()
@property (nonatomic, strong) NSTimer			*timer;

@end

@implementation WMLightView
+ (instancetype)sharedLightView{
     WMLightView *lightView = [[WMLightView alloc] init];
        lightView.backgroundColor = [UIColor whiteColor];
    return lightView;
}
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width) * 0.5, ([UIScreen mainScreen].bounds.size.height) * 0.5, 155, 155);
        self.layer.cornerRadius  = 10;

        {
            UILabel *titleLabel      = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, self.bounds.size.width, 30)];
            titleLabel.font          = [UIFont boldSystemFontOfSize:16.0];
            titleLabel.textColor     = [UIColor colorWithRed:0.25f green:0.22f blue:0.21f alpha:1.00f];
            titleLabel.textAlignment = NSTextAlignmentCenter;
            titleLabel.text          = @"亮度";
            [self addSubview:titleLabel];
        }

        {
            self.centerLightIV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 79, 76)];
            self.centerLightIV.image        = [UIImage imageNamed:[@"WMPlayer.bundle" stringByAppendingPathComponent:@"play_new_brightness_day"]];
            self.centerLightIV.center = CGPointMake(155 * 0.5, 155 * 0.5);
            [self addSubview:self.centerLightIV];
        }

        {
        self.lightBackView         = [[UIView alloc]initWithFrame:CGRectMake(13, 132, self.bounds.size.width - 26, 7)];
        self.lightBackView .backgroundColor = [UIColor colorWithRed:65.0/255.0 green:67.0/255.0 blue:70.0/255.0 alpha:1.0];
        [self addSubview:self.lightBackView ];
        }

        self.lightViewArr = [NSMutableArray arrayWithCapacity:16];
        CGFloat wiew_width = (self.lightBackView.bounds.size.width - 17) / 16;
        CGFloat wiew_Height = 5;
        CGFloat wiew_Y = 1;
        for (int i = 0; i < LIGHT_VIEW_COUNT; i++) {
            CGFloat wiew_X          = i * (wiew_width + 1) + 1;
            UIView  * view = [[UIView alloc] initWithFrame:CGRectMake(wiew_X, wiew_Y, wiew_width, wiew_Height)];
            view.backgroundColor = [UIColor whiteColor];
            [self.lightViewArr addObject:view];
            [self.lightBackView addSubview:view];
        }

        [self updateLongView:[UIScreen mainScreen].brightness];

        //通知
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(onOrientationDidChange:)
                                                     name:UIDeviceOrientationDidChangeNotification
                                                   object:nil];

        //KVO
        [[UIScreen mainScreen] addObserver:self
                                forKeyPath:@"brightness"
                                   options:NSKeyValueObservingOptionNew context:NULL];
        self.alpha = 0.0;
    }
    return self;
}
- (void)observeValueForKeyPath:(NSString *)keyPath
                      ofObject:(id)object
                        change:(NSDictionary *)change
                       context:(void *)context {

    CGFloat sound = [change[@"new"] floatValue];
    if (self.alpha == 0.0) {
        self.alpha = 1.0;
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self hideLightView];
        });
    }

    [self updateLongView:sound];
}

- (void)onOrientationDidChange:(NSNotification *)notify {
    self.alpha = 0.0;
}
- (void)hideLightView{
    if (self.alpha == 1.0) {
        [UIView animateWithDuration:0.8 animations:^{
            self.alpha = 0.0;
        } completion:^(BOOL finished) {

        }];
    }
}
#pragma mark - Update View
- (void)updateLongView:(CGFloat)sound {
    CGFloat stage = 1 / 15.0;
    NSInteger level = sound / stage;

    for (int i = 0; i < self.lightViewArr.count; i++) {
        UIView *aView = self.lightViewArr[i];
        if (i <= level) {
            aView.hidden = NO;
        } else {
            aView.hidden = YES;
        }
    }
    [self setNeedsLayout];

}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.transform = [WMPlayer getCurrentDeviceOrientation];
    self.transform = CGAffineTransformIdentity;
    dispatch_async(dispatch_get_main_queue(), ^{
        self.center = [UIApplication sharedApplication].keyWindow.center;
    });
}
- (void)dealloc {
    self.lightViewArr = nil;
    self.lightBackView = nil;
    NSLog(@"WMLightView dealloc");
    [[UIScreen mainScreen] removeObserver:self forKeyPath:@"brightness"];
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
@end


text:
from setuptools import setup

setup(
    name='tox-travis',
    description='Seamless integration of Tox into Travis CI',
    long_description=open('README.rst', 'rb').read().decode('utf-8'),
    author='Ryan Hiebert',
    author_email='ryan@ryanhiebert.com',
    url='https://github.com/ryanhiebert/tox-travis',
    license='MIT',
    version='0.1',
    py_modules=['tox_travis'],
    entry_points={
        'tox': ['travis = tox_travis'],
    },
    install_requires=['tox>=2.0'],
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
    ],
)


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

public static class DictionaryExtensions
{
    public static TValue GetValueOrDefault<TValue, TKey>(this Dictionary<TKey, TValue> dictionary, TKey key)
    {
        return dictionary.ContainsKey(key) ? dictionary[key] : default(TValue);
    }

    public static void ForEach<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, Action<TKey, TValue> onEachFn)
    {
        foreach (var entry in dictionary)
        {
            onEachFn(entry.Key, entry.Value);
        }
    }

    public static bool UnorderedEquivalentTo<K, V>(this IDictionary<K, V> thisMap, IDictionary<K, V> otherMap)
    {
        if (thisMap == null || otherMap == null) return thisMap == otherMap;
        if (thisMap.Count != otherMap.Count) return false;

        foreach (var entry in thisMap)
        {
            V otherValue;
            if (!otherMap.TryGetValue(entry.Key, out otherValue)) return false;
            if (!Equals(entry.Value, otherValue)) return false;
        }

        return true;
    }

    public static List<T> ConvertAll<T, K, V>(IDictionary<K, V> map, Func<K, V, T> createFn)
    {
        var list = new List<T>();
        map.Each((kvp) => list.Add(createFn(kvp.Key, kvp.Value)));
        return list;
    }

    public static V GetOrAdd<K, V>(this Dictionary<K, V> map, K key, Func<K, V> createFn)
    {
        //simulate ConcurrentDictionary.GetOrAdd
        lock (map)
        {
            V val;
            if (!map.TryGetValue(key, out val))
                map[key] = val = createFn(key);

            return val;
        }
    }

    public static KeyValuePair<TKey, TValue> PairWith<TKey, TValue>(this TKey key, TValue value)
    {
        return new KeyValuePair<TKey, TValue>(key, value);
    }

}


text:
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using QuantConnect.Interfaces;
using QuantConnect.Securities;
using QuantConnect.Util;

namespace QuantConnect.Data.UniverseSelection
{
    /// <summary>
    /// Represents the universe defined by the user's algorithm. This is
    /// the default universe where manually added securities live by
    /// market/security type. They can also be manually generated and
    /// can be configured to fire on certain interval and will always
    /// return the internal list of symbols.
    /// </summary>
    public class UserDefinedUniverse : Universe, INotifyCollectionChanged, ITimeTriggeredUniverse
    {
        private readonly TimeSpan _interval;
        private readonly HashSet<SubscriptionDataConfig> _subscriptionDataConfigs = new HashSet<SubscriptionDataConfig>();
        private readonly HashSet<Symbol> _symbols = new HashSet<Symbol>();
        // `UniverseSelection.RemoveSecurityFromUniverse()` will query us at `GetSubscriptionRequests()` to get the `SubscriptionDataConfig` and remove it from the DF
        // and we need to return the config even after the call to `Remove()`
        private readonly HashSet<SubscriptionDataConfig> _pendingRemovedConfigs = new HashSet<SubscriptionDataConfig>();
        private readonly UniverseSettings _universeSettings;
        private readonly Func<DateTime, IEnumerable<Symbol>> _selector;

        /// <summary>
        /// Event fired when a symbol is added or removed from this universe
        /// </summary>
        public event NotifyCollectionChangedEventHandler CollectionChanged;

        /// <summary>
        /// Gets the interval of this user defined universe
        /// </summary>
        public TimeSpan Interval
        {
            get { return _interval; }
        }

        /// <summary>
        /// Gets the settings used for subscriptons added for this universe
        /// </summary>
        public override UniverseSettings UniverseSettings
        {
            get { return _universeSettings; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UserDefinedUniverse"/> class
        /// </summary>
        /// <param name="configuration">The configuration used to resolve the data for universe selection</param>
        /// <param name="universeSettings">The settings used for new subscriptions generated by this universe</param>
        /// <param name="interval">The interval at which selection should be performed</param>
        /// <param name="symbols">The initial set of symbols in this universe</param>
        public UserDefinedUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, TimeSpan interval, IEnumerable<Symbol> symbols)
            : base(configuration)
        {
            _interval = interval;
            _symbols = symbols.ToHashSet();
            _universeSettings = universeSettings;
            // the selector Func will be the union of the provided symbols and the added symbols or subscriptions data configurations
            _selector = time => _subscriptionDataConfigs.Select(x => x.Symbol).Union(_symbols);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UserDefinedUniverse"/> class
        /// </summary>
        /// <param name="configuration">The configuration used to resolve the data for universe selection</param>
        /// <param name="universeSettings">The settings used for new subscriptions generated by this universe</param>
        /// <param name="interval">The interval at which selection should be performed</param>
        /// <param name="selector">Universe selection function invoked for each time returned via GetTriggerTimes.
        /// The function parameter is a DateTime in the time zone of configuration.ExchangeTimeZone</param>
        public UserDefinedUniverse(SubscriptionDataConfig configuration, UniverseSettings universeSettings, TimeSpan interval, Func<DateTime, IEnumerable<string>> selector)
            : base(configuration)
        {
            _interval = interval;
            _universeSettings = universeSettings;
            _selector = time =>
            {
                var selectSymbolsResult = selector(time.ConvertFromUtc(Configuration.ExchangeTimeZone));
                // if we received an unchaged then short circuit the symbol creation and return it directly
                if (ReferenceEquals(selectSymbolsResult, Unchanged)) return Unchanged;
                return selectSymbolsResult.Select(sym => Symbol.Create(sym, Configuration.SecurityType, Configuration.Market));
            };
        }

        /// <summary>
        /// Creates a user defined universe symbol
        /// </summary>
        /// <param name="securityType">The security</param>
        /// <param name="market">The market</param>
        /// <returns>A symbol for user defined universe of the specified security type and market</returns>
        public static Symbol CreateSymbol(SecurityType securityType, string market)
        {
            var ticker = $"qc-universe-userdefined-{market.ToLowerInvariant()}-{securityType}";
            SecurityIdentifier sid;
            switch (securityType)
            {
                case SecurityType.Base:
                    sid = SecurityIdentifier.GenerateBase(null, ticker, market);
                    break;

                case SecurityType.Equity:
                    sid = SecurityIdentifier.GenerateEquity(SecurityIdentifier.DefaultDate, ticker, market);
                    break;

                case SecurityType.Option:
                    var underlying = SecurityIdentifier.GenerateEquity(SecurityIdentifier.DefaultDate, ticker, market);
                    sid = SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, underlying, market, 0, 0, 0);
                    break;

                case SecurityType.FutureOption:
                    var underlyingFuture = SecurityIdentifier.GenerateFuture(SecurityIdentifier.DefaultDate, ticker, market);
                    sid = SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, underlyingFuture, market, 0, 0, 0);
                    break;

                case SecurityType.IndexOption:
                    var underlyingIndex = SecurityIdentifier.GenerateIndex(ticker, market);
                    sid = SecurityIdentifier.GenerateOption(SecurityIdentifier.DefaultDate, underlyingIndex, market, 0, 0, OptionStyle.European);
                    break;

                case SecurityType.Forex:
                    sid = SecurityIdentifier.GenerateForex(ticker, market);
                    break;

                case SecurityType.Cfd:
                    sid = SecurityIdentifier.GenerateCfd(ticker, market);
                    break;

                case SecurityType.Index:
                    sid = SecurityIdentifier.GenerateIndex(ticker, market);
                    break;

                case SecurityType.Future:
                    sid = SecurityIdentifier.GenerateFuture(SecurityIdentifier.DefaultDate, ticker, market);
                    break;

                case SecurityType.Crypto:
                    sid = SecurityIdentifier.GenerateCrypto(ticker, market);
                    break;

                case SecurityType.Commodity:
                default:
                    throw new NotImplementedException($"The specified security type is not implemented yet: {securityType}");
            }

            return new Symbol(sid, ticker);
        }

        /// <summary>
        /// Adds the specified <see cref="Symbol"/> to this universe
        /// </summary>
        /// <param name="symbol">The symbol to be added to this universe</param>
        /// <returns>True if the symbol was added, false if it was already present</returns>
        public bool Add(Symbol symbol)
        {
            if (_symbols.Add(symbol))
            {
                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, symbol));
                return true;
            }
            return false;
        }

        /// <summary>
        /// Adds the specified <see cref="SubscriptionDataConfig"/> to this universe
        /// </summary>
        /// <param name="subscriptionDataConfig">The subscription data configuration to be added to this universe</param>
        /// <returns>True if the subscriptionDataConfig was added, false if it was already present</returns>
        public bool Add(SubscriptionDataConfig subscriptionDataConfig)
        {
            if (_subscriptionDataConfigs.Add(subscriptionDataConfig))
            {
                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, subscriptionDataConfig.Symbol));
                return true;
            }
            return false;
        }

        /// <summary>
        /// Removes the specified <see cref="Symbol"/> from this universe
        /// </summary>
        /// <param name="symbol">The symbol to be removed</param>
        /// <returns>True if the symbol was removed, false if the symbol was not present</returns>
        public bool Remove(Symbol symbol)
        {
            if (RemoveAndKeepTrack(symbol))
            {
                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, symbol));
                return true;
            }
            return false;
        }

        /// <summary>
        /// Returns the symbols defined by the user for this universe
        /// </summary>
        /// <param name="utcTime">The current utc time</param>
        /// <param name="data">The symbols to remain in the universe</param>
        /// <returns>The data that passes the filter</returns>
        public override IEnumerable<Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)
        {
            return _selector(utcTime);
        }

        /// <summary>
        /// Returns an enumerator that defines when this user defined universe will be invoked
        /// </summary>
        /// <returns>An enumerator of DateTime that defines when this universe will be invoked</returns>
        public virtual IEnumerable<DateTime> GetTriggerTimes(DateTime startTimeUtc, DateTime endTimeUtc, MarketHoursDatabase marketHoursDatabase)
        {
            var exchangeHours = marketHoursDatabase.GetExchangeHours(Configuration);
            var localStartTime = startTimeUtc.ConvertFromUtc(exchangeHours.TimeZone);
            var localEndTime = endTimeUtc.ConvertFromUtc(exchangeHours.TimeZone);

            var first = true;
            foreach (var dateTime in LinqExtensions.Range(localStartTime, localEndTime, dt => dt + Interval))
            {
                if (first)
                {
                    yield return dateTime;
                    first = false;
                }
                else if (exchangeHours.IsOpen(dateTime, dateTime + Interval, Configuration.ExtendedMarketHours))
                {
                    yield return dateTime;
                }
            }
        }

        /// <summary>
        /// Event invocator for the <see cref="CollectionChanged"/> event
        /// </summary>
        /// <param name="e">The notify collection changed event arguments</param>
        protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
        {
            CollectionChanged?.Invoke(this, e);
        }

        /// <summary>
        /// Gets the subscription requests to be added for the specified security
        /// </summary>
        /// <param name="security">The security to get subscriptions for</param>
        /// <param name="currentTimeUtc">The current time in utc. This is the frontier time of the algorithm</param>
        /// <param name="maximumEndTimeUtc">The max end time</param>
        /// <param name="subscriptionService">Instance which implements <see cref="ISubscriptionDataConfigService"/> interface</param>
        /// <returns>All subscriptions required by this security</returns>
        public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security,
            DateTime currentTimeUtc,
            DateTime maximumEndTimeUtc,
            ISubscriptionDataConfigService subscriptionService)
        {
            var result = _subscriptionDataConfigs.Where(x => x.Symbol == security.Symbol).ToList();
            if (!result.Any())
            {
                result = _pendingRemovedConfigs.Where(x => x.Symbol == security.Symbol).ToList();
                if (result.Any())
                {
                    _pendingRemovedConfigs.RemoveWhere(x => x.Symbol == security.Symbol);
                }
                else
                {
                    result = base.GetSubscriptionRequests(security, currentTimeUtc, maximumEndTimeUtc, subscriptionService).Select(x => x.Configuration).ToList();
                    // we create subscription data configs ourselves, add the configs
                    _subscriptionDataConfigs.UnionWith(result);
                }
            }
            return result.Select(config => new SubscriptionRequest(isUniverseSubscription: false,
                                                                   universe: this,
                                                                   security: security,
                                                                   configuration: config,
                                                                   startTimeUtc: currentTimeUtc,
                                                                   endTimeUtc: maximumEndTimeUtc));
        }

        /// <summary>
        /// Tries to remove the specified security from the universe.
        /// </summary>
        /// <param name="utcTime">The current utc time</param>
        /// <param name="security">The security to be removed</param>
        /// <returns>True if the security was successfully removed, false if
        /// we're not allowed to remove or if the security didn't exist</returns>
        internal override bool RemoveMember(DateTime utcTime, Security security)
        {
            if (base.RemoveMember(utcTime, security))
            {
                RemoveAndKeepTrack(security.Symbol);
                return true;
            }
            return false;
        }

        private bool RemoveAndKeepTrack(Symbol symbol)
        {
            var toBeRemoved = _subscriptionDataConfigs.Where(x => x.Symbol == symbol).ToList();
            var removedSymbol = _symbols.Remove(symbol);

            if (removedSymbol || toBeRemoved.Any())
            {
                _subscriptionDataConfigs.RemoveWhere(x => x.Symbol == symbol);
                _pendingRemovedConfigs.UnionWith(toBeRemoved);
                return true;
            }

            return false;
        }
    }
}


text:
package cn.lxz.sweb.uuid;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * @Author jihua.li
 * @Date 2017/7/21 15:45
 */
public class SnowflakeIdWorker {

    /***
     * 开始时间戳 2017-07-01
     */
    private final long startTimestamp=1498838400000L;
    /**
     * 机器所占的位数
     */
    private final long workerIdBits=5L;
    /**
     * 数据标识id所占的位数
     */
    private final long dataCenterIdBits=5L;
    /**
     * 支持的最大机器id,结果是31(位移算法可以很快的计算出几位二进制数所能表示的最大十进制数)
     */
    private final long maxWorkerId=-1L^(-1L<<workerIdBits);
    /**
     *可以支持的最大数据标识id,结果是31
     */
    private final long maxDataCenterId=-1L^(-1L<<dataCenterIdBits);
    /**
     * 序列在id中占的位数
     */
     private final long sequenceBits=12L;
    /**
     * 机器ID向左移12位
     */
    private final long workerIdShift=sequenceBits;
    /**
     * 数据标识id向左移动17
     */
    private final long dataCenterIdShift=sequenceBits+workerIdBits;
    /**
     * 时间戳向左移动的位数22位
     */
    private final long timestampLeftShift=sequenceBits+workerIdBits+dataCenterIdBits;
    /**
     * 生成序列的掩码,这里为4095
     */
    private final long sequenceMask=-1L^(-1L<<sequenceBits);

    /**
     *工作机器id(0~31)
     */
    private long workerId;
    /**
     * 数据中心id(0~31)
     */
    private long dataCenterId;
    /**
     *毫秒内序列(0~4095)
     */
    private long sequence=0L;
    /**
     *上次生成id的时间戳
     */
    private long lastTimestamp=-1L;

    public SnowflakeIdWorker(long workerId,long dataCenterId){
        if(workerId>maxWorkerId||workerId<0){
            throw new IllegalArgumentException(String.format("worker id can't be greater than %d or less than 0",workerId));
        }
        if(dataCenterId>maxDataCenterId||dataCenterId<0){
            throw new IllegalArgumentException(String.format("dataCenter id can't be greater than %d or less than 0",dataCenterId));
        }
        this.workerId=workerId;
        this.dataCenterId=dataCenterId;
    }

    /**
     *获得下一个id(线程安全)
     * @return
     */
    public synchronized long nextId(){
        long timestamp=timeGen();
        //如果当前时间小于上一次id生成的时间戳,说明系统时钟回退过这个时候,直接抛出异常
        if(timestamp<lastTimestamp){
           throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds",lastTimestamp-timestamp));
        }
        //如果是统一时间生成的,则进行毫秒内序列
        if(lastTimestamp==timestamp){
            sequence=(sequence+1)&sequenceMask;
            if(sequence==0){
                timestamp=tilNextMillis(lastTimestamp);
            }
        }else{
            sequence=0L;
        }
        lastTimestamp=timestamp;
        return ((timestamp-startTimestamp)<<timestampLeftShift)
                |(dataCenterId<<dataCenterIdShift)
                |(workerId<<workerIdShift)
                |sequence;
    }

    /**
     * 阻塞到下一个毫秒,直到获取到新的时间戳
     * @param lastTimestamp
     * @return
     */
    protected long tilNextMillis(long lastTimestamp){
       long timestamp=timeGen();
        while (timestamp<=lastTimestamp){
            timestamp=timeGen();
        }
        return timestamp;
    }
    protected long timeGen(){
        return System.currentTimeMillis();
    }

    public static void main(String[] args) throws InterruptedException {
        SnowflakeIdWorker worker=new SnowflakeIdWorker(10,20);
        ExecutorService pool= Executors.newFixedThreadPool(10);
        for(int i=0;i<200;i++){
            pool.submit(() -> System.out.println(Long.toBinaryString(worker.nextId())));
        }
        pool.shutdown();
        pool.awaitTermination(1, TimeUnit.SECONDS);
    }
}


text:
package cmd

import (
	"fmt"
	"os"
	"text/tabwriter"

	"github.com/cilium/cilium/pkg/command"

	"github.com/spf13/cobra"
)

// endpointLogCmd represents the endpoint_log command
var endpointLogCmd = &cobra.Command{
	Use:     "log <endpoint id>",
	Short:   "View endpoint status log",
	Example: "cilium endpoint log 5421",
	Run: func(cmd *cobra.Command, args []string) {
		requireEndpointID(cmd, args)
		getEndpointLog(cmd, args)
	},
}

func init() {
	endpointCmd.AddCommand(endpointLogCmd)
	command.AddJSONOutput(endpointLogCmd)
}

func getEndpointLog(cmd *cobra.Command, args []string) {
	requireEndpointID(cmd, args)
	eID := args[0]
	epLog, err := client.EndpointLogGet(eID)
	if err != nil {
		Fatalf("Cannot get endpoint log %s: %s\n", eID, err)
	}

	if command.OutputJSON() {
		if err := command.PrintOutput(epLog); err != nil {
			os.Exit(1)
		}
	} else {
		w := tabwriter.NewWriter(os.Stdout, 2, 0, 3, ' ', 0)
		fmt.Fprintf(w, "%s\t%s\t%s\t%v\n", "Timestamp", "Status", "State", "Message")
		for _, entry := range epLog {
			fmt.Fprintf(w, "%s\t%s\t%s\t%v\n", entry.Timestamp, entry.Code, entry.State, entry.Message)
		}
		w.Flush()
	}
}


text:
/**
 * @fileoverview Tests for no-ext-create rule.
 * @author Nat Burns
 */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var rule = require("../../../lib/rules/no-ext-create");
var RuleTester = require("eslint").RuleTester;
var tester = new RuleTester();

//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------

tester.run("no-ext-create", rule, {
	valid: [
		"var panel = new Ext.util.Something({ create: true });",
		"var panel = Ext.create(getDynamicClassName(), { config: true });"
	],
	invalid: [
		{
			code: "var panel = Ext.create('Ext.util.Something', { config: true });",
			errors: [
				{
					message: "Use new Ext.util.Something() rather than Ext.create('Ext.util.Something').",
					type: "CallExpression"
				}
			]
		}
	]
});


text:
namespace egl
{
class Display;

class Config
{
  public:
    Config(D3DDISPLAYMODE displayMode, EGLint minSwapInterval, EGLint maxSwapInterval, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat, EGLint multiSample, EGLBoolean fullscreen);

    void setDefaults();
    void set(D3DDISPLAYMODE displayMode, EGLint minSwapInterval, EGLint maxSwapInterval, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat, EGLint multiSample, EGLBoolean fullscreen);
    EGLConfig getHandle() const;

    const D3DDISPLAYMODE mDisplayMode;
    const D3DFORMAT mRenderTargetFormat;
    const D3DFORMAT mDepthStencilFormat;
    const EGLint mMultiSample;

    EGLint mBufferSize;              // Depth of the color buffer
    EGLint mRedSize;                 // Bits of Red in the color buffer
    EGLint mGreenSize;               // Bits of Green in the color buffer
    EGLint mBlueSize;                // Bits of Blue in the color buffer
    EGLint mLuminanceSize;           // Bits of Luminance in the color buffer
    EGLint mAlphaSize;               // Bits of Alpha in the color buffer
    EGLint mAlphaMaskSize;           // Bits of Alpha Mask in the mask buffer
    EGLBoolean mBindToTextureRGB;    // True if bindable to RGB textures.
    EGLBoolean mBindToTextureRGBA;   // True if bindable to RGBA textures.
    EGLenum mColorBufferType;        // Color buffer type
    EGLenum mConfigCaveat;           // Any caveats for the configuration
    EGLint mConfigID;                // Unique EGLConfig identifier
    EGLint mConformant;              // Whether contexts created with this config are conformant
    EGLint mDepthSize;               // Bits of Z in the depth buffer
    EGLint mLevel;                   // Frame buffer level
    EGLBoolean mMatchNativePixmap;   // Match the native pixmap format
    EGLint mMaxPBufferWidth;         // Maximum width of pbuffer
    EGLint mMaxPBufferHeight;        // Maximum height of pbuffer
    EGLint mMaxPBufferPixels;        // Maximum size of pbuffer
    EGLint mMaxSwapInterval;         // Maximum swap interval
    EGLint mMinSwapInterval;         // Minimum swap interval
    EGLBoolean mNativeRenderable;    // EGL_TRUE if native rendering APIs can render to surface
    EGLint mNativeVisualID;          // Handle of corresponding native visual
    EGLint mNativeVisualType;        // Native visual type of the associated visual
    EGLint mRenderableType;          // Which client rendering APIs are supported.
    EGLint mSampleBuffers;           // Number of multisample buffers
    EGLint mSamples;                 // Number of samples per pixel
    EGLint mStencilSize;             // Bits of Stencil in the stencil buffer
    EGLint mSurfaceType;             // Which types of EGL surfaces are supported.
    EGLenum mTransparentType;        // Type of transparency supported
    EGLint mTransparentRedValue;     // Transparent red value
    EGLint mTransparentGreenValue;   // Transparent green value
    EGLint mTransparentBlueValue;    // Transparent blue value
	EGLBoolean mFullscreen;			 // Whether this config supports fullscreen mode
};

// Function object used by STL sorting routines for ordering Configs according to [EGL] section 3.4.1 page 24.
class SortConfig
{
  public:
    explicit SortConfig(const EGLint *attribList);

    bool operator()(const Config *x, const Config *y) const;
    bool operator()(const Config &x, const Config &y) const;

  private:
    void scanForWantedComponents(const EGLint *attribList);
    EGLint wantedComponentsSize(const Config &config) const;

    bool mWantRed;
    bool mWantGreen;
    bool mWantBlue;
    bool mWantAlpha;
    bool mWantLuminance;
};

class ConfigSet
{
    friend Display;

  public:
    ConfigSet();

    void add(D3DDISPLAYMODE displayMode, EGLint minSwapInterval, EGLint maxSwapInterval, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat, EGLint multiSample, EGLBoolean fullscreen);
    size_t size() const;
    bool getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig);
    const egl::Config *get(EGLConfig configHandle);

  private:
    DISALLOW_COPY_AND_ASSIGN(ConfigSet);

    typedef std::set<Config, SortConfig> Set;
    typedef Set::iterator Iterator;
    Set mSet;

    static const EGLint mSortAttribs[];
};
}

#endif   // INCLUDE_CONFIG_H_


text:
<?php

/**
 * http://wiki.swoole.com/wiki/page/412.html
 * @param unknown $after_ms
 * @param unknown $callback
 * @param unknown $param
 * @return unknown id
 */
function swoole_timer_after($after_ms, $callback, $param){

}

/**
 * http://wiki.swoole.com/wiki/page/319.html
 * @param unknown $after_ms
 * @param unknown $callback
 * @param unknown $param
 * @return unknown id
 */
function swoole_timer_tick($after_ms, $callback, $param){

}

/**
 * http://wiki.swoole.com/wiki/page/387.html
 * @param unknown $id
 */
function swoole_timer_clear($id){

}


text:
package org.xmlcml.cmine.files;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import org.apache.commons.io.FileUtils;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Test;
import org.xmlcml.cmine.CMineFixtures;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

public class ResultsJsonTest {

	private static final Logger LOG = Logger.getLogger(ResultsJsonTest.class);

	static {
		LOG.setLevel(Level.DEBUG);
	}

	@Test
	public void testReadResultsJson() throws IOException {
		File file = new File(CMineFixtures.CMINE_DIR, "resultsJson");
		CTree ctree = new CTree(file);
		File resultsJson = ctree.getExistingResultsJSON();
		Assert.assertNotNull(resultsJson);
		String resultsJsonString = FileUtils.readFileToString(resultsJson);
	    JsonParser parser = new JsonParser();
	    JsonObject jsonObject = (JsonObject) parser.parse(resultsJsonString);
		Assert.assertEquals("{\"value\":[\"Trials\"]}", jsonObject.get("journal").toString());
	}

	@Test
	public void testReadResultsJsonKeys() throws IOException {
		File file = new File(CMineFixtures.CMINE_DIR, "resultsJson");
		String resultsJsonString = readResultsJsonString(file);
	    JsonParser parser = new JsonParser();
	    JsonObject jsonObject = (JsonObject) parser.parse(resultsJsonString);
	    Set<Map.Entry<String, JsonElement>> entrySet = jsonObject.entrySet();
	    Assert.assertEquals(19,  entrySet.size());
	    Iterator<Map.Entry<String, JsonElement>> entryIterator = entrySet.iterator();
	    Map<String, String> valueByKey = new HashMap<String, String>();
	    while(entryIterator.hasNext()) {
	    	Map.Entry<String, JsonElement> entry = entryIterator.next();
	    	String key = entry.getKey();
	    	JsonArray array = ((JsonObject)entry.getValue()).get("value").getAsJsonArray();
	    	if (array.size() == 0) {
	    		LOG.trace(key+"=null");
	    		continue;
	    	} else if (array.size() == 1) {
	    		String value = array.get(0).getAsString();
	    		LOG.trace(key+"="+value);
	    		valueByKey.put(key, value);
	    	} else {
	    		LOG.trace(key+"="+array.size()+"/"+array);
	    	}
	    }
	    Assert.assertEquals(11, valueByKey.size());
	}

	private String readResultsJsonString(File file) throws IOException {
		CTree ctree = new CTree(file);
		File resultsJson = ctree.getExistingResultsJSON();
		String resultsJsonString = FileUtils.readFileToString(resultsJson);
		return resultsJsonString;
	}

}


text:
package gw.internal.gosu.regression;

import gw.internal.gosu.parser.IGosuClassInternal;
import gw.lang.reflect.TypeSystem;
import gw.test.TestClass;

public class PL33465Test extends TestClass {
    public void testTemplateParserTextEndsWithPound() {
        IGosuClassInternal clazz = (IGosuClassInternal) TypeSystem.getByFullName("gw.internal.gosu.regression.Errant_PL33465TestClass");
        assertFalse(clazz.isValid());
    }

}


text:
namespace ECRAdmin.ProductsModule.Models
{
    public class ScaleProduct
    {
        public Product Product { get; set; }
        public ScaleSpecifications Specifications { get; set; }
    }
}


text:
<template name="login">
 {{#contentFor "headerButtonLeft"}}
    <button class="button button-clear pull-left" data-ion-menu-toggle="left" style="color: #fff;">
      {{#if isAndroid}}
        {{> ionIcon icon='android-more-vertical'}}
      {{else}}
        {{> ionIcon icon='navicon'}}
      {{/if}}
    </button>
  {{/contentFor}}
  {{#contentFor "headerTitle"}}

Register

    <button class="button button-clear pull-right">
      {{#if isAndroid}}
        {{> ionIcon icon='ion-android-add'}}
      {{else}}
        {{> ionIcon icon='ion-ios-plus-outline'}}
      {{/if}}
    </button>
  {{/contentFor}}
  {{#ionView}}
    {{#ionContent}}

Login

        <form class="login">

Email: <input type="email" name="email">

Password: <input type="password" name="password">

<input type="submit" value="Login">

        </form>

    {{/ionContent}}
  {{/ionView}}
</template>


text:
<?xml version="1.0" encoding="UTF-8"?>
<article id="1148">
	<title>The New Industrial State	</title>
	<author>Galbraith, J.K.	</author>
	<text>
		  During the fifties and sixties it had become customary to depict
		the economic system of the United States, along with its European
		and Japanese counterparts, as an accomplishment unique since the
		Creation.  This volume departed from the accustomed cheering.  It
		is my impression that the adult reader was always more skeptical
		than the economists of the neo-Keynesian nirvana.  Economic life
		was not meant to be that easy.  And perhaps some sensed what I here
		urge, that what was called success was less what served the
		individual than what served the goals of great industrial and
		military bureaucracies which had come, the economic myth notwithstanding,
		to comprise so large a part of the economic system.  Still, who could
		tell that a herald of such news would be welcomed - or even heard.
	</text>
</article>


text:
// // --------------------------------------------------------------------------------------------------------------------
// // <copyright file="HLI.Forms.NullToDateTimeConverter.cs" company="HL Interactive">
// //   Copyright © HL Interactive, Stockholm, Sweden, 2016
// // </copyright>
// // --------------------------------------------------------------------------------------------------------------------

using System;
using System.Globalization;

using Xamarin.Forms;

namespace HLI.Forms.Core.Converters
{
    /// <summary>
    ///     Prevents DateTime? from being breaking Xamarin Forms by returning DateTime.Now instead of <c>null</c>
    /// </summary>
    public class NullToDateTimeConverter : IValueConverter
    {
        #region Implementation of IValueConverter

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value ?? DateTime.Now;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }

        #endregion
    }
}


text:
package me.yawn.eos.event;

import me.yawn.eos.event.Event;

import java.util.HashMap;
import java.util.LinkedHashMap;

/**
 * Created by yawn on 12/5/2014.
 */
public class EventManager {

    public static HashMap<Event, Boolean> eventList = new LinkedHashMap<>();

    public static HashMap<Event, Boolean> getEventList() {
        return eventList;
    }

    /*
    But Yawn, How do I register my events!!!!!!
    simple yUng gods..
     */
    /*
    make ur own dont use mine btw
     */
    public static void registerSampleEvents(){
        new SampleEvent();
    }
    // ez.

}


text:
#ifndef CACHEDFRAME_H		// -*- c++ -*-
#define CACHEDFRAME_H
///
// Copyright (C) 2002 - 2004, Fredrik Arnerup & Rasmus Kaj, See COPYING
///
#include "basicframe.h"
#include <sigc++/slot.h>

/**
 * A frame that is represented in postscript.  This may be a referenced EPS
 * file, or a text frame (that is made into postscript code by TextStream and
 * xml2ps).  This interface is mainly used by PostscriptViewent.
 */
class CachedFrame: public BasicFrame {
public:
  CachedFrame(Group *parent, const std::string &name);
  CachedFrame(const ElementWrap& xml, Group *parent);

  virtual void generate_picture(std::ostream& psstream) const = 0;
};

#endif


text:
This example uses the NetExport and FireBug Firefox extensions to save the details of the browsers
interaction with a website.

Note that we are reusing the script from 17.simplesteps. The difference is that the JNLP file sets the
value:

```
<property name="jnlp.webdriver.firefox.profile" value="selenium" />
```

To make use of this profile you will need to compete the following steps:

1. Create a local Firefox profile called `selenium` using the instructions at https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles
2. Open about:config
3. Set `xpinstall.signatures.required` to false
4. Install Firebug https://addons.mozilla.org/en-US/firefox/addon/firebug/ and NetExport http://www.softwareishard.com/blog/netexport/
5. Open about:config
6. Configure the following settings:
   * extensions.firebug.console.enableSites: true
   * extensions.firebug.script.enableSites: true
   * extensions.firebug.net.enableSites: true
   * extensions.firebug.previousPlacement: 1
   * extensions.firebug.allPagesActivation: on
   * extensions.firebug.netexport.alwaysEnableAutoExport: true
   * extensions.firebug.netexport.defaultLogDir: <your output directory>


text:
package com.lynx.content;

public class LynxContent {

    public void Initialize() {
        nativeInitialize();
    }

    private native void nativeInitialize();
}


text:
<title>tableau des communes</title>
<link rel="stylesheet" type="text/css" href="/css/dgcp3.css">
<link rel="stylesheet" type="text/css" href="/css/global.css">

Les Comptes des Communes

- données BPS exprimées en euros -

Retour -
Retour Menu

	Imprimer

			ANALYSE DES EQUILIBRES FINANCIERS FONDAMENTAUX	2014

DEPARTEMENT : LOIRET
		ORLEANS

Population légale en vigueur au 1er janvier de l'exercice : 117 988 habitants

Budget principal seul

    En milliers d'Euros
    Euros par habitant
		    Moyenne de la strate

								communes de plus de 100 000 hab
appartenant à un groupement fiscalisé (FPU)
		Ratios de structure
		    Moyenne de la strate

		    OPERATIONS DE FONCTIONNEMENT

    177 973
    1 508
			    1 427
		    TOTAL DES PRODUITS DE FONCTIONNEMENT = A
    en % des produits

    78 960
    669
			    593
		    dont : Impôts Locaux
    44,37
			    41,58

    6 837
    58
			    104
		    Autres impôts et taxes
    3,84
			    7,30

    34 364
    291
			    264
		    Dotation globale de fonctionnement
    19,31
			    18,50

    164 278
    1 392
		    1 343
		    TOTAL DES CHARGES DE FONCTIONNEMENT = B
    en % des charges

    78 955
    669
			    703
		    dont : Charges de personnel
    48,06
			    52,36

    32 426
    275
			    257
		    Achats et charges externes
    19,74
			    19,15

    2 294
    19
			    39
		    Charges financières
    1,40
			    2,88

    222
    2
			    30
		    Contingents
    0,14
			    2,23

    25 526
    216
			    168
		    Subventions versées
    15,54
			    12,54

    13 695
    116
		    84
		    RESULTAT COMPTABLE = A - B = R

		    OPERATIONS D'INVESTISSEMENT

    64 543
    547
			    565
		    TOTAL DES RESSOURCES D'INVESTISSEMENT = C
    en % des ressources

    9 249
    78
			    150
		    dont : Emprunts bancaires et dettes assimilées
    14,33
			    26,65

    9 744
    83
			    61
		    Subventions reçues
    15,10
			    10,84

    6 704
    57
			    40
		    FCTVA
    10,39
			    7,13

    0
    0
			    0
		    Retour de biens affectés, concédés, ...
    0,00
			    0,00

    59 005
    500
		    541
		    TOTAL DES EMPLOIS D'INVESTISSEMENT = D
    en % des emplois

    45 118
    382
			    338
		    dont : Dépenses d'équipement
    76,46
			    62,45

    12 608
    107
			    106
		    Remboursement d'emprunts et dettes assimilées
    21,37
			    19,61

    0
    0
			    2
		    Charges à répartir
    0,00
			    0,28

    0
    0
			    0
		    Immobilisations affectées, concédées, ...
    0,00
			    0,00

    -5 537
    -47
		    -23
		    Besoin ou capacité de financement Résiduel de la section d'investissement = D - C

    0
    0
		    -0
		    + Solde des opérations pour le compte de tiers

    -5 537
    -47
		    -24
		    = Besoin ou capacité de financement de la section d'investissement = E

    19 233
    163
		    108
		    Résultat d'ensemble = R - E

		    AUTOFINANCEMENT
    en % des prod. de fonct.

    32 519
    276
			    191
		    Excédent brut de fonctionnement
    18,27
			    13,37

    29 644
    251
			    147
		    Capacité d'autofinancement = CAF
    16,66
			    10,32

    17 036
    144
			    41
		    CAF nette du remboursement en capital des emprunts
    9,57
			    2,89

		    ENDETTEMENT
    en % des prod. de fonct.

    97 863
    829
			    1 176
		    Encours total de la dette au 31/12/N
    54,99
			    82,38

    14 780
    125
			    139
		    Annuité de la dette
    8,30
			    9,76

    5 198
    44
			    41
		    FONDS DE ROULEMENT

ELEMENTS DE FISCALITE DIRECTE LOCALE

	Les bases imposées et les réductions (exonérations, abattements) accordées sur délibérations

	Bases nettes imposées au profit de la commune
	Taxe
	Réductions de bases accordées sur délibérations

    En milliers d'Euros
    En euros par habitant

		    Moyenne de la strate
		    		En milliers d'Euros
    En euros par habitant

		    Moyenne de la strate

    154 364
    1 308
			    1 317
		    Taxe d'habitation (y compris THLV)
    33 849

	   287
												227

    154 047
    1 306
			    1 344
		    Taxe foncière sur les propriétés bâties
    0

	    0
												0

    206
    2
			    4
		    Taxe foncière sur les propriétés non bâties
    0

	    0
												0

	0
	0
		0
		Taxe additionnelle à la taxe foncière sur les propriétés non bâties
	 -

	 -
		 -

    0
    0
			    0
						Cotisation foncière des entreprises
		    0

	    0
												0

	Les taux et les produits de la fiscalité directe locale

	Produits des impôts locaux
	Taxe

			Taux voté
	Taux moyen de la strate

    32 401
    275
			    277
		    Taxe d'habitation (y compris THLV)
		    20,99%
			  21,01%

    45 922
    389
			    310
		    Taxe foncière sur les propriétés bâties
		    29,81%
			   23,07%

    82
    1
			    1
		    Taxe foncière sur les propriétés non bâties
		    39,60%
			   35,33%

	0
	0
		0

		Taxe additionnelle à la taxe foncière sur les propriétés non bâties
		0,00%
			0,00%

    0
    0
			    0
				Cotisation foncière des entreprises
			    0,00%
			   0,00%

	Les produits des impôts de répartition

	Produits des impôts de répartition
	Taxe

	0
	0
		0
		Cotisation sur la valeur ajoutée des entreprises
		 -
		 -

	0
	0
		0
		Impositions forfaitaires sur les entreprises de réseau
		 -
		 -

	0
	0
		0
		Taxe sur les surfaces commerciales
		 -
		 -


text:
class TestMrubyRedmineActivity < MTest::Unit::TestCase
  def test_main
    assert_nil __main__([])
  end
end

MTest::Unit.new.run


text:
#include "set/hdr_intrusive_set.h"
#include <cds/urcu/general_instant.h>
#include <cds/intrusive/michael_list_rcu.h>
#include <cds/intrusive/michael_set_rcu.h>

namespace set {

    namespace {
        typedef cds::urcu::gc< cds::urcu::general_instant<> >   RCU ;
    }

    void IntrusiveHashSetHdrTest::RCU_GPI_base_cmp()
    {
        typedef base_int_item< ci::michael_list::node<RCU> > item ;
        typedef ci::MichaelList< RCU
            ,item
            ,ci::michael_list::make_traits<
                ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
                ,co::compare< cmp<item> >
                ,ci::opt::disposer< faked_disposer >
            >::type
        >    bucket_type    ;

        typedef ci::MichaelHashSet< RCU, bucket_type,
            ci::michael_set::make_traits<
                co::hash< hash_int >
            >::type
        > set ;

        test_rcu_int<set>()    ;
    }

    void IntrusiveHashSetHdrTest::RCU_GPI_base_less()
    {
        typedef base_int_item< ci::michael_list::node<RCU> > item ;
        typedef ci::MichaelList< RCU
            ,item
            ,ci::michael_list::make_traits<
                ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
                ,co::less< less<item> >
                ,ci::opt::disposer< faked_disposer >
            >::type
        >    bucket_type    ;

        typedef ci::MichaelHashSet< RCU, bucket_type,
            ci::michael_set::make_traits<
                co::hash< hash_int >
            >::type
        > set ;

        test_rcu_int<set>()    ;
    }

    void IntrusiveHashSetHdrTest::RCU_GPI_base_cmpmix()
    {
        typedef base_int_item< ci::michael_list::node<RCU> > item ;
        typedef ci::MichaelList< RCU
            ,item
            ,ci::michael_list::make_traits<
                ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
                ,co::less< less<item> >
                ,co::compare< cmp<item> >
                ,ci::opt::disposer< faked_disposer >
            >::type
        >    bucket_type    ;

        typedef ci::MichaelHashSet< RCU, bucket_type,
            ci::michael_set::make_traits<
                co::hash< hash_int >
                ,co::item_counter< simple_item_counter >
            >::type
        > set ;

        test_rcu_int<set>()    ;
    }

    void IntrusiveHashSetHdrTest::RCU_GPI_member_cmp()
    {
        typedef member_int_item< ci::michael_list::node<RCU> > item ;
        typedef ci::MichaelList< RCU
            ,item
            ,ci::michael_list::make_traits<
                ci::opt::hook< ci::michael_list::member_hook<
                    offsetof( item, hMember ),
                    co::gc<RCU>
                > >
                ,co::compare< cmp<item> >
                ,ci::opt::disposer< faked_disposer >
            >::type
        >    bucket_type    ;

        typedef ci::MichaelHashSet< RCU, bucket_type,
            ci::michael_set::make_traits<
                co::hash< hash_int >
            >::type
        > set ;

        test_rcu_int<set>()    ;
    }

    void IntrusiveHashSetHdrTest::RCU_GPI_member_less()
    {
        typedef member_int_item< ci::michael_list::node<RCU> > item ;
        typedef ci::MichaelList< RCU
            ,item
            ,ci::michael_list::make_traits<
                ci::opt::hook< ci::michael_list::member_hook<
                    offsetof( item, hMember ),
                    co::gc<RCU>
                > >
                ,co::less< less<item> >
                ,ci::opt::disposer< faked_disposer >
            >::type
        >    bucket_type    ;

        typedef ci::MichaelHashSet< RCU, bucket_type,
            ci::michael_set::make_traits<
                co::hash< hash_int >
            >::type
        > set ;

        test_rcu_int<set>()    ;
    }

    void IntrusiveHashSetHdrTest::RCU_GPI_member_cmpmix()
    {
        typedef member_int_item< ci::michael_list::node<RCU> > item ;
        typedef ci::MichaelList< RCU
            ,item
            ,ci::michael_list::make_traits<
                ci::opt::hook< ci::michael_list::member_hook<
                    offsetof( item, hMember ),
                    co::gc<RCU>
                > >
                ,co::compare< cmp<item> >
                ,co::less< less<item> >
                ,ci::opt::disposer< faked_disposer >
            >::type
        >    bucket_type    ;

        typedef ci::MichaelHashSet< RCU, bucket_type,
            ci::michael_set::make_traits<
                co::hash< hash_int >
                ,co::item_counter< simple_item_counter >
            >::type
        > set ;

        test_rcu_int<set>()    ;
    }

} // namespace set


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

using System;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;

namespace Tempest.Providers.Network
{
	class NetworkClientSimulator
		: IClientConnection
	{
		private readonly NetworkClientConnection connection;

		public NetworkClientSimulator (NetworkClientConnection connection)
		{
			if (connection == null)
				throw new ArgumentNullException ("connection");

			this.connection = connection;
		}

		public MessageTypes SendPacketLossTypes
		{
			get; set;
		}

		/// <summary>
		/// Gets or sets simulated packet loss sending. 0.0 to 1.0.
		/// </summary>
		public double SendPacketLoss
		{
			get { return this.sendPacketLoss; }
			set
			{
				if (value < 0 || value > 1)
					throw new ArgumentOutOfRangeException ("value", "value must be equal to or between 0.0 and 1.0");

				this.sendPacketLoss = value;
			}
		}

		public void Dispose()
		{
			this.connection.Dispose();
		}

		public bool IsConnected
		{
			get { return this.connection.IsConnected; }
		}

		public long ConnectionId
		{
			get;
			private set;
		}

		public IEnumerable<Protocol> Protocols
		{
			get { return this.connection.Protocols; }
		}

		public int ResponseTime
		{
			get { return this.connection.ResponseTime; }
		}

		public MessagingModes Modes
		{
			get { return this.connection.Modes; }
		}

		public EndPoint RemoteEndPoint
		{
			get { return this.connection.RemoteEndPoint; }
		}

		public IAsymmetricKey RemoteKey
		{
			get { return this.connection.RemoteKey; }
		}

		public event EventHandler<MessageEventArgs> MessageReceived
		{
			add { this.connection.MessageReceived += value; }
			remove { this.connection.MessageReceived -= value; }
		}

		public event EventHandler<MessageEventArgs> MessageSent
		{
			add { this.connection.MessageSent += value; }
			remove { this.connection.MessageSent -= value; }
		}

		public event EventHandler<DisconnectedEventArgs> Disconnected
		{
			add { this.connection.Disconnected += value; }
			remove { this.connection.Disconnected -= value;}
		}

		public event EventHandler<ClientConnectionEventArgs> Connected
		{
			add { this.connection.Connected += value; }
			remove { this.connection.Connected -= value; }
		}

		public void Send (Message message)
		{
			if (this.sendPacketLoss > 0 && ((message.MustBeReliable && (SendPacketLossTypes & MessageTypes.Reliable) == MessageTypes.Reliable)
											|| (!message.MustBeReliable && (SendPacketLossTypes & MessageTypes.Unreliable) == MessageTypes.Unreliable)))
			{
				double v;
				lock (random)
					v = random.NextDouble();

				if (v < this.sendPacketLoss)
					return;
			}

			this.connection.Send (message);
		}

		public Task<TResponse> SendFor<TResponse> (Message message, int timeout = 0) where TResponse : Message
		{
			throw new NotImplementedException();
		}

		public void SendResponse (Message originalMessage, Message response)
		{
			throw new NotImplementedException();
		}

		public IEnumerable<MessageEventArgs> Tick()
		{
			return this.connection.Tick();
		}

		public void Disconnect()
		{
			this.connection.Disconnect();
		}

		public void Disconnect (ConnectionResult reason, string customReason)
		{
			this.connection.Disconnect (reason, customReason);
		}

		public void DisconnectAsync()
		{
			this.connection.DisconnectAsync();
		}

		public void DisconnectAsync (ConnectionResult reason, string customReason)
		{
			this.connection.DisconnectAsync (reason, customReason);
		}

		public Task<ConnectionResult> ConnectAsync (EndPoint endpoint, MessageTypes messageTypes)
		{
			return this.connection.ConnectAsync (endpoint, messageTypes);
		}

		private double sendPacketLoss;
		private readonly Random random = new Random();
	}
}


text:
"""Simple LDraw Model Parser.

Copyright (c) 2015 Tribex

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

"""

from __future__ import print_function

import os
import fnmatch

__all__ = ("LDRParser")

class LDRParser:
    version = ("0", "1", "0")
    ControlCodes = ("COMMENT", "SUBPART", "LINE", "TRI", "QUAD", "OPTLINE")

    options = {
        "skip": [],
        "logLevel": 0
    }

    def __init__(self, libraryLocation, options={}):
        self.libraryLocation = libraryLocation
        self.modelFile = None
        self.__parts = {}
        self.options.update(options)

    @staticmethod
    def __locate(pattern, root=os.curdir):
        for path, dirs, files in os.walk(os.path.abspath(root)):
            for filename in fnmatch.filter(files, pattern):
                yield os.path.join(path, filename)

    @staticmethod
    def __convert(vals):
        for i in range(0, len(vals)):
            line = vals[i]
            # Floats
            if "." in line and "dat" not in line.lower():
                vals[i] = float(line)
            else:
                try:
                    # Integers
                    vals[i] = int(line)
                # Strings
                except ValueError:
                    pass
        return vals

    def log(self, string, level=0):
        """Log debug messages to the console.

        @param {String} string The message to be displayed.
        @param {Number} level Specify the message verbosity level.
                              If the specified level is less than
                              or equal to the level given in the options,
                              the message will be printed.
        """
        if self.options["logLevel"] >= level:
            print("[LDRParser] {0}".format(string))

    def parse(self, modelFile):
        # Set the model to be read
        self.modelFile = modelFile

        # Display the line types we are going to skip parsing.
        if len(self.options["skip"]) > 0:
            self.log("Skip line type(s): {0}".format(
                     ", ".join(self.options["skip"])), 5)

        # This can load any valid file on the LDraw path
        # with the specified name, not just a full path.
        filePath = self.findFile(self.modelFile)

        # The file could not be found.
        if filePath is None:
            self.log("Critical Error - File Not Found: {0}".format(
                     self.modelFile), 0)
            return None

        # Begin parsing the model and all the parts.
        self.log("Reading Initial File: {0}".format(filePath), 3)
        with open(filePath, "rt") as f:
            root = self.buildPartData(f.read())
        root["parts"] = self.__parts

        self.log("Completed Parsing File: {0}".format(filePath), 3)
        return root

    def buildPartData(self, ldrString):
        definition = {}
        lines = ldrString.splitlines()

        for line in lines:
            # Determine the type of line this is.
            ctrl = int(line.lstrip()[0] if line.lstrip() else -1)

            # Ignore invalid line types
            if ctrl == -1:
                continue

            # Determine the control code
            code = self.ControlCodes[ctrl]

            # Always parse comments so we can get the part type
            comment = self.parseComment(line)
            if comment is not None and comment.startswith("!LDRAW_ORG"):
                definition["partType"] = self.getPartType(comment)

            # We are not skipping this line type.
            if code not in self.options["skip"]:

                # Include the comments.
                if code == "COMMENT":
                    if "comments" not in definition:
                        definition["comments"] = []

                    # Make sure there is a comment to add
                    if comment is not None:
                        definition["comments"].append(comment)

                # Parse the subparts.
                elif code == "SUBPART":
                    if "subparts" not in definition:
                        definition["subparts"] = []
                    definition["subparts"].append(self.parsePart(line))

                # Parse the straight lines.
                elif code == "LINE":
                    if "lines" not in definition:
                        definition["lines"] = []
                    definition["lines"].append(self.parseLine(line))

                # Parse the triangles.
                elif code == "TRI":
                    if "tris" not in definition:
                        definition["tris"] = []
                    definition["tris"].append(self.parseTri(line))

                # Parse the quadrilaterals.
                elif code == "QUAD":
                    if "quads" not in definition:
                        definition["quads"] = []
                    definition["quads"].append(self.parseQuad(line))

                # Parse the optional lines.
                elif code == "OPTLINE":
                    if "optlines" not in definition:
                        definition["optlines"] = []
                    definition["optlines"].append(self.parseOptLine(line))

        return definition

    def getPartType(self, line):
        return line.split()[1]

    def parsePart(self, line):
        myDef = {}
        splitLine = self.__convert(line.split())

        myDef["color"] = splitLine[1]
        myDef["matrix"] = (
            splitLine[5],  splitLine[6],  splitLine[7],  splitLine[2],
            splitLine[8],  splitLine[9],  splitLine[10], splitLine[3],
            splitLine[11], splitLine[12], splitLine[13], splitLine[4],
            0,             0,             0,             1,
        )
        myDef["partId"] = self.formatPartName(" ".join(splitLine[14:]))

        # The part is not in the cache.
        if myDef["partId"] not in self.__parts:
            filePath = self.findFile(myDef["partId"])

            # We have a file path.
            if filePath is not None:
                self.log("Caching Part: {0}".format(filePath), 4)

                # Read and cache the part contents.
                with open(filePath, "rt") as f:
                    self.__parts[myDef["partId"]] = \
                        self.buildPartData(f.read())

        return myDef

    def parseComment(self, comment):
        """Perform basic comment processing, including
        minor filtering and cleanup.

        @param {String} comment The comment to process.
        @return {!String} The cleaned comment, or None if it was filtered.
        """
        # Strip the prefix
        comment = comment.strip().lstrip("0 ")

        # Filter out archaic META commands, blank lines, and comments
        # See http://www.ldraw.org/article/218/#meta
        lineFilter = ("", "STEP", "WRITE", "PRINT", "CLEAR", "PAUSE", "SAVE")
        if comment in lineFilter or comment.startswith("//"):
            return None
        return comment

    def parseLine(self, line):
        splitLine = self.__convert(line.split())
        myDef = {
            "color": splitLine[1],
            "pos1": (splitLine[2], splitLine[3], splitLine[4]),
            "pos2": (splitLine[5], splitLine[6], splitLine[7]),
        }
        return myDef

    def parseTri(self, line):
        splitLine = self.__convert(line.split())
        myDef = {
            "color": splitLine[1],
            "pos1": (splitLine[2], splitLine[3], splitLine[4]),
            "pos2": (splitLine[5], splitLine[6], splitLine[7]),
            "pos3": (splitLine[8], splitLine[9], splitLine[10]),
        }
        return myDef

    def parseQuad(self, line):
        splitLine = self.__convert(line.split())
        myDef = {
            "color": splitLine[1],
            "pos1": (splitLine[2], splitLine[3], splitLine[4]),
            "pos2": (splitLine[5], splitLine[6], splitLine[7]),
            "pos3": (splitLine[8], splitLine[9], splitLine[10]),
            "pos4": (splitLine[11], splitLine[12], splitLine[13]),
        }
        return myDef

    def parseOptLine(self, line):
        splitLine = self.__convert(line.split())
        myDef = {
            "color": splitLine[1],
            "pos1": (splitLine[2], splitLine[3], splitLine[4]),
            "pos2": (splitLine[5], splitLine[6], splitLine[7]),
            "ctl1": (splitLine[8], splitLine[9], splitLine[10]),
            "ctl2": (splitLine[11], splitLine[12], splitLine[13]),
        }
        return myDef

    def findFile(self, partPath):
        """Locate a part in the LDraw parts installation.

        @param {String} partPath The part name that needs to be located.
        @return {String} The full file path to the given part.
        """
        locatedFile = None

        # In the order we search:
        #  * Files relative to the main file
        #  * Models folder
        #  * Unofficial parts (parts and p subfolders)
        #  * Parts folder
        #  * p folder
        paths = [
            os.path.join(os.path.dirname(os.path.abspath(self.modelFile)),
                         partPath),
            os.path.join(self.libraryLocation, "models", partPath),
            os.path.join(self.libraryLocation, "Unofficial", "parts",
                         partPath),
            os.path.join(self.libraryLocation, "Unofficial", "p", partPath),
            os.path.join(self.libraryLocation, "parts", partPath),
            os.path.join(self.libraryLocation, "p", partPath)
        ]

        # Try the current directory.
        if os.path.isfile(partPath):
            locatedFile = partPath

        # Now lets check the list of paths we built earlier.
        if not locatedFile:
            for path in paths:
                if os.path.isfile(path):
                    locatedFile = path
                    break

        # Failing that, recursively search through every directory
        # in the library folder for the file.
        if not locatedFile:
            for f in self.__locate(os.path.basename(partPath),
                                   self.libraryLocation):
                locatedFile = f
                break

        # We are totally unable to find that part.
        if not locatedFile:
            self.log("Error: File not found: {0}".format(partPath), 1)

        return locatedFile

    def formatPartName(self, partName):
        """Clean up any path seperators
        to be consistent with the platform
        and convert the file name to lowercase.

        @param {String} The part path to clean up.
        @return {String}
        """
        return partName.lower().replace("\\",
                                        os.path.sep).replace("/",
                                                             os.path.sep)


text:
import Ember from 'ember';
import layout from '../templates/components/ember-tree';

const {
  computed,
  run
} = Ember;

export default Ember.Component.extend({
  layout: layout,
  tagName: 'ul',
  classNames: ['ember-tree-children'],
  attributeBindings: ['role'],
  role: 'group',

  childrenKey: 'children',
  eagerCreate: true,
  expandEvent: 'click',
  showRest: false,
  isExpanded: computed.alias('node.isExpanded'),
  showOtherTextFmt: 'Show Other %@',
  showOnly: false,

  didInsertElement(){
    const $areaExpand = Ember.$(this.$().find('.ember-tree-node-trigger-expand')[0]);
    const expandEvent = this.get('expandEvent');

    if (!$areaExpand){
      console.warn("your tree component won't be expandable unless you nest {{ember-tree/trigger-expand}} component in it");
      return;
    }

    this.set('$areaExpand', $areaExpand);
    $areaExpand.on(expandEvent, ()=>{
      run(()=>{
        if (this.get('expandAction')){
          this.sendAction('expandAction', this.get('node'), !this.get('isExpanded'));
        } else {
          Ember.set(this.get('node'), 'isExpanded', !this.get('isExpanded'));
        }
      });
    });
  },

  willInsertElement(){
    const $areaExpand = this.get('$areaExpand');

    if ($areaExpand){
      $areaExpand.off(this.get('expandEvent'));
    }
  },

  children: computed('node', 'childrenKey', 'showOnly', function(){
    const key = this.get('childrenKey');
    const children = this.get('node')[key];

    if (!children){
      return [];
    }

    var showOnly = this.get('showOnly');
    showOnly = showOnly ? showOnly : children.length;
    return children.slice(0, showOnly);
  }),

  childrenRest: computed('node', 'childrenKey', 'showOnly', function(){
    const key = this.get('childrenKey');
    const showOnly = this.get('showOnly');
    const children = this.get('node')[key];

    if (!children){
      return [];
    }

    return children.slice(showOnly, children.length);
  }),

  showOtherText: computed('showOtherTextFmt', 'showOnly', 'childrenRest.length', function(){
    const showOnly = this.get('showOnly');
    const showOtherTextFmt = this.get('showOtherTextFmt');
    const numberLeft = this.get('childrenRest.length');

    if (!showOnly || !numberLeft){
      return '';
    }
    return Ember.String.fmt(showOtherTextFmt, numberLeft);
  }),

  hasRest: computed('showOnly', 'childrenRest.length', function(){
    return !!this.get('showOnly') && !!this.get('childrenRest.length');
  }),

  actions: {
    showOther(){
      this.toggleProperty('showRest');
    },

    expandChild(node, isExpanded){
      if (this.get('expandAction')){
        this.sendAction('expandAction', node, isExpanded);
      } else {
        Ember.set(node, 'isExpanded', isExpanded);
      }
    }
  }
});


text:
module.exports = {
  recursive: false,
  directory: '.',
  time: 30,
  acm: false
}


text:
/// Json-cpp amalgamated forward header (http://jsoncpp.sourceforge.net/).
/// It is intended to be used with #include "json/json-forwards.h"
/// This header provides forward declaration for all JsonCpp types.

// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: LICENSE
// //////////////////////////////////////////////////////////////////////

// //////////////////////////////////////////////////////////////////////
// End of content of file: LICENSE
// //////////////////////////////////////////////////////////////////////

#ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED
# define JSON_FORWARD_AMALGAMATED_H_INCLUDED
/// If defined, indicates that the source file is amalgamated
/// to prevent private header inclusion.
#define JSON_IS_AMALGAMATION

// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: include/json/version.h
// //////////////////////////////////////////////////////////////////////

#ifndef JSON_VERSION_H_INCLUDED
#define JSON_VERSION_H_INCLUDED

// Note: version must be updated in three places when doing a release. This
// annoying process ensures that amalgamate, CMake, and meson all report the
// correct version.
// 1. /meson.build
// 2. /include/json/version.h
// 3. /CMakeLists.txt
// IMPORTANT: also update the SOVERSION!!

#define JSONCPP_VERSION_STRING "1.9.5"
#define JSONCPP_VERSION_MAJOR 1
#define JSONCPP_VERSION_MINOR 9
#define JSONCPP_VERSION_PATCH 5
#define JSONCPP_VERSION_QUALIFIER
#define JSONCPP_VERSION_HEXA                                                   \
  ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) |             \
   (JSONCPP_VERSION_PATCH << 8))

#ifdef JSONCPP_USING_SECURE_MEMORY
#undef JSONCPP_USING_SECURE_MEMORY
#endif
#define JSONCPP_USING_SECURE_MEMORY 0
// If non-zero, the library zeroes any memory that it has allocated before
// it frees its memory.

#endif // JSON_VERSION_H_INCLUDED

// //////////////////////////////////////////////////////////////////////
// End of content of file: include/json/version.h
// //////////////////////////////////////////////////////////////////////

// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: include/json/allocator.h
// //////////////////////////////////////////////////////////////////////

// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE

#ifndef JSON_ALLOCATOR_H_INCLUDED
#define JSON_ALLOCATOR_H_INCLUDED

#include <cstring>
#include <memory>

#pragma pack(push, 8)

namespace Passenger {
namespace Json {
template <typename T> class SecureAllocator {
public:
  // Type definitions
  using value_type = T;
  using pointer = T*;
  using const_pointer = const T*;
  using reference = T&;
  using const_reference = const T&;
  using size_type = std::size_t;
  using difference_type = std::ptrdiff_t;

  /**
   * Allocate memory for N items using the standard allocator.
   */
  pointer allocate(size_type n) {
    // allocate using "global operator new"
    return static_cast<pointer>(::operator new(n * sizeof(T)));
  }

  /**
   * Release memory which was allocated for N items at pointer P.
   *
   * The memory block is filled with zeroes before being released.
   */
  void deallocate(pointer p, size_type n) {
    // memset_s is used because memset may be optimized away by the compiler
    memset_s(p, n * sizeof(T), 0, n * sizeof(T));
    // free using "global operator delete"
    ::operator delete(p);
  }

  /**
   * Construct an item in-place at pointer P.
   */
  template <typename... Args> void construct(pointer p, Args&&... args) {
    // construct using "placement new" and "perfect forwarding"
    ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
  }

  size_type max_size() const { return size_t(-1) / sizeof(T); }

  pointer address(reference x) const { return std::addressof(x); }

  const_pointer address(const_reference x) const { return std::addressof(x); }

  /**
   * Destroy an item in-place at pointer P.
   */
  void destroy(pointer p) {
    // destroy using "explicit destructor"
    p->~T();
  }

  // Boilerplate
  SecureAllocator() {}
  template <typename U> SecureAllocator(const SecureAllocator<U>&) {}
  template <typename U> struct rebind { using other = SecureAllocator<U>; };
};

template <typename T, typename U>
bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
  return true;
}

template <typename T, typename U>
bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
  return false;
}

} // namespace Json
} // namespace Passenger

#pragma pack(pop)

#endif // JSON_ALLOCATOR_H_INCLUDED

// //////////////////////////////////////////////////////////////////////
// End of content of file: include/json/allocator.h
// //////////////////////////////////////////////////////////////////////

// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: include/json/config.h
// //////////////////////////////////////////////////////////////////////

// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE

#ifndef JSON_CONFIG_H_INCLUDED
#define JSON_CONFIG_H_INCLUDED
#include <cstddef>
#include <cstdint>
#include <istream>
#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#include <type_traits>

// If non-zero, the library uses exceptions to report bad input instead of C
// assertion macros. The default is to use exceptions.
#ifndef JSON_USE_EXCEPTION
#define JSON_USE_EXCEPTION 1
#endif

// Temporary, tracked for removal with issue #982.
#ifndef JSON_USE_NULLREF
#define JSON_USE_NULLREF 1
#endif

/// If defined, indicates that the source file is amalgamated
/// to prevent private header inclusion.
/// Remarks: it is automatically defined in the generated amalgamated header.
// #define JSON_IS_AMALGAMATION

// Export macros for DLL visibility
#if defined(JSON_DLL_BUILD)
#if defined(_MSC_VER) || defined(__MINGW32__)
#define JSON_API __declspec(dllexport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#elif defined(__GNUC__) || defined(__clang__)
#define JSON_API __attribute__((visibility("default")))
#endif // if defined(_MSC_VER)

#elif defined(JSON_DLL)
#if defined(_MSC_VER) || defined(__MINGW32__)
#define JSON_API __declspec(dllimport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#endif // if defined(_MSC_VER)
#endif // ifdef JSON_DLL_BUILD

#if !defined(JSON_API)
#define JSON_API
#endif

#if defined(_MSC_VER) && _MSC_VER < 1800
#error                                                                         \
    "ERROR:  Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
#endif

#if defined(_MSC_VER) && _MSC_VER < 1900
// As recommended at
// https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
extern JSON_API int msvc_pre1900_c99_snprintf(char* outBuf, size_t size,
                                              const char* format, ...);
#define jsoncpp_snprintf msvc_pre1900_c99_snprintf
#else
#define jsoncpp_snprintf std::snprintf
#endif

// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
// integer
// Storages, and 64 bits integer support is disabled.
// #define JSON_NO_INT64 1

// JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.
// C++11 should be used directly in JSONCPP.
#define JSONCPP_OVERRIDE override

#ifdef __clang__
#if __has_extension(attribute_deprecated_with_message)
#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
#endif
#elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc)
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
#endif                  // GNUC version
#elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates
                        // MSVC)
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
#endif // __clang__ || __GNUC__ || _MSC_VER

#if !defined(JSONCPP_DEPRECATED)
#define JSONCPP_DEPRECATED(message)
#endif // if !defined(JSONCPP_DEPRECATED)

#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6))
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
#endif

#if !defined(JSON_IS_AMALGAMATION)

#include "allocator.h"
#include "version.h"

#endif // if !defined(JSON_IS_AMALGAMATION)

namespace Passenger {
namespace Json {
using Int = int;
using UInt = unsigned int;
#if defined(JSON_NO_INT64)
using LargestInt = int;
using LargestUInt = unsigned int;
#undef JSON_HAS_INT64
#else                 // if defined(JSON_NO_INT64)
// For Microsoft Visual use specific types as long long is not supported
#if defined(_MSC_VER) // Microsoft Visual Studio
using Int64 = __int64;
using UInt64 = unsigned __int64;
#else                 // if defined(_MSC_VER) // Other platforms, use long long
using Int64 = int64_t;
using UInt64 = uint64_t;
#endif                // if defined(_MSC_VER)
using LargestInt = Int64;
using LargestUInt = UInt64;
#define JSON_HAS_INT64
#endif // if defined(JSON_NO_INT64)

template <typename T>
using Allocator =
    typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator<T>,
                              std::allocator<T>>::type;
using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
using IStringStream =
    std::basic_istringstream<String::value_type, String::traits_type,
                             String::allocator_type>;
using OStringStream =
    std::basic_ostringstream<String::value_type, String::traits_type,
                             String::allocator_type>;
using IStream = std::istream;
using OStream = std::ostream;
} // namespace Json
} // namespace Passenger

// Legacy names (formerly macros).
using JSONCPP_STRING = Json::String;
using JSONCPP_ISTRINGSTREAM = Json::IStringStream;
using JSONCPP_OSTRINGSTREAM = Json::OStringStream;
using JSONCPP_ISTREAM = Json::IStream;
using JSONCPP_OSTREAM = Json::OStream;

#endif // JSON_CONFIG_H_INCLUDED

// //////////////////////////////////////////////////////////////////////
// End of content of file: include/json/config.h
// //////////////////////////////////////////////////////////////////////

// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: include/json/forwards.h
// //////////////////////////////////////////////////////////////////////

// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE

#ifndef JSON_FORWARDS_H_INCLUDED
#define JSON_FORWARDS_H_INCLUDED

#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
#endif // if !defined(JSON_IS_AMALGAMATION)

namespace Passenger {
namespace Json {

// writer.h
class StreamWriter;
class StreamWriterBuilder;
class Writer;
class FastWriter;
class StyledWriter;
class StyledStreamWriter;

// reader.h
class Reader;
class CharReader;
class CharReaderBuilder;

// json_features.h
class Features;

// value.h
using ArrayIndex = unsigned int;
class StaticString;
class Path;
class PathArgument;
class Value;
class ValueIteratorBase;
class ValueIterator;
class ValueConstIterator;

} // namespace Json
} // namespace Passenger

#endif // JSON_FORWARDS_H_INCLUDED

// //////////////////////////////////////////////////////////////////////
// End of content of file: include/json/forwards.h
// //////////////////////////////////////////////////////////////////////

#endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED


text:
<?php

/*
 * This file is part of the Active Collab Logger.
 *
 * (c) A51 doo <info@activecollab.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace ActiveCollab\Logger\Test;

use ActiveCollab\Logger\Factory\Factory;
use ActiveCollab\Logger\LoggerInterface;
use ActiveCollab\Logger\Test\Base\TestCase;

class LoggerShutdownTest extends TestCase
{
    public function testLogicExceptionOnMultiShutdownCalls()
    {
        $this->expectException(\LogicException::class);
        $this->expectExceptionMessage('Buffer flush function should be registered only once');

        $logger = (new Factory())->create('Active Collab', '1.0.0', 'development', LoggerInterface::LOG_FOR_DEBUG, LoggerInterface::BLACKHOLE);

        $logger->flushBufferOnShutdown();
        $logger->flushBufferOnShutdown();
    }
}


text:
<?php

class CbXsdProperty
{
    public $name;
    public $isArray;
}


text:
import sys

from ez_setup import use_setuptools
use_setuptools()

from setuptools import setup

install_reqs = ['requests>=2.5.1',
                'six>=1.3.0']
assert sys.version_info >= (2, 6), "We only support Python 2.6+"

with open('LICENSE') as f:
  license = f.read()

dist = setup(
    name='dropbox2',
    version='0.1',
    description='Official Dropbox API Client',
    author='Dropbox',
    author_email='dev-platform@dropbox.com',
    url='http://www.dropbox.com/developers',
    install_requires=install_reqs,
    license=license,
    zip_safe=False,
    packages=['dropbox'],
    package_data={'dropbox': ['trusted-certs.crt']},
    platforms=['CPython 2.6', 'CPython 2.7'],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Operating System :: POSIX',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: MacOS :: MacOS X',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)