text:
#ifndef JUCE_TARGETPLATFORM_H_INCLUDED
#define JUCE_TARGETPLATFORM_H_INCLUDED

//==============================================================================
/*  This file figures out which platform is being built, and defines some macros
    that the rest of the code can use for OS-specific compilation.

    Macros that will be set here are:

    - One of JUCE_WINDOWS, JUCE_MAC JUCE_LINUX, JUCE_IOS, JUCE_ANDROID, etc.
    - Either JUCE_32BIT or JUCE_64BIT, depending on the architecture.
    - Either JUCE_LITTLE_ENDIAN or JUCE_BIG_ENDIAN.
    - Either JUCE_INTEL or JUCE_PPC
    - Either JUCE_GCC or JUCE_MSVC
*/

//==============================================================================
#if (defined (_WIN32) || defined (_WIN64))
  #define       JUCE_WIN32 1
  #define       JUCE_WINDOWS 1
#elif defined (JUCE_ANDROID)
  #undef        JUCE_ANDROID
  #define       JUCE_ANDROID 1
#elif defined (LINUX) || defined (__linux__)
  #define     JUCE_LINUX 1
#elif defined (__APPLE_CPP__) || defined(__APPLE_CC__)
  #define Point CarbonDummyPointName // (workaround to avoid definition of "Point" by old Carbon headers)
  #define Component CarbonDummyCompName
  #include <CoreFoundation/CoreFoundation.h> // (needed to find out what platform we're using)
  #undef Point
  #undef Component

  #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
    #define     JUCE_IPHONE 1
    #define     JUCE_IOS 1
  #else
    #define     JUCE_MAC 1
  #endif
#elif defined (__FreeBSD__)
  #define       JUCE_BSD 1
#else
  #error "Unknown platform!"
#endif

//==============================================================================
#if JUCE_WINDOWS
  #ifdef _MSC_VER
    #ifdef _WIN64
      #define JUCE_64BIT 1
    #else
      #define JUCE_32BIT 1
    #endif
  #endif

  #ifdef _DEBUG
    #define JUCE_DEBUG 1
  #endif

  #ifdef __MINGW32__
    #define JUCE_MINGW 1
    #ifdef __MINGW64__
      #define JUCE_64BIT 1
    #else
      #define JUCE_32BIT 1
    #endif
  #endif

  /** If defined, this indicates that the processor is little-endian. */
  #define JUCE_LITTLE_ENDIAN 1

  #define JUCE_INTEL 1
#endif

//==============================================================================
#if JUCE_MAC || JUCE_IOS

  #if defined (DEBUG) || defined (_DEBUG) || ! (defined (NDEBUG) || defined (_NDEBUG))
    #define JUCE_DEBUG 1
  #endif

  #if ! (defined (DEBUG) || defined (_DEBUG) || defined (NDEBUG) || defined (_NDEBUG))
    #warning "Neither NDEBUG or DEBUG has been defined - you should set one of these to make it clear whether this is a release build,"
  #endif

  #ifdef __LITTLE_ENDIAN__
    #define JUCE_LITTLE_ENDIAN 1
  #else
    #define JUCE_BIG_ENDIAN 1
  #endif

  #ifdef __LP64__
    #define JUCE_64BIT 1
  #else
    #define JUCE_32BIT 1
  #endif

  #if defined (__ppc__) || defined (__ppc64__)
    #define JUCE_PPC 1
  #elif defined (__arm__) || defined (__arm64__)
    #define JUCE_ARM 1
  #else
    #define JUCE_INTEL 1
  #endif

  #if JUCE_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
    #error "Building for OSX 10.3 is no longer supported!"
  #endif

  #if JUCE_MAC && ! defined (MAC_OS_X_VERSION_10_5)
    #error "To build with 10.4 compatibility, use a 10.5 or 10.6 SDK and set the deployment target to 10.4"
  #endif
#endif

//==============================================================================
#if JUCE_LINUX || JUCE_ANDROID

  #ifdef _DEBUG
    #define JUCE_DEBUG 1
  #endif

  // Allow override for big-endian Linux platforms
  #if defined (__LITTLE_ENDIAN__) || ! defined (JUCE_BIG_ENDIAN)
    #define JUCE_LITTLE_ENDIAN 1
    #undef JUCE_BIG_ENDIAN
  #else
    #undef JUCE_LITTLE_ENDIAN
    #define JUCE_BIG_ENDIAN 1
  #endif

  #if defined (__LP64__) || defined (_LP64) || defined (__arm64__)
    #define JUCE_64BIT 1
  #else
    #define JUCE_32BIT 1
  #endif

  #if defined (__arm__) || defined (__arm64__)
    #define JUCE_ARM 1
  #elif __MMX__ || __SSE__ || __amd64__
    #define JUCE_INTEL 1
  #endif
#endif

//==============================================================================
// Compiler type macros.

#ifdef __clang__
 #define JUCE_CLANG 1
 #define JUCE_GCC 1
#elif defined (__GNUC__)
  #define JUCE_GCC 1
#elif defined (_MSC_VER)
  #define JUCE_MSVC 1

  #if _MSC_VER < 1500
    #define JUCE_VC8_OR_EARLIER 1

    #if _MSC_VER < 1400
      #define JUCE_VC7_OR_EARLIER 1

      #if _MSC_VER < 1300
        #warning "MSVC 6.0 is no longer supported!"
      #endif
    #endif
  #endif

  #if JUCE_64BIT || ! JUCE_VC7_OR_EARLIER
    #define JUCE_USE_MSVC_INTRINSICS 1
  #endif
#else
  #error unknown compiler
#endif

#endif   // JUCE_TARGETPLATFORM_H_INCLUDED


text:
'use strict'

class DeveloperController {
}

module.exports = DeveloperController

redpajama_set_name: RedPajamaGithub


text:
package concurrent;

public class InterruptWait extends Thread {
	public static Object lock = new Object();

	@Override
	public void run() {
		System.out.println("start");
		synchronized (lock) {
			try {
				lock.wait();
			} catch (InterruptedException e) {
				System.out.println(Thread.currentThread().isInterrupted());
				Thread.currentThread().interrupt(); // set interrupt flag again
				System.out.println(Thread.currentThread().isInterrupted());
				e.printStackTrace();
			}
		}
	}

	public static void main(String[] args) {
		Thread thread = new InterruptWait();
		thread.start();
		try {
			sleep(2000);
		} catch (InterruptedException e) {
		}
		thread.interrupt();
	}
}


text:
* Modify `Classes/AppDelegate.cpp` to include the following headers:
```cpp
#include "PluginGoogleAnalyticsLua.hpp"
#include "PluginGoogleAnalyticsLuaHelper.h"
```

* Second, We need to register the plugin with Lua. This is done by making a call to `register_all_PluginGoogleAnalyticsLua(<lua_State*>);`.

  __Note:__ It is important to note that this call must be made after `lua_State *tolua_s = pStack->getLuaState();` and before `tolua_extensions_ccb_open(tolua_s);`.

	Here is an example of what this might look like for you:
```cpp
#include "PluginGoogleAnalyticsLua.hpp"
#include "PluginGoogleAnalyticsLuaHelper.h"
bool AppDelegate::applicationDidFinishLaunching()
{
	lua_State *tolua_s = pStack->getLuaState();
	register_all_PluginGoogleAnalyticsLua(tolua_s);
	register_all_PluginGoogleAnalyticsLua_helper(tolua_s);
	tolua_extensions_ccb_open(tolua_s);
}
```

### Initialize Google Analytics
Modify your Lua code to `init()` the plugin. This can be done anyplace, however it must be done before trying to use the plugin's features.
```lua
sdkbox.PluginGoogleAnalytics:init()
```

You can always manually stop recording events at any time by calling:
```cpp
sdkbox.PluginGoogleAnalytics:stopSession();
```

However, in-order to record events again you must then manually call:
```cpp
sdkbox.PluginGoogleAnalytics:startSession();
```

Logged data usually shows up within one day.


text:
package griffon.pivot.support.adapters;

import griffon.core.CallableWithArgs;
import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class TabPaneSelectionAdapterTest {
    private TabPaneSelectionAdapter adapter = new TabPaneSelectionAdapter();

    @Test
    public void testPreviewSelectedIndexChange() {
        final boolean[] invoked = new boolean[1];
        CallableWithArgs<org.apache.pivot.util.Vote> callable = new CallableWithArgs<org.apache.pivot.util.Vote>() {
            public org.apache.pivot.util.Vote call(Object... args) {
                invoked[0] = true;
                return null;
            }
        };

        assertNull(adapter.getPreviewSelectedIndexChange());
        adapter.previewSelectedIndexChange(null, 0);
        assertFalse(invoked[0]);

        adapter.setPreviewSelectedIndexChange(callable);
        adapter.previewSelectedIndexChange(null, 0);
        assertTrue(invoked[0]);
    }

    @Test
    public void testSelectedIndexChanged() {
        final boolean[] invoked = new boolean[1];
        CallableWithArgs<Void> callable = new CallableWithArgs<Void>() {
            public Void call(Object... args) {
                invoked[0] = true;
                return null;
            }
        };

        assertNull(adapter.getSelectedIndexChanged());
        adapter.selectedIndexChanged(null, 0);
        assertFalse(invoked[0]);

        adapter.setSelectedIndexChanged(callable);
        adapter.selectedIndexChanged(null, 0);
        assertTrue(invoked[0]);
    }

    @Test
    public void testSelectedIndexChangeVetoed() {
        final boolean[] invoked = new boolean[1];
        CallableWithArgs<Void> callable = new CallableWithArgs<Void>() {
            public Void call(Object... args) {
                invoked[0] = true;
                return null;
            }
        };

        assertNull(adapter.getSelectedIndexChangeVetoed());
        adapter.selectedIndexChangeVetoed(null, null);
        assertFalse(invoked[0]);

        adapter.setSelectedIndexChangeVetoed(callable);
        adapter.selectedIndexChangeVetoed(null, null);
        assertTrue(invoked[0]);
    }

}


text:
    <title>Constructed by MarkupBuilder</title>

What can I do with MarkupBuilder?

<form action='whatever'>
    <input checked='checked' type='checkbox' id='Produce HTML'/>
    Produce HTML

    <input checked='checked' type='checkbox' id='Produce XML'/>
    Produce XML

    <input checked='checked' type='checkbox' id='Have some fun'/>
    Have some fun

</form>


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

import java.io.OutputStream;

import com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
import com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315OmitComments;
import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
import com.sun.org.apache.xml.internal.security.transforms.Transform;
import com.sun.org.apache.xml.internal.security.transforms.TransformSpi;
import com.sun.org.apache.xml.internal.security.transforms.Transforms;

