text:
class String
  def to_alternating_case
    self.chars.map{ |ch| ch == ch.upcase ? ch.downcase : ch.upcase }.join
  end
end

redpajama_set_name: RedPajamaGithub


text:
{% extends "flowr/base.html" %}

{% block body %}
  {% include "flowr/header.html" %}
  <div id="cy" style="height:500px; width:500px">
  </div>
{% endblock body %}

{% block body_post %}
<script type="text/javascript">
  {% include "flowr/graph.js" %}
</script>
{% endblock body_post %}


text:
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-controls="navbar"> Toggle navigation    </button>

SIGN IN

            <hgroup class="landing-header">

Contact Us

            </hgroup>

                            <form>

                                    <input type="text" class="form-control" placeholder="Name">

                                    <input type="email" class="form-control" placeholder="Email Address">

                                    <input type="text" class="form-control" placeholder="Phone Number">

                                    <textarea class="form-control" placeholder="Enter your message" rows="3"></textarea>

                                    <input type="file" class="form-control" />

                                    <button type="submit" class="btn btn-default btn-primary">Send</button>

                            </form>


text:
using namespace std;
template<typename T> std::string format(const T& value);

int main(int argc, char* argv[])
{
    using namespace std::chrono;
    using clock=steady_clock;
    int thread_count = 10;

    if(argc > 1)
        thread_count = atoi(argv[1]);
    int howmany = 1000000;

    g2LogWorker g2log(argv[0], "logs");
    g2::initializeLogging(&g2log);

    std::atomic<int > msg_counter {0};
    vector<thread> threads;
    auto start = clock::now();
    for (int t = 0; t < thread_count; ++t)
    {
        threads.push_back(std::thread([&]()
        {
            while (true)
            {
                int counter = ++msg_counter;
                if (counter > howmany) break;
                LOG(INFO) << "g2log message #" << counter << ": This is some text for your pleasure";
            }
        }));
    }

    for(auto &t:threads)
    {
        t.join();
    };

    duration<float> delta = clock::now() - start;
    float deltaf = delta.count();
    auto rate = howmany/deltaf;

    cout << "Total: " << howmany << std::endl;
    cout << "Threads: " << thread_count << std::endl;
    std::cout << "Delta = " << deltaf << " seconds" << std::endl;
    std::cout << "Rate = " << rate << "/sec" << std::endl;
}


text:
<?php
namespace Avatar4eg\Geotags;

use Flarum\Core\Post;
use Flarum\Core\User;
use Flarum\Database\AbstractModel;

/**
 * @property int $id
 * @property int $user_id
 * @property int $post_id
 * @property string $title
 * @property string $country
 * @property float $lat
 * @property float $lng
 * @property \DateTime created_at
 */
class Geotag extends AbstractModel
{
    protected $table = 'avatar4eg_geotags';

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function post()
    {
        return $this->belongsTo(Post::class);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}


text:
#import "NSMutableArray.h"

@interface NSMutableArray (MSArrayUtilities)
- (void)MSRemoveOneObjectByPointerComparison:(id)arg1;
- (void)MSRemoveOneObject:(id)arg1;
@end


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="generator" content="pandoc">
  <title>Machine Learning Introduction</title>
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <link rel="stylesheet" href="css/reveal.css"/>

  <link rel="stylesheet" href="css/theme/moon.css" id="theme">

Machine Learning Introduction

Hack University Machine Learning Introduction

Slides

Syllabus

Setting Up Your Environment

Data Science Toolbox

1 Day

6 Lessons

25 min talk

5 min break

25 min project

5 minute break

Repeat

Today

What is Machine Learning

Install your Environment

Machine Learning Applications

Download and Plot Portland Crime

Linear Regression

Temperature Conversion

Machine Learning

Artificial Intelligence?

Modeling (Regression)?

Prediction?

Statistics?

Data Science?

You signed up for this, what do you think?

Machine learning is like automated Data Science

But you can't automate it all

Machine's need a lot of help

In future sessions we'll learn about generative models

For now, Data Scientists still have jobs

It takes human understanding to build a system
(Otherwise you wouldn't be here)
And it requires a lot of effort to get data ready for machine learning

So maybe Machine Learning is:

What a software developer would do if she were given a data science problem.

Machine Learning expert:

Someone that knows more statistics than a developer and more computer science than a statistician"

A Data Scientist is

"A statistician in Silicon Valley"

You're going to learn statistics if you are a python developer

You're going to learn python and data if you already know stats

You're going to to know a lot about everything when we're done

What do you want to learn?

Tell me about your plans, career, ideas

Data Science

Using data to create representations or abstractions of data.

Prediction

Sometimes representations are useful for predicting

This is what most experts think of when they think of Machine Learning...

AI

Machines interacting with the world based on predictions

Agents trying to

achieve a goal

optimize something

Deep Blue

Chess

Watson

Jeopardy

Deep Mind

playing Breakout

playing Galaga

playing Go

Automated prediction

Predicting the future is what humans spend their lives learning how to do. It's why children perform "experiments" by pushing their food of the table and onto the floor. They are testing their "hypothesis" that a caregiver will put it back on the table or clean up the mess. They are also testing their hypothesis that the food won't just disappear, or transform into something different (like icecream), or become unedible.


text:
<?xml version="1.0" encoding="utf-8"?>
<Categories>
  <Category>Category1</Category>
  <Category>Category2</Category>
  <Category>Category3</Category>
  <Category>Category4</Category>
  <Category>Category5</Category>
</Categories>


text:
<<<<<<< HEAD
<?php

/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
	/**
	 * @ignore
	 */
	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}

/**
 * PHPExcel_Calculation_Logical
 *
 * @category	PHPExcel
 * @package		PHPExcel_Calculation
 * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 */
class PHPExcel_Calculation_Logical {

	/**
	 * TRUE
	 *
	 * Returns the boolean TRUE.
	 *
	 * Excel Function:
	 *		=TRUE()
	 *
	 * @access	public
	 * @category Logical Functions
	 * @return	boolean		True
	 */
	public static function TRUE() {
		return TRUE;
	}	//	function TRUE()

	/**
	 * FALSE
	 *
	 * Returns the boolean FALSE.
	 *
	 * Excel Function:
	 *		=FALSE()
	 *
	 * @access	public
	 * @category Logical Functions
	 * @return	boolean		False
	 */
	public static function FALSE() {
		return FALSE;
	}	//	function FALSE()

	/**
	 * LOGICAL_AND
	 *
	 * Returns boolean TRUE if all its arguments are TRUE; returns FALSE if one or more argument is FALSE.
	 *
	 * Excel Function:
	 *		=AND(logical1[,logical2[, ...]])
	 *
	 *		The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
	 *			or references that contain logical values.
	 *
	 *		Boolean arguments are treated as True or False as appropriate
	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed		$arg,...		Data values
	 * @return	boolean		The logical AND of the arguments.
	 */
	public static function LOGICAL_AND() {
		// Return value
		$returnValue = TRUE;

		// Loop through the arguments
		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
		$argCount = -1;
		foreach ($aArgs as $argCount => $arg) {
			// Is it a boolean value?
			if (is_bool($arg)) {
				$returnValue = $returnValue && $arg;
			} elseif ((is_numeric($arg)) && (!is_string($arg))) {
				$returnValue = $returnValue && ($arg != 0);
			} elseif (is_string($arg)) {
				$arg = strtoupper($arg);
				if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
					$arg = TRUE;
				} elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
					$arg = FALSE;
				} else {
					return PHPExcel_Calculation_Functions::VALUE();
				}
				$returnValue = $returnValue && ($arg != 0);
			}
		}

