text:
<?php

namespace TheScienceTour\EventBundle\Repository;

use Doctrine\ODM\MongoDB\DocumentRepository;
use TheScienceTour\MainBundle\Model\GeoNear;
use TheScienceTour\MainBundle\Utility\QueryBuilder;

/**
 * EventRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class EventRepository extends DocumentRepository
{

	public function findTrucks(GeoNear $geoNear = null) {
		$labelTypes = $this->dm->createQueryBuilder('TheScienceTour\EventBundle\Document\LabelType')
			->field('slug')->in(array('camion', 'inserm'))
			->getQuery()
			->execute();

		$lqb = $this->dm->createQueryBuilder('TheScienceTour\EventBundle\Document\Label');
		foreach ($labelTypes as $labelType) {
			$lqb->addOr($lqb->expr()->field('labelType')->references($labelType));
		}
		$labels = $lqb->getQuery()
			->execute();

		$qb = $this->createQueryBuilder()
			->field('endDate')->gte(new \DateTime());
		foreach ($labels as $label) {
			$qb->addOr($qb->expr()->field('label')->references($label));
		}

		if ($geoNear) {
			$qb = $geoNear->addToQueryBuilder($qb);
		}

		return $qb->sort('startDate', 'asc')
			->getQuery()
			->execute();
	}

	public function findFrontPage(GeoNear $geoNear = null) {
		$qb = $this->createQueryBuilder()
			->field('frontPage')->equals(true)
			->field('endDate')->gte(new \DateTime());

		if ($geoNear) {
			$qb = $geoNear->addToQueryBuilder($qb);
		}

		return $qb->sort('startDate', 'asc')
			->getQuery()
			->execute();
	}

	public function findNext(GeoNear $geoNear = null) {
		$qb = $this->createQueryBuilder()
			->field('endDate')->gte(new \DateTime());

		if ($geoNear) {
			$qb = $geoNear->addToQueryBuilder($qb);
		}

		return $qb->sort('startDate', 'asc')
			->getQuery()
			->execute();
	}

	public function findFavorite($userFavoriteEvents, GeoNear $geoNear = null) {
		$fav_ids = array();
		foreach ($userFavoriteEvents as $fav) {
			$fav_ids[] = $fav->getId();
		}

		$qb = $this->createQueryBuilder()
			->field("id")->in($fav_ids)
			->field('endDate')->gte(new \DateTime());
		if ($geoNear) {
			$qb = $geoNear->addToQueryBuilder($qb);
		}

		return $qb->sort('startDate', 'asc')
			->getQuery()
			->execute();
	}

	public function findPast(GeoNear $geoNear = null) {
		$qb = $this->createQueryBuilder()
			->field('endDate')->lt(new \DateTime());

		if ($geoNear) {
			$qb = $geoNear->addToQueryBuilder($qb);
		}

		return $qb->sort('startDate', 'desc')
			->getQuery()
			->execute();
	}

	public function findDay($date, GeoNear $geoNear = null) {
		$dayStart = new \DateTime($date . ' 00:00:00');
		$dayEnd = new \DateTime($date . ' 23:59:59');

		$qb = $this->createQueryBuilder()
			->field('startDate')->lte($dayEnd)
			->field('endDate')->gt($dayStart);

		if ($geoNear) {
			$qb = $geoNear->addToQueryBuilder($qb);
		}

		return $qb->getQuery()
			->execute();
	}

}


text:
class Data
{
	public:
		int counter;
		char pos;
};
#endif // DATA_H

redpajama_set_name: RedPajamaGithub


text:
package com.ms.portalv1.validators;

import com.ms.portalv1.interfacedaos.RequestInterfaceDao;
import com.ms.portalv1.models.ServiceRequestRenew;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

/**
 *
 * @author agnux
 */
public class ServiceRequestRenewValidator implements Validator{
    private static final String PATTERN_NUMERIC = "[0-9]*";

    private RequestInterfaceDao RequestDao;

    public RequestInterfaceDao getRequestDao() {
        return RequestDao;
    }

    public void setRequestDao(RequestInterfaceDao RequestDao) {
        this.RequestDao = RequestDao;
    }

    public void initValidator(RequestInterfaceDao RequestDao) {
        this.setRequestDao(RequestDao);
    }

    @Override
    public boolean supports(Class clazz) {
        return ServiceRequestRenew.class.isAssignableFrom(clazz);
    }

