text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.drizzleCakeAmmount = New System.Windows.Forms.NumericUpDown()
        Me.cupCakeAmmount = New System.Windows.Forms.NumericUpDown()
        Me.smallPlainFlourBox = New System.Windows.Forms.Label()
        Me.smallSugarBox = New System.Windows.Forms.Label()
        Me.smallButterBox = New System.Windows.Forms.Label()
        Me.mediumFlourBox = New System.Windows.Forms.Label()
        Me.mediumButterBox = New System.Windows.Forms.Label()
        Me.mediumSugarBox = New System.Windows.Forms.Label()
        Me.largeSugarBox = New System.Windows.Forms.Label()
        Me.largeFlourBox = New System.Windows.Forms.Label()
        Me.largeButterBox = New System.Windows.Forms.Label()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.plainFlourAmmount = New System.Windows.Forms.Label()
        Me.sugarAmmount = New System.Windows.Forms.Label()
        Me.butterAmmount = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.Label11 = New System.Windows.Forms.Label()
        CType(Me.drizzleCakeAmmount, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.cupCakeAmmount, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'drizzleCakeAmmount
        '
        Me.drizzleCakeAmmount.Location = New System.Drawing.Point(273, 25)
        Me.drizzleCakeAmmount.Name = "drizzleCakeAmmount"
        Me.drizzleCakeAmmount.Size = New System.Drawing.Size(120, 20)
        Me.drizzleCakeAmmount.TabIndex = 0
        '
        'cupCakeAmmount
        '
        Me.cupCakeAmmount.Location = New System.Drawing.Point(273, 59)
        Me.cupCakeAmmount.Name = "cupCakeAmmount"
        Me.cupCakeAmmount.Size = New System.Drawing.Size(120, 20)
        Me.cupCakeAmmount.TabIndex = 1
        '
        'smallPlainFlourBox
        '
        Me.smallPlainFlourBox.AutoSize = True
        Me.smallPlainFlourBox.Location = New System.Drawing.Point(281, 247)
        Me.smallPlainFlourBox.Name = "smallPlainFlourBox"
        Me.smallPlainFlourBox.Size = New System.Drawing.Size(13, 13)
        Me.smallPlainFlourBox.TabIndex = 2
        Me.smallPlainFlourBox.Text = "0"
        '
        'smallSugarBox
        '
        Me.smallSugarBox.AutoSize = True
        Me.smallSugarBox.Location = New System.Drawing.Point(281, 306)
        Me.smallSugarBox.Name = "smallSugarBox"
        Me.smallSugarBox.Size = New System.Drawing.Size(13, 13)
        Me.smallSugarBox.TabIndex = 3
        Me.smallSugarBox.Text = "0"
        '
        'smallButterBox
        '
        Me.smallButterBox.AutoSize = True
        Me.smallButterBox.Location = New System.Drawing.Point(281, 360)
        Me.smallButterBox.Name = "smallButterBox"
        Me.smallButterBox.Size = New System.Drawing.Size(13, 13)
        Me.smallButterBox.TabIndex = 4
        Me.smallButterBox.Text = "0"
        '
        'mediumFlourBox
        '
        Me.mediumFlourBox.AutoSize = True
        Me.mediumFlourBox.Location = New System.Drawing.Point(202, 247)
        Me.mediumFlourBox.Name = "mediumFlourBox"
        Me.mediumFlourBox.Size = New System.Drawing.Size(13, 13)
        Me.mediumFlourBox.TabIndex = 5
        Me.mediumFlourBox.Text = "0"
        '
        'mediumButterBox
        '
        Me.mediumButterBox.AutoSize = True
        Me.mediumButterBox.Location = New System.Drawing.Point(202, 360)
        Me.mediumButterBox.Name = "mediumButterBox"
        Me.mediumButterBox.Size = New System.Drawing.Size(13, 13)
        Me.mediumButterBox.TabIndex = 6
        Me.mediumButterBox.Text = "0"
        '
        'mediumSugarBox
        '
        Me.mediumSugarBox.AutoSize = True
        Me.mediumSugarBox.Location = New System.Drawing.Point(202, 306)
        Me.mediumSugarBox.Name = "mediumSugarBox"
        Me.mediumSugarBox.Size = New System.Drawing.Size(13, 13)
        Me.mediumSugarBox.TabIndex = 7
        Me.mediumSugarBox.Text = "0"
        '
        'largeSugarBox
        '
        Me.largeSugarBox.AutoSize = True
        Me.largeSugarBox.Location = New System.Drawing.Point(131, 306)
        Me.largeSugarBox.Name = "largeSugarBox"
        Me.largeSugarBox.Size = New System.Drawing.Size(13, 13)
        Me.largeSugarBox.TabIndex = 8
        Me.largeSugarBox.Text = "0"
        '
        'largeFlourBox
        '
        Me.largeFlourBox.AutoSize = True
        Me.largeFlourBox.Location = New System.Drawing.Point(131, 247)
        Me.largeFlourBox.Name = "largeFlourBox"
        Me.largeFlourBox.Size = New System.Drawing.Size(13, 13)
        Me.largeFlourBox.TabIndex = 9
        Me.largeFlourBox.Text = "0"
        '
        'largeButterBox
        '
        Me.largeButterBox.AutoSize = True
        Me.largeButterBox.Location = New System.Drawing.Point(131, 360)
        Me.largeButterBox.Name = "largeButterBox"
        Me.largeButterBox.Size = New System.Drawing.Size(13, 13)
        Me.largeButterBox.TabIndex = 10
        Me.largeButterBox.Text = "0"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(185, 96)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(75, 23)
        Me.Button1.TabIndex = 11
        Me.Button1.Text = "Enter"
        Me.Button1.UseVisualStyleBackColor = True
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(185, 405)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(75, 23)
        Me.Button2.TabIndex = 12
        Me.Button2.Text = "Reset"
        Me.Button2.UseVisualStyleBackColor = True
        '
        'plainFlourAmmount
        '
        Me.plainFlourAmmount.AutoSize = True
        Me.plainFlourAmmount.Location = New System.Drawing.Point(101, 176)
        Me.plainFlourAmmount.Name = "plainFlourAmmount"
        Me.plainFlourAmmount.Size = New System.Drawing.Size(13, 13)
        Me.plainFlourAmmount.TabIndex = 13
        Me.plainFlourAmmount.Text = "0"
        '
        'sugarAmmount
        '
        Me.sugarAmmount.AutoSize = True
        Me.sugarAmmount.Location = New System.Drawing.Point(233, 176)
        Me.sugarAmmount.Name = "sugarAmmount"
        Me.sugarAmmount.Size = New System.Drawing.Size(13, 13)
        Me.sugarAmmount.TabIndex = 14
        Me.sugarAmmount.Text = "0"
        '
        'butterAmmount
        '
        Me.butterAmmount.AutoSize = True
        Me.butterAmmount.Location = New System.Drawing.Point(373, 176)
        Me.butterAmmount.Name = "butterAmmount"
        Me.butterAmmount.Size = New System.Drawing.Size(13, 13)
        Me.butterAmmount.TabIndex = 15
        Me.butterAmmount.Text = "0"
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(72, 247)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(30, 13)
        Me.Label1.TabIndex = 16
        Me.Label1.Text = "Flour"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(69, 360)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(35, 13)
        Me.Label2.TabIndex = 17
        Me.Label2.Text = "Butter"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(69, 306)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(35, 13)
        Me.Label3.TabIndex = 18
        Me.Label3.Text = "Sugar"
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.Location = New System.Drawing.Point(202, 220)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(44, 13)
        Me.Label4.TabIndex = 19
        Me.Label4.Text = "Medium"
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.Location = New System.Drawing.Point(131, 220)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(34, 13)
        Me.Label5.TabIndex = 20
        Me.Label5.Text = "Large"
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.Location = New System.Drawing.Point(281, 220)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(32, 13)
        Me.Label6.TabIndex = 21
        Me.Label6.Text = "Small"
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.Location = New System.Drawing.Point(6, 176)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(89, 13)
        Me.Label7.TabIndex = 22
        Me.Label7.Text = "Flour Ammount(g)"
        '
        'Label8
        '
        Me.Label8.AutoSize = True
        Me.Label8.Location = New System.Drawing.Point(136, 176)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(94, 13)
        Me.Label8.TabIndex = 23
        Me.Label8.Text = "Sugar Ammount(g)"
        '
        'Label9
        '
        Me.Label9.AutoSize = True
        Me.Label9.Location = New System.Drawing.Point(273, 176)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(94, 13)
        Me.Label9.TabIndex = 24
        Me.Label9.Text = "Butter Ammount(g)"
        '
        'Label10
        '
        Me.Label10.AutoSize = True
        Me.Label10.Location = New System.Drawing.Point(17, 25)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(201, 13)
        Me.Label10.TabIndex = 25
        Me.Label10.Text = "Enter how many Drizzle-Cakes you desire"
        '
        'Label11
        '
        Me.Label11.AutoSize = True
        Me.Label11.Location = New System.Drawing.Point(17, 66)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(240, 13)
        Me.Label11.TabIndex = 26
        Me.Label11.Text = "Enter how many Chocolate Cup Cakes you desire"
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(443, 452)
        Me.Controls.Add(Me.Label11)
        Me.Controls.Add(Me.Label10)
        Me.Controls.Add(Me.Label9)
        Me.Controls.Add(Me.Label8)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.butterAmmount)
        Me.Controls.Add(Me.sugarAmmount)
        Me.Controls.Add(Me.plainFlourAmmount)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.largeButterBox)
        Me.Controls.Add(Me.largeFlourBox)
        Me.Controls.Add(Me.largeSugarBox)
        Me.Controls.Add(Me.mediumSugarBox)
        Me.Controls.Add(Me.mediumButterBox)
        Me.Controls.Add(Me.mediumFlourBox)
        Me.Controls.Add(Me.smallButterBox)
        Me.Controls.Add(Me.smallSugarBox)
        Me.Controls.Add(Me.smallPlainFlourBox)
        Me.Controls.Add(Me.cupCakeAmmount)
        Me.Controls.Add(Me.drizzleCakeAmmount)
        Me.Name = "Form1"
        Me.Text = "Form1"
        CType(Me.drizzleCakeAmmount, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.cupCakeAmmount, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents drizzleCakeAmmount As System.Windows.Forms.NumericUpDown
    Friend WithEvents cupCakeAmmount As System.Windows.Forms.NumericUpDown
    Friend WithEvents smallPlainFlourBox As System.Windows.Forms.Label
    Friend WithEvents smallSugarBox As System.Windows.Forms.Label
    Friend WithEvents smallButterBox As System.Windows.Forms.Label
    Friend WithEvents mediumFlourBox As System.Windows.Forms.Label
    Friend WithEvents mediumButterBox As System.Windows.Forms.Label
    Friend WithEvents mediumSugarBox As System.Windows.Forms.Label
    Friend WithEvents largeSugarBox As System.Windows.Forms.Label
    Friend WithEvents largeFlourBox As System.Windows.Forms.Label
    Friend WithEvents largeButterBox As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents plainFlourAmmount As System.Windows.Forms.Label
    Friend WithEvents sugarAmmount As System.Windows.Forms.Label
    Friend WithEvents butterAmmount As System.Windows.Forms.Label
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents Label11 As System.Windows.Forms.Label

End Class


text:
package com.fishercoder;

import com.fishercoder.solutions._849;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class _849Test {

    private static _849.Solution1 solution1;
    private static _849.Solution2 solution2;

    @BeforeClass
    public static void setup() {
        solution1 = new _849.Solution1();
        solution2 = new _849.Solution2();
    }

    @Test
    public void test1() {
        assertEquals(2, solution1.maxDistToClosest(new int[]{1, 0, 0, 0, 1, 0, 1}));
        assertEquals(2, solution2.maxDistToClosest(new int[]{1, 0, 0, 0, 1, 0, 1}));
    }

    @Test
    public void test2() {
        assertEquals(3, solution1.maxDistToClosest(new int[]{1, 0, 0, 0}));
        assertEquals(3, solution2.maxDistToClosest(new int[]{1, 0, 0, 0}));
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.finos.waltz.service.physical_specification_data_type;

import org.finos.waltz.data.datatype_decorator.PhysicalSpecDecoratorDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static org.finos.waltz.common.Checks.checkNotNull;

@Service
public class PhysicalSpecDataTypeService {

    private final PhysicalSpecDecoratorDao physicalSpecDecoratorDao;

    @Autowired
    public PhysicalSpecDataTypeService(PhysicalSpecDecoratorDao physicalSpecDecoratorDao) {
        checkNotNull(physicalSpecDecoratorDao, "physicalSpecDataTypeDecoratorDao cannot be null");
        this.physicalSpecDecoratorDao = physicalSpecDecoratorDao;
    }

    public int rippleDataTypesToLogicalFlows() {
        return physicalSpecDecoratorDao.rippleDataTypesToLogicalFlows();
    }

}


text:
package pangpang.MainGameLeemJinMuSSang;

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

import javax.microedition.khronos.opengles.GL10;

import jrcengine.Basic.GL_Screen;
import jrcengine.GL.GL_Animation;
import jrcengine.GL.GL_Camera2D;
import jrcengine.GL.GL_SpriteBatcher;
import jrcengine.GL.GL_TextureRegion;
import jrcengine.Interface.IFace_Game;
import jrcengine.Interface.IFace_Input.TouchEvent;
import jrcengine.Interface.Object_Dynamic;
import jrcengine.Manage.Manage_Assets;
import jrcengine.Manage.Manage_Settings;
import jrcengine.Math.Math_Overlap;
import jrcengine.Math.Math_Overlap_Rectangle;
import jrcengine.Math.Math_Vector;

public class PrepareWindow extends GL_Screen {
	private GL_Camera2D guiCam;
	private GL_SpriteBatcher batcher;
	private Math_Vector touchPoint;

	private int nStageNum = 1;
	private LeeSunSin mLeeSunShin;
	private ArrayList<Enemy> enemy;

	private boolean isGamePlayButton;
	private Math_Overlap_Rectangle startButtonBounds;

	private boolean isXbutton;
	private Math_Overlap_Rectangle XbuttonBounds;

	public PrepareWindow(IFace_Game game) {
		super(game);

		this.guiCam = new GL_Camera2D(glGraphics, Screen_MainMenu.GAME_WIDTH,
				Screen_MainMenu.GAME_HEIGHT);
		this.touchPoint = new Math_Vector();
		this.batcher = new GL_SpriteBatcher(glGraphics, 1);

		this.enemy = new ArrayList<Enemy>();
		this.mLeeSunShin = new LeeSunSin(0, 80, 138f, 0);

		if (nStageNum == 1) {
			this.enemy.add(new EnemyGunMan(Screen_MainMenu.GAME_WIDTH - 70,
					100f));
			this.enemy.get(0).setStateFlag(Object_Dynamic.OBJ_D_STOP);
			this.enemy.add(new EnemySwordMan(Screen_MainMenu.GAME_WIDTH - 130,
					100f));
			this.enemy.get(1).setStateFlag(Object_Dynamic.OBJ_D_STOP);
		}

		this.XbuttonBounds = new Math_Overlap_Rectangle(
				Screen_MainMenu.GAME_WIDTH - 35,
				Screen_MainMenu.GAME_HEIGHT - 35, 30, 30);

		this.isGamePlayButton = false;
		this.startButtonBounds = new Math_Overlap_Rectangle(
				Screen_MainMenu.GAME_WIDTH / 2 - 50, 30, 100, 60);
		MainGame_Manager.nStageScore = 0;
		this.isXbutton = false;

	}

	@Override
	public void resume() {
	}

	@Override
	public void pause() {
		Manage_Settings.save(game.getFileIO());
	}

	@Override
	public void update(float deltaTime) {
		List<TouchEvent> touchEvents = game.getInput().getTouchEvents();

		int len = touchEvents.size();
		for (int i = 0; i < len; i++) {
			TouchEvent event = touchEvents.get(i);
			touchPoint.set(event.x, event.y);
			guiCam.touchToWorld(touchPoint);

			if (event.type == TouchEvent.TOUCH_UP) {
				if (Math_Overlap
						.pointInRectangle(startButtonBounds, touchPoint)
						&& true == isGamePlayButton) {
					isGamePlayButton = false;
					game.setScreen(new Screen_MainGame(game));
					return;
				}

				// xButton
				if (Math_Overlap.pointInRectangle(XbuttonBounds, touchPoint)
						&& true == isXbutton) {
					isXbutton = false;
					game.setScreen(new StageWindow(game));
					return;
				}

				this.isXbutton = false;
				this.isGamePlayButton = false;

			}

			if (event.type == TouchEvent.TOUCH_DOWN) {
				if (Math_Overlap
						.pointInRectangle(startButtonBounds, touchPoint)) {
					isGamePlayButton = true;
					return;
				}
				if (Math_Overlap.pointInRectangle(XbuttonBounds, touchPoint)) {

					isXbutton = true;
					return;
				}

				this.isXbutton = false;
				this.isGamePlayButton = false;

			}
		}

		updateObjects(deltaTime);

	}

	private void updateObjects(float deltaTime) {
		this.mLeeSunShin.update(deltaTime);

		for (int i = 0; i < enemy.size(); i++)
			if (enemy.get(i) instanceof EnemySwordMan)
				((EnemySwordMan) enemy.get(i)).update(deltaTime);
			else if (enemy.get(i) instanceof EnemyGunMan)
				((EnemyGunMan) enemy.get(i)).update(deltaTime);
	}

	@Override
	public void present(float deltaTime) {
		GL10 gl = glGraphics.getGL();
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
		guiCam.setViewportAndMatrices();

		gl.glEnable(GL10.GL_TEXTURE_2D);

		batcher.beginBatch(Manage_Assets.ttScrMainMenu);
		batcher.drawSprite(Screen_MainMenu.GAME_WIDTH / 2,
				Screen_MainMenu.GAME_HEIGHT / 2, Screen_MainMenu.GAME_WIDTH,
				Screen_MainMenu.GAME_HEIGHT, Manage_Assets.ttgScrScrMainMenu);
		batcher.endBatch();

		gl.glEnable(GL10.GL_BLEND);
		gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
		// this implimentation object.

		// render_chr_enemy_gun();
		render_enemy();
		render_ally();
		drawPoint();
		// Game Start Button
		batcher.beginBatch(Manage_Assets.ttPrepareSceneGameStartButton);
		if (false == isGamePlayButton)
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH / 2, 50, 100, 60,
					Manage_Assets.ttgGamePreparedSceneGameStart);
		else
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH / 2, 50, 100, 60,
					Manage_Assets.ttgGamePreparedSceneGameStartPressed);
		batcher.endBatch();

		// x button
		batcher.beginBatch(Manage_Assets.ttXbutton);
		if (false == isXbutton)
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH - 20,
					Screen_MainMenu.GAME_HEIGHT - 20, 30, 30,
					Manage_Assets.ttgXButton);
		else
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH - 20,
					Screen_MainMenu.GAME_HEIGHT - 20, 30, 30,
					Manage_Assets.ttgXButtonPressed);
		batcher.endBatch();

		gl.glDisable(GL10.GL_BLEND);
	}

	private void render_ally() {
		GL_TextureRegion _keyFrame;
		_keyFrame = Manage_Assets.aniLeesunsinWalking.getKeyFrame(
				mLeeSunShin.getStateTime(), GL_Animation.ANIMATION_LOOPING);

		batcher.beginBatch(Manage_Assets.ttLeesunsinWalking);

		batcher.drawSprite(mLeeSunShin.position.x, mLeeSunShin.position.y, 282,
				175, _keyFrame);
		batcher.endBatch();
	}

	private void render_enemy() {
		GL_TextureRegion _keyFrame;

		for (int i = 0; i < enemy.size(); i++) {

			if (enemy.get(i) instanceof EnemySwordMan) {
				batcher.beginBatch(Manage_Assets.ttChrEnemySword);
				_keyFrame = Manage_Assets.aniChrEnemySwordMov.getKeyFrame(enemy
						.get(i).getStateTime(), GL_Animation.ANIMATION_LOOPING);
			} else {
				batcher.beginBatch(Manage_Assets.ttChrEnemyGun);
				_keyFrame = Manage_Assets.aniChrEnemyGunMov.getKeyFrame(enemy
						.get(i).getStateTime(), GL_Animation.ANIMATION_LOOPING);
			}
			batcher.drawSprite(enemy.get(i).position.x,
					enemy.get(i).position.y, -180, 100, _keyFrame);
			batcher.endBatch();
		}
	}

	@Override
	public void dispose() {
	}

	private void drawPoint() {
		// draw point 02

		if (1 <= StageWindow.SELECTSTABEMAXNUM) {
			batcher.beginBatch(Manage_Assets.ttScrMainMenuPoint);
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH / 2 + 100,
					Screen_MainMenu.GAME_HEIGHT / 2 - 30, 25, 25,
					Manage_Assets.ttgScrMainMenuPoint);
			batcher.endBatch();
		}

		// draw point 03
		if (2 <= StageWindow.SELECTSTABEMAXNUM) {
			batcher.beginBatch(Manage_Assets.ttScrMainMenuPoint);
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH / 2 + 60,
					Screen_MainMenu.GAME_HEIGHT / 2 - 20, 25, 25,
					Manage_Assets.ttgScrMainMenuPoint);
			batcher.endBatch();
		}
		// draw point 04
		if (3 <= StageWindow.SELECTSTABEMAXNUM) {
			batcher.beginBatch(Manage_Assets.ttScrMainMenuPoint);
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH / 2 + 30,
					Screen_MainMenu.GAME_HEIGHT / 2 - 40, 25, 25,
					Manage_Assets.ttgScrMainMenuPoint);
			batcher.endBatch();
		}
		// draw point 05
		if (4 <= StageWindow.SELECTSTABEMAXNUM) {
			batcher.beginBatch(Manage_Assets.ttScrMainMenuPoint);
			batcher.drawSprite(Screen_MainMenu.GAME_WIDTH / 2,
					Screen_MainMenu.GAME_HEIGHT / 2 - 80, 25, 25,
					Manage_Assets.ttgScrMainMenuPoint);
			batcher.endBatch();
		}
		// draw point 06
		if (5 <= StageWindow.SELECTSTABEMAXNUM) {
			batcher.beginBatch(Manage_Assets.ttScrMainMenuPoint);
			batcher.drawSprite(70, Screen_MainMenu.GAME_HEIGHT / 2 - 80, 25,
					25, Manage_Assets.ttgScrMainMenuPoint);
			batcher.endBatch();
		}
		// draw point 07
		if (6 <= StageWindow.SELECTSTABEMAXNUM) {
			batcher.beginBatch(Manage_Assets.ttScrMainMenuPoint);
			batcher.drawSprite(80, 40, 25, 25,
					Manage_Assets.ttgScrMainMenuPoint);
			batcher.endBatch();
		}
		// draw point 08
		if (7 <= StageWindow.SELECTSTABEMAXNUM) {
			batcher.beginBatch(Manage_Assets.ttScrMainMenuPoint);
			batcher.drawSprite(80, 140, 25, 25,
					Manage_Assets.ttgScrMainMenuPoint);
			batcher.endBatch();
		}
	}
}