		// Return
		if ($argCount < 0) {
			return PHPExcel_Calculation_Functions::VALUE();
		}
		return $returnValue;
	}	//	function LOGICAL_AND()

	/**
	 * LOGICAL_OR
	 *
	 * Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
	 *
	 * Excel Function:
	 *		=OR(logical1[,logical2[, ...]])
	 *
	 *		The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
	 *			or references that contain logical values.
	 *
	 *		Boolean arguments are treated as True or False as appropriate
	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed		$arg,...		Data values
	 * @return	boolean		The logical OR of the arguments.
	 */
	public static function LOGICAL_OR() {
		// Return value
		$returnValue = FALSE;

		// Loop through the arguments
		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
		$argCount = -1;
		foreach ($aArgs as $argCount => $arg) {
			// Is it a boolean value?
			if (is_bool($arg)) {
				$returnValue = $returnValue || $arg;
			} elseif ((is_numeric($arg)) && (!is_string($arg))) {
				$returnValue = $returnValue || ($arg != 0);
			} elseif (is_string($arg)) {
				$arg = strtoupper($arg);
				if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
					$arg = TRUE;
				} elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
					$arg = FALSE;
				} else {
					return PHPExcel_Calculation_Functions::VALUE();
				}
				$returnValue = $returnValue || ($arg != 0);
			}
		}

		// Return
		if ($argCount < 0) {
			return PHPExcel_Calculation_Functions::VALUE();
		}
		return $returnValue;
	}	//	function LOGICAL_OR()

	/**
	 * NOT
	 *
	 * Returns the boolean inverse of the argument.
	 *
	 * Excel Function:
	 *		=NOT(logical)
	 *
	 *		The argument must evaluate to a logical value such as TRUE or FALSE
	 *
	 *		Boolean arguments are treated as True or False as appropriate
	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed		$logical	A value or expression that can be evaluated to TRUE or FALSE
	 * @return	boolean		The boolean inverse of the argument.
	 */
	public static function NOT($logical=FALSE) {
		$logical = PHPExcel_Calculation_Functions::flattenSingleValue($logical);
		if (is_string($logical)) {
			$logical = strtoupper($logical);
			if (($logical == 'TRUE') || ($logical == PHPExcel_Calculation::getTRUE())) {
				return FALSE;
			} elseif (($logical == 'FALSE') || ($logical == PHPExcel_Calculation::getFALSE())) {
				return TRUE;
			} else {
				return PHPExcel_Calculation_Functions::VALUE();
			}
		}

		return !$logical;
	}	//	function NOT()

	/**
	 * STATEMENT_IF
	 *
	 * Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.
	 *
	 * Excel Function:
	 *		=IF(condition[,returnIfTrue[,returnIfFalse]])
	 *
	 *		Condition is any value or expression that can be evaluated to TRUE or FALSE.
	 *			For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100,
	 *			the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.
	 *			This argument can use any comparison calculation operator.
	 *		ReturnIfTrue is the value that is returned if condition evaluates to TRUE.
	 *			For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE,
	 *			then the IF function returns the text "Within budget"
	 *			If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use
	 *			the logical value TRUE for this argument.
	 *			ReturnIfTrue can be another formula.
	 *		ReturnIfFalse is the value that is returned if condition evaluates to FALSE.
	 *			For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE,
	 *			then the IF function returns the text "Over budget".
	 *			If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned.
	 *			If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned.
	 *			ReturnIfFalse can be another formula.
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed	$condition		Condition to evaluate
	 * @param	mixed	$returnIfTrue	Value to return when condition is true
	 * @param	mixed	$returnIfFalse	Optional value to return when condition is false
	 * @return	mixed	The value of returnIfTrue or returnIfFalse determined by condition
	 */
	public static function STATEMENT_IF($condition = TRUE, $returnIfTrue = 0, $returnIfFalse = FALSE) {
		$condition		= (is_null($condition))		? TRUE :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($condition);
		$returnIfTrue	= (is_null($returnIfTrue))	? 0 :		PHPExcel_Calculation_Functions::flattenSingleValue($returnIfTrue);
		$returnIfFalse	= (is_null($returnIfFalse))	? FALSE :	PHPExcel_Calculation_Functions::flattenSingleValue($returnIfFalse);

		return ($condition) ? $returnIfTrue : $returnIfFalse;
	}	//	function STATEMENT_IF()

	/**
	 * IFERROR
	 *
	 * Excel Function:
	 *		=IFERROR(testValue,errorpart)
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed	$testValue	Value to check, is also the value returned when no error
	 * @param	mixed	$errorpart	Value to return when testValue is an error condition
	 * @return	mixed	The value of errorpart or testValue determined by error condition
	 */
	public static function IFERROR($testValue = '', $errorpart = '') {
		$testValue	= (is_null($testValue))	? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($testValue);
		$errorpart	= (is_null($errorpart))	? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($errorpart);

		return self::STATEMENT_IF(PHPExcel_Calculation_Functions::IS_ERROR($testValue), $errorpart, $testValue);
	}	//	function IFERROR()

}	//	class PHPExcel_Calculation_Logical
=======
<?php
/**
 * PHPExcel
 *
 * Copyright (c) 2006 - 2014 PHPExcel
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * @category	PHPExcel
 * @package		PHPExcel_Calculation
 * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 * @license		http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
 * @version		1.8.0, 2014-03-02
 */

/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
	/**
	 * @ignore
	 */
	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}

/**
 * PHPExcel_Calculation_Logical
 *
 * @category	PHPExcel
 * @package		PHPExcel_Calculation
 * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 */
class PHPExcel_Calculation_Logical {

	/**
	 * TRUE
	 *
	 * Returns the boolean TRUE.
	 *
	 * Excel Function:
	 *		=TRUE()
	 *
	 * @access	public
	 * @category Logical Functions
	 * @return	boolean		True
	 */
	public static function TRUE() {
		return TRUE;
	}	//	function TRUE()

	/**
	 * FALSE
	 *
	 * Returns the boolean FALSE.
	 *
	 * Excel Function:
	 *		=FALSE()
	 *
	 * @access	public
	 * @category Logical Functions
	 * @return	boolean		False
	 */
	public static function FALSE() {
		return FALSE;
	}	//	function FALSE()

