text:
@interface Util : NSObject {}

+ (BOOL)checkConnectivity;
+ (CGContextRef)createBitmapContextForWidth:(float)width height:(float)height;
+ (void)drawRoundedRectForPath:(CGMutablePathRef)path rect:(CGRect)rect radius:(float)radius;

@end

redpajama_set_name: RedPajamaGithub


text:
%**************************
\chapter{Desarrollo informático}
\label{ch:Desarrollo informático}
%**************************

En este capítulo haremos el desarrollo informático sobre criptografía con curvas elípticas. En el apartado~\ref{sec:Criptografía con curvas elípticas} hablaremos sobre criptografía asimétrica utilizando curvas elípticas, explicaremos algunos protocolos criptografícos con curvas elípticas en el apartado~\ref{sec:Protocolos criptográficos} y por último en el apartado~\ref{sec:Criptografía con curvas elípticas con Python} hablaremos del programa desarrollado para trabajar con curvas elípticas y protocolos criptográficos.

Las principales referencias utilizadas para el desarrollo informático han sido sido~\cite{Hankerson:2003}, \cite{Menezes:1996}, \cite{Washington:2008} y \cite{Silverman:2009}.

\input{Capitulos/Capitulo03s1}

\input{Capitulos/Capitulo03s2}


text:
namespace MailTrace.Data.Entities
{
    using System;

    public class Log
    {
        public int Id { get; set; }

        public string Host { get; set; }

        public string QueueId { get; set; }

        public string Message { get; set; }

        public bool Processed { get; set; }

        public DateTime SourceTime { get; set; }

        public DateTimeOffset Timestamp { get; set; }
    }
}


text:
package xal.app.orbitcorrect;

import java.util.*;

import xal.smf.*;
import xal.smf.impl.BPM;
import xal.tools.data.*;

/**
 * BpmRecord
 * @author   tap
 * @since    Jul 09, 2004
 */
public class BpmRecord extends BeamMarkerRecord<BPM> implements DataListener {
	/** label for data storage */
	final static public String DATA_LABEL = "BPMRecord";

	/**
	 * Primary constructor
	 * @param bpmAgent        the BPM agent for which the record is made
	 * @param timestamp  the time of the BPM data
	 * @param xAvg       the average x position
	 * @param yAvg       the average y position
	 * @param ampAvg     the average signal amplitude
	 */
	public BpmRecord( final BpmAgent bpmAgent, final Date timestamp, final double xAvg, final double yAvg, final double ampAvg ) {
		super( bpmAgent, timestamp, xAvg, yAvg, ampAvg );
	}

	/**
	 * Constructor
	 * @param bpmAgent        the BPM agent for which the record is made
	 * @param timestamp  the time of the BPM data
	 * @param xAvg       the average x position
	 * @param yAvg       the average y position
	 */
	public BpmRecord( final BpmAgent bpmAgent, final Date timestamp, final double xAvg, final double yAvg ) {
		this( bpmAgent, timestamp, xAvg, yAvg, Double.NaN );
	}

	/**
	 * Constructor
	 * @param record     another BPM record
	 * @param timestamp  the time of the BPM data
	 * @param xAvg       the average x position
	 * @param yAvg       the average y position
	 */
	public BpmRecord( final BpmRecord record, final Date timestamp, final double xAvg, final double yAvg ) {
		this( record.getBpmAgent(), timestamp, xAvg, yAvg, Double.NaN );
	}

	/**
	 * Constructor using the current timestamp and zero for BPM data
	 * @param bpmAgent  the BPM agent for which the record is made
	 */
	public BpmRecord( final BpmAgent bpmAgent ) {
		this( bpmAgent, new Date(), 0.0, 0.0 );
	}

	/** produce a BpmRecord from a BeamMarkerRecord assuming that the beam marker record has a BpmAgent as the beam marker */
	static protected BpmRecord getInstance( final BeamMarkerRecord<BPM> record ) {
		return new BpmRecord( (BpmAgent)record.getBeamMarker(), record.getTimestamp(), record.getXAvg(), record.getYAvg(), record.getAmpAvg() );
	}

	/**
	 * Calculate the difference between a primary BPM record and a reference BPM record.
	 * @param primaryRecord    The primary record
	 * @param referenceRecord  The reference record
	 * @return                 The difference between the primary record and reference record
	 */
	static public BpmRecord calcDifference( final BpmRecord primaryRecord, final BpmRecord referenceRecord ) {
		return getInstance( BeamMarkerRecord.calcDifference( primaryRecord, referenceRecord ) );
	}

	/**
	 * Get the BPM agent for which this record was generated
	 * @return   this record's BPM agent
	 */
	public BpmAgent getBpmAgent() {
		return (BpmAgent)getBeamMarker();
	}

	/**
	 * Get the unique identifier for the enclosed BPM
	 * @return   the ID of the record's BPM
	 */
	public String getBpmID() {
		return getNodeID();
	}

    /**
	 * Provides the name used to identify the class in an external data source.
	 * @return a tag that identifies the receiver's type
	 */
    public String dataLabel() {
		return DATA_LABEL;
	}

    /**
	 * Update the data based on the information provided by the data provider.
     * @param adaptor The adaptor from which to update the data
     */
    public void update( final DataAdaptor adaptor ) {
		TIME_STAMP = new Date( adaptor.longValue( "timestamp" ) );
		X_AVG = adaptor.doubleValue( "XAVG" );
		Y_AVG = adaptor.doubleValue( "YAVG" );
		AMP_AVG = adaptor.doubleValue( "AMPAVG" );
	}

    /**
	 * Write data to the data adaptor for storage.
     * @param adaptor The adaptor to which the receiver's data is written
     */
    public void write( final DataAdaptor adaptor ) {
		adaptor.setValue( "BPM", BEAM_MARKER.getID() );
		adaptor.setValue( "timestamp", TIME_STAMP.getTime() );
		adaptor.setValue( "XAVG", X_AVG );
		adaptor.setValue( "YAVG", Y_AVG );
		adaptor.setValue( "AMPAVG", AMP_AVG );
	}
}


text:
<?php declare(strict_types=1);

namespace Neomerx\Tests\JsonApi\Data\Schemas;

use Neomerx\JsonApi\Contracts\Schema\ContextInterface;
use Neomerx\JsonApi\Contracts\Schema\LinkInterface;
use Neomerx\Tests\JsonApi\Data\Models\Site;

/**
 * @package Neomerx\Tests\JsonApi
 */
class SiteSchema extends DevSchema
{
    /**
     * @inheritdoc
     */
    public function getType(): string
    {
        return 'sites';
    }

    /**
     * @inheritdoc
     */
    public function getId($resource): ?string
    {
        assert($resource instanceof Site);

        $index = $resource->{Site::ATTRIBUTE_ID};

        return $index === null ? $index : (string)$index;
    }

    /**
     * @inheritdoc
     */
    public function getAttributes($resource, ContextInterface $context): iterable
    {
        assert($resource instanceof Site);

        return [
            Site::ATTRIBUTE_NAME => $resource->{Site::ATTRIBUTE_NAME},
        ];
    }

    /**
     * @inheritdoc
     */
    public function getRelationships($resource, ContextInterface $context): iterable
    {
        assert($resource instanceof Site);

        if (property_exists($resource, Site::LINK_POSTS) === true) {
            $description = [self::RELATIONSHIP_DATA => $resource->{Site::LINK_POSTS}];
        } else {
            $selfLink    = $this->getRelationshipSelfLink($resource, Site::LINK_POSTS);
            $description = [self::RELATIONSHIP_LINKS => [LinkInterface::SELF => $selfLink]];
        }

        // NOTE: The `fixing` thing is for testing purposes only. Not for production.
        return $this->fixDescriptions(
            $resource,
            [
                Site::LINK_POSTS => $description,
            ]
        );
    }
}


text:
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
    <services>
        <defaults public="true"/>

        <service id="SwagImportExport\Components\DbAdapters\AddressDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="config"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\ProductsDbAdapter">
            <argument type="service" id="db"/>
            <argument type="service" id="models"/>
            <argument type="service" id="shopware_media.media_service"/>
            <argument type="service" id="config"/>
            <argument type="service" id="events"/>
            <argument type="service" id="SwagImportExport\Components\Service\UnderscoreToCamelCaseService"/>
            <argument type="service" id="shopware_storefront.context_service"/>
            <argument type="service" id="shopware_product_stream.repository"/>
            <argument type="service" id="shopware_search.product_number_search"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\ProductWriter"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\PriceWriter"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\CategoryWriter"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\ConfiguratorWriter"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\TranslationWriter"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\PropertyWriter"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\RelationWriter"/>
            <argument type="service" id="SwagImportExport\Components\DbAdapters\Products\ImageWriter"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\ProductsImagesDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="db"/>
            <argument type="service" id="shopware_media.media_service"/>
            <argument type="service" id="events"/>
            <argument type="service" id="SwagImportExport\Components\DataManagers\ProductImageDataManager"/>
            <argument type="service" id="thumbnail_manager"/>
            <argument type="service" id="SwagImportExport\Components\Service\UnderscoreToCamelCaseService"/>
            <argument type="service" id="SwagImportExport\Components\DbalHelper"/>
            <argument type="service" id="guzzle_http_client_factory"/>
            <argument type="service" id="config"/>
            <argument type="service" id="front"/>
            <argument>%kernel.root_dir%</argument>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\ProductsInStockDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="events"/>
            <argument type="service" id="config"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\ProductsPricesDbAdapter">
            <argument type="service" id="SwagImportExport\Components\DataManagers\ProductPriceDataManager"/>
            <argument type="service" id="models"/>
            <argument type="service" id="shopware_storefront.context_service"/>
            <argument type="service" id="shopware_search.store_front_criteria_factory"/>
            <argument type="service" id="shopware_product_stream.repository"/>
            <argument type="service" id="shopware_search.product_number_search"/>
            <argument type="service" id="events"/>
            <argument type="service" id="config"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\ProductsTranslationsDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="translation"/>
            <argument type="service" id="db"/>
            <argument type="service" id="events"/>
            <argument type="service" id="config"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\CategoriesDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="SwagImportExport\Components\DataManagers\CategoriesDataManager"/>
            <argument type="service" id="db"/>
            <argument type="service" id="SwagImportExport\Components\Service\UnderscoreToCamelCaseService"/>
            <argument type="service" id="events"/>
            <argument type="service" id="config"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\CategoryTranslationDbAdapter">
            <argument type="service" id="translation"/>
            <argument type="service" id="models"/>
            <argument type="service" id="dbal_connection"/>
            <argument type="service" id="events"/>
            <argument type="service" id="config"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\CustomerCompleteDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="db"/>
            <argument type="service" id="SwagImportExport\Components\DataManagers\CustomerDataManager"/>
            <argument type="service" id="passwordencoder"/>
            <argument type="service" id="config"/>
            <argument type="service" id="events"/>
            <argument type="service" id="SwagImportExport\Components\Service\UnderscoreToCamelCaseService"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\CustomerDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="db"/>
            <argument type="service" id="SwagImportExport\Components\DataManagers\CustomerDataManager"/>
            <argument type="service" id="passwordencoder"/>
            <argument type="service" id="config"/>
            <argument type="service" id="events"/>
            <argument type="service" id="SwagImportExport\Components\Service\UnderscoreToCamelCaseService"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\MainOrdersDbAdapter">
            <argument type="service" id="db"/>
            <argument type="service" id="models"/>
            <argument type="service" id="SwagImportExport\Components\Service\UnderscoreToCamelCaseService"/>
            <argument type="service" id="shopware.components.state_translator"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\NewsletterDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="SwagImportExport\Components\DataManagers\NewsletterDataManager"/>
            <argument type="service" id="db"/>
            <argument type="service" id="config"/>
            <argument type="service" id="events"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\OrdersDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="SwagImportExport\Components\Service\UnderscoreToCamelCaseService"/>
            <argument type="service" id="events"/>
            <argument type="service" id="config"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>

        <service id="SwagImportExport\Components\DbAdapters\TranslationsDbAdapter">
            <argument type="service" id="models"/>
            <argument type="service" id="events"/>
            <argument type="service" id="translation"/>
            <argument type="service" id="config"/>
            <argument type="service" id="db"/>

            <tag name="import_export.db_adapter"/>
            <tag name="import_export.proxyable"/>
        </service>
    </services>
