text:
/**
 * Module dependencies
 */
var nodeutil = require('util');
var nodepath = require('path');
var chalk = require('chalk');

// Build logger using best-available information
// when this module is initially required.
var log = require('captains-log')(require('../lib/app/configuration/rc'));

/**
 * Fatal Errors
 */
module.exports = {

  // Lift-time and load-time errors
  failedToLoadSails: function(err) {
    log.error(err);
    log.error('Could not load Sails.');
    log.error('Are you using the latest stable version?');
    _terminateProcess(1);
  },

  noPackageJSON: function() {
    log.error('Cannot read package.json in the current directory (' + process.cwd() + ')');
    log.error('Are you sure this is a Sails app?');
    _terminateProcess(1);
  },

  notSailsApp: function() {
    log.error('The package.json in the current directory does not list Sails as a dependency...');
    log.error('Are you sure `' + process.cwd() + '` is a Sails app?');
    _terminateProcess(1);
  },

  badLocalDependency: function(pathTo_localSails, requiredVersion) {
    log.error(
      'The local Sails dependency installed at `' + pathTo.localSails + '` ' +
      'has a corrupted, missing, or un-parsable package.json file.'
    );
    log.error('You may consider running:');
    log.error('rm -rf ' + pathTo_localSails + ' && npm install sails@' + app.dependencies.sails);
    _terminateProcess(1);
  },

  // TODO: replace the inline version of this error
  // app/loadHooks.js:42
  malformedHook: function() {
    log.error('Malformed hook! (' + id + ')');
    log.error('Hooks should be a function with one argument (`sails`)');
    _terminateProcess(1);
  },

  // TODO: replace the inline version of this error
  // app/load.js:146
  hooksTookTooLong: function() {
    var hooksTookTooLongErr = 'Hooks are taking way too long to get ready...  ' +
      'Something might be amiss.\nAre you using any custom hooks?\nIf so, make sure the hook\'s ' +
      '`initialize()` method is triggering its callback.';
    log.error(hooksTookTooLongErr);
    process.exit(1);
  },

  // Invalid user module errors
  invalidCustomResponse: function(responseIdentity) {
    log.error('Cannot define custom response `' + responseIdentity + '`.');
    log.error('`res.' + responseIdentity + '` has special meaning in Connect/Express/Sails.');
    log.error('Please remove the `' + responseIdentity + '` file from the `responses` directory.');
    _terminateProcess(1);
  },

  // This doesn't technically _need_ to be a fatal error- it just is
  // because certain grunt modules (e.g. grunt-contrib-watch) don't restart
  // when an error occurs.
  __GruntAborted__: function(consoleMsg, stackTrace) {

    var gruntErr =
      '\n------------------------------------------------------------------------\n' +
      consoleMsg + '\n' + (stackTrace || '') +
      '\n------------------------------------------------------------------------';
    log.error(gruntErr);
    log.blank();

    log.error('Looks like a Grunt error occurred--');
    log.error('Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)');
    log.error('Or if you\'re stuck, check out the troubleshooting tips below.');
    log.blank();

    log.error(chalk.underline('Troubleshooting tips:'));
    var relativePublicPath = (nodepath.resolve(process.cwd(), './.tmp'));
    var uid = process.getuid && process.getuid() || 'YOUR_COMPUTER_USER_NAME';
    log.error();
    log.error(' *-> Are "grunt" and related grunt task modules installed locally?  Run `npm install` if you\'re not sure.');
    log.error();
    log.error(' *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.');
    log.error();
    log.error(' *-> Or maybe you don\'t have permissions to access the `.tmp` directory?');
    log.error('     e.g., `' + relativePublicPath + '`', '?');
    log.error();
    log.error('     If you think this might be the case, try running:');
    log.error('     sudo chown -R', uid, relativePublicPath);
    log.blank();

    // See note above this function - for now, this will not
    // actually terminate the process.  The rest of Sails should
    // continue to run.
    // return _terminateProcess(1);
  },

  __UnknownPolicy__: function(policy, source, pathToPolicies) {
    source = source || 'config.policies';

    log.error('Unknown policy, "' + policy + '", referenced in `' + source + '`.');
    log.error('Are you sure that policy exists?');
    log.error('It would be located at: `' + pathToPolicies + '/' + policy + '.js`');
    return _terminateProcess(1);
  },

  __InvalidConnection__: function(connection, sourceModelId) {
    log.error('In model (' + sourceModelId + '), invalid connection ::', connection);
    log.error('Must contain an `adapter` key referencing the adapter to use.');
    return _terminateProcess(1);
  },

  __UnknownConnection__: function(connectionId, sourceModelId) {
    log.error('Unknown connection, "' + connectionId + '", referenced in model `' + sourceModelId + '`.');
    log.error('Are you sure that connection exists?  It should be defined in `sails.config.connections`.');

    // var probableAdapterModuleName = connectionId.toLowerCase();
    // if ( ! probableAdapterModuleName.match(/^(sails-|waterline-)/) ) {
    // 	probableAdapterModuleName = 'sails-' + probableAdapterModuleName;
    // }
    // log.error('Otherwise, if you\'re trying to use an adapter named `' + connectionId + '`, please run ' +
    // 	'`npm install ' + probableAdapterModuleName + '@' + sails.majorVersion + '.' + sails.minorVersion + '.x`');
    return _terminateProcess(1);
  },

  __ModelIsMissingConnection__: function(sourceModelId) {
    log.error(nodeutil.format('One of your models (%s) doesn\'t have a connection.', sourceModelId));
    log.error('Do you have a default `connection` in your `config/models.js` file?');
    return _terminateProcess(1);
  },

  __UnknownAdapter__: function(adapterId, sourceModelId, sailsMajorV, sailsMinorV) {
    log.error('Trying to use unknown adapter, "' + adapterId + '", in model `' + sourceModelId + '`.');
    log.error('Are you sure that adapter is installed in this Sails app?');
    log.error('If you wrote a custom adapter with identity="' + adapterId + '", it should be in this app\'s adapters directory.');

    var probableAdapterModuleName = adapterId.toLowerCase();
    if (!probableAdapterModuleName.match(/^(sails-|waterline-)/)) {
      probableAdapterModuleName = 'sails-' + probableAdapterModuleName;
    }
    log.error('Otherwise, if you\'re trying to use an adapter named `' + adapterId + '`, please run ' +
      '`npm install ' + probableAdapterModuleName + ' --save'/*'@' + sailsMajorV + '.' + sailsMinorV + '.x`'*/);
    return _terminateProcess(1);
  },

  __InvalidAdapter__: function(attemptedModuleName, supplementalErrMsg) {
    log.error('There was an error attempting to require("' + attemptedModuleName + '")');
    log.error('Is this a valid Sails/Waterline adapter?  The following error was encountered ::');
    log.error(supplementalErrMsg);

    return _terminateProcess(1);
  }
};

/**
 *
 * TODO: Make all of this more elegant.
 * ========================================================
 * + Ideally we don't call `process.exit()` at all.
 * We should consistently use `sails.lower()` for unhandleable core
 * errors and just trigger the appropriate callback w/ an error for
 * core lift/load and any CLI errors.
 *
 * + Then we won't have to worry as much about dangling child processes
 * and things like that. Plus it's more testable that way.
 *
 * In practice, the best way to do this may be an error domain or an
 * event emitted on the sails object (or both!)
 * ========================================================
 *
 *
 *
 * TODO: Merge w/ app/teardown.js
 * ========================================================
 * (probably achievable by doing the aforementioned cleanup)
 * ========================================================
 */

/**
 * _terminateProcess
 *
 * Terminate the process as elegantly as possible.
 * If process.env is 'test', throw instead.
 *
 * @param  {[type]} code [console error code]
 * @param  {[type]} opts [currently unused]
 */
function _terminateProcess(code, opts) {
  if (process.env.NODE_ENV === 'test') {
    var Signal = new Error({
      type: 'terminate',
      code: code,
      options: {
        todo: 'put the stuff from the original errors in here'
      }
    });
    throw Signal;
  }

  return process.exit(code);
}


text:
module CapybaraExt
  # Just a shorter way of writing it.
  def assert_seen(text, opts={})
    if opts[:within]
      within(selector_for(*opts[:within])) do
        page.should have_content(text)
      end
    else
      page.should have_content(text)
    end
  end

  def assert_no_link_for!(id_or_text)
    lambda { find_link(id_or_text) }.should(raise_error(Capybara::ElementNotFound), "Expected there not to be a link for #{id_or_text.inspect} on page, but there was")
  end

  def flash_alert!(text)
    within("#flash_alert") do
      assert_seen(text)
    end
  end

  def flash_notice!(text)
    within("#flash_notice") do
      assert_seen(text)
    end
  end

  def selector_for(identifier, id = nil)
    case identifier
    when :forum_header
      "#forum h2"
    when :forum_description
      "#forum .description"
    when :topic_header
      "#topic h2"
    when :topic_menu
      "#topic menu"
    when :post_text
      "#posts .post"
    when :post_user
      "#posts .post .user"
    when :post_id
      id ? "#posts #post_#{id}" : "#posts #post_1"
    when :first_post
      "#posts #post_1"
    when :second_post
      "#posts #post_2"
    when :post_actions
      "#{selector_for(:first_post)} .actions"
    else
      pending "No selector defined for #{identifier}. Please define one in spec/support/capybara_ext.rb"
    end
  end

  # Just shorter to type.
  def page!
    save_and_open_page
  end
end

RSpec.configure do |config|
  config.include CapybaraExt
end

redpajama_set_name: RedPajamaGithub


text:
import sys
from seqio import fastaIterator

def getGCSlidingWindow(sequence, window_size):
    '''Calculates %GC in sequence of sliding window window_size'''
    return map(lambda x: (x.count("G")+x.count("C")) / float(window_size),
               map(lambda r: sequence[r:r+window_size],
                   range(len(sequence)-window_size+1)))

def getGCPrintMatrix(gc,resolution):
    '''resolution is the number of y axis ticks, since gc is from 0 to 1
    we just multiply gc * resultion to find the box to put a '*' in
    '''
    rowl = resolution
    coll = len(gc)
    mat = []
    for r in range(rowl):
        mat.append([" "] * coll)

    for entry in range(len(gc)):
        mat[int(gc[entry]*resolution)][entry] = '*'

    return mat

def printGCGraph(name, seq, windowsize, resolution):
    gc = getGCSlidingWindow(seq, windowsize)
    mat = getGCPrintMatrix(gc,resolution)
    print " " * 4 +name
    print " " * 4 +seq
    for res in reversed(range(resolution)):
        sys.stdout.write("%.2f" % (res/float(resolution)))
        print "".join(mat[res])

if __name__ == "__main__":
    import sys

    if not len(sys.argv) == 4:
        sys.exit("gccontent.py in.fa window_size graph_res")

    windowsize = int(sys.argv[2])
    graphres = int(sys.argv[3])

    with open(sys.argv[1]) as fh:
        for record in fastaIterator(fh):
            printGCGraph(record.name, record.seq, windowsize, graphres)


text:
<?php
	session_start();
	include_once('version_number.inc');