/**
 * Implements the http://www.w3.org/TR/2001/REC-xml-c14n-20010315
 * transform.
 *
 * @author Christian Geuer-Pollmann
 */
public class TransformC14N extends TransformSpi {

   /** Field implementedTransformURI */
   public static final String implementedTransformURI =
      Transforms.TRANSFORM_C14N_OMIT_COMMENTS;

   /**
    * @inheritDoc
    */
   protected String engineGetURI() {
      return TransformC14N.implementedTransformURI;
   }

   /**
    *  @inheritDoc
    */
   protected XMLSignatureInput enginePerformTransform
        (XMLSignatureInput input, Transform _transformObject)
           throws CanonicalizationException {
            return enginePerformTransform(input, null, _transformObject);
   }

    protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input,OutputStream os, Transform _transformObject)
    throws CanonicalizationException {
         Canonicalizer20010315OmitComments c14n = new Canonicalizer20010315OmitComments();
         if (os!=null) {
                c14n.setWriter(os);
         }
         byte[] result = null;
         result=c14n.engineCanonicalize(input);
         XMLSignatureInput output=new XMLSignatureInput(result);
         if (os!=null) {
            output.setOutputStream(os);
         }
         return output;
   }
}


text:
class BuildQueueWorker
  include ApplicationWorker
  include PipelineQueue

  queue_namespace :pipeline_processing

  # rubocop: disable CodeReuse/ActiveRecord
  def perform(build_id)
    Ci::Build.find_by(id: build_id).try do |build|
      Ci::UpdateBuildQueueService.new.execute(build)
    end
  end
  # rubocop: enable CodeReuse/ActiveRecord
end


text:
<?php

class index_Controller extends Micro_Controller
{
    function indexAction()
    {
        $this->data = "Hello World!";
    }
}


text:
package io.protostuff.jetbrains.plugin.reference.file;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.vfs.VirtualFile;
import io.protostuff.jetbrains.plugin.psi.ProtoPsiFileRoot;

/**
 * Returns source roots for libraries and SDK classes.
 *
 * @author Kostiantyn Shchepanovskyi
 */
class LibrariesAndSdkClassesRootsProvider implements FilePathReferenceProvider.SourceRootsProvider {
    @Override
    public VirtualFile[] getSourceRoots(Module module, ProtoPsiFileRoot psiFileRoot) {
        ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
        return moduleRootManager.orderEntries().getAllLibrariesAndSdkClassesRoots();
    }
}


text:
package org.neo4j.kernel.impl.pagecache;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.io.pagecache.PageCache;
import org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory;
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
import org.neo4j.kernel.configuration.Config;
import org.neo4j.logging.NullLog;
import org.neo4j.test.EphemeralFileSystemRule;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.neo4j.graphdb.factory.GraphDatabaseSettings.mapped_memory_page_size;
import static org.neo4j.graphdb.factory.GraphDatabaseSettings.pagecache_memory;
import static org.neo4j.graphdb.factory.GraphDatabaseSettings.pagecache_swapper;
import static org.neo4j.helpers.collection.MapUtil.stringMap;

public class ConfiguringPageCacheFactoryTest
{
    @Rule
    public EphemeralFileSystemRule fsRule = new EphemeralFileSystemRule();

    @Before
    public void setUp()
    {
        PageSwapperFactoryForTesting.createdCounter.set( 0 );
        PageSwapperFactoryForTesting.configuredCounter.set( 0 );
        PageSwapperFactoryForTesting.cachePageSizeHint.set( 0 );
        PageSwapperFactoryForTesting.cachePageSizeHintIsStrict.set( false );
    }

    @Test
    public void shouldUseConfiguredPageSizeAndFitAsManyPagesAsItCan() throws Throwable
    {
        // Given
        final int pageSize = 4096;
        final int maxPages = 60;
        Config config = new Config();
        config.applyChanges( stringMap(
                mapped_memory_page_size.name(), "" + pageSize,
                pagecache_memory.name(), Integer.toString( pageSize * maxPages ) ) );

        // When
        ConfiguringPageCacheFactory factory = new ConfiguringPageCacheFactory(
                fsRule.get(), config, PageCacheTracer.NULL, NullLog.getInstance() );

        // Then
        try ( PageCache cache = factory.getOrCreatePageCache() )
        {
            assertThat( cache.pageSize(), equalTo( pageSize ) );
            assertThat( cache.maxCachedPages(), equalTo( maxPages ) );
        }
    }

    @Test
    public void mustUseConfiguredPageSwapper() throws Exception
    {
        // Given
        Config config = new Config();
        config.applyChanges( stringMap(
                pagecache_memory.name(), "8m",
                pagecache_swapper.name(), "test" ) );

        // When
        new ConfiguringPageCacheFactory( fsRule.get(), config, PageCacheTracer.NULL, NullLog.getInstance() );

        // Then
        assertThat( PageSwapperFactoryForTesting.countCreatedPageSwapperFactories(), is( 1 ) );
        assertThat( PageSwapperFactoryForTesting.countConfiguredPageSwapperFactories(), is( 1 ) );
    }

    @Test
    public void mustUsePageSwapperCachePageSizeHintAsDefault() throws Exception
    {
        // Given
        int cachePageSizeHint = 16 * 1024;
        PageSwapperFactoryForTesting.cachePageSizeHint.set( cachePageSizeHint );
        Config config = new Config();
        config.applyChanges( stringMap(
                GraphDatabaseSettings.pagecache_swapper.name(), "test" ) );

        // When
        ConfiguringPageCacheFactory factory = new ConfiguringPageCacheFactory(
                fsRule.get(), config, PageCacheTracer.NULL, NullLog.getInstance() );

        // Then
        try ( PageCache cache = factory.getOrCreatePageCache() )
        {
            assertThat( cache.pageSize(), is( cachePageSizeHint ) );
        }
    }

    @Test
    public void mustIgnoreExplicitlySpecifiedCachePageSizeIfPageSwapperHintIsStrict() throws Exception
    {
        // Given
        int cachePageSizeHint = 16 * 1024;
        PageSwapperFactoryForTesting.cachePageSizeHint.set( cachePageSizeHint );
        PageSwapperFactoryForTesting.cachePageSizeHintIsStrict.set( true );
        Config config = new Config();
        config.applyChanges( stringMap(
                GraphDatabaseSettings.mapped_memory_page_size.name(), "4096",
                GraphDatabaseSettings.pagecache_swapper.name(), "test" ) );

        // When
        ConfiguringPageCacheFactory factory = new ConfiguringPageCacheFactory(
                fsRule.get(), config, PageCacheTracer.NULL, NullLog.getInstance() );

        // Then
        try ( PageCache cache = factory.getOrCreatePageCache() )
        {
            assertThat( cache.pageSize(), is( cachePageSizeHint ) );
        }
    }

