text:
from distutils.core import setup

with open('README.rst', 'r') as f:
    desc = f.read()

setup(name='wild_sphinx_theme',
    version=__import__('wild_sphinx_theme').__version__,
    description='Like Nature sphinx theme but allows pygments style to be dark',
    long_description=desc,
    packages=['wild_sphinx_theme'],
    package_data={"wild_sphinx_theme": ["wild/*.*", "wild/static/*.*"]},
    url='https://github.com/rhardouin/wild-sphinx-theme',
    author='Romain Hardouin',
    author_email='romain_hardouin@yahoo.fr',
    license = "BSD",
    keywords = ["sphinx", "theme", "wild"],
    download_url = "https://pypi.python.org/pypi/wild_sphinx_theme",
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
        'Topic :: Documentation',
        'Topic :: Software Development :: Documentation',
    ]
)

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace app\modules\content\models;

use app\components\lang\Lang;
use app\components\models\ActiveRecord;
use app\modules\upload\models\Upload;
use app\modules\sitemap\behaviors\SitemapBehavior;
use omgdef\multilingual\MultilingualBehavior;
use omgdef\multilingual\MultilingualQuery;
use Yii;
use yii\helpers\Url;

/**
 * This is the model class for table "{{%content}}".
 *
 * @property integer $id
 * @property string $alias
 * @property integer $enabled
 * @property integer $type
 * @property integer $parent_id
 * @property integer $image_id
 * @property integer $sort
 * @property integer $publish_date
 * @property integer $created_by
 * @property integer $updated_by
 * @property integer $created_at
 * @property integer $updated_at
 */
class Content extends ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%content}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['enabled', 'type', 'parent_id', 'image_id', 'sort', 'created_by', 'updated_by', 'created_at', 'updated_at'], 'integer'],
            [['alias'], 'string', 'max' => 255],
            [['available_translations'], 'string', 'max' => 100],
            ['publish_date', 'date', 'format' => 'yyyy-M-d H:m:s'],
            [$this->getMultilingualAttributes(),'safe'
                ,'on'=>self::SCENARIO_MULTILINGUAL_UPDATE
            ]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'alias' => 'Alias',
            'enabled' => 'Enabled',
            'type' => 'Type',
            'parent_id' => 'Parent',
            'image_id' => 'Image',
            'sort' => 'Sort',
            'publish_date' => 'Publish Date',
            'created_by' => 'Created By',
            'updated_by' => 'Updated By',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'timestamp' => [
                'class' => 'yii\behaviors\TimestampBehavior',
                'attributes' => [
                    ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
                    ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
                ],
            ],
            'blameable' => [
                'class' => 'yii\behaviors\BlameableBehavior',
                'attributes' => [
                    ActiveRecord::EVENT_BEFORE_INSERT => ['created_by', 'updated_by'],
                    ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_by'],
                ],
            ],
            'ml' => [
                'class' => MultilingualBehavior::className(),
                'languages' => Yii::$app->lang->getLanguages(),
                'defaultLanguage' => Yii::$app->params['defaultLanguage'],
                'langForeignKey' => 'entity_id',
                'tableName' => "{{%content_lang}}",
                'attributes' => [
                    'title', 'content', 'short_content', 'seo_keywords', 'seo_description'
                ]
            ],
            'sitemap' => [
                'class' => SitemapBehavior::className(),
                'scope' => function ($model) {
                    $model->select(['alias', 'updated_at', 'type', 'available_translations']);
                    $model->andWhere(['enabled' => 1]);
                },
                'dataClosure' => function ($model) {
                    $out = [];
                    $translations = explode(',', $model->available_translations);
                    $alias = ltrim($model->alias, '/');
                    foreach ($translations as $key) {
                        $url = Yii::$app->getUrlManager()->getHostInfo() . '/' . $key . ($alias ? '/' . $alias : '');
                        $data = [
                           'loc' => $url,
                           'lastmod' => $model->updated_at,
                           'changefreq' => SitemapBehavior::CHANGEFREQ_DAILY,
                           'priority' => 0.8,
                           'translations' => [],
                        ];
                        foreach ($translations as $translationKey) {
                            $data['translations'][$translationKey] = Yii::$app->getUrlManager()->getHostInfo() . '/' . $translationKey . ($alias ? '/' . $alias : '');
                        }
                        $out[]=$data;
                    }
                    return $out;
                }
            ],
       ];
    }

    public function fields()
    {
        return array_merge($this->getMultilingualAttributes(),
            ['id']);
    }

    public function getMultilingualAttributes(){
        $result = [];
        /** @var MultilingualBehavior $ml */
        if(isset($this->behaviors()['ml'])){
            $ml = $this->behaviors()['ml'];
            foreach($ml['languages'] as $lang=>$langName){
                foreach($ml['attributes'] as $attr)
                    if($ml['defaultLanguage'] === $lang)
                        $result[] = $attr;
                    else
                        $result[] = $attr . '_' . $lang;
            }
        }
        return $result;
    }

    public static function find()
    {
        return new MultilingualQuery(get_called_class());
    }

    /**
     * We're overriding this method to fill findAll() and similar method result
     * with proper models.
     *
     * @param array $row
     * @return Content
     */

    public static function instantiate($row)
    {
        switch ($row['type']){
            case Page::TYPE:
                return new Page();
            case Slide::TYPE:
                return new Slide();
            case TopMenu::TYPE:
                return new TopMenu();
            case News::TYPE:
                return new News();
            default:
                return new self;
        }
    }

    public function getImage(){
        return $this->hasOne(Upload::className(), ['id'=>'image_id']);
    }

    public function getChildren(){
        return $this->hasMany(self::className(), ['parent_id'=>'id'])->sorted();
    }

    public function beforeSave($insert){
        $languages = Yii::$app->lang->getLanguages();
        $defaultLanguage = Yii::$app->params['defaultLanguage'];

        foreach ($languages as $key => $language) {
            $contentAttributeName = ($key === $defaultLanguage ? 'content' : 'content_'.$key);
            $shortContentAttributeName = ($key === $defaultLanguage ? 'short_content' : 'short_content_'.$key);

            if(preg_match('~
~s', $this->{$contentAttributeName})){
                $this->{$shortContentAttributeName} =  preg_replace('~
.+~s', '', $this->{$contentAttributeName});
            }

        }

        return parent::beforeSave($insert);
    }

}


text:
package com.cloud.ha;

import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import javax.ejb.Local;
import javax.naming.ConfigurationException;

import com.cloud.alert.AlertManager;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.server.ManagementServer;
import com.cloud.usage.dao.UsageJobDao;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.utils.component.Inject;
import com.cloud.utils.db.Transaction;

@Local(value={HighAvailabilityManager.class})
public class HighAvailabilityManagerExtImpl extends HighAvailabilityManagerImpl {

    @Inject
	UsageJobDao _usageJobDao;
    ConfigurationDao configDao;

	@Override
	public boolean configure(final String name, final Map<String, Object> xmlParams) throws ConfigurationException {
		super.configure(name, xmlParams);

		ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name);

        configDao = locator.getDao(ConfigurationDao.class);
        if (configDao == null)
        {
        	s_logger.warn("Unable to get a configuration dao to check config value for enableUsageServer");
        	return false;
        }

        return true;
	}

	@Override
    public boolean start()
	{
		super.start();

        boolean enableUsage = new Boolean(configDao.getValue("enable.usage.server"));

        //By default, usage is enabled for production
        //Devs might override this value to disable usage in their setup
        if(enableUsage)
        {
        	_executor.scheduleAtFixedRate(new UsageServerMonitorTask(), 60*60, 10*60, TimeUnit.SECONDS); // schedule starting in one hour to execute every 10 minutes
        }

        return true;
    }

	protected class UsageServerMonitorTask implements Runnable {
        @Override
        public void run() {
            if (s_logger.isInfoEnabled()) {
                s_logger.info("checking health of usage server");
            }

            try {
                boolean isRunning = false;
                Transaction txn = Transaction.open(Transaction.USAGE_DB);
                try {
                    Date lastHeartbeat = _usageJobDao.getLastHeartbeat();
                    if (lastHeartbeat != null) {
                        long sinceLastHeartbeat = System.currentTimeMillis() - lastHeartbeat.getTime();
                        if (sinceLastHeartbeat <= (10 * 60 * 1000)) {
                            // if it's been less than 10 minutes since the last heartbeat, then it appears to be running, otherwise send an alert
                            isRunning = true;
                        }
                    }
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("usage server running? " + isRunning + ", heartbeat: " + lastHeartbeat);
                    }
                } finally {
                    txn.close();

                    // switch back to VMOPS db
                    Transaction swap = Transaction.open(Transaction.CLOUD_DB);
                    swap.close();
                }

                if (!isRunning) {
                    _alertMgr.sendAlert(AlertManager.ALERT_TYPE_USAGE_SERVER, 0, new Long(0), "No usage server process running", "No usage server process has been detected, some attention is required");
                } else {
                    _alertMgr.clearAlert(AlertManager.ALERT_TYPE_USAGE_SERVER, 0, 0);
                }
            } catch (Exception ex) {
                s_logger.warn("Error while monitoring usage job", ex);
            }
        }
    }
}


text:
ZOOBIN="${BASH_SOURCE-$0}"
ZOOBIN=`dirname ${ZOOBIN}`
ZOOBINDIR=`cd ${ZOOBIN}; pwd`

