text:
Presentable is a small script/plugin/widget/thingy that adds a table of contents to HTML based presentations by parsing the header tags.

See examples and detailed instructions: [http://fcfeibel.com/presentable/](http://fcfeibel.com/presentable/)

## Framework Support

The following presentation frameworks are supported out of the box, and Presentable can theoretically handle other frameworks too, although your mileage may vary.

* [Reveal.js](https://github.com/hakimel/reveal.js)
* [html5slides](http://code.google.com/p/html5slides/)
* [Shower](https://github.com/pepelsbey/shower)
* [impress.js](https://github.com/bartaz/impress.js/)

## Browser Support
Currently Presentable has been tested and works in Firefox, Chrome, Safari, IE9/10, and the default browser on my HTC G2 Android phone.

## Generic Instructions
These are generic instructions for installing.  See the [official documentation](http://fcfeibel.com/presentable/) for presentation specific instructions.

### CSS
Add the CSS in the  tag.

    <link rel="stylesheet" href="path/to/presentable.css">

### HTML
Wrap the following HTML in a slide.

Table of Contents

And add this as a child of the <body> tag.

### JavaScript
Reference presentable.js following the conventions set by your framework of choice.

### Initialize
This goes after all the slides.

    presentable.toc({
        framework: "framework name here"
    });

It can also accept other configuration options allowing Presentable to support almost any framework.

    presentable.toc({
        config: "options here"
    });

## Learn More
See examples and instructions: [http://fcfeibel.com/presentable/](http://fcfeibel.com/presentable/)

redpajama_set_name: RedPajamaGithub


text:
A web application to connect people across the world with others that have a different demographic profile, but similar interests.

### MVP
  - Create interests and demographics sheet
  - User can view their own profile
  - User can register and login
  - User can be matched with another user
  - User can send and receive messages from their matched pair
  - User can view why you were matched
  - User can view current matched messages
  - User can be given a generated topic
  - User may report another user that is not being respectful

### Stretch Goals
  - User can view past messages
  - User can message in real time
  - User can receive match notification
  - User will receive email after registration
  - User can view information and news articles about various topics
  - Topic are generated dynamically from trending web topics
  - Private demographics option
  - User is automatically switched if there is no communication
  - User can make their profile inactive
  - Scheduling the match switch to run automatically

## Technology
  - Javascript
  - AngularJS
  - Ruby
  - Rails
  - PostgreSQL
  - Redis
  - HTML5
  - CSS3
  - Heroku

## Team
  - Monique Williamson: moniquewill1@yahoo.com
  - Kevin Huang: kevin.ziwen.huang@gmail.com
  - Albert Hahn: xaphx@yahoo.com
  - Jordan Fox: jordanfox15@hotmail.com

Deployment of this app will be on Heroku

Currently there are no restriction to use this code.


text:
using System;
using System.Diagnostics;

namespace MVVm.Core
{
	/// <summary>
	/// A command whose sole purpose is to
	/// relay its functionality to other
	/// objects by invoking delegates. The
	/// default return value for the CanExecute
	/// method is 'true'.
	/// </summary>
	public class RelayCommandNoView : ICommandNoView
	{
		#region Fields
		readonly Action<object> _execute;
		readonly Predicate<object> _canExecute;
		event EventHandler _canExecuteChanged;
		#endregion // Fields

		#region Constructors

		/// <summary>
		/// Creates a new command that can always execute.
		/// </summary>
		/// <param name="execute">The execution logic.</param>
		public RelayCommandNoView(Action<object> execute)
			: this(execute, null)
		{
		}

		/// <summary>
		/// Creates a new command.
		/// </summary>
		/// <param name="execute">The execution logic.</param>
		/// <param name="canExecute">The execution status logic.</param>
		public RelayCommandNoView(Action<object> execute, Predicate<object> canExecute)
		{
			if (execute == null)
				throw new ArgumentNullException("execute");

			_execute = execute;
			_canExecute = canExecute;

		}

		public virtual void RaiseCanExecuteChanged()
		{
			var tempEventHandler = _canExecuteChanged;
			if (tempEventHandler != null)
			{
				tempEventHandler(this, new EventArgs());
			}

		}

		#endregion // Constructors

		#region ICommand Members

		[DebuggerStepThrough]
		public bool CanExecute(object parameter)
		{
			return _canExecute == null ? true : _canExecute(parameter);
		}

		public event EventHandler CanExecuteChanged
		{
			add { _canExecuteChanged += value; }
			remove { _canExecuteChanged -= value; }
		}

		public void Execute(object parameter)
		{
			_execute(parameter);
		}

		#endregion // ICommand Members
	}
}


text:
#ifndef LAME_TIMESTATUS_H
#define LAME_TIMESTATUS_H
void timestatus_klemm(const lame_global_flags * const gfp);

void timestatus ( const int samp_rate,
                  const int frameNum,
                  const int totalframes,
                  const int           framesize);
void timestatus_finish(void);

void decoder_progress(const lame_global_flags * const gfp,const mp3data_struct * const);
void decoder_progress_finish(const lame_global_flags * const gfp);

#endif /* LAME_TIMESTATUS_H */


text:
(function () {
  'use strict';
  var path = require('path');
  var gulp = require('gulp');
  var _ = require('lodash');
  var $ = require('gulp-load-plugins')();
  var opn = require('opn');
  var del = require('del');
  var pkg = require('./package.json');

  var lintSrc  = ['./lib/**/*.js', './gulpfile.js', 'test/**/*.js'];
  var annoSrc  = lintSrc.concat('resources/*.*');
  var testSrc  = ['test/*helper.js', 'test/*spec.js'];
  var annoOpt  = {
    highlight:         'code-prettify',
    SyntaxHighlighter: {style: 'Emacs'},
    CodePrettify:      {style: ''},
    HighlightJS:       {style: 'googlecode'},
    templateOpt:       { pkg: pkg }
  };

  function runCoverage (opts) {
    return gulp.src(testSrc, { read: false })
      .pipe($.coverage.instrument({
        pattern: ['./index.js'],
        debugDirectory: 'debug'}))
      .pipe($.plumber())
      .pipe($.mocha({reporter: 'dot'})
            .on('error', function () { this.emit('end'); })) // test errors dropped
      .pipe($.plumber.stop())
      .pipe($.coverage.gather())
      .pipe($.coverage.format(opts));
  }

  gulp.task("clean", function (done) {
    del(["coverage.html", "debug/**/*", "debug", "dist/*", "dist"], done);
  });

  gulp.task("lint", function () {
    return gulp.src(lintSrc)
      .pipe($.jshint())
      .pipe($.jshint.reporter(require('jshint-table-reporter')));
  });

  gulp.task('coveralls', ['clean'], function () {
    return runCoverage({reporter: 'lcov'})
      .pipe($.coveralls());
  });

  gulp.task('coverage', ['clean'], function () {
    return runCoverage({outFile: './coverage.html'})
      .pipe(gulp.dest('./'))
      .on('end', function () {
        opn('./coverage.html');
      });
  });

  gulp.task("annotate", ['test'], function (done) {
    var annotate = require('./index.js');
    var through2 = require('through2');
    var File = $.util.File;
    var Buffer = require('buffer').Buffer;
    var files = [];
    gulp.src(annoSrc, { read: false })
      .pipe($.annotate('index.html', annoOpt))
      .pipe(gulp.dest('dist')
        .on('end', function () {
          done();
          //opn('./dist/index.html');
        }));
  });

  gulp.task("test", ['clean', 'lint'], function () {
    return gulp.src(testSrc, { read: false })
      .pipe($.plumber())
      .pipe($.mocha({reporter: 'spec', globals: ['expect', 'should']})
           .on('error', function () { this.emit('end'); }))
      .pipe($.plumber.stop());
  });

  gulp.task("watch", function () {
    gulp.watch(lintSrc, ['test', 'annotate']);
  });

  gulp.task("default", ["test"]);
})();


text:
package org.jbromo.common.test.logger;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import org.jbromo.common.ArrayUtil;
import org.jbromo.common.ClassUtil;
import org.jbromo.common.ListUtil;
import org.jbromo.common.invocation.InvocationException;
import org.jbromo.common.invocation.InvocationUtil;
import org.jbromo.common.invocation.InvocationUtil.AccessType;
import org.junit.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.spi.LocationAwareLogger;

@Slf4j
public class MockLogger implements Logger {

    /**
     * serial version UID.
     */
    private static final long serialVersionUID = -4014219155627802093L;

    /**
     * The SLF4J logger.
     */
    private final Logger logger;

    /**
     * If true, logs are logged by SLF4J, else not.
     */
    @Getter
    @Setter
    private boolean enabledSlf4jLog = true;

    /**
     * Define logged messages, by level.
     */
    @Getter
    private final List<LoggedMessage> logged = ListUtil.toList();

    /**
     * Define a logged message.
     */
    @Getter
    @AllArgsConstructor
    private class LoggedMessage {
        /**
         * The level.
         */
        private final int level;

        /**
         * The message.
         */
        private final String message;

        /**
         * Message's arguments.
         */
        private final Object[] arguments;

        /**
         * The throwable.
         */
        private final Throwable throwable;
    }

    /**
     * Default constructor.
     * @param clazz the clazz logging.
     */
    public MockLogger(final Class<?> clazz) {
        super();
        this.logger = LoggerFactory.getLogger(clazz);
    }

    /**
     * Inject a mocker logger into the class.
     * @param clazz the class to inject logger.
     * @return the injected logger.
     */
    public static MockLogger mock(final Class<?> clazz) {
        final Field field = InvocationUtil.getField(clazz, Logger.class);
        // Set field not final.
        try {
            final Field modifiersField = Field.class.getDeclaredField("modifiers");
            Assert.assertNotNull(modifiersField);
            modifiersField.setAccessible(true);
            modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);

            final Logger clazzLogger = InvocationUtil.getValue(null, field, AccessType.FIELD, false);
            if (!ClassUtil.isInstance(clazzLogger, MockLogger.class)) {
                final MockLogger mock = new MockLogger(clazz);
                InvocationUtil.injectValue(null, field, mock);
                // Set mock in clazz.
                return mock;
            } else {
                return MockLogger.class.cast(clazzLogger);
            }
        } catch (final Exception e) {
            log.error("Cannot mock logger", e);
            Assert.fail(e.getMessage());
            return null;
        }
    }

    /**
     * Inject the slf4j logger into the class.
     * @param clazz the class to inject logger.
     */
    public static void unmock(final Class<?> clazz) {
        final Field field = InvocationUtil.getField(clazz, Logger.class);
        // SLF4J logger.
        final Logger logger = LoggerFactory.getLogger(clazz);
        try {
            // Load mocked logger.
            final Logger mock = InvocationUtil.getValue(null, field, AccessType.FIELD, false);
            if (ClassUtil.isInstance(mock, MockLogger.class)) {
                // Set slf4j logger in class.
                InvocationUtil.injectValue(null, field, logger);
            }
        } catch (final InvocationException e) {
            Assert.fail(e.getMessage());
        }
    }

    /**
     * Return enabled level.
     */
    public int getLevel() {
        if (this.logger.isTraceEnabled()) {
            return LocationAwareLogger.TRACE_INT;
        } else if (this.logger.isDebugEnabled()) {
            return LocationAwareLogger.DEBUG_INT;
        } else if (this.logger.isInfoEnabled()) {
            return LocationAwareLogger.INFO_INT;
        } else if (this.logger.isWarnEnabled()) {
            return LocationAwareLogger.WARN_INT;
        } else if (this.logger.isErrorEnabled()) {
            return LocationAwareLogger.ERROR_INT;
        } else {
            Assert.fail("Not implemented!");
            return -1;
        }
    }

    @Override
    public String getName() {
        return this.logger.getName();
    }

    @Override
    public boolean isTraceEnabled() {
        return this.logger.isTraceEnabled();
    }

    /**
     * Log message.
     * @param level the log level.
     * @param message the message.
     */
    private void log(final int level, final String message) {
        log(level, message, new Object[0]);
    }

    /**
     * Log message.
     * @param level the log level.
     * @param message the message.
     * @param arguments the message arguments.
     */
    private void log(final int level, final String message, final Object... arguments) {
        log(level, message, (Throwable) null, arguments);
    }

    /**
     * Log message.
     * @param level the log level.
     * @param message the message.
     * @param throwable the exception to log.
     * @param arguments the message arguments.
     */
    private void log(final int level, final String message, final Throwable throwable, final Object... arguments) {
        this.logged.add(new LoggedMessage(level, message, arguments, throwable));
        if (isEnabledSlf4jLog()) {
            Object[] args;
            if (throwable == null) {
                args = arguments;
            } else {
                args = ArrayUtil.toArray(arguments, throwable);
            }
            switch (level) {
                case LocationAwareLogger.TRACE_INT:
                    this.logger.trace(message, args);
                    break;
                case LocationAwareLogger.DEBUG_INT:
                    this.logger.debug(message, args);
                    break;
                case LocationAwareLogger.INFO_INT:
                    this.logger.info(message, args);
                    break;
                case LocationAwareLogger.WARN_INT:
                    this.logger.warn(message, args);
                    break;
                case LocationAwareLogger.ERROR_INT:
                    this.logger.error(message, args);
                    break;
                default:
                    Assert.fail("Not implemented for level " + level);
            }
        }
    }

    @Override
    public void trace(final String msg) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, msg);
        }
    }

    @Override
    public void trace(final String format, final Object arg) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, format, arg);
        }
    }

    @Override
    public void trace(final String format, final Object arg1, final Object arg2) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, format, arg1, arg2);
        }
    }

    @Override
    public void trace(final String format, final Object[] argArray) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, format, argArray);
        }
    }

    @Override
    public void trace(final String msg, final Throwable throwable) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, msg, throwable);
        }
    }

    @Override
    public boolean isTraceEnabled(final Marker marker) {
        return this.logger.isTraceEnabled(marker);
    }

    @Override
    public void trace(final Marker marker, final String msg) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, msg);
        }
    }

    @Override
    public void trace(final Marker marker, final String format, final Object arg) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, format, arg);
        }
    }

    @Override
    public void trace(final Marker marker, final String format, final Object arg1, final Object arg2) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, format, arg1, arg2);
        }
    }

    @Override
    public void trace(final Marker marker, final String format, final Object[] argArray) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, format, argArray);
        }
    }

    @Override
    public void trace(final Marker marker, final String msg, final Throwable throwable) {
        if (isTraceEnabled()) {
            log(LocationAwareLogger.TRACE_INT, msg, throwable);
        }
    }

    @Override
    public boolean isDebugEnabled() {
        return this.logger.isDebugEnabled();
    }

    @Override
    public void debug(final String msg) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, msg);
        }
    }

    @Override
    public void debug(final String format, final Object arg) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, format, arg);
        }
    }

    @Override
    public void debug(final String format, final Object arg1, final Object arg2) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, format, arg1, arg2);
        }
    }

    @Override
    public void debug(final String format, final Object[] argArray) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, format, argArray);
        }
    }

    @Override
    public void debug(final String msg, final Throwable throwable) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, msg, throwable);
        }
    }

    @Override
    public boolean isDebugEnabled(final Marker marker) {
        return this.logger.isDebugEnabled(marker);
    }

    @Override
    public void debug(final Marker marker, final String msg) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, msg);
        }
    }

    @Override
    public void debug(final Marker marker, final String format, final Object arg) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, format, arg);
        }
    }

    @Override
    public void debug(final Marker marker, final String format, final Object arg1, final Object arg2) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, format, arg1, arg2);
        }
    }

    @Override
    public void debug(final Marker marker, final String format, final Object[] argArray) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, format, argArray);
        }
    }

    @Override
    public void debug(final Marker marker, final String msg, final Throwable throwable) {
        if (isDebugEnabled()) {
            log(LocationAwareLogger.DEBUG_INT, msg, throwable);
        }
    }

    @Override
    public boolean isInfoEnabled() {
        return this.logger.isInfoEnabled();
    }

    @Override
    public void info(final String msg) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, msg);
        }
    }

    @Override
    public void info(final String format, final Object arg) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, format, arg);
        }
    }

    @Override
    public void info(final String format, final Object arg1, final Object arg2) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, format, arg1, arg2);
        }
    }

    @Override
    public void info(final String format, final Object[] argArray) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, format, argArray);
        }
    }

    @Override
    public void info(final String msg, final Throwable throwable) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, msg, throwable);
        }
    }

    @Override
    public boolean isInfoEnabled(final Marker marker) {
        return this.logger.isInfoEnabled(marker);
    }

    @Override
    public void info(final Marker marker, final String msg) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, msg);
        }
    }

    @Override
    public void info(final Marker marker, final String format, final Object arg) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, format, arg);
        }
    }

    @Override
    public void info(final Marker marker, final String format, final Object arg1, final Object arg2) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, format, arg1, arg2);
        }
    }

    @Override
    public void info(final Marker marker, final String format, final Object[] argArray) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, format, argArray);
        }
    }

    @Override
    public void info(final Marker marker, final String msg, final Throwable t) {
        if (isInfoEnabled()) {
            log(LocationAwareLogger.INFO_INT, msg, t);
        }
    }

    @Override
    public boolean isWarnEnabled() {
        return this.logger.isWarnEnabled();
    }

    @Override
    public void warn(final String msg) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, msg);
        }
    }

    @Override
    public void warn(final String format, final Object arg) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, format, arg);
        }
    }

    @Override
    public void warn(final String format, final Object[] argArray) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, format, argArray);
        }
    }

    @Override
    public void warn(final String format, final Object arg1, final Object arg2) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, format, arg1, arg2);
        }
    }

    @Override
    public void warn(final String msg, final Throwable throwable) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, msg, throwable);
        }
    }

    @Override
    public boolean isWarnEnabled(final Marker marker) {
        return this.logger.isWarnEnabled(marker);
    }

    @Override
    public void warn(final Marker marker, final String msg) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, msg);
        }
    }

    @Override
    public void warn(final Marker marker, final String format, final Object arg) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, format, arg);
        }
    }

    @Override
    public void warn(final Marker marker, final String format, final Object arg1, final Object arg2) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, format, arg1, arg2);
        }
    }

    @Override
    public void warn(final Marker marker, final String format, final Object[] argArray) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, format, argArray);
        }
    }

    @Override
    public void warn(final Marker marker, final String msg, final Throwable throwable) {
        if (isWarnEnabled()) {
            log(LocationAwareLogger.WARN_INT, msg, throwable);
        }
    }

    @Override
    public boolean isErrorEnabled() {
        return this.logger.isErrorEnabled();
    }

    @Override
    public void error(final String msg) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, msg);
        }
    }

    @Override
    public void error(final String format, final Object arg) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, format, arg);
        }
    }

    @Override
    public void error(final String format, final Object arg1, final Object arg2) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, format, arg1, arg2);
        }
    }

    @Override
    public void error(final String format, final Object[] argArray) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, format, argArray);
        }
    }

    @Override
    public void error(final String msg, final Throwable throwable) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, msg, throwable);
        }
    }

    @Override
    public boolean isErrorEnabled(final Marker marker) {
        return this.logger.isErrorEnabled(marker);
    }

    @Override
    public void error(final Marker marker, final String msg) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, msg);
        }
    }

    @Override
    public void error(final Marker marker, final String format, final Object arg) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, format, arg);
        }
    }

    @Override
    public void error(final Marker marker, final String format, final Object arg1, final Object arg2) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, format, arg1, arg2);
        }
    }

    @Override
    public void error(final Marker marker, final String format, final Object[] argArray) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, format, argArray);
        }
    }

    @Override
    public void error(final Marker marker, final String msg, final Throwable throwable) {
        if (isErrorEnabled()) {
            log(LocationAwareLogger.ERROR_INT, msg, throwable);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/linear0"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:background="@color/white"
	android:orientation="vertical" >

	<LinearLayout
		android:id="@+id/linearLayout1"
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:paddingBottom="5dip"
		android:paddingTop="10dip" >

		<TextView
			android:id="@+id/tv_tab1"
			android:layout_width="fill_parent"
			android:layout_height="fill_parent"
			android:layout_weight="1.0"
			android:gravity="center"
			android:text="榜单"
			android:textColor="@color/blue"
			android:textSize="18sp" />

		<TextView
			android:id="@+id/tv_tab2"
			android:layout_width="fill_parent"
			android:layout_height="fill_parent"
			android:layout_weight="1.0"
			android:gravity="center"
			android:text="分类"
			android:textColor="@color/chocolate"
			android:textSize="18sp" />

		<TextView
			android:id="@+id/tv_tab3"
			android:layout_width="fill_parent"
			android:layout_height="fill_parent"
			android:layout_weight="1.0"
			android:gravity="center"
			android:text="新锐"
			android:textColor="@color/chocolate"
			android:textSize="18sp" />
	</LinearLayout>

	<LinearLayout
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_gravity="bottom"
		android:orientation="vertical"
		android:paddingBottom="3dip" >

		<ImageView
			android:id="@+id/iv_title_line"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginLeft="30dp"
			android:scaleType="matrix"
			android:src="@drawable/line" />
	</LinearLayout>

</LinearLayout>


text:
package gov.nih.nci.cananolab.dto.common;

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

import org.codehaus.jackson.annotate.JsonIgnore;

import gov.nih.nci.cananolab.security.AccessControlInfo;

public class SecuredDataBean
{
	private List<AccessControlInfo> userAccesses = new ArrayList<AccessControlInfo>();
	private List<AccessControlInfo> groupAccesses = new ArrayList<AccessControlInfo>();

	private AccessControlInfo theAccess = new AccessControlInfo();

	protected String createdBy;

	private Boolean userUpdatable = false;
	private Boolean userDeletable = false;
	private Boolean userIsOwner = false;

	private Boolean publicStatus = false;

	public Boolean getPublicStatus() {
		return publicStatus;
	}

	public void setPublicStatus(Boolean publicStatus)
	{
		this.publicStatus = publicStatus;
	}

	@JsonIgnore
	private List<AccessControlInfo> allAccesses = new ArrayList<AccessControlInfo>();

	public List<AccessControlInfo> getUserAccesses() {
		return userAccesses;
	}

	public void setUserAccesses(List<AccessControlInfo> userAccesses) {
		this.userAccesses = userAccesses;
		allAccesses.addAll(userAccesses);
	}

	public void addUserAccess(AccessControlInfo userAccess)
	{
		this.userAccesses.add(userAccess);
	}

	public List<AccessControlInfo> getGroupAccesses() {
		return groupAccesses;
	}

	public void setGroupAccesses(List<AccessControlInfo> groupAccesses) {
		this.groupAccesses = groupAccesses;
		allAccesses.addAll(groupAccesses);
	}

	public void addGroupAccess(AccessControlInfo groupAccess)
	{
		this.groupAccesses.add(groupAccess);
	}

	public List<AccessControlInfo> getAllAccesses() {
		return allAccesses;
	}

	public AccessControlInfo getTheAccess() {
		return theAccess;
	}

	public void setTheAccess(AccessControlInfo theAccess) {
		this.theAccess = theAccess;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Boolean getUserUpdatable() {
		return userUpdatable;
	}

	public void setUserUpdatable(Boolean userUpdatable) {
		this.userUpdatable = userUpdatable;
	}

	public Boolean getUserDeletable() {
		return userDeletable;
	}

	public void setUserDeletable(Boolean userDeletable) {
		this.userDeletable = userDeletable;
	}

}


text:
#ifndef __UTIL_INDEX_QUEUE_H__
#define __UTIL_INDEX_QUEUE_H__

#include <assert.h>
#include <pthread.h>
#include <string.h>
#include <time.h>

#include <util/link.h>
#include <util/logger.h>

/**
 * A thread-safe queue where its element can be accessed by index.
 * Each element of the queue is a pointer to the type.
 */
template <class Type>
class IndexQueue
{
    public:
        IndexQueue(size_t size);
        ~IndexQueue();
        Link<Type> * getSlot();
        size_t getSlots(Link<Type> ** elmts, size_t size);
        Type * get(size_t idx);
        void del(size_t idx);
        void dels(size_t * elmts, size_t size);
        size_t getWaitCnt();

    private:
        Link<Type> ** mQueue;
        size_t mSize;
        Link<Type> * mSlotList;

//        size_t mWaitCnt;

        pthread_mutex_t mLock;
        pthread_cond_t mCond;

        size_t mCnt;
};

template <class Type>
IndexQueue<Type>::IndexQueue(size_t size)
{
    mSize = size;
//    mWaitCnt = 0;

    mQueue = new Link<Type> *[mSize];
    for (size_t i = 0; i < mSize; ++i) {
        mQueue[i] = new Link<Type>();
        mQueue[i]->mId = i;
        if (i > 0)
            mQueue[i - 1]->mpNext = mQueue[i];
    }
    mSlotList = mQueue[0];

    pthread_mutex_init(&mLock, NULL);
    pthread_cond_init(&mCond, NULL);

    mCnt = 0;
}

template <class Type>
IndexQueue<Type>::~IndexQueue()
{
    for (size_t i = 0; i < mSize; ++i)
        delete mQueue[i];
    delete[] mQueue;

    Logger::out(2, "IndexQueue: Destroyed at time %d.\n", time(NULL));

    pthread_mutex_destroy(&mLock);
    pthread_cond_destroy(&mCond);
}

template <class Type>
Link<Type> * IndexQueue<Type>::getSlot()
{
    pthread_mutex_lock(&mLock);
    while (mSlotList == NULL) {
        pthread_cond_wait(&mCond, &mLock);
    }
    Link<Type> * tmp = mSlotList;
    mSlotList = mSlotList->mpNext;
    ++mCnt;
    assert(mCnt <= mSize);
    pthread_mutex_unlock(&mLock);
    return tmp;
}

template <class Type>
size_t IndexQueue<Type>::getSlots(Link<Type> ** elmts, size_t size)
{
    pthread_mutex_lock(&mLock);
    while (mSlotList == NULL) {
        pthread_cond_wait(&mCond, &mLock);
    }
    size_t cnt = 0;
    while (cnt < size && mSlotList != NULL) {
        elmts[cnt++] = mSlotList;
        mSlotList = mSlotList->mpNext;
    }
    mCnt += cnt;
    assert(mCnt <= mSize);
    pthread_mutex_unlock(&mLock);
    return cnt;
}

template <class Type>
Type * IndexQueue<Type>::get(size_t idx)
{
    return mQueue[idx]->mpVal;
}

template <class Type>
void IndexQueue<Type>::del(size_t idx)
{
    pthread_mutex_lock(&mLock);
    mQueue[idx]->mpNext = mSlotList;
    mSlotList = mQueue[idx];
    assert(mCnt > 0);
    --mCnt;
    pthread_cond_signal(&mCond);
    pthread_mutex_unlock(&mLock);
}

template <class Type>
void IndexQueue<Type>::dels(size_t * elmts, size_t size)
{
    pthread_mutex_lock(&mLock);
    for (size_t i = 0; i < size; ++i) {
        mQueue[elmts[i]]->mpNext = mSlotList;
        mSlotList = mQueue[elmts[i]];
    }
    assert(mSlotList != NULL);
    assert(mCnt >= size);
    mCnt -= size;
    pthread_cond_signal(&mCond);
    pthread_mutex_unlock(&mLock);
}

template <class Type>
size_t IndexQueue<Type>::getWaitCnt()
{
    return 0;
//    return mWaitCnt;
}

#endif // __UTIL_INDEX_QUEUE_H__


text:
\begin{figure}[H]
\centering
\includegraphics[width=6in]{figs/run_24/run_24_nut_ratio_fit}
\caption{Polynomial fits of reynolds stress and velocity gradient terms at $z/c$=7.75, $V_{free}$=21.09, station 3.}
\label{fig:run_24_nut_ratio_fit}
\end{figure}


text:
Please note the following guidelines before submitting pull requests:

- Make sure ESLint passes with `npm run lint`
- Always create pull requests to the *develop* branch


text:
package com.aston.asql.expr;

public interface IExprEval {

	public Object eval(Object val) throws Exception;
}


text:
<?php

namespace backend\models\heating;

use Yii;

/**
 * This is the model class for table "hotwaterRate".
 *
 * @property integer $hotwater_rate_id
 * @property string $dec_rate_person
 * @property string $dec_rate_metr2
 * @property string $date_of_decree
 * @property string $date_of_filling
 *
 * @property HeatingBook[] $heatingBooks
 */
class HotwaterRate extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'hotwaterRate';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['dec_rate_person', 'dec_rate_metr2', 'date_of_decree', 'date_of_filling'], 'required'],
            [['dec_rate_person', 'dec_rate_metr2'], 'number'],
            [['date_of_decree', 'date_of_filling'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'hotwater_rate_id' => 'Hotwater Rate ID',
            'dec_rate_person' => 'Dec Rate Person',
            'dec_rate_metr2' => 'Dec Rate Metr2',
            'date_of_decree' => 'Date Of Decree',
            'date_of_filling' => 'Date Of Filling',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getHeatingBooks()
    {
        return $this->hasMany(HeatingBook::className(), ['hotwater_rate_id' => 'hotwater_rate_id']);
    }
}


text:
package com.hivemq.spi.callback.security.authorization;

/**
 * The Authorization behaviour which defines if
 * an authorization was granted, denied or if
 * another callback should be called
 *
 * @author Christoph Schäbel
 * @since 3.0
 */
public enum AuthorizationBehaviour {

    ACCEPT,
    DENY,
    NEXT
}


text:
SELECT DISTINCT artist,sum(timesplayed) AS total
FROM songs
GROUP BY LOWER(artist)
LIMIT -1 OFFSET 2


text:
'use strict';

var versioner = require('./plugins/mongoose-versioner'),
	pagedFind = require('./plugins/pagedFind');

exports = module.exports = function(app, mongo) {

	var mediafileSchema = new mongo.Schema({
		_id: { type: String },
		geoLocation: { type: String, default: ''},
		lastCheckedBy: { type: String, default: '' },
		action: { type: Number, default: 0 },
		lifecycle: { type: Number, default: 0 },
		filename: { type: String, default: '' },
		name: { type: String, default: '' },
		actionLog: { type: Array, default: [] }
	});

	mediafileSchema.plugin(pagedFind);
	mediafileSchema.plugin(versioner, {modelName:'Mediafile', mongoose:mongo});

	mediafileSchema.index({ pivot: 1 });
	mediafileSchema.index({ name: 1 });
	mediafileSchema.set('autoIndex', (app.get('env') === 'development'));

	app.db.model('Mediafile', mediafileSchema);
};


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

#include "chrome/browser/media/router/media_router_base.h"

#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"

namespace media_router {

MediaRouterBase::MediaRouterBase() = default;

MediaRouterBase::~MediaRouterBase() = default;

std::unique_ptr<PresentationConnectionStateSubscription>
MediaRouterBase::AddPresentationConnectionStateChangedCallback(
    const MediaRoute::Id& route_id,
    const content::PresentationConnectionStateChangedCallback& callback) {
  DCHECK(thread_checker_.CalledOnValidThread());

  auto* callbacks = presentation_connection_state_callbacks_.get(route_id);
  if (!callbacks) {
    callbacks = new PresentationConnectionStateChangedCallbacks;
    callbacks->set_removal_callback(base::Bind(
        &MediaRouterBase::OnPresentationConnectionStateCallbackRemoved,
        base::Unretained(this), route_id));
    presentation_connection_state_callbacks_.add(route_id,
                                                 base::WrapUnique(callbacks));
  }

  return callbacks->Add(callback);
}

void MediaRouterBase::OnOffTheRecordProfileShutdown() {
  // TODO(mfoltz): There is a race condition where off-the-record routes created
  // by pending CreateRoute requests won't be terminated.  Fixing this would
  // extra bookeeping of route requests in progress, and a way to cancel them
  // in-flight.
  for (auto route_ids_it = off_the_record_route_ids_.begin();
       route_ids_it != off_the_record_route_ids_.end();
       /* no-op */) {
    // TerminateRoute will erase |route_id| from |off_the_record_route_ids_|,
    // make a copy as the iterator will be invalidated.
    const MediaRoute::Id route_id = *route_ids_it++;
    TerminateRoute(route_id);
  }
}

void MediaRouterBase::NotifyPresentationConnectionStateChange(
    const MediaRoute::Id& route_id,
    content::PresentationConnectionState state) {
  if (state == content::PRESENTATION_CONNECTION_STATE_TERMINATED)
    OnRouteTerminated(route_id);

  auto* callbacks = presentation_connection_state_callbacks_.get(route_id);
  if (!callbacks)
    return;

  callbacks->Notify(content::PresentationConnectionStateChangeInfo(state));
}

void MediaRouterBase::NotifyPresentationConnectionClose(
    const MediaRoute::Id& route_id,
    content::PresentationConnectionCloseReason reason,
    const std::string& message) {
  auto* callbacks = presentation_connection_state_callbacks_.get(route_id);
  if (!callbacks)
    return;

  content::PresentationConnectionStateChangeInfo info(
      content::PRESENTATION_CONNECTION_STATE_CLOSED);
  info.close_reason = reason;
  info.message = message;
  callbacks->Notify(info);
}

void MediaRouterBase::OnOffTheRecordRouteCreated(
    const MediaRoute::Id& route_id) {
  DCHECK(!ContainsKey(off_the_record_route_ids_, route_id));
  off_the_record_route_ids_.insert(route_id);
}

void MediaRouterBase::OnRouteTerminated(const MediaRoute::Id& route_id) {
  // NOTE: This is called for all routes (off the record or not).
  off_the_record_route_ids_.erase(route_id);
}

void MediaRouterBase::OnPresentationConnectionStateCallbackRemoved(
    const MediaRoute::Id& route_id) {
  auto* callbacks = presentation_connection_state_callbacks_.get(route_id);
  if (callbacks && callbacks->empty())
    presentation_connection_state_callbacks_.erase(route_id);
}

}  // namespace media_router


text:
require('material-design-lite/material.min.js')
require('material-design-lite/material.min.css')
require('material-design-icons/iconfont/material-icons.css')

import Vue from 'vue'
import Router from 'vue-router'
import Resource from 'vue-resource'
import VueMdl from 'vue-mdl'
import App from './components/App'
import Card from './components/Card'
import Layout from './components/Layout'
import Dialog from './components/Dialog'
import UserManagement from './components/UserManagement'
import LoginManagement from './components/LoginManagement'
import AtlasDownload from './components/AtlasDownload'
import Management from './components/Management'

Vue.config.debug = true
Vue.use(Router)
Vue.use(VueMdl)
Vue.use(Resource)

Vue.component('foxgis-layout', Layout)
Vue.component('foxgis-dialog',Dialog)
Vue.component('foxgis-card', Card)

let router = new Router({
  history: false
})

router.map({
  '/': {
    component: function (resolve) {
      require(['./components/LoginManagement.vue'], resolve)
    }
  },
  '/loginManagement': {
    component: function (resolve) {
      require(['./components/LoginManagement.vue'], resolve)
    }
  },
  '/management': {
    component: function (resolve) {
      require(['./components/Management.vue'], resolve)
    },
    subRoutes: {
      '/userManagement': {
        component: function (resolve) {
          require(['./components/UserManagement.vue'], resolve)
        }
      },
      '/atlasDownload': {
        component: function (resolve) {
          require(['./components/AtlasDownload.vue'], resolve)
        }
      }
    }
  },
})

router.start(App, '#app')


text:
import { useStorybookApi, useStorybookState } from '@storybook/api';
import { IconButton, Icons, FlexBar, TabBar, TabButton, ScrollArea } from '@storybook/components';
import { Location, Route } from '@storybook/router';
import { styled } from '@storybook/theming';
import { document } from 'global';
import React, { FunctionComponent, SyntheticEvent, Fragment } from 'react';

import { AboutPage } from './about_page';
import { ReleaseNotesPage } from './release_notes_page';
import { ShortcutsPage } from './shortcuts_page';
import { matchesModifiers, matchesKeyCode } from '../keybinding';

const TabBarButton = React.memo<{
  changeTab: (tab: string) => void;
  id: string;
  title: string;
}>(({ changeTab, id, title }) => (
  <Location>
    {({ path }) => {
      const active = path.includes(`settings/${id}`);
      return (
        <TabButton
          id={`tabbutton-${id}`}
          className={['tabbutton'].concat(active ? ['tabbutton-active'] : []).join(' ')}
          type="button"
          key="id"
          active={active}
          onClick={() => changeTab(id)}
          role="tab"
        >
          {title}
        </TabButton>
      );
    }}
  </Location>
));

const Content = styled(ScrollArea)(
  {
    position: 'absolute',
    top: 40,
    left: 0,
    right: 0,
    bottom: 0,
    overflow: 'auto',
  },
  ({ theme }) => ({
    background: theme.background.content,
  })
);

const Pages: FunctionComponent<{
  onClose: () => void;
  enableShortcuts?: boolean;
  hasReleaseNotes?: boolean;
  changeTab: (tab: string) => void;
}> = ({ changeTab, onClose, enableShortcuts = true, hasReleaseNotes = false }) => {
  React.useEffect(() => {
    const handleEscape = (event: KeyboardEvent) => {
      if (!enableShortcuts || event.repeat) return;
      if (matchesModifiers(false, event) && matchesKeyCode('Escape', event)) {
        event.preventDefault();
        onClose();
      }
    };
    document.addEventListener('keydown', handleEscape);
    return () => document.removeEventListener('keydown', handleEscape);
  }, []);

  return (
    <Fragment>
      <FlexBar border>
        <TabBar role="tablist">
          <TabBarButton id="about" title="About" changeTab={changeTab} />
          {hasReleaseNotes && (
            <TabBarButton id="release-notes" title="Release notes" changeTab={changeTab} />
          )}
          <TabBarButton id="shortcuts" title="Keyboard shortcuts" changeTab={changeTab} />
        </TabBar>
        <IconButton
          onClick={(e: SyntheticEvent) => {
            e.preventDefault();
            return onClose();
          }}
        >
          <Icons icon="close" />
        </IconButton>
      </FlexBar>
      <Content vertical horizontal={false}>
        <Route path="about">
          <AboutPage key="about" />
        </Route>
        <Route path="release-notes">
          <ReleaseNotesPage key="release-notes" />
        </Route>
        <Route path="shortcuts">
          <ShortcutsPage key="shortcuts" />
        </Route>
      </Content>
    </Fragment>
  );
};

const SettingsPages: FunctionComponent = () => {
  const api = useStorybookApi();
  const state = useStorybookState();
  const changeTab = (tab: string) => api.changeSettingsTab(tab);

  return (
    <Pages
      hasReleaseNotes={!!api.releaseNotesVersion()}
      enableShortcuts={state.ui.enableShortcuts}
      changeTab={changeTab}
      onClose={api.closeSettings}
    />
  );
};

export { SettingsPages as default };


text:
<!DOCTYPE html>

  <title>TechnicallySpeaking</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/Style_Sheets/blog-stylesheet.css.css">

Technically Speaking

Learning by sharing what I've learned

** Enumerable #map ** Sunday, May 24th, 2015

		HOME BLOG INDEX

  Say you have a list. You want to make a new list based on that first list but with modification to each item in that list; just to be clear it's the same modification for each item. You could write code to take the first item, change it, add it to the new list and do all of that for every item in the list. You'd hate life, but you could do it.  OR… you could use the enumerable #map to create that second list and do that modification to each item in the original list automatically.

  Now that I wrote that little gem I begin to understand why reference materials for coders all sound like Yoda writing instructions on how to put together an Ikea bookshelf.

  Okay let's clean that up a bit.

  For demonstration's sake, let's say we're working with a list of prices and you want to figure out what those prices would total out to with tax. Say 7.38%.  I want to maintain my original list unchanged but want my other list to have the price plus tax.  #map is a method used in Ruby. What it does is look into an array (a group of something), does something to each item in that array, then makes a new array out of the results.

		You want this:              To give you this:

		     Item                     Item plus tax

		     8.98,                        9.64

		     10.99                       11.80

		     50.0                        53.69

		     12.52                       13.44

		     5.0                         5.37

  We start with that first list, an array of numbers:

  array1 = [8.98, 10.99, 50.00, 12.52, 5.00]

  We want to create a second list, based on the first.

  array2 = array1

  But we want to actually have the second list calculate item plus tax on each item, and give us back each item in the new list.

  array2 = array1.map{ |n| (n*1.0738).round(2)}

  So what's going on there?  Let's break down the statement a piece at a time.

  "array2 = " means create a new array setting it equal to this junk on the right.

  "array1.map"  means to look into array1 and put each value I find into array2
                          after I do this stuff in the braces to my right.

  "{"  The curly braces says to start following instructions that will apply to each item in array1.

  "|n|" This is us telling map to use the letter n as a representation of each item in array1.

  "(n*1.0738)" This tells map to multiple the item found by 1.0738…

  ".round(2)"  … then round it to the nearest hundredth.

  "}" The last curly brace indicates the end of the instruction.

  In this particular setup, everything between the curly braces {} is done to every item in the array.

  One thing I need to point out. #map is what's called a non-destructive method, which means it leaves the original thing it looked into completely unchanged.  You can see how array1 wasn't changed in the example shown below, and what the result was of using #map (plus the instructions for figuring tax) returned.

  array1 = [8.98, 10.99, 50.00, 12.52, 5.00]

  array2 = array1.map{ |n| (n*1.0738).round(2)}

  p array1 # => returns the original array [8.98, 10.99, 50.00, 12.52, 5.00]

  p array2 #=> returns the new array with the adjustments [9.16, 11.21, 51.0, 12.77, 11.21]


text:
.. This file is part of the OpenDSA eTextbook project. See
.. http://algoviz.org/OpenDSA for more details.
.. Copyright (c) 2012-13 by the OpenDSA Project Contributors, and
.. distributed under an MIT open source license.

.. avmetadata::
   :author: David Furcy and Tom Naps

Defining SLang 1
================

Syntax of SLang 1
-----------------

Text forthcoming

RP 20 Part 1
------------

This problem will help you master the concrete syntax of SLang 1. To earn
credit for it, you must complete this randomized problem
correctly three times in a row.

.. avembed:: Exercises/PL/RP20part1.html ka

RP 20 Part 2
------------

This problem will help you master the abstract syntax of SLang 1.

.. avembed:: Exercises/PL/RP20part2.html ka

RP 21 Part 1
------------

This problem will illustrate the semantics of SLang 1 while helping
you review the definition of the *curry* function.

.. avembed:: Exercises/PL/RP21part1.html ka

RP 21 Part 2
------------

This problem focuses on the semantics of SLang 1.

.. avembed:: Exercises/PL/RP21part2.html ka


text:
                <onos-icon class="close-btn" classes="active-close" iconId="close" iconSize="20" (click)="close()"></onos-icon>

                <onos-icon classes="details-icon" iconId="m_ports" [iconSize]="42"></onos-icon>

{{detailsData.devId}} port {{detailsData.id}}

                                    ID :
                                    {{detailsData.id}}

                                    Device :
                                    {{detailsData.devId}}

                                    Type :
                                    {{detailsData.type}}

                                    Speed :
                                    {{detailsData.speed}}

                                    Enabled :
                                    {{detailsData.enabled}}


text:
package org.spongepowered.common.event.filter.delegate;

import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

public interface ParameterFilterDelegate {

    void write(ClassWriter cw, MethodVisitor mv, Method method, Parameter param, int localParam);

}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Diagnostics;
using Lada.Windows.Input;

namespace Lada.Windows.MotionFlow
{
    public interface IMotionTransferCase : IMotionInput, IEnumerable<IMotionTransfer>, IMotionTransferOutput
    {
    }

    public interface INativeMotionTransferCase : INativeMotionInput, IEnumerable<INativeMotionTransfer>, INativeMotionTransferOutput
    {
    }

    public abstract class MotionTransferCaseBase : MotionElement, IMotionTransferCase
    {
        public IMotionInfo  MotionInfo
        {
            get
            {
                return this.First ().MotionInfo;
            }
        }
        public double       Remainder
        {
            get
            {
                return this.Sum (item => item.Remainder);
            }
        }
        public void         Transmit(IMotionInfo info, double delta, IMotionOutput source)
        {
            foreach (var item in this)
                item.Transmit (info, delta, source);
        }
        public void         OnCoupledTransfer(IMotionInfo info, double delta, IMotionTransferOutput source)
        {
            foreach (var item in this)
                item.OnCoupledTransfer (info, delta, source);
        }
        public void         Reset()
        {
            foreach (var item in this)
                item.Reset ();
        }
        public bool         Transfer(IMotionTarget target, object context)
        {
            return this.All (item => item.Transfer (target, context));
        }
        public abstract     IEnumerator<IMotionTransfer> GetEnumerator();
        IEnumerator         IEnumerable.GetEnumerator()
        {
            return GetEnumerator ();
        }
    }

    public abstract class NativeMotionTransferCaseBase : ContentElement, INativeMotionTransferCase
    {
        public IMotionInfo  MotionInfo
        {
            get
            {
                return this.First ().MotionInfo;
            }
        }
        public double       Remainder
        {
            get
            {
                return this.Sum (item => item.Remainder);
            }
        }
        public int          NativeRemainder
        {
            get
            {
                return this.Sum (item => item.NativeRemainder);
            }
        }
        public void         Transmit(IMotionInfo info, int nativeDelta, INativeMotionOutput source)
        {
            foreach (var item in this)
                item.Transmit (info, nativeDelta, source);
        }
        public void         OnCoupledTransfer(IMotionInfo info, int nativeDelta, INativeMotionTransferOutput source)
        {
            foreach (var item in this)
                item.OnCoupledTransfer (info, nativeDelta, source);
        }
        public void         Reset()
        {
            foreach (var item in this)
                item.Reset ();
        }
        public bool         Transfer(IMotionTarget target, object context)
        {
            return this.All (item => item.Transfer (target, context));
        }
        public bool         Transfer(INativeMotionTarget target, object context)
        {
            return this.All (item => item.Transfer (target, context));
        }
        public abstract     IEnumerator<INativeMotionTransfer> GetEnumerator();
        IEnumerator         IEnumerable.GetEnumerator()
        {
            return GetEnumerator ();
        }
    }

    public class MotionTransferCase : MotionTransferCaseBase
    {
        public void                                     Add(IMotionTransfer item)
        {
            _items.Add (item);
            item.SetParent (this);
        }
        public bool                                     Remove(IMotionTransfer item)
        {
            bool removed = _items.Remove (item);
            if (removed)
                item.SetParent (null);
            return removed;
        }
        public override IEnumerator<IMotionTransfer>    GetEnumerator()
        {
            return _items.GetEnumerator ();
        }

        private readonly List<IMotionTransfer>          _items = new List<IMotionTransfer>();
    }

    public class NativeMotionTransferCase : NativeMotionTransferCaseBase
    {
        public void                                         Add(INativeMotionTransfer item)
        {
            _items.Add (item);
            item.SetParent (this);
        }
        public bool                                         Remove(INativeMotionTransfer item)
        {
            bool removed = _items.Remove (item);
            if (removed)
                item.SetParent (null);
            return removed;
        }
        public override IEnumerator<INativeMotionTransfer>  GetEnumerator()
        {
            return _items.GetEnumerator ();
        }

        private readonly List<INativeMotionTransfer>        _items = new List<INativeMotionTransfer>();
    }

    public class NativeCoupledMotionTransferCase : NativeMotionTransferCase
    {
        public          NativeCoupledMotionTransferCase()
        {
            AddHandler (NativeMotionTransfer.TransferedEvent, new NativeMotionTransferEventHandler (OnMotionTransfered));
        }

        private void    OnMotionTransfered(object sender, NativeMotionTransferEventArgs e)
        {
            var source = e.Source as INativeMotionTransferOutput;
            Debug.Assert (source != null);
            foreach (var item in this)
                item.OnCoupledTransfer (e.MotionInfo, e.NativeDelta, source);
        }
    }
}


text:
package org.springframework.boot.actuate.endpoint.web.annotation;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.springframework.boot.actuate.endpoint.EndpointFilter;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.Operation;
import org.springframework.boot.actuate.endpoint.annotation.DiscoveredOperationMethod;
import org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer;
import org.springframework.boot.actuate.endpoint.invoke.OperationInvoker;
import org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper;
import org.springframework.boot.actuate.endpoint.web.PathMapper;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.util.ClassUtils;

/**
 * {@link EndpointDiscoverer} for {@link ExposableControllerEndpoint controller
 * endpoints}.
 *
 * @author Phillip Webb
 * @since 2.0.0
 */
public class ControllerEndpointDiscoverer
		extends EndpointDiscoverer<ExposableControllerEndpoint, Operation>
		implements ControllerEndpointsSupplier {

	private final List<PathMapper> endpointPathMappers;

	/**
	 * Create a new {@link ControllerEndpointDiscoverer} instance.
	 * @param applicationContext the source application context
	 * @param endpointPathMappers the endpoint path mappers
	 * @param filters filters to apply
	 */
	public ControllerEndpointDiscoverer(ApplicationContext applicationContext,
			List<PathMapper> endpointPathMappers,
			Collection<EndpointFilter<ExposableControllerEndpoint>> filters) {
		super(applicationContext, ParameterValueMapper.NONE, Collections.emptyList(),
				filters);
		this.endpointPathMappers = endpointPathMappers;
	}

	@Override
	protected boolean isEndpointExposed(Object endpointBean) {
		Class<?> type = ClassUtils.getUserClass(endpointBean.getClass());
		return AnnotatedElementUtils.isAnnotated(type, ControllerEndpoint.class)
				|| AnnotatedElementUtils.isAnnotated(type, RestControllerEndpoint.class);
	}

	@Override
	protected ExposableControllerEndpoint createEndpoint(Object endpointBean,
			EndpointId id, boolean enabledByDefault, Collection<Operation> operations) {
		String rootPath = PathMapper.getRootPath(this.endpointPathMappers, id);
		return new DiscoveredControllerEndpoint(this, endpointBean, id, rootPath,
				enabledByDefault);
	}

	@Override
	protected Operation createOperation(EndpointId endpointId,
			DiscoveredOperationMethod operationMethod, OperationInvoker invoker) {
		throw new IllegalStateException(
				"ControllerEndpoints must not declare operations");
	}

	@Override
	protected OperationKey createOperationKey(Operation operation) {
		throw new IllegalStateException(
				"ControllerEndpoints must not declare operations");
	}

}


text:
/* global define, _ */

define(['form/App', 'form/templates/widgets/instance.html'],
    function (App, itemTmpl) {
        'use strict';
        return Marionette.ItemView.extend({
            initialize: function (opts) {
                this.isNotInstance = opts.isNotInstance;
                _.bindAll(this, "template");
                this.render();
            },
            className: 'card__link',
            ui: {
                link: 'a'
            },
            events: {
                'click': 'showItem'
            },
            template: Handlebars.compile(itemTmpl),
            onRender: function () {
                this.$el.addClass(this.className);

                if (this.isNotInstance) {
                    this.ui.link.addClass('disabled-link');
                }
            },
            showItem: function () {
                if (this.isNotInstance) {
                    return;
                }

                var itemId = this.model.get('instanceId');
                if (itemId) {
                    App.FormMediator.showItemById(itemId);
                }
            }
        });
    });


text:
#if !PCL
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace WampSharp.Core.Cra
{
    /// <summary>
    /// WAMP-CRA Authentication Helper methods.
    /// </summary>
    public static class WampCraHelpers
    {
        private const int DEFAULT_ITERATIONS = 1000;
        private const int DEFAULT_KEY_LEN = 32;

        /// <summary>
        /// Computes a derived cryptographic key from a password according to PBKDF2
        /// http://en.wikipedia.org/wiki/PBKDF2. The function will only return a derived key
        /// if at least 'salt' is present in the 'extra' dictionary. The complete set of
        /// attributes that can be set in 'extra':
        ///    salt: The salt value to be used.
        ///    iterations: Number of iterations of derivation algorithm to run.
        ///    keylen: Key length to derive.
        /// </summary>
        /// <param name="secret">The secret key from which to derive. </param>
        /// <param name="extra"> Extra data for salting the secret. Possible key values 'salt'
        /// (required, otherwise returns @secret), 'iterations' (1000 default),
        /// and/or 'keylen' (32 default). </param>
        /// <returns>A derived key (Base64 encoded) if a salt is provided in the extra parameter, or the
        /// value of parameter 'secret' if not.</returns>
        public static string DeriveKey(string secret, IDictionary<string, string> extra)
        {
            string salt;

            if (extra == null || !extra.TryGetValue("salt", out salt))
            {
                return secret;
            }

            string strTemp;

            int iterations = DEFAULT_ITERATIONS;

            if (extra.TryGetValue("iterations", out strTemp))
            {
                iterations =
                    int.TryParse(strTemp, out iterations)
                        ? iterations
                        : DEFAULT_ITERATIONS;
            }

            int keyLen = DEFAULT_KEY_LEN;

            if (extra.TryGetValue("keylen", out strTemp))
            {
                keyLen = int.TryParse(strTemp, out keyLen) ? keyLen : DEFAULT_KEY_LEN;
            }

            string result = DeriveKey(secret, salt, iterations, keyLen);

            return result;
        }

        /// <summary>
        /// Computes a derived cryptographic key from a password according to PBKDF2
        /// http://en.wikipedia.org/wiki/PBKDF2. The function will only return a derived key
        /// if at least 'salt' is present in the 'extra' dictionary. The complete set of
        /// attributes that can be set in 'extra':
        ///    salt: The salt value to be used.
        ///    iterations: Number of iterations of derivation algorithm to run.
        ///    keylen: Key length to derive.
        /// </summary>
        /// <param name="secret">The secret key from which to derive. </param>
        /// <param name="salt"></param>
        /// <param name="iterations"></param>
        /// <param name="keyLen"></param>
        /// <returns>A derived key (Base64 encoded) if a salt is provided in the extra parameter, or the
        /// value of parameter 'secret' if not.</returns>
        public static string DeriveKey(string secret, string salt, int? iterations = DEFAULT_ITERATIONS, int? keyLen = DEFAULT_KEY_LEN)
        {
            if (salt == null)
            {
                return secret;
            }

            byte[] secretBytes = Encoding.UTF8.GetBytes(secret);
            byte[] saltBytes = Encoding.UTF8.GetBytes(salt);

            int keyLength = keyLen ?? DEFAULT_KEY_LEN;
            int iterationCount = iterations ?? DEFAULT_ITERATIONS;

            byte[] keyBytes = PBKDF2Sha256GetBytes(keyLength, secretBytes, saltBytes, iterationCount);
            string result = Convert.ToBase64String(keyBytes);

            Array.Clear(secretBytes, 0, secretBytes.Length);
            Array.Clear(saltBytes, 0, saltBytes.Length);

            return result;
        }

        /// <summary>
        /// Compute the authentication signature from an authentication challenge and a secret.
        /// </summary>
        /// <param name="authChallenge">The authentication challenge. </param>
        /// <param name="authSecret">The authentication secret. </param>
        /// <param name="authExtra">Extra data for salting the secret. Possible key values 'salt'
        /// (required, otherwise uses @authSecret), 'iterations' (1000
        /// default), and/or 'keylen' (32 default). </param>
        /// <returns>The authentication signature.</returns>
        public static string AuthSignature(string authChallenge, string authSecret, IDictionary<string, string> authExtra)
        {
            if (authSecret == null)
            {
                authSecret = string.Empty;
            }

            authSecret = DeriveKey(authSecret, authExtra);

            using (HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(authSecret)))
            {
                byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(authChallenge));
                return Convert.ToBase64String(hash);
            }
        }

        /// <summary>
        /// Implements PBKDF2 functionality by using a pseudorandom number generator based on
        /// HMACSHA256.
        /// </summary>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Thrown when one or more arguments are outside
        /// the required range.
        ///  </exception>
        /// <param name="dklen">The number of pseudo-random key bytes to generate. </param>
        /// <param name="password">The password used to derive the key. After use, the password
        /// and salt should be cleared (with Array.Clear) </param>
        /// <param name="salt">The key salt used to derive the key. After use, the password
        /// and salt should be cleared (with Array.Clear) </param>
        /// <param name="iterationCount">The number of iterations for the operation. The iteration
        /// count should be as high as possible without causing
        /// unreasonable delay. </param>
        /// <returns>A byte array filled with pseudo-random key bytes.</returns>
        private static byte[] PBKDF2Sha256GetBytes(int dklen, byte[] password, byte[] salt, int iterationCount)
        {
            using (HMACSHA256 hmac = new HMACSHA256(password))
            {
                int hashLength = hmac.HashSize/8;
                if ((hmac.HashSize & 7) != 0)
                {
                    hashLength++;
                }
                int keyLength = dklen/hashLength;
                if ((long) dklen > (0xFFFFFFFFL*hashLength) || dklen < 0)
                {
                    throw new ArgumentOutOfRangeException("dklen");
                }
                if (dklen%hashLength != 0)
                {
                    keyLength++;
                }
                byte[] extendedkey = new byte[salt.Length + 4];
                Buffer.BlockCopy(salt, 0, extendedkey, 0, salt.Length);
                using (MemoryStream ms = new MemoryStream())
                {
                    for (int i = 0; i < keyLength; i++)
                    {
                        extendedkey[salt.Length] = (byte) (((i + 1) >> 24) & 0xFF);
                        extendedkey[salt.Length + 1] = (byte) (((i + 1) >> 16) & 0xFF);
                        extendedkey[salt.Length + 2] = (byte) (((i + 1) >> 8) & 0xFF);
                        extendedkey[salt.Length + 3] = (byte) (((i + 1)) & 0xFF);
                        byte[] u = hmac.ComputeHash(extendedkey);
                        Array.Clear(extendedkey, salt.Length, 4);
                        byte[] f = u;
                        for (int j = 1; j < iterationCount; j++)
                        {
                            u = hmac.ComputeHash(u);
                            for (int k = 0; k < f.Length; k++)
                            {
                                f[k] ^= u[k];
                            }
                        }
                        ms.Write(f, 0, f.Length);
                        Array.Clear(u, 0, u.Length);
                        Array.Clear(f, 0, f.Length);
                    }
                    byte[] dk = new byte[dklen];
                    ms.Position = 0;
                    ms.Read(dk, 0, dklen);
                    ms.Position = 0;
                    for (long i = 0; i < ms.Length; i++)
                    {
                        ms.WriteByte(0);
                    }
                    Array.Clear(extendedkey, 0, extendedkey.Length);
                    return dk;
                }
            }
        }

        /// <summary>
        /// Signs a challenge with a given authentication key.
        /// </summary>
        /// <param name="authenticationKey"></param>
        /// <param name="challenge"></param>
        /// <returns>The signed challenge.</returns>
        public static string Sign(string authenticationKey, string challenge)
        {
            using (HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(authenticationKey)))
            {
                byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(challenge));
                return Convert.ToBase64String(hash);
            }
        }
    }
}
#endif


