text:
package com.qxcmp.weixin.event;

import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

import java.util.Map;

/**
 * 用户关注事件
 *
 * @author aaric
 */
public class WeixinMpSubscribeEvent extends BaseWeixinMessageEvent {
    public WeixinMpSubscribeEvent(WxMpXmlMessage wxMpXmlMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager wxSessionManager, WxMpXmlOutMessage wxMpXmlOutMessage) {
        super(wxMpXmlMessage, context, wxMpService, wxSessionManager, wxMpXmlOutMessage);
    }
}

redpajama_set_name: RedPajamaGithub


text:
/** @jsx React.DOM */
var React = require('react');

module.exports = React.createClass({
  render: function () {
    return (

    );
  }
});


text:
<?php

namespace app\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\filters\VerbFilter;
use app\models\LoginForm;
use app\models\ContactForm;
use app\models\EntHistorias;
use app\models\EntHistoriasExtend;
use app\models\EntCapitulos;
use yii\web\NotFoundHttpException;
use app\models\EntElementos;
use yii\web\Response;

class SiteController extends Controller {
	/**
	 * @inheritdoc
	 */
	public function behaviors() {
		return [
				'access' => [
						'class' => AccessControl::className (),
						'only' => [
								'logout'
						],
						'rules' => [
								[
										'actions' => [
												'logout'
										],
										'allow' => true,
										'roles' => [
												'@'
										]
								]
						]
				],
				'verbs' => [
						'class' => VerbFilter::className (),
						'actions' => [
								'logout' => [
										'post'
								]
						]
				]
		];
	}

	/**
	 * @inheritdoc
	 */
	public function actions() {
		return [
				'error' => [
						'class' => 'yii\web\ErrorAction'
				],
				'captcha' => [
						'class' => 'yii\captcha\CaptchaAction',
						'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null
				]
		];
	}

	/**
	 * Displays homepage.
	 *
	 * @return string
	 */
	public function actionIndex() {
		$historia = new EntHistorias();
		// Obtiene todas las historias activas
		$historias = EntHistorias::find ()->where ( [
				'b_habilitado' => 1
		] )->all ();

		return $this->render ( 'index', [
				'historias' => $historias,
				'historia'=>$historia
		] );
	}

	/**
	 * Login action.
	 *
	 * @return string
	 */
	public function actionLogin() {
		if (! Yii::$app->user->isGuest) {
			return $this->goHome ();
		}

		$model = new LoginForm ();
		if ($model->load ( Yii::$app->request->post () ) && $model->login ()) {
			return $this->goBack ();
		}
		return $this->render ( 'login', [
				'model' => $model
		] );
	}

	/**
	 * Logout action.
	 *
	 * @return string
	 */
	public function actionLogout() {
		Yii::$app->user->logout ();

		return $this->goHome ();
	}

	/**
	 * Lista de capitulos por historia
	 *
	 * @param string $token
	 */
	public function actionListaDeCapitulos($token = null, $q=null) {
		$historia = $this->getHistoriaByToken ( $token );

		$capituloForm = new EntCapitulos ();
		return $this->render ( 'listaDeCapitulos', [
				'historia' => $historia,
				'capituloForm' => $capituloForm
		] );
	}

	/**
	 * Visualizacion de capitulo seleccionado
	 *
	 * @param string $token
	 */
	public function actionVerCapitulo($token = null, $capitulo = null) {
		$this->layout = 'headerPost';
		$historia = $this->getHistoriaByToken ( $token );

		$capitulo = $this->getCapituloByToken ( $capitulo );

		$elementos = EntElementos::find()->where(['id_capitulo'=>$capitulo->id_capitulo,'id_historia'=>$historia->id_historia])->orderBy('num_orden')->all();

		$historias = EntHistorias::find()->where(['b_habilitado'=>1])->all();

		return $this->render ( 'verCapitulo', [
				'capitulo' => $capitulo,
				'elementos'=>$elementos,
				'historia'=>$historia->txt_token,
				'historias'=>$historias
		] );
	}

	/**
	 * Busca la historia por el token
	 *
	 * @param unknown $token
	 * @throws NotFoundHttpException
	 * @return boolean|\app\models\EntHistorias
	 */
	private function getHistoriaByToken($token) {
		if (($historia = EntHistoriasExtend::getHistoriaByToken ( $token ))) {
			return $historia;
		} else {
			throw new NotFoundHttpException ( 'The requested page does not exist.' );
		}
	}

	/**
	 * Busca la historia por el token
	 *
	 * @param unknown $token
	 * @throws NotFoundHttpException
	 * @return boolean|\app\models\EntHistorias
	 */
	private function getCapituloByToken($token) {
		if (($capitulo = EntCapitulos::find()->where(['txt_token'=>$token])->one())) {
			return $capitulo;
		} else {
			throw new NotFoundHttpException ( 'The requested page does not exist.' );
		}
	}

	public function actionSalir(){
		Yii::$app->user->logout ();

		return $this->goHome ();
	}

	/**
	 *
	 * @param unknown $token
	 */
	public function actionCargarCapitulosHistoria($token=null){
		Yii::$app->response->format = Response::FORMAT_JSON;

		$historia = $this->getHistoriaByToken($token);

		$capitulos = EntCapitulos::find('fch_publicacion <=NOW() AND b_habilitado=1')->where(['id_historia'=>$historia->id_historia])->orderBy('fch_publicacion ASC')->asArray()->all();

		return $capitulos;
	}
}


text:
#include <barrelfish/barrelfish.h>
#include <bench/bench.h>

#include <dma_internal.h>
#include <dma_device_internal.h>
#include <dma_channel_internal.h>
#include <dma_request_internal.h>
#include <debug.h>

/*
 * ---------------------------------------------------------------------------
 * Request ID generation
 * ---------------------------------------------------------------------------
 */

inline dma_req_id_t dma_request_generate_req_id(struct dma_channel *chan)
{
    return dma_request_id_build(chan, dma_channel_incr_req_count(chan));
}

/**
 * \brief initializes the common part of a DMA request
 *
 * \param req   DMA request to initialize
 * \param chan  Channel this request gets executed on
 * \param type  The type of the DMA request
 *
 * \return SYS_ERR_OK on success
 *         errval on failure
 */
errval_t dma_request_common_init(struct dma_request *req,
                                 struct dma_channel *chan,
                                 dma_req_st_t type)
{
    req->id = dma_request_id_build(chan, dma_channel_incr_req_count(chan));
    req->type = type;
    req->state = DMA_REQ_ST_INVALID;

#if DMA_BENCH_ENABLED
    req->timer_start = bench_tsc();
#endif
    return SYS_ERR_OK;
}

/**
 * \brief handles the processing of completed DMA requests
 *
 * \param req   the DMA request to process
 *
 * \returns SYS_ERR_OK on sucess
 *          errval on failure
 */
errval_t dma_request_process(struct dma_request *req)
{
    DMAREQ_DEBUG("Processing done request [%016lx]:\n", req->id);

    errval_t err;

    switch (req->state) {
        case DMA_REQ_ST_DONE:
            err = SYS_ERR_OK;
            break;
        default:
            err = DMA_ERR_CHAN_ERROR;  // todo: error code
            break;
    }

#if DMA_BENCH_ENABLED
    cycles_t timer_end = bench_tsc();
    debug_printf("DMA request %016lx took %lu cycles (%lu ms)\n",
                 req->id, timer_end - req->timer_start,
                 bench_tsc_to_ms(timer_end - req->timer_start));
#endif

    if (req->setup.done_cb) {
        req->setup.done_cb(err, req->id, req->setup.cb_arg);
    }

    return SYS_ERR_OK;
}

/*
 * ----------------------------------------------------------------------------
 * Getter / Setter Functions
 * ----------------------------------------------------------------------------
 */

/**
 * \brief returns the state of a DMA request
 *
 * \param req   DMA request
 *
 * \returns DMA request state
 */
inline dma_req_st_t dma_request_get_state(struct dma_request *req)
{
    return req->state;
}

/**
 * \brief returns the ID of a DMA request
 *
 * \param req   DMA request
 *
 * \returns DMA request ID
 */
inline dma_req_id_t dma_request_get_id(struct dma_request *req)
{
    return req->id;
}

/**
 * \brief returns the next DMA request of the given request
 *
 * \param req   DMA request
 *
 * \returns DMA request if there was one
 *          NULL if the request is at the end of the chain
 */
inline struct dma_request *dma_request_get_next(struct dma_request *req)
{
    return req->next;
}

/**
 * \brief sets the next DMA request of the given request
 *
 * \param req   DMA request
 * \param next  DMA request
 */
inline void dma_request_set_next(struct dma_request *req,
                                 struct dma_request *next)
{
    req->next = next;
}

/*
 * ============================================================================
 * Public Interface
 * ============================================================================
 */

/*
 * ----------------------------------------------------------------------------
 * Memory Registration
 * ----------------------------------------------------------------------------
 */

/**
 * \brief registers a memory region for future use
 *
 * \param frame the memory frame to register
 *
 * \returns SYS_ERR_OK on succes
 *          errval on error
 */
errval_t dma_register_memory(struct dma_device *dev,
                             struct capref frame)
{
    if (dev->f.register_memory == NULL) {
        return DMA_ERR_REQUEST_UNSUPPORTED;
    }
    return dev->f.register_memory(dev, frame);
}

/**
 * \brief deregisters a previously registered memory region
 *
 * \param frame the memory frame to register
 *
 * \returns SYS_ERR_OK on succes
 *          errval on error
 */
errval_t dma_request_deregister_memory(struct dma_device *dev,
                                       struct capref frame)
{
    if (dev->f.deregister_memory == NULL) {
        return DMA_ERR_REQUEST_UNSUPPORTED;
    }
    return dev->f.deregister_memory(dev, frame);
}

/*
 * ----------------------------------------------------------------------------
 * Request Execution
 * ----------------------------------------------------------------------------
 */

/**
 * \brief issues a new DMA memcpy request based on the setup information
 *
 * \param chan  DMA channel
 * \param setup DMA request setup information
 * \param id    returns the DMA request ID
 *
 * \returns SYS_ERR_OK on success
 *          errval on error
 */
errval_t dma_request_memcpy_chan(struct dma_channel *chan,
                                 struct dma_req_setup *setup,
                                 dma_req_id_t *id)
{
    /* check for overlap */
    if (setup->args.memcpy.dst < setup->args.memcpy.src) {
        if ((setup->args.memcpy.dst + setup->args.memcpy.bytes) > setup->args.memcpy.src) {
            return DMA_ERR_MEM_OVERLAP;
        }
    } else if ((setup->args.memcpy.dst > setup->args.memcpy.src)) {
        if ((setup->args.memcpy.src + setup->args.memcpy.bytes) > setup->args.memcpy.dst) {
            return DMA_ERR_MEM_OVERLAP;
        }
    } else {
        /* they are equal so they will overlap */
        return DMA_ERR_MEM_OVERLAP;
    }

    if (chan->f.memcpy == NULL) {
        return DMA_ERR_REQUEST_UNSUPPORTED;
    }

    return chan->f.memcpy(chan, setup, id);
}

