text:
'''
Removes overlaping BED regions from another BED file.
'''

import os
import sys
from ngsutils.bed import BedFile, BedStreamer

def usage(msg=None):
    if msg:
        print 'ERROR: %s' % msg

    print __doc__
    print """\
Usage: bedutils subtract {opts} bedfile1 bedfile2

Returns:
    bedfile1 - bedfile2

Options:
    -nostrand       Ignore strand information when merging regions
"""
    sys.exit(1)

def bed_subtract(mainbed, removebed, stranded=True, out=sys.stdout):
    for mainregion in mainbed:
            regionlist = [mainregion,]
            changed = False

            while regionlist:
                cur = regionlist[0]
                regionlist = regionlist[1:]
                skip = False

                newstart = cur.start
                newend = cur.end

                for region in removebed.fetch(cur.chrom, cur.start, cur.end, cur.strand if stranded else None):
                    if region.start < newstart < newend < region.end:
                        # subtract out the entire region
                        skip = True
                        break

                    if newstart < region.start < region.end < newend:
                        # subtract a subregion - add the end to the list.
                        regionlist.append(cur.clone(start=region.end, end=newend, name='%s*' % cur.name))
                        newend = region.start
                        changed = True
                    elif region.start < newstart < region.end:
                        newstart = region.end
                        changed = True
                    elif region.start < newend < region.end:
                        newend = region.start
                        changed = True

                if not skip:
                    cur.start = newstart
                    cur.end = newend
                    if changed:
                        cur.name = "%s*" % cur.name

                    out.write('%s\n' % cur)

if __name__ == '__main__':
    fname1 = None
    fname2 = None
    stranded = True

    for arg in sys.argv[1:]:
        if arg == '-h':
            usage()
        elif arg == '-nostrand':
            stranded = False
        elif not fname1 and (arg == '-' or os.path.exists(arg)):
            fname1 = arg
        elif not fname2 and (arg == '-' or os.path.exists(arg)):
            fname2 = arg
        else:
            print "Unknown option: %s" % arg
            usage()

    if not fname1 or not fname2:
        usage()

    if fname1 == '-' and fname2 == '-':
        usage("Both input files can't be from stdin!")

    bed1 = BedStreamer(fname1)
    bed2 = BedFile(fname2)

    bed_subtract(bed1, bed2, stranded)

    bed2.close()


text:
FROM jupyterhub/singleuser

RUN conda install -c conda-forge jupyterlab

USER root
ADD startup.sh /srv/singleuser/startup.sh
RUN chmod +x /srv/singleuser/startup.sh

CMD ["/srv/singleuser/startup.sh"]

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <title>Simple Calculator </title>

Simple Calculator

Problem 1: Write a function called sum() that takes in two numbers as arguments and then returns the sum of those numbers.

Problem 2: Write a function called multiply() that takes in two numbers as arguments and then returns the product of those numbers.

Problem 3: Write a function called sumAndMultiply() that takes in THREE numbers as arguments and then returns two values in an array: the sum of those numbers and the product of those numbers.

Problem 4: Write a function called sumArray() that takes in an array of numbers as a single argument and then returns the sum of those numbers.

Problem 5: Write a function called multiplyArray() that takes in an array of numbers as a single argument and then returns the product of those numbers.


text:
(function () {
    'use strict';

    angular.module('firebase.config')
        .constant('FBURL', 'https://javascript-poll-demo.firebaseio.com');
})();


text:
class Header {

    constructor(siteGen, logoRelativePath, backgroundImage, siteName, logoWidth, logoHeight) {

        this.pages = siteGen.pageNames
        this.siteGen = siteGen
        this.headerDiv = siteGen.headerDiv
        this.siteName = siteName
        document.title = siteName

        this.logoRelativePath = logoRelativePath
        this.backgroundImage = backgroundImage

        this.logoWidth = logoWidth
        this.logoHeight = logoHeight

        this.links = ''

    }

    makeHeaderBody()
    {
        // max-width: 100%
        this.html = `

                        <a href="` + this.siteGen.filename + `">
                            ` + this.siteName + `

                        ` + this.links + `

`
    }

    onImageLoad()
    {

        let logoImgElement = document.getElementById("logo_img")
        let logo_img_div = document.getElementById("logo_img_div")
        logoImgElement.src = this.logo_img.src

        if ((this.logoWidth == -1) && (this.logoHeight == -1)){
            this.logoWidth = this.logo_img.width
            this.logoHeight = this.logo_img.height
        }
        else {
            logo_img_div.style.width = this.logoWidth
            logo_img_div.style.height = this.logoHeight

            logoImgElement.style.width = this.logoWidth
            logoImgElement.style.height = this.logoHeight
        }
    }

    loadLogo() {

        this.logo_img = new Image();
        this.logo_img.src = this.logoRelativePath;
        this.logo_img.onload = () => this.onImageLoad();
    }

    setPage(pageName) {

        this.pages.push(pageName)
    }

    onPageClick(pageName)
    {
        siteGen.pageChanged(pageName)
    }

    updateSelected(newPageIndex) {

        let oldIndex = this.currentPageIndex
        let oldID = "header_link_" + oldIndex

        this.currentPageIndex = newPageIndex
        let newID = "header_link_" + newPageIndex

        let ulElementOld = document.getElementById(oldID)
        let ulElementNew = document.getElementById(newID)

        ulElementOld.setAttribute("class", "notCurrent");
        ulElementNew.setAttribute("class", "current");
    }

    insert() {

        this.makeHeaderBody()
        this.header  = document.createElement("header");
        this.header.setAttribute("role", "banner");
        this.header.style["width"] = '100%'
        this.header.style["height"] = '138px'

        this.header.style["background-image"] = this.backgroundImage

        this.header.innerHTML = this.html
        this.headerDiv.appendChild(this.header);

        this.loadLogo()

        this.ulElement = document.getElementById("header_ul")
        function insertPage(ul, pageName, index, onClick, filename)
        {
            var li  = document.createElement("li");
            //let href = filename + '?page=' + index
            let href = ''
            let linkID = ' id = "header_link_' + index + '" '
            if (index == siteGen.currentPageIndex) {

                li.innerHTML = `<li ` + linkID + ` class="current">
                    ` + pageName + `

`
            }
            else {

                li.innerHTML = `<li ` + linkID + ` class="">
                    ` + pageName + `

`
            }
            li.onclick = () => (onClick(pageName))
            li.style.cursor = 'pointer'
            ul.appendChild(li)
        }

        for(let i = 0; i < this.pages.length; i++)
        {
            let pageName = this.pages[i]
            insertPage  (   this.ulElement,
                            pageName,
                            i,
                            this.onPageClick,
                            this.siteGen.filename
                        )
        }
        this.currentPageIndex = siteGen.currentPageIndex
    }
}


text: javac -cp descriptor.jar:commons-codec-1.4.jar ExtractClientSpeedTrends.java && java -Xmx4000m -cp descriptor.jar:commons-codec-1.4.jar:. ExtractClientSpeedTrends


text:
**[1.0.0]**
\- Initial release
\- Android: basic support for Database, Analytics, Storage, App, Authorization, Crash
\- Ios-moe: basic support for Database, Analytics, Storage, App, Authorization, Crash

**[1.1.0]**
\- GWT: Authorization, Database, Storage
\- GdxFirebaseUser: Add the email field

**[1.1.1]**
\- API Addition: Sign-out method in authorization API for android, ios and gwt
\- libGDX updated to version 1.9.8
\- Multi-OS engine updated to version 1.4.1

**[1.2.0]**
\- API Addition: The GdxFIRLogger is now available for debugging
\- API Change: ***Braking change*** @MapConversion annotation is needed now - all database pojo conversions   should be provided by this annotation
\- API Addition: ***GdxFIRDatabase#setMapConverter*** allows to setup own MapConversion flow
\- API Fix: The new ios frameworks paths for latest Pods in firebase.nbc

**[1.3.0]**
\- API Addition: Database ordering&filtering API for Android and iOS

**[1.3.1]**
\- fix: TS in distributions singletons

**[1.4.1]**
\- API Change: The downloadUrl field in FileMetadata is loaded in async way
\- fix: #6 ios firebase sdk 5.x
\- API Change: android firebase sdk 16.x

**[1.5.1]**
\- API Addition: Google authorization for android
\- API Addition: Google authorization for ios
\- API Addition: Google authorization for gwt
\- API Fix: Fix the sign-out callback for gwt
\- API Change: The multi-os engine bindings are delivery with library so no longer needs to generate bindings yourself

**[1.6.1]**
\- API Change: GdxFIRCrash use Crashlytics now, if you have project with older version  - go to the wiki page and update your project
\- General: Minor bugs fix and improvements

**[1.6.2]**
\- fix: Fix for detaching of listeners when call ***GdxFIRDatabase#onDataChange(class, null)***

**[1.6.3]**
\- fix: Fix of wrong query execution for ***GdxFIRDatabase#readValue*** at GWT API
\- fix: Fix of getting the wrong argument in query for ***GdxFIRDatabase#removeValue(callback)*** at GWT API

**[1.7.1]**
\- API Addition: Database Filtering&Sorting support for GWT platform
\- General: Minor bugs fix and improvements for GWT platform

**[1.8.1]**
\- API Addition: User-manage methods (update email, update password, send verification email)
\- API Addition: **GdxFIRAuth#sendPasswordResetEmail**
\- GWT API: Fix of broken signing-in after user creation

**[1.9.1]**

\- API Addition: #reload() method in User API

**[1.9.2]**

\- fix: #13 [iOS Database] Can't read string value

**[1.9.3]**

\- fix: Wrong string/number param recognizing while sending analytics event in android api

**[1.9.4]**

\- fix: Run setScreen on the main thread in analytics api

**[2.0.0]**  | ***breaking changes***

\- the api packaging had changed to *pl.mk5.gdx.fireapp* as the base package
\- promises introduction
\- ***GdxFIRStorage#upload*** signature has changed
\- firebase actions chaining
\- shorter version of *.instance()* method: *.inst()* in all GdxFIR classes

**[2.0.1]**
\- ISSUE #16 - API Change: allows Map to be filtered

**[2.1.0]**
\- ISSUE #18 - API Addition: add new #onChildChange in database API

**[3.0.1]**  | ***breaking changes***
\- ISSUE #40 - API Change: RoboVM backend
\- Drop ios-moe support
\- Upgrade to libgdx 1.9.12