text:
$(document).ready(function () {
  buzzardClient = require('buzzard');

  // Switch from empty anchors to id-ed headings
  $('a[name]').get().forEach(function (i) {
    var $i = $(i);

    $i.next().attr('id', $i.attr('name'));
    $i.detach();
  });

  $('.scroll-spy-target').on('activate.bs.scrollspy', function (event) {
    var $this = $(this);
    var $target = $(event.target);

    $this.scrollTo($target, 0, {
      offset: -($this.innerHeight() / 2)
    });
  });

  function truncate(json, length) {
    if (length === null) {
      length = 20;
    }

    var split = json.split('\n');

    if (split.length <= length) {
      return json;
    }

    return split.slice(0, length).join('\n') + '\n...';
  }

  $('[data-route]').each(function () {
    var $this = $(this);
    var $target = $($this.attr('data-target'));
    var route = $this.attr('data-route');
    var length = $this.attr('data-truncate') || Infinity;

    var method = $this.attr('data-method');
    var body = $this.attr('data-body');

    var requires_auth = $this.attr('data-requires-auth');
    var provides_auth = $this.attr('data-provides-auth');

    $this.click(function () {
      var header;
      var credentials;
      if (requires_auth){
        credentials = JSON.parse(sessionStorage.getItem('credentials'));
        if (credentials){
          console.log(credentials);
          header = buzzardClient.header(credentials);
        } else {
          return alert('you don\'t have credentials yet');
        }
      }

      var body_ready;

      if (body !== ''){
        var editable_body = $this.attr('data-target') + '-data-body';
        body_ready = JSON.parse($(editable_body).text());
      }

      $target.text('Loading ' + route + ' ...');

      $.ajax(route, {
        type: method,
        data: body_ready,
        success: function (data) {
          if(provides_auth){
            console.log('credentials: ', data);
            sessionStorage.setItem('credentials', JSON.stringify(data));
          }
          var json = truncate(JSON.stringify(data, null, 2), length);
          $target.text(json);
        },
        headers: {
          'Authorization': header
        }
      });
    });
  });
});


