text:
namespace canvas
{
    using namespace ABI::Windows::Foundation;
    using namespace ABI::Windows::UI;

    class MockCanvasDrawingSession : public RuntimeClass<
        RuntimeClassFlags<WinRtClassicComMix>,
        ICanvasDrawingSession,
        IClosable,
        CloakedIid<ICanvasResourceWrapperNative>>
    {
    public:
        CALL_COUNTER_WITH_MOCK(CloseMethod, HRESULT());

        MockCanvasDrawingSession()
        {
            CloseMethod.AllowAnyCall();
        }

        IFACEMETHODIMP Close() override
        {
            return CloseMethod.WasCalled();
        }

#define DONT_EXPECT(name, ...)                                  \
        IFACEMETHODIMP name(__VA_ARGS__) override               \
        {                                                       \
            Assert::Fail(L"Unexpected call to " WIDEN(#name));  \
            return E_NOTIMPL;                                   \
        }

        DONT_EXPECT(Clear , Color);

        DONT_EXPECT(DrawImageAtOrigin                                                       , ICanvasImage*);
        DONT_EXPECT(DrawImageAtOffset                                                       , ICanvasImage*, Vector2);
        DONT_EXPECT(DrawImageAtCoords                                                       , ICanvasImage*, float, float);
        DONT_EXPECT(DrawImageToRect                                                         , ICanvasBitmap*, Rect);
        DONT_EXPECT(DrawImageAtOffsetWithSourceRect                                         , ICanvasImage*, Vector2, Rect);
        DONT_EXPECT(DrawImageAtCoordsWithSourceRect                                         , ICanvasImage*, float, float, Rect);
        DONT_EXPECT(DrawImageToRectWithSourceRect                                           , ICanvasImage*, Rect, Rect);
        DONT_EXPECT(DrawImageAtOffsetWithSourceRectAndOpacity                               , ICanvasImage*, Vector2, Rect, float);
        DONT_EXPECT(DrawImageAtCoordsWithSourceRectAndOpacity                               , ICanvasImage*, float, float, Rect, float);
        DONT_EXPECT(DrawImageToRectWithSourceRectAndOpacity                                 , ICanvasImage*, Rect, Rect, float);
        DONT_EXPECT(DrawImageAtOffsetWithSourceRectAndOpacityAndInterpolation               , ICanvasImage*, Vector2, Rect, float, CanvasImageInterpolation);
        DONT_EXPECT(DrawImageAtCoordsWithSourceRectAndOpacityAndInterpolation               , ICanvasImage*, float, float, Rect, float, CanvasImageInterpolation);
        DONT_EXPECT(DrawImageToRectWithSourceRectAndOpacityAndInterpolation                 , ICanvasImage*, Rect, Rect, float, CanvasImageInterpolation);
        DONT_EXPECT(DrawImageAtOffsetWithSourceRectAndOpacityAndInterpolationAndComposite   , ICanvasImage*, Vector2, Rect, float, CanvasImageInterpolation, CanvasComposite);
        DONT_EXPECT(DrawImageAtCoordsWithSourceRectAndOpacityAndInterpolationAndComposite   , ICanvasImage*, float, float, Rect, float, CanvasImageInterpolation, CanvasComposite);
        DONT_EXPECT(DrawImageToRectWithSourceRectAndOpacityAndInterpolationAndComposite     , ICanvasImage*, Rect, Rect, float, CanvasImageInterpolation, CanvasComposite);
        DONT_EXPECT(DrawImageAtOffsetWithSourceRectAndOpacityAndInterpolationAndPerspective , ICanvasBitmap*, Vector2, Rect, float, CanvasImageInterpolation, Matrix4x4);
        DONT_EXPECT(DrawImageAtCoordsWithSourceRectAndOpacityAndInterpolationAndPerspective , ICanvasBitmap*, float, float, Rect, float, CanvasImageInterpolation, Matrix4x4);
        DONT_EXPECT(DrawImageToRectWithSourceRectAndOpacityAndInterpolationAndPerspective   , ICanvasBitmap*, Rect, Rect, float, CanvasImageInterpolation, Matrix4x4);

        DONT_EXPECT(DrawLineWithBrush                                     , Vector2, Vector2, ICanvasBrush*);
        DONT_EXPECT(DrawLineAtCoordsWithBrush                             , float, float, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawLineWithColor                                     , Vector2, Vector2, Color);
        DONT_EXPECT(DrawLineAtCoordsWithColor                             , float, float, float, float, Color);
        DONT_EXPECT(DrawLineWithBrushAndStrokeWidth                       , Vector2, Vector2, ICanvasBrush*, float);
        DONT_EXPECT(DrawLineAtCoordsWithBrushAndStrokeWidth               , float, float, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawLineWithColorAndStrokeWidth                       , Vector2, Vector2, Color, float);
        DONT_EXPECT(DrawLineAtCoordsWithColorAndStrokeWidth               , float, float, float, float, Color, float);
        DONT_EXPECT(DrawLineWithBrushAndStrokeWidthAndStrokeStyle         , Vector2, Vector2, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawLineAtCoordsWithBrushAndStrokeWidthAndStrokeStyle , float, float, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawLineWithColorAndStrokeWidthAndStrokeStyle         , Vector2, Vector2, Color, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawLineAtCoordsWithColorAndStrokeWidthAndStrokeStyle , float, float, float, float, Color, float, ICanvasStrokeStyle*);

        DONT_EXPECT(DrawRectangleWithBrush                                     , Rect, ICanvasBrush*);
        DONT_EXPECT(DrawRectangleAtCoordsWithBrush                             , float, float, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawRectangleWithColor                                     , Rect, Color);
        DONT_EXPECT(DrawRectangleAtCoordsWithColor                             , float, float, float, float, Color);
        DONT_EXPECT(DrawRectangleWithBrushAndStrokeWidth                       , Rect, ICanvasBrush*, float);
        DONT_EXPECT(DrawRectangleAtCoordsWithBrushAndStrokeWidth               , float, float, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawRectangleWithColorAndStrokeWidth                       , Rect, Color, float);
        DONT_EXPECT(DrawRectangleAtCoordsWithColorAndStrokeWidth               , float, float, float, float, Color, float);
        DONT_EXPECT(DrawRectangleWithBrushAndStrokeWidthAndStrokeStyle         , Rect, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawRectangleAtCoordsWithBrushAndStrokeWidthAndStrokeStyle , float, float, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawRectangleWithColorAndStrokeWidthAndStrokeStyle         , Rect, Color, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawRectangleAtCoordsWithColorAndStrokeWidthAndStrokeStyle , float, float, float, float, Color, float, ICanvasStrokeStyle*);

        DONT_EXPECT(FillRectangleWithBrush                       , Rect, ICanvasBrush*);
        DONT_EXPECT(FillRectangleAtCoordsWithBrush               , float, float, float, float, ICanvasBrush*);
        DONT_EXPECT(FillRectangleWithColor                       , Rect, Color);
        DONT_EXPECT(FillRectangleAtCoordsWithColor               , float, float, float, float, Color);
        DONT_EXPECT(FillRectangleWithBrushAndOpacityBrush        , Rect, ICanvasBrush*, ICanvasBrush*);
        DONT_EXPECT(FillRectangleAtCoordsWithBrushAndOpacityBrush, float, float, float, float, ICanvasBrush*, ICanvasBrush*);

        DONT_EXPECT(DrawRoundedRectangleWithBrush                                     , Rect, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawRoundedRectangleAtCoordsWithBrush                             , float, float, float, float, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawRoundedRectangleWithColor                                     , Rect, float, float, Color);
        DONT_EXPECT(DrawRoundedRectangleAtCoordsWithColor                             , float, float, float, float, float, float, Color);
        DONT_EXPECT(DrawRoundedRectangleWithBrushAndStrokeWidth                       , Rect, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawRoundedRectangleAtCoordsWithBrushAndStrokeWidth               , float, float, float, float, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawRoundedRectangleWithColorAndStrokeWidth                       , Rect, float, float, Color, float);
        DONT_EXPECT(DrawRoundedRectangleAtCoordsWithColorAndStrokeWidth               , float, float, float, float, float, float, Color, float);
        DONT_EXPECT(DrawRoundedRectangleWithBrushAndStrokeWidthAndStrokeStyle         , Rect, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawRoundedRectangleAtCoordsWithBrushAndStrokeWidthAndStrokeStyle , float, float, float, float, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawRoundedRectangleWithColorAndStrokeWidthAndStrokeStyle         , Rect, float, float, Color, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawRoundedRectangleAtCoordsWithColorAndStrokeWidthAndStrokeStyle , float, float, float, float, float, float, Color, float, ICanvasStrokeStyle*);

        DONT_EXPECT(FillRoundedRectangleWithBrush         , Rect, float, float, ICanvasBrush*);
        DONT_EXPECT(FillRoundedRectangleAtCoordsWithBrush , float, float, float, float, float, float, ICanvasBrush*);
        DONT_EXPECT(FillRoundedRectangleWithColor         , Rect, float, float, Color);
        DONT_EXPECT(FillRoundedRectangleAtCoordsWithColor , float, float, float, float, float, float, Color);

        DONT_EXPECT(DrawEllipseWithBrush                                     , Vector2, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawEllipseAtCoordsWithBrush                             , float, float, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawEllipseWithColor                                     , Vector2, float, float, Color);
        DONT_EXPECT(DrawEllipseAtCoordsWithColor                             , float, float, float, float, Color);
        DONT_EXPECT(DrawEllipseWithBrushAndStrokeWidth                       , Vector2, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawEllipseAtCoordsWithBrushAndStrokeWidth               , float, float, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawEllipseWithColorAndStrokeWidth                       , Vector2, float, float, Color, float);
        DONT_EXPECT(DrawEllipseAtCoordsWithColorAndStrokeWidth               , float, float, float, float, Color, float);
        DONT_EXPECT(DrawEllipseWithBrushAndStrokeWidthAndStrokeStyle         , Vector2, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawEllipseAtCoordsWithBrushAndStrokeWidthAndStrokeStyle , float, float, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawEllipseWithColorAndStrokeWidthAndStrokeStyle         , Vector2, float, float, Color, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawEllipseAtCoordsWithColorAndStrokeWidthAndStrokeStyle , float, float, float, float, Color, float, ICanvasStrokeStyle*);

        DONT_EXPECT(FillEllipseWithBrush         , Vector2, float, float, ICanvasBrush*);
        DONT_EXPECT(FillEllipseAtCoordsWithBrush , float, float, float, float, ICanvasBrush*);
        DONT_EXPECT(FillEllipseWithColor         , Vector2, float, float, Color);
        DONT_EXPECT(FillEllipseAtCoordsWithColor , float, float, float, float, Color);

        DONT_EXPECT(DrawCircleWithBrush                                     , Vector2, float, ICanvasBrush*);
        DONT_EXPECT(DrawCircleAtCoordsWithBrush                             , float, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawCircleWithColor                                     , Vector2, float, Color);
        DONT_EXPECT(DrawCircleAtCoordsWithColor                             , float, float, float, Color);
        DONT_EXPECT(DrawCircleWithBrushAndStrokeWidth                       , Vector2, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawCircleAtCoordsWithBrushAndStrokeWidth               , float, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawCircleWithColorAndStrokeWidth                       , Vector2, float, Color, float);
        DONT_EXPECT(DrawCircleAtCoordsWithColorAndStrokeWidth               , float, float, float, Color, float);
        DONT_EXPECT(DrawCircleWithBrushAndStrokeWidthAndStrokeStyle         , Vector2, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawCircleAtCoordsWithBrushAndStrokeWidthAndStrokeStyle , float, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawCircleWithColorAndStrokeWidthAndStrokeStyle         , Vector2, float, Color, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawCircleAtCoordsWithColorAndStrokeWidthAndStrokeStyle , float, float, float, Color, float, ICanvasStrokeStyle*);

        DONT_EXPECT(FillCircleWithBrush         , Vector2, float, ICanvasBrush*);
        DONT_EXPECT(FillCircleAtCoordsWithBrush , float, float, float, ICanvasBrush*);
        DONT_EXPECT(FillCircleWithColor         , Vector2, float, Color);
        DONT_EXPECT(FillCircleAtCoordsWithColor , float, float, float, Color);

        DONT_EXPECT(DrawTextAtPointWithColor                , HSTRING, Vector2, Color);
        DONT_EXPECT(DrawTextAtPointCoordsWithColor          , HSTRING, float, float, Color);
        DONT_EXPECT(DrawTextAtPointWithBrushAndFormat       , HSTRING, Vector2, ICanvasBrush*, ICanvasTextFormat*);
        DONT_EXPECT(DrawTextAtRectWithBrushAndFormat        , HSTRING, Rect, ICanvasBrush*, ICanvasTextFormat*);
        DONT_EXPECT(DrawTextAtPointCoordsWithBrushAndFormat , HSTRING, float, float, ICanvasBrush*, ICanvasTextFormat*);
        DONT_EXPECT(DrawTextAtRectCoordsWithBrushAndFormat  , HSTRING, float, float, float, float, ICanvasBrush*, ICanvasTextFormat*);
        DONT_EXPECT(DrawTextAtPointWithColorAndFormat       , HSTRING, Vector2, Color, ICanvasTextFormat*);
        DONT_EXPECT(DrawTextAtRectWithColorAndFormat        , HSTRING, Rect, Color, ICanvasTextFormat*);
        DONT_EXPECT(DrawTextAtPointCoordsWithColorAndFormat , HSTRING, float, float, Color, ICanvasTextFormat*);
        DONT_EXPECT(DrawTextAtRectCoordsWithColorAndFormat  , HSTRING, float, float, float, float, Color, ICanvasTextFormat*);

        DONT_EXPECT(DrawGeometryWithBrush                                    , ICanvasGeometry*, Vector2, ICanvasBrush*);
        DONT_EXPECT(DrawGeometryWithColor                                    , ICanvasGeometry*, Vector2, Color);
        DONT_EXPECT(DrawGeometryAtCoordsWithBrush                            , ICanvasGeometry*, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawGeometryAtCoordsWithColor                            , ICanvasGeometry*, float, float, Color);
        DONT_EXPECT(DrawGeometryAtOriginWithBrush                            , ICanvasGeometry*, ICanvasBrush*);
        DONT_EXPECT(DrawGeometryAtOriginWithColor                            , ICanvasGeometry*, Color);
        DONT_EXPECT(DrawGeometryWithBrushAndStrokeWidth                      , ICanvasGeometry*, Vector2, ICanvasBrush*, float);
        DONT_EXPECT(DrawGeometryWithColorAndStrokeWidth                      , ICanvasGeometry*, Vector2, Color, float);
        DONT_EXPECT(DrawGeometryAtCoordsWithBrushAndStrokeWidth              , ICanvasGeometry*, float, float, ICanvasBrush*, float);
        DONT_EXPECT(DrawGeometryAtCoordsWithColorAndStrokeWidth              , ICanvasGeometry*, float, float, Color, float);
        DONT_EXPECT(DrawGeometryAtOriginWithBrushAndStrokeWidth              , ICanvasGeometry*, ICanvasBrush*, float);
        DONT_EXPECT(DrawGeometryAtOriginWithColorAndStrokeWidth              , ICanvasGeometry*, Color, float);
        DONT_EXPECT(DrawGeometryWithBrushAndStrokeWidthAndStrokeStyle        , ICanvasGeometry*, Vector2, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawGeometryWithColorAndStrokeWidthAndStrokeStyle        , ICanvasGeometry*, Vector2, Color, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawGeometryAtCoordsWithBrushAndStrokeWidthAndStrokeStyle, ICanvasGeometry*, float, float, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawGeometryAtCoordsWithColorAndStrokeWidthAndStrokeStyle, ICanvasGeometry*, float, float, Color, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawGeometryAtOriginWithBrushAndStrokeWidthAndStrokeStyle, ICanvasGeometry*, ICanvasBrush*, float, ICanvasStrokeStyle*);
        DONT_EXPECT(DrawGeometryAtOriginWithColorAndStrokeWidthAndStrokeStyle, ICanvasGeometry*, Color, float, ICanvasStrokeStyle*);

        DONT_EXPECT(FillGeometryWithBrush                       , ICanvasGeometry*, Vector2, ICanvasBrush*);
        DONT_EXPECT(FillGeometryWithBrushAndOpacityBrush        , ICanvasGeometry*, Vector2, ICanvasBrush*, ICanvasBrush*);
        DONT_EXPECT(FillGeometryWithColor                       , ICanvasGeometry*, Vector2, Color);
        DONT_EXPECT(FillGeometryAtCoordsWithBrush               , ICanvasGeometry*, float, float, ICanvasBrush*);
        DONT_EXPECT(FillGeometryAtCoordsWithBrushAndOpacityBrush, ICanvasGeometry*, float, float, ICanvasBrush*, ICanvasBrush*);
        DONT_EXPECT(FillGeometryAtCoordsWithColor               , ICanvasGeometry*, float, float, Color);
        DONT_EXPECT(FillGeometryAtOriginWithBrush               , ICanvasGeometry*, ICanvasBrush*);
        DONT_EXPECT(FillGeometryAtOriginWithBrushAndOpacityBrush, ICanvasGeometry*, ICanvasBrush*, ICanvasBrush*);
        DONT_EXPECT(FillGeometryAtOriginWithColor               , ICanvasGeometry*, Color);

        DONT_EXPECT(DrawCachedGeometryWithBrush        , ICanvasCachedGeometry*, Vector2, ICanvasBrush*);
        DONT_EXPECT(DrawCachedGeometryWithColor        , ICanvasCachedGeometry*, Vector2, Color);
        DONT_EXPECT(DrawCachedGeometryAtCoordsWithBrush, ICanvasCachedGeometry*, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawCachedGeometryAtCoordsWithColor, ICanvasCachedGeometry*, float, float, Color);
        DONT_EXPECT(DrawCachedGeometryAtOriginWithBrush, ICanvasCachedGeometry*, ICanvasBrush*);
        DONT_EXPECT(DrawCachedGeometryAtOriginWithColor, ICanvasCachedGeometry*, Color);

        DONT_EXPECT(DrawTextLayoutWithBrush, ICanvasTextLayout*, Vector2, ICanvasBrush*);
        DONT_EXPECT(DrawTextLayoutAtCoordsWithBrush, ICanvasTextLayout*, float, float, ICanvasBrush*);
        DONT_EXPECT(DrawTextLayoutWithColor, ICanvasTextLayout*, Vector2, Color);
        DONT_EXPECT(DrawTextLayoutAtCoordsWithColor, ICanvasTextLayout*, float, float, Color);

        DONT_EXPECT(get_Antialiasing     , CanvasAntialiasing*);
        DONT_EXPECT(put_Antialiasing     , CanvasAntialiasing);
        DONT_EXPECT(get_Blend            , CanvasBlend*);
        DONT_EXPECT(put_Blend            , CanvasBlend);
        DONT_EXPECT(get_TextAntialiasing , CanvasTextAntialiasing*);
        DONT_EXPECT(put_TextAntialiasing , CanvasTextAntialiasing);
        DONT_EXPECT(get_Transform        , ABI::Microsoft::Graphics::Canvas::Numerics::Matrix3x2*);
        DONT_EXPECT(put_Transform        , ABI::Microsoft::Graphics::Canvas::Numerics::Matrix3x2);
        DONT_EXPECT(get_Units            , CanvasUnits*);
        DONT_EXPECT(put_Units            , CanvasUnits);

        DONT_EXPECT(CreateLayerWithOpacity                                , float, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithOpacityBrush                           , ICanvasBrush*, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithOpacityAndClipRectangle                , float, Rect, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithOpacityBrushAndClipRectangle           , ICanvasBrush*, Rect, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithOpacityAndClipGeometry                 , float, ICanvasGeometry*, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithOpacityBrushAndClipGeometry            , ICanvasBrush*, ICanvasGeometry*, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithOpacityAndClipGeometryAndTransform     , float, ICanvasGeometry*, Matrix3x2, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithOpacityBrushAndClipGeometryAndTransform, ICanvasBrush*, ICanvasGeometry*, Matrix3x2, ICanvasActiveLayer**);
        DONT_EXPECT(CreateLayerWithAllOptions                             , float, ICanvasBrush*, Rect, ICanvasGeometry*, Matrix3x2, CanvasLayerOptions, ICanvasActiveLayer**);

        // ICanvasResourceWrapperNative
        DONT_EXPECT(GetResource, REFIID iid, void**);

#undef DONT_EXPECT

    };
}


text:
You have no access here

Edit Admin

	<form action="" method="post">
		<input name="sid" value="{I_ID_SEASON}" type="hidden"/>
		<input name="mod" value="admins" type="hidden"/>
		<input name="act" value="update" type="hidden"/>
		<input name="opt" value="{I_ID_USER}" type="hidden"/>

			Username:
			{I_USERNAME}

			Headadmin:
			<input type="checkbox" name="headadmin" value="1"/>

			Headadmin:
			<input type="checkbox" name="headadmin" value="1" checked="checked"/>

			<input class="submit" type="submit" value=" Submit "/>

	</form>

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Linq;
using System.Threading.Tasks;
using Telegram.Bot.Tests.Integ.Framework;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
using Telegram.Bot.Types.InlineQueryResults;
using Xunit;

namespace Telegram.Bot.Tests.Integ.Games
{
    [Collection(Constants.TestCollections.Games)]
    [Trait(Constants.CategoryTraitName, Constants.InteractiveCategoryValue)]
    [TestCaseOrderer(Constants.TestCaseOrderer, Constants.AssemblyName)]
    public class GamesTests : IClassFixture<GamesFixture>
    {
        private ITelegramBotClient BotClient => _fixture.BotClient;

        private readonly TestsFixture _fixture;

        private readonly GamesFixture _classFixture;

        public GamesTests(TestsFixture fixture, GamesFixture classFixture)
        {
            _fixture = fixture;
            _classFixture = classFixture;
        }

        [OrderedFact(DisplayName = FactTitles.ShouldAnswerInlineQueryWithGame)]
        [Trait(Constants.MethodTraitName, Constants.TelegramBotApiMethods.AnswerInlineQuery)]
        public async Task Should_Answer_InlineQuery_With_Game()
        {
            await _fixture.SendTestCaseNotificationAsync(FactTitles.ShouldAnswerInlineQueryWithGame,
                startInlineQuery: true);

            Update queryUpdate = await _fixture.UpdateReceiver.GetInlineQueryUpdateAsync();

            const string resultId = "game";
            await BotClient.AnswerInlineQueryAsync(
                inlineQueryId: queryUpdate.InlineQuery.Id,
                results: new InlineQueryResultBase[]
                {
                    new InlineQueryResultGame(
                        id: resultId,
                        gameShortName: _classFixture.GameShortName
                    )
                },
                cacheTime: 0
            );

            (Update messageUpdate, Update chosenResultUpdate) = await _fixture.UpdateReceiver.GetInlineQueryResultUpdates(MessageType.Game);

            Assert.Equal(MessageType.Game, messageUpdate.Message.Type);
            Assert.Equal(resultId, chosenResultUpdate.ChosenInlineResult.ResultId);
            Assert.Empty(chosenResultUpdate.ChosenInlineResult.Query);

            _classFixture.InlineGameMessageId = chosenResultUpdate.ChosenInlineResult.InlineMessageId;
        }

        [OrderedFact(DisplayName = FactTitles.ShouldGetHighScoresInline)]
        [Trait(Constants.MethodTraitName, Constants.TelegramBotApiMethods.GetGameHighScores)]
        public async Task Should_Get_High_Scores_Inline_Message()
        {
            await _fixture.SendTestCaseNotificationAsync(FactTitles.ShouldGetHighScoresInline);

            GameHighScore[] highScores = await BotClient.GetGameHighScoresAsync(
                userId: _classFixture.Player.Id,
                inlineMessageId: _classFixture.InlineGameMessageId
            );

            Assert.All(highScores, _ => Assert.True(_.Position > 0));
            Assert.All(highScores, _ => Assert.True(_.Score > 0));
            Assert.All(highScores.Select(_ => _.User), Assert.NotNull);

            _classFixture.HighScores = highScores;
        }

        [OrderedFact(DisplayName = FactTitles.ShouldSetGameScoreInline)]
        [Trait(Constants.MethodTraitName, Constants.TelegramBotApiMethods.SetGameScore)]
        public async Task Should_Set_Game_Score_Inline_Message()
        {
            int playerId = _classFixture.Player.Id;
            int oldScore = _classFixture.HighScores.Single(highScore => highScore.User.Id == playerId).Score;
            int newScore = oldScore + 1 + new Random().Next(3);

            await _fixture.SendTestCaseNotificationAsync(FactTitles.ShouldSetGameScoreInline,
                $"Changing score from {oldScore} to {newScore} for {_classFixture.Player.Username.Replace("_", @"\_")}.");

            await BotClient.SetGameScoreAsync(
                userId: playerId,
                score: newScore,
                inlineMessageId: _classFixture.InlineGameMessageId
            );
        }

        [OrderedFact(DisplayName = FactTitles.ShouldAnswerGameCallbackQuery)]
        [Trait(Constants.MethodTraitName, Constants.TelegramBotApiMethods.AnswerCallbackQuery)]
        public async Task Should_Answer_CallbackQuery_With_Game_Url()
        {
            await _fixture.SendTestCaseNotificationAsync(FactTitles.ShouldAnswerGameCallbackQuery,
                "Click on any Play button on any of the game messges above 👆");

            Update cqUpdate = await _fixture.UpdateReceiver.GetCallbackQueryUpdateAsync();

            Assert.True(cqUpdate.CallbackQuery.IsGameQuery);

            await BotClient.AnswerCallbackQueryAsync(
                callbackQueryId: cqUpdate.CallbackQuery.Id,
                url: "https://tbot.xyz/lumber/"
            );
        }

        private static class FactTitles
        {
            public const string ShouldAnswerInlineQueryWithGame = "Should answer inline query with a game";

            public const string ShouldGetHighScoresInline = "Should get game high score for inline message";

            public const string ShouldSetGameScoreInline = "Should set game score for inline message";

            public const string ShouldAnswerGameCallbackQuery = "Should answer game callback query";
        }
    }
}


text:
import widget from './widget';

interface Opts {
  pause?: boolean;
  time: number;
}

export default function loadClockWidget() {
  widget('clock', {
    _create: function () {
      this.target = this.options.time * 1000 + Date.now();
      if (!this.options.pause) this.interval = setInterval(this.render.bind(this), 1000);
      this.render();
    },

    set: function (opts: Opts) {
      this.options = opts;
      this.target = this.options.time * 1000 + Date.now();
      this.render();
      clearInterval(this.interval);
      if (!opts.pause) this.interval = setInterval(this.render.bind(this), 1000);
    },

    render: function () {
      if (document.body.contains(this.element[0])) {
        this.element.text(this.formatMs(this.target - Date.now()));
        this.element.toggleClass('clock--run', !this.options.pause);
      } else clearInterval(this.interval);
    },

    pad(x: number) {
      return (x < 10 ? '0' : '') + x;
    },

    formatMs: function (msTime: number) {
      const date = new Date(Math.max(0, msTime + 500)),
        hours = date.getUTCHours(),
        minutes = date.getUTCMinutes(),
        seconds = date.getUTCSeconds();
      return hours > 0 ? hours + ':' + this.pad(minutes) + ':' + this.pad(seconds) : minutes + ':' + this.pad(seconds);
    },
  });
}


text:
"""Unit tests for mw_api."""

import unittest
from wm_metrics.mw_api import MwApi, MwApiQuery

class TestMwApi(unittest.TestCase):

    """Test MwApi."""

    def test_MwApi_constructor_default(self):
        """Test MwApi constructor with default values."""
        mw_api = MwApi('test')
        expected = {'action': 'test',
                    'prop': {},
                    'format': 'json'
                    }
        self.assertEqual(vars(mw_api), expected)

    def test_MwApi_constructor(self):
        """Test MwApi constructor with custom values."""
        input_properties = {'A': 'a', 'B': 'b'}
        input_format = 'xml'
        mw_api = MwApi('test',
                       properties=input_properties,
                       format=input_format)
        expected = {'action': 'test',
                    'prop': input_properties,
                    'format': input_format
                    }
        self.assertEqual(vars(mw_api), expected)

class TestMwApiQuery(unittest.TestCase):

    """Test MwApiQuery."""

    def test_MwApi_constructor_default(self):
        """Test MwApiQuery constructor with default values."""
        mw_api_query = MwApiQuery()
        expected = {'action': 'query',
                    'prop': {},
                    'format': 'json'
                    }
        self.assertEqual(vars(mw_api_query), expected)

    def test_MwApi_constructor(self):
        """Test MwApiQuery constructor with custom values."""
        input_properties = {'A': 'a', 'B': 'b'}
        input_format = 'xml'
        mw_api_query = MwApiQuery(properties=input_properties,
                                  format=input_format)
        expected = {'action': 'query',
                    'prop': input_properties,
                    'format': input_format
                    }
        self.assertEqual(vars(mw_api_query), expected)


text:
var UNSCOPABLES = require('./_wks')('unscopables');
var ArrayProto = Array.prototype;
if (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});
module.exports = function (key) {
  ArrayProto[UNSCOPABLES][key] = true;
};


text:
<?php

use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Http\Models\API\Campus;
use App\Http\Models\API\Building;
use App\Http\Models\API\Room;

class RoomTest extends TestCase
{