	/**
	 * LOGICAL_AND
	 *
	 * Returns boolean TRUE if all its arguments are TRUE; returns FALSE if one or more argument is FALSE.
	 *
	 * Excel Function:
	 *		=AND(logical1[,logical2[, ...]])
	 *
	 *		The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
	 *			or references that contain logical values.
	 *
	 *		Boolean arguments are treated as True or False as appropriate
	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed		$arg,...		Data values
	 * @return	boolean		The logical AND of the arguments.
	 */
	public static function LOGICAL_AND() {
		// Return value
		$returnValue = TRUE;

		// Loop through the arguments
		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
		$argCount = -1;
		foreach ($aArgs as $argCount => $arg) {
			// Is it a boolean value?
			if (is_bool($arg)) {
				$returnValue = $returnValue && $arg;
			} elseif ((is_numeric($arg)) && (!is_string($arg))) {
				$returnValue = $returnValue && ($arg != 0);
			} elseif (is_string($arg)) {
				$arg = strtoupper($arg);
				if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
					$arg = TRUE;
				} elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
					$arg = FALSE;
				} else {
					return PHPExcel_Calculation_Functions::VALUE();
				}
				$returnValue = $returnValue && ($arg != 0);
			}
		}

		// Return
		if ($argCount < 0) {
			return PHPExcel_Calculation_Functions::VALUE();
		}
		return $returnValue;
	}	//	function LOGICAL_AND()

	/**
	 * LOGICAL_OR
	 *
	 * Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
	 *
	 * Excel Function:
	 *		=OR(logical1[,logical2[, ...]])
	 *
	 *		The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
	 *			or references that contain logical values.
	 *
	 *		Boolean arguments are treated as True or False as appropriate
	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed		$arg,...		Data values
	 * @return	boolean		The logical OR of the arguments.
	 */
	public static function LOGICAL_OR() {
		// Return value
		$returnValue = FALSE;

		// Loop through the arguments
		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
		$argCount = -1;
		foreach ($aArgs as $argCount => $arg) {
			// Is it a boolean value?
			if (is_bool($arg)) {
				$returnValue = $returnValue || $arg;
			} elseif ((is_numeric($arg)) && (!is_string($arg))) {
				$returnValue = $returnValue || ($arg != 0);
			} elseif (is_string($arg)) {
				$arg = strtoupper($arg);
				if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
					$arg = TRUE;
				} elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
					$arg = FALSE;
				} else {
					return PHPExcel_Calculation_Functions::VALUE();
				}
				$returnValue = $returnValue || ($arg != 0);
			}
		}

		// Return
		if ($argCount < 0) {
			return PHPExcel_Calculation_Functions::VALUE();
		}
		return $returnValue;
	}	//	function LOGICAL_OR()

	/**
	 * NOT
	 *
	 * Returns the boolean inverse of the argument.
	 *
	 * Excel Function:
	 *		=NOT(logical)
	 *
	 *		The argument must evaluate to a logical value such as TRUE or FALSE
	 *
	 *		Boolean arguments are treated as True or False as appropriate
	 *		Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
	 *		If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
	 *			the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed		$logical	A value or expression that can be evaluated to TRUE or FALSE
	 * @return	boolean		The boolean inverse of the argument.
	 */
	public static function NOT($logical=FALSE) {
		$logical = PHPExcel_Calculation_Functions::flattenSingleValue($logical);
		if (is_string($logical)) {
			$logical = strtoupper($logical);
			if (($logical == 'TRUE') || ($logical == PHPExcel_Calculation::getTRUE())) {
				return FALSE;
			} elseif (($logical == 'FALSE') || ($logical == PHPExcel_Calculation::getFALSE())) {
				return TRUE;
			} else {
				return PHPExcel_Calculation_Functions::VALUE();
			}
		}

		return !$logical;
	}	//	function NOT()

	/**
	 * STATEMENT_IF
	 *
	 * Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.
	 *
	 * Excel Function:
	 *		=IF(condition[,returnIfTrue[,returnIfFalse]])
	 *
	 *		Condition is any value or expression that can be evaluated to TRUE or FALSE.
	 *			For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100,
	 *			the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.
	 *			This argument can use any comparison calculation operator.
	 *		ReturnIfTrue is the value that is returned if condition evaluates to TRUE.
	 *			For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE,
	 *			then the IF function returns the text "Within budget"
	 *			If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use
	 *			the logical value TRUE for this argument.
	 *			ReturnIfTrue can be another formula.
	 *		ReturnIfFalse is the value that is returned if condition evaluates to FALSE.
	 *			For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE,
	 *			then the IF function returns the text "Over budget".
	 *			If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned.
	 *			If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned.
	 *			ReturnIfFalse can be another formula.
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed	$condition		Condition to evaluate
	 * @param	mixed	$returnIfTrue	Value to return when condition is true
	 * @param	mixed	$returnIfFalse	Optional value to return when condition is false
	 * @return	mixed	The value of returnIfTrue or returnIfFalse determined by condition
	 */
	public static function STATEMENT_IF($condition = TRUE, $returnIfTrue = 0, $returnIfFalse = FALSE) {
		$condition		= (is_null($condition))		? TRUE :	(boolean) PHPExcel_Calculation_Functions::flattenSingleValue($condition);
		$returnIfTrue	= (is_null($returnIfTrue))	? 0 :		PHPExcel_Calculation_Functions::flattenSingleValue($returnIfTrue);
		$returnIfFalse	= (is_null($returnIfFalse))	? FALSE :	PHPExcel_Calculation_Functions::flattenSingleValue($returnIfFalse);

		return ($condition) ? $returnIfTrue : $returnIfFalse;
	}	//	function STATEMENT_IF()

	/**
	 * IFERROR
	 *
	 * Excel Function:
	 *		=IFERROR(testValue,errorpart)
	 *
	 * @access	public
	 * @category Logical Functions
	 * @param	mixed	$testValue	Value to check, is also the value returned when no error
	 * @param	mixed	$errorpart	Value to return when testValue is an error condition
	 * @return	mixed	The value of errorpart or testValue determined by error condition
	 */
	public static function IFERROR($testValue = '', $errorpart = '') {
		$testValue	= (is_null($testValue))	? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($testValue);
		$errorpart	= (is_null($errorpart))	? '' :	PHPExcel_Calculation_Functions::flattenSingleValue($errorpart);

		return self::STATEMENT_IF(PHPExcel_Calculation_Functions::IS_ERROR($testValue), $errorpart, $testValue);
	}	//	function IFERROR()

}	//	class PHPExcel_Calculation_Logical
>>>>>>> 6f706d757719ba85748ebde050471e61e5ec9556


text:
var socket = io();

socket.on('announcement', function(data) {
    //window.alert(data);
    if(window.Notification && Notification.permission !== "denied") {
        Notification.requestPermission(function(status) {  // status is "granted", if accepted by user
            var n = new Notification('BigRed//Hacks Announcement!', {
                body: data,
                icon: '/img/logo/full-red.png' // optional
            });
        });
    }
});

function getTimeRemaining(endtime) {
    var t = Math.max(0,Date.parse(endtime) - Date.parse(new Date()));
    var seconds = Math.floor((t / 1000) % 60);
    var minutes = Math.floor((t / 1000 / 60) % 60);
    var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
    var days = Math.floor(t / (1000 * 60 * 60 * 24));
    return {
        'total': t,
        'days': days,
        'hours': hours,
        'minutes': minutes,
        'seconds': seconds
    };
}

$("#request-mentor-btn").on('click', function(e) {
    e.preventDefault();
    //$("#request-mentor-btn").addClass("disabled");
    $.ajax({
        method: "POST",
        url: "/API/RequestMentor",
        data: {
            email: $("#mentor-req-email").val(),
            request: $("#mentor-req-text").val(),
            tableNumber: $("#mentor-req-table").val()
        },
        success: function(data) {
            $("#request-mentor-btn").addClass("disabled");
            $("#mentor-req-alert").css("visibility","visible").addClass("fadeOut").removeClass("alert-danger").removeClass("not-display").addClass("alert-success").text(data);
            console.log(data);
        },
        error: function(data) {
            $("#request-mentor-btn").addClass("disabled");
            $("#mentor-req-alert").css("visibility","visible").removeClass("alert-success").addClass("alert-danger").removeClass("not-display").text(data.responseText);
            console.log(data);

        }
    })
})

//fade out things that have fadeOut class
$(".fadeOut").delay(2000).fadeOut(2000, "easeInCubic");

function initializeClock(id, endtime) {
    var clock = document.getElementById(id);
    var daysSpan = clock.querySelector('.days');
    var hoursSpan = clock.querySelector('.hours');
    var minutesSpan = clock.querySelector('.minutes');
    var secondsSpan = clock.querySelector('.seconds');

    function updateClock() {
        var t = getTimeRemaining(endtime);

        daysSpan.innerHTML = t.days;
        hoursSpan.innerHTML = ('0' + t.hours).slice(-2);
        minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);
        secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);

        if (t.total <= 0) {
            clearInterval(timeinterval);
        }
    }

    updateClock();
    var timeinterval = setInterval(updateClock, 1000);
}

var deadline = new Date(Date.parse(new Date("September 18, 2016 8:00:00")));
initializeClock('clockdiv', deadline);


text:
Segment* segment_create(Vec3 origin) {
  Segment *this = (Segment*)malloc(sizeof(Segment));
  this->origin = origin;
  this->visible = true;
  this->dz = 0;
  this->move_delay = 0;

  return this;
}

void segment_destroy(Segment *this) {
  free(this);
}

void segment_logic(Segment *this) {
  if(this->move_delay > 0) {
    this->move_delay -= 5;
  } else {
    if((this->visible && this->origin.z > 0)
    || (!this->visible && this->origin.z > -SEGMENT_Z_MAX)) {
      this->origin.z -= this->dz;
    }
  }
}

void segment_render(Segment *this) {
  pge_isometric_fill_box(this->origin, SEGMENT_SIZE, SEGMENT_MAX_HEIGHT, this->side_color);
  pge_isometric_fill_rect(Vec3(this->origin.x, this->origin.y, this->origin.z + SEGMENT_MAX_HEIGHT), SEGMENT_SIZE, this->face_color);
#ifdef PBL_BW
  pge_isometric_draw_box(this->origin, SEGMENT_SIZE, SEGMENT_MAX_HEIGHT, GColorWhite);
#endif
}

void segment_set_visible(Segment *this, bool now_visible, int index) {
  if(this->visible && !now_visible) {
    // Now hiding
    this->dz = SEGMENT_FLY_SPEED;
    this->move_delay = index * SEGMENT_DELAY_COEFF;
  } else if(!this->visible && now_visible) {
    // Show
    this->origin.z = SEGMENT_Z_MAX;
    this->dz = SEGMENT_FLY_SPEED;
    this->move_delay = index * SEGMENT_DELAY_COEFF;
  } else {
    // No movement, conditions match
  }

  this->visible = now_visible;
}

