text:
package helpers

import (
	"labix.org/v2/mgo"
	"labix.org/v2/mgo/bson"
	"code.google.com/p/go.crypto/bcrypt"
	"github.com/elcct/amazingwebsite/models"
)

func Login(c *mgo.Database, email string, password string) (user *models.User, err error) {
	err = c.C("users").Find(bson.M{"e": email}).One(&user)
	if err != nil {
		return
	}

	err = bcrypt.CompareHashAndPassword(user.Password, []byte(password))
	if err != nil {
		user = nil
	}
	return
}


text:
namespace ClownCrew.GitBitch.Client.Model
{
    public enum Source { ListenerAgent, CommandAgent }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item android:id="@+id/log_out"
        android:title="@string/log_out"
        app:showAsAction="never"/>
</menu>


text:
// -----------------------------------------------------------------------
// <copyright file="TriangleFile.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------

namespace MeshExplorer.IO.Formats
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using TriangleNet.IO;
    using System.IO;
    using TriangleNet.Geometry;
    using TriangleNet;

    /// <summary>
    /// Read and write files defined in classic Triangle format.
    /// </summary>
    public class TriangleFile : IMeshFile
    {
        TriangleFormat format = new TriangleFormat();

        /// <summary>
        /// Gets the supported file extensions.
        /// </summary>
        public string[] Extensions
        {
            get { return new string[] { ".node", ".poly", ".ele" }; }
        }

        public bool ContainsMeshData(string filename)
        {
            string ext = Path.GetExtension(filename);

            if (ext == ".node" || ext == ".poly")
            {
                if (File.Exists(Path.ChangeExtension(filename, ".ele")))
                {
                    return true;
                }
            }

            return (ext == ".ele");
        }

        public InputGeometry Read(string filename)
        {
            return format.Read(filename);
        }

        public Mesh Import(string filename)
        {
            return format.Import(filename);
        }

        public void Write(Mesh mesh, string filename)
        {
            if (mesh.Vertices.Count > 0)
            {
                format.Write(mesh, filename);
            }
        }
    }
}


text:
Package.describe({
  name: 'skinnygeek1010:flux-helpers',
  version: '0.1.0',
  summary: 'Helpers to make flux easier to use with Meteor',
  git: 'https://github.com/AdamBrodzinski/meteor-flux-helpers.git',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');
  api.addFiles('flux-helpers.js');
  api.export('trackViewer');
  api.export('trackCollection');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('skinnygeek1010:flux-helpers');
  api.addFiles('flux-helpers-tests.js');
});


text:
package org.kie.remote.services.rest;

import static org.kie.internal.remote.PermissionConstants.*;
import java.util.Map;

import javax.annotation.security.RolesAllowed;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;

import org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentUnitList;
import org.kie.services.client.serialization.jaxb.impl.process.JaxbProcessDefinitionList;

/**
 * This resource is responsible for retrieving overview information about all deployment units.
 */
@Path("/deployment")
@RequestScoped
public class DeploymentsResourceImpl extends ResourceBase {

    @Context
    private HttpHeaders headers;

    /* Deployment operations */

    @Inject
    private DeployResourceBase deployResourceBase;

    // REST operations -----------------------------------------------------------------------------------------------------------

    /**
     * Return a (paginated) list of the available deployments, sorted alphabetically by deployment id.
     * @return A {@link JaxbDeploymentUnitList} instance
     */
    @GET
    @RolesAllowed({REST_ROLE, REST_DEPLOYMENT_ROLE})
    public Response listDeployments() {
        String oper = getRelativePath();
        Map<String, String[]> params = getRequestParams();
        int [] pageInfo = getPageNumAndPageSize(params, oper);
        int maxNumResults = getMaxNumResultsNeeded(pageInfo);

       JaxbDeploymentUnitList resultList = deployResourceBase.getDeploymentList(pageInfo, maxNumResults);

        return createCorrectVariant(resultList, headers);
    }

    /**
     * Return a list of process definition information, sorted alphabetically by deployment id.
     * @return
     */
    @GET
    @Path("/processes")
    @RolesAllowed({REST_ROLE, REST_DEPLOYMENT_ROLE})
    public Response listProcessDefinitions() {
        String oper = getRelativePath();
        Map<String, String[]> params = getRequestParams();
        int [] pageInfo = getPageNumAndPageSize(params, oper);
        int maxNumResults = getMaxNumResultsNeeded(pageInfo);

        JaxbProcessDefinitionList resultList = deployResourceBase.getProcessDefinitionList(pageInfo, maxNumResults);

        return createCorrectVariant(resultList, headers);
    }
}


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2005 The PHP Group                                |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at                              |
// | http://www.php.net/license/2_02.txt.                                 |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to          |
// | license@php.net so we can mail you a copy immediately.               |
// +----------------------------------------------------------------------+
// | Author: Andrew Nagy <asnagy@webitecture.org>                         |
// +----------------------------------------------------------------------+
//
// $Id: XLS.php,v 1.16 2005/01/10 15:15:49 asnagy Exp $

require_once 'Spreadsheet/Excel/Writer.php';

/**
 * Structures_DataGrid_Renderer_XLS Class
 *
 * @version  $Revision: 1.16 $
 * @author   Andrew S. Nagy <asnagy@webitecture.org>
 * @access   public
 * @package  Structures_DataGrid
 * @category Structures
 */
class Structures_DataGrid_Renderer_XLS
{
    /**
     * The Datagrid object to render
     * @var object Structures_DataGrid
     */
    var $_dg;

    /**
     * The spreadsheet object
     * @var object Spreadsheet_Excel_Writer
     */
    var $_workbook;

    /**
     * The worksheet object
     * @var object Spreadsheet_Excel_Writer
     */
    var $_worksheet;

    /**
     * The filename of the spreadsheet
     * @var string
     */
    var $_filename = 'spreadsheet.xls';

    /**
     * A switch to determine to use the header
     * @var bool
     */
    var $header = true;

    /**
     * A switch to determine the state of the spreadsheet
     * @var bool
     */
    var $_rendered = false;

    /**
     * Constructor
     *
     * Build default values
     *
     * @param   object Structures_DataGrid  $dg     The datagrid to render.
     * @access public
     */
    function Structures_DataGrid_Renderer_XLS(&$dg)
    {
        $this->_dg =& $dg;

        $this->_workbook = new Spreadsheet_Excel_Writer();
        $this->setFilename();
        $this->_worksheet =& $this->_workbook->addWorksheet();
    }

    /**
     * Sets the name of the file to create
     *
     * @param  string   $filename   The name of the file
     * @access public
     */
    function setFilename($filename = 'spreadsheet.xls')
    {
        $this->_filename = $filename;
        $this->_workbook->send($filename);
    }

    /**
     * Determines whether or not to use the header
     *
     * @access  public
     * @param   bool    $bool   value to determine to use the header or not.
     */
    function useHeader($bool)
    {
        $this->header = (bool)$bool;
    }

    /**
     * Sets the rendered status.  This can be used to "flush the cache" in case
     * you need to render the datagrid twice with the second time having changes
     *
     * @access  public
     * @params  bool        $status     The rendered status of the DataGrid
     */
    function setRendered($status)
    {
        $this->_rendered = (bool)$status;
    }

    /**
     * Force download the spreadsheet
     *
     * @access  public
     */
    function render()
    {
        $this->getSpreadsheet();

        $this->_workbook->close();
    }

    /**
     * Get the spreadsheet object
     *
     * @access  public
     */
    function &getSpreadsheet()
    {
        $dg =& $this->_dg;

        if (!$this->_rendered) {
            // Get the data to be rendered
            $dg->fetchDataSource();

            // Check to see if column headers exist, if not create them
            // This must follow after any fetch method call
            $dg->_setDefaultHeaders();

            if ($this->header) {
                $this->_buildHeader();
            }
            $this->_buildBody();
            $this->_rendered = true;
        }

        return $this->_workbook;
    }

    /**
     * Handles building the header of the DataGrid
     *
     * @access  private
     * @return  void
     */
    function _buildHeader()
    {
        $cnt = 0;
        foreach ($this->_dg->columnSet as $column) {
            //Define Content
            $str = $column->columnName;
            $this->_worksheet->write(0, $cnt, $str);
            $cnt++;
        }
    }

    /**
     * Handles building the body of the DataGrid
     *
     * @access  private
     * @return  void
     */
    function _buildBody()
    {
        if (count($this->_dg->recordSet)) {

            // Determine looping values
            if ($this->_dg->page > 1) {
                $begin = ($this->_dg->page - 1) * $this->_dg->rowLimit;
                $limit = $this->_dg->page * $this->_dg->rowLimit;
            } else {
                $begin = 0;
                if ($this->_dg->rowLimit == null) {
                    $limit = count($this->_dg->recordSet);
                } else {
                    $limit = $this->_dg->rowLimit;
                }
            }

            // Begin loop
            for ($i = $begin; $i < $limit; $i++) {
                $cnt = 0;
                $row = $this->_dg->recordSet[$i];
                foreach ($this->_dg->columnSet as $column) {
                    $rowCnt = ($i-$begin)+1;

                    // Build Content
                    if ($column->formatter != null) {
                        $content = $column->formatter($row);
                    } elseif ($column->fieldName == null) {
                        if ($column->autoFillValue != null) {
                            $content = $column->autoFillValue;
                        } else {
                            $content = $column->columnName;
                        }
                    } else {
                        $content = $row[$column->fieldName];
                    }

                    $this->_worksheet->write($rowCnt, $cnt, $content);

                    $cnt++;
                }
            }
        }
    }

}

?>


text:
//******************************************************************************************************************************************************************************************//
// Public Domain                                                                                //
//                                                                                //
// Written by Peter O. in 2014.                                                                                //
//                                                                                //
// Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/                                                                                //
//                                                                                //
// If you like this, you should donate to Peter O. at: http://peteroupc.github.io/                                                                                //
//******************************************************************************************************************************************************************************************//
using System;

namespace Neos.IdentityServer.MultiFactor.WebAuthN.Library.Cbor.Numbers
{
  /// Exception thrown for arithmetic trap errors. (The "E"
  /// stands for "extended", and has this prefix to group it with the
  /// other classes common to this library, particularly EDecimal,
  /// EFloat, and ERational.).
  /// <para>This library may throw exceptions of this type in certain
  /// cases, notably when errors occur, and may supply messages to those
  /// exceptions (the message can be accessed through the <c>Message</c>
  /// property in.NET or the <c>getMessage()</c> method in Java). These
  /// messages are intended to be read by humans to help diagnose the
  /// error (or other cause of the exception); they are not intended to
  /// be parsed by computer programs, and the exact text of the messages
  /// may change at any time between versions of this
  /// library.</para>
  #if NET20 || NET40
  [Serializable]
  #endif
  public sealed class ETrapException : ArithmeticException {
    private readonly Object result;
    private readonly EContext ctx;