text:
<!DOCTYPE html>

  <button class="tablinks" onclick="openTab(event, 'Overview')" id="defaultOpen">Overview</button>

Overview_Content


text:
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>me.markrose.example</groupId>
	<artifactId>triangle-classifier</artifactId>

	<name>Triangle Classifier</name>
	<url>https://github.com/merose/triangle-classifier</url>
	<description>A program to classify triangles.</description>
	<version>1.0</version>

	<properties>
		<maven.compiler.source>1.6</maven.compiler.source>
		<maven.compiler.target>1.6</maven.compiler.target>
		<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.3</version>
				<configuration>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19</version>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<version>2.7</version>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<version>6.1.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.jgoodies</groupId>
			<artifactId>jgoodies-forms</artifactId>
			<version>1.7.2</version>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-swing-testng</artifactId>
			<version>1.2.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.3</version>
			</plugin>
		</plugins>
	</reporting>
</project>


text:
<?php

namespace Fuel\Core;

/**
 * Html class tests
 *
 * @group Core
 * @group Uri
 */
class Test_Uri extends TestCase
{

	/**
	 * Tests Uri::create()
	 *
	 * @test
	 */
	public function test_create()
	{
		Config::set('url_suffix', '');

		$prefix = Uri::create('');

		$output = Uri::create('controller/method');
		$expected = $prefix."controller/method";
		$this->assertEquals($expected, $output);

		$output = Uri::create('controller/:some', array('some' => 'thing', 'and' => 'more'), array('what' => ':and'));
		$expected = $prefix."controller/thing?what=more";
		$this->assertEquals($expected, $output);

		Config::set('url_suffix', '.html');

		$output = Uri::create('controller/method');
		$expected = $prefix."controller/method.html";
		$this->assertEquals($expected, $output);

		$output = Uri::create('controller/:some', array('some' => 'thing', 'and' => 'more'), array('what' => ':and'));
		$expected = $prefix."controller/thing.html?what=more";
		$this->assertEquals($expected, $output);

		$output = Uri::create('http://example.com/controller/:some', array('some' => 'thing', 'and' => 'more'), array('what' => ':and'));
		$expected = "http://example.com/controller/thing.html?what=more";
		$this->assertEquals($expected, $output);

		$output = Uri::create('http://example.com/controller/:some', array('some' => 'thing', 'and' => 'more'), array('what' => ':and'), true);
		$expected = "https://example.com/controller/thing.html?what=more";
		$this->assertEquals($expected, $output);

		$output = Uri::create('https://example.com/controller/:some', array('some' => 'thing', 'and' => 'more'), array('what' => ':and'), false);
		$expected = "http://example.com/controller/thing.html?what=more";
		$this->assertEquals($expected, $output);
	}

}


