text:
package talecraft.voxelator.shapes;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import talecraft.util.BlockRegion;
import talecraft.util.MutableBlockPos;
import talecraft.voxelator.BrushParameter;
import talecraft.voxelator.CachedWorldDiff;
import talecraft.voxelator.VXShape;
import talecraft.voxelator.Voxelator.ShapeFactory;
import talecraft.voxelator.params.BooleanBrushParameter;
import talecraft.voxelator.params.FloatBrushParameter;
import talecraft.voxelator.params.IntegerBrushParameter;

public class VXShapeCylinder extends VXShape {
	private static final BrushParameter[] PARAMS = new BrushParameter[]{
		new FloatBrushParameter("radius", 1, 64, 5),
		new IntegerBrushParameter("height", 0, 64, 5),
		new BooleanBrushParameter("hollow", false)
	};

	public static ShapeFactory FACTORY = new ShapeFactory() {
		@Override
		public String getName() {
			return "cylinder";
		}
		@Override
		public VXShape newShape(NBTTagCompound shapeData, BlockPos origin) {
			int px = shapeData.getInteger("position.x") + origin.getX();
			int py = shapeData.getInteger("position.y") + origin.getY();
			int pz = shapeData.getInteger("position.z") + origin.getZ();

			float r = shapeData.getFloat("radius");
			int h = shapeData.getInteger("height");
			boolean hollow = shapeData.getBoolean("hollow");

			return new VXShapeCylinder(new BlockPos(px, py, pz), r, h, hollow);
		}

		@Override
		public NBTTagCompound newShape(String[] parameters) {
			if(parameters.length == 1) {
				NBTTagCompound shapeData = new NBTTagCompound();
				shapeData.setString("type", getName());
				shapeData.setFloat("radius", Float.parseFloat(parameters[0]));
				shapeData.setInteger("height", Integer.parseInt(parameters[1]));
				shapeData.setBoolean("hollow", Boolean.parseBoolean(parameters[2]));
				return shapeData;
			}

			return null;
		}
		@Override
		public BrushParameter[] getParameters() {
			return PARAMS;
		}
	};

	private final BlockPos position;
	private final float radius;
	private final float radiusSquared;
	private final int height;
	private final boolean hollow;

	public VXShapeCylinder(BlockPos position, float radius, int height, boolean hollow) {
		this.position = position;
		this.radius = radius;
		this.radiusSquared = radius*radius;
		this.height = height;
		this.hollow = hollow;
	}

	@Override
	public BlockPos getCenter() {
		return position;
	}

	@Override
	public BlockRegion getRegion() {
		int sx = position.getX();
		int sy = position.getY();
		int sz = position.getZ();
		int r = (int) (radius + 0.5d);
		return new BlockRegion(
		sx - r +1, sy, sz - r +1,
		sx + r -1, sy + height -1, sz + r -1
		);
	}

	@Override
	public boolean test(BlockPos pos, BlockPos center, MutableBlockPos offset, CachedWorldDiff fworld) {
		int x = pos.getX();
		int y = pos.getY();
		int z = pos.getZ();
		int sx = position.getX();
		int sy = position.getY();
		int sz = position.getZ();
		int dx = x - sx;
		int dy = y - sy;
		int dz = z - sz;
		dy = dy < 0 ? -dy : dy;
		// TODO: 'new VXShapeCylinder' is a waste of memory and should be removed somehow.
		return dy < height && dx*dx + dz*dz <= radiusSquared && (hollow ? !(new VXShapeCylinder(position, radius-1, height-1, false).test(pos, center, offset, fworld)) : true);
	}

}


text:
module Rouge
  # A Formatter takes a token stream and formats it for human viewing.
  class Formatter
    # @private
    REGISTRY = {}

    # Specify or get the unique tag for this formatter.  This is used
    # for specifying a formatter in `rougify`.
    def self.tag(tag=nil)
      return @tag unless tag
      REGISTRY[tag] = self

      @tag = tag
    end

    # Find a formatter class given a unique tag.
    def self.find(tag)
      REGISTRY[tag]
    end

    # Format a token stream.  Delegates to {#format}.
    def self.format(tokens, *a, &b)
      new(*a).format(tokens, &b)
    end

    def initialize(opts={})
      # pass
    end

    # Format a token stream.
    def format(tokens, &b)
      return stream(tokens, &b) if block_given?

      out = ''
      stream(tokens) { |piece| out << piece }

      out
    end

    # @deprecated Use {#format} instead.
    def render(tokens)
      warn 'Formatter#render is deprecated, use #format instead.'
      format(tokens)
    end

    # @abstract
    # yield strings that, when concatenated, form the formatted output
    def stream(tokens, &b)
      raise 'abstract'
    end

  protected
    def token_lines(tokens, &b)
      return enum_for(:token_lines, tokens) unless block_given?

      out = []
      tokens.each do |tok, val|
        val.scan /\n|[^\n]+/ do |s|
          if s == "\n"
            yield out
            out = []
          else
            out << [tok, s]
          end
        end
      end

      # for inputs not ending in a newline
      yield out if out.any?
    end

  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.heliosapm.shorthand.instrumentor.shorthand;

import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javassist.ByteArrayClassPath;
import javassist.ClassPath;
import javassist.ClassPool;
import javassist.LoaderClassPath;

/**
 *
Title: AbstractResidentTransformer

 *
Description: Base abstract resident transformer, used by {@link ResidentTransformerBuilder} to
 * create new transformer types that extend this type.

 *
Company: Helios Development Group LLC

 * @author Whitehead (nwhitehead AT heliosdev DOT org)
 *
com.heliosapm.shorthand.instrumentor.shorthand.AbstractResidentTransformer

 *
Filters in order of efficiency:

 *
Exact classname

 *
Classloader match

 *
isAnnotation

 *
Implements / Extends

 *
Already Instrumented ?

 *
Method Name Match

 *
Method Name Sig Match

 *

 *

 *

 */

public abstract class AbstractResidentTransformer implements ClassFileTransformer {
	/** The classpool used to inspect candidate classes without classloading them (which we can't) */
	protected final ClassPool cp = new ClassPool();

	/** A list of javassist classpaths added to the classpool, which should be removed on completion */
	protected final List<ClassPath> installedClassPaths = new ArrayList<ClassPath>();
	/** The binary name of the class being examined */
	protected String bClassName = null;

	/**
	 * {@inheritDoc}
	 * @see java.lang.instrument.ClassFileTransformer#transform(java.lang.ClassLoader, java.lang.String, java.lang.Class, java.security.ProtectionDomain, byte[])
	 */
	@Override
	public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
			ProtectionDomain protectionDomain, byte[] classfileBuffer)
			throws IllegalClassFormatException {
		bClassName = className.replace('/', '.');
		try {
			return doTransform(loader, classBeingRedefined, protectionDomain, classfileBuffer);
		} finally {
			cleanAll();
		}
	}

	/**
	 * Determines if the passed class meta represents a class that should be transofmed and if so, transforms it and returns the new byte code.
	 * @param loader The classloader
	 * @param classBeingRedefined The class being redefined
	 * @param protectionDomain The protection domain
	 * @param classfileBuffer the byte code of the class
	 * @return the transformed class if the class meta is filtered in, null otherwise
	 */
	protected abstract byte[] doTransform(ClassLoader loader, Class<?> classBeingRedefined,
			ProtectionDomain protectionDomain, byte[] classfileBuffer);

	/**
	 * Determines if there is an absolute class name match
	 * @param targetClassName the classname to match against
	 * @return true for a match, false otherwise
	 */
	protected boolean ifClassNameMatch(String targetClassName) {
		return bClassName.equals(targetClassName);
	}

	//protected boolean
	/**
	 * Installs the candidate class into the javassist classpool so it can be analyzed
	 * @param loader The classloader the candidate class is being loaded in
	 * @param classfileBuffer The class byte code
	 */
	protected void initJSClass(ClassLoader loader, byte[] classfileBuffer) {
		ClassPath[] cps = new ClassPath[2];
		cps[0] = new LoaderClassPath(loader);
		cps[1] = new ByteArrayClassPath(bClassName, classfileBuffer);
		cp.appendClassPath(cps[0]);
		cp.appendClassPath(cps[1]);
		installedClassPaths.addAll(Arrays.asList(cps));
	}

	/**
	 * Cleans up all items in this instance on completion
	 */
	protected void cleanAll() {
		cleanClassPool();
		bClassName = null;
	}

	/**
	 * Clears all added items from the classpool
	 */
	protected void cleanClassPool() {
		if(!installedClassPaths.isEmpty()) {
			for(ClassPath classpath: installedClassPaths) {
				cp.removeClassPath(classpath);
			}
			installedClassPaths.clear();
		}
	}

}


text:
'use strict';

var editor = null;

document.addEventListener('DOMContentLoaded', function(event) {

    // Loading old snippet
    getLocalSnippets().forEach(function (elmnt) {
        store(elmnt.content, elmnt.langage, elmnt.id, true);
    });

    // Configuring ace
    var path = 'js/lib/ace/src-min-noconflict';
    ace.config.set('basePath', path);

    editor = ace.edit('editor');
    editor.getSession().setMode('ace/mode/text');
    editor.setShowPrintMargin(false);
    editor.setHighlightActiveLine(true);

    editor.commands.addCommand({
    name: 'save',
    bindKey: {win: 'Ctrl-s',  mac: 'Command-s'},
        exec: stroreEvent,
        readOnly: true
    });

    // On clear le contenu du à l'indentation du HTML
    editor.setValue('');
    editor.focus();
    editor.getSession().setMode('ace/mode/text');

    // Binding event
    var langageSelector = document.getElementById('langage-selector');

    langageSelector.addEventListener('change', function (evnt) {
        editor.getSession().setMode('ace/mode/' + evnt.target.value);
    });

    var themeSelector = document.getElementById('theme-selector');

    themeSelector.addEventListener('change', function (evnt) {
        editor.setTheme(evnt.target.value);
    });

    var event = new Event('change');
    // Dispatch it.
    themeSelector.dispatchEvent(event);

    document.getElementById('save-btn').addEventListener('click', stroreEvent);

    document.getElementById('newButton').addEventListener('click', newEvent);

    // Clear du hash
    location.hash = '#new';

});

function stroreEvent() {
    var content = editor.getValue();
    var langage = document.getElementById('langage-selector').value;

    var id = location.hash;

    if (location.hash == '#new') {
        location.hash = uuid();
    }

    if (content !== '') {
        store(content, langage, location.hash, false);
    }
}

