text:
@{
 GroupName = 'Character Operations'
 Name = 'Fix Whitespace Following Backtick'
 Description = 'Remove Whitespace that follow a backtick'
 IgnoreSyntaxErrors = $false
 Tooltip = @'
When you use a backtick for line continuation, there must not follow any code in the same line after the backtick.
If there are spaces following the backtick, then they are hard to recognize and will lead to unexpected results.
This unit identifies these situations and removes any whitespace following a line continuation backtick.
'@
 #Icon = 'image.png'
 Script = 'BacktickSpace.ps1'
 RecommendedOrder = 1
 GUID = 'd7c58cec-46b5-4b04-925f-123315350ce3'
 GroupGUID = '272339ac-7e52-4fa5-9413-b8ae5063cb09'

}

redpajama_set_name: RedPajamaGithub


text:
#ifndef EXPRESSION_H
#define EXPRESSION_H

#include <QList>
#include "kernel_global.h"

namespace Ilwis {
    class SymbolTable;

    enum OperationType{otUnknown=0,otFunction=1, otCommand=2, otSelection=4};

class KERNELSHARED_EXPORT Parameter : public Identity{
public:

    enum PathType{ptNONE, ptLOCALOBJECT, ptREMOTE, ptIRRELEVANT};

    Parameter();
    Parameter(const QString& name, const QString& value, IlwisTypes ,const SymbolTable& );
    Parameter(const QString& value, IlwisTypes, const SymbolTable &);
    virtual ~Parameter();
    QString value() const;
    QString domain() const;
    void domain(const QString& dom);
    IlwisTypes valuetype() const;
    bool isEqual(const Parameter& parm) const;
    bool isValid() const;
    Parameter::PathType pathType() const;
    static IlwisTypes determineType(const QString &value, const SymbolTable& symtab) ;

private:
    QString _key;
    QString _value;
    IlwisTypes _type;
    QString _domain;
};

/*!
 The OperationExpression class a parser for fully defined expressions. This class will parse expressions of the type function and command and split it into its parts. The assumption is that the expression is already parsed to a level that all parts can not be parsed further.
 more complex expressions need first go to the calculator to be reduced to this level. Note that functions have a fixed order of parameters v = func(a,b) is different from b fun(b,a)
 */
class KERNELSHARED_EXPORT OperationExpression
{
public:
    /*!
     *  OperationExpression empty expression
     */
    OperationExpression();
    ~OperationExpression();
    /*!
     * Constructs an expression object of an textual expression.
     *
     *Expressions have either the form of a function which takes the form of output*={id}(paramteres*) or a command with the form {id} (paramters)*. The class will splt this in
     *ids, input parametrs and return parameters
     *
     * \param expr textual form of the expression
     * \param type enum marking the type of the expression, function or command.
     */
    OperationExpression(const QString& expr, const SymbolTable& symtab=SymbolTable());
    /*!
     *  returns the parameter at a defined placed in either the input or the output
     * \param index rank order number of the parameters to be returned
     * \param in input parameter or output parameter
     * \return a parameter
     */
    Parameter parm(int index, bool in=true) const;
    /*!
     *  returns the parameter at a defined name in either the input or the output
     * \param key name of the parameters to be returned
     * \param toLower name will be in lowercase (or not)
     * \param in input parameter or output parameter
     * \return a parameter
     */

    Parameter parm(const QString key, bool toLower=true, bool in=true) const;
    /*!
     *  name returns the name of the command or function
     * \param toLower toLower name will be in lowercase (or not)
     * \return the function/command id
     */
    QString name(bool toLower=true) const;
    /*!
     *  parameterCount returns the number of input or outparameters
     * \param in input or output
     * \return count
     */
    int parameterCount(bool in=true) const;
    /*!
     *  isValid minimum condition for an expression to be valid, it must have a name
     *
     *  An expression might have no return types and no parameters but it always must have a name
     * \return true if there is a name
     */
    bool isValid() const;
    bool isRemote() const;
    QUrl metaUrl(bool simple=true) const;
    void setExpression(const QString &e, const SymbolTable &symtab);
    bool matchesParameterCount(const QString &match, bool in=true) const;
    QString toString(bool rightsideonly=false) const;
    template<typename T> T input(quint32 ) { return T(); }
    template<typename T> T input(quint32, bool& ok ) { return T(); }
private:
    QString _name;
    QList<Parameter> _inParameters;
    QList<Parameter> _outParameters;
    OperationType _type;
    QString _selection;
    bool _isRemote = false;

    void parseFunctionExpression(const QString &txt, const SymbolTable &symtab);
    void parseCommandExpression(const QString &expr, const SymbolTable &symtab);
    void parseSelectors(const QString& selectors, const SymbolTable &symtab);
    void specialExpressions(const QString &e, const SymbolTable &symtab);
};

template<> inline int OperationExpression::input<qint32>(quint32 parmIndex, bool& ok) {
    return parm(parmIndex).value().toInt(&ok);
}

template<> inline int OperationExpression::input<qint32>(quint32 parmIndex) {
    return parm(parmIndex).value().toInt();
}

template<> inline quint32 OperationExpression::input<quint32>(quint32 parmIndex, bool& ok) {
    return parm(parmIndex).value().toUInt(&ok);
}

template<> inline quint32 OperationExpression::input<quint32>(quint32 parmIndex) {
    return parm(parmIndex).value().toUInt();
}

template<> inline double OperationExpression::input<double>(quint32 parmIndex, bool& ok) {
    return parm(parmIndex).value().toDouble(&ok);
}

template<> inline double OperationExpression::input<double>(quint32 parmIndex) {
    return parm(parmIndex).value().toDouble();
}

template<> inline QString OperationExpression::input<QString>(quint32 parmIndex) {
    return parm(parmIndex).value();
}

template<> inline bool OperationExpression::input<bool>(quint32 parmIndex) {
    QString v = parm(parmIndex).value().toLower();
    return v == "yes" || v == "true";
}

}

#endif // EXPRESSION_H


text:
//
// Copyright (C) 2017, NinjaTrader LLC <www.ninjatrader.com>.
// NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
//
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
#endregion

//This namespace holds indicators in this folder and is required. Do not change it.
namespace HaiFeng
{
	/// <summary>
	/// 抛物线指标
	/// Parabolic SAR according to Stocks and Commodities magazine V 11:11 (477-479).
	/// </summary>
	public class ParabolicSAR : Indicator
	{
		private double af;      // Acceleration factor
		private bool afIncreased;
		private bool longPosition;
		private int prevBar;
		private double prevSAR;
		private int reverseBar;
		private double reverseValue;
		private double todaySAR;        // SAR value
		private double xp;      // Extreme Price