text:
Debug = debug.Debug

var exception = null;
var log = [];

function listener(event, exec_state, event_data, data) {
  if (event != Debug.DebugEvent.Break) return;
  try {
    print(event_data.sourceLineText());
    var entry = "";
    for (var i = 0; i < exec_state.frameCount(); i++) {
      entry += exec_state.frame(i).sourceLineText().substr(-1);
      entry += exec_state.frame(i).sourceColumn();
    }
    log.push(entry);
    exec_state.prepareStep(Debug.StepAction.StepIn);
  } catch (e) {
    exception = e;
  }
};

function default_arg(x) {
  return "default";                 // d
}                                   // e

function f(arg0 = default_arg()) {  // f
  return arg0;                      // g
}                                   // h

Debug.setListener(listener);
debugger;                           // a
var result = f();                   // b
Debug.setListener(null);            // c

assertNull(exception);
assertEquals("default", result);

assertEquals(["a0","b13","f18b13","d2f18b13","d19f18b13","g14b13","c0"],
             log);


text:
var dailyCacheUpdate = function() {
    Search = new Mongo.Collection(null);

    Offers.find({}).forEach(function (offer) {
        var listKeywordsDate = [];
        s = Search.findOne({locationId: offer.effectiveLocationId});

        if (s === undefined) {
            _.map(offer.keywords, function(kw){
                listKeywordsDate.push({keyword: kw, dateScrap: offer.dateScrap});
            });

            Search.insert({
                locationId: offer.effectiveLocationId,
                keywordsDate: listKeywordsDate
            });
        } else {
            _.map(offer.keywords, function(kw){
                keywordDate = _.findWhere(s.keywordsDate, {keyword: kw});

                if (keywordDate === undefined) {
                    Search.update({locationId: offer.effectiveLocationId}, {$set: {keywordsDate: _.union(s.keywordsDate, [{keyword: kw, dateScrap: offer.dateScrap}]) }});
                } else {
                    if (offer.dateScrap > keywordDate.dateScrap) {
                        _.map(s.keywordsDate, function(kwDt){
                            if (kwDt.keyword === kw) {
                                kwDt.dateScrap = offer.dateScrap;
                            }
                        });

                        Search.update({locationId: offer.effectiveLocationId}, {$set: {keywordsDate: s.keywordsDate }});
                    }
                }
            });
        }
    });

    Search.find({}).forEach(function (search) {
        var listWebsites = [];

        _.map(search.keywordsDate, function( kwDt ) {
            Websites.find({}).forEach(function (ws) {
                var threshold = getThreshold(ws._id);

                var dateThresholdMin = new Date();
                var dateThresholdMax = new Date();
                dateThresholdMin.setDate(dateThresholdMin.getDate() - threshold);
                dateThresholdMax.setDate(dateThresholdMin.getDate() - threshold + parseInt(Meteor.settings.cron.intervalDays));
                if (kwDt.dateScrap > dateThresholdMin && kwDt.dateScrap < dateThresholdMax) {
                    listWebsites.push(ws.name);
                }
            });

            if (listWebsites.length > 0) {
                Meteor.call('search', kwDt.keyword, search.locationId, null, null, listWebsites, 'cron_daily');
            }
        });
    });

    Errors.remove({userId: 'cron_daily'});
    Search.remove({});
};