function store(content, langage, id, isLocalSaved) {

    var newSnippet = Template.render('snippet-template',
                                        {
                                            'content': content,
                                            'langage': langage,
                                            'id': id
                                        });

    newSnippet.addEventListener('click', restoreEvent, false);

    newSnippet.querySelector('.snippet-closer').addEventListener('click', remove, true);

    var saveBtn = newSnippet.querySelector('.snippet-saver');
    saveBtn.addEventListener('click', localSave, true);
    if (isLocalSaved) {
        saveBtn.classList.add('saved');
    }

    var old = document.querySelector('*[data-snippet-id="' + id + '"]');

    if (old !== null) {
        old.parentNode.insertBefore(newSnippet, old);
        old.remove();
    } else {
        document.getElementById('snippet-list').appendChild(newSnippet);
    }

}

function remove(evnt) {
    var id = this.parentNode.getAttribute('data-snippet-id');
    var data = getLocalSnippets();

    data = localRemove(data, id);

    localStorage.setItem('saved-snippets', JSON.stringify(data));

    this.parentNode.remove();
    evnt.stopPropagation();
}

function restoreEvent(evnt) {
    var content = this.firstChild.textContent;
    var langage = this.getAttribute('data-langage');
    var id = this.getAttribute('data-snippet-id');

    editor.setValue(content);
    editor.gotoLine(1); // To avoid text selection

    document.getElementById('langage-selector').value = langage;
    editor.getSession().setMode('ace/mode/' + langage);

    location.hash = id;
}

function newEvent() {
    editor.setValue('');
    editor.focus();
    location.hash = 'new';
}

function localSave(evnt) {
    var content = this.parentNode.firstChild.textContent;
    var langage = this.parentNode.getAttribute('data-langage');
    var id = this.parentNode.getAttribute('data-snippet-id');

    var data = getLocalSnippets();

    data = localRemove(data, id);

    data.push({
                'content': content,
                'langage': langage,
                'id': id
            });

    localStorage.setItem('saved-snippets', JSON.stringify(data));

    this.classList.add('saved');

    evnt.stopPropagation();
}

function localRemove(data, id) {

    var targetIndex = -1;

    data.forEach(function (elmnt, index) {
        if (elmnt.id == id) {
            targetIndex = index;
        }
    });

    if (targetIndex != -1) {
        data.splice(targetIndex)
    }

    return data;
}

function getLocalSnippets() {
    var data = localStorage.getItem('saved-snippets');

    if (data === null) {
        data = [];
    } else {
        data = JSON.parse(data);
    }

    return data;
}


text:
package com.googlecode.hibernate.memcached;

/**
 * DOCUMENT ME!
 *
 * @author Ray Krueger
 */
public class Config {

    public static final String PROP_PREFIX = "hibernate.memcached.";

    private static final String CACHE_TIME_SECONDS = "cacheTimeSeconds";
    public static final String PROP_CACHE_TIME_SECONDS = PROP_PREFIX + CACHE_TIME_SECONDS;

    private static final String CLEAR_SUPPORTED = "clearSupported";
    public static final String PROP_CLEAR_SUPPORTED = PROP_PREFIX + CLEAR_SUPPORTED;

    private static final String MEMCACHE_CLIENT_FACTORY = "memcacheClientFactory";
    public static final String PROP_MEMCACHE_CLIENT_FACTORY = PROP_PREFIX + MEMCACHE_CLIENT_FACTORY;

    private static final String DOGPILE_PREVENTION = "dogpilePrevention";
    public static final String PROP_DOGPILE_PREVENTION = PROP_PREFIX + DOGPILE_PREVENTION;

    private static final String DOGPILE_PREVENTION_EXPIRATION_FACTOR = "dogpilePrevention.expirationFactor";
    public static final String PROP_DOGPILE_PREVENTION_EXPIRATION_FACTOR = PROP_PREFIX + DOGPILE_PREVENTION_EXPIRATION_FACTOR;

    private static final String KEY_STRATEGY = "keyStrategy";

    public static final int DEFAULT_CACHE_TIME_SECONDS = 300;
    public static final boolean DEFAULT_CLEAR_SUPPORTED = false;
    public static final boolean DEFAULT_DOGPILE_PREVENTION = false;
    public static final String DEFAULT_MEMCACHE_CLIENT_FACTORY = "com.googlecode.hibernate.memcached.spymemcached.SpyMemcacheClientFactory";

    private PropertiesHelper props;
    private static final int DEFAULT_DOGPILE_EXPIRATION_FACTOR = 2;

    public Config(PropertiesHelper props) {
        this.props = props;
    }

    public int getCacheTimeSeconds(String cacheRegion) {
        int globalCacheTimeSeconds = props.getInt(PROP_CACHE_TIME_SECONDS,
                DEFAULT_CACHE_TIME_SECONDS);
        return props.getInt(cacheRegionPrefix(cacheRegion) + CACHE_TIME_SECONDS,
                globalCacheTimeSeconds);
    }

    public String getKeyStrategyName(String cacheRegion) {
        String globalKeyStrategy = props.get(PROP_PREFIX + KEY_STRATEGY,
                HashCodeKeyStrategy.class.getName());
        return props.get(cacheRegionPrefix(cacheRegion) + KEY_STRATEGY, globalKeyStrategy);
    }

    public boolean isClearSupported(String cacheRegion) {
        boolean globalClearSupported = props.getBoolean(PROP_CLEAR_SUPPORTED,
                DEFAULT_CLEAR_SUPPORTED);
        return props.getBoolean(cacheRegionPrefix(cacheRegion) + CLEAR_SUPPORTED,
                globalClearSupported);
    }

    public boolean isDogpilePreventionEnabled(String cacheRegion) {
        boolean globalDogpilePrevention = props.getBoolean(PROP_DOGPILE_PREVENTION,
                DEFAULT_DOGPILE_PREVENTION);
        return props.getBoolean(cacheRegionPrefix(cacheRegion) + DOGPILE_PREVENTION,
                globalDogpilePrevention);
    }

    public double getDogpilePreventionExpirationFactor(String cacheRegion) {
        double globalFactor = props.getDouble(PROP_DOGPILE_PREVENTION_EXPIRATION_FACTOR,
                DEFAULT_DOGPILE_EXPIRATION_FACTOR);
        return props.getDouble(cacheRegionPrefix(cacheRegion) + DOGPILE_PREVENTION_EXPIRATION_FACTOR,
                globalFactor);
    }

    public String getMemcachedClientFactoryName() {
        return props.get(PROP_MEMCACHE_CLIENT_FACTORY,
                DEFAULT_MEMCACHE_CLIENT_FACTORY);
    }

    private String cacheRegionPrefix(String cacheRegion) {
        return PROP_PREFIX + cacheRegion + ".";
    }

    public PropertiesHelper getPropertiesHelper() {
        return props;
    }
}