text: Switch off WiFi on LAN connection


text:
app.controller('BoardListController', function($scope, Ajax) {
	$scope.boards = [];

	Ajax.getBoards().success(function(result) {
		$scope.boards = result;
		console.log(result);
	});
});


text:
Package.describe({
  summary: "Library for Secure Remote Password (SRP) exchanges",
  version: "1.0.4-plugins.0"
});

Package.onUse(function (api) {
  api.use(['random', 'check', 'sha'], ['client', 'server']);
  api.use('underscore');
  api.export('SRP');
  api.addFiles(['biginteger.js', 'srp.js'],
                ['client', 'server']);
});

Package.onTest(function (api) {
  api.use('tinytest');
  api.use('srp', ['client', 'server']);
  api.use('underscore');
  api.addFiles(['srp_tests.js'], ['client', 'server']);
});


text:
module Roxx
  module Presets
    Library = {}

    def self.def_preset name, &block
      Library[name] = block
    end

    def_preset :hypnotic_voice do |params|
      effect_reverb1
    end
  end
end


text:
//
//  UILabel+IXAdditions.m
//  Ignite Engine
//
//  Created by Robert Walsh on 12/19/13.
//

//

#import "UILabel+IXAdditions.h"

static NSString* const kIXTextAlignmentCenter = @"center";
static NSString* const kIXTextAlignmentLeft = @"left";
static NSString* const kIXTextAlignmentRight = @"right";
static NSString* const kIXTextAlignmentJustified = @"justified";
static NSString* const kIXTextAlignmentNatural = @"natural";