text:
package io.ddf.flink.content

import io.ddf.DDF
import io.ddf.content.{ConvertFunction, Representation}
import io.ddf.exception.DDFException
import org.apache.flink.api.scala.DataSet
import org.apache.flink.ml.common.LabeledVector
import org.apache.flink.ml.math.{Vector => FVector, DenseVector}
import org.apache.flink.api.scala._

class ArrayDouble2Vector (@transient ddf: DDF) extends ConvertFunction(ddf) {
  override def apply(representation: Representation): Representation = {
    val numCols = ddf.getNumColumns
    representation.getValue match {
      case dataset: DataSet[Array[Double]] => {
        val vector: DataSet[FVector] = dataset.map {
          row => DenseVector(row)
        }
        new Representation(vector, RepresentationHandler.DATASET_VECTOR.getTypeSpecsString)
      }
      case _ => throw new DDFException("Error getting RDD[Vector]")
    }
  }

}


text:
using System;
using System.Collections.Generic;
using System.Text;
using FlatRedBall;
using FlatRedBall.Input;
using FlatRedBall.Instructions;
using FlatRedBall.AI.Pathfinding;
using FlatRedBall.Graphics.Animation;
using FlatRedBall.Graphics.Particle;

using FlatRedBall.Math.Geometry;
using FlatRedBall.Math.Splines;

using Cursor = FlatRedBall.Gui.Cursor;
using GuiManager = FlatRedBall.Gui.GuiManager;
using FlatRedBall.Localization;
using Microsoft.Xna.Framework;
using FishKing.Entities;
using FishKing.DataTypes;
using System.Collections.Specialized;
using System.Linq;
using FlatRedBall.TileCollisions;
using FishKing.Enums;
using static FishKing.Enums.WaterTypes;
using Microsoft.Xna.Framework.Audio;
using FishKing.UtilityClasses;
using Microsoft.Xna.Framework.Media;
using FlatRedBall.Math;
using FlatRedBall.Gui;
using FishKing.Managers;
using FishKing.GameClasses;

#if FRB_XNA || SILVERLIGHT
using Keys = Microsoft.Xna.Framework.Input.Keys;
using Vector3 = Microsoft.Xna.Framework.Vector3;
using Texture2D = Microsoft.Xna.Framework.Graphics.Texture2D;
#endif
#endregion

namespace FishKing.Screens
{
	public partial class GameScreen
	{
        static string _levelToLoad = "WaterfallPool";
        static string _startPointName = "FirstSpawn";
        private bool _wasFishing = false;
        private bool _shouldUpdateCamera;
        private SoundEffectInstance _fishCaughtSound;
        private SoundEffectInstance _tournamentEndSound;

        bool CanMoveCharacter => !DialogDisplayInstance.Visible && !FishCatchingInterfaceInstance.Visible &&
                                 !CharacterInstance.IsPullingInCatch &&
                                 (!CharacterInstance.IsDisplayingCatch || CharacterInstance.HasFinishedDisplayingCatch);

	    void CustomInitialize()
        {
            InitializePauseMenuButtons();

            bool shouldInitializeSimulator = false;
            if (!TournamentManager.TournamentHasStarted
#if DEBUG
                && !DebuggingVariables.MapDebugMode
#endif
                )
            {
                TournamentManager.StartTournament();
                _levelToLoad = TournamentManager.CurrentTournament.MapName;
                shouldInitializeSimulator = true;
                SaveGameManager.CurrentSaveData.StartPlaySession();
            }

            LoadLevel(_levelToLoad);

            InitializeCharacter();

            InitializeCamera();

            TournamentStatusInstance.Setup(this);
            if (shouldInitializeSimulator)
            {
                TournamentSimulator.Initialize(TournamentManager.CurrentTournament.NumberOfParticipants, CurrentTileMap.GetAllWaterTypes());
            }

#if DEBUG
            if (DebuggingVariables.MapDebugMode)
            {
                RestartVariables.Add("this.CharacterInstance.X");
                RestartVariables.Add("this.CharacterInstance.Y");
            }
#endif
        }

        private void InitializePauseMenuButtons()
        {
            PauseMenuInstance.ResumeGameButtonClick += (IWindow window) => { UnpauseThisScreen(); PauseMenuInstance.Visible = false; };
            PauseMenuInstance.HelpButtonClick += (IWindow window) => { HelpScreenInstance.Visible = true; };
            PauseMenuInstance.ExitButtonClick += (IWindow window) => {
                PopupMessageInstance.CurrentPopupDisplayState = GumRuntimes.PopupMessageRuntime.PopupDisplay.OKCancel;
                PopupMessageInstance.TitleText = "Confirm Quit";
                PopupMessageInstance.PopupText = "Return to the main menu and abandon this tournament?";
                PopupMessageInstance.CancelButtonClick += (IWindow win) => { PopupMessageInstance.Visible = false; };
                PopupMessageInstance.OKButtonClick += (IWindow win) =>
                {
                    SaveAndReturnToMainMenu();
                };
                PopupMessageInstance.Visible = true;
            };
        }

        private void InitializeCamera()
        {
            var camera = Camera.Main;
            camera.ClearBorders();
            camera.ClearMinimumsAndMaximums();
            if (CurrentTileMap.Width > camera.OrthogonalWidth || CurrentTileMap.Height > camera.OrthogonalHeight)
            {
                _shouldUpdateCamera = true;

                camera.MinimumX = (camera.OrthogonalWidth / 2);
                camera.MaximumX = (CurrentTileMap.Width) - (camera.OrthogonalWidth / 2);
                camera.MinimumY = -CurrentTileMap.Height + camera.OrthogonalHeight / 2;
                camera.MaximumY = -(camera.OrthogonalHeight / 2) + TournamentStatusInstance.AbsoluteHeight;
                camera.X = this.CharacterInstance.X;
                camera.Y = this.CharacterInstance.Y;
            }
            else
            {
                _shouldUpdateCamera = false;
                camera.X = CurrentTileMap.Width / 2;
                camera.Y = -CurrentTileMap.Height / 2;
            }
        }

        private void HandleNewNpc(object sender, NotifyCollectionChangedEventArgs e)
        {
            foreach(var item in e.NewItems)
            {
                (item as Character).ReactToReposition();
            }
        }

        void LoadLevel(string levelToLoad)
        {
            InitializeLevel(levelToLoad);
            AddCollisions();
            RemoveBridgedCollisions();
            AddWaterTiles();
            RemoveBlockeddWaterTiles();
            AdjustNpcs();

#if DEBUG
            this.SolidCollisions.Visible =
                DebuggingVariables.ShowShapes;
#else
            this.SolidCollisions.Visible = false;
#endif

            if (levelToLoad.Contains("Cave"))
            {
                CaveLightConeSprite.Position = Camera.Main.Position;
                CaveLightConeSprite.Visible = true;
                CaveLightConeSprite.Z = -1;
            }
            else
            {
                CaveLightConeSprite.Visible = false;
            }
            AmbientAudioManager.CurrentTileMap = CurrentTileMap;
        }

        private void AdjustNpcs()
        {
            foreach(var character in NpcCharacterList)
            {
                character.ReactToReposition();
            }
        }