    public static class PageSwapperFactoryForTesting
            extends SingleFilePageSwapperFactory
            implements ConfigurablePageSwapperFactory
    {
        private static final AtomicInteger createdCounter = new AtomicInteger();
        private static final AtomicInteger configuredCounter = new AtomicInteger();
        private static final AtomicInteger cachePageSizeHint = new AtomicInteger( 8192 );
        private static final AtomicBoolean cachePageSizeHintIsStrict = new AtomicBoolean();

        public static int countCreatedPageSwapperFactories()
        {
            return createdCounter.get();
        }

        public static int countConfiguredPageSwapperFactories()
        {
            return configuredCounter.get();
        }

        public PageSwapperFactoryForTesting()
        {
            createdCounter.getAndIncrement();
        }

        @Override
        public String implementationName()
        {
            return "test";
        }

        @Override
        public int getCachePageSizeHint()
        {
            return cachePageSizeHint.get();
        }

        @Override
        public boolean isCachePageSizeHintStrict()
        {
            return cachePageSizeHintIsStrict.get();
        }

        @Override
        public void configure( Config config )
        {
            configuredCounter.getAndIncrement();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
	<!-- wildfly persistence.xml -->
	<persistence-unit name="ServletUnit" transaction-type="JTA">
		<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
		<exclude-unlisted-classes>false</exclude-unlisted-classes>
		<properties>
			<property name="hibernate.hbm2ddl.auto" value="create-drop" />
		</properties>
	</persistence-unit>
</persistence>


text:
<?php

require_once './classes/Users.php';
$u = new Users();
$courseid = $_POST['courseid'];
$userid = $_POST['userid'];
$list = $u->remove_user_from_course($courseid, $userid);
echo $list;


text:
// This software is part of the Autofac IoC container
// Copyright © 2011 Autofac Contributors
// http://autofac.org
//
// 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 Autofac.Core;

namespace Autofac.Builder
{
    /// <summary>
    /// Registration style for individual components.
    /// </summary>
    public class SingleRegistrationStyle
    {
        Guid _id = Guid.NewGuid();

        readonly ICollection<EventHandler<ComponentRegisteredEventArgs>>
            _registeredHandlers = new List<EventHandler<ComponentRegisteredEventArgs>>();

        bool _preserveDefaults;

        /// <summary>
        /// The id used for the registration.
        /// </summary>
        public Guid Id
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
            }
        }

        /// <summary>
        /// Handlers to notify of the component registration event.
        /// </summary>
        public ICollection<EventHandler<ComponentRegisteredEventArgs>> RegisteredHandlers { get { return _registeredHandlers; } }

        /// <summary>
        /// By default, new registrations override existing registrations as defaults.
        /// If set to true, new registrations will not change existing defaults.
        /// </summary>
        public bool PreserveDefaults
        {
            get { return _preserveDefaults; }
            set { _preserveDefaults = value; }
        }

        /// <summary>
        /// The component upon which this registration is based.
        /// </summary>
        public IComponentRegistration Target { get; set; }
    }
}


text:
@interface EventBuffer ()
@property (nonatomic, strong) id<EventSink> underlyingSink;
@property (nonatomic, copy) NSMutableArray *bufferedEventData;
@end

@implementation EventBuffer

+ (NSArray *)wrapSinks:(NSArray *)sinks
{
  NSMutableArray *buffers = [NSMutableArray arrayWithCapacity:sinks.count];
  for (id<EventSink> sink in sinks) {
    [buffers addObject:[EventBuffer eventBufferForSink:sink]];
  }
  return buffers;
}

+ (instancetype)eventBufferForSink:(id<EventSink>)reporter
{
  EventBuffer *obj = [[EventBuffer alloc] init];
  obj.underlyingSink = reporter;
  return obj;
}

- (instancetype)init
{
  if (self = [super init]) {
    _bufferedEventData = [[NSMutableArray alloc] init];
  }
  return self;
}

- (void)publishDataForEvent:(NSData *)data
{
  [_bufferedEventData addObject:data];
}

- (void)flush
{
  @synchronized(_underlyingSink) {
    for (NSData *data in _bufferedEventData) {
      [_underlyingSink publishDataForEvent:data];
    }
  }
  [_bufferedEventData removeAllObjects];
}

- (NSArray *)events
{
  NSMutableArray *result = [NSMutableArray array];

  for (NSData *data in _bufferedEventData) {
    NSError *error = nil;
    NSDictionary *event = [NSJSONSerialization JSONObjectWithData:data
                                                          options:0
                                                            error:&error];
    NSAssert(event != nil, @"Error encoding JSON: %@", [error localizedFailureReason]);
    [result addObject:event];
  }

  return result;
}

@end


text:
"""
Classification kriging
----------------------

An example of classification kriging
"""

import sys

from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import fetch_california_housing
from sklearn.preprocessing import KBinsDiscretizer
from sklearn.model_selection import train_test_split

from pykrige.ck import ClassificationKriging

svc_model = SVC(C=0.1, gamma="auto", probability=True)
rf_model = RandomForestClassifier(n_estimators=100)
lr_model = LogisticRegression(max_iter=10000)

models = [svc_model, rf_model, lr_model]

try:
    housing = fetch_california_housing()
except PermissionError:
    # this dataset can occasionally fail to download on Windows
    sys.exit(0)

# take the first 5000 as Kriging is memory intensive
p = housing["data"][:5000, :-2]
x = housing["data"][:5000, -2:]
target = housing["target"][:5000]
discretizer = KBinsDiscretizer(encode="ordinal")
target = discretizer.fit_transform(target.reshape(-1, 1))

p_train, p_test, x_train, x_test, target_train, target_test = train_test_split(
    p, x, target, test_size=0.3, random_state=42
)

for m in models:
    print("=" * 40)
    print("classification model:", m.__class__.__name__)
    m_ck = ClassificationKriging(classification_model=m, n_closest_points=10)
    m_ck.fit(p_train, x_train, target_train)
    print(
        "Classification Score: ", m_ck.classification_model.score(p_test, target_test)
    )
    print("CK score: ", m_ck.score(p_test, x_test, target_test))


text:
IPC_ENUM_TRAITS(content::ConsoleMessageLevel)
IPC_ENUM_TRAITS(content::PageTransition)
IPC_ENUM_TRAITS(content::SecurityStyle)
IPC_ENUM_TRAITS(WebKit::WebReferrerPolicy)
IPC_ENUM_TRAITS(WindowOpenDisposition)
IPC_ENUM_TRAITS(webkit_glue::WebPreferences::EditingBehavior)
IPC_ENUM_TRAITS(content::PasswordForm::Type)

IPC_STRUCT_TRAITS_BEGIN(WebKit::WebPoint)
  IPC_STRUCT_TRAITS_MEMBER(x)
  IPC_STRUCT_TRAITS_MEMBER(y)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(WebKit::WebRect)
  IPC_STRUCT_TRAITS_MEMBER(x)
  IPC_STRUCT_TRAITS_MEMBER(y)
  IPC_STRUCT_TRAITS_MEMBER(width)
  IPC_STRUCT_TRAITS_MEMBER(height)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(content::PasswordForm)
IPC_STRUCT_TRAITS_MEMBER(signon_realm)
IPC_STRUCT_TRAITS_MEMBER(origin)
IPC_STRUCT_TRAITS_MEMBER(action)
IPC_STRUCT_TRAITS_MEMBER(submit_element)
IPC_STRUCT_TRAITS_MEMBER(username_element)
IPC_STRUCT_TRAITS_MEMBER(username_value)
IPC_STRUCT_TRAITS_MEMBER(password_element)
IPC_STRUCT_TRAITS_MEMBER(password_value)
IPC_STRUCT_TRAITS_MEMBER(password_autocomplete_set)
IPC_STRUCT_TRAITS_MEMBER(old_password_element)
IPC_STRUCT_TRAITS_MEMBER(old_password_value)
IPC_STRUCT_TRAITS_MEMBER(ssl_valid)
IPC_STRUCT_TRAITS_MEMBER(preferred)
IPC_STRUCT_TRAITS_MEMBER(blacklisted_by_user)
IPC_STRUCT_TRAITS_MEMBER(type)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(content::SSLStatus)
  IPC_STRUCT_TRAITS_MEMBER(security_style)
  IPC_STRUCT_TRAITS_MEMBER(cert_id)
  IPC_STRUCT_TRAITS_MEMBER(cert_status)
  IPC_STRUCT_TRAITS_MEMBER(security_bits)
  IPC_STRUCT_TRAITS_MEMBER(connection_status)
  IPC_STRUCT_TRAITS_MEMBER(content_status)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(webkit::WebPluginMimeType)
  IPC_STRUCT_TRAITS_MEMBER(mime_type)
  IPC_STRUCT_TRAITS_MEMBER(file_extensions)
  IPC_STRUCT_TRAITS_MEMBER(description)
  IPC_STRUCT_TRAITS_MEMBER(additional_param_names)
  IPC_STRUCT_TRAITS_MEMBER(additional_param_values)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(webkit::WebPluginInfo)
  IPC_STRUCT_TRAITS_MEMBER(name)
  IPC_STRUCT_TRAITS_MEMBER(path)
  IPC_STRUCT_TRAITS_MEMBER(version)
  IPC_STRUCT_TRAITS_MEMBER(desc)
  IPC_STRUCT_TRAITS_MEMBER(mime_types)
  IPC_STRUCT_TRAITS_MEMBER(type)
  IPC_STRUCT_TRAITS_MEMBER(pepper_permissions)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebPreferences)
  IPC_STRUCT_TRAITS_MEMBER(standard_font_family_map)
  IPC_STRUCT_TRAITS_MEMBER(fixed_font_family_map)
  IPC_STRUCT_TRAITS_MEMBER(serif_font_family_map)
  IPC_STRUCT_TRAITS_MEMBER(sans_serif_font_family_map)
  IPC_STRUCT_TRAITS_MEMBER(cursive_font_family_map)
  IPC_STRUCT_TRAITS_MEMBER(fantasy_font_family_map)
  IPC_STRUCT_TRAITS_MEMBER(default_font_size)
  IPC_STRUCT_TRAITS_MEMBER(default_fixed_font_size)
  IPC_STRUCT_TRAITS_MEMBER(apply_default_device_scale_factor_in_compositor)
  IPC_STRUCT_TRAITS_MEMBER(apply_page_scale_factor_in_compositor)
  IPC_STRUCT_TRAITS_MEMBER(per_tile_painting_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_animation_enabled)
  IPC_STRUCT_TRAITS_MEMBER(minimum_font_size)
  IPC_STRUCT_TRAITS_MEMBER(minimum_logical_font_size)
  IPC_STRUCT_TRAITS_MEMBER(default_encoding)
  IPC_STRUCT_TRAITS_MEMBER(javascript_enabled)
  IPC_STRUCT_TRAITS_MEMBER(web_security_enabled)
  IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically)
  IPC_STRUCT_TRAITS_MEMBER(loads_images_automatically)
  IPC_STRUCT_TRAITS_MEMBER(images_enabled)
  IPC_STRUCT_TRAITS_MEMBER(plugins_enabled)
  IPC_STRUCT_TRAITS_MEMBER(dom_paste_enabled)
  IPC_STRUCT_TRAITS_MEMBER(developer_extras_enabled)
  IPC_STRUCT_TRAITS_MEMBER(inspector_settings)
  IPC_STRUCT_TRAITS_MEMBER(site_specific_quirks_enabled)
  IPC_STRUCT_TRAITS_MEMBER(shrinks_standalone_images_to_fit)
  IPC_STRUCT_TRAITS_MEMBER(uses_universal_detector)
  IPC_STRUCT_TRAITS_MEMBER(text_areas_are_resizable)
  IPC_STRUCT_TRAITS_MEMBER(java_enabled)
  IPC_STRUCT_TRAITS_MEMBER(allow_scripts_to_close_windows)
  IPC_STRUCT_TRAITS_MEMBER(uses_page_cache)
  IPC_STRUCT_TRAITS_MEMBER(page_cache_supports_plugins)
  IPC_STRUCT_TRAITS_MEMBER(remote_fonts_enabled)
  IPC_STRUCT_TRAITS_MEMBER(javascript_can_access_clipboard)
  IPC_STRUCT_TRAITS_MEMBER(xss_auditor_enabled)
  IPC_STRUCT_TRAITS_MEMBER(dns_prefetching_enabled)
  IPC_STRUCT_TRAITS_MEMBER(local_storage_enabled)
  IPC_STRUCT_TRAITS_MEMBER(databases_enabled)
  IPC_STRUCT_TRAITS_MEMBER(application_cache_enabled)
  IPC_STRUCT_TRAITS_MEMBER(tabs_to_links)
  IPC_STRUCT_TRAITS_MEMBER(hyperlink_auditing_enabled)
  IPC_STRUCT_TRAITS_MEMBER(is_online)
  IPC_STRUCT_TRAITS_MEMBER(user_style_sheet_enabled)
  IPC_STRUCT_TRAITS_MEMBER(user_style_sheet_location)
  IPC_STRUCT_TRAITS_MEMBER(author_and_user_styles_enabled)
  IPC_STRUCT_TRAITS_MEMBER(frame_flattening_enabled)
  IPC_STRUCT_TRAITS_MEMBER(allow_universal_access_from_file_urls)
  IPC_STRUCT_TRAITS_MEMBER(allow_file_access_from_file_urls)
  IPC_STRUCT_TRAITS_MEMBER(webaudio_enabled)
  IPC_STRUCT_TRAITS_MEMBER(experimental_webgl_enabled)
  IPC_STRUCT_TRAITS_MEMBER(flash_3d_enabled)
  IPC_STRUCT_TRAITS_MEMBER(flash_stage3d_enabled)
  IPC_STRUCT_TRAITS_MEMBER(gl_multisampling_enabled)
  IPC_STRUCT_TRAITS_MEMBER(privileged_webgl_extensions_enabled)
  IPC_STRUCT_TRAITS_MEMBER(webgl_errors_to_console_enabled)
  IPC_STRUCT_TRAITS_MEMBER(show_composited_layer_borders)
  IPC_STRUCT_TRAITS_MEMBER(show_composited_layer_tree)
  IPC_STRUCT_TRAITS_MEMBER(show_fps_counter)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_overflow_scroll_enabled)
  IPC_STRUCT_TRAITS_MEMBER(
      accelerated_compositing_for_scrollable_frames_enabled)
  IPC_STRUCT_TRAITS_MEMBER(composited_scrolling_for_frames_enabled)
  IPC_STRUCT_TRAITS_MEMBER(mock_scrollbars_enabled)
  IPC_STRUCT_TRAITS_MEMBER(show_paint_rects)
  IPC_STRUCT_TRAITS_MEMBER(render_vsync_enabled)
  IPC_STRUCT_TRAITS_MEMBER(asynchronous_spell_checking_enabled)
  IPC_STRUCT_TRAITS_MEMBER(unified_textchecker_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_enabled)
  IPC_STRUCT_TRAITS_MEMBER(force_compositing_mode)
  IPC_STRUCT_TRAITS_MEMBER(fixed_position_compositing_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_2d_canvas_enabled)
  IPC_STRUCT_TRAITS_MEMBER(deferred_2d_canvas_enabled)
  IPC_STRUCT_TRAITS_MEMBER(antialiased_2d_canvas_disabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_painting_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_filters_enabled)
  IPC_STRUCT_TRAITS_MEMBER(gesture_tap_highlight_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_plugins_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_3d_transforms_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_animation_enabled)
  IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_video_enabled)
  IPC_STRUCT_TRAITS_MEMBER(memory_info_enabled)
  IPC_STRUCT_TRAITS_MEMBER(fullscreen_enabled)
  IPC_STRUCT_TRAITS_MEMBER(allow_displaying_insecure_content)
  IPC_STRUCT_TRAITS_MEMBER(allow_running_insecure_content)
  IPC_STRUCT_TRAITS_MEMBER(enable_scroll_animator)
  IPC_STRUCT_TRAITS_MEMBER(visual_word_movement_enabled)
  IPC_STRUCT_TRAITS_MEMBER(password_echo_enabled)
  IPC_STRUCT_TRAITS_MEMBER(css_sticky_position_enabled)
  IPC_STRUCT_TRAITS_MEMBER(css_shaders_enabled)
  IPC_STRUCT_TRAITS_MEMBER(css_variables_enabled)
  IPC_STRUCT_TRAITS_MEMBER(css_grid_layout_enabled)
  IPC_STRUCT_TRAITS_MEMBER(touch_enabled)
  IPC_STRUCT_TRAITS_MEMBER(device_supports_touch)
  IPC_STRUCT_TRAITS_MEMBER(device_supports_mouse)
  IPC_STRUCT_TRAITS_MEMBER(touch_adjustment_enabled)
  IPC_STRUCT_TRAITS_MEMBER(default_tile_width)
  IPC_STRUCT_TRAITS_MEMBER(default_tile_height)
  IPC_STRUCT_TRAITS_MEMBER(max_untiled_layer_width)
  IPC_STRUCT_TRAITS_MEMBER(max_untiled_layer_height)
  IPC_STRUCT_TRAITS_MEMBER(fixed_position_creates_stacking_context)
  IPC_STRUCT_TRAITS_MEMBER(sync_xhr_in_documents_enabled)
  IPC_STRUCT_TRAITS_MEMBER(deferred_image_decoding_enabled)
  IPC_STRUCT_TRAITS_MEMBER(should_respect_image_orientation)
  IPC_STRUCT_TRAITS_MEMBER(number_of_cpu_cores)
  IPC_STRUCT_TRAITS_MEMBER(editing_behavior)
  IPC_STRUCT_TRAITS_MEMBER(supports_multiple_windows)
  IPC_STRUCT_TRAITS_MEMBER(viewport_enabled)
  IPC_STRUCT_TRAITS_MEMBER(record_rendering_stats)
  IPC_STRUCT_TRAITS_MEMBER(cookie_enabled)
  IPC_STRUCT_TRAITS_MEMBER(apply_page_scale_factor_in_compositor)