if [ -e "$ZOOBIN/../libexec/zkEnv.sh" ]; then
  . "$ZOOBINDIR"/../libexec/zkEnv.sh
else
  . "$ZOOBINDIR"/zkEnv.sh
fi

usage() {
  # the configfile will be properly formatted as long as the
  # configfile path is less then 40 chars, otw the line will look a
  # bit weird, but otherwise it's fine
  printf "usage: $0 <parameters>
  Optional parameters:
     -h                                                    Display this message
     --help                                                Display this message
     --configfile=%-40s ZooKeeper config file
     --myid=#                                              Set the myid to be used, if any (1-255)
     --force                                               Force creation of the data/txnlog dirs
" "$ZOOCFG"
  exit 1
}

OPTS=$(getopt \
  -n $0 \
  -o 'h' \
  -l 'help' \
  -l 'configfile:' \
  -l 'myid:' \
  -l 'force' \
  -- "$@")

if [ $? != 0 ] ; then
    usage
    exit 1
fi

initialize() {
    if [ ! -e "$ZOOCFG" ]; then
        echo "Unable to find config file at $ZOOCFG"
        exit 1
    fi

    ZOO_DATADIR=$(grep "^[[:space:]]*dataDir" "$ZOOCFG" | sed -e 's/.*=//')
    ZOO_DATALOGDIR=$(grep "^[[:space:]]*dataLogDir" "$ZOOCFG" | sed -e 's/.*=//')

    if [ -z "$ZOO_DATADIR" ]; then
        echo "Unable to determine dataDir from $ZOOCFG"
        exit 1
    fi

    if [ $FORCE ]; then
        echo "Force enabled, data/txnlog directories will be re-initialized"
    else
        # we create if version-2 exists (ie real data), not the
        # parent. See comments in following section for more insight
        if [ -d "$ZOO_DATADIR/version-2" ]; then
            echo "ZooKeeper data directory already exists at $ZOO_DATADIR (or use --force to force re-initialization)"
            exit 1
        fi

        if [ -n "$ZOO_DATALOGDIR" ] && [ -d "$ZOO_DATALOGDIR/version-2" ]; then
            echo "ZooKeeper txnlog directory already exists at $ZOO_DATALOGDIR (or use --force to force re-initialization)"
            exit 1
        fi
    fi

    # remove the child files that we're (not) interested in, not the
    # parent. this allows for parent to be installed separately, and
    # permissions to be set based on overarching requirements. by
    # default we'll use the permissions of the user running this
    # script for the files contained by the parent. note also by using
    # -p the parent(s) will be created if it doesn't already exist
    rm -rf "$ZOO_DATADIR/myid" 2>/dev/null >/dev/null
    rm -rf "$ZOO_DATADIR/version-2" 2>/dev/null >/dev/null
    mkdir -p "$ZOO_DATADIR/version-2"

    if [ -n "$ZOO_DATALOGDIR" ]; then
        rm -rf "$ZOO_DATALOGDIR/myid" 2>/dev/null >/dev/null
        rm -rf "$ZOO_DATALOGDIR/version-2" 2>/dev/null >/dev/null
        mkdir -p "$ZOO_DATALOGDIR/version-2"
    fi

    if [ $MYID ]; then
        echo "Using myid of $MYID"
        echo $MYID > "$ZOO_DATADIR/myid"
    else
        echo "No myid provided, be sure to specify it in $ZOO_DATADIR/myid if using non-standalone"
    fi
}

eval set -- "${OPTS}"
while true; do
  case "$1" in
    --configfile)
      ZOOCFG=$2; shift 2
      ;;
    --myid)
      MYID=$2; shift 2
      ;;
    --force)
      FORCE=1; shift 1
      ;;
    -h)
      usage
      ;;
    --help)
      usage
      ;;
    --)
      initialize
      break
      ;;
    *)
      echo "Unknown option: $1"
      usage
      exit 1
      ;;
  esac
done


text:
function endModule() {
    module.exports = Object.freeze({
        clip        : clip,
        clipCircular: clipCircular
    });
}

function clip(value, min, max) {
    return value > max ? max
         : value < min ? min
         : value;
}

function clipCircular(value, min, max) {
    var d = max - min;
    return ((value - min) % d + d) % d + min;
}

endModule();


text:
Arduino C programing
====================

Build on Debian GNU/Linux.
Running with Arduino Mega 2560.


text:
/* jshint unused:false, curly:false */
/* globals randomColor */

function getMoodScore(data) {
  if (data.children === undefined) {
    switch (data.name) {
      case "Cheerfulness":
        return 50 * data.normalized_score;
      case "Negative":
        return -50 * data.normalized_score;
      case "Anger":
        return -50 * data.normalized_score;
      case "Analytical":
        return -10 * data.normalized_score;
      case "Confident":
        return 25 * data.normalized_score;
      case "Tentative":
        return -25 * data.normalized_score;
      case "Openness":
        return 17 * data.normalized_score;
      case "Agreeableness":
        return 17 * data.normalized_score;
      case "Conscientiousness":
        return 17 * data.normalized_score;
    }
    return 0;
  }

  var sum = 0.0;
  for (var s in data.children) {
    sum += getMoodScore(data.children[s]);
  }
  return sum;
}

function getMood(data) {
  var score = getMoodScore(data);
  var s = score / 5;

  if (s >= -1 && s <= 1) {
    return "Neutral";
  } else if (s > 0) {
    if (s <= 12)
      return "Happy";
    else
      return "Excited";
  } else {//if (s < 0) {
    if (s >= -12)
      return "Sad";
    else
      return "Angry";
  }
}

function produceToneColoring(data) {
    // given: list of emotions, each a list of words
    // output a list of emotions and color, and a list of words by color
    var output = {
        emotions: {},
        words: {}
    };

    data.children.forEach(function(tone) {
        tone.children.forEach(function(emotion) {
            var color = randomColor({
                luminosity: 'dark'
            });
            output.emotions[emotion.name] = {
                name: emotion.name,
                color: color,
                words: emotion.linguistic_evidence[0].words,
                count: emotion.word_count
            };

            emotion.linguistic_evidence[0].words.forEach(function(word) {
                if (word.length > 2) {
                    output.words[word] = color;
                }
            });
        });
    });

    return output;
}


text:
module Users
  class BuildService < BaseService
    delegate :user_default_internal_regex_enabled?,
             :user_default_internal_regex_instance,
             to: :'Gitlab::CurrentSettings.current_application_settings'

    def initialize(current_user, params = {})
      @current_user = current_user
      @params = params.dup
    end

    def execute(skip_authorization: false)
      raise Gitlab::Access::AccessDeniedError unless skip_authorization || can_create_user?

      user_params = build_user_params(skip_authorization: skip_authorization)
      user = User.new(user_params)

      if current_user&.admin?
        @reset_token = user.generate_reset_token if params[:reset_password]

        if user_params[:force_random_password]
          random_password = Devise.friendly_token.first(Devise.password_length.min)
          user.password = user.password_confirmation = random_password
        end
      end

      identity_attrs = params.slice(:extern_uid, :provider)

      unless identity_attrs.empty?
        user.identities.build(identity_attrs)
      end

      user
    end

    private

    def can_create_user?
      (current_user.nil? && Gitlab::CurrentSettings.allow_signup?) || current_user&.admin?
    end

    # Allowed params for creating a user (admins only)
    def admin_create_params
      [
        :access_level,
        :admin,
        :avatar,
        :bio,
        :can_create_group,
        :color_scheme_id,
        :email,
        :external,
        :force_random_password,
        :hide_no_password,
        :hide_no_ssh_key,
        :linkedin,
        :name,
        :password,
        :password_automatically_set,
        :password_expires_at,
        :projects_limit,
        :remember_me,
        :skip_confirmation,
        :skype,
        :theme_id,
        :twitter,
        :username,
        :website_url,
        :private_profile,
        :organization,
        :location,
        :public_email
      ]
    end

    # Allowed params for user signup
    def signup_params
      [
        :email,
        :email_confirmation,
        :password_automatically_set,
        :name,
        :password,
        :username
      ]
    end

    def build_user_params(skip_authorization:)
      if current_user&.admin?
        user_params = params.slice(*admin_create_params)
        user_params[:created_by_id] = current_user&.id

        if params[:reset_password]
          user_params.merge!(force_random_password: true, password_expires_at: nil)
        end
      else
        allowed_signup_params = signup_params
        allowed_signup_params << :skip_confirmation if skip_authorization

        user_params = params.slice(*allowed_signup_params)
        if user_params[:skip_confirmation].nil?
          user_params[:skip_confirmation] = skip_user_confirmation_email_from_setting
        end
      end

      if user_default_internal_regex_enabled? && !user_params.key?(:external)
        user_params[:external] = user_external?
      end

      user_params
    end

    def skip_user_confirmation_email_from_setting
      !Gitlab::CurrentSettings.send_user_confirmation_email
    end

    def user_external?
      user_default_internal_regex_instance.match(params[:email]).nil?
    end
  end
