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

namespace OpenCvSharp.CPlusPlus
{
    /// <summary>
    /// Base class for high-level OpenCV algorithms
    /// </summary>
    public abstract class Algorithm : DisposableCvObject
    {
        /// <summary>
        ///
        /// </summary>
        private bool disposed;

        #region Init & Disposal
        /// <summary>
        ///
        /// </summary>
        internal Algorithm()
        {
        }

#if LANG_JP
        /// <summary>
        /// リソースの解放
        /// </summary>
#else
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
#endif
        public void Release()
        {
            Dispose(true);
        }
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">
        /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.
        /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (!disposed)
            {
                disposed = true;
                base.Dispose(disposing);
            }
        }

        #endregion

        #region Get
        // Get/Set は、cv::Algorithm のメソッドを単純に呼ぶとクラッシュする。
        // レシーバのポインタ型が常に cv::Algorithm* になってしまうため。
        // なので、内部実装を参考に AlgorithmInfoを直接叩く。
        // Algorithm::info() はabstractで、各子クラス固有の AlgorithmInfo*が取れる。

        /// <summary>
        /// Returns the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <returns></returns>
        public int GetInt(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));
            IntPtr info = InfoPtr;
            int value = 0;
            NativeMethods.core_AlgorithmInfo_getInt(
                info, ptr, name, (int)AlgorithmParamType.Int, ref value);
            return value;
        }
        /// <summary>
        /// Returns the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <returns></returns>
        public double GetDouble(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));
            IntPtr info = InfoPtr;
            double value = 0;
            NativeMethods.core_AlgorithmInfo_getDouble(
                info, ptr, name, (int)AlgorithmParamType.Real, ref value);
            return value;
        }

        /// <summary>
        /// Returns the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <returns></returns>
        public bool GetBool(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));
            IntPtr info = InfoPtr;
            int valueInt = 0;
            NativeMethods.core_AlgorithmInfo_getBool(
                info, ptr, name, (int)AlgorithmParamType.Boolean, ref valueInt);
            return valueInt != 0;
        }
        /// <summary>
        /// Returns the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <returns></returns>
        public string GetString(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));
            IntPtr info = InfoPtr;
            StringBuilder buf = new StringBuilder(1 << 16);
            NativeMethods.core_AlgorithmInfo_getString(
                info, ptr, name, (int)AlgorithmParamType.String, buf, buf.Capacity);
            return buf.ToString();
        }
        /// <summary>
        /// Returns the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <returns></returns>
        public Mat GetMat(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));
            IntPtr info = InfoPtr;
            Mat value = new Mat();
            NativeMethods.core_AlgorithmInfo_getMat(
                info, ptr, name, (int)AlgorithmParamType.Mat, value.CvPtr);
            return value;
        }

        /// <summary>
        /// Returns the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <returns></returns>
        public Mat[] GetMatVector(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            throw new NotImplementedException();
        }
        /// <summary>
        /// Returns the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <returns></returns>
        public Algorithm GetAlgorithm(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            throw new NotImplementedException();
        }

        #endregion

        #region Set
        /// <summary>
        /// Sets the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <param name="value">The parameter value.</param>
        public void SetInt(string name, int value)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            IntPtr info = InfoPtr;
            NativeMethods.core_AlgorithmInfo_setInt(
                info, ptr, name, (int)AlgorithmParamType.Int, value, 0);
        }
        /// <summary>
        /// Sets the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <param name="value">The parameter value.</param>
        public void SetDouble(string name, double value)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            IntPtr info = InfoPtr;
            NativeMethods.core_AlgorithmInfo_setDouble(
                info, ptr, name, (int)AlgorithmParamType.Real, value, 0);
        }
        /// <summary>
        /// Sets the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <param name="value">The parameter value.</param>
        public void SetBool(string name, bool value)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            IntPtr info = InfoPtr;
            int valueInt = value ? 1 : 0;
            NativeMethods.core_AlgorithmInfo_setBool(
                info, ptr, name, (int)AlgorithmParamType.Boolean, valueInt, 0);
        }
        /// <summary>
        /// Sets the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <param name="value">The parameter value.</param>
        public void SetString(string name, string value)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            IntPtr info = InfoPtr;
            NativeMethods.core_AlgorithmInfo_setString(
                info, ptr, name, (int)AlgorithmParamType.String, value, 0);
        }
        /// <summary>
        /// Sets the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <param name="value">The parameter value.</param>
        public void SetMat(string name, Mat value)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (value == null)
                throw new ArgumentNullException(nameof(value));
            value.ThrowIfDisposed();

            IntPtr info = InfoPtr;
            NativeMethods.core_AlgorithmInfo_setMat(
                info, ptr, name, (int)AlgorithmParamType.Mat, value.CvPtr, 0);
        }

        /// <summary>
        /// Sets the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <param name="value">The parameter value.</param>
        public void SetMatVector(string name, IEnumerable<Mat> value)
        {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Sets the algorithm parameter
        /// </summary>
        /// <param name="name">The parameter name.</param>
        /// <param name="value">The parameter value.</param>
        public void SetAlgorithm(string name, Algorithm value)
        {
            throw new NotImplementedException();
        }
        #endregion

        /// <summary>
        /// Returns the algorithm name
        /// </summary>
        public string Name
        {
            get { return Info.Name; }
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public string ParamHelp(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));
            return Info.ParamHelp(name);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public AlgorithmParamType ParamType(string name)
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));
            return Info.ParamType(name);
        }

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public string[] GetParams()
        {
            if (disposed)
                throw new ObjectDisposedException("Algorithm");
            return Info.GetParams();
        }

        /// <summary>
        /// Returns the list of registered algorithms
        /// </summary>
        /// <returns>The output array of algorithm names.</returns>
        public static string[] GetList()
        {
            using (var vec = new VectorOfString())
            {
                NativeMethods.core_Algorithm_getList(vec.CvPtr);
                return vec.ToArray();
            }
        }

        /*
        /// <summary>
        /// Creates algorithm instance by name
        /// </summary>
        /// <param name="name">The algorithm name, one of the names returned by GetList()</param>
        /// <typeparam name="T">Algorithm type (SIFT, FAST, etc.)</typeparam>
        /// <returns></returns>
        public static T Create<T>(string name)
            where T : Algorithm
        {
            if (String.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");

            // リフレクションでオブジェクト生成
            Type t = typeof(T);
            MethodInfo mi = t.GetMethod("CreateAlgorithm", BindingFlags.Public | BindingFlags.Static);
            if (mi == null)
                throw new OpenCvSharpException("Algorithm type [" + t.Name + "] not supported");
            return (T)mi.Invoke(null, new object[] {name});
        }
        */

        /// <summary>
        /// Algorithm information
        /// </summary>
        /// <returns></returns>
        public AlgorithmInfo Info
        {
            get
            {
                if (disposed)
                    throw new ObjectDisposedException("Algorithm");
                return infoObj ?? (infoObj = new AlgorithmInfo(InfoPtr));
            }
        }
        private AlgorithmInfo infoObj;
        /// <summary>
        /// Pointer to algorithm information (cv::AlgorithmInfo*)
        /// </summary>
        /// <returns></returns>
        public abstract IntPtr InfoPtr { get; }

        /// <summary>
        /// Returns a string that represents this Algorithm.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            var str = new StringBuilder();
            str.AppendFormat("Algorithm [{0}]\n", Name);

            string[] names = GetParams();
            foreach (string name in names)
            {
                AlgorithmParamType type = ParamType(name);
                string typeName = Enum.GetName(typeof(AlgorithmParamType), type);
                str.AppendFormat(" * {0} {1} = ", typeName, name);

                switch (type)
                {
                    case AlgorithmParamType.Int:
                    case AlgorithmParamType.Short:
                    case AlgorithmParamType.UChar:
                        str.AppendFormat("{0}\n", GetInt(name));
                        break;
                    case AlgorithmParamType.Boolean:
                        str.AppendFormat("{0}\n", GetBool(name));
                        break;
                    case AlgorithmParamType.Real:
                    case AlgorithmParamType.Float:
                    case AlgorithmParamType.UInt64:
                        str.AppendFormat("{0}\n", GetDouble(name));
                        break;
                    case AlgorithmParamType.Mat:
                        str.AppendFormat("{0}\n", GetMat(name).ToString());
                        break;
                    case AlgorithmParamType.MatVector:
                        str.AppendFormat("Mat[{0}]\n", GetMatVector(name).Length);
                        break;
                    case AlgorithmParamType.String:
                        str.AppendFormat("{0}\n", GetString(name));
                        break;
                    case AlgorithmParamType.Algorithm:
                        str.AppendFormat("{0}\n", GetAlgorithm(name).Name);
                        break;
                }
            }

            return str.ToString();
        }
    }
}


text:
package com.thinkaurelius.faunus;

