text:
/* ------------------------------------------------------------------------
  This you can edit.
------------------------------------------------------------------------- */

  /* ----------------------------------
    Light Square Theme
  ----------------------------------- */

  .pp_pic_holder {
    margin-top: -20px;
  }

  div.pp_content_container {
    padding-top: 20px;
    padding-bottom: 20px;
    background: #fff;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  }

  div.light_square .ppt { color: #000 !important; margin-left: 20px; padding-top: 15px; text-align: center;}
  div.light_square .pp_expand { background: url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat; cursor: pointer; } /* Expand button */
  div.light_square .pp_expand:hover { background: url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat; cursor: pointer; } /* Expand button hover */
  div.light_square .pp_contract { background: url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat; cursor: pointer; } /* Contract button */
  div.light_square .pp_contract:hover { background: url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat; cursor: pointer; } /* Contract button hover */
  div.light_square .pp_close { width: 75px; height: 22px; background: url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat; cursor: pointer; } /* Close button */
  div.light_square #pp_full_res .pp_inline { color: #000; }
  div.light_square .pp_gallery a.pp_arrow_previous,
  div.light_square .pp_gallery a.pp_arrow_next { margin-top: 12px !important; }
  div.light_square .pp_nav .pp_play { background: url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat; height: 15px; width: 14px; }
  div.light_square .pp_nav .pp_pause { background: url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat; height: 15px; width: 14px; }

  div.light_square .pp_arrow_previous { background: url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat; } /* The previous arrow in the bottom nav */
    div.light_square .pp_arrow_previous.disabled { background-position: 0 -87px; cursor: default; }
  div.light_square .pp_arrow_next { background: url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat; } /* The next arrow in the bottom nav */
    div.light_square .pp_arrow_next.disabled { background-position: -22px -87px; cursor: default; }

  div.light_square .pp_next:hover { background: url(../images/prettyPhoto/light_square/btnNext.png) center right  no-repeat; cursor: pointer; } /* Next button */
  div.light_square .pp_previous:hover { background: url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat; cursor: pointer; } /* Previous button */

  div.light_square .pp_loaderIcon { background: url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat; } /* Loader icon */

/* ------------------------------------------------------------------------
  DO NOT CHANGE
------------------------------------------------------------------------- */

  div.pp_pic_holder a:focus { outline:none; }

  div.pp_overlay {
    background: #fff;
    display: none;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 9500;
  }

  div.pp_pic_holder {
    display: none;
    position: absolute;
    width: 100px;
    z-index: 10000;
  }

    .pp_top {
      height: 10px;
      position: relative;
    }
      * html .pp_top { padding: 0 20px; }

      .pp_top .pp_left {
        height: 10px;
        left: 0;
        position: absolute;
        width: 20px;
      }
      .pp_top .pp_middle {
        height: 10px;
        left: 20px;
        position: absolute;
        right: 20px;
      }
        * html .pp_top .pp_middle {
          left: 0;
          position: static;
        }

      .pp_top .pp_right {
        height: 10px;
        left: auto;
        position: absolute;
        right: 0;
        top: 0;
        width: 20px;
      }

    .pp_content { height: 40px; min-width: 40px; }
    * html .pp_content { width: 40px; }

    .pp_fade { display: none; }

    .pp_content_container {
      position: relative;
      text-align: left;
      width: 100%;
    }

      .pp_content_container .pp_left { padding-left: 20px; }
      .pp_content_container .pp_right { padding-right: 20px; }

      .pp_content_container .pp_details {
        float: left;
        margin: 10px 0 2px 0;
      }
        .pp_description {
					z-index: 5;
					position: absolute;
          display: none;
					width: 95%;
          margin: 0 0 5px 0;
					text-align: center;
        }

        .pp_nav {
					z-index: 10;
					position: relative;
          clear: left;
          float: left;
          margin: 3px 0 0 0;
        }

          .pp_nav p {
            float: left;
            margin: 2px 4px;
          }

          .pp_nav .pp_play,
          .pp_nav .pp_pause {
            float: left;
            margin-right: 10px;
            margin-top: 2px;
						padding-right: 10px;
						padding-bottom: 2px;
						border-right: 1px solid #eee;
            text-indent: -10000px;
          }

          a.pp_arrow_previous,
          a.pp_arrow_next {
            display: block;
            float: left;
            height: 15px;
            margin-top: 6px;
            overflow: hidden;
            text-indent: -10000px;
            width: 14px;
          }

    .pp_hoverContainer {
      position: absolute;
      top: 0;
      width: 100%;
      z-index: 2000;
    }

    .pp_gallery {
      display: none;
      left: 50%;
      margin-top: -30px;
      position: absolute;
      z-index: 10000;
    }

      .pp_gallery ul {
        float: left;
        height: 60px;
        margin: 0 5px;
        padding: 0;
        position: relative;
      }

      .pp_gallery ul a {
        display: block;
        float: left;
        width: 50px;
        height: 50px;
        padding: 5px;
        overflow: hidden;
      }

      .pp_gallery ul a:hover {
        opacity: 0.7;
      }
      .pp_gallery li.selected a { background-color: #eee; opacity: 1 !important; }

      .pp_gallery ul a img { border: 0; }

      .pp_gallery li {
        display: block;
        float: left;
        margin: 0 5px 0 0;
        padding: 0;
      }

      .pp_gallery li.default a {
        display: block;
        height: 50px;
        width: 50px;
      }

      .pp_gallery li.default a img { display: none; }

      .pp_gallery .pp_arrow_previous,
      .pp_gallery .pp_arrow_next {
        margin-top: 7px !important;
      }

    a.pp_next {
      background: url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;
      display: block;
      float: right;
      height: 100%;
      text-indent: -10000px;
      width: 49%;
    }

    a.pp_previous {
      background: url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;
      display: block;
      float: left;
      height: 100%;
      text-indent: -10000px;
      width: 49%;
    }

    a.pp_expand,
    a.pp_contract {
      cursor: pointer;
      display: none;
      height: 20px;
      position: absolute;
      right: 20px;
      text-indent: -10000px;
      top: 20px;
      width: 20px;
      z-index: 20000;
    }

    a.pp_close {
			z-index: 10;
			position: relative;
      display: block;
      float: right;
      line-height:22px;
      text-indent: -10000px;
    }

    .pp_bottom {
      height: 0;
      position: relative;
    }
      * html .pp_bottom { padding: 0 20px; }

      .pp_bottom .pp_left {
        height: 0;
        left: 0;
        position: absolute;
        width: 20px;
      }
      .pp_bottom .pp_middle {
        height: 0;
        left: 20px;
        position: absolute;
        right: 20px;
      }
        * html .pp_bottom .pp_middle {
          left: 0;
          position: static;
        }

      .pp_bottom .pp_right {
        height: 0;
        left: auto;
        position: absolute;
        right: 0;
        top: 0;
        width: 20px;
      }

    .pp_loaderIcon {
      display: block;
      height: 24px;
      left: 50%;
      margin: -12px 0 0 -12px;
      position: absolute;
      top: 50%;
      width: 24px;
    }

    #pp_full_res {
      line-height: 1 !important;
    }

      #pp_full_res .pp_inline {
        text-align: left;
      }

        #pp_full_res .pp_inline p { margin: 0 0 15px 0; }

    div.ppt {
      color: #fff;
      display: none;
      font-size: 17px;
      margin: 0 0 5px 15px;
      z-index: 9999;
    }

/* ------------------------------------------------------------------------
  Miscellaneous
------------------------------------------------------------------------- */

  .clearfix:after {
      content: ".";
      display: block;
      height: 0;
      clear: both;
      visibility: hidden;
  }

  .clearfix {display: inline-block;}

  /* Hides from IE-mac \*/
  * html .clearfix {height: 1%;}
  .clearfix {display: block;}
  /* End hide from IE-mac */


text:
using System;
using System.Runtime.Serialization;

namespace NSubstitute.Exceptions
{
    [Serializable]
    public class ArgumentNotFoundException : SubstituteException
    {
        public ArgumentNotFoundException(string message) : base(message) { }
        protected ArgumentNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using namespace __tsan;  // NOLINT

void __tsan_read1(void *addr) {
  MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog1);
}

void __tsan_read2(void *addr) {
  MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog2);
}

void __tsan_read4(void *addr) {
  MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog4);
}

void __tsan_read8(void *addr) {
  MemoryRead(cur_thread(), CALLERPC, (uptr)addr, kSizeLog8);
}

void __tsan_write1(void *addr) {
  MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog1);
}

void __tsan_write2(void *addr) {
  MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog2);
}

void __tsan_write4(void *addr) {
  MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog4);
}

void __tsan_write8(void *addr) {
  MemoryWrite(cur_thread(), CALLERPC, (uptr)addr, kSizeLog8);
}

void __tsan_read1_pc(void *addr, void *pc) {
  MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog1);
}

void __tsan_read2_pc(void *addr, void *pc) {
  MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog2);
}

void __tsan_read4_pc(void *addr, void *pc) {
  MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog4);
}

void __tsan_read8_pc(void *addr, void *pc) {
  MemoryRead(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog8);
}

void __tsan_write1_pc(void *addr, void *pc) {
  MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog1);
}

void __tsan_write2_pc(void *addr, void *pc) {
  MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog2);
}

void __tsan_write4_pc(void *addr, void *pc) {
  MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog4);
}

void __tsan_write8_pc(void *addr, void *pc) {
  MemoryWrite(cur_thread(), (uptr)pc, (uptr)addr, kSizeLog8);
}

void __tsan_vptr_update(void **vptr_p, void *new_val) {
  CHECK_EQ(sizeof(vptr_p), 8);
  if (*vptr_p != new_val) {
    ThreadState *thr = cur_thread();
    thr->is_vptr_access = true;
    MemoryWrite(thr, CALLERPC, (uptr)vptr_p, kSizeLog8);
    thr->is_vptr_access = false;
  }
}

void __tsan_vptr_read(void **vptr_p) {
  CHECK_EQ(sizeof(vptr_p), 8);
  ThreadState *thr = cur_thread();
  thr->is_vptr_access = true;
  MemoryRead(thr, CALLERPC, (uptr)vptr_p, kSizeLog8);
  thr->is_vptr_access = false;
}

void __tsan_func_entry(void *pc) {
  FuncEntry(cur_thread(), (uptr)pc);
}

void __tsan_func_exit() {
  FuncExit(cur_thread());
}

void __tsan_ignore_thread_begin() {
  ThreadIgnoreBegin(cur_thread(), CALLERPC);
}

void __tsan_ignore_thread_end() {
  ThreadIgnoreEnd(cur_thread(), CALLERPC);
}

void __tsan_read_range(void *addr, uptr size) {
  MemoryAccessRange(cur_thread(), CALLERPC, (uptr)addr, size, false);
}

void __tsan_write_range(void *addr, uptr size) {
  MemoryAccessRange(cur_thread(), CALLERPC, (uptr)addr, size, true);
}


text:
package v1beta1

import (
	authenticationapi "github.com/FlorianOtel/client-go/pkg/apis/authentication/v1beta1"
)

type TokenReviewExpansion interface {
	Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error)
}

func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
	result = &authenticationapi.TokenReview{}
	err = c.client.Post().
		Resource("tokenreviews").
		Body(tokenReview).
		Do().
		Into(result)
	return
}