void segment_set_colors(Segment *this, GColor side_color, GColor face_color) {
  this->side_color = side_color;
  this->face_color = face_color;
}

bool segment_is_at_rest(Segment *this) {
  return (this->visible && this->origin.z == 0) // Supposed to be visible, and is
      || (!this->visible && abs(this->origin.z) >= SEGMENT_Z_MAX);  // Supposed to be invisible and is high up or down low
}


text:
<?php

namespace Generator\Models\DB\Adapter;

class MySql extends Adapter {

    /**
     * Holds PDO instance
     *
     * @var \PDO
     */
    private $pdo;

    public function __construct($pdo) {
        $this->pdo = $pdo;
    }

    /**
     * Return all the tables of the database
     *
     * @return array
     */
    public function listAllTable() {
        $output = array();
        $details = $this->pdo
                    ->query('SHOW TABLES')
                    ->fetchAll();

        foreach ($details as $record) {
            $output[] = $record[0];
        }

        return $output;
    }

    /**
     * Generate Table details.
     *
     * @param string $table
     * @return array
     * Format:
     *  [
     *      <fieldName:string> => [
     *          <name:string>,
     *          <key:string>
     *          <datatype:string>
     *          <nullable:boolean>
     *          <default:mixed>
     *      ],
     *      ...
     *  ]
     */
    public function getTableDetails($table) {
        $output = array();
        $details = $this->pdo
                    ->query("DESCRIBE {$table}")
                    ->fetchAll();

        foreach ($details as $record) {
            $output[$record['Field']]['name'] = $record['Field'];
            $output[$record['Field']]['key'] = $record['Key'];
            $output[$record['Field']]['datatype'] = $record['Type'];
            $output[$record['Field']]['nullable'] = ($record['Null'] === 'NO') ? false : true;
            $output[$record['Field']]['default'] = $record['Default'];
        }

        return $output;
    }

}


text:
#ifndef CRIMILD_MATHEMATICS_GET_PTR_
#define CRIMILD_MATHEMATICS_GET_PTR_

#include "Mathematics/ColorRGB.hpp"
#include "Mathematics/ColorRGBA.hpp"
#include "Mathematics/Matrix3.hpp"
#include "Mathematics/Matrix4.hpp"
#include "Mathematics/Tuple2.hpp"
#include "Mathematics/Tuple3.hpp"
#include "Mathematics/Tuple4.hpp"

namespace crimild {

    template< typename T >
    inline constexpr const T *get_ptr( const Tuple2Impl< T > &u )
    {
        return static_cast< const T * >( &u.x );
    }

    template< typename T >
    inline constexpr T *get_ptr( Tuple2Impl< T > &u )
    {
        return static_cast< T * >( &u.x );
    }

    template< typename T >
    inline constexpr const T *get_ptr( const Tuple3Impl< T > &u )
    {
        return static_cast< const T * >( &u.x );
    }

    template< typename T >
    inline constexpr T *get_ptr( Tuple3Impl< T > &u )
    {
        return static_cast< T * >( &u.x );
    }

    template< typename T >
    inline constexpr const T *get_ptr( const Tuple4Impl< T > &u )
    {
        return static_cast< const T * >( &u.x );
    }

    template< typename T >
    inline constexpr T *get_ptr( Tuple4Impl< T > &u )
    {
        return static_cast< T * >( &u.x );
    }

    template< typename T >
    inline constexpr const T *get_ptr( const Matrix3Impl< T > &m ) noexcept
    {
        return static_cast< const T * >( &m.c0.x );
    }

    template< typename T >
    inline constexpr T *get_ptr( Matrix3Impl< T > &m ) noexcept
    {
        return static_cast< T * >( &m.c0.x );
    }

    template< typename T >
    inline constexpr const T *get_ptr( const Matrix4Impl< T > &m ) noexcept
    {
        return static_cast< const T * >( &m.c0.x );
    }

    template< typename T >
    inline constexpr T *get_ptr( Matrix4Impl< T > &m ) noexcept
    {
        return static_cast< T * >( &m.c0.x );
    }

    template< typename T >
    inline constexpr const T *get_ptr( const ColorRGBImpl< T > &c )
    {
        return static_cast< const T * >( &c.r );
    }

    template< typename T >
    inline constexpr T *get_ptr( ColorRGBImpl< T > &c )
    {
        return static_cast< T * >( &c.r );
    }

    template< typename T >
    inline constexpr const T *get_ptr( const ColorRGBAImpl< T > &c )
    {
        return static_cast< const T * >( &c.r );
    }

    template< typename T >
    inline constexpr T *get_ptr( ColorRGBAImpl< T > &c )
    {
        return static_cast< T * >( &c.r );
    }

}

#endif


text:
namespace ast {
llvm::Value* Variable::Codegen() const {
  llvm::AllocaInst* val = GetNamedValue(name_);
  if (!val) {
    Error(position, "Unknown variable name: ", name_);
    return nullptr;
  }
  v_ = builder.CreateLoad(val, name_.c_str());
  return v_;
}

llvm::Type* Variable::Type() const {
  assert(v_);
  return v_->getType();
}
}  // end namespace ast


text:
from oslo_config import cfg

from ironic.common.i18n import _

opts = [
    cfg.IntOpt('command_retry_timeout',
               default=60,
               help=_('Maximum time in seconds to retry retryable IPMI '
                      'operations. (An operation is retryable, for '
                      'example, if the requested operation fails '
                      'because the BMC is busy.) Setting this too high '
                      'can cause the sync power state '
                      'periodic task to hang when there are slow or '
                      'unresponsive BMCs.')),
    cfg.IntOpt('retry_timeout',
               help=_('Maximum time in seconds to retry IPMI operations. '
                      'Setting this too high can cause the '
                      'sync power state periodic task to hang when there are '
                      'slow or unresponsive BMCs.'),
               deprecated_for_removal=True,
               deprecated_reason=_('Use option [ipmi]/command_retry_timeout '
                                   'to specify the timeout value for '
                                   'IPMI command retries, and use option '
                                   '[conductor]/power_state_change_timeout to '
                                   'specify the timeout value for waiting for '
                                   'a power operation to complete so that a '
                                   'baremetal node reaches the desired '
                                   'power state.')),
    cfg.IntOpt('min_command_interval',
               default=5,
               help=_('Minimum time, in seconds, between IPMI operations '
                      'sent to a server. There is a risk with some hardware '
                      'that setting this too low may cause the BMC to crash. '
                      'Recommended setting is 5 seconds.')),
]

def register_opts(conf):
    conf.register_opts(opts, group='ipmi')


text:
import { width } from '@looker/design-tokens'
import React from 'react'
import styled, { css } from 'styled-components'
import omit from 'lodash/omit'
import pick from 'lodash/pick'
import { inputHeight } from '../../Inputs/height'
import { HelperText } from './HelperText'
import { FieldDetail } from './FieldDetail'
import { FieldLabel } from './FieldLabel'
import { InputArea } from './InputArea'
import type { FieldProps } from './types'

export const fieldPropKeys = [
  'className',
  'description',
  'detail',
  'externalLabel',
  'id',
  'inline',
  'label',
  'hideLabel',
  'labelWidth',
  'validationMessage',
  'width',
]

export const pickFieldProps = (props: FieldProps) =>
  pick(props, [...fieldPropKeys, 'disabled', 'required', 'autoResize'])

export const omitFieldProps = (props: FieldProps) => omit(props, fieldPropKeys)

/**
 * `<Field />` allows the rendering of a label (optionally associated with a child input like `<InputText />`),
 * and can render a validation message. Generally, this component is used with form inputs to give user
 * feedback about the status of the input values.
 */

