text:
enum {
	IDOK = 1,
	IDCANCEL = 2,
	IDABORT = 3,
	IDRETRY = 4,
	IDIGNORE = 5,
	IDYES = 6,
	IDNO = 7,
	IDCLOSE = 8,
	IDHELP = 9,
};

#endif

enum {
	IDEXIT = IDYES
};

class TopWindow : public Ctrl {
public:
	virtual Size     GetMinSize() const;
	virtual Size     GetStdSize() const;
	virtual void     Activate();
	virtual void     Deactivate();
	virtual bool     Accept();
	virtual void     Reject();
	virtual void     Paint(Draw& w);
	virtual bool     IsShowEnabled() const;
	virtual bool     Key(dword key, int count);
	virtual void     Close();
	virtual String   GetDesc() const;
	virtual void     ChildGotFocus();

#ifdef PLATFORM_WIN32
public:
	virtual LRESULT  WindowProc(UINT message, WPARAM wParam, LPARAM lParam);

private:
	dword       style;
	dword       exstyle;
	HICON       ico, lico;

	void        DeleteIco0();
	void        DeleteIco();
#endif

protected:
	enum {
		TIMEID_DEFSYNCTITLE = Ctrl::TIMEID_COUNT,
		TIMEID_COUNT,
	};

#ifdef PLATFORM_X11
	virtual void    EventProc(XWindow& w, XEvent *event);
private:
	XSizeHints *size_hints;
	XWMHints   *wm_hints;
	XClassHint *class_hint;
	Size        xminsize, xmaxsize;
	bool        topmost;
#endif

	static  Rect      windowFrameMargin;

private:
	struct Abreak : Pte<Abreak> {
		int         ID;
		TopWindow *dlg;

		void    Accept()      { dlg->AcceptBreak(ID); }
		void    Reject()      { dlg->RejectBreak(ID); }
		void    Break()       { dlg->Break(ID); }
	};

	Array<Abreak> action;
	Ptr<Ctrl>     activefocus;
	String        backup;
	PaintRect     background;
	Size          minsize;
	bool          dokeys;
	bool          fullscreen;

	byte          center:2;

	void          PlaceFocus();
	void          ActiveFocus0(Ctrl& ctrl);
	Abreak       *FindAddAction(int ID);
	Abreak       *FindAction(int ID);

#ifdef PLATFORM_WIN32
	void          CenterRect(HWND owner, int center);
#endif

#ifdef PLATFORM_X11
	void          CenterRect(Ctrl *owner);
	void          DefSyncTitle();
	void          EndIgnoreTakeFocus();
#endif

	Rect        overlapped;

	void        SyncTitle0();
	void        SyncSizeHints();
	void        SyncTitle();
	void        SyncCaption0();
	void        SyncCaption();

	void        SetupRect();

	void        FixIcons();

	enum { MINIMIZED, MAXIMIZED, OVERLAPPED };

	WString     title;
	bool        minimizebox:1;
	bool        maximizebox:1;
	bool        noclosebox:1;
	bool        sizeable:1;
	bool        tool:1;
	bool        frameless:1;
	byte        state;
	Image       icon, largeicon;
#ifdef PLATFORM_X11
	Image       invert;
	WString     title2;
#endif

public:
	Callback    WhenClose;

	void        Backup();
	void        Restore();

	void        Break(int ID = IDEXIT);
	bool        AcceptBreak(int ID);
	void        RejectBreak(int ID);

	void        WorkAreaTrim();

	Callback    Breaker(int ID = IDEXIT);
	Callback    Acceptor(int ID);
	Callback    Rejector(int ID);

	TopWindow&  Breaker(Ctrl& m, int ID = -1);
	TopWindow&  Acceptor(Ctrl& m, int ID);
	TopWindow&  Rejector(Ctrl& m, int ID);

	TopWindow&  NoCenter()                          { center = 0; return *this; }
	TopWindow&  CenterOwner()                       { center = 1; return *this; }
	TopWindow&  CenterScreen()                      { center = 2; return *this; }

	void        SetMinSize(Size sz)                 { minsize = sz; }

#ifdef PLATFORM_WIN32
	void       Open(HWND ownerhwnd);
	TopWindow& Style(dword _style);
	dword      GetStyle() const                       { return style; }
	TopWindow& ExStyle(dword _exstyle);
	dword      GetExStyle() const                     { return exstyle; }
#endif

	void       Open(Ctrl *owner);
	void       Open();
	void       OpenMain();
	int        Run(bool appmodal = false);
	int        RunAppModal()                          { return Run(true); }
	int        Execute();
	bool       ExecuteOK()                            { return Execute() == IDOK;     }
	bool       ExecuteCancel()                        { return Execute() == IDCANCEL; }

	void       Minimize(bool effect = false);
	void       Maximize(bool effect = false);
	void       Overlap(bool effect = false);

	bool       IsMaximized() const                    { return state == MAXIMIZED; }
	bool       IsMinimized() const                    { return state == MINIMIZED; }
	bool       IsOverlapped() const                   { return state == OVERLAPPED; }

	TopWindow& ActiveFocus(Ctrl& ctrl)                { ActiveFocus0(ctrl); return *this; }

	TopWindow& Title(const WString& _title);
	TopWindow& Title(const char *s);
	const WString& GetTitle() const                   { return title; }
	TopWindow& Sizeable(bool b = true);
	TopWindow& NoSizeable()                           { return Sizeable(false); }
	bool       IsSizeable() const                     { return sizeable; }
	TopWindow& MinimizeBox(bool b = true);
	TopWindow& MaximizeBox(bool b = true);
	TopWindow& Zoomable(bool b = true)                { MinimizeBox(b); return MaximizeBox(b); }
	TopWindow& NoZoomable()                           { return Zoomable(false); }
	bool       IsZoomable() const                     { return maximizebox; }
	TopWindow& Background(const PaintRect& prect);
	const PaintRect& GetBackground() const            { return background; }
	TopWindow& ToolWindow(bool b = true);
	TopWindow& NoToolWindow()                         { return ToolWindow(false); }
	bool       IsToolWindow() const                   { return tool; }
	TopWindow& TopMost(bool b = true, bool stay_top = true);
	TopWindow& NoTopMost()                            { return TopMost(false); }
	bool       IsTopMost() const;
	TopWindow& FullScreen(bool b = true)              { fullscreen = b; return *this; }
	bool       IsFullScreen() const                   { return fullscreen; }
	TopWindow& FrameLess(bool b = true)               { frameless = b; return *this; }
	bool       IsFrameLess() const                    { return frameless; }
	TopWindow& NoAccessKeysDistribution()             { dokeys = false; return *this; }
	TopWindow& NoCloseBox(bool b = true)              { noclosebox = b; return *this; }

	TopWindow& Icon(const Image& m);
	TopWindow& LargeIcon(const Image& m);
	TopWindow& Icon(const Image& smallicon, const Image& largeicon);

	Image      GetIcon() const                        { return icon; }
	Image      GetLargeIcon() const                   { return largeicon; }

	void       SerializePlacement(Stream& s, bool reminimize = false);

	typedef TopWindow CLASSNAME;

	TopWindow();
	~TopWindow();
};

void Maxisize(TopWindow& win, int screencxmax);

void ArrangeOKCancel(Ctrl& ok, Ctrl& cancel);

int  SwapOKCancel();
void SwapOKCancel_Write(int b);

template <class L>
void InitLayout(Ctrl& ctrl, L& layout)
{
	InitLayout(ctrl, layout, layout, layout);
}

template <class T>
void CtrlLayout(T& ctrl) {
	InitLayout(ctrl, ctrl, ctrl, ctrl);
	Size sz = ctrl.AddFrameSize(T::GetLayoutSize());
	ctrl.SetMinSize(sz);
	ctrl.SetRect(sz);
}

template <class T>
void CtrlLayout(T& ctrl, const char *title) {
	CtrlLayout(ctrl);
	ctrl.Title(title);
}

template <class T>
void CtrlLayoutOK(T& ctrl, const char *title) {
	CtrlLayout(ctrl, title);
	ctrl.Acceptor(ctrl.ok, IDOK);
	ctrl.ok.Ok();
}

template <class T>
void CtrlLayoutCancel(T& ctrl, const char *title) {
	CtrlLayout(ctrl, title);
	ctrl.Rejector(ctrl.cancel, IDCANCEL);
	ctrl.cancel.Cancel();
}

template <class T>
void CtrlLayoutOKCancel(T& ctrl, const char *title) {
	CtrlLayoutOK(ctrl, title);
	ctrl.Rejector(ctrl.cancel, IDCANCEL);
	ctrl.cancel.Cancel();
	ArrangeOKCancel(ctrl.ok, ctrl.cancel);
}

template <class T>
void CtrlLayoutExit(T& ctrl, const char *title) {
	CtrlLayout(ctrl, title);
	ctrl.Acceptor(ctrl.exit, IDEXIT);
	ctrl.exit.Exit();
}