text:
package br.com.uol.pagseguro.example.preapproval;

import br.com.uol.pagseguro.domain.preapproval.RecurrenceCancelTransaction;
import br.com.uol.pagseguro.exception.PagSeguroServiceException;
import br.com.uol.pagseguro.properties.PagSeguroConfig;
import br.com.uol.pagseguro.service.preapproval.RecurrenceService;

public class CancelRecurrence {
    /**
     * Class with a main method to illustrate the usage of the domain class Recurrence
     */
    public static void main(String[] args) {

        // Substitute the code below with a valid recurrence code for your account
        cancelByCode("898F8425BF1A4632A20C826B0DBCDE75");
    }

    private static void cancelByCode(String recurrenceCode) {

        RecurrenceCancelTransaction recurrenceCancelTransaction = null;

        try {

            // Set your account credentials on src/pagseguro-config.properties
        	recurrenceCancelTransaction = RecurrenceService.cancelRecurrenceByCode(PagSeguroConfig.getAccountCredentials(),
                    recurrenceCode);

        } catch (PagSeguroServiceException e) {
            System.err.println(e.getMessage());
        }

        if (recurrenceCancelTransaction != null)
            printRecurrence(recurrenceCancelTransaction);
    }

    private static void printRecurrence(RecurrenceCancelTransaction recurrenceCancelTransaction) {

        System.out.println("code: " + recurrenceCancelTransaction.getCode());
        System.out.println("date: " + recurrenceCancelTransaction.getDate());
    }

    private CancelRecurrence() {

    }
}


text:
class AddIdToSalePriceProducts < ActiveRecord::Migration
  def change
    add_column :spree_sale_price_products, :id, :primary_key
    add_index :spree_sale_price_products, :id, unique: true
  end
end


text:
var delegate;

exports.setDelegate = function(o) {
	delegate = o;
};

function doClick(e) {
     delegate.showAlert();
};


text:
{% extends "layouts/base.html" %}
{% load widget_tweaks %}
{% load staticfiles %}

{% block title %}Notification Trigger{% endblock %}

{% block head %}
{{ form.media }}
{% endblock %}

{% block header %}{% include 'header.html' %}{% endblock %}
{% block sidebar %}{% include 'sidebar.html' %}{% endblock %}

{% block content %}

        Notification Trigger
        {% if edit %}Edit{% else %}Add new{% endif %}

		<form role="form" action="" method="POST">

Notification Trigger Details

							{{ form.notification_incident }}

								{{ form.type.label }}
								{{ form.type|add_class:"form-control" }}
								{{ form.type.errors }}

								{{ form.method.label }}
								{{ form.method|add_class:"form-control" }}
								{{ form.method.errors }}

								{{ form.threshold.label }}
								{{ form.threshold|add_class:"form-control" }}
								{{ form.threshold.errors }}

								{{ form.comparator.label }}
								{{ form.comparator|add_class:"form-control" }}
								{{ form.comparator.errors }}

Actions

							{% csrf_token %}
  							<button class="btn btn-primary" type="submit">Save</button>

		</form>

{% endblock %}

{% block script %}

{% endblock %}


text:
<?php

namespace Wookieb\ZorroDataSchema\SchemaOutline\TypeOutline;
use Wookieb\Assert\Assert;

/**
 * @author Łukasz Kużyński "wookieb" <lukasz.kuzynski@gmail.com>
 */
abstract class AbstractTypeOutline implements TypeOutlineInterface
{
    private $name;
    protected $defaultName;

    /**
     * Set current name as provided in argument
     * If name is null then default name (from defaultName property) will be set
     *
     * @param null|string $name
     *
     * @throws \InvalidArgumentException when name is invalid
     */
    public function __construct($name = null)
    {
        Assert::nullOrNotBlank($name, 'Name of type outline cannot be empty');
        $this->name = $name ? : $this->defaultName;
    }

    /**
     * {@inheritDoc}
     */
    public function getName()
    {
        return $this->name;
    }
}


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';

// HTMLElement animation end event names.
const ON_ANIMATION_END = [
  'webkitAnimationEnd',
  'mozAnimationEnd',
  'MSAnimationEnd',
  'oanimationend',
  'animationend'
];

export default class Highlight extends Component {
  static propTypes = {
    theme: PropTypes.any,
    classes: PropTypes.any,
    className: PropTypes.any,
    children: PropTypes.any,
    animate: PropTypes.bool,
    layer: PropTypes.oneOf([
      'primary',
      'secondary',
      'header',
      'control',
      'success',
      'alert',
      'disabled'
    ])
  };

  static defaultProps = {
    animate: true,
    layer: 'primary'
  };

  // The root element.
  element = null;

  // Last click element created.
  clickElement = null;

  render () {
    const {
      theme,
      classes,
      layer,
      animate,
      className,
      children,
      ...etc
    } = this.props;
    const cls = cx(classes.root, classes[layer], className);

    return (

 (this.element = el)} {...etc}>

          {children}

    );
  }

  /**
   * Click event on element. Reproduces the animation.
   */
  onClick = () => {
    const { animate, classes } = this.props;

    if (animate) {
      if (this.clickElement) {
        this.clickElement.remove();
      }

      this.clickElement = document.createElement('div');
      this.clickElement.setAttribute('class', classes.click);
      this.element.appendChild(this.clickElement);

      ON_ANIMATION_END.forEach(event => {
        this.clickElement.addEventListener(event, () =>
          this.clickElement.remove()
        );
      });
    }
  };
}


text:
package org.wso2.carbon.apimgt.internal.service.impl;

import org.apache.cxf.jaxrs.ext.MessageContext;
import org.wso2.carbon.apimgt.api.APIManagementException;
import org.wso2.carbon.apimgt.api.ExceptionCodes;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.dto.RuntimeArtifactDto;
import org.wso2.carbon.apimgt.impl.gatewayartifactsynchronizer.RuntimeArtifactGeneratorUtil;
import org.wso2.carbon.apimgt.internal.service.RuntimeArtifactsApiService;
import org.wso2.carbon.apimgt.internal.service.dto.SynapseArtifactListDTO;
import org.wso2.carbon.apimgt.internal.service.utils.SubscriptionValidationDataUtil;
import org.wso2.carbon.apimgt.rest.api.common.RestApiConstants;
import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import java.io.File;
import java.nio.file.Files;
import java.util.List;

/**
 * Runtime Artifact Service implementation.
 */
public class RuntimeArtifactsApiServiceImpl implements RuntimeArtifactsApiService {

    public Response runtimeArtifactsGet(String xWSO2Tenant, String apiId, String gatewayLabel, String type,
                                        String name, String version, MessageContext messageContext)
            throws APIManagementException {
        xWSO2Tenant = SubscriptionValidationDataUtil.validateTenantDomain(xWSO2Tenant, messageContext);

        RuntimeArtifactDto runtimeArtifactDto =
                RuntimeArtifactGeneratorUtil.generateRuntimeArtifact(apiId, name, version, gatewayLabel, type,
                        xWSO2Tenant);
        if (runtimeArtifactDto != null) {
            if (runtimeArtifactDto.isFile()) {
                File artifact = (File) runtimeArtifactDto.getArtifact();
                StreamingOutput streamingOutput = (outputStream) -> {
                    try {
                        Files.copy(artifact.toPath(), outputStream);
                    } finally {
                        Files.delete(artifact.toPath());
                    }
                };
                return Response.ok(streamingOutput).header(RestApiConstants.HEADER_CONTENT_DISPOSITION,
                        "attachment; filename=apis.zip").header(RestApiConstants.HEADER_CONTENT_TYPE,
                        APIConstants.APPLICATION_ZIP).build();
            } else {
                SynapseArtifactListDTO synapseArtifactListDTO = new SynapseArtifactListDTO();
                if (runtimeArtifactDto.getArtifact() instanceof List) {
                    synapseArtifactListDTO.setList((List<String>) runtimeArtifactDto.getArtifact());
                    synapseArtifactListDTO.setCount(((List<String>) runtimeArtifactDto.getArtifact()).size());
                }
                return Response.ok().entity(synapseArtifactListDTO)
                        .header(RestApiConstants.HEADER_CONTENT_TYPE, RestApiConstants.APPLICATION_JSON).build();
            }
        } else {
            return Response
                    .status(Response.Status.NOT_FOUND)
                    .entity(RestApiUtil.getErrorDTO(ExceptionCodes.NO_API_ARTIFACT_FOUND))
                    .build();
        }
    }
}


text:
class CreateFoods < ActiveRecord::Migration
  def change
    create_table :foods do |t|
      t.text :name

      t.timestamps null: false
    end
  end
end


text:
/*-
 * cordova MediaViewer Plugin for Android
 *
 * Created by Cortex Media MIT Licensed
 * Revised for Cordova 3.3+ by Dawson Loudon (2013) MIT Licensed
 *
 * Usages:
 *
 * VideoPlayer.play("http://path.to.my/video.mp4");
 * VideoPlayer.play("file:///path/to/my/video.mp4");
 * VideoPlayer.play("file:///android_asset/www/path/to/my/video.mp4");
 * VideoPlayer.play("https://www.youtube.com/watch?v=en_sVVjWFKk");
 */
var exec = require("cordova/exec");

var MediaViewer = {
    view: function(url, type) {
        exec(null, null, "MediaViewer", "viewMedia", [url,type]);
    }
};

module.exports = MediaViewer;


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>GertTheGame Blog</title>
    <meta name="description" content="Verfolgen Sie die Entwicklung des Spieles "Gert The Game" oder tragen sie etwas bei." />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="//TheGertproject.github.io/themes/Casper/favicon.ico">

    <link rel="stylesheet" type="text/css" href="//TheGertproject.github.io/themes/Casper/assets/css/screen.css?v=1.0.0" />
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400" />

    <link rel="canonical" href="https://TheGertproject.github.io" />
    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="GertTheGame Blog" href="https://TheGertproject.github.io/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

        Home

uGUI

                    A 1-post collection

        Page 1 of 1

uGUI

Ab sofort nutzen wir das uGUI-System aus Unity5 für GUI Elemente, alte Elemente werden auf uGUI konvertiert. Unity5 »

             on uGUI,  GUI
            <time class="post-date" datetime="Invalid date">Invalid date</time>

        Page 1 of 1

GertTheGame Blog © 2015

