text:
Blog Api
========================

How to run?
--------------

1. Composer install.
   Add database parameters and other parameters that will be prompted
2. php app/console doctrine:database:create
3. php app/console doctrine:migrations:migrate
4. php app/console doctrine:fixtures:load
5. try user with username 'john_doe' and pass 'test123'
6. get access token with a GET
/oauth/v2/token?grant_type=password&client_id=xxx&client_secret=xxx&username=john_doe&password=test123"
7. with the returned acces_token you can access the secure areas of the api
8. if access token expires you can refresh it with refresh token. using grant_type=refresh_token

redpajama_set_name: RedPajamaGithub


text:
package org.axonframework.test.saga;

import org.axonframework.eventhandling.GenericEventMessage;
import org.axonframework.test.AxonAssertionError;
import org.axonframework.test.aggregate.MyOtherEvent;
import org.axonframework.test.matchers.AllFieldsFilter;
import org.axonframework.test.matchers.Matchers;
import org.junit.Before;
import org.junit.Test;

public class EventValidatorTest {

    private EventValidator testSubject;

    @Before
    public void setUp(){
        testSubject = new EventValidator(null, AllFieldsFilter.instance());
    }

    @Test
    public void testAssertPublishedEventsWithNoEventsMatcherIfNoEventWasPublished() throws Exception {
        testSubject.assertPublishedEventsMatching(Matchers.noEvents());
    }

    @Test(expected = AxonAssertionError.class)
    public void testAssertPublishedEventsWithNoEventsMatcherThrowsAssertionErrorIfEventWasPublished() throws Exception {
        testSubject.handle(GenericEventMessage.asEventMessage(new MyOtherEvent()));

        testSubject.assertPublishedEventsMatching(Matchers.noEvents());
    }

    @Test
    public void testAssertPublishedEventsIfNoEventWasPublished() throws Exception {
        testSubject.assertPublishedEvents();
    }

    @Test(expected = AxonAssertionError.class)
    public void testAssertPublishedEventsThrowsAssertionErrorIfEventWasPublished() throws Exception {
        testSubject.handle(GenericEventMessage.asEventMessage(new MyOtherEvent()));

        testSubject.assertPublishedEvents();
    }

}


text:
layout: post
date: 2018-04-06
title: GoDaddy DNS with Github Pages
description: Setting up GoDaddy domain with Github Pages
categories: github
tags: github godaddy
---

## Steps

1. In your repository, go to Settings, under Github Pages section, fill in your custom domain. This will create a CNAME file in your repository.

2. Add an `A` (host) record with `host = @` and `Points to = 192.30.252.153`.

3. You can also set up an alias record. Add a `CNAME` (alias) record with `host = www` and `Points to = yourname.github.io`.


text:
// Autogenerated from vk-api-schema. Please don't edit it manually.
package com.vk.api.sdk.queries.messages;

import com.vk.api.sdk.client.AbstractQueryBuilder;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.GroupActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.messages.responses.GetByConversationMessageIdResponse;
import com.vk.api.sdk.objects.users.Fields;
import java.util.Arrays;
import java.util.List;

/**
 * Query for Messages.getByConversationMessageId method
 */
public class MessagesGetByConversationMessageIdQuery extends AbstractQueryBuilder<MessagesGetByConversationMessageIdQuery, GetByConversationMessageIdResponse> {
    /**
     * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
     *
     * @param client VK API client
     * @param actor actor with access token
     * @param peerId value of "peer id" parameter.
     * @param conversationMessageIds value of "conversation message ids" parameter.
     */
    public MessagesGetByConversationMessageIdQuery(VkApiClient client, UserActor actor, int peerId,
            Integer... conversationMessageIds) {
        super(client, "messages.getByConversationMessageId", GetByConversationMessageIdResponse.class);
        accessToken(actor.getAccessToken());
        peerId(peerId);
        conversationMessageIds(conversationMessageIds);
    }

    /**
     * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
     *
     * @param client VK API client
     * @param actor actor with access token
     * @param peerId value of "peer id" parameter.
     * @param conversationMessageIds value of "conversation message ids" parameter.
     */
    public MessagesGetByConversationMessageIdQuery(VkApiClient client, UserActor actor, int peerId,
            List<Integer> conversationMessageIds) {
        super(client, "messages.getByConversationMessageId", GetByConversationMessageIdResponse.class);
        accessToken(actor.getAccessToken());
        peerId(peerId);
        conversationMessageIds(conversationMessageIds);
    }

    /**
     * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
     *
     * @param client VK API client
     * @param actor actor with access token
     * @param peerId value of "peer id" parameter.
     * @param conversationMessageIds value of "conversation message ids" parameter.
     */
    public MessagesGetByConversationMessageIdQuery(VkApiClient client, GroupActor actor, int peerId,
            Integer... conversationMessageIds) {
        super(client, "messages.getByConversationMessageId", GetByConversationMessageIdResponse.class);
        accessToken(actor.getAccessToken());
        groupId(actor.getGroupId());
        peerId(peerId);
        conversationMessageIds(conversationMessageIds);
    }

    /**
     * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
     *
     * @param client VK API client
     * @param actor actor with access token
     * @param peerId value of "peer id" parameter.
     * @param conversationMessageIds value of "conversation message ids" parameter.
     */
    public MessagesGetByConversationMessageIdQuery(VkApiClient client, GroupActor actor, int peerId,
            List<Integer> conversationMessageIds) {
        super(client, "messages.getByConversationMessageId", GetByConversationMessageIdResponse.class);
        accessToken(actor.getAccessToken());
        groupId(actor.getGroupId());
        peerId(peerId);
        conversationMessageIds(conversationMessageIds);
    }

