text:
// Example low level rendering Unity plugin

#include "UnityPluginInterface.h"

//#include <pthread.h>
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <osc/OscReceivedElements.h>
#include <osc/OscPacketListener.h>
#include <ip/UdpSocket.h>

#include "AlloServer_Binoculars/FrameData.h"

#ifdef __cplusplus

extern "C" {
#endif

#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
//#include <unistd.h>
#include <sys/types.h>

unsigned char *image = NULL;

FILE * pluginFile;
bool startedServer = false;
    // --------------------------------------------------------------------------
    // Include headers for the graphics APIs we support
}
/*#if SUPPORT_D3D9
	#include <d3d9.h>
#endif
#if SUPPORT_D3D11
	#include <d3d11.h>
#endif*/
#if SUPPORT_OPENGL
	#if UNITY_WIN
		#include <Windows.h>
		#include <GL/gl.h>
	#elif UNITY_LINUX
		#include <GL/gl.h>
	#elif UNITY_OSX
		#include <OpenGL/OpenGL.h>
		#include <OpenGL/gl.h>
	#endif
#endif

// --------------------------------------------------------------------------
// Helper utilities

// Prints a string
static void DebugLog (const char* str)
{
#if UNITY_WIN
	OutputDebugStringA (str);
#else
	printf ("%s", str);
#endif
}

// --------------------------------------------------------------------------
// SetTimeFromUnity, an example function we export which is called by one of the scripts.

static float g_Time=1;

extern "C" void EXPORT_API SetTimeFromUnity (float t) { g_Time = t; }

// --------------------------------------------------------------------------
// SetTextureFromUnity, an example function we export which is called by one of the scripts.

static void* g_TexturePointer;
unsigned int logCount=0;
unsigned char* pixels;

const int i_width = 1920;
const int i_height = 1080;

//const int i_width = 1024;
//const int i_height = 576;
extern "C" void EXPORT_API setLog()
{
    pluginFile = fopen(ROOT_DIR "/Logs/UnityServerPlugin.log", "w");
    fprintf(pluginFile, "Initializing interprocess memory...\n");
    fflush(pluginFile);
}
extern "C" void EXPORT_API SetTextureFromUnity (void* texturePtr)
{
	// A script calls this at initialization time; just remember the texture pointer here.
	// Will update texture pixels each frame from the plugin rendering event (texture update
	// needs to happen on the rendering thread).
	g_TexturePointer = texturePtr;

}

// --------------------------------------------------------------------------
// UnitySetGraphicsDevice

static int g_DeviceType = -1;

// Actual setup/teardown functions defined below
/*#if SUPPORT_D3D9
static void SetGraphicsDeviceD3D9 (IDirect3DDevice9* device, GfxDeviceEventType eventType);
#endif
#if SUPPORT_D3D11
static void SetGraphicsDeviceD3D11 (ID3D11Device* device, GfxDeviceEventType eventType);
#endif*/

extern "C" void EXPORT_API UnitySetGraphicsDevice (void* device, int deviceType, int eventType)
{

	// Set device type to -1, i.e. "not recognized by our plugin"
	g_DeviceType = -1;

/*#if SUPPORT_D3D9
	// D3D9 device, remember device pointer and device type.
	// The pointer we get is IDirect3DDevice9.
	if (deviceType == kGfxRendererD3D9)
	{
		DebugLog ("Set D3D9 graphics device\n");
		g_DeviceType = deviceType;
		SetGraphicsDeviceD3D9 ((IDirect3DDevice9*)device, (GfxDeviceEventType)eventType);
	}
#endif

#if SUPPORT_D3D11
	// D3D11 device, remember device pointer and device type.
	// The pointer we get is ID3D11Device.
	if (deviceType == kGfxRendererD3D11)
	{
		DebugLog ("Set D3D11 graphics device\n");
		g_DeviceType = deviceType;
		SetGraphicsDeviceD3D11 ((ID3D11Device*)device, (GfxDeviceEventType)eventType);
	}
#endif*/

#if SUPPORT_OPENGL
	// If we've got an OpenGL device, remember device type. There's no OpenGL
	// "device pointer" to remember since OpenGL always operates on a currently set
	// global context.
	if (deviceType == kGfxRendererOpenGL)
	{
		DebugLog ("Set OpenGL graphics device\n");
		g_DeviceType = deviceType;
	}
#endif
}

// --------------------------------------------------------------------------
// UnityRenderEvent
// This will be called for GL.IssuePluginEvent script calls; eventID will
// be the integer passed to IssuePluginEvent. In this example, we just ignore
// that value.

struct MyVertex {
	float x, y, z;
	unsigned int color;
};
static void SetDefaultGraphicsState ();
static void DoRendering (const float* worldMatrix, const float* identityMatrix, float* projectionMatrix, const MyVertex* verts);

using namespace boost::interprocess;
mapped_region region;
shared_memory_object shm;
extern "C" void EXPORT_API UnityRenderEvent (int eventID)
{
	// Unknown graphics device type? Do nothing.
	if (g_DeviceType == -1)
		return;

	// A colored triangle. Note that colors will come out differently
	// in D3D9/11 and OpenGL, for example, since they expect color bytes
	// in different ordering.
	MyVertex verts[3] = {
		{ -0.5f, -0.25f,  0, 0xFFff0000 },
		{  0.5f, -0.25f,  0, 0xFF00ff00 },
		{  0,     0.5f ,  0, 0xFF0000ff },
	};

	// Some transformation matrices: rotate around Z axis for world
	// matrix, identity view matrix, and identity projection matrix.

	float phi = g_Time;
	float cosPhi = cosf(phi);
	float sinPhi = sinf(phi);

	float worldMatrix[16] = {
		cosPhi,-sinPhi,0,0,
		sinPhi,cosPhi,0,0,
		0,0,1,0,
		0,0,0.7f,1,
	};
	float identityMatrix[16] = {
		1,0,0,0,
		0,1,0,0,
		0,0,1,0,
		0,0,0,1,
	};
	float projectionMatrix[16] = {
		1,0,0,0,
		0,1,0,0,
		0,0,1,0,
		0,0,0,1,
	};

	// Actual functions defined below
	SetDefaultGraphicsState ();
	DoRendering (worldMatrix, identityMatrix, projectionMatrix, verts);
}

// --------------------------------------------------------------------------
// SetDefaultGraphicsState
//
// Helper function to setup some "sane" graphics state. Rendering state
// upon call into our plugin can be almost completely arbitrary depending
// on what was rendered in Unity before.
// Before calling into the plugin, Unity will set shaders to null,
// and will unbind most of "current" objects (e.g. VBOs in OpenGL case).
//
// Here, we set culling off, lighting off, alpha blend & test off, Z
// comparison to less equal, and Z writes off.

static void SetDefaultGraphicsState ()
{
/*#if SUPPORT_D3D9
	// D3D9 case
	if (g_DeviceType == kGfxRendererD3D9)
	{
		g_D3D9Device->SetRenderState (D3DRS_CULLMODE, D3DCULL_NONE);
		g_D3D9Device->SetRenderState (D3DRS_LIGHTING, FALSE);
		g_D3D9Device->SetRenderState (D3DRS_ALPHABLENDENABLE, FALSE);
		g_D3D9Device->SetRenderState (D3DRS_ALPHATESTENABLE, FALSE);
		g_D3D9Device->SetRenderState (D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
		g_D3D9Device->SetRenderState (D3DRS_ZWRITEENABLE, FALSE);
	}
#endif

#if SUPPORT_D3D11
	// D3D11 case
	if (g_DeviceType == kGfxRendererD3D11)
	{
		ID3D11DeviceContext* ctx = NULL;
		g_D3D11Device->GetImmediateContext (&ctx);
		ctx->OMSetDepthStencilState (g_D3D11DepthState, 0);
		ctx->RSSetState (g_D3D11RasterState);
		ctx->OMSetBlendState (g_D3D11BlendState, NULL, 0xFFFFFFFF);
		ctx->Release();
	}
#endif*/

#if SUPPORT_OPENGL
	// OpenGL case
	if (g_DeviceType == kGfxRendererOpenGL)
	{
		glDisable (GL_CULL_FACE);
		glDisable (GL_LIGHTING);
		glDisable (GL_BLEND);
		glDisable (GL_ALPHA_TEST);
		glDepthFunc (GL_LEQUAL);
		glEnable (GL_DEPTH_TEST);
		glDepthMask (GL_FALSE);
	}
#endif
}

FrameData *data;
static void DoRendering (const float* worldMatrix, const float* identityMatrix, float* projectionMatrix, const MyVertex* verts)
{
    fprintf(pluginFile, "DoRendering()");
    fflush(pluginFile);
	// Does actual rendering of a simple triangle

    //    fprintf(pluginFile, "%i: DoRendering()\n", logCount);
    //    fflush(pluginFile);
    logCount++;

#if SUPPORT_OPENGL
	// OpenGL case
	if (g_DeviceType == kGfxRendererOpenGL)
	{
        fprintf(pluginFile, "Device is opengl");
        fflush(pluginFile);
        //        fprintf(pluginFile, "%i: OpenGL\n", logCount);
        //        fflush(pluginFile);
		// Transformation matrices
		glMatrixMode (GL_MODELVIEW);
		glLoadMatrixf (worldMatrix);
		glMatrixMode (GL_PROJECTION);
		// Tweak the projection matrix a bit to make it match what identity
		// projection would do in D3D case.
		projectionMatrix[10] = 2.0f;
		projectionMatrix[14] = -1.0f;
		glLoadMatrixf (projectionMatrix);

		// Vertex layout
		glVertexPointer (3, GL_FLOAT, sizeof(verts[0]), &verts[0].x);
		glEnableClientState (GL_VERTEX_ARRAY);
		glColorPointer (4, GL_UNSIGNED_BYTE, sizeof(verts[0]), &verts[0].color);
		glEnableClientState (GL_COLOR_ARRAY);

        //        fprintf(pluginFile, "%i: DrawArrays()\n", logCount);
        //        fflush(pluginFile);

		// Draw!
		//glDrawArrays (GL_TRIANGLES, 0, 3);

		// update native texture from code
		if (g_TexturePointer)
		{
            //            fprintf(pluginFile, "texture pointer: %u\n", g_TexturePointer);
            //            fflush(pluginFile);

			GLuint gltex = (GLuint)(size_t)(g_TexturePointer);
			glBindTexture (GL_TEXTURE_2D, gltex);
			int texWidth, texHeight;
			glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &texWidth);
			glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &texHeight);

//            glEnableClientState (GL_TEXTURE_COORD_ARRAY);
//            glVertexPointer (3, GL_FLOAT, sizeof(verts[0]), &verts[0].x);
//            glEnableClientState (GL_VERTEX_ARRAY);
//            glColorPointer (4, GL_UNSIGNED_BYTE, sizeof(verts[0]), &verts[0].color);
//            //glEnableClientState (GL_COLOR_ARRAY);
//
//            glDrawArrays (GL_TRIANGLES, 0, 3);

            //            fprintf(pluginFile, "%i: Set texture.\n", logCount);
            //            fflush(pluginFile);
            fprintf(pluginFile, "Tex width: %i  Tex height: %i\n", texWidth, texHeight);
			fflush(pluginFile);

            //unsigned char tempData[100*3] = {0};
            glGetTexImage(GL_TEXTURE_2D,0,GL_RGB,GL_UNSIGNED_BYTE,data->pixels);

		}
	}
#endif
}

#define PORT 7000
#define QPORT 8008
float a1 = 0;
float a2 = 0;
float a3 = 0;
float a4 = 0;
float a5 = 0;
float a6 = 0;
float a7 = 0;
float q1 = 0;
float q2 = 0;
float q3 = 0;
float q4 = 0;
extern "C" {
	int EXPORT_API startStream();
	int EXPORT_API initInterprocessMemory();
	float EXPORT_API getRoll();
	float EXPORT_API getPitch();
	float EXPORT_API getYaw();
	float EXPORT_API getTouchX();
	float EXPORT_API getTouchY();
	float EXPORT_API getDragX();
	float EXPORT_API getDragY();
	float EXPORT_API getPSQuatX();
	float EXPORT_API getPSQuatY();
	float EXPORT_API getPSQuatZ();
	float EXPORT_API getPSQuatW();
	void EXPORT_API endServer();
	void EXPORT_API oscStart();
	void EXPORT_API oscPhaseSpaceStart();
}
extern "C" void EXPORT_API endServer()
{
    data->shutdownServer = true;
    fprintf(pluginFile, "Ending server...\n");
    fflush(pluginFile);
}