export const Field = styled(
  ({
    autoResize,
    className,
    children,
    description,
    detail,
    id,
    ariaLabelOnly,
    label,
    hideLabel,
    required,
    validationMessage,
  }: FieldProps) => (
    <div className={className}>
      <FieldLabel
        ariaLabelOnly={ariaLabelOnly}
        id={id}
        label={label}
        hideLabel={hideLabel}
        required={required}
      />
      <InputArea autoResize={autoResize}>{children}</InputArea>
      {detail && <FieldDetail>{detail}</FieldDetail>}
      <HelperText
        description={description}
        id={id}
        validationMessage={validationMessage}
      />
    </div>
  )
)`
  align-items: left;

  display: ${({ autoResize }) => (autoResize ? 'inline-grid' : 'grid')};
  ${({ inline }) => (inline ? inlineTemplateAreas : templateAreas)}
  grid-template-columns: ${({ inline }) => (inline ? '150px 1fr' : undefined)};
  height: fit-content;
  justify-content: space-between;
  width: ${({ autoResize }) => (autoResize ? 'fit-content' : '100%')};
  ${width}

  ${InputArea} {
    grid-area: input;
  }

  ${HelperText} {
    grid-area: messages;
  }

  & > ${FieldLabel} {
    grid-area: label;
    ${({ inline }) => fieldLabelCSS(inline)}
  }

  ${FieldDetail} {
    grid-area: detail;
    justify-self: end;
    padding-left: ${({ theme: { space } }) => space.u3};

    ${({ inline }) =>
      inline &&
      css`
        align-self: center;
      `}
  }
`

const fieldLabelCSS = (inline?: boolean) =>
  inline
    ? css`
        height: ${inputHeight};
        justify-self: end;
        line-height: ${inputHeight};
        padding-right: ${({ theme }) => theme.space.u3};
        text-align: right;
      `
    : css`
        line-height: ${({ theme }) => theme.lineHeights.xsmall};
        padding-bottom: ${({ theme }) => theme.space.u1};
      `

const inlineTemplateAreas = css`
  grid-template-areas: 'label input detail' '. messages messages';
`

const templateAreas = css`
  grid-template-areas: 'label detail' 'input input' 'messages messages';
`


text:
#ifndef _MATERIALEDITORFRAME_H_
#define _MATERIALEDITORFRAME_H_

#include <wx/wx.h>

#include "OgreRenderSystem.h"
#include "OgreRoot.h"

class wxAuiManager;
class wxAuiNotebook;
class wxNotebook;
class wxPropertyGridManager;
class wxTreeCtrl;

namespace
{
	class RenderSystem;
	class Root;
}

class DocPanel;
class EventArgs;
class LogPanel;
class PropertiesPanel;
class ResourcePanel;
class WorkspacePanel;
class wxOgre;

class MaterialEditorFrame : public wxFrame
{
public:
	MaterialEditorFrame(wxWindow* parent = NULL);
	~MaterialEditorFrame();

protected:
	void createAuiManager(void);
	void createAuiNotebookPane(void);
	void createManagementPane(void);
	void createInformationPane(void);
	void createPropertiesPane();
	void createOgrePane(void);

	void createMenuBar(void);
	void createFileMenu(void);
	void createEditMenu(void);
	void createViewMenu(void);
	void createToolsMenu(void);
	void createWindowMenu(void);
	void createHelpMenu(void);

	void OnActivate(wxActivateEvent& event);

	void OnActiveEditorChanged(EventArgs& args);

	void OnNewProject(wxCommandEvent& event);
	void OnNewMaterial(wxCommandEvent& event);
	void OnFileOpen(wxCommandEvent& event);
	void OnFileSave(wxCommandEvent& event);
	void OnFileSaveAs(wxCommandEvent& event);
	void OnFileClose(wxCommandEvent& event);
	void OnFileExit(wxCommandEvent& event);
	void OnEditUndo(wxCommandEvent& event);
	void OnEditRedo(wxCommandEvent& event);
	void OnEditCut(wxCommandEvent& event);
	void OnEditCopy(wxCommandEvent& event);
	void OnEditPaste(wxCommandEvent& event);
	void OnViewOpenGL(wxCommandEvent& event);
	void OnViewDirectX(wxCommandEvent& event);

private:
	wxMenuBar* mMenuBar;
	wxMenu* mFileMenu;
	wxMenu* mEditMenu;
	wxMenu* mViewMenu;
	wxMenu* mToolsMenu;
	wxMenu* mWindowMenu;
	wxMenu* mHelpMenu;

	wxAuiManager* mAuiManager;

	wxAuiNotebook* mAuiNotebook;
	wxAuiNotebook* mManagementNotebook;
	wxAuiNotebook* mInformationNotebook;
	WorkspacePanel* mWorkspacePanel;
	ResourcePanel* mResourcePanel;
	PropertiesPanel* mPropertiesPanel;

	Ogre::Root* mRoot;
	Ogre::Entity* mEntity;

	LogPanel* mLogPanel;
	DocPanel* mDocPanel;
	wxOgre* mOgreControl;

	Ogre::RenderSystem* mDirectXRenderSystem;
	Ogre::RenderSystem* mOpenGLRenderSystem;

	DECLARE_EVENT_TABLE();
};

#endif // _MATERIALEDITORFRAME_H_


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

namespace Miseng.Model
{
    public class UINode
    {
        public int Id { get; set; }

        public string ControlName { get; set; }

        public int ParentId { get; set; }
    }
}


text:
package org.objectweb.asm.tree;

import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

/**
 * A node that represents an LDC instruction.
 *
 * @author Eric Bruneton
 */
public class LdcInsnNode extends AbstractInsnNode {

    /**
     * The constant to be loaded on the stack. This parameter must be a non null
     * {@link Integer}, a {@link Float}, a {@link Long}, a {@link Double}, a
     * {@link String} or a {@link org.objectweb.asm.Type}.
     */
    public Object cst;

    /**
     * Constructs a new {@link LdcInsnNode}.
     *
     * @param cst the constant to be loaded on the stack. This parameter must be
     *        a non null {@link Integer}, a {@link Float}, a {@link Long}, a
     *        {@link Double} or a {@link String}.
     */
    public LdcInsnNode(final Object cst) {
        super(Opcodes.LDC);
        this.cst = cst;
    }

    public void accept(final MethodVisitor mv) {
        mv.visitLdcInsn(cst);
    }

    public int getType() {
        return LDC_INSN;
    }
}


text:
'use strict';

import * as angular from 'angular';
import _ from 'lodash';

import { SETTINGS } from 'core/config/settings';
import { CONFIG_SECTION_FOOTER } from '../footer/configSectionFooter.component';

import './applicationLinks.component.less';
import { CORE_APPLICATION_CONFIG_LINKS_EDITLINKS_MODAL_CONTROLLER } from './editLinks.modal.controller';
import ANGULAR_UI_BOOTSTRAP from 'angular-ui-bootstrap';

export const CORE_APPLICATION_CONFIG_LINKS_APPLICATIONLINKS_COMPONENT =
  'spinnaker.core.application.config.applicationLinks.component';
