text:
/**
 * Support and FAQ: visit Atmel Support
 */
#include "bma020.h"
#include "bma_axis.inc.c"

static bool bma020_ioctl(sensor_t *, sensor_command_t, void *);
static bool bma020_read(sensor_t *, sensor_read_t, sensor_data_t *);
static bool bma020_set_range(sensor_hal_t *, int16_t);
static bool bma020_set_bandwidth(sensor_hal_t *, int16_t);

/** \brief Bosch BMA020 Range Table (milli-g, register value) */
static const sensor_map_t range_table [] = {
	{{2000}, RANGE_2G}, {{4000}, RANGE_4G}, {{8000}, RANGE_8G}
};

/** \brief Bosch BMA020 Bandwidth Table (hertz, register value) */
static const sensor_map_t band_table [] = {
	{{  25}, BANDWIDTH_25HZ  }, {{ 50}, BANDWIDTH_50HZ },
	{{ 100}, BANDWIDTH_100HZ }, {{190}, BANDWIDTH_190HZ},
	{{ 375}, BANDWIDTH_375HZ }, {{750}, BANDWIDTH_750HZ},
	{{1500}, BANDWIDTH_1500HZ}
};

/**
 * @brief Bosch BMA020 accelerometer driver initialization.
 *
 * This is the main initialization function for the BMA020 device.
 * The accelerometer range and bandwidth are set based on user-specified
 * values from the system configuration.
 *
 * @param sensor    Address of a sensor device descriptor.
 * @param resvd     Reserved value.
 * @return bool     true if the call succeeds, else false is returned.
 */
bool bma020_init(sensor_t *sensor, int resvd)
{
	bool status = false;

	sensor_hal_t *const hal = sensor->hal;

	if (BMA020_ID_VAL == sensor_bus_get(hal, BMA020_CHIP_ID)) {
		/* Set the driver function table and capabilities pointer. */
		static const sensor_device_t bma020_device = {
			.func.read        = bma020_read,
			.func.ioctl       = bma020_ioctl,

			.caps.feature     = SENSOR_CAPS_3_AXIS     |
					SENSOR_CAPS_SELFTEST   |
					SENSOR_CAPS_HI_G_EVENT |
					SENSOR_CAPS_LO_G_EVENT,

			.caps.vendor      = SENSOR_VENDOR_BOSCH,
			.caps.range_table = range_table,
			.caps.band_table  = band_table,
			.caps.range_count = ARRAYSIZE(range_table),
			.caps.band_count  = ARRAYSIZE(band_table),
			.caps.units       = SENSOR_UNITS_g0,
			.caps.scale       = SENSOR_SCALE_milli,
			.caps.name = "BMA020 Digital, triaxial acceleration sensor"
		};

		sensor->drv = &bma020_device;

		/* Set the driver (device) default range, bandwidth, and
		 * resolution.
		 */
		hal->range      = 2000; /* milli-g */
		hal->bandwidth  = 25;   /* Hertz */
		hal->resolution = BMA020_DATA_RESOLUTION;

		bma020_set_range(hal, 0);
		bma020_set_bandwidth(hal, 0);

		/* Set the device burst read base address. */
		hal->burst_addr = BMA020_ACC_X_LSB;

		status = (STATUS_OK == hal->bus.status);
	}

	return status;
}

/**
 * @brief Read accelerometer device ID and revision numbers.
 *
 * This function reads the accelerometer hardware identification registers
 * and returns these values in the specified data structure.
 *
 * @param hal       Address of an initialized sensor hardware descriptor.
 * @param data      Address of sensor_data_t structure to return values.
 * @return bool     true if the call succeeds, else false is returned.
 */
static bool bma020_device_id(sensor_hal_t *hal, sensor_data_t *data)
{
	data->device.id      = sensor_bus_get(hal, BMA020_CHIP_ID);
	data->device.version = sensor_bus_get(hal, BMA020_CHIP_VERSION);

	return true;
}

/**
 * @brief Read accelerometer vector data.
 *
 * This function obtains accelerometer data for all three axes of the Bosch
 * device.  The data is read from six device registers using a multi-byte
 * bus transfer.  The 10-bit raw results are then assembled from the two
 * register values for each axis, including extending the sign bit, to
 * form a signed 32-bit value.
 *
 * Along with the actual sensor data, the LSB byte contains a "new" flag
 * indicating if the data for this axis has been updated since the last
 * time the axis data was read.  Reading either LSB or MSB data will
 * clear this flag.
 *
 * @param hal      Address of an initialized sensor hardware descriptor.
 * @param data      The address of a vector storing sensor axis data.
 * @return bool     true if the call succeeds, else false is returned.
 */
static bool bma020_get_accel(sensor_hal_t *hal, sensor_data_t *data)
{
	bma_axis_t axis [3];

	size_t const count = sensor_bus_read(hal, hal->burst_addr,
			axis, sizeof(axis));

	format_axis_data(hal, axis, data);

	return (count == sizeof(axis));
}

/**
 * @brief Read sensor data
 *
 * This routine calls the appropriate internal data function to obtain
 * the specified type of data from the sensor device.
 *
 * @param sensor    Address of an initialized sensor device descriptor.
 * @param type      Type of sensor data to read.
 * @param data      The address where data values are returned.
 * @return bool     true if the call succeeds, else false is returned.
 */
static bool bma020_read(sensor_t *sensor, sensor_read_t type,
		sensor_data_t *data)
{
	sensor_hal_t *const hal = sensor->hal;

	switch (type) {
	case SENSOR_READ_ACCELERATION:
		return bma020_get_accel(hal, data);

	case SENSOR_READ_ID:
		return bma020_device_id(hal, data);

	default:
		sensor->err = SENSOR_ERR_FUNCTION;
		return false;
	}
}

/**
 * @brief Set the BMA020 full scale acceleration range.
 *
 * @param hal       Address of an initialized sensor hardware descriptor.
 * @param range     The index of a driver-specific range table entry.
 * @return bool     true if the call succeeds, else false is returned.
 */
static bool bma020_set_range(sensor_hal_t *hal, int16_t range)
{
	/*
	 * After changing the full scale range it takes (1/(2 * bandwidth))
	 * to overwrite the data registers with filtered data according to
	 * the selected bandwidth.
	 */
	uint8_t const ctrl4_range
		= ~(CTRL4_RANGE)&sensor_bus_get(hal, BMA020_CTRL4);

	sensor_bus_put
		(hal, BMA020_CTRL4,
			ctrl4_range | range_table[range].reserved_val);

	return true;
}

/**
 * @brief Set the BMA020 ADC output data bandwidth
 *
 * @param hal      Address of an initialized sensor hardware descriptor.
 * @param band     The index of a driver-specific bandwidth table entry.
 * @return bool    true if the call succeeds, else false is returned.
 */
static bool bma020_set_bandwidth(sensor_hal_t *hal, int16_t band)
{
	/* Set the device sample frequency. */
	uint8_t const ctrl4_bw
		= ~(CTRL4_BANDWIDTH)&sensor_bus_get(hal, BMA020_CTRL4);

	sensor_bus_put
		(hal, BMA020_CTRL4, ctrl4_bw | band_table[band].reserved_val);

	return true;
}

/**
 * @brief BMA020 ioctl control entry point
 *
 *
 * @param hal       Address of an initialized sensor device descriptor.
 * @param cmd       Command to execute
 * @param arg       Argument for command (varies)
 * @return bool     true if the call succeeds, else false is returned.
 */
static bool bma020_ioctl(sensor_t *sensor, sensor_command_t cmd,
		void *arg)
{
	sensor_hal_t *const hal = sensor->hal;
	sensor_data_t sample = {.scaled = true};

	switch (cmd) {
	case SENSOR_SET_RANGE:
		return bma020_set_range(hal, *((uint16_t *)arg));

	case SENSOR_SET_BANDWIDTH:
		return bma020_set_bandwidth(hal, *((uint16_t *)arg));

	case SENSOR_READ_VECTOR:
		if (bma020_get_accel(hal, &sample)) {
			vector3_t *const pvec = (vector3_t *)arg;
			pvec->x = sample.axis.x;
			pvec->y = sample.axis.y;
			pvec->z = sample.axis.z;
			return true;
		} else {
			return false;
		}

	default:
		sensor->err = SENSOR_ERR_UNSUPPORTED;
		return false;
	}
}


text:
module Spree
  class PaysbuyTransaction < ActiveRecord::Base
    has_many :payments, :as => :source
    attr_accessible :ap_code, :result, :amount, :fee, :method, :confirm_cs

    def actions
      []
    end

    def self.create_from_postback(params)
       PaysbuyTransaction.create(:ap_code => params[:apCode],
                               :result => params[:result],
                               :amount => params[:amt],
                               :fee => params[:fee],
                               :method => params[:method],
                               :confirm_cs => params[:confirm_cs]
                              )
    end

  end
end

redpajama_set_name: RedPajamaGithub


