text:
//
// Created by marwac-9 on 9/16/15.
//

#include "PickingApp.h"
#include <cstring>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include "GraphicsManager.h"
#include "GraphicsStorage.h"
#include "Node.h"
#include "Material.h"
#include "Texture.h"
#include "OBJ.h"
#include <fstream>
#include "SceneGraph.h"
#include "ShaderManager.h"
#include <string>
#include "DebugDraw.h"
#include "PhysicsManager.h"
#include "FBOManager.h"
#include "Camera.h"
#include "Frustum.h"
#include "Render.h"
#include "RigidBody.h"
#include "CameraManager.h"
#include "FrameBuffer.h"
#include "Times.h"
#include "BoundingBox.h"
#include "ImGuiWrapper.h"
#include <imgui.h>
#include "DirectionalLight.h"

using namespace Display;
namespace Picking
{

//------------------------------------------------------------------------------
/**
*/
    PickingApp::PickingApp()
    {
        // empty
    }

//------------------------------------------------------------------------------
/**
*/
    PickingApp::~PickingApp()
    {
        // empty
    }

//------------------------------------------------------------------------------
/**
*/
    bool
    PickingApp::Open()
    {
        App::Open();
        this->window = new Display::Window;

        window->SetKeyPressFunction([this](int32 key , int32 scancode, int32 action, int32 mode)
        {
            KeyCallback(key,scancode,action,mode);
        });

		window->SetMouseMoveFunction([this](double mouseX, double mouseY)
		{
			MouseCallback(mouseX, mouseY);
		});

        // window resize callback
        this->window->SetWindowSizeFunction([this](int width, int height)
        {
			if (!minimized)
			{
				this->windowWidth = width;
				this->windowHeight = height;
				this->windowMidX = windowWidth / 2.0f;
				this->windowMidY = windowHeight / 2.0f;
				this->window->SetSize(this->windowWidth, this->windowHeight);
				FBOManager::Instance()->UpdateTextureBuffers(this->windowWidth, this->windowHeight);
				currentCamera->UpdateSize(width, height);
			}
        });

        this->window->SetMousePressFunction([this](int button, int action, int mods)
        {
            if(button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS)
            {
                isLeftMouseButtonPressed = true;
            }
            if(button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_RELEASE)
            {
                isLeftMouseButtonPressed = false;
            }
			else if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS)
			{

			}
			else if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_RELEASE)
			{
			}
			else if (button == GLFW_MOUSE_BUTTON_MIDDLE && action == GLFW_PRESS)
			{
				SceneGraph::Instance()->InitializeSceneTree();
				GraphicsManager::ReloadShaders();
			}
			else if (button == GLFW_MOUSE_BUTTON_MIDDLE && action == GLFW_RELEASE)
			{
			}

        });
		window->SetWindowIconifyFunction([this](int iconified) {
			if (iconified) minimized = true;
			else minimized = false;
		});
        if (this->window->Open())
        {
            running = true;
            return true;
        }
        return false;
    }