    /// Gets the arithmetic context used during the operation that
    /// triggered the trap. May be null.
    /// <value>The arithmetic context used during the operation that
    /// triggered the trap. May be null.</value>
    public EContext Context {
      get {
        return this.ctx;
      }
    }

    private readonly int error;

    private readonly int errors;

    /// Initializes a new instance of the
    /// <see cref='PeterO.Numbers.ETrapException'/> class.
    public ETrapException() : this(FlagToMessage(EContext.FlagInvalid)) {
    }

    /// Initializes a new instance of the
    /// <see cref='PeterO.Numbers.ETrapException'/> class.
    /// <param name='message'>The parameter <paramref name='message'/> is a
    /// text string.</param>
    public ETrapException(string message) : base(message) {
      this.error = EContext.FlagInvalid;
      this.errors = EContext.FlagInvalid;
      this.ctx = null;
      this.result = null;
    }

    /// Initializes a new instance of the
    /// <see cref='PeterO.Numbers.ETrapException'/> class.
    /// <param name='message'>The parameter <paramref name='message'/> is a
    /// text string.</param>
    /// <param name='innerException'>The parameter <paramref
    /// name='innerException'/> is an Exception object.</param>
    public ETrapException(string message, Exception innerException)
      : base(message, innerException) {
      this.error = EContext.FlagInvalid;
      this.errors = EContext.FlagInvalid;
      this.ctx = (this.ctx == null) ? null : this.ctx.Copy();
      this.result = null;
    }

    /// Gets the defined result of the operation that caused the
    /// trap.
    /// <value>The defined result of the operation that caused the
    /// trap.</value>
    public Object Result {
      get {
        return this.result;
      }
    }

    /// Gets the flag that specifies the primary kind of error in
    /// one or more operations (EContext.FlagXXX). This will only be one
    /// flag, such as <c>FlagInexact</c> or FlagSubnormal.
    /// <value>The flag that specifies the primary kind of error in one or
    /// more operations.</value>
    public int Error {
      get {
        return this.error;
      }
    }

    /// Gets the flags that were signaled as the result of one or
    /// more operations. This includes the flag specified in the "flag"
    /// parameter, but can include other flags. For instance, if "flag" is
    /// <c>EContext.FlagInexact</c>, this parameter might be
    /// <c>EContext.FlagInexact | EContext.FlagRounded</c>.
    /// <value>The flags that specify the errors in one or more
    /// operations.</value>
    public int Errors {
      get {
        return this.errors;
      }
    }

    /// Returns whether this trap exception specifies all the
    /// flags given. (Flags are signaled in a trap exception as the result
    /// of one or more operations involving arbitrary-precision numbers,
    /// such as multiplication of two EDecimals.).
    /// <param name='flag'>A combination of one or more flags, such as
    /// <c>EContext.FlagInexact | EContext.FlagRounded</c>.</param>
    /// <returns>True if this exception pertains to all of the flags given
    /// in <paramref name='flag'/> ; otherwise, false.</returns>
    public bool HasError(int flag) {
      return (this.Error & flag) == flag;
    }

    private static string FlagToMessage(int flags) {
      var sb = new System.Text.StringBuilder();
      var first = true;
      for (var i = 0; i < 32; ++i) {
        int flag = 1 << i;
        if ((flags & flag) != 0) {
          if (!first) {
            sb.Append(", ");
          }
          first = false;
          string str = (flag == EContext.FlagClamped) ? "Clamped" : ((flag ==
                EContext.FlagDivideByZero) ? "DivideByZero" : ((flag ==
                  EContext.FlagInexact) ? "Inexact" : ((flag ==
                    EContext.FlagInvalid) ? "Invalid" : ((flag ==
                      EContext.FlagOverflow) ? "Overflow" : ((flag ==
                        EContext.FlagRounded) ? "Rounded" : ((flag ==
                          EContext.FlagSubnormal) ? "Subnormal" : ((flag ==
                            EContext.FlagUnderflow) ? "Underflow" :
"Trap")))))));
          sb.Append(str);
        }
      }
      return sb.ToString();
    }

    /// Initializes a new instance of the
    /// <see cref='PeterO.Numbers.ETrapException'/> class.
    /// <param name='flag'>The flag that specifies the kind of error from
    /// one or more operations (EContext.FlagXXX). This will only be one
    /// flag, such as <c>FlagInexact</c> or FlagSubnormal.</param>
    /// <param name='ctx'>The arithmetic context used during the operation
    /// that triggered the trap. Can be null.</param>
    /// <param name='result'>The defined result of the operation that
    /// caused the trap.</param>
    public ETrapException(int flag, EContext ctx, Object result)
      : this(flag, flag, ctx, result) {
    }

    /// Initializes a new instance of the
    /// <see cref='PeterO.Numbers.ETrapException'/> class.
    /// <param name='flags'>Specifies the flags that were signaled as the
    /// result of one or more operations. This includes the flag specified
    /// in the "flag" parameter, but can include other flags. For instance,
    /// if "flag" is <c>EContext.FlagInexact</c>, this parameter might be
    /// <c>EContext.FlagInexact | EContext.FlagRounded</c>.</param>
    /// <param name='flag'>Specifies the flag that specifies the primary
    /// kind of error from one or more operations (EContext.FlagXXX). This
    /// will only be one flag, such as <c>FlagInexact</c> or
    /// FlagSubnormal.</param>
    /// <param name='ctx'>The arithmetic context used during the operation
    /// that triggered the trap. Can be null.</param>
    /// <param name='result'>The defined result of the operation that
    /// caused the trap.</param>
    /// <exception cref='ArgumentException'>The parameter <paramref
    /// name='flags'/> doesn't include all the flags in the <paramref
    /// name='flag'/> parameter.</exception>
    public ETrapException(int flags, int flag, EContext ctx, Object result)
      : base(FlagToMessage(flags)) {
      if ((flags & flag) != flag) {
        throw new ArgumentException("flags doesn't include flag");
      }
      this.error = flag;
      this.errors = flags;
      this.ctx = (ctx == null) ? null : ctx.Copy();
      this.result = result;
    }

    #if NET20 || NET40
    private ETrapException(
      System.Runtime.Serialization.SerializationInfo info,
      System.Runtime.Serialization.StreamingContext context)
      : base(info, context) {
    }
    #endif
  }
}


text:
<?php

namespace GreenBlue\FrontEndBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use GreenBlue\FrontEndBundle\Entity\Contact;
use GreenBlue\FrontEndBundle\Form\ContactType;

/**
 * Contact controller.
 *
 * @Route("/crud/contact")
 */
class ContactController extends Controller
{
    /**
     * Lists all Contact entities.
     *
     * @Route("/", name="crud_contact")
     * @Template()
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entities = $em->getRepository('GreenBlueFrontEndBundle:Contact')->findAll();

        return array('entities' => $entities);
    }

    /**
     * Finds and displays a Contact entity.
     *
     * @Route("/{id}/show", name="crud_contact_show")
     * @Template()
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('GreenBlueFrontEndBundle:Contact')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Contact entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),        );
    }

    /**
     * Displays a form to create a new Contact entity.
     *
     * @Route("/new", name="crud_contact_new")
     * @Template()
     */
    public function newAction()
    {
        $entity = new Contact();
        $form   = $this->createForm(new ContactType(), $entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }

    /**
     * Creates a new Contact entity.
     *
     * @Route("/create", name="crud_contact_create")
     * @Method("post")
     * @Template("GreenBlueFrontEndBundle:Contact:new.html.twig")
     */
    public function createAction()
    {
        $entity  = new Contact();
        $request = $this->getRequest();
        $form    = $this->createForm(new ContactType(), $entity);
        $form->bindRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('crud_contact_show', array('id' => $entity->getId())));

        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }

    /**
     * Displays a form to edit an existing Contact entity.
     *
     * @Route("/{id}/edit", name="crud_contact_edit")
     * @Template()
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('GreenBlueFrontEndBundle:Contact')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Contact entity.');
        }

        $editForm = $this->createForm(new ContactType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Edits an existing Contact entity.
     *
     * @Route("/{id}/update", name="crud_contact_update")
     * @Method("post")
     * @Template("GreenBlueFrontEndBundle:Contact:edit.html.twig")
     */
    public function updateAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('GreenBlueFrontEndBundle:Contact')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Contact entity.');
        }

        $editForm   = $this->createForm(new ContactType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        $request = $this->getRequest();

        $editForm->bindRequest($request);

        if ($editForm->isValid()) {
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('crud_contact_edit', array('id' => $id)));
        }

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Deletes a Contact entity.
     *
     * @Route("/{id}/delete", name="crud_contact_delete")
     * @Method("post")
     */
    public function deleteAction($id)
    {
        $form = $this->createDeleteForm($id);
        $request = $this->getRequest();

        $form->bindRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getEntityManager();
            $entity = $em->getRepository('GreenBlueFrontEndBundle:Contact')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Contact entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('crud_contact'));
    }

    private function createDeleteForm($id)
    {
        return $this->createFormBuilder(array('id' => $id))
            ->add('id', 'hidden')
            ->getForm()
        ;
    }
}


text:
package org.nekorp.workflow.desktop.servicio.reporte.cliente;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.nekorp.workflow.desktop.modelo.reporte.cliente.EventoRC;
import org.nekorp.workflow.desktop.modelo.reporte.cliente.ReporteCliente;
import org.springframework.stereotype.Component;

/**
 *
 */
@Component
public class BitacoraReporteCliente extends AbstractSeccionXLS implements GeneradorSeccionXLS {

    private String[] atributos = new String[] {
        "nombreEvento",
        "detalle",
        "fecha",
        "etiqueta"
    };

    @Override
    public BordeSeccion generar(BordeSeccion borde, ContextoSeccion contexto, ReporteCliente datos) {
        Sheet sheet = contexto.getSheet();
        XSSFWorkbook wb = contexto.getWb();
        int initialRow = borde.getUpperRow();
        int initialColumn = borde.getLeftColumn();
        BordeSeccion r = new BordeSeccion();
        r.setLeftColumn(initialColumn);
        r.setUpperRow(initialRow);

        Row row = getRow(sheet, initialRow);
        Cell cell = row.createCell(initialColumn);
        cell.setCellValue("Bitacora");
        XSSFCellStyle cellStyle = wb.createCellStyle();
        addHeaderStyle(cellStyle, wb);
        addBorders(wb, cellStyle, CellStyle.BORDER_MEDIUM);
        cell.setCellStyle(cellStyle);

        for (int i = 1; i < 4; i++) {
            cell = row.createCell(initialColumn + i);
            cellStyle = wb.createCellStyle();
            addBorders(wb, cellStyle, CellStyle.BORDER_MEDIUM);
            cell.setCellStyle(cellStyle);
        }

        //merge de celdas
        sheet.addMergedRegion(new CellRangeAddress(
                initialRow, //first row (0-based)
                initialRow, //last row  (0-based)
                initialColumn, //first column (0-based)
                initialColumn + 3  //last column  (0-based)
        ));

        CreationHelper createHelper = wb.getCreationHelper();
        for (EventoRC x: datos.getBitacora()) {
            initialRow = initialRow + 1;
            row = getRow(sheet, initialRow);
            for (int i = 0; i < atributos.length; i++) {
                cell = row.createCell(initialColumn + i);
                cellStyle = wb.createCellStyle();
                try {
                    if (atributos[i].equals("fecha")) {
                        cellStyle.setDataFormat(createHelper.createDataFormat().getFormat("yy/m/d h:mm:ss"));
                        cell.setCellValue((Date)PropertyUtils.getProperty(x, atributos[i]));
                    } else {
                        cell.setCellValue(PropertyUtils.getProperty(x, atributos[i]).toString());
                    }
                } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
                    cell.setCellValue("");
                }
                addBorders(wb, cellStyle, CellStyle.BORDER_THIN);
                cell.setCellStyle(cellStyle);
            }
        }
        r.setLowerRow(initialRow);
        r.setRightColumn(initialColumn + 3);
        paintBorder(wb, sheet, CellStyle.BORDER_MEDIUM, r);
        return r;
    }

}