		internal DataSeries High, Low;
		//DataSeries Close;   //只在Close被修改时才会触发指标计算,以避免多个input造成指标计算多次的性能问题.

		protected override void Init()
		{
			xp = 0.0;
			af = 0;
			todaySAR = 0;
			prevSAR = 0;
			reverseBar = 0;
			reverseValue = 0;
			prevBar = 0;
			afIncreased = false;
		}

		protected override void OnBarUpdate()
		{
			int CurrentBar = Input.Count - 1;

			if (CurrentBar < 3)
				return;

			if (CurrentBar == 3)
			{
				// Determine initial position
				longPosition = High[0] > High[1];
				xp = longPosition ? High.Highest(0, CurrentBar) : Low.Lowest(0, CurrentBar);
				af = Acceleration;
				Value[0] = xp + (longPosition ? -1 : 1) * (High.Highest(0, CurrentBar) - Low.Lowest(0, CurrentBar)) * af;
				return;
			}

			// Reset accelerator increase limiter on new bars
			if (afIncreased && prevBar != CurrentBar)
				afIncreased = false;

			// Current event is on a bar not marked as a reversal bar yet
			if (reverseBar != CurrentBar)
			{
				// SAR = SAR[1] + af * (xp - SAR[1])
				todaySAR = TodaySAR(Value[1] + af * (xp - Value[1]));
				for (int x = 1; x <= 2; x++)
				{
					if (longPosition)
					{
						if (todaySAR > Low[x])
							todaySAR = Low[x];
					}
					else
					{
						if (todaySAR < High[x])
							todaySAR = High[x];
					}
				}

				// Holding long position
				if (longPosition)
				{
					// Process a new SAR value only on a new bar or if SAR value was penetrated.
					if (prevBar != CurrentBar || Low[0] < prevSAR)
					{
						Value[0] = todaySAR;
						prevSAR = todaySAR;
					}
					else
						Value[0] = prevSAR;

					if (High[0] > xp)
					{
						xp = High[0];
						AfIncrease();
					}
				}

				// Holding short position
				else if (!longPosition)
				{
					// Process a new SAR value only on a new bar or if SAR value was penetrated.
					if (prevBar != CurrentBar || High[0] > prevSAR)
					{
						Value[0] = todaySAR;
						prevSAR = todaySAR;
					}
					else
						Value[0] = prevSAR;

					if (Low[0] < xp)
					{
						xp = Low[0];
						AfIncrease();
					}
				}
			}

			// Current event is on the same bar as the reversal bar
			else
			{
				// Only set new xp values. No increasing af since this is the first bar.
				if (longPosition && High[0] > xp)
					xp = High[0];
				else if (!longPosition && Low[0] < xp)
					xp = Low[0];

				Value[0] = prevSAR;

				// SAR = SAR[1] + af * (xp - SAR[1])
				todaySAR = TodaySAR(longPosition ? Math.Min(reverseValue, Low[0]) : Math.Max(reverseValue, High[0]));
			}

			prevBar = CurrentBar;

			// Reverse position
			if ((longPosition && (Low[0] < todaySAR || Low[1] < todaySAR))
				|| (!longPosition && (High[0] > todaySAR || High[1] > todaySAR)))
				Value[0] = Reverse();

		}

		#region Miscellaneous
		// Only raise accelerator if not raised for current bar yet
		private void AfIncrease()
		{
			if (!afIncreased)
			{
				af = Math.Min(AccelerationMax, af + AccelerationStep);
				afIncreased = true;
			}
		}

		// Additional rule. SAR for today can't be placed inside the bar of day - 1 or day - 2.
		private double TodaySAR(double todaySAR)
		{
			if (longPosition)
			{
				double lowestSAR = Math.Min(Math.Min(todaySAR, Low[0]), Low[1]);
				if (Low[0] > lowestSAR)
					todaySAR = lowestSAR;
			}
			else
			{
				double highestSAR = Math.Max(Math.Max(todaySAR, High[0]), High[1]);
				if (High[0] < highestSAR)
					todaySAR = highestSAR;
			}
			return todaySAR;
		}

		private double Reverse()
		{
			double todaySAR = xp;

			if ((longPosition && prevSAR > Low[0]) || (!longPosition && prevSAR < High[0]) || prevBar != CurrentBar)
			{
				longPosition = !longPosition;
				reverseBar = CurrentBar;
				reverseValue = xp;
				af = Acceleration;
				xp = longPosition ? High[0] : Low[0];
				prevSAR = todaySAR;
			}
			else
				todaySAR = prevSAR;
			return todaySAR;
		}
		#endregion

		#region
		[Range(0.00, double.MaxValue)]
		[Parameter("Acceleration")]
		public double Acceleration { get; set; }

		[Range(0.001, double.MaxValue)]
		[Parameter("AccelerationMax")]
		public double AccelerationMax { get; set; }

		[Range(0.001, double.MaxValue)]
		[Parameter("AccelerationStep")]
		public double AccelerationStep { get; set; }
		#endregion
	}

	#region generated code. Neither change nor remove.

	public partial class Indicator
	{
		private ParabolicSAR[] cacheParabolicSAR;

		public ParabolicSAR ParabolicSAR(DataSeries high, DataSeries low, DataSeries close, double acceleration, double accelerationMax, double accelerationStep)
		{
			var cat = cacheParabolicSAR;
			if (cacheParabolicSAR != null)
				for (int idx = 0; idx < cacheParabolicSAR.Length; idx++)
					if (cacheParabolicSAR[idx] != null && cacheParabolicSAR[idx].Acceleration == acceleration && cacheParabolicSAR[idx].AccelerationMax == accelerationMax&& cat[idx].High==high&&cat[idx].Low==low && cacheParabolicSAR[idx].AccelerationStep == accelerationStep && cat[idx].High == high && cat[idx].Low == low && cacheParabolicSAR[idx].EqualsInput(close))
						return cacheParabolicSAR[idx];
			return CacheIndicator<ParabolicSAR>(new ParabolicSAR() { Acceleration = acceleration, AccelerationMax = accelerationMax, AccelerationStep = accelerationStep, High = high, Low = low, Input = close }, ref cacheParabolicSAR);
		}
	}

	public partial class Strategy
	{
		public ParabolicSAR ParabolicSAR(double acceleration, double accelerationMax, double accelerationStep)
		{
			return ParabolicSAR(Datas[0], acceleration, accelerationMax, accelerationStep);
		}

		public ParabolicSAR ParabolicSAR(Data data, double acceleration, double accelerationMax, double accelerationStep)
		{
			return Indicator.ParabolicSAR(data.H, data.L, data.C, acceleration, accelerationMax, accelerationStep);
		}
	}
}

#endregion


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