extern "C" float EXPORT_API getRoll()
{
	return a3;
}

extern "C" float EXPORT_API getPitch()
{
	return a2;
}

extern "C" float EXPORT_API getYaw()
{
	return a1;
}
extern "C" float EXPORT_API getTouchX()
{
	return a4;
}
extern "C" float EXPORT_API getTouchY()
{
	return a5;
}
extern "C" float EXPORT_API getDragX()
{
	return a6;
}
extern "C" float EXPORT_API getDragY()
{
	return a7;
}
extern "C" float EXPORT_API getPSQuatX()
{
	return q1;
}
extern "C" float EXPORT_API getPSQuatY()
{
	return q2;
}
extern "C" float EXPORT_API getPSQuatZ()
{
	return q3;
}
extern "C" float EXPORT_API getPSQuatW()
{
	return q4;
}

class QuaternionPacketListener : public osc::OscPacketListener {
protected:

    virtual void ProcessMessage( const osc::ReceivedMessage& m,
                                const IpEndpointName& remoteEndpoint )
    {
        (void) remoteEndpoint; // suppress unused parameter warning

        try{
            // example of parsing single messages. osc::OsckPacketListener
            // handles the bundle traversal.

            // example #2 -- argument iterator interface, supports
            // reflection for overloaded messages (eg you can call
            // (*arg)->IsBool() to check if a bool was passed etc).
            osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
            q1 = (arg++)->AsFloat();
            q2 = (arg++)->AsFloat();
            q3 = (arg++)->AsFloat();
            q4 = (arg++)->AsFloat();

            if( arg != m.ArgumentsEnd() )
                throw osc::ExcessArgumentException();

        }catch( osc::Exception& e ){
            // any parsing errors such as unexpected argument types, or
            // missing arguments get thrown as exceptions.
            std::cout << "error while parsing message: "
            << m.AddressPattern() << ": " << e.what() << "\n";
        }
    }
};

class OrientationPacketListener : public osc::OscPacketListener {
protected:

    virtual void ProcessMessage( const osc::ReceivedMessage& m,
                                const IpEndpointName& remoteEndpoint )
    {
        (void) remoteEndpoint; // suppress unused parameter warning

        try{
            // example of parsing single messages. osc::OsckPacketListener
            // handles the bundle traversal.

            // example #2 -- argument iterator interface, supports
            // reflection for overloaded messages (eg you can call
            // (*arg)->IsBool() to check if a bool was passed etc).
            osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
            a1 = (arg++)->AsFloat();
            a2 = (arg++)->AsFloat();
            a3 = (arg++)->AsFloat();
            a4 = (arg++)->AsFloat();
            a5 = (arg++)->AsFloat();
            a6 = (arg++)->AsFloat();
            a7 = (arg++)->AsFloat();

            if( arg != m.ArgumentsEnd() )
                throw osc::ExcessArgumentException();

			//fprintf(pluginFile, "Yaw: %f, Pitch: %f, Roll: %f \n", a1, a2, a3);
			//fflush(pluginFile);

        }catch( osc::Exception& e ){
            // any parsing errors such as unexpected argument types, or
            // missing arguments get thrown as exceptions.
            std::cout << "error while parsing message: "
            << m.AddressPattern() << ": " << e.what() << "\n";
        }
    }
};

UdpListeningReceiveSocket* s = NULL;
UdpListeningReceiveSocket* qs = NULL;
//UdpListeningReceiveSocket s;
extern "C" void EXPORT_API oscStart()
{
	/*
     * Start OSC client to receive phone sensor orientation
     */
	OrientationPacketListener listener;
    s = new UdpListeningReceiveSocket(IpEndpointName( IpEndpointName::ANY_ADDRESS, PORT ), &listener );

    s->Run();

}

extern "C" void EXPORT_API oscPhaseSpaceStart()
{
	/*
     * Start OSC client to receive Phase Space sensor orientation
     */
    QuaternionPacketListener qlistener;
    qs = new UdpListeningReceiveSocket(IpEndpointName( IpEndpointName::ANY_ADDRESS, QPORT ), &qlistener );

    qs->Run();

}

unsigned char testPixels[i_width*i_height*3];
extern "C" int EXPORT_API initInterprocessMemory()
{

	/*
     * Initialize shared memory between Unity plugin and the Live 555 server/encoder
     */
    //Remove shared memory on construction and destruction
    struct shm_remove
    {
        shm_remove() { shared_memory_object::remove("MySharedMemory2"); }
        ~shm_remove(){ shared_memory_object::remove("MySharedMemory2"); }
    } remover;

    //Create a shared memory object.
    shm = shared_memory_object(create_only, "MySharedMemory2", read_write);

    //Set size
    shm.truncate(sizeof(FrameData));

    //Map the whole shared memory in this process
    region = mapped_region(shm, read_write);

    //Write all the memory to 1
    //std::memset(region.get_address(), 2, region.get_size());

    //Get the address of the mapped region
    void * addr       = region.get_address();

    //Construct the shared structure in memory
    data = new (addr) FrameData;

//    for(int i=0; i<2048*2048*3; i++)
//    {
//        data->pixels[i] = rand() % 255;
//    }

	/*
     * Start server process
     * Will not return until endServer() is called
     */

	if (0 != std::system(ROOT_DIR "/Bin/" CMAKE_INTDIR "/AlloServer_Binoculars"))
        return 1;

    //AlloServer is finished, so shutdown OSC
    if(s != NULL)
    {
        s->AsynchronousBreak();
        delete s;
        s = NULL;
    }
    if(qs != NULL)
    {
        qs->AsynchronousBreak();
        delete qs;
        qs = NULL;
    }

    fprintf(pluginFile,"AlloServer exited\n");
    fflush(pluginFile);

    return 0;
}


text:
"""Apps for zinnia-threaded-comments"""
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _

class ZinniaThreadedCommentsConfig(AppConfig):
    """
    Config for Zinnia Threaded Comments application.
    """
    name = 'zinnia_threaded_comments'
    label = 'zinnia-threaded-comments'
    verbose_name = _('Comments')

redpajama_set_name: RedPajamaGithub


text:
'use strict';

function quoteRE(str) {
  return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&');
}

module.exports = function normalize_opts(options) {
  var emojies = options.defs,
      shortcuts;

  // Filter emojies by whitelist, if needed
  if (options.enabled.length) {
    emojies = Object.keys(emojies).reduce(function (acc, key) {
      if (options.enabled.indexOf(key) >= 0) {
        acc[key] = emojies[key];
      }
      return acc;
    }, {});
  }

  // Flatten shortcuts to simple object: { alias: emoji_name }
  shortcuts = Object.keys(options.shortcuts).reduce(function (acc, key) {
    // Skip aliases for filtered emojies, to reduce regexp
    if (!emojies[key]) { return acc; }

    if (Array.isArray(options.shortcuts[key])) {
      options.shortcuts[key].forEach(function (alias) {
        acc[alias] = key;
      });
      return acc;
    }

    acc[options.shortcuts[key]] = key;
    return acc;
  }, {});

  // Compile regexp
  var names = Object.keys(emojies)
                .map(function (name) { return ':' + name + ':'; })
                .concat(Object.keys(shortcuts))
                .sort()
                .reverse()
                .map(function (name) { return quoteRE(name); })
                .join('|');
  var scanRE = RegExp(names);
  var replaceRE = RegExp(names, 'g');

  return {
    defs: emojies,
    shortcuts: shortcuts,
    scanRE: scanRE,
    replaceRE: replaceRE
  };
};


text:
using UnityEngine;
using System.Collections;

public class ButtonActionController : MonoBehaviour
{

    public static ButtonActionController Click;     // instance of ButtonActionController

    public Sprite[] ButtonSprite;                   //sprite array of buttons
    void Awake()
    {
        if (Click == null)
        {
            DontDestroyOnLoad(gameObject);
            Click = this;
        }
        else if (Click != this)
        {
            Destroy(gameObject);
        }
    }

    /// <summary>
    /// When select classic mode
    /// </summary>
    /// <param name="level">number of level</param>
    public void ClassicScene(int level)
    {
        SoundController.Sound.Click();
        Time.timeScale = 1;
        PLayerInfo.MODE = 0;
        PLayerInfo.MapPlayer = new Player();
        PLayerInfo.MapPlayer.Level = level;
        PLayerInfo.MapPlayer.HightScore = level;
        PLayerInfo.MapPlayer.HightScore = PlayerPrefs.GetInt(PLayerInfo.KEY_CLASSIC_HISCORE, 0);
        Application.LoadLevel("PlayScene");
    }

    /// <summary>
    /// When select arcade mode
    /// </summary>
    /// <param name="player">info of level to play</param>
    public void ArcadeScene(Player player)
    {
        SoundController.Sound.Click();
        Time.timeScale = 1;
        PLayerInfo.MODE = 1;
        PLayerInfo.MapPlayer = player;
        StartCoroutine(GotoScreen("PlayScene"));
    }

    public void SelectMap(int mode)
    {
        SoundController.Sound.Click();
		if (mode == 1) {
			LoadWaiting.LoadScene = "MapScene";
			Application.LoadLevel("LoadingScene");
		}
//            Application.LoadLevel("MapScene");

        else
            HomeScene();

        CameraMovement.StarPointMoveIndex = -1;
    }

    /// <summary>
    /// Go to a scene with name
    /// </summary>
    /// <param name="screen">name of the scene to direction</param>
    IEnumerator GotoScreen(string screen)
    {
        yield return new WaitForSeconds(0);
        Application.LoadLevel(screen);
    }

    public void HomeScene()
    {
        SoundController.Sound.Click();
        Time.timeScale = 1;
        Application.LoadLevel("HomeScene");
    }

    /// <summary>
    /// Set and change state of music
    /// </summary>
    /// <param name="button">Image button</param>
    public void BMusic(UnityEngine.UI.Button button)
    {

        if (PlayerPrefs.GetInt("MUSIC", 0) != 1)
        {
            PlayerPrefs.SetInt("MUSIC", 1); // music off
        }
        else
        {
            PlayerPrefs.SetInt("MUSIC", 0); // music on
        }

    }
    /// <summary>
    /// Set and change state of sound background
    /// </summary>
    /// <param name="button">Image button</param>
    public void BSound(UnityEngine.UI.Image button)
    {
        if (PlayerPrefs.GetInt("SOUND", 0) != 1)
        {
            PlayerPrefs.SetInt("SOUND", 1);
            button.overrideSprite = ButtonSprite[3];
        }
        else
        {
            PlayerPrefs.SetInt("SOUND", 0);
            button.overrideSprite = ButtonSprite[2];
        }
    }
}


text:
from flask_wtf import FlaskForm
from wtforms import BooleanField, SelectField
from flask_babel import lazy_gettext as _

from ..ext import db

class BaseForm(FlaskForm):
    pass

class BaseObjectForm(BaseForm):

    def save(self, obj, save=True):
        self.populate_obj(obj)
        if save:
            db.session.add(obj)
            db.session.commit()
        return obj

class DeleteForm(BaseForm):
    delete_it = BooleanField(_('delete'), default=False)

class NonValidatingSelectField(SelectField):

    def pre_validate(self, form):
        pass


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>My bid pad/Login</title>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
    <link href="bootstrap/css/style.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="css/transition.min.css" />

                                            <form accept-charset="UTF-8" role="form">
                                                <fieldset>
                                                    Just a testing App

                                                        Login

                                                </fieldset>
                                            </form>


text:
ID: 5395
post_title: Login
author: Gary Jones
post_date: 2016-03-10 16:16:59
post_excerpt: ""
layout: page
permalink: https://gamajo.com/login
published: true
---


text:
* * *

title: Crowdsourcing view: page_curriculum theme: none

* * *

<%= partial('curriculum_header', :title=> 'Crowdsourcing', :unplugged=>true,:disclaimer=>'O tempo da aula inclui apenas a atividade. As sugestões de introdução e de resumo podem ser usadas para aprofundamento, quando o tempo permitir.', :time=>20) %>

[content]

[together]

## Visão geral da aula

Em ciência da computação, enfrentamos alguns problemas grandes e assustadores. Desafios como encontrar números primos grandes ou sequências de DNA são quase impossíveis de se fazer sozinho. Associar as capacidades de outras pessoas torna essas tarefas possíveis. Essa aula vai mostrar aos alunos como pode ser útil trabalhar em grupo.