text:
<tool id="hicexplorer_hicmergematrixbins" name="@BINARY@" version="@WRAPPER_VERSION@.0">
    <description>merge adjacent bins from a Hi-C contact matrix to reduce its resolution</description>
    <macros>
        <token name="@BINARY@">hicMergeMatrixBins</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        hicMergeMatrixBins
            --matrix '$matrix_h5_cooler'
            --numBins $numBins
            $runningWindow
            --outFileName matrix.$outputFormat
        && mv matrix.$outputFormat matrix

]]>
    </command>
    <inputs>
        <expand macro='matrix_h5_cooler_macro' />

        <param argument="--numBins" type="integer" min="1" value="3" label="Number of bins to merge" />
        <param argument="--runningWindow" type="boolean" falsevalue="" truevalue="--runningWindow" label="Set to merge for using a running window of length --numBins. Usually not set." />
        <param name='outputFormat' type='select' label="Output file format">
            <option value='h5' selected='true'>HiCExplorer format</option>
            <option value="cool">cool</option>
        </param>
    </inputs>
    <outputs>
        <data name="outFileName" from_work_dir="matrix" format="h5">
              <change_format>
                <when input="outputFormat" value="cool" format="cool" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
            <param name="numBins" value="5" />
            <output name="outFileName" file="hicMergeMatrixBins_result1.npz.h5" ftype="h5" compare="sim_size" delta="24000" />
        </test>
    </tests>
    <help><![CDATA[

Change matrix resolution
========================

**hicMergeMatrixBins** is used to decrease the resolution of a matrix. With this tool, you can for example create out of a 100 kb
contact matrix a 1000 kb one:

Number of bins to merge = 10

100 kb * 10 = 1000 kb = 1 Mb

Depending on the downstream analyses to perform on a Hi-C matrix generated with HiCExplorer, one might need different bin resolutions. For example using ``hicPlotMatrix`` to display chromatin interactions of a whole chromosome will not produce any meaningful vizualisation if it is performed on a matrix at restriction sites resolution (unmerged). Furthermore, the higher the resolution of a matrix, the more detailed it is, which can make it
difficult to interpret, especially if the read depth of the Hi-C data is not high enough. **hicMergeMatrixBins** address these issues by merging a given number of adjacent bins to reduce Hi-C matrices resolution.

_________________

Usage
-----

To limit the loss of information, it is mandatory to perform **hicMergeMatrixBins** on matrices prior to any correction and any other bin merging (direct output from ``hicBuildMatrix``). After bin merging, ``hicCorrectMatrix`` must be used for downstream analyses requiring corrected matrices.

_________________

Output
------

**hicMergeMatrixBins** outputs a Hi-C matrix with reduced resolution.

Below, we will develop the example of a Hi-C matrix in *Drosophila melanogaster* that we want to display at the whole X-chromosome scale and at the scale of a 1Mb region of the X chromosome. To do this, we performed two different bin merging using **hicMergeMatrixBins** on an uncorrected matrix built at the restiction sites resolution using ``hicBuildMatrix``.

Starting from a matrix with bins of a median length of 529bp (restriction enzyme resolution, here DpnII), running **hicMergeMatrixBins** with a number of bins to merge of 3 produced a matrix with bins of a median length of 1661bp, while **hicMergeMatrixBins** with a number of bins to merge of 50 produced a matrix with bins of a median length of 29798bp.

After the correction of these three matrices using ``hicCorrectMatrix``, we plotted them using ``hicPlotMatrix`` at the scale of the whole X-chromosome and at the scale of the X:2000000-3000000 region to see the effect of bin merging on the interactions visualization.

- **Effect of bins merging at the scale of a chromosome:**

.. image:: $PATH_TO_IMAGES/hicMergeMatrixBins_Xchr.png
   :width: 60 %

When observed altogether, the plots above show that the merging of bins by 50 is the most adequate way to plot interactions for a whole chromosome in *Drosophila melanogaster* when starting from a matrix with bins of a median length of 529bp.

- **Effect of bins merging at the scale of a specific region:**

.. image:: $PATH_TO_IMAGES/hicMergeMatrixBins_Xregion.png
   :width: 60 %

When observed altogether, the plots above show that the merging of bins by 3 is the most adequate way to plot interactions for a region of 1Mb in Drosophila melanogaster when starting from a matrix with bins of a median length of 529bp.

_________________

| For more information about HiCExplorer please consider our documentation on readthedocs.io_

.. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
]]></help>
    <expand macro="citations" />
</tool>


text:
module RailsCaptcha
  class ApplicationController < ActionController::Base
  end
end


text:
<?php

namespace Alexpechkarev\GoogleGeocoder;

use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;

class GoogleGeocoderServiceProvider extends ServiceProvider {

    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        AliasLoader::getInstance()->alias('Geocoder','Alexpechkarev\GoogleGeocoder\Facades\GoogleGeocoderFacade');
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('GoogleGeocoder', function($app)
        {
            $config = array();
            $config['applicationKey']   = Config::get('google-geocoder.applicationKey');
            $config['requestUrl']       = Config::get('google-geocoder.requestUrl');

            // Throw an error if request URL is empty
            if (empty($config['requestUrl'])) {
                throw new \InvalidArgumentException('Request URL is empty, please check your config file.');
            }

            return new GoogleGeocoder($config);
        });
    }

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

}


text:
#ifndef __included_svm_h__
#define __included_svm_h__

#include <pthread.h>
#include <vppinfra/clib.h>
#include <vppinfra/mem.h>
#include <svm/svm_common.h>

#define MMAP_PAGESIZE (clib_mem_get_page_size())

static inline void *
svm_mem_alloc (svm_region_t * rp, uword size)
{
  clib_mem_heap_t *oldheap;
  ASSERT (rp->flags & SVM_FLAGS_MHEAP);
  u8 *rv;

  pthread_mutex_lock (&rp->mutex);
  oldheap = clib_mem_set_heap (rp->data_heap);
  rv = clib_mem_alloc (size);
  clib_mem_set_heap (oldheap);
  pthread_mutex_unlock (&rp->mutex);
  return (rv);
}

static inline void
svm_mem_free (svm_region_t * rp, void *ptr)
{
  clib_mem_heap_t *oldheap;
  ASSERT (rp->flags & SVM_FLAGS_MHEAP);

  pthread_mutex_lock (&rp->mutex);
  oldheap = clib_mem_set_heap (rp->data_heap);
  clib_mem_free (ptr);
  clib_mem_set_heap (oldheap);
  pthread_mutex_unlock (&rp->mutex);

}

static inline void *
svm_push_pvt_heap (svm_region_t * rp)
{
  clib_mem_heap_t *oldheap;
  oldheap = clib_mem_set_heap (rp->region_heap);
  return ((void *) oldheap);
}

static inline void *
svm_push_data_heap (svm_region_t * rp)
{
  clib_mem_heap_t *oldheap;
  oldheap = clib_mem_set_heap (rp->data_heap);
  return ((void *) oldheap);
}

static inline void
svm_pop_heap (void *oldheap)
{
  clib_mem_set_heap (oldheap);
}

#endif /* __included_svm_h__ */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

using Xamarin.Forms;

namespace PrinterPortable.QPrinter.WinPhone
{
	public partial class MainPage
		:
		//PhoneApplicationPage
		 global::Xamarin.Forms.Platform.WinPhone.FormsApplicationPage // superclass new in 1.3
	{
		public MainPage()
		{
			InitializeComponent();

			SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;

	        global::Xamarin.Forms.Forms.Init();
	        LoadApplication(new HeartRate.Polar.HR7.App()); // new in 1.3

	        return;
		}
	}
}


text:
Distributed Dependent Data Maintenance Tool

## What is it?

`dddmt` is a workflow support tool for Big Data. It has the following three major functions:

* check dependencies between dynamically mutating data sets
* launch rebuild if needed
* provide status information

Each of these data sets may be located:

* On a local file system
* On a HDFS
* On a remote file system (FTP and SFTP are supported)

Rebuild may be one of

* Copy from one FS to the other
* MapReduce/Spark/Generic OS Task

The main purpose of this tool's existence is optimization. Only those rebuild processes are launched that are actually needed.

## Use cases?

* Collecting and processing log files from a distributed remote system or a remote file storage


text:
function RegionWhereisDamaged_compareTstats_indiv

RegionWhereisDamaged_compareTstats_indiv(1:2,'ad','individual','png')
RegionWhereisDamaged_compareTstats_indiv(1:23,'rd','individual','png')
RegionWhereisDamaged_compareTstats_indiv(1:23,'fa','individual','png')

%
% RegionWhereisDamaged_compareTstats_indiv(1:23,'ad','JMD','png')
% RegionWhereisDamaged_compareTstats_indiv(1:23,'rd','JMD','png')
% RegionWhereisDamaged_compareTstats_indiv(1:23,'fa','JMD','png')
%
% RegionWhereisDamaged_compareTstats_indiv(1:23,'ad','CRD','png')
% RegionWhereisDamaged_compareTstats_indiv(1:23,'rd','CRD','png')
% RegionWhereisDamaged_compareTstats_indiv(1:23,'fa','CRD','png')


text:
T5.Registry.register('generator', 'osm.cloudmade', function(view, params) {
    var urlFormatter;

    // ensure we have parameters
    params = params || {};

    // initialise the apikey and style
    params.apikey = params.apikey || null;
    params.styleid = params.styleid || 1;

    urlFormatter = formatter('http://{{3}}.tile.cloudmade.com/{{0}}/{{1}}/{{2}}/');
    view.addCopy('This product uses the CloudMade APIs, but is not endorsed or certified by CloudMade.');

    return cog.extend(T5.Registry.create('generator', 'osm', view, params), {
        getServerDetails: function() {
            return {
                baseUrl: urlFormatter(params.apikey, params.styleid, 256, '{{0}}'),
                subDomains: ['a', 'b', 'c']
            };
        }
    });
});