    use DatabaseTransactions;

    /**
     * @var array
     */
    protected $itemStructureResponse = [
        'data' => [
            'id',
            'code',
            'floor_number',
            'floor_label',
            'room_number',
            'room_label',
            'updated',
            'created',
            'building',
        ]
    ];

    public function setUp()
    {
        parent::setUp();
        factory(Campus::class, 5)->create();
        factory(Building::class, 50)->create();
        factory(Room::class, 300)->create();
        $this->logIn();
    }

    /** @test */
    public function can_get_rooms_pages()
    {
        $this->get('/api/v1/rooms?page=2', ['Authorization' => 'Bearer ' . $this->bearer])
            ->seeStatusCode(200)
            ->seeJsonStructure($this->paginatedStructure);
    }

    /** @test */
    public function fails_to_get_rooms_pages_without_auth()
    {
        $this->get('/api/v1/rooms?page=2')
            ->seeStatusCode(401)
            ->seeJsonStructure($this->errorStructure);
    }

    /** @test */
    public function can_get_room()
    {
        $this->get('/api/v1/rooms/' . Room::get()->random()->id, ['Authorization' => 'Bearer ' . $this->bearer])
            ->seeStatusCode(200)
            ->seeJsonStructure($this->itemStructureResponse);
    }

    /** @test */
    public function fails_to_get_room_without_auth()
    {
        $this->get('/api/v1/rooms/' . Room::get()->random()->id)
            ->seeStatusCode(401)
            ->seeJsonStructure($this->errorStructure);
    }