text:
(function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga')

if (process.env.NODE_ENV === 'production') {
  ga('create', 'UA-75932201-4', 'auto')
} else {
  ga('create', 'UA-75932201-3', 'auto')
}
/// / Removes failing protocol check. @see: http://stackoverflow.com/a/22152353/1958200
ga('set', 'checkProtocolTask', function () {})

ga('require', 'displayfeatures')

export function sendEventButton (eventCategory, eventLabel) {
  ga('send', 'event', eventCategory, 'click', eventLabel)
}


text:
A simple JSON REST API server for money transfer among test user accounts

Data integraity is no. 1 priority in financial data systems.
This demo shows how to use relational database transaction and SQL query techniques to ensure data integrity, avoid dead lock and concurrent update conflict with little impact on performance.

## How to build
You need:
* Latest stable Oracle JDK 8
* Latest stable Apache Maven

## Api endpoints
It runs on http://localhost:9997/
* "GET /api/balance/{userid}": get user account balance; return a json object for balance
* "GET /api/transaction/{transactionid}": get individual transaction information; return a json object of transaction info(time, form_user, to_user, amount)
* "GET /api/transactions/{userid}?startdate={startdate}&enddate={enddate}": query user's transactions; return a json array of transaction info
* "POST /api/transfer": request body should be a json object(from_user, to_user, amount); return a json object for transaction id

error codes:
* 404: requested resource not found
* 400: bad request
* 500: internal server error

response body may include a json object showing detailed error message

## Test data
By default 3 users are created:
* user 1 has balance 100
* user 2 has balance 200
* user 3 has balance 300


text:
$(document).ready(function () {

    $('.buttonDelete').click(function (e) {
        if (confirm('Подтвердите удаление')) {
            e.preventDefault();
            var id = $(this).data('id');
            var a = $(this).parent().parent().parent();
            console.log(a);
            ajaxJson({
                url: '/objects/' + id + '/delete',
                success: function (ret) {
                    a.remove();
                    infoWindow('Успешно', function() {

                    });
                }
            });
        }
    });
});


text:
AutomateTheBoringStuff.Ch18 package
===================================

Subpackages
-----------

.. toctree::

    AutomateTheBoringStuff.Ch18.Projects

Submodules
----------

AutomateTheBoringStuff.Ch18.P1\_mouseMovement module
----------------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P1_mouseMovement
    :members:
    :undoc-members:
    :show-inheritance:

AutomateTheBoringStuff.Ch18.P2\_mouseNow module
-----------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P2_mouseNow
    :members:
    :undoc-members:
    :show-inheritance:

AutomateTheBoringStuff.Ch18.P3\_mouseInteraction module
-------------------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P3_mouseInteraction
    :members:
    :undoc-members:
    :show-inheritance:

AutomateTheBoringStuff.Ch18.P4\_spiralDraw module
-------------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P4_spiralDraw
    :members:
    :undoc-members:
    :show-inheritance:

AutomateTheBoringStuff.Ch18.P5\_screenshots module
--------------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P5_screenshots
    :members:
    :undoc-members:
    :show-inheritance:

AutomateTheBoringStuff.Ch18.P6\_mouseNow module
-----------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P6_mouseNow
    :members:
    :undoc-members:
    :show-inheritance:

AutomateTheBoringStuff.Ch18.P7\_controlKeyboard module
------------------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P7_controlKeyboard
    :members:
    :undoc-members:
    :show-inheritance:

AutomateTheBoringStuff.Ch18.P8\_formFiller module
-------------------------------------------------

.. automodule:: AutomateTheBoringStuff.Ch18.P8_formFiller
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: AutomateTheBoringStuff.Ch18
    :members:
    :undoc-members:
    :show-inheritance:


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/math-algorithms.iml" filepath="$PROJECT_DIR$/.idea/math-algorithms.iml" />
    </modules>
  </component>
</project>


text:
var Terrain;
(function (Terrain) {
    var Tiles;
    (function (Tiles) {
        var TilesManager = (function () {
            function TilesManager(scene, sun, material, tileSize, gridSize, tilesMatrixSideSize, centerNorthLalitude, centerWestLongitude, miniMap) {
                this.scene = scene;
                this.sun = sun;
                this.material = material;
                this.tileSize = tileSize;
                this.tileSizeDecimalPrecision = (tileSize % 1).toString().length - 2;
                this.gridSize = gridSize;
                this.amplitud = gridSize * tilesMatrixSideSize;
                this.initialCenterNorthLalitude = centerNorthLalitude;
                this.initialCenterWestLongitude = centerWestLongitude;
                this.tileMatrixSideSize = tilesMatrixSideSize;
                TilesManager.isLoading = false;
                this.createdTilesArray = new Array();
                this.visibleTilesArray = new Array();
                Terrain.Tiles.Tile.HalfGridSize = this.gridSize / 2;
                // Initialize image on minimap with first tile
                this.tileImage = new Tiles.TileImage(this.tileSize, this.gridSize, miniMap);
                Tiles.CoordinateSystemHelps.SetOrigin(this.initialCenterNorthLalitude, this.initialCenterWestLongitude, this.tileSize, this.gridSize);
            }
            TilesManager.GetInstance = function (scene, sun, material, tileSize, gridSize, tilesMatrixSideSize, centerNorthLalitude, centerWestLongitude, miniMap) {
                if (TilesManager.instance == null) {
                    TilesManager.instance = new TilesManager(scene, sun, material, tileSize, gridSize, tilesMatrixSideSize, centerNorthLalitude, centerWestLongitude, miniMap);
                }
                return TilesManager.instance;
            };
            TilesManager.GetExistingInstance = function () {
                return TilesManager.instance;
            };
            TilesManager.prototype.LoadNeededData = function (currentPosition) {
                if (!TilesManager.isLoading) {
                    var centerTiletem = this.GetCenterTileItem();
                    var currentCenterTiletem = this.GetTileItemByPosition(currentPosition);
                    if (!centerTiletem || !currentCenterTiletem) {
                        console.log("New center tile item: North: " + this.initialCenterNorthLalitude + " - West: " + this.initialCenterWestLongitude);
                        this.PopulateVisisbleTilesArray(this.initialCenterNorthLalitude, this.initialCenterWestLongitude);
                        this.LoadVisibleTilesArrayAsync();
                        this.tileImage.LoadTileImage(this.initialCenterNorthLalitude, this.initialCenterWestLongitude);
                        return true;
                    }
                    else if (!currentCenterTiletem.IsEqualTo(centerTiletem)) {
                        TilesManager.isLoading = true;
                        var centerNorthLalitude = currentCenterTiletem.GetNorthLatitude();
                        var centerWestLongitude = currentCenterTiletem.GetWestLongitude();
                        console.log("New center tile item: North: " + centerNorthLalitude + " - West: " + centerWestLongitude);
                        this.PopulateVisisbleTilesArray(centerNorthLalitude, centerWestLongitude);
                        this.LoadVisibleTilesArrayAsync();
                        this.tileImage.LoadTileImage(centerNorthLalitude, centerWestLongitude);
                        return true;
                    }
                }
                return false;
            };
            TilesManager.prototype.GetPositonAltitude = function (position) {
                var tileItem = this.GetTileItemByPosition(position);
                return tileItem != null ? tileItem.GetPositonHeight(position) : 0;
            };
            TilesManager.prototype.GetCenterTilePosition = function () {
                return this.GetCenterTileItem().GetPosition();
            };
            TilesManager.prototype.GetAmplitud = function () {
                return this.amplitud;
            };
            TilesManager.prototype.GetSideSize = function () {
                return this.tileMatrixSideSize;
            };
            TilesManager.prototype.GetTileName = function (latitude, longitude) {
                return 'TileMesh_' + latitude + '-' + longitude;
            };
            TilesManager.prototype.GetTileByName = function (name) {
                return this.GetTileFromTileListByName(name, this.createdTilesArray);
            };
            TilesManager.prototype.OntileLoaded = function (tileData) {
                if (tileData) {
                    var tilesManager = TilesManager.GetExistingInstance();
                    var name = tilesManager.GetTileName(tileData.tilePosition.NorthLalitude, tileData.tilePosition.WestLongitude);
                    var tile = tilesManager.GetTileByName(name);
                    tile.TileLoaded(tileData.data);
                }
            };
            TilesManager.prototype.GetCenterTileItem = function () {
                var index = (((this.tileMatrixSideSize * this.tileMatrixSideSize) / 2) | 0);
                return this.visibleTilesArray.length > index ? this.visibleTilesArray[index] : null;
            };
            TilesManager.prototype.GetTileItemByPosition = function (position) {
                for (var i = 0, tot = this.visibleTilesArray.length; i < tot; i++) {
                    if (this.visibleTilesArray[i].IsPositionIntoTile(position)) {
                        return this.visibleTilesArray[i];
                    }
                }
                return null;
            };
            TilesManager.prototype.GetTileFromTileListByName = function (name, tileList) {
                var result = tileList.filter(function (tile) { return tile.GetName() == name; });
                if (result.length > 0) {
                    return result[0];
                }
                else {
                    return null;
                }
            };
            TilesManager.prototype.PopulateVisisbleTilesArray = function (northLalitude, westLongitude) {
                var _this = this;
                var base = (this.tileMatrixSideSize / 2) | 0;
                var previousVisibleTilesArray = this.visibleTilesArray.slice();
                this.visibleTilesArray.length = 0;
                for (var i = 0; i < this.tileMatrixSideSize; i++) {
                    for (var j = 0; j < this.tileMatrixSideSize; j++) {
                        var latitude = Tiles.CoordinateSystemHelps.CheckLalitude(northLalitude + (this.tileSize * (base - i)), this.tileSizeDecimalPrecision);
                        var longitude = Tiles.CoordinateSystemHelps.CheckLongitude(westLongitude + (this.tileSize * (j - base)), this.tileSizeDecimalPrecision);
                        var name = this.GetTileName(latitude, longitude);
                        var tileItem = this.GetTileFromTileListByName(name, this.createdTilesArray);
                        if (tileItem == null) {
                            var mesh = this.CreateGroundMeshByName(name);
                            tileItem = new Tiles.Tile(latitude, longitude, name, this.tileSize, this.gridSize, mesh);
                            this.createdTilesArray.push(tileItem);
                        }
                        tileItem.Show();
                        this.visibleTilesArray.push(tileItem);
                        if (latitude == northLalitude && longitude == westLongitude) {
                            tileItem.SetIsCenteredTile(true);
                        }
                        else {
                            tileItem.SetIsCenteredTile(false);
                        }
                    }
                }
                //Hide not visible any more tiles
                var notVisibleAnyMoreTilesArray = previousVisibleTilesArray.filter(function (tile) { return _this.GetTileFromTileListByName(tile.GetName(), _this.visibleTilesArray) == null; });
                notVisibleAnyMoreTilesArray.forEach(function (tile) { return tile.Hide(); });
                previousVisibleTilesArray = null;
                notVisibleAnyMoreTilesArray = null;
            };
            TilesManager.prototype.LoadVisibleTilesArrayAsync = function () {
                var _this = this;
                this.visibleTilesArray.forEach(function (tile) { return tile.SetSurroundedTiles(_this.visibleTilesArray); });
                var toLoad = [0, 2, 6, 8];
                TilesManager.countDownEventLoader = new Terrain.Utilities.CountDownEvent(4, this.visibleTilesArray, this.LoadVisibleTilesArraySecondStepAsync);
                this.visibleTilesArray.filter(function (tile) { return toLoad.indexOf(_this.visibleTilesArray.indexOf(tile)) != -1; }).forEach(function (tile) {
                    tile.LoadTile(TilesManager.countDownEventLoader);
                });
            };
            TilesManager.prototype.LoadVisibleTilesArraySecondStepAsync = function (tilesArrayToLoad) {
                var toLoad = [1, 3, 5, 7];
                var centeredTile = tilesArrayToLoad.filter(function (tile) { return tile.GetIsCenteredTile(); })[0];
                TilesManager.countDownEventLoader = new Terrain.Utilities.CountDownEvent(4, centeredTile, function (data) {
                    Tiles.Tile.LoadCenteredTile(data);
                    TilesManager.isLoading = false;
                });
                tilesArrayToLoad.filter(function (tile) { return toLoad.indexOf(tilesArrayToLoad.indexOf(tile)) != -1; }).forEach(function (tile) {
                    tile.LoadTile(TilesManager.countDownEventLoader);
                });
            };
            TilesManager.prototype.CreateGroundMeshByName = function (name) {
                var mesh = new BABYLON.GroundMesh(name, this.scene);
                //mesh._subdivisions = this._subdivisions;
                mesh.checkCollisions = true;
                mesh.showBoundingBox = true;
                mesh.material = this.material;
                //mesh.useOctreeForCollisions = true;
                //mesh.useOctreeForRenderingSelection = true;
                //if ((<any>this.material).AddToRenderList) {
                //    (<any>this.material).AddToRenderList(mesh);
                //}
                return mesh;
            };
            TilesManager.maxMinHeight = 50;
            return TilesManager;
        })();
        Tiles.TilesManager = TilesManager;
    })(Tiles = Terrain.Tiles || (Terrain.Tiles = {}));
})(Terrain || (Terrain = {}));


text:
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;

[System.Serializable]
public class TestWindow : EditorWindow
{
    private static  GUIStyle    _passedStyle;
    private static  GUIStyle    _failedStyle;
    private static  GUIStyle    _notRunStyle;
    private static  GUIStyle    _runningStyle;
    private static  GUIStyle    _suitePassedStyle;
    private static  Vector2     _scrollPosition;

    private         TestHarness _testHarness;

    [MenuItem ("Window/TestWindow")]
    static void Init ()
    {
        _scrollPosition = Vector2.zero;
        ShowWindow();
    }

    static void ShowWindow ()
    {
        Type type = typeof(TestWindow);
        EditorWindow.GetWindow(type, false, "TestWindow").Repaint();
    }

    void OnInspectorUpdate ()
    {
        if (_testHarness == null) {
            _testHarness = new TestHarness();
        }

        if (!_testHarness.HasTests)
        {
            _testHarness.FindTests();
            ShowWindow();
        }
    }

    void OnGUI ()
    {
        _SetupStyles();

        if (_testHarness != null && _testHarness.HasTests)
        {
            if (GUILayout.Button("Run Tests"))     { _testHarness.RunTests();  }
            if (GUILayout.Button("Refresh Tests")) { _testHarness.FindTests(); }

            _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);
                _DrawSuites();
            EditorGUILayout.EndScrollView();
        }
        else {
            GUILayout.Label("No Tests.  Please Refresh.");
        }
    }

    private void _DrawSuites ()
    {
        if (_testHarness == null) { return; }

        foreach(string suiteName in _testHarness.GetSuiteNames())
        {
            GUILayout.Label(suiteName, _suitePassedStyle);

            _DrawTests(suiteName);
        }
    }

    private void _DrawTests (string suiteName)
    {
        foreach(TestRunner tr in _testHarness.GetTestsInSuite(suiteName)) {
            GUILayout.Label(tr.Name + " - " + tr.StatusMessage, _GetStyle(tr));
        }
    }

    private GUIStyle _GetStyle (TestRunner tr)
    {
        GUIStyle style;
        switch (tr.TestState)
        {
            case TestRunner.TestStates.PASSED:
                style = _passedStyle;
                break;
            case TestRunner.TestStates.FAILED:
                style = _failedStyle;
                break;
            case TestRunner.TestStates.RUNNING:
                style = _runningStyle;
                break;
            case TestRunner.TestStates.NOT_RUN:
                style = _notRunStyle;
                break;
            default:
                style = _notRunStyle;
                break;
        }

        return style;
    }

    private static void _SetupStyles ()
    {
        if (_passedStyle == null)
        {
            Color passedColor = new Color(45f / 255f, 240f / 255f, 91f / 255f);

            _passedStyle = new GUIStyle();
            _passedStyle.fontSize = 18;
            _passedStyle.padding = new RectOffset(15, 3, 3, 3);
            _passedStyle.margin  = new RectOffset(10, 1, 0, 1);
            _passedStyle.normal.textColor = Color.black;
            _passedStyle.normal.background = _ColorToTex(600, 1, passedColor);
        }

        if (_failedStyle == null)
        {
            Color failedColor = new Color(240f / 255f, 45f / 255f, 45f / 255f);

            _failedStyle = new GUIStyle();
            _failedStyle.fontSize = 20;
            _failedStyle.padding = new RectOffset(15, 3, 3, 3);
            _failedStyle.margin  = new RectOffset(10, 1, 0, 1);
            _failedStyle.normal.textColor = Color.white;
            _failedStyle.normal.background = _ColorToTex(600, 1, failedColor);
        }

        if (_notRunStyle == null)
        {
            _notRunStyle = new GUIStyle();
            _notRunStyle.fontSize = 18;
            _notRunStyle.padding = new RectOffset(5, 3, 3, 3);
            _notRunStyle.margin  = new RectOffset(10, 1, 0, 1);
            _notRunStyle.normal.textColor = Color.white;
            _notRunStyle.normal.background = _ColorToTex(600, 1, Color.gray);
        }

        if (_runningStyle == null)
        {
            _runningStyle = new GUIStyle();
            _runningStyle.fontSize = 18;
            _runningStyle.padding = new RectOffset(15, 3, 3, 3);
            _runningStyle.normal.textColor = Color.white;
            _runningStyle.normal.background = _ColorToTex(600, 1, Color.yellow);
        }

        if (_suitePassedStyle == null)
        {
            Color sColor = new Color(90f / 255f, 106f / 255f, 83f / 255f);

            _suitePassedStyle = new GUIStyle();
            _suitePassedStyle.fontSize = 25;
            _suitePassedStyle.padding = new RectOffset(5, 5, 5, 5);
            _suitePassedStyle.margin  = new RectOffset(10, 1, 0, 1);
            _suitePassedStyle.normal.textColor = Color.white;
            _suitePassedStyle.normal.background = _ColorToTex(600, 1, sColor);
        }
    }

    private static Texture2D _ColorToTex (int width, int height, Color col)
    {
        Color[] pix = new Color[width*height];

        for(int i = 0; i < pix.Length; i++) {
            pix[i] = col;
        }

        Texture2D result = new Texture2D(width, height);

        result.SetPixels(pix);
        result.Apply();

        return result;
    }
}