    /**
     * Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. "
     *
     * @param value value of "peer id" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected MessagesGetByConversationMessageIdQuery peerId(int value) {
        return unsafeParam("peer_id", value);
    }

    /**
     * Information whether the response should be extended
     *
     * @param value value of "extended" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public MessagesGetByConversationMessageIdQuery extended(Boolean value) {
        return unsafeParam("extended", value);
    }

    /**
     * Group ID (for group messages with group access token)
     *
     * @param value value of "group id" parameter. Minimum is 0.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public MessagesGetByConversationMessageIdQuery groupId(Integer value) {
        return unsafeParam("group_id", value);
    }

    /**
     * conversation_message_ids
     * Conversation message IDs.
     *
     * @param value value of "conversation message ids" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected MessagesGetByConversationMessageIdQuery conversationMessageIds(Integer... value) {
        return unsafeParam("conversation_message_ids", value);
    }

    /**
     * Conversation message IDs.
     *
     * @param value value of "conversation message ids" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected MessagesGetByConversationMessageIdQuery conversationMessageIds(List<Integer> value) {
        return unsafeParam("conversation_message_ids", value);
    }

    /**
     * fields
     * Profile fields to return.
     *
     * @param value value of "fields" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public MessagesGetByConversationMessageIdQuery fields(Fields... value) {
        return unsafeParam("fields", value);
    }

    /**
     * Profile fields to return.
     *
     * @param value value of "fields" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public MessagesGetByConversationMessageIdQuery fields(List<Fields> value) {
        return unsafeParam("fields", value);
    }

    @Override
    protected MessagesGetByConversationMessageIdQuery getThis() {
        return this;
    }

    @Override
    protected List<String> essentialKeys() {
        return Arrays.asList("peer_id", "conversation_message_ids", "access_token");
    }
}


text:
using System;

class TranslateDigitInBulgarian
{
    static void Main()
    {
        Console.WriteLine("Please enter a digit between 0 - 9: ");
        Console.WriteLine();
        byte digit = byte.Parse(Console.ReadLine());
        Console.WriteLine();
        switch (digit)
        {
            case 0:
                Console.WriteLine("Нула");
                break;
            case 1:
                Console.WriteLine("Едно");
                break;
            case 2:
                Console.WriteLine("Две");
                break;
            case 3:
                Console.WriteLine("Три");
                break;
            case 4:
                Console.WriteLine("Четири");
                break;
            case 5:
                Console.WriteLine("Пет");
                break;
            case 6:
                Console.WriteLine("Шест");
                break;
            case 7:
                Console.WriteLine("Седем");
                break;
            case 8:
                Console.WriteLine("Осем");
                break;
            case 9:
                Console.WriteLine("Девет");
                break;
            default:
                Console.WriteLine("Invalid digit!");
                break;
        }
        Console.WriteLine();
    }
}


text:
var validate = require('./../../public/js/vendor/validate');

global.Models = {};

var Model = Class('Model').includes(CustomEvent, CustomEventSupport)({

  validations : {},

  prototype : {
    errors : [],
    init : function init(properties) {
      if (typeof properties !== 'undefined') {
        Object.keys(properties).forEach(function (property) {
          this[property] = properties[property];
        }, this);
      }

      delete this._csrf;

      return this;
    },

    isValid : function isValid () {
      var validations, results, model;
      model = this;

      var valid = true;

      results = [];

      validations = this.constructor.validations;

      this.errors = [];

      if (!validations || Object.keys(validations).length === 0) {
        return valid;
      }

      var values = {};

      for (var validation in validations) {
        if (validations.hasOwnProperty(validation)) {
          values[validation] = model[validation];
        }
      }

      var result = validate(values, validations);

      if (result) {
        model.errors = result;
        valid = false
      }

      return valid;
    },

    getProperty : function getProperty(property) {
      return this[property];
    },

    setProperty : function setProperty(property, newValue) {
      var originalValue = this[property];

      if (newValue !== originalValue) {
        this[property] = newValue;

        this.dispatch('change', {
          property      : property,
          originalValue : originalValue,
          newValue      : newValue
        });

        this.dispatch('change:' + property, {
          originalValue : originalValue,
          newValue      : newValue
        });
      }

      return this;
    },

    save : function save(callback) {
      var model = this;

      if (!model.isValid()) {
        return callback(model.errors);
      }

      delete model.errors;

      if (!model.hasOwnProperty('id') && model.id !== '') {
        model.create(callback);
      } else {
        model.update(callback);
      }
    },

    create : function create(callback) {
      var model = this;

      model.constructor.dispatch('beforeCreate', {
        data : {
          'model' : model
        }
      });

      model.dispatch('beforeCreate');

      model._create(callback);
    },

    _create : function _create(callback) {
      logger.error('Not implemented _create()');
      callback('Not implemented _create()');
    },

    update : function update(callback) {
      var model = this;

      model.constructor.dispatch('beforeUpdate', {
        data : {
          'model' : model
        }
      });

      model.dispatch('beforeUpdate');

      model._update(callback);
    },

    _update : function _update(callback) {
      logger.error('Not implemented _update()');
      callback('Not implemented _update()');
    },

    destroy : function destroy(callback) {
      var model = this;

      model.constructor.dispatch('beforeDestroy', {
        data : {
          'model' : model
        }
      });

      model.dispatch('beforeDestroy');

      model._destroy(callback);
    },

    _destroy : function _destroy(callback) {
      logger.error('Not implemented _destroy()');
      callback('Not implemented _destroy()');
    }
  }
});

module.exports = Model;


text:
using namespace PhotoFlyControllers;
using namespace PhotoFlySettings;

RegistrationFormController::RegistrationFormController(QObject *parent) : QObject(parent)
{
    m_status = S_Ready;
    emit requstStatusChanged();
    m_service = new ServiceProvider();
}

//RegistrationFormController::RegistrationFormController(const RegistrationFormController &other) : QObject(other.parent())
//{

//}

void RegistrationFormController::processLogin(RegistrationFormData *data)
{

    QVariantMap map;
    map.insert(RegistrationFormData::EmailKey, data->getEmail());
    map.insert(RegistrationFormData::PasswordKey, data->getPassword());

    auto req = new GenericServiceRequest(this);
    req->setMessageType(ServiceMessageType::Req_Login);
    req->setContent(map);

    // tmp
    req->urlParameters().insert("user", data->getEmail());

    handleRequest(req);
}

void RegistrationFormController::processRegistration(RegistrationFormData *data)
{
    data->setEmail(data->getEmail().toLower());
    SerializationInfo info;
    data->getObjectInfo(info);
    auto map = info.asMap();

    auto req = new GenericServiceRequest(this);
    req->setMessageType(ServiceMessageType::Req_Register);
    req->setContent(map);

    handleRequest(req);
}

//int RegistrationFormController::status() const
//{
//    return static_cast<int>(m_status);
//}

void RegistrationFormController::setStatus(int status)
{
    m_status = static_cast<RegFormReqStatus>(status);
}

RegFormReqStatus RegistrationFormController::status() const
{
    return m_status;
}

void RegistrationFormController::setStatus(const RegFormReqStatus &status)
{
    m_status = status;
}

void RegistrationFormController::handleRequest(GenericServiceRequest *request)
{
    m_status = S_InProgress;
    emit requstStatusChanged();

    QtConcurrent::run( [&, request] {
        m_service->makeRequest(request);
        handleResponse(request);
    });

}

//        QMetaObject::invokeMethod(this, "handleResponse",
//                                  Qt::QueuedConnection,
//                                 Q_ARG(GenericServiceRequest *, request));
void RegistrationFormController::handleResponse(GenericServiceRequest *request)
{

    auto status = request->getResultStatus();

    bool ok = status != RequestResultStatus::Fail;
    QString errorMessage = request->getErrorString();// Note: Change to user message

    if (ok) {
        switch (request->getMessageType()) {
        case ServiceMessageType::Req_Login:
            ok = handleLoginResponse(request, &errorMessage);
            break;
        case ServiceMessageType::Req_Register:
//            ok = handleRegistrationResponse(request, &errorMessage);
            ok = true;
            break;
        default:
            ok = false;
            errorMessage = tr("Unknown request type");
            break;
        }
    }

    request->deleteLater();
    m_status = S_Ready;
    emit requstStatusChanged();
//    ok = true;
    emit requestResult(ok, errorMessage);
}

bool RegistrationFormController::handleLoginResponse(GenericServiceRequest *request, QString *errorString)
{
    if (!request) {
        *errorString = "inner error: handleLoginResponse";
        return false;
    }

    const auto& reqCont = request->getContent();
    const auto& respCont = request->getResult()->getContent();

    bool correctUser =
            respCont[RegistrationFormData::EmailKey].toString().toLower() ==
                reqCont[RegistrationFormData::EmailKey].toString().toLower() &&
            respCont[RegistrationFormData::PasswordKey].toString() ==
                reqCont[RegistrationFormData::PasswordKey].toString();

    if (correctUser) {
        RegistrationFormData userData;
        userData.deserialize(respCont);
//        appSettings.saveUserInfo(userData);
        return true;
    }

    *errorString = tr("Wrong user credentials");
    return false;

}

bool RegistrationFormController::handleRegistrationResponse(GenericServiceRequest *request, QString *errorString)
{

    if (!request) {
        *errorString = "inner error: handleRegistrationResponse";
        return false;
    }

    const auto& respCont = request->getResult()->getContent();

    qDebug() << "resp: " << respCont;

    return false;
}


text:
import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest';
import * as models from '../models';

/**
 * @class
 * MarketplaceAgreements
 * __NOTE__: An instance of this class is automatically created for an
 * instance of the MarketplaceOrderingAgreements.
 */
export interface MarketplaceAgreements {

