text:
<?php

// Class to manage searches across the site, including errors that are results of search requests that do not return any results.

class SearchController extends Controller
{

    public $subLayout = "_layout";

    /**
     * @return array action filters
     */
    public function filters()
    {
        return array(
            'accessControl', // perform access control for CRUD operations
        );
    }

    /**
     * Specifies the access control rules.
     * This method is used by the 'accessControl' filter.
     * @return array access control rules
     */
    public function accessRules()
    {
        return array(
            array('allow', // allow authenticated user to perform 'create' and 'update' actions
                'users' => array('@'),
            ),
            array('deny', // deny all users
                'users' => array('*'),
            ),
        );
    }

    /**
     * SearchAction
     *
     * Modes: normal for full page, quick as partial for lightbox
     */
    public function actionIndex()
    {

        // Get Parameters
        $keyword = Yii::app()->request->getParam('keyword', "");
        $spaceGuid = Yii::app()->request->getParam('sguid', "");
        $mode = Yii::app()->request->getParam('mode', "normal");
        $page = (int) Yii::app()->request->getParam('page', 1); // current page (pagination)
        // Cleanup
        $keyword = Yii::app()->input->stripClean($keyword);
        $spaceGuid = Yii::app()->input->stripClean($spaceGuid);

        if ($mode != 'quick') {
            $mode = "normal";
        }

        $limit = HSetting::Get('paginationSize');         // Show Hits
        $hitCount = 0;      // Total Hit Count
        $query = "";        // Lucene Query
        $append = " AND (model:User OR model:Space)";  // Appends for Lucene Query
        $moreResults = false;  // Indicates if there are more hits
        $results = array();

        // Quick Search shows always 1
        if ($mode == 'quick')
            $limit = 5;

        // Load also Space if requested
        $currentSpace = null;
        if ($spaceGuid) {
            $currentSpace = Space::model()->findByAttributes(array('guid' => $spaceGuid));
        }

        // Zend Framework files need to have 777 permissions to them (writable by the web service) or the app can't function and it throws an exception
        /*
         * $index = new Zend_Search_Lucene_Interface_MultiSearcher();
         * $index->addIndex(Zend_Search_Lucene::open('search/index1'));
         * $index->addIndex(Zend_Search_Lucene::open('search/index2'));
         * $index->find('someSearchQuery');
         */

        // Do Search
        if ($keyword != "") {

            if ($currentSpace != null) {
                $append = " AND (model:User OR model:Space OR (belongsToType:Space AND belongsToId:" . $currentSpace->id . "))";
            }

            $hits = new ArrayObject(HSearch::getInstance()->Find($keyword . "* " . $append));
            $hitCount = count($hits);

            // Limit Hits
            $hits = new LimitIterator($hits->getIterator(), ($page - 1) * $limit, $limit);

            if ($hitCount > $limit)
                $moreResults = true;

            // Build Results Array
            foreach ($hits as $hit) {

                $doc = $hit->getDocument();
                $model = $doc->getField('model')->value;
                $pk = $doc->getField('pk')->value;

                $object = $model::model()->findByPk($pk);
                $results[] = $object->getSearchResult();
            }
        }

        // Create Pagination Class
        $pages = new CPagination($hitCount);
        $pages->setPageSize($limit);
        $_GET['keyword'] = $keyword; // Fix for post var

        if ($mode == 'quick') {
            $this->renderPartial('quick', array(
                'keyword' => $keyword,
                'results' => $results,
                'spaceGuid' => $spaceGuid,
                'moreResults' => $moreResults,
                'hitCount' => $hitCount,
            ));
        } else {
            $this->render('index', array(
                'keyword' => $keyword,
                'results' => $results,
                'spaceGuid' => $spaceGuid,
                'moreResults' => $moreResults,
                'pages' => $pages, // CPagination,
                'pageSize' => $limit,
                'hitCount' => $hitCount,
            ));
        }
    }

    /**
     * JSON Search interface for Mentioning
     */
    public function actionMentioning()
    {

        $results = array();
        $keyword = Yii::app()->request->getParam('keyword', "");
        $keyword = Yii::app()->input->stripClean(trim($keyword));

        if (strlen($keyword) >= 3) {
            $hits = new ArrayObject(HSearch::getInstance()->Find($keyword . "*  AND (model:User OR model:Space)"));
            $hitCount = count($hits);

            $hits = new LimitIterator($hits->getIterator(), 0, 10);

            foreach ($hits as $hit) {

                $doc = $hit->getDocument();
                $model = $doc->getField('model')->value;
                $pk = $doc->getField('pk')->value;

                $object = $model::model()->findByPk($pk);

                if ($object !== null && $object instanceof HActiveRecordContentContainer) {
                    $result = array();
                    $result['guid'] = $object->guid;
                    if ($object instanceof Space) {
                        $result['name'] = CHtml::encode($object->name);
                        $result['type'] = 's';
                    } elseif  ($object instanceof User) {
                        $result['name'] = CHtml::encode($object->displayName);
                        $result['type'] = 'u';
                    }
                    $result['image'] = $object->getProfileImage()->getUrl();
                    $result['link'] = $object->getUrl();
                    $results[] = $result;
                }
            }
        }

        print CJSON::encode($results);
    }

}


text:
class CreateParties < ActiveRecord::Migration[5.1]
  def change
    create_table :parties do |t|
      t.string :short_name, null:false
      t.string :full_name, null: false

      t.timestamps
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package se.ugli.habanero.j;

import static se.ugli.java.util.stream.Collectors.toImmutableMap;

import java.sql.Blob;
import java.sql.Clob;
import java.sql.ResultSet;
import java.util.Optional;
import java.util.function.Function;

import se.ugli.habanero.j.internal.BlobReader;
import se.ugli.habanero.j.internal.ClobReader;
import se.ugli.habanero.j.metadata.ResultSetMetaData;
import se.ugli.java.util.ImmutableMap;
import se.ugli.java.util.ImmutableSet;
import se.ugli.java.util.Try;

public class ResultTupleFactory implements Function<ResultSet, ResultTuple> {

    @Override
    public ResultTuple apply(final ResultSet resultSet) {
        return new ResultTupleImpl(ResultSetMetaData.apply(resultSet).getColumnLabels()
                .collect(toImmutableMap(c -> c.toLowerCase(), c -> columnValue(resultSet, c))));
    }

    private static Object columnValue(final ResultSet resultSet, final String column) {
        final Object columnValue = Try.runtime(() -> resultSet.getObject(column), HabaneroException::new);
        if (columnValue instanceof Clob)
            return ClobReader.read((Clob) columnValue);
        else if (columnValue instanceof Blob)
            return BlobReader.read((Blob) columnValue);
        return columnValue;
    }

    private static class ResultTupleImpl implements ResultTuple {

        private final ImmutableMap<String, Object> map;
        private final ImmutableSet<String> names;

        ResultTupleImpl(final ImmutableMap<String, Object> map) {
            this.map = map;
            names = map.keySet();
        }

        @Override
        public Optional<Object> get(final String name) {
            return map.get(name);
        }