//------------------------------------------------------------------------------
/**
*/
    void
    PickingApp::Run()
    {
        InitGL();

		SetUpBuffers(this->windowWidth, this->windowHeight);

		GraphicsManager::LoadAllAssets();

		Render::Instance()->InitializeShderBlockDatas();

		ImGuiWrapper ImGuiWrapper(window);

        // For speed computation (FPS)
		Times::Instance()->currentTime = glfwGetTime();

		//camera rotates based on mouse movement, setting initial mouse pos will always focus camera at the beginning in specific position
		window->SetCursorPos(windowMidX, windowMidY+100);
		window->SetCursorMode(GLFW_CURSOR_DISABLED);

		SetUpCamera();

		LoadScene2();
		currentScene = scene2Loaded;

		double customIntervalTime = 0.0;
		SceneGraph::Instance()->Update();

		glfwSwapInterval(0); //unlock fps

        while (running)
        {
			glDepthMask(GL_TRUE);
			glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
			glEnable(GL_DEPTH_TEST);

			glDisable(GL_BLEND);
            this->window->Update();
			if (minimized) continue;
			ImGuiWrapper.NewFrame();

			Times::Instance()->Update(glfwGetTime());

			Monitor(this->window);

			CameraManager::Instance()->Update(Times::Instance()->deltaTime);
			FrustumManager::Instance()->ExtractPlanes(CameraManager::Instance()->ViewProjection);

			switch (currentScene)
			{
				case scene1Loaded:
					if (customIntervalTime >= 0.2){
						SpawnSomeLights(); //have to draw on plane
						customIntervalTime = 0.0;
					}
					break;
				case scene2Loaded:
					MovePlaneUpNDown();
					break;
			}

			SceneGraph::Instance()->Update();

			PhysicsManager::Instance()->Update(Times::Instance()->dtInv);

			if (lightsPhysics)
			{
				if (currentScene == scene2Loaded) Vortex();
			}

			SceneGraph::Instance()->FrustumCulling();

			Render::Instance()->UpdateShaderBlockDatas();

			GenerateGUI();

			DrawPicking();

			DrawGeometryPass();

			if (altButtonToggle) PickingTest();

			DrawLightPass();

			BlitToScreenPass();

			if (debug) DrawDebug();

			DebugDraw::Instance()->DrawCrossHair();

			DrawGeometryMaps(windowWidth, windowHeight);

			ImGuiWrapper.Render();

			customIntervalTime += Times::Instance()->deltaTime;

            this->window->SwapBuffers();
        }
		GraphicsStorage::Clear();
        this->window->Close();
    }

    void
    PickingApp::KeyCallback(int key, int scancode, int action, int mods)
    {
		if (action == GLFW_PRESS)
		{
			if (key == GLFW_KEY_ESCAPE) {
				running = false;
			}
			else if (key == GLFW_KEY_R) {
				//SceneGraph::Instance()->addRandomObject();
			}
			//this is just used to show hide cursor, mouse steal on/off
			else if (key == GLFW_KEY_LEFT_ALT) {
				if (altButtonToggle) {
					altButtonToggle = false;
					window->SetCursorMode(GLFW_CURSOR_NORMAL);
					currentCamera->holdingForward = false;
					currentCamera->holdingBackward = false;
					currentCamera->holdingRight = false;
					currentCamera->holdingLeft = false;
					currentCamera->holdingUp = false;
					currentCamera->holdingDown = false;
				}
				else {
					altButtonToggle = true;
					window->SetCursorPos(windowWidth / 2.f, windowHeight / 2.f);
					window->SetCursorMode(GLFW_CURSOR_DISABLED);
				}
			}
			else if (key == GLFW_KEY_1) {
				currentScene = scene1Loaded;
				LoadScene1();
			}
			else if (key == GLFW_KEY_2) {
				currentScene = scene2Loaded;
				LoadScene2();
			}
			else if (key == GLFW_KEY_3) {
				currentScene = scene3Loaded;
				LoadScene3();
			}
			else if (key == GLFW_KEY_BACKSPACE)
			{
				if (lightsPhysics) lightsPhysics = false;
				else lightsPhysics = true;
			}
			else if (key == GLFW_KEY_TAB) {
				if (wireframe)
				{
					wireframe = false;
					printf("\nSHADED MODE\n");
					glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
				}
				else
				{
					wireframe = true;
					printf("\nWIREFRAME MODE\n");
					glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
				}

			}
			else if (key == GLFW_KEY_S && window->GetKey(GLFW_KEY_LEFT_CONTROL)) {
				auto it = --GraphicsStorage::objs.end();
				GraphicsManager::SaveToOBJ(it->second);
				std::cout << "Last Mesh Saved" << std::endl;
			}
			else if (key == GLFW_KEY_O) {
				if (debug)
				{
					debug = false;
				}
				else
				{
					debug = true;
				}
			}
			else if (key == GLFW_KEY_P)
			{
				if (Times::Instance()->paused) Times::Instance()->paused = false;
				else Times::Instance()->paused = true;
			}
			else if (key == GLFW_KEY_T)
			{
				Times::Instance()->timeModifier = 0.0;
			}
			else if (key == GLFW_KEY_F5)
			{
				if (DebugDraw::Instance()->debug) DebugDraw::Instance()->debug = false;
				else DebugDraw::Instance()->debug = true;
			}

			else if (key == GLFW_KEY_E)
			{
				Object* cube = SceneGraph::Instance()->addPhysicObject("cube", Vector3(0.0, 8.0, 0.0));
				cube->node->SetPosition(Vector3(0.0, (double)SceneGraph::Instance()->pickingList.size() * 2.0 - 10.0 + 0.001, 0.0));
				SceneGraph::Instance()->SwitchObjectMovableMode(cube, true);
			}
		}
    }

    void
    PickingApp::Monitor(Display::Window* windowIn)
    {
		if (windowIn->GetKey(GLFW_KEY_KP_ADD) == GLFW_PRESS) Times::Instance()->timeModifier += 0.0005;
		if (windowIn->GetKey(GLFW_KEY_KP_SUBTRACT) == GLFW_PRESS) Times::Instance()->timeModifier -= 0.0005;
		if (windowIn->GetKey(GLFW_KEY_UP) == GLFW_PRESS) if (lastPickedObject) lastPickedObject->node->Translate(Vector3(0.f, 0.05f, 0.f));
		if (windowIn->GetKey(GLFW_KEY_DOWN) == GLFW_PRESS) if (lastPickedObject) lastPickedObject->node->Translate(Vector3(0.f, -0.05f, 0.f));
		if (windowIn->GetKey(GLFW_KEY_LEFT) == GLFW_PRESS) if (lastPickedObject) lastPickedObject->node->Translate(Vector3(0.05f, 0.f, 0.f));
		if (windowIn->GetKey(GLFW_KEY_RIGHT) == GLFW_PRESS) if (lastPickedObject) lastPickedObject->node->Translate(Vector3(-0.05f, 0.f, 0.f));

		if (altButtonToggle)
		{
			currentCamera->holdingForward = (window->GetKey(GLFW_KEY_W) == GLFW_PRESS);
			currentCamera->holdingBackward = (window->GetKey(GLFW_KEY_S) == GLFW_PRESS);
			currentCamera->holdingRight = (window->GetKey(GLFW_KEY_D) == GLFW_PRESS);
			currentCamera->holdingLeft = (window->GetKey(GLFW_KEY_A) == GLFW_PRESS);
			currentCamera->holdingUp = (window->GetKey(GLFW_KEY_SPACE) == GLFW_PRESS);
			currentCamera->holdingDown = (window->GetKey(GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS);
		}
		currentCamera->fov = fov;
		currentCamera->near = near;
		currentCamera->far = far;
    }

	void
	PickingApp::GenerateGUI()
	{
		ImGui::Begin("Properties", NULL, ImGuiWindowFlags_AlwaysAutoResize);

		ImGui::NewLine();
		if (dirLightComp != nullptr)
		{
			ImGui::SliderFloat("DirDif", &dirLightComp->properties.diffuse, 0.f, 100.f);
			ImGui::SliderFloat("DirSpec", &dirLightComp->properties.specular, 0.f, 100.f);
		}
		if (planeObject != nullptr)
		{
			ImGui::SliderFloat("PlaneShi", &planeObject->materials[0]->shininess, 0.f, 100.f);
		}

		ImGui::Text("Objects rendered %d", objectsRendered);
		ImGui::Text("Lights rendered %d", lightsRendered);
		ImGui::Text("FPS %.3f", 1.0 / Times::Instance()->deltaTime);
		ImGui::Text("TimeStep %.3f", 1.0 / Times::Instance()->timeStep);
		ImGui::Text("PickedID %d", pickedID);
		ImGui::Text("PRUNE %.8f", PhysicsManager::Instance()->pruneAndSweepTime);
		ImGui::Text("SAT %.8f", PhysicsManager::Instance()->satTime);
		ImGui::Text("Intersection Test %.8f", PhysicsManager::Instance()->intersectionTestTime);
		ImGui::Text("Generate Contacts %.8f", PhysicsManager::Instance()->generateContactsTime);
		ImGui::Text("Process Contacts %.8f", PhysicsManager::Instance()->processContactTime);
		ImGui::Text("Positional Correction %.8f", PhysicsManager::Instance()->positionalCorrectionTime);
		ImGui::Text("Iterations Count %d", PhysicsManager::Instance()->iterCount);

		ImGui::End();
	}

    void
    PickingApp::PickingTest()
    {
        if(isLeftMouseButtonPressed)
        {
			window->GetCursorPos(&leftMouseX,&leftMouseY);

			//read pixel from picking texture
			unsigned int Pixel;
			//inverted y coordinate because glfw 0,0 starts at topleft while opengl texture 0,0 starts at bottomleft
			pickingBuffer->ReadPixelData((unsigned int)leftMouseX, this->windowHeight - (unsigned int)leftMouseY, 1, 1, GL_UNSIGNED_INT, &Pixel, pickingTexture);
			pickedID = Pixel;
			//std::cout << pickedID << std::endl;
			if(lastPickedObject != nullptr) //reset previously picked object color
			{
				lastPickedObject->materials[0]->color = Vector3F(0.f, 0.f, 0.f);

			}
			if(SceneGraph::Instance()->pickingList.find(pickedID) != SceneGraph::Instance()->pickingList.end())
			{
				lastPickedObject = SceneGraph::Instance()->pickingList[pickedID];
				lastPickedObject->materials[0]->color = Vector3F(0.5f, 0.25f, 0.f);
				Vector3F world_position;
				geometryBuffer->ReadPixelData((unsigned int)leftMouseX, this->windowHeight - (unsigned int)leftMouseY, 1, 1, GL_FLOAT, world_position.vect, worldPosTexture);
				Vector3 dWorldPos = Vector3(world_position.x, world_position.y, world_position.z);
				Vector3 impulse = (dWorldPos - currentCamera->GetPosition2()).vectNormalize();

				if (RigidBody* body = this->lastPickedObject->GetComponent<RigidBody>()) body->ApplyImpulse(impulse, 1.f, dWorldPos);
			}
        }
    }

    void
    PickingApp::InitGL()
    {

        // grey background
        glClearColor(0.f, 0.f, 0.f, 1.0f);

        // Enable depth test
        glEnable(GL_DEPTH_TEST);
        // Accept fragment if it closer to the camera than the former one
        glDepthFunc(GL_LESS);
        glEnable(GL_CULL_FACE);

        this->window->GetWindowSize(&this->windowWidth, &this->windowHeight);
		windowMidX = windowWidth / 2.0f;
		windowMidY = windowHeight / 2.0f;
    }

	void
	PickingApp::DrawPicking()
	{
		GLenum DrawBuffers[] = { GL_COLOR_ATTACHMENT0 };
		Render::Instance()->drawPicking(GraphicsStorage::shaderIDs["picking"], SceneGraph::Instance()->pickingList, pickingBuffer, DrawBuffers, 1);
	}

	void
	PickingApp::DrawDebug()
	{
		DebugDraw::Instance()->DrawBoundingBoxes();
	}

	void
	PickingApp::LoadScene1()
	{
		//A plank suspended on a static box.
		Clear();
		lightsPhysics = false;
		currentCamera->SetPosition(Vector3(0.f, 20.f, 60.f));
		DebugDraw::Instance()->Init(SceneGraph::Instance()->addChild());

		Object* sphere = SceneGraph::Instance()->addPhysicObject("sphere", Vector3(0.f, 3.f, 0.f));//automatically registered for collision detection and response
		RigidBody* body = sphere->GetComponent<RigidBody>();
		body->SetIsKinematic(true);
		sphere->materials[0]->shininess = 10.f;

		Object* directionalLight = SceneGraph::Instance()->addDirectionalLight();
		//directionalLight->mat->SetDiffuseIntensity(0.1f);
		directionalLightObject = directionalLight;

		Object* plane = SceneGraph::Instance()->addObject("cube", Vector3(0.f, -2.5f, 0.f));
		planeObject = plane;
		plane->materials[0]->SetShininess(12.f);
		//plane->mat->tileX = 2;
		//plane->mat->tileY = 2;
		body = new RigidBody();
		plane->AddComponent(body);
		plane->node->SetScale(Vector3(25.f, 2.f, 25.f));
		body->SetIsKinematic(true);
		PhysicsManager::Instance()->RegisterRigidBody(body); //manually registered after manually creating rigid body component and assembling the object
		SceneGraph::Instance()->SceneObject->node->SetMovable(true);
		SceneGraph::Instance()->InitializeSceneTree();

	}

	void PickingApp::LoadScene2()
	{
		Clear();
		lightsPhysics = false;
		currentCamera->SetPosition(Vector3(0.f, 10.f, 60.f));
		DebugDraw::Instance()->Init(SceneGraph::Instance()->addChild());

		Object* directionalLight = SceneGraph::Instance()->addDirectionalLight();

		for (int i = 0; i < 300; i++)
		{
			Object* pointLight = SceneGraph::Instance()->addPointLight(false, SceneGraph::Instance()->generateRandomIntervallVectorCubic(-20, 20));
			RigidBody* body = new RigidBody();
			pointLight->AddComponent(body, true);
		}

		for (int i = 0; i < 300; i++)
		{
			SceneGraph::Instance()->addObject("sphere", SceneGraph::Instance()->generateRandomIntervallVectorCubic(-20, 20));
		}

		Object* plane = SceneGraph::Instance()->addObject("cube");
		plane->node->SetScale(Vector3(25.f, 0.2f, 25.f));
		this->plane = plane;
		PhysicsManager::Instance()->gravity = Vector3();
		SceneGraph::Instance()->SceneObject->node->SetMovable(true);
		SceneGraph::Instance()->InitializeSceneTree();
	}

	void PickingApp::LoadScene3()
	{
		Clear();
		currentCamera->SetPosition(Vector3());
		DebugDraw::Instance()->Init(SceneGraph::Instance()->addChild());

		Object* directionalLight = SceneGraph::Instance()->addDirectionalLight();

		float rS = 1.f;
		for (int i = 0; i < 500; i++)
		{
			Object* object = SceneGraph::Instance()->addPhysicObject("icosphere", SceneGraph::Instance()->generateRandomIntervallVectorCubic(-80, 80));
			rS = (float)(rand() % 5) + 1.f;
			object->node->SetScale(Vector3(rS, rS, rS));
			RigidBody* body = object->GetComponent<RigidBody>();
			body->SetCanSleep(false);
		}

		PhysicsManager::Instance()->gravity = Vector3();
		SceneGraph::Instance()->SceneObject->node->SetMovable(true);
		SceneGraph::Instance()->InitializeSceneTree();
	}

	void
	PickingApp::Clear()
	{
		SceneGraph::Instance()->Clear();
		PhysicsManager::Instance()->Clear();
		GraphicsStorage::ClearMaterials();
		DebugDraw::Instance()->Clear();
		lastPickedObject = nullptr;
		directionalLightObject = nullptr;
		dirLightComp = nullptr;
		planeObject = nullptr;
	}

	void PickingApp::Vortex()
	{
		/*
		for (auto& obj : SceneGraph::Instance()->pickingList)
		{
			Vector3 dir = obj.second->GetPosition() - Vector3(0,-10,0);
			obj.second->ApplyImpulse(dir*-20.f, obj.second->GetPosition());
		}
		*/

		for (auto& obj : SceneGraph::Instance()->pointLights)
		{
			if (RigidBody* body = obj->GetComponent<RigidBody>())
			{
				Vector3 dir = obj->node->GetWorldPosition() - Vector3(0.f, -10.f, 0.f);
				body->ApplyImpulse(dir.vectNormalize()*-200.f, obj->node->GetWorldPosition());
			}
		}
	}

	void PickingApp::DrawGeometryPass()
	{
		GLenum DrawBuffers[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3 };
		objectsRendered = Render::Instance()->drawGeometry(GraphicsStorage::shaderIDs["geometry"], SceneGraph::Instance()->renderList, geometryBuffer, DrawBuffers, 4);
	}

	void PickingApp::DrawLightPass()
	{
		GLuint pointLightShader = GraphicsStorage::shaderIDs["pointLight"];
		GLuint pointLightShadowShader = GraphicsStorage::shaderIDs["pointLightShadow"];
		GLuint spotLightShader = GraphicsStorage::shaderIDs["spotLight"];
		GLuint spotLightShadowShader = GraphicsStorage::shaderIDs["spotLightShadow"];
		GLuint directionalLightShader = GraphicsStorage::shaderIDs["directionalLight"];
		GLuint directionalLightShadowShader = GraphicsStorage::shaderIDs["directionalLightShadow"];

		GLenum drawLightAttachments[] = { GL_COLOR_ATTACHMENT4 };
		lightsRendered = Render::Instance()->drawLight(pointLightShader, pointLightShadowShader, spotLightShader, spotLightShadowShader, directionalLightShader, directionalLightShadowShader, geometryBuffer, geometryBuffer, drawLightAttachments, 1);
	}

	void PickingApp::BlitToScreenPass()
	{
		//bind geometry buffer for final pass
		FBOManager::Instance()->BindFrameBuffer(GL_DRAW_FRAMEBUFFER, 0); //for drawing we are unbinding to the screen buffer
		FBOManager::Instance()->BindFrameBuffer(GL_READ_FRAMEBUFFER, geometryBuffer->handle); //and we read from the geometry buffer
		glReadBuffer(GL_COLOR_ATTACHMENT4); //enable the final color texture buffer for reading, we tell that we want only to read the attachment 4
		glBlitFramebuffer(0, 0, windowWidth, windowHeight, 0, 0, windowWidth, windowHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
		glBlitFramebuffer(0, 0, windowWidth, windowHeight, 0, 0, windowWidth, windowHeight, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
	}

	void PickingApp::MovePlaneUpNDown()
	{
		if (plane != nullptr)
		{
			if (plane->node->GetWorldPosition().y < -17) planeDir = 1;
			else if (plane->node->GetWorldPosition().y > 10) planeDir = -1;

			plane->node->Translate(Vector3(0.f, 0.1f*planeDir, 0.f));
		}
	}

	void PickingApp::DrawGeometryMaps(int width, int height)
	{
		GLuint depthPanelShader = GraphicsStorage::shaderIDs["depthPanel"];

		float fHeight = (float)height;
		float fWidth = (float)width;
		int y = (int)(fHeight*0.1f);
		int glWidth = (int)(fWidth *0.1f);
		int glHeight = (int)(fHeight*0.1f);

		Render::Instance()->drawRegion(depthPanelShader, 0, y, glWidth, glHeight, worldPosTexture);
		Render::Instance()->drawRegion(depthPanelShader, 0, 0, glWidth, glHeight, diffuseTexture);
		Render::Instance()->drawRegion(depthPanelShader, glWidth, 0, glWidth, glHeight, normalTexture);
		Render::Instance()->drawRegion(depthPanelShader, glWidth, y, glWidth, glHeight, finalColorTexture);
	}

	void PickingApp::SpawnSomeLights()
	{
		if (SceneGraph::Instance()->pointLights.size() < 500)
		{
			Object* pointLight = SceneGraph::Instance()->addPointLight(false, SceneGraph::Instance()->generateRandomIntervallVectorFlat(-20, 20, SceneGraph::y), SceneGraph::Instance()->generateRandomIntervallVectorCubic(0, 6000).toFloat() / 6000.f);
			Object* sphere = SceneGraph::Instance()->addObject("sphere", pointLight->node->GetLocalPosition());
			sphere->node->SetScale(Vector3(0.1f, 0.1f, 0.1f));
			sphere->materials[0]->shininess = 10.f;
		}
	}

	void PickingApp::MouseCallback(double mouseX, double mouseY)
	{
		if (altButtonToggle)
		{
			currentCamera->UpdateOrientation(mouseX, mouseY);
			window->SetCursorPos(windowMidX, windowMidY);
		}
	}

	void PickingApp::SetUpCamera()
	{
		currentCamera = new Camera(Vector3(0.f, 10.f, 60.f), windowWidth, windowHeight);
		currentCamera->Update(Times::Instance()->timeStep);
		window->SetCursorPos(windowMidX, windowMidY);
		CameraManager::Instance()->AddCamera("default", currentCamera);
		CameraManager::Instance()->SetCurrentCamera("default");
		DebugDraw::Instance()->Projection = &currentCamera->ProjectionMatrix;
		DebugDraw::Instance()->View = &currentCamera->ViewMatrix;
	}

	void PickingApp::SetUpBuffers(int windowWidthIn, int windowHeightIn)
	{
		geometryBuffer = FBOManager::Instance()->GenerateFBO();
		worldPosTexture = new Texture(GL_TEXTURE_2D, 0, GL_RGB32F, windowWidthIn, windowHeightIn, GL_RGB, GL_FLOAT, NULL, GL_COLOR_ATTACHMENT0);
		worldPosTexture->GenerateBindSpecify();
		worldPosTexture->SetClampingToEdge();
		worldPosTexture->SetLinear();
		diffuseTexture = new Texture(GL_TEXTURE_2D, 0, GL_RGB, windowWidthIn, windowHeightIn, GL_RGB, GL_FLOAT, NULL, GL_COLOR_ATTACHMENT1);
		diffuseTexture->GenerateBindSpecify();
		diffuseTexture->SetClampingToEdge();
		diffuseTexture->SetLinear();
		normalTexture = new Texture(GL_TEXTURE_2D, 0, GL_RGB32F, windowWidthIn, windowHeightIn, GL_RGB, GL_FLOAT, NULL, GL_COLOR_ATTACHMENT2);
		normalTexture->GenerateBindSpecify();
		normalTexture->SetClampingToEdge();
		normalTexture->SetLinear();
		Texture* materialPropertiesTexture = new Texture(GL_TEXTURE_2D, 0, GL_RGBA32F, windowWidthIn, windowHeightIn, GL_RGBA, GL_FLOAT, NULL, GL_COLOR_ATTACHMENT3);
		materialPropertiesTexture->GenerateBindSpecify();
		materialPropertiesTexture->SetClampingToEdge();
		materialPropertiesTexture->SetLinear();
		finalColorTexture = new Texture(GL_TEXTURE_2D, 0, GL_RGB32F, windowWidthIn, windowHeightIn, GL_RGB, GL_FLOAT, NULL, GL_COLOR_ATTACHMENT4);
		finalColorTexture->GenerateBindSpecify();
		finalColorTexture->SetClampingToEdge();
		finalColorTexture->SetLinear();
		Texture* depthTexture = new Texture(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, windowWidthIn, windowHeightIn, GL_DEPTH_COMPONENT, GL_FLOAT, NULL, GL_DEPTH_STENCIL_ATTACHMENT);
		depthTexture->GenerateBindSpecify();
		depthTexture->SetClampingToEdge();
		depthTexture->SetLinear();

		geometryBuffer->RegisterTexture(worldPosTexture);
		geometryBuffer->RegisterTexture(diffuseTexture);
		geometryBuffer->RegisterTexture(normalTexture);
		geometryBuffer->RegisterTexture(materialPropertiesTexture);
		geometryBuffer->RegisterTexture(finalColorTexture);
		geometryBuffer->RegisterTexture(depthTexture);
		geometryBuffer->SpecifyTextures();
		geometryBuffer->CheckAndCleanup();

		diffuseTexture = diffuseTexture;
		normalTexture = normalTexture;
		ORMSTexture = materialPropertiesTexture;

		pickingBuffer = FBOManager::Instance()->GenerateFBO();
		pickingTexture = new Texture(GL_TEXTURE_2D, 0, GL_R32UI, windowWidthIn, windowHeightIn, GL_RED_INTEGER, GL_UNSIGNED_INT, NULL, GL_COLOR_ATTACHMENT0);
		pickingTexture->GenerateBindSpecify();
		pickingTexture->SetClampingToEdge();
		pickingTexture->SetLinear();
		Texture* pickingDepth = new Texture(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, windowWidthIn, windowHeightIn, GL_DEPTH_COMPONENT, GL_FLOAT, NULL, GL_DEPTH_ATTACHMENT);
		pickingDepth->GenerateBindSpecify();
		pickingDepth->SetClampingToEdge();
		pickingDepth->SetLinear();
		pickingBuffer->RegisterTexture(pickingTexture);
		pickingBuffer->RegisterTexture(pickingDepth);
		pickingBuffer->SpecifyTextures();
		pickingBuffer->CheckAndCleanup();
	}

} // namespace Example


text:
import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js';

import {ModuleMetricsProxy} from 'chrome://welcome/shared/module_metrics_proxy.js';

export class TestMetricsProxy extends TestBrowserProxy implements
    ModuleMetricsProxy {
  constructor() {
    super([
      'recordChoseAnOptionAndChoseNext',
      'recordChoseAnOptionAndChoseSkip',
      'recordChoseAnOptionAndNavigatedAway',
      'recordClickedDisabledNextButtonAndChoseNext',
      'recordClickedDisabledNextButtonAndChoseSkip',
      'recordClickedDisabledNextButtonAndNavigatedAway',
      'recordDidNothingAndChoseNext',
      'recordDidNothingAndChoseSkip',
      'recordDidNothingAndNavigatedAway',
      'recordNavigatedAwayThroughBrowserHistory',
      'recordPageShown',
    ]);
  }

  recordChoseAnOptionAndChoseNext() {
    this.methodCalled('recordChoseAnOptionAndChoseNext');
  }

  recordChoseAnOptionAndChoseSkip() {
    this.methodCalled('recordChoseAnOptionAndChoseSkip');
  }

  recordChoseAnOptionAndNavigatedAway() {
    this.methodCalled('recordChoseAnOptionAndNavigatedAway');
  }

  recordClickedDisabledNextButtonAndChoseNext() {
    this.methodCalled('recordClickedDisabledNextButtonAndChoseNext');
  }

  recordClickedDisabledNextButtonAndChoseSkip() {
    this.methodCalled('recordClickedDisabledNextButtonAndChoseSkip');
  }

  recordClickedDisabledNextButtonAndNavigatedAway() {
    this.methodCalled('recordClickedDisabledNextButtonAndNavigatedAway');
  }

  recordDidNothingAndChoseNext() {
    this.methodCalled('recordDidNothingAndChoseNext');
  }

  recordDidNothingAndChoseSkip() {
    this.methodCalled('recordDidNothingAndChoseSkip');
  }

  recordDidNothingAndNavigatedAway() {
    this.methodCalled('recordDidNothingAndNavigatedAway');
  }

  recordNavigatedAwayThroughBrowserHistory() {
    this.methodCalled('recordNavigatedAwayThroughBrowserHistory');
  }

  recordPageShown() {
    this.methodCalled('recordPageShown');
  }
}

redpajama_set_name: RedPajamaGithub


text:
package com.elminster.retrieve.data;

public interface ITVShow extends IMovie {

  int getSessionsCount();

  int getCurrentSeason();

  int getEpisodesCount();
}


text:
var request = require('request').defaults({ jar: true }); //need cookies enabled since this is cookie session

var assert = require('assert'),
    util = require('./launchUtil');

describe('SERVER3 - test session support', function () {
    this.timeout(5000);
    before(function (done) {
        util.launch('server3', done);
    });

    after(function (done) {
        util.finish(done);
    });

    it('Should let me put and retrieve data from the session', function (done) {
        //the post sets session data
        request.post({
            url: 'http://localhost:' + (process.env.PORT || 5000) + '/session',
            json: {
                foo: 'bar'
            }
        }, function (err, resp, body) {
            assert.equal(null, err);

            //get retrieves session data
            request.get('http://localhost:' + (process.env.PORT || 5000) + '/session',
                function (err, resp, body) {
                    assert.equal(null, err);
                    var data = JSON.parse(body);
                    assert.equal('bar', data.foo);
                    done();
                }
            );
        });
    });

});


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="jirafe.analytics_tracker.class">Jirafe\Bundle\AnalyticsTrackerBundle\Listener\AnalyticsTrackerListener</parameter>
        <parameter key="jirafe.analytics_tracker.jirafe.template">JirafeAnalyticsTrackerBundle:Tracker:jirafe.html.twig</parameter>
        <parameter key="jirafe.analytics_tracker.piwik.template">JirafeAnalyticsTrackerBundle:Tracker:piwik.html.twig</parameter>
        <parameter key="jirafe.analytics_tracker.google_analytics.template">JirafeAnalyticsTrackerBundle:Tracker:google_analytics.html.twig</parameter>
        <parameter key="jirafe.analytics_tracker.clicky.template">JirafeAnalyticsTrackerBundle:Tracker:clicky.html.twig</parameter>
        <parameter key="jirafe.analytics_tracker.jirafe.url">https://data.jirafe.com/</parameter>
    </parameters>

</container>


text:
/* ###
 * IP: GHIDRA
 *
 * 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 ghidra.app.plugin.core.graph;

import java.util.*;

import docking.ActionContext;
import docking.action.MenuData;
import docking.action.ToggleDockingAction;
import docking.tool.ToolConstants;
import ghidra.app.CorePluginPackage;
import ghidra.app.plugin.PluginCategoryNames;
import ghidra.app.services.GraphDisplayBroker;
import ghidra.framework.options.*;
import ghidra.framework.plugintool.*;
import ghidra.framework.plugintool.util.PluginStatus;
import ghidra.service.graph.*;
import ghidra.util.classfinder.ClassSearcher;
import ghidra.util.exception.GraphException;
import ghidra.util.task.TaskMonitor;

//@formatter:off
@PluginInfo(
	status = PluginStatus.RELEASED,
	packageName = CorePluginPackage.NAME,
	category = PluginCategoryNames.GRAPH,
	shortDescription = "Manages the active Graph Display Service",
	description = "This plugin searches for available graph display providers and if it finds more" +
		"than one, it provides menu options for the user to choose the active provider.",
	servicesProvided = { GraphDisplayBroker.class }
)
//@formatter:on
public class GraphDisplayBrokerPlugin extends Plugin
		implements GraphDisplayBroker, OptionsChangeListener {
	private static final String ACTIVE_GRAPH_PROVIDER = "ACTIVE_GRAPH_PROVIDER";
	private List<GraphDisplayProvider> graphDisplayProviders = new ArrayList<>();
	private GraphDisplayProvider defaultGraphDisplayProvider;
	private List<GraphDisplayBrokerListener> listeners = new ArrayList<>();
	private List<GraphSelectionAction> actions = new ArrayList<>();
	private List<AttributedGraphExporter> exporters;

	public GraphDisplayBrokerPlugin(PluginTool tool) {
		super(tool);
		loadServices();
		buildActions();
	}

	@Override
	public void writeConfigState(SaveState saveState) {
		if (defaultGraphDisplayProvider != null) {
			saveState.putString(ACTIVE_GRAPH_PROVIDER, defaultGraphDisplayProvider.getName());
		}
	}

	@Override
	public void readConfigState(SaveState saveState) {
		String active = saveState.getString(ACTIVE_GRAPH_PROVIDER, null);
		if (active != null) {
			for (GraphDisplayProvider provider : graphDisplayProviders) {
				if (provider.getName().equals(active)) {
					setDefaultGraphDisplayProvider(provider);
					return;
				}
			}
		}
	}

	private void loadServices() {
		Set<GraphDisplayProvider> instances =
			new HashSet<>(ClassSearcher.getInstances(GraphDisplayProvider.class));
		graphDisplayProviders = new ArrayList<>(instances);
		Collections.sort(graphDisplayProviders, (s1, s2) -> s1.getName().compareTo(s2.getName()));
		initializeServices();
		if (!graphDisplayProviders.isEmpty()) {
			defaultGraphDisplayProvider = graphDisplayProviders.get(0);
		}
	}

	private void initializeServices() {
		for (GraphDisplayProvider service : graphDisplayProviders) {
			ToolOptions options = tool.getOptions(ToolConstants.GRAPH_OPTIONS);
			options.addOptionsChangeListener(this);
			service.initialize(tool, options);
		}
	}

	private void buildActions() {
		if (graphDisplayProviders.size() <= 1) {
			return;
		}
		for (GraphDisplayProvider graphDisplayProvider : graphDisplayProviders) {
			createAction(graphDisplayProvider);
		}
		updateActions();
	}

	private void createAction(GraphDisplayProvider provider) {
		GraphSelectionAction action = new GraphSelectionAction(getName(), provider);
		actions.add(action);
		tool.addAction(action);
	}

	private void updateActions() {
		for (GraphSelectionAction action : actions) {
			action.setSelected(defaultGraphDisplayProvider == action.provider);
		}
	}

	protected void notifyListeners() {
		for (GraphDisplayBrokerListener listener : listeners) {
			listener.providersChanged();
		}
	}

	@Override
	public GraphDisplayProvider getDefaultGraphDisplayProvider() {
		return defaultGraphDisplayProvider;
	}

	@Override
	public void addGraphDisplayBrokerListener(GraphDisplayBrokerListener listener) {
		listeners.add(listener);
	}

	@Override
	public void removeGraphDisplayBrokerLisetener(GraphDisplayBrokerListener listener) {
		listeners.remove(listener);
	}

	@Override
	public void dispose() {
		for (GraphDisplayProvider graphService : graphDisplayProviders) {
			graphService.dispose();
		}
	}

	@Override
	public GraphDisplay getDefaultGraphDisplay(boolean reuseGraph, TaskMonitor monitor)
			throws GraphException {
		if (defaultGraphDisplayProvider != null) {
			return defaultGraphDisplayProvider.getGraphDisplay(reuseGraph, monitor);
		}
		return null;
	}

	public void setDefaultGraphDisplayProvider(GraphDisplayProvider provider) {
		defaultGraphDisplayProvider = provider;
		notifyListeners();
		updateActions();
	}

	@Override
	public boolean hasDefaultGraphDisplayProvider() {
		return !graphDisplayProviders.isEmpty();
	}

	/**
	 * Action for selecting a {@link GraphDisplayProvider} to be the currently active provider
	 */
	private class GraphSelectionAction extends ToggleDockingAction {

		private GraphDisplayProvider provider;

		public GraphSelectionAction(String owner, GraphDisplayProvider provider) {
			super(provider.getName(), owner);
			this.provider = provider;
			setMenuBarData(
				new MenuData(
					new String[] { ToolConstants.MENU_GRAPH, "Graph Output", provider.getName() },
					"z"));
			setHelpLocation(provider.getHelpLocation());
		}

		@Override
		public void actionPerformed(ActionContext context) {
			setDefaultGraphDisplayProvider(provider);
		}
	}

	@Override
	public void optionsChanged(ToolOptions options, String optionName, Object oldValue,
			Object newValue) {

		for (GraphDisplayProvider graphService : graphDisplayProviders) {
			graphService.optionsChanged(options);
		}
	}

	@Override
	public GraphDisplayProvider getGraphDisplayProvider(String providerName) {
		for (GraphDisplayProvider provider : graphDisplayProviders) {
			if (provider.getName().equals(providerName)) {
				return provider;
			}
		}
		return null;
	}

	@Override
	public List<AttributedGraphExporter> getGraphExporters() {
		if (exporters == null) {
			exporters = ClassSearcher.getInstances(AttributedGraphExporter.class);
		}
		return Collections.unmodifiableList(exporters);
	}

	@Override
	public AttributedGraphExporter getGraphExporters(String exporterName) {
		List<AttributedGraphExporter> graphExporters = getGraphExporters();
		for (AttributedGraphExporter exporter : graphExporters) {
			if (exporter.getName().equals(exporterName)) {
				return exporter;
			}
		}
		return null;
	}

}


text:
package practice;

import java.util.Arrays;

/**
 *

 * Given an array, return the indexes of the minimum unsorted subarray, without modifying the array.

 *
 * A minimum unsorted subarray is defined as the subarray of min length that, when sorted,

 * would make the entire array sorted.

 *
 * When the array is already sorted, there is no unsorted subarray, in which case, return an array [-1, -1]
 *

 * Created by kedar on 2/13/17.
 */
public class MinUnsortedSubarray {

    private static final int[] NO_SUCH = new int[] {-1, -1};

    /**
     * Returns the minimum unsorted subarray. See {@link MinUnsortedSubarray} for the definition.
     * @param a the array
     * @return the indexes of the min unsorted subarray as a 2-element array, [-1, -1] if the array is already sorted
     */
    public static int[] get(int[] a) {
        int max = a[0], // max element so far
            minu = Integer.MAX_VALUE,  // min element in the unsorted array
            len = a.length;
        int si = -1, // index of the element where the min unsorted array starts
            ei = -1, // index of the element where the min unsorted array ends
            lasti = 0, // index of the last element in sorted order
            i = 1;  // index of current element (under consideration)

        // note: a[0..0] is always sorted
        while (i < len) {
            int c = a[i];
            if (c > max) {
                max = c;
                if (si == ei) { // the order has not been destroyed yet
                    si = ei = lasti = i;
                }
            } else { // we found the first element that is "out of order"
                ei = i;
                minu = Math.min(minu, c);
            }
            i += 1;
        }
        if (si == ei) { // no element was out of order
            return NO_SUCH;
        }
        si = ((si = Arrays.binarySearch(a, 0, lasti + 1, minu)) < 0) ? -(si + 1) : si;
        // is linear search better?
        return new int[] {si, ei};
    }

}
/*
  The loop that does not work:
          while (i < len) {
            int c = a[i];
            if (c > max) {
                max = c;
                if (si == ei) {
                    si = ei = i;
                }
            } else if (c < min) {
                min = c;
                si = 0; // this minimum element has got to go to 0th index
                ei = i;
            } else { // c is between min and max
                ei = i;
            }
            i += 1;
        }
 */


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>siddhi</artifactId>
        <groupId>org.wso2.siddhi</groupId>
        <version>3.0.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>

    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>siddhi-core</artifactId>
    <name>Siddhi Core</name>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.172</version>
        </dependency>

        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.3</version>
        </dependency>

        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.5.6</version>
        </dependency>

        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-query</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>15.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.13</version>
                <configuration>
                    <includes>
                        <include>**/standard/**/*TestCase.java</include>
                        <include>**/management/**/*TestCase.java</include>
                        <!--<include>**/distributed/**/*TestCase.java</include>-->
                        <!--<include>**/clustered/**/*TestCase.java</include>-->
                    </includes>
                    <excludes>
                        <exclude>**/standard/table/rdbms/*TestCase.java</exclude>
                        <exclude>**/standard/table/cassandra/*TestCase.java</exclude>
                        <!--<exclude>**/PatternClusteredTestCase.java</exclude>-->
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.7</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Export-Package>
                            org.wso2.siddhi.core*
                        </Export-Package>
                        <Import-Package>
                            *;resolution:=optional
                        </Import-Package>
                        <Embed-Transitive>true</Embed-Transitive>
                        <Embed-Dependency>scope=runtime;inline=true</Embed-Dependency>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <!--<SPI-Consumer>*</SPI-Consumer>-->
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
package org.apache.olingo.odata2.core.batch;

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

import org.apache.olingo.odata2.api.client.batch.BatchChangeSet;
import org.apache.olingo.odata2.api.client.batch.BatchChangeSetPart;

public class BatchChangeSetImpl extends BatchChangeSet {
  private List<BatchChangeSetPart> requests = new ArrayList<BatchChangeSetPart>();

  @Override
  public void add(final BatchChangeSetPart request) {
    requests.add(request);
  }

  @Override
  public List<BatchChangeSetPart> getChangeSetParts() {
    return Collections.unmodifiableList(requests);
  }

  public class BatchChangeSetBuilderImpl extends BatchChangeSetBuilder {

    @Override
    public BatchChangeSet build() {
      return BatchChangeSetImpl.this;
    }

  }
}


text:
package com.xiaofeng.utils.designpatterns.command;

import com.xiaofeng.utils.common.FileUtil;

import java.util.ArrayList;

/**
 * @author Chen Xiaofeng
 * @version 1.0.0
 * @date 2017/07/25
 * @email chenxf84@gmail.com
 */

public class ConfigSettingWindow {
    //定义一个集合来存储每一次操作时的命令对象
    private ArrayList<Commander> commands = new ArrayList<>();
    private Commander command;

    //注入具体命令对象
    public void setCommand(Commander command) {
        this.command = command;
    }

    //执行配置文件修改命令,同时将命令对象添加到命令集合中
    public void call(String args) {
        command.execute(args);
        commands.add(command);
    }

    //记录请求日志,生成日志文件,将命令集合写入日志文件
    public void save() {
        FileUtil.writeCommands(commands);
    }

    //从日志文件中提取命令集合,并循环调用每一个命令对象的execute()方法来实现配置文件的重新设置
    public void recover() {
        ArrayList list;
        list = FileUtil.readCommands();

        for (Object obj : list) {
            ((Commander) obj).execute();
        }
    }
}


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

<TITLE>
JavaGeneratorFactory (Axis API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.axis.wsdl.toJava.JavaGeneratorFactory class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.axis.wsdl.toJava

Class JavaGeneratorFactory

java.lang.Object
  org.apache.axis.wsdl.toJava.JavaGeneratorFactory

All Implemented Interfaces:
GeneratorFactory

public class JavaGeneratorFactory
extends java.lang.Object
implements GeneratorFactory

This is Wsdl2java's implementation of the GeneratorFactory

Nested Class Summary

protected  class
JavaGeneratorFactory.Writers

          Class Writers

Field Summary

protected  JavaGeneratorFactory.Writers
bindingWriters

          Return Wsdl2java's JavaBindingWriter object.

static java.lang.String
COMPLEX_TYPE_FAULT

          Field COMPLEX_TYPE_FAULT

protected  Emitter
emitter

          Field emitter

static java.lang.String
EXCEPTION_CLASS_NAME

          Field EXCEPTION_CLASS_NAME

static java.lang.String
EXCEPTION_DATA_TYPE

          Field EXCEPTION_DATA_TYPE

protected  JavaGeneratorFactory.Writers
serviceWriters

          Return Wsdl2java's JavaServiceWriter object.

protected  SymbolTable
symbolTable

          Field symbolTable

Constructor Summary

JavaGeneratorFactory()

          Default constructor.

JavaGeneratorFactory(Emitter emitter)

          Constructor JavaGeneratorFactory

Method Summary

protected  void
addBindingGenerators()

          Method addBindingGenerators

protected  void
addDefinitionGenerators()

          Method addDefinitionGenerators

 void
addGenerator(java.lang.Class wsdlClass,
             java.lang.Class generator)

          Method addGenerator

protected  void
addMessageGenerators()

          These addXXXGenerators are called by the constructor.

protected  void
addPortTypeGenerators()

          Method addPortTypeGenerators

protected  void
addServiceGenerators()

          Method addServiceGenerators

protected  void
addTypeGenerators()

          Method addTypeGenerators

protected  void
constructSignatures(SymbolTable symbolTable)

          Method constructSignatures

protected  void
determineIfHoldersNeeded(SymbolTable symbolTable)

          Find all inout/out parameters and add a flag to the Type of that parameter saying a holder
 is needed.

protected  void
determineInterfaceNames(SymbolTable symbolTable)

          Method determineInterfaceNames

 void
generatorPass(javax.wsdl.Definition def,
              SymbolTable symbolTable)

          Do the Wsdl2java generator pass:
 - resolve name clashes
 - construct signatures

 BaseTypeMapping
getBaseTypeMapping()

          Method getBaseTypeMapping

protected  java.lang.String
getExceptionJavaNameHook(QName qname)

 Generator
getGenerator(javax.wsdl.Binding binding,
             SymbolTable symbolTable)

          Method getGenerator

 Generator
getGenerator(javax.wsdl.Definition definition,
             SymbolTable symbolTable)

          Method getGenerator

 Generator
getGenerator(javax.wsdl.Message message,
             SymbolTable symbolTable)

          Method getGenerator

 Generator
getGenerator(javax.wsdl.PortType portType,
             SymbolTable symbolTable)

          Method getGenerator

 Generator
getGenerator(javax.wsdl.Service service,
             SymbolTable symbolTable)

          Method getGenerator

 Generator
getGenerator(TypeEntry type,
             SymbolTable symbolTable)

          Method getGenerator

protected  java.lang.String
getOperationJavaNameHook(BindingEntry bEntry,
                         java.lang.String wsdlOpName)

protected  java.lang.String
getParameterTypeJavaNameHook(BindingEntry bEntry,
                             java.lang.String wsdlOpName,
                             int pos)

protected  java.lang.String
getPortJavaNameHook(java.lang.String portName)

protected  java.lang.String
getReturnTypeJavaNameHook(BindingEntry bEntry,
                          java.lang.String wsdlOpName)

protected  java.lang.String
getServiceEndpointInterfaceJavaNameHook(PortTypeEntry ptEntry,
                                        BindingEntry bEntry)

protected  java.lang.String
getServiceInterfaceJavaNameHook(ServiceEntry sEntry)

protected  void
ignoreNonSOAPBindings(SymbolTable symbolTable)

          If a binding's type is not TYPE_SOAP, then we don't use that binding
 or that binding's portType.

protected  boolean
include(QName qName)

          Determines whether the QName supplied should be generated by comparing
 the namespace for the QName against the included and excluded names.

protected  void
javifyNames(SymbolTable symbolTable)

          Fill in the names of each SymTabEntry with the javaified name.

protected  int
javifyTypeEntryName(SymbolTable symbolTable,
                    TypeEntry entry,
                    java.util.HashMap anonQNames,
                    int uniqueNum)

          Refactored to call recursively for JAX-RPC 1.1 spec 4.2.5.

protected  void
resolveNameClashes(SymbolTable symbolTable)

          Messages, PortTypes, Bindings, and Services can share the same name.

protected  void
setAllReferencesToTrue()

          The --all flag is set on the command line (or generateAll(true) is called
 on WSDL2Java).

 void
setBaseTypeMapping(BaseTypeMapping btm)

          Method setBaseTypeMapping

 void
setEmitter(Emitter emitter)

          Method setEmitter

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

emitter

protected Emitter emitter

Field emitter

symbolTable

protected SymbolTable symbolTable

Field symbolTable

COMPLEX_TYPE_FAULT

public static java.lang.String COMPLEX_TYPE_FAULT

Field COMPLEX_TYPE_FAULT

EXCEPTION_CLASS_NAME

public static java.lang.String EXCEPTION_CLASS_NAME

Field EXCEPTION_CLASS_NAME

EXCEPTION_DATA_TYPE

public static java.lang.String EXCEPTION_DATA_TYPE

Field EXCEPTION_DATA_TYPE

bindingWriters

protected JavaGeneratorFactory.Writers bindingWriters

Return Wsdl2java's JavaBindingWriter object.

serviceWriters

protected JavaGeneratorFactory.Writers serviceWriters

Return Wsdl2java's JavaServiceWriter object.

Constructor Detail

JavaGeneratorFactory

public JavaGeneratorFactory()

Default constructor.  Note that this class is unusable until setEmitter
 is called.

JavaGeneratorFactory

public JavaGeneratorFactory(Emitter emitter)

Constructor JavaGeneratorFactory

Parameters:
emitter -

Method Detail

setEmitter

public void setEmitter(Emitter emitter)

Method setEmitter

Parameters:
emitter -

addMessageGenerators

protected void addMessageGenerators()

These addXXXGenerators are called by the constructor.
 If an extender of this factory wants to CHANGE the set
 of generators that are called per WSDL construct, they
 should override these addXXXGenerators methods.  If all
 an extender wants to do is ADD a generator, then the
 extension should simply call addGenerator.
 (NOTE:  It doesn't quite work this way, yet.  Only the
 Definition generators fit this model at this point in
 time.)

addPortTypeGenerators

protected void addPortTypeGenerators()

Method addPortTypeGenerators

addBindingGenerators

protected void addBindingGenerators()

Method addBindingGenerators

addServiceGenerators

protected void addServiceGenerators()

Method addServiceGenerators

addTypeGenerators

protected void addTypeGenerators()

Method addTypeGenerators

addDefinitionGenerators

protected void addDefinitionGenerators()

Method addDefinitionGenerators

generatorPass

public void generatorPass(javax.wsdl.Definition def,
                          SymbolTable symbolTable)

Do the Wsdl2java generator pass:
 - resolve name clashes
 - construct signatures

Specified by:
generatorPass in interface GeneratorFactory

Parameters:
def -
symbolTable -

getGenerator

public Generator getGenerator(javax.wsdl.Message message,
                              SymbolTable symbolTable)

Method getGenerator

Specified by:
getGenerator in interface GeneratorFactory

Parameters:
message -
symbolTable -

Returns:

getGenerator

public Generator getGenerator(javax.wsdl.PortType portType,
                              SymbolTable symbolTable)

Method getGenerator

Specified by:
getGenerator in interface GeneratorFactory

Parameters:
portType -
symbolTable -

Returns:

getGenerator

public Generator getGenerator(javax.wsdl.Binding binding,
                              SymbolTable symbolTable)

Method getGenerator

Specified by:
getGenerator in interface GeneratorFactory

Parameters:
binding -
symbolTable -

Returns:

getGenerator

public Generator getGenerator(javax.wsdl.Service service,
                              SymbolTable symbolTable)

Method getGenerator

Specified by:
getGenerator in interface GeneratorFactory

Parameters:
service -
symbolTable -

Returns:

getGenerator

public Generator getGenerator(TypeEntry type,
                              SymbolTable symbolTable)

Method getGenerator

Specified by:
getGenerator in interface GeneratorFactory

Parameters:
type -
symbolTable -

Returns:

getGenerator

public Generator getGenerator(javax.wsdl.Definition definition,
                              SymbolTable symbolTable)

Method getGenerator

Specified by:
getGenerator in interface GeneratorFactory

Parameters:
definition -
symbolTable -

Returns:

addGenerator

public void addGenerator(java.lang.Class wsdlClass,
                         java.lang.Class generator)

Method addGenerator

Parameters:
wsdlClass -
generator -

javifyNames

protected void javifyNames(SymbolTable symbolTable)

Fill in the names of each SymTabEntry with the javaified name.
 Note: This method also ensures that anonymous types are
 given unique java type names.

Parameters:
symbolTable -

javifyTypeEntryName

protected int javifyTypeEntryName(SymbolTable symbolTable,
                                  TypeEntry entry,
                                  java.util.HashMap anonQNames,
                                  int uniqueNum)

Refactored to call recursively for JAX-RPC 1.1 spec 4.2.5.

getExceptionJavaNameHook

protected java.lang.String getExceptionJavaNameHook(QName qname)

determineInterfaceNames

protected void determineInterfaceNames(SymbolTable symbolTable)

Method determineInterfaceNames

Parameters:
symbolTable -

getServiceEndpointInterfaceJavaNameHook

protected java.lang.String getServiceEndpointInterfaceJavaNameHook(PortTypeEntry ptEntry,
                                                                   BindingEntry bEntry)

getServiceInterfaceJavaNameHook

protected java.lang.String getServiceInterfaceJavaNameHook(ServiceEntry sEntry)

getPortJavaNameHook

protected java.lang.String getPortJavaNameHook(java.lang.String portName)

resolveNameClashes

protected void resolveNameClashes(SymbolTable symbolTable)

Messages, PortTypes, Bindings, and Services can share the same name.  If they do in this
 Definition, force their names to be suffixed with _PortType and _Service, respectively.

Parameters:
symbolTable -

setAllReferencesToTrue

protected void setAllReferencesToTrue()

The --all flag is set on the command line (or generateAll(true) is called
 on WSDL2Java). Set all symbols as referenced (except nonSOAP bindings
 which we don't know how to deal with).

ignoreNonSOAPBindings

protected void ignoreNonSOAPBindings(SymbolTable symbolTable)

If a binding's type is not TYPE_SOAP, then we don't use that binding
 or that binding's portType.

Parameters:
symbolTable -

constructSignatures

protected void constructSignatures(SymbolTable symbolTable)

Method constructSignatures

Parameters:
symbolTable -

getOperationJavaNameHook

protected java.lang.String getOperationJavaNameHook(BindingEntry bEntry,
                                                    java.lang.String wsdlOpName)

getReturnTypeJavaNameHook

protected java.lang.String getReturnTypeJavaNameHook(BindingEntry bEntry,
                                                     java.lang.String wsdlOpName)

getParameterTypeJavaNameHook

protected java.lang.String getParameterTypeJavaNameHook(BindingEntry bEntry,
                                                        java.lang.String wsdlOpName,
                                                        int pos)

determineIfHoldersNeeded

protected void determineIfHoldersNeeded(SymbolTable symbolTable)

Find all inout/out parameters and add a flag to the Type of that parameter saying a holder
 is needed.

Parameters:
symbolTable -

setBaseTypeMapping

public void setBaseTypeMapping(BaseTypeMapping btm)

Method setBaseTypeMapping

Specified by:
setBaseTypeMapping in interface GeneratorFactory

Parameters:
btm -

getBaseTypeMapping

public BaseTypeMapping getBaseTypeMapping()

Method getBaseTypeMapping

Specified by:
getBaseTypeMapping in interface GeneratorFactory

Returns:

include

protected boolean include(QName qName)

Determines whether the QName supplied should be generated by comparing
 the namespace for the QName against the included and excluded names.

if both the includes and excludes are both empty,
             the element is generated

if the namespace is in the includes,
             the element is generated

if the namespace is not in the excludes and the includes are empty,
             the element will be generated.

if the namespace is only in the excludes,
             the element is not generated

if the namespace is not in the includes and the includes are not
             empty, the element is not generated

Parameters:
qName -

Returns:

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Apache Web Services Project. All Rights Reserved.


text:
* Use UTF-8 encoding by default
* Allow indentation level to be specified when outputting XML

### 1.0.1
* Fix nested DSLs not being able to access methods defined outside of their scope
    * ie. Rails url helpers from within a nested tag

### 1.0.0 [yanked]
* Initial version of Ox::Builder
* Includes mappings for all Ox node types (element, instruct, doctype, comment)
* Includes template handler for ActionView and Tilt


text:
@interface IJSVGLinearGradient : IJSVGGradient

+ (NSGradient *)parseGradient:(NSXMLElement *)element
                     gradient:(IJSVGLinearGradient *)aGradient
                   startPoint:(CGPoint *)startPoint
                     endPoint:(CGPoint *)endPoint;

@end


text:
ConfigItem::ConfigItem(ConfigMgr *config_mgr, std::string &value): config_mgr(config_mgr), value(value) { }

int ConfigItem::get_int() {
    try {
        int i = std::stoi(value);
        return i;
    } catch (std::invalid_argument e) {
        throw e;
    }
}

std::string ConfigItem::get_str() {
    return value;
}

bool ConfigItem::get_bool() {
    auto s(value);
    boost::algorithm::to_upper(s);
    if (s == "TRUE") {
        return true;
    } else if (s == "FALSE") {
        return false;
    } else {
        throw std::invalid_argument("Invalid boolean string");
    }
}

ConfigMgr::ConfigMgr(std::string config_file_path, std::string config_file_name):
        config_file_path(config_file_path), config_file_name(config_file_name) {
    init();
}

void ConfigMgr::init() {
    config_items.clear();
    auto dir = boost::filesystem::path(config_file_path);
    auto file = boost::filesystem::path(config_file_name);
    auto full_path = dir / file;

    std::fstream cfg_file;
    cfg_file.open(full_path.string());
    if (!cfg_file.is_open()) {
        std::cout << "Can not open config file: " << full_path << std::endl;
        throw std::runtime_error("Can not open config file");
    } else {
        char line[1024];
        while (!cfg_file.eof()) {
            cfg_file.getline(line, 1024);
            std::string line_(line);

            // ignore comments
            if (line_.length() > 0 && line_[0] == '#') continue;

            auto pos = line_.find('=');
            if (pos == std::string::npos) continue;
            std::string item_name = line_.substr(0, pos);
            std::string item_value = line_.substr(pos+1);
            boost::trim(item_name);
            boost::trim(item_value);

            auto config_item = std::make_shared<ConfigItem>(this, item_value);
            config_items[item_name] = config_item;
        }
    }
}

void ConfigMgr::set_config_file_path(std::string config_file_path_) {
    config_file_path = config_file_path_;
}

void ConfigMgr::set_config_file_name(std::string config_file_name_) {
    config_file_name = config_file_name_;
}

std::shared_ptr<ConfigItem> &ConfigMgr::get_item(std::string name) {
    return config_items[name];
}

ConfigMgr config_mgr;


text:
<title>Class: '1H spectrum reference compound'</title>
<meta http-equiv='content-type' content='text/html;charset=utf8'>
<link rel='stylesheet' href='../default.css' type='text/css' />

Class: '1H spectrum reference compound'

http://nmrML.org/nmrCV#NMR:1000026

Annotations (1)

label "1H spectrum reference compound" (en)

Superclasses (1)

'chemical shift standard'

Usage (1)

Class: '1H spectrum reference compound'


text:
package db

import (
	"io/ioutil"
	"os"
	"path"
	"testing"

	. "gopkg.in/check.v1"
)

// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) {
	TestingT(t)
}

type DbSuite struct{}

var _ = Suite(&DbSuite{})

/*
 * Lowest-layer database tests
 */

func (s *DbSuite) Test_DbFileCreation(c *C) {
	dir, err := ioutil.TempDir("", "rqlite-test-")
	defer os.RemoveAll(dir)

	db := New(path.Join(dir, "test_db"))
	c.Assert(db, NotNil)
	err = db.Close()
	c.Assert(err, IsNil)
}

func (s *DbSuite) Test_TableCreation(c *C) {
	dir, err := ioutil.TempDir("", "rqlite-test-")
	defer os.RemoveAll(dir)
	db := New(path.Join(dir, "test_db"))
	defer db.Close()

	err = db.Execute("create table foo (id integer not null primary key, name text)")
	c.Assert(err, IsNil)

	r, err := db.Query("SELECT * FROM foo")
	c.Assert(err, IsNil)
	c.Assert(len(r), Equals, 0)
}

func (s *DbSuite) Test_SimpleStatements(c *C) {
	dir, err := ioutil.TempDir("", "rqlite-test-")
	defer os.RemoveAll(dir)
	db := New(path.Join(dir, "test_db"))
	defer db.Close()

	err = db.Execute("create table foo (id integer not null primary key, name text)")
	c.Assert(err, IsNil)

	err = db.Execute("INSERT INTO foo(name) VALUES(\"fiona\")")
	c.Assert(err, IsNil)
	r, err := db.Query("SELECT * FROM foo")
	c.Assert(len(r), Equals, 1)
	c.Assert(r[0]["id"], Equals, "1")
	c.Assert(r[0]["name"], Equals, "fiona")

	err = db.Execute("INSERT INTO foo(name) VALUES(\"dana\")")
	c.Assert(err, IsNil)
	r, err = db.Query("SELECT * FROM foo")
	c.Assert(len(r), Equals, 2)
	c.Assert(r[1]["id"], Equals, "2")
	c.Assert(r[1]["name"], Equals, "dana")

	err = db.Execute("UPDATE foo SET Name='Who knows?' WHERE Id=1")
	c.Assert(err, IsNil)
	r, err = db.Query("SELECT * FROM foo")
	c.Assert(len(r), Equals, 2)
	c.Assert(r[0]["id"], Equals, "1")
	c.Assert(r[0]["name"], Equals, "Who knows?")

	err = db.Execute("DELETE FROM foo WHERE Id=2")
	c.Assert(err, IsNil)
	r, err = db.Query("SELECT * FROM foo")
	c.Assert(len(r), Equals, 1)
	c.Assert(r[0]["id"], Equals, "1")
	c.Assert(r[0]["name"], Equals, "Who knows?")

	err = db.Execute("DELETE FROM foo WHERE Id=1")
	c.Assert(err, IsNil)

	for i := 0; i < 10; i++ {
		_ = db.Execute("INSERT INTO foo(name) VALUES(\"philip\")")
	}
	r, err = db.Query("SELECT name FROM foo")
	c.Assert(len(r), Equals, 10)
	for i := range r {
		c.Assert(r[i]["name"], Equals, "philip")
	}
}

func (s *DbSuite) Test_FailingSimpleStatements(c *C) {
	dir, err := ioutil.TempDir("", "rqlite-test-")
	defer os.RemoveAll(dir)
	db := New(path.Join(dir, "test_db"))
	defer db.Close()

	err = db.Execute("INSERT INTO foo(name) VALUES(\"fiona\")")
	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "no such table: foo")

	err = db.Execute("create table foo (id integer not null primary key, name text)")
	c.Assert(err, IsNil)
	err = db.Execute("create table foo (id integer not null primary key, name text)")
	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "table foo already exists")

	err = db.Execute("INSERT INTO foo(id, name) VALUES(11, \"fiona\")")
	c.Assert(err, IsNil)
	err = db.Execute("INSERT INTO foo(id, name) VALUES(11, \"fiona\")")
	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "UNIQUE constraint failed: foo.id")

	err = db.Execute("SELECT * FROM bar")
	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "no such table: bar")

	err = db.Execute("utter nonsense")
	c.Assert(err, NotNil)
	c.Assert(err.Error(), Equals, "near \"utter\": syntax error")
}