    /**
     * Get marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<AgreementTerms>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    getWithHttpOperationResponse(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.AgreementTerms>>;

    /**
     * Get marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {AgreementTerms} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {AgreementTerms} [result]   - The deserialized result object if an error did not occur.
     *                      See {@link AgreementTerms} for more information.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    get(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.AgreementTerms>;
    get(publisherId: string, offerId: string, planId: string, callback: ServiceCallback<models.AgreementTerms>): void;
    get(publisherId: string, offerId: string, planId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.AgreementTerms>): void;

    /**
     * Save marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} parameters Parameters supplied to the Create Marketplace
     * Terms operation.
     *
     * @param {string} [parameters.publisher] Publisher identifier string of image
     * being deployed.
     *
     * @param {string} [parameters.product] Offer identifier string of image being
     * deployed.
     *
     * @param {string} [parameters.plan] Plan identifier string of image being
     * deployed.
     *
     * @param {string} [parameters.licenseTextLink] Link to HTML with Microsoft and
     * Publisher terms.
     *
     * @param {string} [parameters.privacyPolicyLink] Link to the privacy policy of
     * the publisher.
     *
     * @param {string} [parameters.retrieveDatetime] Date and time in UTC of when
     * the terms were accepted. This is empty if Accepted is false.
     *
     * @param {string} [parameters.signature] Terms signature.
     *
     * @param {boolean} [parameters.accepted] If any version of the terms have been
     * accepted, otherwise false.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<AgreementTerms>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    createWithHttpOperationResponse(publisherId: string, offerId: string, planId: string, parameters: models.AgreementTerms, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.AgreementTerms>>;

    /**
     * Save marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} parameters Parameters supplied to the Create Marketplace
     * Terms operation.
     *
     * @param {string} [parameters.publisher] Publisher identifier string of image
     * being deployed.
     *
     * @param {string} [parameters.product] Offer identifier string of image being
     * deployed.
     *
     * @param {string} [parameters.plan] Plan identifier string of image being
     * deployed.
     *
     * @param {string} [parameters.licenseTextLink] Link to HTML with Microsoft and
     * Publisher terms.
     *
     * @param {string} [parameters.privacyPolicyLink] Link to the privacy policy of
     * the publisher.
     *
     * @param {string} [parameters.retrieveDatetime] Date and time in UTC of when
     * the terms were accepted. This is empty if Accepted is false.
     *
     * @param {string} [parameters.signature] Terms signature.
     *
     * @param {boolean} [parameters.accepted] If any version of the terms have been
     * accepted, otherwise false.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {AgreementTerms} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {AgreementTerms} [result]   - The deserialized result object if an error did not occur.
     *                      See {@link AgreementTerms} for more information.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    create(publisherId: string, offerId: string, planId: string, parameters: models.AgreementTerms, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.AgreementTerms>;
    create(publisherId: string, offerId: string, planId: string, parameters: models.AgreementTerms, callback: ServiceCallback<models.AgreementTerms>): void;
    create(publisherId: string, offerId: string, planId: string, parameters: models.AgreementTerms, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.AgreementTerms>): void;

    /**
     * Sign marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<AgreementTerms>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    signWithHttpOperationResponse(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.AgreementTerms>>;

    /**
     * Sign marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {AgreementTerms} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {AgreementTerms} [result]   - The deserialized result object if an error did not occur.
     *                      See {@link AgreementTerms} for more information.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    sign(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.AgreementTerms>;
    sign(publisherId: string, offerId: string, planId: string, callback: ServiceCallback<models.AgreementTerms>): void;
    sign(publisherId: string, offerId: string, planId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.AgreementTerms>): void;

    /**
     * Cancel marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<AgreementTerms>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    cancelWithHttpOperationResponse(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.AgreementTerms>>;

    /**
     * Cancel marketplace terms.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {AgreementTerms} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {AgreementTerms} [result]   - The deserialized result object if an error did not occur.
     *                      See {@link AgreementTerms} for more information.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    cancel(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.AgreementTerms>;
    cancel(publisherId: string, offerId: string, planId: string, callback: ServiceCallback<models.AgreementTerms>): void;
    cancel(publisherId: string, offerId: string, planId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.AgreementTerms>): void;

    /**
     * Get marketplace agreement.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<AgreementTerms>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    getAgreementWithHttpOperationResponse(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.AgreementTerms>>;

    /**
     * Get marketplace agreement.
     *
     * @param {string} publisherId Publisher identifier string of image being
     * deployed.
     *
     * @param {string} offerId Offer identifier string of image being deployed.
     *
     * @param {string} planId Plan identifier string of image being deployed.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {AgreementTerms} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {AgreementTerms} [result]   - The deserialized result object if an error did not occur.
     *                      See {@link AgreementTerms} for more information.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    getAgreement(publisherId: string, offerId: string, planId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.AgreementTerms>;
    getAgreement(publisherId: string, offerId: string, planId: string, callback: ServiceCallback<models.AgreementTerms>): void;
    getAgreement(publisherId: string, offerId: string, planId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.AgreementTerms>): void;

    /**
     * List marketplace agreements in the subscription.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<Array>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.AgreementTerms[]>>;

    /**
     * List marketplace agreements in the subscription.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {Array} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {Array} [result]   - The deserialized result object if an error did not occur.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.AgreementTerms[]>;
    list(callback: ServiceCallback<models.AgreementTerms[]>): void;
    list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.AgreementTerms[]>): void;
}

/**
 * @class
 * Operations
 * __NOTE__: An instance of this class is automatically created for an
 * instance of the MarketplaceOrderingAgreements.
 */
export interface Operations {