        @SuppressWarnings("unchecked")
        @Override
        public <T> Optional<T> get(final Class<T> type, final String name) {
            return get(name).map(e -> (T) Habanero.getTypeAdaptor(type).toTypeValue(type, e));
        }

        @Override
        public ImmutableSet<String> names() {
            return names;
        }

        @Override
        public String toString() {
            return map.toString();
        }

    }

}


text:
$(document).ready(function() {
	'use strict';

	// jQuery objGITs
	var $timer  = $('#timer'),
		$inputs = $timer.find('input'),
		hoursInput = function () { return parseFloat( $inputs[0].value ); },
		minsInput  = function () { return parseFloat( $inputs[1].value ); },
		secsInput  = function () { return parseFloat( $inputs[2].value ); },
		$start = $("#start"),
		$reset = $("#reset");

	// Constants
	var	START = null,
		END = null,
		LENGTH = 0,
		TS = null,
		TIMEOUT = null,
		SELECTED = null,
		IS_STOPPED = true,
		UNITS = countdown.HOURS|countdown.MINUTES|countdown.SECONDS; // For countdown.js

	// CANVAS
	var canvas = document.getElementById('progress'),
		context = canvas.getContext('2d'),
		X = canvas.width / 2,
		Y = canvas.height / 2,
		RADIUS = 100,
		CIRC = Math.PI * 2,
		QUART = Math.PI / 2;

	// Reset page on refresh
	resetUI();

	//
	// HANDLERS
	//

	$inputs.keyup(function(event) {

		// Only allow digits in input boxes
		var value = parseFloat( this.value.replace(/\D+/g, '') );

		// No negative values
		if (value < 0 || isNaN(value) ) {
			value = 0;
		}

		// Set changed value
		$(this).val( value );

		// enable 'Start' button when timer
		// has positive value
		if (IS_STOPPED){
			$start.addClass('disabled');
			$inputs.each(function(index, el) {
				if (el.value > 0) {
					$start.removeClass('disabled');
				}
			});
		}

		// Un-focus inputs when "Enter" pressed
		// restart timer with new values
		if (event.key === "Enter" || event.key === "Tab") {
			$inputs.blur();
			IS_STOPPED = false;

			// create new timer
			setUI();
		}

	}).keydown(function(event) {

		var value = parseFloat( this.value.replace(/\D+/g, '') ),
			charCode = event.which || event.keyCode;

		// up arrow pressed
		if (charCode === 38) {
			value+= 1;

		// down arrow pressed
		} else if (charCode === 40) {
			value-= 1;
		}

		// No negative values
		if (value < 0 || isNaN(value) ) {
			value = 0;
		}

		// Set changed value
		$(event.target).val( value );

	}).click(function() {
		// ignore if already selected,
		// to allow cursor placement
		if (SELECTED === this) { return false; }
		SELECTED = this;
		this.select();

	}).change(function() {
		// create new timer
		setUI();
	});

	// Create countdown and animate
	// progress circle
	$start.click(function() {

		// 'Start' button pressed
		if (IS_STOPPED) {

			IS_STOPPED = false;

			var continue_timer = false;
			$inputs.each(function(index, el) {
				if (el.value > 0) {
					continue_timer = true;
				}
			});

			// create new timer
			setUI(continue_timer);
		}

		// 'Stop' button pressed
		else {
			IS_STOPPED = true;
			$start.text('Start').removeClass('btn-danger').addClass('btn-success');
			clearTimers();
			return false;
		}
	});

	$reset.click(function() {
		resetUI();
	});

	//
	// HELPERS
	//

	function setUI (continue_timer) {

		$start.text('Stop').removeClass('btn-success').addClass('btn-danger');

		// If not continuing from stopped state
		if (!(START && continue_timer)) {
			clearTimers();
			START = new Date();
		}

		END = new Date();

		// Add up timer input durations
		END.setSeconds( END.getSeconds() + secsInput() );
		END.setMinutes( END.getMinutes() + minsInput() );
		END.setHours( END.getHours() + hoursInput() );

		LENGTH = END - START;

		// Prevent counting up if "Enter"
		// pressed before time is entered
		if (LENGTH <= 0) {
			resetUI();
			return false;
		} else {
			$start.removeClass('disabled');
			$reset.removeClass('disabled');
		}

		// Create new countdown
		TS = countdown(
			function (ts) {

				// Update input values for non-focused inputs
				$inputs.not(':focus').each(function() {
					$(this).val(ts[this.id]);
				});

				// Timer finished
				if (ts.value <= 0) {
					clearTimers();
					$start.text('Start').removeClass('btn-danger').addClass('btn-success disabled');
					return;
				}
			},
			END,
			UNITS
		);

		// Update progress circle
		TIMEOUT = setInterval(updateUI, 1);
	}

	// Calculate percent completion
	// and draw to canvas accordingly
	function updateUI() {
		var percent = ($.now() - START) / LENGTH;
		animate(percent);
	}

	// Reset all UI elements
	// and clear timers
	function resetUI() {

		// Set inputs to 0
		$inputs.val(0);

		// Clear Canvas
		context.clearRect(0, 0, canvas.width, canvas.height);

		// Reset Start button
		$start.text('Start').removeClass('btn-danger').addClass('btn-success disabled');

		clearTimers();

		// reset state
		START = null;
		END = null;
		IS_STOPPED = true;
	}

	// Clear all interval timers
	function clearTimers(){
		window.clearInterval(TS);
		window.clearInterval(TIMEOUT);
	}

	// Draw circle to canvas
	function animate(percent) {
		var start = -(QUART),
		end = (CIRC * percent) - QUART;

		context.clearRect(0, 0, canvas.width, canvas.height);

		// outer circle
		context.beginPath();
		context.lineWidth = 2;
		context.strokeStyle = '#777';
		context.arc(X, Y, RADIUS+8, start, CIRC, false);
		context.stroke();

		// progress circle
		context.beginPath();
		context.lineWidth = 10;
		context.strokeStyle = '#ad2323';
		context.arc(X, Y, RADIUS, start, end, false);
		context.stroke();
	}
});


text:
package org.quartzpowered.protocol.codec.indentifier.common.client;

import org.quartzpowered.network.buffer.Buffer;
import org.quartzpowered.network.protocol.codec.Codec;
import org.quartzpowered.protocol.data.component.TextComponent;
import org.quartzpowered.protocol.packet.common.client.KickPacket;

public class KickCodec implements Codec<KickPacket> {
    @Override
    public void encode(Buffer buffer, KickPacket packet) {
        buffer.writeString(packet.getMessage().toJson());
    }

    @Override
    public void decode(Buffer buffer, KickPacket packet) {
        packet.setMessage(TextComponent.fromJson(buffer.readString()));
    }
}


text:
var WebSocket = require('faye-websocket');
var Async = require('async');
var Events = require('events');
var Util = require('util');
var Path = require('path');
var Debug = require('debug')('myriad')
var NPM = require('./npm');

var Connection = function(options, callback) {
  if (!(this instanceof Connection)) return new Connection(options, callback);

  var self = this;

  Events.EventEmitter.call(self);

  if (options) {
    self.connect(options, callback);
  }
}