    @Override
    public void validate(Object target, Errors errors) {
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "codeArea", "required.codeArea", "Se requiere el código de area.");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "phone", "required.phone", "Se requiere el número de teléfono.");

        ServiceRequestRenew srr = (ServiceRequestRenew) target;

        try {
            if (!srr.getPhone().equals("") && !srr.getPhone().isEmpty()) {
                if(!srr.getPhone().matches(PATTERN_NUMERIC)){
                    errors.rejectValue("phone", "notnumeric.phone");
                }else{
                    if(srr.getPhone().length()!=8){
                        errors.rejectValue("phone", "length.phone");
                    }
                }
            }
        } catch (Exception e) {
            errors.rejectValue("phone", "required.phone");
        }

        try {
            if (!srr.getCodeArea().equals("") && !srr.getCodeArea().isEmpty()) {
                if(!srr.getCodeArea().matches(PATTERN_NUMERIC)){
                    errors.rejectValue("codeArea", "notnumeric.codeArea");
                }else{
                    if(srr.getCodeArea().length()!=2){
                        errors.rejectValue("codeArea", "length.codeArea");
                    }
                }
            }
        } catch (Exception e) {
            errors.rejectValue("codeArea", "required.codeArea");
        }

        if(!errors.hasFieldErrors("codeArea") && !errors.hasFieldErrors("phone")){

            System.out.println("srr.getCodeArea(): "+srr.getCodeArea());
            System.out.println("srr.getPhone(): "+srr.getPhone());
            System.out.println("srr.getIdent(): "+srr.getIdent());

            if(this.getRequestDao().getCountPhoneForUser(srr.getCodeArea()+srr.getPhone(),srr.getIdent(), false)>0){
                errors.rejectValue("phone", "repeateduser.phone");
            }else{
                if(this.getRequestDao().getCountPhoneForOtherUser(srr.getCodeArea()+srr.getPhone(),srr.getIdent(), false)>0){
                    errors.rejectValue("phone", "repeateduser.phone");
                }
            }
        }
    }
}


text:
law.parser
==========

.. automodule:: law.parser
   :members:

.. autofunction:: full_parser

.. autofunction:: root_task_parser

.. autofunction:: global_cmdline_args

.. autofunction:: global_cmdline_values


text:
import {ActionTypes} from '../constants';

export const loginFacebook = (data) => {
  return (dispatch, getState) => {
    return dispatch({
      types: [ActionTypes.LOGIN, ActionTypes.LOGIN_SUCCESS, ActionTypes.LOGIN_FAILED],
      promise: (client) => client.fetch('/login-facebook', {method: 'post', body: JSON.stringify(data), withCredentials: 'include', headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  }})
    });
  };
};

export const login = (email, password) => {
  return (dispatch, getState) => {
    return dispatch({
      types: [ActionTypes.LOGIN, ActionTypes.LOGIN_SUCCESS, ActionTypes.LOGIN_FAILED],
      promise: (client) => client.fetch('/login', {method: 'post', body: JSON.stringify({email: email, password: password}), withCredentials: 'include', headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  }})
    });
  };
};


text:
import os
import logging

from flask import Flask, render_template, Response, send_from_directory, request, current_app
from scss import Scss

app = Flask(__name__)
logging.basicConfig()
log = logging.getLogger(__name__)

@app.route("/")
def main():
    return render_template('main.html', title='pyDashie')

@app.route("/dashboard/<dashlayout>/")
def custom_layout(dashlayout):
    return render_template('%s.html'%dashlayout, title='pyDashie')