<title>NUnit - Description</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-US">
<link rel="stylesheet" type="text/css" href="nunit.css">
<link rel="shortcut icon" href="favicon.ico">

    NUnit
    Documentation

Description (NUnit 2.4)

The Description attribute is used to apply descriptive text to a Test,
TestFixture or Assembly. The text appears in the XML output file and is
shown in the Test Properties dialog.

Example:

		C#

		VB

		C++

		J#

[assembly: Description("Assembly description here")]

namespace NUnit.Tests
{
  using System;
  using NUnit.Framework;

  [TestFixture, Description("Fixture description here")]
  public class SomeTests
  {
    [Test, Description("Test description here")]
    public void OneTest()
    { /* ... */ }
  }
}

<assembly: Description("Assembly description here")>

Imports System
Imports Nunit.Framework

Namespace Nunit.Tests

  <TestFixture(), Description("Fixture description here")>_
  Public Class SomeTests
    <Test(), Description("Test description here")>_
    Public Sub OneTest()
    ' ...
    End Sub
  End Class
End Namespace

[assembly:Description("Assembly description here")]

#using <Nunit.Framework.dll>
using namespace System;
using namespace NUnit::Framework;

namespace NUnitTests
{
  [TestFixture, Description("Fixture description here")]
  public __gc class SomeTests
  {
    [Test, Description("Test description here")]
    void OneTest();
  };
}

#include "cppsample.h"

namespace NUnitTests {
  // ...
}

/** @assembly NUnit.Framework.Description("Assembly description here") */

package NUnit.Tests;

import System.*;
import NUnit.Framework.TestFixture;

/** @attribute NUnit.Framework.TestFixture() */
/** @attribute NUnit.Framework.Description("Fixture description here") */
public class SomeTests
{
  /** @attribute NUnit.Framework.Test() */
  /** @attribute NUnit.Framework.Description("Test description here") */
  public void OneTest()
  { /* ... */ }
}

Note: The Test and TestFixture attributes continue to support an
optional Description property. The Description attribute should be used for
new applciations. If both are used, the Description attribute takes precedence.

NUnit 2.5.10

Getting Started

Assertions

Constraints

Attributes

Category

Combinatorial

Culture

Datapoint(s)

Description

Exception

Explicit

Ignore

Maxtime

Pairwise

Platform

Property

Random

Range

Repeat

RequiredAddin

Requires MTA

Requires STA

Requires Thread

Sequential

SetCulture

SetUICulture

Setup

SetupFixture

Suite

Teardown

Test

TestCase

TestCaseSource

TestFixture

TestFixtureSetUp

TestFixtureTearDown

Theory

Timeout

Values

ValueSource

Running Tests

Extensibility

Release Notes

Samples

License

  Copyright © 2010 Charlie Poole. All Rights Reserved.


text:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

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

/**
 * ExpressionEngine Pages Module
 *
 * @package		ExpressionEngine
 * @subpackage	Modules
 * @category	Modules
 * @author		EllisLab Dev Team
 * @link		http://ellislab.com
 */
class Pages {

	/**
	 * Constructor
	 *
	 * @access	public
	 */
	function Pages()
	{
		// Make a local reference to the ExpressionEngine super object
		$this->EE =& get_instance();
	}

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

	/**
	 * Output Javascript
	 *
	 * Outputs Javascript files, triggered most commonly by an action request,
	 * but also available as a tag if desired.
	 *
	 * @access	public
	 * @return	string
	 */
	function load_site_pages()
	{
        $sites			= ee()->TMPL->fetch_param('site', '');
		$current_site	= ee()->config->item('site_short_name');

		// Always include the current site

		$site_names = explode('|', $sites);

		if ( ! in_array($current_site, $site_names))
		{
			$site_names[] = $current_site;
		}

		// Fetch all pages

		ee()->db->select('site_pages, site_name, site_id');
		ee()->db->where_in('site_name', $site_names);
		$query = ee()->db->get('sites');

		$new_pages = array();

		if ($query->num_rows() > 0)
		{
			foreach($query->result_array() as $row)
			{
				$site_pages = unserialize(base64_decode($row['site_pages']));

				if (is_array($site_pages))
				{
					$new_pages += $site_pages;
				}
			}
		}

		// Update config

		ee()->config->set_item('site_pages', $new_pages);

		return '';
	}
}
// End Pages Class

/* End of file mod.pages.php */
/* Location: ./system/expressionengine/modules/pages/mod.pages.php */


text:
static const char metal_model_unlit_ps[] = R"(mtlcode
#pragma clang diagnostic ignored "-Wmissing-prototypes"

#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

struct PS_Input
{
    float4 PosVS;
    float4 Color;
    float2 UV;
    float4 PosP;
};

struct PS_ConstanBuffer
{
    float4 fLightDirection;
    float4 fLightColor;
    float4 fLightAmbient;
    float4 fFlipbookParameter;
    float4 fUVDistortionParameter;
    float4 fBlendTextureParameter;
    float4 fCameraFrontDirection;
    float4 fFalloffParameter;
    float4 fFalloffBeginColor;
    float4 fFalloffEndColor;
    float4 fEmissiveScaling;
    float4 fEdgeColor;
    float4 fEdgeParameter;
    float4 softParticleParam;
    float4 reconstructionParam1;
    float4 reconstructionParam2;
    float4 mUVInversedBack;
    float4 miscFlags;
};

struct main0_out
{
    float4 _entryPointOutput [[color(0)]];
};

struct main0_in
{
    float4 Input_Color [[user(locn0), centroid_perspective]];
    float2 Input_UV [[user(locn1), centroid_perspective]];
    float4 Input_PosP [[user(locn2)]];
};

static inline __attribute__((always_inline))
float3 PositivePow(thread const float3& base, thread const float3& power)
{
    return pow(fast::max(abs(base), float3(1.1920928955078125e-07)), power);
}

static inline __attribute__((always_inline))
float3 LinearToSRGB(thread const float3& c)
{
    float3 param = c;
    float3 param_1 = float3(0.4166666567325592041015625);
    return fast::max((PositivePow(param, param_1) * 1.05499994754791259765625) - float3(0.054999999701976776123046875), float3(0.0));
}

static inline __attribute__((always_inline))
float4 LinearToSRGB(thread const float4& c)
{
    float3 param = c.xyz;
    return float4(LinearToSRGB(param), c.w);
}

static inline __attribute__((always_inline))
float4 ConvertFromSRGBTexture(thread const float4& c, thread const bool& isValid)
{
    if (!isValid)
    {
        return c;
    }
    float4 param = c;
    return LinearToSRGB(param);
}