Proudly published with HubPress


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

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/card_vendor"
        android:id="@+id/Vendor_textView"
        android:layout_alignParentStart="true"
        android:layout_marginTop="40dp"
        android:textAlignment="center"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"/>

    <Spinner
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/vendorSpinner"
        android:spinnerMode="dialog"
        android:layout_alignTop="@+id/Vendor_textView"
        android:layout_alignStart="@+id/amountSpinner"
        android:layout_alignBottom="@+id/Vendor_textView"
        android:prompt="@string/vendor_prompt"
        android:layout_alignEnd="@+id/expiryDateButton" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/card_digits"
        android:id="@+id/Digits_textView"
        android:layout_below="@+id/vendorSpinner"
        android:layout_alignParentStart="true"
        android:layout_marginTop="40dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"/>

    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/digitsEditText"
        android:layout_alignBottom="@+id/Digits_textView"
        android:inputType="number"
        android:layout_alignBaseline="@+id/digitsEditText"
        android:layout_alignStart="@+id/vendorSpinner"
        android:layout_alignEnd="@+id/amountSpinner" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/card_serial"
        android:id="@+id/Serial_textView"
        android:layout_below="@+id/Digits_textView"
        android:layout_alignParentStart="true"
        android:layout_marginTop="40dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"/>

    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/serialEditText"
        android:inputType="number"
        android:layout_alignBottom="@+id/Serial_textView"
        android:layout_alignStart="@+id/digitsEditText"
        android:layout_alignEnd="@+id/amountSpinner" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/card_amount"
        android:id="@+id/Amount_textView"
        android:layout_below="@+id/Serial_textView"
        android:layout_alignParentStart="true"
        android:layout_marginTop="40dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"/>

    <Spinner
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/amountSpinner"
        android:layout_alignBottom="@+id/Amount_textView"
        android:spinnerMode="dialog"
        android:layout_toEndOf="@+id/Amount_textView"
        android:layout_alignTop="@+id/Amount_textView"
        android:layout_marginRight="10dp"
        android:prompt="@string/amount_prompt"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/card_expiry_date"
        android:id="@+id/Expiry_textView"
        android:layout_below="@+id/Amount_textView"
        android:layout_alignParentStart="true"
        android:layout_marginTop="40dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"/>

    <Button
        android:id="@+id/expiryDateButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/Expiry_textView"
        style="@style/TextAppearance.ExpiryDate_Spinner"
        android:onClick="showExpiryDatePickerDialog"
        android:layout_alignEnd="@+id/amountSpinner"
        android:layout_toEndOf="@+id/Expiry_textView"
        android:gravity="bottom|center"/>

    <Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/card_save"
        android:id="@+id/saveButton"
        android:layout_marginBottom="40dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentEnd="true" />

</RelativeLayout>


text:
import * as http from 'http'
import * as https from 'https'
import * as Express from 'express'
import { Response } from 'express'
import * as bodyParser from 'body-parser'
import { ServerOptions as SSLServerOptions } from 'https'
import { ServiceRoute, HTTPMethod, ServeStaticRoute } from './decorators'

export interface ServerConfig {
    hostname?: string
    port?: number
    backlog?: number
    sslServerOptions?: SSLServerOptions
}

export class Server {

    private app: Express.Application
    services: any[]
    server: http.Server | https.Server
    readonly config: ServerConfig

    constructor(config: ServerConfig = {}) {
        this.config = config
        if (!this.config.hostname) {
            this.config.hostname = "127.0.0.1"
        }
        if (!this.config.port) {
            this.config.port = 9080
        }
        this.services = []

        this.app = Express()
        this.app.use(bodyParser.json())
        this.app.use(bodyParser.urlencoded({ extended: false }))
    }

    use(...args) {
        this.app.use(...args)
    }

    addService(service: any) {
        this.services.push(service)
    }

    async start(): Promise<void> {
        if (this.config.sslServerOptions) {
            this.server = https.createServer(this.config.sslServerOptions, this.app)
        } else {
            this.server = http.createServer(this.app)
        }
        for (let service of this.services) {
            let router = Express.Router()
            const baseRoute: string = service["baseRoute"] || service.constructor.name.toLowerCase()
            if (!baseRoute) {
                throw new Error("This service needs a base route.")
            }

            const staticRoutes: ServeStaticRoute[] = service["staticRoutes"] || []
            for (let staticRoute of staticRoutes) {
                router.use(staticRoute.path, Express.static(staticRoute.staticRoot))
            }

            const serviceRoutes = service["routes"] as ServiceRoute[] || []
            for (let serviceRoute of serviceRoutes) {
                let handler: Express.RequestHandler = async (req, res, next) => {
                    let functionName: string = serviceRoute.functionName
                    try {
                        let result = await Promise.resolve(service[functionName](req, res, next))
                        if (result) {
                            res.json(result)
                        }
                    } catch (err) {
                        res.json(err)
                    }
                }
                (router[serviceRoute.httpMethod] as Express.IRouterMatcher<Express.Router>)(serviceRoute.path, handler)
            }
            this.app.use(baseRoute, router)
        }
        return new Promise<void>((resolve, reject) => {
            this.server.listen(this.config.port, this.config.hostname, this.config.backlog, (err) => {
                if (err) {
                    reject(err)
                } else {
                    resolve()
                }
            })
        })
    }

    async stop(): Promise<void> {
        await new Promise<void>((resolve, reject) => {
            this.server.close((err) => {
                if (err) {
                    reject(err)
                } else {
                    resolve()
                }
            })
        })
        this.server = null
    }

}


text:
package com.hazelcast.quorum;

import com.hazelcast.config.Config;
import com.hazelcast.config.MapConfig;
import com.hazelcast.config.QuorumConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.HazelcastInstanceAware;
import com.hazelcast.core.IMap;
import com.hazelcast.core.Member;
import com.hazelcast.quorum.impl.QuorumServiceImpl;
import com.hazelcast.spi.MemberAttributeServiceEvent;
import com.hazelcast.spi.MembershipAwareService;
import com.hazelcast.spi.impl.NodeEngineImpl;
import com.hazelcast.test.AssertTask;
import com.hazelcast.test.HazelcastSerialClassRunner;
import com.hazelcast.test.HazelcastTestSupport;
import com.hazelcast.test.TestHazelcastInstanceFactory;
import com.hazelcast.test.annotation.ParallelTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.util.Collection;
import java.util.concurrent.atomic.AtomicInteger;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;

@RunWith(HazelcastSerialClassRunner.class)
@Category({QuickTest.class, ParallelTest.class})
public class QuorumTest extends HazelcastTestSupport {

    @Test
    public void testQuorumIsSetCorrectlyOnNodeInitialization() {
        Config config = new Config();
        QuorumConfig quorumConfig1 = new QuorumConfig();
        String quorumName1 = randomString();
        quorumConfig1.setName(quorumName1);
        quorumConfig1.setEnabled(true);
        quorumConfig1.setQuorumFunctionImplementation(new QuorumFunction() {
            @Override
            public boolean apply(Collection<Member> members) {
                return true;
            }
        });

        QuorumConfig quorumConfig2 = new QuorumConfig();
        String quorumName2 = randomString();
        quorumConfig2.setName(quorumName2);
        quorumConfig2.setEnabled(true);
        quorumConfig2.setSize(2);

        config.addQuorumConfig(quorumConfig1);
        config.addQuorumConfig(quorumConfig2);

        HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
        final Quorum quorum1 = hazelcastInstance.getQuorumService().getQuorum(quorumName1);
        final Quorum quorum2 = hazelcastInstance.getQuorumService().getQuorum(quorumName2);
        assertTrueEventually(new AssertTask() {
            @Override
            public void run()
                    throws Exception {
                assertTrue(quorum1.isPresent());
                assertFalse(quorum2.isPresent());
            }
        });
    }

    @Test
    public void testQuorumIgnoresMemberAttributeEvents() throws Exception {
        Config config = new Config();
        QuorumConfig quorumConfig = new QuorumConfig().setName(randomString()).setEnabled(true);
        final RecordingQuorumFunction function = new RecordingQuorumFunction();
        quorumConfig.setQuorumFunctionImplementation(function);
        config.addQuorumConfig(quorumConfig);
        HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
        NodeEngineImpl nodeEngine = getNodeEngineImpl(hazelcastInstance);
        MembershipAwareService service = nodeEngine.getService(QuorumServiceImpl.SERVICE_NAME);

        assertTrueEventually(new AssertTask() {
            @Override
            public void run()
                    throws Exception {
                assertTrue(function.wasCalled);
            }
        });
        function.wasCalled = false;

        MemberAttributeServiceEvent event = mock(MemberAttributeServiceEvent.class);
        service.memberAttributeChanged(event);

        assertFalse(function.wasCalled);
    }

    @Test(expected = QuorumException.class)
    public void testCustomQuorumFunctionFails() throws Exception {
        Config config = new Config();
        QuorumConfig quorumConfig = new QuorumConfig();
        String quorumName = randomString();
        quorumConfig.setName(quorumName);
        quorumConfig.setEnabled(true);
        quorumConfig.setQuorumFunctionImplementation(new QuorumFunction() {
            @Override
            public boolean apply(Collection<Member> members) {
                return false;
            }
        });
        config.addQuorumConfig(quorumConfig);
        String mapName = randomMapName();
        MapConfig mapConfig = new MapConfig(mapName);
        mapConfig.setQuorumName(quorumName);
        config.addMapConfig(mapConfig);
        HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
        IMap<Object, Object> map = hazelcastInstance.getMap(mapName);
        map.put("1", "1");
    }

    @Test
    public void testCustomQuorumFunctionIsPresent() throws Exception {
        Config config = new Config();
        QuorumConfig quorumConfig = new QuorumConfig();
        String quorumName = randomString();
        quorumConfig.setName(quorumName);
        quorumConfig.setEnabled(true);
        quorumConfig.setQuorumFunctionImplementation(new QuorumFunction() {
            @Override
            public boolean apply(Collection<Member> members) {
                return false;
            }
        });
        config.addQuorumConfig(quorumConfig);
        String mapName = randomMapName();
        MapConfig mapConfig = new MapConfig(mapName);
        mapConfig.setQuorumName(quorumName);
        config.addMapConfig(mapConfig);
        HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
        IMap<Object, Object> map = hazelcastInstance.getMap(mapName);
        try {
            map.put("1", "1");
            fail();
        } catch (Exception e) {
        }
        Quorum quorum = hazelcastInstance.getQuorumService().getQuorum(quorumName);
        assertFalse(quorum.isPresent());
    }

    @Test(expected = QuorumException.class)
    public void testCustomQuorumFunctionFailsForAllNodes() throws Exception {
        Config config = new Config();
        QuorumConfig quorumConfig = new QuorumConfig();
        String quorumName = randomString();
        quorumConfig.setName(quorumName);
        quorumConfig.setEnabled(true);
        quorumConfig.setQuorumFunctionImplementation(new QuorumFunction() {
            @Override
            public boolean apply(Collection<Member> members) {
                return false;
            }
        });
        config.addQuorumConfig(quorumConfig);
        String mapName = randomMapName();
        MapConfig mapConfig = new MapConfig(mapName);
        mapConfig.setQuorumName(quorumName);
        config.addMapConfig(mapConfig);
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
        HazelcastInstance h1 = factory.newHazelcastInstance(config);
        HazelcastInstance h2 = factory.newHazelcastInstance(config);
        IMap<Object, Object> map2 = h2.getMap(mapName);
        map2.put("1", "1");
    }