[summary]

## Índice de ensino

### **Primeiros passos** - 20 minutos

1) [Revisão](#Review)
2) [Vocabulário](#Vocab)
3) [Grandes problemas](#GetStarted)

### **Atividade: Crowdsourcing** - 20 minutos

4) [Trabalho em equipe](#Activity1)

### **Resumo** - 5 minutos

5) [Bate-papo](#WrapUp) - o que aprendemos?
6) [Jogo de palavras](#Shmocab)

[/summary]

## Objetivos da aula

### Os alunos vão:

  * Identificar uma tarefa grande que precisa ser feita
  * Reorganizar uma tarefa grande em várias tarefas menores
  * Construir uma solução completa a partir de várias soluções menores

[/together]

[together]

# Guia de ensino

## Materiais, recursos e preparação

### Para o aluno

  * Cartas de baralho (1 maço por grupo)

### Para o professor

  * [Vídeo aula](http://youtu.be/UXCaokAHN1U?list=PL2DhNKNdmOtpGJ79ZYYttiEmc-1Aq8hxm)

[tip]

# Dica de material

As cartas de baralho geralmente são vendidas em maços nas lojas, mas se você estiver com pressa, você pode [imprimi-las on-line](http://printerprojects.com/playingcards/deck.html) em uma cartolina e cortá-las com um estilete.

[/tip]

### Para o professor

  * Guia da aula para o professor
  * [Atividade Crowdsourcing](Activity19-Crowdsourcing.pdf): Trabalho em equipe
  * Um pote cheio de alguma coisa (moedas, botões, clipes)

[/together]

[together]

## Primeiros passos (20 min)

###  1) Revisão

Este é um excelente momento para revisar a última aula que você deu à turma. Sugerimos que você faça perguntas sobre a aula anterior e depois divida os alunos em pequenos grupos para discutir as respostas.

Temos aqui algumas perguntas que você pode fazer na revisão:

  * O que fizemos da última vez?

  * O que você gostaria que tivéssemos feito?

  * Você teve alguma dúvida após a aula que gostaria de perguntar?

  * Qual foi a parte da última aula que você mais gostou?

[tip]

# Dica de aula

Terminar a revisão perguntando o que os alunos mais gostaram deixa uma impressão positiva do exercício anterior, aumentando a expectativa para a atividade que virá a seguir.

[/tip]

###  2) Vocabulário

Nesta aula há uma palavra nova e importante:

[centerIt]

![](vocab.png)

[/centerIt]

**Crowdsourcing** - Repita comigo: Crowd-sour-cing
Obter ajuda de um grande grupo de pessoas para terminar algo mais rápido

###  3) Big Problems

  * Mostre aos alunos seu pote cheio de alguma coisa.
      * "Olhem para este pote. Eu tenho um monte de botões aqui dentro, e eu preciso contar ao diretor quantos botões eu tenho aqui antes de acabar a aula"
      * "Vocês podem pensar em uma forma que eu possa contá-los rapidamente?"
  * Seus alunos podem orientá-lo a pedir ajuda, mas se eles não fizerem isso, você também pode fazer essa sugestão.
      * Despeje todos os botões (ou moedas, etc.) amontoando-os no chão.
      * Peça a todos os alunos que peguem um pequeno número (dez é um bom número, mas você pode dar mais se seus alunos puderem lidar com isso).
      * Quando eles tiverem contado as dez, peça para que eles digam a você, guardem os botões de volta no pote e peguem mais alguns, até que o monte acabe.
  * Comente sobre como a tarefa foi feita rapidamente.
      * Peça para que a turma reflita sobre quanto tempo teria levado e como seria difícil fazer isso sozinho.

[/together]

[tip]

# Dica de aula

Potes de botões e moedas funcionam bem, mas se você tiver pouco tempo para preparar a aula, você pode cortar algumas tiras de papel e colocá-las dentro de uma mochila, ou até mesmo dentro de uma caixa de lápis.

[/tip]

[together]

## Atividades (20 min)

###  4) [Atividade Crowdsourcing](Activity19-Crowdsourcing.pdf): Trabalho em equipe

  * As vezes você tem um grande trabalho que precisa ser feito, mas parece que vai levar todo o tempo. Crowdsourcing é uma forma de usar trabalho em equipe para realizar este trabalho de uma maneira muito mais rápida!

  * Nesse jogo, vamos usar crowdsourcing para ordenar um baralho.

**Instruções:**

> 1) Divida os alunos em grupos de 4, 5 ou 6.
>
> 2) Pegue seu maço de cartas e coloque-o em um saco, balde, ou até mesmo em um bolso improvisado segurando a barra da sua camiseta.
>
> 3) Misture as cartas até que fiquem embaralhadas.
>
> 4) Coloque as cartas em uma mesa ou carteira onde toda a classe possa vê-las.
>
> 5) Decida como dividir a tarefa de ordenar as cartas, de forma que cada pessoa tenha algo para fazer e que ninguém faça muita coisa.
>
> 6) Organize as cartas você mesmo. Você pode pensar em um jeito de fazer isso mais rápido?
>
> 7) Repita o jogo até que você tenha encontrado a forma mais rápida e eficiente de usar o crowdsourcing para essa atividade.

[tip]

# Dica de aula

Pode ser um desafio para os alunos descobrir como dividir tarefas grandes no começo. Pode ser útil se você der algumas ideias para eles depois que eles trabalharem um tempo. Uma excelente divisão para ordenar cartas é a seguinte:

  * Uma pessoa pega as cartas e determina o naipe de cada uma.
  * Uma pessoa organiza as cartas de copas.
  * Uma pessoa organiza as cartas de ouros.
  * Uma pessoa organiza as cartas de paus.
  * Uma pessoa organiza as cartas de espadas.
  * (Se houver outra pessoa, ela pode colocar os naipes em ordem)

[/tip]

[/together]

[together]

## Resumo (5 min)

###  4) Bate-papo: o que aprendemos?

  * Alguma vez você já tentou ordenar um monte de cartas sozinho?
  * Você acha que foi mais fácil ou mais difícil com ajuda?
  * Que outras coisas você precisa fazer que seriam mais fáceis com ajuda?

[tip]

# Dica de aula

As perguntas do Bate-papo têm a finalidade de incentivar reflexões sobre como as aulas se relacionam com o mundo e com o futuro brilhante dos alunos. Use seus conhecimentos sobre sua sala de aula para decidir se você quer discutir isso como uma turma, em grupos, ou em duplas.

[/tip]

###  6) Vocab Shmocab

  * Which one of these definitions did we learn a word for today?

> "Retirar algo"
> "Obter ajuda de um grande grupo de pessoas para terminar algo mais rápido"
> "Algo que não está cozido"
>
>
> > ...e qual é a palavra que aprendemos?

[/together]

[together]

## Avaliação (0 min)

### 7) No Indivdual Assessment

  * Since crowdsourcing is not meant to be done alone, there is no individual assessment.
  * The final assessment of this lesson is the result of the previous activity.

[/together]

[together]

## Aprendizagem estendida

Use essas atividades para melhorar a aprendizagem do aluno. Elas podem ser usadas como atividades extraclasse ou como outra forma de aprendizado.