text:
package com.sksamuel.elastic4s.requests.searches.aggs.pipeline

case class CumulativeSumPipelineAgg(name: String,
                                    bucketsPath: String,
                                    format: Option[String] = None,
                                    metadata: Map[String, AnyRef] = Map.empty)
    extends PipelineAgg {

  type T = CumulativeSumPipelineAgg

  def format(format: String): CumulativeSumPipelineAgg                  = copy(format = Some(format))
  def metadata(metadata: Map[String, AnyRef]): CumulativeSumPipelineAgg = copy(metadata = metadata)
}


text:
package org.neptunepowered.common.util.converter;

import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import net.canarymod.api.entity.hanging.Painting;
import net.minecraft.entity.item.EntityPainting;

public class ArtConverter {

    private static BiMap<EntityPainting.EnumArt, Painting.ArtType> map =
            ImmutableBiMap.<EntityPainting.EnumArt, Painting.ArtType>builder()
                    .put(EntityPainting.EnumArt.KEBAB, Painting.ArtType.Kebab)
                    .put(EntityPainting.EnumArt.ALBAN, Painting.ArtType.Alban)
                    .put(EntityPainting.EnumArt.AZTEC, Painting.ArtType.Aztec)
                    .put(EntityPainting.EnumArt.AZTEC_2, Painting.ArtType.Aztec2)
                    .put(EntityPainting.EnumArt.BOMB, Painting.ArtType.Bomb)
                    .put(EntityPainting.EnumArt.PLANT, Painting.ArtType.Plant)
                    .put(EntityPainting.EnumArt.WASTELAND, Painting.ArtType.Wasteland)
                    .put(EntityPainting.EnumArt.POOL, Painting.ArtType.Pool)
                    .put(EntityPainting.EnumArt.COURBET, Painting.ArtType.Courbet)
                    .put(EntityPainting.EnumArt.SEA, Painting.ArtType.Sea)
                    .put(EntityPainting.EnumArt.SUNSET, Painting.ArtType.Sunset)
                    .put(EntityPainting.EnumArt.CREEBET, Painting.ArtType.Creebet)
                    .put(EntityPainting.EnumArt.WANDERER, Painting.ArtType.Wanderer)
                    .put(EntityPainting.EnumArt.GRAHAM, Painting.ArtType.Graham)
                    .put(EntityPainting.EnumArt.MATCH, Painting.ArtType.Match)
                    .put(EntityPainting.EnumArt.BUST, Painting.ArtType.Bust)
                    .put(EntityPainting.EnumArt.STAGE, Painting.ArtType.Stage)
                    .put(EntityPainting.EnumArt.VOID, Painting.ArtType.Void)
                    .put(EntityPainting.EnumArt.SKULL_AND_ROSES, Painting.ArtType.SkullAndRoses)
                    .put(EntityPainting.EnumArt.WITHER, Painting.ArtType.Wither)
                    .put(EntityPainting.EnumArt.FIGHTERS, Painting.ArtType.Fighters)
                    .put(EntityPainting.EnumArt.POINTER, Painting.ArtType.Pointer)
                    .put(EntityPainting.EnumArt.PIGSCENE, Painting.ArtType.Pigscene)
                    .put(EntityPainting.EnumArt.BURNING_SKULL, Painting.ArtType.BurningSkull)
                    .put(EntityPainting.EnumArt.SKELETON, Painting.ArtType.Skeleton)
                    .put(EntityPainting.EnumArt.DONKEY_KONG, Painting.ArtType.DonkeyKong)
                    .build();

    public static Painting.ArtType of(EntityPainting.EnumArt artType) {
        return map.get(artType);
    }

    public static EntityPainting.EnumArt of(Painting.ArtType art) {
        return map.inverse().get(art);
    }
}


text:
import * as React from 'react';
import { Modal, Button } from 'react-bootstrap';
import { SingleSelector, SingleSelectorBuilder } from '../fields/SingleSelector';
import SingleSelectorOptionEditor from '../fields/SingleSelectorOptionEditor';
import { SingleLineTextField, SingleLineTextBuilder } from '../fields/SingleLineTextField';
import SingleLineTextFieldOptionEditor from '../fields/SingleLineTextFieldOptionEditor';
import {
    FieldOptionEditor,
    FormBuilder,
    IField,
    IFieldContext,
    FieldRegistry,
} from 'react-dynamic-formbuilder';

interface IState {
    fields: Array<IField>;
    field: IField;
    editingContext: IFieldContext;
}

const registry: FieldRegistry = new FieldRegistry();
registry.register({
    field: {
        id: '',
        label: 'Please select:',
        type: 'SingleSelector',
        options: {
            selectOpts: ['a', 'b', 'c'],
        }
    },
    type: 'SingleSelector',
    displayName: '单选(selector)',
    input: SingleSelector,
    builder: SingleSelectorBuilder,
    editor: SingleSelectorOptionEditor,
    display: null,
});

registry.register({
    field: {
        id: '',
        label: 'Name',
        type: 'SingleLineTextField',
        options: {
            hint: 'Please enter your name',
            required: true,
            unique: false,
        }
    },
    type: 'SingleLineTextField',
    displayName: '单行输入(input)',
    input: SingleLineTextField,
    builder: SingleLineTextBuilder,
    editor: SingleLineTextFieldOptionEditor,
    display: null,
});

export default class MyApp extends React.Component<{}, IState> {
    private callback: (field: IField) => void;

    constructor() {
        super();
        this.onChangeField = this.onChangeField.bind(this);
        this.closeModal = this.closeModal.bind(this);
        this.onChangeFields = this.onChangeFields.bind(this);
        this.onFieldEditing = this.onFieldEditing.bind(this);
        this.state = {
            fields: [{
                id: 'field1',
                label: 'Please select:',
                type: 'SingleSelector',
                options: {
                    selectOpts: ['a', 'b', 'c'],
                }
            }, {
                id: 'field2',
                label: 'Name',
                type: 'SingleLineTextField',
                options: {
                    hint: 'Please enter your name',
                    required: true,
                    unique: false,
                }
            }],
            field: null,
            editingContext: null,
        };
    }

    private onChangeFields(fields: IField[]) {
        this.setState({ fields } as IState);
    }

    private onChangeField(field: IField, fields: IField[]) {
        this.setState({ field, fields } as IState);
    }

    private closeModal() {
        this.setState({ field: null } as IState);
    }

    private onFieldEditing(field: IField) {
        this.setState({ field } as IState);
    }

    render() {
        let editingFieldId = null;
        if (this.state.field) {
            editingFieldId = this.state.field.id;
        }
        return (
            <div>
                <Modal onHide={this.closeModal} show={!!this.state.field}>
                    <Modal.Body>
                        <FieldOptionEditor
                            onChange={this.onChangeField}
                            registry={registry}
                            field={this.state.field}
                            fields={this.state.fields}
                        />
                    </Modal.Body>
                    <Modal.Footer>
                        <Button onClick={this.closeModal}>
                            Done
                        </Button>
                    </Modal.Footer>
                </Modal>

                <FormBuilder
                    editingFieldId={editingFieldId}
                    registry={registry}
                    onFieldEditing={this.onFieldEditing}
                    onChange={this.onChangeFields}
                    fields={this.state.fields}
                />
            </div>
        );
    }
}


text:
jtable
======

A JQuery plugin to create AJAX based CRUD tables for druto framework


text:
<TITLE>Review for Born on the Fourth of July (1989)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Born on the Fourth of July (1989)

reviewed by
Laurie D. T. Mann

                        BORN ON THE FOURTH OF JULY
                       A film review by Laurie Mann
                        Copyright 1990 Laurie Mann

     While there are a few missteps in the movie, the acting is superb.  I
never really considered Tom Cruise an actor until I saw this film.  Oliver
Stone continues building on his reputation as a director who creates visceral,
gut-wrenching movies.  An 8 or 9 on the Chuck scale.

     BORN ON THE FOURTH OF JULY is the true story of Ron Kovic, a
rabble-rousing Viet Nam paraplegic and how he got that way.  The film opens
idyllically in the late '50s, when little Ronny Kovic is playing soldiers with
his friends.  The action switches to the 4th of July parade, where we meet
Ronny's ever-growing family, and Donna, the girl who'll break his heart
eventually.  The scenes of Massapequa, New York are scenes of a safe home,
where the greatest danger is Mom finding a Playboy in teenaged Ronny's room.

     As a teenager, Ronny is a driven idealist who goes into the Marines right
after graduation.  The action jumps ahead three years, and we see Sargeant
Kovic, an almost-hardened soldier.  Almost immediately, there's shooting and
death, and within fifteen minutes of the film's arrival in Vietnam, there's
the awful scene of Ron Kovic going down fighting, followed by five minutes of
hell in the field hospital.  I couldn't watch most of the field hospital
sequences; it was some of the most gruesome stuff I'd ever seen.  But it was
never gratuitous.  The audience is as numbed by the gore as Ron Kovic was.

     The next sequences in the Bronx VA hospital are so outrageous that they
can only be true.  Kovic pushes himself, and pushes some more, and eventually
is forced to realize that he'll never walk again.  He never really accepts
that, or his experiences in Vietnam, and sinks into alcoholism after he
returns home to Massapequa.

     A lot goes on in the 2-1/2-hour running time of this movie.  His
conversion to a militant pacifist and vet against the war happens pretty
quickly near the end of the movie.  But Tom Cruise really makes us believe that
Ron Kovic spent the first few years of his physical paralysis as a sort of
emotional spastic.  A person who let the world go on so long as he could drink,
and would only occasionally let the rage show.

     The supporting cast, particularly the actors who play Kovic's parents, are