    @Test
    public void testCustomQuorumFunctionFailsThenSuccess() throws Exception {
        Config config = new Config();
        QuorumConfig quorumConfig = new QuorumConfig();
        String quorumName = randomString();
        quorumConfig.setName(quorumName);
        quorumConfig.setEnabled(true);
        final AtomicInteger count = new AtomicInteger(1);
        quorumConfig.setQuorumFunctionImplementation(new QuorumFunction() {
            @Override
            public boolean apply(Collection<Member> members) {
                if (count.get() == 1) {
                    count.incrementAndGet();
                    return false;
                } else {
                    return true;
                }
            }
        });
        config.addQuorumConfig(quorumConfig);
        String mapName = randomMapName();
        MapConfig mapConfig = new MapConfig(mapName);
        mapConfig.setQuorumName(quorumName);
        config.addMapConfig(mapConfig);
        TestHazelcastInstanceFactory f = new TestHazelcastInstanceFactory(2);
        HazelcastInstance hazelcastInstance = f.newHazelcastInstance(config);
        IMap<Object, Object> map = hazelcastInstance.getMap(mapName);
        try {
            map.put("1", "1");
            fail();
        } catch (Exception e) {
            e.printStackTrace();
        }
        HazelcastInstance hazelcastInstance2 = f.newHazelcastInstance(config);
        map.put("1", "1");
        f.shutdownAll();
    }

    @Test
    public void testOneQuorumsFailsOneQuorumSuccessForDifferentMaps() throws Exception {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(3);
        String fourNodeQuorum = randomString();
        QuorumConfig fourNodeQuorumConfig = new QuorumConfig(fourNodeQuorum, true);
        fourNodeQuorumConfig.setQuorumFunctionImplementation(new QuorumFunction() {
            @Override
            public boolean apply(Collection<Member> members) {
                return members.size() == 4;
            }
        });

        String threeNodeQuorum = randomString();
        QuorumConfig threeNodeQuorumConfig = new QuorumConfig(threeNodeQuorum, true);
        threeNodeQuorumConfig.setQuorumFunctionImplementation(new QuorumFunction() {
            @Override
            public boolean apply(Collection<Member> members) {
                return members.size() == 3;
            }
        });

        MapConfig fourNodeMapConfig = new MapConfig("fourNode");
        fourNodeMapConfig.setQuorumName(fourNodeQuorum);

        MapConfig threeNodeMapConfig = new MapConfig("threeNode");
        threeNodeMapConfig.setQuorumName(threeNodeQuorum);

        Config config = new Config();
        config.addQuorumConfig(threeNodeQuorumConfig);
        config.addQuorumConfig(fourNodeQuorumConfig);
        config.addMapConfig(fourNodeMapConfig);
        config.addMapConfig(threeNodeMapConfig);

        HazelcastInstance h1 = factory.newHazelcastInstance(config);
        HazelcastInstance h2 = factory.newHazelcastInstance(config);
        HazelcastInstance h3 = factory.newHazelcastInstance(config);

        IMap<Object, Object> fourNode = h1.getMap("fourNode");
        IMap<Object, Object> threeNode = h1.getMap("threeNode");
        threeNode.put(generateKeyOwnedBy(h1), "bar");
        try {
            fourNode.put(generateKeyOwnedBy(h1), "bar");
            fail();
        } catch (Exception e) {
        }
    }

    @Test
    public void givenQuorumFunctionConfigured_whenImplementsHazelcastInstanceAware_thenHazelcastInjectsItsInstance() {
        String quorumName = randomString();
        QuorumConfig quorumConfig = new QuorumConfig(quorumName, true);
        quorumConfig.setQuorumFunctionClassName(HazelcastInstanceAwareQuorumFunction.class.getName());

        Config config = new Config();
        config.addQuorumConfig(quorumConfig);

        HazelcastInstance instance = createHazelcastInstance(config);

        assertEquals(instance, HazelcastInstanceAwareQuorumFunction.instance);
    }

    @Test
    public void givenQuorumFunctionInstanceConfigured_whenImplementsHazelcastInstanceAware_thenHazelcastInjectsItsInstance() {
        String quorumName = randomString();
        QuorumConfig quorumConfig = new QuorumConfig(quorumName, true);
        quorumConfig.setQuorumFunctionImplementation(new HazelcastInstanceAwareQuorumFunction());

        Config config = new Config();
        config.addQuorumConfig(quorumConfig);
        HazelcastInstance instance = createHazelcastInstance(config);

        assertEquals(instance, HazelcastInstanceAwareQuorumFunction.instance);
    }

    private static class HazelcastInstanceAwareQuorumFunction implements QuorumFunction, HazelcastInstanceAware {
        private static volatile HazelcastInstance instance;

        @Override
        public void setHazelcastInstance(HazelcastInstance instance) {
            this.instance = instance;
        }

        @Override
        public boolean apply(Collection<Member> members) {
            return false;
        }
    }

    private static class RecordingQuorumFunction implements QuorumFunction {
        private volatile boolean wasCalled;

        @Override
        public boolean apply(Collection<Member> members) {
            wasCalled = true;
            return false;
        }

    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ivy-module [
    <!ENTITY jetty.version "8.1.12.v20130726">
]>
<ivy-module version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
    xmlns:m="http://ant.apache.org/ivy/maven">

    <info organisation="com.vaadin" module="vaadin-uitest"
        revision="${vaadin.version}" />

    <configurations>
        <conf name="build" />
        <conf name="build-provided" visibility="private" />
        <conf name="ide" visibility="private" />
        <conf name="jetty-run" visibility="private" />
        <conf name="compile-theme" visibility="private" />
    </configurations>
    <publications>
        <artifact type="war" ext="war" />
    </publications>
    <dependencies defaultconf="build" defaultconfmapping="build,ide->default">
        <!-- API DEPENDENCIES -->
        <dependency org="javax.portlet" name="portlet-api"
            rev="2.0" conf="build-provided,ide -> default" />

        <dependency org="javax.validation" name="validation-api"
            rev="1.0.0.GA" conf="build,ide -> default,sources" />
        <dependency org="org.hibernate" name="hibernate-validator"
            rev="4.2.0.Final" conf="build,ide -> default" />
        <!-- Google App Engine -->
        <dependency org="com.google.appengine" name="appengine-api-1.0-sdk"
            rev="1.7.7" conf="build-provided,ide -> default" />

        <!-- LIBRARY DEPENDENCIES (compile time) -->
        <!-- Project modules -->
        <dependency org="com.vaadin" name="vaadin-server"
            rev="${vaadin.version}" conf="build->build">
            <exclude org="javax.servlet"></exclude>
            <exclude type="pom" />
        </dependency>
        <dependency org="com.vaadin" name="vaadin-client"
            rev="${vaadin.version}" conf="build->build">
            <exclude type="pom" />
        </dependency>
        <dependency org="com.vaadin" name="vaadin-client-compiled"
            rev="${vaadin.version}" conf="build->build">
            <exclude type="pom" />
        </dependency>
        <dependency org="com.vaadin" name="vaadin-themes"
            rev="${vaadin.version}" conf="build->build">
            <exclude type="pom" />
        </dependency>
        <dependency org="com.vaadin" name="vaadin-push" rev="${vaadin.version}"
            conf="build->build">
            <exclude org="javax.servlet"></exclude>
            <exclude type="pom" />
        </dependency>

        <!-- For compiling TestingWidgetSet -->
        <dependency org="com.vaadin" name="vaadin-client-compiler"
            rev="${vaadin.version}" conf="build-provided-> build">
            <exclude type="pom" />
        </dependency>

        <!-- Servlet 3.0 API -->
        <dependency org="javax.servlet" name="javax.servlet-api"
            rev="3.0.1" conf="build-provided,ide -> default" />

        <dependency org="org.eclipse.jetty" name="jetty-server"
            rev="&jetty.version;" conf="ide, build-provided, jetty-run->default">
            <exclude org="org.eclipse.jetty.orbit"></exclude>
        </dependency>
        <!-- jetty-servlets needed by ProxyTest, but not by jetty-runner -->
        <dependency org="org.eclipse.jetty" name="jetty-servlets"
            rev="&jetty.version;" conf="ide, build-provided, jetty-run->default">
            <exclude org="org.eclipse.jetty.orbit"></exclude>
        </dependency>
        <dependency org="org.eclipse.jetty" name="jetty-websocket"
            rev="&jetty.version;" conf="ide, jetty-run->default">
            <exclude org="org.eclipse.jetty.orbit"></exclude>
        </dependency>
        <dependency org="org.eclipse.jetty" name="jetty-webapp"
            rev="&jetty.version;" conf="ide, build-provided, jetty-run->default">
            <exclude org="org.eclipse.jetty.orbit"></exclude>
        </dependency>
        <dependency org="org.mortbay.jetty" name="jetty-runner"
            rev="&jetty.version;" conf="ide, jetty-run->default">
            <exclude org="org.eclipse.jetty.orbit"></exclude>
        </dependency>

        <dependency org="junit" name="junit" rev="4.11"
            conf="build,ide -> default" />
        <dependency org="org.hamcrest" name="hamcrest-all"
            rev="1.3" conf="build,ide->default" />
        <dependency org="com.jcraft" name="jsch" rev="0.1.52"
            conf="ide, build->default" />
        <dependency org="commons-codec" name="commons-codec"
            rev="1.5" conf="build,ide->default" />
        <dependency org="commons-io" name="commons-io"
            rev="${commons-io.version}" conf="build,ide->default" />
        <!-- Mainly for SQLContainer tests -->
        <dependency org="org.hsqldb" name="hsqldb" rev="2.2.6"
            conf="build,ide -> default" />
        <dependency org="com.vaadin" name="vaadin-testbench"
            rev="4.0.2" conf="build-provided,ide -> default" />
        <!-- This should be removed once tests have been updated to use lang3 -->
        <dependency org="commons-lang" name="commons-lang"
            rev="2.6" conf="build,ide -> default" />

        <dependency org="com.vaadin" name="vaadin-sass-compiler"
            rev="${vaadin.sass.version}" conf="compile-theme->default" />

        <dependency org="com.vaadin" name="vaadin-buildhelpers"
            rev="${vaadin.version}" conf="compile-theme->build" />

        <dependency org="org.eclipse.jgit" name="org.eclipse.jgit"
            rev="3.5.1.201410131835-r" conf="ide,build->default">
            <exclude org="org.apache.httpcomponents"></exclude>
        </dependency>

    </dependencies>

</ivy-module>


text:
CODE=	GB
NO_PREPROC= yes
NO_SEP=	yes

.include "../Makefile.part"


text:
var Manager;

(function ($) {

  $(function () {
    Manager = new AjaxSolr.Manager({
      solrUrl: 'http://reuters-demo.tree.ewdev.ca:9090/reuters/'
    });
    Manager.init();
    Manager.store.addByValue('q', '*:*');
    Manager.doRequest();
  });

})(jQuery);


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 The Chromium Authors. All rights reserved.