text:
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H

/* Board specifics. */
#include "rskrx210def.h"

/*-----------------------------------------------------------
 * Application specific definitions.
 *
 * These definitions should be adjusted for your particular hardware and
 * application requirements.
 *
 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
 *
 * See http://www.freertos.org/a00110.html.
 *----------------------------------------------------------*/

#define configUSE_PREEMPTION			1
#define configUSE_IDLE_HOOK				1
#define configUSE_TICK_HOOK				0
#define configCPU_CLOCK_HZ				( ICLK_FREQUENCY ) /* Set in rskrx210def.h. */
#define configPERIPHERAL_CLOCK_HZ		( PCLK_FREQUENCY ) /* Set in rskrx210def.h. */
#define configTICK_RATE_HZ				( ( TickType_t ) 1000 )
#define configMINIMAL_STACK_SIZE		( ( unsigned short ) 140 )
#define configTOTAL_HEAP_SIZE			( ( size_t ) ( 50 * 1024 ) )
#define configMAX_TASK_NAME_LEN			( 12 )
#define configUSE_TRACE_FACILITY		1
#define configUSE_16_BIT_TICKS			0
#define configIDLE_SHOULD_YIELD			1
#define configUSE_CO_ROUTINES 			0
#define configUSE_MUTEXES				1
#define configGENERATE_RUN_TIME_STATS	1
#define configCHECK_FOR_STACK_OVERFLOW	2
#define configUSE_RECURSIVE_MUTEXES		1
#define configQUEUE_REGISTRY_SIZE		0
#define configUSE_MALLOC_FAILED_HOOK	1
#define configUSE_APPLICATION_TASK_TAG	0

#define configMAX_PRIORITIES			( 7 )
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )

/* Software timer definitions. */
#define configUSE_TIMERS				1
#define configTIMER_TASK_PRIORITY		( 3 )
#define configTIMER_QUEUE_LENGTH		5
#define configTIMER_TASK_STACK_DEPTH	( configMINIMAL_STACK_SIZE )

/* The interrupt priority used by the kernel itself for the tick interrupt and
the pended interrupt.  This would normally be the lowest priority. */
#define configKERNEL_INTERRUPT_PRIORITY         1

/* The maximum interrupt priority from which FreeRTOS API calls can be made.
Interrupts that use a priority above this will not be effected by anything the
kernel is doing. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY    4

/* The peripheral used to generate the tick interrupt is configured as part of
the application code.  This constant should be set to the vector number of the
peripheral chosen.  As supplied this is CMT0. */
#define configTICK_VECTOR						_CMT0_CMI0

/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */

#define INCLUDE_vTaskPrioritySet			1
#define INCLUDE_uxTaskPriorityGet			1
#define INCLUDE_vTaskDelete					1
#define INCLUDE_vTaskCleanUpResources		0
#define INCLUDE_vTaskSuspend				1
#define INCLUDE_vTaskDelayUntil				1
#define INCLUDE_vTaskDelay					1
#define INCLUDE_uxTaskGetStackHighWaterMark	1
#define INCLUDE_xTaskGetSchedulerState		1
#define INCLUDE_eTaskGetState				1

#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
extern volatile unsigned long ulHighFrequencyTickCount;
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() nop() /* Run time stats use the same timer as the high frequency timer test. */
#define portGET_RUN_TIME_COUNTER_VALUE() ulHighFrequencyTickCount

/* Override some of the priorities set in the common demo tasks.  This is
required to ensure flase positive timing errors are not reported. */
#define bktPRIMARY_PRIORITY		( configMAX_PRIORITIES - 3 )
#define bktSECONDARY_PRIORITY	( configMAX_PRIORITIES - 4 )
#define intqHIGHER_PRIORITY		( configMAX_PRIORITIES - 3 )

#endif /* FREERTOS_CONFIG_H */


text:
Shellplay Changelog
=========================

### v0.1.9 - 2017-07-24
- update deps on paint gem

### v0.1.8 - 2015-12-09
- fix clear screen on linux
- fix command execution to use `$SHELL` rather than bash
  for FreeBSD comopat

### v0.1.7 - 2015-11-23
- create config dir if it does not exist (first time launch)
- add more code documentation
- update dependencies

### v0.1.6 - 2014-08-19
-------------------
- fix display of session prompt
- better quit on bash for shellplayer

### v0.1.5 - 2014-08-19
- better initial prompt for html version

### v0.1.4 - 2014-08-19
- optimize html export
- fix display of prompts in html export

### v0.1.3 - 2014-08-19
- html export rudimentary but functional

### v0.1.2 - 2014-08-18
- fix recording that was broken in 0.1.1
- add experimental html export

### v0.1.1 - 2014-08-17
- remove the need for input of prompt and timeformat if they are included in the session

### v0.1.0 - 2014-08-17
- first version seems ok, it's running and has been used on the field

### v0.0.13 - 2014-08-15
- add a `x` command in recorder to cancel a record
- add a default prompt at config creation
- improve the session selection menu to include remote recording
- add a 'type enter to begin' at the first screen

### v0.0.12 - 2014-08-15
- fix recorder to take account of `cd` properly
- fix recorder command execution

### v0.0.11 - 2014-08-14
- made possible to open a remote json file with `shellplay http://example.com/something.json`
- moved config vars (prompt and timeformat) to session file

### v0.0.10 - 2014-08-13
- added a `shellcat` command to merge sessions

### v0.0.9 - 2014-08-13
- fix the fix of creation of config dir

### v0.0.8 - 2014-08-13
- fix creation of the config dir at first launch

### v0.0.7 - 2014-08-13
- fix exec of commands in shellplay
- implement a `p` command in play mode for switching to previous screen
- added management of bash escape char for colorization in output texts

### v0.0.6 - 2014-08-13
- save json session in pretty format for manual intervention
- chomp output so there is less spaces
- add a config param for setting time format on the elapsed time of last command
- fix display of playprompt
- improved styling on 'timespent' display

### v0.0.5 - 2014-08-12
- add a `/` record prefix for clearscreen, works with iterm2 on mac, linux trick don't work yet
- add a `?` record prefix for faking output, in case of ssh connection for example
- add a `>` to change the prompt and a `>>` to switch prompt back and forth
- code is getting messy, it will be time to refactor the record into some classes soon

### v0.0.4 - 2014-08-12
- add changelog link in the gemspec
- add a `##` record option for inhibiting display of the play prompt
- add a `d` record command to drop last screen

### v0.0.3 - 2014-08-11
- fix shellrecord that was broken after incomplete file renaming

### v0.0.2 - 2014-08-10
- made recorder and player more or less working
- changed project name twice. First shellprez, then shreplay, finally shellplay rocks better

### v0.0.1 - 2014-08-08
- just initial code


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Article</title>
<meta name="date" content="2017-05-05">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法

zxl.bean

类 Article

java.lang.Object

zxl.bean.Article

public class Article
extends java.lang.Object

构造器概要

构造器

构造器和说明

Article(java.lang.String content,
       long UID,
       long type,
       long trans_AID,
       java.util.List<java.lang.String> pics)