@app.route("/assets/application.js")
def javascripts():

    # TODO: refactor - this is a mess
    # should just build and cache js.

    if not hasattr(current_app, 'javascripts'):
        import coffeescript
        scripts = [
            'assets/javascripts/jquery.js',
            'assets/javascripts/es5-shim.js',
            'assets/javascripts/d3.v2.min.js',

            'assets/javascripts/batman.js',
            'assets/javascripts/batman.jquery.js',

            'assets/javascripts/jquery.gridster.js',
            'assets/javascripts/jquery.leanModal.min.js',

            #'assets/javascripts/dashing.coffee',
            'assets/javascripts/dashing.gridster.coffee',

            'assets/javascripts/jquery.knob.js',
            'assets/javascripts/rickshaw.min.js',
            #'assets/javascripts/application.coffee',
            'assets/javascripts/app.js',
            #'widgets/clock/clock.coffee',
            'widgets/number/number.coffee',
            'widgets/priority_list/priority_list.coffee',
			#if making new templates input coffee files here
			'widgets/jira/jira.coffee',
        ]
        nizzle = True
        if not nizzle:
            scripts = ['assets/javascripts/application.js']

        output = []
        for path in scripts:
            output.append('// JS: %s\n' % path)
            if '.coffee' in path:
                log.info('Compiling Coffee for %s ' % path)
                contents = coffeescript.compile_file(path)
            else:
                f = open(path)
                contents = f.read()
                f.close()

            output.append(contents)

        if nizzle:
            f = open('/tmp/foo.js', 'w')
            for o in output:
                print >> f, o
            f.close()

            f = open('/tmp/foo.js', 'rb')
            output = f.read()
            f.close()
            current_app.javascripts = output
        else:
            current_app.javascripts = ''.join(output)

    return Response(current_app.javascripts, mimetype='application/javascript')

@app.route('/assets/application.css')
def application_css():
    # TODO: refactor !!

    scripts = [
        'assets/stylesheets/application.css',
    ]
    output = []
    for path in scripts:
        output.append(open(path).read())

    compilelist = [
        'widgets/priority_list/priority_list.scss',
		#if making new templates input scss files here
		'widgets/jira/jira.scss'
    ]

    css = Scss()
    for path in compilelist:
        scss = open(path).read()
        output.append(css.compile(scss))

    return Response('\n'.join(output), mimetype='text/css')

@app.route('/assets/images/<path:filename>')
def send_static_img(filename):
    directory = os.path.join('assets', 'images')
    return send_from_directory(directory, filename)

@app.route('/views/<widget_name>.html')
def widget_html(widget_name):
    print widget_name
    html = '%s.html' % widget_name
    path = os.path.join('widgets', widget_name, html)
    if os.path.isfile(path):
        f = open(path)
        contents = f.read()
        f.close()
        return contents

import Queue

class Z:
    pass
xyzzy = Z()
xyzzy.events_queue = {}
xyzzy.last_events = {}
xyzzy.using_events = True
xyzzy.MAX_QUEUE_LENGTH = 20
xyzzy.stopped = False

@app.route('/events')
def events():
    if xyzzy.using_events:
        event_stream_port = request.environ['REMOTE_PORT']
        current_event_queue = Queue.Queue()
        xyzzy.events_queue[event_stream_port] = current_event_queue
        current_app.logger.info('New Client %s connected. Total Clients: %s' %
                                (event_stream_port, len(xyzzy.events_queue)))

        #Start the newly connected client off by pushing the current last events
        for event in xyzzy.last_events.values():
            current_event_queue.put(event)
        return Response(pop_queue(current_event_queue), mimetype='text/event-stream')

    return Response(xyzzy.last_events.values(), mimetype='text/event-stream')

def pop_queue(current_event_queue):
    while not xyzzy.stopped:
        try:
            data = current_event_queue.get(timeout=0.1)
            yield data
        except Queue.Empty:
            #this makes the server quit nicely - previously the queue threads would block and never exit. This makes it keep checking for dead application
            pass

def purge_streams():
    big_queues = [port for port, queue in xyzzy.events_queue if len(queue) > xyzzy.MAX_QUEUE_LENGTH]
    for big_queue in big_queues:
        current_app.logger.info('Client %s is stale. Disconnecting. Total Clients: %s' %
                                (big_queue, len(xyzzy.events_queue)))
        del queue[big_queue]

def close_stream(*args, **kwargs):
    event_stream_port = args[2][1]
    del xyzzy.events_queue[event_stream_port]
    log.info('Client %s disconnected. Total Clients: %s' % (event_stream_port, len(xyzzy.events_queue)))

def run_sample_app():
    import SocketServer
    SocketServer.BaseServer.handle_error = close_stream
    import example_app
    example_app.run(app, xyzzy)

if __name__ == "__main__":
    run_sample_app()


text:
#ifndef  _SUNXI_NAND_H
#define  _SUNXI_NAND_H

extern int nand_get_mbr(char* buffer, uint len);

extern int nand_uboot_init(int boot_mode);
extern int nand_uboot_exit(int force);

extern int nand_uboot_probe(void);

extern uint nand_uboot_read(uint start, uint sectors, void *buffer);

extern uint nand_uboot_write(uint start, uint sectors, void *buffer);