@implementation UILabel (IXAdditions)

-(CGSize)sizeForFixedWidth:(float)fixedWidth
{
    CGSize returnSize = CGSizeZero;

    float lineHeight = ([[self font] ascender] - [[self font] descender] ) + 1;

    CGRect textRect = [[self text] boundingRectWithSize:CGSizeMake(fixedWidth,CGFLOAT_MAX)
                                                options:NSStringDrawingUsesLineFragmentOrigin
                                             attributes:@{NSFontAttributeName:[self font]}
                                                context:nil];

    returnSize = textRect.size;

    if( [self numberOfLines] != 0 && lineHeight * [self numberOfLines] < returnSize.height )
        returnSize.height = lineHeight * [self numberOfLines];

    return returnSize;
}

+(NSTextAlignment)ix_textAlignmentFromString:(NSString*)textAlignmentString
{
    NSTextAlignment textAlignment = NSTextAlignmentLeft;
    if( [textAlignmentString isEqualToString:kIXTextAlignmentCenter] ) {
        textAlignment = NSTextAlignmentCenter;
    } else if( [textAlignmentString isEqualToString:kIXTextAlignmentRight] ) {
        textAlignment = NSTextAlignmentRight;
    } else if( [textAlignmentString isEqualToString:kIXTextAlignmentJustified] ) {
        textAlignment = NSTextAlignmentJustified;
    } else if( [textAlignmentString isEqualToString:kIXTextAlignmentNatural] ) {
        textAlignment = NSTextAlignmentNatural;
    }
    return textAlignment;
}