     Use of this source code is governed by a BSD-style license that can be
     found in the LICENSE file.
-->
<resources>
    <color name="color_picker_border_color">#B0B0B0</color>
    <color name="color_picker_background_color">#FFFFFF</color>
</resources>


text:
#ifndef B6_DEQUE_H_
#define B6_DEQUE_H_

#include "refs.h"
#include "utils.h"
#include "assert.h"

/**
 * @defgroup deque Doubly-ended queue
 *
 * A doubly-ended queue or deque is a sequence of elements where each element
 * has a reference to the next one. Doubly-ended queues have a small footprint
 * in memory. Insertions and deletions after a reference within the deque are
 * very fast as they execute in a constant time. Adding an element as last
 * element is that fast.
 *
 * The counterpart is that operations that need to get a reference to a
 * previous element are inefficient. They have a linear complexity as the
 * whole deque as possibly to be traveled to find it. For instance, removing
 * the last element is that slow.
 */

/**
 * @ingroup deque
 * @brief Doubly-ended queue
 * @see b6_sref
 */
struct b6_deque {
	struct b6_sref sref; /**< sentinel in the doubly-ended queue */
	struct b6_sref *last; /**< latest element or b6_deque::sref if empty */
};

#define B6_DEQUE_INIT(deque) { { &(deque).sref }, &(deque).sref }

/**
 * @ingroup deque
 * @brief Initialize a deque statically
 * @param deque name of the variable
 */
#define B6_DEQUE_DEFINE(deque) struct b6_deque deque = B6_DEQUE_INIT(deque)

/**
 * @ingroup deque
 * @brief Initialize or clear a doubly-ended queue
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 */
static inline void b6_deque_initialize(struct b6_deque *deque)
{
	b6_precond(deque);

	deque->sref.ref = &deque->sref;
	deque->last = &deque->sref;
}

/**
 * @ingroup deque
 * @brief Exchange the contents of two deques
 * @complexity O(1)
 * @param lhs pointer to a doubly-ended queue
 * @param rhs pointer to a doubly-ended queue
 */
static inline void b6_deque_swap(struct b6_deque *lhs, struct b6_deque *rhs)
{
	struct b6_sref *sref;
	sref = lhs->last;
	lhs->last = rhs->last;
	rhs->last = sref;
	sref = lhs->sref.ref;
	lhs->sref.ref = rhs->sref.ref;
	rhs->sref.ref = sref;
	lhs->last->ref = &lhs->sref;
	rhs->last->ref = &rhs->sref;
}

/**
 * @ingroup deque
 * @brief Return the reference of the head of a doubly-ended queue
 *
 * The head reference cannot be dereferenced as it is associated with no
 * element.
 *
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @return pointer to a reference which next reference is the first element in
 * the doubly-ended queue
 */
static inline struct b6_sref *b6_deque_head(const struct b6_deque *deque)
{
	b6_precond(deque);

	return (struct b6_sref *)&deque->sref;
}

/**
 * @ingroup deque
 * @brief Return the reference of the tail of a doubly-ended queue
 *
 * The tail reference cannot be dereferenced as it is associated with no
 * element.
 *
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @return pointer to a reference which previous reference is the latest
 * element in the doubly-ended queue
 */
static inline struct b6_sref *b6_deque_tail(const struct b6_deque *deque)
{
	b6_precond(deque);

	return (struct b6_sref *)&deque->sref;
}

/**
 * @ingroup deque
 * @brief Travel a doubly-ended queue reference per reference
 * @complexity O(n) for B6_PREV, O(1) for B6_NEXT
 * @param deque pointer to the doubly-ended queue
 * @param curr reference to walk from
 * @param direction B6_PREV or B6_NEXT to get the previous or next reference
 * respectively
 * @return NULL when going out of range or the next or previous reference in
 * the sequence
 */
static inline struct b6_sref *b6_deque_walk(const struct b6_deque *deque,
                                            const struct b6_sref *curr,
                                            int direction)
{
	const struct b6_sref *prev;

	b6_precond(curr);
	b6_precond(direction == B6_PREV || direction == B6_NEXT);

	if (direction == B6_NEXT)
		return curr->ref;

	b6_precond(deque);
	if (curr == b6_deque_tail(deque))
		return deque->last;

	for (prev = b6_deque_head(deque); prev->ref != curr; prev = prev->ref);

	return (struct b6_sref *)prev;
}

/**
 * @ingroup deque
 * @brief Return the reference of the first element of a doubly-ended queue
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @return pointer to the reference after the head
 *
 * If the container is empty, then its tail reference is returned
 */
static inline struct b6_sref *b6_deque_first(const struct b6_deque *deque)
{
	return b6_deque_walk(deque, b6_deque_head(deque), B6_NEXT);
}

/**
 * @ingroup deque
 * @brief Return the reference of the last element of a doubly-ended queue
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @return pointer to the reference before the tail
 *
 * If the container is empty, then its tail reference is returned
 */
static inline struct b6_sref *b6_deque_last(const struct b6_deque *deque)
{
	return b6_deque_walk(deque, b6_deque_tail(deque), B6_PREV);
}

/**
 * @ingroup deque
 * @brief Test if a doubly-ended queue contains elements
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @return 0 if the deque contains one element or more and another value if it
 * does not contains any elements
 */
static inline int b6_deque_empty(const struct b6_deque *deque)
{
	return b6_deque_head(deque) == b6_deque_last(deque);
}

/**
 * @ingroup deque
 * @brief Insert a new element after a reference in the doubly-ended queue
 *
 * It is illegal to attempt to insert an element after the tail reference of
 * the doubly-ended queue.
 *
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @param prev reference in the doubly-ended queue
 * @param sref reference of the element to insert
 * @return sref
 */
static inline struct b6_sref *b6_deque_add_after(struct b6_deque *deque,
                                                 struct b6_sref *prev,
                                                 struct b6_sref *sref)
{
	struct b6_sref *next;

	b6_precond(prev);
	next = prev->ref;

	b6_precond(next);
	b6_precond(deque);
	if (b6_unlikely(prev == b6_deque_last(deque)))
		deque->last = sref;

	b6_precond(sref);
	sref->ref = next;
	prev->ref = sref;

	return sref;
}

/**
 * @ingroup deque
 * @brief Remove an element placed after a reference within the doubly-ended
 * queue
 *
 * It is illegal to attempt to remove the tail reference of the doubly-ended
 * queue or after.
 *
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @param prev pointer to the reference in the queue
 * @return pointer to the reference of the element removed
 */
static inline struct b6_sref *b6_deque_del_after(struct b6_deque *deque,
                                                 struct b6_sref *prev)
{
	struct b6_sref *curr;

	b6_precond(prev);
	curr = prev->ref;

	b6_precond(deque);
	if (b6_unlikely(curr == b6_deque_last(deque)))
		deque->last = prev;

	b6_precond(curr != b6_deque_last(deque));
	b6_precond(curr);
	prev->ref = curr->ref;

	return curr;
}

/**
 * @ingroup deque
 * @brief Insert a new element before a reference in the doubly-ended queue
 * @complexity O(n)
 * @param deque pointer to the doubly-ended queue
 * @param next reference in the doubly-ended queue
 * @param sref reference of the element to insert
 * @return sref
 */
static inline struct b6_sref *b6_deque_add(struct b6_deque *deque,
                                           struct b6_sref *next,
                                           struct b6_sref *sref)
{
	struct b6_sref *prev = b6_deque_walk(deque, next, B6_PREV);

	return b6_deque_add_after(deque, prev, sref);
}

/**
 * @ingroup deque
 * @brief Remove an element within the doubly-ended queue
 *
 * It is illegal to attempt to remove the head or the tail reference of the
 * doubly-ended queue.
 *
 * @complexity O(n)
 * @param deque pointer to the doubly-ended queue
 * @param sref pointer to the reference in the queue
 * @return pointer to the reference of the element removed
 */
static inline struct b6_sref *b6_deque_del(struct b6_deque *deque,
                                           struct b6_sref *sref)
{
	struct b6_sref *prev = b6_deque_walk(deque, sref, B6_PREV);

	return b6_deque_del_after(deque, prev);
}

/**
 * @ingroup deque
 * @brief Insert an element as first element of the doubly-ended queue
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @param sref pointer to the reference of the element to insert
 * @return sref
 */
static inline struct b6_sref *b6_deque_add_first(struct b6_deque *deque,
                                                 struct b6_sref *sref)
{
	return b6_deque_add_after(deque, b6_deque_head(deque), sref);
}

/**
 * @ingroup deque
 * @brief Insert an element as last element of the doubly-ended queue
 * @complexity O(1)
 * @param deque pointer to the doubly-ended queue
 * @param sref pointer to the reference of the element to insert
 * @return sref
 */
static inline struct b6_sref *b6_deque_add_last(struct b6_deque *deque,
                                                struct b6_sref *sref)
{
	return b6_deque_add_after(deque, b6_deque_last(deque), sref);
}

/**
 * @ingroup deque
 * @brief Remove the first element of a doubly-ended queue
 * @complexity O(1)
 * @pre The doubly-ended queue is not empty
 * @param deque pointer to the doubly-ended queue
 * @return pointer to the reference of the element removed
 */
static inline struct b6_sref *b6_deque_del_first(struct b6_deque *deque)
{
	return b6_deque_del_after(deque, b6_deque_head(deque));
}

/**
 * @ingroup deque
 * @brief Remove the last element of a doubly-ended queue
 * @complexity O(n)
 * @pre The doubly-ended queue is not empty
 * @param deque pointer to the doubly-ended queue
 * @return pointer to the reference of the element removed
 */
static inline struct b6_sref *b6_deque_del_last(struct b6_deque *deque)
{
	return b6_deque_del(deque, b6_deque_last(deque));
}

/**
 * @ingroup deque
 * @brief Move the elements of a doubly-ended queue to the end of another.
 * @complexity O(1)
 * @param d The doubly-ended queue to extend
 * @param s The doubly-ended queue to move the elements of
 */
static inline void b6_deque_extend(struct b6_deque *d, struct b6_deque *s)
{
	if (b6_deque_empty(s))
		return;
	b6_deque_last(s)->ref = b6_deque_tail(d);
	b6_deque_last(d)->ref = b6_deque_first(s);
	d->last = b6_deque_last(s);
	b6_deque_initialize(s);
}

#endif /* B6_DEQUE_H_ */


text:
This repository is used to run the unit tests for the _rime_ repository.
It contains the submodules that the _rime_ repository requires, with commits that are compatible with each other.
The Jamroot file tells Boost.Build how to test this repository when one says:

    bjam test

[![Build Status](https://travis-ci.org/rogiervd/rime-test.svg?branch=master)](https://travis-ci.org/rogiervd/rime-test)


text:
__author__ = 'Sean Lip'

import test_utils

class GalleryTest(test_utils.AppEngineTestBase):

    def test_gallery_page(self):
        """Test access to gallery page."""
        response = self.testapp.get('/gallery')
        self.assertEqual(response.status_int, 200)
        self.assertSubstring('Gallery', response.body)


text:
package com.google.javascript.jscomp;

import static com.google.common.collect.ObjectArrays.concat;
import static com.google.javascript.jscomp.parsing.Config.JsDocParsing.INCLUDE_DESCRIPTIONS_WITH_WHITESPACE;

import com.google.common.collect.ImmutableList;
import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
import com.google.javascript.refactoring.ApplySuggestedFixes;
import com.google.javascript.refactoring.ErrorToFixMapper;
import com.google.javascript.refactoring.SuggestedFix;

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

/**
 * Minimal binary that just runs the "lint" checks which can be run on a single file at a time.
 * This means some checks in the lintChecks DiagnosticGroup are skipped, since they depend on
 * type information.
 */
public class Linter {
  public static void main(String[] args) throws IOException {
    for (String filename : args) {
      // TODO(tbreisacher): Add a command line flag that causes this
      // to call fix() instead of lint().
      lint(filename);
    }
  }

  static void lint(String filename) throws IOException {
    lint(Paths.get(filename), false);
  }

  static void fix(String filename) throws IOException {
    lint(Paths.get(filename), true);
  }

  private static void lint(Path path, boolean fix) throws IOException {
    SourceFile file = SourceFile.fromFile(path.toString());
    Compiler compiler = new Compiler(System.out);
    CompilerOptions options = new CompilerOptions();
    options.setLanguage(LanguageMode.ECMASCRIPT6_STRICT);

    // For a full compile, this would cause a crash, as the method name implies. But the passes
    // in LintPassConfig can all handle untranspiled ES6.
    options.setSkipTranspilationAndCrash(true);

    options.setParseJsDocDocumentation(INCLUDE_DESCRIPTIONS_WITH_WHITESPACE);
    options.setCodingConvention(new GoogleCodingConvention());

    // Even though we're not running the typechecker, enable the checkTypes DiagnosticGroup, since
    // it contains some warnings we do want to report, such as JSDoc parse warnings.
    options.setWarningLevel(DiagnosticGroups.CHECK_TYPES, CheckLevel.WARNING);

    options.setWarningLevel(DiagnosticGroups.LINT_CHECKS, CheckLevel.WARNING);
    options.setWarningLevel(DiagnosticGroups.STRICT_MISSING_REQUIRE, CheckLevel.WARNING);
    options.setWarningLevel(DiagnosticGroups.EXTRA_REQUIRE, CheckLevel.WARNING);
    options.setWarningLevel(DiagnosticGroups.USE_OF_GOOG_BASE, CheckLevel.WARNING);
    options.setSummaryDetailLevel(0);
    compiler.setPassConfig(new LintPassConfig(options));
    compiler.disableThreads();
    SourceFile externs = SourceFile.fromCode("<Linter externs>", "");
    compiler.compile(ImmutableList.<SourceFile>of(externs), ImmutableList.of(file), options);
    if (fix) {
      List<SuggestedFix> fixes = new ArrayList<>();
      for (JSError warning : concat(compiler.getErrors(), compiler.getWarnings(), JSError.class)) {
        SuggestedFix suggestedFix = ErrorToFixMapper.getFixForJsError(warning, compiler);
        if (suggestedFix != null) {
          fixes.add(suggestedFix);
        }
      }
      ApplySuggestedFixes.applySuggestedFixesToFiles(fixes);
    }
  }
}


text:
namespace Crosschat.Server.Domain.Seedwork
{
    public interface IUnitOfWorkFactory
    {
        IUnitOfWork Create();
    }
}


text:
package com.google.ads.googleads.v10.errors;

public final class InvoiceErrorProto {
  private InvoiceErrorProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  static final com.google.protobuf.Descriptors.Descriptor
    internal_static_google_ads_googleads_v10_errors_InvoiceErrorEnum_descriptor;
  static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_ads_googleads_v10_errors_InvoiceErrorEnum_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n3google/ads/googleads/v10/errors/invoic" +
      "e_error.proto\022\037google.ads.googleads.v10." +
      "errors\"\332\001\n\020InvoiceErrorEnum\"\305\001\n\014InvoiceE" +
      "rror\022\017\n\013UNSPECIFIED\020\000\022\013\n\007UNKNOWN\020\001\022\026\n\022YE" +
      "AR_MONTH_TOO_OLD\020\002\022\031\n\025NOT_INVOICED_CUSTO" +
      "MER\020\003\022\036\n\032BILLING_SETUP_NOT_APPROVED\020\004\022*\n" +
      "&BILLING_SETUP_NOT_ON_MONTHLY_INVOICING\020" +
      "\005\022\030\n\024NON_SERVING_CUSTOMER\020\006B\361\001\n#com.goog" +
      "le.ads.googleads.v10.errorsB\021InvoiceErro" +
      "rProtoP\001ZEgoogle.golang.org/genproto/goo" +
      "gleapis/ads/googleads/v10/errors;errors\242" +
      "\002\003GAA\252\002\037Google.Ads.GoogleAds.V10.Errors\312" +
      "\002\037Google\\Ads\\GoogleAds\\V10\\Errors\352\002#Goog" +
      "le::Ads::GoogleAds::V10::Errorsb\006proto3"
    };
    descriptor = com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        });
    internal_static_google_ads_googleads_v10_errors_InvoiceErrorEnum_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_google_ads_googleads_v10_errors_InvoiceErrorEnum_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_ads_googleads_v10_errors_InvoiceErrorEnum_descriptor,
        new java.lang.String[] { });
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
package com.example.projetbibliotheque;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class AccueilActivity extends Activity {

	static public Button bouton_livre ;
	static public Button bouton_editeur ;
	static public Button bouton_auteur ;
	static public Button bouton_pret ;

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_accueil);

		// on rŽcupŽre l'identifiant du bouton dans le XML du layout
		bouton_livre = (Button)findViewById(R.id.accueil_bt_Livre);

		// on lui donne une action avec un listener

		bouton_livre.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub

				// si on clique on dŽmarre l'activity en question ( ne pas oublier de dŽclarer l'activity dans le fichier AndroidManifest
				Intent	var_prochainePage = new Intent("com.example.projetbibliotheque.LivresActivity");

				startActivity(var_prochainePage);

			}
		});

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.accueil, menu);
		return true;
	}

}


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>Redirecting...</title>
<link rel=canonical href="../祟/index.html">
<meta http-equiv=refresh content="0; url='../祟/index.html'">

Redirecting...

Click here if you are not redirected.


text:
<?php
namespace webfan\InstallShield\apc\CMD;

class processdir extends \webfan\InstallShield\apc\Command1
{

  public function run(){

  	$vm = &$this->cli->vm;

		$projectID =  $this->getRequestOption('projectID');
		if(!$projectID){
			\webdof\wResponse::status(400);
			array_push($this->_result, 'No Project (--projectID) specified!');
			return;
		}

		$vendor =  $this->getRequestOption('vendor');
		if(!$vendor){
			\webdof\wResponse::status(400);
			array_push($this->_result, 'No vendor (--vendor) specified!');
			return;
		}

		$packagename =  $this->getRequestOption('packagename');
		if(!$packagename){
			\webdof\wResponse::status(400);
			array_push($this->_result, 'No packagename (--packagename) specified!');
			return;
		}

		$version =  $this->getRequestOption('version');
		if(!$version){
			\webdof\wResponse::status(400);
			array_push($this->_result, 'No version (--version) specified!');
			return;
		}

		$dir_project = $vm->context->apc->config->config_source['dir_projects'] . urlencode($projectID) . DIRECTORY_SEPARATOR;
		if(!is_dir($dir_project)){
			mkdir($dir_project, 0755, true);
		}
		@chmod($dir_project, 0755);

		$dir_project_packages = $dir_project . 'project_packages' . DIRECTORY_SEPARATOR;
		if(!is_dir($dir_project_packages)){
			mkdir($dir_project_packages, 0755, true);
		}
		@chmod($dir_project_packages, 0755);

		$dir_project_package_vendor = $dir_project_packages . $vendor . DIRECTORY_SEPARATOR;
		if(!is_dir($dir_project_package_vendor)){
			mkdir($dir_project_package_vendor, 0755, true);
		}
		@chmod($dir_project_package_vendor, 0755);

		$dir_project_package_packagename = $dir_project_package_vendor . $packagename . DIRECTORY_SEPARATOR;
		if(!is_dir($dir_project_package_packagename)){
			mkdir($dir_project_package_packagename, 0755, true);
		}
		@chmod($dir_project_package_packagename, 0755);

		$dir_packages = $vm->context->apc->config->config_source['dir_packages'];
		$dir_package_vendor = $dir_packages . $vendor . DIRECTORY_SEPARATOR;
		if(!is_dir($dir_package_vendor)){
			mkdir($dir_package_vendor, 0755, true);
		}
		@chmod($dir_package_vendor, 0755);

		$dir_package = $dir_package_vendor . $packagename . DIRECTORY_SEPARATOR;
		if(!is_dir($dir_package)){
			mkdir($dir_package, 0755, true);
		}
		@chmod($dir_package, 0755);

     //   $zipfile = $dir_package.$version.'.zip';
        $dir_destination = $dir_package.$version. DIRECTORY_SEPARATOR;

$dir = new \RecursiveDirectoryIterator($dir_destination);

$composerFiles = new \RecursiveCallbackFilterIterator($dir, function ($current, $key, $iterator) {
    // Allow recursion
    if ($iterator->hasChildren()) {
        return true;
    }

    if ($current->isFile() && 'composer.json' === $current->getFilename() ) {
        return true;
    }
    return false;
});

foreach (new \RecursiveIteratorIterator($composerFiles) as $file) {

    	array_push($this->_result, 'composerfile '.$file->getPathname().' -i --vendor="'.$vendor.'" --projectID="'.$projectID.'" --packagename="'.$packagename.'" '
	              .' --version="'.$version.'" '
	           .PHP_EOL);
}

 }

}


text:
#
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ENUM_PARAMS_HPP
# define BOOST_PREPROCESSOR_ENUM_PARAMS_HPP
#
# include <carve/external/boost/preprocessor/repetition/enum_params.hpp>
#
# endif


text:
class SpriteSheet{
public:
	SpriteSheet();
	SpriteSheet(unsigned int textureID, float u, float v, float width, float height);

	void Draw(float scale, float x, float y, float rotation);

	float scale;
	unsigned int textureID;
	float u;
	float v;
	float width;
	float height;
};
#endif


text:
/******************************************************************************
 *
 * Module Name: tbfadt   - FADT table utilities
 *
 *****************************************************************************/

/*
 * Copyright (C) 2000 - 2008, Intel Corp.
 * 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,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
 */

#include <acpi/acpi.h>
#include "accommon.h"
#include "actables.h"

#define _COMPONENT          ACPI_TABLES
ACPI_MODULE_NAME("tbfadt")

/* Local prototypes */
static inline void
acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
			     u8 space_id, u8 byte_width, u64 address);

static void acpi_tb_convert_fadt(void);

static void acpi_tb_validate_fadt(void);

static void acpi_tb_setup_fadt_registers(void);

/* Table for conversion of FADT to common internal format and FADT validation */

typedef struct acpi_fadt_info {
	char *name;
	u8 address64;
	u8 address32;
	u8 length;
	u8 default_length;
	u8 type;

} acpi_fadt_info;

#define ACPI_FADT_REQUIRED          1
#define ACPI_FADT_SEPARATE_LENGTH   2

static struct acpi_fadt_info fadt_info_table[] = {
	{"Pm1aEventBlock",
	 ACPI_FADT_OFFSET(xpm1a_event_block),
	 ACPI_FADT_OFFSET(pm1a_event_block),
	 ACPI_FADT_OFFSET(pm1_event_length),
	 ACPI_PM1_REGISTER_WIDTH * 2,	/* Enable + Status register */
	 ACPI_FADT_REQUIRED},

	{"Pm1bEventBlock",
	 ACPI_FADT_OFFSET(xpm1b_event_block),
	 ACPI_FADT_OFFSET(pm1b_event_block),
	 ACPI_FADT_OFFSET(pm1_event_length),
	 ACPI_PM1_REGISTER_WIDTH * 2,	/* Enable + Status register */
	 0},