end


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'PyConTutorialProposal.outline'
        db.add_column(u'pycon_pycontutorialproposal', 'outline',
                      self.gf('django.db.models.fields.TextField')(default=''),
                      keep_default=False)

        # Adding field 'PyConTutorialProposal.more_info'
        db.add_column(u'pycon_pycontutorialproposal', 'more_info',
                      self.gf('django.db.models.fields.TextField')(default=''),
                      keep_default=False)

    def backwards(self, orm):
        # Deleting field 'PyConTutorialProposal.outline'
        db.delete_column(u'pycon_pycontutorialproposal', 'outline')

        # Deleting field 'PyConTutorialProposal.more_info'
        db.delete_column(u'pycon_pycontutorialproposal', 'more_info')

    models = {
        u'auth.group': {
            'Meta': {'object_name': 'Group'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'auth.permission': {
            'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        u'conference.conference': {
            'Meta': {'object_name': 'Conference'},
            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'timezone': ('timezones.fields.TimeZoneField', [], {'default': "'US/Eastern'", 'max_length': '100', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'conference.section': {
            'Meta': {'object_name': 'Section'},
            'conference': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['conference.Conference']"}),
            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})
        },
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'proposals.additionalspeaker': {
            'Meta': {'unique_together': "(('speaker', 'proposalbase'),)", 'object_name': 'AdditionalSpeaker', 'db_table': "'proposals_proposalbase_additional_speakers'"},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'proposalbase': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['proposals.ProposalBase']"}),
            'speaker': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['speakers.Speaker']"}),
            'status': ('django.db.models.fields.IntegerField', [], {'default': '1'})
        },
        u'proposals.proposalbase': {
            'Meta': {'object_name': 'ProposalBase'},
            'abstract': ('django.db.models.fields.TextField', [], {}),
            'additional_notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'additional_speakers': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['speakers.Speaker']", 'symmetrical': 'False', 'through': u"orm['proposals.AdditionalSpeaker']", 'blank': 'True'}),
            'cancelled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'description': ('django.db.models.fields.TextField', [], {'max_length': '400'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'kind': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['proposals.ProposalKind']"}),
            'speaker': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'proposals'", 'to': u"orm['speakers.Speaker']"}),
            'submitted': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'proposals.proposalkind': {
            'Meta': {'object_name': 'ProposalKind'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'section': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'proposal_kinds'", 'to': u"orm['conference.Section']"}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
        },
        u'pycon.pyconposterproposal': {
            'Meta': {'object_name': 'PyConPosterProposal'},
            'audience_level': ('django.db.models.fields.IntegerField', [], {}),
            'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pycon.PyConProposalCategory']"}),
            u'proposalbase_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['proposals.ProposalBase']", 'unique': 'True', 'primary_key': 'True'}),
            'recording_release': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
        },
        u'pycon.pyconproposalcategory': {
            'Meta': {'object_name': 'PyConProposalCategory'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
        },
        u'pycon.pyconsponsortutorialproposal': {
            'Meta': {'object_name': 'PyConSponsorTutorialProposal', '_ormbases': [u'proposals.ProposalBase']},
            u'proposalbase_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['proposals.ProposalBase']", 'unique': 'True', 'primary_key': 'True'})
        },
        u'pycon.pycontalkproposal': {
            'Meta': {'object_name': 'PyConTalkProposal'},
            'audience_level': ('django.db.models.fields.IntegerField', [], {}),
            'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pycon.PyConProposalCategory']"}),
            'duration': ('django.db.models.fields.IntegerField', [], {}),
            'extreme': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            u'proposalbase_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['proposals.ProposalBase']", 'unique': 'True', 'primary_key': 'True'}),
            'recording_release': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
        },
        u'pycon.pycontutorialproposal': {
            'Meta': {'object_name': 'PyConTutorialProposal'},
            'audience_level': ('django.db.models.fields.IntegerField', [], {}),
            'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pycon.PyConProposalCategory']"}),
            'domain_level': ('django.db.models.fields.IntegerField', [], {}),
            'more_info': ('django.db.models.fields.TextField', [], {}),
            'outline': ('django.db.models.fields.TextField', [], {}),
            u'proposalbase_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['proposals.ProposalBase']", 'unique': 'True', 'primary_key': 'True'}),
            'recording_release': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
        },
        u'speakers.speaker': {
            'Meta': {'object_name': 'Speaker'},
            'annotation': ('django.db.models.fields.TextField', [], {}),
            'biography': ('django.db.models.fields.TextField', [], {}),
            'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'invite_email': ('django.db.models.fields.CharField', [], {'max_length': '200', 'unique': 'True', 'null': 'True', 'db_index': 'True'}),
            'invite_token': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_index': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'photo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
            'sessions_preference': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'twitter_username': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'speaker_profile'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.User']"})
        }
    }

    complete_apps = ['pycon']


text:
<!DOCTYPE html>

        <title><?php if(isset($page_title)) : ?><?php echo $page_title ?> - <?php endif; ?><?php echo $this->settings->info->site_name ?></title>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link href="<?php echo $this->common->theme_backend();?>bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="<?php echo $this->common->theme_backend();?>bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">

        <link href="<?php echo $this->common->theme_backend();?>styles/login_layout.css" rel="stylesheet" type="text/css">
        <link href="<?php echo $this->common->theme_backend();?>styles/responsive.css" rel="stylesheet" type="text/css">
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,500,600,700' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
		<link href="<?php echo $this->common->theme_backend();?>styles/costume.css" rel="stylesheet" type="text/css">

        <link rel="apple-touch-icon" sizes="57x57" href="<?php echo $this->common->theme_backend();?>images/favicon/apple-touch-icon-57x57.png">
        <link rel="apple-touch-icon" sizes="60x60" href="<?php echo $this->common->theme_backend();?>images/favicon/apple-touch-icon-60x60.png">
        <link rel="apple-touch-icon" sizes="72x72" href="<?php echo $this->common->theme_backend();?>images/favicon/apple-touch-icon-72x72.png">
        <link rel="apple-touch-icon" sizes="76x76" href="<?php echo $this->common->theme_backend();?>images/favicon/apple-touch-icon-76x76.png">
        <link rel="icon" type="image/png" href="<?php echo $this->common->theme_backend();?>images/favicon/favicon-32x32.png" sizes="32x32">
        <link rel="icon" type="image/png" href="<?php echo $this->common->theme_backend();?>images/favicon/favicon-16x16.png" sizes="16x16">
        <link rel="manifest" href="<?php echo $this->common->theme_backend();?>images/favicon/manifest.json">
        <link rel="mask-icon" href="<?php echo $this->common->theme_backend();?>images/favicon/safari-pinned-tab.svg" color="#5bbad5">
        <link rel="shortcut icon" href="<?php echo $this->common->theme_backend();?>images/favicon/favicon.ico">
        <meta name="msapplication-TileColor" content="#da532c">
        <meta name="msapplication-config" content="<?php echo base_url() ?>images/favicon/browserconfig.xml">
        <meta name="theme-color" content="#ffffff">

        <?php echo $cssincludes ?>

        <?php if($this->settings->info->install) : ?>

 <a href="<?php echo site_url("backend/install") ?>">Great job on uploading all the files and setting up the site correctly! Let's now create the Admin account and set the default settings. Click here! This message will disappear once you have run the install process.

        <?php endif; ?>
        <?php $gl = $this->session->flashdata('globalmsg'); ?>
        <?php if(!empty($gl)) :?>

 <?php echo $this->session->flashdata('globalmsg') ?>

        <?php endif; ?>

        <?php echo $content ?>


text:
from . import AWSHelperFn, AWSObject, AWSProperty, If, FindInMap, Ref
from .validators import boolean, integer, exactly_one, mutually_exclusive
from . import cloudformation

EC2_INSTANCE_LAUNCH = "autoscaling:EC2_INSTANCE_LAUNCH"
EC2_INSTANCE_LAUNCH_ERROR = "autoscaling:EC2_INSTANCE_LAUNCH_ERROR"
EC2_INSTANCE_TERMINATE = "autoscaling:EC2_INSTANCE_TERMINATE"
EC2_INSTANCE_TERMINATE_ERROR = "autoscaling:EC2_INSTANCE_TERMINATE_ERROR"
TEST_NOTIFICATION = "autoscaling:TEST_NOTIFICATION"

# Termination Policy constants
Default = 'Default'
OldestInstance = 'OldestInstance'
NewestInstance = 'NewestInstance'
OldestLaunchConfiguration = 'OldestLaunchConfiguration'
OldestLaunchTemplate = 'OldestLaunchTemplate'
ClosestToNextInstanceHour = 'ClosestToNextInstanceHour'
AllocationStrategy = 'AllocationStrategy'

class Tag(AWSHelperFn):
    def __init__(self, key, value, propogate):
        self.data = {
            'Key': key,
            'Value': value,
            'PropagateAtLaunch': propogate,
        }

class Tags(AWSHelperFn):
    defaultPropagateAtLaunch = True
    manyType = [type([]), type(())]

    def __init__(self, **kwargs):
        self.tags = []
        for k, v in sorted(kwargs.iteritems()):
            if type(v) in self.manyType:
                propagate = str(v[1]).lower()
                v = v[0]
            else:
                propagate = str(self.defaultPropagateAtLaunch).lower()
            self.tags.append({
                'Key': k,
                'Value': v,
                'PropagateAtLaunch': propagate,
            })

    # append tags to list
    def __add__(self, newtags):
        newtags.tags = self.tags + newtags.tags
        return newtags

    def to_dict(self):
        return self.tags

class LifecycleHookSpecification(AWSProperty):
    props = {
        'DefaultResult': (basestring, False),
        'HeartbeatTimeout': (basestring, False),
        'LifecycleHookName': (basestring, True),
        'LifecycleTransition': (basestring, True),
        'NotificationMetadata': (basestring, False),
        'NotificationTargetARN': (basestring, False),
        'RoleARN': (basestring, False),
    }

class NotificationConfigurations(AWSProperty):
    props = {
        'TopicARN': (basestring, True),
        'NotificationTypes': (list, True),
    }

class MetricsCollection(AWSProperty):
    props = {
        'Granularity': (basestring, True),
        'Metrics': (list, False),
    }

class Metadata(AWSHelperFn):
    def __init__(self, init, authentication=None):
        self.validate(init, authentication)
        # get keys and values from init and authentication

        # if there's only one data point, then we know its the default
        # cfn-init; where the key is 'config'
        if len(init.data) == 1:
            initKey, initValue = init.data.popitem()
            self.data = {initKey: initValue}
        else:
            self.data = init.data

        if authentication:
            authKey, authValue = authentication.data.popitem()
            self.data[authKey] = authValue

    def validate(self, init, authentication):
        if not isinstance(init, cloudformation.Init):
            raise ValueError(
                'init must be of type cloudformation.Init'
            )

        is_instance = isinstance(authentication, cloudformation.Authentication)
        if authentication and not is_instance:
            raise ValueError(
                'authentication must be of type cloudformation.Authentication'
            )

class LaunchTemplateSpecification(AWSProperty):
    props = {
        'LaunchTemplateId': (basestring, False),
        'LaunchTemplateName': (basestring, False),
        'Version': (basestring, True)
    }

    def validate(self):
        template_ids = [
            'LaunchTemplateId',
            'LaunchTemplateName'
        ]
        exactly_one(self.__class__.__name__, self.properties, template_ids)

class InstancesDistribution(AWSProperty):
    props = {
        'OnDemandAllocationStrategy': (basestring, False),
        'OnDemandBaseCapacity': (integer, False),
        'OnDemandPercentageAboveBaseCapacity': (integer, False),
        'SpotAllocationStrategy': (basestring, False),
        'SpotInstancePools': (integer, False),
        'SpotMaxPrice': (basestring, False),
    }

class LaunchTemplateOverrides(AWSProperty):
    props = {
        'InstanceType': (basestring, False),
    }

class LaunchTemplate(AWSProperty):
    props = {
        'LaunchTemplateSpecification': (LaunchTemplateSpecification, True),
        'Overrides': ([LaunchTemplateOverrides], True),
    }

class MixedInstancesPolicy(AWSProperty):
    props = {
        'InstancesDistribution': (InstancesDistribution, False),
        'LaunchTemplate': (LaunchTemplate, True),
    }

class AutoScalingGroup(AWSObject):
    resource_type = "AWS::AutoScaling::AutoScalingGroup"

    props = {
        'AutoScalingGroupName': (basestring, False),
        'AvailabilityZones': (list, False),
        'Cooldown': (integer, False),
        'DesiredCapacity': (integer, False),
        'HealthCheckGracePeriod': (integer, False),
        'HealthCheckType': (basestring, False),
        'InstanceId': (basestring, False),
        'LaunchConfigurationName': (basestring, False),
        'LaunchTemplate': (LaunchTemplateSpecification, False),
        'LifecycleHookSpecificationList':
            ([LifecycleHookSpecification], False),
        'LoadBalancerNames': (list, False),
        'MaxSize': (integer, True),
        'MetricsCollection': ([MetricsCollection], False),
        'MinSize': (integer, True),
        'MixedInstancesPolicy': (MixedInstancesPolicy, False),
        'NotificationConfigurations': ([NotificationConfigurations], False),
        'PlacementGroup': (basestring, False),
        'ServiceLinkedRoleARN': (basestring, False),
        'Tags': ((Tags, list), False),
        'TargetGroupARNs': ([basestring], False),
        'TerminationPolicies': ([basestring], False),
        'VPCZoneIdentifier': (list, False),
    }

    def validate(self):
        if 'UpdatePolicy' in self.resource:
            update_policy = self.resource['UpdatePolicy']

            if (not isinstance(update_policy, AWSHelperFn) and
                    'AutoScalingRollingUpdate' in update_policy.properties):
                if not isinstance(
                        update_policy.AutoScalingRollingUpdate, AWSHelperFn):
                    rolling_update = update_policy.AutoScalingRollingUpdate

                    min_instances = rolling_update.properties.get(
                        "MinInstancesInService", "0")
                    is_min_no_check = isinstance(
                        min_instances, (FindInMap, Ref)
                    )
                    is_max_no_check = isinstance(self.MaxSize,
                                                 (If, FindInMap, Ref))

                    if not (is_min_no_check or is_max_no_check):
                        max_count = int(self.MaxSize)
                        min_count = int(min_instances)

                        if min_count >= max_count:
                            raise ValueError(
                                "The UpdatePolicy attribute "
                                "MinInstancesInService must be less than the "
                                "autoscaling group's MaxSize")

        instance_config_types = [
            'LaunchConfigurationName',
            'LaunchTemplate',
            'InstanceId'
        ]

        mutually_exclusive(self.__class__.__name__, self.properties,
                           instance_config_types)

        availability_zones = self.properties.get('AvailabilityZones')
        vpc_zone_identifier = self.properties.get('VPCZoneIdentifier')
        if not availability_zones and not vpc_zone_identifier:
            raise ValueError("Must specify AvailabilityZones and/or "
                             "VPCZoneIdentifier: http://docs.aws.amazon.com/A"
                             "WSCloudFormation/latest/UserGuide/aws-propertie"
                             "s-as-group.html#cfn-as-group-vpczoneidentifier")
        return True

class LaunchConfiguration(AWSObject):
    resource_type = "AWS::AutoScaling::LaunchConfiguration"

    props = {
        'AssociatePublicIpAddress': (boolean, False),
        'BlockDeviceMappings': (list, False),
        'ClassicLinkVPCId': (basestring, False),
        'ClassicLinkVPCSecurityGroups': ([basestring], False),
        'EbsOptimized': (boolean, False),
        'IamInstanceProfile': (basestring, False),
        'ImageId': (basestring, True),
        'InstanceId': (basestring, False),
        'InstanceMonitoring': (boolean, False),
        'InstanceType': (basestring, True),
        'KernelId': (basestring, False),
        'KeyName': (basestring, False),
        'LaunchConfigurationName': (basestring, False),
        'Metadata': (Metadata, False),
        'PlacementTenancy': (basestring, False),
        'RamDiskId': (basestring, False),
        'SecurityGroups': (list, False),
        'SpotPrice': (basestring, False),
        'UserData': (basestring, False),
    }

class StepAdjustments(AWSProperty):
    props = {
        'MetricIntervalLowerBound': (integer, False),
        'MetricIntervalUpperBound': (integer, False),
        'ScalingAdjustment': (integer, True),
    }

class MetricDimension(AWSProperty):
    props = {
        'Name': (basestring, True),
        'Value': (basestring, True),
    }

class CustomizedMetricSpecification(AWSProperty):
    props = {
        'Dimensions': ([MetricDimension], False),
        'MetricName': (basestring, True),
        'Namespace': (basestring, True),
        'Statistic': (basestring, True),
        'Unit': (basestring, False),
    }

class PredefinedMetricSpecification(AWSProperty):
    props = {
        'PredefinedMetricType': (basestring, True),
        'ResourceLabel': (basestring, False),
    }

class TargetTrackingConfiguration(AWSProperty):
    props = {
        'CustomizedMetricSpecification':
            (CustomizedMetricSpecification, False),
        'DisableScaleIn': (boolean, False),
        'PredefinedMetricSpecification':
            (PredefinedMetricSpecification, False),
        'TargetValue': (float, True),
    }

class ScalingPolicy(AWSObject):
    resource_type = "AWS::AutoScaling::ScalingPolicy"

    props = {
        'AdjustmentType': (basestring, False),
        'AutoScalingGroupName': (basestring, True),
        'Cooldown': (integer, False),
        'EstimatedInstanceWarmup': (integer, False),
        'MetricAggregationType': (basestring, False),
        'MinAdjustmentMagnitude': (integer, False),
        'PolicyType': (basestring, False),
        'ScalingAdjustment': (integer, False),
        'StepAdjustments': ([StepAdjustments], False),
        'TargetTrackingConfiguration': (TargetTrackingConfiguration, False),
    }

class ScheduledAction(AWSObject):
    resource_type = "AWS::AutoScaling::ScheduledAction"

    props = {
        'AutoScalingGroupName': (basestring, True),
        'DesiredCapacity': (integer, False),
        'EndTime': (basestring, False),
        'MaxSize': (integer, False),
        'MinSize': (integer, False),
        'Recurrence': (basestring, False),
        'StartTime': (basestring, False),
    }

class LifecycleHook(AWSObject):
    resource_type = "AWS::AutoScaling::LifecycleHook"

    props = {
        'AutoScalingGroupName': (basestring, True),
        'DefaultResult': (basestring, False),
        'HeartbeatTimeout': (integer, False),
        'LifecycleHookName': (basestring, False),
        'LifecycleTransition': (basestring, True),
        'NotificationMetadata': (basestring, False),
        'NotificationTargetARN': (basestring, False),
        'RoleARN': (basestring, False),
    }

class Trigger(AWSObject):
    resource_type = "AWS::AutoScaling::Trigger"

    props = {
        'AutoScalingGroupName': (basestring, True),
        'BreachDuration': (integer, True),
        'Dimensions': (list, True),
        'LowerBreachScaleIncrement': (integer, False),
        'LowerThreshold': (integer, True),
        'MetricName': (basestring, True),
        'Namespace': (basestring, True),
        'Period': (integer, True),
        'Statistic': (basestring, True),
        'Unit': (basestring, False),
        'UpperBreachScaleIncrement': (integer, False),
        'UpperThreshold': (integer, True),
    }

class EBSBlockDevice(AWSProperty):
    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-template.html
    props = {
        'DeleteOnTermination': (boolean, False),
        'Encrypted': (boolean, False),
        'Iops': (integer, False),
        'SnapshotId': (basestring, False),
        'VolumeSize': (integer, False),
        'VolumeType': (basestring, False),
    }

class BlockDeviceMapping(AWSProperty):
    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-mapping.html
    props = {
        'DeviceName': (basestring, True),
        'Ebs': (EBSBlockDevice, False),
        'NoDevice': (boolean, False),
        'VirtualName': (basestring, False),
    }


text:
/*
 * This file provided by Facebook is for non-commercial testing and evaluation
 * purposes only.  Facebook reserves all rights not expressly granted.
 *
 * 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
 * FACEBOOK 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.
 */

package com.facebook.samples.transitions;

import android.app.Activity;
import android.os.Bundle;

public class DestinationActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.drawee_destination);
  }
}