/**
 * \brief issues a new DMA memcpy request based on the setup information
 *
 * \param dev   DMA device
 * \param setup DMA request setup information
 * \param id    returns the DMA request ID
 *
 * \returns SYS_ERR_OK on success
 *          errval on error
 */
errval_t dma_request_memcpy(struct dma_device *dev,
                            struct dma_req_setup *setup,
                            dma_req_id_t *id)
{
    struct dma_channel *chan = dma_device_get_channel(dev);
    return dma_request_memcpy_chan(chan, setup, id);
}

/**
 * \brief issues a new DMA memcpy request based on the setup information
 *
 * \param chan  DMA channel
 * \param setup DMA request setup information
 * \param id    returns the DMA request ID
 *
 * \returns SYS_ERR_OK on success
 *          errval on error
 */
errval_t dma_request_memset_chan(struct dma_channel *chan,
                                 struct dma_req_setup *setup,
                                 dma_req_id_t *id)
{
    if (chan->f.memset == NULL) {
        return DMA_ERR_REQUEST_UNSUPPORTED;
    }

    return chan->f.memset(chan, setup, id);
}

/**
 * \brief issues a new DMA memcpy request based on the setup information
 *
 * \param dev   DMA device
 * \param setup DMA request setup information
 * \param id    returns the DMA request ID
 *
 * \returns SYS_ERR_OK on success
 *          errval on error
 */
errval_t dma_request_memset(struct dma_device *dev,
                            struct dma_req_setup *setup,
                            dma_req_id_t *id)
{
    struct dma_channel *chan = dma_device_get_channel(dev);
    return dma_request_memset_chan(chan, setup, id);
}


text:
module Moped

  # Defines behaviour around indexes.
  class Indexes
    include Enumerable

    # @attribute [r] collection_name The collection name.
    # @attribute [r] database The database.
    # @attribute [r] namespace The index namespace.
    attr_reader :collection_name, :database, :namespace

    # Retrive an index by its definition.
    #
    # @example Get the index.
    #   session[:users].indexes[id: 1]
    #   # => {"v"=>1, "key"=>{"_id"=>1}, "ns"=>"moped_test.users", "name"=>"_id_" }
    #
    # @param [ Hash ] key The index definition.
    #
    # @return [ Hash, nil ] The index with the provided key, or nil.
    #
    # @since 1.0.0
    def [](key)
      database[:"system.indexes"].find(ns: namespace, key: key).one
    end

    # Create an index unless it already exists.
    #
    # @example Without options
    #   session[:users].indexes.create(name: 1)
    #   session[:users].indexes[name: 1]
    #   # => {"v"=>1, "key"=>{"name"=>1}, "ns"=>"moped_test.users", "name"=>"name_1" }
    #
    # @example With options
    #   session[:users].indexes.create(
    #     { location: "2d", name: 1 },
    #     { unique: true, dropDups: true }
    #   )
    #   session[:users][location: "2d", name: 1]
    #   {"v"=>1,
    #     "key"=>{"location"=>"2d", "name"=>1},
    #     "unique"=>true,
    #     "ns"=>"moped_test.users",
    #     "dropDups"=>true,
    #     "name"=>"location_2d_name_1"}
    #
    # @param [ Hash ] key The index spec.
    # @param [ Hash ] options The options for the index.
    #
    # @return [ Hash ] The index spec.
    #
    # @see http://www.mongodb.org/display/DOCS/Indexes#Indexes-CreationOptions
    #
    # @since 1.0.0
    def create(key, options = {})
      spec = options.merge(ns: namespace, key: key)
      spec[:name] ||= key.to_a.join("_")

      database.session.with(write: { w: 1 }) do |_s|
        _s[:"system.indexes"].insert(spec)
      end
    end

    # Drop an index, or all indexes.
    #
    # @example Drop all indexes
    #   session[:users].indexes.count # => 3
    #   # Does not drop the _id index
    #   session[:users].indexes.drop
    #   session[:users].indexes.count # => 1
    #
    # @example Drop a particular index
    #   session[:users].indexes.drop(name: 1)
    #   session[:users].indexes[name: 1] # => nil
    #
    # @param [ Hash ] key The index's key.
    #
    # @return [ Boolean ] Whether the indexes were dropped.
    #
    # @since 1.0.0
    def drop(key = nil)
      if key
        index = self[key] or return false
        name = index["name"]
      else
        name = "*"
      end
      result = database.command deleteIndexes: collection_name, index: name
      result["ok"] == 1
    end

    # Iterate over each of the indexes for the collection.
    #
    # @example Iterate over the indexes.
    #   indexes.each do |spec|
    #     #...
    #   end
    #
    # @return [ Enumerator ] The enumerator.
    #
    # @since 1.0.0
    #
    # @yield [ Hash ] Each index for the collection.
    def each(&block)
      database[:"system.indexes"].find(ns: namespace).each(&block)
    end

    # Initialize the indexes.
    #
    # @example Create the new indexes.
    #   Indexes.new(database, :artists)
    #
    # @param [ Database ] database The database.
    # @param [ String, Symbol ] collection_name The name of the collection.
    #
    # @since 1.0.0
    def initialize(database, collection_name)
      @database, @collection_name = database, collection_name
      @namespace = "#{database.name}.#{collection_name}"
    end
  end
end


text:
<?php
/**
 * Template Name: Home Page
 *
 */
$video_reviews = get_category_by_slug( 'video-reviews' );
$scams_to_avoid = get_category_by_slug( 'scams-to-avoid' );
$feature_blog_posts = get_category_by_slug( 'featured-blog-posts' );
$top_campaign_reviews = get_category_by_slug( 'top-campaign-reviews' );
?>

<div class="pageBanner hg <?php if ( !$au->isLoggedIn() ) { echo 'homeBanner'; }?>" style="background-image: url('<?php the_field('page_banner'); ?>')">

            <?php if ( $au->isLoggedIn() ) {?>

Member Dashboard

Registered User: <?= $au->getName()?>

            <?php }else{ ?>

Start Investing Time and Money In the Right Opportunities!

                <a href="<?php echo esc_url( home_url( '/' ) ); ?>amember/signup"><img class="btn" src="<?php echo get_template_directory_uri(); ?>/dist/images/subscribe-today-but.png" alt="" />
            <?php } ?>

<img class="btn" src="<?php echo get_template_directory_uri(); ?>/dist/images/business-tips-ico.png" alt="" /> TOP BUSINESS VIDEO TIPS

            <?php
            //$cat_businessTips_IDs = get_category_by_slug('business-tips')->term_id;
            //$cat_businessTips_IDs .= ',' . get_category_by_slug('personal-development-tips')->term_id;
            $cat_businessTips_IDs = "2";
            //print_r($cat_businessTips_IDs);+
            $args_video = array(
                'cat'  => $cat_businessTips_IDs,
                'posts_per_page'   => '4'
            );
            if ( have_posts() ) : query_posts($args_video);
                while ( have_posts() ) : the_post();
                    include(locate_template('templates/box_feature_title_text.php'));
                endwhile;
            endif; ?>

<img class="btn" src="<?php echo get_template_directory_uri(); ?>/dist/images/featured-ico.png" alt="" /> FEATURED BLOG POSTS

            <?php if ( have_posts() ) : query_posts('&category_name=featured-blog-posts&offset=0&posts_per_page=4');
                while ( have_posts() ) : the_post();
                    include(locate_template('templates/box_feature_title.php'));
                endwhile;
            endif; ?>

<img class="btn" src="<?php echo get_template_directory_uri(); ?>/dist/images/featured-review-ico.png" alt="" /> FEATURED REVIEWS

            <?php
            $cat_futuredReview_IDs = get_category_by_slug('network')->term_id;
            $cat_futuredReview_IDs .= ',' . get_category_by_slug('biz-op')->term_id;
            $cat_futuredReview_IDs .= ',' . get_category_by_slug('offer')->term_id;
            $cat_futuredReview_IDs .= ',' . get_category_by_slug('mlm')->term_id;
            //print_r($cat_futuredReview_IDs);
            $args_reviews = array(
                'cat'  => $cat_futuredReview_IDs,
                'posts_per_page'   => '4',
                'meta_key' => 'ratings_average',
                'orderby' => 'meta_value_num date', //array( 'meta_value_num' => 'DESC', 'date' => 'ASC' )
                'order' => 'DESC',
            );
            if ( have_posts() ) : query_posts($args_reviews);
                while ( have_posts() ) : the_post();
                    include(locate_template('templates/box_title_text_conv_payout.php'));
                endwhile;
            endif; ?>


text:
/*
	Dimension by HTML5 UP
	html5up.net | @ajlkn
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/

/* Main */

#main article {
    opacity: 1;
    margin: 4rem 0 0 0;
}


text:
layout: post
published: true
title: "Slides: Federal Reserve Bank of Dallas - Vistas from Texas: An Economic Outlook"
description: "My slides from my talk 'Innovative Ways to Teach High-Tech Skills' at the Federal Reserve Bank of Dallas Conference - Vistas from Texas: An Economic Outlook"
header-img: "img/post/fed-vistas.jpeg"
image-credit:
---