text:
<!DOCTYPE html>

		<title>Correo Yahoo - Correo electrónico gratuito con 1 TB de almacenamiento</title>
        <meta name="description" content="Consigue una cuenta gratuita de correo electrónico de Correo Yahoo. Incluye 1 TB de almacenamiento gratuito, potentes funciones de spam y seguridad, herramientas sencillas que para gestionar el correo, y aplicaciones para iPhone, iPad y Android para móviles y tabletas que te ayudan a acceder a la bandeja de entrada en cualquier momento." />
        <meta name="keywords" content="correo electrónico, correo electrónico nuevo, cuenta de correo electrónico nueva, nueva dirección de correo electrónico, correo electrónico gratuito, cuentas de correo electrónico gratuitas, dirección de correo electrónico gratuitas, correos electrónicos gratuitos, registración del correo de yahoo, aplicación del correo de yahoo, aplicación móvil del correo de yahoo, aplicación de android del correo de yahoo, aplicación de iphone del correo de yahoo, aplicación de ios del correo de yahoo, filtro de correo no deseado, funciones de seguridad" />
        <meta property="og:image" content="https://s.yimg.com/nq/overview-page/2/overview-page/enhancr-overview-image.png" />
	    <link rel="stylesheet" href="https://yui-s.yahooapis.com/pure/0.4.2/pure-nr-min.css">
	    <link rel="stylesheet" href="https://s.yimg.com/nq/assets/micro2/v89/css/overview2.css">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	    <meta name="apple-itunes-app" content="app-id=577586159">

Descárgate la app

Conectar buzones

Funciones

Asistencia

Iniciar sesión

Inscríbete

	    <video class="video-bg" autoplay="true" loop="true" preload="auto">
	        <source src="https://s.yimg.com/dh/ap/mail/overview/create_background.mp4" type="video/mp4">
	    </video>

Correo Yahoo. Tu refugio interior.

Mantente organizado durante el día con Correo Yahoo.
Conecta todas tus cuentas, comparte fotos y archivos GIF animados con facilidad y obtén 1000 GB de almacenamiento.

Conecta todas tus cuentas, comparte fotos y archivos GIF animados con facilidad y obtén 1000 GB de almacenamiento.

                    <input type="text" placeholder="Elige tu nombre de usuario" name="username" id="username" class="left"/>

Comprobando...

Ir

La aplicación Correo Yahoo

Bella, sencilla de usar y veloz como el rayo. La aplicación Correo Yahoo facilita el envío de fotos de alta resolución, el cambio de buzón y el ingreso seguro, sin necesidad de contraseña.

Menos tiempo dedicado al correo electrónico. Más tiempo dedicado en ti.

                No revises más varios buzones. Conecta todos tus buzones a Correo Yahoo, lo que incluye Gmail, Outlook, Hotmail y AOL.

            Más información

Más información

Explora tus funciones

Todas las herramientas que necesitas para dar un toque de aire fresco a tu experiencia con el correo.

Novedades

La bandeja de entrada

Búsqueda

Escribir

Agenda

Contactos

Almacenamiento

Seguridad

Llénate de colores alegres

Ilumina tu día con los nuevos temas coloridos en Correo Yahoo.

¿La pantalla es demasiado brillante? Personalízala con una amplia gama de opciones de colores, como formas modernas más oscuras o temas intensos y brillantes.

		    Probar nuevos colores

La bandeja de entrada

                Bienvenido a tu correo electrónico. Personaliza tu bandeja de entrada con temas increíbles y organiza tu correo como te resulte más útil. Accede rápidamente a las herramientas que utilizas cada día, como el Calendario, Bloc de notas, Contactos, Mensajes instantáneos y la herramienta Buscar. Nuestra barra de herramientas y las acciones rápidas para mensajes hacen más sencillo ordenar, seleccionar y eliminar los correos con solo unos pocos clics.

Exploración

Carpetas

Multitareas

Personalización

Tu Bandeja de entrada, Contactos, Calendario, Bloc de notas y Messenger están agrupados en la esquina superior izquierda, para que puedas cambiar entre tareas con un solo clic. Si recibes un mensaje instantáneo nuevo mientras lees un correo electrónico, haz clic en el icono de Messenger para abrir una ventana aparte qué no te hará perder tu trabajo.

Mantén la bandeja de entrada atractiva y ordenada con carpetas. Archiva mensajes importantes o haz un seguimiento de los correos a los que necesites acceder con rapidez. Tus carpetas están siempre accesibles haciendo más fácil que encuentres lo que necesitas cuando lo necesitas.

Las pestañas permiten navegar rápidamente entre correos electrónicos, borradores, búsquedas, contactos y la agenda, todo en una ventana. Para activar las pestañas, ir a Ver, Multitarea y seleccionar Pestañas.

Personaliza tu buzón. En el menú Vista, personaliza el diseño, la manera en la que ordenas tus correos y cómo previsualizas tus mensajes. Elige la mejor forma de hacer un seguimiento de tu trabajo con Pestañas o Recientes. Y con la gran cantidad de hermosos temas para elegir, puedes personalizar el aspecto de tu buzón en todos tus dispositivos.

Búsqueda

                Filtra cientos de correos electrónicos en segundos. Con la herramienta de búsqueda de Correo Yahoo, puedes encontrar el mensaje, el documento o la foto que estás buscando más fácil, independientemente de la fecha en la que los hayas recibido o enviado.

Búsqueda por palabra clave

Búsqueda en la web

Cuando sepas de qué trata un correo, pero no estés seguro de quién lo envió, prueba buscándolo por una palabra clave. Ahorra tiempo de desplazamientos introduciendo simplemente una palabra que sepas que aparece en el correo y deja que nuestra búsqueda inteligente lo encuentre por ti. Por ejemplo, supongamos que intentas buscar un correo sobre una reunión. En el campo de búsqueda de la parte superior de tu correo electrónico, escribe la palabra "reunión" y pulsa el botón "Buscar mensajes". Verás una lista de resultados con todos los correos electrónicos en los que se menciona esa palabra clave.

Nuestra búsqueda doble permite buscar en el correo o en Internet con un solo clic. Así, si estás redactando una invitación en el calendario para una cena y quieres buscar en Internet un buen restaurante en los alrededores, escribe tu consulta en el campo de búsqueda y selecciona Buscar en Internet para abrir una pestaña nueva en el navegador con los resultados de tu búsqueda.

Escribir

                Escribir un correo electrónico debe ser personal y productivo. Con Correo Yahoo, nuestra función de Escribir te permite crear y mejorar tu mensaje con hermosas previsualizaciones de enlaces y opciones de formato. Además, con la integración de Dropbox y Flickr, puedes adjuntar archivos, documentos y fotos más rápido que nunca.

Archivos adjuntos

Vista previa de archivos adjuntos

Envía archivos con total confianza. Con 1 TB de espacio libre, nunca tendrás que preocuparte por enviar o recibir archivos de gran tamaño y quedarte sin espacio. Adjunta fácilmente fotos o documentos desde el ordenador pulsando en el icono del clip o desde Flickr o Dropbox haciendo clic en el menú desplegable. También puedes arrastrar y soltar archivos desde el ordenador al área Redactar y adjuntarlos en un momento.

Todos los días, millones de personas envían y reciben adjuntos en Correo Yahoo. Previsualiza rápidamente los adjuntos de Microsoft Office (Word, PowerPoint y Excel) y Adobe PDF directamente en la vista del mensaje. ¡Haz clic en el nombre del archivo y listo! Verás una previsualización completa de tu documento.

Agenda

                El Calendario de Yahoo tiene las herramientas que necesitas para ayudarte a administrar y organizar tu horario.

Entrada de agenda

Diferentes agendas

Recibe recordatorios de cumpleaños, aniversarios y citas, y nunca vuelvas a olvidarte de un evento importante. Con el calendario de Yahoo puedes crear entradas haciendo clic en la hora y la fecha en las que tendrá lugar el evento. Añade el título y la ubicación del evento y selecciona Añadir más detalles para ver opciones para invitar personas al evento o para añadir un recordatorio de alerta.

Hay personas que utilizan su calendario para administrar sus citas personales, sus programas de trabajo y estudio y sus eventos familiares. Te hemos simplificado la creación y etiquetado de entradas de calendario para que puedas mantener rápidamente un seguimiento de varias partes de tu vida y administrarlas. Para crear un calendario nuevo simplemente haz clic en el icono de engranaje situado junto a Calendarios. Elige un nombre y un color y guárdalo.

Tus contactos

                Mantente en contacto con tu red personal. Nuestra función de importación de dos pasos te permite agregar contactos desde tu cuenta de Facebook o desde otros proveedores de correo electrónico como Gmail o Outlook, lo que facilita el cambio de cuentas de correo electrónico.

Contactos mejorados

Importar contactos

En el perfil de cada contacto, encontrarás una instantánea de tus interacciones más recientes con ellos, como mensajes, imágenes y archivos. Así que si tuviste una conversación de correo electrónico con un amigo sobre las próximas vacaciones, simplemente navega entre tus contactos y selecciona el nombre de tu amigo para ver rápidamente los últimos correos electrónicos y los adjuntos que te enviaron sobre el viaje.