@end


text: export { default } from 'ember-cli-time-input/components/time-input';


text:
require 'rails_helper'

describe Account, :type => :model do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
package net.ontopia.topicmaps.rest;

import javax.servlet.ServletException;
import org.restlet.Application;
import org.restlet.Component;
import org.restlet.Context;
import org.restlet.engine.Engine;
import org.restlet.engine.log.LoggerFacade;
import org.restlet.ext.servlet.ServerServlet;
import org.restlet.ext.slf4j.Slf4jLoggerFacade;
import org.restlet.service.LogService;

public class OntopiaServlet extends ServerServlet {
	private static final long serialVersionUID = 201701091214L;

	public static final String LOGGER_FACADE_ATTRIBUTE = LoggerFacade.class.getName();
	public static final String LOGGER_FACADE_ATTRIBUTE_DEFAULT_VALUE = Slf4jLoggerFacade.class.getName();

	public static final String LOGGER_NAME_ATTRIBUTE = LogService.class.getName() + ".logger";
	public static final String LOGGER_NAME_ATTRIBUTE_DEFAULT_VALUE = OntopiaServlet.class.getPackage().getName() + ".logger";

	public static final String LOGGER_FORMAT_ATTRIBUTE = LogService.class.getName() + ".format";
	public static final String LOGGER_FORMAT_ATTRIBUTE_DEFAULT_VALUE = "{p} {m} {rp} {rq} {emt} {S}";

