text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <title>Esame Febbraio 2019 </title>
  <meta property="og:title" content="Esame Febbraio 2019 " />
  <meta name="twitter:title" content="Esame Febbraio 2019 " />
  <meta name="description" content="

">
  <meta property="og:description" content="

">
  <meta name="twitter:description" content="

">
  <meta name="author" content=""/>
  <link href='https://thefreolo.github.io/img/favicon.ico' rel='icon' type='image/x-icon'/>
  <meta property="og:image" content="https://thefreolo.github.io/media/Profile_PIC.jpg" />
  <meta name="twitter:image" content="https://thefreolo.github.io/media/Profile_PIC.jpg" />
  <meta name="twitter:card" content="summary" />
  <meta name="twitter:site" content="@TheFreolo" />
  <meta name="twitter:creator" content="@TheFreolo" />
  <meta property="og:url" content="https://thefreolo.github.io/teaching/esamefebbraio2019/" />
  <meta property="og:type" content="website" />
  <meta property="og:site_name" content="Federico Reali" />

  <meta name="generator" content="Hugo 0.36.1" />
  <link rel="canonical" href="https://thefreolo.github.io/teaching/esamefebbraio2019/" />
  <link rel="alternate" href="https://thefreolo.github.io/index.xml" type="application/rss+xml" title="Federico Reali">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <link rel="stylesheet" href="https://thefreolo.github.io/css/main.css" /><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
  <link rel="stylesheet" href="https://thefreolo.github.io/css/highlight.min.css" /><link rel="stylesheet" href="https://thefreolo.github.io/css/codeblock.css" />

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">

      <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
      <button class="pswp__button pswp__button--share" title="Share"></button>
      <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
      <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

    <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
    </button>
    <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
    </button>

      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
        Toggle navigation

      </button>
      Federico Reali

              Teaching

                  Home

                  Biostatistics

                  Calcolo delle Probabilità e Statistica Matematica

                  Note di R (it)

              Publications

              About

Esame Febbraio 2019

Esercizio 1

Si consideri il dataset contenente i dati relativi ad alcune informazioni (come peso e alle ore di sonno) di alcuni animali (descrizione).

(2 punti) Si importi il dataset e considerino solo le variabili BodyWt, BrainWt e TotSleep. Si verifichi se ci sono errori nei dati. Se ci sono, li si sostituisca con la media dei dati relativi alla stessa variabile. Nel fare ciò, si escludano i dati errati.

(2 punti) Si calcolino quartili, media e mediana  dei dati. Inolte, si visualizzino le variabili usando degli istogrammi ed i boxplot. Si commentino i grafici e la presenza di potenziali outliers.

(2 punti) Si crei un modello di regressione lineare tra li variabili BodyWt e BrainWt. Si visualizzino i dati, la retta di regressione,
la distribuzione dei residui e si confrontino i quantili dei residui con i quantili della normale. Si commentino i risultati grafici e il valore di R quadro.

Si produca uno script funzionante (o un notebook) che contiene tutto il codice per risolvere gli esercizi. I plot devono riportare le opportune label lungo gli assi.

              ← Previous Post

          2020

             •
            Federico Reali

          Hugo v0.36.1 powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo


text:
package Paws::EC2::DisableVpcClassicLink;
  use Moose;
  has DryRun => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'dryRun' );
  has VpcId => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'vpcId' , required => 1);

  use MooseX::ClassAttribute;

  class_has _api_call => (isa => 'Str', is => 'ro', default => 'DisableVpcClassicLink');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::EC2::DisableVpcClassicLinkResult');
  class_has _result_key => (isa => 'Str', is => 'ro');
1;

### main pod documentation begin ###

=head1 NAME

Paws::EC2::DisableVpcClassicLink - Arguments for method DisableVpcClassicLink on Paws::EC2

=head1 DESCRIPTION

This class represents the parameters used for calling the method DisableVpcClassicLink on the
Amazon Elastic Compute Cloud service. Use the attributes of this class
as arguments to method DisableVpcClassicLink.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DisableVpcClassicLink.