    /**
     * Lists all of the available Microsoft.MarketplaceOrdering REST API
     * operations.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<OperationListResult>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.OperationListResult>>;

    /**
     * Lists all of the available Microsoft.MarketplaceOrdering REST API
     * operations.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {OperationListResult} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {OperationListResult} [result]   - The deserialized result object if an error did not occur.
     *                      See {@link OperationListResult} for more information.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.OperationListResult>;
    list(callback: ServiceCallback<models.OperationListResult>): void;
    list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.OperationListResult>): void;

    /**
     * Lists all of the available Microsoft.MarketplaceOrdering REST API
     * operations.
     *
     * @param {string} nextPageLink The NextLink from the previous successful call
     * to List operation.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @returns {Promise} A promise is returned
     *
     * @resolve {HttpOperationResponse<OperationListResult>} - The deserialized result object.
     *
     * @reject {Error|ServiceError} - The error object.
     */
    listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.OperationListResult>>;

    /**
     * Lists all of the available Microsoft.MarketplaceOrdering REST API
     * operations.
     *
     * @param {string} nextPageLink The NextLink from the previous successful call
     * to List operation.
     *
     * @param {object} [options] Optional Parameters.
     *
     * @param {object} [options.customHeaders] Headers that will be added to the
     * request
     *
     * @param {ServiceCallback} [optionalCallback] - The optional callback.
     *
     * @returns {ServiceCallback|Promise} If a callback was passed as the last
     * parameter then it returns the callback else returns a Promise.
     *
     * {Promise} A promise is returned.
     *
     *                      @resolve {OperationListResult} - The deserialized result object.
     *
     *                      @reject {Error|ServiceError} - The error object.
     *
     * {ServiceCallback} optionalCallback(err, result, request, response)
     *
     *                      {Error|ServiceError}  err        - The Error object if an error occurred, null otherwise.
     *
     *                      {OperationListResult} [result]   - The deserialized result object if an error did not occur.
     *                      See {@link OperationListResult} for more information.
     *
     *                      {WebResource} [request]  - The HTTP Request object if an error did not occur.
     *
     *                      {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
     */
    listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.OperationListResult>;
    listNext(nextPageLink: string, callback: ServiceCallback<models.OperationListResult>): void;
    listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.OperationListResult>): void;
}


text:
'use strict';

var isClassSupported = require( './../lib' );

var bool = isClassSupported();
if ( bool ) {
	console.log( 'Environment has native class support.' );
} else {
	console.log( 'Environment lacks native class support.' );
}


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

<title>EXTPalettedTexture (LWJGL API)</title>
<meta name="date" content="2013-12-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

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.lwjgl.opengl

Class EXTPalettedTexture

java.lang.Object

org.lwjgl.opengl.EXTPalettedTexture

public final class EXTPalettedTexture
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field and Description

static int
GL_COLOR_INDEX1_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

static int
GL_COLOR_INDEX12_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

static int
GL_COLOR_INDEX16_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

static int
GL_COLOR_INDEX2_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

static int
GL_COLOR_INDEX4_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

static int
GL_COLOR_INDEX8_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

static int
GL_COLOR_TABLE_ALPHA_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_COLOR_TABLE_BLUE_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_COLOR_TABLE_FORMAT_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_COLOR_TABLE_GREEN_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_COLOR_TABLE_INTENSITY_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_COLOR_TABLE_LUMINANCE_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_COLOR_TABLE_RED_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_COLOR_TABLE_WIDTH_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

static int
GL_TEXTURE_INDEX_SIZE_EXT

Accepted by the value parameter of GetTexLevelParameter{if}v:

Method Summary

Methods

Modifier and Type
Method and Description

static void
glColorSubTableEXT(int target,
                  int start,
                  int count,
                  int format,
                  int type,
                  java.nio.ByteBuffer data)

static void
glColorSubTableEXT(int target,
                  int start,
                  int count,
                  int format,
                  int type,
                  java.nio.DoubleBuffer data)

static void
glColorSubTableEXT(int target,
                  int start,
                  int count,
                  int format,
                  int type,
                  java.nio.FloatBuffer data)

static void
glColorSubTableEXT(int target,
                  int start,
                  int count,
                  int format,
                  int type,
                  java.nio.IntBuffer data)

static void
glColorSubTableEXT(int target,
                  int start,
                  int count,
                  int format,
                  int type,
                  java.nio.ShortBuffer data)

static void
glColorTableEXT(int target,
               int internalFormat,
               int width,
               int format,
               int type,
               java.nio.ByteBuffer data)

static void
glColorTableEXT(int target,
               int internalFormat,
               int width,
               int format,
               int type,
               java.nio.DoubleBuffer data)

static void
glColorTableEXT(int target,
               int internalFormat,
               int width,
               int format,
               int type,
               java.nio.FloatBuffer data)

static void
glColorTableEXT(int target,
               int internalFormat,
               int width,
               int format,
               int type,
               java.nio.IntBuffer data)

static void
glColorTableEXT(int target,
               int internalFormat,
               int width,
               int format,
               int type,
               java.nio.ShortBuffer data)

static void
glGetColorTableEXT(int target,
                  int format,
                  int type,
                  java.nio.ByteBuffer data)

static void
glGetColorTableEXT(int target,
                  int format,
                  int type,
                  java.nio.DoubleBuffer data)

static void
glGetColorTableEXT(int target,
                  int format,
                  int type,
                  java.nio.FloatBuffer data)

static void
glGetColorTableEXT(int target,
                  int format,
                  int type,
                  java.nio.IntBuffer data)

static void
glGetColorTableEXT(int target,
                  int format,
                  int type,
                  java.nio.ShortBuffer data)

static void
glGetColorTableParameterEXT(int target,
                           int pname,
                           java.nio.FloatBuffer params)

static void
glGetColorTableParameterEXT(int target,
                           int pname,
                           java.nio.IntBuffer params)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

GL_COLOR_INDEX1_EXT

public static final int GL_COLOR_INDEX1_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

See Also:

Constant Field Values

GL_COLOR_INDEX2_EXT

public static final int GL_COLOR_INDEX2_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

See Also:

Constant Field Values

GL_COLOR_INDEX4_EXT

public static final int GL_COLOR_INDEX4_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

See Also:

Constant Field Values

GL_COLOR_INDEX8_EXT

public static final int GL_COLOR_INDEX8_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

See Also:

Constant Field Values

GL_COLOR_INDEX12_EXT

public static final int GL_COLOR_INDEX12_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

See Also:

Constant Field Values

GL_COLOR_INDEX16_EXT

public static final int GL_COLOR_INDEX16_EXT

Accepted by the internalformat parameter of TexImage1D, TexImage2D and
  TexImage3DEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_FORMAT_EXT

public static final int GL_COLOR_TABLE_FORMAT_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_WIDTH_EXT

public static final int GL_COLOR_TABLE_WIDTH_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_RED_SIZE_EXT

public static final int GL_COLOR_TABLE_RED_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_GREEN_SIZE_EXT

public static final int GL_COLOR_TABLE_GREEN_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_BLUE_SIZE_EXT

public static final int GL_COLOR_TABLE_BLUE_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_ALPHA_SIZE_EXT

public static final int GL_COLOR_TABLE_ALPHA_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_LUMINANCE_SIZE_EXT

public static final int GL_COLOR_TABLE_LUMINANCE_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_COLOR_TABLE_INTENSITY_SIZE_EXT

public static final int GL_COLOR_TABLE_INTENSITY_SIZE_EXT

Accepted by the pname parameter of GetColorTableParameterivEXT and
  GetColorTableParameterfvEXT:

See Also:

Constant Field Values

GL_TEXTURE_INDEX_SIZE_EXT

public static final int GL_TEXTURE_INDEX_SIZE_EXT

Accepted by the value parameter of GetTexLevelParameter{if}v:

See Also:

Constant Field Values

Method Detail

glColorTableEXT

public static void glColorTableEXT(int target,
                   int internalFormat,
                   int width,
                   int format,
                   int type,
                   java.nio.ByteBuffer data)

glColorTableEXT

public static void glColorTableEXT(int target,
                   int internalFormat,
                   int width,
                   int format,
                   int type,
                   java.nio.DoubleBuffer data)

glColorTableEXT

public static void glColorTableEXT(int target,
                   int internalFormat,
                   int width,
                   int format,
                   int type,
                   java.nio.FloatBuffer data)

glColorTableEXT

public static void glColorTableEXT(int target,
                   int internalFormat,
                   int width,
                   int format,
                   int type,
                   java.nio.IntBuffer data)

glColorTableEXT

public static void glColorTableEXT(int target,
                   int internalFormat,
                   int width,
                   int format,
                   int type,
                   java.nio.ShortBuffer data)

glColorSubTableEXT

public static void glColorSubTableEXT(int target,
                      int start,
                      int count,
                      int format,
                      int type,
                      java.nio.ByteBuffer data)

glColorSubTableEXT

public static void glColorSubTableEXT(int target,
                      int start,
                      int count,
                      int format,
                      int type,
                      java.nio.DoubleBuffer data)

glColorSubTableEXT

public static void glColorSubTableEXT(int target,
                      int start,
                      int count,
                      int format,
                      int type,
                      java.nio.FloatBuffer data)

glColorSubTableEXT

public static void glColorSubTableEXT(int target,
                      int start,
                      int count,
                      int format,
                      int type,
                      java.nio.IntBuffer data)

glColorSubTableEXT

public static void glColorSubTableEXT(int target,
                      int start,
                      int count,
                      int format,
                      int type,
                      java.nio.ShortBuffer data)

glGetColorTableEXT

public static void glGetColorTableEXT(int target,
                      int format,
                      int type,
                      java.nio.ByteBuffer data)

glGetColorTableEXT

public static void glGetColorTableEXT(int target,
                      int format,
                      int type,
                      java.nio.DoubleBuffer data)

glGetColorTableEXT

public static void glGetColorTableEXT(int target,
                      int format,
                      int type,
                      java.nio.FloatBuffer data)

glGetColorTableEXT

public static void glGetColorTableEXT(int target,
                      int format,
                      int type,
                      java.nio.IntBuffer data)

glGetColorTableEXT

public static void glGetColorTableEXT(int target,
                      int format,
                      int type,
                      java.nio.ShortBuffer data)

glGetColorTableParameterEXT

public static void glGetColorTableParameterEXT(int target,
                               int pname,
                               java.nio.IntBuffer params)

glGetColorTableParameterEXT

public static void glGetColorTableParameterEXT(int target,
                               int pname,
                               java.nio.FloatBuffer params)

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 © 2002-2009 lwjgl.org. All Rights Reserved.


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.gwtwidgets.server.spring.integrationtests;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.gargoylesoftware.htmlunit.html.HtmlPage;

import static org.junit.Assert.*;

/**
 * Integration test that runs a tomcat, deploys the GWT web applications,
 * hits it with an htmlunit browser and checks that the web applications
 * runs in the browser as expected. The test web application loads the
 * GWT compiled applications and communicates rather heavily with the
 * server over RPC, testing GWT-SL Spring integration.
 * @author George Georgovassilis, g.georgovassilis[at]gmail.com
 *
 */

@Category(WebserverTest.class)
public class IntegrationTest extends BaseIntegrationTest{

