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

<title>ElementScanner7 (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<meta name="keywords" content="javax.lang.model.util.ElementScanner7 class">
<meta name="keywords" content="visitVariable()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

javax.lang.model.util

Class ElementScanner7<R,P>

java.lang.Object

javax.lang.model.util.AbstractElementVisitor6<R,P>

javax.lang.model.util.ElementScanner6<R,P>

javax.lang.model.util.ElementScanner7<R,P>

Type Parameters:

R - the return type of this visitor's methods.  Use Void for visitors that do not need to return results.

P - the type of the additional parameter to this visitor's
            methods.  Use Void for visitors that do not need an
            additional parameter.

All Implemented Interfaces:

ElementVisitor<R,P>

@SupportedSourceVersion(value=RELEASE_7)
public class ElementScanner7<R,P>
extends ElementScanner6<R,P>

A scanning visitor of program elements with default behavior
 appropriate for the RELEASE_7
 source version.  The <tt>visitXYZ</tt> methods in this
 class scan their component elements by calling scan on
 their enclosed elements,
 parameters, etc., as
 indicated in the individual method specifications.  A subclass can
 control the order elements are visited by overriding the
 <tt>visitXYZ</tt> methods.  Note that clients of a scanner
 may get the desired behavior be invoking v.scan(e, p) rather
 than v.visit(e, p) on the root objects of interest.

When a subclass overrides a <tt>visitXYZ</tt> method, the
 new method can cause the enclosed elements to be scanned in the
 default way by calling <tt>super.visitXYZ</tt>.  In this
 fashion, the concrete visitor can control the ordering of traversal
 over the component elements with respect to the additional
 processing; for example, consistently calling
 <tt>super.visitXYZ</tt> at the start of the overridden
 methods will yield a preorder traversal, etc.  If the component
 elements should be traversed in some other order, instead of
 calling <tt>super.visitXYZ</tt>, an overriding visit method
 should call scan with the elements in the desired order.

 Methods in this class may be overridden subject to their
 general contract.  Note that annotating methods in concrete
 subclasses with @Override will help
 ensure that methods are overridden as intended.

 WARNING: The ElementVisitor interface
 implemented by this class may have methods added to it in the
 future to accommodate new, currently unknown, language structures
 added to future versions of the Java™ programming language.
 Therefore, methods whose names begin with "visit" may be
 added to this class in the future; to avoid incompatibilities,
 classes which extend this class should not declare any instance
 methods with names beginning with "visit".

When such a new visit method is added, the default
 implementation in this class will be to call the visitUnknown method.  A new element scanner visitor
 class will also be introduced to correspond to the new language
 level; this visitor will have different default behavior for the
 visit method in question.  When the new visitor is introduced, all
 or portions of this visitor may be deprecated.

Since:

1.7

See Also:

ElementScanner6

Field Summary

Fields inherited from class javax.lang.model.util.ElementScanner6

DEFAULT_VALUE

Constructor Summary

Constructors

Modifier
Constructor and Description

protected
ElementScanner7()

Constructor for concrete subclasses; uses null for the
 default value.

protected
ElementScanner7(R defaultValue)

Constructor for concrete subclasses; uses the argument for the
 default value.

Method Summary

Methods

Modifier and Type
Method and Description

R
visitVariable(VariableElement e,
             P p)

This implementation scans the enclosed elements.

Methods inherited from class javax.lang.model.util.ElementScanner6

scan, scan, scan, visitExecutable, visitPackage, visitType, visitTypeParameter

Methods inherited from class javax.lang.model.util.AbstractElementVisitor6

visit, visit, visitUnknown

Methods inherited from class java.lang.Object

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

Constructor Detail

ElementScanner7

protected ElementScanner7()

Constructor for concrete subclasses; uses null for the
 default value.

ElementScanner7

protected ElementScanner7(R defaultValue)

Constructor for concrete subclasses; uses the argument for the
 default value.

Method Detail

visitVariable

public R visitVariable(VariableElement e,
              P p)

This implementation scans the enclosed elements.

Specified by:

visitVariable in interface ElementVisitor<R,P>

Overrides:

visitVariable in class ElementScanner6<R,P>

Parameters:

e - the element to visit

p - a visitor-specified parameter

Returns:

the result of scanning

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Hyménomyc. de France (Sceaux) 194 (1928)

#### Original name
Corticium filium subsp. molliforme Bourdot & Galzin

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
jQuery(document).ready(function() {
    var $ = jQuery;

    $('.accordion-settings').parents('td').siblings('th').remove();
    $(".accordion-settings").accordion({ header: "h3" });

});


text:
:: uncomment for localhost
::sqlplus -S / as sysdba @ create-oracle.sql
::sqlplus -S jdbc_test/p4ssw0rd @ create.sql

:: uncomment for remote host
sqlplus -S sys/${jdbc_test.oracle.password}@${jdbc_test.oracle.host}:${jdbc_test.oracle.port}/${jdbc_test.oracle.service_name} as sysdba @create-oracle.sql
sqlplus -S jdbc_test/p4ssw0rd@${jdbc_test.oracle.host}:${jdbc_test.oracle.port}/${jdbc_test.oracle.service_name} @create.sql


text:
Ext.define('RedmineApp.store.IssueStatuses', {
    extend: 'Ext.data.Store',
    requires: ['RedmineApp.proxy.DynamicRest'],
    config: {
        model: 'RedmineApp.model.IssueStatus',
        proxy: {
            type: 'dynamicrest',
            resourcePath: '/issue_statuses',
            format: 'json',
            reader: {
                rootProperty: 'issue_statuses',
                type: 'json'
            }
        },
        autoLoad: true
    }
}
);


text:
class AddExpectedUnitsToAmrDataFeedConfigs < ActiveRecord::Migration[6.0]
  def change
    add_column :amr_data_feed_configs, :expected_units, :string
  end
end


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class SectionTeachers extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('section_teachers', function(Blueprint $table) {
			$table->string('teacher_id');
			$table->string('course_section_id');
			$table->string('time_period_id');
			$table->timestamps();

			$table->foreign('teacher_id')
				->references('id')
				->on('teachers')
				->onDelete('CASCADE')
				->onUpdate('CASCADE');
			$table->foreign('course_section_id')
				->references('id')
				->on('course_sections')
				->onDelete('CASCADE')
				->onUpdate('CASCADE');
			$table->foreign('time_period_id')
				->references('id')
				->on('time_periods')
				->onDelete('NO ACTION')
				->onUpdate('CASCADE');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('section_teachers');
	}

}


text:
package com.yhy.widget.layout.status.view;

import android.content.Context;
import androidx.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

import com.yhy.widget.R;

/**
 * author : 颜洪毅
 * e-mail : yhyzgn@gmail.com
 * time   : 2017-10-13 16:28
 * version: 1.0.0
 * desc   : 默认[错误]界面
 */
public class StaErrorView extends LinearLayout {
    public StaErrorView(Context context) {
        this(context, null);
    }

    public StaErrorView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public StaErrorView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        LayoutInflater.from(getContext()).inflate(R.layout.widget_status_error, this);
    }
}


text:
package consumer

// MonitorConsumer is a consumer of decoded monitor events
type MonitorConsumer interface {
	// NotifyAgentEvent informs the consumer about a new monitor event
	// sent from cilium-agent. The concrete type of the message parameter
	// depends on the value of typ:
	//  - MessageTypeAccessLog:		accesslog.LogRecord
	//  - MessageTypeAgent:			api.AgentNotify
	NotifyAgentEvent(typ int, message interface{})

	// NotifyPerfEvent informs the consumer about an datapath event obtained
	// via perf events ring buffer.
	// Data contains the raw binary encoded perf payload. The underlying type
	// depends on the value of typ:
	// 	- MessageTypeDrop:			monitor.DropNotify
	// 	- MessageTypeDebug:			monitor.DebugMsg
	// 	- MessageTypeCapture:		monitor.DebugCapture
	// 	- MessageTypeTrace:			monitor.TraceNotify
	// 	- MessageTypePolicyVerdict:	monitor.PolicyVerdictNotify
	NotifyPerfEvent(data []byte, cpu int)

	// NotifyPerfEventLost informs the consumer that a number of events have
	// been lost due to the perf event ring buffer not being read.
	NotifyPerfEventLost(numLostEvents uint64, cpu int)
}


text:
package pbWriter

import (
	"errors"
	"fmt"
	"log"
	"sync"

	"github.com/dh1tw/gosamplerate"
	"github.com/dh1tw/remoteAudio/audio"
	"github.com/dh1tw/remoteAudio/audiocodec/opus"
	"github.com/dh1tw/remoteAudio/utils"
	"github.com/golang/protobuf/proto"

	sbAudio "github.com/dh1tw/remoteAudio/sb_audio"
)

// PbWriter implements the audio.Sink interface. It is used to encode
// audio.Msg with a selected audiocodec into Protocol buffers. This
// Sink is typically used when audio frames have to be send to the network.
type PbWriter struct {
	sync.RWMutex
	options Options
	enabled bool
	buffer  []byte
	stash   []float32
	src     src
	volume  float32
}

// src contains a samplerate converter and its needed variables
type src struct {
	gosamplerate.Src
	samplerate float64
	ratio      float64
}

// NewPbWriter is the constructor for a ProtoBufWriter. The ToWireCb callback will
// be executed when an audio.Msg has been encoded into a protobuf byte slice and
// ready to be send to the network. Additional functional options can be passed
// in (e.g. the audio codec to be used).
func NewPbWriter(opts ...Option) (*PbWriter, error) {

	pbw := &PbWriter{
		options: Options{
			DeviceName:      "ProtoBufWriter",
			Channels:        1,
			FramesPerBuffer: 960,
			UserID:          fmt.Sprintf("user-%s", utils.RandStringRunes(5)),
		},
		buffer: make([]byte, 10000),
		volume: 0.7,
	}

	for _, option := range opts {
		option(&pbw.options)
	}

	// if no encoder set, create the default encoder
	if pbw.options.Encoder == nil {
		encChannels := opus.Channels(pbw.options.Channels)
		encSR := opus.Samplerate(48000)
		enc, err := opus.NewEncoder(encChannels, encSR)
		if err != nil {
			return nil, err
		}
		pbw.options.Encoder = enc
	}

	// setup a samplerate converter
	srConv, err := gosamplerate.New(gosamplerate.SRC_SINC_FASTEST,
		pbw.options.Channels, 65536)
	if err != nil {
		return nil, fmt.Errorf("PbWriter samplerate converter: %v", err)
	}
	pbw.src = src{
		Src:        srConv,
		samplerate: 48000,
		ratio:      1,
	}

	return pbw, nil
}

// Start starts this audio sink.
func (pbw *PbWriter) Start() error {
	pbw.Lock()
	defer pbw.Unlock()
	pbw.enabled = true
	return nil
}

// Stop disables this audio sink.
func (pbw *PbWriter) Stop() error {
	pbw.Lock()
	defer pbw.Unlock()
	pbw.enabled = false
	return nil
}

// Close is not implemented
func (pbw *PbWriter) Close() error {
	return nil
}

// SetVolume sets the volume for this sink
func (pbw *PbWriter) SetVolume(v float32) {
	pbw.Lock()
	defer pbw.Unlock()
	if v < 0 {
		pbw.volume = 0
	} else if v > 1 {
		pbw.volume = 1
	} else {
		pbw.volume = v
	}
}

// Volume returns the volume for this sink
func (pbw *PbWriter) Volume() float32 {
	pbw.RLock()
	defer pbw.RUnlock()
	return pbw.volume
}