    /** @test */
    public function can_get_room_by_code()
    {
        $this->get('/api/v1/rooms/code/' . Room::get()->random()->code, ['Authorization' => 'Bearer ' . $this->bearer])
            ->seeStatusCode(200)
            ->seeJsonStructure($this->itemStructureResponse);
    }

    /** @test */
    public function fails_to_get_room_by_code_without_auth()
    {
        $this->get('/api/v1/rooms/code/' . Room::get()->random()->code)
            ->seeStatusCode(401)
            ->seeJsonStructure($this->errorStructure);
    }

    /** @test */
    public function can_create_room()
    {
        $room = [
            'code' => 'ThisIsACode',
            'building_id' => Building::get()->random()->id,
            'floor_number' => 1,
            'floor_label' => 'First Floor',
            'room_number' => 100,
            'room_label' => 'Mt. Hood Room',
        ];
        $this->post('/api/v1/rooms', $room, ['Authorization' => 'Bearer ' . $this->bearer])
            ->seeStatusCode(201)
            ->seeJsonStructure($this->itemStructureResponse);
    }

    /** @test */
    public function fails_to_create_room_without_auth()
    {
        $room = [
            'code' => 'ThisIsACode',
            'building_id' => Building::get()->random()->id,
            'floor_number' => 1,
            'floor_label' => 'First Floor',
            'room_number' => 100,
            'room_label' => 'Mt. Hood Room',
        ];
        $this->post('/api/v1/rooms', $room)
            ->seeStatusCode(401)
            ->seeJsonStructure($this->errorStructure);
    }

    /** @test */
    public function can_create_room_with_building_code()
    {
        $room = [
            'code' => 'ThisIsACode',
            'building_code' => Building::get()->random()->code,
            'floor_number' => 1,
            'floor_label' => 'First Floor',
            'room_number' => 100,
            'room_label' => 'Mt. Hood Room',
        ];
        $this->post('/api/v1/rooms', $room, ['Authorization' => 'Bearer ' . $this->bearer])
            ->seeStatusCode(201)
            ->seeJsonStructure($this->itemStructureResponse);
    }

    /** @test */
    public function fails_to_create_room_with_building_code_without_auth()
    {
        $room = [
            'code' => 'ThisIsACode',
            'building_code' => Building::get()->random()->code,
            'floor_number' => 1,
            'floor_label' => 'First Floor',
            'room_number' => 100,
            'room_label' => 'Mt. Hood Room',
        ];
        $this->post('/api/v1/rooms', $room)
            ->seeStatusCode(401)
            ->seeJsonStructure($this->errorStructure);
    }

    /** @test */
    public function can_delete_room_by_id()
    {
        $this->delete('/api/v1/rooms', ['id' => Room::get()->random()->id], ['Authorization' => 'Bearer ' . $this->bearer])
            ->seeStatusCode(204);
    }

    /** @test */
    public function fails_to_delete_room_by_id_without_auth()
    {
        $this->delete('/api/v1/rooms', ['id' => Room::get()->random()->id])
            ->seeStatusCode(401)
            ->seeJsonStructure($this->errorStructure);
    }

    /** @test */
    public function can_delete_room_by_code()
    {
        $this->delete('/api/v1/rooms', ['code' => Room::get()->random()->code], ['Authorization' => 'Bearer ' . $this->bearer])
            ->seeStatusCode(204);
    }