	void waitForTextOnPage(HtmlPage page, String text) throws Exception{
		//wait for tests to finish
		long time = -System.currentTimeMillis();
		while (!page.asText().contains(text)){
			Thread.sleep(500);
			if (time+System.currentTimeMillis()>TIMEOUT)
				throw new Exception("Test timed out");
		}
	}

	@Test
	public void test_page() throws Exception{

		HtmlPage page = webClient.getPage(baseUrl);
		waitForTextOnPage(page, "Tests finished in");
		String p = page.asText();
		assertTrue(p.contains("(0) Test1 success: 7"));
		assertTrue(p.contains("(0) Test2 success: null"));
		assertTrue(p.contains("(0) Test3 success"));
		assertTrue(p.contains("(0) Test4 success"));
		assertTrue(p.contains("(0) Test5 success"));
		assertTrue(p.contains("(0) Test5b success"));

		assertTrue(p.contains("(1) Test1 success: 7"));
		assertTrue(p.contains("(1) Test2 success"));
		assertTrue(p.contains("(1) Test3 success:"));
		assertTrue(p.contains("(1) Test4 success"));
		assertTrue(p.contains("(1) Test5 success"));
		assertTrue(p.contains("(1) Test5b success"));

		assertTrue(p.contains("(2) Test1 success: 7"));
		assertTrue(p.contains("(2) Test2 success"));
		assertTrue(p.contains("(2) Test3 success"));
		assertTrue(p.contains("(2) Test4 success"));
		assertTrue(p.contains("(2) Test5 success"));
		assertTrue(p.contains("(2) Test5b success"));

		assertTrue(p.contains("(3) Test1 success: 7"));
		assertTrue(p.contains("(3) Test2 success"));
		assertTrue(p.contains("(3) Test3 success"));
		assertTrue(p.contains("(3) Test4 success"));
		assertTrue(p.contains("(3) Test5 success"));
		assertTrue(p.contains("(3) Test5b success"));

		assertTrue(p.contains("(4) Test1 success: 7"));
		assertTrue(p.contains("(4) Test2 success"));
		assertTrue(p.contains("(4) Test3 success"));
		assertTrue(p.contains("(4) Test4 success"));
		assertTrue(p.contains("(4) Test5 success"));
		assertTrue(p.contains("(4) Test5b success"));

		assertTrue(p.contains("(5) Test1 success: 7"));
		assertTrue(p.contains("(5) Test2 success"));
		assertTrue(p.contains("(5) Test3 success"));
		assertTrue(p.contains("(5) Test4 success"));
		assertTrue(p.contains("(5) Test5 success"));
		assertTrue(p.contains("(5) Test5b success"));

		assertTrue(p.contains("(6) Test1 success: 7"));
		assertTrue(p.contains("(6) Test2 success"));
		assertTrue(p.contains("(6) Test3 success"));
		assertTrue(p.contains("(6) Test4 success"));
		assertTrue(p.contains("(6) Test5 success"));
		assertTrue(p.contains("(6) Test5b success"));

		assertTrue(p.contains("(7) Test1 success: 7"));
		assertTrue(p.contains("(7) Test2 success"));
		assertTrue(p.contains("(7) Test3 success"));
		assertTrue(p.contains("(7) Test4 success"));
		assertTrue(p.contains("(7) Test5 success"));
		assertTrue(p.contains("(7) Test5b success"));

		assertTrue(p.contains("(8) Test1 success: 7"));
		assertTrue(p.contains("(8) Test2 success"));
		assertTrue(p.contains("(8) Test3 success"));
		assertTrue(p.contains("(8) Test4 success"));
		assertTrue(p.contains("(8) Test5 success"));
		assertTrue(p.contains("(8) Test5b success"));

		assertTrue(p.contains("(9) Test success"));
		assertTrue(p.contains("(10) Test success"));
		assertTrue(p.contains("(11) Test success"));
	}

}


text:
volatile Uint32 Xint1Count;
volatile Uint32 Xint2Count;
Uint32 LoopCount;

//
// Function Prototypes
//
interrupt void xint1_isr(void);
interrupt void xint2_isr(void);

//
// Main
//
void main(void)
{
   Uint32 TempX1Count;
   Uint32 TempX2Count;

//
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xS_SysCtrl.c file.
//
   InitSysCtrl();

//
// Step 2. Initialize GPIO:
// This example function is found in the F2837xS_Gpio.c file and
// illustrates how to set the GPIO to its default state.
//
// InitGpio();  // Skipped for this example

//
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
//
   DINT;

//
// Initialize PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the F2837xS_PieCtrl.c file.
//
   InitPieCtrl();

//
// Disable CPU interrupts and clear all CPU interrupt flags:
//
   IER = 0x0000;
   IFR = 0x0000;

//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table, even if the interrupt
// is not used in this example.  This is useful for debug purposes.
// The shell ISR routines are found in F2837xS_DefaultIsr.c.
// This function is found in F2837xS_PieVect.c.
//
   InitPieVectTable();

//
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
//
   EALLOW;	// This is needed to write to EALLOW protected registers
   PieVectTable.XINT1_INT = &xint1_isr;
   PieVectTable.XINT2_INT = &xint2_isr;
   EDIS;    // This is needed to disable write to EALLOW protected registers

//
// Step 4. User specific code, enable interrupts:
//
// Clear the counters
//
   Xint1Count = 0; // Count XINT1 interrupts
   Xint2Count = 0; // Count XINT2 interrupts
   LoopCount = 0;  // Count times through idle loop

//
// Enable XINT1 and XINT2 in the PIE: Group 1 interrupt 4 & 5
// Enable INT1 which is connected to WAKEINT:
//
   PieCtrlRegs.PIECTRL.bit.ENPIE = 1;          // Enable the PIE block
   PieCtrlRegs.PIEIER1.bit.INTx4 = 1;          // Enable PIE Group 1 INT4
   PieCtrlRegs.PIEIER1.bit.INTx5 = 1;          // Enable PIE Group 1 INT5
   IER |= M_INT1;                              // Enable CPU INT1
   EINT;                                       // Enable Global Interrupts

//
// GPIO30 & GPIO31 are outputs, start GPIO30 high and GPIO31 low
//
   EALLOW;
   GpioDataRegs.GPASET.bit.GPIO30 = 1;         // Load the output latch
   GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 0;        // GPIO
   GpioCtrlRegs.GPADIR.bit.GPIO30 = 1;         // output

   GpioDataRegs.GPACLEAR.bit.GPIO31 = 1;       // Load the output latch
   GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 0;        // GPIO
   GpioCtrlRegs.GPADIR.bit.GPIO31 = 1;         // output
   EDIS;

//
// GPIO0 and GPIO1 are inputs
//
   EALLOW;
   GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;         // GPIO
   GpioCtrlRegs.GPADIR.bit.GPIO0 = 0;          // input
   GpioCtrlRegs.GPAQSEL1.bit.GPIO0 = 0;        // XINT1 Synch to SYSCLKOUT only

   GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 0;         // GPIO
   GpioCtrlRegs.GPADIR.bit.GPIO1 = 0;          // input
   GpioCtrlRegs.GPAQSEL1.bit.GPIO1 = 2;        // XINT2 Qual using 6 samples
   GpioCtrlRegs.GPACTRL.bit.QUALPRD0 = 0xFF;   // Each sampling window
                                               // is 510*SYSCLKOUT
   EDIS;

//
// GPIO0 is XINT1, GPIO1 is XINT2
//
   GPIO_SetupXINT1Gpio(0);
   GPIO_SetupXINT2Gpio(1);

//
// Configure XINT1
//
   XintRegs.XINT1CR.bit.POLARITY = 0;          // Falling edge interrupt
   XintRegs.XINT2CR.bit.POLARITY = 1;          // Rising edge interrupt

//
// Enable XINT1 and XINT2
//
   XintRegs.XINT1CR.bit.ENABLE = 1;            // Enable XINT1
   XintRegs.XINT2CR.bit.ENABLE = 1;            // Enable XINT2

//
// GPIO34 will go low inside each interrupt.  Monitor this on a scope
//
   EALLOW;
   GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 0;        // GPIO
   GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1;         // output
   EDIS;

//
// Step 5. IDLE loop:
//
   for(;;)
   {
      TempX1Count = Xint1Count;
      TempX2Count = Xint2Count;

      //
      // Trigger both XINT1
      //
      GpioDataRegs.GPBSET.bit.GPIO34 = 1;      // GPIO34 is high
      GpioDataRegs.GPACLEAR.bit.GPIO30 = 1;    // Lower GPIO30, trigger XINT1
      while(Xint1Count == TempX1Count) {}

      //
      // Trigger both XINT2
      //
      GpioDataRegs.GPBSET.bit.GPIO34 = 1;      // GPIO34 is high
      DELAY_US(DELAY);                         // Wait for Qual period
      GpioDataRegs.GPASET.bit.GPIO31 = 1;      // Raise GPIO31, trigger XINT2
      while(Xint2Count == TempX2Count) {}

      //
      // Check that the counts were incremented properly and get ready
      // to start over.
      //
      if(Xint1Count == TempX1Count + 1 && Xint2Count == TempX2Count + 1)
      {
          LoopCount++;
          GpioDataRegs.GPASET.bit.GPIO30 = 1;   // raise GPIO30
          GpioDataRegs.GPACLEAR.bit.GPIO31 = 1; // lower GPIO31
      }
      else
      {
         asm("      ESTOP0"); // stop here
      }
   }
}

//
// xint1_isr - External Interrupt 1 ISR
//
interrupt void xint1_isr(void)
{
	GpioDataRegs.GPBCLEAR.all = 0x4;   // GPIO34 is low
	Xint1Count++;

    //
	// Acknowledge this interrupt to get more from group 1
    //
	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

//
// xint2_isr - External Interrupt 2 ISR
//
interrupt void xint2_isr(void)
{
	GpioDataRegs.GPBCLEAR.all = 0x4;   // GPIO34 is low
	Xint2Count++;

    //
	// Acknowledge this interrupt to get more from group 1
    //
	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

//
// End of file
//


text:
/*
 * File:   PEMatches.h
 * Author: david
 *
 * Created on April 8, 2012, 11:34 PM
 */

/*
 *
 *  Copyright (c) 2008, 2011, 2012, 2013
 *  David Hernandez, Patrice Francois, Jacques Schrenzel
 *
 *  This file is part of EDENA.
 *
 *  EDENA is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  EDENA is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with EDENA.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef PEMATCHES_H
#define	PEMATCHES_H

#include "Pairing.h"
#include <vector>
#include <cmath>

using namespace std;

class PEMatches;

class PEMatchesStorage {

public:

    PEMatchesStorage(Pairing *p);
    ~PEMatchesStorage();

    void allocate();
    void doubleAllocatedSize();
    void freeMemory();

    void initStorage();

    //return an initialized element
    PEMatches* getPPEMatches(unsigned int nChoice);

private:

    PEMatches  **V;
    Pairing *P;
    size_t nElement;
    size_t maxSize;
};

class PEMatches {
public:
    PEMatches();
    PEMatches(const PEMatches& orig);
    virtual ~PEMatches();

    void init(unsigned int n);
    void allocate();
    void doubleAllocationSize();
    void freeMemory();
    inline unsigned int getCount(unsigned int lib, unsigned i){return counts[lib-1][i];}
    inline unsigned int getNChoice(){return nBranch;}
    inline double getMean(unsigned int lib, unsigned int i){return sumDist[lib-1][i]/counts[lib-1][i];}
    double getVar(unsigned int lib,unsigned int i);
    inline double getSD(unsigned int lib, unsigned int i){return sqrt( getVar(lib,i));}
    inline void addMatch(unsigned int lib, unsigned int i, double distance){counts[lib-1][i]++;sumDist[lib-1][i]+=distance;sumDistSquare[lib-1][i]+=(distance*distance);}

    void getMaxCount(unsigned int lib, unsigned int &sumCount, unsigned int &max, size_t&maxIndex);
    inline int getSumCount(unsigned int lib){unsigned int sum=0; for(unsigned int i=0; i<nBranch; i++)sum+=counts[lib-1][i];return sum;}

    static Pairing *P;
    static unsigned int nLibrary;

private:

    unsigned int **counts;
    double **sumDist;
    double **sumDistSquare;
    unsigned int maxBranch;
    unsigned int nBranch;
};

#endif	/* PEMATCHES_H */


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sphaerotheca fuliginea f. saussureae Golovin

### Remarks
null


text:
function createCookie(name, value, days) {
	localStorage.setItem(name, value);
}

function readCookie(name) {
	return localStorage.getItem(name);
}

function toggleInherited(el) {
	var toggle = $(el).closest(".toggle");
	toggle.toggleClass("toggle-on");
	if (toggle.hasClass("toggle-on")) {
		$("img", toggle).attr("src", dox.rootPath + "triangle-opened.png");
	} else {
		$("img", toggle).attr("src", dox.rootPath + "triangle-closed.png");
	}
    return false;
}

function toggleCollapsed(el) {
	var toggle = $(el).closest(".expando");
	toggle.toggleClass("expanded");

	if (toggle.hasClass("expanded")) {
		$("img", toggle).first().attr("src", dox.rootPath + "triangle-opened.png");
	} else {
		$("img", toggle).first().attr("src", dox.rootPath + "triangle-closed.png");
	}
	updateTreeState();
    return false;
}

function updateTreeState(){
	var states = [];
	$("#nav .expando").each(function(i, e){
		states.push($(e).hasClass("expanded") ? 1 : 0);
	});
	var treeState = JSON.stringify(states);
	createCookie("treeState", treeState);
}

var filters = {};

function selectPlatform(e) {
	setPlatform($(e.target).parent().attr("data"));
}

function selectVersion(e) {
	setVersion($(e.target).parent().attr("data"));
}

function setPlatform(platform) {
	selectItem("platform", platform);

	var styles = ".platform { display:none }";
	var platforms = dox.platforms;

	for (var i = 0; i < platforms.length; i++)
	{
		var p = platforms[i];

		if (platform == "sys")
		{
			if (p != "flash" && p != "flash8" && p != "js")
			{
				styles += ".platform-" + p + " { display:inherit } ";
			}
		}
		else
		{
			if (platform == "all" || p == platform)
			{
				styles += ".platform-" + p + " { display:inherit } ";
			}
		}
	}

	if (platform != "flash" && platform != "flash8" && platform != "js")
	{
		styles += ".platform-sys { display:inherit } ";
	}

	$("#dynamicStylesheet").text(styles);
}

function setVersion(version) {
	selectItem("version", version);
}

function selectItem(filter, value)
{
	var dropdown = $("#select-" + filter);
	var item = $("li[data='"+value+"']", dropdown);
	var label = $("a", item).text();
	$(".dropdown-toggle", dropdown).html(label + '<b class="caret">');
	$("li.active", dropdown).removeClass("active");
	item.addClass("active");
	createCookie(filter, value);
}

$(document).ready(function(){
	$("#nav").html(navContent);
	var treeState = readCookie("treeState");

	$("#nav .expando").each(function(i, e){
		$("img", e).first().attr("src", dox.rootPath + "triangle-closed.png");
	});

	$(".treeLink").each(function() {
		this.href = this.href.replace("::rootPath::", dox.rootPath);
	});

	if (treeState != null)
	{
		var states = JSON.parse(treeState);
		$("#nav .expando").each(function(i, e){
			if (states[i]) {
				$(e).addClass("expanded");
				$("img", e).first().attr("src", dox.rootPath + "triangle-opened.png");
			}
		});
	}
	$("head").append("<style id='dynamicStylesheet'></style>");

	setPlatform(readCookie("platform") == null ? "all" : readCookie("platform"));
	setVersion(readCookie("version") == null ? "3_0" : readCookie("version"));

	$("#search").on("input", function(e){
		searchQuery(e.target.value);
	});

	$("#nav a").each(function () {
		if (this.href == location.href) {
			$(this.parentElement).addClass("active");
		}
	});

    // Because there is no CSS parent selector
    $("code.prettyprint").parents("pre").addClass("example");
});

function searchQuery(query) {
	query = query.toLowerCase();
	$("#searchForm").removeAttr("action");
	if (query == "") {
		$("#nav").removeClass("searching");
		$("#nav li").each(function(index, element){
			var e = $(element);
			e.css("display", "");
		});
		return;
	}

	console.log("Searching: "+query);

	var searchSet = false;

	$("#nav").addClass("searching");
	$("#nav li").each(function(index, element){
		var e = $(element);
		if (!e.hasClass("expando")) {
			var content = e.attr("data_path").toLowerCase();
			var match = searchMatch(content, query);
			if (match && !searchSet) {
				var url = dox.rootPath + e.attr("data_path").split(".").join("/") + ".html";
				$("#searchForm").attr("action", url);
				searchSet = true;
			}
			e.css("display", match ? "" : "none");
		}
	});

}

function searchMatch(text, query) {
	// I should be working at Google.
	return text.indexOf(query) > -1;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nest;
using Tests.Framework;
using Tests.Framework.MockData;
using static Tests.Framework.UrlTester;

namespace Tests.Modules.SnapshotAndRestore.Snapshot.SnapshotStatus
{
	public class SnapshotStatusUrlTests
	{
		[U] public async Task Urls()
		{
			await GET("/_snapshot/_status")
				.Fluent(c => c.SnapshotStatus())
				.Request(c => c.SnapshotStatus(new SnapshotStatusRequest()))
				.FluentAsync(c => c.SnapshotStatusAsync())
				.RequestAsync(c => c.SnapshotStatusAsync(new SnapshotStatusRequest()))
				;

			var repository = "repos";
			await GET($"/_snapshot/{repository}/_status")
				.Fluent(c => c.SnapshotStatus(s=>s.RepositoryName(repository)))
				.Request(c => c.SnapshotStatus(new SnapshotStatusRequest(repository)))
				.FluentAsync(c => c.SnapshotStatusAsync(s=>s.RepositoryName(repository)))
				.RequestAsync(c => c.SnapshotStatusAsync(new SnapshotStatusRequest(repository)))
				;
			var snapshot = "snap";
			await GET($"/_snapshot/{repository}/{snapshot}/_status")
				.Fluent(c => c.SnapshotStatus(s=>s.RepositoryName(repository).Snapshot(snapshot)))
				.Request(c => c.SnapshotStatus(new SnapshotStatusRequest(repository, snapshot)))
				.FluentAsync(c => c.SnapshotStatusAsync(s=>s.RepositoryName(repository).Snapshot(snapshot)))
				.RequestAsync(c => c.SnapshotStatusAsync(new SnapshotStatusRequest(repository, snapshot)))
				;
		}
	}
}


text:
package org.apache.spark.sql

import com.esotericsoftware.kryo.{Kryo, Serializer}
import com.esotericsoftware.kryo.io.{Input, Output}

import org.apache.spark.SparkConf
import org.apache.spark.internal.config.Kryo._
import org.apache.spark.serializer.KryoRegistrator
import org.apache.spark.sql.test.SharedSparkSession

/**
 * Test suite to test Kryo custom registrators.
 */
class DatasetSerializerRegistratorSuite extends QueryTest with SharedSparkSession {
  import testImplicits._

  override def sparkConf: SparkConf =
    super.sparkConf
      .setAppName("test")
      .set("spark.sql.parquet.columnarReaderBatchSize", "4096")
      .set("spark.sql.sources.useV1SourceList", "avro")
      .set("spark.sql.extensions", "com.intel.oap.ColumnarPlugin")
      .set("spark.sql.execution.arrow.maxRecordsPerBatch", "4096")
      //.set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager")
      .set("spark.memory.offHeap.enabled", "true")
      .set("spark.memory.offHeap.size", "50m")
      .set("spark.sql.join.preferSortMergeJoin", "false")
      .set("spark.sql.columnar.codegen.hashAggregate", "false")
      .set("spark.oap.sql.columnar.wholestagecodegen", "false")
      .set("spark.sql.columnar.window", "false")
      .set("spark.unsafe.exceptionOnMemoryLeak", "false")
      //.set("spark.sql.columnar.tmp_dir", "/codegen/nativesql/")
      .set("spark.sql.columnar.sort.broadcastJoin", "true")
      .set("spark.oap.sql.columnar.preferColumnar", "true")
      .set(KRYO_USER_REGISTRATORS, TestRegistrator().getClass.getCanonicalName)

//  override protected def sparkConf: SparkConf = {
//    // Make sure we use the KryoRegistrator
//    super.sparkConf.set(KRYO_USER_REGISTRATORS, TestRegistrator().getClass.getCanonicalName)
//  }

  test("Kryo registrator") {
    implicit val kryoEncoder = Encoders.kryo[KryoData]
    val ds = Seq(KryoData(1), KryoData(2)).toDS()
    assert(ds.collect().toSet == Set(KryoData(0), KryoData(0)))
  }

}

/** Used to test user provided registrator. */
class TestRegistrator extends KryoRegistrator {
  override def registerClasses(kryo: Kryo): Unit =
    kryo.register(classOf[KryoData], new ZeroKryoDataSerializer())
}

object TestRegistrator {
  def apply(): TestRegistrator = new TestRegistrator()
}

/**
 * A `Serializer` that takes a [[KryoData]] and serializes it as KryoData(0).
 */
class ZeroKryoDataSerializer extends Serializer[KryoData] {
  override def write(kryo: Kryo, output: Output, t: KryoData): Unit = {
    output.writeInt(0)
  }

  override def read(kryo: Kryo, input: Input, aClass: Class[KryoData]): KryoData = {
    KryoData(input.readInt())
  }
}


text:
from setuptools import setup, find_packages

setup(
    name='pymogilefs',
    version='0.1.1-1',
    description='Python MogileFS Client',
    long_description='Python MogileFS Client',
    url='https://github.com/bwind/pymogilefs',
    classifiers=(
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ),
    author='Bas Wind',
    author_email='mailtobwind@gmail.com',
    license='MIT',
    packages=['pymogilefs'],
    install_requires=['requests>=2.12.3'],
)


text:
require 'acts_as_vacl'

ApplicationController.prepend_view_path( File.join( File.dirname( __FILE__ ), 'app', 'views' ) )

model_path = File.join( directory, 'lib', 'app', 'models' )
$LOAD_PATH << model_path
ActiveSupport::Dependencies.load_paths << model_path

controller_path = File.join(directory, 'lib', 'app', 'controllers')
$LOAD_PATH.insert(0, controller_path)
ActiveSupport::Dependencies.load_paths.insert(0, controller_path)
config.controller_paths.insert(0, controller_path)


text:
<?php

namespace Acme\MovieBundle\Form\DataTransformer;

use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\PersistentCollection;
use Doctrine\Common\Collections\ArrayCollection;

use Acme\MovieBundle\Entity\Director;
use Acme\MovieBundle\Entity\Genre;
use Acme\MovieBundle\Entity\Movie;
use Acme\MovieBundle\Entity\Tag;

class EntitiesToTokenInputTransformer implements DataTransformerInterface
{
	/**
	 * @var ObjectManager
	 */
	private $repository;

	/**
	 * @var ObjectManager
	 */
	private $em;

	/**
	 * @param ObjectManager $om
	 */
	public function __construct($repository, $em)
	{
		$this->repository = $repository;
		$this->em = $em;
	}

	/**
	 * Transforms objects to ids
	 *
	 * @param $entities
	 * @return string
	 */
	public function transform($entities)
	{
		if (null === $entities) {
			return "";
		}

		$tokensArray = array();
		foreach ($entities as $entity) {
			$tokensArray[] = array(
				'id' => $entity->getId(),
				'name' => $entity->getName()
			);
		}
		$tokens = json_encode($tokensArray);

		return $tokens;
	}

	/**
	 * Transforms entity id's back to objects
	 *
	 * @param $ids List of entity ids
	 */
	public function reverseTransform($ids)
	{
		$entities = new ArrayCollection();

		if ('' === $ids || null === $ids)
		{
			return $ids;
		}

		if (!is_string($ids)) {
			throw new UnexpectedTypeException($ids, 'string');
		}

		$idsArray = explode(",", $ids);
		$idsArray = array_filter($idsArray, 'is_numeric');
		foreach ($idsArray as $id) {
			$entity = $this->repository
				->findOneBy(array('id' => $id));
			$entities->add($entity);
		}

		return $entities;
	}
}