export const name = CORE_APPLICATION_CONFIG_LINKS_APPLICATIONLINKS_COMPONENT; // for backwards compatibility
angular
  .module(CORE_APPLICATION_CONFIG_LINKS_APPLICATIONLINKS_COMPONENT, [
    CORE_APPLICATION_CONFIG_LINKS_EDITLINKS_MODAL_CONTROLLER,
    ANGULAR_UI_BOOTSTRAP,
    CONFIG_SECTION_FOOTER,
  ])
  .component('applicationLinks', {
    bindings: {
      application: '=',
    },
    templateUrl: require('./applicationLinks.component.html'),
    controller: [
      '$uibModal',
      function($uibModal) {
        const initialize = () => {
          if (this.application.notFound || this.application.hasError) {
            return;
          }

          this.cloudProviders = this.application.attributes.cloudProviders
            ? this.application.attributes.cloudProviders
            : [];

          this.sections = _.cloneDeep(
            this.application.attributes.instanceLinks || SETTINGS.defaultInstanceLinks || [],
          ).filter(
            section =>
              !section.cloudProviders ||
              section.cloudProviders.length === 0 ||
              _.intersection(section.cloudProviders, this.cloudProviders).length > 0,
          );

          this.viewState = {
            originalSections: _.cloneDeep(this.sections),
            originalStringVal: JSON.stringify(this.sections),
            saving: false,
            saveError: false,
            isDirty: false,
          };

          this.setDefaultLinkState();
        };

        this.setDefaultLinkState = () => {
          this.usingDefaultLinks = angular.toJson(this.sections) === angular.toJson(SETTINGS.defaultInstanceLinks);
          this.defaultLinksConfigured = !!SETTINGS.defaultInstanceLinks;
        };

        this.revert = initialize;

        this.useDefaultLinks = () => {
          this.sections = _.cloneDeep(SETTINGS.defaultInstanceLinks);
          this.configChanged();
        };

        this.addLink = section => {
          section.links.push({ title: '', path: '' });
          this.configChanged();
        };

        this.removeLink = (section, index) => {
          section.links.splice(index, 1);
          this.configChanged();
        };

        this.addSection = () => {
          const section = { title: '', links: [] };
          this.sections.push(section);
          this.addLink(section);
        };

        this.removeSection = index => {
          this.sections.splice(index, 1);
          this.configChanged();
        };

        this.configChanged = () => {
          this.setDefaultLinkState();
          this.viewState.isDirty = this.viewState.originalStringVal !== JSON.stringify(angular.copy(this.sections));
        };

        this.editJson = () => {
          $uibModal
            .open({
              templateUrl: require('./editLinks.modal.html'),
              controller: 'EditLinksModalCtrl as vm',
              size: 'lg modal-fullscreen',
              resolve: {
                sections: () => this.sections,
              },
            })
            .result.then(newSections => {
              this.sections = newSections;
              this.configChanged();
            })
            .catch(() => {});
        };

        this.sortOptions = {
          axis: 'y',
          delay: 150,
          stop: () => this.configChanged(),
        };

        this.$onInit = initialize;
      },
    ],
  });


text:
module Slideoff
  autoload :Markdown,        "slideoff/markdown"
  autoload :Presentation,    "slideoff/presentation"
  autoload :SlidesAPI,       "slideoff/slides_api"
  autoload :RemoteAPI,       "slideoff/remote_api"
  autoload :Routes,          "slideoff/routes"
  autoload :Server,          "slideoff/server"
  autoload :ConfigBuilder,   File.expand_path("slideoff/config_builder", File.dirname(__FILE__))
  autoload :Utils,           "slideoff/utils"
  autoload :FlickrImage,     "slideoff/flickr_image"
  autoload :FlickrAPI,       "slideoff/flickr_api"

  CONFIG = ConfigBuilder.new(Dir.pwd)
  VERSION = "0.4.0"
end


text:
/* tslint:disable:no-unused-variable */

import {TestBed, async, inject} from '@angular/core/testing'
import {LovefieldProviderService} from './lovefield-provider.service'

describe('LovefieldProviderService', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [LovefieldProviderService]
    })
  })

  it('should ...', inject([LovefieldProviderService], (service: LovefieldProviderService) => {
    expect(service).toBeTruthy()
  }))
})


text:
const newsEventname = 'openNewsListPage';
universalLinks.subscribe(newsEventname, onNewsListPageRequested);

function onNewsListPageRequested(eventData: universalLinks.EventData) {
  alert('Did launch application with news link: ' + eventData.url);
}

universalLinks.unsubscribe('openNewsListPage');

universalLinks.subscribe(null, onOtherLinkRequested);

function onOtherLinkRequested(eventData: universalLinks.EventData) {
  alert('Did launch application with other link: ' + eventData.url);
}

universalLinks.unsubscribe(null);


text:
sample-scala-maven-project
====================

Sample Scala Project with Maven


text:
#ifndef OPTIMIZER_H
#define OPTIMIZER_H

#include "Map.h"
#include "MapPoint.h"
#include "KeyFrame.h"
#include "LoopClosing.h"
#include "Frame.h"

#include "Thirdparty/g2o/g2o/types/sim3/types_seven_dof_expmap.h"

namespace ORB_SLAM
{

class LoopClosing;

class Optimizer
{
public:
    void static BundleAdjustment(const std::vector<KeyFrame*> &vpKF, const std::vector<MapPoint*> &vpMP, int nIterations = 5, bool *pbStopFlag=NULL);
    void static GlobalBundleAdjustemnt(Map* pMap, int nIterations=5, bool *pbStopFlag=NULL);
    void static LocalBundleAdjustment(KeyFrame* pKF, bool *pbStopFlag=NULL);
    int static PoseOptimization(Frame* pFrame);

    void static OptimizeEssentialGraph(Map* pMap, KeyFrame* pLoopKF, KeyFrame* pCurKF, g2o::Sim3 &Scurw,
                                       LoopClosing::KeyFrameAndPose &NonCorrectedSim3,
                                       LoopClosing::KeyFrameAndPose &CorrectedSim3,
                                       std::map<KeyFrame*, set<KeyFrame*> > &LoopConnections);

    static int OptimizeSim3(KeyFrame* pKF1, KeyFrame* pKF2, std::vector<MapPoint *> &vpMatches1, g2o::Sim3 &g2oS12, double th2 = 10);
};

} //namespace ORB_SLAM

#endif // OPTIMIZER_H


text:
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.12">
	<Constant uuid="d508b3e9-4dac-40a3-9a0b-1cc76b4196ea">
		<InternalInfo>
			<xr:GeneratedType name="ConstantManager.ОтложенноеОбновлениеВГлавномУзлеЗавершеноУспешно" category="Manager">
				<xr:TypeId>7858d15d-104a-4099-8b5e-cd069d50567e</xr:TypeId>
				<xr:ValueId>83389369-02c7-4cfe-825c-feb8049e444b</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="ConstantValueManager.ОтложенноеОбновлениеВГлавномУзлеЗавершеноУспешно" category="ValueManager">
				<xr:TypeId>927d2161-5e15-4e16-8f3d-99ee6b57bd05</xr:TypeId>
				<xr:ValueId>3ef9a9f3-aeab-48da-bde7-16ba2d82cf38</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="ConstantValueKey.ОтложенноеОбновлениеВГлавномУзлеЗавершеноУспешно" category="ValueKey">
				<xr:TypeId>e367ed17-825b-5e8b-9eda-38ff1ba94042</xr:TypeId>
				<xr:ValueId>6b4d244d-ce3e-5077-8814-3df5ac8355aa</xr:ValueId>
			</xr:GeneratedType>
		</InternalInfo>
		<Properties>
			<Name>ОтложенноеОбновлениеВГлавномУзлеЗавершеноУспешно</Name>
			<Synonym>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Отложенное обновление в главном узле завершено успешно</v8:content>
				</v8:item>
			</Synonym>
			<Comment/>
			<Type>
				<v8:Type>xs:boolean</v8:Type>
			</Type>
			<UseStandardCommands>true</UseStandardCommands>
			<DefaultForm/>
			<ExtendedPresentation/>
			<Explanation/>
			<PasswordMode>false</PasswordMode>
			<Format/>
			<EditFormat/>
			<ToolTip/>
			<MarkNegatives>false</MarkNegatives>
			<Mask/>
			<MultiLine>false</MultiLine>
			<ExtendedEdit>false</ExtendedEdit>
			<MinValue xsi:nil="true"/>
			<MaxValue xsi:nil="true"/>
			<FillChecking>DontCheck</FillChecking>
			<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
			<ChoiceParameterLinks/>
			<ChoiceParameters/>
			<QuickChoice>Auto</QuickChoice>
			<ChoiceForm/>
			<LinkByType/>
			<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
			<DataLockControlMode>Managed</DataLockControlMode>
			<DataHistory>DontUse</DataHistory>
			<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
			<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
		</Properties>
	</Constant>
</MetaDataObject>


text:
package com.builtamont.cassandra.migration.internal.util;

import com.builtamont.cassandra.migration.internal.util.scanner.Resource;
import com.builtamont.cassandra.migration.internal.util.scanner.classpath.ClassPathResource;
import com.builtamont.cassandra.migration.internal.util.scanner.classpath.ClassPathScanner;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.io.IOException;

import static org.junit.Assert.*;

/**
 * Test for ClassUtils.
 */
public class ClassUtilsSmallTest {
    /**
     * The old classloader, to be restored after a test completes.
     */
    private static ClassLoader oldClassLoader;

