text:
This guide is designed to help you get off the ground quickly contributing to Sails.  Reading it thoroughly will help you write useful issues, propose eloquent feature requests, and submit top-notch code that can be merged quickly.  Respecting the guidelines laid out below helps make the core maintainers of Sails more productive, and makes the experience of working with Sails more enjoyable for the community at large.

## Installing different versions of Sails

| Release               | Install Command          | Build Status      |
|-----------------------|--------------------------|-------------------|
| [stable](https://github.com/balderdashy/sails/tree/stable)                | `npm install sails`      | [![Build Status](https://travis-ci.org/balderdashy/sails.png?branch=stable)](https://travis-ci.org/balderdashy/sails) |
| [beta](https://github.com/balderdashy/sails/tree/beta)                  | `npm install sails@beta` | [![Build Status](https://travis-ci.org/balderdashy/sails.png?branch=beta)](https://travis-ci.org/balderdashy/sails) |
| [edge](https://github.com/balderdashy/sails/tree/master)                  | `npm install sails@git://github.com/balderdashy/sails.git` | [![Build Status](https://travis-ci.org/balderdashy/sails.png?branch=master)](https://travis-ci.org/balderdashy/sails) |

## Opening issues

> Sails is composed of a number of different sub-projects, many of which have their [own dedicated repository](https://github.com/balderdashy/sails/blob/master/MODULES.md).  Please open issues with Waterline, various adapters, various generators, etc. in the relevant repo.  This helps us stay on top of issues and keep organized.

When submitting an issue, please follow these simple instructions:

1. If you have a question about setting up/using Sails, please check out the [Sails docs](http://sailsjs.org/#!documentation) or try searching  [StackOverflow](http://stackoverflow.com/questions/tagged/sails.js).
2. Search for issues similar to yours in [GitHub search](https://github.com/balderdashy/sails/search?type=Issues) and [Google](https://www.google.nl/search?q=sails+js).
3. Feature requests are welcome; see [Requesting Features](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md#requesting-features) below for submission guidelines.
4. If there's an open issue, please contribute to that issue.
5. If there's a closed issue, open a new issue and link the url of the already closed issue(s).
6. If there is no issue, open a new issue and specify the following:
  - A short description of your issue in the title
  - The sails version (find this with ````sails -v````).
  - Detailed explanation of how to recreate the issue
7. If you are experiencing more than one problem, create a separate issue for each one. If you think they might be related, please reference the other issues you've created.

## Requesting Features

> Note: The process for tracking feature requests has recently changed. We are still using Trello for the Sails roadmap, but are migrating feature requests back into GitHub issues in order to allow more people to participate in the discussion.

#####Submitting a new feature request
1. First, check to see if a feature request already exists for what you're interested in. If it does, you can join the discussion in that request's comment thread.
2. If it doesn't already exist, create a new issue for it. Please prefix the title with **[#feature]** so we can easily spot it and keep track of feature requests.

## Writing Tests

See our [guides on writing tests](https://github.com/balderdashy/sails/tree/master/test) for Sails core.

Test Coverage:

| Edge (master branch) |
|----------------------|
| [![Coverage Status](https://coveralls.io/repos/balderdashy/sails/badge.png)](https://coveralls.io/r/balderdashy/sails) |

## Code Submission Guidelines

The community is what makes Sails great, without you we wouldn't have come so far. But to help us keep our sanity and reach code-nirvana together, please follow these quick rules whenever contributing.

> Note: This section is based on the [Node.js contribution guide](https://github.com/joyent/node/blob/master/CONTRIBUTING.md#contributing).

###### No CoffeeScript.

For consistency, all code in Sails core, including core hooks and core generators, must be written in JavaScript, not CoffeeScript or TypeScript.  We can't merge a pull request in CofeeScript.

###### Contributing to an adapter

If the adapter is part of core (code base is located in the Sails repo), please follow the general best practices for contributing to Sails core.  If it is located in a different repo, please send feature requests, patches, and issues there.

###### Authoring a new adapter

The custom adapter API is not stable yet, but it is settling.  Feel free to start work on a new custom adapter, just make sure and do a thorough search on npm, Google and Github to make sure someone else hasn't already started working on the same thing.  A custom adapter is a great way to get your feet wet with contributing to the Waterline code base.

###### Contributing to a generator

If the generator is part of core (code base is located in the Sails repo), please follow the general best practices for contributing to Sails core.  If it is located in a different repo, please send feature requests, patches, and issues there.

###### Contributing to core

Sub-modules within the Sails core are at varying levels of API stability. Bug fixes are always welcome but API or behavioral changes to modules at stability level 3 and up cannot be merged without serious planning.

Sails has several dependencies referenced in the `package.json` file that are not part of the project proper. Any proposed changes to those dependencies or _their_ dependencies should be sent to their respective projects (i.e. Waterline, Anchor, etc.) Please do not send your patch or feature request to this repository, we cannot accept or fulfill it.

In case of doubt, open an issue in the [issue tracker](), post your question to the [mailing list]() or contact one of the project maintainers on IRC (#sailsjs on freenode).  Especially if you plan to work on something big. Nothing is more frustrating than seeing your hard work go to waste because your vision does not align with a project's roadmap.  At the end of the day, we just want to be able to merge your code.

###### Contributing to a hook

If the hook is part of core (code base is located in the Sails repo), please follow the general best practices for contributing to Sails core.  If the hook is located in a different repo, please send feature requests, patches, and issues there.

###### Authoring a new hook

The custom hook API, while functional, is still unstable.  Feel free to start work on a custom hook, but please consult with one of the project maintainers first so we can help protect your work from future changes.

###### Authoring a new generator

The custom generator API is very new, and still experimental.  If you are serious about building a new generator, please consult with one of the project maintainers before you start so we can help set you off on the right foot.

###### Submitting Pull Requests

0. If you don't know how to fork and PR, [follow our instructions on contributing](https://github.com/balderdashy/sails-docs/blob/0.9/Contributing-to-Sails.md).
1. Fork the repo.
2. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test!
4. Make the tests pass and make sure you follow [our syntax guidelines](https://github.com/balderdashy/sails/blob/master/.jshintrc).
5. Push to your fork and submit a pull request to the [master branch](https://github.com/balderdashy/sails/tree/master).

## Best-practices / workflow for developing on Sails

The best way to work with Sails core is to fork the repository, `git clone` it to your filesystem, and then run `npm link`.  In addition to writing tests, you'll often want to use a sample project as a harness-- to do that, `cd` into the sample app and run `npm link sails`.  This will create a symbolic link in the `node_modules` directory of your sample app that points to your local cloned version of sails.  This keeps you from having to copy the framework over every time you make a change.  You can force your sample app to use the local sails dependency by running `node app` instead of `sails lift` (although `sails lift` **should** use the local dependency, if one exists).  If you need to test the command line tool this way, you can access it from your sample app as `node node_modules/sails/bin/sails`.  For example, if you were working on `sails new`, and you wanted to test it manually, you could run `node node_modules/sails/bin/sails new testProj`.

Of course, that's just my opinion, so if you have a more productive way to collaborate/contribute, that is entirely your perogative.  And as always, if you have suggestions, please let us know.

## Installing an unreleased branch for testing

In general, you can `npm install` sails directly from Github as follows:

```sh
# Install an unreleased branch of Sails in the current directory's `node_modules`
$ npm install sails@git://github.com/balderdashy/sails.git#nameOfDesiredBranch
```

This is useful for testing/installing hot-fixes, and just a good thing to know how to do in general.  Here's how you'd install a few different branches:

| Release               | Install Command          |
|-----------------------|--------------------------|
| [stable](https://github.com/balderdashy/sails/tree/stable)                | `npm install sails@git://github.com/balderdashy/sails.git#stable`      |
| [beta](https://github.com/balderdashy/sails/tree/beta)                  | `npm install sails@git://github.com/balderdashy/sails.git#beta` |
| [edge](https://github.com/balderdashy/sails/tree/master)                  | `npm install sails@git://github.com/balderdashy/sails.git` |

## Financial Support

+ Sails is sponsored by [Balderdash](http://balderdash.co), a small development and design studio in Austin, TX.  If you have a mutually beneficial opportunity to work together, or want to fund us to accelerate the development of a feature in Sails for a real-world use case, please [contact us](http://balderdash.co).
+ [Donate](https://www.gittip.com/mikermcneil/) to help me (@mikermcneil) stop paying myself, and instead use that money to expand the core team, improve docs, etc.

## Additional Resources
#### [Get Started](http://sailsjs.org/#!getStarted) | [Documentation](http://sailsjs.org/#!documentation) | [Changelog](https://github.com/balderdashy/sails/wiki/Changelog) | [#sailsjs on IRC](http://webchat.freenode.net/) | [Google Group](https://groups.google.com/forum/?fromgroups#!forum/sailsjs) | [Twitter](http://twitter.com/sailsjs)


text:
<?php
/**
 * Created by PhpStorm.
 * User: janhuang
 * Date: 16/4/18
 * Time: 下午10:23
 * Github: https://www.github.com/janhuang
 * Coding: https://www.coding.net/janhuang
 * SegmentFault: http://segmentfault.com/u/janhuang
 * Blog: http://segmentfault.com/blog/janhuang
 * Gmail: bboyjanhuang@gmail.com
 * WebSite: http://www.janhuang.me
 */

include __DIR__ . '/../vendor/autoload.php';

$generator = new \FastD\Generator\Generator('Test');

echo $generator->output();

$generator->save(__DIR__ . '/save/Test.php');

redpajama_set_name: RedPajamaGithub


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:background="@drawable/bg1"
    tools:context=".MyActivity">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imageView"
        android:src="@drawable/logo"
        android:layout_marginLeft="3dp"
        android:layout_marginTop="3dp"
        android:layout_above="@+id/textView2"
        android:layout_alignEnd="@+id/editText1" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_above="@+id/imageView"
        android:text="@string/hello_world"
        android:textColor="@color/blanco"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:visibility="invisible" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/username"
        android:textColor="@color/blanco"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:layout_toStartOf="@+id/editText1"
        android:layout_above="@+id/editText2"
        android:layout_alignStart="@+id/textView3" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/blanco"
        android:ems="10"
        android:layout_above="@+id/editText2"
        android:layout_alignStart="@+id/editText2">
        <requestFocus />
    </EditText>

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/password"
        android:textColor="@color/blanco"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:layout_alignBottom="@+id/editText2"
        android:layout_toStartOf="@+id/editText2" />

    <EditText
        android:id="@+id/editText2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:textColor="@color/blanco"
        android:inputType="textPassword"
        android:layout_above="@+id/button1"
        android:layout_alignStart="@+id/textView1"
        android:layout_marginBottom="74dp" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="login"
        android:text="@string/Login"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="66dp" />

    <TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/blanco"
        android:text="TextView"
        android:layout_alignBaseline="@+id/button1"
        android:layout_alignBottom="@+id/button1"
        android:layout_toEndOf="@+id/button1"
        android:visibility="invisible"
        android:src="@drawable/logo" />

</RelativeLayout>
<!-- From: file:/home/fer/Downloads/NotiNexusFimeUanl/app/src/main/res/layout/activity_my.xml -->


text:
'use strict';

var _ = require('lodash');
var expect = require('chai').expect;
var filter = require('../..');

describe('Knex schema filter', function () {
  var schemas, tableNames;

  describe('given nothing', function () {
    it('should return empty array', function (done) {
      filter.filter(schemas, tableNames, function (err, schemas) {
        if (err) return done(err);
        expect(schemas).to.eql([]);
        done();
      });
    });
  });

  describe('given empty schemas', function () {
    beforeEach(function () {
      schemas = [];
    });

    it('should return empty array', function (done) {
      filter.filter(schemas, tableNames, function (err, schemas) {
        if (err) return done(err);
        expect(schemas).to.eql([]);
        done();
      });
    });
  });

  describe('given schemas', function () {
    beforeEach(function () {
      schemas = require('../fixtures/schemas');
    });

    it('should return all schemas', function (done) {
      filter.filter(schemas, tableNames, function (err, schemas) {
        if (err) return done(err);
        expect(schemas).to.eql(schemas);
        done();
      });
    });

    describe('given empty table names', function () {
      beforeEach(function () {
        tableNames = [];
      });

      it('should return all schemas', function (done) {
        filter.filter(schemas, tableNames, function (err, schemas) {
          if (err) return done(err);
          expect(schemas).to.eql(schemas);
          done();
        });
      });
    });

    describe('given table name a', function () {
      beforeEach(function () {
        tableNames = ['a'];
      });

      it('should return all schemas', function (done) {
        filter.filter(schemas, tableNames, function (err, schemas) {
          if (err) return done(err);
          expect(schemas).to.eql(filterSchemas(schemas, 'a'));
          done();
        });
      });
    });

    describe('given table name b', function () {
      beforeEach(function () {
        tableNames = ['b'];
      });

      it('should return all schemas', function (done) {
        filter.filter(schemas, tableNames, function (err, schemas) {
          if (err) return done(err);
          expect(schemas).to.eql(filterSchemas(schemas, 'a', 'b'));
          done();
        });
      });
    });

    describe('given table name c', function () {
      beforeEach(function () {
        tableNames = ['c'];
      });

      it('should return all schemas', function (done) {
        filter.filter(schemas, tableNames, function (err, schemas) {
          if (err) return done(err);
          expect(schemas).to.eql(filterSchemas(schemas, 'a', 'b', 'c'));
          done();
        });
      });
    });

    describe('given table name d', function () {
      beforeEach(function () {
        tableNames = ['d'];
      });

      it('should return all schemas', function (done) {
        filter.filter(schemas, tableNames, function (err, schemas) {
          if (err) return done(err);
          expect(schemas).to.eql(filterSchemas(schemas, 'a', 'b', 'c', 'd'));
          done();
        });
      });
    });

    describe('given table name e', function () {
      beforeEach(function () {
        tableNames = ['e'];
      });

      it('should return all schemas', function (done) {
        filter.filter(schemas, tableNames, function (err, schemas) {
          if (err) return done(err);
          expect(schemas).to.eql(filterSchemas(schemas, 'a', 'b', 'c', 'd', 'e'));
          done();
        });
      });
    });

    describe('given table name e and g', function () {
      beforeEach(function () {
        tableNames = ['d'];
      });

      it('should return all schemas', function (done) {
        filter.filter(schemas, tableNames, function (err, schemas) {
          if (err) return done(err);
          expect(schemas).to.eql(filterSchemas(schemas, 'a', 'b', 'c', 'd', 'e', 'f', 'g'));
          done();
        });
      });
    });
  });
});

/**
 * Filter provided schemas using table names arguments.
 *
 * @param {[Schema]} schemas
 * @param {String...} tableName
 */

function filterSchemas(schemas) {
  var tableNames = _.rest(arguments);
  return schemas.filter(function (schema) {
    return tableNames.indexOf(schema.tableName) >= 0;
  });
}


text:
PROJECT=$(readlink -f $(dirname $0)/../../..)
UBUNTU_DIR=${PROJECT}/package/ubuntu/hyperstart
VERSION=${VERSION:-0.8.1}
BRANCH=${BRANCH:-master}

if [ $# -gt 0 ] ; then
    VERSION=$1
fi

# install addtional pkgs in order to build deb pkg
# sudo apt-get install -y autoconf automake pkg-config dh-make

# get hyperstart tar ball
cd $PROJECT/../hyperstart
git archive --format=tar.gz ${BRANCH} > ${UBUNTU_DIR}/hyperstart-${VERSION}.tar.gz

# prepair to create source pkg
mkdir -p ${UBUNTU_DIR}/hyperstart-${VERSION}
cd ${UBUNTU_DIR}
tar -zxf hyperstart-${VERSION}.tar.gz -C ${UBUNTU_DIR}/hyperstart-${VERSION}

# in order to use debian/* to create deb, so put them in the hyperstart.
cp -a ${UBUNTU_DIR}/debian ${UBUNTU_DIR}/hyperstart-${VERSION}

# run dh_make
cd ${UBUNTU_DIR}/hyperstart-${VERSION}
dh_make -s -y -f ../hyperstart_${VERSION}.orig.tar.gz -e dev@hyper.sh

# run dpkg-buildpackage
dpkg-buildpackage -b -us -uc -rfakeroot

#clean up intermediate files
rm -rf ${UBUNTU_DIR}/hyperstart-${VERSION}


text:
![AppStore provision](https://raw.github.com/ealeksandrov/ProvisionQL/master/Screenshots/2.png)
![dev provision](https://raw.github.com/ealeksandrov/ProvisionQL/master/Screenshots/3.png)
![ipa before AppStore](https://raw.github.com/ealeksandrov/ProvisionQL/master/Screenshots/4.png)
![ipa from AppStore](https://raw.github.com/ealeksandrov/ProvisionQL/master/Screenshots/5.png)


text:
class AddInstructionsToPage < ActiveRecord::Migration
  def change
    add_column :pages, :instructions, :string
  end
end


text:
#pragma once
#include <aws/apigateway/APIGateway_EXPORTS.h>
#include <aws/apigateway/APIGatewayRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/apigateway/model/PatchOperation.h>
#include <utility>

namespace Aws
{
namespace APIGateway
{
namespace Model
{

  /**
   *
The PATCH request to update a usage plan of a given plan Id.

See
   * Also:
   AWS
   * API Reference

   */
  class AWS_APIGATEWAY_API UpdateUsagePlanRequest : public APIGatewayRequest
  {
  public:
    UpdateUsagePlanRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "UpdateUsagePlan"; }

    Aws::String SerializePayload() const override;

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline const Aws::String& GetUsagePlanId() const{ return m_usagePlanId; }

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline bool UsagePlanIdHasBeenSet() const { return m_usagePlanIdHasBeenSet; }

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline void SetUsagePlanId(const Aws::String& value) { m_usagePlanIdHasBeenSet = true; m_usagePlanId = value; }

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline void SetUsagePlanId(Aws::String&& value) { m_usagePlanIdHasBeenSet = true; m_usagePlanId = std::move(value); }

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline void SetUsagePlanId(const char* value) { m_usagePlanIdHasBeenSet = true; m_usagePlanId.assign(value); }

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline UpdateUsagePlanRequest& WithUsagePlanId(const Aws::String& value) { SetUsagePlanId(value); return *this;}

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline UpdateUsagePlanRequest& WithUsagePlanId(Aws::String&& value) { SetUsagePlanId(std::move(value)); return *this;}

    /**
     *
The Id of the to-be-updated usage plan.

     */
    inline UpdateUsagePlanRequest& WithUsagePlanId(const char* value) { SetUsagePlanId(value); return *this;}

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline const Aws::Vector<PatchOperation>& GetPatchOperations() const{ return m_patchOperations; }

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline bool PatchOperationsHasBeenSet() const { return m_patchOperationsHasBeenSet; }

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline void SetPatchOperations(const Aws::Vector<PatchOperation>& value) { m_patchOperationsHasBeenSet = true; m_patchOperations = value; }

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline void SetPatchOperations(Aws::Vector<PatchOperation>&& value) { m_patchOperationsHasBeenSet = true; m_patchOperations = std::move(value); }

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline UpdateUsagePlanRequest& WithPatchOperations(const Aws::Vector<PatchOperation>& value) { SetPatchOperations(value); return *this;}

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline UpdateUsagePlanRequest& WithPatchOperations(Aws::Vector<PatchOperation>&& value) { SetPatchOperations(std::move(value)); return *this;}

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline UpdateUsagePlanRequest& AddPatchOperations(const PatchOperation& value) { m_patchOperationsHasBeenSet = true; m_patchOperations.push_back(value); return *this; }

    /**
     *
For more information about supported patch operations, see Patch
     * Operations.

     */
    inline UpdateUsagePlanRequest& AddPatchOperations(PatchOperation&& value) { m_patchOperationsHasBeenSet = true; m_patchOperations.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_usagePlanId;
    bool m_usagePlanIdHasBeenSet = false;

    Aws::Vector<PatchOperation> m_patchOperations;
    bool m_patchOperationsHasBeenSet = false;
  };

} // namespace Model
} // namespace APIGateway
} // namespace Aws


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HTTPResponseHandler (fax4j 0.45.0 API)</title>
<meta name="date" content="2020-05-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.fax4j.spi.http

Interface HTTPResponseHandler

All Superinterfaces:

ConfigurationHolder, Initializable, ProviderImplementation, Service

All Known Implementing Classes:

AbstractHTTPResponseHandler, AbstractMappingHTTPResponseHandler, EmptyHTTPResponseHandler, JSONHTTPResponseHandler, XMLHTTPResponseHandler

public interface HTTPResponseHandler
extends Service

This interface defines the HTTP response handler which is used to update the fax job based on the HTTP response data.

Since:

0.42.4

Version:

1.0

Author:

Sagie Gur-Ari

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

FaxJobStatus
getFaxJobStatus(HTTPResponse httpResponse)

This function extracts the fax job status from the HTTP response data.

void
updateFaxJob(FaxJob faxJob,
            HTTPResponse httpResponse,
            FaxActionType faxActionType)

Updates the fax job based on the data from the HTTP response data.

Methods inherited from interface org.fax4j.common.Service

setPropertyPart

Methods inherited from interface org.fax4j.common.ProviderImplementation

getProvider

Methods inherited from interface org.fax4j.common.Initializable

initialize

Methods inherited from interface org.fax4j.common.ConfigurationHolder

getConfiguration, getConfigurationValue, getConfigurationValue, getPropertyPart

Method Detail

updateFaxJob

void updateFaxJob(FaxJob faxJob,
                  HTTPResponse httpResponse,
                  FaxActionType faxActionType)

Updates the fax job based on the data from the HTTP response data.

Parameters:

faxJob - The fax job object

httpResponse - The HTTP response

faxActionType - The fax action type

getFaxJobStatus

FaxJobStatus getFaxJobStatus(HTTPResponse httpResponse)

This function extracts the fax job status from the HTTP response data.

Parameters:

httpResponse - The HTTP response

Returns:

The fax job status

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2009–2020 fax4j. All rights reserved.


text:
namespace SixLabors.Fonts.Tables.General
{
    internal sealed class VerticalMetricsTable : Table
    {
        internal const string TableName = "vmtx";
        private readonly short[] topSideBearings;
        private readonly ushort[] advancedHeights;

        public VerticalMetricsTable(ushort[] advancedHeights, short[] topSideBearings)
        {
            this.advancedHeights = advancedHeights;
            this.topSideBearings = topSideBearings;
        }

        public ushort GetAdvancedHeight(int glyphIndex)
        {
            if (glyphIndex >= this.advancedHeights.Length)
            {
                return this.advancedHeights[0];
            }

            return this.advancedHeights[glyphIndex];
        }

        internal short GetTopSideBearing(int glyphIndex)
        {
            if (glyphIndex >= this.topSideBearings.Length)
            {
                return this.topSideBearings[0];
            }

            return this.topSideBearings[glyphIndex];
        }

        public static VerticalMetricsTable Load(FontReader reader)
        {
            // You should load all dependent tables prior to manipulating the reader
            VerticalHeadTable headTable = reader.GetTable<VerticalHeadTable>();
            MaximumProfileTable profileTable = reader.GetTable<MaximumProfileTable>();

            // Move to start of table
            using BigEndianBinaryReader binaryReader = reader.GetReaderAtTablePosition(TableName);
            return Load(binaryReader, headTable.NumberOfVMetrics, profileTable.GlyphCount);
        }

        public static VerticalMetricsTable Load(BigEndianBinaryReader reader, int metricCount, int glyphCount)
        {
            // Type           | Name                                          | Description
            // longVerMetric  | vMetrics[numberOfVMetrics]                    | Paired advance height and top side bearing values for each glyph. Records are indexed by glyph ID.
            // int16          | leftSideBearing[numGlyphs - numberOfVMetrics] | Top side bearings for glyph IDs greater than or equal to numberOfVMetrics.
            int bearingCount = glyphCount - metricCount;
            ushort[] advancedHeights = new ushort[metricCount];
            short[] topSideBearings = new short[glyphCount];

            for (int i = 0; i < metricCount; i++)
            {
                // longVerMetric Record:
                // Type   | Name          | Description
                // -------| ------------- | -----------------------------------------------------------
                // uint16 | advanceHeight | The advance height of the glyph.Signed integer in FUnits.
                // int16  | topSideBearing| The top side bearing of the glyph. Signed integer in FUnits
                advancedHeights[i] = reader.ReadUInt16();
                topSideBearings[i] = reader.ReadInt16();
            }

            for (int i = 0; i < bearingCount; i++)
            {
                topSideBearings[metricCount + i] = reader.ReadInt16();
            }

            return new VerticalMetricsTable(advancedHeights, topSideBearings);
        }
    }
}


text:
var async = require('async')
  , User = require('../models/user');

exports.id = '007-user-icon';

exports.up = function(done) {
  console.log('\nUpdating user icons');

  User.getUsers(function(err, users) {
    if (err) return done(err);

    async.each(users, function(user, done) {
      user.icon = user.icon || {};
      user.icon.type = user.icon.relativePath ? 'upload' : 'none';
      user.save(done);
    }, function(err) {
      done(err);
    });
  });
};

exports.down = function(done) {
  done();
};


text:
<?php

/**
 * RockSolid Antispam translations
 *
 * @author Martin Auswöger <martin@madeyourday.net>
 */

$GLOBALS['TL_LANG']['FFL']['rocksolid_antispam'][0] = 'Antispam und Backup-Sicherheitsfrage';
$GLOBALS['TL_LANG']['FFL']['rocksolid_antispam'][1] = 'Ein unsichtbares Feld als Schutz vor Spam-Bots. Als Backup-Mechanismus kommt die standard Sicherheitsfrage zum Einsatz. Die Feldbezeichnung beschreibt das Sicherheitsfrage-Feld und sollte deshalb z.B. lauten »Sicherheitfrage«.';
$GLOBALS['TL_LANG']['FFL']['rocksolid_antispam']['label'] = 'Dieses Feld nicht ausfüllen';


text:
namespace dotless.Core.Parser.Tree
{
    using Infrastructure;
    using Infrastructure.Nodes;

    public class Alpha : Call
    {
        public Node Value { get; set; }

        public Alpha(Node value)
        {
            Value = value;
        }

        public override Node Evaluate(Env env)
        {
            Value = Value.Evaluate(env);

            return this;
        }

        public override string ToCSS(Env env)
        {
            return string.Format("alpha(opacity={0})", Value.ToCSS(env));
        }

        public override Node Copy()
        {
            return new Alpha(Value.Copy());
        }
    }
}


text:
package cyclops.free;

import com.oath.cyclops.hkt.Higher;
import com.oath.cyclops.hkt.Higher2;
import cyclops.companion.Functions;
import cyclops.function.Lambda;
import com.oath.cyclops.hkt.DataWitness.free;
import com.oath.cyclops.hkt.DataWitness.freeAp;
import cyclops.instances.free.FreeApInstances;
import cyclops.instances.free.FreeInstances;
import cyclops.function.NaturalTransformation;
import cyclops.typeclasses.monad.Applicative;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;

import java.util.function.BiFunction;
import java.util.function.Function;

//FreeAp refs : = https://github.com/typelevel/cats/blob/master/free/src/main/scala/cats/free/FreeApplicative.scala
public interface FreeAp<F, T> extends Higher2<freeAp,F, T> {
    static <F, T> FreeAp<F, T> pure(T value) {
        return new Pure(value);
    }
    static <F, T,P> FreeAp<F, T> ap(Higher<F,P> fp, FreeAp<F,Function<P, T>> fn){
        return new Ap(fp,fn);
    }
    default <P, R> FreeAp<F, R> ap(FreeAp<F, ? extends Function<T, R>> b){
        return b.<P,FreeAp<F, R>>fold(f->this.map(f),
                 (pivot,fn)->ap(pivot,ap(fn.map(fx->a->p->fx.apply(p).apply(a)))));
    }
    default <P, R> FreeAp<F, R> map(Function<? super T,? extends R> f){
            return this.<P,FreeAp<F, R>>fold(a->pure(f.apply(a)),
                    (pivot,fn)-> ap(pivot, fn.map(it -> {
                        Function<P,? extends R> x = f.compose(it);
                        return Functions.narrow(x);
                    })));
    }
    default <P,G> Higher<G, T> foldMap(NaturalTransformation<F, G> f, Applicative<G> applicative){
        return this.<P,Higher<G, T>>fold(a->applicative.unit(a),
                (pivot,fn)->applicative.zip(f.apply(pivot),fn.foldMap(f,applicative),(a, g)->g.apply(a)));
    }

    default <P> Higher<F, T> fold(Applicative<F> applicative){
        return this.<P, F>foldMap(NaturalTransformation.identity(), applicative);
    }
    default Free<F, T> monad(Applicative<F> applicative){
        return Free.narrowK(foldMap(new NaturalTransformation<F, Higher<free, F>>() {
            @Override
            public <T> Higher<Higher<free, F>, T> apply(Higher<F, T> a) {
                Free<F, T> res = Free.liftF(a, applicative);
                return res;
            }
        }, FreeInstances.applicative(applicative, applicative)));

    }
    default <P,G> FreeAp<G, T> compile(NaturalTransformation<F, G> f, Applicative<G> applicative){
        return FreeAp.narrowK(foldMap(new NaturalTransformation<F, Higher<freeAp, G>>() {

            @Override
            public <T> Higher<Higher<freeAp, G>, T> apply(Higher<F, T> a) {
                return FreeAp.lift(f.apply(a),applicative);
            }
        }, FreeApInstances.applicative(applicative, applicative)));
    }
    static <F,A> FreeAp<F,A> lift(Higher<F,A> fa, Applicative<F> applicative) {
        return ap(fa,pure(Lambda.l1(a -> a)));
    }

    <P,R> R fold(Function<? super T,? extends R> pure, BiFunction<? super Higher<F,P>,FreeAp<F,Function<P, T>>,? extends R> ap);

    @AllArgsConstructor(access = AccessLevel.PRIVATE)
    static class Pure<F, A> implements FreeAp<F,A> {
        private final  A a;

        @Override
        public <P,R> R fold(Function<? super A, ? extends R> pure, BiFunction<? super Higher<F, P>, FreeAp<F, Function<P, A>>, ? extends R> ap) {
            return pure.apply(a);
        }
    }
    @AllArgsConstructor(access = AccessLevel.PRIVATE)
    static class Ap<F, P, A> implements FreeAp<F,A> {
        private final Higher<F,P> pivot;
        private final FreeAp<F,Function<P,A>> fn;

        @Override
        public <P,R> R fold(Function<? super A, ? extends R> pure, BiFunction<? super Higher<F, P>, FreeAp<F, Function<P, A>>, ? extends R> ap) {
           Higher<F,P> p = (Higher)pivot;
            return (R)ap.apply((Higher<F, P>)pivot, (FreeAp) fn);
         }
    }
    static <F,T> FreeAp<F,T> narrowK(Higher<Higher<freeAp, F>, T> ds){
        return (FreeAp<F,T>)ds;
    }

}


text:
/**
 * \usergroup{SceUdcd}
 * \usage{psp2/udcd.h,SceUdcd_stub}
 */

#ifndef _PSP2_UDCD_H_
#define _PSP2_UDCD_H_

#include <psp2/types.h>

#ifdef __cplusplus
extern "C" {
#endif

/** USB Status */
typedef enum SceUdcdStatus {
	SCE_UDCD_STATUS_CONNECTION_NEW          = 0x0001,
	SCE_UDCD_STATUS_CONNECTION_ESTABLISHED  = 0x0002,
	SCE_UDCD_STATUS_CONNECTION_SUSPENDED    = 0x0004,
	SCE_UDCD_STATUS_CABLE_DISCONNECTED      = 0x0010,
	SCE_UDCD_STATUS_CABLE_CONNECTED         = 0x0020,
	SCE_UDCD_STATUS_DEACTIVATED             = 0x0100,
	SCE_UDCD_STATUS_ACTIVATED               = 0x0200,
	SCE_UDCD_STATUS_IS_CHARGING             = 0x0400,
	SCE_UDCD_STATUS_USE_USB_CHARGING        = 0x0800,
	SCE_UDCD_STATUS_UNKNOWN_1000            = 0x1000,
	SCE_UDCD_STATUS_UNKNOWN_2000            = 0x2000
} SceUdcdStatus;

/** USB Driver status
 */
typedef enum SceUdcdStatusDriver {
	SCE_UDCD_STATUS_DRIVER_STARTED         = 0x01,
	SCE_UDCD_STATUS_DRIVER_REGISTERED      = 0x02
} SceUdcdStatusDriver;

typedef struct {
	uint8_t info[64];
} SceUdcdDeviceInfo;

typedef struct SceUdcdWaitParam {
	int unk_00;
	int status;
	int unk_08;
	int unk_0C;
	int unk_10;
	const char *driverName;
} SceUdcdWaitParam;

typedef struct SceUdcdDeviceState {
	int unk_00;
	int state;
	int cable;
	int connection;
	int use_usb_charging;
	int unk_14;
} SceUdcdDeviceState;

/**
 * Get device state
 *
 * @param[out] state - Device state
 *
 * @return 0 on success, < 0 on error.
*/
int sceUdcdGetDeviceState(SceUdcdDeviceState *state);

/**
 * Get device information
 *
 * @param[out] devInfo - Device information
 *
 * @return 0 on success, < 0 on error.
*/
int sceUdcdGetDeviceInfo(SceUdcdDeviceInfo *devInfo);

/**
 * Get state of a specific USB driver
 *
 * @param driverName - name of USB driver to get status from
 *
 * @return SCE_UDCD_STATUS_DRIVER_STARTED if the driver has been started, SCE_UDCD_STATUS_DRIVER_REGISTERED if it is stopped
 */
int sceUdcdGetDrvState(const char *driverName);

/**
 * Register callback
 *
 * @param[in] cbid - Callback UID
 * @param[in] state - State
 *
 * @return 0 on success, < 0 on error.
*/
int sceUdcdRegisterCallback(SceUID cbid, int state);

/**
 * Unregister callback
 *
 * @param[in] cbid - Callback UID
 *
 * @return 0 on success, < 0 on error.
*/
int sceUdcdUnregisterCallback(SceUID cbid);

/**
 * Wait for state
 *
 * @param[in] waitParam - Wait parameter
 * @param[in] timeout - Timeout
 *
 * @return 0 on success, < 0 on error.
*/
int sceUdcdWaitState(SceUdcdWaitParam *waitParam, unsigned int timeout);

#ifdef __cplusplus
}
#endif

#endif /* _PSP2_UDCD_H_ */


text:
package com.mongodash.client.connector;

import com.mongodash.client.Command;
import com.mongodb.DBObject;

public interface Connector {

	DBObject getData(Command command);

}


text:
chart = [
    "Li",
    "Rb",
    "K",
    "Ba",
    "Sr",
    "Ca",
    "Na",
    "Mg",
    "Al",
    "Mn",
    "Zn",
    "Cr",
    "Fe",
    "Cd",
    "Co",
    "Ni",
    "Sn",
    "Pb",
    "H",
    "Sb",
    "Bi",
    "Cu",
    "Hg",
    "Ag",
    "Pt",
    "Au"
]

quiz = {
    correct : {
        //If the first element is correct
        first : function() {
            $("#firstElement-card").addClass("green");
            $("#firstElement-name").addClass("white-text");
            $("#firstElement-card").addClass("z-depth-5").removeClass("hoverable");
            $("#secondElement-card").addClass("red");
            $("#secondElement-name").addClass("white-text");
        },
        second : function() {
            $("#secondElement-card").addClass("green");
            $("#secondElement-name").addClass("white-text");
            $("#secondElement-card").addClass("z-depth-5").removeClass("hoverable");
            $("#firstElement-card").addClass("red");
            $("#firstElement-name").addClass("white-text");
        },
        reset : function() {
            $("#secondElement-card").removeClass("green red z-depth-5").addClass("hoverable");
            $("#firstElement-card").removeClass("green red z-depth-5").addClass("hoverable");
            $("#firstElement-name").removeClass("white-text");
            $("#secondElement-name").removeClass("white-text");
        }
    },
    click : function(whichOne) {

        //show the correct answer via page
        if (quiz.answer == 1) {
            quiz.correct.first();
        }
        else if (quiz.answer == 2) {
            quiz.correct.second();
        }

        if (whichOne == "firstElement-card") {
            //user chose the first element
            //user chose the second element
            if (quiz.answer == 1) {
                //it's right
                quiz.score.total++;
                quiz.score.right++;
            }
            else {
                //it's wrong
                quiz.score.total++;
                quiz.score.wrong++;
            }
        }
        else if (whichOne == "secondElement-card") {
            //user chose the second element
            if (quiz.answer == 2) {
                //it's right
                quiz.score.total++;
                quiz.score.right++;
            }
            else {
                //it's wrong
                quiz.score.total++;
                quiz.score.wrong++;
            }
        }

        quiz.score.percent = Math.round((quiz.score.right / quiz.score.total) * 100);
        document.getElementById("total").innerHTML = quiz.score.total;
        document.getElementById("right").innerHTML = quiz.score.right;
        document.getElementById("percent").innerHTML = quiz.score.percent;
    },
    answer : 2,
    reload : function() {
        quiz.correct.reset();
        el1 = new Object();
        el2 = new Object();
        el1.num = Math.floor(Math.random() * 25)
        el2.num = Math.floor(Math.random() * 25)

        //just in case
        if (el2 == el1) {
            el2 = Math.floor(Math.random() * 26)
        console.log(number)
        }

        //find their names
        el1.name = chart[(el1.num)]
        el2.name = chart[(el2.num)]

        document.getElementById("firstElement-name").innerHTML = el1.name
        document.getElementById("secondElement-name").innerHTML = el2.name

        //figure out which one is more reactive by looking at which one is closer to the beginning of the list
        if (el1.num > el2.num) {
            //first element is right
            quiz.answer = 2;
        }
        if (el1.num < el2.num) {
            //second element is right
            quiz.answer = 1;
        }
    },
    score : {
        percent : 100,
        total : 0,
        right : 0,
        wrong : 0,
    }
}


text:
package org.apache.camel.openapi.model;

import java.time.Month;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(name = "sampleResponseWithSchema")
public class SampleComplexResponseTypeWithSchemaAnnotation {
    @JsonProperty(required = true)
    private String responseField1 = "Response Field 1";
    private String responseField2 = "Response Field 2";
    private String[] arrayOfStrings;
    private Month month;
    private InnerClass innerClass;

    public String getResponseField1() {
        return responseField1;
    }

    public String getResponseField2() {
        return responseField2;
    }

    @JsonProperty(required = true)
    public String[] getArrayOfStrings() {
        return arrayOfStrings;
    }

    public Month getMonth() {
        return month;
    }

    public InnerClass getInnerClass() {
        return innerClass;
    }

    @Schema(name = "responseInner")
    public static class InnerClass {
        double doubleField;

        public double getDoubleField() {
            return doubleField;
        }
    }
}


text:
#include <stdlib.h>
#include <stdarg.h>
#include "gettext.h"
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif

extern const char *progname;

void set_progname (const char *arg);
void gdbm_perror (const char *fmt, ...);
void sys_perror (int code, const char *fmt, ...);
void error (const char *fmt, ...);
void verror (const char *fmt, va_list ap);

void *emalloc (size_t size);
void *erealloc (void *ptr, size_t size);
void *ecalloc (size_t nmemb, size_t size);
void *ezalloc (size_t size);
char *estrdup (const char *str);

#define PARSEOPT_HIDDEN 0x01
#define PARSEOPT_ALIAS  0x02

struct gdbm_option
{
  int opt_short;
  char *opt_long;
  char *opt_arg;
  char *opt_descr;
  int opt_flags;
};

int parseopt_first (int pc, char **pv, struct gdbm_option *options);
int parseopt_next (void);
void parseopt_print_help (void);

extern char *parseopt_program_name;
extern char *parseopt_program_doc;
extern char *parseopt_program_args;

/* Application exit codes */
#define EXIT_OK      0
#define EXIT_FATAL   1
#define EXIT_MILD    2
#define EXIT_USAGE   3


text:
// ======================================================================
/*!
 * \file NFmiTime.h
 * \brief Interface of class NFmiTime
 */
// ======================================================================

#pragma once

#include "NFmiStaticTime.h"

#include <boost/date_time/local_time/local_date_time.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>

#define DICT_WEEKDAY_MONDAY "WeekdayMonday"
#define DICT_WEEKDAY_TUESDAY "WeekdayTuesday"
#define DICT_WEEKDAY_WEDNESDAY "WeekdayWednesday"
#define DICT_WEEKDAY_THURSDAY "WeekdayThursday"
#define DICT_WEEKDAY_FRIDAY "WeekdayFriday"
#define DICT_WEEKDAY_SATURDAY "WeekdaySaturday"
#define DICT_WEEKDAY_SUNDAY "WeekdaySunday"

#define DICT_MONTH_JANUARY "MonthJanuary"
#define DICT_MONTH_FEBRUARY "MonthFebruary"
#define DICT_MONTH_MARCH "MonthMarch"
#define DICT_MONTH_APRIL "MonthApril"
#define DICT_MONTH_MAY "MonthMay"
#define DICT_MONTH_JUNE "MonthJune"
#define DICT_MONTH_JULY "MonthJuly"
#define DICT_MONTH_AUGUST "MonthAugust"
#define DICT_MONTH_SEPTEMPER "MonthSeptember"
#define DICT_MONTH_OCTOBER "MonthOctober"
#define DICT_MONTH_NOVEMBER "MonthNovember"
#define DICT_MONTH_DECEMBER "MonthDecember"

class NFmiLocation;

//! Undocumented
class NFmiTime : public NFmiStaticTime
{
 public:
  NFmiTime();
  NFmiTime(const NFmiTime &aTime);
  NFmiTime(long datePart, long timePart);

  NFmiTime(short year, short month, short day);
  NFmiTime(short year, short month, short day, short hour, short minute = 0, short sec = 0);

  NFmiTime(const boost::posix_time::ptime &thePosixTime);
  NFmiTime(const boost::local_time::local_date_time &theLocalTime);

  NFmiTime &operator=(const NFmiTime &theTime);

  static void Init(const FmiLanguage theLanguage);

  // HUOM! tämä voi olla hämäävä, koska time_t on integer,
  // (pitäisikö thehdä SetTime-metodi konstruktorin sijaan?)

  explicit NFmiTime(std::time_t theTime);

  // Use always even numbers between 0->12
  // 0 = Real length of the night (not implemented yet)

  bool IsNight(const NFmiLocation &theLocation, unsigned short theResolution = 12);

  // Use always even numbers between 0->12
  // 0 = Real length of the day (not implemented yet)
  bool IsDay(const NFmiLocation &theLocation, unsigned short theResolution = 12);

  void ChangeBySeconds(long seconds);
  void ChangeByMinutes(long minutes);
  void ChangeByHours(long hours);
  void ChangeByDays(long days);

  long DifferenceInMinutes(const NFmiTime &anotherTime) const;
  long DifferenceInHours(const NFmiTime &anotherTime) const;
  long DifferenceInDays(const NFmiTime &anotherTime) const;

  short GetZoneDifferenceHour() const;
  short GetWeekday() const;  // mon=1, tue=2,..., sat=6,  sun=7

  const NFmiString Weekday(const FmiLanguage theLanguage = kFinnish) const;
  const NFmiString MonthName(const FmiLanguage theLanguage = kFinnish) const;

  using NFmiStaticTime::ToStr;

  virtual const NFmiString ToStr(const NFmiString theTimeFormat,
                                 const FmiLanguage theLanguage = kFinnish) const;

  void PrintWeekday() const;
  short GetJulianDay() const;

  virtual const NFmiTime UTCTime(float theLongitude = kFloatMissing) const;
  virtual const NFmiTime UTCTime(const NFmiLocation &theLocation) const;
  virtual const NFmiTime LocalTime(float theLongitude = kFloatMissing) const;
  virtual const NFmiTime LocalTime(const NFmiLocation &theLocation) const;

  virtual void SetLocalPlace(float theLongitude);

  static short DaysInYear(short aYear);
  static short DaysInMonth(short aMonth, short aYear);

  long GetCompareValue() const;

 protected:
  void DecodeCompareValue(long aCompareValue);
  void SetZoneDifferenceHour();
  short CalcZoneDifferenceHour(float theLongitude) const;
  const NFmiString RelativeDay(FmiLanguage theLanguage,
                               NFmiString theFormat,
                               int &thePlusInd) const;

  static std::string GetDictionaryString(const char *theMagicWord);

 private:
  short itsZoneDifferenceHour;

};  // class NFmiTime

//! Undocumented, should be removed
typedef NFmiTime *PTFmiTime;

//! Undocumented, should be removed
typedef NFmiTime TFmiTime;

// ----------------------------------------------------------------------
/*!
 * Void constructor
 */
// ----------------------------------------------------------------------

inline NFmiTime::NFmiTime() : NFmiStaticTime(), itsZoneDifferenceHour()
{
  SetZoneDifferenceHour();
}

// ----------------------------------------------------------------------
/*!
 * Copy constructor
 *
 * \param aTime The object being copied
 */
// ----------------------------------------------------------------------

inline NFmiTime::NFmiTime(const NFmiTime &aTime)
    : NFmiStaticTime(aTime), itsZoneDifferenceHour(aTime.itsZoneDifferenceHour)
{
}

// ----------------------------------------------------------------------
/*!
 * Constructor
 *
 * \param year Undocumented
 * \param month Undocumented
 * \param day Undocumented
 */
// ----------------------------------------------------------------------

inline NFmiTime::NFmiTime(short year, short month, short day)
    : NFmiStaticTime(year, month, day), itsZoneDifferenceHour()
{
  SetZoneDifferenceHour();
}

// ----------------------------------------------------------------------
/*!
 * Constructor
 *
 * \param year Undocumented
 * \param month Undocumented
 * \param day Undocumented
 * \param hour Undocumented
 * \param minute Undocumented
 * \param sec Undocumented
 */
// ----------------------------------------------------------------------

inline NFmiTime::NFmiTime(short year, short month, short day, short hour, short minute, short sec)
    : NFmiStaticTime(year, month, day, hour, minute, sec), itsZoneDifferenceHour()
{
  SetZoneDifferenceHour();
}

// ----------------------------------------------------------------------
/*!
 * \param minutes Undocumented
 */
// ----------------------------------------------------------------------

inline void NFmiTime::ChangeByMinutes(long minutes)
{
  if (minutes)
    DecodeCompareValue(GetCompareValue() + minutes);
}

// ----------------------------------------------------------------------
/*!
 * \param hours Undocumented
 */
// ----------------------------------------------------------------------

inline void NFmiTime::ChangeByHours(long hours)
{
  if (hours)
    DecodeCompareValue(GetCompareValue() + 60L * hours);
}

// ----------------------------------------------------------------------
/*!
 * \param days Undocumented
 */
// ----------------------------------------------------------------------

inline void NFmiTime::ChangeByDays(long days)
{
  if (days)
    DecodeCompareValue(GetCompareValue() + 60L * 24L * days);
}

// ----------------------------------------------------------------------
/*!
 * \param anotherTime Undocumented
 * \return Undocumented
 */
// ----------------------------------------------------------------------

inline long NFmiTime::DifferenceInMinutes(const NFmiTime &anotherTime) const
{
  return (GetCompareValue() - anotherTime.GetCompareValue());
}

// ----------------------------------------------------------------------
/*!
 * \param anotherTime Undocumented
 * \return Undocumented
 */
// ----------------------------------------------------------------------

inline long NFmiTime::DifferenceInHours(const NFmiTime &anotherTime) const
{
  return (DifferenceInMinutes(anotherTime) / 60L);
}

// ----------------------------------------------------------------------
/*!
 * \param anotherTime Undocumented
 * \return Undocumented
 */
// ----------------------------------------------------------------------

inline long NFmiTime::DifferenceInDays(const NFmiTime &anotherTime) const
{
  return (DifferenceInMinutes(anotherTime) / 60L / 24L);
}

// ----------------------------------------------------------------------
/*!
 * \return Undocumented
 */
// ----------------------------------------------------------------------

inline short NFmiTime::GetZoneDifferenceHour() const
{
  return itsZoneDifferenceHour;
}

// ======================================================================


text:
//
// Go-FTL
//
// Copyright (C) Philip Schlump, 2014-2016
//
// Do not remove the following lines - used in auto-update.
// Version: 0.5.9
// BuildNo: 1811
// FileId: 1235
//

package Latency

import (
	"fmt"
	"net/http"
	"net/http/httptest"
	"os"
	"testing"
	"time"

	"github.com/pschlump/Go-FTL/server/cfg"
	"github.com/pschlump/Go-FTL/server/goftlmux"
	"github.com/pschlump/Go-FTL/server/lib"
	"github.com/pschlump/Go-FTL/server/mid"
	"github.com/pschlump/Go-FTL/server/tr"
)

// -----------------------------------------------------------------------------------------------------------------------------------------------
func Test_LatencyServer(t *testing.T) {

	if !cfg.SetupRedisForTest("../test_redis.json") {
		return
	}

	tests := []struct {
		url          string
		expectedCode int
		expectSlow   bool
	}{
		{
			"http://example.com/foo?abc=def",
			http.StatusOK,
			false,
		},
		{
			"http://example.com/index.html",
			http.StatusOK,
			true,
		},
	}

	bot := mid.NewServer()
	var err error
	lib.SetupTestCreateDirs()
	ms := NewLatencyServer(bot, []string{"/index.html"}, 2000)

	fmt.Printf("Expect test to take serveral seconds\n")

	for ii, test := range tests {

		rec := httptest.NewRecorder()

		wr := goftlmux.NewMidBuffer(rec, nil)

		id := "test-01-StatusHandler"
		trx := tr.NewTrx(cfg.ServerGlobal.RedisPool)
		trx.TrxIdSeen(id, test.url, "GET")
		wr.RequestTrxId = id

		wr.G_Trx = trx

		var req *http.Request

		req, err = http.NewRequest("GET", test.url, nil)
		if err != nil {
			t.Fatalf("Test %d: Could not create HTTP request: %v", ii, err)
		}
		lib.SetupTestMimicReq(req, "example.com")

		if db4 {
			fmt.Printf("{\"req\":%s,\n\"wr\":%s}\n", lib.SVarI(req), lib.SVarI(wr))
		}

		start := time.Now()

		if db4 {
			fmt.Fprintf(os.Stderr, "bef: %s\n", test.url)
		}
		ms.ServeHTTP(wr, req)
		if db4 {
			fmt.Fprintf(os.Stderr, "aft: %s\n", test.url)
		}

		elapsed := time.Since(start)

		if test.expectSlow {
			if elapsed < ((2000 - 1) * time.Millisecond) {
				t.Errorf("Error %2d, did not slow request down got: %.4f seconds, expected %.4f\n", ii, elapsed.Seconds(), (2000 * time.Millisecond).Seconds())
			}
		}

		// Tests to perform on final recorder data.
		if wr.StatusCode != test.expectedCode {
			t.Errorf("Error %2d, reject error got: %d, expected %d\n", ii, wr.StatusCode, test.expectedCode)
		}

		// xyzzy - test the output in ./test.out.out

	}

}

const db4 = false

/* vim: set noai ts=4 sw=4: */


text:
package server

import (
	"fmt"
	"io"
	"log"
	"net/http"

	"github.com/zyfdegh/hiupdate/server/api"
	"github.com/zyfdegh/hiupdate/server/conf"
)

var port = conf.OptionsReady.Port

// Serve do router mapping and start http server
func Serve() {
	http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))

	http.HandleFunc("/", handleRoot)
	http.HandleFunc("/record/", handleRecord)
	http.HandleFunc("/report/", handleReport)
	http.HandleFunc("/persons/forgot/", handlePersonsForgot)

	s := &http.Server{Addr: fmt.Sprintf(":%d", port)}
	log.Printf("server start on localhost:%d", port)
	if err := s.ListenAndServe(); err != nil {
		log.Fatalf("start server error: %v", err)
	}
}

func handleRoot(w http.ResponseWriter, req *http.Request) {
	http.ServeFile(w, req, "static/html/index.html")
}

func handleRecord(w http.ResponseWriter, req *http.Request) {
	switch req.Method {
	case http.MethodGet:
		api.GetRecord(w, req)
	case http.MethodPut:
		api.PutRecord(w, req)
	default:
		io.WriteString(w, "method not allowed")
	}
	return
}

// GET /report?date=20160825
func handleReport(w http.ResponseWriter, req *http.Request) {
	switch req.Method {
	case http.MethodGet:
		api.GetReport(w, req)
	default:
		io.WriteString(w, "method not allowed")
	}
	return
}

func handlePersonsForgot(w http.ResponseWriter, req *http.Request) {
	switch req.Method {
	case http.MethodGet:
		api.GetForgotPersons(w, req)
	default:
		io.WriteString(w, "method not allowed")
	}
	return
}


text:
{% extends "base.html" %}

{% load i18n humanize tz %}

{% block head_title %}{{ author.username }}'s referrals{% endblock %}

{% block body %}

 {{ author.username }}'s referrals

             Title
             Actions
             Added
             Active
             Views
             Yay
             Nay
             Usage
             Validity

            {% for referral in referral_list %}

                        {{ referral.title }}

                        {% if request.user == referral.author %}
                            {% include 'referrals/_action_buttons.html' %}
                        {% else %}
                            {% include 'referrals/_yayornay_form.html' %}
                        {% endif %}

                    {{ referral.created_at|date:"Y-m-d H:i:s" }}{{ referral.created_at|naturaltime}}

                        {% if referral.is_active %}

                        {% else %}

                        {% endif %}

                    {{ referral.view_count }}
                    {{ referral.yay }}
                    {{ referral.nay }}
                    {{ referral.usage_count }}
                    {{ referral.validity|timeuntil|default:'n/a' }}

        {% endfor %}

{% endblock %}


text:
module Fog
  module Compute
    class Ecloud
      class VirtualMachineAssignedIp < Fog::Ecloud::Model
        identity :href

        attribute :network, :aliases => :Networks
        attribute :address

        def id
          href.scan(/\d+/)[0]
        end

        def network=(network)
          network = network.dup
          network_address = network[:Network]
          @network = self.service.networks.new(network_address)
          network_id = @network.href.match(/(\d+)$/)[1]
          address_ip = network_address[:IpAddresses][:IpAddress]
          @address = self.service.ip_addresses.new(
            :href => "/cloudapi/ecloud/ipaddresses/networks/#{network_id}/#{address_ip}",
            :name => address_ip
          )
        end
        attr_reader :network

        def address=(address); end
        attr_reader :address
      end
    end
  end
end


text:
/* ------------------------------------------------------------------------------
** _________   _________      ________    _____      _____  ___________ _________
** \_   ___ \ /   _____/     /  _____/   /  _  \    /     \ \_   _____//   _____/
** /    \  \/ \_____  \     /   \  ___  /  /_\  \  /  \ /  \ |    __)_ \_____  \
** \     \____/        \    \    \_\  \/    |    \/    Y    \|        \/        \
**  \______  /_______  /     \______  /\____|__  /\____|__  /_______  /_______  /
**        \/        \/             \/         \/         \/        \/        \/
**
** NetCommandController.cpp
** Implementation of NetCommandController
**
** Author: Samuel-Ricardo Carriere
** ------------------------------------------------------------------------------*/

#include "NetCommandController.h"

NetCommandController::NetCommandController(NetPlayerController* netPlayerController)
{
	this->netPlayerController = netPlayerController;
	mState = Command::Init;
	mType = Command::None;
	x = 0;
	z = 0;
	playerId = 0;
	characterId = 0;
	description = "";
	playerName = "";
	characterCount = 0;

	for( int i=0; i<maxCharacter; ++i)
	{
		characterNames[i] = "";
	}
}

void NetCommandController::UpdateStateMachine(char* token)
{
	bool bIsDigit = true;

	switch(mState)
	{
	case Command::Init:
		if(!strcmp(token, "Error"))
		{
			mType = Command::Error;
			mState = Command::WaitingDescription;
		}
		else if(!strcmp(token, "Disconnect"))
		{
			mType = Command::Disconnect;
			mState = Command::WaitingPlayerId;
		}
		else if(!strcmp(token, "AddPlayer"))
		{
			mType = Command::AddPlayer;
			mState = Command::WaitingPlayerName;
		}
		else if(!strcmp(token, "Move"))
		{
			mType = Command::Move;
			mState = Command::WaitingPosX;
		}
		break;

	case Command::WaitingDescription:
		description = token;

		if(mType == Command::Error)
		{
			Error();
		}
		mState = Command::Init;
		mType = Command::None;
		break;

	case Command::WaitingPosX:
		for (int i = (int) strlen(token)-1; i > 0; i--)
			if (!isdigit(token[i]))
			{
				bIsDigit = false;
				break;
			}

		if(bIsDigit)
		{
			x = atoi(token);
			mState = Command::WaitingPosZ;
		}
		else
		{
			mState = Command::Init;
		}
		break;

	case Command::WaitingPosZ:
		for (int i = (int) strlen(token)-1; i > 0; i--)
			if (!isdigit(token[i]))
			{
				bIsDigit = false;
				break;
			}

		if(bIsDigit)
		{
			z = atoi(token);
			mState = Command::WaitingCharacterId;
		}
		else
		{
			mState = Command::Init;
		}
		break;

	case Command::WaitingCharacterId:
		for (int i = (int) strlen(token)-1; i > 0; i--)
			if (!isdigit(token[i]))
			{
				bIsDigit = false;
				break;
			}

		if(bIsDigit)
		{
			characterId = atoi(token);
			mState = Command::WaitingPlayerId;
		}
		else
		{
			mState = Command::Init;
			mType = Command::None;
		}
		break;

	case Command::WaitingPlayerName:
		playerName = token;
		mState = Command::WaitingCharacterName;
		characterCount = 0;
		break;

	case Command::WaitingCharacterName:
		characterNames[characterCount++] = token;

		if(characterCount > maxCharacter-1)
		{
			mState = Command::WaitingPlayerId;
		}
		break;

	case Command::WaitingPlayerId:
		for (int i = (int) strlen(token)-1; i > 0; i--)
			if (!isdigit(token[i]))
			{
				bIsDigit = false;
				break;
			}

		if(bIsDigit)
		{
			playerId = atoi(token);
			if(mType == Command::AddPlayer)
				AddPlayer();
			else if (mType == Command::Move)
				MoveCharacter();
			else if (mType == Command::Disconnect)
				Disconnect();
		}

		mState = Command::Init;
		mType = Command::None;
		break;
	}
}

void NetCommandController::Error()
{
	std::cout << "Error :" << description << std::endl;
}

void NetCommandController::Disconnect()
{
	std::cout << "Player " << playerId << " disconnected from the game" << std::endl;

	netPlayerController->quitPlayer(playerId);
}

void NetCommandController::AddPlayer()
{
	std::cout << "Player " << playerId << " join with name " << playerName << std::endl;
	for( int i=0; i<maxCharacter; ++i)
	{
		std::cout << "    * Character " << characterNames[i] << " enter the battlefield" << std::endl;
	}

	netPlayerController->addPlayer(playerId, playerName, characterNames);
}

void NetCommandController::MoveCharacter()
{
	std::cout << "Player " << playerId << " move character " << characterId <<
				 " to (" << x << "," << z << ")" << std::endl;

	netPlayerController->moveCharacter(playerId, characterId, x, z);
}

void NetCommandController::OkForExit()
{
	std::cout << "You are ok to disconnect!" << std::endl;

	// TODO: check what to do here
}


text:
package org.gradoop.examples.io;

import org.apache.flink.api.common.ProgramDescription;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.gradoop.examples.AbstractRunner;
import org.gradoop.flink.io.impl.dot.DOTDataSink;
import org.gradoop.flink.io.impl.dot.functions.DOTFileFormat;
import org.gradoop.flink.io.impl.json.JSONDataSource;
import org.gradoop.flink.model.api.epgm.GraphCollection;
import org.gradoop.flink.util.GradoopFlinkConfig;

/**
 * Example program that reads a graph from an EPGM-specific JSON representation
 * into a {@link GraphCollection} and stores the
 * resulting {@link GraphCollection} as DOT.
 * The resulting format is described in {@link DOTFileFormat}.
 */
public class DOTExample extends AbstractRunner implements ProgramDescription {

  /**
   * Reads an EPGM graph collection from a directory that contains the separate
   * files. Files can be stored in local file system or HDFS.
   *
   * args[0]: path to graph head file
   * args[1]: path to vertex file
   * args[2]: path to edge file
   * args[3]: path to write output graph
   * args[4]: flag to write graph head information
   *
   * @param args program arguments
   */
  public static void main(String[] args) throws Exception {
    if (args.length != 5) {
      throw new IllegalArgumentException(
        "provide graph/vertex/edge paths, output directory and flag to print " +
          "graph head information (true/false)");
    }

    final String graphHeadFile         = args[0];
    final String vertexFile            = args[1];
    final String edgeFile              = args[2];
    final String outputDir             = args[3];
    final String graphHeadInformation  = args[4];

    // init Flink execution environment
    ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    // create default Gradoop config
    GradoopFlinkConfig config = GradoopFlinkConfig.createConfig(env);

    // create DataSource
    JSONDataSource dataSource =
      new JSONDataSource(graphHeadFile, vertexFile, edgeFile, config);

    // create DataSink
    DOTDataSink dataSink =
      new DOTDataSink(outputDir, Boolean.parseBoolean(graphHeadInformation));

    // write dot format
    dataSink.write(dataSource.getGraphCollection());

    // execute program
    env.execute();
  }

  @Override
  public String getDescription() {
    return DOTExample.class.getName();
  }
}


text:
'use strict';

define(['app'], function(app) {
    app.controller('ContactCtrl', ['$location', '$scope', 'contactService', 'settingsService', 'notify', 'Environment',
        function($location, $scope, contactService, settingsService, notify, Environment) {

            $scope.config = false;

            settingsService.getApplicationConfig().success(
                function(data, status) {
                    var locale = Environment.currentLocale();
                    $scope.config = data.settings[locale].contact;
                }
            );

            // Submit Contact
            $scope.submitContact = function(form) {
                if (form.$valid) {
                    contactService.send(form).success(
                        function(data, status) {
                            notify(data.message);
                        }
                    );
                }
            };

        }
    ]);
});


text:
package com.jme3.renderer.lwjgl;

import com.jme3.renderer.RendererException;
import com.jme3.renderer.opengl.GLFbo;
import java.nio.Buffer;
import java.nio.IntBuffer;
import org.lwjgl.opengl.GL30;

/**
 * Implements GLFbo via OpenGL3+.
 *
 * @author Kirill Vainer
 */
public final class LwjglGLFboGL3 implements GLFbo {

    private static void checkLimit(Buffer buffer) {
        if (buffer == null) {
            return;
        }
        if (buffer.limit() == 0) {
            throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error");
        }
        if (buffer.remaining() == 0) {
            throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error");
        }
    }

    @Override
    public void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) {
        GL30.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
    }

    @Override
    public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) {
        GL30.glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
    }

    @Override
    public void glBindFramebufferEXT(int param1, int param2) {
        GL30.glBindFramebuffer(param1, param2);
    }

    @Override
    public void glBindRenderbufferEXT(int param1, int param2) {
        GL30.glBindRenderbuffer(param1, param2);
    }

    @Override
    public int glCheckFramebufferStatusEXT(int param1) {
        return GL30.glCheckFramebufferStatus(param1);
    }

    @Override
    public void glDeleteFramebuffersEXT(IntBuffer param1) {
        checkLimit(param1);
        GL30.glDeleteFramebuffers(param1);
    }

    @Override
    public void glDeleteRenderbuffersEXT(IntBuffer param1) {
        checkLimit(param1);
        GL30.glDeleteRenderbuffers(param1);
    }

    @Override
    public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) {
        GL30.glFramebufferRenderbuffer(param1, param2, param3, param4);
    }

    @Override
    public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) {
        GL30.glFramebufferTexture2D(param1, param2, param3, param4, param5);
    }

    @Override
    public void glGenFramebuffersEXT(IntBuffer param1) {
        checkLimit(param1);
        GL30.glGenFramebuffers(param1);
    }

    @Override
    public void glGenRenderbuffersEXT(IntBuffer param1) {
        checkLimit(param1);
        GL30.glGenRenderbuffers(param1);
    }

    @Override
    public void glGenerateMipmapEXT(int param1) {
        GL30.glGenerateMipmap(param1);
    }

    @Override
    public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) {
        GL30.glRenderbufferStorage(param1, param2, param3, param4);
    }

    @Override
    public void glFramebufferTextureLayerEXT(int param1, int param2, int param3, int param4, int param5) {
        GL30.glFramebufferTextureLayer(param1, param2, param3, param4, param5);
    }
}


text:
package org.workcraft.gui;

import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;

import org.workcraft.Framework;
import org.workcraft.annotations.Annotations;
import org.workcraft.dom.visual.SizeHelper;
import org.workcraft.dom.visual.VisualModel;
import org.workcraft.gui.events.GraphEditorKeyEvent;
import org.workcraft.gui.graph.GraphEditorPanel;
import org.workcraft.gui.graph.generators.DefaultNodeGenerator;
import org.workcraft.gui.graph.tools.CustomToolsProvider;
import org.workcraft.gui.graph.tools.GraphEditorKeyListener;
import org.workcraft.gui.graph.tools.GraphEditorTool;
import org.workcraft.gui.graph.tools.NodeGeneratorTool;
import org.workcraft.gui.graph.tools.ToolProvider;

public class Toolbox implements ToolProvider, GraphEditorKeyListener {

    class ToolTracker {
        ArrayList<GraphEditorTool> tools = new ArrayList<>();
        int nextIndex = 0;

        public void addTool(GraphEditorTool tool) {
            tools.add(tool);
            nextIndex = 0;
        }

        public void reset() {
            nextIndex = 0;
        }

        public GraphEditorTool getNextTool() {
            GraphEditorTool ret = tools.get(nextIndex);
            setNext(nextIndex + 1);
            return ret;
        }

        private void setNext(int next) {
            if (next >= tools.size()) {
                next %= tools.size();
            }
            nextIndex = next;
        }

        public void track(GraphEditorTool tool) {
            setNext(tools.indexOf(tool) + 1);
        }
    }

    private final GraphEditorPanel editor;
    private final HashSet<GraphEditorTool> tools = new HashSet<>();
    private final LinkedHashMap<GraphEditorTool, JToggleButton> buttons = new LinkedHashMap<>();
    private final HashMap<Integer, ToolTracker> hotkeyMap = new HashMap<>();
    private GraphEditorTool defaultTool = null;
    private GraphEditorTool selectedTool = null;

    public Toolbox(GraphEditorPanel editor) {
        this.editor = editor;
        VisualModel model = editor.getModel();
        Class<? extends CustomToolsProvider> customTools = Annotations.getCustomToolsProvider(model.getClass());
        if (customTools != null) {
            boolean isDefault = true;
            CustomToolsProvider provider = null;
            try {
                provider = customTools.getConstructor().newInstance();
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (provider != null) {
                for (GraphEditorTool tool : provider.getTools()) {
                    addTool(tool, isDefault);
                    isDefault = false;
                }
            }
        }

        for (Class<?> cls : Annotations.getDefaultCreateButtons(model.getClass())) {
            NodeGeneratorTool tool = new NodeGeneratorTool(new DefaultNodeGenerator(cls));
            addTool(tool, false);
        }

        for (Class<? extends GraphEditorTool>  tool : Annotations.getCustomTools(model.getClass())) {
            try {
                addTool(tool.newInstance(), false);
            } catch (InstantiationException | IllegalAccessException e) {
                throw new RuntimeException(e);
            }
        }
        selectedTool = defaultTool;
        setToolButtonSelection(selectedTool, true);
    }

    private void addTool(final GraphEditorTool tool, boolean isDefault) {
        tools.add(tool);
        if (tool.requiresButton()) {
            JToggleButton button = createToolButton(tool);
            buttons.put(tool, button);
        }
        assignToolHotKey(tool, tool.getHotKeyCode());
        if (isDefault) {
            defaultTool = tool;
        }
    }

    private void assignToolHotKey(final GraphEditorTool tool, int hotKeyCode) {
        if (hotKeyCode != -1) {
            ToolTracker tracker = hotkeyMap.get(hotKeyCode);
            if (tracker == null) {
                tracker = new ToolTracker();
                hotkeyMap.put(hotKeyCode, tracker);
            }
            tracker.addTool(tool);
        }
    }

    private JToggleButton createToolButton(final GraphEditorTool tool) {
        JToggleButton button = new JToggleButton();

        button.setFocusable(false);
        button.setHorizontalAlignment(SwingConstants.LEFT);
        button.setMargin(new Insets(0, 0, 0, 0));

        int iconSize = SizeHelper.getToolIconSize();
        Insets insets = button.getInsets();
        int minSize = iconSize + Math.max(insets.left + insets.right, insets.top + insets.bottom);

        Icon icon = tool.getIcon();
        if (icon == null) {
            button.setText(tool.getLabel());
            button.setPreferredSize(new Dimension(120, minSize));
        } else {
            BufferedImage crop = new BufferedImage(iconSize, iconSize,
                    BufferedImage.TYPE_INT_ARGB);
            int x = (iconSize - icon.getIconWidth()) / 2;
            int y = (iconSize - icon.getIconHeight()) / 2;
            icon.paintIcon(button, crop.getGraphics(), x, y);
            button.setIcon(new ImageIcon(crop));
            button.setPreferredSize(new Dimension(minSize, minSize));
        }

        int hotKeyCode = tool.getHotKeyCode();
        if (hotKeyCode != -1) {
            button.setToolTipText(tool.getLabel() + " (" + Character.toString((char) hotKeyCode) + ")");
        } else {
            button.setToolTipText(tool.getLabel());
        }
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                selectTool(tool);
            }
        });
        return button;
    }

    @SuppressWarnings("unchecked")
    public <T extends GraphEditorTool> T getToolInstance(Class<T> cls) {
        for (GraphEditorTool tool : tools) {
            if (cls == tool.getClass()) {
                return (T) tool;
            }
        }
        for (GraphEditorTool tool : tools) {
            if (cls.isInstance(tool)) {
                return (T) tool;
            }
        }
        return null;
    }

    public <T extends GraphEditorTool> T selectToolInstance(Class<T> cls) {
        final T tool = getToolInstance(cls);
        if (tool != null) {
            selectTool(tool);
            return (T) tool;
        }
        return null;
    }

    public void selectTool(GraphEditorTool tool) {
        if (selectedTool != null) {
            ToolTracker oldTracker = hotkeyMap.get(selectedTool.getHotKeyCode());
            if (oldTracker != null) {
                oldTracker.reset();
            }
            selectedTool.deactivated(editor);
            setToolButtonSelection(selectedTool, false);
        }
        ToolTracker tracker = hotkeyMap.get(tool.getHotKeyCode());
        if (tracker != null) {
            tracker.track(tool);
        }
        // Setup and activate the selected tool (before updating Property editor and Tool controls).
        selectedTool = tool;
        setToolButtonSelection(selectedTool, true);
        selectedTool.activated(editor);
        // Update the content of Property editor (first) and Tool controls (second).
        editor.updatePropertyView();
        editor.updateToolsView();
        // Update visibility of Property editor and Tool controls.
        final Framework framework = Framework.getInstance();
        final MainWindow mainWindow = framework.getMainWindow();
        mainWindow.updateDockableWindowVisibility();
    }

    public void setToolsForModel(JToolBar toolbar) {
        for (JToggleButton button: buttons.values()) {
            toolbar.add(button);
        }
        // FIXME: Add separator to force the same toolbar height as the tool controls and global toolbars.
        toolbar.addSeparator();
    }

    @Override
    public GraphEditorTool getDefaultTool() {
        return defaultTool;
    }

    @Override
    public GraphEditorTool getSelectedTool() {
        return selectedTool;
    }

    @Override
    public boolean keyPressed(GraphEditorKeyEvent event) {
        if (selectedTool.keyPressed(event)) {
            return true;
        }
        int keyCode = event.getKeyCode();
        if (keyCode == KeyEvent.VK_ESCAPE) {
            selectTool(defaultTool);
            return true;
        }
        if (!event.isAltKeyDown() && !event.isMenuKeyDown() && !event.isShiftKeyDown()) {
            ToolTracker tracker = hotkeyMap.get(keyCode);
            if (tracker != null) {
                GraphEditorTool tool = tracker.getNextTool();
                selectTool(tool);
                return true;
            }
        }
        return false;
    }

    @Override
    public boolean keyReleased(GraphEditorKeyEvent event) {
        return selectedTool.keyReleased(event);
    }

    @Override
    public boolean keyTyped(GraphEditorKeyEvent event) {
        return selectedTool.keyTyped(event);
    }

    public void setToolButtonEnableness(GraphEditorTool tool, boolean state) {
        JToggleButton button = buttons.get(tool);
        if (button != null) {
            button.setEnabled(state);
        }
    }

    public void setToolButtonSelection(GraphEditorTool tool, boolean state) {
        JToggleButton button = buttons.get(tool);
        if (button != null) {
            button.setSelected(state);
        }
    }

}


text:
#info {
	position:absolute;
	display:none;
	width:359px;
	/* It is important to define this width */
	z-index:500;
	padding:0;
}

#infoContents {
	 float:left;
	 width:305px;
	 min-height:120px;
	 background-color:#262626; /* This color is the one used in the arrows! */
	 margin:0;
	 padding:15px;
	 color:#FFFFFF;

	 border-radius:15px;
}

#infoName {
	 color:#BF3731;
	 font-weight:bold;
}

#infoDescription {
	 margin-left:10px;
	 border-left:2px solid #BF3731;
	 padding-left:20px;
	 padding-right:20px;
	 text-align: justify;
}

#infoExtra {
	font-family:Helvetica;
}

#leftArrow {
	 float:left;
	 margin:0;
	 margin-top:50px;
	 width:24px;
}

#rightArrow {
	 float:left;
	 margin:0;
	 margin-top:50px;
	 display:none;
	 width:24px;
}


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'TournamentPlayer.paypal_payer_id'
        db.add_column(u'tournament_tournamentplayer', 'paypal_payer_id',
                      self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True),
                      keep_default=False)

    def backwards(self, orm):
        # Deleting field 'TournamentPlayer.paypal_payer_id'
        db.delete_column(u'tournament_tournamentplayer', 'paypal_payer_id')

    models = {
        u'auth.group': {
            'Meta': {'object_name': 'Group'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'auth.permission': {
            'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'sites.site': {
            'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'tournament.player': {
            'Meta': {'object_name': 'Player'},
            'country': ('django_countries.fields.CountryField', [], {'max_length': '2'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'pdga_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'pdga_rating': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'phonenumber': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'})
        },
        u'tournament.playerclass': {
            'Meta': {'object_name': 'PlayerClass'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '300'})
        },
        u'tournament.registrationstage': {
            'Meta': {'object_name': 'RegistrationStage'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'opens': ('django.db.models.fields.DateTimeField', [], {}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"})
        },
        u'tournament.registrationstageclass': {
            'Meta': {'object_name': 'RegistrationStageClass'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'player_class': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.PlayerClass']"}),
            'rating_required': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
            'registration_stage': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.RegistrationStage']"})
        },
        u'tournament.tournament': {
            'Meta': {'object_name': 'Tournament'},
            'classes': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['tournament.PlayerClass']", 'symmetrical': 'False'}),
            'currency': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
            'enable_payments': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'google_analytics_account': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
            'header_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '5'}),
            'max_players': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '72'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'payment_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'paypal_client_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'null': 'True', 'blank': 'True'}),
            'paypal_mode': ('django.db.models.fields.CharField', [], {'default': "'live'", 'max_length': '10', 'null': 'True', 'blank': 'True'}),
            'paypal_secret': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'null': 'True', 'blank': 'True'}),
            'pdga_rules_approval': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'registration_ends': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'registration_opens': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'registration_stages': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'start_date': ('django.db.models.fields.DateField', [], {}),
            'tournament_admin_email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
            'wildcard_spots': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'})
        },
        u'tournament.tournamentadmin': {
            'Meta': {'object_name': 'TournamentAdmin'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
        },
        u'tournament.tournamentclassprice': {
            'Meta': {'object_name': 'TournamentClassPrice'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'player_class': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.PlayerClass']"}),
            'price': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"})
        },
        u'tournament.tournamentnewsitem': {
            'Meta': {'ordering': "['-created']", 'object_name': 'TournamentNewsItem'},
            'body': ('ckeditor.fields.RichTextField', [], {}),
            'created': ('django.db.models.fields.DateTimeField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'introduction': ('ckeditor.fields.RichTextField', [], {}),
            'is_published': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'published': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
        },
        u'tournament.tournamentoption': {
            'Meta': {'object_name': 'TournamentOption'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'price': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '2'}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"})
        },
        u'tournament.tournamentpage': {
            'Meta': {'ordering': "['navigation_position']", 'object_name': 'TournamentPage'},
            'body': ('ckeditor.fields.RichTextField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'navigation_position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'show_in_navigation': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"})
        },
        u'tournament.tournamentplayer': {
            'Meta': {'ordering': "['player_class', '-player__pdga_rating']", 'object_name': 'TournamentPlayer'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_paid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_pending_payment': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_waiting_list': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['tournament.TournamentOption']", 'symmetrical': 'False', 'blank': 'True'}),
            'paypal_payer_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
            'paypal_payment_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
            'player': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Player']"}),
            'player_class': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.PlayerClass']"}),
            'registered': ('django.db.models.fields.DateTimeField', [], {}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"})
        },
        u'tournament.tournamentsite': {
            'Meta': {'object_name': 'TournamentSite'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'site': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['sites.Site']"}),
            'tournament': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['tournament.Tournament']"})
        }
    }

    complete_apps = ['tournament']


text:
import { Component, Input, OnInit } from '@angular/core';
import { AI } from '../model/ai'
import { Generator } from '../model/generator'
import { SFService } from '../services/sf.service'
import { NetService } from '../services/net.service'

@Component({
    moduleId: 'app/music/',
    selector: 'app-ai-detail',
    templateUrl: './ai-detail.html'

})

export class AIDetailComponent implements OnInit {
    @Input() ai: AI;

    aiName: any = null
    nHidden: Array<number> = []

    constructor(private netService: NetService) {

    }

    ngOnInit() {
        console.log('NGINIT')
        for (const name in this.netService.types) {

            if (name === this.ai.net.netname) {
                this.aiName = name
                console.log('DONE')
            }
        }
        this.nHidden = this.ai.net.nHidden
        //  console.log('HELLO'+this.ai.out)
    }

    implant() {
        this.ai.implant({ type: this.aiName , nHidden: this.nHidden })
    }
}