    /** @test */
    public function fails_to_delete_room_by_code_without_auth()
    {
        $this->delete('/api/v1/rooms', ['code' => Room::get()->random()->code])
            ->seeStatusCode(401)
            ->seeJsonStructure($this->errorStructure);
    }

}


text:
'use strict';

var util = require('util');

var models = require('./index');

/**
 * @class
 * Initializes a new instance of the StorageAccountPropertiesUpdateParameters class.
 * @constructor
 */
function StorageAccountPropertiesUpdateParameters() { }

/**
 * Validate the payload against the StorageAccountPropertiesUpdateParameters schema
 *
 * @param {JSON} payload
 *
 */
StorageAccountPropertiesUpdateParameters.prototype.validate = function (payload) {
  if (!payload) {
    throw new Error('StorageAccountPropertiesUpdateParameters cannot be null.');
  }
  if (payload['accountType']) {
    var allowedValues = [ 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' ];
    if (!allowedValues.some( function(item) { return item === payload['accountType']; })) {
      throw new Error(payload['accountType'] + ' is not a valid value. The valid values are: ' + allowedValues);
    }
  }

  if (payload['customDomain']) {
    models['CustomDomain'].validate(payload['customDomain']);
  }
};

/**
 * Deserialize the instance to StorageAccountPropertiesUpdateParameters schema
 *
 * @param {JSON} instance
 *
 */
StorageAccountPropertiesUpdateParameters.prototype.deserialize = function (instance) {
  if (instance) {
    if (instance.customDomain !== null && instance.customDomain !== undefined) {
      instance.customDomain = models['CustomDomain'].deserialize(instance.customDomain);
    }
  }
  return instance;
};

module.exports = new StorageAccountPropertiesUpdateParameters();


text:
require "rapidfire/engine"

module Rapidfire
  class AccessDenied < StandardError
  end

  # configuration which will be used as delimiter in case answers are bunch
  # of collection values. This is the default delimiter which is used by
  # all the browsers.
  mattr_accessor :answers_delimiter
  self.answers_delimiter = "\r\n"

  def self.config
    yield(self)
  end
end


text:
Lunchtime.LunchesController = Ember.ArrayController.extend({

    createLunch: function () {
        var name = this.get('newName');
        if (!name.trim()) return;
        var lunch = Lunchtime.Lunch.createRecord({
            name: name,
            active: true
        });
        this.set('newName', '');
        lunch.save();
    }

});


text:
@class IOSClass;

@interface ComGoogleCommonBaseDefaults : NSObject

#pragma mark Public

+ (id)defaultValueWithIOSClass:(IOSClass *)type;

@end

J2OBJC_STATIC_INIT(ComGoogleCommonBaseDefaults)

FOUNDATION_EXPORT id ComGoogleCommonBaseDefaults_defaultValueWithIOSClass_(IOSClass *type);

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonBaseDefaults)

#endif

#pragma pop_macro("ComGoogleCommonBaseDefaults_INCLUDE_ALL")


text:
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Start&Boost</title>

    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <link rel="stylesheet" href="<?php echo base_url(); ?>bootstrap/css/bootstrap.min.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>/css/font-awesome.min.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>css/ionicons.min.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/AdminLTE.min.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/skins/_all-skins.min.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/iCheck/flat/blue.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/morris/morris.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/jvectormap/jquery-jvectormap-1.2.2.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/datepicker/datepicker3.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/daterangepicker/daterangepicker-bs3.css">

    <link rel="stylesheet" href="<?php echo base_url(); ?>plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

     <link rel="stylesheet" href="../css/AdminLTE.min.css" />

    <link href="font/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" href="<?php echo base_url(); ?>css/section.css" />

    <link rel="shortcut icon" href="<?php echo base_url(); ?>images/favicon.ico" type="image/x-icon">
    <link rel="icon" href="<?php echo base_url(); ?>images/favicon.ico" type="image/x-icon">

                    <button type="button" id="nav-toggle" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-nav">
                        Toggle navigation

                    </button>
                    <span class="navbar-brand" style="float:left; background-image:url('<?php echo base_url();?>images/SNBlogo.png'); background-size:contain;background-repeat:no-repeat;background-position:center;">

Home

Top 5 ideas

About Us

Contact Us

            <img src="<?php echo base_url(); ?>images/bg3.png" alt="banner"/>

A Web and mobile-based startup ideas repository and exploration

Start&Boost is a Capstone project made by $index[5], a group of student from University of Cebu - Lapulapu and Mandaue. Anyone who has a brilliant idea is given an opportunity to share and discuss it with reliable members from different parts of the world, who's profile has reputation and badges. This system has three classifications of users: The ideators, investors, and company. Members can chat, create group, video conference, post ideas, upload product snapshots and links, and share to social medias.

                      <?php echo form_open('pages/login',"class=form-horizontal"); ?>

Login

                                <input type="text" class="form-control" required='required' name="email" id="email" placeholder="Email Address" title="Please enter your Email address">

                                <input type="password" class="form-control" required='required' name="password" id="password" placeholder="Password" title="Please enter your password">

                          <?php
                            if($error!=""){
                          ?>

                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

                                   <?php echo $error; ?>

                          <?php }?>

                            <button name="login" type="submit" class="btn btn-primary form-control" id="submit">Log-in</button>

                      </form>
                      <?php echo form_open('pages/register'); ?>
                            <button name="create" type="submit" class="btn btn-primary form-control" id="create">Create Account</button>
                      </form>

TOP Startup Products

            <?php

                        $query = $this->db->query("SELECT *, COUNT(c.postId) as number_of_votes from upvote_dtl c left join userpost v on c.postId = v.postId left join user_md b on v.userId = b.userId left join user_dtl d on b.userId = d.userId where voteType = '1' AND postType = '2' group by c.postId order by number_of_votes desc limit 5");
                             $i = 0;
                                foreach($query->result() as $row):
                             $i++;
            ?>

<?php echo $i;?>.

                  <?php echo $row->postTitle;?>

                <a href="<?php echo base_url()."pages/post1/".$row->postId;?>" class="small-box-footer" data-toggle="modal">
                    View Idea

                <input type="hidden" name="topidea" value='<?php echo $row->postId; ?>'/>

            <?php  endforeach;?>

<img src="<?php echo base_url(); ?>images/ind.png" style="width:50%;" />

$index[5]

MEET THE TEAM

<img src="<?php echo base_url(); ?>images/team/index0.png" style="width:40%;" />

Lyneth Cutamora

$index[0]

Project Manager

<img src="<?php echo base_url(); ?>images/team/index1.jpg" style="width:40%;" />

Jason Pitogo

$index[1]

Software Engineer

 <img src="<?php echo base_url(); ?>images/team/index2.jpg" style="width:40%;" />

AlfieDimpas

$index[2]

Technical Writer

<img src="<?php echo base_url(); ?>images/team/index3.jpg" style="width:40%;" />

Edelito Albaracin

$index[3]

System Analyst

<img src="<?php echo base_url(); ?>images/team/index4.jpg" style="width:40%;" />

Isidro Estose Jr.

$index[4]

QA Tester

 <button name="like" type="submit" class="btn btn-primary form-control" id="like">LIKE US IN FACEBOOK!</button>

Let's Keep In Touch!

            	<form method="post" >

                            Name
                            <?php echo form_error('name'); ?>
                            <input type="text" class="form-control" name="name" id="name" placeholder="Enter name" title="Please enter your name (at least 2 characters)">

                            Email
                            <?php echo form_error('email'); ?>
                            <input type="text" class="form-control" name="email1" id="email1" placeholder="Enter email" title="Please enter a valid email address">

                            Comments
                            <?php echo form_error('comment'); ?>
                            <textarea name="comment" class="form-control" id="comments" cols="3" rows="5" placeholder="Enter your message…" title="Please enter your message (at least 10 characters)"></textarea>

                        <button name="touch" type="submit" class="btn btn-lg btn-primary" id="touch">Submit</button>

                </form>

Address:

                    <address>
                        Index[5] Company

                       Sangi New Road

                        Lapu-lapu city

                    </address>

Phone:

                    <address>
                        12345-49589-2

                    </address>


text:
import argparse
import sys
import struct
from copy import copy

from bstruct import BStruct
from bstruct_defs import SymbolsRaw

#
# Exceptions for internal use
#
class WrongStructFormat(Exception):
    pass

class NoSuchField(Exception):
    pass

class InvalidDataFormat(Exception):
    pass

class InvalidArgument(Exception):
    pass

#

def modify_field(ss, field_name, value):
    """
    Modify the field named 'field_name' in the BStruct 'ss'.
    'value' is the new value in string form.
    """
    if not isinstance(ss, BStruct):
        raise WrongStructFormat()

    # Format string that's feed into pack
    fmts = None

    for (fname, ffmt, *_) in ss._fields:
        if fname == field_name:
            fmts = ffmt
            break

    if fmts is None:
        raise NoSuchField()

    # Try to perform the correct cast.
    if fmts[-1] == "c":
        raise InvalidArgument("c fields aren't supported yet")
    elif fmts[-1] == "s":
        value = value.encode("utf-8")
    elif fmts[-1] in ["f", "d"]:
        value = float(value)
    else:
        value = int(value, 0)

    # Validate the data first
    try:
        struct.pack(fmts, value)
    except struct.error as e:
        raise InvalidDataFormat("Invalid data format for field {}".format(field_name))
    except:
        raise

    setattr(ss, field_name, value)

def parse_file(name, strucc):
    try:
        fp = open(name, "rb")
    except OSError as e:
        print("Cannot open file '{}' for reading".format(name))
        sys.exit(1)

    content = []

    while True:
        buf = fp.read(strucc._size)

        if len(buf) != strucc._size:
            break

        content.append(strucc(buf))

    fp.close()

    return content

def write_file(name, content):
    try:
        fp = open(name, "wb")
    except OSError as e:
        print("Cannot open file '{}' for writing".format(name))
        sys.exit(1)

    for r in content:
        fp.write(r.repack())

    fp.close()

def find_in_content(content, field_name, value):
    struct_type = type(content[0])

    # Make sure the field exists and is a string
    ex = [x[0] for x in struct_type._fields if x[0] == field_name and x[1][-1] == "s"]

    if len(ex) == 0:
        # The field isn't available in this BStruct
        raise InvalidArgument(field_name)

    for r in content:
        v = getattr(r, ex[0])
        # Sanitize the value before checking the value
        if v.decode("utf-8").rstrip("\0") == value:
            return r

    raise InvalidArgument(value)

#
# Filetype specific options
#
class SymbolsRawBundle:
    name_field = "name"
    sort_field = "name"
    need_sort = True

if __name__ == "__main__":
    # Parse the arguments
    argumentParser = argparse.ArgumentParser(add_help=False)
    argumentParser.add_argument(
        "-i",
        "--input-file",
        action="store",
        dest="inputFile",
        help="input file",
        required=True,
    )
    argumentParser.add_argument(
        "-t",
        "--input-type",
        action="store",
        dest="inputType",
        help="input type",
        required=True,
    )
    argumentParser.add_argument(
        "-k",
        "--key-group",
        action="store",
        dest="keyGroup",
        help="group key",
        required=True,
    )
    argumentParser.add_argument(
        "-d",
        "--delete",
        action="store_true",
        dest="doDelete",
        help="Delete this record",
    )
    argumentParser.add_argument(
        "-a",
        "--add",
        action="store",
        dest="doAdd",
        help="Add a new record",
        default=None,
    )
    argumentParser.add_argument(
        "-m",
        "--modify",
        action="append",
        dest="doModify",
        help="Modify the record data",
    )
    argumentParser.add_argument(
        "-h", "--help", action="help", help="Show this help message and exit"
    )
    args = argumentParser.parse_args()