static inline __attribute__((always_inline))
float SoftParticle(thread const float& backgroundZ, thread const float& meshZ, thread const float4& softparticleParam, thread const float4& reconstruct1, thread const float4& reconstruct2)
{
    float distanceFar = softparticleParam.x;
    float distanceNear = softparticleParam.y;
    float distanceNearOffset = softparticleParam.z;
    float2 rescale = reconstruct1.xy;
    float4 params = reconstruct2;
    float2 zs = float2((backgroundZ * rescale.x) + rescale.y, meshZ);
    float2 depth = ((zs * params.w) - float2(params.y)) / (float2(params.x) - (zs * params.z));
    float dir = sign(depth.x);
    depth *= dir;
    float alphaFar = (depth.x - depth.y) / distanceFar;
    float alphaNear = (depth.y - distanceNearOffset) / distanceNear;
    return fast::min(fast::max(fast::min(alphaFar, alphaNear), 0.0), 1.0);
}

static inline __attribute__((always_inline))
float3 SRGBToLinear(thread const float3& c)
{
    return fast::min(c, c * ((c * ((c * 0.305306017398834228515625) + float3(0.6821711063385009765625))) + float3(0.01252287812530994415283203125)));
}

static inline __attribute__((always_inline))
float4 SRGBToLinear(thread const float4& c)
{
    float3 param = c.xyz;
    return float4(SRGBToLinear(param), c.w);
}

static inline __attribute__((always_inline))
float4 ConvertToScreen(thread const float4& c, thread const bool& isValid)
{
    if (!isValid)
    {
        return c;
    }
    float4 param = c;
    return SRGBToLinear(param);
}

static inline __attribute__((always_inline))
float4 _main(PS_Input Input, constant PS_ConstanBuffer& v_225, thread texture2d<float> _colorTex, thread sampler sampler_colorTex, thread texture2d<float> _depthTex, thread sampler sampler_depthTex)
{
    bool convertColorSpace = (isunordered(v_225.miscFlags.x, 0.0) || v_225.miscFlags.x != 0.0);
    float4 param = _colorTex.sample(sampler_colorTex, Input.UV);
    bool param_1 = convertColorSpace;
    float4 Output = ConvertFromSRGBTexture(param, param_1) * Input.Color;
    float3 _258 = Output.xyz * v_225.fEmissiveScaling.x;
    Output = float4(_258.x, _258.y, _258.z, Output.w);
    float4 screenPos = Input.PosP / float4(Input.PosP.w);
    float2 screenUV = (screenPos.xy + float2(1.0)) / float2(2.0);
    screenUV.y = 1.0 - screenUV.y;
    screenUV.y = v_225.mUVInversedBack.x + (v_225.mUVInversedBack.y * screenUV.y);
    if ((isunordered(v_225.softParticleParam.w, 0.0) || v_225.softParticleParam.w != 0.0))
    {
        float backgroundZ = _depthTex.sample(sampler_depthTex, screenUV).x;
        float param_2 = backgroundZ;
        float param_3 = screenPos.z;
        float4 param_4 = v_225.softParticleParam;
        float4 param_5 = v_225.reconstructionParam1;
        float4 param_6 = v_225.reconstructionParam2;
        Output.w *= SoftParticle(param_2, param_3, param_4, param_5, param_6);
    }
    if (Output.w == 0.0)
    {
        discard_fragment();
    }
    float4 param_7 = Output;
    bool param_8 = convertColorSpace;
    return ConvertToScreen(param_7, param_8);
}

fragment main0_out main0(main0_in in [[stage_in]], constant PS_ConstanBuffer& v_225 [[buffer(0)]], texture2d<float> _colorTex [[texture(0)]], texture2d<float> _depthTex [[texture(1)]], sampler sampler_colorTex [[sampler(0)]], sampler sampler_depthTex [[sampler(1)]], float4 gl_FragCoord [[position]])
{
    main0_out out = {};
    PS_Input Input;
    Input.PosVS = gl_FragCoord;
    Input.Color = in.Input_Color;
    Input.UV = in.Input_UV;
    Input.PosP = in.Input_PosP;
    float4 _359 = _main(Input, v_225, _colorTex, sampler_colorTex, _depthTex, sampler_depthTex);
    out._entryPointOutput = _359;
    return out;
}

)";


text:
void printUsage(const char *execName, int exitCode)
{
  std::cout << execName << " <input-header-list> <output-hmap>" << std::endl;
  exit(exitCode);
}

void readStrings(const String& inputFile, StringVec& inVec)
{
  std::ifstream inFile(inputFile.c_str());
  sbValidate(inFile.is_open(), "Failed to open \"" + inputFile + "\" input file for reading.");

  String line;
  while (getline(inFile, line)) {
    inVec.push_back(line);
  }
  inFile.close();
}

void writeHMap(const String& outputFile, const StringVec& inVec)
{
  IncludeMapMaker hmap;

  std::ofstream outFile(outputFile.c_str(), std::ofstream::out | std::ofstream::binary);
  sbValidate(outFile.is_open(), "Failed to open \"" + outputFile + "\" output file for writing.");

  StringVec::const_iterator it = inVec.begin();
  for (; it != inVec.end(); ++it) {
    hmap.addMapping(sb_basename(*it), *it);
  }

  hmap.writeMap(outFile);
  outFile.close();
}

int main(int argc, const char* argv[])
{
  if (argc != 3)
    printUsage(argv[0], -1);

  String inputFile(argv[1]);
  String outputFile(argv[2]);

  // Read in the input file
  StringVec inVec;
  readStrings(inputFile, inVec);

  // Write header map
  writeHMap(outputFile, inVec);
}


text:
$(document).ready(function() {
	$('#overlay').show();

	init();
});

function init() {
	loadData();
}

var data = null;
var mirrors = null;

var mcountry = null;
var mprovider = null;

var default_mirror = null;

function loadData() {
	$.getJSON("data/data.json", function(d) {
		data = d;
		loadReleases();
		loadComponents();
		loadExtra();
		loadMirrorsData(data.mirrors_data);
	});
}

function loadReleases() {
	$('#release').empty();
	$.each(data.releases, function(k, val) {
		var code = val.code;
		var label = data.dist + ' ' + val.ver + ' ' + val.name;
		var selected = "";
		if (val.selected == 1) {
			selected = ' selected="selected"';
		}

		$('#release').append('<option value="'+code+'"'+selected+'">'+label+'</option>');
	});
}

