text:
package deleteallblobs

import (
	"bufio"
	"fmt"
	"os"

	"github.com/nyaxt/otaru/blobstore"
	"github.com/nyaxt/otaru/btncrypt"
	"github.com/nyaxt/otaru/facade"
	"github.com/urfave/cli/v2"
	"go.uber.org/zap"
	"golang.org/x/oauth2"

	oflags "github.com/nyaxt/otaru/flags"
	"github.com/nyaxt/otaru/gcloud/auth"
	"github.com/nyaxt/otaru/gcloud/datastore"
	"github.com/nyaxt/otaru/gcloud/gcs"
)

const notReadOnly = false

type BlobListerRemover interface {
	blobstore.BlobLister
	blobstore.BlobRemover
}

func clearBlobStore(bs BlobListerRemover) error {
	bps, err := bs.ListBlobs()
	if err != nil {
		return fmt.Errorf("Failed to ListBlobs(): %v", err)
	}
	zap.S().Infof("Found %d blobs!", len(bps))

	for i, bp := range bps {
		zap.S().Infof("Removing blob %d/%d: %s", i+1, len(bps), bp)
		if err := bs.RemoveBlob(bp); err != nil {
			return fmt.Errorf("Failed to RemoveBlob(%s): %v", bp, err)
		}
	}
	return nil
}

func clearCache(cacheDir string) error {
	bs, err := blobstore.NewFileBlobStore(cacheDir, oflags.O_RDWRCREATE)
	if err != nil {
		return fmt.Errorf("Failed to init FileBlobStore: %v", err)
	}

	return clearBlobStore(bs)
}

func clearGCS(projectName, bucketName string, tsrc oauth2.TokenSource) error {
	bs, err := gcs.NewGCSBlobStore(projectName, bucketName, tsrc, oflags.O_RDWRCREATE)
	if err != nil {
		return fmt.Errorf("Failed to init GCSBlobStore: %v", err)
	}

	return clearBlobStore(bs)
}

var Command = &cli.Command{
	Name:  "deleteallblobs",
	Usage: "delete all blobs from specified blobstorage",
	Action: func(c *cli.Context) error {
		s := zap.S().Named("deleteallblobs")

		cfg, err := facade.NewConfig(c.Path("configDir"))
		if err != nil {
			return err
		}

		tsrc, err := auth.GetGCloudTokenSource(cfg.CredentialsFilePath)
		if err != nil {
			return fmt.Errorf("Failed to init GCloudClientSource: %w", err)
		}
		key := btncrypt.KeyFromPassword(cfg.Password)
		cipher, err := btncrypt.NewCipher(key)
		if err != nil {
			return fmt.Errorf("Failed to init *btncrypt.Cipher: %w", err)
		}

		fmt.Printf("Do you really want to proceed with deleting all blobs in gs://%s{,-meta} and its cache in %s?\n", cfg.BucketName, cfg.CacheDir)
		fmt.Printf("Type \"deleteall\" to proceed: ")
		sc := bufio.NewScanner(os.Stdin)
		if !sc.Scan() {
			return fmt.Errorf("Failed to scan line input from stdin")
		}
		if sc.Text() != "deleteall" {
			zap.S().Infof("Cancelled.\n")
			os.Exit(1)
		}

		dscfg := datastore.NewConfig(cfg.ProjectName, cfg.BucketName, cipher, tsrc)
		l := datastore.NewGlobalLocker(dscfg, "otaru-deleteallblobs", facade.GenHostName())
		if err := l.Lock(c.Context, notReadOnly); err != nil {
			return fmt.Errorf("Failed to acquire global lock: %w", err)
		}
		defer l.Unlock(c.Context)

		if err := clearGCS(cfg.ProjectName, cfg.BucketName, tsrc); err != nil {
			return fmt.Errorf("Failed to clear bucket \"%s\": %w", cfg.BucketName, err)
		}
		if cfg.UseSeparateBucketForMetadata {
			metabucketname := fmt.Sprintf("%s-meta", cfg.BucketName)
			if err := clearGCS(cfg.ProjectName, metabucketname, tsrc); err != nil {
				return fmt.Errorf("Failed to clear metadata bucket \"%s\": %w", metabucketname, err)
			}
		}
		if err := clearCache(cfg.CacheDir); err != nil {
			return fmt.Errorf("Failed to clear cache \"%s\": %w", cfg.CacheDir, err)
		}

		s.Infof("otaru-deleteallblobs: Successfully completed!")
		s.Infof("Hint: You might also want to run \"otaru-txlogio purge\" to delete inodedb txlogs.")
		return nil
	},
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//Recibe las variables del formulario que esta llamando el archivo javascript
	var x;
	x=$(document);
	x.ready(inicio);

	//Funcion inicio recibe las acciones realizadas en el formulario y llama a las funciones correspondientes a cada una
	function inicio()
	{
		var x;
		x=$("#solicitud");
		x.click(Solicitud);

		var x;
		x=$("#motivos");
		x.click(motivos);

		var x;
		x=$("#edificios");
		x.click(Edificios);

		var x;
		x=$("#unidad");
		x.click(Unidad);

		var x;
		x=$("#revision");
		x.click(Revision);

		var x;
		x=$("#reportes");
		x.click(reportes);
	}

	//Carga en el area de trabajo de la pantalla el formulario correspondiente para la realizacion de las solicitudes
	function Solicitud()
	{
		$.ajax({
			async:true,
			type: "POST",
			dataType: "html",
			contentType: "application/x-www-form-urlencoded",
			url:"pages/permisos/Solicitudes.php",
			// url:"../solicitudes.php",
			beforeSend:inicioEnvio,
			success:llegadaSolic,
			timeout:4000,
			error:function(result){
            alert('ERROR ' + result.status + ' ' + result.statusText);
          }
		});
		return false;
	}

	//Carga en el area de trabajo de la pantalla el formulario correspondiente para la ingresar motivos en la base de datos
	function motivos()
	{
		$.ajax({
			async:true,
			type: "POST",
			dataType: "html",
			contentType: "application/x-www-form-urlencoded",
			url:"pages/permisos/motivo.php",
			// url:"../Motivos.php",
			beforeSend:inicioEnvio,
			success:llegadaMotivos,
			timeout:4000,
			error:problemas
		});
		return false;
	}

	//Carga en el area de trabajo de la pantalla el formulario correspondiente para la ingresar edificios en la base de datos
	function Edificios()
	{
		$.ajax({
			async:true,
			type: "POST",
			dataType: "html",
			contentType: "application/x-www-form-urlencoded",
			url:"pages/permisos/Edificios.php",
			// url:"../Edificios.php",
			beforeSend:inicioEnvio,
			success:llegadaEdificios,
			timeout:4000,
			error:problemas
		});
		return false;
	}

	//Carga en el area de trabajo de la pantalla el formulario correspondiente para la ingresar unidades academicas en la base de datos
	function Unidad()
	{
		$.ajax({
			async:true,
			type: "POST",
			dataType: "html",
			contentType: "application/x-www-form-urlencoded",
			url:"pages/permisos/Unidad_Academica.php",
			// url:"../Unidad_Academica.php",
			beforeSend:inicioEnvio,
			success:llegadaUnidad,
			timeout:4000,
			error:problemas
		});
		return false;
	}

	//Carga en el area de trabajo de la pantalla el formulario correspondiente para la visualización de los reportes
	function reportes()
	{
		$.ajax({
			async:true,
			type: "POST",
			dataType: "html",
			contentType: "application/x-www-form-urlencoded",
			url:"pages/permisos/reportes.php",
			// url:"../Unidad_Academica.php",
			beforeSend:inicioEnvio,
			success:llegadareporte,
			timeout:4000,
			error:problemas
		});
		return false;
	}

	function Revision()
	{
		$.ajax({
			async:true,
			type: "POST",
			dataType: "html",
			contentType: "application/x-www-form-urlencoded",
			url:"pages/permisos/revision.php",
			// url:"../revision.php",
			beforeSend:inicioEnvio,
			success:llegadaRevision,
			timeout:4000,
			error:problemas
		});
		return false;
	}

	//Esta función desaparece momentaneamente el formulario mientras las de guardado son realizadas
	function inicioEnvio()
	{
		var x=$("#contenedor");
		x.html('Cargando...');
	}

	//Esta función carga nuevamente el formulario solicitado
	function llegadaSolic()
	{
		$("#contenedor").load('pages/permisos/Solicitud.php');
		 //$("#contenedor").load('../permisos/solicitudes.php');
	}

	//Esta función carga nuevamente el formulario solicitado
	function llegadareporte()
	{
		$("#contenedor").load('pages/permisos/reportes.php');
		 //$("#contenedor").load('../permisos/reportes.php');
	}

	//Esta función carga nuevamente el formulario solicitado
	function llegadaMotivos()
	{
		$("#contenedor").load('pages/permisos/motivo.php');
		 //$("#contenedor").load('../permisos/motivos.php');
	}

	//Esta función carga nuevamente el formulario solicitado
	function llegadaEdificios()
	{
		$("#contenedor").load('pages/permisos/Edificios.php');
		 //$("#contenedor").load('../permisos/Edificios.php');
	}

	//Esta función carga nuevamente el formulario solicitado
	function llegadaUnidad()
	{
		$("#contenedor").load('pages/permisos/Unidad_Academica.php');
		 //$("#contenedor").load('../permisos/Unidad_Academica.php');
	}

	//Esta función carga nuevamente el formulario solicitado
	function llegadaRevision()
	{
		$("#contenedor").load('pages/permisos/revision.php');
		 //$("#contenedor").load('../permisos/revision.php');
	}

	//Muestra un mensaje de error cuando la transacción falla
	function problemas()
	{
		$("#contenedor").text();
	}

redpajama_set_name: RedPajamaGithub


text:
package sun.jvm.hotspot.ui.table;

import java.awt.Component;

import javax.swing.*;
import javax.swing.table.*;

/**
 * A renderer for long values.
 */
public class LongCellRenderer extends DefaultTableCellRenderer {

    private JFormattedTextField textField;

    // Subclassed to set the background value
    public Component getTableCellRendererComponent(JTable table, Object value,
                                                   boolean isSelected, boolean hasFocus,
                                                   int row, int column)  {
        if (textField == null) {
            textField = new JFormattedTextField();
            textField.setFont(table.getFont());
            textField.setHorizontalAlignment(JTextField.RIGHT);
        }

        textField.setForeground(isSelected ? table.getSelectionForeground() :
                                table.getForeground());
        textField.setBackground(isSelected ? table.getSelectionBackground() :
                                table.getBackground());
        if (hasFocus) {
            textField.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
        } else {
            textField.setBorder(noFocusBorder);
        }

        textField.setValue((Long)value);

        return textField;
    }
}


text:
<?php
	namespace core;

	/**
	 * Classe modèle des controllers
	 */
	abstract class Controller {

		protected $_view;
		protected $_access = 'formateur';

		public function __construct(View $view)
		{
			$this->_view = $view;
		}

		public function getAccess() { return $this->_access; }

		abstract public function actionDefault();
	}
?>


text:
/*************************************************************************/
/*  tile_map.cpp                                                         */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                    http://www.godotengine.org                         */
/*************************************************************************/
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                 */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/
#include "tile_map.h"
#include "io/marshalls.h"
#include "servers/physics_2d_server.h"
void TileMap::_notification(int p_what) {

	switch(p_what) {

		case NOTIFICATION_ENTER_TREE: {

			pending_update=true;
			_update_dirty_quadrants();
			RID space = get_world_2d()->get_space();
			_update_quadrant_transform();
			_update_quadrant_space(space);

		} break;
		case NOTIFICATION_EXIT_TREE: {

			_update_quadrant_space(RID());

		} break;
		case NOTIFICATION_TRANSFORM_CHANGED: {

			//move stuff
			_update_quadrant_transform();

		} break;
	}
}

void TileMap::_update_quadrant_space(const RID& p_space) {

	for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {

		Quadrant &q=E->get();
		Physics2DServer::get_singleton()->body_set_space(q.static_body,p_space);
	}
}

void TileMap::_update_quadrant_transform() {

	if (!is_inside_tree())
		return;

	Matrix32 global_transform = get_global_transform();

	for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {

		Quadrant &q=E->get();
		Matrix32 xform;
		xform.set_origin( q.pos );
		xform = global_transform * xform;
		Physics2DServer::get_singleton()->body_set_state(q.static_body,Physics2DServer::BODY_STATE_TRANSFORM,xform);
	}
}

void TileMap::set_tileset(const Ref<TileSet>& p_tileset) {

	if (tile_set.is_valid())
		tile_set->disconnect("changed",this,"_recreate_quadrants");

	_clear_quadrants();
	tile_set=p_tileset;

	if (tile_set.is_valid())
		tile_set->connect("changed",this,"_recreate_quadrants");
	else
		clear();

	_recreate_quadrants();
	emit_signal("settings_changed");

}

Ref<TileSet> TileMap::get_tileset() const {

	return tile_set;
}

void TileMap::set_cell_size(Size2 p_size) {

	ERR_FAIL_COND(p_size.x<1 || p_size.y<1);

	_clear_quadrants();
	cell_size=p_size;
	_recreate_quadrants();
	emit_signal("settings_changed");

}
Size2 TileMap::get_cell_size() const {

	return cell_size;
}
void TileMap::set_quadrant_size(int p_size) {

	ERR_FAIL_COND(p_size<1);

	_clear_quadrants();
	quadrant_size=p_size;
	_recreate_quadrants();
	emit_signal("settings_changed");

}
int TileMap::get_quadrant_size() const {

	return quadrant_size;
}

void TileMap::set_center_x(bool p_enable) {

	center_x=p_enable;
	_recreate_quadrants();
	emit_signal("settings_changed");

}
bool TileMap::get_center_x() const {

	return center_x;
}
void TileMap::set_center_y(bool p_enable) {

	center_y=p_enable;
	_recreate_quadrants();
	emit_signal("settings_changed");

}
bool TileMap::get_center_y() const {

	return center_y;
}

void TileMap::_update_dirty_quadrants() {

	if (!pending_update)
		return;
	if (!is_inside_tree())
		return;
	if (!tile_set.is_valid())
		return;

	VisualServer *vs = VisualServer::get_singleton();
	Physics2DServer *ps = Physics2DServer::get_singleton();
	Vector2 tofs = get_cell_draw_offset();

	while (dirty_quadrant_list.first()) {

		Quadrant &q = *dirty_quadrant_list.first()->self();

		vs->canvas_item_clear(q.canvas_item);
		ps->body_clear_shapes(q.static_body);
		int shape_idx=0;

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

			Map<PosKey,Cell>::Element *E=tile_map.find( q.cells[i] );
			Cell &c=E->get();
			//moment of truth
			if (!tile_set->has_tile(c.id))
				continue;
			Ref<Texture> tex = tile_set->tile_get_texture(c.id);
			Vector2 tile_ofs = tile_set->tile_get_texture_offset(c.id);

			Vector2 offset = _map_to_world(E->key().x, E->key().y) - q.pos + tofs;

			if (!tex.is_valid())
				continue;

			Rect2 r = tile_set->tile_get_region(c.id);
			Size2 s = tex->get_size();

			if (r==Rect2())
				s = tex->get_size();
			else {
				s = r.size;
				r.pos.x+=fp_adjust;
				r.pos.y+=fp_adjust;
				r.size.x-=fp_adjust*2.0;
				r.size.y-=fp_adjust*2.0;
			}

			Rect2 rect;
			rect.pos=offset.floor();
			rect.size=s;

			rect.size.x+=fp_adjust;
			rect.size.y+=fp_adjust;

			if (c.flip_h)
				rect.size.x=-rect.size.x;
			if (c.flip_v)
				rect.size.y=-rect.size.y;

			rect.pos+=tile_ofs;
			if (r==Rect2()) {

				tex->draw_rect(q.canvas_item,rect);
			} else {

				tex->draw_rect_region(q.canvas_item,rect,r);
			}

			Vector< Ref<Shape2D> > shapes = tile_set->tile_get_shapes(c.id);

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

				Ref<Shape2D> shape = shapes[i];
				if (shape.is_valid()) {

					Vector2 shape_ofs = tile_set->tile_get_shape_offset(c.id);
					Matrix32 xform;
					xform.set_origin(offset.floor());
					if (c.flip_h) {
						xform.elements[0]=-xform.elements[0];
						xform.elements[2].x+=s.x-shape_ofs.x;
					} else {

						xform.elements[2].x+=shape_ofs.x;
					}
					if (c.flip_v) {
						xform.elements[1]=-xform.elements[1];
						xform.elements[2].y+=s.y-shape_ofs.y;
					} else {

						xform.elements[2].y+=shape_ofs.y;
					}

					ps->body_add_shape(q.static_body,shape->get_rid(),xform);
					ps->body_set_shape_metadata(q.static_body,shape_idx++,Vector2(E->key().x,E->key().y));

				}
			}
		}

		dirty_quadrant_list.remove( dirty_quadrant_list.first() );
	}

	pending_update=false;

	if (quadrant_order_dirty) {

		for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {

			Quadrant &q=E->get();
			if (q.canvas_item.is_valid()) {
				VS::get_singleton()->canvas_item_raise(q.canvas_item);
			}

		}

		quadrant_order_dirty=false;
	}

	_recompute_rect_cache();

}