As an example:

  $service_obj->DisableVpcClassicLink(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 DryRun => Bool

Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response. If
you have the required permissions, the error response is
C<DryRunOperation>. Otherwise, it is C<UnauthorizedOperation>.

=head2 B<REQUIRED> VpcId => Str

The ID of the VPC.

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method DisableVpcClassicLink in L<Paws::EC2>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut

redpajama_set_name: RedPajamaGithub


text:
"""Provides interface for training the model."""

import os
import shutil

import tensorflow as tf

from .model import architectures
from .preprocessing import ImageDataPipeline

def main(train_dir,
         label_dict,
         steps,
         savepath,
         tensorboard_dir,
         resuming=True):
    """
    Builds up a graph of operations from scratch to train a model.

    Parameters:
        - train_dir (str)
            - Path to the directory of classes.
            - e.g. 'data/train', where 'train' holds subdirs with images in them.
        - label_dict (dict, str -> np.ndarray)
            - Maps the name of the subdirectory (class) to a label.
                - e.g. {'cats': np.array([[1, 0]]), 'dogs': np.array([[0, 1]])}
                    - Each label must have the same shape!
                    - In this case, the two labels are of shape [1, 2].
        - steps (int)
            - Number of gradient updates (samples to train on).
        - savepath (str)
            - Path where the model will be saved/loaded from.
            - e.g. X/Y will give: X/Y.meta, X/Y.index, etc. for other tf.train.Saver artifacts.
        - tensorboard_dir (str)
            - Directory where the tensorboard files are stored.
        - resuming (bool)
            - Whether to resume training from a saved model or to start from scratch.
    """
    # TensorFlow doesn't overwrite the old directory by default.
    if os.path.isdir(tensorboard_dir):
        shutil.rmtree(tensorboard_dir)
    sess = tf.Session()
    # If resuming, load the graph from the saved directory.
    if resuming:
        loader = tf.train.import_meta_graph(savepath + '.meta')
        loader.restore(sess, savepath)
        input_ = sess.graph.get_tensor_by_name('input:0')
        label = sess.graph.get_tensor_by_name('label:0')
        optimizer = sess.graph.get_operation_by_name('optimizer')
    # Else, we have to build from scratch.
    else:
        input_ = tf.placeholder(tf.float32, name='input')
        output = architectures.baby_resnet(input_, name='model')
        sess.run(tf.global_variables_initializer())
        label = tf.placeholder(tf.float32, name='label')
        objective = tf.sqrt(tf.reduce_mean(tf.squared_difference(label, output)), name='objective')
        optimizer = tf.train.GradientDescentOptimizer(0.0001).minimize(objective, name='optimizer')
        tf.summary.scalar('objective_summary', objective)
    # Merge summary ops and create writer object to record the results.
    summary = tf.summary.merge_all()
    writer = tf.summary.FileWriter(tensorboard_dir, graph=sess.graph)
    # Define preprocessor and begin training the model.
    preprocessor = ImageDataPipeline(mode='NHWC')
    for step, img_path, img_tensor, img_label in preprocessor.preprocess_classes(steps, train_dir,
                                                                                label_dict):
        print('Step: {} | Image: {}'.format(step, img_path))
        _, step_summary = sess.run([optimizer, summary],
                                   feed_dict={input_: img_tensor, label: img_label})
        writer.add_summary(step_summary, global_step=step)
    tf.train.Saver().save(sess, savepath)
    # Make a noise to indicate end of training.
    print('\a')


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title>帮主约见窗口</title>
	<link rel="stylesheet" type="text/css" href="../../../css/aui-win.css">

约见帮主

		提交


text:
package com.jiajunhui.xapp.medialoader.bean;

import com.jiajunhui.xapp.medialoader.config.FileLoaderConfig;

/**
 * Created by Taurus on 2017/5/23.
 */

public enum  FileType {

    DOC(new FileProperty(null, FileLoaderConfig.documentMIME)),
    APK(new FileProperty(FileLoaderConfig.apkExtension,null)),
    ZIP(new FileProperty(FileLoaderConfig.zipExtension,null));

    FileProperty property;

    FileType(FileProperty property){
        this.property = property;
    }

    public FileProperty getProperty() {
        return property;
    }

    public void setProperty(FileProperty property) {
        this.property = property;
    }
}


text:
NAMESPACE_BEGIN(smartqq)

class MessageCallback {
protected:
    MessageCallback() {}
public:
    virtual void onMessage(const Message& message) = 0;
    virtual void onGroupMessage(const GroupMessage& message) = 0;
    virtual void onDiscussMessage(const DiscussMessage& message) = 0;
};

NAMESPACE_END(smartqq)
#endif


text:
'use strict';
var chai = require('chai');
var expect = chai.expect;
var q = require('q');
var _ = require('underscore');
var modelMaker = require('pd-redis-base-record');
var parentize = require('../');

var announcer = require('pd-api-announcer');
var eReport = require('./report-error');
var anno = require('pd-api-test-anno')();

var Message = require('./model');
var User = modelMaker('user');
var Department = modelMaker('department');
var System = modelMaker('system');
parentize(User, Message);
parentize(Department, Message);
parentize(System, Message);
parentize(Message, Message);

describe('Multi-parent', function () {
    var toDelete = {
        user: [],
        department: [],
        message: [],
        messageMother: [],
        system: []
    };

    var MomSystem;

    before(function (done) {
        anno.init(function () {
            var momPromises = [];
            momPromises.push(
                System.create({
                    name: 'linux'
                }).then(function (sid) {
                    toDelete.system.push(sid);
                })
            );

            _.range(5).forEach(function (num) {
                [User, Department, Message].forEach(function (Model) {
                    var modelName = Model.modelName();
                    modelName = modelName === 'message' ? 'messageMother' : modelName;
                    momPromises.push(
                        Model.create({
                            name: 'Robot.' + Model.modelName() + '.' + num
                        }).then(function (momSid) {
                            toDelete[modelName].push(momSid);
                            var kidPromises = [];
                            _.range(3).forEach(function (num) {
                                kidPromises.push(
                                    Model.messageOwner(momSid).bear({
                                        content: 'I,' + Model.modelName() + ' said ' + num
                                    }).then(function (msgSid) {
                                        toDelete.message.push(msgSid);
                                    })
                                );
                            });
                            return q.allSettled(kidPromises);
                        })
                    )
                });
            });
            return q.allSettled(momPromises).then(function (results) {
                var adoptionPromises = [];
                announcer.assertFulfilledPromises(results, 'mom creations');
                MomSystem = System.messageOwner(toDelete.system[0]);
                toDelete.message.forEach(function (msgSid) {
                    adoptionPromises.push(
                        MomSystem.adopt(msgSid)
                    );
                });
                return q.allSettled(adoptionPromises);
            });
        }, done, 'Multi-parent');
    });

    it('should show correct relationship', function (done) {
        anno.tcase(function () {
            return User.messageOwner(toDelete.user[0]).findKids({
                latest: (new Date()).getTime(),
                earliest: 0,
                withCreatedAt: true
            }).then(function (kids) {
                expect(kids.length).to.equal(3);
                kids.forEach(function (kid) {
                    expect(kid.systemSid).to.equal(toDelete.system[0] + '');
                    console.log(kid);
                });
            });
        }, done, 'show relationship');
    });

    after(function (done) {
        anno.fin(function () {
            var kidPromises = [];
            toDelete.message.forEach(function (msgId) {
                kidPromises.push(
                    Message.remove(msgId, function (multis) {
                        expect(multis.length).to.equal(4);
                        return multis;
                    }).fail(function (err) {
                        eReport(err);
                    })
                );
            });
            return q.allSettled(kidPromises).then(function () {
                var momPromises = [];
                [User, Department, System, Message].forEach(function (Model) {
                    var modelName = Model.modelName();
                    modelName = modelName === 'message' ? 'messageMother' : modelName;
                    toDelete[modelName].forEach(function (sid) {
                        momPromises.push(
                            Model.remove(sid).fail(function (err) {
                                eReport(err);
                            })
                        );
                    });
                });
                return q.allSettled(momPromises).then(function () {
                    var clearPromises = [];
                    [User, Department, Message, System].forEach(function (Model) {
                        clearPromises.push(
                            Model.clearSidCounter()
                        );
                    });
                    return q.allSettled(clearPromises);
                });
            });
        }, done, 'Multi-parent');
    })
});


text:
[![Gem Version](https://fury-badge.herokuapp.com/rb/mail_form.svg)](http://badge.fury.io/rb/mail_form)
[![Code Climate](https://codeclimate.com/github/heartcombo/mail_form.svg)](https://codeclimate.com/github/heartcombo/mail_form)

### Rails 5

This gem was built on top of `ActiveModel` to showcase how you can pull in validations, naming
and `i18n` from Rails to your models without the need to implement it all by yourself.

This README refers to the **MailForm** gem to be used in Rails 5+. For instructions
on how to use MailForm in older versions of Rails, please refer to the available branches.

### Description

**MailForm** allows you to send an e-mail straight from a form. For instance,
if you want to make a contact form just the following lines are needed (including the e-mail):

```ruby
class ContactForm < MailForm::Base
  attribute :name, validate: true
  attribute :email, validate: /\A[^@\s]+@[^@\s]+\z/i
  attribute :file, attachment: true

  attribute :message
  attribute :nickname, captcha: true

  # Declare the e-mail headers. It accepts anything the mail method
  # in ActionMailer accepts.
  def headers
    {
      subject: "My Contact Form",
      to: "your.email@your.domain.com",
      from: %("#{name}" <#{email}>)
    }
  end
end
```

Then you start a console with `rails console` and type:

```ruby
>> c = ContactForm.new(name: 'José', email: 'jose@email.com', message: 'Cool!')
>> c.deliver
```

Check your inbox and the e-mail will be there, with the sent fields (assuming that
you configured your mailer delivery method properly).

### MailForm::Base

When you inherit from `MailForm::Base`, it pulls down a set of stuff from `ActiveModel`,
as `ActiveModel::Validation`, `ActiveModel::Translation` and `ActiveModel::Naming`.

This brings `I18n`, error messages, validations and attributes handling like in
`ActiveRecord` to **MailForm**, so **MailForm** can be used in your controllers and form builders without extra tweaks. This also means that instead of the following:

```ruby
attribute :email, validate: /\A[^@\s]+@[^@\s]+\z/i
```

You could actually do this:

```ruby
attribute :email
validates_format_of :email, with: /\A[^@\s]+@[^@\s]+\z/i
```

Choose the one which pleases you the most. For more information on the API, please
continue reading below.

### Playing together ORMs

**MailForm** plays nice with ORMs as well. You just need to include `MailForm::Delivery`
in your model and declare which attributes should be sent:

```ruby
class User < ActiveRecord::Base
  include MailForm::Delivery

  append :remote_ip, :user_agent, :session
  attributes :name, :email, :created_at

  def headers
    {
      to: "your.email@your.domain.com",
      subject: "User created an account"
    }
  end
end
```

The delivery will be triggered in an `after_create` hook.

## Installation

Install **MailForm** is very easy. Just edit your Gemfile adding the following:

```ruby
gem 'mail_form'
```

Then run `bundle install` to install **MailForm**.

You can run `rails generate mail_form` to view help information on how to generate
a basic form to get you started.

## API Overview

### attributes(*attributes)

Declare your form attributes. All attributes declared here will be appended
to the e-mail, except the ones :captcha is true.

Options:

* `:validate` - A hook to `validates_*_of`. When `true` is given, validates the
  presence of the attribute. When a regexp, validates format. When array,
  validates the inclusion of the attribute in the array.

  Whenever `:validate` is given, the presence is automatically checked. Give
  `allow_blank: true` to override.

  Finally, when `:validate` is a symbol, the method given as symbol will be
  called. Then you can add validations as you do in Active Record (`errors.add`).

* `:attachment` - When given, expects a file to be sent and attaches
  it to the e-mail. Don't forget to set your form to multitype.

* `:captcha` - When true, validates the attributes must be blank.
  This is a simple way to avoid spam and the input should be hidden with CSS.

Examples:

```ruby
class ContactForm < MailForm::Base
  attributes :name, validate: true
  attributes :email, validate: /\A[^@\s]+@[^@\s]+\z/i
  attributes :type, validate: ["General", "Interface bug"]
  attributes :message
  attributes :screenshot, attachment: true, validate: :interface_bug?
  attributes :nickname, captcha: true

  def interface_bug?
    if type == 'Interface bug' && screenshot.nil?
      self.errors.add(:screenshot, "can't be blank on interface bugs")
    end
  end
end

c = ContactForm.new(nickname: 'not_blank', email: 'your@email.com', name: 'José')
c.valid?   #=> true
c.spam?    #=> true  (raises an error in development, to remember you to hide it)
c.deliver  #=> false (just delivers if is not a spam and is valid, raises an error in development)

c = ContactForm.new(email: 'invalid')
c.valid?               #=> false
c.errors.inspect       #=> { name: :blank, email: :invalid }
c.errors.full_messages #=> [ "Name can't be blank", "Email is invalid" ]

c = ContactForm.new(name: 'José', email: 'your@email.com')
c.deliver
```

### append(*methods)

**MailForm** also makes easy to append request information from client to the sent
mail. You just have to do:

```ruby
class ContactForm < MailForm::Base
  append :remote_ip, :user_agent, :session
  # ...
end
```

And in your controller:

```ruby
@contact_form = ContactForm.new(params[:contact_form])
@contact_form.request = request
```

The remote ip, user agent and session will be sent in the e-mail in a
request information session. You can give to append any method that the
request object responds to.

## I18n

I18n in **MailForm** works like in ActiveRecord, so all models, attributes and messages
can be used with localized. Below is an I18n file example file:

```ruby
mail_form:
  models:
    contact_form: "Your site contact form"
  attributes:
    contact_form:
      email: "E-mail"
      telephone: "Telephone number"
      message: "Sent message"
  request:
    title: "Technical information about the user"
    remote_ip: "IP Address"
    user_agent: "Browser"
```

## Custom e-mail template

To customize the e-mail template that is used create a file called `contact.erb` in `app/views/mail_form`.
Take a look at `lib/mail_form/views/mail_form/contact.erb` in this repo to see how the default template works.

## Maintainers

* José Valim - http://github.com/josevalim
* Carlos Antonio - http://github.com/carlosantoniodasilva

## Contributors

* Andrew Timberlake - http://github.com/andrewtimberlake

## Supported Ruby / Rails versions

We intend to maintain support for all Ruby / Rails versions that haven't reached end-of-life.

For more information about specific versions please check [Ruby](https://www.ruby-lang.org/en/downloads/branches/)
and [Rails](https://guides.rubyonrails.org/maintenance_policy.html) maintenance policies, and our test matrix.

## Bugs and Feedback

If you discover any bug, please use github issues tracker.

Copyright (c) 2009-2019 Plataformatec http://plataformatec.com.br/


text:
namespace Bloggable.Data
{
    using System;
    using System.Data.Entity;

    using Bloggable.Data.Models;

    using Microsoft.AspNet.Identity.EntityFramework;

    public interface IBloggableDbContext : IDisposable
    {
        IDbSet<User> Users { get; }

        IDbSet<IdentityRole> Roles { get; }

        IDbSet<Post> Posts { get; }

        IDbSet<Page> Pages { get; }

        IDbSet<Tag> Tags { get; }

        IDbSet<Comment> Comments { get; }

        IDbSet<Rating> Ratings { get; }

        IDbSet<SearchTerm> SearchTerms { get; }

        IDbSet<Feedback> Feedback { get; }

        IDbSet<Referral> Referrals { get; }

        IDbSet<Setting> Settings { get; }

        IDbSet<AdministrationLog> AdministrationLogs { get; }

        int SaveChanges();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="close">Sulje</string>
    <string name="exit">Poistu</string>
    <string name="about">Tietoja</string>
    <string name="help">Apua</string>
    <string name="more">Lisää</string>
    <string name="search">Hae</string>
    <string name="licenses">Lisenssit</string>
    <string name="help_message">• Suodattimen käyttöönotto saattaa joissakin tapauksissa huomattavasti vähentää suorituskykyä. Ota se pois käytöstä, jos peli on liian hidas.<BR>• Kuvan välkkymisen voi korjata laittamalla päälle \"Välittömän käsittelytilan\" asetuksista.</string>
    <string name="author">Tekijä: </string>
    <string name="version">Versio: </string>
    <string name="no_data_for_display">Ei tietoja</string>
    <string name="message_delete">Haluatko todella poistaa tämän sovelluksen?</string>
    <string name="permission_request_failed">Tämä sovellus edellyttää tallennuslupaa</string>
    <string name="external_storage_not_mounted">Tämä sovellus vaatii ulkoisen tallennustilan</string>
    <string name="action_context_shortcut">Lisää pikakuvake</string>
    <string name="action_settings">Asetukset</string>
    <string name="action_context_delete">Poista</string>
    <string name="action_context_rename">Nimeä uudelleen</string>
    <string name="donate">Lahjoita</string>
    <string name="converting_wait">Muunnetaan JARia...</string>
    <string name="START_CMD">Käynnistä</string>
    <string name="CANCEL_CMD">Peruuta</string>
    <string name="CLEAR_DATA_CMD">Tyhjennä tiedot</string>
    <string name="RESET_SETTINGS_CMD">Nollaa asetukset</string>
    <string name="RESET_LAYOUT_CMD">Nollaa näppäinasettelu</string>
    <string name="PREF_SCREEN_OPTIONS">Näytön asetukset</string>
    <string name="PREF_SCALE_RATIO">Skaalaus (%)</string>
    <string name="PREF_SCALE_TO_FIT">Skaalaus sopivaksi</string>
    <string name="PREF_KEEP_ASPECT_RATIO">Pidä kuvasuhde</string>
    <string name="PREF_FILTER">Suodatin</string>
    <string name="PREF_IMMEDIATE">Välitön käsittelytila</string>
    <string name="PREF_SHOW_FPS">Näytä FPS</string>
    <string name="PREF_FONT_OPTIONS">Fonttiasetukset</string>
    <string name="PREF_WIDTH">Leveys</string>
    <string name="PREF_HEIGHT">Korkeus</string>
    <string name="PREF_FONT_SMALL">Pieni</string>
    <string name="PREF_FONT_MEDIUM">Keskikokoinen</string>
    <string name="PREF_FONT_LARGE">Suuri</string>
    <string name="PREF_FONT_SIZE_IN_SP">Arvot ovat skaalattuja pikseleitä</string>
    <string name="PREF_BACKGROUND">Tausta</string>
    <string name="PREF_VIRTUAL_KEYBOARD_OPTIONS">Virtuaalinen näppäimistö</string>
    <string name="PREF_VK_SHOW">Näytä näppäimistö</string>
    <string name="PREF_VK_FEEDBACK">Haptinen palaute</string>
    <string name="PREF_VK_BACK">Painikkeet</string>
    <string name="PREF_VK_FORE">Selitteet</string>
    <string name="PREF_VK_OUTLINE">Ääriviivat</string>
    <string name="PREF_VK_ALPHA">Sameus: </string>
    <string name="PREF_VK_HIDE_DELAY">Piilotusviive: </string>
    <string name="PREF_UNIT_MS">ms</string>
    <string name="PREF_VK_SEL_FORE">Selitteet (P)</string>
    <string name="PREF_VK_SEL_BACK">Painikkeet (P)</string>
    <string name="PREF_VK_KEY_SIZES">Näppäinkoot</string>
    <string name="PREF_VK_NAV_KEYS">Peliohjain: </string>
    <string name="PREF_VK_SOFT_KEYS">Ohjelmanäppäimet: </string>
    <string name="PREF_VK_NUM_KEYS">Numeroa: </string>
    <string name="PREF_VK_FIRE_KEY">Antaa potkut: </string>
    <string name="PREF_VK_SIZE_HINT">Sinä</string>
    <string name="SIZE_PRESETS">Esiasetukset</string>
    <string name="SWAP_SIZES">Vaihda kokoja</string>
    <string name="error">Virhe</string>
    <string name="FORCE_CLOSE_CONFIRMATION">Sovelluksen sulkeutuminen voi johtaa tietojen menetykseen tai jopa rikkoa sen kokonaan!\nJatketaanko?</string>
    <string name="CONFIRMATION_REQUIRED">Vahvistus vaaditaan</string>
    <string name="select_dialog_title">Valitse MIDlet</string>
    <string name="crash_dialog_message">Haluatko lähettää virheilmoituksen kehittäjälle?</string>
    <string name="crash_dialog_title">Havaittiin virhe</string>
    <string name="report_crash">Lähetä</string>
    <string name="layout_edit_finished">Muokkaustila päättynyt</string>
    <string name="layout_edit_finish">Lopeta muokkaustila</string>
    <string name="layout_edit_mode">Näppäinasettelun editointitila</string>
    <string name="layout_scale_mode">Näppäinasettelun koonsäätötila</string>
    <string name="layout_switch">Vaihda näppäinasettelu</string>
    <string name="hide_buttons">Piilota painikkeet</string>
    <string name="pref_enable_actionbar_title">Ota käyttöön toimintopalkki</string>
    <string name="pref_enable_actionbar_summary">Koko näytön sovelluksissa</string>
    <string name="pref_app_sort_title">Sovellusten lajittelujärjestys</string>
    <string name="pref_app_sort_name">Nimi</string>
    <string name="pref_app_sort_date">Päivämäärä</string>
</resources>


text:
export default class PublicationTocDirective {

  constructor() {
    'ngInject';

    return {
      restrict: 'E',
      replace: true,
      template: '' +
        '
' +
          '
' +
            '<be-publication-toc-section section-level="section.level" ' +
              'is-open="section.open" ' +
              'section="section" ' +
              'on-display-section-items="vm.openSectionCards(items)" ' +
              'on-display-item-id="vm.displayItemById(itemId, itemUrl)" ' +
              'show-section-header="!vm.isSingleRootSection()">' +
            '</be-publication-toc-section>' +
          '
' +
        '
',
      controller: 'BePublicationTocController',
      controllerAs: 'vm',
      scope: {
        onDisplaySectionItems: '&',
        onDisplayItemId: '&',
        closeMultipleItems: '=',
        closedItemId: '=',
        triggeredItemId: '=',
        toc: '='
      }
    };
  }
}


text:
require 'eventmachine'
require 'highline/import'
require 'logslam/client.rb'
require 'logslam/server.rb'
require 'logslam/auth.rb'
require 'logslam/tail.rb'
require 'logslam/launcher.rb'

module Logslam
  def self.run(options)
    # Self defined defaults
    options[:server_log] = "logslam.log"
    options[:pid_file] = "logslam.pid"

    if options[:configfile]
      if File.exists?(options[:configfile])
        new_opts = YAML.load_file(options[:configfile])
        options[:directory] = new_opts["directory"]
        options[:host] = new_opts["host"]
        options[:port] = new_opts["port"]
        options[:daemonize] ||= new_opts["daemonize"]
        options[:server] = true
      else
        puts "Config File #{options[:configfile]} does not exist"
        exit
      end
      Launcher.daemonize(options) if options[:daemonize]
      LogslamServer.run(options)
    elsif options[:server]
      Launcher.daemonize(options) if options[:daemonize]
      LogslamServer.run(options)
    else
      LogslamClient.run(options)
    end
  end
end


text:
/**
 * Parsing DNS Adapter.
 *
 */

#include "parser/addnsparser.h"
#include "shared/log.h"

#include <libxml/xpath.h>
#include <libxml/xmlreader.h>
#include <stdlib.h>
#include <string.h>

static const char* parser_str = "parser";

/**
 * Parse the remote servers.
 *
 */
static acl_type*
parse_addns_remote(allocator_type* allocator, const char* filename,
    tsig_type* tsig, char* expr)
{
    acl_type* acl = NULL;
    acl_type* new_acl = NULL;
    int i = 0;
    char* address = NULL;
    char* port = NULL;
    char* key = NULL;
    xmlDocPtr doc = NULL;
    xmlXPathContextPtr xpathCtx = NULL;
    xmlXPathObjectPtr xpathObj = NULL;
    xmlNode* curNode = NULL;
    xmlChar* xexpr = NULL;

    if (!allocator || !filename || !expr) {
        return NULL;
    }
    /* Load XML document */
    doc = xmlParseFile(filename);
    if (doc == NULL) {
        ods_log_error("[%s] could not parse %s: xmlParseFile() failed",
            parser_str, expr);
        return NULL;
    }
    /* Create xpath evaluation context */
    xpathCtx = xmlXPathNewContext(doc);
    if(xpathCtx == NULL) {
        xmlFreeDoc(doc);
        ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed",
            parser_str, expr);
        return NULL;
    }
    /* Evaluate xpath expression */
    xexpr = (xmlChar*) expr;
    xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx);
    if(xpathObj == NULL) {
        xmlXPathFreeContext(xpathCtx);
        xmlFreeDoc(doc);
        ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() "
            "failed", parser_str, expr);
        return NULL;
    }
    /* Parse interfaces */
    if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) {
        for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) {
            address = NULL;
            port = NULL;
            key = NULL;

            curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
            while (curNode) {
                if (xmlStrEqual(curNode->name, (const xmlChar *)"Address")) {
                    address = (char *) xmlNodeGetContent(curNode);
                } else if (xmlStrEqual(curNode->name,
                    (const xmlChar *)"Port")) {
                    port = (char *) xmlNodeGetContent(curNode);
                } else if (xmlStrEqual(curNode->name,
                    (const xmlChar *)"Key")) {
                    key = (char *) xmlNodeGetContent(curNode);
                }
                curNode = curNode->next;
            }
            if (address) {
                new_acl = acl_create(allocator, address, port, key, tsig);
                if (!new_acl) {
                   ods_log_error("[%s] unable to add server %s:%s %s to list "
                       "%s: acl_create() failed", parser_str, address,
                       port?port:"", key?key:"", (char*) expr);
                } else {
                   new_acl->next = acl;
                   acl = new_acl;
                   ods_log_debug("[%s] added server %s:%s %s to list %s",
                       parser_str, address, port?port:"", key?key:"",
                       (char*) expr);
                }
            }
            free((void*)address);
            free((void*)port);
            free((void*)key);
        }
    }
    xmlXPathFreeObject(xpathObj);
    xmlXPathFreeContext(xpathCtx);
    if (doc) {
        xmlFreeDoc(doc);
    }
    return acl;
}

/**
 * Parse the ACL interfaces.
 *
 */
static acl_type*
parse_addns_acl(allocator_type* allocator, const char* filename,
    tsig_type* tsig, char* expr)
{
    acl_type* acl = NULL;
    acl_type* new_acl = NULL;
    int i = 0;
    char* prefix = NULL;
    char* key = NULL;
    xmlDocPtr doc = NULL;
    xmlXPathContextPtr xpathCtx = NULL;
    xmlXPathObjectPtr xpathObj = NULL;
    xmlNode* curNode = NULL;
    xmlChar* xexpr = NULL;

    if (!allocator || !filename || !expr) {
        return NULL;
    }
    /* Load XML document */
    doc = xmlParseFile(filename);
    if (doc == NULL) {
        ods_log_error("[%s] could not parse %s: xmlParseFile() failed",
            parser_str, expr);
        return NULL;
    }
    /* Create xpath evaluation context */
    xpathCtx = xmlXPathNewContext(doc);
    if(xpathCtx == NULL) {
        xmlFreeDoc(doc);
        ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed",
            parser_str, expr);
        return NULL;
    }
    /* Evaluate xpath expression */
    xexpr = (xmlChar*) expr;
    xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx);
    if(xpathObj == NULL) {
        xmlXPathFreeContext(xpathCtx);
        xmlFreeDoc(doc);
        ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() "
            "failed", parser_str, expr);
        return NULL;
    }
    /* Parse interfaces */
    if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) {
        for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) {
            prefix = NULL;
            key = NULL;

            curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
            while (curNode) {
                if (xmlStrEqual(curNode->name, (const xmlChar *)"Prefix")) {
                    prefix = (char *) xmlNodeGetContent(curNode);
                } else if (xmlStrEqual(curNode->name,
                    (const xmlChar *)"Key")) {
                    key = (char *) xmlNodeGetContent(curNode);
                }
                curNode = curNode->next;
            }
            if (prefix || key) {
                new_acl = acl_create(allocator, prefix, NULL, key, tsig);
                if (!new_acl) {
                   ods_log_error("[%s] unable to add acl for %s %s to list "
                       "%s: acl_create() failed", parser_str, prefix?prefix:"",
                       key?key:"", (char*) expr);
                } else {
                   new_acl->next = acl;
                   acl = new_acl;
                   ods_log_debug("[%s] added %s %s interface to list %s",
                       parser_str, prefix?prefix:"", key?key:"", (char*) expr);
                }
            }
            free((void*)prefix);
            free((void*)key);
        }
    }
    xmlXPathFreeObject(xpathObj);
    xmlXPathFreeContext(xpathCtx);
    if (doc) {
        xmlFreeDoc(doc);
    }
    return acl;
}

