text:
/* GLOBAL VARIABLES */
var gameCanvas,
	gameContext,
	heroCanvas,
	heroContext,
	updates,
	imgDir,
	img,
	renderCounter = 0,
	updateCounter = 0,
	map,
	character,
	xPos,
	yPos,
	inputKey,
	isRunning = 	false,
	runDirection = 	'down',
	helpEvent = 	null,
	heroImage,
	heroOffsetX = 	0,
	heroOffsetY = 	0,
	gameTick = 		Date.now(),
	gameAudio = 	loadAudios(),
	monsterCanvas = [],
	itemCanvas = 	[];
/* END GLOBAL VARIABLES */

// Animation event listener
requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame;
window.addEventListener('load', eventWindowLoaded, false);

/**
* Initialize procedure when loaded
*
* @fires 	canvasFire()
* @fires 	actualizeStatusBar()
* @return 	void
* @see 		eventWindowLoaded()
*/
function eventWindowLoaded(){
	$(function(){

		// Init game soundtrack
		gameAudio.soundtrack = document.createElement('audio');

		gameAudio.soundtrack.setAttribute('id', 'game-audio-soundtrack');
		gameAudio.soundtrack.setAttribute('src', 'media/audio/map.mp3');

		// Set game soundtrack options
		gameAudio.soundtrack.autoplay = 	true;
		gameAudio.soundtrack.loop = 		true;
		gameAudio.soundtrack.muted = 		false;
		gameAudio.soundtrack.volume = 		0.15;

		updates = true;

		inputKey;

		helpEvent = 'start';

		canvasFire();

		actualizeStatusBar();
	});
}

/**
* Fires Canvas
*
* @fires 	gameCreate()
* @fires 	heroCreate()
* @fires 	heroMain()
* @fires 	gameMain()
* @return 	void
* @see 		canvasFire()
*/
function canvasFire(){
	gameCreate();
	heroCreate();

	heroMain();
	gameMain();
}

/**
* Init game audio
*
* @return 	array
* @see 		loadAudios()
*/
function loadAudios(){
	return {
		soundtrack: 	{},
		running: 		{},
		hitting: 		{},
		defending: 		{},
		dying: 			{},
		collecting: 	{},
		monster: 		{}
	};
}