#if defined(OS_ANDROID)
  IPC_STRUCT_TRAITS_MEMBER(text_autosizing_enabled)
  IPC_STRUCT_TRAITS_MEMBER(font_scale_factor)
  IPC_STRUCT_TRAITS_MEMBER(force_enable_zoom)
#endif
IPC_STRUCT_TRAITS_END()

#endif  // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_


text:
<?php

namespace Mr5\Bayes;

use Mr5\Bayes\Storage\StorageInterface;

/**
 * Classifier
 *
 * @category Mr5\Bayes
 * @package  Mr5\Bayes
 * @author   mr.5 <mr5.simple@gmail.com>
 * @license  MIT <http://github.com/mr5/bayes/LICENSE.md>
 * @link     http://github.com/mr5/bayes
 */
class Classifier
{
    /**
     * Array storage
     *
     * @var StorageInterface
     */
    protected $storage;

    /**
     * Constructor.
     *
     * @param StorageInterface $storage Storage for
     */
    public function __construct(StorageInterface $storage)
    {
        $this->storage = $storage;
    }

    /**
     * Calculate probability of feature in category.
     *
     * @param string $category category
     * @param string $feature  feature
     *
     * @return float
     */
    protected function featureProbability($category, $feature)
    {

        if ($this->storage->getCategoryFeaturesCount($category) == 0) {
            // avoid `0` probability
            return 0.01;
        }
        // P(category|feature) = P(feature|category) * P(category)  /
        // P(feature|category) * P(category) +
        // ( P(feature|otherCategories) * P(otherCategories))

        // P(feature|category)
        // = feature frequency in category / all features in category
        $featureCountInCategory
            = $this->storage->getFeatureCountInCategory($category, $feature);

        $categoryFeaturesCount = $this->storage->getCategoryFeaturesCount($category);
        // P(feature|category)
        $featureCategoryProbability
            = $this->storage->getFeatureDocumentsCountInCategory($category, $feature)
            / $this->storage->getCategoryDocumentsCount($category);

        if ($featureCategoryProbability == 0) {
            $featureCategoryProbability = 0.01;
        }
        // P(category)
        $categoryProbability
            = $this->storage->getCategoryDocumentsCount($category)
            / $this->storage->getDocumentsCount();

        // P(otherCategories)
        $categoryImprobability
            = ($this->storage->getFeatureCount($feature) - $featureCountInCategory)
            /
            ($this->storage->getFeaturesCount() - $categoryFeaturesCount);

        $categoryImprobability
            = $categoryImprobability == 0 ? 0.01 : $categoryImprobability;

        // P(category|feature)
        $probability
            = ($featureCategoryProbability * $categoryProbability)
            / (
                ($featureCategoryProbability * $categoryProbability)
                +
                $categoryImprobability * (1 - $categoryProbability)
            );

        return $probability;
    }

    /**
     * Calculate probability of given category.
     *
     * @param string $category Category
     * @param array  $features Features
     * @param int    $limit    Top {$limit} probability of features limited.
     *
     * @return float
     */
    public function categoryProbability($category, array $features, $limit = 0)
    {

        $probabilities = [];
        foreach ($features as $feature) {
            $probabilities[]
                = $this->featureProbability($category, $feature);
        }

        if ($limit > 0 && $limit < count($probabilities)) {
            arsort($probabilities, SORT_NUMERIC);
            $probabilities = array_slice($probabilities, 0, $limit);
        }

        $probabilitiesTotal = 1;
        $improbabilitiesTotal = 1;

        foreach ($probabilities as $probability) {
            $improbability = 1 - $probability;
            $probabilitiesTotal *= $probability;
            $improbabilitiesTotal *= $improbability;
        }

        return $probabilitiesTotal / ($probabilitiesTotal + $improbabilitiesTotal);
    }

    /**
     * Calculate probability of all categories
     *
     * @param array $features features array
     *
     * @return array
     */
    public function categoriesProbability(array $features)
    {
        $probabilities = [];
        foreach ($this->storage->getCategories() as $category) {
            $probabilities[$category]
                = round($this->categoryProbability($category, $features, 3), 4);
        }
        arsort($probabilities, SORT_NUMERIC);

        return $probabilities;
    }

    /**
     * Classify given features.
     *
     * @param array $features Features to classify
     *
     * @return array
     */
    public function classify(array $features)
    {
        $probabilities = $this->categoriesProbability($features);

        return array_keys(array_slice($probabilities, 0, 1))[0];
    }

    /**
     * Train classifier categorize given features to given category.
     *
     * @param string $category Category of features.
     * @param array  $features Features of category.
     *
     * @return void
     */
    public function learn($category, array $features)
    {
        $this->storage->increaseDocumentsCount();
        $this->storage->increaseCategoryDocumentsCount($category);
        $uniqueFeatures = array_unique($features);
        foreach ($uniqueFeatures as $uniqueFeature) {
            $this->storage->increaseFeatureDocumentsCountInCategory(
                $category,
                $uniqueFeature
            );
        }
        foreach ($features as $feature) {
            $this->storage->increaseFeaturesCount();
            $this->storage->increaseFeatureCount($feature);
            $this->storage->increaseCategoryFeaturesCount($category);
            $this->storage->increaseFeatureCountInCategory($category, $feature);
        }
    }
}


text:
#include "glnextWindow01.h"

#define TODEGREES 57.2957795
#define TORADIANS 0.0174532925

glnextWindow01::glnextWindow01(const string& name,
			       int w, int h,
			       int posx, int posy):glfwWindow(name,w,h,posx,posy)
{

  _appInstance = NULL;

}

glnextWindow01::~glnextWindow01(void){

}

void glnextWindow01::OnRender(void)
{
  // erase the background:
  glDrawBuffer( GL_BACK );
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  if(_appInstance)
    _appInstance->OnRender();

  glfwWindow::OnRender();
}

void glnextWindow01::OnIdle()
{
  if(_appInstance)
    _appInstance->OnIdle();

  //call the parent idle function
  glfwWindow::OnIdle();

}

void glnextWindow01::OnInit()
{
  //call parent initializers first
  glfwWindow::OnInit();

  //opengl initialization code goes here
  if(_appInstance)
    _appInstance->OnInit();
}

void glnextWindow01::OnExit()
{
  //application exits first
  if(_appInstance)
    _appInstance->OnExit();

  glfwWindow::OnExit();
}

void glnextWindow01::OnResize(int w, int h)
{

}

void glnextWindow01::OnMouseDown(int button, int x, int y)
{

}

void glnextWindow01::OnRightMouseDrag(int x, int y)
{

}

void glnextWindow01::OnLeftMouseDrag(int x, int y)
{

}

void glnextWindow01::OnMiddleMouseDrag(int x, int y)
{

}

void glnextWindow01::OnMouseUp(int button, int x, int y)
{
}

void glnextWindow01::OnMouseWheel(int nWheelNumber, int nDirection, int x, int y)
{

}

void glnextWindow01::OnKeyDown(int nKey, char cAscii)
{
  if (nKey == 257) // 0x1b = ESC
  {
      Close(); // Close Window!
  }

}