void TileMap::_recompute_rect_cache() {

#ifdef DEBUG_ENABLED

	if (!rect_cache_dirty)
		return;

	Rect2 r_total;
	for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {

		Rect2 r;
		r.pos=_map_to_world(E->key().x*quadrant_size, E->key().y*quadrant_size);
		r.expand_to( _map_to_world(E->key().x*quadrant_size+quadrant_size, E->key().y*quadrant_size) );
		r.expand_to( _map_to_world(E->key().x*quadrant_size+quadrant_size, E->key().y*quadrant_size+quadrant_size) );
		r.expand_to( _map_to_world(E->key().x*quadrant_size, E->key().y*quadrant_size+quadrant_size) );
		if (E==quadrant_map.front())
			r_total=r;
		else
			r_total=r_total.merge(r);

	}

	if (r_total==Rect2()) {
		rect_cache=Rect2(-10,-10,20,20);
	} else {
		rect_cache=r_total.grow(MAX(cell_size.x,cell_size.y)*quadrant_size);
	}

	item_rect_changed();

	rect_cache_dirty=false;
#endif

}

Map<TileMap::PosKey,TileMap::Quadrant>::Element *TileMap::_create_quadrant(const PosKey& p_qk) {

	Matrix32 xform;
	//xform.set_origin(Point2(p_qk.x,p_qk.y)*cell_size*quadrant_size);
	Quadrant q;
	q.pos = _map_to_world(p_qk.x*quadrant_size,p_qk.y*quadrant_size);
	xform.set_origin( q.pos );
	q.canvas_item = VisualServer::get_singleton()->canvas_item_create();
	VisualServer::get_singleton()->canvas_item_set_parent( q.canvas_item, get_canvas_item() );
	VisualServer::get_singleton()->canvas_item_set_transform( q.canvas_item, xform );
	q.static_body=Physics2DServer::get_singleton()->body_create(Physics2DServer::BODY_MODE_STATIC);
	Physics2DServer::get_singleton()->body_attach_object_instance_ID(q.static_body,get_instance_ID());
	Physics2DServer::get_singleton()->body_set_layer_mask(q.static_body,collision_layer);
	Physics2DServer::get_singleton()->body_set_param(q.static_body,Physics2DServer::BODY_PARAM_FRICTION,friction);
	Physics2DServer::get_singleton()->body_set_param(q.static_body,Physics2DServer::BODY_PARAM_BOUNCE,bounce);

	if (is_inside_tree()) {
		xform = get_global_transform() * xform;
		RID space = get_world_2d()->get_space();
		Physics2DServer::get_singleton()->body_set_space(q.static_body,space);
	}

	Physics2DServer::get_singleton()->body_set_state(q.static_body,Physics2DServer::BODY_STATE_TRANSFORM,xform);

	rect_cache_dirty=true;
	quadrant_order_dirty=true;
	return quadrant_map.insert(p_qk,q);
}

void TileMap::_erase_quadrant(Map<PosKey,Quadrant>::Element *Q) {

	Quadrant &q=Q->get();
	Physics2DServer::get_singleton()->free(q.static_body);
	VisualServer::get_singleton()->free(q.canvas_item);
	if (q.dirty_list.in_list())
		dirty_quadrant_list.remove(&q.dirty_list);

	quadrant_map.erase(Q);
	rect_cache_dirty=true;
}

void TileMap::_make_quadrant_dirty(Map<PosKey,Quadrant>::Element *Q) {

	Quadrant &q=Q->get();
	if (!q.dirty_list.in_list())
		dirty_quadrant_list.add(&q.dirty_list);

	if (pending_update)
		return;
	pending_update=true;
	if (!is_inside_tree())
		return;
	call_deferred("_update_dirty_quadrants");
}

void TileMap::set_cell(int p_x,int p_y,int p_tile,bool p_flip_x,bool p_flip_y) {

	PosKey pk(p_x,p_y);

	Map<PosKey,Cell>::Element *E=tile_map.find(pk);
	if (!E && p_tile==INVALID_CELL)
		return; //nothing to do

	PosKey qk(p_x/quadrant_size,p_y/quadrant_size);
	if (p_tile==INVALID_CELL) {
		//erase existing
		tile_map.erase(pk);
		Map<PosKey,Quadrant>::Element *Q = quadrant_map.find(qk);
		ERR_FAIL_COND(!Q);
		Quadrant &q=Q->get();
		q.cells.erase(pk);
		if (q.cells.size()==0)
			_erase_quadrant(Q);
		else
			_make_quadrant_dirty(Q);

		return;
	}

	Map<PosKey,Quadrant>::Element *Q = quadrant_map.find(qk);

	if (!E) {
		E=tile_map.insert(pk,Cell());
		if (!Q) {
			Q=_create_quadrant(qk);
		}
		Quadrant &q=Q->get();
		q.cells.insert(pk);
	} else {
		ERR_FAIL_COND(!Q); // quadrant should exist...

		if (E->get().id==p_tile && E->get().flip_h==p_flip_x && E->get().flip_v==p_flip_y)
			return; //nothing changed

	}

	Cell &c = E->get();

	c.id=p_tile;
	c.flip_h=p_flip_x;
	c.flip_v=p_flip_y;

	_make_quadrant_dirty(Q);

}