/**
* Battle against a monster
*
* @param 	integer 	x
* @param 	integer 	y
* @return 	void
* @see 		battleMonster()
*/
function battleMonster(x, y){

	// Get monster
	var monster = hasMonster(x, y);

	// Add  battle window
	$('body').append('

');

	// Style battle window
	$('#game-battleground').css({
		position: 			'fixed',
		left: 				'0px',
		top: 				'0px',
		width: 				'100%',
		height: 			'100%',
		overflow: 			'auto',
		backgroundColor: 	'rgba(0, 0, 0, 0.8)',
		zIndex: 			'20',
		textAlign: 			'center',
		paddingTop: 		'50vh',
		display: 			'none'
	});

	// Style battle window content
	$('#game-battleground .content').css({
			width: 			'50vw',
			minWidth: 		'300px',
			margin: 		'auto',
		    marginTop: 		'-20vh',
			height: 		'40vh',
			background: 	'#DDDDDD',
			padding: 		'0px',
			border: 		'2px solid #DDDDDD',
			borderRadius: 	'5px',
		overflow: 			'auto'
	});

	// Add loader
	$('#game-battleground .content').html(
		'
' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
			'

' +
		'
'
	);

	// Open battle window
	$('#game-battleground').fadeIn(400);

	// Load battle
	$('#game-battleground .content').load('view/popup/battle.inc.php?x=' + x + '&y=' + y + '&monster=' + monster, function(){
		$('#game-battleground .content').hide();
		$('#game-battleground .content').slideDown(400);
	});
}

/**
* Collecting an item
*
* @param 	integer 	x
* @param 	integer 	y
* @return 	void
* @see 		collectItem()
*/
function collectItem(x, y){

	// Get item
	var item = hasItem(x, y);

	// Collect item in database
	$.ajax({
		type: 		'post',
		url: 		'ajax/collectItem.ajax.php',
		dataType: 	'json',
		data: 		{
			session: 	gameId,
			x: 			x,
			y: 			y,
			item: 		item
		},
		cache: 		false,
        async: 		false,
	}).done(function(data){

		// Check if collecting was successful
		if(data.status === true){

			// Delete item from array
			map.field[xPos + ':' + yPos].item = '';

			// Add callback window
			$('body').append('
' + data.message + '
');

			// Style callback window
			$('.item-collect-callback').css({
				position: 	'fixed',
				width: 		'100%',
				left: 		'0px',
				textAlign: 	'center',
				top: 		'40vh',
				fontSize: 	'22px',
				fontWeight: '900',
				color: 		'#222222',
				textShadow: '-1px 0 #DDDDDD, 0 1px #DDDDDD, 1px 0 #DDDDDD, 0 -1px #DDDDDD',
				display: 	'none'
			});

			// Show callback window
			$('.item-collect-callback').fadeIn(400, function(){
				setTimeout(function(){

					// Animate callback window
					$('.item-collect-callback').animate(
						{
							top: '-' + $('.item-collect-callback').height() + 'px'
						},
						400,
						function(){

							// Delete callback window
							$('.item-collect-callback').detach();
						}
					)
				}, 1000);
			});
		}
	});

	// Reset help event
	helpEvent = null;
}

/**
* Create a new map
*
* @fire 	canvasFire()
* @return 	void
* @see 		createMap()
*/
function createMap(){
	updates = true;

	// Delete Map in database
	$.ajax({
		type: 		'post',
		url: 		'ajax/deleteMap.ajax.php',
		dataType: 	'json',
		data: 		{
			session: gameId
		},
		cache: 		false,
		async: 		false
	});

	// Set level + 1 in database
	$.ajax({
		type: 		'post',
		url: 		'ajax/levelUp.ajax.php',
		dataType: 	'json',
		data: 		{
			session: gameId
		},
		cache: 		false,
		async: 		false
	});

	// Save data to highscore
	$.ajax({
		type: 		'post',
		url: 		'ajax/saveHighscore.ajax.php',
		dataType: 	'json',
		data: 		{
			session: gameId
		},
		cache: 		false,
		async: 		false
	});

	// Reload audio
	gameAudio = loadAudios();

	// Delete audio
	$('audio').detach();
	$('canvas').detach();
	$('#game-canvas').children().detach();

	canvasFire();

	// Reset help event
	helpEvent = null;

	// Refresh page
	location.reload();
}

/**
* Refresh status bar values (gold, hp, exp)
*
* @fires 	actualizeStatusBar()
* @return 	void
* @see 		actualizeStatusBar()
*/
function actualizeStatusBar(){

	// Get player data from database
	$.ajax({
		type: 		'post',
		url: 		'ajax/getPlayer.ajax.php',
		dataType: 	'json',
		data: 		{
			session: gameId
		},
		cache: 		false,
		async: 		false
	}).done(function(data){

		// Add data to status bar
		$('#game-navigation #lvl').html(data.stats.lvl);
		$('#game-navigation #gold').html(data.stats.gold);
		$('#game-navigation #actEXP').html(data.stats.exp);
		$('#game-navigation #actTP').html(data.stats.tp);
		$('#game-navigation #maxTP').html(data.stats.maxTp);

		$('#game-navigation #actTp').closest('.progress').find('.progress-bar').attr('aria-valuenow', data.stats.tp);
		$('#game-navigation #actTp').closest('.progress').find('.progress-bar').attr('aria-valuemax', data.stats.maxTp);
		$('#game-navigation #actTp').closest('.progress').find('.progress-bar').css({
			width: ((data.stats.tp / data.stats.maxTp) * 100) + '%'
		});
	});

	// Relaod this function
	setTimeout(function(){
		actualizeStatusBar();
	}, 250);
}


text:
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;

using XenAdmin.Dialogs;

namespace XenAdmin.Controls
{
    /// <summary>
    /// Utility class for viewing the members of System.Drawing.SystemColors and System.Windows.Forms.ProfessionalColors.
    ///
    /// Try 'XenAdmin.Controls.ColorsHelper.Run()' in the Immediate Window.
    /// </summary>
    public partial class ColorsHelper : XenDialogBase
    {
        public ColorsHelper()
        {
            InitializeComponent();

            foreach (PropertyInfo pi in typeof(SystemColors).GetProperties())
            {
                if (pi.PropertyType == typeof(Color))
                {
                    Label label1 = new Label();
                    label1.Text = "SystemColors." + pi.Name;
                    label1.Dock = DockStyle.Fill;
                    tableLayoutPanel1.Controls.Add(label1);

                    Label label2 = new Label();
                    label2.Dock = DockStyle.Fill;
                    label2.BackColor = (Color)pi.GetValue(null, null);
                    tableLayoutPanel1.Controls.Add(label2);
                }
            }

            foreach (PropertyInfo pi in typeof(ProfessionalColors).GetProperties())
            {
                if (pi.PropertyType == typeof(Color))
                {
                    Label label1 = new Label();
                    label1.Text = "ProfessionalColors." + pi.Name;
                    label1.Dock = DockStyle.Fill;
                    tableLayoutPanel2.Controls.Add(label1);

                    Label label2 = new Label();
                    label2.Dock = DockStyle.Fill;
                    label2.BackColor = (Color)pi.GetValue(null, null);
                    tableLayoutPanel2.Controls.Add(label2);
                }
            }
        }

        static void Run()
        {
            Application.EnableVisualStyles();
            Application.Run(new ColorsHelper());
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
WWDC 2017

Table of Contents
=================

  * [What's New in Testing \- Thursday](#whats-new-in-testing---thursday)
    * [Enhancements](#enhancements)
      * [xcodebuild](#xcodebuild)
      * [XCode Server](#xcode-server)
    * [Async Testing](#async-testing)
      * [There were limitations](#there-were-limitations)
      * [XCTWaiter](#xctwaiter)
      * [XCTestExpectation](#xctestexpectation)
    * [Multi\-app Testing in UI Testing](#multi-app-testing-in-ui-testing)
    * [UI Testing Performance](#ui-testing-performance)
      * [First match vs Match Auto](#first-match-vs-match-auto)
    * [Block\-based NSPredicate](#block-based-nspredicate)
    * [Screenshot & Attachments API in UI Tests](#screenshot--attachments-api-in-ui-tests)

# What's New in Testing - Thursday
Session video and resources: https://developer.apple.com/videos/play/wwdc2017/409/

## Enhancements
  - UI Testing in Xcode 8.3
    - Siri
    - UITouchBar
  - Xcode 9
    - Swift 4
    - Block-based teardown
  - UI Test speed enhancements
### xcodebuild
  - CoreSimulator without launchinf simulator app
  - Parallel device testing - YES ! with multiple `- destination`
  - Localization
### XCode Server
  - Improved provisioning workflow
  - CoreSimulator
  - Parallel Testing

## Async Testing
  - Validate calls which doesn't finish immediately
    - Opening docs
    - Work on background threads
    - Network activities
    - UI animations
  - Create expectations and fulfill
### There were limitations
  - Timeout was always a failure
  - Waiting requires test object
  - No nested Waiting
### XCTWaiter
  - Extracted logic from `XCTestCase`
  - Calls back to `XCTWaiterDelegate`

  ```
  XCTWaiter(delegate : self).wait(for: [expectation], timeout: 10)
  ```
### XCTestExpectation
  - Public initializer
    - Decoupled from `XCTestCase`
  - Multiple fulfillments
  - Ordering enforcement for expectations

## Multi-app Testing in UI Testing
  - Scenarios
    - App groups
    - Settings
    - Extensions
  - Additions to `XCUIApplication`
    - New initializers
    - Activate method `func activate()`
      - Useful for scenarios where there is no need to wipe out previous scenarios
  ```
  let readerApp = XCUIApplication(bundleIdentifier: "/////")
  let writerApp = XCUIApplication(bundleIdentifier: "/////")

  readerApp.launch()
  // Assertion to read something in the app

  writerApp.activate()
  // Write something and send via tap etc.

  // set an expectation with a predicate that readerApp is on foreground
  // wait for timeout
  ```

## UI Testing Performance
  - User interface elements
    - Buttons, labels etc.
  - Faster in XCode 9
### First match vs Match Auto

## Block-based `NSPredicate`

## Screenshot & Attachments API in UI Tests


text:
package org.apache.hadoop.streaming;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.File;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapred.Counters;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.MiniMRCluster;
import org.apache.hadoop.mapred.TaskAttemptID;
import org.apache.hadoop.mapred.TaskID;
import org.apache.hadoop.mapred.TaskLog;
import org.apache.hadoop.mapred.TaskReport;
import org.apache.hadoop.mapreduce.MRJobConfig;
import org.apache.hadoop.mapreduce.TaskType;
import org.apache.hadoop.mapreduce.MapReduceTestUtil;
import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;

/**
 * Tests if mapper/reducer with empty/nonempty input works properly if
 * reporting is done using lines like "reporter:status:" and
 * "reporter:counter:" before map()/reduce() method is called.
 * Validates the task's log of STDERR if messages are written to stderr before
 * map()/reduce() is called.
 * Also validates job output.
 * Uses MiniMR since the local jobtracker doesn't track task status.
 */
public class TestStreamingStatus {
  protected static String TEST_ROOT_DIR =
    new File(System.getProperty("test.build.data","/tmp"),
    TestStreamingStatus.class.getSimpleName())
    .toURI().toString().replace(' ', '+');
  protected String INPUT_FILE = TEST_ROOT_DIR + "/input.txt";
  protected String OUTPUT_DIR = TEST_ROOT_DIR + "/out";
  protected String input = "roses.are.red\nviolets.are.blue\nbunnies.are.pink\n";
  protected String map = null;
  protected String reduce = null;

  protected String scriptFile = TEST_ROOT_DIR + "/perlScript.pl";
  protected String scriptFileName = new Path(scriptFile).toUri().getPath();

  String expectedStderr = "my error msg before consuming input\n" +
      "my error msg after consuming input\n";
  String expectedOutput = null;// inited in setUp()
  String expectedStatus = "before consuming input";

  // This script does the following
  // (a) setting task status before reading input
  // (b) writing to stderr before reading input and after reading input
  // (c) writing to stdout before reading input
  // (d) incrementing user counter before reading input and after reading input
  // Write lines to stdout before reading input{(c) above} is to validate
  // the hanging task issue when input to task is empty(because of not starting
  // output thread).
  protected String script =
    "#!/usr/bin/perl\n" +
    "print STDERR \"reporter:status:" + expectedStatus + "\\n\";\n" +
    "print STDERR \"reporter:counter:myOwnCounterGroup,myOwnCounter,1\\n\";\n" +
    "print STDERR \"my error msg before consuming input\\n\";\n" +
    "for($count = 1500; $count >= 1; $count--) {print STDOUT \"$count \";}" +
    "while(<STDIN>) {chomp;}\n" +
    "print STDERR \"my error msg after consuming input\\n\";\n" +
    "print STDERR \"reporter:counter:myOwnCounterGroup,myOwnCounter,1\\n\";\n";

  MiniMRCluster mr = null;
  FileSystem fs = null;
  JobConf conf = null;

  /**
   * Start the cluster and create input file before running the actual test.
   *
   * @throws IOException
   */
  @Before
  public void setUp() throws IOException {
    conf = new JobConf();
    conf.setBoolean(JTConfig.JT_RETIREJOBS, false);
    conf.setBoolean(JTConfig.JT_PERSIST_JOBSTATUS, false);

    mr = new MiniMRCluster(1, "file:///", 3, null , null, conf);

    Path inFile = new Path(INPUT_FILE);
    fs = inFile.getFileSystem(mr.createJobConf());
    clean(fs);

    buildExpectedJobOutput();
  }

  /**
   * Kill the cluster after the test is done.
   */
  @After
  public void tearDown() {
    if (fs != null) { clean(fs); }
    if (mr != null) { mr.shutdown(); }
  }

  // Updates expectedOutput to have the expected job output as a string
  void buildExpectedJobOutput() {
    if (expectedOutput == null) {
      expectedOutput = "";
      for(int i = 1500; i >= 1; i--) {
        expectedOutput = expectedOutput.concat(Integer.toString(i) + " ");
      }
      expectedOutput = expectedOutput.trim();
    }
  }

  // Create empty/nonempty input file.
  // Create script file with the specified content.
  protected void createInputAndScript(boolean isEmptyInput,
      String script) throws IOException {
    makeInput(fs, isEmptyInput ? "" : input);

    // create script file
    DataOutputStream file = fs.create(new Path(scriptFileName));
    file.writeBytes(script);
    file.close();
  }

  protected String[] genArgs(String jobtracker, String mapper, String reducer)
  {
    return new String[] {
      "-input", INPUT_FILE,
      "-output", OUTPUT_DIR,
      "-mapper", mapper,
      "-reducer", reducer,
      "-jobconf", MRJobConfig.NUM_MAPS + "=1",
      "-jobconf", MRJobConfig.NUM_REDUCES + "=1",
      "-jobconf", MRJobConfig.PRESERVE_FAILED_TASK_FILES + "=true",
      "-jobconf", "stream.tmpdir=" + new Path(TEST_ROOT_DIR).toUri().getPath(),
      "-jobconf", JTConfig.JT_IPC_ADDRESS + "="+jobtracker,
      "-jobconf", "fs.default.name=file:///",
      "-jobconf", "mapred.jar=" + TestStreaming.STREAMING_JAR,
      "-jobconf", "mapreduce.framework.name=yarn"
    };
  }

  // create input file with the given content
  public void makeInput(FileSystem fs, String input) throws IOException {
    Path inFile = new Path(INPUT_FILE);
    DataOutputStream file = fs.create(inFile);
    file.writeBytes(input);
    file.close();
  }

  // Delete output directory
  protected void deleteOutDir(FileSystem fs) {
    try {
      Path outDir = new Path(OUTPUT_DIR);
      fs.delete(outDir, true);
    } catch (Exception e) {}
  }

  // Delete input file, script file and output directory
  public void clean(FileSystem fs) {
    deleteOutDir(fs);
    try {
      Path file = new Path(INPUT_FILE);
      if (fs.exists(file)) {
        fs.delete(file, false);
      }
      file = new Path(scriptFile);
      if (fs.exists(file)) {
        fs.delete(file, false);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  /**
   * Check if mapper/reducer with empty/nonempty input works properly if
   * reporting is done using lines like "reporter:status:" and
   * "reporter:counter:" before map()/reduce() method is called.
   * Validate the task's log of STDERR if messages are written
   * to stderr before map()/reduce() is called.
   * Also validate job output.
   *
   * @throws IOException
   */
  @Test
  public void testReporting() throws Exception {
    testStreamJob(false);// nonempty input
    testStreamJob(true);// empty input
  }

  /**
   * Run a streaming job with the given script as mapper and validate.
   * Run another streaming job with the given script as reducer and validate.
   *
   * @param isEmptyInput Should the input to the script be empty ?
   * @param script The content of the script that will run as the streaming task
   */
  private void testStreamJob(boolean isEmptyInput)
      throws IOException {

      createInputAndScript(isEmptyInput, script);

      // Check if streaming mapper works as expected
      map = scriptFileName;
      reduce = "/bin/cat";
      runStreamJob(TaskType.MAP, isEmptyInput);
      deleteOutDir(fs);

      // Check if streaming reducer works as expected.
      map = "/bin/cat";
      reduce = scriptFileName;
      runStreamJob(TaskType.REDUCE, isEmptyInput);
      clean(fs);
  }

  // Run streaming job for the specified input file, mapper and reducer and
  // (1) Validate if the job succeeds.
  // (2) Validate if user counter is incremented properly for the cases of
  //   (a) nonempty input to map
  //   (b) empty input to map and
  //   (c) nonempty input to reduce
  // (3) Validate task status for the cases of (2)(a),(2)(b),(2)(c).
  //     Because empty input to reduce task => reporter is dummy and ignores
  //     all "reporter:status" and "reporter:counter" lines.
  // (4) Validate stderr of task of given task type.
  // (5) Validate job output
  void runStreamJob(TaskType type, boolean isEmptyInput) throws IOException {
    boolean mayExit = false;
    StreamJob job = new StreamJob(genArgs(
        mr.createJobConf().get(JTConfig.JT_IPC_ADDRESS), map, reduce), mayExit);
    int returnValue = job.go();
    assertEquals(0, returnValue);

    // If input to reducer is empty, dummy reporter(which ignores all
    // reporting lines) is set for MRErrorThread in waitOutputThreads(). So
    // expectedCounterValue is 0 for empty-input-to-reducer case.
    // Output of reducer is also empty for empty-input-to-reducer case.
    int expectedCounterValue = 0;
    if (type == TaskType.MAP || !isEmptyInput) {
      validateTaskStatus(job, type);
      // output is from "print STDOUT" statements in perl script
      validateJobOutput(job.getConf());
      expectedCounterValue = 2;
    }
    validateUserCounter(job, expectedCounterValue);
    validateTaskStderr(job, type);

    deleteOutDir(fs);
  }

  // validate task status of task of given type(validates 1st task of that type)
  void validateTaskStatus(StreamJob job, TaskType type) throws IOException {
    // Map Task has 2 phases: map, sort
    // Reduce Task has 3 phases: copy, sort, reduce
    String finalPhaseInTask;
    TaskReport[] reports;
    if (type == TaskType.MAP) {
      reports = job.jc_.getMapTaskReports(job.jobId_);
      finalPhaseInTask = "sort";
    } else {// reduce task
      reports = job.jc_.getReduceTaskReports(job.jobId_);
      finalPhaseInTask = "reduce";
    }
    assertEquals(1, reports.length);
    assertEquals(expectedStatus + " > " + finalPhaseInTask,
        reports[0].getState());
  }

  // Validate the job output
  void validateJobOutput(Configuration conf)
      throws IOException {

    String output = MapReduceTestUtil.readOutput(
        new Path(OUTPUT_DIR), conf).trim();

    assertTrue(output.equals(expectedOutput));
  }

  // Validate stderr task log of given task type(validates 1st
  // task of that type).
  void validateTaskStderr(StreamJob job, TaskType type)
      throws IOException {
    TaskAttemptID attemptId =
        new TaskAttemptID(new TaskID(job.jobId_, type, 0), 0);

    String log = MapReduceTestUtil.readTaskLog(TaskLog.LogName.STDERR,
        attemptId, false);

    // trim() is called on expectedStderr here because the method
    // MapReduceTestUtil.readTaskLog() returns trimmed String.
    assertTrue(log.equals(expectedStderr.trim()));
  }

  // Validate if user counter is incremented properly
  void validateUserCounter(StreamJob job, int expectedCounterValue)
      throws IOException {
    Counters counters = job.running_.getCounters();
    assertEquals(expectedCounterValue, counters.findCounter(
        "myOwnCounterGroup", "myOwnCounter").getValue());
  }

}


text:
package org.market.tool.ui;

import org.market.tool.R;
import org.market.tool.view.HeaderLayout.onRightImageButtonClickListener;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import cn.bmob.im.util.BmobLog;

import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.mapapi.SDKInitializer;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.BitmapDescriptor;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.MapStatusUpdate;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.MyLocationConfigeration;
import com.baidu.mapapi.map.MyLocationData;
import com.baidu.mapapi.map.OverlayOptions;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.geocode.GeoCodeResult;
import com.baidu.mapapi.search.geocode.GeoCoder;
import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeOption;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult;

/**
 * ÓÃÓÚ·¢ËÍλÖõĽçÃæ
 *
 * @ClassName: LocationActivity
 * @Description: TODO
 * @author smile
 * @date 2014-6-23 ÏÂÎç3:17:05
 */
public class LocationActivity extends BaseActivity implements
		OnGetGeoCoderResultListener {

	// ¶¨Î»Ïà¹Ø
	LocationClient mLocClient;
	public MyLocationListenner myListener = new MyLocationListenner();
	BitmapDescriptor mCurrentMarker;

	MapView mMapView;
	BaiduMap mBaiduMap;

	private BaiduReceiver mReceiver;// ×¢²á¹ã²¥½ÓÊÕÆ÷£¬ÓÃÓÚ¼àÌýÍøÂçÒÔ¼°ÑéÖ¤key

	GeoCoder mSearch = null; // ËÑË÷Ä£¿é£¬ÒòΪ°Ù¶È¶¨Î»sdkÄܹ»µÃµ½¾Î³¶È£¬µ«ÊÇÈ´ÎÞ·¨µÃµ½¾ßÌåµÄÏêϸµØÖ·£¬Òò´ËÐèÒª²ÉÈ¡·´±àÂ뷽ʽȥËÑË÷´Ë¾Î³¶È´ú±íµÄµØÖ·

	static BDLocation lastLocation = null;

	BitmapDescriptor bdgeo = BitmapDescriptorFactory.fromResource(R.drawable.icon_geo);

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_location);
		initBaiduMap();
	}

	private void initBaiduMap() {
		// µØͼ³õ'»¯
		mMapView = (MapView) findViewById(R.id.bmapView);
		mBaiduMap = mMapView.getMap();
		//ÉèÖÃËõ·Å¼¶±ð
		mBaiduMap.setMaxAndMinZoomLevel(18, 13);
		// ×¢²á SDK ¹ã²¥¼àÌýÕß
		IntentFilter iFilter = new IntentFilter();
		iFilter.addAction(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_ERROR);
		iFilter.addAction(SDKInitializer.SDK_BROADCAST_ACTION_STRING_NETWORK_ERROR);
		mReceiver = new BaiduReceiver();
		registerReceiver(mReceiver, iFilter);

		Intent intent = getIntent();
		String type = intent.getStringExtra("type");
		if (type.equals("select")) {// Ñ¡Ôñ·¢ËÍλÖÃ
			initTopBarForBoth("λÖÃ", R.drawable.btn_login_selector, "·¢ËÍ",
					new onRightImageButtonClickListener() {

						@Override
						public void onClick() {
							// TODO Auto-generated method stub
							gotoChatPage();
						}
					});
			mHeaderLayout.getRightImageButton().setEnabled(false);
			initLocClient();
		} else {// ²é¿´µ±Ç°Î»ÖÃ
			initTopBarForLeft("λÖÃ");
			Bundle b = intent.getExtras();
			LatLng latlng = new LatLng(b.getDouble("latitude"), b.getDouble("longtitude"));//ά¶ÈÔÚÇ°£¬¾¶ÈÔÚºó
			mBaiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(latlng));
			//ÏÔʾµ±Ç°Î»ÖÃͼ±ê
			OverlayOptions ooA = new MarkerOptions().position(latlng).icon(bdgeo).zIndex(9);
			mBaiduMap.addOverlay(ooA);
		}

		mSearch = GeoCoder.newInstance();
		mSearch.setOnGetGeoCodeResultListener(this);

	}

	/**
	 * »Øµ½ÁÄÌì½çÃæ
	 * @Title: gotoChatPage
	 * @Description: TODO
	 * @param
	 * @return void
	 * @throws
	 */
	private void gotoChatPage() {
		if(lastLocation!=null){
			Intent intent = new Intent();
			intent.putExtra("y", lastLocation.getLongitude());// ¾¶È
			intent.putExtra("x", lastLocation.getLatitude());// ά¶È
			intent.putExtra("address", lastLocation.getAddrStr());
			setResult(RESULT_OK, intent);
			this.finish();
		}else{
			ShowToast("»ñÈ¡µØÀíλÖÃÐÅϢʧ°Ü!");
		}
	}

	private void initLocClient() {
//		 ¿ªÆô¶¨Î»Í¼²ã
		mBaiduMap.setMyLocationEnabled(true);
		mBaiduMap.setMyLocationConfigeration(new MyLocationConfigeration(
				com.baidu.mapapi.map.MyLocationConfigeration.LocationMode.NORMAL, true, null));
		// ¶¨Î»³õ'»¯
		mLocClient = new LocationClient(this);
		mLocClient.registerLocationListener(myListener);
		LocationClientOption option = new LocationClientOption();
		option.setProdName("bmobim");// ÉèÖòúÆ·Ïß
		option.setOpenGps(true);// ´ò¿ªgps
		option.setCoorType("bd09ll"); // ÉèÖÃ×ø±êÀàÐÍ
		option.setScanSpan(1000);
		option.setOpenGps(true);
		option.setIsNeedAddress(true);
		option.setIgnoreKillProcess(true);
		mLocClient.setLocOption(option);
		mLocClient.start();
		if (mLocClient != null && mLocClient.isStarted())
		    mLocClient.requestLocation();

		if (lastLocation != null) {
			// ÏÔʾÔÚµØͼÉÏ
			LatLng ll = new LatLng(lastLocation.getLatitude(),
					lastLocation.getLongitude());
			MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
			mBaiduMap.animateMapStatus(u);
		}
	}

	/**
	 * ¶¨Î»SDK¼àÌýº¯Êý
	 */
	public class MyLocationListenner implements BDLocationListener {

		@Override
		public void onReceiveLocation(BDLocation location) {
			// map view Ïú»Ùºó²»ÔÚ´¦ÀíнÓÊÕµÄλÖÃ
			if (location == null || mMapView == null)
				return;

			if (lastLocation != null) {
				if (lastLocation.getLatitude() == location.getLatitude()
						&& lastLocation.getLongitude() == location
						.getLongitude()) {
					BmobLog.i("»ñÈ¡×ø±êÏàͬ");// ÈôÁ½´ÎÇëÇó»ñÈ¡µ½µÄµØÀíλÖÃ×ø±êÊÇÏàͬµÄ£¬Ôò²»ÔÙ¶¨Î»
					mLocClient.stop();
					return;
				}
			}
			lastLocation = location;

			BmobLog.i("lontitude = " + location.getLongitude() + ",latitude = "
					+ location.getLatitude() + ",µØÖ· = "
					+ lastLocation.getAddrStr());

			MyLocationData locData = new MyLocationData.Builder()
					.accuracy(location.getRadius())
					// ´Ë´¦ÉèÖÿª·¢Õß»ñÈ¡µ½µÄ·½ÏòÐÅÏ¢£¬Ë³Ê±Õë0-360
					.direction(100).latitude(location.getLatitude())
					.longitude(location.getLongitude()).build();
			mBaiduMap.setMyLocationData(locData);
			LatLng ll = new LatLng(location.getLatitude(),
					location.getLongitude());
			String address = location.getAddrStr();
			if (address != null && !address.equals("")) {
				lastLocation.setAddrStr(address);
			} else {
				// ·´GeoËÑË÷
				mSearch.reverseGeoCode(new ReverseGeoCodeOption().location(ll));
			}
			// ÏÔʾÔÚµØͼÉÏ
			MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
			mBaiduMap.animateMapStatus(u);
			//ÉèÖð´Å¥¿Éµã»÷
			mHeaderLayout.getRightImageButton().setEnabled(true);
		}

	}

	/**
	 * ¹¹Ôì¹ã²¥¼àÌýÀ࣬¼àÌý SDK key ÑéÖ¤ÒÔ¼°ÍøÂçÒì³£¹ã²¥
	 */
	public class BaiduReceiver extends BroadcastReceiver {
		public void onReceive(Context context, Intent intent) {
			String s = intent.getAction();
			if (s.equals(SDKInitializer.SDK_BROADTCAST_ACTION_STRING_PERMISSION_CHECK_ERROR)) {
				ShowToast("key ÑéÖ¤³ö´í! ÇëÔÚ AndroidManifest.xml ÎļþÖмì²é key ÉèÖÃ");
			} else if (s
					.equals(SDKInitializer.SDK_BROADCAST_ACTION_STRING_NETWORK_ERROR)) {
				ShowToast("ÍøÂç³ö´í");
			}
		}
	}

	@Override
	public void onGetGeoCodeResult(GeoCodeResult arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {
		// TODO Auto-generated method stub
		if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
			ShowToast("±§Ç¸£¬Î´ÄÜÕÒµ½½á¹û");
			return;
		}
		BmobLog.i("·´±àÂëµÃµ½µÄµØÖ·£º" + result.getAddress());
		lastLocation.setAddrStr(result.getAddress());
	}

	@Override
	protected void onPause() {
		mMapView.onPause();
		super.onPause();
		lastLocation = null;
	}

	@Override
	protected void onResume() {
		mMapView.onResume();
		super.onResume();
	}

	@Override
	protected void onDestroy() {
		if(mLocClient!=null && mLocClient.isStarted()){
			// Í˳öʱÏú»Ù¶¨Î»
			mLocClient.stop();
		}
		// ¹Ø±Õ¶¨Î»Í¼²ã
		mBaiduMap.setMyLocationEnabled(false);
		mMapView.onDestroy();
		mMapView = null;
		// È¡Ïû¼àÌý SDK ¹ã²¥
		unregisterReceiver(mReceiver);
		super.onDestroy();
		// »ØÊÕ bitmap ×ÊÔ´
		bdgeo.recycle();
	}

}


text:
class CreditCard : public FormGroup {
 public:
  explicit CreditCard(const std::string& guid);

  // For use in STL containers.
  CreditCard();
  CreditCard(const CreditCard& credit_card);
  virtual ~CreditCard();

  // FormGroup implementation:
  virtual void GetPossibleFieldTypes(const string16& text,
                                     FieldTypeSet* possible_types) const;
  virtual void GetAvailableFieldTypes(FieldTypeSet* available_types) const;
  virtual string16 GetInfo(AutofillFieldType type) const;
  virtual void SetInfo(AutofillFieldType type, const string16& value);
  // Credit card preview summary, for example: ******1234, Exp: 01/2020
  virtual const string16 Label() const;

  // Special method to set value for HTML5 month input type.
  void SetInfoForMonthInputType(const string16& value);

  // The number altered for display, for example: ******1234
  string16 ObfuscatedNumber() const;
  // The last four digits of the credit card number.
  string16 LastFourDigits() const;

  const std::string& type() const { return type_; }

  // The guid is the primary identifier for |CreditCard| objects.
  const std::string guid() const { return guid_; }
  void set_guid(const std::string& guid) { guid_ = guid; }

  // For use in STL containers.
  void operator=(const CreditCard& credit_card);

  // Comparison for Sync.  Returns 0 if the credit card is the same as |this|,
  // or < 0, or > 0 if it is different.  The implied ordering can be used for
  // culling duplicates.  The ordering is based on collation order of the
  // textual contents of the fields.
  // GUIDs, labels, and unique IDs are not compared, only the values of the
  // credit cards themselves.
  int Compare(const CreditCard& credit_card) const;

  // This is same as |Compare| for credit cards as they are single-valued.
  // This is here to unify templated code that deals with |FormGroup|s.
  int CompareMulti(const CreditCard& credit_card) const;

  // Used by tests.
  bool operator==(const CreditCard& credit_card) const;
  bool operator!=(const CreditCard& credit_card) const;

  // Return a version of |number| that has any separator characters removed.
  static const string16 StripSeparators(const string16& number);

  // Returns true if |text| looks like a valid credit card number.
  // Uses the Luhn formula to validate the number.
  static bool IsValidCreditCardNumber(const string16& text);

  // Returns true if there are no values (field types) set.
  bool IsEmpty() const;

  // Returns the credit card number.
  const string16& number() const { return number_; }

 private:
  // The month and year are zero if not present.
  int Expiration4DigitYear() const { return expiration_year_; }
  int Expiration2DigitYear() const { return expiration_year_ % 100; }
  string16 ExpirationMonthAsString() const;
  string16 Expiration4DigitYearAsString() const;
  string16 Expiration2DigitYearAsString() const;

  // Sets |expiration_month_| to the integer conversion of |text|.
  void SetExpirationMonthFromString(const string16& text);

  // Sets |expiration_year_| to the integer conversion of |text|.
  void SetExpirationYearFromString(const string16& text);

  // Sets |number_| to the stripped version of |number|, containing only digits.
  void SetNumber(const string16& number);

  // These setters verify that the month and year are within appropriate
  // ranges.
  void SetExpirationMonth(int expiration_month);
  void SetExpirationYear(int expiration_year);

  // Returns true if |text| matches the name on the card.  The comparison is
  // case-insensitive.
  bool IsNameOnCard(const string16& text) const;

  // Returns true if |text| matches the card number.
  bool IsNumber(const string16& text) const;

  // Returns true if |text| matches the expiration month of the card.
  bool IsExpirationMonth(const string16& text) const;

  // Returns true if the integer value of |text| matches the 2-digit expiration
  // year.
  bool Is2DigitExpirationYear(const string16& text) const;

  // Returns true if the integer value of |text| matches the 4-digit expiration
  // year.
  bool Is4DigitExpirationYear(const string16& text) const;

  string16 number_;  // The credit card number.
  string16 name_on_card_;  // The cardholder's name.
  std::string type_;  // The type of the card.

  // These members are zero if not present.
  int expiration_month_;
  int expiration_year_;

  // The guid of this credit card.
  std::string guid_;
};

// So we can compare CreditCards with EXPECT_EQ().
std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card);

// The string identifiers for credit card icon resources.
extern const char* const kAmericanExpressCard;
extern const char* const kDinersCard;
extern const char* const kDiscoverCard;
extern const char* const kGenericCard;
extern const char* const kJCBCard;
extern const char* const kMasterCard;
extern const char* const kSoloCard;
extern const char* const kVisaCard;

#endif  // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_


text:
/*
  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)

  Permission to use, copy, modify, distribute, and sell this
  software and its documentation for any purpose is hereby granted
  without fee, provided that the above copyright notice appear in
  all copies and that both that the copyright notice and this
  permission notice and warranty disclaimer appear in supporting
  documentation, and that the name of the author not be used in
  advertising or publicity pertaining to distribution of the
  software without specific, written prior permission.

  The author disclaim all warranties with regard to this
  software, including all implied warranties of merchantability
  and fitness.  In no event shall the author be liable for any
  special, indirect or consequential damages or any damages
  whatsoever resulting from loss of use, data or profits, whether
  in an action of contract, negligence or other tortious action,
  arising out of or in connection with the use or performance of
  this software.
*/

/** \file
 *  \brief USB Human Interface Device (HID) Class report descriptor parser.
 *
 *  This file allows for the easy parsing of complex HID report descriptors, which describes the data that
 *  a HID device transmits to the host. It also provides an easy API for extracting and processing the data
 *  elements inside a HID report sent from an attached HID device.
 */

/** \ingroup Group_USB
 *  \defgroup Group_HIDParser HID Report Parser
 *  \brief USB Human Interface Device (HID) Class report descriptor parser.
 *
 *  \section Sec_Dependencies Module Source Dependencies
 *  The following files must be built with any user project that uses this module:
 *    - LUFA/Drivers/USB/Class/Host/HIDParser.c (Makefile source module name: LUFA_SRC_USB)
 *
 *  \section Sec_ModDescription Module Description
 *  Human Interface Device (HID) class report descriptor parser. This module implements a parser than is
 *  capable of processing a complete HID report descriptor, and outputting a flat structure containing the
 *  contents of the report in an a more friendly format. The parsed data may then be further processed and used
 *  within an application to process sent and received HID reports to and from an attached HID device.
 *
 *  A HID report descriptor consists of a set of HID report items, which describe the function and layout
 *  of data exchanged between a HID device and a host, including both the physical encoding of each item
 *  (such as a button, key press or joystick axis) in the sent and received data packets - known as "reports" -
 *  as well as other information about each item such as the usages, data range, physical location and other
 *  characteristics. In this way a HID device can retain a high degree of flexibility in its capabilities, as it
 *  is not forced to comply with a given report layout or feature-set.
 *
 *  This module also contains routines for the processing of data in an actual HID report, using the parsed report
 *  descriptor data as a guide for the encoding.
 *
 *  @{
 */

#ifndef __HIDPARSER_H__
#define __HIDPARSER_H__

	/* Includes: */
		#include "../../../../Common/Common.h"

		#include "HIDReportData.h"
		#include "../Common/HID.h"

	/* Enable C linkage for C++ Compilers: */
		#if defined(__cplusplus)
			extern "C" {
		#endif

	/* Macros: */
		#if !defined(HID_STATETABLE_STACK_DEPTH) || defined(__DOXYGEN__)
			/** Constant indicating the maximum stack depth of the state table. A larger state table
			 *  allows for more PUSH/POP report items to be nested, but consumes more memory. By default
			 *  this is set to 2 levels (allowing non-nested PUSH items) but this can be overridden by
			 *  defining \c HID_STATETABLE_STACK_DEPTH to another value in the user project makefile, passing the
			 *  define to the compiler using the -D compiler switch.
			 */
			#define HID_STATETABLE_STACK_DEPTH    2
		#endif

		#if !defined(HID_USAGE_STACK_DEPTH) || defined(__DOXYGEN__)
			/** Constant indicating the maximum stack depth of the usage table. A larger usage table
			 *  allows for more USAGE items to be indicated sequentially for REPORT COUNT entries of more than
			 *  one, but requires more stack space. By default this is set to 8 levels (allowing for a report
			 *  item with a count of 8) but this can be overridden by defining \c HID_USAGE_STACK_DEPTH to another
			 *  value in the user project makefile, passing the define to the compiler using the -D compiler
			 *  switch.
			 */
			#define HID_USAGE_STACK_DEPTH         8
		#endif

		#if !defined(HID_MAX_COLLECTIONS) || defined(__DOXYGEN__)
			/** Constant indicating the maximum number of COLLECTION items (nested or unnested) that can be
			 *  processed in the report item descriptor. A large value allows for more COLLECTION items to be
			 *  processed, but consumes more memory. By default this is set to 10 collections, but this can be
			 *  overridden by defining \c HID_MAX_COLLECTIONS to another value in the user project makefile, passing
			 *  the define to the compiler using the -D compiler switch.
			 */
			#define HID_MAX_COLLECTIONS           10
		#endif

		#if !defined(HID_MAX_REPORTITEMS) || defined(__DOXYGEN__)
			/** Constant indicating the maximum number of report items (IN, OUT or FEATURE) that can be processed
			 *  in the report item descriptor and stored in the user HID Report Info structure. A large value allows
			 *  for more report items to be stored, but consumes more memory. By default this is set to 20 items,
			 *  but this can be overridden by defining \c HID_MAX_REPORTITEMS to another value in the user project
			 *  makefile, and passing the define to the compiler using the -D compiler switch.
			 */
			#define HID_MAX_REPORTITEMS           20
		#endif

		#if !defined(HID_MAX_REPORT_IDS) || defined(__DOXYGEN__)
			/** Constant indicating the maximum number of unique report IDs that can be processed in the report item
			 *  descriptor for the report size information array in the user HID Report Info structure. A large value
			 *  allows for more report ID report sizes to be stored, but consumes more memory. By default this is set
			 *  to 10 items, but this can be overridden by defining \c HID_MAX_REPORT_IDS to another value in the user project
			 *  makefile, and passing the define to the compiler using the -D compiler switch. Note that IN, OUT and FEATURE
			 *  items sharing the same report ID consume only one size item in the array.
			 */
			#define HID_MAX_REPORT_IDS            10
		#endif

		/** Returns the value a given HID report item (once its value has been fetched via \ref USB_GetHIDReportItemInfo())
		 *  left-aligned to the given data type. This allows for signed data to be interpreted correctly, by shifting the data
		 *  leftwards until the data's sign bit is in the correct position.
		 *
		 *  \param[in] ReportItem  HID Report Item whose retrieved value is to be aligned.
		 *  \param[in] Type        Data type to align the HID report item's value to.
		 *
		 *  \return Left-aligned data of the given report item's pre-retrieved value for the given datatype.
		 */
		#define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))

	/* Public Interface - May be used in end-application: */
		/* Enums: */
			/** Enum for the possible error codes in the return value of the \ref USB_ProcessHIDReport() function. */
			enum HID_Parse_ErrorCodes_t
			{
				HID_PARSE_Successful                  = 0, /**< Successful parse of the HID report descriptor, no error. */
				HID_PARSE_HIDStackOverflow            = 1, /**< More than \ref HID_STATETABLE_STACK_DEPTH nested PUSHes in the report. */
				HID_PARSE_HIDStackUnderflow           = 2, /**< A POP was found when the state table stack was empty. */
				HID_PARSE_InsufficientReportItems     = 3, /**< More than \ref HID_MAX_REPORTITEMS report items in the report. */
				HID_PARSE_UnexpectedEndCollection     = 4, /**< An END COLLECTION item found without matching COLLECTION item. */
				HID_PARSE_InsufficientCollectionPaths = 5, /**< More than \ref HID_MAX_COLLECTIONS collections in the report. */
				HID_PARSE_UsageListOverflow           = 6, /**< More than \ref HID_USAGE_STACK_DEPTH usages listed in a row. */
				HID_PARSE_InsufficientReportIDItems   = 7, /**< More than \ref HID_MAX_REPORT_IDS report IDs in the device. */
				HID_PARSE_NoUnfilteredReportItems     = 8, /**< All report items from the device were filtered by the filtering callback routine. */
			};

		/* Type Defines: */
			/** \brief HID Parser Report Item Min/Max Structure.
			 *
			 *  Type define for an attribute with both minimum and maximum values (e.g. Logical Min/Max).
			 */
			typedef struct
			{
				uint32_t Minimum; /**< Minimum value for the attribute. */
				uint32_t Maximum; /**< Maximum value for the attribute. */
			} HID_MinMax_t;

			/** \brief HID Parser Report Item Unit Structure.
			 *
			 *  Type define for the Unit attributes of a report item.
			 */
			typedef struct
			{
				uint32_t Type;     /**< Unit type (refer to HID specifications for details). */
				uint8_t  Exponent; /**< Unit exponent (refer to HID specifications for details). */
			} HID_Unit_t;

			/** \brief HID Parser Report Item Usage Structure.
			 *
			 *  Type define for the Usage attributes of a report item.
			 */
			typedef struct
			{
				uint16_t Page;  /**< Usage page of the report item. */
				uint16_t Usage; /**< Usage of the report item. */
			} HID_Usage_t;

			/** \brief HID Parser Report Item Collection Path Structure.
			 *
			 *  Type define for a COLLECTION object. Contains the collection attributes and a reference to the
			 *  parent collection if any.
			 */
			typedef struct HID_CollectionPath
			{
				uint8_t                    Type;   /**< Collection type (e.g. "Generic Desktop"). */
				HID_Usage_t                Usage;  /**< Collection usage. */
				struct HID_CollectionPath* Parent; /**< Reference to parent collection, or \c NULL if root collection. */
			} HID_CollectionPath_t;

			/** \brief HID Parser Report Item Attributes Structure.
			 *
			 *  Type define for all the data attributes of a report item, except flags.
			 */
			typedef struct
			{
				uint8_t      BitSize;  /**< Size in bits of the report item's data. */

				HID_Usage_t  Usage;    /**< Usage of the report item. */
				HID_Unit_t   Unit;     /**< Unit type and exponent of the report item. */
				HID_MinMax_t Logical;  /**< Logical minimum and maximum of the report item. */
				HID_MinMax_t Physical; /**< Physical minimum and maximum of the report item. */
			} HID_ReportItem_Attributes_t;

			/** \brief HID Parser Report Item Details Structure.
			 *
			 *  Type define for a report item (IN, OUT or FEATURE) layout attributes and other details.
			 */
			typedef struct
			{
				uint16_t                    BitOffset;      /**< Bit offset in the IN, OUT or FEATURE report of the item. */
				uint8_t                     ItemType;       /**< Report item type, a value in \ref HID_ReportItemTypes_t. */
				uint16_t                    ItemFlags;      /**< Item data flags, a mask of HID_IOF_* constants. */
				uint8_t                     ReportID;       /**< Report ID this item belongs to, or 0x00 if device has only one report */
				HID_CollectionPath_t*       CollectionPath; /**< Collection path of the item. */

				HID_ReportItem_Attributes_t Attributes;     /**< Report item attributes. */

				uint32_t                    Value;          /**< Current value of the report item - use \ref HID_ALIGN_DATA() when processing
				                                             *   a retrieved value so that it is aligned to a specific type.
				                                             */
				uint32_t                    PreviousValue;  /**< Previous value of the report item. */
			} HID_ReportItem_t;

			/** \brief HID Parser Report Size Structure.
			 *
			 *  Type define for a report item size information structure, to retain the size of a device's reports by ID.
			 */
			typedef struct
			{
				uint8_t  ReportID; /**< Report ID of the report within the HID interface. */
				uint16_t ReportSizeBits[3]; /**< Total number of bits in each report type for the given Report ID,
				                             *   indexed by the \ref HID_ReportItemTypes_t enum.
				                             */
			} HID_ReportSizeInfo_t;

			/** \brief HID Parser State Structure.
			 *
			 *  Type define for a complete processed HID report, including all report item data and collections.
			 */
			typedef struct
			{
				uint8_t              TotalReportItems; /**< Total number of report items stored in the \c ReportItems array. */
				HID_ReportItem_t     ReportItems[HID_MAX_REPORTITEMS]; /**< Report items array, including all IN, OUT
			                                                            *   and FEATURE items.
				                                                        */
				HID_CollectionPath_t CollectionPaths[HID_MAX_COLLECTIONS]; /**< All collection items, referenced
				                                                            *   by the report items.
				                                                            */
				uint8_t              TotalDeviceReports; /**< Number of reports within the HID interface */
				HID_ReportSizeInfo_t ReportIDSizes[HID_MAX_REPORT_IDS]; /**< Report sizes for each report in the interface */
				uint16_t             LargestReportSizeBits; /**< Largest report that the attached device will generate, in bits */
				bool                 UsingReportIDs; /**< Indicates if the device has at least one REPORT ID
				                                      *   element in its HID report descriptor.
				                                      */
			} HID_ReportInfo_t;

		/* Function Prototypes: */
			/** Function to process a given HID report returned from an attached device, and store it into a given
			 *  \ref HID_ReportInfo_t structure.
			 *
			 *  \param[in]  ReportData  Buffer containing the device's HID report table.
			 *  \param[in]  ReportSize  Size in bytes of the HID report table.
			 *  \param[out] ParserData  Pointer to a \ref HID_ReportInfo_t instance for the parser output.
			 *
			 *  \return A value in the \ref HID_Parse_ErrorCodes_t enum.
			 */
			uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
			                             uint16_t ReportSize,
			                             HID_ReportInfo_t* const ParserData) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);

			/** Extracts the given report item's value out of the given HID report and places it into the Value
			 *  member of the report item's \ref HID_ReportItem_t structure.
			 *
			 *  When called on a report with an item that exists in that report, this copies the report item's \c Value
			 *  to its \c PreviousValue element for easy checking to see if an item's value has changed before processing
			 *  a report. If the given item does not exist in the report, the function does not modify the report item's
			 *  data.
			 *
			 *  \param[in]     ReportData  Buffer containing an IN or FEATURE report from an attached device.
			 *  \param[in,out] ReportItem  Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
			 *
			 *  \returns Boolean \c true if the item to retrieve was located in the given report, \c false otherwise.
			 */
			bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
			                              HID_ReportItem_t* const ReportItem) ATTR_NON_NULL_PTR_ARG(1);

			/** Retrieves the given report item's value out of the \c Value member of the report item's
			 *  \ref HID_ReportItem_t structure and places it into the correct position in the HID report
			 *  buffer. The report buffer is assumed to have the appropriate bits cleared before calling
			 *  this function (i.e., the buffer should be explicitly cleared before report values are added).
			 *
			 *  When called, this copies the report item's \c Value element to its \c PreviousValue element for easy
			 *  checking to see if an item's value has changed before sending a report.
			 *
			 *  If the device has multiple HID reports, the first byte in the report is set to the report ID of the given item.
			 *
			 *  \param[out] ReportData  Buffer holding the current OUT or FEATURE report data.
			 *  \param[in]  ReportItem  Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
			 */
			void USB_SetHIDReportItemInfo(uint8_t* ReportData,
			                              HID_ReportItem_t* const ReportItem) ATTR_NON_NULL_PTR_ARG(1);

			/** Retrieves the size of a given HID report in bytes from its Report ID.
			 *
			 *  \param[in] ParserData  Pointer to a \ref HID_ReportInfo_t instance containing the parser output.
			 *  \param[in] ReportID    Report ID of the report whose size is to be determined.
			 *  \param[in] ReportType  Type of the report whose size is to be determined, a value from the
			 *                         \ref HID_ReportItemTypes_t enum.
			 *
			 *  \return Size of the report in bytes, or \c 0 if the report does not exist.
			 */
			uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData,
			                              const uint8_t ReportID,
			                              const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1);

			/** Callback routine for the HID Report Parser. This callback must be implemented by the user code when
			 *  the parser is used, to determine what report IN, OUT and FEATURE item's information is stored into the user
			 *  \ref HID_ReportInfo_t structure. This can be used to filter only those items the application will be using, so that
			 *  no RAM is wasted storing the attributes for report items which will never be referenced by the application.
			 *
			 *  Report item pointers passed to this callback function may be cached by the user application for later use
			 *  when processing report items. This provides faster report processing in the user application than would
			 *  a search of the entire parsed report item table for each received or sent report.
			 *
			 *  \param[in] CurrentItem  Pointer to the current report item for user checking.
			 *
			 *  \return Boolean \c true if the item should be stored into the \ref HID_ReportInfo_t structure, \c false if
			 *          it should be ignored.
			 */
			bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem);

	/* Private Interface - For use in library only: */
	#if !defined(__DOXYGEN__)
		/* Type Defines: */
			typedef struct
			{
				 HID_ReportItem_Attributes_t Attributes;
				 uint8_t                     ReportCount;
				 uint8_t                     ReportID;
			} HID_StateTable_t;
	#endif

	/* Disable C linkage for C++ Compilers: */
		#if defined(__cplusplus)
			}
		#endif

#endif

/** @} */


text:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Psr\Log\LoggerInterface" type="Magento\Framework\Logger\Monolog" />
</config>


text:
package supervisor

import (
	"fmt"
	"io"
	"os/exec"
	"strings"
)

type logger struct {
	process   *Process
	emptyLine bool
}

func (l *logger) Log(prefix, line string) {
	if l.emptyLine {
		l.process.Log(prefix)
		l.emptyLine = false
	}

	if line == "" {
		l.emptyLine = true
	} else {
		l.process.Logf("%s%s", prefix, line)
		l.emptyLine = false
	}
}

func (l *logger) LogLines(prefix, str string, err error) {
	if strings.HasSuffix(str, "\n") {
		str = str[:len(str)-1]
	} else {
		str += "\\no newline"
	}
	lines := strings.Split(str, "\n")
	for _, line := range lines {
		l.Log(prefix, line)
	}

	if !(err == nil || err == io.EOF) {
		l.process.Log(fmt.Sprintf("%v", err))
	}
}

type loggingWriter struct {
	logger
	writer io.Writer
}

func (l *loggingWriter) Write(bytes []byte) (int, error) {
	if l.writer == nil {
		l.LogLines(" <- ", string(bytes), nil)
		return len(bytes), nil
	}
	n, err := l.writer.Write(bytes)
	l.LogLines(" <- ", string(bytes[:n]), err)
	return n, err
}

type loggingReader struct {
	logger
	reader io.Reader
}

func (l *loggingReader) Read(p []byte) (n int, err error) {
	n, err = l.reader.Read(p)
	l.LogLines(" -> ", string(p[:n]), err)
	return n, err
}

// A Cmd is like an os/exec.Cmd, but logs what happens on
// stdin/stdout/stderr, and has a slightly different API.
type Cmd struct {
	*exec.Cmd
	supervisorProcess *Process
}

func (c *Cmd) pre() {
	if c.Stdin != nil {
		c.Stdin = &loggingReader{logger: logger{process: c.supervisorProcess}, reader: c.Stdin}
	}
	c.Stdout = &loggingWriter{logger: logger{process: c.supervisorProcess}, writer: c.Stdout}
	c.Stderr = &loggingWriter{logger: logger{process: c.supervisorProcess}, writer: c.Stderr}

	c.supervisorProcess.Logf("%s %v", c.Path, c.Args[1:])
}

func (c *Cmd) post(err error) {
	if err == nil {
		c.supervisorProcess.Logf("%s exited successfully", c.Path)
	} else {
		if c.ProcessState == nil {
			c.supervisorProcess.Logf("%v", err)
		} else {
			c.supervisorProcess.Logf("%s: %v", c.Path, err)
		}
	}
}

// Start is like os/exec.Cmd.Start.
func (c *Cmd) Start() error {
	c.pre()
	return c.Cmd.Start()
}

// Wait is like os/exec.Cmd.Wait.
func (c *Cmd) Wait() error {
	err := c.Cmd.Wait()
	c.post(err)
	return err
}

// Run is like os/exec.Cmd.Run.
func (c *Cmd) Run() error {
	c.pre()
	err := c.Cmd.Run()
	c.post(err)
	return err
}

// Command creates a single purpose supervisor and uses it to produce
// and return a *supervisor.Cmd.
func Command(prefix, name string, args ...string) (result *Cmd) {
	MustRun(prefix, func(p *Process) error {
		result = p.Command(name, args...)
		return nil
	})
	return
}

// Command creates a command that automatically logs inputs, outputs,
// and exit codes to the process logger.
func (p *Process) Command(name string, args ...string) *Cmd {
	return &Cmd{exec.Command(name, args...), p}
}

// Capture runs a command with the supplied input and captures the
// output as a string.
func (c *Cmd) Capture(stdin io.Reader) (output string, err error) {
	c.Stdin = stdin
	out := strings.Builder{}
	c.Stdout = &out
	err = c.Run()
	output = out.String()
	return
}

// MustCapture is like Capture, but panics if there is an error.
func (c *Cmd) MustCapture(stdin io.Reader) (output string) {
	output, err := c.Capture(stdin)
	if err != nil {
		panic(err)
	}
	return output
}

// CaptureErr runs a command with the supplied input and captures
// stdout and stderr as a string.
func (c *Cmd) CaptureErr(stdin io.Reader) (output string, err error) {
	c.Stdin = stdin
	out := strings.Builder{}
	c.Stdout = &out
	c.Stderr = &out
	err = c.Run()
	output = out.String()
	return
}

// MustCaptureErr is like CaptureErr, but panics if there is an error.
func (c *Cmd) MustCaptureErr(stdin io.Reader) (output string) {
	output, err := c.CaptureErr(stdin)
	if err != nil {
		panic(err)
	}
	return output
}


text:
package com.igitras.cbframework.common.attribute.status;

import com.igitras.cbframework.common.attribute.RequestAttribute;
import com.igitras.cbframework.exception.ErrorMessage;

/**
 * Class {@link StatusAttribute}.
 *
 * @author mason
 */
public interface StatusAttribute extends RequestAttribute {

    /**
     * Get status code.
     *
     * @return code
     */
    String getCode();

    /**
     * Set status code.
     *
     * @param code code
     * @return Status Attribute
     */
    StatusAttribute setCode(String code);

    /**
     * Get error messages.
     *
     * @return error messages
     */
    ErrorMessage[] getErrorMessages();

    /**
     * Set error messages.
     *
     * @param messages msgs
     * @return Statue Attribute
     */
    StatusAttribute setErrorMessages(ErrorMessage... messages);

    /**
     * Get status messages.
     *
     * @return message
     */
    String[] getMessages();

    /**
     * Set status messages.
     *
     * @param messages messages
     * @return Status Attribute
     */
    StatusAttribute setMessages(String... messages);
}


text:
package app.controllers;

import org.junit.Test;

import leap.lang.http.HTTP;
import leap.web.WebTestCase;

public class ErrorTestControllerTest extends WebTestCase {

	@Test
	public void test404() {
		get("/not_exists_action").assertStatusEquals(HTTP.SC_NOT_FOUND).assertContentContains("404");
		get("/error_test/err404").assertStatusEquals(HTTP.SC_NOT_FOUND).assertContentContains("404");
	}

	@Test
	public void test403() {
		get("/error_test/err403").assertStatusEquals(HTTP.SC_FORBIDDEN).assertContentContains("403");
	}

	@Test
	public void test500() {
		get("/error_test/err500").assertStatusEquals(HTTP.SC_INTERNAL_SERVER_ERROR).assertContentContains("err");
	}

	@Test
	public void testCustome() {
		get("/error_test/err_custom").assertStatusEquals(HTTP.SC_INTERNAL_SERVER_ERROR).assertContentContains("custom:err");
	}
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

// System.String
struct String_t;

#include "mscorlib_System_Attribute2523058482.h"
#include "mscorlib_System_Runtime_InteropServices_CallingCon1635440495.h"
#include "mscorlib_System_Runtime_InteropServices_CharSet4282055494.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Runtime.InteropServices.DllImportAttribute
struct  DllImportAttribute_t1934708125  : public Attribute_t2523058482
{
public:
	// System.Runtime.InteropServices.CallingConvention System.Runtime.InteropServices.DllImportAttribute::CallingConvention
	int32_t ___CallingConvention_0;
	// System.Runtime.InteropServices.CharSet System.Runtime.InteropServices.DllImportAttribute::CharSet
	int32_t ___CharSet_1;
	// System.String System.Runtime.InteropServices.DllImportAttribute::Dll
	String_t* ___Dll_2;
	// System.String System.Runtime.InteropServices.DllImportAttribute::EntryPoint
	String_t* ___EntryPoint_3;
	// System.Boolean System.Runtime.InteropServices.DllImportAttribute::ExactSpelling
	bool ___ExactSpelling_4;
	// System.Boolean System.Runtime.InteropServices.DllImportAttribute::PreserveSig
	bool ___PreserveSig_5;
	// System.Boolean System.Runtime.InteropServices.DllImportAttribute::SetLastError
	bool ___SetLastError_6;
	// System.Boolean System.Runtime.InteropServices.DllImportAttribute::BestFitMapping
	bool ___BestFitMapping_7;
	// System.Boolean System.Runtime.InteropServices.DllImportAttribute::ThrowOnUnmappableChar
	bool ___ThrowOnUnmappableChar_8;

public:
	inline static int32_t get_offset_of_CallingConvention_0() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___CallingConvention_0)); }
	inline int32_t get_CallingConvention_0() const { return ___CallingConvention_0; }
	inline int32_t* get_address_of_CallingConvention_0() { return &___CallingConvention_0; }
	inline void set_CallingConvention_0(int32_t value)
	{
		___CallingConvention_0 = value;
	}

	inline static int32_t get_offset_of_CharSet_1() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___CharSet_1)); }
	inline int32_t get_CharSet_1() const { return ___CharSet_1; }
	inline int32_t* get_address_of_CharSet_1() { return &___CharSet_1; }
	inline void set_CharSet_1(int32_t value)
	{
		___CharSet_1 = value;
	}

	inline static int32_t get_offset_of_Dll_2() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___Dll_2)); }
	inline String_t* get_Dll_2() const { return ___Dll_2; }
	inline String_t** get_address_of_Dll_2() { return &___Dll_2; }
	inline void set_Dll_2(String_t* value)
	{
		___Dll_2 = value;
		Il2CppCodeGenWriteBarrier(&___Dll_2, value);
	}

	inline static int32_t get_offset_of_EntryPoint_3() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___EntryPoint_3)); }
	inline String_t* get_EntryPoint_3() const { return ___EntryPoint_3; }
	inline String_t** get_address_of_EntryPoint_3() { return &___EntryPoint_3; }
	inline void set_EntryPoint_3(String_t* value)
	{
		___EntryPoint_3 = value;
		Il2CppCodeGenWriteBarrier(&___EntryPoint_3, value);
	}

	inline static int32_t get_offset_of_ExactSpelling_4() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___ExactSpelling_4)); }
	inline bool get_ExactSpelling_4() const { return ___ExactSpelling_4; }
	inline bool* get_address_of_ExactSpelling_4() { return &___ExactSpelling_4; }
	inline void set_ExactSpelling_4(bool value)
	{
		___ExactSpelling_4 = value;
	}

	inline static int32_t get_offset_of_PreserveSig_5() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___PreserveSig_5)); }
	inline bool get_PreserveSig_5() const { return ___PreserveSig_5; }
	inline bool* get_address_of_PreserveSig_5() { return &___PreserveSig_5; }
	inline void set_PreserveSig_5(bool value)
	{
		___PreserveSig_5 = value;
	}

	inline static int32_t get_offset_of_SetLastError_6() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___SetLastError_6)); }
	inline bool get_SetLastError_6() const { return ___SetLastError_6; }
	inline bool* get_address_of_SetLastError_6() { return &___SetLastError_6; }
	inline void set_SetLastError_6(bool value)
	{
		___SetLastError_6 = value;
	}

	inline static int32_t get_offset_of_BestFitMapping_7() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___BestFitMapping_7)); }
	inline bool get_BestFitMapping_7() const { return ___BestFitMapping_7; }
	inline bool* get_address_of_BestFitMapping_7() { return &___BestFitMapping_7; }
	inline void set_BestFitMapping_7(bool value)
	{
		___BestFitMapping_7 = value;
	}

	inline static int32_t get_offset_of_ThrowOnUnmappableChar_8() { return static_cast<int32_t>(offsetof(DllImportAttribute_t1934708125, ___ThrowOnUnmappableChar_8)); }
	inline bool get_ThrowOnUnmappableChar_8() const { return ___ThrowOnUnmappableChar_8; }
	inline bool* get_address_of_ThrowOnUnmappableChar_8() { return &___ThrowOnUnmappableChar_8; }
	inline void set_ThrowOnUnmappableChar_8(bool value)
	{
		___ThrowOnUnmappableChar_8 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
#include "arm_compute/core/Types.h"
#include "arm_compute/core/utils/misc/ShapeCalculator.h"
#include "arm_compute/runtime/NEON/functions/NEDeconvolutionLayer.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "tests/NEON/Accessor.h"
#include "tests/PaddingCalculator.h"
#include "tests/datasets/ShapeDatasets.h"
#include "tests/framework/Asserts.h"
#include "tests/framework/Macros.h"
#include "tests/framework/datasets/Datasets.h"
#include "tests/validation/Validation.h"
#include "tests/validation/fixtures/DeconvolutionLayerFixture.h"

namespace arm_compute
{
namespace test
{
namespace validation
{
namespace
{
constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f);    /**< Tolerance for floating point tests */
constexpr AbsoluteTolerance<float> tolerance_quantized(1.0f); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */
#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
const RelativeTolerance<half_float::half> tolerance_fp16(half_float::half(0.2f)); /**< Relative tolerance value for comparing reference's output against implementation's output for DataType::F16 */
#endif                                                                            /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC*/
constexpr float tolerance_num = 0.07f;                                            /**< Tolerance number */

const auto data4x4 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 3)
                     * framework::dataset::make("PadY", 0, 3) * framework::dataset::make("NumKernels", { 3 });

const auto data3x3 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 2)
                     * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });

const auto data3x3_asymm = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadLeft", 0, 1)
                           * framework::dataset::make("PadRight", 0, 1) * framework::dataset::make("PadTop", 0, 1) * framework::dataset::make("PadBottom", 0, 1) * framework::dataset::make("NumKernels", { 3 });

const auto data9x9_small_asymm = framework::dataset::make("InputShape", TensorShape{ 10U, 10U, 1U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY",
                                 2)
                                 *framework::dataset::make("PadLeft", 3)
                                 *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 });

const auto data9x9_large_asymm = framework::dataset::make("InputShape", TensorShape{ 640U, 360U, 56U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY",
                                 2)
                                 *framework::dataset::make("PadLeft", 3)
                                 *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 });

const auto data3x3_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadX", 0, 2)
                               * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });

const auto data1x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 1)
                     * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 });

const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC });

const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false });

const auto input_qinfo_dataset = framework::dataset::make("InputQInfo",
{
    QuantizationInfo(1.f / 255.f, 0),
    QuantizationInfo(2.f, 0),
});

const auto output_qinfo_dataset = framework::dataset::make("OutputQInfo",
{
    QuantizationInfo(3.f / 255.f, 0),
    QuantizationInfo(4.f, 0),
});

} // namespace

TEST_SUITE(NEON)
TEST_SUITE(DeconvolutionLayer)

