text:
-- phpMyAdmin SQL Dump
-- version 3.5.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 02, 2013 at 10:56 AM
-- Server version: 5.1.68-cll
-- PHP Version: 5.2.17

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `todocont_conte`
--

-- --------------------------------------------------------

--
-- Table structure for table `articulos`
--

DROP TABLE IF EXISTS `articulos`;
CREATE TABLE IF NOT EXISTS `articulos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Titulo` varchar(100) NOT NULL DEFAULT '',
  `IdClase` int(11) NOT NULL DEFAULT '0',
  `Contenido` text NOT NULL,
  `Resumen` text NOT NULL,
  `Copete` text NOT NULL,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `Orden` tinyint(4) NOT NULL DEFAULT '0',
  `Visitas` int(11) NOT NULL DEFAULT '0',
  `Votos1` int(11) NOT NULL DEFAULT '0',
  `Votos2` int(11) NOT NULL DEFAULT '0',
  `Votos3` int(11) NOT NULL DEFAULT '0',
  `Votos4` int(11) NOT NULL DEFAULT '0',
  `Votos5` int(11) NOT NULL DEFAULT '0',
  `Imagen` varchar(200) NOT NULL DEFAULT '',
  `TextoImagen` text NOT NULL,
  `IdEstado` tinyint(4) NOT NULL DEFAULT '0',
  `FechaHoraAlta` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `FechaHoraModificacion` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Enlace` varchar(200) NOT NULL DEFAULT '',
  `VigenciaDesde` date NOT NULL DEFAULT '0000-00-00',
  `VigenciaHasta` date NOT NULL DEFAULT '0000-00-00',
  PRIMARY KEY (`Id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=607 ;

-- --------------------------------------------------------

--
-- Table structure for table `articulosclases`
--

DROP TABLE IF EXISTS `articulosclases`;
CREATE TABLE IF NOT EXISTS `articulosclases` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- Table structure for table `articulossugeridos`
--