// Write is called to encode audio.Msg with a specified audio codec into
// protobufs. The Token is not used. On success the protobuf ([]byte) will
// be returned in a callback.
func (pbw *PbWriter) Write(audioMsg audio.Msg) error {

	pbw.Lock()
	defer pbw.Unlock()

	if !pbw.enabled {
		return nil
	}

	if pbw.options.ToWireCb == nil {
		return nil
	}

	if pbw.options.Encoder == nil {
		return errors.New("no encoder set")
	}

	// The resampling and encoding can be quite expensive (e.g. with opus). Therefore it is
	// launched in a separate go routine.
	go func() {

		pbw.Lock()
		defer pbw.Unlock()

		var aData []float32
		var err error

		// if necessary adjust the amount of audio channels
		if audioMsg.Channels != pbw.options.Channels {
			aData = audio.AdjustChannels(audioMsg.Channels,
				pbw.options.Channels, audioMsg.Data)
		} else {
			aData = audioMsg.Data
		}

		if audioMsg.Samplerate != 48000 {
			if pbw.src.samplerate != audioMsg.Samplerate {
				pbw.src.Reset()
				pbw.src.samplerate = audioMsg.Samplerate
				pbw.src.ratio = 48000 / audioMsg.Samplerate
			}
			aData, err = pbw.src.Process(aData, pbw.src.ratio, false)
			if err != nil {
				log.Println(err)
				return
			}
		}

		// audio buffer size we want to push into the opus encuder
		// opus only allows certain buffer sizes (2,5ms, 5ms, 10ms...etc)
		expBufferSize := pbw.options.Channels * pbw.options.FramesPerBuffer

		// if there is data stashed from previous calles, get it and prepend it
		// to the data received
		if len(pbw.stash) > 0 {
			aData = append(pbw.stash, aData...)
			pbw.stash = pbw.stash[:0] // empty
		}

		// if audioMsg.EOF {
		// 	// get the stuff from the stash
		// 	fmt.Println("EOF!!!")
		// 	fmt.Println("stash size:", len(pbw.stash))
		// }

		// if the audio buffer size is actually smaller than the one we need,
		// then stash it for the next time and return
		if len(aData) < expBufferSize {
			pbw.stash = aData
			return
		}

		// slice of audio buffers which will be send
		var bData [][]float32

		// if the aData contains multiples of the expected buffer size,
		// then we chop it into (several) buffers
		if len(aData) >= expBufferSize {
			vol := pbw.volume

			for len(aData) >= expBufferSize {
				if vol != 1 {
					// if necessary, adjust the volume
					audio.AdjustVolume(vol, aData[:expBufferSize])
				}
				bData = append(bData, aData[:expBufferSize])
				aData = aData[expBufferSize:]
			}
		}

		// stash the left over
		if len(aData) > 0 {
			pbw.stash = aData
		}

		channels := sbAudio.Channels_unknown
		switch pbw.options.Channels {
		case 1:
			channels = sbAudio.Channels_mono
		case 2:
			channels = sbAudio.Channels_stereo
		}

		for _, frame := range bData {
			num, err := pbw.options.Encoder.Encode(frame, pbw.buffer)
			if err != nil {
				log.Println(err)
			}

			msg := sbAudio.Frame{
				Data:         pbw.buffer[:num],
				Channels:     channels,
				BitDepth:     16,
				Codec:        sbAudio.Codec_opus,
				FrameLength:  int32(pbw.options.FramesPerBuffer),
				SamplingRate: 48000,
				UserId:       pbw.options.UserID,
			}

			data, err := proto.Marshal(&msg)
			if err != nil {
				log.Println(err)
				return
			}
			pbw.options.ToWireCb(data)
		}

	}()

	return nil
}

// Flush clears all internal buffers
func (pbw *PbWriter) Flush() {
	pbw.Lock()
	defer pbw.Unlock()

	pbw.stash = []float32{}
}

// SetToWireCb allows to set a callback which will be called whenever
// the data has been serialized and is ready to be send on the wire.
func (pbw *PbWriter) SetToWireCb(cb func([]byte)) {
	pbw.Lock()
	defer pbw.Unlock()

	pbw.options.ToWireCb = cb
}


text:
namespace Baikal
{
    SceneIo* SceneIo::GetInstance()
    {
        static SceneIo instance;
        return &instance;
    }

    void SceneIo::RegisterLoader(const std::string& ext, SceneIo::Loader *loader)
    {
        GetInstance()->m_loaders[ext] = loader;
    }

    void SceneIo::UnregisterLoader(const std::string& ext)
    {
        GetInstance()->m_loaders.erase(ext);
    }

    Scene1::Ptr SceneIo::LoadScene(std::string const& filename, std::string const& basepath)
    {
        auto ext = filename.substr(filename.rfind(".") + 1);

        SceneIo *instance = GetInstance();
        auto loader_it = instance->m_loaders.find(ext);
        if (loader_it == instance->m_loaders.end())
        {
            throw std::runtime_error("No loader for \"" + filename + "\" has been found.");
        }

        return loader_it->second->LoadScene(filename, basepath);
    }

    void SceneIo::SaveScene(Scene1 const& scene, std::string const& filename, std::string const& basepath)
    {
        auto ext = filename.substr(filename.rfind("."));

        SceneIo *instance = GetInstance();
        auto loader_it = instance->m_loaders.find(ext);
        if (loader_it == instance->m_loaders.end())
        {
            throw std::runtime_error("No serializer for \"" + filename + "\" has been found.");
        }

        return loader_it->second->SaveScene(scene, filename, basepath);
    }

    Texture::Ptr SceneIo::Loader::LoadTexture(ImageIo const& io, Scene1& scene, std::string const& basepath, std::string const& name) const
    {
        std::string fname = basepath + name;
        std::replace(fname.begin(), fname.end(), '\\', '/');

        auto iter = m_texture_cache.find(name);

        if (iter != m_texture_cache.cend())
        {
            return iter->second;
        }
        else
        {
            try
            {
                LogInfo("Loading ", name, "\n");
                auto texture = io.LoadImage(fname);
                texture->SetName(name);
                m_texture_cache[name] = texture;
                return texture;
            }
            catch (std::runtime_error &)
            {
                LogInfo("Missing texture: ", name, "\n");
                return nullptr;
            }
        }
    }

    SceneIo::Loader::Loader(const std::string& ext, SceneIo::Loader *loader) :
        m_ext(ext)

    {
        SceneIo::RegisterLoader(m_ext, loader);
    }

    SceneIo::Loader::~Loader()
    {
        SceneIo::UnregisterLoader(m_ext);
    }

}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

<class name="DAO.Recruteur" table="RECRUTEURS" >

	<id name="idUtilisateur" column="ID_UTILISATEUR"  >
		<generator class="native"></generator>
	</id>

	<property name="nom"></property>
	<property name="prenom"></property>
	<property name="email"></property>
	<property name="passWord"></property>
	<property name="tel"></property>
	<property name="nomEntreprise"></property>
	<property name="adresseEntreprise"></property>
	<property name="siteWebEntreprise"></property>
	<property name="villeEntreprise"></property>
	<property name="paysEntreprise"></property>
	<property name="codePostal"></property>
	<property name="descriptionEntreprise"></property>

	<set name="offres" table="RECRUTEUR_OFFRE" lazy="false"  >
        <key column="ID_UTILISATEUR"/>
        <many-to-many column="ID_OFFRE" class="DAO.Offre"/>
    </set>

    <set name="motsCles" table="RECRUTEUR_MOTS_CLES" lazy="false" >
            <key column="ID_UTILISATEUR"/>
            <element type="string" column="MOTS_CLES"/>
        </set>

</class>

</hibernate-mapping>


text:
<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

/** UserController */
Route::post('users/store', 'UserController@store')->name('users.store');
Route::get('users', 'UserController@index')->name('users.index');


text:
<?php

namespace DigitalOcean\Tests\Domains;

use DigitalOcean\Tests\TestCase;
use DigitalOcean\Domains\Domains;
use DigitalOcean\Domains\DomainsActions;
use DigitalOcean\Domains\RecordsActions;

/**
 * @author Antoine Corcy <contact@sbin.dk>
 */
class DomainsTest extends TestCase
{
    protected $domainId;
    protected $domainName;
    protected $recordId;
    protected $domains;
    protected $domainsBuildQueryMethod;

    protected function setUp()
    {
        $this->domainId   = 123;
        $this->domainName = 'foo.org';
        $this->recordId   = 456;

        $this->domains = new Domains($this->getMockCredentials(), $this->getMockAdapter($this->never()));
        $this->domainsBuildQueryMethod = new \ReflectionMethod(
            $this->domains, 'buildQuery'
        );
        $this->domainsBuildQueryMethod->setAccessible(true);

        $this->recordsBuildQueryMethod = new \ReflectionMethod(
            $this->domains, 'buildRecordsQuery'
        );
        $this->recordsBuildQueryMethod->setAccessible(true);
    }