	{"Pm1aControlBlock",
	 ACPI_FADT_OFFSET(xpm1a_control_block),
	 ACPI_FADT_OFFSET(pm1a_control_block),
	 ACPI_FADT_OFFSET(pm1_control_length),
	 ACPI_PM1_REGISTER_WIDTH,
	 ACPI_FADT_REQUIRED},

	{"Pm1bControlBlock",
	 ACPI_FADT_OFFSET(xpm1b_control_block),
	 ACPI_FADT_OFFSET(pm1b_control_block),
	 ACPI_FADT_OFFSET(pm1_control_length),
	 ACPI_PM1_REGISTER_WIDTH,
	 0},

	{"Pm2ControlBlock",
	 ACPI_FADT_OFFSET(xpm2_control_block),
	 ACPI_FADT_OFFSET(pm2_control_block),
	 ACPI_FADT_OFFSET(pm2_control_length),
	 ACPI_PM2_REGISTER_WIDTH,
	 ACPI_FADT_SEPARATE_LENGTH},

	{"PmTimerBlock",
	 ACPI_FADT_OFFSET(xpm_timer_block),
	 ACPI_FADT_OFFSET(pm_timer_block),
	 ACPI_FADT_OFFSET(pm_timer_length),
	 ACPI_PM_TIMER_WIDTH,
	 ACPI_FADT_REQUIRED},

	{"Gpe0Block",
	 ACPI_FADT_OFFSET(xgpe0_block),
	 ACPI_FADT_OFFSET(gpe0_block),
	 ACPI_FADT_OFFSET(gpe0_block_length),
	 0,
	 ACPI_FADT_SEPARATE_LENGTH},

	{"Gpe1Block",
	 ACPI_FADT_OFFSET(xgpe1_block),
	 ACPI_FADT_OFFSET(gpe1_block),
	 ACPI_FADT_OFFSET(gpe1_block_length),
	 0,
	 ACPI_FADT_SEPARATE_LENGTH}
};

#define ACPI_FADT_INFO_ENTRIES \
			(sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))

/* Table used to split Event Blocks into separate status/enable registers */

typedef struct acpi_fadt_pm_info {
	struct acpi_generic_address *target;
	u8 source;
	u8 register_num;

} acpi_fadt_pm_info;

static struct acpi_fadt_pm_info fadt_pm_info_table[] = {
	{&acpi_gbl_xpm1a_status,
	 ACPI_FADT_OFFSET(xpm1a_event_block),
	 0},

	{&acpi_gbl_xpm1a_enable,
	 ACPI_FADT_OFFSET(xpm1a_event_block),
	 1},

	{&acpi_gbl_xpm1b_status,
	 ACPI_FADT_OFFSET(xpm1b_event_block),
	 0},

	{&acpi_gbl_xpm1b_enable,
	 ACPI_FADT_OFFSET(xpm1b_event_block),
	 1}
};

#define ACPI_FADT_PM_INFO_ENTRIES \
			(sizeof (fadt_pm_info_table) / sizeof (struct acpi_fadt_pm_info))

/*******************************************************************************
 *
 * FUNCTION:    acpi_tb_init_generic_address
 *
 * PARAMETERS:  generic_address     - GAS struct to be initialized
 *              byte_width          - Width of this register
 *              Address             - Address of the register
 *
 * RETURN:      None
 *
 * DESCRIPTION: Initialize a Generic Address Structure (GAS)
 *              See the ACPI specification for a full description and
 *              definition of this structure.
 *
 ******************************************************************************/

static inline void
acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
			     u8 space_id, u8 byte_width, u64 address)
{

	/*
	 * The 64-bit Address field is non-aligned in the byte packed
	 * GAS struct.
	 */
	ACPI_MOVE_64_TO_64(&generic_address->address, &address);

	/* All other fields are byte-wide */

	generic_address->space_id = space_id;
	generic_address->bit_width = (u8)ACPI_MUL_8(byte_width);
	generic_address->bit_offset = 0;
	generic_address->access_width = 0;	/* Access width ANY */
}

/*******************************************************************************
 *
 * FUNCTION:    acpi_tb_parse_fadt
 *
 * PARAMETERS:  table_index         - Index for the FADT
 *
 * RETURN:      None
 *
 * DESCRIPTION: Initialize the FADT, DSDT and FACS tables
 *              (FADT contains the addresses of the DSDT and FACS)
 *
 ******************************************************************************/

void acpi_tb_parse_fadt(u32 table_index)
{
	u32 length;
	struct acpi_table_header *table;

	/*
	 * The FADT has multiple versions with different lengths,
	 * and it contains pointers to both the DSDT and FACS tables.
	 *
	 * Get a local copy of the FADT and convert it to a common format
	 * Map entire FADT, assumed to be smaller than one page.
	 */
	length = acpi_gbl_root_table_list.tables[table_index].length;

	table =
	    acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index].
			       address, length);
	if (!table) {
		return;
	}

	/*
	 * Validate the FADT checksum before we copy the table. Ignore
	 * checksum error as we want to try to get the DSDT and FACS.
	 */
	(void)acpi_tb_verify_checksum(table, length);

	/* Create a local copy of the FADT in common ACPI 2.0+ format */

	acpi_tb_create_local_fadt(table, length);

	/* All done with the real FADT, unmap it */

	acpi_os_unmap_memory(table, length);

	/* Obtain the DSDT and FACS tables via their addresses within the FADT */

	acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
			      ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);

	acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
			      ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
}

/*******************************************************************************
 *
 * FUNCTION:    acpi_tb_create_local_fadt
 *
 * PARAMETERS:  Table               - Pointer to BIOS FADT
 *              Length              - Length of the table
 *
 * RETURN:      None
 *
 * DESCRIPTION: Get a local copy of the FADT and convert it to a common format.
 *              Performs validation on some important FADT fields.
 *
 * NOTE:        We create a local copy of the FADT regardless of the version.
 *
 ******************************************************************************/

void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
{
	/*
	 * Check if the FADT is larger than the largest table that we expect
	 * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue
	 * a warning.
	 */
	if (length > sizeof(struct acpi_table_fadt)) {
		ACPI_WARNING((AE_INFO,
			      "FADT (revision %u) is longer than ACPI 2.0 version, "
			      "truncating length 0x%X to 0x%X",
			      table->revision, length,
			      (u32)sizeof(struct acpi_table_fadt)));
	}

	/* Clear the entire local FADT */

	ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));

	/* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */

	ACPI_MEMCPY(&acpi_gbl_FADT, table,
		    ACPI_MIN(length, sizeof(struct acpi_table_fadt)));

	/* Convert the local copy of the FADT to the common internal format */

	acpi_tb_convert_fadt();

	/* Validate FADT values now, before we make any changes */

	acpi_tb_validate_fadt();

	/* Initialize the global ACPI register structures */

	acpi_tb_setup_fadt_registers();
}

/*******************************************************************************
 *
 * FUNCTION:    acpi_tb_convert_fadt
 *
 * PARAMETERS:  None, uses acpi_gbl_FADT
 *
 * RETURN:      None
 *
 * DESCRIPTION: Converts all versions of the FADT to a common internal format.
 *              Expand 32-bit addresses to 64-bit as necessary.
 *
 * NOTE:        acpi_gbl_FADT must be of size (struct acpi_table_fadt),
 *              and must contain a copy of the actual FADT.
 *
 * Notes on 64-bit register addresses:
 *
 * After this FADT conversion, later ACPICA code will only use the 64-bit "X"
 * fields of the FADT for all ACPI register addresses.
 *
 * The 64-bit "X" fields are optional extensions to the original 32-bit FADT
 * V1.0 fields. Even if they are present in the FADT, they are optional and
 * are unused if the BIOS sets them to zero. Therefore, we must copy/expand
 * 32-bit V1.0 fields if the corresponding X field is zero.
 *
 * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the
 * corresponding "X" fields in the internal FADT.
 *
 * For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded
 * to the corresponding 64-bit X fields. For compatibility with other ACPI
 * implementations, we ignore the 64-bit field if the 32-bit field is valid,
 * regardless of whether the host OS is 32-bit or 64-bit.
 *
 ******************************************************************************/

static void acpi_tb_convert_fadt(void)
{
	struct acpi_generic_address *address64;
	u32 address32;
	u32 i;

	/* Update the local FADT table header length */

	acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);

	/*
	 * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
	 * Later code will always use the X 64-bit field. Also, check for an
	 * address mismatch between the 32-bit and 64-bit address fields
	 * (FIRMWARE_CTRL/X_FIRMWARE_CTRL, DSDT/X_DSDT) which would indicate
	 * the presence of two FACS or two DSDT tables.
	 */
	if (!acpi_gbl_FADT.Xfacs) {
		acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
	} else if (acpi_gbl_FADT.facs &&
		   (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) {
		ACPI_WARNING((AE_INFO,
		    "32/64 FACS address mismatch in FADT - two FACS tables!"));
	}

	if (!acpi_gbl_FADT.Xdsdt) {
		acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
	} else if (acpi_gbl_FADT.dsdt &&
		   (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) {
		ACPI_WARNING((AE_INFO,
		    "32/64 DSDT address mismatch in FADT - two DSDT tables!"));
	}

	/*
	 * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
	 * should be zero are indeed zero. This will workaround BIOSs that
	 * inadvertently place values in these fields.
	 *
	 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at
	 * offset 45, 55, 95, and the word located at offset 109, 110.
	 */
	if (acpi_gbl_FADT.header.revision < FADT2_REVISION_ID) {
		acpi_gbl_FADT.preferred_profile = 0;
		acpi_gbl_FADT.pstate_control = 0;
		acpi_gbl_FADT.cst_control = 0;
		acpi_gbl_FADT.boot_flags = 0;
	}

	/*
	 * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
	 * generic address structures as necessary. Later code will always use
	 * the 64-bit address structures.
	 *
	 * March 2009:
	 * We now always use the 32-bit address if it is valid (non-null). This
	 * is not in accordance with the ACPI specification which states that
	 * the 64-bit address supersedes the 32-bit version, but we do this for
	 * compatibility with other ACPI implementations. Most notably, in the
	 * case where both the 32 and 64 versions are non-null, we use the 32-bit
	 * version. This is the only address that is guaranteed to have been
	 * tested by the BIOS manufacturer.
	 */
	for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
		address32 = *ACPI_ADD_PTR(u32,
					  &acpi_gbl_FADT,
					  fadt_info_table[i].address32);

		address64 = ACPI_ADD_PTR(struct acpi_generic_address,
					 &acpi_gbl_FADT,
					 fadt_info_table[i].address64);

		/*
		 * If both 32- and 64-bit addresses are valid (non-zero),
		 * they must match.
		 */
		if (address64->address && address32 &&
		    (address64->address != (u64) address32)) {
			ACPI_ERROR((AE_INFO,
				    "32/64X address mismatch in %s: %8.8X/%8.8X%8.8X, using 32",
				    fadt_info_table[i].name, address32,
				    ACPI_FORMAT_UINT64(address64->address)));
		}

		/* Always use 32-bit address if it is valid (non-null) */

		if (address32) {
			/*
			 * Copy the 32-bit address to the 64-bit GAS structure. The
			 * Space ID is always I/O for 32-bit legacy address fields
			*/
			acpi_tb_init_generic_address(address64,
						     ACPI_ADR_SPACE_SYSTEM_IO,
						     *ACPI_ADD_PTR(u8,
								   &acpi_gbl_FADT,
								   fadt_info_table
								   [i].length),
						     (u64) address32);
		}
	}
}