	@Override
	public void init() throws ServletException {
		String facade = getInitParameter(LOGGER_FACADE_ATTRIBUTE, LOGGER_FACADE_ATTRIBUTE_DEFAULT_VALUE);

		if (!Boolean.FALSE.toString().equalsIgnoreCase(facade)) {
			try {
				Class<?> facadeClass = Class.forName(facade);
				Engine.getInstance().setLoggerFacade((LoggerFacade) facadeClass.newInstance());
			} catch (ClassNotFoundException ex) {
				log("[Restlet] OntopiaServlet could not find logger facade class '" + facade + "'");
			} catch (InstantiationException ex) {
				log("[Restlet] OntopiaServlet could not instantiate logger facade of class '" + facade + "'");
			} catch (IllegalAccessException ex) {
				log("[Restlet] OntopiaServlet could not access logger facade class '" + facade + "'");
			}
		}

		super.init();
	}

	@Override
	protected Application createApplication(Context parentContext) {
		Application application = super.createApplication(parentContext);

		if (application == null) {
			application = new OntopiaRestApplication(parentContext.createChildContext());
		}

		return application;
	}

	@Override
	protected Component createComponent() {
		Component component = super.createComponent();

		// a bit more configuration by initParams
		LogService log = component.getLogService();

		// allow access to the LogService in the application via the context
		component.getContext().getAttributes().put(LogService.class.getName(), log);

		// modify the logger name
		String loggerName = getInitParameter(LOGGER_NAME_ATTRIBUTE, LOGGER_NAME_ATTRIBUTE_DEFAULT_VALUE);
		log.setLoggerName(loggerName);

		// modify the logger pattern
		// note: overridden to be smaller than the restlet default value
		log.setResponseLogFormat(getInitParameter(LOGGER_FORMAT_ATTRIBUTE, LOGGER_FORMAT_ATTRIBUTE_DEFAULT_VALUE));

		return component;
	}
}


text:
layout: default
---

    {% for post in site.posts %}

                    {% if post.main-class == 'ジャーナリスト' %}
                      {{post.main-class}}
                    {% endif %}
                    {% if post.main-class == 'パーソナリティー' %}
                      {{post.main-class}}
                    {% endif %}
                    {% if post.main-class == 'レーサー' %}
                      {{post.main-class}}
                    {% endif %}
                    {% if post.main-class == 'レポーター' %}
                      {{post.main-class}}
                    {% endif %}
                    {% if post.main-class == 'モデル' %}
                      {{post.main-class}}
                    {% endif %}

                            {{ post.title }}

{{ post.introduction }}

                        {% for tag in post.tags %}
                            {{ tag }}
                        {% endfor %}

    {% endfor %}


text:
package main

import (
	"context"
	"flag"
	"log"
	"net/http"

	"github.com/elazarl/goproxy2"
)

func main() {
	verbose := flag.Bool("v", false, "should every proxy request be logged to stdout")
	addr := flag.String("addr", ":8080", "proxy listen address")
	flag.Parse()
	proxy := goproxy.New()
	proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)
	proxy.OnRequest().DoFunc(func(req *http.Request, ctx context.Context) (*http.Request, *http.Response) {
		if req.URL.Scheme == "https" {
			req.URL.Scheme = "http"
		}
		return req, nil
	})
	proxy.Verbose = *verbose
	log.Fatal(http.ListenAndServe(*addr, proxy))
}


text:
//
//  GPSSensor.m
//  Multi_MCSim
//
//  Created by Andreas Wassmer on 29.09.15.
//  Copyright © 2015 Phandroo. All rights reserved.
//

#import "GPSSensor.h"

@implementation GPSSensor

- (id)init {
    self = [super init];

    if (self) {
        self.latitude = 0.0f;
        self.longitude = 0.0f;
        self.elevation = 0;
        self.speed = 0;
        self.heading = 0;
        self.hdop = 0;
        self.snr = 0;
        self.numSatellites = 0;

    }
    return self;
}

- (id)initWithLongitude:(float)longitude andLatitude:(float)latitude {
    self = [super init];

    if (self) {
        self.latitude = latitude;
        self.longitude = longitude;
        self.elevation = 0;
        self.speed = 0;
        self.heading = 0;
        self.hdop = 0;
        self.snr = 0;
        self.numSatellites = 0;
    }
    return self;
}

/*
 * Implementation of SensorProtocol
 */
- (void)generateNewData {

    /*
    _longitude -= 0.01;
    _latitude += 0.01;
     */

    _latitude = ((float)arc4random()/(float)RAND_MAX/2.0) * 180.0 - 90.0;
    _longitude = ((float)arc4random()/(float)RAND_MAX/2.0) * 360.0 - 180.0;
    _elevation = (int16_t)arc4random()/(RAND_MAX/2.0) * 8848;
    _speed = (uint8_t)arc4random()/(RAND_MAX/2.0) * 100;
    _heading = (uint8_t)arc4random()/(RAND_MAX/2.0) * 360;
    _hdop = 0;
    _snr = (uint8_t)arc4random()/(RAND_MAX/2.0) * 100;
    _numSatellites = (uint8_t)arc4random()/(RAND_MAX/2.0) * 10 + 1;

    NSLog(@"Location Sensor -- %@", [self describeStatus]);
}

- (NSData *)readDataStream {
    short temp = 0;
    NSMutableData *stream = [[NSMutableData alloc] init];

    // -U is a union defined in SensorProtocol
    _u.fvalue = self.longitude;
    swap_bytes_4(_u.bstream);
    [stream appendBytes:_u.bstream length:4];

    _u.fvalue = self.latitude;
    swap_bytes_4(_u.bstream);
    [stream appendBytes:_u.bstream length:4];

    temp = _elevation;
    swap_bytes_2((unsigned char *)&temp);
    [stream appendBytes:&temp length:2];

    [stream appendBytes:&_speed length:1];

    temp = _heading;
    swap_bytes_2((unsigned char *)&temp);
    [stream appendBytes:&temp length:2];

    [stream appendBytes:&_hdop length:1];
    [stream appendBytes:&_snr length:1];
    [stream appendBytes:&_numSatellites length:1];

    return stream;
}