    @BeforeClass
    public static void setUp() throws IOException {
        oldClassLoader = getClassLoader();
        String jar = new ClassPathResource("no-directory-entries.jar", getClassLoader()).getLocationOnDisk();
        assertTrue(new File(jar).isFile());
        ClassUtils.addJarOrDirectoryToClasspath(jar);
    }

    private static ClassLoader getClassLoader() {
        return Thread.currentThread().getContextClassLoader();
    }

    @AfterClass
    public static void tearDown() {
        Thread.currentThread().setContextClassLoader(oldClassLoader);
    }
    @Test
    public void isPresent() {
        assertTrue(ClassUtils.isPresent("com.builtamont.cassandra.migration.CassandraMigration", Thread.currentThread().getContextClassLoader()));
    }

    @Test
    public void isPresentNot() {
        assertFalse(ClassUtils.isPresent("com.example.FakeClass", Thread.currentThread().getContextClassLoader()));
    }

    /**
     * Tests dynamically adding a directory to the classpath.
     */
    @Test
    public void addDirectoryToClasspath() throws Exception {
        assertFalse(new ClassPathResource("pkg/runtime.conf", getClassLoader()).exists());

        String folder = new ClassPathResource("dynamic", getClassLoader()).getLocationOnDisk();
        ClassUtils.addJarOrDirectoryToClasspath(folder);

        assertTrue(new ClassPathResource("pkg/runtime.conf", getClassLoader()).exists());

        Resource[] resources = new ClassPathScanner(getClassLoader()).scanForResources(new Location("classpath:pkg"), "run", ".conf");
        assertEquals("pkg/runtime.conf", resources[0].getLocation());
    }

    /**
     * Tests dynamically adding a directory to the default package of classpath.
     */
    @Test
    public void addDirectoryToClasspathDefaultPackage() throws Exception {
        assertFalse(new ClassPathResource("runtime.conf", getClassLoader()).exists());

        String folder = new ClassPathResource("dynamic/pkg2", getClassLoader()).getLocationOnDisk();
        ClassUtils.addJarOrDirectoryToClasspath(folder);

        assertTrue(new ClassPathResource("funtime.properties", getClassLoader()).exists());

        Resource[] resources = new ClassPathScanner(getClassLoader()).scanForResources(new Location("classpath:"), "fun", ".properties");
        assertEquals("funtime.properties", resources[1].getLocation());
    }
}


text:
using Adventure_Works.CognitiveServices.LUIS;
using Microsoft.Cognitive.LUIS;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Adventure_Works.CognitiveServices
{
    public class LUISAPI
    {
        private static LUISAPI _instance;
        public static LUISAPI Instance => _instance ?? (_instance = new LUISAPI());

        private IntentRouter _router;

        private LUISAPI() { }

        public async Task<LUISIntentStatus> HandleIntent(string text)
        {
            try
            {
                if (_router == null)
                {
                    var handlers = new LUISIntentHandlers();
                    _router = IntentRouter.Setup(Keys.LUISAppId, Keys.LUISAzureSubscriptionKey, handlers, false);
                }
                var status = new LUISIntentStatus();
                var handled = await _router.Route(text, status);

                return status;
            }
            catch(Exception ex)
            {
                return new LUISIntentStatus()
                {
                    SpeechRespose = "LUIS and I are not talking right now, make sure IDs are correct in Keys.cs",
                    TextResponse = "Can't access LUIS, make sure to populate Keys.cs with the LUIS IDs",
                    Success = true
                };
            }
        }

    }
}


text:
goog.provide('ngeo.createfeatureDirective');

goog.require('ngeo');
goog.require('ngeo.EventHelper');
/** @suppress {extraRequire} */
goog.require('ngeo.filters');
goog.require('ngeo.interaction.MeasureArea');
goog.require('ngeo.interaction.MeasureLength');
goog.require('ngeo.utils');
goog.require('ol.events');
goog.require('ol.Feature');
goog.require('ol.interaction.Draw');
goog.require('ol.style.Style');

/**
 * A directive used to draw vector features of a single geometry type using
 * either a 'draw' or 'measure' interaction. Once a feature is finished being
 * drawn, it is added to a collection of features.
 *
 * The geometry types supported are:
 *  - Point
 *  - LineString
 *  - Polygon
 *
 * Example:
 *
 *
 *
 *
 * @htmlAttribute {boolean} ngeo-createfeature-active Whether the directive is
 *     active or not.
 * @htmlAttribute {ol.Collection} ngeo-createfeature-features The collection of
 *     features where to add those created by this directive.
 * @htmlAttribute {string} ngeo-createfeature-geom-type Determines the type
 *     of geometry this directive should draw.
 * @htmlAttribute {ol.Map} ngeo-createfeature-map The map.
 *
 * @return {angular.Directive} The directive specs.
 * @ngdoc directive
 * @ngname ngeoCreatefeature
 */
ngeo.createfeatureDirective = function() {
  return {
    controller: ngeo.CreatefeatureController,
    bindToController: true,
    scope: {
      'active': '=ngeoCreatefeatureActive',
      'features': '=ngeoCreatefeatureFeatures',
      'geomType': '=ngeoCreatefeatureGeomType',
      'map': '=ngeoCreatefeatureMap'
    }
  };
};

ngeo.module.directive('ngeoCreatefeature', ngeo.createfeatureDirective);

/**
 * @param {!angularGettext.Catalog} gettextCatalog Gettext catalog.
 * @param {!angular.$compile} $compile Angular compile service.
 * @param {!angular.$filter} $filter Angular filter
 * @param {!angular.Scope} $scope Scope.
 * @param {!angular.$timeout} $timeout Angular timeout service.
 * @param {!ngeo.EventHelper} ngeoEventHelper Ngeo event helper service
 * @constructor
 * @private
 * @struct
 * @ngInject
 * @ngdoc controller
 * @ngname ngeoCreatefeatureController
 */
ngeo.CreatefeatureController = function(gettextCatalog, $compile, $filter, $scope,
  $timeout, ngeoEventHelper) {

  /**
   * @type {boolean}
   * @export
   */
  this.active;

  /**
   * @type {ol.Collection.<!ol.Feature>|!ol.source.Vector}
   * @export
   */
  this.features;

  /**
   * @type {string}
   * @export
   */
  this.geomType;

  /**
   * @type {!ol.Map}
   * @export
   */
  this.map;

  /**
   * @type {!angularGettext.Catalog}
   * @private
   */
  this.gettextCatalog_ = gettextCatalog;

  /**
   * @type {!angular.$compile}
   * @private
   */
  this.compile_ = $compile;

  /**
   * @type {!angular.$filter}
   * @private
   */
  this.filter_ = $filter;

  /**
   * @type {!angular.Scope}
   * @private
   */
  this.scope_ = $scope;

  /**
   * @type {!angular.$timeout}
   * @private
   */
  this.timeout_ = $timeout;

  /**
   * @type {!ngeo.EventHelper}
   * @private
   */
  this.ngeoEventHelper_ = ngeoEventHelper;

  /**
   * The draw or measure interaction responsible of drawing the vector feature.
   * The actual type depends on the geometry type.
   * @type {ol.interaction.Interaction}
   * @private
   */
  this.interaction_;

  // == Event listeners ==
  $scope.$watch(
    () => this.active,
    (newVal) => {
      this.interaction_.setActive(newVal);
    }
  );
};

/**
 * Initialize the directive.
 */