text:
1. [](#new)
    * Made various components of the sidebar and article display optional. If all components of a specific unit are hidden, then the entire unit is hidden.
    * The config variable `params:articleroot` is now deprecated. Use `params:articles:root` instead. Backwards compatibility will be removed at the next major release.

# v1.1.1
##  02/21/2017

1. [](#new)
    * Simplified Chinese tranlsation added. Thanks, @lazyyz!

# v1.1.0
##  02/19/2017

1. [](#new)
    * Theme now configured to allow for translations
    * Czech translation added
    * Many thanks to @rbukovansky for these changes!

# v1.0.1
##  11/05/2016

1. [](#bugfix)
    * Added plugin dependencies to the blueprint

# v1.0.0
##  10/22/2016

1. [](#new)
    * ChangeLog started...

redpajama_set_name: RedPajamaGithub


text:
namespace
{

class EGLSurfaceTest : public testing::Test
{
  protected:
    EGLSurfaceTest()
        : mDisplay(EGL_NO_DISPLAY),
          mWindowSurface(EGL_NO_SURFACE),
          mPbufferSurface(EGL_NO_SURFACE),
          mContext(EGL_NO_CONTEXT),
          mSecondContext(EGL_NO_CONTEXT),
          mOSWindow(nullptr)
    {
    }

    void SetUp() override
    {
        mOSWindow = CreateOSWindow();
        mOSWindow->initialize("EGLSurfaceTest", 64, 64);
    }

    // Release any resources created in the test body
    void TearDown() override
    {
        if (mDisplay != EGL_NO_DISPLAY)
        {
            eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);

            if (mWindowSurface != EGL_NO_SURFACE)
            {
                eglDestroySurface(mDisplay, mWindowSurface);
                mWindowSurface = EGL_NO_SURFACE;
            }

            if (mPbufferSurface != EGL_NO_SURFACE)
            {
                eglDestroySurface(mDisplay, mPbufferSurface);
                mPbufferSurface = EGL_NO_SURFACE;
            }

            if (mContext != EGL_NO_CONTEXT)
            {
                eglDestroyContext(mDisplay, mContext);
                mContext = EGL_NO_CONTEXT;
            }

            if (mSecondContext != EGL_NO_CONTEXT)
            {
                eglDestroyContext(mDisplay, mSecondContext);
                mSecondContext = EGL_NO_CONTEXT;
            }

            eglTerminate(mDisplay);
            mDisplay = EGL_NO_DISPLAY;
        }

        mOSWindow->destroy();
        SafeDelete(mOSWindow);

        ASSERT_TRUE(mWindowSurface == EGL_NO_SURFACE && mContext == EGL_NO_CONTEXT);
    }

    void initializeDisplay(EGLenum platformType)
    {
        PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
        ASSERT_TRUE(eglGetPlatformDisplayEXT != nullptr);

        std::vector<EGLint> displayAttributes;
        displayAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
        displayAttributes.push_back(platformType);
        displayAttributes.push_back(EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE);
        displayAttributes.push_back(EGL_DONT_CARE);
        displayAttributes.push_back(EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE);
        displayAttributes.push_back(EGL_DONT_CARE);

        if (platformType == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE || platformType == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
        {
            displayAttributes.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE);
            displayAttributes.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
        }
        displayAttributes.push_back(EGL_NONE);

        mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE,
                                            reinterpret_cast<void *>(mOSWindow->getNativeDisplay()),
                                            displayAttributes.data());
        ASSERT_TRUE(mDisplay != EGL_NO_DISPLAY);

        EGLint majorVersion, minorVersion;
        ASSERT_TRUE(eglInitialize(mDisplay, &majorVersion, &minorVersion) == EGL_TRUE);

        eglBindAPI(EGL_OPENGL_ES_API);
        ASSERT_TRUE(eglGetError() == EGL_SUCCESS);
    }

    void initializeContext()
    {
        EGLint contextAttibutes[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};

        mContext = eglCreateContext(mDisplay, mConfig, nullptr, contextAttibutes);
        ASSERT_TRUE(eglGetError() == EGL_SUCCESS);

        mSecondContext = eglCreateContext(mDisplay, mConfig, nullptr, contextAttibutes);
        ASSERT_TRUE(eglGetError() == EGL_SUCCESS);
    }

    void initializeSurface(EGLConfig config)
    {
        mConfig = config;

        std::vector<EGLint> surfaceAttributes;
        surfaceAttributes.push_back(EGL_NONE);
        surfaceAttributes.push_back(EGL_NONE);

        // Create first window surface
        mWindowSurface = eglCreateWindowSurface(mDisplay, mConfig, mOSWindow->getNativeWindow(), &surfaceAttributes[0]);
        ASSERT_TRUE(eglGetError() == EGL_SUCCESS);

        mPbufferSurface = eglCreatePbufferSurface(mDisplay, mConfig, &surfaceAttributes[0]);
        initializeContext();
    }

    void initializeSurfaceWithDefaultConfig()
    {
        const EGLint configAttributes[] =
        {
            EGL_RED_SIZE, EGL_DONT_CARE,
            EGL_GREEN_SIZE, EGL_DONT_CARE,
            EGL_BLUE_SIZE, EGL_DONT_CARE,
            EGL_ALPHA_SIZE, EGL_DONT_CARE,
            EGL_DEPTH_SIZE, EGL_DONT_CARE,
            EGL_STENCIL_SIZE, EGL_DONT_CARE,
            EGL_SAMPLE_BUFFERS, 0,
            EGL_NONE
        };

        EGLint configCount;
        EGLConfig config;
        ASSERT_TRUE(eglChooseConfig(mDisplay, configAttributes, &config, 1, &configCount) || (configCount != 1) == EGL_TRUE);

        initializeSurface(config);
    }

    GLuint createProgram()
    {
        const std::string testVertexShaderSource = SHADER_SOURCE
        (
            attribute highp vec4 position;

            void main(void)
            {
                gl_Position = position;
            }
        );

        const std::string testFragmentShaderSource = SHADER_SOURCE
        (
            void main(void)
            {
                gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
            }
        );

        return CompileProgram(testVertexShaderSource, testFragmentShaderSource);
    }

    void drawWithProgram(GLuint program)
    {
        glClearColor(0, 0, 0, 1);
        glClear(GL_COLOR_BUFFER_BIT);

        GLint positionLocation = glGetAttribLocation(program, "position");

        glUseProgram(program);

        const GLfloat vertices[] =
        {
            -1.0f,  1.0f, 0.5f,
            -1.0f, -1.0f, 0.5f,
             1.0f, -1.0f, 0.5f,

            -1.0f,  1.0f, 0.5f,
             1.0f, -1.0f, 0.5f,
             1.0f,  1.0f, 0.5f,
        };

        glVertexAttribPointer(positionLocation, 3, GL_FLOAT, GL_FALSE, 0, vertices);
        glEnableVertexAttribArray(positionLocation);

        glDrawArrays(GL_TRIANGLES, 0, 6);

        glDisableVertexAttribArray(positionLocation);
        glVertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 0, nullptr);

        EXPECT_PIXEL_EQ(mOSWindow->getWidth() / 2, mOSWindow->getHeight() / 2, 255, 0, 0, 255);
    }

    void runMessageLoopTest(EGLSurface secondSurface, EGLContext secondContext)
    {
        eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
        ASSERT_TRUE(eglGetError() == EGL_SUCCESS);

        // Make a second context current
        eglMakeCurrent(mDisplay, secondSurface, secondSurface, secondContext);
        eglDestroySurface(mDisplay, mWindowSurface);

        // Create second window surface
        std::vector<EGLint> surfaceAttributes;
        surfaceAttributes.push_back(EGL_NONE);
        surfaceAttributes.push_back(EGL_NONE);

        mWindowSurface = eglCreateWindowSurface(mDisplay, mConfig, mOSWindow->getNativeWindow(), &surfaceAttributes[0]);
        ASSERT_TRUE(eglGetError() == EGL_SUCCESS);

        eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
        ASSERT_TRUE(eglGetError() == EGL_SUCCESS);

        mOSWindow->signalTestEvent();
        mOSWindow->messageLoop();
        ASSERT_TRUE(mOSWindow->didTestEventFire());

        // Simple operation to test the FBO is set appropriately
        glClear(GL_COLOR_BUFFER_BIT);
    }

    EGLDisplay mDisplay;
    EGLSurface mWindowSurface;
    EGLSurface mPbufferSurface;
    EGLContext mContext;
    EGLContext mSecondContext;
    EGLConfig mConfig;
    OSWindow *mOSWindow;
};

// Test a surface bug where we could have two Window surfaces active
// at one time, blocking message loops. See http://crbug.com/475085
TEST_F(EGLSurfaceTest, MessageLoopBug)
{
    const char *extensionsString = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
    if (strstr(extensionsString, "EGL_ANGLE_platform_angle_d3d") == nullptr)
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
    initializeSurfaceWithDefaultConfig();

    runMessageLoopTest(EGL_NO_SURFACE, EGL_NO_CONTEXT);
}

// Tests the message loop bug, but with setting a second context
// instead of null.
TEST_F(EGLSurfaceTest, MessageLoopBugContext)
{
    const char *extensionsString = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
    if (strstr(extensionsString, "EGL_ANGLE_platform_angle_d3d") == nullptr)
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
    initializeSurfaceWithDefaultConfig();

    runMessageLoopTest(mPbufferSurface, mSecondContext);
}

// Test a bug where calling makeCurrent twice would release the surface
TEST_F(EGLSurfaceTest, MakeCurrentTwice)
{
#if defined(ANGLE_PLATFORM_APPLE) && !defined(ANGLE_STANDALONE_BUILD)
    // TODO(cwallez) Make context creation return at least an OpenGL ES 2 context on
    // the Mac trybots.
    std::cout << "Test skipped temporarily skipped on the Mac trybots" << std::endl;
    return;
#endif

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE);
    initializeSurfaceWithDefaultConfig();

    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    ASSERT_TRUE(eglGetError() == EGL_SUCCESS);

    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    ASSERT_TRUE(eglGetError() == EGL_SUCCESS);

    // Simple operation to test the FBO is set appropriately
    glClear(GL_COLOR_BUFFER_BIT);
}

// Test that the D3D window surface is correctly resized after calling swapBuffers
TEST_F(EGLSurfaceTest, ResizeD3DWindow)
{
    const char *extensionsString = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
    if (strstr(extensionsString, "EGL_ANGLE_platform_angle_d3d") == nullptr)
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
    initializeSurfaceWithDefaultConfig();
    initializeContext();

    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    eglSwapBuffers(mDisplay, mWindowSurface);
    ASSERT_EGL_SUCCESS();

    EGLint height;
    eglQuerySurface(mDisplay, mWindowSurface, EGL_HEIGHT, &height);
    ASSERT_EGL_SUCCESS();
    ASSERT_EQ(64, height);  // initial size

    // set window's height to 0
    mOSWindow->resize(64, 0);

    eglSwapBuffers(mDisplay, mWindowSurface);
    ASSERT_EGL_SUCCESS();

    eglQuerySurface(mDisplay, mWindowSurface, EGL_HEIGHT, &height);
    ASSERT_EGL_SUCCESS();
    ASSERT_EQ(0, height);

    // restore window's height
    mOSWindow->resize(64, 64);

    eglSwapBuffers(mDisplay, mWindowSurface);
    ASSERT_EGL_SUCCESS();

    eglQuerySurface(mDisplay, mWindowSurface, EGL_HEIGHT, &height);
    ASSERT_EGL_SUCCESS();
    ASSERT_EQ(64, height);
}

// Test creating a surface that supports a EGLConfig with 16bit
// support GL_RGB565
TEST_F(EGLSurfaceTest, CreateWithEGLConfig5650Support)
{
    if (!ANGLETest::eglDisplayExtensionEnabled(EGL_NO_DISPLAY, "EGL_ANGLE_platform_angle_d3d"))
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }

    const EGLint configAttributes[] =
    {
        EGL_RED_SIZE, 5,
        EGL_GREEN_SIZE, 6,
        EGL_BLUE_SIZE, 5,
        EGL_ALPHA_SIZE, 0,
        EGL_DEPTH_SIZE, 0,
        EGL_STENCIL_SIZE, 0,
        EGL_SAMPLE_BUFFERS, 0,
        EGL_NONE
    };

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
    EGLConfig config;
    if (EGLWindow::FindEGLConfig(mDisplay, configAttributes, &config) == EGL_FALSE)
    {
        std::cout << "EGLConfig for a GL_RGB565 surface is not supported, skipping test" << std::endl;
        return;
    }

    initializeSurface(config);

    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    ASSERT_EGL_SUCCESS();

    GLuint program = createProgram();
    ASSERT_NE(0u, program);
    drawWithProgram(program);
    EXPECT_GL_NO_ERROR();
    glDeleteProgram(program);
}

// Test creating a surface that supports a EGLConfig with 16bit
// support GL_RGBA4
TEST_F(EGLSurfaceTest, CreateWithEGLConfig4444Support)
{
    if (!ANGLETest::eglDisplayExtensionEnabled(EGL_NO_DISPLAY, "EGL_ANGLE_platform_angle_d3d"))
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }

    const EGLint configAttributes[] =
    {
        EGL_RED_SIZE, 4,
        EGL_GREEN_SIZE, 4,
        EGL_BLUE_SIZE, 4,
        EGL_ALPHA_SIZE, 4,
        EGL_DEPTH_SIZE, 0,
        EGL_STENCIL_SIZE, 0,
        EGL_SAMPLE_BUFFERS, 0,
        EGL_NONE
    };

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
    EGLConfig config;
    if (EGLWindow::FindEGLConfig(mDisplay, configAttributes, &config) == EGL_FALSE)
    {
        std::cout << "EGLConfig for a GL_RGBA4 surface is not supported, skipping test" << std::endl;
        return;
    }

    initializeSurface(config);

    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    ASSERT_EGL_SUCCESS();

    GLuint program = createProgram();
    ASSERT_NE(0u, program);
    drawWithProgram(program);
    EXPECT_GL_NO_ERROR();
    glDeleteProgram(program);
}