Util.inherits(Connection, Events.EventEmitter);

Connection.prototype.connect = function(options, callback) {
  var self = this;

  if (callback) {
    Debug("Has callback");
    self.on('connect', callback);
  }

  Debug("Connecting to " + options.url);
  self._socket = new WebSocket.Client(options.url);
  Debug("Started connecting");

  self._socket.on('open', function(event) {
    Debug("Received open event");
    self.emit('connect', {});
  });

  self._socket.on('error', function(event) {
    Debug("Received error event");
    Debug(event);
    self.emit('error', { message: event.message });
  });

  self._socket.on('close', function(event) {
    Debug("Received close event");
    self._socket = null;
    self.emit('close', {});
  });

  self._socket.on('message', function(event) {
    Debug("Received message event");
    event = JSON.parse(event.data);
    Debug("Received " + event.event + " message");
    self.emit('message', event);
  });
}

Connection.prototype.spawn = function(options) {
  var self = this;

  if (options.localPackage !== true && options.localPackage !== false) {
    Debug("Defaulting localPackage to true");
    options.localPackage = true;
  }

  Async.waterfall(
    [
      function(callback) {
        if (options.localPackage) {
          var package = Path.resolve(options.package);
          Debug('Using local package ' + package);
          callback(null, package);
        }
        else if (options.package instanceof Buffer) {
          Debug('Package has already been packed');
          callback(null, options.package);
        }
        else {
          NPM.pack({ package: options.package }, function(err, package) {
            if (err) {
              callback({ message: "Failed to pack the package", error: err });
            }
            else {
              Debug('Packed package ' + options.package);
              callback(null, package.toString('base64'));
            }
          });
        }
      }
    ],
    function(err, package) {
      if (err) {
        // No event listeners registered yet so wait for next tick
        process.nextTick(function() {
          self.emit('error', err);
        });
      }
      else {
        var data = {
          package: package,
          localPackage: options.localPackage,
          bin: options.bin,
          args: options.args,
          env: options.env
        }

        self.send({ event: 'spawn', data: data });
      }
    }
  );
};

Connection.prototype.send = function(options) {
  var self = this;

  Debug("Sending event " + options.event);
  self._socket.send(JSON.stringify({ event: options.event, data: options.data }));
};

Connection.prototype.close = function(callback) {
  var self = this;

  if (callback) {
    self.on('close', callback);
  }

  Debug('Closing');
  self._socket.close();
}

module.exports = Connection;


text:
require "test_helper"

describe DataCategory do
  let(:data_category) { DataCategory.new }

  it "must be valid" do
    value(data_category).must_be :valid?
  end
end


text:
<!DOCTYPE html>

        <title>Announcing vue-cli — Sanskrit Notes संस्कृत टिप्पणी</title>
        <meta charset="utf-8">
        <meta name="description" content="Sanskrit Notes संस्कृत टिप्पणी - A easy modern introduction to the ancient language.">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

        <meta property="og:type" content="article">
        <meta property="og:title" content="Announcing vue-cli — Vue.js">
        <meta property="og:description" content="Sanskrit Notes संस्कृत टिप्पणी - A easy modern introduction to the ancient language.">
        <meta property="og:image" content="https://sanskritnotes.com//images/logo.png">

        <meta name="twitter:card" content="summary">
        <meta name="twitter:title" content="Announcing vue-cli — Vue.js">
        <meta name="twitter:description" content="Sanskrit Notes संस्कृत टिप्पणी - A easy modern introduction to the ancient language.">
        <meta name="twitter:image" content="https://sanskritnotes.com/images/logo.png">

        <link rel="icon" href="/images/logo.png" type="image/x-icon">

        <link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono' rel='stylesheet' type='text/css'>
        <link href='//fonts.googleapis.com/css?family=Dosis:500&text=Vue.js' rel='stylesheet' type='text/css'>

        <link rel="stylesheet" href="/css/page.css">

    Sanskrit Notes संस्कृत टिप्पणी

  <form id="search-form">
    <input type="text" id="search-query-nav" class="search-query st-default-search-input">
  </form>

Notes

  <form id="search-form">
    <input type="text" id="search-query-nav" class="search-query st-default-search-input">
  </form>

Notes

            Recent Posts

                Announcing Vue.js 2.0

                March 2016 Update

                Common Beginner Gotchas

                Announcing vue-cli

                Why Vue.js doesn't support templateURL

                Vue.js 1.0.0 Released

                Vue.js 0.12 released!

                0.11 Component Tips

                Vue.js 0.11 released!

                Vue.js 0.10.6, and what's next

Announcing vue-cli

Dec 28, 2015

Recently there has been a lot of discussion around the tooling hurdle when you start a React project. Luckily for Vue.js, all you need to do to start with a quick prototype is including it from a CDN via a <script> tag, so we've got that part covered. However, that's not how you'd build a real world application. In real world applications we inevitably need a certain amount of tooling to give us modularization, transpilers, pre-processors, hot-reload, linting and testing. These tools are necessary for the long-term maintainability and productivity of large projects, but the initial setup can be a big pain. This is why we are announcing vue-cli, a simple CLI tool to help you quickly scaffold Vue.js projects with opinionated, battery-included build setups.

Just The Scaffolding

The usage looks like this:

npm install -g vue-cli

vue init webpack my-project

# answer prompts

cd my-project

npm install

npm run dev # tada!

All the CLI does is pulling down templates from the vuejs-templates organization on GitHub. Dependencies are handled via NPM, and build tasks are simply NPM scripts.

Official Templates

The purpose of official Vue project templates is providing opinionated, battery-included development tooling setups so that users can get started with actual app code as fast as possible. However, these templates are un-opinionated in terms of how you structure your app code and what libraries you use in addition to Vue.js.

All official project templates are repos in the vuejs-templates organization. When a new template is added to the organization, you will be able to run vue init <template-name> <project-name> to use that template. You can also run vue list to see all available official templates.

Current available templates include:

browserify - A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.

browserify-simple - A simple Browserify + vueify setup for quick prototyping.

webpack - A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.

webpack-simple - A simple Webpack + vue-loader setup for quick prototyping.

Bring Your Own Setup

If you are not happy with the official templates, you can fork these templates, modify them to fit your specific needs (or even create your own from scratch), and use them via vue-cli too, because vue-cli can work directly on GitHub repos:

vue init username/repo my-project

Vue Components Everywhere

There are different templates for different purposes: simple setups for quick prototyping, and full-featured setups for ambitious applications. A common feature among these templates though, is that they all support *.vue single file components. This means any third party Vue components written as valid *.vue files can be shared among projects using these setups, and simply be distributed over NPM - let's create more reusable components!

        <link href="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="/css/search.css">


text:
package oic.simulator.serviceprovider.utils;

import org.oic.simulator.serviceprovider.AutomationType;

/**
 * This class maintains all constants which are used throughout the service
 * provider plug-in.
 */
public class Constants {

    public static final String         CONFIG_DIRECTORY_PATH            = "/resource";