// *INDENT-OFF*
// clang-format off
DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
    framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),   // Mismatching data type
                                            TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),   // Invalid weights shape
                                            TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16),   // Non supported data type
                                            TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),  // Invalid bias shape
                                            TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink
                                            TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32),
                                          }),
    framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
                                            TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32),
                                            TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
                                            TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32),
                                            TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32),
                                              TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32),
                                          })),
    framework::dataset::make("BiasInfo",  { TensorInfo(TensorShape(1U), 1, DataType::F16),
                                            TensorInfo(TensorShape(1U), 1, DataType::F32),
                                            TensorInfo(TensorShape(1U), 1, DataType::F32),
                                            TensorInfo(TensorShape(25U, 11U), 1, DataType::F32),
                                            TensorInfo(TensorShape(1U), 1, DataType::F32),
                                            TensorInfo(TensorShape(4U), 1, DataType::F32),
                                          })),
    framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16),
                                            TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32),
                                            TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
                                            TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32),
                                            TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32),
                                            TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32),
                                          })),
    framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0),
                                                PadStrideInfo(1, 1, 0, 0),
                                                PadStrideInfo(1, 1, 0, 0),
                                                PadStrideInfo(1, 1, 0, 0),
                                                PadStrideInfo(1, 1, 1, 1),
                                                PadStrideInfo(1, 1, 0, 0),
                                           })),
    framework::dataset::make("Expected", { false, false, false, false, false, true })),
    input_info, weights_info, bias_info, output_info, pad_info, expected)
{
    bool is_valid = bool(NEDeconvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), pad_info));
    ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
}
// clang-format on
// *INDENT-ON*