    if args.inputType != "symbolsraw":
        print("Invalid input type")
        sys.exit(1)

    # A bundle keeps track of various options that are filetype-specific
    bundle = SymbolsRawBundle

    cont = parse_file(args.inputFile, SymbolsRaw)

    # Find the key group first
    try:
        key_group = find_in_content(cont, bundle.name_field, args.keyGroup)
    except InvalidArgument as e:
        print("Could not find the -k group '{}'".format(args.keyGroup))
        sys.exit(1)

    if not args.doAdd is None:
        # We can't have two symbols with the same name
        try:
            is_present = find_in_content(cont, bundle.name_field, args.doAdd)
        except InvalidArgument as e:
            pass
        else:
            print("The symbol {} is already in the file, cannot overwrite it".format(e))
            sys.exit(1)

        # Clone the old object and modify its name
        new_group = copy(key_group)
        modify_field(new_group, bundle.name_field, args.doAdd)
        cont.append(new_group)
    elif not args.doModify is None:
        for opt in args.doModify:
            # Options are in the 'name=value' format
            val = opt.split("=")

            val_name = val[0].strip()
            val_value = val[1].strip()

            # Perform the modification in place
            modify_field(key_group, val_name, val_value)
    elif not args.doDelete is None:
        cont.remove(key_group)

    # Sort the file content if needed
    if bundle.need_sort:
        cont.sort(key=lambda x: getattr(x, bundle.sort_field))

    # Serialize the file
    write_file(args.inputFile, cont)


text:
@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    ROKRadio *voltage = [ROKRadio radioWithRequestURL:@"http://www.voltage.fr/rcs/playing.xml"
                                       responseFormat:ROKRequestResponseFormatXML
                                           trackOrder:ROKRadioTrackOrderAsc
                                         titleKeyPath:@"info.chanson"
                                        artistKeyPath:@"info.artiste"];
    [voltage lastTracks:^(ROKRequest *request, NSArray *tracks, NSError *error) {
        NSLog(@"%@", request);
        NSLog(@"%@", tracks);
        NSLog(@"%@", error);
    }];

    [voltage lastTrack:^(ROKRequest *request, id<ROKTrack> track, NSError *error) {
        NSString *message = [NSString stringWithFormat:@"%@ - %@", track.title, track.artist];
        dispatch_async(dispatch_get_main_queue(), ^{
            [[[UIAlertView alloc] initWithTitle:@"Now playing on Voltage FM"
                                        message:message delegate:nil
                              cancelButtonTitle:@"OK"
                              otherButtonTitles:nil]
             show];
        });
    }];
}

@end


text:
class Awscli < Formula
  include Language::Python::Virtualenv

  desc "Official Amazon AWS command-line interface"
  homepage "https://aws.amazon.com/cli/"
  url "https://github.com/aws/aws-cli/archive/2.0.54.tar.gz"
  sha256 "46917f320990e6042ebc75f2ba7f191951ea3e5bbbfb7b62d4404b5553b3dd66"
  license "Apache-2.0"
  head "https://github.com/aws/aws-cli.git", branch: "v2"

  bottle do
    sha256 "5937034d9fffdf60aca1b938e78461238ad547d8cbf33160cfeb52368752b8da" => :catalina
    sha256 "629f96db86e73d1c601c8ef5be35b6ba87ceddfc55a462b3df12b8636c76219c" => :mojave
    sha256 "3a028e2d2eacd9ffb9c543c61eae9b4dfb558aadbdeeb8d9ad5cdd498b90f18a" => :high_sierra
  end

  depends_on "python@3.8"

  uses_from_macos "groff"

  on_linux do
    depends_on "libyaml"
  end

  def install
    venv = virtualenv_create(libexec, "python3")
    system libexec/"bin/pip", "install", "-v", "-r", "requirements.txt",
                              "--ignore-installed", buildpath
    system libexec/"bin/pip", "uninstall", "-y", "awscli"
    venv.pip_install_and_link buildpath
    pkgshare.install "awscli/examples"

    rm Dir["#{bin}/{aws.cmd,aws_bash_completer,aws_zsh_completer.sh}"]
    bash_completion.install "bin/aws_bash_completer"
    zsh_completion.install "bin/aws_zsh_completer.sh"
    (zsh_completion/"_aws").write <<~EOS
      #compdef aws
      _aws () {
        local e
        e=$(dirname ${funcsourcetrace[1]%:*})/aws_zsh_completer.sh
        if [[ -f $e ]]; then source $e; fi
      }
    EOS

    system libexec/"bin/python3", "scripts/gen-ac-index", "--include-builtin-index"
  end

  def caveats
    <<~EOS
      The "examples" directory has been installed to:
        #{HOMEBREW_PREFIX}/share/awscli/examples
    EOS
  end

  test do
    assert_match "topics", shell_output("#{bin}/aws help")
    assert_include Dir["#{libexec}/lib/python3.8/site-packages/awscli/data/*"],
                   "#{libexec}/lib/python3.8/site-packages/awscli/data/ac.index"
  end
end


text:
import requests
import pandas as pd
from bs4 import BeautifulSoup
import numpy as np
import datetime
pd.set_option('display.expand_frame_repr', False)

import re

def get_financial_statements(code):
    # 인증값 추출
    re_enc = re.compile("encparam: '(.*)'", re.IGNORECASE)
    re_id = re.compile("id: '([a-zA-Z0-9]*)' ?", re.IGNORECASE)

    url = "https://companyinfo.stock.naver.com/v1/company/c1010001.aspx?cmp_cd={}".format(code)
    html = requests.get(url).text

    search = re_enc.search(html)
    if search is None:
        return {}
    encparam = re_enc.search(html).group(1)
    encid = re_id.search(html).group(1)

    # 스크래핑
    url = "https://companyinfo.stock.naver.com/v1/company/ajax/cF1001.aspx?cmp_cd={}&fin_typ=0&freq_typ=A&encparam={}&id={}".format(code, encparam, encid)
    headers = {"Referer": "HACK"}
    html = requests.get(url, headers=headers).text

    soup = BeautifulSoup(html, "html5lib")
    dividend = soup.select("table:nth-of-type(2) tr:nth-of-type(33) td span")
    years = soup.select("table:nth-of-type(2) th")

    dividend_dict = {}
    for i in range(len(dividend)):
        dividend_dict[years[i+3].text.strip()[:4]] = dividend[i].text

    return dividend_dict

def get_3year_treasury():
    url = "http://www.index.go.kr/strata/jsp/showStblGams3.jsp?stts_cd=288401&idx_cd=2884&freq=Y&period=1998:2018"
    html = requests.get(url).text
    soup = BeautifulSoup(html, 'html5lib')
    td_data = soup.select("tr td")

    treasury_3year = {}
    start_year = 1998

    for x in td_data:
        treasury_3year[start_year] = x.text
        start_year += 1

    return treasury_3year

def get_dividend_yield(code):
    url = "http://companyinfo.stock.naver.com/company/c1010001.aspx?cmp_cd=" + code
    html = requests.get(url).text

    soup = BeautifulSoup(html, 'html5lib')
    dt_data = soup.select("td dl dt")

    dividend_yield = dt_data[-2].text
    dividend_yield = dividend_yield.split(' ')[1]
    dividend_yield = dividend_yield[:-1]

    return dividend_yield

def get_estimated_dividend_yield(code):
    dividend_yield = get_financial_statements(code)
    if len(dividend_yield) == 0:
        return 0
    dividend_yield = sorted(dividend_yield.items())[-1]
    return dividend_yield[1]

def get_current_3year_treasury():
    url = "http://finance.naver.com/marketindex/interestDailyQuote.nhn?marketindexCd=IRR_GOVT03Y&page=1"
    html = requests.get(url).text

    soup = BeautifulSoup(html, 'html5lib')
    td_data = soup.select("tr td")
    return td_data[1].text

def get_previous_dividend_yield(code):
    dividend_yield = get_financial_statements(code)

    now = datetime.datetime.now()
    cur_year = now.year

    previous_dividend_yield = {}

    for year in range(cur_year-5, cur_year):
        if str(year) in dividend_yield:
            previous_dividend_yield[year] = dividend_yield[str(year)]

    return previous_dividend_yield

if __name__ == "__main__":
    estimated_dividend_yield = get_estimated_dividend_yield("058470")
    print(estimated_dividend_yield)
    current_3year_treasury = get_current_3year_treasury()
    print(current_3year_treasury)
    estimated_dividend_to_treasury = float(estimated_dividend_yield) / float(current_3year_treasury)
    print(estimated_dividend_to_treasury)
    # print(get_estimated_dividend_yield('058470'))
    # print(get_current_3year_treasury())
    # print(get_previous_dividend_yield('058470'))


text:
#include <stdlib.h>

#include <isl/arg.h>
#include <isl/options.h>
#include <isl/schedule.h>

struct options {
	struct isl_options *isl;
	char *schedule1;
	char *schedule2;
};

ISL_ARGS_START(struct options, options_args)
ISL_ARG_CHILD(struct options, isl, "isl", &isl_options_args, "isl options")
ISL_ARG_ARG(struct options, schedule1, "schedule1", NULL)
ISL_ARG_ARG(struct options, schedule2, "schedule2", NULL)
ISL_ARGS_END

ISL_ARG_DEF(options, struct options, options_args)

static void die(const char *msg)
{
	fprintf(stderr, "%s\n", msg);
	exit(EXIT_FAILURE);
}

static FILE *open_or_die(const char *filename)
{
	FILE *file;

	file = fopen(filename, "r");
	if (!file) {
		fprintf(stderr, "Unable to open %s\n", filename);
		exit(EXIT_FAILURE);
	}
	return file;
}

/* Given two YAML descriptions of isl_schedule objects, check whether
 * they are equivalent.
 * Return EXIT_SUCCESS if they are and EXIT_FAILURE if they are not
 * or if anything else went wrong.
 */
