text:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Stimulus exploration:
%   A sketchpad for trying out different ideas for what new stimuli to use
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Preparation for noise image: Load the bpfilter
load(fullfile(rootpath, 'data', 'input', 'stimuli.mat'), 'bpfilter');

%% Build a thresholded noise image
load(fullfile(rootpath, 'data', 'input', 'stimuli.mat'), 'bpfilter');
[output, edge, thresh, res] = createPatternStimulus([800, 800], 1/20, bpfilter);

%% Generate a pure grating, just to show it's doable
N = 800;
k = 40;
sinusoid = sin(2*pi*k/N*(1:N));
sinim = repmat(sinusoid, N, 1);
figure; imshow(sinim/2 + 0.5);

%% Load existing images
imFile = fullfile(rootpath, 'data', 'input', 'stimuli.mat');
existingIms = loadImages(imFile, [176:184]);

existingIms = (double(existingIms) / 255) - 0.5;

denseGrating = existingIms(:,:,1,1);
sparseGrating = existingIms(:,:,3,1);

densePattern = existingIms(:,:,6,1);
sparsePattern = existingIms(:,:,8,1);

mid = ceil((size(denseGrating)+1)/2);

%% Analyze the dense grating to show it isn't a pure grating
subchunkIdxs = 182:356;
subchunk = denseGrating(subchunkIdxs, mid(2));
figure;
subplot(2, 1, 1); plot(subchunk);
subplot(2, 1, 2); plot(abs(fftshift(fft(subchunk))), 'ro-');

%% Convolve with bpfilter?

%% Analyze the sparse grating to show it's really made out of the bpfilter
subchunkIdxs = 182:356;
subchunk = sparseGrating(subchunkIdxs, mid(2));
figure;
subplot(3, 1, 1); plot(subchunk);
subplot(3, 1, 2); plot(abs(fftshift(fft(subchunk))), 'ro-');
subplot(3, 1, 3); plot(-1*bpfilter(:, 10)); xlim([0, 100]);

%% Analyze the sparse pattern; it's also bpfilter
figure;
subplot(3, 1, 1); plot(sparsePattern(:, mid(2)));
subplot(3, 1, 2); plot(abs(fftshift(fft(sparsePattern))), 'ro-');
subplot(3, 1, 3); plot(-1*bpfilter(:, 10)); xlim([0, 100]);

%% Generate a line pattern windowing onto a pure grating
linewindow = output.*sinim;
linewindow = linewindow - min(linewindow(:)) / (max(linewindow(:)) - min(linewindow(:)));
figure; imshow(linewindow, []);
figure; imshow(abs(fftshift(fft(linewindow))), []);

%% Wiggly aperture, grating backdrop
wigglyAperture = denseGrating .* sparsePattern;
figure; imshow(wigglyAperture, []);
toShow = {denseGrating, sparsePattern, wigglyAperture};
showFourier(toShow);

%% Convolve? (time-consuming)
temp = conv2(sparsePattern, sinim);