- (NSString *)describeStatus {
    NSMutableString *status = [[NSMutableString alloc] init];

    [status appendString:[NSString stringWithFormat:@"GPS-Sensor Latitude  : %f\n", self.latitude]];
    [status appendString:[NSString stringWithFormat:@"GPS-Sensor Longitude : %f\n", self.longitude]];
    [status appendString:[NSString stringWithFormat:@"GPS-Sensor Elevation : %d\n", self.elevation]];
    [status appendString:[NSString stringWithFormat:@"GPS-Sensor Speed     : %d\n", self.speed]];
    [status appendString:[NSString stringWithFormat:@"GPS-Sensor Heading   : %d\n", self.heading]];
    [status appendString:[NSString stringWithFormat:@"GPS-Sensor HDOP      : %d\n", self.hdop]];
    [status appendString:[NSString stringWithFormat:@"GPS-Sensor Satellites: %d\n", self.numSatellites]];
    return (NSString *)status;
}

- (NSString *)description {
    return @"GPS Sensor";
}

@end


text:
using System.Web.Mvc;
using Cresce.Datasources.Repositories;
using Cresce.Models;
using Cresce.Services;

namespace Cresce.WebApp.Areas.Administration.Controllers
{
    public class ServicesController : Controller
    {
        private readonly IServiceRepository _serviceRepository;

        public ServicesController(IServiceRepository serviceRepository)
        {
            _serviceRepository = serviceRepository;
        }

        public ServicesController()
            : this(Configuration.Get<IServiceRepository>()) { }

        // GET: Patients
        public ActionResult Index()
        {
            var services = _serviceRepository.GetServices();

            return View(services);
        }

        // GET: Patients/Edit
        public ActionResult Edit(string id)
        {
            var services = _serviceRepository.GetById(id);

            return View(services);
        }

        // POST: Patients/Create
        [HttpPost]
        public ActionResult Create(Service service)
        {
            _serviceRepository.Save(service);

            return RedirectToAction("Index", "Administration/Services");
        }

        // POST: Patients/Delete/5
        public ActionResult Delete(int id)
        {

            return RedirectToAction("Index", "Administration/Services");
        }

        public ActionResult Save(Service service)
        {
            _serviceRepository.Save(service);

            return RedirectToAction("Index", "Administration/Services");
        }
    }
}


text:
This is sample project for Cross Cover.
clone the project
Just do npm install
bower install
do grunt server

Thats it you are done.


text:
/*
 * generated by Xtext
 */
package com.acme.foo.dsl.ui.contentassist.antlr;

import java.util.Collection;
import java.util.Collections;

import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser;
import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement;
import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
import org.eclipse.xtext.util.PolymorphicDispatcher;

/**
 * @author Sebastian Zarnekow - Initial contribution and API
 */
@SuppressWarnings("restriction")
public class PartialMainContentAssistParser extends MainParser implements IPartialContentAssistParser {

	private AbstractRule rule;

	public void initializeFor(AbstractRule rule) {
		this.rule = rule;
	}

	@Override
	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
		if (rule == null || rule.eIsProxy())
			return Collections.emptyList();
		String methodName = "entryRule" + rule.getName();
		PolymorphicDispatcher<Collection<FollowElement>> dispatcher =
			new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser));
		dispatcher.invoke();
		return parser.getFollowElements();
	}

}


text:
  La Chaux est
       un village
       géographiquement positionné dans le département des Doubs en Franche-Comté. On dénombrait 414 habitants en 2008.

À proximité de La Chaux sont localisées les communes de
Le Bélieu à 1 km, 286 habitants,
Consolation-Maisonnettes localisée à 5 km, 30 habitants,
Narbief à 4 km, 67 habitants,
Les Fins à 2 km, 2 807 habitants,
Fournets-Luisans localisée à 5 km, 577 habitants,
La Chenalotte à 3 km, 356 habitants,
 entre autres. De plus, La Chaux est située à seulement six km de Morteau.

La ville propose de multiples  équipements sportifs, elle propose entre autres un terrain de tennis, un domaine skiable, un terrain de sport et une boucle de randonnée.

Le nombre de logements, à La Chaux, se décomposait en 2011 en 61 appartements et 159 maisons soit
 un marché relativement équilibré.

Si vous pensez venir habiter à La Chaux, vous pourrez facilement trouver une maison à acheter.


text:
package org.pentaho.di.trans.steps.constant;

import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.mockito.Mockito;
import org.pentaho.di.core.RowMetaAndData;
import org.pentaho.di.core.exception.KettlePluginException;
import org.pentaho.di.core.logging.LoggingObjectInterface;
import org.pentaho.di.core.row.RowMeta;
import org.pentaho.di.core.row.value.ValueMetaPluginType;
import org.pentaho.di.junit.rules.RestorePDIEngineEnvironment;
import org.pentaho.di.trans.steps.mock.StepMockHelper;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class ConstantTest {

  private StepMockHelper<ConstantMeta, ConstantData> mockHelper;
  private ConstantMeta constantMeta = mock( ConstantMeta.class );
  private ConstantData constantData = mock( ConstantData.class );
  private RowMetaAndData rowMetaAndData = mock( RowMetaAndData.class );
  private Constant constantSpy;

  @ClassRule
  public static RestorePDIEngineEnvironment env = new RestorePDIEngineEnvironment();

  @BeforeClass
  public static void setUpBeforeClass() throws KettlePluginException {
    ValueMetaPluginType.getInstance().searchPlugins();
  }

  @Before
  public void setUp() throws Exception {

    mockHelper = new StepMockHelper<>( "Add Constants", ConstantMeta.class, ConstantData.class );
    when( mockHelper.logChannelInterfaceFactory.create( any(), any( LoggingObjectInterface.class ) ) ).thenReturn(
            mockHelper.logChannelInterface );
    when( mockHelper.trans.isRunning() ).thenReturn( true );

    doReturn( rowMetaAndData ).when( mockHelper.stepDataInterface ).getConstants();
    constantSpy = Mockito.spy( new Constant( mockHelper.stepMeta, mockHelper.stepDataInterface, 0,
            mockHelper.transMeta, mockHelper.trans ) );
  }

  @After
  public void tearDown() throws Exception {
    mockHelper.cleanUp();
  }

  @Test
  public void testProcessRow_success() throws Exception {

    doReturn( new Object[1] ).when( constantSpy ).getRow();
    doReturn( new RowMeta() ).when( constantSpy ).getInputRowMeta();
    doReturn( new Object[1] ).when( rowMetaAndData ).getData();

    boolean success = constantSpy.processRow( constantMeta, constantData );
    assertTrue( success );
  }

  @Test
  public void testProcessRow_fail() throws Exception {

    doReturn( null ).when( constantSpy ).getRow();
    doReturn( null ).when( constantSpy ).getInputRowMeta();

    boolean success = constantSpy.processRow( constantMeta, constantData );
    assertFalse( success );
  }
}


text:
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
import pymysql
import ssl

context = ssl._create_unverified_context()

conn = pymysql.connect(host='127.0.0.1', unix_socket='/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock', user='root', passwd=None, db='wikipedia', port=3306, charset='utf8')

cur = conn.cursor()

def insertPageIfNotExistsANDgetId(url):
    cur.execute("SELECT * FROM pages WHERE url = %s", (url))
    if cur.rowcount == 0:
        cur.execute("INSERT INTO pages (url) VALUES (%s)", (url))
        conn.commit()
        return cur.lastrowid
    else:
        return cur.fetchone()[0]

def insertLink(fromPageId, toPageId):
    cur.execute("SELECT * FROM links WHERE fromPageId = %s AND toPageId = %s", (int(fromPageId), int(toPageId)))
    if cur.rowcount == 0:
        cur.execute("INSERT INTO links (fromPageId, toPageId) VALUES (%s, %s)", (int(fromPageId), int(toPageId)))
        conn.commit()

pages = set()

def getLinks(pageUrl, recursionLevel):
    if recursionLevel > 3:
        return
    pageId = insertPageIfNotExistsANDgetId(pageUrl)
    html = urlopen("http://en.wikipedia.org"+pageUrl, context=context)
    bsObj = BeautifulSoup(html, "lxml")
    links = bsObj.findAll("a", href=re.compile("^(/wiki/)((?!:).)*$"))
    for link in links:
        insertLink(pageId, insertPageIfNotExistsANDgetId(link.attrs['href']))
        if link.attrs['href'] not in pages:
            newPage = link.attrs['href']
            pages.add(newPage)
            getLinks(newPage, recursionLevel+1)

try:
    getLinks("/wiki/Kevin_Bacon", 0)

finally:
    cur.close()
    conn.close()


text:
All data processing and remote requests should be managed by Vuex data stores. The core modules generally contain `store` folder inside.
You can modify the existing store actions by responding to events. Events are specified in the docs below and can be found in the [core module](https://github.com/DivanteLtd/vue-storefront/tree/master/core), where `EventBus.$emit` has been mostly used for Vuex Actions.

**You should put all the REST calls, Elasticsearch data queries inside the Vuex Actions.** This is our default design pattern for managing the data.

## Vuex conventions

Before you start working with Vuex, it's recommended to get familiar with our [vuex conventions](./vuex-conventions.md)

## Vuex modules

- [Product](product-store.md)
- [Category](category-store.md)
- [Cart](Cart%20Store.md)
- [Checkout](Checkout%20Store.md)
- [Order](Order%20Store.md)
- [Stock](stock-store.md)
- [Sync](sync-store.md)
- [User](User%20Store.md)
- [Attribute](attribute-store.md)
- [UI Store](<https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20UI%20Store%20(interface%20state).md>)

## Override existing core modules

Existing core modules can be overridden in the themes store. Just import any core store modules and override them using the `extendStore()` utility method like the example given below in `src/modules/ui-store/index.ts`.

```
import coreStore from '@vue-storefront/core/store/modules/ui-store'
import { extendStore } from '@vue-storefront/core/lib/themes'

const state = {
  // override state of core ui module...
}

const mutations = {
  // override mutations of core ui module...
}

const actions = {
  // override actions of core ui module...
}

export default extendStore(coreStore, {
  state,
  mutations,
  actions
})
```

And then import it in `src/modules/index.ts`

```
import ui from './ui-store'

export default {
  ui
}
```

## Related

[Working with data](data.md)