text:
var alexa = require('alexa-app');
var ssml = require('./refs/ssml');
var chai = require('chai');
var should = chai.should();

// App modules
var intentHandler = require('../src/intentHandler');
var prompts = require('../src/prompts');
var utility = require('../src/utility');

// Used to persist the session between tests involving multiple requests.
var sessionAttributes;

// Required for building requests in full intent tests.
var requestData = {
    "version": "1.0",
    "session": {
        "new": false,
        "sessionId": "amzn1.echo-api.session.abeee1a7-aee0-41e6-8192-e6faaed9f5ef",
        "application": {
        "applicationId": "amzn1.echo-sdk-ams.app.000000-d0ed-0000-ad00-000000d00ebe"
        },
        "attributes": {},
        "user": {
        "userId": "amzn1.account.AM3B227HF3FAM1B261HK7FFM3A2"
        }
    },
    "request": {
        "type": "IntentRequest",
        "requestId": "amzn1.echo-api.request.6919844a-733e-4e89-893a-fdcb77e2ef0d",
        "timestamp": "2015-05-13T12:34:56Z",
        "intent": {}
    }
};

function getRequestData() {
    // Create a new copy of request data and return it.
    return JSON.parse(JSON.stringify(requestData));
}

describe('intentHandler', function() {
    describe('on launch', function() {
        // Trigger the launch function
        var response = new alexa.response();
        var request = new alexa.request(getRequestData());
        intentHandler.launch(request, response);

        // Get the speech response
        var speechResponse = response.response.response;
        var prompt = speechResponse.outputSpeech;
        var reprompt = speechResponse.reprompt.outputSpeech;
        var shouldEndSession = speechResponse.shouldEndSession;
        sessionAttributes = request.sessionAttributes;

        it('should have a prompt', function () {
            should.exist(prompt);
            prompt.type.should.equal('SSML');
        });

        it('should have correct "launch" prompt', function () {
            var expected = ssml.fromStr(prompts.launch.prompt)
            prompt.ssml.should.equal(expected);
        });

        it('should have a reprompt', function () {
            should.exist(reprompt);
            reprompt.type.should.equal('SSML');
        });

        it('should have correct "launch" reprompt', function () {
            var expected = ssml.fromStr(prompts.launch.reprompt);
            reprompt.ssml.should.equal(expected);
        });

        it('should not end the session', function() {
            shouldEndSession.should.equal(false);
        });

        context('and then invoking built-in intents', function() {
            // Prepare to invoke another intent

            // Copy session variables from the launch response to the new request data
            // (to simulate persisting the session for a subsequent call).
            var requestDataCopy = getRequestData();
            requestDataCopy.session.attributes = sessionAttributes;

            // Build the request and response
            var response = new alexa.response();
            var request = new alexa.request(requestDataCopy);

            describe('on error', function() {

                // Execute the intent
                var exception = {};
                intentHandler.error(exception, request, response);

                // Get the speech response
                var speechResponse = response.response.response;
                var prompt = speechResponse.outputSpeech;
                var shouldEndSession = speechResponse.shouldEndSession;

                it('should not end the session', function() {
                    shouldEndSession.should.equal(false);
                });
            });

            describe('on stop', function() {
                // Execute the intent
                intentHandler.stop(request, response);

                // Get the speech response
                var speechResponse = response.response.response;
                var prompt = speechResponse.outputSpeech;
                var shouldEndSession = speechResponse.shouldEndSession;

                it('should end the session', function() {
                    shouldEndSession.should.equal(true);
                });
            });

            describe('on help', function() {
                // Execute the intent
                intentHandler.help(request, response);

                // Get the speech response
                var speechResponse = response.response.response;
                var prompt = speechResponse.outputSpeech;
                var shouldEndSession = speechResponse.shouldEndSession;

                it('should not end the session', function() {
                    shouldEndSession.should.equal(false);
                });
            });

            describe('on cancel', function() {
                // Execute the intent
                intentHandler.stop(request, response);

                // Get the speech response
                var speechResponse = response.response.response;
                var prompt = speechResponse.outputSpeech;
                var shouldEndSession = speechResponse.shouldEndSession;

                it('should end the session', function() {
                    shouldEndSession.should.equal(true);
                });
            });
        });

        context('and then on custom intents', function() {
            describe('on whoIsRight', function() {
                // Copy the request data and set slot info
                var firstPersonName = "Bob";
                var secondPersonName = "Jim";
                var requestDataCopy = getRequestData();
                requestDataCopy.request.intent = {
                    "name": "WhoIsRight",
                    "slots": {
                        "FirstPerson": {
                            "value": firstPersonName,
                            "name": "FirstPerson"
                        },
                        "SecondPerson": {
                            "value": secondPersonName,
                            "name": "SecondPerson"
                        }
                    }
                };

                // Create the request and response, then trigger the intent
                var response = new alexa.response();
                var request = new alexa.request(requestDataCopy);
                intentHandler.whoIsRight(request, response);

                // Get the speech response
                var speechResponse = response.response.response;
                var prompt = speechResponse.outputSpeech;
                var reprompt = speechResponse.reprompt.outputSpeech;
                var shouldEndSession = speechResponse.shouldEndSession;

                it('should end the session', function() {
                    shouldEndSession.should.equal(true);
                });
            });
        });
    });

    describe('On error', function() {
        // Copy the request data to prevent changes affecting other tests
        var requestDataCopy = getRequestData();

        // Trigger the error function
        var response = new alexa.response();
        var request = new alexa.request(requestDataCopy);

        var exception = {};
        intentHandler.error(exception, request, response);

        // Get the speech response
        var speechResponse = response.response.response;
        var prompt = speechResponse.outputSpeech;
        var shouldEndSession = speechResponse.shouldEndSession;

        it('should have a prompt', function () {
            should.exist(prompt);
            prompt.type.should.equal('SSML');
        });

        it('should have correct "error" prompt', function () {
            var expected = ssml.fromStr(prompts.error.prompt);
            prompt.ssml.should.equal(expected);
        });

        it('should end the session', function() {
            shouldEndSession.should.equal(true);
        });
    });

    describe('On stop', function() {
        // Trigger the stop function
        var response = new alexa.response();
        var request = {};
        intentHandler.stop(request, response);

        // Get the speech response
        var speechResponse = response.response.response;
        var prompt = speechResponse.outputSpeech;
        var shouldEndSession = speechResponse.shouldEndSession;

        it('should have a prompt', function () {
            should.exist(prompt);
            prompt.type.should.equal('SSML');
        });

        it('should have correct "stop" prompt', function () {
            var expected = ssml.fromStr(prompts.stop.prompt);
            prompt.ssml.should.equal(expected);
        });

        it('should end the session', function() {
            shouldEndSession.should.equal(true);
        });
    });

    describe('On help', function() {
        // Copy the request data to prevent changes affecting other tests
        var requestDataCopy = getRequestData();

        // Trigger the help function
        var response = new alexa.response();
        var request = new alexa.request(requestDataCopy);
        intentHandler.help(request, response);

        // Get the speech response
        var speechResponse = response.response.response;
        var prompt = speechResponse.outputSpeech;
        var shouldEndSession = speechResponse.shouldEndSession;

        it('should have a prompt', function () {
            should.exist(prompt);
            prompt.type.should.equal('SSML');
        });

        it('should have correct "help" prompt', function () {
            var expected = ssml.fromStr(prompts.help.prompt);
            prompt.ssml.should.equal(expected);
        });

        it('should end the session', function() {
            shouldEndSession.should.equal(true);
        });
    });

    describe('On cancel', function() {
        // Trigger the cancel function
        var response = new alexa.response();
        var request = {};
        intentHandler.cancel(request, response);

        // Get the speech response
        var speechResponse = response.response.response;
        var prompt = speechResponse.outputSpeech;
        var shouldEndSession = speechResponse.shouldEndSession;

        it('should have a prompt', function () {
            should.exist(prompt);
            prompt.type.should.equal('SSML');
        });

        it('should have correct "cancel" prompt', function () {
            var expected = ssml.fromStr(prompts.cancel.prompt);
            prompt.ssml.should.equal(expected);
        });

        it('should end the session', function() {
            shouldEndSession.should.equal(true);
        });
    });

    describe('On whoIsRight', function() {
        context('when firstPerson slot is empty', function() {
            // Copy the request data and set slot info
            var requestDataCopy = getRequestData();
            requestDataCopy.request.intent = {
                "name": "WhoIsRight",
                "slots": {
                    "SecondPerson": {
                        "value": "Jim",
                        "name": "SecondPerson"
                    }
                }
            };

            // Create the request and response, then trigger the intent
            var response = new alexa.response();
            var request = new alexa.request(requestDataCopy);
            intentHandler.whoIsRight(request, response);

            // Get the speech response
            var speechResponse = response.response.response;
            var prompt = speechResponse.outputSpeech;
            var reprompt = speechResponse.reprompt.outputSpeech;
            var shouldEndSession = speechResponse.shouldEndSession;

            it('should have a prompt', function() {
                should.exist(prompt);
                prompt.type.should.equal('SSML');
            });

            it('should have "not understood" prompt', function() {
                var expected = ssml.fromStr(prompts.intents.whoIsRight.notUnderstood.prompt);
                prompt.ssml.should.equal(expected);
            });

            it('should have a reprompt', function() {
                should.exist(prompt);
                reprompt.type.should.equal('SSML');
            });

            it('should have "not understood" reprompt', function() {
                var expected = ssml.fromStr(prompts.intents.whoIsRight.notUnderstood.reprompt);
                reprompt.ssml.should.equal(expected);
            });

            it('should end the session', function() {
                shouldEndSession.should.equal(true);
            });
        });

        context('when secondPerson slot is empty', function() {
            // Copy the request data and set slot info
            var requestDataCopy = getRequestData();
            requestDataCopy.request.intent = {
                "name": "WhoIsRight",
                "slots": {
                    "FirstPerson": {
                        "value": "Bob",
                        "name": "FirstPerson"
                    }
                }
            };

            // Create the request and response, then trigger the intent
            var response = new alexa.response();
            var request = new alexa.request(requestDataCopy);
            intentHandler.whoIsRight(request, response);

            // Get the speech response
            var speechResponse = response.response.response;
            var prompt = speechResponse.outputSpeech;
            var reprompt = speechResponse.reprompt.outputSpeech;
            var shouldEndSession = speechResponse.shouldEndSession;

            it('should have a prompt', function() {
                should.exist(prompt);
                prompt.type.should.equal('SSML');
            });

            it('should have "not understood" prompt', function() {
                var expected = ssml.fromStr(prompts.intents.whoIsRight.notUnderstood.prompt);
                prompt.ssml.should.equal(expected);
            });

            it('should have a reprompt', function() {
                should.exist(prompt);
                reprompt.type.should.equal('SSML');
            });

            it('should have "not understood" reprompt', function() {
                var expected = ssml.fromStr(prompts.intents.whoIsRight.notUnderstood.reprompt);
                reprompt.ssml.should.equal(expected);
            });

            it('should end the session', function() {
                shouldEndSession.should.equal(true);
            });
        });

        context('when firstPerson and secondPerson slots are supplied', function() {
            // Copy the request data and set slot info
            var firstPersonName = "Bob";
            var secondPersonName = "Jim";
            var requestDataCopy = getRequestData();
            requestDataCopy.request.intent = {
                "name": "WhoIsRight",
                "slots": {
                    "FirstPerson": {
                        "value": firstPersonName,
                        "name": "FirstPerson"
                    },
                    "SecondPerson": {
                        "value": secondPersonName,
                        "name": "SecondPerson"
                    }
                }
            };

            // Create the request and response, then trigger the intent
            var response = new alexa.response();
            var request = new alexa.request(requestDataCopy);
            intentHandler.whoIsRight(request, response);

            // Get the speech response
            var speechResponse = response.response.response;
            var prompt = speechResponse.outputSpeech;
            var reprompt = speechResponse.reprompt.outputSpeech;
            var shouldEndSession = speechResponse.shouldEndSession;

            it('should have a prompt', function() {
                should.exist(prompt);
                prompt.type.should.equal('SSML');
            });

            it('should have a random success prompt', function() {
                // Generate list of all prompts for both first and second person (as winner is selected at random)
                var possiblePrompts = [];
                for(var i = 0; i < prompts.intents.whoIsRight.responses.length; i++)
                {
                    var response = prompts.intents.whoIsRight.responses[i];
                    possiblePrompts.push(ssml.fromStr(utility.string.format(response, firstPersonName, secondPersonName)));
                    possiblePrompts.push(ssml.fromStr(utility.string.format(response, secondPersonName, firstPersonName)));
                }

                possiblePrompts.should.include(prompt.ssml)
            });

            it('should have a reprompt', function() {
                should.exist(prompt);
                reprompt.type.should.equal('SSML');
            });

            it('should have "success" reprompt', function() {
                var expected = ssml.fromStr(prompts.intents.whoIsRight.success.reprompt);
                reprompt.ssml.should.equal(expected);
            });

            it('should end the session', function() {
                shouldEndSession.should.equal(true);
            });
        });
    });
})