方法概要

方法

限定符和类型
方法和说明

long
getAID()

java.lang.String
getContent()

java.util.List<java.lang.String>
getPics()

long
getTime()

long
getTrans_AID()

long
getType()

long
getUID()

void
setAID(long AID)

void
setContent(java.lang.String content)

void
setPics(java.util.List<java.lang.String> pics)

void
setTime(long time)

void
setTrans_AID(long trans_AID)

void
setType(long type)

void
setUID(long UID)

从类继承的方法 java.lang.Object

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

构造器详细资料

Article

public Article(java.lang.String content,
       long UID,
       long type,
       long trans_AID,
       java.util.List<java.lang.String> pics)

方法详细资料

getAID

public long getAID()

setAID

public void setAID(long AID)

getTime

public long getTime()

setTime

public void setTime(long time)

getContent

public java.lang.String getContent()

setContent

public void setContent(java.lang.String content)

getUID

public long getUID()

setUID

public void setUID(long UID)

getTrans_AID

public long getTrans_AID()

setTrans_AID

public void setTrans_AID(long trans_AID)

getType

public long getType()

setType

public void setType(long type)

getPics

public java.util.List<java.lang.String> getPics()

setPics

public void setPics(java.util.List<java.lang.String> pics)

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法


text:
require 'sequel_paper_trail/version'
require 'sequel_paper_trail/config'

# Paper Trail config interface
module SequelPaperTrail
  class << self
    attr_accessor :whodunnit
    attr_accessor :info_for_paper_trail

    # Set versioning state.
    #
    # Boolean -> Boolean
    #
    def enabled=(enable)
      Config.instance.enabled = enable
    end

    # Check if versioning enabled.
    #
    # Boolean
    #
    def enabled?
      Config.instance.enabled
    end

    # Execute block with or without versioning.
    #
    # Boolean -> Proc -> Boolean
    #
    def with_versioning(enable = true)
      was_enabled = enabled?
      self.enabled = enable
      yield
    ensure
      self.enabled = was_enabled
    end
  end
end

# Default Configuration
SequelPaperTrail.enabled = true
SequelPaperTrail.whodunnit = nil
SequelPaperTrail.info_for_paper_trail = {}


text:
using System.Collections.Generic;

namespace CommonSenseCSharp.datastructures {
    public class NonNullHashSet<T> : HashSet<T> {
        public new void Add(T item) {
            if (item == null) {
                return;
            }
            base.Add(item);
        }

    }
}


text:
using System;
using System.Collections;
using System.Xml.Serialization;

namespace LBSView.Framework.Common.Template.Xml
{
    /// <summary>
    /// Helper class that represents the root
    /// element of an XML declaration document.
    /// </summary>
    [Serializable]
    public class TemplateConfiguration
    {

        #region members

        /// <summary>
        /// The base folder of the templates, if any.
        /// </summary>
        private string baseDirectory;

        /// <summary>
        /// The SMTP server to be used.
        /// </summary>
        private string smtpServer;

        /// <summary>
        /// The available template groups.
        /// </summary>
        private ArrayList templateGroups;

        private string smtpUserToAuthenticate;

        private string smtpPassToAuthenticate;

        private string smtpReplaceBareLineFeeds;

        #endregion

        #region properties

        /// <summary>
        /// The base folder of the templates, if any.
        /// </summary>
        [XmlElement()]
        public string BaseDirectory
        {
            get { return this.baseDirectory; }
            set { this.baseDirectory = value; }
        }

        /// <summary>
        /// The SMTP server to be used.
        /// </summary>
        [XmlElement()]
        public string SmtpServer
        {
            get { return this.smtpServer; }
            set { this.smtpServer = value; }
        }

        /// <summary>
        /// The available template groups.
        /// </summary>
        [XmlArray("Groups")]
        [XmlArrayItem("TemplateGroup", typeof(TemplateGroupElement))]
        public ArrayList TemplateGroups
        {
            get { return this.templateGroups; }
            set { this.templateGroups = value; }
        }

        [XmlElement()]
        public string SmtpUserToAuthenticate
        {
            get { return smtpUserToAuthenticate; }
            set { smtpUserToAuthenticate = value; }
        }

        [XmlElement()]
        public string SmtpPassToAuthenticate
        {
            get { return smtpPassToAuthenticate; }
            set { smtpPassToAuthenticate = value; }
        }

        [XmlElement()]
        public string SmtpReplaceBareLineFeeds
        {
            get { return smtpReplaceBareLineFeeds; }
            set { smtpReplaceBareLineFeeds = value; }
        }

        #endregion

        #region get template group

        /// <summary>
        /// Gets a template group based on the
        /// template ID.
        /// </summary>
        /// <param name="templateId">Alphanumeric group ID.</param>
        /// <returns>A group element that provides access to the
        /// group's templates.</returns>
        /// <exception cref="ArgumentException">Thrown if no
        /// such group exists.</exception>
        public TemplateGroupElement GetGroup(string templateId)
        {
            foreach (TemplateGroupElement group in this.templateGroups)
            {
                if (group.TemplateGroupId.Equals(templateId)) return group;
            }

            string msg = "Unknown template Id: '{0}'";
            msg = String.Format(msg, templateId);
            throw new ArgumentException(msg);
        }

        #endregion

    }
}

#region Revision History
//
//******************************************************************************
//
// Revision Details
// ================
//
// $Author: Admin $
// $Header: /Release 1/Hydra/Core/Source/Framework/Common/Template/Xml/TemplateConfiguration.cs 1     10/05/10 15:30 Admin $
// $Workfile: TemplateConfiguration.cs $
// $Revision: 1 $
//
// $History: TemplateConfiguration.cs $
//
//*****************  Version 1  *****************
//User: Admin        Date: 10/05/10   Time: 15:30
//Created in $/Release 1/Hydra/Core/Source/Framework/Common/Template/Xml
//
//*****************  Version 1  *****************
//User: Admin        Date: 23/03/10   Time: 22:25
//Created in $/Release 1/LBS/LBS/Framework/Common/Template/Xml
//
//*****************  Version 1  *****************
//User: Admin        Date: 31/12/09   Time: 0:09
//Created in $/Phase1/LBS/Framework/Common/Template/Xml
//
// $Log: /Release 1/Hydra/Core/Source/Framework/Common/Template/Xml/TemplateConfiguration.cs $
//
//1     10/05/10 15:30 Admin
//
//1     23/03/10 22:25 Admin
//
//1     31/12/09 0:09 Admin
//
//******************************************************************************
//
#endregion


text:
module Pohoda
  module Builders
    module Gdp
      class GDPRHeaderType
        include ParserCore::BaseBuilder

        def builder
          root = Ox::Element.new(name)
          root = add_attributes_and_namespaces(root)

          root << build_element('gdp:id', data[:id], data[:id_attributes]) if data.key? :id
          root << build_element('gdp:GDPRType', data[:gdpr_type], data[:gdpr_type_attributes]) if data.key? :gdpr_type
          root << build_element('gdp:name', data[:name], data[:name_attributes]) if data.key? :name
          root << build_element('gdp:description', data[:description], data[:description_attributes]) if data.key? :description
          root << build_element('gdp:valueOfValidity', data[:value_of_validity], data[:value_of_validity_attributes]) if data.key? :value_of_validity
          root << build_element('gdp:typeOfValidity', data[:type_of_validity], data[:type_of_validity_attributes]) if data.key? :type_of_validity
          root << build_element('gdp:note', data[:note], data[:note_attributes]) if data.key? :note
          root << build_element('gdp:markRecord', data[:mark_record], data[:mark_record_attributes]) if data.key? :mark_record

          root
        end
      end
    end
  end
end


text:
require 'spec_helper'

describe 'default recipe on Ubuntu 12.04' do
  let(:chef_run) do
    runner = ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
    runner.node.default['packages']['fail2ban'] = { version: '0.8.6-3wheezy3build0.12.04.1', arch: 'all' }
    runner.converge('fail2ban::default')
  end

  it 'converges successfully' do
    expect { :chef_run }.to_not raise_error
  end

  it 'should template fail2ban.conf' do
    expect(chef_run).to render_file('/etc/fail2ban/fail2ban.conf').with_content(/^loglevel = 3/)
  end
end

describe 'default recipe on Ubuntu 18.04' do
  let(:chef_run) do
    runner = ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '18.04')
    runner.node.default['packages']['fail2ban'] = { version: '0.10.2-2', arch: 'all' }
    runner.converge('fail2ban::default')
  end

  it 'converges successfully' do
    expect { :chef_run }.to_not raise_error
  end

  it 'should template fail2ban.conf' do
    expect(chef_run).to render_file('/etc/fail2ban/fail2ban.conf').with_content { |content|
      expect(content).to match(/^loglevel = INFO/)
      expect(content).to match(/^syslogsocket = auto/)
      expect(content).to match(%r{^dbfile = /var/lib/fail2ban/fail2ban.sqlite3})
      expect(content).to match(/^dbpurgeage = 86400/)
    }
  end
end


text:
source ./test/config.sh

echo  "SETUP - Creating Edge Microgateway service and Deploying spring application to Cloud Foundry..."
cf api --skip-ssl-validation $cf_hostname
cf login --skip-ssl-validation -a $cf_hostname -u $cf_admin -p $cf_adminpw -o $cf_org -s $cf_space

pushd ../gs-rest-service/complete
if [ ! -d "build" ]; then
  gradle build
fi
cf push --no-start -m 512MB
cf cups edgemicro_service -p 'REPLACEME'
cf bind-service spring_hello edgemicro_service
popd
echo  "SETUP - finished"

echo "SETUP - Enabling Diego for spring app..."
cf enable-diego spring_hello
cf start spring_hello
echo "SETUP - Finished enabling Diego."


text:
/**
 * This barrel file provides the export for the shared GraphPreviewComponent.
 */
export * from './graph-preview.component';


text:
package com.iobeam.api.client;

import com.iobeam.api.ApiException;
import com.iobeam.api.auth.AbstractAuthHandler;
import com.iobeam.api.auth.AuthHandler;
import com.iobeam.api.auth.AuthToken;
import com.iobeam.api.auth.ProjectBearerAuthToken;
import com.iobeam.api.http.RequestBuilder;
import com.iobeam.api.http.StatusCode;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.util.Date;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

@RunWith(MockitoJUnitRunner.class)
public class RestClientTest {

    @Spy
    private final RequestBuilder reqBuilder =
        new RequestBuilder("http://localhost:14634/foo");

    @Spy
    private final RestClient client = new RestClient();

    private AuthToken validToken;

    private AuthToken expiredToken = new ProjectBearerAuthToken(0, "faketoken", new Date(0));