/**
 * Parse the TSIG credentials.
 *
 */
static tsig_type*
parse_addns_tsig_static(allocator_type* allocator, const char* filename,
    char* expr)
{
    tsig_type* tsig = NULL;
    tsig_type* new_tsig = NULL;
    int i = 0;
    char* name = NULL;
    char* algo = NULL;
    char* secret = NULL;
    xmlDocPtr doc = NULL;
    xmlXPathContextPtr xpathCtx = NULL;
    xmlXPathObjectPtr xpathObj = NULL;
    xmlNode* curNode = NULL;
    xmlChar* xexpr = NULL;

    if (!allocator || !filename || !expr) {
        return NULL;
    }
    /* Load XML document */
    doc = xmlParseFile(filename);
    if (doc == NULL) {
        ods_log_error("[%s] could not parse %s: xmlParseFile() failed",
            parser_str, expr);
        return NULL;
    }
    /* Create xpath evaluation context */
    xpathCtx = xmlXPathNewContext(doc);
    if(xpathCtx == NULL) {
        xmlFreeDoc(doc);
        ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed",
            parser_str, expr);
        return NULL;
    }
    /* Evaluate xpath expression */
    xexpr = (xmlChar*) expr;
    xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx);
    if(xpathObj == NULL) {
        xmlXPathFreeContext(xpathCtx);
        xmlFreeDoc(doc);
        ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() "
            "failed", parser_str, expr);
        return NULL;
    }
    /* Parse interfaces */
    if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) {
        for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) {
            name = NULL;
            algo = NULL;
            secret = NULL;

            curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
            while (curNode) {
                if (xmlStrEqual(curNode->name, (const xmlChar *)"Name")) {
                    name = (char *) xmlNodeGetContent(curNode);
                } else if (xmlStrEqual(curNode->name,
                    (const xmlChar *)"Algorithm")) {
                    algo = (char *) xmlNodeGetContent(curNode);
                } else if (xmlStrEqual(curNode->name,
                    (const xmlChar *)"Secret")) {
                    secret = (char *) xmlNodeGetContent(curNode);
                }
                curNode = curNode->next;
            }
            if (name && algo && secret) {
                new_tsig = tsig_create(allocator, name, algo, secret);
                if (!new_tsig) {
                   ods_log_error("[%s] unable to add tsig %s: "
                       "tsig_create() failed", parser_str, name);
                } else {
                   new_tsig->next = tsig;
                   tsig = new_tsig;
                   ods_log_debug("[%s] added %s tsig to list %s",
                       parser_str, name, (char*) expr);
                }
            }
            free((void*)name);
            free((void*)algo);
            free((void*)secret);
        }
    }
    xmlXPathFreeObject(xpathObj);
    xmlXPathFreeContext(xpathCtx);
    if (doc) {
        xmlFreeDoc(doc);
    }
    return tsig;
}