text:
DISABLE_ASIO_WARNINGS
#include <boost/asio/ip/address_v6.hpp>
REENABLE_WARNINGS


text:
var TESTEXPORT, 'foo'

# set a local env var
lvar TESTLOCAL, 'bar'

# set an alias
shalias testalias, 'echo yay'

# single quotes are the default, but we can force them anyway
var TESTSINGLEQUOTES, sq('foo $NOTAVAR')

# use dq if you need "", and var to pick the best variable syntax
var TESTDOUBLEQUOTES, dq('foo ' + variable('TESTLOCAL'))

# use env variables directly
var TESTVARACCESS, "testlocal = #{env.TESTLOCAL}"

# local var with double quotes
lvar TESTQUOTEDLOCAL, dq('oh no $PATH')

# shell commands work too, with the run function
var TESTUNAME, "my uname is #{run('uname', '-a')}"

# $PATH is treated slightly differently, because separators vary between shells
suffix PATH, 'appends', 'these', 'to', 'path'
prefix PATH, 'prepends'

# conditionals can work on shell families
if shell == :fish
  var MYSHELL, 'fish'
elsif shell == :csh
  var MYSHELL, 'ewwcsh'
elsif shell == :posix
  var MYSHELL, 'yaysh'
end

# or platforms (as defined by python's sys.platform)
var MACUSERS, 'rawr' if Platform.darwin?