        private void InitializeCharacter()
        {
            var foundStartPoint = this.StartPointList.FirstOrDefault(item => item.Name == _startPointName);
            if(foundStartPoint == null)
            {
                throw new Exception($"Could not find start point with a name of {_startPointName}");
            }
            this.CharacterInstance.X = foundStartPoint.X;
            this.CharacterInstance.Y = foundStartPoint.Y;

            this.CharacterInstance.ReactToReposition();

            var gamePad = InputManager.Xbox360GamePads[0];

            var movementInputs = new Multiple2DInputs();
            movementInputs.Inputs.Add(InputManager.Keyboard.Get2DInput(
                Keys.A, Keys.D, Keys.W, Keys.S));
            movementInputs.Inputs.Add(InputManager.Keyboard.Get2DInput(
                Keys.Left, Keys.Right, Keys.Up, Keys.Down));
            if (InputManager.NumberOfConnectedGamePads > 0)
            {
                movementInputs.Inputs.Add(gamePad.DPad);
                movementInputs.Inputs.Add(gamePad.LeftStick);
            }

            var actionInputs = new MultiplePressableInputs();
            actionInputs.Inputs.Add(InputManager.Keyboard.GetKey(Keys.Space));
            actionInputs.Inputs.Add(InputManager.Keyboard.GetKey(Keys.Enter));
            if (InputManager.NumberOfConnectedGamePads > 0)
            {
                actionInputs.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.A));
                actionInputs.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.Y));
                actionInputs.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.X));
                actionInputs.Inputs.Add(InputManager.Xbox360GamePads[0].GetButton(Xbox360GamePad.Button.B));
            }

            var alignmentInputs = new Multiple1DInputs();
            var leftMouseButton = new PressableTo1DInput(InputManager.Mouse.GetButton(Mouse.MouseButtons.LeftButton));
            alignmentInputs.Inputs.Add(leftMouseButton);
            if (InputManager.NumberOfConnectedGamePads > 0)
            {
                var rightTrigger = new AnalogButtonTo1DInput(gamePad.RightTrigger);
                alignmentInputs.Inputs.Add(rightTrigger);
            }

            var reelingInputs = new Multiple1DInputs();
            var leftShift = new PressableTo1DInput(InputManager.Keyboard.GetKey(Keys.LeftShift));
            reelingInputs.Inputs.Add(leftShift);
            var rightShift = new PressableTo1DInput(InputManager.Keyboard.GetKey(Keys.RightShift));
            reelingInputs.Inputs.Add(rightShift);
            if (InputManager.NumberOfConnectedGamePads > 0)
            {
                var leftTrigger = new AnalogButtonTo1DInput(gamePad.LeftTrigger);
                reelingInputs.Inputs.Add(leftTrigger);
            }

            var escapeInputs = new MultiplePressableInputs();
            escapeInputs.Inputs.Add(InputManager.Keyboard.GetKey(Keys.Escape));
            if (InputManager.NumberOfConnectedGamePads > 0)
            {
                escapeInputs.Inputs.Add(gamePad.GetButton(Xbox360GamePad.Button.Start));
                escapeInputs.Inputs.Add(gamePad.GetButton(Xbox360GamePad.Button.B));
            }

            var helpInputs = new MultiplePressableInputs();
            helpInputs.Inputs.Add(InputManager.Keyboard.GetKey(Keys.F1));
            if (InputManager.NumberOfConnectedGamePads > 0)
            {
                helpInputs.Inputs.Add(gamePad.GetButton(Xbox360GamePad.Button.Back));
            }

            this.CharacterInstance.MovementInput = movementInputs;
            this.CharacterInstance.ActionInput = actionInputs;
            this.CharacterInstance.FishingAlignmentInput = alignmentInputs;
            this.CharacterInstance.ReelingInput = reelingInputs;
            this.CharacterInstance.EscapeInput = escapeInputs;
            this.CharacterInstance.HelpInput = helpInputs;

            var overlayLayer = CurrentTileMap.MapLayers.FindByName("Overlay");
            if (overlayLayer != null)
            {
                this.CharacterInstance.Position.Z = overlayLayer.Z - 0.5f;
            }
            else
            {
                this.CharacterInstance.Position.Z = CurrentTileMap.MapLayers.Count - 2;
            }
            AmbientAudioManager.CharacterInstance = CharacterInstance;
            AmbientAudioManager.UpdateAmbientSoundSources();
        }

        void CustomActivity(bool firstTimeCalled)
		{
#if DEBUG
            if (FlatRedBall.Input.InputManager.Keyboard.GetKey(Keys.F5).WasJustPressed)
            {
                RestartScreen(reloadContent: true);
            }
#endif
            MusicManager.Update();
            if (CharacterInstance.EscapeInput.WasJustPressed && !TournamentStatusInstance.HasStartedCelebration)
            {
                if (HelpScreenInstance.Visible)
                {
                    HelpScreenInstance.Visible = false;
                }
                else
                {
                    PauseMenuInstance.Visible = !PauseMenuInstance.Visible;

                    if (PauseMenuInstance.Visible)
                    {
                        PauseThisScreen();
                    }
                    else
                    {
                        UnpauseThisScreen();
                    }
                }
            }

            FlatRedBallServices.Game.IsMouseVisible = IsPaused;
            if (IsPaused)
            {
                HandlePauseInput();
            }
            else
            {
#if DEBUG
                if (DebuggingVariables.TournamentScoresYUIOP)
                {
                    if (InputManager.Keyboard.GetKey(Keys.Y).WasJustPressed)
                    {
                        TournamentManager.CurrentScores.AddToNonPlayerScore(1, 10);
                    }
                    if (InputManager.Keyboard.GetKey(Keys.U).WasJustPressed)
                    {
                        TournamentManager.CurrentScores.AddToNonPlayerScore(2, 10);
                    }
                    if (InputManager.Keyboard.GetKey(Keys.I).WasJustPressed)
                    {
                        TournamentManager.CurrentScores.AddToNonPlayerScore(3, 10);
                    }
                    if (InputManager.Keyboard.GetKey(Keys.O).WasJustPressed)
                    {
                        TournamentManager.CurrentScores.AddToNonPlayerScore(4, 10);
                    }
                    if (InputManager.Keyboard.GetKey(Keys.P).WasJustPressed)
                    {
                        TournamentManager.CurrentScores.AddToNonPlayerScore(5, 10);
                    }
                    if (InputManager.Keyboard.GetKey(Keys.T).WasJustPressed)
                    {
                        TournamentManager.CurrentScores.AddToPlayerScore(10);
                    }
                }
#endif

#if DEBUG
                if (DebuggingVariables.MapDebugMode)
                {
                    if (_shouldUpdateCamera) UpdateCamera();
                    DialogActivity();
                    FishingActivity();

                    bool characterMoved = false;
                    if (CanMoveCharacter)
                    {
                        characterMoved = this.CharacterInstance.PerformMovementActivity(this.SolidCollisions, NpcCharacterList);
                    }

                    CharacterInstance.UpdateFishingStatus(characterMoved);
                    this.CharacterInstance.SetSpriteOffset();

                    CollisionActivity();
                    if (CharacterInstance.IsMoving)
                    {
                        AmbientAudioManager.UpdateAmbientSoundSources();
                    }
                }
                else
                {
#endif
                    if (TournamentManager.CurrentScores.HasPlayerFinished)
                    {
                        if (!ResultsDisplayInstance.Visible)
                        {
                            TournamentStatusInstance.UpdateFishPlaceMarkers(TournamentManager.CurrentScores.AsArray);
                            TournamentManager.EndTournament();

                            if (TournamentManager.CurrentScores.PlayerPlace <= 3)
                            {
                                _tournamentEndSound = GlobalContent.TournamentWin.CreateInstance();
                            } else
                            {
                                _tournamentEndSound = GlobalContent.TournamentLose.CreateInstance();
                            }
                            _tournamentEndSound.Volume = OptionsManager.Options.SoundEffectsVolume;
                            _tournamentEndSound.Play();

                            ResultsDisplayInstance.DisplayResults(TournamentManager.CurrentTournamentResults);
                            ResultsDisplayInstance.OKButtonClick += ResultsDisplayOkClick;
                            ResultsDisplayInstance.Visible = true;

                            TournamentStatusInstance.StartCelebration();
                        }
                        else if (CharacterInstance.EscapeInput.WasJustPressed || CharacterInstance.ActionInput.WasJustPressed)
                        {
                            ResultsDisplayInstance.ClickOK();
                        }
                    }
                    else
                    {
#if DEBUG
                        if (DebuggingVariables.SimulateTournamentScores)
                        {
                            TournamentManager.CurrentScores.SimulateTournament();
                        }
#endif
                        TournamentSimulator.Update();
                        if (TournamentManager.CurrentScores.HasScoreChanged)
                        {
                            TournamentStatusInstance.UpdateFishPlaceMarkers(TournamentManager.CurrentScores.AsArray);
                            TournamentManager.CurrentScores.MarkScoreReviewed();
                        }
                        if (_shouldUpdateCamera) UpdateCamera();
                        DialogActivity();
                        FishingActivity();

                        bool characterMoved = false;
                        if (CanMoveCharacter)
                        {
                            characterMoved = this.CharacterInstance.PerformMovementActivity(this.SolidCollisions, NpcCharacterList);
                        }

                        CharacterInstance.UpdateFishingStatus(characterMoved);
                        this.CharacterInstance.SetSpriteOffset();

                        CollisionActivity();
                        if (CharacterInstance.IsMoving)
                        {
                            AmbientAudioManager.UpdateAmbientSoundSources();
                        }

                        if (CharacterInstance.HelpInput.WasJustPressed)
                        {
                            PauseThisScreen();
                            PauseMenuInstance.Visible = true;
                            PauseMenuInstance.ShowHelp();
                        }
                    }
#if DEBUG
                }
#endif
            }
        }

        private void ResultsDisplayOkClick(IWindow window)
        {
            SaveGameManager.CurrentSaveData.AddTournamentResult(TournamentManager.CurrentTournamentResults);
            SaveAndReturnToMainMenu();
        }

        private void SaveAndReturnToMainMenu()
        {
            SaveGameManager.CurrentSaveData.StopPlaySession();
            SaveGameManager.SaveCurrentData();
            MusicManager.Stop();
            LoadingScreen.TransitionToScreen(typeof(MainMenu));
        }

        private void HandlePauseInput()
        {
            if (PopupMessageInstance.Visible)
            {
                if (CharacterInstance.ActionInput.WasJustPressed)
                {
                    PopupMessageInstance.HandleSelection();
                }
                else
                {
                    PopupMessageInstance.HandleMovement(CardinalTimedDirection.GetDesiredDirection(CharacterInstance.MovementInput));
                }
            }
            else
            {
                if (CharacterInstance.HelpInput.WasJustPressed)
                {
                    HelpScreenInstance.Visible = false;
                    PauseMenuInstance.Visible = false;
                    UnpauseThisScreen();
                }
                else
                {
                    PauseMenuInstance.HandleMovement(CharacterInstance.MovementInput);
                    PauseMenuInstance.HandleSelection(CharacterInstance.ActionInput);
                    if (HelpScreenInstance.Visible && CharacterInstance.EscapeInput.WasJustPressed)
                    {
                        HelpScreenInstance.Visible = false;
                    }
                }
            }
        }

        private void UpdateCamera()
        {
            Camera.Main.X = this.CharacterInstance.X;
            Camera.Main.Y = this.CharacterInstance.Y;
        }

        private void DialogActivity()
        {
            if (CharacterInstance.IsAttemptingAction)
            {
                if (this.DialogDisplayInstance.Visible)
                {
                    this.DialogDisplayInstance.Visible = false;
                }
                else
                {
                    Character npcTalkingTo = null;
                    foreach (var npc in this.NpcCharacterList)
                    {
                        if (CharacterInstance.ActionCollision.CollideAgainst(npc.BackwardCollision))
                        {
                            npcTalkingTo = npc;
                            break;
                        }
                    }

                    if(npcTalkingTo != null)
                    {
                        ShowDialog(npcTalkingTo.Dialog);
                    }
                }
            }
            CharacterInstance.IsInDialog = DialogDisplayInstance.Visible;
        }

        private void FishingActivity()
        {
            if ((CharacterInstance.IsMoving && FishCatchingInterfaceInstance.HasAttachedFish) ||
                (CharacterInstance.IsAttemptingAction && CharacterInstance.HasFinishedDisplayingCatch))
            {
                FishCatchingInterfaceInstance.Reset();
                CharacterInstance.ResetFishingStatus();
            }

            var characterJustReleased = CharacterInstance.IsCastingRod && CharacterInstance.ActionInput.WasJustReleased;

            var characterJustStartedfishing = CharacterInstance.IsAttemptingAction && !CharacterInstance.IsInDialog &&
                !CharacterInstance.IsFishing && !CharacterInstance.IsCastingRod && !CharacterInstance.IsMoving &&
                !CharacterInstance.IsAttemptingMovement;

            var tileSize = (float)CurrentTileMap.WidthPerTile;

            if (characterJustStartedfishing)
            {
                CharacterInstance.HasInitiatedCatching = false;
                CharacterInstance.IsCastingRod = true;

                ProgressBarInstance.ResetProgress();
                ProgressBarInstance.PositionProgressBarOver(CharacterInstance.Position);

                var targetStartX = CharacterInstance.Position.X;
                var targetStartY = CharacterInstance.Position.Y;
                switch (CharacterInstance.DirectionFacing)
                {
                    case Direction.Left: targetStartX -= tileSize*2.5f; break;
                    case Direction.Right: targetStartX += tileSize * 2.5f; break;
                    case Direction.Up: targetStartY += tileSize * 2.5f; break;
                    case Direction.Down: targetStartY -= tileSize * 2.5f; break;
                }

                TargetingSpriteInstance.Position = new Vector3(targetStartX, targetStartY, CharacterInstance.Position.Z + 1);
                CharacterInstance.TargetPosition = TargetingSpriteInstance.Position;
            }
            else if (CharacterInstance.IsOnWindUp)
            {
                ProgressBarInstance.Update();

                var percentPower = (float)Decimal.Divide(ProgressBarInstance.Progress, 100);
                var maxDistance = CharacterInstance.MaxDistanceTileCast * tileSize;
                var effectiveDistance = (tileSize*2.5f) + (maxDistance * percentPower);

                var targetNewX = CharacterInstance.Position.X;
                var targetNewY = CharacterInstance.Position.Y;

                switch (CharacterInstance.DirectionFacing)
                {
                    case Direction.Left: targetNewX += -effectiveDistance; break;
                    case Direction.Right: targetNewX += effectiveDistance; break;
                    case Direction.Up: targetNewY += effectiveDistance; break;
                    case Direction.Down: targetNewY += -effectiveDistance; break;
                }
                TargetingSpriteInstance.Position = new Vector3(targetNewX, targetNewY, CharacterInstance.Position.Z + 1);
                CharacterInstance.TargetPosition = TargetingSpriteInstance.Position;
            }
            else if (CharacterInstance.JustReleasedCast)
            {
                var waterType = GetWaterType();
                if (waterType == WaterType.None)
                {
                    CharacterInstance.ResetFishingStatus();
                }
            }
            else if (CharacterInstance.IsFishing)
            {
                if (CharacterInstance.HasFishOnTheLine)
                {
                    if (CharacterInstance.HasInitiatedCatching)
                    {
                        if (!FishCatchingInterfaceInstance.HasAttachedFish)
                        {
                             FishCatchingInterfaceInstance.AttachFish(CharacterInstance.FishOnTheLine, GetWaterType());
                        }
                        if (FishCatchingInterfaceInstance.FishIsCaught)
                        {
                            FishCatchingInterfaceInstance.Stop();
                            if (!CharacterInstance.IsPullingInCatch && !CharacterInstance.IsDisplayingCatch)
                            {
                                CharacterInstance.HandleFishCaught();
                            } else if(CharacterInstance.IsDisplayingCatch && CharacterInstance.IsOnFinalFrameOfAnimationChain && !FishCatchDisplayInstance.Visible)
                            {
                                var fish = CharacterInstance.FishOnTheLine;
                                var newCatch = SaveGameManager.CurrentSaveData.AddCaughtFish(fish);
                                var fishMeetsReq = TournamentManager.CurrentTournament.DoesFishMeetRequirements(fish);

                                FishCatchDisplayInstance.ShowFish(fish, newCatch);

                                if (_fishCaughtSound != null && !_fishCaughtSound.IsDisposed)
                                {
                                    _fishCaughtSound.Dispose();
                                }

                                if (fishMeetsReq)
                                {
                                    if (newCatch)
                                    {
                                        _fishCaughtSound = GlobalContent.NewFishCaught.CreateInstance();
                                    }
                                    else
                                    {
                                        _fishCaughtSound = GlobalContent.FishCaught.CreateInstance();
                                    }
                                }
                                else
                                {
                                    if (newCatch)
                                    {
                                        _fishCaughtSound = GlobalContent.IneligibleNewFishCatch.CreateInstance();
                                    }
                                    else
                                    {
                                        _fishCaughtSound = GlobalContent.IneligibleFishCatch.CreateInstance();
                                    }
                                }
                                _fishCaughtSound.Volume = OptionsManager.Options.SoundEffectsVolume;
                                _fishCaughtSound.Play();

                                if (fishMeetsReq)
                                {
                                    TournamentManager.CurrentScores.AddToPlayerScore(fish.Points);
                                }
                            }
                        }
                        else
                        {
                            if (FishCatchingInterfaceInstance.LineHasSnapped)
                            {
                                if (FishCatchingInterfaceInstance.FishHasEscaped)
                                {
                                    CharacterInstance.ResetFishingStatus();
                                    CharacterInstance.StandStill();
                                    FishCatchingInterfaceInstance.Reset();
                                    FishCatchingInterfaceInstance.Visible = false;
                                }
                            }
                            else
                            {
                                if (CharacterInstance.IsHoldingAlignButton)
                                {
                                    FishCatchingInterfaceInstance.RaiseAlignmentBar(CharacterInstance.AlignAmount);
                                }
                                if (CharacterInstance.IsHoldingReelButton)
                                {
                                    FishCatchingInterfaceInstance.SpinReel(CharacterInstance.ReelAmount);
                                }
                            }
                            FishCatchingInterfaceInstance.Update();
                        }
                    }
                }
                else
                {
                    var rnd = new Random();
                    var catchChance = 0.0025;
                    var catchRoll = rnd.NextDouble();

                    if (
#if DEBUG
                    DebuggingVariables.ImmediatelyCatchFish ||
#endif
                        catchRoll <= catchChance)
                    {
                        var fish = FishGenerator.CreateFish(GetWaterType());
                        CharacterInstance.FishOnTheLine = fish;
                    }
                }
            }

            FishCatchingInterfaceInstance.Visible = CharacterInstance.HasInitiatedCatching && !FishCatchingInterfaceInstance.FishIsCaught;
            ProgressBarInstance.Visible = CharacterInstance.IsOnWindUp;
            TargetingSpriteInstance.Visible = CharacterInstance.IsOnWindUp;
            FishCatchDisplayInstance.Visible = (CharacterInstance.IsDisplayingCatch && CharacterInstance.IsOnFinalFrameOfAnimationChain);

            if (_wasFishing  && !CharacterInstance.IsFishing)
            {
                FishCatchingInterfaceInstance.Stop();
            }

            _wasFishing = CharacterInstance.IsFishing;
        }

        private void ShowDialog(string stringId)
        {
            this.DialogDisplayInstance.Visible = true;
            this.DialogDisplayInstance.Text = LocalizationManager.Translate(stringId);
        }

        private void CollisionActivity()
        {
            foreach(var trigger in MapNavigationTriggerList)
            {
                if(CharacterInstance.BackwardCollision.CollideAgainst(trigger.Collision))
                {
                    _levelToLoad = trigger.TargetMap;
                    _startPointName = trigger.StartPointName;

                    if(string.IsNullOrEmpty(_startPointName))
                    {
                        throw new Exception("Trigger has an empty StartPointName");
                    }

                    RestartScreen(reloadContent: false);
                }
            }

        }

        private WaterType GetWaterType()
        {
            var tile = WaterTiles.GetTileAt(TargetingSpriteInstance.X, TargetingSpriteInstance.Y);
            if (tile == null)
            {
                return WaterType.None;
            }
            else
            {
                return WaterTypeNameToEnum(tile.Name);
            }
        }

        private void AddWaterTiles()
        {
            var waterNames = new List<string>() { "IsOcean", "IsDeepOcean", "IsLake", "IsCaveLake", "IsRiver", "IsPond", "IsDeepOcean", "IsWaterfall" };
            WaterTiles.AddWaterFrom(CurrentTileMap, (List =>
                List.Any(item => waterNames.Contains(item.Name))
                ));
            WaterTiles.Visible = false;
        }

        private void RemoveBlockeddWaterTiles()
        {
            var nonWaterLayers = new System.Collections.Generic.List<string>() { "Bridge", "Boat" };
            WaterTiles.RemoveCollisionsFromLayer(CurrentTileMap, nonWaterLayers);
        }

        private void AddCollisions()
        {
            SolidCollisions.AddCollisionFrom(CurrentTileMap,
                 (list =>
                 list.Any(item => item.Name == "HasCollision")));

            var collisionLayers = new System.Collections.Generic.List<string>() { "Walls", "Water" };
            SolidCollisions.AddCollisionFromLayer(CurrentTileMap, collisionLayers);
        }

        private void RemoveBridgedCollisions()
        {
            var nonCollisionLayers = new System.Collections.Generic.List<string>() { "Bridge", "Boat" };
            SolidCollisions.RemoveCollisionsFromLayer(CurrentTileMap, nonCollisionLayers);
        }

        void CustomDestroy()
        {
            AmbientAudioManager.RemoveAmbientAudioSources();
            if (_tournamentEndSound != null && !_tournamentEndSound.IsDisposed)
            {
                _tournamentEndSound.Dispose();
            }
            if (_fishCaughtSound != null && !_fishCaughtSound.IsDisposed)
            {
                _fishCaughtSound.Dispose();
            }
        }

        static void CustomLoadStaticContent(string contentManagerName)
        {

        }

	}
}