    public static final String         UNDERSCORE                       = "_";
    public static final String         FORWARD_SLASH                    = "/";

    public static final String         OIC_PREFIX                       = "/oic/r";
    public static final String         SIMULATOR                        = "simulator";

    public static final String         RESOURCE_URI                     = "Resource URI";
    public static final String         RESOURCE_TYPE                    = "Resource Type";
    public static final String         RESOURCE_UID                     = "Resource ID";
    public static final String         CONNECTIVITY_TYPE                = "Connectivity Type";

    public static final String[]       META_PROPERTIES                  = {
            RESOURCE_URI, RESOURCE_TYPE, CONNECTIVITY_TYPE             };

    public static final int            META_PROPERTY_COUNT              = META_PROPERTIES.length;

    public static final String         ENABLE                           = "Enable";
    public static final String         DISABLE                          = "Disable";
    public static final String         ENABLED                          = "Enabled";
    public static final String         DISABLED                         = "Disabled";

    public static final String         AUTOMATION                       = "Automation";
    public static final String         AUTOMATION_TYPE                  = "Automation Type";
    public static final String         UPDATE_INTERVAL_IN_MS            = "Update Interval(ms)";

    public static final String[]       AUTOMATION_SETTINGS              = {
            AUTOMATION_TYPE, UPDATE_INTERVAL_IN_MS                     };

    public static final int            AUTOMATION_SETTINGS_COUNT        = AUTOMATION_SETTINGS.length;

    public static final String         START_RESOURCE_AUTOMATION        = "Start Automation";
    public static final String         STOP_RESOURCE_AUTOMATION         = "Stop Automation";

    public static final int            DISPLAY_RESOURCE_URI_TOKEN_COUNT = 2;

    public static final AutomationType DEFAULT_AUTOMATION_TYPE          = AutomationType.NORMAL;

    public static final int            DEFAULT_AUTOMATION_INTERVAL      = 500;

    public static final int            PROPER_LOG_TIME_TOKEN_LENGTH     = 3;

    public static final String[]       BROWSE_RAML_FILTER_EXTENSIONS    = new String[] { "*.raml" };
    public static final String[]       SAVE_LOG_FILTER_EXTENSIONS       = new String[] {
            "*.log", "*"                                               };

    public static final int            LOG_SIZE                         = 1000;

    public static final String         INFO_LOG                         = "info_log";
    public static final String         WARNING_LOG                      = "warning_log";
    public static final String         ERROR_LOG                        = "error_log";
    public static final String         DEBUG_LOG                        = "debug_log";
    public static final String         UNKNOWN_LOG                      = "unknown_log";

    public static final String         INFO                             = "Info";
    public static final String         WARNING                          = "Warning";
    public static final String         ERROR                            = "Error";
    public static final String         DEBUG                            = "Debug";
    public static final String         UNKNOWN                          = "Unknown";

    public static final String         CHECKED                          = "Checked";
    public static final String         UNCHECKED                        = "Unchecked";
    public static final String         NOTIFY_BUTTON_SELECTED           = "Notify_Selected";
    public static final String         NOTIFY_BUTTON_UNSELECTED         = "Notify_Unselected";

    public static final String         CREATE_PAGE_TITLE                = "Create Resource";
    public static final String         CREATE_PAGE_MESSAGE              = "Select a standard resource or custom resource to be created";

    public static final String         DELETE_PAGE_TITLE                = "Delete Resource";
    public static final String         DELETE_PAGE_MESSAGE              = "Select the resource(s) to be deleted";

    public static final String         RAML_FILE_PREFIX                 = "/resource/";

    public static final String         RAML_FILE_EXTENSION              = ".raml";
    public static final String         JSON_FILE_EXTENSION              = ".json";

    public static final String         SPLIT_BY_DOT_PATTERN             = "\\.";

    public static final String         SAMPLE_LIGHT                      = "sample.light";
}


text:
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif

#import "GMUWrappingDictionaryKey.h"

@implementation GMUWrappingDictionaryKey {
  id _object;
}

- (instancetype)initWithObject:(id)object {
  if ((self = [super init])) {
    _object = object;
  }
  return self;
}

- (id)copyWithZone:(NSZone *)zone {
  GMUWrappingDictionaryKey *newKey = [[self class] allocWithZone:zone];
  if (newKey) {
    newKey->_object = _object;
  }
  return newKey;
}

// Forwards hash to _object.
- (NSUInteger)hash {
  return [_object hash];
}

// Forwards isEqual to _object.
- (BOOL)isEqual:(id)object {
  if (self == object) return YES;

  if ([object class] != [self class]) return NO;

  GMUWrappingDictionaryKey *other = (GMUWrappingDictionaryKey *)object;
  return [_object isEqual:other->_object];
}

@end


text:
using UnityEngine;
using System.Collections;

namespace ValueObjects {
	public class SubjectVO {
		public string name {get; set;}
		public string group_id {get; set;}
		public string key {get; set;}

	}
}


text:
package bootstrap

import "hivejam/common"
import "hivejam/config"
import "hivejam/data"

import "log"
import "os"
import "time"

import _ "github.com/jteeuwen/go-bindata"
import "github.com/scgolang/osc"

var oscClient = common.Connect(*config.Flags.SpIp, *config.Flags.SpPort)
var BootComplete = make(chan bool)

func send(address, message string) error {
	oscMessage, err := osc.NewMessage(address)
	if err != nil {
		return err
	}
	oscMessage.WriteString("hivejam/bootstrap")
	if message != "" {
		oscMessage.WriteString(message)
	}
	err = oscClient.Send(oscMessage)
	if err != nil {
		return err
	}
	return nil
}

func ping() error {
	return send("/ping", "")
}

func upload(filename string) error {
	data, err := data.Asset(filename)
	if err != nil {
		return err
	}
	return send("/run-code", string(data))
}

func fail(err, msg string) {
	if err != "" {
		log.Print(err)
	}
	log.Print(msg)
	os.Exit(1)
}

var files = [...]string{
	"ruby/lib/hivejam/state.rb",
	"ruby/lib/hivejam/params.rb",
	"ruby/lib/hivejam/dispatch.rb",
	"ruby/server.rb",
}

func Boot() {
	timeout := make(chan bool, 1)
	go func() {
		time.Sleep(time.Duration(*config.Flags.BootstrapTimeoutSeconds) * time.Second)
		timeout <- true
	}()
	for i := 0; i < 10; i++ {
		err := ping()
		if err != nil {
			fail(err.Error(), "Have you started Sonic Pi?")
		}
	}
	rubyConfig, err := config.RubyConfig()
	if err != nil {
		fail(err.Error(), "Error generating Ruby config")
	}
	err = send("/run-code", string(rubyConfig))
	if err != nil {
		fail(err.Error(), "Error uploading Ruby config")
	}
	for _, file := range files {
		// Give the files a moment to be interpretted.
		time.Sleep(100 * time.Millisecond)
		err := upload(file)
		if err != nil {
			fail(err.Error(), "Error uploading file "+file)
		}
	}
	select {
	case <- BootComplete:
	case <- timeout:
		fail("", "Timeout while waiting for Hive Jam to bootstrap. Check Sonic Pi UI for errors.")
	}
	log.Print("Bootstrapping complete.")
}