int main(int argc, char **argv)
{
	isl_ctx *ctx;
	struct options *options;
	FILE *input1, *input2;
	isl_bool equal;
	isl_schedule *s1, *s2;

	options = options_new_with_defaults();
	if (!options)
		return EXIT_FAILURE;

	ctx = isl_ctx_alloc_with_options(&options_args, options);
	argc = options_parse(options, argc, argv, ISL_ARG_ALL);

	input1 = open_or_die(options->schedule1);
	input2 = open_or_die(options->schedule2);
	s1 = isl_schedule_read_from_file(ctx, input1);
	s2 = isl_schedule_read_from_file(ctx, input2);

	equal = isl_schedule_plain_is_equal(s1, s2);
	if (equal < 0)
		return EXIT_FAILURE;
	if (!equal)
		die("schedules differ");

	isl_schedule_free(s1);
	isl_schedule_free(s2);
	fclose(input1);
	fclose(input2);
	isl_ctx_free(ctx);

	return EXIT_SUCCESS;
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.minimalj</groupId>
	<artifactId>thymeleaf</artifactId>
	<version>0.8.0.0-SNAPSHOT</version>
	<name>MinimalJ Thymeleaf</name>
	<description>Use Thymeleaf as template engine</description>

	<build>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ftp</artifactId>
				<version>3.3.2</version>
			</extension>
		</extensions>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.minimalj</groupId>
			<artifactId>minimalj</artifactId>
			<version>[1.24.0.1-SNAPSHOT,)</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.thymeleaf</groupId>
			<artifactId>thymeleaf</artifactId>
			<version>3.0.11.RELEASE</version>
		</dependency>
	</dependencies>

	<distributionManagement>
		<repository>
			<id>openech-repository</id>
			<url>ftp://ftp.openech.ch/public_html/repository</url>
		</repository>
	</distributionManagement>

</project>


text:
package DNP3

import (
	"bytes"
	"encoding/binary"
	//"fmt"
)

func Convert2BytesToInteger(buffer []byte ) uint {

	var toInterger uint16

	buf := bytes.NewReader(buffer)
	err := binary.Read(buf, binary.LittleEndian, &toInterger)
	if err != nil {
		println("binary.Read failed:", err)
	}
	//fmt.Print(toInterger)

	return uint(toInterger)
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ManagedEntity (Apache Geode 1.0.0-incubating.M2)</title>
<meta name="date" content="2016-04-13">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.gemstone.gemfire.admin

Interface ManagedEntity

All Known Subinterfaces:

CacheServer, CacheVm, DistributionLocator

Deprecated.

as of 7.0 use the management package instead

public interface ManagedEntity

A entity that can be managed with the GemFire administration API.

Since:

4.0

See Also:

ManagedEntityConfig

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods

Modifier and Type
Method and Description

java.lang.String
getLog()

Deprecated.

Returns the tail of this manage entity's log file.

boolean
isRunning()

Deprecated.

Returns whether or not this managed entity is running.

void
start()

Deprecated.

Starts this managed entity.

void
stop()

Deprecated.

Stops this managed entity.

boolean
waitToStart(long timeout)

Deprecated.

Waits for up to a given number of milliseconds for this managed
 entity to start.

boolean
waitToStop(long timeout)

Deprecated.

Waits for up to a given number of milliseconds for this managed
 entity to stop.

Method Detail

start

void start()
    throws AdminException

Deprecated.

Starts this managed entity.  Note that this method may return
 before the managed entity is actually started.

Throws:

AdminException - If a problem is encountered while starting this managed
         entity.

java.lang.IllegalStateException - If this managed entity resides on a remote machine and a
         null or empty ("") remote command has
         been specified.

See Also:

waitToStart(long)

stop

void stop()
   throws AdminException

Deprecated.

Stops this managed entity.  Note that this method may return
 before the managed entity is actually stopped.

Throws:

AdminException - If a problem is encountered while stopping this managed
         entity.

java.lang.IllegalStateException - If this managed entity resides on a remote machine and a
         null or empty ("") remote command has
         been specified.

See Also:

waitToStop(long)

waitToStart

boolean waitToStart(long timeout)
             throws java.lang.InterruptedException

Deprecated.

Waits for up to a given number of milliseconds for this managed
 entity to start.

Parameters:

timeout - The number of milliseconds to wait for this managed entity
        to start.

Returns:

Whether or not the entity has started.
         false, if the method times out.

Throws:

java.lang.InterruptedException - If the thread invoking this method is interrupted while
         waiting.

waitToStop

boolean waitToStop(long timeout)
            throws java.lang.InterruptedException

Deprecated.

Waits for up to a given number of milliseconds for this managed
 entity to stop.

Parameters:

timeout - The number of milliseconds to wait for this managed entity
        to stop.

Returns:

Whether or not the entity has stopped.
         false, if the method times out.

Throws:

java.lang.InterruptedException - If the thread invoking this method is interrupted while
         waiting.

isRunning

boolean isRunning()

Deprecated.

Returns whether or not this managed entity is running.  Note that
 this operation may attempt to contact the managed entity.

Throws:

java.lang.IllegalStateException - If this managed entity resides on a remote machine and a
         null or empty ("") remote command has
         been specified.

getLog

java.lang.String getLog()
                 throws AdminException

Deprecated.

Returns the tail of this manage entity's log file.  Note that not
 all managed entities implement this functionality.

Throws:

AdminException - If a problem is encountered while getting the log of this
         managed entity.

java.lang.UnsupportedOperationException - If this managed entity does not support retrieving its
         log.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
namespace gloperate
{

template<typename... Args>
void AbstractPipeline::addStages(AbstractStage * stage, Args... pipeline)
{
    addStage(stage);
    addStages(std::forward<Args>(pipeline)...);
}

template <typename T>
Data<T> * AbstractPipeline::addConstantParameter(const T & value)
{
    auto constant = new Data<T>(value);

    m_constantParameters.push_back(constant);

    return constant;
}

template <typename T>
Data<T> * AbstractPipeline::getParameter(const std::string & name) const
{
    return dynamic_cast<Data<T> *>(findParameter(name));
}

template <typename T>
Data<T> * AbstractPipeline::getParameter() const
{
    return dynamic_cast<Data<T> *>(collection::detect(m_parameters, [](AbstractData * parameter) { return dynamic_cast<Data<T> *>(parameter) != nullptr; }, nullptr));
}

template <typename T>
Data<T> * AbstractPipeline::getOutput(const std::string & name) const
{
    for (AbstractData * output : findOutputs(name))
    {
        Data<T>* data = dynamic_cast<Data<T> *>(output);
        if (data)
        {
            return data;
        }
    }

    return nullptr;
}

template <typename T>
Data<T> * AbstractPipeline::getOutput() const
{
    return dynamic_cast<Data<T> *>(collection::detect(allOutputs(), [](AbstractData * data) { return dynamic_cast<Data<T> *>(data) != nullptr; }, nullptr));
}

} // namespace gloperate


text:
from pyqtgraph.Qt import QtGui, QtCore
from .UIGraphicsItem import *
import pyqtgraph.functions as fn

__all__ = ['GradientLegend']

class GradientLegend(UIGraphicsItem):
    """
    Draws a color gradient rectangle along with text labels denoting the value at specific
    points along the gradient.
    """

    def __init__(self, size, offset):
        self.size = size
        self.offset = offset
        UIGraphicsItem.__init__(self)
        self.setAcceptedMouseButtons(QtCore.Qt.NoButton)
        self.brush = QtGui.QBrush(QtGui.QColor(200,0,0))
        self.pen = QtGui.QPen(QtGui.QColor(0,0,0))
        self.labels = {'max': 1, 'min': 0}
        self.gradient = QtGui.QLinearGradient()
        self.gradient.setColorAt(0, QtGui.QColor(0,0,0))
        self.gradient.setColorAt(1, QtGui.QColor(255,0,0))

    def setGradient(self, g):
        self.gradient = g
        self.update()

    def setIntColorScale(self, minVal, maxVal, *args, **kargs):
        colors = [fn.intColor(i, maxVal-minVal, *args, **kargs) for i in range(minVal, maxVal)]
        g = QtGui.QLinearGradient()
        for i in range(len(colors)):
            x = float(i)/len(colors)
            g.setColorAt(x, colors[i])
        self.setGradient(g)
        if 'labels' not in kargs:
            self.setLabels({str(minVal/10.): 0, str(maxVal): 1})
        else:
            self.setLabels({kargs['labels'][0]:0, kargs['labels'][1]:1})

    def setLabels(self, l):
        """Defines labels to appear next to the color scale. Accepts a dict of {text: value} pairs"""
        self.labels = l
        self.update()

    def paint(self, p, opt, widget):
        UIGraphicsItem.paint(self, p, opt, widget)
        rect = self.boundingRect()   ## Boundaries of visible area in scene coords.
        unit = self.pixelSize()       ## Size of one view pixel in scene coords.
        if unit[0] is None:
            return

        ## determine max width of all labels
        labelWidth = 0
        labelHeight = 0
        for k in self.labels:
            b = p.boundingRect(QtCore.QRectF(0, 0, 0, 0), QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter, str(k))
            labelWidth = max(labelWidth, b.width())
            labelHeight = max(labelHeight, b.height())

        labelWidth *= unit[0]
        labelHeight *= unit[1]

        textPadding = 2  # in px

        if self.offset[0] < 0:
            x3 = rect.right() + unit[0] * self.offset[0]
            x2 = x3 - labelWidth - unit[0]*textPadding*2
            x1 = x2 - unit[0] * self.size[0]
        else:
            x1 = rect.left() + unit[0] * self.offset[0]
            x2 = x1 + unit[0] * self.size[0]
            x3 = x2 + labelWidth + unit[0]*textPadding*2
        if self.offset[1] < 0:
            y2 = rect.top() - unit[1] * self.offset[1]
            y1 = y2 + unit[1] * self.size[1]
        else:
            y1 = rect.bottom() - unit[1] * self.offset[1]
            y2 = y1 - unit[1] * self.size[1]
        self.b = [x1,x2,x3,y1,y2,labelWidth]

        ## Draw background
        p.setPen(self.pen)
        p.setBrush(QtGui.QBrush(QtGui.QColor(255,255,255,100)))
        rect = QtCore.QRectF(
            QtCore.QPointF(x1 - unit[0]*textPadding, y1 + labelHeight/2 + unit[1]*textPadding),
            QtCore.QPointF(x3, y2 - labelHeight/2 - unit[1]*textPadding)
        )
        p.drawRect(rect)

        ## Have to scale painter so that text and gradients are correct size. Bleh.
        p.scale(unit[0], unit[1])

        ## Draw color bar
        self.gradient.setStart(0, y1/unit[1])
        self.gradient.setFinalStop(0, y2/unit[1])
        p.setBrush(self.gradient)
        rect = QtCore.QRectF(
            QtCore.QPointF(x1/unit[0], y1/unit[1]),
            QtCore.QPointF(x2/unit[0], y2/unit[1])
        )
        p.drawRect(rect)

        ## draw labels
        p.setPen(QtGui.QPen(QtGui.QColor(0,0,0)))
        tx = x2 + unit[0]*textPadding
        lh = labelHeight/unit[1]
        for k in self.labels:
            y = y1 + self.labels[k] * (y2-y1)
            p.drawText(QtCore.QRectF(tx/unit[0], y/unit[1] - lh/2.0, 1000, lh), QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter, str(k))


text:
package com.cognizant.devops.platformregressiontest.test.groupsanduser;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.testng.Assert;
import org.testng.annotations.Test;

import com.cognizant.devops.platformregressiontest.test.common.CommonUtils;
import com.cognizant.devops.platformregressiontest.test.common.ConfigOptionsTest;
import com.google.gson.JsonObject;

import io.restassured.RestAssured;
import io.restassured.http.Header;
import io.restassured.http.Method;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;

public class SearchUserAPITest extends GroupsAndUserTestData {

	private static final Logger log = LogManager.getLogger(SearchUserAPITest.class);

	@Test(priority = 1)
	public void searchUser() {

		RestAssured.baseURI = CommonUtils.getProperty("baseURI") + CommonUtils.getProperty("searchUser");
		RequestSpecification httpRequest = RestAssured.given();

		httpRequest.header(new Header(ConfigOptionsTest.CSRF_NAME_KEY, CommonUtils.xsrfToken));
		httpRequest.cookies(CommonUtils.cookiesMap);
		httpRequest.header(ConfigOptionsTest.AUTH_HEADER_KEY, CommonUtils.jtoken);

		httpRequest.body(CommonUtils.getProperty("userName"));

		httpRequest.header(ConfigOptionsTest.CONTENT_HEADER_KEY, ConfigOptionsTest.CONTENT_TYPE_VALUE);

		Response response = httpRequest.request(Method.POST, "/");

		String searchUser = response.getBody().asString();

		log.debug("searchUser {}", searchUser);

		int statusCode = response.getStatusCode();
		Assert.assertEquals(statusCode, 200);
		Assert.assertTrue(searchUser.contains("status"), "success");
		//Assert.assertTrue(searchUser.contains("data"), "User list displayed");

	}

	@Test(priority = 2)
	public void searchUserFail() {

		RestAssured.baseURI = CommonUtils.getProperty("baseURI") + CommonUtils.getProperty("searchUser");
		RequestSpecification httpRequest = RestAssured.given();

		httpRequest.header(new Header(ConfigOptionsTest.CSRF_NAME_KEY, CommonUtils.xsrfToken));
		httpRequest.cookies(CommonUtils.cookiesMap);
		httpRequest.header(ConfigOptionsTest.AUTH_HEADER_KEY, CommonUtils.jtoken);
		// Request payload sending along with post request
		JsonObject requestParam = new JsonObject();

		httpRequest.header(ConfigOptionsTest.CONTENT_HEADER_KEY, ConfigOptionsTest.CONTENT_TYPE_VALUE);
		httpRequest.body(requestParam);

		Response response = httpRequest.request(Method.POST, "/");

		String userResponseFail = response.getBody().asString();

		log.debug("SearchUserResponseFail {}", userResponseFail);

		int statusCode = response.getStatusCode();
		Assert.assertEquals(statusCode, 200);
		Assert.assertEquals(userResponseFail.contains("failure"), true);
		Assert.assertTrue(userResponseFail.contains("message"), "Invalid Request");

	}

}


text:
import { mount } from '../../../../test/vue-jest-style-workaround.js';
import CdrModal from '../CdrModal.vue';

describe('CdrModal.vue', () => {
  describe('default open', ()=>{
    let wrapper;
    let elem;
    beforeEach(()=>{
      elem = document.createElement('div')
      if (document.body) {
        document.body.appendChild(elem)
      }
      wrapper = mount(CdrModal, {
        propsData: {
          opened: true,
          label: "Label is the modal title"
        },
        slots: {
          default: 'Sticky content',
        },
        attachTo: elem,
      });
    });

    it('renders correctly', () => {
      expect(wrapper.element).toMatchSnapshot();
    });

    it('contains the "cdr-modal__noscroll" class', () => {
      expect(document.documentElement.classList.contains('cdr-modal__noscroll')).toBe(true);
    });

    it('handleKeyDown', async () => {
      wrapper.trigger('keydown', {
        key: 'a'
      });
      await wrapper.vm.$nextTick();

      wrapper.trigger('keydown', {
        key: 'Esc',
      });
      await wrapper.vm.$nextTick();

      wrapper.trigger('keydown', {
        key: 'Escape',
      });
      await wrapper.vm.$nextTick();

      expect(wrapper.emitted().closed.length).toBe(2);
    });

    // describe('after removeNoScroll has been called', ()=>{
    //   beforeEach(()=>{
    //     wrapper.vm.removeNoScroll();
    //   });

    //   it('renders correctly', () => {
    //     expect(wrapper.element).toMatchSnapshot();
    //   });

    //   it('does NOT contain the "cdr-modal__noscroll" class', () => {
    //     expect(document.documentElement.classList.contains('cdr-modal__noscroll')).toBeFalsy();
    //     expect(document.body.classList.contains('cdr-modal__noscroll')).toBeFalsy();
    //   });
    // });
  });

  describe('default closed', ()=>{
    let wrapper;
    let elem;
    beforeEach(()=>{
      elem = document.createElement('div')
      if (document.body) {
        document.body.appendChild(elem)
      }
      wrapper = mount(CdrModal, {
        propsData: {
          opened: false,
          label: "Label is the modal title"
        },
        slots: {
          default: 'Sticky content',
        },
        attachTo: elem,
      });
    });

    it('renders correctly', () => {
      expect(wrapper.element).toMatchSnapshot();
    });
  });

  describe('fullscreen snapshot', ()=>{
    let wrapper;
    let elem;
    beforeEach(()=>{
      elem = document.createElement('div')
      if (document.body) {
        document.body.appendChild(elem)
      }
      wrapper = mount(CdrModal, {
        propsData: {
          opened: true,
          label: "Label is the modal title"
        },
        data() {
          return {
            fullscreen: true,
          };
        },
        slots: {
          scrollingContentSlot: 'Main content',
        },
        attachTo: elem,
      });
    });

    it('renders correctly', () => {
      expect(wrapper.element).toMatchSnapshot();
    });
  });
});


text:
<!DOCTYPE html>
<script src="../resources/text-based-repaint.js"></script>
<script>
function repaintTest() {
  document.getElementById('textarea').style.resize = 'auto';
}
onload = runRepaintAndPixelTest;
</script>
Tests paint invalidation when a textarea's resize property changed.
Passes if the resize handle is repainted correctly.
<textarea id="textarea" style="
  position: absolute;
  top: 50px;
  left: 0;
  width: 100px;
  height: 100px;
  resize: none">
</textarea>


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="HandheldFriendly" content="true" />
  <link rel="shortcut icon" href="https://www.epa.gov/sites/all/themes/epa/favicon.ico" type="image/vnd.microsoft.icon" />
  <meta name="MobileOptimized" content="width" />
  <meta http-equiv="cleartype" content="on" />
  <meta http-equiv="ImageToolbar" content="false" />
  <meta name="viewport" content="width=device-width" />
  <meta name="version" content="20161218" />

  <meta name="DC.description" content="" />
  <meta name="DC.title" content="" />
  <title>
  Role of land use and BMPs in reducing the effect of extreme magnitude events on sediment and pollutant transport in the SE US Coastal Plain and Mississippi Alluvial Valley|

  Research Project Database | Grantee Research Project | ORD | US EPA</title>

  <meta name="keywords" content="" />
  <link rel="shortlink" href="" />
  <link rel="canonical" href="" />
  <meta name="DC.creator" content="" />
  <meta name="DC.language" content="en" />
  <meta name="DC.Subject.epachannel" content="" />
  <meta name="DC.type" content="" />
  <meta name="DC.date.created" content="" />
  <meta name="DC.date.modified" content="2012-06-26" />

  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/misc/ui/jquery.ui.autocomplete.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/lib/jquery.ui.theme.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/libraries/template2/s.css" media="all" />

	<link rel="alternate" type="application/atom+xml" title="EPA.gov All Press Releases" href="https://www.epa.gov/newsreleases/search/rss" />
	<link rel="alternate" type="application/atom+xml" title="EPA.gov Headquarters Press Releases" href="https://www.epa.gov/newsreleases/search/rss/field_press_office/headquarters" />
	<link rel="alternate" type="application/atom+xml" title="Greenversations, EPA's Blog" href="https://blog.epa.gov/blog/feed/" />

Jump to main content

  <hgroup class="site-name-and-slogan">

US EPA

United States Environmental Protection Agency

  </hgroup>
  <form class="epa-search" method="get" action="https://search.epa.gov/epasearch/epasearch">
    Search
    <input class="form-text" placeholder="Search EPA.gov" name="querytext" id="search-box" value=""/>
    <button class="epa-search-button" id="search-button" type="submit" title="Search">Search</button>
    <input type="hidden" name="fld" value="" />
    <input type="hidden" name="areaname" value="" />
    <input type="hidden" name="areacontacts" value="" />
    <input type="hidden" name="areasearchurl" value="" />
    <input type="hidden" name="typeofsearch" value="epa" />
    <input type="hidden" name="result_template" value="2col.ftl" />
    <input type="hidden" name="filter" value="sample4filt.hts" />
  </form>

Contact Us

Project Research Results

2014 Progress Report

2013 Progress Report

2012 Progress Report

                      11 publications for this project

Related Information

Research Grants

P3: Student Design Competition

Research Fellowships

Small Business Innovation Research (SBIR)

Grantee Research Project Results Search

      Role of land use and BMPs in reducing the effect of extreme magnitude events on sediment and pollutant transport in the SE US Coastal Plain and Mississippi Alluvial Valley

    EPA Grant Number: R835186

    Title: Role of land use and BMPs in reducing the effect of extreme magnitude events on sediment and pollutant transport in the SE US Coastal Plain and Mississippi Alluvial Valley

    Investigators:
     Hatten, Jeffery A

    Institution:

      Oregon State University

    	EPA Project Officer:

           Hiscock, Michael

      Project Period:
      April 1, 2012 through
        March 31, 2017

        Project Amount:

          $363,258

      RFA:
      Extreme Event Impacts on Air Quality and Water Quality with a Changing Global Climate (2011)

        		RFA Text |
          Recipients Lists

      Research Category:

          Global Climate Change
          ,
          Air Quality and Air Toxics
          ,
          Water and Watersheds
          ,
          Climate Change
          ,
          Air
          ,
          Water

Description:

	Suspended sediment is a major non-point source pollutant of surface waters. Best management practices (BMPs) and current landuse decisions may not be sufficient to protect water quality in a changing climate, as a result of a loss of efficiency at reducing suspended sediment at high storm intensities. Climate change is expected to increase the magnitude of storm events across the Southeast United States, potentially resulting in impacts to water quality in this region. Interactions among BMPs, land management, land use change, and water quality as storm events change in magnitude are unknown. It is important to understand the efficiency of BMPs and land-use decisions in affecting water quality so that policy makers can make informed, proactive decisions with regard to future water quality policies.

Objective:

	The overall objective of this research is to understand the role of BMPs and land use decisions on water quality in the face of climate change. We hypothesize that the efficiency of BMPs at reducing sediment and pollutant yield will decrease with increasing storm magnitude; however in large multi-use watersheds any reduction in suspended sediment as a result of conservation practices may be annulled by landuse change. Two objectives have been developed to guide this research: Objective #I. Determine the capacity ofBMPs to reduce large event caused delivery of sediment in lakes with small watersheds in the Mississippi Alluvial Valley (MA V). Objective #2. Determine the role that BMP development and landuse decisions have had on event associated sedimentation rates in a lake with a large watershed.

Approach:

	We will examine overall and event caused sedimentation rates in I) oxbow lakes in the MA V (small watersheds) where BMPs have been implemented and shown to reduce sedimentation rates in lakes and 2) Ross Barnett Reservoir a large multi-use watershed of the Upper Pearl River, MS. We will correlate sedimentation rates with climatic history to determine watershed response pre- and post-BMP and/or historical land use. In the large watershed we will combine the sedimentation record with historical and current water quality data to determine historical levels of total suspended solids, total nitrogen, and total phosphorus. We will combine these efforts with geochemical analyses to determine the source of sediment being discharged into these depositional areas - allowing us to diagnose BMPs and landuse decisions.