text:
<?php

require_once __DIR__.'/../bootstrap/init.php';

use PDFfiller\OAuth2\Client\Provider\Enums\GrantType;
use \PDFfiller\OAuth2\Client\Provider\PDFfiller;

$provider = new PDFfiller([
    'clientId'       => getenv('CLIENT_ID'),
    'clientSecret'   => getenv('CLIENT_SECRET'),
    'urlAccessToken' => getenv('URL_ACCESS_TOKEN'),
    'redirectUri'    => getenv('REDIRECT_URI'),
    'urlApiDomain'   => getenv('URL_API_DOMAIN')
]);

$provider->getAccessToken(new GrantType(GrantType::PASSWORD_GRANT), [
    'username' => getenv('USER_EMAIL'),
    'password' => getenv('PASSWORD')
]);

dd($provider->queryApiCall('test'));

redpajama_set_name: RedPajamaGithub


text:
namespace google_breakpad {

// This is very simple allocator which fetches pages from the kernel directly.
// Thus, it can be used even when the heap may be corrupted.
//
// There is no free operation. The pages are only freed when the object is
// destroyed.
class PageAllocator {
 public:
  PageAllocator()
      : page_size_(getpagesize()),
        last_(NULL),
        current_page_(NULL),
        page_offset_(0) {
  }

  ~PageAllocator() {
    FreeAll();
  }

  void *Alloc(unsigned bytes) {
    if (!bytes)
      return NULL;

    if (current_page_ && page_size_ - page_offset_ >= bytes) {
      uint8_t *const ret = current_page_ + page_offset_;
      page_offset_ += bytes;
      if (page_offset_ == page_size_) {
        page_offset_ = 0;
        current_page_ = NULL;
      }

      return ret;
    }

    const unsigned pages =
        (bytes + sizeof(PageHeader) + page_size_ - 1) / page_size_;
    uint8_t *const ret = GetNPages(pages);
    if (!ret)
      return NULL;

    page_offset_ = (page_size_ - (page_size_ * pages - (bytes + sizeof(PageHeader)))) % page_size_;
    current_page_ = page_offset_ ? ret + page_size_ * (pages - 1) : NULL;

    return ret + sizeof(PageHeader);
  }

 private:
  uint8_t *GetNPages(unsigned num_pages) {
#ifdef __x86_64
    void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
#else
    void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
                        MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
#endif
    if (a == MAP_FAILED)
      return NULL;

    struct PageHeader *header = reinterpret_cast<PageHeader*>(a);
    header->next = last_;
    header->num_pages = num_pages;
    last_ = header;

    return reinterpret_cast<uint8_t*>(a);
  }

  void FreeAll() {
    PageHeader *next;

    for (PageHeader *cur = last_; cur; cur = next) {
      next = cur->next;
      sys_munmap(cur, cur->num_pages * page_size_);
    }
  }

  struct PageHeader {
    PageHeader *next;  // pointer to the start of the next set of pages.
    unsigned num_pages;  // the number of pages in this set.
  };

  const unsigned page_size_;
  PageHeader *last_;
  uint8_t *current_page_;
  unsigned page_offset_;
};

// A wasteful vector is like a normal std::vector, except that it's very much
// simplier and it allocates memory from a PageAllocator. It's wasteful
// because, when resizing, it always allocates a whole new array since the
// PageAllocator doesn't support realloc.
template<class T>
class wasteful_vector {
 public:
  wasteful_vector(PageAllocator *allocator, unsigned size_hint = 16)
      : allocator_(allocator),
        a_((T*) allocator->Alloc(sizeof(T) * size_hint)),
        allocated_(size_hint),
        used_(0) {
  }