text:
package com.gokuai.library;

/**
 * Created by Brandon on 2016/10/12.
 */
public class Config {
    public static final boolean PRINT_DEBUG = true;

}


text:
/** @addtogroup lwext4
 * @{
 */
/**
 * @file  ext4_super.c
 * @brief Superblock operations.
 */

#ifndef EXT4_SUPER_H_
#define EXT4_SUPER_H_

#include <ext4_config.h>
#include <ext4_types.h>

/**@brief   Blocks count get stored in superblock.
 * @param   s superblock descriptor
 * @return  count of blocks*/
static inline uint64_t ext4_sb_get_blocks_cnt(struct ext4_sblock *s)
{
    return ((uint64_t) to_le32(s->blocks_count_hi) << 32) |
            to_le32(s->blocks_count_lo);
}

/**@brief   Free blocks count get stored in superblock.
 * @param   s superblock descriptor
 * @return  free blocks*/
static inline uint64_t ext4_sb_get_free_blocks_cnt(struct ext4_sblock *s)
{
    return ((uint64_t) to_le32(s->free_blocks_count_hi) << 32) |
            to_le32(s->free_blocks_count_lo);
}

/**@brief   Free blocks count set.
 * @param   s superblock descriptor
 * @param   cnt new value of free blocks*/
static inline void ext4_sb_set_free_blocks_cnt(struct ext4_sblock *s,
    uint64_t cnt)
{
    s->free_blocks_count_lo = to_le32((cnt << 32) >> 32);
    s->free_blocks_count_hi = to_le32(cnt >> 32);
}

/**@brief   Block size get from superblock.
 * @param   s superblock descriptor
 * @return  block size in bytes*/