func (s *DbSuite) Test_SimpleTransactions(c *C) {
	dir, err := ioutil.TempDir("", "rqlite-test-")
	defer os.RemoveAll(dir)
	db := New(path.Join(dir, "test_db"))
	defer db.Close()

	err = db.Execute("create table foo (id integer not null primary key, name text)")
	c.Assert(err, IsNil)

	err = db.StartTransaction()
	c.Assert(err, IsNil)
	for i := 0; i < 10; i++ {
		_ = db.Execute("INSERT INTO foo(name) VALUES(\"philip\")")
	}
	err = db.CommitTransaction()
	c.Assert(err, IsNil)

	r, err := db.Query("SELECT name FROM foo")
	c.Assert(len(r), Equals, 10)
	for i := range r {
		c.Assert(r[i]["name"], Equals, "philip")
	}

	err = db.StartTransaction()
	c.Assert(err, IsNil)
	for i := 0; i < 10; i++ {
		_ = db.Execute("INSERT INTO foo(name) VALUES(\"philip\")")
	}
	err = db.RollbackTransaction()
	c.Assert(err, IsNil)

	r, err = db.Query("select name from foo") // Test lowercase
	c.Assert(len(r), Equals, 10)
	for i := range r {
		c.Assert(r[i]["name"], Equals, "philip")
	}
}