// Test creating a surface that supports a EGLConfig with 16bit
// support GL_RGB5_A1
TEST_F(EGLSurfaceTest, CreateWithEGLConfig5551Support)
{
    if (!ANGLETest::eglDisplayExtensionEnabled(EGL_NO_DISPLAY, "EGL_ANGLE_platform_angle_d3d"))
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }

    const EGLint configAttributes[] =
    {
        EGL_RED_SIZE, 5,
        EGL_GREEN_SIZE, 5,
        EGL_BLUE_SIZE, 5,
        EGL_ALPHA_SIZE, 1,
        EGL_DEPTH_SIZE, 0,
        EGL_STENCIL_SIZE, 0,
        EGL_SAMPLE_BUFFERS, 0,
        EGL_NONE
    };

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
    EGLConfig config;
    if (EGLWindow::FindEGLConfig(mDisplay, configAttributes, &config) == EGL_FALSE)
    {
        std::cout << "EGLConfig for a GL_RGB5_A1 surface is not supported, skipping test" << std::endl;
        return;
    }

    initializeSurface(config);

    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    ASSERT_EGL_SUCCESS();

    GLuint program = createProgram();
    ASSERT_NE(0u, program);
    drawWithProgram(program);
    EXPECT_GL_NO_ERROR();
    glDeleteProgram(program);
}

// Test creating a surface that supports a EGLConfig without alpha support
TEST_F(EGLSurfaceTest, CreateWithEGLConfig8880Support)
{
    if (!ANGLETest::eglDisplayExtensionEnabled(EGL_NO_DISPLAY, "EGL_ANGLE_platform_angle_d3d"))
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }

    const EGLint configAttributes[] =
    {
        EGL_RED_SIZE, 8,
        EGL_GREEN_SIZE, 8,
        EGL_BLUE_SIZE, 8,
        EGL_ALPHA_SIZE, 0,
        EGL_DEPTH_SIZE, 0,
        EGL_STENCIL_SIZE, 0,
        EGL_SAMPLE_BUFFERS, 0,
        EGL_NONE
    };

    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
    EGLConfig config;
    if (EGLWindow::FindEGLConfig(mDisplay, configAttributes, &config) == EGL_FALSE)
    {
        std::cout << "EGLConfig for a GL_RGB8_OES surface is not supported, skipping test"
                  << std::endl;
        return;
    }

    initializeSurface(config);

    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    ASSERT_EGL_SUCCESS();

    GLuint program = createProgram();
    ASSERT_NE(0u, program);
    drawWithProgram(program);
    EXPECT_GL_NO_ERROR();
    glDeleteProgram(program);
}

#if defined(ANGLE_ENABLE_D3D11)
// Test that rendering to an IDCompositionSurface using a pbuffer works.
TEST_F(EGLSurfaceTest, CreateDirectCompositionSurface)
{
    if (!ANGLETest::eglDisplayExtensionEnabled(EGL_NO_DISPLAY, "EGL_ANGLE_platform_angle_d3d"))
    {
        std::cout << "D3D Platform not supported in ANGLE" << std::endl;
        return;
    }
    initializeDisplay(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);

    EGLAttrib device       = 0;
    EGLAttrib newEglDevice = 0;
    ASSERT_EGL_TRUE(eglQueryDisplayAttribEXT(mDisplay, EGL_DEVICE_EXT, &newEglDevice));
    ASSERT_EGL_TRUE(eglQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(newEglDevice),
                                            EGL_D3D11_DEVICE_ANGLE, &device));
    angle::ComPtr<ID3D11Device> d3d11Device(reinterpret_cast<ID3D11Device *>(device));
    ASSERT_TRUE(!!d3d11Device);

    HMODULE dcompLibrary = LoadLibraryA("dcomp.dll");
    if (!dcompLibrary)
    {
        std::cout << "DirectComposition not supported" << std::endl;
        return;
    }
    typedef HRESULT(WINAPI * PFN_DCOMPOSITION_CREATE_DEVICE2)(IUnknown * dxgiDevice, REFIID iid,
                                                              void **dcompositionDevice);
    PFN_DCOMPOSITION_CREATE_DEVICE2 createDComp = reinterpret_cast<PFN_DCOMPOSITION_CREATE_DEVICE2>(
        GetProcAddress(dcompLibrary, "DCompositionCreateDevice2"));
    if (!createDComp)
    {
        std::cout << "DirectComposition2 not supported" << std::endl;
        FreeLibrary(dcompLibrary);
        return;
    }

    angle::ComPtr<IDCompositionDevice> dcompDevice;
    HRESULT hr = createDComp(d3d11Device.Get(), IID_PPV_ARGS(dcompDevice.GetAddressOf()));
    ASSERT_TRUE(SUCCEEDED(hr));

    angle::ComPtr<IDCompositionSurface> dcompSurface;
    hr = dcompDevice->CreateSurface(100, 100, DXGI_FORMAT_B8G8R8A8_UNORM,
                                    DXGI_ALPHA_MODE_PREMULTIPLIED, dcompSurface.GetAddressOf());
    ASSERT_TRUE(SUCCEEDED(hr));

    angle::ComPtr<ID3D11Texture2D> texture;
    POINT updateOffset;
    hr = dcompSurface->BeginDraw(nullptr, IID_PPV_ARGS(texture.GetAddressOf()), &updateOffset);
    ASSERT_TRUE(SUCCEEDED(hr));

    const EGLint configAttributes[] = {
        EGL_RED_SIZE,   8, EGL_GREEN_SIZE,   8, EGL_BLUE_SIZE,      8, EGL_ALPHA_SIZE, 8,
        EGL_DEPTH_SIZE, 0, EGL_STENCIL_SIZE, 0, EGL_SAMPLE_BUFFERS, 0, EGL_NONE};

    EGLConfig config;
    ASSERT_EGL_TRUE(EGLWindow::FindEGLConfig(mDisplay, configAttributes, &config));

    const EGLint surfaceAttributes[] = {EGL_WIDTH, 64, EGL_HEIGHT, 64, EGL_NONE};

    EGLClientBuffer buffer = reinterpret_cast<EGLClientBuffer>(texture.Get());
    mPbufferSurface = eglCreatePbufferFromClientBuffer(mDisplay, EGL_D3D_TEXTURE_ANGLE, buffer,
                                                       config, surfaceAttributes);
    ASSERT_EGL_SUCCESS();

    mConfig = config;
    initializeContext();

    eglMakeCurrent(mDisplay, mPbufferSurface, mPbufferSurface, mContext);
    ASSERT_EGL_SUCCESS();

    GLuint program = createProgram();
    ASSERT_NE(0u, program);
    drawWithProgram(program);
    EXPECT_GL_NO_ERROR();
    glDeleteProgram(program);
}