function loadComponents() {
	$('#component').empty();
	for (var code in data.components) {
		var label = data.components[code].label;
		var selected = data.components[code].selected;

		var checked = '';
		if (selected == 1) {
			 checked = ' checked="checked"';
		}

		$('#component').append('
<input type="checkbox" value="'+code+'"'+checked+'/>'+label+'
');

	}
}

function loadExtra() {
	$('#extra').empty();
	for (var code in data.extra) {
		var label = data.extra[code].label;
		var selected = data.extra[code].selected;

		var checked = '';
		if (selected == 1) {
			 checked = ' checked="checked"';
		}

		$('#extra').append('
<input type="checkbox" value="'+code+'"'+checked+'/>'+label+'
');

	}
}

function loadMirrorsData(data_file) {
	$.getJSON(data_file, function(d) {
		mirrors = d;
		loadMirrors();
	});
}

function loadMirrors() {
	$('#country').empty();
	$('#country').append("<option value='+main'>Main Server</option>");
	$('#country').append("<option value='+other'>Other..</option>");

	$('#country').append('<optgroup label="Countries"></optgroup>');
	var cc = $('#country').find('optgroup');

	$.each(mirrors.mirrors, function(key, val) {
		cc.append("<option value='"+key+"'>"+key+"</option>");
	});
	updateProviders();

	$('#overlay').hide();

	$('#country').change(function() {
		updateProviders();
	});

	$('#provider').change(function() {
		updateProtocols();
	});

	for (var key in data.main_mirrors) {
		default_mirror = data.main_mirrors[key];
		break;
	}

	$('#othermirror').val(default_mirror);
	$('span.othermirror strong').text(default_mirror);
	$('span.othermirror strong').click(function() {
		$('#othermirror').val(default_mirror);
		$('#othermirror').select();
	});
}

function updateProviders() {
	var country = $('#country').val();

	$('p.othermirror').hide();
	$('p.protocol').show();
	$('p.provider').show();

	if (country == "+main") {
		$('p.provider').hide();
		updateProtocols(data.main_mirrors);
		return;
	}
	else if (country == "+other") {
		$('p.provider').hide();
		$('p.protocol').hide();
		$('p.othermirror').show();
		$('#othermirror').focus();
		$('#othermirror').select();
	}

	mcountry = mirrors.mirrors[country];

	$('#provider').empty();
	$.each(mcountry.mirrors, function(key, val) {
		var url = val.mirrors.http;
		if (url == undefined) {
			url = val.mirrors.ftp;
		}
		$('#provider').append("<option value='"+key+"'>"+key+"</option>");
	});

	updateProtocols();

}

function updateProtocols(data) {

	if (data == undefined) {
		var name = $('#provider').val();
		mprovider = mcountry.mirrors[name];
		data = mprovider.mirrors;
	}

	$('#protocol').empty();
	$.each(data, function(protocol, url) {
		$('#protocol').append('<option value="'+url+'">'+protocol+'</option>');
	});

}

function generate() {

	var release = $('#release').val();

	var base = $('#protocol').val();
	if ($('#country').val() == "+other") {
		base = $('#othermirror').val();
	}

	var ca = [];
	$('#component input[type="checkbox"]:checked').each(function() {
		ca.push($(this).val());
	});
	var components = ca.join(" ");

	var repos = [''];
	$('#extra input[type="checkbox"]:checked').each(function() {
		repos.push("-" + $(this).val());
	});

	var source = $('#source')[0].checked;

	var txt = "";
	var i, len = repos.length;
	for (i=0; i<len; i++) {

		txt += "deb " + base + " " + release + repos[i] + " " + components;
		if (source) {
			txt += "\ndeb-src " + base + " " + release + repos[i] + " " + components;
		}

		if (i<len-1) {
			txt += "\n\n";
		}
	}

	$('#sourceslist pre code').text(txt);
	$('#sourceslist').show();
}


text:
<?php

namespace Parable\Tests\TestClasses;

class CyclicB
{
    public function __construct(\Parable\Tests\TestClasses\CyclicA $a)
    {
    }
}


text:
import struct
import socket
import logging
import gevent

from ryu.ofproto import inet
from ryu.ofproto import ofproto_v1_2
from ryu.ofproto import ofproto_v1_2_parser
from ryu.lib import mac

LOG = logging.getLogger('ryu.lib.ofctl_v1_2')

DEFAULT_TIMEOUT = 1.0

def to_actions(dp, acts):
    inst = []

    for a in acts:
        action_type = a.get('type')
        if action_type == 'OUTPUT':
            out_port = int(a.get('port', ofproto_v1_2.OFPP_ANY))
            actions = [dp.ofproto_parser.OFPActionOutput(out_port, 0)]
            inst_type = dp.ofproto.OFPIT_APPLY_ACTIONS
            inst = [dp.ofproto_parser.OFPInstructionActions(
                    inst_type, actions)]
        else:
            LOG.debug('Unknown action type')

    return inst

def actions_to_str(instructions):
    actions = []

    for instruction in instructions:
        for a in instruction.actions:
            action_type = a.cls_action_type

            if action_type == ofproto_v1_2.OFPAT_OUTPUT:
                buf = 'OUTPUT:' + str(a.port)
            else:
                buf = 'UNKNOWN'
            actions.append(buf)

    return actions

def to_match(dp, attrs):
    match = dp.ofproto_parser.OFPMatch()

    convert = {'in_port': int,
               'dl_src': mac.haddr_to_bin,
               'dl_dst': mac.haddr_to_bin,
               'dl_type': int,
               'dl_vlan': int,
               'nw_src': to_match_ip,
               'nw_dst': to_match_ip,
               'nw_proto': int,
               'tp_src': int,
               'tp_dst': int}

    match_append = {'in_port': match.set_in_port,
                    'dl_src': match.set_dl_src,
                    'dl_dst': match.set_dl_dst,
                    'dl_type': match.set_dl_type,
                    'dl_vlan': match.set_vlan_vid,
                    'nw_src': match.set_ipv4_src_masked,
                    'nw_dst': match.set_ipv4_dst_masked,
                    'nw_proto': match.set_ip_proto,
                    'tp_src': to_match_tpsrc,
                    'tp_dst': to_match_tpdst}

    for key, value in attrs.items():
        if key in convert:
            value = convert[key](value)
        if key in match_append:
            if key == 'nw_src' or key == 'nw_dst':
                # IP address
                ip = value[0]
                mask = value[1]
                match_append[key](ip, mask)
            elif key == 'tp_src' or key == 'tp_dst':
                # tp_src/dst
                match = match_append[key](value, match, attrs)
            else:
                # others
                match_append[key](value)

    return match

def to_match_tpsrc(value, match, rest):
    match_append = {inet.IPPROTO_TCP: match.set_tcp_src,
                    inet.IPPROTO_UDP: match.set_udp_src}

    nw_proto = rest.get('nw_proto', 0)
    if nw_proto in match_append:
        match_append[nw_proto](value)

    return match

def to_match_tpdst(value, match, rest):
    match_append = {inet.IPPROTO_TCP: match.set_tcp_dst,
                    inet.IPPROTO_UDP: match.set_udp_dst}

    nw_proto = rest.get('nw_proto', 0)
    if nw_proto in match_append:
        match_append[nw_proto](value)

    return match

def to_match_ip(value):
    ip_mask = value.split('/')
    # ip
    ipv4 = struct.unpack('!I', socket.inet_aton(ip_mask[0]))[0]
    # netmask
    mask = 32
    if len(ip_mask) == 2:
        mask = int(ip_mask[1])
    netmask = ofproto_v1_2_parser.UINT32_MAX << 32 - mask\
        & ofproto_v1_2_parser.UINT32_MAX

    return ipv4, netmask

def match_to_str(ofmatch):
    keys = {ofproto_v1_2.OXM_OF_IN_PORT: 'in_port',
            ofproto_v1_2.OXM_OF_ETH_SRC: 'dl_src',
            ofproto_v1_2.OXM_OF_ETH_DST: 'dl_dst',
            ofproto_v1_2.OXM_OF_ETH_TYPE: 'dl_type',
            ofproto_v1_2.OXM_OF_VLAN_VID: 'dl_vlan',
            ofproto_v1_2.OXM_OF_IPV4_SRC: 'nw_src',
            ofproto_v1_2.OXM_OF_IPV4_DST: 'nw_dst',
            ofproto_v1_2.OXM_OF_IPV4_SRC_W: 'nw_src',
            ofproto_v1_2.OXM_OF_IPV4_DST_W: 'nw_dst',
            ofproto_v1_2.OXM_OF_IP_PROTO: 'nw_proto',
            ofproto_v1_2.OXM_OF_TCP_SRC: 'tp_src',
            ofproto_v1_2.OXM_OF_TCP_DST: 'tp_dst',
            ofproto_v1_2.OXM_OF_UDP_SRC: 'tp_src',
            ofproto_v1_2.OXM_OF_UDP_DST: 'tp_dst'}

    match = {}
    for match_field in ofmatch.fields:
        key = keys[match_field.header]
        if key == 'dl_src' or key == 'dl_dst':
            value = mac.haddr_to_str(match_field.value)
        elif key == 'nw_src' or key == 'nw_dst':
            value = match_ip_to_str(match_field.value, match_field.mask)
        else:
            value = match_field.value
        match.setdefault(key, value)

    return match

def match_ip_to_str(value, mask):
    ip = socket.inet_ntoa(struct.pack('!I', value))

    if mask is not None and mask != 0:
        binary_str = bin(mask)[2:].zfill(8)
        netmask = '/%d' % len(binary_str.rstrip('0'))
    else:
        netmask = ''

    return ip + netmask

def send_stats_request(dp, stats, waiters, msgs):
    dp.set_xid(stats)
    waiters_per_dp = waiters.setdefault(dp.id, {})
    lock = gevent.event.AsyncResult()
    waiters_per_dp[stats.xid] = (lock, msgs)
    dp.send_msg(stats)

    try:
        lock.get(timeout=DEFAULT_TIMEOUT)
    except gevent.Timeout:
        del waiters_per_dp[stats.xid]

def get_flow_stats(dp, waiters):
    table_id = 0
    out_port = dp.ofproto.OFPP_ANY
    out_group = dp.ofproto.OFPG_ANY
    cookie = 0
    cookie_mask = 0
    match = dp.ofproto_parser.OFPMatch()

    stats = dp.ofproto_parser.OFPFlowStatsRequest(
        dp, table_id, out_port, out_group, cookie, cookie_mask, match)

    msgs = []
    send_stats_request(dp, stats, waiters, msgs)

    flows = []
    for msg in msgs:
        for stats in msg.body:
            actions = actions_to_str(stats.instructions)
            match = match_to_str(stats.match)

            s = {'priority': stats.priority,
                 'cookie': stats.cookie,
                 'idle_timeout': stats.idle_timeout,
                 'hard_timeout': stats.hard_timeout,
                 'actions': actions,
                 'match': match,
                 'byte_count': stats.byte_count,
                 'duration_sec': stats.duration_sec,
                 'duration_nsec': stats.duration_nsec,
                 'packet_count': stats.packet_count,
                 'table_id': stats.table_id}
            flows.append(s)
    flows = {str(dp.id): flows}

    return flows

def mod_flow_entry(dp, flow, cmd):
    cookie = int(flow.get('cookie', 0))
    cookie_mask = int(flow.get('cookie_mask', 0))
    table_id = int(flow.get('table_id', 0))
    idle_timeout = int(flow.get('idle_timeout', 0))
    hard_timeout = int(flow.get('hard_timeout', 0))
    priority = int(flow.get('priority', 0))
    buffer_id = int(flow.get('buffer_id', 0xffffffff))
    out_port = int(flow.get('out_port', dp.ofproto.OFPP_ANY))
    out_group = int(flow.get('out_group', dp.ofproto.OFPG_ANY))
    flags = int(flow.get('flags', 0))
    match = to_match(dp, flow.get('match', {}))
    inst = to_actions(dp, flow.get('actions', {}))

    flow_mod = dp.ofproto_parser.OFPFlowMod(
        dp, cookie, cookie_mask, table_id, cmd, idle_timeout,
        hard_timeout, priority, buffer_id, out_port, out_group,
        flags, match, inst)

    dp.send_msg(flow_mod)


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using Maze.Domain;
using Maze.Domain.Points;
using Maze.Domain.Service;

namespace Maze.Repository
{
    public class MazeMapRepository: IMazeMapRepository
{
        public MazeMap GetMazeMap(string filePath)
        {
            try
            {
                if (!File.Exists(filePath))
                {
                    throw new IOException("File not found: " + filePath);
                }

                var rows = GetDataLines(filePath).ToList();

                MazePoint start = null;
                MazePoint goal = null;
                var mazeMap = new MazePoint[rows.Count, rows[0].Length];

                //TODO: Maybe this belongs to a Creation Method.
                var i = 0;
                foreach (var row in rows)
                {
                    var cols = row.ToCharArray();
                    var j = 0;
                    foreach (var col in cols)
                    {
                        MazePoint point;
                        switch (col)
                        {
                            case 'S':
                                point = new StartPoint(i, j);
                                start = point;
                                break;
                            case 'G':
                                point = new GoalPoint(i, j);
                                goal = point;
                                break;
                            case '_':
                                point = new EmptyPoint(i, j);
                                break;
                            case 'X':
                                point = new WallPoint(i, j);
                                break;
                            default:
                                throw new InvalidDataException();
                        }
                        mazeMap[i, j] = point;

                        j++;
                    }
                    i++;
                }

                return new MazeMap(start, goal, mazeMap);
            }
            catch (Exception e)
            {
                //TODO: log exception
                throw;
            }
        }

        private static IEnumerable<string> GetDataLines(string dataFile)
        {
            var sr = new StreamReader(dataFile);
            string line;

            while ((line = sr.ReadLine()) != null)
            {
                yield return line;
            }

            sr.Close();
        }
}
}


text:
/*
 * point.h
 *
 *  Created on: 2016年12月8日
 *      Author: zhuqian
 */

#ifndef SRC_LIGHTS_POINT_H_
#define SRC_LIGHTS_POINT_H_
#include "raiden.h"
#include "light.h"
//点光源
class PointLight: public Light {
private:
	Point3f _position; //点光源的位置,预计算,免得每次都要计算
	Spectrum _I; //光源强度,I,单位Watte/sr
public:
	PointLight(const Transform& l2w, const Spectrum& I) :
			Light((int) LightFlags::DeltaPosition,l2w, MediumInterface()) {
		_position = _lightToWorld(Point3f(0, 0, 0)); //计算光源在世界坐标下的位置
		_I = I;
	}
	virtual Spectrum Sample_Li(const Interaction& interaction,const Point2f &u,Vector3f* wi,
			Float* pdf, VisibilityTester* vis) const override;
	virtual Float Pdf_Li(const Interaction &ref, const Vector3f &wi) const override;
	virtual Spectrum Power() const override;
	virtual Spectrum Sample_Le(const Point2f &u1, const Point2f &u2, Float time,
			Ray *ray, Normal3f *nLight, Float *pdfPos, Float *pdfDir) const
					override;
	virtual void Pdf_Le(const Ray &ray, const Normal3f &nLight, Float *pdfPos,
					Float *pdfDir) const override;
};

std::shared_ptr<PointLight> CreatePointLight(const Transform &light2world,
		const ParamSet &paramSet);

#endif /* SRC_LIGHTS_POINT_H_ */


text:
@implementation NSString (Extension)
// 判断一个路径是文件夹 or 文件
//    [[mgr attributesOfItemAtPath:self error:nil].fileType isEqualToString:NSFileTypeDirectory];

- (NSInteger)fileSize
{
    // 文件管理者
    NSFileManager *mgr = [NSFileManager defaultManager];
    // 是否为文件夹
    BOOL isDirectory = NO;
    // 这个路径是否存在
    BOOL exists = [mgr fileExistsAtPath:self isDirectory:&isDirectory];
    // 路径不存在
    if (exists == NO) return 0;

    if (isDirectory) { // 文件夹
        // 总大小
        NSInteger size = 0;
        // 获得文件夹中的所有内容
        NSDirectoryEnumerator *enumerator = [mgr enumeratorAtPath:self];
        for (NSString *subpath in enumerator) {
            // 获得全路径
            NSString *fullSubpath = [self stringByAppendingPathComponent:subpath];
            // 获得文件属性
            size += [mgr attributesOfItemAtPath:fullSubpath error:nil].fileSize;
        }
        return size;
    } else { // 文件
        return [mgr attributesOfItemAtPath:self error:nil].fileSize;
    }
}

@end


text:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AboutComponent } from '../../page/home/about/about.component';
import { RouterModule, Routes } from '@angular/router';
import { IndexComponent } from '../../page/home/index/index.component';
import { ListComponent } from '../../page/home/list/list.component';
import { MytestDirective } from '../../directive/mytest.directive';

const myrouter:Routes=[
  {path:"home",children:[
    {path:"index",component:IndexComponent},
    {path:"about",component:AboutComponent},
    {path:"list",component:ListComponent}
  ]}
]

@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(myrouter),
  ],
  declarations: [
    MytestDirective,
    AboutComponent,
    IndexComponent,
    ListComponent,
  ]
})
export class HomeModule { }