static inline uint32_t ext4_sb_get_block_size(struct ext4_sblock *s)
{
    return 1024 << to_le32(s->log_block_size);
}

/**@brief   Block group descriptor size.
 * @param   s superblock descriptor
 * @return  block group descriptor size in bytes*/
static inline uint16_t ext4_sb_get_desc_size(struct ext4_sblock *s)
{
    uint16_t size = to_le16(s->desc_size);

    return size < EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE ?
            EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE : size;
}

/*************************Flags and features*********************************/

/**@brief   Support check of flag.
 * @param   s superblock descriptor
 * @param   v flag to check
 * @return  true if flag is supported*/
static inline bool ext4_sb_check_flag(struct ext4_sblock *s, uint32_t v)
{
    return to_le32(s->flags) & v;
}

/**@brief   Support check of feature compatible.
 * @param   s superblock descriptor
 * @param   v feature to check
 * @return  true if feature is supported*/
static inline bool ext4_sb_check_feature_compatible(struct ext4_sblock *s,
    uint32_t v)
{
    return to_le32(s->features_compatible) & v;
}

/**@brief   Support check of feature incompatible.
 * @param   s superblock descriptor
 * @param   v feature to check
 * @return  true if feature is supported*/
static inline bool ext4_sb_check_feature_incompatible(struct ext4_sblock *s,
    uint32_t v)
{
    return to_le32(s->features_incompatible) & v;
}

/**@brief   Support check of read only flag.
 * @param   s superblock descriptor
 * @param   v flag to check
 * @return  true if flag is supported*/
static inline bool ext4_sb_check_read_only(struct ext4_sblock *s, uint32_t v)
{
    return to_le32(s->features_read_only) & v;
}

/**************************More complex functions****************************/

/**@brief   Returns a block group count.
 * @param   s superblock descriptor
 * @return  count of block groups*/
uint32_t ext4_block_group_cnt(struct ext4_sblock *s);

/**@brief   Returns block count in block group
 *          (last block group may have less blocks)
 * @param   s superblock descriptor
 * @param   bgid block group id
 * @return  blocks count*/
uint32_t ext4_blocks_in_group_cnt(struct ext4_sblock *s, uint32_t bgid);

/**@brief   Returns inodes count in block group
 *          (last block group may have less inodes)
 * @param   s superblock descriptor
 * @param   bgid block group id
 * @return  inodes count*/
uint32_t ext4_inodes_in_group_cnt(struct ext4_sblock *s, uint32_t bgid);

/***************************Read/write/check superblock**********************/

/**@brief   Superblock write.
 * @param   bdev block device descriptor.
 * @param   s superblock descruptor
 * @return  Standard error code */
int ext4_sb_write(struct ext4_blockdev *bdev, struct ext4_sblock *s);

/**@brief   Superblock read.
 * @param   bdev block device descriptor.
 * @param   s superblock descruptor
 * @return  Standard error code */
int ext4_sb_read(struct ext4_blockdev *bdev, struct ext4_sblock *s);

/**@brief   Superblock simple validation.
 * @param   s superblock dsecriptor
 * @return  true if OK*/
bool ext4_sb_check(struct ext4_sblock *s);

#endif /* EXT4_SUPER_H_ */

/**
 * @}
 */


text:
WD="${GOPATH}/src/github.com/hyperledger/fabric-sdk-java"
#WD="${WORKSPACE}/gopath/src/github.com/hyperledger/fabric-sdk-java"
SDK_REPO_NAME=fabric-sdk-java
git clone https://github.com/hyperledger/fabric-sdk-java $WD
cd $WD
git checkout tags/v1.0.0-rc1
export GOPATH=$WD/src/test/fixture

cd $WD/src/test
chmod +x cirun.sh
source cirun.sh


text:
/*
 * This is the /proc/ide/ filesystem implementation.
 *
 * Drive/Driver settings can be retrieved by reading the drive's
 * "settings" files.  e.g.    "cat /proc/ide0/hda/settings"
 * To write a new value "val" into a specific setting "name", use:
 *   echo "name:val" >/proc/ide/ide0/hda/settings
 *
 * Also useful, "cat /proc/ide0/hda/[identify, smart_values,
 * smart_thresholds, capabilities]" will issue an IDENTIFY /
 * PACKET_IDENTIFY / SMART_READ_VALUES / SMART_READ_THRESHOLDS /
 * SENSE CAPABILITIES command to /dev/hda, and then dump out the
 * returned data as 256 16-bit words.  The "hdparm" utility will
 * be updated someday soon to use this mechanism.
 *
 */

#include <linux/module.h>

#include <asm/uaccess.h>
#include <linux/errno.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/mm.h>
#include <linux/pci.h>
#include <linux/ctype.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/seq_file.h>

#include <asm/io.h>

static int proc_ide_read_imodel
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_hwif_t	*hwif = (ide_hwif_t *) data;
	int		len;
	const char	*name;

	/*
	 * Neither ide_unknown nor ide_forced should be set at this point.
	 */
	switch (hwif->chipset) {
		case ide_generic:	name = "generic";	break;
		case ide_pci:		name = "pci";		break;
		case ide_cmd640:	name = "cmd640";	break;
		case ide_dtc2278:	name = "dtc2278";	break;
		case ide_ali14xx:	name = "ali14xx";	break;
		case ide_qd65xx:	name = "qd65xx";	break;
		case ide_umc8672:	name = "umc8672";	break;
		case ide_ht6560b:	name = "ht6560b";	break;
		case ide_rz1000:	name = "rz1000";	break;
		case ide_trm290:	name = "trm290";	break;
		case ide_cmd646:	name = "cmd646";	break;
		case ide_cy82c693:	name = "cy82c693";	break;
		case ide_4drives:	name = "4drives";	break;
		case ide_pmac:		name = "mac-io";	break;
		case ide_au1xxx:	name = "au1xxx";	break;
		default:		name = "(unknown)";	break;
	}
	len = sprintf(page, "%s\n", name);
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

static int proc_ide_read_mate
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_hwif_t	*hwif = (ide_hwif_t *) data;
	int		len;

	if (hwif && hwif->mate && hwif->mate->present)
		len = sprintf(page, "%s\n", hwif->mate->name);
	else
		len = sprintf(page, "(none)\n");
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

static int proc_ide_read_channel
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_hwif_t	*hwif = (ide_hwif_t *) data;
	int		len;

	page[0] = hwif->channel ? '1' : '0';
	page[1] = '\n';
	len = 2;
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

static int proc_ide_read_identify
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *)data;
	int		len = 0, i = 0;
	int		err = 0;

	len = sprintf(page, "\n");

	if (drive) {
		unsigned short *val = (unsigned short *) page;

		err = taskfile_lib_get_identify(drive, page);
		if (!err) {
			char *out = ((char *)page) + (SECTOR_WORDS * 4);
			page = out;
			do {
				out += sprintf(out, "%04x%c",
					le16_to_cpu(*val), (++i & 7) ? ' ' : '\n');
				val += 1;
			} while (i < (SECTOR_WORDS * 2));
			len = out - page;
		}
	}
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

static void proc_ide_settings_warn(void)
{
	static int warned = 0;

	if (warned)
		return;

	printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
			    "obsolete, and will be removed soon!\n");
	warned = 1;
}

static int proc_ide_read_settings
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *) data;
	ide_settings_t	*setting = (ide_settings_t *) drive->settings;
	char		*out = page;
	int		len, rc, mul_factor, div_factor;

	proc_ide_settings_warn();

	down(&ide_setting_sem);
	out += sprintf(out, "name\t\t\tvalue\t\tmin\t\tmax\t\tmode\n");
	out += sprintf(out, "----\t\t\t-----\t\t---\t\t---\t\t----\n");
	while(setting) {
		mul_factor = setting->mul_factor;
		div_factor = setting->div_factor;
		out += sprintf(out, "%-24s", setting->name);
		if ((rc = ide_read_setting(drive, setting)) >= 0)
			out += sprintf(out, "%-16d", rc * mul_factor / div_factor);
		else
			out += sprintf(out, "%-16s", "write-only");
		out += sprintf(out, "%-16d%-16d", (setting->min * mul_factor + div_factor - 1) / div_factor, setting->max * mul_factor / div_factor);
		if (setting->rw & SETTING_READ)
			out += sprintf(out, "r");
		if (setting->rw & SETTING_WRITE)
			out += sprintf(out, "w");
		out += sprintf(out, "\n");
		setting = setting->next;
	}
	len = out - page;
	up(&ide_setting_sem);
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

#define MAX_LEN	30

static int proc_ide_write_settings(struct file *file, const char __user *buffer,
				   unsigned long count, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *) data;
	char		name[MAX_LEN + 1];
	int		for_real = 0;
	unsigned long	n;
	ide_settings_t	*setting;
	char *buf, *s;

	if (!capable(CAP_SYS_ADMIN))
		return -EACCES;

	proc_ide_settings_warn();

	if (count >= PAGE_SIZE)
		return -EINVAL;

	s = buf = (char *)__get_free_page(GFP_USER);
	if (!buf)
		return -ENOMEM;

	if (copy_from_user(buf, buffer, count)) {
		free_page((unsigned long)buf);
		return -EFAULT;
	}

	buf[count] = '\0';

	/*
	 * Skip over leading whitespace
	 */
	while (count && isspace(*s)) {
		--count;
		++s;
	}
	/*
	 * Do one full pass to verify all parameters,
	 * then do another to actually write the new settings.
	 */
	do {
		char *p = s;
		n = count;
		while (n > 0) {
			unsigned val;
			char *q = p;

			while (n > 0 && *p != ':') {
				--n;
				p++;
			}
			if (*p != ':')
				goto parse_error;
			if (p - q > MAX_LEN)
				goto parse_error;
			memcpy(name, q, p - q);
			name[p - q] = 0;

			if (n > 0) {
				--n;
				p++;
			} else
				goto parse_error;

			val = simple_strtoul(p, &q, 10);
			n -= q - p;
			p = q;
			if (n > 0 && !isspace(*p))
				goto parse_error;
			while (n > 0 && isspace(*p)) {
				--n;
				++p;
			}

			down(&ide_setting_sem);
			setting = ide_find_setting_by_name(drive, name);
			if (!setting)
			{
				up(&ide_setting_sem);
				goto parse_error;
			}
			if (for_real)
				ide_write_setting(drive, setting, val * setting->div_factor / setting->mul_factor);
			up(&ide_setting_sem);
		}
	} while (!for_real++);
	free_page((unsigned long)buf);
	return count;