    private HttpURLConnection conn;

    @Before
    public void setUp() throws Exception {
        conn = spy(reqBuilder.build());
        doReturn(conn).when(reqBuilder).build();
        doNothing().when(conn).connect();
        doReturn(401).when(conn).getResponseCode();
        doReturn(0).when(conn).getContentLength();
        doReturn(true).when(conn).getDoInput();
        long validTime = System.currentTimeMillis() + 60000;
        validToken = new ProjectBearerAuthToken(0, "faketokenworks", new Date(validTime));
    }

    @Test
    public void testRequestWithExpiredAuthTokenShouldRefreshToken() throws Exception {

        final AuthHandler handler = spy(new AbstractAuthHandler() {
            @Override
            protected AuthToken readToken() {
                return null;
            }

            @Override
            protected void writeToken(AuthToken token) {
            }

            @Override
            public AuthToken refreshToken() throws IOException, ApiException {
                doReturn(200).when(conn).getResponseCode();
                return validToken;
            }
        });
        client.setAuthenticationHandler(handler);
        client.setAuthToken(expiredToken);
        assertFalse(client.hasValidAuthToken());
        client.executeRequest(reqBuilder, StatusCode.OK, Void.class, true);
        verify(handler).refreshToken();
        assertTrue(client.hasValidAuthToken());
    }

    @Test
    public void testRequestWithExpiredAuthTokenShouldReadToken() throws Exception {

        final AuthHandler handler = spy(new AbstractAuthHandler() {
            @Override
            protected AuthToken readToken() {
                try {
                    doReturn(200).when(conn).getResponseCode();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                return validToken;
            }

            @Override
            protected void writeToken(AuthToken token) {
            }

            @Override
            public AuthToken refreshToken() throws IOException, ApiException {
                return null;
            }
        });
        client.setAuthenticationHandler(handler);
        client.setAuthToken(expiredToken);
        assertFalse(client.hasValidAuthToken());
        client.executeRequest(reqBuilder, StatusCode.OK, Void.class, true);
        verify(handler, times(0)).refreshToken();
        assertTrue(client.hasValidAuthToken());
    }

    @Test
    public void testRequestWithExpiredAuthTokenShouldForceRefresh() throws Exception {

        final AuthHandler handler = spy(new AbstractAuthHandler() {
            int count = 0;

            @Override
            protected AuthToken readToken() {
                return null;
            }

            @Override
            protected void writeToken(AuthToken token) {
            }

            @Override
            public AuthToken refreshToken() throws IOException, ApiException {
                // Do not return a valid token on the first two refreshes
                // to force a (fake) 401 server response that requests a valid token
                if (count++ < 2) {
                    return expiredToken;
                }
                doReturn(200).when(conn).getResponseCode();
                return validToken;
            }
        });
        client.setAuthenticationHandler(handler);
        client.setAuthToken(expiredToken);
        assertFalse(client.hasValidAuthToken());
        client.executeRequest(reqBuilder, StatusCode.OK, Void.class, true);
        verify(handler, times(3)).refreshToken();
        assertTrue(client.hasValidAuthToken());
    }

}


text:
package org.ihtsdo.changeanalyzer;

import org.apache.maven.doxia.markup.HtmlMarkup;
import org.apache.maven.doxia.module.xhtml.XhtmlSink;
import org.apache.maven.doxia.module.xhtml.XhtmlSinkFactory;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkEventAttributeSet;
import org.apache.maven.doxia.sink.SinkEventAttributes;
import org.apache.maven.doxia.siterenderer.Renderer;
import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;

import java.io.*;
import java.net.URLEncoder;
import java.util.*;

/**
 * Reports all new concepts in a release file.
 *
 * @author Vahram
 * @goal report-concepts
 * @phase site
 */
public class ConceptReportSite extends AbstractMavenReport {

	/**
	 * The Maven Project Object
	 *
	 * @parameter default-value="${project}"
	 * @required
	 * @readonly
	 */
	private MavenProject project;

	/**
	 * Specifies the directory where the report will be generated
	 *
	 * @parameter default-value="${project.reporting.outputDirectory}"
	 * @required
	 */
	private String outputDirectory;

	/**
	 * Specifies the directory of report source files
	 *
	 * @parameter default-value="${project.reporting.outputDirectory}"
	 * @required
	 */
	private String inputDirectory;

	/**
	 * Specifies the directory of report source files
	 *
	 * @parameter
	 * @required
	 */
	private String conceptFileToReport;

	/**
	 * bundle
	 *
	 * @parameter
	 * @required
	 */
	private String bundle;

	/**
	 * @component
	 * @required
	 * @readonly
	 */
	private Renderer siteRenderer;

	private String conceptHeader;

	private int count;

	private HashMap<String, ArrayList<String>> semanticTagMap;

	@Override
	protected void executeReport(Locale arg0) throws MavenReportException {
		try {
			Sink sink = getSink();
			SinkUtilities.headAndTitle(sink, "Concepts Report");
			sink.body();

			File file = new File(inputDirectory, conceptFileToReport);
			FileInputStream sortedFis = new FileInputStream(file);
			InputStreamReader sortedIsr = new InputStreamReader(sortedFis, "UTF-8");
			BufferedReader br = new BufferedReader(sortedIsr);

			SinkUtilities.createGeneralInfoSection(sink, br, count);

			conceptHeader = br.readLine();

			// Create a map with concepts semantic tags and lines
			semanticTagMap = new HashMap<String, ArrayList<String>>();
			// CONCPET ID MODULE DEFINITION STATUS TERM SEMANTIC TAG
			count = 0;
			while (br.ready()) {
				String line = br.readLine();
				String[] splited = line.split("\\t");
				if (semanticTagMap.containsKey(splited[4])) {
					semanticTagMap.get(splited[4]).add(line);
				} else {
					ArrayList<String> lines = new ArrayList<String>();
					lines.add(line);
					semanticTagMap.put(splited[4], lines);
				}
				count++;
			}

			sink.section2();
			sink.sectionTitle2();
			sink.text("Concept Table");
			sink.sectionTitle2_();

			SinkUtilities.createFilterSection(sink);

			createConceptsTable(sink, br);

			sink.section2_();

			sink.body_();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	private void createConceptsTable(Sink sink, BufferedReader br) throws IOException {
		// Create concepts semantic tag table
		Set<String> semanticTags = semanticTagMap.keySet();

		// Semantic tag tables attributes
		SinkEventAttributes tableAttr = new SinkEventAttributeSet();
		tableAttr.addAttribute(SinkEventAttributes.ID, "results");
		tableAttr.addAttribute(SinkEventAttributes.CLASS,
				"bodyTable sortable-onload-3 no-arrow rowstyle-alt colstyle-alt paginate-20 max-pages-7 paginationcallback-callbackTest-calculateTotalRating paginationcallback-callbackTest-displayTextInfo sortcompletecallback-callbackTest-calculateTotalRating");

		// Semantic tag table
		sink.table(tableAttr);
		// Semantic tag tables header
		sink.tableRow();
		sink.tableHeaderCell();
		sink.text("Semantic Tag");
		sink.tableHeaderCell_();
		sink.tableHeaderCell();
		sink.text("New concepts count");
		sink.tableHeaderCell_();
		sink.tableRow_();
		// Semantic tag table rows
		if (semanticTags.isEmpty()) {
			sink.tableRow();
			sink.tableCell();
			sink.text("No concepts found");
			sink.tableCell_();
			sink.tableCell();
			sink.tableCell_();
			sink.tableRow_();
			sink.table_();
		} else {
			for (String semanticTag : semanticTags) {
				ArrayList<String> semTagConcepts = semanticTagMap.get(semanticTag);
				createConceptsFile(semTagConcepts, semanticTag);
				// Create Semantic tag line
				SinkEventAttributes findigLinkAttrs = new SinkEventAttributeSet();
				findigLinkAttrs.addAttribute("onclick", "javascript:showFindings(\"newRels/" + URLEncoder.encode(semanticTag.replaceAll(" ", ""), "UTF-8") + ".html\"" + ")");
				findigLinkAttrs.addAttribute("href", "javascript:linkme();");

				sink.tableRow();
				sink.tableCell();
				sink.unknown("a", new Object[] { new Integer(HtmlMarkup.TAG_TYPE_START) }, findigLinkAttrs);
				sink.text(semanticTag);
				sink.unknown("a", new Object[] { new Integer(HtmlMarkup.TAG_TYPE_END) }, null);
				sink.tableCell_();
				sink.tableCell();
				sink.text("" + semTagConcepts.size());
				sink.tableCell_();
				sink.tableRow_();
			}
			// Close semantic tag table
			sink.table_();
			sink.section3();
			sink.sectionTitle3();
			sink.text("Concpets");
			sink.sectionTitle3_();
			sink.lineBreak();
			SinkEventAttributes divAttrs = new SinkEventAttributeSet();
			divAttrs.addAttribute(SinkEventAttributes.CLASS, "findings");
			sink.unknown("div", new Object[] { new Integer(HtmlMarkup.TAG_TYPE_START) }, divAttrs);
			sink.text("Click on a sematic tag to see the concepts");
			sink.unknown("div", new Object[] { new Integer(HtmlMarkup.TAG_TYPE_END) }, null);

			sink.section3_();
		}

	}

	private void createConceptsFile(ArrayList<String> semTagConcepts, String semanticTag) throws IOException {
		// Relationship html file sink initialization
		File outputDir = new File(outputDirectory, "newRels");
		outputDir.mkdir();
		File relFile = new File(outputDir, URLEncoder.encode(semanticTag.replaceAll(" ", ""), "UTF-8") + ".html");
		FileOutputStream fos = new FileOutputStream(relFile);
		XhtmlSink conceptSink = (XhtmlSink) new XhtmlSinkFactory().createSink(fos, "UTF-8");
		conceptSink.head();
		conceptSink.title();
		conceptSink.text("Concpets");
		conceptSink.title_();
		conceptSink.head_();
		conceptSink.body();

		SinkEventAttributes tableAttr = new SinkEventAttributeSet();
		tableAttr.addAttribute(SinkEventAttributes.ID, "results2");
		tableAttr.addAttribute(SinkEventAttributes.CLASS,
				"bodyTable sortable-onload-3 no-arrow rowstyle-alt colstyle-alt paginate-15 max-pages-7 paginationcallback-callbackTest-calculateTotalRating paginationcallback-callbackTest-displayTextInfo sortcompletecallback-callbackTest-calculateTotalRating");

		conceptSink.table(tableAttr);
		conceptSink.tableRow();

		String[] conceptHeaderSplited = conceptHeader.split("\\t", -1);
		SinkEventAttributes headerAttrs = new SinkEventAttributeSet();
		for (int i = 0; i < conceptHeaderSplited.length; i++) {
			if (i >= 1) {
				headerAttrs.addAttribute(SinkEventAttributes.CLASS, "sortable-text fd-column-" + (i - 1));
			} else if (i == 0) {
				headerAttrs.addAttribute(SinkEventAttributes.CLASS, "sortable-numeric fd-column-" + (0));
			}
			conceptSink.tableHeaderCell(headerAttrs);
			conceptSink.text(conceptHeaderSplited[i]);
			conceptSink.tableHeaderCell_();
		}
		conceptSink.tableRow_();
		for (String string : semTagConcepts) {

			String[] ruleLineSplit = string.split("\\t", -1);

			conceptSink.tableRow();
			for (int i = 0; i < ruleLineSplit.length; i++) {
				conceptSink.tableCell();
				conceptSink.text(ruleLineSplit[i]);
				conceptSink.tableCell_();
			}
			conceptSink.tableRow_();
		}
		conceptSink.table_();
		conceptSink.body_();
		conceptSink.flush();
		conceptSink.close();
	}

	@Override
	protected String getOutputDirectory() {
		return outputDirectory;
	}

	@Override
	protected MavenProject getProject() {
		return project;
	}

	@Override
	protected Renderer getSiteRenderer() {
		return siteRenderer;
	}

	@Override
	public String getDescription(Locale locale) {
		return getBundle(locale).getString("report.description");
	}

	@Override
	public String getName(Locale locale) {
		return getBundle(locale).getString("report.name");
	}

	@Override
	public String getOutputName() {
		return project.getArtifactId() + conceptFileToReport.replaceAll(".txt", "") + "-Site-Report";
	}

	private ResourceBundle getBundle(Locale locale) {
		return ResourceBundle.getBundle(bundle);
	}

}


text:
from __future__ import print_function
from pprint import pprint
my_device = {}
my_device['ip_addr'] = '1.2.3.4'
my_device['username'] = 'wjohnston'
my_device['password'] = 'password1'
my_device['vendor'] = 'juniper'
my_device['model'] = 'MX480'
for key,val in my_device.items():
    print (key,val)
my_device['password'] = 'NewPass#32'
my_device['secret'] = 'dont tell'
bad_device = my_device.get('whatever','bad stuff')
print (bad_device)


text:
<?php

// list
$this->widget('dressing.widgets.YdListView', array(
    'id' => 'attachment-list',
    'dataProvider' => $attachment->search(),
    'itemView' => '/attachment/_list_view',
));


text:
<!doctype html>

<title>CodeMirror: Close-Tag Demo</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../doc/docs.css">

<link rel="stylesheet" href="../lib/codemirror.css">

CodeMirror

Home

Manual

Code

Close-Tag

Close-Tag Demo

<form><textarea id="code" name="code"><html</textarea></form>


text:
Write an improved version of debug.debug that runs the given commands as if they were in the lexical scope of the calling function.  (Hint: run the commands in an empty environment and use the __index metamethod attached to function getvarvalue to do all accesses to variables.)
]]

rdebug = require 'rdebug'

x = 3
local y = 4
local _ = (function()
  local z = y + 1
  rdebug.debug()
end)()

--[[
debug> print(x)
3
debug> print(y)
4
debug> print(z)
5
debug> cont
]]


text:
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!

#include "config.h"
#if ENABLE(WEB_AUDIO)
#include "V8StereoPannerNode.h"

#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/modules/v8/V8AudioParam.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/TraceEvent.h"
#include "wtf/GetPtr.h"
#include "wtf/RefPtr.h"

namespace blink {

// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
const WrapperTypeInfo V8StereoPannerNode::wrapperTypeInfo = { gin::kEmbedderBlink, V8StereoPannerNode::domTemplate, V8StereoPannerNode::refObject, V8StereoPannerNode::derefObject, V8StereoPannerNode::trace, 0, 0, V8StereoPannerNode::preparePrototypeObject, V8StereoPannerNode::installConditionallyEnabledProperties, "StereoPannerNode", &V8AudioNode::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::GarbageCollectedObject };
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic pop
#endif

// This static member must be declared by DEFINE_WRAPPERTYPEINFO in StereoPannerNode.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
const WrapperTypeInfo& StereoPannerNode::s_wrapperTypeInfo = V8StereoPannerNode::wrapperTypeInfo;

namespace StereoPannerNodeV8Internal {

static void panAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    StereoPannerNode* impl = V8StereoPannerNode::toImpl(holder);
    RawPtr<AudioParam> cppValue(impl->pan());
    if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue.get()))
        return;
    v8::Local<v8::Value> v8Value(toV8(cppValue.get(), holder, info.GetIsolate()));
    if (!v8Value.IsEmpty()) {
        V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "pan"), v8Value);
        v8SetReturnValue(info, v8Value);
    }
}