func (s *DbSuite) Test_TransactionsConstraintViolation(c *C) {
	dir, err := ioutil.TempDir("", "rqlite-test-")
	defer os.RemoveAll(dir)
	db := New(path.Join(dir, "test_db"))
	defer db.Close()

	err = db.Execute("create table foo (id integer not null primary key, name text)")
	c.Assert(err, IsNil)

	err = db.StartTransaction()
	c.Assert(err, IsNil)
	err = db.Execute("INSERT INTO foo(id, name) VALUES(1, \"fiona\")")
	c.Assert(err, IsNil)
	err = db.Execute("INSERT INTO foo(id, name) VALUES(1, \"fiona\")")
	c.Assert(err, NotNil)
	err = db.RollbackTransaction()
	c.Assert(err, IsNil)

	r, err := db.Query("SELECT * FROM foo")
	c.Assert(len(r), Equals, 0)
}

func (s *DbSuite) Test_TransactionsHardFail(c *C) {
	dir, err := ioutil.TempDir("", "rqlite-test-")
	defer os.RemoveAll(dir)
	db := New(path.Join(dir, "test_db"))

	err = db.Execute("create table foo (id integer not null primary key, name text)")
	c.Assert(err, IsNil)
	err = db.Execute("INSERT INTO foo(id, name) VALUES(1, \"fiona\")")
	c.Assert(err, IsNil)

	err = db.StartTransaction()
	c.Assert(err, IsNil)
	err = db.Execute("INSERT INTO foo(id, name) VALUES(2, \"dana\")")
	c.Assert(err, IsNil)
	db.Close()

	db = Open(path.Join(dir, "test_db"))
	c.Assert(db, NotNil)
	r, err := db.Query("SELECT * FROM foo")
	c.Assert(len(r), Equals, 1)
	c.Assert(r[0]["name"], Equals, "fiona")
	db.Close()
}