template <typename T>
using NEDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;

template <typename T>
using NEDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;

template <typename T>
using NEDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;

template <typename T>
using NEDeconvolutionLayerAsymmFixture9x9 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 9, 9>;

template <typename T>
using NEDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;

TEST_SUITE(Float)
TEST_SUITE(FP32)
TEST_SUITE(W4x4)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp32);
}
TEST_SUITE_END() // W4x4
TEST_SUITE(W3x3)
FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
                                                                                DataType::F32)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp32);
}
FIXTURE_DATA_TEST_CASE(RunAsymm, NEDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType",
                                                                                DataType::F32)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp32);
}
FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp32);
}
TEST_SUITE_END() // W3x3
TEST_SUITE(W1x1)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp32);
}
TEST_SUITE_END() // W1x1
TEST_SUITE(W9x9)
FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::ALL, combine(combine(combine(data9x9_small_asymm, framework::dataset::make("DataType",
                                                                                DataType::F32)),
                                                                                framework::dataset::make("DataLayout", { DataLayout::NHWC })),
                                                                                framework::dataset::make("AddBias", { false })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp32);
}
FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data9x9_large_asymm, framework::dataset::make("DataType",
                                                                                DataType::F32)),
                                                                                framework::dataset::make("DataLayout", { DataLayout::NHWC })),
                                                                                framework::dataset::make("AddBias", { false })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp32);
}
TEST_SUITE_END() // W9x9
TEST_SUITE_END() // FP32