text:
<TITLE>Review for Dear God (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Dear God (1996)

reviewed by
Tim Voon

                              DEAR GOD 1996
                      A film review by Timothy Voon
                       Copyright 1998 Timothy Voon
                   2 :-( :-(  for answering God's mail

Cast: Greg Kinnear, Laurie Metcalf, Maria Pitillo, Tim Conway, Roscoe
Lee Browne, Jen Seda, Hector Elizondo
Director: Garry Marshall
Screenplay: Warren Leight and Ed Kaplan Cinematography: Charles Minsky

When a con artist (Greg Kinear) is given the choice of prison or
community service, it's not surprising he chooses service – being a
pretty boy. In the dungeons of a mailroom, he is given the task of
sorting dead mail, with an odd ball group of socially impaired
co-workers. When they take to the habit of opening 'Dear God' letters,
and then answering them – i.e. giving away money, stopping suicides,
babysitting etc, they begin to find some common purpose in life.

So why doesn't this premise for a feel good movie work? Well there isn't
a specific reason why, just a lot of little annoying things that seem to
weigh it down. Like the constant whining of Laurie Metcalf (ROSEANNE's
sister), the general low IQ of the actors, the annoyingly tedious ways
of getting a miracle to happen. I know they're not angels, but at least
God has a plan. It's surprising that this severely, dysfunctional group,
are able to put a single constructive idea together between them. I
guess I should count my blessings, and include this as one of God's
miracles.

The movie then takes another tedious downward turn, when the City of New
York decides to take this group of muffin heads to court for answering
'Dear God' letters. When they win the case and everyone starts rejoicing
in the city streets, one would have thought they had just discovered the
cure for AIDS. Now that would be a worthwhile miracle in response to a
'Dear God' letter.

Greg Kinnear once again plays cute - something he does well i.e.
SABRINA, AS GOOD AS IT GETS. Whilst director, Garry Marshall, has chosen
an unusual subject material for his latest movie, far removed from the
PRETTY WOMAN stuff he is renown for.

In future, let God answer his own letters.

Timothy Voon
e-mail: stirling@netlink.com.au
Movie Archives http://us.imdb.com/M/reviews_by?Tim+Voon
Hugues Bouclier's Movies in Melbourne
http://www.labyrinth.net.au/~bouclier/week/movies.html

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
using System;
using System.Linq;
using AlexaCore.Content;
using AlexaCore.Web;

namespace AlexaCore.Tests.Content
{
    class TestContentService : ContentService<IntentContent>
    {
        private readonly IHttpClient _httpClient;

        public TestContentService(PersistentQueue<ApplicationParameter> applicationParameters, string userId, IHttpClient httpClient = null)
            : base(applicationParameters, userId)
        {
            _httpClient = httpClient;
        }

        public override IHttpClient BuildClient()
        {
            return _httpClient ?? base.BuildClient();
        }

        public override Uri BaseAddress => new Uri("http://www.source.co.uk");

        public override string RequestUri(string intentKey, string userId, RequestParameters additionalRequestParameters)
        {
            if (additionalRequestParameters.Parameters.Any())
            {
                return
                    $"/url/intents/{intentKey}?j=1&userId={userId}&{String.Join("&", additionalRequestParameters.Parameters.Select(a => $"{a.Key}={a.Value}"))}";
            }

            return $"/url/intents/{intentKey}?j=1&userId={userId}";
        }
    }
}


text:
package kms

import (
	"github.com/aws/aws-sdk-go/private/protocol"
)

const (

	// ErrCodeAlreadyExistsException for service response error code
	// "AlreadyExistsException".
	//
	// The request was rejected because it attempted to create a resource that already
	// exists.
	ErrCodeAlreadyExistsException = "AlreadyExistsException"

	// ErrCodeCloudHsmClusterInUseException for service response error code
	// "CloudHsmClusterInUseException".
	//
	// The request was rejected because the specified AWS CloudHSM cluster is already
	// associated with a custom key store or it shares a backup history with a cluster
	// that is associated with a custom key store. Each custom key store must be
	// associated with a different AWS CloudHSM cluster.
	//
	// Clusters that share a backup history have the same cluster certificate. To
	// view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
	// operation.
	ErrCodeCloudHsmClusterInUseException = "CloudHsmClusterInUseException"

	// ErrCodeCloudHsmClusterInvalidConfigurationException for service response error code
	// "CloudHsmClusterInvalidConfigurationException".
	//
	// The request was rejected because the associated AWS CloudHSM cluster did
	// not meet the configuration requirements for a custom key store.
	//
	//    * The cluster must be configured with private subnets in at least two
	//    different Availability Zones in the Region.
	//
	//    * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
	//    (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
	//    rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
	//    rules and the Destination in the outbound rules must match the security
	//    group ID. These rules are set by default when you create the cluster.
	//    Do not delete or change them. To get information about a particular security
	//    group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
	//    operation.
	//
	//    * The cluster must contain at least as many HSMs as the operation requires.
	//    To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
	//    operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
	//    operations, the AWS CloudHSM cluster must have at least two active HSMs,
	//    each in a different Availability Zone. For the ConnectCustomKeyStore operation,
	//    the AWS CloudHSM must contain at least one active HSM.
	//
	// For information about the requirements for an AWS CloudHSM cluster that is
	// associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
	// in the AWS Key Management Service Developer Guide. For information about
	// creating a private subnet for an AWS CloudHSM cluster, see Create a Private
	// Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
	// in the AWS CloudHSM User Guide. For information about cluster security groups,
	// see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
	// in the AWS CloudHSM User Guide .
	ErrCodeCloudHsmClusterInvalidConfigurationException = "CloudHsmClusterInvalidConfigurationException"

	// ErrCodeCloudHsmClusterNotActiveException for service response error code
	// "CloudHsmClusterNotActiveException".
	//
	// The request was rejected because the AWS CloudHSM cluster that is associated
	// with the custom key store is not active. Initialize and activate the cluster
	// and try the command again. For detailed instructions, see Getting Started
	// (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html)
	// in the AWS CloudHSM User Guide.
	ErrCodeCloudHsmClusterNotActiveException = "CloudHsmClusterNotActiveException"

	// ErrCodeCloudHsmClusterNotFoundException for service response error code
	// "CloudHsmClusterNotFoundException".
	//
	// The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster
	// with the specified cluster ID. Retry the request with a different cluster
	// ID.
	ErrCodeCloudHsmClusterNotFoundException = "CloudHsmClusterNotFoundException"

	// ErrCodeCloudHsmClusterNotRelatedException for service response error code
	// "CloudHsmClusterNotRelatedException".
	//
	// The request was rejected because the specified AWS CloudHSM cluster has a
	// different cluster certificate than the original cluster. You cannot use the
	// operation to specify an unrelated cluster.
	//
	// Specify a cluster that shares a backup history with the original cluster.
	// This includes clusters that were created from a backup of the current cluster,
	// and clusters that were created from the same backup that produced the current
	// cluster.
	//
	// Clusters that share a backup history have the same cluster certificate. To
	// view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
	// operation.
	ErrCodeCloudHsmClusterNotRelatedException = "CloudHsmClusterNotRelatedException"

	// ErrCodeCustomKeyStoreHasCMKsException for service response error code
	// "CustomKeyStoreHasCMKsException".
	//
	// The request was rejected because the custom key store contains AWS KMS customer
	// master keys (CMKs). After verifying that you do not need to use the CMKs,
	// use the ScheduleKeyDeletion operation to delete the CMKs. After they are
	// deleted, you can delete the custom key store.
	ErrCodeCustomKeyStoreHasCMKsException = "CustomKeyStoreHasCMKsException"

	// ErrCodeCustomKeyStoreInvalidStateException for service response error code
	// "CustomKeyStoreInvalidStateException".
	//
	// The request was rejected because of the ConnectionState of the custom key
	// store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
	// operation.
	//
	// This exception is thrown under the following conditions:
	//
	//    * You requested the CreateKey or GenerateRandom operation in a custom
	//    key store that is not connected. These operations are valid only when
	//    the custom key store ConnectionState is CONNECTED.
	//
	//    * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
	//    on a custom key store that is not disconnected. This operation is valid
	//    only when the custom key store ConnectionState is DISCONNECTED.
	//
	//    * You requested the ConnectCustomKeyStore operation on a custom key store
	//    with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
	//    for all other ConnectionState values.
	ErrCodeCustomKeyStoreInvalidStateException = "CustomKeyStoreInvalidStateException"

	// ErrCodeCustomKeyStoreNameInUseException for service response error code
	// "CustomKeyStoreNameInUseException".
	//
	// The request was rejected because the specified custom key store name is already
	// assigned to another custom key store in the account. Try again with a custom
	// key store name that is unique in the account.
	ErrCodeCustomKeyStoreNameInUseException = "CustomKeyStoreNameInUseException"

	// ErrCodeCustomKeyStoreNotFoundException for service response error code
	// "CustomKeyStoreNotFoundException".
	//
	// The request was rejected because AWS KMS cannot find a custom key store with
	// the specified key store name or ID.
	ErrCodeCustomKeyStoreNotFoundException = "CustomKeyStoreNotFoundException"

	// ErrCodeDependencyTimeoutException for service response error code
	// "DependencyTimeoutException".
	//
	// The system timed out while trying to fulfill the request. The request can
	// be retried.
	ErrCodeDependencyTimeoutException = "DependencyTimeoutException"

	// ErrCodeDisabledException for service response error code
	// "DisabledException".
	//
	// The request was rejected because the specified CMK is not enabled.
	ErrCodeDisabledException = "DisabledException"

	// ErrCodeExpiredImportTokenException for service response error code
	// "ExpiredImportTokenException".
	//
	// The request was rejected because the specified import token is expired. Use
	// GetParametersForImport to get a new import token and public key, use the
	// new public key to encrypt the key material, and then try the request again.
	ErrCodeExpiredImportTokenException = "ExpiredImportTokenException"

	// ErrCodeIncorrectKeyException for service response error code
	// "IncorrectKeyException".
	//
	// The request was rejected because the specified CMK cannot decrypt the data.
	// The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request
	// must identify the same CMK that was used to encrypt the ciphertext.
	ErrCodeIncorrectKeyException = "IncorrectKeyException"

	// ErrCodeIncorrectKeyMaterialException for service response error code
	// "IncorrectKeyMaterialException".
	//
	// The request was rejected because the key material in the request is, expired,
	// invalid, or is not the same key material that was previously imported into
	// this customer master key (CMK).
	ErrCodeIncorrectKeyMaterialException = "IncorrectKeyMaterialException"

	// ErrCodeIncorrectTrustAnchorException for service response error code
	// "IncorrectTrustAnchorException".
	//
	// The request was rejected because the trust anchor certificate in the request
	// is not the trust anchor certificate for the specified AWS CloudHSM cluster.
	//
	// When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr),
	// you create the trust anchor certificate and save it in the customerCA.crt
	// file.
	ErrCodeIncorrectTrustAnchorException = "IncorrectTrustAnchorException"

	// ErrCodeInternalException for service response error code
	// "KMSInternalException".
	//
	// The request was rejected because an internal exception occurred. The request
	// can be retried.
	ErrCodeInternalException = "KMSInternalException"

	// ErrCodeInvalidAliasNameException for service response error code
	// "InvalidAliasNameException".
	//
	// The request was rejected because the specified alias name is not valid.
	ErrCodeInvalidAliasNameException = "InvalidAliasNameException"

	// ErrCodeInvalidArnException for service response error code
	// "InvalidArnException".
	//
	// The request was rejected because a specified ARN, or an ARN in a key policy,
	// is not valid.
	ErrCodeInvalidArnException = "InvalidArnException"

	// ErrCodeInvalidCiphertextException for service response error code
	// "InvalidCiphertextException".
	//
	// From the Decrypt or ReEncrypt operation, the request was rejected because
	// the specified ciphertext, or additional authenticated data incorporated into
	// the ciphertext, such as the encryption context, is corrupted, missing, or
	// otherwise invalid.
	//
	// From the ImportKeyMaterial operation, the request was rejected because AWS
	// KMS could not decrypt the encrypted (wrapped) key material.
	ErrCodeInvalidCiphertextException = "InvalidCiphertextException"

	// ErrCodeInvalidGrantIdException for service response error code
	// "InvalidGrantIdException".
	//
	// The request was rejected because the specified GrantId is not valid.
	ErrCodeInvalidGrantIdException = "InvalidGrantIdException"

	// ErrCodeInvalidGrantTokenException for service response error code
	// "InvalidGrantTokenException".
	//
	// The request was rejected because the specified grant token is not valid.
	ErrCodeInvalidGrantTokenException = "InvalidGrantTokenException"

	// ErrCodeInvalidImportTokenException for service response error code
	// "InvalidImportTokenException".
	//
	// The request was rejected because the provided import token is invalid or
	// is associated with a different customer master key (CMK).
	ErrCodeInvalidImportTokenException = "InvalidImportTokenException"

	// ErrCodeInvalidKeyUsageException for service response error code
	// "InvalidKeyUsageException".
	//
	// The request was rejected for one of the following reasons:
	//
	//    * The KeyUsage value of the CMK is incompatible with the API operation.
	//
	//    * The encryption algorithm or signing algorithm specified for the operation
	//    is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
	//
	// For encrypting, decrypting, re-encrypting, and generating data keys, the
	// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
	// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
	//
	// To find the encryption or signing algorithms supported for a particular CMK,
	// use the DescribeKey operation.
	ErrCodeInvalidKeyUsageException = "InvalidKeyUsageException"

	// ErrCodeInvalidMarkerException for service response error code
	// "InvalidMarkerException".
	//
	// The request was rejected because the marker that specifies where pagination
	// should next begin is not valid.
	ErrCodeInvalidMarkerException = "InvalidMarkerException"

	// ErrCodeInvalidStateException for service response error code
	// "KMSInvalidStateException".
	//
	// The request was rejected because the state of the specified resource is not
	// valid for this request.
	//
	// For more information about how key state affects the use of a CMK, see How
	// Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
	// in the AWS Key Management Service Developer Guide .
	ErrCodeInvalidStateException = "KMSInvalidStateException"

	// ErrCodeKMSInvalidSignatureException for service response error code
	// "KMSInvalidSignatureException".
	//
	// The request was rejected because the signature verification failed. Signature
	// verification fails when it cannot confirm that signature was produced by
	// signing the specified message with the specified CMK and signing algorithm.
	ErrCodeKMSInvalidSignatureException = "KMSInvalidSignatureException"

	// ErrCodeKeyUnavailableException for service response error code
	// "KeyUnavailableException".
	//
	// The request was rejected because the specified CMK was not available. You
	// can retry the request.
	ErrCodeKeyUnavailableException = "KeyUnavailableException"

	// ErrCodeLimitExceededException for service response error code
	// "LimitExceededException".
	//
	// The request was rejected because a limit was exceeded. For more information,
	// see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
	// in the AWS Key Management Service Developer Guide.
	ErrCodeLimitExceededException = "LimitExceededException"

	// ErrCodeMalformedPolicyDocumentException for service response error code
	// "MalformedPolicyDocumentException".
	//
	// The request was rejected because the specified policy is not syntactically
	// or semantically correct.
	ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocumentException"

	// ErrCodeNotFoundException for service response error code
	// "NotFoundException".
	//
	// The request was rejected because the specified entity or resource could not
	// be found.
	ErrCodeNotFoundException = "NotFoundException"

	// ErrCodeTagException for service response error code
	// "TagException".
	//
	// The request was rejected because one or more tags are not valid.
	ErrCodeTagException = "TagException"

	// ErrCodeUnsupportedOperationException for service response error code
	// "UnsupportedOperationException".
	//
	// The request was rejected because a specified parameter is not supported or
	// a specified resource is not valid for this operation.
	ErrCodeUnsupportedOperationException = "UnsupportedOperationException"
)

var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
	"AlreadyExistsException":                       newErrorAlreadyExistsException,
	"CloudHsmClusterInUseException":                newErrorCloudHsmClusterInUseException,
	"CloudHsmClusterInvalidConfigurationException": newErrorCloudHsmClusterInvalidConfigurationException,
	"CloudHsmClusterNotActiveException":            newErrorCloudHsmClusterNotActiveException,
	"CloudHsmClusterNotFoundException":             newErrorCloudHsmClusterNotFoundException,
	"CloudHsmClusterNotRelatedException":           newErrorCloudHsmClusterNotRelatedException,
	"CustomKeyStoreHasCMKsException":               newErrorCustomKeyStoreHasCMKsException,
	"CustomKeyStoreInvalidStateException":          newErrorCustomKeyStoreInvalidStateException,
	"CustomKeyStoreNameInUseException":             newErrorCustomKeyStoreNameInUseException,
	"CustomKeyStoreNotFoundException":              newErrorCustomKeyStoreNotFoundException,
	"DependencyTimeoutException":                   newErrorDependencyTimeoutException,
	"DisabledException":                            newErrorDisabledException,
	"ExpiredImportTokenException":                  newErrorExpiredImportTokenException,
	"IncorrectKeyException":                        newErrorIncorrectKeyException,
	"IncorrectKeyMaterialException":                newErrorIncorrectKeyMaterialException,
	"IncorrectTrustAnchorException":                newErrorIncorrectTrustAnchorException,
	"KMSInternalException":                         newErrorInternalException,
	"InvalidAliasNameException":                    newErrorInvalidAliasNameException,
	"InvalidArnException":                          newErrorInvalidArnException,
	"InvalidCiphertextException":                   newErrorInvalidCiphertextException,
	"InvalidGrantIdException":                      newErrorInvalidGrantIdException,
	"InvalidGrantTokenException":                   newErrorInvalidGrantTokenException,
	"InvalidImportTokenException":                  newErrorInvalidImportTokenException,
	"InvalidKeyUsageException":                     newErrorInvalidKeyUsageException,
	"InvalidMarkerException":                       newErrorInvalidMarkerException,
	"KMSInvalidStateException":                     newErrorInvalidStateException,
	"KMSInvalidSignatureException":                 newErrorKMSInvalidSignatureException,
	"KeyUnavailableException":                      newErrorKeyUnavailableException,
	"LimitExceededException":                       newErrorLimitExceededException,
	"MalformedPolicyDocumentException":             newErrorMalformedPolicyDocumentException,
	"NotFoundException":                            newErrorNotFoundException,
	"TagException":                                 newErrorTagException,
	"UnsupportedOperationException":                newErrorUnsupportedOperationException,
}


text:
module SchemaTableHelpers
  def each_table(schema)
    return enum_for(__method__, schema) unless block_given?

    split_into_tables(schema).each do |table_definition|
      if table_name = table_name_from_definition_body(table_definition)
        yield table_name, table_definition, primary_key(table_name), string_primary_key?(table_name)
      end
    end
  end

  def with_file(filename)
    schema = File.read(filename)

    File.open(filename, "w:utf-8") do |f|
      yield schema, f
    end
  end

  def split_into_tables(schema)
    schema.split(/\nend\n?/).map{|s| "#{s}\nend\n"}
  end

  def table_name_from_definition_body(t)
    t.match(/create_table "([^\"]+)"/)[1] rescue nil
  end

  def string_primary_key?(table_name)
    column = ActiveRecord::Base.connection.
      columns(table_name).
      find{|c| c.name == primary_key(table_name)}

    if column
      column.type == :string
    end
  end

  def primary_key(table_name)
    ActiveRecord::Base.connection.primary_key table_name
  end

  private

  #It's easier to compare/test ruby code without leading whitespace.
  #ideally we'd handle this nicely but the
  #schema files are only normally present during a schema extraction/insertion
  def kill_leading_whitespace!(s)
    if s.is_a?(Array)
      s.map{|i| kill_leading_whitespace!(i)}
    else
      s.gsub!(/^ */,"").chomp
      s.gsub!(/\A\n/,"")
      s.gsub!(/\n\z/,"")
      s
    end
  end
end


text:
from __future__ import unicode_literals

from django.apps import apps
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template.context import RequestContext
from django.utils.translation import ugettext
from django.views.decorators.http import require_POST

from .forms import AttachmentForm
from .models import Attachment

def add_url_for_obj(obj):
    return reverse('attachments:add', kwargs={
        'app_label': obj._meta.app_label,
        'model_name': obj._meta.model_name,
        'pk': obj.pk
    })

@require_POST
@login_required
def add_attachment(request, app_label, model_name, pk,
                   template_name='attachments/add.html', extra_context={}):

    next = request.POST.get('next', '/')
    if not request.user.has_perm('attachments.add_attachment'):
        return HttpResponseRedirect(next)

    model = apps.get_model(app_label, model_name)
    obj = get_object_or_404(model, pk=pk)
    form = AttachmentForm(request.POST, request.FILES)

    if form.is_valid():
        form.save(request, obj)
        messages.success(request, ugettext('Your attachment was uploaded.'))
        return HttpResponseRedirect(next)

    template_context = {
        'form': form,
        'form_url': add_url_for_obj(obj),
        'next': next,
    }
    template_context.update(extra_context)
    return render_to_response(template_name, template_context,
                              RequestContext(request))

@login_required
def delete_attachment(request, attachment_pk):
    g = get_object_or_404(Attachment, pk=attachment_pk)
    if (
        (request.user.has_perm('attachments.delete_attachment') and
        request.user == g.creator)
    or
        request.user.has_perm('attachments.delete_foreign_attachments')
    ):
        g.delete()
        messages.success(request, ugettext('Your attachment was deleted.'))
    next = request.GET.get('next') or '/'
    return HttpResponseRedirect(next)


text:
    void UnitTest_##name();	\
        TestRegister g_TestRegister_##name(#name, __FILE__, &UnitTest_##name); \
    void UnitTest_##name()

DECLARE_EXCEPTION(TestFailureException, RootException);

namespace my
{
  inline void OnTestFailed(SrcPoint const & srcPoint, string const & msg)
  {
    LOG(LINFO, ("FAILED"));
    LOG(LINFO, (DebugPrint(srcPoint.FileName()) + ":" + DebugPrint(srcPoint.Line()), msg));
    MYTHROW(TestFailureException, (srcPoint.FileName(), srcPoint.Line(), msg));
  }
}

// This struct contains parsed command line options. It may contain pointers to argc contents.
struct CommandLineOptions
{
  CommandLineOptions()
      : m_filterRegExp(nullptr), m_suppressRegExp(nullptr),
      m_dataPath(nullptr), m_resourcePath(nullptr), m_help(false)
  {
  }

  char const * m_filterRegExp;
  char const * m_suppressRegExp;
  char const * m_dataPath;
  char const * m_resourcePath;

  bool m_help;
};
CommandLineOptions const & GetTestingOptions();

#define TEST(X, msg) { if (X) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST("#X")", ::my::impl::Message msg));}}
#define TEST_EQUAL(X, Y, msg) { if ((X) == (Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST("#X" == "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}
#define TEST_NOT_EQUAL(X, Y, msg) { if ((X) != (Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST("#X" != "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}
#define TEST_LESS(X, Y, msg) { if ((X) < (Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST("#X" < "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}
#define TEST_LESS_OR_EQUAL(X, Y, msg) { if ((X) <= (Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST("#X" <= "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}
#define TEST_GREATER(X, Y, msg) { if ((X) > (Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST("#X" > "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}
#define TEST_GREATER_OR_EQUAL(X, Y, msg) { if ((X) >= (Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST("#X" >= "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}
#define TEST_ALMOST_EQUAL_ULPS(X, Y, msg) { if (::my::AlmostEqualULPs(X, Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST(my::AlmostEqualULPs("#X", "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}
#define TEST_NOT_ALMOST_EQUAL_ULPS(X, Y, msg) { if (!::my::AlmostEqualULPs(X, Y)) {} else { \
  ::my::OnTestFailed(SRC(), ::my::impl::Message("TEST(!my::AlmostEqualULPs("#X", "#Y")", \
                                                 ::my::impl::Message(X, Y), \
                                                 ::my::impl::Message msg));}}