all fine.  Willem Dafoe has a great turn as a drugged-out paraplegic Kovic
meets in Mexico.

     As much as I like the movie, I noticed the following problems with it:

1.  The movie has an awful sense of time, and only intermittently tells
        the viewer what year it is.

2.  Vietnam looked too much like Mexico.  That's because Stone shot
        the Vietnam portions in Mexico.  Then he chose almost IDENTICAL
        opening shots (incredibly yellow aerial shots of sand dunes) to
        establish both locales (Kovic goes to Mexico for some R&R).

3.  Kovic has a major falling out with his parents.  So they disappear
        from the movie completely when he goes to Mexico.  That doesn't
        make a lot of sense, since his family had been such a big part
        of his life up till that point.  Even to see a shot of Mrs.
        Kovic crying when her son appears on TV at the '72 Republican
        National Convention would have been fine.

4.  Same problem with Donna.  The movie strongly implies that she's
        gotten married, and she introduces Kovic to anti-war protests.
        She also completely disappears from the movie.

5.  I didn't think the sex scene (which is detailed in this month's
        Premire magazine) worked all that well.  I understand that it
        wasn't supposed to be all that erotic, but it just felt
        rather muddled.

6. The movie could have been trimmed by about another five minutes with
        no damage done, particularly the murky scene after the very
        dramatic disruption of the Republican National Convention.

7.  The last shot of the movie shows Kovic about to officially
        address the Democratic National Convention in 1976.  It would
        have been terrific to show the real Ron Kovic addressing the
        the crowd under the credits.

/*I'm a woman by nature, a mother by choice.  ** Capitalist for choice!
Laurie Mann   **   harvard!m2c!jjmhome!lmann  ** lmann%jjmhome@m2c.m2c.org
Work: Stratus Computer ** Home: Northboro, MA ** lmann@jjmhome.UUCP          */

.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
A in memory time to live cache with streaming support.