extern int nand_download_boot0(uint length, void *buffer);
extern int nand_download_uboot(uint length, void *buffer);

extern int nand_force_download_uboot(uint length ,void *buffer);
extern int nand_uboot_erase(int user_erase);

extern uint nand_uboot_get_flash_info(void *buffer, uint length);

extern uint nand_uboot_set_flash_info(void *buffer, uint length);

extern uint nand_uboot_get_flash_size(void);

extern int nand_uboot_flush(void);

extern int NAND_Uboot_Force_Erase(void);

uint nand_upload_boot0(uint length, void *buf);

int nand_download_boot0_simple(uint length, void *buffer);

#endif


text:
package silhouette.provider.social

/**
 * Indicates that an error occurred during profile retrieval in a social provider.
 *
 * @param msg The exception message.
 * @param cause The exception cause.
 */
class ProfileRetrievalException(msg: String, cause: Option[Throwable] = None)
  extends SocialProviderException(msg, cause)


text:
import zipfile
import sys
import os
# Define the length of junk char (AAAAAAA...)
nm = "A"*7280

def shorten(sname, dname):
        try:
                source = zipfile.ZipFile(sname, 'r')
        except:
                print "[*] Can not file the source JAR file"
                sys.exit(1)
        target = zipfile.ZipFile(dname, 'w', zipfile.ZIP_DEFLATED)
        for file in source.filelist:
                target.writestr(file.filename.replace(nm,"A"), source.read(file.filename))
        target.close()
        source.close()
	print "[*] Shortened", sname, "to", dname

def cls():
	if sys.platform == 'linux-i386' or sys.platform == 'linux2':
		os.system("clear")
	elif sys.platform == 'win32':
		os.system("cls")
	else:
		os.system("cls")

def banner():
        cls()

        print "======================================================="
        print u"Allatori ZIP Shortener v1.0 [http://www.mertsarica.com]"
        print "======================================================="

def usage():
       print "Usage: python allatori_zip_shortener.py <source JAR file> <destination JAR file>\n"

if __name__ == '__main__':
        cls()
	banner()

	if len(sys.argv) < 3:
		usage()
		sys.exit(1)
	else:
		shorten(sys.argv[1], sys.argv[2])


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>medas</artifactId>
        <groupId>medas</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>common</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-mongodb</artifactId>
            <version>1.3.3.RELEASE</version>
        </dependency>
    </dependencies>

</project>


text:
import java.util.Scanner;
public class SS {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		//System.out.print("3");
		int A = scn.nextInt();
		int B = scn.nextInt();
		int C = scn.nextInt();
		int D = A+B+C;

		//String AB = scn.nextLine();
		System.out.println(D);

		//System.out.println(AB);
	}

}


text:
package akka.persistence.jdbc.query.dao.legacy

import akka.persistence.jdbc.config.{ LegacyJournalTableConfiguration, ReadJournalConfig }
import akka.persistence.jdbc.journal.dao.legacy.JournalTables
import slick.jdbc.JdbcProfile

class ReadJournalQueries(val profile: JdbcProfile, val readJournalConfig: ReadJournalConfig) extends JournalTables {
  override val journalTableCfg: LegacyJournalTableConfiguration = readJournalConfig.journalTableConfiguration

  import profile.api._

  def journalRowByPersistenceIds(persistenceIds: Iterable[String]) =
    for {
      query <- JournalTable.map(_.persistenceId)
      if query.inSetBind(persistenceIds)
    } yield query

  private def _allPersistenceIdsDistinct(max: ConstColumn[Long]): Query[Rep[String], String, Seq] =
    baseTableQuery().map(_.persistenceId).distinct.take(max)

  private def baseTableQuery() =
    if (readJournalConfig.includeDeleted) JournalTable
    else JournalTable.filter(_.deleted === false)

  val allPersistenceIdsDistinct = Compiled(_allPersistenceIdsDistinct _)

  private def _messagesQuery(
      persistenceId: Rep[String],
      fromSequenceNr: Rep[Long],
      toSequenceNr: Rep[Long],
      max: ConstColumn[Long]) =
    baseTableQuery()
      .filter(_.persistenceId === persistenceId)
      .filter(_.sequenceNumber >= fromSequenceNr)
      .filter(_.sequenceNumber <= toSequenceNr)
      .sortBy(_.sequenceNumber.asc)
      .take(max)

  val messagesQuery = Compiled(_messagesQuery _)