var clearLocationCache = function () {
    clearLocationScrap();
    clearLocationScale();
};

var event = new Object();
event[Meteor.settings.cron.dbClearOffersResidualData] = clearOffersResidualData;
event[Meteor.settings.cron.dbClearLocation] = clearLocationCache;
event[Meteor.settings.cron.dailyCacheUpdate] = dailyCacheUpdate;

new Meteor.Cron( {
  events:event
});


text:
package eu.monnetproject.lemon;

import java.net.URI;

/**
 * Convenience class for wrapping a URI value
 * @author John McCrae
 */
public abstract class URIValue {

    protected URIValue(URI uri) {
        this.uri = uri;
    }
    private final URI uri;

    public URI getURI() {
        return uri;
    }

    @Override
    public String toString() {
        return uri.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if(!(obj instanceof URIValue)) {
            return false;
        }
        final URIValue other = (URIValue) obj;
        if (this.uri != other.uri && (this.uri == null || !this.uri.equals(other.uri))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = getInfHash();
        hash = hash + (this.uri != null ? this.uri.hashCode() : 0);
        return hash;
    }

    protected int getInfHash() {
        int hash = 3;
        for (Class interf : this.getClass().getInterfaces()) {
            if (interf.getName().startsWith("eu.monnetproject.lemon.model") && !interf.getName().endsWith("Impl")) {
                hash += interf.getName().hashCode();
            }
        }
        return hash;
    }
}


text:
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved

#pragma once

#include "stdafx.h"
#include <vector>
#include "assert.h"
#include <iostream>

using std::cout;
using std::endl;

//---------------------------------------------------------------------
// defined keyword
//---------------------------------------------------------------------
template<class VALUE>
struct _DEFINED_KEYWORD
{
    LPCWSTR _pwszKeyword;
    VALUE _value;
};

//---------------------------------------------------------------------
// enum
//---------------------------------------------------------------------
enum KEYSTROKE_CATEGORY
{
    CATEGORY_NONE = 0,
    CATEGORY_COMPOSING,
    CATEGORY_CANDIDATE,
    CATEGORY_PHRASE,
    CATEGORY_PHRASEFROMKEYSTROKE,
    CATEGORY_INVOKE_COMPOSITION_EDIT_SESSION
};

enum KEYSTROKE_FUNCTION
{
    FUNCTION_NONE = 0,
    FUNCTION_INPUT,

    FUNCTION_CANCEL,
    FUNCTION_FINALIZE_TEXTSTORE,
    FUNCTION_FINALIZE_TEXTSTORE_AND_INPUT,
    FUNCTION_FINALIZE_CANDIDATELIST,
    FUNCTION_FINALIZE_CANDIDATELIST_AND_INPUT,
    FUNCTION_CONVERT,
    FUNCTION_CONVERT_WILDCARD,
    FUNCTION_SELECT_BY_NUMBER,
    FUNCTION_BACKSPACE,
    FUNCTION_MOVE_LEFT,
    FUNCTION_MOVE_RIGHT,
    FUNCTION_MOVE_UP,
    FUNCTION_MOVE_DOWN,
    FUNCTION_MOVE_PAGE_UP,
    FUNCTION_MOVE_PAGE_DOWN,
    FUNCTION_MOVE_PAGE_TOP,
    FUNCTION_MOVE_PAGE_BOTTOM,

    // Function Double/Single byte
    FUNCTION_DOUBLE_SINGLE_BYTE,

    // Function Punctuation
    FUNCTION_PUNCTUATION
};

//---------------------------------------------------------------------
// candidate list
//---------------------------------------------------------------------
enum CANDIDATE_MODE
{
    CANDIDATE_NONE = 0,
    CANDIDATE_ORIGINAL,
    CANDIDATE_PHRASE,
    CANDIDATE_INCREMENTAL,
    CANDIDATE_WITH_NEXT_COMPOSITION
};

//---------------------------------------------------------------------
// structure
//---------------------------------------------------------------------
struct _KEYSTROKE_STATE
{
    KEYSTROKE_CATEGORY Category;
    KEYSTROKE_FUNCTION Function;
};

struct _PUNCTUATION
{
    WCHAR _Code;
    WCHAR _Punctuation;
};

BOOL CLSIDToString(REFGUID refGUID, _Out_writes_ (39) WCHAR *pCLSIDString);

HRESULT SkipWhiteSpace(LCID locale, _In_ LPCWSTR pwszBuffer, DWORD_PTR dwBufLen, _Out_ DWORD_PTR *pdwIndex);
HRESULT FindChar(WCHAR wch, _In_ LPCWSTR pwszBuffer, DWORD_PTR dwBufLen, _Out_ DWORD_PTR *pdwIndex);

BOOL IsSpace(LCID locale, WCHAR wch);

template<class T>
class CSampleImeArray
{
    typedef typename std::vector<T> CSampleImeInnerArray;
    typedef typename std::vector<T>::iterator CSampleImeInnerIter;

public:
    CSampleImeArray(): _innerVect()
    {
    }

    explicit CSampleImeArray(size_t count): _innerVect(count)
    {
    }

    virtual ~CSampleImeArray()
    {
    }

    inline T* GetAt(size_t index)
    {
        assert(index >= 0);
        assert(index < _innerVect.size());

        T& curT = _innerVect.at(index);

        return &(curT);
    }

    inline const T* GetAt(size_t index) const
    {
        assert(index >= 0);
        assert(index < _innerVect.size());

        T& curT = _innerVect.at(index);

        return &(curT);
    }

    void RemoveAt(size_t index)
    {
        assert(index >= 0);
        assert(index < _innerVect.size());

        CSampleImeInnerIter iter = _innerVect.begin();
        _innerVect.erase(iter + index);
    }

    UINT Count() const
    {
        return static_cast<UINT>(_innerVect.size());
    }

    T* Append()
    {
        T newT;
        _innerVect.push_back(newT);
        T& backT = _innerVect.back();

        return &(backT);
    }

    void reserve(size_t Count)
    {
        _innerVect.reserve(Count);
    }

    void Clear()
    {
        _innerVect.clear();
    }

private:
    CSampleImeInnerArray _innerVect;
};

class CCandidateRange
{
public:
    CCandidateRange(void);
    ~CCandidateRange(void);

    BOOL IsRange(UINT vKey);
    int GetIndex(UINT vKey);

    inline int Count() const
    {
        return _CandidateListIndexRange.Count();
    }
    inline DWORD *GetAt(int index)
    {
        return _CandidateListIndexRange.GetAt(index);
    }
    inline DWORD *Append()
    {
        return _CandidateListIndexRange.Append();
    }

private:
    CSampleImeArray<DWORD> _CandidateListIndexRange;
};

class CStringRange
{
public:
    CStringRange();
    ~CStringRange();

    const WCHAR *Get() const;
    const DWORD_PTR GetLength() const;
    void Clear();
    void Set(const WCHAR *pwch, DWORD_PTR dwLength);
    void Set(CStringRange &sr);
    CStringRange& operator=(const CStringRange& sr);
    void CharNext(_Inout_ CStringRange* pCharNext);
    static int Compare(LCID locale, _In_ CStringRange* pString1, _In_ CStringRange* pString2);
    static BOOL WildcardCompare(LCID locale, _In_ CStringRange* stringWithWildcard, _In_ CStringRange* targetString);

protected:
    DWORD_PTR _stringBufLen;         // Length is in character count.
    const WCHAR *_pStringBuf;    // Buffer which is not add zero terminate.
};

//---------------------------------------------------------------------
// CCandidateListItem
//	_ItemString - candidate string
//	_FindKeyCode - tailing string
//---------------------------------------------------------------------
struct CCandidateListItem
{
    CStringRange _ItemString;
    CStringRange _FindKeyCode;

	CCandidateListItem& CCandidateListItem::operator =( const CCandidateListItem& rhs)
	{
		_ItemString = rhs._ItemString;
		_FindKeyCode = rhs._FindKeyCode;
		return *this;
	}
};

class CPunctuationPair
{
public:
    CPunctuationPair();
    CPunctuationPair(WCHAR code, WCHAR punctuation, WCHAR pair);

    struct _PUNCTUATION _punctuation;
    WCHAR _pairPunctuation;
    BOOL _isPairToggle;
};

class CPunctuationNestPair
{
public:
    CPunctuationNestPair();
    CPunctuationNestPair(WCHAR wchCode_begin, WCHAR wch_begin, WCHAR wchPair_begin,
        WCHAR wchCode_end,   WCHAR wch_end,   WCHAR wchPair_end);

    struct _PUNCTUATION _punctuation_begin;
    WCHAR _pairPunctuation_begin;