text:
define([
    "container",
    "app/view/abstruct-view"
], function(ContainerJS, AbstructView){

    "use strict";

    /**
     * @class
     */
    var BView = function() {
        this.model = ContainerJS.Inject("app.model.BModel");
    };

    BView.prototype = new AbstructView();

    /**
     * @public
     */
    BView.prototype.initialize = function() {
        this.model.addObserver("updated", function( ev ) {
            if ( ev.property != "message" ) return;
            this.print( ev.value );
        }.bind(this));
    };

    return BView;
});


text:
package org.openntf.domino.graph2.builtin.workflow.definition;

import org.openntf.domino.graph2.builtin.DEdgeFrame;

import com.tinkerpop.frames.InVertex;
import com.tinkerpop.frames.OutVertex;

public interface Finishes extends DEdgeFrame {
	public final static String LABEL_FINISHES = "finishes"; //$NON-NLS-1$

	@OutVertex
	public TaskDefinition getTaskDefinition();

	@InVertex
	public FlowDefinition getFlowDefinition();
}


text:
package org.openqa.grid.shared;

import java.util.Map;

import javax.servlet.Servlet;

public interface GridNodeServer extends Stoppable {
  boolean boot();
  int getRealPort();
  void setExtraServlets(Map<String, Class<? extends Servlet>> extraServlets);
}