?>
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="description" content="Privacy Policy">
	<meta name="author" content="Rene Midouin">
	<meta name="keywords" content="">

	<title>Privacy Policy | CertRebel</title>

	<link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon">
	<link rel="apple-touch-icon" href="/images/apple-touch-icon.png">
	<link rel="apple-touch-icon" sizes="72x72" href="/images/apple-touch-icon-72x72.png">
	<link rel="apple-touch-icon" sizes="114x114" href="/images/apple-touch-icon-114x114.png">

	<link rel="stylesheet" type="text/css" href="/css/dist/bootstyle.min.css?ver=<?php echo $version;?>">

	<?php include_once('scripts/js/seo.php'); ?>

 Call Us: (646) 470-7119

 Email Us: hello@certrebel.com

						<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
										 Toggle navigation

						</button>

Home

About

Courses

Contact

Privacy Policy

Home

Terms

Privacy Policy

							This privacy policy discloses the privacy practices for www.certrebel.com.
							This privacy policy applies solely to information collected by this web site. It will notify you of the following:

What personally identifiable information is collected from you through the web site, how it is used and with whom it may be shared.

What choices are available to you regarding the use of your data.

The security procedures in place to protect the misuse of your information.

How you can correct any inaccuracies in the information.

							Information Collection, Use, and Sharing

							We are the sole owners of the information collected on this site.
							We only have access to/collect information that you voluntarily give us via email or other direct contact from you.
							We will not sell or rent this information to anyone.

							We will use your information to respond to you, regarding the reason you contacted us.
							We will not share your information with any third party outside of our organization, other than as necessary to fulfill your request, i.e. to ship an order.

							Unless you ask us not to, we may contact you via email in the future to tell you about specials, new products or services, or changes to this privacy policy.

							Your Access to and Control Over Information

							You may opt out of any future contacts from us at any time.
							You can do the following at any time by contacting us via the email address or phone number given on our website:

See what data we have about you, if any.

Change/correct any data we have about you.

Have us delete any data we have about you.

Express any concern you have about our use of your data.

							Security

							We take precautions to protect your information.
							When you submit sensitive information via the website, your information is protected both online and offline.
							To read more about our web security, visit Stripe at: https://stripe.com/us/features#seamless-security.

							Wherever we collect sensitive information (such as credit card data), that information is encrypted and transmitted to us in a secure way.
							You can verify this by looking for a closed lock icon at the bottom of your web browser, or looking for "https" at the beginning of the address of the web page.

							While we use encryption to protect sensitive information transmitted online, we also protect your information offline.
							Only employees who need the information to perform a specific job (for example, billing or customer service) are granted access to personally identifiable information.
							The computers/servers in which we store personally identifiable information are kept in a secure environment.

							Registration

							In order to use this website, a user must first complete the registration form.
							During registration a user is required to give certain information (such as name and email address).
							This information is used to contact you about the products/services on our site in which you have expressed interest.
							At your option, you may also provide demographic information (such as gender or age) about yourself, but it is not required.

							Orders

							We request information from you on our order form.
							To buy from us, you must provide contact information (like name and shipping address) and financial information (like credit card number, expiration date).
							This information is used for billing purposes and to fill your orders. If we have trouble processing an order, we'll use this information to contact you.

							Updates

							Our Privacy Policy may change from time to time and all updates will be posted on this page.
							If you feel that we are not abiding by this privacy policy, you should contact us immediately via telephone at 646-470-7119 or via email.

		<?php require_once("forms/footer/footer.php"); ?>


text:
<?php

namespace Drupal\migrate\Plugin\migrate\process;

use Drupal\migrate\MigrateSkipProcessException;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Row;
use Drupal\migrate\MigrateSkipRowException;

/**
 * Skips processing the current row when the input value is empty.
 *
 * The skip_on_empty process plugin checks to see if the current input value
 * is empty (empty string, NULL, FALSE, 0, '0', or an empty array). If so, the
 * further processing of the property or the entire row (depending on the chosen
 * method) is skipped and will not be migrated.
 *
 * Available configuration keys:
 * - method: (optional) What to do if the input value is empty. Possible values:
 *   - row: Skips the entire row when an empty value is encountered.
 *   - process: Prevents further processing of the input property when the value
 *     is empty.
 *
 * Examples:
 *
 * @code
 * process:
 *   field_type_exists:
 *     plugin: skip_on_empty
 *     method: row
 *     source: field_name
 * @endcode
 *
 * If field_name is empty, skips the entire row.
 *
 * @code
 * process:
 *   parent:
 *     -
 *       plugin: skip_on_empty
 *       method: process
 *       source: parent
 *     -
 *       plugin: migration
 *       migration: d6_taxonomy_term
 * @endcode
 *
 * If parent is empty, any further processing of the property is skipped - thus,
 * the next plugin (migration) will not be run.
 *
 * @see \Drupal\migrate\Plugin\MigrateProcessInterface
 *
 * @MigrateProcessPlugin(
 *   id = "skip_on_empty"
 * )
 */
class SkipOnEmpty extends ProcessPluginBase {

  /**
   * Skips the current row when value is not set.
   *
   * @param mixed $value
   *   The input value.
   * @param \Drupal\migrate\MigrateExecutableInterface $migrate_executable
   *   The migration in which this process is being executed.
   * @param \Drupal\migrate\Row $row
   *   The row from the source to process.
   * @param string $destination_property
   *   The destination property currently worked on. This is only used together
   *   with the $row above.
   *
   * @return mixed
   *   The input value, $value, if it is not empty.
   *
   * @throws \Drupal\migrate\MigrateSkipRowException
   *   Thrown if the source property is not set and the row should be skipped,
   *   records with STATUS_IGNORED status in the map.
   */
  public function row($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (!$value) {
      throw new MigrateSkipRowException();
    }
    return $value;
  }

  /**
   * Stops processing the current property when value is not set.
   *
   * @param mixed $value
   *   The input value.
   * @param \Drupal\migrate\MigrateExecutableInterface $migrate_executable
   *   The migration in which this process is being executed.
   * @param \Drupal\migrate\Row $row
   *   The row from the source to process.
   * @param string $destination_property
   *   The destination property currently worked on. This is only used together
   *   with the $row above.
   *
   * @return mixed
   *   The input value, $value, if it is not empty.
   *
   * @throws \Drupal\migrate\MigrateSkipProcessException
   *   Thrown if the source property is not set and rest of the process should
   *   be skipped.
   */
  public function process($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (!$value) {
      throw new MigrateSkipProcessException();
    }
    return $value;
  }

}


text:
Simparino
=========
>Simparino is a _McDappy_ __Doo__ whistle BOWOW CHICA WOW WOW

Set Development Environmentodino
--------------------------------

####  Dependencies

You need to install these libraries some howowino