  T& back() {
    return a_[used_ - 1];
  }

  const T& back() const {
    return a_[used_ - 1];
  }

  bool empty() const {
    return used_ == 0;
  }

  void push_back(const T& new_element) {
    if (used_ == allocated_)
      Realloc(allocated_ * 2);
    a_[used_++] = new_element;
  }

  size_t size() const {
    return used_;
  }

  void resize(unsigned sz, T c = T()) {
    // No need to test "sz >= 0", as "sz" is unsigned.
    if (sz <= used_) {
      used_ = sz;
    } else {
      unsigned a = allocated_;
      if (sz > a) {
        while (sz > a) {
          a *= 2;
        }
        Realloc(a);
      }
      while (sz > used_) {
        a_[used_++] = c;
      }
    }
  }

  T& operator[](size_t index) {
    return a_[index];
  }

  const T& operator[](size_t index) const {
    return a_[index];
  }

 private:
  void Realloc(unsigned new_size) {
    T *new_array =
        reinterpret_cast<T*>(allocator_->Alloc(sizeof(T) * new_size));
    memcpy(new_array, a_, used_ * sizeof(T));
    a_ = new_array;
    allocated_ = new_size;
  }

  PageAllocator *const allocator_;
  T *a_;  // pointer to an array of |allocated_| elements.
  unsigned allocated_;  // size of |a_|, in elements.
  unsigned used_;  // number of used slots in |a_|.
};

}  // namespace google_breakpad

inline void* operator new(size_t nbytes,
                          google_breakpad::PageAllocator& allocator) {
   return allocator.Alloc(nbytes);
}

#endif  // GOOGLE_BREAKPAD_COMMON_MEMORY_H_


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<base href="../../../" />

		<link type="text/css" rel="stylesheet" href="page.css" />

[name]

      Eventi JavaScript per oggetti personalizzati.

			[link:https://github.com/mrdoob/eventdispatcher.js EventDispatcher on GitHub]

Codice di Esempio

		// Aggiungere eventi ad un oggetto custom

		class Car extends EventDispatcher {

			start() {

				this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } );

			}

		};

		// Usare gli eventi con l'oggetto custom

		const car = new Car();

		car.addEventListener( 'start', function ( event ) {

			alert( event.message );

		} );

		car.start();

Costruttore

[name]()

      Crea un oggetto EventDispatcher.

Metodi

[method:undefined addEventListener]( [param:String type], [param:Function listener] )

		  type - Il tipo di evento da ascoltare.

		  listener - La funzione che viene chiamata quando viene generato l'evento.

      Aggiunge un listener ad un tipo di evento.

[method:Boolean hasEventListener]( [param:String type], [param:Function listener] )

		  type - Il tipo di evento da ascoltare.

		  listener - La funzione che viene chiamata quando viene generato l'evento.

      Verifica se il listener è aggiunto ad un tipo di evento.

[method:undefined removeEventListener]( [param:String type], [param:Function listener] )

		  type - Il tipo di listener che viene rimosso.

		  listener - La funzione listener che viene rimossa.

      Rimuove un listener da un tipo di evento.

[method:undefined dispatchEvent]( [param:Object event] )

		  event - L'evento che viene lanciato.

      Lancia un tipo di evento.

Source

			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]


text:
using System;

namespace ExamPrep.Data.Utils.RandomDataGenerators.Contracts
{
    public interface IRandomDataGenerator
    {
        string GenerateString(int length);

        int GenerateIntValue(int maxValue, int minValue = 0);

        DateTime GenerateDate(int maxYear, int minYear = 1990);
    }
}