/**
 * Parse <RequestTransfer/>.
 *
 */
acl_type*
parse_addns_request_xfr(allocator_type* allocator, const char* filename,
    tsig_type* tsig)
{
    return parse_addns_remote(allocator, filename, tsig,
        "//Adapter/DNS/Inbound/RequestTransfer/Remote"
        );
}

/**
 * Parse <AllowNotify/>.
 *
 */
acl_type*
parse_addns_allow_notify(allocator_type* allocator, const char* filename,
    tsig_type* tsig)
{
    return parse_addns_acl(allocator, filename, tsig,
        "//Adapter/DNS/Inbound/AllowNotify/Peer"
        );
}

/**
 * Parse <ProvideTransfer/>.
 *
 */
acl_type*
parse_addns_provide_xfr(allocator_type* allocator, const char* filename,
    tsig_type* tsig)
{
    return parse_addns_acl(allocator, filename, tsig,
        "//Adapter/DNS/Outbound/ProvideTransfer/Peer"
        );
}

/**
 * Parse <Notify/>.
 *
 */
acl_type*
parse_addns_do_notify(allocator_type* allocator, const char* filename,
    tsig_type* tsig)
{
    return parse_addns_remote(allocator, filename, tsig,
        "//Adapter/DNS/Outbound/Notify/Remote"
        );
}

/**
 * Parse <TSIG/>.
 *
 */
tsig_type*
parse_addns_tsig(allocator_type* allocator, const char* filename)
{
    return parse_addns_tsig_static(allocator, filename,
        "//Adapter/DNS/TSIG"
        );
}


text:
package org.apache.nifi.web.api;

import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import com.wordnik.swagger.annotations.ApiResponse;
import com.wordnik.swagger.annotations.ApiResponses;
import com.wordnik.swagger.annotations.Authorization;
import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.authorization.AccessDeniedException;
import org.apache.nifi.authorization.AuthorizationRequest;
import org.apache.nifi.authorization.AuthorizationResult;
import org.apache.nifi.authorization.AuthorizationResult.Result;
import org.apache.nifi.authorization.Authorizer;
import org.apache.nifi.authorization.RequestAction;
import org.apache.nifi.authorization.UserContextKeys;
import org.apache.nifi.authorization.resource.ResourceFactory;
import org.apache.nifi.authorization.user.NiFiUser;
import org.apache.nifi.authorization.user.NiFiUserUtils;
import org.apache.nifi.cluster.manager.NodeResponse;
import org.apache.nifi.web.NiFiServiceFacade;
import org.apache.nifi.web.api.dto.SystemDiagnosticsDTO;
import org.apache.nifi.web.api.entity.SystemDiagnosticsEntity;

import javax.ws.rs.Consumes;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.HashMap;
import java.util.Map;

/**
 * RESTful endpoint for retrieving system diagnostics.
 */
@Path("/system-diagnostics")
@Api(
        value = "/system-diagnostics",
        description = "Endpoint for accessing system diagnostics."
)
public class SystemDiagnosticsResource extends ApplicationResource {

    private NiFiServiceFacade serviceFacade;
    private Authorizer authorizer;

    private void authorizeSystem() {
        final NiFiUser user = NiFiUserUtils.getNiFiUser();

        final Map<String, String> userContext;
        if (!StringUtils.isBlank(user.getClientAddress())) {
            userContext = new HashMap<>();
            userContext.put(UserContextKeys.CLIENT_ADDRESS.name(), user.getClientAddress());
        } else {
            userContext = null;
        }

        final AuthorizationRequest request = new AuthorizationRequest.Builder()
                .resource(ResourceFactory.getSystemResource())
                .identity(user.getIdentity())
                .groups(user.getGroups())
                .anonymous(user.isAnonymous())
                .accessAttempt(true)
                .action(RequestAction.READ)
                .userContext(userContext)
                .explanationSupplier(() -> "Unable to view system diagnostics.")
                .build();

        final AuthorizationResult result = authorizer.authorize(request);
        if (!Result.Approved.equals(result.getResult())) {
            throw new AccessDeniedException(result.getExplanation());
        }
    }

    /**
     * Gets the system diagnostics for this NiFi instance.
     *
     * @return A systemDiagnosticsEntity.
     * @throws InterruptedException if interrupted
     */
    @GET
    @Consumes(MediaType.WILDCARD)
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Gets the diagnostics for the system NiFi is running on",
            response = SystemDiagnosticsEntity.class,
            authorizations = {
                    @Authorization(value = "Read - /system", type = "")
            }
    )
    @ApiResponses(
            value = {
                    @ApiResponse(code = 401, message = "Client could not be authenticated."),
                    @ApiResponse(code = 403, message = "Client is not authorized to make this request."),}
    )
    public Response getSystemDiagnostics(
            @ApiParam(
                    value = "Whether or not to include the breakdown per node. Optional, defaults to false",
                    required = false
            )
            @QueryParam("nodewise") @DefaultValue(NODEWISE) final Boolean nodewise,
            @ApiParam(
                    value = "The id of the node where to get the status.",
                    required = false
            )
            @QueryParam("clusterNodeId") final String clusterNodeId) throws InterruptedException {

        authorizeSystem();

        // ensure a valid request
        if (Boolean.TRUE.equals(nodewise) && clusterNodeId != null) {
            throw new IllegalArgumentException("Nodewise requests cannot be directed at a specific node.");
        }

        if (isReplicateRequest()) {
            // determine where this request should be sent
            if (clusterNodeId == null) {
                final NodeResponse nodeResponse;

                // Determine whether we should replicate only to the cluster coordinator, or if we should replicate directly
                // to the cluster nodes themselves.
                if (getReplicationTarget() == ReplicationTarget.CLUSTER_NODES) {
                    nodeResponse = getRequestReplicator().replicate(HttpMethod.GET, getAbsolutePath(), getRequestParameters(), getHeaders()).awaitMergedResponse();
                } else {
                    nodeResponse = getRequestReplicator().forwardToCoordinator(
                            getClusterCoordinatorNode(), HttpMethod.GET, getAbsolutePath(), getRequestParameters(), getHeaders()).awaitMergedResponse();
                }

                final SystemDiagnosticsEntity entity = (SystemDiagnosticsEntity) nodeResponse.getUpdatedEntity();

                // ensure there is an updated entity (result of merging) and prune the response as necessary
                if (entity != null && !nodewise) {
                    entity.getSystemDiagnostics().setNodeSnapshots(null);
                }

                return nodeResponse.getResponse();
            } else {
                return replicate(HttpMethod.GET);
            }
        }

        final SystemDiagnosticsDTO systemDiagnosticsDto = serviceFacade.getSystemDiagnostics();

        // create the response
        final SystemDiagnosticsEntity entity = new SystemDiagnosticsEntity();
        entity.setSystemDiagnostics(systemDiagnosticsDto);

        // generate the response
        return generateOkResponse(entity).build();
    }

    // setters

    public void setServiceFacade(NiFiServiceFacade serviceFacade) {
        this.serviceFacade = serviceFacade;
    }

    public void setAuthorizer(Authorizer authorizer) {
        this.authorizer = authorizer;
    }
}


text:
package com.intellij.tasks.integration;

import com.intellij.tasks.Task;
import com.intellij.tasks.generic.GenericRepository;
import com.intellij.tasks.generic.GenericRepositoryType;
import org.jetbrains.annotations.NotNull;

import static com.intellij.tasks.TaskTestUtil.TaskBuilder;
import static com.intellij.tasks.TaskTestUtil.assertTasksEqual;

/**
 * @author Dmitry Avdeev
 */
public class AssemblaIntegrationTest extends GenericSubtypeTestCase {

  public static final String TASK_LIST_RESPONSE =
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
    "<tickets type=\"array\">\n" +
    "<ticket>\n" +
    "  <assigned-to-id>dsNkyYr0Gr4iEBeJe5cbCb</assigned-to-id>\n" +
    "  <completed-date type=\"datetime\"></completed-date>\n" +
    "  <component-id type=\"integer\"></component-id>\n" +
    "  <created-on type=\"datetime\">2013-04-01T10:45:06+03:00</created-on>\n" +
    "  <description></description>\n" +
    "  <from-support type=\"integer\">0</from-support>\n" +
    "  <id type=\"integer\">50351983</id>\n" +
    "  <importance type=\"integer\">-1</importance>\n" +
    "  <importance-float type=\"float\">-1.0</importance-float>\n" +
    "  <is-story type=\"boolean\">false</is-story>\n" +
    "  <milestone-id type=\"integer\"></milestone-id>\n" +
    "  <notification-list>dsNkyYr0Gr4iEBeJe5cbCb</notification-list>\n" +
    "  <number type=\"integer\">1</number>\n" +
    "  <priority type=\"integer\">3</priority>\n" +
    "  <reporter-id>dsNkyYr0Gr4iEBeJe5cbCb</reporter-id>\n" +
    "  <space-id>ab1WOCMQar4QGgacwqjQWU</space-id>\n" +
    "  <status type='integer'>0</status>\n" +
    "  <status-name>New</status-name>\n" +
    "  <story-importance type=\"integer\">0</story-importance>\n" +
    "  <summary>Привет</summary>\n" +
    "  <updated-at type=\"datetime\">2013-04-01T10:48:19+03:00</updated-at>\n" +
    "  <working-hours type=\"float\">0.0</working-hours>\n" +
    "  <working-hour type=\"float\" warning=\"deprecated\">0.0</working-hour>\n" +
    "  <estimate type=\"string\">Small</estimate>\n" +
    "  <total-estimate type=\"float\">1.0</total-estimate>\n" +
    "  <invested-hours type=\"float\">0.0</invested-hours>\n" +
    "  <assigned-to><id>dsNkyYr0Gr4iEBeJe5cbCb</id><login>avdeev.dmitry</login><login_name warning=\"deprecated\">avdeev.dmitry</login_name><name>avdeev.dmitry</name></assigned-to>\n" +
    "  <reporter><id>dsNkyYr0Gr4iEBeJe5cbCb</id><login>avdeev.dmitry</login><login_name warning=\"deprecated\">avdeev.dmitry</login_name><name>avdeev.dmitry</name></reporter>\n" +
    "</ticket>\n" +
    "</tickets>";