#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
TEST_SUITE(FP16)
TEST_SUITE(W4x4)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp16);
}
TEST_SUITE_END() // W4x4
TEST_SUITE(W3x3)
FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
                                                                                DataType::F16)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp16);
}
FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp16);
}
TEST_SUITE_END() // W3x3
TEST_SUITE(W1x1)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)),
                                                                                data_layouts_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_fp16);
}
TEST_SUITE_END() // W1x1
TEST_SUITE_END() // FP16
#endif           /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */

TEST_SUITE_END() // Float

template <typename T>
using NEDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;

template <typename T>
using NEDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;

template <typename T>
using NEDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;

template <typename T>
using NEDeconvolutionLayerQuantizedPerChannelFixture4x4 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 4, 4>;

template <typename T>
using NEDeconvolutionLayerQuantizedPerChannelFixture3x3 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 3, 3>;

template <typename T>
using NEDeconvolutionLayerQuantizedPerChannelFixture1x1 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 1, 1>;

TEST_SUITE(Quantized)
TEST_SUITE(QASYMM8)

TEST_SUITE(W4x4)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
                                                                                DataType::QASYMM8)),
                                                                                data_layouts_dataset),
                                                                                input_qinfo_dataset),
                                                                                output_qinfo_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W4x4

TEST_SUITE(W3x3)
FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
                       framework::dataset::make("DataType",
                                                DataType::QASYMM8)),
                       data_layouts_dataset),
                       input_qinfo_dataset),
                       output_qinfo_dataset),
                       add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
                       framework::dataset::make("DataType",
                                                DataType::QASYMM8)),
                       data_layouts_dataset),
                       input_qinfo_dataset),
                       output_qinfo_dataset),
                       add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W3x3