void glnextWindow01::OnKeyUp(int nKey, char cAscii)
{
  if (cAscii == 'f')
  {
      SetFullscreen(true);
  }
  else if (cAscii == 'w')
  {
      SetFullscreen(false);
  }
}


text:
package com.palantir.docker.compose.configuration;

import static com.google.common.base.Preconditions.checkState;

import com.google.common.collect.ImmutableList;
import java.util.List;
import java.util.UUID;
import java.util.function.Predicate;
import java.util.regex.Pattern;
import org.immutables.value.Value.Check;
import org.immutables.value.Value.Immutable;
import org.immutables.value.Value.Parameter;

@Immutable
@PackageVisible
public abstract class ProjectName {

    @Parameter
    protected abstract String projectName();

    @Check
    protected void validate() {
        checkState(projectName().trim().length() > 0, "ProjectName must not be blank.");

        checkState(validCharacters(),
                "ProjectName '%s' not allowed, please use lowercase letters and numbers only.", projectName());
    }

    // Only allows strings that docker-compose-cli would not modify
    // https://github.com/docker/compose/blob/85e2fb63b3309280a602f1f76d77d3a82e53b6c2/compose/cli/command.py#L84
    protected boolean validCharacters() {
        Predicate<String> illegalCharacters = Pattern.compile("[^a-z0-9]").asPredicate();
        return !illegalCharacters.test(projectName());
    }

    public String asString() {
        return projectName();
    }

    public List<String> constructComposeFileCommand() {
        return ImmutableList.of("--project-name", projectName());
    }

    public static ProjectName random() {
        return ImmutableProjectName.of(UUID.randomUUID().toString().substring(0, 8));
    }

    /**
     * @param name A name consisting of lowercase letters and numbers only.
     * @return The corresponding project name
     * @see ProjectName
     */
    public static ProjectName fromString(String name) {
        return ImmutableProjectName.of(name);
    }
}


text:
$(function () {

  'use strict';

  var $image = $(window.createCropperImage());

  $image.on('cropmove.cropper', function (e) {

    QUnit.test('events#cropmove', function (assert) {
      assert.equal(e.type, 'cropmove');
      assert.equal(e.action, 'crop');
    });

  }).cropper({
    ready: function () {
      var $dragBox = $image.data('cropper').$dragBox;

      // Triggers events manually when ready
      $dragBox.trigger('mousedown').trigger('mousemove').trigger('mouseup');
    },

    cropmove: function (e) {

      QUnit.test('options#cropmove', function (assert) {
        assert.equal(e.type, 'cropmove');
        assert.equal(e.action, 'crop');
      });

    }
  });

});


text:
package ghpages.examples

import ghpages.GhPagesMacros
import japgolly.scalajs.react._, vdom.prefix_<^._
import ghpages.examples.util.SideBySide

object ProductTableExample {

  def content = SideBySide.Content(jsSource, source, main())

  lazy val main = addIntro(FilterableProductTable withProps products,
    _(scalaPortOfPage("docs/thinking-in-react.html")))

  val jsSource =
    """
      |var ProductCategoryRow = React.createClass({
      |    render: function() {
      |        return (
{this.props.category}
);
      |    }
      |});
      |
      |var ProductRow = React.createClass({
      |    render: function() {
      |        var name = this.props.product.stocked ?
      |            this.props.product.name :
      |
      |                {this.props.product.name}
      |            ;
      |        return (
      |

      |                {name}
      |                {this.props.product.price}
      |

      |        );
      |    }
      |});
      |
      |var ProductTable = React.createClass({
      |    render: function() {
      |        console.log(this.props);
      |        var rows = [];
      |        var lastCategory = null;
      |        this.props.products.forEach(function(product) {
      |            if (product.name.indexOf(this.props.filterText) === -1 || (!product.stocked && this.props.inStockOnly)) {
      |                return;
      |            }
      |            if (product.category !== lastCategory) {
      |                rows.push(<ProductCategoryRow category={product.category} key={product.category} />);
      |            }
      |            rows.push(<ProductRow product={product} key={product.name} />);
      |            lastCategory = product.category;
      |        }.bind(this));
      |        return (
      |

      |

      |

      |                        Name
      |                        Price
      |

      |

      |
{rows}

      |

      |        );
      |    }
      |});
      |
      |var SearchBar = React.createClass({
      |    handleChange: function() {
      |        this.props.onUserInput(
      |            this.refs.filterTextInput.getDOMNode().value,
      |            this.refs.inStockOnlyInput.getDOMNode().checked
      |        );
      |    },
      |    render: function() {
      |        return (
      |            <form>
      |                <input
      |                    type="text"
      |                    placeholder="Search..."
      |                    value={this.props.filterText}
      |                    ref="filterTextInput"
      |                    onChange={this.handleChange}
      |                />
      |

      |                    <input
      |                        type="checkbox"
      |                        value={this.props.inStockOnly}
      |                        ref="inStockOnlyInput"
      |                        onChange={this.handleChange}
      |                    />
      |                    Only show products in stock
      |

      |            </form>
      |        );
      |    }
      |});
      |
      |var FilterableProductTable = React.createClass({
      |    getInitialState: function() {
      |        return {
      |            filterText: '',
      |            inStockOnly: false
      |        };
      |    },
      |
      |    handleUserInput: function(filterText, inStockOnly) {
      |        this.setState({
      |            filterText: filterText,
      |            inStockOnly: inStockOnly
      |        });
      |    },
      |
      |    render: function() {
      |        return (
      |

      |                <SearchBar
      |                    filterText={this.state.filterText}
      |                    inStockOnly={this.state.inStockOnly}
      |                    onUserInput={this.handleUserInput}
      |                />
      |                <ProductTable
      |                    products={this.props.products}
      |                    filterText={this.state.filterText}
      |                    inStockOnly={this.state.inStockOnly}
      |                />
      |

      |        );
      |    }
      |});
      |
      |
      |var PRODUCTS = [
      |  {category: 'Sporting Goods', price: '$49.99', stocked: true, name: 'Football'},
      |  {category: 'Sporting Goods', price: '$9.99', stocked: true, name: 'Baseball'},
      |  {category: 'Sporting Goods', price: '$29.99', stocked: false, name: 'Basketball'},
      |  {category: 'Electronics', price: '$99.99', stocked: true, name: 'iPod Touch'},
      |  {category: 'Electronics', price: '$399.99', stocked: false, name: 'iPhone 5'},
      |  {category: 'Electronics', price: '$199.99', stocked: true, name: 'Nexus 7'}
      |];
      |
      |React.render(<FilterableProductTable products={PRODUCTS} />, document.body);
      | """.stripMargin

  val source = GhPagesMacros.exampleSource

  // EXAMPLE:START

  case class Product(name: String, price: Double, category: String, stocked: Boolean)

  case class State(filterText: String, inStockOnly: Boolean)

  class Backend($: BackendScope[_, State])  {
    def onTextChange(e: ReactEventI) =
      $.modState(_.copy(filterText = e.target.value))
    def onCheckBox(e: ReactEvent) =
      $.modState(s => s.copy(inStockOnly = !s.inStockOnly))
  }

  val ProductCategoryRow = ReactComponentB[String]("ProductCategoryRow")
    .render(category => <.tr(<.th(^.colSpan := 2, category)))
    .build

  val ProductRow = ReactComponentB[Product]("ProductRow")
    .render(P =>
      <.tr(
        <.td(<.span(!P.stocked ?= ^.color.red, P.name)),
        <.td(P.price))
    )
    .build

  def productFilter(s: State)(p: Product): Boolean =
    p.name.contains(s.filterText) &&
    (!s.inStockOnly || p.stocked)

  val ProductTable = ReactComponentB[(List[Product], State)]("ProductTable")
    .render(P => {
      val (products, state) = P
      val rows = products.filter(productFilter(state))
                 .groupBy(_.category).toList
                 .flatMap{ case (cat, ps) =>
                    ProductCategoryRow.withKey(cat)(cat) :: ps.map(p => ProductRow.withKey(p.name)(p))
                  }
      <.table(
        <.thead(
          <.tr(
            <.th("Name"),
            <.th("Price"))),
        <.tbody(
          rows))
    })
    .build

  val SearchBar = ReactComponentB[(State, Backend)]("SearchBar")
    .render(P => {
      val (s, b) = P
      <.form(
        <.input(
          ^.placeholder := "Search Bar ...",
          ^.value       := s.filterText,
          ^.onChange   ==> b.onTextChange),
        <.p(
          <.input(
            ^.tpe     := "checkbox",
            ^.onClick ==> b.onCheckBox,
            "Only show products in stock")))
    })
    .build

  val FilterableProductTable = ReactComponentB[List[Product]]("FilterableProductTable")
    .initialState(State("", false))
    .backend(new Backend(_))
    .render((P, S, B) =>
      <.div(
        SearchBar((S,B)),
        ProductTable((P,S)))
    ).build

    val products = List(
      Product("FootBall", 49.99, "Sporting Goods", true),
      Product("Baseball", 9.99, "Sporting Goods", true),
      Product("basketball", 29.99, "Sporting Goods", false),
      Product("ipod touch", 99.99, "Electronics", true),
      Product("iphone 5", 499.99, "Electronics", true),
      Product("Nexus 7", 199.99, "Electronics", true))

  // EXAMPLE:END
}


text:
namespace yarpl {
namespace observable {

std::shared_ptr<Observable<int64_t>> Observable<>::range(
    int64_t start,
    int64_t count) {
  auto lambda = [start, count](std::shared_ptr<Observer<int64_t>> observer) {
    auto end = start + count;
    for (int64_t i = start; i < end; ++i) {
      observer->onNext(i);
    }
    observer->onComplete();
  };

  return Observable<int64_t>::create(std::move(lambda));
}
} // namespace observable
} // namespace yarpl


text:
import { getReference } from '../utils'
import { getResourceSlot } from '../selectors'
import Registry from '../utils/registry'
/*
 * action types
 */

export const ADD_RESOURCE = 'ADD_RESOURCE'
export const SET_RESOURCE_AMOUNT = 'SET_RESOURCE_AMOUNT'
export const UPDATE_RESOURCE_BAG = 'UPDATE_RESOURCE_BAG'

/*
 * action creators
 */

export function addResource(resourceBag, resource) {
  return {
    type: ADD_RESOURCE,
    resourceBag: getReference(resourceBag),
    resource: getReference(resource),
  }
}

export function setResourceAmount(resourceBag, resource, newValue) {
  return {
    type: SET_RESOURCE_AMOUNT,
    resource: getReference(resource),
    resourceBag: getReference(resourceBag),
    newAmount: newValue,
  }
}