Organiza todos tus contactos desde un solo lugar. En la sección Contactos, haz clic en Importar contactos para elegir el proveedor del cual desees importar tus contactos: Facebook, Google, Outlook, otra cuenta de Yahoo o carga un archivo .csv o .vcf.

Almacenamiento

                Correo Yahoo te da más almacenamiento gratuito que cualquier otro proveedor de correo electrónico. Con 1 TB de espacio libre (¡eso son 1000 GB!), nunca tendrás que preocuparte por tener que eliminar correos electrónicos para ahorrar espacio.

Almacenamiento de 1 TB

                Guarda todos los correos electrónicos y archivos que te enviaron. Para verificar cuánto almacenamiento tienes, ve a Configuración, debajo de Cuentas verás el porcentaje de almacenamiento utilizado.

Seguridad

                Correo Yahoo emplea la mejor tecnología en seguridad para mantenerte seguro cuando estés en línea. El cifrado SSL mantiene tu correo seguro mientras pasa del navegador web de tu computadora a los servidores de Yahoo. Esto significa que, independientemente de donde te encuentres, ya sea que estés en tu hogar o revisando correos en un bar, la información de tu correo se mantiene segura.

SSL

                     Cada vez que usas Correo Yahoo, ya sea en la web desde tu computadora o desde un dispositivo móvil, en aplicaciones móviles o mediante IMAP, POP o SMTP, cuentas de forma predeterminada con un cifrado total y una protección con certificados de 2048 bits. Este cifrado cubre tus correos electrónicos, adjuntos y contactos, además de la Agenda y Messenger en Mail.

 Filtros de spam

                    Correo Yahoo bloquea más de 15 000 millones de mensajes spam a diario. Usamos aprendizaje automático y ajustamos y mejoramos nuestras tecnologías de filtrado que bloquean spam y demás correos malintencionados que no quisieras ver. Puedes entrenar los filtros haciendo clic en el botón Spam cada vez que te encuentras con correos electrónicos no deseados en tu buzón.

            ¿Quieres más funciones? En nuestro Directorio de funciones, podrás aprender a usar todas las herramientas potentes de Correo Yahoo.

Seguir Correo Yahoo

Tumblr

Facebook

Twitter

Política de privacidad

Acerca de nuestros anuncios

Condiciones del servicio


text:
option(ENABLE_FC_SUPPORT "Enable Fortran language support" ON)

if(ENABLE_FC_SUPPORT)
    enable_language(Fortran)

    set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/modules)
    include_directories(${PROJECT_BINARY_DIR}/modules)

    if(NOT DEFINED CMAKE_Fortran_COMPILER_ID)
        message(FATAL_ERROR "CMAKE_Fortran_COMPILER_ID variable is not defined!")
    endif()

    if(NOT CMAKE_Fortran_COMPILER_WORKS)
        message(FATAL_ERROR "CMAKE_Fortran_COMPILER_WORKS is false!")
    endif()

    if(DEFINED EXTRA_FCFLAGS)
      if(NOT EXTRA_FCFLAGS STREQUAL "")
        set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${EXTRA_FCFLAGS}")
      endif()
    endif()

    if(DEFINED ENV{FCFLAGS})
        message(STATUS "FCFLAGS is set to '$ENV{FCFLAGS}'.")
        set(CMAKE_Fortran_FLAGS "$ENV{FCFLAGS}")
    endif()
else()
    # workaround to avoid unused warning
    if(DEFINED EXTRA_FCFLAGS)
        set(_unused ${EXTRA_FCFLAGS})
        unset(_unused)
    endif()
endif()


text:
The Boundary Layer
==================

.. todo:: flesh out

Designing good DTOs
-------------------

DTOs have no business logic. Think of them as language constructs around
simple requests not dependent of any protocol.

In our Go program, the naming convention is to have a service "Foobar"
(in caps, can be a pluralized noun), and have it in
``service/foobar.go``, and its request and response models are *all* in
``service/requests/foobar.go`` and ``service/responses/foobar.go``.

Though these interfaces are named similarly, in Go, we refer to these
types as ``requests.FindGopher``, hence it is never ambiguous as to what
the structures are. The ``requests`` (or responses) packages contain
only structures like these, hence there will never be any confusion
between the two.

In other languages, you would usually have a suffix of some sorts or use
a namespace explicitly to avoid repetition.

Wrapping up
-----------

The service layer is the common language of the application
architecture. When the API and core speak to each other, they do so via
an abstract boundary. They use DTOs (data transfer objects), simple
structures of data, for communication. We now move on to the core layer
of the architecture.


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Phoebe.Core.Entity
{
    using Phoebe.Base.Framework;
    using SqlSugar;

    /// <summary>
    /// 编号记录类
    /// </summary>
    public class SequenceRecord : IBaseEntity<string>
    {
        #region Property
        /// <summary>
        /// ID
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
        [Display(Name = "ID")]
        public string Id { get; set; }

        /// <summary>
        /// 模板ID
        /// </summary>
        [SugarColumn(ColumnName = "TemplateId")]
        [Display(Name = "模板ID")]
        public string TemplateId { get; set; }

        /// <summary>
        /// 表名
        /// </summary>
        [SugarColumn(ColumnName = "TableName")]
        [Display(Name = "表名")]
        public string TableName { get; set; }

        /// <summary>
        /// 当前日期
        /// </summary>
        [SugarColumn(ColumnName = "CurrentDate")]
        [Display(Name = "当前日期")]
        public string CurrentDate { get; set; }

        /// <summary>
        /// 当前编号
        /// </summary>
        [SugarColumn(ColumnName = "CurrentSequence")]
        [Display(Name = "当前编号")]
        public int CurrentSequence { get; set; }
        #endregion //Property
    }
}


text:
<?php
namespace frontend\modules\user\models\forms;

use frontend\modules\user\Module;
use common\models\User;
use Yii;
use \yii\base\Model;

/**
 * Login form
 */
class LoginForm extends Model
{
	/** @var */
	public $email;
	/** @var */
	public $password;
	/** @var bool */
	public $rememberMe = true;
	/** @var bool */
	private $_user = false;

	/**
	 * @inheritdoc
	 */
	public function rules()
	{
		return [
			[['email', 'password'], 'required'], // username and password are both required
			['rememberMe', 'boolean'], // rememberMe must be a boolean value
			['password', 'validatePassword'], // password is validated by validatePassword()
		];
	}

	/**
	 * Validates the password.
	 * This method serves as the inline validation for password.
	 *
	 * @param string $attribute the attribute currently being validated
	 * @param array $params the additional name-value pairs given in the rule
	 */
	public function validatePassword($attribute, $params)
	{
		if (!$this->hasErrors()) {
			$user = $this->getUser();
			if (!$user || !$user->validatePassword($this->password)) {
				$this->addError($attribute, Module::t('user', 'Incorrect email or password.'));
			}
		}
	}

	/**
	 * Logs in a user using the provided email and password.
	 *
	 * @return boolean whether the user is logged in successfully
	 */
	public function login()
	{
		if ($this->validate()) {
			return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
		} else {
			return false;
		}
	}

	/**
	 * Finds user by [[username]]
	 *
	 * @return User|null
	 */
	public function getUser()
	{
		if ($this->_user === false) {
			$this->_user = User::findByEmail($this->email);
		}

		return $this->_user;
	}

	/**
	 * @return array
	 */
	public function attributeLabels()
	{
		return [
			'email'   => Module::t('login', 'Email'),
			'password'   => Module::t('login', 'Password'),
			'rememberMe' => Module::t('login', 'Remember Me'),
		];
	}
}


text:
================
Session Handling
================

Flow has excellent support for working with sessions.

This chapter will explain:

* ... how to store specific data in a session
* ... how to store objects in the session
* ... how to delete sessions

Scope Session
=============

Flow does not only support the ``prototype`` and ``singleton`` object scopes, but also the
object scope ``session``. Objects marked like this basically behave like ``singleton`` objects
which are automatically serialized into the user's session.

As an example, when building a shopping basket, the class could look as follows::

	/**
	 * @Flow\Scope("session")
	 */
	class ShoppingBasket {

		/**
		 * @var array
		 */
		protected $items = array();

		/**
		 * @param string $item
		 * @return void
		 * @Flow\Session(autoStart = TRUE)
		 */
		public function addItem($item) {
			$this->items[] = $item;
		}

		/**
		 * @return array
		 */
		public function getItems() {
			return $this->items;
		}
	}

In the above example

* the object scope is set to ``session``, so it behaves like a *user-bound cross-request
  singleton*. This ``ShoppingBasket`` can now be injected where it is needed using *Dependency
  Injection*.
* We only want to start a session when the first element is added to the shopping basket.
  For this the addItem() method needs to be annotated with ``@Flow\Session(autoStart = TRUE)``.

When a user browses the website, the following then happens:

* First, the user's shopping basket is empty, and getItems() returns an empty array.
  No session exists yet. For each page being requested, the ``ShoppingBasket`` is
  newly initialized.

* As soon as the user adds something to the shopping basket, ``addItem()`` is called.
  Because this is annotated with ``@Flow\Session(autoStart = TRUE)``, a new PHP session
  is started, and the ShoppingBasket is placed into the session.

* As the user continues to browse the website, the ``ShoppingBasket`` is being fetched
  from the user's session (which exists now). Thus, ``getItems()`` returns the items
  from the session.