    struct _PUNCTUATION _punctuation_end;
    WCHAR _pairPunctuation_end;

    int _nestCount;
};


text:
package com.g24.cop4331.nutrilog.Fragments;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.g24.cop4331.nutrilog.Activities.ProductActivity;
import com.g24.cop4331.nutrilog.Activities.RecentItemsActivity;
import com.g24.cop4331.nutrilog.Models.ActivitySingleton;
import com.g24.cop4331.nutrilog.R;
import com.g24.cop4331.nutrilog.SearchItem;

import java.util.ArrayList;

/**
 * Created by Ted on 10/29/2015.
 *
 * The recent fragment is displayed by the recent activity. It shows all the items
 * that the user viewed most recently.
 */
public class RecentFragment extends Fragment {

    public RecentFragment(){}

    /**
     * Inflates the view when it is created.
     * @param inflater
     * @param container
     * @param savedInstanceState
     * @return
     */
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.fragment_recent, container, false);

        ListView list = createList(rootView);
        registerClickCallback(list);

        return rootView;
    }

    /**
     * Creates the list of search items and gives it the adapter.
     * @param v
     * @return
     */
    private ListView createList(View v) {
        View view = v.getRootView();
        ListView list = (ListView) view.findViewById(R.id.recentView);
        ArrayAdapter<SearchItem> arrayAdapter = new ArrayAdapter<>(ActivitySingleton.getInstance().getMainActivity(), android.R.layout.simple_list_item_1, ActivitySingleton.getInstance().getRecent());

        list.setAdapter(arrayAdapter);
        return list;
    }

    /**
     * When an item is clicked, it opens that item and refreshes its position
     * in the recent items list.
     * @param list
     */
    private void registerClickCallback(ListView list) {
        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                SearchItem item = (SearchItem) parent.getItemAtPosition(position);

                //Add the item to the recently viewed list when you click on the item
                ArrayList<SearchItem> recentItems = ActivitySingleton.getInstance().getRecent();
                if (!recentItems.contains(item)) {
                    recentItems.add(item);
                }

                Intent intent = new Intent(getActivity(), ProductActivity.class);
                intent.putExtra("item", item);
                startActivity(intent);

            }
        });
    }
}


text:
<editor>
  <help>https://docs.cloudbees.com/docs/cloudbees-cd/latest/plugins/ec-weblogic#CheckServerStatus</help>
  <formElement>
    <type>entry</type>
    Configuration name

    <configuration>1</configuration>

    <property>configname</property>
    <propertyReference>/plugins/@PLUGIN_NAME@/project/weblogic_cfgs</propertyReference>
    <required>1</required>
    <documentation>Name of the configuration to be used. URL, port and credentials are retrieved from the given configuration. To view or create a new configuration, go to the Administration -> Plugins tab, and select 'Configure' action for @PLUGIN_KEY@ plugin.</documentation>
    <htmlDocumentation>Name of the configuration to be used. URL, port and credentials are retrieved from the given configuration.</htmlDocumentation>
  </formElement>
  <formElement>
    <type>entry</type>
    WLST script absolute path
    <property>wlstabspath</property>
    <required>1</required>
        <documentation>
Absolute path to WLST. i.e: '/path/to/wlst.cmd' or 'wlst.sh'. Setting this path will make applying the equal param in procedures unnecessary.
NOTE: You need to install the agent to the machine that has access to the WLST script at least.
        </documentation>
    <propertyReference type="property">/plugins/@PLUGIN_NAME@/project/weblogic_cfgs/$configname/wlst_path</propertyReference>
    <dependsOn>configname</dependsOn>
  </formElement>
  <formElement>
    <type>entry</type>
    Maximum elapsed time
    <property>maxelapsedtime</property>
    <documentation>Defines the maximum time in seconds that the job will try to check into the server. Blank implies no wait time (URL only checked one time).</documentation>
    <required>0</required>
  </formElement>
  <formElement>
    <type>select</type>
    Success criteria
    <property>successcriteria</property>
    <required>1</required>
    <documentation>Indicates the expected correct result to be obtained when running checking the server.</documentation>
    <option>
      <name>Server running</name>
      <value>RUNNING</value>
    </option>
    <option>
      <name>Server not running</name>
      <value>NOT_RUNNING</value>
    </option>
  </formElement>
  <formElement>
    <type>entry</type>
    Instance name
    <property>instancename</property>
    <documentation>Indicates the name of the instance to be checked.</documentation>
    <required>1</required>
  </formElement>
</editor>


text:
package net.nemerosa.ontrack.jenkins;

public enum OntrackSecurityMode {
    DEFAULT("Default security model"),
    SANDBOX("Always use the sandbox"),
    NONE("Disable security checks");

    private final String displayName;

    OntrackSecurityMode(String displayName) {
        this.displayName = displayName;
    }

    public String getDisplayName() {
        return displayName;
    }
}


text:
require 'test_helper'

describe BrBoleto::Remessa::Cnab240::Cecred do
	subject { FactoryGirl.build(:remessa_cnab240_cecred, lotes: lote) }
	let(:pagamento) { FactoryGirl.build(:remessa_pagamento, valor_documento: 879.66) }
	let(:lote) { FactoryGirl.build(:remessa_lote, pagamentos: pagamento) }

	it "deve herdar da class Base" do
		subject.class.superclass.must_equal BrBoleto::Remessa::Cnab240::Base
	end

	context "validations" do
		describe 'Validações personalizadas da conta' do
			it 'valid_carteira_required' do
				subject.conta.carteira = ''
				conta_must_be_msg_error(:carteira, :blank)
			end

			it 'valid_carteira_length' do
				subject.conta.carteira = '1234567890123456'
				conta_must_be_msg_error(:carteira, :custom_length_is, {count: 1})
			end

			it 'valid_convenio_required' do
				subject.conta.convenio = ''
				conta_must_be_msg_error(:convenio, :blank)
			end

			it 'valid_convenio_length' do
				subject.conta.convenio = '1234567890123456'
				conta_must_be_msg_error(:convenio, :custom_length_maximum, {count: 6})
			end

			it 'agencia_required' do
				subject.conta.agencia = ''
				conta_must_be_msg_error(:agencia, :blank)
			end

			it 'agencia_length' do
				subject.conta.agencia = '1234567890123456'
				conta_must_be_msg_error(:agencia, :custom_length_is, {count: 4})
			end

			private

			def conta_must_be_msg_error(attr_validation, msg_key, options_msg={})
				must_be_message_error(:base, "#{BrBoleto::Conta::Cecred.human_attribute_name(attr_validation)} #{get_message(msg_key, options_msg)}")
			end
		end
	end

	describe "#convenio_lote" do
		it "as 7 primeiras posições deve ser o valor do convenio ajustado com zeros a esquerda" do
			subject.conta.codigo_cedente = '88'
			subject.convenio_lote(lote).must_equal '000088              '

			subject.conta.convenio = '7374'
			subject.convenio_lote(lote).must_equal '007374              '
		end
		it "deve ter 20 caracteres" do
			subject.convenio_lote(lote).size.must_equal 20
		end
	end

	describe "#informacoes_da_conta" do
		it "deve ter 20 posições" do
			subject.informacoes_da_conta.size.must_equal 20
		end

		it "1 - Primeira parte = agencia 5 posicoes - ajustados com zeros a esquerda" do
			subject.conta.agencia = '47'
			subject.informacoes_da_conta[0..4].must_equal '00047'

			subject.conta.agencia = '1234'
			subject.informacoes_da_conta[0..4].must_equal '01234'
		end

		it "2 - Segunda parte = agencia_dv" do
			subject.conta.agencia_dv = '7'
			subject.informacoes_da_conta[5].must_equal "7"
		end

		it "3 - Terceira parte = conta_corrente 12 posicoes - ajustados com zeros a esquerda" do
			subject.conta.conta_corrente = '89755'
			subject.informacoes_da_conta[6..17].must_equal '000000089755'

			subject.conta.conta_corrente = '1234567890'
			subject.informacoes_da_conta[6..17].must_equal '001234567890'
		end

		it "4 - Quarta parte = Conta Corrente DV" do
			subject.conta.conta_corrente_dv = '8'
			subject.informacoes_da_conta[18..18].must_equal('8')
		end

		it "5 - Quinta parte = Se o conta_corrente_dv não for 2 digitos deve ter 1 espaço em branco" do
			subject.informacoes_da_conta[19].must_equal(' ')
		end
	end

	describe "#complemento_header_arquivo" do
		it "deve ter 29 posições" do
			subject.complemento_header_arquivo.size.must_equal 29
		end

		it "2 - Segunda parte = USO FEBRABAN com 25 posições em branco" do
			subject.complemento_header_arquivo[4..28].must_equal ' ' * 25
		end
	end

	describe "#complemento_p" do

		it "deve ter 34 posições" do
			subject.complemento_p(pagamento).size.must_equal 34
		end

		it "1 - Primeira parte = conta_corrente com 12 posicoes - ajustados com zeros a esquerda" do
			subject.conta.conta_corrente = '1234'
			subject.complemento_p(pagamento)[0..11].must_equal '000000001234'

			subject.conta.conta_corrente = '264631'
			subject.complemento_p(pagamento)[0..11].must_equal '000000264631'
		end

		it "2 - Seguna parte = Conta Corrente DV - 1 posicao" do
			subject.conta.conta_corrente_dv = '7'
			subject.complemento_p(pagamento)[12..12].must_equal '7'
		end

		it "3 - Terceira parte = Se o conta_corrente_dv não for 2 digitos deve ter 1 espaço em branco" do
			subject.complemento_p(pagamento)[13..13].must_equal ' '
		end

		it "4 - Quarta parte = Identificação do Título na Cooperativa " do
			pagamento.nosso_numero = '99999998000000001'
			subject.complemento_p(pagamento)[14..33].must_equal '99999998000000001   '
		end

	end

	describe "#segmento_p_numero_do_documento" do
		it "deve ter 15 posições" do
			subject.segmento_p_numero_do_documento(pagamento).size.must_equal 15
		end

		it "deve conter o numero do documento 15 posicoes - ajustados com zeros a esquerda" do
			pagamento.expects(:numero_documento).returns("977897")
			subject.segmento_p_numero_do_documento(pagamento).must_equal '000000000977897'
		end
	end

	describe "#segmento_p_posicao_221_a_221(pagamento)" do
		it "deve ter 1 posição" do
			subject.segmento_p_posicao_221_a_221(pagamento).size.must_equal 1
		end

		it "deve conter o Código para Protesto" do
			subject.segmento_p_posicao_221_a_221(pagamento).must_equal '3'
		end
	end

	describe "#segmento_p_posicao_224_a_224" do
		it "deve ter 1 posição" do
			subject.segmento_p_posicao_224_a_224.size.must_equal 1
		end

		it "deve conter o Código para Baixa/Devolução" do
			subject.segmento_p_posicao_224_a_224.must_equal '2'
		end
	end

	describe "#complemento_trailer_lote" do
		it "deve ter 217 posições" do
			subject.complemento_trailer_lote(lote, 5).size.must_equal 217
		end

		it "1 - Primeira parte = 92 posições todas preenchidas com zeros (VALORES UTILIZADOS APENAS PARA ARQUIVO DE RETORNO)" do
			subject.complemento_trailer_lote(lote, 5)[0..91].must_equal '0' * 92
		end

		it "2 - Segunda parte = 8 posições todas preenchidas com zeros (Nr. do aviso de lançamento do crédito referente aos títulos de cobrança)" do
			subject.complemento_trailer_lote(lote, 5)[92..99].must_equal ('0' * 8)
		end

		it "3 - Terceira parte = EXCLUSIVO FEBRABAN com 117 posicoes em branco" do
			subject.complemento_trailer_lote(lote, 5)[100..216].must_equal (' ' * 117)
		end
	end

	describe 'Geração do arquivo' do
		let(:conta) do
			{
				razao_social:   'EMPRESA EMITENTE',
				cpf_cnpj:       '33.486.451/0001-30',
				carteira:       '1',
				agencia:        '7506',
				codigo_cedente: '828196',
				conta_corrente: '1354843'
			}
		end
		let(:pagador) {
			{
				nome:     'Benjamin Francisco Marcos Vinicius Fernandes',
				cpf_cnpj: '787.933.211-12',
				endereco: 'Rua Principal s/n 881',
				bairro:   'Centro',
				cep:      '79210-972',
				cidade:   'Anastácio',
				uf:       'MS',
			}
		}
		let(:pagamento) {
			BrBoleto::Remessa::Pagamento.new({
				nosso_numero:     '09142444000000001',
				numero_documento: '000000001',
				data_vencimento:  Date.parse('15/12/2016'),
				valor_documento:  10.00,
				pagador:          pagador,
				especie_titulo:   '02',
				codigo_juros:     '0',
				data_juros:       Date.parse('17/12/2016'),
				valor_juros:      0.00,
				codigo_multa:     '0',
				data_multa:       Date.parse('16/12/2016'),
				valor_multa:      0.00,
				data_emissao:     Date.parse('08/11/2016'),
			})
		}
		let(:lote) { BrBoleto::Remessa::Lote.new(pagamentos: pagamento) }
		it "deve gerar o arquivo de remessa corretamente com as informações passadas" do
			remessa = BrBoleto::Remessa::Cnab240::Cecred.new({
				data_hora_arquivo:  Time.parse('08/11/2016 09:31:47'),
				sequencial_remessa: 1,
				conta:              conta,
				lotes:              [lote],
			})
			remessa.dados_do_arquivo.must_equal read_fixture('remessa/cnab240/cecred.rem')
		end
	end