TEST_SUITE(W1x1)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType",
                                                                                DataType::QASYMM8)),
                                                                                data_layouts_dataset),
                                                                                input_qinfo_dataset),
                                                                                output_qinfo_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W1x1

TEST_SUITE_END() // QASYMM8

TEST_SUITE(QASYMM8_SIGNED)

TEST_SUITE(W4x4)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
                                                                                DataType::QASYMM8_SIGNED)),
                                                                                data_layouts_dataset),
                                                                                input_qinfo_dataset),
                                                                                output_qinfo_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W4x4

TEST_SUITE(W3x3)
FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
                       framework::dataset::make("DataType",
                                                DataType::QASYMM8_SIGNED)),
                       data_layouts_dataset),
                       input_qinfo_dataset),
                       output_qinfo_dataset),
                       add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
                       framework::dataset::make("DataType",
                                                DataType::QASYMM8_SIGNED)),
                       data_layouts_dataset),
                       input_qinfo_dataset),
                       output_qinfo_dataset),
                       add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W3x3

TEST_SUITE(W1x1)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1,
                                                                                framework::dataset::make("DataType",
                                                                                DataType::QASYMM8_SIGNED)),
                                                                                data_layouts_dataset),
                                                                                input_qinfo_dataset),
                                                                                output_qinfo_dataset),
                                                                                add_bias_dataset))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W1x1