static void panAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    StereoPannerNodeV8Internal::panAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

} // namespace StereoPannerNodeV8Internal

static const V8DOMConfiguration::AccessorConfiguration V8StereoPannerNodeAccessors[] = {
    {"pan", StereoPannerNodeV8Internal::panAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
};

static void installV8StereoPannerNodeTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "StereoPannerNode", V8AudioNode::domTemplate(isolate), V8StereoPannerNode::internalFieldCount,
        0, 0,
        V8StereoPannerNodeAccessors, WTF_ARRAY_LENGTH(V8StereoPannerNodeAccessors),
        0, 0);
    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
    ALLOW_UNUSED_LOCAL(instanceTemplate);
    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
    ALLOW_UNUSED_LOCAL(prototypeTemplate);

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}

v8::Local<v8::FunctionTemplate> V8StereoPannerNode::domTemplate(v8::Isolate* isolate)
{
    return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8StereoPannerNodeTemplate);
}

bool V8StereoPannerNode::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
}

v8::Local<v8::Object> V8StereoPannerNode::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
    return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}

StereoPannerNode* V8StereoPannerNode::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
{
    return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0;
}

void V8StereoPannerNode::refObject(ScriptWrappable* scriptWrappable)
{
}

void V8StereoPannerNode::derefObject(ScriptWrappable* scriptWrappable)
{
}

} // namespace blink
#endif // ENABLE(WEB_AUDIO)