</container>


text:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>quote-bundle on UI performance and resilience</title>
    <link>https://bart747.github.io/categories/quote-bundle/</link>
    <description>Recent content in quote-bundle on UI performance and resilience</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 09 Sep 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://bart747.github.io/categories/quote-bundle/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Max Planck on New Ideas and Creative Work</title>
      <link>https://bart747.github.io/planck/</link>
      <pubDate>Fri, 09 Sep 2016 00:00:00 +0000</pubDate>

      <guid>https://bart747.github.io/planck/</guid>
      <description>
Here are few famous quotes related to creative work, by Max Planck:

A new scientific truth does not triumph by convincing
its opponents and making them see the light,
but rather because its opponents eventually die,
and a new generation grows up that is familiar with it.

</description>
    </item>

  </channel>
</rss>


text:
void AutomationProvider::OverrideEncoding(int tab_handle,
                                          const std::string& encoding_name,
                                          bool* success) {
  NOTIMPLEMENTED();
  *success = false;
}

void AutomationProvider::PrintAsync(int tab_handle) {
  NOTIMPLEMENTED();
}

void AutomationProvider::WindowSimulateDrag(int handle,
                                            const std::vector<gfx::Point>& drag_path,
                                            int flags,
                                            bool press_escape_en_route,
                                            IPC::Message* reply_message) {
  NOTIMPLEMENTED();
}


text:
package MIME::Tools;

#------------------------------
# Because the POD documentation is pretty extensive, it follows
# the __END__ statement below...
#------------------------------

use strict;
use vars (qw(@ISA %CONFIG @EXPORT_OK %EXPORT_TAGS $VERSION $ME
	     $M_DEBUG $M_WARNING $M_ERROR ));

require Exporter;
use IO::File;
use File::Temp 0.18 ();
use Carp;

$ME = "MIME-tools";

@ISA = qw(Exporter);

# Exporting (importing should only be done by modules in this toolkit!):
%EXPORT_TAGS = (
    'config'  => [qw(%CONFIG)],
    'msgs'    => [qw(usage debug whine error)],
    'msgtypes'=> [qw($M_DEBUG $M_WARNING $M_ERROR)],
    'utils'   => [qw(textual_type tmpopen )],
    );
Exporter::export_ok_tags('config', 'msgs', 'msgtypes', 'utils');

# The TOOLKIT version, both in 1.23 style *and* usable by MakeMaker:
$VERSION = "5.509";

# Configuration (do NOT alter this directly)...
# All legal CONFIG vars *must* be in here, even if only to be set to undef:
%CONFIG =
    (
     DEBUGGING       => 0,
     QUIET           => 1,
     );

# Message-logging constants:
$M_DEBUG   = 'debug';
$M_WARNING = 'warning';
$M_ERROR   = 'error';

#------------------------------
#
# CONFIGURATION... (see below)
#
#------------------------------

sub config {
    my $class = shift;
    usage("config() is obsolete");

    # No args? Just return list:
    @_ or return keys %CONFIG;
    my $method = lc(shift);
    return $class->$method(@_);
}

sub debugging {
    my ($class, $value) = @_;
    $CONFIG{'DEBUGGING'} = $value   if (@_ > 1);
    return $CONFIG{'DEBUGGING'};
}

sub quiet {
    my ($class, $value) = @_;
    $CONFIG{'QUIET'} = $value   if (@_ > 1);
    return $CONFIG{'QUIET'};
}

sub version {
    my ($class, $value) = @_;
    return $VERSION;
}

#------------------------------
#
# MESSAGES...
#
#------------------------------

#------------------------------
#
# debug MESSAGE...
#
# Function, private.
# Output a debug message.
#
sub debug {
    print STDERR "$ME: $M_DEBUG: ", @_, "\n"      if $CONFIG{DEBUGGING};
}

#------------------------------
#
# whine MESSAGE...
#
# Function, private.
# Something doesn't look right: issue a warning.
# Only output if $^W (-w) is true, and we're not being QUIET.
#
sub whine {
    my $msg = "$ME: $M_WARNING: ".join('', @_)."\n";
    warn $msg if ($^W && !$CONFIG{QUIET});
    return (wantarray ? () : undef);
}

#------------------------------
#
# error MESSAGE...
#
# Function, private.
# Something failed, but not so badly that we want to throw an
# exception.  Just report our general unhappiness.
# Only output if $^W (-w) is true, and we're not being QUIET.
#
sub error {
    my $msg = "$ME: $M_ERROR: ".join('', @_)."\n";
    warn $msg if ($^W && !$CONFIG{QUIET});
    return (wantarray ? () : undef);
}

#------------------------------
#
# usage MESSAGE...
#
# Register unhappiness about usage.
#
sub usage {
    my ( $p,  $f,  $l,  $s) = caller(1);
    my ($cp, $cf, $cl, $cs) = caller(2);
    my $msg = join('', (($s =~ /::/) ? "$s() " : "${p}::$s() "), @_, "\n");
    my $loc = ($cf ? "\tin code called from $cf l.$cl" : '');

    warn "$msg$loc\n" if ($^W && !$CONFIG{QUIET});
    return (wantarray ? () : undef);
}

#------------------------------
#
# UTILS...
#
#------------------------------

#------------------------------
#
# textual_type MIMETYPE
#
# Function.  Does the given MIME type indicate a textlike document?
#
sub textual_type {
    ($_[0] =~ m{^(text|message)(/|\Z)}i);
}

#------------------------------
#
# tmpopen
#
#
sub tmpopen
{
	my ($args) = @_;
	$args ||= {};
	return File::Temp->new( %{$args} );
}

#------------------------------
1;
__END__

=head1 NAME

MIME-tools - modules for parsing (and creating!) MIME entities

=head1 SYNOPSIS

Here's some pretty basic code for B<parsing a MIME message,> and outputting
its decoded components to a given directory:

    use MIME::Parser;

    ### Create parser, and set some parsing options:
    my $parser = new MIME::Parser;
    $parser->output_under("$ENV{HOME}/mimemail");

    ### Parse input:
    $entity = $parser->parse(\*STDIN) or die "parse failed\n";

    ### Take a look at the top-level entity (and any parts it has):
    $entity->dump_skeleton;

Here's some code which B<composes and sends a MIME message> containing
three parts: a text file, an attached GIF, and some more text:

    use MIME::Entity;

    ### Create the top-level, and set up the mail headers:
    $top = MIME::Entity->build(Type    =>"multipart/mixed",
                               From    => "me\@myhost.com",
	                       To      => "you\@yourhost.com",
                               Subject => "Hello, nurse!");

    ### Part #1: a simple text document:
    $top->attach(Path=>"./testin/short.txt");

    ### Part #2: a GIF file:
    $top->attach(Path        => "./docs/mime-sm.gif",
                 Type        => "image/gif",
                 Encoding    => "base64");

    ### Part #3: some literal text:
    $top->attach(Data=>$message);

    ### Send it:
    open MAIL, "| /usr/lib/sendmail -t -oi -oem" or die "open: $!";
    $top->print(\*MAIL);
    close MAIL;

For more examples, look at the scripts in the B<examples> directory
of the MIME-tools distribution.

=head1 DESCRIPTION

MIME-tools is a collection of Perl5 MIME:: modules for parsing, decoding,
I<and generating> single- or multipart (even nested multipart) MIME
messages.  (Yes, kids, that means you can send messages with attached
GIF files).

=head1 REQUIREMENTS

You will need the following installed on your system:

	File::Path
	File::Spec
	IPC::Open2              (optional)
	MIME::Base64
	MIME::QuotedPrint
	Net::SMTP
	Mail::Internet, ...     from the MailTools distribution.

See the Makefile.PL in your distribution for the most-comprehensive
list of prerequisite modules and their version numbers.

=head1 A QUICK TOUR

=head2 Overview of the classes