[![Dependencies](https://img.shields.io/david/trygve-lie/ttl-mem-cache.svg?style=flat-square)](https://david-dm.org/trygve-lie/ttl-mem-cache)
[![Build Status](http://img.shields.io/travis/trygve-lie/ttl-mem-cache/master.svg?style=flat-square)](https://travis-ci.org/trygve-lie/ttl-mem-cache)
[![Greenkeeper badge](https://badges.greenkeeper.io/trygve-lie/ttl-mem-cache.svg?style=flat-square)](https://greenkeeper.io/)
[![Known Vulnerabilities](https://snyk.io/test/github/trygve-lie/ttl-mem-cache/badge.svg?targetFile=package.json&style=flat-square)](https://snyk.io/test/github/trygve-lie/ttl-mem-cache?targetFile=package.json)

## Installation

```bash
$ npm install ttl-mem-cache
```

## Example

Set an object and retrieve it.

```js
const Cache = require('ttl-mem-cache');

const cache = new Cache();

cache.set('a', {foo: 'bar'});
const obj = cache.get('a'); // returns {foo: 'bar'}
```

## Description

This is a in memory time to live key/value cache with streaming support. Items are
not pro-actively pruned out as they age but expires when they are too old when touched.
In other words; this module does not use `setTimeout()` or simmilar methods internally.

There is no restrictions on the values stored in the cache and there is no maximum limit
of the amount of items in the cache. Whan that is said, the intention of this module is
to act as a simple key/value cache where one need to cache small to medium amounts of
data.

## Constructor

Create a new Cache instance.

```js
const Cache = require('ttl-mem-cache');
const cache = new Cache(options);
```

### options (optional)

An Object containing misc configuration. The following values can be provided:

 * ttl - `Number` - Default time to live in milliseconds all items in the cache should be cached before expiering.
 * stale - `Boolean` - If expired items in cache should be returned when pruned from the cache. Default: `false`.
 * changelog - `Boolean` - If emitted `set` event and stream should contain both old and new value. Default: `false`.
 * id - `String` - Give the instanse a unique identifier. Default: `hash`

If an option Object with a `ttl` is not provided all items in the cache will by default
cached for 5 minutes before they expire.

Items can be cached forever by setting `ttl` to `Infinity`. Items cached forever can
be overwritten and manually deleted.

Pruning of items from the cache happend when they are touched by one of the methods
for retrieving (`.get()` and `.entries()`) items from the cache. By default pruning
happens before the method returns a value so if an item have expired, `null` will be
returned for expired items. By setting `stale` to `true`, these methods will return
the pruned item(s) before they are removed from the cache.

Internally the cache has a unique ID created each time its instantiated. This ID is
used to tell the origin of an cached item when streaming. The `id` will override
this generated ID. When using this, be carefull to not provide the same ID to multiple
instances of the cache.

The Cache instance inherit from Duplex Stream. Due to this the instance also take all
config parameters which the Duplex Stream does. Please see the [documentation of Duplex Streams](https://nodejs.org/api/stream.html#stream_duplex_and_transform_streams)
for further documentation.

## API

The Cache instance have the following API:

### .set(key, value, ttl)

Set an item in the cache on a given key.

```js
const cache = new Cache();
cache.set('a', {foo: 'bar'});
cache.set('b', {foo: 'xyz'}, 20 * 60 * 1000);
```

This method take the following arguments:

 * key - An unique key the value should be stored on in the cache. Required.
 * value - The value to store on the key in the cache. Required.
 * ttl - Time to live before the item should expire. Uses default if not given. Optional.

An item can be cached forever by setting `ttl` to `Infinity`.

### .get(key)

Get an item on a given key from the cache.

```js
const cache = new Cache();
cache.set('a', {foo: 'bar'});
const obj = cache.get('a'); // returns {foo: 'bar'}
```

This method take the following arguments:

 * key - The unique key for the item in the cache. Required.

Triggering `.get()` will check the expire on the item. If the item is older than
the time to live set on it, the item will be removed from the cache and this method
will return `null` unless `stale` is set to `true` on the constructor. Then the
expired item will be returned before its removed from the cache.

### .del(key)

Explicitly delete an item on a given key in the cache.

```js
const cache = new Cache();
cache.set('a', {foo: 'bar'});
cache.del('a');
```

This method take the following arguments:

 * key - The unique key for the item in the cache. Required.

### .entries(mutator)

Get all items in the cache. Returns an Array with all items.

```js
const cache = new Cache();
cache.set('a', {foo: 'bar'});
cache.set('b', {foo: 'xyz'});
const all = cache.entries(); // returns [{foo: 'bar'}, {foo: 'xyz'}]
```

Triggering `.entries()` will check the expire on the items. If an item is older than
the time to live set on it, the item will be removed from the cache and it will not be
included in the returned value of this methid unless `stale` is set to `true` on the
constructor. Then the expired item will be included before its removed from the cache.

This method take the following arguments:

 * mutator - A function for mutating the items returned. Optional.

The mutator attribute can be used to change the structure of the returned items. It
takes a function which will be called with an Object with the `key` and `value`. This
function must return a value which then will be the value of the item in the returned
output.

```js
const cache = new Cache();
cache.set('a', {foo: 'bar'});
cache.set('b', {foo: 'xyz'});
const all = cache.entries((item) => {
    return item.value.foo;
}); // returns ['bar', 'xyz']
```

The advantage of using the mutator if one want to mutate the items is that the mutator
is applied to each item in the same process as the expire is checked.

### .prune()

Iterates over all items in the cache and proactively prunes expired items.

### .clear()

Clears the entire cache. All items will be deleted.

### .dump()

Returns an Array of all items in the cache ready to be used by `.load()`.

### .load(dump)

Loads an Array of items, provided by `.dump()`, into the cache.

This method take the following arguments:

 * dump - Array of items to be imported.

If any of the items in the loaded Array contains a key which already are in
the cache the entry in the cache will be overwritten.

If any of the entries in the loaded Array are not compatible with the format
which `.dump()` exports, they will not be inserted into the cache.

Returns and Array with the keys which was inserted into the cache.

### .length()

The number of items in the cache.

## Events

The Cache instance inherit from Duplex Stream. Due to this the instance emits all the
events which Duplex Stream does when the streaming feature is used. Please see the
[documentation of Duplex Streams](https://nodejs.org/api/stream.html#stream_duplex_and_transform_streams)
for further documentation.

In addition to this, the following events are emitted:

### set

When an item is set in the cache. Emits an Object with the `key` and `value` of the item.

```js
const cache = new Cache();
cache.on('set', (key, item) => {
    console.log(key, item);  // outputs: "a, {foo: 'bar'}"
});
cache.set('a', {foo: 'bar'});
```

If `changefeed` is set to be `true` on the constructor, the emitted Object will hold both
old and new value for the key. See "changelog" for further info.

### dispose

When an item is disposed (deleted) from the cache. Emits the `key` of the item and the item itself.

```js
const cache = new Cache();
cache.on('dispose', (key, item) => {
    console.log(key, item);  // outputs: "a, {foo: 'bar'}"
});
cache.set('a', {foo: 'bar'});
cache.del('a');
```

### clear

When the cache is cleared.

## Streams

The Cache instance is a [Duplex Stream](https://nodejs.org/api/stream.html#stream_duplex_and_transform_streams). One can stream
items in and out of the cache.

Example of streaming into the cache:

```js
const cache = new Cache();
const source = new SomeReadableStream();  // a source streaming an item on key 'a' into the cache

source.pipe(cache);

cache.get('a');  // returns the item for key 'a'
```

Example of streaming out of the cache:

```js
const cache = new Cache();
const dest = new SomeWritableStream();  // a destination stream recieving items from the cache

cache.pipe(dest);

cache.set('a', {foo: 'bar'});  // pushes {foo: 'bar'} onto the writable stream
```

Example of streaming through the cache (all items streamed through will be kept in the cache):

```js
const cache = new Cache();
const source = new SomeReadableStream();  // a source streaming items into the cache
const dest = new SomeWritableStream();  // a destination stream recieving items from the cache

source.pipe(cache).pipe(dest);

cache.entries();  // returns all the items streamed through the cache
```

### Linking caches

With the stream API its possible to link caches together and distribute cached items between them.

```js
const Cache = require('../');

const cacheA = new Cache();
const cacheB = new Cache();
const cacheC = new Cache();

// Link all caches together
cacheA.pipe(cacheB).pipe(cacheC).pipe(cacheA);

// Set a value in cache C
cacheC.set('foo', 'bar');

// Retrieve the same value from all caches
console.log(cacheA.get('foo'), cacheB.get('foo'), cacheC.get('foo'));

// Delete the value in cache A
cacheA.del('foo');

// The value is deleted from all caches
console.log(cacheA.get('foo'), cacheB.get('foo'), cacheC.get('foo'));
```

### Streaming Object type

When using the Stream API to write to and read from the cache an [Entry Object](https://github.com/trygve-lie/ttl-mem-cache/blob/master/lib/entry.js)
or an Object of simmilar character is used.

The [Entry Object](https://github.com/trygve-lie/ttl-mem-cache/blob/master/lib/entry.js)
looks like this:

```js
{
    key: 'item key',
    value: 'item value',
    origin: 'cache instance ID',
    ttl: 'time to live',
    expires: 'time stamp'
}
```

The Stream API will always emit a full Entry Object. When writing to the Stream API one can provide
a full Entry Object, but a simmilar Object will also be accepted. Only `key` and `value` are required
properties when writing to the Stream API.

Iow; the following Object will be accepted by the Stream API:

```js
{
    key: 'foo',
    value: 'bar'
}
```

`key` defines what key the value of `value` should be stored on in the cache. `key` is required
and if not provided the stream will emit an error.

When writing to the cache and a Object with `value` with a value is provided, it will be stored in
the cache on the provided `key`. If `value` is not provided or `null` or `undefined` on the
Object when writing to the cache, any item with a matching `key` in the cache will be deleted.

When the stream emits objects each object will have a `origin` key. The value is the unique ID of
the instance the object first was emitted on the stream. If the construcor was given a value for
the `id` argument, this will be used as `origin` value.

`ttl` is how long the item is set to live in the cache.

`expires` is the calculated timestamp for when the item should expire from the cache. This is
calculated when an item is set in the cache. If a value for `expires` is provided when writing
to the Stream API this value will be set in the cache.

If the items you want to store in the cache does not fit your data type, its recommended to use
a [Transform Stream](https://nodejs.org/api/stream.html#stream_implementing_a_transform_stream)
to transform it into the supported Object type.

Example:

```js
const cache = new Cache();
const source = new SomeReadableStream();  // contains Objects like this {id: 'a', item: 'bar'}

const convert = new stream.Transform({
    objectMode: true,
    transform(obj, encoding, callback) {
        this.push({
            key: obj.id,
            value: obj.item
        });
        callback();
    }
});

source.pipe(convert).pipe(cache);
```

The [Entry Object](https://github.com/trygve-lie/ttl-mem-cache/blob/master/lib/entry.js) does
implement `.toPrimitive` where a stringified JSON representation of the Object will be returned
when call to the Entry Object with a String hint is done.

This can be used when one want to convert the Entry Object into a [Buffer](https://nodejs.org/api/buffer.html).

```js
const cache = new Cache();
const dest = new SomeWritableStream();  // Some destination supporting Buffers

const convert = new stream.Transform({
    writableObjectMode: true,
    readableObjectMode: false,
    transform(obj, encoding, callback) {
        const buff = Buffer.from(obj);  // Convert Entry Object to a Buffer
        this.push(buff);
        callback();
    }
});

cache.pipe(convert).pipe(dest);
```

### Object Mode

By default the stream are in object mode. Its also supported to run the stream in non-object
mode. Object mode can be turned off by setting `objectMode` to `false` as an option to the
constructor.

When using non-object mode the stream will emit `Buffers` containing a stringified JSON
representaion of the Entry Object.

## Changelog

If the attribute `changelog` is set to `true` on the constructor, the `set` events will emit an
object holding both old and new values for the key.

The emitted object looks like this:

```js
{
    oldVal: 'foo',
    newVal: 'bar'
}
```

Example:

```js
const Cache = require('ttl-mem-cache');

const cache = new Cache({ changefeed: true });
cache.on('set', (key, item) => {
    // item will be in the format above
});
cache.set('a', 'foo');
cache.set('a', 'bar');
```

If a key does not hold a value in cache before, `oldVal` will be `null`.
If a key hold a value which has expired and `stale` is `false`, `oldVal` will be `null`.
If a key hold a value which has expired and `stale` is `true`, `oldVal` will be the old value.

## node.js compabillity

This module is written in ES6 and uses some functions only found in node.js 8.2
and newer. This module will not function with older than 8.2 versions of node.js.

## error handling

This module does not handle errors for you, so you must handle errors on
whatever streams you pipe into this module. This is a general rule when
programming with node.js streams: always handle errors on each and every stream.

We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump)
for writing error tolerant stream code.

## License

The MIT License (MIT)

Copyright (c) 2017 - Trygve Lie - post@trygve-lie.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


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

namespace DAQ.HAL
{
    public abstract class Calibration
    {
        protected double rangeLow;
        protected double rangeHigh;

        public abstract double Convert(double input);
        public void CheckRange(double input)
        {
            if (rangeLow != rangeHigh)
            {
                if (input < rangeLow || input > rangeHigh)
                {
                    throw new CalibrationRangeException();
                }
                else { }
            }
        }
        public class CalibrationRangeException : ArgumentOutOfRangeException { };
    }
}


text:
<?php

namespace AppBundle\Command\Moderation;

use AppBundle\Entity\Moderation;
use AppBundle\Service\ModerationHelper;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Description of ModerationLogCommand
 *
 * @author cedric
 */
class ModerationLogCommand extends ContainerAwareCommand
{
    /** @var EntityManagerInterface $entityManager */
    private $entityManager;

    /** @var ModerationHelper $moderationHelper */
    private $moderationHelper;

    public function __construct(EntityManagerInterface $entityManager, ModerationHelper $moderationHelper)
    {
        parent::__construct();
        $this->entityManager = $entityManager;
        $this->moderationHelper = $moderationHelper;
    }

    protected function configure()
    {
        $this
            ->setName('app:moderation:log')
            ->setDescription('View the moderation log')
            ->addArgument('limit', InputArgument::OPTIONAL, "Number of lines to display", 10)
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $limit = $input->getArgument('limit');

        $moderationList = $this->entityManager->getRepository('AppBundle:Moderation')->findBy([], ['dateCreation' => 'DESC'], $limit);

        $table = new Table($output);
        $table->setHeaders(['Date','Mod','Before','After','Id','Deck']);
        /** @var Moderation $moderation */
        foreach ($moderationList as $moderation) {
            $table->addRow([
                $moderation->getDateCreation()->format('Y-m-d'),
                $moderation->getModerator()->getUsername(),
                $this->moderationHelper->getLabel($moderation->getStatusBefore()),
                $this->moderationHelper->getLabel($moderation->getStatusAfter()),
                $moderation->getDecklist()->getId(),
                $moderation->getDecklist()->getName()
            ]);
        }

        $table->render();
    }
}


text:
/* this file provides the mappings for the JSRE defined interface for PE assisted libary calls */

#include <sys/stat.h>
#include <sys/syscall.h>

#ifndef __JSRE_H
#define __JSRE_H

#define JSRE_POSIX1_SIGNALCODE 0x2101

#define JSRE_CLOSE 2
#define JSRE_FSTAT 4
#define JSRE_GETPAGESIZE 6
#define JSRE_GETTIMEOFDAY 7
#define JSRE_LSEEK 9
#define JSRE_LSTAT 10
#define JSRE_MMAP 11
#define JSRE_MREMAP 12
#define JSRE_MSYNC 13
#define JSRE_MUNMAP 14
#define JSRE_OPEN 15
#define JSRE_READ 16
#define JSRE_SHM_OPEN 21
#define JSRE_SHM_UNLINK 22
#define JSRE_STAT 23
#define JSRE_UNLINK 24
#define JSRE_WRITE 27
#define JSRE_FTRUNCATE 28
#define JSRE_ACCESS 29
#define JSRE_DUP 30
#define JSRE_NANOSLEEP 32

#define JSRE_CHDIR 33
#define JSRE_FCHDIR 34
#define JSRE_MKDIR 35
#define JSRE_MKNOD 36
#define JSRE_RMDIR 37
#define JSRE_CHMOD 38
#define JSRE_FCHMOD 39
#define JSRE_CHOWN 40
#define JSRE_FCHOWN 41
#define JSRE_LCHOWN 42
#define JSRE_GETCWD 43
#define JSRE_LINK 44
#define JSRE_SYMLINK 45
#define JSRE_READLINK 46
#define JSRE_SYNC 47
#define JSRE_FSYNC 48
#define JSRE_FDATASYNC 49
#define JSRE_DUP2 50
#define JSRE_LOCKF 51
#define JSRE_TRUNCATE 52
#define JSRE_MKSTEMP 53
#define JSRE_MKTEMP 54
#define JSRE_OPENDIR 55
#define JSRE_CLOSEDIR 56
#define JSRE_READDIR 57
#define JSRE_REWINDDIR 58
#define JSRE_SEEKDIR 59
#define JSRE_TELLDIR 60
#define JSRE_SCHED_YIELD 61
#define JSRE_UMASK 62
#define JSRE_UTIME 63
#define JSRE_UTIMES 64
#define JSRE_PREAD 65
#define JSRE_PWRITE 66
#define JSRE_READV 67
#define JSRE_WRITEV 68

struct jsre_stat {
    unsigned int dev;
    unsigned int ino;
    unsigned int mode;
    unsigned int nlink;
    unsigned int uid;
    unsigned int gid;
    unsigned int rdev;
    unsigned int size;
    unsigned int blksize;
    unsigned int blocks;
    unsigned int atime;
    unsigned int mtime;
    unsigned int ctime;
};

void __conv_stat (struct stat *stat, struct jsre_stat *jstat);

#endif


text:
ros
===
Ubuntu Core 14.04 + [ROS Jade Base](http://www.ros.org/).

Citation
--------
If you find this useful in research please consider [citing this work](https://github.com/Kaixhin/dockerfiles/blob/master/CITATION.md).


text:
package net.dirtyfilthy.bouncycastle.asn1.x509;

import net.dirtyfilthy.bouncycastle.asn1.ASN1Encodable;
import net.dirtyfilthy.bouncycastle.asn1.ASN1Sequence;
import net.dirtyfilthy.bouncycastle.asn1.ASN1TaggedObject;
import net.dirtyfilthy.bouncycastle.asn1.DERObject;
import net.dirtyfilthy.bouncycastle.asn1.DERSequence;

public class GeneralNames
    extends ASN1Encodable
{
    private final GeneralName[] names;

    public static GeneralNames getInstance(
        Object  obj)
    {
        if (obj == null || obj instanceof GeneralNames)
        {
            return (GeneralNames)obj;
        }

        if (obj instanceof ASN1Sequence)
        {
            return new GeneralNames((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    }

    public static GeneralNames getInstance(
        ASN1TaggedObject obj,
        boolean          explicit)
    {
        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    }

    /**
     * Construct a GeneralNames object containing one GeneralName.
     *
     * @param name the name to be contained.
     */
    public GeneralNames(
        GeneralName  name)
    {
        this.names = new GeneralName[] { name };
    }

    public GeneralNames(
        ASN1Sequence  seq)
    {
        this.names = new GeneralName[seq.size()];

        for (int i = 0; i != seq.size(); i++)
        {
            names[i] = GeneralName.getInstance(seq.getObjectAt(i));
        }
    }

    public GeneralName[] getNames()
    {
        GeneralName[] tmp = new GeneralName[names.length];

        System.arraycopy(names, 0, tmp, 0, names.length);

        return tmp;
    }

    /**
     * Produce an object suitable for an ASN1OutputStream.
     * <pre>
     * GeneralNames ::= SEQUENCE SIZE {1..MAX} OF GeneralName
     * </pre>
     */
    public DERObject toASN1Object()
    {
        return new DERSequence(names);
    }

    public String toString()
    {
        StringBuffer  buf = new StringBuffer();
        String        sep = System.getProperty("line.separator");

        buf.append("GeneralNames:");
        buf.append(sep);

        for (int i = 0; i != names.length; i++)
        {
            buf.append("    ");
            buf.append(names[i]);
            buf.append(sep);
        }
        return buf.toString();
    }
}


text:
This is the source code to the site operating at
[https://lobste.rs](https://lobste.rs).  It is a Rails 4 codebase and uses a
SQL (MariaDB in production) backend for the database and Sphinx for the search
engine.

While you are free to fork this code and modify it (according to the [license](https://github.com/jcs/lobsters/blob/master/LICENSE))
to run your own link aggregation website, this source code repository and bug
tracker are only for the site operating at [lobste.rs](https://lobste.rs/).
Please do not use the bug tracker for support related to operating your own
site unless you are contributing code that will also benefit [lobste.rs](https://lobste.rs/).

####Contributing bugfixes and new features

Please see the [CONTRIBUTING](https://github.com/jcs/lobsters/blob/master/CONTRIBUTING.md)
file.

####Initial setup

* Install Ruby. Supported Ruby versions include 1.9.3, 2.0.0 and 2.1.0.

* Checkout the lobsters git tree from Github

         $ git clone git://github.com/jcs/lobsters.git
         $ cd lobsters
         lobsters$

* Run Bundler to install/bundle gems needed by the project:

         lobsters$ bundle

* Create a MySQL (other DBs supported by ActiveRecord may work, only MySQL and
MariaDB have been tested) database, username, and password and put them in a
`config/database.yml` file:

          development:
            adapter: mysql2
            encoding: utf8mb4
            reconnect: false
            database: lobsters_dev
            socket: /tmp/mysql.sock
            username: *username*
            password: *password*

          test:
            adapter: sqlite3
            database: db/test.sqlite3
            pool: 5
            timeout: 5000

* Load the schema into the new database:

          lobsters$ rake db:schema:load

* Create a `config/initializers/secret_token.rb` file, using a randomly
generated key from the output of `rake secret`:

          Lobsters::Application.config.secret_token = 'your random secret here'

* (Optional, only needed for the search engine) Install Sphinx.  Build Sphinx
config and start server:

          lobsters$ rake ts:rebuild

* Define your site's name and default domain, which are used in various places,
in a `config/initializers/production.rb` or similar file:

          class << Rails.application
            def domain
              "example.com"
            end

            def name
              "Example News"
            end
          end

          Rails.application.routes.default_url_options[:host] = Rails.application.domain

* Create an initial administrator user and at least one tag:

          lobsters$ rails console
          Loading development environment (Rails 3.2.6)
          irb(main):001:0> u = User.new(:username => "test", :email => "test@example.com", :password => "test", :password_confirmation => "test")
          irb(main):002:0> u.is_admin = true
          irb(main):003:0> u.is_moderator = true
          irb(main):004:0> u.save

          irb(main):005:0> t = Tag.new
          irb(main):006:0> t.tag = "test"
          irb(main):007:0> t.save

* Run the Rails server in development mode.  You should be able to login to
`http://localhost:3000` with your new `test` user:

          lobsters$ rails server


text:
<?php

namespace Payum\Core\Tests\Model;

use DateTime;
use Payum\Core\Model\CreditCard;
use Payum\Core\Model\CreditCardInterface;
use Payum\Core\Security\SensitiveValue;
use Payum\Core\Tests\TestCase;
use ReflectionClass;

class CreditCardTest extends TestCase
{
    public function testShouldExtendDetailsAwareInterface()
    {
        $rc = new ReflectionClass(CreditCard::class);

        $this->assertTrue($rc->implementsInterface(CreditCardInterface::class));
    }

    public function testShouldReturnNullOnNewCreditCard()
    {
        $card = new CreditCard();

        $this->assertNull($card->getToken());
        $this->assertNull($card->getBrand());
        $this->assertNull($card->getHolder());
        $this->assertNull($card->getMaskedHolder());
        $this->assertNull($card->getNumber());
        $this->assertNull($card->getMaskedNumber());
        $this->assertNull($card->getSecurityCode());
        $this->assertNull($card->getExpireAt());
    }

    public function testShouldAllowGetPreviouslySetBrand()
    {
        $card = new CreditCard();

        $card->setBrand('theBrand');

        $this->assertSame('theBrand', $card->getBrand());
    }

    public function testShouldAllowGetPreviouslySetToken()
    {
        $card = new CreditCard();

        $card->setToken('theToken');

        $this->assertSame('theToken', $card->getToken());
    }

    public function testShouldAllowGetPreviouslySetHolder()
    {
        $card = new CreditCard();

        $card->setHolder('Mahatma Gandhi');

        $this->assertSame('Mahatma Gandhi', $card->getHolder());
    }

    public function testShouldStoreHolderAsSensitiveValue()
    {
        $card = new CreditCard();

        $card->setHolder('Mahatma Gandhi');

        $value = $this->readAttribute($card, 'securedHolder');
        $this->assertInstanceOf(SensitiveValue::class, $value);
        $this->assertSame('Mahatma Gandhi', $value->peek());
    }

    public function testShouldAllowGetMaskedHolderWhenSetHolder()
    {
        $card = new CreditCard();

        $card->setHolder('Mahatma Gandhi');

        $this->assertSame('MXXXXXX XXndhi', $card->getMaskedHolder());
    }

    public function testShouldAllowChangeMaskedHolder()
    {
        $card = new CreditCard();

        $card->setHolder('Mahatma Gandhi');
        $card->setMaskedHolder('theMaskedHolder');

        $this->assertSame('Mahatma Gandhi', $card->getHolder());
        $this->assertSame('theMaskedHolder', $card->getMaskedHolder());
    }

    public function testShouldAllowGetPreviouslySetNumber()
    {
        $card = new CreditCard();

        $card->setNumber('1234 5678 1234 5678');

        $this->assertSame('1234 5678 1234 5678', $card->getNumber());
    }

    public function testShouldStoreNumberAsSensitiveValue()
    {
        $card = new CreditCard();

        $card->setNumber('1234 5678 1234 5678');

        $value = $this->readAttribute($card, 'securedNumber');
        $this->assertInstanceOf(SensitiveValue::class, $value);
        $this->assertSame('1234 5678 1234 5678', $value->peek());
    }

    public function testShouldAllowGetMaskedNumberWhenSetNumber()
    {
        $card = new CreditCard();

        $card->setNumber('1234 5678 1234 5678');

        $this->assertSame('1XXX XXXX XXXX 5678', $card->getMaskedNumber());
    }

    public function testShouldAllowChangeMaskedNumber()
    {
        $card = new CreditCard();

        $card->setNumber('1234 5678 1234 5678');
        $card->setMaskedNumber('theMaskedNumber');

        $this->assertSame('1234 5678 1234 5678', $card->getNumber());

        $this->assertSame('theMaskedNumber', $card->getMaskedNumber());
    }

    public function testShouldAllowGetPreviouslySetSecurityCode()
    {
        $card = new CreditCard();

        $card->setSecurityCode('theCode');

        $this->assertSame('theCode', $card->getSecurityCode());
    }

    public function testShouldStoreSecurityCodeAsSensitiveValue()
    {
        $card = new CreditCard();

        $card->setSecurityCode('123');

        $value = $this->readAttribute($card, 'securedSecurityCode');
        $this->assertInstanceOf(SensitiveValue::class, $value);
        $this->assertSame('123', $value->peek());
    }

    public function testShouldAllowGetPreviouslySetExpireAt()
    {
        $card = new CreditCard();

        $expected = new DateTime();

        $card->setExpireAt($expected);

        $this->assertSame($expected, $card->getExpireAt());
    }

    public function testShouldStoreExpireAtAsSensitiveValue()
    {
        $card = new CreditCard();

        $expected = new DateTime();

        $card->setExpireAt($expected);

        $value = $this->readAttribute($card, 'securedExpireAt');
        $this->assertInstanceOf(SensitiveValue::class, $value);
        $this->assertSame($expected, $value->peek());
    }
}


text:
import _ from 'underscore';
import { Blaze } from 'meteor/blaze';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/tap:i18n';

import { timeAgo, formatDateAndTime } from '../../lib/client/lib/formatDate';
import { DateFormat } from '../../lib/client';
import { renderMessageBody, MessageTypes, MessageAction, call, normalizeThreadMessage } from '../../ui-utils/client';
import { RoomRoles, UserRoles, Roles, Messages } from '../../models/client';
import { callbacks } from '../../callbacks/client';
import { Markdown } from '../../markdown/client';
import { t, roomTypes, getURL } from '../../utils';
import { upsertMessage } from '../../ui-utils/client/lib/RoomHistoryManager';
import { messageArgs } from '../../ui-utils/client/lib/messageArgs';
import './message.html';
import './messageThread.html';

async function renderPdfToCanvas(canvasId, pdfLink) {
	const isSafari = /constructor/i.test(window.HTMLElement)
		|| ((p) => p.toString() === '[object SafariRemoteNotification]')(!window.safari
			|| (typeof window.safari !== 'undefined' && window.safari.pushNotification));

	if (isSafari) {
		const [, version] = /Version\/([0-9]+)/.exec(navigator.userAgent) || [null, 0];
		if (version <= 12) {
			return;
		}
	}

	if (!pdfLink || !/\.pdf$/i.test(pdfLink)) {
		return;
	}
	pdfLink = getURL(pdfLink);

	const canvas = document.getElementById(canvasId);
	if (!canvas) {
		return;
	}

	const pdfjsLib = await import('pdfjs-dist');
	pdfjsLib.GlobalWorkerOptions.workerSrc = `${ Meteor.absoluteUrl() }pdf.worker.min.js`;

	const loader = document.getElementById(`js-loading-${ canvasId }`);

	if (loader) {
		loader.style.display = 'block';
	}

	const pdf = await pdfjsLib.getDocument(pdfLink);
	const page = await pdf.getPage(1);
	const scale = 0.5;
	const viewport = page.getViewport(scale);
	const context = canvas.getContext('2d');
	canvas.height = viewport.height;
	canvas.width = viewport.width;
	await page.render({
		canvasContext: context,
		viewport,
	}).promise;

	if (loader) {
		loader.style.display = 'none';
	}

	canvas.style.maxWidth = '-webkit-fill-available';
	canvas.style.maxWidth = '-moz-available';
	canvas.style.display = 'block';
}

const renderBody = (msg, settings) => {
	const isSystemMessage = MessageTypes.isSystemMessage(msg);
	const messageType = MessageTypes.getType(msg) || {};

	if (messageType.render) {
		msg = messageType.render(msg);
	} else if (messageType.template) {
		// render template
	} else if (messageType.message) {
		msg = TAPi18n.__(messageType.message, { ...typeof messageType.data === 'function' && messageType.data(msg) });
	} else if (msg.u && msg.u.username === settings.Chatops_Username) {
		msg.html = msg.msg;
		msg = callbacks.run('renderMentions', msg);
		msg = msg.html;
	} else {
		msg = renderMessageBody(msg);
	}

	if (isSystemMessage) {
		msg.html = Markdown.parse(msg.html);
	}
	return msg;
};

Template.message.helpers({
	body() {
		const { msg, settings } = this;
		return Tracker.nonreactive(() => renderBody(msg, settings));
	},
	and(a, b) {
		return a && b;
	},
	i18nReplyCounter() {
		const { msg } = this;
		return `<span class='reply-counter'>${ msg.tcount }</span>`;
	},
	i18nDiscussionCounter() {
		const { msg } = this;
		return `<span class='reply-counter'>${ msg.dcount }</span>`;
	},
	formatDateAndTime,
	encodeURI(text) {
		return encodeURI(text);
	},
	broadcast() {
		const { msg, room = {}, u } = this;
		return !msg.private && !msg.t && msg.u._id !== u._id && room && room.broadcast;
	},
	isIgnored() {
		const { ignored, msg } = this;
		const isIgnored = typeof ignored !== 'undefined' ? ignored : msg.ignored;
		return isIgnored;
	},
	ignoredClass() {
		const { ignored, msg } = this;
		const isIgnored = typeof ignored !== 'undefined' ? ignored : msg.ignored;
		return isIgnored ? 'message--ignored' : '';
	},
	isDecrypting() {
		const { msg } = this;
		return msg.e2e === 'pending';
	},
	isBot() {
		const { msg } = this;
		return msg.bot && 'bot';
	},
	roleTags() {
		const { msg, hideRoles, settings } = this;
		if (settings.hideRoles || hideRoles) {
			return [];
		}

		if (!msg.u || !msg.u._id) {
			return [];
		}
		const userRoles = UserRoles.findOne(msg.u._id);
		const roomRoles = RoomRoles.findOne({
			'u._id': msg.u._id,
			rid: msg.rid,
		});
		const roles = [...(userRoles && userRoles.roles) || [], ...(roomRoles && roomRoles.roles) || []];
		return Roles.find({
			_id: {
				$in: roles,
			},
			description: {
				$exists: 1,
				$ne: '',
			},
		}, {
			fields: {
				description: 1,
			},
		});
	},
	isGroupable() {
		const { msg, room = {}, settings, groupable } = this;
		if (groupable === false || settings.allowGroup === false || room.broadcast || msg.groupable === false || (MessageTypes.isSystemMessage(msg) && !msg.tmid)) {
			return 'false';
		}
	},
	sequentialClass() {
		const { msg, groupable } = this;
		if (MessageTypes.isSystemMessage(msg) && !msg.tmid) {
			return;
		}
		return groupable !== false && msg.groupable !== false && 'sequential';
	},
	avatarFromUsername() {
		const { msg } = this;

		if (msg.avatar != null && msg.avatar[0] === '@') {
			return msg.avatar.replace(/^@/, '');
		}
	},
	getName() {
		const { msg, settings } = this;
		if (msg.alias) {
			return msg.alias;
		}
		if (!msg.u) {
			return '';
		}
		return (settings.UI_Use_Real_Name && msg.u.name) || msg.u.username;
	},
	showUsername() {
		const { msg, settings } = this;
		return msg.alias || (settings.UI_Use_Real_Name && msg.u && msg.u.name);
	},
	own() {
		const { msg, u } = this;
		if (msg.u && msg.u._id === u._id) {
			return 'own';
		}
	},
	timestamp() {
		const { msg } = this;
		return +msg.ts;
	},
	chatops() {
		const { msg, settings } = this;
		if (msg.u && msg.u.username === settings.Chatops_Username) {
			return 'chatops-message';
		}
	},
	time() {
		const { msg, timeAgo: useTimeAgo } = this;

		return useTimeAgo ? timeAgo(msg.ts) : DateFormat.formatTime(msg.ts);
	},
	date() {
		const { msg } = this;
		return DateFormat.formatDate(msg.ts);
	},
	isTemp() {
		const { msg } = this;
		if (msg.temp === true) {
			return 'temp';
		}
	},
	threadMessage() {
		const { msg } = this;
		return normalizeThreadMessage(msg);
	},
	bodyClass() {
		const { msg } = this;
		return MessageTypes.isSystemMessage(msg) ? 'color-info-font-color' : 'color-primary-font-color';
	},
	system(returnClass) {
		const { msg } = this;
		if (MessageTypes.isSystemMessage(msg)) {
			if (returnClass) {
				return 'color-info-font-color';
			}
			return 'system';
		}
	},
	showTranslated() {
		const { msg, subscription, settings, u } = this;
		if (settings.AutoTranslate_Enabled && msg.u && msg.u._id !== u._id && !MessageTypes.isSystemMessage(msg)) {
			const autoTranslate = subscription && subscription.autoTranslate;
			return msg.autoTranslateFetching || (!!autoTranslate !== !!msg.autoTranslateShowInverse && msg.translations && msg.translations[settings.translateLanguage]);
		}
	},
	edited() {
		return Template.instance().wasEdited;
	},
	editTime() {
		const { msg } = this;
		if (Template.instance().wasEdited) {
			return DateFormat.formatDateAndTime(msg.editedAt);
		}
	},
	editedBy() {
		if (!Template.instance().wasEdited) {
			return '';
		}
		const { msg } = this;
		// try to return the username of the editor,
		// otherwise a special "?" character that will be
		// rendered as a special avatar
		return (msg.editedBy && msg.editedBy.username) || '?';
	},
	label() {
		const { msg } = this;

		if (msg.i18nLabel) {
			return t(msg.i18nLabel);
		} if (msg.label) {
			return msg.label;
		}
	},
	hasOembed() {
		const { msg, settings } = this;
		// there is no URLs, there is no template to show the oembed (oembed package removed) or oembed is not enable
		if (!(msg.urls && msg.urls.length > 0) || !Template.oembedBaseWidget || !settings.API_Embed) {
			return false;
		}

		// check if oembed is disabled for message's sender
		if ((settings.API_EmbedDisabledFor || '').split(',').map((username) => username.trim()).includes(msg.u && msg.u.username)) {
			return false;
		}
		return true;
	},
	reactions() {
		const { msg: { reactions = {} }, u: { username: myUsername, name: myName } } = this;

		return Object.entries(reactions)
			.map(([emoji, reaction]) => {
				const myDisplayName = reaction.names ? myName : `@${ myUsername }`;
				const displayNames = reaction.names || reaction.usernames.map((username) => `@${ username }`);
				const selectedDisplayNames = displayNames.slice(0, 15).filter((displayName) => displayName !== myDisplayName);

				if (displayNames.some((displayName) => displayName === myDisplayName)) {
					selectedDisplayNames.unshift(t('You'));
				}

				let usernames;

				if (displayNames.length > 15) {
					usernames = `${ selectedDisplayNames.join(', ') }${ t('And_more', { length: displayNames.length - 15 }).toLowerCase() }`;
				} else if (displayNames.length > 1) {
					usernames = `${ selectedDisplayNames.slice(0, -1).join(', ') } ${ t('and') } ${ selectedDisplayNames[selectedDisplayNames.length - 1] }`;
				} else {
					usernames = selectedDisplayNames[0];
				}

				return {
					emoji,
					count: displayNames.length,
					usernames,
					reaction: ` ${ t('Reacted_with').toLowerCase() } ${ emoji }`,
					userReacted: displayNames.indexOf(myDisplayName) > -1,
				};
			});
	},
	markUserReaction(reaction) {
		if (reaction.userReacted) {
			return {
				class: 'selected',
			};
		}
	},
	hideReactions() {
		const { msg } = this;
		if (_.isEmpty(msg.reactions)) {
			return 'hidden';
		}
	},
	hideMessageActions() {
		const { msg } = this;

		return msg.private || MessageTypes.isSystemMessage(msg);
	},
	actionLinks() {
		const { msg } = this;
		// remove 'method_id' and 'params' properties
		return _.map(msg.actionLinks, function(actionLink, key) {
			return _.extend({
				id: key,
			}, _.omit(actionLink, 'method_id', 'params'));
		});
	},
	hideActionLinks() {
		const { msg } = this;
		if (_.isEmpty(msg.actionLinks)) {
			return 'hidden';
		}
	},
	injectIndex(data, index) {
		data.index = index;
	},
	channelName() {
		const { subscription } = this;
		// const subscription = Subscriptions.findOne({ rid: this.rid });
		return subscription && subscription.name;
	},
	roomIcon() {
		const { room } = this;
		if (room && room.t === 'd') {
			return 'at';
		}
		return roomTypes.getIcon(room);
	},
	customClass() {
		const { customClass, msg } = this;
		return customClass || msg.customClass;
	},
	fromSearch() {
		const { customClass, msg } = this;
		return [msg.customClass, customClass].includes('search');
	},
	actionContext() {
		const { msg } = this;
		return msg.actionContext;
	},
	messageActions(group) {
		const { msg, context: ctx } = this;
		let messageGroup = group;
		let context = ctx || msg.actionContext;

		if (!group) {
			messageGroup = 'message';
		}

		if (!context) {
			context = 'message';
		}

		return MessageAction.getButtons(this, context, messageGroup);
	},
	isSnippet() {
		const { msg } = this;
		return msg.actionContext === 'snippeted';
	},
	isThreadReply() {
		const { msg: { tmid, t }, settings: { showreply } } = this;
		return !!(tmid && showreply && (!t || t === 'e2e'));
	},
	collapsed() {
		const { msg: { tmid, collapsed }, settings: { showreply }, shouldCollapseReplies } = this;
		const isCollapsedThreadReply = shouldCollapseReplies && tmid && showreply && collapsed !== false;
		if (isCollapsedThreadReply) {
			return 'collapsed';
		}
	},
	collapseSwitchClass() {
		const { msg: { collapsed = true } } = this;
		return collapsed ? 'icon-right-dir' : 'icon-down-dir';
	},
	parentMessage() {
		const { msg: { threadMsg } } = this;
		return threadMsg;
	},
});

const findParentMessage = (() => {
	const waiting = [];

	const getMessages = _.debounce(async function() {
		const uid = Tracker.nonreactive(() => Meteor.userId());
		const _tmp = [...waiting];
		waiting.length = 0;
		(await call('getMessages', _tmp)).map((msg) => upsertMessage({ msg, uid }));
	}, 500);

	return (tmid) => {
		if (waiting.indexOf(tmid) > -1) {
			return;
		}

		const message = Messages.findOne({ _id: tmid });
		if (message) {
			const uid = Tracker.nonreactive(() => Meteor.userId());
			return Messages.update({ tmid, repliesCount: { $exists: 0 } }, {
				$set: {
					following: message.replies && message.replies.indexOf(uid) > -1,
					threadMsg: normalizeThreadMessage(message),
					repliesCount: message.tcount,
				},
			}, { multi: true });
		}

		waiting.push(tmid);
		getMessages();
	};
})();

Template.message.onCreated(function() {
	const { msg, shouldCollapseReplies } = Template.currentData();

	this.wasEdited = msg.editedAt && !MessageTypes.isSystemMessage(msg);
	if (shouldCollapseReplies && msg.tmid && !msg.threadMsg) {
		findParentMessage(msg.tmid);
	}
});

const hasTempClass = (node) => node.classList.contains('temp');

const getPreviousSentMessage = (currentNode) => {
	if (hasTempClass(currentNode)) {
		return currentNode.previousElementSibling;
	}
	if (currentNode.previousElementSibling != null) {
		let previousValid = currentNode.previousElementSibling;
		while (previousValid != null && (hasTempClass(previousValid) || !previousValid.classList.contains('message'))) {
			previousValid = previousValid.previousElementSibling;
		}
		return previousValid;
	}
};

const isNewDay = (currentNode, previousNode, forceDate, showDateSeparator) => {
	if (!showDateSeparator) {
		return false;
	}

	if (forceDate || !previousNode) {
		return true;
	}

	const { dataset: currentDataset } = currentNode;
	const { dataset: previousDataset } = previousNode;
	const previousMessageDate = new Date(parseInt(previousDataset.timestamp));
	const currentMessageDate = new Date(parseInt(currentDataset.timestamp));

	if (previousMessageDate.toDateString() !== currentMessageDate.toDateString()) {
		return true;
	}

	return false;
};

const isSequential = (currentNode, previousNode, forceDate, period, showDateSeparator, shouldCollapseReplies) => {
	if (!previousNode) {
		return false;
	}

	if (showDateSeparator && forceDate) {
		return false;
	}

	const { dataset: currentDataset } = currentNode;
	const { dataset: previousDataset } = previousNode;
	const previousMessageDate = new Date(parseInt(previousDataset.timestamp));
	const currentMessageDate = new Date(parseInt(currentDataset.timestamp));

	if (showDateSeparator && previousMessageDate.toDateString() !== currentMessageDate.toDateString()) {
		return false;
	}

	if (shouldCollapseReplies && currentDataset.tmid) {
		return previousDataset.id === currentDataset.tmid || previousDataset.tmid === currentDataset.tmid;
	}

	if (previousDataset.tmid && !currentDataset.tmid) {
		return false;
	}

	if ([previousDataset.groupable, currentDataset.groupable].includes('false')) {
		return false;
	}

	if (previousDataset.username !== currentDataset.username) {
		return false;
	}

	if (previousDataset.alias !== currentDataset.alias) {
		return false;
	}

	if (parseInt(currentDataset.timestamp) - parseInt(previousDataset.timestamp) <= period) {
		return true;
	}

	return false;
};

const processSequentials = ({ currentNode, settings, forceDate, showDateSeparator = true, groupable, msg, shouldCollapseReplies }) => {
	if (!showDateSeparator && !groupable) {
		return;
	}
	if (msg.file && msg.file.type === 'application/pdf') {
		Meteor.defer(() => { renderPdfToCanvas(msg.file._id, msg.attachments[0].title_link); });
	}
	// const currentDataset = currentNode.dataset;
	const previousNode = getPreviousSentMessage(currentNode);
	const nextNode = currentNode.nextElementSibling;

	if (isSequential(currentNode, previousNode, forceDate, settings.Message_GroupingPeriod, showDateSeparator, shouldCollapseReplies)) {
		currentNode.classList.add('sequential');
	} else {
		currentNode.classList.remove('sequential');
	}

	if (isNewDay(currentNode, previousNode, forceDate, showDateSeparator)) {
		currentNode.classList.add('new-day');
	} else {
		currentNode.classList.remove('new-day');
	}

	if (nextNode && nextNode.dataset) {
		if (isSequential(nextNode, currentNode, forceDate, settings.Message_GroupingPeriod, showDateSeparator, shouldCollapseReplies)) {
			nextNode.classList.add('sequential');
		} else {
			nextNode.classList.remove('sequential');
		}

		if (isNewDay(nextNode, currentNode, forceDate, showDateSeparator)) {
			nextNode.classList.add('new-day');
		} else {
			nextNode.classList.remove('new-day');
		}
	} else if (shouldCollapseReplies) {
		const [el] = $(`#chat-window-${ msg.rid }`);
		const view = el && Blaze.getView(el);
		const templateInstance = view && view.templateInstance();
		if (!templateInstance) {
			return;
		}

		if (currentNode.classList.contains('own') === true) {
			templateInstance.atBottom = true;
		}
		templateInstance.sendToBottomIfNecessary();
	}
};

Template.message.onRendered(function() { // duplicate of onViewRendered(NRR) the onRendered works only for non nrr templates
	this.autorun(() => {
		const currentNode = this.firstNode;
		processSequentials({ currentNode, ...messageArgs(Template.currentData()) });
	});
});

Template.message.onViewRendered = function() {
	const args = messageArgs(Template.currentData());
	// processSequentials({ currentNode, ...messageArgs(Template.currentData()) });
	return this._domrange.onAttached((domRange) => {
		const currentNode = domRange.lastNode();
		processSequentials({ currentNode, ...args });
	});
};


text:
// --------------------------------------------------------------------------------------------------------------------
// <summary>
//   Profile Company Information
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace PasskeyCoreSDK.Domain
{
    using System.Xml.Serialization;

    /// <summary>
    ///     The profile company info.
    /// </summary>
    [XmlType(AnonymousType = true, Namespace = "http://www.opentravel.org/OTA/2002/11")]
    public class ProfileCompanyInfo
    {
        #region Public Properties

        /// <summary>
        ///     Gets or sets the company name.
        /// </summary>
        public string CompanyName { get; set; }

        #endregion
    }
}


text:
@interface MusicManager : NSObject
#ifdef TARGET_OS_IPHONE
		<AVAudioPlayerDelegate>
#endif
{
#ifndef DISABLE_SOUND
	StringInBlock songChangeBlock;
	NSMutableArray *songs;

#if defined(SDL)
    Mix_Music               *music;
//#elif defined(GNUSTEP)
//    NSSound                 *currentSong;
//#elif defined(__COCOTRON__)
#elif defined(TARGET_OS_MAC)
    QTMovie                 *currentSong;
#elif defined(TARGET_OS_IPHONE)
	AVAudioPlayer *currentSong;
#endif
#endif
}

- (id)initWithSongs:(NSArray *)_songs andSongChangeBlock:(StringInBlock)_songChangeBlock;
- (void)startPlayingWithDelay:(float)delay;
- (void)playSongInBackground;
- (void)pauseMusic;
- (void)unpauseMusic;

@end


text:
import socket
from email.mime.text import MIMEText

send_email_flag = True

# Our SMTP server is defined here
smtp_server = 'smtp.subaru.nao.ac.jp'

sender_name = 'hscq.web.check'
server_name = socket.getfqdn()
sender = '@'.join([sender_name, server_name])

recipient = 'queue@naoj.org'

mail_str = {'Excel_file': 'uploaded',
            'Google_sheet': 'submitted',
            }

def create_msg(propname, user_auth_type, user_auth_fullname, upload_datetime, user_filetype, input_name, fullpathname):

    body = 'An HSC Queue spreadsheet for proposal %s was %s to the hscq server by %s user %s on %s. Input was %s named %s. Output filename is %s:%s' % (propname, mail_str[user_filetype], user_auth_type, user_auth_fullname, upload_datetime.strftime('%c'), user_filetype, input_name, server_name, fullpathname)
    subject = 'HSC Queue spreadsheet for %s was %s' % (propname, mail_str[user_filetype])
    msg = MIMEText(body)
    msg['Subject'] = subject
    msg['From'] = sender
    msg['To'] = recipient

    return msg


text:
module Azure::StorSimple8000Series::Mgmt::V2017_06_01
  module Models
    #
    # The volume container.
    #
    class VolumeContainer < BaseModel

      include MsRestAzure

      # @return [AsymmetricEncryptedSecret] The key used to encrypt data in the
      # volume container. It is required when property 'EncryptionStatus' is
      # "Enabled".
      attr_accessor :encryption_key

      # @return [EncryptionStatus] The flag to denote whether encryption is
      # enabled or not. Possible values include: 'Enabled', 'Disabled'
      attr_accessor :encryption_status

      # @return [Integer] The number of volumes in the volume Container.
      attr_accessor :volume_count

      # @return [String] The path ID of storage account associated with the
      # volume container.
      attr_accessor :storage_account_credential_id

      # @return [OwnerShipStatus] The owner ship status of the volume
      # container. Only when the status is "NotOwned", the delete operation on
      # the volume container is permitted. Possible values include: 'Owned',
      # 'NotOwned'
      attr_accessor :owner_ship_status

      # @return [Integer] The bandwidth-rate set on the volume container.
      attr_accessor :band_width_rate_in_mbps

      # @return [String] The ID of the bandwidth setting associated with the
      # volume container.
      attr_accessor :bandwidth_setting_id

      # @return [Integer] The total cloud storage for the volume container.
      attr_accessor :total_cloud_storage_usage_in_bytes

      #
      # Mapper for VolumeContainer class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'VolumeContainer',
          type: {
            name: 'Composite',
            class_name: 'VolumeContainer',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              kind: {
                client_side_validation: true,
                required: false,
                serialized_name: 'kind',
                type: {
                  name: 'Enum',
                  module: 'Kind'
                }
              },
              encryption_key: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.encryptionKey',
                type: {
                  name: 'Composite',
                  class_name: 'AsymmetricEncryptedSecret'
                }
              },
              encryption_status: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.encryptionStatus',
                type: {
                  name: 'Enum',
                  module: 'EncryptionStatus'
                }
              },
              volume_count: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.volumeCount',
                type: {
                  name: 'Number'
                }
              },
              storage_account_credential_id: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.storageAccountCredentialId',
                type: {
                  name: 'String'
                }
              },
              owner_ship_status: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.ownerShipStatus',
                type: {
                  name: 'Enum',
                  module: 'OwnerShipStatus'
                }
              },
              band_width_rate_in_mbps: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.bandWidthRateInMbps',
                type: {
                  name: 'Number'
                }
              },
              bandwidth_setting_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.bandwidthSettingId',
                type: {
                  name: 'String'
                }
              },
              total_cloud_storage_usage_in_bytes: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.totalCloudStorageUsageInBytes',
                type: {
                  name: 'Number'
                }
              }
            }
          }
        }
      end
    end
  end
end