Expected Results:

	We will determine the overall efficiency of BMPs and effects of landuse on suspended sediment over a wide range of climatic conditions and as a result of predicted change to climate for the MA V and MS Coastal Plain. In this proposal we will also test an approach that will be useful across many regions to assess the response of water quality in managed or developed watersheds with regard to climate change.

Publications and Presentations:

        Publications have been submitted on this project: View all 11 publications for this project

Supplemental Keywords:

      watersheds, pollution prevention, hydrology, agriculture, forestry, sediment, sedimentation, best management practices, Southeast, EPA Region 4

Progress and Final Reports:

                2012 Progress Report

                2013 Progress Report

                2014 Progress Report

Top of Page

 The perspectives, information and conclusions conveyed in research project abstracts, progress reports, final reports, journal abstracts and journal publications convey the viewpoints of the principal investigator and may not represent the views and policies of ORD and EPA.  Conclusions drawn by the principal investigators have not been reviewed by the Agency.

Main menu

Environmental Topics

Laws & Regulations

About EPA

Discover.

Accessibility

EPA Administrator

Budget & Performance

Contracting

Grants

No FEAR Act Data

Privacy and Security

Connect.

Data.gov

Inspector General

Jobs

Newsroom

Open Government

Regulations.gov

Subscribe

USA.gov