#endif
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">ReadyCast</string>
    <string name="prompt">Choose a RSS feed</string>
    <string name="src_sbs">SBS podcast</string>
    <string name="report_id">dFVnWnJiRk5YYTRBdU9DZzZTYjVWbXc6MQ</string>
    <string name="menu_settings">Settings</string>
    <string name="title_activity_intro">IntroActivity</string>
    <string name="main_tab1_title">Subscriptions</string>
    <string name="main_tab2_title">Downloads</string>
    <string name="main_tab3_title">New Feeds</string>
    <string name="tab1_num_down">Downloading </string>
    <string name="tab1_num_down_2">files </string>
    <string name="tab1_num2_down">Downloading </string>
    <string name="tab1_num2_down_2">files </string>
    <string name="tab1_manual">Downloads manually</string>
    <string name="tab1_sched_1">Watch at </string>
    <string name="tab1_sched_2"> everyday</string>
    <string name="tab1_1_title">Playlist</string>
    <string name="tab1_2_title">Feed list</string>
    <string name="tab1_1_btn">Switch to delete mode</string>
    <string name="tab1_1_btn1">Switch to watch mode</string>
    <string name="tab1_1_select">Select All</string>
    <string name="tab1_1_delete">Delete</string>
    <string name="tab1_2_btn1">Download now</string>
    <string name="tab1_2_btn2">Watch later</string>
    <string name="tab3_btn">Subscribe</string>
    <string name="tab3_title">Add a New Channel</string>

    <string name="setting_Deadline">Set default deadline</string>
    <string name="setting_Release">Release note</string>
    <string name="setting_Help">Help</string>
    <string name="setting_Project">Cedos project?</string>
    <string name="setting_Email">Send feedback to developers</string>

    <string name="tab1_popupTitle">Download Reservation</string>
    <string name="tab1_popupMessage">ReadyCast allows [download reservation] with a user-specified deadline, and the content is made ready by the time the user wants.</string>

    <string name="tab1_helpMessage1">TIP: You can save some money on smartphone mobile data using ReadyCast.</string>
    <string name="tab1_helpMessage2">TIP: Wi-Fi data usage increases by 29% on average when user can wait 1 hour.</string>
    <string name="tab1_helpMessage3">TIP: You can find out various information in the right-upper config menu.</string>
    <string name="tab1_helpMessage4">TIP: You can specify default download deadline time in config menu.</string>
    <string name="tab1_helpMessage5">TIP: You can avoid using expensive cellular network by using download reservation.</string>

</resources>


text:
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { MuiThemeProvider, Card, CardText, CardTitle } from 'material-ui';
import lightTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import injectEventTapPlugin from 'react-tap-event-plugin';

import ButtonBar from './components/ButtonBar';
import store from './redux/store';

import componentFactory from './util/factory';
import exampleLayout from './schema/exampleLayout';

import { AutoForm } from '../../packages/redux-autoform-core/dist';

injectEventTapPlugin();

const handleSubmit = values => alert(JSON.stringify(values, null, 2));

export default class App extends Component {
    render() {
        return (
            <Provider store={store}>
                <MuiThemeProvider muiTheme={getMuiTheme(lightTheme)}>
                    <div style={{
                        display: 'flex',
                        flexDirection: 'column',
                        minHeight: '100vh',
                        alignItems: 'center',
                        justifyContent: 'center',
                        backgroundColor: '#E0E0E0'
                    }}>
                        <Card style={{ minWidth: 350 }}>
                            <CardTitle style={{
                              minWidth: 350,
                                textAlign: 'center'
                            }}>
                                Redux Autoform v6
                            </CardTitle>
                            <CardText>
                                <AutoForm
                                    form='autoform'
                                    buttonBar={ButtonBar}
                                    layout={exampleLayout}
                                    onSubmit={handleSubmit}
                                    componentFactory={componentFactory}
                                />
                            </CardText>
                        </Card>
                    </div>
                </MuiThemeProvider>
            </Provider>
        )
    }
}


text: A Flask extension for creating product catalogs.


text:
package lombok.eclipse;

import org.eclipse.jdt.core.compiler.CategorizedProblem;
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.jdt.internal.compiler.problem.DefaultProblem;
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
import org.eclipse.jdt.internal.compiler.util.Util;

public class EclipseAstProblemView {
	/**
	 * Adds a problem to the provided CompilationResult object so that it will show up
	 * in the Problems/Warnings view.
	 */
	public static void addProblemToCompilationResult(CompilationUnitDeclaration ast,
			boolean isWarning, String message, int sourceStart, int sourceEnd) {
		if (ast.compilationResult == null) return;
		char[] fileNameArray = ast.getFileName();
		if (fileNameArray == null) fileNameArray = "(unknown).java".toCharArray();
		int lineNumber = 0;
		int columnNumber = 1;
		CompilationResult result = ast.compilationResult;
		int[] lineEnds = null;
		lineNumber = sourceStart >= 0
				? Util.getLineNumber(sourceStart, lineEnds = result.getLineSeparatorPositions(), 0, lineEnds.length-1)
				: 0;
		columnNumber = sourceStart >= 0
				? Util.searchColumnNumber(result.getLineSeparatorPositions(), lineNumber,sourceStart)
				: 0;

		CategorizedProblem ecProblem = new LombokProblem(
				fileNameArray, message, 0, new String[0],
				isWarning ? ProblemSeverities.Warning : ProblemSeverities.Error,
				sourceStart, sourceEnd, lineNumber, columnNumber);
		ast.compilationResult.record(ecProblem, null);
	}

	private static class LombokProblem extends DefaultProblem {
		private static final String MARKER_ID = "org.eclipse.jdt.apt.pluggable.core.compileProblem";  //$NON-NLS-1$

		public LombokProblem(char[] originatingFileName, String message, int id,
				String[] stringArguments, int severity,
				int startPosition, int endPosition, int line, int column) {
			super(originatingFileName, message, id, stringArguments, severity, startPosition, endPosition, line, column);
		}

		@Override public int getCategoryID() {
			return CAT_UNSPECIFIED;
		}

		@Override public String getMarkerType() {
			return MARKER_ID;
		}
	}
}