TEST_SUITE_END() // QASYMM8_SIGNED

const auto input_qinfo_per_channel_dataset         = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10) });
const auto output_qinfo_per_channel_dataset        = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0) });
const auto input_signed_qinfo_per_channel_dataset  = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10) });
const auto output_signed_qinfo_per_channel_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10) });

TEST_SUITE(QSYMM8_PER_CHANNEL)

TEST_SUITE(W4x4)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
                       framework::dataset::make("DataType", DataType::QASYMM8)),
                       data_layouts_dataset),
                       input_qinfo_per_channel_dataset),
                       output_qinfo_per_channel_dataset),
                       add_bias_dataset),
                       framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
                       framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
                       data_layouts_dataset),
                       input_signed_qinfo_per_channel_dataset),
                       output_signed_qinfo_per_channel_dataset),
                       add_bias_dataset),
                       framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W4x4

TEST_SUITE(W3x3)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
                       framework::dataset::make("DataType", DataType::QASYMM8)),
                       data_layouts_dataset),
                       input_qinfo_per_channel_dataset),
                       output_qinfo_per_channel_dataset),
                       add_bias_dataset),
                       framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
                       framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
                       data_layouts_dataset),
                       input_signed_qinfo_per_channel_dataset),
                       output_signed_qinfo_per_channel_dataset),
                       add_bias_dataset),
                       framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W3x3

TEST_SUITE(W1x1)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
                       framework::dataset::make("DataType", DataType::QASYMM8)),
                       data_layouts_dataset),
                       input_qinfo_per_channel_dataset),
                       output_qinfo_per_channel_dataset),
                       add_bias_dataset),
                       framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
                       framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
                       data_layouts_dataset),
                       input_signed_qinfo_per_channel_dataset),
                       output_signed_qinfo_per_channel_dataset),
                       add_bias_dataset),
                       framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
    // Validate output
    validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
}
TEST_SUITE_END() // W1x1

TEST_SUITE_END() // QSYMM8_PER_CHANNEL

TEST_SUITE_END() // Quantized

TEST_SUITE_END() // DeconvolutionLayer
TEST_SUITE_END() // Neon
} // namespace validation
} // namespace test
} // namespace arm_compute


text:
#pragma once

#include "YouTubeDownloadLibrary.h"

namespace YouTubeDownloadLibrary
{
	class FMT
	{
	public:
		FMT();
		~FMT();

		/**
		 * @fn	static std::string FMT::ExtractFMT (std::string feed);
		 *
		 * @brief	Extracts the youtube fmt data from text
		 *
		 * @author	agabani
		 * @date	23/02/2014
		 *
		 * @param	feed	The input text.
		 *
		 * @return	The extracted fmt text.
		 */

		static std::string ExtractFMT (std::string feed);

		/**
		 * @fn	static std::vector <YouTubeDownloadLibrary::Video> FMT::ParseFMT (std::string serial);
		 *
		 * @brief	Parse and structures fmt data.
		 *
		 * @author	agabani
		 * @date	23/02/2014
		 *
		 * @param	serial	Unparsed fmt data.
		 *
		 * @return	Formated and structured fmt data.
		 */

		static std::vector <YouTubeDownloadLibrary::Video> ParseFMT (std::string serial);
	};
}


text:
{% block navbar %}
   {% include "csv2/navigation_bar.html" %}
{% endblock %}

<link rel="stylesheet" href="/static/glintwebui/css/glint_matrix.css">

    {% load glint_template_utils %}
    {% load static %}
    <link rel="stylesheet" type="text/css" href="{% static "csv2/common.css" %}?{{version}}">
    <link rel="stylesheet" type="text/css" href="{% static "csv2/menu.css" %}?{{version}}">
    <link rel="stylesheet" type="text/css" href="{% static "csv2/overlay.css" %}?{{version}}">

         <input type="text" id="image_search" onkeyup="image_search()" autofocus="autofocus" placeholder="Search by Image Name">
        <input type="button" value="+Upload Image" onclick="window.location.href='/images/upload_image/{{active_group}}/?{{active_group}}'">

        Private Image

        Public Image

        Transaction Error

    {% csrf_token %}

  IMAGES
            {% for cloud in cloud_list %}
                 {{ cloud.cloud_name }}
            {% endfor %}

        {% for image_key, image_list in image_dict.items %}

                 {{ image_key|first_split:'---' }}

                    {% if image_key|first_split:'---' == default_image %}

                    {% endif %}

                {% for img_tuple in image_list %}
                    {% if img_tuple.0 == "missing" %}
                        <button onclick='transfer_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>O</button>
                    {% elif img_tuple.0 == "present" %}

                        {% if img_tuple.2 == "public" %}
                            <button onclick='delete_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")' disabled>✔</button>
                        {% else %}
                            <button class="button" title="Delete image" onclick='delete_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>✔</button>
                        {% endif %}
                    {% elif img_tuple.0 == "pending" %}
                        pending transfer
                    {% elif img_tuple.0 == "claimed" %}
                        transfering
                    {% elif img_tuple.0 == "pending delete" %}
                        pending delete
                    {% elif img_tuple.0 == "error"%}
                        <button title="Retry request
Error: {{img_tuple.1}}" onclick='retry_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>↻</button><button title="Clear request
Error: {{img_tuple.1}}" onclick='clear_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>✘</button>
                    {% endif %}
                {% endfor %}

        {% endfor %}

    <div class="footer"
        {% if response_code == 1 %}

Error: {{ message }}

        {% elif message is not None %}

{{ message }}

        {% endif %}


text:
var MSG = {
  title: "Kod",
  blocks: "Bloki",
  linkTooltip: "Zapisz i podlinkuj do bloków",
  runTooltip: "Uruchom program zdefinowany przez bloki w obszarze roboczym",
  badCode: "Błąd programu:\n%1",
  timeout: "Maksymalna liczba iteracji wykonywań przekroczona",
  discard: "Usunąć wszystkie %1 bloki?",
  trashTooltip: "Odrzuć wszystkie bloki.",
  catMinecraft:'Minecraft',
  catLogic: "Logika",
  catLoops: "Pętle",
  catMath: "Matematyka",
  catText: "Tekst",
  catLists: "Listy",
  catColour: "Kolor",
  catVariables: "Zmienne",
  catFunctions: "Funkcje",
  listVariable: "lista",
  textVariable: "tekst",
  httpRequestError: "Wystąpił problem z żądaniem.",
  linkAlert: "Udpostępnij swoje bloki korzystając z poniższego linku : \n\n\n(Ctrl-C or Cmd-C to copy link)",
  hashError: "Przepraszamy, \"%1\" nie odpowiada żadnemu zapisanemu programowi.",
  xmlError: "Nie można załadować zapisanego pliku. Być może został utworzony za pomocą innej wersji Blockly?",
  badXml: "Błąd parsowania XML : \n%1\n\nZaznacz 'OK' aby odrzucić twoje zmiany lub 'Cancel', żeby w przyszłości edytować XML."
};


text:
#ifndef STREAM_COPY_H
#define STREAM_COPY_H

#include "input_stream.h"

typedef struct {
	input_stream_t *input_stream; /* Input stream. */
	int fd;                       /* Destination file descriptor. */

	unsigned char *write_ptr;

	size_t written;
	size_t zero_bytes_written;

	int error;
} stream_copy_t;

void stream_copy_init (stream_copy_t *stream_copy, input_stream_t *input_stream, int fd);

int stream_copy_until_end (stream_copy_t *stream_copy);
int stream_copy_chunk (stream_copy_t *stream_copy, size_t *bytes);
int stream_copy_until_needle (stream_copy_t *stream_copy, const char *needle, size_t len, size_t max_written, int *found, int *done);

#endif /* STREAM_COPY_H */


text:
import unittest
from amara.lib import testsupport
from amara import tree
import os
import re, tempfile
from amara.lib import U

from amara import bindery
from amara.bindery.model import examplotron_model, generate_metadata

if __name__ == '__main__':
    from amara.test import test_main
    testsupport.test_main()