text:
<?php

namespace backend\modules\admin\controllers;

use Yii;
use common\models\Media;
use backend\controllers\DefaultController as GolfLeagueController;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * MessageController implements the CRUD actions for Message model.
 */
class MediaController extends GolfLeagueController
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Deletes an existing Message model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete()
    {
        $id = Yii::$app->request->post('id');
		Yii::trace('deleting '.$id);
        $this->findModel($id)->delete();
		return;
    }

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


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

using System;
using System.Diagnostics;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Text;
using Microsoft.Win32.SafeHandles;

namespace WindowsAccessBridgeInterop.Win32 {
  /// <summary>
  /// Utility class to wrap an unmanaged DLL and be responsible for freeing it.
  /// </summary>
  /// <remarks>
  /// This is a managed wrapper over the native LoadLibrary, GetProcAddress, and
  /// FreeLibrary calls.
  /// </remarks>
  public class UnmanagedLibrary : IDisposable {
    // Unmanaged resource. CLR will ensure SafeHandles get freed, without requiring a finalizer on this class.
    private readonly SafeLibraryHandle _libraryHandle;

    /// <summary>
    /// Constructor to load a dll and be responible for freeing it.
    /// </summary>
    /// <param name="fileName">full path name of dll to load</param>
    /// <exception cref="System.IO.FileNotFoundException">if fileName can't be found</exception>
    /// <remarks>Throws exceptions on failure. Most common failure would be file-not-found, or
    /// that the file is not a  loadable image.</remarks>
    public UnmanagedLibrary(string fileName) {
      _libraryHandle = NativeMethods.LoadLibrary(fileName);
      if (_libraryHandle.IsInvalid) {
        try {
          var hr = Marshal.GetHRForLastWin32Error();
          Marshal.ThrowExceptionForHR(hr);
        } catch (Exception e) {
          throw new Exception(string.Format("Error loading library \"{0}\"", fileName), e);
        }
      }
    }