text:
* [Syna](https://syna.okkur.org)
* [TXTDirect](https://txtdirect.org)
* [Resumic](https://resumic.org)


text:
package com.tyrfing.games.id17.buildings;

import java.util.ArrayList;
import java.util.List;

import com.tyrfing.games.id17.gui.holding.ProductionGUI;
import com.tyrfing.games.id17.gui.mails.HeaderedMail;
import com.tyrfing.games.id17.gui.mails.HoldingEntry;
import com.tyrfing.games.id17.holdings.Barony;
import com.tyrfing.games.id17.holdings.Holding;
import com.tyrfing.games.id17.trade.GoodProduction;
import com.tyrlib2.gui.Window;
import com.tyrlib2.gui.WindowManager;

public class GuildMail extends HeaderedMail {

	private Guild.TYPE selection;
	private Barony target;
	private Guild g;
	private Holding h;
	private List<Window> producedGoods = new ArrayList<Window>();

	public GuildMail(Guild g, Holding h) {
		super("Settle Guild", h.getOwner(), h.getOwner(), false);
		this.addRightColumnList("Guild");
		this.addLeftColumnList("");

		this.g = g;
		this.h = h;

		if (g.type == Guild.TYPE.Merchants) {
			target = h.getTradeNeighbour(0);
		}

		Guild.TYPE[] types =  Guild.TYPE.values();
		for (int i = 0; i < types.length; ++i) {
			Guild.TYPE type = types[i];
			GuildEntry entry = new GuildEntry(type, this);
			this.rightColumn.addItemListEntry(entry);
			entry.setReceiveTouchEvents(true);

			 if ((i == 0 && g.type == null) || (g.type  == type)) {
				 entry.highlight();
				 select(type);
			 }
		}

		this.addAcceptButton();
	}

	public void select(Guild.TYPE type) {

		for (int i = 0; i < producedGoods.size(); ++i) {
			WindowManager.getInstance().destroyWindow(producedGoods.get(i));
		}

		producedGoods.clear();

		 for (int i = 0; i < leftColumn.getCountEntries(); ++i) {
			 WindowManager.getInstance().destroyWindow(leftColumn.getEntry(i));
		 }

		 leftColumn.clear();

		if (type == Guild.TYPE.Merchants) {
			 this.titleLabelLeft.setText("Export goods to:");

			 List<Holding> holdings = h.getOwner().getHoldings();

			 for (int i = 0; i < holdings.size(); ++i) {
				 if (holdings.get(i) instanceof Barony && holdings.get(i) != h) {
					 HoldingEntry entry = new HoldingEntry(holdings.get(i), this) {
							@Override
							protected void onClick() {
								mail.unhighlightLeftColumn();
								highlight();
								target = (Barony) holding;
							}
					 };
					 leftColumn.addItemListEntry(entry);
					 entry.setReceiveTouchEvents(true);

					 if ((i == 0 && target == null) || target == holdings.get(i)) {
						 entry.highlight();
						 target = (Barony) holdings.get(i);
					 }
				 }
			 }

		} else {
			this.titleLabelLeft.setText("Production");
			GoodProduction p = GoodProduction.createProduction(Guild.DATA.get(type));
			ProductionGUI.createGoodProductionGUI(0, p, this.getName(), left, producedGoods, ProductionGUI.PROD_BASE_POS.get(), h);
		}

		selection = type;
	}

	@Override
	public void onAccept() {
		remove();
		g.setupGuild(selection, target, h);
	}

}


text:
import argparse
import os
import utils

class BaseOptions():
    def __init__(self):
        self.parser = argparse.ArgumentParser()
        self.initialized = False

    def initialize(self):
        self.parser.add_argument(
            '--dataroot', required=False, help='path to images (should have subfolders trainA, trainB, valA, valB, etc)')
        self.parser.add_argument(
            '--batchSize', type=int, default=1, help='input batch size')
        self.parser.add_argument(
            '--loadSize', type=int, default=286, help='scale images to this size')
        self.parser.add_argument(
            '--fineSize', type=int, default=256, help='then crop to this size')
        self.parser.add_argument(
            '--input_nc', type=int, default=3, help='# of input image channels')
        self.parser.add_argument(
            '--output_nc', type=int, default=3, help='# of output image channels')
        self.parser.add_argument(
            '--ngf', type=int, default=64, help='# of gen filters in first conv layer')
        self.parser.add_argument(
            '--ndf', type=int, default=64, help='# of discrim filters in first conv layer')
        self.parser.add_argument('--which_model_netD', type=str,
                                 default='basic', help='selects model to use for netD')
        self.parser.add_argument('--which_model_netG', type=str,
                                 default='resnet_9blocks', help='selects model to use for netG')
        self.parser.add_argument(
            '--n_layers_D', type=int, default=3, help='only used if which_model_netD==n_layers')
        self.parser.add_argument(
            '--gpu_ids', type=str, default='0', help='gpu ids: e.g. 0  0,1,2, 0,2')
        self.parser.add_argument('--name', type=str, default='rarepepes',
                                 help='name of the experiment. It decides where to store samples and models')
        self.parser.add_argument('--align_data', action='store_true',
                                 help='if True, the datasets are loaded from "test" and "train" directories and the data pairs are aligned')
        self.parser.add_argument(
            '--which_direction', type=str, default='AtoB', help='AtoB or BtoA')
        self.parser.add_argument(
            '--nThreads', default=2, type=int, help='# threads for loading data')
        self.parser.add_argument('--checkpoints_dir', type=str,
                                 default='./checkpoints', help='models are saved here')
        self.parser.add_argument('--norm', type=str, default='instance',
                                 help='instance normalization or batch normalization')
        self.parser.add_argument('--serial_batches', action='store_true',
                                 help='if true, takes images in order to make batches, otherwise takes them randomly')
        self.parser.add_argument(
            '--display_winsize', type=int, default=256, help='display window size')
        self.parser.add_argument(
            '--display_id', type=int, default=1, help='window id of the web display')
        self.parser.add_argument('--identity', type=float, default=0.0,
                                 help='use identity mapping. Setting identity other than 1 has an effect of scaling the weight of the identity mapping loss. For example, if the weight of the identity loss should be 10 times smaller than the weight of the reconstruction loss, please set optidentity = 0.1')
        self.parser.add_argument(
            '--use_dropout', action='store_true', help='use dropout for the generator')
        self.parser.add_argument('--max_dataset_size', type=int, default=float(
            "inf"), help='Maximum number of samples allowed per dataset. If the dataset directory contains more than max_dataset_size, only a subset is loaded.')

        self.initialized = True

    def parse(self):
        if not self.initialized:
            self.initialize()
        self.opt, _ = self.parser.parse_known_args()
        self.opt.isTrain = self.isTrain   # train or test

        str_ids = self.opt.gpu_ids.split(',')
        self.opt.gpu_ids = []
        for str_id in str_ids:
            id = int(str_id)
            if id >= 0:
                self.opt.gpu_ids.append(id)

        args = vars(self.opt)
        return self.opt

class TrainOptions(BaseOptions):
    def initialize(self):
        BaseOptions.initialize(self)
        self.parser.add_argument('--display_freq', type=int, default=100,
                                 help='frequency of showing training results on screen')
        self.parser.add_argument('--print_freq', type=int, default=100,
                                 help='frequency of showing training results on console')
        self.parser.add_argument('--save_latest_freq', type=int,
                                 default=5000, help='frequency of saving the latest results')
        self.parser.add_argument('--save_epoch_freq', type=int, default=5,
                                 help='frequency of saving checkpoints at the end of epochs')
        self.parser.add_argument('--continue_train', action='store_true',
                                 help='continue training: load the latest model')
        self.parser.add_argument(
            '--phase', type=str, default='train', help='train, val, test, etc')
        self.parser.add_argument('--which_epoch', type=str, default='latest',
                                 help='which epoch to load? set to latest to use latest cached model')
        self.parser.add_argument(
            '--niter', type=int, default=100, help='# of iter at starting learning rate')
        self.parser.add_argument('--niter_decay', type=int, default=100,
                                 help='# of iter to linearly decay learning rate to zero')
        self.parser.add_argument(
            '--beta1', type=float, default=0.5, help='momentum term of adam')
        self.parser.add_argument(
            '--lr', type=float, default=0.0002, help='initial learning rate for adam')
        self.parser.add_argument('--no_lsgan', action='store_true',
                                 help='do *not* use least square GAN, if false, use vanilla GAN')
        self.parser.add_argument(
            '--lambda_A', type=float, default=10.0, help='weight for cycle loss (A -> B -> A)')
        self.parser.add_argument(
            '--lambda_B', type=float, default=10.0, help='weight for cycle loss (B -> A -> B)')
        self.parser.add_argument('--pool_size', type=int, default=50,
                                 help='the size of image buffer that stores previously generated images')
        self.parser.add_argument('--no_html', action='store_true',
                                 help='do not save intermediate training results to [opt.checkpoints_dir]/[opt.name]/web/')
        self.parser.add_argument('--no_flip', action='store_true',
                                 help='if specified, do not flip the images for data argumentation')

        # NOT-IMPLEMENTED self.parser.add_argument('--preprocessing', type=str,
        # default='resize_and_crop', help='resizing/cropping strategy')
        self.isTrain = True

class TestOptions(BaseOptions):
    def initialize(self):
        BaseOptions.initialize(self)
        self.parser.add_argument(
            '--ntest', type=int, default=float("inf"), help='# of test examples.')
        self.parser.add_argument(
            '--results_dir', type=str, default='./results/', help='saves results here.')
        self.parser.add_argument(
            '--aspect_ratio', type=float, default=1.0, help='aspect ratio of result images')
        self.parser.add_argument(
            '--phase', type=str, default='test', help='train, val, test, etc')
        self.parser.add_argument('--which_epoch', type=str, default='latest',
                                 help='which epoch to load? set to latest to use latest cached model')
        self.parser.add_argument(
            '--how_many', type=int, default=3, help='how many test images to run')
        self.isTrain = False


text:
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="activity_padding">16dp</dimen>

    <!-- Inventory adapter padding and margins -->
    <dimen name="adapter_layout_bottom_margin">0.5dp</dimen>

    <!-- Inventory adapter shape info -->
    <dimen name="shape_pantry_item_stroke_width">1dp</dimen>
    <dimen name="shape_pantry_item_padding">20dp</dimen>
    <dimen name="shape_pantry_item_corner_radius">20dp</dimen>

    <dimen name="add_item_button_margin">16dp</dimen>

    <dimen name="margin_edit_item_pieces">10dp</dimen>

    <!-- Main Activity dimens -->
    <dimen name="undo_btn_height">45dp</dimen>
    <dimen name="footer_height">70dp</dimen>

    <!-- Edit location dimens -->
    <dimen name="edit_location_padding">10dp</dimen>
    <dimen name="edit_location_item_padding">20dp</dimen>
    <dimen name="edit_location_dialog_label_padding">25dp</dimen>
    <dimen name="edit_location_dialog_label_text_size">25sp</dimen>
    <dimen name="edit_location_dialog_input_padding">25dp</dimen>
    <dimen name="location_text_size">24sp</dimen>
    <dimen name="location_name_margin_left">5dp</dimen>

    <!--inventory item adapter-->
    <dimen name="adapter_margin">16dp</dimen>
    <dimen name="adapter_padding">8dp</dimen>
    <dimen name="icon_inner_margin">10dp</dimen>
    <dimen name="group_title_padding">10dp</dimen>
    <dimen name="item_recycler_divider_height">0.5dp</dimen>

    <dimen name="card_elevation">1px</dimen>
    <dimen name="card_margin">1px</dimen>

    <!-- Navigation drawer dimens -->
    <dimen name="navigation_item_padding">10dp</dimen>
    <dimen name="navigation_item_drawable_padding">5dp</dimen>
    <dimen name="navigation_drawer_width">240dp</dimen>
    <dimen name="navigation_drawer_divider_height">0dp</dimen>
    <dimen name="navigation_drawer_separator_height">1dp</dimen>
    <dimen name="navigation_drawer_separator_margin">5dp</dimen>
    <dimen name="navigation_drawer_bottom_items_padding">5dp</dimen>
    <dimen name="navigation_drawer_bottom_items_text_size">15sp</dimen>
    <dimen name="navigation_drawer_text_size">24sp</dimen>

    <!--App Sub Bar-->
    <dimen name="app_sub_bar_padding">5dp</dimen>
    <dimen name="app_sub_bar_filter_margin">50dp</dimen>
    <dimen name="app_sub_bar_elevation">5dp</dimen>

    <!--edit item-->
    <dimen name="edit_item_font_size">20sp</dimen>
    <dimen name="expiration_content_height">100dp</dimen>
    <dimen name="field_label_height">25dp</dimen>
    <dimen name="edit_field_margins">10dp</dimen>
    <dimen name="field_content_spinner_width">200dp</dimen>
    <dimen name="field_content_height">70dp</dimen>
    <dimen name="edit_divider_width">200dp</dimen>
    <dimen name="edit_divider_height">1dp</dimen>

    <!--About Page-->
    <dimen name="about_top_text_size">20sp</dimen>
    <dimen name="about_text_size">15sp</dimen>
    <dimen name="about_url_margin">5dp</dimen>
    <dimen name="about_view_button_height">28dp</dimen>
    <dimen name="about_view_button_width">100dp</dimen>

    <!--Quantity Widget-->
    <dimen name="quantity_button_height">40dp</dimen>
    <dimen name="quantity_label_margin_top">8dp</dimen>
    <dimen name="edit_item_barcode_width">60dp</dimen>
    <dimen name="edit_item_barcode_height">40dp</dimen>
    <dimen name="expiry_item_width">36dp</dimen>

    <!-- Empty View Widget dimens -->
    <dimen name="empty_view_widget_label_text_size">21sp</dimen>
    <dimen name="empty_view_widget_btn_margin">25dp</dimen>

    <!-- ActionBar dimens -->
    <dimen name="actionbar_splat_padding">2dp</dimen>
    <dimen name="actionbar_splat_size">16dp</dimen>
    <dimen name="actionbar_splat_text_size">8sp</dimen>
    <dimen name="actionbar_title_padding">10dp</dimen>

    <dimen name="spinner_horizontal_padding">10sp</dimen>
    <dimen name="spinner_vertical_padding">5sp</dimen>
    <dimen name="margin_name_text">15sp</dimen>
    <dimen name="quantity_widget_padding">10dp</dimen>

</resources>


text:
process.env.NODE_ENV = 'test';

//Require the dev-dependencies
let chai = require('chai');
let should = chai.should();

var ps = require('../../public/js/presentation-storage');

describe('presentation creation', () => {
    beforeEach((done) => {
        ps.clearPresentation();
        done();
    });

    it('should start with an empty presentation', (done) => {
        ps.size().should.equal(0);
        done();
    });

    it('should be able to change title and description', (done) => {
        let name = "presentation title";
        let desc = "my awsome description!";
        ps.setInfo(name, desc);

        ps.name().should.equal(name);
        ps.description().should.equal(desc);
        done();
    });

    it('should be able to add pages', (done) => {
        let page = 'this is supposed to be a page';
        let page2 = 'page number 2';
        ps.addSlide(page);
        ps.addSlide(page2);

        ps.size().should.equal(2);
        ps.getSlide(0).should.equal(page);
        ps.getSlide(1).should.equal(page2);

        done();
    });

    it('should be able to add audio to slides', (done) => {
        let page = 'this is supposed to be a page';
        ps.addSlide(page);

        let audio = {data: 'audio data...', duration: 34};
        ps.setSlideAudio(0, audio.data, audio.duration);

        ps.getSlideAudio(0).should.deep.equal(audio);
        done();
    });

    it('should be able to delete pages', (done) => {
        let page = 'this is supposed to be a page';
        let page2 = 'page number 2';
        ps.addSlide(page);
        ps.addSlide(page2);

        ps.deleteSlide(0);

        ps.size().should.equal(1);
        ps.getSlide(0).should.equal(page2);
        done();
    });

    it('should be able to change slides order', (done) => {
        let page = 'this is supposed to be a page';
        let page2 = 'page number 2';
        let page3 = 'just another page';
        let page4 = 'just one more and we are done for now';
        ps.addSlide(page);
        ps.addSlide(page2);
        ps.addSlide(page3);
        ps.addSlide(page4);

        // Send element on position 1 to 3
        ps.moveSlides(1, 3);

        ps.getSlide(0).should.equal(page);
        ps.getSlide(1).should.equal(page3);
        ps.getSlide(2).should.equal(page4);
        ps.getSlide(3).should.equal(page2);

        // dont change positions
        ps.moveSlides(0, 6);
        ps.getSlide(0).should.equal(page);
        ps.getSlide(1).should.equal(page3);
        ps.getSlide(2).should.equal(page4);
        ps.getSlide(3).should.equal(page2);

        // dont change positions
        ps.moveSlides(1, -1);
        ps.getSlide(0).should.equal(page);
        ps.getSlide(1).should.equal(page3);
        ps.getSlide(2).should.equal(page4);
        ps.getSlide(3).should.equal(page2);

        // send element 2 to first position
        ps.moveSlides(2, 0);
        ps.getSlide(0).should.equal(page4);
        ps.getSlide(1).should.equal(page);
        ps.getSlide(2).should.equal(page3);
        ps.getSlide(3).should.equal(page2);

        done();
    });

});


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="ID"
        android:id="@+id/textView2"
        android:layout_marginTop="27dp"
        android:layout_marginLeft="10dp"
        android:layout_marginStart="29dp"
        android:layout_below="@+id/textView6"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="PM2.5"
        android:id="@+id/textView"
        android:layout_marginTop="27dp"
        android:layout_below="@+id/textView2"
        android:layout_alignLeft="@+id/textView2"
        android:layout_alignStart="@+id/textView2" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="溫度"
        android:id="@+id/textView3"
        android:layout_marginTop="22dp"
        android:layout_below="@+id/textView"
        android:layout_alignLeft="@+id/textView"
        android:layout_alignStart="@+id/textView" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="濕度"
        android:id="@+id/textView4"
        android:layout_marginTop="25dp"
        android:layout_below="@+id/textView3"
        android:layout_alignLeft="@+id/textView3"
        android:layout_alignStart="@+id/textView3" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="時間"
        android:id="@+id/textView5"
        android:layout_marginTop="21dp"
        android:layout_below="@+id/textView4"
        android:layout_alignLeft="@+id/textView4"
        android:layout_alignStart="@+id/textView4" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Large Text"
        android:id="@+id/tvDevId"
        android:layout_alignTop="@+id/textView2"
        android:layout_toRightOf="@+id/textView"
        android:layout_toEndOf="@+id/textView"
        android:layout_marginLeft="40dp"
        android:layout_marginStart="62dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Large Text"
        android:id="@+id/tvPM25"
        android:layout_above="@+id/textView3"
        android:layout_alignLeft="@+id/tvDevId"
        android:layout_alignStart="@+id/tvDevId" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Large Text"
        android:id="@+id/tvTemp"
        android:layout_alignBottom="@+id/textView3"
        android:layout_alignLeft="@+id/tvPM25"
        android:layout_alignStart="@+id/tvPM25" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Large Text"
        android:id="@+id/tvHumi"
        android:layout_alignTop="@+id/textView4"
        android:layout_alignLeft="@+id/tvTemp"
        android:layout_alignStart="@+id/tvTemp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Large Text"
        android:id="@+id/tvDateTime"
        android:layout_alignTop="@+id/textView5"
        android:layout_alignLeft="@+id/tvHumi"
        android:layout_alignStart="@+id/tvHumi" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="過濾器"
        android:id="@+id/textView6"
        android:layout_marginTop="23dp"
        android:layout_alignParentTop="true"
        android:layout_alignRight="@+id/textView"
        android:layout_alignEnd="@+id/textView" />

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/etFilter"
        android:text="FT1_0"
        android:layout_above="@+id/textView2"
        android:layout_alignLeft="@+id/tvDevId"
        android:layout_alignStart="@+id/tvDevId"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="經緯度"
        android:layout_below="@+id/textView5"
        android:layout_alignLeft="@+id/textView5"
        android:layout_alignStart="@+id/textView5"
        android:layout_marginTop="23dp"
        android:id="@+id/textView8" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Large Text"
        android:id="@+id/tvLoc"
        android:layout_alignTop="@+id/textView8"
        android:layout_alignLeft="@+id/tvDateTime"
        android:layout_alignStart="@+id/tvDateTime" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="我位置"
        android:layout_marginTop="26dp"
        android:id="@+id/textView7"
        android:layout_below="@+id/textView8"
        android:layout_alignLeft="@+id/textView6"
        android:layout_alignStart="@+id/textView6" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Large Text"
        android:id="@+id/tvMyLoc"
        android:layout_alignTop="@+id/textView7"
        android:layout_alignLeft="@+id/tvLoc"
        android:layout_alignStart="@+id/tvLoc" />

</RelativeLayout>


text:
<?php

namespace HomePage\UbicacionBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;

class DefaultController extends Controller {

    /*
    public function controlUbicacionesAction(Request $request) {
        //Si la carga se hizo con post obtiene los valores
        if ($request->getMethod() == 'POST') {
            try {
                //Obtenemos los valores de la opción
                $opcion = $request->get('opcion');
                if ($opcion == 'buscar') {
                    $codigo = $request->get('codigo');
                    //Buscamos la información del codigo y lo retornamos a la vista
                    $em = $this->getDoctrine()->getManager();
                    $resultado = $em->getRepository("AppBundle:InventarioDiurno")->createQueryBuilder('o')
                            ->where('o.idActivo = :codigo')
                            ->setParameter('codigo', $codigo)
                            ->getQuery()
                            ->getArrayResult();
                    //Retornamos el resultado
                    return new JsonResponse($resultado);
                } else {
                    //En caso que la opcion fuera actualizar
                    //TODO
                    //codigo para separar codigo
                }//else
            } catch (Exception $ex) {
                //Mostramos el mensaje de error
                return new JsonResponse(array('mensaje' => 'Sucedió un error por favor vuelve a intentarlo'));
            }//catch
        }//if
        //Si la carga no se hizo por post recarga la página
        return $this->render('HomePageInventarioBundle:Default:visualizarModificarActivo.html.twig');
    }
*/
}


text:
=head1 LICENSE

Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

=head1 CONTACT

 Please email comments or questions to the public Ensembl
 developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

 Questions may also be sent to the Ensembl help desk at
 <http://www.ensembl.org/Help/Contact>.

=cut

package Bio::EnsEMBL::Variation::ExternalFeatureVariationAllele;

use strict;
use warnings;

use base qw(Bio::EnsEMBL::Variation::VariationFeatureOverlapAllele);

sub new_fast {
    my ($self, $hashref) = @_;

    # swap an external_feature_variation argument for a variation_feature_overlap one

    if ($hashref->{external_feature_variation}) {
        $hashref->{variation_feature_overlap} = delete $hashref->{external_feature_variation};
    }

    # and call the superclass

    return $self->SUPER::new_fast($hashref);
}

sub external_feature_variation {
    my $self = shift;
    return $self->variation_feature_overlap(@_);
}

sub external_feature {
    my $self = shift;
    return $self->external_feature_variation->external_feature;
}

1;


text:
function spiralStar
% spiral Star
% number of sides of polygon
% N = 3 triangle, N = 4 square, N = 5 penatgon, N = 6 hexagon
nSideMin = 3;
nSideMax = 6;
nPolyMin = 10;
nPolyMax = 100;

%get user input
N = getUserInput(['Enter a choice from ' num2str(nSideMin)...
    ' to ' num2str(nSideMax) ...
    '\n'] , nSideMin, nSideMax);

nPolygon = getUserInput(['Enter a choice from ' num2str(nPolyMin)...
    ' to ' num2str(nPolyMax) ...
    '\n'] , nPolyMin, nPolyMax);

theta=pi/100;
phi=pi/N;
colormap=makeColorMap(rand(1,3),[1 1 1],rand(1,3),nPolygon);

figure
drawSpiralStar1(N,theta,phi,nPolygon,colormap);
axis equal off

figure
drawSpiralStar2(N,theta,phi,nPolygon,colormap);
axis equal off
end

function [xx,yy]=trans2d(x,y,tx,ty,phi)
xx=x.*cos(phi)-y.*sin(phi)+tx;
yy=x.*sin(phi)+y.*cos(phi)+ty;
end

function drawSpiralStar1(N,theta,phi,nPolygon,colormap)
t=linspace(0,2*pi,N+1); %points for triangle
len=1;
[x,y]=pol2cart(t,1);
for n=1:nPolygon
    patch(len*x,len*y,'r','facecolor',colormap(n,:),'edgecolor',colormap(n,:));
    patch(len*x,-len*y,'r','facecolor',colormap(n,:),'edgecolor',colormap(n,:));
    len=len*cos(phi)/cos(phi-theta);
    [x,y]=trans2d(x,y,0,0,theta); %rotate by theta
end
end

function drawSpiralStar2(N,theta,phi,nPolygon,colormap)
t=linspace(0,2*pi,N+1); %points for triangle
len=1;
[x,y]=pol2cart(t,1);
for n=1:nPolygon
    patch(len*x,len*y,'r','facecolor',colormap(n,:),'edgecolor',colormap(n,:));
    patch(-len*x,-len*y,'r','facecolor',colormap(n,:),'edgecolor',colormap(n,:));
    len=len*cos(phi)/cos(phi-theta);
    [x,y]=trans2d(x,y,0,0,theta); %rotate by theta
end
end

function choice = getUserInput(promptStr, minNum, maxNum)
% return the user input and check the range of input
choice = input(promptStr);
if isempty(choice) || ~isnumeric(choice)
    error('enter a number');
elseif (choice < minNum) || (choice > maxNum)
    error(['enter a number between' num2str(minNum) ' to ' num2str(maxNum)]);
elseif isfloat(choice)
    %if choice is floating point value then truncate the fractional part
    choice = choice - mod(choice,1);
end
end


text:
#ifndef _FASTHASH_H
#define _FASTHASH_H

#include <stdint.h>
#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * fasthash32 - 32-bit implementation of fasthash
 * @buf:  data buffer
 * @len:  data size
 * @seed: the seed
 */
	uint32_t fasthash32(const void *buf, size_t len, uint32_t seed);

/**
 * fasthash64 - 64-bit implementation of fasthash
 * @buf:  data buffer
 * @len:  data size
 * @seed: the seed
 */
	uint64_t fasthash64(const void *buf, size_t len, uint64_t seed);

#ifdef __cplusplus
}
#endif

#endif


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1818f35af">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Eastern District of Michigan</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2012-01-17</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2007-01-04</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-mied-2_06-cv-15609</identifier>
<identifier type="local">P0b002ee1818f35af</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2012-01-17</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2012-01-18</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-mied-2_06-cv-15609</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mied-2_06-cv-15609</accessId>
 <courtType>District</courtType>
 <courtCode>mied</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Michigan</courtState>
 <courtSortOrder>2251</courtSortOrder>
 <caseNumber>2:06-cv-15609</caseNumber>
 <caseOffice>Detroit</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>442</natureSuitCode>
 <natureSuit>Civil Rights Employment</natureSuit>
 <party firstName="Melvin" fullName="Melvin Lemont Martin" lastName="Martin" middleName="Lemont" role="Plaintiff"></party>
 <party fullName="Michigan, State of" lastName="Michigan, State of" role="Defendant"></party>
</extension>
<titleInfo>
 <title>Martin v. State of Michigan</title>
 <partNumber>2:06-cv-15609</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-mied-2_06-cv-15609/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">2:06-cv-15609;06-15609</identifier>
<name type="corporate">
 <namePart>United States District Court Eastern District of Michigan</namePart>
 <namePart>6th Circuit</namePart>
 <namePart>Detroit</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Melvin Lemont Martin</displayForm>
 <namePart type="family">Martin</namePart>
 <namePart type="given">Melvin</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Michigan, State of</displayForm>
 <namePart type="family">Michigan, State of</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mied-2_06-cv-15609</accessId>
 <courtType>District</courtType>
 <courtCode>mied</courtCode>
 <courtCircuit>6th</courtCircuit>
 <courtState>Michigan</courtState>
 <courtSortOrder>2251</courtSortOrder>
 <caseNumber>2:06-cv-15609</caseNumber>
 <caseOffice>Detroit</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>442</natureSuitCode>
 <natureSuit>Civil Rights Employment</natureSuit>
 <party firstName="Melvin" fullName="Melvin Lemont Martin" lastName="Martin" middleName="Lemont" role="Plaintiff"></party>
 <party fullName="Michigan, State of" lastName="Michigan, State of" role="Defendant"></party>
 <state>Michigan</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-mied-2_06-cv-15609-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-mied-2_06-cv-15609/USCOURTS-mied-2_06-cv-15609-0/mods.xml">
 <titleInfo>
  <title>Martin v. State of Michigan</title>
  <subTitle>ORDER Requiring Plaintiff to File a More Detailed Complaint Within 20 Days. Signed by Honorable Avern Cohn. (JOwe, )</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2007-01-04</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-mied-2_06-cv-15609-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee181944e7c</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-mied-2_06-cv-15609/USCOURTS-mied-2_06-cv-15609-0</identifier>
 <identifier type="former granule identifier">mied-2_06-cv-15609_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-mied-2_06-cv-15609/USCOURTS-mied-2_06-cv-15609-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-mied-2_06-cv-15609/pdf/USCOURTS-mied-2_06-cv-15609-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:06-cv-15609; Martin v. State of Michigan; </searchTitle>
  <courtName>United States District Court Eastern District of Michigan</courtName>
  <state>Michigan</state>
  <accessId>USCOURTS-mied-2_06-cv-15609-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2007-01-04</dateIssued>
  <docketText>ORDER Requiring Plaintiff to File a More Detailed Complaint Within 20 Days. Signed by Honorable Avern Cohn. (JOwe, )</docketText>
</extension>
</relatedItem>
</mods>


text:
import React, { Component } from 'react';
import * as d3 from 'd3';

class TimeZonePicker extends Component {
	constructor(props) {
		super(props);
        this.onClick = this.onClick.bind(this);
	}

	render() {
		return

            {[0,1,2,3].map((i) => {
                return
 this.onClick(i)}>
                    {`Participant ${i+1}`}

            })}

	}

    onClick(i) {
        this.props.changePerson(i);
    }
}

export default TimeZonePicker;


text:
class CreateRtaOrgCredentials < ActiveRecord::Migration[5.2]
  def up
    create_table :rta_org_credentials do |t|
      t.references :organization
      t.string :rta_client_id
      t.string :rta_client_secret
      t.string :rta_tenant_id
      t.string :name
      t.timestamps
    end

    Organization.where.not(rta_client_id: nil, rta_client_secret: nil, rta_tenant_id: nil). each do |o|
      RtaOrgCredential.create(organization: o, rta_client_id: o.rta_client_id, rta_client_secret: o.rta_client_secret, rta_tenant_id: o.rta_tenant_id, name: o.short_name)
    end

    remove_column :organizations, :rta_client_id
    remove_column :organizations, :rta_client_secret
    remove_column :organizations, :rta_tenant_id
  end

  def down
    add_column :organizations, :rta_client_id, :string
    add_column :organizations, :rta_client_secret, :string
    add_column :organizations, :rta_tenant_id, :string

    RtaOrgCredential.each do |c|
      unless c.organization.rta_client_id
        c.organization.update(rta_client_id: c.rta_client_id, rta_client_secret: c.rta_client_secret, rta_tenant_id: c.rta_tenant_id)
      end
    end

    drop_table :rta_org_credentials
  end
end


text:
FROM jenkinsci/jnlp-slave
MAINTAINER Naveen <naveensrinivasan@yahoo.com>

USER root
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g gulp

ENV CLOUDSDK_CORE_DISABLE_PROMPTS 1
ENV PATH /opt/google-cloud-sdk/bin:$PATH

RUN curl https://sdk.cloud.google.com | bash && mv google-cloud-sdk /opt \
    && gcloud components install kubectl

RUN wget -O /usr/bin/docker --no-check-certificate https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
&& chmod a+x /usr/bin/docker

ENV HELM_VERSION v2.0.0

RUN curl -fsSL https://storage.googleapis.com/kubernetes-helm/helm-$HELM_VERSION-linux-amd64.tar.gz -o helm.tar.gz \
	&& tar -C /usr/local/ -xzf helm.tar.gz \
	&& cp /usr/local/linux-amd64/helm /usr/local/bin/

WORKDIR /usr/local
COPY ./sonar sonar
ENV PATH /usr/local/sonar/bin:$PATH
RUN apt-get install zip unzip curl -y
WORKDIR /usr/local
COPY ./wait-for-it.sh /usr/local/wait-for-it.sh


text:
<!DOCTYPE html>

    <title>wgertler | Tumbling Down the Rabbit Hole</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="William Gertler">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="/css/kube.css" />
    <link rel="stylesheet" href="/css/font-awesome.css" />
    <link rel="stylesheet" href="/css/custom.css" />
    <link rel="icon"       href="/img/favicon.png" />

					wgertler

				    wgertler

Home

About

Articles

Contact

All of Pythagoras's Friends

March, 2018

						A lot of the reason I read a particular textbook has to
                        do with its portability. I've got a lot of moving
                        around to do over the course of the day. If I want to
                        kill the commute time, reading has always been my
                        go-to. Reading on the bus is kinda nice, but if you've
                        got a text that's a little too large, it can be
                        prohibitive. Not to mention the fact that you've got
                        to carry it around all day. Fortunately, there are a
                        plentitude of texts that fit right in your pocket!
                         The one I picked off the shelf today is called
                        Introduction to Elliptic Curves and Modular
                        Forms, by a guy named Neal Koblitz. He's a
                        cryptographer at the university of Washington, and an
                        adjunct faculty member here at Waterloo.

						I don't actually know any number theory, though. So
                        this book has been an adventure. I've had to brush up
                        on some definitions, sit and ponder a few things. The
                        first problem I worked out today had to do with
                        primitive Pythagorean triples, which is a 3-tuple of
                        intergers $(X,Y,Z)$ such that $X^2+Y^2=Z^2$, with none
                        of the intergers sharing a common factor. We suppose
                        that $a>b$ without loss of generality, and say that
                        they're not both odd, and relatively prime. The
                        problem is to show that, given the relations

						$$ X=a^2-b^2,\, Y=2ab,\, Z= a^2+b^2$$

						form a triple so-described, and that all primitive
                        Pythagorean triples take this form. Showing that this
                        is formulation of $(X,Y,Z)$ is a triple is simple, all
                        that's needed is to recognize that these values
                        fulfill the Pythagorean theorem. Showing that they
                        form all primitive solutions is a little trickier.
                        Letting both $a$ and $b$ be even, we see that $Y$ and
                        $Z$ are no longer coprime. Similarly, if both $a$ and
                        $b$ are odd, all $(X,Y,Z)$ become even, and thus no
                        two of them are coprime. Thus, we need one of $(a,b)$
                        to be odd, and the other even.

						The reason we know all primitive triples are
                        found this way is the most interesting part. The
                        easiest way to see it is to draw a picture:

						Re-paramaterizing from
                        $$ X=a^2-b^2,\, Y=2ab,\, Z= a^2+b^2$$
                        to
                        $$u=\frac{X}{Z},\,v=\frac{Y}{Z}$$,
                        we see that following the Pythagorean theorem leads us
                        to know that $u^2+v^2=1$, naturally leading us to a
                        parametrization of the unit circle. Cycling through
                        the intergers for $a$ and $b$ gives us all possible
                        Pythagorean triples.


text:
cd FEZ.TAS.mm
xbuild
xbuild /p:Configuration='Debug - FNA'
cd ..


text:
<?php
namespace Kitsunet\FlowFastRoute;

use TYPO3\Flow\Package\Package as BasePackage;
use TYPO3\Flow\Annotations as Flow;

/**
 * Package base class of the Kitsunet\FlowFastRoute package.
 *
 * @Flow\Scope("singleton")
 */
class Package extends BasePackage {

	/**
	 * Invokes custom PHP code directly after the package manager has been initialized.
	 *
	 * @param \TYPO3\Flow\Core\Bootstrap $bootstrap The current bootstrap
	 * @return void
	 */
	public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap) {
		$bootstrap->registerRequestHandler(new Core\RequestHandler($bootstrap));
	}

}