  @NotNull
  @Override
  protected GenericRepository createRepository(GenericRepositoryType genericType) {
    return (GenericRepository)genericType.new AssemblaRepository().createRepository();
  }

  public void testParsingTaskList() throws Exception {
    Task[] tasks = myRepository.getActiveResponseHandler().parseIssues(TASK_LIST_RESPONSE, 50);
    assertTasksEqual(
      new Task[]{
        new TaskBuilder("1", "\u041F\u0440\u0438\u0432\u0435\u0442", myRepository)
          .withDescription("")
          .withUpdated("2013-04-01T10:48:19+03:00")
          .withCreated("2013-04-01T10:45:06+03:00")
      },
      tasks);
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

<ScrollView
    android:id="@+id/scroll"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginBottom="200dip"
    android:scrollbars="vertical" >

<TextView
    android:id="@+id/text"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello" />
</ScrollView>
<RelativeLayout
    android:layout_marginTop="-200dip"
    android:gravity="bottom"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent">
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
<Button
	android:id="@+id/btnService"
	android:text="Service"
	android:textStyle="bold"
	android:layout_width="fill_parent"
	android:layout_height="50dip"
	android:onClick="onClick"
	/>
<Button
	android:id="@+id/btnMinimize"
	android:text="Minimize"
	android:textStyle="bold"
	android:layout_width="fill_parent"
	android:layout_height="50dip"
	android:onClick="onMinimize"
	/>
<Button
	android:id="@+id/btnDisplay"
	android:text="Show display"
	android:textStyle="bold"
	android:layout_width="fill_parent"
	android:layout_height="50dip"
	android:onClick="onDisplay"
	/>
<Button
	android:id="@+id/btnSettings"
	android:text="Settings"
	android:textStyle="bold"
	android:layout_width="fill_parent"
	android:layout_height="50dip"
	android:onClick="onSettings"
	/></LinearLayout>

</RelativeLayout>
</LinearLayout>


text:
namespace boost { namespace simd { namespace ext
{
  BOOST_SIMD_FUNCTOR_IMPLEMENTATION( boost::simd::tag::terminal_, tag::cpu_
                                   , (Expr)(X)
                                   , ((expr_< target_< simd_< unspecified_<Expr>, X> >, boost::simd::tag::terminal_, mpl::long_<0> >))
                                   )
  {
    typedef typename boost::dispatch::meta::
            semantic_of<typename Expr::proto_child0>::type result_type;

    BOOST_FORCEINLINE result_type
    operator()( Expr& ) const
    {
      return result_type();
    }
  };
} } }

namespace boost { namespace dispatch { namespace meta
{
  template<class T, std::size_t N>
  struct semantic_of< as_< boost::simd::pack<T, N> > >
  {
    typedef as_< typename boost::simd::pack<T, N>::data_type > type;
  };
} } }

#endif


text:
#ifndef LOG_H
#define LOG_H

void start_log(VMCWSTR filename);
void stop_log();
void write_log(char* message);
#endif /* LOG_H */


text:
class AM : public Instrument {
	int inchan, skip, branch;
	float *in, amp, modfreq, spread;
	float amptabs[2], freqtabs[2];
	double *wavetable, *amptable, *freqtable, *amtable;
	Ooscili *modosc;
	bool ownWavetable;

public:
	AM();
	virtual ~AM();
	virtual int init(double *, int);
	virtual int configure();
	virtual int run();
};

// update flags (shift amount is pfield number)
enum {
	kAmp = 1 << 3,
	kFreq = 1 << 4,
	kPan = 1 << 6
};


text:
using System;
using OpenMetaverse;

namespace OpenSim.Framework
{
    /// <summary>
    /// Client provided parameters for avatar movement
    /// </summary>
    public class AgentUpdateArgs : EventArgs
    {
        /// <summary>
        /// Agent's unique ID
        /// </summary>
        public UUID AgentID;

        /// <summary>
        /// Rotation of the avatar's body
        /// </summary>
        public Quaternion BodyRotation;

        /// <summary>
        /// AT portion of the camera matrix
        /// </summary>
        public Vector3 CameraAtAxis;

        /// <summary>
        /// Position of the camera in the Scene
        /// </summary>
        public Vector3 CameraCenter;
        public Vector3 CameraLeftAxis;
        public Vector3 CameraUpAxis;

        /// <summary>
        /// Bitflag field for agent movement.  Fly, forward, backward, turn left, turn right, go up, go down, Straffe, etc.
        /// </summary>
        public uint ControlFlags;

        /// <summary>
        /// Agent's client Draw distance setting
        /// </summary>
        public float Far;
        public byte Flags;

        /// <summary>
        /// Rotation of the avatar's head
        /// </summary>
        public Quaternion HeadRotation;

        /// <summary>
        /// Session Id
        /// </summary>
        public UUID SessionID;
        public byte State;

        public Vector3 ClientAgentPosition;
        public bool UseClientAgentPosition;
        public bool NeedsCameraCollision;
        public uint lastpacketSequence;

        public AgentUpdateArgs()
        {
            UseClientAgentPosition = false;
        }
    }
}


text:
/* $Id: quickform-repeat.js 326347 2012-06-26 14:12:11Z avb $ */

/**
 * Sets repeat properties and attaches handlers for adding and removing items
 *
 * @param {HTMLElement} container
 * @param {String} itemId
 * @param {String[]} triggers
 * @param {String} rulesTpl
 * @param {String} scriptsTpl
 * @constructor
 */
qf.elements.Repeat = function(container, itemId, triggers, rulesTpl, scriptsTpl)
{
    container.repeat = this;

    /**
     * Form containing the repeat element
     * @type {HTMLFormElement}
     */
    this.form            = null;

    /**
     * Prototype item which will be cloned in add()
     * @type {HTMLElement}
     */
    this.repeatPrototype = null;

    /**
     * HTML element containing all repeated items
     * @type {HTMLElement}
     */
    this.container       = container;

    /**
     * Id of repeated items, used to deduce index
     * @type {String}
     */
    this.itemId          = itemId;

    /**
     * String containing validation code template, will be eval()'d
     * @type {String}
     */
    this.rulesTpl        = rulesTpl;

    /**
     * String containing elements setup code template, will be eval()'d
     * @type {String}
     */
    this.scriptsTpl      = scriptsTpl;

    /**
     * Templates for element's id attributes, used to remove rules on removing repeated item
     * @type {String[]}
     */
    this.triggers        = triggers;

    // find all elements with class repeatAdd inside container...
    var adders = this.getElementsByClass('repeatAdd', container);
    for (var i = 0, element; element = adders[i]; i++) {
        qf.events.addListener(element, 'click', qf.elements.Repeat.addHandler);
    }
    // find all elements with class repeatRemove inside container...
    var removers = this.getElementsByClass('repeatRemove', container);
    for (i = 0; element = removers[i]; i++) {
        qf.events.addListener(element, 'click', qf.elements.Repeat.removeHandler);
    }
};

/**
 * Event handler for "add item" onclick events, added automatically on elements with class 'repeatAdd'
 *
 * @param {Event} event
 */
qf.elements.Repeat.addHandler = function(event)
{
    event = qf.events.fixEvent(event);

    var parent = event.target;
    while (parent && !qf.classes.has(parent, 'repeat')) {
        parent = parent.parentNode;
    }
    if (parent && parent.repeat && parent.repeat.onBeforeAdd()) {
        parent.repeat.add();
    }
    event.preventDefault();
};

/**
 * Event handler for "remove item" onclick events, added automatically on elements with class 'repeatRemove'
 *
 * @param {Event} event
 */
qf.elements.Repeat.removeHandler = function(event)
{
    event = qf.events.fixEvent(event);

    var parent = event.target,
        item;
    while (parent && !qf.classes.has(parent, 'repeat')) {
        if (qf.classes.has(parent, 'repeatItem')) {
            item = parent;
        }
        parent = parent.parentNode;
    }
    if (parent && item && parent.repeat && parent.repeat.onBeforeRemove(item)) {
        parent.repeat.remove(item);
    }
    event.preventDefault();
};

qf.elements.Repeat.prototype = {
    /**
     * Finds elements by CSS class name
     *
     * Wraps around native getElementsByClassName() if available, uses a custom
     * implementation if not.
     *
     * @function
     * @param {String} className
     * @param {Node} node
     * @returns {Node[]}
     */
    getElementsByClass: (function() {
        if (document.getElementsByClassName) {
            return function(className, node) {
                return node.getElementsByClassName(className);
            };
        } else {
            return function(className, node) {
                var list   = node.getElementsByTagName('*'),
                    result = [];

                for (var i = 0, child; child = list[i]; i++) {
                    if (qf.classes.has(child, className)) {
                        result.push(child);
                    }
                }
                return result;
            };
        }
    })(),
    /**
     * Finds an index for a given repeat item
     *
     * @param {Node} item
     * @returns {String}
     */
    findIndexByItem: function(item)
    {
        var itemRegexp = new RegExp('^' + this.itemId.replace(':idx:', '([a-zA-Z0-9_]+?)') + '$'),
            m;

        if (item.id && (m = itemRegexp.exec(item.id))) {
            // item has the needed id itself (fieldset case)
            return m[1];
        } else {
            // search for item with a needed id (group case)
            var elements = item.getElementsByTagName('*');
            for (var i = 0, element; element = elements[i]; i++) {
                if (element.id && (m = itemRegexp.exec(element.id))) {
                    return m[1];
                }
            }
        }
        return null;
    },
    /**
     * Finds a repeat item for a given index
     *
     * @param {String} index
     * @returns {Node}
     */
    findItemByIndex: function(index)
    {
        var id = this.itemId.replace(':idx:', index),
            el = document.getElementById(id);
        if (el && !qf.classes.has(el, 'repeatItem')) {
            do {
                el = el.parentNode;
            } while (el && !qf.classes.has(el, 'repeatItem'));
        }
        return el;
    },
    /**
     * Finds a form containing repeat element
     *
     * @returns {HTMLFormElement}
     */
    findForm: function()
    {
        var parent = this.container;
        while (parent && 'form' !== parent.nodeName.toLowerCase()) {
            parent = parent.parentNode;
        }
        return parent;
    },
    /**
     * Generates a new index for item being added to the repeat
     *
     * @returns {String}
     */
    generateIndex: function()
    {
        var index;

        do {
            // 10000 will be enough for everybody!
            index = 'add' + Math.round(Math.random() * 10000);
        } while (document.getElementById(this.itemId.replace(':idx:', index)));
        return index;
    },
    /**
     * Adds a new repeated item to the repeat element
     *
     * @param {String} [index] Explicit index to use, will be generated if not given
     * @return {String} Added element's index
     */
    add: function(index)
    {
        if (!this.repeatPrototype) {
            this.repeatPrototype = this.getElementsByClass('repeatPrototype', this.container)[0];
        }
        if (0 == arguments.length || !/^[a-zA-Z0-9_]+$/.test(index)) {
            index = this.generateIndex();
        }

        var items    = this.getElementsByClass('repeatItem', this.container),
            lastItem = items[items.length - 1],
            clone    = this.repeatPrototype.cloneNode(true);

        qf.classes.remove(clone, 'repeatPrototype');
        if (clone.id) {
            clone.id = clone.id.replace(':idx:', index);
        }
        // maybe get rid of this and mangle innerHTML instead?
        var elements = clone.getElementsByTagName('*');
        for (var i = 0, element; element = elements[i]; i++) {
            if (element.id) {
                element.id = element.id.replace(':idx:', index);
            }
            if (element.name) {
                element.name = element.name.replace(':idx:', index);
            }
            if (element.type && ('checkbox' == element.type || 'radio' == element.type)) {
                element.value = element.value.replace(':idx:', index);
            }
            if (element.htmlFor) {
                element.htmlFor = element.htmlFor.replace(':idx:', index);
            }
            // inline script found, eval() 'em
            if ('script' == element.nodeName.toLowerCase()) {
                eval(element.innerHTML.replace(/:idx:/g, index));
            }
            if (qf.classes.has(element, 'repeatAdd')) {
                qf.events.addListener(element, 'click', qf.elements.Repeat.addHandler);
            }
            if (qf.classes.has(element, 'repeatRemove')) {
                qf.events.addListener(element, 'click', qf.elements.Repeat.removeHandler);
            }
        }

        lastItem.parentNode.insertBefore(clone, lastItem.nextSibling);

        if (this.scriptsTpl) {
            eval(this.scriptsTpl.replace(/:idx:/g, index));
        }
        if (this.rulesTpl) {
            if (!this.form) {
                this.form = this.findForm();
            }
            if (this.form.validator) {
                var rules = eval(this.rulesTpl.replace(/:idx:/g, index)),
                    rule;
                for (i = 0; rule = rules[i]; i++) {
                    this.form.validator.rules.push(rule);
                }
            }
        }
        this.onChange();

        return index;
    },
    /**
     * Removes an item from repeat element
     *
     * @param {Node|String} item
     */
    remove: function(item)
    {
        var index;
        if (typeof item == 'string') {
            index = item;
            if (!(item = this.findItemByIndex(index))) {
                return;
            }
        }
        if (this.rulesTpl) {
            if (!this.form) {
                this.form = this.findForm();
            }
            if (this.form.validator) {
                var check = new qf.Map(),
                    rules = this.form.validator.rules,
                    trigger, rule, i;
                if (!index) {
                    index = this.findIndexByItem(item);
                }
                for (i = 0; trigger = this.triggers[i]; i++) {
                    check.set(trigger.replace(':idx:', index), true);
                }
                for (i = rules.length - 1; rule = rules[i]; i--) {
                    // repeated IDs are unlikely to appear in rule.triggers
                    // without appearing in rule.owner, so we check only owner
                    if (check.hasKey(rule.owner)) {
                        rules.splice(i, 1);
                    }
                }
            }
        }
        item.parentNode.removeChild(item);
        this.onChange();
    },
    /**
     * Called before adding a repeated item.
     *
     * If this method returns false, no item will be added
     *
     * @returns {Boolean}
     */
    onBeforeAdd: function()
    {
        return true;
    },
    /**
     * Called before removing a repeated item.
     *
     * If this method returns false, the item will not be removed
     *
     * @param {Node} item
     * @returns {Boolean}
     */
    onBeforeRemove: function(item)
    {
        return true;
    },
    /**
     * Called after adding or deleting the item
     */
    onChange: function()
    {
    }
};


text:
require 'rails_helper'
require 'support/dns_mock'

describe Trackback, 'With the various trackback filters loaded and DNS mocked out appropriately', type: :model do
  let(:article) { create(:article) }

  before(:each) do
    @blog = FactoryGirl.create(:blog)
    @blog.sp_global = true
    @blog.default_moderate_comments = false
    @blog.save!
  end

  it 'Incomplete trackbacks should not be accepted' do
    tb = Trackback.new(blog_name: 'Blog name',
                       title: 'Title',
                       excerpt: 'Excerpt',
                       article_id: FactoryGirl.create(:article).id)
    expect(tb).not_to be_valid
    expect(tb.errors['url']).to be_any
  end

  it 'A valid trackback should be accepted' do
    tb = Trackback.new(blog_name: 'Blog name',
                       title: 'Title',
                       url: 'http://foo.com',
                       excerpt: 'Excerpt',
                       article_id: FactoryGirl.create(:article).id)
    expect(tb).to be_valid
    tb.save
    expect(tb.guid.size).to be > 15
    expect(tb).not_to be_spam
  end

  it 'Trackbacks with a spammy link in the excerpt should be rejected' do
    tb = article.trackbacks.build(ham_params.merge(excerpt: 'spam'))
    expect(tb).to be_spam
  end

  it 'Trackbacks with a spammy source url should be rejected' do
    tb = article.trackbacks.build(ham_params.merge(url: 'http://www.chinaircatering.com'))
    expect(tb).to be_spam
  end

  it 'Trackbacks from a spammy ip address should be rejected' do
    tb = article.trackbacks.build(ham_params.merge(ip: '212.42.230.207'))
    expect(tb).to be_spam
  end

  def ham_params
    { blog_name: 'Blog', title: 'trackback', excerpt: 'bland',
      url: 'http://notaspammer.com', ip: '212.42.230.206' }
  end
end


text:
import {stripIndents} from 'common-tags';
import {ng} from '../../utils/process';
import { writeMultipleFiles, expectFileToMatch, expectFileMatchToExist } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';

function verifyMedia(css: RegExp, content: RegExp) {
  return expectFileMatchToExist('./dist', css)
    .then(fileName => expectFileToMatch(`dist/${fileName}`, content));
}

export default function() {
  // Skip this in Appveyor tests.
  if (getGlobalVariable('argv').appveyor) {
    return Promise.resolve();
  }

  return Promise.resolve()
    .then(() => writeMultipleFiles({
    'src/styles.css': stripIndents`
      body { background-image: url("image.svg"); }
    `,
    'src/image.svg': 'I would like to be an image someday.'
    }))
    .then(() => ng('build', '--dev', '--output-hashing=all'))
    .then(() => expectFileToMatch('dist/index.html', /inline\.[0-9a-f]{20}\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /main\.[0-9a-f]{20}\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /styles\.[0-9a-f]{20}\.bundle\.(css|js)/))
    .then(() => verifyMedia(/styles\.[0-9a-f]{20}\.bundle\.(css|js)/, /image\.[0-9a-f]{20}\.svg/))

    .then(() => ng('build', '--prod', '--output-hashing=none'))
    .then(() => expectFileToMatch('dist/index.html', /inline\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /main\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /styles\.bundle\.(css|js)/))
    .then(() => verifyMedia(/styles\.bundle\.(css|js)/, /image\.svg/))

    .then(() => ng('build', '--dev', '--output-hashing=media'))
    .then(() => expectFileToMatch('dist/index.html', /inline\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /main\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /styles\.bundle\.(css|js)/))
    .then(() => verifyMedia(/styles\.bundle\.(css|js)/, /image\.[0-9a-f]{20}\.svg/))

    .then(() => ng('build', '--dev', '--output-hashing=bundles'))
    .then(() => expectFileToMatch('dist/index.html', /inline\.[0-9a-f]{20}\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /main\.[0-9a-f]{20}\.bundle\.js/))
    .then(() => expectFileToMatch('dist/index.html', /styles\.[0-9a-f]{20}\.bundle\.(css|js)/))
    .then(() => verifyMedia(/styles\.[0-9a-f]{20}\.bundle\.(css|js)/, /image\.svg/));
}


text:
from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class Ui_laser_main(object):
    def setupUi(self, laser_main):
        laser_main.setObjectName(_fromUtf8("laser_main"))
        laser_main.resize(800, 600)
        self.centralwidget = QtGui.QWidget(laser_main)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.button_send = QtGui.QPushButton(self.centralwidget)
        self.button_send.setGeometry(QtCore.QRect(310, 420, 115, 31))
        self.button_send.setObjectName(_fromUtf8("button_send"))
        self.tl_x = QtGui.QDoubleSpinBox(self.centralwidget)
        self.tl_x.setGeometry(QtCore.QRect(120, 160, 77, 31))
        self.tl_x.setDecimals(3)
        self.tl_x.setMinimum(-1.0)
        self.tl_x.setMaximum(1.0)
        self.tl_x.setSingleStep(0.001)
        self.tl_x.setProperty("value", -1.0)
        self.tl_x.setObjectName(_fromUtf8("tl_x"))
        self.tl_y = QtGui.QDoubleSpinBox(self.centralwidget)
        self.tl_y.setGeometry(QtCore.QRect(240, 160, 77, 31))
        self.tl_y.setDecimals(3)
        self.tl_y.setMinimum(-1.0)
        self.tl_y.setMaximum(1.0)
        self.tl_y.setSingleStep(0.001)
        self.tl_y.setProperty("value", 1.0)
        self.tl_y.setObjectName(_fromUtf8("tl_y"))
        self.bl_x = QtGui.QDoubleSpinBox(self.centralwidget)
        self.bl_x.setGeometry(QtCore.QRect(120, 270, 77, 31))
        self.bl_x.setDecimals(3)
        self.bl_x.setMinimum(-1.0)
        self.bl_x.setMaximum(1.0)
        self.bl_x.setSingleStep(0.001)
        self.bl_x.setProperty("value", -1.0)
        self.bl_x.setObjectName(_fromUtf8("bl_x"))
        self.bl_y = QtGui.QDoubleSpinBox(self.centralwidget)
        self.bl_y.setGeometry(QtCore.QRect(240, 270, 77, 31))
        self.bl_y.setDecimals(3)
        self.bl_y.setMinimum(-1.0)
        self.bl_y.setMaximum(1.0)
        self.bl_y.setSingleStep(0.001)
        self.bl_y.setProperty("value", -1.0)
        self.bl_y.setObjectName(_fromUtf8("bl_y"))
        self.tr_x = QtGui.QDoubleSpinBox(self.centralwidget)
        self.tr_x.setGeometry(QtCore.QRect(430, 160, 77, 31))
        self.tr_x.setDecimals(3)
        self.tr_x.setMinimum(-1.0)
        self.tr_x.setMaximum(1.0)
        self.tr_x.setSingleStep(0.001)
        self.tr_x.setProperty("value", 1.0)
        self.tr_x.setObjectName(_fromUtf8("tr_x"))
        self.tr_y = QtGui.QDoubleSpinBox(self.centralwidget)
        self.tr_y.setGeometry(QtCore.QRect(560, 160, 77, 31))
        self.tr_y.setDecimals(3)
        self.tr_y.setMinimum(-1.0)
        self.tr_y.setMaximum(1.0)
        self.tr_y.setSingleStep(0.001)
        self.tr_y.setProperty("value", 1.0)
        self.tr_y.setObjectName(_fromUtf8("tr_y"))
        self.br_x = QtGui.QDoubleSpinBox(self.centralwidget)
        self.br_x.setGeometry(QtCore.QRect(430, 270, 77, 31))
        self.br_x.setDecimals(3)
        self.br_x.setMinimum(-1.0)
        self.br_x.setMaximum(1.0)
        self.br_x.setSingleStep(0.001)
        self.br_x.setProperty("value", 1.0)
        self.br_x.setObjectName(_fromUtf8("br_x"))
        self.br_y = QtGui.QDoubleSpinBox(self.centralwidget)
        self.br_y.setGeometry(QtCore.QRect(560, 270, 77, 31))
        self.br_y.setDecimals(3)
        self.br_y.setMinimum(-1.0)
        self.br_y.setMaximum(1.0)
        self.br_y.setSingleStep(0.001)
        self.br_y.setProperty("value", -1.0)
        self.br_y.setObjectName(_fromUtf8("br_y"))
        self.text_tl = QtGui.QLabel(self.centralwidget)
        self.text_tl.setGeometry(QtCore.QRect(180, 90, 80, 21))
        self.text_tl.setObjectName(_fromUtf8("text_tl"))
        self.text_tr = QtGui.QLabel(self.centralwidget)
        self.text_tr.setGeometry(QtCore.QRect(500, 90, 80, 21))
        self.text_tr.setObjectName(_fromUtf8("text_tr"))
        self.text_bl = QtGui.QLabel(self.centralwidget)
        self.text_bl.setGeometry(QtCore.QRect(159, 220, 111, 21))
        self.text_bl.setObjectName(_fromUtf8("text_bl"))
        self.text_br = QtGui.QLabel(self.centralwidget)
        self.text_br.setGeometry(QtCore.QRect(479, 220, 111, 21))
        self.text_br.setObjectName(_fromUtf8("text_br"))
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(150, 130, 80, 21))
        self.label.setObjectName(_fromUtf8("label"))
        self.label_2 = QtGui.QLabel(self.centralwidget)
        self.label_2.setGeometry(QtCore.QRect(270, 130, 80, 21))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.label_3 = QtGui.QLabel(self.centralwidget)
        self.label_3.setGeometry(QtCore.QRect(580, 130, 80, 21))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_4 = QtGui.QLabel(self.centralwidget)
        self.label_4.setGeometry(QtCore.QRect(460, 130, 80, 21))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.label_5 = QtGui.QLabel(self.centralwidget)
        self.label_5.setGeometry(QtCore.QRect(270, 240, 80, 21))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.label_6 = QtGui.QLabel(self.centralwidget)
        self.label_6.setGeometry(QtCore.QRect(150, 240, 80, 21))
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.label_7 = QtGui.QLabel(self.centralwidget)
        self.label_7.setGeometry(QtCore.QRect(580, 240, 80, 21))
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.label_8 = QtGui.QLabel(self.centralwidget)
        self.label_8.setGeometry(QtCore.QRect(460, 240, 80, 21))
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.edit_ip = QtGui.QLineEdit(self.centralwidget)
        self.edit_ip.setGeometry(QtCore.QRect(370, 20, 241, 31))
        self.edit_ip.setObjectName(_fromUtf8("edit_ip"))
        self.button_searchdac = QtGui.QPushButton(self.centralwidget)
        self.button_searchdac.setGeometry(QtCore.QRect(200, 20, 115, 31))
        self.button_searchdac.setObjectName(_fromUtf8("button_searchdac"))
        self.label_9 = QtGui.QLabel(self.centralwidget)
        self.label_9.setGeometry(QtCore.QRect(60, 320, 501, 31))
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.label_10 = QtGui.QLabel(self.centralwidget)
        self.label_10.setGeometry(QtCore.QRect(110, 350, 491, 31))
        self.label_10.setObjectName(_fromUtf8("label_10"))
        laser_main.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(laser_main)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 29))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        laser_main.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(laser_main)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        laser_main.setStatusBar(self.statusbar)

        self.retranslateUi(laser_main)
        QtCore.QObject.connect(self.tl_x, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QObject.connect(self.tl_y, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QObject.connect(self.tr_x, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QObject.connect(self.tr_y, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QObject.connect(self.bl_x, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QObject.connect(self.bl_y, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QObject.connect(self.br_x, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QObject.connect(self.br_y, QtCore.SIGNAL(_fromUtf8("valueChanged(double)")), self.button_send.click)
        QtCore.QMetaObject.connectSlotsByName(laser_main)

    def retranslateUi(self, laser_main):
        laser_main.setWindowTitle(QtGui.QApplication.translate("laser_main", "Laser geometry setter", None, QtGui.QApplication.UnicodeUTF8))
        self.button_send.setText(QtGui.QApplication.translate("laser_main", "Send Coords", None, QtGui.QApplication.UnicodeUTF8))
        self.text_tl.setText(QtGui.QApplication.translate("laser_main", "Top Left", None, QtGui.QApplication.UnicodeUTF8))
        self.text_tr.setText(QtGui.QApplication.translate("laser_main", "Top Right", None, QtGui.QApplication.UnicodeUTF8))
        self.text_bl.setText(QtGui.QApplication.translate("laser_main", "Bottom left", None, QtGui.QApplication.UnicodeUTF8))
        self.text_br.setText(QtGui.QApplication.translate("laser_main", "Bottom right", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("laser_main", "x", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setText(QtGui.QApplication.translate("laser_main", "y", None, QtGui.QApplication.UnicodeUTF8))
        self.label_3.setText(QtGui.QApplication.translate("laser_main", "y", None, QtGui.QApplication.UnicodeUTF8))
        self.label_4.setText(QtGui.QApplication.translate("laser_main", "x", None, QtGui.QApplication.UnicodeUTF8))
        self.label_5.setText(QtGui.QApplication.translate("laser_main", "y", None, QtGui.QApplication.UnicodeUTF8))
        self.label_6.setText(QtGui.QApplication.translate("laser_main", "x", None, QtGui.QApplication.UnicodeUTF8))
        self.label_7.setText(QtGui.QApplication.translate("laser_main", "y", None, QtGui.QApplication.UnicodeUTF8))
        self.label_8.setText(QtGui.QApplication.translate("laser_main", "x", None, QtGui.QApplication.UnicodeUTF8))
        self.edit_ip.setText(QtGui.QApplication.translate("laser_main", "192.168.0.10", None, QtGui.QApplication.UnicodeUTF8))
        self.button_searchdac.setText(QtGui.QApplication.translate("laser_main", "Search DAC", None, QtGui.QApplication.UnicodeUTF8))
        self.label_9.setText(QtGui.QApplication.translate("laser_main", "Note: Messages will be sent when modifying the Spin Boxes", None, QtGui.QApplication.UnicodeUTF8))
        self.label_10.setText(QtGui.QApplication.translate("laser_main", "and when hitting \"Send Coords\" to the IP in the EditBox.", None, QtGui.QApplication.UnicodeUTF8))


text:
<?php

declare(strict_types=1);

namespace Doctrine\Tests\DBAL\Functional\Driver\OCI8;

use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\OCI8\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;

class DriverTest extends AbstractDriverTest
{
    protected function setUp() : void
    {
        if (! extension_loaded('oci8')) {
            $this->markTestSkipped('oci8 is not installed.');
        }

        parent::setUp();

        if ($this->connection->getDriver() instanceof Driver) {
            return;
        }

        $this->markTestSkipped('oci8 only test.');
    }

    /**
     * {@inheritdoc}
     */
    public function testConnectsWithoutDatabaseNameParameter() : void
    {
        $this->markTestSkipped('Oracle does not support connecting without database name.');
    }

    /**
     * {@inheritdoc}
     */
    public function testReturnsDatabaseNameWithoutDatabaseNameParameter() : void
    {
        $this->markTestSkipped('Oracle does not support connecting without database name.');
    }

    /**
     * {@inheritdoc}
     */
    protected function createDriver() : DriverInterface
    {
        return new Driver();
    }
}


text:
package org.cz.security;

/**
 * SHA256RSA签名/验证签名
 * Created by chenzhe8 on 2017/6/20.
 */

import java.security.InvalidKeyException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.SignatureException;

public class RSA_Demo {
    RSA_Demo() {
        init();
    }

    private void init() {
        prepare();
        doSenderWork();
        doReceiverWork();
    }

    //share by sender and receiver
    Signature sign = null;
    //belong to sender,it visible to sender and receiver
    PublicKey publicKey = null;
    //belong to sender,it is only visible to sender
    PrivateKey privateKey;

    private void prepare() {
        KeyPairGenerator keyGen = null;
        try {
            //实例化一个RSA算法的公钥/私钥对生成器
            keyGen = KeyPairGenerator.getInstance("RSA");
        } catch (NoSuchAlgorithmException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        int keysize = 1024;
        //设置公钥/私钥对的长度
        keyGen.initialize(keysize);
        //生成一个RSA算法的公钥/私钥
        KeyPair keyPair = keyGen.generateKeyPair();
        privateKey = keyPair.getPrivate();
        publicKey = keyPair.getPublic();
        try {
            //实例化一个用SHA算法进行散列,用RSA算法进行加密的Signature.
            sign = Signature.getInstance("SHA1WithRSA");
        } catch (NoSuchAlgorithmException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    void doSenderWork() {
        String words = "This is robin.How are you?";
        Message msg = new Message(words.getBytes());
        try {
            //设置加密散列码用的私钥
            sign.initSign(privateKey);
        } catch (InvalidKeyException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        try {
            //设置散列算法的输入
            sign.update(msg.getBody());
        } catch (SignatureException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        byte data[] = null;
        try {
            //进行散列,对产生的散列码进行加密并返回
            data = sign.sign();
        } catch (SignatureException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        //把加密后散列(即签名)加到消息中
        msg.setSignature(data);
        //发送消息
        sendMsg(msg);
    }

    Message sendingMsg;

    void sendMsg(Message sendMsg) {
        sendingMsg = sendMsg;
        System.out.println("sending Message");
    }

    void doReceiverWork() {
        //收到消息
        Message msg = getReceivedMsg();
        try {
            //设置解密散列码用的公钥。
            sign.initVerify(publicKey);
        } catch (InvalidKeyException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        try {
            //设置散列算法的输入
            sign.update(msg.getBody());
        } catch (SignatureException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        try {
   /*进行散列计算,比较计算所得散列码是否和解密的散列码是否一致。
   * 一致则验证成功,否则失败
   */
            if (sign.verify(msg.getSignature())) {
                System.out.println("数字签名验证成功!");
            } else {
                System.out.println("数字签名验证失败!");
            }
        } catch (SignatureException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    Message getReceivedMsg() {
        System.out.println("receiving Message");
        return sendingMsg;
    }
}

class Message {
    private byte[] body;
    private byte[] signature;

    Message(byte data[]) {
        body = data;
    }

    byte[] getBody() {
        return body;
    }

    byte[] getSignature() {
        return signature;
    }

    void setSignature(byte data[]) {
        signature = data;
    }
}


text:
<#
  This file exists so we can load the test file without necessarily having xNetworking in
  the $env:PSModulePath. Otherwise PowerShell will throw an error when reading the Pester File
#>

$rule = @{
    Name                  = 'b8df0af9-d0cc-4080-885b-6ed263aaed67'
    DisplayName           = 'Test Rule'
    Group                 = 'Test Group'
    Ensure                = 'Present'
    Enabled               = 'False'
    Profile               = @('Domain','Private')
    Action                = 'Allow'
    Description           = 'MSFT_xFirewall Test Firewall Rule'
    Direction             = 'Inbound'
    RemotePort            = @('8080', '8081')
    LocalPort             = @('9080', '9081')
    Protocol              = 'TCP'
    Program               = 'c:\windows\system32\notepad.exe'
    Service               = 'WinRM'
    Authentication        = 'NotRequired'
    Encryption            = 'NotRequired'
    InterfaceAlias        = (Get-NetAdapter -Physical | Select-Object -First 1).Name
    InterfaceType         = 'Wired'
    LocalAddress          = @('192.168.2.0-192.168.2.128','192.168.1.0/255.255.255.0')
    LocalUser             = 'Any'
    Package               = 'S-1-15-2-3676279713-3632409675-756843784-3388909659-2454753834-4233625902-1413163418'
    Platform              = @('6.1')
    RemoteAddress         = @('192.168.2.0-192.168.2.128','192.168.1.0/255.255.255.0')
    RemoteMachine         = 'Any'
    RemoteUser            = 'Any'
    DynamicTransport      = 'Any'
    EdgeTraversalPolicy   = 'Allow'
    LocalOnlyMapping      = $false
    LooseSourceMapping    = $false
    OverrideBlockRules    = $false
    Owner                 = (Get-CimInstance win32_useraccount | Select-Object -First 1).Sid
}

Configuration MSFT_xFirewall_Config {
    Import-DscResource -ModuleName xNetworking
    node localhost {
       xFirewall Integration_Test {
            Name                  = $rule.Name
            DisplayName           = $rule.DisplayName
            Group                 = $rule.Group
            Ensure                = 'Present'
            Enabled               = $rule.Enabled
            Profile               = $rule.Profile
            Action                = $rule.Action
            Description           = $rule.Description
            Direction             = $rule.Direction
            RemotePort            = $rule.RemotePort
            LocalPort             = $rule.LocalPort
            Protocol              = $rule.Protocol
            Program               = $rule.Program
            Service               = $rule.Service
            Authentication        = $rule.Authentication
            Encryption            = $rule.Encryption
            InterfaceAlias        = $rule.InterfaceAlias
            InterfaceType         = $rule.InterfaceType
            LocalAddress          = $rule.LocalAddress
            LocalUser             = $rule.LocalUser
            Package               = $rule.Package
            Platform              = $rule.Platform
            RemoteAddress         = $rule.RemoteAddress
            RemoteMachine         = $rule.RemoteMachine
            RemoteUser            = $rule.RemoteUser
            DynamicTransport      = $rule.DynamicTransport
            EdgeTraversalPolicy   = $rule.EdgeTraversalPolicy
            LocalOnlyMapping      = $rule.LocalOnlyMapping
            LooseSourceMapping    = $rule.LooseSourceMapping
            OverrideBlockRules    = $rule.OverrideBlockRules
            Owner                 = $rule.Owner
        }
    }
}


text:
/**
 * @defgroup xcb__property_t XCB Property Functions
 *
 * These functions ease the handling of X propertiess received.
 *
 * @{
 */

#ifndef __XCB_PROPERTY_H__
#define __XCB_PROPERTY_H__

#include "xcb_event.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct xcb_property_handlers xcb_property_handlers_t;
typedef int (*xcb_generic_property_handler_t)(void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property);

typedef struct {
	uint32_t                       long_len;
	xcb_generic_property_handler_t handler;
	void                          *data;
} xcb_property_handler_t;

typedef struct xcb_property_handler_node xcb_property_handler_node_t;
struct xcb_property_handler_node {
	xcb_property_handler_node_t *next;
	xcb_atom_t     name;
	xcb_property_handler_t h;
};

struct xcb_property_handlers {
	xcb_property_handler_node_t *head;
	xcb_property_handler_t      def;
	xcb_event_handlers_t        *evenths;
};

/**
 * @brief Get any property from a window, from any format.
 * @param c The connection to the X server.
 * @param del Boolean value that determines whether the property is deleted.
 * @param window The window to get property from.
 * @param name The property atom name.
 * @param long_len The maximum length of the property.
 * @return A cookie.
 */
xcb_get_property_cookie_t xcb_get_any_property(xcb_connection_t *c,
                                               uint8_t del,
                                               xcb_window_t window,
                                               xcb_atom_t name,
                                               uint32_t long_len);

/**
 * @see xcb_get_any_property
 */
xcb_get_property_cookie_t xcb_get_any_property_unchecked(xcb_connection_t *c,
                                                         uint8_t del,
                                                         xcb_window_t window,
                                                         xcb_atom_t name,
                                                         uint32_t long_len);
/**
 * @brief Initialize a property handlers structure.
 * @param prophs The property handlers data structure pointer.
 * @param evenths The event handlers.
 */
void xcb_property_handlers_init(xcb_property_handlers_t *prophs, xcb_event_handlers_t *evenths);

/**
 * @brief Wipe a property handler structure.
 * @param prophs The property handlers data structure pointer.
 */
void xcb_property_handlers_wipe(xcb_property_handlers_t *prophs);

/**
 * @brief Get a event handlers from a property handlers data structure.
 * @param prophs The property handlers.
 * @return The event handlers data structure which was set if any, NULL
 * otherwise.
 */
xcb_event_handlers_t *xcb_property_get_event_handlers(xcb_property_handlers_t *prophs);

/**
 * @brief Set a property handler for an event.
 * @param prophs The property handlers.
 * @param name The property atom name.
 * @param long_len The maximum length of the property value that will be
 * handled.
 * @param handler The handler callback function.
 * @param data Optional data that will be passed as argument of the handler
 * callback function. Can be NULL safely if you do not need it.
 * @return Return 1 on success, 0 otherwise.
 */
uint8_t xcb_property_set_handler(xcb_property_handlers_t *prophs,
                                 xcb_atom_t name,
                                 uint32_t long_len,
                                 xcb_generic_property_handler_t handler,
                                 void *data);

/**
 * @brief Set the default property handler.
 * If a property does not have its own handler function, this one will be
 * used.
 * @param prophs The property handlers.
 * @param name The property atom name.
 * @param long_len The maximum length of the property value that will be
 * handled.
 * @param handler The handler callback function.
 * @param data Optional data that will be passed as argument of the handler
 * callback function. Can be NULL safely if you do not need it.
 * @return Return 1 on success, 0 otherwise.
 */
uint8_t xcb_property_set_default_handler(xcb_property_handlers_t *prophs, uint32_t long_len, xcb_generic_property_handler_t handler, void *data);

/**
 * @brief Notify that a property has changed and call handler function callback as needed.
 * @param prophs The property handlers.
 * @param state The property state.
 * @param window The window.
 * @param atom The property atom name.
 */
int xcb_property_changed(xcb_property_handlers_t *prophs, uint8_t state, xcb_window_t window, xcb_atom_t atom);

#ifdef __cplusplus
}
#endif

/**
 * @}
 */

#endif /* __XCB_PROPERTY_H__ */


text:
module.exports = function (grunt) {
  grunt.initConfig({
    coffeelint: {
      app: ['lib/*.coffee'],
      options: {
        max_line_length: {
          level: 'ignore'
        },
        line_endings: {
          value: "unix",
          level: "error"
        },
        no_trailing_semicolons: {
          level: "ignore"
        }
      }
    },
    coffee: {
      compile: {
        files: [{
          expand: true,         // Enable dynamic expansion.
          cwd: 'lib/',          // Src matches are relative to this path.
          src: ['**/*.coffee'], // Actual pattern(s) to match.
          dest: 'lib/',         // Destination path prefix.
          ext: '.js'            // Dest filepaths will have this extension.
        }],
        options: {
          bare: true            // Skip surrounding IIFE in compiled output.
        }
      }
    },
    concat: {
      "firepadjs": {
        options: {
          banner: [
            '/*!',
            ' * Firepad is an open-source, collaborative code and text editor. It was designed',
            ' * to be embedded inside larger applications. Since it uses Firebase as a backend,',
            ' * it requires no server-side code and can be added to any web app simply by',
            ' * including a couple JavaScript files.',
            ' *',
            ' * Firepad 0.0.0',
            ' * http://www.firepad.io/',
            ' * License: MIT',
            ' * Copyright: 2014 Firebase',
            ' * With code from ot.js (Copyright 2012-2013 Tim Baumann)',
            ' */\n',
            '(function (name, definition, context) {',
            '  //try CommonJS, then AMD (require.js), then use global.',
            '  if (typeof module != \'undefined\' && module.exports) module.exports = definition();',
            '  else if (typeof context[\'define\'] == \'function\' && context[\'define\'][\'amd\']) define(definition);',
            '  else context[name] = definition();',
            '})(\'Firepad\', function () {'
          ].join('\n'),
          footer: "\nreturn firepad.Firepad; }, this);"
        },
        "src": [
          "lib/utils.js",
          "lib/span.js",
          "lib/text-op.js",
          "lib/text-operation.js",
          "lib/annotation-list.js",
          "lib/cursor.js",
          "lib/firebase-adapter.js",
          "lib/rich-text-toolbar.js",
          "lib/wrapped-operation.js",
          "lib/undo-manager.js",
          "lib/client.js",
          "lib/editor-client.js",
          "lib/ace-adapter.js",
          "lib/constants.js",
          "lib/entity-manager.js",
          "lib/entity.js",
          "lib/rich-text-codemirror.js",
          "lib/rich-text-codemirror-adapter.js",
          "lib/formatting.js",
          "lib/text.js",
          "lib/line-formatting.js",
          "lib/line.js",
          "lib/parse-html.js",
          "lib/serialize-html.js",
          "lib/text-pieces-to-inserts.js",
          "lib/headless.js",
          "lib/firepad.js"
        ],
        "dest": "dist/firepad.js"
      }
    },
    uglify: {
      options: {
        preserveComments: "some"
      },
      "firepad-min-js": {
        src: "dist/firepad.js",
        dest: "dist/firepad.min.js"
      }
    },
    copy: {
      toBuild: {
        files: [
          {
            src: 'font/firepad.eot',
            dest: 'dist/firepad.eot'
          },
          {
            src: 'lib/firepad.css',
            dest: 'dist/firepad.css'
          },
        ]
      }
    },
    watch: {
      files: ['lib/*.js', 'lib/*.coffee', 'lib/*.css'],
      tasks: ['build']
    },

    // Unit tests
    karma: {
      options: {
        configFile: 'test/karma.conf.js',
      },
      unit: {
        autowatch: false,
        singleRun: true
      }
    }
  });

  grunt.loadNpmTasks('grunt-coffeelint');
  grunt.loadNpmTasks('grunt-contrib-coffee');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-karma');

  // Tasks
  grunt.registerTask('test', ['karma:unit']);
  grunt.registerTask('build', ['coffeelint', 'coffee', 'concat', 'uglify', 'copy'])
  grunt.registerTask('default', ['build', 'test']);
};