ngeo.CreatefeatureController.prototype.$onInit = function() {
  this.active = this.active === true;
  const gettextCatalog = this.gettextCatalog_;

  // Create the draw or measure interaction depending on the geometry type
  let interaction;
  if (this.geomType === ngeo.GeometryType.POINT ||
      this.geomType === ngeo.GeometryType.MULTI_POINT
  ) {
    interaction = new ol.interaction.Draw({
      type: /** @type {ol.geom.GeometryType} */ ('Point')
    });
  } else if (this.geomType === ngeo.GeometryType.LINE_STRING ||
      this.geomType === ngeo.GeometryType.MULTI_LINE_STRING
  ) {
    const helpMsg = gettextCatalog.getString('Click to start drawing length');
    const contMsg = gettextCatalog.getString(
      'Click to continue drawing
' +
      'Double-click or click last point to finish'
    );

    interaction = new ngeo.interaction.MeasureLength(
      this.filter_('ngeoUnitPrefix'),
      {
        style: new ol.style.Style(),
        startMsg: this.compile_(`<div translate>${helpMsg}</div>`)(this.scope_)[0],
        continueMsg: this.compile_(`<div translate>${contMsg}</div>`)(this.scope_)[0]
      }
    );
  } else if (this.geomType === ngeo.GeometryType.POLYGON ||
      this.geomType === ngeo.GeometryType.MULTI_POLYGON
  ) {
    const helpMsg = gettextCatalog.getString('Click to start drawing area');
    const contMsg = gettextCatalog.getString(
      'Click to continue drawing
' +
      'Double-click or click starting point to finish'
    );

    interaction = new ngeo.interaction.MeasureArea(
      this.filter_('ngeoUnitPrefix'),
      {
        style: new ol.style.Style(),
        startMsg: this.compile_(`<div translate>${helpMsg}</div>`)(this.scope_)[0],
        continueMsg: this.compile_(`<div translate>${contMsg}</div>`)(this.scope_)[0]
      }
    );
  }

  goog.asserts.assert(interaction);

  interaction.setActive(this.active);
  this.interaction_ = interaction;
  this.map.addInteraction(interaction);

  const uid = ol.getUid(this);
  if (interaction instanceof ol.interaction.Draw) {
    this.ngeoEventHelper_.addListenerKey(
      uid,
      ol.events.listen(
        interaction,
        'drawend',
        this.handleDrawEnd_,
        this
      )
    );
  } else if (interaction instanceof ngeo.interaction.MeasureLength ||
     interaction instanceof ngeo.interaction.MeasureArea) {
    this.ngeoEventHelper_.addListenerKey(
      uid,
      ol.events.listen(
        interaction,
        'measureend',
        this.handleDrawEnd_,
        this
      )
    );
  }
};

/**
 * Called when a feature is finished being drawn. Add the feature to the
 * collection.
 * @param {ol.interaction.Draw.Event|ngeox.MeasureEvent} event Event.
 * @export
 */
ngeo.CreatefeatureController.prototype.handleDrawEnd_ = function(event) {
  let sketch;
  if (event.feature) {
    // ol.interaction.Draw.Event
    sketch = event.feature;
  } else {
    // ngeox.MeasureEvent
    sketch = event.detail.feature;
  }
  goog.asserts.assert(sketch);

  // convert to multi if geomType is multi and feature is not
  let geometry = sketch.getGeometry();
  const type = geometry.getType();
  if (this.geomType.indexOf('Multi') != type.indexOf('Multi')) {
    geometry = ngeo.utils.toMulti(geometry);
  }
  const feature = new ol.Feature(geometry);
  if (this.features instanceof ol.Collection) {
    this.features.push(feature);
  } else {
    this.features.addFeature(feature);
  }
};

/**
 * Cleanup event listeners and remove the interaction from the map.
 */
ngeo.CreatefeatureController.prototype.$onDestroy = function() {
  this.timeout_(() => {
    const uid = ol.getUid(this);
    this.ngeoEventHelper_.clearListenerKey(uid);
    this.interaction_.setActive(false);
    this.map.removeInteraction(this.interaction_);
  }, 0);
};


text:
import mock

from paasta_tools import remote_git

def test_make_determine_wants_func():
    refs = {
        b'refs/heads/foo': b'abcde',
        b'refs/tags/blah': b'12345',
    }
    # nothing changed, so nothing should change
    determine_wants = remote_git._make_determine_wants_func(lambda x: x)
    assert determine_wants(refs) == refs

    # don't delete anything.
    determine_wants = remote_git._make_determine_wants_func(lambda x: {})
    assert determine_wants(refs) == refs

    # don't modify anything existing.
    determine_wants = remote_git._make_determine_wants_func(
        lambda x: {k: v[::-1] for k, v in x.items()},
    )
    assert determine_wants(refs) == refs

    # only allow new things
    determine_wants = remote_git._make_determine_wants_func(
        lambda x: {'foo': 'bar'},
    )
    actual = determine_wants(refs)
    expected = dict(refs)
    expected.update({b'foo': b'bar'})
    assert actual == expected

def test_non_ascii_tags():
    """git tags can be UTF-8 encoded"""

    with mock.patch(
        'dulwich.client.get_transport_and_path',
        autospec=True,
        return_value=(
            mock.Mock(**{'fetch_pack.return_value': {'☃'.encode('UTF-8'): b'deadbeef'}}),
            'path',
        ),
    ):
        with mock.patch('time.sleep', autospec=True):
            ret = remote_git.list_remote_refs('git-url')
            assert ret == {'☃': 'deadbeef'}

def test_make_force_push_mutate_refs_func_overwrites_shas():
    targets = ['refs/heads/targeta', 'refs/tags/targetb']
    input_refs = {
        b'refs/heads/foo': b'12345',
        b'refs/heads/targeta': b'12345',
        b'refs/tags/targetb': b'12345',
        b'refs/heads/ignored': b'12345',
        b'refs/tags/blah': b'12345',
    }
    expected = {
        b'refs/heads/foo': b'12345',
        b'refs/heads/targeta': b'newsha',
        b'refs/tags/targetb': b'newsha',
        b'refs/heads/ignored': b'12345',
        b'refs/tags/blah': b'12345',
    }

    mutate_refs_func = remote_git.make_force_push_mutate_refs_func(
        targets=targets,
        sha='newsha',
    )
    actual = mutate_refs_func(input_refs)
    assert actual == expected
    assert all([isinstance(k, bytes) for k in actual])

@mock.patch('dulwich.client', autospec=True)
@mock.patch('paasta_tools.remote_git._make_determine_wants_func', autospec=True)
def test_create_remote_refs_is_safe_by_default(mock_make_determine_wants_func, mock_dulwich_client):
    git_url = 'fake_git_url'
    fake_git_client = mock.Mock()
    mock_dulwich_client.get_transport_and_path.return_value = fake_git_client, 'fake_path'
    remote_git.create_remote_refs(
        git_url=git_url,
        ref_mutator=mock.sentinel.ref_mutator,
    )
    fake_git_client.send_pack.assert_called_once_with(
        'fake_path', mock_make_determine_wants_func.return_value, mock.ANY,
    )

@mock.patch('dulwich.client', autospec=True)
def test_create_remote_refs_allows_force_and_uses_the_provided_mutator(mock_dulwich_client):
    git_url = 'fake_git_url'
    fake_git_client = mock.Mock()
    mock_dulwich_client.get_transport_and_path.return_value = fake_git_client, 'fake_path'
    remote_git.create_remote_refs(
        git_url=git_url,
        ref_mutator=mock.sentinel.ref_mutator,
        force=True,
    )
    fake_git_client.send_pack.assert_called_once_with(
        'fake_path', mock.sentinel.ref_mutator, mock.ANY,
    )


text:
package Chapter3.EX12;

import java.util.Scanner;

public class ex12_calRate {

	public static void main(String[] args) {
		System.out.println("Enter the principal : ? ");
		int principal = inputScannerInteger();

		System.out.println("Enter the rate of interest ? ");
		String interest = inputScannerString();

		float rateOfInterest = Float.parseFloat(interest);

		System.out.println("Enter the number of years ? ");
		int years = inputScannerInteger();

		float investment = 0;

		investment = principal * ( 1 + rateOfInterest/100 * years);

		System.out.println("After " + years + " years at " + rateOfInterest +"%, the investment will be worth $" + investment);

	}

	public static String  inputScannerString(){
		String input = null;

		Scanner scanner = new Scanner(System.in);
		input = scanner.nextLine();

		return input;
	}

	public static int  inputScannerInteger(){
		String input = null;

		Scanner scanner = new Scanner(System.in);
		input = scanner.nextLine();

		return Integer.parseInt(input);
	}

	public static void pizzaParty(int people, int pizza, int pieces){

		System.out.println(people + " people with " + pizza);

		int totalPieces = pizza * pieces;

		int eachPieces = totalPieces / people;

		int leftPieces = totalPieces % people;

		System.out.println("Each person gets " + eachPieces + " pieces of pizza");

		System.out.println("There are " + leftPieces + " leftover pieces.");

	}

}