text:
class ClientSocket : public Socket
{
public:
    ClientSocket();
    ~ClientSocket();

    int Connect(const SocketAddress &remote);
};

#endif //__CLIENT_SOCKET_H__


text:
All notable changes of the PHPUnit 5.2 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [5.2.0] - 2016-02-05

### Added

* Implemented [#1902](https://github.com/sebastianbergmann/phpunit/issues/1902): Mark a test as risky when it performs an assertion on a test double
* Implemented [#1905](https://github.com/sebastianbergmann/phpunit/issues/1905): Add `--fail-on-risky` and `--fail-on-warning` commandline options as well as `failOnRisky` and `failOnWarning` configuration options
* Implemented [#1912](https://github.com/sebastianbergmann/phpunit/issues/1912): Add support for specifying the extension version with the `@requires` annotation
* Implemented [#1977](https://github.com/sebastianbergmann/phpunit/issues/1977): Add support for disabling annotations that control the ignoring of code coverage

[5.2.0]: https://github.com/sebastianbergmann/phpunit/compare/5.1...5.2.0

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lasiosphaeria subcaudata var. sarmentorum Mouton

### Remarks
null


text:
package com.openatlas.launcher;

import android.app.Activity;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.os.Bundle;

import com.openatlas.framework.OpenAtlasInternalConstant;

import com.openatlas.launcher.welcome.WelcomeFragment;
import com.openatlas.runtime.Globals;

public class LauncherActivity extends Activity {
	WelcomeFragment mFragment;
    public static boolean isAtlasDexopted() {
        PackageInfo packageInfo = null;
        try {
            packageInfo = Globals.getApplication().getPackageManager().getPackageInfo(Globals.getApplication().getPackageName(), 0);
        } catch (Throwable e) {
           e.printStackTrace();
        }
        SharedPreferences sharedPreferences = Globals.getApplication().getSharedPreferences(OpenAtlasInternalConstant.OPENATLAS_CONFIGURE, 0);
        if (packageInfo == null || !"dexopt".equals(sharedPreferences.getString(packageInfo.versionName, ""))) {
            return false;
        }
        return false;
    }
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
//		setContentView(R.layout.activity_loader_tesst);
        setContentView(R.layout.welcome_frame);
        this.mFragment = new WelcomeFragment();
        getFragmentManager().beginTransaction().add(R.id.frame, this.mFragment).commitAllowingStateLoss();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		//libcom_taobao_scan.so

	}
	/**
	 *
	 */
	public static void doLaunchoverUT() {

	}
}


text:
lock '3.1.0'

set :application, 'collins'
set :repo_url, 'git@github.com:Shopify/collins-private.git'
set :deploy_to, '/u/apps/collins'

# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }

# Default deploy_to directory is /var/www/my_app
# set :deploy_to, '/var/www/my_app'

# Default value for :scm is :git
# set :scm, :git

# Default value for :format is :pretty
# set :format, :pretty

# Default value for :log_level is :debug
# set :log_level, :debug

# Default value for :pty is false
# set :pty, true

# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}

# Default value for linked_dirs is []
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }

# Default value for keep_releases is 5
# set :keep_releases, 5

namespace :deploy do

  desc 'Compile application'

  task :compile do
    on roles(:app) do
      within '/u/apps/collins/current' do
        execute :pwd
        execute :play, 'clean compile stage'
        execute :mkdir, 'target/conf'
        execute :touch, 'target/conf/metrics-reporter-config.yaml'
        execute :sv, 'restart collins'
      end
    end
  end

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      # Your restart mechanism here, for example:
      # execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after :publishing, :compile
  after :publishing, :restart

  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      # Here we can do anything such as:
      # within release_path do
      #   execute :rake, 'cache:clear'
      # end
    end
  end

end


text:
const globby = require('globby')
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { DefinePlugin } = require('webpack')

const contentSource = 'src'
const ASSET_PATH = process.env.ASSET_PATH || '/'

// Convert absolute filepaths to project relative ones to use as
// output destinations.
const makeRelativePath = (filepath) =>
  path.relative(path.join(__dirname, contentSource), filepath)

// Strip `/src` from output destination pathnames.
// Otherwise Webpack outputs files at `/dist/src/*`
const fileLoaderOutputPath = ({ filename }) => {
  return filename.replace(`${contentSource}/`, '')
}

const browserEntries = ['./src/**/*.{css,ts,ttf,woff,woff2}', '!**/lib/**/*.ts']

const libEntries = ['./src/lib/**/*.ts']

module.exports = (env = {}, { mode }) => {
  // Build target, can be one of: [`browser` | 'lib' | 'docs']
  const target = env.target || 'browser'
  const isDocs = env.target === 'docs'
  const isDevelopment = mode === 'development'
  const contentBase = isDocs ? 'docs' : 'dist'

  const entries = [
    ...(target === 'lib' ? libEntries : browserEntries),
    // Don't compile test files for package distribution
    '!**/*.{d,test}.ts',
    // These files make use of Node APIs, and do not need to be packaged for Browser targets
    '!**/scripts/*.ts',
    '!**/extensions/math/update.ts',
    '!**/extensions/extensions.ts',
    // Don't build HTML demo files for package distribution
    ...(isDocs || isDevelopment
      ? [
          './src/**/*.{jpg,png,gif,tsx,html}',
          // Template are used as basis for HtmlWebpackPlugin, and should not be used as an entry points
          '!./src/demo/templates/*',
        ]
      : ['!**/*.html', '!./src/demo/**/*', '!./src/examples/*']),
  ]

  const entry = globby.sync(entries).reduce(
    (files, file) => ({
      ...files,
      [makeRelativePath(file).replace(/.ts$/, '').replace(/.css$/, '')]: file,
    }),
    {}
  )

  // Only generate HTML files for documentation builds, and local development
  const docsPlugins =
    isDocs || isDevelopment
      ? [
          new HtmlWebpackPlugin({
            filename: 'editor/index.html',
            template: './src/demo/templates/template.html',
            chunks: ['demo/styles', 'themes/stencila/styles', 'demo/app.tsx'],
            templateParameters: {
              ASSET_PATH,
            },
          }),
          new HtmlWebpackPlugin({
            filename: 'index.html',
            template: './src/demo/templates/gallery.ejs',
            chunks: [
              'demo/styles',
              'demo/gallery.tsx',
              'themes/galleria/styles',
            ],
          }),
        ]
      : []

  return {
    entry,
    resolve: {
      extensions: ['.ts', '.tsx', '.js', '.css', '.html'],
      fallback: {
        path: false,
      },
    },
    mode: mode || 'development',
    target: target === 'lib' ? 'node' : 'web',
    output: {
      assetModuleFilename: fileLoaderOutputPath,
      path: path.resolve(__dirname, contentBase),
      publicPath: ASSET_PATH,
      library: 'thema',
      libraryTarget: 'umd',
      umdNamedDefine: true,
    },
    node: {
      __dirname: false,
    },
    devServer: {
      static: {
        directory: path.join(__dirname, contentBase),
      },
      client: {
        overlay: true,
      },
    },
    plugins: [
      new DefinePlugin({
        'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH),
        'process.env.NODE_ENV': JSON.stringify(mode),
        'process.env.npm_package_version': JSON.stringify(
          process.env.npm_package_version
        ),
      }),
      new MiniCssExtractPlugin(),
      ...docsPlugins,
    ],
    module: {
      rules: [
        {
          test: /\.ts(x?)$/,
          use: {
            loader: 'ts-loader',
            options: {
              configFile: `tsconfig.${
                target === 'lib' ? 'lib' : 'browser'
              }.json`,
              compilerOptions: {
                incremental: true,
              },
            },
          },
        },
        {
          test: /\.ejs$/,
          loader: 'ejs-loader',
          options: {
            // @see https://github.com/difelice/ejs-loader/pull/45
            esModule: false,
          },
        },
        {
          test: /\.html$/i,
          // Don't transform HtmlWebpackPlugin generated file
          exclude: /template\.html$/i,
          type: 'asset/resource',
        },
        {
          test: /\.(css)$/,
          use: [
            {
              loader: MiniCssExtractPlugin.loader,
              options: {
                publicPath: (resourcePath, context) => {
                  // Make asset paths relative
                  // @see https://github.com/webpack-contrib/mini-css-extract-plugin#the-publicpath-option-as-function
                  return (
                    path.relative(
                      path.dirname(resourcePath),
                      path.join(context, 'src')
                    ) + '/'
                  )
                },
              },
            },
            {
              loader: 'css-loader',
              options: { importLoaders: 1, url: true, import: true },
            },
            'postcss-loader',
          ],
        },
        {
          test: /\.(eot|woff|woff2|svg|ttf|jpe?g|png|gif)$|html\.media\/.*$/,
          type: 'asset/resource',
        },
      ],
    },
  }
}


text:
namespace eddic {

namespace ast {

struct VariableAnnotationPass : Pass {
    void apply_function(ast::TemplateFunctionDeclaration& function) override;
    void apply_struct_function(ast::TemplateFunctionDeclaration& function) override;
    void apply_struct_constructor(ast::Constructor& constructor) override;
    void apply_struct_destructor(ast::Destructor& destructor) override;
    void apply_program(ast::SourceFile& program, bool indicator) override;

    std::shared_ptr<GlobalContext> context;
};

} //end of ast

} //end of eddic

#endif


text:
package com.google.template.soy.basicfunctions;

import com.google.common.collect.ImmutableSet;
import com.google.template.soy.data.SoyValue;
import com.google.template.soy.data.restricted.FloatData;
import com.google.template.soy.data.restricted.IntegerData;
import com.google.template.soy.jssrc.restricted.JsExpr;
import com.google.template.soy.jssrc.restricted.SoyJsSrcFunction;
import com.google.template.soy.phpsrc.restricted.PhpExpr;
import com.google.template.soy.phpsrc.restricted.PhpFunctionExprBuilder;
import com.google.template.soy.phpsrc.restricted.SoyPhpSrcFunction;
import com.google.template.soy.pysrc.restricted.PyExpr;
import com.google.template.soy.pysrc.restricted.PyFunctionExprBuilder;
import com.google.template.soy.pysrc.restricted.SoyPySrcFunction;
import com.google.template.soy.shared.restricted.SoyJavaFunction;
import com.google.template.soy.shared.restricted.SoyPureFunction;

import java.util.List;
import java.util.Set;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * Soy function that takes the max of two numbers.
 *
 */
@Singleton
@SoyPureFunction
class MaxFunction implements SoyJavaFunction, SoyJsSrcFunction, SoyPySrcFunction, SoyPhpSrcFunction {

  @Inject
  MaxFunction() {}

  @Override public String getName() {
    return "max";
  }

  @Override public Set<Integer> getValidArgsSizes() {
    return ImmutableSet.of(2);
  }

  @Override public SoyValue computeForJava(List<SoyValue> args) {
    SoyValue arg0 = args.get(0);
    SoyValue arg1 = args.get(1);

    if (arg0 instanceof IntegerData && arg1 instanceof IntegerData) {
      return IntegerData.forValue(Math.max(arg0.longValue(), arg1.longValue()));
    } else {
      return FloatData.forValue(Math.max(arg0.numberValue(), arg1.numberValue()));
    }
  }

  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {
    JsExpr arg0 = args.get(0);
    JsExpr arg1 = args.get(1);

    return new JsExpr(
        "Math.max(" + arg0.getText() + ", " + arg1.getText() + ")", Integer.MAX_VALUE);
  }

  @Override public PyExpr computeForPySrc(List<PyExpr> args) {
    PyExpr arg0 = args.get(0);
    PyExpr arg1 = args.get(1);

    PyFunctionExprBuilder fnBuilder = new PyFunctionExprBuilder("max");
    return fnBuilder.addArg(arg0).addArg(arg1).asPyExpr();
  }

  @Override public PhpExpr computeForPhpSrc(List<PhpExpr> args) {
    PhpExpr arg0 = args.get(0);
    PhpExpr arg1 = args.get(1);

    PhpFunctionExprBuilder fnBuilder = new PhpFunctionExprBuilder("max");
    return fnBuilder.addArg(arg0).addArg(arg1).asPhpExpr();
  }
}


text:
#region Usings

using System;
using Xunit;

#endregion

namespace Extend.Testing
{
    public partial class StringExTest
    {
        [Fact]
        public void SplitTest()
        {
            var actual = "1,2,3".Split( "," );
            Assert.Equal( 3, actual.Length );
            Assert.Equal( "1", actual[0] );
            Assert.Equal( "2", actual[1] );
            Assert.Equal( "3", actual[2] );
        }

        [Fact]
        public void SplitTest1()
        {
            var actual = "1,2,,3.4".Split( StringSplitOptions.RemoveEmptyEntries, ",", "." );
            Assert.Equal( 4, actual.Length );
            Assert.Equal( "1", actual[0] );
            Assert.Equal( "2", actual[1] );
            Assert.Equal( "3", actual[2] );
            Assert.Equal( "4", actual[3] );
        }

        [Fact]
        public void SplitTest1NullCheck()
        {
            // ReSharper disable once AssignNullToNotNullAttribute
            // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            Action test = () => StringEx.Split( null, StringSplitOptions.RemoveEmptyEntries, "" );

            Assert.Throws<ArgumentNullException>( test );
        }

        [Fact]
        public void SplitTest1NullCheck1()
        {
            // ReSharper disable once AssignNullToNotNullAttribute
            // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            Action test = () => "".Split( StringSplitOptions.RemoveEmptyEntries, null );

            Assert.Throws<ArgumentNullException>( test );
        }

        [Fact]
        public void SplitTestNullCheck()
        {
            // ReSharper disable once AssignNullToNotNullAttribute
            // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            Action test = () => StringEx.Split( null, "" );

            Assert.Throws<ArgumentNullException>( test );
        }

        [Fact]
        public void SplitTestNullCheck1()
        {
            // ReSharper disable once AssignNullToNotNullAttribute
            // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            Action test = () => StringEx.Split( "", null );

            Assert.Throws<ArgumentNullException>( test );
        }
    }
}


text:
var Mangler = function() {
  this._table = {};
  this._reverseTable = {};
  this._current = "A";
  this._prefix = "";
  this._codes = {
    $: 36,
    Z: 90,
    _: 95,
    z: 122,
  };
};

function insertChar(c, index, string) {
  return string.substring(0, index)
    + c
    + string.substring(index + 1, string.length);
}

Mangler.prototype._nextChar = function(c) {
  switch(c) {
  case this._codes.$: return "A";
  case this._codes.Z: return "_";
  case this._codes._: return "a";
  case this._codes.z: return "$";
  default: return String.fromCharCode(++c);
  }
};

Mangler.prototype._nextStr = function(s) {
  var output = s;
  var index = s.length - 1;

  var c = s.charCodeAt(index);
  while(c === this._codes.$) {
    output = insertChar(this._nextChar(c), index, output);

    index--;
    if(index < 0) {
      return output + "A";
    }
    c = s.charCodeAt(index);
  }

  return insertChar(this._nextChar(c), index, output);
};

Mangler.prototype.mangle = function(str) {
  if(!(str in this._table)) {
    this._table[str] = this._prefix + this._current;
    this._reverseTable[this._current] = str;
    this._current = this._nextStr(this._current);
  }
  return this._table[str];
};

Mangler.prototype.unmangle = function(str) {
  if(str in this._reverseTable) {
    return this._reverseTable[str];
  } else {
    return "";
  }
};

Mangler.prototype.makeManglingTable = function() {
  return this._table;
};

Mangler.prototype.makeLookupTable = function() {
  return this._reverseTable;
};

Mangler.prototype.setPrefix = function(p) {
  this._prefix = p;
};

module.exports = Mangler;
module.exports.default = Mangler;


text:
NSString * const UncaughtExceptionHandlerSignalExceptionName = @"UncaughtExceptionHandlerSignalExceptionName";
NSString * const UncaughtExceptionHandlerSignalKey = @"UncaughtExceptionHandlerSignalKey";
NSString * const UncaughtExceptionHandlerAddressesKey = @"UncaughtExceptionHandlerAddressesKey";

volatile int32_t UncaughtExceptionCount = 0;
const int32_t UncaughtExceptionMaximum = 10;

const NSInteger UncaughtExceptionHandlerSkipAddressCount = 0;
const NSInteger UncaughtExceptionHandlerReportAddressCount = 9;

@implementation UncaughtExceptionHandler

+ (NSArray *)backtrace
{
	 void* callstack[128];
	 int frames = backtrace(callstack, 128);
	 char **strs = backtrace_symbols(callstack, frames);

	 int i;
	 NSMutableArray *backtrace = [NSMutableArray arrayWithCapacity:frames];
	 for (
	 	i = UncaughtExceptionHandlerSkipAddressCount;
	 	i < UncaughtExceptionHandlerSkipAddressCount +
			UncaughtExceptionHandlerReportAddressCount;
		i++)
	 {
	 	[backtrace addObject:[NSString stringWithUTF8String:strs[i]]];
	 }
	 free(strs);

	 return backtrace;
}

//- (void)alertView:(UIAlertView *)anAlertView clickedButtonAtIndex:(NSInteger)anIndex
//{
//    NSLog(@"dddddd:=%ld",(long)anIndex);
////	if (anIndex == 0)
////	{
////		dismissed = YES;
////	}
//}

- (void)validateAndSaveCriticalApplicationData
{
    NSLog(@"要保存的数据");
}

- (void)handleException:(NSException *)exception
{
	[self validateAndSaveCriticalApplicationData];

    //NSArray *addresses =[exception callStackReturnAddresses];
   // NSArray * arr = [exception callStackSymbols];
    NSString *reason = [exception reason];
    NSString *name = [exception name];
    NSDictionary *info = [exception userInfo];
    NSString *content = [NSString stringWithFormat:@"========异常错误报告========\nname:%@\nreason:%@\ninfo:=%@",name,reason,info];

    NSNotification *notification =[NSNotification notificationWithName:@"crashCollectNotication" object:nil userInfo:@{@"name":name,@"reson":reason,@"info":info}];
    [[NSNotificationCenter defaultCenter] postNotification:notification];

    NSLog(@"%s:%d %@", __FUNCTION__, __LINE__, content);

    //NSLog(@"heqin, Stack Trace: %@", [exception callStackSymbols]);
//	UIAlertView *alert =
//		[[[UIAlertView alloc]
//			initWithTitle:NSLocalizedString(@"未处理异常:", nil)
//			message:[NSString stringWithFormat:NSLocalizedString(
//				@"你可以尝试继续,但应用程序可能是不稳定的.\n\n"
//				@"调试细节:\n%@\n%@", nil),
//				[exception reason],
//				[[exception userInfo] objectForKey:UncaughtExceptionHandlerAddressesKey]]
//			delegate:self
//			cancelButtonTitle:NSLocalizedString(@"Quit", nil)
//			otherButtonTitles:NSLocalizedString(@"Continue", nil), nil]
//		autorelease];
//	[alert show];

	CFRunLoopRef runLoop = CFRunLoopGetCurrent();
	CFArrayRef allModes = CFRunLoopCopyAllModes(runLoop);

	while (!dismissed)
	{
		for (NSString *mode in (__bridge NSArray *)allModes)
		{
			CFRunLoopRunInMode((CFStringRef)mode, 0.001, false);
		}
	}

	CFRelease(allModes);

	NSSetUncaughtExceptionHandler(NULL);
	signal(SIGABRT, SIG_DFL);
	signal(SIGILL, SIG_DFL);
	signal(SIGSEGV, SIG_DFL);
	signal(SIGFPE, SIG_DFL);
	signal(SIGBUS, SIG_DFL);
	signal(SIGPIPE, SIG_DFL);

	if ([[exception name] isEqual:UncaughtExceptionHandlerSignalExceptionName])
	{
		kill(getpid(), [[[exception userInfo] objectForKey:UncaughtExceptionHandlerSignalKey] intValue]);
	}
	else
	{
		[exception raise];
	}
}

@end

void HandleException(NSException *exception)
{
	int32_t exceptionCount = OSAtomicIncrement32(&UncaughtExceptionCount);
	if (exceptionCount > UncaughtExceptionMaximum)
	{
		return;
	}

	NSArray *callStack = [UncaughtExceptionHandler backtrace];
	NSMutableDictionary *userInfo =
		[NSMutableDictionary dictionaryWithDictionary:[exception userInfo]];
	[userInfo
		setObject:callStack
		forKey:UncaughtExceptionHandlerAddressesKey];

	[[[UncaughtExceptionHandler alloc] init]
		performSelectorOnMainThread:@selector(handleException:)
		withObject:
			[NSException
				exceptionWithName:[exception name]
				reason:[exception reason]
				userInfo:userInfo]
		waitUntilDone:YES];
}

void SignalHandler(int signal)
{
	int32_t exceptionCount = OSAtomicIncrement32(&UncaughtExceptionCount);
	if (exceptionCount > UncaughtExceptionMaximum)
	{
		return;
	}

	NSMutableDictionary *userInfo =
		[NSMutableDictionary
			dictionaryWithObject:[NSNumber numberWithInt:signal]
			forKey:UncaughtExceptionHandlerSignalKey];

	NSArray *callStack = [UncaughtExceptionHandler backtrace];
	[userInfo
		setObject:callStack
		forKey:UncaughtExceptionHandlerAddressesKey];

    [[[UncaughtExceptionHandler alloc] init]
	//[[[[UncaughtExceptionHandler alloc] init] autorelease]
		performSelectorOnMainThread:@selector(handleException:)
		withObject:
			[NSException
				exceptionWithName:UncaughtExceptionHandlerSignalExceptionName
				reason:
					[NSString stringWithFormat:
						NSLocalizedString(@"信号 %d 被提出.", nil),
						signal]
				userInfo:
					[NSDictionary
						dictionaryWithObject:[NSNumber numberWithInt:signal]
						forKey:UncaughtExceptionHandlerSignalKey]]
		waitUntilDone:YES];
}

void InstallUncaughtExceptionHandler(void)
{
	NSSetUncaughtExceptionHandler(&HandleException);
	signal(SIGABRT, SignalHandler);
	signal(SIGILL, SignalHandler);
	signal(SIGSEGV, SignalHandler);
	signal(SIGFPE, SignalHandler);
	signal(SIGBUS, SignalHandler);
	signal(SIGPIPE, SignalHandler);
}

NSString* getAppInfo()
{
    NSString *appInfo = [NSString stringWithFormat:@"App :%@ %@ %@(%@)\nDevice : %@\nOS Version : %@ %@\nUDID :\n",
                         [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"],
                         [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],
                         [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"],
                         [UIDevice currentDevice].model,
                         [UIDevice currentDevice].systemName,
                         [UIDevice currentDevice].systemVersion,
                         [UIDevice currentDevice].identifierForVendor];
    NSLog(@"Crash!!!! %@", appInfo);

    return appInfo;

}


text:
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on August 26, 2013 */

@font-face {
    font-family: 'Track';
    src: url('track-webfont.eot');
    src:
         url('track-webfont.eot?#iefix') format('embedded-opentype'),
         url('track-webfont.woff') format('woff'),
         url('track-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;

}


text:
"""
Description of question 12

Nicholas Staples
2014-04-15

"""

from utils.include_decorator import include_decorator

description = '''
The sequence of triangle numbers is generated by adding the natural numbers.
So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.

The first ten terms would be:
	1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...

Let us list the factors of the first seven triangle numbers:
	1: 1
	3: 1,3
	6: 1,2,3,6
	10: 1,2,5,10
	15: 1,3,5,15
	21: 1,3,7,21
	28: 1,2,4,7,14,28

We can see that 28 is the first triangle number to have over five divisors.
What is the value of the first triangle number to have over five hundred
divisors?
'''

@include_decorator(12)
def problem_12():
    print description


text:
PHP wrapper for Bierdopje API

## Install
Simple:
`composer require mattiasdelang/bierdopje-php`

## How to use
### Environment variable
Make sure you have a `BD_APIKEY` environment variable set.

If your project:
 - uses a `.env` file, add it there.
 - uses Apache you can add `SetEnv BD_APIKEY apikeystring` to your vhost.
 - runs on Linux you can execute `export BD_APIKEY=apikeystring`
 - runs on Windows [add it to your environment](http://www.computerhope.com/issues/ch000549.htm).

### HTTP User-Agent
Bierdopje requires all automated tools to specify a custom User-Agent when performing HTTP requests.
So give your Http client a default User-Agent before passing it to the constructor.

```PHP
use mattiasdelang\Bierdopje as BierdopjeApi;

$httpClient = new \GuzzleHttp\Client([
  'headers' => [
    'User-Agent' => 'projectname/0.0.1'
  ]
]);

$bierdopje = new BierdopjeApi($httpClient);
```


text:
/* global $ */
$('body').on('submit', 'form', function (e) {
  // On form submit, add hidden inputs for checkboxes so the server knows if
  // they've been unchecked. This means we can automatically store and update
  // all form data on the server, including checkboxes that are checked, then
  // later unchecked

  var $checkboxes = $(this).find('input:checkbox')

  var $inputs = []
  var names = {}

  $checkboxes.each(function () {
    var $this = $(this)

    if (!names[$this.attr('name')]) {
      names[$this.attr('name')] = true
      var $input = $('<input type="hidden">')
      $input.attr('name', $this.attr('name'))
      $input.attr('value', '_unchecked')
      $inputs.push($input)
    }
  })

  $(this).prepend($inputs)
})


text:
ICE candidate exchange server (Sort of like a SIP registrar)

TODO:


text:
Lens Reader
===========

This module is no longer maintained. See [Substance Reader](http://github.com/substance/reader).


text:
package cz.metacentrum.perun.core.api.exceptions;

import cz.metacentrum.perun.core.api.Vo;
import cz.metacentrum.perun.core.api.exceptions.rt.VoNotExistsRuntimeException;

/**
 * Checked version of VoNotExistsException.
 *
 * @see cz.metacentrum.perun.core.api.exceptions.rt.VoNotExistsRuntimeException
 * @author Martin Kuba
 */
public class VoNotExistsException extends EntityNotExistsException {
	static final long serialVersionUID = 0;

	private Vo vo;

	public VoNotExistsException(VoNotExistsRuntimeException rt) {
		super(rt.getMessage(),rt);
	}

	public VoNotExistsException(String message) {
		super(message);
	}

	public VoNotExistsException(String message, Throwable cause) {
		super(message, cause);
	}

	public VoNotExistsException(Throwable cause) {
		super(cause);
	}

	public VoNotExistsException(Vo vo) {
		super(vo.toString());
		this.vo = vo;
	}

	public Vo getVo() {
		return this.vo;
	}
}


text:
![alt text](http://foodnetwork.sndimg.com/content/dam/images/food/fullset/2004/5/10/0/ll1a03_garlic_mashed_potatoes1.jpg.rend.sni12col.landscape.jpeg)
### Ingredients

####
* 1 medium head cauliflower
* 1 tablespoon cream cheese, softened
* 1/4 cup grated Parmesan
* 1/2 teaspoon minced garlic
* 1/8 teaspoon straight chicken base or bullion (may substitute 1/2 teaspoon salt)
* 1/8 teaspoon freshly ground black pepper
* 1/2 teaspoon chopped fresh or dry chives, for garnish
* 3 tablespoons unsalted butter

### Instructions
* Set a stockpot of water to boil over high heat.
* Clean and cut cauliflower into small pieces. Cook in boiling water for about 6 minutes, or until well done. Drain well; do not let cool and pat cooked cauliflower very dry between several layers of paper towels.
* In a bowl with an immersion blender, or in a food processor, puree the hot cauliflower with the cream cheese, Parmesan, garlic, chicken base, and pepper until almost smooth.
* Garnish with chives, and serve hot with pats of butter.
* Hint: Try roasting the garlic and adding a little fresh
* rosemary for a whole new taste.
* Chef: George Stella


text:
package io.gravitee.rest.api.service.impl;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.net.InternetDomainName;
import io.gravitee.definition.model.VirtualHost;
import io.gravitee.repository.management.api.ApiRepository;
import io.gravitee.repository.management.model.Api;
import io.gravitee.rest.api.model.EnvironmentEntity;
import io.gravitee.rest.api.model.api.ApiEntity;
import io.gravitee.rest.api.service.EnvironmentService;
import io.gravitee.rest.api.service.VirtualHostService;
import io.gravitee.rest.api.service.common.GraviteeContext;
import io.gravitee.rest.api.service.exceptions.ApiContextPathAlreadyExistsException;
import io.gravitee.rest.api.service.exceptions.InvalidVirtualHostException;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author David BRASSELY (david.brassely at graviteesource.com)
 * @author GraviteeSource Team
 */
@Component
public class VirtualHostServiceImpl extends TransactionalService implements VirtualHostService {

    private static final Pattern DUPLICATE_SLASH_REMOVER = Pattern.compile("[//]+");

    private static final String URI_PATH_SEPARATOR = "/";

    private static final char URI_PATH_SEPARATOR_CHAR = '/';

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

    @Autowired
    private ApiRepository apiRepository;

    @Autowired
    private ObjectMapper objectMapper;

    @Autowired
    private EnvironmentService environmentService;

    @Override
    public Collection<VirtualHost> sanitizeAndValidate(Collection<VirtualHost> virtualHosts, String apiId) {
        // Sanitize virtual hosts
        Collection<VirtualHost> sanitizedVirtualHosts = virtualHosts.stream().map(this::sanitize).collect(Collectors.toList());

        // validate domain restrictions
        validateDomainRestrictions(sanitizedVirtualHosts);

        // Get all the API of the currentEnvironment, except the one to update
        Set<ApiEntity> apis = apiRepository
            .search(null)
            .stream()
            .filter(api -> !api.getId().equals(apiId) && api.getEnvironmentId().equals(GraviteeContext.getCurrentEnvironment()))
            .map(this::convert)
            .collect(Collectors.toSet());

        // Extract all the virtual hosts with a host
        Map<String, List<String>> registeredVirtualHosts = apis
            .stream()
            .flatMap(
                new Function<ApiEntity, Stream<VirtualHost>>() {
                    @Override
                    public Stream<VirtualHost> apply(ApiEntity api) {
                        return api
                            .getProxy()
                            .getVirtualHosts()
                            .stream()
                            .filter(virtualHost -> virtualHost.getHost() != null && !virtualHost.getHost().isEmpty());
                    }
                }
            )
            .collect(Collectors.groupingBy(VirtualHost::getHost, Collectors.mapping(VirtualHost::getPath, Collectors.toList())));

        // Extract all the virtual hosts with a single path
        List<String> registeredContextPaths = apis
            .stream()
            .flatMap(
                new Function<ApiEntity, Stream<String>>() {
                    @Override
                    public Stream<String> apply(ApiEntity api) {
                        return api
                            .getProxy()
                            .getVirtualHosts()
                            .stream()
                            .filter(virtualHost -> virtualHost.getHost() == null)
                            .map(VirtualHost::getPath);
                    }
                }
            )
            .collect(Collectors.toList());

        // Check only virtual hosts with a host and compare to registered virtual hosts
        if (!registeredVirtualHosts.isEmpty()) {
            sanitizedVirtualHosts
                .stream()
                .filter(virtualHost -> virtualHost.getHost() != null && !virtualHost.getHost().isEmpty())
                .forEach(virtualHost -> compare(virtualHost.getPath(), registeredVirtualHosts.get(virtualHost.getHost())));
        }

        // Then check remaining virtual hosts without a host and compare to registered context paths
        if (!registeredContextPaths.isEmpty()) {
            sanitizedVirtualHosts
                .stream()
                .filter(virtualHost -> virtualHost.getHost() == null)
                .forEach(virtualHost -> compare(virtualHost.getPath(), registeredContextPaths));
        }
        return sanitizedVirtualHosts;
    }

    private void validateDomainRestrictions(Collection<VirtualHost> virtualHosts) {
        final EnvironmentEntity currentEnv = environmentService.findById(GraviteeContext.getCurrentEnvironment());
        final List<String> domainRestrictions = currentEnv.getDomainRestrictions();
        if (domainRestrictions != null && !domainRestrictions.isEmpty()) {
            for (VirtualHost vHost : virtualHosts) {
                String host = vHost.getHost();
                if (!StringUtils.isEmpty(host)) {
                    String hostWithoutPort = host.split(":")[0];
                    if (!isValidDomainOrSubDomain(hostWithoutPort, domainRestrictions)) {
                        throw new InvalidVirtualHostException(hostWithoutPort, domainRestrictions);
                    }
                } else {
                    vHost.setHost(domainRestrictions.get(0));
                }
            }
        }
    }

    private boolean isValidDomainOrSubDomain(String domain, List<String> domainRestrictions) {
        boolean isSubDomain = false;

        if (domainRestrictions.isEmpty()) {
            return true;
        }

        for (String domainRestriction : domainRestrictions) {
            InternetDomainName domainIDN = InternetDomainName.from(domain);
            InternetDomainName parentIDN = InternetDomainName.from(domainRestriction);

            if (domainIDN.equals(parentIDN)) {
                return true;
            }

            while (!isSubDomain && domainIDN.hasParent()) {
                isSubDomain = parentIDN.equals(domainIDN);
                domainIDN = domainIDN.parent();
            }

            if (isSubDomain) {
                break;
            }
        }

        return isSubDomain;
    }

    @Override
    public VirtualHost sanitize(VirtualHost virtualHost) {
        String path = virtualHost.getPath();
        if (path == null || path.isEmpty()) {
            path = URI_PATH_SEPARATOR;
        }

        if (!path.startsWith(URI_PATH_SEPARATOR)) {
            path = URI_PATH_SEPARATOR + path;
        }

        if (path.lastIndexOf(URI_PATH_SEPARATOR_CHAR) != path.length() - 1) {
            path += URI_PATH_SEPARATOR;
        }

        path = DUPLICATE_SLASH_REMOVER.matcher(path).replaceAll(URI_PATH_SEPARATOR);

        // Create a copy of the virtual host to avoid any change into the initial one
        return new VirtualHost(virtualHost.getHost(), path, virtualHost.isOverrideEntrypoint());
    }

    private void compare(String path, List<String> paths) {
        boolean match =
            paths != null && paths.stream().anyMatch(registeredPath -> path.startsWith(registeredPath) || registeredPath.startsWith(path));

        if (match) {
            throw new ApiContextPathAlreadyExistsException(path);
        }
    }

    private ApiEntity convert(Api api) {
        ApiEntity apiEntity = new ApiEntity();
        apiEntity.setId(api.getId());

        if (api.getDefinition() != null) {
            try {
                io.gravitee.definition.model.Api apiDefinition = objectMapper.readValue(
                    api.getDefinition(),
                    io.gravitee.definition.model.Api.class
                );
                apiEntity.setProxy(apiDefinition.getProxy());

                // Sanitize virtual hosts
                apiEntity
                    .getProxy()
                    .setVirtualHosts(apiEntity.getProxy().getVirtualHosts().stream().map(this::sanitize).collect(Collectors.toList()));
            } catch (IOException ioe) {
                LOGGER.error("Unexpected error while getting API definition", ioe);
            }
        }

        return apiEntity;
    }
}


text:
using ParkingSpace.Models;
using Rotativa;
using System.Web;
using System.Web.Mvc;

namespace ParkingSpace.Web.Printing {
  public class PdfParkingTicketPrinter : IParkingTicketPrinter {

    public PdfParkingTicketPrinter( ) {
      //
    }

    public void Print(ParkingTicket ticket, object args = null) {
      var r = new ViewAsPdf("RPT-01-ParkingTicket-In", ticket);

      r.PageSize = Rotativa.Options.Size.A6;
      r.PageOrientation = Rotativa.Options.Orientation.Portrait;

      var fileName = ticket.Id + ".pdf";
      var filePath = HttpContext.Current.Server.MapPath("~/App_Data/" + fileName);

      var bytes = r.BuildPdf((ControllerContext)args);
      System.IO.File.WriteAllBytes(filePath, bytes);
    }
  }
}


text:
package invtweaks.container;

import invtweaks.InvTweaks;
import invtweaks.InvTweaksConst;
import invtweaks.InvTweaksObfuscation;
import invtweaks.api.container.ContainerSection;
import invtweaks.forge.InvTweaksMod;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class MirroredContainerManager implements IContainerManager {
    private ItemStack[] slotItems;
    private ItemStack heldItem;
    @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") // Partially implemented
    private List<ItemStack> droppedItems = new ArrayList<>();
    private Container container;
    private Map<ContainerSection, List<Integer>> itemRefs;
    private Map<ContainerSection, List<Slot>> slotRefs;

    public MirroredContainerManager(Container cont) {
        container = cont;

        slotRefs = InvTweaksObfuscation.getContainerSlotMap(container);
        if(slotRefs == null) {
            slotRefs = new HashMap<>();
        }

        // TODO: Detect if there is a big enough unassigned section for inventory.
        @SuppressWarnings("unchecked")
        List<Slot> slots = (List<Slot>) container.inventorySlots;
        int size = slots.size();
        if(size >= InvTweaksConst.INVENTORY_SIZE && !slotRefs.containsKey(ContainerSection.INVENTORY)) {
            slotRefs.put(ContainerSection.INVENTORY, slots.subList(size - InvTweaksConst.INVENTORY_SIZE, size));
            slotRefs.put(ContainerSection.INVENTORY_NOT_HOTBAR,
                    slots.subList(size - InvTweaksConst.INVENTORY_SIZE, size - HOTBAR_SIZE));
            slotRefs.put(ContainerSection.INVENTORY_HOTBAR, slots.subList(size - HOTBAR_SIZE, size));
        }

        itemRefs = new HashMap<>();
        for(Map.Entry<ContainerSection, List<Slot>> section : slotRefs.entrySet()) {
            List<Integer> slotIndices = section.getValue().stream().map(slots::indexOf).collect(Collectors.toList());

            itemRefs.put(section.getKey(), slotIndices);
        }

        slotItems = new ItemStack[size];
        for(int i = 0; i < size; ++i) {
            slotItems[i] = slots.get(i).getStack().copy();
        }

        heldItem = InvTweaks.getInstance().getHeldStack();
    }

    @Override
    public boolean move(ContainerSection srcSection, int srcIndex, ContainerSection destSection, int destIndex) {
        int srcSlotIdx = slotPositionToIndex(srcSection, srcIndex);

        if(destIndex == DROP_SLOT) {
            droppedItems.add(slotItems[srcSlotIdx]);
            slotItems[srcSlotIdx] = null;
        }

        int destSlotIdx = slotPositionToIndex(destSection, destIndex);

        Slot srcSlot = getSlot(srcSection, srcIndex);
        Slot destSlot = getSlot(destSection, destIndex);

        ItemStack srcItem = slotItems[srcSlotIdx];
        ItemStack destItem = slotItems[destSlotIdx];

        if(srcItem != null && !destSlot.isItemValid(srcItem)) {
            return false;
        }

        if(destItem != null && !srcSlot.isItemValid(destItem)) {
            // TODO: Behavior says move dest to empty valid slot in this case.
            return false;
        }

        // TODO: Attempt to stack instead of always swapping?
        slotItems[srcSlotIdx] = destItem;
        slotItems[destSlotIdx] = srcItem;

        return true;
    }

    @Override
    public boolean moveSome(ContainerSection srcSection, int srcIndex, ContainerSection destSection, int destIndex, int amount) {
        // TODO: Can't currently do partial movements
        return false;
    }

    @Override
    public boolean putHoldItemDown(ContainerSection destSection, int destIndex) {
        int destSlotIdx = slotPositionToIndex(destSection, destIndex);

        if(slotItems[destSlotIdx] != null) {
            return false;
        }

        slotItems[destSlotIdx] = heldItem;
        heldItem = null;

        return true;
    }

    @Override
    public void click(ContainerSection section, int index, boolean rightClick) {
        // TODO: Currently unused externally -- consider if it needs to really be in the interface.
    }

    @Override
    public boolean hasSection(ContainerSection section) {
        return itemRefs.containsKey(section);
    }

    @Override
    public List<Slot> getSlots(ContainerSection section) {
        return slotRefs.get(section);
    }

    @Override
    public int getSize() {
        return slotItems.length;
    }

    @Override
    public int getSize(ContainerSection section) {
        return itemRefs.get(section).size();
    }

    @Override
    public int getFirstEmptyIndex(ContainerSection section) {
        int i = 0;
        for(int slot : itemRefs.get(section)) {
            if(slotItems[slot] == null) {
                return i;
            }
            i++;
        }
        return -1;
    }

    @Override
    public boolean isSlotEmpty(ContainerSection section, int slot) {
        return getItemStack(section, slot) == null;
    }

    @Override
    public Slot getSlot(ContainerSection section, int index) {
        return container.getSlot(slotPositionToIndex(section, index));
    }

    @Override
    public int getSlotIndex(int slotNumber, boolean preferInventory) {
        // TODO Caching with getSlotSection
        for(ContainerSection section : slotRefs.keySet()) {
            if(!preferInventory && section != ContainerSection.INVENTORY || (preferInventory && section != ContainerSection.INVENTORY_NOT_HOTBAR && section != ContainerSection.INVENTORY_HOTBAR)) {
                int i = 0;
                for(Slot slot : slotRefs.get(section)) {
                    if(InvTweaksObfuscation.getSlotNumber(slot) == slotNumber) {
                        return i;
                    }
                    i++;
                }
            }
        }
        return -1;
    }

    @Override
    public ContainerSection getSlotSection(int slotNumber) {
        // TODO Caching with getSlotIndex
        for(ContainerSection section : slotRefs.keySet()) {
            if(section != ContainerSection.INVENTORY) {
                for(Slot slot : slotRefs.get(section)) {
                    if(InvTweaksObfuscation.getSlotNumber(slot) == slotNumber) {
                        return section;
                    }
                }
            }
        }
        return null;
    }

    @Override
    public ItemStack getItemStack(ContainerSection section, int index) {
        return slotItems[slotPositionToIndex(section, index)];
    }

    @Override
    public Container getContainer() {
        return container;
    }

    @Override
    public void applyChanges() {
        // TODO: Figure out what is needed to match container with virtual inventory.
        InvTweaksMod.proxy.sortComplete();
    }
    /**
     * Converts section/index values to slot ID.
     *
     * @return -1 if not found
     */
    private int slotPositionToIndex(ContainerSection section, int index) {
        if(index == DROP_SLOT) {
            return DROP_SLOT;
        } else if(index < 0) {
            return -1;
        } else if(hasSection(section)) {
            return itemRefs.get(section).get(index);
        } else {
            return -1;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CloudDancerCommon;

namespace CloudDancerCLI
{
    class Program
    {
        private const int listenPort = 11000;

        private static void StartListener()
        {
            bool done = false;

            UdpClient listener = new UdpClient(listenPort);
            IPEndPoint groupEP = new IPEndPoint(IPAddress.Any, listenPort);

            try
            {
                while (!done)
                {
                    Console.WriteLine("Waiting for broadcast");
                    byte[] bytes = listener.Receive(ref groupEP);

                    Console.WriteLine("Received broadcast from {0} :\n {1}\n",
                        groupEP.ToString(),
                        Encoding.ASCII.GetString(bytes, 0, bytes.Length));
                }

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            finally
            {
                listener.Close();
            }
        }
        static void Main(string[] args)
        {
            Gdm.BeginAnnounce(new TimeSpan(0, 0, 0, 30));
            foreach (var server in Gdm.Listen(5))
            {
                Console.WriteLine(server.Name);
            }
        }
    }
}


text:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

from .core import UnitedStates

class Minnesota(UnitedStates):
    """Minnesota"""
    include_thanksgiving_friday = True
    include_columbus_day = False


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

using Google.Api;
using Google.Api.Gax.Grpc;
using Google.Cloud.Logging.V2;
using Moq;
using System;
using Xunit;

namespace Google.Cloud.Diagnostics.Common.Tests
{
    public class EventTargetTest
    {
        private const string _projectId = "pid";
        private const string _organizationId = "oid";
        private static readonly LoggingServiceV2Client _loggingClient = new Mock<LoggingServiceV2Client>().Object;

        [Fact]
        public void ForProject()
        {
            var eventTarget = EventTarget.ForProject(_projectId);

            Assert.Equal(EventTargetKind.Logging, eventTarget.Kind);
            Assert.Equal(_projectId, eventTarget.ProjectId);
            Assert.NotNull(eventTarget.LogTarget);
            Assert.Equal(LogTargetKind.Project, eventTarget.LogTarget.Kind);
            Assert.Equal(_projectId, eventTarget.LogTarget.ProjectId);
        }

        [Fact]
        public void ForLogTarget()
        {
            var logTarget = LogTarget.ForOrganization(_organizationId);
            var eventTarget = EventTarget.ForLogTarget(logTarget);

            Assert.Equal(EventTargetKind.Logging, eventTarget.Kind);
            Assert.Same(logTarget, eventTarget.LogTarget);
        }
    }
}


text:
(function(root, factory) {
    if(typeof define === 'function' && define.amd) {
        define([
            'ember',
            './components/spin-box-row.js',
            './components/spin-box-selection-win.js',
            './components/spin-box.js',
            './views/spin-box-rows.js'
        ], function(Ember, Row, SelectionWin, SpinBox, Rows) {
            return factory(Ember, Row, SelectionWin, SpinBox, Rows);
        });
    } else if(typeof exports === 'object') {
        module.exports = factory(
            require('ember'),
            require('./components/spin-box-row.js'),
            require('./components/spin-box-selection-win.js'),
            require('./components/spin-box.js'),
            require('./views/spin-box-rows.js')
        );
    } else {
        factory(
            Ember,
            root.SpinBoxRowComponent,
            root.SpinBoxSelectionWinComponent,
            root.SpinBoxComponent,
            root.SpinBoxRowsView
        );
    }
})(this, function(Ember, Row, SelectionWin, SpinBox, Rows) {

    Ember.Application.initializer({
        name: 'spin-box',
        initialize: function(container, application) {
            container.register('component:spin-box-row', Row);
            container.register('component:spin-box-selection-win', SelectionWin);
            container.register('component:spin-box', SpinBox);
            container.register('view:spin-box-rows', Rows);
        }
    });

    return {
        SpinBoxRowComponent: Row,
        SpinBoxSelectionWinComponent: SelectionWin,
        SpinBoxComponent: SpinBox,
        Rows: SpinBoxRowsView
    };
});


text:
<?php

namespace ZendTest\Log\TestAsset;

class MockDbPlatform
{

    public function __call($method, $params)
    {
        $this->calls[$method][] = $params;
    }

}


text:
_Unfortunately, I don't have access to VS2012 anymore so I can't really contribute any improvements unless I can find a maintainer._

# SassyStudio

SassyStudio provides a small amount of integration with Visual Studio to the experience using
Sass / SCSS a bit friendlier. Here's what we provide so far:

- Syntax Highlighting
- Outlining
- Generate css file on save
- Multiline Comments
- Intellisense completion support for variables, functions, mixins, and keywords
- Intellisense completion support for CSS syntax

In the near future I am planning to add support for the following (assuming VS/Web team doesn't add it first):

- Error integration

You can grab the extension from [the Visual Studio Gallery](http://visualstudiogallery.msdn.microsoft.com/85fa99a6-e4c6-4a1c-9f00-e6a8129b6f4d)

If you are curious about what's coming next you can [take a look at the road map for the project](http://darrenkopp.com/posts/2013/09/10/SassyStudio-v06-and-roadmap.html).


text:
package kembe.stream;

import fj.Show;
import fj.data.Validation;
import kembe.EventStream;
import kembe.EventStreamSubscriber;
import kembe.OpenEventStream;

public class ValidationMappedEventStream<E, T> extends EventStream<T> {
    private final EventStream<Validation<E, T>> wrappedStream;

    private final Show<E> errorShow;

    public ValidationMappedEventStream(EventStream<Validation<E, T>> stream, Show<E> show) {
        this.wrappedStream = stream;
        this.errorShow = show;
    }

    @Override
    public OpenEventStream<T> open(final EventStreamSubscriber<T> effect) {
        OpenEventStream<Validation<E, T>> open =
                wrappedStream.open(
                        effect.onNext(
                                next -> {
                                    if (next.isSuccess())
                                        effect.next( next.success() );
                                    else
                                        effect.error( new Exception( errorShow.showS( next.fail() ) ) );
                                } ) );

        return OpenEventStream.wrap( this, open );
    }
}


text:
class SkbioWarning(Warning):
    """Used to filter our warnings from warnings given by 3rd parties"""
    pass

class EfficiencyWarning(SkbioWarning):
    """Warn about potentially accidental use of inefficient code.

    For example, if a user doesn't have an optimized version of a
    function/algorithm available in their scikit-bio installation, a slower,
    pure-Python implementation may be used instead. This warning can be used to
    let the user know they are using a version of the function that could be
    potentially orders of magnitude slower.

    """
    pass

class RepresentationWarning(SkbioWarning):
    """Warn about assumptions made for the successful completion of a process.

    Warn about substitutions, assumptions, or particular alterations that were
    made for the successful completion of a process. For example, if a value
    that is required for a task is not present, a best guess or least
    deleterious value could be used, accompanied by this warning.

    """
    pass

class DeprecationWarning(DeprecationWarning, SkbioWarning):
    """Used to indicate deprecated functionality in scikit-bio."""
    pass


text:
//////////////////////////////////////////////////////////////////////////
// Copyright 2001-2014 Aspose Pty Ltd. All Rights Reserved.
//
// This file is part of Aspose.Words. The source code in this file
// is only intended as a supplement to the documentation, and is provided
// "as is", without warranty of any kind, either expressed or implied.
//////////////////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.IO;

using Aspose.Words;
using Aspose.Words.Tables;
using Aspose.Words.Fields;
using Aspose.Words.Layout;
using System.Diagnostics;

namespace CSharp.Programming_Documents.Working_with_Fields
{
    public class FieldsHelper : DocumentVisitor
    {
        /// <summary>
        /// Converts any fields of the specified type found in the descendants of the node into static text.
        /// </summary>
        /// <param name="compositeNode">The node in which all descendants of the specified FieldType will be converted to static text.</param>
        /// <param name="targetFieldType">The FieldType of the field to convert to static text.</param>
        public static void ConvertFieldsToStaticText(CompositeNode compositeNode, FieldType targetFieldType)
        {
            string originalNodeText = compositeNode.ToString(SaveFormat.Text); //ExSkip
            FieldsHelper helper = new FieldsHelper(targetFieldType);
            compositeNode.Accept(helper);

            Debug.Assert(originalNodeText.Equals(compositeNode.ToString(SaveFormat.Text)), "Error: Text of the node converted differs from the original"); //ExSkip
            foreach (Node node in compositeNode.GetChildNodes(NodeType.Any, true)) //ExSkip
                Debug.Assert(!(node is FieldChar && ((FieldChar)node).FieldType.Equals(targetFieldType)), "Error: A field node that should be removed still remains."); //ExSkip
        }

        private FieldsHelper(FieldType targetFieldType)
        {
            mTargetFieldType = targetFieldType;
        }

        public override VisitorAction VisitFieldStart(FieldStart fieldStart)
        {
            // We must keep track of the starts and ends of fields incase of any nested fields.
            if (fieldStart.FieldType.Equals(mTargetFieldType))
            {
                mFieldDepth++;
                fieldStart.Remove();
            }
            else
            {
                // This removes the field start if it's inside a field that is being converted.
                CheckDepthAndRemoveNode(fieldStart);
            }

            return VisitorAction.Continue;
        }

        public override VisitorAction VisitFieldSeparator(FieldSeparator fieldSeparator)
        {
            // When visiting a field separator we should decrease the depth level.
            if (fieldSeparator.FieldType.Equals(mTargetFieldType))
            {
                mFieldDepth--;
                fieldSeparator.Remove();
            }
            else
            {
                // This removes the field separator if it's inside a field that is being converted.
                CheckDepthAndRemoveNode(fieldSeparator);
            }

            return VisitorAction.Continue;
        }

        public override VisitorAction VisitFieldEnd(FieldEnd fieldEnd)
        {
            if (fieldEnd.FieldType.Equals(mTargetFieldType))
                fieldEnd.Remove();
            else
                CheckDepthAndRemoveNode(fieldEnd); // This removes the field end if it's inside a field that is being converted.

            return VisitorAction.Continue;
        }

        public override VisitorAction VisitRun(Run run)
        {
            // Remove the run if it is between the FieldStart and FieldSeparator of the field being converted.
            CheckDepthAndRemoveNode(run);

            return VisitorAction.Continue;
        }

        public override VisitorAction VisitParagraphEnd(Paragraph paragraph)
        {
            if (mFieldDepth > 0)
            {
                // The field code that is being converted continues onto another paragraph. We
                // need to copy the remaining content from this paragraph onto the next paragraph.
                Node nextParagraph = paragraph.NextSibling;

                // Skip ahead to the next available paragraph.
                while (nextParagraph != null && nextParagraph.NodeType != NodeType.Paragraph)
                    nextParagraph = nextParagraph.NextSibling;

                // Copy all of the nodes over. Keep a list of these nodes so we know not to remove them.
                while (paragraph.HasChildNodes)
                {
                    mNodesToSkip.Add(paragraph.LastChild);
                    ((Paragraph)nextParagraph).PrependChild(paragraph.LastChild);
                }

                paragraph.Remove();
            }

            return VisitorAction.Continue;
        }

        public override VisitorAction VisitTableStart(Table table)
        {
            CheckDepthAndRemoveNode(table);

            return VisitorAction.Continue;
        }

        /// <summary>
        /// Checks whether the node is inside a field or should be skipped and then removes it if necessary.
        /// </summary>
        private void CheckDepthAndRemoveNode(Node node)
        {
            if (mFieldDepth > 0 && !mNodesToSkip.Contains(node))
                node.Remove();
        }

        private int mFieldDepth = 0;
        private ArrayList mNodesToSkip = new ArrayList();
        private FieldType mTargetFieldType;
    }
}


text:
import com.fonmoney.fancycase.FancyTraitCompanion
import shapeless.HNil

/**
  * The abstract vals introduced in a `@fancy trait` are called its fields (i.e. without any inherited ones.)
  * vals with a right-hand-side may be marked as `abstract`; that will then be removed, treated as
  * an optional field and the right-hand-side will be its default value.
  * These must always be the last ones.
  *
  * The fields of `@fancy traits` are expected to be `replacable` in their implementors,
  * i.e. there should be a virtual method that copies the current object but replaces
  *      the values of the abstract fields of the trait.
  **/

@fancy trait A {
  val i : Int
  val s : String
  abstract val e : Boolean = false
}

/** will be equivalent to:
*/

trait A {
  val i : Int
  val s : String
  val e : Boolean = false

  /** The type of the implementing type. Should be overridden in all subtypes. */
  type Self >: this.type <: A

  /** A copy of the current object such that everything is unchanged but values i and s */
  def withA(i: Int = i, s: String = s, e : Boolean = e): Self

  def withA(from : A) : Self = withA(from.i, from.s, from.e)

  def withA(newValues: A.Repr): Self = newValues match {
    case i :: s :: e :: _ => withA(i, s)
  }

  /** `val r = (x : A).withoutA` can be passed around as a "remainder" of dividing x by A. Then,
    * `r * (i, s)` will be equivalent to `x.withA(i,s)`
    **/
  def withoutA: A.Remainder[Self] = new A.Remainder(this)

  /** Determines whether two objects' fields (in A) are equal.
    */
  final def equalsInA(other : A) = i == other.i && s == other.s && e == other.e
}
object A extends FancyTraitCompanion[A] {
  type Repr = Int :: String :: HNil
  object Repr {
    def apply(i : Int, s : String, e : Boolean = false) : Repr = i :: s :: HNil
  }

  class Remainder[+Dividend <: A](of : Dividend { type Self <: Dividend }) {
    def *(i : Int = of.i, s : String = of.s) : Dividend = of.withA(i,s)
    def *(right : Repr) : Dividend = of.withA(right)
  }

  /** Implementors of A can be pattern matched upon without knowing its runtime type.
    * {{{
    * (x : A) match {
    *   case A((i,s), rem) => rem * (i,s)
    * }
    * }}}
    * will then equal x.
    */
  def unapply[T <: A](instance : T { type Self <: T }) : Option[((Int, String), Remainder[T])] = {
    Some((instance.i, instace.s), instance.withoutA)
  }
}

/** Suppose we have the following definitions as well:
*/
@fancy trait B {
  val j : Int
  val k : Int
}

@fancy trait Q extends A {
  val l : Long
  abstract val d : Double = 3.14
}

/** Then, a `@fancy case class` will automatically implement these traits.
  * Their mandatory fields will be inserted into the primary constructor's first parameter list, in order of linearization,
  * between the mandatory and the optional parameters; the optional ones after them.
  * A `fromComponents` method will also be added to the companion object, which is similar to the default apply method,
  * but instead of the ancestor's fields, accepts instances of the ancestor fancy traits.
  **/

@fancy case class C(f : Boolean, x : Boolean = false) extends Q with A with B

/** is equivalent to */

case class C(f : Boolean,
             override i : Int, override s : String,
             override l : Long,
             override j : Int, override k : Int,
             override x : Boolean = false,
             override e : Boolean = A.Repr.apply$defaults$3,
             override d : Double = Q.Repr.apply$defaults$2) extends Q with A with B {
  type Self = C

  override def withA(i : Int = i, s : String = s, e : Boolean = e) = copy(i = i, s = s)
  override def withQ(l : Long = l, d : Double = d) = copy(l = l, d = d)
  override def withB(j : Int = j, k : Int = k) = copy(j = j, k = k)
}
object C {
  def fromComponents(f : Boolean, A : A, Q : Q, B : B, x : Boolean = false) = {
    C(f, A.i, A.s, Q.l, B.j, B.k, x)
  }
}


text:
  This field works in conjunction with the proxy server field to specify the
  HTTP proxy port.