text:
// Code generated by informer-gen. DO NOT EDIT.

package internalversion

import (
	internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
)

// Interface provides access to all the informers in this group version.
type Interface interface {
	// StorageClasses returns a StorageClassInformer.
	StorageClasses() StorageClassInformer
	// VolumeAttachments returns a VolumeAttachmentInformer.
	VolumeAttachments() VolumeAttachmentInformer
}

type version struct {
	factory          internalinterfaces.SharedInformerFactory
	namespace        string
	tweakListOptions internalinterfaces.TweakListOptionsFunc
}

// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
	return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}

// StorageClasses returns a StorageClassInformer.
func (v *version) StorageClasses() StorageClassInformer {
	return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

// VolumeAttachments returns a VolumeAttachmentInformer.
func (v *version) VolumeAttachments() VolumeAttachmentInformer {
	return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}


text:
set -o errexit
set -o nounset
set -o pipefail

# Change directories to the parent directory of the one in which this
# script is located.
cd "$(dirname "${BASH_SOURCE[0]}")/.."

# Ensure the temp out file is removed when this program exits.
out="$(mktemp)"
on_exit() {
  [ -z "${out}" ] || [ ! -e "${out}" ] || rm -f "${out}"
}
trap on_exit EXIT

# Run goformat on all the sources.
flags="-e -s -w"
[ -z "${PROW_JOB_ID-}" ] || flags="-d ${flags}"
eval "gofmt ${flags} ./cmd/ ./pkg/" | tee "${out}"

# Check to see if there any suggestions.
goformat_exit_code=0; test -z "$(head -n 1 "${out}")" || goformat_exit_code=1

# Truncate the out file.
rm -f "${out}" && touch "${out}"

# Run goimports on all the sources.
go get golang.org/x/tools/cmd/goimports
go install golang.org/x/tools/cmd/goimports
cmd=$(go list -f \{\{\.Target\}\} golang.org/x/tools/cmd/goimports)
flags="-e -w"
[ -z "${PROW_JOB_ID-}" ] || flags="-d ${flags}"
eval "${cmd} ${flags} ./cmd/ ./pkg/" | tee "${out}"

# Check to see if there any suggestions.
goimports_exit_code=0; test -z "$(head -n 1 "${out}")" || goimports_exit_code=1

# If running on Prow, exit with a non-zero code if either of the tests failed.
if [ -n "${PROW_JOB_ID-}" ]; then
  [ "${goformat_exit_code}" -eq "0" ] ||  exit "${goformat_exit_code}"
  [ "${goimports_exit_code}" -eq "0" ] || exit "${goimports_exit_code}"
fi


text:
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (c) 2020. Adventech <info@adventech.io>
  ~
  ~ 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.
  -->

<resources>
    <string name="ss_app_name">"Bài học Sa-bát"</string>
    <string name="ss_share">"Chia sẻ"</string>
    <string name="ss_login_button_google">"Đăng nhập bằng Google"</string>
    <string name="ss_login_button_anonymous">"Đăng nhập nặc danh"</string>
    <string name="ss_menu_anonymous_name">"Vô danh"</string>
    <string name="ss_menu_sign_out">"Đăng xuất"</string>
    <string name="ss_menu_read_now">"Đọc ngay"</string>
    <string name="ss_menu_share_app">"Chia sẻ ứng dụng"</string>
    <string name="ss_menu_share_app_text">"Kiểm tra ứng dụng Sabbath School mới mà tôi đang sử dụng - %1$s"</string>
    <string name="ss_my_highlights">"Điểm nổi bật của tôi"</string>
    <string name="ss_my_notes">"Ghi chú của tôi"</string>
    <string name="ss_settings">"Cài đặt"</string>
    <string name="ss_about">"Trong khoảng"</string>
    <string name="ss_login_failed">"Đăng nhập thất bại. Vui lòng thử lại."</string>
    <string name="ss_login_anonymously_dialog_positive">"Vâng"</string>
    <string name="ss_login_anonymously_dialog_negative">"Không"</string>
    <string name="ss_login_anonymously_dialog_title">"Đăng nhập nặc danh?"</string>
    <string name="ss_login_anonymously_dialog_description">"Nếu bạn đăng nhập ẩn danh, bạn sẽ không thể đồng bộ hóa dữ liệu của mình (như nhận xét và nội dung nổi bật) trên các thiết bị hoặc sau khi gỡ cài đặt ứng dụng. Bạn có chắc muốn tiếp tục?"</string>
    <string name="ss_quarterlies_filter_languages">"Ngôn ngữ"</string>
    <string name="ss_quarterlies_downloading">"Bắt tứ quý"</string>
    <string name="ss_quarterlies_error">"Xảy ra lỗi không xác định được. Vui lòng thử lại."</string>
    <string name="ss_quarterlies_empty">"Không có phần tư có sẵn tại thời điểm này"</string>
    <string name="ss_quarterly_item_read_text">"Mở"</string>
    <string name="ss_lessons_downloading">"Khai trương hàng quý"</string>
    <string name="ss_lessons_error">"Xảy ra lỗi trong khi mở hàng quý"</string>
    <string name="ss_lessons_empty">"Không có phần tư có sẵn tại thời điểm này"</string>
    <string name="ss_lessons_read">"Đọc"</string>
    <string name="ss_reading_empty">"Chúng tôi đang làm việc trên bài học này. Vui lòng kiểm tra lại sớm."</string>
    <string name="ss_reading_error">"Xảy ra lỗi trong khi mở bài học"</string>
    <string name="ss_reading_downloading">"Tải xuống bài học để đọc ngoại tuyến"</string>
    <string name="ss_reading_suggest_edit">"Đề nghị chỉnh sửa hoặc chỉnh sửa"</string>
    <string name="ss_reading_suggest_edit_hint">"Vui lòng mô tả sự điều chỉnh hoặc đề nghị của bạn"</string>
    <string name="ss_reading_suggest_edit_done">"Cảm ơn bạn! Đề nghị của bạn sẽ được xem xét."</string>
    <string name="ss_reading_comment">"Bình luận"</string>
    <string name="ss_reading_enter_comment">"Nhập bình luận của bạn"</string>
    <string name="ss_reading_copied">"Lựa chọn sao chép"</string>
    <string name="ss_reading_share_to">"Chia sẻ lựa chọn để:"</string>

    <string name="ss_about_made">"Được làm bằng bởi Adventech"</string>
    <string name="ss_settings_display_options">"Tùy chọn hiển thị"</string>
    <string name="ss_settings_color_theme_light">"Ánh sáng"</string>
    <string name="ss_settings_color_theme_sepia">"Nâu đỏ"</string>
    <string name="ss_settings_color_theme_dark">"Tối"</string>
    <string name="ss_settings_typeface">"Phông chữ"</string>
    <string name="ss_settings_font_size">"Cỡ chữ"</string>
    <string name="ss_settings_font_size_tiny">"Nhỏ bé"</string>
    <string name="ss_settings_font_size_small">"Nhỏ bé"</string>
    <string name="ss_settings_font_size_medium">"Trung bình"</string>
    <string name="ss_settings_font_size_large">"Lớn"</string>
    <string name="ss_settings_font_size_huge">"Khổng lồ"</string>
    <string name="ss_settings_version">"Phiên bản"</string>

    <!-- RATE APP -->
    <string name="rate_dialog_title">"Đánh giá ứng dụng này"</string>
    <string name="rate_dialog_message">"Hãy dành một chút thời gian để đánh giá ứng dụng này. Cảm ơn sự hỗ trợ của bạn!"</string>
    <string name="rate_dialog_ok">"Đánh giá nó"</string>
    <string name="rate_dialog_cancel">"Một lát sau"</string>
    <string name="rate_dialog_no">"Không"</string>
    <string name="ss_settings_website">"Trang mạng"</string>
    <string name="ss_quarterlies_filter_languages_prompt_title">"Thêm ngôn ngữ"</string>
    <string name="ss_quarterlies_filter_languages_prompt_description">"Nhấn vào biểu tượng bộ lọc để xem các ngôn ngữ có sẵn"</string>
    <string name="ss_bible">"Kinh thánh"</string>
    <string name="ss_settings_reminder">"Nhắc nhở hàng ngày"</string>
    <string name="ss_settings_reminder_summary">"Kiểm tra để bật nhắc nhở học tập hàng ngày"</string>
    <string name="ss_settings_reminder_time">"Thời gian nhắc nhở"</string>
    <string name="ss_settings_reminder_text">"Thời gian để học bài Sabbath School"</string>
    <string name="ss_reading_offline">"Bạn đang offline. Kết nối lại để đọc bài học này."</string>
    <string name="ss_reading_offline_retry">"Thử lại"</string>
    <string name="ss_about_text">"Sứ mệnh của Adventech là trên hết và trước hết - hãy mang lại vinh quang cho Lᴏʀᴅ của chúng ta, Ancient of Days. Chúng tôi được dành riêng để làm bộ của chúng tôi thông qua công nghệ. Mục tiêu của chúng tôi là hợp nhất Giáo hội Cơ Đốc Phục Lâm của chúng tôi. Mục tiêu của chúng tôi là loan báo Tin mừng cho thế giới này bằng công nghệ và những tiến bộ trong truyền thông. Mục tiêu của chúng tôi là chứng kiến Chúa Jesus Lần thứ hai đến.

Chúng ta được truyền cảm hứng bởi tấm gương và phương pháp của Chúa Giêsu, khi Ngài khai thác ở đây trên Trái đất. Do đó, chúng tôi cam kết cung cấp mức độ cao về chất lượng của tất cả các dự án của chúng tôi hoàn toàn miễn phí với tình yêu và sự cống hiến. Chúng tôi cam kết ban vinh quang cho Cha của chúng tôi, bởi vì Ngài xứng đáng được ca ngợi cao nhất.

Chúng tôi thực sự tin rằng Chúa đã gia tăng kiến thức về thế giới hiện đại và muốn chúng tôi sử dụng nó cho vinh quang của Ngài để tuyên bố sự trở lại sớm của Ngài!"</string>
    <string name="ss_settings_version_with_param_string">Phiên bản: %1$s</string>
    <string name="ss_more">Hơn</string>
    <string name="ss_copyright">%1$s Đại hội những người Cơ đốc Phục lâm ngày thứ bảy®</string>
    <string name="ss_see_all">Nhìn thấy tất cả</string>
    <string name="ss_media_video">Video</string>
    <string name="ss_media_audio">Âm thanh</string>
    <string name="ss_pdf_original">Bố trí gốc</string>
    <string name="ss_settings_theme">Chủ đề</string>
    <string name="ss_settings_theme_default">Vỡ nợ</string>
    <string name="ss_get_printed_resources">Nhận tài nguyên in</string>
    <string name="ss_account">Tài khoản</string>
    <string name="ss_action_arrow_back">Mũi tên quay lại</string>
    <string name="ss_action_arrow_drop_down">Mũi tên thả xuống</string>
    <string name="ss_action_arrow_right">Mũi tên phải</string>
    <string name="ss_action_close">Đóng</string>
    <string name="ss_action_selected">Đã chọn</string>
    <string name="ss_action_back">Mặt sau</string>
    <string name="ss_action_open">Mở</string>
    <string name="ss_action_rewind">Tua lại</string>
    <string name="ss_action_play_pause">Phát hoặc Tạm dừng</string>
    <string name="ss_action_playlist">Danh sách phát</string>
    <string name="ss_action_forward">Ở đằng trước</string>
    <string name="ss_picture_in_picture">Hình ảnh trong ảnh</string>
    <string name="ss_auto">Tự động</string>
</resources>


text:
/*	$NetBSD: if_arc.h,v 1.13 1999/11/19 20:41:19 thorpej Exp $	*/
/* $FreeBSD: src/sys/net/if_arc.h,v 1.4 2002/09/23 06:25:08 alfred Exp $ */

/*
 * Copyright (c) 1982, 1986, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * from: NetBSD: if_ether.h,v 1.10 1994/06/29 06:37:55 cgd Exp
 *       @(#)if_ether.h	8.1 (Berkeley) 6/10/93
 */

#ifndef _NET_IF_ARC_H_
#define _NET_IF_ARC_H_

/*
 * Arcnet address - 1 octets
 * don't know who uses this.
 */
struct arc_addr {
	u_int8_t  arc_addr_octet[1];
} __packed;

/*
 * Structure of a 2.5MB/s Arcnet header.
 * as given to interface code.
 */
struct	arc_header {
	u_int8_t  arc_shost;
	u_int8_t  arc_dhost;
	u_int8_t  arc_type;
	/*
	 * only present for newstyle encoding with LL fragmentation.
	 * Don't use sizeof(anything), use ARC_HDR{,NEW}LEN instead.
	 */
	u_int8_t  arc_flag;
	u_int16_t arc_seqid;

	/*
	 * only present in exception packets (arc_flag == 0xff)
	 */
	u_int8_t  arc_type2;	/* same as arc_type */
	u_int8_t  arc_flag2;	/* real flag value */
	u_int16_t arc_seqid2;	/* real seqid value */
} __packed;

#define	ARC_ADDR_LEN		1

#define	ARC_HDRLEN		3
#define	ARC_HDRNEWLEN		6
#define	ARC_HDRNEWLEN_EXC	10

/* these lengths are data link layer length - 2*ARC_ADDR_LEN */
#define	ARC_MIN_LEN		1
#define	ARC_MIN_FORBID_LEN	254
#define	ARC_MAX_FORBID_LEN	256
#define	ARC_MAX_LEN		508

/* RFC 1051 */
#define	ARCTYPE_IP_OLD		240	/* IP protocol */
#define	ARCTYPE_ARP_OLD		241	/* address resolution protocol */

/* RFC 1201 */
#define	ARCTYPE_IP		212	/* IP protocol */
#define	ARCTYPE_ARP		213	/* address resolution protocol */
#define	ARCTYPE_REVARP		214	/* reverse addr resolution protocol */

#define	ARCTYPE_ATALK		221	/* Appletalk */
#define	ARCTYPE_BANIAN		247	/* Banyan Vines */
#define	ARCTYPE_IPX		250	/* Novell IPX */

#define ARCTYPE_INET6		0xc4	/* IPng */
#define ARCTYPE_DIAGNOSE	0x80	/* as per ANSI/ATA 878.1 */

#define	ARCMTU			507
#define	ARCMIN			0

#define ARC_PHDS_MAXMTU		60480

struct	arccom {
	struct	  ifnet ac_if;		/* network-visible interface */

	u_int16_t ac_seqid;		/* seq. id used by PHDS encap. */

	u_int8_t  arc_shost;
	u_int8_t  arc_dhost;
	u_int8_t  arc_type;

	u_int8_t  dummy0;
	u_int16_t dummy1;
	int sflag, fsflag, rsflag;
	struct mbuf *curr_frag;

	struct ac_frag {
		u_int8_t  af_maxflag;	/* from first packet */
		u_int8_t  af_lastseen;	/* last split flag seen */
		u_int16_t af_seqid;
		struct mbuf *af_packet;
	} ac_fragtab[256];		/* indexed by sender ll address */
};

#ifdef _KERNEL
extern u_int8_t arcbroadcastaddr;
extern int arc_ipmtu;	/* XXX new ip only, no RFC 1051! */

void	arc_ifattach(struct ifnet *, u_int8_t);
void	arc_ifdetach(struct ifnet *);
void	arc_storelladdr(struct ifnet *, u_int8_t);
char	*arc_sprintf(u_int8_t *);
int	arc_isphds(int);
void	arc_input(struct ifnet *, struct mbuf *);
int	arc_output(struct ifnet *, struct mbuf *,
	    struct sockaddr *, struct rtentry *);
int	arc_ioctl(struct ifnet *, int, caddr_t);

void		arc_frag_init(struct ifnet *);
struct mbuf *	arc_frag_next(struct ifnet *);
#endif

#endif /* _NET_IF_ARC_H_ */


text:
import { VNode } from 'snabbdom/vnode';
import h from 'snabbdom/h';
import { Observable } from 'rxjs';
import { filter } from 'rxjs/operators';

import { Inject, PostConstruct } from '../di';
import { Renderable, RenderableDestroyContext, RenderableConfig } from '../dom';
import { ContainerRef, ConfigurationRef, DragEvent } from '../common';
import { XYContainer } from './XYContainer';
import { Draggable } from '../Draggable';
import { LockState, LOCK_RESIZING } from '../LockState';

export const SPLITTER_SIZE = 5;

export interface SplitterConfig extends RenderableConfig {
  size: number;
  disabler?: (splitter: Splitter) => boolean;
}

export class Splitter extends Renderable<SplitterConfig> {
  dragStatus: Observable<DragEvent<Splitter>>;
  x: number = 0;
  y: number = 0;

  private _isDragging: boolean = false;
  private _element: HTMLElement;
  private _isDisabled: boolean = false;

  @Inject(ConfigurationRef) protected _config: SplitterConfig;
  @Inject(ContainerRef) protected _container: XYContainer;
  @Inject(Draggable) protected _draggable: Draggable<Splitter>;
  @Inject(LockState) protected _lockState: LockState;

  get height(): number {
    return this._isRow ? this._container.height : this._config.size;
  }

  get width(): number {
    return this._isRow ? this._config.size : this._container.width;
  }

  get size(): number {
    return this._isRow ? this.width : this.height;
  }

  get element(): HTMLElement {
    return this._element;
  }

  get isDisabled(): boolean {
    return this._isDisabled || Boolean(this._config.disabler && this._config.disabler(this));
  }

  private get handleStyles(): { [key:string]: any } {
    if (this._isRow) {
      return {
        height: `${this.height}px`,
        width: `${this.width + 10}px`,
        left: `${this.x - 5}px`,
        top: 0
      };
    }

    return {
      height: `${this.height + 10}px`,
      width: `${this.width}px`,
      left: 0,
      top: `${this.y - 5}px`
    };
  }

  private get _isRow(): boolean {
    return this._container.isRow;
  }

  @PostConstruct()
  initialize(): void {
    super.initialize();

    this.dragStatus = this._draggable.drag;

    this._draggable.drag
      .pipe(filter(Draggable.isDragStopEvent))
      .subscribe(() => this._isDragging = false);

    this._draggable.drag
      .pipe(filter(Draggable.isDragStartEvent))
      .subscribe(this._onDragStart.bind(this));

    this._lockState
      .scope(LOCK_RESIZING)
      .subscribe(isLocked => isLocked ? this.disable() : this.enable());
  }

  dragTo(x = this.x, y = this.y): void {
    this.x = x;
    this.y = y;
    this._element.style.transform = `translateX(${this.x}px) translateY(${this.y}px)`
  }

  render(): VNode {
    return h(`div.ug-layout__splitter`, {
      key: this.uid,
      class: {
        'ug-layout__splitter-disabled': this.isDisabled,
        'ug-layout__splitter-x': this._isRow,
        'ug-layout__splitter-y': !this._isRow,
        'ug-layout__splitter-dragging': this._isDragging
      },
      style: {
        height: `${this.height}px`,
        width: `${this.width}px`,
        transform: `translateX(${this.x}px) translateY(${this.y}px)`
      },
      hook: {
        create: (oldNode, newNode) => this._element = newNode.elm as HTMLElement
      }
    }, [
      h('div.ug-layout__drag-handle', {
        style: this.handleStyles,
        on: {
          mousedown: e => this._onMouseDown(e)
        }
      })
    ]);
  }

  destroy(context: RenderableDestroyContext): void {
    this._draggable.destroy();
    super.destroy(context);
  }

  disable(): void {
    this._isDisabled = true;
  }

  enable(): void {
    this._isDisabled = false;
  }

  private _onMouseDown(e: MouseEvent): void {
    e.preventDefault();

    if (!this.isDisabled) {
      this._draggable.startDrag({
        host: this,
        startX: e.pageX,
        startY: e.pageY,
        threshold: 1
      });
    }
  }

  private _onDragStart(): void {
    this._isDragging = true;
    this._renderer.render();
  }
}


text:
"""Import an image and show its inside border"""

import cv2

def showBorder(fileName):
	#try to load all channels including alpha
	img_orig = cv2.imread(fileName,-1);
	#to check whether it's alpha-channel enabled (4 channels)
	if(img_orig.shape[2] < 4) :
		#print debug infor out...
		print 'Not Alpha image, nothing to do!';
		return None;

	img_clone = img_orig.copy();
	img_alpha = img_clone[:,:,3:]; #only alpha channel considered and reshape to shallower structure
	img_alpha = img_alpha.reshape(img_alpha.shape[0],img_alpha.shape[1]);
	#cv2.imshow('Alpha',img_alpha);  #debug info: to show threshold image

	ret,img_alpha = cv2.threshold(img_alpha,5,1,cv2.THRESH_BINARY);
	#cont,hier = cv2.findContours(img_alpha, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_TC89_L1);
	#very most outsider contour
	cont,hier = cv2.findContours(img_alpha, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE);
	#cont,hier = cv2.findContours(img_alpha, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE);
	cv2.drawContours(img_clone, cont, -1, (255,255,128), thickness=2);
	cv2.imshow('final',img_clone);
	cv2.waitKey();


text:
@extends('layouts.app')

@section('content')
    <jumbo bg="/img/jumbo.jpg" :videos="true" :event='@json($meetup__next_event ?? null)'></jumbo>

Meet the Speakers

Awesome people giving talks at the next {{ config('app.name') }} meetup.

                @isset ($meetup__next_event)
                    @forelse ($meetup__next_event->get('talks', []) as $talk)
                        <single-speaker :talk='@json($talk)'></single-speaker>
                        @if ($loop->last)

                                Previous talks

                        @endif
                    @empty

                                No speakers yet. If you're interested, you can apply to speak by using the link below.

                                Apply to Speak

                    @endforelse
                @else

                            The next meetup has not been scheduled. While you wait, you can see
                            previous talks.

                @endisset

    <single-tweet :tweet='@json($tweet)'></single-tweet>
    <learn-laravel :tracks="false"></learn-laravel>
    <slack-inviter team="{{ config('services.community_inviter.slack_team') }}"></slack-inviter>
    <sponsors-slider :sponsors='@json($sponsors)'></sponsors-slider>
@endsection


text:
Nuit de l'Info 2014 – Vladimir Pouteam
Website Project
======================
WOW SUCH CODE


text:
export default class BiMap<TValue> {
    constructor(object?: { [i: string]: TValue });
    size: number;

    set(key: string, value: TValue): void;
    get(key: string): TValue;
    getKey(value: TValue): string;
    clear(): void;
    delete(key: string): void;
    deleteValue(value: TValue): void;
    entries(): IterableIterator<[string, TValue]>;
    has(key: string): boolean;
    hasValue(value: TValue): boolean;
    keys(): IterableIterator<string>;
    values(): IterableIterator<TValue>;
}


text:
package imagerepository

import (
	"fmt"

	"code.google.com/p/go-uuid/uuid"

	kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"

	"github.com/openshift/origin/pkg/image/api"
)

// REST implements the RESTStorage interface in terms of an Registry.
type REST struct {
	registry Registry
}

// NewREST returns a new REST.
func NewREST(registry Registry) apiserver.RESTStorage {
	return &REST{registry}
}

// New returns a new ImageRepository for use with Create and Update.
func (s *REST) New() runtime.Object {
	return &api.ImageRepository{}
}

// List retrieves a list of ImageRepositories that match selector.
func (s *REST) List(ctx kapi.Context, selector, fields labels.Selector) (runtime.Object, error) {
	imageRepositories, err := s.registry.ListImageRepositories(ctx, selector)
	if err != nil {
		return nil, err
	}
	return imageRepositories, err
}

// Get retrieves an ImageRepository by id.
func (s *REST) Get(ctx kapi.Context, id string) (runtime.Object, error) {
	repo, err := s.registry.GetImageRepository(ctx, id)
	if err != nil {
		return nil, err
	}
	return repo, nil
}

// Watch begins watching for new, changed, or deleted ImageRepositories.
func (s *REST) Watch(ctx kapi.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
	return s.registry.WatchImageRepositories(ctx, resourceVersion, func(repo *api.ImageRepository) bool {
		fields := labels.Set{
			"ID": repo.ID,
			"DockerImageRepository": repo.DockerImageRepository,
		}
		return label.Matches(labels.Set(repo.Labels)) && field.Matches(fields)
	})
}

// Create registers the given ImageRepository.
func (s *REST) Create(ctx kapi.Context, obj runtime.Object) (<-chan runtime.Object, error) {
	repo, ok := obj.(*api.ImageRepository)
	if !ok {
		return nil, fmt.Errorf("not an image repository: %#v", obj)
	}
	if !kapi.ValidNamespace(ctx, &repo.TypeMeta) {
		return nil, errors.NewConflict("imageRepository", repo.Namespace, fmt.Errorf("ImageRepository.Namespace does not match the provided context"))
	}

	if len(repo.ID) == 0 {
		repo.ID = uuid.NewUUID().String()
	}

	if repo.Tags == nil {
		repo.Tags = make(map[string]string)
	}

	repo.CreationTimestamp = util.Now()

	return apiserver.MakeAsync(func() (runtime.Object, error) {
		if err := s.registry.CreateImageRepository(ctx, repo); err != nil {
			return nil, err
		}
		return s.Get(ctx, repo.ID)
	}), nil
}

// Update replaces an existing ImageRepository in the registry with the given ImageRepository.
func (s *REST) Update(ctx kapi.Context, obj runtime.Object) (<-chan runtime.Object, error) {
	repo, ok := obj.(*api.ImageRepository)
	if !ok {
		return nil, fmt.Errorf("not an image repository: %#v", obj)
	}
	if len(repo.ID) == 0 {
		return nil, fmt.Errorf("id is unspecified: %#v", repo)
	}
	if !kapi.ValidNamespace(ctx, &repo.TypeMeta) {
		return nil, errors.NewConflict("imageRepository", repo.Namespace, fmt.Errorf("ImageRepository.Namespace does not match the provided context"))
	}

	return apiserver.MakeAsync(func() (runtime.Object, error) {
		err := s.registry.UpdateImageRepository(ctx, repo)
		if err != nil {
			return nil, err
		}
		return s.Get(ctx, repo.ID)
	}), nil
}

// Delete asynchronously deletes an ImageRepository specified by its id.
func (s *REST) Delete(ctx kapi.Context, id string) (<-chan runtime.Object, error) {
	return apiserver.MakeAsync(func() (runtime.Object, error) {
		return &kapi.Status{Status: kapi.StatusSuccess}, s.registry.DeleteImageRepository(ctx, id)
	}), nil
}


text:
class AvatarButtonDelegate;
class Profile;

// Avatar button that displays the active profile's name in the caption area.
class NewAvatarButton : public views::LabelButton,
                        public ProfileAttributesStorage::Observer,
                        public SigninErrorController::Observer {
 public:
  NewAvatarButton(AvatarButtonDelegate* delegate,
                  AvatarButtonStyle button_style,
                  Profile* profile);
  ~NewAvatarButton() override;

  // Views::LabelButton
  bool OnMousePressed(const ui::MouseEvent& event) override;
  void OnMouseReleased(const ui::MouseEvent& event) override;

  // Views
  void OnGestureEvent(ui::GestureEvent* event) override;

 private:
  friend class ProfileChooserViewExtensionsTest;

  // ProfileAttributesStorage::Observer:
  void OnProfileAdded(const base::FilePath& profile_path) override;
  void OnProfileWasRemoved(const base::FilePath& profile_path,
                           const base::string16& profile_name) override;
  void OnProfileNameChanged(const base::FilePath& profile_path,
                            const base::string16& old_profile_name) override;
  void OnProfileSupervisedUserIdChanged(
      const base::FilePath& profile_path) override;

  // SigninErrorController::Observer:
  void OnErrorChanged() override;

  // Called when the profile info cache has changed, which means we might
  // have to update the icon/text of the button.
  void Update();

  AvatarButtonDelegate* delegate_;
  Profile* profile_;

  // Whether the signed in profile has an authentication error. Used to display
  // an error icon next to the button text.
  bool has_auth_error_;

  // The icon displayed instead of the profile name in the local profile case.
  // Different assets are used depending on the OS version.
  gfx::ImageSkia generic_avatar_;

  // This is used to check if the bubble was showing during the mouse pressed
  // event. If this is true then the mouse released event is ignored to prevent
  // the bubble from reshowing.
  bool suppress_mouse_released_action_;

  DISALLOW_COPY_AND_ASSIGN(NewAvatarButton);
};

#endif  // CHROME_BROWSER_UI_VIEWS_PROFILES_NEW_AVATAR_BUTTON_H_


text:
typedef InProcessBrowserTest ShelfBrowserTest;

// Confirm that a status bubble doesn't cause the shelf to darken.
IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) {
  ash::ShelfLayoutManager* shelf =
      ash::RootWindowController::ForShelf(
          browser()->window()->GetNativeWindow())->GetShelfLayoutManager();
  EXPECT_TRUE(shelf->IsVisible());

  // Ensure that the browser abuts the shelf.
  const gfx::Rect old_bounds = browser()->window()->GetBounds();
  const gfx::Rect new_bounds(
      old_bounds.x(),
      old_bounds.y(),
      old_bounds.width(),
      shelf->GetIdealBounds().y() - old_bounds.y());
  browser()->window()->SetBounds(new_bounds);
  EXPECT_FALSE(shelf->window_overlaps_shelf());

  // Show status, which will overlap the shelf by a pixel.
  browser()->window()->GetStatusBubble()->SetStatus(
      base::UTF8ToUTF16("Dummy Status Text"));
  shelf->UpdateVisibilityState();

  // Ensure that status doesn't cause overlap.
  EXPECT_FALSE(shelf->window_overlaps_shelf());
}