.. admonition:: Why is ``@Flow\Session(autoStart = TRUE)`` necessary?

	If Flow did not have this annotation, there would be no way for it to determine
	when a session must be started. Thus, every user browsing the website would
	*always* need a session as soon as an object of scope ``session`` is accessed.
	This would happens if the ``session``-scoped object is still in its initial state.

	To be able to use proxies such as Varnish, Flow defers the creation of a
	session to a point in time when it is really needed -- and the developer needs
	to tell the framework when that point is reached using the above annotation.

The Flow session scope handles persistent objects and dependency injection correctly:

* Objects which are injected via Dependency Injection are removed before serialization
  and re-injected on deserialization.

* Persistent objects which are unchanged are just stored as a reference and fetched
  from persistence again on deserialization.

* Persistent objects which are modified are fully stored in the session.

Low-level session handling
==========================

It is possible to inject the ``Neos\Flow\Session\SessionInterface`` and interact
with the session on a low level, by using ``start()``, ``getData()`` and ``putData()``.

That should rarely be needed, though. Instead of manually serializing objects object into
the session, the *session scope* should be used whenever possible.

Session Backends
================

The session implementation of Flow is written in pure PHP and uses the caching
framework as its storage. This allows for storing session data in a variety of
backends, including PDO databases, APC and Redis.

The preferred storage backend for the built-in session is defined through a custom
Caches.yaml file, placed in a package or the global configuration directory:

.. code-block:: yaml

	Flow_Session_Storage:
	  backend: Neos\Cache\Backend\RedisBackend

The built-in session implementation provides a few more configuration options, related to
the session cookie and the automatic garbage collection. Please refer to the
Settings.yaml file of the Flow package for a list of all possible options and
their respective documentation.

Session Storage
===============

.. note::

	Since Flow 5.2 Sessions are no longer destroyed by default when caches are flushed. This is
	due to the session caches being marked as "persistent". This previously lead to all sessions
	being destroyed on each deployment, which was undesireable.

If you deploy changes that change the structure of data that is stored in the session or the class
of an `@Flow\scope("session")` object, you need to manually destroy sessions to avoid deserialization
errors. You can do this by running `./flow flow:session:destroyAll` or manually deleting the folder
where the sessions are stored.

Also, sessions are shared among the application contexts, e.g. `Development` and `Production`, so if
your use case requires to have sessions separated for different contexts, you need to configure the
`cacheDirectory` backend option for the `Flow_Session_Storage` and `Flow_Session_MetaData` caches for
each individual context. Please refer to the :doc:`Caching` section of this guide for further information.


text:
package iterator

// Defines one of the base iterators, the HasA iterator. The HasA takes a
// subiterator of links, and acts as an iterator of nodes in the given
// direction. The name comes from the idea that a "link HasA subject" or a "link
// HasA predicate".
//
// HasA is weird in that it may return the same value twice if on the Next()
// path. That's okay -- in reality, it can be viewed as returning the value for
// a new quad, but to make logic much simpler, here we have the HasA.
//
// Likewise, it's important to think about Contains()ing a HasA. When given a
// value to check, it means "Check all predicates that have this value for your
// direction against the subiterator." This would imply that there's more than
// one possibility for the same Contains()ed value. While we could return the
// number of options, it's simpler to return one, and then call NextPath()
// enough times to enumerate the options. (In fact, one could argue that the
// raison d'etre for NextPath() is this iterator).
//
// Alternatively, can be seen as the dual of the LinksTo iterator.

import (
	"github.com/cayleygraph/cayley/clog"

	"fmt"
	"github.com/cayleygraph/cayley/graph"
	"github.com/cayleygraph/cayley/quad"
)

var _ graph.Iterator = &HasA{}

// A HasA consists of a reference back to the graph.QuadStore that it references,
// a primary subiterator, a direction in which the quads for that subiterator point,
// and a temporary holder for the iterator generated on Contains().
type HasA struct {
	uid       uint64
	tags      graph.Tagger
	qs        graph.QuadStore
	primaryIt graph.Iterator
	dir       quad.Direction
	resultIt  graph.Iterator
	result    graph.Value
	runstats  graph.IteratorStats
	err       error
}

// Construct a new HasA iterator, given the quad subiterator, and the quad
// direction for which it stands.
func NewHasA(qs graph.QuadStore, subIt graph.Iterator, d quad.Direction) *HasA {
	return &HasA{
		uid:       NextUID(),
		qs:        qs,
		primaryIt: subIt,
		dir:       d,
	}
}

func (it *HasA) UID() uint64 {
	return it.uid
}

// Return our sole subiterator.
func (it *HasA) SubIterators() []graph.Iterator {
	return []graph.Iterator{it.primaryIt}
}

func (it *HasA) Reset() {
	it.primaryIt.Reset()
	if it.resultIt != nil {
		it.resultIt.Close()
	}
}

func (it *HasA) Tagger() *graph.Tagger {
	return &it.tags
}

func (it *HasA) Clone() graph.Iterator {
	out := NewHasA(it.qs, it.primaryIt.Clone(), it.dir)
	out.tags.CopyFrom(it)
	return out
}

// Direction accessor.
func (it *HasA) Direction() quad.Direction { return it.dir }

// Pass the Optimize() call along to the subiterator. If it becomes Null,
// then the HasA becomes Null (there are no quads that have any directions).
func (it *HasA) Optimize() (graph.Iterator, bool) {
	newPrimary, changed := it.primaryIt.Optimize()
	if changed {
		it.primaryIt = newPrimary
		if it.primaryIt.Type() == graph.Null {
			return it.primaryIt, true
		}
	}
	// Ask the graph.QuadStore if we can be replaced. Often times, this is a great
	// optimization opportunity (there's a fixed iterator underneath us, for
	// example).
	newReplacement, hasOne := it.qs.OptimizeIterator(it)
	if hasOne {
		it.Close()
		return newReplacement, true
	}
	return it, false
}

// Pass the TagResults down the chain.
func (it *HasA) TagResults(dst map[string]graph.Value) {
	it.tags.TagResult(dst, it.Result())

	it.primaryIt.TagResults(dst)
}

func (it *HasA) String() string {
	return fmt.Sprintf("HasA(%v)", it.dir)
}

// Check a value against our internal iterator. In order to do this, we must first open a new
// iterator of "quads that have `val` in our direction", given to us by the quad store,
// and then Next() values out of that iterator and Contains() them against our subiterator.
func (it *HasA) Contains(val graph.Value) bool {
	graph.ContainsLogIn(it, val)
	it.runstats.Contains += 1
	if clog.V(4) {
		clog.Infof("Id is %v", it.qs.NameOf(val))
	}
	// TODO(barakmich): Optimize this
	if it.resultIt != nil {
		it.resultIt.Close()
	}
	it.resultIt = it.qs.QuadIterator(it.dir, val)
	ok := it.NextContains()
	if it.err != nil {
		return false
	}
	return graph.ContainsLogOut(it, val, ok)
}

// NextContains() is shared code between Contains() and GetNextResult() -- calls next on the
// result iterator (a quad iterator based on the last checked value) and returns true if
// another match is made.
func (it *HasA) NextContains() bool {
	if it.resultIt == nil {
		return false
	}
	for it.resultIt.Next() {
		it.runstats.ContainsNext += 1
		link := it.resultIt.Result()
		if clog.V(4) {
			clog.Infof("Quad is %v", it.qs.Quad(link))
		}
		if it.primaryIt.Contains(link) {
			it.result = it.qs.QuadDirection(link, it.dir)
			return true
		}
	}
	it.err = it.resultIt.Err()
	return false
}

// Get the next result that matches this branch.
func (it *HasA) NextPath() bool {
	// Order here is important. If the subiterator has a NextPath, then we
	// need do nothing -- there is a next result, and we shouldn't move forward.
	// However, we then need to get the next result from our last Contains().
	//
	// The upshot is, the end of NextPath() bubbles up from the bottom of the
	// iterator tree up, and we need to respect that.
	if clog.V(4) {
		clog.Infof("HASA %v NextPath", it.UID())
	}
	if it.primaryIt.NextPath() {
		return true
	}
	it.err = it.primaryIt.Err()
	if it.err != nil {
		return false
	}

	result := it.NextContains() // Sets it.err if there's an error
	if it.err != nil {
		return false
	}
	if clog.V(4) {
		clog.Infof("HASA %v NextPath Returns %v", it.UID(), result)
	}
	return result
}

// Next advances the iterator. This is simpler than Contains. We have a
// subiterator we can get a value from, and we can take that resultant quad,
// pull our direction out of it, and return that.
func (it *HasA) Next() bool {
	graph.NextLogIn(it)
	it.runstats.Next += 1
	if it.resultIt != nil {
		it.resultIt.Close()
	}

	if !it.primaryIt.Next() {
		it.err = it.primaryIt.Err()
		return graph.NextLogOut(it, false)
	}
	tID := it.primaryIt.Result()
	val := it.qs.QuadDirection(tID, it.dir)
	it.result = val
	return graph.NextLogOut(it, true)
}

func (it *HasA) Err() error {
	return it.err
}

func (it *HasA) Result() graph.Value {
	return it.result
}