parse_error:
	free_page((unsigned long)buf);
	printk("proc_ide_write_settings(): parse error\n");
	return -EINVAL;
}

int proc_ide_read_capacity
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	int len = sprintf(page,"%llu\n", (long long)0x7fffffff);
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

EXPORT_SYMBOL_GPL(proc_ide_read_capacity);

int proc_ide_read_geometry
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *) data;
	char		*out = page;
	int		len;

	out += sprintf(out,"physical     %d/%d/%d\n",
			drive->cyl, drive->head, drive->sect);
	out += sprintf(out,"logical      %d/%d/%d\n",
			drive->bios_cyl, drive->bios_head, drive->bios_sect);

	len = out - page;
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

EXPORT_SYMBOL(proc_ide_read_geometry);

static int proc_ide_read_dmodel
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *) data;
	struct hd_driveid *id = drive->id;
	int		len;

	len = sprintf(page, "%.40s\n",
		(id && id->model[0]) ? (char *)id->model : "(none)");
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

static int proc_ide_read_driver
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *) data;
	struct device	*dev = &drive->gendev;
	ide_driver_t	*ide_drv;
	int		len;

	down_read(&dev->bus->subsys.rwsem);
	if (dev->driver) {
		ide_drv = container_of(dev->driver, ide_driver_t, gen_driver);
		len = sprintf(page, "%s version %s\n",
				dev->driver->name, ide_drv->version);
	} else
		len = sprintf(page, "ide-default version 0.9.newide\n");
	up_read(&dev->bus->subsys.rwsem);
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
{
	struct device *dev = &drive->gendev;
	int ret = 1;
	int err;

	down_write(&dev->bus->subsys.rwsem);
	device_release_driver(dev);
	/* FIXME: device can still be in use by previous driver */
	strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
	err = device_attach(dev);
	if (err < 0)
		printk(KERN_WARNING "IDE: %s: device_attach error: %d\n",
			__FUNCTION__, err);
	drive->driver_req[0] = 0;
	if (dev->driver == NULL) {
		err = device_attach(dev);
		if (err < 0)
			printk(KERN_WARNING
				"IDE: %s: device_attach(2) error: %d\n",
				__FUNCTION__, err);
	}
	if (dev->driver && !strcmp(dev->driver->name, driver))
		ret = 0;
	up_write(&dev->bus->subsys.rwsem);

	return ret;
}

static int proc_ide_write_driver
	(struct file *file, const char __user *buffer, unsigned long count, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *) data;
	char name[32];

	if (!capable(CAP_SYS_ADMIN))
		return -EACCES;
	if (count > 31)
		count = 31;
	if (copy_from_user(name, buffer, count))
		return -EFAULT;
	name[count] = '\0';
	if (ide_replace_subdriver(drive, name))
		return -EINVAL;
	return count;
}

static int proc_ide_read_media
	(char *page, char **start, off_t off, int count, int *eof, void *data)
{
	ide_drive_t	*drive = (ide_drive_t *) data;
	const char	*media;
	int		len;

	switch (drive->media) {
		case ide_disk:	media = "disk\n";
				break;
		case ide_cdrom:	media = "cdrom\n";
				break;
		case ide_tape:	media = "tape\n";
				break;
		case ide_floppy:media = "floppy\n";
				break;
		case ide_optical:media = "optical\n";
				break;
		default:	media = "UNKNOWN\n";
				break;
	}
	strcpy(page,media);
	len = strlen(media);
	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}

static ide_proc_entry_t generic_drive_entries[] = {
	{ "driver",	S_IFREG|S_IRUGO,	proc_ide_read_driver,	proc_ide_write_driver },
	{ "identify",	S_IFREG|S_IRUSR,	proc_ide_read_identify,	NULL },
	{ "media",	S_IFREG|S_IRUGO,	proc_ide_read_media,	NULL },
	{ "model",	S_IFREG|S_IRUGO,	proc_ide_read_dmodel,	NULL },
	{ "settings",	S_IFREG|S_IRUSR|S_IWUSR,proc_ide_read_settings,	proc_ide_write_settings },
	{ NULL,	0, NULL, NULL }
};

void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void *data)
{
	struct proc_dir_entry *ent;

	if (!dir || !p)
		return;
	while (p->name != NULL) {
		ent = create_proc_entry(p->name, p->mode, dir);
		if (!ent) return;
		ent->data = data;
		ent->read_proc = p->read_proc;
		ent->write_proc = p->write_proc;
		p++;
	}
}

void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p)
{
	if (!dir || !p)
		return;
	while (p->name != NULL) {
		remove_proc_entry(p->name, dir);
		p++;
	}
}

static void create_proc_ide_drives(ide_hwif_t *hwif)
{
	int	d;
	struct proc_dir_entry *ent;
	struct proc_dir_entry *parent = hwif->proc;
	char name[64];

	for (d = 0; d < MAX_DRIVES; d++) {
		ide_drive_t *drive = &hwif->drives[d];

		if (!drive->present)
			continue;
		if (drive->proc)
			continue;

		drive->proc = proc_mkdir(drive->name, parent);
		if (drive->proc)
			ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
		sprintf(name,"ide%d/%s", (drive->name[2]-'a')/2, drive->name);
		ent = proc_symlink(drive->name, proc_ide_root, name);
		if (!ent) return;
	}
}

static void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive)
{
	if (drive->proc) {
		ide_remove_proc_entries(drive->proc, generic_drive_entries);
		remove_proc_entry(drive->name, proc_ide_root);
		remove_proc_entry(drive->name, hwif->proc);
		drive->proc = NULL;
	}
}

static void destroy_proc_ide_drives(ide_hwif_t *hwif)
{
	int	d;

	for (d = 0; d < MAX_DRIVES; d++) {
		ide_drive_t *drive = &hwif->drives[d];
		if (drive->proc)
			destroy_proc_ide_device(hwif, drive);
	}
}

static ide_proc_entry_t hwif_entries[] = {
	{ "channel",	S_IFREG|S_IRUGO,	proc_ide_read_channel,	NULL },
	{ "mate",	S_IFREG|S_IRUGO,	proc_ide_read_mate,	NULL },
	{ "model",	S_IFREG|S_IRUGO,	proc_ide_read_imodel,	NULL },
	{ NULL,	0, NULL, NULL }
};

void create_proc_ide_interfaces(void)
{
	int	h;

	for (h = 0; h < MAX_HWIFS; h++) {
		ide_hwif_t *hwif = &ide_hwifs[h];

		if (!hwif->present)
			continue;
		if (!hwif->proc) {
			hwif->proc = proc_mkdir(hwif->name, proc_ide_root);
			if (!hwif->proc)
				return;
			ide_add_proc_entries(hwif->proc, hwif_entries, hwif);
		}
		create_proc_ide_drives(hwif);
	}
}

EXPORT_SYMBOL(create_proc_ide_interfaces);

#ifdef CONFIG_BLK_DEV_IDEPCI
void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
{
	create_proc_info_entry(name, 0, proc_ide_root, get_info);
}

EXPORT_SYMBOL_GPL(ide_pci_create_host_proc);
#endif

void destroy_proc_ide_interface(ide_hwif_t *hwif)
{
	if (hwif->proc) {
		destroy_proc_ide_drives(hwif);
		ide_remove_proc_entries(hwif->proc, hwif_entries);
		remove_proc_entry(hwif->name, proc_ide_root);
		hwif->proc = NULL;
	}
}

static int proc_print_driver(struct device_driver *drv, void *data)
{
	ide_driver_t *ide_drv = container_of(drv, ide_driver_t, gen_driver);
	struct seq_file *s = data;

	seq_printf(s, "%s version %s\n", drv->name, ide_drv->version);

	return 0;
}

static int ide_drivers_show(struct seq_file *s, void *p)
{
	int err;

	err = bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver);
	if (err < 0)
		printk(KERN_WARNING "IDE: %s: bus_for_each_drv error: %d\n",
			__FUNCTION__, err);
	return 0;
}

static int ide_drivers_open(struct inode *inode, struct file *file)
{
	return single_open(file, &ide_drivers_show, NULL);
}

static const struct file_operations ide_drivers_operations = {
	.open		= ide_drivers_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};

void proc_ide_create(void)
{
	struct proc_dir_entry *entry;

	if (!proc_ide_root)
		return;

	create_proc_ide_interfaces();

	entry = create_proc_entry("drivers", 0, proc_ide_root);
	if (entry)
		entry->proc_fops = &ide_drivers_operations;
}

void proc_ide_destroy(void)
{
	remove_proc_entry("drivers", proc_ide_root);
	remove_proc_entry("ide", NULL);
}


text:
solution "MusOOEvaluator"
	configurations {"Release", "Debug"}
	if (_ACTION == nil) then
		return
	end
	location (os.get() .. '-' .. _ACTION)
	targetdir (os.get() .. '-' .. _ACTION)

	-- A project defines one build target
	project "MusOOEvaluator"
		kind "ConsoleApp"
		language "C++"
		files {
			"../*.h",
			"../*.cpp",
			"../libMusOO/MusOO/*.h",
			"../libMusOO/MusOO/*.cpp",
			"../libMusOO/MusOOFile/*.h",
			"../libMusOO/MusOOFile/*.cpp",
			"../libMusOO/tinyxml2/tinyxml2.cpp",
		}
		includedirs {
			"..",
			"../libMusOO",
			"../third-party/eigen",
			"$(COMPILED_LIBRARIES_INCLUDE)"
		}

		configuration "Debug"
			defines {"DEBUG"}
			flags {"Symbols"}

		configuration "Release"
			defines {"NDEBUG"}
			flags {"Optimize"}

		configuration {"macosx", "gmake"}
			linkoptions {
				"$(shell test ${COMPILED_LIBRARIES_LIB} && echo ${COMPILED_LIBRARIES_LIB} || echo $(shell brew --prefix)/lib)/libboost_filesystem.a",
				"$(shell test ${COMPILED_LIBRARIES_LIB} && echo ${COMPILED_LIBRARIES_LIB} || echo $(shell brew --prefix)/lib)/libboost_program_options.a",
				"$(shell test ${COMPILED_LIBRARIES_LIB} && echo ${COMPILED_LIBRARIES_LIB} || echo $(shell brew --prefix)/lib)/libboost_system.a"
			}

		configuration {"macosx", "xcode3"}
			linkoptions {"${COMPILED_LIBRARIES_LIB}/libboost_filesystem.a", "${COMPILED_LIBRARIES_LIB}/libboost_program_options.a", "${COMPILED_LIBRARIES_LIB}/libboost_system.a"}

		configuration "linux"
			links {"boost_filesystem", "boost_program_options", "boost_system"}
			linkoptions {" -static $(shell test ${COMPILED_LIBRARIES_LIB} && echo -L${COMPILED_LIBRARIES_LIB})"}
			defines {"_SYS_SYSMACROS_H"}

		configuration "vs*"
			defines {"_CRT_SECURE_NO_WARNINGS", "_SCL_SECURE_NO_WARNINGS"}
			libdirs {"$(COMPILED_LIBRARIES_LIB)"}