/*******************************************************************************
 *
 * FUNCTION:    acpi_tb_validate_fadt
 *
 * PARAMETERS:  Table           - Pointer to the FADT to be validated
 *
 * RETURN:      None
 *
 * DESCRIPTION: Validate various important fields within the FADT. If a problem
 *              is found, issue a message, but no status is returned.
 *              Used by both the table manager and the disassembler.
 *
 * Possible additional checks:
 * (acpi_gbl_FADT.pm1_event_length >= 4)
 * (acpi_gbl_FADT.pm1_control_length >= 2)
 * (acpi_gbl_FADT.pm_timer_length >= 4)
 * Gpe block lengths must be multiple of 2
 *
 ******************************************************************************/

static void acpi_tb_validate_fadt(void)
{
	char *name;
	struct acpi_generic_address *address64;
	u8 length;
	u32 i;

	/*
	 * Check for FACS and DSDT address mismatches. An address mismatch between
	 * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
	 * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
	 */
	if (acpi_gbl_FADT.facs &&
	    (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) {
		ACPI_WARNING((AE_INFO,
			      "32/64X FACS address mismatch in FADT - "
			      "%8.8X/%8.8X%8.8X, using 32",
			      acpi_gbl_FADT.facs,
			      ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs)));

		acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs;
	}

	if (acpi_gbl_FADT.dsdt &&
	    (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) {
		ACPI_WARNING((AE_INFO,
			      "32/64X DSDT address mismatch in FADT - "
			      "%8.8X/%8.8X%8.8X, using 32",
			      acpi_gbl_FADT.dsdt,
			      ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt)));

		acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
	}

	/* Examine all of the 64-bit extended address fields (X fields) */

	for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
		/*
		 * Generate pointer to the 64-bit address, get the register
		 * length (width) and the register name
		 */
		address64 = ACPI_ADD_PTR(struct acpi_generic_address,
					 &acpi_gbl_FADT,
					 fadt_info_table[i].address64);
		length =
		    *ACPI_ADD_PTR(u8, &acpi_gbl_FADT,
				  fadt_info_table[i].length);
		name = fadt_info_table[i].name;

		/*
		 * For each extended field, check for length mismatch between the
		 * legacy length field and the corresponding 64-bit X length field.
		 */
		if (address64->address &&
		    (address64->bit_width != ACPI_MUL_8(length))) {
			ACPI_WARNING((AE_INFO,
				      "32/64X length mismatch in %s: %d/%d",
				      name, ACPI_MUL_8(length),
				      address64->bit_width));
		}

		if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {
			/*
			 * Field is required (Pm1a_event, Pm1a_control, pm_timer).
			 * Both the address and length must be non-zero.
			 */
			if (!address64->address || !length) {
				ACPI_ERROR((AE_INFO,
					    "Required field %s has zero address and/or length:"
					    " %8.8X%8.8X/%X",
					    name,
					    ACPI_FORMAT_UINT64(address64->
							       address),
					    length));
			}
		} else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) {
			/*
			 * Field is optional (PM2Control, GPE0, GPE1) AND has its own
			 * length field. If present, both the address and length must
			 * be valid.
			 */
			if ((address64->address && !length) ||
			    (!address64->address && length)) {
				ACPI_WARNING((AE_INFO,
					      "Optional field %s has zero address or length: "
					      "%8.8X%8.8X/%X",
					      name,
					      ACPI_FORMAT_UINT64(address64->
								 address),
					      length));
			}
		}
	}
}

/*******************************************************************************
 *
 * FUNCTION:    acpi_tb_setup_fadt_registers
 *
 * PARAMETERS:  None, uses acpi_gbl_FADT.
 *
 * RETURN:      None
 *
 * DESCRIPTION: Initialize global ACPI PM1 register definitions. Optionally,
 *              force FADT register definitions to their default lengths.
 *
 ******************************************************************************/

static void acpi_tb_setup_fadt_registers(void)
{
	struct acpi_generic_address *target64;
	struct acpi_generic_address *source64;
	u8 pm1_register_byte_width;
	u32 i;

	/*
	 * Optionally check all register lengths against the default values and
	 * update them if they are incorrect.
	 */
	if (acpi_gbl_use_default_register_widths) {
		for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
			target64 =
			    ACPI_ADD_PTR(struct acpi_generic_address,
					 &acpi_gbl_FADT,
					 fadt_info_table[i].address64);

			/*
			 * If a valid register (Address != 0) and the (default_length > 0)
			 * (Not a GPE register), then check the width against the default.
			 */
			if ((target64->address) &&
			    (fadt_info_table[i].default_length > 0) &&
			    (fadt_info_table[i].default_length !=
			     target64->bit_width)) {
				ACPI_WARNING((AE_INFO,
					      "Invalid length for %s: %d, using default %d",
					      fadt_info_table[i].name,
					      target64->bit_width,
					      fadt_info_table[i].
					      default_length));

				/* Incorrect size, set width to the default */

				target64->bit_width =
				    fadt_info_table[i].default_length;
			}
		}
	}

	/*
	 * Get the length of the individual PM1 registers (enable and status).
	 * Each register is defined to be (event block length / 2). Extra divide
	 * by 8 converts bits to bytes.
	 */
	pm1_register_byte_width = (u8)
	    ACPI_DIV_16(acpi_gbl_FADT.xpm1a_event_block.bit_width);

	/*
	 * Calculate separate GAS structs for the PM1x (A/B) Status and Enable
	 * registers. These addresses do not appear (directly) in the FADT, so it
	 * is useful to pre-calculate them from the PM1 Event Block definitions.
	 *
	 * The PM event blocks are split into two register blocks, first is the
	 * PM Status Register block, followed immediately by the PM Enable
	 * Register block. Each is of length (pm1_event_length/2)
	 *
	 * Note: The PM1A event block is required by the ACPI specification.
	 * However, the PM1B event block is optional and is rarely, if ever,
	 * used.
	 */

	for (i = 0; i < ACPI_FADT_PM_INFO_ENTRIES; i++) {
		source64 =
		    ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT,
				 fadt_pm_info_table[i].source);

		if (source64->address) {
			acpi_tb_init_generic_address(fadt_pm_info_table[i].
						     target, source64->space_id,
						     pm1_register_byte_width,
						     source64->address +
						     (fadt_pm_info_table[i].
						      register_num *
						      pm1_register_byte_width));
		}
	}
}


text:
/* Sorts the given data by the specified column
 * @parameter {array<object>} data - The data to sort
 * @parameter {string} column - the name of the column to sort
 * @parameter {boolean optional} sortAscending - whether or not to sort this column in ascending order
 *
 * TODO: Needs tests!
 */
export function defaultSort(data, column, sortAscending = true) {
  return data.sort(
    (original, newRecord) => {
      const columnKey = column.split('.');
      const originalValue = (original.hasIn(columnKey) && original.getIn(columnKey)) || '';
      const newRecordValue = (newRecord.hasIn(columnKey) && newRecord.getIn(columnKey)) || '';

      //TODO: This is about the most cheezy sorting check ever.
      //Make it better
      if(originalValue === newRecordValue) {
        return 0;
      } else if (originalValue > newRecordValue) {
        return sortAscending ? 1 : -1;
      }
      else {
        return sortAscending ? -1 : 1;
      }
    });
}

export function setSortProperties({ setSortColumn, sortProperty, columnId }) {
  return () => {
    if (sortProperty === null) {
      setSortColumn({ id: columnId, sortAscending: true });
      return;
    }

    const newSortProperty = {
      ...sortProperty,
      sortAscending: !sortProperty.sortAscending
    };

    setSortColumn(newSortProperty);
  };
}

export function getSortIconProps(props) {
  const { sortProperty, sortAscendingIcon, sortDescendingIcon } = props;
  const { sortAscendingClassName, sortDescendingClassName } = props;

  if (sortProperty) {
    return sortProperty.sortAscending ?
    {
      icon: sortAscendingIcon,
      iconClassName: sortAscendingClassName,
    } :
    {
      icon: sortDescendingIcon,
      iconClassName: sortDescendingClassName,
    };
  }

  // return null so we don't render anything if no sortProperty
  return null;
}


text:
package com.github.tomsaleeba.jr2c;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;

import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Resource;
import org.junit.Test;

public class ImprovisedCsvResultContextTest {

	private Model helper = ModelFactory.createDefaultModel();
	private static final String NS = "urn:test#";

	/**
	 * Can we create a new row?
	 */
	@Test
	public void testNewRow01() {
		ImprovisedCsvResultContext objectUnderTest = new ImprovisedCsvResultContext();
		Row result = objectUnderTest.newRow();
		assertNotNull(result);
	}

	/**
	 * Can we create a header column when none exist?
	 */
	@Test
	public void testGetOrCreateHeaderColumn01() {
		ImprovisedCsvResultContext objectUnderTest = new ImprovisedCsvResultContext();
		HeaderColumn result = objectUnderTest.getOrCreateHeaderColumn("Site", "name");
		assertThat(result.getName(), is("Site.name"));
	}

	@Test
	public void testToCsv01() {
		ImprovisedCsvResultContext objectUnderTest = new ImprovisedCsvResultContext();
		Row row1 = objectUnderTest.newRow();
		Resource subject = subject("Site1", "Site");
		row1.addOneToOneRelationship(subject, helper.createProperty("urn:test#name"), "site #1");
		row1.addOneToOneRelationship(subject, helper.createProperty("urn:test#colour"), "blue");
		row1.addOneToOneRelationship(subject, helper.createProperty("urn:test#climate"), "arid");
		String[] result = objectUnderTest.toCsv();
		assertThat(result.length, is(2));
		assertThat(result[0], is("Site.name,Site.colour,Site.climate"));
		assertThat(result[1], is("\"site #1\",\"blue\",\"arid\""));
	}

	private Resource subject(String instanceId, String type) {
		Resource typeResource = resource(type);
		return helper.createResource(NS + instanceId, typeResource);
	}

	private Resource resource(String localName) {
		return helper.createResource(NS + localName);
	}
}


text:
<!DOCTYPE html>

		<title>three.js webgl - GLTFloader + Instancing</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<link type="text/css" rel="stylesheet" href="main.css">

			three.js - GLTFLoader + EXT_mesh_gpu_instancing

			Battle Damaged Sci-fi Helmet by
			theblueturtle_

			Royal Esplanade by HDRI Haven


text:
ChildAccountInfoFetcher* ChildAccountInfoFetcher::CreateFrom(
    const std::string& account_id,
    AccountFetcherService* fetcher_service,
    OAuth2TokenService* token_service,
    net::URLRequestContextGetter* request_context_getter,
    invalidation::InvalidationService* invalidation_service) {
#if defined(OS_ANDROID)
  ChildAccountInfoFetcherAndroid::StartFetchingChildAccountInfo(fetcher_service,
                                                                account_id);
  return nullptr;
#else
  return new ChildAccountInfoFetcherImpl(account_id, fetcher_service,
                                         token_service, request_context_getter,
                                         invalidation_service);
#endif
}

ChildAccountInfoFetcher::~ChildAccountInfoFetcher() {
}