text:
package com.sega.vimarket.color;

import android.app.ActivityManager;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.WindowManager;

import com.sega.vimarket.model.Utils;

import org.jetbrains.annotations.Nullable;

public abstract class CActivity extends AppCompatActivity {
    private String themeString;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        themeString=Colorful.getThemeString();
        setTheme(Colorful.getThemeDelegate().getStyle());
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            if (Colorful.getThemeDelegate().isTranslucent()) {
                getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            }

            ActivityManager.TaskDescription tDesc = new ActivityManager.TaskDescription(null, null, getResources().getColor(Colorful.getThemeDelegate().getPrimaryColor().getColorRes()));
            setTaskDescription(tDesc);
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (!Colorful.getThemeString().equals(themeString)) {
            Log.d(Utils.LOG_TAG, "Theme change detected, restarting activity");
            recreate();
        }
    }

}


text:
int main(){
    puts("hello world!");
    return 0;
}


text:
<html>

<head>
  <title>Breakout + processing.js Accelerometer Example</title>
</head>

<body>
  <canvas id='canvas1'></canvas>

  <!-- The following (socket.io.js) is only required when using the node_server -->
  <script src="../../socket.io/socket.io.js"></script>
  <script src="libs/processing-1.4.1-api.min.js"></script>
  <script src="../../dist/Breakout.min.js"></script>
  <script type="text/javascript">
  // Breakout dependencies
  var IOBoard = BO.IOBoard;
  var IOBoardEvent = BO.IOBoardEvent;
  var AnalogAccelerometer = BO.io.AnalogAccelerometer;
  var AccelerometerEvent = BO.io.AccelerometerEvent;

  // set to true to print debug messages to console
  BO.enableDebugging = true;

  var sketch = new Processing.Sketch();
  // define 3D context
  sketch.use3DContext = true;
  // preload the images
  sketch.imageCache.add("images/pjs.png");
  // attach function
  sketch.attachFunction = function(p) {

    // Breakout vars
    var arduino;
    var accelerometer;
    var RANGE_GS = 3; // +-3 Gs for ADXL335
    var SUPPLY_V = 3.3; // supply voltage of sensor
    var isReady = false;

    var texture;
    var rotx = Math.PI / 4;
    var roty = Math.PI / 4;

    p.setup = function() {
      // Please note: processingjs cannot run on mobile devices in
      // 3D mode because WebGL is not yet supported on mobile devices
      p.size(640, 360, p.P3D);
      texture = p.loadImage("images/pjs.png");
      p.textureMode(p.NORMALIZED);
      p.fill(255);
      p.stroke(p.color(44, 48, 32));

      // create an instance of the IOBoard
      arduino = new IOBoard("localhost", 8887);
      // listen for the READY event
      arduino.addEventListener(IOBoardEvent.READY, onArduinoReady);
    };

    p.draw = function() {
      // don't draw until the Arduino is ready
      if (!isReady) return;

      p.background(0);
      p.translate(p.width / 2.0, p.height / 2.0, -100);

      // each time through the draw loop, set the x and y rotation
      // to the pitch and roll values from teh accelerometer
      // you may need to adjust which access pitch and roll apply to
      // depending on the orientation of your accelerometer to the
      // screen.
      p.rotateX(-accelerometer.pitch * Math.PI / 180);
      p.rotateZ(accelerometer.roll * Math.PI / 180);
      p.scale(90);

      texturedCube(texture);
    }

    function texturedCube(texture) {
      p.beginShape(p.QUADS);
      p.texture(texture);

      // Given one texture and six faces, we can easily set up the uv coordinates
      // such that four of the faces tile "perfectly" along either u or v, but the other
      // two faces cannot be so aligned.  This code tiles "along" u, "around" the X/Z faces
      // and fudges the Y faces - the Y faces are arbitrarily aligned such that a
      // rotation along the X axis will put the "top" of either texture at the "top"
      // of the screen, but is not otherwised aligned with the X/Z faces. (This
      // just affects what type of symmetry is required if you need seamless
      // tiling all the way around the cube)

      // +Z "front" face
      p.vertex(-1, -1, 1, 0, 0);
      p.vertex(1, -1, 1, 1, 0);
      p.vertex(1, 1, 1, 1, 1);
      p.vertex(-1, 1, 1, 0, 1);

      // -Z "back" face
      p.vertex(1, -1, -1, 0, 0);
      p.vertex(-1, -1, -1, 1, 0);
      p.vertex(-1, 1, -1, 1, 1);
      p.vertex(1, 1, -1, 0, 1);

      // +Y "bottom" face
      p.vertex(-1, 1, 1, 0, 0);
      p.vertex(1, 1, 1, 1, 0);
      p.vertex(1, 1, -1, 1, 1);
      p.vertex(-1, 1, -1, 0, 1);

      // -Y "top" face
      p.vertex(-1, -1, -1, 0, 0);
      p.vertex(1, -1, -1, 1, 0);
      p.vertex(1, -1, 1, 1, 1);
      p.vertex(-1, -1, 1, 0, 1);

      // +X "right" face
      p.vertex(1, -1, 1, 0, 0);
      p.vertex(1, -1, -1, 1, 0);
      p.vertex(1, 1, -1, 1, 1);
      p.vertex(1, 1, 1, 0, 1);

      // -X "left" face
      p.vertex(-1, -1, -1, 0, 0);
      p.vertex(-1, -1, 1, 1, 0);
      p.vertex(-1, 1, 1, 1, 1);
      p.vertex(-1, 1, -1, 0, 1);

      p.endShape();
    }

    function onArduinoReady(event) {
      // remove the READY event listener. Must always to this.
      arduino.removeEventListener(IOBoardEvent.READY, onArduinoReady);

      // params: IOBoard, xPin, yPin, zPin, dynamicRange, enableSmoothing
      accelerometer = new AnalogAccelerometer(
        arduino,
        arduino.getAnalogPin(0),
        arduino.getAnalogPin(1),
        arduino.getAnalogPin(2),
        RANGE_GS,
        true);

      // Use calibrate_accelerometer.html to obtain the min and max voltage values
      // to supply to the getCalibratedRange method below.

      // calibration settings for an ADXL335 at 3.3v
      // params: minimum voltage on the axis, max voltage on the axis, supply voltage
      var xRange = accelerometer.getCalibratedRange(1.258, 1.994, SUPPLY_V);
      var yRange = accelerometer.getCalibratedRange(1.248, 1.984, SUPPLY_V);
      var zRange = accelerometer.getCalibratedRange(1.284, 1.935, SUPPLY_V);

      // params: axis, minimum range, maximum range
      accelerometer.setRangeFor(AnalogAccelerometer.X_AXIS, xRange.min, xRange.max);
      accelerometer.setRangeFor(AnalogAccelerometer.Y_AXIS, yRange.min, yRange.max);
      accelerometer.setRangeFor(AnalogAccelerometer.Z_AXIS, zRange.min, zRange.max);

      // signal that the Arduino is ready so processing.js can start
      // drawing with the accelerometer data
      isReady = true;
    }

  };

  var canvas = document.getElementById("canvas1");
  // attaching the sketch to the canvas
  var p = new Processing(canvas, sketch);
  </script>