### Reverse Crowdsourcing

  * Often we think of crowdsourcing as pulling things apart to make them more simple. You can also make big, beautiful things with the same technique.
  * Have your students each grab three cards and build one segment of a [card house](http://www.wikihow.com/Build-a-Tower-of-Cards).
  * Each student can go one after another to build a grand card tower.
  * Try with two, or even three students adding their chunk at a time.
      * Does crowdsourcing always make a task easier?

### Crowdsourcing in the Round

  * You can crowdsource all at the same time or you can do it one person at a time. Try having the whole class sort the same deck of cards, one student at a time.
      * Shuffle the cards and place them in a pile in the center of the room.
      * Have each student approach the pile and choose four cards.
          * Have four piles for the students to sort their cards into
              * Spades
              * Clubs
              * Hearts
              * Diamonds
          * Once all cards have been put in their four piles, have the following four students sort the individual piles.
          * The last person will put all four piles together.
  * This version may not save a lot of time, but it still divides the work and lets each individual have more free time!

[/together]

[standards]

## Conexões e informações básicas

### ISTE Standards (formerly NETS)

  * 1.c - Use models and simulation to explore complex systems and issues.
  * 2.d - Contribute to project teams to solve problems.
  * 4.b - Plan and manage activities to develop a solution or complete a project.
  * 6.a - Understand and use technology systems.

### CSTA K-12 Computer Science Standards

  * CPP.L1:3-04. Construct a set of statements to be acted out to accomplish a simple task
  * CT.L1:3-03. Understand how to arrange information into useful order without using a computer
  * CT.L1:6-01. Understand and use the basic steps in algorithmic problem-solving
  * CT.L1:6-02. Develop a simple understanding of an algorithm using computer-free exercise
  * CT.L1:6-05. Make a list of sub-problems to consider while addressing a larger problem.
  * CL.L1:6-03. Identify ways that teamwork and collaboration can support problem solving and innovation.
  * CT.L2-06. Describe and analyze a sequence of instructions being followed.

### NGSS Science and Engineering Practices

  * K-2-ETS1-1 - Ask questions, make observations, and gather information about a situation people want to change to define a simple problem that can be solved through the development of a new or improved object or tool.

### Common Core Mathematical Practices

  *   1. Make sense of problems and persevere in solving them.
  *   1. Reason abstractly and quantitatively.
  *   1. Attend to precision.
  *   1. Look for and make use of structure.
  *   1. Look for and express regularity in repeated reasoning.

### Common Core Language Arts

  * SL.3.1 - Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 3 topics and texts, building on others' ideas and expressing their own clearly.
  * SL.3.3 - Ask and answer questions about information from a speaker, offering appropriate elaboration and detail.
  * L.3.6 - Acquire and use accurately grade-appropriate conversational, general academic, and domain-specific words and phrases, including those that signal spatial and temporal relationships.
  * SL.4.1 - Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 4 topics and texts, building on others' ideas and expressing their own clearly.
  * L.4.6 - Acquire and use accurately grade-appropriate general academic and domain-specific words and phrases, including those that signal precise actions, emotions, or states of being and that are basic to a particular topic.
  * SL.5.1 - Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 5 topics and texts, building on others' ideas and expressing their own clearly.
  * L.5.6 - Acquire and use accurately grade-appropriate general academic and domain-specific words and phrases, including those that signal contrast, addition, and other logical relationships.

[/standards]

[](http://creativecommons.org/)

[](http://thinkersmith.org/)

[](https://www.commonsensemedia.org/)

[/content]

<link rel="stylesheet" type="text/css" href="../docs/morestyle.css" />


text:
import React, { Component, PropTypes } from 'react';
import ReactDom from "react-dom";
import "./page.less";

import {fetchPosts} from "components/common/fetch";
import {withRouter} from "react-router";

import isNumber from "lodash/isNumber";
import each from "lodash/each";
import size from "lodash/size";

import { Dialog } from 'ui';

import Input from "./input.js";

class OrderConfirm extends Component {
    constructor(props) {
        super(props);
        this.state={
            showData:{
                investmentNum:10,//投资金额
                estimateMoney:"",//钱宝可赚
                estimatePer:140,//预计百分比
                bankMoney:"",//银行可赚
                bankPer:17,//
                totalNum:"",//合计
                cycleYear:5//周期 年
            },
            modelData:{
                name: '',
                phone: '',
                orderId:false
            },
            disabled:false,
            show:false,
            errorShow:false,
            values:{},
            errorMsgs:{
                name:"姓名不能为空!",
                phone:"联系电话不能为空!"
            },
            eMsg:"",
            minPrice:10,
            maxPrice:100
        }
        this.moneyCalculate = this.moneyCalculate.bind(this);
        this.handOk = this.handOk.bind(this);
        this.operate = this.operate.bind(this);
        this.handChange = this.handChange.bind(this);
        this.handBlur = this.handBlur.bind(this);

        this.hangInChange = this.hangInChange.bind(this);
    }

    componentWillMount(){
        //if() minPrice
        //debugger
        let {minPrice,maxPrice} = this.props.location&&this.props.location.state;
        if(!minPrice){
           this.context.router.push({pathname:"/"})
        }
        //let maxPrice = 1000;
        let {showData} = this.state;
        showData.investmentNum = minPrice;
        this.setState({
            minPrice,
            maxPrice,
            showData:Object.assign({},showData,this.moneyCalculate(showData))
        });
    }

    handBlur(){
        //&&value>=this.state.minPrice
        //debugger;
        //ReactDom.findDOMNode(this.refs.temp).focus();
        if(this.state.showData.investmentNum< this.state.minPrice){
            this.setState({
                disabled:true,
                eMsg:"起投金额不能小于"+this.state.minPrice+"万"
            })
            alert("起投金额不能小于"+this.state.minPrice+"万");
            //return ;
        }else if(this.state.showData.investmentNum>this.state.maxPrice){
            this.setState({
                disabled:true,
                eMsg:"起投金额不能大于"+this.state.maxPrice+"万"
            })
            alert("起投金额不能大于"+this.state.maxPrice+"万");
           // return ;
        }else{
            this.setState({
                disabled:false,
                showData:Object.assign({},this.state.showData,this.moneyCalculate(this.state.showData))
            });
        }

    }

    moneyCalculate(data){
        var newState = {};
        let {investmentNum,estimatePer,bankPer,cycleYear} = data;
        newState.estimateMoney = this.calculate(investmentNum,estimatePer,cycleYear);
        newState.bankMoney = this.calculate(investmentNum,bankPer,cycleYear);
        newState.totalNum = investmentNum;
        return newState;
    }
    calculate(money,per,cycle){
        return (money*per*cycle/365).toFixed(2);
    }
    handOk(){
        //0debugger;
        let vaResult = true,errorMsg = this.state.eMsg;
        let {values,errorMsgs,showData} = this.state;
        each(errorMsgs,function(one,key){
            if(one!==true){
                vaResult = false;
                errorMsg = one;
                return false;
            }

        })
        //debugger
        if(this.state.disabled===true||vaResult===false||size(errorMsgs)!=2){
            alert(errorMsg);
            return;
        }

        this.setState({
            disabled:true
        })
        var self = this;
        let {projectId} = this.props.routeParams;
        values.amount = Number(showData.investmentNum)*10000;
        //debugger;
        fetchPosts("/api/project/"+projectId+"/apply",values,"POST").then((data)=>{
            //debugger;
            if(data.code===0){
                data = data.result;
                self.setState({
                    modelData:{
                        name:data.user.realName,
                        phone:data.user.phoneNo,
                        orderId:data.orderId
                    },
                    disabled:false,
                    show:true
                })
            }else{
                alert(data.message);
                self.setState({
                    disabled:false
                })

                // self.props.router.push({pathname:"/orderinfo/"+projectId});

                //self.props.router.push({pathname:"/"});

            }

            //consoel.log("niya . sha b ",data);
            //modelData
        }).catch(()=>{
            self.setState({
                disabled:false
            })
            //alert("系统繁忙,请稍后再试!");
            // let data = {user:{name:"呵呵",phone:"11111111111"}}
            // self.setState({
            //     modelData:{
            //         name:data.user.name,
            //         phone:data.user.phone,
            //         orderId:data.orderId
            //     },
            //     disabled:false,
            //     show:true
            // })
        })
        //this.props.router.push({pathname:"/home"})
        //
    }

    handChange(event){
        let value = event.target.value.substr(0, 140);
        value = Number(value);
        //debugger
        if(isNumber(value)&&value<=10000){
            this.setState({
                showData:Object.assign({},this.state.showData,{investmentNum:value})
            });
            console.log(Object.assign({},this.state.showData,{investmentNum:value}))
        }

    }
    operate(data){
        let {projectId} = this.props.routeParams;
        //this.props.router.push({pathname:"/orderinfo/"+projectId});
        this.props.history.push({pathname:"/"});
    }

    hangInChange(name,value){
        //ReactDom.findDOMNode(this.refs.temp).focus();

        let errorMsg = true,newState={};
        //debugger
        if(!value){
            errorMsg = (name==='name'?"姓名":"联系电话")+"不能为空";
            //ReactDom.findDOMNode(this.refs.temp).focus();
        }else if(name ==="phone" && !/^1(3|4|5|7|8)\d{9}$/.test(value)){
            errorMsg = "手机号码错误";
        }

         let newValue = {},newMsg = {};
         newValue[name] = value;
         newMsg[name] = errorMsg;

        if(errorMsg===true){
            newState.values = Object.assign({},this.state.values,newValue);
            newState.errorMsgs = Object.assign({},this.state.errorMsgs,newMsg);
        }else{
            newState.errorMsgs = Object.assign({},this.state.errorMsgs,newMsg);
            //alert(errorMsg);
            //ReactDom.findDOMNode(this.refs.temp).focus();
            //return ;
        }

        this.setState(newState);
    }

    render() {
        let {inputProps} = this.props;
        let {investmentNum,estimateMoney,bankMoney,totalNum} = this.state.showData;
        return (

            <input type="hidden" ref="temp"/>

                        我要投(万元)
                        <input type="input" value={investmentNum} onChange={this.handChange} onBlur={this.handBlur} />

个人信息

                    <Input {...inputProps.name} onChange={this.hangInChange}  />
                    <Input {...inputProps.phone} onChange={this.hangInChange} />

                {/*

<Input title={"姓名"}  />

<Input title={"联系电话"}  />

姓名<input type="text" />

联系电话<input type="text" />

*/}

合计:¥{totalNum}万

                    <button onClick={this.handOk}>确认</button>

                <Dialog errorShow={this.state.errorShow} buttonConfirm={(data)=>this.operate(data)} show={this.state.show}  data={this.state.modelData}></Dialog>

        )
    }
}
OrderConfirm.defaultProps = {
    inputProps:{
        name:{
            title:"姓名",
            name:"name",
            maxLength:10
        },
        phone:{
            title:"联系电话",
            name:"phone",
            maxLength:11,
            type:"text"
        }

    }
}

OrderConfirm.contextTypes = {
  router: React.PropTypes.object.isRequired
};

export default OrderConfirm;

/**
 *
 *
 * type: 'success',
    buttonConfirm: function () {
    },
    errorShow: false,

                        预计到期可赚(万元)
                        {estimateMoney}

                        银行同期可赚(万元)
                        {bankMoney}

 */
//


text:
class ClImage2D;
class ClImage3D;
class ClMem;

// Command to read from a 2D or 3D image object to host memory.
class ClReadImage : public ClBlockingCommand {
    const ClMem& mem;
    const glm::ivec3 imageOrigin;
    const glm::ivec3 imageRegion;
    const size_t rp;
    const size_t sp;
    void * ptr;

public:
    // read whole 2D image
    ClReadImage(const ClImage2D& im, void * pptr, size_t rowPitch=0);

    // read part of 2D image
    ClReadImage(const ClImage2D& im, void * pptr,
                glm::ivec2 origin, glm::ivec2 region,
                size_t rowPitch=0);

    // read whole 3D image
    ClReadImage(const ClImage3D& im, void * pptr,
                size_t rowPitch=0, size_t slicePitch=0);

    // read part of 3D image
    ClReadImage(const ClImage3D& im, void * pptr,
                glm::ivec3 origin, glm::ivec3 region,
                size_t rowPitch=0, size_t slicePitch=0);

    ClEvent enqueueBlocking(Error& error, const ClCommandQueue& queue,
                            cl_uint nEvents, const cl_event * events,
                            bool blocking);
};


text:
const path = require('path');

const DISALLOWED_EXTENSIONS = {
	'.babelrc.js': {
		messageId: 'noExplicitPreset',
		property: 'presets',
		values: new Set(['@babel/preset-env', '@babel/preset-react']),
	},
	'.eslintrc.js': {
		messageId: 'noExplicitExtend',
		property: 'extends',
		values: new Set(['liferay/portal', 'liferay/react']),
	},
};

const noExplicitExtend =
	'`liferay/portal` and `liferay/react` apply automatically and can be omitted';

const noExplicitPreset =
	'`@babel/preset-env` and `@babel/preset-react` apply automatically and can be omitted';

/**
 * Expects `nodesToRemove` to be either:
 *
 * - a Set of literals to prune from an ArrayExpression; or:
 * - a Property to prune from an ObjectExpression.
 */
function fix(nodesToRemove, context, fixer) {
	const source = context.getSourceCode();

	let items;

	if (nodesToRemove instanceof Set) {
		// Removing elements from an ArrayExpression.

		const parent = [...nodesToRemove][0].parent;

		items = parent.elements.slice();
	} else {
		// Removing property from an ObjectExpression.

		const parent = nodesToRemove.parent;

		// Special case: when removing last property, kill all
		// internal whitespace.

		if (parent.properties.length === 1) {
			return fixer.replaceText(parent, '{}');
		}

		nodesToRemove = new Set([nodesToRemove]);
		items = parent.properties.slice();
	}

	const lastIndex = items.length - 1;
	const start = items[0].range[0];
	const end = items[lastIndex].range[1];

	// Record index of last `item` in `items` that will remain after we've
	// deleted `nodesToRemove`.

	const lastRemaining = items.reduce((last, item, index) => {
		if (nodesToRemove.has(item)) {
			return last;
		} else {
			return index;
		}
	}, NaN);

	// Remove array elements or an object property, preserving
	// whitespace between items.

	return fixer.replaceTextRange(
		[start, end],
		items.slice().reduce((text, item, index) => {
			const atEnd = index >= lastRemaining;

			const trailingWhitespace = atEnd
				? ''
				: source
						.getText()
						.slice(item.range[1], items[index + 1].range[0]);

			if (nodesToRemove.has(item)) {
				return text;
			} else {
				const itemText = source.getText(item);

				return text + itemText + trailingWhitespace;
			}
		}, '')
	);
}

module.exports = {
	create(context) {
		const filename = path.basename(context.getFilename());

		const disallowed = DISALLOWED_EXTENSIONS[filename];

		if (!disallowed) {
			return {};
		}

		const {messageId} = disallowed;

		const pendingDeletions = new Map();

		return {
			'ArrayExpression:exit'(node) {
				if (pendingDeletions.has(node)) {
					// Special case: when removing all array items, remove
					// entire property instead.

					if (
						pendingDeletions.get(node).size === node.elements.length
					) {
						pendingDeletions.set(node.parent, node.parent);
					} else {
						context.report({
							fix: fixer =>
								fix(pendingDeletions.get(node), context, fixer),
							messageId,
							node,
						});
					}
				}
			},

			Literal(node) {
				if (!disallowed.values.has(node.value)) {
					return;
				}

				if (
					node.parent &&
					node.parent.type === 'ArrayExpression' &&
					node.parent.parent &&
					node.parent.parent.type === 'Property' &&
					node.parent.parent.key &&
					node.parent.parent.key.type === 'Identifier' &&
					node.parent.parent.key.name === disallowed.property
				) {
					if (!pendingDeletions.has(node.parent)) {
						pendingDeletions.set(node.parent, new Set());
					}

					pendingDeletions.get(node.parent).add(node);
				} else if (
					node.parent &&
					node.parent.type === 'Property' &&
					node.parent.key &&
					node.parent.key.type === 'Identifier' &&
					node.parent.key.name === disallowed.property
				) {
					pendingDeletions.set(node.parent, node);
				}
			},

			'Property:exit'(node) {
				if (pendingDeletions.has(node)) {
					context.report({
						fix: fixer => fix(node, context, fixer),
						messageId,
						node,
					});
				}
			},
		};
	},

	meta: {
		docs: {
			category: 'Best Practices',
			description: 'default configs and presets can be omitted',
			recommended: false,
			url: 'https://github.com/liferay/eslint-config-liferay/pull/53',
		},
		fixable: 'code',
		messages: {
			noExplicitExtend,
			noExplicitPreset,
		},
		schema: [],
		type: 'problem',
	},
};


text:
#ifndef __JAMMIN_WINDOW_H
#define __JAMMIN_WINDOW_H

//#include "globals.h"
//#include "constants.h"
#include "TargetSettingsWin.h"
#include "TargetConfig.h"
#include "JMOpenFilePanel.h"
//#include  "JamFile.h"

//#include <Application.h>
#include <View.h>
#include <ListView.h>
#include <OutlineListView.h>
#include <StringView.h>
#include <ScrollView.h>
#include <Menu.h>
#include <MenuItem.h>
#include <MenuBar.h>
#include <Message.h>
#include <Window.h>

//application message constants
const uint32 WINDOW_REGISTRY_ADD =		'WRad';
const uint32 WINDOW_REGISTRY_SUB =		'WRsb';
const uint32 WINDOW_REGISTRY_ADDED =	'WRdd';

// messaggi per il menu
//menu file
const uint32 MENU_FILE_NEW_TARGET =		'MFnt';
const uint32 MENU_FILE_OPEN =			'MFop';
const uint32 MENU_FILE_SAVEAS = 		'MFsa';
const uint32 MENU_FILE_EXPORT_JAMFILE =	'MFex';
const uint32 MENU_FILE_CLOSE =			'MFcl';
const uint32 MENU_FILE_QUIT	=			'MFqt';

//menu target
const uint32 MENU_TARGET_ADD_FILES =	'MTaf';
const uint32 MENU_TARGET_REMOVE_ITEMS = 'MTrm';
const uint32 MENU_TARGET_BUILD = 		'MTbd';
const uint32 MENU_TARGET_SETTINGS = 	'MTst';

//finestra Target Settings
const uint32 TARGET_NAME_CHANGED =		'TNch';
const uint32 TARGET_TYPE_CHANGED =		'TTch';
const uint32 TARGET_OPTIONS_CHANGED =	'TOch';

//Misc
const uint32 JAMFILE_REF_RECEIVED =		'JFrr';
const uint32 LISTVIEW_FILE_INVOKED =	'LVfi';

class JamMinWindow : public BWindow
{
public:
	JamMinWindow(const char *uWindowTitle);
	JamMinWindow(entry_ref* ref);
	~JamMinWindow();
	virtual void MessageReceived(BMessage *Message);
	virtual bool QuitRequested();
	virtual void FrameResized(float width, float height);
	virtual void Zoom(BPoint origin, float width, float height);
	status_t Save(BMessage* message);
private:
	/* members */
	TargetConfig* fConfig;
	TargetSettingsWin* fSettingsWin;
	//BListView* fListView;

	BMenuBar *fMenubar;
	BScrollView *fScrollFileListView;
	BFilePanel* fSavePanel;
	BFilePanel*	fExportPanel;
	BFilePanel*	fOpenPanel;
	JMOpenFilePanel* fOpenPanel2; //to add files to project
	///////
	BOutlineListView *fFileListView;
	BListItem* fSourceGroup;
	//BStringItem* fSourceGroup;
	BListItem* fResourceGroup;
	BListItem* fLibraryGroup;
	BListItem* fSysLibGroup;
	BListItem* fUserLibGroup;
	BListItem* fOtherGroup;

	///////

	status_t fStatus;
	BMessage* fSaveMessage;

	//helper functions
	void		InitFileList(); //inserisce nella lista i nomi dei file														//da compilare
	void		InitMenu();
	void		InitWindow();
	void		PopulateFileList();
	void		SetPanelDirs();

	void		AddToProject(entry_ref* ref, bool relpath);
	status_t	AddToTargetAndGroup(const char* name, const char* archName, BPath* fullPath,
		status_t (TargetConfig::*AddFun)(const char*),
		status_t (TargetConfig::*RemFun)(const char*), BListItem* group);
	void		RemoveSelectedItems();
	void		RemoveSelectedGroupItems(BListItem* group);
	status_t	ExportJamFile(BMessage* message);
	bool		IsSystemLibraryPath(BPath* libPath);
	//bool		IsPathAllowed(BPath* workingDir, BPath* fileDir);
	BPath		GetWorkingDirPath();
	status_t	AddFileToGroup(const char* name, const char* archName, BPath* fullPath, BListItem* group);
	status_t	AddArchivedName(const char* archName, BListItem* group,
		status_t (TargetConfig::*RemFun)(const char*));
	void		HandleDragMessage(BMessage* message);
	inline bool	IsRelativePath(const char* path);
	//status_t	AbsToRelPath(BString* returnedPath, BPath* filePath);
	status_t	GetFileExtension(BString* extension, const BString* fileName);
	void		OpenSelectedItem();
	void		ShowSaveAlert();
	bool		SysLibAlert();
	void		UnflattenErrorAlert();
	void		UnarchiveNameErrorAlert(const char* path);

	void		Register();
	void		Unregister();
};

#endif //__JAMMIN_WINDOW_H


text:
package com.jetbrains.python.codeInsight.controlflow;

import com.intellij.codeInsight.controlflow.ControlFlow;
import com.intellij.codeInsight.controlflow.ControlFlowBuilder;
import com.intellij.codeInsight.controlflow.Instruction;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiNamedElement;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.QualifiedName;
import com.intellij.util.containers.ContainerUtil;
import com.jetbrains.python.PyNames;
import com.jetbrains.python.PyTokenTypes;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.impl.ParamHelper;
import com.jetbrains.python.psi.impl.PyAugAssignmentStatementNavigator;
import com.jetbrains.python.psi.impl.PyEvaluator;
import com.jetbrains.python.psi.impl.PyImportStatementNavigator;
import kotlin.Triple;
import one.util.streamex.StreamEx;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

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

/**
 * @author oleg
 */
public class PyControlFlowBuilder extends PyRecursiveElementVisitor {
  private final ControlFlowBuilder myBuilder = new ControlFlowBuilder();

  public ControlFlow buildControlFlow(@NotNull final ScopeOwner owner) {
    return myBuilder.build(this, owner);
  }

  @NotNull
  protected ControlFlowBuilder getBuilder() {
    return this.myBuilder;
  }

  @Override
  public void visitPyFunction(final PyFunction node) {
    // Create node and stop here
    myBuilder.startNode(node);
    visitParameterListExpressions(node.getParameterList());
    visitDecorators(node.getDecoratorList());
    final PyAnnotation annotation = node.getAnnotation();
    if (annotation != null) {
      annotation.accept(this);
    }

    final ReadWriteInstruction instruction = ReadWriteInstruction.write(myBuilder, node, node.getName());
    myBuilder.addNode(instruction);
    myBuilder.checkPending(instruction);
  }

  @Override
  public void visitPyDecoratorList(PyDecoratorList node) {
  }

  private void visitDecorators(PyDecoratorList list) {
    if (list != null) {
      for (PyDecorator decorator : list.getDecorators()) {
        decorator.accept(this);
      }
    }
  }

  private void visitParameterListExpressions(PyParameterList parameterList) {
    ParamHelper.walkDownParamArray(parameterList.getParameters(), new ParamHelper.ParamVisitor() {
      @Override
      public void visitNamedParameter(PyNamedParameter param, boolean first, boolean last) {
        final PyExpression defaultValue = param.getDefaultValue();
        if (defaultValue != null) {
          defaultValue.accept(PyControlFlowBuilder.this);
        }
        final PyAnnotation annotation = param.getAnnotation();
        if (annotation != null) {
          annotation.accept(PyControlFlowBuilder.this);
        }
      }
    });
  }

  @Override
  public void visitPyClass(final PyClass node) {
    // Create node and stop here
    myBuilder.startNode(node);
    for (PsiElement element : node.getSuperClassExpressions()) {
      element.accept(this);
    }
    visitDecorators(node.getDecoratorList());
    final ReadWriteInstruction instruction = ReadWriteInstruction.write(myBuilder, node, node.getName());
    myBuilder.addNode(instruction);
    myBuilder.checkPending(instruction);
  }

  @Override
  public void visitPyStatement(final PyStatement node) {
    myBuilder.startNode(node);
    super.visitPyStatement(node);
  }

  @Override
  public void visitPyElement(PyElement node) {
    if (node instanceof PsiNamedElement && !(node instanceof PyKeywordArgument)) {
      myBuilder.startNode(node);
      myBuilder.addNode(ReadWriteInstruction.newInstruction(myBuilder, node, node.getName(), ReadWriteInstruction.ACCESS.WRITE));
    }
    super.visitPyElement(node);
  }

  @Override
  public void visitPyCallExpression(final PyCallExpression node) {
    final PyExpression callee = node.getCallee();
    // Flow abrupted
    final String repr = PyUtil.getReadableRepr(callee, true);
    if (callee != null && ("sys.exit".equals(repr) ||
                           "self.fail".equals(repr))) {
      callee.accept(this);
      for (PyExpression expression : node.getArguments()) {
        expression.accept(this);
      }
      abruptFlow(node);
    }
    else {
      super.visitPyCallExpression(node);
    }
    if (node.isCalleeText(PyNames.ASSERT_IS_INSTANCE)) {
      final PyTypeAssertionEvaluator assertionEvaluator = new PyTypeAssertionEvaluator();
      node.accept(assertionEvaluator);
      InstructionBuilder.addAssertInstructions(myBuilder, assertionEvaluator);
    }
  }

  @Override
  public void visitPySubscriptionExpression(PySubscriptionExpression node) {
    myBuilder.startNode(node);
    node.getOperand().accept(this);
    final PyExpression expression = node.getIndexExpression();
    if (expression != null) {
      expression.accept(this);
    }
  }

  @Override
  public void visitPyReferenceExpression(final PyReferenceExpression node) {
    final PyExpression qualifier = node.getQualifier();
    if (qualifier != null) {
      qualifier.accept(this);
      return;
    }
    if (PyImportStatementNavigator.getImportStatementByElement(node) != null) {
      return;
    }

    final ReadWriteInstruction.ACCESS access = PyAugAssignmentStatementNavigator.getStatementByTarget(node) != null
                                               ? ReadWriteInstruction.ACCESS.READWRITE
                                               : ReadWriteInstruction.ACCESS.READ;
    final ReadWriteInstruction readWriteInstruction = ReadWriteInstruction.newInstruction(myBuilder, node, node.getName(), access);
    myBuilder.addNode(readWriteInstruction);
    myBuilder.checkPending(readWriteInstruction);
  }

  @Override
  public void visitPyBoolLiteralExpression(PyBoolLiteralExpression node) {
    final ReadWriteInstruction readWriteInstruction = ReadWriteInstruction.newInstruction(myBuilder, node, node.getText(),
                                                                                ReadWriteInstruction.ACCESS.READ);
    myBuilder.addNode(readWriteInstruction);
    myBuilder.checkPending(readWriteInstruction);
  }

  @Override
  public void visitPyNoneLiteralExpression(PyNoneLiteralExpression node) {
    final ReadWriteInstruction readWriteInstruction = ReadWriteInstruction.newInstruction(myBuilder, node, node.getText(),
                                                                                ReadWriteInstruction.ACCESS.READ);
    myBuilder.addNode(readWriteInstruction);
    myBuilder.checkPending(readWriteInstruction);
  }

  @Override
  public void visitPyTypeDeclarationStatement(PyTypeDeclarationStatement node) {
    myBuilder.startNode(node);
    final PyAnnotation annotation = node.getAnnotation();
    if (annotation != null) {
      annotation.accept(this);
    }
    node.getTarget().accept(this);
  }

  @Override
  public void visitPyAssignmentStatement(final PyAssignmentStatement node) {
    myBuilder.startNode(node);
    final PyExpression value = node.getAssignedValue();
    if (value != null) {
      value.accept(this);
    }
    final PyAnnotation annotation = node.getAnnotation();
    if (annotation != null) {
      annotation.accept(this);
    }
    for (PyExpression expression : node.getRawTargets()) {
      expression.accept(this);
    }
  }

  @Override
  public void visitPyAugAssignmentStatement(final PyAugAssignmentStatement node) {
    myBuilder.startNode(node);
    final PyExpression value = node.getValue();
    if (value != null) {
      value.accept(this);
    }
    node.getTarget().accept(this);
  }

  @Override
  public void visitPyTargetExpression(final PyTargetExpression node) {
    final QualifiedName qName = node.asQualifiedName();
    if (qName != null) {
      final ReadWriteInstruction instruction = ReadWriteInstruction.newInstruction(myBuilder, node, qName.toString(),
                                                                                ReadWriteInstruction.ACCESS.WRITE);
      myBuilder.addNode(instruction);
      myBuilder.checkPending(instruction);
    }

    final PyExpression qualifier = node.getQualifier();
    if (qualifier != null) {
      qualifier.accept(this);
    }
  }

  @Override
  public void visitPyNamedParameter(final PyNamedParameter node) {
    final PyExpression defaultValue = node.getDefaultValue();
    if (defaultValue != null) {
      defaultValue.accept(this);
    }
    final ReadWriteInstruction instruction = ReadWriteInstruction.write(myBuilder, node, node.getName());
    myBuilder.addNode(instruction);
    myBuilder.checkPending(instruction);
  }

  @Override
  public void visitPyImportStatement(final PyImportStatement node) {
    visitPyImportStatementBase(node);
  }

  @Override
  public void visitPyFromImportStatement(PyFromImportStatement node) {
    visitPyImportStatementBase(node);
    final PyStarImportElement starImportElement = node.getStarImportElement();
    if (starImportElement != null) {
      starImportElement.accept(this);
    }
  }

  @Override
  public void visitPyStarImportElement(PyStarImportElement node) {
    myBuilder.startNode(node);
  }

  private void visitPyImportStatementBase(PyImportStatementBase node) {
    myBuilder.startNode(node);
    for (PyImportElement importElement : node.getImportElements()) {
      final ReadWriteInstruction instruction = ReadWriteInstruction.write(myBuilder, importElement, importElement.getVisibleName());
      myBuilder.addNode(instruction);
      myBuilder.checkPending(instruction);
    }
  }

  @NotNull
  private List<Pair<PsiElement, Instruction>> getPrevInstructions(@Nullable PyElement condition) {
    final List<Pair<PsiElement, Instruction>> result = ContainerUtil.newArrayList(Pair.create(condition, myBuilder.prevInstruction));
    myBuilder.processPending((pendingScope, instruction) -> {
      if (pendingScope != null && PsiTreeUtil.isAncestor(condition, pendingScope, false)) {
        result.add(Pair.create(pendingScope, instruction));
      }
      else {
        myBuilder.addPendingEdge(pendingScope, instruction);
      }
    });
    return result;
  }

  @Override
  public void visitPyConditionalExpression(PyConditionalExpression node) {
    myBuilder.startNode(node);
    final PyExpression condition = node.getCondition();
    final PyTypeAssertionEvaluator assertionEvaluator = new PyTypeAssertionEvaluator();
    if (condition != null) {
      condition.accept(this);
      condition.accept(assertionEvaluator);
    }
    final Instruction branchingPoint = myBuilder.prevInstruction;
    final PyExpression truePart = node.getTruePart();
    final PyExpression falsePart = node.getFalsePart();
    if (truePart != null) {
      InstructionBuilder.addAssertInstructions(myBuilder, assertionEvaluator);
      truePart.accept(this);
      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }
    if (falsePart != null) {
      myBuilder.prevInstruction = branchingPoint;
      falsePart.accept(this);
      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }
  }

  @Override
  public void visitPyIfStatement(final PyIfStatement node) {
    myBuilder.startNode(node);

    PyExpression lastCondition = null; // last visited condition
    List<Pair<PsiElement, Instruction>> lastBranchingPoints = Collections.emptyList(); // outcoming edges from the last visited condition
    final List<Boolean> conditionResults = new ArrayList<>(); // visited conditions results

    final PyIfPart firstIfPart = node.getIfPart();

    for (PyIfPart part : StreamEx.of(firstIfPart).append(node.getElifParts())) {
      if (part != firstIfPart) {
        // first `if` could not be considered as some `if` inheritor
        if (!ContainerUtil.exists(conditionResults, Boolean.TRUE::equals)) {
          // edges to `if` would be created below if there were no conditions evaluated to `True` earlier
          lastBranchingPoints.forEach(pair -> myBuilder.addPendingEdge(pair.getFirst(), pair.getSecond()));
        }
        myBuilder.prevInstruction = null;

        myBuilder.startConditionalNode(part, lastCondition, false);
      }

      final Triple<PyExpression, List<Pair<PsiElement, Instruction>>, Boolean> currentPartResults = visitPyIfPart(part, node);
      lastCondition = currentPartResults.getFirst();
      lastBranchingPoints = currentPartResults.getSecond();
      conditionResults.add(currentPartResults.getThird());
    }

    final PyTypeAssertionEvaluator negativeAssertionEvaluator = new PyTypeAssertionEvaluator(false);
    final PyExpression firstIfPartCondition = firstIfPart.getCondition();
    // TODO: Add support for 'elif'
    if (firstIfPartCondition != null) {
      firstIfPartCondition.accept(negativeAssertionEvaluator);
    }

    final PyElsePart elseBranch = node.getElsePart();
    if (elseBranch != null) {
      if (!ContainerUtil.exists(conditionResults, Boolean.TRUE::equals)) {
        // edges to `else` would be created below if there were no conditions evaluated to `True` earlier
        lastBranchingPoints.forEach(pair -> myBuilder.addPendingEdge(pair.getFirst(), pair.getSecond()));
      }
      myBuilder.prevInstruction = null;

      final PyStatementList statements = elseBranch.getStatementList();

      myBuilder.startConditionalNode(statements, lastCondition, false);
      InstructionBuilder.addAssertInstructions(myBuilder, negativeAssertionEvaluator);
      statements.accept(this);

      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }
    else if (ContainerUtil.getLastItem(conditionResults) != Boolean.TRUE) {
      // if last condition was evaluated to `True`, all outcoming `if` statement edges were correctly processed in the last `if`

      myBuilder.prevInstruction = null;

      final Instruction instruction =
        ContainerUtil.getFirstItem(InstructionBuilder.addAssertInstructions(myBuilder, negativeAssertionEvaluator));
      if (instruction != null) {
        lastBranchingPoints.forEach(p -> myBuilder.addEdge(p.getSecond(), instruction));
      }
      else {
        lastBranchingPoints.forEach(pair -> myBuilder.addPendingEdge(pair.getFirst(), pair.getSecond()));
      }

      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }
  }

  @NotNull
  private Triple<PyExpression, List<Pair<PsiElement, Instruction>>, Boolean> visitPyIfPart(@NotNull PyIfPart part,
                                                                                @NotNull PyIfStatement node) {
    final PyExpression condition = part.getCondition();
    final PyTypeAssertionEvaluator assertionEvaluator = new PyTypeAssertionEvaluator();
    final Boolean conditionResult = PyEvaluator.evaluateAsBooleanNoResolve(condition);

    if (condition != null) {
      condition.accept(this);
      condition.accept(assertionEvaluator);
    }

    final List<Pair<PsiElement, Instruction>> branchingPoints = getPrevInstructions(condition);
    if (conditionResult != Boolean.FALSE) {
      // edges to the statement list under `if` would be created below if condition were not evaluated to `False`
      branchingPoints.forEach(pair -> myBuilder.addPendingEdge(pair.getFirst(), pair.getSecond()));
    }
    myBuilder.prevInstruction = null;

    visitPyIfPartStatements(part, assertionEvaluator, node);

    return new Triple<>(condition, branchingPoints, conditionResult);
  }

  private void visitPyIfPartStatements(@NotNull PyIfPart part,
                                       @NotNull PyTypeAssertionEvaluator assertionEvaluator,
                                       @NotNull PyIfStatement node) {
    final PyStatementList statements = part.getStatementList();

    myBuilder.startConditionalNode(statements, part.getCondition(), true);
    InstructionBuilder.addAssertInstructions(myBuilder, assertionEvaluator);
    statements.accept(this);

    myBuilder.processPending(
      (pendingScope, instruction) -> {
        if (pendingScope != null && PsiTreeUtil.isAncestor(statements, pendingScope, false)) {
          myBuilder.addPendingEdge(node, instruction);
        }
        else {
          myBuilder.addPendingEdge(pendingScope, instruction);
        }
      }
    );

    myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
  }

  @Override
  public void visitPyBinaryExpression(PyBinaryExpression node) {
    final PyElementType operator = node.getOperator();
    if (operator == PyTokenTypes.AND_KEYWORD || operator == PyTokenTypes.OR_KEYWORD) {
      myBuilder.startNode(node);
      final PyTypeAssertionEvaluator assertionEvaluator = new PyTypeAssertionEvaluator(operator == PyTokenTypes.AND_KEYWORD);

      final PyExpression left = node.getLeftExpression();
      if (left != null) {
        left.accept(this);
        left.accept(assertionEvaluator);
        myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
      }

      final PyExpression right = node.getRightExpression();
      if (right != null) {
        InstructionBuilder.addAssertInstructions(myBuilder, assertionEvaluator);
        right.accept(this);
        myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
      }
    }
    else {
      super.visitPyBinaryExpression(node);
    }
  }

  @Override
  public void visitPyWhileStatement(final PyWhileStatement node) {
    final Instruction instruction = myBuilder.startNode(node);
    final PyWhilePart whilePart = node.getWhilePart();
    final PyExpression condition = whilePart.getCondition();
    boolean isStaticallyTrue = false;
    if (condition != null) {
      condition.accept(this);
      isStaticallyTrue = PyEvaluator.evaluateAsBooleanNoResolve(condition, false);
    }
    final Instruction head = myBuilder.prevInstruction;
    final PyElsePart elsePart = node.getElsePart();
    if (elsePart == null && !isStaticallyTrue) {
      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }
    final PyStatementList list = whilePart.getStatementList();
    myBuilder.startConditionalNode(list, condition, true);
    list.accept(this);
    // Loop edges
    if (myBuilder.prevInstruction != null) {
      myBuilder.addEdge(myBuilder.prevInstruction, instruction);
    }
    myBuilder.checkPending(instruction);

    if (elsePart != null) {
      myBuilder.prevInstruction = !isStaticallyTrue ? head : null;
      elsePart.accept(this);
      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }

    myBuilder.flowAbrupted();
  }

  @Override
  public void visitPyForStatement(final PyForStatement node) {
    myBuilder.startNode(node);
    final PyForPart forPart = node.getForPart();
    final PyExpression source = forPart.getSource();
    if (source != null) {
      source.accept(this);
    }
    final Instruction head = myBuilder.prevInstruction;
    final PyElsePart elsePart = node.getElsePart();
    if (elsePart == null && !PyEvaluator.evaluateAsBooleanNoResolve(source, false)) {
      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }
    final PyStatementList list = forPart.getStatementList();
    final Instruction body;
    final PyExpression target = forPart.getTarget();
    if (target != null) {
      body = myBuilder.startNode(target);
      target.accept(this);
    }
    else {
      body = myBuilder.startNode(list);
    }
    list.accept(this);
    if (myBuilder.prevInstruction != null) {
      myBuilder.addEdge(myBuilder.prevInstruction, body);  //loop
      myBuilder.addPendingEdge(list, myBuilder.prevInstruction); // exit
    }
    myBuilder.processPending((pendingScope, instruction) -> {
      if (pendingScope != null && PsiTreeUtil.isAncestor(list, pendingScope, false)) {
        myBuilder.addEdge(instruction, body);  //loop
        myBuilder.addPendingEdge(list, instruction); // exit
      }
      else {
        myBuilder.addPendingEdge(pendingScope, instruction);
      }
    });
    myBuilder.prevInstruction = head;
    if (elsePart != null) {
      elsePart.accept(this);
      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
    }
    myBuilder.flowAbrupted();
  }

  @Override
  public void visitPyBreakStatement(final PyBreakStatement node) {
    myBuilder.startNode(node);
    final PyLoopStatement loop = node.getLoopStatement();
    if (loop != null) {
      myBuilder.addPendingEdge(loop, myBuilder.prevInstruction);
    }
    else {
      myBuilder.addPendingEdge(null, myBuilder.prevInstruction);
    }
    myBuilder.flowAbrupted();
  }

  @Override
  public void visitPyContinueStatement(final PyContinueStatement node) {
    myBuilder.startNode(node);
    final PyLoopStatement loop = node.getLoopStatement();
    if (loop != null) {
      final Instruction instruction = myBuilder.findInstructionByElement(loop);
      if (instruction != null) {
        myBuilder.addEdge(myBuilder.prevInstruction, instruction);
      }
      else {
        myBuilder.addPendingEdge(null, null);
      }
    }
    myBuilder.flowAbrupted();
  }

  @Override
  public void visitPyYieldExpression(PyYieldExpression node) {
    myBuilder.startNode(node);
    final PyExpression expression = node.getExpression();
    if (expression != null) {
      expression.accept(this);
    }
  }

  @Override
  public void visitPyRaiseStatement(final PyRaiseStatement node) {
    myBuilder.startNode(node);
    final PyExpression[] expressions = node.getExpressions();
    for (PyExpression expression : expressions) {
      expression.accept(this);
    }

    myBuilder.processPending((pendingScope, instruction) -> {
      final PsiElement pendingElement = instruction.getElement();
      if (pendingElement != null && PsiTreeUtil.isAncestor(node, pendingElement, false)) {
        myBuilder.addEdge(null, instruction);
      }
      else {
        myBuilder.addPendingEdge(pendingScope, instruction);
      }
    });
    myBuilder.addPendingEdge(null, myBuilder.prevInstruction);
    myBuilder.flowAbrupted();
  }

  @Override
  public void visitPyReturnStatement(final PyReturnStatement node) {
    myBuilder.startNode(node);
    final PyExpression expression = node.getExpression();
    if (expression != null) {
      expression.accept(this);
    }
    abruptFlow(node);
  }

  @Override
  public void visitPyTryExceptStatement(final PyTryExceptStatement node) {
    myBuilder.startNode(node);

    // Process try part
    final PyTryPart tryPart = node.getTryPart();
    myBuilder.startNode(tryPart);
    tryPart.accept(this);

    // Goto else part after execution, or exit
    final PyElsePart elsePart = node.getElsePart();
    if (elsePart != null) {
      myBuilder.startNode(elsePart);
      elsePart.accept(this);
    }
    myBuilder.addPendingEdge(node, myBuilder.prevInstruction);

    // Process except parts
    final List<Instruction> exceptInstructions = new ArrayList<>();
    List<Pair<PsiElement, Instruction>> pendingBackup = new ArrayList<>();
    for (PyExceptPart exceptPart : node.getExceptParts()) {
      pendingBackup.addAll(myBuilder.pending);
      myBuilder.pending = new ArrayList<>();
      myBuilder.flowAbrupted();
      final Instruction exceptInstruction = myBuilder.startNode(exceptPart);
      exceptPart.accept(this);
      myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
      exceptInstructions.add(exceptInstruction);
    }
    for (Pair<PsiElement, Instruction> pair : pendingBackup) {
      myBuilder.addPendingEdge(pair.first, pair.second);
    }

    final List<Pair<PsiElement, Instruction>> pendingNormalExits = new ArrayList<>();
    final PyFinallyPart finallyPart = node.getFinallyPart();
    final Instruction finallyFailInstruction;

    // Store pending normal exit instructions from try-except-else parts
    if (finallyPart != null) {
      myBuilder.processPending((pendingScope, instruction) -> {
        final PsiElement pendingElement = instruction.getElement();
        if (pendingElement != null) {
          final boolean isPending = PsiTreeUtil.isAncestor(node, pendingElement, false) &&
                                    !PsiTreeUtil.isAncestor(finallyPart, pendingElement, false);
          if (isPending && pendingScope != null) {
            pendingNormalExits.add(Pair.createNonNull(pendingScope, instruction));
          }
          else {
            myBuilder.addPendingEdge(pendingScope, instruction);
          }
        }
      });
    }

    // Finally-fail part handling
    if (finallyPart != null) {
      myBuilder.flowAbrupted();
      finallyFailInstruction = myBuilder.startNode(finallyPart);
      finallyPart.accept(this);
      myBuilder.addPendingEdge(null, myBuilder.prevInstruction);
      myBuilder.flowAbrupted();
    }
    else {
      finallyFailInstruction = null;
    }

    // Create exception edges
    for (Instruction instruction : myBuilder.instructions) {
      final PsiElement e = instruction.getElement();
      if (e == null || !canRaiseExceptions(instruction)) {
        continue;
      }
      // All instructions inside the try part have edges to except and finally parts
      if (PsiTreeUtil.getParentOfType(e, PyTryPart.class, false) == tryPart) {
        for (Instruction inst : exceptInstructions) {
          myBuilder.addEdge(instruction, inst);
        }
        if (finallyPart != null) {
          myBuilder.addEdge(instruction, finallyFailInstruction);
        }
      }
      if (finallyPart != null) {
        // All instructions inside except parts have edges to the finally part
        for (PyExceptPart exceptPart : node.getExceptParts()) {
          if (PsiTreeUtil.isAncestor(exceptPart, e, false)) {
            myBuilder.addEdge(instruction, finallyFailInstruction);
          }
        }
        // All instructions inside the else part have edges to the finally part
        if (PsiTreeUtil.isAncestor(elsePart, e, false)) {
          myBuilder.addEdge(instruction, finallyFailInstruction);
        }
      }
    }

    if (finallyPart != null) {
      myBuilder.processPending((pendingScope, instruction) -> {
        final PsiElement e = instruction.getElement();
        if (e != null) {
          // Change the scope of pending edges from finally-fail part to point to the last instruction
          if (PsiTreeUtil.isAncestor(finallyPart, e, false)) {
            myBuilder.addPendingEdge(null, instruction);
          }
          // Connect pending fail edges to the finally-fail part
          else if (pendingScope == null && PsiTreeUtil.isAncestor(node, e, false)) {
            myBuilder.addEdge(instruction, finallyFailInstruction);
          }
          else {
            myBuilder.addPendingEdge(pendingScope, instruction);
          }
        }
      });

      // Duplicate CFG for finally (-fail and -success) only if there are some successful exits from the
      // try part. Otherwise a single CFG for finally provides the correct control flow
      final Instruction finallyInstruction;
      if (!pendingNormalExits.isEmpty()) {
        // Finally-success part handling
        pendingBackup = new ArrayList<>(myBuilder.pending);
        myBuilder.pending = new ArrayList<>();
        myBuilder.flowAbrupted();
        final Instruction finallySuccessInstruction = myBuilder.startNode(finallyPart);
        finallyPart.accept(this);
        for (Pair<PsiElement, Instruction> pair : pendingBackup) {
          myBuilder.addPendingEdge(pair.first, pair.second);
        }
        finallyInstruction = finallySuccessInstruction;
      }
      else {
        finallyInstruction = finallyFailInstruction;
      }

      // Connect normal exits from try and else parts to the finally part
      for (Pair<PsiElement, Instruction> pendingScopeAndInstruction : pendingNormalExits) {
        final PsiElement pendingScope = pendingScopeAndInstruction.first;
        final Instruction instruction = pendingScopeAndInstruction.second;

        myBuilder.addEdge(instruction, finallyInstruction);

        // When instruction continues outside of try-except statement scope
        // the last instruction in finally-block is marked as pointing to that continuation
        if (PsiTreeUtil.isAncestor(pendingScope, node, true)) {
          myBuilder.addPendingEdge(pendingScope, myBuilder.prevInstruction);
        }
      }
    }
  }

  @Override
  public void visitPyComprehensionElement(final PyComprehensionElement node) {
    PyExpression prevCondition = null;
    myBuilder.startNode(node);
    List<Instruction> iterators = new ArrayList<>();

    for (PyComprehensionComponent component : node.getComponents()) {
      if (component instanceof PyComprehensionForComponent) {
        final PyComprehensionForComponent c = (PyComprehensionForComponent)component;
        final PyExpression iteratedList = c.getIteratedList();
        final PyExpression iteratorVariable = c.getIteratorVariable();
        if (prevCondition != null) {
          myBuilder.startConditionalNode(iteratedList, prevCondition, true);
          prevCondition = null;
        }
        else {
          myBuilder.startNode(iteratedList);
        }
        iteratedList.accept(this);

        // for-loop continue and exit
        for (Instruction i : iterators) {
          myBuilder.addEdge(myBuilder.prevInstruction, i);
        }
        myBuilder.addPendingEdge(node, myBuilder.prevInstruction);

        final Instruction iterator = myBuilder.startNode(iteratorVariable);
        iteratorVariable.accept(this);

        // Inner "for" and "if" constructs will be linked to all outer iterators
        iterators.add(iterator);
      }
      else if (component instanceof PyComprehensionIfComponent) {
        final PyComprehensionIfComponent c = (PyComprehensionIfComponent)component;
        final PyExpression condition = c.getTest();
        if (condition == null) {
          continue;
        }
        if (prevCondition != null) {
          myBuilder.startConditionalNode(condition, prevCondition, true);
        }
        else {
          myBuilder.startNode(condition);
        }
        final PyTypeAssertionEvaluator assertionEvaluator = new PyTypeAssertionEvaluator();
        condition.accept(this);
        condition.accept(assertionEvaluator);
        InstructionBuilder.addAssertInstructions(myBuilder, assertionEvaluator);

        // Condition is true for nested "for" and "if" constructs, next startNode() should create a conditional node
        prevCondition = condition;

        // for-loop continue and exit
        for (Instruction i : iterators) {
          myBuilder.addEdge(myBuilder.prevInstruction, i);
        }
        myBuilder.addPendingEdge(node, myBuilder.prevInstruction);
      }
    }

    final PyExpression result = node.getResultExpression();
    if (result != null) {
      if (prevCondition != null) {
        myBuilder.startConditionalNode(result, prevCondition, true);
      }
      else {
        myBuilder.startNode(result);
      }
      result.accept(this);

      // for-loop continue
      for (Instruction i : iterators) {
        myBuilder.addEdge(myBuilder.prevInstruction, i);
      }
    }
  }

  @Override
  public void visitPyAssertStatement(final PyAssertStatement node) {
    myBuilder.startNode(node);
    super.visitPyAssertStatement(node);
    final PyExpression[] args = node.getArguments();
    // assert False
    if (args.length >= 1 && !PyEvaluator.evaluateAsBooleanNoResolve(args[0], true)) {
      abruptFlow(node);
      return;
    }
    PyTypeAssertionEvaluator evaluator = new PyTypeAssertionEvaluator();
    node.acceptChildren(evaluator);
    InstructionBuilder.addAssertInstructions(myBuilder, evaluator);
  }

  @Override
  public void visitPyLambdaExpression(final PyLambdaExpression node) {
    myBuilder.startNode(node);
    visitParameterListExpressions(node.getParameterList());
  }

  @Override
  public void visitPyWithStatement(final PyWithStatement node) {
    super.visitPyWithStatement(node);
    myBuilder.processPending((pendingScope, instruction) -> {
      final PsiElement element = instruction.getElement();
      if (element != null && PsiTreeUtil.isAncestor(node, element, true) &&
          PsiTreeUtil.getParentOfType(element, PyRaiseStatement.class) != null) {
        myBuilder.addPendingEdge(node, instruction);
      }
      myBuilder.addPendingEdge(pendingScope, instruction);
    });
  }

  private void abruptFlow(final PsiElement node) {
    // Here we process pending instructions!!!
    myBuilder.processPending((pendingScope, instruction) -> {
      if (pendingScope != null && PsiTreeUtil.isAncestor(node, pendingScope, false)) {
        myBuilder.addPendingEdge(null, instruction);
      }
      else {
        myBuilder.addPendingEdge(pendingScope, instruction);
      }
    });
    myBuilder.addPendingEdge(null, myBuilder.prevInstruction);
    myBuilder.flowAbrupted();
  }

  private static boolean canRaiseExceptions(final Instruction instruction) {
    if (instruction instanceof ReadWriteInstruction) {
      return true;
    }
    return !PsiTreeUtil.instanceOf(instruction.getElement(),
                                   PyStatementList.class);
  }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/bootstrap-theme.min.css">
        <link rel="stylesheet" href="css/font-awesome.min.css">
        <link rel="stylesheet" href="css/select2.css">
        <link rel="stylesheet" href="css/select2-bootstrap.css">
        <link rel="stylesheet" href="css/main.css">


text:
package lc.countprimes;

import java.util.Arrays;

// Count the number of primes which is smaller than a given non-negative number, n.
// TAKE HEED TO overflow case of int in such problems.
public class Solution {
  public int countPrimes(int n) {
    if (n <= 2)
      return 0;
    // what is n is very large? what is the range of n?
    boolean[] isPrime = new boolean[n];
    Arrays.fill(isPrime, true);
    int count = 0;
    // this approach is taught in Berkerly CS61B. The idea is using the multiples of primes to
    // filter out non-primes. What about the runtime of the alg? O(n * ?), space: O(n)
    for (long i = 2; i < n; i++) {
      if (isPrime[(int) i]) {
        count++;
        // start from i * i, due to that (i - 1) * i had been computed in iteration wrt i - 1
        long factor = i;
        while (factor * i < n) {  // this can cause overflow error if factor and i are all int
          isPrime[(int) (factor * i)] = false;
          factor++;
        }
      }
    }

    return count;
  }
}


text:
/**
 * This script builds a production output of all of our bundles.
 */

import webpack from 'webpack';
import appRootDir from 'app-root-dir';
import { resolve as pathResolve } from 'path';
import webpackConfigFactory from '../webpack/configFactory';
import { exec } from '../utils';
import config from '../../config';

// eslint-disable-next-line no-unused-vars
const [x, y, ...args] = process.argv;

const optimize = args.findIndex(arg => arg === '--optimize') !== -1;

// First clear the build output dir.
exec(`rimraf ${pathResolve(appRootDir.get(), config('buildOutputPath'))}`);

// Get our "fixed" bundle names
Object.keys(config('bundles'))
  // And the "additional" bundle names
  .concat(Object.keys(config('additionalNodeBundles')))
  // And then build them all.
  .forEach((bundleName) => {
    const compiler = webpack(webpackConfigFactory({ target: bundleName, optimize }));
    compiler.run((err, stats) => {
      if (err) {
        console.error(err);
        return;
      }
      console.log(stats.toString({ colors: true }));
    });
  });


text:
'use strict';

var Hapi = require('hapi');

var server = new Hapi.Server();

if( process.env.PORT ) {
  server.connection({ port: process.env.PORT });
}
else {
  server.connection({ port: 1337 });
}

/*
server.route({
  method: 'GET',
  path: '/',
  handler: function (request, reply) {
    reply('Hello, world!');
  }
});

server.route({
  method: 'GET',
  path: '/{name}',
  handler: function (request, reply) {
    reply('Hello, ' + encodeURIComponent(request.params.name) + '!');
  }
});
*/

server.route({
  method : "GET",
  path : '/assets/{param*}',
  handler : {
    directory : {
      path : 'bower_components',
  listing : true
    }
  }
});

server.route({
  method : "GET",
  path : '/{param*}',
  handler : {
    directory : {
      path : 'public',
  listing : true
    }
  }
});

server.start(function () {
  console.log('Server running at:', server.info.uri);
});


text:
<?php

namespace Api\Taobao\Request;
/**
 * TOP API: taobao.ump.activity.add request
 *
 * @author auto create
 * @since 1.0, 2014-03-20 13:15:50
 */
class UmpActivityAddRequest
{
	/**
	 * 活动内容,通过ump sdk里面的MarkeitngTool来生成
	 **/
	private $content;

	/**
	 * 工具id
	 **/
	private $toolId;

	private $apiParas = array();

	public function setContent($content)
	{
		$this->content = $content;
		$this->apiParas["content"] = $content;
	}

	public function getContent()
	{
		return $this->content;
	}

	public function setToolId($toolId)
	{
		$this->toolId = $toolId;
		$this->apiParas["tool_id"] = $toolId;
	}

	public function getToolId()
	{
		return $this->toolId;
	}

	public function getApiMethodName()
	{
		return "taobao.ump.activity.add";
	}

	public function getApiParas()
	{
		return $this->apiParas;
	}

	public function check()
	{

		\Api\Taobao\RequestCheckUtil::checkNotNull($this->content,"content");
		\Api\Taobao\RequestCheckUtil::checkNotNull($this->toolId,"toolId");
	}

	public function putOtherTextParam($key, $value) {
		$this->apiParas[$key] = $value;
		$this->$key = $value;
	}
}


text:
package datastore

import (
	"testing"

	"github.com/treeder/functions/api/datastore/internal/datastoretest"
)

func TestDatastore(t *testing.T) {
	datastoretest.Test(t, NewMock())
}


text:
layout: default
title: "arcgis-insights cookbook"
category: cookbooks
item: arcgis-insights
version: 4.0.0
latest: true
---

# arcgis-insights cookbook

This cookbook installs and configures ArcGIS Insights.

## Supported ArcGIS Insights versions

* 2020.1
* 2020.2
* 2020.3
* 2021.1
* 2021.1.1
* 2021.2
* 2021.2.1
* 2021.3
* 2021.3.1
* 2022.1
* 2022.1.1
* 2022.2

## Platforms

* Windows 10
* Windows Server 2012 (R2)
* Windows Server 2016
* Windows Server 2019
* Windows Server 2022
* Ubuntu Server 18.04 and 20.04 LTS
* Red Hat Enterprise Linux Server 8
* SUSE Linux Enterprise Server 15
* Oracle Linux 8

## Dependencies

The following cookbooks are required:

* arcgis-enterprise
* arcgis-repository

## Attributes

* `node['arcgis']['insights']['version']` = ArcGIS Insights version. Default version is `2022.2`
* `node['arcgis']['insights']['setup_archive']` = Path to the ArcGIS Insights setup archive. Default value depends on `node['arcgis']['insights']['version']` attribute value.
* `node['arcgis']['insights']['setup']` = The location of the ArcGIS Insights setup executable. Default location is `%USERPROFILE%\\Documents\\ArcGIS Insights 2022.2\\Insights\Setup.exe` on Windows and `/opt/arcgis/Insights/Insights-Setup.sh` on Linux.
* `node['arcgis']['insights']['patches]` = File names of ArcGIS Insights patches to install. Default value is `[]`.

## Recipes

### default

Installs and configures ArcGIS Insights.

Attributes used by the recipe:

```JSON
{
  "arcgis": {
    "version": "11.0",
    "run_as_user": "arcgis",
    "run_as_password": "Pa$$w0rdPa$$w0rd",
    "server": {
      "install_dir": "C:\\Program Files\\ArcGIS",
    },
    "insights": {
      "version": "2022.2",
      "setup": "%USERPROFILE%\\Documents\\ArcGIS Insights 2022.2\\Insights\\Setup.exe"
    }
  },
  "run_list": [
    "recipe[arcgis-insights]"
  ]
}
```

> ArcGIS Server or Portal for ArcGIS must be installed on the machine before running the arcgis-insights::default recipe.

### install_patches

Installs patches for ArcGIS Insights. The recipe installs patches from the patches folder specified by the arcgis.insights.patches attribute. The patch names may contain a wildcard '\*'. For example, "ArcGIS-1091-\*.msp" specifies all .msp patches that start with "ArcGIS-1091-".

Attributes used by the recipe:

```JSON
{
  "arcgis" : {
    "repository" : {
      "patches" : "%USERPROFILE%\\Software\\Esri\\patches"
    },
    "insights": {
      "patches": ["patch1.msp", "patch2.msp"]
    }
  },
  "run_list": [
    "recipe[arcgis-insights::install_patches]"
  ]
}
```

### uninstall

Uninstalls ArcGIS Insights.

Attributes used by the recipe:

```JSON
{
  "arcgis": {
    "version": "11.0",
    "run_as_user": "arcgis",
    "server": {
      "install_dir": "C:\\Program Files (x86)\\ArcGIS"
    },
    "insights": {
      "version": "2022.2"
     }
  },
  "run_list":[
    "recipe[arcgis-insights::uninstall]"
  ]
}
```


text:
package org.atreus.core.tests.entities.functional;

import org.atreus.core.annotations.AtreusEntity;
import org.atreus.core.annotations.AtreusPrimaryKey;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.InetAddress;
import java.util.Date;
import java.util.UUID;

/**
 * CQLPrimitiveTypesTestEntity.
 *
 * @author Martin Crawford
 */
@AtreusEntity()
public class CQLPrimitiveTypesTestEntity {

  // Constants ---------------------------------------------------------------------------------------------- Constants

  // Instance Variables ---------------------------------------------------------------------------- Instance Variables

  @AtreusPrimaryKey
  private String id;

  private BigDecimal aBigDecimal;

  private BigInteger aBigInteger;

  private boolean aBoolean;

  private Date aDate;

  private double aDouble;

  private float aFloat;

  private InetAddress anInetAddress;

  private int aInteger;

  private long aLong;

  private String aString;

  private UUID aUuid;

  // Constructors ---------------------------------------------------------------------------------------- Constructors

  // Public Methods ------------------------------------------------------------------------------------ Public Methods

  // Protected Methods ------------------------------------------------------------------------------ Protected Methods

  // Private Methods ---------------------------------------------------------------------------------- Private Methods

  // Getters & Setters ------------------------------------------------------------------------------ Getters & Setters

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public BigDecimal getaBigDecimal() {
    return aBigDecimal;
  }

  public void setaBigDecimal(BigDecimal aBigDecimal) {
    this.aBigDecimal = aBigDecimal;
  }

  public BigInteger getaBigInteger() {
    return aBigInteger;
  }

  public void setaBigInteger(BigInteger aBigInteger) {
    this.aBigInteger = aBigInteger;
  }

  public boolean isaBoolean() {
    return aBoolean;
  }

  public void setaBoolean(boolean aBoolean) {
    this.aBoolean = aBoolean;
  }

  public Date getaDate() {
    return aDate;
  }

  public void setaDate(Date aDate) {
    this.aDate = aDate;
  }

  public double getaDouble() {
    return aDouble;
  }

  public void setaDouble(double aDouble) {
    this.aDouble = aDouble;
  }

  public float getaFloat() {
    return aFloat;
  }

  public void setaFloat(float aFloat) {
    this.aFloat = aFloat;
  }

  public InetAddress getAnInetAddress() {
    return anInetAddress;
  }

  public void setAnInetAddress(InetAddress anInetAddress) {
    this.anInetAddress = anInetAddress;
  }

  public int getaInteger() {
    return aInteger;
  }

  public void setaInteger(int aInteger) {
    this.aInteger = aInteger;
  }

  public long getaLong() {
    return aLong;
  }

  public void setaLong(long aLong) {
    this.aLong = aLong;
  }

  public String getaString() {
    return aString;
  }

  public void setaString(String aString) {
    this.aString = aString;
  }

  public UUID getaUuid() {
    return aUuid;
  }

  public void setaUuid(UUID aUuid) {
    this.aUuid = aUuid;
  }

}


text:
require "locomotive_contrib/engine"

module LocomotiveContrib
end


text:
class ReportGrid
{
public:
	ReportGrid(const uint32 &width, const uint32 &height);
	~ReportGrid(void);

	const char *RowTitle(const int32 &index);
	void SetRowTitle(const int32 &index, const char *title);
	int32 FindTitle(const char *title);

	status_t ValueAt(const uint32 &x, const uint32 &y, Fixed &fixed);
	status_t SetValue(const uint32 &x, const uint32 &y, const Fixed &fixed);

	void AddItem(const int32 &index = -1);
	void RemoveItem(const int32 &index);

	int32 CountItems(void) const { return fList.CountItems(); }
	void MakeEmpty(void);

	void Sort(void);

	void PrintToStream(void);

	uint32 Width(void) const { return fWidth; }
	uint32 Height(void) const { return (uint32)fList.CountItems(); }

private:

	class GridRecord
	{
		public:
			GridRecord(const uint32 &size, const char *title = NULL);
			~GridRecord(void);

			const char *Title(void) const { return fTitle.String(); }
			void SetTitle(const char *title) { fTitle = title; }

			status_t ValueAt(const uint32 &index, Fixed &fixed);
			status_t SetValue(const uint32 &index, const Fixed &fixed);
		private:
			BObjectList<Fixed> fList;
			BString fTitle;
	};

	static int CompareGridrecord(const GridRecord *item1, const GridRecord *item2);

	BObjectList<GridRecord> fList;
	uint32 fWidth;
};

#endif


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
var loaderUtils = require("loader-utils");
var processCss = require("./processCss");
var getImportPrefix = require("./getImportPrefix");

module.exports = function(content) {
	if(this.cacheable) this.cacheable();
	var query = loaderUtils.parseQuery(this.query);
	var moduleMode = query.modules || query.module;

	var result = processCss(content, null, {
		mode: moduleMode ? "local" : "global",
		query: query,
		minimize: this.minimize,
		loaderContext: this
	});

	// for importing CSS
	var importUrlPrefix = getImportPrefix(this, query);

	function importItemMatcher(item) {
		var match = result.importItemRegExp.exec(item);
		var idx = +match[1];
		var importItem = result.importItems[idx];
		var importUrl = importUrlPrefix + importItem.url;
		return "\" + require(" + loaderUtils.stringifyRequest(this, importUrl) + ")" +
			"[" + JSON.stringify(importItem.export) + "] + \"";
	}

	var exportJs = "";
	if(Object.keys(result.exports).length > 0) {
		exportJs = Object.keys(result.exports).map(function(key) {
			var valueAsString = JSON.stringify(result.exports[key]);
			valueAsString = valueAsString.replace(result.importItemRegExpG, importItemMatcher.bind(this));
			return "\t" + JSON.stringify(key) + ": " + valueAsString;
		}.bind(this)).join(",\n");
		exportJs = "module.exports = {\n" + exportJs + "\n};";
	}

	return exportJs;
};