text:
package com.alibaba.android.arouter.exception;

/**
 * 主流程的处理异常
 *
 * @author zhilong Contact me.
 * @version 1.0
 * @since 15/12/7 上午10:30
 */
public class HandlerException extends RuntimeException {
    public HandlerException(String detailMessage) {
        super(detailMessage);
    }
}


text:
declare namespace ಠ_ಠ.clutz.module$exports$fn_params_with_platform {
  function es6args (a : any , b : any ,  ...rest : any [] ) : void ;
}
declare module 'goog:fn_params_with_platform' {
  import fn_params_with_platform = ಠ_ಠ.clutz.module$exports$fn_params_with_platform;
  export = fn_params_with_platform;
}


text:
package com.google.cloud.storage.contrib.nio;

import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;

import com.google.cloud.ReadChannel;
import com.google.cloud.storage.Blob;
import com.google.cloud.storage.BlobId;
import com.google.cloud.storage.Storage;

import com.google.cloud.storage.StorageException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.ArgumentCaptor;

import javax.net.ssl.SSLHandshakeException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.NonWritableChannelException;

/**
 * Unit tests for {@link CloudStorageReadChannel}.
 */
@RunWith(JUnit4.class)
public class CloudStorageReadChannelTest {

  @Rule public final ExpectedException thrown = ExpectedException.none();