text:
using System.Linq;
using System.Reflection;

namespace CTRC.Cache
{
    static class PropertiesCache<T>
    {
        static PropertiesCache()
        {
            Properties = typeof(T).GetTypeInfo()
                .DeclaredProperties.Where(c=>c.GetMethod.IsPublic
            &&
            !c.GetMethod.IsStatic).ToArray();
        }

        public static PropertyInfo[] Properties;
    }
}


text:
package javax.microedition.amms.control;

public interface ContainerFormatControl extends FormatControl {
	public void setFormat(String format);
}


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
  d: "M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"
}), 'FormatAlignRightSharp');
exports.default = _default;


text:
#include <aws/kafka/model/UpdateConfigurationRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/HashingUtils.h>

#include <utility>

using namespace Aws::Kafka::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

UpdateConfigurationRequest::UpdateConfigurationRequest() :
    m_arnHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_serverPropertiesHasBeenSet(false)
{
}

Aws::String UpdateConfigurationRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_descriptionHasBeenSet)
  {
   payload.WithString("description", m_description);

  }

  if(m_serverPropertiesHasBeenSet)
  {
   payload.WithString("serverProperties", HashingUtils::Base64Encode(m_serverProperties));
  }

  return payload.View().WriteReadable();
}


text:
//-----------------------------------------------
//
//	This file is part of the Siv3D Engine.
//
//	Copyright (c) 2008-2022 Ryo Suzuki
//	Copyright (c) 2016-2022 OpenSiv3D Project
//
//	Licensed under the MIT License.
//
//-----------------------------------------------

# pragma once
# include "Common.hpp"
# include "Uncopyable.hpp"
# include "Optional.hpp"
# include "ColorHSV.hpp"

namespace s3d
{
	class ScopedColorAdd2D : Uncopyable
	{
	public:

		SIV3D_NODISCARD_CXX20
		ScopedColorAdd2D() = default;

		SIV3D_NODISCARD_CXX20
		explicit ScopedColorAdd2D(const ColorF& color);

		SIV3D_NODISCARD_CXX20
		explicit ScopedColorAdd2D(double rgb, double a = 0.0);

		SIV3D_NODISCARD_CXX20
		ScopedColorAdd2D(double r, double g, double b, double a = 0.0);

		SIV3D_NODISCARD_CXX20
		ScopedColorAdd2D(ScopedColorAdd2D&& other) noexcept;

		~ScopedColorAdd2D();

		//ScopedColorAdd2D& operator =(ScopedColorAdd2D && other) noexcept;

	private:

		Optional<Float4> m_oldColor;

		void clear() noexcept;
	};
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager;

namespace Azure.ResourceManager.HDInsight
{
    /// <summary>
    /// A class representing a collection of <see cref="HDInsightPrivateLinkResource" /> and their operations.
    /// Each <see cref="HDInsightPrivateLinkResource" /> in the collection will belong to the same instance of <see cref="HDInsightClusterResource" />.
    /// To get a <see cref="HDInsightPrivateLinkResourceCollection" /> instance call the GetHDInsightPrivateLinkResources method from an instance of <see cref="HDInsightClusterResource" />.
    /// </summary>
    public partial class HDInsightPrivateLinkResourceCollection : ArmCollection, IEnumerable<HDInsightPrivateLinkResource>, IAsyncEnumerable<HDInsightPrivateLinkResource>
    {
        private readonly ClientDiagnostics _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics;
        private readonly PrivateLinkResourcesRestOperations _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient;

        /// <summary> Initializes a new instance of the <see cref="HDInsightPrivateLinkResourceCollection"/> class for mocking. </summary>
        protected HDInsightPrivateLinkResourceCollection()
        {
        }

        /// <summary> Initializes a new instance of the <see cref="HDInsightPrivateLinkResourceCollection"/> class. </summary>
        /// <param name="client"> The client parameters to use in these operations. </param>
        /// <param name="id"> The identifier of the parent resource that is the target of operations. </param>
        internal HDInsightPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
        {
            _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HDInsight", HDInsightPrivateLinkResource.ResourceType.Namespace, Diagnostics);
            TryGetApiVersion(HDInsightPrivateLinkResource.ResourceType, out string hdInsightPrivateLinkResourcePrivateLinkResourcesApiVersion);
            _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hdInsightPrivateLinkResourcePrivateLinkResourcesApiVersion);
#if DEBUG
			ValidateResourceId(Id);
#endif
        }

        internal static void ValidateResourceId(ResourceIdentifier id)
        {
            if (id.ResourceType != HDInsightClusterResource.ResourceType)
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HDInsightClusterResource.ResourceType), nameof(id));
        }

        /// <summary>
        /// Gets the specific private link resource.
        /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}
        /// Operation Id: PrivateLinkResources_Get
        /// </summary>
        /// <param name="privateLinkResourceName"> The name of the private link resource. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentException"> <paramref name="privateLinkResourceName"/> is an empty string, and was expected to be non-empty. </exception>
        /// <exception cref="ArgumentNullException"> <paramref name="privateLinkResourceName"/> is null. </exception>
        public virtual async Task<Response<HDInsightPrivateLinkResource>> GetAsync(string privateLinkResourceName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName));

            using var scope = _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("HDInsightPrivateLinkResourceCollection.Get");
            scope.Start();
            try
            {
                var response = await _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken).ConfigureAwait(false);
                if (response.Value == null)
                    throw new RequestFailedException(response.GetRawResponse());
                return Response.FromValue(new HDInsightPrivateLinkResource(Client, response.Value), response.GetRawResponse());
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }

        /// <summary>
        /// Gets the specific private link resource.
        /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}
        /// Operation Id: PrivateLinkResources_Get
        /// </summary>
        /// <param name="privateLinkResourceName"> The name of the private link resource. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentException"> <paramref name="privateLinkResourceName"/> is an empty string, and was expected to be non-empty. </exception>
        /// <exception cref="ArgumentNullException"> <paramref name="privateLinkResourceName"/> is null. </exception>
        public virtual Response<HDInsightPrivateLinkResource> Get(string privateLinkResourceName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName));

            using var scope = _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("HDInsightPrivateLinkResourceCollection.Get");
            scope.Start();
            try
            {
                var response = _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken);
                if (response.Value == null)
                    throw new RequestFailedException(response.GetRawResponse());
                return Response.FromValue(new HDInsightPrivateLinkResource(Client, response.Value), response.GetRawResponse());
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }

        /// <summary>
        /// Lists the private link resources in a HDInsight cluster.
        /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources
        /// Operation Id: PrivateLinkResources_ListByCluster
        /// </summary>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <returns> An async collection of <see cref="HDInsightPrivateLinkResource" /> that may take multiple service requests to iterate over. </returns>
        public virtual AsyncPageable<HDInsightPrivateLinkResource> GetAllAsync(CancellationToken cancellationToken = default)
        {
            async Task<Page<HDInsightPrivateLinkResource>> FirstPageFunc(int? pageSizeHint)
            {
                using var scope = _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("HDInsightPrivateLinkResourceCollection.GetAll");
                scope.Start();
                try
                {
                    var response = await _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient.ListByClusterAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
                    return Page.FromValues(response.Value.Value.Select(value => new HDInsightPrivateLinkResource(Client, value)), null, response.GetRawResponse());
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }
            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
        }

        /// <summary>
        /// Lists the private link resources in a HDInsight cluster.
        /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources
        /// Operation Id: PrivateLinkResources_ListByCluster
        /// </summary>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <returns> A collection of <see cref="HDInsightPrivateLinkResource" /> that may take multiple service requests to iterate over. </returns>
        public virtual Pageable<HDInsightPrivateLinkResource> GetAll(CancellationToken cancellationToken = default)
        {
            Page<HDInsightPrivateLinkResource> FirstPageFunc(int? pageSizeHint)
            {
                using var scope = _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("HDInsightPrivateLinkResourceCollection.GetAll");
                scope.Start();
                try
                {
                    var response = _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient.ListByCluster(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return Page.FromValues(response.Value.Value.Select(value => new HDInsightPrivateLinkResource(Client, value)), null, response.GetRawResponse());
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }
            return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
        }

        /// <summary>
        /// Checks to see if the resource exists in azure.
        /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}
        /// Operation Id: PrivateLinkResources_Get
        /// </summary>
        /// <param name="privateLinkResourceName"> The name of the private link resource. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentException"> <paramref name="privateLinkResourceName"/> is an empty string, and was expected to be non-empty. </exception>
        /// <exception cref="ArgumentNullException"> <paramref name="privateLinkResourceName"/> is null. </exception>
        public virtual async Task<Response<bool>> ExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName));

            using var scope = _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("HDInsightPrivateLinkResourceCollection.Exists");
            scope.Start();
            try
            {
                var response = await _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false);
                return Response.FromValue(response.Value != null, response.GetRawResponse());
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }

        /// <summary>
        /// Checks to see if the resource exists in azure.
        /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}
        /// Operation Id: PrivateLinkResources_Get
        /// </summary>
        /// <param name="privateLinkResourceName"> The name of the private link resource. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentException"> <paramref name="privateLinkResourceName"/> is an empty string, and was expected to be non-empty. </exception>
        /// <exception cref="ArgumentNullException"> <paramref name="privateLinkResourceName"/> is null. </exception>
        public virtual Response<bool> Exists(string privateLinkResourceName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName));

            using var scope = _hdInsightPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("HDInsightPrivateLinkResourceCollection.Exists");
            scope.Start();
            try
            {
                var response = _hdInsightPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken);
                return Response.FromValue(response.Value != null, response.GetRawResponse());
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }

        IEnumerator<HDInsightPrivateLinkResource> IEnumerable<HDInsightPrivateLinkResource>.GetEnumerator()
        {
            return GetAll().GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetAll().GetEnumerator();
        }

        IAsyncEnumerator<HDInsightPrivateLinkResource> IAsyncEnumerable<HDInsightPrivateLinkResource>.GetAsyncEnumerator(CancellationToken cancellationToken)
        {
            return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
        }
    }
}