  private def _eventsByTag(
      tag: Rep[String],
      offset: ConstColumn[Long],
      maxOffset: ConstColumn[Long],
      max: ConstColumn[Long]) = {
    baseTableQuery()
      .filter(_.tags.like(tag))
      .sortBy(_.ordering.asc)
      .filter(row => row.ordering > offset && row.ordering <= maxOffset)
      .take(max)
  }

  val eventsByTag = Compiled(_eventsByTag _)

  private def _journalSequenceQuery(from: ConstColumn[Long], limit: ConstColumn[Long]) =
    JournalTable.filter(_.ordering > from).map(_.ordering).sorted.take(limit)

  val journalSequenceQuery = Compiled(_journalSequenceQuery _)

  val maxJournalSequenceQuery = Compiled {
    JournalTable.map(_.ordering).max.getOrElse(0L)
  }
}


text:
package com.autotest.mybatis;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.mybatis.generator.api.GeneratedXmlFile;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.xml.Attribute;
import org.mybatis.generator.api.dom.xml.Document;
import org.mybatis.generator.api.dom.xml.TextElement;
import org.mybatis.generator.api.dom.xml.XmlElement;
import org.mybatis.generator.internal.util.StringUtility;
import org.mybatis.generator.internal.util.messages.Messages;

/**
 * Created by huairen on 2017/8/2.
 */
public class MapperConfigPlugin extends PluginAdapter {
    private List<String> mapperFiles = new ArrayList();

    public MapperConfigPlugin() {
    }

    @Override
    public boolean validate(List<String> warnings) {
        boolean valid = true;
        if (!StringUtility.stringHasValue(this.properties.getProperty("targetProject"))) {
            warnings.add(Messages.getString("ValidationError.18", "MapperConfigPlugin", "targetProject"));
            valid = false;
        }

        if (!StringUtility.stringHasValue(this.properties.getProperty("targetPackage"))) {
            warnings.add(Messages.getString("ValidationError.18", "MapperConfigPlugin", "targetPackage"));
            valid = false;
        }

        return valid;
    }

    @Override
    public List<GeneratedXmlFile> contextGenerateAdditionalXmlFiles() {
        Document document = new Document("-//mybatis.org//DTD Config 3.0//EN", "http://mybatis.org/dtd/mybatis-3-config.dtd");
        XmlElement root = new XmlElement("configuration");
        document.setRootElement(root);
        root.addElement(new TextElement("<!--"));
        root.addElement(new TextElement("  This file is generated by MyBatis Generator."));
        root.addElement(new TextElement("-->"));
        XmlElement mappers = new XmlElement("mappers");
        root.addElement(mappers);
        Iterator var6 = this.mapperFiles.iterator();

        while (var6.hasNext()) {
            String mapperFile = (String) var6.next();
            XmlElement mapper = new XmlElement("mapper");
            mapper.addAttribute(new Attribute("resource", mapperFile));
            mappers.addElement(mapper);
        }

        GeneratedXmlFile gxf = new GeneratedXmlFile(document, this.properties.getProperty("fileName", "MapperConfig.xml"), this.properties.getProperty("targetPackage"), this.properties.getProperty("targetProject"), false, this.context.getXmlFormatter());
        List<GeneratedXmlFile> answer = new ArrayList(1);
        answer.add(gxf);
        return answer;
    }

    @Override
    public boolean sqlMapGenerated(GeneratedXmlFile sqlMap, IntrospectedTable introspectedTable) {
        StringBuilder sb = new StringBuilder();
        sb.append(sqlMap.getTargetPackage());
        sb.append('.');
        String temp = sb.toString();
        sb.setLength(0);
        sb.append(temp.replace('.', '/'));
        sb.append(sqlMap.getFileName());
        this.mapperFiles.add(sb.toString());
        return true;
    }
}


text:
namespace Beekeeper.Data.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class Add_Number_To_Hives : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.Hives", "Number", c => c.Int(nullable: false));
        }

        public override void Down()
        {
            DropColumn("dbo.Hives", "Number");
        }
    }
}


text:
package com.android.easyrouter.util;

/**
 * Created by liuzhao on 2017/9/17.
 */

public class EasyRouterConstant {
    public static String ORIGINALURL = "original_url";// 原始的url
    public static int IntentWraperType_Fragment = 1;
}


text:
<?php
namespace Cupon\OfertaBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Cupon\OfertaBundle\Util\Util;