    /**
     * @expectedException \RuntimeException
     * @expectedExceptionMEssage Impossible to process this query: https://api.digitalocean.com/domains/?client_id=foo&api_key=bar
     */
    public function testProcessQuery()
    {
        $sshKeys = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns(null));
        $sshKeys->getAll();
    }

    public function testGetAllUrl()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/?client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains)
        );
    }

    public function testGetAllReturnsNoDomains()
    {
        $response = <<<JSON
{"status":"OK","domains":[]}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $domains = $domains->getAll();

        $this->assertTrue(is_object($domains));
        $this->assertEquals('OK', $domains->status);
        $this->assertEmpty($domains->domains);
    }

    public function testGetAll()
    {
        $response = <<<'JSON'
{
  "status": "OK",
  "domains": [
    {
      "id": 100,
      "name": "example.com",
      "ttl": 1800,
      "live_zone_file": "$TTL\\t600\\n@\\t\\tIN\\tSOA\\tNS1.DIGITALOCEAN.COM.\\thostmaster.example.com. (\\n\\t\\t\\t1369261882 ; last update: 2013-05-22 22:31:22 UTC\\n\\t\\t\\t3600 ; refresh\\n\\t\\t\\t900 ; retry\\n\\t\\t\\t1209600 ; expire\\n\\t\\t\\t10800 ; 3 hours ttl\\n\\t\\t\\t)\\n             IN      NS      NS1.DIGITALOCEAN.COM.\\n @\\tIN A\\t8.8.8.8\\n",
      "error": null,
      "zone_file_with_error": null
    }
  ]
}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $domains = $domains->getAll();

        $this->assertTrue(is_object($domains));
        $this->assertEquals('OK', $domains->status);
        $this->assertTrue(is_array($domains->domains));

        $domains = $domains->domains[0];
        $this->assertTrue(is_object($domains));
        $this->assertSame(100, $domains->id);
        $this->assertSame('example.com', $domains->name);
        $this->assertSame(1800, $domains->ttl);
        $this->assertSame('$TTL\\t600\\n@\\t\\tIN\\tSOA\\tNS1.DIGITALOCEAN.COM.\\thostmaster.example.com. (\\n\\t\\t\\t1369261882 ; last update: 2013-05-22 22:31:22 UTC\\n\\t\\t\\t3600 ; refresh\\n\\t\\t\\t900 ; retry\\n\\t\\t\\t1209600 ; expire\\n\\t\\t\\t10800 ; 3 hours ttl\\n\\t\\t\\t)\\n             IN      NS      NS1.DIGITALOCEAN.COM.\\n @\\tIN A\\t8.8.8.8\\n', $domains->live_zone_file);
        $this->assertNull($domains->error);
        $this->assertNull($domains->zone_file_with_error);
    }

    public function testShowUrlWithDomainId()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/123/?client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains, $this->domainId)
        );
    }

    public function testShowUrlWithDomainName()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/foo.org/?client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains, $this->domainName)
        );
    }

    public function testShow()
    {
        $response = <<<'JSON'
{
  "status": "OK",
  "domain": {
    "id": 100,
    "name": "example.com",
    "ttl": 1800,
    "live_zone_file": "$TTL\\t600\\n@\\t\\tIN\\tSOA\\tNS1.DIGITALOCEAN.COM.\\thostmaster.example.com. (\\n\\t\\t\\t1369261882 ; last update: 2013-05-22 22:31:22 UTC\\n\\t\\t\\t3600 ; refresh\\n\\t\\t\\t900 ; retry\\n\\t\\t\\t1209600 ; expire\\n\\t\\t\\t10800 ; 3 hours ttl\\n\\t\\t\\t)\\n             IN      NS      NS1.DIGITALOCEAN.COM.\\n @\\tIN A\\t8.8.8.8\\n",
    "error": null,
    "zone_file_with_error": null
  }
}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $domain  = $domains->show($this->domainId);

        $this->assertTrue(is_object($domain));
        $this->assertEquals('OK', $domain->status);

        $domain = $domain->domain;
        $this->assertTrue(is_object($domain));
        $this->assertSame(100, $domain->id);
        $this->assertSame('example.com', $domain->name);
        $this->assertSame(1800, $domain->ttl);
        $this->assertSame('$TTL\\t600\\n@\\t\\tIN\\tSOA\\tNS1.DIGITALOCEAN.COM.\\thostmaster.example.com. (\\n\\t\\t\\t1369261882 ; last update: 2013-05-22 22:31:22 UTC\\n\\t\\t\\t3600 ; refresh\\n\\t\\t\\t900 ; retry\\n\\t\\t\\t1209600 ; expire\\n\\t\\t\\t10800 ; 3 hours ttl\\n\\t\\t\\t)\\n             IN      NS      NS1.DIGITALOCEAN.COM.\\n @\\tIN A\\t8.8.8.8\\n', $domain->live_zone_file);
        $this->assertNull($domain->error);
        $this->assertNull($domain->zone_file_with_error);
    }

    public function testAddUrl()
    {
        $newDomain = array(
            'name'       => 'bar.org',
            'ip_address' => '127.0.0.1',
        );

        $this->assertEquals(
            'https://api.digitalocean.com/domains/new/?name=bar.org&ip_address=127.0.0.1&client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains, null, DomainsActions::ACTION_ADD, $newDomain)
        );
    }

    public function testAdd()
    {
        $response = <<<JSON
{
  "status": "OK",
  "domain": {
    "id": 101,
    "name": "newdomain.com"
  }
}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $domains = $domains->add(array('name' => 'newdomain.com', 'ip_address' => '127.0.0.1'));

        $this->assertTrue(is_object($domains));
        $this->assertEquals('OK', $domains->status);

        $this->assertTrue(is_object($domains->domain));
        $this->assertSame(101, $domains->domain->id);
        $this->assertSame('newdomain.com', $domains->domain->name);
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the name of the domain.
     */
    public function testAddThrowsNameInvalidArgumentException()
    {
        $this->domains->add(array());
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the IP address for the domain's initial A record.
     */
    public function testAddThrowsIpAddressInvalidArgumentException()
    {
        $this->domains->add(array('name' => 'bar.org'));
    }

    public function testDestroyUrlWithDomainId()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/123/destroy/?client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains, $this->domainId, DomainsActions::ACTION_DESTROY)
        );
    }

    public function testDestroyUrlWithDomainName()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/foo.org/destroy/?client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains, $this->domainName, DomainsActions::ACTION_DESTROY)
        );
    }

    public function testDestroy()
    {
        $response = <<<JSON
{"status":"OK"}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $destroy = $domains->destroy($this->domainId);

        $this->assertTrue(is_object($destroy));
        $this->assertEquals('OK', $destroy->status);
    }

    public function testGetRecordsUrlWithDomaineId()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/123/records/?client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains, $this->domainId, DomainsActions::ACTION_RECORDS)
        );
    }

    public function testGetRecordsUrlWithDomaineName()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/foo.org/records/?client_id=foo&api_key=bar',
            $this->domainsBuildQueryMethod->invoke($this->domains, $this->domainName, DomainsActions::ACTION_RECORDS)
        );
    }

    public function testGetRecords()
    {
        $response = <<<JSON
{
  "status": "OK",
  "records": [
    {
      "id": 49,
      "domain_id": "100",
      "record_type": "A",
      "name": "example.com",
      "data": "8.8.8.8",
      "priority": null,
      "port": null,
      "weight": null
    },
    {
      "id": 50,
      "domain_id": "100",
      "record_type": "CNAME",
      "name": "www",
      "data": "@",
      "priority": null,
      "port": null,
      "weight": null
    }
  ]
}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $records = $domains->getRecords($this->domainId);

        $this->assertTrue(is_object($records));
        $this->assertEquals('OK', $records->status);

        $this->assertTrue(is_array($records->records));

        $record1 = $records->records[0];
        $this->assertTrue(is_object($record1));
        $this->assertSame(49, $record1->id);
        $this->assertSame('100', $record1->domain_id);
        $this->assertSame('A', $record1->record_type);
        $this->assertSame('example.com', $record1->name);
        $this->assertSame('8.8.8.8', $record1->data);
        $this->assertNull($record1->priority);
        $this->assertNull($record1->port);
        $this->assertNull($record1->weight);

        $record2 = $records->records[1];
        $this->assertSame(50, $record2->id);
        $this->assertSame('100', $record2->domain_id);
        $this->assertSame('CNAME', $record2->record_type);
        $this->assertSame('www', $record2->name);
        $this->assertSame('@', $record2->data);
        $this->assertNull($record2->priority);
        $this->assertNull($record2->port);
        $this->assertNull($record2->weight);
    }

    public function testNewRecordUrlWithDomaineId()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/123/records/new/?client_id=foo&api_key=bar',
            $this->recordsBuildQueryMethod->invoke($this->domains, $this->domainId, RecordsActions::ACTION_ADD)
        );
    }

    public function testNewRecordUrlWithDomaineName()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/foo.org/records/new/?client_id=foo&api_key=bar',
            $this->recordsBuildQueryMethod->invoke($this->domains, $this->domainName, RecordsActions::ACTION_ADD)
        );
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the record_type.
     */
    public function testNewRecordWithEmptyArray()
    {
        $this->domains->newRecord($this->domainId, array());
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage The record_type can only be A, CNAME, NS, TXT, MX or SRV
     */
    public function testNewRecordWithWrongRecordTypeValueType()
    {
        $this->domains->newRecord($this->domainId, array(
            'record_type' => null,
        ));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the data value of the record.
     */
    public function testNewRecordWithCorrectRecordTypeValue()
    {
        $this->domains->newRecord($this->domainId, array(
            'record_type' => 'A',
        ));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the data value of the record.
     */
    public function testNewRecordWithWrongDataAndWrongDataType()
    {
        $this->domains->newRecord($this->domainId, array(
            'record_type' => 'A',
            'data'        => null
        ));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the name string if the record_type is A, CNAME, TXT or SRV.
     */
    public function testNewRecordTypeAWithoutNameString()
    {
        $this->domains->newRecord($this->domainId, array(
            'record_type' => 'A',
            'data'        => 'data',
        ));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the priority integer if the record_type is SRV or MX.
     */
    public function testNewRecordTypeSRVWithoutPriorityNumber()
    {
        $this->domains->newRecord($this->domainId, array(
            'record_type' => 'SRV',
            'data'        => 'data',
            'name'        => 'foo',
        ));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the port integer if the record_type is SRV.
     */
    public function testNewRecordTypeSRVWithoutPortNumber()
    {
        $this->domains->newRecord($this->domainId, array(
            'record_type' => 'SRV',
            'data'        => 'data',
            'name'        => 'foo',
            'priority'    => 1,
        ));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage You need to provide the weight integer if the record_type is SRV.
     */
    public function testNewRecordTypeSRVWithoutWeightNumber()
    {
        $this->domains->newRecord($this->domainId, array(
            'record_type' => 'SRV',
            'data'        => 'data',
            'name'        => 'foo',
            'priority'    => 1,
            'port'        => 2,
        ));
    }

    public function testNewRecordTypeA()
    {
        $response = <<<JSON
{"status":"OK","domain_record":{"id": 51,"domain_id":"100","record_type":"A","name":"foo","data":"data","priority":null,"port":null,"weight":null}}
JSON
        ;

        $parameters = array(
            'record_type' => 'A',
            'data'        => 'data',
            'name'        => 'foo',
        );

        $domains   = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $newRecord = $domains->newRecord($this->domainId, $parameters);

        $this->assertTrue(is_object($newRecord));
        $this->assertEquals('OK', $newRecord->status);

        $record = $newRecord->domain_record;
        $this->assertTrue(is_object($record));
        $this->assertSame(51, $record->id);
        $this->assertSame('100', $record->domain_id);
        $this->assertSame('A', $record->record_type);
        $this->assertSame('foo', $record->name);
        $this->assertSame('data', $record->data);
        $this->assertNull($record->priority);
        $this->assertNull($record->port);
        $this->assertNull($record->weight);
    }

    public function testNewRecordTypeCNAME()
    {
        $response = <<<JSON
{"status":"OK","domain_record":{"id": 52,"domain_id":"100","record_type":"CNAME","name":"foo","data":"data","priority":null,"port":null,"weight":null}}
JSON
        ;

        $parameters = array(
            'record_type' => 'CNAME',
            'data'        => 'data',
            'name'        => 'foo',
        );

        $domains   = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $newRecord = $domains->newRecord($this->domainId, $parameters);

        $this->assertTrue(is_object($newRecord));
        $this->assertEquals('OK', $newRecord->status);

        $record = $newRecord->domain_record;
        $this->assertTrue(is_object($record));
        $this->assertSame(52, $record->id);
        $this->assertSame('100', $record->domain_id);
        $this->assertSame('CNAME', $record->record_type);
        $this->assertSame('foo', $record->name);
        $this->assertSame('data', $record->data);
        $this->assertNull($record->priority);
        $this->assertNull($record->port);
        $this->assertNull($record->weight);
    }

    public function testNewRecordTypeNS()
    {
        $response = <<<JSON
{"status":"OK","domain_record":{"id": 53,"domain_id":"100","record_type":"NS","name":"bar","data":"data","priority":null,"port":null,"weight":null}}
JSON
        ;

        $parameters = array(
            'record_type' => 'NS',
            'data'        => 'data',
        );

        $domains   = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $newRecord = $domains->newRecord($this->domainId, $parameters);

        $this->assertTrue(is_object($newRecord));
        $this->assertEquals('OK', $newRecord->status);

        $record = $newRecord->domain_record;
        $this->assertTrue(is_object($record));
        $this->assertSame(53, $record->id);
        $this->assertSame('100', $record->domain_id);
        $this->assertSame('NS', $record->record_type);
        $this->assertSame('bar', $record->name);
        $this->assertSame('data', $record->data);
        $this->assertNull($record->priority);
        $this->assertNull($record->port);
        $this->assertNull($record->weight);
    }

    public function testNewRecordTypeTXT()
    {
        $response = <<<JSON
{"status":"OK","domain_record":{"id": 54,"domain_id":"100","record_type":"TXT","name":"foo","data":"data","priority":null,"port":null,"weight":null}}
JSON
        ;

        $parameters = array(
            'record_type' => 'TXT',
            'data'        => 'data',
            'name'        => 'foo'
        );

        $domains   = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $newRecord = $domains->newRecord($this->domainId, $parameters);

        $this->assertTrue(is_object($newRecord));
        $this->assertEquals('OK', $newRecord->status);

        $record = $newRecord->domain_record;
        $this->assertTrue(is_object($record));
        $this->assertSame(54, $record->id);
        $this->assertSame('100', $record->domain_id);
        $this->assertSame('TXT', $record->record_type);
        $this->assertSame('foo', $record->name);
        $this->assertSame('data', $record->data);
        $this->assertNull($record->priority);
        $this->assertNull($record->port);
        $this->assertNull($record->weight);
    }

    public function testNewRecordTypeMX()
    {
        $response = <<<JSON
{"status":"OK","domain_record":{"id": 55,"domain_id":"100","record_type":"MX","name":"baz","data":"data","priority":1,"port":null,"weight":null}}
JSON
        ;

        $parameters = array(
            'record_type' => 'MX',
            'data'        => 'data',
            'priority'    => 1,
        );

        $domains   = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $newRecord = $domains->newRecord($this->domainId, $parameters);

        $this->assertTrue(is_object($newRecord));
        $this->assertEquals('OK', $newRecord->status);

        $record = $newRecord->domain_record;
        $this->assertTrue(is_object($record));
        $this->assertSame(55, $record->id);
        $this->assertSame('100', $record->domain_id);
        $this->assertSame('MX', $record->record_type);
        $this->assertSame('baz', $record->name);
        $this->assertSame('data', $record->data);
        $this->assertSame(1, $record->priority);
        $this->assertNull($record->port);
        $this->assertNull($record->weight);
    }

    public function testNewRecordTypeSRV()
    {
        $response = <<<JSON
{"status":"OK","domain_record":{"id": 56,"domain_id":"100","record_type":"SRV","name":"foo","data":"data","priority":1,"port":88,"weight":2}}
JSON
        ;

        $parameters = array(
            'record_type' => 'SRV',
            'data'        => 'data',
            'name'        => 'foo',
            'priority'    => 1,
            'port'        => 88,
            'weight'      => 2,
        );

        $domains   = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $newRecord = $domains->newRecord($this->domainId, $parameters);

        $this->assertTrue(is_object($newRecord));
        $this->assertEquals('OK', $newRecord->status);

        $record = $newRecord->domain_record;
        $this->assertTrue(is_object($record));
        $this->assertSame(56, $record->id);
        $this->assertSame('100', $record->domain_id);
        $this->assertSame('SRV', $record->record_type);
        $this->assertSame('foo', $record->name);
        $this->assertSame('data', $record->data);
        $this->assertSame(1, $record->priority);
        $this->assertSame(88, $record->port);
        $this->assertSame(2, $record->weight);
    }

    public function testGetRecordUrl()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/123/records/456/?client_id=foo&api_key=bar',
            $this->recordsBuildQueryMethod->invoke($this->domains, $this->domainId, $this->recordId)
        );
    }

    public function testGetRecord()
    {
        $response = <<<JSON
{"status":"OK","record":{"id":456,"domain_id":"123","record_type":"CNAME","name":"www","data":"@","priority":null,"port":null,"weight":null}}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $record  = $domains->getRecord($this->domainId, $this->recordId);

        $this->assertTrue(is_object($record));
        $this->assertEquals('OK', $record->status);

        $record = $record->record;
        $this->assertTrue(is_object($record));
        $this->assertSame(456, $record->id);
        $this->assertSame('123', $record->domain_id);
        $this->assertSame('CNAME', $record->record_type);
        $this->assertSame('www', $record->name);
        $this->assertSame('@', $record->data);
        $this->assertNull($record->priority);
        $this->assertNull($record->port);
        $this->assertNull($record->weight);
    }

    public function testEditRecordUrl()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/123/records/456/edit/?client_id=foo&api_key=bar',
            $this->recordsBuildQueryMethod->invoke($this->domains, $this->domainId, $this->recordId, RecordsActions::ACTION_EDIT)
        );
    }

    public function testEditRecord()
    {
        $response = <<<JSON
{"status":"OK","record":{"id":50,"domain_id":"100","record_type":"CNAME","name":"www2","data":"@","priority":null,"port":null,"weight":null}}
JSON
        ;

        $parameters = array(
            'record_type' => 'CNAME',
            'data'        => '@',
            'name'        => 'www2'
        );

        $domains      = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $editedRecord = $domains->editRecord($this->domainId, $this->recordId, $parameters);

        $this->assertTrue(is_object($editedRecord));
        $this->assertEquals('OK', $editedRecord->status);

        $record = $editedRecord->record;
        $this->assertTrue(is_object($record));
        $this->assertSame(50, $record->id);
        $this->assertSame('100', $record->domain_id);
        $this->assertSame('CNAME', $record->record_type);
        $this->assertSame('www2', $record->name);
        $this->assertSame('@', $record->data);
        $this->assertNull($record->priority);
        $this->assertNull($record->port);
        $this->assertNull($record->weight);
    }

    // testEditRecord* are close to testNewRecord* because we use the protected method
    // Domains::checkParameters in both Domains::newRecord and Domains::editRecord.

    public function testDestroyRecordUrl()
    {
        $this->assertEquals(
            'https://api.digitalocean.com/domains/123/records/456/destroy/?client_id=foo&api_key=bar',
            $this->recordsBuildQueryMethod->invoke($this->domains, $this->domainId, $this->recordId, RecordsActions::ACTION_DESTROY)
        );
    }

    public function testDestroyRecord()
    {
        $response = <<<JSON
{"status":"OK"}
JSON
        ;

        $domains = new Domains($this->getMockCredentials(), $this->getMockAdapterReturns($response));
        $destroy = $domains->destroyRecord($this->domainId, $this->recordId);

        $this->assertTrue(is_object($destroy));
        $this->assertEquals('OK', $destroy->status);
    }
}


text:
A PHP client for BCash payment webservice.

## Install

Via Composer

``` bash
$ composer require eumatheusgomes/bcash
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

If you discover any security related issues, please email [eu@matheusgomes.com.br](eu@matheusgomes.com.br) instead of using the issue tracker.

## Credits

- [Matheus Gomes](https://github.com/eumatheusgomes)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('messages', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('body')->nullable();
            $table->integer('user_id')->unsigned();
            $table->integer('attachment_id')->unsigned()->nullable()->comment('id of files table');
            $table->string('messageable_type')->comment('office, team or projects');
            $table->integer('messageable_id')->unsigned();
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->foreign('attachment_id')->references('id')->on('attachments')->onDelete('cascade');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('messages');
    }
}


text:
import Ember from 'ember';
import C from 'ui/utils/constants';
import Util from 'ui/utils/util';
import Sortable from 'ui/mixins/sortable';

export default Ember.Controller.extend(Sortable, {
  access: Ember.inject.service(),
  'tab-session': Ember.inject.service(),

  sortBy: 'name',
  sorts: {
    state:        ['stateSort','name','id'],
    name:         ['name','id'],
    description:  ['description','name','id'],
    publicValue:  ['publicValue','id'],
    created:      ['created','name','id'],
  },

  application: Ember.inject.controller(),
  cookies: Ember.inject.service(),
  projects: Ember.inject.service(),
  growl: Ember.inject.service(),
  project: Ember.computed.alias('projects.current'),
  endpointService: Ember.inject.service('endpoint'),

  accountArranged: function() {
    var me = this.get(`session.${C.SESSION.ACCOUNT_ID}`);
    return this.get('arranged').filter((row) => {
      return row.get('accountId') === me;
    });
  }.property('arranged.@each.accountId'),

  environmentArranged: function() {
    var me = this.get(`session.${C.SESSION.ACCOUNT_ID}`);
    return this.get('arranged').filter((row) => {
      return row.get('accountId') !== me;
    });
  }.property('arranged.@each.accountId'),

  actions: {
    newApikey: function(kind) {
      var cred;
      if ( kind === 'account' )
      {
        cred = this.get('userStore').createRecord({
          type: 'apikey',
          accountId: this.get(`session.${C.SESSION.ACCOUNT_ID}`),
        });
      }
      else
      {
        cred = this.get('store').createRecord({
          type: 'apikey',
          accountId: this.get('projects.current.id'),
        });
      }

      this.get('application').setProperties({
        editApikey: true,
        originalModel: cred,
      });
    },
  },

  displayEndpoint: function() {
    // Strip trailing slash off of the absoluteEndpoint
    var url = this.get('endpointService.absolute').replace(/\/+$/,'');
    // Add a single slash
    url += '/';

    // And strip leading slashes off the API endpoint
    url += this.get('app.apiEndpoint').replace(/^\/+/,'');

    return url;
  }.property('endpointService.absolute','app.apiEndpoint',`tab-session.${C.TABSESSION.PROJECT}`),

  displayEndpointEnvironment: function() {
    var url = this.get('displayEndpoint');

    // Go to the project-specific version
    var projectId = this.get('tab-session').get(C.TABSESSION.PROJECT);
    if ( projectId )
    {
      url += '/projects/' + projectId;
    }

    return url;
  }.property('displayEndpoint'),

  endpointWithAuth: function() {
    var url = this.get('displayEndpoint');

    // For local development where API doesn't match origin, add basic auth token
    if ( url.indexOf(window.location.origin) !== 0 )
    {
      var token = this.get('cookies').get(C.COOKIE.TOKEN);
      if ( token )
      {
        url = Util.addAuthorization(url, C.USER.BASIC_BEARER, token);
      }
    }

    return url;
  }.property('displayEndpoint', `session.${C.SESSION.TOKEN}`,`tab-session.${C.TABSESSION.PROJECT}`),

  endpointWithAuthEnvironment: function() {
    var url = this.get('displayEndpointEnvironment');

    // For local development where API doesn't match origin, add basic auth token
    if ( url.indexOf(window.location.origin) !== 0 )
    {
      var token = this.get('cookies').get(C.COOKIE.TOKEN);
      if ( token )
      {
        url = Util.addAuthorization(url, C.USER.BASIC_BEARER, token);
      }
    }

    return url;
  }.property('displayEndpointEnvironment', `session.${C.SESSION.TOKEN}`,`tab-session.${C.TABSESSION.PROJECT}`)
});


text:
/* IP tables module for matching the value of the IPv4 and TCP ECN bits
 *
 * (C) 2002 by Harald Welte <laforge@gnumonks.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/in.h>
#include <linux/ip.h>
#include <net/ip.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/tcp.h>

#include <linux/netfilter/x_tables.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_ecn.h>

MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
MODULE_DESCRIPTION("Xtables: Explicit Congestion Notification (ECN) flag match for IPv4");
MODULE_LICENSE("GPL");

static inline bool match_ip(const struct sk_buff *skb,
			    const struct ipt_ecn_info *einfo)
{
	return (ip_hdr(skb)->tos & IPT_ECN_IP_MASK) == einfo->ip_ect;
}

static inline bool match_tcp(const struct sk_buff *skb,
			     const struct ipt_ecn_info *einfo,
			     bool *hotdrop)
{
	struct tcphdr _tcph;
	const struct tcphdr *th;

	/* In practice, TCP match does this, so can't fail.  But let's
	 * be good citizens.
	 */
	th = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_tcph), &_tcph);
	if (th == NULL) {
		*hotdrop = false;
		return false;
	}

	if (einfo->operation & IPT_ECN_OP_MATCH_ECE) {
		if (einfo->invert & IPT_ECN_OP_MATCH_ECE) {
			if (th->ece == 1)
				return false;
		} else {
			if (th->ece == 0)
				return false;
		}
	}

	if (einfo->operation & IPT_ECN_OP_MATCH_CWR) {
		if (einfo->invert & IPT_ECN_OP_MATCH_CWR) {
			if (th->cwr == 1)
				return false;
		} else {
			if (th->cwr == 0)
				return false;
		}
	}

	return true;
}

static bool ecn_mt(const struct sk_buff *skb, const struct xt_match_param *par)
{
	const struct ipt_ecn_info *info = par->matchinfo;

	if (info->operation & IPT_ECN_OP_MATCH_IP)
		if (!match_ip(skb, info))
			return false;

	if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR)) {
		if (ip_hdr(skb)->protocol != IPPROTO_TCP)
			return false;
		if (!match_tcp(skb, info, par->hotdrop))
			return false;
	}

	return true;
}

static bool ecn_mt_check(const struct xt_mtchk_param *par)
{
	const struct ipt_ecn_info *info = par->matchinfo;
	const struct ipt_ip *ip = par->entryinfo;

	if (info->operation & IPT_ECN_OP_MATCH_MASK)
		return false;

	if (info->invert & IPT_ECN_OP_MATCH_MASK)
		return false;

	if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR)
	    && ip->proto != IPPROTO_TCP) {
		printk(KERN_WARNING "ipt_ecn: can't match TCP bits in rule for"
		       " non-tcp packets\n");
		return false;
	}

	return true;
}

static struct xt_match ecn_mt_reg __read_mostly = {
	.name		= "ecn",
	.family		= NFPROTO_IPV4,
	.match		= ecn_mt,
	.matchsize	= sizeof(struct ipt_ecn_info),
	.checkentry	= ecn_mt_check,
	.me		= THIS_MODULE,
};

static int __init ecn_mt_init(void)
{
	return xt_register_match(&ecn_mt_reg);
}

static void __exit ecn_mt_exit(void)
{
	xt_unregister_match(&ecn_mt_reg);
}

module_init(ecn_mt_init);
module_exit(ecn_mt_exit);


text:
<?php

namespace Laradic\Generators\Core\Traits;

use Illuminate\Support\Arr;

trait ValueTrait
{
    /**
     * @var mixed
     */
    protected $value;

    /**
     * @return mixed
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * @param mixed $value
     * @return $this
     */
    public function setValue($value)
    {
        $this->value = $value;

        return $this;
    }

    /**
     * @return string|null
     */
    protected function renderValue()
    {
        return $this->renderTyped($this->value);
    }

    /**
     * @param mixed $value
     * @return string|null
     */
    protected function renderTyped($value)
    {
        $type = gettype($value);

        switch ($type) {
            case 'boolean':
                $value = $value ? 'true' : 'false';

                break;
            case 'int':
                // do nothing

                break;
            case 'string':
                $value = sprintf('\'%s\'', addslashes($value));

                break;
            case 'array':
                if(Arr::isAssoc($value)){

                    $value = var_export($value,true);
                    break;
                }
                $parts = [];
                foreach ($value as $item) {
                    $parts[] = $this->renderTyped($item);
                }
                $value = '[' . implode(', ', $parts) . ']';

                break;
            default:
                $value = null; // TODO: how to render null explicitly?
        }

        return $value;
    }
}


text:
<?php

header("Location: http://thesis.jsdares.com/thesis-jan-paul-posma.pdf");


text:
<?php

/**
 * Interface that represents a single Command that can be executed through the
 * console.
 *
 * @author  Charles Sprayberry
 * @license See LICENSE in source root
 * @version 0.1
 * @since   0.1
 */

namespace SpraySole\Command;

use \SpraySole\Input\Input;
use \SpraySole\Output\Output;
use \SpraySole\Application;

interface Command {

    /**
     * Provide the Application that the Command is being executed on in case it
     * needs access to other Commands or publicly exposed Application state.
     *
     * @param \SpraySole\Application $App
     * @return \SpraySole\Command\Command
     */
    public function setApplication(Application $App);

    /**
     * Return the description of the command.
     *
     * @return string
     */
    public function getDescription();

    /**
     * Return the help output for the command.
     *
     * @return string
     */
    public function getHelp();

    /**
     * Return the name of the command as it would be typed into the console.
     *
     * @return string
     */
    public function getName();

    /**
     * Return whether the Command is enabled; you can set this to false if the
     * current environment prohibits the Command from being ran.
     *
     * @return boolean
     */
    public function isEnabled();

    /**
     * Execute the given Command based on the Input, writing whatever Output is
     * necessary based on any normal processing or errors; return an exit code
     * or 0 if there was no error.
     *
     * @param \SpraySole\Input\Input $Input
     * @param \SpraySole\Output\Output $StdOut
     * @param \SpraySole\Output\Output $StdErr
     * @return integer
     */
    public function execute(Input $Input, Output $StdOut, Output $StdErr);

}


text:
// +build !ignore_autogenerated

// This file was autogenerated by conversion-gen. Do not edit it manually!

package v1

import (
	meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	testapigroup "k8s.io/apimachinery/pkg/apis/testapigroup"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	unsafe "unsafe"
)

func init() {
	localSchemeBuilder.Register(RegisterConversions)
}

// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
	return scheme.AddGeneratedConversionFuncs(
		Convert_v1_Carp_To_testapigroup_Carp,
		Convert_testapigroup_Carp_To_v1_Carp,
		Convert_v1_CarpCondition_To_testapigroup_CarpCondition,
		Convert_testapigroup_CarpCondition_To_v1_CarpCondition,
		Convert_v1_CarpList_To_testapigroup_CarpList,
		Convert_testapigroup_CarpList_To_v1_CarpList,
		Convert_v1_CarpSpec_To_testapigroup_CarpSpec,
		Convert_testapigroup_CarpSpec_To_v1_CarpSpec,
		Convert_v1_CarpStatus_To_testapigroup_CarpStatus,
		Convert_testapigroup_CarpStatus_To_v1_CarpStatus,
	)
}

func autoConvert_v1_Carp_To_testapigroup_Carp(in *Carp, out *testapigroup.Carp, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_v1_CarpSpec_To_testapigroup_CarpSpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	if err := Convert_v1_CarpStatus_To_testapigroup_CarpStatus(&in.Status, &out.Status, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1_Carp_To_testapigroup_Carp is an autogenerated conversion function.
func Convert_v1_Carp_To_testapigroup_Carp(in *Carp, out *testapigroup.Carp, s conversion.Scope) error {
	return autoConvert_v1_Carp_To_testapigroup_Carp(in, out, s)
}

func autoConvert_testapigroup_Carp_To_v1_Carp(in *testapigroup.Carp, out *Carp, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_testapigroup_CarpSpec_To_v1_CarpSpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	if err := Convert_testapigroup_CarpStatus_To_v1_CarpStatus(&in.Status, &out.Status, s); err != nil {
		return err
	}
	return nil
}

// Convert_testapigroup_Carp_To_v1_Carp is an autogenerated conversion function.
func Convert_testapigroup_Carp_To_v1_Carp(in *testapigroup.Carp, out *Carp, s conversion.Scope) error {
	return autoConvert_testapigroup_Carp_To_v1_Carp(in, out, s)
}

func autoConvert_v1_CarpCondition_To_testapigroup_CarpCondition(in *CarpCondition, out *testapigroup.CarpCondition, s conversion.Scope) error {
	out.Type = testapigroup.CarpConditionType(in.Type)
	out.Status = testapigroup.ConditionStatus(in.Status)
	out.LastProbeTime = in.LastProbeTime
	out.LastTransitionTime = in.LastTransitionTime
	out.Reason = in.Reason
	out.Message = in.Message
	return nil
}

// Convert_v1_CarpCondition_To_testapigroup_CarpCondition is an autogenerated conversion function.
func Convert_v1_CarpCondition_To_testapigroup_CarpCondition(in *CarpCondition, out *testapigroup.CarpCondition, s conversion.Scope) error {
	return autoConvert_v1_CarpCondition_To_testapigroup_CarpCondition(in, out, s)
}

func autoConvert_testapigroup_CarpCondition_To_v1_CarpCondition(in *testapigroup.CarpCondition, out *CarpCondition, s conversion.Scope) error {
	out.Type = CarpConditionType(in.Type)
	out.Status = ConditionStatus(in.Status)
	out.LastProbeTime = in.LastProbeTime
	out.LastTransitionTime = in.LastTransitionTime
	out.Reason = in.Reason
	out.Message = in.Message
	return nil
}

// Convert_testapigroup_CarpCondition_To_v1_CarpCondition is an autogenerated conversion function.
func Convert_testapigroup_CarpCondition_To_v1_CarpCondition(in *testapigroup.CarpCondition, out *CarpCondition, s conversion.Scope) error {
	return autoConvert_testapigroup_CarpCondition_To_v1_CarpCondition(in, out, s)
}

func autoConvert_v1_CarpList_To_testapigroup_CarpList(in *CarpList, out *testapigroup.CarpList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]testapigroup.Carp, len(*in))
		for i := range *in {
			if err := Convert_v1_Carp_To_testapigroup_Carp(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_v1_CarpList_To_testapigroup_CarpList is an autogenerated conversion function.
func Convert_v1_CarpList_To_testapigroup_CarpList(in *CarpList, out *testapigroup.CarpList, s conversion.Scope) error {
	return autoConvert_v1_CarpList_To_testapigroup_CarpList(in, out, s)
}

func autoConvert_testapigroup_CarpList_To_v1_CarpList(in *testapigroup.CarpList, out *CarpList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]Carp, len(*in))
		for i := range *in {
			if err := Convert_testapigroup_Carp_To_v1_Carp(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_testapigroup_CarpList_To_v1_CarpList is an autogenerated conversion function.
func Convert_testapigroup_CarpList_To_v1_CarpList(in *testapigroup.CarpList, out *CarpList, s conversion.Scope) error {
	return autoConvert_testapigroup_CarpList_To_v1_CarpList(in, out, s)
}

func autoConvert_v1_CarpSpec_To_testapigroup_CarpSpec(in *CarpSpec, out *testapigroup.CarpSpec, s conversion.Scope) error {
	out.RestartPolicy = testapigroup.RestartPolicy(in.RestartPolicy)
	out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds))
	out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds))
	out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector))
	out.ServiceAccountName = in.ServiceAccountName
	// INFO: in.DeprecatedServiceAccount opted out of conversion generation
	out.NodeName = in.NodeName
	// INFO: in.HostNetwork opted out of conversion generation
	// INFO: in.HostPID opted out of conversion generation
	// INFO: in.HostIPC opted out of conversion generation
	out.Hostname = in.Hostname
	out.Subdomain = in.Subdomain
	out.SchedulerName = in.SchedulerName
	return nil
}

// Convert_v1_CarpSpec_To_testapigroup_CarpSpec is an autogenerated conversion function.
func Convert_v1_CarpSpec_To_testapigroup_CarpSpec(in *CarpSpec, out *testapigroup.CarpSpec, s conversion.Scope) error {
	return autoConvert_v1_CarpSpec_To_testapigroup_CarpSpec(in, out, s)
}

func autoConvert_testapigroup_CarpSpec_To_v1_CarpSpec(in *testapigroup.CarpSpec, out *CarpSpec, s conversion.Scope) error {
	out.RestartPolicy = RestartPolicy(in.RestartPolicy)
	out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds))
	out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds))
	out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector))
	out.ServiceAccountName = in.ServiceAccountName
	out.NodeName = in.NodeName
	out.Hostname = in.Hostname
	out.Subdomain = in.Subdomain
	out.SchedulerName = in.SchedulerName
	return nil
}

// Convert_testapigroup_CarpSpec_To_v1_CarpSpec is an autogenerated conversion function.
func Convert_testapigroup_CarpSpec_To_v1_CarpSpec(in *testapigroup.CarpSpec, out *CarpSpec, s conversion.Scope) error {
	return autoConvert_testapigroup_CarpSpec_To_v1_CarpSpec(in, out, s)
}

func autoConvert_v1_CarpStatus_To_testapigroup_CarpStatus(in *CarpStatus, out *testapigroup.CarpStatus, s conversion.Scope) error {
	out.Phase = testapigroup.CarpPhase(in.Phase)
	out.Conditions = *(*[]testapigroup.CarpCondition)(unsafe.Pointer(&in.Conditions))
	out.Message = in.Message
	out.Reason = in.Reason
	out.HostIP = in.HostIP
	out.CarpIP = in.CarpIP
	out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime))
	return nil
}

// Convert_v1_CarpStatus_To_testapigroup_CarpStatus is an autogenerated conversion function.
func Convert_v1_CarpStatus_To_testapigroup_CarpStatus(in *CarpStatus, out *testapigroup.CarpStatus, s conversion.Scope) error {
	return autoConvert_v1_CarpStatus_To_testapigroup_CarpStatus(in, out, s)
}

func autoConvert_testapigroup_CarpStatus_To_v1_CarpStatus(in *testapigroup.CarpStatus, out *CarpStatus, s conversion.Scope) error {
	out.Phase = CarpPhase(in.Phase)
	out.Conditions = *(*[]CarpCondition)(unsafe.Pointer(&in.Conditions))
	out.Message = in.Message
	out.Reason = in.Reason
	out.HostIP = in.HostIP
	out.CarpIP = in.CarpIP
	out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime))
	return nil
}

// Convert_testapigroup_CarpStatus_To_v1_CarpStatus is an autogenerated conversion function.
func Convert_testapigroup_CarpStatus_To_v1_CarpStatus(in *testapigroup.CarpStatus, out *CarpStatus, s conversion.Scope) error {
	return autoConvert_testapigroup_CarpStatus_To_v1_CarpStatus(in, out, s)
}


text:
package com.game.client.handlers.packet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.game.client.Client;
import com.game.client.WorldManager;
import com.game.client.handlers.PacketHandler;
import com.game.client.model.Player;
import com.game.client.ui.ChatMessages;
import com.game.common.codec.Packet;
import com.game.common.model.Hash;

public class ChatHandler implements PacketHandler {
	private static final Logger log = LoggerFactory.getLogger(ChatHandler.class);

	@Override
	public void handlePacket(Client client, WorldManager world, Packet packet) throws Exception {
		Hash id = packet.getHash();
		Player from = world.getPlayer(id);
		if (from == null) {
			log.warn("Received chat message from unknown player: " + id);
			return;
		}

		String message = packet.getString();

		// Send the message to our HUD to be displayed
		client.getHUD().addMessage(from.getUsername() + ": " + message, ChatMessages.Type.LOCAL_CHAT);

		// TODO: Display the chat message over the players head
	}
}


text:
<!DOCTYPE html>

    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Content moved</title>
    <meta name="author" content="Mark Seemann">
    <meta http-equiv="refresh" content="0;/2010/11/22/IntegratingAutoFixturewithObjectHydrator"><link rel="canonical" href="/2010/11/22/IntegratingAutoFixturewithObjectHydrator">

    This page has moved to /2010/11/22/IntegratingAutoFixturewithObjectHydrator.


text:
package org.fcrepo.kernel.modeshape.services;

import org.fcrepo.kernel.api.FedoraSession;
import org.fcrepo.kernel.api.exception.RepositoryRuntimeException;
import org.fcrepo.kernel.api.exception.ResourceTypeException;
import org.fcrepo.kernel.api.models.FedoraBinary;
import org.fcrepo.kernel.api.services.BinaryService;
import org.fcrepo.kernel.modeshape.FedoraBinaryImpl;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;

import javax.jcr.Node;
import javax.jcr.RepositoryException;

import static org.fcrepo.kernel.api.FedoraTypes.FEDORA_BINARY;
import static org.fcrepo.kernel.api.FedoraTypes.FEDORA_NON_RDF_SOURCE_DESCRIPTION;
import static org.fcrepo.kernel.api.FedoraTypes.FEDORA_RESOURCE;
import static org.fcrepo.kernel.modeshape.utils.FedoraTypesUtils.getContainingNode;
import static org.fcrepo.kernel.modeshape.utils.FedoraTypesUtils.touch;
import static org.fcrepo.kernel.modeshape.utils.FedoraTypesUtils.touchLdpMembershipResource;
import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT;
import static org.modeshape.jcr.api.JcrConstants.NT_FILE;
import static org.modeshape.jcr.api.JcrConstants.NT_RESOURCE;
import static org.slf4j.LoggerFactory.getLogger;

/**
 * @author cabeer
 * @author ajs6f
 * @since 10/10/14
 */
@Component
public class BinaryServiceImpl extends AbstractService implements BinaryService {

    private static final Logger LOGGER = getLogger(BinaryServiceImpl.class);

    /**
     * Retrieve or create a Datastream instance by pid and dsid
     *
     * @param path jcr path to the datastream
     * @return datastream
     */
    @Override
    public FedoraBinary findOrCreate(final FedoraSession session, final String path) {
        try {
            final Node dsNode = findOrCreateNode(session, path, NT_FILE);

            if (dsNode.isNew()) {
                initializeNewDatastreamProperties(dsNode);

                getContainingNode(dsNode).ifPresent(parent -> {
                    touch(parent);
                    touchLdpMembershipResource(dsNode);
                });
            }

            final FedoraBinaryImpl binary = new FedoraBinaryImpl(dsNode.getNode(JCR_CONTENT));

            if (dsNode.isNew()) {
                binary.touch();
            }

            return binary;
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }

    /**
     * Retrieve a Datastream instance by pid and dsid
     *
     * @param path jcr path to the datastream
     * @return datastream
     */
    @Override
    public FedoraBinary find(final FedoraSession session, final String path) {
        try {
            final Node dsNode = findNode(session, path);

            return cast(dsNode.getNode(JCR_CONTENT));
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }

    private static void initializeNewDatastreamProperties(final Node node) {
        try {

            if (node.canAddMixin(FEDORA_RESOURCE)) {
                node.addMixin(FEDORA_RESOURCE);
            }

            if (node.canAddMixin(FEDORA_NON_RDF_SOURCE_DESCRIPTION)) {
                node.addMixin(FEDORA_NON_RDF_SOURCE_DESCRIPTION);
            }

            final Node contentNode = jcrTools.findOrCreateChild(node, JCR_CONTENT, NT_RESOURCE);

            if (contentNode.canAddMixin(FEDORA_BINARY)) {
                contentNode.addMixin(FEDORA_BINARY);
            }
        } catch (final RepositoryException e) {
            LOGGER.warn("Could not decorate {} with datastream properties: {}", node, e);
        }

    }
    /**
     * Retrieve a Datastream instance by pid and dsid
     *
     * @param node datastream node
     * @return node as datastream
     */
    private FedoraBinary cast(final Node node) {
        assertIsType(node);
        return new FedoraBinaryImpl(node);
    }

    private static void assertIsType(final Node node) {
        if (!FedoraBinaryImpl.hasMixin(node)) {
            throw new ResourceTypeException(node + " can not be used as a binary");
        }
    }

}


text:
/*
Theme Name: Shop Isle Child 01
Theme URI:
Description: Child 01 theme for the Shop Isle theme
Author: ThemeIsle
Author URI:
Template: shop-isle
Version: 1.1.6.15
*/

/* Generated by Orbisius Child Theme Creator (http://club.orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/) on Fri, 02 Dec 2016 10:58:20 +0000 */
/* The plugin now uses the recommended approach for loading the css files.*/

.count {
	display: none;
}


text:
#pragma once

#include <mrpt/math/CProbabilityDensityFunction.h>
#include <mrpt/math/math_frwds.h>
#include <mrpt/poses/CPose3D.h>
#include <mrpt/serialization/CSerializable.h>

namespace mrpt::poses
{
class CPosePDF;

/** A Probability Density Function (PDF) of a SE(3) pose.
 * This class is just the base class for unifying many diferent
 *    ways this PDF can be implemented.
 *
 *  For convenience, a pose composition is also defined for any
 *    PDF derived class, changeCoordinatesReference, in the form of a method
 * rather than an operator.
 *
 *  For a similar class for 3D points (without attitude), see CPointPDF
 *
 *  See also:
 *  [probabilistic spatial representations](tutorial-pdf-over-poses.html)
 *
 * \sa CPose3D, CPosePDF, CPointPDF
 * \ingroup poses_pdf_grp
 */
class CPose3DPDF : public mrpt::serialization::CSerializable,
				   public mrpt::math::CProbabilityDensityFunction<CPose3D, 6>
{
	DEFINE_VIRTUAL_SERIALIZABLE(CPose3DPDF)

   public:
	/** Copy operator, translating if necesary (for example, between particles
	 * and gaussian representations)
	 * \sa createFrom2D
	 */
	virtual void copyFrom(const CPose3DPDF& o) = 0;

	/** This is a static transformation method from 2D poses to 3D PDFs,
	 * preserving the representation type (particles->particles,
	 * Gaussians->Gaussians,etc)
	 *
	 * \warning It returns a new object of any of the derived classes of
	 * CPose3DPDF. This object must be deleted by the user when not required
	 * anymore.
	 *
	 * \sa copyFrom
	 */
	static CPose3DPDF* createFrom2D(const CPosePDF& o);

	virtual void changeCoordinatesReference(
		const CPose3D& newReferenceBase) = 0;

	/** Bayesian fusion of two pose distributions, then save the result in this
	 * object (WARNING: Currently only distributions of the same class can be
	 * fused! eg, gaussian with gaussian,etc) */
	virtual void bayesianFusion(const CPose3DPDF& p1, const CPose3DPDF& p2) = 0;

	/** Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF */
	virtual void inverse(CPose3DPDF& o) const = 0;

	/** This static method computes the pose composition Jacobians.
	 *
	 * See this techical report:
	 * http:///www.mrpt.org/6D_poses:equivalences_compositions_and_uncertainty
	 *
	 * Direct equations (for the covariances) in yaw-pitch-roll are too complex.
	 *  Make a way around them and consider instead this path:
	 * \code
	 *      X(6D)       U(6D)
	 *        |           |
	 *        v           v
	 *      X(7D)       U(7D)
	 *        |           |
	 *        +--- (+) ---+
	 *              |
	 *              v
	 *            RES(7D)
	 *              |
	 *              v
	 *            RES(6D)
	 * \endcode
	 *
	 */
	static void jacobiansPoseComposition(
		const CPose3D& x, const CPose3D& u, mrpt::math::CMatrixDouble66& df_dx,
		mrpt::math::CMatrixDouble66& df_du);

	enum
	{
		is_3D_val = 1
	};
	static constexpr bool is_3D() { return is_3D_val != 0; }
	enum
	{
		is_PDF_val = 1
	};
	static constexpr bool is_PDF() { return is_PDF_val != 0; }
	/** Returns a 3D representation of this PDF (it doesn't clear the current
	 * contents of out_obj, but append new OpenGL objects to that list)
	 * \note Needs the mrpt-opengl library, and using
	 * mrpt::opengl::CSetOfObjects::Ptr as template argument.
	 * \note By default, ellipsoids for the confidence intervals of  "q=3" are
	 * drawn; for more mathematical details, see
	 * CGeneralizedEllipsoidTemplate::setQuantiles()
	 * \sa mrpt::opengl::CSetOfObjects::posePDF2opengl() for details on
	 * pose-to-opengl conversion
	 */
	template <class OPENGL_SETOFOBJECTSPTR>
	inline void getAs3DObject(OPENGL_SETOFOBJECTSPTR& out_obj) const
	{
		using SETOFOBJECTS = typename OPENGL_SETOFOBJECTSPTR::element_type;
		out_obj->insertCollection(*SETOFOBJECTS::posePDF2opengl(*this));
	}

	/** Returns a 3D representation of this PDF.
	 * \note Needs the mrpt-opengl library, and using
	 * mrpt::opengl::CSetOfObjects::Ptr as template argument.
	 */
	template <class OPENGL_SETOFOBJECTSPTR>
	inline OPENGL_SETOFOBJECTSPTR getAs3DObject() const
	{
		using SETOFOBJECTS = typename OPENGL_SETOFOBJECTSPTR::element_type;
		return SETOFOBJECTS::posePDF2opengl(*this);
	}

};	// End of class def.
}  // namespace mrpt::poses


text:
package gopath

import (
	"os"
	"path"
	"path/filepath"
	"strings"
)

func (g GoPath) String() string {
	return g.path
}

// Path returns the path represented by the given GoPath object.
// If that GoPath is errorneous, a zero value is returned.
func (g GoPath) Path() string {
	return g.path
}

func (g GoPath) Ext() string {
	return path.Ext(g.Path())
}

func (g GoPath) Base() string {
	return path.Base(g.Path())
}

// FileInfo calls Stat() on GoPath and returns the resulting FileInfo.
// When Stat() results in an error, or GoPath is already errorneous,
// the result is a zero interface.
// When the Stat() result is already cached inside the GoPath, Stat() is not
// called again.
func (g GoPath) FileInfo() os.FileInfo {
	if !g.HasErr() && g.fileInfo == nil {
		return g.Stat().FileInfo()
	}
	return g.fileInfo
}

// FileMode returns g.FileInfo().Mode(), or 0, when FileInfo() fails.
func (g GoPath) FileMode() os.FileMode {
	if info := g.FileInfo(); info != nil {
		return info.Mode()
	}
	return 0
}

// Glob calls filepath.Glob(string) and returns the matches and any possible
// error.
//
// See also GlobAny(), if you just want one GoPath value.
// Especially it returns g.Err(), if this GoPath is errorneous.
func (g GoPath) Glob() (matches []string, err error) {
	if g.HasErr() {
		return make([]string, 0), g.Err()
	}
	return filepath.Glob(g.Path())
}

// Components returns all path components in this gopath.
// That is, the path is split at each os.PathSeparator.
//
// If this gopath is errorneous, it returns the empty array.
func (g GoPath) Components() []string {
	if g.HasErr() {
		return make([]string, 0)
	}
	return strings.Split(g.Path(), string(os.PathSeparator))
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="icon/favicon.ico">
<title>User Dashboard</title>

<link href="/assets/css/bootstrap.min.css" rel="stylesheet">
<link href="/assets/css/custom.css" rel="stylesheet">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>


text:
<?php

namespace ImboClientCli;

/**
 * Version class
 *
 * @package Application
 * @author Christer Edvartsen <cogo@starzinger.net>
 */
class Version {
    /**
     * The current version
     *
     * @var string
     */
    const VERSION = 'dev';
}


text:
"""Change point kernel."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import tensorflow.compat.v2 as tf
from tensorflow_probability.python.internal import assert_util
from tensorflow_probability.python.internal import distribution_util
from tensorflow_probability.python.internal import dtype_util
from tensorflow_probability.python.internal import parameter_properties
from tensorflow_probability.python.internal import prefer_static as ps
from tensorflow_probability.python.internal import tensor_util
from tensorflow_probability.python.math.psd_kernels import positive_semidefinite_kernel as psd_kernel
from tensorflow_probability.python.math.psd_kernels.internal import util

__all__ = ['ChangePoint']

class ChangePoint(psd_kernel.AutoCompositeTensorPsdKernel):
  """Changepoint Kernel.

  Given a list of kernels `k_1`, `k_2`, ..., `k_n`, and 1-D inputs `x` and `y`,
  this kernel computes a smooth interpolant between the kernels.

  ```none
  k(x, y) = (1 - s_1(x)) * k_1(x, y) * (1 - s1(y)) +
            (1 - s_2(x)) * s_1(x) * k_2(x, y) * (1 - s_2(y)) * s_1(y) +
            (1 - s_3(x)) * s_2(x) * k_3(x, y) * (1 - s_3(y)) * s_2(y) +
            ...
            s_{n-1}(x) * kn(x, y) * s_{n-1}(y)
  ```

  where:
    * `s_i(x) = sigmoid(slopes[i] * (x - locs[i]))`
    * `locs` is a `Tensor` of length `n - 1` that's in ascending order.
    * `slopes` is a positive `Tensor` of length `n - 1`.

  If we have 2 kernels `k1` and `k2`, this takes the form:

  ```none
  k(x, y) = (1 - s_1(x)) * k_1(x, y) * (1 - s_1(y)) +
            s_1(x) * k_2(x, y) * s_1(y)
  ```

  When `x` and `y` are much less than `locs[0]`, `k(x, y) ~= k1(x, y)`, while
  `x` and `y` are much greater than `locs[0]`, `k(x, y) ~= k2(x, y)`.

  In general, this kernel performs a smooth interpolation between `ki(x, y)`
  where `k(x, y) ~= ki(x, y)` when `locs[i - 1] < x, y < locs[i]`.

  This kernel accepts an optional `weight_fn` which consumes `x` and returns
  a scalar. This is used when computing the sigmoids
  `si(x) = sigmoid(slopes[i] * (w(x) - locs[i]))`, which allows this kernel
  to be computed on arbitrary dimensional input. For instance, a `weight_fn`
  that is `tf.linalg.norm` would smoothly interpolate between different kernels
  over different annuli in the plane.

  #### References
  [1]: Andrew Gordon Wilson. The Change Point Kernel.
       https://www.cs.cmu.edu/~andrewgw/changepoints.pdf
  """

  def __init__(
      self,
      kernels,
      locs,
      slopes,
      weight_fn=util.sum_rightmost_ndims_preserving_shape,
      validate_args=False,
      name='ChangePoint'):
    """Construct a ChangePoint kernel instance.

    Args:
      kernels: List of size `[N]` of `PositiveSemidefiniteKernel` instances to
        interpolate between.
      locs: Ascending Floating-point `Tensor` of shape broadcastable to
        `[..., N - 1]` that controls the regions for the interpolation.
        If `kernels` are a list of 1-D kernels with the default `weight_fn`,
        then between `locs[i - 1]` and `locs[i]`, this kernel acts like
        `kernels[i]`.
      slopes: Positive Floating-point `Tensor` of shape broadcastable to
        `[..., N - 1]` that controls how smooth the interpolation between
        kernels is (larger `slopes` means more discrete transitions).
      weight_fn: Python `callable` which takes an input `x` and `feature_ndims`
        argument, and returns a `Tensor` where a scalar is returned for
        each right-most `feature_ndims` of the input.
        (in other words, if `x` is a batch of inputs, `weight_fn` returns
        a batch of scalar, with the same batch shape).
        Default value: Sums over the last `feature_ndims` of the input `x`.
      validate_args: If `True`, parameters are checked for validity despite
        possibly degrading runtime performance
      name: Python `str` name prefixed to Ops created by this class.
    """

    parameters = dict(locals())
    with tf.name_scope(name):
      dtype = util.maybe_get_common_dtype(
          [kernels, locs, slopes])

      if not callable(weight_fn):
        raise TypeError(f'fn is not callable: {weight_fn}')
      if len(kernels) < 2:
        raise ValueError(
            f'Expecting at least 2 kernels, got {len(kernels)}')
      if not all(k.feature_ndims == kernels[0].feature_ndims for k in kernels):
        raise ValueError(
            'Expect that all `kernels` have the same feature_ndims')
      self._kernels = kernels
      self._locs = tensor_util.convert_nonref_to_tensor(
          locs, name='locs', dtype=dtype)
      self._slopes = tensor_util.convert_nonref_to_tensor(
          slopes, name='slopes', dtype=dtype)
      self._weight_fn = weight_fn
      super(ChangePoint, self).__init__(
          kernels[0].feature_ndims,
          dtype=dtype,
          name=name,
          validate_args=validate_args,
          parameters=parameters)

  @classmethod
  def _parameter_properties(cls, dtype, num_classes=None):
    from tensorflow_probability.python.bijectors import ascending  # pylint:disable=g-import-not-at-top
    from tensorflow_probability.python.bijectors import softplus  # pylint:disable=g-import-not-at-top
    return dict(
        kernels=parameter_properties.BatchedComponentProperties(
            event_ndims=lambda self: [0 for _ in self.kernels]),
        locs=parameter_properties.ParameterProperties(
            event_ndims=1,
            default_constraining_bijector_fn=lambda: ascending.Ascending()),  # pylint:disable=unnecessary-lambda
        slopes=parameter_properties.ParameterProperties(
            event_ndims=1,
            default_constraining_bijector_fn=(
                lambda: softplus.Softplus(low=dtype_util.eps(dtype)))))

  @property
  def kernels(self):
    return self._kernels

  @property
  def locs(self):
    return self._locs

  @property
  def slopes(self):
    return self._slopes

  @property
  def weight_fn(self):
    return self._weight_fn

  def _apply(self, x1, x2, example_ndims):
    locs = util.pad_shape_with_ones(self.locs, example_ndims, start=-2)
    slopes = util.pad_shape_with_ones(self.slopes, example_ndims, start=-2)

    weights_x1 = tf.math.sigmoid(
        slopes * (
            self.weight_fn(x1, self.feature_ndims)[..., tf.newaxis] - locs))
    weights_x2 = tf.math.sigmoid(
        slopes * (
            self.weight_fn(x2, self.feature_ndims)[..., tf.newaxis] - locs))

    initial_weights = (1. - weights_x1) * (1. - weights_x2)
    initial_weights = tf.concat([
        initial_weights,
        tf.ones_like(initial_weights[..., 0])[..., tf.newaxis]], axis=-1)
    end_weights = weights_x1 * weights_x2
    end_weights = tf.concat([
        tf.ones_like(end_weights[..., 0])[..., tf.newaxis],
        end_weights], axis=-1)

    results = [k.apply(x1, x2, example_ndims)[
        ..., tf.newaxis] for k in self.kernels]
    broadcasted_shape = distribution_util.get_broadcast_shape(*results)
    results = tf.concat(
        [ps.broadcast_to(r, broadcasted_shape) for r in results], axis=-1)
    return tf.math.reduce_sum(initial_weights * results * end_weights, axis=-1)

  def _matrix(self, x1, x2):
    locs = util.pad_shape_with_ones(self.locs, ndims=1, start=-2)
    slopes = util.pad_shape_with_ones(self.slopes, ndims=1, start=-2)

    weights_x1 = tf.math.sigmoid(
        slopes * (
            self.weight_fn(x1, self.feature_ndims)[..., tf.newaxis] - locs))
    weights_x1 = weights_x1[..., tf.newaxis, :]
    weights_x2 = tf.math.sigmoid(
        slopes * (
            self.weight_fn(x2, self.feature_ndims)[..., tf.newaxis] - locs))
    weights_x2 = weights_x2[..., tf.newaxis, :, :]

    initial_weights = (1. - weights_x1) * (1. - weights_x2)
    initial_weights = tf.concat([
        initial_weights,
        tf.ones_like(initial_weights[..., 0])[..., tf.newaxis]], axis=-1)
    end_weights = weights_x1 * weights_x2
    end_weights = tf.concat([
        tf.ones_like(end_weights[..., 0])[..., tf.newaxis],
        end_weights], axis=-1)

    results = [k.matrix(x1, x2)[..., tf.newaxis] for k in self.kernels]
    broadcasted_shape = distribution_util.get_broadcast_shape(*results)
    results = tf.concat(
        [ps.broadcast_to(r, broadcasted_shape) for r in results], axis=-1)
    return tf.math.reduce_sum(initial_weights * results * end_weights, axis=-1)

  def _parameter_control_dependencies(self, is_init):
    if is_init:
      # Check that locs and slopes have the same last dimension.
      if (self.locs.shape is not None and
          self.locs.shape[-1] is not None and
          self.slopes.shape is not None and
          self.slopes.shape[-1] is not None):
        k = self.locs.shape[-1]
        l = self.slopes.shape[-1]
        if not(k == l or k == 1 or l == 1):
          raise ValueError(
              'Expect that `locs` and `slopes` are broadcastable.')

      if self.locs.shape is not None and self.locs.shape[-1] is not None:
        if not (len(self.kernels) == self.locs.shape[-1] + 1 or
                self.locs.shape[-1] == 1):
          raise ValueError(
              'Expect that `locs` has last dimension `1` or `N - 1` where '
              f'`N` is the number of kernels, but got {self.locs.shape[-1]}')

      if self.slopes.shape is not None and self.slopes.shape[-1] is not None:
        if not (len(self.kernels) == self.slopes.shape[-1] + 1 or
                self.slopes.shape[-1] == 1):
          raise ValueError(
              'Expect that `slopes` has last dimension `1` or `N - 1` where '
              f'`N` is the number of kernels, but got {self.slopes.shape[-1]}')

    assertions = []
    if not self.validate_args:
      return assertions

    if is_init != tensor_util.is_ref(self.locs):
      locs = tf.convert_to_tensor(self.locs)

      assertions.append(
          assert_util.assert_greater(
              locs[..., 1:], locs[..., :-1],
              message='Expect that elements of `locs` are ascending.'))

    if is_init != tensor_util.is_ref(self.slopes):
      slopes = tf.convert_to_tensor(self.slopes)
      assertions.append(assert_util.assert_positive(
          slopes, message='`slopes` must be positive.'))

    return assertions


text:
package me.simple.cms.controller;

import javax.validation.groups.Get;
import javax.validation.groups.Remove;
import javax.validation.groups.Save;
import javax.validation.groups.Update;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import me.simple.cms.service.TagService;
import me.simple.common.entity.Pagination;
import me.simple.common.entity.Tag;

@Controller
@RequestMapping(value = "cms/tag")
public class TagController {

    @Autowired
    private TagService tagService;
//    @Autowired
//    private MessageSource messageSource;

    @RequestMapping(value = { "" }, method = RequestMethod.GET)
    public String index(Tag tag, Pagination<Tag> pagination, Model model) {
	/* BindingResult bindingResult, */
	tagService.queryTag(tag, pagination);
	model.addAttribute("pagination", pagination);
	return "cms/tag_index";
    }

    @RequestMapping(value = { "create" }, method = RequestMethod.GET)
    public String create(Tag tag, BindingResult bindingResult, Model model) {
	if (!bindingResult.hasErrors()) {
	    model.addAttribute(tag);
	}
	return "cms/tag_create";
    }

    @RequestMapping(value = { "save" }, method = RequestMethod.POST)
    public String save(@Validated(value = { Save.class }) Tag tag, BindingResult bindingResult, Model model) {
	if (!bindingResult.hasErrors()) {
	    tagService.saveTag(tag);
	} else {
	    return "cms/tag_create";
	}
	return "redirect:/cms/tag";
    }

    @RequestMapping(value = { "edit" }, method = RequestMethod.GET)
    public String edit(@Validated(value = { Get.class }) Tag tag, BindingResult bindingResult, Model model) {
	if (!bindingResult.hasErrors()) {
	    model.addAttribute(tagService.getTag(tag.getTagname()));
	}
	return "cms/tag_edit";
    }

    @RequestMapping(value = { "update" }, method = RequestMethod.POST)
    public String update(@Validated(value = { Update.class }) Tag tag, BindingResult bindingResult, Model model) {
	if (!bindingResult.hasErrors()) {
	    model.addAttribute(tagService.updateTag(tag));
	} else {
	    return "cms/tag_edit";
	}
	return "redirect:/cms/tag";
    }

    @RequestMapping(value = { "remove" }, method = RequestMethod.POST)
    public String remove(@Validated(value = { Remove.class }) Tag tag, BindingResult bindingResult, Model model) {
	if (!bindingResult.hasErrors()) {
	    tagService.removeTag(tag.getTagname());
	}
	return "redirect:/cms/tag";
    }

}


text:
/*
 * Controlls the behaviour of the ask modal
 */

"use strict";
define( [
	"models/User",
	"text!template/ask-modal.html",
	"models/Question",
	"modalReset"
], function( User, askModalTemplate, Question ) {

$( "body" ).append( askModalTemplate );

function validateFields( e ) {
	var $input = $( e.target ),
		inputValue = $input.val().trim(),
		hasError = false;

	if ( !inputValue ) {
		$input
			.attr( "placeholder", "Field is required!" )
			.parent()
			.addClass( "has-error" );
	} else {
		hasError = $input.is( "[name='title']" ) && inputValue.length > Question.MAX_TITLE_LENGTH;
		hasError = $input.is( "[name='content']" ) && inputValue.length > Question.MAX_CONTENT_LENGTH;

		if ( hasError ) {
			$input
				.attr( "placeholder", "Maximum length is " + Question.MAX_TITLE_LENGTH )
				.parent()
				.addClass( "has-error" );
		} else {
			$input
				.parent()
				.removeClass( "has-error" )
				.addClass( "has-success" );
		}
	}
}

$( "#ask-form" )
	.on( "submit", function( e ) {
		e.preventDefault();
		e.stopPropagation();

		var formData = $( this ).serializeArray(),
			question = new Question(),
			hasError = false;

		formData.forEach(function( data ) {
			question[ data.name ] = data.value;

			if ( data.name === "tags" ) {
				var tags = data.value.split( "," );

				for ( var i = 0, len = tags.length; i < len; i++ ) {
					if ( tags[ i ].trim().length > Question.MAX_TAG_LENGTH ) {
						$( "#ask-form input[name='tags']" )
							.text( "Maximum tag length is " + Question.MAX_TAG_LENGTH )
							.parent()
							.addClass( "has-success" );
						hasError = true;
						break;
					}
				}

				question[ data.name ] = tags;
			}
		});

		if ( hasError ) {
			return;
		}

		try {
			question.save().done(function() {
				window.location.hash = "/forum/view/" + question.objectId
				$( "#ask-modal" ).modal( "hide" );
			});
		} catch ( er ) {
			$( "#ask-form input, #ask-form textarea" ).trigger( "blur" );
		}

	})
	.on( "blur", "input, textarea", validateFields );
});


text:
function run_test() {
  var ios = Components.classes["@mozilla.org/network/io-service;1"].
            getService(Components.interfaces.nsIIOService);

  var dataFile = do_get_file("data/bug121341.properties");

  var channel = ios.newChannelFromURI(ios.newFileURI(dataFile, null, null));
  var inp = channel.open();

  var properties = Components.classes["@mozilla.org/persistent-properties;1"].
                   createInstance(Components.interfaces.nsIPersistentProperties);
  properties.load(inp);

  var value;

  value = properties.getStringProperty("1");
  do_check_eq(value, "abc");

  value = properties.getStringProperty("2");
  do_check_eq(value, "xy");

  value = properties.getStringProperty("3");
  do_check_eq(value, "\u1234\t\r\n\u00AB\u0001\n");

  value = properties.getStringProperty("4");
  do_check_eq(value, "this is multiline property");

  value = properties.getStringProperty("5");
  do_check_eq(value, "this is another multiline property");

  value = properties.getStringProperty("6");
  do_check_eq(value, "test\u0036");

  value = properties.getStringProperty("7");
  do_check_eq(value, "yet another multiline propery");

  value = properties.getStringProperty("8");
  do_check_eq(value, "\ttest5\u0020");

  value = properties.getStringProperty("9");
  do_check_eq(value, " test6\t");

  value = properties.getStringProperty("10a\u1234b");
  do_check_eq(value, "c\uCDEFd");

  value = properties.getStringProperty("11");
  do_check_eq(value, "\uABCD");

  dataFile = do_get_file("data/bug121341-2.properties");

  channel = ios.newChannelFromURI(ios.newFileURI(dataFile, null, null));
  inp = channel.open();

  var properties2 = Components.classes["@mozilla.org/persistent-properties;1"].
                    createInstance(Components.interfaces.nsIPersistentProperties);
  try {
    properties2.load(inp);
    do_throw("load() didn't fail");
  }
  catch (e) {
  }
}


text:
'use strict';

import gulp from 'gulp';
import gutil from 'gulp-util';
import webpack  from 'webpack';
import webpackDevMiddelware from 'webpack-dev-middleware';
import webpackHotMiddelware from 'webpack-hot-middleware';
import browserSync from 'browser-sync';
import supportsColor from 'supports-color';

import config from './tasks/config';
import copyTemplate from './tasks/copy-template';
import deployWidgets from './tasks/deploy-widgets';

import webpackDistConfig from './webpack.dist.config';
import webpackConfig from './webpack.config';

/**
 * Bundles application modules with webpack
 */
function compile(done) {
  webpack(webpackDistConfig, (err, stats) => {
    if(err)  {
      throw new gutil.PluginError("webpack", err);
    }

    gutil.log("[webpack]", stats.toString({
      colors: supportsColor,
      chunks: false,
      errorDetails: true
    }));

    done();
  });
}

/**
 * Starts webpack dev server
 */
function serve() {
  const compiler = webpack(webpackConfig);

  browserSync({
    port: process.env.PORT || 3000,
    open: false,
    server: { baseDir: config.paths.root },
    https: true,
    middleware: [
      webpackDevMiddelware(compiler, {
        stats: {
          colors: supportsColor,
          chunks: false,
          modules: false
        },
        publicPath: webpackDistConfig.output.publicPath
      }),
      webpackHotMiddelware(compiler)
    ]
  });
}

/**
 * Deploys new component template
 */
function copyComponent() {
  return copyTemplate('component');
}

/**
 * Deploys new service template
 */
function copyService() {
  return copyTemplate('service');
}

gulp.task('default', serve);
gulp.task('serve', serve);

gulp.task('webpack', compile);
gulp.task('build', compile);

gulp.task('component', copyComponent);
gulp.task('service', copyService);

/**
 * Uploads the built widgets to a EVRYTHNG File entity.
 */
gulp.task('publish', gulp.series(compile, deployWidgets));