text:
require 'spec_helper'

describe CarrierWaveDirect::Test::CapybaraHelpers do
  class ExampleSpec
    include CarrierWaveDirect::Test::CapybaraHelpers
  end

  let(:subject) { ExampleSpec.new }
  let(:page) { double("Page").as_null_object }
  let(:selector) { double("Selector") }

  def stub_page
    allow(subject).to receive(:page).and_return(page)
  end

  def find_element_value(css, value, options = nil)
    if options
      allow(page).to receive(:find).with(css, options).and_return(selector)
    else
      allow(page).to receive(:find).with(css).and_return(selector)
    end
    allow(selector).to receive(:value).and_return(value)
  end

  describe "#attach_file_for_direct_upload" do
    context "'path/to/file.ext'" do
      it "should attach a file with the locator => 'file'" do
        expect(subject).to receive(:attach_file).with("file", "path/to/file.ext")
        subject.attach_file_for_direct_upload "path/to/file.ext"
      end
    end
  end

  describe "#upload_directly" do
    let(:uploader) { DirectUploader.new }

    def upload_directly(options = {})
      options[:button_locator] ||= ""
      button_locator = options.delete(:button_locator)
      subject.upload_directly(uploader, button_locator, options)
    end

    def stub_common
      stub_page
      find_element_value("input[name='success_action_redirect']", "http://example.com", visible: false)
      allow(subject).to receive(:visit)
    end

    before do
      allow(subject).to receive(:click_button)
    end

    shared_examples_for "submitting the form" do
      let(:options) { {} }

      it "should submit the form" do
        expect(subject).to receive(:click_button).with("Upload!")
        upload_directly(options.merge(:button_locator => "Upload!"))
      end
    end

    shared_examples_for ":success => false" do
      let(:options) { { :success => false } }

      it "should not redirect" do
        expect(subject).to_not receive(:visit)
        upload_directly(options)
      end
    end

    context "passing no options" do
      before do
        stub_common
        allow(subject).to receive(:find_key).and_return("upload_dir/guid/$filename")
        allow(subject).to receive(:find_upload_path).and_return("path/to/file.ext")
      end

      it_should_behave_like "submitting the form"

      it "should redirect to the page's success_action_redirect url" do
        expect(subject).to receive(:visit).with(/^http:\/\/example.com/)
        upload_directly
      end

      context "the redirect url's params" do
        it "should include the bucket name" do
          expect(subject).to receive(:visit).with(/bucket=/)
          upload_directly
        end

        it "should include an etag" do
          expect(subject).to receive(:visit).with(/etag=/)
          upload_directly
        end

        it "should include the key derived from the form" do
          expect(subject).to receive(:visit).with(/key=upload_dir%2Fguid%2Ffile.ext/)
          upload_directly
        end
      end
    end

    context "with options" do
      context ":redirect_key => 'some redirect key'" do
        before do
          stub_common
        end

        context "the redirect url's params" do
          it "should include the key from the :redirect_key option" do
            expect(subject).to receive(:visit).with(/key=some\+redirect\+key/)
            upload_directly(:redirect_key => "some redirect key")
          end
        end
      end

      context ":success => false" do
        let(:options) { { :success => false } }

        it_should_behave_like "submitting the form" do
          let(:options) { { :success => false } }
        end

        it_should_behave_like ":success => false"
      end

      context ":fail => true" do
        it_should_behave_like "submitting the form" do
          let(:options) { { :fail => true } }
        end

        it_should_behave_like ":success => false" do
          let(:options) { { :fail => true } }
        end
      end
    end
  end

  describe "#find_key" do
    before do
      stub_page
      find_element_value("input[name='key']", "key", visible: false)
    end

    it "should try to find the key on the page" do
      expect(subject.find_key).to eq "key"
    end
  end

  describe "#find_upload_path" do
    before do
      stub_page
      find_element_value("input[name='file']", "upload path", visible: false)
    end

    it "should try to find the upload path on the page" do
      expect(subject.find_upload_path).to eq "upload path"
    end
  end
end


text:
package foo;
import bar.Bar;

public class Foo {
    protected static Object bar() {
        return Bar.bar();
    }
}


text:
package com.linecorp.platform.channel.sample;

import com.google.common.util.concurrent.ListenableFuture;
import com.linecorp.platform.channel.sample.pojos.*;
import org.apache.commons.codec.binary.Base64;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;

public class BusinessConnect {

    private final static String API_URL_EVENTS = "https://api.line.me/v1/events";
    private final static String API_URL_PROFILES = "https://api.line.me/v1/profiles";

    public BusinessConnect() {
    }

    public boolean validateBCRequest(String httpRequestBody, String channelSecret, String channelSignature) {
        if (httpRequestBody == null || channelSecret == null || channelSignature == null) {
            return false;
        }

        String signature;
        SecretKeySpec key = new SecretKeySpec(channelSecret.getBytes(), "HmacSHA256");
        try {
            Mac mac = Mac.getInstance("HmacSHA256");
            mac.init(key);
            byte[] source = httpRequestBody.getBytes("UTF-8");
            signature = Base64.encodeBase64String(mac.doFinal(source));
        } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
            e.printStackTrace();
            return false;
        }
        return channelSignature.equals(signature);
    }

    public void sendTextMessage(List<String> toUsers, String message, ApiHttpClient apiHttpClient) {
        OutgoingMessage outgoingMessage = new OutgoingMessage();
        outgoingMessage.setTo(toUsers);
        outgoingMessage.setToChannel(Constants.ToChannel.MESSAGE);
        outgoingMessage.setEventType(Constants.EventType.OUTGOING_MESSAGE);
        MessageContent messageContent = new MessageContent();
        messageContent.setContentType(Constants.ContentType.TEXT);
        messageContent.setToType(Constants.ToType.USER);
        messageContent.setText(message);
        outgoingMessage.setContent(messageContent);

        ListenableFuture<ApiResponse> apiListenableFuture = apiHttpClient.sendMessage(API_URL_EVENTS, outgoingMessage);
        if (apiListenableFuture != null) {
            try {
                ApiResponse apiResponse = apiListenableFuture.get();
            } catch (InterruptedException | ExecutionException e) {
                e.printStackTrace();
            }
        }
    }

    public Profile getProfile(String mid, ApiHttpClient apiHttpClient) {
        ProfileList profileList = null;
        String url = String.format("%s?mids=%s", API_URL_PROFILES, mid);
        ListenableFuture<ProfileList> apiListenableFuture = apiHttpClient.getProfileList(url);
        if (apiListenableFuture != null) {
            try {
                profileList = apiListenableFuture.get();
            } catch (InterruptedException | ExecutionException e) {
                e.printStackTrace();
            }
        }
        if (profileList != null && profileList.getContacts().size() > 0) {
            return profileList.getContacts().get(0);
        }
        return null;
    }

    public void addFriend(String mid, String displayName, Connection connection) {
        try (Statement stmt = connection.createStatement();
             PreparedStatement pstmt = connection.prepareStatement("INSERT INTO friends VALUES (?, ?, now())");
            ) {
            stmt.executeUpdate("CREATE TABLE IF NOT EXISTS friends (mid VARCHAR(100) CONSTRAINT friends_pk PRIMARY KEY, " +
                    "display VARCHAR(300), occasion TIMESTAMP)");

            pstmt.setString(1, mid);
            pstmt.setString(2, displayName);
            pstmt.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public List<String> getFriends(String currentMid, Connection connection) {
        List<String> output = new ArrayList<>();
        try (PreparedStatement pstmt = connection.prepareStatement("SELECT mid FROM friends WHERE mid <> ?")) {
            pstmt.setString(1, currentMid);
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                output.add(rs.getString("mid"));
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return output;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/C:/Users/dang/Desktop/cheesesquare-master/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res/values-sw600dp/values-sw600dp.xml -->
    <eat-comment/>
    <dimen name="abc_action_bar_content_inset_material">24dp</dimen>
    <dimen name="abc_action_bar_default_height_material">64dp</dimen>
    <dimen name="abc_action_bar_default_padding_end_material">8dp</dimen>
    <dimen name="abc_action_bar_default_padding_start_material">8dp</dimen>
    <dimen name="abc_config_prefDialogWidth">580dp</dimen>
    <dimen name="abc_text_size_subtitle_material_toolbar">16dp</dimen>
    <dimen name="abc_text_size_title_material_toolbar">20dp</dimen>
    <!-- From: file:/C:/Users/dang/Desktop/cheesesquare-master/app/build/intermediates/exploded-aar/com.android.support/design/23.1.0/res/values-sw600dp/values-sw600dp.xml -->
    <eat-comment/>
    <dimen name="design_snackbar_action_inline_max_width">0dp</dimen>
    <dimen name="design_snackbar_background_corner_radius">2dp</dimen>
    <dimen name="design_snackbar_extra_spacing_horizontal">24dp</dimen>
    <dimen name="design_snackbar_max_width">576dp</dimen>
    <dimen name="design_snackbar_min_width">320dp</dimen>
    <dimen name="design_snackbar_padding_vertical_2lines">@dimen/design_snackbar_padding_vertical</dimen>
    <dimen name="design_tab_scrollable_min_width">160dp</dimen>
    <!-- From: file:/C:/Users/dang/Desktop/cheesesquare-master/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res/values-sw600dp/values-sw600dp.xml -->
    <eat-comment/>
    <integer name="abc_max_action_buttons">5</integer>
    <!-- From: file:/C:/Users/dang/Desktop/cheesesquare-master/app/build/intermediates/exploded-aar/com.android.support/design/23.1.0/res/values-sw600dp/values-sw600dp.xml -->
    <eat-comment/>
    <integer name="design_snackbar_text_max_lines">1</integer>
    <style name="Widget.Design.TabLayout" parent="Base.Widget.Design.TabLayout">
        <item name="tabGravity">center</item>
        <item name="tabMode">fixed</item>
    </style>
</resources>