  private CloudStorageReadChannel chan;

  private final Storage gcsStorage = mock(Storage.class);
  private final BlobId file = BlobId.of("blob", "attack");
  private final Blob metadata = mock(Blob.class);
  private final ReadChannel gcsChannel = mock(ReadChannel.class);

  @Before
  public void before() throws IOException {
    when(metadata.getSize()).thenReturn(42L);
    when(metadata.getGeneration()).thenReturn(2L);
    when(gcsStorage.get(file, Storage.BlobGetOption.fields(Storage.BlobField.GENERATION, Storage.BlobField.SIZE))).thenReturn(metadata);
    when(gcsStorage.reader(file, Storage.BlobSourceOption.generationMatch(2L))).thenReturn(gcsChannel);
    when(gcsChannel.isOpen()).thenReturn(true);
    chan = CloudStorageReadChannel.create(gcsStorage, file, 0, 1);
    verify(gcsStorage).get(eq(file), eq(Storage.BlobGetOption.fields(Storage.BlobField.GENERATION, Storage.BlobField.SIZE)));
    verify(gcsStorage).reader(eq(file), eq(Storage.BlobSourceOption.generationMatch(2L)));
  }

  @Test
  public void testRead() throws IOException {
    ByteBuffer buffer = ByteBuffer.allocate(1);
    when(gcsChannel.read(eq(buffer))).thenReturn(1);
    assertThat(chan.position()).isEqualTo(0L);
    assertThat(chan.read(buffer)).isEqualTo(1);
    assertThat(chan.position()).isEqualTo(1L);
    verify(gcsChannel).read(any(ByteBuffer.class));
    verify(gcsChannel, times(3)).isOpen();
  }