    public string Path {
      get {
        if (_libraryHandle.IsInvalid) {
          throw new InvalidOperationException("Cannot retrieve path because no library has been loaded yet");
        }

        var sb = new StringBuilder(4096);
        var size = NativeMethods.GetModuleFileName(_libraryHandle, sb, (uint)sb.Capacity);
        if (size == 0) {
          throw new InvalidOperationException("Error retrieving library path");
        }

        return sb.ToString(0, (int)size);
      }
    }

    public FileVersionInfo Version {
      get { return FileVersionInfo.GetVersionInfo(Path); }
    }

    /// <summary>
    /// Dynamically lookup a function in the dll via kernel32!GetProcAddress.
    /// </summary>
    /// <param name="functionName">raw name of the function in the export table.</param>
    /// <returns>null if function is not found. Else a delegate to the unmanaged function.
    /// </returns>
    /// <remarks>GetProcAddress results are valid as long as the dll is not yet unloaded. This
    /// is very very dangerous to use since you need to ensure that the dll is not unloaded
    /// until after you're done with any objects implemented by the dll. For example, if you
    /// get a delegate that then gets an IUnknown implemented by this dll,
    /// you can not dispose this library until that IUnknown is collected. Else, you may free
    /// the library and then the CLR may call release on that IUnknown and it will crash.</remarks>
    public TDelegate GetUnmanagedFunction<TDelegate>(string functionName) where TDelegate : class {
      var p = NativeMethods.GetProcAddress(_libraryHandle, functionName);

      // Failure is a common case, especially for adaptive code.
      if (p == IntPtr.Zero) {
        return null;
      }
      Delegate function = Marshal.GetDelegateForFunctionPointer(p, typeof(TDelegate));

      // Ideally, we'd just make the constraint on TDelegate be
      // System.Delegate, but compiler error CS0702 (constrained can't be System.Delegate)
      // prevents that. So we make the constraint system.object and do the cast from object-->TDelegate.
      object o = function;

      return (TDelegate)o;
    }

