text
stringlengths
2
100k
meta
dict
// // Copyright 2015 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // #include "test_utils/ANGLETest.h" #include "test_utils/gl_raii.h" #include "util/EGLWindow.h" #include "util/gles_loader_autogen.h" #include "util/random_utils.h" using namespace angle; namespace { class TransformFeedbackTestBase : public ANGLETest { protected: TransformFeedbackTestBase() : mProgram(0), mTransformFeedbackBuffer(0), mTransformFeedback(0) { setWindowWidth(128); setWindowHeight(128); setConfigRedBits(8); setConfigGreenBits(8); setConfigBlueBits(8); setConfigAlphaBits(8); } void testSetUp() override { glGenBuffers(1, &mTransformFeedbackBuffer); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBufferSize, nullptr, GL_STATIC_DRAW); glGenTransformFeedbacks(1, &mTransformFeedback); ASSERT_GL_NO_ERROR(); } void testTearDown() override { if (mProgram != 0) { glDeleteProgram(mProgram); mProgram = 0; } if (mTransformFeedbackBuffer != 0) { glDeleteBuffers(1, &mTransformFeedbackBuffer); mTransformFeedbackBuffer = 0; } if (mTransformFeedback != 0) { glDeleteTransformFeedbacks(1, &mTransformFeedback); mTransformFeedback = 0; } } GLuint mProgram; static const size_t mTransformFeedbackBufferSize = 1 << 24; GLuint mTransformFeedbackBuffer; GLuint mTransformFeedback; }; class TransformFeedbackTest : public TransformFeedbackTestBase { protected: void compileDefaultProgram(const std::vector<std::string> &tfVaryings, GLenum bufferMode) { ASSERT_EQ(0u, mProgram); mProgram = CompileProgramWithTransformFeedback( essl1_shaders::vs::Simple(), essl1_shaders::fs::Red(), tfVaryings, bufferMode); ASSERT_NE(0u, mProgram); } void setupOverrunTest(const std::vector<GLfloat> &vertices); }; TEST_P(TransformFeedbackTest, ZeroSizedViewport) { // Set the program's transform feedback varyings (just gl_Position) std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); glUseProgram(mProgram); // Bind the buffer for transform feedback output and start transform feedback glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glBeginTransformFeedback(GL_TRIANGLES); // Create a query to check how many primitives were written GLuint primitivesWrittenQuery = 0; glGenQueries(1, &primitivesWrittenQuery); glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, primitivesWrittenQuery); // Set a viewport that would result in no pixels being written to the framebuffer and draw // a quad glViewport(0, 0, 0, 0); drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f); // End the query and transform feedback glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); glEndTransformFeedback(); glUseProgram(0); // Check how many primitives were written and verify that some were written even if // no pixels were rendered GLuint primitivesWritten = 0; glGetQueryObjectuiv(primitivesWrittenQuery, GL_QUERY_RESULT_EXT, &primitivesWritten); EXPECT_GL_NO_ERROR(); EXPECT_EQ(2u, primitivesWritten); } // Test that rebinding a buffer with the same offset resets the offset (no longer appending from the // old position) TEST_P(TransformFeedbackTest, BufferRebinding) { glDisable(GL_DEPTH_TEST); // Set the program's transform feedback varyings (just gl_Position) std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); glUseProgram(mProgram); // Make sure the buffer has zero'd data std::vector<float> data(mTransformFeedbackBufferSize / sizeof(float), 0.0f); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBufferSize, data.data(), GL_STATIC_DRAW); // Create a query to check how many primitives were written GLuint primitivesWrittenQuery = 0; glGenQueries(1, &primitivesWrittenQuery); glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, primitivesWrittenQuery); const float finalZ = 0.95f; RNG rng; const size_t loopCount = 64; for (size_t loopIdx = 0; loopIdx < loopCount; loopIdx++) { // Bind the buffer for transform feedback output and start transform feedback glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glBeginTransformFeedback(GL_TRIANGLES); float z = (loopIdx + 1 == loopCount) ? finalZ : rng.randomFloatBetween(0.1f, 0.5f); drawQuad(mProgram, essl1_shaders::PositionAttrib(), z); glEndTransformFeedback(); } // End the query and transform feedback glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); glUseProgram(0); // Check how many primitives were written and verify that some were written even if // no pixels were rendered GLuint primitivesWritten = 0; glGetQueryObjectuiv(primitivesWrittenQuery, GL_QUERY_RESULT_EXT, &primitivesWritten); EXPECT_GL_NO_ERROR(); EXPECT_EQ(loopCount * 2, primitivesWritten); // Check the buffer data const float *bufferData = static_cast<float *>(glMapBufferRange( GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBufferSize, GL_MAP_READ_BIT)); for (size_t vertexIdx = 0; vertexIdx < 6; vertexIdx++) { // Check the third (Z) component of each vertex written and make sure it has the final // value EXPECT_NEAR(finalZ, bufferData[vertexIdx * 4 + 2], 0.0001); } for (size_t dataIdx = 24; dataIdx < mTransformFeedbackBufferSize / sizeof(float); dataIdx++) { EXPECT_EQ(data[dataIdx], bufferData[dataIdx]) << "Buffer overrun detected."; } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); EXPECT_GL_NO_ERROR(); } // Test that XFB can write back vertices to a buffer and that we can draw from this buffer // afterward. TEST_P(TransformFeedbackTest, RecordAndDraw) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); // Set the program's transform feedback varyings (just gl_Position) std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); glUseProgram(mProgram); GLint positionLocation = glGetAttribLocation(mProgram, essl1_shaders::PositionAttrib()); // First pass: draw 6 points to the XFB buffer glEnable(GL_RASTERIZER_DISCARD); 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); // Bind the buffer for transform feedback output and start transform feedback glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glBeginTransformFeedback(GL_POINTS); // Create a query to check how many primitives were written GLuint primitivesWrittenQuery = 0; glGenQueries(1, &primitivesWrittenQuery); glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, primitivesWrittenQuery); glDrawArrays(GL_POINTS, 0, 6); glDisableVertexAttribArray(positionLocation); glVertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 0, nullptr); // End the query and transform feedback glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); glEndTransformFeedback(); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0); glDisable(GL_RASTERIZER_DISCARD); // Check how many primitives were written and verify that some were written even if // no pixels were rendered GLuint primitivesWritten = 0; glGetQueryObjectuiv(primitivesWrittenQuery, GL_QUERY_RESULT_EXT, &primitivesWritten); EXPECT_GL_NO_ERROR(); EXPECT_EQ(6u, primitivesWritten); // Nothing should have been drawn to the framebuffer EXPECT_PIXEL_EQ(getWindowWidth() / 2, getWindowHeight() / 2, 0, 0, 0, 0); // Second pass: draw from the feedback buffer glBindBuffer(GL_ARRAY_BUFFER, mTransformFeedbackBuffer); glVertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(positionLocation); glDrawArrays(GL_TRIANGLES, 0, 6); EXPECT_PIXEL_EQ(getWindowWidth() / 2, getWindowHeight() / 2, 255, 0, 0, 255); EXPECT_GL_NO_ERROR(); } // Test that XFB does not allow writing more vertices than fit in the bound buffers. // TODO(jmadill): Enable this test after fixing the last case where the buffer size changes after // calling glBeginTransformFeedback. TEST_P(TransformFeedbackTest, DISABLED_TooSmallBuffers) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_RASTERIZER_DISCARD); // Set the program's transform feedback varyings (just gl_Position) std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); GLint positionLocation = glGetAttribLocation(mProgram, essl1_shaders::PositionAttrib()); glUseProgram(mProgram); 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); const size_t verticesToDraw = 6; const size_t stride = sizeof(float) * 4; const size_t bytesNeeded = stride * verticesToDraw; glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); // Set up the buffer to be the right size uint8_t tfData[stride * verticesToDraw] = {0}; glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, bytesNeeded, &tfData, GL_STATIC_DRAW); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, verticesToDraw); EXPECT_GL_NO_ERROR(); glEndTransformFeedback(); // Set up the buffer to be too small glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, bytesNeeded - 1, &tfData, GL_STATIC_DRAW); glBeginTransformFeedback(GL_POINTS); EXPECT_GL_NO_ERROR(); glDrawArrays(GL_POINTS, 0, verticesToDraw); EXPECT_GL_ERROR(GL_INVALID_OPERATION); glEndTransformFeedback(); // Set up the buffer to be the right size but make it smaller after glBeginTransformFeedback glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, bytesNeeded, &tfData, GL_STATIC_DRAW); glBeginTransformFeedback(GL_POINTS); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, bytesNeeded - 1, &tfData, GL_STATIC_DRAW); EXPECT_GL_NO_ERROR(); glDrawArrays(GL_POINTS, 0, verticesToDraw); EXPECT_GL_ERROR(GL_INVALID_OPERATION); glEndTransformFeedback(); } // Test that buffer binding happens only on the current transform feedback object TEST_P(TransformFeedbackTest, BufferBinding) { // Reset any state glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0); // Generate a new buffer GLuint scratchBuffer = 0; glGenBuffers(1, &scratchBuffer); EXPECT_GL_NO_ERROR(); // Bind TF 0 and a buffer glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); EXPECT_GL_NO_ERROR(); // Check that the buffer ID matches the one that was just bound GLint currentBufferBinding = 0; glGetIntegerv(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, &currentBufferBinding); EXPECT_EQ(static_cast<GLuint>(currentBufferBinding), mTransformFeedbackBuffer); glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, 0, &currentBufferBinding); EXPECT_EQ(static_cast<GLuint>(currentBufferBinding), mTransformFeedbackBuffer); EXPECT_GL_NO_ERROR(); // Check that the buffer ID for the newly bound transform feedback is zero glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, 0, &currentBufferBinding); EXPECT_EQ(0, currentBufferBinding); // But the generic bind point is unaffected by glBindTransformFeedback. glGetIntegerv(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, &currentBufferBinding); EXPECT_EQ(static_cast<GLuint>(currentBufferBinding), mTransformFeedbackBuffer); EXPECT_GL_NO_ERROR(); // Bind a buffer to this TF glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, scratchBuffer, 0, 32); glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, 0, &currentBufferBinding); EXPECT_EQ(static_cast<GLuint>(currentBufferBinding), scratchBuffer); EXPECT_GL_NO_ERROR(); // Rebind the original TF and check it's bindings glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, 0, &currentBufferBinding); EXPECT_EQ(static_cast<GLuint>(currentBufferBinding), mTransformFeedbackBuffer); EXPECT_GL_NO_ERROR(); // Clean up glDeleteBuffers(1, &scratchBuffer); } // Test that we can capture varyings only used in the vertex shader. TEST_P(TransformFeedbackTest, VertexOnly) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); constexpr char kVS[] = "#version 300 es\n" "in vec2 position;\n" "in float attrib;\n" "out float varyingAttrib;\n" "void main() {\n" " gl_Position = vec4(position, 0, 1);\n" " varyingAttrib = attrib;\n" "}"; constexpr char kFS[] = "#version 300 es\n" "out mediump vec4 color;\n" "void main() {\n" " color = vec4(0.0, 1.0, 0.0, 1.0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("varyingAttrib"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glUseProgram(mProgram); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); std::vector<float> attribData; for (unsigned int cnt = 0; cnt < 100; ++cnt) { attribData.push_back(static_cast<float>(cnt)); } GLint attribLocation = glGetAttribLocation(mProgram, "attrib"); ASSERT_NE(-1, attribLocation); glVertexAttribPointer(attribLocation, 1, GL_FLOAT, GL_FALSE, 4, &attribData[0]); glEnableVertexAttribArray(attribLocation); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, "position", 0.5f); glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); glUseProgram(0); void *mappedBuffer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(float) * 6, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mappedBuffer); float *mappedFloats = static_cast<float *>(mappedBuffer); for (unsigned int cnt = 0; cnt < 6; ++cnt) { EXPECT_EQ(attribData[cnt], mappedFloats[cnt]); } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); EXPECT_GL_NO_ERROR(); } // Test that multiple paused transform feedbacks do not generate errors or crash TEST_P(TransformFeedbackTest, MultiplePaused) { const size_t drawSize = 1024; std::vector<float> transformFeedbackData(drawSize); for (size_t i = 0; i < drawSize; i++) { transformFeedbackData[i] = static_cast<float>(i + 1); } // Initialize the buffers to zero size_t bufferSize = drawSize; std::vector<float> bufferInitialData(bufferSize, 0); const size_t transformFeedbackCount = 8; constexpr char kVS[] = R"(#version 300 es in highp vec4 position; in float transformFeedbackInput; out float transformFeedbackOutput; void main(void) { gl_Position = position; transformFeedbackOutput = transformFeedbackInput; })"; constexpr char kFS[] = R"(#version 300 es out mediump vec4 color; void main(void) { color = vec4(1.0, 1.0, 1.0, 1.0); })"; std::vector<std::string> tfVaryings; tfVaryings.push_back("transformFeedbackOutput"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glUseProgram(mProgram); GLint positionLocation = glGetAttribLocation(mProgram, "position"); glDisableVertexAttribArray(positionLocation); glVertexAttrib4f(positionLocation, 0.0f, 0.0f, 0.0f, 1.0f); GLint tfInputLocation = glGetAttribLocation(mProgram, "transformFeedbackInput"); glEnableVertexAttribArray(tfInputLocation); glVertexAttribPointer(tfInputLocation, 1, GL_FLOAT, false, 0, &transformFeedbackData[0]); glDepthMask(GL_FALSE); glEnable(GL_DEPTH_TEST); ASSERT_GL_NO_ERROR(); GLuint transformFeedbacks[transformFeedbackCount]; glGenTransformFeedbacks(transformFeedbackCount, transformFeedbacks); GLuint buffers[transformFeedbackCount]; glGenBuffers(transformFeedbackCount, buffers); for (size_t i = 0; i < transformFeedbackCount; i++) { glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, transformFeedbacks[i]); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buffers[i]); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, bufferSize * sizeof(GLfloat), &bufferInitialData[0], GL_DYNAMIC_DRAW); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buffers[i]); ASSERT_GL_NO_ERROR(); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(drawSize)); glPauseTransformFeedback(); EXPECT_GL_NO_ERROR(); } for (size_t i = 0; i < transformFeedbackCount; i++) { glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, transformFeedbacks[i]); glEndTransformFeedback(); glDeleteTransformFeedbacks(1, &transformFeedbacks[i]); EXPECT_GL_NO_ERROR(); } } // Test that running multiple simultaneous queries and transform feedbacks from multiple EGL // contexts returns the correct results. Helps expose bugs in ANGLE's virtual contexts. TEST_P(TransformFeedbackTest, MultiContext) { // These tests are flaky, do not lift these unless you find the root cause and the fix. ANGLE_SKIP_TEST_IF(IsOSX() && IsOpenGL()); ANGLE_SKIP_TEST_IF(IsLinux() && IsAMD() && IsOpenGL()); // Flaky on Win Intel Vulkan. http://anglebug.com/4497 ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); EGLint contextAttributes[] = { EGL_CONTEXT_MAJOR_VERSION_KHR, GetParam().majorVersion, EGL_CONTEXT_MINOR_VERSION_KHR, GetParam().minorVersion, EGL_NONE, }; // Keep a fixed seed RNG so we are deterministic. RNG rng(0); EGLWindow *window = getEGLWindow(); EGLDisplay display = window->getDisplay(); EGLConfig config = window->getConfig(); EGLSurface surface = window->getSurface(); const size_t passCount = 5; struct ContextInfo { EGLContext context; GLuint program; GLuint query; GLuint buffer; size_t primitiveCounts[passCount]; }; static constexpr uint32_t kContextCount = 32; ContextInfo contexts[kContextCount]; const size_t maxDrawSize = 512; std::vector<float> transformFeedbackData(maxDrawSize); for (size_t i = 0; i < maxDrawSize; i++) { transformFeedbackData[i] = static_cast<float>(i + 1); } // Initialize the buffers to zero size_t bufferSize = maxDrawSize * passCount; std::vector<float> bufferInitialData(bufferSize, 0); constexpr char kVS[] = R"(#version 300 es in highp vec4 position; in float transformFeedbackInput; out float transformFeedbackOutput; void main(void) { gl_Position = position; transformFeedbackOutput = transformFeedbackInput; })"; constexpr char kFS[] = R"(#version 300 es out mediump vec4 color; void main(void) { color = vec4(1.0, 1.0, 1.0, 1.0); })"; for (ContextInfo &context : contexts) { context.context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttributes); ASSERT_NE(context.context, EGL_NO_CONTEXT); eglMakeCurrent(display, surface, surface, context.context); std::vector<std::string> tfVaryings; tfVaryings.push_back("transformFeedbackOutput"); context.program = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(context.program, 0u); glUseProgram(context.program); GLint positionLocation = glGetAttribLocation(context.program, "position"); glDisableVertexAttribArray(positionLocation); glVertexAttrib4f(positionLocation, 0.0f, 0.0f, 0.0f, 1.0f); GLint tfInputLocation = glGetAttribLocation(context.program, "transformFeedbackInput"); glEnableVertexAttribArray(tfInputLocation); glVertexAttribPointer(tfInputLocation, 1, GL_FLOAT, false, 0, &transformFeedbackData[0]); glDepthMask(GL_FALSE); glEnable(GL_DEPTH_TEST); glGenQueriesEXT(1, &context.query); glBeginQueryEXT(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, context.query); ASSERT_GL_NO_ERROR(); glGenBuffers(1, &context.buffer); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, context.buffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, bufferSize * sizeof(GLfloat), &bufferInitialData[0], GL_DYNAMIC_DRAW); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, context.buffer); ASSERT_GL_NO_ERROR(); // For each pass, draw between 0 and maxDrawSize primitives for (size_t &primCount : context.primitiveCounts) { primCount = rng.randomIntBetween(1, maxDrawSize); } glBeginTransformFeedback(GL_POINTS); } for (size_t pass = 0; pass < passCount; pass++) { for (const auto &context : contexts) { eglMakeCurrent(display, surface, surface, context.context); glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(context.primitiveCounts[pass])); } } for (const auto &context : contexts) { eglMakeCurrent(display, surface, surface, context.context); glEndTransformFeedback(); glEndQueryEXT(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); GLuint result = 0; glGetQueryObjectuivEXT(context.query, GL_QUERY_RESULT_EXT, &result); EXPECT_GL_NO_ERROR(); size_t totalPrimCount = 0; for (const auto &primCount : context.primitiveCounts) { totalPrimCount += primCount; } EXPECT_EQ(static_cast<GLuint>(totalPrimCount), result); const float *bufferData = reinterpret_cast<float *>(glMapBufferRange( GL_TRANSFORM_FEEDBACK_BUFFER, 0, bufferSize * sizeof(GLfloat), GL_MAP_READ_BIT)); size_t curBufferIndex = 0; unsigned int failures = 0; for (const auto &primCount : context.primitiveCounts) { for (size_t prim = 0; prim < primCount; prim++) { failures += (bufferData[curBufferIndex] != (prim + 1)) ? 1 : 0; curBufferIndex++; } } EXPECT_EQ(0u, failures); while (curBufferIndex < bufferSize) { EXPECT_EQ(bufferData[curBufferIndex], 0.0f); curBufferIndex++; } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); } eglMakeCurrent(display, surface, surface, window->getContext()); for (auto &context : contexts) { eglDestroyContext(display, context.context); context.context = EGL_NO_CONTEXT; } } // Test that when two vec2s are packed into the same register, we can still capture both of them. TEST_P(TransformFeedbackTest, PackingBug) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); // TODO(jmadill): With points and rasterizer discard? constexpr char kVS[] = "#version 300 es\n" "in vec2 inAttrib1;\n" "in vec2 inAttrib2;\n" "out vec2 outAttrib1;\n" "out vec2 outAttrib2;\n" "in vec2 position;\n" "void main() {" " outAttrib1 = inAttrib1;\n" " outAttrib2 = inAttrib2;\n" " gl_Position = vec4(position, 0, 1);\n" "}"; constexpr char kFS[] = "#version 300 es\n" "precision mediump float;\n" "out vec4 color;\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("outAttrib1"); tfVaryings.push_back("outAttrib2"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(Vector2) * 2 * 6, nullptr, GL_STREAM_DRAW); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); GLint attrib1Loc = glGetAttribLocation(mProgram, "inAttrib1"); GLint attrib2Loc = glGetAttribLocation(mProgram, "inAttrib2"); std::vector<Vector2> attrib1Data; std::vector<Vector2> attrib2Data; int counter = 0; for (size_t i = 0; i < 6; i++) { attrib1Data.push_back(Vector2(counter + 0.0f, counter + 1.0f)); attrib2Data.push_back(Vector2(counter + 2.0f, counter + 3.0f)); counter += 4; } glEnableVertexAttribArray(attrib1Loc); glEnableVertexAttribArray(attrib2Loc); glVertexAttribPointer(attrib1Loc, 2, GL_FLOAT, GL_FALSE, 0, attrib1Data.data()); glVertexAttribPointer(attrib2Loc, 2, GL_FLOAT, GL_FALSE, 0, attrib2Data.data()); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, "position", 0.5f); glEndTransformFeedback(); glUseProgram(0); ASSERT_GL_NO_ERROR(); const void *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector2) * 2 * 6, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const Vector2 *vecPointer = static_cast<const Vector2 *>(mapPointer); for (unsigned int vectorIndex = 0; vectorIndex < 3; ++vectorIndex) { unsigned int stream1Index = vectorIndex * 2; unsigned int stream2Index = vectorIndex * 2 + 1; EXPECT_EQ(attrib1Data[vectorIndex], vecPointer[stream1Index]); EXPECT_EQ(attrib2Data[vectorIndex], vecPointer[stream2Index]); } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test that transform feedback varyings that can be optimized out yet do not cause program // compilation to fail TEST_P(TransformFeedbackTest, OptimizedVaryings) { constexpr char kVS[] = "#version 300 es\n" "in vec4 a_vertex;\n" "in vec3 a_normal; \n" "\n" "uniform Transform\n" "{\n" " mat4 u_modelViewMatrix;\n" " mat4 u_projectionMatrix;\n" " mat3 u_normalMatrix;\n" "};\n" "\n" "out vec3 normal;\n" "out vec4 ecPosition;\n" "\n" "void main()\n" "{\n" " normal = normalize(u_normalMatrix * a_normal);\n" " ecPosition = u_modelViewMatrix * a_vertex;\n" " gl_Position = u_projectionMatrix * ecPosition;\n" "}\n"; constexpr char kFS[] = "#version 300 es\n" "precision mediump float;\n" "\n" "in vec3 normal;\n" "in vec4 ecPosition;\n" "\n" "out vec4 fragColor;\n" "\n" "void main()\n" "{\n" " fragColor = vec4(normal/2.0+vec3(0.5), 1);\n" "}\n"; std::vector<std::string> tfVaryings; tfVaryings.push_back("normal"); tfVaryings.push_back("ecPosition"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); } // Test an edge case where two varyings are unreferenced in the frag shader. TEST_P(TransformFeedbackTest, TwoUnreferencedInFragShader) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); // TODO(jmadill): With points and rasterizer discard? constexpr char kVS[] = "#version 300 es\n" "in vec3 position;\n" "out vec3 outAttrib1;\n" "out vec3 outAttrib2;\n" "void main() {" " outAttrib1 = position;\n" " outAttrib2 = position;\n" " gl_Position = vec4(position, 1);\n" "}"; constexpr char kFS[] = "#version 300 es\n" "precision mediump float;\n" "out vec4 color;\n" "in vec3 outAttrib1;\n" "in vec3 outAttrib2;\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("outAttrib1"); tfVaryings.push_back("outAttrib2"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(Vector3) * 2 * 6, nullptr, GL_STREAM_DRAW); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, "position", 0.5f); glEndTransformFeedback(); glUseProgram(0); ASSERT_GL_NO_ERROR(); const void *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector3) * 2 * 6, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const auto &quadVertices = GetQuadVertices(); const Vector3 *vecPointer = static_cast<const Vector3 *>(mapPointer); for (unsigned int vectorIndex = 0; vectorIndex < 3; ++vectorIndex) { unsigned int stream1Index = vectorIndex * 2; unsigned int stream2Index = vectorIndex * 2 + 1; EXPECT_EQ(quadVertices[vectorIndex], vecPointer[stream1Index]); EXPECT_EQ(quadVertices[vectorIndex], vecPointer[stream2Index]); } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test that the transform feedback write offset is reset to the buffer's offset when // glBeginTransformFeedback is called TEST_P(TransformFeedbackTest, OffsetResetOnBeginTransformFeedback) { ANGLE_SKIP_TEST_IF(IsOSX() && IsAMD()); ANGLE_SKIP_TEST_IF((IsNexus5X() || IsNexus6P()) && IsOpenGLES()); // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); constexpr char kVS[] = "#version 300 es\n" "in vec4 position;\n" "out vec4 outAttrib;\n" "void main() {" " outAttrib = position;\n" " gl_Position = vec4(0);\n" "}"; constexpr char kFS[] = "#version 300 es\n" "precision mediump float;\n" "out vec4 color;\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("outAttrib"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); GLint positionLocation = glGetAttribLocation(mProgram, "position"); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(Vector4) * 2, nullptr, GL_STREAM_DRAW); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); Vector4 drawVertex0(4, 3, 2, 1); Vector4 drawVertex1(8, 7, 6, 5); Vector4 drawVertex2(12, 11, 10, 9); glEnableVertexAttribArray(positionLocation); glBeginTransformFeedback(GL_POINTS); // Write vertex 0 at offset 0 glVertexAttribPointer(positionLocation, 4, GL_FLOAT, false, 0, &drawVertex0); glDrawArrays(GL_POINTS, 0, 1); // Append vertex 1 glVertexAttribPointer(positionLocation, 4, GL_FLOAT, false, 0, &drawVertex1); glDrawArrays(GL_POINTS, 0, 1); glEndTransformFeedback(); glBeginTransformFeedback(GL_POINTS); // Write vertex 2 at offset 0 glVertexAttribPointer(positionLocation, 4, GL_FLOAT, false, 0, &drawVertex2); glDrawArrays(GL_POINTS, 0, 1); glEndTransformFeedback(); const void *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector4) * 2, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const Vector4 *vecPointer = static_cast<const Vector4 *>(mapPointer); ASSERT_EQ(drawVertex2, vecPointer[0]); ASSERT_EQ(drawVertex1, vecPointer[1]); glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test that the captured buffer can be copied to other buffers. TEST_P(TransformFeedbackTest, CaptureAndCopy) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); // Set the program's transform feedback varyings (just gl_Position) std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); glUseProgram(mProgram); GLint positionLocation = glGetAttribLocation(mProgram, essl1_shaders::PositionAttrib()); glEnable(GL_RASTERIZER_DISCARD); 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); // Bind the buffer for transform feedback output and start transform feedback glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, 6); glDisableVertexAttribArray(positionLocation); glVertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 0, nullptr); glEndTransformFeedback(); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0); glDisable(GL_RASTERIZER_DISCARD); // Allocate a buffer with one byte uint8_t singleByte[] = {0xaa}; // Create a new buffer and copy the first byte of captured data to it GLBuffer copyBuffer; glBindBuffer(GL_COPY_WRITE_BUFFER, copyBuffer); glBufferData(GL_COPY_WRITE_BUFFER, 1, singleByte, GL_DYNAMIC_DRAW); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glCopyBufferSubData(GL_TRANSFORM_FEEDBACK_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 1); EXPECT_GL_NO_ERROR(); } class TransformFeedbackLifetimeTest : public TransformFeedbackTest { protected: TransformFeedbackLifetimeTest() : mVertexArray(0) {} void testSetUp() override { glGenVertexArrays(1, &mVertexArray); glBindVertexArray(mVertexArray); std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_SEPARATE_ATTRIBS); glGenBuffers(1, &mTransformFeedbackBuffer); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBufferSize, nullptr, GL_DYNAMIC_DRAW); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, 0); glGenTransformFeedbacks(1, &mTransformFeedback); ASSERT_GL_NO_ERROR(); } void testTearDown() override { glDeleteVertexArrays(1, &mVertexArray); TransformFeedbackTest::testTearDown(); } GLuint mVertexArray; }; // Tests a bug with state syncing and deleted transform feedback buffers. TEST_P(TransformFeedbackLifetimeTest, DeletedBuffer) { // First stream vertex data to mTransformFeedbackBuffer. glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, true); glEndTransformFeedback(); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); // TODO(jmadill): Remove this when http://anglebug.com/1351 is fixed. glBindVertexArray(0); drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f); glBindVertexArray(1); // Next, draw vertices with mTransformFeedbackBuffer. This will link to mVertexArray. glBindBuffer(GL_ARRAY_BUFFER, mTransformFeedbackBuffer); GLint loc = glGetAttribLocation(mProgram, essl1_shaders::PositionAttrib()); ASSERT_NE(-1, loc); glVertexAttribPointer(loc, 1, GL_FLOAT, GL_FALSE, 4, nullptr); glEnableVertexAttribArray(loc); glBindBuffer(GL_ARRAY_BUFFER, 0); glDrawArrays(GL_TRIANGLES, 0, 3); // Delete resources, making a stranded pointer to mVertexArray in mTransformFeedbackBuffer. glDeleteBuffers(1, &mTransformFeedbackBuffer); mTransformFeedbackBuffer = 0; glDeleteVertexArrays(1, &mVertexArray); mVertexArray = 0; // Then draw again with transform feedback, dereferencing the stranded pointer. glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, true); glEndTransformFeedback(); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); ASSERT_GL_NO_ERROR(); } class TransformFeedbackTestES31 : public TransformFeedbackTestBase {}; // Test that program link fails in case that transform feedback names including same array element. TEST_P(TransformFeedbackTestES31, SameArrayElementVaryings) { constexpr char kVS[] = "#version 310 es\n" "in vec3 position;\n" "out vec3 outAttribs[3];\n" "void main() {" " outAttribs[0] = position;\n" " outAttribs[1] = vec3(0, 0, 0);\n" " outAttribs[2] = position;\n" " gl_Position = vec4(position, 1);\n" "}"; constexpr char kFS[] = "#version 310 es\n" "precision mediump float;\n" "out vec4 color;\n" "in vec3 outAttribs[3];\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("outAttribs"); tfVaryings.push_back("outAttribs[1]"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_EQ(0u, mProgram); } // Test that program link fails in case to capture array element on a non-array varying. TEST_P(TransformFeedbackTestES31, ElementCaptureOnNonArrayVarying) { constexpr char kVS[] = "#version 310 es\n" "in vec3 position;\n" "out vec3 outAttrib;\n" "void main() {" " outAttrib = position;\n" " gl_Position = vec4(position, 1);\n" "}"; constexpr char kFS[] = "#version 310 es\n" "precision mediump float;\n" "out vec4 color;\n" "in vec3 outAttrib;\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("outAttrib[1]"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_EQ(0u, mProgram); } // Test that program link fails in case to capure an outbound array element. TEST_P(TransformFeedbackTestES31, CaptureOutboundElement) { constexpr char kVS[] = "#version 310 es\n" "in vec3 position;\n" "out vec3 outAttribs[3];\n" "void main() {" " outAttribs[0] = position;\n" " outAttribs[1] = vec3(0, 0, 0);\n" " outAttribs[2] = position;\n" " gl_Position = vec4(position, 1);\n" "}"; constexpr char kFS[] = "#version 310 es\n" "precision mediump float;\n" "out vec4 color;\n" "in vec3 outAttribs[3];\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("outAttribs[3]"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_EQ(0u, mProgram); } // Test transform feedback names can be specified using array element. TEST_P(TransformFeedbackTestES31, DifferentArrayElementVaryings) { // Remove this when http://anglebug.com/4140 is fixed. ANGLE_SKIP_TEST_IF(IsVulkan()); constexpr char kVS[] = "#version 310 es\n" "in vec3 position;\n" "out vec3 outAttribs[3];\n" "void main() {" " outAttribs[0] = position;\n" " outAttribs[1] = vec3(0, 0, 0);\n" " outAttribs[2] = position;\n" " gl_Position = vec4(position, 1);\n" "}"; constexpr char kFS[] = "#version 310 es\n" "precision mediump float;\n" "out vec4 color;\n" "in vec3 outAttribs[3];\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("outAttribs[0]"); tfVaryings.push_back("outAttribs[2]"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(Vector3) * 2 * 6, nullptr, GL_STREAM_DRAW); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, "position", 0.5f); glEndTransformFeedback(); glUseProgram(0); ASSERT_GL_NO_ERROR(); const GLvoid *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector3) * 2 * 6, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const auto &quadVertices = GetQuadVertices(); const Vector3 *vecPointer = static_cast<const Vector3 *>(mapPointer); for (unsigned int vectorIndex = 0; vectorIndex < 3; ++vectorIndex) { unsigned int stream1Index = vectorIndex * 2; unsigned int stream2Index = vectorIndex * 2 + 1; EXPECT_EQ(quadVertices[vectorIndex], vecPointer[stream1Index]); EXPECT_EQ(quadVertices[vectorIndex], vecPointer[stream2Index]); } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test transform feedback varying for base-level members of struct. TEST_P(TransformFeedbackTestES31, StructMemberVaryings) { // Remove this when http://anglebug.com/4140 is fixed. ANGLE_SKIP_TEST_IF(IsVulkan()); constexpr char kVS[] = R"(#version 310 es in vec3 position; struct S { vec3 field0; vec3 field1; vec3 field2; }; out S s; void main() { s.field0 = position; s.field1 = vec3(0, 0, 0); s.field2 = position; gl_Position = vec4(position, 1); })"; constexpr char kFS[] = R"(#version 310 es precision mediump float; struct S { vec3 field0; vec3 field1; vec3 field2; }; out vec4 color; in S s; void main() { color = vec4(s.field1, 1); })"; std::vector<std::string> tfVaryings; tfVaryings.push_back("s.field0"); tfVaryings.push_back("s.field2"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(Vector3) * 2 * 6, nullptr, GL_STREAM_DRAW); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, "position", 0.5f); glEndTransformFeedback(); glUseProgram(0); ASSERT_GL_NO_ERROR(); const GLvoid *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector3) * 2 * 6, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const auto &quadVertices = GetQuadVertices(); const Vector3 *vecPointer = static_cast<const Vector3 *>(mapPointer); for (unsigned int vectorIndex = 0; vectorIndex < 3; ++vectorIndex) { unsigned int stream1Index = vectorIndex * 2; unsigned int stream2Index = vectorIndex * 2 + 1; EXPECT_EQ(quadVertices[vectorIndex], vecPointer[stream1Index]); EXPECT_EQ(quadVertices[vectorIndex], vecPointer[stream2Index]); } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test transform feedback varying for struct is not allowed. TEST_P(TransformFeedbackTestES31, InvalidStructVaryings) { constexpr char kVS[] = R"(#version 310 es in vec3 position; struct S { vec3 field0; vec3 field1; }; out S s; void main() { s.field0 = position; s.field1 = vec3(0, 0, 0); gl_Position = vec4(position, 1); })"; constexpr char kFS[] = R"(#version 310 es precision mediump float; struct S { vec3 field0; vec3 field1; }; out vec4 color; in S s; void main() { color = vec4(s.field1, 1); })"; std::vector<std::string> tfVaryings; tfVaryings.push_back("s"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_EQ(0u, mProgram); } // Test transform feedback can capture the whole array TEST_P(TransformFeedbackTestES31, CaptureArray) { constexpr char kVS[] = R"(#version 310 es in vec4 a_position; in float a_varA; in float a_varB1; in float a_varB2; out float v_varA[1]; out float v_varB[2]; void main() { gl_Position = a_position; gl_PointSize = 1.0; v_varA[0] = a_varA; v_varB[0] = a_varB1; v_varB[1] = a_varB2; })"; constexpr char kFS[] = R"(#version 310 es precision mediump float; in float v_varA[1]; in float v_varB[2]; out vec4 fragColor; void main() { vec4 res = vec4(0.0); res += vec4(v_varA[0]); res += vec4(v_varB[0]); res += vec4(v_varB[1]); fragColor = res; })"; std::vector<std::string> tfVaryings; tfVaryings.push_back("v_varA"); tfVaryings.push_back("v_varB"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(float) * 3 * 6, nullptr, GL_STREAM_DRAW); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); GLint varA = glGetAttribLocation(mProgram, "a_varA"); ASSERT_NE(-1, varA); GLint varB1 = glGetAttribLocation(mProgram, "a_varB1"); ASSERT_NE(-1, varB1); GLint varB2 = glGetAttribLocation(mProgram, "a_varB2"); ASSERT_NE(-1, varB2); std::array<float, 6> data1 = {24.0f, 25.0f, 30.0f, 33.0f, 37.5f, 44.0f}; std::array<float, 6> data2 = {48.0f, 5.0f, 55.0f, 3.1415f, 87.0f, 42.0f}; std::array<float, 6> data3 = {128.0f, 1.0f, 0.0f, -1.0f, 16.0f, 1024.0f}; glVertexAttribPointer(varA, 1, GL_FLOAT, GL_FALSE, 0, data1.data()); glEnableVertexAttribArray(varA); glVertexAttribPointer(varB1, 1, GL_FLOAT, GL_FALSE, 0, data2.data()); glEnableVertexAttribArray(varB1); glVertexAttribPointer(varB2, 1, GL_FLOAT, GL_FALSE, 0, data3.data()); glEnableVertexAttribArray(varB2); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, "a_position", 0.5f); glEndTransformFeedback(); glUseProgram(0); ASSERT_GL_NO_ERROR(); void *mappedBuffer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(float) * 3 * 6, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mappedBuffer); float *mappedFloats = static_cast<float *>(mappedBuffer); for (int i = 0; i < 6; i++) { std::array<float, 3> mappedData = {mappedFloats[i * 3], mappedFloats[i * 3 + 1], mappedFloats[i * 3 + 2]}; std::array<float, 3> data = {data1[i], data2[i], data3[i]}; EXPECT_EQ(data, mappedData) << "iteration #" << i; } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test that nonexistent transform feedback varyings don't assert when linking. TEST_P(TransformFeedbackTest, NonExistentTransformFeedbackVarying) { std::vector<std::string> tfVaryings; tfVaryings.push_back("bogus"); mProgram = CompileProgramWithTransformFeedback( essl3_shaders::vs::Simple(), essl3_shaders::fs::Red(), tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_EQ(0u, mProgram); } // Test that nonexistent transform feedback varyings don't assert when linking. In this test the // nonexistent varying is prefixed with "gl_". TEST_P(TransformFeedbackTest, NonExistentTransformFeedbackVaryingWithGLPrefix) { std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Bogus"); mProgram = CompileProgramWithTransformFeedback( essl3_shaders::vs::Simple(), essl3_shaders::fs::Red(), tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_EQ(0u, mProgram); } // Test transform feedback names can be reserved names in GLSL, as long as they're not reserved in // GLSL ES. TEST_P(TransformFeedbackTest, VaryingReservedOpenGLName) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); constexpr char kVS[] = "#version 300 es\n" "in vec3 position;\n" "out vec3 buffer;\n" "void main() {\n" " buffer = position;\n" " gl_Position = vec4(position, 1);\n" "}"; constexpr char kFS[] = "#version 300 es\n" "precision highp float;\n" "out vec4 color;\n" "in vec3 buffer;\n" "void main() {\n" " color = vec4(0);\n" "}"; std::vector<std::string> tfVaryings; tfVaryings.push_back("buffer"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_INTERLEAVED_ATTRIBS); ASSERT_NE(0u, mProgram); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(Vector3) * 6, nullptr, GL_STREAM_DRAW); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); drawQuad(mProgram, "position", 0.5f); glEndTransformFeedback(); glUseProgram(0); ASSERT_GL_NO_ERROR(); const GLvoid *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector3) * 6, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const auto &quadVertices = GetQuadVertices(); const Vector3 *vecPointer = static_cast<const Vector3 *>(mapPointer); for (unsigned int vectorIndex = 0; vectorIndex < 3; ++vectorIndex) { EXPECT_EQ(quadVertices[vectorIndex], vecPointer[vectorIndex]); } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test that calling BeginTransformFeedback when no program is currentwill generate an // INVALID_OPERATION error. TEST_P(TransformFeedbackTest, NoCurrentProgram) { glUseProgram(0); glBeginTransformFeedback(GL_TRIANGLES); // GLES 3.0.5 section 2.15.2: "The error INVALID_OPERATION is also generated by // BeginTransformFeedback if no binding points would be used, either because no program object // is active or because the active program object has specified no output variables to record." EXPECT_GL_ERROR(GL_INVALID_OPERATION); } // Test that calling BeginTransformFeedback when no transform feedback varyings are in use will // generate an INVALID_OPERATION error. TEST_P(TransformFeedbackTest, NoTransformFeedbackVaryingsInUse) { ANGLE_GL_PROGRAM(program, essl3_shaders::vs::Simple(), essl3_shaders::fs::Red()); glUseProgram(program); glBeginTransformFeedback(GL_TRIANGLES); // GLES 3.0.5 section 2.15.2: "The error INVALID_OPERATION is also generated by // BeginTransformFeedback if no binding points would be used, either because no program object // is active or because the active program object has specified no output variables to record." EXPECT_GL_ERROR(GL_INVALID_OPERATION); } // Test that you can pause transform feedback without drawing first. TEST_P(TransformFeedbackTest, SwitchProgramBeforeDraw) { std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); ANGLE_GL_PROGRAM(nonTFProgram, essl3_shaders::vs::Simple(), essl3_shaders::fs::Red()); // Set up transform feedback, but pause it. glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); glPauseTransformFeedback(); // Switch programs and draw while transform feedback is paused. glUseProgram(nonTFProgram); GLint positionLocation = glGetAttribLocation(nonTFProgram, essl1_shaders::PositionAttrib()); glDisableVertexAttribArray(positionLocation); glVertexAttrib4f(positionLocation, 0.0f, 0.0f, 0.0f, 1.0f); glDrawArrays(GL_TRIANGLES, 0, 3); glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); } // Test that ending transform feedback with a different program bound does not cause internal // errors. TEST_P(TransformFeedbackTest, EndWithDifferentProgram) { // AMD drivers fail because they perform transform feedback when it should be paused. ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL()); std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); ANGLE_GL_PROGRAM(nonTFProgram, essl3_shaders::vs::Simple(), essl3_shaders::fs::Red()); // Set up transform feedback, but pause it. glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); // Make sure the buffer has zero'd data std::vector<float> data(mTransformFeedbackBufferSize / sizeof(float), 0.0f); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBufferSize, data.data(), GL_STATIC_DRAW); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); glPauseTransformFeedback(); // Transform feedback should not happen drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, true); // Draw using a different program. glUseProgram(nonTFProgram); GLint positionLocation = glGetAttribLocation(nonTFProgram, essl1_shaders::PositionAttrib()); glDisableVertexAttribArray(positionLocation); glVertexAttrib4f(positionLocation, 0.0f, 0.0f, 0.0f, 1.0f); glDrawArrays(GL_TRIANGLES, 0, 3); // End transform feedback without unpausing and with a different program bound. This triggers // the bug. glEndTransformFeedback(); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); // On a buggy driver without the workaround this will cause a GL error because the driver // thinks transform feedback is still paused, but rendering will still write to the transform // feedback buffers. glPauseTransformFeedback(); drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, true); glEndTransformFeedback(); // Make sure that transform feedback did not happen. We always paused transform feedback before // rendering, but a buggy driver will fail to pause. const void *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector4) * 4, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const Vector4 *vecPointer = static_cast<const Vector4 *>(mapPointer); ASSERT_EQ(vecPointer[0], Vector4(0, 0, 0, 0)); glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); ASSERT_GL_NO_ERROR(); } // Test that switching contexts with paused transform feedback does not cause internal errors. TEST_P(TransformFeedbackTest, EndWithDifferentProgramContextSwitch) { // AMD drivers fail because they perform transform feedback when it should be paused. ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL()); std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); EGLWindow *window = getEGLWindow(); EGLDisplay display = window->getDisplay(); EGLConfig config = window->getConfig(); EGLSurface surface = window->getSurface(); EGLint contextAttributes[] = { EGL_CONTEXT_MAJOR_VERSION_KHR, GetParam().majorVersion, EGL_CONTEXT_MINOR_VERSION_KHR, GetParam().minorVersion, EGL_NONE, }; auto context1 = eglGetCurrentContext(); auto context2 = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttributes); ASSERT_NE(context2, EGL_NO_CONTEXT); // Compile a program on the second context. eglMakeCurrent(display, surface, surface, context2); ANGLE_GL_PROGRAM(nonTFProgram, essl3_shaders::vs::Simple(), essl3_shaders::fs::Red()); eglMakeCurrent(display, surface, surface, context1); // Set up transform feedback, but pause it. glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); // Make sure the buffer has zero'd data std::vector<float> data(mTransformFeedbackBufferSize / sizeof(float), 0.0f); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBufferSize, data.data(), GL_STATIC_DRAW); glUseProgram(mProgram); glBeginTransformFeedback(GL_TRIANGLES); glPauseTransformFeedback(); drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, true); // Leave transform feedback active but paused while we switch to a second context and render // something. eglMakeCurrent(display, surface, surface, context2); glUseProgram(nonTFProgram); GLint positionLocation = glGetAttribLocation(nonTFProgram, essl1_shaders::PositionAttrib()); glDisableVertexAttribArray(positionLocation); glVertexAttrib4f(positionLocation, 0.0f, 0.0f, 0.0f, 1.0f); glDrawArrays(GL_TRIANGLES, 0, 3); // Switch back to the first context and end transform feedback. On a buggy driver, this will // cause the transform feedback object to enter an invalid "inactive, but paused" state unless // the workaround is applied. eglMakeCurrent(display, surface, surface, context1); glEndTransformFeedback(); glBeginTransformFeedback(GL_TRIANGLES); // On a buggy driver without the workaround this will cause a GL error because the driver // thinks transform feedback is still paused, but rendering will still write to the transform // feedback buffers. glPauseTransformFeedback(); drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, true); glEndTransformFeedback(); // Make sure that transform feedback did not happen. We always paused transform feedback before // rendering, but a buggy driver will fail to pause. const void *mapPointer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(Vector4) * 4, GL_MAP_READ_BIT); ASSERT_NE(nullptr, mapPointer); const Vector4 *vecPointer = static_cast<const Vector4 *>(mapPointer); ASSERT_EQ(vecPointer[0], Vector4(0, 0, 0, 0)); glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); eglDestroyContext(display, context2); ASSERT_GL_NO_ERROR(); } // Test an out of memory event. TEST_P(TransformFeedbackTest, BufferOutOfMemory) { // The GL back-end throws an internal error that we can't deal with in this test. ANGLE_SKIP_TEST_IF(IsOpenGL()); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); // Set the program's transform feedback varyings (just gl_Position) std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); GLint positionLocation = glGetAttribLocation(mProgram, essl1_shaders::PositionAttrib()); const GLfloat vertices[] = {-1.0f, -0.5f, 0.0f, 0.5f, 1.0f}; glVertexAttribPointer(positionLocation, 3, GL_FLOAT, GL_FALSE, 0, vertices); glEnableVertexAttribArray(positionLocation); // Draw normally. glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glUseProgram(mProgram); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, 5); glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); // Attempt to generate OOM and begin XFB. constexpr GLsizeiptr kLargeSize = std::numeric_limits<GLsizeiptr>::max(); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, kLargeSize, nullptr, GL_STATIC_DRAW); // It's not spec guaranteed to return OOM here. GLenum err = glGetError(); EXPECT_TRUE(err == GL_NO_ERROR || err == GL_OUT_OF_MEMORY); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, 5); glEndTransformFeedback(); } void TransformFeedbackTest::setupOverrunTest(const std::vector<GLfloat> &vertices) { std::vector<uint8_t> zeroData(mTransformFeedbackBufferSize, 0); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); glBufferSubData(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBufferSize, zeroData.data()); // Draw a simple points XFB. std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); glUseProgram(mProgram); GLint positionLocation = glGetAttribLocation(mProgram, essl1_shaders::PositionAttrib()); // First pass: draw 6 points to the XFB buffer glEnable(GL_RASTERIZER_DISCARD); glVertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 0, vertices.data()); glEnableVertexAttribArray(positionLocation); // Bind the buffer for transform feedback output and start transform feedback glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, 6); } void VerifyVertexFloats(const GLfloat *mapPtrFloat, const std::vector<GLfloat> &vertices, size_t copies, size_t numFloats) { for (size_t floatIndex = 0; floatIndex < vertices.size() * copies; ++floatIndex) { size_t vertIndex = floatIndex % vertices.size(); ASSERT_EQ(mapPtrFloat[floatIndex], vertices[vertIndex]) << "at float index " << floatIndex; } // The rest should be zero. for (size_t floatIndex = vertices.size() * copies; floatIndex < numFloats; ++floatIndex) { ASSERT_EQ(mapPtrFloat[floatIndex], 0) << "at float index " << floatIndex; } } // Tests that stopping XFB works as expected. TEST_P(TransformFeedbackTest, Overrun) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); const std::vector<GLfloat> vertices = { -1.0f, 1.0f, 0.5f, 1.0f, -1.0f, -1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, -1.0f, 1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, }; setupOverrunTest(vertices); glEndTransformFeedback(); // Draw a second time without XFB. glDrawArrays(GL_POINTS, 0, 6); ASSERT_GL_NO_ERROR(); // Verify only the first data was output. const void *mapPtr = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBufferSize, GL_MAP_READ_BIT); const GLfloat *mapPtrFloat = reinterpret_cast<const float *>(mapPtr); size_t numFloats = mTransformFeedbackBufferSize / sizeof(GLfloat); VerifyVertexFloats(mapPtrFloat, vertices, 1, numFloats); } // Similar to the overrun test but with Pause instead of End. TEST_P(TransformFeedbackTest, OverrunWithPause) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); const std::vector<GLfloat> vertices = { -1.0f, 1.0f, 0.5f, 1.0f, -1.0f, -1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, -1.0f, 1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, }; setupOverrunTest(vertices); glPauseTransformFeedback(); // Draw a second time without XFB. glDrawArrays(GL_POINTS, 0, 6); glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); // Verify only the first data was output. const void *mapPtr = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBufferSize, GL_MAP_READ_BIT); const GLfloat *mapPtrFloat = reinterpret_cast<const float *>(mapPtr); size_t numFloats = mTransformFeedbackBufferSize / sizeof(GLfloat); VerifyVertexFloats(mapPtrFloat, vertices, 1, numFloats); } // Similar to the overrun test but with Pause instead of End. TEST_P(TransformFeedbackTest, OverrunWithPauseAndResume) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); // Fails on Adreno Pixel 2 GL drivers. Not a supported configuration. ANGLE_SKIP_TEST_IF(IsOpenGL() && IsAdreno() && IsAndroid()); // Fails on Windows Intel GL drivers. http://anglebug.com/4697 ANGLE_SKIP_TEST_IF(IsOpenGL() && IsIntel() && IsWindows()); const std::vector<GLfloat> vertices = { -1.0f, 1.0f, 0.5f, 1.0f, -1.0f, -1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, -1.0f, 1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, }; setupOverrunTest(vertices); glPauseTransformFeedback(); // Draw a second time without XFB. glDrawArrays(GL_POINTS, 0, 6); // Draw a third time with XFB. glResumeTransformFeedback(); glDrawArrays(GL_POINTS, 0, 6); glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); // Verify only the first and third data was output. const void *mapPtr = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBufferSize, GL_MAP_READ_BIT); const GLfloat *mapPtrFloat = reinterpret_cast<const float *>(mapPtr); size_t numFloats = mTransformFeedbackBufferSize / sizeof(GLfloat); VerifyVertexFloats(mapPtrFloat, vertices, 2, numFloats); } // Similar to the overrun Pause/Resume test but with more than one Pause and Resume. TEST_P(TransformFeedbackTest, OverrunWithMultiplePauseAndResume) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); // Fails on Adreno Pixel 2 GL drivers. Not a supported configuration. ANGLE_SKIP_TEST_IF(IsOpenGL() && IsAdreno() && IsAndroid()); // Fails on Windows Intel GL drivers. http://anglebug.com/4697 ANGLE_SKIP_TEST_IF(IsOpenGL() && IsIntel() && IsWindows()); // Fails on Mac AMD GL drivers. http://anglebug.com/4775 ANGLE_SKIP_TEST_IF(IsOpenGL() && IsAMD() && IsOSX()); const std::vector<GLfloat> vertices = { -1.0f, 1.0f, 0.5f, 1.0f, -1.0f, -1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, -1.0f, 1.0f, 0.5f, 1.0f, 1.0f, -1.0f, 0.5f, 1.0f, 1.0f, 1.0f, 0.5f, 1.0f, }; setupOverrunTest(vertices); for (int iteration = 0; iteration < 2; ++iteration) { // Draw without XFB. glPauseTransformFeedback(); glDrawArrays(GL_POINTS, 0, 6); // Draw with XFB. glResumeTransformFeedback(); glDrawArrays(GL_POINTS, 0, 6); } glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); // Verify only the first and third data was output. const void *mapPtr = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBufferSize, GL_MAP_READ_BIT); const GLfloat *mapPtrFloat = reinterpret_cast<const float *>(mapPtr); size_t numFloats = mTransformFeedbackBufferSize / sizeof(GLfloat); VerifyVertexFloats(mapPtrFloat, vertices, 3, numFloats); } // Tests begin/draw/end/*bindBuffer*/begin/draw/end. TEST_P(TransformFeedbackTest, EndThenBindNewBufferAndRestart) { // TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver. ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan()); // Set the program's transform feedback varyings (just gl_Position) std::vector<std::string> tfVaryings; tfVaryings.push_back("gl_Position"); compileDefaultProgram(tfVaryings, GL_INTERLEAVED_ATTRIBS); glUseProgram(mProgram); GLint positionLocation = glGetAttribLocation(mProgram, essl1_shaders::PositionAttrib()); ASSERT_NE(-1, positionLocation); glEnableVertexAttribArray(positionLocation); GLBuffer secondBuffer; glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, secondBuffer); glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBufferSize, nullptr, GL_STATIC_DRAW); std::vector<GLfloat> posData1 = {0.1f, 0.0f, 0.0f, 1.0f, 0.2f, 0.0f, 0.0f, 1.0f, 0.3f, 0.0f, 0.0f, 1.0f, 0.4f, 0.0f, 0.0f, 1.0f, 0.5f, 0.0f, 0.0f, 1.0f}; std::vector<GLfloat> posData2 = {0.6f, 0.0f, 0.0f, 1.0f, 0.7f, 0.0f, 0.0f, 1.0f, 0.8f, 0.0f, 0.0f, 1.0f, 0.9f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f}; size_t posBytes = posData1.size() * sizeof(posData1[0]); ASSERT_EQ(posBytes, posData2.size() * sizeof(posData2[0])); GLBuffer posBuffer1; glBindBuffer(GL_ARRAY_BUFFER, posBuffer1); glBufferData(GL_ARRAY_BUFFER, posBytes, posData1.data(), GL_STATIC_DRAW); GLBuffer posBuffer2; glBindBuffer(GL_ARRAY_BUFFER, posBuffer2); glBufferData(GL_ARRAY_BUFFER, posBytes, posData2.data(), GL_STATIC_DRAW); // Draw a first time with first buffer. glBindBuffer(GL_ARRAY_BUFFER, posBuffer1); glVertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 0, 0); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mTransformFeedbackBuffer); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, 5); glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); // Bind second buffer and draw with new data. glBindBuffer(GL_ARRAY_BUFFER, posBuffer2); glVertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 0, 0); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, secondBuffer); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, 5); glEndTransformFeedback(); ASSERT_GL_NO_ERROR(); // Read back buffer datas. glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, mTransformFeedbackBuffer); void *posMap1 = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, posBytes, GL_MAP_READ_BIT); ASSERT_NE(posMap1, nullptr); std::vector<GLfloat> actualData1(posData1.size()); memcpy(actualData1.data(), posMap1, posBytes); EXPECT_EQ(posData1, actualData1); glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, secondBuffer); void *posMap2 = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, posBytes, GL_MAP_READ_BIT); ASSERT_NE(posMap2, nullptr); std::vector<GLfloat> actualData2(posData2.size()); memcpy(actualData2.data(), posMap2, posBytes); EXPECT_EQ(posData2, actualData2); } // Draw without transform feedback, then with it. In this test, there are no uniforms. Regression // test based on conformance2/transform_feedback/simultaneous_binding.html for the transform // feedback emulation path in Vulkan that bundles default uniforms and transform feedback buffers // in the same descriptor set. A previous bug was that the first non-transform-feedback draw call // didn't allocate this descriptor set as there were neither uniforms nor transform feedback to be // updated. A second bug was that the second draw call didn't attempt to update the transform // feedback buffers, as they were not "dirty". TEST_P(TransformFeedbackTest, DrawWithoutTransformFeedbackThenWith) { // Fails on Mac Intel GL drivers. http://anglebug.com/4992 ANGLE_SKIP_TEST_IF(IsOpenGL() && IsIntel() && IsOSX()); constexpr char kVS[] = R"(#version 300 es in float in_value; out float out_value; void main() { out_value = in_value * 2.; })"; constexpr char kFS[] = R"(#version 300 es precision mediump float; out vec4 dummy; void main() { dummy = vec4(0.5); })"; std::vector<std::string> tfVaryings; tfVaryings.push_back("out_value"); mProgram = CompileProgramWithTransformFeedback(kVS, kFS, tfVaryings, GL_SEPARATE_ATTRIBS); ASSERT_NE(0u, mProgram); glUseProgram(mProgram); GLBuffer vertexBuffer, indexBuffer, xfbBuffer; GLVertexArray vao; constexpr std::array<float, 4> kAttribInitData = {1, 2, 3, 4}; constexpr std::array<float, 4> kIndexInitData = {0, 1, 2, 3}; constexpr std::array<float, 4> kXfbInitData = {0, 0, 0, 0}; // Initialize buffers. glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); glBufferData(GL_ARRAY_BUFFER, kAttribInitData.size() * sizeof(float), kAttribInitData.data(), GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); glBufferData(GL_ELEMENT_ARRAY_BUFFER, kIndexInitData.size() * sizeof(float), kIndexInitData.data(), GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, xfbBuffer); glBufferData(GL_ARRAY_BUFFER, kXfbInitData.size() * sizeof(float), kXfbInitData.data(), GL_STATIC_DRAW); // This tests that having a transform feedback buffer bound in an unbound VAO // does not affect anything. GLVertexArray unboundVao; glBindVertexArray(unboundVao); glBindBuffer(GL_ARRAY_BUFFER, xfbBuffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 1, GL_FLOAT, false, 0, nullptr); glBindVertexArray(0); // Create the real VAO used for the test. glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 1, GL_FLOAT, false, 0, nullptr); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, xfbBuffer); // First, issue an indexed draw call without transform feedback. glDrawElements(GL_POINTS, 4, GL_UNSIGNED_SHORT, 0); // Then issue a draw call with transform feedback. glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, 4); glEndTransformFeedback(); // Verify transform feedback buffer. void *mappedBuffer = glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, kXfbInitData.size() * sizeof(float), GL_MAP_READ_BIT); ASSERT_NE(nullptr, mappedBuffer); float *xfbOutput = static_cast<float *>(mappedBuffer); for (size_t index = 0; index < kXfbInitData.size(); ++index) { EXPECT_EQ(xfbOutput[index], kAttribInitData[index] * 2); } glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER); EXPECT_GL_NO_ERROR(); } // Use this to select which configurations (e.g. which renderer, which GLES major version) these // tests should be run against. ANGLE_INSTANTIATE_TEST_ES3(TransformFeedbackTest); ANGLE_INSTANTIATE_TEST_ES3(TransformFeedbackLifetimeTest); ANGLE_INSTANTIATE_TEST_ES31(TransformFeedbackTestES31); } // anonymous namespace
{ "pile_set_name": "Github" }
package railo.transformer.bytecode.expression; import java.util.ArrayList; import java.util.List; import org.objectweb.asm.Type; import org.objectweb.asm.commons.GeneratorAdapter; import org.objectweb.asm.commons.Method; import railo.transformer.bytecode.BytecodeContext; import railo.transformer.bytecode.BytecodeException; import railo.transformer.bytecode.expression.var.DataMember; import railo.transformer.bytecode.expression.var.Member; import railo.transformer.bytecode.expression.var.UDF; import railo.transformer.bytecode.util.ExpressionUtil; import railo.transformer.bytecode.util.Types; public final class ExpressionInvoker extends ExpressionBase implements Invoker { // Object getCollection (Object,String) private final static Method GET_COLLECTION = new Method("getCollection", Types.OBJECT, new Type[]{Types.OBJECT,Types.STRING} ); // Object get (Object,String) private final static Method GET = new Method("get", Types.OBJECT, new Type[]{Types.OBJECT,Types.STRING} ); // Object getFunction (Object,String,Object[]) private final static Method GET_FUNCTION = new Method("getFunction", Types.OBJECT, new Type[]{Types.OBJECT,Types.STRING,Types.OBJECT_ARRAY} ); // Object getFunctionWithNamedValues (Object,String,Object[]) private final static Method GET_FUNCTION_WITH_NAMED_ARGS = new Method("getFunctionWithNamedValues", Types.OBJECT, new Type[]{Types.OBJECT,Types.STRING,Types.OBJECT_ARRAY} ); private Expression expr; private List members=new ArrayList(); public ExpressionInvoker(Expression expr) { super(expr.getStart(),expr.getEnd()); this.expr=expr; } public Type _writeOut(BytecodeContext bc, int mode) throws BytecodeException { GeneratorAdapter adapter = bc.getAdapter(); Type rtn=Types.OBJECT; int count=members.size(); for(int i=0;i<count;i++) { adapter.loadArg(0); } expr.writeOut(bc, Expression.MODE_REF); for(int i=0;i<count;i++) { Member member=((Member)members.get(i)); // Data Member if(member instanceof DataMember) { ((DataMember)member).getName().writeOut(bc, MODE_REF); adapter.invokeVirtual(Types.PAGE_CONTEXT,((i+1)==count)?GET:GET_COLLECTION); rtn=Types.OBJECT; } // UDF else if(member instanceof UDF) { UDF udf=(UDF) member; udf.getName().writeOut(bc, MODE_REF); ExpressionUtil.writeOutExpressionArray(bc, Types.OBJECT, udf.getArguments()); adapter.invokeVirtual(Types.PAGE_CONTEXT,udf.hasNamedArgs()?GET_FUNCTION_WITH_NAMED_ARGS:GET_FUNCTION); rtn=Types.OBJECT; } } return rtn; } /** * * @see railo.transformer.bytecode.expression.Invoker#addMember(railo.transformer.bytecode.expression.var.Member) */ public void addMember(Member member) { members.add(member); } /** * * @see railo.transformer.bytecode.expression.Invoker#getMembers() */ public List getMembers() { return members; } }
{ "pile_set_name": "Github" }
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build aix // +build ppc64 // Functions to access/create device major and minor numbers matching the // encoding used AIX. package unix // Major returns the major component of a Linux device number. func Major(dev uint64) uint32 { return uint32((dev & 0x3fffffff00000000) >> 32) } // Minor returns the minor component of a Linux device number. func Minor(dev uint64) uint32 { return uint32((dev & 0x00000000ffffffff) >> 0) } // Mkdev returns a Linux device number generated from the given major and minor // components. func Mkdev(major, minor uint32) uint64 { var DEVNO64 uint64 DEVNO64 = 0x8000000000000000 return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) }
{ "pile_set_name": "Github" }
#--- # Excerpted from "Programming Elixir 1.3", # published by The Pragmatic Bookshelf. # Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. # We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/elixir13 for more book information. #--- # This file is responsible for configuring your application # and its dependencies with the aid of the Mix.Config module. use Mix.Config # This configuration is loaded before any dependency and is restricted # to this project. If another project depends on this project, this # file won't be loaded nor affect the parent project. For this reason, # if you want to provide default values for your application for # 3rd-party users, it should be done in your "mix.exs" file. # You can configure for your application as: # # config :line_sigil, key: :value # # And access this configuration in your application as: # # Application.get_env(:line_sigil, :key) # # Or configure a 3rd-party app: # # config :logger, level: :info # # It is also possible to import configuration files, relative to this # directory. For example, you can emulate configuration per environment # by uncommenting the line below and defining dev.exs, test.exs and such. # Configuration from the imported file will override the ones defined # here (which is why it is important to import them last). # # import_config "#{Mix.env}.exs"
{ "pile_set_name": "Github" }
package com.fasterxml.jackson.databind.ser; import java.util.concurrent.atomic.AtomicReference; import com.fasterxml.jackson.core.util.Snapshottable; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.ser.impl.ReadOnlyClassToSerializerMap; import com.fasterxml.jackson.databind.util.SimpleLookupCache; import com.fasterxml.jackson.databind.util.TypeKey; /** * Simple cache object that allows for doing 2-level lookups: first level is * by "local" read-only lookup Map (used without locking) and second backup * level is by a shared modifiable HashMap. The idea is that after a while, * most serializers are found from the local Map (to optimize performance, * reduce lock contention), but that during buildup we can use a shared map * to reduce both number of distinct read-only maps constructed, and number * of serializers constructed. *<p> * Cache contains three kinds of entries, based on combination of class pair key. * First class in key is for the type to serialize, and second one is type used for * determining how to resolve value type. One (but not both) of entries can be null. */ public final class SerializerCache implements Snapshottable<SerializerCache>, java.io.Serializable { private static final long serialVersionUID = 3L; /** * By default, allow caching of up to 4000 serializer entries (for possibly up to * 1000 types; but depending access patterns may be as few as half of that). */ public final static int DEFAULT_MAX_CACHED = 4000; /** * Shared, modifiable map; used if local read-only copy does not contain serializer * caller expects. *<p> * NOTE: keys are of various types (see below for key types), in addition to * basic {@link JavaType} used for "untyped" serializers. */ private final SimpleLookupCache<TypeKey, JsonSerializer<Object>> _sharedMap; /** * Most recent read-only instance, created from _sharedMap, if any. */ private final transient AtomicReference<ReadOnlyClassToSerializerMap> _readOnlyMap; public SerializerCache() { this(DEFAULT_MAX_CACHED); } /** * @since 3.0 */ public SerializerCache(int maxCached) { int initial = Math.min(64, maxCached>>2); _sharedMap = new SimpleLookupCache<TypeKey, JsonSerializer<Object>>(initial, maxCached); _readOnlyMap = new AtomicReference<ReadOnlyClassToSerializerMap>(); } protected SerializerCache(SimpleLookupCache<TypeKey, JsonSerializer<Object>> shared) { _sharedMap = shared; _readOnlyMap = new AtomicReference<ReadOnlyClassToSerializerMap>(); } // Since 3.0, needed to initialize cache properly: shared map would be ok but need to // reconstruct AtomicReference protected Object readResolve() { return new SerializerCache(_sharedMap); } @Override public SerializerCache snapshot() { return new SerializerCache(_sharedMap.snapshot()); } /** * Method that can be called to get a read-only instance populated from the * most recent version of the shared lookup Map. */ public ReadOnlyClassToSerializerMap getReadOnlyLookupMap() { ReadOnlyClassToSerializerMap m = _readOnlyMap.get(); if (m != null) { return m; } return _makeReadOnlyLookupMap(); } private final synchronized ReadOnlyClassToSerializerMap _makeReadOnlyLookupMap() { // double-locking; safe, but is it really needed? Not doing that is only a perf problem, // not correctness ReadOnlyClassToSerializerMap m = _readOnlyMap.get(); if (m == null) { m = ReadOnlyClassToSerializerMap.from(this, _sharedMap); _readOnlyMap.set(m); } return m; } /* /********************************************************************** /* Lookup methods for accessing shared (slow) cache /********************************************************************** */ public int size() { return _sharedMap.size(); } /** * Method that checks if the shared (and hence, synchronized) lookup Map might have * untyped serializer for given type. */ public JsonSerializer<Object> untypedValueSerializer(Class<?> type) { return _sharedMap.get(new TypeKey(type, false)); } public JsonSerializer<Object> untypedValueSerializer(JavaType type) { return _sharedMap.get(new TypeKey(type, false)); } public JsonSerializer<Object> typedValueSerializer(JavaType type) { return _sharedMap.get(new TypeKey(type, true)); } public JsonSerializer<Object> typedValueSerializer(Class<?> cls) { return _sharedMap.get(new TypeKey(cls, true)); } /* /********************************************************************** /* Methods for adding shared serializer instances /********************************************************************** */ /** * Method called if none of lookups succeeded, and caller had to construct * a serializer. If so, we will update the shared lookup map so that it * can be resolved via it next time. */ public void addTypedSerializer(JavaType type, JsonSerializer<Object> ser) { if (_sharedMap.put(new TypeKey(type, true), ser) == null) { // let's invalidate the read-only copy, too, to get it updated _readOnlyMap.set(null); } } public void addTypedSerializer(Class<?> cls, JsonSerializer<Object> ser) { if (_sharedMap.put(new TypeKey(cls, true), ser) == null) { // let's invalidate the read-only copy, too, to get it updated _readOnlyMap.set(null); } } public void addAndResolveNonTypedSerializer(Class<?> type, JsonSerializer<Object> ser, SerializerProvider provider) throws JsonMappingException { synchronized (this) { if (_sharedMap.put(new TypeKey(type, false), ser) == null) { _readOnlyMap.set(null); } // Need resolution to handle cyclic POJO type dependencies /* 14-May-2011, tatu: Resolving needs to be done in synchronized manner; * this because while we do need to register instance first, we also must * keep lock until resolution is complete. */ ser.resolve(provider); } } public void addAndResolveNonTypedSerializer(JavaType type, JsonSerializer<Object> ser, SerializerProvider provider) throws JsonMappingException { synchronized (this) { if (_sharedMap.put(new TypeKey(type, false), ser) == null) { _readOnlyMap.set(null); } // Need resolution to handle cyclic POJO type dependencies /* 14-May-2011, tatu: Resolving needs to be done in synchronized manner; * this because while we do need to register instance first, we also must * keep lock until resolution is complete. */ ser.resolve(provider); } } /** * Another alternative that will cover both access via raw type and matching * fully resolved type, in one fell swoop. */ public void addAndResolveNonTypedSerializer(Class<?> rawType, JavaType fullType, JsonSerializer<Object> ser, SerializerProvider provider) throws JsonMappingException { synchronized (this) { Object ob1 = _sharedMap.put(new TypeKey(rawType, false), ser); Object ob2 = _sharedMap.put(new TypeKey(fullType, false), ser); if ((ob1 == null) || (ob2 == null)) { _readOnlyMap.set(null); } ser.resolve(provider); } } /** * Method called by StdSerializerProvider#flushCachedSerializers() to * clear all cached serializers */ public synchronized void flush() { _sharedMap.clear(); } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2010-2019 Evolveum and contributors * * This work is dual-licensed under the Apache License 2.0 * and European Union Public License. See LICENSE file for details. */ package com.evolveum.midpoint.testing.schrodinger.labs; import com.codeborne.selenide.Selenide; import com.codeborne.selenide.ex.ElementNotFound; import com.evolveum.midpoint.schrodinger.MidPoint; import com.evolveum.midpoint.schrodinger.component.AssignmentHolderBasicTab; import com.evolveum.midpoint.schrodinger.component.AssignmentsTab; import com.evolveum.midpoint.schrodinger.component.common.PrismForm; import com.evolveum.midpoint.schrodinger.component.common.PrismFormWithActionButtons; import com.evolveum.midpoint.schrodinger.component.configuration.ObjectPolicyTab; import com.evolveum.midpoint.schrodinger.component.org.OrgRootTab; import com.evolveum.midpoint.schrodinger.component.resource.ResourceAccountsTab; import com.evolveum.midpoint.schrodinger.page.resource.ViewResourcePage; import com.evolveum.midpoint.schrodinger.page.task.TaskPage; import com.evolveum.midpoint.schrodinger.page.user.UserPage; import com.evolveum.midpoint.testing.schrodinger.scenarios.ScenariosCommons; import org.apache.commons.io.FileUtils; import org.testng.Assert; import org.testng.annotations.Test; import java.io.File; import java.io.IOException; /** * @author skublik */ public class M10ObjectTemplate extends AbstractLabTest{ private static final File OBJECT_TEMPLATE_USER_SIMPLE_FILE = new File(LAB_OBJECTS_DIRECTORY + "objectTemplate/object-template-example-user-simple.xml"); private static final File OBJECT_TEMPLATE_USER_FILE = new File(LAB_OBJECTS_DIRECTORY + "objectTemplate/object-template-example-user.xml"); private static final File OBJECT_TEMPLATE_USER_FILE_10_3 = new File(LAB_OBJECTS_DIRECTORY + "objectTemplate/object-template-example-user-10-3.xml"); private static final File LOOKUP_EMP_STATUS_FILE = new File(LAB_OBJECTS_DIRECTORY + "lookupTables/lookup-emp-status.xml"); private static final File CSV_3_RESOURCE_FILE_10_4 = new File(LAB_OBJECTS_DIRECTORY + "resources/localhost-csvfile-3-ldap-10-4.xml"); @Test(groups={"M10"}, dependsOnGroups={"M9"}) public void mod10test01SimpleObjectTemplate() throws IOException { importObject(OBJECT_TEMPLATE_USER_SIMPLE_FILE, true); ((PrismFormWithActionButtons<ObjectPolicyTab>)basicPage.objectPolicy() .clickAddObjectPolicy() .selectOption("type", "User") .editRefValue("objectTemplateRef") .table() .clickByName("ExAmPLE User Template")) .clickDone() .and() .save() .feedback() .isSuccess(); showUser("X001212") .checkReconcile() .clickSave() .feedback() .isSuccess(); Assert.assertTrue(showUser("X001212") .selectTabBasic() .form() .compareInputAttributeValue("fullName", "John Smith")); showTask("HR Synchronization").clickResume(); FileUtils.copyFile(HR_SOURCE_FILE_10_1, hrTargetFile); Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); Assert.assertTrue(showUser("X000998") .selectTabBasic() .form() .compareInputAttributeValue("fullName", "David Lister")); TaskPage task = basicPage.newTask(); task.setHandlerUriForNewTask("Recompute task"); task.selectTabBasic() .form() .addAttributeValue("name", "User Recomputation Task") .selectOption("recurrence","Single") .selectOption("objectType","User") .and() .and() .clickSaveAndRun() .feedback() .isInfo(); Assert.assertTrue(showUser("kirk") .selectTabBasic() .form() .compareInputAttributeValue("fullName", "Jim Tiberius Kirk")); } @Test(dependsOnMethods = {"mod10test01SimpleObjectTemplate"}, groups={"M10"}, dependsOnGroups={"M9"}) public void mod10test02AutomaticAssignments() throws IOException { importObject(OBJECT_TEMPLATE_USER_FILE, true); ResourceAccountsTab<ViewResourcePage> accountTab = basicPage.listResources() .table() .clickByName(HR_RESOURCE_NAME) .clickAccountsTab() .clickSearchInResource(); Selenide.sleep(MidPoint.TIMEOUT_DEFAULT_2_S); accountTab.table() .selectCheckboxByName("001212") .clickHeaderActionDropDown() .clickImport() .and() .and() .feedback() .isSuccess(); AssignmentsTab<UserPage> tab = accountTab.table() .clickOnOwnerByName("X001212") .selectTabAssignments(); Assert.assertTrue(tab.containsAssignmentsWithRelation("Default", "Human Resources", "Active Employees", "Internal Employee")); Assert.assertTrue(tab.containsAssignmentsWithRelation("Manager", "Human Resources")); FileUtils.copyFile(HR_SOURCE_FILE_10_2_PART1, hrTargetFile); Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); Assert.assertTrue(showUser("X000999") .selectTabAssignments() .containsAssignmentsWithRelation("Default", "Java Development", "Active Employees", "Internal Employee")); showTask("User Recomputation Task").clickRunNow(); Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); Assert.assertTrue(showUser("X000998") .selectTabAssignments() .containsAssignmentsWithRelation("Default", "Java Development", "Active Employees", "Internal Employee")); FileUtils.copyFile(HR_SOURCE_FILE_10_2_PART2, hrTargetFile); Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); UserPage user = showUser("X000998"); Assert.assertTrue(user.selectTabBasic() .form() .compareSelectAttributeValue("administrativeStatus", "Disabled")); Assert.assertTrue(user.selectTabAssignments() .containsAssignmentsWithRelation("Default", "Inactive Employees", "Internal Employee")); FileUtils.copyFile(HR_SOURCE_FILE_10_2_PART3, hrTargetFile); Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); user = showUser("X000998"); Assert.assertTrue(user.selectTabBasic() .form() .compareSelectAttributeValue("administrativeStatus", "Disabled")); Assert.assertTrue(user.selectTabAssignments() .containsAssignmentsWithRelation("Default", "Former Employees")); FileUtils.copyFile(HR_SOURCE_FILE_10_2_PART1, hrTargetFile); Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); user = showUser("X000998"); Assert.assertTrue(user.selectTabBasic() .form() .compareSelectAttributeValue("administrativeStatus", "Enabled")); Assert.assertTrue(showUser("X000998") .selectTabAssignments() .containsAssignmentsWithRelation("Default", "Java Development", "Active Employees", "Internal Employee")); } @Test(dependsOnMethods = {"mod10test02AutomaticAssignments"}, groups={"M10"}, dependsOnGroups={"M9"}) public void mod10test03LookupTablesAndAttributeOverrides() { PrismForm<AssignmentHolderBasicTab<UserPage>> form = showUser("kirk") .selectTabBasic() .form(); form.showEmptyAttributes("Properties"); form.addAttributeValue("empStatus", "O"); form.addAttributeValue("familyName", "kirk2"); boolean existFeedback = false; try { existFeedback = form.and().and().feedback().isError(); } catch (ElementNotFound e) { } Assert.assertFalse(existFeedback); Assert.assertTrue(form.findProperty("telephoneNumber"). $x(".//i[contains(@data-original-title, 'Primary telephone number of the user, org. unit, etc.')]").exists()); Assert.assertFalse(form.findProperty("telephoneNumber"). $x(".//i[contains(@data-original-title, 'Mobile Telephone Number')]").exists()); Assert.assertTrue(form.isPropertyEnabled("honorificSuffix")); importObject(LOOKUP_EMP_STATUS_FILE, true); importObject(OBJECT_TEMPLATE_USER_FILE_10_3, true); form = showUser("kirk") .selectTabBasic() .form(); form.showEmptyAttributes("Properties"); form.addAttributeValue("empStatus", "O"); form.addAttributeValue("familyName", "kirk2"); Assert.assertTrue(form.and().and().feedback().isError()); Assert.assertFalse(form.findProperty("telephoneNumber"). $x(".//i[contains(@data-original-title, 'Primary telephone number of the user, org. unit, etc.')]").exists()); Assert.assertTrue(form.findProperty("telephoneNumber"). $x(".//i[contains(@data-original-title, 'Mobile Telephone Number')]").exists()); Assert.assertFalse(form.isPropertyEnabled("honorificSuffix")); } @Test(dependsOnMethods = {"mod10test03LookupTablesAndAttributeOverrides"}, groups={"M10"}, dependsOnGroups={"M9"}) public void mod10test04FinishingManagerMapping() { Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); showTask("User Recomputation Task").clickRunNow(); Selenide.sleep(MidPoint.TIMEOUT_MEDIUM_6_S); OrgRootTab rootTab = basicPage.orgStructure() .selectTabWithRootOrg("ExAmPLE, Inc. - Functional Structure"); Assert.assertTrue(rootTab.getOrgHierarchyPanel() .showTreeNodeDropDownMenu("Technology Division") .expandAll() .selectOrgInTree("IT Administration Department") .and() .getManagerPanel() .containsManager("John Wicks")); rootTab.getMemberPanel() .selectType("User") .table() .search() .resetBasicSearch() .and() .clickByName("X000158"); Assert.assertTrue(new UserPage().selectTabProjections() .table() .clickByName("cn=Alice Black,ou=0212,ou=0200,ou=ExAmPLE,dc=example,dc=com") .compareInputAttributeValue("manager", "X000390")); Assert.assertTrue(showUser("X000390").selectTabProjections() .table() .clickByName("cn=John Wicks,ou=0212,ou=0200,ou=ExAmPLE,dc=example,dc=com") .compareInputAttributeValue("manager", "X000035")); Assert.assertTrue(showUser("X000035").selectTabProjections() .table() .clickByName("cn=James Bradley,ou=0200,ou=ExAmPLE,dc=example,dc=com") .showEmptyAttributes("Attributes") .compareInputAttributeValue("manager", "")); Assert.assertTrue(showUser("kirk") .selectTabAssignments() .containsAssignmentsWithRelation("Default", "Warp Speed Research")); Assert.assertTrue(new UserPage().selectTabProjections() .table() .clickByName("cn=Jim Tiberius Kirk,ou=ExAmPLE,dc=example,dc=com") .showEmptyAttributes("Attributes") .compareInputAttributeValue("manager", "")); showUser("picard") .selectTabAssignments() .clickAddAssignemnt("New Organization type assignment with manager relation") .selectType("Org") .table() .search() .byName() .inputValue("0919") .updateSearch() .and() .selectCheckboxByName("0919") .and() .clickAdd() .and() .clickSave() .feedback() .isSuccess(); showUser("kirk").checkReconcile() .clickSave() .feedback() .isSuccess(); Assert.assertTrue(showUser("kirk").selectTabProjections() .table() .clickByName("cn=Jim Tiberius Kirk,ou=ExAmPLE,dc=example,dc=com") .compareInputAttributeValue("manager", "picard")); showUser("picard").selectTabAssignments() .table() .selectCheckboxByName("Warp Speed Research") .removeByName("Warp Speed Research") .and() .and() .clickSave() .feedback() .isSuccess(); Assert.assertTrue(showUser("kirk").selectTabProjections() .table() .clickByName("cn=Jim Tiberius Kirk,ou=ExAmPLE,dc=example,dc=com") .compareInputAttributeValue("manager", "picard")); importObject(CSV_3_RESOURCE_FILE_10_4,true); changeResourceAttribute(CSV_3_RESOURCE_NAME, ScenariosCommons.CSV_RESOURCE_ATTR_FILE_PATH, csv3TargetFile.getAbsolutePath(), true); showUser("kirk").checkReconcile() .clickSave() .feedback() .isSuccess(); Assert.assertTrue(showUser("kirk").selectTabProjections() .table() .clickByName("cn=Jim Tiberius Kirk,ou=ExAmPLE,dc=example,dc=com") .showEmptyAttributes("Attributes") .compareInputAttributeValue("manager", "")); } }
{ "pile_set_name": "Github" }
package com.nielsmasdorp.speculum.views; import com.nielsmasdorp.speculum.models.Configuration; /** * @author Niels Masdorp (NielsMasdorp) */ public interface SetupView extends BaseView { void showLoading(); void hideLoading(); void navigateToMainActivity(Configuration configuration); }
{ "pile_set_name": "Github" }
Hilfe für Einsteiger und Anwender • Re: HDD läuft voll -\> Umzug auf eine größere HDD? ====================================================================================== Date: 2017-02-08 19:29:25 Andere Möglichkeit ist noch mit einer LIve CD zu booten und ein HDD-Image aus der VM heraus zu machen.\ Danach eine Virtuelle HDD mit neuer Größer anlegen und das Image drüberbügeln und der Yacy VM austauschen. Statistik: Verfasst von [promocore](http://forum.yacy-websuche.de/memberlist.php?mode=viewprofile&u=9648) --- Mi Feb 08, 2017 7:29 pm ------------------------------------------------------------------------
{ "pile_set_name": "Github" }
using System.Text.Json.Serialization; namespace Essensoft.AspNetCore.Payment.Alipay.Response { /// <summary> /// KoubeiMerchantDepartmentModifyResponse. /// </summary> public class KoubeiMerchantDepartmentModifyResponse : AlipayResponse { /// <summary> /// 修改商户部门成功时返回的部门id /// </summary> [JsonPropertyName("dept_id")] public string DeptId { get; set; } } }
{ "pile_set_name": "Github" }
var _ = require('underscore'); var Backbone = require('backbone'); var CycleModel = Backbone.Model.extend({ idAttribute: 'cycleId', urlRoot: '/api/cycle', initialize: function () { this.listenTo(this, 'cycle:save', function (data) { this.save(data, { success: function (data) { this.trigger('cycle:save:success', data); }.bind(this), error: function ( model, response, options ) { this.trigger( 'cycle:save:error', model, response, options ); }.bind(this), }); }); }, }); module.exports = CycleModel;
{ "pile_set_name": "Github" }
define(function(require, exports, module) { require('new-uploader'); exports.run = function() { var $uploader = $('#uploader-container'); var uploadProcess = { document: { type: 'html', }, }; var uploader = new UploaderSDK({ id: $uploader.attr('id'), sdkBaseUri: app.cloudSdkBaseUri, disableDataUpload: app.cloudDisableLogReport, disableSentry: app.cloudDisableLogReport, initUrl: $uploader.data('initUrl'), finishUrl: $uploader.data('finishUrl'), accept: $uploader.data('accept'), process: uploadProcess, fileSingleSizeLimit: $uploader.data('fileSingleSizeLimit'), ui: 'single' }); uploader.on('file.finish', function(file) { if (file.length && file.length > 0) { var minute = parseInt(file.length / 60); var second = Math.round(file.length % 60); $("#minute").val(minute); $("#second").val(second); $("#length").val(minute * 60 + second); } var $metas = $('[data-role="metas"]'); var currentTarget = $metas.data('currentTarget'); var $ids = $('.' + $metas.data('idsClass')); var $list = $('.' + $metas.data('listClass')); if (currentTarget != '') { $ids = $('[data-role=' + currentTarget + ']').find('.' + $metas.data('idsClass')); $list = $('[data-role=' + currentTarget + ']').find('.' + $metas.data('listClass')); } $.get('/attachment/file/' + file.no + '/show', function(html) { $list.append(html); $ids.val(file.no); $('#attachment-modal').modal('hide'); $list.siblings('.js-upload-file').hide(); }) }); //只执行一次 $('#attachment-modal').one('hide.bs.modal', function() { uploader.destroy(); uploader = null; }); } });
{ "pile_set_name": "Github" }
#include "openvr-camera.hpp" #include "openvr-hmd.hpp" // for make_pose(...) using namespace polymer; /////////////////////////////// // OpenVR Tracked Camera // /////////////////////////////// #undef near #undef far bool openvr_tracked_camera::initialize(vr::IVRSystem * vr_system, const uint32_t camera_index) { if (!vr_system) return false; index = camera_index; assert(index < 2); hmd = vr_system; trackedCamera = vr::VRTrackedCamera(); if (!trackedCamera) { std::cout << "could not acquire VRTrackedCamera" << std::endl; return false; } bool systemHasCamera = false; vr::EVRTrackedCameraError error = trackedCamera->HasCamera(vr::k_unTrackedDeviceIndex_Hmd, &systemHasCamera); if (error != vr::VRTrackedCameraError_None || !systemHasCamera) { std::cout << "system has no tracked camera available. did you enable it in steam settings? " << trackedCamera->GetCameraErrorNameFromEnum(error) << std::endl; return false; } vr::ETrackedPropertyError propertyError; char buffer[128]; hmd->GetStringTrackedDeviceProperty(vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_CameraFirmwareDescription_String, buffer, sizeof(buffer), &propertyError); if (propertyError != vr::TrackedProp_Success) { std::cout << "failed to get camera firmware desc" << std::endl; return false; } std::cout << "OpenVR_TrackedCamera::Prop_CameraFirmwareDescription_Stringbuffer - " << buffer << std::endl; vr::HmdVector2_t focalLength; vr::HmdVector2_t principalPoint; error = trackedCamera->GetCameraIntrinsics(vr::k_unTrackedDeviceIndex_Hmd, index, vr::VRTrackedCameraFrameType_MaximumUndistorted, &focalLength, &principalPoint); vr::HmdMatrix44_t trackedCameraProjection; float near = .01f; float far = 100.f; error = trackedCamera->GetCameraProjection(vr::k_unTrackedDeviceIndex_Hmd, index, vr::VRTrackedCameraFrameType_MaximumUndistorted, near, far, &trackedCameraProjection); projectionMatrix = transpose(reinterpret_cast<const float4x4 &>(trackedCameraProjection)); intrin.fx = focalLength.v[0]; intrin.fy = focalLength.v[1]; intrin.ppx = principalPoint.v[0]; intrin.ppy = principalPoint.v[1]; return true; } bool openvr_tracked_camera::start() { uint32_t frameWidth = 0; uint32_t frameHeight = 0; uint32_t framebufferSize = 0; if (trackedCamera->GetCameraFrameSize(vr::k_unTrackedDeviceIndex_Hmd, vr::VRTrackedCameraFrameType_MaximumUndistorted, &frameWidth, &frameHeight, &framebufferSize) != vr::VRTrackedCameraError_None) { intrin.width = frameWidth; intrin.height = frameHeight; std::cout << "GetCameraFrameSize() failed" << std::endl; return false; } // Generate texture handle frame.texture.setup(intrin.width, intrin.height, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, nullptr); // Create a persistent buffer for holding the incoming camera data frame.rawBytes = image_buffer<uint8_t, 3>(int2(frameWidth, frameHeight)); lastFrameSequence = 0; // Open and cache OpenVR camera handle trackedCamera->AcquireVideoStreamingService(vr::k_unTrackedDeviceIndex_Hmd, &trackedCameraHandle); if (trackedCameraHandle == INVALID_TRACKED_CAMERA_HANDLE) { std::cout << "AcquireVideoStreamingService() failed" << std::endl; return false; } return true; } void openvr_tracked_camera::stop() { trackedCamera->ReleaseVideoStreamingService(trackedCameraHandle); trackedCameraHandle = INVALID_TRACKED_CAMERA_HANDLE; } void openvr_tracked_camera::capture() { if (!trackedCamera || !trackedCameraHandle) return; vr::CameraVideoStreamFrameHeader_t frameHeader; vr::EVRTrackedCameraError error = trackedCamera->GetVideoStreamFrameBuffer(trackedCameraHandle, vr::VRTrackedCameraFrameType_MaximumUndistorted, nullptr, 0, &frameHeader, sizeof(frameHeader)); if (error != vr::VRTrackedCameraError_None) return; // Ideally called once every ~16ms but who knows if (frameHeader.nFrameSequence == lastFrameSequence) return; // Copy error = trackedCamera->GetVideoStreamFrameBuffer(trackedCameraHandle, vr::VRTrackedCameraFrameType_MaximumUndistorted, frame.rawBytes.data(), cameraFrameBufferSize, &frameHeader, sizeof(frameHeader)); if (error != vr::VRTrackedCameraError_None) return; frame.render_pose = make_pose(frameHeader.standingTrackedDevicePose.mDeviceToAbsoluteTracking); lastFrameSequence = frameHeader.nFrameSequence; glTextureImage2DEXT(frame.texture, GL_TEXTURE_2D, 0, GL_RGB, intrin.width, intrin.height, 0, GL_RGB, GL_UNSIGNED_BYTE, frame.rawBytes.data()); }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ #ifndef SHARE_CI_CIMETHODBLOCKS_HPP #define SHARE_CI_CIMETHODBLOCKS_HPP #include "ci/ciMethod.hpp" #include "memory/resourceArea.hpp" #include "utilities/growableArray.hpp" class ciBlock; typedef short ciBlockIndex; class ciMethodBlocks : public ResourceObj { private: ciMethod *_method; Arena *_arena; GrowableArray<ciBlock *> *_blocks; ciBlock **_bci_to_block; int _num_blocks; int _code_size; void do_analysis(); public: ciMethodBlocks(Arena *arena, ciMethod *meth); ciBlock *block_containing(int bci); ciBlock *block(int index) { return _blocks->at(index); } ciBlock *make_block_at(int bci); ciBlock *split_block_at(int bci); bool is_block_start(int bci); int num_blocks() { return _num_blocks;} void clear_processed(); ciBlock *make_dummy_block(); // a block not associated with a bci #ifndef PRODUCT void dump(); #endif }; class ciBlock : public ResourceObj { private: int _idx; int _start_bci; int _limit_bci; int _control_bci; uint _flags; int _ex_start_bci; int _ex_limit_bci; #ifndef PRODUCT ciMethod *_method; #endif enum { Processed = (1 << 0), Handler = (1 << 1), MayThrow = (1 << 2), DoesJsr = (1 << 3), DoesRet = (1 << 4), RetTarget = (1 << 5), HasHandler = (1 << 6) }; public: enum { fall_through_bci = -1 }; ciBlock(ciMethod *method, int index, int start_bci); int start_bci() const { return _start_bci; } int limit_bci() const { return _limit_bci; } int control_bci() const { return _control_bci; } int index() const { return _idx; } void set_start_bci(int bci) { _start_bci = bci; } void set_limit_bci(int bci) { _limit_bci = bci; } void set_control_bci(int bci) { _control_bci = bci;} void set_exception_range(int start_bci, int limit_bci); int ex_start_bci() const { return _ex_start_bci; } int ex_limit_bci() const { return _ex_limit_bci; } bool contains(int bci) const { return start_bci() <= bci && bci < limit_bci(); } // flag handling bool processed() const { return (_flags & Processed) != 0; } bool is_handler() const { return (_flags & Handler) != 0; } bool may_throw() const { return (_flags & MayThrow) != 0; } bool does_jsr() const { return (_flags & DoesJsr) != 0; } bool does_ret() const { return (_flags & DoesRet) != 0; } bool has_handler() const { return (_flags & HasHandler) != 0; } bool is_ret_target() const { return (_flags & RetTarget) != 0; } void set_processed() { _flags |= Processed; } void clear_processed() { _flags &= ~Processed; } void set_handler() { _flags |= Handler; } void set_may_throw() { _flags |= MayThrow; } void set_does_jsr() { _flags |= DoesJsr; } void clear_does_jsr() { _flags &= ~DoesJsr; } void set_does_ret() { _flags |= DoesRet; } void clear_does_ret() { _flags &= ~DoesRet; } void set_is_ret_target() { _flags |= RetTarget; } void set_has_handler() { _flags |= HasHandler; } void clear_exception_handler() { _flags &= ~Handler; _ex_start_bci = -1; _ex_limit_bci = -1; } #ifndef PRODUCT ciMethod *method() const { return _method; } void dump(); void print_on(outputStream* st) const PRODUCT_RETURN; #endif }; #endif // SHARE_CI_CIMETHODBLOCKS_HPP
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> <TargetExt>.mxe</TargetExt> </PropertyGroup> <ItemDefinitionGroup> <Link> <AdditionalLibraryDirectories>$(C74SUPPORT)\max-includes;$(C74SUPPORT)\msp-includes;$(C74SUPPORT)\jit-includes;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> <ResourceCompile> <PreprocessorDefinitions>VER_TARGETEXT=\".mxe\";%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> <ClCompile> <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> </ClCompile> </ItemDefinitionGroup> </Project>
{ "pile_set_name": "Github" }
--- Title: Verordnung über den Güterkraftverkehr jurabk: GüKVO layout: default origslug: g_kvo slug: guekvo --- # Verordnung über den Güterkraftverkehr (GüKVO) Ausfertigungsdatum : 1990-06-20 Fundstelle : GBl DDR I: 1990, 580 ## (XXXX) §§ 1 bis 3, 5 bis 13, 15 bis 44, 45 bis 69 (weggefallen) ## § 70 Güterfernverkehr (1) Unternehmen, die bis zum Zeitpunkt des Inkrafttretens dieser Verordnung genehmigungspflichtige Beförderungen betrieben haben, können ihren Betrieb bis zum 31. Dezember 1990 weiterführen. Der § 9 Abs. 1 ist insoweit nicht anzuwenden. Dies gilt auch für Unternehmen, die nach Inkrafttreten dieser Verordnung Güterfernverkehr aufnehmen. (2) (3) Die Weiterführung des Güterfernverkehrsunternehmens nach dem im Abs. 1 bestimmten Zeitpunkt setzt die rechtzeitige Einholung der Genehmigung nach § 9 dieser Verordnung voraus. ## § 71 Speditioneller Abfertigungsdienst, Umzugsverkehr und Güternahverkehr (1) Unternehmer, die zum Zeitpunkt des Inkrafttretens dieser Verordnung speditionellen Abfertigungsdienst, Umzugsverkehr oder Güternahverkehr betrieben haben, können ihr Unternehmen bis zum 31. Dezember 1990 weiterführen. Die §§ 33, 35 und 52 sind insoweit nicht anzuwenden. Dies gilt auch für Unternehmen, die nach Inkrafttreten dieser Verordnung bis zum 31. Dezember 1990 eine dieser Tätigkeiten aufnehmen. (2) Die Weiterführung eines solchen Unternehmens nach dem in Abs. 1 bestimmten Zeitpunkt setzt die rechtzeitige Einholung der Zulassung bzw. Erlaubnis nach dieser Verordnung voraus. ## (XXXX) §§ 72 bis 75 (weggefallen) ## Schlußformel **Der Ministerrat der Deutschen Demokratischen Republik** ## Anhang EV Auszug aus EinigVtr Anlage II Kapitel XI Sachgebiet B Abschnitt III (BGBl. II 1990, 885, 1223) Folgendes Recht der Deutschen Demokratischen Republik bleibt mit folgenden Maßgaben in Kraft: 1. § 4 Abs. 2, § 14 Abs. 1 Nr. 1, § 45 Abs. 1 Nr. 4, § 70 Abs. 1 und 3, § 71 der Verordnung vom 20. Juni 1990 über den Güterkraftverkehr (GüKVO) (GBl. I Nr. 40 S. 580) mit folgenden Maßgaben: a) § 4 Abs. 2, § 14 Abs. 1 Nr. 1, § 45 Abs. 1 Nr. 4 gelten bis zum 31. Dezember 1992. b) In § 70 Abs. 1 und 3 tritt an die Stelle des 31. Oktober 1990 der 31. Dezember 1990. c) In § 70 Abs. 1 Satz 3 entfallen die Worte "bis 31. Juli 1990". d) In § 71 tritt an die Stelle des 30. September 1990 der 31. Dezember 1990\. 2. bis 7. ...
{ "pile_set_name": "Github" }
<?php /** * This file was generated by phpSPO model generator 2019-11-17T17:00:44+00:00 16.0.19506.12022 */ namespace Office365\SharePoint; use Office365\Runtime\ClientObject; /** * Contains * operations used in SharePoint connector serving Flow, PowerApps and LogicApps * documentation. */ class APIHubConnector extends ClientObject { }
{ "pile_set_name": "Github" }
// リスト7.7 package main import ( "encoding/xml" "fmt" "io/ioutil" ) type Post struct { XMLName xml.Name `xml:"post"` Id string `xml:"id,attr"` Content string `xml:"content"` Author Author `xml:"author"` } type Author struct { Id string `xml:"id,attr"` Name string `xml:",chardata"` } func main() { post := Post{ Id: "1", Content: "Hello World!", Author: Author{ Id: "2", Name: "Sau Sheong", }, } // output, err := xml.Marshal(&post) output, err := xml.MarshalIndent(&post, "", "\t\t") if err != nil { fmt.Println("Error marshalling to XML:", err) return } err = ioutil.WriteFile("post.xml", []byte(xml.Header + string(output)), 0644) if err != nil { fmt.Println("Error writing XML to file:", err) return } }
{ "pile_set_name": "Github" }
/***************************************************************************** * (c) 2014 Microchip Technology Inc. and its subsidiaries. * You may use this software and any derivatives exclusively with * Microchip products. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, * AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP * PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION. * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. * TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL * CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF * FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE * OF THESE TERMS. *****************************************************************************/ /** @file mec14xx_girqs.h *MEC14xx Interrupt Table Header */ /** @defgroup MEC14xx interrupt */ #ifndef _MEC14XX_GIRQS_H #define _MEC14XX_GIRQS_H #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #include "mec14xx.h" #include "mec14xx_jtvic.h" #include "mec14xx_girqm.h" #define GIRQ08_SRC00_PRI JTVIC_PRI1 #define GIRQ08_SRC01_PRI JTVIC_PRI1 #define GIRQ08_SRC02_PRI JTVIC_PRI1 #define GIRQ08_SRC03_PRI JTVIC_PRI1 #define GIRQ08_SRC04_PRI JTVIC_PRI1 #define GIRQ08_SRC05_PRI JTVIC_PRI1 #define GIRQ08_SRC06_PRI JTVIC_PRI1 #define GIRQ08_SRC07_PRI JTVIC_PRI1 #define GIRQ08_SRC08_PRI JTVIC_PRI1 #define GIRQ08_SRC09_PRI JTVIC_PRI1 #define GIRQ08_SRC10_PRI JTVIC_PRI1 #define GIRQ08_SRC11_PRI JTVIC_PRI1 #define GIRQ08_SRC12_PRI JTVIC_PRI1 #define GIRQ08_SRC13_PRI JTVIC_PRI1 #define GIRQ08_SRC14_PRI JTVIC_PRI1 #define GIRQ08_SRC15_PRI JTVIC_PRI1 #define GIRQ08_SRC16_PRI JTVIC_PRI1 #define GIRQ08_SRC17_PRI JTVIC_PRI1 #define GIRQ08_SRC18_PRI JTVIC_PRI1 #define GIRQ08_SRC19_PRI JTVIC_PRI1 #define GIRQ08_SRC20_PRI JTVIC_PRI1 #define GIRQ08_SRC21_PRI JTVIC_PRI1 #define GIRQ08_SRC22_PRI JTVIC_PRI1 #define GIRQ08_PRI_A (JTVIC_PRI_VAL(0, GIRQ08_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ08_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ08_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ08_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ08_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ08_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ08_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ08_SRC07_PRI)) #define GIRQ08_PRI_B (JTVIC_PRI_VAL(0, GIRQ08_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ08_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ08_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ08_SRC11_PRI) + \ JTVIC_PRI_VAL(4, GIRQ08_SRC12_PRI) + \ JTVIC_PRI_VAL(5, GIRQ08_SRC13_PRI) + \ JTVIC_PRI_VAL(6, GIRQ08_SRC14_PRI) + \ JTVIC_PRI_VAL(7, GIRQ08_SRC15_PRI)) #define GIRQ08_PRI_C (JTVIC_PRI_VAL(0, GIRQ08_SRC16_PRI) + \ JTVIC_PRI_VAL(1, GIRQ08_SRC17_PRI) + \ JTVIC_PRI_VAL(2, GIRQ08_SRC18_PRI) + \ JTVIC_PRI_VAL(3, GIRQ08_SRC19_PRI) + \ JTVIC_PRI_VAL(4, GIRQ08_SRC20_PRI) + \ JTVIC_PRI_VAL(5, GIRQ08_SRC21_PRI) + \ JTVIC_PRI_VAL(6, GIRQ08_SRC22_PRI) ) #define GIRQ08_PRI_D (0ul) /* * GIRQ09 */ #define GIRQ09_SRC00_PRI JTVIC_PRI1 #define GIRQ09_SRC01_PRI JTVIC_PRI1 #define GIRQ09_SRC02_PRI JTVIC_PRI1 #define GIRQ09_SRC03_PRI JTVIC_PRI1 #define GIRQ09_SRC04_PRI JTVIC_PRI1 #define GIRQ09_SRC05_PRI JTVIC_PRI1 #define GIRQ09_SRC06_PRI JTVIC_PRI1 #define GIRQ09_SRC07_PRI JTVIC_PRI1 #define GIRQ09_SRC08_PRI JTVIC_PRI1 #define GIRQ09_SRC09_PRI JTVIC_PRI1 #define GIRQ09_SRC10_PRI JTVIC_PRI1 #define GIRQ09_SRC11_PRI JTVIC_PRI1 #define GIRQ09_SRC12_PRI JTVIC_PRI1 #define GIRQ09_SRC13_PRI JTVIC_PRI1 #define GIRQ09_SRC14_PRI JTVIC_PRI1 #define GIRQ09_SRC15_PRI JTVIC_PRI1 #define GIRQ09_SRC16_PRI JTVIC_PRI1 #define GIRQ09_SRC17_PRI JTVIC_PRI1 #define GIRQ09_SRC18_PRI JTVIC_PRI1 #define GIRQ09_SRC19_PRI JTVIC_PRI1 #define GIRQ09_SRC20_PRI JTVIC_PRI1 #define GIRQ09_SRC21_PRI JTVIC_PRI1 #define GIRQ09_SRC22_PRI JTVIC_PRI1 #define GIRQ09_SRC23_PRI JTVIC_PRI1 #define GIRQ09_SRC24_PRI JTVIC_PRI1 #define GIRQ09_SRC25_PRI JTVIC_PRI1 #define GIRQ09_SRC26_PRI JTVIC_PRI1 #define GIRQ09_SRC27_PRI JTVIC_PRI1 #define GIRQ09_SRC28_PRI JTVIC_PRI1 #define GIRQ09_SRC29_PRI JTVIC_PRI1 #define GIRQ09_SRC30_PRI JTVIC_PRI1 #define GIRQ09_PRI_A (JTVIC_PRI_VAL(0, GIRQ09_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ09_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ09_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ09_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ09_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ09_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ09_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ09_SRC07_PRI)) #define GIRQ09_PRI_B (JTVIC_PRI_VAL(0, GIRQ09_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ09_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ09_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ09_SRC11_PRI) + \ JTVIC_PRI_VAL(4, GIRQ09_SRC12_PRI) + \ JTVIC_PRI_VAL(5, GIRQ09_SRC13_PRI) + \ JTVIC_PRI_VAL(6, GIRQ09_SRC14_PRI) + \ JTVIC_PRI_VAL(7, GIRQ09_SRC15_PRI)) #define GIRQ09_PRI_C (JTVIC_PRI_VAL(0, GIRQ09_SRC16_PRI) + \ JTVIC_PRI_VAL(1, GIRQ09_SRC17_PRI) + \ JTVIC_PRI_VAL(2, GIRQ09_SRC18_PRI) + \ JTVIC_PRI_VAL(3, GIRQ09_SRC19_PRI) + \ JTVIC_PRI_VAL(4, GIRQ09_SRC20_PRI) + \ JTVIC_PRI_VAL(5, GIRQ09_SRC21_PRI) + \ JTVIC_PRI_VAL(6, GIRQ09_SRC22_PRI) + \ JTVIC_PRI_VAL(7, GIRQ09_SRC23_PRI)) #define GIRQ09_PRI_D (JTVIC_PRI_VAL(0, GIRQ09_SRC24_PRI) + \ JTVIC_PRI_VAL(1, GIRQ09_SRC25_PRI) + \ JTVIC_PRI_VAL(2, GIRQ09_SRC26_PRI) + \ JTVIC_PRI_VAL(3, GIRQ09_SRC27_PRI) + \ JTVIC_PRI_VAL(4, GIRQ09_SRC28_PRI) + \ JTVIC_PRI_VAL(5, GIRQ09_SRC29_PRI) + \ JTVIC_PRI_VAL(6, GIRQ09_SRC30_PRI) ) /* * GIRQ10 */ #define GIRQ10_SRC00_PRI JTVIC_PRI1 #define GIRQ10_SRC01_PRI JTVIC_PRI1 #define GIRQ10_SRC02_PRI JTVIC_PRI1 #define GIRQ10_SRC03_PRI JTVIC_PRI1 #define GIRQ10_SRC04_PRI JTVIC_PRI1 #define GIRQ10_SRC05_PRI JTVIC_PRI1 #define GIRQ10_SRC06_PRI JTVIC_PRI1 #define GIRQ10_SRC07_PRI JTVIC_PRI1 #define GIRQ10_SRC08_PRI JTVIC_PRI1 #define GIRQ10_SRC09_PRI JTVIC_PRI1 #define GIRQ10_SRC10_PRI JTVIC_PRI1 #define GIRQ10_SRC11_PRI JTVIC_PRI1 #define GIRQ10_SRC12_PRI JTVIC_PRI7 #define GIRQ10_SRC13_PRI JTVIC_PRI1 #define GIRQ10_SRC14_PRI JTVIC_PRI1 #define GIRQ10_SRC15_PRI JTVIC_PRI1 #define GIRQ10_SRC16_PRI JTVIC_PRI1 #define GIRQ10_SRC17_PRI JTVIC_PRI1 #define GIRQ10_SRC18_PRI JTVIC_PRI1 #define GIRQ10_SRC19_PRI JTVIC_PRI1 #define GIRQ10_SRC20_PRI JTVIC_PRI1 /* Sources [21:22] Reserved */ #define GIRQ10_SRC23_PRI JTVIC_PRI1 #define GIRQ10_PRI_A (JTVIC_PRI_VAL(0, GIRQ10_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ10_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ10_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ10_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ10_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ10_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ10_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ10_SRC07_PRI)) #define GIRQ10_PRI_B (JTVIC_PRI_VAL(0, GIRQ10_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ10_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ10_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ10_SRC11_PRI) + \ JTVIC_PRI_VAL(4, GIRQ10_SRC12_PRI) + \ JTVIC_PRI_VAL(5, GIRQ10_SRC13_PRI) + \ JTVIC_PRI_VAL(6, GIRQ10_SRC14_PRI) + \ JTVIC_PRI_VAL(7, GIRQ10_SRC15_PRI)) #define GIRQ10_PRI_C (JTVIC_PRI_VAL(0, GIRQ10_SRC16_PRI) + \ JTVIC_PRI_VAL(1, GIRQ10_SRC17_PRI) + \ JTVIC_PRI_VAL(2, GIRQ10_SRC18_PRI) + \ JTVIC_PRI_VAL(3, GIRQ10_SRC19_PRI) + \ JTVIC_PRI_VAL(4, GIRQ10_SRC20_PRI) + \ JTVIC_PRI_VAL(7, GIRQ10_SRC23_PRI)) #define GIRQ10_PRI_D (0ul) /* * GIRQ11 */ /* Source[0] Reserved */ #define GIRQ11_SRC01_PRI JTVIC_PRI1 #define GIRQ11_SRC02_PRI JTVIC_PRI1 #define GIRQ11_SRC03_PRI JTVIC_PRI1 #define GIRQ11_SRC04_PRI JTVIC_PRI1 #define GIRQ11_SRC05_PRI JTVIC_PRI1 #define GIRQ11_SRC06_PRI JTVIC_PRI1 #define GIRQ11_SRC07_PRI JTVIC_PRI1 #define GIRQ11_SRC08_PRI JTVIC_PRI1 #define GIRQ11_SRC09_PRI JTVIC_PRI1 #define GIRQ11_SRC10_PRI JTVIC_PRI1 #define GIRQ11_SRC11_PRI JTVIC_PRI1 #define GIRQ11_SRC12_PRI JTVIC_PRI1 #define GIRQ11_SRC13_PRI JTVIC_PRI1 #define GIRQ11_SRC14_PRI JTVIC_PRI1 #define GIRQ11_SRC15_PRI JTVIC_PRI1 #define GIRQ11_SRC16_PRI JTVIC_PRI1 #define GIRQ11_SRC17_PRI JTVIC_PRI1 #define GIRQ11_SRC18_PRI JTVIC_PRI1 #define GIRQ11_SRC19_PRI JTVIC_PRI1 #define GIRQ11_SRC20_PRI JTVIC_PRI1 #define GIRQ11_SRC21_PRI JTVIC_PRI1 #define GIRQ11_SRC22_PRI JTVIC_PRI1 #define GIRQ11_SRC23_PRI JTVIC_PRI1 #define GIRQ11_SRC24_PRI JTVIC_PRI1 #define GIRQ11_SRC25_PRI JTVIC_PRI1 #define GIRQ11_SRC26_PRI JTVIC_PRI1 #define GIRQ11_SRC27_PRI JTVIC_PRI1 #define GIRQ11_SRC28_PRI JTVIC_PRI1 #define GIRQ11_SRC29_PRI JTVIC_PRI1 #define GIRQ11_SRC30_PRI JTVIC_PRI1 #define GIRQ11_PRI_A (JTVIC_PRI_VAL(1, GIRQ11_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ11_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ11_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ11_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ11_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ11_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ11_SRC07_PRI)) #define GIRQ11_PRI_B (JTVIC_PRI_VAL(0, GIRQ11_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ11_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ11_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ11_SRC11_PRI) + \ JTVIC_PRI_VAL(4, GIRQ11_SRC12_PRI) + \ JTVIC_PRI_VAL(5, GIRQ11_SRC13_PRI) + \ JTVIC_PRI_VAL(6, GIRQ11_SRC14_PRI) + \ JTVIC_PRI_VAL(7, GIRQ11_SRC15_PRI)) #define GIRQ11_PRI_C (JTVIC_PRI_VAL(0, GIRQ11_SRC16_PRI) + \ JTVIC_PRI_VAL(1, GIRQ11_SRC17_PRI) + \ JTVIC_PRI_VAL(2, GIRQ11_SRC18_PRI) + \ JTVIC_PRI_VAL(3, GIRQ11_SRC19_PRI) + \ JTVIC_PRI_VAL(4, GIRQ11_SRC20_PRI) + \ JTVIC_PRI_VAL(5, GIRQ11_SRC21_PRI) + \ JTVIC_PRI_VAL(6, GIRQ11_SRC22_PRI) + \ JTVIC_PRI_VAL(7, GIRQ11_SRC23_PRI)) #define GIRQ11_PRI_D (JTVIC_PRI_VAL(0, GIRQ11_SRC24_PRI) + \ JTVIC_PRI_VAL(1, GIRQ11_SRC25_PRI) + \ JTVIC_PRI_VAL(2, GIRQ11_SRC26_PRI) + \ JTVIC_PRI_VAL(3, GIRQ11_SRC27_PRI) + \ JTVIC_PRI_VAL(4, GIRQ11_SRC28_PRI) + \ JTVIC_PRI_VAL(5, GIRQ11_SRC29_PRI) + \ JTVIC_PRI_VAL(6, GIRQ11_SRC30_PRI) ) /* * GIRQ12 */ #define GIRQ12_SRC00_PRI JTVIC_PRI1 #define GIRQ12_SRC01_PRI JTVIC_PRI1 #define GIRQ12_SRC02_PRI JTVIC_PRI1 #define GIRQ12_PRI_A (JTVIC_PRI_VAL(0, GIRQ12_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ12_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ12_SRC02_PRI) ) #define GIRQ12_PRI_B (0ul) #define GIRQ12_PRI_C (0ul) #define GIRQ12_PRI_D (0ul) /* * GIRQ13 */ #define GIRQ13_SRC00_PRI JTVIC_PRI1 #define GIRQ13_SRC01_PRI JTVIC_PRI1 #define GIRQ13_SRC02_PRI JTVIC_PRI1 #define GIRQ13_SRC03_PRI JTVIC_PRI1 #define GIRQ13_SRC04_PRI JTVIC_PRI1 #define GIRQ13_SRC05_PRI JTVIC_PRI1 #define GIRQ13_SRC06_PRI JTVIC_PRI1 #define GIRQ13_PRI_A (JTVIC_PRI_VAL(0, GIRQ13_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ13_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ13_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ13_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ13_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ13_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ13_SRC06_PRI) ) #define GIRQ13_PRI_B (0ul) #define GIRQ13_PRI_C (0ul) #define GIRQ13_PRI_D (0ul) /* * GIRQ14 */ #define GIRQ14_SRC00_PRI JTVIC_PRI1 #define GIRQ14_SRC01_PRI JTVIC_PRI1 #define GIRQ14_SRC02_PRI JTVIC_PRI1 #define GIRQ14_SRC03_PRI JTVIC_PRI1 #define GIRQ14_SRC04_PRI JTVIC_PRI1 #define GIRQ14_SRC05_PRI JTVIC_PRI1 #define GIRQ14_PRI_A (JTVIC_PRI_VAL(0, GIRQ14_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ14_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ14_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ14_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ14_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ14_SRC05_PRI) ) #define GIRQ14_PRI_B (0ul) #define GIRQ14_PRI_C (0ul) #define GIRQ14_PRI_D (0ul) /* * GIRQ15 */ #define GIRQ15_SRC00_PRI JTVIC_PRI1 #define GIRQ15_SRC01_PRI JTVIC_PRI1 #define GIRQ15_SRC02_PRI JTVIC_PRI1 #define GIRQ15_SRC03_PRI JTVIC_PRI1 #define GIRQ15_SRC04_PRI JTVIC_PRI1 #define GIRQ15_SRC05_PRI JTVIC_PRI1 #define GIRQ15_SRC06_PRI JTVIC_PRI1 #define GIRQ15_SRC07_PRI JTVIC_PRI1 #define GIRQ15_SRC08_PRI JTVIC_PRI1 #define GIRQ15_SRC09_PRI JTVIC_PRI1 #define GIRQ15_SRC10_PRI JTVIC_PRI1 #define GIRQ15_SRC11_PRI JTVIC_PRI1 #define GIRQ15_SRC12_PRI JTVIC_PRI1 #define GIRQ15_SRC13_PRI JTVIC_PRI1 #define GIRQ15_SRC14_PRI JTVIC_PRI1 #define GIRQ15_SRC15_PRI JTVIC_PRI1 #define GIRQ15_SRC16_PRI JTVIC_PRI1 #define GIRQ15_SRC17_PRI JTVIC_PRI1 #define GIRQ15_SRC18_PRI JTVIC_PRI1 #define GIRQ15_PRI_A (JTVIC_PRI_VAL(0, GIRQ15_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ15_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ15_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ15_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ15_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ15_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ15_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ15_SRC07_PRI)) #define GIRQ15_PRI_B (JTVIC_PRI_VAL(0, GIRQ15_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ15_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ15_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ15_SRC11_PRI) + \ JTVIC_PRI_VAL(4, GIRQ15_SRC12_PRI) + \ JTVIC_PRI_VAL(5, GIRQ15_SRC13_PRI) + \ JTVIC_PRI_VAL(6, GIRQ15_SRC14_PRI) + \ JTVIC_PRI_VAL(7, GIRQ15_SRC15_PRI)) #define GIRQ15_PRI_C (JTVIC_PRI_VAL(0, GIRQ15_SRC16_PRI) + \ JTVIC_PRI_VAL(1, GIRQ15_SRC17_PRI) + \ JTVIC_PRI_VAL(2, GIRQ15_SRC18_PRI) ) #define GIRQ15_PRI_D (0ul) /* * GIRQ16 */ #define GIRQ16_SRC00_PRI JTVIC_PRI1 #define GIRQ16_SRC01_PRI JTVIC_PRI1 #define GIRQ16_SRC02_PRI JTVIC_PRI1 #define GIRQ16_SRC03_PRI JTVIC_PRI1 #define GIRQ16_SRC04_PRI JTVIC_PRI1 #define GIRQ16_SRC05_PRI JTVIC_PRI1 #define GIRQ16_SRC06_PRI JTVIC_PRI1 #define GIRQ16_SRC07_PRI JTVIC_PRI1 #define GIRQ16_SRC08_PRI JTVIC_PRI1 #define GIRQ16_SRC09_PRI JTVIC_PRI1 #define GIRQ16_PRI_A (JTVIC_PRI_VAL(0, GIRQ16_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ16_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ16_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ16_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ16_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ16_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ16_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ16_SRC07_PRI)) #define GIRQ16_PRI_B (JTVIC_PRI_VAL(0, GIRQ16_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ16_SRC09_PRI) ) #define GIRQ16_PRI_C (0ul) #define GIRQ16_PRI_D (0ul) /* * GIRQ17 */ #define GIRQ17_SRC00_PRI JTVIC_PRI1 #define GIRQ17_SRC01_PRI JTVIC_PRI1 #define GIRQ17_SRC02_PRI JTVIC_PRI1 #define GIRQ17_SRC03_PRI JTVIC_PRI1 #define GIRQ17_SRC04_PRI JTVIC_PRI1 #define GIRQ17_SRC05_PRI JTVIC_PRI1 #define GIRQ17_SRC06_PRI JTVIC_PRI1 #define GIRQ17_SRC07_PRI JTVIC_PRI1 #define GIRQ17_SRC08_PRI JTVIC_PRI1 #define GIRQ17_SRC09_PRI JTVIC_PRI1 #define GIRQ17_SRC10_PRI JTVIC_PRI1 #define GIRQ17_PRI_A (JTVIC_PRI_VAL(0, GIRQ17_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ17_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ17_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ17_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ17_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ17_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ17_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ17_SRC07_PRI)) #define GIRQ17_PRI_B (JTVIC_PRI_VAL(0, GIRQ17_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ17_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ17_SRC10_PRI) ) #define GIRQ17_PRI_C (0ul) #define GIRQ17_PRI_D (0ul) /* * GIRQ18 */ #define GIRQ18_DISAGG (0) #define GIRQ18_SRC00_PRI JTVIC_PRI1 #define GIRQ18_PRI_A (JTVIC_PRI_VAL(0, GIRQ18_SRC00_PRI) ) #define GIRQ18_PRI_B (0ul) #define GIRQ18_PRI_C (0ul) #define GIRQ18_PRI_D (0ul) /* * GIRQ19 */ #define GIRQ19_SRC00_PRI JTVIC_PRI1 #define GIRQ19_SRC01_PRI JTVIC_PRI1 #define GIRQ19_SRC02_PRI JTVIC_PRI1 #define GIRQ19_SRC03_PRI JTVIC_PRI1 #define GIRQ19_SRC04_PRI JTVIC_PRI1 #define GIRQ19_SRC05_PRI JTVIC_PRI1 #define GIRQ19_SRC06_PRI JTVIC_PRI1 #define GIRQ19_SRC07_PRI JTVIC_PRI1 #define GIRQ19_SRC08_PRI JTVIC_PRI1 #define GIRQ19_PRI_A (JTVIC_PRI_VAL(0, GIRQ19_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ19_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ19_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ19_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ19_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ19_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ19_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ19_SRC07_PRI)) #define GIRQ19_PRI_B (JTVIC_PRI_VAL(0, GIRQ19_SRC08_PRI) ) #define GIRQ19_PRI_C (0ul) #define GIRQ19_PRI_D (0ul) /* * GIRQ20 */ #define GIRQ20_SRC00_PRI JTVIC_PRI1 #define GIRQ20_SRC01_PRI JTVIC_PRI1 #define GIRQ20_SRC02_PRI JTVIC_PRI1 #define GIRQ20_SRC03_PRI JTVIC_PRI1 #define GIRQ20_SRC04_PRI JTVIC_PRI1 #define GIRQ20_SRC05_PRI JTVIC_PRI1 #define GIRQ20_PRI_A (JTVIC_PRI_VAL(0, GIRQ20_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ20_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ20_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ20_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ20_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ20_SRC05_PRI) ) #define GIRQ20_PRI_B (0ul) #define GIRQ20_PRI_C (0ul) #define GIRQ20_PRI_D (0ul) /* GIRQ21 is for Wake purposes. It only wakes IA logic and * does not fire an interrupt to the CPU. * No GIRQ21 sources are defined! */ #define GIRQ21_DISAGG (0) #define GIRQ21_PRI_A (0ul) #define GIRQ21_PRI_B (0ul) #define GIRQ21_PRI_C (0ul) #define GIRQ21_PRI_D (0ul) /* * GIRQ22 */ #define GIRQ22_SRC00_PRI JTVIC_PRI1 #define GIRQ22_SRC01_PRI JTVIC_PRI1 #define GIRQ22_SRC02_PRI JTVIC_PRI1 #define GIRQ22_SRC03_PRI JTVIC_PRI1 #define GIRQ22_SRC04_PRI JTVIC_PRI1 #define GIRQ22_SRC05_PRI JTVIC_PRI1 #define GIRQ22_SRC06_PRI JTVIC_PRI1 #define GIRQ22_SRC07_PRI JTVIC_PRI1 #define GIRQ22_SRC08_PRI JTVIC_PRI1 #define GIRQ22_SRC09_PRI JTVIC_PRI1 #define GIRQ22_PRI_A (JTVIC_PRI_VAL(0, GIRQ22_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ22_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ22_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ22_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ22_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ22_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ22_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ22_SRC07_PRI)) #define GIRQ22_PRI_B (JTVIC_PRI_VAL(0, GIRQ22_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ22_SRC09_PRI) ) #define GIRQ22_PRI_C (0ul) #define GIRQ22_PRI_D (0ul) /* * GIRQ23 */ #define GIRQ23_SRC00_PRI JTVIC_PRI1 #define GIRQ23_SRC01_PRI JTVIC_PRI1 #define GIRQ23_SRC02_PRI JTVIC_PRI1 #define GIRQ23_SRC03_PRI JTVIC_PRI1 #define GIRQ23_SRC04_PRI JTVIC_PRI1 #define GIRQ23_SRC05_PRI JTVIC_PRI1 #define GIRQ23_SRC06_PRI JTVIC_PRI1 #define GIRQ23_SRC07_PRI JTVIC_PRI1 #define GIRQ23_SRC08_PRI JTVIC_PRI1 #define GIRQ23_SRC09_PRI JTVIC_PRI1 #define GIRQ23_SRC10_PRI JTVIC_PRI1 #define GIRQ23_SRC11_PRI JTVIC_PRI1 #define GIRQ23_SRC12_PRI JTVIC_PRI1 #define GIRQ23_SRC13_PRI JTVIC_PRI1 #define GIRQ23_SRC14_PRI JTVIC_PRI1 #define GIRQ23_SRC15_PRI JTVIC_PRI1 #define GIRQ23_PRI_A (JTVIC_PRI_VAL(0, GIRQ23_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ23_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ23_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ23_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ23_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ23_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ23_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ23_SRC07_PRI)) #define GIRQ23_PRI_B (JTVIC_PRI_VAL(0, GIRQ23_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ23_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ23_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ23_SRC11_PRI) + \ JTVIC_PRI_VAL(4, GIRQ23_SRC12_PRI) + \ JTVIC_PRI_VAL(5, GIRQ23_SRC13_PRI) + \ JTVIC_PRI_VAL(6, GIRQ23_SRC14_PRI) + \ JTVIC_PRI_VAL(7, GIRQ23_SRC15_PRI)) #define GIRQ23_PRI_C (0ul) #define GIRQ23_PRI_D (0ul) /* * GIRQ24 */ #define GIRQ24_SRC00_PRI JTVIC_PRI3 #define GIRQ24_SRC01_PRI JTVIC_PRI1 #define GIRQ24_SRC02_PRI JTVIC_PRI1 #define GIRQ24_PRI_A (JTVIC_PRI_VAL(0, GIRQ24_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ24_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ24_SRC02_PRI) ) #define GIRQ24_PRI_B (0ul) #define GIRQ24_PRI_C (0ul) #define GIRQ24_PRI_D (0ul) /* * GIRQ25 */ #define GIRQ25_SRC00_PRI JTVIC_PRI1 #define GIRQ25_SRC01_PRI JTVIC_PRI1 #define GIRQ25_SRC02_PRI JTVIC_PRI1 #define GIRQ25_SRC03_PRI JTVIC_PRI1 #define GIRQ25_SRC04_PRI JTVIC_PRI1 #define GIRQ25_SRC05_PRI JTVIC_PRI1 #define GIRQ25_SRC06_PRI JTVIC_PRI1 #define GIRQ25_SRC07_PRI JTVIC_PRI1 #define GIRQ25_SRC08_PRI JTVIC_PRI1 #define GIRQ25_SRC09_PRI JTVIC_PRI1 #define GIRQ25_SRC10_PRI JTVIC_PRI1 #define GIRQ25_SRC11_PRI JTVIC_PRI1 #define GIRQ25_SRC12_PRI JTVIC_PRI1 #define GIRQ25_SRC13_PRI JTVIC_PRI1 #define GIRQ25_SRC14_PRI JTVIC_PRI1 #define GIRQ25_SRC15_PRI JTVIC_PRI1 #define GIRQ25_SRC16_PRI JTVIC_PRI1 #define GIRQ25_SRC17_PRI JTVIC_PRI1 #define GIRQ25_SRC18_PRI JTVIC_PRI1 #define GIRQ25_SRC19_PRI JTVIC_PRI1 #define GIRQ25_SRC20_PRI JTVIC_PRI1 #define GIRQ25_SRC21_PRI JTVIC_PRI1 #define GIRQ25_SRC22_PRI JTVIC_PRI1 #define GIRQ25_SRC23_PRI JTVIC_PRI1 #define GIRQ25_SRC24_PRI JTVIC_PRI1 #define GIRQ25_SRC25_PRI JTVIC_PRI1 #define GIRQ25_SRC26_PRI JTVIC_PRI1 #define GIRQ25_SRC27_PRI JTVIC_PRI1 #define GIRQ25_PRI_A (JTVIC_PRI_VAL(0, GIRQ25_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ25_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ25_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ25_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ25_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ25_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ25_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ25_SRC07_PRI)) #define GIRQ25_PRI_B (JTVIC_PRI_VAL(0, GIRQ25_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ25_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ25_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ25_SRC11_PRI) + \ JTVIC_PRI_VAL(4, GIRQ25_SRC12_PRI) + \ JTVIC_PRI_VAL(5, GIRQ25_SRC13_PRI) + \ JTVIC_PRI_VAL(6, GIRQ25_SRC14_PRI) + \ JTVIC_PRI_VAL(7, GIRQ25_SRC15_PRI)) #define GIRQ25_PRI_C (JTVIC_PRI_VAL(0, GIRQ25_SRC16_PRI) + \ JTVIC_PRI_VAL(1, GIRQ25_SRC17_PRI) + \ JTVIC_PRI_VAL(2, GIRQ25_SRC18_PRI) + \ JTVIC_PRI_VAL(3, GIRQ25_SRC19_PRI) + \ JTVIC_PRI_VAL(4, GIRQ25_SRC20_PRI) + \ JTVIC_PRI_VAL(5, GIRQ25_SRC21_PRI) + \ JTVIC_PRI_VAL(6, GIRQ25_SRC22_PRI) + \ JTVIC_PRI_VAL(7, GIRQ25_SRC23_PRI)) #define GIRQ25_PRI_D (JTVIC_PRI_VAL(0, GIRQ25_SRC24_PRI) + \ JTVIC_PRI_VAL(1, GIRQ25_SRC25_PRI) + \ JTVIC_PRI_VAL(2, GIRQ25_SRC26_PRI) + \ JTVIC_PRI_VAL(3, GIRQ25_SRC27_PRI) ) /* * GIRQ26 */ #define GIRQ26_SRC00_PRI JTVIC_PRI1 #define GIRQ26_SRC01_PRI JTVIC_PRI1 #define GIRQ26_SRC02_PRI JTVIC_PRI1 #define GIRQ26_SRC03_PRI JTVIC_PRI1 #define GIRQ26_SRC04_PRI JTVIC_PRI1 #define GIRQ26_SRC05_PRI JTVIC_PRI1 #define GIRQ26_SRC06_PRI JTVIC_PRI1 #define GIRQ26_SRC07_PRI JTVIC_PRI1 #define GIRQ26_SRC08_PRI JTVIC_PRI1 #define GIRQ26_SRC09_PRI JTVIC_PRI1 #define GIRQ26_SRC10_PRI JTVIC_PRI1 #define GIRQ26_SRC11_PRI JTVIC_PRI1 #define GIRQ26_PRI_A (JTVIC_PRI_VAL(0, GIRQ26_SRC00_PRI) + \ JTVIC_PRI_VAL(1, GIRQ26_SRC01_PRI) + \ JTVIC_PRI_VAL(2, GIRQ26_SRC02_PRI) + \ JTVIC_PRI_VAL(3, GIRQ26_SRC03_PRI) + \ JTVIC_PRI_VAL(4, GIRQ26_SRC04_PRI) + \ JTVIC_PRI_VAL(5, GIRQ26_SRC05_PRI) + \ JTVIC_PRI_VAL(6, GIRQ26_SRC06_PRI) + \ JTVIC_PRI_VAL(7, GIRQ26_SRC07_PRI)) #define GIRQ26_PRI_B (JTVIC_PRI_VAL(0, GIRQ26_SRC08_PRI) + \ JTVIC_PRI_VAL(1, GIRQ26_SRC09_PRI) + \ JTVIC_PRI_VAL(2, GIRQ26_SRC10_PRI) + \ JTVIC_PRI_VAL(3, GIRQ26_SRC11_PRI) ) #define GIRQ26_PRI_C (0ul) #define GIRQ26_PRI_D (0ul) /* * b[7:0] = GIRQ number (0-18) -> GIRQ(8,26) * b[15:8] = bit number (0-31) */ typedef enum IRQn { /* GIRQ08 */ GPIO140_IRQn = ((0 << 8) + 0), GPIO141_IRQn = ((1 << 8) + 0), GPIO142_IRQn = ((2 << 8) + 0), GPIO143_IRQn = ((3 << 8) + 0), GPIO144_IRQn = ((4 << 8) + 0), GPIO145_IRQn = ((5 << 8) + 0), GPIO146_IRQn = ((6 << 8) + 0), GPIO147_IRQn = ((7 << 8) + 0), GPIO150_IRQn = ((8 << 8) + 0), GPIO151_IRQn = ((9 << 8) + 0), GPIO152_IRQn = ((10 << 8) + 0), GPIO153_IRQn = ((11 << 8) + 0), GPIO154_IRQn = ((12 << 8) + 0), GPIO155_IRQn = ((13 << 8) + 0), GPIO156_IRQn = ((14 << 8) + 0), GPIO157_IRQn = ((15 << 8) + 0), GPIO160_IRQn = ((16 << 8) + 0), GPIO161_IRQn = ((17 << 8) + 0), GPIO162_IRQn = ((18 << 8) + 0), GPIO163_IRQn = ((19 << 8) + 0), GPIO164_IRQn = ((20 << 8) + 0), GPIO165_IRQn = ((21 << 8) + 0), GPIO166_IRQn = ((22 << 8) + 0), /* GIRQ09 */ GPIO100_IRQn = ((0 << 8) + 1), GPIO101_IRQn = ((1 << 8) + 1), GPIO102_IRQn = ((2 << 8) + 1), GPIO103_IRQn = ((3 << 8) + 1), GPIO104_IRQn = ((4 << 8) + 1), GPIO105_IRQn = ((5 << 8) + 1), GPIO106_IRQn = ((6 << 8) + 1), GPIO107_IRQn = ((7 << 8) + 1), GPIO110_IRQn = ((8 << 8) + 1), GPIO111_IRQn = ((9 << 8) + 1), GPIO112_IRQn = ((10 << 8) + 1), GPIO113_IRQn = ((11 << 8) + 1), GPIO114_IRQn = ((12 << 8) + 1), GPIO115_IRQn = ((13 << 8) + 1), GPIO116_IRQn = ((14 << 8) + 1), GPIO117_IRQn = ((15 << 8) + 1), GPIO120_IRQn = ((16 << 8) + 1), GPIO121_IRQn = ((17 << 8) + 1), GPIO122_IRQn = ((18 << 8) + 1), GPIO123_IRQn = ((19 << 8) + 1), GPIO124_IRQn = ((20 << 8) + 1), GPIO125_IRQn = ((21 << 8) + 1), GPIO126_IRQn = ((22 << 8) + 1), GPIO127_IRQn = ((23 << 8) + 1), GPIO130_IRQn = ((24 << 8) + 1), GPIO131_IRQn = ((25 << 8) + 1), GPIO132_IRQn = ((26 << 8) + 1), GPIO133_IRQn = ((27 << 8) + 1), GPIO134_IRQn = ((28 << 8) + 1), GPIO135_IRQn = ((29 << 8) + 1), GPIO136_IRQn = ((30 << 8) + 1), /* GIRQ10 */ GPIO040_IRQn = ((0 << 8) + 2), GPIO041_IRQn = ((1 << 8) + 2), GPIO042_IRQn = ((2 << 8) + 2), GPIO043_IRQn = ((3 << 8) + 2), GPIO044_IRQn = ((4 << 8) + 2), GPIO045_IRQn = ((5 << 8) + 2), GPIO046_IRQn = ((6 << 8) + 2), GPIO047_IRQn = ((7 << 8) + 2), GPIO050_IRQn = ((8 << 8) + 2), GPIO051_IRQn = ((9 << 8) + 2), GPIO052_IRQn = ((10 << 8) + 2), GPIO053_IRQn = ((11 << 8) + 2), GPIO054_IRQn = ((12 << 8) + 2), GPIO055_IRQn = ((13 << 8) + 2), GPIO056_IRQn = ((14 << 8) + 2), GPIO057_IRQn = ((15 << 8) + 2), GPIO060_IRQn = ((16 << 8) + 2), GPIO061_IRQn = ((17 << 8) + 2), GPIO062_IRQn = ((18 << 8) + 2), GPIO063_IRQn = ((19 << 8) + 2), GPIO064_IRQn = ((20 << 8) + 2), GPIO065_IRQn = ((21 << 8) + 2), GPIO066_IRQn = ((22 << 8) + 2), GPIO067_IRQn = ((23 << 8) + 2), /* GIRQ11 */ GPIO001_IRQn = ((1 << 8) + 3), GPIO002_IRQn = ((2 << 8) + 3), GPIO003_IRQn = ((3 << 8) + 3), GPIO004_IRQn = ((4 << 8) + 3), GPIO005_IRQn = ((5 << 8) + 3), GPIO006_IRQn = ((6 << 8) + 3), GPIO007_IRQn = ((7 << 8) + 3), GPIO010_IRQn = ((8 << 8) + 3), GPIO011_IRQn = ((9 << 8) + 3), GPIO012_IRQn = ((10 << 8) + 3), GPIO013_IRQn = ((11 << 8) + 3), GPIO014_IRQn = ((12 << 8) + 3), GPIO015_IRQn = ((13 << 8) + 3), GPIO016_IRQn = ((14 << 8) + 3), GPIO017_IRQn = ((15 << 8) + 3), GPIO020_IRQn = ((16 << 8) + 3), GPIO021_IRQn = ((17 << 8) + 3), GPIO022_IRQn = ((18 << 8) + 3), GPIO023_IRQn = ((19 << 8) + 3), GPIO024_IRQn = ((20 << 8) + 3), GPIO025_IRQn = ((21 << 8) + 3), GPIO026_IRQn = ((22 << 8) + 3), GPIO027_IRQn = ((23 << 8) + 3), GPIO030_IRQn = ((24 << 8) + 3), GPIO031_IRQn = ((25 << 8) + 3), GPIO032_IRQn = ((26 << 8) + 3), GPIO033_IRQn = ((27 << 8) + 3), GPIO034_IRQn = ((28 << 8) + 3), GPIO035_IRQn = ((29 << 8) + 3), GPIO036_IRQn = ((30 << 8) + 3), /* GIRQ12 */ SMB0_IRQn = ((0 << 8) + 4), SMB1_IRQn = ((1 << 8) + 4), SMB2_IRQn = ((2 << 8) + 4), /* GIRQ13 */ DMA0_IRQn = ((0 << 8) + 5), DMA1_IRQn = ((1 << 8) + 5), DMA2_IRQn = ((2 << 8) + 5), DMA3_IRQn = ((3 << 8) + 5), DMA4_IRQn = ((4 << 8) + 5), DMA5_IRQn = ((5 << 8) + 5), DMA6_IRQn = ((6 << 8) + 5), /* GIRQ14 */ LPC_ERR_IRQn = ((0 << 8) + 6), PFR_STS_IRQn = ((1 << 8) + 6), LED0_IRQn = ((2 << 8) + 6), LED1_IRQn = ((3 << 8) + 6), LED2_IRQn = ((4 << 8) + 6), INT32K_RDY_IRQn = ((5 << 8) + 6), /* GIRQ15 */ MBOX_IRQn = ((0 << 8) + 7), EMI0_IRQn = ((2 << 8) + 7), KBD_OBF_IRQn = ((4 << 8) + 7), KBD_IBF_IRQn = ((5 << 8) + 7), P80A_IRQn = ((6 << 8) + 7), P80B_IRQn = ((7 << 8) + 7), ACPI_PM1_CTL_IRQn = ((8 << 8) + 7), ACPI_PM1_EN_IRQn = ((9 << 8) + 7), ACPI_PM1_STS_IRQn = ((10 << 8) + 7), ACPI_EC0_IBF_IRQn = ((11 << 8) + 7), ACPI_EC0_OBF_IRQn = ((12 << 8) + 7), ACPI_EC1_IBF_IRQn = ((13 << 8) + 7), ACPI_EC1_OBF_IRQn = ((14 << 8) + 7), ACPI_EC2_IBF_IRQn = ((15 << 8) + 7), ACPI_EC2_OBF_IRQn = ((16 << 8) + 7), ACPI_EC3_IBF_IRQn = ((17 << 8) + 7), ACPI_EC3_OBF_IRQn = ((18 << 8) + 7), /* GIRQ16 */ LPC_WAKE_IRQn = ((0 << 8) + 8), SMB0_WAKE_IRQn = ((1 << 8) + 8), SMB1_WAKE_IRQn = ((2 << 8) + 8), SMB2_WAKE_IRQn = ((3 << 8) + 8), PS2D0_WAKE_IRQn = ((4 << 8) + 8), PS2D1A_WAKE_IRQn = ((5 << 8) + 8), PS2D1B_WAKE_IRQn = ((6 << 8) + 8), KSC_WAKE_IRQn = ((7 << 8) + 8), ICSP_WAKE_IRQn = ((8 << 8) + 8), ESPI_WAKE_IRQn = ((9 << 8) + 8), /* GIRQ17 */ ADC_SGL_IRQn = ((0 << 8) + 9), ADC_RPT_IRQn = ((1 << 8) + 9), PS2D0_ACT_IRQn = ((4 << 8) + 9), PS2D1_ACT_IRQn = ((5 << 8) + 9), KSC_IRQn = ((6 << 8) + 9), UART0_IRQn = ((7 << 8) + 9), PECI_HOST_IRQn = ((8 << 8) + 9), TACH0_IRQn = ((9 << 8) + 9), TACH1_IRQn = ((10 << 8) + 9), /* GIRQ18 */ QMSPI0_IRQn = ((0 << 8) + 10), /* GIRQ19 */ ESPI_PC_IRQn = ((0 << 8) + 11), ESPI_BM1_IRQn = ((1 << 8) + 11), ESPI_BM2_IRQn = ((2 << 8) + 11), ESPI_LTR_IRQn = ((3 << 8) + 11), ESPI_OOB_UP_IRQn = ((4 << 8) + 11), ESPI_OOB_DN_IRQn = ((5 << 8) + 11), ESPI_FLASH_IRQn = ((6 << 8) + 11), ESPI_RESET_IRQn = ((7 << 8) + 11), SUBDEC_IRQn = ((8 << 8) + 11), /* GIRQ20 */ BC0_BUSY_IRQn = ((0 << 8) + 12), BC0_ERR_IRQn = ((1 << 8) + 12), BC0_EV_IRQn = ((2 << 8) + 12), BC1_BUSY_IRQn = ((3 << 8) + 12), BC1_ERR_IRQn = ((4 << 8) + 12), BC1_EV_IRQn = ((5 << 8) + 12), /* GIRQ21 */ STAP_OBF_IRQn = ((0 << 8) + 13), STAP_IBF_IRQn = ((1 << 8) + 13), STAP_WAKE_IRQn = ((2 << 8) + 13), /* GIRQ22 */ LPC_WAKE_ONLY_IRQn = ((0 << 8) + 14), SMB0_WAKE_ONLY_IRQn = ((1 << 8) + 14), SMB1_WAKE_ONLY_IRQn = ((2 << 8) + 14), SMB2_WAKE_ONLY_IRQn = ((3 << 8) + 14), PS2D0_WAKE_ONLY_IRQn = ((4 << 8) + 14), PS2D1A_WAKE_ONLY_IRQn = ((5 << 8) + 14), PS2D1B_WAKE_ONLY_IRQn = ((6 << 8) + 14), KSC_WAKE_ONLY_IRQn = ((7 << 8) + 14), ICSP_WAKE_ONLY_IRQn = ((8 << 8) + 14), ESPI_WAKE_ONLY_IRQn = ((9 << 8) + 14), /* GIRQ23 */ TMR0_IRQn = ((0 << 8) + 15), TMR1_IRQn = ((1 << 8) + 15), TMR2_IRQn = ((2 << 8) + 15), TMR3_IRQn = ((3 << 8) + 15), RTOS_TMR_IRQn = ((4 << 8) + 15), HIBTMR_IRQn = ((5 << 8) + 15), WEEK_ALARM_IRQn = ((6 << 8) + 15), SUB_WEEK_ALARM_IRQn = ((7 << 8) + 15), ONE_SEC_WEEK_IRQn = ((8 << 8) + 15), SUB_SEC_WEEK_IRQn = ((9 << 8) + 15), SYSPWR_PRES_IRQn = ((10 << 8) + 15), VCI_OVRD_IN_IRQn = ((11 << 8) + 15), VCI_IN0_IRQn = ((12 << 8) + 15), VCI_IN1_IRQn = ((13 << 8) + 15), /* GIRQ24 */ M14K_COUNTER_IRQn = ((0 << 8) + 16), M14K_SOFT_IRQ0_IRQn = ((1 << 8) + 16), M14K_SOFT_IRQ1_IRQn = ((2 << 8) + 16), /* GIRQ25 */ ESPI_MSVW00_S0_IRQn = ((0 << 8) + 17), ESPI_MSVW00_S1_IRQn = ((1 << 8) + 17), ESPI_MSVW00_S2_IRQn = ((2 << 8) + 17), ESPI_MSVW00_S3_IRQn = ((3 << 8) + 17), ESPI_MSVW01_S0_IRQn = ((4 << 8) + 17), ESPI_MSVW01_S1_IRQn = ((5 << 8) + 17), ESPI_MSVW01_S2_IRQn = ((6 << 8) + 17), ESPI_MSVW01_S3_IRQn = ((7 << 8) + 17), ESPI_MSVW02_S0_IRQn = ((8 << 8) + 17), ESPI_MSVW02_S1_IRQn = ((9 << 8) + 17), ESPI_MSVW02_S2_IRQn = ((10 << 8) + 17), ESPI_MSVW02_S3_IRQn = ((11 << 8) + 17), ESPI_MSVW03_S0_IRQn = ((12 << 8) + 17), ESPI_MSVW03_S1_IRQn = ((13 << 8) + 17), ESPI_MSVW03_S2_IRQn = ((14 << 8) + 17), ESPI_MSVW03_S3_IRQn = ((15 << 8) + 17), ESPI_MSVW04_S0_IRQn = ((16 << 8) + 17), ESPI_MSVW04_S1_IRQn = ((17 << 8) + 17), ESPI_MSVW04_S2_IRQn = ((18 << 8) + 17), ESPI_MSVW04_S3_IRQn = ((19 << 8) + 17), ESPI_MSVW05_S0_IRQn = ((20 << 8) + 17), ESPI_MSVW05_S1_IRQn = ((21 << 8) + 17), ESPI_MSVW05_S2_IRQn = ((22 << 8) + 17), ESPI_MSVW05_S3_IRQn = ((23 << 8) + 17), ESPI_MSVW06_S0_IRQn = ((24 << 8) + 17), ESPI_MSVW06_S1_IRQn = ((25 << 8) + 17), ESPI_MSVW06_S2_IRQn = ((26 << 8) + 17), ESPI_MSVW06_S3_IRQn = ((27 << 8) + 17), /* GIRQ26 */ ESPI_MSVW07_S0_IRQn = ((0 << 8) + 18), ESPI_MSVW07_S1_IRQn = ((1 << 8) + 18), ESPI_MSVW07_S2_IRQn = ((2 << 8) + 18), ESPI_MSVW07_S3_IRQn = ((3 << 8) + 18), ESPI_MSVW08_S0_IRQn = ((4 << 8) + 18), ESPI_MSVW08_S1_IRQn = ((5 << 8) + 18), ESPI_MSVW08_S2_IRQn = ((6 << 8) + 18), ESPI_MSVW08_S3_IRQn = ((7 << 8) + 18), ESPI_MSVW09_S0_IRQn = ((8 << 8) + 18), ESPI_MSVW09_S1_IRQn = ((9 << 8) + 18), ESPI_MSVW09_S2_IRQn = ((10 << 8) + 18), ESPI_MSVW09_S3_IRQn = ((11 << 8) + 18), /* End */ } IRQn_Type; /* * GIRQn ISR prototypes used to export handlers. * NOTE: We need nomips16 on both prototype and * function definition. Do not add the other * attributes from the function definition to * these prototypes. */ void __attribute__((nomips16)) girq08_isr(void); void __attribute__((nomips16)) girq09_isr(void); void __attribute__((nomips16)) girq10_isr(void); void __attribute__((nomips16)) girq11_isr(void); void __attribute__((nomips16)) girq12_isr(void); void __attribute__((nomips16)) girq13_isr(void); void __attribute__((nomips16)) girq14_isr(void); void __attribute__((nomips16)) girq15_isr(void); void __attribute__((nomips16)) girq16_isr(void); void __attribute__((nomips16)) girq17_isr(void); void __attribute__((nomips16)) girq18_isr(void); void __attribute__((nomips16)) girq19_isr(void); void __attribute__((nomips16)) girq20_isr(void); void __attribute__((nomips16)) girq21_isr(void); void __attribute__((nomips16)) girq22_isr(void); void __attribute__((nomips16)) girq23_isr(void); void __attribute__((nomips16)) girq24_isr(void); void __attribute__((nomips16)) girq25_isr(void); void __attribute__((nomips16)) girq26_isr(void); extern const JTVIC_CFG dflt_ih_table[]; #ifdef __cplusplus } #endif #endif /* _MEC14XX_GIRQS_H */ /** @} */
{ "pile_set_name": "Github" }
/* Print instructions for the Texas TMS320C[34]X, for GDB and GNU Binutils. Copyright (C) 2002-2020 Free Software Foundation, Inc. Contributed by Michael P. Hayes ([email protected]) This file is part of the GNU opcodes library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sysdep.h" #include <math.h> #include "libiberty.h" #include "disassemble.h" #include "opcode/tic4x.h" #define TIC4X_DEBUG 0 #define TIC4X_HASH_SIZE 11 /* 11 (bits) and above should give unique entries. */ #define TIC4X_SPESOP_SIZE 8 /* Max 8. ops for special instructions. */ typedef enum { IMMED_SINT, IMMED_SUINT, IMMED_SFLOAT, IMMED_INT, IMMED_UINT, IMMED_FLOAT } immed_t; typedef enum { INDIRECT_SHORT, INDIRECT_LONG, INDIRECT_TIC4X } indirect_t; static unsigned long tic4x_version = 0; static unsigned int tic4x_dp = 0; static tic4x_inst_t **optab = NULL; static tic4x_inst_t **optab_special = NULL; static const char *registernames[REG_TABLE_SIZE]; static int tic4x_pc_offset (unsigned int op) { /* Determine the PC offset for a C[34]x instruction. This could be simplified using some boolean algebra but at the expense of readability. */ switch (op >> 24) { case 0x60: /* br */ case 0x62: /* call (C4x) */ case 0x64: /* rptb (C4x) */ return 1; case 0x61: /* brd */ case 0x63: /* laj */ case 0x65: /* rptbd (C4x) */ return 3; case 0x66: /* swi */ case 0x67: return 0; default: break; } switch ((op & 0xffe00000) >> 20) { case 0x6a0: /* bB */ case 0x720: /* callB */ case 0x740: /* trapB */ return 1; case 0x6a2: /* bBd */ case 0x6a6: /* bBat */ case 0x6aa: /* bBaf */ case 0x722: /* lajB */ case 0x748: /* latB */ case 0x798: /* rptbd */ return 3; default: break; } switch ((op & 0xfe200000) >> 20) { case 0x6e0: /* dbB */ return 1; case 0x6e2: /* dbBd */ return 3; default: break; } return 0; } static int tic4x_print_char (struct disassemble_info * info, char ch) { if (info != NULL) (*info->fprintf_func) (info->stream, "%c", ch); return 1; } static int tic4x_print_str (struct disassemble_info *info, const char *str) { if (info != NULL) (*info->fprintf_func) (info->stream, "%s", str); return 1; } static int tic4x_print_register (struct disassemble_info *info, unsigned long regno) { unsigned int i; if (registernames[REG_R0] == NULL) { for (i = 0; i < tic3x_num_registers; i++) registernames[tic3x_registers[i].regno] = tic3x_registers[i].name; if (IS_CPU_TIC4X (tic4x_version)) { /* Add C4x additional registers, overwriting any C3x registers if necessary. */ for (i = 0; i < tic4x_num_registers; i++) registernames[tic4x_registers[i].regno] = tic4x_registers[i].name; } } if (regno > (IS_CPU_TIC4X (tic4x_version) ? TIC4X_REG_MAX : TIC3X_REG_MAX)) return 0; if (info != NULL) (*info->fprintf_func) (info->stream, "%s", registernames[regno]); return 1; } static int tic4x_print_addr (struct disassemble_info *info, unsigned long addr) { if (info != NULL) (*info->print_address_func)(addr, info); return 1; } static int tic4x_print_relative (struct disassemble_info *info, unsigned long pc, long offset, unsigned long opcode) { return tic4x_print_addr (info, pc + offset + tic4x_pc_offset (opcode)); } static int tic4x_print_direct (struct disassemble_info *info, unsigned long arg) { if (info != NULL) { (*info->fprintf_func) (info->stream, "@"); tic4x_print_addr (info, arg + (tic4x_dp << 16)); } return 1; } #if 0 /* FIXME: make the floating point stuff not rely on host floating point arithmetic. */ static void tic4x_print_ftoa (unsigned int val, FILE *stream, fprintf_ftype pfunc) { int e; int s; int f; double num = 0.0; e = EXTRS (val, 31, 24); /* Exponent. */ if (e != -128) { s = EXTRU (val, 23, 23); /* Sign bit. */ f = EXTRU (val, 22, 0); /* Mantissa. */ if (s) f += -2 * (1 << 23); else f += (1 << 23); num = f / (double)(1 << 23); num = ldexp (num, e); } (*pfunc)(stream, "%.9g", num); } #endif static int tic4x_print_immed (struct disassemble_info *info, immed_t type, unsigned long arg) { int s; int f; int e; double num = 0.0; if (info == NULL) return 1; switch (type) { case IMMED_SINT: case IMMED_INT: (*info->fprintf_func) (info->stream, "%ld", (long) arg); break; case IMMED_SUINT: case IMMED_UINT: (*info->fprintf_func) (info->stream, "%lu", arg); break; case IMMED_SFLOAT: e = EXTRS (arg, 15, 12); if (e != -8) { s = EXTRU (arg, 11, 11); f = EXTRU (arg, 10, 0); if (s) f += -2 * (1 << 11); else f += (1 << 11); num = f / (double)(1 << 11); num = ldexp (num, e); } (*info->fprintf_func) (info->stream, "%f", num); break; case IMMED_FLOAT: e = EXTRS (arg, 31, 24); if (e != -128) { s = EXTRU (arg, 23, 23); f = EXTRU (arg, 22, 0); if (s) f += -2 * (1 << 23); else f += (1 << 23); num = f / (double)(1 << 23); num = ldexp (num, e); } (*info->fprintf_func) (info->stream, "%f", num); break; } return 1; } static int tic4x_print_cond (struct disassemble_info *info, unsigned int cond) { static tic4x_cond_t **condtable = NULL; unsigned int i; if (condtable == NULL) { condtable = xcalloc (32, sizeof (tic4x_cond_t *)); for (i = 0; i < tic4x_num_conds; i++) condtable[tic4x_conds[i].cond] = (tic4x_cond_t *)(tic4x_conds + i); } if (cond > 31 || condtable[cond] == NULL) return 0; if (info != NULL) (*info->fprintf_func) (info->stream, "%s", condtable[cond]->name); return 1; } static int tic4x_print_indirect (struct disassemble_info *info, indirect_t type, unsigned long arg) { unsigned int aregno; unsigned int modn; unsigned int disp; const char *a; aregno = 0; modn = 0; disp = 1; switch(type) { case INDIRECT_TIC4X: /* *+ARn(disp) */ disp = EXTRU (arg, 7, 3); aregno = EXTRU (arg, 2, 0) + REG_AR0; modn = 0; break; case INDIRECT_SHORT: disp = 1; aregno = EXTRU (arg, 2, 0) + REG_AR0; modn = EXTRU (arg, 7, 3); break; case INDIRECT_LONG: disp = EXTRU (arg, 7, 0); aregno = EXTRU (arg, 10, 8) + REG_AR0; modn = EXTRU (arg, 15, 11); if (modn > 7 && disp != 0) return 0; break; default: (*info->fprintf_func)(info->stream, "# internal error: Unknown indirect type %d", type); return 0; } if (modn > TIC3X_MODN_MAX) return 0; a = tic4x_indirects[modn].name; while (*a) { switch (*a) { case 'a': tic4x_print_register (info, aregno); break; case 'd': tic4x_print_immed (info, IMMED_UINT, disp); break; case 'y': tic4x_print_str (info, "ir0"); break; case 'z': tic4x_print_str (info, "ir1"); break; default: tic4x_print_char (info, *a); break; } a++; } return 1; } static int tic4x_print_op (struct disassemble_info *info, unsigned long instruction, tic4x_inst_t *p, unsigned long pc) { int val; const char *s; const char *parallel = NULL; /* Print instruction name. */ s = p->name; while (*s && parallel == NULL) { switch (*s) { case 'B': if (! tic4x_print_cond (info, EXTRU (instruction, 20, 16))) return 0; break; case 'C': if (! tic4x_print_cond (info, EXTRU (instruction, 27, 23))) return 0; break; case '_': parallel = s + 1; /* Skip past `_' in name. */ break; default: tic4x_print_char (info, *s); break; } s++; } /* Print arguments. */ s = p->args; if (*s) tic4x_print_char (info, ' '); while (*s) { switch (*s) { case '*': /* Indirect 0--15. */ if (! tic4x_print_indirect (info, INDIRECT_LONG, EXTRU (instruction, 15, 0))) return 0; break; case '#': /* Only used for ldp, ldpk. */ tic4x_print_immed (info, IMMED_UINT, EXTRU (instruction, 15, 0)); break; case '@': /* Direct 0--15. */ tic4x_print_direct (info, EXTRU (instruction, 15, 0)); break; case 'A': /* Address register 24--22. */ if (! tic4x_print_register (info, EXTRU (instruction, 24, 22) + REG_AR0)) return 0; break; case 'B': /* 24-bit unsigned int immediate br(d)/call/rptb address 0--23. */ if (IS_CPU_TIC4X (tic4x_version)) tic4x_print_relative (info, pc, EXTRS (instruction, 23, 0), p->opcode); else tic4x_print_addr (info, EXTRU (instruction, 23, 0)); break; case 'C': /* Indirect (short C4x) 0--7. */ if (! IS_CPU_TIC4X (tic4x_version)) return 0; if (! tic4x_print_indirect (info, INDIRECT_TIC4X, EXTRU (instruction, 7, 0))) return 0; break; case 'D': /* Cockup if get here... */ break; case 'E': /* Register 0--7. */ case 'e': if (! tic4x_print_register (info, EXTRU (instruction, 7, 0))) return 0; break; case 'F': /* 16-bit float immediate 0--15. */ tic4x_print_immed (info, IMMED_SFLOAT, EXTRU (instruction, 15, 0)); break; case 'i': /* Extended indirect 0--7. */ if (EXTRU (instruction, 7, 5) == 7) { if (!tic4x_print_register (info, EXTRU (instruction, 4, 0))) return 0; break; } /* Fallthrough */ case 'I': /* Indirect (short) 0--7. */ if (! tic4x_print_indirect (info, INDIRECT_SHORT, EXTRU (instruction, 7, 0))) return 0; break; case 'j': /* Extended indirect 8--15 */ if (EXTRU (instruction, 15, 13) == 7) { if (! tic4x_print_register (info, EXTRU (instruction, 12, 8))) return 0; break; } /* Fall through. */ case 'J': /* Indirect (short) 8--15. */ if (! tic4x_print_indirect (info, INDIRECT_SHORT, EXTRU (instruction, 15, 8))) return 0; break; case 'G': /* Register 8--15. */ case 'g': if (! tic4x_print_register (info, EXTRU (instruction, 15, 8))) return 0; break; case 'H': /* Register 16--18. */ if (! tic4x_print_register (info, EXTRU (instruction, 18, 16))) return 0; break; case 'K': /* Register 19--21. */ if (! tic4x_print_register (info, EXTRU (instruction, 21, 19))) return 0; break; case 'L': /* Register 22--24. */ if (! tic4x_print_register (info, EXTRU (instruction, 24, 22))) return 0; break; case 'M': /* Register 22--22. */ tic4x_print_register (info, EXTRU (instruction, 22, 22) + REG_R2); break; case 'N': /* Register 23--23. */ tic4x_print_register (info, EXTRU (instruction, 23, 23) + REG_R0); break; case 'O': /* Indirect (short C4x) 8--15. */ if (! IS_CPU_TIC4X (tic4x_version)) return 0; if (! tic4x_print_indirect (info, INDIRECT_TIC4X, EXTRU (instruction, 15, 8))) return 0; break; case 'P': /* Displacement 0--15 (used by Bcond and BcondD). */ tic4x_print_relative (info, pc, EXTRS (instruction, 15, 0), p->opcode); break; case 'Q': /* Register 0--15. */ case 'q': if (! tic4x_print_register (info, EXTRU (instruction, 15, 0))) return 0; break; case 'R': /* Register 16--20. */ case 'r': if (! tic4x_print_register (info, EXTRU (instruction, 20, 16))) return 0; break; case 'S': /* 16-bit signed immediate 0--15. */ tic4x_print_immed (info, IMMED_SINT, EXTRS (instruction, 15, 0)); break; case 'T': /* 5-bit signed immediate 16--20 (C4x stik). */ if (! IS_CPU_TIC4X (tic4x_version)) return 0; if (! tic4x_print_immed (info, IMMED_SUINT, EXTRU (instruction, 20, 16))) return 0; break; case 'U': /* 16-bit unsigned int immediate 0--15. */ tic4x_print_immed (info, IMMED_SUINT, EXTRU (instruction, 15, 0)); break; case 'V': /* 5/9-bit unsigned vector 0--4/8. */ tic4x_print_immed (info, IMMED_SUINT, IS_CPU_TIC4X (tic4x_version) ? EXTRU (instruction, 8, 0) : EXTRU (instruction, 4, 0) & ~0x20); break; case 'W': /* 8-bit signed immediate 0--7. */ if (! IS_CPU_TIC4X (tic4x_version)) return 0; tic4x_print_immed (info, IMMED_SINT, EXTRS (instruction, 7, 0)); break; case 'X': /* Expansion register 4--0. */ val = EXTRU (instruction, 4, 0) + REG_IVTP; if (val < REG_IVTP || val > REG_TVTP) return 0; if (! tic4x_print_register (info, val)) return 0; break; case 'Y': /* Address register 16--20. */ val = EXTRU (instruction, 20, 16); if (val < REG_AR0 || val > REG_SP) return 0; if (! tic4x_print_register (info, val)) return 0; break; case 'Z': /* Expansion register 16--20. */ val = EXTRU (instruction, 20, 16) + REG_IVTP; if (val < REG_IVTP || val > REG_TVTP) return 0; if (! tic4x_print_register (info, val)) return 0; break; case '|': /* Parallel instruction. */ tic4x_print_str (info, " || "); tic4x_print_str (info, parallel); tic4x_print_char (info, ' '); break; case ';': tic4x_print_char (info, ','); break; default: tic4x_print_char (info, *s); break; } s++; } return 1; } static void tic4x_hash_opcode_special (tic4x_inst_t **optable_special, const tic4x_inst_t *inst) { int i; for (i = 0;i < TIC4X_SPESOP_SIZE; i++) if (optable_special[i] != NULL && optable_special[i]->opcode == inst->opcode) { /* Collision (we have it already) - overwrite. */ optable_special[i] = (tic4x_inst_t *) inst; return; } for (i = 0; i < TIC4X_SPESOP_SIZE; i++) if (optable_special[i] == NULL) { /* Add the new opcode. */ optable_special[i] = (tic4x_inst_t *) inst; return; } /* This should never occur. This happens if the number of special instructions exceeds TIC4X_SPESOP_SIZE. Please increase the variable of this variable */ #if TIC4X_DEBUG printf ("optable_special[] is full, please increase TIC4X_SPESOP_SIZE!\n"); #endif } static void tic4x_hash_opcode (tic4x_inst_t **optable, tic4x_inst_t **optable_special, const tic4x_inst_t *inst, const unsigned long tic4x_oplevel) { unsigned int j; unsigned int opcode = inst->opcode >> (32 - TIC4X_HASH_SIZE); unsigned int opmask = inst->opmask >> (32 - TIC4X_HASH_SIZE); /* Use a TIC4X_HASH_SIZE bit index as a hash index. We should have unique entries so there's no point having a linked list for each entry? */ for (j = opcode; j < opmask; j++) if ((j & opmask) == opcode && inst->oplevel & tic4x_oplevel) { #if TIC4X_DEBUG /* We should only have collisions for synonyms like ldp for ldi. */ if (optable[j] != NULL) printf ("Collision at index %d, %s and %s\n", j, optable[j]->name, inst->name); #endif /* Catch those ops that collide with others already inside the hash, and have a opmask greater than the one we use in the hash. Store them in a special-list, that will handle full 32-bit INSN, not only the first 11-bit (or so). */ if (optable[j] != NULL && inst->opmask & ~(opmask << (32 - TIC4X_HASH_SIZE))) { /* Add the instruction already on the list. */ tic4x_hash_opcode_special (optable_special, optable[j]); /* Add the new instruction. */ tic4x_hash_opcode_special (optable_special, inst); } optable[j] = (tic4x_inst_t *) inst; } } /* Disassemble the instruction in 'instruction'. 'pc' should be the address of this instruction, it will be used to print the target address if this is a relative jump or call the disassembled instruction is written to 'info'. The function returns the length of this instruction in words. */ static int tic4x_disassemble (unsigned long pc, unsigned long instruction, struct disassemble_info *info) { tic4x_inst_t *p; int i; unsigned long tic4x_oplevel; if (tic4x_version != info->mach) { tic4x_version = info->mach; /* Don't stash anything from a previous call using a different machine. */ free (optab); optab = NULL; free (optab_special); optab_special = NULL; registernames[REG_R0] = NULL; } tic4x_oplevel = (IS_CPU_TIC4X (tic4x_version)) ? OP_C4X : 0; tic4x_oplevel |= OP_C3X | OP_LPWR | OP_IDLE2 | OP_ENH; if (optab == NULL) { optab = xcalloc (sizeof (tic4x_inst_t *), (1 << TIC4X_HASH_SIZE)); optab_special = xcalloc (sizeof (tic4x_inst_t *), TIC4X_SPESOP_SIZE); /* Install opcodes in reverse order so that preferred forms overwrite synonyms. */ for (i = tic4x_num_insts - 1; i >= 0; i--) tic4x_hash_opcode (optab, optab_special, &tic4x_insts[i], tic4x_oplevel); /* We now need to remove the insn that are special from the "normal" optable, to make the disasm search this extra list for them. */ for (i = 0; i < TIC4X_SPESOP_SIZE; i++) if (optab_special[i] != NULL) optab[optab_special[i]->opcode >> (32 - TIC4X_HASH_SIZE)] = NULL; } /* See if we can pick up any loading of the DP register... */ if ((instruction >> 16) == 0x5070 || (instruction >> 16) == 0x1f70) tic4x_dp = EXTRU (instruction, 15, 0); p = optab[instruction >> (32 - TIC4X_HASH_SIZE)]; if (p != NULL) { if (((instruction & p->opmask) == p->opcode) && tic4x_print_op (NULL, instruction, p, pc)) tic4x_print_op (info, instruction, p, pc); else (*info->fprintf_func) (info->stream, "%08lx", instruction); } else { for (i = 0; i<TIC4X_SPESOP_SIZE; i++) if (optab_special[i] != NULL && optab_special[i]->opcode == instruction) { (*info->fprintf_func)(info->stream, "%s", optab_special[i]->name); break; } if (i == TIC4X_SPESOP_SIZE) (*info->fprintf_func) (info->stream, "%08lx", instruction); } /* Return size of insn in words. */ return 1; } /* The entry point from objdump and gdb. */ int print_insn_tic4x (bfd_vma memaddr, struct disassemble_info *info) { int status; unsigned long pc; unsigned long op; bfd_byte buffer[4]; status = (*info->read_memory_func) (memaddr, buffer, 4, info); if (status != 0) { (*info->memory_error_func) (status, memaddr, info); return -1; } pc = memaddr; op = bfd_getl32 (buffer); info->bytes_per_line = 4; info->bytes_per_chunk = 4; info->octets_per_byte = 4; info->display_endian = BFD_ENDIAN_LITTLE; return tic4x_disassemble (pc, op, info) * 4; }
{ "pile_set_name": "Github" }
<?php use PHPUnit\ExampleExtension\TestCaseTrait; class OneTest extends PHPUnit\Framework\TestCase { use TestCaseTrait; public function testOne() { $this->assertExampleExtensionInitialized(); } }
{ "pile_set_name": "Github" }
package io.eventuate.tram.spring.commands.producer; import io.eventuate.tram.commands.producer.CommandProducer; import io.eventuate.tram.commands.producer.CommandProducerImpl; import io.eventuate.tram.messaging.common.ChannelMapping; import io.eventuate.tram.messaging.producer.MessageProducer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class TramCommandProducerConfiguration { @Bean public CommandProducer commandProducer(MessageProducer messageProducer, ChannelMapping channelMapping) { return new CommandProducerImpl(messageProducer); } }
{ "pile_set_name": "Github" }
/////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2015 Xilinx, Inc. // All Rights Reserved /////////////////////////////////////////////////////////////////////////////// // ____ ____ // / /\/ / // /___/ \ / Vendor: Xilinx // \ \ \/ Version: 1.0 // \ \ Application : Vivado HLS // / / Filename: srcCtrl.cpp // /___/ /\ Timestamp: Tue May 12 5:00:00 PST 2015 // \ \ / \ // \___\/\___\ // //Command: N/A //Device: 7K325T-2 //Design Name: multiSRC //Purpose: // This file describes the behavior of the controller that // 1) generates the coefficient ROM address // 2) determines whether the data in the MAC chain should be shifted or not // 3) determines whether the MAC chain computed data is a valid output //Reference: // XAPP1236 /////////////////////////////////////////////////////////////////////////////// #include "multiSRC.h" void srcCtrl(bool vld_i, rat_t rat_i, bool& vld_o, bool& toshift_o, coef_phase_t &addr_o){ // time multiplex channels static coef_phase_t vec_phase[ChMux]; static coef_phase_t vec_tokeep[ChMux]; static coef_phase_t vec_isskip[ChMux]; static chid_t cnt_r=0; // read out the info from the shift register as output coef_phase_t phase = vec_phase[cnt_r]; // whether to shift the register bool tokeep = vec_tokeep[cnt_r]; // isskip flag for the valid input bool isskip = vec_isskip[cnt_r]; if(cnt_r==ChMux-1) cnt_r=0; else cnt_r++; // rat_i=0, bypass : addr=0, // rat_i=1, 3/4 : addr=1, 2, 3 // rat_i=2, 5/8 : addr=4, 5, 6, 7, 8 // rat_i=3, 5/6 : addr=9, 10, 11, 12, 13 coef_phase_t base_addr = BA_VEC[rat_i]; // output the signals toshift_o = vld_i & (!tokeep); // shift when a valid input is available and it is time to shift vld_o = (vld_i & (!isskip)) | tokeep; // addr_o = phase+base_addr; // mux for the step_input and step_output coef_phase_t step_in = STEP_IN_VEC[rat_i]; coef_phase_t step_out = STEP_OUT_VEC[rat_i]; // when there is a valid output out, // phase need to increase by step_out // and if the new phase is not larger than step_in // then it should not shift if (vld_o){ phase+=step_out; if(phase<step_in){ // it means that no new data is required for next output tokeep=true; isskip=false; }else{ // new data is needed tokeep=false; isskip=( (phase>>1) >=step_in); phase-=step_in; } }else if (vld_i){ // a new input is available, but it is to be skipped tokeep=false; isskip=( (phase>>1) >=step_in); phase-=step_in; } static chid_t cnt_w=0; // save nxt values into the shift register vec_phase[cnt_w]=phase; vec_tokeep[cnt_w]=tokeep; vec_isskip[cnt_w]=isskip; if(cnt_w==ChMux-1) cnt_w=0; else cnt_w++; }
{ "pile_set_name": "Github" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class AutoMoveAndRotate : MonoBehaviour { public Vector3andSpace moveUnitsPerSecond; public Vector3andSpace rotateDegreesPerSecond; public bool ignoreTimescale; private float m_LastRealTime; private void Start() { m_LastRealTime = Time.realtimeSinceStartup; } // Update is called once per frame private void Update() { float deltaTime = Time.deltaTime; if (ignoreTimescale) { deltaTime = (Time.realtimeSinceStartup - m_LastRealTime); m_LastRealTime = Time.realtimeSinceStartup; } transform.Translate(moveUnitsPerSecond.value*deltaTime, moveUnitsPerSecond.space); transform.Rotate(rotateDegreesPerSecond.value*deltaTime, moveUnitsPerSecond.space); } [Serializable] public class Vector3andSpace { public Vector3 value; public Space space = Space.Self; } } }
{ "pile_set_name": "Github" }
Example use case ================ .. toctree:: :maxdepth: 2 To briefly explain how to approach pyasn1, consider a quick workflow example. Grab ASN.1 schema for SSH keys ------------------------------ ASN.1 is widely used in many Internet protocols. Frequently, whenever ASN.1 is employed, data structures are described in ASN.1 schema language right in the RFC. Take `RFC2437 <https://www.ietf.org/rfc/rfc2437.txt>`_ for example -- we can look into it and weed out data structures specification into a local file: .. code-block:: python # pkcs-1.asn PKCS-1 {iso(1) member(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) modules(0) pkcs-1(1)} DEFINITIONS EXPLICIT TAGS ::= BEGIN RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, publicExponent INTEGER, privateExponent INTEGER, prime1 INTEGER, prime2 INTEGER, exponent1 INTEGER, exponent2 INTEGER, coefficient INTEGER } Version ::= INTEGER END Compile ASN.1 schema into Python -------------------------------- In the best case, you should be able to automatically compile ASN.1 spec into Python classes. For that purpose we have the `asn1ate <https://github.com/kimgr/asn1ate>`_ tool: .. code-block:: bash $ asn1ate pkcs-1.asn > rsakey.py Though it may not work out as, as it stands now, asn1ate does not support all ASN.1 language constructs. Alternatively, you could check out the `pyasn1-modules <https://github.com/etingof/pyasn1-modules>`_ package to see if it already has the ASN.1 spec you are looking for compiled and shipped there. Then just install the package, import the data structure you need and use it: .. code-block:: bash $ pip install pyasn1-modules As a last resort, you could express ASN.1 in Python by hand. The end result should be a declarative Python code resembling original ASN.1 syntax like this: .. code-block:: python # rsakey.py class Version(Integer): pass class RSAPrivateKey(Sequence): componentType = NamedTypes( NamedType('version', Version()), NamedType('modulus', Integer()), NamedType('publicExponent', Integer()), NamedType('privateExponent', Integer()), NamedType('prime1', Integer()), NamedType('prime2', Integer()), NamedType('exponent1', Integer()), NamedType('exponent2', Integer()), NamedType('coefficient', Integer()) ) Read your ~/.ssh/id_rsa ----------------------- Given we've put our Python classes into the `rsakey.py` module, we could import the top-level object for SSH keys container and initialize it from our `~/.ssh/id_rsa` file (for sake of simplicity here we assume no passphrase is set on the key file): .. code-block:: python from base64 import b64decode from pyasn1.codec.der.decoder import decode as der_decoder from rsakey import RSAPrivateKey # Read SSH key from file (assuming no passphrase) with open('.ssh/id_rsa') as key_file: b64_serialisation = ''.join(key_file.readlines()[1:-1]) # Undo BASE64 serialisation der_serialisation = b64decode(b64_serialisation) # Undo DER serialisation, reconstruct SSH key structure private_key, rest_of_input = der_decoder(der_serialisation, asn1Spec=RSAPrivateKey()) Once we have Python ASN.1 structures initialized, we could inspect them: .. code-block:: pycon >>> print('%s' % private_key) RSAPrivateKey: version=0 modulus=280789907761334970323210643584308373... publicExponent=65537 privateExponent=1704567874679144879123080924... prime1=1780178536719561265324798296279384073... prime2=1577313184995269616049017780493740138... exponent1=1193974819720845247396384239609024... exponent2=9240965721817961178848297404494811... coefficient=10207364473358910343346707141115... Play with the keys ------------------ As well as use them nearly as we do with native Python types: .. code-block:: pycon >>> pk = private_key >>> >>> pk['prime1'] * pk['prime2'] == pk['modulus'] True >>> pk['prime1'] == pk['modulus'] // pk['prime2'] True >>> pk['exponent1'] == pk['privateExponent'] % (pk['prime1'] - 1) True >>> pk['exponent2'] == pk['privateExponent'] % (pk['prime2'] - 1) True Technically, pyasn1 classes `emulate <https://docs.python.org/3/reference/datamodel.html#emulating-container-types>`_ Python built-in types. Transform to built-ins ---------------------- ASN.1 data structures exhibit a way more complicated behaviour compared to Python types. You may wish to simplify things by turning the whole tree of pyasn1 objects into an analogous tree made of base Python types: .. code-block:: pycon >>> from pyasn1.codec.native.encoder import encode >>> ... >>> py_private_key = encode(private_key) >>> py_private_key {'version': 0, 'modulus': 280789907761334970323210643584308373, 'publicExponent': 65537, 'privateExponent': 1704567874679144879123080924, 'prime1': 1780178536719561265324798296279384073, 'prime2': 1577313184995269616049017780493740138, 'exponent1': 1193974819720845247396384239609024, 'exponent2': 9240965721817961178848297404494811, 'coefficient': 10207364473358910343346707141115} You can do vice-versa: initialize ASN.1 structure from a dict: .. code-block:: pycon >>> from pyasn1.codec.native.decoder import decode >>> py_private_key = {'modulus': 280789907761334970323210643584308373} >>> private_key = decode(py_private_key, asn1Spec=RSAPrivateKey()) Write it back ------------- Possibly not that applicable to the SSH key example, but you can of course modify any part of the ASN.1 data structure and serialise it back into the same or other wire representation: .. code-block:: python from pyasn1.codec.der.encoder import encode as der_encoder # Serialise SSH key data structure into DER stream der_serialisation = der_encoder(private_key) # Serialise DER stream into BASE64 stream b64_serialisation = '-----BEGIN RSA PRIVATE KEY-----\n' b64_serialisation += b64encode(der_serialisation) b64_serialisation += '-----END RSA PRIVATE KEY-----\n' with open('.ssh/id_rsa.new', 'w') as key_file: key_file.write(b64_serialisation)
{ "pile_set_name": "Github" }
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <[email protected]>, 2011 # Vichai Vongvorakul <[email protected]>, 2012 msgid "" msgstr "" "Project-Id-Version: django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-17 23:12+0200\n" "PO-Revision-Date: 2016-05-21 09:51+0000\n" "Last-Translator: Jannis Leidel <[email protected]>\n" "Language-Team: Thai (http://www.transifex.com/django/django/language/th/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: th\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "Administrative Documentation" msgstr "" msgid "Home" msgstr "หน้าหลัก" msgid "Documentation" msgstr "เอกสารประกอบ" msgid "Bookmarklets" msgstr "Bookmarklets" msgid "Documentation bookmarklets" msgstr "Documentation bookmarklets" msgid "" "To install bookmarklets, drag the link to your bookmarks toolbar, or right-" "click the link and add it to your bookmarks. Now you can select the " "bookmarklet from any page in the site." msgstr "" msgid "Documentation for this page" msgstr "เอกสารสำหรับหน้านี้" msgid "" "Jumps you from any page to the documentation for the view that generates " "that page." msgstr "ย้ายจากทุกหน้าไปที่วิวที่สร้างหน้านั้นขึ้นมา" msgid "Tags" msgstr "Tags:" msgid "List of all the template tags and their functions." msgstr "" msgid "Filters" msgstr "Filters" msgid "" "Filters are actions which can be applied to variables in a template to alter " "the output." msgstr "" msgid "Models" msgstr "Models" msgid "" "Models are descriptions of all the objects in the system and their " "associated fields. Each model has a list of fields which can be accessed as " "template variables" msgstr "" msgid "Views" msgstr "View" msgid "" "Each page on the public site is generated by a view. The view defines which " "template is used to generate the page and which objects are available to " "that template." msgstr "" msgid "Tools for your browser to quickly access admin functionality." msgstr "" msgid "Please install docutils" msgstr "" #, python-format msgid "" "The admin documentation system requires Python's <a href=\"%(link)s" "\">docutils</a> library." msgstr "" #, python-format msgid "" "Please ask your administrators to install <a href=\"%(link)s\">docutils</a>." msgstr "" #, python-format msgid "Model: %(name)s" msgstr "" msgid "Fields" msgstr "" msgid "Field" msgstr "" msgid "Type" msgstr "" msgid "Description" msgstr "" msgid "Methods with arguments" msgstr "" msgid "Method" msgstr "" msgid "Arguments" msgstr "" msgid "Back to Model documentation" msgstr "" msgid "Model documentation" msgstr "" msgid "Model groups" msgstr "" msgid "Templates" msgstr "Templates" #, python-format msgid "Template: %(name)s" msgstr "" #, python-format msgid "Template: \"%(name)s\"" msgstr "" #. Translators: Search is not a verb here, it qualifies path (a search path) #, python-format msgid "Search path for template \"%(name)s\":" msgstr "" msgid "(does not exist)" msgstr "" msgid "Back to Documentation" msgstr "" msgid "Template filters" msgstr "" msgid "Template filter documentation" msgstr "" msgid "Built-in filters" msgstr "" #, python-format msgid "" "To use these filters, put <code>%(code)s</code> in your template before " "using the filter." msgstr "" msgid "Template tags" msgstr "" msgid "Template tag documentation" msgstr "" msgid "Built-in tags" msgstr "" #, python-format msgid "" "To use these tags, put <code>%(code)s</code> in your template before using " "the tag." msgstr "" #, python-format msgid "View: %(name)s" msgstr "" msgid "Context:" msgstr "" msgid "Templates:" msgstr "" msgid "Back to View documentation" msgstr "" msgid "View documentation" msgstr "" msgid "Jump to namespace" msgstr "" msgid "Empty namespace" msgstr "" #, python-format msgid "Views by namespace %(name)s" msgstr "" msgid "Views by empty namespace" msgstr "" #, python-format msgid "" "\n" " View function: <code>%(full_name)s</code>. Name: <code>%(url_name)s</" "code>.\n" msgstr "" msgid "Boolean (Either True or False)" msgstr "ตรรกะแบบบูลหมายถึง ค่า\"จริง\" (True) หรือ \"ไม่จริง \" (False)" #, python-format msgid "Field of type: %(field_type)s" msgstr "ฟิลด์ข้อมูล: %(field_type)s" msgid "tag:" msgstr "ป้ายกำกับ:" msgid "filter:" msgstr "ตัวกรอง:" msgid "view:" msgstr "ดู:" #, python-format msgid "App %(app_label)r not found" msgstr "" #, python-format msgid "Model %(model_name)r not found in app %(app_label)r" msgstr "ไม่พบโมเดล %(model_name)r ในแอป %(app_label)r" msgid "model:" msgstr "โมเดล:" #, python-format msgid "the related `%(app_label)s.%(data_type)s` object" msgstr "ความสัมพันธ์`%(app_label)s.%(data_type)s` อ็อบเจ็กต์" #, python-format msgid "related `%(app_label)s.%(object_name)s` objects" msgstr "ความสัมพันธ์`%(app_label)s.%(object_name)s` อ็อบเจ็กต์" #, python-format msgid "all %s" msgstr "ทั้งหมด %s " #, python-format msgid "number of %s" msgstr "จำนวนของ %s" #, python-format msgid "%s does not appear to be a urlpattern object" msgstr "%s ดูเหมือนจะไม่ใช่ urlpattern อ็อบเจ็กต์"
{ "pile_set_name": "Github" }
/* * (C) Copyright 2001-2015 Diomidis Spinellis * * This file is part of CScout. * * CScout is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * CScout is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with CScout. If not, see <http://www.gnu.org/licenses/>. * * * A C token. * The getnext() method for these tokens converts preprocessor tokens to C * tokens. * */ #ifndef CTOKEN_ #define CTOKEN_ #include <string> #include <map> #include "token.h" #include "pdtoken.h" using namespace std; char unescape_char(const string& s, string::const_iterator& si); typedef map<string, int> mapKeyword; class Ctoken: public Token { private: static mapKeyword keywords; static mapKeyword& create_keymap(); public: Ctoken() {} Ctoken(Pdtoken& t) : Token(t) {}; static int lookup_keyword(const string& s); void getnext(); }; int parse_lex(); #endif // CTOKEN
{ "pile_set_name": "Github" }
# AccessiWeb 2.2 - Rule 13.1.4 ## Summary No-check rule ## Business description Criterion : 13.1 Test : [13.1.4](http://www.accessiweb.org/index.php/accessiweb-22-english-version.html#test-13-1-4) Test description : For each Web page, does each server-side redirect process pass one of the conditions below ([except in special cases](http://www.accessiweb.org/index.php/glossary-76.html#cpCrit13-1 "Special cases for criterion 13.1"))? - The user can stop or restart the redirection - The user can increase the time limit before the redirection to at least ten times - The user is warned about the imminence of the redirection and has at least twenty seconds to increase the time limit before the next redirection - Time limit before redirection is at least twenty hours Level : Bronze ## Technical description Scope : page Decision level : semidecidable ## Algorithm ### Selection None ### Process None ### Analysis **Not Tested** ## Notes
{ "pile_set_name": "Github" }
<?php /*-------------------------------------------------------------------------------------------------------------| www.vdm.io |------/ ____ ____ __ __ __ /\ _`\ /\ _`\ __ /\ \__ __/\ \ /\ \__ \ \,\L\_\ __ _ __ ___ ___ ___ ___ \ \ \/\ \/\_\ ____\ \ ,_\ _ __ /\_\ \ \____ __ __\ \ ,_\ ___ _ __ \/_\__ \ /'__`\/\`'__\/' __` __`\ / __`\ /' _ `\ \ \ \ \ \/\ \ /',__\\ \ \/ /\`'__\/\ \ \ '__`\/\ \/\ \\ \ \/ / __`\/\`'__\ /\ \L\ \/\ __/\ \ \/ /\ \/\ \/\ \/\ \L\ \/\ \/\ \ \ \ \_\ \ \ \/\__, `\\ \ \_\ \ \/ \ \ \ \ \L\ \ \ \_\ \\ \ \_/\ \L\ \ \ \/ \ `\____\ \____\\ \_\ \ \_\ \_\ \_\ \____/\ \_\ \_\ \ \____/\ \_\/\____/ \ \__\\ \_\ \ \_\ \_,__/\ \____/ \ \__\ \____/\ \_\ \/_____/\/____/ \/_/ \/_/\/_/\/_/\/___/ \/_/\/_/ \/___/ \/_/\/___/ \/__/ \/_/ \/_/\/___/ \/___/ \/__/\/___/ \/_/ /------------------------------------------------------------------------------------------------------------------------------------/ @version 2.0.x @created 22nd October, 2015 @package Sermon Distributor @subpackage default.php @author Llewellyn van der Merwe <https://www.vdm.io/> @copyright Copyright (C) 2015. All Rights Reserved @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html A sermon distributor that links to Dropbox. /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file defined('_JEXEC') or die('Restricted access'); // load tooltip behavior JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_sermondistributor&task=help_documents.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> <script type="text/javascript"> Joomla.orderTable = function() { table = document.getElementById("sortTable"); direction = document.getElementById("directionTable"); order = table.options[table.selectedIndex].value; if (order != '<?php echo $this->listOrder; ?>') { dirn = 'asc'; } else { dirn = direction.options[direction.selectedIndex].value; } Joomla.tableOrdering(order, dirn, ''); } </script> <form action="<?php echo JRoute::_('index.php?option=com_sermondistributor&view=help_documents'); ?>" method="post" name="adminForm" id="adminForm"> <?php if(!empty( $this->sidebar)): ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif; ?> <?php if (empty($this->items)): ?> <?php echo $this->loadTemplate('toolbar');?> <div class="alert alert-no-items"> <?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> </div> <?php else : ?> <?php echo $this->loadTemplate('toolbar');?> <table class="table table-striped" id="help_documentList"> <thead><?php echo $this->loadTemplate('head');?></thead> <tfoot><?php echo $this->loadTemplate('foot');?></tfoot> <tbody><?php echo $this->loadTemplate('body');?></tbody> </table> <?php //Load the batch processing form. ?> <?php if ($this->canCreate && $this->canEdit) : ?> <?php echo JHtml::_( 'bootstrap.renderModal', 'collapseModal', array( 'title' => JText::_('COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') ); ?> <?php endif; ?> <input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" /> <input type="hidden" name="boxchecked" value="0" /> </div> <?php endif; ?> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </form>
{ "pile_set_name": "Github" }
.App { text-align: center; } .App-header { background-color: #282c34; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: calc(10px + 2vmin); color: white; } .App-link { font-size: calc(30px + 2vmin); color: #2f90bc; font-weight: 100; } .App-link:hover, .App-link:focus { color: #00afff; } .App-link strong { font-weight: 400; } h1 { margin: 0; padding: 0; } h2 { margin-bottom: 0; padding: 0; font-size: calc(10px + 2vmin); font-weight: 200; } .file { font-size: calc(6px + 1vmin); color: #faa; display: block; } .components div { margin: 1vmin; float: left; } .React-logo { animation: React-logo-spin infinite 20s linear; height: 40vmin; } .Yarn-cat { animation: Yarn-cat-move infinite 2s ease; height: 40vmin; position: relative; margin-left: -20vmin; margin-top: 7.5vmin; } @keyframes React-logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes Yarn-cat-move { 0% { transform: translateX(0%); } 50% { transform: translateX(20%); } 100% { transform: translateX(0%); } }
{ "pile_set_name": "Github" }
package reflect2 import ( "reflect" "unsafe" ) type safeSliceType struct { safeType } func (type2 *safeSliceType) SetIndex(obj interface{}, index int, value interface{}) { val := reflect.ValueOf(obj).Elem() elem := reflect.ValueOf(value).Elem() val.Index(index).Set(elem) } func (type2 *safeSliceType) UnsafeSetIndex(obj unsafe.Pointer, index int, value unsafe.Pointer) { panic("does not support unsafe operation") } func (type2 *safeSliceType) GetIndex(obj interface{}, index int) interface{} { val := reflect.ValueOf(obj).Elem() elem := val.Index(index) ptr := reflect.New(elem.Type()) ptr.Elem().Set(elem) return ptr.Interface() } func (type2 *safeSliceType) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer { panic("does not support unsafe operation") } func (type2 *safeSliceType) MakeSlice(length int, cap int) interface{} { val := reflect.MakeSlice(type2.Type, length, cap) ptr := reflect.New(val.Type()) ptr.Elem().Set(val) return ptr.Interface() } func (type2 *safeSliceType) UnsafeMakeSlice(length int, cap int) unsafe.Pointer { panic("does not support unsafe operation") } func (type2 *safeSliceType) Grow(obj interface{}, newLength int) { oldCap := type2.Cap(obj) oldSlice := reflect.ValueOf(obj).Elem() delta := newLength - oldCap deltaVals := make([]reflect.Value, delta) newSlice := reflect.Append(oldSlice, deltaVals...) oldSlice.Set(newSlice) } func (type2 *safeSliceType) UnsafeGrow(ptr unsafe.Pointer, newLength int) { panic("does not support unsafe operation") } func (type2 *safeSliceType) Append(obj interface{}, elem interface{}) { val := reflect.ValueOf(obj).Elem() elemVal := reflect.ValueOf(elem).Elem() newVal := reflect.Append(val, elemVal) val.Set(newVal) } func (type2 *safeSliceType) UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer) { panic("does not support unsafe operation") } func (type2 *safeSliceType) SetNil(obj interface{}) { val := reflect.ValueOf(obj).Elem() val.Set(reflect.Zero(val.Type())) } func (type2 *safeSliceType) UnsafeSetNil(ptr unsafe.Pointer) { panic("does not support unsafe operation") } func (type2 *safeSliceType) LengthOf(obj interface{}) int { return reflect.ValueOf(obj).Elem().Len() } func (type2 *safeSliceType) UnsafeLengthOf(ptr unsafe.Pointer) int { panic("does not support unsafe operation") } func (type2 *safeSliceType) Cap(obj interface{}) int { return reflect.ValueOf(obj).Elem().Cap() } func (type2 *safeSliceType) UnsafeCap(ptr unsafe.Pointer) int { panic("does not support unsafe operation") }
{ "pile_set_name": "Github" }
package com.tencent.wstt.gt; parcelable PerfDigitalEntry;
{ "pile_set_name": "Github" }
//#lagom-immutables libraryDependencies += lagomJavadslImmutables //#lagom-immutables //#lagom-immutables-lombok val lombok = "org.projectlombok" % "lombok" % "1.18.8" libraryDependencies += lombok //#lagom-immutables-lombok
{ "pile_set_name": "Github" }
package com.shejiaomao.weibo.service.cache.wrap; public abstract class Wrap<T> { /** 命中数 **/ private int hit; private boolean isLocalCached = false; public abstract T getWrap(); public abstract void setWrap(T t); public int getHit() { return hit; } public void setHit(int hit) { this.hit = hit; } public void hit() { hit++; } public boolean isLocalCached() { return isLocalCached; } public void setLocalCached(boolean isLocalCached) { this.isLocalCached = isLocalCached; } }
{ "pile_set_name": "Github" }
/*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <limits.h> #include <errno.h> #include <ctype.h> #include <stdlib.h> /* * Convert a string to an unsigned long long integer. * * Assumes that the upper and lower case * alphabets and digits are each contiguous. */ unsigned long long strtoull(const char *nptr, char **endptr, int base) { const char *s; unsigned long long acc; char c; unsigned long long cutoff; int neg, any, cutlim; /* * See strtoq for comments as to the logic used. */ s = nptr; do { c = *s++; } while (isspace((unsigned char)c)); if (c == '-') { neg = 1; c = *s++; } else { neg = 0; if (c == '+') c = *s++; } if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X') && ((s[1] >= '0' && s[1] <= '9') || (s[1] >= 'A' && s[1] <= 'F') || (s[1] >= 'a' && s[1] <= 'f'))) { c = s[1]; s += 2; base = 16; } if (base == 0) base = c == '0' ? 8 : 10; acc = any = 0; if (base < 2 || base > 36) goto noconv; cutoff = ULLONG_MAX / base; cutlim = ULLONG_MAX % base; for ( ; ; c = *s++) { if (c >= '0' && c <= '9') c -= '0'; else if (c >= 'A' && c <= 'Z') c -= 'A' - 10; else if (c >= 'a' && c <= 'z') c -= 'a' - 10; else break; if (c >= base) break; if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; acc *= base; acc += c; } } if (any < 0) { acc = ULLONG_MAX; errno = ERANGE; } else if (!any) { noconv: errno = EINVAL; } else if (neg) acc = -acc; if (endptr != NULL) *endptr = (char *)(any ? s - 1 : nptr); return (acc); }
{ "pile_set_name": "Github" }
/*! * Bootstrap v2.0.1 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ .clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { display: table; content: ""; } .clearfix:after { clear: both; } article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } audio:not([controls]) { display: none; } html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } a:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } a:hover, a:active { outline: 0; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { max-width: 100%; height: auto; border: 0; -ms-interpolation-mode: bicubic; } button, input, select, textarea { margin: 0; font-size: 100%; vertical-align: middle; } button, input { *overflow: visible; line-height: normal; } button::-moz-focus-inner, input::-moz-focus-inner { padding: 0; border: 0; } button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; } input[type="search"] { -webkit-appearance: textfield; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; } input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } textarea { overflow: auto; vertical-align: top; } body { margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #333333; background-color: #ffffff; } a { color: #0088cc; text-decoration: none; } a:hover { color: #005580; text-decoration: underline; } p { margin: 0 0 9px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; } p small { font-size: 11px; color: #999999; } .lead { margin-bottom: 18px; font-size: 20px; font-weight: 200; line-height: 27px; } h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: bold; color: #333333; text-rendering: optimizelegibility; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-weight: normal; color: #999999; } h1 { font-size: 30px; line-height: 36px; } h1 small { font-size: 18px; } h2 { font-size: 24px; line-height: 36px; } h2 small { font-size: 18px; } h3 { line-height: 27px; font-size: 18px; } h3 small { font-size: 14px; } h4, h5, h6 { line-height: 18px; } h4 { font-size: 14px; } h4 small { font-size: 12px; } h5 { font-size: 12px; } h6 { font-size: 11px; color: #999999; text-transform: uppercase; } .page-header { padding-bottom: 17px; margin: 18px 0; border-bottom: 1px solid #eeeeee; } .page-header h1 { line-height: 1; } ul, ol { padding: 0; margin: 0 0 9px 25px; } ul ul, ul ol, ol ol, ol ul { margin-bottom: 0; } ul { list-style: disc; } ol { list-style: decimal; } li { line-height: 18px; } ul.unstyled, ol.unstyled { margin-left: 0; list-style: none; } dl { margin-bottom: 18px; } dt, dd { line-height: 18px; } dt { font-weight: bold; } dd { margin-left: 9px; } hr { margin: 18px 0; border: 0; border-top: 1px solid #eeeeee; border-bottom: 1px solid #ffffff; } strong { font-weight: bold; } em { font-style: italic; } .muted { color: #999999; } abbr { font-size: 90%; text-transform: uppercase; border-bottom: 1px dotted #ddd; cursor: help; } blockquote { padding: 0 0 0 15px; margin: 0 0 18px; border-left: 5px solid #eeeeee; } blockquote p { margin-bottom: 0; font-size: 16px; font-weight: 300; line-height: 22.5px; } blockquote small { display: block; line-height: 18px; color: #999999; } blockquote small:before { content: '\2014 \00A0'; } blockquote.pull-right { float: right; padding-left: 0; padding-right: 15px; border-left: 0; border-right: 5px solid #eeeeee; } blockquote.pull-right p, blockquote.pull-right small { text-align: right; } q:before, q:after, blockquote:before, blockquote:after { content: ""; } address { display: block; margin-bottom: 18px; line-height: 18px; font-style: normal; } small { font-size: 100%; } cite { font-style: normal; } code, pre { padding: 0 3px 2px; font-family: Menlo, Monaco, "Courier New", monospace; font-size: 12px; color: #333333; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } code { padding: 3px 4px; color: #d14; background-color: #f7f7f9; border: 1px solid #e1e1e8; } pre { display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; } pre.prettyprint { margin-bottom: 18px; } pre code { padding: 0; color: inherit; background-color: transparent; border: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .btn { display: inline-block; padding: 4px 10px 4px; margin-bottom: 0; font-size: 13px; line-height: 18px; color: #333333; text-align: center; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); vertical-align: middle; background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(top, #ffffff, #e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #ccc; border-bottom-color: #bbb; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); cursor: pointer; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); *margin-left: .3em; } .btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] { background-color: #e6e6e6; } .btn:active, .btn.active { background-color: #cccccc \9; } .btn:first-child { *margin-left: 0; } .btn:hover { color: #333333; text-decoration: none; background-color: #e6e6e6; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -ms-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; } .btn:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn.active, .btn:active { background-image: none; -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); background-color: #e6e6e6; background-color: #d9d9d9 \9; outline: 0; } .btn.disabled, .btn[disabled] { cursor: default; background-image: none; background-color: #e6e6e6; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-large { padding: 9px 14px; font-size: 15px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .btn-large [class^="icon-"] { margin-top: 1px; } .btn-small { padding: 5px 9px; font-size: 11px; line-height: 16px; } .btn-small [class^="icon-"] { margin-top: -1px; } .btn-mini { padding: 2px 6px; font-size: 11px; line-height: 14px; } .btn-primary, .btn-primary:hover, .btn-warning, .btn-warning:hover, .btn-danger, .btn-danger:hover, .btn-success, .btn-success:hover, .btn-info, .btn-info:hover, .btn-inverse, .btn-inverse:hover { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); color: #ffffff; } .btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-dark.active { color: rgba(255, 255, 255, 0.75); } .btn-primary { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { background-color: #0044cc; } .btn-primary:active, .btn-primary.active { background-color: #003399 \9; } .btn-warning { background-color: #faa732; background-image: -moz-linear-gradient(top, #fbb450, #f89406); background-image: -ms-linear-gradient(top, #fbb450, #f89406); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); background-image: -webkit-linear-gradient(top, #fbb450, #f89406); background-image: -o-linear-gradient(top, #fbb450, #f89406); background-image: linear-gradient(top, #fbb450, #f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); border-color: #f89406 #f89406 #ad6704; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] { background-color: #f89406; } .btn-warning:active, .btn-warning.active { background-color: #c67605 \9; } .btn-danger { background-color: #da4f49; background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); background-image: linear-gradient(top, #ee5f5b, #bd362f); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0); border-color: #bd362f #bd362f #802420; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-danger:hover, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] { background-color: #bd362f; } .btn-danger:active, .btn-danger.active { background-color: #942a25 \9; } .btn-success { background-color: #5bb75b; background-image: -moz-linear-gradient(top, #62c462, #51a351); background-image: -ms-linear-gradient(top, #62c462, #51a351); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); background-image: -webkit-linear-gradient(top, #62c462, #51a351); background-image: -o-linear-gradient(top, #62c462, #51a351); background-image: linear-gradient(top, #62c462, #51a351); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0); border-color: #51a351 #51a351 #387038; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] { background-color: #51a351; } .btn-success:active, .btn-success.active { background-color: #408140 \9; } .btn-info { background-color: #49afcd; background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); background-image: linear-gradient(top, #5bc0de, #2f96b4); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0); border-color: #2f96b4 #2f96b4 #1f6377; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] { background-color: #2f96b4; } .btn-info:active, .btn-info.active { background-color: #24748c \9; } .btn-inverse { background-color: #393939; background-image: -moz-linear-gradient(top, #454545, #262626); background-image: -ms-linear-gradient(top, #454545, #262626); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#454545), to(#262626)); background-image: -webkit-linear-gradient(top, #454545, #262626); background-image: -o-linear-gradient(top, #454545, #262626); background-image: linear-gradient(top, #454545, #262626); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#454545', endColorstr='#262626', GradientType=0); border-color: #262626 #262626 #000000; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-inverse:hover, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] { background-color: #262626; } .btn-inverse:active, .btn-inverse.active { background-color: #0c0c0c \9; } button.btn, input[type="submit"].btn { *padding-top: 2px; *padding-bottom: 2px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { padding: 0; border: 0; } button.btn.large, input[type="submit"].btn.large { *padding-top: 7px; *padding-bottom: 7px; } button.btn.small, input[type="submit"].btn.small { *padding-top: 3px; *padding-bottom: 3px; } [class^="icon-"], [class*=" icon-"] { display: inline-block; width: 14px; height: 14px; line-height: 14px; vertical-align: text-top; background-image: url("../img/glyphicons-halflings.png"); background-position: 14px 14px; background-repeat: no-repeat; *margin-right: .3em; } [class^="icon-"]:last-child, [class*=" icon-"]:last-child { *margin-left: 0; } .icon-white { background-image: url("../img/glyphicons-halflings-white.png"); } .icon-glass { background-position: 0 0; } .icon-music { background-position: -24px 0; } .icon-search { background-position: -48px 0; } .icon-envelope { background-position: -72px 0; } .icon-heart { background-position: -96px 0; } .icon-star { background-position: -120px 0; } .icon-star-empty { background-position: -144px 0; } .icon-user { background-position: -168px 0; } .icon-film { background-position: -192px 0; } .icon-th-large { background-position: -216px 0; } .icon-th { background-position: -240px 0; } .icon-th-list { background-position: -264px 0; } .icon-ok { background-position: -288px 0; } .icon-remove { background-position: -312px 0; } .icon-zoom-in { background-position: -336px 0; } .icon-zoom-out { background-position: -360px 0; } .icon-off { background-position: -384px 0; } .icon-signal { background-position: -408px 0; } .icon-cog { background-position: -432px 0; } .icon-trash { background-position: -456px 0; } .icon-home { background-position: 0 -24px; } .icon-file { background-position: -24px -24px; } .icon-time { background-position: -48px -24px; } .icon-road { background-position: -72px -24px; } .icon-download-alt { background-position: -96px -24px; } .icon-download { background-position: -120px -24px; } .icon-upload { background-position: -144px -24px; } .icon-inbox { background-position: -168px -24px; } .icon-play-circle { background-position: -192px -24px; } .icon-repeat { background-position: -216px -24px; } .icon-refresh { background-position: -240px -24px; } .icon-list-alt { background-position: -264px -24px; } .icon-lock { background-position: -287px -24px; } .icon-flag { background-position: -312px -24px; } .icon-headphones { background-position: -336px -24px; } .icon-volume-off { background-position: -360px -24px; } .icon-volume-down { background-position: -384px -24px; } .icon-volume-up { background-position: -408px -24px; } .icon-qrcode { background-position: -432px -24px; } .icon-barcode { background-position: -456px -24px; } .icon-tag { background-position: 0 -48px; } .icon-tags { background-position: -25px -48px; } .icon-book { background-position: -48px -48px; } .icon-bookmark { background-position: -72px -48px; } .icon-print { background-position: -96px -48px; } .icon-camera { background-position: -120px -48px; } .icon-font { background-position: -144px -48px; } .icon-bold { background-position: -167px -48px; } .icon-italic { background-position: -192px -48px; } .icon-text-height { background-position: -216px -48px; } .icon-text-width { background-position: -240px -48px; } .icon-align-left { background-position: -264px -48px; } .icon-align-center { background-position: -288px -48px; } .icon-align-right { background-position: -312px -48px; } .icon-align-justify { background-position: -336px -48px; } .icon-list { background-position: -360px -48px; } .icon-indent-left { background-position: -384px -48px; } .icon-indent-right { background-position: -408px -48px; } .icon-facetime-video { background-position: -432px -48px; } .icon-picture { background-position: -456px -48px; } .icon-pencil { background-position: 0 -72px; } .icon-map-marker { background-position: -24px -72px; } .icon-adjust { background-position: -48px -72px; } .icon-tint { background-position: -72px -72px; } .icon-edit { background-position: -96px -72px; } .icon-share { background-position: -120px -72px; } .icon-check { background-position: -144px -72px; } .icon-move { background-position: -168px -72px; } .icon-step-backward { background-position: -192px -72px; } .icon-fast-backward { background-position: -216px -72px; } .icon-backward { background-position: -240px -72px; } .icon-play { background-position: -264px -72px; } .icon-pause { background-position: -288px -72px; } .icon-stop { background-position: -312px -72px; } .icon-forward { background-position: -336px -72px; } .icon-fast-forward { background-position: -360px -72px; } .icon-step-forward { background-position: -384px -72px; } .icon-eject { background-position: -408px -72px; } .icon-chevron-left { background-position: -432px -72px; } .icon-chevron-right { background-position: -456px -72px; } .icon-plus-sign { background-position: 0 -96px; } .icon-minus-sign { background-position: -24px -96px; } .icon-remove-sign { background-position: -48px -96px; } .icon-ok-sign { background-position: -72px -96px; } .icon-question-sign { background-position: -96px -96px; } .icon-info-sign { background-position: -120px -96px; } .icon-screenshot { background-position: -144px -96px; } .icon-remove-circle { background-position: -168px -96px; } .icon-ok-circle { background-position: -192px -96px; } .icon-ban-circle { background-position: -216px -96px; } .icon-arrow-left { background-position: -240px -96px; } .icon-arrow-right { background-position: -264px -96px; } .icon-arrow-up { background-position: -289px -96px; } .icon-arrow-down { background-position: -312px -96px; } .icon-share-alt { background-position: -336px -96px; } .icon-resize-full { background-position: -360px -96px; } .icon-resize-small { background-position: -384px -96px; } .icon-plus { background-position: -408px -96px; } .icon-minus { background-position: -433px -96px; } .icon-asterisk { background-position: -456px -96px; } .icon-exclamation-sign { background-position: 0 -120px; } .icon-gift { background-position: -24px -120px; } .icon-leaf { background-position: -48px -120px; } .icon-fire { background-position: -72px -120px; } .icon-eye-open { background-position: -96px -120px; } .icon-eye-close { background-position: -120px -120px; } .icon-warning-sign { background-position: -144px -120px; } .icon-plane { background-position: -168px -120px; } .icon-calendar { background-position: -192px -120px; } .icon-random { background-position: -216px -120px; } .icon-comment { background-position: -240px -120px; } .icon-magnet { background-position: -264px -120px; } .icon-chevron-up { background-position: -288px -120px; } .icon-chevron-down { background-position: -313px -119px; } .icon-retweet { background-position: -336px -120px; } .icon-shopping-cart { background-position: -360px -120px; } .icon-folder-close { background-position: -384px -120px; } .icon-folder-open { background-position: -408px -120px; } .icon-resize-vertical { background-position: -432px -119px; } .icon-resize-horizontal { background-position: -456px -118px; } .btn-group { position: relative; *zoom: 1; *margin-left: .3em; } .btn-group:before, .btn-group:after { display: table; content: ""; } .btn-group:after { clear: both; } .btn-group:first-child { *margin-left: 0; } .btn-group + .btn-group { margin-left: 5px; } .btn-toolbar { margin-top: 9px; margin-bottom: 9px; } .btn-toolbar .btn-group { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; } .btn-group .btn { position: relative; float: left; margin-left: -1px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-group .btn:first-child { margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .btn-group .btn:last-child, .btn-group .dropdown-toggle { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .btn-group .btn.large:first-child { margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .btn-group .btn.large:last-child, .btn-group .large.dropdown-toggle { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } .btn-group .btn:hover, .btn-group .btn:focus, .btn-group .btn:active, .btn-group .btn.active { z-index: 2; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group .dropdown-toggle { padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); *padding-top: 5px; *padding-bottom: 5px; } .btn-group.open { *z-index: 1000; } .btn-group.open .dropdown-menu { display: block; margin-top: 1px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .btn-group.open .dropdown-toggle { background-image: none; -webkit-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn .caret { margin-top: 7px; margin-left: 0; } .btn:hover .caret, .open.btn-group .caret { opacity: 1; filter: alpha(opacity=100); } .btn-primary .caret, .btn-danger .caret, .btn-info .caret, .btn-success .caret, .btn-inverse .caret { border-top-color: #ffffff; opacity: 0.75; filter: alpha(opacity=75); } .btn-small .caret { margin-top: 4px; } .nav { margin-left: 0; margin-bottom: 18px; list-style: none; } .nav > li > a { display: block; } .nav > li > a:hover { text-decoration: none; background-color: #eeeeee; } .nav .nav-header { display: block; padding: 3px 15px; font-size: 11px; font-weight: bold; line-height: 18px; color: #999999; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-transform: uppercase; } .nav li + .nav-header { margin-top: 9px; } .nav-list { padding-left: 14px; padding-right: 14px; margin-bottom: 0; } .nav-list > li > a, .nav-list .nav-header { margin-left: -15px; margin-right: -15px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } .nav-list > li > a { padding: 3px 15px; } .nav-list .active > a, .nav-list .active > a:hover { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); background-color: #0088cc; } .nav-list [class^="icon-"] { margin-right: 2px; } .nav-tabs, .nav-pills { *zoom: 1; } .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after { display: table; content: ""; } .nav-tabs:after, .nav-pills:after { clear: both; } .nav-tabs > li, .nav-pills > li { float: left; } .nav-tabs > li > a, .nav-pills > li > a { padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: 14px; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { margin-bottom: -1px; } .nav-tabs > li > a { padding-top: 9px; padding-bottom: 9px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > .active > a, .nav-tabs > .active > a:hover { color: #555555; background-color: #ffffff; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; } .nav-pills > li > a { padding-top: 8px; padding-bottom: 8px; margin-top: 2px; margin-bottom: 2px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .nav-pills .active > a, .nav-pills .active > a:hover { color: #ffffff; background-color: #0088cc; } .nav-stacked > li { float: none; } .nav-stacked > li > a { margin-right: 0; } .nav-tabs.nav-stacked { border-bottom: 0; } .nav-tabs.nav-stacked > li > a { border: 1px solid #ddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .nav-tabs.nav-stacked > li:first-child > a { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs.nav-stacked > li:last-child > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .nav-tabs.nav-stacked > li > a:hover { border-color: #ddd; z-index: 2; } .nav-pills.nav-stacked > li > a { margin-bottom: 3px; } .nav-pills.nav-stacked > li:last-child > a { margin-bottom: 1px; } .nav-tabs .dropdown-menu, .nav-pills .dropdown-menu { margin-top: 1px; border-width: 1px; } .nav-pills .dropdown-menu { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .nav-tabs .dropdown-toggle .caret, .nav-pills .dropdown-toggle .caret { border-top-color: #0088cc; margin-top: 6px; } .nav-tabs .dropdown-toggle:hover .caret, .nav-pills .dropdown-toggle:hover .caret { border-top-color: #005580; } .nav-tabs .active .dropdown-toggle .caret, .nav-pills .active .dropdown-toggle .caret { border-top-color: #333333; } .nav > .dropdown.active > a:hover { color: #000000; cursor: pointer; } .nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > .open.active > a:hover { color: #ffffff; background-color: #999999; border-color: #999999; } .nav .open .caret, .nav .open.active .caret, .nav .open a:hover .caret { border-top-color: #ffffff; opacity: 1; filter: alpha(opacity=100); } .tabs-stacked .open > a:hover { border-color: #999999; } .tabbable { *zoom: 1; } .tabbable:before, .tabbable:after { display: table; content: ""; } .tabbable:after { clear: both; } .tab-content { overflow: hidden; } .tabs-below .nav-tabs, .tabs-right .nav-tabs, .tabs-left .nav-tabs { border-bottom: 0; } .tab-content > .tab-pane, .pill-content > .pill-pane { display: none; } .tab-content > .active, .pill-content > .active { display: block; } .tabs-below .nav-tabs { border-top: 1px solid #ddd; } .tabs-below .nav-tabs > li { margin-top: -1px; margin-bottom: 0; } .tabs-below .nav-tabs > li > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .tabs-below .nav-tabs > li > a:hover { border-bottom-color: transparent; border-top-color: #ddd; } .tabs-below .nav-tabs .active > a, .tabs-below .nav-tabs .active > a:hover { border-color: transparent #ddd #ddd #ddd; } .tabs-left .nav-tabs > li, .tabs-right .nav-tabs > li { float: none; } .tabs-left .nav-tabs > li > a, .tabs-right .nav-tabs > li > a { min-width: 74px; margin-right: 0; margin-bottom: 3px; } .tabs-left .nav-tabs { float: left; margin-right: 19px; border-right: 1px solid #ddd; } .tabs-left .nav-tabs > li > a { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .tabs-left .nav-tabs > li > a:hover { border-color: #eeeeee #dddddd #eeeeee #eeeeee; } .tabs-left .nav-tabs .active > a, .tabs-left .nav-tabs .active > a:hover { border-color: #ddd transparent #ddd #ddd; *border-right-color: #ffffff; } .tabs-right .nav-tabs { float: right; margin-left: 19px; border-left: 1px solid #ddd; } .tabs-right .nav-tabs > li > a { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .tabs-right .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #eeeeee #dddddd; } .tabs-right .nav-tabs .active > a, .tabs-right .nav-tabs .active > a:hover { border-color: #ddd #ddd #ddd transparent; *border-left-color: #ffffff; } @-webkit-keyframes progress-bar-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } } @-moz-keyframes progress-bar-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } } @keyframes progress-bar-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } } .progress { overflow: hidden; height: 18px; margin-bottom: 18px; background-color: #f7f7f7; background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: linear-gradient(top, #f5f5f5, #f9f9f9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0); -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .progress .bar { width: 0%; height: 18px; color: #ffffff; font-size: 12px; text-align: center; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #0e90d2; background-image: -moz-linear-gradient(top, #149bdf, #0480be); background-image: -ms-linear-gradient(top, #149bdf, #0480be); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); background-image: -webkit-linear-gradient(top, #149bdf, #0480be); background-image: -o-linear-gradient(top, #149bdf, #0480be); background-image: linear-gradient(top, #149bdf, #0480be); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0); -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: width 0.6s ease; -moz-transition: width 0.6s ease; -ms-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .bar { background-color: #62c462; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -webkit-background-size: 40px 40px; -moz-background-size: 40px 40px; -o-background-size: 40px 40px; background-size: 40px 40px; } .progress.active .bar { -webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-danger .bar { background-color: #dd514c; background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); background-image: linear-gradient(top, #ee5f5b, #c43c35); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); } .progress-danger.progress-striped .bar { background-color: #ee5f5b; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-success .bar { background-color: #5eb95e; background-image: -moz-linear-gradient(top, #62c462, #57a957); background-image: -ms-linear-gradient(top, #62c462, #57a957); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); background-image: -webkit-linear-gradient(top, #62c462, #57a957); background-image: -o-linear-gradient(top, #62c462, #57a957); background-image: linear-gradient(top, #62c462, #57a957); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); } .progress-success.progress-striped .bar { background-color: #62c462; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-info .bar { background-color: #4bb1cf; background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); background-image: -o-linear-gradient(top, #5bc0de, #339bb9); background-image: linear-gradient(top, #5bc0de, #339bb9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0); } .progress-info.progress-striped .bar { background-color: #5bc0de; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .dropdown { position: relative; } .dropdown-toggle { *margin-bottom: -3px; } .dropdown-toggle:active, .open .dropdown-toggle { outline: 0; } .caret { display: inline-block; width: 0; height: 0; text-indent: -99999px; *text-indent: 0; vertical-align: top; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid #000000; opacity: 0.3; filter: alpha(opacity=30); content: "\2193"; } .dropdown .caret { margin-top: 8px; margin-left: 2px; } .dropdown:hover .caret, .open.dropdown .caret { opacity: 1; filter: alpha(opacity=100); } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; float: left; display: none; min-width: 160px; _width: 160px; padding: 4px 0; margin: 0; list-style: none; background-color: #ffffff; border-color: #ccc; border-color: rgba(0, 0, 0, 0.2); border-style: solid; border-width: 1px; -webkit-border-radius: 0 0 5px 5px; -moz-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; *border-right-width: 2px; *border-bottom-width: 2px; } .dropdown-menu.bottom-up { top: auto; bottom: 100%; margin-bottom: 2px; } .dropdown-menu .divider { height: 1px; margin: 5px 1px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #ffffff; *width: 100%; *margin: -5px 0 5px; } .dropdown-menu a { display: block; padding: 3px 15px; clear: both; font-weight: normal; line-height: 18px; color: #555555; white-space: nowrap; } .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover { color: #ffffff; text-decoration: none; background-color: #0088cc; } .dropdown.open { *z-index: 1000; } .dropdown.open .dropdown-toggle { color: #ffffff; background: #ccc; background: rgba(0, 0, 0, 0.3); } .dropdown.open .dropdown-menu { display: block; } .typeahead { margin-top: 2px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.05); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .close { float: right; font-size: 20px; font-weight: bold; line-height: 18px; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover { color: #000000; text-decoration: none; opacity: 0.4; filter: alpha(opacity=40); cursor: pointer; } .pull-right { float: right; } .pull-left { float: left; } .hide { display: none; } .show { display: block; } .invisible { visibility: hidden; } .fade { -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -ms-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; opacity: 0; } .fade.in { opacity: 1; } .collapse { -webkit-transition: height 0.35s ease; -moz-transition: height 0.35s ease; -ms-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; position: relative; overflow: hidden; height: 0; } .collapse.in { height: auto; }
{ "pile_set_name": "Github" }
// (C) Copyright John Maddock 2007. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // This file is machine generated, do not edit by hand // Polynomial evaluation using second order Horners rule #ifndef BOOST_MATH_TOOLS_RAT_EVAL_15_HPP #define BOOST_MATH_TOOLS_RAT_EVAL_15_HPP namespace boost{ namespace math{ namespace tools{ namespace detail{ template <class T, class U, class V> inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V) { return static_cast<V>(0); } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V) { return static_cast<V>(a[0]) / static_cast<V>(b[0]); } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V) { return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0])); } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V) { return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0])); } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V) { return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0])); } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[4] * x2 + a[2]; t[1] = a[3] * x2 + a[1]; t[2] = b[4] * x2 + b[2]; t[3] = b[3] * x2 + b[1]; t[0] *= x2; t[2] *= x2; t[0] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[0]); t[1] *= x; t[3] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[2] *= z2; t[0] += static_cast<V>(a[4]); t[2] += static_cast<V>(b[4]); t[1] *= z; t[3] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[5] * x2 + a[3]; t[1] = a[4] * x2 + a[2]; t[2] = b[5] * x2 + b[3]; t[3] = b[4] * x2 + b[2]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[1]); t[1] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[1]); t[3] += static_cast<V>(b[0]); t[0] *= x; t[2] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z; t[2] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[6] * x2 + a[4]; t[1] = a[5] * x2 + a[3]; t[2] = b[6] * x2 + b[4]; t[3] = b[5] * x2 + b[3]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[2]); t[1] += static_cast<V>(a[1]); t[2] += static_cast<V>(b[2]); t[3] += static_cast<V>(b[1]); t[0] *= x2; t[2] *= x2; t[0] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[0]); t[1] *= x; t[3] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[2] *= z2; t[0] += static_cast<V>(a[6]); t[2] += static_cast<V>(b[6]); t[1] *= z; t[3] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[7] * x2 + a[5]; t[1] = a[6] * x2 + a[4]; t[2] = b[7] * x2 + b[5]; t[3] = b[6] * x2 + b[4]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[3]); t[1] += static_cast<V>(a[2]); t[2] += static_cast<V>(b[3]); t[3] += static_cast<V>(b[2]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[1]); t[1] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[1]); t[3] += static_cast<V>(b[0]); t[0] *= x; t[2] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z; t[2] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[8] * x2 + a[6]; t[1] = a[7] * x2 + a[5]; t[2] = b[8] * x2 + b[6]; t[3] = b[7] * x2 + b[5]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[3]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[3]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[2]); t[1] += static_cast<V>(a[1]); t[2] += static_cast<V>(b[2]); t[3] += static_cast<V>(b[1]); t[0] *= x2; t[2] *= x2; t[0] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[0]); t[1] *= x; t[3] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z2; t[2] *= z2; t[0] += static_cast<V>(a[8]); t[2] += static_cast<V>(b[8]); t[1] *= z; t[3] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[9] * x2 + a[7]; t[1] = a[8] * x2 + a[6]; t[2] = b[9] * x2 + b[7]; t[3] = b[8] * x2 + b[6]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[5]); t[1] += static_cast<V>(a[4]); t[2] += static_cast<V>(b[5]); t[3] += static_cast<V>(b[4]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[3]); t[1] += static_cast<V>(a[2]); t[2] += static_cast<V>(b[3]); t[3] += static_cast<V>(b[2]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[1]); t[1] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[1]); t[3] += static_cast<V>(b[0]); t[0] *= x; t[2] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[9]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[9]); t[0] *= z; t[2] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[10] * x2 + a[8]; t[1] = a[9] * x2 + a[7]; t[2] = b[10] * x2 + b[8]; t[3] = b[9] * x2 + b[7]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[5]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[3]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[3]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[2]); t[1] += static_cast<V>(a[1]); t[2] += static_cast<V>(b[2]); t[3] += static_cast<V>(b[1]); t[0] *= x2; t[2] *= x2; t[0] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[0]); t[1] *= x; t[3] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[9]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[9]); t[0] *= z2; t[2] *= z2; t[0] += static_cast<V>(a[10]); t[2] += static_cast<V>(b[10]); t[1] *= z; t[3] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[11] * x2 + a[9]; t[1] = a[10] * x2 + a[8]; t[2] = b[11] * x2 + b[9]; t[3] = b[10] * x2 + b[8]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[7]); t[1] += static_cast<V>(a[6]); t[2] += static_cast<V>(b[7]); t[3] += static_cast<V>(b[6]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[5]); t[1] += static_cast<V>(a[4]); t[2] += static_cast<V>(b[5]); t[3] += static_cast<V>(b[4]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[3]); t[1] += static_cast<V>(a[2]); t[2] += static_cast<V>(b[3]); t[3] += static_cast<V>(b[2]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[1]); t[1] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[1]); t[3] += static_cast<V>(b[0]); t[0] *= x; t[2] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[9]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[9]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[10]); t[1] += static_cast<V>(a[11]); t[2] += static_cast<V>(b[10]); t[3] += static_cast<V>(b[11]); t[0] *= z; t[2] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[12] * x2 + a[10]; t[1] = a[11] * x2 + a[9]; t[2] = b[12] * x2 + b[10]; t[3] = b[11] * x2 + b[9]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[7]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[5]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[3]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[3]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[2]); t[1] += static_cast<V>(a[1]); t[2] += static_cast<V>(b[2]); t[3] += static_cast<V>(b[1]); t[0] *= x2; t[2] *= x2; t[0] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[0]); t[1] *= x; t[3] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[9]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[9]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[10]); t[1] += static_cast<V>(a[11]); t[2] += static_cast<V>(b[10]); t[3] += static_cast<V>(b[11]); t[0] *= z2; t[2] *= z2; t[0] += static_cast<V>(a[12]); t[2] += static_cast<V>(b[12]); t[1] *= z; t[3] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[13] * x2 + a[11]; t[1] = a[12] * x2 + a[10]; t[2] = b[13] * x2 + b[11]; t[3] = b[12] * x2 + b[10]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[9]); t[1] += static_cast<V>(a[8]); t[2] += static_cast<V>(b[9]); t[3] += static_cast<V>(b[8]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[7]); t[1] += static_cast<V>(a[6]); t[2] += static_cast<V>(b[7]); t[3] += static_cast<V>(b[6]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[5]); t[1] += static_cast<V>(a[4]); t[2] += static_cast<V>(b[5]); t[3] += static_cast<V>(b[4]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[3]); t[1] += static_cast<V>(a[2]); t[2] += static_cast<V>(b[3]); t[3] += static_cast<V>(b[2]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[1]); t[1] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[1]); t[3] += static_cast<V>(b[0]); t[0] *= x; t[2] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[9]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[9]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[10]); t[1] += static_cast<V>(a[11]); t[2] += static_cast<V>(b[10]); t[3] += static_cast<V>(b[11]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[12]); t[1] += static_cast<V>(a[13]); t[2] += static_cast<V>(b[12]); t[3] += static_cast<V>(b[13]); t[0] *= z; t[2] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } template <class T, class U, class V> inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*) BOOST_MATH_NOEXCEPT(V) { if(x <= 1) { V x2 = x * x; V t[4]; t[0] = a[14] * x2 + a[12]; t[1] = a[13] * x2 + a[11]; t[2] = b[14] * x2 + b[12]; t[3] = b[13] * x2 + b[11]; t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[10]); t[1] += static_cast<V>(a[9]); t[2] += static_cast<V>(b[10]); t[3] += static_cast<V>(b[9]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[7]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[5]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[3]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[3]); t[0] *= x2; t[1] *= x2; t[2] *= x2; t[3] *= x2; t[0] += static_cast<V>(a[2]); t[1] += static_cast<V>(a[1]); t[2] += static_cast<V>(b[2]); t[3] += static_cast<V>(b[1]); t[0] *= x2; t[2] *= x2; t[0] += static_cast<V>(a[0]); t[2] += static_cast<V>(b[0]); t[1] *= x; t[3] *= x; return (t[0] + t[1]) / (t[2] + t[3]); } else { V z = 1 / x; V z2 = 1 / (x * x); V t[4]; t[0] = a[0] * z2 + a[2]; t[1] = a[1] * z2 + a[3]; t[2] = b[0] * z2 + b[2]; t[3] = b[1] * z2 + b[3]; t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[4]); t[1] += static_cast<V>(a[5]); t[2] += static_cast<V>(b[4]); t[3] += static_cast<V>(b[5]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[6]); t[1] += static_cast<V>(a[7]); t[2] += static_cast<V>(b[6]); t[3] += static_cast<V>(b[7]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[8]); t[1] += static_cast<V>(a[9]); t[2] += static_cast<V>(b[8]); t[3] += static_cast<V>(b[9]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[10]); t[1] += static_cast<V>(a[11]); t[2] += static_cast<V>(b[10]); t[3] += static_cast<V>(b[11]); t[0] *= z2; t[1] *= z2; t[2] *= z2; t[3] *= z2; t[0] += static_cast<V>(a[12]); t[1] += static_cast<V>(a[13]); t[2] += static_cast<V>(b[12]); t[3] += static_cast<V>(b[13]); t[0] *= z2; t[2] *= z2; t[0] += static_cast<V>(a[14]); t[2] += static_cast<V>(b[14]); t[1] *= z; t[3] *= z; return (t[0] + t[1]) / (t[2] + t[3]); } } }}}} // namespaces #endif // include guard
{ "pile_set_name": "Github" }
using NUnit.Framework; using Python.Runtime; using System; using System.Linq; using System.Threading; namespace Python.EmbeddingTest { public class TestFinalizer { private int _oldThreshold; [SetUp] public void SetUp() { _oldThreshold = Finalizer.Instance.Threshold; PythonEngine.Initialize(); Exceptions.Clear(); } [TearDown] public void TearDown() { Finalizer.Instance.Threshold = _oldThreshold; PythonEngine.Shutdown(); } private static void FullGCCollect() { GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); GC.WaitForPendingFinalizers(); } [Test] public void CollectBasicObject() { Assert.IsTrue(Finalizer.Instance.Enable); Finalizer.Instance.Threshold = 1; bool called = false; var objectCount = 0; EventHandler<Finalizer.CollectArgs> handler = (s, e) => { objectCount = e.ObjectCount; called = true; }; Assert.IsFalse(called, "The event handler was called before it was installed"); Finalizer.Instance.CollectOnce += handler; WeakReference shortWeak; WeakReference longWeak; { MakeAGarbage(out shortWeak, out longWeak); } FullGCCollect(); // The object has been resurrected Warn.If( shortWeak.IsAlive, "The referenced object is alive although it should have been collected", shortWeak ); Assert.IsTrue( longWeak.IsAlive, "The reference object is not alive although it should still be", longWeak ); { var garbage = Finalizer.Instance.GetCollectedObjects(); Assert.NotZero(garbage.Count, "There should still be garbage around"); Warn.Unless( garbage.Any(T => ReferenceEquals(T.Target, longWeak.Target)), $"The {nameof(longWeak)} reference doesn't show up in the garbage list", garbage ); } try { Finalizer.Instance.Collect(); } finally { Finalizer.Instance.CollectOnce -= handler; } Assert.IsTrue(called, "The event handler was not called during finalization"); Assert.GreaterOrEqual(objectCount, 1); } [Test] public void CollectOnShutdown() { MakeAGarbage(out var shortWeak, out var longWeak); FullGCCollect(); var garbage = Finalizer.Instance.GetCollectedObjects(); Assert.IsNotEmpty(garbage); PythonEngine.Shutdown(); garbage = Finalizer.Instance.GetCollectedObjects(); Assert.IsEmpty(garbage); } private static void MakeAGarbage(out WeakReference shortWeak, out WeakReference longWeak) { PyLong obj = new PyLong(1024); shortWeak = new WeakReference(obj); longWeak = new WeakReference(obj, true); obj = null; } private static long CompareWithFinalizerOn(PyObject pyCollect, bool enbale) { // Must larger than 512 bytes make sure Python use string str = new string('1', 1024); Finalizer.Instance.Enable = true; FullGCCollect(); FullGCCollect(); pyCollect.Invoke(); Finalizer.Instance.Collect(); Finalizer.Instance.Enable = enbale; // Estimate unmanaged memory size long before = Environment.WorkingSet - GC.GetTotalMemory(true); for (int i = 0; i < 10000; i++) { // Memory will leak when disable Finalizer new PyString(str); } FullGCCollect(); FullGCCollect(); pyCollect.Invoke(); if (enbale) { Finalizer.Instance.Collect(); } FullGCCollect(); FullGCCollect(); long after = Environment.WorkingSet - GC.GetTotalMemory(true); return after - before; } /// <summary> /// Because of two vms both have their memory manager, /// this test only prove the finalizer has take effect. /// </summary> [Test] [Ignore("Too many uncertainties, only manual on when debugging")] public void SimpleTestMemory() { bool oldState = Finalizer.Instance.Enable; try { using (PyObject gcModule = PythonEngine.ImportModule("gc")) using (PyObject pyCollect = gcModule.GetAttr("collect")) { long span1 = CompareWithFinalizerOn(pyCollect, false); long span2 = CompareWithFinalizerOn(pyCollect, true); Assert.Less(span2, span1); } } finally { Finalizer.Instance.Enable = oldState; } } class MyPyObject : PyObject { public MyPyObject(IntPtr op) : base(op) { } protected override void Dispose(bool disposing) { base.Dispose(disposing); GC.SuppressFinalize(this); throw new Exception("MyPyObject"); } internal static void CreateMyPyObject(IntPtr op) { Runtime.Runtime.XIncref(op); new MyPyObject(op); } } [Test] public void ErrorHandling() { bool called = false; var errorMessage = ""; EventHandler<Finalizer.ErrorArgs> handleFunc = (sender, args) => { called = true; errorMessage = args.Error.Message; }; Finalizer.Instance.Threshold = 1; Finalizer.Instance.ErrorHandler += handleFunc; try { WeakReference shortWeak; WeakReference longWeak; { MakeAGarbage(out shortWeak, out longWeak); var obj = (PyLong)longWeak.Target; IntPtr handle = obj.Handle; shortWeak = null; longWeak = null; MyPyObject.CreateMyPyObject(handle); obj.Dispose(); obj = null; } FullGCCollect(); Finalizer.Instance.Collect(); Assert.IsTrue(called); } finally { Finalizer.Instance.ErrorHandler -= handleFunc; } Assert.AreEqual(errorMessage, "MyPyObject"); } [Test] public void ValidateRefCount() { if (!Finalizer.Instance.RefCountValidationEnabled) { Assert.Pass("Only run with FINALIZER_CHECK"); } IntPtr ptr = IntPtr.Zero; bool called = false; Finalizer.IncorrectRefCntHandler handler = (s, e) => { called = true; Assert.AreEqual(ptr, e.Handle); Assert.AreEqual(2, e.ImpactedObjects.Count); // Fix for this test, don't do this on general environment Runtime.Runtime.XIncref(e.Handle); return false; }; Finalizer.Instance.IncorrectRefCntResolver += handler; try { ptr = CreateStringGarbage(); FullGCCollect(); Assert.Throws<Finalizer.IncorrectRefCountException>(() => Finalizer.Instance.Collect()); Assert.IsTrue(called); } finally { Finalizer.Instance.IncorrectRefCntResolver -= handler; } } private static IntPtr CreateStringGarbage() { PyString s1 = new PyString("test_string"); // s2 steal a reference from s1 PyString s2 = new PyString(s1.Handle); return s1.Handle; } } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- import os import ssl import sys import time import socket import optparse import platform import subprocess DEFAULT_TIMEOUT = 60.0 DEFAULT_SOCKET_TIMEOUT = 5.0 PYTHON = sys.executable CUR_FILE = os.path.abspath(__file__) def get_opt_map(values_obj): attr_names = set(dir(values_obj)) - set(dir(optparse.Values())) return dict([(an, getattr(values_obj, an)) for an in attr_names]) def parse_args(): prs = optparse.OptionParser() prs.add_option('--host') prs.add_option('--port') prs.add_option('--wrap-ssl', action='store_true') prs.add_option('--timeout') prs.add_option('--socket-timeout') prs.add_option('--want-response', action='store_true') prs.add_option('--child', action='store_true') opts, args = prs.parse_args() return get_opt_map(opts), args def get_data(): return sys.stdin.read() def send_data_child(data, host, port=None, wrap_ssl=None, timeout=None, socket_timeout=None, want_response=False, response_stream=None): timeout = DEFAULT_TIMEOUT if timeout is None else float(timeout) if not response_stream: response_stream = sys.stdout if not host: raise ValueError('expected host, not %r' % host) if not port: # default to HTTP(S) ports if wrap_ssl: port = 443 else: port = 80 else: port = int(port) start_time = time.time() max_time = start_time + timeout sock = socket.socket() if wrap_ssl: sock = ssl.wrap_socket(sock) sock.settimeout(socket_timeout) sock.connect((host, port)) sock.sendall(data) if not want_response: return while 1: data = sock.recv(4096) if not data: break response_stream.write(data) response_stream.flush() if time.time() > max_time: break return if 'windows' in platform.system().lower(): def spawn_process(*args, **kwargs): return subprocess.Popen(*args, **kwargs) else: import signal PROCS = [] def spawn_process(*args, **kwargs): proc = subprocess.Popen(*args, **kwargs) PROCS.append(proc) return proc def reap_processes(signo, frame): global PROCS PROCS = [proc for proc in PROCS if proc.poll() is None] if not PROCS: signal.signal(signal.SIGCHLD, orig_disposition) if callable(orig_disposition): orig_disposition(signo, frame) orig_disposition = signal.signal(signal.SIGCHLD, reap_processes) def send_data(data, host, port=None, wrap_ssl=None, timeout=None, socket_timeout=None, want_response=False): cmd_tokens = [PYTHON, CUR_FILE, '--child', '--host', host] if port: cmd_tokens += ['--port', str(port)] if want_response: cmd_tokens += ['--want-response'] if timeout is not None: cmd_tokens += ['--timeout', str(timeout)] if socket_timeout is not None: cmd_tokens += ['--socket-timeout', str(socket_timeout)] if wrap_ssl: cmd_tokens += ['--wrap-ssl'] proc = spawn_process(cmd_tokens, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if want_response: return proc.communicate(input=data) else: proc.stdin.write(data) proc.stdin.flush() proc.stdin.close() return None, None def main(): opts, args = parse_args() data = get_data() kwargs = dict(opts) is_child = kwargs.pop('child', False) if is_child: send_data_child(data, **kwargs) else: #kwargs['want_response'] = True # TODO stdout, stderr = send_data(data, **kwargs) if stdout: print stdout if stderr: print 'stderr:', stderr if __name__ == '__main__': main()
{ "pile_set_name": "Github" }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file is autogenerated by // base/android/jni_generator/jni_generator.py // For // org/chromium/TestJni #ifndef org_chromium_TestJni_JNI #define org_chromium_TestJni_JNI #include <jni.h> #include "base/android/jni_generator/jni_generator_helper.h" #include "base/android/jni_int_wrapper.h" // Step 1: forward declarations. namespace { const char kTestJniClassPath[] = "org/chromium/TestJni"; const char kMyInnerClassClassPath[] = "org/chromium/TestJni$MyInnerClass"; // Leaking this jclass as we cannot use LazyInstance from some threads. base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0; #define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz) // Leaking this jclass as we cannot use LazyInstance from some threads. base::subtle::AtomicWord g_MyInnerClass_clazz __attribute__((unused)) = 0; #define MyInnerClass_clazz(env) base::android::LazyGetClass(env, kMyInnerClassClassPath, &g_MyInnerClass_clazz) } // namespace // Step 2: method stubs. static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& jcaller); extern "C" __attribute__((visibility("default"))) jint Java_org_chromium_TestJni_00024MyInnerClass_nativeInit(JNIEnv* env, jobject jcaller) { return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); } // Step 3: RegisterNatives. static const JNINativeMethod kMethodsMyInnerClass[] = { { "nativeInit", "(" ")" "I", reinterpret_cast<void*>(Java_org_chromium_TestJni_00024MyInnerClass_nativeInit) }, }; static bool RegisterNativesImpl(JNIEnv* env) { if (base::android::IsManualJniRegistrationDisabled()) return true; const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass); if (env->RegisterNatives(MyInnerClass_clazz(env), kMethodsMyInnerClass, kMethodsMyInnerClassSize) < 0) { jni_generator::HandleRegistrationError( env, MyInnerClass_clazz(env), __FILE__); return false; } return true; } #endif // org_chromium_TestJni_JNI
{ "pile_set_name": "Github" }
#include <iostream> #include <thread> #include <vector> #include "TCPEpollServer.h" #include "IQuestProcessor.h" #include "TaskThreadPool.h" #include "msec.h" #include "Setting.h" using namespace std; using namespace fpnn; class QuestProcessor: public IQuestProcessor { QuestProcessorClassPrivateFields(QuestProcessor) TaskThreadPool _delayAnswerPool; std::atomic<bool> _running; vector<thread> threads; public: //will be exec after server startup virtual void start() { /* Start User Thread here*/ threads.push_back(thread(&QuestProcessor::myThread2,this)); } //called before server exit virtual void serverWillStop() { _running = false; } //call after server exit virtual void serverStopped() { } // virtual void connected(const ConnectionInfo&) { cout<<"server connected."<<endl; } virtual void connectionWillClose(const ConnectionInfo&, bool closeByError) { if (!closeByError) cout<<"server close event processed."<<endl; else cout<<"server error event processed."<<endl; } virtual FPAnswerPtr unknownMethod(const std::string& method_name, const FPReaderPtr args, const FPQuestPtr quest, const ConnectionInfo& ci) { cout<<"received a unknown method"<<endl; return IQuestProcessor::unknownMethod(method_name, args, quest, ci); } //-- oneway FPAnswerPtr demoOneway(const FPReaderPtr args, const FPQuestPtr quest, const ConnectionInfo& ci) { cout<<"One way method demo is called. socket: "<<ci.socket<<", address: "<<ci.ip<<":"<<ci.port<<endl; cout<<"quest data: "<<(quest->json())<<endl; //do something return NULL; } //-- twoway FPAnswerPtr demoTwoway(const FPReaderPtr args, const FPQuestPtr quest, const ConnectionInfo& ci) { cout<<"Two way method demo is called. socket: "<<ci.socket<<", address: "<<ci.ip<<":"<<ci.port<<endl; cout<<"quest data: "<<(quest->json())<<endl; cout<<"get=>quest:"<<args->get("quest", string(""))<<endl; cout<<"get=>int:"<<args->get("int", (int)0)<<endl; cout<<"get=>double:"<<args->get("double", (double)0)<<endl; cout<<"get=>boolean:"<<args->get("boolean", (bool)0)<<endl; tuple<string, int> tup; tup = args->get("ARRAY", tup); cout<<"get=>array_tuple:"<<std::get<0>(tup)<<" "<<std::get<1>(tup)<<endl; OBJECT obj = args->getObject("MAP"); FPReader fpr(obj); cout<<"map1=>"<<fpr.get("map1",string(""))<<endl; cout<<"map2=>"<<fpr.get("map2",(bool)false)<<endl; cout<<"map3=>"<<fpr.get("map3",(int)0)<<endl; cout<<"map4=>"<<fpr.get("map4",(double)0.0)<<endl; cout<<"map5=>"<<fpr.get("map5",string(""))<<endl; try{ cout<<"WANT:"<<fpr.want("map4", (double)0.0)<<endl; cout<<"WANT:"<<fpr.want("map4", string(""))<<endl; } catch(...){ cout<<"EXECPTION: double value, but want string value"<<endl; } //Do some thing // //return FPAWriter aw(6, quest); aw.param("answer", "one"); aw.param("int", 2); aw.param("double", 3.3); aw.param("boolean", true); aw.paramArray("ARRAY",2); aw.param(make_tuple ("tuple1", 3.1, 14, false)); aw.param(make_tuple ("tuple2", 5.7, 9, true)); aw.paramMap("MAP",5); aw.param("m1","first_map"); aw.param("m2",true); aw.param("m3",5); aw.param("m4",5.7); aw.param("m5","中文2"); return aw.take(); } FPAnswerPtr demoAdvanceAnswer(const FPReaderPtr args, const FPQuestPtr quest, const ConnectionInfo& ci) { //std::string* data = new std::string("advance answer quest answer"); //FPAnswer *answer = new FPAnswer(data, quest.seqNumLE()); FPAnswerPtr answer = FPAWriter::emptyAnswer(quest); bool sent = sendAnswer(quest, answer); if (sent) cout<<"answer advance quest success. socket: "<<ci.socket<<", address: "<<ci.ip<<":"<<ci.port<<endl; else cout<<"answer advance quest failed. socket: "<<ci.socket<<", address: "<<ci.ip<<":"<<ci.port<<endl; cout<<"quest data: "<<(quest->json())<<endl; return NULL; } FPAnswerPtr demoDelayAnswer(const FPReaderPtr args, const FPQuestPtr quest, const ConnectionInfo& ci) { int delay = 5; cout<<"Delay answer demo is called. will answer after "<<delay<<" seconds. socket: "<<ci.socket<<", address: "<<ci.ip<<":"<<ci.port<<endl; cout<<"quest data: "<<(quest->json())<<endl; std::shared_ptr<IAsyncAnswer> async = genAsyncAnswer(quest); _delayAnswerPool.wakeUp([delay, async](){ sleep(delay); //std::string* data = new std::string("Delay answer quest answer"); FPAnswerPtr answer = FPAWriter::emptyAnswer(async->getQuest()); async->sendAnswer(answer); }); ; return NULL; } void myThread1(){ cout<<"Start myThread1"<<endl; while(_running){ sleep(1); } } void myThread2(){ cout<<"Start myThread2"<<endl; while(_running){ sleep(1); } } QuestProcessor():_running(true) { registerMethod("one way demo", &QuestProcessor::demoOneway); registerMethod("two way demo", &QuestProcessor::demoTwoway); registerMethod("advance answer demo", &QuestProcessor::demoAdvanceAnswer); registerMethod("delay answer demo", &QuestProcessor::demoDelayAnswer); _delayAnswerPool.init(5, 1, 10, 20); threads.push_back(thread(&QuestProcessor::myThread1,this)); } ~QuestProcessor(){ for(unsigned int i=0; i<threads.size();++i){ threads[i].join(); } } QuestProcessorClassBasicPublicFuncs }; int main(int argc, char* argv[]) { if (argc != 2) { cout<<"Usage: "<<argv[0]<<" config"<<endl; return 0; } if(!Setting::load(argv[1])){ cout<<"Config file error:"<< argv[1]<<endl; return 1; } ServerPtr server = TCPEpollServer::create(); server->setQuestProcessor(std::make_shared<QuestProcessor>()); server->startup(); server->run(); return 0; }
{ "pile_set_name": "Github" }
<?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsList; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * @property TaskQueuesStatisticsList $statistics */ class TaskQueueList extends ListResource { protected $_statistics = null; /** * Construct the TaskQueueList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues'; } /** * Streams TaskQueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TaskQueueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskQueueInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TaskQueueInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TaskQueuePage Page of TaskQueueInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): TaskQueuePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'EvaluateWorkerAttributes' => $options['evaluateWorkerAttributes'], 'WorkerSid' => $options['workerSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TaskQueuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskQueueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TaskQueuePage Page of TaskQueueInstance */ public function getPage(string $targetUrl): TaskQueuePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskQueuePage($this->version, $response, $this->solution); } /** * Create the TaskQueueInstance * * @param string $friendlyName A string to describe the resource * @param array|Options $options Optional Arguments * @return TaskQueueInstance Created TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): TaskQueueInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'TargetWorkers' => $options['targetWorkers'], 'MaxReservedWorkers' => $options['maxReservedWorkers'], 'TaskOrder' => $options['taskOrder'], 'ReservationActivitySid' => $options['reservationActivitySid'], 'AssignmentActivitySid' => $options['assignmentActivitySid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskQueueInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Access the statistics */ protected function getStatistics(): TaskQueuesStatisticsList { if (!$this->_statistics) { $this->_statistics = new TaskQueuesStatisticsList($this->version, $this->solution['workspaceSid']); } return $this->_statistics; } /** * Constructs a TaskQueueContext * * @param string $sid The SID of the resource to */ public function getContext(string $sid): TaskQueueContext { return new TaskQueueContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.TaskQueueList]'; } }
{ "pile_set_name": "Github" }
{% if not model.builtIn %}{% eol %} {% doc_comment_if model.description %} {% noeol %} public class {{ model.safeClassName }} {%if not model.parent %} : Google.Apis.Requests.IDirectResponseSchema {% endif %} {% endnoeol %} { {% indent %} {% for property in model.properties %} {% doc_comment_if property.description %} {% if property.codeType == 'System.Nullable<System.DateTime>' %} [Newtonsoft.Json.JsonPropertyAttribute({% literal property.wireName %})] public virtual string {{ property.memberName }}Raw { get; set; }{% eol %} /// <summary><seealso cref="System.DateTime"/> representation of <see cref="{{ property.memberName }}Raw"/>.</summary> [Newtonsoft.Json.JsonIgnore] public virtual {{ property.codeType }} {{ property.memberName }} { get { return Google.Apis.Util.Utilities.GetDateTimeFromString({{ property.memberName }}Raw); } set { {{ property.memberName }}Raw = Google.Apis.Util.Utilities.GetStringFromDateTime(value); } }{% eol %} {% else %} [Newtonsoft.Json.JsonPropertyAttribute({% literal property.wireName %})] {% noeol %} public virtual {{ property.codeType }} {% if property.wireName == 'etag' and not model.parent %} ETag {% else %} {{ property.memberName }} {% endif %} { get; set; } {% eol %} {% endnoeol %} {% endif %} {% endfor %} {%if not model.hasEtagProperty and not model.parent %}/// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } {% endif %} {% endindent %} {% for child in model.children %}{% indent %}{% call_template _model model=child %}{% endindent %}{% endfor %} }{% endif %}
{ "pile_set_name": "Github" }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // if not in a browser, assume we're in a test, return a dummy if (typeof window === "undefined") exports.browser = {}; else exports.browser = require("webextension-polyfill");
{ "pile_set_name": "Github" }
/* Copyright 2017 The Kubernetes Authors. 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. */ // Package meta contains the meta description of the GCE cloud types to // generate code for. package meta
{ "pile_set_name": "Github" }
-- boundary1.test -- -- db eval { -- SELECT a FROM t1 WHERE rowid <= 268435455 ORDER BY a -- } SELECT a FROM t1 WHERE rowid <= 268435455 ORDER BY a
{ "pile_set_name": "Github" }
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *) pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
{ "pile_set_name": "Github" }
1.0.1 / 2015-05-05 ------------------ - standard formatting 1.0.0 / 2015-01-14 ------------------ - updated dev deps - added more test fixtures - updated readme with usage, testing, etc - moved from https://github.com/cryptocoinjs/ripemd160 to https://github.com/crypto-browserify/ripemd160 0.2.1 / 2014-12-31 ------------------ - made license clear in `package.json` - deleted `Makefile`, moved targets to `package.json` - removed `terst` for `assert` 0.2.0 / 2014-03-09 ------------------ * removed bower.json and component.json * changed 4 spacing to 2 * returns `Buffer` type now, input must be Array, Uint8Array, Buffer, or string * remove deps: `convert-hex` and `convert-string` 0.1.0 / 2013-11-20 ------------------ * changed package name * removed AMD support 0.0.2 / 2013-11-06 ------------------ * fixed component.json file 0.0.1 / 2013-11-03 ------------------ * initial release
{ "pile_set_name": "Github" }
<?php /** * This file is part of GameQ. * * GameQ is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * GameQ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ namespace GameQ\Protocols; /** * Minecraft Protocol Class * * Thanks to https://github.com/xPaw/PHP-Minecraft-Query for helping me realize this is * Gamespy 3 Protocol. Make sure you enable the items below for it to work. * * Information from original author: * Instructions * * Before using this class, you need to make sure that your server is running GS4 status listener. * * Look for those settings in server.properties: * * enable-query=true * query.port=25565 * * @package GameQ\Protocols * * @author Austin Bischoff <[email protected]> */ class Minecraft extends Gamespy3 { /** * String name of this protocol class * * @type string */ protected $name = 'minecraft'; /** * Longer string name of this protocol class * * @type string */ protected $name_long = "Minecraft"; /** * The client join link * * @type string */ protected $join_link = "minecraft://%s:%d/"; /** * Normalize settings for this protocol * * @type array */ protected $normalize = [ // General 'general' => [ // target => source 'dedicated' => 'dedicated', 'gametype' => 'game_id', 'hostname' => 'hostname', 'mapname' => 'map', 'maxplayers' => 'maxplayers', 'numplayers' => 'numplayers', 'password' => 'password', ], // Individual 'player' => [ 'name' => 'player', ], ]; }
{ "pile_set_name": "Github" }
{ "info" : { "version" : 1, "author" : "xcode" }, "properties" : { "filename" : "kitura.png" } }
{ "pile_set_name": "Github" }
// Copyright 2016 Yahoo Inc. // Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms. package com.yahoo.bard.webservice.data.cache import static com.yahoo.bard.webservice.config.BardFeatureFlag.DRUID_CACHE import static com.yahoo.bard.webservice.config.BardFeatureFlag.DRUID_CACHE_V2 import com.yahoo.bard.webservice.application.JerseyTestBinder import com.yahoo.bard.webservice.data.cache.HashDataCache.Pair import com.yahoo.bard.webservice.table.availability.AvailabilityTestingUtils import com.yahoo.bard.webservice.util.GroovyTestUtils import com.yahoo.bard.webservice.web.endpoints.DataServlet import org.joda.time.DateTime; import org.joda.time.Interval import net.spy.memcached.MemcachedClient import spock.lang.IgnoreIf import spock.lang.Specification import spock.lang.Unroll @IgnoreIf({!DRUID_CACHE.isOn()}) class MemcachedCacheSpec extends Specification { JerseyTestBinder jtb boolean cacheStatus boolean cacheV2Status def setup() { cacheStatus = DRUID_CACHE.isOn() cacheV2Status = DRUID_CACHE_V2.isOn() DRUID_CACHE.setOn(true) DRUID_CACHE_V2.setOn(false) // Create the test web container to test the resources jtb = new JerseyTestBinder(false, DataServlet.class) if (System.getenv("BUILD_NUMBER") != null) { // Only use real memcached client if in the CI environment jtb.dataCache = new HashDataCache<>(new MemDataCache<Pair<String, String>>()) } jtb.start() Interval interval = new Interval("2010-01-01/2500-12-31") AvailabilityTestingUtils.populatePhysicalTableCacheIntervals(jtb, interval) } def cleanup() { DRUID_CACHE.setOn(cacheStatus) DRUID_CACHE_V2.setOn(cacheV2Status) // Release the test web container assert jtb != null jtb.tearDown() } def "cache misses on error without invalidating"() { setup: "Give the cache a client that will throw an error in the middle of hits" MemcachedClient client = Mock(MemcachedClient) Pair<String, String> pair = new Pair<String, String>("key", "value"); client.get(_) >> pair >> { throw new RuntimeException() } >> pair HashDataCache cache = new HashDataCache<>(new MemDataCache<Pair<String, String>>(client)) when: "get a healthy object" String cacheValue = cache.get("key") then: cacheValue == pair.value when: "get an exception" cacheValue = cache.get("key") then: "return null (a cache miss)" cacheValue == null when: "get a good hit" cacheValue = cache.get("key") then: "hits continue" cacheValue == pair.value } @Unroll def "cache set and get #key"() { when: "set" DataCache<String> cache = (DataCache<String>) jtb.dataCache cache.set(key, value) cache.set(key2, value2) then: "get" cache.get(key) == value cache.get(key2) == value2 when: "update" cache.set(key, value2) cache.set(key2, value) then: "get" cache.get(key) == value2 cache.get(key2) == value where: key | key2 | value | value2 "key" | "key2" | "value" | "value2" "key\ufe01@" | "key\ufe02@" | "value\ufe01#" | "value\ufe02#" } @Unroll def "cache set and get #key with expiration version"() { when: "set" DataCache<String> cache = (DataCache<String>) jtb.dataCache cache.set(key, value, new DateTime().plusHours(5)) // Expires immediately cache.set(key2, value2, new DateTime()) then: "get" cache.get(key) == value !cache.get(key2) when: "update" cache.set(key, value2, new DateTime().plusHours(5)) cache.set(key2, value, new DateTime().plusHours(5)) then: "get" cache.get(key) == value2 cache.get(key2) == value where: key | key2 | value | value2 "key" | "key2" | "value" | "value2" "key\ufe01@" | "key\ufe02@" | "value\ufe01#" | "value\ufe02#" } @Unroll def "cache throws #exception.simpleName because #reason"() { setup: DataCache<String> cache = (DataCache<String>) jtb.dataCache cache.set(key, value) when: cache.get(key) then: thrown(exception) where: key | value | exception | reason null | null | Exception | "cache key is null" null | "value" | Exception | "cache key is null" } def "servlet caching"() { setup: assert jtb != null String response = """[ { "version" : "v1", "timestamp" : "2014-06-10T00:00:00.000Z", "event" : { "color" : "Baz", "width" : 9 } } ]""" String expected = """{ "rows":[{"dateTime":"2014-06-10 00:00:00.000","color|id":"Baz","color|desc":"","width":9}] }""" when: "initial request" jtb.druidWebService.jsonResponse = {response} String result = jtb.getHarness().target("data/shapes/day/color") .queryParam("metrics","width") .queryParam("dateTime","2014-06-10%2F2014-06-11") .request().get(String.class) then: "result should match" GroovyTestUtils.compareJson(result, expected) when: "Change druid result" jtb.druidWebService.jsonResponse = {"[]"} result = jtb.getHarness().target("data/shapes/day/color") .queryParam("metrics","width") .queryParam("dateTime","2014-06-10%2F2014-06-11") .request().get(String.class) then: "should read old result from cache" GroovyTestUtils.compareJson(result, expected) when: "force cache bypass" jtb.druidWebService.jsonResponse = {"[]"} expected = """{ "rows":[] }""" result = jtb.getHarness().target("data/shapes/day/color") .queryParam("metrics","width") .queryParam("dateTime","2014-06-10%2F2014-06-11") .queryParam("_cache","FALSE") .request().get(String.class) then: "should read new result" GroovyTestUtils.compareJson(result, expected) } }
{ "pile_set_name": "Github" }
# # specifying flor # # Tue Mar 14 16:41:37 JST 2017 # require 'spec_helper' describe Flor::Caller do before :all do @caller = Flor::Caller.new(nil) end describe '#call' do context 'ruby' do it 'calls basic ruby classes' do r = @caller.call( nil, { 'require' => 'unit/hooks/for_caller', 'class' => 'Romeo::Callee', '_path' => 'spec/' }, { 'point' => 'execute', 'm' => 1 }) expect(r).to eq([ { 'point' => 'receive', 'mm' => 2 } ]) end context 'on call error' do it 'returns a failed message' do r = @caller.call( nil, { 'require' => 'unit/hooks/for_caller', 'class' => 'Does::Not::Exist', '_path' => 'spec/' }, { 'point' => 'execute', 'm' => 1 }) expect(r.class).to eq(Array) expect(r.size).to eq(1) expect(r[0].keys.sort).to eq( %w[ error fm fpoint point ]) expect(r[0]['error']['kla']).to eq( 'NameError') expect(r[0]['error']['msg']).to match( /\Auninitialized constant (Kernel::)?Does\z/) end end context 'on error' do it 'returns a failed message' do r = @caller.call( nil, { 'require' => 'unit/hooks/for_caller', 'class' => 'Romeo::Failer', '_path' => 'spec/' }, { 'point' => 'execute', 'm' => 67 }) expect(r.class).to eq(Array) expect(r.size).to eq(1) expect(r[0].keys.sort).to eq(%w[ error fm fpoint point ]) expect(r[0]['error']['kla']).to eq('RuntimeError') expect(r[0]['error']['msg']).to eq('pure fail at m:67') end end end context 'external' do it 'calls basic scripts' do r = @caller.call( nil, { 'cmd' => 'python spec/unit/hooks/for_caller.py', '_path' => 'spec/' }, { 'point' => 'execute', 'payload' => { 'items' => 2 } }) expect( r ).to eq([ { 'point' => 'receive', 'payload' => { 'items' => 2, 'price' => 'CHF 5.00' } } ]) end it 'calls basic scripts (with arguments)' do r = @caller.call( nil, { 'cmd' => 'python spec/unit/hooks/for_caller.py "hello python"', '_path' => 'spec/' }, { 'point' => 'execute', 'payload' => { 'items' => 2 } }) expect( r ).to eq([ { 'argument' => 'hello python', 'point' => 'receive', 'payload' => { 'items' => 2, 'price' => 'CHF 5.00' } } ]) end it 'calls basic scripts (with env var)' do r = @caller.call( nil, { 'cmd' => 'ENV_VAR=hello python spec/unit/hooks/for_caller.py', '_path' => 'spec/' }, { 'point' => 'execute', 'payload' => { 'items' => 2 } }) expect( r ).to eq([ { 'env_var' => 'hello', 'point' => 'receive', 'payload' => { 'items' => 2, 'price' => 'CHF 5.00' } } ]) end context 'on call error' do it 'returns a failed message' do r = @caller.call( nil, { 'cmd' => 'cobra spec/unit/hooks/for_caller.py', '_path' => 'spec/' }, { 'point' => 'execute', 'payload' => { 'items' => 2 } }) expect(r.class).to eq(Array) expect(r.size).to eq(1) expect(r[0].keys.sort).to eq(%w[ error fm fpoint payload point ]) e = r[0]['error'] #pp e expect(e['kla']).to eq('Flor::Caller::WrappedSpawnError') expect(e['msg']).to match(/No such file or directory/) ed = e['details'] expect(ed[:cmd]).to eq('cobra spec/unit/hooks/for_caller.py') expect(ed[:pid]).to eq(nil) expect(ed[:timeout]).to eq(14) end end context 'on exit code != 1' do it 'returns a failed message' do r = @caller.call( nil, { 'cmd' => 'python spec/unit/hooks/no_such_caller.py', '_path' => 'spec/' }, { 'point' => 'execute', 'payload' => { 'items' => 2 } }) expect(r.class).to eq(Array) expect(r.size).to eq(1) expect(r[0].keys.sort).to eq(%w[ error fm fpoint payload point ]) e = r[0]['error'] #pp e expect(e['kla']).to eq('Flor::Caller::SpawnNonZeroExitError') expect(e['msg']).to match(/\A\(code: 2, pid: \d+\) /) expect(e['msg']).to match(/[Pp]ython: can't open file 'spec\/unit\//) expect(e['msg']).to match(/ \[Errno 2\] No such file or directory/) ed = e['details'] expect(ed[:cmd]).to eq('python spec/unit/hooks/no_such_caller.py') expect(ed[:pid]).to be_an(Integer) expect(ed[:timeout]).to eq(14) end end context 'on timeout' do it 'fails' do t0 = Time.now r = @caller.call( nil, { 'cmd' => 'ruby -e "sleep"', '_path' => 'spec/', 'timeout' => '2s' }, { 'point' => 'execute', 'payload' => {} }) expect(r.class).to eq(Array) expect(r.size).to eq(1) expect(r[0].keys.sort).to eq(%w[ error fm fpoint payload point ]) e = r[0]['error'] #pp e expect(e['kla'] ).to eq('Flor::Caller::WrappedSpawnError') expect(e['msg'] ).to eq('wrapped: Flor::Caller::TimeoutError: execution expired') ed = e['details'] pid = ed[:pid] expect(`ps -p #{pid}`.strip.split("\n").size).to eq(1) # ensure child process has vanished expect(ed[:cmd]).to eq('ruby -e "sleep"') expect(ed[:pid]).to be_an(Integer) expect(ed[:timeout]).to eq(2) expect(ed[:conf]['timeout']).to eq('2s') expect(ed[:cause] ).to eq( kla: 'Flor::Caller::TimeoutError', msg: 'execution expired') end end end end end
{ "pile_set_name": "Github" }
import sys,os target_prefix = sys.prefix for i in range(len(sys.argv)): a = sys.argv[i] if a=='--prefix': target_prefix=sys.argv[i+1] sp = a.split("--prefix=") if len(sp)==2: target_prefix=sp[1] sys.path.insert(0,os.path.join(target_prefix,'lib','python%i.%i' % sys.version_info[:2],'site-packages')) from numpy.distutils.core import Extension import sys sources = """ Src/sh3grd.f Src/shblda.f Src/shgeti.f Src/shgetnp.f Src/shgrid.f Src/shrot.f Src/shsetup.f Src/sh3val.f Src/sherr.f Src/shgetnp3.f Src/shgivens.f Src/shqshep.f Src/shseti.f Src/shstore3.f """.split() extra_link_args=[] if sys.platform=='darwin': extra_link_args = ['-bundle','-bundle_loader '+sys.prefix+'/bin/python'] ext1 = Extension(name = 'shgridmodule', extra_link_args=extra_link_args, sources = ['Src/shgridmodule.pyf',]+sources) if __name__ == "__main__": from numpy.distutils.core import setup setup(name = 'sh', ext_modules = [ext1,], packages = ['sh'], package_dir = {'sh': 'Lib', }, )
{ "pile_set_name": "Github" }
param( [Parameter()] [ValidateSet('Light','Dark')] [string]$theme = 'Dark' ) Write-Host "Updating PowerShell shortcuts on the Start Menu" $appdataFolder = $env:APPDATA $startFolder = resolve-path "$appdataFolder\Microsoft\Windows\Start Menu" $powerShellFolder = resolve-path "$startFolder\Programs\Windows PowerShell" Write-Host "Looking in $powerShellFolder" Write-Host $powerShellx86 = "$powerShellFolder\Windows PowerShell (x86).lnk" if (test-path $powerShellx86) { Write-Host "Updating $powerShellx86" .\Update-Link.ps1 $powerShellx86 $theme } else { Write-Warning "Didn't find $powerShellx86" } Write-Host $powerShell64 = "$powerShellFolder\Windows PowerShell.lnk" if (test-path $powerShell64) { Write-Host "Updating $powerShell64" .\Update-Link.ps1 $powerShell64 $theme } else { Write-Warning "Didn't find $powerShell64" }
{ "pile_set_name": "Github" }
/* * Copyright 2012 Google Inc. * * 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. */ package com.google.gwt.i18n.shared.impl.cldr; // DO NOT EDIT - GENERATED FROM CLDR AND ICU DATA /** * Implementation of DateTimeFormatInfo for the "nl" locale. */ public class DateTimeFormatInfoImpl_nl extends DateTimeFormatInfoImpl { @Override public String[] ampms() { return new String[] { "a.m.", "p.m." }; } @Override public String dateFormatFull() { return "EEEE d MMMM y"; } @Override public String dateFormatLong() { return "d MMMM y"; } @Override public String dateFormatMedium() { return "d MMM y"; } @Override public String dateFormatShort() { return "dd-MM-y"; } @Override public String dateTimeFull(String timePattern, String datePattern) { return datePattern + " 'om' " + timePattern; } @Override public String dateTimeLong(String timePattern, String datePattern) { return datePattern + " 'om' " + timePattern; } @Override public String[] erasFull() { return new String[] { "voor Christus", "na Christus" }; } @Override public String[] erasShort() { return new String[] { "v.Chr.", "n.Chr." }; } @Override public String formatMonthAbbrevDay() { return "d MMM"; } @Override public String formatMonthFullDay() { return "d MMMM"; } @Override public String formatMonthFullWeekdayDay() { return "EEEE d MMMM"; } @Override public String formatMonthNumDay() { return "d-M"; } @Override public String formatYearMonthAbbrev() { return "MMM y"; } @Override public String formatYearMonthAbbrevDay() { return "d MMM y"; } @Override public String formatYearMonthFull() { return "MMMM y"; } @Override public String formatYearMonthFullDay() { return "d MMMM y"; } @Override public String formatYearMonthNum() { return "M-y"; } @Override public String formatYearMonthNumDay() { return "d-M-y"; } @Override public String formatYearMonthWeekdayDay() { return "EEE d MMM y"; } @Override public String formatYearQuarterFull() { return "QQQQ y"; } @Override public String formatYearQuarterShort() { return "Q y"; } @Override public String[] monthsFull() { return new String[] { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" }; } @Override public String[] monthsShort() { return new String[] { "jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec." }; } @Override public String[] quartersFull() { return new String[] { "1e kwartaal", "2e kwartaal", "3e kwartaal", "4e kwartaal" }; } @Override public String[] quartersShort() { return new String[] { "K1", "K2", "K3", "K4" }; } @Override public String[] weekdaysFull() { return new String[] { "zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag" }; } @Override public String[] weekdaysNarrow() { return new String[] { "Z", "M", "D", "W", "D", "V", "Z" }; } @Override public String[] weekdaysShort() { return new String[] { "zo", "ma", "di", "wo", "do", "vr", "za" }; } }
{ "pile_set_name": "Github" }
///////////////////////////////////////////////////////////////////////////// // Name: src/msw/statbox.cpp // Purpose: wxStaticBox // Author: Julian Smart // Modified by: // Created: 04/01/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ // declarations // ============================================================================ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #if wxUSE_STATBOX #include "wx/statbox.h" #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/dcclient.h" #include "wx/dcmemory.h" #include "wx/image.h" #include "wx/sizer.h" #endif #include "wx/notebook.h" #include "wx/sysopt.h" #include "wx/msw/uxtheme.h" #include "wx/msw/private.h" #include "wx/msw/missing.h" #include "wx/msw/dc.h" // the values coincide with those in tmschema.h #define BP_GROUPBOX 4 #define GBS_NORMAL 1 #define TMT_FONT 210 // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- // ============================================================================ // implementation // ============================================================================ // ---------------------------------------------------------------------------- // wxStaticBox // ---------------------------------------------------------------------------- bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return false; if ( !MSWCreateControl(wxT("BUTTON"), label, pos, size) ) return false; #ifndef __WXWINCE__ if (!wxSystemOptions::IsFalse(wxT("msw.staticbox.optimized-paint"))) { Connect(wxEVT_PAINT, wxPaintEventHandler(wxStaticBox::OnPaint)); // Our OnPaint() completely erases our background, so don't do it in // WM_ERASEBKGND too to avoid flicker. SetBackgroundStyle(wxBG_STYLE_PAINT); } #endif // !__WXWINCE__ return true; } WXDWORD wxStaticBox::MSWGetStyle(long style, WXDWORD *exstyle) const { long styleWin = wxStaticBoxBase::MSWGetStyle(style, exstyle); // no need for it anymore, must be removed for wxRadioBox child // buttons to be able to repaint themselves styleWin &= ~WS_CLIPCHILDREN; if ( exstyle ) { #ifndef __WXWINCE__ // We may have children inside this static box, so use this style for // TAB navigation to work if we ever use IsDialogMessage() to implement // it (currently we don't because it's too buggy and implement TAB // navigation ourselves, but this could change in the future). *exstyle |= WS_EX_CONTROLPARENT; if (wxSystemOptions::IsFalse(wxT("msw.staticbox.optimized-paint"))) *exstyle |= WS_EX_TRANSPARENT; #endif } styleWin |= BS_GROUPBOX; return styleWin; } wxSize wxStaticBox::DoGetBestSize() const { wxSize best; // Calculate the size needed by the label int cx, cy; wxGetCharSize(GetHWND(), &cx, &cy, GetFont()); int wBox; GetTextExtent(GetLabelText(wxGetWindowText(m_hWnd)), &wBox, &cy); wBox += 3*cx; int hBox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); // If there is a sizer then the base best size is the sizer's minimum if (GetSizer() != NULL) { wxSize cm(GetSizer()->CalcMin()); best = ClientToWindowSize(cm); // adjust for a long label if needed best.x = wxMax(best.x, wBox); } // otherwise the best size falls back to the label size else { best = wxSize(wBox, hBox); } return best; } void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const { wxStaticBoxBase::GetBordersForSizer(borderTop, borderOther); // need extra space, don't know how much but this seems to be enough *borderTop += GetCharHeight()/3; } // all the hacks below are not necessary for WinCE #ifndef __WXWINCE__ WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { if ( nMsg == WM_NCHITTEST ) { // This code breaks some other processing such as enter/leave tracking // so it's off by default. static int s_useHTClient = -1; if (s_useHTClient == -1) s_useHTClient = wxSystemOptions::GetOptionInt(wxT("msw.staticbox.htclient")); if (s_useHTClient == 1) { int xPos = GET_X_LPARAM(lParam); int yPos = GET_Y_LPARAM(lParam); ScreenToClient(&xPos, &yPos); // Make sure you can drag by the top of the groupbox, but let // other (enclosed) controls get mouse events also if ( yPos < 10 ) return (long)HTCLIENT; } } if ( nMsg == WM_PRINTCLIENT ) { // we have to process WM_PRINTCLIENT ourselves as otherwise child // windows' background (eg buttons in radio box) would never be drawn // unless we have a parent with non default background // so check first if we have one if ( !HandlePrintClient((WXHDC)wParam) ) { // no, we don't, erase the background ourselves // (don't use our own) - see PaintBackground for explanation wxBrush brush(GetParent()->GetBackgroundColour()); wxFillRect(GetHwnd(), (HDC)wParam, GetHbrushOf(brush)); } return 0; } if ( nMsg == WM_UPDATEUISTATE ) { // DefWindowProc() redraws just the static box text when it gets this // message and it does it using the standard (blue in standard theme) // colour and not our own label colour that we use in PaintForeground() // resulting in the label mysteriously changing the colour when e.g. // "Alt" is pressed anywhere in the window, see #12497. // // To avoid this we simply refresh the window forcing our own code // redrawing the label in the correct colour to be called. This is // inefficient but there doesn't seem to be anything else we can do. // // Notice that the problem is XP-specific and doesn't arise under later // systems. if ( m_hasFgCol && wxGetWinVersion() == wxWinVersion_XP ) Refresh(); } return wxControl::MSWWindowProc(nMsg, wParam, lParam); } // ---------------------------------------------------------------------------- // static box drawing // ---------------------------------------------------------------------------- /* We draw the static box ourselves because it's the only way to prevent it from flickering horribly on resize (because everything inside the box is erased twice: once when the box itself is repainted and second time when the control inside it is repainted) without using WS_EX_TRANSPARENT style as we used to do and which resulted in other problems. */ // MSWGetRegionWithoutSelf helper: removes the given rectangle from region static inline void SubtractRectFromRgn(HRGN hrgn, int left, int top, int right, int bottom) { AutoHRGN hrgnRect(::CreateRectRgn(left, top, right, bottom)); if ( !hrgnRect ) { wxLogLastError(wxT("CreateRectRgn()")); return; } ::CombineRgn(hrgn, hrgn, hrgnRect, RGN_DIFF); } void wxStaticBox::MSWGetRegionWithoutSelf(WXHRGN hRgn, int w, int h) { HRGN hrgn = (HRGN)hRgn; // remove the area occupied by the static box borders from the region int borderTop, border; GetBordersForSizer(&borderTop, &border); // top SubtractRectFromRgn(hrgn, 0, 0, w, borderTop); // bottom SubtractRectFromRgn(hrgn, 0, h - border, w, h); // left SubtractRectFromRgn(hrgn, 0, 0, border, h); // right SubtractRectFromRgn(hrgn, w - border, 0, w, h); } namespace { RECT AdjustRectForRtl(wxLayoutDirection dir, RECT const& childRect, RECT const& boxRect) { RECT ret = childRect; if( dir == wxLayout_RightToLeft ) { // The clipping region too is mirrored in RTL layout. // We need to mirror screen coordinates relative to static box window priot to // intersecting with region. ret.right = boxRect.right - childRect.left - boxRect.left; ret.left = boxRect.right - childRect.right - boxRect.left; } return ret; } } WXHRGN wxStaticBox::MSWGetRegionWithoutChildren() { RECT boxRc; ::GetWindowRect(GetHwnd(), &boxRc); HRGN hrgn = ::CreateRectRgn(boxRc.left, boxRc.top, boxRc.right + 1, boxRc.bottom + 1); bool foundThis = false; // Iterate over all sibling windows as in the old wxWidgets API the // controls appearing inside the static box were created as its siblings // and not children. This is now deprecated but should still work. // // Also notice that we must iterate over all windows, not just all // wxWindows, as there may be composite windows etc. HWND child; for ( child = ::GetWindow(GetHwndOf(GetParent()), GW_CHILD); child; child = ::GetWindow(child, GW_HWNDNEXT) ) { if ( ! ::IsWindowVisible(child) ) { // if the window isn't visible then it doesn't need clipped continue; } LONG style = ::GetWindowLong(child, GWL_STYLE); wxString str(wxGetWindowClass(child)); str.UpperCase(); if ( str == wxT("BUTTON") && (style & BS_GROUPBOX) == BS_GROUPBOX ) { if ( child == GetHwnd() ) foundThis = true; // Any static boxes below this one in the Z-order can't be clipped // since if we have the case where a static box with a low Z-order // is nested inside another static box with a high Z-order then the // nested static box would be painted over. Doing it this way // unfortunately results in flicker if the Z-order of nested static // boxes is not inside (lowest) to outside (highest) but at least // they are still shown. if ( foundThis ) continue; } RECT rc; ::GetWindowRect(child, &rc); rc = AdjustRectForRtl(GetLayoutDirection(), rc, boxRc ); if ( ::RectInRegion(hrgn, &rc) ) { // need to remove WS_CLIPSIBLINGS from all sibling windows // that are within this staticbox if set if ( style & WS_CLIPSIBLINGS ) { style &= ~WS_CLIPSIBLINGS; ::SetWindowLong(child, GWL_STYLE, style); // MSDN: "If you have changed certain window data using // SetWindowLong, you must call SetWindowPos to have the // changes take effect." ::SetWindowPos(child, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); } AutoHRGN hrgnChild(::CreateRectRgnIndirect(&rc)); ::CombineRgn(hrgn, hrgn, hrgnChild, RGN_DIFF); } } // Also iterate over all children of the static box, we need to clip them // out as well. for ( child = ::GetWindow(GetHwnd(), GW_CHILD); child; child = ::GetWindow(child, GW_HWNDNEXT) ) { if ( !::IsWindowVisible(child) ) { // if the window isn't visible then it doesn't need clipped continue; } RECT rc; ::GetWindowRect(child, &rc); rc = AdjustRectForRtl(GetLayoutDirection(), rc, boxRc ); AutoHRGN hrgnChild(::CreateRectRgnIndirect(&rc)); ::CombineRgn(hrgn, hrgn, hrgnChild, RGN_DIFF); } return (WXHRGN)hrgn; } // helper for OnPaint(): really erase the background, i.e. do it even if we // don't have any non default brush for doing it (DoEraseBackground() doesn't // do anything in such case) void wxStaticBox::PaintBackground(wxDC& dc, const RECT& rc) { // note that we do not use the box background colour here, it shouldn't // apply to its interior for several reasons: // 1. wxGTK doesn't do it // 2. controls inside the box don't get correct bg colour because they // are not our children so we'd have some really ugly colour mix if // we did it // 3. this is backwards compatible behaviour and some people rely on it, // see http://groups.google.com/groups?selm=4252E932.3080801%40able.es wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl(); HBRUSH hbr = MSWGetBgBrush(impl->GetHDC()); // if there is no special brush for painting this control, just use the // solid background colour wxBrush brush; if ( !hbr ) { brush = wxBrush(GetParent()->GetBackgroundColour()); hbr = GetHbrushOf(brush); } ::FillRect(GetHdcOf(*impl), &rc, hbr); } void wxStaticBox::PaintForeground(wxDC& dc, const RECT&) { wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl(); MSWDefWindowProc(WM_PAINT, (WPARAM)GetHdcOf(*impl), 0); #if wxUSE_UXTHEME // when using XP themes, neither setting the text colour nor transparent // background mode doesn't change anything: the static box def window proc // still draws the label in its own colours, so we need to redraw the text // ourselves if we have a non default fg colour if ( m_hasFgCol && wxUxThemeEngine::GetIfActive() ) { // draw over the text in default colour in our colour HDC hdc = GetHdcOf(*impl); ::SetTextColor(hdc, GetForegroundColour().GetPixel()); // Get dimensions of the label const wxString label = GetLabel(); // choose the correct font AutoHFONT font; SelectInHDC selFont; if ( m_hasFont ) { selFont.Init(hdc, GetHfontOf(GetFont())); } else // no font set, use the one set by the theme { wxUxThemeHandle hTheme(this, L"BUTTON"); if ( hTheme ) { wxUxThemeFont themeFont; if ( wxUxThemeEngine::Get()->GetThemeFont ( hTheme, hdc, BP_GROUPBOX, GBS_NORMAL, TMT_FONT, themeFont.GetPtr() ) == S_OK ) { font.Init(themeFont.GetLOGFONT()); if ( font ) selFont.Init(hdc, font); } } } // Get the font extent int width, height; dc.GetTextExtent(wxStripMenuCodes(label, wxStrip_Mnemonics), &width, &height); int x; int y = height; // first we need to correctly paint the background of the label // as Windows ignores the brush offset when doing it // // FIXME: value of x is hardcoded as this is what it is on my system, // no idea if it's true everywhere RECT dimensions = {0, 0, 0, y}; x = 9; dimensions.left = x; dimensions.right = x + width; // need to adjust the rectangle to cover all the label background dimensions.left -= 2; dimensions.right += 2; dimensions.bottom += 2; if ( UseBgCol() ) { // our own background colour should be used for the background of // the label: this is consistent with the behaviour under pre-XP // systems (i.e. without visual themes) and generally makes sense wxBrush brush = wxBrush(GetBackgroundColour()); ::FillRect(hdc, &dimensions, GetHbrushOf(brush)); } else // paint parent background { PaintBackground(dc, dimensions); } UINT drawTextFlags = DT_SINGLELINE | DT_VCENTER; // determine the state of UI queues to draw the text correctly under XP // and later systems static const bool isXPorLater = wxGetWinVersion() >= wxWinVersion_XP; if ( isXPorLater ) { if ( ::SendMessage(GetHwnd(), WM_QUERYUISTATE, 0, 0) & UISF_HIDEACCEL ) { drawTextFlags |= DT_HIDEPREFIX; } } // now draw the text RECT rc2 = { x, 0, x + width, y }; ::DrawText(hdc, label.t_str(), label.length(), &rc2, drawTextFlags); } #endif // wxUSE_UXTHEME } void wxStaticBox::OnPaint(wxPaintEvent& WXUNUSED(event)) { RECT rc; ::GetClientRect(GetHwnd(), &rc); wxPaintDC dc(this); // draw the entire box in a memory DC wxMemoryDC memdc(&dc); wxBitmap bitmap(rc.right, rc.bottom); memdc.SelectObject(bitmap); PaintBackground(memdc, rc); PaintForeground(memdc, rc); // now only blit the static box border itself, not the interior, to avoid // flicker when background is drawn below // // note that it seems to be faster to do 4 small blits here and then paint // directly into wxPaintDC than painting background in wxMemoryDC and then // blitting everything at once to wxPaintDC, this is why we do it like this int borderTop, border; GetBordersForSizer(&borderTop, &border); // top dc.Blit(border, 0, rc.right - border, borderTop, &memdc, border, 0); // bottom dc.Blit(border, rc.bottom - border, rc.right - border, border, &memdc, border, rc.bottom - border); // left dc.Blit(0, 0, border, rc.bottom, &memdc, 0, 0); // right (note that upper and bottom right corners were already part of the // first two blits so we shouldn't overwrite them here to avoi flicker) dc.Blit(rc.right - border, borderTop, border, rc.bottom - borderTop - border, &memdc, rc.right - border, borderTop); // create the region excluding box children AutoHRGN hrgn((HRGN)MSWGetRegionWithoutChildren()); RECT rcWin; ::GetWindowRect(GetHwnd(), &rcWin); ::OffsetRgn(hrgn, -rcWin.left, -rcWin.top); // and also the box itself MSWGetRegionWithoutSelf((WXHRGN) hrgn, rc.right, rc.bottom); wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl(); HDCClipper clipToBg(GetHdcOf(*impl), hrgn); // paint the inside of the box (excluding box itself and child controls) PaintBackground(dc, rc); } #endif // !__WXWINCE__ #endif // wxUSE_STATBOX
{ "pile_set_name": "Github" }
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path d="M12 16c3.87 0 7-3.13 7-7s-3.13-7-7-7-7 3.13-7 7 3.13 7 7 7zm0-12c2.76 0 5 2.24 5 5s-2.24 5-5 5-5-2.24-5-5 2.24-5 5-5z" /><circle cx="10" cy="8" r="1" /><circle cx="14" cy="8" r="1" /><circle cx="12" cy="6" r="1" /><path d="M7 19h2c1.1 0 2 .9 2 2v1h2v-1c0-1.1.9-2 2-2h2v-2H7v2z" /></React.Fragment> , 'SportsGolfSharp');
{ "pile_set_name": "Github" }
import os from test_base import MainTestCase from main.views import show, form_photos, update_xform, profile, enketo_preview from django.core.urlresolvers import reverse from odk_logger.models import XForm from odk_logger.views import download_xlsform, download_jsonform,\ download_xform, delete_xform from odk_viewer.views import export_list, map_view from utils.user_auth import http_auth_string from odk_viewer.models import ParsedInstance class TestFormShow(MainTestCase): def setUp(self): MainTestCase.setUp(self) self._create_user_and_login() self._publish_transportation_form() self.url = reverse(show, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }) def test_show_form_name(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 200) self.assertContains(response, self.xform.id_string) def test_hide_from_anon(self): response = self.anon.get(self.url) self.assertEqual(response.status_code, 302) def test_hide_from_not_user(self): self._create_user_and_login("jo") response = self.client.get(self.url) self.assertEqual(response.status_code, 302) def test_show_to_anon_if_public(self): self.xform.shared = True self.xform.save() response = self.anon.get(self.url) self.assertEqual(response.status_code, 200) def test_dl_xlsx_xlsform(self): self._publish_xlsx_file() response = self.client.get(reverse(download_xlsform, kwargs={ 'username': self.user.username, 'id_string': 'exp_one' })) self.assertEqual(response.status_code, 200) self.assertEqual( response['Content-Disposition'], "attachment; filename=exp_one.xlsx") def test_dl_xls_to_anon_if_public(self): self.xform.shared = True self.xform.save() response = self.anon.get(reverse(download_xlsform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string })) self.assertEqual(response.status_code, 200) def test_dl_xls_for_basic_auth(self): extra = { 'HTTP_AUTHORIZATION': http_auth_string(self.login_username, self.login_password) } response = self.anon.get(reverse(download_xlsform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }), **extra) self.assertEqual(response.status_code, 200) def test_dl_json_to_anon_if_public(self): self.xform.shared = True self.xform.save() response = self.anon.get(reverse(download_jsonform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string })) self.assertEqual(response.status_code, 200) def test_dl_jsonp_to_anon_if_public(self): self.xform.shared = True self.xform.save() callback = 'jsonpCallback' response = self.anon.get(reverse(download_jsonform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }), {'callback': callback}) self.assertEqual(response.status_code, 200) self.assertEqual(response.content.startswith(callback + '('), True) self.assertEqual(response.content.endswith(')'), True) def test_dl_json_for_basic_auth(self): extra = { 'HTTP_AUTHORIZATION': http_auth_string(self.login_username, self.login_password) } response = self.anon.get(reverse(download_jsonform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }), **extra) self.assertEqual(response.status_code, 200) def test_dl_json_for_cors_options(self): response = self.anon.options(reverse(download_jsonform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string })) allowed_headers = ['Accept', 'Origin', 'X-Requested-With', 'Authorization'] control_headers = response['Access-Control-Allow-Headers'] provided_headers = [h.strip() for h in control_headers.split(',')] self.assertListEqual(allowed_headers, provided_headers) self.assertEqual(response['Access-Control-Allow-Methods'], 'GET') self.assertEqual(response['Access-Control-Allow-Origin'], '*') def test_dl_xform_to_anon_if_public(self): self.xform.shared = True self.xform.save() response = self.anon.get(reverse(download_xform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string })) self.assertEqual(response.status_code, 200) def test_dl_xform_for_basic_auth(self): extra = { 'HTTP_AUTHORIZATION': http_auth_string(self.login_username, self.login_password) } response = self.anon.get(reverse(download_xform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }), **extra) self.assertEqual(response.status_code, 200) def test_show_private_if_shared_but_not_data(self): self.xform.shared = True self.xform.save() response = self.anon.get(self.url) self.assertContains(response, 'PRIVATE') def test_show_link_if_shared_and_data(self): self.xform.shared = True self.xform.shared_data = True self.xform.save() self._submit_transport_instance() response = self.anon.get(self.url) self.assertContains(response, reverse(export_list, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string, 'export_type': 'csv' })) def test_show_link_if_owner(self): self._submit_transport_instance() response = self.client.get(self.url) self.assertContains(response, reverse(export_list, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string, 'export_type': 'csv' })) self.assertContains(response, reverse(export_list, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string, 'export_type': 'xls' })) self.assertNotContains(response, reverse(map_view, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string })) # check that a form with geopoints has the map url response = self._publish_xls_file( os.path.join( os.path.dirname(__file__), "fixtures", "gps", "gps.xls")) self.assertEqual(response.status_code, 200) self.xform = XForm.objects.latest('date_created') show_url = reverse(show, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }) map_url = reverse(map_view, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }) response = self.client.get(show_url) # check that map url doesnt show before we have submissions self.assertNotContains(response, map_url) # make a submission self._make_submission( os.path.join( os.path.dirname(__file__), "fixtures", "gps", "instances", "gps_1980-01-23_20-52-08.xml") ) self.assertEqual(self.response.status_code, 201) # get new show view response = self.client.get(show_url) self.assertContains(response, map_url) def test_user_sees_edit_btn(self): response = self.client.get(self.url) self.assertContains(response, 'edit</a>') def test_user_sees_settings(self): response = self.client.get(self.url) self.assertContains(response, 'Settings') def test_anon_no_edit_btn(self): self.xform.shared = True self.xform.save() response = self.anon.get(self.url) self.assertNotContains(response, 'edit</a>') def test_anon_no_toggle_data_share_btn(self): self.xform.shared = True self.xform.save() response = self.anon.get(self.url) self.assertNotContains(response, 'PUBLIC</a>') self.assertNotContains(response, 'PRIVATE</a>') def test_show_add_sourc_doc_if_owner(self): response = self.client.get(self.url) self.assertContains(response, 'Source document:') def test_show_add_supporting_docs_if_owner(self): response = self.client.get(self.url) self.assertContains(response, 'Supporting document:') def test_show_add_supporting_media_if_owner(self): response = self.client.get(self.url) self.assertContains(response, 'Media upload:') def test_show_add_mapbox_layer_if_owner(self): response = self.client.get(self.url) self.assertContains(response, 'JSONP url:') def test_hide_add_supporting_docs_if_not_owner(self): self.xform.shared = True self.xform.save() response = self.anon.get(self.url) self.assertNotContains(response, 'Upload') def test_load_photo_page(self): response = self.client.get(reverse(form_photos, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string})) self.assertEqual(response.status_code, 200) def test_load_from_uuid(self): self.xform = XForm.objects.get(pk=self.xform.id) response = self.client.get(reverse(show, kwargs={ 'uuid': self.xform.uuid})) self.assertEqual(response.status_code, 302) self.assertEqual(response['Location'], '%s%s' % (self.base_url, self.url)) def test_xls_replace_markup(self): """ Check that update form is only shown when there are no submissions and the user is the owner """ # when we have 0 submissions, update markup exists self.xform.shared = True self.xform.save() dashboard_url = reverse(profile, kwargs={ 'username': 'bob' }) response = self.client.get(dashboard_url) self.assertContains( response, 'href="#replace-transportation_2011_07_25"') # a non owner can't see the markup response = self.anon.get(self.url) self.assertNotContains( response, 'href="#replace-transportation_2011_07_25"') # when we have a submission, we cant update the xls form self._submit_transport_instance() response = self.client.get(dashboard_url) self.assertNotContains( response, 'href="#replace-transportation_2011_07_25"') def test_non_owner_cannot_replace_form(self): """ Test that a non owner cannot replace a shared xls form """ xform_update_url = reverse(update_xform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }) self.xform.shared = True self.xform.save() # create and login another user self._create_user_and_login('peter', 'peter') response = self.client.post(xform_update_url) # since we are logged in, we'll be re-directed to our profile page self.assertRedirects(response, self.base_url, status_code=302, target_status_code=302) def test_replace_xform(self): xform_update_url = reverse(update_xform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }) count = XForm.objects.count() xls_path = os.path.join(self.this_directory, "fixtures", "transportation", "transportation_updated.xls") with open(xls_path, "r") as xls_file: post_data = {'xls_file': xls_file} self.client.post(xform_update_url, post_data) self.assertEqual(XForm.objects.count(), count) self.xform = XForm.objects.order_by('id').reverse()[0] data_dictionary = self.xform.data_dictionary() # look for the preferred_means question # which is only in the updated xls is_updated_form = len([e.name for e in data_dictionary.survey_elements if e.name == u'preferred_means']) > 0 self.assertTrue(is_updated_form) def test_update_form_doesnt_truncate_to_50_chars(self): count = XForm.objects.count() xls_path = os.path.join( self.this_directory, "fixtures", "transportation", "transportation_with_long_id_string.xls") self._publish_xls_file_and_set_xform(xls_path) # Update the form xform_update_url = reverse(update_xform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }) updated_xls_path = os.path.join( self.this_directory, "fixtures", "transportation", "transportation_with_long_id_string_updated.xls") with open(updated_xls_path, "r") as xls_file: post_data = {'xls_file': xls_file} self.client.post(xform_update_url, post_data) # Count should stay the same self.assertEqual(XForm.objects.count(), count + 1) self.xform = XForm.objects.order_by('id').reverse()[0] data_dictionary = self.xform.data_dictionary() # look for the preferred_means question # which is only in the updated xls is_updated_form = len([e.name for e in data_dictionary.survey_elements if e.name == u'preferred_means']) > 0 self.assertTrue(is_updated_form) def test_xform_delete(self): id_string = self.xform.id_string form_exists = XForm.objects.filter( user=self.user, id_string=id_string).count() == 1 self.assertTrue(form_exists) xform_delete_url = reverse(delete_xform, kwargs={ 'username': self.user.username, 'id_string': id_string }) self.client.post(xform_delete_url) form_deleted = XForm.objects.filter( user=self.user, id_string=id_string).count() == 0 self.assertTrue(form_deleted) def test_non_owner_cant_delete_xform(self): id_string = self.xform.id_string form_exists = XForm.objects.filter( user=self.user, id_string=id_string).count() == 1 self.assertTrue(form_exists) xform_delete_url = reverse(delete_xform, kwargs={ 'username': self.user.username, 'id_string': id_string }) # save current user before we re-assign bob = self.user self._create_user_and_login('alice', 'alice') self.client.post(xform_delete_url) form_deleted = XForm.objects.filter( user=bob, id_string=id_string).count() == 0 self.assertFalse(form_deleted) def test_xform_delete_cascades_mongo_instances(self): initial_mongo_count = ParsedInstance.query_mongo( self.user.username, self.xform.id_string, '{}', '[]', '{}', count=True)[0]["count"] # submit instance for i in range(len(self.surveys)): self._submit_transport_instance(i) # check mongo record exists mongo_count = ParsedInstance.query_mongo( self.user.username, self.xform.id_string, '{}', '[]', '{}', count=True)[0]["count"] self.assertEqual(mongo_count, initial_mongo_count + len(self.surveys)) # delete form xform_delete_url = reverse(delete_xform, kwargs={ 'username': self.user.username, 'id_string': self.xform.id_string }) self.client.post(xform_delete_url) mongo_count = ParsedInstance.query_mongo( self.user.username, self.xform.id_string, '{}', '[]', '{}', count=True)[0]["count"] self.assertEqual(mongo_count, initial_mongo_count) def test_enketo_preview(self): url = reverse( enketo_preview, kwargs={'username': self.user.username, 'id_string': self.xform.id_string}) response = self.client.get(url) self.assertEqual(response.status_code, 302) def test_enketo_preview_works_on_shared_forms(self): self.xform.shared = True self.xform.save() url = reverse( enketo_preview, kwargs={'username': self.user.username, 'id_string': self.xform.id_string}) response = self.anon.get(url) self.assertEqual(response.status_code, 302) def test_form_urls_case_insensitive(self): url = reverse(show, kwargs={ 'username': self.user.username.upper(), 'id_string': self.xform.id_string.upper() }) response = self.client.get(url) self.assertEqual(response.status_code, 200)
{ "pile_set_name": "Github" }
`ResourceLoaderAware`接口是一个特殊的标记接口,用于标识期望获得ResourceLoader引用的对象。 ``` public interface ResourceLoaderAware { void setResourceLoader(ResourceLoader resourceLoader); } ``` 当一个类实现了`ResourceLoaderAware`且发布到应用程序上下文中(作为bean被Spring管理),它会被应用程序上下文识别为`ResourceLoadAware`。应用程序上下文会调用`setResourceLoader(ResourceLoader)`,将自身作为参数传入(请记住,Spring中所有的应用程序上下文都实现了`ResourceLoader`接口)。 当然,由于`ApplicationContext`是一个`ResourceLoader`,bean也可以实现`ApplicationContextAware`接口并直接使用提供的应用程序上下文来加载资源,但通常情况下,最好是特指出`ResourceLoader`接口(如果需要的话)。 从Spring 2.5开始,你可以依靠`ResourceLoader`的自动装配来替代实现`ResourceLoaderAware`接口。现在,“传统”构造函数和byType自动装配模式(如第7.4.5节“自动装配协作者”中所述)能够分别为构造函数参数或设置方法参数提供`ResourceLoader`类型的依赖关系。为了获得更大的灵活性(包括自动装配字段和多个参数方法的能力),请考虑使用新的基于注释的自动装配功能。在这种情况下,只要字段,构造函数或方法携带@Autowired注解,ResourceLoader就会被自动装载到期望`ResourceLoader`类型的字段,构造函数参数或方法参数中。更多信息,请见[6.9.2 "@Autowired"](https://docs.spring.io/spring/docs/4.3.12.RELEASE/spring-framework-reference/htmlsingle/#beans-autowired-annotation)。
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" and="text" et-al-min="3" et-al-use-first="1" demote-non-dropping-particle="sort-only" default-locale="en-GB"> <info> <title>Finance and Society</title> <title-short>FinSoc</title-short> <id>http://www.zotero.org/styles/finance-and-society</id> <link href="http://www.zotero.org/styles/finance-and-society" rel="self"/> <link href="http://www.zotero.org/styles/harvard-university-for-the-creative-arts" rel="template"/> <link href="http://financeandsociety.ed.ac.uk//pages/view/house-style" rel="documentation"/> <author> <name>Dave Elder-Vass</name> <email>[email protected]</email> </author> <category citation-format="author-date"/> <category field="generic-base"/> <eissn>2059-5999</eissn> <summary>Finance and Society journal style</summary> <updated>2020-09-23T02:37:13+00:00</updated> <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights> </info> <locale> <terms> <term name="accessed">accessed </term> <term name="no date" form="short">n.d.</term> </terms> </locale> <macro name="cite-author"> <choose> <if type="broadcast motion_picture legislation bill map legal_case" match="any"> <text variable="title" font-style="italic"/> </if> <else> <names variable="author"> <name and="text" delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1" initialize-with=". " name-as-sort-order="all"/> <label form="short" prefix=" "/> <et-al font-style="italic"/> <substitute> <text macro="editor"/> <text variable="container-title"/> <text variable="title" font-style="italic"/> </substitute> </names> </else> </choose> </macro> <macro name="year-date"> <choose> <if type="legislation" match="none"> <choose> <if type="legal_case" match="any"> <date variable="issued" prefix="(" suffix=")"> <date-part name="year"/> </date> </if> <else-if variable="issued"> <date variable="issued"> <date-part name="year"/> </date> </else-if> <else> <text term="no date" form="short"/> </else> </choose> </if> </choose> </macro> <macro name="primary-title"> <choose> <if type="chapter article-journal article-newspaper article-magazine paper-conference" match="any"> <text variable="title" prefix="" suffix="."/> <choose> <if match="any" variable="original-title"> <text variable="original-title" prefix="(" suffix=")."/> </if> </choose> </if> <else-if type="bill legal_case legislation motion_picture" match="any"> <text variable="collection-number"/> </else-if> <else-if type="entry-dictionary entry-encyclopedia" match="any"> <group delimiter=" "> <text variable="title" prefix="'" suffix="' definition."/> <choose> <if match="any" variable="URL"> <text term="online" prefix="[" suffix="]"/> </if> </choose> </group> </else-if> <else> <choose> <if type="broadcast map" match="none"> <group delimiter=" "> <group delimiter=" "> <text variable="title" font-style="italic" suffix="."/> <choose> <if match="any" variable="original-title"> <text variable="original-title" font-style="italic" prefix="(" suffix=")"/> </if> </choose> <choose> <if match="any" variable="volume"> <text term="volume" form="short" text-case="capitalize-first"/> <text variable="volume" text-case="uppercase" suffix="."/> </if> </choose> <text macro="edition-no"/> <group delimiter=": " suffix="."> <choose> <if type="song" match="any"> <text term="in" text-case="capitalize-first"/> <text variable="collection-title"/> <text variable="container-title"/> </if> </choose> </group> </group> </group> </if> </choose> </else> </choose> </macro> <macro name="genre-online-marker"> <choose> <if type="report thesis interview patent entry-dictionary" match="any"> <choose> <if variable="URL"> <choose> <if variable="genre"> <text variable="genre" prefix="[" suffix="]"/> </if> <else-if variable="medium"> <text variable="medium" prefix="[" suffix="]"/> </else-if> </choose> </if> <else-if type="thesis"> <text variable="genre" prefix="[" suffix="]"/> </else-if> </choose> </if> <else-if type="manuscript song post-weblog post" match="any"> <group delimiter=" "> <text variable="genre" prefix="[" suffix="]"/> <text variable="medium" prefix="[" suffix="]"/> </group> <text variable="dimensions" prefix=" " suffix="."/> </else-if> <else-if type="broadcast"/> <else-if type="graphic" match="any"> <group delimiter=" "> <text variable="genre"/> <text variable="medium" prefix="[" suffix="]"/> <text variable="dimensions" suffix="."/> <text variable="note" prefix=" " suffix="."/> <text variable="archive_location" prefix=" "/> </group> <text variable="archive" prefix=": " suffix="."/> </else-if> <else-if type="speech personal_communication" match="any"> <group delimiter=" " prefix="[" suffix="]."> <names variable="recipient" prefix="Email sent to "> <name and="text" delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1" initialize-with="." name-as-sort-order="all"/> </names> <text variable="genre" suffix=" "/> <text variable="event-place"/> <date delimiter=" " variable="issued"> <date-part name="day" form="numeric-leading-zeros"/> <date-part name="month" form="long"/> <date-part name="year"/> </date> </group> </else-if> </choose> </macro> <macro name="edition-no"> <choose> <if match="any" is-numeric="edition"> <group delimiter=" " prefix="(" suffix=")"> <number variable="edition" form="ordinal"/> <text term="edition" form="short"/> </group> </if> <else> <text variable="edition" prefix="(" suffix=")"/> </else> </choose> </macro> <macro name="translator"> <names variable="translator"> <label form="verb" text-case="capitalize-first"/> <name delimiter=". " prefix=" " suffix="." and="text" delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1" initialize-with="." name-as-sort-order="all"/> <et-al font-style="italic"/> </names> </macro> <macro name="bill-detail"> <choose> <if type="bill legislation" match="any"> <group delimiter=". " suffix="."> <names variable="author"> <name and="text" delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1" initialize-with="." name-as-sort-order="all"/> <et-al font-style="italic"/> </names> <text variable="section"/> </group> </if> </choose> </macro> <macro name="publisher"> <choose> <if match="any" variable="publisher"> <text variable="publisher"/> </if> <else-if match="any" variable="URL"/> <else> <text value="s.n." prefix=" (" suffix=")."/> </else> </choose> </macro> <macro name="publisher-place"> <choose> <if match="any" variable="publisher-place"> <text variable="publisher-place"/> </if> <else-if type="report entry-dictionary entry-encyclopedia motion_picture chapter speech song paper-conference article-journal book" match="all" variable="URL"> <text variable="publisher-place"/> </else-if> <else-if type="map motion_picture" match="any"/> <else> <text value="s.l." prefix="(" suffix=")"/> </else> </choose> </macro> <macro name="container"> <choose> <if type="entry-dictionary entry-encyclopedia paper-conference" match="any"> <group> <text term="in" text-case="capitalize-first" suffix=": "/> <text macro="editor"/> <group delimiter=", "> <group delimiter=" "> <text variable="container-title" font-style="italic" suffix="."/> <group delimiter=" " suffix="."> <text term="volume" form="short" text-case="capitalize-first"/> <text variable="volume" text-case="uppercase"/> </group> <choose> <if is-numeric="edition"> <group delimiter=" " prefix=" (" suffix=")"> <number variable="edition" form="ordinal"/> <text term="edition" form="short"/> </group> </if> <else> <text variable="edition" suffix="."/> </else> </choose> </group> </group> </group> </if> <else-if type="patent"> <text variable="number" suffix="."/> </else-if> <else-if type="motion_picture article broadcast" match="any"> <choose> <if match="any" variable="collection-title container-title"> <group suffix=" "> <text term="in" text-case="capitalize-first" suffix=": "/> <text variable="collection-title" font-style="italic" suffix="."/> <text variable="container-title" font-style="italic" suffix="."/> </group> </if> </choose> <names variable="author" prefix="Directed by "> <name suffix="." and="text" delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1" initialize-with="." name-as-sort-order="all"/> <et-al font-style="italic"/> </names> <text variable="medium" prefix=" [" suffix="] "/> </else-if> <else-if type="book" match="any"> <text variable="medium" prefix="[" suffix="]"/> </else-if> <else-if type="webpage" match="any"> <text variable="genre" prefix="[" suffix="]"/> <text variable="container-title" font-style="italic" suffix="."/> </else-if> <else-if type="article" match="any"/> <else-if type="map" match="any"> <group delimiter=" " prefix="[" suffix="]"> <text variable="collection-title"/> <text variable="genre"/> <text variable="scale"/> </group> </else-if> <else-if type="chapter" match="any"> <text term="in" text-case="capitalize-first" suffix=": "/> <text macro="editor"/> <text macro="translator"/> <text variable="container-title" font-style="italic" suffix="."/> <text macro="edition-no" prefix=" "/> </else-if> <else> <choose> <if variable="volume issue page" match="any" type="article-newspaper article-magazine article-journal"> <text variable="container-title" font-style="italic" prefix="" suffix=","/> </if> </choose> </else> </choose> </macro> <macro name="legal-detail"> <group delimiter=", "> <choose> <if type="legal_case"> <group> <text variable="volume" prefix=" "/> <text variable="authority" prefix=" (" suffix=")"/> </group> <group> <label variable="page" form="short"/> <text variable="page"/> </group> </if> </choose> </group> </macro> <macro name="locator"> <choose> <if type="article-journal article-newspaper article-magazine interview" match="any"> <group delimiter=" "> <group> <text variable="volume"/> <text variable="issue" prefix="(" suffix="):"/> </group> <choose> <if type="article-magazine interview article-newspaper" match="any"> <date delimiter=" " variable="issued"> <date-part name="day" form="numeric-leading-zeros"/> <date-part name="month" form="long" suffix="."/> </date> </if> </choose> <choose> <if variable="page"> <group> <text variable="page" suffix="."/> </group> </if> </choose> </group> </if> <else-if type="book chapter paper-conference entry-dictionary entry-encyclopedia motion_picture report article map song" match="any"> <group delimiter=". "> <text variable="event"/> <group delimiter=": " suffix="."> <text macro="publisher-place"/> <text macro="publisher"/> </group> <group> <text variable="page" suffix="."/> </group> </group> </else-if> <else-if type="broadcast"> <group> <text variable="event"/> <group suffix="."> <text macro="publisher"/> <date delimiter=" " variable="issued" prefix=" "> <date-part name="day" form="numeric-leading-zeros"/> <date-part name="month" form="long"/> </date> </group> </group> <text variable="dimensions" prefix=" " suffix="."/> </else-if> <else-if type="thesis" match="any"> <text variable="publisher" suffix="."/> </else-if> <else-if type="manuscript" match="any"> <group delimiter=" " suffix="."> <text variable="archive_location" suffix="."/> <text variable="archive-place" suffix=":"/> <text variable="archive"/> </group> </else-if> </choose> </macro> <macro name="online-access"> <choose> <if variable="URL"> <group> <text value="Available at: &lt;" prefix=" "/> <text variable="URL"/> <group prefix="&gt;. " suffix="."> <text term="accessed" plural="true" text-case="capitalize-first" suffix=""/> <date delimiter=" " variable="accessed"> <date-part name="day" form="numeric-leading-zeros"/> <date-part name="month" form="long" range-delimiter=""/> <date-part name="year" range-delimiter="-"/> </date> </group> </group> </if> </choose> </macro> <macro name="author-short"> <choose> <if type="bill broadcast legal_case legislation motion_picture" match="any"> <text variable="title"/> </if> <else> <names variable="author"> <name form="short" and="text" delimiter-precedes-last="never" initialize-with="."/> <et-al font-style="italic"/> <substitute> <names variable="editor"/> <text variable="container-title"/> <text variable="title"/> </substitute> </names> </else> </choose> </macro> <macro name="editor"> <names variable="editor" delimiter="," suffix=" "> <name and="text" delimiter-precedes-last="never" et-al-min="3" et-al-use-first="1" initialize-with="." name-as-sort-order="all"/> <label form="short" prefix=" (" suffix=")"/> <et-al font-style="italic"/> </names> </macro> <citation disambiguate-add-year-suffix="true" collapse="year-suffix" et-al-min="3" et-al-use-first="1"> <layout delimiter="; " prefix="(" suffix=")"> <group delimiter=": "> <group delimiter=", "> <text macro="author-short"/> <text macro="year-date"/> </group> <text variable="locator"/> </group> </layout> </citation> <bibliography hanging-indent="false"> <sort> <key macro="cite-author"/> <key macro="year-date"/> <key variable="title"/> </sort> <layout> <group delimiter=" "> <text macro="cite-author"/> <choose> <if type="legal_case" match="any"> <text macro="year-date"/> </if> <else> <text macro="year-date" prefix="(" suffix=") "/> </else> </choose> </group> <group delimiter=" "> <text macro="primary-title"/> <text macro="genre-online-marker"/> <group delimiter=". " prefix=" "> <text macro="translator"/> <text macro="bill-detail"/> <text macro="container"/> </group> <text macro="legal-detail"/> <text macro="locator"/> </group> <text macro="online-access"/> </layout> </bibliography> </style>
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:c45f4544f63dd0d1ae1a2c0784d9577fcecff51c6cf6f154d02c2e120511f0a1 size 219
{ "pile_set_name": "Github" }
/** * Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Eclipse Public License (EPL). * Please see the license.txt included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ /* * Created on 03/09/2005 */ package org.python.pydev.core.docutils; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.python.pydev.core.ObjectsInternPool; import org.python.pydev.core.log.Log; import org.python.pydev.shared_core.string.FastStringBuffer; import org.python.pydev.shared_core.string.StringUtils; /** * This is an extension to the String utils so * @author Fabio * */ public final class PyStringUtils { private PyStringUtils() { } private static final boolean DEBUG = false; /** * <p>Find the index of <tt>character</tt> in a <tt>string</tt>.</p> * * <p>This method is like {@link java.lang.String#indexOf(int)} * but has the additional ability to ignore occurrences of * <tt>character</tt> in Python string literals (e.g. enclosed * by single, double or triple quotes). This is done by employing * a very simple statemachine.</p> * * @param string - the source string, e.g. the <i>haystack</i> * @param character - the character to retrieve the index for * @param ignoreInStringLiteral - if <tt>true</tt>, ignore occurrences * of <tt>character</tt> in Python string literals * @return the position of the character in string.<br> * if <tt>string</tt> is <tt>null</tt> or empty, or * if <tt>(int)character < 0</tt>, returns <tt>-1</tt>. * @note escaped (i.e. <tt>\"</tt>) characters are ignored and * control characters, e.g. line delimiters etc., are treated * normally like every other character. */ public static int indexOf(final String string, final char character, final boolean ignoreInStringLiteral) { if (null == string || (character < 0) || string.length() == 0) { return -1; } int index = string.indexOf(character); if (-1 == index) { return index; } if (ignoreInStringLiteral) { final int len = string.length(); boolean inString = false; char nextc = '\0'; char c = '\0'; int i = -1; try { while (i < len) { i++; c = string.charAt(i); if ((i + 1) < len) { nextc = string.charAt(i + 1); } if ('\\' == c) { // ignore escapes i++; continue; } if (!inString && character == c) { index = i; break; } if ('"' == c || '\'' == c) { if ('"' == nextc || '\'' == nextc) { i++; continue; } else { if (inString) { inString = false; } else { inString = true; } } } } } catch (StringIndexOutOfBoundsException e) { // malformed Python string literals may throw a SIOOBE if (DEBUG) { System.err.print(e.getMessage()); } index = -1; } } return index; } /** * <p>Find the substring in <tt>string</tt> that starts from the first * occurrence of <tt>character</tt>.</p> * * <p>This method is similar to {@link java.lang.String#substring} * but has the additional ability to ignore occurrences of * <tt>character</tt> in Python string literals (e.g. enclosed * by single, double or triple single/double quotes).</p> * * @param string - the source string, e.g. the <i>haystack</i> * @param character - the character that is the starting boundary of the searched substring * @param ignoreInStringLiteral - if <tt>true</tt>, ignore occurrences * of <tt>character</tt> in Python string literals * @return a substring from <tt>string</tt><br>or <tt>null</tt> if * {@link PyStringUtils#indexOf} returns <tt>-1</tt> * @see {@link PyStringUtils#indexOf} */ public static String findSubstring(final String string, final char character, final boolean ignoreInStringLiteral) { String result = null; int index = PyStringUtils.indexOf(string, character, ignoreInStringLiteral); if (index >= 0) { result = string.substring(index + 1); } return result; } /** * Formats a docstring to be shown and adds the indentation passed to all the docstring lines but the 1st one. */ public static String fixWhitespaceColumnsToLeftFromDocstring(String docString, String indentationToAdd) { FastStringBuffer buf = new FastStringBuffer(); List<String> splitted = StringUtils.splitInLines(docString); for (int i = 0; i < splitted.size(); i++) { String initialString = splitted.get(i); if (i == 0) { buf.append(initialString);//first is unchanged } else { String string = StringUtils.leftTrim(initialString); buf.append(indentationToAdd); if (string.length() > 0) { buf.append(string); } else { int length = initialString.length(); if (length > 0) { char c; if (length > 1) { //check 2 chars c = initialString.charAt(length - 2); if (c == '\n' || c == '\r') { buf.append(c); } } c = initialString.charAt(length - 1); if (c == '\n' || c == '\r') { buf.append(c); } } } } } //last line if (buf.length() > 0) { char c = buf.lastChar(); if (c == '\r' || c == '\n') { buf.append(indentationToAdd); } } return buf.toString(); } public static String removeWhitespaceColumnsToLeft(String hoverInfo) { FastStringBuffer buf = new FastStringBuffer(); int firstCharPosition = Integer.MAX_VALUE; List<String> splitted = StringUtils.splitInLines(hoverInfo); for (String line : splitted) { if (line.trim().length() > 0) { int found = PySelection.getFirstCharPosition(line); firstCharPosition = Math.min(found, firstCharPosition); } } if (firstCharPosition != Integer.MAX_VALUE) { for (String line : splitted) { if (line.length() > firstCharPosition) { buf.append(line.substring(firstCharPosition)); } } return buf.toString(); } else { return hoverInfo;//return initial } } public static String removeWhitespaceColumnsToLeftAndApplyIndent(String code, String indent, boolean indentCommentLinesAt0Pos) { FastStringBuffer buf = new FastStringBuffer(); int firstCharPosition = Integer.MAX_VALUE; List<String> splitted = StringUtils.splitInLines(code); for (String line : splitted) { if (indentCommentLinesAt0Pos || !line.startsWith("#")) { if (line.trim().length() > 0) { int found = PySelection.getFirstCharPosition(line); firstCharPosition = Math.min(found, firstCharPosition); } } } if (firstCharPosition != Integer.MAX_VALUE) { for (String line : splitted) { if (indentCommentLinesAt0Pos || !line.startsWith("#")) { buf.append(indent); if (line.length() > firstCharPosition) { buf.append(line.substring(firstCharPosition)); } else { buf.append(line); } } else { buf.append(line); } } return buf.toString(); } else { return code;//return initial } } /** * Splits some string given some char (that char will not appear in the returned strings) * Empty strings are also never added. */ public static void splitWithIntern(String string, char toSplit, Collection<String> addTo) { synchronized (ObjectsInternPool.lock) { int len = string.length(); int last = 0; char c = 0; for (int i = 0; i < len; i++) { c = string.charAt(i); if (c == toSplit) { if (last != i) { addTo.add(ObjectsInternPool.internUnsynched(string.substring(last, i))); } while (c == toSplit && i < len - 1) { i++; c = string.charAt(i); } last = i; } } if (c != toSplit) { if (last == 0 && len > 0) { addTo.add(ObjectsInternPool.internUnsynched(string)); //it is equal to the original (no char to split) } else if (last < len) { addTo.add(ObjectsInternPool.internUnsynched(string.substring(last, len))); } } } } /** * Tests whether each character in the given string is a valid identifier. * * @param str * @return <code>true</code> if the given string is a word */ public static boolean isValidIdentifier(final String str, boolean acceptPoint) { int len = str.length(); if (str == null || len == 0) { return false; } char c = '\0'; boolean lastWasPoint = false; for (int i = 0; i < len; i++) { c = str.charAt(i); if (i == 0) { if (!Character.isJavaIdentifierStart(c)) { return false; } } else { if (!Character.isJavaIdentifierPart(c)) { if (acceptPoint && c == '.') { if (lastWasPoint) { return false; //can't have 2 consecutive dots. } lastWasPoint = true; continue; } return false; } } lastWasPoint = false; } if (c == '.') { //if the last char is a point, don't accept it (i.e.: only accept at middle). return false; } return true; } /** * An array of Python pairs of characters that you will find in any Python code. * * Currently, the set contains: * <ul> * <ol>left and right brackets: [, ]</ol> * <ol>right and right parentheses: (, ) * </ul> */ public static final char[] BRACKETS = { '{', '}', '(', ')', '[', ']' }; public static final char[] CLOSING_BRACKETS = { '}', ')', ']' }; public static boolean hasOpeningBracket(String trimmedLine) { return trimmedLine.indexOf('{') != -1 || trimmedLine.indexOf('(') != -1 || trimmedLine.indexOf('[') != -1; } public static boolean hasClosingBracket(String trimmedLine) { return trimmedLine.indexOf('}') != -1 || trimmedLine.indexOf(')') != -1 || trimmedLine.indexOf(']') != -1; } public static boolean hasUnbalancedClosingPeers(final String line) { Map<Character, Integer> stack = new HashMap<Character, Integer>(); final int len = line.length(); for (int i = 0; i < len; i++) { char c = line.charAt(i); switch (c) { case '(': case '{': case '[': Integer iStack = stack.get(c); if (iStack == null) { iStack = 0; } iStack++; stack.put(c, iStack); break; case ')': case '}': case ']': char peer = StringUtils.getPeer(c); iStack = stack.get(peer); if (iStack == null) { iStack = 0; } iStack--; stack.put(peer, iStack); break; } } for (int i : stack.values()) { if (i < 0) { return true; } } return false; } public static String urlEncodeKeyValuePair(String key, String value) { String result = null; try { result = URLEncoder.encode(key, "UTF-8") + "=" + URLEncoder.encode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { Log.log(e); } return result; } /** * //Python 3.0 can use unicode identifiers. So, the letter construct deals with that... * TOKEN : * Python identifiers * * { * < NAME: <LETTER> ( <LETTER> | <DIGIT>)* > * | * < #LETTER: * [ * "a"-"z", * "A"-"Z", * "_", * "\u0080"-"\uffff" //Anything more than 128 is considered valid (unicode range) * * ] * > * } * @param param * @return */ public static boolean isPythonIdentifier(final String param) { final int len = param.length(); if (len == 0) { return false; } char c = param.charAt(0); if (!Character.isLetter(c) && c != '_' && c <= 128) { return false; } for (int i = 1; i < len; i++) { c = param.charAt(i); if ((!Character.isLetter(c) && !Character.isDigit(c) && c != '_') && (c <= 128)) { return false; } } return true; } public static String getExeAsFileSystemValidPath(String executableOrJar) { return "v1_" + StringUtils.md5(executableOrJar); } }
{ "pile_set_name": "Github" }
post_install() { cd mingw32 local _prefix=$(pwd -W) cd - local _it for _it in gdbus-codegen glib-genmarshal glib-mkenums gtester-report; do sed -e "s|/mingw32|${_prefix}|g" \ -i ${_prefix}/bin/${_it}-script.py done } post_upgrade() { post_install }
{ "pile_set_name": "Github" }
# encoding: utf-8 module Axiom # Abstract base class representing a type of data in a relation tuple class Attribute extend Aliasable, DescendantsTracker include AbstractType, ::Comparable, Visitable include Equalizer.new(:name, :type, :required?) abstract_singleton_method :type # The attribute name # # @return [Symbol] # # @api private attr_reader :name # The attribute type # # @return [Class<Types::Object>] # # @api private attr_reader :type # Coerce an object into an Attribute # # @param [Attribute, #to_ary, #to_sym] object # the object to coerce # # @return [Attribute] # # @api private def self.coerce(object) if object.kind_of?(Attribute) object elsif equal?(Attribute) Object.coerce(object) else name, type, options = object klass = type ? const_get(type.name) : self klass.new(name, options || EMPTY_HASH) end end # Extract the attribute name from the object # # @param [#name, #to_ary, #to_a] object # the object to extract a name from # # @return [Symbol] # # @api private def self.name_from(object) if object.respond_to?(:name) object.name else Array(object).first.to_sym end end # Infer the Attribute type from the operand # # @param [Object] operand # # @return [Class<Attribute>] # # @api private def self.infer_type(operand) if operand.respond_to?(:type) operand.type else Types::Type.descendants.detect { |type| type.include?(operand) } end end # Initialize an Attribute # # @param [#to_sym] name # the attribute name # @param [Hash] options # the options for the attribute # @option options [Boolean] :required (true) # if true, then the value cannot be nil # # @return [undefined] # # @api private def initialize(name, options = EMPTY_HASH) @name = name.to_sym @required = options.fetch(:required, true) @type = self.class.type end # Extract the value corresponding to this attribute from a tuple # # @example # value = attribute.call(tuple) # # @param [Tuple] tuple # the tuple to extract the value from # # @return [Object] # # @api public def call(tuple) tuple[self] end # Rename an attribute # # @example # new_attribute = attribute.rename(new_name) # # @param [Symbol] new_name # the new name to rename the attribute to # # @return [Attribute] # # @todo Make this have the same API as functions # # @api public def rename(new_name) if name.equal?(new_name) self else self.class.new(new_name, required: required?) end end # Test if the attribute is required # # @example # attribute.required? # => true or false # # @return [Boolean] # # @api public def required? @required end # Test if the attribute is optional # # @example # attribute.optional? # => true or false # # @return [Boolean] # # @api public def optional? !required? end # Test if the value matches the attribute constraints # # @example # attribute.include?(value) # => true or false # # @param [Object] value # the value to test # # @return [Boolean] # # @api public def include?(value) valid_or_optional?(value, &type.method(:include?)) end private # Test that the value is either valid or optional # # @param [Object] value # the value to test # # @yield [] block representing attribute constraint # # @return [Boolean] # # @api private def valid_or_optional?(value) value.nil? ? optional? : yield(value) end # Coerce the object into an Attribute # # @param [Array] args # # @return [Attribute] # # @api private def coerce(*args) self.class.coerce(*args) end end # class Attribute end # module Axiom
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Preprocessed version of "boost/mpl/list/list40_c.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 > struct list31_c : l_item< long_<31> , integral_c< T,C0 > , list30_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30 > > { typedef list31_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31 > struct list32_c : l_item< long_<32> , integral_c< T,C0 > , list31_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31 > > { typedef list32_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32 > struct list33_c : l_item< long_<33> , integral_c< T,C0 > , list32_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32 > > { typedef list33_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32, T C33 > struct list34_c : l_item< long_<34> , integral_c< T,C0 > , list33_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33 > > { typedef list34_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32, T C33, T C34 > struct list35_c : l_item< long_<35> , integral_c< T,C0 > , list34_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34 > > { typedef list35_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32, T C33, T C34, T C35 > struct list36_c : l_item< long_<36> , integral_c< T,C0 > , list35_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35 > > { typedef list36_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32, T C33, T C34, T C35, T C36 > struct list37_c : l_item< long_<37> , integral_c< T,C0 > , list36_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36 > > { typedef list37_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32, T C33, T C34, T C35, T C36, T C37 > struct list38_c : l_item< long_<38> , integral_c< T,C0 > , list37_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37 > > { typedef list38_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38 > struct list39_c : l_item< long_<39> , integral_c< T,C0 > , list38_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38 > > { typedef list39_c type; typedef T value_type; }; template< typename T , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39 > struct list40_c : l_item< long_<40> , integral_c< T,C0 > , list39_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39 > > { typedef list40_c type; typedef T value_type; }; }}
{ "pile_set_name": "Github" }
/* * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package sun.management; /** */ @Deprecated public class CompilerThreadStat implements java.io.Serializable { private String name; private long taskCount; private long compileTime; private MethodInfo lastMethod; CompilerThreadStat(String name, long taskCount, long time, MethodInfo lastMethod) { this.name = name; this.taskCount = taskCount; this.compileTime = time; this.lastMethod = lastMethod; }; /** * Returns the name of the compiler thread associated with * this compiler thread statistic. * * @return the name of the compiler thread. */ public String getName() { return name; } /** * Returns the number of compile tasks performed by the compiler thread * associated with this compiler thread statistic. * * @return the number of compile tasks performed by the compiler thread. */ public long getCompileTaskCount() { return taskCount; } /** * Returns the accumulated elapsed time spent by the compiler thread * associated with this compiler thread statistic. * * @return the accumulated elapsed time spent by the compiler thread. */ public long getCompileTime() { return compileTime; } /** * Returns the information about the last method compiled by * the compiler thread associated with this compiler thread statistic. * * @return a {@link MethodInfo} object for the last method * compiled by the compiler thread. */ public MethodInfo getLastCompiledMethodInfo() { return lastMethod; } public String toString() { return getName() + " compileTasks = " + getCompileTaskCount() + " compileTime = " + getCompileTime(); } private static final long serialVersionUID = 6992337162326171013L; }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <PhotoPrintProduct/KHModel.h> @class NSString; @interface KHTextStyleLocalization : KHModel { long long _styleId; NSString *_languageCode; NSString *_font; long long _fontSize; double _leading; double _lineSpacing; double _kerning; long long _productID; } + (id)modelWithDictionary:(id)arg1 inDatabase:(id)arg2; + (id)modelWithDictionary:(id)arg1; + (id)localizationForTextStyle:(long long)arg1 language:(id)arg2 fromDatabase:(id)arg3; + (id)modelWithLocalizationString:(id)arg1 inDatabase:(id)arg2; + (id)modelWithLocalizationString:(id)arg1; - (void)applyDictionaryProperties:(id)arg1; - (id)stringValue; - (void)applyLocalizationString:(id)arg1; - (void)setLineSpacing:(double)arg1; - (void)cacheLineSpacing:(double)arg1; - (double)lineSpacing; - (void)setProductID:(long long)arg1; - (void)cacheProductID:(long long)arg1; - (long long)productID; - (void)setKerning:(double)arg1; - (void)cacheKerning:(double)arg1; - (double)kerning; - (void)setLeading:(double)arg1; - (void)cacheLeading:(double)arg1; - (double)leading; - (void)setFontSize:(long long)arg1; - (void)cacheFontSize:(long long)arg1; - (long long)fontSize; - (void)setFont:(id)arg1; - (void)cacheFont:(id)arg1; - (id)font; - (void)setLanguageCode:(id)arg1; - (void)cacheLanguageCode:(id)arg1; - (id)languageCode; - (void)setStyleId:(long long)arg1; - (void)cacheStyleId:(long long)arg1; - (long long)styleId; - (void)dealloc; @end
{ "pile_set_name": "Github" }
import config_mqtt import config_identity import task_queues_manager import asynch_result if config_identity.IS_MICROPYTHON: import worker_upython as worker_impl else: import worker_cpython as worker_impl class Broker(worker_impl.Worker): DEFAULT_CHANNEL = config_mqtt.SERVER_NAME def __init__(self, server_address, server_port): worker_impl.Worker.__init__(self, server_address, server_port) self.is_client = False self.broadcasting_channel = Broker.DEFAULT_CHANNEL self.task_queues_manager = task_queues_manager.Queue_manager() self.enqueue_task = self.task_queues_manager.enqueue_task self.enqueue_result = self.task_queues_manager.enqueue_result self.dequeue_task = self.task_queues_manager.dequeue_task def put_task(self, signature, routing_key = DEFAULT_CHANNEL): message = self.create_task_message(signature) remain_tasks_count = self.task_queues_manager.remain_tasks_count() self.enqueue_task(message) if remain_tasks_count == 0: # call for help only if this is the first one. self.call_for_help(routing_key) async_result = None if message.get('need_result'): async_result = asynch_result.Asynch_result(message.get('task_id'), self.task_queues_manager._requests_need_result, self.receive_one_cycle) return async_result def create_task_message(self, signature): message = signature.message time_stamp = str(self.now()) message['message_id'] = time_stamp message['sender'] = self.name message['reply_to'] = self.name message['result'] = None message['correlation_id'] = time_stamp message['task_id'] = time_stamp message = self.format_message(**message) return message def call_for_help(self, routing_key = DEFAULT_CHANNEL): message= {'receiver': routing_key, 'message_type': 'function', 'function': 'fetch_task', 'kwargs': {'broker': self.name}} self.request(message) def fetch_task(self, broker): # if not self.is_client: if self.name != broker: remain_tasks_count = 1 while remain_tasks_count > 0: # fetch_task message= {'receiver': broker, 'message_type': 'function', 'function': 'dequeue_task', 'need_result': True} msg, asynch_result = self.request(message) task = None result = asynch_result.get() if result: task, remain_tasks_count = result self.blink_led(on_seconds=0.003, off_seconds=0.001) if task: print('\ntask:', task) self.consume_task(task) def consume_task(self, task): # do task message, message_string = self.do(task) print('reply_message:', message) # reply result try: if message and message.get('need_result'): time_stamp = str(self.now()) reply_message = self.format_message(message_id=time_stamp, sender=self.name, receiver=message.get('sender'), message_type='function', function='enqueue_result', kwargs={'message': message}, reply_to=self.name, correlation_id=time_stamp) print('\nProcessed result:\n{0}\n'.format(self.get_OrderedDict(reply_message))) self.send_message(reply_message) except Exception as e: print(e, 'Fail to return result.')
{ "pile_set_name": "Github" }
wget "http://cs231n.stanford.edu/coco_captioning.zip" unzip coco_captioning.zip rm coco_captioning.zip
{ "pile_set_name": "Github" }
/* * Copyright (c) 2012 Fredrik Mellbin * Copyright (c) 2013 Clément Bœsch * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "libavutil/timestamp.h" #include "avfilter.h" #include "internal.h" #define INPUT_MAIN 0 #define INPUT_CLEANSRC 1 struct qitem { AVFrame *frame; int64_t maxbdiff; int64_t totdiff; }; typedef struct { const AVClass *class; struct qitem *queue; ///< window of cycle frames and the associated data diff int fid; ///< current frame id in the queue int filled; ///< 1 if the queue is filled, 0 otherwise AVFrame *last; ///< last frame from the previous queue AVFrame **clean_src; ///< frame queue for the clean source int got_frame[2]; ///< frame request flag for each input stream AVRational ts_unit; ///< timestamp units for the output frames int64_t start_pts; ///< base for output timestamps uint32_t eof; ///< bitmask for end of stream int hsub, vsub; ///< chroma subsampling values int depth; int nxblocks, nyblocks; int bdiffsize; int64_t *bdiffs; /* options */ int cycle; double dupthresh_flt; double scthresh_flt; int64_t dupthresh; int64_t scthresh; int blockx, blocky; int ppsrc; int chroma; } DecimateContext; #define OFFSET(x) offsetof(DecimateContext, x) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM static const AVOption decimate_options[] = { { "cycle", "set the number of frame from which one will be dropped", OFFSET(cycle), AV_OPT_TYPE_INT, {.i64 = 5}, 2, 25, FLAGS }, { "dupthresh", "set duplicate threshold", OFFSET(dupthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl = 1.1}, 0, 100, FLAGS }, { "scthresh", "set scene change threshold", OFFSET(scthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl = 15.0}, 0, 100, FLAGS }, { "blockx", "set the size of the x-axis blocks used during metric calculations", OFFSET(blockx), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS }, { "blocky", "set the size of the y-axis blocks used during metric calculations", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS }, { "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { "chroma", "set whether or not chroma is considered in the metric calculations", OFFSET(chroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS }, { NULL } }; AVFILTER_DEFINE_CLASS(decimate); static void calc_diffs(const DecimateContext *dm, struct qitem *q, const AVFrame *f1, const AVFrame *f2) { int64_t maxdiff = -1; int64_t *bdiffs = dm->bdiffs; int plane, i, j; memset(bdiffs, 0, dm->bdiffsize * sizeof(*bdiffs)); for (plane = 0; plane < (dm->chroma && f1->data[2] ? 3 : 1); plane++) { int x, y, xl; const int linesize1 = f1->linesize[plane]; const int linesize2 = f2->linesize[plane]; const uint8_t *f1p = f1->data[plane]; const uint8_t *f2p = f2->data[plane]; int width = plane ? AV_CEIL_RSHIFT(f1->width, dm->hsub) : f1->width; int height = plane ? AV_CEIL_RSHIFT(f1->height, dm->vsub) : f1->height; int hblockx = dm->blockx / 2; int hblocky = dm->blocky / 2; if (plane) { hblockx >>= dm->hsub; hblocky >>= dm->vsub; } for (y = 0; y < height; y++) { int ydest = y / hblocky; int xdest = 0; #define CALC_DIFF(nbits) do { \ for (x = 0; x < width; x += hblockx) { \ int64_t acc = 0; \ int m = FFMIN(width, x + hblockx); \ for (xl = x; xl < m; xl++) \ acc += abs(((const uint##nbits##_t *)f1p)[xl] - \ ((const uint##nbits##_t *)f2p)[xl]); \ bdiffs[ydest * dm->nxblocks + xdest] += acc; \ xdest++; \ } \ } while (0) if (dm->depth == 8) CALC_DIFF(8); else CALC_DIFF(16); f1p += linesize1; f2p += linesize2; } } for (i = 0; i < dm->nyblocks - 1; i++) { for (j = 0; j < dm->nxblocks - 1; j++) { int64_t tmp = bdiffs[ i * dm->nxblocks + j ] + bdiffs[ i * dm->nxblocks + j + 1] + bdiffs[(i + 1) * dm->nxblocks + j ] + bdiffs[(i + 1) * dm->nxblocks + j + 1]; if (tmp > maxdiff) maxdiff = tmp; } } q->totdiff = 0; for (i = 0; i < dm->bdiffsize; i++) q->totdiff += bdiffs[i]; q->maxbdiff = maxdiff; } static int filter_frame(AVFilterLink *inlink, AVFrame *in) { int scpos = -1, duppos = -1; int drop = INT_MIN, i, lowest = 0, ret; AVFilterContext *ctx = inlink->dst; AVFilterLink *outlink = ctx->outputs[0]; DecimateContext *dm = ctx->priv; AVFrame *prv; /* update frames queue(s) */ if (FF_INLINK_IDX(inlink) == INPUT_MAIN) { dm->queue[dm->fid].frame = in; dm->got_frame[INPUT_MAIN] = 1; } else { dm->clean_src[dm->fid] = in; dm->got_frame[INPUT_CLEANSRC] = 1; } if (!dm->got_frame[INPUT_MAIN] || (dm->ppsrc && !dm->got_frame[INPUT_CLEANSRC])) return 0; dm->got_frame[INPUT_MAIN] = dm->got_frame[INPUT_CLEANSRC] = 0; if (dm->ppsrc) in = dm->clean_src[dm->fid]; if (in) { /* update frame metrics */ prv = dm->fid ? (dm->ppsrc ? dm->clean_src[dm->fid - 1] : dm->queue[dm->fid - 1].frame) : dm->last; if (!prv) { dm->queue[dm->fid].maxbdiff = INT64_MAX; dm->queue[dm->fid].totdiff = INT64_MAX; } else { calc_diffs(dm, &dm->queue[dm->fid], prv, in); } if (++dm->fid != dm->cycle) return 0; av_frame_free(&dm->last); dm->last = av_frame_clone(in); dm->fid = 0; /* we have a complete cycle, select the frame to drop */ lowest = 0; for (i = 0; i < dm->cycle; i++) { if (dm->queue[i].totdiff > dm->scthresh) scpos = i; if (dm->queue[i].maxbdiff < dm->queue[lowest].maxbdiff) lowest = i; } if (dm->queue[lowest].maxbdiff < dm->dupthresh) duppos = lowest; drop = scpos >= 0 && duppos < 0 ? scpos : lowest; } /* metrics debug */ if (av_log_get_level() >= AV_LOG_DEBUG) { av_log(ctx, AV_LOG_DEBUG, "1/%d frame drop:\n", dm->cycle); for (i = 0; i < dm->cycle && dm->queue[i].frame; i++) { av_log(ctx, AV_LOG_DEBUG," #%d: totdiff=%08"PRIx64" maxbdiff=%08"PRIx64"%s%s%s%s\n", i + 1, dm->queue[i].totdiff, dm->queue[i].maxbdiff, i == scpos ? " sc" : "", i == duppos ? " dup" : "", i == lowest ? " lowest" : "", i == drop ? " [DROP]" : ""); } } /* push all frames except the drop */ ret = 0; for (i = 0; i < dm->cycle && dm->queue[i].frame; i++) { if (i == drop) { if (dm->ppsrc) av_frame_free(&dm->clean_src[i]); av_frame_free(&dm->queue[i].frame); } else { AVFrame *frame = dm->queue[i].frame; if (frame->pts != AV_NOPTS_VALUE && dm->start_pts == AV_NOPTS_VALUE) dm->start_pts = frame->pts; if (dm->ppsrc) { av_frame_free(&frame); frame = dm->clean_src[i]; } frame->pts = av_rescale_q(outlink->frame_count, dm->ts_unit, (AVRational){1,1}) + (dm->start_pts == AV_NOPTS_VALUE ? 0 : dm->start_pts); ret = ff_filter_frame(outlink, frame); if (ret < 0) break; } } return ret; } static int config_input(AVFilterLink *inlink) { int max_value; AVFilterContext *ctx = inlink->dst; DecimateContext *dm = ctx->priv; const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); const int w = inlink->w; const int h = inlink->h; dm->hsub = pix_desc->log2_chroma_w; dm->vsub = pix_desc->log2_chroma_h; dm->depth = pix_desc->comp[0].depth; max_value = (1 << dm->depth) - 1; dm->scthresh = (int64_t)(((int64_t)max_value * w * h * dm->scthresh_flt) / 100); dm->dupthresh = (int64_t)(((int64_t)max_value * dm->blockx * dm->blocky * dm->dupthresh_flt) / 100); dm->nxblocks = (w + dm->blockx/2 - 1) / (dm->blockx/2); dm->nyblocks = (h + dm->blocky/2 - 1) / (dm->blocky/2); dm->bdiffsize = dm->nxblocks * dm->nyblocks; dm->bdiffs = av_malloc_array(dm->bdiffsize, sizeof(*dm->bdiffs)); dm->queue = av_calloc(dm->cycle, sizeof(*dm->queue)); if (!dm->bdiffs || !dm->queue) return AVERROR(ENOMEM); if (dm->ppsrc) { dm->clean_src = av_calloc(dm->cycle, sizeof(*dm->clean_src)); if (!dm->clean_src) return AVERROR(ENOMEM); } return 0; } static av_cold int decimate_init(AVFilterContext *ctx) { DecimateContext *dm = ctx->priv; AVFilterPad pad = { .name = av_strdup("main"), .type = AVMEDIA_TYPE_VIDEO, .filter_frame = filter_frame, .config_props = config_input, }; if (!pad.name) return AVERROR(ENOMEM); ff_insert_inpad(ctx, INPUT_MAIN, &pad); if (dm->ppsrc) { pad.name = av_strdup("clean_src"); pad.config_props = NULL; if (!pad.name) return AVERROR(ENOMEM); ff_insert_inpad(ctx, INPUT_CLEANSRC, &pad); } if ((dm->blockx & (dm->blockx - 1)) || (dm->blocky & (dm->blocky - 1))) { av_log(ctx, AV_LOG_ERROR, "blockx and blocky settings must be power of two\n"); return AVERROR(EINVAL); } dm->start_pts = AV_NOPTS_VALUE; return 0; } static av_cold void decimate_uninit(AVFilterContext *ctx) { int i; DecimateContext *dm = ctx->priv; av_frame_free(&dm->last); av_freep(&dm->bdiffs); av_freep(&dm->queue); av_freep(&dm->clean_src); for (i = 0; i < ctx->nb_inputs; i++) av_freep(&ctx->input_pads[i].name); } static int request_inlink(AVFilterContext *ctx, int lid) { int ret = 0; DecimateContext *dm = ctx->priv; if (!dm->got_frame[lid]) { AVFilterLink *inlink = ctx->inputs[lid]; ret = ff_request_frame(inlink); if (ret == AVERROR_EOF) { // flushing dm->eof |= 1 << lid; ret = filter_frame(inlink, NULL); } } return ret; } static int request_frame(AVFilterLink *outlink) { int ret; AVFilterContext *ctx = outlink->src; DecimateContext *dm = ctx->priv; const uint32_t eof_mask = 1<<INPUT_MAIN | dm->ppsrc<<INPUT_CLEANSRC; if ((dm->eof & eof_mask) == eof_mask) // flush done? return AVERROR_EOF; if ((ret = request_inlink(ctx, INPUT_MAIN)) < 0) return ret; if (dm->ppsrc && (ret = request_inlink(ctx, INPUT_CLEANSRC)) < 0) return ret; return 0; } static int query_formats(AVFilterContext *ctx) { static const enum AVPixelFormat pix_fmts[] = { #define PF_NOALPHA(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf #define PF_ALPHA(suf) AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf #define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf) PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16), AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_NONE }; AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); if (!fmts_list) return AVERROR(ENOMEM); return ff_set_common_formats(ctx, fmts_list); } static int config_output(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; DecimateContext *dm = ctx->priv; const AVFilterLink *inlink = ctx->inputs[dm->ppsrc ? INPUT_CLEANSRC : INPUT_MAIN]; AVRational fps = inlink->frame_rate; if (!fps.num || !fps.den) { av_log(ctx, AV_LOG_ERROR, "The input needs a constant frame rate; " "current rate of %d/%d is invalid\n", fps.num, fps.den); return AVERROR(EINVAL); } fps = av_mul_q(fps, (AVRational){dm->cycle - 1, dm->cycle}); av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n", inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den); outlink->time_base = inlink->time_base; outlink->frame_rate = fps; outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; outlink->w = inlink->w; outlink->h = inlink->h; dm->ts_unit = av_inv_q(av_mul_q(fps, outlink->time_base)); return 0; } static const AVFilterPad decimate_outputs[] = { { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .request_frame = request_frame, .config_props = config_output, }, { NULL } }; AVFilter ff_vf_decimate = { .name = "decimate", .description = NULL_IF_CONFIG_SMALL("Decimate frames (post field matching filter)."), .init = decimate_init, .uninit = decimate_uninit, .priv_size = sizeof(DecimateContext), .query_formats = query_formats, .outputs = decimate_outputs, .priv_class = &decimate_class, .flags = AVFILTER_FLAG_DYNAMIC_INPUTS, };
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ package org.apache.submarine.client.cli.yarnservice; import org.apache.submarine.commons.runtime.MockClientContext; import org.apache.submarine.commons.runtime.RuntimeFactory; import org.apache.submarine.commons.runtime.fs.MemorySubmarineStorage; import org.apache.submarine.server.submitter.yarnservice.YarnServiceRuntimeFactory; import java.io.IOException; import static org.apache.submarine.client.cli.yarnservice.YarnServiceRunJobCliCommonsTest.DEFAULT_JOB_NAME; public class YarnServiceCliTestUtils { public static MockClientContext getMockClientContext() throws IOException { MockClientContext mockClientContext = new MockClientContext(DEFAULT_JOB_NAME); RuntimeFactory runtimeFactory = new YarnServiceRuntimeFactory( mockClientContext); mockClientContext.setRuntimeFactory(runtimeFactory); runtimeFactory.setSubmarineStorage(new MemorySubmarineStorage()); return mockClientContext; } }
{ "pile_set_name": "Github" }
#ifndef UNITTEST_TESTRESULTS_H #define UNITTEST_TESTRESULTS_H namespace UnitTest { class TestReporter; class TestDetails; class TestResults { public: explicit TestResults(TestReporter* reporter = nullptr); void OnTestStart(TestDetails const& test); void OnTestFailure(TestDetails const& test, char const* failure); void OnTestFinish(TestDetails const& test, float secondsElapsed) const; int GetTotalTestCount() const; int GetFailedTestCount() const; int GetFailureCount() const; private: TestReporter* m_testReporter; int m_totalTestCount; int m_failedTestCount; int m_failureCount; bool m_currentTestFailed; TestResults(TestResults const&); TestResults& operator =(TestResults const&); }; } #endif
{ "pile_set_name": "Github" }
package table; public class AccountTable { public static final String ACCOUNT_TABLE = "account_table"; public static final String UID = "uid"; public static final String USER_NAME = "user_name"; public static final String USER_PWD = "user_password"; public static final String ACCESS_TOKEN_HACK = "access_token_hack"; public static final String ACCESS_TOKEN_HACK_EXPIRES_TIME = "expires_time_hack"; public static final String COOKIE = "cookie"; public static final String OAUTH_TOKEN = "oauth_token"; public static final String OAUTH_TOKEN_EXPIRES_TIME = "oauth_token_expires_time"; public static final String NAVIGATION_POSITION = "navigation_position"; public static final String USER_INFO_JSON = "user_info_json"; public static final String G_SID = "g_sid"; }
{ "pile_set_name": "Github" }
/** * 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. */ package org.brixcms.plugin.site.page.admin; import org.apache.wicket.markup.html.form.TextArea; import org.apache.wicket.model.IModel; import org.brixcms.registry.ExtensionPoint; /** * A factory that can create an editor to edit markup. The user can then chose from the list of available editors when * editing markup throught he web interface. * * @author igor.vaynberg */ public interface MarkupEditorFactory { /** * Extension point used to register repository initializers */ public static final ExtensionPoint<MarkupEditorFactory> POINT = new ExtensionPoint<MarkupEditorFactory>() { public Multiplicity getMultiplicity() { return Multiplicity.COLLECTION; } public String getUuid() { return MarkupEditorFactory.class.getName(); } }; /** * Create the textarea component that will represent the editor * * @param id component id * @param markup markup model * @return editor component */ TextArea<String> newEditor(String id, IModel<String> markup); /** * Create a model that will display the editor name in the menu * * @return */ IModel<String> newLabel(); }
{ "pile_set_name": "Github" }
/* plotDataMatrix - Create an image showing a matrix of data values.. */ /* Copyright (C) 2011 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "options.h" #include "sqlNum.h" #include "vGfx.h" #include "memgfx.h" struct vGfx *vgOpenGif(int width, int height, char *fileName, boolean useTransparency); int cellWidth = 25; int cellHeight = 25; boolean clCorrelate = FALSE; void usage() /* Explain usage and exit. */ { errAbort( "plotDataMatrix - Create an image showing a matrix of data values.\n" "usage:\n" " plotDataMatrix inPairs.tab xLabels.tab yLabels.tab output.gif\n" "where the three inputs are all tab-separated text files:\n" " inPairs.tab has 3 columns: xId, yId, and a floating point number\n" " xLabels.tab has 2 columns: xId and xLabel\n" " yLabels.tab has 2 column: yId and yLabel\n" "The label files also determine the order (top to bottom, right to left)\n" "of the display.\n" "options:\n" " -correlate Treat as a correlation matrix. Fill in the diagonal with\n" " perfect score and reflect other squares\n" ); } static struct optionSpec options[] = { {"correlate", OPTION_BOOLEAN}, {NULL, 0}, }; struct sparseCell /* Two id's and a value - a representation of a sparse matrix cell. */ { struct sparseCell *next; char *xId; /* ID for columns. Allocated in matrix hash. */ char *yId; /* ID for rows. Allocated in matrix hash. */ double val; /* Value at this position in matrix. */ }; struct sparseMatrix /* A matrix stored as a list of cells with values. */ { struct sparseMatrix *next; struct sparseCell *cellList; /* List of all cells */ struct hash *xIdHash; /* Hash of column IDs. */ struct hash *yIdHash; /* Hash of row IDs. */ }; struct sparseMatrix *sparseMatrixRead(char *fileName) /* Read in a sparse matrix file and return it in memory structure. */ { /* Open up file */ struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[3]; /* Start up matrix data structure. */ struct sparseMatrix *mat; AllocVar(mat); mat->xIdHash = hashNew(0); mat->yIdHash = hashNew(0); /* Loop through file adding cells. */ while (lineFileRow(lf, row)) { struct sparseCell *cell; AllocVar(cell); cell->xId = hashStoreName(mat->xIdHash, row[0]); cell->yId = hashStoreName(mat->yIdHash, row[1]); cell->val = sqlDouble(row[2]); slAddHead(&mat->cellList, cell); } slReverse(&mat->cellList); /* Clean up and go home. */ lineFileClose(&lf); return mat; } struct sparseCell *sparseMatrixFindCell(struct sparseMatrix *mat, char *xId, char *yId) /* Rummage through cell list looking for match. */ { struct sparseCell *cell; for (cell = mat->cellList; cell != NULL; cell = cell->next) { if (sameString(cell->xId, xId) && sameString(cell->yId, yId)) return cell; } return NULL; } struct slPair *labelsRead(char *fileName, struct hash *idHash, char *inPairsFile) /* Read in file into a list of pairs where name is id, val is label. */ { /* Open up file */ struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[2]; /* Loop through file adding pairs to list. */ struct slPair *list = NULL; while (lineFileRowTab(lf, row)) { char *id = row[0]; char *label = row[1]; if (!hashLookup(idHash, id)) verbose(2, "id %s is in line %d of %s, but not in %s", id, lf->lineIx, lf->fileName, inPairsFile); struct slPair *el = slPairNew(id, cloneString(label)); slAddHead(&list, el); } slReverse(&list); lineFileClose(&lf); return list; } int widestLabelWidth(MgFont *font, struct slPair *labelList) /* Return width in pixels of widest label in list. */ { int widest = 0; struct slPair *label; for (label = labelList; label != NULL; label = label->next) { int width = mgFontStringWidth(font, label->val); if (widest < width) widest = width; } return widest; } void makeImage(struct sparseMatrix *mat, struct slPair *xLabelList, struct slPair *yLabelList, char *fileName) /* Make image file from matrix and labels. */ { /* Figure out dimensions */ int xCount = slCount(xLabelList); int yCount = slCount(yLabelList); MgFont *font = mgTimes12Font(); int spaceWidth = mgFontCharWidth(font, ' '); int lineHeight = mgFontLineHeight(font); int labelWidth = 2*spaceWidth + widestLabelWidth(font, yLabelList); int totalWidth = labelWidth + cellWidth * xCount; int totalHeight = lineHeight + cellHeight * yCount; int matrixX = labelWidth; int matrixY = lineHeight; /* Start up image. */ struct vGfx *vg = vgOpenGif(totalWidth, totalHeight, fileName, FALSE); /* Print row labels */ struct slPair *yLabel; int y = matrixY; for (yLabel = yLabelList; yLabel != NULL; yLabel = yLabel->next) { vgTextCentered(vg, 0, y, labelWidth, cellHeight, MG_BLACK, font, yLabel->val); y += cellHeight; } /* Print x labels */ struct slPair *xLabel; int x = matrixX; for (xLabel = xLabelList; xLabel != NULL; xLabel = xLabel->next) { vgTextCentered(vg, x, 0, cellWidth, lineHeight, MG_BLACK, font, xLabel->val); x += cellWidth; } /* Print matrix. */ y = matrixY; for (yLabel = yLabelList; yLabel != NULL; yLabel = yLabel->next) { x = matrixX; for (xLabel = xLabelList; xLabel != NULL; xLabel = xLabel->next) { boolean gotData = FALSE; struct sparseCell *cell = sparseMatrixFindCell(mat, xLabel->name, yLabel->name); if (cell == NULL && clCorrelate) cell = sparseMatrixFindCell(mat, yLabel->name, xLabel->name); int grayLevel; if (cell != NULL) { grayLevel = 255 - 255 * cell->val; gotData = TRUE; } else /* No data - maybe try and fake it? */ { if (clCorrelate) { if (sameString(xLabel->name, yLabel->name)) { grayLevel = 0; gotData = TRUE; } } } Color color; if (gotData) color = vgFindColorIx(vg, grayLevel, grayLevel, grayLevel); else color = MG_YELLOW; vgBox(vg, x, y, cellWidth, cellHeight, color); x += cellWidth; } y += cellHeight; } /* Clean up */ vgClose(&vg); } void plotDataMatrix(char *inPairsFile, char *xLabelsFile, char *yLabelsFile, char *outFile) /* plotDataMatrix - Create an image showing a matrix of data values.. */ { struct sparseMatrix *mat = sparseMatrixRead(inPairsFile); struct slPair *xLabelList = labelsRead(xLabelsFile, mat->xIdHash, inPairsFile); struct slPair *yLabelList = labelsRead(yLabelsFile, mat->yIdHash, inPairsFile); verbose(2, "got %d cells, %d x dims, %d y dims\n", slCount(mat->cellList), slCount(xLabelList), slCount(yLabelList)); makeImage(mat, xLabelList, yLabelList, outFile); } int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); if (argc != 5) usage(); clCorrelate = optionExists("correlate"); plotDataMatrix(argv[1], argv[2], argv[3], argv[4]); return 0; }
{ "pile_set_name": "Github" }
#ifndef __LIBGRAVIS_STRING_FORMAT_H__ #define __LIBGRAVIS_STRING_FORMAT_H__ #include <sstream> #include <iomanip> #include <stdint.h> namespace gravis { /** * Usage * std::string name = StringFormat("Dies sind ")(12)(" Zahlen."); * std::string name = StringFormat("Dies sind ")(12, 4, '0')(" Zahlen."); **/ class StringFormat { private: std::stringstream s; public: StringFormat(const StringFormat& start) : s() { s << start.string(); }; const char* c_str() const { return s.str().c_str(); } std::string string() const { return s.str(); } operator std::string() const { return s.str(); } bool operator==(const StringFormat& o) const { return o.string()==string(); } bool operator!=(const StringFormat& o) const { return o.string()!=string(); } bool operator==(const std::string& o) const { return o==string(); } bool operator!=(const std::string& o) const { return o!=string(); } StringFormat() : s() { } template <class T> explicit StringFormat(const T& e) : s() { s << e; } template <class T> StringFormat(const T& e, std::streamsize w) : s() { s << std::setw(w) << e; } template <class T> StringFormat(const T& e, std::streamsize w, char fill) : s() { s << std::setw(w) << std::setfill(fill) << e; } template <class T> inline StringFormat& operator()(const T& e) { s << e; return *this; } template <class T> inline StringFormat& operator()(const T& e, int w) { s << std::setw(w) << e; return *this; } template <class T> inline StringFormat& operator()(const T& e, int w, char fill) { s << std::setw(w) << std::setfill(fill) << e; return *this; } }; } inline std::ostream& operator<< (std::ostream& os, const gravis::StringFormat& arg) { os << arg.string(); return os; } #endif
{ "pile_set_name": "Github" }
# Copyright (C) Inverse inc. # English translations for PacketFence package. # # This file is distributed under the same license as the PacketFence package. # # Translators: # Derek Wuelfrath <[email protected]>, 2012 # inverse <[email protected]>, 2013 # inverse <[email protected]>, 2013 # muhlig <[email protected]>, 2013 # muhlig <[email protected]>, 2012 # Mateusz Ilnicki <[email protected]>, 2017 # muhlig <[email protected]>, 2012-2013 # olmanolsztyn <[email protected]>, 2017 msgid "" msgstr "" "Project-Id-Version: PacketFence\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2018-04-19 16:11+0000\n" "Last-Translator: inverse <[email protected]>\n" "Language-Team: Polish (Poland) (http://www.transifex.com/inverse/packetfence/language/pl_PL/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl_PL\n" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Root.pm msgid " with bandwidth balance : %s," msgstr "z przepustowością: %s," # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Root.pm msgid " with time balance : %s," msgstr "z czasem: %s," # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Root.pm msgid " with unregistration date : %s," msgstr "z datą wyrejestrowania: %s," # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/Email.pm msgid "%s: Email activation required" msgstr "%s: wymagana aktywacja email." # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/Sponsor.pm msgid "%s: Guest access request" msgstr "%s: prośba o dostęp gościnny" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "%s: Guest access request accepted" msgstr "%s: prośba o dostęp gościnny zaakceptowana" # html/captive-portal/templates/pki_provider/packetfence_local.html # html/captive-portal/templates/pki_provider/packetfence_pki.html # html/captive-portal/templates/pki_provider/scep.html msgid "" "A random certificate password has been generated for you. Please note it as " "it will be necessary to complete the process." msgstr "Tymczasowe hasło zostało wygenerowane dla Ciebie. Zanotuj je na potrzeby dalszego procesu." # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "AUP is required and it" msgstr "" # html/captive-portal/templates/emails/emails-guest_sponsor_confirmed.html msgid "Access Authorized" msgstr "Dostęp autoryzowany" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "Access granted" msgstr "Dostęp przyznany" # html/captive-portal/templates/activation/sponsor_accepted.html msgid "Access to the guest network granted" msgstr "Dostęp do sieci gościnnej przyznany" # html/captive-portal/templates/activation/sponsor_accepted.html msgid "Access to the guest network has been granted." msgstr "Dostęp do sieci gościnnej został przyznany. " # html/captive-portal/templates/provisioner/deny.html msgid "" "According to the provisioner configuration, this device cannot access the " "network." msgstr "Zgodnie z konfiguracją oprogramowania pośredniczącego urządzenie to nie może uzyskać dostępu do sieci." # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Root.pm msgid "Account created" msgstr "Konto zostało utworzone" # html/captive-portal/templates/emails/emails-guest_email_preregistration.html msgid "Activate your network access" msgstr "Aktywuj dostęp do sieci" # pf::person::FIELDS msgid "Address" msgstr "Adres" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "" "After registering, you will be given temporary network access for %s " "minutes. In order to complete your registration, you will need to click on " "the link emailed to you." msgstr "" # html/captive-portal/templates/provisioner/sepm.html msgid "Alternate installer" msgstr "Alternatywny instalator" # html/captive-portal/templates/emails/emails-guest_admin_pregistration.html msgid "An account has been created for you to access our network." msgstr "Konto dostępu do sieci zostało utworzone." # html/captive-portal/templates/account.html msgid "An e-mail with the login informations will follow in the next minutes" msgstr "E-mail z danymi logowania zostanie wysłany w ciągu najbliższych minut" # html/captive-portal/lib/captiveportal/PacketFence/Controller/TLSProfile.pm msgid "" "An error has occured while trying to save your certificate, please contact " "your local support staff" msgstr "" # html/captive-portal/lib/captiveportal/PacketFence/Controller/Root.pm # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Application.pm msgid "An error occured" msgstr "Wystąpił błąd" # html/captive-portal/templates/lost_stolen.html msgid "" "An error occured while trying to declare the device %s as lost or stolen." msgstr "" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "An type and activation code is required" msgstr "Wymagany jest typ i kod aktywacyjny" # pf::person::FIELDS msgid "Anniversary" msgstr "Rocznica" # pf::person::FIELDS msgid "Apartment_number" msgstr "Numer mieszkania" # html/captive-portal/templates/status.html msgid "Bandwidth balance " msgstr "" # html/captive-portal/templates/activation/sponsor_login.html msgid "Before we proceed with guest activation, we need you to authenticate." msgstr "Przed kontynuacją aktywacji gości trzeba, abyś się uwierzytelnił." # html/captive-portal/templates/emails/emails- # billing_stripe_customer.subscription.deleted.html msgid "Billing cancellation" msgstr "Anulowanie płatności" # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "Billing invoice" msgstr "Faktura rozliczeniowa" # pf::person::FIELDS msgid "Birthday" msgstr "Data urodzenia" # pf::person::FIELDS msgid "Building_number" msgstr "Numer budynku" # html/captive-portal/templates/status.html msgid "Cancel" msgstr "Anuluj" # pf::person::FIELDS msgid "Cell_phone" msgstr "Telefon komórkowy" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/TLSEnrollment.pm # html/captive-portal/templates/pki_provider/packetfence_local.html # html/captive-portal/templates/pki_provider/packetfence_pki.html # html/captive-portal/templates/pki_provider/scep.html msgid "Certificate generation for EAP TLS connection" msgstr "Generowanie certyfikatu dla połączenia EAP TLS" # html/captive-portal/templates/status.html msgid "Change my password" msgstr "Zmień moje hasło" # html/captive-portal/templates/status/reset_password.html msgid "Change your password" msgstr "Zmień swoje hasło" # html/captive-portal/templates/saml.html msgid "Click here to login on %s" msgstr "Kliknij tutaj, aby zalogować się do %s" # pf::person::FIELDS msgid "Company" msgstr "Firma" # html/captive-portal/templates/status.html msgid "Computer name " msgstr "Nazwa komputera" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/SMS.pm msgid "Confirm Mobile Phone Number" msgstr "Potwierdź numer telefonu komórkowego" # html/captive-portal/templates/status/reset_password.html msgid "Confirm your password" msgstr "Potwierdź hasło" # html/captive-portal/templates/billing/confirm_Stripe.html # html/captive-portal/templates/challenge.html # html/captive-portal/templates/message.html # html/captive-portal/templates/provisioner/accept.html # html/captive-portal/templates/provisioner/android.html # html/captive-portal/templates/provisioner/ibm.html # html/captive-portal/templates/provisioner/jamf.html # html/captive-portal/templates/provisioner/mobileconfig.html # html/captive-portal/templates/provisioner/mobileiron.html # html/captive-portal/templates/provisioner/opswat.html # html/captive-portal/templates/provisioner/sentinelone.html # html/captive-portal/templates/provisioner/sepm.html # html/captive-portal/templates/provisioner/symantec.html # html/captive-portal/templates/provisioner/windows.html # html/captive-portal/templates/select-role.html # html/captive-portal/templates/signin.html # html/captive-portal/templates/sms/validate.html # html/captive-portal/templates/survey.html msgid "Continue" msgstr "Kontynuuj" # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "Cost" msgstr "Koszt" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "Could not find unregistration date for this activation code." msgstr "Nie można odnaleźć daty wyrejestrowania dla tego kodu aktywacyjnego." # html/captive-portal/templates/account.html msgid "Created account %s" msgstr "Konto %s zostało utworzone" # pf::person::FIELDS msgid "Custom_field_1" msgstr "" # pf::person::FIELDS msgid "Custom_field_2" msgstr "" # pf::person::FIELDS msgid "Custom_field_3" msgstr "" # pf::person::FIELDS msgid "Custom_field_4" msgstr "" # pf::person::FIELDS msgid "Custom_field_5" msgstr "" # pf::person::FIELDS msgid "Custom_field_6" msgstr "" # pf::person::FIELDS msgid "Custom_field_7" msgstr "" # pf::person::FIELDS msgid "Custom_field_8" msgstr "" # pf::person::FIELDS msgid "Custom_field_9" msgstr "" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "Date Of Birth" msgstr "" # html/captive-portal/templates/status.html msgid "Declare as lost or stolen" msgstr "Zgubiony lub ukradziony?" # html/captive-portal/templates/billing/tier.html msgid "Description" msgstr "Opis" # html/captive-portal/templates/device-registration/registration.html msgid "Device MAC address" msgstr "MAC adres urządzenia" # html/captive-portal/templates/device-registration/registration.html msgid "Device Type" msgstr "Typ urządzenia" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/DeviceRegistration.pm msgid "Device registration landing" msgstr "Rejestracja urządzenia" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/DeviceRegistration.pm msgid "Device registration module is not enabled" msgstr "Moduł rejestracji urządzenia nie jest aktywny" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "Do NOT authorize access if you were not expecting this guest." msgstr "NIE autoryzuj dostępu, jeśli nie oczekiwałeś tego gościa." # html/captive-portal/templates/provisioner/sepm.html # html/captive-portal/templates/provisioner/symantec.html msgid "Download" msgstr "Pobierz" # html/captive-portal/templates/provisioner/sentinelone.html msgid "Download Mac OSX Agent" msgstr "Pobierz agenta dla Mac OSX" # html/captive-portal/templates/provisioner/sentinelone.html msgid "Download Windows Agent" msgstr "Pobierz agenta dla Windows" # html/captive-portal/templates/pki_provider/packetfence_pki.html msgid "E-mail" msgstr "" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm # html/captive-portal/templates/account.html # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html # pf::person::FIELDS msgid "Email" msgstr "Mejl" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "" "Email activation code has been verified. Access granted until : $unregdate" msgstr "Kod aktywacyjny został zweryfikowany. Dostęp przyznany do: $unregdate" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "Enter a valid telephone number" msgstr "" # html/captive-portal/templates/violations/bandwidth_expiration.html msgid "Expiration" msgstr "Wygaśnięcie" # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "Extend access duration" msgstr "Wydłuż czas dostępu" # html/captive-portal/templates/status.html msgid "Extend your access" msgstr "Wydłuż dostęp" # html/captive-portal/templates/emails/emails-guest_email_activation.html msgid "" "Failure to do so within %s minutes will result in a termination of your " "network access." msgstr "Nieprzestrzeganie tego w ciągu %s minut spowoduje zablokowanie twojego\ndostępu do sieci." # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html # pf::person::FIELDS msgid "Firstname" msgstr "Imię" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm # pf::person::FIELDS msgid "Gender" msgstr "Płeć" # html/captive-portal/templates/pki_provider/packetfence_local.html # html/captive-portal/templates/pki_provider/packetfence_pki.html # html/captive-portal/templates/pki_provider/scep.html msgid "Generate certificate" msgstr "Generuj certyfikat" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "Guest Sponsor Login" msgstr "Login sponsorowany" # html/captive-portal/templates/emails/emails-guest_email_activation.html # html/captive-portal/templates/emails/emails-guest_email_preregistration.html msgid "Guest access to the network was requested using this email address." msgstr "Dostęp do sieci został zażądany za pomocą tego adresu e-mail." # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "Guest request" msgstr "Prośba gościa" # html/captive-portal/templates/emails/emails-billing_confirmation.html # html/captive-portal/templates/emails/emails- # billing_stripe_customer.subscription.deleted.html # html/captive-portal/templates/emails/emails-guest_admin_pregistration.html # html/captive-portal/templates/emails/emails-guest_email_activation.html # html/captive-portal/templates/emails/emails-guest_email_preregistration.html # html/captive-portal/templates/emails/emails- # guest_email_preregistration_confirmed.html # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html # html/captive-portal/templates/emails/emails-guest_sponsor_confirmed.html # html/captive-portal/templates/emails/emails- # guest_sponsor_preregistration.html # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "Hello" msgstr "" # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html msgid "Here are the info." msgstr "Tutaj są informacje." # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "Here is the information of the infringing device" msgstr "" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "Here is the information the guest provided with registration form" msgstr "Oto informacje podane w formularzu rejestracyjnym" # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "Hostname" msgstr "Nazwa hosta" # html/captive-portal/lib/captiveportal/PacketFence/Form/Widget/Field/AUP.pm msgid "I accept the terms" msgstr "Akceptuję warunki" # html/captive-portal/templates/sms/validate.html msgid "I don't have a PIN" msgstr "Nie posiadam numeru PIN" # lib/pf/web.pm msgid "IP" msgstr "" # html/captive-portal/templates/provisioner/mobileiron.html msgid "If you are using a Windows phone" msgstr "Jeśli używasz Windows phone" # html/captive-portal/templates/provisioner/mobileiron.html msgid "If you are using an Android phone or tablet" msgstr "Jeśli używasz telefonu lub tabletu z Android" # html/captive-portal/templates/provisioner/mobileiron.html msgid "If you are using an Apple phone or tablet" msgstr "Jeśli używasz telefonu lub tabletu Apple" # html/captive-portal/templates/provisioner/sepm.html msgid "If you find the program above not working you can try this one:" msgstr "Jeśli wybrany program nie działa spróbuj tego:" # html/captive-portal/templates/emails/emails- # guest_email_preregistration_confirmed.html # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html # html/captive-portal/templates/emails/emails-guest_sponsor_confirmed.html # html/captive-portal/templates/emails/emails- # guest_sponsor_preregistration.html msgid "" "If you have any questions regarding the registration process please contact " "your local support staff." msgstr "Jeśli masz jakiekolwiek pytania dotyczące procesu rejestracji,\nskontaktuj się z lokalnym działem wsparcia." # html/captive-portal/templates/release.html # html/captive-portal/templates/scan-in-progress.html # html/captive-portal/templates/scan.html # html/captive-portal/templates/waiting.html msgid "" "If you have scripting turned off, you will not be automatically redirected. " "Please enable scripting or open a new browser window from time to time to " "see if your access was enabled." msgstr "Jeśli masz wyłączone skrypty, nie zostaniesz automatycznie przekierowany. Proszę włączyć skrypty lub od czasu do czasu otworzyć nowe okno przeglądarki aby zobaczyć, czy masz włączony dostęp." # html/captive-portal/templates/pki_provider/packetfence_local.html # html/captive-portal/templates/pki_provider/packetfence_pki.html # html/captive-portal/templates/pki_provider/scep.html msgid "" "In order to complete the registration process, you need to generate your " "user certificate." msgstr "Aby ukończyć proces rejestracji musisz wygenerować swój\ncertyfikat użytkownika" # html/captive-portal/templates/provisioner/windows.html msgid "" "In order to complete your connection to the secure SSID, you will need to " "run the agent available below." msgstr "Aby uruchomić połączenie z bezpiecznym SSID, musisz\nuruchomić agenta dostępnego poniżej." # html/captive-portal/templates/provisioner/ibm.html # html/captive-portal/templates/provisioner/mobileiron.html # html/captive-portal/templates/provisioner/opswat.html # html/captive-portal/templates/provisioner/windows.html msgid "Install Agent" msgstr "Zainstaluj agenta" # html/captive-portal/templates/provisioner/android.html # html/captive-portal/templates/provisioner/mobileconfig.html msgid "Install wireless profile" msgstr "Zainstaluj profil WIFI" # html/captive-portal/templates/billing/index.html msgid "Internet Access Package" msgstr "Pakiet Dostępu do Internetu" # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html msgid "" "Just to let you know that an user account has been created while registering" " your device. You may now want to use it for different features (devices " "registration, status page)." msgstr "" # pf::person::FIELDS msgid "Lang" msgstr "Język" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html # pf::person::FIELDS msgid "Lastname" msgstr "Nazwisko" # html/captive-portal/templates/activation/sponsor_login.html # html/captive-portal/templates/oauth2/landing.html # html/captive-portal/templates/status/login.html msgid "Login" msgstr "Login" # html/captive-portal/templates/status/login.html msgid "Login to manage registered devices" msgstr "Zaloguj się, aby zarządzać zarejestrowanymi urządzeniami" # html/captive-portal/templates/status.html # html/captive-portal/templates/status/menu.html msgid "Logout" msgstr "Wylogowanie" # html/captive-portal/templates/status.html # lib/pf/web.pm msgid "MAC" msgstr "MAC" # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "MAC Address" msgstr "Adres MAC" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "Mobile provider" msgstr "Operator komórkowy" # html/captive-portal/templates/emails/emails-guest_email_activation.html msgid "Network access activation" msgstr "Aktywowanie dostępu do sieci" # html/captive-portal/templates/release.html # html/captive-portal/templates/scan-in-progress.html msgid "Network access has been granted" msgstr "Dostęp do sieci został przyznany" # pf::person::FIELDS msgid "Nickname" msgstr "" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "No active sponsor source for this Connection Profile." msgstr "Brak aktywnego źródła sponsora dla tego profilu połączenia." # html/captive-portal/lib/captiveportal/PacketFence/Controller/Node/Manager.pm msgid "Not allowed to deregister $mac" msgstr "Wyrejestrowanie $mac jest niedozwolone" # html/captive-portal/lib/captiveportal/PacketFence/Controller/Node/Manager.pm msgid "Not logged in or node ID $mac is not known" msgstr "Niezalogowany lub $mac jest nieznany" # pf::person::FIELDS msgid "Notes" msgstr "Notatki" # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "OS" msgstr "" # html/captive-portal/templates/status.html msgid "OS Type " msgstr "Typ OS" # html/captive-portal/templates/emails/emails- # guest_email_preregistration_confirmed.html msgid "" "Once on site, select guest access on the captive portal and use the " "following username and password to authenticate" msgstr "Gdy będziesz na miejscu, wybierz dostęp dla gości\ni użyj następującej nazwy użytkownika i hasła do uwierzytelnienia" # html/captive-portal/templates/provisioner/ibm.html # html/captive-portal/templates/provisioner/jamf.html # html/captive-portal/templates/provisioner/opswat.html # html/captive-portal/templates/provisioner/sentinelone.html # html/captive-portal/templates/provisioner/symantec.html msgid "" "Once the application is installed, click 'Continue' to activate your network" " connection" msgstr "Po zainstalowaniu aplikacji kliknij 'Kontynuuj', aby aktywować połączenie z siecią" # html/captive-portal/templates/provisioner/mobileiron.html msgid "" "Once the application is installed, click Continue to activate your network " "connection" msgstr "Po zainstalowaniu aplikacji kliknij 'Kontynuuj', aby aktywować połączenie z siecią" # html/captive-portal/templates/provisioner/sepm.html msgid "" "Once the application is installed, click next to activate your network " "connection" msgstr "Po zainstalowaniu aplikacji kliknij 'następny', aby aktywować połączenie z siecią" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "" "Once you click on the activation link the guest will be sent a username and " "password by email which will allow him to register as a guest in the network" " once on-site." msgstr "" # html/captive-portal/templates/emails/emails-guest_email_preregistration.html msgid "" "Once you have activated you will receive a username and password to use once" " you'll be on-site." msgstr "" # html/captive-portal/templates/emails/emails-guest_admin_pregistration.html msgid "" "Once you will be on-site, authenticate using the following credentials to " "our captive portal" msgstr "" # html/captive-portal/templates/status/reset_password.html msgid "One of the password fields hasn't been filled" msgstr "" # html/captive-portal/templates/sms/validate.html msgid "PIN" msgstr "PIN" # html/captive-portal/templates/layout.html msgid "PacketFence Registration system" msgstr "System Rejestracji PacketFence" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm # html/captive-portal/templates/account.html # html/captive-portal/templates/activation/sponsor_login.html # html/captive-portal/templates/emails/emails-guest_admin_pregistration.html # html/captive-portal/templates/emails/emails- # guest_email_preregistration_confirmed.html # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html # html/captive-portal/templates/emails/emails- # guest_sponsor_preregistration.html # html/captive-portal/templates/pki_provider/packetfence_local.html # html/captive-portal/templates/pki_provider/packetfence_pki.html # html/captive-portal/templates/pki_provider/scep.html # html/captive-portal/templates/status/login.html # html/captive-portal/templates/status/reset_password.html msgid "Password" msgstr "Hasło" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/Billing.pm msgid "Pay for your access" msgstr "Zapłać za dostęp do sieci" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "Phone number" msgstr "Numer telefonu" # pf::person::FIELDS msgid "Pid" msgstr "" # html/captive-portal/templates/emails/emails-guest_email_activation.html # html/captive-portal/templates/emails/emails-guest_email_preregistration.html msgid "Please ignore this request if you have not requested network access." msgstr "" # pf::person::FIELDS msgid "Portal" msgstr "" # html/captive-portal/templates/emails/emails- # guest_email_preregistration_confirmed.html msgid "PreRegister confirmation" msgstr "Potwierdzenie wstępnej rejestracji" # html/captive-portal/templates/emails/emails-guest_admin_pregistration.html # html/captive-portal/templates/emails/emails-guest_email_preregistration.html msgid "PreRegistration" msgstr "Wstępna rejestracja" # html/captive-portal/templates/billing/tier.html msgid "Price" msgstr "Cena" # html/captive-portal/templates/status.html msgid "" "Really unregister %s? The device will be immediately disconnected from the " "network." msgstr "Czy napewno chcez wyrejestrować urządzenie %s? Urządzenie zostanie rozłączone." # html/captive-portal/templates/device-registration/registration.html msgid "Register" msgstr "Zarejestruj" # html/captive-portal/templates/status.html msgid "Register another device" msgstr "Zarejestruj kolejne urządzenie" # html/captive-portal/templates/status.html msgid "Registered on" msgstr "" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/DeviceRegistration.pm msgid "Registration" msgstr "Rejestracja" # html/captive-portal/templates/waiting.html msgid "Registration pending" msgstr "Oczekuje rejestracja" # html/captive-portal/templates/status/menu.html msgid "Return to device list" msgstr "" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Root.pm msgid "Role %s has been assigned to your device" msgstr "Rola %s została przypisana do twojego urządzenia." # pf::person::FIELDS msgid "Room_number" msgstr "" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/SAML.pm msgid "SAML authentication" msgstr "Uwierzytelnianie SAML" # html/captive-portal/templates/device-registration/registration.html msgid "Select Console" msgstr "Wybierz konsolę" # html/captive-portal/templates/content-with-choice.html msgid "Select an authentication method" msgstr "Wybierz typ uwierzytelniania" # pf::person::FIELDS msgid "Source" msgstr "Źródło" # pf::person::FIELDS msgid "Sponsor" msgstr "" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "Sponsor Email" msgstr "Email sponsora" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "Sponsor request accepted" msgstr "Prośba sponsora zaakceptowana" # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "Status" msgstr "Stan" # html/captive-portal/lib/captiveportal/PacketFence/Controller/Status.pm msgid "Status - Login" msgstr "Stan - Logowanie" # html/captive-portal/lib/captiveportal/PacketFence/Controller/Status.pm msgid "Status - Manage Account" msgstr "Stan - Zarządzanie kontem" # html/captive-portal/lib/captiveportal/PacketFence/Controller/Status.pm msgid "Status - Network Access" msgstr "Stan - Dostęp do sieci" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm # pf::person::FIELDS msgid "Telephone" msgstr "Telefon" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "Telephone number is not valid" msgstr "" # pf::person::FIELDS msgid "Tenant_id" msgstr "" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "Thank you for your cooperation." msgstr "Dziękujemy za wspólpracę." # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "Thank you for your purchase." msgstr "Dziękujemy za zakup." # html/captive-portal/templates/emails/emails-guest_email_activation.html # html/captive-portal/templates/emails/emails-guest_email_preregistration.html msgid "Thank you for your understanding" msgstr "Dziękujemy za wyrozumiałość." # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "" "The activation code provided is invalid. Reasons could be: it never existed," " it was already used or has expired." msgstr "Kod aktywacyjny jest nieprawidłowy. Możliwe powody: nieistniejący kod,\nzostał już użyty lub wygasł." # html/captive-portal/templates/status.html msgid "" "The device %s will be disconnected and won't be able to be registered again." msgstr "Urządzenie %s zostanie rozłączone bez możliwości ponownej rejestracji." # html/captive-portal/templates/emails/emails- # billing_stripe_customer.subscription.deleted.html msgid "The network access of device %s has been revoked." msgstr "Dostęp do sieci dla urządzenia %s został odwołany." # html/captive-portal/templates/readonly.html msgid "The system is in maintenance mode" msgstr "System jest w trybie konserwacji" # html/captive-portal/templates/status/reset_password.html msgid "The two entered passwords did not match" msgstr "Hasła nie zgadzają się" # html/captive-portal/templates/account.html msgid "This account can only be used once." msgstr "To konto może być użyte tylko raz." # html/captive-portal/templates/status.html msgid "This device is declared as lost or stolen." msgstr "Urządzenie zostało oznaczone jako zagubione lub skradzione." # html/captive-portal/templates/emails/emails-billing_confirmation.html # html/captive-portal/templates/emails/emails-guest_email_preregistration.html # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html # html/captive-portal/templates/emails/emails-guest_sponsor_confirmed.html # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "This is a post only E-mail, please do not reply." msgstr "To jest tylko wiadomość e-mail, proszę nie odpowiadać." # html/captive-portal/templates/status.html msgid "This is your current device." msgstr "To jest twoje aktualne urządzenie." # html/captive-portal/templates/emails/emails-guest_admin_pregistration.html msgid "This username and password will be valid starting" msgstr "Ta nazwa użytkownika i hasło będą ważne od" # html/captive-portal/templates/billing/tier.html msgid "Tier" msgstr "" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/Billing.pm msgid "Tier confirmation" msgstr "" # html/captive-portal/templates/status.html msgid "Time balance " msgstr "" # pf::person::FIELDS msgid "Title" msgstr "Tytuł" # html/captive-portal/templates/provisioner/mobileiron.html msgid "To complete your network activation you need to install MobileIron" msgstr "Aby ukończyć aktywację sieci, musisz zainstalować MobileIron" # html/captive-portal/templates/provisioner/ibm.html msgid "" "To complete your network activation you need to install the IBM client." msgstr "Aby ukończyć aktywację sieci, musisz zainstalować klienta IBM." # html/captive-portal/templates/provisioner/jamf.html msgid "" "To complete your network activation you need to install the JAMF client." msgstr "" # html/captive-portal/templates/provisioner/opswat.html msgid "" "To complete your network activation you need to install the OPSWAT " "Metadefender Endpoint client." msgstr "Aby ukończyć aktywację sieci, musisz zainstalować klienta OPSWAT\nMetadefender Endpoint client." # html/captive-portal/templates/provisioner/sentinelone.html msgid "" "To complete your network activation you need to install the SentinelOne " "client." msgstr "Aby ukończyć aktywację sieci, musisz zainstalować klienta SentinelOne" # html/captive-portal/templates/provisioner/sepm.html msgid "" "To complete your network activation you need to install the Symantec " "Endpoint Manager" msgstr "Aby ukończyć aktywację sieci, musisz zainstalować Symantec\nEndpoint Manager" # html/captive-portal/templates/provisioner/symantec.html msgid "" "To complete your network activation you need to install the Symantec client." msgstr "Aby ukończyć aktywację sieci, musisz zainstalować klienta Symantec" # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "To extend your network access, please visit" msgstr "Aby rozszerzyć dostęp do sieci, odwiedź stronę" # html/captive-portal/templates/provisioner/accept.html msgid "" "To the administrator : you should probably file a bug report on the " "PacketFence website" msgstr "Do administratorów: powinieneś prawdopodobnie zgłosić raport o błędzie na\nstronie PacketFence" # html/captive-portal/templates/provisioner/accept.html msgid "To the user : try clicking Continue to see if it fixes the problem" msgstr "o użytkownika: spróbuj kliknąć przycisk Kontynuuj, aby sprawdzić, czy problem został rozwiązany" # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "To view your current network status, please visit" msgstr "Aby wyświetlić aktualny stan sieci, odwiedź stronę" # html/captive-portal/templates/emails/emails-billing_confirmation.html msgid "Transaction ID" msgstr "ID tranzakcji" # html/captive-portal/templates/billing/tier.html msgid "Transaction summary" msgstr "Podsumowanie tranzakcji" # html/captive-portal/templates/release.html # html/captive-portal/templates/scan-in-progress.html msgid "" "Unable to detect network connectivity. Try restarting your web browser or " "opening a new tab to see if your access has been succesfully enabled." msgstr "Nie można wykryć łączności sieciowej. Spróbuj ponownie uruchomić przeglądarkę lub\notwórz nową zakładkę, aby sprawdzić, czy dostęp został pomyślnie włączony." # html/captive-portal/templates/status.html msgid "Unregister" msgstr "Wyrejestruj" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "" "Until you click on the activation link this guest will have NO Internet " "access." msgstr "Dopóki nie klikniesz na link aktywacyjny, ten gość nie będzie miał dostępu do Internetu." # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html # html/captive-portal/templates/emails/emails- # guest_sponsor_preregistration.html msgid "User Account" msgstr "Konto użytkownika" # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm # html/captive-portal/templates/account.html # html/captive-portal/templates/activation/sponsor_login.html # html/captive-portal/templates/emails/emails-guest_admin_pregistration.html # html/captive-portal/templates/emails/emails- # guest_email_preregistration_confirmed.html # html/captive-portal/templates/emails/emails- # guest_local_account_creation.html # html/captive-portal/templates/emails/emails- # guest_sponsor_preregistration.html # html/captive-portal/templates/status/login.html msgid "Username" msgstr "Nazwa użytkownika" # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "Violation %s was detected on your device." msgstr "Naruszenie %s zostało wykryte dla tego urządzenia." # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "Violation detected !" msgstr "Wykryto naruszenie polityki bezpieczeństwa!" # pf::person::FIELDS msgid "Work_phone" msgstr "Tel. służbowy" # html/captive-portal/templates/pki_provider/packetfence_local.html # html/captive-portal/templates/pki_provider/packetfence_pki.html # html/captive-portal/templates/pki_provider/scep.html msgid "You can also modify the password below." msgstr "Poniżej możesz zmienić hasło." # html/captive-portal/templates/lost_stolen.html msgid "" "You do not own this device %s, therefor you can not declare it as lost or " "stolen." msgstr "" # html/captive-portal/templates/emails/emails-violation-triggered.html msgid "You have been detected doing malicious activity on the network." msgstr "Zostały wykryte złośliwe działania w sieci." # html/captive-portal/templates/status.html msgid "You have no registered devices." msgstr "Nie masz zarejestrowanych urządzeń." # html/captive-portal/lib/captiveportal/PacketFence/Form/Authentication.pm msgid "You must accept the terms and conditions" msgstr "" # html/captive-portal/templates/provisioner/accept.html msgid "You should not seeing this page, something went wrong." msgstr "Nie powinieneś widzieć tej strony, coś poszło nie tak." # html/captive-portal/templates/status.html msgid "" "You're not connected to the network, but have a timebank of <strong " "id='timeleft'>%s</strong>" msgstr "Nie masz połączenia z siecią, ale masz bank czasu<strong id='timeleft'>%s</strong>" # html/captive-portal/templates/provisioner/android.html # html/captive-portal/templates/provisioner/mobileconfig.html msgid "" "Your XML configuration have been generated and is now ready to download. " "Follow the link below in order to get access to the secure SSID." msgstr "Twoja konfiguracja XML została wygenerowana i jest teraz gotowa do ściągnięcia. Wykorzystaj łącznik poniżej aby uzyskać dosep do bezpiecznego SSID." # html/captive-portal/lib/captiveportal/PacketFence/Controller/TLSProfile.pm msgid "" "Your certificate could not be aquired from the certificate server. Try again" " later or contact your network administrator." msgstr "" # html/captive-portal/templates/lost_stolen.html msgid "Your device %s has been declared as lost or stolen." msgstr "" # html/captive-portal/templates/emails/emails-guest_sponsor_confirmed.html # html/captive-portal/templates/emails/emails- # guest_sponsor_preregistration.html msgid "Your guest access to the network was authorized." msgstr "Dostęp gościnny do sieci został autoryzowany." # html/captive-portal/templates/emails/emails- # guest_email_preregistration_confirmed.html msgid "Your guest access to the network was confirmed." msgstr "Dostęp gościnny do sieci został potwierdzony." # html/captive-portal/templates/status.html msgid "Your network access ends in <strong id=\"expiration\"></strong>" msgstr "Twój dostęp do sieci zakończy się <strong id=\"expiration\"></strong>" # html/captive-portal/templates/status.html msgid "Your network access has expired." msgstr "Twój dostęp do sieci wygasł." # html/captive-portal/templates/status.html msgid "Your network access is <strong>paused</strong>" msgstr "Twój dostęp do sieci jest <strong>wstrzymany</strong>" # html/captive-portal/templates/release.html msgid "" "Your network access is currently being enabled. Once network connectivity is" " established you will be automatically redirected." msgstr "Twój dostęp do sieci jest aktualnie włączany. Po nawiązaniu łączności sieciowej zostaniesz automatycznie przekierowany." # html/captive-portal/templates/status/reset_password.html msgid "Your password has been updated" msgstr "" # html/captive-portal/templates/status.html msgid "Your registered devices" msgstr "Twoje zarejestrowane urządzenia" # html/captive-portal/templates/waiting.html msgid "" "Your registration is pending approval. Once approved you will be " "automatically redirected." msgstr "Twoja rejestracja oczekuje na aprobatę. Po aprobacie zostaniesz przekierowany automatycznie." # html/captive-portal/templates/emails/emails- # billing_stripe_customer.subscription.deleted.html msgid "Your subscribtion was cancelled." msgstr "Twoja subskrypcja została anulowana." # lib/pf/web.pm msgid "automatically refresh" msgstr "odśwież automatycznie" # pf::web::constants (Locales) msgid "de_DE" msgstr "Niemiecki" # html/captive- # portal/lib/captiveportal/PacketFence/Controller/Activate/Email.pm msgid "does not have permission to sponsor a user" msgstr "nie posiada uprawnień sponsora" # pf::web::constants (Locales) msgid "en_US" msgstr "Angielski" # html/captive-portal/lib/captiveportal/PacketFence/Controller/Violation.pm # lib/pf/web/release.pm msgid "error: max re-enables reached" msgstr "Maksymalna liczba aktywacji została osiągnięta" # lib/pf/web/release.pm msgid "error: not found in the database" msgstr "Twój komputer nie został odnaleziony w bazie PacketFence.\nUruchom komputer ponownie, aby rozwiązać problem." # pf::web::constants (Locales) msgid "es_ES" msgstr "Hiszpański" # pf::web::constants (Locales) msgid "fr_CA" msgstr "Francuski (CA)" # pf::web::constants (Locales) msgid "fr_FR" msgstr "Francuski" # pf::web::constants (Locales) msgid "he_IL" msgstr "" # html/captive-portal/templates/layout.html msgid "help: provide info" msgstr "" # pf::web::constants (Locales) msgid "it_IT" msgstr "" # pf::web::constants (Locales) msgid "nl_NL" msgstr "" # pf::web::constants (Locales) msgid "pl_PL" msgstr "" # pf::web::constants (Locales) msgid "pt_BR" msgstr "" # html/captive- # portal/lib/captiveportal/PacketFence/DynamicRouting/Module/Authentication/Blackhole.pm msgid "register: not allowed to register" msgstr "Nie masz uprawnień, aby zarejestrować się do tej sieci." # html/captive-portal/lib/captiveportal/PacketFence/DynamicRouting/Module.pm msgid "release: enabling network" msgstr "Aktywowanie dostępu do sieci." # lib/pf/web/release.pm msgid "release: reopen browser" msgstr "" # html/captive-portal/templates/emails/emails-guest_sponsor_activation.html msgid "requested guest access to your network." msgstr "" # lib/pf/web.pm msgid "scan in progress contact support if too long" msgstr "Skanowanie w toku, skontaktuj się ze wsparciem technicznym jeśli trwa to za długo." # html/captive-portal/lib/captiveportal/PacketFence/Controller/Remediation.pm # html/captive-portal/lib/captiveportal/PacketFence/Controller/Violation.pm # html/captive-portal/templates/scan-in-progress.html msgid "scan: scan in progress" msgstr "Twój system jest skanowany." # html/captive-portal/lib/captiveportal/PacketFence/Controller/Violation.pm # lib/pf/web.pm msgid "system scan in progress" msgstr "Twój system jest skanowany - proces ten potrwa %s sekund." # html/captive-portal/lib/captiveportal/PacketFence/Controller/Remediation.pm # html/captive-portal/lib/captiveportal/PacketFence/Controller/Violation.pm msgid "violation: quarantine established" msgstr ""
{ "pile_set_name": "Github" }
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2009 Gael Guennebaud <[email protected]> // Copyright (C) 2006-2008 Benoit Jacob <[email protected]> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. // This file is a base class plugin containing common coefficient wise functions. #ifndef EIGEN_PARSED_BY_DOXYGEN /** \internal the return type of conjugate() */ typedef typename internal::conditional<NumTraits<Scalar>::IsComplex, const CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Derived>, const Derived& >::type ConjugateReturnType; /** \internal the return type of real() const */ typedef typename internal::conditional<NumTraits<Scalar>::IsComplex, const CwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived>, const Derived& >::type RealReturnType; /** \internal the return type of real() */ typedef typename internal::conditional<NumTraits<Scalar>::IsComplex, CwiseUnaryView<internal::scalar_real_ref_op<Scalar>, Derived>, Derived& >::type NonConstRealReturnType; /** \internal the return type of imag() const */ typedef CwiseUnaryOp<internal::scalar_imag_op<Scalar>, const Derived> ImagReturnType; /** \internal the return type of imag() */ typedef CwiseUnaryView<internal::scalar_imag_ref_op<Scalar>, Derived> NonConstImagReturnType; typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> NegativeReturnType; #endif // not EIGEN_PARSED_BY_DOXYGEN /// \returns an expression of the opposite of \c *this /// EIGEN_DOC_UNARY_ADDONS(operator-,opposite) /// EIGEN_DEVICE_FUNC inline const NegativeReturnType operator-() const { return NegativeReturnType(derived()); } template<class NewType> struct CastXpr { typedef typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<Scalar, NewType>, const Derived> >::type Type; }; /// \returns an expression of \c *this with the \a Scalar type casted to /// \a NewScalar. /// /// The template parameter \a NewScalar is the type we are casting the scalars to. /// EIGEN_DOC_UNARY_ADDONS(cast,conversion function) /// /// \sa class CwiseUnaryOp /// template<typename NewType> EIGEN_DEVICE_FUNC typename CastXpr<NewType>::Type cast() const { return typename CastXpr<NewType>::Type(derived()); } template<int N> struct ShiftRightXpr { typedef CwiseUnaryOp<internal::scalar_shift_right_op<Scalar, N>, const Derived> Type; }; /// \returns an expression of \c *this with the \a Scalar type arithmetically /// shifted right by \a N bit positions. /// /// The template parameter \a N specifies the number of bit positions to shift. /// EIGEN_DOC_UNARY_ADDONS(cast,conversion function) /// /// \sa class CwiseUnaryOp /// template<int N> EIGEN_DEVICE_FUNC typename ShiftRightXpr<N>::Type shift_right() const { return typename ShiftRightXpr<N>::Type(derived()); } template<int N> struct ShiftLeftXpr { typedef CwiseUnaryOp<internal::scalar_shift_left_op<Scalar, N>, const Derived> Type; }; /// \returns an expression of \c *this with the \a Scalar type logically /// shifted left by \a N bit positions. /// /// The template parameter \a N specifies the number of bit positions to shift. /// EIGEN_DOC_UNARY_ADDONS(cast,conversion function) /// /// \sa class CwiseUnaryOp /// template<int N> EIGEN_DEVICE_FUNC typename ShiftLeftXpr<N>::Type shift_left() const { return typename ShiftLeftXpr<N>::Type(derived()); } /// \returns an expression of the complex conjugate of \c *this. /// EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate) /// /// \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_conj">Math functions</a>, MatrixBase::adjoint() EIGEN_DEVICE_FUNC inline ConjugateReturnType conjugate() const { return ConjugateReturnType(derived()); } /// \returns an expression of the complex conjugate of \c *this if Cond==true, returns derived() otherwise. /// EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate) /// /// \sa conjugate() template<bool Cond> EIGEN_DEVICE_FUNC inline typename internal::conditional<Cond,ConjugateReturnType,const Derived&>::type conjugateIf() const { typedef typename internal::conditional<Cond,ConjugateReturnType,const Derived&>::type ReturnType; return ReturnType(derived()); } /// \returns a read-only expression of the real part of \c *this. /// EIGEN_DOC_UNARY_ADDONS(real,real part function) /// /// \sa imag() EIGEN_DEVICE_FUNC inline RealReturnType real() const { return RealReturnType(derived()); } /// \returns an read-only expression of the imaginary part of \c *this. /// EIGEN_DOC_UNARY_ADDONS(imag,imaginary part function) /// /// \sa real() EIGEN_DEVICE_FUNC inline const ImagReturnType imag() const { return ImagReturnType(derived()); } /// \brief Apply a unary operator coefficient-wise /// \param[in] func Functor implementing the unary operator /// \tparam CustomUnaryOp Type of \a func /// \returns An expression of a custom coefficient-wise unary operator \a func of *this /// /// The function \c ptr_fun() from the C++ standard library can be used to make functors out of normal functions. /// /// Example: /// \include class_CwiseUnaryOp_ptrfun.cpp /// Output: \verbinclude class_CwiseUnaryOp_ptrfun.out /// /// Genuine functors allow for more possibilities, for instance it may contain a state. /// /// Example: /// \include class_CwiseUnaryOp.cpp /// Output: \verbinclude class_CwiseUnaryOp.out /// EIGEN_DOC_UNARY_ADDONS(unaryExpr,unary function) /// /// \sa unaryViewExpr, binaryExpr, class CwiseUnaryOp /// template<typename CustomUnaryOp> EIGEN_DEVICE_FUNC inline const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const { return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func); } /// \returns an expression of a custom coefficient-wise unary operator \a func of *this /// /// The template parameter \a CustomUnaryOp is the type of the functor /// of the custom unary operator. /// /// Example: /// \include class_CwiseUnaryOp.cpp /// Output: \verbinclude class_CwiseUnaryOp.out /// EIGEN_DOC_UNARY_ADDONS(unaryViewExpr,unary function) /// /// \sa unaryExpr, binaryExpr class CwiseUnaryOp /// template<typename CustomViewOp> EIGEN_DEVICE_FUNC inline const CwiseUnaryView<CustomViewOp, const Derived> unaryViewExpr(const CustomViewOp& func = CustomViewOp()) const { return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func); } /// \returns a non const expression of the real part of \c *this. /// EIGEN_DOC_UNARY_ADDONS(real,real part function) /// /// \sa imag() EIGEN_DEVICE_FUNC inline NonConstRealReturnType real() { return NonConstRealReturnType(derived()); } /// \returns a non const expression of the imaginary part of \c *this. /// EIGEN_DOC_UNARY_ADDONS(imag,imaginary part function) /// /// \sa real() EIGEN_DEVICE_FUNC inline NonConstImagReturnType imag() { return NonConstImagReturnType(derived()); }
{ "pile_set_name": "Github" }
/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" #include "apr_portable.h" #include "apr_arch_proc_mutex.h" #include "apr_arch_file_io.h" #include <string.h> #include <stddef.h> #define CurrentTid (*_threadid) static char *fixed_name(const char *fname, apr_pool_t *pool) { char *semname; if (fname == NULL) semname = NULL; else { // Semaphores don't live in the file system, fix up the name while (*fname == '/' || *fname == '\\') { fname++; } semname = apr_pstrcat(pool, "/SEM32/", fname, NULL); if (semname[8] == ':') { semname[8] = '$'; } } return semname; } APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *vmutex) { apr_proc_mutex_t *mutex = vmutex; return apr_proc_mutex_destroy(mutex); } APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) { return NULL; } APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return "os2sem"; } APR_DECLARE(const char *) apr_proc_mutex_defname(void) { return "os2sem"; } APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool) { apr_proc_mutex_t *new; ULONG rc; char *semname; if (mech != APR_LOCK_DEFAULT) { return APR_ENOTIMPL; } new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); new->pool = pool; new->owner = 0; new->lock_count = 0; *mutex = new; semname = fixed_name(fname, pool); rc = DosCreateMutexSem(semname, &(new->hMutex), DC_SEM_SHARED, FALSE); if (!rc) { apr_pool_cleanup_register(pool, new, apr_proc_mutex_cleanup, apr_pool_cleanup_null); } return APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) { apr_proc_mutex_t *new; ULONG rc; char *semname; new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); new->pool = pool; new->owner = 0; new->lock_count = 0; semname = fixed_name(fname, pool); rc = DosOpenMutexSem(semname, &(new->hMutex)); *mutex = new; if (!rc) { apr_pool_cleanup_register(pool, new, apr_proc_mutex_cleanup, apr_pool_cleanup_null); } return APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); if (rc == 0) { mutex->owner = CurrentTid; mutex->lock_count++; } return APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); if (rc == 0) { mutex->owner = CurrentTid; mutex->lock_count++; } return APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { ULONG rc; if (mutex->owner == CurrentTid && mutex->lock_count > 0) { mutex->lock_count--; rc = DosReleaseMutexSem(mutex->hMutex); return APR_FROM_OS_ERROR(rc); } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { ULONG rc; apr_status_t status = APR_SUCCESS; if (mutex->owner == CurrentTid) { while (mutex->lock_count > 0 && status == APR_SUCCESS) { status = apr_proc_mutex_unlock(mutex); } } if (status != APR_SUCCESS) { return status; } if (mutex->hMutex == 0) { return APR_SUCCESS; } rc = DosCloseMutexSem(mutex->hMutex); if (!rc) { mutex->hMutex = 0; } return APR_FROM_OS_ERROR(rc); } APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex) { *ospmutex = pmutex->hMutex; return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { apr_proc_mutex_t *new; new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); new->pool = pool; new->owner = 0; new->lock_count = 0; new->hMutex = *ospmutex; *pmutex = new; return APR_SUCCESS; }
{ "pile_set_name": "Github" }
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "sandbox/win/src/nt_internals.h" #include "sandbox/win/src/sandbox_types.h" #ifndef SANDBOX_SRC_POLICY_TARGET_H__ #define SANDBOX_SRC_POLICY_TARGET_H__ namespace sandbox { struct CountedParameterSetBase; // Performs a policy lookup and returns true if the request should be passed to // the broker process. bool QueryBroker(int ipc_id, CountedParameterSetBase* params); extern "C" { // Interception of NtSetInformationThread on the child process. // It should never be called directly. SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtSetInformationThread( NtSetInformationThreadFunction orig_SetInformationThread, HANDLE thread, NT_THREAD_INFORMATION_CLASS thread_info_class, PVOID thread_information, ULONG thread_information_bytes); // Interception of NtOpenThreadToken on the child process. // It should never be called directly SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenThreadToken( NtOpenThreadTokenFunction orig_OpenThreadToken, HANDLE thread, ACCESS_MASK desired_access, BOOLEAN open_as_self, PHANDLE token); // Interception of NtOpenThreadTokenEx on the child process. // It should never be called directly SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtOpenThreadTokenEx( NtOpenThreadTokenExFunction orig_OpenThreadTokenEx, HANDLE thread, ACCESS_MASK desired_access, BOOLEAN open_as_self, ULONG handle_attributes, PHANDLE token); } // extern "C" } // namespace sandbox #endif // SANDBOX_SRC_POLICY_TARGET_H__
{ "pile_set_name": "Github" }
EESchema Schematic File Version 2 LIBS:power LIBS:device LIBS:transistors LIBS:conn LIBS:linear LIBS:regul LIBS:74xx LIBS:cmos4000 LIBS:adc-dac LIBS:memory LIBS:xilinx LIBS:special LIBS:microcontrollers LIBS:dsp LIBS:microchip LIBS:analog_switches LIBS:motorola LIBS:texas LIBS:intel LIBS:audio LIBS:interface LIBS:digital-audio LIBS:philips LIBS:display LIBS:cypress LIBS:siliconi LIBS:opto LIBS:atmel LIBS:contrib LIBS:valves LIBS:FE LIBS:Duet0.85-cache EELAYER 27 0 EELAYER END $Descr A2 23386 16535 encoding utf-8 Sheet 2 7 Title "Duet" Date "7 jul 2015" Rev "0.85" Comp "Think3DPrint3D, RepRapPro" Comment1 "CERN OSH License 1.2" Comment2 "http://www.ohwr.org/attachments/2388/cern_ohl_v_1_2.txt" Comment3 "" Comment4 "" $EndDescr Wire Wire Line 4150 8600 5250 8600 Wire Wire Line 4150 8600 4150 8500 Wire Wire Line 10500 8100 10350 8100 Wire Wire Line 5250 2900 5100 2900 Wire Wire Line 9400 8200 9600 8200 Wire Wire Line 9600 8200 9600 8050 Wire Wire Line 9400 8500 9400 8600 Wire Wire Line 9400 8600 10500 8600 Wire Wire Line 4300 7950 4300 8050 Wire Wire Line 4300 3400 5250 3400 Wire Wire Line 4150 3000 4350 3000 Wire Wire Line 4350 3000 4350 2850 Wire Wire Line 9550 3400 10500 3400 Wire Wire Line 9600 2850 10350 2850 Wire Wire Line 10350 2850 10350 2900 Wire Wire Line 9600 3300 10350 3300 Wire Wire Line 9400 3150 9600 3150 Wire Wire Line 9600 3150 9600 3300 Wire Wire Line 9400 3300 9550 3300 Wire Wire Line 9550 3300 9550 3400 Wire Wire Line 10350 3300 10350 3250 Wire Wire Line 10350 3250 10500 3250 Wire Wire Line 9400 2850 9550 2850 Wire Wire Line 9550 2850 9550 2750 Wire Wire Line 9400 3000 9600 3000 Wire Wire Line 9600 3000 9600 2850 Wire Wire Line 4350 2850 5100 2850 Wire Wire Line 5100 2850 5100 2900 Wire Wire Line 4350 3300 5100 3300 Wire Wire Line 4150 3300 4300 3300 Wire Wire Line 4300 3300 4300 3400 Wire Wire Line 5100 3300 5100 3250 Wire Wire Line 5100 3250 5250 3250 Wire Wire Line 4150 2850 4300 2850 Wire Wire Line 4300 2850 4300 2750 Wire Wire Line 10500 8450 10350 8450 Wire Wire Line 10350 8450 10350 8500 Wire Wire Line 10350 8500 9600 8500 Wire Wire Line 10350 8100 10350 8050 Wire Wire Line 10350 8050 9600 8050 Wire Wire Line 4350 8050 5100 8050 Wire Wire Line 5100 8050 5100 8100 Wire Wire Line 4350 8500 5100 8500 Wire Wire Line 9500 8950 9500 9000 Wire Wire Line 9500 9000 9400 9000 Wire Wire Line 9400 8750 9500 8750 Wire Wire Line 9400 3550 9500 3550 Wire Wire Line 9400 3800 9500 3800 Wire Wire Line 9500 3800 9500 3750 Wire Wire Line 4250 3750 4250 3800 Wire Wire Line 4250 3800 4150 3800 Wire Wire Line 4150 3550 4250 3550 Wire Wire Line 4150 8750 4250 8750 Connection ~ 7500 7350 Connection ~ 7500 7750 Wire Wire Line 7500 7100 7500 8050 Connection ~ 2250 7350 Connection ~ 2250 7750 Wire Wire Line 2250 7100 2250 8050 Connection ~ 7500 2150 Connection ~ 7500 2550 Wire Wire Line 7500 1900 7500 2850 Connection ~ 2250 2150 Connection ~ 2250 2550 Wire Wire Line 2250 1900 2250 2850 Connection ~ 10500 9250 Wire Wire Line 10500 9250 10500 9350 Connection ~ 5200 4050 Wire Wire Line 5200 4050 5200 4150 Connection ~ 14700 2650 Wire Wire Line 14500 2650 14700 2650 Connection ~ 12600 1750 Wire Wire Line 12600 1750 15000 1750 Connection ~ 12600 1200 Wire Wire Line 12600 1250 12600 1200 Connection ~ 12800 2300 Wire Wire Line 13000 2300 12800 2300 Wire Wire Line 12200 2400 13000 2400 Wire Wire Line 15000 2850 14500 2850 Wire Wire Line 15000 1750 15000 2850 Connection ~ 7900 7050 Wire Wire Line 7900 7050 7650 7050 Wire Wire Line 7650 7050 7650 7000 Connection ~ 7900 1850 Wire Wire Line 7900 1850 7650 1850 Wire Wire Line 7650 1850 7650 1800 Connection ~ 2650 1850 Wire Wire Line 2650 1850 2400 1850 Wire Wire Line 2400 1850 2400 1800 Connection ~ 2650 7050 Wire Wire Line 2650 7050 2400 7050 Wire Wire Line 2400 7050 2400 7000 Connection ~ 15000 1950 Connection ~ 13750 1250 Wire Wire Line 15250 1700 15250 1250 Wire Wire Line 17650 4200 17650 4400 Wire Wire Line 17650 1550 17650 1800 Wire Wire Line 12450 1800 12450 1850 Wire Wire Line 12200 1800 12450 1800 Wire Wire Line 12200 1800 12200 1850 Connection ~ 10000 5350 Wire Wire Line 6900 5350 10300 5350 Wire Wire Line 10300 5350 10300 5100 Connection ~ 4750 5350 Wire Wire Line 1650 5350 5050 5350 Wire Wire Line 5050 5350 5050 5100 Connection ~ 4750 10550 Wire Wire Line 1650 10550 5050 10550 Wire Wire Line 5050 10550 5050 10300 Connection ~ 10000 10550 Wire Wire Line 6900 10550 10300 10550 Wire Wire Line 10300 10550 10300 10300 Connection ~ 14700 2300 Wire Wire Line 14700 3400 14700 2150 Wire Wire Line 14700 2150 14500 2150 Wire Wire Line 19450 4950 19450 5050 Connection ~ 17650 5550 Wire Wire Line 17650 5400 17650 5550 Connection ~ 17650 2950 Wire Wire Line 17650 2800 17650 2950 Wire Wire Line 19550 2300 19550 2400 Wire Bus Line 15550 4200 15750 4200 Wire Wire Line 17000 6250 17000 6050 Wire Wire Line 18900 3600 18900 3400 Wire Wire Line 18700 5550 18950 5550 Wire Wire Line 18700 2950 19000 2950 Wire Wire Line 19400 2950 19750 2950 Wire Wire Line 17500 2950 17850 2950 Wire Wire Line 15250 3400 15250 2100 Wire Wire Line 2650 6700 2650 6550 Wire Wire Line 7900 6700 7900 6550 Wire Wire Line 7900 1700 7900 2000 Wire Wire Line 2650 1500 2650 1350 Connection ~ 17000 2950 Wire Wire Line 17000 3200 17000 2950 Connection ~ 12450 2500 Wire Wire Line 12450 2250 12450 2500 Wire Notes Line 11750 750 11750 4200 Wire Notes Line 15750 750 15750 4200 Wire Notes Line 11750 4200 15550 4200 Wire Notes Line 11150 10850 11150 5950 Wire Notes Line 5900 750 5900 5650 Wire Notes Line 5900 750 1050 750 Wire Notes Line 1050 750 1050 5650 Wire Notes Line 1050 5650 5900 5650 Wire Wire Line 7500 8050 7700 8050 Wire Wire Line 7500 2850 7700 2850 Wire Wire Line 1850 3000 2450 3000 Wire Wire Line 1850 8200 2450 8200 Wire Wire Line 9400 9250 10650 9250 Wire Wire Line 4150 4050 5400 4050 Wire Wire Line 12100 2500 13000 2500 Connection ~ 13750 3400 Wire Wire Line 13750 3250 13750 3600 Wire Wire Line 14500 2750 15300 2750 Connection ~ 7600 3600 Wire Wire Line 7600 3600 7600 3750 Wire Wire Line 7600 3750 7500 3750 Connection ~ 7600 8800 Wire Wire Line 7600 8800 7600 8950 Wire Wire Line 7600 8950 7500 8950 Wire Wire Line 2450 3250 2250 3250 Wire Wire Line 3600 1400 3600 2300 Wire Wire Line 2050 1550 2050 1900 Wire Wire Line 2200 3600 2450 3600 Wire Wire Line 4100 2150 4100 2350 Connection ~ 3400 2200 Wire Wire Line 3000 2300 3000 2150 Wire Wire Line 3000 2150 2900 2150 Wire Wire Line 2900 2150 2900 1950 Wire Wire Line 3250 2300 3250 2200 Wire Wire Line 2450 4200 2300 4200 Wire Wire Line 2300 4200 2300 4050 Wire Wire Line 2250 4750 2250 4700 Wire Wire Line 2250 4700 2450 4700 Wire Wire Line 1900 4800 1900 4550 Wire Wire Line 1900 4550 2450 4550 Connection ~ 4350 5350 Wire Wire Line 4750 5350 4750 5150 Wire Wire Line 4150 4350 4750 4350 Wire Wire Line 4750 4350 4750 4650 Connection ~ 3150 5350 Wire Wire Line 3300 5350 3300 5100 Wire Wire Line 3150 5350 3150 5100 Wire Wire Line 1650 5350 1650 5500 Wire Wire Line 3450 5350 3450 5100 Connection ~ 3300 5350 Wire Wire Line 4350 4650 4350 4500 Wire Wire Line 4350 4500 4150 4500 Wire Wire Line 4350 5350 4350 5150 Connection ~ 3450 5350 Wire Wire Line 1900 5200 1900 5350 Connection ~ 1900 5350 Wire Wire Line 2250 5350 2250 5250 Connection ~ 2250 5350 Wire Wire Line 3250 2200 3400 2200 Wire Wire Line 2200 4050 2450 4050 Connection ~ 2300 4050 Wire Wire Line 4100 1750 4100 1650 Wire Wire Line 4100 1650 3600 1650 Connection ~ 3600 1650 Wire Wire Line 3400 1950 3300 1950 Connection ~ 3400 1950 Connection ~ 3400 1350 Wire Wire Line 1450 4050 1700 4050 Wire Wire Line 1700 3600 1450 3600 Connection ~ 1450 3600 Wire Wire Line 1450 3350 1450 4050 Connection ~ 2050 1900 Wire Wire Line 3400 1150 3400 2300 Wire Wire Line 2450 3400 2250 3400 Wire Wire Line 7700 3400 7500 3400 Wire Wire Line 8650 1150 8650 2300 Connection ~ 7300 1900 Wire Wire Line 6700 3350 6700 4050 Connection ~ 6700 3600 Wire Wire Line 6950 3600 6700 3600 Wire Wire Line 6700 4050 6950 4050 Connection ~ 8650 1350 Connection ~ 8650 1950 Wire Wire Line 8650 1950 8550 1950 Connection ~ 8850 1650 Wire Wire Line 8850 1650 9350 1650 Wire Wire Line 9350 1650 9350 1750 Connection ~ 7550 4050 Wire Wire Line 7450 4050 7700 4050 Wire Wire Line 8650 2200 8500 2200 Connection ~ 7500 5350 Wire Wire Line 7500 5350 7500 5250 Connection ~ 7150 5350 Wire Wire Line 7150 5200 7150 5350 Connection ~ 8700 5350 Wire Wire Line 9600 5350 9600 5150 Wire Wire Line 9400 4500 9600 4500 Wire Wire Line 9600 4500 9600 4650 Connection ~ 8550 5350 Wire Wire Line 8700 5350 8700 5100 Wire Wire Line 6900 5350 6900 5500 Wire Wire Line 8400 5350 8400 5100 Wire Wire Line 8550 5350 8550 5100 Connection ~ 8400 5350 Wire Wire Line 10000 4650 10000 4350 Wire Wire Line 10000 4350 9400 4350 Wire Wire Line 10000 5350 10000 5150 Connection ~ 9600 5350 Wire Wire Line 7700 4550 7150 4550 Wire Wire Line 7150 4550 7150 4800 Wire Wire Line 7700 4700 7500 4700 Wire Wire Line 7500 4700 7500 4750 Wire Wire Line 7550 4050 7550 4200 Wire Wire Line 7550 4200 7700 4200 Wire Wire Line 8500 2200 8500 2300 Wire Wire Line 8150 1950 8150 2150 Wire Wire Line 8150 2150 8250 2150 Wire Wire Line 8250 2150 8250 2300 Connection ~ 8650 2200 Wire Wire Line 9350 2150 9350 2350 Wire Wire Line 7450 3600 7700 3600 Wire Wire Line 7300 1550 7300 1900 Wire Wire Line 8850 1400 8850 2300 Wire Wire Line 7700 3250 7500 3250 Wire Wire Line 7700 8450 7500 8450 Wire Wire Line 8850 6600 8850 7500 Wire Wire Line 7300 6750 7300 7100 Wire Wire Line 7450 8800 7700 8800 Wire Wire Line 9350 7350 9350 7550 Connection ~ 8650 7400 Wire Wire Line 8250 7500 8250 7350 Wire Wire Line 8250 7350 8150 7350 Wire Wire Line 8150 7350 8150 7150 Wire Wire Line 8500 7500 8500 7400 Wire Wire Line 7700 9400 7550 9400 Wire Wire Line 7550 9400 7550 9250 Wire Wire Line 7500 9950 7500 9900 Wire Wire Line 7500 9900 7700 9900 Wire Wire Line 7150 10000 7150 9750 Wire Wire Line 7150 9750 7700 9750 Connection ~ 9600 10550 Wire Wire Line 10000 10550 10000 10350 Wire Wire Line 9400 9550 10000 9550 Wire Wire Line 10000 9550 10000 9850 Connection ~ 8400 10550 Wire Wire Line 8550 10550 8550 10300 Wire Wire Line 8400 10550 8400 10300 Wire Wire Line 6900 10550 6900 10700 Wire Wire Line 8700 10550 8700 10300 Connection ~ 8550 10550 Wire Wire Line 9600 9850 9600 9700 Wire Wire Line 9600 9700 9400 9700 Wire Wire Line 9600 10550 9600 10350 Connection ~ 8700 10550 Wire Wire Line 7150 10400 7150 10550 Connection ~ 7150 10550 Wire Wire Line 7500 10550 7500 10450 Connection ~ 7500 10550 Wire Wire Line 8500 7400 8650 7400 Wire Wire Line 7450 9250 7700 9250 Connection ~ 7550 9250 Wire Wire Line 9350 6950 9350 6850 Wire Wire Line 9350 6850 8850 6850 Connection ~ 8850 6850 Wire Wire Line 8650 7150 8550 7150 Connection ~ 8650 7150 Connection ~ 8650 6550 Wire Wire Line 6700 9250 6950 9250 Wire Wire Line 6950 8800 6700 8800 Connection ~ 6700 8800 Wire Wire Line 6700 8550 6700 9250 Connection ~ 7300 7100 Wire Wire Line 8650 6350 8650 7500 Wire Wire Line 7700 8600 7500 8600 Wire Wire Line 2450 8600 2250 8600 Wire Wire Line 3400 6350 3400 7500 Connection ~ 2050 7100 Wire Wire Line 1450 8550 1450 9250 Connection ~ 1450 8800 Wire Wire Line 1700 8800 1450 8800 Wire Wire Line 1450 9250 1700 9250 Connection ~ 3400 6550 Connection ~ 3400 7150 Wire Wire Line 3400 7150 3300 7150 Connection ~ 3600 6850 Wire Wire Line 3600 6850 4100 6850 Wire Wire Line 4100 6850 4100 6950 Connection ~ 2300 9250 Wire Wire Line 2200 9250 2450 9250 Wire Wire Line 3400 7400 3250 7400 Connection ~ 2250 10550 Wire Wire Line 2250 10550 2250 10450 Connection ~ 1900 10550 Wire Wire Line 1900 10400 1900 10550 Connection ~ 3450 10550 Wire Wire Line 4350 10550 4350 10350 Wire Wire Line 4150 9700 4350 9700 Wire Wire Line 4350 9700 4350 9850 Connection ~ 3300 10550 Wire Wire Line 3450 10550 3450 10300 Wire Wire Line 1650 10550 1650 10700 Wire Wire Line 3150 10550 3150 10300 Wire Wire Line 3300 10550 3300 10300 Connection ~ 3150 10550 Wire Wire Line 4750 9850 4750 9550 Wire Wire Line 4750 9550 4150 9550 Wire Wire Line 4750 10550 4750 10350 Connection ~ 4350 10550 Wire Wire Line 2450 9750 1900 9750 Wire Wire Line 1900 9750 1900 10000 Wire Wire Line 2450 9900 2250 9900 Wire Wire Line 2250 9900 2250 9950 Wire Wire Line 2300 9250 2300 9400 Wire Wire Line 2300 9400 2450 9400 Wire Wire Line 3250 7400 3250 7500 Wire Wire Line 2900 7150 2900 7350 Wire Wire Line 2900 7350 3000 7350 Wire Wire Line 3000 7350 3000 7500 Connection ~ 3400 7400 Wire Wire Line 4100 7350 4100 7550 Wire Wire Line 2200 8800 2450 8800 Wire Wire Line 2050 6750 2050 7100 Wire Wire Line 3600 6600 3600 7500 Wire Wire Line 2450 8450 2250 8450 Wire Wire Line 2250 8950 2350 8950 Wire Wire Line 2350 8950 2350 8800 Connection ~ 2350 8800 Wire Wire Line 2250 3750 2350 3750 Wire Wire Line 2350 3750 2350 3600 Connection ~ 2350 3600 Wire Wire Line 13000 2750 12150 2750 Wire Wire Line 14500 2050 14650 2050 Wire Wire Line 13750 1150 13750 1550 Wire Wire Line 4150 9250 5400 9250 Wire Wire Line 9400 4050 10650 4050 Wire Wire Line 1850 7100 2250 7100 Wire Wire Line 2250 8050 2450 8050 Wire Wire Line 2250 2850 2450 2850 Wire Wire Line 1850 1900 2250 1900 Wire Wire Line 7100 3000 7700 3000 Wire Wire Line 7100 1900 7500 1900 Wire Wire Line 7100 8200 7700 8200 Wire Wire Line 7100 7100 7500 7100 Wire Notes Line 6400 750 6400 5650 Wire Notes Line 6400 750 11150 750 Wire Notes Line 11150 750 11150 5650 Wire Notes Line 11150 5650 6400 5650 Wire Notes Line 11150 10850 6400 10850 Wire Notes Line 11150 5950 6400 5950 Wire Notes Line 6400 5950 6400 10850 Wire Notes Line 5900 10850 1050 10850 Wire Notes Line 5900 5950 1050 5950 Wire Notes Line 5900 5950 5900 10850 Wire Notes Line 1050 5950 1050 10850 Wire Notes Line 20250 750 16400 750 Wire Notes Line 20250 750 20250 10850 Wire Notes Line 20250 10850 16400 10850 Wire Notes Line 16400 10850 16400 750 Wire Wire Line 12200 2250 12200 2400 Connection ~ 12200 2350 Connection ~ 17000 5550 Wire Wire Line 17000 5850 17000 5550 Wire Wire Line 17450 5550 17850 5550 Wire Wire Line 19350 5550 19700 5550 Wire Wire Line 18900 5850 18900 5550 Connection ~ 18900 5550 Wire Wire Line 2650 1700 2650 2000 Wire Wire Line 7900 1500 7900 1350 Wire Wire Line 7900 6900 7900 7200 Wire Wire Line 2650 6900 2650 7200 Wire Wire Line 14500 2300 14700 2300 Connection ~ 14700 3400 Wire Wire Line 18900 3200 18900 2950 Connection ~ 18900 2950 Wire Wire Line 16800 2950 17100 2950 Wire Wire Line 16800 5550 17050 5550 Wire Wire Line 17000 3600 17000 3400 Wire Wire Line 18900 6250 18900 6050 Wire Wire Line 15600 2100 15600 2400 Wire Wire Line 15600 2400 14500 2400 Wire Wire Line 19550 2800 19550 2950 Connection ~ 19550 2950 Wire Wire Line 17650 2400 17650 2300 Wire Wire Line 17650 5000 17650 4900 Wire Wire Line 19450 5450 19450 5550 Connection ~ 19450 5550 Wire Wire Line 10300 9250 10300 9900 Connection ~ 10300 9250 Wire Wire Line 5050 9250 5050 9900 Connection ~ 5050 9250 Wire Wire Line 5050 4050 5050 4700 Connection ~ 5050 4050 Wire Wire Line 10300 4050 10300 4700 Connection ~ 10300 4050 Wire Wire Line 12950 2050 13000 2050 Connection ~ 12350 1800 Wire Wire Line 19550 1550 19550 1800 Wire Wire Line 19450 4200 19450 4450 Wire Wire Line 12350 1200 13750 1200 Wire Wire Line 12350 1200 12350 1800 Connection ~ 13750 1200 Wire Wire Line 13750 1250 15600 1250 Wire Wire Line 15600 1250 15600 1700 Connection ~ 15250 1250 Wire Wire Line 14500 1950 15000 1950 Wire Wire Line 2400 6600 2400 6550 Wire Wire Line 2400 6550 3400 6550 Connection ~ 2650 6550 Wire Wire Line 2400 1400 2400 1350 Wire Wire Line 2400 1350 3400 1350 Connection ~ 2650 1350 Wire Wire Line 7650 1400 7650 1350 Wire Wire Line 7650 1350 8650 1350 Connection ~ 7900 1350 Wire Wire Line 7650 6600 7650 6550 Wire Wire Line 7650 6550 8650 6550 Connection ~ 7900 6550 Wire Wire Line 12150 2350 12200 2350 Wire Wire Line 13000 2150 12800 2150 Wire Wire Line 12800 2150 12800 3400 Wire Wire Line 12800 3400 15250 3400 Wire Wire Line 12600 2850 13000 2850 Wire Wire Line 12600 1650 12600 2850 Wire Wire Line 12600 1950 13000 1950 Connection ~ 12600 1950 Wire Wire Line 13000 2650 12800 2650 Connection ~ 12800 2650 Wire Wire Line 10450 4150 10450 4050 Connection ~ 10450 4050 Wire Wire Line 5200 9450 5200 9250 Connection ~ 5200 9250 Wire Wire Line 1850 1900 1850 3000 Connection ~ 1850 2550 Connection ~ 1850 2150 Wire Wire Line 7100 1900 7100 3000 Connection ~ 7100 2550 Connection ~ 7100 2150 Wire Wire Line 1850 7100 1850 8200 Connection ~ 1850 7750 Connection ~ 1850 7350 Wire Wire Line 7100 7100 7100 8200 Connection ~ 7100 7750 Connection ~ 7100 7350 Wire Wire Line 4150 9000 4250 9000 Wire Wire Line 4250 9000 4250 8950 Wire Wire Line 5100 8500 5100 8450 Wire Wire Line 5100 8450 5250 8450 Wire Wire Line 4300 8050 4150 8050 Wire Wire Line 4300 2750 5250 2750 Wire Wire Line 4150 3150 4350 3150 Wire Wire Line 4350 3150 4350 3300 Wire Wire Line 4350 8050 4350 8200 Wire Wire Line 4350 8200 4150 8200 Wire Wire Line 9600 8500 9600 8350 Wire Wire Line 9600 8350 9400 8350 Wire Wire Line 9400 7950 10500 7950 Wire Wire Line 9400 7950 9400 8050 Wire Wire Line 10350 2900 10500 2900 Wire Wire Line 5100 8100 5250 8100 Wire Wire Line 4150 8350 4350 8350 Wire Wire Line 4350 8350 4350 8500 $Comp L CSMALL C39 U 1 1 53B04F8E P 9500 8850 F 0 "C39" H 9525 8900 30 0000 L CNN F 1 "0u1" H 9525 8800 30 0000 L CNN F 2 "" H 9500 8850 60 0001 C CNN F 3 "" H 9500 8850 60 0001 C CNN 1 9500 8850 1 0 0 -1 $EndComp $Comp L CSMALL C38 U 1 1 53B04F7A P 9500 3650 F 0 "C38" H 9525 3700 30 0000 L CNN F 1 "0u1" H 9525 3600 30 0000 L CNN F 2 "" H 9500 3650 60 0001 C CNN F 3 "" H 9500 3650 60 0001 C CNN 1 9500 3650 1 0 0 -1 $EndComp $Comp L CSMALL C28 U 1 1 53B04F5B P 4250 3650 F 0 "C28" H 4275 3700 30 0000 L CNN F 1 "0u1" H 4275 3600 30 0000 L CNN F 2 "" H 4250 3650 60 0001 C CNN F 3 "" H 4250 3650 60 0001 C CNN 1 4250 3650 1 0 0 -1 $EndComp $Comp L CSMALL C29 U 1 1 53B04F24 P 4250 8850 F 0 "C29" H 4275 8900 30 0000 L CNN F 1 "0u1" H 4275 8800 30 0000 L CNN F 2 "" H 4250 8850 60 0001 C CNN F 3 "" H 4250 8850 60 0001 C CNN 1 4250 8850 1 0 0 -1 $EndComp $Comp L SJ SJ2 U 1 1 526126AF P 2250 2350 F 0 "SJ2" H 2350 2500 50 0000 C CNN F 1 "MS1" H 2350 2201 40 0000 C CNN F 2 "" H 2250 2350 60 0001 C CNN F 3 "" H 2250 2350 60 0001 C CNN 1 2250 2350 1 0 0 -1 $EndComp $Comp L SJ SJ4 U 1 1 526126AB P 7500 2350 F 0 "SJ4" H 7600 2500 50 0000 C CNN F 1 "MS1" H 7600 2201 40 0000 C CNN F 2 "" H 7500 2350 60 0001 C CNN F 3 "" H 7500 2350 60 0001 C CNN 1 7500 2350 1 0 0 -1 $EndComp $Comp L SJ SJ6 U 1 1 526126A8 P 2250 7550 F 0 "SJ6" H 2350 7700 50 0000 C CNN F 1 "MS1" H 2350 7401 40 0000 C CNN F 2 "" H 2250 7550 60 0001 C CNN F 3 "" H 2250 7550 60 0001 C CNN 1 2250 7550 1 0 0 -1 $EndComp $Comp L SJ SJ8 U 1 1 5261269E P 7500 7550 F 0 "SJ8" H 7600 7700 50 0000 C CNN F 1 "MS1" H 7600 7401 40 0000 C CNN F 2 "" H 7500 7550 60 0001 C CNN F 3 "" H 7500 7550 60 0001 C CNN 1 7500 7550 1 0 0 -1 $EndComp $Comp L SJ SJ7 U 1 1 5261269B P 7100 7550 F 0 "SJ7" H 7200 7700 50 0000 C CNN F 1 "MS2" H 7200 7401 40 0000 C CNN F 2 "" H 7100 7550 60 0001 C CNN F 3 "" H 7100 7550 60 0001 C CNN 1 7100 7550 1 0 0 -1 $EndComp $Comp L SJ SJ5 U 1 1 52612697 P 1850 7550 F 0 "SJ5" H 1950 7700 50 0000 C CNN F 1 "MS2" H 1950 7401 40 0000 C CNN F 2 "" H 1850 7550 60 0001 C CNN F 3 "" H 1850 7550 60 0001 C CNN 1 1850 7550 1 0 0 -1 $EndComp $Comp L SJ SJ3 U 1 1 52612692 P 7100 2350 F 0 "SJ3" H 7200 2500 50 0000 C CNN F 1 "MS2" H 7200 2201 40 0000 C CNN F 2 "" H 7100 2350 60 0001 C CNN F 3 "" H 7100 2350 60 0001 C CNN 1 7100 2350 1 0 0 -1 $EndComp $Comp L SJ SJ1 U 1 1 52612673 P 1850 2350 F 0 "SJ1" H 1950 2500 50 0000 C CNN F 1 "MS2" H 1950 2201 40 0000 C CNN F 2 "" H 1850 2350 60 0001 C CNN F 3 "" H 1850 2350 60 0001 C CNN 1 1850 2350 1 0 0 -1 $EndComp $Comp L VREF J18 U 1 1 517D1780 P 10500 9350 F 0 "J18" H 10300 9500 60 0000 C CNN F 1 "E0 VREF" H 10300 9600 60 0000 C CNN F 2 "" H 10500 9350 60 0001 C CNN F 3 "" H 10500 9350 60 0001 C CNN 1 10500 9350 -1 0 0 1 $EndComp $Comp L VREF J16 U 1 1 517D177D P 5200 9450 F 0 "J16" H 5050 9600 60 0000 C CNN F 1 "Z VREF" H 5000 9500 60 0000 C CNN F 2 "" H 5200 9450 60 0001 C CNN F 3 "" H 5200 9450 60 0001 C CNN 1 5200 9450 -1 0 0 1 $EndComp $Comp L VREF J3 U 1 1 517D1776 P 5200 4150 F 0 "J3" H 5000 4350 60 0000 C CNN F 1 "X VREF" H 5000 4450 60 0000 C CNN F 2 "" H 5200 4150 60 0001 C CNN F 3 "" H 5200 4150 60 0001 C CNN 1 5200 4150 -1 0 0 1 $EndComp $Comp L VREF J17 U 1 1 517D175F P 10450 4150 F 0 "J17" H 10250 4450 60 0000 C CNN F 1 "Y VREF" H 10250 4350 60 0000 C CNN F 2 "" H 10450 4150 60 0001 C CNN F 3 "" H 10450 4150 60 0001 C CNN 1 10450 4150 -1 0 0 1 $EndComp $Comp L MCP44X1 U9 U 1 1 51756C1C P 13750 2350 F 0 "U9" H 13600 1700 60 0000 C CNN F 1 "MCP44X1" H 13750 2350 60 0000 C CNN F 2 "" H 13750 2350 60 0001 C CNN F 3 "" H 13750 2350 60 0001 C CNN 1 13750 2350 1 0 0 -1 $EndComp $Comp L C C78 U 1 1 511A9A28 P 7650 6800 F 0 "C78" H 7700 6900 50 0000 L CNN F 1 "0u1" H 7700 6700 50 0000 L CNN F 2 "" H 7650 6800 60 0001 C CNN F 3 "" H 7650 6800 60 0001 C CNN 1 7650 6800 -1 0 0 1 $EndComp $Comp L C C77 U 1 1 511A9A18 P 7650 1600 F 0 "C77" H 7700 1700 50 0000 L CNN F 1 "0u1" H 7700 1500 50 0000 L CNN F 2 "" H 7650 1600 60 0001 C CNN F 3 "" H 7650 1600 60 0001 C CNN 1 7650 1600 -1 0 0 1 $EndComp $Comp L C C75 U 1 1 511A9A0A P 2400 1600 F 0 "C75" H 2450 1700 50 0000 L CNN F 1 "0u1" H 2450 1500 50 0000 L CNN F 2 "" H 2400 1600 60 0001 C CNN F 3 "" H 2400 1600 60 0001 C CNN 1 2400 1600 -1 0 0 1 $EndComp $Comp L C C76 U 1 1 511A99F6 P 2400 6800 F 0 "C76" H 2450 6900 50 0000 L CNN F 1 "0u1" H 2450 6700 50 0000 L CNN F 2 "" H 2400 6800 60 0001 C CNN F 3 "" H 2400 6800 60 0001 C CNN 1 2400 6800 -1 0 0 1 $EndComp Text Notes 11800 3800 0 60 ~ 0 2k7 resistor chosen to give range of VRef with 0R1 sense resistors \nfor full range of current, to use the maximum current\ncooling would be required. $Comp L GND #PWR01 U 1 1 50FEF973 P 17000 6250 F 0 "#PWR01" H 17000 6250 30 0001 C CNN F 1 "GND" H 17000 6180 30 0001 C CNN F 2 "" H 17000 6250 60 0001 C CNN F 3 "" H 17000 6250 60 0001 C CNN 1 17000 6250 1 0 0 -1 $EndComp $Comp L R_SMALL R37 U 1 1 50F9A148 P 12600 1450 F 0 "R37" V 12675 1458 50 0000 C CNN F 1 "2k7" V 12532 1462 50 0000 C CNN F 2 "" H 12600 1450 60 0001 C CNN F 3 "" H 12600 1450 60 0001 C CNN 1 12600 1450 1 0 0 -1 $EndComp $Comp L C C57 U 1 1 509EB18C P 10300 10100 F 0 "C57" H 10350 10200 50 0000 L CNN F 1 "0u1" H 10350 10000 50 0000 L CNN F 2 "" H 10300 10100 60 0001 C CNN F 3 "" H 10300 10100 60 0001 C CNN 1 10300 10100 1 0 0 -1 $EndComp $Comp L C C15 U 1 1 509EB180 P 5050 10100 F 0 "C15" H 5100 10200 50 0000 L CNN F 1 "0u1" H 5100 10000 50 0000 L CNN F 2 "" H 5050 10100 60 0001 C CNN F 3 "" H 5050 10100 60 0001 C CNN 1 5050 10100 1 0 0 -1 $EndComp $Comp L C C56 U 1 1 509EB177 P 10300 4900 F 0 "C56" H 10350 5000 50 0000 L CNN F 1 "0u1" H 10350 4800 50 0000 L CNN F 2 "" H 10300 4900 60 0001 C CNN F 3 "" H 10300 4900 60 0001 C CNN 1 10300 4900 1 0 0 -1 $EndComp $Comp L C C14 U 1 1 509EB16A P 5050 4900 F 0 "C14" H 5100 5000 50 0000 L CNN F 1 "0u1" H 5100 4800 50 0000 L CNN F 2 "" H 5050 4900 60 0001 C CNN F 3 "" H 5050 4900 60 0001 C CNN 1 5050 4900 1 0 0 -1 $EndComp $Comp L R R71 U 1 1 509D8605 P 19450 4700 F 0 "R71" V 19530 4700 50 0000 C CNN F 1 "680R" V 19350 4700 50 0000 C CNN F 2 "" H 19450 4700 60 0001 C CNN F 3 "" H 19450 4700 60 0001 C CNN 1 19450 4700 -1 0 0 1 $EndComp $Comp L LED D11 U 1 1 509D8604 P 19450 5250 F 0 "D11" H 19450 5350 50 0000 C CNN F 1 "E0 Stop" H 19450 5150 50 0000 C CNN F 2 "" H 19450 5250 60 0001 C CNN F 3 "" H 19450 5250 60 0001 C CNN 1 19450 5250 0 1 1 0 $EndComp $Comp L R R70 U 1 1 509D8602 P 17650 4650 F 0 "R70" V 17730 4650 50 0000 C CNN F 1 "680R" V 17550 4650 50 0000 C CNN F 2 "" H 17650 4650 60 0001 C CNN F 3 "" H 17650 4650 60 0001 C CNN 1 17650 4650 -1 0 0 1 $EndComp $Comp L LED D10 U 1 1 509D8601 P 17650 5200 F 0 "D10" H 17650 5300 50 0000 C CNN F 1 "Z Stop" H 17650 5100 50 0000 C CNN F 2 "" H 17650 5200 60 0001 C CNN F 3 "" H 17650 5200 60 0001 C CNN 1 17650 5200 0 1 1 0 $EndComp $Comp L R R72 U 1 1 509D85FC P 19550 2050 F 0 "R72" V 19630 2050 50 0000 C CNN F 1 "680R" V 19450 2050 50 0000 C CNN F 2 "" H 19550 2050 60 0001 C CNN F 3 "" H 19550 2050 60 0001 C CNN 1 19550 2050 -1 0 0 1 $EndComp $Comp L LED D12 U 1 1 509D85FB P 19550 2600 F 0 "D12" H 19550 2700 50 0000 C CNN F 1 "X Stop" H 19550 2500 50 0000 C CNN F 2 "" H 19550 2600 60 0001 C CNN F 3 "" H 19550 2600 60 0001 C CNN 1 19550 2600 0 1 1 0 $EndComp $Comp L R R69 U 1 1 509D85F8 P 17650 2050 F 0 "R69" V 17730 2050 50 0000 C CNN F 1 "680R" V 17550 2050 50 0000 C CNN F 2 "" H 17650 2050 60 0001 C CNN F 3 "" H 17650 2050 60 0001 C CNN 1 17650 2050 -1 0 0 1 $EndComp $Comp L LED D9 U 1 1 509D85F7 P 17650 2600 F 0 "D9" H 17650 2700 50 0000 C CNN F 1 "Y Stop" H 17650 2500 50 0000 C CNN F 2 "" H 17650 2600 60 0001 C CNN F 3 "" H 17650 2600 60 0001 C CNN 1 17650 2600 0 1 1 0 $EndComp $Comp L R_SMALL R66 U 1 1 509AE2F6 P 15600 1900 F 0 "R66" V 15675 1908 50 0000 C CNN F 1 "10k" V 15532 1912 50 0000 C CNN F 2 "" H 15600 1900 60 0001 C CNN F 3 "" H 15600 1900 60 0001 C CNN 1 15600 1900 1 0 0 -1 $EndComp Text GLabel 19450 4200 1 39 Input ~ 0 +3.3V $Comp L GND #PWR02 U 1 1 509056E6 P 18900 6250 F 0 "#PWR02" H 18900 6250 30 0001 C CNN F 1 "GND" H 18900 6180 30 0001 C CNN F 2 "" H 18900 6250 60 0001 C CNN F 3 "" H 18900 6250 60 0001 C CNN 1 18900 6250 1 0 0 -1 $EndComp Text GLabel 19550 1550 1 39 Input ~ 0 +3.3V $Comp L GND #PWR03 U 1 1 509056A4 P 18900 3600 F 0 "#PWR03" H 18900 3600 30 0001 C CNN F 1 "GND" H 18900 3530 30 0001 C CNN F 2 "" H 18900 3600 60 0001 C CNN F 3 "" H 18900 3600 60 0001 C CNN 1 18900 3600 1 0 0 -1 $EndComp $Comp L GND #PWR04 U 1 1 509056A1 P 17000 3600 F 0 "#PWR04" H 17000 3600 30 0001 C CNN F 1 "GND" H 17000 3530 30 0001 C CNN F 2 "" H 17000 3600 60 0001 C CNN F 3 "" H 17000 3600 60 0001 C CNN 1 17000 3600 1 0 0 -1 $EndComp Text GLabel 17650 1550 1 39 Input ~ 0 +3.3V Text GLabel 18700 5550 0 39 Output ~ 0 E0_STOP Text GLabel 16800 5550 0 39 Output ~ 0 Z_STOP Text GLabel 18700 2950 0 39 Output ~ 0 X_STOP Text GLabel 16800 2950 0 39 Output ~ 0 Y_STOP Text GLabel 17650 4200 1 39 Input ~ 0 +3.3V $Comp L C C55 U 1 1 5081B0CF P 15250 1900 F 0 "C55" H 15300 2000 50 0000 L CNN F 1 "0u1" H 15300 1800 50 0000 L CNN F 2 "" H 15250 1900 60 0001 C CNN F 3 "" H 15250 1900 60 0001 C CNN 1 15250 1900 1 0 0 -1 $EndComp $Comp L A4982SLPTR U7 U 1 1 50659C40 P 8550 3700 F 0 "U7" H 8550 3700 60 0000 C CNN F 1 "A4982SLPTR" H 8550 3553 60 0000 C CNN F 2 "" H 8550 3700 60 0001 C CNN F 3 "" H 8550 3700 60 0001 C CNN 1 8550 3700 1 0 0 -1 $EndComp $Comp L A4982SLPTR U5 U 1 1 50659C38 P 3300 3700 F 0 "U5" H 3300 3700 60 0000 C CNN F 1 "A4982SLPTR" H 3300 3553 60 0000 C CNN F 2 "" H 3300 3700 60 0001 C CNN F 3 "" H 3300 3700 60 0001 C CNN 1 3300 3700 1 0 0 -1 $EndComp $Comp L A4982SLPTR U6 U 1 1 50659C31 P 3300 8900 F 0 "U6" H 3300 8900 60 0000 C CNN F 1 "A4982SLPTR" H 3300 8753 60 0000 C CNN F 2 "" H 3300 8900 60 0001 C CNN F 3 "" H 3300 8900 60 0001 C CNN 1 3300 8900 1 0 0 -1 $EndComp $Comp L A4982SLPTR U8 U 1 1 50659C20 P 8550 8900 F 0 "U8" H 8550 8900 60 0000 C CNN F 1 "A4982SLPTR" H 8550 8753 60 0000 C CNN F 2 "" H 8550 8900 60 0001 C CNN F 3 "" H 8550 8900 60 0001 C CNN 1 8550 8900 1 0 0 -1 $EndComp $Comp L C_POL C23 U 1 1 50659B77 P 2650 6800 F 0 "C23" H 2675 6875 50 0000 L CNN F 1 "100u" H 2650 6725 50 0000 L CNN F 2 "" H 2650 6800 60 0001 C CNN F 3 "" H 2650 6800 60 0001 C CNN 1 2650 6800 1 0 0 -1 $EndComp $Comp L C_POL C33 U 1 1 50659B6B P 7900 6800 F 0 "C33" H 7925 6875 50 0000 L CNN F 1 "100u" H 7900 6725 50 0000 L CNN F 2 "" H 7900 6800 60 0001 C CNN F 3 "" H 7900 6800 60 0001 C CNN 1 7900 6800 1 0 0 -1 $EndComp $Comp L C_POL C32 U 1 1 50659B59 P 7900 1600 F 0 "C32" H 7925 1675 50 0000 L CNN F 1 "100u" H 7900 1525 50 0000 L CNN F 2 "" H 7900 1600 60 0001 C CNN F 3 "" H 7900 1600 60 0001 C CNN 1 7900 1600 1 0 0 -1 $EndComp $Comp L C_POL C22 U 1 1 50659B49 P 2650 1600 F 0 "C22" H 2675 1675 50 0000 L CNN F 1 "100u" H 2650 1525 50 0000 L CNN F 2 "" H 2650 1600 60 0001 C CNN F 3 "" H 2650 1600 60 0001 C CNN 1 2650 1600 1 0 0 -1 $EndComp Text GLabel 17850 5550 2 39 Output ~ 0 Z_STOP_CONN $Comp L R_SMALL R58 U 1 1 5065980C P 17250 5550 F 0 "R58" V 17325 5558 50 0000 C CNN F 1 "100R" V 17182 5562 50 0000 C CNN F 2 "" H 17250 5550 60 0001 C CNN F 3 "" H 17250 5550 60 0001 C CNN 1 17250 5550 0 -1 -1 0 $EndComp $Comp L C_SMALL C42 U 1 1 5065980B P 17000 5950 F 0 "C42" H 17025 6025 50 0000 L CNN F 1 "0u1" H 17000 5875 50 0000 L CNN F 2 "" H 17000 5950 60 0001 C CNN F 3 "" H 17000 5950 60 0001 C CNN 1 17000 5950 1 0 0 -1 $EndComp $Comp L C_SMALL C43 U 1 1 5065980A P 18900 5950 F 0 "C43" H 18925 6025 50 0000 L CNN F 1 "0u1" H 18900 5875 50 0000 L CNN F 2 "" H 18900 5950 60 0001 C CNN F 3 "" H 18900 5950 60 0001 C CNN 1 18900 5950 1 0 0 -1 $EndComp $Comp L R_SMALL R59 U 1 1 50659809 P 19150 5550 F 0 "R59" V 19225 5558 50 0000 C CNN F 1 "100R" V 19082 5562 50 0000 C CNN F 2 "" H 19150 5550 60 0001 C CNN F 3 "" H 19150 5550 60 0001 C CNN 1 19150 5550 0 -1 -1 0 $EndComp Text GLabel 19700 5550 2 39 Output ~ 0 E0_STOP_CONN Text GLabel 17850 2950 2 39 Output ~ 0 Y_STOP_CONN $Comp L R_SMALL R57 U 1 1 506596A6 P 17300 2950 F 0 "R57" V 17375 2958 50 0000 C CNN F 1 "100R" V 17232 2962 50 0000 C CNN F 2 "" H 17300 2950 60 0001 C CNN F 3 "" H 17300 2950 60 0001 C CNN 1 17300 2950 0 -1 -1 0 $EndComp $Comp L C_SMALL C41 U 1 1 506596A5 P 17000 3300 F 0 "C41" H 17025 3375 50 0000 L CNN F 1 "0u1" H 17000 3225 50 0000 L CNN F 2 "" H 17000 3300 60 0001 C CNN F 3 "" H 17000 3300 60 0001 C CNN 1 17000 3300 1 0 0 -1 $EndComp $Comp L C_SMALL C40 U 1 1 5065966E P 18900 3300 F 0 "C40" H 18925 3375 50 0000 L CNN F 1 "0u1" H 18900 3225 50 0000 L CNN F 2 "" H 18900 3300 60 0001 C CNN F 3 "" H 18900 3300 60 0001 C CNN 1 18900 3300 1 0 0 -1 $EndComp $Comp L R_SMALL R56 U 1 1 5065962A P 19200 2950 F 0 "R56" V 19275 2958 50 0000 C CNN F 1 "100R" V 19132 2962 50 0000 C CNN F 2 "" H 19200 2950 60 0001 C CNN F 3 "" H 19200 2950 60 0001 C CNN 1 19200 2950 0 -1 -1 0 $EndComp Text GLabel 19750 2950 2 39 Output ~ 0 X_STOP_CONN $Comp L R_SMALL R51 U 1 1 50658494 P 12450 2050 F 0 "R51" V 12525 2058 50 0000 C CNN F 1 "4k7" V 12382 2062 50 0000 C CNN F 2 "" H 12450 2050 60 0001 C CNN F 3 "" H 12450 2050 60 0001 C CNN 1 12450 2050 1 0 0 -1 $EndComp $Comp L R_SMALL R50 U 1 1 50658491 P 12200 2050 F 0 "R50" V 12275 2058 50 0000 C CNN F 1 "4k7" V 12132 2062 50 0000 C CNN F 2 "" H 12200 2050 60 0001 C CNN F 3 "" H 12200 2050 60 0001 C CNN 1 12200 2050 1 0 0 -1 $EndComp Text Notes 16550 1000 0 60 ~ 0 Endstops. Text Notes 13100 950 2 60 ~ 0 Digital Current Limit Control Text Notes 5700 6200 2 60 ~ 0 Z-Axis Stepper Driver Text Notes 11000 6200 2 60 ~ 0 Extruder 0 Stepper Driver Text Notes 11000 1000 2 60 ~ 0 Y-Axis Stepper Driver Text Notes 5700 1000 2 60 ~ 0 X-Axis Stepper Driver Text GLabel 5400 9250 2 60 UnSpc ~ 0 Z_REF Text GLabel 10650 9250 2 60 UnSpc ~ 0 E0_REF Text GLabel 10650 4050 2 60 UnSpc ~ 0 Y_REF Text GLabel 5400 4050 2 60 UnSpc ~ 0 X_REF Text GLabel 12100 2500 0 60 Input ~ 0 TWD0 Text GLabel 12150 2350 0 60 Input ~ 0 TWCK0 Text GLabel 12950 2050 0 60 UnSpc ~ 0 Y_REF Text GLabel 12150 2750 0 60 UnSpc ~ 0 X_REF Text GLabel 15300 2750 2 60 UnSpc ~ 0 E0_REF Text GLabel 14650 2050 2 60 UnSpc ~ 0 Z_REF $Comp L GND #PWR05 U 1 1 50620C89 P 13750 3600 F 0 "#PWR05" H 13750 3600 30 0001 C CNN F 1 "GND" H 13750 3530 30 0001 C CNN F 2 "" H 13750 3600 60 0001 C CNN F 3 "" H 13750 3600 60 0001 C CNN 1 13750 3600 1 0 0 -1 $EndComp Text GLabel 13750 1150 1 60 Input ~ 0 +3.3V Text GLabel 2250 3750 0 60 Output ~ 0 X_EN Text GLabel 7500 3750 0 60 Output ~ 0 Y_EN Text GLabel 7500 8950 0 60 Output ~ 0 E0_EN Text GLabel 2250 8950 0 60 Output ~ 0 Z_EN $Comp L GND #PWR06 U 1 1 505A09C9 P 1650 10700 F 0 "#PWR06" H 1650 10700 30 0001 C CNN F 1 "GND" H 1650 10630 30 0001 C CNN F 2 "" H 1650 10700 60 0001 C CNN F 3 "" H 1650 10700 60 0001 C CNN 1 1650 10700 1 0 0 -1 $EndComp $Comp L R R33 U 1 1 505A09C8 P 4350 10100 F 0 "R33" V 4430 10100 50 0000 C CNN F 1 "0R1" V 4350 10100 50 0000 C CNN F 2 "" H 4350 10100 60 0001 C CNN F 3 "" H 4350 10100 60 0001 C CNN 1 4350 10100 1 0 0 -1 $EndComp $Comp L R R35 U 1 1 505A09C7 P 4750 10100 F 0 "R35" V 4830 10100 50 0000 C CNN F 1 "0R1" V 4750 10100 50 0000 C CNN F 2 "" H 4750 10100 60 0001 C CNN F 3 "" H 4750 10100 60 0001 C CNN 1 4750 10100 1 0 0 -1 $EndComp $Comp L C C21 U 1 1 505A09C5 P 1900 10200 F 0 "C21" H 1950 10300 50 0000 L CNN F 1 "0u22" H 1950 10100 50 0000 L CNN F 2 "" H 1900 10200 60 0001 C CNN F 3 "" H 1900 10200 60 0001 C CNN 1 1900 10200 1 0 0 -1 $EndComp $Comp L R R31 U 1 1 505A09C4 P 2250 10200 F 0 "R31" V 2330 10200 50 0000 C CNN F 1 "0R" V 2250 10200 50 0000 C CNN F 2 "" H 2250 10200 60 0001 C CNN F 3 "" H 2250 10200 60 0001 C CNN 1 2250 10200 1 0 0 -1 $EndComp $Comp L C C25 U 1 1 505A09C0 P 3100 7150 F 0 "C25" H 3150 7250 50 0000 L CNN F 1 "0u1" H 3150 7050 50 0000 L CNN F 2 "" H 3100 7150 60 0001 C CNN F 3 "" H 3100 7150 60 0001 C CNN 1 3100 7150 0 -1 -1 0 $EndComp $Comp L R R29 U 1 1 505A09BD P 1950 9250 F 0 "R29" V 2030 9250 50 0000 C CNN F 1 "10k" V 1950 9250 50 0000 C CNN F 2 "" H 1950 9250 60 0001 C CNN F 3 "" H 1950 9250 60 0001 C CNN 1 1950 9250 0 -1 -1 0 $EndComp $Comp L C C27 U 1 1 505A09BC P 4100 7150 F 0 "C27" H 4150 7250 50 0000 L CNN F 1 "0u22" H 4150 7050 50 0000 L CNN F 2 "" H 4100 7150 60 0001 C CNN F 3 "" H 4100 7150 60 0001 C CNN 1 4100 7150 1 0 0 -1 $EndComp $Comp L GND #PWR07 U 1 1 505A09BB P 4100 7550 F 0 "#PWR07" H 4100 7550 30 0001 C CNN F 1 "GND" H 4100 7480 30 0001 C CNN F 2 "" H 4100 7550 60 0001 C CNN F 3 "" H 4100 7550 60 0001 C CNN 1 4100 7550 1 0 0 -1 $EndComp $Comp L GND #PWR08 U 1 1 505A09B9 P 2650 7200 F 0 "#PWR08" H 2650 7200 30 0001 C CNN F 1 "GND" H 2650 7130 30 0001 C CNN F 2 "" H 2650 7200 60 0001 C CNN F 3 "" H 2650 7200 60 0001 C CNN 1 2650 7200 1 0 0 -1 $EndComp $Comp L R R28 U 1 1 505A09B8 P 1950 8800 F 0 "R28" V 2030 8800 50 0000 C CNN F 1 "100k" V 1950 8800 50 0000 C CNN F 2 "" H 1950 8800 60 0001 C CNN F 3 "" H 1950 8800 60 0001 C CNN 1 1950 8800 0 -1 -1 0 $EndComp Text GLabel 1450 8550 1 60 Input ~ 0 +3.3V Text GLabel 2050 6750 1 60 Input ~ 0 +3.3V Text GLabel 3600 6600 1 60 Input ~ 0 +3.3V Text GLabel 3400 6350 1 60 Input ~ 0 V_IN Text GLabel 2250 8450 0 60 Input ~ 0 Z_STEP Text GLabel 2250 8600 0 60 Input ~ 0 Z_DIR Text GLabel 5250 8100 2 60 Output ~ 0 Z_MOT_1A Text GLabel 5250 7950 2 60 Output ~ 0 Z_MOT_1B Text GLabel 5250 8450 2 60 Output ~ 0 Z_MOT_2A Text GLabel 5250 8600 2 60 Output ~ 0 Z_MOT_2B Text GLabel 10500 8600 2 60 Output ~ 0 E0_MOT_2B Text GLabel 10500 8450 2 60 Output ~ 0 E0_MOT_2A Text GLabel 10500 7950 2 60 Output ~ 0 E0_MOT_1B Text GLabel 10500 8100 2 60 Output ~ 0 E0_MOT_1A Text GLabel 7500 8600 0 60 Input ~ 0 E0_DIR Text GLabel 7500 8450 0 60 Input ~ 0 E0_STEP Text GLabel 8650 6350 1 60 Input ~ 0 V_IN Text GLabel 8850 6600 1 60 Input ~ 0 +3.3V Text GLabel 7300 6750 1 60 Input ~ 0 +3.3V Text GLabel 6700 8550 1 60 Input ~ 0 +3.3V $Comp L R R40 U 1 1 505A09B7 P 7200 8800 F 0 "R40" V 7280 8800 50 0000 C CNN F 1 "100k" V 7200 8800 50 0000 C CNN F 2 "" H 7200 8800 60 0001 C CNN F 3 "" H 7200 8800 60 0001 C CNN 1 7200 8800 0 -1 -1 0 $EndComp $Comp L GND #PWR09 U 1 1 505A09B6 P 7900 7200 F 0 "#PWR09" H 7900 7200 30 0001 C CNN F 1 "GND" H 7900 7130 30 0001 C CNN F 2 "" H 7900 7200 60 0001 C CNN F 3 "" H 7900 7200 60 0001 C CNN 1 7900 7200 1 0 0 -1 $EndComp $Comp L GND #PWR010 U 1 1 505A09B4 P 9350 7550 F 0 "#PWR010" H 9350 7550 30 0001 C CNN F 1 "GND" H 9350 7480 30 0001 C CNN F 2 "" H 9350 7550 60 0001 C CNN F 3 "" H 9350 7550 60 0001 C CNN 1 9350 7550 1 0 0 -1 $EndComp $Comp L C C37 U 1 1 505A09B3 P 9350 7150 F 0 "C37" H 9400 7250 50 0000 L CNN F 1 "0u22" H 9400 7050 50 0000 L CNN F 2 "" H 9350 7150 60 0001 C CNN F 3 "" H 9350 7150 60 0001 C CNN 1 9350 7150 1 0 0 -1 $EndComp $Comp L R R41 U 1 1 505A09B2 P 7200 9250 F 0 "R41" V 7280 9250 50 0000 C CNN F 1 "10k" V 7200 9250 50 0000 C CNN F 2 "" H 7200 9250 60 0001 C CNN F 3 "" H 7200 9250 60 0001 C CNN 1 7200 9250 0 -1 -1 0 $EndComp $Comp L C C35 U 1 1 505A09AF P 8350 7150 F 0 "C35" H 8400 7250 50 0000 L CNN F 1 "0u1" H 8400 7050 50 0000 L CNN F 2 "" H 8350 7150 60 0001 C CNN F 3 "" H 8350 7150 60 0001 C CNN 1 8350 7150 0 -1 -1 0 $EndComp $Comp L R R43 U 1 1 505A09AB P 7500 10200 F 0 "R43" V 7580 10200 50 0000 C CNN F 1 "0R" V 7500 10200 50 0000 C CNN F 2 "" H 7500 10200 60 0001 C CNN F 3 "" H 7500 10200 60 0001 C CNN 1 7500 10200 1 0 0 -1 $EndComp $Comp L C C31 U 1 1 505A09AA P 7150 10200 F 0 "C31" H 7200 10300 50 0000 L CNN F 1 "0u22" H 7200 10100 50 0000 L CNN F 2 "" H 7150 10200 60 0001 C CNN F 3 "" H 7150 10200 60 0001 C CNN 1 7150 10200 1 0 0 -1 $EndComp $Comp L R R47 U 1 1 505A09A8 P 10000 10100 F 0 "R47" V 10080 10100 50 0000 C CNN F 1 "0R1" V 10000 10100 50 0000 C CNN F 2 "" H 10000 10100 60 0001 C CNN F 3 "" H 10000 10100 60 0001 C CNN 1 10000 10100 1 0 0 -1 $EndComp $Comp L R R45 U 1 1 505A09A7 P 9600 10100 F 0 "R45" V 9680 10100 50 0000 C CNN F 1 "0R1" V 9600 10100 50 0000 C CNN F 2 "" H 9600 10100 60 0001 C CNN F 3 "" H 9600 10100 60 0001 C CNN 1 9600 10100 1 0 0 -1 $EndComp $Comp L GND #PWR011 U 1 1 505A09A6 P 6900 10700 F 0 "#PWR011" H 6900 10700 30 0001 C CNN F 1 "GND" H 6900 10630 30 0001 C CNN F 2 "" H 6900 10700 60 0001 C CNN F 3 "" H 6900 10700 60 0001 C CNN 1 6900 10700 1 0 0 -1 $EndComp $Comp L GND #PWR012 U 1 1 505A0991 P 6900 5500 F 0 "#PWR012" H 6900 5500 30 0001 C CNN F 1 "GND" H 6900 5430 30 0001 C CNN F 2 "" H 6900 5500 60 0001 C CNN F 3 "" H 6900 5500 60 0001 C CNN 1 6900 5500 1 0 0 -1 $EndComp $Comp L R R44 U 1 1 505A0990 P 9600 4900 F 0 "R44" V 9680 4900 50 0000 C CNN F 1 "0R1" V 9600 4900 50 0000 C CNN F 2 "" H 9600 4900 60 0001 C CNN F 3 "" H 9600 4900 60 0001 C CNN 1 9600 4900 1 0 0 -1 $EndComp $Comp L R R46 U 1 1 505A098F P 10000 4900 F 0 "R46" V 10080 4900 50 0000 C CNN F 1 "0R1" V 10000 4900 50 0000 C CNN F 2 "" H 10000 4900 60 0001 C CNN F 3 "" H 10000 4900 60 0001 C CNN 1 10000 4900 1 0 0 -1 $EndComp $Comp L C C30 U 1 1 505A098D P 7150 5000 F 0 "C30" H 7200 5100 50 0000 L CNN F 1 "0u22" H 7200 4900 50 0000 L CNN F 2 "" H 7150 5000 60 0001 C CNN F 3 "" H 7150 5000 60 0001 C CNN 1 7150 5000 1 0 0 -1 $EndComp $Comp L R R42 U 1 1 505A098C P 7500 5000 F 0 "R42" V 7580 5000 50 0000 C CNN F 1 "0R" V 7500 5000 50 0000 C CNN F 2 "" H 7500 5000 60 0001 C CNN F 3 "" H 7500 5000 60 0001 C CNN 1 7500 5000 1 0 0 -1 $EndComp $Comp L C C34 U 1 1 505A0988 P 8350 1950 F 0 "C34" H 8400 2050 50 0000 L CNN F 1 "0u1" H 8400 1850 50 0000 L CNN F 2 "" H 8350 1950 60 0001 C CNN F 3 "" H 8350 1950 60 0001 C CNN 1 8350 1950 0 -1 -1 0 $EndComp $Comp L R R39 U 1 1 505A0985 P 7200 4050 F 0 "R39" V 7280 4050 50 0000 C CNN F 1 "10k" V 7200 4050 50 0000 C CNN F 2 "" H 7200 4050 60 0001 C CNN F 3 "" H 7200 4050 60 0001 C CNN 1 7200 4050 0 -1 -1 0 $EndComp $Comp L C C36 U 1 1 505A0984 P 9350 1950 F 0 "C36" H 9400 2050 50 0000 L CNN F 1 "0u22" H 9400 1850 50 0000 L CNN F 2 "" H 9350 1950 60 0001 C CNN F 3 "" H 9350 1950 60 0001 C CNN 1 9350 1950 1 0 0 -1 $EndComp $Comp L GND #PWR013 U 1 1 505A0983 P 9350 2350 F 0 "#PWR013" H 9350 2350 30 0001 C CNN F 1 "GND" H 9350 2280 30 0001 C CNN F 2 "" H 9350 2350 60 0001 C CNN F 3 "" H 9350 2350 60 0001 C CNN 1 9350 2350 1 0 0 -1 $EndComp $Comp L GND #PWR014 U 1 1 505A0981 P 7900 2000 F 0 "#PWR014" H 7900 2000 30 0001 C CNN F 1 "GND" H 7900 1930 30 0001 C CNN F 2 "" H 7900 2000 60 0001 C CNN F 3 "" H 7900 2000 60 0001 C CNN 1 7900 2000 1 0 0 -1 $EndComp $Comp L R R38 U 1 1 505A0980 P 7200 3600 F 0 "R38" V 7280 3600 50 0000 C CNN F 1 "100k" V 7200 3600 50 0000 C CNN F 2 "0603" H 7200 3600 60 0001 C CNN F 3 "" H 7200 3600 60 0001 C CNN 1 7200 3600 0 -1 -1 0 $EndComp Text GLabel 6700 3350 1 60 Input ~ 0 +3.3V Text GLabel 7300 1550 1 60 Input ~ 0 +3.3V Text GLabel 8850 1400 1 60 Input ~ 0 +3.3V Text GLabel 8650 1150 1 60 Input ~ 0 V_IN Text GLabel 7500 3250 0 60 Input ~ 0 Y_STEP Text GLabel 7500 3400 0 60 Input ~ 0 Y_DIR Text GLabel 10500 2900 2 60 Output ~ 0 Y_MOT_1A Text GLabel 10500 2750 2 60 Output ~ 0 Y_MOT_1B Text GLabel 10500 3250 2 60 Output ~ 0 Y_MOT_2A Text GLabel 10500 3400 2 60 Output ~ 0 Y_MOT_2B Text GLabel 5250 3400 2 60 Output ~ 0 X_MOT_2B Text GLabel 5250 3250 2 60 Output ~ 0 X_MOT_2A Text GLabel 5250 2750 2 60 Output ~ 0 X_MOT_1B Text GLabel 5250 2900 2 60 Output ~ 0 X_MOT_1A Text GLabel 2250 3400 0 60 Input ~ 0 X_DIR Text GLabel 2250 3250 0 60 Input ~ 0 X_STEP Text GLabel 3400 1150 1 60 Input ~ 0 V_IN Text GLabel 3600 1400 1 60 Input ~ 0 +3.3V Text GLabel 2050 1550 1 60 Input ~ 0 +3.3V Text GLabel 1450 3350 1 60 Input ~ 0 +3.3V $Comp L R R26 U 1 1 50579524 P 1950 3600 F 0 "R26" V 2030 3600 50 0000 C CNN F 1 "100k" V 1950 3600 50 0000 C CNN F 2 "" H 1950 3600 60 0001 C CNN F 3 "" H 1950 3600 60 0001 C CNN 1 1950 3600 0 -1 -1 0 $EndComp $Comp L GND #PWR015 U 1 1 505794D5 P 2650 2000 F 0 "#PWR015" H 2650 2000 30 0001 C CNN F 1 "GND" H 2650 1930 30 0001 C CNN F 2 "" H 2650 2000 60 0001 C CNN F 3 "" H 2650 2000 60 0001 C CNN 1 2650 2000 1 0 0 -1 $EndComp $Comp L GND #PWR016 U 1 1 5057946D P 4100 2350 F 0 "#PWR016" H 4100 2350 30 0001 C CNN F 1 "GND" H 4100 2280 30 0001 C CNN F 2 "" H 4100 2350 60 0001 C CNN F 3 "" H 4100 2350 60 0001 C CNN 1 4100 2350 1 0 0 -1 $EndComp $Comp L C C26 U 1 1 5057945E P 4100 1950 F 0 "C26" H 4150 2050 50 0000 L CNN F 1 "0u22" H 4150 1850 50 0000 L CNN F 2 "" H 4100 1950 60 0001 C CNN F 3 "" H 4100 1950 60 0001 C CNN 1 4100 1950 1 0 0 -1 $EndComp $Comp L R R27 U 1 1 5057943F P 1950 4050 F 0 "R27" V 2030 4050 50 0000 C CNN F 1 "10k" V 1950 4050 50 0000 C CNN F 2 "" H 1950 4050 60 0001 C CNN F 3 "" H 1950 4050 60 0001 C CNN 1 1950 4050 0 -1 -1 0 $EndComp $Comp L C C24 U 1 1 5057936C P 3100 1950 F 0 "C24" H 3150 2050 50 0000 L CNN F 1 "0u1" H 3150 1850 50 0000 L CNN F 2 "" H 3100 1950 60 0001 C CNN F 3 "" H 3100 1950 60 0001 C CNN 1 3100 1950 0 -1 -1 0 $EndComp $Comp L R R30 U 1 1 5057925B P 2250 5000 F 0 "R30" V 2330 5000 50 0000 C CNN F 1 "0R" V 2250 5000 50 0000 C CNN F 2 "" H 2250 5000 60 0001 C CNN F 3 "" H 2250 5000 60 0001 C CNN 1 2250 5000 1 0 0 -1 $EndComp $Comp L C C20 U 1 1 50579249 P 1900 5000 F 0 "C20" H 1950 5100 50 0000 L CNN F 1 "0u22" H 1950 4900 50 0000 L CNN F 2 "" H 1900 5000 60 0001 C CNN F 3 "" H 1900 5000 60 0001 C CNN 1 1900 5000 1 0 0 -1 $EndComp $Comp L R R34 U 1 1 505791AC P 4750 4900 F 0 "R34" V 4830 4900 50 0000 C CNN F 1 "0R1" V 4750 4900 50 0000 C CNN F 2 "" H 4750 4900 60 0001 C CNN F 3 "" H 4750 4900 60 0001 C CNN 1 4750 4900 1 0 0 -1 $EndComp $Comp L R R32 U 1 1 505791A8 P 4350 4900 F 0 "R32" V 4430 4900 50 0000 C CNN F 1 "0R1" V 4350 4900 50 0000 C CNN F 2 "" H 4350 4900 60 0001 C CNN F 3 "" H 4350 4900 60 0001 C CNN 1 4350 4900 1 0 0 -1 $EndComp $Comp L GND #PWR017 U 1 1 5057917D P 1650 5500 F 0 "#PWR017" H 1650 5500 30 0001 C CNN F 1 "GND" H 1650 5430 30 0001 C CNN F 2 "" H 1650 5500 60 0001 C CNN F 3 "" H 1650 5500 60 0001 C CNN 1 1650 5500 1 0 0 -1 $EndComp Wire Wire Line 15550 8100 15400 8100 Wire Wire Line 14450 8200 14650 8200 Wire Wire Line 14650 8200 14650 8050 Wire Wire Line 14450 8500 14450 8600 Wire Wire Line 14450 8600 15550 8600 Wire Wire Line 15550 8450 15400 8450 Wire Wire Line 15400 8450 15400 8500 Wire Wire Line 15400 8500 14650 8500 Wire Wire Line 15400 8100 15400 8050 Wire Wire Line 15400 8050 14650 8050 Wire Wire Line 14550 8950 14550 9000 Wire Wire Line 14550 9000 14450 9000 Wire Wire Line 14450 8750 14550 8750 Connection ~ 12550 7350 Connection ~ 12550 7750 Wire Wire Line 12550 7100 12550 8050 Connection ~ 15550 9250 Wire Wire Line 15550 9250 15550 9350 Connection ~ 12950 7050 Wire Wire Line 12950 7050 12700 7050 Wire Wire Line 12700 7050 12700 7000 Connection ~ 15050 10550 Wire Wire Line 11950 10550 15350 10550 Wire Wire Line 15350 10550 15350 10300 Wire Wire Line 12950 6700 12950 6550 Wire Notes Line 16200 10850 16200 5950 Wire Wire Line 12550 8050 12750 8050 Wire Wire Line 14450 9250 15700 9250 Connection ~ 12650 8800 Wire Wire Line 12650 8800 12650 8950 Wire Wire Line 12650 8950 12550 8950 Wire Wire Line 12750 8450 12550 8450 Wire Wire Line 13900 6600 13900 7500 Wire Wire Line 12350 6750 12350 7100 Wire Wire Line 12500 8800 12750 8800 Wire Wire Line 14400 7350 14400 7550 Connection ~ 13700 7400 Wire Wire Line 13300 7500 13300 7350 Wire Wire Line 13300 7350 13200 7350 Wire Wire Line 13200 7350 13200 7150 Wire Wire Line 13550 7500 13550 7400 Wire Wire Line 12750 9400 12600 9400 Wire Wire Line 12600 9400 12600 9250 Wire Wire Line 12550 9950 12550 9900 Wire Wire Line 12550 9900 12750 9900 Wire Wire Line 12200 10000 12200 9750 Wire Wire Line 12200 9750 12750 9750 Connection ~ 14650 10550 Wire Wire Line 15050 10550 15050 10350 Wire Wire Line 14450 9550 15050 9550 Wire Wire Line 15050 9550 15050 9850 Connection ~ 13450 10550 Wire Wire Line 13600 10550 13600 10300 Wire Wire Line 13450 10550 13450 10300 Wire Wire Line 11950 10550 11950 10700 Wire Wire Line 13750 10550 13750 10300 Connection ~ 13600 10550 Wire Wire Line 14650 9850 14650 9700 Wire Wire Line 14650 9700 14450 9700 Wire Wire Line 14650 10550 14650 10350 Connection ~ 13750 10550 Wire Wire Line 12200 10400 12200 10550 Connection ~ 12200 10550 Wire Wire Line 12550 10550 12550 10450 Connection ~ 12550 10550 Wire Wire Line 13550 7400 13700 7400 Wire Wire Line 12500 9250 12750 9250 Connection ~ 12600 9250 Wire Wire Line 14400 6950 14400 6850 Wire Wire Line 14400 6850 13900 6850 Connection ~ 13900 6850 Wire Wire Line 13700 7150 13600 7150 Connection ~ 13700 7150 Connection ~ 13700 6550 Wire Wire Line 11750 9250 12000 9250 Wire Wire Line 12000 8800 11750 8800 Connection ~ 11750 8800 Wire Wire Line 11750 8550 11750 9250 Connection ~ 12350 7100 Wire Wire Line 13700 6350 13700 7500 Wire Wire Line 12750 8600 12550 8600 Wire Wire Line 12150 8200 12750 8200 Wire Wire Line 12150 7100 12550 7100 Wire Notes Line 16200 10850 11450 10850 Wire Notes Line 16200 5950 11450 5950 Wire Notes Line 11450 5950 11450 10850 Wire Wire Line 12950 6900 12950 7200 Wire Wire Line 15350 9250 15350 9900 Connection ~ 15350 9250 Wire Wire Line 12700 6600 12700 6550 Wire Wire Line 12700 6550 13700 6550 Connection ~ 12950 6550 Wire Wire Line 12150 7100 12150 8200 Connection ~ 12150 7750 Connection ~ 12150 7350 Wire Wire Line 14650 8500 14650 8350 Wire Wire Line 14650 8350 14450 8350 Wire Wire Line 14450 7950 15550 7950 Wire Wire Line 14450 7950 14450 8050 $Comp L CSMALL C105 U 1 1 5547ABE3 P 14550 8850 F 0 "C105" H 14575 8900 30 0000 L CNN F 1 "0u1" H 14575 8800 30 0000 L CNN F 2 "" H 14550 8850 60 0001 C CNN F 3 "" H 14550 8850 60 0001 C CNN 1 14550 8850 1 0 0 -1 $EndComp $Comp L SJ SJ10 U 1 1 5547ABE9 P 12550 7550 F 0 "SJ10" H 12650 7700 50 0000 C CNN F 1 "MS1" H 12650 7401 40 0000 C CNN F 2 "" H 12550 7550 60 0001 C CNN F 3 "" H 12550 7550 60 0001 C CNN 1 12550 7550 1 0 0 -1 $EndComp $Comp L SJ SJ9 U 1 1 5547ABEF P 12150 7550 F 0 "SJ9" H 12250 7700 50 0000 C CNN F 1 "MS2" H 12250 7401 40 0000 C CNN F 2 "" H 12150 7550 60 0001 C CNN F 3 "" H 12150 7550 60 0001 C CNN 1 12150 7550 1 0 0 -1 $EndComp $Comp L VREF J2 U 1 1 5547ABF5 P 15550 9350 F 0 "J2" H 15350 9500 60 0000 C CNN F 1 "E1 VREF" H 15350 9600 60 0000 C CNN F 2 "" H 15550 9350 60 0001 C CNN F 3 "" H 15550 9350 60 0001 C CNN 1 15550 9350 -1 0 0 1 $EndComp $Comp L C C101 U 1 1 5547ABFB P 12700 6800 F 0 "C101" H 12750 6900 50 0000 L CNN F 1 "0u1" H 12750 6700 50 0000 L CNN F 2 "" H 12700 6800 60 0001 C CNN F 3 "" H 12700 6800 60 0001 C CNN 1 12700 6800 -1 0 0 1 $EndComp $Comp L C C110 U 1 1 5547AC01 P 15350 10100 F 0 "C110" H 15400 10200 50 0000 L CNN F 1 "0u1" H 15400 10000 50 0000 L CNN F 2 "" H 15350 10100 60 0001 C CNN F 3 "" H 15350 10100 60 0001 C CNN 1 15350 10100 1 0 0 -1 $EndComp $Comp L A4982SLPTR U11 U 1 1 5547AC07 P 13600 8900 F 0 "U11" H 13600 8900 60 0000 C CNN F 1 "A4982SLPTR" H 13600 8753 60 0000 C CNN F 2 "" H 13600 8900 60 0001 C CNN F 3 "" H 13600 8900 60 0001 C CNN 1 13600 8900 1 0 0 -1 $EndComp $Comp L C_POL C102 U 1 1 5547AC0D P 12950 6800 F 0 "C102" H 12975 6875 50 0000 L CNN F 1 "100u" H 12950 6725 50 0000 L CNN F 2 "" H 12950 6800 60 0001 C CNN F 3 "" H 12950 6800 60 0001 C CNN 1 12950 6800 1 0 0 -1 $EndComp Text Notes 16050 6200 2 60 ~ 0 Extruder 1 Stepper Driver Text GLabel 15700 9250 2 60 UnSpc ~ 0 E1_REF Text GLabel 12550 8950 0 60 Output ~ 0 E1_EN Text GLabel 15550 8600 2 60 Output ~ 0 E1_MOT_2B Text GLabel 15550 8450 2 60 Output ~ 0 E1_MOT_2A Text GLabel 15550 7950 2 60 Output ~ 0 E1_MOT_1B Text GLabel 15550 8100 2 60 Output ~ 0 E1_MOT_1A Text GLabel 12550 8600 0 60 Input ~ 0 E1_DIR Text GLabel 12550 8450 0 60 Input ~ 0 E1_STEP Text GLabel 13700 6350 1 60 Input ~ 0 V_IN Text GLabel 13900 6600 1 60 Input ~ 0 +3.3V Text GLabel 12350 6750 1 60 Input ~ 0 +3.3V Text GLabel 11750 8550 1 60 Input ~ 0 +3.3V $Comp L R R89 U 1 1 5547AC20 P 12250 8800 F 0 "R89" V 12330 8800 50 0000 C CNN F 1 "100k" V 12250 8800 50 0000 C CNN F 2 "" H 12250 8800 60 0001 C CNN F 3 "" H 12250 8800 60 0001 C CNN 1 12250 8800 0 -1 -1 0 $EndComp $Comp L GND #PWR018 U 1 1 5547AC26 P 12950 7200 F 0 "#PWR018" H 12950 7200 30 0001 C CNN F 1 "GND" H 12950 7130 30 0001 C CNN F 2 "" H 12950 7200 60 0001 C CNN F 3 "" H 12950 7200 60 0001 C CNN 1 12950 7200 1 0 0 -1 $EndComp $Comp L GND #PWR019 U 1 1 5547AC2C P 14400 7550 F 0 "#PWR019" H 14400 7550 30 0001 C CNN F 1 "GND" H 14400 7480 30 0001 C CNN F 2 "" H 14400 7550 60 0001 C CNN F 3 "" H 14400 7550 60 0001 C CNN 1 14400 7550 1 0 0 -1 $EndComp $Comp L C C104 U 1 1 5547AC32 P 14400 7150 F 0 "C104" H 14450 7250 50 0000 L CNN F 1 "0u22" H 14450 7050 50 0000 L CNN F 2 "" H 14400 7150 60 0001 C CNN F 3 "" H 14400 7150 60 0001 C CNN 1 14400 7150 1 0 0 -1 $EndComp $Comp L R R90 U 1 1 5547AC38 P 12250 9250 F 0 "R90" V 12330 9250 50 0000 C CNN F 1 "10k" V 12250 9250 50 0000 C CNN F 2 "" H 12250 9250 60 0001 C CNN F 3 "" H 12250 9250 60 0001 C CNN 1 12250 9250 0 -1 -1 0 $EndComp $Comp L C C103 U 1 1 5547AC3E P 13400 7150 F 0 "C103" H 13450 7250 50 0000 L CNN F 1 "0u1" H 13450 7050 50 0000 L CNN F 2 "" H 13400 7150 60 0001 C CNN F 3 "" H 13400 7150 60 0001 C CNN 1 13400 7150 0 -1 -1 0 $EndComp $Comp L R R91 U 1 1 5547AC44 P 12550 10200 F 0 "R91" V 12630 10200 50 0000 C CNN F 1 "0R" V 12550 10200 50 0000 C CNN F 2 "" H 12550 10200 60 0001 C CNN F 3 "" H 12550 10200 60 0001 C CNN 1 12550 10200 1 0 0 -1 $EndComp $Comp L C C100 U 1 1 5547AC4A P 12200 10200 F 0 "C100" H 12250 10300 50 0000 L CNN F 1 "0u22" H 12250 10100 50 0000 L CNN F 2 "" H 12200 10200 60 0001 C CNN F 3 "" H 12200 10200 60 0001 C CNN 1 12200 10200 1 0 0 -1 $EndComp $Comp L R R94 U 1 1 5547AC50 P 15050 10100 F 0 "R94" V 15130 10100 50 0000 C CNN F 1 "0R1" V 15050 10100 50 0000 C CNN F 2 "" H 15050 10100 60 0001 C CNN F 3 "" H 15050 10100 60 0001 C CNN 1 15050 10100 1 0 0 -1 $EndComp $Comp L R R93 U 1 1 5547AC56 P 14650 10100 F 0 "R93" V 14730 10100 50 0000 C CNN F 1 "0R1" V 14650 10100 50 0000 C CNN F 2 "" H 14650 10100 60 0001 C CNN F 3 "" H 14650 10100 60 0001 C CNN 1 14650 10100 1 0 0 -1 $EndComp $Comp L GND #PWR020 U 1 1 5547AC5C P 11950 10700 F 0 "#PWR020" H 11950 10700 30 0001 C CNN F 1 "GND" H 11950 10630 30 0001 C CNN F 2 "" H 11950 10700 60 0001 C CNN F 3 "" H 11950 10700 60 0001 C CNN 1 11950 10700 1 0 0 -1 $EndComp Wire Notes Line 11750 4400 11750 5700 Wire Notes Line 15750 4400 15750 5700 Text Notes 12650 4550 2 60 ~ 0 DAC Control for E1 Wire Notes Line 15750 750 11750 750 Wire Notes Line 15750 5700 11750 5700 Wire Notes Line 11750 4400 15750 4400 Text GLabel 13400 4600 0 60 Input ~ 0 PB15/DAC0 Text GLabel 14000 5000 2 60 UnSpc ~ 0 E1_REF $Comp L DIODE D18 U 1 1 5547B7F8 P 13800 4800 F 0 "D18" H 13800 4900 40 0000 C CNN F 1 "1SS400T1G" H 13800 4700 40 0000 C CNN F 2 "~" H 13800 4800 60 0000 C CNN F 3 "~" H 13800 4800 60 0000 C CNN F 4 "0.6V at 1mA" V 13650 4850 60 0000 C CNN "Fwd Voltage Drop (1mA)" 1 13800 4800 0 1 1 0 $EndComp $Comp L R R92 U 1 1 5547B805 P 13800 5300 F 0 "R92" V 13880 5300 50 0000 C CNN F 1 "2K15" V 13700 5300 50 0000 C CNN F 2 "" H 13800 5300 60 0001 C CNN F 3 "" H 13800 5300 60 0001 C CNN 1 13800 5300 -1 0 0 1 $EndComp Wire Wire Line 13400 4600 13800 4600 Wire Wire Line 13800 5000 13800 5050 $Comp L GND #PWR021 U 1 1 5547C01C P 13800 5600 F 0 "#PWR021" H 13800 5600 30 0001 C CNN F 1 "GND" H 13800 5530 30 0001 C CNN F 2 "" H 13800 5600 60 0001 C CNN F 3 "" H 13800 5600 60 0001 C CNN 1 13800 5600 1 0 0 -1 $EndComp Wire Wire Line 13800 5550 13800 5600 Wire Wire Line 13800 5000 14000 5000 Text Notes 11900 5000 0 28 ~ 0 DAC voltage range 0.55V-2.75V if Vana = 3.3V\nDiode with Vfwd of 0.6V drops the voltage range to approx 0V-2.15V\n(different from the same range as the Digipot).\nNote that Diodes Vfwd depends on current.\nThe current flow is set by the resistor (2K15),\nat 2.15V = 1mA decreasing as the voltage decreases towards 0V\ni.e this arrangement is not linear! Wire Wire Line 17550 7500 17550 7600 Wire Wire Line 16800 8100 17050 8100 Wire Wire Line 17450 8100 17800 8100 Wire Wire Line 17000 8400 17000 8100 Connection ~ 17000 8100 Wire Wire Line 17000 8800 17000 8600 Wire Wire Line 17550 8000 17550 8100 Connection ~ 17550 8100 Wire Wire Line 17550 6750 17550 7000 $Comp L R R96 U 1 1 5547C60D P 17550 7250 F 0 "R96" V 17630 7250 50 0000 C CNN F 1 "680R" V 17450 7250 50 0000 C CNN F 2 "" H 17550 7250 60 0001 C CNN F 3 "" H 17550 7250 60 0001 C CNN 1 17550 7250 -1 0 0 1 $EndComp $Comp L LED D19 U 1 1 5547C613 P 17550 7800 F 0 "D19" H 17550 7900 50 0000 C CNN F 1 "E1 Stop" H 17550 7700 50 0000 C CNN F 2 "" H 17550 7800 60 0001 C CNN F 3 "" H 17550 7800 60 0001 C CNN 1 17550 7800 0 1 1 0 $EndComp Text GLabel 17550 6750 1 39 Input ~ 0 +3.3V $Comp L GND #PWR022 U 1 1 5547C61A P 17000 8800 F 0 "#PWR022" H 17000 8800 30 0001 C CNN F 1 "GND" H 17000 8730 30 0001 C CNN F 2 "" H 17000 8800 60 0001 C CNN F 3 "" H 17000 8800 60 0001 C CNN 1 17000 8800 1 0 0 -1 $EndComp Text GLabel 16800 8100 0 39 Output ~ 0 E1_STOP $Comp L C_SMALL C111 U 1 1 5547C621 P 17000 8500 F 0 "C111" H 17025 8575 50 0000 L CNN F 1 "0u1" H 17000 8425 50 0000 L CNN F 2 "" H 17000 8500 60 0001 C CNN F 3 "" H 17000 8500 60 0001 C CNN 1 17000 8500 1 0 0 -1 $EndComp $Comp L R_SMALL R95 U 1 1 5547C627 P 17250 8100 F 0 "R95" V 17325 8108 50 0000 C CNN F 1 "100R" V 17182 8112 50 0000 C CNN F 2 "" H 17250 8100 60 0001 C CNN F 3 "" H 17250 8100 60 0001 C CNN 1 17250 8100 0 -1 -1 0 $EndComp Text GLabel 17800 8100 2 39 Output ~ 0 E1_STOP_CONN Wire Wire Line 9550 2750 10500 2750 Wire Wire Line 4300 7950 5250 7950 $EndSCHEMATC
{ "pile_set_name": "Github" }
/** * Project: ${puma-parser.aid} * * File Created at 2012-6-24 * $Id$ * * Copyright 2010 dianping.com. * All rights reserved. * * This software is the confidential and proprietary information of * Dianping Company. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with dianping.com. */ package com.dianping.puma.parser.mysql.column; /** * * TODO Comment of TinyColumn * * @see http://code.google.com/p/open-replicator/ * @author Leo Liang * */ public final class TinyColumn implements Column { private static final long serialVersionUID = -7981385814804060055L; public static final int MIN_VALUE = -128; public static final int MAX_VALUE = 127; private final int value; private TinyColumn(int value) { this.value = value; } /* * (non-Javadoc) * * @see java.lang.Object#toString() */ @Override public String toString() { return String.valueOf(value); } public Integer getValue() { return this.value; } public static final TinyColumn valueOf(int value) { if (value < MIN_VALUE || value > MAX_VALUE) { throw new IllegalArgumentException("invalid value: " + value); } return new TinyColumn(value); } }
{ "pile_set_name": "Github" }
DEPRECATION ----------- .. versionadded:: 3.17 Deprecation message from imported target's developer. ``DEPRECATION`` is the message regarding a deprecation status to be displayed to downstream users of a target.
{ "pile_set_name": "Github" }
Model: predict "Class = +1" if score > 1 score = 2 * x3 Accuracy: 0.60778 Confusion Matrix: 80 108 23 123 Predictions: -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 1 1 1 -1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 1 1 1 1 -1 1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1
{ "pile_set_name": "Github" }
/* * dynamic hashed associative table for commands and variables */ #include "sh.h" #define INIT_TBLS 8 /* initial table size (power of 2) */ static void texpand ARGS((struct table *tp, int nsize)); static int tnamecmp ARGS((void *p1, void *p2)); unsigned int hash(n) register const char * n; { register unsigned int h = 0; while (*n != '\0') h = 2*h + *n++; return h * 32821; /* scatter bits */ } void tinit(tp, ap, tsize) register struct table *tp; register Area *ap; int tsize; { tp->areap = ap; tp->tbls = NULL; tp->size = tp->nfree = 0; if (tsize) texpand(tp, tsize); } static void texpand(tp, nsize) register struct table *tp; int nsize; { register int i; register struct tbl *tblp, **p; register struct tbl **ntblp, **otblp = tp->tbls; int osize = tp->size; ntblp = (struct tbl**) alloc(sizeofN(struct tbl *, nsize), tp->areap); for (i = 0; i < nsize; i++) ntblp[i] = NULL; tp->size = nsize; tp->nfree = 8*nsize/10; /* table can get 80% full */ tp->tbls = ntblp; if (otblp == NULL) return; for (i = 0; i < osize; i++) if ((tblp = otblp[i]) != NULL) if ((tblp->flag&DEFINED)) { for (p = &ntblp[hash(tblp->name) & (tp->size-1)]; *p != NULL; p--) if (p == ntblp) /* wrap */ p += tp->size; *p = tblp; tp->nfree--; } else if (!(tblp->flag & FINUSE)) { afree((void*)tblp, tp->areap); } afree((void*)otblp, tp->areap); } struct tbl * tsearch(tp, n, h) register struct table *tp; /* table */ register const char *n; /* name to enter */ unsigned int h; /* hash(n) */ { register struct tbl **pp, *p; if (tp->size == 0) return NULL; /* search for name in hashed table */ for (pp = &tp->tbls[h & (tp->size-1)]; (p = *pp) != NULL; pp--) { if (*p->name == *n && strcmp(p->name, n) == 0 && (p->flag&DEFINED)) return p; if (pp == tp->tbls) /* wrap */ pp += tp->size; } return NULL; } struct tbl * tenter(tp, n, h) register struct table *tp; /* table */ register const char *n; /* name to enter */ unsigned int h; /* hash(n) */ { register struct tbl **pp, *p; register int len; if (tp->size == 0) texpand(tp, INIT_TBLS); Search: /* search for name in hashed table */ for (pp = &tp->tbls[h & (tp->size-1)]; (p = *pp) != NULL; pp--) { if (*p->name == *n && strcmp(p->name, n) == 0) return p; /* found */ if (pp == tp->tbls) /* wrap */ pp += tp->size; } if (tp->nfree <= 0) { /* too full */ texpand(tp, 2*tp->size); goto Search; } /* create new tbl entry */ len = strlen(n) + 1; p = (struct tbl *) alloc(offsetof(struct tbl, name[0]) + len, tp->areap); p->flag = 0; p->type = 0; p->areap = tp->areap; p->u2.field = 0; p->u.array = (struct tbl *)0; memcpy(p->name, n, len); /* enter in tp->tbls */ tp->nfree--; *pp = p; return p; } void tdelete(p) register struct tbl *p; { p->flag = 0; } void twalk(ts, tp) struct tstate *ts; struct table *tp; { ts->left = tp->size; ts->next = tp->tbls; } struct tbl * tnext(ts) struct tstate *ts; { while (--ts->left >= 0) { struct tbl *p = *ts->next++; if (p != NULL && (p->flag&DEFINED)) return p; } return NULL; } static int tnamecmp(p1, p2) void *p1, *p2; { return strcmp(((struct tbl *)p1)->name, ((struct tbl *)p2)->name); } struct tbl ** tsort(tp) register struct table *tp; { register int i; register struct tbl **p, **sp, **dp; p = (struct tbl **)alloc(sizeofN(struct tbl *, tp->size+1), ATEMP); sp = tp->tbls; /* source */ dp = p; /* dest */ for (i = 0; i < tp->size; i++) if ((*dp = *sp++) != NULL && (((*dp)->flag&DEFINED) || ((*dp)->flag&ARRAY))) dp++; i = dp - p; qsortp((void**)p, (size_t)i, tnamecmp); p[i] = NULL; return p; } #ifdef PERF_DEBUG /* performance debugging */ void tprintinfo ARGS((struct table *tp)); void tprintinfo(tp) struct table *tp; { struct tbl *te; char *n; unsigned int h; int ncmp; int totncmp = 0, maxncmp = 0; int nentries = 0; struct tstate ts; shellf("table size %d, nfree %d\n", tp->size, tp->nfree); shellf(" Ncmp name\n"); twalk(&ts, tp); while ((te = tnext(&ts))) { register struct tbl **pp, *p; h = hash(n = te->name); ncmp = 0; /* taken from tsearch() and added counter */ for (pp = &tp->tbls[h & (tp->size-1)]; (p = *pp); pp--) { ncmp++; if (*p->name == *n && strcmp(p->name, n) == 0 && (p->flag&DEFINED)) break; /* return p; */ if (pp == tp->tbls) /* wrap */ pp += tp->size; } shellf(" %4d %s\n", ncmp, n); totncmp += ncmp; nentries++; if (ncmp > maxncmp) maxncmp = ncmp; } if (nentries) shellf(" %d entries, worst ncmp %d, avg ncmp %d.%02d\n", nentries, maxncmp, totncmp / nentries, (totncmp % nentries) * 100 / nentries); } #endif /* PERF_DEBUG */
{ "pile_set_name": "Github" }
/** * Creates a new OpenDocumentView. This view shows a dialog from which the user * can select a mind map from the local storage or a hard disk. * * @constructor */ mindmaps.OpenDocumentView = function() { var self = this; // create dialog var $dialog = $("#template-open").tmpl().dialog({ autoOpen : false, modal : true, zIndex : 5000, width : 550, close : function() { $(this).dialog("destroy"); $(this).remove(); } }); var $openCloudButton = $("#button-open-cloud").button().click(function() { if (self.openCloudButtonClicked) { self.openCloudButtonClicked(); } }); $dialog.find(".file-chooser input").bind("change", function(e) { if (self.openExernalFileClicked) { self.openExernalFileClicked(e); } }); var $table = $dialog.find(".localstorage-filelist"); $table.delegate("a.title", "click", function() { if (self.documentClicked) { var t = $(this).tmplItem(); self.documentClicked(t.data); } }).delegate("a.delete", "click", function() { if (self.deleteDocumentClicked) { var t = $(this).tmplItem(); self.deleteDocumentClicked(t.data); } }); /** * Render list of documents in the local storage * * @param {mindmaps.Document[]} docs */ this.render = function(docs) { // empty list and insert list of documents var $list = $(".document-list", $dialog).empty(); $("#template-open-table-item").tmpl(docs, { format : function(date) { if (!date) return ""; var day = date.getDate(); var month = date.getMonth() + 1; var year = date.getFullYear(); return day + "/" + month + "/" + year; } }).appendTo($list); }; /** * Shows the dialog. * * @param {mindmaps.Document[]} docs */ this.showOpenDialog = function(docs) { this.render(docs); $dialog.dialog("open"); }; /** * Hides the dialog. */ this.hideOpenDialog = function() { $dialog.dialog("close"); }; this.showCloudError = function(msg) { $dialog.find('.cloud-loading').removeClass('loading'); $dialog.find('.cloud-error').text(msg); }; this.showCloudLoading = function() { $dialog.find('.cloud-error').text(''); $dialog.find('.cloud-loading').addClass('loading'); }; this.hideCloudLoading = function() { $dialog.find('.cloud-loading').removeClass('loading'); }; }; /** * Creates a new OpenDocumentPresenter. The presenter can load documents from * the local storage or hard disk. * * @constructor * @param {mindmaps.EventBus} eventBus * @param {mindmaps.MindMapModel} mindmapModel * @param {mindmaps.OpenDocumentView} view * @param {mindmaps.FilePicker} filePicker */ mindmaps.OpenDocumentPresenter = function(eventBus, mindmapModel, view, filePicker) { /** * Open file via cloud */ view.openCloudButtonClicked = function(e) { mindmaps.Util.trackEvent("Clicks", "cloud-open"); mindmaps.Util.trackEvent("CloudOpen", "click"); filePicker.open({ load: function() { view.showCloudLoading(); }, cancel: function () { view.hideCloudLoading(); mindmaps.Util.trackEvent("CloudOpen", "cancel"); }, success: function() { view.hideOpenDialog(); mindmaps.Util.trackEvent("CloudOpen", "success"); }, error: function(msg) { view.showCloudError(msg); mindmaps.Util.trackEvent("CloudOpen", "error", msg); } }); }; // http://www.w3.org/TR/FileAPI/#dfn-filereader /** * View callback: external file has been selected. Try to read and parse a * valid mindmaps Document. * * @ignore */ view.openExernalFileClicked = function(e) { mindmaps.Util.trackEvent("Clicks", "hdd-open"); var files = e.target.files; var file = files[0]; var reader = new FileReader(); reader.onload = function() { try { var doc = mindmaps.Document.fromJSON(reader.result); } catch (e) { eventBus.publish(mindmaps.Event.NOTIFICATION_ERROR, 'File is not a valid mind map!'); throw new Error('Error while opening map from hdd', e); } mindmapModel.setDocument(doc); view.hideOpenDialog(); }; reader.readAsText(file); }; /** * View callback: A document in the local storage list has been clicked. * Load the document and close view. * * @ignore * @param {mindmaps.Document} doc */ view.documentClicked = function(doc) { mindmaps.Util.trackEvent("Clicks", "localstorage-open"); mindmapModel.setDocument(doc); view.hideOpenDialog(); }; /** * View callback: The delete link the local storage list has been clicked. * Delete the document, and render list again. * * @ignore * @param {mindmaps.Document} doc */ view.deleteDocumentClicked = function(doc) { // TODO event mindmaps.LocalDocumentStorage.deleteDocument(doc); // re-render view var docs = mindmaps.LocalDocumentStorage.getDocuments(); view.render(docs); }; /** * Initialize. */ this.go = function() { var docs = mindmaps.LocalDocumentStorage.getDocuments(); docs.sort(mindmaps.Document.sortByModifiedDateDescending); view.showOpenDialog(docs); }; };
{ "pile_set_name": "Github" }
// ========================================================================== // Project: CoreTools.Target // Copyright: ©2010 Apple Inc. // ========================================================================== /*globals CoreTools */ /** @class Describes a target in the build system. @extends SC.Record */ CoreTools.Target = SC.Record.extend( /** @scope CoreTools.Target.prototype */ { primaryKey: "name", /** Name of target. This is also the primary key. */ name: SC.Record.attr(String), /** Parent of target. Only non-null for nested targets. */ parent: SC.Record.toOne("CoreTools.Target"), /** URL to use to load tests. */ testsUrl: SC.Record.attr(String, { key: "link_tests" }), /** URL to use to load the app. If no an app, returns null */ appUrl: function() { return (this.get('kind') === 'app') ? this.get('name') : null; }.property('kind', 'name').cacheable(), /** The isExpanded state. Defaults to NO on load. */ isExpanded: SC.Record.attr(Boolean, { defaultValue: NO }), /** Children of this target. Computed by getting the loaded targets */ children: function() { var store = this.get('store'), query = CoreTools.TARGETS_QUERY, ret = store.find(query).filterProperty('parent', this); if (ret) ret = ret.sortProperty('kind', 'displayName'); return (ret && ret.get('length')>0) ? ret : null ; }.property().cacheable(), /** Display name for this target */ displayName: function() { var name = (this.get('name') || '(unknown)').split('/'); return name[name.length-1]; }.property('name').cacheable(), /** The icon to display. Based on the type. */ targetIcon: function() { var ret = 'sc-icon-document-16'; switch(this.get('kind')) { case "framework": ret = 'sc-icon-folder-16'; break; case "app": ret = 'sc-icon-options-16'; break; } return ret ; }.property('kind').cacheable(), /** This is the group key used to display. Will be the kind unless the item belongs to the sproutcore target. */ sortKind: function() { if (this.get('name') === '/sproutcore') return null; var parent = this.get('parent'); if (parent && (parent.get('name') === '/sproutcore')) return 'sproutcore'; else return (this.get('kind') || 'unknown').toLowerCase(); }.property('kind', 'parent').cacheable(), testsQuery: function() { return SC.Query.remote(CoreTools.Test, { url: this.get('testsUrl') }); }.property('testsUrl').cacheable(), /** Returns all of the tests associated with this target by fetching the testsUrl. */ tests: function() { return this.get('store').find(this.get('testsQuery')); }.property('testsQuery').cacheable() }) ; CoreTools.TARGETS_QUERY = SC.Query.remote(CoreTools.Target);
{ "pile_set_name": "Github" }
/* * Copyright 2019-2020 Mamoe Technologies and contributors. * * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * Use of this source code is governed by the GNU AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found via the following link. * * https://github.com/mamoe/mirai/blob/master/LICENSE */ @file:Suppress("unused") package net.mamoe.mirai.network import net.mamoe.mirai.Bot import net.mamoe.mirai.utils.MiraiExperimentalAPI import net.mamoe.mirai.utils.MiraiInternalAPI import net.mamoe.mirai.utils.SinceMirai /** * 在 [登录][Bot.login] 失败时抛出, 可正常地中断登录过程. */ public sealed class LoginFailedException( /** * 是否可因此登录失败而关闭 [Bot]. 一般是密码错误, 被冻结等异常时. */ public val killBot: Boolean = false, message: String? = null, cause: Throwable? = null ) : RuntimeException(message, cause) /** * 密码输入错误 (有时候也会是其他错误, 如 `"当前上网环境异常,请更换网络环境或在常用设备上登录或稍后再试。"`) */ public class WrongPasswordException @MiraiInternalAPI constructor( message: String? ) : LoginFailedException(true, message) /** * 无可用服务器 */ public class NoServerAvailableException @MiraiInternalAPI constructor( public override val cause: Throwable? ) : LoginFailedException(false, "no server available") /** * 服务器要求稍后重试 */ @SinceMirai("1.2.0") public class RetryLaterException @MiraiInternalAPI constructor() : LoginFailedException(false, "server requests retrial later") /** * 无标准输入或 Kotlin 不支持此输入. */ public class NoStandardInputForCaptchaException @MiraiInternalAPI constructor( public override val cause: Throwable? ) : LoginFailedException(true, "no standard input for captcha") /** * 需要短信验证时抛出. mirai 目前还不支持短信验证. */ @MiraiExperimentalAPI("Will be removed when SMS login is supported") public class UnsupportedSMSLoginException(message: String?) : LoginFailedException(true, message) /** * 非 mirai 实现的异常 */ public abstract class CustomLoginFailedException : LoginFailedException { public constructor(killBot: Boolean) : super(killBot) public constructor(killBot: Boolean, message: String?) : super(killBot, message) public constructor(killBot: Boolean, message: String?, cause: Throwable?) : super(killBot, message, cause) public constructor(killBot: Boolean, cause: Throwable?) : super(killBot, cause = cause) }
{ "pile_set_name": "Github" }
// author: Jannik Strötgen // email: [email protected] // resources automatically created; see our EMNLP 2015 paper for details: // https://aclweb.org/anthology/D/D15/D15-1063.pdf // // english: "one","1" "вейке","1" // english: "two","2" "кавто","2" // english: "three","3" "колмо","3" // english: "four","4" "ниле","4" // english: "five","5" "вете","5" // english: "six","6" "кото","6" // english: "seven","7" "сисем","7" // english: "eight","8" "кавксо","8" // english: "nine","9" "вейксе","9" // english: "ten","10" "кемень","10"
{ "pile_set_name": "Github" }
var entry = document.querySelector('#entry'); var output = document.querySelector('h1'); entry.addEventListener('input', function(){ // value in form text input field console.log('ENTRY: ', entry.value); // AJAX SEND var xhr = new XMLHttpRequest(); xhr.open('POST', '/api/check'); xhr.send(JSON.stringify({'Name':entry.value})); console.log("JSON SENT:", JSON.stringify({'Name':entry.value})); // AJAX RECEIVE xhr.addEventListener('readystatechange', function(){ if (xhr.readyState === 4 && xhr.status === 200) { console.log("JSON RCVD:", xhr.responseText); var taken = JSON.parse(xhr.responseText); console.log('TAKEN:', taken, '\n\n'); if (taken == 'true') { output.textContent = 'Word Taken!'; } else { output.textContent = ''; } } }); });
{ "pile_set_name": "Github" }
/* * Copyright (c) 2004-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #include "UDPHeader.h" #include <folly/io/Cursor.h> #include <folly/lang/Bits.h> #include <sstream> #include "fboss/agent/FbossError.h" #include "fboss/agent/PortStats.h" #include "fboss/agent/packet/IPv4Hdr.h" #include "fboss/agent/packet/IPv6Hdr.h" #include "fboss/agent/packet/PktUtil.h" using folly::Endian; using folly::io::Cursor; using std::string; using std::stringstream; namespace facebook::fboss { template <typename IPHDR> uint16_t UDPHeader::computeChecksumImpl(const IPHDR& ip, const Cursor& cursor) const { // Checksum the IP pseudo-header uint32_t sum = ip.pseudoHdrPartialCsum(); // Checksum the udp header sum += srcPort; sum += dstPort; sum += length; // Now the payload auto payloadLength = length - UDPHeader::size(); // Finish the end-around carry uint16_t cs = PktUtil::finalizeChecksum(cursor, payloadLength, sum); // A 0 checksum should be transmitted as all ones if (cs == 0) { cs = 0xffff; } return cs; } void UDPHeader::parse(Cursor* cursor) { srcPort = cursor->readBE<uint16_t>(); dstPort = cursor->readBE<uint16_t>(); length = cursor->readBE<uint16_t>(); csum = cursor->readBE<uint16_t>(); } void UDPHeader::parse(Cursor* cursor, PortStats* stats) { try { parse(cursor); } catch (std::out_of_range&) { stats->udpTooSmall(); throw FbossError( "Too small packet. Got ", cursor->length(), " bytes. Minimum ", size(), " bytes"); } } bool UDPHeader::operator==(const UDPHeader& r) const { return length == r.length && csum == r.csum && srcPort == r.srcPort && dstPort == r.dstPort; } uint16_t UDPHeader::computeChecksum( const IPv4Hdr& ipv4Hdr, const Cursor& cursor) const { return computeChecksumImpl(ipv4Hdr, cursor); } void UDPHeader::updateChecksum(const IPv4Hdr& ipv6Hdr, const Cursor& cursor) { csum = computeChecksum(ipv6Hdr, cursor); } uint16_t UDPHeader::computeChecksum( const IPv6Hdr& ipv6Hdr, const Cursor& cursor) const { return computeChecksumImpl(ipv6Hdr, cursor); } void UDPHeader::updateChecksum(const IPv6Hdr& ipv6Hdr, const Cursor& cursor) { csum = computeChecksum(ipv6Hdr, cursor); } string UDPHeader::toString() const { stringstream ss; ss << " Length: " << length << " Checksum: " << csum << " Source port: " << srcPort << " Destination port: " << dstPort; return ss.str(); } } // namespace facebook::fboss
{ "pile_set_name": "Github" }
export let NodeCanvasFactory: { new (): {}; }; export let NodeCMapReaderFactory: { new (): {}; };
{ "pile_set_name": "Github" }
LOCUS HM138502 1410 bp cRNA linear VRL 22-APR-2010 DEFINITION Influenza A virus (A/California/07/2009(H1N1)) segment 6 neuraminidase (NA) gene, complete cds. ACCESSION HM138502 VERSION HM138502.1 GI:295002854 DBLINK BioProject: PRJNA37813 KEYWORDS . SOURCE Influenza A virus (A/California/07/2009(H1N1)) ORGANISM Influenza A virus (A/California/07/2009(H1N1)) Viruses; ssRNA negative-strand viruses; Orthomyxoviridae; Influenzavirus A. REFERENCE 1 (bases 1 to 1410) AUTHORS Starick,E. TITLE Direct Submission JOURNAL Submitted (21-APR-2010) Friedrich-Loeffler-Institut, Suedufer 10, Greifswald-Insel Riems 17493, Germany COMMENT Swine influenza A (H1N1) virus isolated during human swine flu outbreak of 2009. ##GISAID_EpiFlu(TM)Data-START## Isolate :: A/California/07/09 Subtype :: H1N1 Lineage :: swl ##GISAID_EpiFlu(TM)Data-END## FEATURES Location/Qualifiers source 1..1410 /organism="Influenza A virus (A/California/07/2009(H1N1))" /mol_type="viral cRNA" /strain="A/California/07/2009" /serotype="H1N1" /host="Homo sapiens" /db_xref="taxon:641809" /segment="6" /country="USA" /collection_date="09-Apr-2009" /note="lineage: swl" gene 1..1410 /gene="NA" CDS 1..1410 /gene="NA" /codon_start=1 /product="neuraminidase" /protein_id="ADF58339.1" /db_xref="GI:295002855" /translation="MNPNQKIITIGSVCMTIGMANLILQIGNIISIWISHSIQLGNQN QIETCNQSVITYENNTWVNQTYVNISNTNFAAGQSVVSVKLAGNSSLCPVSGWAIYSK DNSVRIGSKGDVFVIREPFISCSPLECRTFFLTQGALLNDKHSNGTIKDRSPYRTLMS CPIGEVPSPYNSRFESVAWSASACHDGINWLTIGISGPDNGAVAVLKYNGIITDTIKS WRNNILRTQESECACVNGSCFTVMTDGPSNGQASYKIFRIEKGKIVKSVEMNAPNYHY EECSCYPDSSEITCVCRDNWHGSNRPWVSFNQNLEYQIGYICSGIFGDNPRPNDKTGS CGPVSSNGANGVKGFSFKYGNGVWIGRTKSISSRNGFEMIWDPNGWTGTDNNFSIKQD IVGINEWSGYSGSFVQHPELTGLDCIRPCFWVELIRGRPKENTIWTSGSSISFCGVNS DTVGWSWPDGAELPFTIDK" ORIGIN 1 atgaatccaa accaaaagat aataaccatt ggttcggtct gtatgacaat tggaatggct 61 aacttaatat tacaaattgg aaacataatc tcaatatgga ttagccactc aattcaactt 121 gggaatcaaa atcagattga aacatgcaat caaagcgtca ttacttatga aaacaacact 181 tgggtaaatc agacatatgt taacatcagc aacaccaact ttgctgctgg acagtcagtg 241 gtttccgtga aattagcagg caattcctct ctctgccctg ttagtggatg ggctatatac 301 agtaaagaca acagtgtaag aatcggttcc aagggggatg tgtttgtcat aagggaacca 361 ttcatatcat gctccccctt ggaatgcaga accttcttct tgactcaagg ggccttgcta 421 aatgacaaac attccaatgg aaccattaaa gacaggagcc catatcgaac cctaatgagc 481 tgtcctattg gtgaagttcc ctctccatac aactcaagat ttgagtcagt cgcttggtca 541 gcaagtgctt gtcatgatgg catcaattgg ctaacaattg gaatttctgg cccagacaat 601 ggggcagtgg ctgtgttaaa gtacaacggc ataataacag acactatcaa gagttggaga 661 aacaatatat tgagaacaca agagtctgaa tgtgcatgtg taaatggttc ttgctttact 721 gtaatgaccg atggaccaag taatggacag gcctcataca agatcttcag aatagaaaag 781 ggaaagatag tcaaatcagt cgaaatgaat gcccctaatt atcactatga ggaatgctcc 841 tgttatcctg attctagtga aatcacatgt gtgtgcaggg ataactggca tggctcgaat 901 cgaccgtggg tgtctttcaa ccagaatctg gaatatcaga taggatacat atgcagtggg 961 attttcggag acaatccacg ccctaatgat aagacaggca gttgtggtcc agtatcgtct 1021 aatggagcaa atggagtaaa agggttttca ttcaaatacg gcaatggtgt ttggataggg 1081 agaactaaaa gcattagttc aagaaacggt tttgagatga tttgggatcc gaacggatgg 1141 actgggacag acaataactt ctcaataaag caagatatcg taggaataaa tgagtggtca 1201 ggatatagcg ggagttttgt tcagcatcca gaactaacag ggctggattg tataagacct 1261 tgcttctggg ttgaactaat cagagggcga cccaaagaga acacaatctg gactagcggg 1321 agcagcatat ccttttgtgg tgtaaacagt gacactgtgg gttggtcttg gccagacggt 1381 gctgagttgc catttaccat tgacaagtaa //
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <resources> <drawable name="locale_current_flag">@drawable/flag_vietnam</drawable> </resources>
{ "pile_set_name": "Github" }
function Ahat = nearestSPD(A) % nearestSPD - the nearest (in Frobenius norm) Symmetric Positive Definite matrix to A % usage: Ahat = nearestSPD(A) % % From Higham: "The nearest symmetric positive semidefinite matrix in the % Frobenius norm to an arbitrary real matrix A is shown to be (B + H)/2, % where H is the symmetric polar factor of B=(A + A')/2." % % http://www.sciencedirect.com/science/article/pii/0024379588902236 % % arguments: (input) % A - square matrix, which will be converted to the nearest Symmetric % Positive Definite Matrix. % % Arguments: (output) % Ahat - The matrix chosen as the nearest SPD matrix to A. if nargin ~= 1 error('Exactly one argument must be provided.') end % test for a square matrix A [r,c] = size(A); if r ~= c error('A must be a square matrix.') elseif (r == 1) && (A <= 0) % A was scalar and non-positive, so just return eps Ahat = eps; return end % symmetrize A into B B = (A + A')/2; % Compute the symmetric polar factor of B. Call it H. % Clearly H is itself SPD. [U,Sigma,V] = svd(B); H = V*Sigma*V'; % get Ahat in the above formula Ahat = (B+H)/2; % ensure symmetry Ahat = (Ahat + Ahat')/2; % test that Ahat is in fact PD. if it is not so, then tweak it just a bit. p = 1; k = 0; while p ~= 0 [R,p] = chol(Ahat); k = k + 1; if p ~= 0 % Ahat failed the chol test. It must have been just a hair off, % due to floating point trash, so it is simplest now just to % tweak by adding a tiny multiple of an identity matrix. mineig = min(eig(Ahat)); Ahat = Ahat + (-mineig*k.^2 + eps(mineig))*eye(size(A)); end end
{ "pile_set_name": "Github" }
<jqxKnob [value]="60" [min]="0" [max]="100" [startAngle]="120" [endAngle]="480" [snapToStep]="true" [rotation]="'clockwise'" [marks]="marks" [labels]="labels" [progressBar]="progressBar" [pointer]="pointer"> </jqxKnob>
{ "pile_set_name": "Github" }
// Distributed under the terms of the MIT license // Test case submitted to project by https://github.com/practicalswift (practicalswift) // Test case found by fuzzing protocol c { { { } } { } { } enum A { class B { deinit { if true { class case ,
{ "pile_set_name": "Github" }
// // Labels // -------------------------------------------------- .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: @label-color; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; // Add hover effects, but only for links a& { &:hover, &:focus { color: @label-link-hover-color; text-decoration: none; cursor: pointer; } } // Empty labels collapse automatically (not available in IE8) &:empty { display: none; } // Quick fix for labels in buttons .btn & { position: relative; top: -1px; } } // Colors // Contextual variations (linked labels get darker on :hover) .label-default { .label-variant(@label-default-bg); } .label-primary { .label-variant(@label-primary-bg); } .label-success { .label-variant(@label-success-bg); } .label-info { .label-variant(@label-info-bg); } .label-warning { .label-variant(@label-warning-bg); } .label-danger { .label-variant(@label-danger-bg); }
{ "pile_set_name": "Github" }
Usage Example ============= Let's create a database! $ sdb d hello=world $ sdb d hello world Using arrays (>=0.6): $ sdb - '[]list=1,2' '[0]list' '[0]list=foo' '[]list' '[+1]list=bar' 1 foo 2 foo fuck 2 Let's play with json: $ sdb d g='{"foo":1,"bar":{"cow":3}}' $ sdb d g:bar.cow 3 $ sdb - user='{"id":123}' user:id=99 user:id 99 Using the commandline without any disk database: $ sdb - foo=bar foo a=3 +a -a bar 4 3 $ sdb - foo=bar foo bar a=3 +a 4 -a 3 Remove the database $ rm -f d
{ "pile_set_name": "Github" }
/* * jQuery UI CSS Framework * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .ui-helper-clearfix { display: inline-block; } /* required comment for clearfix to work in Opera \*/ * html .ui-helper-clearfix { height:1%; } .ui-helper-clearfix { display:block; } /* end clearfix */ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /* * jQuery UI CSS Framework * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px */ /* Component containers ----------------------------------*/ .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } .ui-widget-content a { color: #333333; } .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } .ui-widget-header a { color: #ffffff; } /* Interaction states ----------------------------------*/ .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } .ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } .ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } .ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } .ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } .ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-off { background-position: -96px -144px; } .ui-icon-radio-on { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } .ui-icon-pause { background-position: -16px -160px; } .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } .ui-icon-volume-off { background-position: -128px -160px; } .ui-icon-volume-on { background-position: -144px -160px; } .ui-icon-power { background-position: 0 -176px; } .ui-icon-signal-diag { background-position: -16px -176px; } .ui-icon-signal { background-position: -32px -176px; } .ui-icon-battery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } /* Overlays */ .ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* Resizable ----------------------------------*/ .ui-resizable { position: relative;} .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Accordion ----------------------------------*/ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } .ui-accordion .ui-accordion-li-fix { display: inline; } .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } .ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete ----------------------------------*/ .ui-autocomplete { position: absolute; cursor: default; } .ui-autocomplete-loading { background: white; } /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ /* Menu ----------------------------------*/ .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; } .ui-menu .ui-menu { margin-top: -3px; } .ui-menu .ui-menu-item { margin:0; padding: 0; width: 100%; } .ui-menu .ui-menu-item a { text-decoration:none; display:block; padding:.2em .4em; line-height:1.5; zoom:1; } .ui-menu .ui-menu-item a.ui-state-hover, .ui-menu .ui-menu-item a.ui-state-active { margin: -1px; } /* Button ----------------------------------*/ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ .ui-button-icons-only { width: 3.4em; } button.ui-button-icons-only { width: 3.7em; } /*button text element */ .ui-button .ui-button-text { display: block; line-height: 1.4; } .ui-button-text-only .ui-button-text { padding: .4em 1em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } .ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ input.ui-button { padding: .4em 1em; } /*button icon element(s) */ .ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } .ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } /*button sets*/ .ui-buttonset { margin-right: 7px; } .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } /* workarounds */ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ /* Dialog ----------------------------------*/ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } /* Slider ----------------------------------*/ .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } .ui-slider-horizontal .ui-slider-range-min { left: 0; } .ui-slider-horizontal .ui-slider-range-max { right: 0; } .ui-slider-vertical { width: .8em; height: 100px; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; }/* Datepicker ----------------------------------*/ .ui-datepicker { width: 17em; padding: .2em .2em 0; } .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } .ui-datepicker .ui-datepicker-prev { left:2px; } .ui-datepicker .ui-datepicker-next { right:2px; } .ui-datepicker .ui-datepicker-prev-hover { left:1px; } .ui-datepicker .ui-datepicker-next-hover { right:1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%;} .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } /* with multiple calendars */ .ui-datepicker.ui-datepicker-multi { width:auto; } .ui-datepicker-multi .ui-datepicker-group { float:left; } .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } .ui-datepicker-row-break { clear:both; width:100%; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } .ui-datepicker-rtl .ui-datepicker-group { float:right; } .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ .ui-datepicker-cover { display: none; /*sorry for IE5*/ display/**/: block; /*sorry for IE5*/ position: absolute; /*must have*/ z-index: -1; /*must have*/ filter: mask(); /*must have*/ top: -4px; /*must have*/ left: -4px; /*must have*/ width: 200px; /*must have*/ height: 200px; /*must have*/ }
{ "pile_set_name": "Github" }
<template> <div class="app-container"> <!-- Note that row-key is necessary to get a correct row order. --> <el-table ref="dragTable" v-loading="listLoading" :data="list" row-key="id" border fit highlight-current-row style="width: 100%"> <el-table-column align="center" label="ID" width="65"> <template slot-scope="scope"> <span>{{ scope.row.id }}</span> </template> </el-table-column> <el-table-column width="180px" align="center" label="Date"> <template slot-scope="scope"> <span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> </template> </el-table-column> <el-table-column min-width="300px" label="Title"> <template slot-scope="scope"> <span>{{ scope.row.title }}</span> </template> </el-table-column> <el-table-column width="110px" align="center" label="Author"> <template slot-scope="scope"> <span>{{ scope.row.author }}</span> </template> </el-table-column> <el-table-column width="100px" label="Importance"> <template slot-scope="scope"> <svg-icon v-for="n in +scope.row.importance" :key="n" icon-class="star" class="icon-star" /> </template> </el-table-column> <el-table-column align="center" label="Readings" width="95"> <template slot-scope="scope"> <span>{{ scope.row.pageviews }}</span> </template> </el-table-column> <el-table-column class-name="status-col" label="Status" width="110"> <template slot-scope="{row}"> <el-tag :type="row.status | statusFilter"> {{ row.status }} </el-tag> </template> </el-table-column> <el-table-column align="center" label="Drag" width="80"> <template slot-scope="{}"> <svg-icon class="drag-handler" icon-class="drag" /> </template> </el-table-column> </el-table> <!-- $t is vue-i18n global function to translate lang (lang in @/lang) --> <div class="show-d"> <el-tag style="margin-right:12px;">{{ $t('table.dragTips1') }} :</el-tag> {{ oldList }} </div> <div class="show-d"> <el-tag>{{ $t('table.dragTips2') }} :</el-tag> {{ newList }} </div> </div> </template> <script> import { fetchList } from '@/api/article' import Sortable from 'sortablejs' export default { name: 'DragTable', filters: { statusFilter(status) { const statusMap = { published: 'success', draft: 'info', deleted: 'danger' } return statusMap[status] } }, data() { return { list: null, total: null, listLoading: true, listQuery: { page: 1, limit: 10 }, sortable: null, oldList: [], newList: [] } }, created() { this.getList() }, methods: { async getList() { this.listLoading = true const { data } = await fetchList(this.listQuery) this.list = data.items this.total = data.total this.listLoading = false this.oldList = this.list.map(v => v.id) this.newList = this.oldList.slice() this.$nextTick(() => { this.setSort() }) }, setSort() { const el = this.$refs.dragTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] this.sortable = Sortable.create(el, { ghostClass: 'sortable-ghost', // Class name for the drop placeholder, setData: function(dataTransfer) { // to avoid Firefox bug // Detail see : https://github.com/RubaXa/Sortable/issues/1012 dataTransfer.setData('Text', '') }, onEnd: evt => { const targetRow = this.list.splice(evt.oldIndex, 1)[0] this.list.splice(evt.newIndex, 0, targetRow) // for show the changes, you can delete in you code const tempIndex = this.newList.splice(evt.oldIndex, 1)[0] this.newList.splice(evt.newIndex, 0, tempIndex) } }) } } } </script> <style> .sortable-ghost{ opacity: .8; color: #fff!important; background: #42b983!important; } </style> <style scoped> .icon-star{ margin-right:2px; } .drag-handler{ width: 20px; height: 20px; cursor: pointer; } .show-d{ margin-top: 15px; } </style>
{ "pile_set_name": "Github" }