Library Name                                 | Description
-----------------------------------------    | -----------
[SDL2](http://www.libsdl.org/)               | cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D
[GLEW](http://glew.sourceforge.net/)         | The OpenGL Extension Wrangler Library
[Bullet Physics 2.82](https://code.google.com/p/bullet/downloads/list) | Bullet 3D Real-Time Multiphysics Library provides state of the art collision detection, soft body and rigid body dynamics.

####  Macarino OS Developmentodino

1. Build SDL2 framework library bundle and stick in in /Library/Frameworks
2. Install GLEW
3. Install Bullet physics as library framework bundle
3. Run Make

####  Microsoft Visual Stupodino

1. Download [Microsoft DirectX June 2010](http://www.microsoft.com/en-us/download/details.aspx?id=8109). We need this to build SDL2
3. Build and link bullet physics
4. Use [this tutorial](http://www.libsdl.org/tmp/SDL/VisualC.html) to build SDL2 in Visual Studio
5. Use [this tutorial](http://twinklebeardev.blogspot.com/2012/07/setting-up-sdl-in-visual-studio.html) to add SDL2 dependency to a new project
6. Link glew binaries
7. Add reference to source files in project

Thanks for checking out Simparino and don't forget to MacDappy Dooperino your whistle pineapplerino :-)


text:
PROGRAM=./out/croppa
OBJS=out/croppa.o
LIBS=`GraphicsMagick-config --ldflags --libs`
EXTRA_CFLAGS=`GraphicsMagick-config --cppflags`

include ../../shared/tools.mk


text:
package com.beecavegames.bjc.handlers;

import java.util.Date;

import com.beecavegames.common.Response;
import com.beecavegames.common.Response.Status;
import com.beecavegames.dispatch.Param;
import com.beecavegames.dispatch.RequestContext;
import com.beecavegames.dispatch.RequiresAuthentication;
import com.beecavegames.stats.Counter;
import com.beecavegames.stats.GlobalCounter;
import com.beecavegames.stats.StatsManager;
import com.beecavegames.util.Config;
import com.google.inject.Inject;

@RequiresAuthentication(false)
public class TapstreamPostbackHandler{

	@Inject StatsManager stats;

	private static final Counter COUNTER_PAID_INSTALL = Counter.create(GlobalCounter.Category.Install, GlobalCounter.Install.paid);
	private static final Counter COUNTER_REFERRAL_INSTALL = Counter.create(GlobalCounter.Category.Install, GlobalCounter.Install.referral);

	public Response handle(RequestContext rc, @Param("campaign_id") final String campaignId,
			@Param("referring_beeid") final String referringBeeId, @Param("event") final String event,
			@Param("beeid") final String beeid, @Param("ts") final long timestamp, @Param("secret") final String secret
			) {

		Response response;

		if(secret.equals(Config.getString("tapstream.postback.secret", ""))) {
			if(referringBeeId.isEmpty()) {
				stats.count(COUNTER_PAID_INSTALL.withLabel(campaignId), new Date(timestamp * 1000));
			} else {
				stats.count(COUNTER_REFERRAL_INSTALL.withLabel(referringBeeId), new Date(timestamp * 1000));
			}
			response = new Response();
			response.status = Status.OK;
		} else {
			response = new Response("These are not the droids you're looking for");
			response.status = Status.FAIL;
		}

		return response;
	}
}


text:
package rapture.plugin.validators;

import java.util.List;

import rapture.common.RaptureURI;
import rapture.common.impl.jackson.JacksonUtil;
import rapture.plugin.validators.Note.Level;

public abstract class JsonValidator<T> implements Validator {
    Class<T> clazz;

    public JsonValidator(Class<T> clazz) {
        this.clazz = clazz;
    }

    @Override
    public void validate(String content, RaptureURI uri, List<Note> errors) {
        if (uri.hasAttribute()) {
            if (needsRawValidation()) validateRaw(content, uri, errors);
        }
        T thing = null;
        try {
            thing = JacksonUtil.objectFromJson(content, clazz);
        } catch (Exception ex) {
            errors.add(new Note(Level.ERROR, "Failed to parse Json for " + uri.toString()));
            return;
        }
        validateObject(thing, uri, errors);
    }

    public boolean needsRawValidation() {
        return false;
    }

    abstract void validateObject(T thing, RaptureURI uri, List<Note> errors);

    abstract void validateRaw(String content, RaptureURI uri, List<Note> errors);
}


text:
name             'my_cookbook'
maintainer       'Unique Consultants'
maintainer_email 'parveen.beniwal@gmail.com'
license          'Apache 2.0'
description      'Installs/Configures my_cookbook'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '0.1.0'


text:
using System;

namespace Metaheuristics
{
	public class SSBL42SP : IMetaheuristic, ITunableMetaheuristic
	{
		protected int timePenalty = 250;
		public int poolSize = 200;
		public int refSetSize = 10;
		public double explorationFactor = 0.75;

		public void Start(string inputFile, string outputFile, int timeLimit)
		{
			TwoSPInstance instance = new TwoSPInstance(inputFile);
			DiscreteSS ss = new DiscreteSSBL42SP(instance, poolSize, refSetSize, explorationFactor);
			ss.Run(timeLimit - timePenalty);
			int[,] coordinates = TwoSPUtils.BLCoordinates(instance, ss.BestSolution);
			TwoSPSolution solution = new TwoSPSolution(instance, coordinates);
			solution.Write(outputFile);
		}

		public string Name {
			get {
				return "SS using the BL heuristic for 2SP";
			}
		}

		public MetaheuristicType Type {
			get {
				return MetaheuristicType.SS;
			}
		}

		public ProblemType Problem {
			get {
				return ProblemType.TwoSP;
			}
		}

		public string[] Team {
			get {
				return About.Team;
			}
		}

		public void UpdateParameters(double[] parameters)
		{
			timePenalty = (int) parameters[0];
			poolSize = (int) parameters[1];
			refSetSize = (int) parameters[2];
			explorationFactor = parameters[3];
		}
	}
}


text:
/* $Id$ */
/*
 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
 * See the copyright notice in the ACK home directory, in the file "Copyright".
 */
#include <stdio.h>
#include <em_spec.h>
#include "../share/types.h"
#include "../share/debug.h"
#include "../share/lset.h"
#include "cs.h"
#include "cs_aux.h"
#include "cs_avail.h"
#include "cs_entity.h"

#ifdef VERBOSE

extern char em_mnem[]; /* The mnemonics of the EM instructions. */

static void showinstr(line_p lnp)
{
	/* Makes the instruction in `lnp' human readable. Only lines that
	 * can occur in expressions that are going to be eliminated are
	 * properly handled.
	 */
	if (INSTR(lnp) < sp_fmnem && INSTR(lnp) > sp_lmnem) {
		fprintf(stderr,"*** ?\n");
		return;
	}

	fprintf(stderr,"%s", &em_mnem[4 * (INSTR(lnp)-sp_fmnem)]);
	switch (TYPE(lnp)) {
		case OPNO:
			break;
		case OPSHORT:
			fprintf(stderr," %d", SHORT(lnp));
			break;
		case OPOBJECT:
			fprintf(stderr," %d", OBJ(lnp)->o_id);
			break;
		case OPOFFSET:
			fprintf(stderr," %ld", OFFSET(lnp));
			break;
		default:
			fprintf(stderr," ?");
			break;
	}
	fprintf(stderr,"\n");
}

void SHOWOCCUR(occur_p ocp)
{
	/* Shows all instructions in an occurrence. */

	line_p lnp, next;

	if (verbose_flag) {
		for (lnp = ocp->oc_lfirst; lnp != (line_p) 0; lnp = next) {
			next = lnp == ocp->oc_llast ? (line_p) 0 : lnp->l_next;

			showinstr(lnp);
		}
	}
}

#endif

#ifdef TRACE

void SHOWAVAIL(avail_p avp)
{
	/* Shows an available expression. */
	showinstr(avp->av_found);
	fprintf(stderr,"result %d,", avp->av_result);
	fprintf(stderr,"occurred %d times\n", Lnrelems(avp->av_occurs) + 1);

}

void OUTAVAILS()
{
	avail_p ravp;

	fprintf(stderr,"AVAILABLE EXPRESSIONS\n");

	for (ravp = avails; ravp != (avail_p) 0; ravp = ravp->av_before) {
		SHOWAVAIL(ravp);
		fprintf(stderr,"\n");
	}
}

static char *enkinds[] = {
	"constant",
	"local",
	"external",
	"indirect",
	"offsetted",
	"address of local",
	"address of external",
	"address of offsetted",
	"address of local base",
	"address of argument base",
	"procedure",
	"floating zero",
	"array element",
	"local base",
	"heap pointer",
	"ignore mask"
};

void OUTENTITIES()
{
	Lindex i;

	fprintf(stderr,"ENTITIES\n");
	for (i = Lfirst(entities); i != (Lindex) 0; i = Lnext(i, entities)) {
		entity_p rep = en_elem(i);

		fprintf(stderr,"%s,", enkinds[rep->en_kind]);
		fprintf(stderr,"size %ld,", rep->en_size);
		fprintf(stderr,"valno %d,", rep->en_vn);
		switch (rep->en_kind) {
			case ENCONST:
				fprintf(stderr,"$%ld\n", rep->en_val);
				break;
			case ENLOCAL:
			case ENALOCAL:
				fprintf(stderr,"%ld(LB)\n", rep->en_loc);
				break;
			case ENINDIR:
				fprintf(stderr,"*%d\n", rep->en_ind);
				break;
			case ENOFFSETTED:
			case ENAOFFSETTED:
				fprintf(stderr,"%ld(%d)\n", rep->en_off, rep->en_base);
				break;
			case ENALOCBASE:
			case ENAARGBASE:
				fprintf(stderr,"%ld levels\n", rep->en_levels);
				break;
			case ENARRELEM:
				fprintf(stderr,"%d[%d], ",rep->en_arbase,rep->en_index);
				fprintf(stderr,"rom at %d\n", rep->en_adesc);
				break;
		}
		fprintf(stderr,"\n");
	}
}

#endif /* TRACE */


text:
package fr.eni.QCM.BO;

public abstract class Utilisateur {

	// ATTRIBUTS
	private int id;
	private String nom;
	private String prenom;
	private String mail;
	private String login;
	private String password;

	// CONSTRUCTEUR
	public Utilisateur(int id, String nom, String prenom, String mail, String login, String password) {
		this.id = id;
		this.nom = nom;
		this.prenom = prenom;
		this.mail = mail;
		this.login = login;
		this.password = password;
	}

	public Utilisateur(){

	}

	// ID
	public int getId() {return id;}
	public void setId(int id) {this.id = id;}

	// NOM
	public String getNom() {return nom;}
	public void setNom(String nom) {this.nom = nom;}

	// PRENOM
	public String getPrenom() {return prenom;}
	public void setPrenom(String prenom) {this.prenom = prenom;}

	// MAIL
	public String getMail() {return mail;}
	public void setMail(String mail) {this.mail = mail;}

	// LOGIN
	public String getLogin() {return login;}
	public void setLogin(String login) {this.login = login;}

	// PASSWORD
	public String getPassword() {return password;}
	public void setPassword(String password) {this.password = password;}

	// FONCTIONS
	@Override
	public String toString() {
		return "Utilisateur [id=" + getId() + ", nom=" + getNom() + ", prenom=" + getPrenom()
				+ ", mail=" + getMail() + ", login=" + getLogin() + ", password="
				+ getPassword() + "]";
	}

}


text:
package org.carewebframework.ui.xml;

import org.carewebframework.ui.util.CWFUtil;

/**
 * Static utility class for XML viewing constants.
 */
public class XMLConstants {

    protected static final String RESOURCE_PATH = CWFUtil.getResourcePath(XMLConstants.class);

    protected static final String VIEW_DIALOG = RESOURCE_PATH + "xmlViewer.fsp";

    protected static final String STYLE_TAG = "cwf-xml-tag";

    protected static final String STYLE_ATTR_NAME = "cwf-xml-attrname";

    protected static final String STYLE_ATTR_VALUE = "cwf-xml-attrvalue";

    protected static final String STYLE_CONTENT = "cwf-xml-content";

    protected static final String STYLE_COMMENT = "cwf-xml-comment";

    public static final String[] EXCLUDED_PROPERTIES = {};

    /**
     * Enforce static class.
     */
    private XMLConstants() {
    }
}


text:
from datetime import datetime
from os import environ, path, makedirs
from subprocess import Popen
from sys import stderr, stdout

_TEMPORARY_FOLDER = '/tmp/mongo-backup/'

class BackupMongo(object):
    def __init__(self, *, databases, target_folder):
        """
        Args:
            databases (list of dict)
            target_folder (str)
        """

        self._databases = databases
        self._target_folder = target_folder

    @staticmethod
    def _create_mongo_backup(archive_path, database_host, database_name):
        command_args = ["mongodump",
                        "--host=" + database_host,
                        "--db=" + database_name,
                        "--archive=" + archive_path,
                        "--gzip"]
        process = Popen(command_args)
        result, err = process.communicate(timeout=600)
        assert not err, 'Process raised error [%s].' % err

    def _move_to_buket(self, archive_path):
        command_args = ["mv", archive_path, self._target_folder]
        process = Popen(command_args)
        result, err = process.communicate(timeout=600)
        assert not err, 'Process raised errorr [%s].' % err

    def _backup_database(self, database_host, database_name):
        if not path.exists(_TEMPORARY_FOLDER):
            makedirs(_TEMPORARY_FOLDER)
        archive_path = "%s%s_%s.gz" % \
                       (_TEMPORARY_FOLDER,
                        database_name,
                        datetime.utcnow().strftime("%Y%m%d_%H%M"))
        self._create_mongo_backup(archive_path, database_host, database_name)
        self._move_to_buket(archive_path)
        stdout.write("Backup of [%s]/[%s] completed.\n" %
                     (database_host, database_name))

    def execute(self):
        success = True
        for database in self._databases:
            try:
                self._backup_database(database['host'], database['database'])
            except Exception as e:
                success = False
                stderr.write("Backup error: [%s]\n" % e)
        return success

if __name__ == '__main__':
    target = None
    dbs = None
    try:
        target = environ['TARGET_FOLDER']
        dbs = [{'host': environ['MONGO_STAGE_HOST'],
                'database': environ['MONGO_STAGE_DATABASE']},
               {'host': environ['MONGO_MASTER_HOST'],
                'database': environ['MONGO_MASTER_DATABASE']}]
    except Exception as e:
        stderr.write('Missing environment variable [%s].' % e)
        exit(1)
    backup = BackupMongo(databases=dbs, target_folder=target)
    if backup.execute():
        stderr.write("Database backup completed.")
        exit(0)
    else:
        stderr.write("Database backup failed.")
        exit(1)


text:
// <copyright file="RunTests.cs" company="Peter Ibbotson">
// (C) Copyright 2017 Peter Ibbotson
// </copyright>

namespace ClassicBasic.Test.CommandTests
{
    using System.Collections.Generic;
    using ClassicBasic.Interpreter;
    using ClassicBasic.Interpreter.Commands;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Moq;

    /// <summary>
    /// Test class for RUN.
    /// </summary>
    [TestClass]
    public class RunTests
    {
        private Run _sut;
        private IRunEnvironment _runEnvironment;
        private ProgramLine _line10;
        private ProgramLine _line20;
        private Mock<ITokeniser> _mockTokeniser;
        private Mock<IProgramRepository> _mockProgramRepository;
        private Mock<IVariableRepository> _mockVariableRepository;
        private Mock<IDataStatementReader> _mockDataStatementReader;

        /// <summary>
        /// Run clears Program stack and variables.
        /// </summary>
        [TestMethod]
        public void RunClearsVariablesAndStacks()
        {
            SetupSut();
            _runEnvironment.ProgramStack.Push(new StackEntry());
            _sut.Execute(_mockTokeniser.Object);
            Assert.AreEqual(10, _runEnvironment.CurrentLine.LineNumber);
            _mockVariableRepository.Verify(mvr => mvr.Clear(), Times.Once);
            _mockDataStatementReader.Verify(mdsr => mdsr.RestoreToLineNumber(null), Times.Once);
            Assert.AreEqual(0, _runEnvironment.ProgramStack.Count);
        }

        /// <summary>
        /// Run starts from a line number.
        /// </summary>
        [TestMethod]
        public void RunStartsFromALineNumber()
        {
            SetupSut();
            _runEnvironment.CurrentLine = new ProgramLine(null, new List<IToken> { new Token("20") });
            _runEnvironment.ProgramStack.Push(new StackEntry());
            _sut.Execute(_mockTokeniser.Object);
            Assert.AreEqual(20, _runEnvironment.CurrentLine.LineNumber);
        }

        /// <summary>
        /// Run starts from a line number.
        /// </summary>
        [TestMethod]
        public void RunExecutesLoad()
        {
            SetupSut();
            var mockLoadToken = new Mock<IToken>();
            var mockLoadCmd = mockLoadToken.As<ITokeniserCommand>();
            _mockTokeniser.Setup(mt => mt.Tokenise("LOAD \"test.bas\""))
                .Returns(new ProgramLine(null, new List<IToken> { mockLoadToken.Object }));
            _runEnvironment.CurrentLine = new ProgramLine(null, new List<IToken> { new Token("test.bas", TokenClass.String) });
            _runEnvironment.ProgramStack.Push(new StackEntry());
            _sut.Execute(_mockTokeniser.Object);
            mockLoadCmd.Verify(mlc => mlc.Execute(_mockTokeniser.Object), Times.Once);
        }

        private void SetupSut()
        {
            _runEnvironment = new RunEnvironment
            {
                CurrentLine = new ProgramLine(null, new List<IToken> { })
            };
            _line10 = new ProgramLine(10, new List<IToken> { });
            _line20 = new ProgramLine(20, new List<IToken> { });
            _mockTokeniser = new Mock<ITokeniser>();
            _mockProgramRepository = new Mock<IProgramRepository>();
            _mockProgramRepository.Setup(mpr => mpr.GetFirstLine()).Returns(_line10);
            _mockProgramRepository.Setup(mpr => mpr.GetLine(20)).Returns(_line20);
            _mockVariableRepository = new Mock<IVariableRepository>();
            _mockDataStatementReader = new Mock<IDataStatementReader>();
            _sut = new Run(
                _runEnvironment,
                _mockProgramRepository.Object,
                _mockVariableRepository.Object,
                _mockDataStatementReader.Object);
        }
    }
}


text:
static bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
                         void* context, bool success) {
  if (!success) {
    static const char msg[] = "Failed to write minidump\n";
    sys_write(2, msg, sizeof(msg) - 1);
    return false;
  }

  static const char msg[] = "Wrote minidump: ";
  sys_write(2, msg, sizeof(msg) - 1);
  sys_write(2, descriptor.path(), strlen(descriptor.path()));
  sys_write(2, "\n", 1);

  return true;
}

static void DoSomethingWhichCrashes() {
  int local_var = 1;
  *reinterpret_cast<volatile char*>(NULL) = 1;
}

int main() {
  google_breakpad::MinidumpDescriptor minidump(".");
  google_breakpad::ExceptionHandler breakpad(minidump, NULL, DumpCallback, NULL,
                                             true, -1);
  DoSomethingWhichCrashes();
  return 0;
}


text:
package io.github.jeddict.rest.applicationconfig;

import io.github.jeddict.jcode.ui.GenericDialog;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.SourceGroup;
import org.openide.util.NbBundle;

/**
 *
 * @author Gaurav Gupta
 */
public class RestConfigDialog extends GenericDialog {

    /**
     * Creates new form RestConfigDialog
     */
    public RestConfigDialog() {
        initComponents();
        this.setTitle(NbBundle.getMessage(RestConfigDialog.class, "RestConfigDialog.title"));
        getRootPane().setDefaultButton(updateButton);
    }

      public void init(String _package,Project project, SourceGroup sourceGroup) {
       restConfigPanel1.init(_package, project, sourceGroup);
       restConfigPanel1.read();

      }
    public RestConfigData getRestConfigData() {
        return restConfigPanel1.getConfigData();
    }

//    public void setRestApplicationClasses(List<RestApplication> restApplicationClasses) {
//        this.restConfigPanel1.setRestApplicationClasses(restApplicationClasses);
//    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        restConfigPanel1 = new io.github.jeddict.rest.applicationconfig.RestConfigPanel();
        updateButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        org.openide.awt.Mnemonics.setLocalizedText(updateButton, org.openide.util.NbBundle.getMessage(RestConfigDialog.class, "RestConfigDialog.updateButton.text")); // NOI18N
        updateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                updateButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(RestConfigDialog.class, "RestConfigDialog.cancelButton.text")); // NOI18N
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(restConfigPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(updateButton)
                .addGap(18, 18, 18)
                .addComponent(cancelButton)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(restConfigPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(updateButton)
                    .addComponent(cancelButton))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
        if (!restConfigPanel1.hasError()) {
            setVisible(false);
            this.setDialogResult(javax.swing.JOptionPane.OK_OPTION);
            dispose();
            restConfigPanel1.store();
        }
    }//GEN-LAST:event_updateButtonActionPerformed

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        cancelActionPerformed(evt);
    }//GEN-LAST:event_cancelButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private io.github.jeddict.rest.applicationconfig.RestConfigPanel restConfigPanel1;
    private javax.swing.JButton cancelButton;
    private javax.swing.JButton updateButton;
    // End of variables declaration//GEN-END:variables
}


text:
@jsinterop.annotations.JsPackage(namespace = "swell.operation")
package org.swellrt.beta.client.rest.operations;


text:
using FullSerializer;
using UnityEngine;
using System.Collections;

namespace IBM.Watson.DeveloperCloud.Services.PersonalityInsights.v2
{
  /// <summary>
  /// The profile result from Personality Insights.
  /// </summary>
  [fsObject]
  public class Profile
  {
    /// <summary>
    /// Detailed results for a specific characteristic of the input text.
    /// </summary>
    /// <value>The tree.</value>
    public TraitTreeNode tree { get; set; }

    /// <summary>
    /// The unique user identifier for which these characteristics were computed. The value is derived from the userid field of the input ContentItem objects. The field is passed as-is from JSON input. Sanitize the contents of the field before displaying them to prevent cross-site scripting attacks.
    /// </summary>
    /// <value>The identifier.</value>
    public string id { get; set; }

    /// <summary>
    /// The source identifier for which these characteristics were computed. The value is derived from the sourceid field of the input ContentItem objects. The field is passed as-is from JSON input. Sanitize the contents of the field before displaying them to prevent cross-site scripting attacks.
    /// </summary>
    /// <value>The source.</value>
    public string source { get; set; }

    /// <summary>
    /// The language model that was used to process the input; for example, en.
    /// </summary>
    /// <value>The processed lang.</value>
    public string processed_lang { get; set; }

    /// <summary>
    /// The number of words that were found in the input.
    /// </summary>
    /// <value>The word count.</value>
    public string word_count { get; set; }

    /// <summary>
    /// When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
    /// </summary>
    /// <value>The word count message.</value>
    public string word_count_message { get; set; }

    /// <summary>
    /// Warning messages associated with the input text submitted with the request. The array is empty if the input generated no warnings.
    /// </summary>
    /// <value>The warnings.</value>
    public Warning[] warnings { get; set; }
  }

  /// <summary>
  /// The trait tree node of the trait tree.
  /// </summary>
  [fsObject]
  public class TraitTreeNode
  {
    /// <summary>
    /// The unique identifier of the characteristic to which the results pertain.
    /// </summary>
    /// <value>The identifier.</value>
    public string id { get; set; }

    /// <summary>
    /// The user-visible name of the characteristic.
    /// </summary>
    /// <value>The name.</value>
    public string name { get; set; }

    /// <summary>
    /// The category of the characteristic: personality, needs, values, or behavior (for temporal data).
    /// </summary>
    /// <value>The category.</value>
    public string category { get; set; }

    /// <summary>
    /// For personality, needs, and values characteristics, the normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.25, the author scored in the 25th percentile; the author is more open than 24% of the population and less open than 74% of the population. For temporal behavior characteristics, the percentage of timestamped data that occurred during that day or hour.
    /// </summary>
    /// <value>The percentage.</value>
    public string percentage { get; set; }

    /// <summary>
    /// For personality, needs, and values characteristics, indicates the sampling error of the percentage based on the number of words in the input text. The range is 0 to 1. The number defines a 95% confidence interval around the percentage. For example, if the sampling error is 4% and the percentage is 61%, it is 95% likely that the actual percentage value is between 57% and 65% if more words are given.
    /// </summary>
    /// <value>The sampling error.</value>
    public string sampling_error { get; set; }

    /// <summary>
    /// For personality, needs, and values characteristics, the raw score for the characteristic. A positive or negative score indicates more or less of the characteristic; zero indicates neutrality or no evidence for a score. The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
    /// </summary>
    /// <value>The raw score.</value>
    public string raw_score { get; set; }

    /// <summary>
    /// For personality, needs, and values characteristics, indicates the sampling error of the raw score based on the number of words in the input. The practical range is 0 to 1. The number defines a 95% confidence interval around the raw score. For example, if the raw sampling error is 5% and the raw score is 65%, it is 95% likely that the actual raw score is between 60% and 70% if more words are given.
    /// </summary>
    /// <value>The raw sampling error.</value>
    public string raw_sampling_error { get; set; }

    /// <summary>
    /// Recursive array of more detailed characteristics inferred from the input text.
    /// </summary>
    /// <value>The children.</value>
    public TraitTreeNode[] children { get; set; }
  }

  /// <summary>
  /// The warning object.
  /// </summary>
  [fsObject]
  public class Warning
  {
    /// <summary>
    /// The identifier of the warning message, one of WORD_COUNT_MESSAGE or JSON_AS_TEXT.
    /// </summary>
    /// <value>The identifier.</value>
    public string id { get; set; }

    /// <summary>
    /// The message associated with the id. For WORD_COUNT_MESSAGE, "There were [number] words in the input. We need a minimum of 3,500, preferably 6,000 or more, to compute statistically significant estimates"; for JSON_AS_TEXT, "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?".
    /// </summary>
    /// <value>The message.</value>
    public string message { get; set; }
  }

  /// <summary>
  /// Holder for content items.
  /// </summary>
  [fsObject]
  public class ContentListContainer
  {
    /// <summary>
    /// An array of content items for personality insight profile request.
    /// </summary>
    /// <value>The content items.</value>
    public ContentItem[] contentItems { get; set; }
  }

  /// <summary>
  /// The content item.
  /// </summary>
  [fsObject]
  public class ContentItem
  {
    /// <summary>
    /// Unique identifier for this content item.
    /// </summary>
    /// <value>The identifier.</value>
    public string id { get; set; }

    /// <summary>
    /// Unique identifier for the author of this content.
    /// </summary>
    /// <value>The userid.</value>
    public string userid { get; set; }

    /// <summary>
    /// Identifier for the source of this content, for example, blog123 or twitter.
    /// </summary>
    /// <value>The sourceid.</value>
    public string sourceid { get; set; }

    /// <summary>
    /// Timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
    /// </summary>
    /// <value>The created.</value>
    public string created { get; set; }

    /// <summary>
    /// Timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
    /// </summary>
    /// <value>The updated.</value>
    public string updated { get; set; }

    /// <summary>
    /// MIME type of the content, for example, text/plain (the default) or text/html. The tags are stripped from HTML content before it is analyzed; other MIME types are processed as is.
    /// </summary>
    /// <value>The contenttype.</value>
    public string contenttype { get; set; }

    /// <summary>
    /// Language identifier (two-letter ISO 639-1 identifier) for the input text: ar (Arabic), en (English), es (Spanish), or ja (Japanese). The default is English. Regional variants are treated as their parent language; for example, en-US is interpreted as en. A language specified with the Content-Type header overrides the value of this parameter; any content items that specify a different language are ignored. Omit the Content-Type header to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input text and the response (Accept-Language).
    /// </summary>
    /// <value>The language.</value>
    public string language { get; set; }

    /// <summary>
    /// Content to be analyzed. Up to 20 MB of content is supported.
    /// </summary>
    /// <value>The content.</value>
    public string content { get; set; }

    /// <summary>
    /// Unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on.
    /// </summary>
    /// <value>The parentid.</value>
    public string parentid { get; set; }

    /// <summary>
    /// Indicates whether this content item is a reply to another content item.
    /// </summary>
    /// <value><c>true</c> if reply; otherwise, <c>false</c>.</value>
    public bool reply { get; set; }

    /// <summary>
    /// Indicates whether this content item is a forwarded/copied version of another content item.
    /// </summary>
    /// <value><c>true</c> if forward; otherwise, <c>false</c>.</value>
    public bool forward { get; set; }
  }

  /// <summary>
  /// The content type. Either text, html or json.
  /// </summary>
  public class ContentType
  {
    /// <summary>
    /// Mime type for plain text.
    /// </summary>
    public const string TEXT_PLAIN = "text/plain";

    /// <summary>
    /// Mime type for HTML.
    /// </summary>
    public const string TEXT_HTML = "text/html";

    /// <summary>
    /// Mime type for json.
    /// </summary>
    public const string APPLICATION_JSON = "application/json";
  }

  /// <summary>
  /// The content language. Either English, Arabic, Spanish or Japanese.
  /// </summary>
  public class Language
  {
    /// <summary>
    /// English.
    /// </summary>
    public const string ENGLISH = "en";
    /// <summary>
    /// Arabic.
    /// </summary>
    public const string ARABIC = "ar";
    /// <summary>
    /// Spanish.
    /// </summary>
    public const string SPANISH = "es";
    /// <summary>
    /// Japanese
    /// </summary>
    public const string JAPANESE = "ja";
  }
}


text:
<link rel="import" href="../forge-shared/polymer.html">

<link rel="import" href="../_lib/google-chart/google-chart.html">

<link rel="import" href="../forge-shared/forge-shared.html">

<dom-module id="forge-statistics-chart-card">

  <template>

    <paper-card>

        <iron-icon class="icon" icon="[[icon]]"></iron-icon>
        [[localize(heading)]]

      <paper-progress hidden$="[[_hideLoading]]" class="loading-bar" indeterminate></paper-progress>

        <template is="dom-if" if="[[_missingResults]]">
          [[localize('wcm.cardStatisticsEmptyState')]]
        </template>
        <google-chart class$="{{_getChartClasses(_missingResults)}}" id="statisticsChart" type="line" options=[[_chartOptions]]></google-chart>

    </paper-card>

  </template>

</dom-module>


text:
  // set a base case of digits length is 0
    //if digits length is 0
      // create an array
      // loop through temp array
      // set arr = temp
      // join array and push it into result
    // grab first digit of substring and parse into integer and set it to currentDigit
    // create a letters variable that check against the letter library returns the set of letters of that digit
    // loop through the letters
      // push the first letter of the set of letters into temp
      // run the getString function digits, temp array, final result array, and the letter library
      // remove whats in temp with pop
// call getString function on remainding digits, temp array, final result array, and the letter library
// return result

var letterCombinations = function(digits) {
     var letterLib = [];
         letterLib[2]="abc";
         letterLib[3]="def";
         letterLib[4]="ghi";
         letterLib[5]="jkl";
         letterLib[6]="mno";
         letterLib[7]="pqrs";
         letterLib[8]="tuv";
         letterLib[9]="wxyz";
         letterLib[0]="";
    var result = [];
    if(digits === null || digits.length === 0){
        return result;
    }
    var temp = [];

    function getString(digits, temp, result, letterLib){
        if(digits.length === 0){
            var arr = [];
            for(var i=0; i<temp.length; i++){
                arr[i] = temp[i];
            }
            result.push(arr.join(''));
            return;
        }
        var currentDigit = parseInt(digits.substring(0,1));
        var letters = letterLib[currentDigit];
        for(var i=0; i<letters.length; i++){
            temp.push(letters.charAt(i));
            getString(digits.substring(1), temp, result, letterLib);
            temp.pop();
        }
    }
    getString(digits, temp, result, letterLib);
    return result;
};

// -----------------------------


text:
layout: page
title: "MCEN 3030: Computational Methods Statistics"
comments: true
description: "blanks"
keywords: "MCEN,3030,CU,Boulder"
---

#### GRADE AND WORKLOAD STATISTICS

**Percent withdrawn**: 3.39%

**Percent incomplete**: 0.0%

**Average grade** (4.0 scale): 2.82

**Standard deviation in grades** (4.0 scale): 0.23

**Average workload** (raw): 4.23

**Standard deviation in workload** (raw): 0.65

#### COURSE AND INSTRUCTOR RATINGS/INFORMATION

**Average course rating** (6 point scale): 4.34

**Standard deviation in course rating** (6 point scale): 0.84

**Average instructor rating** (6 point scale): 4.79

**Standard deviation in instructor rating** (6 point scale): 0.93

**Instructors**: Francisco Castro, Luke Houlden Engvall, Gustavo Joseph Gonzalez, Daven Ker Henze, Jeffrey Steven Knutsen, Peter Paul Mitrano, Shalom Ruben, Oleg Vasilyev

#### GENERAL CLASS INFORMATION

**Years provided**: Spring 2007, Fall 2007, Fall 2008, Fall 2009, Fall 2010, Fall 2011, Fall 2012, Fall 2013, Spring 2014, Fall 2014, Spring 2015, Fall 2015, Spring 2016, Fall 2016, Spring 2017

**Credits**: 3

**RAP/Honors class?** Neither

**Number of Sections**: 22

**Department**: MCEN

**College**: College of Engineering and Applied Science

**Level**: Upper

**Activity**: LEC - Lecture


text:
title: iOS
category: Devices
order: 1
---

Use ChatApp on most of your Apple devices. Only the latest versions are supported.

To install ChatApp on your device:

1. Open the App Store
2. Search for ChatApp
3. Select **Install**

![](//placehold.it/800x600)


text:
#pragma once
#include <aws/config/ConfigService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace ConfigService
{
namespace Model
{
  enum class ResourceType
  {
    NOT_SET,
    AWS_EC2_CustomerGateway,
    AWS_EC2_EIP,
    AWS_EC2_Host,
    AWS_EC2_Instance,
    AWS_EC2_InternetGateway,
    AWS_EC2_NetworkAcl,
    AWS_EC2_NetworkInterface,
    AWS_EC2_RouteTable,
    AWS_EC2_SecurityGroup,
    AWS_EC2_Subnet,
    AWS_CloudTrail_Trail,
    AWS_EC2_Volume,
    AWS_EC2_VPC,
    AWS_EC2_VPNConnection,
    AWS_EC2_VPNGateway,
    AWS_IAM_Group,
    AWS_IAM_Policy,
    AWS_IAM_Role,
    AWS_IAM_User,
    AWS_ACM_Certificate,
    AWS_RDS_DBInstance,
    AWS_RDS_DBSubnetGroup,
    AWS_RDS_DBSecurityGroup,
    AWS_RDS_DBSnapshot,
    AWS_RDS_EventSubscription,
    AWS_ElasticLoadBalancingV2_LoadBalancer,
    AWS_S3_Bucket,
    AWS_SSM_ManagedInstanceInventory,
    AWS_Redshift_Cluster,
    AWS_Redshift_ClusterSnapshot,
    AWS_Redshift_ClusterParameterGroup,
    AWS_Redshift_ClusterSecurityGroup,
    AWS_Redshift_ClusterSubnetGroup,
    AWS_Redshift_EventSubscription,
    AWS_CloudWatch_Alarm,
    AWS_CloudFormation_Stack,
    AWS_DynamoDB_Table,
    AWS_AutoScaling_AutoScalingGroup,
    AWS_AutoScaling_LaunchConfiguration,
    AWS_AutoScaling_ScalingPolicy,
    AWS_AutoScaling_ScheduledAction,
    AWS_CodeBuild_Project,
    AWS_WAF_RateBasedRule,
    AWS_WAF_Rule,
    AWS_WAF_WebACL,
    AWS_WAFRegional_RateBasedRule,
    AWS_WAFRegional_Rule,
    AWS_WAFRegional_WebACL,
    AWS_CloudFront_Distribution,
    AWS_CloudFront_StreamingDistribution,
    AWS_WAF_RuleGroup,
    AWS_WAFRegional_RuleGroup,
    AWS_Lambda_Function,
    AWS_ElasticBeanstalk_Application,
    AWS_ElasticBeanstalk_ApplicationVersion,
    AWS_ElasticBeanstalk_Environment,
    AWS_ElasticLoadBalancing_LoadBalancer,
    AWS_XRay_EncryptionConfig,
    AWS_SSM_AssociationCompliance,
    AWS_SSM_PatchCompliance,
    AWS_Shield_Protection,
    AWS_ShieldRegional_Protection,
    AWS_Config_ResourceCompliance,
    AWS_CodePipeline_Pipeline
  };

namespace ResourceTypeMapper
{
AWS_CONFIGSERVICE_API ResourceType GetResourceTypeForName(const Aws::String& name);

AWS_CONFIGSERVICE_API Aws::String GetNameForResourceType(ResourceType value);
} // namespace ResourceTypeMapper
} // namespace Model
} // namespace ConfigService
} // namespace Aws


text:
//
//  BmobIMDemoPCH.h
//  BmobIMDemo
//
//  Created by Bmob on 16/1/18.
//  Copyright © 2016年 bmob. All rights reserved.
//

#ifndef BmobIMDemoPCH_h
#define BmobIMDemoPCH_h

#import "UIColor+SubClass.h"

typedef NS_ENUM(int,SystemMessageContact){
    SystemMessageContactAdd = 0,
    SystemMessageContactAgree,
    SystemMessageContactRefuse
};

#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kInviteMessageTable      @"InviteMessage"
#define kFriendTable             @"Friend"
#define kNewMessagesNotifacation @"NewMessagesNotifacation"
#define kNewMessageFromer        @"NewMessageFromer"

#define kDefaultViewBackgroundColor [UIColor colorWithR:241 g:242 b:246]

#endif /* BmobIMDemoPCH_h */


text:
var Exchange = require('./exchange');
exports = module.exports = Exchange;
exports.Exchange = Exchange;
exports.Queue = require('./queue');
exports.PubSub = require('./pubsub');
exports.version = require('./../package.json').version;


text:
class AddPhotoAlbumsAndPhotoAlbumPhotos < ActiveRecord::Migration
  def self.up
    create_table :photo_albums do |t|
      t.string :name
    end

    create_table :photo_album_photos do |t|
      t.integer :photo_album_id
      t.string  :title
      t.text    :caption
      t.string  :photo_album_photo_image_file_name
      t.string  :photo_album_photo_image_content_type
      t.integer :photo_album_photo_image_file_size
    end
  end

  def self.down
    drop_table :photo_album_photos

    drop_table :photo_albums
  end
end


text:
static void help(std::string errorMessage)
{
    std::cout<<"Program init error : "<<errorMessage<<std::endl;
    std::cout<<"\nProgram call procedure : retinaDemo [processing mode] [Optional : media target] [Optional LAST parameter: \"log\" to activate retina log sampling]"<<std::endl;
    std::cout<<"\t[processing mode] :"<<std::endl;
    std::cout<<"\t -image : for still image processing"<<std::endl;
    std::cout<<"\t -video : for video stream processing"<<std::endl;
    std::cout<<"\t[Optional : media target] :"<<std::endl;
    std::cout<<"\t if processing an image or video file, then, specify the path and filename of the target to process"<<std::endl;
    std::cout<<"\t leave empty if processing video stream coming from a connected video device"<<std::endl;
    std::cout<<"\t[Optional : activate retina log sampling] : an optional last parameter can be specified for retina spatial log sampling"<<std::endl;
    std::cout<<"\t set \"log\" without quotes to activate this sampling, output frame size will be divided by 4"<<std::endl;
    std::cout<<"\nExamples:"<<std::endl;
    std::cout<<"\t-Image processing : ./retinaDemo -image lena.jpg"<<std::endl;
    std::cout<<"\t-Image processing with log sampling : ./retinaDemo -image lena.jpg log"<<std::endl;
    std::cout<<"\t-Video processing : ./retinaDemo -video myMovie.mp4"<<std::endl;
    std::cout<<"\t-Live video processing : ./retinaDemo -video"<<std::endl;
    std::cout<<"\nPlease start again with new parameters"<<std::endl;
}

int main(int argc, char* argv[]) {
    // welcome message
    std::cout<<"****************************************************"<<std::endl;
    std::cout<<"* Retina demonstration : demonstrates the use of is a wrapper class of the Gipsa/Listic Labs retina model."<<std::endl;
    std::cout<<"* This retina model allows spatio-temporal image processing (applied on still images, video sequences)."<<std::endl;
    std::cout<<"* As a summary, these are the retina model properties:"<<std::endl;
    std::cout<<"* => It applies a spectral whithening (mid-frequency details enhancement)"<<std::endl;
    std::cout<<"* => high frequency spatio-temporal noise reduction"<<std::endl;
    std::cout<<"* => low frequency luminance to be reduced (luminance range compression)"<<std::endl;
    std::cout<<"* => local logarithmic luminance compression allows details to be enhanced in low light conditions\n"<<std::endl;
    std::cout<<"* for more information, reer to the following papers :"<<std::endl;
    std::cout<<"* Benoit A., Caplier A., Durette B., Herault, J., \"USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING\", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011"<<std::endl;
    std::cout<<"* Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891."<<std::endl;
    std::cout<<"* => reports comments/remarks at benoit.alexandre.vision@gmail.com"<<std::endl;
    std::cout<<"* => more informations and papers at : http://sites.google.com/site/benoitalexandrevision/"<<std::endl;
    std::cout<<"****************************************************"<<std::endl;
    std::cout<<" NOTE : this program generates the default retina parameters file 'RetinaDefaultParameters.xml'"<<std::endl;
    std::cout<<" => you can use this to fine tune parameters and load them if you save to file 'RetinaSpecificParameters.xml'"<<std::endl;

    // basic input arguments checking
    if (argc<2)
    {
        help("bad number of parameter");
        return -1;
    }

    bool useLogSampling = !strcmp(argv[argc-1], "log"); // check if user wants retina log sampling processing

    std::string inputMediaType=argv[1];

    // declare the retina input buffer... that will be fed differently in regard of the input media
    cv::Mat inputFrame;
    cv::VideoCapture videoCapture; // in case a video media is used, its manager is declared here

    //////////////////////////////////////////////////////////////////////////////
    // checking input media type (still image, video file, live video acquisition)
    if (!strcmp(inputMediaType.c_str(), "-image") && argc >= 3)
    {
        std::cout<<"RetinaDemo: processing image "<<argv[2]<<std::endl;
        // image processing case
        inputFrame = cv::imread(std::string(argv[2]), 1); // load image in RGB mode
    }else
        if (!strcmp(inputMediaType.c_str(), "-video"))
        {
            if (argc == 2 || (argc == 3 && useLogSampling)) // attempt to grab images from a video capture device
            {
                videoCapture.open(0);
            }else// attempt to grab images from a video filestream
            {
                std::cout<<"RetinaDemo: processing video stream "<<argv[2]<<std::endl;
                videoCapture.open(argv[2]);
            }

            // grab a first frame to check if everything is ok
            videoCapture>>inputFrame;
        }else
        {
            // bad command parameter
            help("bad command parameter");
            return -1;
        }

    if (inputFrame.empty())
    {
        help("Input media could not be loaded, aborting");
        return -1;
    }

    //////////////////////////////////////////////////////////////////////////////
    // Program start in a try/catch safety context (Retina may throw errors)
    try
    {
        // create a retina instance with default parameters setup, uncomment the initialisation you wanna test
        cv::Ptr<cv::Retina> myRetina;

        // if the last parameter is 'log', then activate log sampling (favour foveal vision and subsamples peripheral vision)
        if (useLogSampling)
                {
                        myRetina = new cv::Retina(inputFrame.size(), true, cv::RETINA_COLOR_BAYER, true, 2.0, 10.0);
                }
        else// -> else allocate "classical" retina :
            myRetina = new cv::Retina(inputFrame.size());

        // save default retina parameters file in order to let you see this and maybe modify it and reload using method "setup"
        myRetina->write("RetinaDefaultParameters.xml");

        // load parameters if file exists
        myRetina->setup("RetinaSpecificParameters.xml");
        myRetina->clearBuffers();

        // declare retina output buffers
        cv::Mat retinaOutput_parvo;
        cv::Mat retinaOutput_magno;

        // processing loop with stop condition
        bool continueProcessing=true; // FIXME : not yet managed during process...
        while(continueProcessing)
        {
            // if using video stream, then, grabbing a new frame, else, input remains the same
            if (videoCapture.isOpened())
                videoCapture>>inputFrame;

            // run retina filter
            myRetina->run(inputFrame);
            // Retrieve and display retina output
            myRetina->getParvo(retinaOutput_parvo);
            myRetina->getMagno(retinaOutput_magno);
            cv::imshow("retina input", inputFrame);
            cv::imshow("Retina Parvo", retinaOutput_parvo);
            cv::imshow("Retina Magno", retinaOutput_magno);
            cv::waitKey(10);
        }
    }catch(cv::Exception e)
    {
        std::cerr<<"Error using Retina : "<<e.what()<<std::endl;
    }

    // Program end message
    std::cout<<"Retina demo end"<<std::endl;

    return 0;
}


text:
// This file is automatically generated.

package adila.db;

/*
 * Lenovo A708t
 *
 * DEVICE: A708t
 * MODEL: Lenovo A708t
 */
final class a708t_lenovo20a708t {
    public static final String DATA = "Lenovo|A708t|";
}


text:
Download the example [or clone the whole project](https://github.com/palmerhq/backpack.git):

```bash
curl https://codeload.github.com/palmerhq/backpack/tar.gz/master | tar -xz --strip=2 backpack-master/examples/basic
cd basic
```

Install it and run:

```bash
npm install
npm run dev
```

## Idea behind the example

This is a basic example of how to use Backpack in a project. It is a simple Express.js server. It demonstrates how easy it is to use
Backpack in a project. It also shows off some of the default syntax features provided by Backpack such as async/await and object rest spread
as well as a Webpack environment flag (`__DEV__`).


text:
#ifndef BOOST_MULTI_INDEX_INDEXED_BY_HPP
#define BOOST_MULTI_INDEX_INDEXED_BY_HPP

#if defined(_MSC_VER)
#pragma once
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>

/* An alias to mpl::vector used to hide MPL from the user.
 * indexed_by contains the index specifiers for instantiation
 * of a multi_index_container.
 */

/* This user_definable macro limits the number of elements of an index list;
 * useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
 * has problems coping with very long symbol names.)
 */

#if !defined(BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE)
#define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
#endif

#if BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
#define BOOST_MULTI_INDEX_INDEXED_BY_SIZE \
  BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE
#else
#define BOOST_MULTI_INDEX_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
#endif

#define BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM(z,n,var) \
  typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::na)

namespace boost{

namespace multi_index{

template<
  BOOST_PP_ENUM(
    BOOST_MULTI_INDEX_INDEXED_BY_SIZE,
    BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM,T)
>
struct indexed_by:
  mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_INDEXED_BY_SIZE,T)>
{
};

} /* namespace multi_index */

} /* namespace boost */

#undef BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM
#undef BOOST_MULTI_INDEX_INDEXED_BY_SIZE

#endif


text:
package catan.common.game.board.hexarray;

import catan.common.game.board.paths.Path;
import catan.common.game.board.tiles.Tile;
import catan.common.game.board.towns.Town;

import java.util.Set;

/**
 * Created by Greg on 8/8/2014.
 * Map system for storing board data.
 */
public class HexagonalArray {

    private final TwoDimensionalArray<Tile> spaces;
    private final TwoDimensionalArray<Path> edges;
    private final TwoDimensionalArray<Town> vertices;

    public HexagonalArray(int x, int y) {
        spaces = new TwoDimensionalArray<>(x, y); // Number of spaces in a hex map is x * y
        edges = new TwoDimensionalArray<>(3 * (x + 1), y + 1); // number of edges in a hex map is less than 4x * y+1
        vertices = new TwoDimensionalArray<>(2 * (x + 1), y + 1); // number of vertices in a hex map is less than 2(x+1) * y+1
    }

    public Set<Coordinate> getSpaceCoordinates() {
        return spaces.coordinates();
    }

    public Set<Coordinate> getEdgeCoordinates() {
        return edges.coordinates();
    }

    public Set<Coordinate> getVertexCoordinates() {
        return vertices.coordinates();
    }

    public void setTile(Coordinate space, Tile tile) {
        if (tile == null) return;
        tile.setPosition(space);
        spaces.set(space, tile);
    }

    public void setPath(Coordinate edge, Path path) {
        if (path == null) return;
        path.setPosition(edge);
        edges.set(edge, path);
    }

    public void setTown(Coordinate vertex, Town town) {
        if (town == null) return;
        town.setPosition(vertex);
        vertices.set(vertex, town);
    }

    public Tile getTile(Coordinate space) {
        return spaces.get(space);
    }

    public Path getPath(Coordinate edge) {
        return edges.get(edge);
    }

    public Town getTown(Coordinate vertex) {
        return vertices.get(vertex);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if ((o == null) || (getClass() != o.getClass())) return false;

        HexagonalArray other = (HexagonalArray) o;

        if (!spaces.equals(other.spaces)) return false;
        if (!edges.equals(other.edges)) return false;
        return vertices.equals(other.vertices);

    }

    @Override
    public int hashCode() {
        int result = spaces.hashCode();
        result = 31 * result + edges.hashCode();
        result = 31 * result + vertices.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "HexagonalArray{" +
                "spaces=" + spaces +
                ", edges=" + edges +
                ", vertices=" + vertices +
                '}';
    }
}


text:
TeapotioBaseCacheBundle
====================

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/7a5fe882-28a1-4601-a5a6-5faebf901498/big.png)](https://insight.sensiolabs.com/projects/7a5fe882-28a1-4601-a5a6-5faebf901498)

Forum Bundle for Symfony2 that provides a simple Cache system.


text:
package db

import (
	"database/sql"
	"errors"
	"os"
	"sync"
)

// DefaultConnection connects to a Postgres database using the DATABASE_URL
// environment variable.
var DefaultConnection = new(DatabaseURLConnector)

// DatabaseURLConnector connects to the database using the DATABASE_URL
// environment variable.
type DatabaseURLConnector struct {
	mu sync.Mutex
}

// Connect to the database using the DATABASE_URL environment variable with the
// given number of database connections, and store the result in conn.
func (dc *DatabaseURLConnector) Connect(dbConns int) (*sql.DB, error) {
	dc.mu.Lock()
	defer dc.mu.Unlock()
	url := os.Getenv("DATABASE_URL")
	if url == "" {
		return nil, errors.New("setup: No value provided for DATABASE_URL, cannot connect")
	}
	conn, err := sql.Open("postgres", url)
	if err != nil {
		return nil, err
	}
	if dbConns != 0 {
		conn.SetMaxOpenConns(dbConns)
	}
	if dbConns > 100 {
		conn.SetMaxIdleConns(dbConns - 20)
	} else if dbConns > 50 {
		conn.SetMaxIdleConns(dbConns - 10)
	} else if dbConns > 10 {
		conn.SetMaxIdleConns(dbConns - 3)
	} else if dbConns > 5 {
		conn.SetMaxIdleConns(dbConns - 2)
	}
	return conn, nil
}

var mu sync.Mutex

// Conn is a shared connection used by all database queries.
var Conn *sql.DB

// Connector establishes a connection to a Postgres database, with the given
// number of connections, and stores the connection in conn.
type Connector interface {
	Connect(dbConns int) (*sql.DB, error)
}

// Connected returns true if a connection exists to the database.
func Connected() bool {
	mu.Lock()
	defer mu.Unlock()
	return Conn != nil
}


text:
import React from 'react';
import { Viewport } from './viewport';

// https://stackoverflow.com/a/24600597/128816
const IS_MOBILE = /Mobi|Android/i.test(navigator.userAgent);

export function useWindowViewport() {
  const [viewport, setViewport] = React.useState(getWindowViewport());
  React.useEffect(() => {
    function handleWindowResize() {
      const newViewport = getWindowViewport();
      if (didViewportChange(viewport, newViewport)) {
        setViewport(newViewport);
      }
    }
    window.addEventListener('resize', handleWindowResize);
    return () => window.removeEventListener('resize', handleWindowResize);
  });
  return viewport;
}

function getWindowViewport() {
  return {
    width: window.innerWidth,
    height: window.innerHeight,
  };
}

function didViewportChange(oldViewport: Viewport, newViewport: Viewport) {
  if (newViewport.width !== oldViewport.width) {
    return true;
  }
  if (newViewport.height !== oldViewport.height && !IS_MOBILE) {
    return true;
  }
  // Ignore small height changes that occur on scroll in landscape mode.
  // Eg. Safari on iOS minimizes the address bar and hides the bottom menu
  // after initial scroll
  const heightDiff = Math.abs(newViewport.height - oldViewport.height);
  return heightDiff / newViewport.height >= 0.2;
}


text:
package it.hysen.springmvc.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import it.hysen.springmvc.model.User;
import it.hysen.springmvc.service.UserService;

@Controller
@RequestMapping(value = "/user")
public class UserController extends AbstractController {

	@Autowired
	private UserService service;

	@RequestMapping(value = "/login", method = RequestMethod.GET)
	public String authenticate() {
		return "partials/user/login";
	}

	@RequestMapping(value = "/authenticate", method = RequestMethod.POST)
	public ResponseEntity<User> authenticate(HttpServletRequest request, @RequestBody User model) {
		User foundUser = this.service.authenticate(model);
		if (foundUser != null) {
			HttpSession session = request.getSession();
			session.setAttribute("user", model);
			return new ResponseEntity<>(foundUser, HttpStatus.OK);
		}
		return new ResponseEntity<>(HttpStatus.NOT_FOUND);
	}

	@RequestMapping(value = "/index", method = RequestMethod.GET)
	public String getHome() {
		return "partials/user/index";
	}

	@RequestMapping(value = "/authenticated", method = RequestMethod.POST)
	public ResponseEntity<User> getUserAuthenticated(HttpServletRequest request) {
		HttpSession session = request.getSession(false);
		if (session != null) {
			if (session.getAttribute("user") != null) {
				return new ResponseEntity<>((User) session.getAttribute("user"), HttpStatus.OK);
			}
		}
		return new ResponseEntity<>(HttpStatus.NOT_FOUND);
	}

	@RequestMapping(value = "/logout", method = RequestMethod.POST)
	public ResponseEntity<User> logout(HttpServletRequest request) {
		HttpSession session = request.getSession(false);
		if (session != null) {
			if (session.getAttribute("user") != null) {
				session.setAttribute("user", null);
				return new ResponseEntity<>(HttpStatus.OK);
			}
		}
		return new ResponseEntity<>(HttpStatus.NOT_FOUND);
	}

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Threading;
using System.Threading.Tasks;
using Azure.Messaging.ServiceBus.Perf;
using Azure.Messaging.ServiceBus.Tests;
using Azure.Test.Perf;

namespace Azure.Messaging.ServiceBus.Perf.Scenarios
{
    public sealed class SendMessageBatch : ServiceBusPerfTestBase
    {
        private readonly SizeCountOptions _options;

        public SendMessageBatch(SizeCountOptions options) : base(options)
        {
            _options = options;
        }

        public override async Task RunAsync(CancellationToken cancellationToken)
        {
            var batch = await Sender.CreateMessageBatchAsync(cancellationToken);
            for (int i = 0; i < _options.Count; i++)
            {
                batch.TryAddMessage(new ServiceBusMessage(MessageBody));
            }
            await Sender.SendMessagesAsync(batch, cancellationToken);
        }
    }
}


text:
package com.kotcrab.vis.editor.util.gdx;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Value;
import com.badlogic.gdx.scenes.scene2d.ui.Widget;

/**
 * Allows to use LibGDX {@link Value} with lambdas for scene2d.ui widgets
 * @author Kotcrab
 * @see VisValue
 */
public class VisWidgetValue extends Value {
	protected WidgetValueGetter getter;

	public VisWidgetValue (WidgetValueGetter getter) {
		this.getter = getter;
	}

	@Override
	public float get (Actor context) {
		return getter.get((Widget) context);
	}

	public interface WidgetValueGetter {
		float get (Widget context);
	}
}


text:
package uk.theretiredprogrammer.lindos.simpleexpressionlanguage.languageelements;

import java.util.Map;
import uk.theretiredprogrammer.lindos.expressionparserandevaluate.parsetree.ParseTree;
import uk.theretiredprogrammer.lindos.expressionparserandevaluate.parsetree.ParseTreeStringResult;
import uk.theretiredprogrammer.lindos.expressionparserandevaluate.tokens.FunctionToken;

/**
 * The Uppercase Function "uppercase(string)". Translates the given string into
 * an uppercase version of the string.
 *
 * @author Richard Linsdale (richard at theretiredprogrammer.uk)
 */
public class UppercaseToken extends FunctionToken {

    /**
     * Constructor.
     *
     * @param index the token's key
     */
    public UppercaseToken(int index) {
        super(index);
    }

    @Override
    public String getTokenString() {
        return "uppercase";
    }

    @Override
    public ParseTree getParseTree(ParseTree lower, ParseTree upper) {
        extractParameters("uppercase", 1, lower, upper);
        return new UppercaseFunction();
    }

    private class UppercaseFunction extends ParseTreeStringResult {

        @Override
        public String getResult(Map<String, String> parameters) {
            return ParseTreeStringResult.evaluate(p[1], parameters).toUpperCase();
        }
    }
}


text:
<?php
namespace Chamilo\Application\Weblcms\Menu;

use Chamilo\Application\Weblcms\Manager;
use Chamilo\Application\Weblcms\Storage\DataClass\ContentObjectPublicationCategory;
use Chamilo\Application\Weblcms\Storage\DataManager;
use Chamilo\Libraries\Architecture\Application\Application;
use Chamilo\Libraries\Architecture\ClassnameUtilities;
use Chamilo\Libraries\File\Redirect;
use Chamilo\Libraries\Format\Menu\TreeMenu\GenericTree;
use Chamilo\Libraries\Platform\Session\Request;
use Chamilo\Libraries\Translation\Translation;
use Chamilo\Libraries\Storage\Parameters\DataClassRetrievesParameters;
use Chamilo\Libraries\Storage\Query\Condition\AndCondition;
use Chamilo\Libraries\Storage\Query\Condition\EqualityCondition;
use Chamilo\Libraries\Storage\Query\OrderBy;
use Chamilo\Libraries\Storage\Query\Variable\PropertyConditionVariable;
use Chamilo\Libraries\Storage\Query\Variable\StaticConditionVariable;
use Chamilo\Libraries\Storage\Parameters\DataClassCountParameters;

/**
 *
 * @package group.lib
 */

/**
 * This class provides a navigation menu to allow a user to browse through categories of courses.
 *
 * @author Pieterjan Broekaert
 */
class PublicationCategoriesTree extends GenericTree
{
    const TREE_NAME = __CLASS__;
    const ROOT_NODE_CLASS = 'category';
    const CATEGORY_CLASS = 'category';
    const NEW_CATEGORY_CLASS = 'new_category';
    const INVISIBLE_CATEGORY_CLASS = 'invisible_category';

    private $browser;

    /**
     * Creates a new category navigation menu.
     *
     * @param $owner int The ID of the owner of the categories to provide in this menu.
     * @param $current_category int The ID of the current category in the menu.
     * @param $url_format string The format to use for the URL of a category. Passed to sprintf(). Defaults to the
     *        string "?category=%s".
     * @param $extra_items array An array of extra tree items, added to the root.
     */
    public function __construct($browser)
    {
        $this->browser = $browser;
        parent::__construct();
    }

    /**
     * Returns the url of a node
     *
     * @param $node_id int
     * @return string
     */
    public function get_node_url($node_id)
    {
        $url_param[Manager::PARAM_CATEGORY] = $node_id;
        return $this->browser->get_url($url_param);
    }

    public function get_current_node_id()
    {
        return intval(Request::get(Manager::PARAM_CATEGORY));
    }

    public function get_node($node_id)
    {
        return DataManager::retrieve_by_id(ContentObjectPublicationCategory::class_name(), $node_id);
    }

    public function get_node_children($parent_node_id)
    {
        $conditions[] = new EqualityCondition(
            new PropertyConditionVariable(
                ContentObjectPublicationCategory::class_name(),
                ContentObjectPublicationCategory::PROPERTY_PARENT),
            new StaticConditionVariable($parent_node_id));
        $conditions[] = new EqualityCondition(
            new PropertyConditionVariable(
                ContentObjectPublicationCategory::class_name(),
                ContentObjectPublicationCategory::PROPERTY_COURSE),
            new StaticConditionVariable($this->browser->get_parent()->get_course_id()));
        $conditions[] = new EqualityCondition(
            new PropertyConditionVariable(
                ContentObjectPublicationCategory::class_name(),
                ContentObjectPublicationCategory::PROPERTY_TOOL),
            new StaticConditionVariable($this->browser->get_parent()->get_tool_id()));
        if (! $this->is_invisible_allowed())
        {
            $conditions[] = new EqualityCondition(
                new PropertyConditionVariable(
                    ContentObjectPublicationCategory::class_name(),
                    ContentObjectPublicationCategory::PROPERTY_VISIBLE),
                new StaticConditionVariable(true));
        }
        $condition = new AndCondition($conditions);

        $children = DataManager::retrieves(
            ContentObjectPublicationCategory::class_name(),
            new DataClassRetrievesParameters(
                $condition,
                null,
                null,
                new OrderBy(
                    new PropertyConditionVariable(
                        ContentObjectPublicationCategory::class_name(),
                        ContentObjectPublicationCategory::PROPERTY_DISPLAY_ORDER))));

        return $children;
    }

    public function node_has_children($node_id)
    {
        $conditions[] = new EqualityCondition(
            new PropertyConditionVariable(
                ContentObjectPublicationCategory::class_name(),
                ContentObjectPublicationCategory::PROPERTY_PARENT),
            new StaticConditionVariable($node_id));
        $conditions[] = new EqualityCondition(
            new PropertyConditionVariable(
                ContentObjectPublicationCategory::class_name(),
                ContentObjectPublicationCategory::PROPERTY_COURSE),
            new StaticConditionVariable($this->browser->get_parent()->get_course_id()));
        $conditions[] = new EqualityCondition(
            new PropertyConditionVariable(
                ContentObjectPublicationCategory::class_name(),
                ContentObjectPublicationCategory::PROPERTY_TOOL),
            new StaticConditionVariable($this->browser->get_parent()->get_tool_id()));
        if (! $this->is_invisible_allowed())
        {
            $conditions[] = new EqualityCondition(
                new PropertyConditionVariable(
                    ContentObjectPublicationCategory::class_name(),
                    ContentObjectPublicationCategory::PROPERTY_VISIBLE),
                new StaticConditionVariable(true));
        }

        $condition = new AndCondition($conditions);

        return DataManager::count(
            ContentObjectPublicationCategory::class_name(),
            new DataClassCountParameters($condition)) > 0;
    }

    /**
     * Returns true if the current user is allowed to view invisible categories.
     */
    public function is_invisible_allowed()
    {
        return $this->browser->is_allowed('view_invisible_category_right');
    }

    public function get_search_url()
    {
        $searchUrl = new Redirect(
            array(
                Application::PARAM_CONTEXT => \Chamilo\Application\Weblcms\Ajax\Manager::package(),
                \Chamilo\Application\Weblcms\Ajax\Manager::PARAM_ACTION => \Chamilo\Application\Weblcms\Ajax\Manager::ACTION_XML_GROUP_MENU_FEED));

        return $searchUrl->getUrl();
    }

    public function get_url_format()
    {
        $course_id = $this->browser->get_parent()->get_course_id();
        $tool = Request::get(Manager::PARAM_TOOL);

        $url_format = '?application=weblcms&course=' . $course_id . '&go=course_viewer&tool=' . $tool;

        $tool_action = Request::get(Manager::PARAM_TOOL_ACTION);
        if (! is_null($tool_action))
        {
            $url_format .= '&tool_action=' . $tool_action;
        }
        $browser_type = Request::get(\Chamilo\Application\Weblcms\Tool\Manager::PARAM_BROWSER_TYPE);
        if (! is_null($browser_type))
        {
            $url_format .= '&browser=' . $browser_type;
        }

        $url_format .= '&publication_category=%d';

        return $url_format;
    }

    public function get_root_node_class()
    {
        return self::ROOT_NODE_CLASS;
    }

    public function get_node_class($node)
    {
        if ($this->get_node($node->get_id())->get_visibility())
        {
            if ($this->browser->tool_category_has_new_publications($node->get_id()))
            {
                return self::NEW_CATEGORY_CLASS;
            }
            else
            {
                return self::CATEGORY_CLASS;
            }
        }
        else
        {
            return self::INVISIBLE_CATEGORY_CLASS;
        }
    }

    public function get_root_node_title()
    {
        $parent = $this->browser->get_parent();
        $course_title = $parent->get_course()->get_title();
        $context = ClassnameUtilities::getInstance()->getNamespaceFromObject($parent);
        $root_title = Translation::get('TypeName', null, $context) . ' ' . $course_title;
        return $root_title;
    }

    public function get_node_title($node)
    {
        return $node->get_name();
    }

    public function get_node_safe_title($node)
    {
        return $this->get_node_title($node);
    }

    public function get_node_id($node)
    {
        return $node->get_id();
    }

    public function get_node_parent($node)
    {
        return $node->get_parent();
    }
}


text:
namespace web {
class BrowserState;
class WebState;
}

namespace dom_distiller {

class DistillerPageMediaBlocker;

// Loads URLs and injects JavaScript into a page, extracting the distilled page
// content.
class DistillerPageIOS : public DistillerPage, public web::WebStateObserver {
 public:
  explicit DistillerPageIOS(web::BrowserState* browser_state);
  ~DistillerPageIOS() override;

 protected:
  bool StringifyOutput() override;
  void DistillPageImpl(const GURL& url, const std::string& script) override;

  // Sets the WebState that will be used for the distillation. Do not call
  // between |DistillPageImpl| and |OnDistillationDone|.
  virtual void AttachWebState(std::unique_ptr<web::WebState> web_state);

  // Release the WebState used for distillation. Do not call between
  // |DistillPageImpl| and |OnDistillationDone|.
  virtual std::unique_ptr<web::WebState> DetachWebState();

  // Return the current WebState.
  virtual web::WebState* CurrentWebState();

  // Called by |web_state_observer_| once the page has finished loading.
  virtual void OnLoadURLDone(
      web::PageLoadCompletionStatus load_completion_status);

 private:
  // Called once the |script_| has been evaluated on the page.
  void HandleJavaScriptResult(id result);

  // web::WebStateObserver implementation.
  void PageLoaded(
      web::WebState* web_state,
      web::PageLoadCompletionStatus load_completion_status) override;
  void DidStartLoading(web::WebState* web_state) override;
  void DidStopLoading(web::WebState* web_state) override;
  void WebStateDestroyed(web::WebState* web_state) override;

  GURL url_;
  std::string script_;
  web::BrowserState* browser_state_;
  std::unique_ptr<web::WebState> web_state_;
  std::unique_ptr<DistillerPageMediaBlocker> media_blocker_;

  // Used to store whether the owned WebState is currently loading or not.
  // TODO(crbug.com/782159): this is a work-around as WebState::IsLoading()
  // is/was not returning the expected value when an SLL interstitial is
  // blocked. Remove this and use WebState::IsLoading() when WebState has
  // been fixed.
  bool loading_ = false;

  base::WeakPtrFactory<DistillerPageIOS> weak_ptr_factory_;

  DISALLOW_COPY_AND_ASSIGN(DistillerPageIOS);
};

}  // namespace dom_distiller

#endif  // COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_


text:
namespace TemplatesNS1 {
template <class T> const char *basicFunctionTemplate(T) {
  return "TemplatesNS1::basicFunctionTemplate";
}

template <class> struct BasicClassTemplate {
  const char *basicMember() { return "TemplatesNS1::BasicClassTemplate::basicMember"; }
};

using BasicClassTemplateChar = BasicClassTemplate<char>;
} // namespace TemplatesNS1

namespace TemplatesNS1 {
namespace TemplatesNS2 {
template <class T> const char *forwardDeclaredFunctionTemplate(T);
template <class> struct ForwardDeclaredClassTemplate;

template <class T> const char *forwardDeclaredFunctionTemplateOutOfLine(T);
template <class> struct ForwardDeclaredClassTemplateOutOfLine;
} // namespace TemplatesNS2
} // namespace TemplatesNS1

namespace TemplatesNS1 {
template <class T>
const char *TemplatesNS2::forwardDeclaredFunctionTemplate(T) {
  return "TemplatesNS1::TemplatesNS2::forwardDeclaredFunctionTemplate";
}

template <class> struct TemplatesNS2::ForwardDeclaredClassTemplate {
  const char *basicMember() {
    return "TemplatesNS1::TemplatesNS2::ForwardDeclaredClassTemplate::basicMember";
  }
};

using ForwardDeclaredClassTemplateChar =
    TemplatesNS2::ForwardDeclaredClassTemplate<char>;
} // namespace TemplatesNS1

template <class T>
const char *
TemplatesNS1::TemplatesNS2::forwardDeclaredFunctionTemplateOutOfLine(T) {
  return "TemplatesNS1::TemplatesNS2::forwardDeclaredFunctionTemplateOutOfLine";
}

template <class>
struct TemplatesNS1::TemplatesNS2::ForwardDeclaredClassTemplateOutOfLine {
  const char *basicMember() {
    return "TemplatesNS1::TemplatesNS2::ForwardDeclaredClassTemplateOutOfLine::"
           "basicMember";
  }
};

using ForwardDeclaredClassTemplateOutOfLineChar =
    TemplatesNS1::TemplatesNS2::ForwardDeclaredClassTemplateOutOfLine<char>;

namespace TemplatesNS1 {
namespace TemplatesNS3 {
template <class> struct BasicClassTemplate {};
} // namespace TemplatesNS3
} // namespace TemplatesNS1

namespace TemplatesNS1 {
namespace TemplatesNS2 {
using BasicClassTemplateChar = TemplatesNS3::BasicClassTemplate<char>;
inline const char *takesClassTemplateFromSibling(BasicClassTemplateChar) {
  return "TemplatesNS1::TemplatesNS2::takesClassTemplateFromSibling";
}
} // namespace TemplatesNS2
} // namespace TemplatesNS1

namespace TemplatesNS4 {
template <class> struct HasSpecialization {};

template <> struct HasSpecialization<int> {};
} // namespace TemplatesNS4

namespace TemplatesNS1 {
using UseTemplate = TemplatesNS4::HasSpecialization<char>;
using UseSpecialized = TemplatesNS4::HasSpecialization<int>;
} // namespace TemplatesNS1

namespace TemplatesNS1 {
template <class T> const char *basicFunctionTemplateDefinedInDefs(T);
template <class> struct BasicClassTemplateDefinedInDefs;
} // namespace TemplatesNS1

#endif // TEST_INTEROP_CXX_NAMESPACE_INPUTS_TEMPLATES_H