text:
.content-blog .form_add.span8 {
    margin-left: 110px;
    margin-top: 23px;
    position: relative;
}
.content-blog .form_add.span8 .media-body.media_{
    background-color: #FFFFFF;
    border: 1px solid #DBDBDB;
    border-radius: 6px 6px 6px 6px;
    margin-top: 6px;
    padding: 10px;
    position: relative;
}
.content-blog .span7.form_article {
    border-radius: 0 0 0 0;
    background-color: #FFFFFF;
    border-top-width: 0;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0px;
    padding-top: 27px;
    padding-left: 19px;
    width: 528px;
}
.content-blog .span7.form_article form label {
    font-size: 17px;
}
.content-blog .span7.form_article form textarea {
    width: 473px;
}
.title-article.span6 {
    margin-left: 0px;
}
.own-article.span5 {
    background-color: #FFFFFF;
    border-left-width: 0;
    border-radius: 0 0 0 0;
    border-right-width: 0;
    border-top-width: 0;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    width: 623px;
    overflow: auto;
    height: 626px;
}
.own-article.span5 h3 {
    margin-bottom: 0;
    margin-top: 0;
    padding: 10px;
    border-bottom: 1px solid #D2D2D2;
}
.own-article.span5 h3 span {
    color: #E74C3C;
    font-family: arial;
    font-size: 15px;
    font-weight: bold;
}
.content_categories.span5 {
    margin-left: 29px;
}
.own-article.span5 ul {
    font-family: arial;
    font-weight: bold;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 5px;
}
.own-article table .description-tab {
    width: 33%;
}
.own-article table {
    border-bottom-width: 0;
    border-radius: 0px;
    border-top-width: 0;
    margin-bottom: 0;
}
.own-article table thead {
    border-bottom-width: 0;
}
.own-article table .first-elmt{
    border-left-width: 0;
    width: 20%;
}
.own-article table .second-elmt{
    width: 17%;
}
.table-bordered thead:first-child tr:first-child > th:first-child, .table-bordered tbody:first-child tr:first-child > td:first-child, .table-bordered tbody:first-child tr:first-child > th:first-child {
    border-top-left-radius: 0px;
}
.table-bordered thead:first-child tr:first-child > th:last-child, .table-bordered tbody:first-child tr:first-child > td:last-child, .table-bordered tbody:first-child tr:first-child > th:last-child {
    border-top-right-radius: 0px;
}
.own-article table .icon-picture {
    color: #E67E22;
}
.own-article table .icon-pencil {
    color: #3498DB;
}
.own-article table .icon-zoom-in {
    color: #F1C40F;
}
.own-article table .icon-wrench {
    color: #2ECC71;
}
.own-article table .icon-trash {
    color: #E74C3C;
}
.own-article table .wrench-btn {
    padding-left: 20px;
    padding-top: 44px;
}
.own-article table .trash-btn {
    padding-left: 21px;
    padding-top: 44px;
}
.own-article table .wrench-btn .btn-success {
    background-color: #2ECC71;
    background-image: -moz-linear-gradient(top, #2ECC71, #2ECC71);
    background-image:-webkit-gradient(linear, center top, center bottom, from(#2ECC71), to(#2ECC71));
    background-repeat: repeat-x;
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
    color: #FFFFFF;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.own-article table .wrench-btn .btn-success i {
    color: #F5F5F5;
}
.own-article table .trash-btn .btn-danger {
    background-color: #DA4F49;
    background-image: -moz-linear-gradient(top, #E74C3C, #E74C3C);
    background-image:-webkit-gradient(linear, center top, center bottom, from(#E74C3C), to(#E74C3C));
    background-repeat: repeat-x;
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
    color: #FFFFFF;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.own-article table .trash-btn .btn-danger i {
    color: #F5F5F5;
}
.own-article table .bgcolor-tab {
    background-color: #EAEAEA;
}
.own-article table .title-tab {
    color: #34495E;
    font-weight: bold;
}
.own-article table .date-tab {
    color: #4B4B4B;
    font-weight: bold;
}


text:
namespace FluentSettings.UnitTests
{
    using FluentSettings.UnitTests.Helpers;

    using Xunit;

    public class ConversionTests
    {
        [Fact]
        public void IsValueType_Int_ReturnsTrue()
        {
            var isValueType = ConversionHelper.IsValueType(5);
            Assert.True(isValueType);
        }

        [Fact]
        public void IsValueType_IntType_ReturnsTrue()
        {
            var isValueType = ConversionHelper.IsValueType<int>();
            Assert.True(isValueType);
        }

        [Fact]
        public void IsStruct_PassStruct_ReturnsTrue()
        {
            var value = new PersonStruct();
            var isStruct = ConversionHelper.IsStruct(value);
            Assert.True(isStruct);
        }

        [Fact]
        public void IsStruct_PassInt_ReturnsFalse()
        {
            var isStruct = ConversionHelper.IsStruct(5);
            Assert.False(isStruct);
        }

        [Fact]
        public void IsString_PassString_ReturnsTrue()
        {
            var isString = ConversionHelper.IsString("Hello");
            Assert.True(isString);
        }

        [Fact]
        public void IsString_PassInt_ReturnsFalse()
        {
            var isString = ConversionHelper.IsString(5);
            Assert.False(isString);
        }

        [Fact]
        public void IsNullableType_PassNullableType_ReturnsTrue()
        {
            int? i = 5;
            var isNullableType = ConversionHelper.IsNullableType(i);
            Assert.True(isNullableType);
        }

        [Fact]
        public void IsNullableType_PassReferenceType_ReturnsFalse()
        {
            var personClass = new PersonClass();
            var isNullableType = ConversionHelper.IsNullableType(personClass);
            Assert.False(isNullableType);
        }

        [Fact]
        public void IsNullableType_PassValueType_ReturnsFalse()
        {
            const int I = 5;
            var isNullableType = ConversionHelper.IsNullableType(I);
            Assert.False(isNullableType);
        }
    }
}


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

namespace LibMinecraft.Model.Blocks
{
    /// <summary>
    /// End Stone ID=121
    /// </summary>
    /// <remarks></remarks>
    public class EndStoneBlock : Block
    {
        /// <summary>
        /// The Block ID for this block
        /// </summary>
        /// <remarks></remarks>
        public override byte BlockID
        {
            get { return 121; }
        }
    }
}


text:
/*
    The original source for this example is
    Copyright (c) 1994-2008 John E. Stone
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.
    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
    OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    SUCH DAMAGE.
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "types.h"
#include "api.h"       /* The ray tracing library API */
#include "ui.h"
#include "util.h"
#include "tachyon_video.h"

extern SceneHandle global_scene;
extern char *global_window_title;
extern bool global_usegraphics;

void tachyon_video::on_process() {
    char buf[8192];
    flt runtime;
    scenedef *scene = (scenedef *) global_scene;
    updating_mode = scene->displaymode == RT_DISPLAY_ENABLED;
    recycling = false;
    pausing = false;
    do {
        updating = updating_mode;
        timer start_timer = gettimer();
        rt_renderscene(global_scene);
        timer end_timer = gettimer();
        runtime = timertime(start_timer, end_timer);
        sprintf(buf, "%s: %.3f seconds", global_window_title, runtime);
        rt_ui_message(MSG_0, buf);
        title = buf; show_title(); // show time spent for rendering
        if(!updating) {
            updating = true;
            drawing_memory dm = get_drawing_memory();
            drawing_area drawing(0, 0, dm.sizex, dm.sizey);// invalidate whole screen
        }
        rt_finalize();
        title = global_window_title; show_title(); // reset title to default
    } while(recycling && running);
}

void tachyon_video::on_key(int key) {
    key &= 0xff;
    recycling = true;
    if(key == esc_key) running = false;
    else if(key == ' ') {
        if(!updating) {
            updating = true;
            drawing_memory dm = get_drawing_memory();
            drawing_area drawing(0, 0, dm.sizex, dm.sizey);// invalidate whole screen
        }
        updating = updating_mode = !updating_mode;
    }
    else if(key == 'p') {
        pausing = !pausing;
        if(pausing) {
            title = "Press ESC to exit or 'p' to continue after rendering completion";
            show_title();
        }
    }
}

void rt_finalize(void) {
    timer t0, t1;
    t0 = gettimer();
    if(global_usegraphics)
        do { rt_sleep(1); t1 = gettimer(); }
        while( (timertime(t0, t1) < 10 || video->pausing) && video->next_frame());
#ifdef _WINDOWS
    else rt_sleep(10000);
#endif
}


text:
<linked-combos
  name="item[{{ $name }}]"
  :value="{{ $items }}"
  :default-options="{{ $authorities_choices }}"
  options-search-url="/autori/suggestions?search=%QUERY"
  :options-search-transform="function(item){ return {key: item.id, value: item.name} }"
  :relation-types="{{ $roles_choices }}"
/>


text:
/*
 * @(#)PollOptionBean.java
 *
 * @project    : Morozko - Pool
 * @package    : org.morozko.java.mod.web.poll.dg.bean
 * @creation   : 18/11/2009 09/03/07
 */
package org.morozko.java.mod.web.poll.dg.bean;

import org.morozko.java.mod.web.poll.dg.bean.helpers.PollOptionBeanHelper;

/**
 *
Classe PollOptionBean.

 *
 * @author Matteo Franci
 */
public class PollOptionBean extends PollOptionBeanHelper {

	private final static long serialVersionUID = 125853138733624L;

}


text:
from django import forms
from django.contrib.auth.forms import ReadOnlyPasswordHashField

from .models import TemuUser, Post, FriendRequest, Relationship

import logging

logger = logging.getLogger(__name__)

class SignupForm(forms.ModelForm):
    error_messages = [
        {'password_mismatch': "The two password fields didn't match."}
    ]

    password = forms.CharField(label="Password", widget=forms.PasswordInput)
    password_confirm = forms.CharField(label="Password confirmation",
                                       widget=forms.PasswordInput)

    class Meta:
        model = TemuUser
        fields = ("username", "email")

    def clean_password_confirm(self):
        password = self.cleaned_data.get('password')
        password_confirm = self.cleaned_data.get('password_confirm')
        if password and password_confirm and password != password_confirm:
            raise forms.ValidationError(
                self.error_messages['password_mismatch'],
                code='password_mismatch'
            )
        return password_confirm

    def save(self, commit=True):
        user = super(SignupForm, self).save(commit=False)
        user.set_password(self.cleaned_data['password'])
        if commit:
            user.save()
            logger.debug("New user is signed up!")
        return user

class UserUpdateForm(forms.ModelForm):
    password = ReadOnlyPasswordHashField()

    class Meta:
        model = TemuUser
        fields = ('username', 'password', 'is_active', 'is_superuser')

    def clean_password(self):
        return self.initial['password']

class PostCreationForm(forms.ModelForm):
    post_text = forms.CharField(widget=forms.Textarea(
            {'rows': 2,
             'placeholder': 'What\'s on your mind?'}
    ))

    class Meta:
        model = Post
        fields = ('post_text',)

    def save(self, commit=True):
        post = super(PostCreationForm, self).save(commit=False)
        post.post_text = self.cleaned_data['post_text']

        if commit:
            post.save()
        return post


text:
{{<layout}}

{{$pageTitle}}Submit your ERS annual return{{/pageTitle}}
{{$afterHeader}}

{{/afterHeader}}

{{$content}}
  {{>alpha_banner}}
  {{>hmrc_banner}}

   {{>sub_header_CSOP}}

Upload your spreadsheets

File name	Status	Action

ExampleCompanyCSOP1.ods	Ready to upload	Remove file

Add another spreadsheet

              Upload spreadsheets

          </form>
          Back

{{/content}}

{{/layout}}


text:
"""
Excellon Statements
====================
**Excellon file statement classes**

"""

import re
import uuid
from .utils import (parse_gerber_value, write_gerber_value, decimal_string,
                    inch, metric)

__all__ = ['ExcellonTool', 'ToolSelectionStmt', 'CoordinateStmt',
           'CommentStmt', 'HeaderBeginStmt', 'HeaderEndStmt',
           'RewindStopStmt', 'EndOfProgramStmt', 'UnitStmt',
           'IncrementalModeStmt', 'VersionStmt', 'FormatStmt', 'LinkToolStmt',
           'MeasuringModeStmt', 'RouteModeStmt', 'DrillModeStmt',
           'AbsoluteModeStmt', 'RepeatHoleStmt', 'UnknownStmt',
           'ExcellonStatement',]

class ExcellonStatement(object):
    """ Excellon Statement abstract base class
    """

    @classmethod
    def from_excellon(cls, line):
        raise NotImplementedError('from_excellon must be implemented in a '
                                  'subclass')

    def __init__(self, unit='inch', id=None):
        self.units = unit
        self.id = uuid.uuid4().int if id is None else id

    def to_excellon(self, settings=None):
        raise NotImplementedError('to_excellon must be implemented in a '
                                  'subclass')
    def to_inch(self):
        self.units = 'inch'

    def to_metric(self):
        self.units = 'metric'

    def offset(self, x_offset=0, y_offset=0):
        pass

    def __eq__(self, other):
        return self.__dict__ == other.__dict__

class ExcellonTool(ExcellonStatement):
    """ Excellon Tool class

    Parameters
    ----------
    settings : FileSettings (dict-like)
        File-wide settings.

    kwargs : dict-like
        Tool settings from the excellon statement. Valid keys are:
            - `diameter` : Tool diameter [expressed in file units]
            - `rpm` : Tool RPM
            - `feed_rate` : Z-axis tool feed rate
            - `retract_rate` : Z-axis tool retraction rate
            - `max_hit_count` : Number of hits allowed before a tool change
            - `depth_offset` : Offset of tool depth from tip of tool.

    Attributes
    ----------
    number : integer
        Tool number from the excellon file

    diameter : float
        Tool diameter in file units

    rpm : float
        Tool RPM

    feed_rate : float
        Tool Z-axis feed rate.

    retract_rate : float
        Tool Z-axis retract rate

    depth_offset : float
        Offset of depth measurement from tip of tool

    max_hit_count : integer
        Maximum number of tool hits allowed before a tool change

    hit_count : integer
        Number of tool hits in excellon file.
    """

    @classmethod
    def from_excellon(cls, line, settings, id=None):
        """ Create a Tool from an excellon file tool definition line.

        Parameters
        ----------
        line : string
            Tool definition line from an excellon file.

        settings : FileSettings (dict-like)
            Excellon file-wide settings

        Returns
        -------
        tool : Tool
            An ExcellonTool representing the tool defined in `line`
        """
        commands = re.split('([BCFHSTZ])', line)[1:]
        commands = [(command, value) for command, value in pairwise(commands)]
        args = {}
        args['id'] = id
        nformat = settings.format
        zero_suppression = settings.zero_suppression
        for cmd, val in commands:
            if cmd == 'B':
                args['retract_rate'] = parse_gerber_value(val, nformat, zero_suppression)
            elif cmd == 'C':
                args['diameter'] = parse_gerber_value(val, nformat, zero_suppression)
            elif cmd == 'F':
                args['feed_rate'] = parse_gerber_value(val, nformat, zero_suppression)
            elif cmd == 'H':
                args['max_hit_count'] = parse_gerber_value(val, nformat, zero_suppression)
            elif cmd == 'S':
                args['rpm'] = 1000 * parse_gerber_value(val, nformat, zero_suppression)
            elif cmd == 'T':
                args['number'] = int(val)
            elif cmd == 'Z':
                args['depth_offset'] = parse_gerber_value(val, nformat, zero_suppression)
        return cls(settings, **args)

    @classmethod
    def from_dict(cls, settings, tool_dict):
        """ Create an ExcellonTool from a dict.

        Parameters
        ----------
        settings : FileSettings (dict-like)
            Excellon File-wide settings

        tool_dict : dict
            Excellon tool parameters as a dict

        Returns
        -------
        tool : ExcellonTool
            An ExcellonTool initialized with the parameters in tool_dict.
        """
        return cls(settings, **tool_dict)

    def __init__(self, settings, **kwargs):
        if kwargs.get('id') is not None:
            super(ExcellonTool, self).__init__(id=kwargs.get('id'))
        self.settings = settings
        self.number = kwargs.get('number')
        self.feed_rate = kwargs.get('feed_rate')
        self.retract_rate = kwargs.get('retract_rate')
        self.rpm = kwargs.get('rpm')
        self.diameter = kwargs.get('diameter')
        self.max_hit_count = kwargs.get('max_hit_count')
        self.depth_offset = kwargs.get('depth_offset')
        self.hit_count = 0

    def to_excellon(self, settings=None):
        fmt = self.settings.format
        zs = self.settings.zero_suppression
        stmt = 'T%02d' % self.number
        if self.retract_rate is not None:
            stmt += 'B%s' % write_gerber_value(self.retract_rate, fmt, zs)
        if self.feed_rate is not None:
            stmt += 'F%s' % write_gerber_value(self.feed_rate, fmt, zs)
        if self.max_hit_count is not None:
            stmt += 'H%s' % write_gerber_value(self.max_hit_count, fmt, zs)
        if self.rpm is not None:
            if self.rpm < 100000.:
                stmt += 'S%s' % write_gerber_value(self.rpm / 1000., fmt, zs)
            else:
                stmt += 'S%g' % (self.rpm / 1000.)
        if self.diameter is not None:
            stmt += 'C%s' % decimal_string(self.diameter, fmt[1], True)
        if self.depth_offset is not None:
            stmt += 'Z%s' % write_gerber_value(self.depth_offset, fmt, zs)
        return stmt

    def to_inch(self):
        if self.settings.units != 'inch':
            self.settings.units = 'inch'
            if self.diameter is not None:
                self.diameter = inch(self.diameter)

    def to_metric(self):
        if self.settings.units != 'metric':
            self.settings.units = 'metric'
            if self.diameter is not None:
                self.diameter = metric(self.diameter)

    def _hit(self):
        self.hit_count += 1

    def __repr__(self):
        unit = 'in.' if self.settings.units == 'inch' else 'mm'
        fmtstr = '<ExcellonTool %%02d: %%%d.%dg%%s dia.>' % self.settings.format
        return fmtstr % (self.number, self.diameter, unit)

class ToolSelectionStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        """ Create a ToolSelectionStmt from an excellon file line.

        Parameters
        ----------
        line : string
            Line from an Excellon file

        Returns
        -------
        tool_statement : ToolSelectionStmt
            ToolSelectionStmt representation of `line.`
        """
        line = line[1:]
        compensation_index = None

        # up to 3 characters for tool number (Frizting uses that)
        if len(line) <= 3:
            tool = int(line)
        else:
            tool = int(line[:2])
            compensation_index = int(line[2:])

        return cls(tool, compensation_index, **kwargs)

    def __init__(self, tool, compensation_index=None, **kwargs):
        super(ToolSelectionStmt, self).__init__(**kwargs)
        tool = int(tool)
        compensation_index = (int(compensation_index) if compensation_index
                              is not None else None)
        self.tool = tool
        self.compensation_index = compensation_index

    def to_excellon(self, settings=None):
        stmt = 'T%02d' % self.tool
        if self.compensation_index is not None:
            stmt += '%02d' % self.compensation_index
        return stmt

class CoordinateStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, settings, **kwargs):
        x_coord = None
        y_coord = None
        if line[0] == 'X':
            splitline = line.strip('X').split('Y')
            x_coord = parse_gerber_value(splitline[0], settings.format,
                                         settings.zero_suppression)
            if len(splitline) == 2:
                y_coord = parse_gerber_value(splitline[1], settings.format,
                                             settings.zero_suppression)
        else:
            y_coord = parse_gerber_value(line.strip(' Y'), settings.format,
                                         settings.zero_suppression)
        c = cls(x_coord, y_coord, **kwargs)
        c.units = settings.units
        return c

    def __init__(self, x=None, y=None, **kwargs):
        super(CoordinateStmt, self).__init__(**kwargs)
        self.x = x
        self.y = y

    def to_excellon(self, settings):
        stmt = ''
        if self.x is not None:
            stmt += 'X%s' % write_gerber_value(self.x, settings.format,
                                               settings.zero_suppression)
        if self.y is not None:
            stmt += 'Y%s' % write_gerber_value(self.y, settings.format,
                                               settings.zero_suppression)
        return stmt

    def to_inch(self):
        if self.units == 'metric':
            self.units = 'inch'
            if self.x is not None:
                self.x = inch(self.x)
            if self.y is not None:
                self.y = inch(self.y)

    def to_metric(self):
        if self.units == 'inch':
            self.units = 'metric'
            if self.x is not None:
                self.x = metric(self.x)
            if self.y is not None:
                self.y = metric(self.y)

    def offset(self, x_offset=0, y_offset=0):
        if self.x is not None:
            self.x += x_offset
        if self.y is not None:
            self.y += y_offset

    def __str__(self):
        coord_str = ''
        if self.x is not None:
            coord_str += 'X: %g ' % self.x
        if self.y is not None:
            coord_str += 'Y: %g ' % self.y

        return '<Coordinate Statement: %s>' % coord_str

class RepeatHoleStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, settings, **kwargs):
        match = re.compile(r'R(?P<rcount>[0-9]*)X?(?P<xdelta>[+\-]?\d*\.?\d*)?Y?'
                           '(?P<ydelta>[+\-]?\d*\.?\d*)?').match(line)
        stmt = match.groupdict()
        count = int(stmt['rcount'])
        xdelta = (parse_gerber_value(stmt['xdelta'], settings.format,
                                     settings.zero_suppression)
                  if stmt['xdelta'] is not '' else None)
        ydelta = (parse_gerber_value(stmt['ydelta'], settings.format,
                                     settings.zero_suppression)
                  if stmt['ydelta'] is not '' else None)
        c = cls(count, xdelta, ydelta, **kwargs)
        c.units = settings.units
        return c

    def __init__(self, count, xdelta=0.0, ydelta=0.0, **kwargs):
        super(RepeatHoleStmt, self).__init__(**kwargs)
        self.count = count
        self.xdelta = xdelta
        self.ydelta = ydelta

    def to_excellon(self, settings):
        stmt = 'R%d' % self.count
        if self.xdelta is not None and self.xdelta != 0.0:
            stmt += 'X%s' % write_gerber_value(self.xdelta, settings.format,
                                               settings.zero_suppression)
        if self.ydelta is not None and self.ydelta != 0.0:
            stmt += 'Y%s' % write_gerber_value(self.ydelta, settings.format,
                                               settings.zero_suppression)
        return stmt

    def to_inch(self):
        if self.units == 'metric':
            self.units = 'inch'
            if self.xdelta is not None:
                self.xdelta = inch(self.xdelta)
            if self.ydelta is not None:
                self.ydelta = inch(self.ydelta)

    def to_metric(self):
        if self.units == 'inch':
            self.units = 'metric'
            if self.xdelta is not None:
                self.xdelta = metric(self.xdelta)
            if self.ydelta is not None:
                self.ydelta = metric(self.ydelta)

    def __str__(self):
        return '<Repeat Hole: %d times, offset X: %g Y: %g>' % (
            self.count,
            self.xdelta if self.xdelta is not None else 0,
            self.ydelta if self.ydelta is not None else 0)

class CommentStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        return cls(line.lstrip(';'))

    def __init__(self, comment, **kwargs):
        super(CommentStmt, self).__init__(**kwargs)
        self.comment = comment

    def to_excellon(self, settings=None):
        return ';%s' % self.comment

class HeaderBeginStmt(ExcellonStatement):

    def __init__(self, **kwargs):
        super(HeaderBeginStmt, self).__init__(**kwargs)

    def to_excellon(self, settings=None):
        return 'M48'

class HeaderEndStmt(ExcellonStatement):

    def __init__(self, **kwargs):
        super(HeaderEndStmt, self).__init__(**kwargs)

    def to_excellon(self, settings=None):
        return 'M95'

class RewindStopStmt(ExcellonStatement):

    def __init__(self, **kwargs):
        super(RewindStopStmt, self).__init__(**kwargs)

    def to_excellon(self, settings=None):
        return '%'

class EndOfProgramStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, settings, **kwargs):
        match = re.compile(r'M30X?(?P<x>\d*\.?\d*)?Y?'
                           '(?P<y>\d*\.?\d*)?').match(line)
        stmt = match.groupdict()
        x = (parse_gerber_value(stmt['x'], settings.format,
                                settings.zero_suppression)
             if stmt['x'] is not '' else None)
        y = (parse_gerber_value(stmt['y'], settings.format,
                                settings.zero_suppression)
             if stmt['y'] is not '' else None)
        c = cls(x, y, **kwargs)
        c.units = settings.units
        return c

    def __init__(self, x=None, y=None, **kwargs):
        super(EndOfProgramStmt, self).__init__(**kwargs)
        self.x = x
        self.y = y

    def to_excellon(self, settings=None):
        stmt = 'M30'
        if self.x is not None:
            stmt += 'X%s' % write_gerber_value(self.x)
        if self.y is not None:
            stmt += 'Y%s' % write_gerber_value(self.y)
        return stmt

    def to_inch(self):
        if self.units == 'metric':
            self.units = 'inch'
            if self.x is not None:
                self.x = inch(self.x)
            if self.y is not None:
                self.y = inch(self.y)

    def to_metric(self):
        if self.units == 'inch':
            self.units = 'metric'
            if self.x is not None:
                self.x = metric(self.x)
            if self.y is not None:
                self.y = metric(self.y)

    def offset(self, x_offset=0, y_offset=0):
        if self.x is not None:
            self.x += x_offset
        if self.y is not None:
            self.y += y_offset

class UnitStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        units = 'inch' if 'INCH' in line else 'metric'
        zeros = 'leading' if 'LZ' in line else 'trailing'
        return cls(units, zeros, **kwargs)

    def __init__(self, units='inch', zeros='leading', **kwargs):
        super(UnitStmt, self).__init__(**kwargs)
        self.units = units.lower()
        self.zeros = zeros

    def to_excellon(self, settings=None):
        stmt = '%s,%s' % ('INCH' if self.units == 'inch' else 'METRIC',
                          'LZ' if self.zeros == 'leading'
                          else 'TZ')
        return stmt

    def to_inch(self):
        self.units = 'inch'

    def to_metric(self):
        self.units = 'metric'

class IncrementalModeStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        return cls('off', **kwargs) if 'OFF' in line else cls('on', **kwargs)

    def __init__(self, mode='off', **kwargs):
        super(IncrementalModeStmt, self).__init__(**kwargs)
        if mode.lower() not in ['on', 'off']:
            raise ValueError('Mode may be "on" or "off"')
        self.mode = mode

    def to_excellon(self, settings=None):
        return 'ICI,%s' % ('OFF' if self.mode == 'off' else 'ON')

class VersionStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        version = int(line.split(',')[1])
        return cls(version, **kwargs)

    def __init__(self, version=1, **kwargs):
        super(VersionStmt, self).__init__(**kwargs)
        version = int(version)
        if version not in [1, 2]:
            raise ValueError('Valid versions are  1 or 2')
        self.version = version

    def to_excellon(self, settings=None):
        return 'VER,%d' % self.version

class FormatStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        fmt = int(line.split(',')[1])
        return cls(fmt, **kwargs)

    def __init__(self, format=1, **kwargs):
        super(FormatStmt, self).__init__(**kwargs)
        format = int(format)
        if format not in [1, 2]:
            raise ValueError('Valid formats are 1 or 2')
        self.format = format

    def to_excellon(self, settings=None):
        return 'FMAT,%d' % self.format

class LinkToolStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        linked = [int(tool) for tool in line.split('/')]
        return cls(linked, **kwargs)

    def __init__(self, linked_tools, **kwargs):
        super(LinkToolStmt, self).__init__(**kwargs)
        self.linked_tools = [int(x) for x in linked_tools]

    def to_excellon(self, settings=None):
        return '/'.join([str(x) for x in self.linked_tools])

class MeasuringModeStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        if not ('M71' in line or 'M72' in line):
            raise ValueError('Not a measuring mode statement')
        return cls('inch', **kwargs) if 'M72' in line else cls('metric', **kwargs)

    def __init__(self, units='inch', **kwargs):
        super(MeasuringModeStmt, self).__init__(**kwargs)
        units = units.lower()
        if units not in ['inch', 'metric']:
            raise ValueError('units must be "inch" or "metric"')
        self.units = units

    def to_excellon(self, settings=None):
        return 'M72' if self.units == 'inch' else 'M71'

    def to_inch(self):
        self.units = 'inch'

    def to_metric(self):
        self.units = 'metric'

class RouteModeStmt(ExcellonStatement):

    def __init__(self, **kwargs):
        super(RouteModeStmt, self).__init__(**kwargs)

    def to_excellon(self, settings=None):
        return 'G00'

class DrillModeStmt(ExcellonStatement):

    def __init__(self, **kwargs):
        super(DrillModeStmt, self).__init__(**kwargs)

    def to_excellon(self, settings=None):
        return 'G05'

class AbsoluteModeStmt(ExcellonStatement):

    def __init__(self, **kwargs):
        super(AbsoluteModeStmt, self).__init__(**kwargs)

    def to_excellon(self, settings=None):
        return 'G90'

class UnknownStmt(ExcellonStatement):

    @classmethod
    def from_excellon(cls, line, **kwargs):
        return cls(line, **kwargs)

    def __init__(self, stmt, **kwargs):
        super(UnknownStmt, self).__init__(**kwargs)
        self.stmt = stmt

    def to_excellon(self, settings=None):
        return self.stmt

    def __str__(self):
        return "<Unknown Statement: %s>" % self.stmt

def pairwise(iterator):
    """ Iterate over list taking two elements at a time.

    e.g. [1, 2, 3, 4, 5, 6] ==> [(1, 2), (3, 4), (5, 6)]
    """
    itr = iter(iterator)
    while True:
        yield tuple([next(itr) for i in range(2)])


text:
<?php

#****c* classes/Fm
# NAME
#   Fm -- Form related utility class
#******

abstract class Fm {
  const BOOLEAN_RE = '/^\d+$/';

  #****m* Fm/input
  # NAME
  #   input -- create HTML of a input field
  # SYNOPSIS
  #   $html = Fm::input($name,$opts)
  # FUNCTION
  #   Returns the HTML rendering for a generic input field.  It will
  #   pre-load with the POST.$name value.
  # INPUTS
  #   $name - F3 POST variable name
  #   $opts - array containing options as a possible mix of scalars
  #           and key+value pairs.
  #           Normally, these will be simply included in the <input>
  #           tag as additional attributes.
  # OPTIONS
  #   These options in "$opts" are treated specially:
  #
  #   prefix - This is prepended to the $name to generic a "id"
  #            attribute.  The "id" attribute can be used to refer
  #            to the control in JavaScript.  If not specified,
  #            it will default to "form_".
  #   type   - type of input control.  Defaults to "text".
  #   name   - Used to override the field name.  Defaults to $name.
  #   value  - pre-load field value.  If not specified, it would read
  #            from "POST.$name" or use a $opts['default'].
  #   default - Used to initialize "value" if not in "POST.$name".
  #   label - Label for this input control.
  # RESULTS
  #   HTML rendering for input field.
  #******
  static public function input($name,$opts=[]) {
    $tag = '';
    if (isset($opts['prefix'])) {
      $prefix = $opts['prefix'];
      unset($opts['prefix']);
    } else {
      $prefix = 'form_';
    }

    if (!isset($opts['type'])) $opts['type'] = 'text';
    if (!isset($opts['name'])) $opts['name'] = $name;
    if (!isset($opts['id'])) $opts['id'] = $prefix.$name;

    if (!isset($opts['value'])) {
      $f3 = Base::instance();
      if ($f3->exists('POST.'.$name)) {
        $opts['value'] = $f3->get('POST.'.$name);
      } elseif (isset($opts['default'])) {
	$opts['value'] = self::esc($opts['default']);
      } else {
        $opts['value'] = '';
      }
    } else {
      $opts['value'] = self::esc($opts['value']);
    }
    if (isset($opts['default'])) unset($opts['default']);
    if (isset($opts['label'])) {
      $tag .= ''.$opts['label'].'';
      unset($opts['label']);
    }

    $tag .= '<input';
    foreach ($opts as $k=>$v) {
      if (preg_match(self::BOOLEAN_RE,$k)) {
        $tag .= ' '.$v;
      } else {
        $tag .= ' '.$k.'="'.$v.'"';
      }
    }
    $tag .= '/>';
    return $tag;
  }
  #****m* Fm/text
  # NAME
  #   text -- create HTML input text
  # SYNOPSIS
  #   $html = Fm::text($name,$opts)
  # FUNCTION
  #   This is just an alias for Fm::input().
  # INPUTS
  #   $name - F3 POST variable name
  #   $opts - array containing options as a possible mix of scalars
  #           and key+value pairs.
  # SEE ALSO
  #   Fm/input
  # RESULTS
  #   HTML rendering for input text field.
  #******
  static public function text($name,$opts=[]) {
    return self::input($name,$opts);
  }
  #****m* Fm/checkbox
  # NAME
  #   checkbox -- create HTML checkbox
  # SYNOPSIS
  #   $html = Fm::checkbox($name,$opts)
  # FUNCTION
  #   Returns the HTML rendering for a checkbox.  It will pre-load
  #   with the POST.$name value.
  # INPUTS
  #   $name - F3 POST variable name
  #   $opts - array containing options as a possible mix of scalars
  #           and key+value pairs.
  # OPTIONS
  #    See OPTIONS section for Fm/input.
  # SEE ALSO
  #   Fm/input
  # RESULTS
  #   HTML rendering for checkbox.
  #******
  static public function checkbox($name,$opts=[]) {
    $f3 = Base::instance();
    if ($f3->exists('POST.'.$name) && $f3->get('POST.'.$name)) {
      $opts[] = 'checked';
    }
    if (!isset($opts['value'])) $opts['value'] = 1;
    if (!isset($opts['type'])) $opts['type'] = 'checkbox';
    return self::input($name,$opts);
  }
  #****m* Fm/radio
  # NAME
  #   radio -- create HTML radio button
  # SYNOPSIS
  #   $html = Fm::radio($name,$opts)
  # FUNCTION
  #   Returns the HTML rendering for a radio button.  It will pre-load
  #   with the POST.$name value.
  #
  #   The radio group is specified by the "$name" value.  i.e. radio
  #   buttons with the same "$name" value will belong to the same
  #   radio group.
  # INPUTS
  #   $name - F3 POST variable name
  #   $opts - array containing options as a possible mix of scalars
  #           and key+value pairs.
  # OPTIONS
  #    See OPTIONS section for Fm/input.
  # SEE ALSO
  #   Fm/input
  # RESULTS
  #   HTML rendering for radio button.
  #******
  static public function radio($name,$opts=[]) {
    $f3 = Base::instance();
    $isdefault = false;
    foreach ($opts as $k=>$v) {
      if (preg_match(self::BOOLEAN_RE,$k) && $v == 'default') {
        $isdefault = [$k];
	break;
      }
    }
    if ($isdefault) {
      unset($opts[$isdefault[0]]);
      $isdefault = true;
    }
    if (!isset($opts['value'])) $f3->error(404);

    if (!$f3->exists('POST.'.$name) && $isdefault) $f3->set('POST.'.$name,$opts['value']);
    if ($f3->exists('POST.'.$name) && $f3->get('POST.'.$name) == $opts['value']) {
      $opts[] = 'checked';
    }
    if (!isset($opts['type'])) $opts['type'] = 'radio';
    return self::input($name,$opts);
  }

  #****m* Fm/select
  # NAME
  #   select -- create HTML of a select field
  # SYNOPSIS
  #   $html = Fm::select($name,$choices,$opts)
  # FUNCTION
  #   Returns the HTML rendering for a generic select field.  It will
  #   pre-load with the POST.$name value.
  # INPUTS
  #   $name - F3 POST variable name
  #   $choices - array with the possible selectable options.
  #   $opts - array containing options as a possible mix of scalars
  #           and key+value pairs.
  #           Normally, these will be simply included in the <select>
  #           tag as additional attributes.
  # OPTIONS
  #   These options in "$opts" are treated specially:
  #
  #   prefix - This is prepended to the $name to generic a "id"
  #            attribute.  The "id" attribute can be used to refer
  #            to the control in JavaScript.  If not specified,
  #            it will default to "form_".
  #   name   - Used to override the field name.  Defaults to $name.
  #   value  - pre-load field value.  If not specified, it would read
  #            from "POST.$name" or use a $opts['default'].
  #   default - Used to initialize "value" if not in "POST.$name".
  #   label - Label for this select control.
  # RESULTS
  #   HTML rendering for input field.
  #******
  static public function select($name,$choices,$opts=[]) {
    $tag = '';

    if (isset($opts['prefix'])) {
      $prefix = $opts['prefix'];
      unset($opts['prefix']);
    } else {
      $prefix = 'form_';
    }

    if (!isset($opts['name'])) $opts['name'] = $name;
    if (!isset($opts['id'])) $opts['id'] = $prefix.$name;

    if (isset($opts['value'])) {
      $value = $opts['value'];
      unset($opts['value']);
    } else {
      $f3 = Base::instance();
      if ($f3->exists('POST.'.$name)) {
        $value = $f3->get('POST.'.$name);
      } elseif (isset($opts['default'])) {
        $value = $opts['default'];
      } else {
        foreach ($choices as $k=>$v) {
	  $value = $k;
	  break;
	}
      }
    }
    if (isset($opts['default'])) unset($opts['default']);

    if (isset($opts['label'])) {
      $tag .= ''.$opts['label'].'';
      unset($opts['label']);
    }

    $tag .= '<select';
    foreach ($opts as $k=>$v) {
      if (preg_match(self::BOOLEAN_RE,$k)) {
        $tag .= ' '.$v;
      } else {
        $tag .= ' '.$k.'="'.$v.'"';
      }
    }
    $tag .= '>';
    foreach ($choices as $k=>$v) {
      $tag .= '<option value="'.$k.'"';
      if ($k == $value) $tag.= ' selected';
      $tag .= '>'.$v.'</option>';
    }
    $tag .= '</select>';
    return $tag;
  }
  #****m* Fm/textarea
  # NAME
  #   textarea -- create HTML of a textarea field
  # SYNOPSIS
  #   $html = Fm::textarea($name,$opts)
  # FUNCTION
  #   Returns the HTML rendering for a generic textarea.  It will
  #   pre-load with the POST.$name value.
  # INPUTS
  #   $name - F3 POST variable name
  #   $opts - array containing options as a possible mix of scalars
  #           and key+value pairs.
  #           Normally, these will be simply included in the <input>
  #           tag as additional attributes.
  # OPTIONS
  #   These options in "$opts" are treated specially:
  #
  #   prefix - This is prepended to the $name to generic a "id"
  #            attribute.  The "id" attribute can be used to refer
  #            to the control in JavaScript.  If not specified,
  #            it will default to "form_".
  #   name   - Used to override the field name.  Defaults to $name.
  #   value  - pre-load field value.  If not specified, it would read
  #            from "POST.$name" or use a $opts['default'].
  #   default - Used to initialize "value" if not in "POST.$name".
  #   label - Label for this textarea.
  # RESULTS
  #   HTML rendering for input field.
  #******

  static public function textarea($name,$opts=[]) {
    $tag = '';

    if (isset($opts['prefix'])) {
      $prefix = $opts['prefix'];
      unset($opts['prefix']);
    } else {
      $prefix = 'form_';
    }

    if (!isset($opts['name'])) $opts['name'] = $name;
    if (!isset($opts['id'])) $opts['id'] = $prefix.$name;

    if (isset($opts['value'])) {
      $value = self::esc($opts['value']);
      unset($opts['value']);
    } else {
      $f3 = Base::instance();
      if ($f3->exists('POST.'.$name)) {
        $value = $f3->get('POST.'.$name);
      } elseif (isset($opts['default'])) {
        $value = self::esc($opts['default']);
      } else {
        $value = "";
      }
    }
    if (isset($opts['default'])) unset($opts['default']);

    if (isset($opts['label'])) {
      $tag .= ''.$opts['label'].'';
      unset($opts['label']);
    }

    $tag .= '<textarea';
    foreach ($opts as $k=>$v) {
      if (preg_match(self::BOOLEAN_RE,$k)) {
        $tag .= ' '.$v;
      } else {
        $tag .= ' '.$k.'="'.$v.'"';
      }
    }
    $tag .= '>';

    $tag .= $value;

    $tag .= '</textarea>';
    return $tag;

  }
  #****m* Fm/esc
  # NAME
  #   esc -- Escape HTML entities
  # SYNOPSIS
  #   $escaped = Fm::esc($txt)
  # FUNCTION
  #   Escape text in $txt using PHP htmlspecialchars function.
  # INPUTS
  #   $txt - Text to escape
  # RESULTS
  #   Escaped HTML output.
  #******
  static public function esc($txt) {
    return htmlspecialchars($txt);
  }

}


text:
#ifndef SRC_CORE_NEON_KERNELS_SELECT_LIST_H
#define SRC_CORE_NEON_KERNELS_SELECT_LIST_H

#include "arm_compute/core/ITensor.h"

namespace arm_compute
{
namespace cpu
{
#define DECLARE_SELECT_KERNEL(func_name) \
    void func_name(const ITensor *c, const ITensor *x, const ITensor *y, ITensor *output, const Window &window)

DECLARE_SELECT_KERNEL(neon_s8_select_same_rank);
DECLARE_SELECT_KERNEL(neon_s16_select_same_rank);
DECLARE_SELECT_KERNEL(neon_s32_select_same_rank);
DECLARE_SELECT_KERNEL(neon_u8_select_same_rank);
DECLARE_SELECT_KERNEL(neon_u16_select_same_rank);
DECLARE_SELECT_KERNEL(neon_u32_select_same_rank);
DECLARE_SELECT_KERNEL(neon_f16_select_same_rank);
DECLARE_SELECT_KERNEL(neon_f32_select_same_rank);

DECLARE_SELECT_KERNEL(neon_s8_select_not_same_rank);
DECLARE_SELECT_KERNEL(neon_s16_select_not_same_rank);
DECLARE_SELECT_KERNEL(neon_s32_select_not_same_rank);
DECLARE_SELECT_KERNEL(neon_u8_select_not_same_rank);
DECLARE_SELECT_KERNEL(neon_u16_select_not_same_rank);
DECLARE_SELECT_KERNEL(neon_u32_select_not_same_rank);
DECLARE_SELECT_KERNEL(neon_f16_select_not_same_rank);
DECLARE_SELECT_KERNEL(neon_f32_select_not_same_rank);

#undef DECLARE_RANGE_KERNEL

} // namespace cpu
} // namespace arm_compute
#endif //SRC_CORE_NEON_KERNELS_SELECT_LIST_H


text:
<form id="mc-form" class="form-group cushion-top" autocomplete="off" >

      <input id="mc-email" class="form-control input-lg" type="email" id="inputLarge" placeholder="Email Address">

      <button type="submit" class="btn btn-info btn-lg btn-block"> Stay Updated</button>

</form>


text:
<?php
/**
 * Sample php server script for a wookmark integration
 *
 * @author Sebastian Helzle <sebastian@helzle.net>
 */

/**
 * Basic class which provides all functions to retrieve and paginate pictures
 */
class picture {

    /**
     * @var array $data
     */
    protected $data;

    /**
     * @var int $itemsPerPage
     */
    protected $itemsPerPage;

    function __construct($data, $itemsPerPage) {
        $this->data = $data;
        $this->itemsPerPage = $itemsPerPage;
  }

  /**
   * Returns the pictures of the given page or an empty array if page doesn't exist
   * @param int $page
   * @return array
   */
  public function getPage($page=1) {
      if ($page > 0 && $page <= $this->getNumberOfPages()) {
          $startOffset = ($page - 1) * $this->itemsPerPage;
          return array_slice($this->data, $startOffset, $this->itemsPerPage);
    }
    return array();
  }

  /**
   * Returns the maximum number of pages
   * @return int
   */
  public function getNumberOfPages() {
      return ceil(count($this->data) / $this->itemsPerPage);
  }
}


text:
package ant.test;

import java.io.File;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectHelper;

public class JavaCallAnt {
	/**
	 * 执行build.xml文件
	 *
	 * @param build
	 *            build.xml文件
	 * @param level
	 *            日志输出级别(Project.MSG_INFO)
	 * */
	public static void exeBuildFile(String build, int level) {
		File buildFile = new File(build);
		Project p = new Project();
		// 添加日志输出
		DefaultLogger consoleLogger = new DefaultLogger();
		consoleLogger.setErrorPrintStream(System.err);
		consoleLogger.setOutputPrintStream(System.out);
		// 输出信息级别
		consoleLogger.setMessageOutputLevel(level);
		p.addBuildListener(consoleLogger);
		try {
			p.fireBuildStarted();
			p.init();
			ProjectHelper helper = ProjectHelper.getProjectHelper();
			helper.parse(p, buildFile);
			p.executeTarget(p.getDefaultTarget());
			p.fireBuildFinished(null);
		} catch (BuildException e) {
			p.fireBuildFinished(e);
		}
	}

	public static void main(String[] args) {
		exeBuildFile("src/test/java/ant/test/javaCallAnt.xml", Project.MSG_INFO);
	}

}