DROP TABLE IF EXISTS `articulossugeridos`;
CREATE TABLE IF NOT EXISTS `articulossugeridos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Descripcion` varchar(100) NOT NULL DEFAULT '',
  `Url` varchar(200) NOT NULL DEFAULT '',
  `Detalle` text NOT NULL,
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`,`IdCategoria`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=50 ;

-- --------------------------------------------------------

--
-- Table structure for table `categorias`
--

DROP TABLE IF EXISTS `categorias`;
CREATE TABLE IF NOT EXISTS `categorias` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` varchar(60) NOT NULL DEFAULT '',
  `Alias` varchar(16) NOT NULL DEFAULT '',
  `Detalle` text NOT NULL,
  `Resumen` text NOT NULL,
  `Terminos` varchar(100) NOT NULL DEFAULT '',
  `IdPadre` int(11) NOT NULL DEFAULT '0',
  `IdReferencia` int(11) NOT NULL DEFAULT '0',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  `Visitas` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdPadre` (`IdPadre`),
  KEY `IdReferencia` (`IdReferencia`),
  KEY `Alias` (`Alias`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=396 ;

-- --------------------------------------------------------

--
-- Table structure for table `categoriasarticulos`
--

DROP TABLE IF EXISTS `categoriasarticulos`;
CREATE TABLE IF NOT EXISTS `categoriasarticulos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdArticulo` int(11) NOT NULL DEFAULT '0',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdArticulo` (`IdArticulo`,`IdCategoria`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=626 ;

-- --------------------------------------------------------

--
-- Table structure for table `categoriasitems`
--

DROP TABLE IF EXISTS `categoriasitems`;
CREATE TABLE IF NOT EXISTS `categoriasitems` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdItem` int(11) NOT NULL DEFAULT '0',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdCategoria` (`IdCategoria`),
  KEY `IdItem` (`IdItem`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=172780 ;

-- --------------------------------------------------------

--
-- Table structure for table `categoriasnoticias`
--

DROP TABLE IF EXISTS `categoriasnoticias`;
CREATE TABLE IF NOT EXISTS `categoriasnoticias` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdNoticia` int(11) NOT NULL DEFAULT '0',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdNoticia` (`IdNoticia`),
  KEY `IdCategoria` (`IdCategoria`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Table structure for table `categoriassugeridas`
--

DROP TABLE IF EXISTS `categoriassugeridas`;
CREATE TABLE IF NOT EXISTS `categoriassugeridas` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Descripcion` varchar(100) NOT NULL DEFAULT '',
  `Detalle` text NOT NULL,
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`,`IdCategoria`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=412 ;

-- --------------------------------------------------------

--
-- Table structure for table `contactos`
--

DROP TABLE IF EXISTS `contactos`;
CREATE TABLE IF NOT EXISTS `contactos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `Email` varchar(100) NOT NULL DEFAULT '',
  `Motivo` varchar(100) NOT NULL DEFAULT '',
  `Texto` text NOT NULL,
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=278 ;

-- --------------------------------------------------------

--
-- Table structure for table `cursos`
--

DROP TABLE IF EXISTS `cursos`;
CREATE TABLE IF NOT EXISTS `cursos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Codigo` varchar(16) NOT NULL DEFAULT '',
  `Descripcion` varchar(60) NOT NULL DEFAULT '',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `Detalle` text NOT NULL,
  `Objetivos` text NOT NULL,
  `Requisitos` text NOT NULL,
  `Plan` text NOT NULL,
  `Material` text NOT NULL,
  `Modalidad` text NOT NULL,
  `Precio` text NOT NULL,
  `ImportePrecio` decimal(10,2) NOT NULL DEFAULT '0.00',
  `ImporteMateriales` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Observaciones` text NOT NULL,
  `Inscripcion` text NOT NULL,
  `Inicio` text NOT NULL,
  `Duracion` text NOT NULL,
  `ListaCorreo` varchar(30) NOT NULL DEFAULT '',
  `Profesor` text NOT NULL,
  `EmailProfesor` varchar(50) NOT NULL DEFAULT '',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  `Habilitado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `Codigo_2` (`Codigo`),
  KEY `Codigo` (`Codigo`),
  KEY `IdCategoria` (`IdCategoria`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=25 ;

-- --------------------------------------------------------

--
-- Table structure for table `cursoscategorias`
--

DROP TABLE IF EXISTS `cursoscategorias`;
CREATE TABLE IF NOT EXISTS `cursoscategorias` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` varchar(60) NOT NULL DEFAULT '',
  `Detalle` text NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- Table structure for table `emails`
--

DROP TABLE IF EXISTS `emails`;
CREATE TABLE IF NOT EXISTS `emails` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `De` varchar(100) NOT NULL DEFAULT '',
  `Para` varchar(100) NOT NULL DEFAULT '',
  `Tema` varchar(100) NOT NULL DEFAULT '',
  `Texto` text NOT NULL,
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Ip` varchar(20) NOT NULL DEFAULT '',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=50 ;

-- --------------------------------------------------------

--
-- Table structure for table `eventos`
--

DROP TABLE IF EXISTS `eventos`;
CREATE TABLE IF NOT EXISTS `eventos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Tipo` char(2) NOT NULL DEFAULT '',
  `Parametro` varchar(255) NOT NULL DEFAULT '',
  `Subparametro` varchar(255) NOT NULL DEFAULT '',
  `IdParametro` int(11) NOT NULL DEFAULT '0',
  `Ip` varchar(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `favoritos`
--

DROP TABLE IF EXISTS `favoritos`;
CREATE TABLE IF NOT EXISTS `favoritos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `IdItem` int(11) NOT NULL DEFAULT '0',
  `IdArticulo` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`),
  KEY `IdItem` (`IdItem`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=859 ;

-- --------------------------------------------------------

--
-- Table structure for table `items`
--

DROP TABLE IF EXISTS `items`;
CREATE TABLE IF NOT EXISTS `items` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` varchar(100) NOT NULL DEFAULT '',
  `IdClase` int(11) NOT NULL DEFAULT '0',
  `Detalle` text NOT NULL,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `Url` varchar(200) NOT NULL DEFAULT '',
  `Orden` tinyint(4) NOT NULL DEFAULT '0',
  `Visitas` int(11) NOT NULL DEFAULT '0',
  `Votos1` int(11) NOT NULL DEFAULT '0',
  `Votos2` int(11) NOT NULL DEFAULT '0',
  `Votos3` int(11) NOT NULL DEFAULT '0',
  `Votos4` int(11) NOT NULL DEFAULT '0',
  `Votos5` int(11) NOT NULL DEFAULT '0',
  `Imagen` varchar(100) NOT NULL DEFAULT '',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  `FechaHora` datetime DEFAULT NULL,
  `Favoritos` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=172666 ;

-- --------------------------------------------------------

--
-- Table structure for table `itemsclases`
--

DROP TABLE IF EXISTS `itemsclases`;
CREATE TABLE IF NOT EXISTS `itemsclases` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `itemssugeridos`
--

DROP TABLE IF EXISTS `itemssugeridos`;
CREATE TABLE IF NOT EXISTS `itemssugeridos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `IdCategoria` int(11) NOT NULL DEFAULT '0',
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Descripcion` varchar(100) NOT NULL DEFAULT '',
  `Url` varchar(200) NOT NULL DEFAULT '',
  `Detalle` text NOT NULL,
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`,`IdCategoria`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5880 ;

-- --------------------------------------------------------

--
-- Table structure for table `lecciones`
--

DROP TABLE IF EXISTS `lecciones`;
CREATE TABLE IF NOT EXISTS `lecciones` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` varchar(255) NOT NULL DEFAULT '',
  `IdCurso` int(11) NOT NULL DEFAULT '0',
  `Orden` int(11) NOT NULL DEFAULT '0',
  `Nivel` int(11) NOT NULL DEFAULT '0',
  `IdAnterior` int(11) NOT NULL DEFAULT '0',
  `IdSiguiente` int(11) NOT NULL DEFAULT '0',
  `IdPadre` int(11) NOT NULL DEFAULT '0',
  `Archivo` varchar(255) NOT NULL DEFAULT '',
  `Visitas` int(11) NOT NULL DEFAULT '0',
  `Votos1` int(11) NOT NULL DEFAULT '0',
  `Votos2` int(11) NOT NULL DEFAULT '0',
  `Votos3` int(11) NOT NULL DEFAULT '0',
  `Votos4` int(11) NOT NULL DEFAULT '0',
  `Votos5` int(11) NOT NULL DEFAULT '0',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdCurso` (`IdCurso`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=174 ;

-- --------------------------------------------------------

--
-- Table structure for table `noticias`
--

DROP TABLE IF EXISTS `noticias`;
CREATE TABLE IF NOT EXISTS `noticias` (
  `Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Titulo` varchar(100) NOT NULL DEFAULT '',
  `Resumen` text NOT NULL,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `Copete` text NOT NULL,
  `Texto` text NOT NULL,
  `Imagen` varchar(100) NOT NULL DEFAULT '',
  `TextoImagen` text NOT NULL,
  `Orden` tinyint(4) NOT NULL DEFAULT '0',
  `Visitas` int(11) NOT NULL DEFAULT '0',
  `IdEstado` tinyint(4) NOT NULL DEFAULT '0',
  `VigenciaDesde` date DEFAULT NULL,
  `VigenciaHasta` date DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

--
-- Table structure for table `pagos`
--

DROP TABLE IF EXISTS `pagos`;
CREATE TABLE IF NOT EXISTS `pagos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `IdCurso` int(11) NOT NULL DEFAULT '0',
  `Fecha` date NOT NULL DEFAULT '0000-00-00',
  `Importe` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Divisa` varchar(30) NOT NULL DEFAULT '',
  `Apellido` varchar(50) NOT NULL DEFAULT '',
  `Nombre` varchar(50) NOT NULL DEFAULT '',
  `Comprobante` varchar(30) NOT NULL DEFAULT '',
  `Tipo` char(2) NOT NULL DEFAULT '',
  `Observaciones` text NOT NULL,
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`,`IdCurso`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

-- --------------------------------------------------------

--
-- Table structure for table `paises`
--

DROP TABLE IF EXISTS `paises`;
CREATE TABLE IF NOT EXISTS `paises` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` varchar(40) NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`),
  KEY `Descripcion` (`Descripcion`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;

-- --------------------------------------------------------

--
-- Table structure for table `preferencias`
--

DROP TABLE IF EXISTS `preferencias`;
CREATE TABLE IF NOT EXISTS `preferencias` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `Novedades` tinyint(4) NOT NULL DEFAULT '0',
  `Html` tinyint(4) NOT NULL DEFAULT '0',
  `Internet` tinyint(4) NOT NULL DEFAULT '0',
  `Deportes` tinyint(4) NOT NULL DEFAULT '0',
  `Educacion` tinyint(4) NOT NULL DEFAULT '0',
  `Ciencia` tinyint(4) NOT NULL DEFAULT '0',
  `Tecnologia` tinyint(4) NOT NULL DEFAULT '0',
  `Computacion` tinyint(4) NOT NULL DEFAULT '0',
  `Negocios` tinyint(4) NOT NULL DEFAULT '0',
  `Empleo` tinyint(4) NOT NULL DEFAULT '0',
  `Finanzas` tinyint(4) NOT NULL DEFAULT '0',
  `Viajes` tinyint(4) NOT NULL DEFAULT '0',
  `Compras` tinyint(4) NOT NULL DEFAULT '0',
  `Juegos` tinyint(4) NOT NULL DEFAULT '0',
  `Entretenimiento` tinyint(4) NOT NULL DEFAULT '0',
  `Salud` tinyint(4) NOT NULL DEFAULT '0',
  `Familia` tinyint(4) NOT NULL DEFAULT '0',
  `FechaHoraCreacion` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `FechaHoraModificacion` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `IdUsuario` (`IdUsuario`),
  KEY `IdUsuario_2` (`IdUsuario`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2261 ;

-- --------------------------------------------------------

--
-- Table structure for table `puntos`
--

DROP TABLE IF EXISTS `puntos`;
CREATE TABLE IF NOT EXISTS `puntos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Puntos` int(11) NOT NULL DEFAULT '0',
  `Cantidad` int(11) NOT NULL DEFAULT '0',
  `Tipo` tinyint(4) NOT NULL DEFAULT '0',
  `IdParametro` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6045 ;

-- --------------------------------------------------------

--
-- Table structure for table `recomendados`
--

DROP TABLE IF EXISTS `recomendados`;
CREATE TABLE IF NOT EXISTS `recomendados` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `De` varchar(60) NOT NULL DEFAULT '',
  `Para` varchar(60) NOT NULL DEFAULT '',
  `FechaHora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `IP` varchar(20) NOT NULL DEFAULT '',
  `Enviado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`,`De`,`Para`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=275 ;

-- --------------------------------------------------------

--
-- Table structure for table `sesion`
--

DROP TABLE IF EXISTS `sesion`;
CREATE TABLE IF NOT EXISTS `sesion` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `codigo` varchar(20) NOT NULL DEFAULT '',
  `texto` text NOT NULL,
  `tiempo` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `codigo_2` (`codigo`),
  KEY `codigo` (`codigo`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=169 ;

-- --------------------------------------------------------

--
-- Table structure for table `tablas`
--

DROP TABLE IF EXISTS `tablas`;
CREATE TABLE IF NOT EXISTS `tablas` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Codigo` varchar(30) NOT NULL DEFAULT '',
  `Descripcion` varchar(50) NOT NULL DEFAULT '',
  `Singular` varchar(50) NOT NULL DEFAULT '',
  `Plural` varchar(50) NOT NULL DEFAULT '',
  `IdGenero` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `Codigo` (`Codigo`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Table structure for table `usuarios`
--

DROP TABLE IF EXISTS `usuarios`;
CREATE TABLE IF NOT EXISTS `usuarios` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Codigo` varchar(16) NOT NULL DEFAULT '',
  `Contrasenia` varchar(16) NOT NULL DEFAULT '',
  `IdReferente` int(11) NOT NULL DEFAULT '0',
  `Nombre` varchar(40) NOT NULL DEFAULT '',
  `Apellido` varchar(40) NOT NULL DEFAULT '',
  `Email` varchar(50) NOT NULL DEFAULT '',
  `NosConoce` char(2) NOT NULL DEFAULT '',
  `Comentarios` text NOT NULL,
  `IdSexo` tinyint(4) NOT NULL DEFAULT '0',
  `IdPais` int(11) NOT NULL DEFAULT '0',
  `Provincia` varchar(30) NOT NULL DEFAULT '',
  `Ciudad` varchar(40) NOT NULL DEFAULT '',
  `CodigoPostal` varchar(10) NOT NULL DEFAULT '',
  `FechaNacimiento` date NOT NULL DEFAULT '0000-00-00',
  `EsAdministrador` tinyint(4) NOT NULL DEFAULT '0',
  `EsTutor` tinyint(4) NOT NULL DEFAULT '0',
  `EsCliente` tinyint(4) NOT NULL DEFAULT '0',
  `EsAfiliado` tinyint(4) NOT NULL DEFAULT '0',
  `FechaHoraAlta` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `FechaHoraModificacion` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `FechaHoraUltimoIngreso` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Ingresos` int(11) NOT NULL DEFAULT '0',
  `Puntos` int(11) NOT NULL DEFAULT '0',
  `PuntosAnteriores` int(11) NOT NULL DEFAULT '0',
  `PuntosPendientes` int(11) NOT NULL DEFAULT '0',
  `Verificado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `Codigo` (`Codigo`),
  KEY `Email` (`Email`),
  KEY `IdReferente` (`IdReferente`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2535 ;

-- --------------------------------------------------------

--
-- Table structure for table `usuarioscursos`
--

DROP TABLE IF EXISTS `usuarioscursos`;
CREATE TABLE IF NOT EXISTS `usuarioscursos` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `IdUsuario` int(11) NOT NULL DEFAULT '0',
  `IdCurso` int(11) NOT NULL DEFAULT '0',
  `FechaHoraInscripcion` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Precio` decimal(10,2) NOT NULL DEFAULT '0.00',
  `PrecioOriginal` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Puntos` int(11) NOT NULL DEFAULT '0',
  `FechaHoraPago` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Estado` tinyint(4) NOT NULL DEFAULT '0',
  `Visitas` int(11) NOT NULL DEFAULT '0',
  `Importe` decimal(10,2) NOT NULL DEFAULT '0.00',
  `Habilitado` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `IdUsuario` (`IdUsuario`,`IdCurso`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1401 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
'use strict';

function openIncognito(url) {
    console.log("Attempting to open URL incognito: ", url);
    chrome.windows.getAll({}, function (wins) {
        var incognitoWins = wins.filter(function (w) { return w.incognito; });
        var focussedWins = wins.filter(function (w) { return w.focused; });

        var state = (focussedWins.length > 0)
                        ? (focussedWins[0].state || "normal")
                        : "normal";

        if (incognitoWins.length > 0 && typeof incognitoWins[0].id !== "undefined") {
            chrome.tabs.create({ url: url, windowId: incognitoWins[0].id });
        } else {
            try {
                chrome.windows.create(
                    { url: url
                    , incognito: true
                    // May not be able to use `state` as it is supported
                    // only in Chrome 41 and beyond.
                    , state: state
                    }
                );
            } catch(e) {
                console.log("Trying without `state`");
                chrome.windows.create(
                    { url: url
                    , incognito: true
                    }
                );
            }
        }
    });
}

chrome.runtime.onInstalled.addListener(function (details) {
    if (details.reason === "install") {
        chrome.runtime.openOptionsPage();
    }
});

chrome.extension.onMessage.addListener(
    function(request, sender, sendResponse) {
        openIncognito(request.url);
        sendResponse(true);
    }
);

chrome.browserAction.onClicked.addListener(
    function(tab) {
        openIncognito(tab.url);
    }
);

redpajama_set_name: RedPajamaGithub


text:
#include "config.h"
#ifdef HAVE_SGEN_GC

#include "metadata/sgen-gc.h"
#include "metadata/sgen-protocol.h"
#include "metadata/sgen-memory-governor.h"
#include "metadata/profiler-private.h"
#include "utils/mono-time.h"
#include "utils/dtrace.h"
#include "utils/mono-counters.h"

#define TV_DECLARE SGEN_TV_DECLARE
#define TV_GETTIME SGEN_TV_GETTIME
#define TV_ELAPSED SGEN_TV_ELAPSED
#define TV_ELAPSED_MS SGEN_TV_ELAPSED_MS

inline static void*
align_pointer (void *ptr)
{
	mword p = (mword)ptr;
	p += sizeof (gpointer) - 1;
	p &= ~ (sizeof (gpointer) - 1);
	return (void*)p;
}

#ifdef USE_MONO_CTX
static MonoContext cur_thread_ctx;
#else
static mword cur_thread_regs [ARCH_NUM_REGS] = {0};
#endif

static void
update_current_thread_stack (void *start)
{
	int stack_guard = 0;
#if !defined(USE_MONO_CTX)
	void *reg_ptr = cur_thread_regs;
#endif
	SgenThreadInfo *info = mono_thread_info_current ();

	info->stack_start = align_pointer (&stack_guard);
	g_assert (info->stack_start >= info->stack_start_limit && info->stack_start < info->stack_end);
#ifdef USE_MONO_CTX
	MONO_CONTEXT_GET_CURRENT (cur_thread_ctx);
	memcpy (&info->ctx, &cur_thread_ctx, sizeof (MonoContext));
	if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
		mono_gc_get_gc_callbacks ()->thread_suspend_func (info->runtime_data, NULL, &info->ctx);
#else
	ARCH_STORE_REGS (reg_ptr);
	memcpy (&info->regs, reg_ptr, sizeof (info->regs));
	if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
		mono_gc_get_gc_callbacks ()->thread_suspend_func (info->runtime_data, NULL, NULL);
#endif
}

static gboolean
is_ip_in_managed_allocator (MonoDomain *domain, gpointer ip)
{
	MonoJitInfo *ji;

	if (!mono_thread_internal_current ())
		/* Happens during thread attach */
		return FALSE;

	if (!ip || !domain)
		return FALSE;
	if (!sgen_has_critical_method ())
		return FALSE;

	/*
	 * mono_jit_info_table_find is not async safe since it calls into the AOT runtime to load information for
	 * missing methods (#13951). To work around this, we disable the AOT fallback. For this to work, the JIT needs
	 * to register the jit info for all GC critical methods after they are JITted/loaded.
	 */
	ji = mono_jit_info_table_find_internal (domain, ip, FALSE);
	if (!ji)
		return FALSE;

	return sgen_is_critical_method (mono_jit_info_get_method (ji));
}

static int
restart_threads_until_none_in_managed_allocator (void)
{
	SgenThreadInfo *info;
	int num_threads_died = 0;
	int sleep_duration = -1;

	for (;;) {
		int restart_count = 0, restarted_count = 0;
		/* restart all threads that stopped in the
		   allocator */
		FOREACH_THREAD_SAFE (info) {
			gboolean result;
			if (info->skip || info->gc_disabled)
				continue;
			if (mono_thread_info_run_state (info) == STATE_RUNNING && (!info->stack_start || info->in_critical_region || info->info.inside_critical_region ||
					is_ip_in_managed_allocator (info->stopped_domain, info->stopped_ip))) {
				binary_protocol_thread_restart ((gpointer)mono_thread_info_get_tid (info));
				SGEN_LOG (3, "thread %p resumed.", (void*) (size_t) info->info.native_handle);
				result = sgen_resume_thread (info);
				if (result) {
					++restart_count;
				} else {
					info->skip = 1;
				}
			} else {
				/* we set the stopped_ip to
				   NULL for threads which
				   we're not restarting so
				   that we can easily identify
				   the others */
				info->stopped_ip = NULL;
				info->stopped_domain = NULL;
			}
		} END_FOREACH_THREAD_SAFE
		/* if no threads were restarted, we're done */
		if (restart_count == 0)
			break;

		/* wait for the threads to signal their restart */
		sgen_wait_for_suspend_ack (restart_count);

		if (sleep_duration < 0) {
			mono_thread_info_yield ();
			sleep_duration = 0;
		} else {
			g_usleep (sleep_duration);
			sleep_duration += 10;
		}

		/* stop them again */
		FOREACH_THREAD (info) {
			gboolean result;
			if (info->skip || info->stopped_ip == NULL)
				continue;
			result = sgen_suspend_thread (info);

			if (result) {
				++restarted_count;
			} else {
				info->skip = 1;
			}
		} END_FOREACH_THREAD
		/* some threads might have died */
		num_threads_died += restart_count - restarted_count;
		/* wait for the threads to signal their suspension
		   again */
		sgen_wait_for_suspend_ack (restarted_count);
	}

	return num_threads_died;
}

static void
acquire_gc_locks (void)
{
	LOCK_INTERRUPTION;
	mono_thread_info_suspend_lock ();
}

static void
release_gc_locks (void)
{
	mono_thread_info_suspend_unlock ();
	UNLOCK_INTERRUPTION;
}

static void
count_cards (long long *major_total, long long *major_marked, long long *los_total, long long *los_marked)
{
	sgen_get_major_collector ()->count_cards (major_total, major_marked);
	sgen_los_count_cards (los_total, los_marked);
}

static TV_DECLARE (stop_world_time);
static unsigned long max_pause_usec = 0;

static long long time_stop_world;
static long long time_restart_world;

/* LOCKING: assumes the GC lock is held */
int
sgen_stop_world (int generation)
{
	TV_DECLARE (end_handshake);
	int count, dead;

	mono_profiler_gc_event (MONO_GC_EVENT_PRE_STOP_WORLD, generation);
	MONO_GC_WORLD_STOP_BEGIN ();
	binary_protocol_world_stopping (sgen_timestamp ());
	acquire_gc_locks ();

	/* We start to scan after locks are taking, this ensures we won't be interrupted. */
	sgen_process_togglerefs ();

	update_current_thread_stack (&count);

	sgen_global_stop_count++;
	SGEN_LOG (3, "stopping world n %d from %p %p", sgen_global_stop_count, mono_thread_info_current (), (gpointer)mono_native_thread_id_get ());
	TV_GETTIME (stop_world_time);
	count = sgen_thread_handshake (TRUE);
	dead = restart_threads_until_none_in_managed_allocator ();
	if (count < dead)
		g_error ("More threads have died (%d) that been initialy suspended %d", dead, count);
	count -= dead;

	SGEN_LOG (3, "world stopped %d thread(s)", count);
	mono_profiler_gc_event (MONO_GC_EVENT_POST_STOP_WORLD, generation);
	MONO_GC_WORLD_STOP_END ();
	if (binary_protocol_is_enabled ()) {
		long long major_total, major_marked, los_total, los_marked;
		count_cards (&major_total, &major_marked, &los_total, &los_marked);
		binary_protocol_world_stopped (sgen_timestamp (), major_total, major_marked, los_total, los_marked);
	}

	TV_GETTIME (end_handshake);
	time_stop_world += TV_ELAPSED (stop_world_time, end_handshake);

	sgen_memgov_collection_start (generation);
	if (sgen_need_bridge_processing ())
		sgen_bridge_reset_data ();

	return count;
}

/* LOCKING: assumes the GC lock is held */
int
sgen_restart_world (int generation, GGTimingInfo *timing)
{
	int count;
	SgenThreadInfo *info;
	TV_DECLARE (end_sw);
	TV_DECLARE (start_handshake);
	TV_DECLARE (end_bridge);
	unsigned long usec, bridge_usec;

	if (binary_protocol_is_enabled ()) {
		long long major_total, major_marked, los_total, los_marked;
		count_cards (&major_total, &major_marked, &los_total, &los_marked);
		binary_protocol_world_restarting (generation, sgen_timestamp (), major_total, major_marked, los_total, los_marked);
	}

	/* notify the profiler of the leftovers */
	/* FIXME this is the wrong spot at we can STW for non collection reasons. */
	if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_GC_MOVES))
		sgen_gc_event_moves ();
	mono_profiler_gc_event (MONO_GC_EVENT_PRE_START_WORLD, generation);
	MONO_GC_WORLD_RESTART_BEGIN (generation);
	FOREACH_THREAD (info) {
		info->stack_start = NULL;
#ifdef USE_MONO_CTX
		memset (&info->ctx, 0, sizeof (MonoContext));
#else
		memset (&info->regs, 0, sizeof (info->regs));
#endif
	} END_FOREACH_THREAD

	TV_GETTIME (start_handshake);
	count = sgen_thread_handshake (FALSE);
	TV_GETTIME (end_sw);
	time_restart_world += TV_ELAPSED (start_handshake, end_sw);
	usec = TV_ELAPSED (stop_world_time, end_sw);
	max_pause_usec = MAX (usec, max_pause_usec);
	SGEN_LOG (2, "restarted %d thread(s) (pause time: %d usec, max: %d)", count, (int)usec, (int)max_pause_usec);
	mono_profiler_gc_event (MONO_GC_EVENT_POST_START_WORLD, generation);
	MONO_GC_WORLD_RESTART_END (generation);
	binary_protocol_world_restarted (generation, sgen_timestamp ());

	/*
	 * We must release the thread info suspend lock after doing
	 * the thread handshake.  Otherwise, if the GC stops the world
	 * and a thread is in the process of starting up, but has not
	 * yet registered (it's not in the thread_list), it is
	 * possible that the thread does register while the world is
	 * stopped.  When restarting the GC will then try to restart
	 * said thread, but since it never got the suspend signal, it
	 * cannot answer the restart signal, so a deadlock results.
	 */
	release_gc_locks ();

	sgen_try_free_some_memory = TRUE;

	if (sgen_need_bridge_processing ())
		sgen_bridge_processing_finish (generation);

	TV_GETTIME (end_bridge);
	bridge_usec = TV_ELAPSED (end_sw, end_bridge);

	if (timing) {
		timing [0].stw_time = usec;
		timing [0].bridge_time = bridge_usec;
	}

	sgen_memgov_collection_end (generation, timing, timing ? 2 : 0);

	return count;
}

void
sgen_init_stw (void)
{
	mono_counters_register ("World stop", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_stop_world);
	mono_counters_register ("World restart", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_restart_world);
}

#endif


text:
cea.analysis.costs package
==========================

.. automodule:: cea.analysis.costs
   :members:
   :undoc-members:
   :show-inheritance:

Submodules
----------

cea.analysis.costs.equations module
-----------------------------------

.. automodule:: cea.analysis.costs.equations
   :members:
   :undoc-members:
   :show-inheritance:

cea.analysis.costs.system\_costs module
---------------------------------------

.. automodule:: cea.analysis.costs.system_costs
   :members:
   :undoc-members:
   :show-inheritance:


text:
**Registros**

Fernando Hoces de la Guardia

Berkeley Initiative for Transparency in the Social

----------

Los objetivos de este modulo son:
 1. Introducir la pagina de registros de [AEA](https://www.socialscienceregistry.org).
 2. Introducir el [Open Science Framework](osf.io)
 3. Asegurarnos de que tengan instalado el software para las sesiones siguientes.

## AEA Registry

* Creen una cuenta.
* Llenemos los campos con un proyecto ficticio.
* Guarden pero NO HAGAN SUBMISSION

## OSF

**Objetivo**: un lugar para organizar toda tu investigación. Esta diseñado para que puedas compartir, y recibas credito, todos los componentes que desees de tu trabajo.

Esta seccion se basa principlamente en el turorial que  [Kaitlyn Werner](https://osf.io/ftk25/) presentó en RT2 London. Link [aquí a su presentación](https://osf.io/qpgrn/).

### Navegación del OSF
* Creen una cuenta
* Creen un nuevo proyecto
* Añadan un componentes
* Agreguen un archivo a ese componente
* Hagan 'check-out' de ese archivo.
* Modifíquenlo y luego hagan check-in. Revisen las versiones.
* Compartan el archivo con un reviewer anónimo.

### Practicando Open Science
* Registren un estudio en formato 'Open-Ended'.
* Registren un estudio en 'Prereg Challenge' (50%)
* Si quieren continuar recuerden que pueden recibir [$1000](https://cos.io/prereg/)

## Instalación de Software

 * [Instalen R](https://cloud.r-project.org)
 * [Instalen RStudio](https://www.rstudio.com/products/rstudio/download/#download)
 * [Instalen Github Desktop](https://desktop.github.com)
 * Asegurence de tener un editor de texto en su computador.

   * **Windows:** Notepad
   * **Mac:** Textedit -  cambien los defaults como se indica [aqui](http://www.iphonehacks.com/2017/06/plain-text-mode-textedit-mac.html). O instalen un editor.
 Como [Atom](http://atom.io), Sublime o Notepad++ (el editor de do-files de Stata también funciona).

 * [Crear](https://github.com/join?source=header-home) una cuenta en Github.com.


text:
package org.compass.core.lucene;

import java.io.Reader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

import org.compass.core.Property;
import org.compass.core.Resource;
import org.compass.core.engine.SearchEngineException;
import org.compass.core.lucene.engine.LuceneSearchEngine;
import org.compass.core.spi.MultiResource;
import org.compass.core.spi.ResourceKey;
import org.compass.core.util.StringUtils;

/**
 * @author kimchy
 */
public class LuceneMultiResource implements MultiResource, Map<String, Property[]> {

    private LuceneResource currentResource;

    private ArrayList<Resource> resources = new ArrayList<Resource>();

    private String alias;

    private transient LuceneSearchEngine searchEngine;

    public LuceneMultiResource(String alias, LuceneSearchEngine searchEngine) {
        this.alias = alias;
        this.searchEngine = searchEngine;
        currentResource = new LuceneResource(alias, searchEngine);
        resources.add(currentResource);
    }

    // MultiResource inteface

    public int size() {
        return resources.size();
    }

    public Resource currentResource() {
        return currentResource;
    }

    public ResourceKey resourceKey() {
        return currentResource.resourceKey();
    }

    public void addResource() {
        currentResource = new LuceneResource(alias, searchEngine);
        resources.add(currentResource);
    }

    public Resource resource(int i) {
        return resources.get(i);
    }

    public void clear() {
        resources.clear();
        currentResource = null;
    }

    // Resource interfaces

    public String getAlias() {
        return currentResource.getAlias();
    }

    public String getId() {
        return currentResource.getId();
    }

    public String[] getIds() {
        return currentResource.getIds();
    }

    public Property getIdProperty() {
        return currentResource.getIdProperty();
    }

    public Property[] getIdProperties() {
        return currentResource.getIdProperties();
    }

    public String getValue(String name) {
        return currentResource.getValue(name);
    }

    public Object getObject(String name) {
        return currentResource.getObject(name);
    }

    public String[] getValues(String name) {
        return currentResource.getValues(name);
    }

    public Resource addProperty(String name, Object value) throws SearchEngineException {
        currentResource.addProperty(name, value);
        return this;
    }

    public Resource addProperty(String name, Reader value) throws SearchEngineException {
        currentResource.addProperty(name, value);
        return this;
    }

    public Resource addProperty(Property property) {
        currentResource.addProperty(property);
        return this;
    }

    public Resource setProperty(String name, Object value) throws SearchEngineException {
        currentResource.setProperty(name, value);
        return this;
    }

    public Resource setProperty(String name, Reader value) throws SearchEngineException {
        currentResource.setProperty(name, value);
        return this;
    }

    public Resource setProperty(Property property) {
        currentResource.setProperty(property);
        return this;
    }

    public Resource removeProperty(String name) {
        currentResource.removeProperty(name);
        return this;
    }

    public Resource removeProperties(String name) {
        currentResource.removeProperties(name);
        return this;
    }

    public Property getProperty(String name) {
        return currentResource.getProperty(name);
    }

    public Property[] getProperties(String name) {
        return currentResource.getProperties(name);
    }

    public Property[] getProperties() {
        return currentResource.getProperties();
    }

    public float getBoost() {
        return currentResource.getBoost();
    }

    public Resource setBoost(float boost) {
        currentResource.setBoost(boost);
        return this;
    }

    public void copy(Resource resource) {
        clear();
        if (resource instanceof MultiResource) {
            MultiResource multiResource = (MultiResource) resource;
            for (int i = 0; i < multiResource.size(); i++) {
                addResource();
                currentResource.copy(multiResource.resource(i));
            }
        } else {
            currentResource = (LuceneResource) resource;
            resources.add(resource);
        }
    }

    public String toString() {
        if (resources.size() == 1) {
            return resource(0).toString();
        }
        return StringUtils.collectionToCommaDelimitedString(resources);
    }

    // methods from the map interface

    public boolean isEmpty() {
        return currentResource.isEmpty();
    }

    public boolean containsKey(Object key) {
        return currentResource.containsKey(key);
    }

    public boolean containsValue(Object value) {
        return currentResource.containsValue(value);
    }

    public Collection<Property[]> values() {
        return currentResource.values();
    }

    public void putAll(Map<? extends String, ? extends Property[]> t) {
        currentResource.putAll(t);
    }

    public Set<Map.Entry<String, Property[]>> entrySet() {
        return currentResource.entrySet();
    }

    public Set<String> keySet() {
        return currentResource.keySet();
    }

    public Property[] get(Object key) {
        return currentResource.get(key);
    }

    public Property[] remove(Object key) {
        return currentResource.remove(key);
    }

    public Property[] put(String key, Property[] value) {
        return currentResource.put(key, value);
    }
}


text:
class SSTestDotTableName < ActiveRecord::Base
  self.table_name = '[dbo].[some.Name]'
end


text:
package com.intel.analytics.bigdl.dllib.models.utils

import com.intel.analytics.bigdl._
import com.intel.analytics.bigdl.dllib.feature.dataset.{DistributedDataSet, MiniBatch}
import com.intel.analytics.bigdl.dllib.models.inception.{Inception_v1, Inception_v2}
import com.intel.analytics.bigdl.dllib.models.vgg.{Vgg_16, Vgg_19}
import com.intel.analytics.bigdl.dllib.nn.ClassNLLCriterion
import com.intel.analytics.bigdl.numeric.NumericFloat
import com.intel.analytics.bigdl.dllib.optim.{Optimizer, Trigger}
import com.intel.analytics.bigdl.dllib.tensor.Tensor
import com.intel.analytics.bigdl.dllib.utils.Engine
import org.apache.logging.log4j.Level
import org.apache.logging.log4j.core.config.Configurator
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import scopt.OptionParser

object DistriOptimizerPerf {
  Configurator.setLevel("org", Level.ERROR)
  Configurator.setLevel("akka", Level.ERROR)
  Configurator.setLevel("breeze", Level.ERROR)
  Configurator.setLevel("com.intel.analytics.bigdl.dllib.optim", Level.DEBUG)

  val parser = new OptionParser[DistriOptimizerPerfParam]("BigDL Distribute Performance Test") {
    head("Performance Test of Distribute Optimizer")
    opt[Int]('b', "batchSize")
      .text("Batch size of input data")
      .action((v, p) => p.copy(batchSize = v))
    opt[Int]('e', "maxEpoch")
      .text("epoch numbers of the test")
      .action((v, p) => p.copy(maxEpoch = v))
    opt[String]('t', "type")
      .text("Data type. It can be float | double")
      .action((v, p) => p.copy(dataType = v))
      .validate(v =>
        if (v.toLowerCase() == "float" || v.toLowerCase() == "double") {
          success
        } else {
          failure("Data type can only be float or double now")
        }
      )
    opt[String]('m', "model")
      .text("Model name. It can be inception_v1 | inception_v2 | vgg16 | " +
        "vgg19")
      .action((v, p) => p.copy(module = v))
      .validate(v =>
        if (Set("inception_v1", "inception_v2", "vgg16", "vgg19").
          contains(v.toLowerCase())) {
          success
        } else {
          failure("Data type can only be inception_v1 | " +
            "vgg16 | vgg19 | inception_v2 now")
        }
      )
    opt[String]('d', "inputdata")
      .text("Input data type. One of constant | random")
      .action((v, p) => p.copy(inputData = v))
      .validate(v =>
        if (v.toLowerCase() == "constant" || v.toLowerCase() == "random") {
          success
        } else {
          failure("Input data type must be one of constant and random")
        }
      )
    help("help").text("Prints this usage text")
  }

  def main(args: Array[String]): Unit = {
    parser.parse(args, new DistriOptimizerPerfParam).foreach(performance)
  }

  def performance(param: DistriOptimizerPerfParam): Unit = {
    val conf = Engine.createSparkConf()
      .setAppName("DistriOptimizer Performance Test")
      .set("spark.task.maxFailures", "1")

    val (_model, input) = param.module match {
      case "inception_v1" => (Inception_v1(1000), Tensor(param.batchSize, 3, 224, 224))
      case "inception_v2" => (Inception_v2(1000), Tensor(param.batchSize, 3, 224, 224))
      case "vgg16" => (Vgg_16(1000), Tensor(param.batchSize, 3, 224, 224))
      case "vgg19" => (Vgg_19(1000), Tensor(param.batchSize, 3, 224, 224))
    }
    param.inputData match {
      case "constant" => input.fill(0.01f)
      case "random" => input.rand()
    }
    val model = _model
    println(model)
    val criterion = ClassNLLCriterion[Float]()
    val labels = Tensor(param.batchSize).fill(1)

    val sc = new SparkContext(conf)
    Engine.init
    val broadcast = sc.broadcast(MiniBatch(input, labels))
    val rdd = sc.parallelize((1 to Engine.nodeNumber()), Engine.nodeNumber())
      .mapPartitions(iter => {
        Iterator.single((broadcast.value))
      }).persist()
    rdd.count()
    val dummyDataSet = new DistributedDataSet[MiniBatch[Float]] {
      override def size(): Long = 10000
      override def shuffle(): Unit = {}
      override def originRDD(): RDD[_] = rdd
      override def data(train: Boolean): RDD[MiniBatch[Float]] = rdd
    }

    val optimizer = Optimizer(
      model,
      dummyDataSet,
      criterion
    )
    optimizer.setEndWhen(Trigger.maxEpoch(param.maxEpoch)).optimize()
    sc.stop()
  }
}

/**
 * The parameters of a distributed optimizer
 *
 * @param batchSize batch size
 * @param maxEpoch how many epochs to run
 * @param dataType data type (double / float)
 * @param module module name
 * @param inputData inputData input data type (constant / random)
 */
case class DistriOptimizerPerfParam(
  batchSize: Int = 128,
  maxEpoch: Int = 5,
  dataType: String = "float",
  module: String = "inception_v1",
  inputData: String = "random"
)


text:
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, NumericProperty, AliasProperty

def get_succeeded(*args):
    self = args[0]
    return self.last_build_status != 'Failure' and self.last_build_status != 'Exception'

def set_succeeded(*args):
    return False

class Project(EventDispatcher):

    name = StringProperty('')
    ci_server = StringProperty('')
    activity = StringProperty('Sleeping')
    last_build_status = StringProperty('Unknown')
    last_build_time = StringProperty('2015-07-01T18:04:22Z')
    succeeded = AliasProperty(get_succeeded, set_succeeded, bind=['last_build_status'])

    def __init__(self, **kwargs):
        self.name = kwargs.get('name', '')
        self.ci_server = kwargs.get('ci_server', '')
        self.activity = kwargs.get('activity', 'Sleeping')
        self.last_build_status = kwargs.get('last_build_status', 'Unknown')
        self.last_build_time = kwargs.get('last_build_time', '2015-07-01T18:04:22Z')


text:
'use strict';

function invariant(condition, message, a, b, c, d, e) {
  if (!condition) {
    if (message !== undefined) {
      var replacements = [a, b, c, d, e];
      var idx = 0;
      message = message.replace(/%s/g, function() {
        return replacements[idx++];
      });
      throw new Error('React Forms invariant violation: ' + message);
    } else {
      throw new Error('React Forms invariant violation');
    }
  }
}

module.exports = invariant;


text:
import logging
import threading
import time

from oslo_messaging._drivers.protocols.amqp import controller
from oslo_messaging import exceptions

from six import moves

LOG = logging.getLogger(__name__)

class SendTask(controller.Task):
    """A task that sends a message to a target, and optionally waits for a
    reply message.  The caller may block until the remote confirms receipt or
    the reply message has arrived.
    """
    def __init__(self, target, request, wait_for_reply, deadline):
        super(SendTask, self).__init__()
        self._target = target
        self._request = request
        self._deadline = deadline
        self._wait_for_reply = wait_for_reply
        self._results_queue = moves.queue.Queue()

    def wait(self, timeout):
        """Wait for the send to complete, and, optionally, a reply message from
        the remote.  Will raise MessagingTimeout if the send does not complete
        or no reply is received within timeout seconds. If the request has
        failed for any other reason, a MessagingException is raised."
        """
        try:
            result = self._results_queue.get(timeout=timeout)
        except moves.queue.Empty:
            if self._wait_for_reply:
                reason = "Timed out waiting for a reply."
            else:
                reason = "Timed out waiting for send to complete."
            raise exceptions.MessagingTimeout(reason)
        if result["status"] == "OK":
            return result.get("response", None)
        raise result["error"]

    def execute(self, controller):
        """Runs on eventloop thread - sends request."""
        if not self._deadline or self._deadline > time.time():
            controller.request(self._target, self._request,
                               self._results_queue, self._wait_for_reply)
        else:
            LOG.warn("Send request to %s aborted: TTL expired.", self._target)

class ListenTask(controller.Task):
    """A task that creates a subscription to the given target.  Messages
    arriving from the target are given to the listener.
    """
    def __init__(self, target, listener, notifications=False):
        """Create a subscription to the target."""
        super(ListenTask, self).__init__()
        self._target = target
        self._listener = listener
        self._notifications = notifications

    def execute(self, controller):
        """Run on the eventloop thread - subscribes to target. Inbound messages
        are queued to the listener's incoming queue.
        """
        if self._notifications:
            controller.subscribe_notifications(self._target,
                                               self._listener.incoming)
        else:
            controller.subscribe(self._target, self._listener.incoming)

class ReplyTask(controller.Task):
    """A task that sends 'response' message to 'address'.
    """
    def __init__(self, address, response, log_failure):
        super(ReplyTask, self).__init__()
        self._address = address
        self._response = response
        self._log_failure = log_failure
        self._wakeup = threading.Event()

    def wait(self):
        """Wait for the controller to send the message.
        """
        self._wakeup.wait()

    def execute(self, controller):
        """Run on the eventloop thread - send the response message."""
        controller.response(self._address, self._response)
        self._wakeup.set()


text:
function res = MBSAS(X,theta,q)
% MBSAS - Modified Basic Sequential Algorithmic Scheme
%
% Inputs:
%   X : [ number_of_samples by number_of_features ] matrix of feature vectors
%   theta : threshold of dissimilarty
%   q : maximum number of clusters
%
% Notes:
%   For this scheme one needs to define the distance between a point x_i and a cluster C_j.
%   This implementation uses the cluster represntative is the mean and the distance between x_i and C_j
%   is the Euclidean distance between x_i and the cluster reprentative.
%
% Written by:
% --
% John L. Weatherwax                2007-07-01
%
% email: wax@alum.mit.edu
%
% Please send comments and especially bug reports to the
% above email address.
%
%-----

N = size(X,1);
nFeatures = size(X,2);

labels = zeros(1,N); % zero means the point is not yet labeled

% Cluster determination:
%
m=1;
labels(1)=1;
for ii = 2:N,
  % find C_k : d(x_ii,C_k) = min_{1 <= j <= m} d(x_ii,C_j)
  %
  [ d_x_i_C_k, k ] = findClosestCluster( ii, labels, X );

  if( (d_x_i_C_k > theta) && (m<q) )
    m=m+1;
    labels(ii)=m;
  end
end

% Pattern Classification:
%
for ii=1:N,
  if( labels(ii)==0 )
    [ d_x_i_C_k, k ] = findClosestCluster( ii, labels, X );
    labels(ii) = k;
  end
end

res = labels;


text:
Azure Confidential Ledger provides a service for logging to an immutable, tamper-proof ledger. As part of the [Azure Confidential Computing][azure_confidential_computing] portfolio, Azure Confidential Ledger runs in secure, hardware-based trusted execution environments, also known as enclaves. It is built on Microsoft Research's [Confidential Consortium Framework][ccf].

[Source code][confidential_ledger_client_src] | [Package (PyPI)][pypi_package_confidential_ledger] | [API reference documentation][reference_docs] | [Product documentation][confidential_ledger_docs]

## Getting started
### Install packages
Install [azure-confidentialledger][pypi_package_confidential_ledger] and [azure-identity][azure_identity_pypi] with [pip][pip]:
```Bash
pip install azure-identity azure-confidentialledger
```
[azure-identity][azure_identity] is used for Azure Active Directory
authentication as demonstrated below.

### Prerequisites
* An [Azure subscription][azure_sub]
* Python 3.6 or later
* A running instance of Azure Confidential Ledger.
* A registered user in the Confidential Ledger, typically assigned during [ARM][azure_resource_manager] resource creation, with `Administrator` privileges.

### Authenticate the client
#### Using Azure Active Directory
This document demonstrates using [DefaultAzureCredential][default_cred_ref] to authenticate to the Confidential Ledger via Azure Active Directory. However, `ConfidentialLedgerClient` accepts any [azure-identity][azure_identity] credential. See the [azure-identity][azure_identity] documentation for more information about other credentials.

#### Using a client certificate
As an alternative to Azure Active Directory, clients may choose to use a client certificate to authenticate via mutual TLS. `azure.confidentialledger.ConfidentialLedgerCertificateCredential` may be used for this purpose.

### Create a client
`DefaultAzureCredential` will automatically handle most Azure SDK client scenarios. To get started, set environment variables for the AAD identity registered with your Confidential Ledger.
```bash
export AZURE_CLIENT_ID="generated app id"
export AZURE_CLIENT_SECRET="random password"
export AZURE_TENANT_ID="tenant id"
```
Then, `DefaultAzureCredential` will be able to authenticate the `ConfidentialLedgerClient`.

Constructing the client also requires your Confidential Ledger's URL and id, which you can get from the Azure CLI or the Azure Portal. When you have retrieved those values, please replace instances of `"my-ledger-id"` and `"https://my-ledger-id.confidential-ledger.azure.com"` in the examples below. You may also need to replace `"https://identity.confidential-ledger.core.azure.com"` with the hostname from the `identityServiceUri` in the ARM description of your ledger.

Because Confidential Ledgers use self-signed certificates securely generated and stored in an enclave, the signing certificate for each Confidential Ledger must first be retrieved from the Confidential Ledger Identity Service.

```python
from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)
```

Conveniently, the `ConfidentialLedgerClient` constructor will fetch the ledger TLS certificate (and write it to the specified file) if it is provided with a non-existent file. The user is responsible for removing the created file as needed.

```python
from azure.confidentialledger import ConfidentialLedgerClient
from azure.identity import DefaultAzureCredential

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path="ledger_certificate.pem"
)

# The ledger TLS certificate is written to `ledger_certificate.pem`.
```

To make it clear that a file is being used for the ledger TLS certificate, subsequent examples will explicitly write the ledger TLS certificate to a file.

## Key concepts
### Ledger entries and transactions
Every write to Azure Confidential Ledger generates an immutable ledger entry in the service. Writes, also referred to as transactions, are uniquely identified by transaction ids that increment with each write. Once written, ledger entries may be retrieved at any time.

### Receipts
State changes to the Confidential Ledger are saved in a data structure called a Merkle tree. To cryptographically verify that writes were correctly saved, a Merkle proof, or receipt, can be retrieved for any transaction id.

### Collections
While most use cases involve just one collection per Confidential Ledger, we provide the collection id feature in case semantically or logically different groups of data need to be stored in the same Confidential Ledger.

Ledger entries are retrieved by their `collectionId`. The Confidential Ledger will always assume a constant, service-determined `collectionId` for entries written without a `collectionId` specified.

### Users
Users are managed directly with the Confidential Ledger instead of through Azure. Users may be AAD-based, identified by their AAD object id, or certificate-based, identified by their PEM certificate fingerprint.

### Confidential computing
[Azure Confidential Computing][azure_confidential_computing] allows you to isolate and protect your data while it is being processed in the cloud. Azure Confidential Ledger runs on Azure Confidential Computing virtual machines, thus providing stronger data protection with encryption of data in use.

### Confidential Consortium Framework
Azure Confidential Ledger is built on Microsoft Research's open-source [Confidential Consortium Framework (CCF)][ccf]. Under CCF, applications are managed by a consortium of members with the ability to submit proposals to modify and govern application operation. In Azure Confidential Ledger, Microsoft Azure owns an operator member identity that allows it to perform governance and maintenance actions like replacing unhealthy nodes in the Confidential Ledger and upgrading the enclave code.

## Examples
This section contains code snippets covering common tasks, including:
- [Append entry](#append-entry)
- [Retrieving ledger entries](#retrieving-ledger-entries)
- [Making a ranged query](#making-a-ranged-query)
- [Managing users](#managing-users)
- [Using certificate authentication](#using-certificate-authentication)

### Append entry
Data that needs to be stored immutably in a tamper-proof manner can be saved to Azure Confidential Ledger by appending an entry to the ledger.

Since Confidential Ledger is a distributed system, rare transient failures may cause writes to be lost. For entries that must be preserved, it is advisable to verify that the write became durable. For less important writes where higher client throughput is preferred, the wait step may be skipped.

```python
from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)

post_entry_result = ledger_client.create_ledger_entry(
        {"contents": "Hello world!"}
    )
transaction_id = post_entry_result["transactionId"]

wait_poller = ledger_client.begin_wait_for_commit(transaction_id)
wait_poller.wait()
print(f'Ledger entry at transaction id {transaction_id} has been committed successfully')
```

Alternatively, the client may wait for commit when writing a ledger entry.

```python
from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)

post_poller = ledger_client.begin_create_ledger_entry(
    {"contents": "Hello world again!"}
)
new_post_result = post_poller.result()
print(
    'The new ledger entry has been committed successfully at transaction id '
    f'{new_post_result["transactionId"]}'
)
```

### Retrieving ledger entries
Getting ledger entries older than the latest may take some time as the service is loading historical entries, so a poller is provided.

Ledger entries are retrieved by collection. The returned value is the value contained in the specified collection at the point in time identified by the transaction id.

```python
from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)

post_poller = ledger_client.begin_create_ledger_entry(
    {"contents": "Original hello"}
)
post_result = post_poller.result()

post_transaction_id = post_result["transactionId"]

latest_entry = ledger_client.get_current_ledger_entry()
print(
    f'Current entry (transaction id = {latest_entry["transactionId"]}) '
    f'in collection {latest_entry["collectionId"]}: {latest_entry["contents"]}'
)

post_poller = ledger_client.begin_create_ledger_entry(
    {"contents": "Hello!"}
)
post_result = post_poller.result()

get_entry_poller = ledger_client.begin_get_ledger_entry(post_transaction_id)
older_entry = get_entry_poller.result()
print(
    f'Contents of {older_entry["entry"]["collectionId"]} at {post_transaction_id}: {older_entry["entry"]["contents"]}'
)
```

### Making a ranged query
Ledger entries may be retrieved over a range of transaction ids. Entries will only be returned from the default or specified collection.

```python
from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)

post_poller = ledger_client.begin_create_ledger_entry(
    {"contents": "First message"}
)
first_transaction_id = post_poller.result()["transactionId"]

for i in range(10):
    ledger_client.create_ledger_entry(
        {"contents": f"Message {i}"}
    )

post_poller = ledger_client.begin_create_ledger_entry(
    {"contents": "Last message"}
)
last_transaction_id = post_poller.result()["transactionId"]

ranged_result = ledger_client.list_ledger_entries(
    from_transaction_id=first_transaction_id,
    to_transaction_id=last_transaction_id,
)
for entry in ranged_result:
    print(f'Contents at {entry["transactionId"]}: {entry["contents"]}')
```

### Managing users
Users with `Administrator` privileges can manage users of the Confidential Ledger directly with the Confidential Ledger itself. Available roles are `Reader` (read-only), `Contributor` (read and write), and `Administrator` (read, write, and add or remove users).

```python
from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)

user_id = "some AAD object id"
user = ledger_client.create_or_update_user(
    user_id, {"assignedRole": "Contributor"}
)
# A client may now be created and used with AAD credentials (i.e. AAD-issued JWT tokens) for the user identified by `user_id`.

user = ledger_client.get_user(user_id)
assert user["userId"] == user_id
assert user["assignedRole"] == "Contributor"

ledger_client.delete_user(user_id)

# For a certificate-based user, their user ID is the fingerprint for their PEM certificate.
user_id = "PEM certificate fingerprint"
user = ledger_client.create_or_update_user(
    user_id, {"assignedRole": "Reader"}
)

user = ledger_client.get_user(user_id)
assert user["userId"] == user_id
assert user["assignedRole"] == "Reader"

ledger_client.delete_user(user_id)
```

### Using certificate authentication
Clients may authenticate with a client certificate in mutual TLS instead of via an Azure Active Directory token. `ConfidentialLedgerCertificateCredential` is provided for such clients.

```python
from azure.confidentialledger import (
    ConfidentialLedgerCertificateCredential,
    ConfidentialLedgerClient,
)
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = ConfidentialLedgerCertificateCredential(
    certificate_path="Path to user certificate PEM file"
)
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)
```

### Async API
This library includes a complete async API supported on Python 3.5+. To use it, you must first install an async transport, such as [aiohttp](https://pypi.org/project/aiohttp). See the [azure-core documentation](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#transport) for more information.

An async client is obtained from `azure.confidentialledger.aio`. Methods have the same names and signatures as the synchronous client. Samples may be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples).

## Troubleshooting
### General
Confidential Ledger clients raise exceptions defined in [azure-core][azure_core_exceptions]. For example, if you try to get a transaction that doesn't exist, `ConfidentialLedgerClient` raises [ResourceNotFoundError](https://aka.ms/azsdk-python-core-exceptions-resource-not-found-error):

```python
from azure.core.exceptions import ResourceNotFoundError
from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name
)

try:
    ledger_client.begin_get_ledger_entry(
        transaction_id="10000.100000"  # Using a very high id that probably doesn't exist in the ledger if it's relatively new.
    )
except ResourceNotFoundError as e:
    print(e.message)
```

### Logging
This library uses the standard
[logging](https://docs.python.org/3.5/library/logging.html) library for logging. Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO level.

Detailed DEBUG level logging, including request/response bodies and unredacted headers, can be enabled on a client with the `logging_enable` argument:
```python
import logging
import sys

from azure.confidentialledger import ConfidentialLedgerClient
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
from azure.identity import DefaultAzureCredential

# Create a logger for the 'azure' SDK
logger = logging.getLogger('azure')
logger.setLevel(logging.DEBUG)

# Configure a console output
handler = logging.StreamHandler(stream=sys.stdout)
logger.addHandler(handler)

identity_client = ConfidentialLedgerCertificateClient()
network_identity = identity_client.get_ledger_identity(
    ledger_id="my-ledger-id"
)

ledger_tls_cert_file_name = "ledger_certificate.pem"
with open(ledger_tls_cert_file_name, "w") as cert_file:
    cert_file.write(network_identity["ledgerTlsCertificate"])

credential = DefaultAzureCredential()

# This client will log detailed information about its HTTP sessions, at DEBUG level.
ledger_client = ConfidentialLedgerClient(
    endpoint="https://my-ledger-id.confidential-ledger.azure.com",
    credential=credential,
    ledger_certificate_path=ledger_tls_cert_file_name,
    logging_enable=True,
)
```

Similarly, `logging_enable` can enable detailed logging for a single operation, even when it isn't enabled for the client:
```python
ledger_client.get_current_ledger_entry(logging_enable=True)
```

## Next steps
### More sample code
These code samples show common scenario operations with the Azure Confidential Ledger client library.

#### Common scenarios

- Writing to the ledger:
  - [write_to_ledger.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/write_to_ledger.py)
  - [write_to_ledger_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/write_to_ledger_async.py) (async version)

- Write many ledger entries and retrieve them all afterwards:
  - [list_ledger_entries.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/list_ledger_entries.py)
  - [list_ledger_entries_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/list_ledger_entries_async.py) (async version)

- Manage users using service-implemented role-based access control:
  - [manage_users.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/manage_users.py)
  - [manage_users_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/manage_users_async.py) (async version)

#### Advanced scenarios

- Using collections:
  - [use_collections.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/use_collections.py)
  - [use_collections_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/use_collections_async.py) (async version)

- Getting receipts for ledger writes:
  - [get_receipt.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/get_receipt.py)
  - [get_receipt_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/get_receipt_async.py) (async version)

- Verifying service details:
  - [verify_service.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/verify_service.py)
  - [verify_service_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/verify_service_async.py) (async version)

###  Additional Documentation
For more extensive documentation on Azure Confidential Ledger, see the
[API reference documentation][reference_docs]. You may also read more about Microsoft Research's open-source [Confidential Consortium Framework][ccf].

## Contributing
This project welcomes contributions and suggestions. Most contributions require
you to agree to a Contributor License Agreement (CLA) declaring that you have
the right to, and actually do, grant us the rights to use your contribution.
For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether
you need to provide a CLA and decorate the PR appropriately (e.g., label,
comment). Simply follow the instructions provided by the bot. You will only
need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct].
For more information, see the
[Code of Conduct FAQ][code_of_conduct_faq] or
contact opencode@microsoft.com with any additional questions or comments.

[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_cloud_shell]: https://shell.azure.com/bash
[azure_confidential_computing]: https://azure.microsoft.com/solutions/confidential-compute
[azure_core_exceptions]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core#azure-core-library-exceptions
[azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
[azure_identity_pypi]: https://pypi.org/project/azure-identity/
[azure_resource_manager]: https://docs.microsoft.com/azure/azure-resource-manager/management/overview
[azure_sub]: https://azure.microsoft.com/free
[ccf]: https://github.com/Microsoft/CCF
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct
[code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq
[confidential_ledger_client_src]: https://aka.ms/azsdk/python/confidentialledger/src
[confidential_ledger_docs]: https://aka.ms/confidentialledger-servicedocs
[default_cred_ref]: https://aka.ms/azsdk/python/identity/docs#azure.identity.DefaultAzureCredential
[pip]: https://pypi.org/project/pip/
[pypi_package_confidential_ledger]: https://aka.ms/azsdk/python/confidentialledger/pypi
[reference_docs]: https://aka.ms/azsdk/python/confidentialledger/ref-docs


text:
/// <copyright>
/// Copyright (c) 2013 ICRL
/// See the file license.txt for copying permission.
/// </copyright>
using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TextEngineEditor
{
    public class INode : ViewModelBase
    {
        public override string ToString()
        {
            return "";
        }
    }
}


text:
using System.Collections.Generic;
using Azure.Core;

namespace Azure.Search.Documents.Models
{
    /// <summary> Represents an index action that operates on a document. </summary>
    internal partial class IndexAction
    {
        /// <summary> Initializes a new instance of IndexAction. </summary>
        public IndexAction()
        {
            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
        }

        /// <summary> The operation to perform on a document in an indexing batch. </summary>
        public IndexActionType? ActionType { get; set; }
        /// <summary> Additional Properties. </summary>
        public IDictionary<string, object> AdditionalProperties { get; }
    }
}


text:
require 'three_seventy_api'
require 'yaml'
# Example to list all the contents.
class AllContents
  def run
    # Load the config file
    config = YAML.load_file(File.expand_path("../../config.yml", __FILE__))
    # Load the account_id from config.
    account_id = config['account_id']
    # Load the url from config.
    url = config['url']
    # Load the username from config.
    username = config['username']
    # Load the password from config.
    password = config['password']
    # Initiate the client.
    client = ThreeSeventyApi::Client.new(url, username, password, account_id)
    # Now make a call to AllContents api and print the result.
    puts client.all_contents
  end
end
example = AllContents.new
example.run


text:
Mercurial
=========

The latest development version of SDL is available via Mercurial.
Mercurial allows you to get up-to-the-minute fixes and enhancements;
as a developer works on a source tree, you can use "hg" to mirror that
source tree instead of waiting for an official release. Please look
at the Mercurial website ( http://mercurial.selenic.com/ ) for more
information on using hg, where you can also download software for
Mac OS X, Windows, and Unix systems.

    hg clone http://hg.libsdl.org/SDL

If you are building SDL with an IDE, you will need to copy the file
include/SDL_config.h.default to include/SDL_config.h before building.

If you are building SDL via configure, you will need to run autogen.sh
before running configure.

There is a web interface to the subversion repository at:
	http://hg.libsdl.org/SDL/

There is an RSS feed available at that URL, for those that want to
track commits in real time.


text:
<?php

declare(strict_types=1);

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Entity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @Entity()
 */
class News
{
    /**
     * @var int
     *
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @Assert\NotBlank
     *
     * @ORM\Column(type="string")
     */
    private $headline;

    /**
     * @var string
     *
     * @Assert\NotBlank
     *
     * @ORM\Column(type="text")
     */
    private $preview;

    /**
     * @var string
     *
     * @Assert\NotBlank
     *
     * @ORM\Column(type="text")
     */
    private $body;

    /**
     * @var bool
     *
     * @ORM\Column(type="boolean")
     */
    private $published = false;

    /**
     * @var \DateTime
     *
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $publishedAt;

    /**
     * @var NewsCategory
     *
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\NewsCategory", inversedBy="news")
     */
    private $category;

    public function __construct()
    {
        $this->publishedAt = new \DateTime();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return string
     */
    public function getHeadline(): ?string
    {
        return $this->headline;
    }

    public function setHeadline(string $headline): void
    {
        $this->headline = $headline;
    }

    /**
     * @return string
     */
    public function getPreview(): ?string
    {
        return $this->preview;
    }

    public function setPreview(string $preview): void
    {
        $this->preview = $preview;
    }

    /**
     * @return string
     */
    public function getBody(): ?string
    {
        return $this->body;
    }

    public function setBody(string $body): void
    {
        $this->body = $body;
    }

    /**
     * @return bool
     */
    public function isPublished(): bool
    {
        return $this->published;
    }

    public function setPublished(bool $published): void
    {
        $this->published = $published;
    }

    /**
     * @return \DateTime
     */
    public function getPublishedAt(): ?\DateTime
    {
        return $this->publishedAt ? clone $this->publishedAt: null;
    }

    public function getCategory(): ?NewsCategory
    {
        return $this->category;
    }

    public function setCategory(NewsCategory $category): void
    {
        $category->addNews($this);
        $this->category = $category;
    }

}


text:
var traverse = require('traverse');
var Stream = require('stream').Stream;
var charm = require('charm');
var deepEqual = require('deep-is');

var exports = module.exports = function (opts_) {
    var fn = difflet.bind(null, opts_);
    fn.compare = function (prev, next) {
        var opts = Object.keys(opts_ || {}).reduce(function (acc, key) {
            acc[key] = opts_[key];
            return acc;
        }, {});
        var s = opts.stream = new Stream;
        var data = '';
        s.write = function (buf) { data += buf };
        s.end = function () {};
        s.readable = true;
        s.writable = true;

        difflet(opts, prev, next);
        return data;
    };
    return fn;
};

exports.compare = function (prev, next) {
    return exports({}).compare(prev, next);
};

function difflet (opts, prev, next) {
    var stream = opts.stream || new Stream;
    if (!opts.stream) {
        stream.readable = true;
        stream.writable = true;
        stream.write = function (buf) { this.emit('data', buf) };
        stream.end = function () { this.emit('end') };
    }

    if (!opts) opts = {};
    if (opts.start === undefined && opts.stop === undefined) {
        var c = charm(stream);
        opts.start = function (type) {
            c.foreground({
                inserted : 'green',
                updated : 'blue',
                deleted : 'red',
                comment : 'cyan',
            }[type]);
            c.display('bright');
        };
        opts.stop = function (type) {
            c.display('reset');
        };
    }
    var write = function (buf) {
        if (opts.write) opts.write(buf, stream)
        else stream.write(buf)
    };

    var commaFirst = opts.comma === 'first';

    var stringify = function (node, params) {
        return stringifier.call(this, true, node, params || opts);
    };
    var plainStringify = function (node, params) {
        return stringifier.call(this, false, node, params || opts);
    };

    var levels = 0;
    function set (type) {
        if (levels === 0) opts.start(type, stream);
        levels ++;
    }

    function unset (type) {
        if (--levels === 0) opts.stop(type, stream);
    }

    function stringifier (insertable, node, opts) {
        var indent = opts.indent;

        if (insertable) {
            var prevNode = traverse.get(prev, this.path || []);
        }
        var inserted = insertable && prevNode === undefined;

        var indentx;
        try {
            indentx = indent ? Array(
                ((this.path || []).length + 1) * indent + 1
            ).join(' ') : '';
        } catch (e) {
            // at times we get an invalid Array size here and need to prevent crashing
            indentx = '';
        }
        if (commaFirst) indentx = indentx.slice(indent);

        if (Array.isArray(node)) {
            var updated = (prevNode || traverse.has(prev, this.path))
                && !Array.isArray(prevNode);
            if (updated) {
                set('updated');
            }

            if (opts.comment && !Array.isArray(prevNode)) {
                indent = 0;
            }

            this.before(function () {
                if (inserted) set('inserted');
                if (indent && commaFirst) {
                    if ((this.path || []).length === 0
                    || Array.isArray(this.parent.node)) {
                        write('[ ');
                    }
                    else write('\n' + indentx + '[ ');
                }
                else if (indent) {
                    write('[\n' + indentx);
                }
                else {
                    write('[');
                }
            });

            this.post(function (child) {
                if (!child.isLast && !(indent && commaFirst)) {
                    write(',');
                }

                var prev = prevNode && prevNode[child.key];
                if (indent && opts.comment && child.node !== prev
                && (typeof child.node !== 'object' || typeof prev !== 'object')
                ) {
                    set('comment');
                    write(' // != ');
                    traverse(prev).forEach(function (x) {
                        plainStringify.call(this, x, { indent : 0 });
                    });
                    unset('comment');
                }

                if (!child.isLast) {
                    if (indent && commaFirst) {
                        write('\n' + indentx + ', ');
                    }
                    else if (indent) {
                        write('\n' + indentx);
                    }
                }
            });

            this.after(function () {
                if (indent && commaFirst) write('\n' + indentx);
                else if (indent) write('\n' + indentx.slice(indent));

                write(']');
                if (updated) unset('updated');
                if (inserted) unset('inserted');
            });
        }
        else if (isRegExp(node)) {
            this.block();

            if (inserted) {
                set('inserted');
                write(node.toString());
                unset('inserted');
            }
            else if (insertable && prevNode !== node) {
                set('updated');
                write(node.toString());
                unset('updated');
            }
            else write(node.toString());
        }
        else if (typeof node === 'object'
        && node && typeof node.inspect === 'function') {
            this.block();
            if (inserted) {
                set('inserted');
                write(node.inspect());
                unset('inserted');
            }
            else if (!(prevNode && typeof prevNode.inspect === 'function'
            && prevNode.inspect() === node.inspect())) {
                set('updated');
                write(node.inspect());
                unset('updated');
            }
            else write(node.inspect());
        }
        else if (typeof node == 'object' && node !== null) {
            var insertedKey = false;
            var deleted = insertable && typeof prevNode === 'object' && prevNode
                ? Object.keys(prevNode).filter(function (key) {
                    return !Object.hasOwnProperty.call(node, key);
                })
                : []
            ;

            this.before(function () {
                if (inserted) set('inserted');
                write(indent && commaFirst && !this.isRoot
                    ? '\n' + indentx + '{ '
                    : '{'
                );
            });

            this.pre(function (x, key) {
                if (insertable) {
                    var obj = traverse.get(prev, this.path.concat(key));
                    if (obj === undefined) {
                        insertedKey = true;
                        set('inserted');
                    }
                }

                if (indent && !commaFirst) write('\n' + indentx);

                plainStringify(key);
                write(indent ? ' : ' : ':');
            });

            this.post(function (child) {
                if (!child.isLast && !(indent && commaFirst)) {
                    write(',');
                }

                if (child.isLast && deleted.length) {
                    if (insertedKey) unset('inserted');
                    insertedKey = false;
                }
                else if (insertedKey) {
                    unset('inserted');
                    insertedKey = false;
                }

                var prev = prevNode && prevNode[child.key];
                if (indent && opts.comment && child.node !== prev
                && (typeof child.node !== 'object' || typeof prev !== 'object')
                ) {
                    set('comment');
                    write(' // != ');
                    traverse(prev).forEach(function (x) {
                        plainStringify.call(this, x, { indent : 0 });
                    });
                    unset('comment');
                }

                if (child.isLast && deleted.length) {
                    if (insertedKey) unset('inserted');
                    insertedKey = false;

                    if (indent && commaFirst) {
                        write('\n' + indentx + ', ')
                    }
                    else if (opts.comment && indent) {
                        write('\n' + indentx);
                    }
                    else if (indent) {
                        write(',\n' + indentx);
                    }
                    else write(',');
                }
                else {
                    if (!child.isLast) {
                        if (indent && commaFirst) {
                            write('\n' + indentx + ', ');
                        }
                    }
                }
            });

            this.after(function () {
                if (inserted) unset('inserted');

                if (deleted.length) {
                    if (indent && !commaFirst
                    && Object.keys(node).length === 0) {
                        write('\n' + indentx);
                    }

                    set('deleted');
                    deleted.forEach(function (key, ix) {
                        if (indent && opts.comment) {
                            unset('deleted');
                            set('comment');
                            write('// ');
                            unset('comment');
                            set('deleted');
                        }

                        plainStringify(key);
                        write(indent ? ' : ' : ':');
                        traverse(prevNode[key]).forEach(function (x) {
                            plainStringify.call(this, x, { indent : 0 });
                        });


text:
from PythonTidy import VERSION

version = VERSION
summary = 'Cleans up, regularizes, and reformats the text of Python scripts.'


text:
package integration_test

import (
	"os"
	"time"

	"github.com/cloudfoundry/libbuildpack/cutlass"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("CF PHP Buildpack", func() {
	var app *cutlass.App
	AfterEach(func() { app = DestroyApp(app) })

	Context("deploying a basic PHP app using httpd as the webserver", func() {
		BeforeEach(func() {
			app = cutlass.New(Fixtures("with_httpd"))
			app.SetEnv("COMPOSER_GITHUB_OAUTH_TOKEN", os.Getenv("COMPOSER_GITHUB_OAUTH_TOKEN"))
			PushAppAndConfirm(app)
		})

		It("succeeds", func() {
			By("shows the current buildpack version for useful info")
			Eventually(app.Stdout.String, 10*time.Second).Should(ContainSubstring("-------> Buildpack version " + buildpackVersion))

			By("installs httpd, the request web server")
			Eventually(app.Stdout.String, 10*time.Second).Should(ContainSubstring("Installing HTTPD"))

			By("logs the httpd version")
			Eventually(app.Stdout.String, 10*time.Second).Should(ContainSubstring("HTTPD " + DefaultVersion("httpd")))

			By("the root endpoint renders a dynamic message")
			Expect(app.GetBody("/")).To(ContainSubstring("PHP Version"))

			By("compresses dynamic content")
			_, headers, err := app.Get("/", map[string]string{"Accept-Encoding": "gzip"})
			Expect(err).ToNot(HaveOccurred())
			Expect(headers).To(HaveKeyWithValue("StatusCode", []string{"200"}))
			Expect(headers).To(HaveKeyWithValue("Server", []string{"Apache"}))
			Expect(headers).To(HaveKeyWithValue("Content-Encoding", []string{"gzip"}))

			By("compresses static content")
			_, headers, err = app.Get("/staticfile.html", map[string]string{"Accept-Encoding": "gzip"})
			Expect(err).ToNot(HaveOccurred())
			Expect(headers).To(HaveKeyWithValue("StatusCode", []string{"200"}))
			Expect(headers).To(HaveKeyWithValue("Server", []string{"Apache"}))
			Expect(headers).To(HaveKeyWithValue("Content-Encoding", []string{"gzip"}))
		})
	})

	Context("deploying a basic PHP app using httpd as the webserver", func() {
		BeforeEach(func() {
			app = cutlass.New(Fixtures("with_httpd"))
			app.SetEnv("COMPOSER_GITHUB_OAUTH_TOKEN", os.Getenv("COMPOSER_GITHUB_OAUTH_TOKEN"))
			app.SetEnv("BP_DEBUG", "true")
			PushAppAndConfirm(app)
		})

		It("installs the default version of httpd", func() {
			Eventually(app.Stdout.String, 10*time.Second).Should(ContainSubstring(`"update_default_version" is setting [HTTPD_VERSION]`))
		})
	})

	AssertNoInternetTraffic("with_httpd")
})


text:
var assert = require('assert')

var mnfy = require('..')
require('rimraf').sync(mnfy.tmpdir)
require('mkdirp').sync(mnfy.tmpdir)

describe('Standalone', function () {
  it('should minify JS', function () {
    return mnfy.js('function hello() { \n console.log("lol"); }').then(function (js) {
      assert.equal(js.code, 'function hello(){console.log("lol")}')
    })
  })

  it('should minify CSS', function () {
    return mnfy.css('body { box-sizing: border-box; }').then(function (css) {
      assert.equal(css.code, 'body{box-sizing:border-box}')
    })
  })

  it('should minify CSS in safe mode by default', function () {
    return mnfy.css('body { z-index: 1000; }').then(function (css) {
      assert.equal(css.code, 'body{z-index:1000}')
    })
  })

  it('should not mess with colors in fony-family', function () {
    return mnfy.css('body { font-family: Mark Pro Black }').then(function (css) {
      assert(!/#000/.test(css))
    })
  })

  it('should minify HTML', function () {
    return mnfy.html('    ').then(function (html) {
      assert.equal(html.code, ' ')
    })
  })

  it('should pass options', function () {
    return mnfy.html('    ', {
      collapseWhitespace: true
    }).then(function (html) {
      assert.equal(html.code, '')
    })
  })
})

describe('As a master/slave', function () {
  var mnfy = require('../master')

  it('should minify JS', function () {
    return mnfy.js('function hello() { \n console.log("lol"); }').then(function (js) {
      assert.equal(js.code, 'function hello(){console.log("lol")}')
    })
  })

  it('should minify CSS', function () {
    return mnfy.css('body { box-sizing: border-box; }').then(function (css) {
      assert.equal(css.code, 'body{box-sizing:border-box}')
    })
  })

  it('should minify HTML', function () {
    return mnfy.html('    ').then(function (html) {
      assert.equal(html.code, ' ')
    })
  })

  it('should pass options', function () {
    return mnfy.html('    ', {
      collapseWhitespace: true
    }).then(function (html) {
      assert.equal(html.code, '')
    })
  })
})


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Zhigly {

    public partial class Activation {

        /// <summary>
        /// Success control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlGenericControl Success;

        /// <summary>
        /// Name control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlGenericControl Name;

        /// <summary>
        /// Failure control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlGenericControl Failure;

        /// <summary>
        /// Activated control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlGenericControl Activated;
    }
}


text:
package com.tencent.connect.avatar;

// Referenced classes of package com.tencent.connect.avatar:
//            l, ImageActivity

class m
    implements Runnable
{

    final l a;

    m(l l1)
    {
        a = l1;
        super();
    }

    public void run()
    {
        ImageActivity.g(a.a);
    }
}