</body>

</html>


text:
<!-- Auto-generated by x/build/update-readmes.go -->

[![Go Reference](https://pkg.go.dev/badge/golang.org/x/build/tarutil.svg)](https://pkg.go.dev/golang.org/x/build/tarutil)

# golang.org/x/build/tarutil

Package tarutil contains utilities for working with tar archives.


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Detalle_disponibilidad_montos extends CI_Controller {

 public function __construct() {
   parent::__construct();
   if($this->session->userdata('logged_in') == FALSE){
     redirect('login/index/error_no_autenticado');
   }
   $this->load->helper(array('form', 'paginacion'));
   $this->load->library('table');
   $this->load->model(array('Compras/Detalle_solicitud_compra_model','Bodega/Detalle_solicitud_producto_model',
   'Compras/Solicitud_Compra_Model','Compras/Detalle_disponibilidad_montos_model'));
 }

 public function index(){

   if ($this->uri->segment(4) == '') {
     $data['body'] = "ERRROR";
     $this->load->view('base', $data);
   } else {
     $solicitud_compra=$this->Detalle_disponibilidad_montos_model->obtenerSolicitudCompra($this->uri->segment(4));
     $data['title'] = "Detalle Sol.";
     $dis=$this->uri->segment(5);
     $data['js'] = "assets/js/validate/detalle_montos.js";
     $msg['disponibilidad'] = $this->uri->segment(4);
     $men = array('alert' => $this->uri->segment(5),'controller'=>'Detalle_disponibilidad_montos',
     'compra'=>$solicitud_compra);

     $data['body'] = $this->load->view('mensajes', $men, TRUE) . $this->load->view('Compras/detalle_disponibilidad_montos_view',$msg,TRUE) .
                     "

" .
                     "
 Montos
".
                     "
" . $this->mostrarTabla() . "
";
     $data['menu'] = $this->menu_dinamico->menus($this->session->userdata('logged_in'),$this->uri->segment(1));
     $this->load->view('base', $data);
   }
 }

 public function mostrarTabla($accion = TRUE){
   /*
   * Configuracion de la tabla    */
   $template = array(
       'table_open' => '
'
   );
   $this->table->set_template($template);
   $this->table->set_heading('#','Id del requerimiento','Disponibilidad','Linea','Monto','Acciones');

   $registros;

   if ($this->input->is_ajax_request()) {
   } else {
         $registros = $this->Detalle_disponibilidad_montos_model->obtenerDetalleDisponibilidad($this->uri->segment(4));
   }

   if (!($registros == FALSE)) {
     $i = 1;
       foreach ($registros as $det) {
         $onClick = "llenarFormulario('solicitud', ['id_detalle_solicitud_disponibilidad', 'linea',
         'autocomplete1', 'monto'],[$det->id_detalle_solicitud_disponibilidad, '$det->id_linea_trabajo',
          '$det->linea_trabajo','$det->monto_sub_total'])";
         if($det->estado_solicitud_compra=='APROBADA COMPRAS' && $det->estado_solicitud_compra==6 || $det->nivel_solicitud>5 ){
           $eliminar='';
           $editar='';
         }
         else{
           $eliminar='id_detalle_solicitud_disponibilidad.'/'.$this->uri->segment(4)).'>';
           $editar='';
         }
           $this->table->add_row($i,$det->id_solicitud_compra,$det->id_solicitud_disponibilidad,
           $det->linea_trabajo,'$'.number_format($det->monto_sub_total,2),$editar.$eliminar);
         $i++;
       }
   } else {
     $msg = array('data' => "No se encontraron resultados", 'colspan' => "7");
     $this->table->add_row($msg);
   }

   if ($this->input->is_ajax_request()) {
     echo "
" . $this->table->generate() . "
";
   } else {
     return "
" . $this->table->generate() . "
";
   }
 }
 /*
 * Actualiza o Registra al sistema
 */
 public function RecibirDatos(){
   $mod = $this->User_model->obtenerModulo('Compras/Detalle_disponibilidad_montos');
   $USER = $this->session->userdata('logged_in');
   $precio=0.0;
   $data = array(
       'id_detalle_solicitud_disponibilidad' =>$this->input->post('id_detalle_solicitud_disponibilidad'),
       'id_linea_trabajo'=>$this->input->post('linea'),
       'monto_sub_total' => $this->input->post('monto'),
       'id_solicitud_disponibilidad'=>$this->input->post('disponibilidad')
   );
   date_default_timezone_set('America/El_Salvador');
   $anyo=20;
   $fecha_actual=date($anyo."y-m-d");
   $hora=date("H:i:s");
   $rastrea = array(
     'id_usuario' =>$USER['id'],
     'id_modulo' =>$mod,
     'fecha' =>$fecha_actual,
     'hora' =>$hora,
   );
     if (!($data['id_detalle_solicitud_disponibilidad'] == '')){
         $this->Detalle_disponibilidad_montos_model->actualizarDetalleDisponibilidad($data['id_detalle_solicitud_disponibilidad'],$data);
         $rastrea['operacion']='ACTUALIZA';
         $rastrea['id_registro']=$this->input->post('id_detalle_solicitud_disponibilidad');
         $this->User_model->insertarRastreabilidad($rastrea);
         redirect('/Compras/Detalle_disponibilidad_montos/index/'.$data['id_solicitud_disponibilidad'].'/update');
     }else{
               $this->Detalle_disponibilidad_montos_model->insertarDetalleDisponibilidad($data);
               $rastrea['operacion']='INSERTA';
               $rastrea['id_registro']=$this->User_model->obtenerSiguienteIdModuloIncrement('sic_detalle_solicitud_disponibilidad')-1;
               $this->User_model->insertarRastreabilidad($rastrea);
               redirect('/Compras/Detalle_disponibilidad_montos/index/'.$data['id_solicitud_disponibilidad'].'/new');
             }
 }

 public function EliminarDato(){
   $mod = $this->User_model->obtenerModulo('Compras/Detalle_disponibilidad_montos');
   $USER = $this->session->userdata('logged_in');
     $id = $this->uri->segment(4);
     date_default_timezone_set('America/El_Salvador');
     $anyo=20;
     $fecha_actual=date($anyo."y-m-d");
     $hora=date("H:i:s");
     $rastrea = array(
       'id_usuario' =>$USER['id'],
       'id_modulo' =>$mod,
       'fecha' =>$fecha_actual,
       'hora' =>$hora,
       'operacion' =>'ELIMINA',
       'id_registro' =>$this->uri->segment(4),
     );
       $this->Detalle_disponibilidad_montos_model->eliminarDetalleDisponibilidad($id);
       $this->User_model->insertarRastreabilidad($rastrea);
       redirect('/Compras/Detalle_disponibilidad_montos/index/'.$this->uri->segment(5).'/delete');
 }
}
?>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" value="width=device-width; initial-scale:1.0">
    <link rel="stylesheet" href="css/site.css">

         | Topher