text:
@interface DetailViewController ()
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;
@property (weak, nonatomic) IBOutlet UITextField *latitudeTextField;
@property (weak, nonatomic) IBOutlet UITextField *longitudeTextField;
@property (weak, nonatomic) IBOutlet UILabel *mainLabel;

@property (weak, nonatomic) IBOutlet MKMapView *mapView;

@end

@implementation DetailViewController

#pragma mark - Managing the detail item

- (void)setDetailItem:(id)newDetailItem {
    if (_detailItem != newDetailItem) {
        _detailItem = newDetailItem;

        [self configureView];
    }
}

- (void)configureView {
    if (self.detailItem) {
        self.nameTextField.text = self.detailItem.name;
        self.latitudeTextField.text = [NSString stringWithFormat:@"%@", self.detailItem.latitude];
        self.longitudeTextField.text = [NSString stringWithFormat:@"%@", self.detailItem.longitude];
        [self updateLabel];

        CLLocationCoordinate2D myCoord = CLLocationCoordinate2DMake([self.detailItem.latitude floatValue], [self.detailItem.longitude floatValue]);
        [self.mapView setCenterCoordinate:myCoord animated:YES];

    }
}

- (IBAction)updateLabel {
    self.mainLabel.text = [NSString stringWithFormat:@"%@ \nLat:%@º - Lon:%@º", self.nameTextField.text, self.latitudeTextField.text, self.longitudeTextField.text];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    self.detailItem.name = self.nameTextField.text;
    self.detailItem.latitude = [NSNumber numberWithInteger:[self.latitudeTextField.text integerValue]];
    self.detailItem.longitude = [NSNumber numberWithInteger:[self.longitudeTextField.text integerValue]];

    NSError *error;

    [self.detailItem.managedObjectContext save:&error];
    if (error) {
        abort();
    }
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self configureView];

    PQFBouncingBalls *balls = [[PQFBouncingBalls alloc] initLoaderOnView:self.view];
    [balls show];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end