import org.apache.hadoop.io.GenericWritable;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class Holder<T extends FaunusElement> extends GenericWritable implements WritableComparable<Holder<T>> {

    protected char tag;

    static {
        WritableComparator.define(Holder.class, new Comparator());
    }

    private static Class[] CLASSES = {
            FaunusVertex.class,
            FaunusEdge.class
    };

    protected Class<T>[] getTypes() {
        return CLASSES;

    }

    public Holder() {
        super();
    }

    public Holder(final DataInput in) throws IOException {
        this();
        this.readFields(in);
    }

    public Holder(final char tag, final T element) {
        this();
        this.set(element);
        this.tag = tag;
    }

    @Override
    public int hashCode() {
        return super.get().hashCode();
    }

    public char getTag() {
        return this.tag;
    }

    public T get() {
        return (T) super.get();
    }

    public Holder<T> set(final char tag, final T element) {
        this.set(element);
        this.tag = tag;
        return this;
    }

    @Override
    public void write(final DataOutput out) throws IOException {
        out.writeChar(this.tag);
        super.write(out);

    }

    @Override
    public void readFields(final DataInput in) throws IOException {
        this.tag = in.readChar();
        super.readFields(in);
    }

    @Override
    public boolean equals(final Object object) {
        return object.getClass().equals(Holder.class) && ((Holder) object).getTag() == this.tag && ((Holder) object).get().equals(this.get());
    }

    @Override
    public int compareTo(final Holder<T> holder) {
        final FaunusElement e1 = holder.get();
        final FaunusElement e2 = this.get();
        if (e1 instanceof FaunusVertex && e2 instanceof FaunusVertex)
            return e1.compareTo(e2);
        else
            return 0;
    }

    public static class Comparator extends WritableComparator {
        public Comparator() {
            super(Holder.class);
        }

        @Override
        public int compare(final byte[] holder1, final int start1, final int length1, final byte[] holder2, final int start2, final int length2) {
            // 1 byte is the class
            // 1 byte is the character
            // the next vlong bytes are the long id
            try {
                return Long.valueOf(readVLong(holder1, 3)).compareTo(readVLong(holder2, 3));
            } catch (IOException e) {
                return -1;
            }
        }

        @Override
        public int compare(final WritableComparable a, final WritableComparable b) {
            if (a instanceof Holder && b instanceof Holder)
                return ((Long) (((Holder) a).get().getIdAsLong())).compareTo(((Holder) b).get().getIdAsLong());
            else
                return super.compare(a, b);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
IF OBJECT_ID('zdm.plans') IS NOT NULL
  DROP PROCEDURE zdm.plans
GO
CREATE PROCEDURE zdm.plans
  @filter      nvarchar(256),
  @objectType  nvarchar(20) = 'Proc',
  @rows        smallint = 50
AS
  SET NOCOUNT ON
  SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

  SELECT TOP (@rows) C.objtype, C.cacheobjtype, C.refcounts, C.usecounts, C.size_in_bytes,
         P.query_plan, T.[text]
    FROM sys.dm_exec_cached_plans C
      CROSS APPLY sys.dm_exec_sql_text (C.plan_handle) T
      CROSS APPLY sys.dm_exec_query_plan(C.plan_handle) P
   WHERE C.objtype = @objectType AND T.[text] like N'%' + @filter + N'%'
   ORDER BY C.usecounts DESC
GO


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var router_1 = require('@angular/router');
var product_service_1 = require('./product.service');
var ng2_toastr_1 = require('ng2-toastr/ng2-toastr');
var ng2_slim_loading_bar_1 = require('ng2-slim-loading-bar');
var ProductComponent = (function () {
    // constructor
    function ProductComponent(productService, router, toastr, vRef, slimLoadingBarService) {
        this.productService = productService;
        this.router = router;
        this.toastr = toastr;
        this.vRef = vRef;
        this.slimLoadingBarService = slimLoadingBarService;
        this.productFilter = '';
        this.toastr.setRootViewContainerRef(vRef);
    }
    // start loading
    ProductComponent.prototype.startLoading = function () {
        this.slimLoadingBarService.progress = 30;
        this.slimLoadingBarService.start();
    };
    // complete loading
    ProductComponent.prototype.completeLoading = function () {
        this.slimLoadingBarService.complete();
    };
    // list product
    ProductComponent.prototype.getProductList = function () {
        if (!localStorage.getItem('access_token')) {
            this.router.navigate(['login']);
        }
        this.getProductData();
    };
    ProductComponent.prototype.getProductData = function () {
        var toastr;
        this.productCollectionView = new wijmo.collections.CollectionView(this.productService.getListProductData(toastr));
        this.productCollectionView.filter = this.filterFunction.bind(this);
        this.productCollectionView.pageSize = 15;
        this.productCollectionView.trackChanges = true;
    };
    Object.defineProperty(ProductComponent.prototype, "filter", {
        // filter
        get: function () {
            return this.productFilter;
        },
        // filter
        set: function (value) {
            if (this.productFilter != value) {
                this.productFilter = value;
                if (this.productToFilter) {
                    clearTimeout(this.productToFilter);
                }
                var self = this;
                this.productToFilter = setTimeout(function () {
                    self.productCollectionView.refresh();
                }, 500);
            }
        },
        enumerable: true,
        configurable: true
    });
    // filter function
    ProductComponent.prototype.filterFunction = function (item) {
        if (this.productFilter) {
            return (item.ArticleCode.toLowerCase().indexOf(this.productFilter.toLowerCase()) > -1) ||
                (item.ManualArticleCode.toLowerCase().indexOf(this.productFilter.toLowerCase()) > -1) ||
                (item.Article.toLowerCase().indexOf(this.productFilter.toLowerCase()) > -1) ||
                (item.Unit.toLowerCase().indexOf(this.productFilter.toLowerCase()) > -1);
        }
        return true;
    };
    // show menu
    ProductComponent.prototype.showMenu = function () {
        document.getElementById("showTop").click();
    };
    ProductComponent.prototype.backClicked = function () {
        window.history.back();
    };
    // refresh grid
    ProductComponent.prototype.refreshGrid = function () {
        this.startLoading();
        document.getElementById("btnRefresh").disabled = true;
        document.getElementById("btnRefresh").innerHTML = "<i class='fa fa-spinner fa-spin fa-fw'></i> Refreshing";
        this.getProductData();
    };
    // initialization
    ProductComponent.prototype.ngOnInit = function () {
        this.startLoading();
        this.getProductList();
    };
    ProductComponent = __decorate([
        core_1.Component({
            selector: 'my-product',
            templateUrl: 'app/setup-product/product.html'
        }),
        __metadata('design:paramtypes', [product_service_1.ProductService, router_1.Router, ng2_toastr_1.ToastsManager, core_1.ViewContainerRef, ng2_slim_loading_bar_1.SlimLoadingBarService])
    ], ProductComponent);
    return ProductComponent;
}());
exports.ProductComponent = ProductComponent;
//# sourceMappingURL=product.component.js.map


text:
module.exports = function (grunt)
{
	grunt.registerTask('syncAssets', ['jst:dev', 'sass:dev', 'sync:dev', 'coffee:dev']);
};


text:
require 'frinkiac/version'
require 'frinkiac/screencap'


text:
function News(){
  var i=0;rasta=0;
  var o=0;k=0;m=0;
  str = new String();
    for (i=LastPosition; i < MaxValue ; i++){
       rasta=rasta+1;
	}
	document.write('  Naujienos ');
	if (rasta==0) document.write('

  Jokių naujienų nėra.'); else     document.write('

  Šiuo metu yra ', rasta,' naujienų(-a).
  Jeigu norite ką nors atsiųsti, tiesiog paspauskite ant to sulietuvinimo pavadinimo, kurį jūs norite atsisiųsti.');
  for (i=LastPosition; i < MaxValue ; i++){
			document.write('

');
			document.write('
 ');
			document.write('	');
			document.write('
');
			document.write('
');
            document.write('
');
            document.write('
');
            document.write('
 ');
            document.write('   ',Suliet[i],'	');
            document.write('
');
            document.write('
');
            document.write(' 	');
            document.write('
');
            document.write('
 ');
            document.write('   ');
            document.write('Kaina:');
			if (Money[i]=='-') document.write('Nemokama'); else document.write(Money[i]);
			document.write('	');
            document.write('
');
            document.write('
 ');
            document.write('  ');
            document.write('Dydis: ',Dydis[i],'	');
            document.write('
');
            document.write('
 ');
            document.write('  ');
            document.write('Įvertinimas: ');
            document.write('',Taskai[i],'	');
            document.write('
');
            document.write('
 ');
            document.write('  ');
            document.write('Svetainė: ');
            document.write('',Page[i],'	');
            document.write('
');
            document.write('
 ');
            document.write(' 	');
            document.write('
');
            document.write('
 ');
            document.write(' ', Koment[i],'	');
            document.write('
');
            document.write('
');
		}
  }


text:
@interface PodsDummy_Pods_JPulseHUD_Example : NSObject
@end
@implementation PodsDummy_Pods_JPulseHUD_Example
@end


text:
.. highlight:: shell

Installation
============

In order to install Morelia, make sure Python is installed. Morelia was tested
with:

    * Python 3.5
    * Python 3.6
    * Python 3.7

Stable release
--------------

To install Morelia, run this command in your terminal:

.. code-block:: console

    $ pip install morelia

This is the preferred method to install Morelia, as it will always install the most recent stable release.

If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.

.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/

From sources
------------

The sources for Morelia can be downloaded from the `GitHub repo`_.

You can either clone the public repository:

.. code-block:: console

    $ git clone git://github.com/kidosoft/Morelia

Or download the `tarball`_:

.. code-block:: console

    $ curl  -OL https://github.com/kidosoft/morelia/tarball/master

Once you have a copy of the source, you can install it with:

.. code-block:: console

    $ python setup.py install

.. _GitHub repo: https://github.com/kidosoft/Morelia
.. _tarball: https://github.com/kidosoft/Morelia/tarball/master


text:
<?php

/**
 * @file
 * Definition of Drupal\comment\Tests\CommentActionsTest.
 */

namespace Drupal\comment\Tests;

/**
 * Tests actions provided by the Comment module.
 */
class CommentActionsTest extends CommentTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array('dblog', 'action');

  public static function getInfo() {
    return array(
      'name' => 'Comment actions',
      'description' => 'Test actions provided by the comment module.',
      'group' => 'Comment',
    );
  }

  /**
   * Tests comment publish and unpublish actions.
   */
  function testCommentPublishUnpublishActions() {
    $this->drupalLogin($this->web_user);
    $comment_text = $this->randomName();
    $subject = $this->randomName();
    $comment = $this->postComment($this->node, $comment_text, $subject);

    // Unpublish a comment.
    $action = entity_load('action', 'comment_unpublish_action');
    $action->execute(array($comment));
    $this->assertEqual($comment->status->value, COMMENT_NOT_PUBLISHED, 'Comment was unpublished');

    // Publish a comment.
    $action = entity_load('action', 'comment_publish_action');
    $action->execute(array($comment));
    $this->assertEqual($comment->status->value, COMMENT_PUBLISHED, 'Comment was published');
  }

  /**
   * Tests the unpublish comment by keyword action.
   */
  function testCommentUnpublishByKeyword() {
    $this->drupalLogin($this->admin_user);
    $keyword_1 = $this->randomName();
    $keyword_2 = $this->randomName();
    $action = entity_create('action', array(
      'id' => 'comment_unpublish_by_keyword_action',
      'label' => $this->randomName(),
      'type' => 'comment',
      'configuration' => array(
        'keywords' => array($keyword_1, $keyword_2),
      ),
      'plugin' => 'comment_unpublish_by_keyword_action',
    ));
    $action->save();

    $comment = $this->postComment($this->node, $keyword_2, $this->randomName());

    // Load the full comment so that status is available.
    $comment = comment_load($comment->id());

    $this->assertTrue($comment->status->value == COMMENT_PUBLISHED, 'The comment status was set to published.');

    $action->execute(array($comment));
    $this->assertTrue($comment->status->value == COMMENT_NOT_PUBLISHED, 'The comment status was set to not published.');
  }

}


text:
<TITLE>Review for Titanic (1997)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Titanic (1997)

reviewed by
Harvey S. Karten

TITANIC

 By Harvey Karten, Ph.D.
 20th Century Fox/Lightstorm/Paramount Pictures
 Director:  James Cameron
 Writer:  James Cameron
 Cast: Leonardo DiCaprio, Kate Winslet, Billy Zen, Kathy
Bates, Frances Fisher, Gloria Stuart, Bill Paxton, Bernard Hill,
Jonathan Hyde, Victor Garber

   Few people under the age of forty have even heard of the
legendary folk singer, Pete Seeger, who in his heyday had a
tendency to attach Marxist ideology to his strains and ballads.
In one of his major melodies, "Titanic," he strums his banjo
and intones, "The rich refused to associate with the poor./  So
they put the poor below,/ They were the first to go,/ It was sad
when the great ship went down."  Committed to the left wing
even in his insistence on once stating that Franco was a
bigger villain than Stalin, Seeger could well be expected to
cut one of the world's great disasters with a strong
political edge.

   What larger point can be made from this insight?  Simply
this: in converting life to art, visionaries have the power (within
reason) to impose their interpretation on events, to highlight
those aspects of a true story which they wish to underscore
and ignore those which they consider of little relevance to
their imagination.  What James Cameron did in his smashing
direction of "Titanic"--whose screenplay he wrote as well--is to
emphasize four angles in his epic work about the fate of the
world's most celebrated cruise ship which left Southampton,
England, in April of 1912.  Foremost is the love story between
an upper-class, somewhat spoiled 17-year-old, Rose DeWitt
Bukater (Kate Winslet) and a lower-caste, self-confident and
handsome lad, Jack Dawson (Leonardo DiCaprio).  Jack
intuitively senses the girl's rebelliousness, her unhappiness
with what she imagines will be a high-society life of endless
cotillion balls and inane conversation.  His own spirited style
becomes the anchor which is hungrily grasped by the
despondent young woman.   Cameron is obsessed, also, with
re-creating much of Titanic's actual dimensions, in effecting a
verisimilitude between the vessel of 1912 and the ship
designed for him in this film.  Given his $200 million budget--
which makes "Titanic" the most expensive movie of all time--
it's no wonder that he is able to hire the original manufacturer
of the vessel's carpet, reproducing the actual weave for an
audience which would hardly put much concern with such
literalness.  Thirdly, Cameron nutritiously feeds his public with
the disaster spectacle for which it has an insatiable appetite,
devoting the final forty percent of the three and one-quarter
work on the mayhem which follows the craft's collision with an
iceberg.  Finally Cameron deals with the political reality; that
snobbery and a fairly rigid class structure is alive and well not
only in Europe but in America as well.  "Titanic" never stops
beating up on the tuxedo-clad, corset-imprisoned crowd with
the money not only to ride first class but bring along maids,
bodyguards and even their favorite paintings to decorate their
staterooms.  Even in a film a lengthy as this one, fulfilling all
four missions is an imposing task, and Cameron rises to the
occasion so well that his audience is likely to accept without
sardonic laughter even the corniest playing-out of the
romance between Winslet's and DiCaprio's characters.

   To avoid the structure of a museum piece, Cameron wisely
opens his story in the present day, basing the scenario
around the actual discovery in 1985 of the body of the boat
deep beneath the surface of the North Atlantic Ocean.  Brock
Lovett (Bill Paxton), an American explorer who is not adverse
to capitalizing on the riches which may be found within the
wreck, is particularly interested in recovering a diamond
necklace said to have been owned by Louis XVI allegedly lost
in the wreckage. To his dismay he locates not the diamond
but a reproduction of the jewelry on a painting around the
neck of a nude woman who had posed for a sketch during the
ship's maiden voyage.  When news of this find hits the
airwaves, a 101-year-old woman who claims to be Rose
DeWitt Bukater (Gloria Stuart, actually 87) and the owner of
the necklace phones Brock expressing her willingness to tell
the story of the ill-fated voyage.  Cinematographer Russell
Carpenter hones in on the wreck which he is videotaping and
we are suddenly transformed into the glittering pre-war era of
1912 society as the Southampton-based craft labeled
unsinkable takes on passengers from the fabulously rich
to the penniless immigrants.  The first-class compartment is
lavishly appointed and filled with both "new money" and the
"old money" types who look down on the upstarts.  When
Jack Dawson wins a steerage ticket after a lucky hand of
poker just minutes before the ship is to leave the dock at
midnight, his life becomes so intertwined with that of the
lovely but suicidal society girl whose life he saves that he and
his Rose become as inseparable as Romeo and Juliet.

   Though the dialogue leans far more to the cornball and
inane than to the witty and scintillating, and while Cameron is
intent on exposing his audience to the most opulent and
profuse display of humanity yet recorded, the romance and
class struggle portrayed in "Titanic" is, curiously enough, of
greater interest than the disaster sequences--which, by the
way, have been chronicled in almost real time.  Jack and
Rose take their time to get to know and love each other, with
Rose torn between breaking her engagement to the
fabulously rich Cal (Billy Zane) and thrusting aside her humble
but relaxed and confident new beau, Jack.  Rose's resistance
to the penniless artist is overcome in the most predictable
way--she bolts from the asinine conversation of her peers to
join Jack at a "real" party of indigent immigrants dancing a jig,
taking part in hand-wrestling and generally have a rowdy
good time for themselves.  Her decision to pose in the nude
for the talented young man who has been earning his living
sketching women through Paris is the key moment of the
movie.  The chemistry between the two is so palpable, so
believable, that we are swept along despite our inclination to
dismiss the scenes as so much mawkish folderol.  We are
willing even to believe that Cal, the man whom Rose's mother
Frances (Ruth DeWitt Bukater) has chosen for her daughter
because her own wealth had been depleted, can be one
hundred percent Edwardian villain.  So scheming and
snobbish is this Cal that he seems unable to commit a single
ethical act throughout the entire film.  If he finds himself
outmaneuvered for his fiance's love by a member of the hoi
polloi he will stop at nothing, planting jewelry on him and
claiming robbery, even shooting at him as Jack skips around
the deck with his fair maiden.  The steerage people are all
fun-loving, sincere, authentic: the first class passengers--with
the exception of Molly Brown (Kathy Bates) who enjoys being
the comic center of the movie--are obnoxious almost to a
person.

   Even as Titanic hits the fateful iceberg, Cameron takes his
time in introducing the tragic nature of the collision.  At first,
the incident appears minor.  Yet like an early-stage cancer
that is operable, we are made to believe that the ship is going
to sink within two hours and that half of its population will die
because the owners, to avoid an appearance of clutter, did
not provide a sufficient number of lifeboats.

   Film critic David Thomson once said of James Cameron--
known for his off-the-wall sci fi films like "The Spawning,"
"Aliens," and "Terminator 2" that "no one did so much to
redeem the eighties genre of high-tech threat through the
overlay of genuine human interest stories."  Even given the
awe-inspiring technology that treats us to the mayhem on
board as the water seeps, then flows dramatically into each
compartment, Cameron does not smother his interesting,
romantic story with effects and apparatus.  "Titanic" is as
likely as not to sweep the Oscars, given the love of the
Academy for movies of epic grandeur.  It is perhaps the best
example in 1997 of a film which is pure, simple melodrama,
the sort which many Hollywood producers steer clear of
because of their perception that a modern audience will hoot
and holler at the screen, and yet one which works on us by
achieving an end-run around our intellectual defenses.  Rated
PG-13.  Running Time: 194 minutes.  (C) 1997 Harvey Karten

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
import { Timeline } from 'antd';
const container = document.getElementById('components-timeline-demo-pending');

ReactDOM.render(
<Timeline pending>
  <Timeline.Item>创建服务现场 2015-09-01</Timeline.Item>
  <Timeline.Item>初步排除网络异常 2015-09-01</Timeline.Item>
  <Timeline.Item>技术测试异常 2015-09-01</Timeline.Item>
</Timeline>
, container);

      最后一个

在最后位置添加一个幽灵节点,表示时间轴未完成,还在记录过程中。


text:
package toll.geofence;

import com.google.android.gms.maps.model.LatLng;

import java.util.HashMap;

/**
 * Constants used in this sample.
 */
public final class Constants {

    private Constants() {
    }

    public static final String PACKAGE_NAME = "com.google.android.gms.location.Geofence";

    public static final String SHARED_PREFERENCES_NAME = PACKAGE_NAME + ".SHARED_PREFERENCES_NAME";

    public static final String GEOFENCES_ADDED_KEY = PACKAGE_NAME + ".GEOFENCES_ADDED_KEY";

    public static final float GEOFENCE_RADIUS_IN_METERS = 2500; //2,5km

    /**
     * Map for storing information about airports in the San Francisco bay area.
     */
    public static final HashMap<String, LatLng> GEOFENCE_ZONES = new HashMap<String, LatLng>();
    static {
        GEOFENCE_ZONES.put("TOLL_ZONE_GOTHENBURG", new LatLng(57.7013956150995, 11.971664428710938));
        GEOFENCE_ZONES.put("TOLL_ZONE_ANNA", new LatLng(60.2086194,14.932779));
    }
}


text:
(function(){
    'use strict';

    /* Services */
    angular.module('moduleHttpService', []).service('httpService', function($http, $q) {
        return {
            get: function(uri) {
                var deferred = $q.defer()
                $http.get(uri).then(function(data) {
                    deferred.resolve(data)
                }, function(data) {
                    deferred.reject('Error calling: ' + uri)
                })
                return deferred.promise
            },
            getQueryMap: function(uri, queryMap) {
                var deferred = $q.defer();

                if(Object.getOwnPropertyNames(queryMap).length != 0) {
                    uri = uri + '?';
                    angular.forEach(queryMap, function(value, key) {
                        if(uri.slice(-1) == '?') {
                            uri = uri + key + '=' + value;
                        } else {
                            uri = uri + '&' + key + '=' + value;
                        }
                    });
                }

                $http.get(uri).then(function(data) {
                    deferred.resolve(data)
                }, function(data) {
                    deferred.reject('Error calling: ' + uri)
                })
                return deferred.promise
            },
            post: function(uri, data) {
                var deferred = $q.defer()
                $http.post(uri, data).then(function(data) {
                    deferred.resolve(data)
                }, function(data) {
                    deferred.reject(data)
                })
                return deferred.promise
            },
            put: function(uri, data) {
                var deferred = $q.defer()
                $http.put(uri, data).then(function(data) {
                    deferred.resolve(data)
                }, function(data) {
                    deferred.reject(data)
                })
                return deferred.promise
            },
            delete: function(uri) {
                var deferred = $q.defer()
                $http.delete(uri).then(function(data) {
                    deferred.resolve(data)
                }, function(data) {
                    deferred.reject(data)
                })
                return deferred.promise
            },
            multipleCall: function(callsArray) {
                var deferred = $q.defer();
                $q.all(callsArray).then(function(results_array){
                    deferred.resolve(results_array);
                }).catch(function(error){
                    deferred.reject(error);
                });
                return deferred.promise;
            }
        }
    });

})();


text:
import {accumulateEnterLeaveDispatches} from 'events/EventPropagators';

import SyntheticMouseEvent from './SyntheticMouseEvent';
import {
  getClosestInstanceFromNode,
  getNodeFromInstance,
} from '../client/ReactDOMComponentTree';

const eventTypes = {
  mouseEnter: {
    registrationName: 'onMouseEnter',
    dependencies: ['topMouseOut', 'topMouseOver'],
  },
  mouseLeave: {
    registrationName: 'onMouseLeave',
    dependencies: ['topMouseOut', 'topMouseOver'],
  },
};

const EnterLeaveEventPlugin = {
  eventTypes: eventTypes,

  /**
   * For almost every interaction we care about, there will be both a top-level
   * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
   * we do not extract duplicate events. However, moving the mouse into the
   * browser from outside will not fire a `mouseout` event. In this case, we use
   * the `mouseover` top-level event.
   */
  extractEvents: function(
    topLevelType,
    targetInst,
    nativeEvent,
    nativeEventTarget,
  ) {
    if (
      topLevelType === 'topMouseOver' &&
      (nativeEvent.relatedTarget || nativeEvent.fromElement)
    ) {
      return null;
    }
    if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {
      // Must not be a mouse in or mouse out - ignoring.
      return null;
    }

    let win;
    if (nativeEventTarget.window === nativeEventTarget) {
      // `nativeEventTarget` is probably a window object.
      win = nativeEventTarget;
    } else {
      // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
      const doc = nativeEventTarget.ownerDocument;
      if (doc) {
        win = doc.defaultView || doc.parentWindow;
      } else {
        win = window;
      }
    }

    let from;
    let to;
    if (topLevelType === 'topMouseOut') {
      from = targetInst;
      const related = nativeEvent.relatedTarget || nativeEvent.toElement;
      to = related ? getClosestInstanceFromNode(related) : null;
    } else {
      // Moving to a node from outside the window.
      from = null;
      to = targetInst;
    }

    if (from === to) {
      // Nothing pertains to our managed components.
      return null;
    }

    const fromNode = from == null ? win : getNodeFromInstance(from);
    const toNode = to == null ? win : getNodeFromInstance(to);

    const leave = SyntheticMouseEvent.getPooled(
      eventTypes.mouseLeave,
      from,
      nativeEvent,
      nativeEventTarget,
    );
    leave.type = 'mouseleave';
    leave.target = fromNode;
    leave.relatedTarget = toNode;

    const enter = SyntheticMouseEvent.getPooled(
      eventTypes.mouseEnter,
      to,
      nativeEvent,
      nativeEventTarget,
    );
    enter.type = 'mouseenter';
    enter.target = toNode;
    enter.relatedTarget = fromNode;

    accumulateEnterLeaveDispatches(leave, enter, from, to);

    return [leave, enter];
  },
};

export default EnterLeaveEventPlugin;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3(2): 487 (1898)

#### Original name
Hypoderma ampelodesmi Ces.

### Remarks
null


text:
class Aggregate::Attribute::Enum < Aggregate::Attribute::Builtin
  def load(value)
    value.to_sym
  end

  def store(value)
    value.to_s
  end

  def assign(value)
    value.to_sym if value.present?
  end
end


text:
#include <glm/gtc/matrix_inverse.hpp>
#include <glm/gtc/type_ptr.hpp>

#include "dpengine/light/Light.h"
#include "dpengine/scene/Material.h"
#include "dpengine/shapes/terrain.h"
#include "dpengine/scene/SceneLeafModel.h"
#include "dpengine/texture/Texture.h"

namespace DreadedPE
{

TerrainShader* TerrainShader::terrain_shader_ = NULL;

TerrainShader::TerrainShader(const std::string& vertex_shader, const std::string& fragment_shader)
	: LightShader(vertex_shader, fragment_shader)
{

}

void TerrainShader::prepareToRender(const SceneLeafModel& model_node, const glm::mat4& view_matrix, const glm::mat4& model_matrix, const glm::mat4& projection_matrix, const std::vector<const SceneLeafLight*>& lights)
{
	std::map<const Shape*, GLuint>::iterator mapped_i = shape_to_vbo_.find(model_node.getShape().get());
	GLuint vbo_index;
	if (mapped_i == shape_to_vbo_.end())
	{
		glGenVertexArrays(1, &vbo_index);
		glBindVertexArray(vbo_index);

		glEnableVertexAttribArray(0);
		glEnableVertexAttribArray(1);
		glEnableVertexAttribArray(2);
		glDisableVertexAttribArray(3);
		glDisableVertexAttribArray(4);
		glDisableVertexAttribArray(5);
		glDisableVertexAttribArray(6);
		glDisableVertexAttribArray(7);

		glBindBuffer(GL_ARRAY_BUFFER, model_node.getShape()->getVertexBufferId());
		glVertexAttribPointer((GLint)0, 3, GL_FLOAT, GL_FALSE, 0, 0);

		glBindBuffer(GL_ARRAY_BUFFER, model_node.getShape()->getTexCoordBufferId());
		glVertexAttribPointer((GLint)1, 2, GL_FLOAT, GL_FALSE, 0, 0);

		glBindBuffer(GL_ARRAY_BUFFER, model_node.getShape()->getNormalBufferId());
		glVertexAttribPointer((GLint)2, 3, GL_FLOAT, GL_FALSE, 0, 0);

		glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, model_node.getShape()->getIndexBufferId());
		shape_to_vbo_[model_node.getShape().get()] = vbo_index;
		model_node.getShape()->addDestructionListener(*this);
	}
	else
	{
		glBindVertexArray((*mapped_i).second);
	}

	if (last_used_shader_ != this)
	{
		bindShader();
	}

	LightShader::prepareToRender(model_node, view_matrix, model_matrix, projection_matrix, lights);
	glm::mat4 model_view_matrix = view_matrix * model_matrix;
	//glm::mat4 normal_matrix = glm::inverseTranspose(model_view_matrix);

	//Send the modelview and projection matrices to the shaders
	glUniformMatrix4fv(modelview_matrix_loc_, 1, false, glm::value_ptr(model_view_matrix));
	glUniformMatrix4fv(model_matrix_loc_, 1, false, glm::value_ptr(model_matrix));
	glUniformMatrix4fv(projection_matrix_loc_, 1, false, glm::value_ptr(projection_matrix));
	glUniformMatrix4fv(view_matrix_loc_, 1, false, glm::value_ptr( view_matrix));

	assert (model_node.getMaterial()->get1DTextures().size() == 1);
	assert (model_node.getMaterial()->get2DTextures().size() == 1);

	glUniform1i(texture0_loc_, model_node.getMaterial()->get2DTextures()[0]->getActiveTextureId());

	glUniform1i(texture1_loc_, model_node.getMaterial()->get1DTextures()[0]->getActiveTextureId());

	const MaterialLightProperty& material_ambient = model_node.getMaterial()->getAmbient();
	const MaterialLightProperty& material_diffuse = model_node.getMaterial()->getDiffuse();
	const MaterialLightProperty& material_specular = model_node.getMaterial()->getSpecular();
	const MaterialLightProperty& material_emissive = model_node.getMaterial()->getEmissive();

	glUniform4f(material_ambient_loc_, material_ambient.red_, material_ambient.green_, material_ambient.blue_, material_ambient.alpha_);
	glUniform4f(material_diffuse_loc_, material_diffuse.red_, material_diffuse.green_, material_diffuse.blue_, material_diffuse.alpha_);
	glUniform4f(material_specular_loc_, material_specular.red_, material_specular.green_, material_specular.blue_, material_specular.alpha_);
	glUniform4f(material_emissive_loc_, material_emissive.red_, material_emissive.green_, material_emissive.blue_, material_emissive.alpha_);

	glDrawElements(model_node.getShape()->getRenderingMode(), model_node.getShape()->getIndices().size(), GL_UNSIGNED_INT, 0);
	glBindVertexArray(0);
}

TerrainShader& TerrainShader::getShader()
{
	if (terrain_shader_ == NULL)
	{
		terrain_shader_ = new TerrainShader("shaders/basic-shadow.vert", "shaders/terrain.frag");

		// Load the shader.
		if (!terrain_shader_->initialize())
		{
			std::cerr << "Failed to initialise the terrain shader." << std::endl;
			exit(1);
		}

		//Bind the attribute locations
		terrain_shader_->bindAttrib(0, "a_Vertex");
		terrain_shader_->bindAttrib(1, "a_TexCoord0");
		terrain_shader_->bindAttrib(2, "a_Normal");

		//Re link the program
		terrain_shader_->linkProgram();
		terrain_shader_->resolveUniformNames();
		terrain_shader_->bindShader();

		terrain_shader_->modelview_matrix_loc_ = terrain_shader_->getUniformLocation("modelview_matrix");
		terrain_shader_->model_matrix_loc_ = terrain_shader_->getUniformLocation("model_matrix");
		terrain_shader_->projection_matrix_loc_ = terrain_shader_->getUniformLocation("projection_matrix");
		terrain_shader_->view_matrix_loc_ = terrain_shader_->getUniformLocation("view_matrix");
		terrain_shader_->texture0_loc_ = terrain_shader_->getUniformLocation("texture0");
		terrain_shader_->texture1_loc_ = terrain_shader_->getUniformLocation("texture1");
		terrain_shader_->material_ambient_loc_ = terrain_shader_->getUniformLocation("material_ambient");
		terrain_shader_->material_diffuse_loc_ = terrain_shader_->getUniformLocation("material_diffuse");
		terrain_shader_->material_specular_loc_ = terrain_shader_->getUniformLocation("material_specular");
		terrain_shader_->material_emissive_loc_ = terrain_shader_->getUniformLocation("material_emissive");
	}
	return *terrain_shader_;
}

};


text:
<?php

namespace Ticketmatic\Model;

use Ticketmatic\Json;

/**
 * Address, used for physical deliveries and contact details.
 *
 * ## Help Center
 *
 * Full documentation can be found in the Ticketmatic Help Center
 * (https://apps.ticketmatic.com/#/knowledgebase/api/types/Address).
 */
class Address implements \jsonSerializable
{
    /**
     * Create a new Address
     *
     * @param array $data
     */
    public function __construct(array $data = array()) {
        foreach ($data as $key => $value) {
            $this->$key = $value;
        }
    }

    /**
     * Address ID
     *
     * Note: Only available when used for a contact (api/types/Contact) address.
     *
     * @var int
     */
    public $id;

    /**
     * Address type ID
     *
     * Note: Only available when used for a contact (api/types/Contact) address.
     *
     * @var int
     */
    public $typeid;

    /**
     * Addressee
     *
     * Note: Only available when used as an order (api/types/Order) deliver address.
     *
     * @var string
     */
    public $addressee;

    /**
     * City
     *
     * @var string
     */
    public $city;

    /**
     * Country name (based on `typeid`, returned as a convenience).
     *
     * Note: Only available when used for a contact (api/types/Contact) address.
     *
     * @var string
     */
    public $country;

    /**
     * ISO 3166-1 alpha-2 country code
     * (http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
     *
     * @var string
     */
    public $countrycode;

    /**
     * Contact this address belongs to
     *
     * Note: Only available when used for a contact (api/types/Contact) address.
     *
     * @var int
     */
    public $customerid;

    /**
     * State
     *
     * @var string
     */
    public $state;

    /**
     * Street field 1 (typically the street name)
     *
     * @var string
     */
    public $street1;

    /**
     * Street field 2 (typically the number)
     *
     * @var string
     */
    public $street2;

    /**
     * Street field 3 (sometimes used for box numbers or suffixes)
     *
     * @var string
     */
    public $street3;

    /**
     * Address type (based on `typeid`, returned as a convenience).
     *
     * Note: Only available when used for a contact (api/types/Contact) address.
     *
     * @var string
     */
    public $type;

    /**
     * Zip code
     *
     * @var string
     */
    public $zip;

    /**
     * Unpack Address from JSON.
     *
     * @param object $obj
     *
     * @return \Ticketmatic\Model\Address
     */
    public static function fromJson($obj) {
        if ($obj === null) {
            return null;
        }

        return new Address(array(
            "id" => isset($obj->id) ? $obj->id : null,
            "typeid" => isset($obj->typeid) ? $obj->typeid : null,
            "addressee" => isset($obj->addressee) ? $obj->addressee : null,
            "city" => isset($obj->city) ? $obj->city : null,
            "country" => isset($obj->country) ? $obj->country : null,
            "countrycode" => isset($obj->countrycode) ? $obj->countrycode : null,
            "customerid" => isset($obj->customerid) ? $obj->customerid : null,
            "state" => isset($obj->state) ? $obj->state : null,
            "street1" => isset($obj->street1) ? $obj->street1 : null,
            "street2" => isset($obj->street2) ? $obj->street2 : null,
            "street3" => isset($obj->street3) ? $obj->street3 : null,
            "type" => isset($obj->type) ? $obj->type : null,
            "zip" => isset($obj->zip) ? $obj->zip : null,
        ));
    }

    /**
     * Serialize Address to JSON.
     *
     * @return array
     */
    public function jsonSerialize() {
        $result = array();
        if (!is_null($this->id)) {
            $result["id"] = intval($this->id);
        }
        if (!is_null($this->typeid)) {
            $result["typeid"] = intval($this->typeid);
        }
        if (!is_null($this->addressee)) {
            $result["addressee"] = strval($this->addressee);
        }
        if (!is_null($this->city)) {
            $result["city"] = strval($this->city);
        }
        if (!is_null($this->country)) {
            $result["country"] = strval($this->country);
        }
        if (!is_null($this->countrycode)) {
            $result["countrycode"] = strval($this->countrycode);
        }
        if (!is_null($this->customerid)) {
            $result["customerid"] = intval($this->customerid);
        }
        if (!is_null($this->state)) {
            $result["state"] = strval($this->state);
        }
        if (!is_null($this->street1)) {
            $result["street1"] = strval($this->street1);
        }
        if (!is_null($this->street2)) {
            $result["street2"] = strval($this->street2);
        }
        if (!is_null($this->street3)) {
            $result["street3"] = strval($this->street3);
        }
        if (!is_null($this->type)) {
            $result["type"] = strval($this->type);
        }
        if (!is_null($this->zip)) {
            $result["zip"] = strval($this->zip);
        }

        return $result;
    }
}


text:
package org.apache.reef.tang;

import org.apache.reef.tang.exceptions.NameResolutionException;
import org.apache.reef.tang.implementation.avro.AvroClassHierarchySerializer;
import org.apache.reef.tang.formats.AvroConfigurationSerializer;
import org.apache.reef.tang.formats.ConfigurationSerializer;
import org.apache.reef.tang.implementation.protobuf.ProtocolBufferClassHierarchy;
import org.apache.reef.tang.proto.ClassHierarchyProto;
import org.apache.reef.tang.types.NamedParameterNode;
import org.apache.reef.tang.types.Node;
import org.junit.Assert;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.util.Set;

/**
 * Test case for class hierarchy deserialization.
 * TODO: The files should be created and deserialized by the AvroClassHierarchySerializer (REEF-400)
 */
public class ClassHierarchyDeserializationTest {
  private final ConfigurationSerializer configurationSerializer = new AvroConfigurationSerializer();
  private final ClassHierarchySerializer classHierarchySerializer = new AvroClassHierarchySerializer();

  /**
   * generate task.bin from running .Net ClassHierarchyBuilder.exe.
   */
  @Test
  public void testDeserializationForTasks() {
    // TODO: The file should be written by Avro (REEF-400)
    try (final InputStream chin = Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("Task.bin")) {
      // TODO: Use AvroClassHierarchySerializer instead (REEF-400)
      final ClassHierarchyProto.Node root = ClassHierarchyProto.Node.parseFrom(chin);
      final ClassHierarchy ch = new ProtocolBufferClassHierarchy(root);
      final Node n1 = ch.getNode("Org.Apache.REEF.Examples.Tasks.StreamingTasks.StreamTask1, " +
          "Org.Apache.REEF.Examples.Tasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
      Assert.assertTrue(n1.getFullName().equals("Org.Apache.REEF.Examples.Tasks.StreamingTasks.StreamTask1, " +
          "Org.Apache.REEF.Examples.Tasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));

      final Node n2 = ch.getNode("Org.Apache.REEF.Examples.Tasks.HelloTask.HelloTask, " +
          "Org.Apache.REEF.Examples.Tasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
      Assert.assertTrue(n2.getFullName().equals("Org.Apache.REEF.Examples.Tasks.HelloTask.HelloTask, " +
          "Org.Apache.REEF.Examples.Tasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"));

      final ConfigurationBuilder taskConfigurationBuilder1 = Tang.Factory.getTang()
          .newConfigurationBuilder(ch);

      final ConfigurationBuilder taskConfigurationBuilder2 = Tang.Factory.getTang()
          .newConfigurationBuilder(ch);
    } catch (final IOException e) {
      final String message = "Unable to load class hierarchy.";
      throw new RuntimeException(message, e);
    } catch (final NameResolutionException e) {
      final String message = "Unable to get node from class hierarchy.";
      throw new RuntimeException(message, e);
    }
  }

  /**
   * This is to test CLR protocol Buffer class hierarchy merge.
   */
  @Test
  public void testProtocolClassHierarchyMerge() {
    final ConfigurationBuilder taskConfigurationBuilder;
    final ConfigurationBuilder eventConfigurationBuilder;

    // TODO: The file should be written by Avro (REEF-400)
    try (final InputStream chin = Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("Task.bin")) {
      // TODO: Use AvroClassHierarchySerializer instead (REEF-400)
      final ClassHierarchyProto.Node root = ClassHierarchyProto.Node.parseFrom(chin);
      final ClassHierarchy ch = new ProtocolBufferClassHierarchy(root);
      taskConfigurationBuilder = Tang.Factory.getTang().newConfigurationBuilder(ch);
    } catch (final IOException e) {
      final String message = "Unable to load class hierarchy from task.bin.";
      throw new RuntimeException(message, e);
    }

    // TODO: The file should be written by Avro (REEF-400)
    try (final InputStream chin = Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("Event.bin")) {
      // TODO: Use AvroClassHierarchySerializer instead (REEF-400)
      final ClassHierarchyProto.Node root = ClassHierarchyProto.Node.parseFrom(chin);
      final ClassHierarchy ch = new ProtocolBufferClassHierarchy(root);
      eventConfigurationBuilder = Tang.Factory.getTang().newConfigurationBuilder(ch);
    } catch (final Exception e) {
      final String message = "Unable to load class hierarchy from event.bin.";
      throw new RuntimeException(message, e);
    }

    taskConfigurationBuilder.addConfiguration(eventConfigurationBuilder.build());
  }

  /**
   * generate event.bin from .Net Tang test case TestSerilization.TestGenericClass.
   */
  @Test
  public void testDeserializationForEvent() {
    // TODO: The file should be written by Avro (REEF-400)
    try (final InputStream chin = Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("Event.bin")) {
      // TODO: Use AvroClassHierarchySerializer instead (REEF-400)
      final ClassHierarchyProto.Node root = ClassHierarchyProto.Node.parseFrom(chin);
      final ClassHierarchy ch = new ProtocolBufferClassHierarchy(root);
      final ConfigurationBuilder taskConfigurationBuilder = Tang.Factory.getTang()
          .newConfigurationBuilder(ch);
    } catch (final Exception e) {
      final String message = "Unable to load class hierarchy.";
      throw new RuntimeException(message, e);
    }
  }

  @Test
  // Test bindSetEntry(NamedParameterNode<Set<T>> iface, String impl) in ConfigurationBuilderImpl
  // with deserialized class hierarchy
  public void testBindSetEntryWithSetOfT() throws IOException {
    final ClassHierarchy ns1 = Tang.Factory.getTang().getDefaultClassHierarchy();
    ns1.getNode(SetOfClasses.class.getName());
    final ClassHierarchy ns2 = classHierarchySerializer.fromString(classHierarchySerializer.toString(ns1));
    final ConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder(ns2);

    final NamedParameterNode<Set<Number>> n2 =
        (NamedParameterNode<Set<Number>>) ns1.getNode(SetOfClasses.class.getName());
    final Node fn = ns1.getNode(Float.class.getName());
    cb.bindSetEntry(n2, fn);

    final Configuration c = configurationSerializer.fromString(configurationSerializer.toString(cb.build()), ns2);
  }

  @Test
  // Test public <T> void bindParameter(NamedParameterNode<T> name, String value) in ConfigurationBuilderImpl
  // with deserialized class hierarchy
  public void testBindSetEntryWithSetOfString() throws IOException {
    final ClassHierarchy ns1 = Tang.Factory.getTang().getDefaultClassHierarchy();
    ns1.getNode(SetOfStrings.class.getName());
    final ClassHierarchy ns2 = classHierarchySerializer.fromString(classHierarchySerializer.toString(ns1));
    final ConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder(ns2);
    cb.bindSetEntry(SetOfStrings.class.getName(), "four");
    cb.bindSetEntry(SetOfStrings.class.getName(), "five");

    final NamedParameterNode<Set<String>> n2 =
        (NamedParameterNode<Set<String>>) ns1.getNode(SetOfStrings.class.getName());
    cb.bindSetEntry(n2, "six");

    final Configuration c = configurationSerializer.fromString(configurationSerializer.toString(cb.build()), ns2);
  }
}


text:
import React from 'react';
import Helmet from 'react-helmet';

import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import { white } from 'material-ui/styles/colors';

const muiTheme = getMuiTheme({
  palette: {
    primary1Color: white
  }
}, { userAgent: false });

const App = ({ children }) => (
  <MuiThemeProvider muiTheme={muiTheme}>
    <div>
      <Helmet title='Home' titleTemplate='Musix - %s' />
      {children}
    </div>
  </MuiThemeProvider>
);

export default App;


text:
OrbitVM - Type System Manifesto
===============================

Orbit needs a type system. At the moment, it's a weird bastard between dynamic
and static typing. The compiler (or parser really, since that's the one part
that's pretty much done) allows type annotations on variables, and the compiler
will ultimately provide type inference, and enforce static typing.

On the VM side however, things are less strict for the time being. Each variable
and value is allocated using a GCValue tagged union, much like in dynamic
languages. I'm considering keeping it that way, for the sake of simplicity.

Even so, two things need to be defined before I make any more significant
progress on the compiler. Delaying those decisions more will only lead to
painful shoe-horning down the road.

 * The compile-time type system. What types exist, what can and can't be done,
   what does the compiler guess and what do users specify. That includes not
   only primitives, but also whether I want generics to be limited to language
   collections (`Array` and `Map`) or have a user-defined generics system
   (ouch).

 * The runtime type system. Especially if Orbit has a `Any` type like it has
   now, users must be able to query the type of an object at runtime. If the
   type system doesn't allow generics, that kind be pretty much just based on
   strings containing a normalised version of the type's name. If users can
   define generic types, it gets much more complex, and probably requires much
   of the compiler's type table system to be included in the VM too.

Type System, V1
---------------

There's a few things I'm certain I want in orbit's user-exposed type system:

 1. Static: I know some people like dynamic systems, but I've found they tend
    to lead to errors more than anything.

 2. Strong typing: While it can seem constraining at first, I very much love
    Swift's type system, and that'll probably be the model for strictness in
    orbit. That has some impact on the runtime type system too.

 3. At least some level of generic support. The bare minimum is supporting
    generic primitive collection types (`Array` and `Dict`). Ideally, I'd like
    to have at least some support for user-defined generic functions, but it
    means big changes for the way user-defined types are stored at runtime.

 4. Type-inferred: This is 100% on the compiler side. I feel like any language
    designed today should be able to infer as much as possible. One limitation:
    the user should *always* be able to bypass type inference through type
    annotations.

 5. Maybe optional support. Yes, it can add some checking code, but (1) that's
    code that should have been written to check for `nil` anyway, and (2) it makes
    possible nil-ness explicit, and leads to safer programs.

(3) is the big one here. Even generic collection types are sneakier than they
appear at first glance, since they can be passed as parameters, and thus
require some sort of generic function system. The other solutions are either
force users to write a function for each version of `Array<T>` they use (not
awesome), or convert any `Array<T>` parameter to `Array<Any>`, but that flies
in the face of the strong type system (2).

As far as primitives are concerned, so far the list includes the following.
`Number` will very probably be split in `Int` and `Float` at some point.

 * `Void`, nothing. Only allowed as return type, not exposed to the VM,
 * `(Params)->ReturnType`, Generic type for all functions,
 * `String`, UTF-8 backed unicode string,
 * `Number`, any number (stored as double),
 * `Any`, for variables that need to contain anything. Most likely only allowed
   as function or type parameter.
 * `Array<T>`, linear random-access collection type
 * `Map<K,V>`, hash table-backed dictionary type.


text:
from ingenico.connect.sdk.data_object import DataObject

class LodgingCharge(DataObject):
    """
    | Object that holds lodging related charges
    """

    __charge_amount = None
    __charge_amount_currency_code = None
    __charge_type = None

    @property
    def charge_amount(self):
        """
        | Amount of additional charges associated with the stay of the guest.
        | Note: The currencyCode is presumed to be identical to the order.amountOfMoney.currencyCode.

        Type: int
        """
        return self.__charge_amount

    @charge_amount.setter
    def charge_amount(self, value):
        self.__charge_amount = value

    @property
    def charge_amount_currency_code(self):
        """
        | Currency for Charge amount. The code should be in 3 letter ISO format.

        Type: str
        """
        return self.__charge_amount_currency_code

    @charge_amount_currency_code.setter
    def charge_amount_currency_code(self, value):
        self.__charge_amount_currency_code = value

    @property
    def charge_type(self):
        """
        | Type of additional charges associated with the stay of the guest.Allowed values:

        * lodging
        * telephone
        * restaurant
        * minibar
        * giftshop
        * laundry
        * transport
        * gratuity
        * conferenceRoom
        * audiovisual
        * banquet
        * internet
        * earlyDeparture
        * roomService
        * loungeBar
        * other

        Type: str
        """
        return self.__charge_type

    @charge_type.setter
    def charge_type(self, value):
        self.__charge_type = value

    def to_dictionary(self):
        dictionary = super(LodgingCharge, self).to_dictionary()
        if self.charge_amount is not None:
            dictionary['chargeAmount'] = self.charge_amount
        if self.charge_amount_currency_code is not None:
            dictionary['chargeAmountCurrencyCode'] = self.charge_amount_currency_code
        if self.charge_type is not None:
            dictionary['chargeType'] = self.charge_type
        return dictionary

    def from_dictionary(self, dictionary):
        super(LodgingCharge, self).from_dictionary(dictionary)
        if 'chargeAmount' in dictionary:
            self.charge_amount = dictionary['chargeAmount']
        if 'chargeAmountCurrencyCode' in dictionary:
            self.charge_amount_currency_code = dictionary['chargeAmountCurrencyCode']
        if 'chargeType' in dictionary:
            self.charge_type = dictionary['chargeType']
        return self


text:
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.6.4.13
description: >
    Iterators should be closed via their `return` method when iteration is
    interrupted via a `throw` statement.
features: [Symbol.iterator]
---*/

var startedCount = 0;
var returnCount = 0;
var iterationCount = 0;
var iterable = {};

iterable[Symbol.iterator] = function() {
  return {
    next: function() {
      startedCount += 1;
      return { done: false, value: null };
    },
    return: function() {
      returnCount += 1;
      return {};
    }
  };
};

try {
  for (var x of iterable) {
    assert.sameValue(
      startedCount, 1, 'Value is retrieved'
    );
    assert.sameValue(
      returnCount, 0, 'Iterator is not closed'
    );
    iterationCount += 1;
    throw 0;
  }
} catch (err) {}

assert.sameValue(
  startedCount, 1, 'Iterator does not restart following interruption'
);
assert.sameValue(iterationCount, 1, 'A single iteration occurs');
assert.sameValue(
  returnCount, 1, 'Iterator is closed after `throw` statement'
);


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.memcache.v1.model;

/**
 * Configure the schedule.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Memorystore for Memcached API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Schedule extends com.google.api.client.json.GenericJson {

  /**
   * Allows to define schedule that runs specified day of the week.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String day;

  /**
   * Output only. Duration of the time window, set by service producer.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String duration;

  /**
   * Time within the window to start the operations.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private TimeOfDay startTime;

  /**
   * Allows to define schedule that runs specified day of the week.
   * @return value or {@code null} for none
   */
  public java.lang.String getDay() {
    return day;
  }

  /**
   * Allows to define schedule that runs specified day of the week.
   * @param day day or {@code null} for none
   */
  public Schedule setDay(java.lang.String day) {
    this.day = day;
    return this;
  }

  /**
   * Output only. Duration of the time window, set by service producer.
   * @return value or {@code null} for none
   */
  public String getDuration() {
    return duration;
  }

  /**
   * Output only. Duration of the time window, set by service producer.
   * @param duration duration or {@code null} for none
   */
  public Schedule setDuration(String duration) {
    this.duration = duration;
    return this;
  }

  /**
   * Time within the window to start the operations.
   * @return value or {@code null} for none
   */
  public TimeOfDay getStartTime() {
    return startTime;
  }

  /**
   * Time within the window to start the operations.
   * @param startTime startTime or {@code null} for none
   */
  public Schedule setStartTime(TimeOfDay startTime) {
    this.startTime = startTime;
    return this;
  }

  @Override
  public Schedule set(String fieldName, Object value) {
    return (Schedule) super.set(fieldName, value);
  }

  @Override
  public Schedule clone() {
    return (Schedule) super.clone();
  }

}


text:
FactoryGirl.define do
  factory :refresh_token, class: 'Oa2c::RefreshToken' do
    user
    client
  end
end


text:
class dstat_plugin(dstat):
    def __init__(self):
        self.nick = ['read', 'write', 'dirty', 'cancel', 'missed']
        self.cols = len(self.nick)

    def check(self):
        if not os.path.exists('/proc/vz'):
            raise Exception, 'System does not have OpenVZ support'
        elif not os.path.exists('/proc/bc'):
            raise Exception, 'System does not have (new) OpenVZ beancounter support'
        elif not glob.glob('/proc/bc/*/ioacct'):
            raise Exception, 'System does not have any OpenVZ containers'
        info(1, 'Module %s is still experimental.' % self.filename)

    def name(self):
        return ['ve/'+name for name in self.vars]

    def vars(self):
        ret = []
        if not op.full:
            varlist = ['total',]
        else:
            varlist = [os.path.basename(veid) for veid in glob.glob('/proc/vz/*')]
        ret = varlist
        return ret

    def extract(self):
        global update
        for veid in self.vars:
            self.set2['total'] = {}
            for line in dopen('/proc/bc/%s/ioacct' % veid).readlines():
#            for line in dopen('ioacct.%d' % (update % 3)).readlines():
                l = line.split()
                if len(l) != 2: continue
                if l[0] not in self.nick: continue
                index = self.nick.index(l[0])
                self.set2[veid][index] = long(l[1])
                self.set2['total'][index] = self.set2['total'][index] + long(l[1])
#            print veid, self.val[veid], self.set2[veid][0], self.set2[veid][1]
#            print veid, self.val[veid], self.set1[veid][0], self.set1[veid][1]
            for i in range(len(self.nick)):
                self.val[veid][i] = (self.set2[veid][i] - self.set1[veid][i]) / elapsed
        if step == op.delay:
            self.set1.update(self.set2)

# vim:ts=4:sw=4:et


text:
package org.openbel.framework.common.record;

import static java.lang.String.format;
import static java.lang.System.arraycopy;

import org.openbel.framework.common.InvalidArgument;

/**
 * Models a record for some {@code <T>} contained by a {@link RecordFile}.
 *
 * @param <T> The modeled item
 * @author Nick Bargnesi
 */
public abstract class Record<T> {
    protected final Column<?>[] columns;
    protected final int recordSize;

    /**
     * Creates a record associated with fixed-size columns.
     *
     * @param columns {@link Column Columns} composing each record; may not be
     * null or have zero length
     * @throws InvalidArgument Thrown if {@code columns} is null or invalid
     */
    public Record(Column<?>... columns) {
        if (columns == null) {
            throw new InvalidArgument("columns", columns);
        } else if (columns.length == 0) {
            throw new InvalidArgument("invalid number of columns");
        }
        this.columns = columns;

        int size = 0;
        for (final Column<?> c : columns) {
            if (c.size == 0) {
                throw new InvalidArgument("column size may not be 0");
            }
            size += c.size;
        }
        recordSize = size;
    }

    /**
     * Creates a record associated with some number of columns with the last
     * columns having an unknown size.
     *
     * @param recordSize The record size used to derive the size of the last
     * column
     * @param columns {@link Column Columns} composing each record; may not be
     * zero or have zero length.
     * @throws InvalidArgument Thrown if {@code columns} is null, zero-length,
     * or invalid
     */
    public Record(final int recordSize, Column<?>... columns) {
        if (columns == null) {
            throw new InvalidArgument("columns", columns);
        } else if (columns.length == 0) {
            throw new InvalidArgument("invalid number of columns");
        }
        this.columns = columns;

        int size = 0, i = 0;
        for (; i < columns.length; i++) {
            Column<?> c = columns[i];
            final boolean lastColumn = (i == (columns.length - 1));
            if (lastColumn && c.size != 0) {
                // last column's size must be zero
                final String msg = "the last column size must be unknown";
                throw new InvalidArgument(msg);
            } else if (!lastColumn && c.size == 0) {
                // column size may not be zero here
                final String msg = "only the last column size may be unknown";
                throw new InvalidArgument(msg);
            }
            size += c.size;
        }

        columns[i - 1].setSize(recordSize - size);
        this.recordSize = recordSize;
    }

    /**
     * Returns the {@code column's} byte array data contained in {@code buffer}.
     *
     * @param buffer {@code byte[]}; must be non-null and of the same length as
     * {@link #getRecordSize()}
     * @param column Column to read
     * @return {@code byte[]}
     * @throws InvalidArgument Thrown if {@code buffer} is null or invalid
     */
    public final byte[] readColumn(byte[] buffer, int column) {
        if (buffer == null) {
            throw new InvalidArgument("buffer", buffer);
        } else if (buffer.length != recordSize) {
            final String fmt = "invalid buffer (%d bytes, expected %d)";
            final String msg = format(fmt, buffer.length, recordSize);
            throw new InvalidArgument(msg);
        }

        int i = 0, offset = 0;
        for (; i < column; i++) {
            offset += columns[i].size;
        }
        Column<?> c = columns[i];

        byte[] ret = new byte[c.size];
        arraycopy(buffer, offset, ret, 0, c.size);
        return ret;
    }

    /**
     * Copies the {@code column's} byte array data contained in
     * {@code recBuffer} into the {@code colBuffer}.
     *
     * @param recBuffer {@code byte[]}; must be non-null and of the same length
     * as {@link #getRecordSize()}
     * @param colBuffer {@code byte[]}; must be non-null and of the same length
     * as the {@code column} size
     * @param column Column to read
     * @throws InvalidArgument Thrown either buffer or column is null or invalid
     */
    public final void readColumn(byte[] recBuffer,
            byte[] colBuffer,
            int column) {
        if (recBuffer == null) {
            throw new InvalidArgument("recBuffer", recBuffer);
        } else if (colBuffer == null) {
            throw new InvalidArgument("colBuffer", colBuffer);
        } else if (recBuffer.length != recordSize) {
            final String fmt = "invalid record buffer (%d bytes, expected %d)";
            final String msg = format(fmt, recBuffer.length, recordSize);
            throw new InvalidArgument(msg);
        }

        int i = 0, offset = 0;
        for (; i < column; i++) {
            offset += columns[i].size;
        }
        Column<?> c = columns[i];

        if (colBuffer.length != c.size) {
            final String fmt = "invalid column buffer (%d bytes, expected %d)";
            final String msg = format(fmt, colBuffer.length, c.size);
            throw new InvalidArgument(msg);
        }

        arraycopy(recBuffer, offset, colBuffer, 0, c.size);
    }

    /**
     * Writes the column's buffer byte array data into the {@code column}
     * contained by the record buffer.
     *
     * @param colBuffer Column buffer data
     * @param column Column to write
     * @param recBuffer Record buffer
     * @throws InvalidArgument Thrown if either buffer or column is invalid, or
     * either buffer is null
     */
    public final void writeColumn(byte[] colBuffer,
            int column,
            byte[] recBuffer) {
        if (colBuffer == null) {
            throw new InvalidArgument("colBuffer may not be null");
        } else if (recBuffer == null) {
            throw new InvalidArgument("recBuffer may not be null");
        } else if (column < 0 || column >= columns.length) {
            final String fmt = "invalid column: %d";
            final String msg = format(fmt, column);
            throw new InvalidArgument(msg);
        } else if (recBuffer.length != recordSize) {
            final String fmt = "invalid record buffer (%d bytes, expected %d)";
            final String msg = format(fmt, recBuffer.length, recordSize);
            throw new InvalidArgument(msg);
        }

        int i = 0, offset = 0;
        for (; i < column; i++) {
            offset += columns[i].size;
        }
        Column<?> c = columns[i];

        if (colBuffer.length != c.size) {
            final String fmt = "invalid column buffer (%d bytes, expected %d)";
            final String msg = format(fmt, colBuffer.length, c.size);
            throw new InvalidArgument(msg);
        }

        arraycopy(colBuffer, 0, recBuffer, offset, colBuffer.length);
        return;
    }

    /**
     * Returns the record size (the summation of all column sizes).
     *
     * @return {@code int}
     */
    public final int getRecordSize() {
        return recordSize;
    }

    /**
     * Reads {@code <T>} from a byte buffer.
     *
     * @param buffer {@code byte[]}; of size {@link #getRecordSize()}
     * @return {@code <T>}
     * @throws InvalidArgument Thrown if {@code buffer} is null or invalid
     */
    public final T readBuffer(byte[] buffer) {
        if (buffer == null) {
            throw new InvalidArgument("buffer", buffer);
        } else if (buffer.length != recordSize) {
            final String fmt = "invalid buffer (%d bytes, expected %d)";
            final String msg = format(fmt, buffer.length, recordSize);
            throw new InvalidArgument(msg);
        }
        return read(buffer);
    }

    /**
     * Reads {@code <T>} to the provided {@code buffer}.
     *
     * @param buffer {@code byte[]}; of size {@link #getRecordSize()}
     * @param t {@code <T>}
     * @throws InvalidArgument Thrown if either argument is null or if
     * {@code buffer} is invalid
     */
    public final void readToEntry(byte[] buffer, T t) {
        if (buffer == null) {
            throw new InvalidArgument("buffer", buffer);
        } else if (t == null) {
            throw new InvalidArgument("cannot read a null entry");
        } else if (buffer.length != recordSize) {
            final String fmt = "invalid buffer (%d bytes, expected %d)";
            final String msg = format(fmt, buffer.length, recordSize);
            throw new InvalidArgument(msg);
        }
        readTo(buffer, t);
    }

    /**
     * Writes {@code <T>} to a byte buffer.
     *
     * @param t {@code <T>}
     * @return {@code byte[]}; of size {@link #getRecordSize()}
     * @throws InvalidArgument Thrown if {@code t} is null
     */
    public final byte[] writeEntry(T t) {
        if (t == null) {
            throw new InvalidArgument("cannot write a null");
        }
        return write(t);
    }

    /**
     * Writes {@code <T>} to the provided {@code buffer}.
     *
     * @param t {@code <T>}
     * @param buffer {@code byte[]}; of size {@link #getRecordSize()}
     * @throws InvalidArgument Thrown if either argument is null or if
     */
    public final void writeToBuffer(T t, byte[] buffer) {
        if (t == null) {
            throw new InvalidArgument("cannot write a null");
        } else if (buffer == null) {
            throw new InvalidArgument("cannot write to a null buffer");
        } else if (buffer.length != recordSize) {
            final String fmt = "invalid buffer (%d bytes, expected %d)";
            final String msg = format(fmt, buffer.length, recordSize);
            throw new InvalidArgument(msg);
        }
        writeTo(t, buffer);
    }

    /**
     * Returns an empty, uninitialized record.
     *
     * @return {@code byte[]}
     * @see java.util.Arrays#fill(byte[], byte)
     */
    public byte[] emptyRecord() {
        return new byte[recordSize];
    }

    /**
     * Internal {@link #readBuffer(byte[])} implementation deferred to
     * {@link Record record} subclasses.
     *
     * @param buffer {@code byte[]}; guaranteed to be non-null and of the
     * correct size (@link {@link #getRecordSize()})
     * @return {@code <T>}
     */
    protected abstract T read(byte[] buffer);

    /**
     * Internal {@link Record#readToEntry(byte[], Object)} implementation
     * deferred to {@link Record record} subclasses.
     *
     * @param buffer {@code byte[]}; guaranteed to be non-null and of the
     * correct size (@link {@link #getRecordSize()})
     * @param t {@code <T>}; guaranteed to be non-null
     */
    protected abstract void readTo(byte[] buffer, T t);

    /**
     * Internal {@link Record#write(Object)} implementation deferred to
     * {@link Record record} subclasses.
     *
     * @param t {@code <T>}; guaranteed to be non-null
     * @return {@code byte[]}
     */
    protected abstract byte[] write(T t);

    /**
     * Internal {@link Record#writeToBuffer(Object, byte[])} implementation
     * deferred to {@link Record record} subclasses.
     *
     * @param t {@code <T>}; guaranteed to be non-null
     * @param buffer {@code byte[]}; guaranteed to be non-null and of the
     * correct size (@link {@link #getRecordSize()})
     */
    protected abstract void writeTo(T t, byte[] buffer);

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<catalogue xml:lang="en">
  <message key1="hello-world">Hello World!</message>
  <something>blah</something>
</catalogue>


text:
<?php

class RestExtension {
    private $_ch = null;
    private $_config = array(
        'user' => '',
        'password' => '',
        'ssl' => false,
        'timeout' => 10,
        'headers' => array()
    );
    private $_response_info = null;
    private $_response_body = null;

    public function __construct($config = null) {
        if (!extension_loaded('curl')) {
            throw new CException('Rest requires PHP curl extension to be loaded', 500);
        }
        $this->setConfig($config);
    }

    public function setConfig($config) {
        if ($config !== null && is_array($config) == true) {
            foreach ($this->_config as $k => $v) {
                $this->_config[$k] = (array_key_exists($k, $config) === false) ? $v : $config[$k];
            }
        }
    }

    public function getConfig() {
        return $this->_config;
    }

    public function sendRequest($url, $method, $data = null) {
        /**
         * Set URL
         */
        $this->_initConfig();
        $method = strtoupper($method);
        /**
         * Set URL
         */
        switch ($method) {
            case 'GET':
                $this->_sendGetRequest($url, $data);
                break;
            case 'POST':
                $this->_sendPostRequest($url, $data);
                break;
            case 'PUT':
                $this->_sendPutRequest($url, $data);
                break;
            case 'DELETE':
                $this->_sendDeleteRequest($url);
                break;
            default:
                curl_close($this->_ch);
                throw new CException("Current methos ($method) is an invalid REST method.");
        }
    }

    public function getRequestMethod() {
        $result = null;
        if (isset($_SERVER['REQUEST_METHOD'])) {
            $methods = array('GET', 'POST', 'PUT', 'DELETE');
            $method = strtoupper($_SERVER['REQUEST_METHOD']);
            if (in_array($method, $methods)) {
                $result = $method;
            }
        }
        return $result;
    }

    public function getRequestPutData() {
        $result = array();
        $putdata = file_get_contents('php://input');
        $putdata = explode('&', $putdata);
        foreach ($putdata as $pair) {
            $item = explode('=', $pair);
            if (count($item) == 2) {
                $result[urldecode($item[0])] = urldecode($item[1]);
            }
        }
        return $result;
    }

    public function getResponseInfo() {
        return $this->_response_info;
    }

    public function getResponseBody() {
        return $this->_response_body;
    }

    public function checkAuth() {
        $user = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : '';
        $password = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
        $result = ($user == $this->_config['user'] && $password == $this->_config['password']) ? true : false;
        return $result;
    }

    private function _initConfig() {
        $this->_ch = curl_init();
        curl_setopt($this->_ch, CURLOPT_TIMEOUT, $this->_config['timeout']);
        curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, true);
        if ($this->_config['user'] != '' || $this->_config['password'] != '') {
            curl_setopt($this->_ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
            curl_setopt($this->_ch, CURLOPT_USERPWD, $this->_config['user'].':'.$this->_config['password']);
        }
        if ($this->_config['ssl'] === true) {
            curl_setopt($this->_ch, CURLOPT_VERBOSE, 0);
            curl_setopt($this->_ch, CURLOPT_SSL_VERIFYPEER, FALSE);
            curl_setopt($this->_ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        }
        if ($this->_config['headers'] != null) {
            curl_setopt($this->_ch, CURLOPT_HTTPHEADER, (array) $this->_config['headers']);
        }
    }

    private function _sendGetRequest($url, $data) {
        $data = $this->_buildPostData($data);
        if (null != $data) {
            $data = (strpos('?', $url) !== false) ? '?'.$data : '&'.$data;
            $url .= $data;
        }
        curl_setopt($this->_ch, CURLOPT_URL, $url);
        $this->_executeRequest();
    }

    private function _sendPostRequest($url, $data) {
        $data = $this->_buildPostData($data);
        if (null != $data) {
            curl_setopt($this->_ch, CURLOPT_POSTFIELDS, $data);
            curl_setopt($this->_ch, CURLOPT_POST, 1);
        }
        curl_setopt($this->_ch, CURLOPT_URL, $url);
        $this->_executeRequest();
    }

    private function _sendPutRequest($url, $data) {
        curl_setopt($this->_ch, CURLOPT_CUSTOMREQUEST, "PUT");
        $this->_sendPostRequest($url, $data);
    }

    private function _sendDeleteRequest($url) {
        curl_setopt($this->_ch, CURLOPT_URL, $url);
        curl_setopt($this->_ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
        $this->_executeRequest();
    }

    private function _buildPostData($data) {
        $data = (is_array($data) && $data != null) ? http_build_query($data, '', '&') : null;
        return $data;
    }

    private function _executeRequest() {
        $this->_response_body = curl_exec($this->_ch);
        $this->_response_info = curl_getinfo($this->_ch);
        curl_close($this->_ch);
    }
}


text:
jQuery(document).ready(function ($) {

	var actionContent = $('#action-content'),
	h1 = $('h1');

	var prev = {
		link:  ppi.baseUrl + 'docs/' + actionContent.data('prevlink'),
		title: actionContent.data('prevpage')
	};

	var next = {
		link:  ppi.baseUrl + 'docs/' + actionContent.data('nextlink'),
		title: actionContent.data('nextpage')
	};

	h1.find('a').remove();

	var newhtml = '
';
	if(actionContent.data('prevlink') !== undefined && actionContent.data('prevpage') != "The Book") {
		prev.link = prev.link.replace('.php', '');
		newhtml +=
		'' +
				'  ' + prev.title +
		'';
	}

	newhtml += '
' + h1.html() + '
';
	console.log(actionContent.data('nextlink'));
	if(actionContent.data('nextlink') !== undefined) {
		next.link = next.link.replace('.php', '');
		newhtml +=
		'' +
			  '' + next.title + '  ' +
		'';
	}

	newhtml += '
';

	$(newhtml).insertAfter(h1);

	h1.hide();

});


text:
import os
import site # for fedora: get site-packages into sys.path so it finds nose
import sys

# run nosetests
# this assumes that the builder is called as
# "blender --background --factory-startup --python blender-nosetests.py -- ..."
# pass the correct arguments by dropping the arguments prior to --
import nose
sys.argv = ['blender-nosetests'] + sys.argv[6:]
nose.run_exit()