    public Delegate GetUnmanagedFunction(string functionName, Type type) {
      var p = NativeMethods.GetProcAddress(_libraryHandle, functionName);

      // Failure is a common case, especially for adaptive code.
      if (p == IntPtr.Zero) {
        return null;
      }
      return Marshal.GetDelegateForFunctionPointer(p, type);
    }

    /// <summary>
    /// Call FreeLibrary on the unmanaged dll. All function pointers
    /// handed out from this class become invalid after this.
    /// </summary>
    /// <remarks>This is very dangerous because it suddenly invalidate
    /// everything retrieved from this dll. This includes any functions
    /// handed out via GetProcAddress, and potentially any objects returned
    /// from those functions (which may have an implemention in the
    /// dll).</remarks>
    public void Dispose() {
      if (!_libraryHandle.IsClosed) {
        _libraryHandle.Close();
      }
    }

    // See http://msdn.microsoft.com/msdnmag/issues/05/10/Reliability/ for more about safe handles.
    [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
    private sealed class SafeLibraryHandle : SafeHandleZeroOrMinusOneIsInvalid {
      private SafeLibraryHandle() : base(true) { }

      protected override bool ReleaseHandle() {
        return NativeMethods.FreeLibrary(handle);
      }
    }

    static class NativeMethods {
      const string SKernel = "kernel32";

      [DllImport(SKernel, CharSet = CharSet.Auto, BestFitMapping = false, SetLastError = true)]
      public static extern SafeLibraryHandle LoadLibrary(string fileName);

      [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
      [DllImport(SKernel, SetLastError = true)]
      [return: MarshalAs(UnmanagedType.Bool)]
      public static extern bool FreeLibrary(IntPtr hModule);

      [DllImport(SKernel)]
      public static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, string procname);

      [DllImport(SKernel, CharSet = CharSet.Auto, BestFitMapping = false, SetLastError = true)]
      public static extern uint GetModuleFileName(
        [In]SafeLibraryHandle hModule,
        [Out]StringBuilder lpFilename,
        [In]uint nSize);
    }
  }
}


text:
#ifndef WEEX_PROJECT_JNI_OBJECT_WRAP_H
#define WEEX_PROJECT_JNI_OBJECT_WRAP_H

#include <jni.h>
#include "android/base/jni/scoped_java_ref.h"
#include "base/common.h"

namespace WeexCore {
class JNIObjectWrap {
 public:
  JNIObjectWrap() {}

  JNIObjectWrap(JNIEnv* env, jobject jni_object)
      : jni_object_(env, jni_object) {}

  virtual ~JNIObjectWrap() {}

  inline void Reset(JNIEnv* env, jobject jni_object) {
    jni_object_.Reset(env, jni_object);
  }

  inline jobject jni_object() { return jni_object_.Get(); }

 private:
  base::android::ScopedGlobalJavaRef<jobject> jni_object_;
  DISALLOW_COPY_AND_ASSIGN(JNIObjectWrap);
};
}  // namespace WeexCore
#endif  // WEEX_PROJECT_JNI_OBJECT_WRAP_H


text:
Yet another post

[meta:author]: <> (Jonas Colmsjo)
[meta:title]: <> (Responsive-wp-themes.md)
[meta:date]: <> (2012-01-01)
[meta:nested:key]: <> (Metadata value)

##!!truncate

Articles:
 * http://www.tripwiremagazine.com/2012/09/wordpress-mobile-theme.html
 * http://www.hongkiat.com/blog/free-responsive-wordpress-themes/
 * http://wpmu.org/top-10-free-responsive-wordpress-themes/
 * http://wpmu.org/7-free-twitter-bootstrap-themes-for-wordpress/
 * http://stackoverflow.com/questions/tagged/bootstrap
 * Performance - http://developer.yahoo.com/performance/rules.html#gzip

Tutorial:
 * http://wp.tutsplus.com/tutorials/theme-development/developing-wordpress-themes-using-responsive-frameworks/

Search:
 * http://themeforest.net/search?utf8=%E2%9C%93&term=bootstrap

Themes:
* http://320press.com/wpbs/
* http://themeforest.net/item/decision-bootstrap-responsive-template/3207933
* http://wordpress.org/extend/themes/hybrid
* http://wpbasis.de/readme-en_US.php
* http://themify.me/themes/itheme2
* http://responsivetwentyten.com/
* http://themeforest.net/item/good-minimal-a-responsive-wordpress-theme/410879?ref=WordPressPremium
* http://themeforest.net/item/modulo-responsive-premium-theme/795863?ref=WordPressPremium
* http://www.rootstheme.com/
* http://themble.com/bones/

Generic:
* https://github.com/malarkey/320andup/
* http://lessframework.com/
* http://foundation.zurb.com/
* http://www.yaml.de/
* https://github.com/h5bp/html5-boilerplate
* https://github.com/eddiemachado/bones
* https://github.com/eddiemachado/bones-genesis

Other Bootstrap tools:
* CDN - http://www.bootstrapcdn.com/
* Colors
 * http://bootswatch.com/
 * http://bootswatchr.com/
 * http://stylebootstrap.info/
* Interface builder - http://jetstrap.com/
* http://www.plugolabs.com/twitter-bootstrap-button-generator/
* Code snippets - http://bootsnipp.com/
* http://builtwithbootstrap.com/
* http://www.bootstraphero.com/


text:
'use strict';

CopInNewController.$inject = ['StudentFactory', '$routeParams', '$location'];
function CopInNewController(StudentFactory, $routeParams, $location) {
	var vm = this;

	vm.formTitle = 'New Change of Program In Form';

	var studentId = $routeParams.id;

	vm.submit = function() {
		StudentFactory.add_cop_in({ id: studentId },
			{ cop_in: vm.cop_in }, function (res) {
				$location.path('/students/' + studentId);
			}
		);
	}
}

module.exports = CopInNewController;