int TileMap::get_cell(int p_x,int p_y) const {

	PosKey pk(p_x,p_y);

	const Map<PosKey,Cell>::Element *E=tile_map.find(pk);

	if (!E)
		return INVALID_CELL;

	return E->get().id;

}
bool TileMap::is_cell_x_flipped(int p_x,int p_y) const {

	PosKey pk(p_x,p_y);

	const Map<PosKey,Cell>::Element *E=tile_map.find(pk);

	if (!E)
		return false;

	return E->get().flip_h;
}
bool TileMap::is_cell_y_flipped(int p_x,int p_y) const {

	PosKey pk(p_x,p_y);

	const Map<PosKey,Cell>::Element *E=tile_map.find(pk);

	if (!E)
		return false;

	return E->get().flip_v;
}

void TileMap::_recreate_quadrants() {

	_clear_quadrants();

	for (Map<PosKey,Cell>::Element *E=tile_map.front();E;E=E->next()) {

		PosKey qk(E->key().x/quadrant_size,E->key().y/quadrant_size);

		Map<PosKey,Quadrant>::Element *Q=quadrant_map.find(qk);
		if (!Q) {
			Q=_create_quadrant(qk);
			dirty_quadrant_list.add(&Q->get().dirty_list);
		}

		Q->get().cells.insert(E->key());
		_make_quadrant_dirty(Q);
	}

}

void TileMap::_clear_quadrants() {

	while (quadrant_map.size()) {
		_erase_quadrant( quadrant_map.front() );
	}
}

void TileMap::clear() {

	_clear_quadrants();
	tile_map.clear();
}

void TileMap::_set_tile_data(const DVector<int>& p_data) {

	int c=p_data.size();
	DVector<int>::Read r = p_data.read();

	for(int i=0;i<c;i+=2) {

		const uint8_t *ptr=(const uint8_t*)&r[i];
		uint8_t local[8];
		for(int j=0;j<8;j++)
			local[j]=ptr[j];

#ifdef BIG_ENDIAN_ENABLED

		SWAP(local[0],local[3]);
		SWAP(local[1],local[2]);
		SWAP(local[4],local[7]);
		SWAP(local[5],local[6]);
#endif

		int16_t x = decode_uint16(&local[0]);
		int16_t y = decode_uint16(&local[2]);
		uint32_t v = decode_uint32(&local[4]);
		bool flip_h = v&(1<<29);
		bool flip_v = v&(1<<30);
		v&=(1<<29)-1;

//		if (x<-20 || y <-20 || x>4000 || y>4000)
//			continue;
		set_cell(x,y,v,flip_h,flip_v);

	}

}

DVector<int> TileMap::_get_tile_data() const {

	DVector<int> data;
	data.resize(tile_map.size()*2);
	DVector<int>::Write w = data.write();

	int idx=0;
	for(const Map<PosKey,Cell>::Element *E=tile_map.front();E;E=E->next()) {

		uint8_t *ptr = (uint8_t*)&w[idx];
		encode_uint16(E->key().x,&ptr[0]);
		encode_uint16(E->key().y,&ptr[2]);
		uint32_t val = E->get().id;
		if (E->get().flip_h)
			val|=(1<<29);
		if (E->get().flip_v)
			val|=(1<<30);

		encode_uint32(val,&ptr[4]);
		idx+=2;
	}

	w = DVector<int>::Write();

	return data;

}

Rect2 TileMap::get_item_rect() const {

	const_cast<TileMap*>(this)->_update_dirty_quadrants();
	return rect_cache;
}

void TileMap::set_collision_layer_mask(uint32_t p_layer) {

	collision_layer=p_layer;
	for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {

		Quadrant &q=E->get();
		Physics2DServer::get_singleton()->body_set_layer_mask(q.static_body,collision_layer);
	}
}

void TileMap::set_collision_friction(float p_friction) {

	friction=p_friction;
	for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {

		Quadrant &q=E->get();
		Physics2DServer::get_singleton()->body_set_param(q.static_body,Physics2DServer::BODY_PARAM_FRICTION,p_friction);
	}

}

float TileMap::get_collision_friction() const{

	return friction;
}

void TileMap::set_collision_bounce(float p_bounce){

	bounce=p_bounce;
	for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) {

		Quadrant &q=E->get();
		Physics2DServer::get_singleton()->body_set_param(q.static_body,Physics2DServer::BODY_PARAM_BOUNCE,p_bounce);
	}

}
float TileMap::get_collision_bounce() const{

	return bounce;
}

uint32_t TileMap::get_collision_layer_mask() const {

	return collision_layer;
}

void TileMap::set_mode(Mode p_mode) {

	_clear_quadrants();
	mode=p_mode;
	_recreate_quadrants();
	emit_signal("settings_changed");
}

TileMap::Mode TileMap::get_mode() const {
	return mode;
}

void TileMap::set_half_offset(HalfOffset p_half_offset) {

	_clear_quadrants();
	half_offset=p_half_offset;
	_recreate_quadrants();
	emit_signal("settings_changed");
}

Vector2 TileMap::get_cell_draw_offset() const {

	switch(mode) {

		case MODE_SQUARE: {

			return Vector2();
		} break;
		case MODE_ISOMETRIC: {

			return Vector2(-cell_size.x*0.5,0);

		} break;
		case MODE_CUSTOM: {

			Vector2 min;
			min.x = MIN(custom_transform[0].x,min.x);
			min.y = MIN(custom_transform[0].y,min.y);
			min.x = MIN(custom_transform[1].x,min.x);
			min.y = MIN(custom_transform[1].y,min.y);
			return min;
		} break;
	}

	return Vector2();

}

TileMap::HalfOffset TileMap::get_half_offset() const {
	return half_offset;
}

Matrix32 TileMap::get_cell_transform() const {

	switch(mode) {

		case MODE_SQUARE: {

			Matrix32 m;
			m[0]*=cell_size.x;
			m[1]*=cell_size.y;
			return m;
		} break;
		case MODE_ISOMETRIC: {

			//isometric only makes sense when y is positive in both x and y vectors, otherwise
			//the drawing of tiles will overlap
			Matrix32 m;
			m[0]=Vector2(cell_size.x*0.5,cell_size.y*0.5);
			m[1]=Vector2(-cell_size.x*0.5,cell_size.y*0.5);
			return m;

		} break;
		case MODE_CUSTOM: {

			return custom_transform;
		} break;
	}

	return Matrix32();
}

void TileMap::set_custom_transform(const Matrix32& p_xform) {

	_clear_quadrants();
	custom_transform=p_xform;
	_recreate_quadrants();
	emit_signal("settings_changed");

}

Matrix32 TileMap::get_custom_transform() const{

	return custom_transform;
}

Vector2 TileMap::_map_to_world(int x,int y,bool p_ignore_ofs) const {

	Vector2 ret = get_cell_transform().xform(Vector2(x,y));
	if (!p_ignore_ofs) {
		switch(half_offset) {

			case HALF_OFFSET_X: {
				if (ABS(y)&1) {

					ret+=get_cell_transform()[0]*0.5;
				}
			} break;
			case HALF_OFFSET_Y: {
				if (ABS(x)&1) {
					ret+=get_cell_transform()[1]*0.5;
				}
			} break;
			default: {}
		}
	}
	return ret;
}
Vector2 TileMap::map_to_world(const Vector2& p_pos,bool p_ignore_ofs) const {

	return _map_to_world(p_pos.x,p_pos.y,p_ignore_ofs);
}
Vector2 TileMap::world_to_map(const Vector2& p_pos) const{

	Vector2 ret = get_cell_transform().affine_inverse().xform(p_pos);

	switch(half_offset) {

		case HALF_OFFSET_X: {
			if (int(ret.y)&1) {

				ret.x-=0.5;
			}
		} break;
		case HALF_OFFSET_Y: {
			if (int(ret.x)&1) {
				ret.y-=0.5;
			}
		} break;
		default: {}
	}

	return ret.floor();
}