# or shell names
# this will run only when --shell zsh or -s zsh is passed in
if shell_name == :zsh
  # ruby variables won't leak into the environment
  num = 10
  var NUM, "it is #{num}"
end

# or whatever you like
puts '# whee' if 3.odd?

# sometimes you just want to embed some shell commands to be printed verbatim
if shell == :posix
  puts <<-END
  if [[ -f ~/.bash_history ]]; then
    echo YOU HAVE A HISTORY
  fi
  END
end


text:
// Code generated by go-swagger; DO NOT EDIT.

package bundle

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"net/http"
	"time"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/swag"

	strfmt "github.com/go-openapi/strfmt"
)

// NewResumeBundleParams creates a new ResumeBundleParams object
// with the default values initialized.
func NewResumeBundleParams() *ResumeBundleParams {
	var ()
	return &ResumeBundleParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewResumeBundleParamsWithTimeout creates a new ResumeBundleParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewResumeBundleParamsWithTimeout(timeout time.Duration) *ResumeBundleParams {
	var ()
	return &ResumeBundleParams{

		timeout: timeout,
	}
}

// NewResumeBundleParamsWithContext creates a new ResumeBundleParams object
// with the default values initialized, and the ability to set a context for a request
func NewResumeBundleParamsWithContext(ctx context.Context) *ResumeBundleParams {
	var ()
	return &ResumeBundleParams{

		Context: ctx,
	}
}

// NewResumeBundleParamsWithHTTPClient creates a new ResumeBundleParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewResumeBundleParamsWithHTTPClient(client *http.Client) *ResumeBundleParams {
	var ()
	return &ResumeBundleParams{
		HTTPClient: client,
	}
}

/*ResumeBundleParams contains all the parameters to send to the API endpoint
for the resume bundle operation typically these are written to a http.Request
*/
type ResumeBundleParams struct {

	/*XKillbillComment*/
	XKillbillComment *string
	/*XKillbillCreatedBy*/
	XKillbillCreatedBy string
	/*XKillbillReason*/
	XKillbillReason *string
	/*BundleID*/
	BundleID strfmt.UUID
	/*PluginProperty*/
	PluginProperty []string
	/*RequestedDate*/
	RequestedDate *strfmt.Date

	WithProfilingInfo     *string // If set, return KB hprof headers
	WithStackTrace        *bool   // If set, returns full stack trace with error message
	timeout               time.Duration
	Context               context.Context
	HTTPClient            *http.Client
	ProcessLocationHeader bool // For create APIs that return 201, send another request and retrieve the resource.
}