// GetStats() returns the statistics on the HasA iterator. This is curious. Next
// cost is easy, it's an extra call or so on top of the subiterator Next cost.
// ContainsCost involves going to the graph.QuadStore, iterating out values, and hoping
// one sticks -- potentially expensive, depending on fanout. Size, however, is
// potentially smaller. we know at worst it's the size of the subiterator, but
// if there are many repeated values, it could be much smaller in totality.
func (it *HasA) Stats() graph.IteratorStats {
	subitStats := it.primaryIt.Stats()
	// TODO(barakmich): These should really come from the quadstore itself
	// and be optimized.
	faninFactor := int64(1)
	fanoutFactor := int64(30)
	nextConstant := int64(2)
	quadConstant := int64(1)
	return graph.IteratorStats{
		NextCost:     quadConstant + subitStats.NextCost,
		ContainsCost: (fanoutFactor * nextConstant) * subitStats.ContainsCost,
		Size:         faninFactor * subitStats.Size,
		ExactSize:    false,
		Next:         it.runstats.Next,
		Contains:     it.runstats.Contains,
		ContainsNext: it.runstats.ContainsNext,
	}
}

// Close the subiterator, the result iterator (if any) and the HasA. It closes
// all subiterators it can, but returns the first error it encounters.
func (it *HasA) Close() error {
	err := it.primaryIt.Close()

	if it.resultIt != nil {
		_err := it.resultIt.Close()
		if err == nil {
			err = _err
		}
	}

	return err
}

// Register this iterator as a HasA.
func (it *HasA) Type() graph.Type { return graph.HasA }

func (it *HasA) Size() (int64, bool) {
	st := it.Stats()
	return st.Size, st.ExactSize
}


text:
package gov.nasa.jpf.psyco.search;

import gov.nasa.jpf.constraints.api.ConstraintSolver;
import gov.nasa.jpf.psyco.search.datastructures.searchImage.EnumerativeImage;
import gov.nasa.jpf.psyco.search.datastructures.region.EnumerativeRegion;
import gov.nasa.jpf.psyco.search.util.region.EnumerativeRegionUtil;
import gov.nasa.jpf.psyco.search.transitionSystem.TransitionSystem;
import gov.nasa.jpf.psyco.search.util.SearchUtil;
import gov.nasa.jpf.psyco.util.PsycoProfiler;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * This class is an enumerative breadth-first search.
 */
public class EnumerativeSearchEngine {

  public static EnumerativeImage enumerativBreadthFirstSearch(
          TransitionSystem transitionSystem,
          ConstraintSolver solver,
          int maxSearchDepth) {
    SolverInstance.getInstance().setSolver(solver);
    EnumerativeRegion newRegion, reachableRegion
            = new EnumerativeRegion(transitionSystem.getInitValuation());
    EnumerativeRegionUtil regionUtil = new EnumerativeRegionUtil(solver);
    SearchUtil<EnumerativeImage> searchUtil
            = new SearchUtil<>(regionUtil);
    EnumerativeImage currentSearchState
            = new EnumerativeImage(reachableRegion);
    currentSearchState.setPreviousNewStates(reachableRegion);
    //If newRegion is empty, it was not possible to reach a new state by
    //the last iteration. A fix point is reached. This is the termiantion goal.
    while (!currentSearchState.getPreviousNewStates().isEmpty()) {
      EnumerativeImage newImage = searchUtil.post(currentSearchState,
              transitionSystem);
      EnumerativeRegion nextReachableStates = newImage.getNewStates();

      PsycoProfiler.startDiffProfiler(newImage.getDepth());
      newRegion = regionUtil.difference(nextReachableStates,
              reachableRegion);
      PsycoProfiler.stopDiffProfieler(newImage.getDepth());

      reachableRegion = regionUtil.union(reachableRegion, newRegion);
      newImage.setReachableStates(reachableRegion);
      newImage.setReachableStates(reachableRegion);
      newImage.setPreviousNewStates(newRegion);
      newImage.setNewStates(null);
      currentSearchState = newImage;

      logState(currentSearchState);
      if (maxSearchDepth != Integer.MIN_VALUE
              && currentSearchState.getDepth() == maxSearchDepth) {
        currentSearchState.setDepth(Integer.MAX_VALUE);
        break;
      }
    }
    return currentSearchState;
  }

  private static void logState(EnumerativeImage newImage) {
    Logger logger = Logger.getLogger("psyco");
    StringBuilder builder = new StringBuilder();
    try {
      newImage.print(builder);
      logger.fine(builder.toString());
    } catch (IOException ex) {
      Logger.getLogger(SymbolicSearchEngine.class.getName())
              .log(Level.SEVERE, null, ex);
    }
  }
}


text:
'use strict';

require('newrelic');

var app = require('./app/app');

module.exports = app.listen(app.get('port'), function() {
    console.log('Express server listening on port ' + app.get('port'));
});


text:
layout: post
date: 2017-05-21
title: Jekyll Up!
mini_title: WOO HOO! It is up!
categories: Tech
---

Finally got this up and running, after almost a month long delay. A friend of mine inspired me to create a website using Jekyll and GitHub Pages.