Here are the classes you'll generally be dealing with directly:

    (START HERE)            results() .-----------------.
          \                 .-------->| MIME::          |
           .-----------.   /          | Parser::Results |
           | MIME::    |--'           `-----------------'
           | Parser    |--.           .-----------------.
           `-----------'   \ filer()  | MIME::          |
              | parse()     `-------->| Parser::Filer   |
              | gives you             `-----------------'
              | a...                        	      | output_path()
              |                         	      | determines
              |					      | path() of...
              |    head()       .--------.	      |
              |    returns...   | MIME:: | get()      |
              V       .-------->| Head   | etc...     |
           .--------./          `--------'            |
     .---> | MIME:: | 				      |
     `-----| Entity |           .--------.            |
   parts() `--------'\          | MIME:: |           /
   returns            `-------->| Body   |<---------'
   sub-entities    bodyhandle() `--------'
   (if any)        returns...       | open()
                                    | returns...
                                    |
                                    V
                                .--------. read()
                                | IO::   | getline()
                                | Handle | print()
                                `--------' etc...

To illustrate, parsing works this way:

=over 4

=item *

B<The "parser" parses the MIME stream.>
A parser is an instance of C<MIME::Parser>.
You hand it an input stream (like a filehandle) to parse a message from:
if the parse is successful, the result is an "entity".

=item *

B<A parsed message is represented by an "entity".>
An entity is an instance of C<MIME::Entity> (a subclass of C<Mail::Internet>).
If the message had "parts" (e.g., attachments), then those parts
are "entities" as well, contained inside the top-level entity.
Each entity has a "head" and a "body".

=item *

B<The entity's "head" contains information about the message.>
A "head" is an instance of C<MIME::Head> (a subclass of C<Mail::Header>).
It contains information from the message header: content type,
sender, subject line, etc.

=item *

B<The entity's "body" knows where the message data is.>
You can ask to "open" this data source for I<reading> or I<writing>,
and you will get back an "I/O handle".

=item *

B<You can open() a "body" and get an "I/O handle" to read/write message data.>
This handle is an object that is basically like an IO::Handle...  it
can be any class, so long as it supports a small, standard set of
methods for reading from or writing to the underlying data source.

=back

A typical multipart message containing two parts -- a textual greeting
and an "attached" GIF file -- would be a tree of MIME::Entity objects,
each of which would have its own MIME::Head.  Like this:

    .--------.
    | MIME:: | Content-type: multipart/mixed
    | Entity | Subject: Happy Samhaine!
    `--------'
         |
         `----.
        parts |
              |   .--------.
              |---| MIME:: | Content-type: text/plain; charset=us-ascii
              |   | Entity | Content-transfer-encoding: 7bit
              |   `--------'
              |   .--------.
              |---| MIME:: | Content-type: image/gif
                  | Entity | Content-transfer-encoding: base64
                  `--------' Content-disposition: inline;
                               filename="hs.gif"

=head2 Parsing messages

You usually start by creating an instance of B<MIME::Parser>
and setting up certain parsing parameters: what directory to save
extracted files to, how to name the files, etc.

You then give that instance a readable filehandle on which waits a
MIME message.  If all goes well, you will get back a B<MIME::Entity>
object (a subclass of B<Mail::Internet>), which consists of...

=over 4

=item *

A B<MIME::Head> (a subclass of B<Mail::Header>) which holds the MIME
header data.

=item *

A B<MIME::Body>, which is a object that knows where the body data is.
You ask this object to "open" itself for reading, and it
will hand you back an "I/O handle" for reading the data: this could be
of any class, so long as it conforms to a subset of the B<IO::Handle>
interface.

=back

If the original message was a multipart document, the MIME::Entity
object will have a non-empty list of "parts", each of which is in
turn a MIME::Entity (which might also be a multipart entity, etc,
etc...).

Internally, the parser (in MIME::Parser) asks for instances
of B<MIME::Decoder> whenever it needs to decode an encoded file.
MIME::Decoder has a mapping from supported encodings (e.g., 'base64')
to classes whose instances can decode them.  You can add to this mapping
to try out new/experiment encodings.  You can also use
MIME::Decoder by itself.

=head2 Composing messages

All message composition is done via the B<MIME::Entity> class.
For single-part messages, you can use the B<MIME::Entity/build>
constructor to create MIME entities very easily.

For multipart messages, you can start by creating a top-level
C<multipart> entity with B<MIME::Entity::build()>, and then use
the similar B<MIME::Entity::attach()> method to attach parts to
that message.  I<Please note:> what most people think of as
"a text message with an attached GIF file" is I<really> a multipart
message with 2 parts: the first being the text message, and the
second being the GIF file.

When building MIME a entity, you'll have to provide two very important
pieces of information: the I<content type> and the
I<content transfer encoding>.  The type is usually easy, as it is directly
determined by the file format; e.g., an HTML file is C<text/html>.
The encoding, however, is trickier... for example, some HTML files are
C<7bit>-compliant, but others might have very long lines and would need to be
sent C<quoted-printable> for reliability.

See the section on encoding/decoding for more details, as well as
L<"A MIME PRIMER"> below.

=head2 Sending email

Since MIME::Entity inherits directly from Mail::Internet,
you can use the normal Mail::Internet mechanisms to send
email.  For example,

    $entity->smtpsend;

=head2 Encoding/decoding support

The B<MIME::Decoder> class can be used to I<encode> as well; this is done
when printing MIME entities.  All the standard encodings are supported
(see L<"A MIME PRIMER"> below for details):

    Encoding:        | Normally used when message contents are:
    -------------------------------------------------------------------
    7bit             | 7-bit data with under 1000 chars/line, or multipart.
    8bit             | 8-bit data with under 1000 chars/line.
    binary           | 8-bit data with some long lines (or no line breaks).
    quoted-printable | Text files with some 8-bit chars (e.g., Latin-1 text).
    base64           | Binary files.

Which encoding you choose for a given document depends largely on
(1) what you know about the document's contents (text vs binary), and
(2) whether you need the resulting message to have a reliable encoding
for 7-bit Internet email transport.

In general, only C<quoted-printable> and C<base64> guarantee reliable
transport of all data; the other three "no-encoding" encodings simply
pass the data through, and are only reliable if that data is 7bit ASCII
with under 1000 characters per line, and has no conflicts with the
multipart boundaries.

I've considered making it so that the content-type and encoding
can be automatically inferred from the file's path, but that seems
to be asking for trouble... or at least, for Mail::Cap...

=head2 Message-logging

MIME-tools is a large and complex toolkit which tries to deal with
a wide variety of external input.  It's sometimes helpful to see
what's really going on behind the scenes.
There are several kinds of messages logged by the toolkit itself:

=over 4

=item Debug messages

These are printed directly to the STDERR, with a prefix of
C<"MIME-tools: debug">.

Debug message are only logged if you have turned
L</debugging> on in the MIME::Tools configuration.

=item Warning messages

These are logged by the standard Perl warn() mechanism
to indicate an unusual situation.
They all have a prefix of C<"MIME-tools: warning">.

Warning messages are only logged if C<$^W> is set true
and MIME::Tools is not configured to be L</quiet>.

=item Error messages

These are logged by the standard Perl warn() mechanism
to indicate that something actually failed.
They all have a prefix of C<"MIME-tools: error">.

Error messages are only logged if C<$^W> is set true
and MIME::Tools is not configured to be L</quiet>.

=item Usage messages

Unlike "typical" warnings above, which warn about problems processing
data, usage-warnings are for alerting developers of deprecated methods
and suspicious invocations.

Usage messages are currently only logged if C<$^W> is set true
and MIME::Tools is not configured to be L</quiet>.

=back

When a MIME::Parser (or one of its internal helper classes)
wants to report a message, it generally does so by recording
the message to the B<MIME::Parser::Results> object
immediately before invoking the appropriate function above.
That means each parsing run has its own trace-log which
can be examined for problems.

=head2 Configuring the toolkit

If you want to tweak the way this toolkit works (for example, to
turn on debugging), use the routines in the B<MIME::Tools> module.

=over

=item debugging

Turn debugging on or off.
Default is false (off).

     MIME::Tools->debugging(1);

=item quiet

Turn the reporting of warning/error messages on or off.
Default is true, meaning that these message are silenced.

     MIME::Tools->quiet(1);

=item version

Return the toolkit version.

     print MIME::Tools->version, "\n";

=back

=head1 THINGS YOU SHOULD DO

=head2 Take a look at the examples

The MIME-Tools distribution comes with an "examples" directory.
The scripts in there are basically just tossed-together, but
they'll give you some ideas of how to use the parser.

=head2 Run with warnings enabled

I<Always> run your Perl script with C<-w>.
If you see a warning about a deprecated method, change your
code ASAP.  This will ease upgrades tremendously.

=head2 Avoid non-standard encodings

Don't try to MIME-encode using the non-standard MIME encodings.
It's just not a good practice if you want people to be able to
read your messages.

=head2 Plan for thrown exceptions

For example, if your mail-handling code absolutely must not die,
then perform mail parsing like this:

    $entity = eval { $parser->parse(\*INPUT) };

Parsing is a complex process, and some components may throw exceptions
if seriously-bad things happen.  Since "seriously-bad" is in the
eye of the beholder, you're better off I<catching> possible exceptions
instead of asking me to propagate C<undef> up the stack.  Use of exceptions in
reusable modules is one of those religious issues we're never all
going to agree upon; thankfully, that's what C<eval{}> is good for.

=head2 Check the parser results for warnings/errors

As of 5.3xx, the parser tries extremely hard to give you a
MIME::Entity.  If there were any problems, it logs warnings/errors
to the underlying "results" object (see L<MIME::Parser::Results>).
Look at that object after each parse.
Print out the warnings and errors, I<especially> if messages don't
parse the way you thought they would.

=head2 Don't plan on printing exactly what you parsed!

I<Parsing is a (slightly) lossy operation.>
Because of things like ambiguities in base64-encoding, the following
is I<not> going to spit out its input unchanged in all cases:

    $entity = $parser->parse(\*STDIN);
    $entity->print(\*STDOUT);

If you're using MIME::Tools to process email, remember to save
the data you parse if you want to send it on unchanged.
This is vital for things like PGP-signed email.

=head2 Understand how international characters are represented

The MIME standard allows for text strings in headers to contain
characters from any character set, by using special sequences
which look like this:

    =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?=

To be consistent with the existing Mail::Field classes, MIME::Tools
does I<not> automatically unencode these strings, since doing so would
lose the character-set information and interfere with the parsing
of fields (see L<MIME::Parser/decode_headers> for a full explanation).
That means you should be prepared to deal with these encoded strings.

The most common question then is, B<how do I decode these encoded strings?>
The answer depends on what you want to decode them I<to>:
ASCII, Latin1, UTF-8, etc.  Be aware that your "target" representation
may not support all possible character sets you might encounter;
for example, Latin1 (ISO-8859-1) has no way of representing Big5
(Chinese) characters.  A common practice is to represent "untranslateable"
characters as "?"s, or to ignore them completely.

To unencode the strings into some of the more-popular Western byte
representations (e.g., Latin1, Latin2, etc.), you can use the decoders
in MIME::WordDecoder (see L<MIME::WordDecoder>).
The simplest way is by using C<unmime()>, a function wrapped
around your "default" decoder, as follows:

    use MIME::WordDecoder;
    ...
    $subject = unmime $entity->head->get('subject');

One place this I<is> done automatically is in extracting the recommended
filename for a part while parsing.  That's why you should start by
setting up the best "default" decoder if the default target of Latin1
isn't to your liking.

=head1 THINGS I DO THAT YOU SHOULD KNOW ABOUT

=head2 Fuzzing of CRLF and newline on input

RFC 2045 dictates that MIME streams have lines terminated by CRLF
(C<"\r\n">).  However, it is extremely likely that folks will want to
parse MIME streams where each line ends in the local newline
character C<"\n"> instead.

An attempt has been made to allow the parser to handle both CRLF
and newline-terminated input.

=head2 Fuzzing of CRLF and newline when decoding

The C<"7bit"> and C<"8bit"> decoders will decode both
a C<"\n"> and a C<"\r\n"> end-of-line sequence into a C<"\n">.

The C<"binary"> decoder (default if no encoding specified)
still outputs stuff verbatim... so a MIME message with CRLFs
and no explicit encoding will be output as a text file
that, on many systems, will have an annoying ^M at the end of
each line... I<but this is as it should be>.

=head2 Fuzzing of CRLF and newline when encoding/composing

TODO FIXME
All encoders currently output the end-of-line sequence as a C<"\n">,
with the assumption that the local mail agent will perform
the conversion from newline to CRLF when sending the mail.
However, there probably should be an option to output CRLF as per RFC 2045

=head2 Inability to handle multipart boundaries with embedded newlines

Let's get something straight: this is an evil, EVIL practice.
If your mailer creates multipart boundary strings that contain
newlines, give it two weeks notice and find another one.  If your
mail robot receives MIME mail like this, regard it as syntactically
incorrect, which it is.

=head2 Ignoring non-header headers

People like to hand the parser raw messages straight from
POP3 or from a mailbox.  There is often predictable non-header
information in front of the real headers; e.g., the initial
"From" line in the following message:

    From - Wed Mar 22 02:13:18 2000
    Return-Path: <eryq@zeegee.com>
    Subject: Hello

The parser simply ignores such stuff quietly.  Perhaps it
shouldn't, but most people seem to want that behavior.

=head2 Fuzzing of empty multipart preambles

Please note that there is currently an ambiguity in the way
preambles are parsed in.  The following message fragments I<both>
are regarded as having an empty preamble (where C<\n> indicates a
newline character):

     Content-type: multipart/mixed; boundary="xyz"\n
     Subject: This message (#1) has an empty preamble\n
     \n
     --xyz\n
     ...

     Content-type: multipart/mixed; boundary="xyz"\n
     Subject: This message (#2) also has an empty preamble\n
     \n
     \n
     --xyz\n
     ...

In both cases, the I<first> completely-empty line (after the "Subject")
marks the end of the header.

But we should clearly ignore the I<second> empty line in message #2,
since it fills the role of I<"the newline which is only there to make
sure that the boundary is at the beginning of a line">.
Such newlines are I<never> part of the content preceding the boundary;
thus, there is no preamble "content" in message #2.

However, it seems clear that message #1 I<also> has no preamble
"content", and is in fact merely a compact representation of an
empty preamble.

=head2 Use of a temp file during parsing

I<Why not do everything in core?>
Although the amount of core available on even a modest home
system continues to grow, the size of attachments continues
to grow with it.  I wanted to make sure that even users with small
systems could deal with decoding multi-megabyte sounds and movie files.
That means not being core-bound.

As of the released 5.3xx, MIME::Parser gets by with only
one temp file open per parser.  This temp file provides
a sort of infinite scratch space for dealing with the current
message part.  It's fast and lightweight, but you should know
about it anyway.

=head2 Why do I assume that MIME objects are email objects?

Achim Bohnet once pointed out that MIME headers do nothing more than
store a collection of attributes, and thus could be represented as
objects which don't inherit from Mail::Header.

I agree in principle, but RFC 2045 says otherwise.
RFC 2045 [MIME] headers are a syntactic subset of RFC-822 [email] headers.
Perhaps a better name for these modules would have been RFC1521::
instead of MIME::, but we're a little beyond that stage now.

When I originally wrote these modules for the CPAN, I agonized for a long
time about whether or not they really should subclass from B<Mail::Internet>
(then at version 1.17).  Thanks to Graham Barr, who graciously evolved
MailTools 1.06 to be more MIME-friendly, unification was achieved
at MIME-tools release 2.0.
The benefits in reuse alone have been substantial.

=head1 A MIME PRIMER

So you need to parse (or create) MIME, but you're not quite up on
the specifics?  No problem...

=head2 Glossary

Here are some definitions adapted from RFC 1521 (predecessor of the
current RFC 204[56789] defining MIME) explaining the terminology we
use; each is accompanied by the equivalent in MIME:: module terms...

=over 4

=item attachment

An "attachment" is common slang for any part of a multipart message --
except, perhaps, for the first part, which normally carries a user
message describing the attachments that follow (e.g.: "Hey dude, here's
that GIF file I promised you.").

In our system, an attachment is just a B<MIME::Entity> under the
top-level entity, probably one of its L<parts|MIME::Entity/parts>.

=item body

The "body" of an L<entity|/entity> is that portion of the entity
which follows the L<header|/header> and which contains the real message
content.  For example, if your MIME message has a GIF file attachment,
then the body of that attachment is the base64-encoded GIF file itself.

A body is represented by an instance of B<MIME::Body>.  You get the
body of an entity by sending it a L<bodyhandle()|MIME::Entity/bodyhandle>
message.

=item body part

One of the parts of the body of a multipart B</entity>.
A body part has a B</header> and a B</body>, so it makes sense to
speak about the body of a body part.

Since a body part is just a kind of entity, it's represented by
an instance of B<MIME::Entity>.

=item entity

An "entity" means either a B</message> or a B</body part>.
All entities have a B</header> and a B</body>.

An entity is represented by an instance of B<MIME::Entity>.
There are instance methods for recovering the
L<header|MIME::Entity/head> (a B<MIME::Head>) and the
L<body|MIME::Entity/bodyhandle> (a B<MIME::Body>).

=item header

This is the top portion of the MIME message, which contains the
"Content-type", "Content-transfer-encoding", etc.  Every MIME entity has
a header, represented by an instance of B<MIME::Head>.  You get the
header of an entity by sending it a head() message.

=item message

A "message" generally means the complete (or "top-level") message being
transferred on a network.

There currently is no explicit package for "messages"; under MIME::,
messages are streams of data which may be read in from files or
filehandles.  You can think of the B<MIME::Entity> returned by the
B<MIME::Parser> as representing the full message.

=back

=head2 Content types

This indicates what kind of data is in the MIME message, usually
as I<majortype/minortype>.  The standard major types are shown below.
A more-comprehensive listing may be found in RFC-2046.

=over 4

=item application

Data which does not fit in any of the other categories, particularly
data to be processed by some type of application program.
C<application/octet-stream>, C<application/gzip>, C<application/postscript>...

=item audio

Audio data.
C<audio/basic>...

=item image

Graphics data.
C<image/gif>, C<image/jpeg>...

=item message

A message, usually another mail or MIME message.
C<message/rfc822>...

=item multipart

A message containing other messages.
C<multipart/mixed>, C<multipart/alternative>...

=item text

Textual data, meant for humans to read.
C<text/plain>, C<text/html>...

=item video

Video or video+audio data.
C<video/mpeg>...

=back

=head2 Content transfer encodings

This is how the message body is packaged up for safe transit.
There are the 5 major MIME encodings.
A more-comprehensive listing may be found in RFC-2045.

=over 4

=item 7bit

No encoding is done at all.  This label simply asserts that no
8-bit characters are present, and that lines do not exceed 1000 characters
in length (including the CRLF).

=item 8bit

No encoding is done at all.  This label simply asserts that the message
might contain 8-bit characters, and that lines do not exceed 1000 characters
in length (including the CRLF).

=item binary

No encoding is done at all.  This label simply asserts that the message
might contain 8-bit characters, and that lines may exceed 1000 characters
in length.  Such messages are the I<least> likely to get through mail
gateways.

=item base64

A standard encoding, which maps arbitrary binary data to the 7bit domain.
Like "uuencode", but very well-defined.  This is how you should send
essentially binary information (tar files, GIFs, JPEGs, etc.).

=item quoted-printable

A standard encoding, which maps arbitrary line-oriented data to the
7bit domain.  Useful for encoding messages which are textual in
nature, yet which contain non-ASCII characters (e.g., Latin-1,
Latin-2, or any other 8-bit alphabet).

=back

=head1 SEE ALSO

L<MIME::Parser>, L<MIME::Head>, L<MIME::Body>, L<MIME::Entity>, L<MIME::Decoder>, L<Mail::Header>,
L<Mail::Internet>

At the time of this writing, the MIME-tools homepage was
F<http://www.mimedefang.org/static/mime-tools.php>.  Check there for
updates and support.

The MIME format is documented in RFCs 1521-1522, and more recently
in RFCs 2045-2049.

The MIME header format is an outgrowth of the mail header format
documented in RFC 822.

=head1 SUPPORT

Please file support requests via rt.cpan.org.

=head1 CHANGE LOG

Released as MIME-parser (1.0): 28 April 1996.
Released as MIME-tools (2.0): Halloween 1996.
Released as MIME-tools (4.0): Christmas 1997.
Released as MIME-tools (5.0): Mother's Day 2000.

See ChangeLog file for full details.

=head1 AUTHOR

Eryq (F<eryq@zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
Dianne Skoll (F<dfs@roaringpenguin.com>) F<http://www.roaringpenguin.com>.

Copyright (c) 1998, 1999 by ZeeGee Software Inc (www.zeegee.com).
Copyright (c) 2004 by Roaring Penguin Software Inc (www.roaringpenguin.com)

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

See the COPYING file in the distribution for details.

=head1 ACKNOWLEDGMENTS

B<This kit would not have been possible> but for the direct
contributions of the following:

    Gisle Aas             The MIME encoding/decoding modules.
    Laurent Amon          Bug reports and suggestions.
    Graham Barr           The new MailTools.
    Achim Bohnet          Numerous good suggestions, including the I/O model.
    Kent Boortz           Initial code for RFC-1522-decoding of MIME headers.
    Andreas Koenig        Numerous good ideas, tons of beta testing,
                            and help with CPAN-friendly packaging.
    Igor Starovoitov      Bug reports and suggestions.
    Jason L Tibbitts III  Bug reports, suggestions, patches.

Not to mention the Accidental Beta Test Team, whose bug reports (and
comments) have been invaluable in improving the whole:

    Phil Abercrombie
    Mike Blazer
    Brandon Browning
    Kurt Freytag
    Steve Kilbane
    Jake Morrison
    Rolf Nelson
    Joel Noble
    Michael W. Normandin
    Tim Pierce
    Andrew Pimlott
    Dragomir R. Radev
    Nickolay Saukh
    Russell Sutherland
    Larry Virden
    Zyx

Please forgive me if I've accidentally left you out.
Better yet, email me, and I'll put you in.

=head1 LICENSE

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

See the COPYING file for more details.

=cut


text:
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.4.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H

#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QWidget>

QT_BEGIN_NAMESPACE

class Ui_MainWindow
{
public:
    QAction *actionGTD;
    QAction *actionKanban;
    QAction *actionClose;
    QAction *actionSave;
    QAction *actionSave_As;
    QAction *actionExit;
    QAction *action_New;
    QAction *actionAbout;
    QAction *action_Open;
    QAction *actionMinimize;
    QAction *actionMaximize;
    QAction *actionRestore;
    QWidget *centralWidget;
    QMenuBar *menuBar;
    QMenu *menuFile;
    QMenu *menuRecent_Files;
    QMenu *menuView;
    QMenu *menuHelp;
    QMenu *menuWizard;
    QMenu *menuStats;
    QToolBar *mainToolBar;
    QStatusBar *statusBar;

    void setupUi(QMainWindow *MainWindow)
    {
        if (MainWindow->objectName().isEmpty())
            MainWindow->setObjectName(QStringLiteral("MainWindow"));
        MainWindow->resize(400, 300);
        actionGTD = new QAction(MainWindow);
        actionGTD->setObjectName(QStringLiteral("actionGTD"));
        actionKanban = new QAction(MainWindow);
        actionKanban->setObjectName(QStringLiteral("actionKanban"));
        actionClose = new QAction(MainWindow);
        actionClose->setObjectName(QStringLiteral("actionClose"));
        actionSave = new QAction(MainWindow);
        actionSave->setObjectName(QStringLiteral("actionSave"));
        actionSave_As = new QAction(MainWindow);
        actionSave_As->setObjectName(QStringLiteral("actionSave_As"));
        actionExit = new QAction(MainWindow);
        actionExit->setObjectName(QStringLiteral("actionExit"));
        action_New = new QAction(MainWindow);
        action_New->setObjectName(QStringLiteral("action_New"));
        actionAbout = new QAction(MainWindow);
        actionAbout->setObjectName(QStringLiteral("actionAbout"));
        action_Open = new QAction(MainWindow);
        action_Open->setObjectName(QStringLiteral("action_Open"));
        actionMinimize = new QAction(MainWindow);
        actionMinimize->setObjectName(QStringLiteral("actionMinimize"));
        actionMaximize = new QAction(MainWindow);
        actionMaximize->setObjectName(QStringLiteral("actionMaximize"));
        actionRestore = new QAction(MainWindow);
        actionRestore->setObjectName(QStringLiteral("actionRestore"));
        centralWidget = new QWidget(MainWindow);
        centralWidget->setObjectName(QStringLiteral("centralWidget"));
        MainWindow->setCentralWidget(centralWidget);
        menuBar = new QMenuBar(MainWindow);
        menuBar->setObjectName(QStringLiteral("menuBar"));
        menuBar->setGeometry(QRect(0, 0, 400, 20));
        menuFile = new QMenu(menuBar);
        menuFile->setObjectName(QStringLiteral("menuFile"));
        menuRecent_Files = new QMenu(menuFile);
        menuRecent_Files->setObjectName(QStringLiteral("menuRecent_Files"));
        menuView = new QMenu(menuBar);
        menuView->setObjectName(QStringLiteral("menuView"));
        menuView->setEnabled(false);
        menuHelp = new QMenu(menuBar);
        menuHelp->setObjectName(QStringLiteral("menuHelp"));
        menuWizard = new QMenu(menuBar);
        menuWizard->setObjectName(QStringLiteral("menuWizard"));
        menuWizard->setEnabled(false);
        menuStats = new QMenu(menuBar);
        menuStats->setObjectName(QStringLiteral("menuStats"));
        menuStats->setEnabled(false);
        MainWindow->setMenuBar(menuBar);
        mainToolBar = new QToolBar(MainWindow);
        mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
        MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
        statusBar = new QStatusBar(MainWindow);
        statusBar->setObjectName(QStringLiteral("statusBar"));
        MainWindow->setStatusBar(statusBar);

        menuBar->addAction(menuFile->menuAction());
        menuBar->addAction(menuView->menuAction());
        menuBar->addAction(menuWizard->menuAction());
        menuBar->addAction(menuStats->menuAction());
        menuBar->addAction(menuHelp->menuAction());
        menuFile->addAction(action_New);
        menuFile->addAction(action_Open);
        menuFile->addAction(menuRecent_Files->menuAction());
        menuFile->addSeparator();
        menuFile->addAction(actionClose);
        menuFile->addSeparator();
        menuFile->addAction(actionSave);
        menuFile->addAction(actionSave_As);
        menuFile->addSeparator();
        menuFile->addAction(actionExit);
        menuRecent_Files->addSeparator();
        menuView->addAction(actionGTD);
        menuView->addAction(actionKanban);
        menuHelp->addAction(actionAbout);
        menuHelp->addSeparator();
        menuHelp->addAction(actionMinimize);
        menuHelp->addAction(actionMaximize);
        menuHelp->addAction(actionRestore);

        retranslateUi(MainWindow);

        QMetaObject::connectSlotsByName(MainWindow);
    } // setupUi

    void retranslateUi(QMainWindow *MainWindow)
    {
        MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
        actionGTD->setText(QApplication::translate("MainWindow", "&GTD", 0));
        actionKanban->setText(QApplication::translate("MainWindow", "&Kanban", 0));
        actionClose->setText(QApplication::translate("MainWindow", "&Close", 0));
        actionSave->setText(QApplication::translate("MainWindow", "&Save", 0));
        actionSave->setShortcut(QApplication::translate("MainWindow", "Ctrl+S", 0));
        actionSave_As->setText(QApplication::translate("MainWindow", "Save &As", 0));
        actionSave_As->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+A", 0));
        actionExit->setText(QApplication::translate("MainWindow", "E&xit", 0));
        action_New->setText(QApplication::translate("MainWindow", "&New", 0));
        action_New->setShortcut(QApplication::translate("MainWindow", "Ctrl+N", 0));
        actionAbout->setText(QApplication::translate("MainWindow", "A&bout", 0));
        actionAbout->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+B", 0));
        action_Open->setText(QApplication::translate("MainWindow", "&Open", 0));
        actionMinimize->setText(QApplication::translate("MainWindow", "M&inimize", 0));
        actionMinimize->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+I", 0));
        actionMaximize->setText(QApplication::translate("MainWindow", "Ma&ximize", 0));
        actionMaximize->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+X", 0));
        actionRestore->setText(QApplication::translate("MainWindow", "&Restore", 0));
        actionRestore->setShortcut(QApplication::translate("MainWindow", "Ctrl+Shift+R", 0));
        menuFile->setTitle(QApplication::translate("MainWindow", "&File", 0));
        menuRecent_Files->setTitle(QApplication::translate("MainWindow", "Recent Files", 0));
        menuView->setTitle(QApplication::translate("MainWindow", "&View", 0));
        menuHelp->setTitle(QApplication::translate("MainWindow", "&Help", 0));
        menuWizard->setTitle(QApplication::translate("MainWindow", "Wi&zard", 0));
        menuStats->setTitle(QApplication::translate("MainWindow", "S&tats", 0));
    } // retranslateUi

};

namespace Ui {
    class MainWindow: public Ui_MainWindow {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_MAINWINDOW_H


text:
package org.springframework.social.evernote.api.impl;

import org.junit.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.social.evernote.api.impl.entity.Bar;
import org.springframework.social.evernote.api.impl.entity.Baz;
import org.springframework.social.evernote.api.impl.entity.Foo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;

import static org.hamcrest.Matchers.*;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.springframework.social.evernote.api.impl.ThriftWrapper.makeNullSafe;
import static org.springframework.social.evernote.api.impl.ThriftWrapper.unwrap;

/**
 * @author Tadaya Tsuyukubo
 */
public class ThriftWrapperUnwrapTest {

	@Test
	public void testUnwrap() throws Exception {
		Foo foo = new Foo("foo", new ArrayList<String>(), new HashSet<String>(), new HashMap<String, String>());
		Bar bar = new Bar();
		Baz baz = new Baz();
		bar.setName("bar");
		baz.setName("baz");
		bar.setBaz(baz);
		foo.setBar(bar);

		Foo wrapped = makeNullSafe(foo);  // wrap
		Foo unwrapped = unwrap(wrapped);

		// initially all options were null
		assertThat(AopUtils.isAopProxy(unwrapped), is(false));
		assertThat(unwrapped.getRequiredList(), is(emptyCollectionOf(String.class)));
		assertThat(unwrapped.getRequiredSet(), is(emptyCollectionOf(String.class)));
		assertThat(unwrapped.getRequiredMap(), is(notNullValue()));
		assertThat(unwrapped.getRequiredMap().size(), is(0));
		assertThat(unwrapped.getOptionalList(), is(nullValue()));
		assertThat(unwrapped.getOptionalSet(), is(nullValue()));
		assertThat(unwrapped.getOptionalMap(), is(nullValue()));

		assertThat(AopUtils.isAopProxy(unwrapped.getBar()), is(false));
		assertThat(unwrapped.getBar().getName(), is("bar"));
		assertThat(unwrapped.getBar().getBarList(), is(nullValue()));
		assertThat(unwrapped.getBar().getBarSet(), is(nullValue()));
		assertThat(unwrapped.getBar().getBarMap(), is(nullValue()));

		assertThat(AopUtils.isAopProxy(unwrapped.getBar().getBaz()), is(false));
		assertThat(unwrapped.getBar().getBaz().getName(), is("baz"));
		assertThat(unwrapped.getBar().getBaz().getBazList(), is(nullValue()));
		assertThat(unwrapped.getBar().getBaz().getBazSet(), is(nullValue()));
		assertThat(unwrapped.getBar().getBaz().getBazMap(), is(nullValue()));
	}

	@Test
	public void testUnwrapWithAddedValues() throws Exception {
		// when initially null, but something has already added
		Foo foo = new Foo("foo", new ArrayList<String>(), new HashSet<String>(), new HashMap<String, String>());

		Foo wrapped = makeNullSafe(foo);  // wrap
		wrapped.addToOptionalList("FOO");
		wrapped.addToOptionalSet("FOO");
		wrapped.putToOptionalMap("FOO-KEY", "FOO-VALUE");

		Foo unwrapped = unwrap(wrapped);  // unwrap

		// should retain added values
		assertThat(unwrapped.getOptionalList(), is(hasItem("FOO")));
		assertThat(unwrapped.getOptionalSet(), is(hasItem("FOO")));
		assertThat(unwrapped.getOptionalMap(), is(hasEntry("FOO-KEY", "FOO-VALUE")));
	}

	@Test
	public void testUnwrapNullValue() {
		assertThat(ThriftWrapper.unwrap(null), is(nullValue()));
	}

}


text:
import re
import logging
import nameparser
import collections

from django.db import models
from django.apps import apps

from share.models.base import ShareObject
from share.models.base import TypedShareObjectMeta
from share.models.fields import ShareManyToManyField
from share.normalize.links import GuessAgentTypeLink
from share.util import strip_whitespace, ModelGenerator

logger = logging.getLogger('share.normalize')
NULL_RE = re.compile(r'^(?:\s*(none|null|empty)\s*)?$', re.I)
NAME_PARTS = collections.OrderedDict([('first', 'given_name'), ('middle', 'additional_name'), ('last', 'family_name'), ('suffix', 'suffix')])

AGENT_RE = r'^(.*Departa?ment.+?); (.+?); ([^;]+)$'

class AbstractAgent(ShareObject, metaclass=TypedShareObjectMeta):
    """
    An Agent is a thing that has the power to act, to make decisions,
    to produce or contribute to the production of creative works.
    Either an individual person or a group of people.
    """

    name = models.TextField(blank=True, db_index=True)
    location = models.TextField(blank=True)
    related_agents = ShareManyToManyField('AbstractAgent', through='AbstractAgentRelation', through_fields=('subject', 'related'), symmetrical=False)
    related_works = ShareManyToManyField('AbstractCreativeWork', through='AbstractAgentWorkRelation')

    @classmethod
    def normalize(cls, node, graph):
        if 'name' not in node.attrs and not node.is_blank:
            return

        name = strip_whitespace(node.attrs['name'])

        # Slightly more intellegent title casing
        name = re.sub(r'(?!for|and|the)\b[a-z]\w{2,}', lambda x: x.group().title(), name)

        if NULL_RE.match(name):
            logger.debug('Discarding unnamed agent "%s"', name)
            return graph.remove(node)

        maybe_type = GuessAgentTypeLink(default=node.type).execute(node.attrs['name'])
        # If the new type is MORE specific, IE encompasses FEWER types, upgrade. Otherwise ignore
        if len(apps.get_model('share', maybe_type).get_types()) < len(node.model.get_types()):
            node._type = maybe_type

        match = re.match(r'^(.*(?:Departa?ment|Institute).+?);(?: (.+?); )?([^;]+)$', name, re.I)
        if match:
            *parts, location = [strip_whitespace(x) for x in match.groups() if x and strip_whitespace(x)]
            node.attrs['name'] = ' - '.join(reversed(parts))
            node.attrs['location'] = location
            return

        match = re.match(r'^(.+?), ([^,]+), ([^,]+)$', name, re.I)
        if match:
            name, *location = [strip_whitespace(x) for x in match.groups() if x and strip_whitespace(x)]
            node.attrs['name'] = name
            node.attrs['location'] = ', '.join(location)

        node.attrs['name'] = name
        if node.attrs.get('location'):
            node.attrs['location'] = strip_whitespace(node.attrs['location'])

    class Disambiguation:
        any = ('identifiers', 'work_relations')

    class Meta:
        db_table = 'share_agent'
        index_together = (
            ('type', 'name',)
        )

    def __str__(self):
        return self.name

generator = ModelGenerator(field_types={
    'text': models.TextField
})
globals().update(generator.subclasses_from_yaml(__file__, AbstractAgent))

def normalize_person(cls, node, graph):
    name = max(strip_whitespace(' '.join(
        node.attrs[x]
        for x in NAME_PARTS.values()
        if node.attrs.get(x)
    )), strip_whitespace(node.attrs.get('name', '')), '', key=len)

    if NULL_RE.match(name):
        logger.debug('Discarding unnamed agent "%s"', node.attrs['name'])
        return graph.remove(node)

    human = nameparser.HumanName(name)
    parts = {v: strip_whitespace(human[k]).title() for k, v in NAME_PARTS.items() if strip_whitespace(human[k])}

    node.attrs = {'name': ' '.join(parts[k] for k in NAME_PARTS.values() if k in parts), **parts}

    if node.attrs.get('location'):
        node.attrs['location'] = strip_whitespace(node.attrs['location'])

Person.normalize = classmethod(normalize_person)  # noqa

class UniqueNameDisambiguation:
    any = AbstractAgent.Disambiguation.any + ('name',)

Institution.Disambiguation = UniqueNameDisambiguation # noqa
Organization.Disambiguation = UniqueNameDisambiguation # noqa
Consortium.Disambiguation = UniqueNameDisambiguation # noqa


text:
<!DOCTYPE html>
<html lang="en">
{% include head.html %}

<body ontouchstart="">
    <header class="header top" id="header">
        {% include header.html %}
    </header>
    <div class="container">
        {{ content }}
    </div>

    {% include footer.html %}
</body>

</html>


text:
<meta http-equiv="X-UA-Compatible" content="IE=Edge">

	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../quickforms/css/quickforms/quickforms.css" />

SAMPLE APP

		<form id="newform">

Student Registration Dashboard

			New Registration Form

			New registration Form
		</form>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>RestPixlTest</groupId>
  <artifactId>RestPixlTest</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>RestPixlTest</name>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
		<dependency>
			<groupId>RestPixl</groupId>
			<artifactId>RestPixl</artifactId>
			<version>0.0.1-SNAPSHOT</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>
</project>


text:
def to_string(exception: Exception) -> str:
    return f"{type(exception).__name__}: {str(exception)}"


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/UniversalMusicPlayer.iml" filepath="$PROJECT_DIR$/UniversalMusicPlayer.iml" />
      <module fileurl="file://$PROJECT_DIR$/mobile/mobile.iml" filepath="$PROJECT_DIR$/mobile/mobile.iml" />
    </modules>
  </component>
</project>


text:
package com.eixox.data;

/**
 * Programming model for "filter able" objects.
 *
 * @author Rodrigo Portela
 *
 * @param <T>
 */
public interface Filterable<T> {

	/**
	 * Sets the filter to a given term.
	 *
	 * @param term
	 * @return
	 */
	public T where(FilterTerm term);

	/**
	 * Sets the filter to a given expression.
	 *
	 * @param expression
	 * @return
	 */
	public T where(FilterExpression expression);

	/**
	 * Sets the filter to a given filter term;
	 *
	 * @param column
	 * @param comparison
	 * @param value
	 * @return
	 */
	public T where(Column column, FilterComparison comparison, Object value);

	/**
	 * Sets the filter to a given filter term;
	 *
	 * @param column
	 * @param value
	 * @return
	 */
	public T where(Column column, Object value);

	/**
	 * Sets the filter to a given filter term.
	 *
	 * @param name
	 * @param comparison
	 * @param value
	 * @return
	 */
	public T where(String name, FilterComparison comparison, Object value);

	/**
	 * Sets the filter o a given filter term.
	 *
	 * @param name
	 * @param value
	 * @return
	 */
	public T where(String name, Object value);

	/**
	 * Appends a given term with an AND operator.
	 *
	 * @param term
	 * @return
	 */
	public T andWhere(FilterTerm term);

	/**
	 * Appends a given expression with an AND operator.
	 *
	 * @param expression
	 * @return
	 */
	public T andWhere(FilterExpression expression);

	/**
	 * Appends a given filter term with an AND operator;
	 *
	 * @param column
	 * @param comparison
	 * @param value
	 * @return
	 */
	public T andWhere(Column column, FilterComparison comparison, Object value);

	/**
	 * Appends a given filter term with an AND operator;
	 *
	 * @param column
	 * @param value
	 * @return
	 */
	public T andWhere(Column column, Object value);

	/**
	 * Appends a given term with an AND operator.
	 *
	 * @param name
	 * @param comparison
	 * @param value
	 * @return
	 */
	public T andWhere(String name, FilterComparison comparison, Object value);

	/**
	 * Appends a given term with an AND operator.
	 *
	 * @param name
	 * @param value
	 * @return
	 */
	public T andWhere(String name, Object value);

	/**
	 * Appends a given term with an OR operator.
	 *
	 * @param term
	 * @return
	 */
	public T orWhere(FilterTerm term);

	/**
	 * Appends a given expression with an OR operator.
	 *
	 * @param expression
	 * @return
	 */
	public T orWhere(FilterExpression expression);

	/**
	 * Appends a given filter term with an OR operator;
	 *
	 * @param column
	 * @param comparison
	 * @param value
	 * @return
	 */
	public T orWhere(Column column, FilterComparison comparison, Object value);

	/**
	 * Appends a given filter term with an OR operator;
	 *
	 * @param column
	 * @param value
	 * @return
	 */
	public T orWhere(Column column, Object value);

	/**
	 * Appends a given term with an OR operator.
	 *
	 * @param name
	 * @param comparison
	 * @param value
	 * @return
	 */
	public T orWhere(String name, FilterComparison comparison, Object value);

	/**
	 * Appends a given term with an OR operator.
	 *
	 * @param name
	 * @param value
	 * @return
	 */
	public T orWhere(String name, Object value);

}


text:
#include "config.h"
#include "public/platform/WebTransformKeyframe.h"

#include "wtf/PassOwnPtr.h"

namespace blink {

WebTransformKeyframe::WebTransformKeyframe(double time, PassOwnPtr<WebTransformOperations> value)
    : m_time(time)
    , m_value(value)
{
}

WebTransformKeyframe::~WebTransformKeyframe()
{
    m_value.reset(0);
}

double WebTransformKeyframe::time() const
{
    return m_time;
}

const WebTransformOperations& WebTransformKeyframe::value() const
{
    return *m_value.get();
}

} // namespace blink


text: Criado por Adriano Schmidt


text:
module Azure::ARM::Resources
  module Models
    #
    # The type of the paths for alias.
    #
    class AliasPathType

      include MsRestAzure

      # @return [String] The path of an alias.
      attr_accessor :path

      # @return [Array<String>] The API versions.
      attr_accessor :api_versions

      #
      # Mapper for AliasPathType class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          required: false,
          serialized_name: 'AliasPathType',
          type: {
            name: 'Composite',
            class_name: 'AliasPathType',
            model_properties: {
              path: {
                required: false,
                serialized_name: 'path',
                type: {
                  name: 'String'
                }
              },
              api_versions: {
                required: false,
                serialized_name: 'apiVersions',
                type: {
                  name: 'Sequence',
                  element: {
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
{-# LANGUAGE RankNTypes #-}
module Main where

import Blinkomatic
import Color (RGB(..), blackRGB, rgb_w2d)
import Control.Exception (bracket)
import Control.Monad          (forM_)
import Control.Monad.Identity (Identity(..))
import Control.Monad.State (StateT, evalStateT)
import Control.Monad.Trans (MonadIO(liftIO), lift)
import Control.Wire (Wire, Event, Session(..), Timed(..), countSession_, stepWire, stepSession)
import Control.Concurrent.STM      (atomically)
import Control.Concurrent.STM.TVar (TVar, newTVar, readTVar, writeTVar)
import Control.Wire.Unsafe.Event
import Data.Time.Clock
import qualified Data.IntMap as IntMap
import Data.IntMap (IntMap)
import Data.Maybe  (fromJust)
import Data.Vector                   (Vector)
import qualified Data.Vector         as V
import qualified Data.Vector.Mutable as MV
import Data.Word (Word8)
import qualified Graphics.Rendering.OpenGL as GL
import Graphics.Rendering.OpenGL (($=))
import qualified Graphics.UI.GLFW as GLFW
import Sound.NH.MIDI.Core (MIDI(MidiClock))

data Scene = Scene
  { elWires   :: MV.IOVector Switch
  , tclLights :: TVar (Vector (RGB Word8))
  }

colorMap :: IntMap (GL.Color3 GL.GLfloat)
colorMap = IntMap.fromList
  [ (0, GL.Color3 1.0 0.0 0.0) -- red
  , (1, GL.Color3 1.0 0.5 0.0) -- dark orange
  , (2, GL.Color3 1.0 0.8 0.0) -- light orange
  , (3, GL.Color3 1.0 1.0 0.0) -- yellow
  , (4, GL.Color3 0.5 1.0 0.0) -- light green
  , (5, GL.Color3 0.0 0.0 1.0) -- blue
  , (6, GL.Color3 0.7 0.7 0.9) -- violet
  , (7, GL.Color3 1.0 1.0 1.0) -- white
  ]

-- | Resize the viewport and set the projection matrix
resize window w h = do
  -- These are all analogous to the standard OpenGL functions
  GL.viewport     $= (GL.Position 0 0, GL.Size (fromIntegral w) (fromIntegral h))
  GL.matrixMode   $= GL.Projection
  GL.loadIdentity
  GL.perspective  45 (fromIntegral w / fromIntegral h) 1 100
  GL.matrixMode   $= GL.Modelview 0

-- | This will print and clear the OpenGL errors
printErrors = GL.get GL.errors >>= mapM_ print

drawScene :: (MonadIO m) => GLFW.Window -> Scene -> m ()
drawScene window scene = liftIO $
  do GL.clear [GL.ColorBuffer, GL.DepthBuffer]
     GL.loadIdentity
     GL.translate $ GL.Vector3 (-20) 0 (-50 :: GL.GLfloat)
     -- el wire
     GL.renderPrimitive GL.Quads $
       forM_ [0..7] $ \i -> do
         switch <- liftIO $ MV.read (elWires scene) (fromIntegral i)
         forM_ [(0,0), (1,0), (1,1), (0, 1)] $ \(x, y) ->
           let vtx = GL.Vertex3 (x + (fromIntegral i * 2)) y 0 :: GL.Vertex3 GL.GLfloat
           in do case switch of
                     Open -> GL.color (GL.Color3 0.1 0.1 (0.1 :: GL.GLfloat))
                     Close  -> GL.color $ fromJust $ IntMap.lookup i colorMap
                 GL.vertex vtx
     -- tcl
     tcl <- atomically $ readTVar $ tclLights scene
     GL.renderPrimitive GL.Quads $
       forM_ [0..24::Int] $ \i -> do
         let light = tcl V.! (fromIntegral i)
         forM_ [(0,0), (1,0), (1,1), (0, 1)] $ \(x, y) ->
           let vtx = GL.Vertex3 (x + (fromIntegral i * 2)) (y+10) 0 :: GL.Vertex3 GL.GLfloat
           in do let RGB r g b = rgb_w2d light
                 GL.color (GL.Color3 (realToFrac r) (realToFrac g) (realToFrac b :: GL.GLfloat))
                 GL.vertex vtx
     printErrors

     GL.flush
     GLFW.swapBuffers window

simulateShow :: (MonadIO m) =>
                GLFW.Window
             -> Scene
             -> Session m (Timed Int ())
             -> MidiLights
             -> m a
simulateShow window scene s0 w0 = loop s0 w0
  where
    loop s' w' = do
      (ds, s) <- stepSession s'
      let Identity (mx, w) =  stepWire w' ds (Right NoEvent)
      case mx of
        (Right (Event actions)) ->
          do let perform (Print s)     = liftIO $ putStrLn s
                 perform (SendCmd (Command channel switch)) =
                   liftIO $ MV.write (elWires scene) (fromIntegral channel) switch
                 perform (TCL tcl) = liftIO $ atomically $ writeTVar (tclLights scene) tcl
             mapM_ perform actions
             liftIO $ GLFW.pollEvents
             drawScene window scene
        _                 -> return ()
      loop s w

simulate :: Double -> MidiLights -> IO ()
simulate bpm midiLights =
  bracket GLFW.init (const GLFW.terminate) $ \True -> do
    (Just window) <- GLFW.createWindow 640 480 "blinkomatic" Nothing Nothing
    GLFW.makeContextCurrent (Just window)
    GLFW.setWindowSizeCallback window (Just resize)
    GL.depthFunc $= Just GL.Less
    el  <- MV.replicate 10 Open
    tcl <- atomically $ newTVar $ V.replicate 25 blackRGB
    simulateShow window (Scene el tcl) (fakeMidiClock bpm) midiLights
    return ()

fakeMidiClock :: (MonadIO m) => Double -> MidiSession m
fakeMidiClock bpm =
  Session $ do
    t0 <- liftIO getCurrentTime
    return (Timed 0 (), loop t0)
    where
      secondsPerPulse :: NominalDiffTime
      secondsPerPulse = ((1 / (realToFrac bpm)) * 60) / 24
      loop t' =
        Session $ do
          t <- liftIO getCurrentTime
          let dt = diffUTCTime t t'
              dmc :: Int
              dmc = floor (realToFrac (dt / secondsPerPulse) :: Double)
          if dt > secondsPerPulse
            then return (Timed dmc (), loop (addUTCTime ((fromIntegral dmc) * secondsPerPulse) t'))
            else return (Timed 0 (), loop t')

main :: IO ()
main = simulate 120 tclFade


text:
/*jslint browser: true, devel: true, node: true, ass: true, nomen: true, unparam: true, indent: 4 */

/**
 * @license
 * Copyright (c) 2015 The ExpandJS authors. All rights reserved.
 * This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt
 * The complete set of authors may be found at https://expandjs.github.io/AUTHORS.txt
 * The complete set of contributors may be found at https://expandjs.github.io/CONTRIBUTORS.txt
 */
(function () {
    "use strict";

    var assertArgument = require('../assert/assertArgument'),
        isDefined      = require('../tester/isDefined'),
        slice          = require('../array/slice'),
        toArray        = require('../caster/toArray');

    /**
     * Concatenates multiple arrays between them, using the first one as an
     * entry point, and returns the result.
     *
     * ```js
     *     var num1 = [1, 2, 3],
     *         num2 = [4, 5, 6],
     *         num3 = [7, 8, 9];
     *
     *     XP.concat(num1, num2, num3);
     *     // => [1, 2, 3, 4, 5, 6, 7, 8, 9]
     *
     *     console.log(num1);
     *     // => [1, 2, 3, 4, 5, 6, 7, 8, 9]
     * ```
     *
     * @function concat
     * @param {Array} array The entry point array to be modified
     * @param {...Array} var_args List of arrays to be concatenated with the entry point
     * @returns {Array} Returns the modified entry point array
     */
    module.exports = function concat(array, var_args) {
        assertArgument(array = toArray(array), 1, 'Arrayable');
        slice(arguments, 1).forEach(function (arg) { if (isDefined(arg = toArray(arg))) { arg.forEach(function (val) { array.push(val); }); } });
        return array;
    };

}());


text:
from setuptools import setup, find_packages

setup(
  name = 'pipspect',
  version = '0.3',
  entry_points={
    'console_scripts': ['pipspect=src.pipspect:main']
  },
  packages = find_packages(),
  license = "MIT",
  description = 'A small CLI tool to inspect your modules, especially those installed via pip',
  author = 'Yong Cheng Toh',
  author_email = 'tohyongcheng@gmail.com',
  url = 'https://github.com/tohyongcheng/pipspect',
  keywords = ['module', 'inspect', 'pip', 'classes', 'builtin', 'functions', 'methods'], # arbitrary keywords
  classifiers = [
    'Development Status :: 3 - Alpha',
    'Environment :: Console',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Programming Language :: Python',
    'Topic :: Software Development :: Testing',
    'Programming Language :: Python :: 2',
  ],
)


text:
/*
* PROJECT:          Atomix Development
* LICENSE:          BSD 3-Clause (LICENSE.md)
* PURPOSE:          Blt_Un MSIL
* PROGRAMMERS:      Aman Priyadarshi (aman.eureka@gmail.com)
*/

using System;
using System.Reflection;

using Atomixilc.Machine;
using Atomixilc.Attributes;
using Atomixilc.IL.CodeType;
using Atomixilc.Machine.x86;

namespace Atomixilc.IL
{
    [ILImpl(ILCode.Blt_Un)]
    internal class Blt_Un_il : MSIL
    {
        public Blt_Un_il()
            : base(ILCode.Blt_Un)
        {

        }

        /*
         * URL : https://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.Blt_Un(v=vs.110).aspx
         * Description : Transfers control to a target instruction if the first value is less than the second value, when comparing unsigned integer values or unordered float values.
         */
        internal override void Execute(Options Config, OpCodeType xOp, MethodBase method, Optimizer Optimizer)
        {
            if (Optimizer.vStack.Count < 2)
                throw new Exception("Internal Compiler Error: vStack.Count < 2");

            var offset = ((OpBranch)xOp).Value;
            var itemA = Optimizer.vStack.Pop();
            var itemB = Optimizer.vStack.Pop();

            var xTrueLabel = Helper.GetLabel(offset);

            var size = Math.Max(Helper.GetTypeSize(itemA.OperandType, Config.TargetPlatform),
                Helper.GetTypeSize(itemB.OperandType, Config.TargetPlatform));

            /* The stack transitional behavior, in sequential order, is:
             * value1 is pushed onto the stack.
             * value2 is pushed onto the stack.
             * value2 and value1 are popped from the stack; if value1 is less than value2, the branch operation is performed.
             */

            switch (Config.TargetPlatform)
            {
                case Architecture.x86:
                    {
                        if (itemA.IsFloat || itemB.IsFloat || size > 4)
                            throw new Exception(string.Format("UnImplemented '{0}'", msIL));

                        if (!itemA.SystemStack || !itemB.SystemStack)
                            throw new Exception(string.Format("UnImplemented-RegisterType '{0}'", msIL));

                        new Pop { DestinationReg = Register.EAX };
                        new Pop { DestinationReg = Register.EDX };
                        new Cmp { DestinationReg = Register.EDX, SourceReg = Register.EAX };
                        new Jmp { Condition = ConditionalJump.JB, DestinationRef = xTrueLabel };

                        Optimizer.SaveStack(offset);
                        Optimizer.SaveStack(xOp.NextPosition);
                    }
                    break;
                default:
                    throw new Exception(string.Format("Unsupported target platform '{0}' for MSIL '{1}'", Config.TargetPlatform, msIL));
            }
        }
    }
}


text:
using UnityEngine;
using System.Collections;

public class Flash : MonoBehaviour {

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {

		if(Input.GetMouseButtonDown(0))
			FlashAllEllemnts();
	}

	private void FlashAllEllemnts () {
		GameObject[] ellemnts = GameObject.FindGameObjectsWithTag("Player");
		foreach(GameObject ellemnt in ellemnts) {
			float rand = Random.Range(0f,10f);
			if(rand > 9f) ellemnt.SendMessage("StrongerSkin");
		}
	}
}


text:
package io.druid.segment.filter;

import io.druid.java.util.common.StringUtils;
import io.druid.query.BitmapResultFactory;
import io.druid.query.filter.BitmapIndexSelector;
import io.druid.query.filter.Filter;
import io.druid.query.filter.ValueMatcher;
import io.druid.segment.ColumnSelector;
import io.druid.segment.ColumnSelectorFactory;

/**
 */
public class SelectorFilter implements Filter
{
  private final String dimension;
  private final String value;

  public SelectorFilter(
      String dimension,
      String value
  )
  {
    this.dimension = dimension;
    this.value = value;
  }

  @Override
  public <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory)
  {
    return bitmapResultFactory.wrapDimensionValue(selector.getBitmapIndex(dimension, value));
  }

  @Override
  public ValueMatcher makeMatcher(ColumnSelectorFactory factory)
  {
    return Filters.makeValueMatcher(factory, dimension, value);
  }

  @Override
  public boolean supportsBitmapIndex(BitmapIndexSelector selector)
  {
    return selector.getBitmapIndex(dimension) != null;
  }

  @Override
  public boolean supportsSelectivityEstimation(
      ColumnSelector columnSelector, BitmapIndexSelector indexSelector
  )
  {
    return Filters.supportsSelectivityEstimation(this, dimension, columnSelector, indexSelector);
  }

  @Override
  public double estimateSelectivity(BitmapIndexSelector indexSelector)
  {
    return (double) indexSelector.getBitmapIndex(dimension, value).size() / indexSelector.getNumRows();
  }

  @Override
  public String toString()
  {
    return StringUtils.format("%s = %s", dimension, value);
  }
}


text:
package org.apache.spark.deploy.k8s

import io.fabric8.kubernetes.api.model.{Container, Pod}

 /**
  * The purpose of this case class is so that we can package together
  * the driver pod with its container so we can bootstrap and modify
  * the class instead of each component seperately
  */
private[spark] case class PodWithMainContainer(
    pod: Pod,
    mainContainer: Container)


text:
@interface FLXTodoTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation FLXTodoTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

# pragma mark - Public

- (instancetype)initializeWithTodo:(FLXTodo *)todo {
    self.label.text = todo.subject;

    return self;
}

@end


text:
import logging
import textwrap
import re

from profiles.model.user import PasswordHistory

from profiles.webapp.framework import scrubber

log = logging.getLogger(__name__)

class AuthScrubber(scrubber.Scrubber):

    """
    All the auth-related scrubbers are here.  Different subclasses pick
    and choose which ones to run.
    """

    def extract_password1_from_post(self, raw_data, errors, values):

        if 'password1' in self.req.parsed_body:
            values['password1'] = self.req.parsed_body['password1'][0]

        else:
            errors['password1'] = 'This is a required field!'
            errors['general'] = 'Sorry, you have some bad data'

        return raw_data, errors, values

    def extract_password2_from_post(self, raw_data, errors, values):

        if 'password2' in self.req.parsed_body:
            values['password2'] = self.req.parsed_body['password2'][0]

        else:
            errors['password2'] = 'This is a required field!'
            errors['general'] = 'Sorry, you have some bad data'

        return raw_data, errors, values

    def verify_passwords_match(self, raw_data, errors, values):

        if not errors and values['password1'] != values['password2']:
            errors['password2'] = 'This password doesn\'t match!'

        return raw_data, errors, values

    def extract_old_password_from_post(self, raw_data, errors, values):

        if 'old_password' in self.req.parsed_body:
            values['old_password'] = self.req.parsed_body['old_password'][0]

        else:
            errors['old_password'] = 'This is a required field!'
            errors['general'] = 'Sorry, you have some bad data'

        return raw_data, errors, values

    def extract_person_id_from_session(self, raw_data, errors, values):

        log.debug('errors is {0}.'.format(errors))

        if not errors:

            if not self.req.session:
                errors['general'] = "No session!"

            elif not self.req.user:
                errors['general'] = "Not logged in!"

            else:
                values['person_id'] = self.req.user.person_id

        return raw_data, errors, values

    def verify_password_history(self, raw_data, errors, values):

        if not errors:

            pw_history = PasswordHistory(self.pgconn, person_id=values['person_id'])
            log.debug("Password for password history for {0}.".format(values['password1']))
            pass_history = pw_history.check_password_history(values['password1'],insert_history_record=False)

            if pass_history==True:
                errors['general'] = 'Sorry, this password has been used in the past year.'

        return raw_data, errors, values

    def verify_old_password_is_correct(self, raw_data, errors, values):

        if not errors:

            cursor = self.pgconn.cursor()

            cursor.execute(textwrap.dedent("""
                select person_id
                from people
                where person_id = %(person_id)s
                and salted_hashed_password = crypt(
                %(old_password)s,
                salted_hashed_password)
                """),
                dict(
                    person_id=values['person_id'],
                    old_password=values['old_password']))

            if not cursor.rowcount:
                # errors['general'] = 'Sorry, you have some bad data'
                errors['old_password'] = 'Sorry, this is not correct'

        return raw_data, errors, values

    def extract_biography_from_post(self, raw_data, errors, values):

        if 'biography' in self.req.parsed_body:
            values['biography'] = self.req.parsed_body['biography'][0]

        else:
            errors['biography'] = 'This is a required field!'
            errors['general'] = 'Sorry, you have some bad data'

        return raw_data, errors, values

    def check_password(self, raw_data, errors, values):

        password = values['password1']
        #strength = ['Blank', 'Very Weak', 'Weak', 'Medium', 'Strong', 'Very Strong']
        score = 1

        #if len(password) < 1:
        #    return strength[0]
        #if len(password) < 4:
        #    return strength[1]

        log.debug(password)

        if len(password) >= 8:
            score = score + 1
            log.debug(score)
        if len(password) >=10:
            score = score + 1

        if re.search('\d+',password):
            score = score + 1
        if re.search('[a-z]',password) and re.search('[A-Z]', password):
            score = score + 1
        if re.search('.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]', password):
            score = score + 1

        if score <= 2:
            errors['password1'] = 'Password must be a strong password! The password must be minimum of eight alphanumeric characters including a number or symbol'
            errors['general'] = 'Sorry, you have some bad data'

        return raw_data, errors, values

class ChangePasswordScrubber(AuthScrubber):

    def scrub(self):

        raw_data, errors, values = dict(), dict(), dict()

        # Remember that python passes errors and values by
        # references so each of these methods are altering the errors
        # and values dictionaries.

        self.extract_password1_from_post(raw_data, errors, values)
        self.extract_password2_from_post(raw_data, errors, values)
        self.check_password(raw_data, errors, values)
        self.verify_passwords_match(raw_data, errors, values)
        self.extract_old_password_from_post(raw_data, errors, values)
        self.extract_person_id_from_session(raw_data, errors, values)
        self.verify_old_password_is_correct(raw_data, errors, values)
        self.verify_password_history(raw_data,errors,values)

        if not errors:

            # Now assign the good values.
            values['password'] = values['password1']

        log.debug('errors at the end of scrub is {0}.'.format(errors))

        return raw_data, errors, values

class UpdateBiographyScrubber(AuthScrubber):

    def scrub(self):

        raw_data, errors, values = dict(), dict(), dict()

        self.extract_person_id_from_session(raw_data, errors, values)
        self.extract_biography_from_post(raw_data, errors, values)

        return raw_data, errors, values

class UpdateContactInfoScrubber(AuthScrubber):

    def scrub(self):

        raw_data, errors, values = dict(), dict(), dict()

        self.extract_person_id_from_session(raw_data, errors, values)

        for field in ['phone_number_one', 'phone_number_two',
            'twitter_page',
            'facebook_page',
            'pinterest_page',
            'email_address',
            'street_address_line_one',
            'street_address_line_two',
            'city',
            'state',
            'zipcode']:

            self.generic_extract(raw_data, errors, values, field,
                self.req.parsed_body, required_field=False,
                converter=self.convert_empty_strings_to_None)

        return raw_data, errors, values

class UpdateLocationScrubber(AuthScrubber):

    def scrub(self):

        raw_data, errors, values = dict(), dict(), dict()

        self.extract_person_id_from_session(errors, values)

        for field in ['latitude', 'longitude']:

            self.generic_extract(raw_data, errors, values, field,
                self.req.parsed_body, required_field=True,
                converter=float)

        log.debug('errors at the end of scrub is {0}.'.format(errors))

        return raw_data, errors, values


text:
package operias.output.html;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;

import org.apache.commons.io.IOUtils;

import operias.Configuration;
import operias.diff.DiffFile;

public class HTMLTestView extends HTMLCodeView {

	/**
	 * Create a new hTML file view page
	 * @param file
	 * @throws IOException
	 */
	public HTMLTestView(String fileName, DiffFile file) throws IOException {

		File classHTMLFile = new File(Configuration.getDestinationDirectory() + "/" + fileName + ".html");
		classHTMLFile.createNewFile();

		PrintStream outputStreamHTMLFile = new PrintStream(classHTMLFile);
		InputStream headerStream = getClass().getResourceAsStream("/html/header.html");
		IOUtils.copy(headerStream, outputStreamHTMLFile);

		outputStreamHTMLFile.println("

");

		InputStream legendStream = getClass().getResourceAsStream("/html/codeviewlegend.html");
		IOUtils.copy(legendStream, outputStreamHTMLFile);

		outputStreamHTMLFile.println("
");
		outputStreamHTMLFile.print("
Code");
		outputStreamHTMLFile.println("
");
		outputStreamHTMLFile.println("
");

		// Generate source diff view
		generateSourceDiffView(outputStreamHTMLFile, file, true);

		outputStreamHTMLFile.println("

");

		InputStream footerStream = getClass().getResourceAsStream("/html/footer.html");
		IOUtils.copy(footerStream, outputStreamHTMLFile);

		outputStreamHTMLFile.close();
		footerStream.close();
		headerStream.close();
	}

}


text:
<component-set>
  <components>
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>dll</role-hint>
      <implementation>
        org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
      </implementation>
      <configuration>
        <phases>
          <process-resources>
            org.apache.maven.plugins:maven-resources-plugin:resources
          </process-resources>
          <compile>
            com.samskivert:monotouch-maven-plugin:ios-compile-bindings
          </compile>
          <package>
            com.samskivert:monotouch-maven-plugin:ios-package-bindings
          </package>
          <install>
            org.apache.maven.plugins:maven-install-plugin:install
          </install>
          <deploy>
            org.apache.maven.plugins:maven-deploy-plugin:deploy
          </deploy>
        </phases>
      </configuration>
    </component>
    <component>
      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
      <role-hint>dll</role-hint>
      <implementation>
        org.apache.maven.artifact.handler.DefaultArtifactHandler
      </implementation>
      <configuration>
        <extension>dll</extension>
        <type>dll</type>
        <packaging>dll</packaging>
        <addedToClasspath>true</addedToClasspath>
      </configuration>
    </component>
  </components>
</component-set>