/**
* @ORM\Entity(repositoryClass="Cupon\OfertaBundle\Entity\OfertaRepository")
* @ORM\Table(name="ProyectoCupon_Oferta")
*/
class Oferta {
	/**
	* @ORM\Id
	* @ORM\Column(type="integer")
	* @ORM\GeneratedValue
	*/
  protected $id;

  /** @ORM\Column(type="string", length=255) */
  protected $nombre;

  /** @ORM\Column(type="string", length=255) */
  protected $slug;

  /** @ORM\Column(type="text") */
  protected $descripcion;

  /** @ORM\Column(type="text") */
  protected $condiciones;
    /**
     * @ORM\Column(type="string")
     */
    protected $rutaFoto;

  /** @ORM\Column(type="decimal") */
  protected $foto;

  /** @ORM\Column(type="string", length=255) */
  protected $precio;

  /** @ORM\Column(type="string", length=255) */
  protected $descuento;

  /** @ORM\Column(type="datetime") */
  protected $fecha_publicacion;

  /** @ORM\Column(type="datetime") */
  protected $fecha_expiracion;

  /** @ORM\Column(type="integer") */
  protected $compras;

  /** @ORM\Column(type="integer") */
  protected $umbral;

  /** @ORM\Column(type="boolean") */
  protected $revisada;

  /** @ORM\ManyToOne(targetEntity="Cupon\CiudadBundle\Entity\Ciudad") */
  private $ciudad;
  /** @ORM\ManyToOne(targetEntity="Cupon\TiendaBundle\Entity\Tienda") */
  private $tienda;

  public function __toString()
  {
      return $this->getNombre();
  }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     * @return Oferta
     */
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;
        $this->slug = Util::getSlug($nombre);
        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Set slug
     *
     * @param string $slug
     * @return Oferta
     */
    public function setSlug($slug)
    {
        $this->slug = $slug;

        return $this;
    }

    /**
     * Get slug
     *
     * @return string
     */
    public function getSlug()
    {
        return $this->slug;
    }