Planetary Scale

Using the form below, select your planet and enter the distance that you want to model your scale of our solar system.  Distances are measured in feet.

            Select Planet:
            <select name="targetPlanet" id="targetPlanet">
                <optgroup label="Outer Planets">
                    <option>Netpune</option>
                    <option>Uranus</option>
                    <option>Saturn</option>
                    <option>Jupiter</option>
                </optgroup>
                <optgroup label="Inner Planets">
                    <option>Mars</option>
                    <option>Earth</option>
                    <option>Venus</option>
                    <option>Mercury</option>
                </optgroup>
            </select>

            Target Distance (in feet):
            <input name="targetDistance" id="targetDistance" type="number">

            <button  id="calculate">Calculate Diameters and Average Distances</button>

                    Diameter
                    Avg. Distance from Sun

        © All Rights Reserved • Christopher Kanode


text:
namespace DAVA
{
class ColladaMesh
{
public:
    ColladaMesh(FCDGeometryMesh* _mesh, ColladaVertexWeight* wertexWeightArray, uint32 maxVertexInfluence);
    ~ColladaMesh();

    inline int GetPolygonGroupCount()
    {
        return (int)polygons.size();
    }
    inline ColladaPolygonGroup* GetPolygonGroup(int index)
    {
        return polygons[index];
    };

    FCDGeometryMesh* mesh;

    fm::string name;
    std::vector<ColladaPolygonGroup*> polygons;
};
};

#endif // __COLLADALOADER_COLLADAMESH_H__


text:
package com.jsvoid.solarsystem.services;

import com.jsvoid.solarsystem.models.CelestialObject;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.GET;

/**
 * CelestialObjectResource
 *
 * @author aditya.sharat
 */
public interface CelestialObjectResource {
    @GET("objects.json")
    Call<List<CelestialObject>> query();
}


text:
package net.opengis.gml;

/**
 * An XML MultiSolidType(@http://www.opengis.net/gml).
 *
 * This is a complex type.
 */
public interface MultiSolidType extends net.opengis.gml.AbstractGeometricAggregateType
{
    public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
        org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(MultiSolidType.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.s6E28D279B6C224D74769DB8B98AF1665").resolveHandle("multisolidtype968ftype");

    /**
     * Gets a List of "solidMember" elements
     */
    java.util.List<net.opengis.gml.SolidPropertyType> getSolidMemberList();

    /**
     * Gets array of all "solidMember" elements
     * @deprecated
     */
    @Deprecated
    net.opengis.gml.SolidPropertyType[] getSolidMemberArray();

    /**
     * Gets ith "solidMember" element
     */
    net.opengis.gml.SolidPropertyType getSolidMemberArray(int i);

    /**
     * Returns number of "solidMember" element
     */
    int sizeOfSolidMemberArray();

    /**
     * Sets array of all "solidMember" element
     */
    void setSolidMemberArray(net.opengis.gml.SolidPropertyType[] solidMemberArray);

    /**
     * Sets ith "solidMember" element
     */
    void setSolidMemberArray(int i, net.opengis.gml.SolidPropertyType solidMember);

    /**
     * Inserts and returns a new empty value (as xml) as the ith "solidMember" element
     */
    net.opengis.gml.SolidPropertyType insertNewSolidMember(int i);

    /**
     * Appends and returns a new empty value (as xml) as the last "solidMember" element
     */
    net.opengis.gml.SolidPropertyType addNewSolidMember();

    /**
     * Removes the ith "solidMember" element
     */
    void removeSolidMember(int i);

    /**
     * Gets the "solidMembers" element
     */
    net.opengis.gml.SolidArrayPropertyType getSolidMembers();

    /**
     * True if has "solidMembers" element
     */
    boolean isSetSolidMembers();

    /**
     * Sets the "solidMembers" element
     */
    void setSolidMembers(net.opengis.gml.SolidArrayPropertyType solidMembers);

    /**
     * Appends and returns a new empty "solidMembers" element
     */
    net.opengis.gml.SolidArrayPropertyType addNewSolidMembers();

    /**
     * Unsets the "solidMembers" element
     */
    void unsetSolidMembers();

    /**
     * A factory class with static methods for creating instances
     * of this type.
     */

    public static final class Factory
    {
        public static net.opengis.gml.MultiSolidType newInstance() {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }

        public static net.opengis.gml.MultiSolidType newInstance(org.apache.xmlbeans.XmlOptions options) {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }

        /** @param xmlAsString the string value to parse */
        public static net.opengis.gml.MultiSolidType parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }

        public static net.opengis.gml.MultiSolidType parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }

        /** @param file the file from which to load an xml document */
        public static net.opengis.gml.MultiSolidType parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }

        public static net.opengis.gml.MultiSolidType parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }

        public static net.opengis.gml.MultiSolidType parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }

        public static net.opengis.gml.MultiSolidType parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }

        public static net.opengis.gml.MultiSolidType parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }

        public static net.opengis.gml.MultiSolidType parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }

        public static net.opengis.gml.MultiSolidType parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }

        public static net.opengis.gml.MultiSolidType parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }

        public static net.opengis.gml.MultiSolidType parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }

        public static net.opengis.gml.MultiSolidType parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }

        public static net.opengis.gml.MultiSolidType parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }

        public static net.opengis.gml.MultiSolidType parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }

        /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
        @Deprecated
        public static net.opengis.gml.MultiSolidType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }

        /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
        @Deprecated
        public static net.opengis.gml.MultiSolidType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
          return (net.opengis.gml.MultiSolidType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }

        /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
        @Deprecated
        public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
          return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }

        /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
        @Deprecated
        public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
          return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }

        private Factory() { } // No instance of this class allowed
    }
}