void TileMap::_bind_methods() {

	ObjectTypeDB::bind_method(_MD("set_tileset","tileset:TileSet"),&TileMap::set_tileset);
	ObjectTypeDB::bind_method(_MD("get_tileset:TileSet"),&TileMap::get_tileset);

	ObjectTypeDB::bind_method(_MD("set_mode","mode"),&TileMap::set_mode);
	ObjectTypeDB::bind_method(_MD("get_mode"),&TileMap::get_mode);

	ObjectTypeDB::bind_method(_MD("set_half_offset","half_offset"),&TileMap::set_half_offset);
	ObjectTypeDB::bind_method(_MD("get_half_offset"),&TileMap::get_half_offset);

	ObjectTypeDB::bind_method(_MD("set_custom_transform","custom_transform"),&TileMap::set_custom_transform);
	ObjectTypeDB::bind_method(_MD("get_custom_transform"),&TileMap::get_custom_transform);

	ObjectTypeDB::bind_method(_MD("set_cell_size","size"),&TileMap::set_cell_size);
	ObjectTypeDB::bind_method(_MD("get_cell_size"),&TileMap::get_cell_size);

	ObjectTypeDB::bind_method(_MD("_set_old_cell_size","size"),&TileMap::_set_old_cell_size);
	ObjectTypeDB::bind_method(_MD("_get_old_cell_size"),&TileMap::_get_old_cell_size);

	ObjectTypeDB::bind_method(_MD("set_quadrant_size","size"),&TileMap::set_quadrant_size);
	ObjectTypeDB::bind_method(_MD("get_quadrant_size"),&TileMap::get_quadrant_size);

	ObjectTypeDB::bind_method(_MD("set_center_x","enable"),&TileMap::set_center_x);
	ObjectTypeDB::bind_method(_MD("get_center_x"),&TileMap::get_center_x);

	ObjectTypeDB::bind_method(_MD("set_center_y","enable"),&TileMap::set_center_y);
	ObjectTypeDB::bind_method(_MD("get_center_y"),&TileMap::get_center_y);

	ObjectTypeDB::bind_method(_MD("set_collision_layer_mask","mask"),&TileMap::set_collision_layer_mask);
	ObjectTypeDB::bind_method(_MD("get_collision_layer_mask"),&TileMap::get_collision_layer_mask);

	ObjectTypeDB::bind_method(_MD("set_collision_friction","value"),&TileMap::set_collision_friction);
	ObjectTypeDB::bind_method(_MD("get_collision_friction"),&TileMap::get_collision_friction);

	ObjectTypeDB::bind_method(_MD("set_collision_bounce","value"),&TileMap::set_collision_bounce);
	ObjectTypeDB::bind_method(_MD("get_collision_bounce"),&TileMap::get_collision_bounce);

	ObjectTypeDB::bind_method(_MD("set_cell","x","y","tile","flip_x","flip_y"),&TileMap::set_cell,DEFVAL(false),DEFVAL(false));
	ObjectTypeDB::bind_method(_MD("get_cell","x","y"),&TileMap::get_cell);
	ObjectTypeDB::bind_method(_MD("is_cell_x_flipped","x","y"),&TileMap::is_cell_x_flipped);
	ObjectTypeDB::bind_method(_MD("is_cell_y_flipped","x","y"),&TileMap::is_cell_y_flipped);

	ObjectTypeDB::bind_method(_MD("clear"),&TileMap::clear);

	ObjectTypeDB::bind_method(_MD("map_to_world","mappos","ignore_half_ofs"),&TileMap::map_to_world,DEFVAL(false));
	ObjectTypeDB::bind_method(_MD("world_to_map","worldpos"),&TileMap::world_to_map);

	ObjectTypeDB::bind_method(_MD("_clear_quadrants"),&TileMap::_clear_quadrants);
	ObjectTypeDB::bind_method(_MD("_recreate_quadrants"),&TileMap::_recreate_quadrants);
	ObjectTypeDB::bind_method(_MD("_update_dirty_quadrants"),&TileMap::_update_dirty_quadrants);

	ObjectTypeDB::bind_method(_MD("_set_tile_data"),&TileMap::_set_tile_data);
	ObjectTypeDB::bind_method(_MD("_get_tile_data"),&TileMap::_get_tile_data);

	ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Square,Isometric,Custom"),_SCS("set_mode"),_SCS("get_mode"));
	ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_set",PROPERTY_HINT_RESOURCE_TYPE,"TileSet"),_SCS("set_tileset"),_SCS("get_tileset"));
	ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_size",PROPERTY_HINT_RANGE,"1,8192,1",0),_SCS("_set_old_cell_size"),_SCS("_get_old_cell_size"));
	ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"cell/size",PROPERTY_HINT_RANGE,"1,8192,1"),_SCS("set_cell_size"),_SCS("get_cell_size"));
	ADD_PROPERTY( PropertyInfo(Variant::INT,"cell/quadrant_size",PROPERTY_HINT_RANGE,"1,128,1"),_SCS("set_quadrant_size"),_SCS("get_quadrant_size"));
	ADD_PROPERTY( PropertyInfo(Variant::MATRIX32,"cell/custom_transform"),_SCS("set_custom_transform"),_SCS("get_custom_transform"));
	ADD_PROPERTY( PropertyInfo(Variant::INT,"cell/half_offset",PROPERTY_HINT_ENUM,"Offset X,Offset Y,Disabled"),_SCS("set_half_offset"),_SCS("get_half_offset"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_friction"),_SCS("get_collision_friction"));
	ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_bounce"),_SCS("get_collision_bounce"));
	ADD_PROPERTY( PropertyInfo(Variant::INT,"collision/layers",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_layer_mask"),_SCS("get_collision_layer_mask"));
	ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_tile_data"),_SCS("_get_tile_data"));

	ADD_SIGNAL(MethodInfo("settings_changed"));

	BIND_CONSTANT( INVALID_CELL );
	BIND_CONSTANT( MODE_SQUARE );
	BIND_CONSTANT( MODE_ISOMETRIC );
	BIND_CONSTANT( MODE_CUSTOM );
	BIND_CONSTANT( HALF_OFFSET_X );
	BIND_CONSTANT( HALF_OFFSET_Y );
	BIND_CONSTANT( HALF_OFFSET_DISABLED );

}

TileMap::TileMap() {

	rect_cache_dirty=true;
	pending_update=false;
	quadrant_order_dirty=false;
	quadrant_size=16;
	cell_size=Size2(64,64);
	center_x=false;
	center_y=false;
	collision_layer=1;
	friction=1;
	bounce=0;
	mode=MODE_SQUARE;
	half_offset=HALF_OFFSET_DISABLED;

	fp_adjust=0.01;
	fp_adjust=0.01;
}

TileMap::~TileMap() {

	clear();
}


text:
<?php

require_once dirname(dirname(__DIR__)).'/prumo.php';

pProtect('prumo_devtools');
?>

<fieldset>
<legend><?=_('Atualização de banco de dados');?></legend>

    <?=_('Cole na caixa de texto o código DDL de atualização do banco de dados:');?>

        <textarea id="ddl_code" autofocus wrap="off" style="font: 12px Courier New; height: 350px; width: 99%;" onchange="txPrumoCode_change()"></textarea>

    <input type="checkbox" id="uptodate" checked="checked" /> <?=_('Considerar que este script já foi executado na base de dados atual');?>

    <button onclick="btWriteScript_click()"><?=_('Gravar script');?></button>

</fieldset>


text:
/* $lab:coverage:off$ */
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
/* $lab:coverage:on$ */

module.exports = isPositiveInteger;
module.exports.isSafePositiveInteger = isSafePositiveInteger;

function isPositiveInteger(x) {
    // Is it a number?
  return Object.prototype.toString.call(x) === '[object Number]' &&
        // Is it an integer?
        x % 1 === 0 &&
        // Is it positive?
        x > 0;
}

// strict positive integer check:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
function isSafePositiveInteger(x) {
  return isPositiveInteger(x) &&
        x <= MAX_SAFE_INTEGER;
}


text:
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=broadcom-diag
PKG_RELEASE:=11

include $(INCLUDE_DIR)/package.mk

define KernelPackage/diag
  SUBMENU:=Other modules
  DEPENDS:=@TARGET_brcm47xx
  TITLE:=Driver for router LEDs and Buttons
  FILES:=$(PKG_BUILD_DIR)/diag.ko
  AUTOLOAD:=$(call AutoLoad,05,diag,1)
endef

define KernelPackage/diag/description
 Kernel modules for Broadcom LED and Button driver
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

define Build/Compile
	$(MAKE) -C "$(LINUX_DIR)" \
		CROSS_COMPILE="$(TARGET_CROSS)" \
		ARCH="$(LINUX_KARCH)" \
		SUBDIRS="$(PKG_BUILD_DIR)" \
		EXTRA_CFLAGS="$(BUILDFLAGS)" \
		modules
endef

$(eval $(call KernelPackage,diag))


text:
import * as types from '../constants/counter.const';

export default function CounterApp(state = 0, action) {
    switch(action.type) {
        case types.INCREMENT:
            return state = state + 1;
        case types.DECREMENT:
            return state = state - 1;
    }
    return state;
}


text:
#ifndef TEST_EX_3_H
#define TEST_EX_3_H

#include <automata.h>
#include <libconfig.h>
#include "minunit.h"

MU_TEST(example3_a) {
    config_t cfg;
    config_init(&cfg);

    if(!config_read_file(&cfg, "../examples/example3.aut")) {
        config_destroy(&cfg);
        mu_fail("Could not read example3.aut");
    }

    bool acc = automata_is_accepted(&cfg, "q_0", "a");

    config_destroy(&cfg);
    mu_assert(!acc, "'a' accepted as input by example 3");
}

MU_TEST(example3_ab) {
    config_t cfg;
    config_init(&cfg);

    if(!config_read_file(&cfg, "../examples/example3.aut")) {
        config_destroy(&cfg);
        mu_fail("Could not read example3.aut");
    }

    bool acc = automata_is_accepted(&cfg, "q_0", "ab");

    config_destroy(&cfg);
    mu_assert(!acc, "'ab' accepted as input by example 3");
}

MU_TEST(example3_b) {
    config_t cfg;
    config_init(&cfg);

    if(!config_read_file(&cfg, "../examples/example3.aut")) {
        config_destroy(&cfg);
        mu_fail("Could not read example3.aut");
    }

    bool acc = automata_is_accepted(&cfg, "q_0", "b");

    config_destroy(&cfg);
    mu_assert(acc, "'b' not accepted as input by example 3");
}

MU_TEST(example3_ba) {
    config_t cfg;
    config_init(&cfg);

    if(!config_read_file(&cfg, "../examples/example3.aut")) {
        config_destroy(&cfg);
        mu_fail("Could not read example3.aut");
    }

    bool acc = automata_is_accepted(&cfg, "q_0", "ba");

    config_destroy(&cfg);
    mu_assert(acc, "'ba' not accepted as input by example 3");
}

MU_TEST(example3_aba) {
    config_t cfg;
    config_init(&cfg);

    if(!config_read_file(&cfg, "../examples/example3.aut")) {
        config_destroy(&cfg);
        mu_fail("Could not read example3.aut");
    }

    bool acc = automata_is_accepted(&cfg, "q_0", "b");

    config_destroy(&cfg);
    mu_assert(acc, "'aba' not accepted as input by example 3");
}

MU_TEST_SUITE(example3) {
    MU_RUN_TEST(example3_a);
    MU_RUN_TEST(example3_ab);
    MU_RUN_TEST(example3_b);
    MU_RUN_TEST(example3_ba);
    MU_RUN_TEST(example3_aba);
}

#endif /* TEST_EX_3_H */


text:
> ¡Ándale! ¡Ándale! ¡Arriba! ¡Arriba! ¡Epa! ¡Epa! ¡Epa! Yeehaw!

*"Gosh, yet another micro-framework for timing PHP code..*" you might say. I can deal with that. Almost.

----

## Installation

```sh
$  composer require "lx/gonzalez" "dev-master"
```

## Usage

### Setup

```php

<?php

use \Gonzalez\Runner

require_once 'vendor/autoload.php';

$function_to_benchmark = function() {
    // code to benchmark goes here...
};

$runner = new Runner($function_to_benchmark);

```

### Basics

```php
$results = $runner->run(1000);

$iterations = count($results);
$overall_time = array_sum($results);

$fastest = min($results);
$slowest = max($results);
$average = $iterations / $overall_time;

```

### Calibration

#### Why?

Let's say you want to measure how fast you can drink a pint of beer. Let's also say you have only one arm.
The steps it would take are:

1. Press `Start` in the stopwatch app in your shiny smartphone
2. Put your smartphone on the desk
3. Grab the glass
4. Drink
5. Put down the glass
6. Grab your smartphone
7. Press `Stop` in the stopwatch app in your shiny smartphone
8. Burp

What you wanted to measure was only action #4, what you actually measured was action #2 to #7. Not good.

#### How?

Gonzalez provides a simple way to calibrate your benchmarks: **Gonzalez**.

The minimum calibration you want to do is the time it takes php entering and leaving the function to benchmark. So if
you want to benchmark an anonymous function you would take an empty anonymous function:

```php
$empty_anonymous_function = function () {};
$calibrator = new Runner($empty_anonymous_function);

$result = $calibrator->run(10000);
$calibration_time = min($result);

$runner->setCalibrationTime($calibration_time);

$result = $runner->run(1000);
// ...

```

In general your calibration function should be exactly the same as the function you want to benchmark, *excluding* the
lines of code you really want to benchmark.

----
## Bunch'o'Badges

[![Build Status](https://img.shields.io/travis/l-x/gonzalez/master.svg?style=flat-square)](https://travis-ci.org/l-x/gonzalez)
[![Test Coverage](https://img.shields.io/codeclimate/coverage/github/l-x/gonzalez.svg?style=flat-square)](https://codeclimate.com/github/l-x/gonzalez)
[![Code Climate](https://img.shields.io/codeclimate/github/l-x/gonzalez.svg?style=flat-square)](https://codeclimate.com/github/l-x/gonzalez)
[![License](https://img.shields.io/packagist/l/lx/gonzalez.svg?style=flat-square)](https://packagist.org/packages/lx/gonzalez)
[![Badges](https://img.shields.io/badge/Badges-5%2F5-orange.svg?style=flat-square)](http://shields.io)


text:
import {
  ChangeDetectionStrategy,
  Component,
  EventEmitter,
  Input,
  OnChanges,
  OnInit,
  Output,
  SimpleChanges,
  ViewEncapsulation,
} from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatChipInputEvent } from '@angular/material/chips';
import { Observable } from 'rxjs';
import { map, startWith } from 'rxjs/operators';
import { ApiRequestStatus } from '../../../../../framework/client/rpc';
import {
  App,
  APP_STORE_CATEGORIES,
  Contact,
  DeveloperAccount,
  Language,
  LANGUAGES,
  PLAY_STORE_CATEGORIES,
  ReviewNotes,
} from '../../../interfaces';

@Component({
  selector: 'rcc-store-listing-detail-form',
  changeDetection: ChangeDetectionStrategy.OnPush,
  encapsulation: ViewEncapsulation.None,
  templateUrl: 'store-listing-detail-form.component.html',
})
export class StoreListingDetailFormComponent implements OnInit, OnChanges {
  languageFormControl = new FormControl();
  languages = LANGUAGES;
  appStoreCategories = APP_STORE_CATEGORIES;
  playStoreCategories = PLAY_STORE_CATEGORIES;
  filteredLanguages: Observable<Language[]>;
  androidDeveloperAccounts: DeveloperAccount[] = [];
  iosDeveloperAccounts: DeveloperAccount[] = [];

  @Input() updateAppStatus: ApiRequestStatus;
  @Input() reviewNotes: ReviewNotes[];
  @Input() contacts: Contact[];
  @Input() developerAccounts: DeveloperAccount[];
  @Output() save = new EventEmitter<App>();

  private _app: App;

  get app() {
    return this._app;
  }

  @Input()
  set app(app: App) {
    this._app = { ...app };
  }

  ngOnInit() {
    this.filteredLanguages = this.languageFormControl.valueChanges.pipe(
      startWith(''),
      map(val => val ? this.filterLanguages(val) : [ ...LANGUAGES ]),
    );
  }

  ngOnChanges(changes: SimpleChanges): void {
    if (changes.developerAccounts && changes.developerAccounts.currentValue) {
      const devAccounts = changes.developerAccounts.currentValue as DeveloperAccount[];
      this.androidDeveloperAccounts = devAccounts.filter(d => d.type === 'android');
      this.iosDeveloperAccounts = devAccounts.filter(d => d.type === 'ios');
    }
  }

  getLanguage(langCode: string) {
    const lang = LANGUAGES.find(l => l.code === langCode);
    return lang ? lang.name : null;
  }

  addLocale(event: MatChipInputEvent) {
    if (!this.app.other_languages.includes(event.value) && !this.isMainLanguage(event.value) && this.getLanguage(event.value)) {
      this.app.other_languages = [ ...this.app.other_languages as string[], event.value ];
    }
    this.languageFormControl.reset();
  }

  removeLanguage(langCode: string) {
    this.app.other_languages = (this.app.other_languages as string[]).filter(lang => lang !== langCode);
  }

  submit() {
    this.save.emit({ ...this.app });
  }

  private isMainLanguage(lang: string) {
    return this.app.main_language === lang;
  }

  private filterLanguages(val: string): Language[] {
    const re = new RegExp(val, 'gi');
    return LANGUAGES.filter(lang => !this.isMainLanguage(lang.code) && (re.test(lang.name) || re.test(lang.code)));
  }
}


text:
<!DOCTYPE html>

<title>Message_email_constructor</title>
<meta charset="utf-8"/>


text:
function Point (x, y) {

	if (typeof x !== "number" || typeof y !== "number") {
		throw new Error('Both x and y must be numbers');
	}

	this._x = x;
	this._y = y;
}

Point.prototype.x = function () {
	return this._x;
};

Point.prototype.y = function () {
	return this._y;
};

Point.prototype.distance = function (other) {
	var dx = other.x() - this.x();
	var dy = other.y() - this.y();
	return Math.sqrt(dx * dx + dy * dy);
};

Point.prototype.direction = function (other) {
	return Math.atan2(other.y() - this.y(), other.x() - this.x());
};

Point.prototype.equals = function (other) {
	return this.x() === other.x() && this.y() === other.y();
};

Point.prototype.translate = function (dx, dy) {
	return new Point(this.x() + dx, this.y() + dy);
};

Point.prototype.subtract = function (other) {
	return this.translate(-other.x(), -other.y());
};

module.exports = Point;


text:
docker-sync-backend makes local dir sync to backend (Amazon S3).
First, fetc data from backend on startup, and then sync local dir to backend regularly (task runs per 10 minutes).

## Required envaironment variables

- `$AWS_ACCESS_KEY_ID`
- `$AWS_SECRET_ACCESS_KEY`
- `$BUCKET_NAME`
 - S3 bucket name.
- `$VOLUME`
 - A directory path that is synchronized to Amazon S3. It is supporsed to use with data volume.


text:
NAME=akashic-storage

compile:
	sh internal/compile-jar.sh
clean:
	cd ..; sbt clean
install:
	sh internal/install.sh
uninstall:
	rm -rf /opt/$(NAME)
update:
	cp $(NAME).jar /opt/$(NAME)/jar


text:
namespace Incoding.MvcContrib
{
    #region << Using >>

    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq.Expressions;
    using System.Web.Mvc;
    using System.Web.WebPages;
    using Incoding.Extensions;

    #endregion

    public class TemplateDoTSyntax<TModel> : ITemplateSyntax<TModel>
    {
        #region Fields

        readonly HtmlHelper htmlHelper;

        string property;

        #endregion

        #region Constructors

        public TemplateDoTSyntax(HtmlHelper htmlHelper, string property)
        {
            this.htmlHelper = htmlHelper;
            this.property = property;

            htmlHelper.ViewContext.Writer.Write("{{~it:x}}");
        }

        #endregion

        #region ITemplateSyntax<TModel> Members

        public ITemplateSyntax<TModel> Up()
        {
            throw new NotImplementedException();
        }

        public string For(string field)
        {
            return "{{=x." + field + "}}";
        }

        public string For(Expression<Func<TModel, object>> field)
        {
            return For(field.GetMemberName());
        }

        public string For(Expression<Func<TModel, bool>> field)
        {
            return For(field.GetMemberName());
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, string isTrue, string isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, MvcHtmlString isTrue, MvcHtmlString isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, string isTrue, MvcHtmlString isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, MvcHtmlString isTrue, string isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, Func<object, HelperResult> isTrue, Func<object, HelperResult> isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, Func<object, HelperResult> isTrue, MvcHtmlString isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, MvcHtmlString isTrue, Func<object, HelperResult> isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, string isTrue, Func<object, HelperResult> isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString Inline(Expression<Func<TModel, object>> field, Func<object, HelperResult> isTrue, string isFalse)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString IsInline(Expression<Func<TModel, object>> field, string content)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString IsInline(Expression<Func<TModel, object>> field, MvcHtmlString content)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString IsInline(Expression<Func<TModel, object>> field, Func<object, HelperResult> content)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString NotInline(Expression<Func<TModel, object>> field, string content)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString NotInline(Expression<Func<TModel, object>> field, MvcHtmlString content)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString NotInline(Expression<Func<TModel, object>> field, Func<object, HelperResult> content)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString ForRaw(string field)
        {
            throw new NotImplementedException();
        }

        public MvcHtmlString ForRaw(Expression<Func<TModel, object>> field)
        {
            throw new NotImplementedException();
        }

        public ITemplateSyntax<TNewModel> ForEach<TNewModel>(Expression<Func<TModel, IEnumerable<TNewModel>>> field)
        {
            throw new NotImplementedException();
        }

        public IDisposable Is(Expression<Func<TModel, object>> field)
        {
            throw new NotImplementedException();
        }

        public IDisposable Not(Expression<Func<TModel, object>> field)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region Disposable

        public void Dispose()
        {
            htmlHelper.ViewContext.Writer.Write("{{~}}");
        }

        #endregion

        #region Enums

        public enum DoTType
        { }

        #endregion
    }
}


text:
package krasa.grepconsole.gui.table.column;

import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;

import krasa.grepconsole.gui.table.ModelUtils;
import krasa.grepconsole.model.GrepExpressionGroup;

import org.jetbrains.annotations.Nullable;

import com.intellij.util.ui.ColumnInfo;

/**
 * @author Vojtech Krasa
 */
public class GroupNameAdapter extends FolderColumnInfoWrapper {

	private ColumnInfo groupColumnInfo;

	public GroupNameAdapter(ColumnInfo columnInfo) {
		super(columnInfo);
		groupColumnInfo = new JavaBeanColumnInfo<GrepExpressionGroup, String>("name", "name");
	}

	@Override
	public boolean isCellEditable(Object o) {
		Object o1 = ModelUtils.unWrap(o);
		if (o1 instanceof GrepExpressionGroup) {
			return groupColumnInfo.isCellEditable(ModelUtils.unWrap(o));
		}
		return columnInfo.isCellEditable(ModelUtils.unWrap(o));
	}

	@Nullable
	@Override
	public TableCellRenderer getRenderer(Object o) {
		Object o1 = ModelUtils.unWrap(o);
		if (o1 instanceof GrepExpressionGroup) {
			return groupColumnInfo.getRenderer(o1);
		}
		return columnInfo.getRenderer(o1);
	}

	@Override
	public void setValue(Object o, Object value) {
		Object o1 = ModelUtils.unWrap(o);
		if (o1 instanceof GrepExpressionGroup) {
			groupColumnInfo.setValue(ModelUtils.unWrap(o), value);
		} else {
			columnInfo.setValue(ModelUtils.unWrap(o), value);
		}
	}

	@Nullable
	@Override
	public TableCellEditor getEditor(Object o) {
		Object o1 = ModelUtils.unWrap(o);
		if (o1 instanceof GrepExpressionGroup) {
			return groupColumnInfo.getEditor(o1);
		}
		return columnInfo.getEditor(o1);
	}

	@Nullable
	@Override
	public Object valueOf(Object o) {
		Object o1 = ModelUtils.unWrap(o);
		if (o1 instanceof GrepExpressionGroup) {
			return groupColumnInfo.valueOf(o1);
		}
		return columnInfo.valueOf(o1);
	}
}


text:
<?php
/**
 * @author: Albaraa Mishlawi
 * @package: albaraam/php-gcm
 */

namespace albaraam\gcm;

class GCMResponse
{

	/**
	 * Unique ID (number) identifying the multicast message.
	 *
	 * @var integer
	 */
	private $multicastId = null;

	/**
	 * Number of messages that were processed without an error.
	 *
	 * @var integer
	 */
	private $success = null;

	/**
	 * Number of messages that could not be processed.
	 *
	 * @var integer
	 */
	private $failure = null;

	/**
	 * Number of results that contain a canonical registration ID.
	 *
	 * @var integer
	 */
	private $canonicalIds = null;

	/**
	 * Array of objects representing the status of the messages processed.
	 * The objects are listed in the same order as the request
	 * (i.e., for each registration ID in the request, its result is listed in the same index in the response)
	 * and they can have these fields:
	 *      message_id:         String representing the message when it was successfully processed.
	 *      registration_id:    If set, means that GCM processed the message but it has another canonical registration ID for that device, so sender should replace the IDs on future requests
	 *                          (otherwise they might be rejected). This field is never set if there is an error in the request.
	 *      error:              String describing an error that occurred while processing the message for that recipient. The possible values are the same as documented in the above table, plus "Unavailable"
	 *                          (meaning GCM servers were busy and could not process the message for that particular recipient, so it could be retried).
	 *
	 * @var array
	 */
	private $results = [];

	public function __construct(GCMMessage $message, $body)
	{
		$data = $this->json_clean_decode($body);

		$this->multicastId = $data->multicast_id;
		$this->failure = $data->failure;
		$this->success = $data->success;
		$this->canonicalIds = $data->canonical_ids;

		foreach ($message->getTo() as $key => $to)
		{
			$this->results[$to] = $data->results[$key];
		}
	}

	public function getMulticastId()
	{
		return $this->multicastId;
	}

	public function getSuccessCount()
	{
		return $this->success;
	}

	public function getFailureCount()
	{
		return $this->failure;
	}

	public function getNewRegistrationIdsCount()
	{
		return $this->canonicalIds;
	}

	public function getResults()
	{
		return $this->results;
	}

	public function json_clean_decode($json, $assoc = false, $depth = 512, $options = 0) {
	    // search and remove comments like /* */ and //
	    $json = preg_replace("#(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|([\s\t]//.*)|(^//.*)#", '', $json);

	    if(version_compare(phpversion(), '5.4.0', '>=')) {
	        $json = json_decode($json, $assoc, $depth, $options);
	    }
	    elseif(version_compare(phpversion(), '5.3.0', '>=')) {
	        $json = json_decode($json, $assoc, $depth);
	    }
	    else {
	        $json = json_decode($json, $assoc);
	    }

	    return $json;
	}

}


text: challanges for fun ...


text:
package main

type BaseResponse struct {
	CreateRepositoryURL string `json:"create_repo_url"`
	UserRepositoriesURL string `json:"user_repositories_url"`
	UserRepositoryURL   string `json:"user_repository_url"`
	BranchesURL         string `json:"branches_url"`
}

type CreateResponse struct {
	ResponseMessage string `json:"response_message"`
	CloneURL        string `json:"clone_url"`
}


text:
<?php
/**
 * MailServiceProvider - Implements a Service Provider for Mailer.
 *
 * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com
 * @version 3.0
 */

namespace Mail;

use Mail\Mailer;
use Support\ServiceProvider;

use Swift_Mailer;
use Swift_SmtpTransport as SmtpTransport;
use Swift_MailTransport as MailTransport;
use Swift_SendmailTransport as SendmailTransport;

class MailServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the Provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Register the Service Provider.
     *
     * @return void
     */
    public function register()
    {
        $me = $this;

        $this->app->bindShared('mailer', function($app) use ($me)
        {
            $me->registerSwiftMailer();

            $mailer = new Mailer($app['view'], $app['swift.mailer'], $app['events']);

            $from = $app['config']['mail.from'];

            if (is_array($from) && isset($from['address'])) {
                $mailer->alwaysFrom($from['address'], $from['name']);
            }

            return $mailer;
        });
    }

    /**
     * Register the Swift Mailer instance.
     *
     * @return void
     */
    public function registerSwiftMailer()
    {
        $config = $this->app['config']['mail'];

        $this->registerSwiftTransport($config);

        $this->app['swift.mailer'] = new Swift_Mailer($this->app['swift.transport']);
    }

    /**
     * Register the Swift Transport instance.
     *
     * @param  array  $config
     * @return void
     *
     * @throws \InvalidArgumentException
     */
    protected function registerSwiftTransport($config)
    {
        switch ($config['driver']) {
            case 'smtp':
                return $this->registerSmtpTransport($config);

            case 'sendmail':
                return $this->registerSendmailTransport($config);

            case 'mail':
                return $this->registerMailTransport($config);

            default:
                throw new \InvalidArgumentException('Invalid mail driver.');
        }
    }

    /**
     * Register the SMTP Swift Transport instance.
     *
     * @param  array  $config
     * @return void
     */
    protected function registerSmtpTransport($config)
    {
        $this->app['swift.transport'] = $this->app->share(function($app) use ($config)
        {
            extract($config);

            $transport = SmtpTransport::newInstance($host, $port);

            if (isset($encryption)) {
                $transport->setEncryption($encryption);
            }

            if (isset($username)) {
                $transport->setUsername($username);

                $transport->setPassword($password);
            }

            return $transport;
        });
    }

    /**
     * Register the Sendmail Swift Transport instance.
     *
     * @param  array  $config
     * @return void
     */
    protected function registerSendmailTransport($config)
    {
        $this->app['swift.transport'] = $this->app->share(function($app) use ($config)
        {
            return SendmailTransport::newInstance($config['sendmail']);
        });
    }

    /**
     * Register the Mail Swift Transport instance.
     *
     * @param  array  $config
     * @return void
     */
    protected function registerMailTransport($config)
    {
        $this->app['swift.transport'] = $this->app->share(function()
        {
            return MailTransport::newInstance();
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return array('mailer');
    }

}


text:
"""Unit tests for breakpad.py."""

import os
import sys

sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from testing_support.super_mox import SuperMoxTestBase

import breakpad

class Breakpad(SuperMoxTestBase):
  """Setups and tear downs the mocks but doesn't test anything as-is."""
  def setUp(self):
    super(Breakpad, self).setUp()
    self.mox.StubOutWithMock(breakpad.atexit, 'register')
    self.mox.StubOutWithMock(breakpad.getpass, 'getuser')
    self.mox.StubOutWithMock(breakpad.urllib2, 'urlopen')
    breakpad._HOST_NAME = 'bozo'
    self.assertEquals(False, breakpad.IS_ENABLED)
    breakpad.IS_ENABLED = True
    self._old_sys_argv = breakpad.sys.argv
    breakpad.sys.argv = ['my_test']
    self._old_sys_version = breakpad.sys.version
    breakpad.sys.version = 'random python'

  def tearDown(self):
    breakpad.IS_ENABLED = False
    breakpad.sys.version = self._old_sys_version
    breakpad.sys.argv = self._old_sys_argv
    super(Breakpad, self).tearDown()

  def testMembersChanged(self):
    members = [
        'CheckForException', 'DEFAULT_URL', 'FormatException', 'IS_ENABLED',
        'Register', 'SendProfiling', 'SendStack',
        'atexit', 'getpass', 'os', 'post', 'socket', 'sys', 'time', 'traceback',
        'urllib', 'urllib2',
    ]
    # If this test fails, you should add the relevant test.
    self.compareMembers(breakpad, members)

  def _part_1_setup_mocks(self, exception):
    breakpad.os.getcwd().AndReturn('/tmp/asdf')
    breakpad.getpass.getuser().AndReturn('georges')
    obj = self.mox.CreateMockAnything()
    kwargs = {}
    if (breakpad.sys.version_info[0] * 10 + breakpad.sys.version_info[1]) >= 26:
      kwargs['timeout'] = 4
    breakpad.urllib2.urlopen(
        'https://chromium-status.appspot.com/breakpad',
        breakpad.urllib.urlencode([('exception', exception)]) + (
         '&args=%5B%27my_test%27%5D'
         '&stack=bar'
         '&host=bozo'
         '&version=random+python'
         '&user=georges'
         '&cwd=%2Ftmp%2Fasdf'),
        **kwargs).AndReturn(obj)
    obj.read().AndReturn('ok')
    obj.close()

  def _part_2_verify_stdout(self, exception):
    self.checkstdout(
        ( "Sending crash report ...\n"
          "  args: ['my_test']\n"
          "  cwd: /tmp/asdf\n"
          "  exception: %s\n"
          "  host: bozo\n"
          "  stack: bar\n"
          "  user: georges\n"
          "  version: random python\n"
          "ok\n") % exception)

  def _check(self, obj, result):
    self._part_1_setup_mocks(result)
    self.mox.ReplayAll()
    breakpad.SendStack(obj, 'bar')
    self._part_2_verify_stdout(result)

  def testSendBase(self):
    self._check('foo', 'foo')

  def testSendReprThrows(self):
    class Throws(object):
      def __repr__(self):
        raise NotImplementedError()
      def __str__(self):
        return '[foo]'
    self._check(Throws(), '[foo]')

  def testSendStrThrows(self):
    class Throws(object):
      def __repr__(self):
        return '[foo]'
      def __str__(self):
        raise NotImplementedError()
    self._check(Throws(), '[foo]')

  def testSendBoth(self):
    class Both(object):
      def __repr__(self):
        return '[foo]'
      def __str__(self):
        return '[bar]'
    self._check(Both(), '[bar]')

  def testSendException(self):
    obj = Exception('foo')
    obj.msg = 'a message'
    self._check(obj, 'foo\nMsg: a message')

if __name__ == '__main__':
  import unittest
  unittest.main()


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="6f90a59b-f5de-4a84-a8c3-70c464ba6633" name="Default" comment="" />
    <ignored path="$PROJECT_DIR$/.tmp/" />
    <ignored path="$PROJECT_DIR$/temp/" />
    <ignored path="$PROJECT_DIR$/tmp/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300" />
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="JavaScript File" />
        <option value="CSS File" />
      </list>
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/src/main.js" />
        <option value="$PROJECT_DIR$/src/renderer.js" />
        <option value="$PROJECT_DIR$/src/index.html" />
        <option value="$PROJECT_DIR$/src/common.css" />
        <option value="$PROJECT_DIR$/../../../support_tools/QueryRedirector/src/index.html" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER">
    <package-json value="$PROJECT_DIR$/package.json" />
  </component>
  <component name="JsFlowSettings">
    <service-enabled>true</service-enabled>
    <exe-path />
    <other-services-enabled>true</other-services-enabled>
    <auto-save>true</auto-save>
  </component>
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="NodeModulesDirectoryManager">
    <handled-path value="$PROJECT_DIR$/node_modules" />
  </component>
  <component name="NodePackageJsonFileManager">
    <packageJsonPaths>
      <path value="$PROJECT_DIR$/package.json" />
    </packageJsonPaths>
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="x" value="261" />
    <option name="y" value="60" />
    <option name="width" value="1388" />
    <option name="height" value="1020" />
  </component>
  <component name="ProjectView">
    <navigator currentView="Scope" currentSubView="Project Files" proportions="" version="1">
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="e-app" type="b2602c69:ProjectViewProjectNode" />
              <item name="e-app" type="462c0819:PsiDirectoryNode" />
            </path>
            <path>
              <item name="e-app" type="b2602c69:ProjectViewProjectNode" />
              <item name="e-app" type="462c0819:PsiDirectoryNode" />
              <item name="src" type="462c0819:PsiDirectoryNode" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
      <pane id="Scope">
        <subPane subId="Project Files">
          <expand>
            <path>
              <item name="Root" type="cbb8eebc:String" user="Root" />
              <item name="e-app" type="cbb8eebc:String" user="e-app" />
            </path>
            <path>
              <item name="Root" type="cbb8eebc:String" user="Root" />
              <item name="e-app" type="cbb8eebc:String" user="e-app" />
              <item name="src" type="cbb8eebc:String" user="src" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="HbShouldOpenHtmlAsHb" value="" />
    <property name="JavaScriptWeakerCompletionTypeGuess" value="true" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="list.type.of.created.stylesheet" value="CSS" />
    <property name="node.js.detected.package.prettier" value="true" />
    <property name="node.js.path.for.package.prettier" value="project" />
    <property name="node.js.selected.package.prettier" value="" />
    <property name="nodejs_interpreter_path.stuck_in_default_project" value="$USER_HOME$/.nvm/versions/node/v6.11.1/bin/node" />
    <property name="run.code.analysis.last.selected.profile" value="pProject Default" />
    <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="RunManager">
    <configuration name="Unnamed" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="$PROJECT_DIR$/node_modules/.bin/electron" node-parameters="." working-dir="$PROJECT_DIR$" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="6f90a59b-f5de-4a84-a8c3-70c464ba6633" name="Default" comment="" />
      <created>1515266497080</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1515266497080</updated>
      <workItem from="1515266498447" duration="10365000" />
      <workItem from="1515443425533" duration="1823000" />
      <workItem from="1515589870334" duration="2203000" />
      <workItem from="1515612134114" duration="1797000" />
      <workItem from="1523873111631" duration="1017000" />
      <workItem from="1529859262735" duration="1608000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="18813000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="25" width="1920" height="1055" extended-state="6" />
    <layout>
      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
      <window_info anchor="bottom" id="TODO" order="6" />
      <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
      <window_info id="npm" order="2" side_tool="true" />
      <window_info anchor="bottom" id="Run" order="2" weight="0.3290735" />
      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
      <window_info anchor="bottom" id="Terminal" order="7" weight="0.3290735" />
      <window_info id="Favorites" order="2" side_tool="true" />
      <window_info anchor="bottom" id="Debug" order="3" weight="0.399361" />
      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
      <window_info anchor="right" id="Commander" order="0" weight="0.4" />
      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
      <window_info anchor="bottom" id="Inspection Results" order="7" weight="0.3290735" />
      <window_info anchor="bottom" id="Find" order="1" />
      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
      <window_info anchor="bottom" id="Message" order="0" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="5" />
    </breakpoint-manager>
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/src/index.html">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="612">
          <caret line="34" selection-start-line="34" selection-end-line="34" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/index.html">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="612">
          <caret line="34" lean-forward="true" selection-start-line="34" selection-end-line="34" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/renderer.js">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/src/common.css">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="170">
          <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/renderer.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="425">
          <caret line="25" selection-start-line="25" selection-end-line="25" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/../../../support_tools/QueryRedirector/src/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="326">
          <caret line="24" column="37" selection-start-line="24" selection-start-column="37" selection-end-line="24" selection-end-column="37" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/index.html">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/src/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="758">
          <caret line="55" selection-start-line="55" selection-end-line="55" />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
package test.retention;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import test.util.DirUtils;
import junit.framework.TestCase;
import krati.io.Serializer;
import krati.retention.EventBatchSerializer;
import krati.retention.Retention;
import krati.retention.SimpleEventBatchSerializer;
import krati.retention.clock.Clock;
import krati.retention.clock.ClockSerializer;
import krati.retention.clock.SourceWaterMarksClock;
import krati.retention.policy.RetentionPolicy;
import krati.retention.policy.RetentionPolicyOnSize;
import krati.store.DataStore;
import krati.util.SourceWaterMarks;

/**
 * AbstractTestRetentionStore
 *
 * @author jwu
 * @since 10/17, 2011
 */
public abstract class AbstractTestRetentionStore<K, V> extends TestCase {
    protected List<String> _sources;
    protected DataStore<K, V> _store;
    protected Retention<K> _retention;
    protected SourceWaterMarksClock _clock;
    protected Random _rand = new Random();

    protected final static String source1 = "source1";
    protected final static String source2 = "source2";
    protected final static String source3 = "source3";

    protected File getHomeDir() {
        return DirUtils.getTestDir(getClass());
    }

    protected int getId() {
        return 2;
    }

    protected int getEventBatchSize() {
        return 1000;
    }

    protected int getNumRetentionBatches() {
        return 5;
    }

    protected RetentionPolicy createRetentionPolicy() {
        return new RetentionPolicyOnSize(getNumRetentionBatches());
    }

    protected EventBatchSerializer<K> createBatchSerializer() {
        return new SimpleEventBatchSerializer<K>(createEventValueSerializer(), createEventClockSerializer());
    }

    protected Serializer<Clock> createEventClockSerializer() {
        return new ClockSerializer();
    }

    protected abstract Serializer<K> createEventValueSerializer();

    protected abstract Retention<K> createRetention() throws Exception;

    protected abstract DataStore<K, V> createStore() throws Exception;

    protected abstract K nextKey();

    protected abstract V nextValue();

    protected abstract boolean checkKeyEquality(K key1, K key2);

    protected abstract boolean checkValueEquality(V value1, V value2);

    @Override
    protected void setUp() {
        try {
            DirUtils.deleteDirectory(getHomeDir());
            _sources = new ArrayList<String>();
            _sources.add(source1);
            _sources.add(source2);
            _sources.add(source3);

            File sourceWaterMarksFile = new File(getHomeDir(), "sourceWaterMarks.scn");
            SourceWaterMarks sourceWaterMarks = new SourceWaterMarks(sourceWaterMarksFile);
            _clock = new SourceWaterMarksClock(_sources, sourceWaterMarks);
            _retention = createRetention();
            _store = createStore();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    protected void tearDown() {
        try {
            _store.close();
            _retention.close();
            DirUtils.deleteDirectory(getHomeDir());
        } catch(Exception e) {
            e.printStackTrace();
        } finally {
            _retention = null;
        }
    }
}


text:
'use strict';

var lib = process.env['LIB'] || 'lib';

var dal = require('../lib/dal.js'),
  events = require('../lib/events.js'),
  exec = require('child_process').exec,
  request = require('request'),
  assert = require('assert'),
  path = require('path'),
  fs = require('fs');

// var BASE_URL = 'http://127.0.0.1',
var BASE_URL = 'http://localhost',
  port = randomInt(2000, 10000);

/**
 * Get an integer between min and max.
 * @param   {Number} min
 * @param   {Number} max
 * @returns {Number}
 */
function randomInt(min, max) {
  return Math.floor(min + Math.random() * (max - min + 1));
}

/**
 * Get the port our test server is running on.
 * @return {Number}
 */
exports.getServerPort = function() {
  return port;
};

exports.loadTestsOfType = function(type) {
  var p = path.join(__dirname, './', type);
  var files = fs.readdirSync(p);

  files.forEach(function(file) {
    if (path.extname(file) === '.js') {
      require(path.join(__dirname, './', type, file));
    }
  });
};

exports.clearDatabase = function(callback) {
  // TODO: should connect to mongo directly
  dal.removeAllCollections(callback);
};

/**
 * Start a server by requiring application.js
 * @param {Function} callback
 */
exports.startServer = function(clearDB, callback) {
  console.log('Starting test server on port, please wait %s', port);
  process.env.FH_USE_LOCAL_DB = true;

  function start(callback) {

    events.on(events.emittedEvents.fhReady, function() {
      return callback();
    });
    require('../application.js');
  }

  if (clearDB) {
    exports.clearDatabase(function() {
      start(callback);
    })
  } else {
    start(callback);
  }
};

// TODO: should be called cloud POST
exports.cloudCall = function(path, data, cb) {
  var url = [BASE_URL, ':', process.env.FH_PORT, path].join('');

  console.log('Posting to %s', url);
  data = data || null;

  request.post({
    url: url,
    form: data,
  }, function(err, response, data) {
    if (err) {
      console.error('cloudCall error: %s', err);
      return cb(err, null);
    }
    cb(null, JSON.parse(data));
  })
};


text:
import java.io.File;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

/**
   Tests a database installation by creating and querying
   a sample table. Call this program as
   java -classpath driver_class_path;. TestDB propertiesFile
*/
public class TestDB
{
   public static void main(String[] args) throws Exception
   {
      if (args.length == 0)
      {
         System.out.println(
               "Usage: java -classpath driver_class_path"
               + File.pathSeparator
               + ". TestDB propertiesFile");
         return;
      }

      SimpleDataSource.init(args[0]);

      try (Connection conn = SimpleDataSource.getConnection())
      {
         Statement stat = conn.createStatement();

         stat.execute("CREATE TABLE Test (Name VARCHAR(20))");
         stat.execute("INSERT INTO Test VALUES ('Romeo')");

         ResultSet result = stat.executeQuery("SELECT * FROM Test");
         result.next();
         System.out.println(result.getString("Name"));

         stat.execute("DROP TABLE Test");
      }
   }
}


text:
"""
Example intercepting uncaught exceptions using Sanic's error handler framework.
This may be useful for developers wishing to use Sentry, Airbrake, etc.
or a custom system to log and monitor unexpected errors in production.
First we create our own class inheriting from Handler in sanic.exceptions,
and pass in an instance of it when we create our Sanic instance. Inside this
class' default handler, we can do anything including sending exceptions to
an external service.
"""
from sanic.handlers import ErrorHandler
from sanic.exceptions import SanicException
"""
Imports and code relevant for our CustomHandler class
(Ordinarily this would be in a separate file)
"""

class CustomHandler(ErrorHandler):

    def default(self, request, exception):
        # Here, we have access to the exception object
        # and can do anything with it (log, send to external service, etc)

        # Some exceptions are trivial and built into Sanic (404s, etc)
        if not isinstance(exception, SanicException):
            print(exception)

        # Then, we must finish handling the exception by returning
        # our response to the client
        # For this we can just call the super class' default handler
        return super().default(request, exception)

"""
This is an ordinary Sanic server, with the exception that we set the
server's error_handler to an instance of our CustomHandler
"""

from sanic import Sanic

app = Sanic(__name__)

handler = CustomHandler()
app.error_handler = handler

@app.route("/")
async def test(request):
    # Here, something occurs which causes an unexpected exception
    # This exception will flow to our custom handler.
    raise SanicException('You Broke It!')

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=8000, debug=True)


text:
package com.dottydingo.service.pipeline;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 */
public class PhaseExecutorRegistry<C>
{
    private Map<String,PhaseExecutor<C>> phaseExecutorMap = new ConcurrentHashMap<String, PhaseExecutor<C>>();

    public void registerPhaseExecutor(String name, PhaseExecutor<C> phaseExecutor)
    {
        if(phaseExecutorMap.put(name,phaseExecutor) != null)
            throw new RuntimeException(
                    String.format("Duplicate phaseExecutor registered under name %s",name));
    }

    public PhaseExecutor<C> getPhaseExecutor(String name)
    {
        PhaseExecutor<C> router = phaseExecutorMap.get(name);
        if(router == null)
            throw new RuntimeException(
                    String.format("No phaseExecutor registered under name %s",name));

        return router;
    }

    public void setPhaseExecutorMap(Map<String, PhaseExecutor<C>> phaseExecutorMap)
    {
        this.phaseExecutorMap.putAll(phaseExecutorMap);
    }
}


text:
package speeral;

public final class ServerPrxHolder
{
    public
    ServerPrxHolder()
    {
    }

    public
    ServerPrxHolder(ServerPrx value)
    {
        this.value = value;
    }

    public ServerPrx value;
}


text:
namespace tracked_objects {
class Location;
}  // namespace tracked_objects

namespace syncer {

class SyncChange;

typedef std::vector<SyncChange> SyncChangeList;

// An interface for services that handle receiving SyncChanges.
class SYNC_EXPORT SyncChangeProcessor {
 public:
  SyncChangeProcessor();
  virtual ~SyncChangeProcessor();

  // Process a list of SyncChanges.
  // Returns: A default SyncError (IsSet() == false) if no errors were
  //          encountered, and a filled SyncError (IsSet() == true)
  //          otherwise.
  // Inputs:
  //   |from_here|: allows tracking of where sync changes originate.
  //   |change_list|: is the list of sync changes in need of processing.
  virtual SyncError ProcessSyncChanges(
      const tracked_objects::Location& from_here,
      const SyncChangeList& change_list) = 0;
};

}  // namespace syncer

#endif  // SYNC_API_SYNC_CHANGE_PROCESSOR_H_


text:
cargo-install-update(1) -- Cargo subcommand for checking and applying updates to installed executables
======================================================================================================

## SYNOPSIS

`cargo install-update` [OPTIONS] [PACKAGE...]

## DESCRIPTION

Cargo subcommand for checking and applying updates to installed executables.

This was mostly built out of a frustration with periodically checking for
updates for my cargo-installed executables, which was long and boring.

Updates packages from the main repository and git repositories.

See cargo-install-update-config(1) for further configuring updates.

The `CARGO_INSTALL_OPTS` environment variable can be set,
containing options to forward to the end of `cargo install` invocations'
argument lists.
Note, that cargo-install-update-config(1) is preferred in the general case.

If `cargo-binstall` (>=0.13.1) is available in the `PATH`,
`-r` was not overriden, `CARGO_INSTALL_OPTS` is empty,
the package is in the default registry, and has no non-default configuration,
it will be used to install the package instead.

Exit values and possible errors:

    -1 - cargo subprocess was terminated by a signal (Linux-only)
    1  - option parsing error
    2  - registry repository error
    X  - bubbled-up cargo install exit value

## OPTIONS

  -a --all

    Update all currently installed executables.

    Required if list of packages not given.

  [PACKAGE...]

    List of packages to update in the [(registry_url):]package_name[:version] format.

    Registry defaults to the default crates.io registry,
    and can be a name from ~/.cargo/config.

    If specified in addition to --all,
    will add the specified packages to the update list
    (useful, e.g., in conjunction with --allow-no-update).

    Required if --all not given.

  -l --list

    Don't update any packages, just list them.

    If PACKAGE is empty, act as if --all was specified.

  -f --force

    Update all packages, regardless of whether they need to be version-wise.

  -d --downdate

    Downdate packages to match the latest unyanked version from the registry.

  -i --allow-no-update

    Allow to fresh install packages passed as PACKAGE argument.

    This is useful, for example, in pairing with cargo-install-update-config(1).

    Off by default.

  -g --git

    Also update git-originating packages.

    Off by default, because it's expensive.

  -q --quiet

    Don't print status messages to stdout
    and pass down --quiet to cargo subprocesses.

  -s --filter <PACKAGE_FILTER>...

    Only consider packages matching all filters.

    PACKAGE_FILTER is in the form "key=value", where key is any of:
      - "toolchain": the package must be configured to be compiled with
                     the specified toolchain via cargo-install-update-config(1).

  -r --install-cargo <CARGO_EXECUTABLE>

    Cargo executable to run for installations.

    *Must* behave indistinguishably from the default cargo
    with regards to on-disk state ("$CARGO_DIR/.crates.toml"
    and installed executables) and the arguments it accepts.

    Required. Default: "cargo"

  -c --cargo-dir <CARGO_DIR>
     --root      <CARGO_DIR>

    Set the directory containing cargo metadata.

    Equivalent to, and forwarded as, cargo install --root.

    Required. Default: "$CARGO_INSTALL_ROOT", then "$CARGO_HOME",
    then "$HOME/.cargo", otherwise manual.

  -t --temp-dir <TEMP_DIR>

    Set the directory in which to clone git repositories.

    Adjoined with "cargo-update" as last segment.

    Required. Default: system temp, otherwise manual.

## ENVIRONMENT VARIABLES

  `$CARGO_NET_GIT_FETCH_WITH_CLI`

    Overrides the net.git-fetch-with-cli Cargo configuration key.

  `$GIT`

    Overrides the git executable in net.git-fetch-with-cli=true mode.

## EXAMPLES

  `cargo install-update -a`

    Update all installed packages.

    Example output:
          Updating registry `https://github.com/rust-lang/crates.io-index`

      Package         Installed  Latest   Needs update
      checksums       v0.5.0     v0.5.2   Yes
      treesize        v0.2.0     v0.2.1   Yes
      cargo-count     v0.2.2     v0.2.2   No
      cargo-graph     v0.3.0     v0.3.0   No
      cargo-outdated  v0.2.0     v0.2.0   No
      identicon       v0.1.1     v0.1.1   No
      racer           v1.2.10    v1.2.10  No
      rustfmt         v0.6.2     v0.6.2   No

      Updating checksums
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading checksums v0.5.2
         [...]
         Compiling checksums v0.5.2
          Finished release [optimized] target(s) in 95.2 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\checksums.exe

      Updating treesize
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading treesize v0.2.1
         [...]
         Compiling treesize v0.2.1
          Finished release [optimized] target(s) in 76.77 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\treesize.exe

      Updated 2 packages.

  `cargo install-update racer treesize cargo-cln`

    Only consider racer, treesize and cargo-cln for updates.
    Since cargo-cln is not installed, it'll be ignored.

     Example output:
          Updating registry `https://github.com/rust-lang/crates.io-index`

      Package   Installed  Latest   Needs update
      racer     v1.2.10    v1.2.10  No
      treesize  v0.2.0     v0.2.1   Yes

      Updating treesize
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading treesize v0.2.1
         [...]
         Compiling treesize v0.2.1
          Finished release [optimized] target(s) in 76.77 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\treesize.exe

      Updated 1 package.

  `cargo install-update -al`

    List all installed packages, don't update any.

    Example output:
          Updating registry `https://github.com/rust-lang/crates.io-index`

      Package         Installed  Latest   Needs update
      checksums       v0.5.0     v0.5.2   Yes
      treesize        v0.2.0     v0.2.1   Yes
      cargo-count     v0.2.2     v0.2.2   No
      cargo-graph     v0.3.0     v0.3.0   No
      cargo-outdated  v0.2.0     v0.2.0   No
      identicon       v0.1.1     v0.1.1   No
      racer           v1.2.10    v1.2.10  No
      rustfmt         v0.6.2     v0.6.2   No

  `cargo install-update -af`

    Update all installed packages.

    Example output:
          Updating registry `https://github.com/rust-lang/crates.io-index`

      Package       Installed  Latest   Needs update
      treesize      v0.2.0     v0.2.1   Yes
      clippy        v0.0.1     v0.0.99  Yes
      clippy_lints  v0.0.1     v0.0.99  Yes
      racer         v1.2.10    v1.2.10  No

      Updating racer
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading racer v1.2.10
         [...]
         Compiling racer v1.2.10
          Finished release [optimized] target(s) in 51.43 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\racer.exe

      Updating clippy
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading clippy v0.0.99
         [...]
         Compiling clippy v0.0.99
         [...]
      error: failed to compile `clippy v0.0.99`, intermediate artifacts can be found at `T:\-_-TEM~1\cargo-install.WOcMlrKQ5Sok`

      Updating treesize
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading treesize v0.2.1
         [...]
         Compiling treesize v0.2.1
          Finished release [optimized] target(s) in 76.77 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\treesize.exe

      Updating clippy_lints
          Updating registry `https://github.com/rust-lang/crates.io-index`
      error: specified package has no binaries

      Updated 2 packages.
      Failed to update clippy, clippy_lints.

  `cargo install-update -i checksums rustfmt treesize`

    Install specified packages, their installation status notwithstanding

    Example output:
          Updating registry `https://github.com/rust-lang/crates.io-index`

      Package    Installed  Latest   Needs update
      checksums             v0.5.2   Yes
      treesize   v0.2.0     v0.2.1   Yes
      rustfmt    v0.6.2     v0.6.2   No

      Installing checksums
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading checksums v0.5.2
         [...]
         Compiling checksums v0.5.2
          Finished release [optimized] target(s) in 95.2 secs
         Installing D:\Users\nabijaczleweli\.cargo\bin\checksums.exe

      Updating treesize
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading treesize v0.2.1
         [...]
         Compiling treesize v0.2.1
          Finished release [optimized] target(s) in 76.77 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\treesize.exe

      Updated 2 packages.

  `cargo install-update -i (file:///usr/local/share/cargo):zram-generator:0.1.1`

    Install zram-generator from a local repository in /usr/local/share/cargo
    (but a remote one or a short name  will work just as well), at most version 0.1.1.

     Example output:
          Updating registry `file:///usr/local/share/cargo`

      Package         Installed  Latest   Needs update
      zram-generator             v0.1.1   Yes

      Installing zram-generator
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading zram-generator v0.1.1
         [...]
         Compiling zram-generator v0.1.1
          Finished release [optimized] target(s) in 21.62 secs
        Installing /home/nabijaczleweli/.cargo/bin/zram-generator
         Installed package `zram-generator v0.1.1` (executable `zram-generator`)

      Updated 1 package.

  `cargo install-update -ag`

    Update all installed packages, including ones from git.

    Example output:
          Updating registry `https://github.com/rust-lang/crates.io-index`

      Package         Installed  Latest   Needs update
      checksums       v0.5.0     v0.5.2   Yes
      cargo-count     v0.2.2     v0.2.2   No

      Updating checksums
          Updating registry `https://github.com/rust-lang/crates.io-index`
         Downloading checksums v0.5.2
         [...]
         Compiling checksums v0.5.2
          Finished release [optimized] target(s) in 95.2 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\checksums.exe

      Updated 1 package.

      Package                Installed  Latest   Needs update
      alacritty              eb231b3    5f78857  Yes
      chattium-oxide-client  108a7b9    108a7b9  No

      Updating alacritty from https://github.com/jwilm/alacritty
          Updating git repository `https://github.com/jwilm/alacritty`
         Installing alacritty v0.1.0 (https://github.com/jwilm/alacritty#5f788574)
         [...]
         Compiling alacritty v0.1.0
          Finished release [optimized] target(s) in 127.6 secs
         Replacing D:\Users\nabijaczleweli\.cargo\bin\alacritty.exe

      Updated 1 package.

## AUTHOR

Written by наб <<nabijaczleweli@nabijaczleweli.xyz>>,
           Yann Simon <<yann.simon.fr@gmail.com>>,
           ven <<vendethiel@hotmail.fr>>,
           Cat Plus Plus <<piotrlegnica@piotrl.pl>>,
           Liigo <<liigo@qq.com>>,
           azyobuzin <<azyobuzin@users.sourceforge.jp>>,
           Tatsuyuki Ishi <<ishitatsuyuki@gmail.com>>,
           Tom Prince <<tom.prince@twistedmatrix.com>>,
           Mateusz Mikuła <<mati865@gmail.com>>,
           sinkuu <<sinkuupump@gmail.com>>,
           Alex Burka <<aburka@seas.upenn.edu>>,
           Matthias Krüger <<matthias.krueger@famsik.de>>,
           Daniel Holbert <<dholbert@cs.stanford.edu>>,
           Jonas Bushart <<jonas@bushart.org>>,
           Harrison Metzger <<harrisonmetz@gmail.com>>,
           Benjamin Bannier <<bbannier@gmail.com>>,
           Dimitris Apostolou <<dimitris.apostolou@icloud.com>>,
           Corbin Uselton <<corbinu@decimal.io>>,
           QuarticCat <<QuarticCat@protonmail.com>>,
           Artur Sinila <<freesoftware@logarithmus.dev>>,
           qthree <<qthree3@gmail.com>>,
           Marcin Puc <<tranzystorek.io@protonmail.com>>,
           Paul Barker <<paul@pbarker.dev>>,
           Benoît CORTIER <<benoit.cortier@fried-world.eu>>,
           Biswapriyo Nath <<nathbappai@gmail.com>>,
       and Shiraz <<smcclennon@protonmail.com>>

## SPECIAL THANKS

To all who support further development, in particular:

  * ThePhD
  * Embark Studios

## REPORTING BUGS

<<https://github.com/nabijaczleweli/cargo-update/issues>>

## SEE ALSO

<<https://github.com/nabijaczleweli/cargo-update>>

<<https://github.com/ryankurte/cargo-binstall>>


text:
layout: post
title: webpack
description: 打包
categories: javascript
---

webpack is a client-side module builder and module loader. This blog post shows you how to write ECMAScript 6 code with it.


text:
namespace Envoy {
namespace Extensions {
namespace Retry {
namespace Host {

REGISTER_FACTORY(PreviousHostsRetryPredicateFactory, Upstream::RetryHostPredicateFactory);

}
} // namespace Retry
} // namespace Extensions
} // namespace Envoy