text:
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Login extends CI_Controller {

     // Facebook OAuth Crediential
        private $appId = "142655082759044";
        private $secret = "f1019caf57a76118701e7fe205571c00";

     // Google OAuth Crediential
        private $client_id = '218430018550-2dfhie2a8b9p4og2589h8vbj67064ag3.apps.googleusercontent.com';
        private $client_secret = 'DiyNZuAUTqJABcvBcBXRTqaf';
        private $redirect_uri = 'http://localhost/ci_loginapp_fb_google/login/google_login';
        private $simple_api_key = 'AIzaSyDWaDwJhdhg2x4Bf62l4MizxSO5V0Mnl20';

    function __construct() {
        parent::__construct();
        $this->load->library('session');
        $this->load->model('loginapp_model');
        $this->load->helper('cookie');
        $this->load->library('email');

        session_start();
        // Load facebook library and pass associative array which contains appId and secret key
        $this->load->library('facebook', array('appId' => $this->appId, 'secret' => $this->secret));
    }

    public function index() {
       //call back browser function
        $this->back_browser();
       //call autologin function
        $this->autologin();

            if (isset($_GET['p']) && $_GET['p'] == 'popup') {
                $error =  array('error' => '');
                $this->load->view('login_view', $error);
            } elseif (isset($_GET['p']) && $_GET['p'] == 'entry') {
                  $error =  array('error' => '');
                $this->load->view('login_view', $error);
            } else {
                  $error =  array('error' => '');
                $this->load->view('login_view', $error);
            }

    }

    public function facebook_login(){
           $data = $this->facebook_oauth();
              // If already user login in facebook, it pass the user profile values, which get from facebook id.
        if(isset($data['fb_login_url'])){
          header('Location:' .$data['fb_login_url']);
        }
        if (isset($data['user_email'])) {
            $user_fb_data = array(
                'user_picture' => $data['user_picture'],
                'user_name' => $data['user_name'],
                'user_email' => $data['user_email'],
                'logout_url' => $data['logout_url']
            );

            //checking email id exists or not in database
            $data = $this->loginapp_model->user_email_check($user_fb_data['user_email']);
            isset($data[0]) ? $check_email = trim(strtolower($data[0]->user_email)) : $check_email = '';

            //if not exists then save on db
            if ($check_email != $user_fb_data['user_email']) {
                $insert_fb_data = array(
                    'user_name' => $user_fb_data['user_name'],
                   'user_email' => $user_fb_data['user_email'],
                     'is_active' => 1
                    );
                // Sucess New User Registration
                $new_user = $this->loginapp_model->new_user_registration($insert_fb_data);
            }
              // if exit save all data in session and view home page
                    $this->session->set_userdata($user_fb_data);
                    $this->session->all_userdata();
                    $this->home();
        }
    }

    public function google_login(){

        $data = $this->google_oauth();

           if(isset($data['authUrl'])){
          header('Location:' .$data['authUrl']);
        }

        //get google oauth userdata
        if (isset($data['userData'])) {

            $user_name = $data['userData']->given_name . " " . $data['userData']->family_name;
            $user_email = $data['userData']->email;
            $user_picture = $data['userData']->picture;
            $user_google_data = array(
                'user_picture' => $user_picture,
                'user_name' => $user_name,
                'user_email' => $user_email
            );

            //checking email id exists or not in database
            $data = $this->loginapp_model->user_email_check($user_google_data['user_email']);
            isset($data[0]) ? $check_email = trim(strtolower($data[0]->user_email)) : $check_email = '';

            //if not exists then save on db
            if ($check_email != $user_google_data['user_email']) {

                $insert_google_data = array(
                    'user_name' => $user_name,
                    'user_email' => $user_email,
                     'is_active' => 1

                );
                // Sucess New User Registration
                $new_user = $this->loginapp_model->new_user_registration($insert_google_data);
            }
            //set user data to session
            $this->session->set_userdata($user_google_data);
            $this->session->all_userdata();
            $this->home();
        }

    }

     // Log In via Facebook.
    public function facebook_oauth() {
        $facebook_user = "";
        // Get user's login information
        $facebook_user = $this->facebook->getUser();

        if (isset($_GET['error_reason']) && $_GET['error_reason'] == 'user_denied') {
            header('Location:'.  base_url());
        } else {

        if ($facebook_user) {
            $user_profile = $this->facebook->api('/me?fields=id,first_name,last_name,email,gender,locale,picture');
            $data['user_email'] = $user_profile['email'];
            $data['user_name'] = $user_profile['first_name'];
            $data['user_picture'] = "https://graph.facebook.com/" . $user_profile['id'] . "/picture";
            $data['logout_url'] = $this->facebook->getLogoutUrl(array('next' => base_url() . 'login/logout'));
        } else {
            $data['fb_login_url'] = $this->facebook->getLoginUrl(array(
                'scope' => 'email,public_profile'

            ));
        }
        }
        return $data;
    }

    //Google OAuth Function
    public function google_oauth() {

        // Include google-php-client library in controller
        include_once APPPATH . "libraries/google-api-php-client-master/src/Google/Client.php";
        include_once APPPATH . "libraries/google-api-php-client-master/src/Google/Service/Oauth2.php";

        // Store values in variables from project created in Google Developer Console
        $client_id = $this->client_id;
        $client_secret = $this->client_secret;
        $redirect_uri = $this->redirect_uri;
        $simple_api_key = $this->simple_api_key;

        // Create Client Request to access Google API
        $client = new Google_Client();
        $client->setApplicationName("PHP Google OAuth Login Example");
        $client->setClientId($client_id);
        $client->setClientSecret($client_secret);
        $client->setRedirectUri($redirect_uri);
        $client->setDeveloperKey($simple_api_key);
        $client->addScope("https://www.googleapis.com/auth/userinfo.email");

        // Send Client Request
        $objOAuthService = new Google_Service_Oauth2($client);

        // Add Access Token to Session
        if (isset($_GET['code'])) {
            $client->authenticate($_GET['code']);
            $_SESSION['access_token'] = $client->getAccessToken();
            header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
        }

        // Set Access Token to make Request
        if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
            $client->setAccessToken($_SESSION['access_token']);
        }

        // Get User Data from Google and store them in $data
        if ($client->getAccessToken()) {
            $userData = $objOAuthService->userinfo->get();
            $data['userData'] = $userData;
            $_SESSION['access_token'] = $client->getAccessToken();
        }  else {
            $authUrl = $client->createAuthUrl();
            $data['authUrl'] = $authUrl;
            $this->load->view('login_view', $data);
            exit;
        }
        return $data;

    }

    //For new User Registration and verification
    public function user_registration() {

        //set validtion and xss clean
        $this->load->library('form_validation');
        $this->form_validation->set_rules('uname', 'Full Name', 'required|min_length[3]|max_length[25]|xss_clean');
        $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
        $this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[25]');

        //Checking form validtion if true then getting posted data  by user
        if ($this->form_validation->run() === TRUE) {

            //get value from submitted data
            $user_reg_data = array(
                'user_name' => trim($this->input->post('uname')),
                'user_email' => trim(strtolower($this->input->post('email'))),
                'user_password' => md5($this->input->post('password'))
            );

            //checking email id exists or not in database
            $data = $this->loginapp_model->user_email_check($user_reg_data['user_email']);
            isset($data[0]) ? $check_email = trim(strtolower($data[0]->user_email)) : $check_email = '';

            //if not exists then save on db
            if ($check_email != $user_reg_data['user_email']) {

                // Sucess New User Registration
                $new_user = $this->loginapp_model->new_user_registration($user_reg_data);
                if ($new_user == TRUE) {

                    $this->send_account_varification_link($user_reg_data['user_name'], $user_reg_data['user_email']);
                }
            }
            //send error msg on registration panel for email id already exists
            else {
                $error_message = array('alert_message' => $user_reg_data['user_email'] . " : already exists",'email_already_flag' => '1');
                $this->load->view('login_view', $error_message);
            }
        }
        //Send error message on registration panel for form validation
        else {
            $error_message = array('alert_message' => " All Field is required");
            $this->load->view('login_view', $error_message);
        }
    }

    //Send  user account  activation link
    public function send_account_varification_link($user_name, $user_email) {

        $to = $user_email;
        $encode_user_name = $this->base64_url_encode($user_name);
        $encode_user_email = $this->base64_url_encode($user_email);

        //Create a link for accoution activation
        $link = base_url() . 'login/email_activation/' . $encode_user_name . "/" . $encode_user_email;

        //Designing a template for email
        $msg = '

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

For Account Activation  Please Click On Below Link

Active Your Account

';

        //Subject for email
        $sub = "FormGet : Loginapp Account Activation";

        //Calling email sending function
        $this->GlobalMail($to, $sub, $msg);

        $this->load->view('email_verification');
    }

    function GlobalMail($to, $sub = '', $msg = '', $header = '') {

        $config = array(
            'charset' => 'utf-8',
            'wordwrap' => TRUE,
            'mailtype' => 'html'
        );

        $this->email->initialize($config);
        $this->email->set_newline("\r\n");
        $this->email->from('noreply@formget.com', $header);
        $this->email->reply_to('noreply@formget.com', 'noreply@formget.com');
        $this->email->to($to);
        $this->email->subject($sub);
        $this->email->message($msg);
        $this->email->send();
    }

    // For email Activation
    public function email_activation() {
        $user_email = $this->uri->segment(4);
        $decode_user_email = $this->base64_url_decode($user_email);
        $data = $this->loginapp_model->set_is_active($decode_user_email);
        if ($data == TRUE) {
            $this->load->view('email_activation');
        } else {
            header('Location:' . base_url() . 'login');
        }
    }

    public function login_check() {

        //get value from submitted data
        $user_login_data = array(
            'remember' => $this->input->post('remember'),
            'user_email' => trim(strtolower($this->input->post('email'))),
            'user_password' => md5($this->input->post('password'))
        );

        $data = $this->loginapp_model->login_get($user_login_data['user_email'], $user_login_data['user_password']);

        foreach ($data as $row) {
            $user_id = $row->user_id;
            $user_name = $row->user_name;
            $is_active = $row->is_active;
            $user_email = $row->user_email;
        }

        if (isset($user_id) && isset($user_name)) {
            $user_data = array(
                'user_id' => $user_id,
                'user_name' => $user_name,
                'user_email' => $user_email
            );

            if ($is_active == 1) {
                $this->loginapp_model->update_client_ip($user_data['user_email']);
                $this->session->set_userdata($user_data);

                $arr = $this->session->all_userdata();
                $u_data = serialize(array("user_id" => $arr['user_id'], "user_name" => $arr["user_name"], "user_email" => $arr["user_email"]));

                //create cookies
                if ($user_login_data['remember'] == "true") {

                    $cookie_email = array(
                        'name' => 'user_email',
                        'value' => $user_email,
                        'expire' => '31572500',
                    );

                    $cookie_name = array(
                        'name' => 'user_name',
                        'value' => $user_name,
                        'expire' => '31572500',
                    );
                    $cookie_id = array(
                        'name' => 'user_id',
                        'value' => $user_id,
                        'expire' => '31572500',
                    );

                    $this->input->set_cookie($cookie_email);
                    $this->input->set_cookie($cookie_name);
                    $this->input->set_cookie($cookie_id);
                }

                header('Location:' . base_url() . 'login/home');
            } else {
                $error = array('error' => 'Your account is not active');
                $this->load->view('login_view', $error);
            }
            // popup changes end
        } else {
            $error = array('error' => 'Username and Password NOT Found');
            $this->load->view('login_view', $error);
        }
    }

    //loding home view
    public function home() {
        $this->back_browser();

        $user_email = $this->session->userdata('user_email');
        $res = $this->loginapp_model->get_user_name($user_email);

        foreach ($res as $row) {
            $data['user_name'] = $row->user_name;
            $data['contact_no'] = $row->contact_no;
            $data['address'] = $row->address;
        }

        $this->load->view('home', $data);
    }

    //loading profile view
    public function profile() {
        $this->back_browser();
        $user_email = $this->session->userdata('user_email');
        $res = $this->loginapp_model->get_user_name($user_email);
        foreach ($res as $row) {
            $data['user_name'] = $row->user_name;
            $data['contact_no'] = $row->contact_no;
            $data['address'] = $row->address;
        }

        $this->load->view('profile', $data);
    }

    //logout and destroy the session value
    public function logout() {
        $newdata = array(
            'user_name' => '',
            'user_email' => '',
            'user_id' => '',
        );

        $this->session->unset_userdata($newdata);
        $this->session->sess_destroy();
        delete_cookie("user_email");
        delete_cookie("user_id");
        delete_cookie("user_name");
        unset($_SESSION['access_token']);
        session_destroy();
        header('Location:' . base_url() . 'login');
    }

    public function update_password() {

        $user_email = $this->session->userdata('user_email');
        $oldpassword = ($this->input->post('oldpassword'));
        $newpassword = ($this->input->post('newpassword'));
        $confirmpassword = ($this->input->post('confirmpassword'));

        $data['msg'] = $this->loginapp_model->updatepassword($user_email, $oldpassword, $newpassword, $confirmpassword);
        $res = $this->loginapp_model->get_user_name($user_email);
        foreach ($res as $row){
            $data['user_name'] = $row->user_name;
            $data['contact_no'] = $row->contact_no;
            $data['address'] = $row->address;
        }
        $this->load->view('profile', $data);
    }

    public function update_details() {
        $user_email = $this->session->userdata('user_email');
        $data = array(
            'user_name' => $this->input->post('full_name'),
            'contact_no' => $this->input->post('mobile_number'),
            'address' => $this->input->post('address')
        );
        $data['user_detail'] = $this->loginapp_model->update_details_db($user_email, $data);
        $this->load->view('profile', $data);
    }

    function base64_url_encode($input) {
        return strtr(base64_encode($input), '+/=', '+_-');
    }

    function base64_url_decode($input) {
        return base64_decode(strtr($input, '+_-', '+/='));
    }

    public function autologin() {

        $user_email = $this->input->cookie('user_email', true);
        $user_name = $this->input->cookie('user_name', true);
        $user_id = $this->input->cookie('user_id', true);

        if (!empty($user_email) && !empty($user_name)) {

            $user_data = array(
                'user_email' => $user_email,
                'user_name' => $user_name,
                'user_id' => $user_id,
            );

            $this->session->set_userdata($user_data);

            $arr = $this->session->all_userdata();
            $u_data = serialize(array("user_id" => $arr['user_id'], "user_name" => $arr["user_name"], "user_email" => $arr["user_email"]));

            header('Location:' . base_url() . 'login/home');
        }
    }

    //Making sure a web page is not cached, across all browsers
    public function back_browser() {
        header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
        header("Pragma: no-cache"); // HTTP 1.0.
        header("Expires: 0"); // Proxies.
    }

}


text:
layout: slide
title: Heads Up
---

reveal.js is a framework for easily creating beautiful presentations using HTML. You'll need a browser with support for CSS 3D transforms to see it in its full glory.

reveal-jekyll turns Markdown files to slides with the power of Jekyll.

<aside markdown="1" class="notes">
Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).
</aside>