  @Test
  public void testReadRetry() throws IOException {
    ByteBuffer buffer = ByteBuffer.allocate(1);
    when(gcsChannel.read(eq(buffer)))
        .thenThrow(new StorageException(new IOException("outer", new IOException("Connection closed prematurely: bytesRead = 33554432, Content-Length = 41943040"))))
        .thenReturn(1);
    assertThat(chan.position()).isEqualTo(0L);
    assertThat(chan.read(buffer)).isEqualTo(1);
    assertThat(chan.position()).isEqualTo(1L);
    verify(gcsChannel, times(2)).read(any(ByteBuffer.class));
  }

  @Test
  public void testReadRetrySSLHandshake() throws IOException {
    ByteBuffer buffer = ByteBuffer.allocate(1);
    when(gcsChannel.read(eq(buffer)))
        .thenThrow(new StorageException(new IOException("something", new IOException("thing", new SSLHandshakeException("connection closed due to throttling")))))
        .thenReturn(1);
    assertThat(chan.position()).isEqualTo(0L);
    assertThat(chan.read(buffer)).isEqualTo(1);
    assertThat(chan.position()).isEqualTo(1L);
    verify(gcsChannel, times(2)).read(any(ByteBuffer.class));
  }

  @Test
  public void testReadRetryEventuallyGivesUp() throws IOException {
    ByteBuffer buffer = ByteBuffer.allocate(1);
    when(gcsChannel.read(eq(buffer)))
        .thenThrow(new StorageException(new IOException("Connection closed prematurely: bytesRead = 33554432, Content-Length = 41943040")))
        .thenThrow(new StorageException(new IOException("Connection closed prematurely: bytesRead = 33554432, Content-Length = 41943040")))
        .thenReturn(1);
    assertThat(chan.position()).isEqualTo(0L);
    thrown.expect(StorageException.class);
    chan.read(buffer);
  }

  @Test
  public void testRead_whenClosed_throwsCce() throws IOException {
    when(gcsChannel.isOpen()).thenReturn(false);
    thrown.expect(ClosedChannelException.class);
    chan.read(ByteBuffer.allocate(1));
  }

  @Test
  public void testWrite_throwsNonWritableChannelException() throws IOException {
    thrown.expect(NonWritableChannelException.class);
    chan.write(ByteBuffer.allocate(1));
  }

  @Test
  public void testTruncate_throwsNonWritableChannelException() throws IOException {
    thrown.expect(NonWritableChannelException.class);
    chan.truncate(0);
  }

  @Test
  public void testIsOpen() throws IOException {
    when(gcsChannel.isOpen()).thenReturn(true).thenReturn(false);
    assertThat(chan.isOpen()).isTrue();
    chan.close();
    assertThat(chan.isOpen()).isFalse();
    verify(gcsChannel, times(2)).isOpen();
    verify(gcsChannel).close();
  }

  @Test
  public void testSize() throws IOException {
    assertThat(chan.size()).isEqualTo(42L);
    verify(gcsChannel).isOpen();
    verifyZeroInteractions(gcsChannel);
  }

  @Test
  public void testSize_whenClosed_throwsCce() throws IOException {
    when(gcsChannel.isOpen()).thenReturn(false);
    thrown.expect(ClosedChannelException.class);
    chan.size();
  }

  @Test
  public void testPosition_whenClosed_throwsCce() throws IOException {
    when(gcsChannel.isOpen()).thenReturn(false);
    thrown.expect(ClosedChannelException.class);
    chan.position();
  }

  @Test
  public void testSetPosition_whenClosed_throwsCce() throws IOException {
    when(gcsChannel.isOpen()).thenReturn(false);
    thrown.expect(ClosedChannelException.class);
    chan.position(0);
  }

  @Test
  public void testClose_calledMultipleTimes_doesntThrowAnError() throws IOException {
    chan.close();
    chan.close();
    chan.close();
  }

  @Test
  public void testSetPosition() throws IOException {
    assertThat(chan.position()).isEqualTo(0L);
    assertThat(chan.size()).isEqualTo(42L);
    chan.position(1L);
    assertThat(chan.position()).isEqualTo(1L);
    assertThat(chan.size()).isEqualTo(42L);
    verify(gcsChannel).seek(1);
    verify(gcsChannel, times(5)).isOpen();
  }

  /*
   * This test case was crafted in response to a bug in CloudStorageReadChannel in which the
   * channel position (a long) was getting truncated to an int when seeking on the encapsulated
   * ReadChannel in innerOpen(). This test case fails when the bad long -> int cast is present,
   * and passes when it's removed.
   */
  @Test
  public void testChannelPositionDoesNotGetTruncatedToInt() throws IOException {
    // This position value will overflow to a negative value if a long -> int cast is attempted
    long startPosition = 11918483280L;
    ArgumentCaptor<Long> captor = ArgumentCaptor.forClass(Long.class);

    // Invoke CloudStorageReadChannel.create() to trigger a call to the private
    // CloudStorageReadChannel.innerOpen() method, which does a seek on our gcsChannel.
    CloudStorageReadChannel.create(gcsStorage, file, startPosition, 1);

    // Confirm that our position did not overflow during the seek in CloudStorageReadChannel.innerOpen()
    verify(gcsChannel).seek(captor.capture());
    assertThat(captor.getValue()).isEqualTo(startPosition);
  }
}


text:
                                9th International dCache Workshop

                                Took place at Science Center, Amsterdam

  {{ content }}

                                The 6th dCache workshop

                                 Took place at DESY/Zeuthen close to Berlin, April 17-19, 2012 was a great success.

                                Category

                                Project Name

                                Category

                                Project Name


text:
// @require ../overlay.js
// @require widgets/targeter/closer/closer.js

(function ( $, _, Svelto, Widgets, Factory ) {

  /* CONFIG */

  let config = {
    name: 'overlayCloser',
    plugin: true,
    selector: '.overlay-closer',
    options: {
      widget: Widgets.Overlay
    }
  };

  /* OVERLAY CLOSER */

  class OverlayCloser extends Widgets.Closer {}

  /* FACTORY */

  Factory.make ( OverlayCloser, config );

}( Svelto.$, Svelto._, Svelto, Svelto.Widgets, Svelto.Factory ));