On hindsight, this process is simple. Since I did not want to do too much designing of the webpage from scratch, I used the exact same [boilerplate](https://github.com/barryclark/jekyll-now/) that my friend used.

All I had to do was fork the repo, and follow my friend's [readme](https://github.com/kaiyisg/pers-blog) on setting up a local version of the webpage.

That's it! Everything was good to go.

Admitedly, I took some time to understand how Jekyll works as a whole. For starters, I did not read the official Jekyll documentation HAHA! That was a bad idea and I ended up wasting time trying to figure things out by myself. In the end, a YouTube tutorial video helped me to better understand how Jekyll works. That is how I have this!

Moving forward, I think it is a good idea to post one new technical skill I learnt everyday. Not only does this help me to push myself to learn something new everyday, it also would help me to remember some of the things that I have learnt in my computing career.


text:
{
  return ComponentTree.getNodeFromInstance(node);
}


text:
<?php

/**
 * NewsVersion form.
 *
 * @package    cartefinancement
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class NewsVersionForm extends BaseNewsVersionForm
{
  public function configure()
  {
  }
}


text:
package com.desha.Beans;

import javax.persistence.Id;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by Viktor on 2/28/2017.
 */
@Embeddable
public class Work_ScheduleKey implements Serializable {

    @Id
    private int num;

    @Id
    @Column(name = "employee_email")
    private String email;

    @Id
    @Column(name = "restaurant_name")
    private String resname;

    @Id
    @Column(name = "region_id")
    private int id;

    public Work_ScheduleKey(int num, String email, String resname, int id) {
        this.num = num;

        this.email = email;
        this.resname = resname;
        this.id = id;
    }

    public Work_ScheduleKey() {
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getResname() {
        return resname;
    }

    public void setResname(String resname) {
        this.resname = resname;
    }

    public int getId() {
        return id;
    }

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


text:
package org.apache.geode.cache.lucene.internal.results;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;

import org.apache.geode.internal.serialization.DataSerializableFixedID;
import org.apache.geode.internal.serialization.DeserializationContext;
import org.apache.geode.internal.serialization.KnownVersion;
import org.apache.geode.internal.serialization.SerializationContext;

public class PageResults extends ArrayList<PageEntry> implements DataSerializableFixedID {

  public PageResults(final int initialCapacity) {
    super(initialCapacity);
  }

  public PageResults() {}

  @Override
  public int getDSFID() {
    return DataSerializableFixedID.LUCENE_PAGE_RESULTS;
  }

  @Override
  public void toData(final DataOutput out,
      SerializationContext context) throws IOException {
    out.writeInt(size());
    for (PageEntry entry : this) {
      entry.toData(out);
    }
  }

  @Override
  public void fromData(final DataInput in,
      DeserializationContext context) throws IOException, ClassNotFoundException {
    int size = in.readInt();
    for (int i = 0; i < size; i++) {
      PageEntry entry = new PageEntry();
      entry.fromData(in);
      add(entry);
    }
  }

  @Override
  public KnownVersion[] getSerializationVersions() {
    return new KnownVersion[0];
  }
}


text:
set -euo pipefail

catch() {
    errormsg="${1:-}"
    trap '' ERR
    echo $errormsg
}

trap 'catch "Error caught (line $LINENO, exit code $?)"' ERR


text:
package com.intellij.execution.testframework.autotest;

import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.runners.PreferredPlace;
import com.intellij.execution.runners.RunTab;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.ExecutionDataKeys;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

public class ToggleAutoTestAction extends ToggleAction {

  public ToggleAutoTestAction() {
    super(IdeBundle.messagePointer("action.ToggleAction.text.toggle.auto.test"),
          IdeBundle.messagePointer("action.ToggleAction.description.toggle.auto.test"),
          AllIcons.Actions.SwapPanels);
    getTemplatePresentation().putClientProperty(RunTab.PREFERRED_PLACE, PreferredPlace.MORE_GROUP);
  }

  @Override
  public boolean isSelected(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    RunContentDescriptor descriptor = e.getData(LangDataKeys.RUN_CONTENT_DESCRIPTOR);
    return project != null && descriptor != null && getAutoTestManager(project).isAutoTestEnabled(descriptor);
  }

  @Override
  public void setSelected(@NotNull AnActionEvent e, boolean state) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    RunContentDescriptor descriptor = e.getData(LangDataKeys.RUN_CONTENT_DESCRIPTOR);
    ExecutionEnvironment environment = e.getData(ExecutionDataKeys.EXECUTION_ENVIRONMENT);
    if (project != null && descriptor != null && environment != null) {
      getAutoTestManager(project).setAutoTestEnabled(descriptor, environment, state);
    }
  }

  public boolean isDelayApplicable() {
    return true;
  }

  public AbstractAutoTestManager getAutoTestManager(Project project) {
    return AutoTestManager.getInstance(project);
  }
}


text:
class CreateDemandDrivers < ActiveRecord::Migration
  def self.up
    create_table :demand_drivers do |t|
      t.string :name
      t.text   :description
      t.belongs_to :energy_system
      t.timestamps
    end
    add_index :demand_drivers, :name
  end

  def self.down
    drop_table :demand_drivers
  end
end


text:
from sklearn.datasets import load_svmlight_file, dump_svmlight_file
import numpy as np
import sys
from os.path import dirname, join

from uda_common import read_feature_lookup, read_feature_groups

def main(args):
    if len(args) < 2:
        sys.stderr.write("Error: At least two required arguments: <Training input> <reduced training output file>\n")
        sys.exit(-1)

    X_train, y_train = load_svmlight_file(args[0])
    (num_instances, num_feats) = X_train.shape
    data_dir = dirname(args[0])
    out_file = args[1]
    out_dir = dirname(out_file)
    num_feats_allowed = int(out_dir.split("_")[-1].replace('k', '000'))
    sys.stderr.write("Argument indicates feature threshold of %d features allowed\n" % (num_feats_allowed))

    ## Find the low frequency feature we can discard:
    feat_counts = X_train.sum(0)

    for count in range(1,10):
        lowfreq_inds = np.where(feat_counts < count)[1]
        num_good_feats = num_feats - len(lowfreq_inds)
        sys.stderr.write("Found %d features that occurred >= %d times in the data\n" % (num_good_feats, count))
        if num_good_feats < num_feats_allowed:
            sys.stderr.write("Breaking at threshold %d\n" % (count))
            break

    ## Get the feature mapping, giving it an offset of -1 to adjust for the fact that
    ## java wrote liblinear with index 1 and load_svmlight_file gives it to us with
    ## index 1
    old_feat_map = read_feature_lookup(join(data_dir, 'features-lookup.txt'), offset=-1)
    old_groups = read_feature_groups(join(data_dir, 'feature-groups.txt'), offset=-1)
    new_groups = {}
    for domain in old_groups.keys():
        new_groups[domain] = []

    new_map_file = open(join(out_dir, 'reduced-features-lookup.txt'), 'w')

    ## Create a reduced feature matrix with only common features:
    new_X = np.matrix(np.zeros((num_instances, num_good_feats)))

    sys.stderr.write('Building matrix in reduced dimension space\n')
    new_ind = 0
    for ind in range(num_feats):
        feat_name = old_feat_map[ind]
        if not ind in lowfreq_inds:
            ## Use this feature:
            # 1) Write its mapping to feature lookup file: (unless it's the bias feature)
            if not ind == 0:
                new_map_file.write('%s : %d\n' % (feat_name, new_ind))

            # 2) Add its column to the data matrix:
            new_X[:,new_ind] += X_train[:,ind].toarray()

            # 3) Add its index to the group mapping file:
            for feat_type in old_groups.keys():
                if ind in old_groups[feat_type]:
                    new_groups[feat_type].append(new_ind)

            new_ind += 1

    new_map_file.close()

    sys.stderr.write('Writing reduced feature groups file\n')
    new_group_file = open(join(out_dir, 'reduced-feature-groups.txt'), 'w')
    for feat_type in new_groups.keys():
        new_group_file.write('%s : %s\n' % (feat_type, ','.join(map(str,new_groups[feat_type]))))

    new_group_file.close()

    sys.stderr.write('Writing new svmlight file\n')
    f = open(out_file, 'w')
    dump_svmlight_file(new_X, y_train, f)
    f.close()

if __name__ == '__main__':
    args = sys.argv[1:]
    main(args)


text:
package com.in28minutes.junit.model;

/**
 * Collateral Model API.
 */
public interface Collateral {

	long getId();

	String getName();

	CollateralType getType();
}


text:
angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q', '$timeout', function($q, $timeout){
  var errorUnsupported = {
    error: "unsupported",
    message: "Operation unsupported"
  };

  var initialize = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.initialize(
        function(obj) {
          q.notify(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var enable = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.enable(
        null,
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var disable = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.disable(
        null,
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var startScan = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = null;
      if (params && params.scanTimeout) {
        timeout = $timeout(function() {
          window.bluetoothle.isScanning(function(obj) {
            if (obj.isScanning) {
              window.bluetoothle.stopScan(
                function(obj) {
                  q.resolve(obj);
                },
                function(obj) {
                  q.reject(obj);
                }
              );
            }
          });
        }, params.scanTimeout);
      }

      window.bluetoothle.startScan(
        function(obj) {
          q.notify(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var stopScan = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.stopScan(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var retrieveConnected = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.retrieveConnected(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var bond = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.bond(
        function(obj) {
          $timeout.cancel(timeout);
          q.notify(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var unbond = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.unbond(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var connect = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.connect(
        function(obj) {
          $timeout.cancel(timeout);
          if (params && params.useResolve) {
            q.resolve(obj);
          } else {
            q.notify(obj);
          }
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var reconnect = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.reconnect(
        function(obj) {
          $timeout.cancel(timeout);
          if (params && params.useResolve) {
            q.resolve(obj);
          } else {
            q.notify(obj);
          }
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var disconnect = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.disconnect(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var close = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.close(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var discover = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.discover(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var services = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.services(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var characteristics = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.characteristics(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var descriptors = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.descriptors(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var read = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.read(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var subscribe = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.subscribe(
        function(obj) {
          $timeout.cancel(timeout);
          q.notify(obj);

          if (params && params.subscribeTimeout && obj.status == "subscribed") {
            $timeout(function() {
              window.bluetoothle.unsubscribe(
                function(obj) {
                  q.resolve(obj);
                },
                function(obj) {
                  q.reject(obj);
                },
                params
              );
            }, params.subscribeTimeout);
          }
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var unsubscribe = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.unsubscribe(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var write = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.write(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var writeQ = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.writeQ(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var readDescriptor = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.readDescriptor(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var writeDescriptor = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.writeDescriptor(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var rssi = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.rssi(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var mtu = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.mtu(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var requestConnectionPriority = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      var timeout = createTimeout(params, q);

      window.bluetoothle.requestConnectionPriority(
        function(obj) {
          $timeout.cancel(timeout);
          q.resolve(obj);
        },
        function(obj) {
          $timeout.cancel(timeout);
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var isInitialized = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isInitialized(
        function(obj) {
          q.resolve(obj);
        }
      );
    }
    return q.promise;
  };

  var isEnabled = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isEnabled(
        function(obj) {
          q.resolve(obj);
        }
      );
    }
    return q.promise;
  };

  var isScanning = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isScanning(
        function(obj) {
          q.resolve(obj);
        }
      );
    }
    return q.promise;
  };

  var isBonded = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isBonded(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var wasConnected = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.wasConnected(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var isConnected = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isConnected(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var isDiscovered = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isDiscovered(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var hasPermission = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.hasPermission(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var requestPermission = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.requestPermission(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var isLocationEnabled = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isLocationEnabled(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var requestLocation = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.requestLocation(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var initializePeripheral = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.initializePeripheral(
        function(obj) {
          q.notify(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var addService = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.addService(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var removeService = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.removeService(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var removeAllServices = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.removeAllServices(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var startAdvertising = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.startAdvertising(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var stopAdvertising = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.stopAdvertising(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var isAdvertising = function() {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.isAdvertising(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        }
      );
    }
    return q.promise;
  };

  var respond = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.respond(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var notify = function(params) {
    var q = $q.defer();
    if (window.bluetoothle === undefined) {
      q.reject(errorUnsupported);
    } else {
      window.bluetoothle.notify(
        function(obj) {
          q.resolve(obj);
        },
        function(obj) {
          q.reject(obj);
        },
        params
      );
    }
    return q.promise;
  };

  var encodedStringToBytes = function(value) {
    if (window.bluetoothle === undefined) {
      return;
    }
    return window.bluetoothle.encodedStringToBytes(value);
  };

  var bytesToEncodedString = function(value) {
    if (window.bluetoothle === undefined) {
      return;
    }
    return window.bluetoothle.bytesToEncodedString(value);
  };

  var stringToBytes = function(value) {
    if (window.bluetoothle === undefined) {
      return;
    }
    return window.bluetoothle.stringToBytes(value);
  };

  var bytesToString = function(value) {
    if (window.bluetoothle === undefined) {
      return;
    }
    return window.bluetoothle.bytesToString(value);
  };

  var bytesToHex = function(value) {
    if (window.bluetoothle === undefined) {
      return;
    }
    return window.bluetoothle.bytesToHex(value);
  };

  var createTimeout = function(params, q) {
    if (params && params.timeout) {
      return $timeout(function() {
        params.error = "timeout";
        q.reject(params);
      }, params.timeout);
    }
    return null;
  };

  return {
    initialize: initialize,
    enable: enable,
    disable: disable,
    startScan: startScan,
    stopScan: stopScan,
    retrieveConnected: retrieveConnected,

    bond: bond,
    unbond: unbond,
    connect: connect,
    reconnect: reconnect,
    disconnect: disconnect,
    close: close,
    discover: discover,
    services: services,
    characteristics: characteristics,
    descriptors: descriptors,
    read: read,
    subscribe: subscribe,
    unsubscribe: unsubscribe,
    write: write,
    writeQ: writeQ,
    readDescriptor: readDescriptor,
    writeDescriptor: writeDescriptor,
    rssi: rssi,
    mtu: mtu,
    requestConnectionPriority: requestConnectionPriority,

    isInitialized: isInitialized,
    isEnabled: isEnabled,
    isScanning: isScanning,
    isBonded: isBonded,
    wasConnected: wasConnected,
    isConnected: isConnected,
    isDiscovered: isDiscovered,

    hasPermission: hasPermission,
    requestPermission: requestPermission,
    isLocationEnabled: isLocationEnabled,
    requestLocation: requestLocation,

    initializePeripheral: initializePeripheral,
    addService: addService,
    removeService: removeService,
    removeAllServices: removeAllServices,
    startAdvertising: startAdvertising,
    stopAdvertising: stopAdvertising,
    isAdvertising: isAdvertising,
    respond: respond,
    notify: notify,

    encodedStringToBytes: encodedStringToBytes,
    bytesToEncodedString: bytesToEncodedString,
    stringToBytes: stringToBytes,
    bytesToString: bytesToString,
    bytesToHex: bytesToHex
  };
}]);


text:
<resources>
    <string name="app_name">GeoUser</string>
    <string name="action_settings">Settings</string>

    <string name="buttonTog">Send</string>
    <string name="title_activity_login">Sign up</string>
    <string name="utenteC">Insert the Username to find</string>
    <string name="data1">Insert the first date in format MM/dd/yyyy HH:mm:ss</string>
    <string name="data2">Insert the second date in format MM/dd/yyyy HH:mm:ss</string>
    <string name="trova_utente">Find User</string>
    <string name="update_gps">Update GPS</string>
    <string name="find">Find</string>
    <string name="allUserPosition">Find All</string>
    <string name="find_time">Change time</string>
    <string name="find_date">Change date</string>
    <string name="prompt_ip">Insert IP</string>
    <string name="prompt_port">Insert port number</string>

    -->

    <!-- Strings related to login and signin-->
    <string name="prompt_username">Username</string>
    <string name="prompt_password">Password </string>
    <string name="prompt_password2">Reinsert Password</string>
    <string name="action_sign_in">Sign in or register</string>
    <string name="action_sign_in_short">Sign up</string>
    <string name="action_log_in">Log in</string>
    <string name="error_invalid_email">This email address is invalid</string>
    <string name="error_invalid_password">This password is too short</string>
    <string name="error_incorrect_password">This password is incorrect</string>
    <string name="error_field_required">This field is required</string>
    <string name="permission_rationale">"Contacts permissions are needed for providing email
        completions."
    </string>
    <string name="title_activity_maps">Map</string>
    <string name="registrati">Sign up</string>
    <string name="accedi">Login</string>
    <string name="email">Please insert your e-mail address</string>
    <string name="nome">Please insert your Name</string>
    <string name="cognome">Please insert your Surname</string>
    <string name="init_message">Please select an Operation</string>

    <string-array name="find_spinner_strings">
        <item>BETWEEN</item>
        <item>FROM</item>
        <item>UNTIL</item>
    </string-array>

</resources>


text:
from django.forms import ModelForm
from django import forms
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
from .models import Persona, Estacionamiento, Vehiculo

cedulaValidator = RegexValidator(regex=r'^V\-\d{6,8}$', message="Introduzca una cédula del estilo: V-00000000", code=None, inverse_match=None, flags=0)
telefonoValidator = RegexValidator(regex=r'^\+?(58)?\d{9,15}$', message="Introduzca un teléfono del estilo: +58XXXXXXXXXX", code=None, inverse_match=None, flags=0)

class SignUpPersonaForm(ModelForm):
    class Meta:
        model = Persona
        fields = ['nombre', 'apellido', 'cedula', 'telefono', 'email', 'enviar_correo']

class SignUpEstacionamientoForm(ModelForm):
    class Meta:
        model = Estacionamiento
        fields = ['rif', 'nombre', 'numero_de_puestos', 'acceso_restringido', 'email', 'monto_tarifa', 'tarifa_plana']

class VehiculoForm(ModelForm):
    class Meta:
        model = Vehiculo
        fields = ['placa', 'marca','modelo','year']

class PagoEstacionamientoForm(forms.Form):
    numero_ticket = forms.IntegerField(label="Número de ticket",
                                       min_value=0)
    registrado_ticket = forms.BooleanField(label="¿El ticket está registrado?",
                                           required=False)

class Mensajes_Form(forms.Form):
    placa_mensaje = forms.CharField(max_length=25, label="Placa del vehículo")

    responsable = forms.CharField(label="Responsable del mensaje",
                                           required=True)
    tipo_mensaje= forms.CharField(max_length=25, label="Tipo de mensaje")


text:
package com.mattprecious.notisync.wizardpager.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.CheckBox;

import com.actionbarsherlock.app.SherlockFragment;
import com.mattprecious.notisync.R;
import com.mattprecious.notisync.service.PrimaryService;
import com.mattprecious.notisync.service.SecondaryService;
import com.mattprecious.notisync.util.Preferences;
import com.mattprecious.notisync.wizardpager.model.Page;

public class ModeFragment extends SherlockFragment implements OnClickListener {
    private static final String ARG_KEY = "key";

    private PageFragmentCallbacks mCallbacks;
    private String mKey;
    private Page mPage;

    private View primaryView;
    private View secondaryView;
    private CheckBox primaryCheckBox;
    private CheckBox secondaryCheckBox;

    public static ModeFragment create(String key) {
        Bundle args = new Bundle();
        args.putString(ARG_KEY, key);

        ModeFragment fragment = new ModeFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Bundle args = getArguments();
        mKey = args.getString(ARG_KEY);
        mPage = mCallbacks.onGetPage(mKey);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.wizard_mode, container, false);

        primaryView = rootView.findViewById(R.id.primary);
        primaryView.setOnClickListener(this);

        primaryCheckBox = (CheckBox) rootView.findViewById(R.id.primary_checkbox);
        primaryCheckBox.setClickable(false);

        secondaryView = rootView.findViewById(R.id.secondary);
        secondaryView.setOnClickListener(this);

        secondaryCheckBox = (CheckBox) rootView.findViewById(R.id.secondary_checkbox);
        secondaryCheckBox.setClickable(false);

        updateSelection();

        return rootView;
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        if (!(activity instanceof PageFragmentCallbacks)) {
            throw new ClassCastException("Activity must implement PageFragmentCallbacks");
        }

        mCallbacks = (PageFragmentCallbacks) activity;
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mCallbacks = null;
    }

    private void updateSelection() {
        boolean isPrimary = Preferences.isPrimary(getActivity());
        primaryCheckBox.setChecked(isPrimary);
        secondaryCheckBox.setChecked(!isPrimary);
    }

    @Override
    public void onClick(View v) {
        if (v == primaryView) {
            Preferences.setMode(getActivity(), Preferences.Mode.PRIMARY);

            if (SecondaryService.isRunning()) {
                getActivity().stopService(new Intent(getActivity(), SecondaryService.class));
                getActivity().startService(new Intent(getActivity(), PrimaryService.class));
            }
        } else {
            Preferences.setMode(getActivity(), Preferences.Mode.SECONDARY);

            if (PrimaryService.isRunning()) {
                getActivity().stopService(new Intent(getActivity(), PrimaryService.class));
                getActivity().startService(new Intent(getActivity(), SecondaryService.class));
            }
        }

        updateSelection();
        mPage.notifyDataChanged();
    }

}


text:
import React from 'react';
import { mount } from 'enzyme';

import headerDriverFactory from './Header.driver';
import { headerUniDriverFactory } from './Header.uni.driver';
import Header from './Header';
import { headerTestkitFactory } from '../../../testkit';
import { headerTestkitFactory as enzymeHeaderTestkitFactory } from '../../../testkit/enzyme';
import {
  isTestkitExists,
  isEnzymeTestkitExists,
} from '../../../test/utils/testkit-sanity';
import {
  createRendererWithDriver,
  createRendererWithUniDriver,
} from '../../../test/utils/unit';

describe('Header', () => {
  describe('[sync]', () => {
    runTests(createRendererWithDriver(headerDriverFactory));
  });

  describe('[async]', () => {
    runTests(createRendererWithUniDriver(headerUniDriverFactory));
  });

  function runTests(render) {
    const createDriver = jsx => render(jsx).driver;

    describe('`title` prop', () => {
      it('should render as string', async () => {
        const driver = createDriver();
        expect(await driver.title()).toBe('Header Title');
      });

      it('should render as component', async () => {
        const driver = createDriver();
        expect(await driver.title()).toBe('hello world');
      });
    });

    describe('`subtitle` prop', () => {
      it('should render as string', async () => {
        const driver = createDriver(
          ,
        );
        expect(await driver.subtitle()).toBe('Header Subtitle');
      });

      it('should render as component', async () => {
        const driver = createDriver(
          ,
        );
        expect(await driver.subtitle()).toBe('hello world');
      });
    });

    describe('testkits', () => {
      it('should exist', async () => {
        expect(
          isTestkitExists(, headerTestkitFactory),
        ).toBe(true);
      });

      it('should exist for enzyme', async () => {
        expect(
          isEnzymeTestkitExists(
            ,
            enzymeHeaderTestkitFactory,
            mount,
          ),
        ).toBe(true);
      });
    });
  }
});