%% Multiply in frequency domain (haven't done this yet)
temp2 = ifft2(fft2(denseGrating) .* fft2(sparsePattern));

%% Filter line image w/ one gabor
gaborfilt = makegabor2d(32, [], [], 4, 0, 0, 2);
edgePad = padarray(edge, floor(size(gaborfilt)/2), 'circular', 'both');
output = conv2(edgePad, gaborfilt, 'valid');
showFourier({edge, gaborfilt, gaborEdge});
figure; imshow(gaborEdge, []);
    % YES, do the ocean ripples one

%% Filter grating with low-frequency noise
res = (res - (min(res(:)))) / (max(res(:)) - min(res(:)));
gratingNoise = denseGrating .* res;
figure; imshow(gratingNoise, []);

gratingThresh = denseGrating .* thresh;

%% Create a literal carrier-frequency bandpass noise
noise = randn(800, 800);
noise = noise./(max(noise(:) - min(noise(:)))) + 0.5;
filterednoise = conv2(noise, bpfilter, 'same');
figure; imshow((sinim/2 + 0.5) .* filterednoise, [])

%% Do that, with the existing sparse gratings
noise = randn(800, 800);
noise = noise./(max(noise(:) - min(noise(:)))) + 0.5;
filterednoise = conv2(noise, bpfilter, 'same');

aperture = -1 * sparseGrating;
aperture(aperture < 0) = 0; % remove the flanking stripes

blursize = 3; % TODO: figure out the appropriate blur size
blurfilt = makegaussian2d(blursize * 5, [], [], blursize, blursize );
aperturePad = padarray(aperture, floor(size(blurfilt)/2), 'circular', 'both');
apertureBroad = conv2(aperturePad, blurfilt, 'valid');

noiseLines  = apertureBroad .* filterednoise;
figure; imshow(noiseLines, []);

%% Visualize band energy (not complete)
numor = 8;
numph = 2;

outputSz = 150; padSz = 30;
imStack = resizeStack(wigglyAperture, outputSz, padSz);
cpfovsA = 1 * 37.5*(180/150);
gaborFlatA = gaborenergy(wigglyAperture, numor, numph, cpfovsA);

cpfovsB = 0.5 * 37.5*(180/150);
gaborFlatB = gaborenergy(wigglyAperture, numor, numph, cpfovsB);

%% Edge-based aperture
wigglyAperture = denseGrating .* sparsePattern;
figure; imshow(wigglyAperture, []);
toShow = {denseGrating, sparsePattern, wigglyAperture};
showFourier(toShow);

%% Wiggly backdrop, grating aperture
gratingAperture = densePattern .* sparseGrating;
figure; imshow(gratingAperture, []);
toShow = {densePattern, sparseGrating, gratingAperture};
showFourier(toShow);


text:
//
//  Copyright 2014 Gustavo J Knuppe (https://github.com/knuppe)
//
//   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.
//
//   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//   - May you do good and not evil.                                         -
//   - May you find forgiveness for yourself and forgive others.             -
//   - May you share freely, never taking more than you give.                -
//   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//

using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using SharpNL.Formats.Ad;
using SharpNL.Formats.Convert;
using SharpNL.Tokenize;
using SharpNL.Utility;

namespace SharpNL.Tests.Formats.Ad {
    [TestFixture, TestOf(typeof(AdTokenSampleStream))]
    internal class AdTokenSampleStreamTest {

        private const string SampleFile = "opennlp/tools/formats/ad.sample";

        private List<TokenSample> samplesFromConvert;
        private List<TokenSample> samplesFromStream;

        [OneTimeSetUp]
        public void Setup() {
            var dict = new DetokenizationDictionary(Tests.OpenFile("opennlp/tools/tokenize/latin-detokenizer.xml"));
            var stream = new NameToTokenSampleStream(
                new DictionaryDetokenizer(dict),
                new AdNameSampleStream(Tests.OpenFile(SampleFile), Encoding.UTF8, true, false));

            samplesFromConvert = new List<TokenSample>();

            TokenSample sample;

            while ((sample = stream.Read()) != null) {
                samplesFromConvert.Add(sample);
            }

            samplesFromStream = new List<TokenSample>();

            var sampleStream = new AdTokenSampleStream(
                new PlainTextByLineStream(Tests.OpenFile(SampleFile)),
                new DictionaryDetokenizer(dict),
                true, false);

            while ((sample = sampleStream.Read()) != null) {
                samplesFromStream.Add(sample);
            }
        }

        [Test]
        public void TestSimpleCount() {
            Assert.AreEqual(AdParagraphStreamTest.numSentences, samplesFromConvert.Count);

            Assert.AreEqual(samplesFromConvert.Count, samplesFromStream.Count);
        }

        [Test]
        public void TestSentences() {
            Assert.True(samplesFromConvert[5].Text.Contains("ofereceu-me"));
        }

        [Test]
        public void TestSamplesFromStream() {
            Assert.AreEqual(samplesFromConvert.Count, samplesFromStream.Count);

            for (var i = 0; i < samplesFromConvert.Count; i++) {
                Assert.AreEqual(samplesFromConvert[i], samplesFromStream[i]);
            }
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Xml.Linq;
using XSerialization;
using XSerialization.Attributes;

namespace TestModels.TestContracts
{
    class FieldSerializationContract2 : FieldSerializationContract
    {
        public override XElement Write(object pObject, XElement pParentElement, IXSerializationContext pSerializationContext)
        {
            Console.WriteLine("FieldSerializationContract2 " + this.TypedAttribute.FieldName);
            return base.Write(pObject, pParentElement, pSerializationContext);
        }
    }
}


text:
The examples in this section show how to use the AWS SDK for .NET with Amazon Relational Database Service (Amazon RDS).

Amazon RDS is a web service that makes it easier to set up, operate, and scale a relational database in the cloud.

## ⚠ Important
* Running this code might result in charges to your AWS account.
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).

## Code examples

### Single actions
Code excerpts that show you how to call individual service functions.
* [Create a DB parameter group](Actions/RDSWrapper.ParameterGroups.cs)(`CreateDbParameterGroupAsync`)
* [Create a snapshot of a DB instance](Actions/RDSWrapper.Snaspshots.cs)(`CreateDbSnapshotAsync`)
* [Create a DB instance](Actions/RDSWrapper.Instances.cs)(`CreateDBInstanceAsync`)
* [Delete a DB instance](Actions/RDSWrapper.Instances.cs)(`DeleteDBInstanceAsync`)
* [Delete a DB parameter group](Actions/RDSWrapper.ParameterGroups.cs)(`DeleteDbParameterGroupAsync`)
* [Describe DB instances](Actions/RDSWrapper.Instances.cs)(`DescribeDBInstancesAsync`)
* [Describe DB parameter groups](Actions/RDSWrapper.ParameterGroups.cs)(`DescribeDbParameterGroupsAsync`)
* [Describe database engine versions](Actions/RDSWrapper.Instances.cs)(`DescribeDbEngineVersionsAsync`)
* [Describe options for DB instances](Actions/RDSWrapper.Instances.cs)(`DescribeOrderableDbInstanceOptionsAsync`)
* [Describe parameters in a DB parameter group](Actions/RDSWrapper.ParameterGroups.cs)(`DescribeDbParametersAsync`)
* [Describe snapshots of DB instances](Actions/RDSWrapper.Snaspshots.cs)(`DescribeDbSnapshotsAsync`)
* [Update parameters in a DB parameter group](Actions/RDSWrapper.ParameterGroups.cs)(`ModifyDbParameterGroupAsync`)

### Scenarios

Code examples that show you how to accomplish a specific task by calling
multiple functions within the same service.

* [Get started with DB instances](Scenarios/RDSInstanceScenario/RDSInstanceScenario.cs)

## Run the examples

### Prerequisites
* To find prerequisites for running these examples, see the
[README](../README.md#Prerequisites) in the dotnetv3 folder.

After the example compiles, you can run it from the command line. To do so,
navigate to the folder that contains the .csproj file and run the following
command:

```
dotnet run
```

Alternatively, you can run the example from within your IDE.

## Tests
⚠ Running the tests might result in charges to your AWS account.

The solution includes a test project. To run the tests, navigate to the folder that contains the test project and then issue the following command:

```
dotnet test
```

Alternatively, you can open the example solution and use the Visual Studio Test Runner to run the tests.

## Additional resources
* [Amazon RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html)
* [Amazon RDS API Reference](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/Welcome.html)
* [AWS SDK for .NET Amazon RDS](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/RDS/NRDS.html)
* [AWS SDK for .NET Developer Guide](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/welcome.html)

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.project.syz.randomidnum" >
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
import app from '../styles/app/app.css';
import button from '../components/button.css';

/** @jsx h */
import {h} from 'hyperapp';
import Button from '../components/Button'; // eslint-disable-line no-unused-vars
import Counter from '../components/Counter'; // eslint-disable-line no-unused-vars

export const Home = ({state, actions}) =>

Example application built with Hyperapp

    <Counter num={state.num} add={actions.add} sub={actions.sub}/>

      <Button id="btn-ping" className={button['Button-primary']} stroked onclick={ (e) => actions.ping(e) }>
        Ping
      </Button>

{state.response}

      <Button className={button['Button-primary']} stroked onclick={ (e) => actions.triggerUnhandledError(e) }>
        Unhandled error!
      </Button>

{state.unhandledErrorResponse}

;


text:
using System;
using System.Web.UI.WebControls;

using DotNetNuke.Common;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.FileSystem;
using DotNetNuke.UI.Skins;

#endregion

namespace DotNetNuke.UI.Containers
{
	/// -----------------------------------------------------------------------------
	/// Project	 : DotNetNuke
	/// Class	 : DotNetNuke.UI.Containers.Icon
	///
	/// -----------------------------------------------------------------------------
	/// <summary>
	/// Contains the attributes of an Icon.
	/// These are read into the PortalModuleBase collection as attributes for the icons within the module controls.
	/// </summary>
	/// <remarks>
	/// </remarks>
    public partial class Icon : SkinObjectBase
    {
		#region "Public Members"

        public string BorderWidth { get; set; }
        public string CssClass { get; set; }

		#endregion

		#region "Event Handlers"

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            try
            {
				//public attributes
                if (!String.IsNullOrEmpty(BorderWidth))
                {
                    imgIcon.BorderWidth = Unit.Parse(BorderWidth);
                }
                if (!String.IsNullOrEmpty(CssClass))
                {
                    imgIcon.CssClass = CssClass;
                }
                Visible = false;
                if ((ModuleControl != null) && (ModuleControl.ModuleContext.Configuration != null))
                {
                    var iconFile = GetIconFileUrl();
                    if (!string.IsNullOrEmpty(iconFile))
                    {
                        if (Globals.IsAdminControl())
                        {
                            iconFile = $"~/DesktopModules/{ModuleControl.ModuleContext.Configuration.DesktopModule.FolderName}/{iconFile}";
                        }

                        imgIcon.ImageUrl = iconFile;
                        imgIcon.AlternateText = ModuleControl.ModuleContext.Configuration.ModuleTitle;
                        Visible = true;
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }

        #endregion

        #region Private Methods

        private string GetIconFileUrl()
        {
            var iconFile = ModuleControl.ModuleContext.Configuration.IconFile;
            if ((string.IsNullOrEmpty(iconFile) || iconFile.StartsWith("~")))
            {
                return iconFile;
            }

            IFileInfo fileInfo;
            if (iconFile.StartsWith("FileID=", StringComparison.InvariantCultureIgnoreCase))
            {
                var fileId = Convert.ToInt32(iconFile.Substring(7));
                fileInfo = FileManager.Instance.GetFile(fileId);
            }
            else
            {
                fileInfo = FileManager.Instance.GetFile(PortalSettings.PortalId, iconFile);
            }

            return fileInfo != null ? FileManager.Instance.GetUrl(fileInfo) : iconFile;
        }

        #endregion
    }
}


text:
% Copyright 2014 The MathWorks, Inc.
function [tc, results] = gcc_codesourcery_arm_linux_gnueabihf()
%gcc_codesourcery_arm_linux_gnueabihf

% Copyright 2013 The MathWorks, Inc.

toolchain.Platforms  = {'win64', 'win32'};
toolchain.Versions   = {'4.8'};
toolchain.Artifacts  = {'gmake'};
toolchain.FuncHandle = str2func('getToolchainInfoFor');
toolchain.ExtraFuncArgs = {};

[tc, results] = coder.make.internal.generateToolchainInfoObjects(mfilename, toolchain);
end

function tc = getToolchainInfoFor(platform, version, artifact, varargin)
% Toolchain Information

tc = coder.make.ToolchainInfo('BuildArtifact', 'gmake makefile', 'SupportedLanguages', {'Asm/C/C++'});
info = getARMCortexAInfo_CS();
tc.Name = coder.make.internal.formToolchainName(info.ToolChainName, ...
    platform, version, artifact);
tc.Platform = platform;
tc.setBuilderApplication(platform);

% Toolchain's attribute
tc.addAttribute('TransformPathsWithSpaces');
tc.addAttribute('SupportsUNCPaths',     false);
tc.addAttribute('SupportsDoubleQuotes', false);

% ------------------------------
% Make
% ------------------------------

make = tc.BuilderApplication();
make.IncludeFiles = {'codertarget_assembly_flags.mk', '../codertarget_assembly_flags.mk'};

% Add macros
tc.addIntrinsicMacros({'TARGET_LOAD_CMD_ARGS'});
tc.addIntrinsicMacros({'TARGET_PKG_INSTALLDIR'}); %Daren: important for pointing out where the batch file for download is (your target directory)
tc.addMacro('CCOUTPUTFLAG',     '--output_file=');
tc.addMacro('LDOUTPUTFLAG',     '--output_file=');
% tc.addMacro('CPFLAGS', '-O binary');

tc.addIntrinsicMacros({'CODE_SOURCERY'}); %Daren: Added this here, according to the doc
tc.addMacro('COMPILER_PATH','$(CODE_SOURCERY)');

% Assembler
assembler = tc.getBuildTool('Assembler');
assembler.setName([info.ToolChainName, ' Assembler']);
assembler.setCommand('arm-none-linux-gnueabi-as');
assembler.setDirective('IncludeSearchPath', '-I');
assembler.setDirective('PreprocessorDefine', '-D');
assembler.setDirective('OutputFlag', '-o');
assembler.setDirective('Debug', '-g');
assembler.DerivedFileExtensions = {'Object'};
assembler.setFileExtension('Source','.s');
assembler.setFileExtension('Object', '.o');
assembler.setPath('$(CODE_SOURCERY)');

% Compiler
cCompiler = tc.getBuildTool('C Compiler');
cCompiler.setName([info.ToolChainName, ' C Compiler']);
cCompiler.setCommand('arm-none-linux-gnueabi-gcc');
cCompiler.setDirective('IncludeSearchPath', '-I');
cCompiler.setDirective('PreprocessorDefine', '-D');
cCompiler.setDirective('OutputFlag', '-o');
cCompiler.setDirective('Debug', '-g');
cCompiler.setFileExtension('Source', '.c');
cCompiler.setFileExtension('Header', '.h');
cCompiler.setFileExtension('Object', '.o');
cCompiler.setPath('$(COMPILER_PATH)');

% C++ compiler
cppCompiler = tc.getBuildTool('C++ Compiler');
cppCompiler.setName([info.ToolChainName, ' C Compiler']);
cppCompiler.setCommand('arm-none-linux-gnueabi-g++');
cppCompiler.setDirective('IncludeSearchPath', '-I');
cppCompiler.setDirective('PreprocessorDefine', '-D');
cppCompiler.setDirective('OutputFlag', '-o');
cppCompiler.setDirective('Debug', '-g');
cppCompiler.setFileExtension('Source', '.cpp');
cppCompiler.setFileExtension('Header', '.hpp');
cppCompiler.setFileExtension('Object', '.o');
% cppcompiler.setPath('$(CODE_SOURCERY)');

% Linker
linker = tc.getBuildTool('Linker');
linker.setName([info.ToolChainName, ' Linker']);
linker.setCommand('arm-none-linux-gnueabi-gcc');
linker.setDirective('Library', '-l');
linker.setDirective('LibrarySearchPath', '-L');
linker.setDirective('OutputFlag', '-o');
linker.setDirective('Debug', '-g');
linker.setFileExtension('Executable', '.elf');
linker.setFileExtension('Shared Library', '.so');
linker.Libraries = {'-lm'};
linker.setPath('$(CODE_SOURCERY)');

% C++ Linker
cppLinker = tc.getBuildTool('C++ Linker');
cppLinker.setName([info.ToolChainName, ' C++ Linker']);
cppLinker.setCommand('arm-none-linux-gnueabi-gcc');
cppLinker.setDirective('Library', '-l');
cppLinker.setDirective('LibrarySearchPath', '-L');
cppLinker.setDirective('OutputFlag', '-o');
cppLinker.setDirective('Debug', '-g');
cppLinker.setFileExtension('Executable', '');
cppLinker.setFileExtension('Shared Library', '.so');
cppLinker.Libraries = {'-lm'};
% cpplinker.setPath('$(CODE_SOURCERY)');

% Archiver
archiver = tc.getBuildTool('Archiver');
archiver.setName([info.ToolChainName, ' Archiver']);
archiver.setCommand('arm-none-linux-gnueabi-ar');
archiver.setDirective('OutputFlag', '');
archiver.setFileExtension('Static Library', '.lib');
archiver.setPath('$(CODE_SOURCERY)');

% --------------------------------------------
% BUILD CONFIGURATIONS
% --------------------------------------------
optimsOffOpts = {'-O0'};
optimsOnOpts = {'-O2'};
cCompilerOpts    = {''};
archiverOpts     = {'-r'};

compilerOpts = {...
    '-c'};

assemblerOpts = compilerOpts;

linkerOpts = { ...
    '-lm    -lrt  -lpthread'};

% Get the debug flag per build tool
debugFlag.CCompiler   = '-g -D"_DEBUG"';
debugFlag.Linker      = '';
debugFlag.Archiver    = '';

cfg = tc.getBuildConfiguration('Faster Builds');
cfg.setOption('Assembler',  horzcat(cCompilerOpts, assemblerOpts, '$(ASFLAGS_ADDITIONAL)', '$(INCLUDES)'));
cfg.setOption('C Compiler', horzcat(cCompilerOpts, compilerOpts, optimsOffOpts));
cfg.setOption('Linker',     linkerOpts);
cfg.setOption('Archiver',   archiverOpts);

cfg = tc.getBuildConfiguration('Faster Runs');
cfg.setOption('Assembler',  horzcat(cCompilerOpts, assemblerOpts, '$(ASFLAGS_ADDITIONAL)', '$(INCLUDES)'));
cfg.setOption('C Compiler', horzcat(cCompilerOpts, compilerOpts, optimsOnOpts));
cfg.setOption('Linker',     linkerOpts);
cfg.setOption('Archiver',   archiverOpts);

cfg = tc.getBuildConfiguration('Debug');
cfg.setOption('Assembler',  horzcat(cCompilerOpts, assemblerOpts, '$(ASFLAGS_ADDITIONAL)', '$(INCLUDES)', debugFlag.CCompiler));
cfg.setOption('C Compiler', horzcat(cCompilerOpts, compilerOpts, optimsOffOpts, debugFlag.CCompiler));
cfg.setOption('Linker',     horzcat(linkerOpts, debugFlag.Linker));
cfg.setOption('Archiver',   horzcat(archiverOpts, debugFlag.Archiver));

tc.setBuildConfigurationOption('all', 'Make Tool', '-f $(MAKEFILE)');

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
  <string name="about">About</string>
  <string name="action_sign_in">Sign in</string>
  <string name="add_tag">Add Tag</string>
  <string name="all_notes">All notes</string>
  <string name="attach_file">Attach file</string>
  <string name="auth_user">Email or username</string>
  <string name="auth_host_url">Server address https://…</string>
  <string name="auth_password">Password</string>
  <string name="cancel">Cancel</string>
  <string name="confirm">OK</string>
  <string name="create_notebook_title">Create Notebook</string>
  <string name="delete_note">Delete Note</string>
  <string name="delete_note_message">Are you sure that you want to delete this note?</string>
  <string name="delete_title">Delete</string>
  <string name="discard">Discard?</string>
  <string name="discard_changes">Your change are not saved. Do you really want to discard your changes?</string>
  <string name="edit">Edit</string>
  <string name="empty_note">Note was not saved</string>
  <string name="empty_note_hint">Write your note</string>
  <string name="empty_title_error">Title cannot be empty</string>
  <string name="empty_title_hint">Your note title</string>
  <string name="error_field_required">This field is required</string>
  <string name="error_incorrect_password">Password or email is incorrect</string>
  <!-- Login error messages -->
  <string name="error_invalid_url">This url is invalid</string>
  <string name="error_timeout">The server is not responding</string>
  <string name="file">File</string>
  <string name="image">Image</string>
  <string name="logout">Logout</string>
  <string name="menu_close">Menu closed</string>
  <string name="menu_open">Menu opened</string>
  <string name="more">More</string>
  <string name="move_to">Move To</string>
  <string name="move_to_message">Choose the new notebook for this note</string>
  <string name="note">note</string>
  <string name="notebooks">Notebooks</string>
  <string name="notebook_selection_title">Select a notebook</string>
  <string name="notes">notes</string>
  <string name="no_notes">No notes</string>
  <string name="save_note">Save</string>
  <string name="search">Search</string>
  <string name="settings">Settings</string>
  <string name="share_note">Share</string>
  <string name="tags">Tags</string>
  <string name="take_photo">Take photo</string>
  <!-- Strings related to login -->
  <string name="title_activity_login">Sign in</string>
  <string name="wait">Please wait…</string>
</resources>


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

namespace PEG.SyntaxTree
{
    public class Substitution : Expression
    {
        public string Name { get; set; }
        public Expression Target { get; set; }

        public override IEnumerable<OutputRecord> Execute(ParseEngine engine)
        {
            return Target.Execute(engine);
        }

        public override void Accept<T>(IExpressionVisitor<T> visitor, T context)
        {
            visitor.Visit(this, context);
        }
    }
}


text:
namespace Log4NetTest
{
    partial class TestForm
    {
        private readonly System.ComponentModel.IContainer components = null;

        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.button3 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.button3);
            this.groupBox1.Controls.Add(this.button2);
            this.groupBox1.Controls.Add(this.button1);
            this.groupBox1.Location = new System.Drawing.Point(13, 12);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(97, 117);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Busy Workers";
            //
            // button3
            //
            this.button3.Location = new System.Drawing.Point(6, 78);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(75, 23);
            this.button3.TabIndex = 0;
            this.button3.Text = "Curly";
            this.button3.UseVisualStyleBackColor = true;
            this.button3.Click += new System.EventHandler(this.BusyWorker_Click);
            //
            // button2
            //
            this.button2.Location = new System.Drawing.Point(6, 49);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 0;
            this.button2.Text = "Larry";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.BusyWorker_Click);
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(7, 20);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "Moe";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.BusyWorker_Click);
            //
            // TestForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(513, 368);
            this.Controls.Add(this.groupBox1);
            this.Name = "TestForm";
            this.Text = "TestForm";
            this.groupBox1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button1;
    }
}


text:
import 'babel-polyfill';

import React from 'react';
import ReactDOM from 'react-dom';
import Root from './root';
import { Store } from './store';
import { hashHistory } from 'react-router';

if (process.env.NODE_ENV !== 'production') {
  require('../asset/sass/app.scss');
}

ReactDOM.render(
	<Root history={ hashHistory } store={ Store } />,
	document.getElementById("main")
);


text:
'''
Syntax:
variable = input('prompt label')
print('result text', variable)

when run, the input() field will

note: differences between python 2 and 3.
in 2, if you want to use user input as a string, you must use raw_imput(). vers 3 naturally interprets input() as string
'''

myname = input('please enter your name: ')
myage = input('and your age please?: ')
print('Hello world, my name is', myname, 'and I am', myage, 'years old.')

#formatting
print('Hello world, my name is %s and I am %s years old.' %(myname,myage))
#or

print('Hello world, my name is {} and I am {} years old.'.format(myname,myage))

#formatting, with triple quotes
'''
long messages with line breaks can be printed with triple quotes
'''
#example:
print('''Hello world.
my name is {}
and I am {} years old.'''.format(myname,myage))

#escape characters in string
'''
\t tab. example: ('hello\tworld')
\n prints new line
\\ prints backslash
\" prints quotes
\' prints single
r raw text. example r('hello\tworld') will return 'hello\tworld'
'''

#choice & decisions: if, for , while loop try, except
##############
##############

#condition statements (if true= true, else= false)
'''
== equals
!= not equals #5!=2
<  smaller than #2<5
>  greater than #5>2
<= smaller or equals
>= greater than or equal
'''
# operators: and or not
'''
and  #returns true if all conditions are met
or  #returns true if one condition is met
else #returns false  if all conditions are met

'''

print(5==5 and 2>1)
#result: true

print(5==6 and 2>1)
#result: false

print(5==6 or 2>1)
#result: true

#if
'''
syntax:

if varible:
	decisions
elif varible2:
	decisions
elif varible3:
	decisions
else:
	decisions

note: no () are needed after if, elif, else. also, no {} needed to define start and end of statement
 indentation is key. anything indented will be treated as a block of code to execute if true.
 '''

#example:
userinput = input('enter 1 or 2: ')
if userinput == "1":
	print("hello world")
	print("how are you?")
elif userinput == "2":
	print("python rocks!")
	print("I love python")
else:
	print ("you did not enter a valid number")

#result:
hello world
how are you?

#inline if
'''
simplified if statement, for 1 condition tasks
'''
#examples:
num1 = 12 if myint==10 else 13

myint = 11
print("this is task a" if myint ==10 else "this is task b")

#for loop
'''
for #loop executes a block of code repetedly until the condition in the for statment is no longer valid.
#iterable- anything that can be looped over, such a string.
#Syntax:
for a in iterable
	print (a)
'''
#example:
pets = ['cats', 'dogs', 'rabbits', 'hamsters']
for mypets in pets:
	print (mypets)

# the for statment above takes all members of pets dictionary and assignes each member to mypets variable.
#result:
cats
dogs
rabbits
hamsters

#to list index:
for index, mypets in enumerate(pets):
	print (index, mypets)

#result:
(0, 'cats')
(1, 'dogs')
(2, 'rabbits')
(3, 'hamsters')

#loop into a string.

message = 'hello'
for i in message:
	print (i)
#result:
h
e
l
l
o

#looping through a sequence of numbers
'''
#syntax
range(start, end, step)
#note:  if start is not given, generates from 0
if step is not given, than numbers provided will be consecutive
end is required, but not generated in result
'''

#Examples:
print range(5)
#Result: [0, 1, 2, 3, 4]
print range(3,10)
[3, 4, 5, 6, 7, 8, 9]

#example in FOR
for i in range(5):
	print (i)
#Result:
0
1
2
3
4

#while loop
'''
while # repeatedly executes instructions inside the loop while certain condition remains valid.

#syntaxwhile condition is true:
	do A

'''
#example

counter = 5

while counter > 0:
	print ("Counter - ", counter)
	counter = counter - 1

#Result:
Counter = 5
Counter = 4
Counter = 3
Counter = 2
Counter = 1

#example
counter = 5

while counter < 10:
	print ("Counter - ", counter)
	counter = counter + 1

#Result:
Counter = 5
Counter = 6
Counter = 7
Counter = 8
Counter = 9

''''
###important!###
beware of infinite loops!!!!

always add counter = counter +- 1 for defined increments,
so the while commands can eventually reach a FALSE statement, to stop.
if not, INFINITY AND BEYOND!!
'''

#Break loop
'''
to exit a loop, add breaks
'''
#nested example:
j=0
for i in range(5):
	j = j + 2
	print ('i= ', i, ', j = ', j)
	if j== 6:
		break

# continue in loop
'''
with continue, the rest of the loop AFTER the keyword is skipped for the iteration
'''
#example:

j=0
for i in range(5):
	j=j+2
	print ('\ni= ', i, ', j = ', j)
	if j == 6 :
		continue
	print('i will be skipped over if j=6')

''''
when j=6 the line after continue keyword is not printed. everything else runs as normal.
'''

# try, except
'''
try, except controls how a program proceeds when an error occurs
#syntax:

try:
	do something
except:
	do something else when error occurs
'''
#example:

try:
	answer=12/0
	print (answer)
except:
	print ('danger will robinson!!!')

#except exetutes when an error occurs  (dividing 12 by 0)
# for specified error messages,
try:
	userInput1 = int(input("please enter a number:"))
	userInput2 = int(input("please enter another number:"))
	answer = userInput1/userInput2
	print ("the answer is ", answer)
	myFile = open("missing.txt",'r')
except ValueError:
	print ("error: non number entered")


text:
package towers;

import projectiles.Projectile;
import utilities.Position;
import models.DriverModel;

public class MoneyTower extends Tower
{
	private static final String TOWER_BASE_IMAGE = null;
	public static final String TOWER_TURRET_IMAGE = null;
	public static final int TOWER_RANGE = 0;
	public static final int TOWER_FIRE_RATE = 0;
	public static final int TOWER_COST = 0;

	private static final long serialVersionUID = 1L;

	/**
	 * Constructor
	 * @param location
	 * @param model
	 */
	public MoneyTower(final Position position)
	{
		super(position, TOWER_BASE_IMAGE, TOWER_TURRET_IMAGE);
		this.range = TOWER_RANGE;
		this.fireRate = TOWER_FIRE_RATE;
		this.cost = TOWER_COST;
	}

	public Projectile[] attackMob(DriverModel model) {
		return new Projectile[0];
	}

	public void upgradePath1(final DriverModel model) {
	}

	public void upgradePath2(final DriverModel model) {
	}

	@Override
	public int path1CurrentValue() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int path2CurrentValue() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int path3CurrentValue() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int path1UpgradeValue() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int path2UpgradeValue() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int path3UpgradeValue() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void upgradePath3(DriverModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public int getRange() {
		// TODO Auto-generated method stub
		return 0;
	}
}


text:
This template creates an organization policy.

## Prerequisites

- Install [gcloud](https://cloud.google.com/sdk)
- Create a [GCP project, set up billing, enable requisite APIs](../project/README.md)
- Grant the [resourcemanager.organizationAdmin](https://cloud.google.com/resource-manager/docs/access-control-org) IAM role to the project service account

## Deployment

### Resources

- [cloudresourcemanager.v1.project](https://cloud.google.com/resource-manager/reference/rest/v1/projects/setOrgPolicy)

### Properties

See the `properties` section in the schema file(s):

-  [Org Policy](org_policy.py.schema)

### Usage

1. Clone the [Deployment Manager samples repository](https://github.com/GoogleCloudPlatform/deploymentmanager-samples):

```shell
    git clone https://github.com/GoogleCloudPlatform/deploymentmanager-samples
```

2. Go to the [community/cloud-foundation](../../) directory:

```shell
    cd community/cloud-foundation
```

3. Copy the example DM config to be used as a model for the deployment; in this case, [examples/org_policy.yaml](examples/org_policy.yaml):

```shell
    cp templates/org_policy/examples/org_policy.yaml my_org_policy.yaml
```

4. Change the values in the config file to match your specific GCP setup (for properties, refer to the schema files listed above):

```shell
    vim my_org_policy.yaml  # <== change values to match your GCP setup
```

5. Create your deployment (replace <YOUR_DEPLOYMENT_NAME> with the relevant deployment name):

```shell
    gcloud deployment-manager deployments create <YOUR_DEPLOYMENT_NAME> \
        --config my_org_policy.yaml
```

6. In case you need to delete your deployment:

```shell
    gcloud deployment-manager deployments delete <YOUR_DEPLOYMENT_NAME>
```

## Examples

- [Org policy](examples/org_policy.yaml)


text:
class Profiles::GpgKeysController < Profiles::ApplicationController
  before_action :set_gpg_key, only: [:destroy, :revoke]

  def index
    @gpg_keys = current_user.gpg_keys
    @gpg_key = GpgKey.new
  end

  def create
    @gpg_key = current_user.gpg_keys.new(gpg_key_params)

    if @gpg_key.save
      redirect_to profile_gpg_keys_path
    else
      @gpg_keys = current_user.gpg_keys.select(&:persisted?)
      render :index
    end
  end

  def destroy
    @gpg_key.destroy

    respond_to do |format|
      format.html { redirect_to profile_gpg_keys_url, status: 302 }
      format.js { head :ok }
    end
  end

  def revoke
    @gpg_key.revoke

    respond_to do |format|
      format.html { redirect_to profile_gpg_keys_url, status: 302 }
      format.js { head :ok }
    end
  end

  private

  def gpg_key_params
    params.require(:gpg_key).permit(:key)
  end

  def set_gpg_key
    @gpg_key = current_user.gpg_keys.find(params[:id])
  end
end


text:
#include <ztest.h>

#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
K_THREAD_STACK_EXTERN(tstack);
extern struct k_thread tdata;
static ZTEST_BMEM int execute_flag;

K_SEM_DEFINE(sync_sema, 0, 1);
#define BLOCK_SIZE 64

static void thread_entry(void *p1, void *p2, void *p3)
{
	execute_flag = 1;
	k_sleep(100);
	execute_flag = 2;
}

static void thread_entry_abort(void *p1, void *p2, void *p3)
{
	/**TESTPOINT: abort current thread*/
	execute_flag = 1;
	k_thread_abort(k_current_get());
	/*unreachable*/
	execute_flag = 2;
	zassert_true(1 == 0, NULL);
}
/**
 * @ingroup kernel_thread_tests
 * @brief Validate k_thread_abort() when called by current thread
 *
 * @details Create a user thread and let the thread execute.
 * Then call k_thread_abort() and check if the thread is terminated.
 * Here the main thread is also a user thread.
 *
 * @see k_thread_abort()
 */
void test_threads_abort_self(void)
{
	execute_flag = 0;
	k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_abort,
			NULL, NULL, NULL, 0, K_USER, 0);
	k_sleep(100);
	/**TESTPOINT: spawned thread executed but abort itself*/
	zassert_true(execute_flag == 1, NULL);
}

/**
 * @ingroup kernel_thread_tests
 * @brief Validate k_thread_abort() when called by other thread
 *
 * @details Create a user thread and abort the thread before its
 * execution. Create a another user thread and abort the thread
 * after it has started.
 *
 * @see k_thread_abort()
 */
void test_threads_abort_others(void)
{
	execute_flag = 0;
	k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
				      thread_entry, NULL, NULL, NULL,
				      0, K_USER, 0);

	k_thread_abort(tid);
	k_sleep(100);
	/**TESTPOINT: check not-started thread is aborted*/
	zassert_true(execute_flag == 0, NULL);

	tid = k_thread_create(&tdata, tstack, STACK_SIZE,
			      thread_entry, NULL, NULL, NULL,
			      0, K_USER, 0);
	k_sleep(50);
	k_thread_abort(tid);
	/**TESTPOINT: check running thread is aborted*/
	zassert_true(execute_flag == 1, NULL);
	k_sleep(1000);
	zassert_true(execute_flag == 1, NULL);
}

/**
 * @ingroup kernel_thread_tests
 * @brief Test abort on a terminated thread
 *
 * @see k_thread_abort()
 */
void test_threads_abort_repeat(void)
{
	execute_flag = 0;
	k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
				      thread_entry, NULL, NULL, NULL,
				      0, K_USER, 0);

	k_thread_abort(tid);
	k_sleep(100);
	k_thread_abort(tid);
	k_sleep(100);
	k_thread_abort(tid);
	/* If no fault occured till now. The test case passed. */
	ztest_test_pass();
}

bool abort_called;
void *block;

static void abort_function(void)
{
	printk("Child thread's abort handler called\n");
	abort_called = true;
	k_free(block);
}

static void uthread_entry(void)
{
	block = k_malloc(BLOCK_SIZE);
	zassert_true(block != NULL, NULL);
	printk("Child thread is running\n");
	k_sleep(K_MSEC(2));
}

/**
 * @ingroup kernel_thread_tests
 * @brief Test to validate the call of abort handler
 * specified by thread when it is aborted
 *
 * @see k_thread_abort(), #k_thread.fn_abort
 */
void test_abort_handler(void)
{
	k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
				      (k_thread_entry_t)uthread_entry, NULL, NULL, NULL,
				      0, 0, 0);

	tdata.fn_abort = &abort_function;

	k_sleep(K_MSEC(1));

	abort_called = false;

	printk("Calling abort of child from parent\n");
	k_thread_abort(tid);

	zassert_true(abort_called == true, "Abort handler"
		     " is not called");
}

static void delayed_thread_entry(void *p1, void *p2, void *p3)
{
	execute_flag = 1;

	zassert_unreachable("Delayed thread shouldn't be executed");
}

/**
 * @ingroup kernel_thread_tests
 * @brief Test abort on delayed thread before it has started
 * execution
 *
 * @see k_thread_abort()
 */
void test_delayed_thread_abort(void)
{
	int current_prio = k_thread_priority_get(k_current_get());

	/* Make current thread preemptive */
	k_thread_priority_set(k_current_get(), K_PRIO_PREEMPT(2));

	/* Create a preemptive thread of higher priority than
	 * current thread
	 */
	k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
				      (k_thread_entry_t)delayed_thread_entry, NULL, NULL, NULL,
				      K_PRIO_PREEMPT(1), 0, 100);

	/* Give up CPU */
	k_sleep(50);

	/* Test point: check if thread delayed for 100ms has not started*/
	zassert_true(execute_flag == 0, "Delayed thread created is not"
		     " put to wait queue");

	k_thread_abort(tid);

	/* Test point: Test abort of thread before its execution*/
	zassert_false(execute_flag == 1, "Delayed thread is has executed"
		      " before cancellation");

	/* Restore the priority */
	k_thread_priority_set(k_current_get(), current_prio);
}


text:
package com.facebook.buck.intellij.ideabuck.build;

import com.facebook.buck.intellij.ideabuck.config.BuckModule;
import com.facebook.buck.intellij.ideabuck.config.BuckProjectSettingsProvider;
import com.facebook.buck.intellij.ideabuck.ui.tree.BuckTextNode.TextType;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.process.OSProcessHandler;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessListener;
import com.intellij.execution.process.ProcessOutputTypes;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vcs.LineHandlerHelper;
import com.intellij.openapi.vfs.CharsetToolkit;
import java.io.File;
import java.nio.charset.Charset;
import java.util.regex.Pattern;
import org.jetbrains.annotations.Nullable;

/** The handler for buck commands with text outputs. */
public abstract class BuckCommandHandler {

  protected static final Logger LOG = Logger.getInstance(BuckCommandHandler.class);
  private static final long LONG_TIME = 10 * 1000;

  protected final Project project;
  protected final BuckModule buckModule;
  protected final BuckCommand command;

  private final File workingDirectory;
  private final GeneralCommandLine commandLine;
  private final Object processStateLock = new Object();
  private static final Pattern CHARACTER_DIGITS_PATTERN = Pattern.compile("(?s).*[A-Z0-9a-z]+.*");
  private final boolean doStartNotify;

  @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"})
  private Process process;

  @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"})
  private OSProcessHandler handler;

  /** Character set to use for IO. */
  @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"})
  private Charset charset = CharsetToolkit.UTF8_CHARSET;

  /** Buck execution start timestamp. */
  private long startTime;

  /** The partial line from stderr stream. */
  private final StringBuilder stderrLine = new StringBuilder();

  public BuckCommandHandler(Project project, File directory, BuckCommand command) {
    this(project, directory, command, /* doStartNotify */ false);
  }

  /**
   * @param project a project
   * @param directory a process directory
   * @param command a command to execute (if empty string, the parameter is ignored)
   * @param doStartNotify true if the handler should call OSHandler#startNotify
   */
  public BuckCommandHandler(
      Project project, File directory, BuckCommand command, boolean doStartNotify) {
    this.doStartNotify = doStartNotify;

    String buckExecutable =
        BuckProjectSettingsProvider.getInstance(project).resolveBuckExecutable();

    this.project = project;
    this.buckModule = project.getComponent(BuckModule.class);
    this.command = command;
    commandLine = new GeneralCommandLine();
    commandLine.setExePath(buckExecutable);
    workingDirectory = directory;
    commandLine.withWorkDirectory(workingDirectory);
    commandLine.addParameter(command.name());
    for (String parameter : command.getParameters()) {
      commandLine.addParameter(parameter);
    }
  }

  /** Start process */
  public synchronized void start() {
    checkNotStarted();

    buckModule
        .getBuckEventsConsumer()
        .sendAsConsoleEvent(commandLine.getCommandLineString(), TextType.INFO);
    try {
      startTime = System.currentTimeMillis();
      process = startProcess();
      startHandlingStreams();
    } catch (ProcessCanceledException e) {
      LOG.warn(e);
    } catch (Throwable t) {
      if (!project.isDisposed()) {
        LOG.error(t);
      }
    }
  }

  /** Stop process */
  public synchronized void stop() {
    process.destroy();
  }

  /** @return true if process is started. */
  public final synchronized boolean isStarted() {
    return process != null;
  }

  /**
   * Check that process is not started yet.
   *
   * @throws IllegalStateException if process has been already started
   */
  private void checkNotStarted() {
    if (isStarted()) {
      throw new IllegalStateException("The process has been already started");
    }
  }

  /**
   * Check that process is started.
   *
   * @throws IllegalStateException if process has not been started
   */
  protected final void checkStarted() {
    if (!isStarted()) {
      throw new IllegalStateException("The process is not started yet");
    }
  }

  public GeneralCommandLine command() {
    return commandLine;
  }

  /** @return a context project */
  public Project project() {
    return project;
  }

  /** Start the buck process. */
  @Nullable
  protected Process startProcess() throws ExecutionException {
    synchronized (processStateLock) {
      handler = createProcess(commandLine);
      return handler.getProcess();
    }
  }

  /** Start handling process output streams for the handler. */
  protected void startHandlingStreams() {
    if (handler == null) {
      return;
    }
    handler.addProcessListener(
        new ProcessListener() {
          public void startNotified(final ProcessEvent event) {}

          public void processTerminated(final ProcessEvent event) {
            BuckCommandHandler.this.processTerminated();
          }

          public void processWillTerminate(
              final ProcessEvent event, final boolean willBeDestroyed) {}

          public void onTextAvailable(final ProcessEvent event, final Key outputType) {
            BuckCommandHandler.this.onTextAvailable(event.getText(), outputType);
          }
        });
    if (doStartNotify) {
      handler.startNotify();
    }
  }

  protected boolean processExitSuccesfull() {
    return process.exitValue() == 0;
  }

  /** Wait for process termination. */
  public void waitFor() {
    checkStarted();
    if (handler != null) {
      // handler.waitFor will wait for a semaphore which will be released when the started
      // process terminates if doStartNotify is true.
      // If the following call never returns, please check the value of doStartNotify
      handler.waitFor();
    }
  }

  public OSProcessHandler createProcess(GeneralCommandLine commandLine) throws ExecutionException {
    // TODO(t7984081): Use ProcessExecutor to start buck process.
    Process process = commandLine.createProcess();
    return new OSProcessHandler(process, commandLine.getCommandLineString(), charset);
  }

  public void runInCurrentThread(@Nullable Runnable postStartAction) {
    if (!beforeCommand()) {
      return;
    }

    start();
    if (isStarted()) {
      if (postStartAction != null) {
        postStartAction.run();
      }
      waitFor();
    }
    afterCommand();
    logTime();
  }

  public void runInCurrentThreadPostEnd(@Nullable Runnable postEndAction) {
    if (!beforeCommand()) {
      return;
    }

    start();
    if (isStarted()) {
      waitFor();
    }
    afterCommand();
    if (postEndAction != null) {
      postEndAction.run();
    }
    logTime();
  }

  private void logTime() {
    if (startTime > 0) {
      long time = System.currentTimeMillis() - startTime;
      if (!LOG.isDebugEnabled() && time > LONG_TIME) {
        LOG.info(
            String.format(
                "buck %s took %s ms. Command parameters: %n%s",
                command, time, commandLine.getCommandLineString()));
      } else {
        LOG.debug(String.format("buck %s took %s ms", command, time));
      }
    } else {
      LOG.debug(String.format("buck %s finished.", command));
    }
  }

  protected void processTerminated() {
    if (stderrLine.length() != 0) {
      onTextAvailable("\n", ProcessOutputTypes.STDERR);
    }
  }

  protected void onTextAvailable(final String text, final Key outputType) {
    notifyLines(outputType, LineHandlerHelper.splitText(text));
  }

  /**
   * Notify listeners for each complete line. Note that in the case of stderr, the last line is
   * saved.
   */
  protected void notifyLines(final Key outputType, final Iterable<String> lines) {
    if (outputType == ProcessOutputTypes.STDERR) {
      StringBuilder stderr = new StringBuilder();
      for (String line : lines) {
        // Check if the line has at least one character or digit
        if (CHARACTER_DIGITS_PATTERN.matcher(line).matches()) {
          stderr.append(line);
        }
      }
      if (stderr.length() != 0) {
        buckModule.getBuckEventsConsumer().consumeConsoleEvent(stderr.toString());
      }
    }
  }

  protected abstract boolean beforeCommand();

  protected abstract void afterCommand();

  public OSProcessHandler getHandler() {
    return handler;
  }
}


text:
#ifndef __ASM_TRAP_H
#define __ASM_TRAP_H

#include <linux/list.h>

struct pt_regs;

struct undef_hook {
	struct list_head node;
	u32 instr_mask;
	u32 instr_val;
	u64 pstate_mask;
	u64 pstate_val;
	int (*fn)(struct pt_regs *regs, u32 instr);
};

void register_undef_hook(struct undef_hook *hook);
void unregister_undef_hook(struct undef_hook *hook);

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
static inline int __in_irqentry_text(unsigned long ptr)
{
	extern char __irqentry_text_start[];
	extern char __irqentry_text_end[];

	return ptr >= (unsigned long)&__irqentry_text_start &&
	       ptr < (unsigned long)&__irqentry_text_end;
}
#else
static inline int __in_irqentry_text(unsigned long ptr)
{
	return 0;
}
#endif

static inline int in_exception_text(unsigned long ptr)
{
	extern char __exception_text_start[];
	extern char __exception_text_end[];
	int in;

	in = ptr >= (unsigned long)&__exception_text_start &&
	     ptr < (unsigned long)&__exception_text_end;

	return in ? : __in_irqentry_text(ptr);
}

#endif


text:
package edu.upennlib.redirect;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.util.internal.TypeParameterMatcher;
import java.net.URLEncoder;

/**
 *
 * @author magibney
 */
@ChannelHandler.Sharable
public class WrapRedirect extends ChannelOutboundHandlerAdapter {

    private static final TypeParameterMatcher matcher = TypeParameterMatcher.get(HttpResponse.class);
    private static final CharSequence LOCATION = HttpHeaders.newNameEntity(HttpHeaders.Names.LOCATION);
    private final String prefix;

    public WrapRedirect(String prefix) {
        this.prefix = prefix;
    }

    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        if (matcher.match(msg)) {
            HttpResponse resp = (HttpResponse) msg;
            HttpHeaders headers = resp.headers();
            String rawLocation = headers.get(LOCATION);
            if (rawLocation != null) {
                headers.set(LOCATION, prefix.concat(URLEncoder.encode(rawLocation, "UTF-8")));
            }
        }
        super.write(ctx, msg, promise);
    }

}


text:
require 'spec_helper'

describe Virtus::Coercion::Numeric, '.to_integer' do
  subject { object.to_integer(numeric) }

  let(:object)  { described_class }
  let(:numeric) { Rational(2, 2)  }

  it { should eql(1) }
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
using System.Runtime.Serialization;
namespace XBMCRPC.VideoLibrary
{
   public class GetMusicVideosResponse
   {
       public XBMCRPC.List.LimitsReturned limits { get; set; }
       public global::System.Collections.Generic.List<XBMCRPC.Video.Details.MusicVideo> musicvideos { get; set; }
    }
}