White House

Ask.

Contact Us

Hotlines

FOIA Requests

Frequent Questions

Follow.

Facebook

Twitter

YouTube

Flickr

Instagram

Last updated on Tuesday, June 26, 2012


text:
package org.pac4j.http.client;

import org.pac4j.core.client.BaseClient;
import org.pac4j.core.client.Mechanism;
import org.pac4j.core.client.RedirectAction;
import org.pac4j.core.context.WebContext;
import org.pac4j.core.exception.RequiresHttpAction;
import org.pac4j.core.exception.TechnicalException;
import org.pac4j.core.util.CommonHelper;
import org.pac4j.http.credentials.UsernamePasswordAuthenticator;
import org.pac4j.http.credentials.UsernamePasswordCredentials;
import org.pac4j.http.profile.HttpProfile;
import org.pac4j.http.profile.ProfileCreator;

/**
 * This class is the client to authenticate users through HTTP form.
 *

 * The login url of the form must be defined through the {@link #setLoginUrl(String)} method. For authentication, the user is redirected to
 * this login form. The username and password inputs must be posted on the callback url. Their names can be defined by using the
 * {@link #setUsernameParameter(String)} and {@link #setPasswordParameter(String)} methods.
 *

 * It returns a {@link org.pac4j.http.profile.HttpProfile}.
 *
 * @see org.pac4j.http.profile.HttpProfile
 * @author Jerome Leleu
 * @since 1.4.0
 */
public class FormClient extends BaseHttpClient {

    private String loginUrl;

    public final static String ERROR_PARAMETER = "error";

    public final static String MISSING_FIELD_ERROR = "missing_field";

    public final static String DEFAULT_USERNAME_PARAMETER = "username";

    private String usernameParameter = DEFAULT_USERNAME_PARAMETER;

    public final static String DEFAULT_PASSWORD_PARAMETER = "password";

    private String passwordParameter = DEFAULT_PASSWORD_PARAMETER;

    public FormClient() {
    }

    public FormClient(final String loginUrl, final UsernamePasswordAuthenticator usernamePasswordAuthenticator) {
        setLoginUrl(loginUrl);
        setUsernamePasswordAuthenticator(usernamePasswordAuthenticator);
    }

    public FormClient(final String loginUrl, final UsernamePasswordAuthenticator usernamePasswordAuthenticator,
                      final ProfileCreator profileCreator) {
        this(loginUrl, usernamePasswordAuthenticator);
        setProfileCreator(profileCreator);
    }

    @Override
    protected BaseClient<UsernamePasswordCredentials, HttpProfile> newClient() {
        final FormClient newClient = new FormClient();
        newClient.setLoginUrl(this.loginUrl);
        newClient.setUsernameParameter(this.usernameParameter);
        newClient.setPasswordParameter(this.passwordParameter);
        return newClient;
    }

    @Override
    protected void internalInit() {
        super.internalInit();
        CommonHelper.assertNotBlank("loginUrl", this.loginUrl);
    }

    @Override
    protected RedirectAction retrieveRedirectAction(final WebContext context) {
        return RedirectAction.redirect(this.loginUrl);
    }

    @Override
    protected UsernamePasswordCredentials retrieveCredentials(final WebContext context) throws RequiresHttpAction {
        final String username = context.getRequestParameter(this.usernameParameter);
        final String password = context.getRequestParameter(this.passwordParameter);
        if (CommonHelper.isNotBlank(username) && CommonHelper.isNotBlank(password)) {
            final UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password,
                                                                                getName());
            logger.debug("usernamePasswordCredentials : {}", credentials);
            try {
                // validate credentials
                this.usernamePasswordAuthenticator.validate(credentials);
            } catch (final TechnicalException e) {
                String redirectionUrl = CommonHelper.addParameter(this.loginUrl, this.usernameParameter, username);
                String errorMessage = computeErrorMessage(e);
                redirectionUrl = CommonHelper.addParameter(redirectionUrl, ERROR_PARAMETER, errorMessage);
                logger.debug("redirectionUrl : {}", redirectionUrl);
                final String message = "Credentials validation fails -> return to the form with error";
                logger.debug(message);
                throw RequiresHttpAction.redirect(message, context, redirectionUrl);
            }

            return credentials;
        }
        String redirectionUrl = CommonHelper.addParameter(this.loginUrl, this.usernameParameter, username);
        redirectionUrl = CommonHelper.addParameter(redirectionUrl, ERROR_PARAMETER, MISSING_FIELD_ERROR);
        logger.debug("redirectionUrl : {}", redirectionUrl);
        final String message = "Username and password cannot be blank -> return to the form with error";
        logger.debug(message);
        throw RequiresHttpAction.redirect(message, context, redirectionUrl);
    }

    /**
     * Return the error message depending on the thrown exception. Can be overriden for other message computation.
     *
     * @param e
     * @return the error message
     */
    protected String computeErrorMessage(final TechnicalException e) {
        return e.getClass().getSimpleName();
    }

    public String getLoginUrl() {
        return this.loginUrl;
    }

    public void setLoginUrl(final String loginUrl) {
        this.loginUrl = loginUrl;
    }

    public String getUsernameParameter() {
        return this.usernameParameter;
    }

    public void setUsernameParameter(final String usernameParameter) {
        this.usernameParameter = usernameParameter;
    }

    public String getPasswordParameter() {
        return this.passwordParameter;
    }

    public void setPasswordParameter(final String passwordParameter) {
        this.passwordParameter = passwordParameter;
    }

    @Override
    public String toString() {
        return CommonHelper.toString(this.getClass(), "callbackUrl", this.callbackUrl, "name", getName(), "loginUrl",
                                     this.loginUrl, "usernameParameter", this.usernameParameter, "passwordParameter",
                                     this.passwordParameter, "usernamePasswordAuthenticator",
                                     getUsernamePasswordAuthenticator(), "profileCreator", getProfileCreator());
    }

    @Override
    protected boolean isDirectRedirection() {
        return true;
    }

    @Override
    public Mechanism getMechanism() {
        return Mechanism.FORM_MECHANISM;
    }
}


text:
import datetime

from django.db import models

# Date conflicts can arise
class Season(models.Model):
    name = models.CharField(
        max_length=50, verbose_name="navn", help_text="Jul, Påske etc."
    )
    logo = models.ImageField(
        null=True,
        blank=True,
        upload_to="seasonal_events/logos/",
        help_text="Dersom ingen logo lastes opp brukes standard hackerspace-logo",
    )
    start_date = models.DateTimeField(
        verbose_name="startdato", help_text="Prøv å unngå overlapp mellom datoer"
    )
    end_date = models.DateTimeField(
        verbose_name="sluttdato", help_text="Prøv å unngå overlapp mellom datoer"
    )
    active = models.BooleanField(default=True, verbose_name="aktiv")
    repeating = models.BooleanField(
        default=False, verbose_name="repeterende", help_text="Repeteres hvert år"
    )
    manual_override = models.BooleanField(
        verbose_name="Manuel overskriving", help_text="Tving sesongen til å være aktiv"
    )
    disable_reservations = models.BooleanField(
        verbose_name="Hindre reservasjoner",
        help_text="Skru av mulighet for reservasjoner til ikke-medlemmer når denne sesongen er aktiv.",
    )

    def isNow(self):
        if not self.active:
            return False
        if self.manual_override:
            return True
        if not self.repeating:
            if self.start_date <= datetime.datetime.now() <= self.end_date:
                return True
        else:
            if (
                self.start_date.day <= datetime.datetime.now().day <= self.end_date.day
            ) and (
                self.start_date.month
                <= datetime.datetime.now().month
                <= self.end_date.month
            ):
                return True
        return False

    def __str__(self):
        return self.name

    class Meta:
        verbose_name_plural = "Seasons"


text:
from hashes_tests import TestRandomBinaryProjections, \
    TestRandomDiscretizedProjections, TestPCABinaryProjections
from engine_tests import TestEngine
from storage_tests import TestStorage
from distances_tests import TestEuclideanDistance, TestAngularDistance
from filters_tests import TestVectorFilters
from experiments_tests import TestRecallExperiment


text:
    <title>OpenLayers: Sundials on a Spherical Mercator Map</title>

    <link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css" />
        <link rel="stylesheet" href="http://openlayers.org/dev/theme/default/framedCloud.css" type="text/css" />

OSM + Google Maps + GeoRSS feed


text:
package sqlreflect

import (
	"github.com/Masterminds/squirrel"
	"github.com/Masterminds/structable"
)

// TableConstraint defines a constraint (e.g. primary key, foreign key...)
// placed on a table.
type TableConstraint struct {
	//TableLocator
	TableCatalog   string `stbl:"table_catalog"`
	TableSchema    string `stbl:"table_schema"`
	TableNameField string `stbl:"table_name"`

	// ConstraintLocator
	ConstraintCatalog string `stbl:"constraint_catalog"`
	ConstraintSchema  string `stbl:"constraint_schema"`
	ConstraintName    string `stbl:"constraint_name"`

	ConstraintType    ConstraintType `stbl:"constraint_type"`
	IsDeferrable      YesNo          `stbl:"is_deferrable"`
	InitiallyDeferred YesNo          `stbl:"initially_deferred"`

	opts *DBOptions
}

func (t *TableConstraint) TableName() string {
	return "information_schema.table_constraints"
}

// ColumnUsage returns information about which columns are used in this key.
func (this *TableConstraint) ColumnUsage() ([]*KeyColumnUsage, error) {
	t := &KeyColumnUsage{}
	res := []*KeyColumnUsage{}
	st := structable.New(this.opts.Queryer, this.opts.Driver).Bind(t.TableName(), t)
	fn := func(d structable.Describer, q squirrel.SelectBuilder) (squirrel.SelectBuilder, error) {
		q = q.Where("constraint_schema=? AND constraint_catalog = ? AND constraint_name = ?",
			this.ConstraintSchema, this.ConstraintCatalog, this.ConstraintName)
		return q, nil
	}
	items, err := structable.ListWhere(st, fn)
	if err != nil {
		return res, err
	}
	for _, item := range items {
		tt := item.Interface().(*KeyColumnUsage)
		tt.opts = this.opts
		res = append(res, tt)
	}
	return res, nil
}


text:
/*global process */

var sf = require('../../../lib/jsforce');

require('../async-check');

/**
 *
 */
module.exports = {

  isBrowser: true,

  assert: require('assert'),

  createConnection: function(config) {
    var conn = new sf.Connection({
      loginUrl: config.loginUrl,
      proxyUrl: config.proxyUrl,
      logLevel: config.logLevel,
    });
    return conn;
  },

  establishConnection: function(conn, config, done) {
    conn.login(config.username, config.password, function(err) {
      if (err) { throw err; }
      if (!conn.accessToken) { throw new Error("No access token. Invalid login."); }
    }.check(done));
  }

};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.Web;

namespace YapperWebRole
{
    public class YapperWebBehaviour : WebHttpBehavior
    {
        protected override QueryStringConverter GetQueryStringConverter(OperationDescription operationDescription)
        {
            return new DataAccessLayer.YapperQueryConverter();
        }
    }

}