    /**
     * Set description
     *
     * @param string $description
     * @return Oferta
     */
    public function setDescripcion($descripcion)
    {
        $this->descripcion = $descripcion;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescripcion()
    {
        return $this->descripcion;
    }

    /**
     * Set condiciones
     *
     * @param string $condiciones
     * @return Oferta
     */
    public function setCondiciones($condiciones)
    {
        $this->condiciones = $condiciones;

        return $this;
    }

    /**
     * Get condiciones
     *
     * @return string
     */
    public function getCondiciones()
    {
        return $this->condiciones;
    }

    /**
     * Set foto
     *
     * @param string $foto
     * @return Oferta
     */
    public function setFoto($foto)
    {
        $this->foto = $foto;

        return $this;
    }

    /**
     * Get foto
     *
     * @return string
     */
    public function getFoto()
    {
        return $this->foto;
    }

    /**
     * Set precio
     *
     * @param string $precio
     * @return Oferta
     */
    public function setPrecio($precio)
    {
        $this->precio = $precio;

        return $this;
    }

    /**
     * Get precio
     *
     * @return string
     */
    public function getPrecio()
    {
        return $this->precio;
    }

    /**
     * Set descuento
     *
     * @param string $descuento
     * @return Oferta
     */
    public function setDescuento($descuento)
    {
        $this->descuento = $descuento;

        return $this;
    }

    /**
     * Get descuento
     *
     * @return string
     */
    public function getDescuento()
    {
        return $this->descuento;
    }

    /**
     * Set fecha_publicacion
     *
     * @param \DateTime $fechaPublicacion
     * @return Oferta
     */
    public function setFechaPublicacion($fechaPublicacion)
    {
        $this->fecha_publicacion = $fechaPublicacion;

        return $this;
    }

    /**
     * Get fecha_publicacion
     *
     * @return \DateTime
     */
    public function getFechaPublicacion()
    {
        return $this->fecha_publicacion;
    }

    /**
     * Set compras
     *
     * @param integer $compras
     * @return Oferta
     */
    public function setCompras($compras)
    {
        $this->compras = $compras;

        return $this;
    }

    /**
     * Get compras
     *
     * @return integer
     */
    public function getCompras()
    {
        return $this->compras;
    }

    /**
     * Set umbral
     *
     * @param integer $umbral
     * @return Oferta
     */
    public function setUmbral($umbral)
    {
        $this->umbral = $umbral;

        return $this;
    }

    /**
     * Get umbral
     *
     * @return integer
     */
    public function getUmbral()
    {
        return $this->umbral;
    }

    /**
     * Set revisada
     *
     * @param boolean $revisada
     * @return Oferta
     */
    public function setRevisada($revisada)
    {
        $this->revisada = $revisada;

        return $this;
    }

    /**
     * Get revisada
     *
     * @return boolean
     */
    public function getRevisada()
    {
        return $this->revisada;
    }

    /**
     * Set ciudad
     *
     * @param string $ciudad
     * @return Oferta
     */
    public function setCiudad($ciudad)
    {
        $this->ciudad = $ciudad;

        return $this;
    }

    /**
     * Get ciudad
     *
     * @return string
     */
    public function getCiudad()
    {
        return $this->ciudad;
    }

    /**
     * Set tienda
     *
     * @param string $tienda
     * @return Oferta
     */
    public function setTienda($tienda)
    {
        $this->tienda = $tienda;

        return $this;
    }

    /**
     * Get tienda
     *
     * @return string
     */
    public function getTienda()
    {
        return $this->tienda;
    }

    /**
     * Set fecha_expiracion
     *
     * @param \DateTime $fechaExpiracion
     * @return Oferta
     */
    public function setFechaExpiracion($fechaExpiracion)
    {
        $this->fecha_expiracion = $fechaExpiracion;

        return $this;
    }

    /**
     * Get fecha_expiracion
     *
     * @return \DateTime
     */
    public function getFechaExpiracion()
    {
        return $this->fecha_expiracion;
    }
    /**
     * Set rutaFoto
     *
     * @param string $foto
     */
    public function setRutaFoto($rutaFoto)
    {
        $this->rutaFoto = $rutaFoto;
    }

    /**
     * Get rutaFoto
     *
     * @return string
     */
    public function getRutaFoto()
    {
        return $this->rutaFoto;
    }
}


text:
<title>Exemplo de cabeçalho</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

item de uma lista

item de uma lista, que pode ser tão grande quanto se queira, sem que seja necessário se preocupar com a formatação das margens de texto

item


text:
import sys

from protocol import launch_protocol
from confparser import load_config

from expyriment import design, control, stimuli, io

# %%
# ======================== SET DEVELOPMENT MODE ===============================
# For older versions than 0.9.0 (compatible with 0.9.0)
control.set_develop_mode(False)

# %%
# ========================== SET DEFAULT KEYS =================================
# Prevent 'p' key to pause the experiment
control.defaults.pause_key = None

# %%
# ========== SET COMMAND-LINE ARGUMENTS TO BE PASSED TO THE SCRIPT ============
assert(len(sys.argv) > 1), "No arg was introduced. " + \
                           "You must pass two valid args to the script."
gender_stim = sys.argv[1]
assert(gender_stim in ['male', 'female']), \
    "Not valid arg for gender. Please use either male or female."
assert(len(sys.argv) > 2), "The second arg was not introduced. " + \
                           "You must pass a second valid arg to the script."
exp_version = sys.argv[2]
assert(exp_version in ['1', '2']), \
    "Not valid arg for number of inputs' vs. Please use either 1 or 2."

# %%
# ========================== INITIALIZATION ===================================
#
# (1) Present the startup screen with the countdown;
# (2) Start an experimental clock, create the screen;
# (3) Create an event file;
# (4) Present "Preparing experiment"
#
# =============================================================================
# Define global variable for the experiment
exp = design.Experiment('self_reference_' + gender_stim + '_' + exp_version,
                        foreground_colour=(255, 255, 255))

control.initialize(exp)

# %%
# ============================== MENU =========================================
# Preset the menu

setting_mm = load_config('config_self_main_menu.ini')

menu_options = [setting_mm["train_sess"], setting_mm["main_sess"],
                setting_mm["exit"]]

task_title = setting_mm["protocol_title"]

# Use the next command line if you're running Expyriment vs. O.7.0 on Windows
# menu_options = [s.decode('utf-8').encode('cp1252') for s in menu_options]
# task_title = task_title.decode('utf-8').encode('cp1252')
# Use the next two command lines for the customized vs of Expyriment vs. O.7.0
# in Win laptop of the IBC acquisitions
menu_options = [s.decode('utf-8') for s in menu_options]
task_title = task_title.decode('utf-8')

display_note = stimuli.TextLine(setting_mm["note"].decode('utf-8'),
                                text_size=24, text_colour=(0, 160, 230),
                                position=(0, -300))

menu = io.TextMenu(task_title, menu_options, width=1000, text_size=28, gap=10,
                   background_stimulus=display_note)

# Launch the menu (default_preselected_item = 'Expérience principale')
selected_option = menu.get(1)

# Call the functions according to the options selected in the menu
while True:
    # Launch option: "Session d'entraînement"
    if selected_option == 0:
        launch_protocol("config_self_training_session.ini", exp,
                        gender_stim, exp_version)
    # Launch option: "Expérience principale"
    elif selected_option == 1:
        launch_protocol("config_self_main_session.ini", exp,
                        gender_stim, exp_version)
    # Launch option: "Sortie"
    else:
        break
    # Goes back to the main menu after quitting any option
    # (except for the last one)
    if selected_option < (len(menu_options) - 1):
        exp = design.Experiment('self_reference',
                                foreground_colour=(255, 255, 255))
        control.initialize(exp)
        menu_options = [setting_mm["train_sess"], setting_mm["main_sess"],
                        setting_mm["exit"]]