end


text:
import electron from 'electron';
import React from 'react';
import PropTypes from 'prop-types';
import tildify from 'tildify';

import {connect, PreferencesContainer} from '../../../containers';

import Item from '../item';
import Switch from '../item/switch';
import Button from '../item/button';
import Select from '../item/select';
import ShortcutInput from '../shortcut-input';

import Category from './category';

class General extends React.Component {
  static defaultProps = {
    audioDevices: [],
    kapturesDir: '',
    category: 'general'
  }

  state = {}

  componentDidMount() {
    this.setState({
      showCursorSupported: electron.remote.require('./utils/macos-version').isGreaterThanOrEqualTo('10.13')
    });
  }

  openKapturesDir = () => {
    electron.shell.openItem(this.props.kapturesDir);
  }

  render() {
    const {
      kapturesDir,
      openOnStartup,
      allowAnalytics,
      showCursor,
      highlightClicks,
      record60fps,
      recordKeyboardShortcut,
      loopExports,
      toggleSetting,
      toggleRecordAudio,
      audioInputDeviceId,
      setAudioInputDeviceId,
      audioDevices,
      recordAudio,
      pickKapturesDir,
      setOpenOnStartup,
      cropperShortcut,
      updateShortcut,
      toggleShortcuts,
      category
    } = this.props;

    const {showCursorSupported} = this.state;

    const devices = audioDevices.map(device => ({
      label: device.name,
      value: device.id
    }));

    const kapturesDirPath = tildify(kapturesDir);
    const tabIndex = category === 'general' ? 0 : -1;
    const fpsOptions = [{label: '30 FPS', value: false}, {label: '60 FPS', value: true}];

    return (
      <Category>
        {
          showCursorSupported &&
            <Item
              key="showCursor"
              parentItem
              title="Show cursor"
              subtitle="Display the mouse cursor in your Kaptures"
            >
              <Switch
                tabIndex={tabIndex}
                checked={showCursor}
                onClick={
                  () => {
                    if (showCursor) {
                      toggleSetting('highlightClicks', false);
                    }

                    toggleSetting('showCursor');
                  }
                }/>
            </Item>
        }
        {
          showCursorSupported &&
            <Item key="highlightClicks" subtitle="Highlight clicks">
              <Switch
                tabIndex={tabIndex}
                checked={highlightClicks}
                disabled={!showCursor}
                onClick={() => toggleSetting('highlightClicks')}
              />
            </Item>
        }
        <Item
          key="recordKeyboardShortcut"
          parentItem
          title="Keyboard shortcuts"
          subtitle="Toggle and customise keyboard shortcuts"
        >
          <Switch tabIndex={tabIndex} checked={recordKeyboardShortcut} onClick={toggleShortcuts}/>
        </Item>
        {
          recordKeyboardShortcut &&
            <Item key="cropperShortcut" subtitle="Trigger Kap">
              <ShortcutInput
                shortcut={cropperShortcut}
                tabIndex={tabIndex}
                onChange={shortcut => updateShortcut('cropperShortcut', shortcut)}
              />
            </Item>
        }
        <Item
          key="loopExports"
          title="Loop exports"
          subtitle="Infinitely loop exports when supported"
        >
          <Switch tabIndex={tabIndex} checked={loopExports} onClick={() => toggleSetting('loopExports')}/>
        </Item>
        <Item
          key="recordAudio"
          parentItem
          title="Audio recording"
          subtitle="Record audio from input device"
        >
          <Switch
            tabIndex={tabIndex}
            checked={recordAudio}
            onClick={toggleRecordAudio}/>
        </Item>
        {
          recordAudio &&
            <Item key="audioInputDeviceId" subtitle="Select input device">
              <Select
                tabIndex={tabIndex}
                options={devices}
                selected={audioInputDeviceId}
                placeholder="Select Device"
                noOptionsMessage="No input devices"
                onSelect={setAudioInputDeviceId}/>
            </Item>
        }
        <Item
          key="record60fps"
          title="Capture frame rate"
          subtitle="Increased FPS impacts performance and file size"
        >
          <Select
            tabIndex={tabIndex}
            options={fpsOptions}
            selected={record60fps}
            onSelect={value => toggleSetting('record60fps', value)}/>
        </Item>
        <Item
          key="allowAnalytics"
          title="Allow analytics"
          subtitle="Help us improve Kap by sending anonymous usage stats"
        >
          <Switch tabIndex={tabIndex} checked={allowAnalytics} onClick={() => toggleSetting('allowAnalytics')}/>
        </Item>
        <Item
          key="openOnStartup"
          title="Start automatically"
          subtitle="Launch Kap on system startup"
        >
          <Switch tabIndex={tabIndex} checked={openOnStartup} onClick={setOpenOnStartup}/>
        </Item>
        <Item
          key="pickKapturesDir"
          title="Save to…"
          subtitle={kapturesDirPath}
          tooltip={kapturesDir}
          onSubtitleClick={this.openKapturesDir}
        >
          <Button tabIndex={tabIndex} title="Choose" onClick={pickKapturesDir}/>
        </Item>
      </Category>
    );
  }
}

General.propTypes = {
  showCursor: PropTypes.bool,
  highlightClicks: PropTypes.bool,
  record60fps: PropTypes.bool,
  recordKeyboardShortcut: PropTypes.bool,
  toggleSetting: PropTypes.elementType.isRequired,
  toggleRecordAudio: PropTypes.elementType.isRequired,
  audioInputDeviceId: PropTypes.string,
  setAudioInputDeviceId: PropTypes.elementType.isRequired,
  audioDevices: PropTypes.array,
  recordAudio: PropTypes.bool,
  kapturesDir: PropTypes.string,
  openOnStartup: PropTypes.bool,
  allowAnalytics: PropTypes.bool,
  loopExports: PropTypes.bool,
  pickKapturesDir: PropTypes.elementType.isRequired,
  setOpenOnStartup: PropTypes.elementType.isRequired,
  updateShortcut: PropTypes.elementType.isRequired,
  toggleShortcuts: PropTypes.elementType.isRequired,
  category: PropTypes.string,
  cropperShortcut: PropTypes.shape({
    metaKey: PropTypes.bool.isRequired,
    altKey: PropTypes.bool.isRequired,
    ctrlKey: PropTypes.bool.isRequired,
    shiftKey: PropTypes.bool.isRequired,
    character: PropTypes.string.isRequired
  })
};

export default connect(
  [PreferencesContainer],
  ({
    showCursor,
    highlightClicks,
    record60fps,
    recordAudio,
    recordKeyboardShortcut,
    audioInputDeviceId,
    audioDevices,
    kapturesDir,
    openOnStartup,
    allowAnalytics,
    loopExports,
    cropperShortcut,
    category
  }) => ({
    showCursor,
    highlightClicks,
    record60fps,
    recordAudio,
    recordKeyboardShortcut,
    audioInputDeviceId,
    audioDevices,
    kapturesDir,
    openOnStartup,
    allowAnalytics,
    loopExports,
    cropperShortcut,
    category
  }),
  ({
    toggleSetting,
    toggleRecordAudio,
    setAudioInputDeviceId,
    pickKapturesDir,
    setOpenOnStartup,
    updateShortcut,
    toggleShortcuts
  }) => ({
    toggleSetting,
    toggleRecordAudio,
    setAudioInputDeviceId,
    pickKapturesDir,
    setOpenOnStartup,
    updateShortcut,
    toggleShortcuts
  })
)(General);


text:
mappyfile
=========

A Python library to create, parse, modify, and format `MapServer <http://mapserver.org/documentation.html>`_ Mapfiles.

+ Python 2 and 3 compatible
+ Pure Python - no MapServer dependencies
+ Open Source License (MIT)

An online formatter demonstrating the libraries capabilities can be found at: http://mappyfile.geographika.net/

A presentation on mappyfile was given at `FOSS4G Europe 2017 <https://europe.foss4g.org/2017/Home>`_ - slides are available
:download:`to download here <_static/foss4ge2017_mappyfile_sgirvin.pdf>`.

.. toctree::
    :maxdepth: 2
    :numbered:
    :titlesonly:

    Parsing (draft) <parser.rst>
    Transforming (draft) <transformer.rst>
    Pretty Printing <pretty_printing.rst>
    validation.rst
    schemas.rst
    grammar.rst
    python_integration.rst
    client.rst
    api/main.rst
    development.rst

.. image:: images/class_parsed.png

What is mappyfile?
------------------

*mappyfile* takes a Mapfile as input and parses it into an `Abstract syntax tree (AST) <https://en.wikipedia.org/wiki/Abstract_syntax_tree>`_
using `lark <https://github.com/erezsh/lark>`_ a Python parsing library.
mappyfile can then transform the AST into a dictionary structure, containing keys and values of dicts, and lists familiar to
Python programmers. This structure can be edited directly. Alternatively new objects can be added by parsing further Mapfile text and inserting into the
dictionary structure. mappyfile also includes a "pretty printer" to export this dictionary structure back to a Mapfile, with keyword formatting and indentation.

*mappyfile* assumes knowledge of the Mapfile format - a `domain specific language (DSL) <https://en.wikipedia.org/wiki/Domain-specific_language>`_ used
by MapServer to generate map images. mappyfile is a possible alternative to using MapScript. The definitions of these (from the
`MapServer glossary <http://mapserver.org/el/glossary.html>`_) are shown below:

+ **Mapfile** is the declarative language that MapServer uses to define data connections,
  map styling, templating, and server directives. Its format is xml-like and hierarchical,
  with closing END tags, but the format is not xml.

+ **MapScript** is an alternative to the CGI application of mapserv that allows you to
  program the MapServer object API in many languages.

The diagram below shows the different elements of mappyfile, and how they are used to modify a Mapfile:

.. image:: images/mappyfile_modules.png

Why?
----

* Easily generate development, staging, and production Mapfiles from the same source Mapfile
* Create Mapfiles for different datasets from a single Mapfile
* Create, manipulate, and test Mapfiles from within Python