text:
module BoletoSimples
  class Installment < BaseModel
  end
end


text:
namespace Bridge.Pixi
{
	[External]
	[Namespace("PIXI")]
	public abstract class WebGLManager
	{
		/// <param name="renderer">The renderer this manager works for.</param>
		public extern WebGLManager(WebGLRenderer renderer);

		/// <summary>
		/// The renderer this manager works for.
		/// </summary>
		[FieldProperty]
		public WebGLRenderer Renderer { get; set; }

		/// <summary>
		/// Generic destroy methods to be overridden by the subclass.
		/// </summary>
		public virtual extern void Destroy();

		/// <summary>
		/// Generic method called when there is a WebGL context change.
		/// </summary>
		public virtual extern void OnContextChange();
	}
}


text:
require 'twilio-ruby'

# Initialize the client
# To set up environmental variables, see http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
client = Twilio::REST::Client.new(account_sid, auth_token)

# Retreive the service
service = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')

# Retrieve the Document
response = service.documents('MyFirstDocument')

puts response


text:
#define __CL_ENABLE_EXCEPTIONS

#include "CL/opencl.h"

#include "common.h"

#include <iostream>
#include <cstdlib>
#include <vector>

using namespace std;

int main( int argc, char ** argv ) {

    const cl_uint MAX_PLATFORMS = 10;
    cl_platform_id p_ids[ MAX_PLATFORMS ];
    cl_uint      nPlatforms;

    cl_int  ret = clGetPlatformIDs(MAX_PLATFORMS, p_ids, &nPlatforms );

    cout << "Found " << nPlatforms << " Platforms" << endl;

    const int BUFFER_SIZE = 1024;
    char buffer[ BUFFER_SIZE ];
    size_t nSize;

    const int MAX_DEVICES = 10;
    cl_device_id d_ids[ MAX_DEVICES ];
    cl_uint nDevices;

    for( cl_uint i = 0; i < nPlatforms; ++i ) {
        ret = clGetPlatformInfo( p_ids[i], CL_PLATFORM_NAME, BUFFER_SIZE, (void *)buffer, &nSize );
        cout << "Platform '" << buffer;

        ret = clGetPlatformInfo( p_ids[i], CL_PLATFORM_VERSION, BUFFER_SIZE, (void *)buffer, &nSize );
        cout << "' supports " << buffer << " and has the following devices:" << endl;

        // profile CPU devices
        ret = clGetDeviceIDs( p_ids[i], CL_DEVICE_TYPE_ALL, MAX_DEVICES, d_ids, &nDevices );
        for( cl_uint j = 0; j < nDevices; ++j ) {
            ret = clGetDeviceInfo( d_ids[j], CL_DEVICE_NAME, BUFFER_SIZE, (void *)buffer, &nSize );

            cout << "\tDevice '" <<  buffer << "' supports ";

            ret = clGetDeviceInfo( d_ids[j], CL_DEVICE_VERSION, BUFFER_SIZE, (void *)buffer, &nSize );

            cout << buffer << " and is ";
            cl_device_type dType;
            ret = clGetDeviceInfo( d_ids[j], CL_DEVICE_TYPE, sizeof( cl_device_type ), (void *)&dType, NULL );

            switch( dType ) {
            case CL_DEVICE_TYPE_CPU:
                cout << "a CPU";
                break;
            case CL_DEVICE_TYPE_GPU:
                cout << "a GPU";
                break;
            case CL_DEVICE_TYPE_ACCELERATOR:
                cout << "an ACCELERATOR type";
                break;
            case CL_DEVICE_TYPE_DEFAULT:
                cout << "a DEFAULT type";
                break;
            default:
                cout << "of UNKNOWN type";
                break;
            }

            cout << endl;
        }
    }

    return EXIT_SUCCESS;
}