        task_title = setting_mm["protocol_title"]

        menu_options = [s.decode('utf-8') for s in menu_options]
        task_title = task_title.decode('utf-8')

        menu = io.TextMenu(task_title, menu_options, width=1000,
                           text_size=28, gap=10,
                           background_stimulus=display_note)
        selected_option = menu.get(1)

control.end(fast_quit=1)


text:
package org.apache.uima.fit.component;

import static org.apache.uima.fit.factory.CollectionReaderFactory.createReader;
import static org.junit.Assert.assertEquals;

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

import org.apache.commons.io.FileUtils;
import org.apache.uima.cas.CAS;
import org.apache.uima.collection.CollectionException;
import org.apache.uima.collection.CollectionReader;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.jcas.JCas;
import org.apache.uima.util.CasCreationUtils;
import org.apache.uima.util.Progress;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

/**
 * Test {@link JCasCollectionReader_ImplBase}
 *
 */
public class JCasCollectionReader_ImplBaseTest {

  @Rule
  public TemporaryFolder folder = new TemporaryFolder();

  /**
   * Test using a simple reader reading one text file.
   *
   * @throws Exception
   *           if an error occurs.
   */
  @Test
  public void test() throws Exception {
    File file = folder.newFile("test.txt");
    FileUtils.write(file, "Aaa Bbbb Cc Dddd eeee ff .", "UTF-8");

    CollectionReader reader = createReader(SingleTextReader.class,
            SingleTextReader.PARAM_FILE, file.getPath());

    CAS cas = CasCreationUtils.createCas(reader.getProcessingResourceMetaData());
    reader.getNext(cas);
    reader.close();

    assertEquals(FileUtils.readFileToString(file, "UTF-8"), cas.getDocumentText());
  }

  public static class SingleTextReader extends JCasCollectionReader_ImplBase {
    public static final String PARAM_FILE = "File";

    @ConfigurationParameter(name = PARAM_FILE, mandatory = true)
    private File file;

    public boolean hasNext() throws IOException, CollectionException {
      return file != null;
    }

    public Progress[] getProgress() {
      return new Progress[0];
    }

    @Override
    public void getNext(JCas jCas) throws IOException, CollectionException {
      jCas.setDocumentText(FileUtils.readFileToString(file, "UTF-8"));
    }
  }
}


text:
if [ `id -u` -ne 0 ]; then
    echo "$0: FATAL: need root privileges" 1>&2
    exit 1
fi

cd /home/mlab_neubot

if [ -f neubot.tar.gz ]; then

    if [ -x /home/mlab_neubot/neubot/M-Lab/uninstall.sh ]; then
        echo "uninstall previous neubot"
        /home/mlab_neubot/neubot/M-Lab/uninstall.sh
    fi

    echo "extract new neubot"
    tar -xzf neubot.tar.gz

    echo "install new neubot"
    /home/mlab_neubot/neubot/M-Lab/install.sh

    # Note: would be wrong to cleanup because tarball is installed by the RPM
    #echo "cleanup"
    #rm -rf neubot.tar.gz

else
    echo "FATAL: neubot.tar.gz missing" 1>&2
    exit 1
fi


text:
namespace UnityEditor.ShaderGraph
{
    class TestNode : AbstractMaterialNode
    {
    }
}