The current alternative to building applications with MapServer is to use MapScript. This approach has a
number of issues that resulted in the development of mappyfile:

+ When running on Windows any Python libraries using C/C++ require them to be built with the MS C/C++ VS2008 compiler, this means no applications using MapScript
  can take advantage of performance improvements in the MS C/C++ 2015 compiler
+ You need to create an empty log file or MapServer won't open the map (or get "msSetErrorFile(): General error message. Failed to open MS_ERRORFILE" errors)
+ MapScript is not available through PyPI - the last version was uploaded in 2010 - https://pypi.python.org/pypi/mapscript/5.6.3.0 **UPDATE** mapscript wheels
  for MapServer 7.2 on Windows are now available
+ It is necessary to set the working directory so that MapServer includes are found (this also applies to mappyfile, but there is no need to os.chdir
  and change the working directory for your script or application)
+ The MapScript API is not particularly "Pythonic"

One key difference is that mappyfile only deals with text, so you cannot retrieve features or connect to databases through layers as you can with MapScript.
mappyfile's approach is to build a Mapfile that then uses the mapserv program to handle these requirements. This design was influenced by Sean Gillies,
the MapScript maintainer for several years (until 2006). A couple of his last blog posts on MapScript make a strong case for working with Mapfiles rather than MapScript:

    *"Cease, or at the very least, minimize your use of MapServer's various language bindings.
    Instead, embrace MapServer's domain-specific language (DSL) and write more of the declarative
    cartographic scripts known as mapfiles. Use the mapserv (or shp2img) program to compile these
    scripts into images. This is the path to happiness and prosperity."*

    Sean Gillies - `Stop using MapScript`_

A later post listed the benefits of this approach:

    *"the instructions encoded in a MapServer mapfile comprise a domain-specific language..
    to embrace the map language is to benefit from simplicity, usability, and portability."*

    Sean Gillies - `Declarative Maps`_

The concept of the Mapfile as a DSL has been implemented a few times. A Python `Mapfile builder`_ written by Allan Doyle used an XML approach.

More recently the Node module `node-mapserv`_ provides support for declarative mapfile programming.
As the author notes:

    *node-mapserv is not MapScript for Node. Instead it provides a simple declarative API for
    rendering mapserver mapfiles..most of what can be accomplished imperatively
    using mapscript can be done declaratively by custom generating new mapfiles and tweaking
    existing mapfiles*

As an interesting footnote the MapScript "bindings" are available in several different languages thanks to `SWIG <https://en.wikipedia.org/wiki/SWIG>`_ which creates wrapper
code for C. SWIG was developed by `David Beazley <http://www.dabeaz.com/>`_, who then later built `PLY <http://www.dabeaz.com/ply/>`_ on which mappyfile was originally based.
PLY is an implementation of lex and yacc parsing tools for Python - the tools MapServer itself uses to parse Mapfiles in C.

Code Examples
-------------

This section details the basic use of the ``mappyfile`` library. For all functionality and examples see the :ref:`mappyfile-api` documentation.

Accessing Values
++++++++++++++++

.. literalinclude:: examples/api/accessing_values_test.py
    :language: python
    :dedent: 4
    :start-after: # START OF API EXAMPLE
    :end-before: # END OF API EXAMPLE

Query
+++++

.. literalinclude:: examples/api/search_test.py
    :language: python
    :dedent: 4
    :start-after: # START OF API EXAMPLE
    :end-before: # END OF API EXAMPLE

Modifying Values
++++++++++++++++

.. literalinclude:: examples/api/modifying_values_test.py
    :language: python
    :dedent: 4
    :start-after: # START OF API EXAMPLE
    :end-before: # END OF API EXAMPLE

Adding Items
++++++++++++

Adding a new layer:

.. literalinclude:: examples/api/adding_values_test.py
    :language: python
    :dedent: 4
    :start-after: # START OF ADD LAYER EXAMPLE
    :end-before: # END OF ADD LAYER EXAMPLE

Adding a new class to a layer:

.. literalinclude:: examples/api/adding_values_test.py
    :language: python
    :dedent: 4
    :start-after: # START OF ADD CLASS EXAMPLE
    :end-before: # END OF ADD CLASS EXAMPLE

Development Roadmap
-------------------

Future development plans, leading to a v1.0 release include:

+ Setup an easy way to plug in "linters" to check various Mapfile settings and rules (e.g. configured correctly for WFS)
+ Create a Jupyter Notebook demonstrating mappyfile usage
+ Add a plugins page to the docs
+ Add an example of creating Mapfiles using YAML
+ Create a new ``prune`` function to remove redundant default settings from a Mapfile

.. include:: HISTORY.rst

.. _Stop using MapScript: https://sgillies.net/2006/11/29/stop-using-mapscript.html
.. _Declarative Maps: https://sgillies.net/2006/12/01/declarative-maps.html
.. _Mapfile builder: https://web.archive.org/web/20090106070607/http://think.random-stuff.org/FrontPage/archive/2006/07/mapfile-builder
.. _node-mapserv: https://www.npmjs.com/package/mapserv


text:
<!DOCTYPE html>

    <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"
          rel="stylesheet">

How To Upload a File

      <form action="upload" method="post" enctype="multipart/form-data">
        <input type="file" name="file">

        <input type="submit" value="Upload">
      </form>


text:
<!-- main sidebar -->
<aside class="main-sidebar">
  <section class="sidebar">
    {!! $htmlMenu !!}
  </section>
</aside> <!-- main sidebar -->


text:
copyright:
  years: 2015, 2016