Yesterday I spoke to the Federal Reserve Bank of Dallas at their San Antonio conference [Vistas from Texas: An Economic Outlook](https://www.dallasfed.org/research/events/2018/18vistas).

Below are my slides from my presentation.

  Innovative Ways to Teach High-Tech Skills  from Jason Straughan

You can download them [via SlideShare](https://www.slideshare.net/JasonStraughan/innovative-ways-to-teach-hightech-skills).


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

using System.Collections.Generic;
using Summer.Batch.Data.Incrementer;
using Summer.Batch.Data.Parameter;

namespace Summer.Batch.Data
{
    /// <summary>
    /// Extension for Oracle support.
    /// </summary>
    public class OracleExtension : IDatabaseExtension
    {
        /// <summary>
        /// An enumerable containing the supported provider names for Oracle.
        /// </summary>
        public IEnumerable<string> ProviderNames
        {
            get
            {
                return new[] { "System.Data.OracleClient", "Oracle.ManagedDataAccess.Client", "Oracle.DataAccess.Client" };
            }
        }

        /// <summary>
        /// The placeholder getter for Oracle.
        /// </summary>
        public IPlaceholderGetter PlaceholderGetter { get { return new PlaceholderGetter(name => ":" + name, true); } }

        /// <summary>
        /// An instance of <see cref="OracleSequenceMaxValueIncrementer"/>.
        /// </summary>
        public IDataFieldMaxValueIncrementer Incrementer { get { return new OracleSequenceMaxValueIncrementer(); } }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
    xmlns:batch="http://schemas.google.com/gdata/batch"
    xmlns:exif="http://schemas.google.com/photos/exif/2007"
    xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
    xmlns:georss="http://www.georss.org/georss"
    xmlns:gml="http://www.opengis.net/gml"
    xmlns:gphoto="http://schemas.google.com/photos/2007"
    xmlns:media="http://search.yahoo.com/mrss/"
    xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:photo="http://www.pheed.com/pheed/">
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#user"/>
<entry>
    <gphoto:nickname>Greg</gphoto:nickname>
    <gphoto:user>TestdomainTestAccount</gphoto:user>
    <gphoto:thumbnail>http://lh3.google.com/image/TestdomainTestAccount/AAAAUbcFQeo/AAAAAAAAAAA/LRLjNgdEmmU/TestdomainTestAccount.jpg?imgmax=64&crop=1</gphoto:thumbnail>
    <id>http://photos.googleapis.com/data/entry/api/user/TestdomainTestAccount</id>
    <title type="text">TestdomainTestAccount</title>
    <summary type="text"/>
    <published>2007-05-23T18:18:39Z</published>
    <updated>2007-05-23T18:18:39Z</updated>
    <link
        href="http://photos.googleapis.com/data/feed/api/user/TestdomainTestAccount"
        rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
    <link href="http://photos.googleapis.com/TestdomainTestAccount"
        rel="alternate" type="text/html"/>
    <link
        href="http://photos.googleapis.com/data/entry/api/user/TestdomainTestAccount"
        rel="self" type="application/atom+xml"/>
    <author>
        <name>Greg</name>
        <uri>http://photos.googleapis.com/TestdomainTestAccount</uri>
    </author>
    <category scheme="http://schemas.google.com/g/2005#kind"
    	term="http://schemas.google.com/photos/2007#user"/>
</entry>
</feed>


text:
{-# LANGUAGE PackageImports #-}
import "rockit" RockIt ( defaultTemplate, noBuffering, simpleGET, downloadPlaylist, getPlaylist, Result(..) )
import "rockit" RockIt.Template ( parse )
import "base" System.Environment ( getArgs, getProgName )
import "base" System.Exit ( exitFailure )
import "base" Data.List ( isInfixOf )
import "base" System.IO ( hPutStrLn, stderr )

main :: IO ()
main = do
    args <- getArgs
    if ["-h"] `isInfixOf` args then
      usage
    else
      parseArgs args

doMagic :: String -> String -> IO ()
doMagic template url = do
    noBuffering
    {-res <- simpleGET "http://www.rockit.it/finebeforeyoucame/album/ormai/18579"-}
    res <- simpleGET url
    case res of
      Left err -> fail err
      Right r  ->
        case getPlaylist r of
          Just playlist -> do
            e <- downloadPlaylist (parse template) playlist
            case e of
              OK       -> return ()
              Error e' -> die e'
          Nothing       -> do
            die "Invalid URL"
  where
  err' x = hPutStrLn stderr $ "ERROR: " ++ x
  die x = err' x >> exitFailure

usage :: IO ()
usage = do
  n <- getProgName
  putStrLn $ "USAGE: " ++ n ++ " [pathTemplate] url"
  putStrLn $ "       " ++ n ++ " -h"

parseArgs :: [String] -> IO ()
parseArgs [url]           = doMagic defaultTemplate url
parseArgs [template, url] = doMagic template url
parseArgs _               = usage >> exitFailure


text:
@import url("ui.css");
@import url("toolbar.css");
@import url("piechart.css");
@import url("sidebar.css");
@import url("treemap.css");


text:
/*
Flot plugin for plotting textual data or categories. Consider a
dataset like [["February", 34], ["March", 20], ...]. This plugin
allows you to plot such a dataset directly.

To enable it, you must specify mode: "categories" on the axis with the
textual labels, e.g.

  $.plot("#placeholder", data, { xaxis: { mode: "categories" } });

By default, the labels are ordered as they are met in the data series.
If you need a different ordering, you can specify "categories" on the
axis options and list the categories there:

   xaxis: {
       mode: "categories",
       categories: ["February", "March", "April"]
   }

If you need to customize the distances between the categories, you can
specify "categories" as an object mapping labels to values

   xaxis: {
       mode: "categories",
       categories: { "February": 1, "March": 3, "April": 4 }
   }

If you don't specify all categories, the remaining encountered
categories will be numbered from the max value plus 1 (with a spacing
of 1 between each).

Internally, the plugin works by transforming the input data through an
auto-generated mapping where the first category becomes 0, the second
1, etc. Hence, a point like ["February", 34] becomes [0, 34]
internally in Flot (this is visible in hover and click events that
return numbers rather than the category labels). The plugin also
overrides the tick generator to spit out the categories as ticks
instead of the values.

If you need to map a value back to its label, the mapping is always
accessible as "categories" on the axis object, e.g.
plot.getAxes().xaxis.categories.
*/

(function ($) {
    var options = {
        xaxis: {
            categories: null
        },
        yaxis: {
            categories: null
        }
    };

    function processRawData(plot, series, data, datapoints) {
        // if categories are enabled, we need to disable
        // auto-transformation to numbers so the strings are intact
        // for later processing

        var xCategories = series.xaxis.options.mode == "categories",
            yCategories = series.yaxis.options.mode == "categories";

        if (!(xCategories || yCategories))
            return;

        var format = datapoints.format;

        if (!format) {
            // FIXME: auto-detection should really not be defined here
            var s = series;
            format = [];
            format.push({ x: true, number: true, required: true });
            format.push({ y: true, number: true, required: true });

            if (s.bars.show || (s.lines.show && s.lines.fill)) {
                format.push({ y: true, number: true, required: false, defaultValue: 0 });
                if (s.bars.horizontal) {
                    delete format[format.length - 1].y;
                    format[format.length - 1].x = true;
                }
            }

            datapoints.format = format;
        }

        for (var m = 0; m < format.length; ++m) {
            if (format[m].x && xCategories)
                format[m].number = false;

            if (format[m].y && yCategories)
                format[m].number = false;
        }
    }

    function getNextIndex(categories) {
        var index = -1;

        for (var v in categories)
            if (categories[v] > index)
                index = categories[v];

        return index + 1;
    }

    function categoriesTickGenerator(axis) {
        var res = [];
        for (var label in axis.categories) {
            var v = axis.categories[label];
            if (v >= axis.min && v <= axis.max)
                res.push([v, label]);
        }

        res.sort(function (a, b) { return a[0] - b[0]; });

        return res;
    }

    function setupCategoriesForAxis(series, axis, datapoints) {
        if (series[axis].options.mode != "categories")
            return;

        if (!series[axis].categories) {
            // parse options
            var c = {}, o = series[axis].options.categories || {};
            if ($.isArray(o)) {
                for (var i = 0; i < o.length; ++i)
                    c[o[i]] = i;
            }
            else {
                for (var v in o)
                    c[v] = o[v];
            }

            series[axis].categories = c;
        }

        // fix ticks
        if (!series[axis].options.ticks)
            series[axis].options.ticks = categoriesTickGenerator;

        transformPointsOnAxis(datapoints, axis, series[axis].categories);
    }

    function transformPointsOnAxis(datapoints, axis, categories) {
        // go through the points, transforming them
        var points = datapoints.points,
            ps = datapoints.pointsize,
            format = datapoints.format,
            formatColumn = axis.charAt(0),
            index = getNextIndex(categories);

        for (var i = 0; i < points.length; i += ps) {
            if (points[i] == null)
                continue;

            for (var m = 0; m < ps; ++m) {
                var val = points[i + m];

                if (val == null || !format[m][formatColumn])
                    continue;

                if (!(val in categories)) {
                    categories[val] = index;
                    ++index;
                }

                points[i + m] = categories[val];
            }
        }
    }

    function processDatapoints(plot, series, datapoints) {
        setupCategoriesForAxis(series, "xaxis", datapoints);
        setupCategoriesForAxis(series, "yaxis", datapoints);
    }

    function init(plot) {
        plot.hooks.processRawData.push(processRawData);
        plot.hooks.processDatapoints.push(processDatapoints);
    }

    $.plot.plugins.push({
        init: init,
        options: options,
        name: 'categories',
        version: '1.0'
    });
})(jQuery);


text:
import moment
import json

# Dispatch function for user api

# check message and get rid of all outdated messages

def returnHelper(status = 1, msg = None,content = None):
    return_val = {}
    return_val["status"] = status
    return_val["msg"] = msg
    return_val["content"] = content

    return return_val

def checkCache(mydb):
    #Remove the entries which are not updated for a long time

    id_list = []
    res = mydb.getData("cache", id_list)
    if(res["status"] != 1):
        return res
    cursor = res["content"]

    outoftime_cache = []
    current_time = moment.now().epoch()
    for doc in cursor:
        if(doc["create_time"] < current_time - 86400):
            outoftime_cache.append(doc["_id"])

    id_list = outoftime_cache
    res = mydb.removeData("cache", id_list)
    if(res["status"] != 1):
        return res

    return returnHelper()

def checkMsg(mydb):

    #get all messages and check the out of time message
    id_list = []
    res = mydb.getData("message", id_list)
    if(res["status"] != 1):
        return res
    cursor = res["content"]

    outoftime_msg = []
    related_user = {}
    current_time = moment.now().epoch()
    st = current_time - 86400

    for msg in cursor:
        if(msg["create_time"] < st):
            outoftime_msg.append(doc["_id"])
            if(msg["receiver_id"] in related_user.keys()):
                pass
            else:
                related_user[msg["receiver_id"]] = []
            related_user[msg["receiver_id"]].append(msg["_id"])
    if(len(outoftime_msg) == 0):
        return returnHelper()

    #update users' unprocessed msg list by removing the out of date msgs
    id_list = related_user.keys()
    if(len(id_list) > 0):
        res = mydb.getData("user",id_list)
        if(res["status"] != 1):
            return res
        cursor = res["content"]

        id_list = []
        data_list = []
        for user in cursor:
            for msg_id in related_user[user["_id"]]:
                if(msg_id in user["unprocessed_message"]):
                    user["unprocessed_message"].remove(msg_id)
            id_list.append(user["_id"])
            data_list.append(user)
        res = mydb.updateData("user",id_list, data_list)
        if(res["status"] != 1):
            return res

    #delete the out of time messages in database
    id_list = outoftime_msg
    res = mydb.removeData("message", id_list)
    if(res["status"] != 1):
        return res

    return returnHelper()

def updateConflict(post_list,mydb):
    #get the new conflict list of a user
    if(len(post_list) < 2):
        return returnHelper(content = [])
    id_list = post_list
    res = mydb.getData("schedule",id_list)
    if(res["status"] != 1):
        return res
    cursor = res["content"]
    nconflict_list = set()

    for i in range(0,len(cursor)-1):
        for j in range(i+1,len(cursor)):
            minen = min(cursor[i]["end_time"],cursor[j]["end_time"])
            maxst = max(cursor[i]["start_time"],cursor[j]["start_time"])
            if(minen > maxst):
                nconflict_list.add(cursor[i]["_id"])
                nconflict_list.add(cursor[j]["_id"])

    nconflict_list = list(nconflict_list)
    return returnHelper(content = nconflict_list)

def updateUser(user_list, pid, t, mydb):
    id_list = json.loads(json.dumps(user_list))
    res = mydb.getData("user",id_list)
    if(res["status"] != 1):
        return res
    cursor = list(res["content"])
    del_msg = set()

    for user in cursor:
        user["history_events"].append(pid)
        user["schedule_list"].remove(pid)
        user["conflict_list"] = updateConflict(user["schedule_list"],mydb)
        user["total_activities"] = len(user["history_events"])
        user["total_time"] += t
        user["total_hours"] = (int)(user["total_time"] / 3600)

        id_list = user["unprocessed_message"]
        if(len(id_list) != 0):
            mres = mydb.getData("message",id_list)
            if(mres["status"] != 1):
                return mres
            mcursor = list(mres["content"])
            for msg in mcursor:
                if(msg["post_id"] == pid):
                    del_msg.add(msg["_id"])
                    user["unprocessed_message"].remove(msg["_id"])

    id_list = json.loads(json.dumps(user_list))
    data_list = cursor
    res = mydb.updateData("user",id_list,data_list)
    if(res["status"] != 1):
        return res

    id_list = list(del_msg)
    res = mydb.removeData("message",id_list)
    if(res["status"] != 1):
        return res

    return returnHelper()

def checkSchedule(mydb):
    #Remove the schedules which have been finished
    id_list = []
    res = mydb.getData("schedule",id_list)
    if(res["status"] != 1):
        return res
    cursor = res["content"]
    current_time = moment.now().epoch()

    for doc in cursor:
        if("finish" not in doc.keys() and doc["end_time"] < current_time):
            doc["finish"] = True
            user_list = []
            user_list = doc["member"]
            user_list.append(doc["owner"])
            t = doc["end_time"] - doc["start_time"]

            ures = updateUser(user_list,doc["_id"],t,mydb)
            if(ures["status"] != 1):
                return ures

            id_list = [doc["_id"]]
            data_list = [doc]
            sres = mydb.updateData("schedule",id_list,data_list)
            if(sres["status"] != 1):
                return sres

    return returnHelper()


text:
{% if False %}
# DjangoCMS Base Template #

## About ##

This version of the project template is designed for Django 1.7 and DjangoCMS 3.0.

## Features ##

By default, this project template includes:

A set of basic templates Twitter Bootstrap 3.2.0 (located in the base app, with css and javascript by default).

Plugins:

- [cmsplugin-contact](https://github.com/arkanister/cmsplugin-contact)
- [cmsplugin-bootstrap](https://github.com/arkanister/cmsplugin-bootstrap)

Database:

- By default use sqlite3 (projectname.db).

Migrations:

- Django built-in migrations

Any of these options can added, modified, or removed as you like after creating your project.

## How to use this project template to create your project ##

- Install Django 1.7 ($ sudo pip install django>=1.7)
- $ django-admin.py startproject --template=https://github.com/arkanister/djangocmstemplate/archive/master.zip --extension=py,md,rst projectname
- $ cd projectname
- $ fab provision
- $ python manage.py runserver

That's all you need to do to get the project ready for development. When you deploy your project into production, you should look into getting certain settings from environment variables or other external sources. (See SECRET_KEY for an example.)
{% endif %}
# The ``{{ project_name }}`` Project #

## About ##

Describe your project here.

## Installation ##

Fill out with installation instructions for your project.

## License ##

This software is licensed under the [New BSD License][BSD]. For more
information, read the file ``LICENSE``.

[BSD]: http://opensource.org/licenses/BSD-3-Clause


text:
package mundo;

import java.util.List;

public class Tablero {

private List continentes;

public Tablero(){

}

}


text:
<?php
/**
 * DO NOT EDIT CUSTOM MARKERS
 * Generated from Class.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
 */

namespace connectors;

use \PHPUnit_Framework_TestCase as PHPUnit_Framework_TestCase;
/* * Generated from UseStatements.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54. */
use \Config as Config;
use \Logger as Logger;
use \Model as Model;
use \Cache as Cache;
use \CurlFile as CurlFile;
use \model\network\Endpoint as Endpoint;
use \model\network\EndpointDBO as EndpointDBO;
use \utilities\MediaFilename as MediaFilename;
use \exceptions\EndpointConnectionException as EndpointConnectionException;
/* {useStatements} */

class SABnzbdConnectorTest extends PHPUnit_Framework_TestCase
{
    protected function setUp()
    {
    }

    protected function tearDown()
    {
    }

/*	 Test functions */

	/**
	 * @covers	testConnnector
	 * 			T_FUNCTION T_PUBLIC testConnnector ( )
	 * @todo	Implement testTestConnnector().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testTestConnnector()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	defaultParameters
	 * 			T_FUNCTION T_PUBLIC defaultParameters ( )
	 * @todo	Implement testDefaultParameters().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testDefaultParameters()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	simpleRequestForMode
	 * 			T_FUNCTION T_PUBLIC simpleRequestForMode ( $mode = '')
	 * @todo	Implement testSimpleRequestForMode().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testSimpleRequestForMode()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	statusCheck
	 * 			T_FUNCTION T_PUBLIC statusCheck ( )
	 * @todo	Implement testStatusCheck().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testStatusCheck()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	restart
	 * 			T_FUNCTION T_PUBLIC restart ( )
	 * @todo	Implement testRestart().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testRestart()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	shutdown
	 * 			T_FUNCTION T_PUBLIC shutdown ( )
	 * @todo	Implement testShutdown().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testShutdown()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	pauseAll
	 * 			T_FUNCTION T_PUBLIC pauseAll ( )
	 * @todo	Implement testPauseAll().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testPauseAll()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	resumeAll
	 * 			T_FUNCTION T_PUBLIC resumeAll ( )
	 * @todo	Implement testResumeAll().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testResumeAll()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	sabnzbdVersion
	 * 			T_FUNCTION T_PUBLIC sabnzbdVersion ( )
	 * @todo	Implement testSabnzbdVersion().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testSabnzbdVersion()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	categories
	 * 			T_FUNCTION T_PUBLIC categories ( )
	 * @todo	Implement testCategories().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testCategories()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	comicCategory
	 * 			T_FUNCTION T_PUBLIC comicCategory ( )
	 * @todo	Implement testComicCategory().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testComicCategory()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	scripts
	 * 			T_FUNCTION T_PUBLIC scripts ( )
	 * @todo	Implement testScripts().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testScripts()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	contentaScript
	 * 			T_FUNCTION T_PUBLIC contentaScript ( )
	 * @todo	Implement testContentaScript().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testContentaScript()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	queue
	 * 			T_FUNCTION T_PUBLIC queue ( )
	 * @todo	Implement testQueue().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testQueue()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	queueSlots
	 * 			T_FUNCTION T_PUBLIC queueSlots ( )
	 * @todo	Implement testQueueSlots().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testQueueSlots()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	history
	 * 			T_FUNCTION T_PUBLIC history ( )
	 * @todo	Implement testHistory().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testHistory()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	historySlots
	 * 			T_FUNCTION T_PUBLIC historySlots ( )
	 * @todo	Implement testHistorySlots().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testHistorySlots()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	historyDelete
	 * 			T_FUNCTION T_PUBLIC historyDelete ( )
	 * @todo	Implement testHistoryDelete().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testHistoryDelete()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	queueDelete
	 * 			T_FUNCTION T_PUBLIC queueDelete ( )
	 * @todo	Implement testQueueDelete().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testQueueDelete()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	addURL
	 * 			T_FUNCTION T_PUBLIC addURL ( $url = null, $category = null, $priority = SABnzbdConnectorPRIORITY_Default)
	 * @todo	Implement testAddURL().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testAddURL()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	addNZB
	 * 			T_FUNCTION T_PUBLIC addNZB ( $filepath = null, $name = null, $category = null, $priority = SABnzbdConnectorPRIORITY_Default)
	 * @todo	Implement testAddNZB().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testAddNZB()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	/**
	 * @covers	performGET
	 * 			T_FUNCTION T_PUBLIC performGET ( $url, $force = true)
	 * @todo	Implement testPerformGET().
	 * Generated from Function.tpl by PhpTestClassGenerator.php on 2016-05-16 21:52:54.
	 */
	public function testPerformGET()
	{
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

/* {functions} */
}


text:
#import "NSEnumerator.h"

@interface NSDirectoryEnumerator : NSEnumerator
{
}

- (void)skipDescendants;
- (void)skipDescendents;
- (unsigned long long)level;
- (id)directoryAttributes;
- (id)fileAttributes;
- (id)nextObject;

@end


text:
Glimpse.Plugins.Bundling
========================

A plugin for Glimpse which exposes Asp.Net MVC Bundles and whether they were used on the current page request.

Install through Nuget:
---------------

    Install-Package Glimpse.Plugins.Bundling

The plugin simply shows which bundles have been created and what their contents are. You can also see which transforms are in use, the CDN path (if any) and
what Orderer instance is being used.

No boilerplate code is necessary - simply install the package through Nuget, and rebuild.

![Plugin Screenshot](https://raw.github.com/elkdanger/Glimpse.Plugins.Bundling/master/media/screenshot.jpg)

Viewing included Bundles
------------------------
The bundles that have been included and used on the current page can be viewed (seen highlighted in green in the screenshot above) by registering a HTTP handler, as follows:

	<modules>
		<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />

		<!-- Register this handler to view process bundles on the page -->
		<add name="GlimpseBundlePluginHttpModule" type="Glimpse.Plugins.Bundling.GlimpseBundlePluginHttpModule, Glimpse.Plugins.Bundling" preCondition="integratedMode" />
	</modules>


text:
#region License
// <copyright file="HelpVerbOptionAttribute.cs" company="Giacomo Stelluti Scala">
//   Copyright 2015-2013 Giacomo Stelluti Scala
// </copyright>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#endregion
#region Using Directives
using System;
using System.Reflection;
using CommandLine.Extensions;

using CommandLine.Infrastructure;
#endregion

namespace CommandLine
{
    /// <summary>
    /// Indicates the instance method that must be invoked when it becomes necessary show your help screen.
    /// The method signature is an instance method with that accepts and returns a <see cref="System.String"/>.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public sealed class HelpVerbOptionAttribute : BaseOptionAttribute
    {
        private const string DefaultHelpText = "Display more information on a specific command.";

        /// <summary>
        /// Initializes a new instance of the <see cref="CommandLine.HelpVerbOptionAttribute"/> class.
        /// Although it is possible, it is strongly discouraged redefine the long name for this option
        /// not to disorient your users.
        /// </summary>
        public HelpVerbOptionAttribute()
            : this("help")
        {
            HelpText = DefaultHelpText;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CommandLine.HelpVerbOptionAttribute"/> class
        /// with the specified long name. Use parameter less constructor instead.
        /// </summary>
        /// <param name="longName">Help verb option alternative name.</param>
        /// <remarks>
        /// It's highly not recommended change the way users invoke help. It may create confusion.
        /// </remarks>
        public HelpVerbOptionAttribute(string longName)
            : base(null, longName)
        {
            HelpText = DefaultHelpText;
        }

        /// <summary>
        /// Help verb command do not support short name by design.
        /// </summary>
        public override char? ShortName
        {
            get { return null; }
            internal set { throw new InvalidOperationException(SR.InvalidOperationException_DoNotUseShortNameForVerbCommands); }
        }

        /// <summary>
        /// Help verb command like ordinary help option cannot be mandatory by design.
        /// </summary>
        public override bool Required
        {
            get { return false; }
            set { throw new InvalidOperationException(SR.InvalidOperationException_DoNotSetRequiredPropertyForVerbCommands); }
        }

        internal static void InvokeMethod(
            object target,
            Pair<MethodInfo, HelpVerbOptionAttribute> helpInfo,
            string verb,
            out string text)
        {
            text = null;
            var method = helpInfo.Left;
            if (!CheckMethodSignature(method))
            {
                throw new MemberAccessException(
                    SR.MemberAccessException_BadSignatureForHelpVerbOptionAttribute.FormatInvariant(method.Name));
            }

            text = (string)method.Invoke(target, new object[] { verb });
        }

        private static bool CheckMethodSignature(MethodInfo value)
        {
            if (value.ReturnType == typeof(string) && value.GetParameters().Length == 1)
            {
                return value.GetParameters()[0].ParameterType == typeof(string);
            }

            return false;
        }
    }
}


text:
package com.netflix.priam.notification;

/**
 * Generic interface which an event generator class should implement so all the observers could be
 * notified of the events. Any class interested in state change for the event can subscribe by
 * registering themselves. Created by aagrawal on 8/11/17.
 */
public interface EventGenerator<T> {
    /**
     * Subscribes {@code observer} to receive generated events.
     *
     * @param observer {@link EventObserver} interested in receiving updates from this event
     *     generator. May not be null.
     */
    void addObserver(EventObserver<T> observer);

    /**
     * Removes {@code observer} from receiving any further events from this generator.
     *
     * @param observer {@link EventObserver} that is to stop receiving updates from this event
     *     generator. May not be null.
     */
    void removeObserver(EventObserver<T> observer);

    /**
     * Notify all the observers of an event start who subscribed to receive events.
     *
     * @param event Generated event from the generator
     */
    void notifyEventStart(T event);

    /**
     * Notify all the observers of an event success who subscribed to receive events.
     *
     * @param event Event which was successful from the generator.
     */
    void notifyEventSuccess(T event);

    /**
     * Notify all the observers of an event failure who subscribed to receive events.
     *
     * @param event Event which was failure from the generator.
     */
    void notifyEventFailure(T event);

    /**
     * Notify all the observers of an event stop who subscribed to receive events.
     *
     * @param event Event which was stopped from the generator.
     */
    void notifyEventStop(T event);
}


text:
class Formulary

  def self.unload_formula formula_name
    Object.send(:remove_const, class_s(formula_name))
  end

  def self.formula_class_defined? class_name
    Object.const_defined?(class_name)
  end

  def self.get_formula_class class_name
    Object.const_get(class_name)
  end

  def self.restore_formula formula_name, value
    old_verbose, $VERBOSE = $VERBOSE, nil
    Object.const_set(class_s(formula_name), value)
  ensure
    $VERBOSE = old_verbose
  end

  def self.class_s name
    class_name = name.capitalize
    class_name.gsub!(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase }
    class_name.gsub!('+', 'x')
    class_name
  end

  # A FormulaLoader returns instances of formulae.
  # Subclasses implement loaders for particular sources of formulae.
  class FormulaLoader
    # The formula's name
    attr_reader :name
    # The formula's ruby file's path or filename
    attr_reader :path
    # The ruby constant name of the formula's class
    attr_reader :class_name

    def initialize(name, path)
      @name = name
      @path = path.resolved_path
      @class_name = Formulary.class_s(name)
    end

    # Gets the formula instance.
    def get_formula
      klass.new(name, path)
    end

    # Return the Class for this formula, `require`-ing it if
    # it has not been parsed before.
    def klass
      begin
        have_klass = Formulary.formula_class_defined? class_name
      rescue NameError
        raise FormulaUnavailableError.new(name)
      end

      unless have_klass
        STDERR.puts "#{$0} (#{self.class.name}): loading #{path}" if ARGV.debug?
        begin
          require path
        rescue NoMethodError
          # This is a programming error in an existing formula, and should not
          # have a "no such formula" message.
          raise
        rescue LoadError, NameError
          raise if ARGV.debug?  # let's see the REAL error
          raise FormulaUnavailableError.new(name)
        end
      end

      klass = Formulary.get_formula_class(class_name)
      if klass == Formula || !(klass < Formula)
        raise FormulaUnavailableError.new(name)
      end
      klass
    end
  end

  # Loads formulae from bottles.
  class BottleLoader < FormulaLoader
    def initialize bottle_name
      @bottle_filename = Pathname(bottle_name).realpath
      name_without_version = bottle_filename_formula_name @bottle_filename
      if name_without_version.empty?
        if ARGV.homebrew_developer?
          opoo "Add a new regex to bottle_version.rb to parse this filename."
        end
        name = bottle_name
      else
        name = name_without_version
      end

      super name, Formula.path(name)
    end

    def get_formula
      formula = super
      formula.local_bottle_path = @bottle_filename
      formula
    end
  end

  # Loads formulae from Homebrew's provided Library
  class StandardLoader < FormulaLoader
    def initialize name, path=Formula.path(name)
      super
    end
  end

  class AliasLoader < FormulaLoader
    def initialize alias_path
      path = alias_path.resolved_path
      name = path.basename(".rb").to_s
      super name, path
    end
  end

  # Loads formulae from disk using a path
  class FromPathLoader < FormulaLoader
    def initialize path
      path = Pathname.new(path).expand_path
      super path.basename(".rb").to_s, path
    end
  end

  # Loads formulae from URLs
  class FromUrlLoader < FormulaLoader
    attr_reader :url

    def initialize url
      @url = url
      uri = URI(url)
      formula = File.basename(uri.path, ".rb")
      super formula, HOMEBREW_CACHE_FORMULA/File.basename(uri.path)
    end

    # Downloads the formula's .rb file
    def fetch
      unless Formulary.formula_class_defined? class_name
        HOMEBREW_CACHE_FORMULA.mkpath
        FileUtils.rm path.to_s, :force => true
        curl url, '-o', path.to_s
      end
    end

    def get_formula
      fetch
      super
    end
  end

  # Loads tapped formulae.
  class TapLoader < FormulaLoader
    attr_reader :tapped_name

    def initialize tapped_name
      @tapped_name = tapped_name
      user, repo, name = tapped_name.split("/", 3).map(&:downcase)
      tap = Pathname.new("#{HOMEBREW_LIBRARY}/Taps/#{user}/homebrew-#{repo}")
      path = tap.join("#{name}.rb")

      if tap.directory?
        tap.find_formula do |file|
          if file.basename(".rb").to_s == name
            path = file
          end
        end
      end

      super name, path
    end

    def get_formula
      super
    rescue FormulaUnavailableError
      raise TapFormulaUnavailableError.new(tapped_name)
    end
  end

  # Return a Formula instance for the given reference.
  # `ref` is string containing:
  # * a formula name
  # * a formula pathname
  # * a formula URL
  # * a local bottle reference
  def self.factory ref
    loader_for(ref).get_formula
  end

  def self.canonical_name(ref)
    loader_for(ref).name
  end

  def self.loader_for(ref)
    case ref
    when %r[(https?|ftp)://]
      return FromUrlLoader.new(ref)
    when Pathname::BOTTLE_EXTNAME_RX
      return BottleLoader.new(ref)
    when HOMEBREW_TAP_FORMULA_REGEX
      return TapLoader.new(ref)
    end

    if File.extname(ref) == ".rb"
      return FromPathLoader.new(ref)
    end

    formula_with_that_name = Formula.path(ref)
    if formula_with_that_name.file?
      return StandardLoader.new(ref, formula_with_that_name)
    end

    possible_alias = Pathname.new("#{HOMEBREW_LIBRARY}/Aliases/#{ref}")
    if possible_alias.file?
      return AliasLoader.new(possible_alias)
    end

    possible_cached_formula = Pathname.new("#{HOMEBREW_CACHE_FORMULA}/#{ref}.rb")
    if possible_cached_formula.file?
      return StandardLoader.new(ref, possible_cached_formula)
    end

    return StandardLoader.new(ref)
  end
end


text:
// ==================================================================================
// Copyright (c) 2012 HiFi-LoFi
//
// This is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// ==================================================================================

#ifndef _FFTCONVOLVER_UTILITIES_H
#define _FFTCONVOLVER_UTILITIES_H

#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <new>

namespace fftconvolver
{

#if defined(__SSE__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  #if !defined(FFTCONVOLVER_USE_SSE) && !defined(FFTCONVOLVER_DONT_USE_SSE)
    #define FFTCONVOLVER_USE_SSE
  #endif
#endif

#if defined (FFTCONVOLVER_USE_SSE)
  #include <xmmintrin.h>
#endif

#if defined(__GNUC__)
  #define FFTCONVOLVER_RESTRICT __restrict__
#else
  #define FFTCONVOLVER_RESTRICT
#endif

/**
* @brief Returns whether SSE optimization for the convolver is enabled
* @return true: Enabled - false: Disabled
*/
bool SSEEnabled();

/**
* @class Buffer
* @brief Simple buffer implementation (uses 16-byte alignment if SSE optimization is enabled)
*/
template<typename T>
class Buffer
{
public:
  explicit Buffer(size_t initialSize = 0) :
    _data(0),
    _size(0)
  {
    resize(initialSize);
  }

  virtual ~Buffer()
  {
    clear();
  }

  void clear()
  {
    deallocate(_data);
    _data = 0;
    _size = 0;
  }

  void resize(size_t size)
  {
    if (_size != size)
    {
      clear();

      if (size > 0)
      {
        assert(!_data && _size == 0);
        _data = allocate(size);
        _size = size;
      }
    }
    setZero();
  }

  size_t size() const
  {
    return _size;
  }

  void setZero()
  {
    ::memset(_data, 0, _size * sizeof(T));
  }

  void copyFrom(const Buffer<T>& other)
  {
    assert(_size == other._size);
    if (this != &other)
    {
      ::memcpy(_data, other._data, _size * sizeof(T));
    }
  }

  T& operator[](size_t index)
  {
    assert(_data && index < _size);
    return _data[index];
  }

  const T& operator[](size_t index) const
  {
    assert(_data && index < _size);
    return _data[index];
  }

  operator bool() const
  {
    return (_data != 0 && _size > 0);
  }

  T* data()
  {
    return _data;
  }

  const T* data() const
  {
    return _data;
  }

  static void Swap(Buffer<T>& a, Buffer<T>& b)
  {
    std::swap(a._data, b._data);
    std::swap(a._size, b._size);
  }

private:
  T* allocate(size_t size)
  {
#if defined(FFTCONVOLVER_USE_SSE)
    return static_cast<T*>(_mm_malloc(size * sizeof(T), 16));
#else
    return new T[size];
#endif
  }

  void deallocate(T* ptr)
  {
#if defined(FFTCONVOLVER_USE_SSE)
    _mm_free(ptr);
#else
    delete [] ptr;
#endif
  }

  T* _data;
  size_t _size;

  // Prevent uncontrolled usage
  Buffer(const Buffer&);
  Buffer& operator=(const Buffer&);
};

/**
* @brief Type of one sample
*/
typedef float Sample;

/**
* @brief Buffer for samples
*/
typedef Buffer<Sample> SampleBuffer;

/**
* @class SplitComplex
* @brief Buffer for split-complex representation of FFT results
*
* The split-complex representation stores the real and imaginary parts
* of FFT results in two different memory buffers which is useful e.g. for
* SIMD optimizations.
*/
class SplitComplex
{
public:
  explicit SplitComplex(size_t initialSize = 0) :
    _size(0),
    _re(),
    _im()
  {
    resize(initialSize);
  }

  ~SplitComplex()
  {
    clear();
  }

  void clear()
  {
    _re.clear();
    _im.clear();
    _size = 0;
  }

  void resize(size_t newSize)
  {
    _re.resize(newSize);
    _im.resize(newSize);
    _size = newSize;
  }

  void setZero()
  {
    _re.setZero();
    _im.setZero();
  }

  void copyFrom(const SplitComplex& other)
  {
    _re.copyFrom(other._re);
    _im.copyFrom(other._im);
  }

  Sample* re()
  {
    return _re.data();
  }

  const Sample* re() const
  {
    return _re.data();
  }

  Sample* im()
  {
    return _im.data();
  }

  const Sample* im() const
  {
    return _im.data();
  }

  size_t size() const
  {
    return _size;
  }

private:
  size_t _size;
  SampleBuffer _re;
  SampleBuffer _im;

  // Prevent uncontrolled usage
  SplitComplex(const SplitComplex&);
  SplitComplex& operator=(const SplitComplex&);
};

/**
* @brief Returns the next power of 2 of a given number
* @param val The number
* @return The next power of 2
*/
template<typename T>
T NextPowerOf2(const T& val)
{
  T nextPowerOf2 = 1;
  while (nextPowerOf2 < val)
  {
    nextPowerOf2 *= 2;
  }
  return nextPowerOf2;
}

/**
* @brief Sums two given sample arrays
* @param result The result array
* @param a The 1st array
* @param b The 2nd array
* @param len The length of the arrays
*/
void Sum(Sample* FFTCONVOLVER_RESTRICT result,
         const Sample* FFTCONVOLVER_RESTRICT a,
         const Sample* FFTCONVOLVER_RESTRICT b,
         size_t len);

/**
* @brief Copies a source array into a destination buffer and pads the destination buffer with zeros
* @param dest The destination buffer
* @param src The source array
* @param srcSize The size of the source array
*/
template<typename T>
void CopyAndPad(Buffer<T>& dest, const T* src, size_t srcSize)
{
  assert(dest.size() >= srcSize);
  ::memcpy(dest.data(), src, srcSize * sizeof(T));
  ::memset(dest.data() + srcSize, 0, (dest.size()-srcSize) * sizeof(T));
}

/**
* @brief Adds the complex product of two split-complex buffers to a result buffer
* @param result The result buffer
* @param a The 1st factor of the complex product
* @param b The 2nd factor of the complex product
*/
void ComplexMultiplyAccumulate(SplitComplex& result, const SplitComplex& a, const SplitComplex& b);

/**
* @brief Adds the complex product of two split-complex arrays to a result array
* @param re The real part of the result buffer
* @param im The imaginary part of the result buffer
* @param reA The real part of the 1st factor of the complex product
* @param imA The imaginary part of the 1st factor of the complex product
* @param reB The real part of the 2nd factor of the complex product
* @param imB The imaginary part of the 2nd factor of the complex product
*/
void ComplexMultiplyAccumulate(Sample* FFTCONVOLVER_RESTRICT re,
                               Sample* FFTCONVOLVER_RESTRICT im,
                               const Sample* FFTCONVOLVER_RESTRICT reA,
                               const Sample* FFTCONVOLVER_RESTRICT imA,
                               const Sample* FFTCONVOLVER_RESTRICT reB,
                               const Sample* FFTCONVOLVER_RESTRICT imB,
                               const size_t len);

} // End of namespace fftconvolver

#endif // Header guard


text:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Keshi Foods TPS | Dashboard</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- CSS include -->
    <?php include "Imports/styles.php" ?>
</head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <!-- Header (With the logo and User Profile) -->
    <?php include "Imports/header.php" ?>

    <!-- Left side column. contains the logo and sidebar -->
    <?php include "Imports/sidebar.php" ?>

    <!-- Content Wrapper. Contains page content -->
    <?php include "Pages/payment_add.php" ?>

    <!-- Footer -->
    <?php include "Imports/footer.php" ?>

</div>

<!-- JS include -->
<?php include 'Imports/js.php' ?>
</body>
</html>


text:
package org.wso2.carbon.apimgt.impl;

import org.wso2.carbon.apimgt.api.LoginPostExecutor;

public class SampleLoginPostExecutor implements LoginPostExecutor {

    public String getGroupingIdentifiers(String loginResponse){
        return "success";
    }
}


text:
namespace pegtl
{
   namespace internal
   {
      template< typename Rule, typename Pad1, typename Pad2 = Pad1 >
      using pad = seq< star< Pad1 >, Rule, star< Pad2 > >;

   } // internal

} // pegtl

#endif


text:
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'twilio_thinqlcr_ruby'


text:
class Elasticsearch < Formula
  desc "Distributed search & analytics engine"
  homepage "https://www.elastic.co/products/elasticsearch"
  url "https://github.com/elastic/elasticsearch/archive/v7.8.1.tar.gz"
  sha256 "e222d4165fb4145222491e1ed33dad15acc7b56334ca6589202e2ee761900c78"
  license "Apache-2.0"

  bottle do
    cellar :any_skip_relocation
    sha256 "6cef7f769428a47c864edccc30b043153fa239fc5c5545b661975b7cef17efe7" => :catalina
    sha256 "812838714ceb91031ae6ccc4b762a42fc2f52a8f43dbb9b74e3222a2a6c2b6cd" => :mojave
    sha256 "666d9a971e6f8a603a96feac7afaaf95e6d88eabf4ecc3d6f1b1f02ff928fa3e" => :high_sierra
  end

  depends_on "gradle" => :build
  depends_on "openjdk"

  def cluster_name
    "elasticsearch_#{ENV["USER"]}"
  end

  def install
    system "gradle", ":distribution:archives:oss-no-jdk-darwin-tar:assemble"

    mkdir "tar" do
      # Extract the package to the tar directory
      system "tar", "--strip-components=1", "-xf",
        Dir["../distribution/archives/oss-no-jdk-darwin-tar/build/distributions/elasticsearch-oss-*.tar.gz"].first

      # Install into package directory
      libexec.install "bin", "lib", "modules"

      # Set up Elasticsearch for local development:
      inreplace "config/elasticsearch.yml" do |s|
        # 1. Give the cluster a unique name
        s.gsub!(/#\s*cluster\.name: .*/, "cluster.name: #{cluster_name}")

        # 2. Configure paths
        s.sub!(%r{#\s*path\.data: /path/to.+$}, "path.data: #{var}/lib/elasticsearch/")
        s.sub!(%r{#\s*path\.logs: /path/to.+$}, "path.logs: #{var}/log/elasticsearch/")
      end

      inreplace "config/jvm.options", %r{logs/gc.log}, "#{var}/log/elasticsearch/gc.log"

      # Move config files into etc
      (etc/"elasticsearch").install Dir["config/*"]
    end

    inreplace libexec/"bin/elasticsearch-env",
              "if [ -z \"$ES_PATH_CONF\" ]; then ES_PATH_CONF=\"$ES_HOME\"/config; fi",
              "if [ -z \"$ES_PATH_CONF\" ]; then ES_PATH_CONF=\"#{etc}/elasticsearch\"; fi"

    bin.install libexec/"bin/elasticsearch",
                libexec/"bin/elasticsearch-keystore",
                libexec/"bin/elasticsearch-plugin",
                libexec/"bin/elasticsearch-shard"
    bin.env_script_all_files(libexec/"bin", JAVA_HOME: Formula["openjdk"].opt_prefix)
  end

  def post_install
    # Make sure runtime directories exist
    (var/"lib/elasticsearch").mkpath
    (var/"log/elasticsearch").mkpath
    ln_s etc/"elasticsearch", libexec/"config" unless (libexec/"config").exist?
    (var/"elasticsearch/plugins").mkpath
    ln_s var/"elasticsearch/plugins", libexec/"plugins" unless (libexec/"plugins").exist?
    # fix test not being able to create keystore because of sandbox permissions
    system bin/"elasticsearch-keystore", "create" unless (etc/"elasticsearch/elasticsearch.keystore").exist?
  end

  def caveats
    <<~EOS
      Data:    #{var}/lib/elasticsearch/
      Logs:    #{var}/log/elasticsearch/#{cluster_name}.log
      Plugins: #{var}/elasticsearch/plugins/
      Config:  #{etc}/elasticsearch/
    EOS
  end

  plist_options manual: "elasticsearch"

  def plist
    <<~EOS
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
        <dict>
          <key>KeepAlive</key>
          <false/>
          <key>Label</key>
          <string>#{plist_name}</string>
          <key>ProgramArguments</key>
          <array>
            <string>#{opt_bin}/elasticsearch</string>
          </array>
          <key>EnvironmentVariables</key>
          <dict>
          </dict>
          <key>RunAtLoad</key>
          <true/>
          <key>WorkingDirectory</key>
          <string>#{var}</string>
          <key>StandardErrorPath</key>
          <string>#{var}/log/elasticsearch.log</string>
          <key>StandardOutPath</key>
          <string>#{var}/log/elasticsearch.log</string>
        </dict>
      </plist>
    EOS
  end

  test do
    port = free_port
    (testpath/"data").mkdir
    (testpath/"logs").mkdir
    fork do
      exec bin/"elasticsearch", "-Ehttp.port=#{port}",
                                "-Epath.data=#{testpath}/data",
                                "-Epath.logs=#{testpath}/logs"
    end
    sleep 20
    output = shell_output("curl -s -XGET localhost:#{port}/")
    assert_equal "oss", JSON.parse(output)["version"]["build_flavor"]

    system "#{bin}/elasticsearch-plugin", "list"
  end
end


text:
// Ayasdi Inc. Copyright 2014
// Grapher.js may be freely distributed under the Apache 2.0 license

;(function () {

/**
  * Grapher
  * =======
  * WebGL network grapher rendering with PIXI
  */
  function Grapher () {
    this.initialize.apply(this, arguments);
    return this;
  }

/**
  * Helpers and Renderers
  * =====================
  * Load helpers and renderers.
  */
  var WebGLRenderer = Grapher.WebGLRenderer = require('./renderers/gl/renderer.js'),
      CanvasRenderer = Grapher.CanvasRenderer = require('./renderers/canvas/renderer.js'),
      Color = Grapher.Color = require('./helpers/color.js'),
      Link = Grapher.Link = require('./helpers/link.js'),
      Node = Grapher.Node = require('./helpers/node.js'),
      Shaders = Grapher.Shaders = require('./helpers/shaders.js'),
      u = Grapher.utils = require('./helpers/utilities.js');

  Grapher.prototype = {};

  /**
    * grapher.initialize
    * ------------------
    *
    * Initialize is called when a grapher instance is created:
    *
    *     var grapher = new Grapher(width, height, options);
    *
    */
  Grapher.prototype.initialize = function (o) {
    if (!o) o = {};

    // Extend default properties with options
    this.props = u.extend({
      color: 0xff222222,
      scale: 1,
      translate: [0, 0],
      resolution: window.devicePixelRatio || 1
    }, o);

    if (!o.canvas) this.props.canvas = document.createElement('canvas');
    this.canvas = this.props.canvas;

    var webGL = this._getWebGL();
    if (webGL) {
      this.props.webGL = webGL;
      this.props.canvas.addEventListener('webglcontextlost', function (e) { this._onContextLost(e); }.bind(this));
      this.props.canvas.addEventListener('webglcontextrestored', function (e) { this._onContextRestored(e); }.bind(this));
      this.props.linkShaders = new Shaders(this.props.linkShaders);
      this.props.nodeShaders = new Shaders(this.props.nodeShaders);
    }

    // Renderer and view
    this.renderer =  webGL ? new WebGLRenderer(this.props) : new CanvasRenderer(this.props);
    this.rendered = false;

    // Sprite array
    this.links = [];
    this.nodes = [];

    this.renderer.setLinks(this.links);
    this.renderer.setNodes(this.nodes);

    // Indices that will update
    this.willUpdate = {};
    this.updateAll = {};
    this._clearUpdateQueue();

    // Bind some updaters
    this._updateLink = u.bind(this._updateLink, this);
    this._updateNode = u.bind(this._updateNode, this);
    this._updateLinkByIndex = u.bind(this._updateLinkByIndex, this);
    this._updateNodeByIndex = u.bind(this._updateNodeByIndex, this);
    this.animate = u.bind(this.animate, this);

    // Event Handlers
    this.handlers = {};

    // Do any additional setup
    u.eachKey(o, this.set, this);
  };

  /**
    * grapher.set
    * ------------------
    *
    * General setter for a grapher's properties.
    *
    *     grapher.set(1, 'scale');
    */
  Grapher.prototype.set = function (val, key) {
    var setter = this[key];
    if (setter && u.isFunction(setter))
      return setter.call(this, val);
  };

  /**
    * grapher.on
    * ------------------
    *
    * Add a listener to a grapher event. Only one listener can be bound to an
    * event at this time. Available events:
    *
    *   * mousedown
    *   * mouseover
    *   * mouseup
    */
  Grapher.prototype.on = function (event, fn) {
    this.handlers[event] = this.handlers[event] || [];
    this.handlers[event].push(fn);
    this.canvas.addEventListener(event, fn, false);
    return this;
  };

  /**
    * grapher.off
    * ------------------
    *
    * Remove a listener from an event, or all listeners from an event if fn is not specified.
    */
  Grapher.prototype.off = function (event, fn) {
    var removeHandler = u.bind(function (fn) {
      var i = u.indexOf(this.handlers[event], fn);
      if (i > -1) this.handlers[event].splice(i, 1);
      this.canvas.removeEventListener(event, fn, false);
    }, this);

    if (fn && this.handlers[event]) removeHandler(fn);
    else if (u.isUndefined(fn) && this.handlers[event]) u.each(this.handlers[event], removeHandler);

    return this;
  };

  /**
    * grapher.data
    * ------------------
    *
    * Accepts network data in the form:
    *
    *     {
    *       nodes: [{x: 0, y: 0, r: 20, color: (swatch or hex/rgb)}, ... ],
    *       links: [{from: 0, to: 1, color: (swatch or hex/rgb)}, ... ]
    *     }
    */
  Grapher.prototype.data = function (data) {
    if (u.isUndefined(data)) return this.props.data;

    this.props.data = data;
    this.exit();
    this.enter();
    this.update();

    return this;
  };

  /**
    * grapher.enter
    * ------------------
    *
    * Creates node and link sprites to match the number of nodes and links in the
    * data.
    */
  Grapher.prototype.enter = function () {
    var data = this.data();
    if (this.links.length < data.links.length) {
      var links = data.links.slice(this.links.length, data.links.length);
      u.eachPop(links, u.bind(function () { this.links.push(new Link()); }, this));
    }

    if (this.nodes.length < data.nodes.length) {
      var nodes = data.nodes.slice(this.nodes.length, data.nodes.length);
      u.eachPop(nodes, u.bind(function () { this.nodes.push(new Node()); }, this));
    }

    return this;
  };

  /**
    * grapher.exit
    * ------------------
    *
    * Removes node and link sprites to match the number of nodes and links in the
    * data.
    */
  Grapher.prototype.exit = function () {
    var data = this.data(),
        exiting = [];

    if (data.links.length < this.links.length) {
      this.links.splice(data.links.length, this.links.length - data.links.length);
    }
    if (data.nodes.length < this.nodes.length) {
      this.nodes.splice(data.nodes.length, this.nodes.length - data.nodes.length);
    }

    return this;
  };

  /**
    * grapher.update
    * ------------------
    *
    * Add nodes and/or links to the update queue by index. Passing in no arguments will
    * add all nodes and links to the update queue. Node and link sprites in the update
    * queue are updated at the time of rendering.
    *
    *     grapher.update(); // updates all nodes and links
    *     grapher.update('links'); // updates only links
    *     grapher.update('nodes', 0, 4); // updates nodes indices 0 to 3 (4 is not inclusive)
    *     grapher.update('links', [0, 1, 2, 6, 32]); // updates links indexed by the indices
    */
  Grapher.prototype.update = function (type, start, end) {
    var indices;
    if (u.isArray(start)) indices = start;
    else if (u.isNumber(start) && u.isNumber(end)) indices = u.range(start, end);

    if (u.isArray(indices)) {
      this._addToUpdateQueue(type, indices);
      if (type === NODES) this._addToUpdateQueue(LINKS, this._findLinks(indices));
    } else {
      if (type !== NODES) this.updateAll.links = true;
      if (type !== LINKS) this.updateAll.nodes = true;
    }
    return this;
  };

  /**
    * grapher.updateNode
    * ------------------
    *
    * Add an individual node to the update queue. Optionally pass in a boolean to
    * specify whether or not to also add links connected with the node to the update queue.
    */
  Grapher.prototype.updateNode = function (index, willUpdateLinks) {
    this._addToUpdateQueue(NODES, [index]);
    if (willUpdateLinks) this._addToUpdateQueue(LINKS, this._findLinks([index]));
    return this;
  };

  /**
    * grapher.updateLink
    * ------------------
    *
    * Add an individual link to the update queue.
    */
  Grapher.prototype.updateLink = function (index) {
    this._addToUpdateQueue(LINKS, [index]);
    return this;
  };

  /**
    * grapher.clear
    * ------------------
    *
    * Clears the canvas and grapher data.
    */
  Grapher.prototype.clear = function () {
    this.data({links: [], nodes: []});
    this.render();
    return this;
  };

  /**
    * grapher.render
    * ------------------
    *
    * Updates each sprite and renders the network.
    */
  Grapher.prototype.render = function () {
    this.rendered = true;
    this._update();
    this.renderer.render();
    return this;
  };

  /**
    * grapher.animate
    * ------------------
    *
    * Calls render in a requestAnimationFrame loop.
    */
  Grapher.prototype.animate = function (time) {
    this.render();
    this.currentFrame = requestAnimationFrame(this.animate);
  };

  /**
    * grapher.play
    * ------------------
    *
    * Starts the animate loop.
    */
  Grapher.prototype.play = function () {
    this.currentFrame = requestAnimationFrame(this.animate);
    return this;
  };

  /**
    * grapher.pause
    * ------------------
    *
    * Pauses the animate loop.
    */
  Grapher.prototype.pause = function () {
    if (this.currentFrame) cancelAnimationFrame(this.currentFrame);
    this.currentFrame = null;
    return this;
  };

  /**
    * grapher.resize
    * ------------------
    *
    * Resize the grapher view.
    */
  Grapher.prototype.resize = function (width, height) {
    this.renderer.resize(width, height);
    return this;
  };

  /**
    * grapher.width
    * ------------------
    *
    * Specify or retrieve the width.
    */
  Grapher.prototype.width = function (width) {
    if (u.isUndefined(width)) return this.canvas.clientWidth;
    this.resize(width, null);
    return this;
  };

   /**
    * grapher.height
    * ------------------
    *
    * Specify or retrieve the height.
    */
  Grapher.prototype.height = function (height) {
    if (u.isUndefined(height)) return this.canvas.clientHeight;
    this.resize(null, height);
    return this;
  };

  /**
    * grapher.transform
    * ------------------
    *
    * Set the scale and translate as an object.
    * If no arguments are passed in, returns the current transform object.
    */
  Grapher.prototype.transform = function (transform) {
    if (u.isUndefined(transform))
      return {scale: this.props.scale, translate: this.props.translate};

    this.scale(transform.scale);
    this.translate(transform.translate);
    return this;
  };

  /**
    * grapher.scale
    * ------------------
    *
    * Set the scale.
    * If no arguments are passed in, returns the current scale.
    */
  Grapher.prototype.scale = function (scale) {
    if (u.isUndefined(scale)) return this.props.scale;
    if (u.isNumber(scale)) this.props.scale = scale;
    this.updateTransform = true;
    return this;
  };

  /**
    * grapher.translate
    * ------------------
    *
    * Set the translate.
    * If no arguments are passed in, returns the current translate.
    */
  Grapher.prototype.translate = function (translate) {
    if (u.isUndefined(translate)) return this.props.translate;
    if (u.isArray(translate)) this.props.translate = translate;
    this.updateTransform = true;
    return this;
  };

  /**
    * grapher.color
    * ------------------
    *
    * Set the default color of nodes and links.
    * If no arguments are passed in, returns the current default color.
    */
  Grapher.prototype.color = function (color) {
    if (u.isUndefined(color)) return this.props.color;
    this.props.color = Color.parse(color);
    return this;
  };

  /**
    * grapher.getDataPosition
    * ------------------
    *
    * Returns data space coordinates given display coordinates.
    * If a single argument passed in, function considers first argument an object with x and y props.
    */
  Grapher.prototype.getDataPosition = function (x, y) {
    var xCoord = u.isUndefined(y) ? x.x : x;
    var yCoord = u.isUndefined(y) ? x.y : y;
    x = this.renderer.untransformX(xCoord);
    y = this.renderer.untransformY(yCoord);
    return {x: x, y: y};
  };

  /**
  * grapher.getDisplayPosition
  * ------------------
  *
  * Returns display space coordinates given data coordinates.
  * If a single argument passed in, function considers first argument an object with x and y props.
  */
  Grapher.prototype.getDisplayPosition = function (x, y) {
    var xCoord = u.isUndefined(y) ? x.x : x;
    var yCoord = u.isUndefined(y) ? x.y : y;
    x = this.renderer.transformX(xCoord);
    y = this.renderer.transformY(yCoord);
    return {x: x, y: y};
  };

/**
  * Private Functions
  * =================
  *
  */

  /**
    * grapher._addToUpdateQueue
    * -------------------
    *
    * Add indices to the nodes or links update queue.
    *
    */
  Grapher.prototype._addToUpdateQueue = function (type, indices) {
    var willUpdate = type === NODES ? this.willUpdate.nodes : this.willUpdate.links,
        updateAll = type === NODES ? this.updateAll.nodes : this.updateAll.links,
        spriteSet = type === NODES ? this.nodes : this.links;

    var insert = function (n) { u.uniqueInsert(willUpdate, n); };
    if (!updateAll && u.isArray(indices)) u.each(indices, insert, this);

    updateAll = updateAll || willUpdate.length >= spriteSet.length;

    if (type === NODES) this.updateAll.nodes = updateAll;
    else this.updateAll.links = updateAll;
  };

  /**
    * grapher._clearUpdateQueue
    * -------------------
    *
    * Clear the update queue.
    *
    */
  Grapher.prototype._clearUpdateQueue = function () {
    this.willUpdate.links = [];
    this.willUpdate.nodes = [];
    this.updateAll.links = false;
    this.updateAll.nodes = false;
    this.updateTransform = false;
  };

  /**
    * grapher._update
    * -------------------
    *
    * Update nodes and links in the update queue.
    *
    */
  Grapher.prototype._update = function () {
    var updatingLinks = this.willUpdate.links,
        updatingNodes = this.willUpdate.nodes,
        i;

    if (this.updateAll.links) u.each(this.links, this._updateLink);
    else if (updatingLinks && updatingLinks.length) u.eachPop(updatingLinks, this._updateLinkByIndex);

    if (this.updateAll.nodes) u.each(this.nodes, this._updateNode);
    else if (updatingNodes && updatingNodes.length) u.eachPop(updatingNodes, this._updateNodeByIndex);

    if (this.updateTransform) {
      this.renderer.setScale(this.props.scale);
      this.renderer.setTranslate(this.props.translate);
    }

    this._clearUpdateQueue();
  };

  Grapher.prototype._updateLink = function (link, i) {
    var data = this.data(),
        l = data.links[i],
        from = data.nodes[l.from],
        to = data.nodes[l.to];

    var color = !u.isUndefined(l.color) ? this._findColor(l.color) :
        Color.interpolate(this._findColor(from.color), this._findColor(to.color));

    link.update(from.x, from.y, to.x, to.y, color);
  };

  Grapher.prototype._updateNode = function (node, i) {
    var n = this.data().nodes[i];
    node.update(n.x, n.y, n.r, this._findColor(n.color));
  };

  Grapher.prototype._updateNodeByIndex = function (i) { this._updateNode(this.nodes[i], i); };

  Grapher.prototype._updateLinkByIndex = function (i) { this._updateLink(this.links[i], i); };

  /**
    * grapher._findLinks
    * -------------------
    *
    * Search for links connected to the node indices provided.
    *
    * isLinked is a helper function that returns true if a link is
    * connected to a node in indices.
    */
  var isLinked = function (indices, l) {
    var i, len = indices.length, flag = false;
    for (i = 0; i < len; i++) {
      if (l.to == indices[i] || l.from == indices[i]) {
        flag = true;
        break;
      }
    }
    return flag;
  };

  Grapher.prototype._findLinks = function (indices) {
    var links = this.data().links,
        i, numLinks = links.length,
        updatingLinks = [];

    for (i = 0; i < numLinks; i++) {
      if (isLinked(indices, links[i])) updatingLinks.push(i);
    }

    return updatingLinks;
  };

  /**
    * grapher._findColor
    * -------------------
    *
    * Search for a color whether it's defined by palette index, string,
    * integer.
    */
  Grapher.prototype._findColor = function (c) {
    var color = Color.parse(c);

    // if color is still not set, use the default
    if (u.isNaN(color)) color = this.color();
    return color;
  };

  /**
    * grapher._getWebGL
    * -------------------
    *
    *get webGL context if available
    *
    */
  Grapher.prototype._getWebGL = function () {
    var gl = null;
    try { gl = this.canvas.getContext("webgl") || this.canvas.getContext("experimental-webgl"); }
    catch (x) { gl = null; }
    return gl;
  };

 /**
    * grapher._onContextLost
    * ----------------------
    *
    * Handle context lost.
    *
    */
  Grapher.prototype._onContextLost = function (e) {
    e.preventDefault();
    if (this.currentFrame) cancelAnimationFrame(this.currentFrame);
  };

  /**
    * grapher._onContextRestored
    * --------------------------
    *
    * Handle context restored.
    *
    */
  Grapher.prototype._onContextRestored = function (e) {
    var webGL = this._getWebGL();
    this.renderer.initGL(webGL);
    if (this.currentFrame) this.play(); // Play the graph if it was running.
    else if (this.rendered) this.render();
  };

/**
  * Grapher Static Properties
  * =========================
  */
  var NODES = Grapher.NODES = 'nodes';
  var LINKS = Grapher.LINKS = 'links';

  if (module && module.exports) module.exports = Grapher;
})();


text:
.. PySO8601 documentation master file, created by
   sphinx-quickstart on Thu Jan 13 17:43:40 2011.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Documentation for PySO8601
==========================

.. include:: ../../README.rst

----------------
Module Contents:
----------------

.. automodule:: PySO8601
   :members:
   :inherited-members:


text:
(function($) {
	'use strict';

	/**
	 * (en) Agent 모든 Ajax 요청을 대리함.
	 * @ko Agent 모든 Ajax 요청을 대리함.
	 * @group Service
	 * @name AgentAjaxService
	 * @class
	 */
	pinpointApp.constant('AgentAjaxServiceConfig', {
		"agentList": "/getAgentList.pinpoint",				// agentId, timestamp ( or agentId, from, to )
		"agentInfo": "/getAgentInfo.pinpoint", 				// agentId, timestamp
		"agetEvent": "/getAgentEvent.pinpoint", 				// agentId, eventTimestamp, eventTypeCode
		"agentStatus": "/getAgentStatus.pinpoint", 			// agentId, timestamp
		"agentEventList": "/getAgentEvents.pinpoint", 		// agentId, from, to
		"agentStateForChart": "/getAgentStat.pinpoint"		//
	});

	pinpointApp.service('AgentAjaxService', [ 'AgentAjaxServiceConfig', '$http', function ($config, $http) {
		this.getAgentList = function(data, callback) {
			retrieve($config.agentList, data, callback);
		};
		this.getAgentStateForChart = function( data, callback ) {
			retrieve($config.agentStateForChart, data, callback);
		};
		this.getAgentInfo = function( data, callback ) {
			retrieve($config.agentInfo, data, callback);
		};
		this.getEventList = function( data, callback ) {
			data.exclude = "10199";
			retrieve($config.agentEventList, data, callback);
		};
		this.getEvent = function( data, callback ) {
			retrieve($config.agetEvent, data, callback);
		};

		function retrieve(url, data, callback) {
			$http.get(url +  getQueryStr( data ) ).then(function(result) {
				callback(result.data);
			}, function(error) {
				callback(error);
			});
		}
		function getQueryStr( o ) {
			var query = "?";
			for( var p in o ) {
				query += ( query == "?" ? "" : "&" ) + p + "=" + o[p];
			}
			return query;
		}
	}]);
})(jQuery);


text:
using Microsoft.VisualStudio.Text;
using System;
using System.Collections.Generic;
using System.Linq;

namespace HumansTxtLanguageService.Syntax
{
    public class HumansTxtDocumentSyntax : SyntaxNode
    {
        public HumansTxtDocumentSyntax(IList<HumansTxtSectionSyntax> sections)
        {
            this.Sections = sections;
            this.LeadingTrivia = new List<SnapshotToken>();
            this.TrailingTrivia = new List<SnapshotToken>();
        }

        public ITextSnapshot Snapshot { get; set; }

        public IList<HumansTxtSectionSyntax> Sections { get; set; }

        public IList<SnapshotToken> LeadingTrivia { get; set; }

        public IList<SnapshotToken> TrailingTrivia { get; set; }

        public override SnapshotSpan Span
        {
            get
            {
                if (!this.Sections.Any())
                    return new SnapshotSpan(this.Snapshot, 0, 0);

                return new SnapshotSpan(
                    this.Sections.First().Span.Start,
                    this.Sections.Last().Span.End
                );
            }
        }

        public override SnapshotSpan FullSpan
        {
            get
            {
                return new SnapshotSpan(this.Snapshot, 0, this.Snapshot.Length);
            }
        }

        public override SyntaxNode Parent
        {
            get
            {
                return null;
            }
        }

        public override IEnumerable<SyntaxNode> Descendants()
        {
            return this.Sections.SelectMany(s => s.DescendantsAndSelf());
        }

        public override IEnumerable<SnapshotToken> GetTokens()
        {
            return (this.LeadingTrivia)
                .Concat(this.Sections.SelectMany(s => s.GetTokens()))
                .Concat(this.TrailingTrivia)
            ;
        }
    }
}


text:
@class IDESchemeActionResult, IDESchemeActionTestSummaryGroup, IDESchemeActionTestableSummary, NSMutableArray, NSString;

@interface IDETestsSummariesBuilder : NSObject <IDETestsObserver>
{
    IDESchemeActionTestableSummary *_currentTestableSummary;
    IDESchemeActionTestSummaryGroup *_currentTestGroup;
    NSMutableArray *_testSuiteStack;
    NSMutableArray *_performanceMetricSummaries;
    NSMutableArray *_failureSummaries;
    NSMutableArray *_activitySummaries;
    NSMutableArray *_currentActivityStack;
    IDESchemeActionResult *_actionResult;
}

@property(retain) IDESchemeActionResult *actionResult; // @synthesize actionResult=_actionResult;
- (void)didFinishTest:(id)arg1 withTestResult:(id)arg2 rawOutput:(id)arg3;
- (void)didFailTest:(id)arg1 withTestResultMessage:(id)arg2 rawOutput:(id)arg3;
- (void)test:(id)arg1 didMeasurePerformanceMetric:(id)arg2 rawOutput:(id)arg3;
- (void)test:(id)arg1 didFinishActivity:(id)arg2;
- (void)test:(id)arg1 willStartActivity:(id)arg2;
- (void)didStartTest:(id)arg1 withRawOutput:(id)arg2;
- (void)testOperationGroupDidFinish;
- (void)testOperationWillFinishWithSuccess:(BOOL)arg1 withError:(id)arg2;
- (void)testSuiteDidFinish:(long long)arg1 withFailures:(long long)arg2 unexpected:(long long)arg3 testDuration:(double)arg4 totalDuration:(double)arg5 rawOutput:(id)arg6;
- (void)testSuite:(id)arg1 willFinishAt:(id)arg2 rawOutput:(id)arg3;
- (void)testDidOutput:(id)arg1;
- (void)testSuite:(id)arg1 didStartAt:(id)arg2 rawOutput:(id)arg3;
- (void)testRunner:(id)arg1 didLaunchTestSessionForScheme:(id)arg2 withDisplayName:(id)arg3;
- (id)initWithActionResult:(id)arg1;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end