// WithTimeout adds the timeout to the resume bundle params
func (o *ResumeBundleParams) WithTimeout(timeout time.Duration) *ResumeBundleParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the resume bundle params
func (o *ResumeBundleParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the resume bundle params
func (o *ResumeBundleParams) WithContext(ctx context.Context) *ResumeBundleParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the resume bundle params
func (o *ResumeBundleParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the resume bundle params
func (o *ResumeBundleParams) WithHTTPClient(client *http.Client) *ResumeBundleParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the resume bundle params
func (o *ResumeBundleParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithXKillbillComment adds the xKillbillComment to the resume bundle params
func (o *ResumeBundleParams) WithXKillbillComment(xKillbillComment *string) *ResumeBundleParams {
	o.SetXKillbillComment(xKillbillComment)
	return o
}

// SetXKillbillComment adds the xKillbillComment to the resume bundle params
func (o *ResumeBundleParams) SetXKillbillComment(xKillbillComment *string) {
	o.XKillbillComment = xKillbillComment
}

// WithXKillbillCreatedBy adds the xKillbillCreatedBy to the resume bundle params
func (o *ResumeBundleParams) WithXKillbillCreatedBy(xKillbillCreatedBy string) *ResumeBundleParams {
	o.SetXKillbillCreatedBy(xKillbillCreatedBy)
	return o
}

// SetXKillbillCreatedBy adds the xKillbillCreatedBy to the resume bundle params
func (o *ResumeBundleParams) SetXKillbillCreatedBy(xKillbillCreatedBy string) {
	o.XKillbillCreatedBy = xKillbillCreatedBy
}

// WithXKillbillReason adds the xKillbillReason to the resume bundle params
func (o *ResumeBundleParams) WithXKillbillReason(xKillbillReason *string) *ResumeBundleParams {
	o.SetXKillbillReason(xKillbillReason)
	return o
}

// SetXKillbillReason adds the xKillbillReason to the resume bundle params
func (o *ResumeBundleParams) SetXKillbillReason(xKillbillReason *string) {
	o.XKillbillReason = xKillbillReason
}

// WithBundleID adds the bundleID to the resume bundle params
func (o *ResumeBundleParams) WithBundleID(bundleID strfmt.UUID) *ResumeBundleParams {
	o.SetBundleID(bundleID)
	return o
}

// SetBundleID adds the bundleId to the resume bundle params
func (o *ResumeBundleParams) SetBundleID(bundleID strfmt.UUID) {
	o.BundleID = bundleID
}

// WithPluginProperty adds the pluginProperty to the resume bundle params
func (o *ResumeBundleParams) WithPluginProperty(pluginProperty []string) *ResumeBundleParams {
	o.SetPluginProperty(pluginProperty)
	return o
}

// SetPluginProperty adds the pluginProperty to the resume bundle params
func (o *ResumeBundleParams) SetPluginProperty(pluginProperty []string) {
	o.PluginProperty = pluginProperty
}

// WithRequestedDate adds the requestedDate to the resume bundle params
func (o *ResumeBundleParams) WithRequestedDate(requestedDate *strfmt.Date) *ResumeBundleParams {
	o.SetRequestedDate(requestedDate)
	return o
}

// SetRequestedDate adds the requestedDate to the resume bundle params
func (o *ResumeBundleParams) SetRequestedDate(requestedDate *strfmt.Date) {
	o.RequestedDate = requestedDate
}

// WriteToRequest writes these params to a swagger request
func (o *ResumeBundleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.XKillbillComment != nil {

		// header param X-Killbill-Comment
		if err := r.SetHeaderParam("X-Killbill-Comment", *o.XKillbillComment); err != nil {
			return err
		}

	}

	// header param X-Killbill-CreatedBy
	if err := r.SetHeaderParam("X-Killbill-CreatedBy", o.XKillbillCreatedBy); err != nil {
		return err
	}

	if o.XKillbillReason != nil {

		// header param X-Killbill-Reason
		if err := r.SetHeaderParam("X-Killbill-Reason", *o.XKillbillReason); err != nil {
			return err
		}

	}

	// path param bundleId
	if err := r.SetPathParam("bundleId", o.BundleID.String()); err != nil {
		return err
	}

	valuesPluginProperty := o.PluginProperty

	joinedPluginProperty := swag.JoinByFormat(valuesPluginProperty, "multi")
	// query array param pluginProperty
	if err := r.SetQueryParam("pluginProperty", joinedPluginProperty...); err != nil {
		return err
	}

	if o.RequestedDate != nil {

		// query param requestedDate
		var qrRequestedDate strfmt.Date
		if o.RequestedDate != nil {
			qrRequestedDate = *o.RequestedDate
		}
		qRequestedDate := qrRequestedDate.String()
		if qRequestedDate != "" {
			if err := r.SetQueryParam("requestedDate", qRequestedDate); err != nil {
				return err
			}
		}

	}

	// header param WithProfilingInfo
	if o.WithProfilingInfo != nil && len(*o.WithProfilingInfo) > 0 {
		if err := r.SetHeaderParam("X-Killbill-Profiling-Req", *o.WithProfilingInfo); err != nil {
			return err
		}
	}

	// header param withStackTrace
	if o.WithStackTrace != nil && *o.WithStackTrace {
		if err := r.SetQueryParam("withStackTrace", "true"); err != nil {
			return err
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}


text:
using System;
using System.Diagnostics;

using Vba.Grammars;

namespace Vba.Language
{
    internal class ExpressionEvaluator : PreprocessorBaseVisitor<object>
    {
        protected readonly ConstantsDictionary constants;
        protected StringComparison stringComparison = StringComparison.InvariantCultureIgnoreCase;

        public ExpressionEvaluator(ConstantsDictionary constants)
        {
            this.constants = constants;
        }

        #region Preprocessor Overrides

        public override object VisitPreprocessorStatement(PreprocessorParser.PreprocessorStatementContext context)
        {
            if (context.ifStatement() != null)
            {
                return VisitIfStatement(context.ifStatement());
            }
            if (context.elseIfStatement() != null)
            {
                return VisitElseIfStatement(context.elseIfStatement());
            }
            if (context.elseStatement() != null)
            {
                return VisitElseStatement(context.elseStatement());
            }
            if (context.endIfStatement() != null)
            {
                return VisitEndIfStatement(context.endIfStatement());
            }
            throw new NotImplementedException("VisitPreprocessorStatement");
        }

        public override object VisitIfStatement(PreprocessorParser.IfStatementContext context)
        {
            return VisitExpression(context.expression());
        }

        public override object VisitElseIfStatement(PreprocessorParser.ElseIfStatementContext context)
        {
            return VisitExpression(context.expression());
        }

        public override object VisitElseStatement(PreprocessorParser.ElseStatementContext context)
        {
            throw new Exception("Cannot evaluate Else Statement");
        }

        public override object VisitEndIfStatement(PreprocessorParser.EndIfStatementContext context)
        {
            // This statement can't really be evaluated.  Not sure what we should return.
            return false;
        }

        #endregion

        public override object VisitExpression(PreprocessorParser.ExpressionContext context)
        {
            if (context.comparisonOperator() != null
                && context.expression().Count == 2)
            {
                dynamic left = VisitExpression(context.expression(0));   // could be any expression, bool, string...
                dynamic right = VisitExpression(context.expression(1));  // could be any expression, bool, string...
                return CompareValues(left, right, context.comparisonOperator().GetText());  // This could fail if we don't have a matching overload.
            }
            if (context.arithmeticExpression() != null)
            {
                return VisitArithmeticExpression(context.arithmeticExpression());
            }
            if (context.boolExpression() != null)
            {
                return VisitBoolExpression(context.boolExpression());
            }
            if (context.stringExpression() != null)
            {
                return VisitStringExpression(context.stringExpression());
            }
            throw new NotImplementedException("VisitExpression");
        }

        #region Boolean Expressions

        public override object VisitBoolExpression(PreprocessorParser.BoolExpressionContext context)
        {
            // check for Not unary operator.
            if (context.Not() != null
                && context.boolExpression() != null
                && context.boolExpression(0) != null)
            {
                return !(bool)VisitBoolExpression(context.boolExpression(0));
            }

            // check for And binary operator.
            if (context.And() != null
                && context.boolExpression() != null
                && context.boolExpression().Count == 2)
            {
                var left = (bool)VisitBoolExpression(context.boolExpression(0));
                var right = (bool)VisitBoolExpression(context.boolExpression(1));
                return left && right;
            }

            // check for Or binary operator.
            if (context.Or() != null
                && context.boolExpression() != null
                && context.boolExpression().Count == 2)
            {
                var left = (bool)VisitBoolExpression(context.boolExpression(0));
                var right = (bool)VisitBoolExpression(context.boolExpression(1));
                return left || right;
            }

            // check for Xor binary operator.
            if (context.Xor() != null
                && context.boolExpression() != null
                && context.boolExpression().Count == 2)
            {
                var left = (bool)VisitBoolExpression(context.boolExpression(0));
                var right = (bool)VisitBoolExpression(context.boolExpression(1));
                return left ^ right;
            }

            // check for boolean literal.
            if (context.boolLiteral() != null)
            {
                return VisitBoolLiteral(context.boolLiteral());
            }
            throw new NotImplementedException("VisitBoolExpression");
        }

        public override object VisitBoolLiteral(PreprocessorParser.BoolLiteralContext context)
        {
            if (context.True() != null)
            {
                return true;
            }
            if (context.False() != null)
            {
                return false;
            }
            throw new Exception("VisitBoolLiteral");
        }

        #endregion

        #region String Expressions

        public override object VisitStringExpression(PreprocessorParser.StringExpressionContext context)
        {
            if ((context.AMP() != null || context.PLUS() != null)
                && context.stringExpression().Count == 2)
            {
                var left = (string)VisitStringExpression(context.stringExpression(0));
                var right = (string)VisitStringExpression(context.stringExpression(1));
                return left + right;
            }
            if (context.Like() != null)
            {
                throw new NotImplementedException("Need to implement like comparison");
            }
            if (context.StringLiteral() != null)
            {
                var text = context.StringLiteral().GetText();
                Debug.Assert(text.Length > 2);
                return text.Substring(1, text.Length - 2);
            }
            throw new NotImplementedException("VisitStringExpression: " + context.GetText());
        }

        #endregion

        #region Arithmetic Expressions

        public override object VisitArithmeticExpression(PreprocessorParser.ArithmeticExpressionContext context)
        {
            if (context.MINUS() != null
                && context.arithmeticExpression().Count == 1)
            {
                return -1 * (int)VisitArithmeticExpression(context.arithmeticExpression(0));
            }
            if (context.IntegerLiteral() != null)
            {
                return ParseInteger(context.IntegerLiteral().GetText());
            }
            if (context.FloatLiteral() != null)
            {
                return ParseFloat(context.FloatLiteral().GetText());
            }

            Debug.Assert(context.arithmeticExpression().Count == 2);  // only operations left are binary.

            var left = (int)VisitArithmeticExpression(context.arithmeticExpression(0));
            var right = (int)VisitArithmeticExpression(context.arithmeticExpression(1));
            if (context.CARET() != null)
            {
                return (int)Math.Pow(left, right);
            }
            if (context.FS() != null)
            {
                return left / right;
            }
            if (context.BS() != null)
            {
                return left / right;
            }
            if (context.Mod() != null)
            {
                return left % right;
            }
            if (context.STAR() != null)
            {
                return left * right;
            }
            if (context.PLUS() != null)
            {
                return left + right;
            }
            if (context.MINUS() != null)
            {
                return left - right;
            }
            throw new NotImplementedException("VisitArithmeticExpression");
        }

        private static int ParseInteger(string text)
        {
            // TODO need to handle VBA integer definitions (hex/octal/decimal/suffixes).
            return int.Parse(text);
        }

        private static float ParseFloat(string text)
        {
            // TODO need to handle VBA float definitions (exponents/suffixes).
            return float.Parse(text);
        }

        #endregion

        #region Comparison Expressions

        private object CompareValues(string left, string right, string op)
        {
            var areEqual = AreStringsEqual(left, right);
            var leftIsLessThan = IsLeftStringLessThan(left, right);

            switch (op)
            {
                case "=":
                    return areEqual;
                case "<":
                    return !areEqual && leftIsLessThan;
                case ">":
                    return !areEqual && !leftIsLessThan;
                case "<=":
                    return areEqual || leftIsLessThan;
                case ">=":
                    return areEqual || !leftIsLessThan;
                case "><":
                case "<>":
                    return !areEqual;
                default:
                    throw new NotImplementedException();
            }
        }

        private bool AreStringsEqual(string left, string right)
        {
            return String.Equals(left, right, stringComparison);
        }

        private bool IsLeftStringLessThan(string left, string right)
        {
            // TODO this may not be correct.  Also need to check against VBA implementation vs .Net Framework implementation.
            return string.Compare(left, right, stringComparison) < 0;
        }

        private object CompareValues(bool left, bool right, string op)
        {
            return CompareValues(ConvertBoolToInt(left), ConvertBoolToInt(right), op);
        }

        private object CompareValues(bool left, int right, string op)
        {
            return CompareValues(ConvertBoolToInt(left), right, op);
        }

        private object CompareValues(int left, bool right, string op)
        {
            return CompareValues(left, ConvertBoolToInt(right), op);
        }

        private int ConvertBoolToInt(bool value)
        {
            // VBAL p148: True is considered less than False
            if (value)
            {
                return -1;  // true
            }
            return 0;       // false
        }

        private object CompareValues(int left, int right, string op)
        {
            switch (op)
            {
                case "=":
                    return left == right;
                case "<":
                    return left < right;
                case ">":
                    return left > right;
                case "<=":
                    return left <= right;
                case ">=":
                    return left >= right;
                case "><":
                case "<>":
                    return left != right;
                default:
                    throw new NotImplementedException();
            }
        }

        private object CompareValues(string left, bool right, string op)
        {
            // TODO consider creating a specific class to represent errors
            // A Type Mismatch error occurs.
            throw new NotImplementedException();
        }

        private object CompareValues(bool left, string right, string op)
        {
            // TODO consider creating a specific class to represent errors
            // A Type Mismatch error occurs.
            throw new NotImplementedException();
        }

        private object CompareValues(int left, string right, string op)
        {
            // TODO consider creating a specific class to represent errors
            // A Type Mismatch error occurs.
            throw new NotImplementedException();
        }

        private object CompareValues(string left, int right, string op)
        {
            // TODO consider creating a specific class to represent errors
            // A Type Mismatch error occurs.
            throw new NotImplementedException();
        }

        #endregion
    }
}


text:
/**
 *
 */
package com.cqu.news.util;

/**
 * @author xiongxianren
 * @desciption 保存常量
 */
public class Constant {
	public static final String INDEXDIR = "indexDir/article/";
	public static final String POOLNAME = "proxool.cqunews";
}


text:
![FEZ Cerbuino Net](images/fez-cerbuino-net.jpg)

An Arduino-pinout compatible single board computer with Gadgeteer sockets.

## Resources

* [Schematic](http://files.ghielectronics.com/downloads/Schematics/FEZ/FEZ%20Cerbuino%20Net%20Rev%201.1%20Schematic.pdf)

## Software

For information on programming the FEZ Cerbuino Net, please go to the [FEZ Cerberus](../gadgeteer/fez-cerberus.md) page.


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace DeploymentCockpit.Common
{
    public static class IEnumerableExtensions
    {
        public static IEnumerable<T> Each<T>(this IEnumerable<T> enumerable, Action<T> itemAction)
        {
            foreach (var item in enumerable)
            {
                itemAction(item);
            }

            return enumerable; // Enable method chaining
        }

        public static HashSet<T> ToHashSet<T>(this IEnumerable<T> enumerable)
        {
            return new HashSet<T>(enumerable);
        }
    }
}


text:
require File.expand_path('../../../spec_helper', __FILE__)

describe "ARGF.closed?" do
  before :each do
    @file1_name = fixture __FILE__, "file1.txt"
    @file2_name = fixture __FILE__, "file2.txt"
  end

  after :each do
    ARGF.close unless ARGF.closed?
  end

  it "returns true if the current stream has been closed" do
    argv [@file1_name, @file2_name] do
      stream = ARGF.to_io
      stream.close

      ARGF.closed?.should be_true
      stream.reopen(ARGF.filename, 'r')
    end
  end
end


text:
exports.definition = {
	config: {
		debug : "1",
		adapter: {
			type: "restapi",
			collection_name: "teamMembers",
			idAttribute: "id"
		}
	},
	extendModel: function(Model) {
		_.extend(Model.prototype, {
			initialize : function(args){

			}
		});

		return Model;
	},
	extendCollection: function(Collection) {
		_.extend(Collection.prototype, {

			parse: function(resp){
				return resp.data;
			}
		});

		return Collection;
	}
};


text:
<?php
$settings = array(
    /**
     * On peut déterminer un layout pour un module (la config doit se trouver dans global.php ou local.php)
     * TODO : Descendre jusqu'à l'action
     */
    /*'core_layout' => array(
            'AdfabUser' => 'layout/1column',
    ),*/

    /**
     * Bitly Account : A service for shortening url :)
     */
    'bitlyUsername' => 'o_7t2s2bjmun',
    'bitlyApiKey'   => 'R_335290ffb3f5fc08b45d3e0e6678c3db',
    'bitlyUrl'      => 'http://api.bit.ly/v3/shorten',

    //Used to create the open graph stuff
    'facebookOpengraph' => array(
        'enable' => false,
        'appId'  => '118474821657382',
        'tags'   => array(
            'og:site_name'  => '',
            'og:type'       => '',
        ),
    ),

    /**
    * Social messages
    */
    'defaultShareMessage' => 'Venez jouez au jeu : __placeholder__ sur Playground',

    /**
     * Email transport
     *
     * Name of Zend Transport Class to use
     */
    'transport_class' => 'Zend\Mail\Transport\File',
    'options_class' => 'Zend\Mail\Transport\FileOptions',
    'options' => array(
        'path' => 'data/mail/',
    ),

    'ckeditor' => array(
        'BasePath' =>'lib/js/ckeditor',
        'Width'      => "100%",
        'Height'     => "340",
        'Language'   => 'fr',
        'Color'      => '#F7F7F7',
        'stylesSet'  => 'custom_styles:/lib/js/ckeditor-custom/ckeditor-styles.js',
        'templates_files'  => array('/lib/js/ckeditor-custom/ckeditor-templates.js'),
        'contentsCss'  => array('/lib/css/ckeditor-custom/ckeditor-css.css'),

        // Full toolbars
        'Toolbar'    => array(
            array('Source','-','DocProps','Preview','Print'),
            array('Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo'),
            array('Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt'),
            array('Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'),
            '/',
            array('Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat'),
            array('NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'),
            array('Link','Unlink','Anchor' ),
            array('Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'),
            '/',
            array('Styles','Format','Font','FontSize'),
            array('TextColor','BGColor' ),
            array('Maximize', 'ShowBlocks','-','About'),
        ),
        'ElFinderBaseURL'      => '/elfinder/ckeditor',
        'ElFinderWindowWidth'  => "1000",
        'ElFinderWindowHeight' => "650",
    ),

    'QuConfig' => array(
        'QuElFinder'=>array(
            'QuRoots'=>array(
                'driver'        => 'LocalFileSystem',
                'path'          =>  'C:\programmation\www\playground\public\uploads\files',
                'URL'           =>  '/uploads/files/',
                'accessControl' => 'access'
            ),
            'BasePath'=>'/js/lib/elfinder',
        ),
    ),
    'googleAnalytics' => array(
        'id' => '',

        /**
        * Tracking across multiple (sub)domains
        * @see https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite
        */
        'domain_name'   => '',
        'allow_linker' => false,
    ),
);

$zenddevelopertools = array(
    'profiler' => array(
        'enabled' => false,
        'strict' => false,
        'flush_early' => false,
        'cache_dir' => 'data/cache',
        'matcher' => array(),
        'collectors' => array(),
    ),
    'toolbar' => array(
        'enabled' => false,
        'auto_hide' => false,
        'position' => 'bottom',
        'version_check' => false,
        'entries' => array(),
        'template_hint' => false,
    ),
);

// 'Jhu\ZdtLoggerModule' config
// $sm->get('jhu.zdt_logger')->info('my log');
$zdt_logger = array(
    'logger' => 'Zend\Log\Logger'
);

/**
 * You do not need to edit below this line
 */
return array(
    'playgroundcore'         => $settings,
    'zenddevelopertools'=> $zenddevelopertools,
    'jhu'               => array('zdt_logger' => $zdt_logger)
);


text:
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';

import { User } from './user';

import { Headers, RequestOptions} from '@angular/http';
import { ApiService } from '../shared/api.service';

@Injectable()
export class UserService {
    private headers = new Headers({'Content-Type': 'application/json'});
    private user: User = new User;

    constructor(
        private API: ApiService
    ) {
        // If the user has a token get their details
        if (this.hasToken()) {
            this.getCurrentUserDetails();
        }
    }

    public login(user: User) {
        let options = new RequestOptions({ headers: this.headers });
        let body = JSON.stringify(user);

        // Make the auth request
        let loginObservable = this.API.post('auth/login', body, options)
            .map(res => res.json())
            .catch(this.observableHandleError);

        // Save the auth token if the login succeeds
        loginObservable.subscribe(
            response => {
                this.setToken(response.token);
            });

        return loginObservable;
    }

    public logout() {
        this.user = new User;
        this.invalidateToken();
    }

    public lock() {
        localStorage.setItem('userLocked', 'locked');
    }

    public isLocked(): boolean {
        return localStorage.getItem('userLocked') !== null;
    }

    public unlock() {
        localStorage.removeItem('userLocked');
    }

    private getCurrentUserDetails() {
        this.API.get('users/me')
            .map(result => result.json())
            .catch(this.observableHandleError)
            .subscribe((userDetails: User) => {
                    this.user = new User(userDetails);
                }
            );
    }

    public getUserDetails(): Observable<User> {
       return this.API.get('users/me')
           .map(res => <User> res.json())
           .catch(this.observableHandleError);
    }

    private setToken(value: string): void {
        localStorage.setItem('userToken', value);
    }

    public hasToken(): boolean {
        return localStorage.getItem('userToken') !== null;
    }

    private invalidateToken(): void {
        localStorage.removeItem('userToken');
    }

    private observableHandleError (error: any) {
        // in a real world app, we may send the server to some remote logging infrastructure
        // instead of just logging it to the console
        let errorMessage = (error.message) ? error.message :
            error.status ? `${error.status} - ${error.statusText}` : 'Server error - Your request could not be processed';
        console.error(error);
        return Observable.throw(errorMessage || 'Server error - Your request could not be processed');
    }
}


text:
package tests.pages;

import models.Surfer;
import org.fluentlenium.core.FluentPage;
import org.openqa.selenium.WebDriver;
import play.Play;
// Although Eclipse marks the following two methods as deprecated,
// the no-arg versions of the methods used here are not deprecated.  (as of May, 2013).
import static org.fluentlenium.core.filter.FilterConstructor.withText;
import static org.fluentlenium.core.filter.FilterConstructor.withId;
import static org.fest.assertions.Assertions.assertThat;

/**
 * Illustration of the Page Object Pattern in Fluentlenium.
 * @author Taylor Kennedy
 */
public class SurferPage extends FluentPage {
  private String url;

  /**
   * Create the LoginPage.
   * @param webDriver The driver.
   * @param port The port.
   */
  public SurferPage(WebDriver webDriver, int port) {
    super(webDriver);
    this.url = "http://localhost:" + port + "/surfer/" + Surfer.find.findList().get(Surfer.find.findList().size()-1).getSlug();
  }

  @Override
  public String getUrl() {
    return this.url;
  }

  @Override
  public void isAt() {
    assertThat(title()).isEqualTo("Surfer (surferpedia)");
  }

  /**
   * Moves to the surfer update page.
   * @param name The form name data.
   * @param gender The form gender value.
   */
  public void updateButton() {
   find("#edit").click();
  }

  /**
   * Tests the surfer update function using the bio as the changed field.
   * @param name The form name data.
   * @param gender The form gender value.
   */
  public void updateSurfer() {
    fill("#bio").with("Testing Update");
    find("#submit").click();
  }

  /**
   * Deletes a surfer from the database.
   * @param name The form name data.
   * @param gender The form gender value.
   */
  public void delete() {
    find("#delete").click();
  }

}


text:
package manifold.json.rt;

import manifold.json.rt.api.IJsonBindingsTranslator;

public class JsonBindingsTranslator implements IJsonBindingsTranslator
{
  @Override
  public String getName()
  {
    return "JSON";
  }

  @Override
  public String fromBindings( Object bindingsValue )
  {
    return Json.toJson( bindingsValue );
  }

  @Override
  public void fromBindings( Object bindingsValue, StringBuilder target )
  {
    Json.toJson( target, 0, bindingsValue );
  }

  @Override
  public void fromBindings( Object bindingsValue, String name, StringBuilder target, int indent )
  {
    Json.toJson( target, indent, bindingsValue );
  }

  @Override
  public Object toBindings( String translation )
  {
    return Json.fromJson( translation );
  }

  @Override
  public Object toBindings( String translation, boolean withTokens )
  {
    return Json.fromJson( translation, false, withTokens );
  }

  @Override
  public Object toBindings( String translation, boolean withBigNumbers, boolean withTokens )
  {
    return Json.fromJson( translation, withBigNumbers, withTokens );
  }
}


text:
require 'watir'
require 'watir-webdriver'
require 'watir-scroll'

#Set up du browser + go page principle de curse
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 180
browser = Watir::Browser.new :firefox, :http_client => client
browser.goto "https://www.curse.com"

#attendre que la page soit loaded
browser.h1(:text, "Curse, Inc").wait_until_present

#scroll juskau bouto pour lancer l'app en ligne + lancer l'app
browser.scroll.to browser.h3(:text, "Game Changing Features")
browser.link(:class, "button app-launch-button tertiary-button large").click

#scroll juskau champs pour se co + clic sur login
browser.scroll.to browser.h4(:text, "Let's get you in!")
browser.span(:text, "Login").click

#remplir form email et mdp
browser.text_field(:placeholder, "Email").set ""
browser.text_field(:placeholder, "Password").set ""

#clic pour se connecter
browser.button(:class, "primary-button button large").click

#attendre d'etre co 'page loaded'
browser.div(:class=>" modal-content").wait_until_present

#Aller sur le channel dev de zera
browser.goto("https://www.curse.com/ZeratoR/tech-code-dev")

#attendre que ca soit loadé
browser.h5(:text, "Venez parler de C, C++, C#, php, python, java et encore plus !").wait_until_present
sleep(3)

#ecrire et envoyer
browser.textarea(:id, "field-message").set "I'M BACK"
browser.send_keys :enter

#Lire le dernier message
browser.divs(:class, "message-content")[-1].text

last = ""
deads = []

while 1 do
	new = browser.div(:class, "chat-scroll").divs(:class, "message-content").last.text
	if last != new
		last = new
		if last["!hello"] == "!hello"
			if last["!helloTo"] == "!helloTo"
				browser.textarea(:id, "field-message").set ("Bonjour à toi !"+ last.split("!helloTo")[1])
				browser.send_keys :enter
				browser.send_keys :enter
			else
				browser.textarea(:id, "field-message").set ("Bonjour à toi ! @"+ last.split(":")[0][0..-2])
				browser.send_keys :enter
				browser.send_keys :enter
			end
		end
		if last["!bye"] == "!bye"
			browser.textarea(:id, "field-message").set ("Au revoir à toi ! @"+ last.split(":")[0][0..-2])
			browser.send_keys :enter
			browser.send_keys :enter
		end
		if last["BrouzBot"] == "BrouzBot"
			browser.textarea(:id, "field-message").set ("Les bots sont interdis ici, va-t-en BrouzBot")
			browser.send_keys :enter
		end
		if last["ScruffyBot"] == "ScruffyBot"
			browser.textarea(:id, "field-message").set ("Hé scruffy !")
			browser.send_keys :enter
			browser.textarea(:id, "field-message").set ("!ping")
			browser.send_keys :enter
		end
		if last["!help"] == "!help"
			browser.textarea(:id, "field-message").set ("Les commandes disponibles sont : !hello, !roulette, !bye,!HelloTo <pseudal>")
			browser.send_keys :enter
		end
		if last["!roulette"] == "!roulette"
			nick = last.split(":")[0][0..-3]

			if deads.include?(nick)
				browser.textarea(:id, "field-message").set ("Tu ne peux plus jouer car tu es déjà mort @"+nick)
				browser.send_keys :enter
				browser.send_keys :enter
			else
				browser.textarea(:id, "field-message").set (nick + " pose le canon du revolver sur sa tempe")
				browser.send_keys :enter
				if rand(6)>4
					browser.textarea(:id, "field-message").set (nick + " est mort")
					browser.send_keys :enter
					deads.push(nick)
				else
					browser.textarea(:id, "field-message").set ("*click* il a survécu")
					browser.send_keys :enter
				end
			end
		end
	else
		sleep(0.1)
	end
end


text:
<?php

namespace frontend\controllers;

use Yii;
use common\models\Category;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * CategoryController implements the CRUD actions for Category model.
 */
class CategoryController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    /**
     * Lists all Category models.
     * @return mixed
     */
    public function actionIndex()
    {
        $dataProvider = new ActiveDataProvider([
            'query' => Category::find(),
        ]);

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

    /**
     * Displays a single Category model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Finds the Category model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Category the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Category::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
using System;
using Fake.Testing;
using FSharp.Testing;
using Machine.Specifications;

namespace Test.FAKECore.Testing.NUnit3Specs
{
    [Subject(typeof(NUnit3), "runner argument construction")]
    internal abstract class BuildArgumentsSpecsBase
    {
        private Establish context = () =>
        {
            Assemblies = new[] { "test1.dll", "test2.dll" };
            Parameters = NUnit3.NUnit3Defaults;
        };

        Because of = () =>
        {
            Arguments = NUnit3.buildNUnit3Args(Parameters, Assemblies);
            Console.WriteLine(Arguments);
        };

        protected static NUnit3.NUnit3Params Parameters;
        protected static string[] Assemblies;
        protected static string Arguments;
    }

    internal class When_using_the_default_parameters
        : BuildArgumentsSpecsBase
    {
        It should_not_set_any_trace_value =
            () => Arguments.ShouldNotContain("--trace");

        It should_not_skip_non_test_assemblies =
            () => Arguments.ShouldNotContain("--skipnontestassemblies");
    }

    internal class When_using_non_default_trace_parameter
        : BuildArgumentsSpecsBase
    {
        Establish context =
            () => Parameters = Parameters.With(p => p.TraceLevel, NUnit3.NUnit3TraceLevel.Verbose);

        It should_include_the_expected_trace_argument =
            () => Arguments.ShouldContain(@"--trace=Verbose");
    }

    internal class When_using_SkipNonTestAssemblies_parameter
        : BuildArgumentsSpecsBase
    {
        Establish context =
            () => Parameters = Parameters.With(p => p.SkipNonTestAssemblies, true);

        It should_include_the_expected_skipnontestassemblies_argument =
            () => Arguments.ShouldContain(@"--skipnontestassemblies");
    }
}