---
# Surveillance d'applications à l'aide de {{site.data.keyword.mobileanalytics_short}}
{: #monitoringapps}
*Dernière mise à jour jour : 6 mai 2016*
{: .last-updated}

{{site.data.keyword.mobileanalytics_full}} fournit des fonctions de surveillance et d'analyse pour vos applications mobiles. Le logiciel SDK du client {{site.data.keyword.mobileanalytics_short}} vous permet d'enregistrer les journaux client et de surveiller les données. Les développeurs peuvent contrôler le moment auquel ces données doivent être envoyées au service {{site.data.keyword.mobileanalytics_short}}. Lorsque les données sont fournies à {{site.data.keyword.mobileanalytics_short}}, vous pouvez utiliser le tableau de bord {{site.data.keyword.mobileanalytics_short}} pour obtenir des perspectives d'analyse relatives à vos applications et périphériques mobiles, ainsi que les journaux client.
{: shortdesc}

## Visualisation de données à l'aide de graphiques personnalisés
{: #custom-charts}

Vous pouvez visualiser les données d'analyse collectées dans votre référentiel d'analyse. Cette visualisation est un moyen très efficace d'examiner les données relatives à des scénarios d'utilisation spécifiques. Vous pouvez créer des graphiques avec des données déjà collectées par une analyse opérationnelle, en plus des données personnalisées que vous communiquez.

### Création de graphiques personnalisés pour les journaux client
{: #custom-charts-client-logs}

Vous pouvez créer un diagramme personnalisé pour les journaux client contenant des informations de journal qui sont envoyées à l'API de journal d'événements pour la plateforme. Les informations de journal contiennent également des informations contextuelles sur le périphérique, à savoir l'environnement, ainsi que le nom et la version de l'application.

Dans cet exemple, vous utilisez des données de journal client pour créer un graphique de flux. Le graphique final affiche la distribution des niveaux de journalisation dans une application spécifique. Les données suivantes peuvent également être représentées dans un graphique :

* Données spécifiques
  * Niveau de journalisation
* Données de message
  * Horodatage
* Données contextuelles relatives au système d'exploitation du périphérique
  * Nom de l'application
  * Version de l'application
  * Système d'exploitation du périphérique
* Données contextuelles relatives au périphérique
  * ID du périphérique
  * Modèle de périphérique
  * Version du système d'exploitation du périphérique

1. Assurez-vous que vous disposez d'une application qui collecte des journaux de périphérique ou regroupe des données d'analyse.
2. Dans la console {{site.data.keyword.mobileanalytics_short}}, cliquez sur l'onglet **Graphiques personnalisés** sur la page du **tableau de bord** . Vous pouvez créer un graphique à partir des messages d'analyse qui ont été envoyés au serveur.
3. Cliquez sur **Créer un graphique** pour créer un nouveau graphique personnalisé et indiquez les valeurs suivantes :
  * Titre de graphique : Application et niveaux de journalisation
  * Type d'événement : Journaux client
  * Type de graphique : Graphique de flux
5. Cliquez sur l'onglet **Définition de graphique** et indiquez les valeurs suivantes :
  * Source : Nom d'application
  * Destination : Niveau de journalisation
  * Propriété : nom de votre application
7. Cliquez sur **Sauvegarder**

### Exportation de données personnalisées
{: #export-custom-data}

Vous pouvez exporter les données de chaque graphique personnalisé au format JSON, XML ou CSV.

La structure des données exportées du graphique exporté. Pour exporter des données, cliquez sur l'icône Exporter située dans l'angle supérieur droit du graphique personnalisé.

### Exportation et importation de définitions de graphique personnalisé
{: #export-import-custom}

Vous pouvez importer et exporter des définitions de graphique personnalisé à l'aide d'un programme ou manuellement dans le tableau de bord {{site.data.keyword.mobileanalytics_short}}.

Assurez-vous que vous disposez d'au moins un graphique personnalisé dans le tableau de bord {{site.data.keyword.mobileanalytics_short}}.
Dans cet exemple, vous exportez et importez manuellement des définitions de graphique personnalisé.

1. Dans la console {{site.data.keyword.mobileanalytics_short}}, cliquez sur l'onglet **Graphiques personnalisés** sur la page du **tableau de bord** .
2. Pour exporter les définitions de graphique personnalisé, cliquez sur **Exporter les graphiques**. Cette action affiche une boîte de dialogue permettant de sauvegarder un fichier `customChartsDefinition.json`.
3. Choisissez l'emplacement de sauvegarde du fichier.
4. Cliquez sur l'icône **Supprimer un graphique** située en regard de chaque graphique personnalisé pour supprimer tous les graphiques personnalisés.
5. Pour importer une définition de graphique personnalisé, cliquez sur **Importer des graphiques**. Cette action affiche une boîte de dialogue permettant de sélectionner un fichier.
6. Choisissez le fichier `customChartsDefinition.json` que vous avez précédemment exporté afin de l'ouvrir.

Vous pouvez également exporter et importer les définitions de graphique personnalisé à l'aide d'un programme en utilisant le client HTTP de votre choix (par exemple, CURL ou postman) :
* Le noeud final GET pour l'exportation est `http://mobile-analytics-dashboard.ng.bluemix.net/analytics-service/rest/data/customCharts/`.
* Le noeud final POST pour l'importation est `http://mobile-analytics-dashboard.ng.bluemix.net/analytics-service/rest/data/customCharts/import/`.

**Remarque** : Si vous importez une définition de graphique personnalisé qui existe déjà, une définition en double est créée, et, par conséquent, le tableau de bord {{site.data.keyword.mobileanalytics_short}} affiche des graphiques personnalisés dupliqués.

## Définition d'alertes
{: #alerts}

Vous pouvez définir des seuils dans les définitions d'alerte dans la console
{{site.data.keyword.mobileanalytics_short}} pour un meilleur contrôle de vos
activités.

Vous pouvez configurer des seuils, qui, s'ils sont dépassés, déclenchent des alertes et entraînent l'envoi de notifications à la console {{site.data.keyword.mobileanalytics_short}}. Les alertes déclenchées peuvent être visualisées sur la console ou gérées par un webhook personnalisé. Cette fonction offre un moyen proactif de détecter des erreurs de journal client, des erreurs de journal serveur, des périodes prolongées de temps d'attente du réseau et des échecs d'authentification. La mise en place d'alertes et de seuils réactifs vous évite d'avoir à parcourir vos données et à définir des seuils avec un niveau de granularité élevé.

### Création d'une définition d'alerte pour les journaux client
{: #alert-def-client-logs}

Vous pouvez créer une définition d'alerte basée sur les journaux client.

Dans cet exemple, vous utilisez des données de journal client pour créer une définition d'alerte. L'alerte surveille tous les journaux client qui ont été reçus au cours des 5 dernières minutes, et continue la vérification toutes les 5 minutes, jusqu'à ce que la définition d'alerte soit désactivée ou supprimée. Une alerte est déclenchée pour chaque périphérique qui a envoyé au moins 3 journaux d'erreurs client avec le même nom et la même version d'application.

1. Dans la console {{site.data.keyword.mobileanalytics_short}}, cliquez sur l'icône qui représente une sonnette pour accéder à la page **Journal des alertes**.
2. Accédez à la page **Gestion des alertes** et cliquez sur **Créer une alerte**.
3. Indiquez les valeurs suivantes :
	* Nom d'alerte : Alerte pour les journaux client
	* Message : Alerte de message d'erreur
	* Fréquence des requêtes : 5 minutes
	* Type d'événement : Journaux client
		* Propriété : Niveau de journalisation
			* Valeur : Erreur
			* Seuil
				* Type de seuil : Total pour instance d'application

					**Remarque** : Si vous choisissez l'option Moyenne pour application, la moyenne de journaux client est calculée en fonction du nombre de périphériques. Par exemple, si vous possédez deux périphériques et l'un d'eux envoie six journaux client tandis que l'autre en envoie trois, la moyenne est de 4,5 journaux client.
				* Opérateur : Est supérieur ou égal à 3
	<!-- insert alert definition tab image? -->

4. Cliquez sur **Suivant** ou sur l'onglet **Méthode de distribution** et indiquez la valeur suivante :
	* Méthode : Console Analytics uniquement

		Remarque : Choisissez l'option Console Analytics et publication sur le réseau si vous souhaitez envoyer également un message POST avec un contenu JSON à votre URL personnalisée. Les zones suivantes sont disponibles lorsque vous choisissez cette option :
		* Adresse URL de publication sur le réseau
        * En-têtes
        * Type d'authentification
5. Cliquez sur **Sauvegarder**.

Vous avez créé une définition d'alerte qui déclenche une alerte toutes les 5 minutes si le nombre de journaux d'erreurs client est supérieur ou égal à 3.

### Création d'une définition d'alerte pour les pannes d'application
{: #alert-def-app-crash}

Vous pouvez créer une définition d'alerte basée sur les pannes d'application.

Dans cet exemple, vous utilisez des données de panne d'application pour créer une définition d'alerte. L'alerte surveille toutes les pannes d'application qui se sont produites au cours des 2 dernières minutes, et continue la vérification toutes les 2 minutes, jusqu'à ce que la définition d'alerte soit désactivée ou supprimée. Une alerte est déclenchée pour chaque application qui est tombée en panne au moins 5 fois. Pour plus d'informations sur les pannes d'application, voir [Pannes d'application](app_crash/c_op_analytics_crashes.html).

1. Dans la console {{site.data.keyword.mobileanalytics_short}}, cliquez sur l'icône **Alertes**. Cette action permet d'afficher la page Journal des alertes.
2. Cliquez sur l'onglet **Gestion des alertes**, puis sur **Créer une alerte**.
3. Indiquez les valeurs suivantes :
	* Nom d'alerte : Alerte pour les pannes d'application
	* Message : Alerte de panne d'application
	* Fréquence des requêtes : Pannes d'application
		* Nom d'application : N'importe quelle application
		* Version d'application : N'importe quelle version
    * Seuil
      * Type de seuil : Nombre de pannes
      * Opérateur : Est supérieur ou égal à 5
4. Cliquez sur l'onglet **Méthode de distribution** et indiquez la valeur suivante :
  * Méthode : Console Analytics uniquement

    **Remarque** : Choisissez l'option **Console Analytics et publication sur le réseau** si vous souhaitez envoyer également un message POST avec un contenu JSON à votre URL personnalisée. Les zones suivantes sont disponibles lorsque vous choisissez cette option :
      * Adresse URL de publication sur le réseau (obligatoire)
      * En-têtes (facultative)
      * Type d'authentification (obligatoire)
5. Cliquez sur **Sauvegarder**.

### Gestion des définitions d'alerte
{: #managing-alert-definitions}

Dans cet exemple, vous gérez vos définitions d'alerte à partir de la page Gestion des alerte.

1. Dans la console {{site.data.keyword.mobileanalytics_short}}, cliquez sur l'icône **Alertes**. Cette action permet d'afficher la page Journal des alertes.
2. Cliquez sur l'onglet **Gestion des alertes**.
3. Facultatif : Sélectionnez ou désélectionnez la case à cocher située sous la colonne **Activé** pour activer ou désactiver une définition d'alerte donnée.
4. Facultatif : Cliquez sur l'icône **Dupliquer** si vous souhaitez créer une copie d'une définition d'alerte et modifier certaines valeurs.
5. Facultatif : Cliquez sur l'icône **Crayon** si vous souhaitez éditer une définition d'alerte.
6. Facultatif : Cliquez sur l'icône **Corbeille** si vous souhaitez supprimer une définition d'alerte.

### Affichage des détails d'alerte
{: #viewing-alert-details}

Dans cet exemple, vous affichez les détails de vos alertes déclenchées à partir de la page Journal des alertes.

1. Dans la console {{site.data.keyword.mobileanalytics_short}}, cliquez sur l'icône **Alertes**. Cette action permet d'afficher la page Journal des alertes.
2. Cliquez sur l'icône **+** pour n'importe laquelle des alertes. Cette action permet d'afficher les sections **Définition d'alerte** et **Instances d'alerte**.

    **Remarque** : Si la définition d'alerte correspondante n'a pas été supprimée ou modifiée, vous pouvez l'éditer en cliquant sur **Editer une alerte**. Sinon, le bouton **Editer une alerte** n'est pas disponible et le message suivant s'affiche :

    `Depuis, cette définition d'alerte a été modifiée ou supprimée. `

3. Facultatif : Sélectionnez une alerte et cliquez sur l'icône **Corbeille** pour la supprimer.

## Pannes d'application
{: #monitor-app-crash}

Vous pouvez afficher les informations relatives à vos pannes d'application dans la console {{site.data.keyword.mobileanalytics_short}} afin d'améliorer la surveillance et l'identification et la résolution des problèmes liés à vos applications.

### Surveillance de pannes d'application
{: #app-crash}

Vous pouvez afficher rapidement les informations relatives à vos pannes d'application dans la section **Tableau de bord** de la console {{site.data.keyword.mobileanalytics_short}}.

Sur la page **Présentation** de la section **Tableau de bord**, le diagramme à barres **Pannes** illustre un histogramme des pannes au fil du temps.

Vous pouvez afficher les données de deux façons :

1. Afficher le taux de pannes : taux de pannes au fil du temps
2. Afficher le nombre total de pannes : nombre total de pannes au fil du temps

### Traitement des incidents liés aux pannes d'application
{: #app-crash-troubleshooting}

Vous pouvez afficher la page **Pannes** qui se trouve dans la section **Applications** de la console {{site.data.keyword.mobileanalytics_short}} pour mieux administrer vos applications.

Le tableau **Présentation des pannes** affiche les colonnes de données suivantes :

* Application : Nom d'application
* Pannes : Nombre total de pannes pour cette application
* Nombre total d'utilisations : Nombre total de fois qu'un utilisateur ouvre et ferme cette application
* Taux de pannes : Pourcentage de pannes par utilisation

Le tableau **Récapitulatif des pannes** inclut les colonnes de données suivantes et peut être trié :

* Pannes
* Périphériques
* Dernière panne
* Application
* Système d'exploitation
* Message

Vous pouvez cliquer sur l'icône + située en regard de n'importe quelle entrée pour afficher le tableau **Détails des pannes**, qui inclut les colonnes suivantes :

* Heure de la panne
* Version de l'application
* Version du système d'exploitation
* Modèle de périphérique
* ID du périphérique
* Télécharger : lien permettant de télécharger les journaux qui ont conduit à la panne

Vous pouvez développer n'importe quelle entrée du tableau **Détails des pannes** pour obtenir plus de détails, y compris une trace de pile.

**Remarque** : Le tableau **Récapitulatif des pannes** est renseigné en exécutant une requête sur les journaux client de niveau Fatal. Si votre application ne collecte pas de journaux client de niveau Fatal, aucune donnée n'est disponible.


text:
set :default_env, { path: "/usr/local/ruby22/bin:$PATH" }
set :deploy_to, '/home/deploy/jobs.ruby.tw'
set :branch, ENV["REVISION"] || ENV["BRANCH_NAME"] || "master"
set :stage, :production
role :web, "deploy@do.5xruby.tw"
role :app, "deploy@do.5xruby.tw"
role :db,  "deploy@do.5xruby.tw", :primary => true


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>Class Session\Session</title>

	<link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e">

		Overview

Namespaces

						Session

Classes

Session

SessionContainer

SessionFactory

Exceptions

SessionException

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

				Overview

				Namespace

Class

Class Session

		Namespace: Session

			Located at Session.php

Methods summary

			 public

		#
		__construct(  <var>$id</var>,  <var>$timeout</var> = -1 )

			 public

		#
		getNames( )

			 public

		#
		getCreationTime( )

			 public

		#
		getLastAccessedTime( )

			 public

		#
		isValid( )

			 public

		#
		updateLastAccess( )

			 public

		#
		getTimeout( )

			 public

		#
		setTimeout(  <var>$timeout</var> )

			 public

		#
		get(  <var>$key</var>,  <var>$default</var> = null )

			 public

		#
		set(  <var>$key</var>,  <var>$value</var> )

		 API documentation generated by ApiGen


text:
#ifndef _ROUND_LUA_ENGINE_H_
#define _ROUND_LUA_ENGINE_H_

#include <round/node_internal.h>
#include <round/script_internal.h>
#include <round/method.h>
#include <round/platform.h>

#ifdef  __cplusplus
extern "C" {
#endif

#if defined(ROUND_SUPPORT_LUA)
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#endif

#define RoundLuaEngineLanguage "lua"

typedef struct {
  ROUND_SCRIPT_ENGINE_STRUCT_MEMBERS

#if defined(ROUND_SUPPORT_LUA)
  lua_State *luaState;
#endif
} RoundLuaEngine;

RoundLuaEngine *round_lua_engine_new();
bool round_lua_engine_init(RoundLuaEngine *engine);
bool round_lua_engine_destory(RoundLuaEngine *engine);
bool round_lua_engine_delete(RoundLuaEngine *engine);

bool round_lua_engine_run(RoundLuaEngine *engine, RoundMethod *method, const char *param, RoundJSONObject** resObj, RoundError *err);

#define round_lua_engine_lock(engine) round_script_engine_lock((RoundScriptEngine *)engine)
#define round_lua_engine_unlock(engine) round_script_engine_unlock((RoundScriptEngine *)engine)

#if defined(ROUND_SUPPORT_LUA)
bool round_lua_engine_register(RoundLuaEngine *engine, const char *name, lua_CFunction func);
#endif

/****************************************
 * Function
 ****************************************/

#if defined(ROUND_SUPPORT_LUA)

void round_lua_setlocalnode(RoundLocalNode *);

int round_lua_getnetworkstate(lua_State* L);
int round_lua_getclusterstate(lua_State* L);
int round_lua_getlocalnodestate(lua_State* L);
int round_lua_setregistry(lua_State* L);
int round_lua_getregistry(lua_State* L);
int round_lua_removeregistry(lua_State* L);
int round_lua_postmethod(lua_State* L);

#endif

#ifdef  __cplusplus
}
#endif

#endif


text:
module Azure::DataBox::Mgmt::V2018_01_01
  module Models
    #
    # Output of the address validation api.
    #
    class AddressValidationOutput

      include MsRestAzure

      # @return [AddressValidationStatus] The address validation status.
      # Possible values include: 'Valid', 'Invalid', 'Ambiguous'
      attr_accessor :validation_status

      # @return [Array<ShippingAddress>] List of alternate addresses.
      attr_accessor :alternate_addresses

      #
      # Mapper for AddressValidationOutput class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'AddressValidationOutput',
          type: {
            name: 'Composite',
            class_name: 'AddressValidationOutput',
            model_properties: {
              validation_status: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.validationStatus',
                type: {
                  name: 'Enum',
                  module: 'AddressValidationStatus'
                }
              },
              alternate_addresses: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.alternateAddresses',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ShippingAddressElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ShippingAddress'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
@(project: Project)(implicit request: Request[_], userOpt: Option[User])

@main(title = "Project :: " + project.name){

@project.name

@project.description

    @for((version, vIdx) <- project.versions.zipWithIndex){

            @version.id

              @for((scalaVersion, sIdx) <- version.scalaVersions.zipWithIndex){

                    Scala @scalaVersion.id

                        @for((artifact, aIdx) <- scalaVersion.artifacts.zipWithIndex){

                                @artifact.id

SBT dependency

@Browser.dependencies.sbt(version, scalaVersion, artifact)

                                @for((label, path) <- artifact.files.seq){
                                  @label
                                }

Library dependencies

                                    Name
                                    Version
                                    Scope

                                  @for(dependency <- artifact.dependencies){

                                        @dependency.groupId
                                        .
                                        @dependency.artifactName

                                      @dependency.version
                                      @dependency.scope

                                  }

                        }

              }

    }

}


text:
package com.amazonaws.services.s3.internal;

import com.amazonaws.http.HttpResponse;
import com.amazonaws.services.s3.Headers;
import com.amazonaws.services.s3.model.InitiateMultipartUploadResult;

public class InitiateMultipartUploadHeaderHandler implements HeaderHandler<InitiateMultipartUploadResult> {
    @Override
    public void handle(InitiateMultipartUploadResult result, HttpResponse response) {
        result.setAbortDate(ServiceUtils.parseRfc822Date(response.getHeaders().get(Headers.ABORT_DATE)));
        result.setAbortRuleId(response.getHeaders().get(Headers.ABORT_RULE_ID));
    }
}


text:
var extractor = require('../extractor/mget');
var fixtures = require('./fixtures/_index');

module.exports.extractor = {};

module.exports.extractor.invalidMget = function(test, common) {
  test('constructor: invalidCallback', function(t) {
    var proxy = extractor();
    t.equal(typeof proxy, 'function', 'function returned');
    t.throws(proxy, /(undefined|cb) is not a function$/, 'exception thrown');
    t.end();
  });
}

module.exports.extractor.respEmitsError = function(test, common) {
  test('resp: emitsError', function(t) {
    var proxy = extractor( function( err, resp ){
      t.equal(typeof err, 'string', 'error emitted');
      t.equal(err, 'an upstream error', err);
      t.end();
    });
    t.equal(typeof proxy, 'function', 'function returned');
    proxy( 'an upstream error' ); // upstream error
  });
}

module.exports.extractor.respNoHits = function(test, common) {
  test('resp: respNoHits', function(t) {
    var proxy = extractor( function( err, resp ){
      t.equal(err, undefined, 'no error emitted');
      t.equal(resp, undefined, 'no result returned');
      t.end();
    });
    t.equal(typeof proxy, 'function', 'function returned');
    proxy(); // no hits
  });
}

module.exports.extractor.respContainedSomeMissedGets = function(test, common) {
  test('resp: respGotHits', function(t) {
    var proxy = extractor( function( err, resp ){
      t.equal(err, 'one or more node ids not found', 'no error emitted');
      t.end();
    });
    t.equal(typeof proxy, 'function', 'function returned');
    proxy( null, fixtures.failedmget );
  });
}

// Matched all mget
module.exports.extractor.respCompletedSuccessfully = function(test, common) {
  test('resp: respGotHits', function(t) {
    var proxy = extractor( function( err, resp ){
      t.equal(err, undefined, 'no error emitted');
      t.equal(Array.isArray(resp), true, 'array returned');
      t.equal(resp.length, 19, 'array contains 1 record');
      t.equal(resp[0]._id, '34034714', 'field returned');
      t.equal(resp[0]._index, 'pelias', 'field returned');
      t.equal(resp[0]._type, 'osmnode', 'field returned');
      t.equal(resp[0].type, 'node', 'field returned');
      t.equal(resp[0].center_point.lat, 33.5060419, 'field returned');
      t.equal(resp[0].center_point.lon, 36.2884532, 'field returned');
      t.end();
    });
    t.equal(typeof proxy, 'function', 'function returned');
    proxy( null, fixtures.mget );
  });
}

module.exports.extractor.genericFailure = function(test, common) {
  test('resp: genericFailure', function(t) {
    var proxy = extractor( function( err, resp ){
      t.equal(err, fixtures.genericfail.error, 'error emitted');
      t.equal(resp, undefined, 'no results returned');
      t.end();
    });
    t.equal(typeof proxy, 'function', 'function returned');
    proxy( null, fixtures.genericfail );
  });
}

module.exports.all = function (tape, common) {

  function test(name, testFunction) {
    return tape('mget extractor: ' + name, testFunction)
  }

  for( var testCase in module.exports.extractor ){
    module.exports.extractor[testCase](test, common);
  }
}


text:
<!--
  Copyright The Ohio State University Research Foundation, The University of Chicago -
Argonne National Laboratory, Emory University, SemanticBits LLC, and Ekagra Software Technologies Ltd.

  Distributed under the OSI-approved BSD 3-Clause License.
  See http://ncip.github.com/cagrid-core/LICENSE.txt for details.
-->
<?xml version="1.0"?>

<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd">

  <info organisation="caGrid" module="introduce-servicetools" revision="${project.version}">
    <license name="caGrid" url="http://cagrid.org/wiki/CaGrid:LICENSE-1.3"/>
    <description>Introduce Service Tools</description>
  </info>

  <configurations>
    <conf name="impl" visibility="private" extends="default" />
    <!-- Public Configurations-->
    <conf name="default" visibility="public" />
  </configurations>

  <publications>
    <artifact name="caGrid-Introduce-serviceTools" conf="default" type="jar" />
  </publications>

  <dependencies>
  </dependencies>
</ivy-module>


text:
package net.hycrafthd.corelib.util;

import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

/**
 * Utils for Colors ({@link NBTTagCompound} , {@link RGBA})
 *
 * @author HyCraftHD (https://www.hycrafthd.net)
 *
 */
public class ColorUtils {

	/**
	 * Read color code from itemstack
	 *
	 * @param stack
	 *            Itemstack
	 * @return colorcode
	 */
	public static int getColor(ItemStack stack) {
		NBTTagCompound nbttagcompound = stack.getTagCompound();
		if (nbttagcompound != null) {
			NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");

			if (nbttagcompound1 != null && nbttagcompound1.hasKey("color", 3)) {
				return nbttagcompound1.getInteger("color");
			}
		}
		return 4860944;
	}

	/**
	 * Remove current color from itemstack
	 *
	 * @param stack
	 *            Itemstack
	 */
	public static void removeColor(ItemStack stack) {
		NBTTagCompound nbttagcompound = stack.getTagCompound();
		if (nbttagcompound != null) {
			NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");

			if (nbttagcompound1.hasKey("color")) {
				nbttagcompound1.removeTag("color");
			}
		}
	}

	/**
	 * Set Color to itemstack
	 *
	 * @param stack
	 *            Itemstack
	 * @param color
	 *            Colorcode
	 */
	public static void setColor(ItemStack stack, int color) {
		NBTTagCompound nbttagcompound = stack.getTagCompound();
		if (nbttagcompound == null) {
			nbttagcompound = new NBTTagCompound();
			stack.setTagCompound(nbttagcompound);
		}
		NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");

		if (!nbttagcompound.hasKey("display", 10)) {
			nbttagcompound.setTag("display", nbttagcompound1);
		}
		nbttagcompound1.setInteger("color", color);
	}

	/**
	 * Converts int colorcodes to RGB
	 *
	 * @param color
	 *            colorcode
	 * @return RGBA
	 */
	public static RGBA hexToRGBA(int color) {
		int f3 = Math.round((float) (color >> 24 & 255) / 255.0F);
		int f = Math.round((float) (color >> 16 & 255) / 255.0F);
		int f1 = Math.round((float) (color >> 8 & 255) / 255.0F);
		int f2 = Math.round((float) (color & 255) / 255.0F);
		return new RGBA(f, f1, f2, f3);
	}

}


text:
#ifndef _SYS_IPC_H
# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
#endif

#include <bits/types.h>

/* Mode bits for `msgget', `semget', and `shmget'.  */
#define IPC_CREAT	01000		/* Create key if key does not exist. */
#define IPC_EXCL	02000		/* Fail if key exists.  */
#define IPC_NOWAIT	04000		/* Return error on wait.  */

/* Control commands for `msgctl', `semctl', and `shmctl'.  */
#define IPC_RMID	0		/* Remove identifier.  */
#define IPC_SET		1		/* Set `ipc_perm' options.  */
#define IPC_STAT	2		/* Get `ipc_perm' options.  */
#ifdef __USE_GNU
# define IPC_INFO	3		/* See ipcs.  */
#endif

/* Special key values.  */
#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */

/* Data structure used to pass permission information to IPC operations.  */
struct ipc_perm
  {
    __key_t __key;			/* Key.  */
    __uid_t uid;			/* Owner's user ID.  */
    __gid_t gid;			/* Owner's group ID.  */
    __uid_t cuid;			/* Creator's user ID.  */
    __gid_t cgid;			/* Creator's group ID.  */
    unsigned short int mode;		/* Read/write permission.  */
    unsigned short int __pad1;
    unsigned short int __seq;		/* Sequence number.  */
    unsigned short int __pad2;
    __syscall_ulong_t __unused1;
    __syscall_ulong_t __unused2;
  };


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

<!-- Test that the schema requires @iso-date in total-budget/period-start -->
<iati-organisation>
  <iati-identifier>12345</iati-identifier>
  <total-budget>
    <period-start>Q1 2011</period-start>
    <value value-date="2010-01-01">100</value>
  </total-budget>
</iati-organisation>


text:
try:
	from Tkinter import *
	from gui.menubar import MenuBar
	from gui.container import DisplayBox
	from time import localtime, strftime
# passes the program execution if import wasn't successful
except ImportError, e:
	print e
	print "Please make sure that all the required libraries:\n Tkinter, Scapy, Pmw are installed and working properly in your system.\nPlease run this program later!"
	print "\n\n" + "="*50 + "\nExiting System."
	exit()

# Guards program execution
if __name__ == '__main__':
	# variable to store current date and time.
	start_time = strftime("%Y-%m-%d %H:%M:%S", localtime())
	print "Start time: %s" % start_time

	# Instantiate Tk() to create new window
	root = Tk()
	#root.geometry("800x1000+300+300")

	# Read optionfile containing values for widget's attributes
	root.option_readfile("gui/optionDB")
	root.title("WLAN Manager")

	# Instantiating the class MenuBar to add Menu bar in the top of window
	mb = MenuBar(root)
	# Instantiating Displaybox class to add action panel and canvas in the main window
	db = DisplayBox(root)
	#db.create_box(root)
	root.mainloop()