text:
OverlayMediaNotificationsManager::OverlayMediaNotificationsManager(
    MediaNotificationService* service)
    : service_(service) {
  DCHECK(service_);
}

OverlayMediaNotificationsManager::~OverlayMediaNotificationsManager() {
  overlay_notifications_.clear();
}

void OverlayMediaNotificationsManager::ShowOverlayNotification(
    const std::string& id,
    std::unique_ptr<OverlayMediaNotification> overlay_notification) {
  DCHECK(overlay_notification);
  OverlayMediaNotification* notification = overlay_notification.get();
  overlay_notifications_.insert({id, std::move(overlay_notification)});
  notification->SetManager(this);
  notification->ShowNotification();
}

void OverlayMediaNotificationsManager::CloseOverlayNotification(
    const std::string& id) {
  auto it = overlay_notifications_.find(id);
  if (it == overlay_notifications_.end())
    return;
  it->second->CloseNotification();
}

void OverlayMediaNotificationsManager::OnOverlayNotificationClosed(
    const std::string& id) {
  service_->OnOverlayNotificationClosed(id);

  // Warning: after this call, |id| is not safe to use since this deletes the
  // caller.
  overlay_notifications_.erase(id);
}


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

	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Keep Australia Beautiful Council Website - Planned Outage</title>

Keep Australia Beautiful Council Website

Planned Outage

				The Keep Australia Beautiful Council Website is temporarily unavailable due to planned maintenance.

We apologise for any inconvenience.

redpajama_set_name: RedPajamaGithub


text:
@interface ATCPasswordPromptViewController : NSViewController <NSTextFieldDelegate>

#pragma mark - Outlets

@property ( weak ) IBOutlet NSSecureTextField* passwordSecureField;
@property ( weak ) IBOutlet NSButton* unlockButton;

#pragma mark - IBActions

- ( IBAction ) unlockAction: ( id )_Sender;

@end // ATCPasswordPromptViewController class


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>me.hfox</groupId>
    <artifactId>morphix</artifactId>
    <version>1.6.5</version>
    <url>https://github.com/ParaPenguin/Morphix</url>

    <distributionManagement>
        <repository>
            <id>komp-releases</id>
            <url>http://pomhub.uk/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>komp-snapshots</id>
            <url>http://pomhub.uk/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>2.13.1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
$LOAD_PATH << "."

require 'app/presenters/user_presenter'
require 'timecop'

describe UserPresenter do
  let(:user) { stub(:user) }

  describe "#pairing_preference" do
    subject { UserPresenter.new(user, nil).pairing_preference }

    it "makes 'Both' appear as 'Local or Remote'" do
      user.stub(:remote_local_preference).and_return('Both')
      subject.should == "Local or Remote"
    end

    ["Local", "Remote"].each do |preference|
      it "returns #{preference} unchanged" do
        user.stub(:remote_local_preference).and_return(preference)
        subject.should == preference
      end
    end
  end

  describe "#available_now?" do
    before do
      Timecop.freeze(Time.now)
    end

    after do
      Timecop.return
    end

    subject { UserPresenter.new(user, nil).available_now? }

    it "is available when the last available time is <= 2 hours ago" do
      two_hours_ago = Time.now - (2 * 60 * 60)
      user.stub(:last_available_time).and_return(two_hours_ago)
      subject.should be_true
    end

    it "is not available when the last available time is > 2 hours ago" do
      two_hours_one_minute_ago = Time.now - (2 * 60 * 60) - 60
      user.stub(:last_available_time).and_return(two_hours_one_minute_ago)
      subject.should be_false
    end

    it "is not available when the last available time is nil" do
      user.stub(:last_available_time).and_return(nil)
      subject.should be_false
    end
  end
end


text:
namespace net::tcp {

template <typename Ptr_type> class Packet4_v;
using Packet4_view = Packet4_v<net::Packet_ptr>;
using Packet4_view_raw = Packet4_v<net::Packet*>;

template <typename Ptr_type>
class Packet4_v : public Packet_v<Ptr_type> {
public:
  Packet4_v(Ptr_type ptr)
    : Packet_v<Ptr_type>(std::move(ptr))
  {
    Expects(packet().is_ipv4());
    this->set_header(packet().ip_data().data());
  }

  inline void init();

  uint16_t compute_tcp_checksum() const noexcept override
  { return calculate_checksum4(*this); }

  Protocol ipv() const noexcept override
  { return Protocol::IPv4; }

  ip4::Addr ip4_src() const noexcept
  { return packet().ip_src(); }

  ip4::Addr ip4_dst() const noexcept
  { return packet().ip_dst(); }

private:
  PacketIP4& packet() noexcept
  { return static_cast<PacketIP4&>(*this->pkt); }

  const PacketIP4& packet() const noexcept
  { return static_cast<PacketIP4&>(*this->pkt); }

  void set_ip_src(const net::Addr& addr) noexcept override
  { packet().set_ip_src(addr.v4()); }

  void set_ip_dst(const net::Addr& addr) noexcept override
  { packet().set_ip_dst(addr.v4()); }

  net::Addr ip_src() const noexcept override
  { return packet().ip_src(); }

  net::Addr ip_dst() const noexcept override
  { return packet().ip_dst(); }

  uint16_t ip_data_length() const noexcept override
  { return packet().ip_data_length(); }

  uint16_t ip_header_length() const noexcept override
  { return packet().ip_header_length(); }

};

template <typename Ptr_type>
inline void Packet4_v<Ptr_type>::init()
{
  // clear TCP header
  memset(this->header, 0, sizeof(tcp::Header));

  this->set_win(tcp::default_window_size);
  this->header->offset_flags.offset_reserved = (5 << 4);

  this->set_length();
}

}


text:
<?php

namespace app\master\controllers;

use Yii;
use app\master\models\MasterMember;
use app\master\models\MasterMemberSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use app\master\models\MemberDetail;
/**
 * MasterMemberController implements the CRUD actions for MasterMember model.
 */
class MasterMemberController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    // 'delete' => ['POST'],
                ],
            ],
        ];
    }

    /**
     * Lists all MasterMember models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new MasterMemberSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single MasterMember model.
     * @param string $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new MasterMember model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new MasterMember();

        if ($model->load(Yii::$app->request->post())) {
            $model->DateCrt = date('Y-m-d h:i:s');
            $model->save();
            return $this->redirect(['index']);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    public function actionDetail($id)
    {

        if(Yii::$app->request->post())
        {
            $request = Yii::$app->request;
            $jenis = $request->post('jenis');
            $jumlah = $request->post('jumlah');
            $datebuy = date('Y-m-d',strtotime($request->post('datebuy')));
            $datecrt = date('Y-m-d h:i:s');

            $db = Yii::$app->db->createCommand("insert into MemberDetail (MemberId,Date,JenisId,Qty,DateCrt) values ('$id','$datebuy','$jenis','$jumlah','$datecrt')");
            $db->execute();

            return $this->redirect(['index']);
        } else {
            return $this->render('_detail',['id' => $id]);
        }

    }

    /**
     * Updates an existing MasterMember model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param string $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->MemberId]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing MasterMember model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param string $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $del = Yii::$app->db->createCommand("delete from MasterMember where MemberId = $id");
        $deld = Yii::$app->db->createCommand("delete from MemberDetail where MemberId = $id");

        $deld->execute();
        $del->execute();

        return $this->redirect(['index']);
    }

    /**
     * Finds the MasterMember model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param string $id
     * @return MasterMember the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = MasterMember::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

    public function actionCountup($id)
    {
        $model = $this->findModel($id);
        $countnow = $model->CountBuy;

        $model->CountBuy = $countnow + 1;
        $model->save();

        return $this->redirect(['index']);
    }
}


text:
<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>jQuery.Coverflow</title>

		<link href="https://google-code-prettify.googlecode.com/svn/loader/prettify.css" rel="stylesheet" type="text/css"/>

Examples

				Try it yourself…

Quick start (look in console)

					//HTML

Unittest

				jQuery.tristate comes with a complete set of QUnit-based unittests.

				Click here to run the tests in a new window: Unittests

			Copyright © 2013-2014 Martijn van der Lee. MIT Open Source license applies.


text:
package storage

import (
	"bytes"
	"errors"
	"hash/crc64"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
)

// FileGetter is the interface for getting a stream of a file payload,
// addressed by name/filename. Presumably, the names will be scoped to relative
// file paths.
type FileGetter interface {
	// Get returns a stream for the provided file path
	Get(filename string) (output io.ReadCloser, err error)
}

// FilePutter is the interface for storing a stream of a file payload,
// addressed by name/filename.
type FilePutter interface {
	// Put returns the size of the stream received, and the crc64 checksum for
	// the provided stream
	Put(filename string, input io.Reader) (size int64, checksum []byte, err error)
}

// FileGetPutter is the interface that groups both Getting and Putting file
// payloads.
type FileGetPutter interface {
	FileGetter
	FilePutter
}

// NewPathFileGetter returns a FileGetter that is for files relative to path
// relpath.
func NewPathFileGetter(relpath string) FileGetter {
	return &pathFileGetter{root: relpath}
}

type pathFileGetter struct {
	root string
}

func (pfg pathFileGetter) Get(filename string) (io.ReadCloser, error) {
	return os.Open(filepath.Join(pfg.root, filename))
}

type bufferFileGetPutter struct {
	files map[string][]byte
}

func (bfgp bufferFileGetPutter) Get(name string) (io.ReadCloser, error) {
	if _, ok := bfgp.files[name]; !ok {
		return nil, errors.New("no such file")
	}
	b := bytes.NewBuffer(bfgp.files[name])
	return &readCloserWrapper{b}, nil
}

func (bfgp *bufferFileGetPutter) Put(name string, r io.Reader) (int64, []byte, error) {
	c := crc64.New(CRCTable)
	tRdr := io.TeeReader(r, c)
	b := bytes.NewBuffer([]byte{})
	i, err := io.Copy(b, tRdr)
	if err != nil {
		return 0, nil, err
	}
	bfgp.files[name] = b.Bytes()
	return i, c.Sum(nil), nil
}

type readCloserWrapper struct {
	io.Reader
}

func (w *readCloserWrapper) Close() error { return nil }

// NewBufferFileGetPutter is a simple in-memory FileGetPutter
//
// Implication is this is memory intensive...
// Probably best for testing or light weight cases.
func NewBufferFileGetPutter() FileGetPutter {
	return &bufferFileGetPutter{
		files: map[string][]byte{},
	}
}

// NewDiscardFilePutter is a bit bucket FilePutter
func NewDiscardFilePutter() FilePutter {
	return &bitBucketFilePutter{}
}

type bitBucketFilePutter struct {
}

func (bbfp *bitBucketFilePutter) Put(name string, r io.Reader) (int64, []byte, error) {
	c := crc64.New(CRCTable)
	tRdr := io.TeeReader(r, c)
	i, err := io.Copy(ioutil.Discard, tRdr)
	return i, c.Sum(nil), err
}

// CRCTable is the default table used for crc64 sum calculations
var CRCTable = crc64.MakeTable(crc64.ISO)


text:
require 'rails_helper'

module Chainub
  RSpec.describe TriggerChannelsController, type: :controller do
    describe "GET index" do
      routes { Chainub::Engine.routes }
      subject { get :index }
      it { should be_success }
    end

    describe "GET new" do
      routes { Chainub::Engine.routes }
      login_user
      subject { get :new }
      it { should be_success }
    end
  end
end


text:
package com.sangupta.colors;

import com.sangupta.colors.model.RGB;

/**
 * CSS3 color names as defined by Mozilla at
 * https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
 *
 * @author sangupta
 * @since 1.0.0
 */
public interface CSS3Colors {

	/**
	 * Color Alice Blue
	 */
	public static final RGB ALICE_BLUE = new RGB("#f0f8ff");

	/**
	 * Color Antique White
	 */
	public static final RGB ANTIQUE_WHITE = new RGB("#faebd7");

	/**
	 * Color Aqua
	 */
	public static final RGB AQUA = new RGB("#00ffff");

	/**
	 * Color Aqua Marine
	 */
	public static final RGB AQUA_MARINE = new RGB("#7fffd4");

	/**
	 * Color Azure
	 */
	public static final RGB AZURE = new RGB("#f0ffff");

	/**
	 * Color Beige
	 */
	public static final RGB BEIGE = new RGB("#f5f5dc");

	/**
	 * Color Bisque
	 */
	public static final RGB BISQUE = new RGB("#ffe4c4");

	/**
	 * Color Black
	 */
	public static final RGB BLACK = new RGB("#000000");

	/**
	 * Color Blanched Almond
	 */
	public static final RGB BLANCHED_ALMOND = new RGB("#ffebcd");

	/**
	 * Color Blue
	 */
	public static final RGB BLUE = new RGB("#0000ff");

	/**
	 * Color Blue Violet
	 */
	public static final RGB BLUE_VIOLET = new RGB("#8a2be2");

	/**
	 * Color Brown
	 */
	public static final RGB BROWN = new RGB("#a52a2a");

	/**
	 * Color Burly Wood
	 */
	public static final RGB BURLY_WOOD = new RGB("#deb887");

	/**
	 * Color Cadet Blue
	 */
	public static final RGB CADET_BLUE = new RGB("#5f9ea0");

	/**
	 * Color Chart Reuse
	 */
	public static final RGB CHART_REUSE = new RGB("#7fff00");

	/**
	 * Color Chocolate
	 */
	public static final RGB CHOCOLATE = new RGB("#d2691e");

	/**
	 * Color Coral
	 */
	public static final RGB CORAL = new RGB("#ff7f50");

	/**
	 * Color Corn Flower Blue
	 */
	public static final RGB CORN_FLOWER_BLUE = new RGB("#6495ed");

	/**
	 * Color Corn Silk
	 */
	public static final RGB CORN_SILK = new RGB("#fff8dc");

	/**
	 * Color Crimson
	 */
	public static final RGB CRIMSON = new RGB("#dc143c");

	/**
	 * Color Cyan
	 */
	public static final RGB CYAN = new RGB("#00ffff");

	/**
	 * Color Dark Blue
	 */
	public static final RGB DARK_BLUE = new RGB("#00008b");

	/**
	 * Color Dark Cyan
	 */
	public static final RGB DARK_CYAN = new RGB("#008b8b");

	/**
	 * Color Dark Golden Rod
	 */
	public static final RGB DARK_GOLDEN_ROD = new RGB("#b8860b");

	/**
	 * Color Dark Gray
	 */
	public static final RGB DARK_GRAY = new RGB("#a9a9a9");

	/**
	 * Color Dark Grey
	 */
	public static final RGB DARK_GREY = new RGB("#a9a9a9");

	/**
	 * Color Dark Green
	 */
	public static final RGB DARK_GREEN = new RGB("#006400");

	/**
	 * Color Dark Khaki
	 */
	public static final RGB DARK_KHAKI = new RGB("#bdb76b");

	/**
	 * Color Dark Magenta
	 */
	public static final RGB DARK_MAGENTA = new RGB("#8b008b");

	/**
	 * Color Dark Olive Grene
	 */
	public static final RGB DARK_OLIVE_GREEN = new RGB("#556b2f");

	/**
	 * Color Dark Orange
	 */
	public static final RGB DARK_ORANGE = new RGB("#ff8c00");

	/**
	 * Color Dark Orchid
	 */
	public static final RGB DARK_ORCHID = new RGB("#9932cc");

	/**
	 * Color Dark Red
	 */
	public static final RGB DARK_RED = new RGB("#8b0000");

	/**
	 * Color Dark Salmon
	 */
	public static final RGB DARK_SALMON = new RGB("#e9967a");

	/**
	 * Color Dark Sea Green
	 */
	public static final RGB DARK_SEA_GREEN = new RGB("#8fbc8f");

	/**
	 * Color Dark Slate Blue
	 */
	public static final RGB DARK_SLATE_BLUE = new RGB("#483d8b");

	/**
	 * Color Dark Slate Gray
	 */
	public static final RGB DARK_SLATE_GRAY = new RGB("#2f4f4f");

	/**
	 * Color Dark Slate Grey
	 */
	public static final RGB DARK_SLATE_GREY = new RGB("#2f4f4f");

	/**
	 * Color Dark Turquoise
	 */
	public static final RGB DARK_TURQUOISE = new RGB("#00ced1");

	/**
	 * Color Dark Violet
	 */
	public static final RGB DARK_VIOLET = new RGB("#9400d3");

	/**
	 * Color Deep Pink
	 */
	public static final RGB DEEP_PINK = new RGB("#ff1493");

	/**
	 * Color Deep Sky Blue
	 */
	public static final RGB DEEP_SKY_BLUE = new RGB("#00bfff");

	/**
	 * Color Dim Gray
	 */
	public static final RGB DIM_GRAY = new RGB("#696969");

	/**
	 * Color Dim Grey
	 */
	public static final RGB DIM_GREY = new RGB("#696969");

	/**
	 * Color Dodge Blue
	 */
	public static final RGB DODGER_BLUE = new RGB("#1e90ff");

	/**
	 * Color Fire Brick
	 */
	public static final RGB FIRE_BRICK = new RGB("#b22222");

	/**
	 * Color Floral White
	 */
	public static final RGB FLORAL_WHITE = new RGB("#fffaf0");

	/**
	 * Color Forest Green
	 */
	public static final RGB FOREST_GREEN = new RGB("#228b22");

	/**
	 * Color Fuchsia
	 */
	public static final RGB FUCHSIA = new RGB("#ff00ff");

	/**
	 * Color Gains Boro
	 */
	public static final RGB GAINS_BORO = new RGB("#dcdcdc");

	/**
	 * Color Ghost White
	 */
	public static final RGB GHOST_WHITE = new RGB("#f8f8ff");

	/**
	 * Color Gold
	 */
	public static final RGB GOLD = new RGB("#ffd700");

	/**
	 * Color Golden Rod
	 */
	public static final RGB GOLDEN_ROD = new RGB("#daa520");

	/**
	 * Color Gray
	 */
	public static final RGB GRAY = new RGB("#808080");

	/**
	 * Color Grey
	 */
	public static final RGB GREY = new RGB("#808080");

	/**
	 * Color Green
	 */
	public static final RGB GREEN = new RGB("#008000");

	/**
	 * Color Green Yellow
	 */
	public static final RGB GREEN_YELLOW = new RGB("#adff2f");

	/**
	 * Color Honey Dew
	 */
	public static final RGB HONEY_DEW = new RGB("#f0fff0");

	/**
	 * Color Hot Pink
	 */
	public static final RGB HOT_PINK = new RGB("#ff69b4");

	/**
	 * Color Indian Red
	 */
	public static final RGB INDIAN_RED = new RGB("#cd5c5c");

	/**
	 * Color Indigo
	 */
	public static final RGB INDIGO = new RGB("#4b0082");

	/**
	 * Color Ivory
	 */
	public static final RGB IVORY = new RGB("#fffff0");

	/**
	 * Color Khaki
	 */
	public static final RGB KHAKI = new RGB("#f0e68c");

	/**
	 * Color Lavender
	 */
	public static final RGB LAVENDER = new RGB("#e6e6fa");

	/**
	 * Color Lavendar Blush
	 */
	public static final RGB LAVENDER_BLUSH = new RGB("#fff0f5");

	/**
	 * Color Lawn Green
	 */
	public static final RGB LAWN_GREEN = new RGB("#7cfc00");

	/**
	 * Color Lemon Chiffon
	 */
	public static final RGB LEMON_CHIFFON = new RGB("#fffacd");

	/**
	 * Color Light Blue
	 */
	public static final RGB LIGHT_BLUE = new RGB("#add8e6");

	/**
	 * Color Light Coral
	 */
	public static final RGB LIGHT_CORAL = new RGB("#f08080");

	/**
	 * Color Light Cyan
	 */
	public static final RGB LIGHT_CYAN = new RGB("#e0ffff");

	/**
	 * Color Light Golden Rod Yello
	 */
	public static final RGB LIGHT_GOLDEN_ROD_YELLOW = new RGB("#fafad2");

	/**
	 * Color Light Gray
	 */
	public static final RGB LIGHT_GRAY = new RGB("#d3d3d3");

	/**
	 * Color Light Grey
	 */
	public static final RGB LIGHT_GREY = new RGB("#d3d3d3");

	/**
	 * Color Light Green
	 */
	public static final RGB LIGHT_GREEN = new RGB("#90ee90");

	/**
	 * Color Light Pink
	 */
	public static final RGB LIGHT_PINK = new RGB("#ffb6c1");

	/**
	 * Color Light Salmon
	 */
	public static final RGB LIGHT_SALMON = new RGB("#ffa07a");

	/**
	 * Color Light Sea Green
	 */
	public static final RGB LIGHT_SEA_GREEN = new RGB("#20b2aa");

	/**
	 * Color Light Sky Blue
	 */
	public static final RGB LIGHT_SKY_BLUE = new RGB("#87cefa");

	/**
	 * Color Light Slate Gray
	 */
	public static final RGB LIGHT_SLATE_GRAY = new RGB("#778899");

	/**
	 * Color Light Slate Grey
	 */
	public static final RGB LIGHT_SLATE_GREY = new RGB("#778899");

	/**
	 * Color Light Steel Blue
	 */
	public static final RGB LIGHT_STEEL_BLUE = new RGB("#b0c4de");

	/**
	 * Color Light Yellow
	 */
	public static final RGB LIGHT_YELLOW = new RGB("#ffffe0");

	/**
	 * Color Lime
	 */
	public static final RGB LIME = new RGB("#00ff00");

	/**
	 * Color
	 */
	public static final RGB LIME_GREEN = new RGB("#32cd32");

	/**
	 * Color Linen
	 */
	public static final RGB LINEN = new RGB("#faf0e6");

	/**
	 * Color Magenta
	 */
	public static final RGB MAGENTA = new RGB("#ff00ff");

	/**
	 * Color Maroon
	 */
	public static final RGB MAROON = new RGB("#800000");

	/**
	 * Color Medium Aqua Marine
	 */
	public static final RGB MEDIUM_AQUA_MARINE = new RGB("#66cdaa");

	/**
	 * Color Medium Blue
	 */
	public static final RGB MEDIUM_BLUE = new RGB("#0000cd");

	/**
	 * Color Medium Orchid
	 */
	public static final RGB MEDIUM_ORCHID = new RGB("#ba55d3");

	/**
	 * Color Medium Purple
	 */
	public static final RGB MEDIUM_PURPLE = new RGB("#9370d8");

	/**
	 * Color Medium Sea Green
	 */
	public static final RGB MEDIUM_SEA_GREEN = new RGB("#3cb371");

	/**
	 * Color Medium Slate Blue
	 */
	public static final RGB MEDIUM_SLATE_BLUE = new RGB("#7b68ee");

	/**
	 * Color Medium Spring Green
	 */
	public static final RGB MEDIUM_SPRING_GREEN = new RGB("#00fa9a");

	/**
	 * Color Medium Turquoise
	 */
	public static final RGB MEDIUM_TURQUOISE = new RGB("#48d1cc");

	/**
	 * Color Medium Violet Red
	 */
	public static final RGB MEDIUM_VIOLET_RED = new RGB("#c71585");

	/**
	 * Color Midnight Blue
	 */
	public static final RGB MIDNIGHT_BLUE = new RGB("#191970");

	/**
	 * Color Mint Cream
	 */
	public static final RGB MINT_CREAM = new RGB("#f5fffa");

	/**
	 * Color Misty Rose
	 */
	public static final RGB MISTY_ROSE = new RGB("#ffe4e1");

	/**
	 * Color Moccasin
	 */
	public static final RGB MOCCASIN = new RGB("#ffe4b5");

	/**
	 * Color Navajo White
	 */
	public static final RGB NAVAJO_WHITE = new RGB("#ffdead");

	/**
	 * Color Navy
	 */
	public static final RGB NAVY = new RGB("#000080");

	/**
	 * Color Old Lace
	 */
	public static final RGB OLD_LACE = new RGB("#fdf5e6");

	/**
	 * Color Olive
	 */
	public static final RGB OLIVE = new RGB("#808000");

	/**
	 * Color Olive Drab
	 */
	public static final RGB OLIVE_DRAB = new RGB("#6b8e23");

	/**
	 * Color Orange
	 */
	public static final RGB ORANGE = new RGB("#ffa500");

	/**
	 * Color Red
	 */
	public static final RGB ORANGE_RED = new RGB("#ff4500");

	/**
	 * Color Orchid
	 */
	public static final RGB ORCHID = new RGB("#da70d6");

	/**
	 * Color Pale Golden Rod
	 */
	public static final RGB PALE_GOLDEN_ROD = new RGB("#eee8aa");

	/**
	 * Color Pale Green
	 */
	public static final RGB PALE_GREEN = new RGB("#98fb98");

	/**
	 * Color Pale Turquoise
	 */
	public static final RGB PALE_TURQUOISE = new RGB("#afeeee");

	/**
	 * Color Pale Violet Red
	 */
	public static final RGB PALE_VIOLET_RED = new RGB("#d87093");

	/**
	 * Color Papaya Whip
	 */
	public static final RGB PAPAYA_WHIP = new RGB("#ffefd5");

	/**
	 * Color Peach Puff
	 */
	public static final RGB PEACH_PUFF = new RGB("#ffdab9");

	/**
	 * Color Peru
	 */
	public static final RGB PERU = new RGB("#cd853f");

	/**
	 * Color Pink
	 */
	public static final RGB PINK = new RGB("#ffc0cb");

	/**
	 * Color Plum
	 */
	public static final RGB PLUM = new RGB("#dda0dd");

	/**
	 * Color Powder Blue
	 */
	public static final RGB POWDER_BLUE = new RGB("#b0e0e6");

	/**
	 * Color Purple
	 */
	public static final RGB PURPLE = new RGB("#800080");

	/**
	 * Color Red
	 */
	public static final RGB RED = new RGB("#ff0000");

	/**
	 * Color Rosy Brown
	 */
	public static final RGB ROSY_BROWN = new RGB("#bc8f8f");

	/**
	 * Color Royal Blue
	 */
	public static final RGB ROYAL_BLUE = new RGB("#4169e1");

	/**
	 * Color Saddle Brown
	 */
	public static final RGB SADDLE_BROWN = new RGB("#8b4513");

	/**
	 * Color Salmon
	 */
	public static final RGB SALMON = new RGB("#fa8072");

	/**
	 * Color Sandy Brown
	 */
	public static final RGB SANDY_BROWN = new RGB("#f4a460");

	/**
	 * Color Sea Green
	 */
	public static final RGB SEA_GREEN = new RGB("#2e8b57");

	/**
	 * Color Sea Shell
	 */
	public static final RGB SEA_SHELL = new RGB("#fff5ee");

	/**
	 * Color Sienna
	 */
	public static final RGB SIENNA = new RGB("#a0522d");

	/**
	 * Color Silver
	 */
	public static final RGB SILVER = new RGB("#c0c0c0");

	/**
	 * Color Sky Blue
	 */
	public static final RGB SKY_BLUE = new RGB("#87ceeb");

	/**
	 * Color Slate Blue
	 */
	public static final RGB SLATE_BLUE = new RGB("#6a5acd");

	/**
	 * Color Slate Gray
	 */
	public static final RGB SLATE_GRAY = new RGB("#708090");

	/**
	 * Color Slate Grey
	 */
	public static final RGB SLATE_GREY = new RGB("#708090");

	/**
	 * Color Snow
	 */
	public static final RGB SNOW = new RGB("#fffafa");

	/**
	 * Color Spring Green
	 */
	public static final RGB SPRING_GREEN = new RGB("#00ff7f");

	/**
	 * Color Steel Blue
	 */
	public static final RGB STEEL_BLUE = new RGB("#4682b4");

	/**
	 * Color Tan
	 */
	public static final RGB TAN = new RGB("#d2b48c");

	/**
	 * Color Teal
	 */
	public static final RGB TEAL = new RGB("#008080");

	/**
	 * Color Thistle
	 */
	public static final RGB THISTLE = new RGB("#d8bfd8");

	/**
	 * Color Tomato
	 */
	public static final RGB TOMATO = new RGB("#ff6347");

	/**
	 * Color Turquoise
	 */
	public static final RGB TURQUOISE = new RGB("#40e0d0");

	/**
	 * Color Violet
	 */
	public static final RGB VIOLET = new RGB("#ee82ee");

	/**
	 * Color Wheat
	 */
	public static final RGB WHEAT = new RGB("#f5deb3");

	/**
	 * Color White
	 */
	public static final RGB WHITE = new RGB("#ffffff");

	/**
	 * Color White Smoke
	 */
	public static final RGB WHITE_SMOKE = new RGB("#f5f5f5");

	/**
	 * Color Yellow
	 */
	public static final RGB YELLOW = new RGB("#ffff00");

	/**
	 * Color Yellow Green
	 */
	public static final RGB YELLOW_GREEN = new RGB("#9acd32");

}


text:
package com.google.cloud.tools.jib.image.json;

import com.google.cloud.tools.jib.api.DescriptorDigest;
import com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath;
import com.google.cloud.tools.jib.api.buildplan.Port;
import com.google.cloud.tools.jib.blob.Blob;
import com.google.cloud.tools.jib.blob.BlobDescriptor;
import com.google.cloud.tools.jib.blob.Blobs;
import com.google.cloud.tools.jib.configuration.DockerHealthCheck;
import com.google.cloud.tools.jib.hash.Digests;
import com.google.cloud.tools.jib.image.Image;
import com.google.cloud.tools.jib.image.Layer;
import com.google.cloud.tools.jib.image.LayerPropertyNotFoundException;
import com.google.cloud.tools.jib.json.JsonTemplate;
import com.google.cloud.tools.jib.json.JsonTemplateMapper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.io.Resources;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.DigestException;
import java.time.Duration;
import java.time.Instant;
import java.util.Arrays;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;

/** Tests for {@link ImageToJsonTranslator}. */
public class ImageToJsonTranslatorTest {

  private ImageToJsonTranslator imageToJsonTranslator;

  private void setUp(Class<? extends BuildableManifestTemplate> imageFormat)
      throws DigestException, LayerPropertyNotFoundException {
    Image.Builder testImageBuilder =
        Image.builder(imageFormat)
            .setCreated(Instant.ofEpochSecond(20))
            .setArchitecture("wasm")
            .setOs("js")
            .addEnvironmentVariable("VAR1", "VAL1")
            .addEnvironmentVariable("VAR2", "VAL2")
            .setEntrypoint(Arrays.asList("some", "entrypoint", "command"))
            .setProgramArguments(Arrays.asList("arg1", "arg2"))
            .setHealthCheck(
                DockerHealthCheck.fromCommand(ImmutableList.of("CMD-SHELL", "/checkhealth"))
                    .setInterval(Duration.ofSeconds(3))
                    .setTimeout(Duration.ofSeconds(1))
                    .setStartPeriod(Duration.ofSeconds(2))
                    .setRetries(3)
                    .build())
            .addExposedPorts(ImmutableSet.of(Port.tcp(1000), Port.tcp(2000), Port.udp(3000)))
            .addVolumes(
                ImmutableSet.of(
                    AbsoluteUnixPath.get("/var/job-result-data"),
                    AbsoluteUnixPath.get("/var/log/my-app-logs")))
            .addLabels(ImmutableMap.of("key1", "value1", "key2", "value2"))
            .setWorkingDirectory("/some/workspace")
            .setUser("tomcat");

    DescriptorDigest fakeDigest =
        DescriptorDigest.fromDigest(
            "sha256:8c662931926fa990b41da3c9f42663a537ccd498130030f9149173a0493832ad");
    testImageBuilder.addLayer(
        new Layer() {

          @Override
          public Blob getBlob() throws LayerPropertyNotFoundException {
            return Blobs.from("ignored");
          }

          @Override
          public BlobDescriptor getBlobDescriptor() throws LayerPropertyNotFoundException {
            return new BlobDescriptor(1000, fakeDigest);
          }

          @Override
          public DescriptorDigest getDiffId() throws LayerPropertyNotFoundException {
            return fakeDigest;
          }
        });
    testImageBuilder.addHistory(
        HistoryEntry.builder()
            .setCreationTimestamp(Instant.EPOCH)
            .setAuthor("Bazel")
            .setCreatedBy("bazel build ...")
            .setEmptyLayer(true)
            .build());
    testImageBuilder.addHistory(
        HistoryEntry.builder()
            .setCreationTimestamp(Instant.ofEpochSecond(20))
            .setAuthor("Jib")
            .setCreatedBy("jib")
            .build());
    imageToJsonTranslator = new ImageToJsonTranslator(testImageBuilder.build());
  }

  @Test
  public void testGetContainerConfiguration()
      throws IOException, URISyntaxException, DigestException {
    setUp(V22ManifestTemplate.class);

    // Loads the expected JSON string.
    Path jsonFile = Paths.get(Resources.getResource("core/json/containerconfig.json").toURI());
    String expectedJson = new String(Files.readAllBytes(jsonFile), StandardCharsets.UTF_8);

    // Translates the image to the container configuration and writes the JSON string.
    JsonTemplate containerConfiguration = imageToJsonTranslator.getContainerConfiguration();

    Assert.assertEquals(expectedJson, JsonTemplateMapper.toUtf8String(containerConfiguration));
  }

  @Test
  public void testGetManifest_v22() throws URISyntaxException, IOException, DigestException {
    setUp(V22ManifestTemplate.class);
    testGetManifest(V22ManifestTemplate.class, "core/json/translated_v22manifest.json");
  }

  @Test
  public void testGetManifest_oci() throws URISyntaxException, IOException, DigestException {
    setUp(OciManifestTemplate.class);
    testGetManifest(OciManifestTemplate.class, "core/json/translated_ocimanifest.json");
  }

  @Test
  public void testPortListToMap() {
    ImmutableSet<Port> input = ImmutableSet.of(Port.tcp(1000), Port.udp(2000));
    ImmutableSortedMap<String, Map<?, ?>> expected =
        ImmutableSortedMap.of("1000/tcp", ImmutableMap.of(), "2000/udp", ImmutableMap.of());
    Assert.assertEquals(expected, ImageToJsonTranslator.portSetToMap(input));
  }

  @Test
  public void testVolumeListToMap() {
    ImmutableSet<AbsoluteUnixPath> input =
        ImmutableSet.of(
            AbsoluteUnixPath.get("/var/job-result-data"),
            AbsoluteUnixPath.get("/var/log/my-app-logs"));
    ImmutableSortedMap<String, Map<?, ?>> expected =
        ImmutableSortedMap.of(
            "/var/job-result-data", ImmutableMap.of(), "/var/log/my-app-logs", ImmutableMap.of());
    Assert.assertEquals(expected, ImageToJsonTranslator.volumesSetToMap(input));
  }

  @Test
  public void testEnvironmentMapToList() {
    ImmutableMap<String, String> input = ImmutableMap.of("NAME1", "VALUE1", "NAME2", "VALUE2");
    ImmutableList<String> expected = ImmutableList.of("NAME1=VALUE1", "NAME2=VALUE2");
    Assert.assertEquals(expected, ImageToJsonTranslator.environmentMapToList(input));
  }

  /** Tests translation of image to {@link BuildableManifestTemplate}. */
  private <T extends BuildableManifestTemplate> void testGetManifest(
      Class<T> manifestTemplateClass, String translatedJsonFilename)
      throws URISyntaxException, IOException {
    // Loads the expected JSON string.
    Path jsonFile = Paths.get(Resources.getResource(translatedJsonFilename).toURI());
    String expectedJson = new String(Files.readAllBytes(jsonFile), StandardCharsets.UTF_8);

    // Translates the image to the manifest and writes the JSON string.
    JsonTemplate containerConfiguration = imageToJsonTranslator.getContainerConfiguration();
    BlobDescriptor blobDescriptor = Digests.computeDigest(containerConfiguration);
    T manifestTemplate =
        imageToJsonTranslator.getManifestTemplate(manifestTemplateClass, blobDescriptor);

    Assert.assertEquals(expectedJson, JsonTemplateMapper.toUtf8String(manifestTemplate));
  }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.10.20 at 11:04:04 AM BST
//

package org.openehr.schemas.v1;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for DV_DATE_TIME complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="DV_DATE_TIME">
 *   <complexContent>
 *     <extension base="{http://schemas.openehr.org/v1}DV_TEMPORAL">
 *       <sequence>
 *         <element name="value" type="{http://schemas.openehr.org/v1}Iso8601DateTime"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DV_DATE_TIME", propOrder = {
    "value"
})
public class DVDATETIME
    extends DVTEMPORAL
{

    @XmlElement(required = true)
    protected String value;

    /**
     * Gets the value of the value property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getValue() {
        return value;
    }

    /**
     * Sets the value of the value property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setValue(String value) {
        this.value = value;
    }

}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs");
var path = require("path");
var chokidar = require('chokidar');
var DynamicProject = (function () {
    function DynamicProject(folder, id, service, messageBus) {
        this.folder = folder;
        this.id = id;
        this.service = service;
        this.messageBus = messageBus;
    }
    DynamicProject.prototype.Start = function () {
        /*var feature = new csComp.Services.Feature();
        feature.id = "hoi";
        console.log(JSON.stringify(feature));*/
        var _this = this;
        // load project file
        this.openFile();
        // watch directory changes for new geojson files
        this.watchFolder();
        // setup http handler
        this.service.server.get('/project/' + this.id, function (req, res) { _this.GetLayer(req, res); });
    };
    DynamicProject.prototype.AddLayer = function (data) {
        var groupFolder = this.folder + '\\' + data.group;
        var resourceFolder = this.folder + '\\..\\..\\resourceTypes';
        var geojsonfile = groupFolder + '\\' + data.reference + '.json';
        var resourcefile = resourceFolder + '\\' + data.featureType + '.json';
        if (!fs.existsSync(groupFolder))
            fs.mkdirSync(groupFolder);
        if (!fs.existsSync(resourceFolder))
            fs.mkdirSync(resourceFolder);
        var combinedjson = this.splitJson(data);
        fs.writeFileSync(resourcefile, JSON.stringify(combinedjson.resourcejson));
        fs.writeFileSync(geojsonfile, JSON.stringify(combinedjson.geojson));
        console.log('done!');
    };
    DynamicProject.prototype.splitJson = function (data) {
        var geojson = {}, resourcejson = {};
        var combinedjson = data.geojson;
        if (combinedjson.hasOwnProperty('type') && combinedjson.hasOwnProperty('features')) {
            geojson = {
                type: combinedjson.type,
                features: combinedjson.features
            };
        }
        if (combinedjson.hasOwnProperty('timestamps')) {
            geojson['timestamps'] = combinedjson['timestamps'];
        }
        if (combinedjson.hasOwnProperty('featureTypes')) {
            for (var ftName in combinedjson.featureTypes) {
                if (combinedjson.featureTypes.hasOwnProperty(ftName)) {
                    var defaultFeatureType = combinedjson.featureTypes[ftName];
                    if (defaultFeatureType.hasOwnProperty('propertyTypeData')) {
                        var propertyTypeObjects = {};
                        var propKeys = '';
                        defaultFeatureType.propertyTypeData.forEach(function (pt) {
                            propertyTypeObjects[pt.label] = pt;
                            propKeys = propKeys + pt.label + ';';
                        });
                        delete defaultFeatureType.propertyTypeData;
                        defaultFeatureType.propertyTypeKeys = propKeys;
                        defaultFeatureType.name = data.featureType;
                        resourcejson['featureTypes'] = {};
                        resourcejson.featureTypes[data.featureType] = defaultFeatureType;
                        resourcejson['propertyTypeData'] = {};
                        resourcejson.propertyTypeData = propertyTypeObjects;
                        data.defaultFeatureType = defaultFeatureType.name;
                    }
                }
            }
        }
        return { geojson: geojson, resourcejson: resourcejson };
    };
    /***
    Open project file from disk
    */
    DynamicProject.prototype.openFile = function () {
        var _this = this;
        var f = this.folder + '\\project.json';
        fs.readFile(f, 'utf8', function (err, data) {
            if (!err) {
                try {
                    _this.project = JSON.parse(data);
                    if (!_this.project.id)
                        _this.project.id = _this.project.title;
                    if (!_this.project.groups)
                        _this.project.groups = [];
                    //console.log('ProjectID: ' + this.project.id);
                }
                catch (e) {
                    console.log('Error (' + f + '): ' + e);
                }
            }
        });
    };
    DynamicProject.prototype.watchFolder = function () {
        var _this = this;
        console.log('watch folder:' + this.folder);
        setTimeout(function () {
            var watcher = chokidar.watch(_this.folder, { ignoreInitial: false, ignored: /[\/\\]\./, persistent: true });
            watcher.on('all', (function (action, path) {
                if (action === 'add') {
                    _this.addLayer(path);
                }
                if (action === 'unlink') {
                    _this.removeLayer(path);
                }
                if (action === 'change') {
                    _this.addLayer(path);
                }
            }));
        }, 1000);
        //console.log(action + ' - ' + path); });
    };
    DynamicProject.prototype.removeLayer = function (file) {
        console.log('removing : ' + file);
        var p = path;
        var pp = file.split(p.sep);
        if (p.basename(file) === 'project.json')
            return;
        // determine group
        var groupTitle = p.dirname(file).replace(this.folder, '').replace(p.sep, '');
        if (groupTitle === '')
            return;
        // check if group exists
        var gg = this.project.groups.filter(function (element) { return (element != null && element.title && element.title.toLowerCase() == groupTitle.toLowerCase()); });
        var g = {};
        if (gg.length > 0) {
            g = gg[0];
            var layer = {};
            layer.id = file;
            layer.groupId = g.title;
            g.layers = g.layers.filter(function (l) { return layer.id != l.id; });
            this.service.connection.publish(this.project.id, 'project', 'layer-remove', [layer]);
        }
    };
    DynamicProject.prototype.addLayer = function (file) {
        if (!this.project)
            return;
        var p = path;
        var pp = file.split(p.sep);
        if (p.basename(file) === 'project.json')
            return;
        // determine group
        var groupTitle = p.dirname(file).replace(this.folder, '').replace(p.sep, '');
        if (groupTitle === '')
            return;
        // obtain additional parameters (useClustering, isEnabled, etc.)
        var parameters = this.service.projectParameters[groupTitle];
        //if (!parameters) parameters = { useClustering: true };
        if (!parameters)
            return; //parameters are required
        if (!this.project.groups)
            this.project.groups = [];
        // check if group exists
        var gg = this.project.groups.filter(function (element) { return (element != null && element.title && element.title.toLowerCase() == groupTitle.toLowerCase()); });
        var g = {};
        if (gg.length > 0) {
            g = gg[0];
        }
        else {
            //  var g : any; //new csComp.Services.ProjectGroup();
            g.id = groupTitle;
            g.title = groupTitle;
            g.layers = [];
            g.oneLayerActive = false;
            this.project.groups.push(g);
        }
        if (parameters.useClustering) {
            g.clustering = true;
            g.clusterLevel = parameters.clusterLevel;
        }
        var tt = file.split('\\');
        var t = tt[tt.length - 1].replace('.json', '');
        var layer = {};
        layer.id = file;
        layer.description = parameters.description;
        layer.title = parameters.layerTitle; //pp.name.split('_').join(' ');
        layer.type = 'geojson';
        layer.dynamicResource = true;
        layer.url = 'data/projects/' + this.id + '/' + g.title + '/' + p.basename(file);
        layer.groupId = g.id;
        layer.enabled = parameters.enabled;
        layer.reference = parameters.reference;
        layer.defaultFeatureType = parameters.featureType;
        if (parameters.featureType)
            layer.typeUrl = 'data/resourceTypes/' + parameters.featureType + '.json';
        var layerExists = false;
        for (var i = 0; i < g.layers.length; i++) {
            if (g.layers[i].id === layer.id) {
                layerExists = true;
                break;
            }
        }
        if (!layerExists)
            g.layers.push(layer);
        this.service.connection.publish(this.project.id, 'project', 'layer-update', { layer: [layer], group: g });
        // save project.json (+backup)
        //console.log('g:' + group);
    };
    DynamicProject.prototype.GetLayer = function (req, res) {
        console.log('Get Layer: ' + this.folder);
        res.send(JSON.stringify(this.project));
        //res.send("postgres layer");
    };
    return DynamicProject;
}());
exports.DynamicProject = DynamicProject;
var DynamicProjectService = (function () {
    function DynamicProjectService(server, connection, messageBus) {
        this.server = server;
        this.connection = connection;
        this.messageBus = messageBus;
        this.projects = {};
        this.projectParameters = {};
    }
    DynamicProjectService.prototype.Start = function (server) {
        var _this = this;
        console.log('Start project service');
        this.messageBus.subscribe('dynamic_project_layer', function (title, data) {
            if (title === 'send-layer') {
                _this.connection.publish(data.id, 'layer', 'layer-update', data);
            }
            else {
                // find project
                if (_this.projects.hasOwnProperty(data.project)) {
                    var dp = _this.projects[data.project];
                    //console.log('adding layer');
                    dp.AddLayer(data);
                    _this.projectParameters[data.group] = data;
                }
            }
        });
        var rootDir = 'public\\data\\projects';
        fs.readdir(rootDir, function (error, folders) {
            if (!error) {
                folders.forEach(function (f) {
                    var filePath = rootDir + '\\' + f;
                    fs.stat(filePath, function (error, stat) {
                        if (!error && stat.isDirectory && filePath.indexOf('projects.json') === -1) {
                            var dp = new DynamicProject(filePath, f, _this, _this.messageBus);
                            _this.projects[f] = dp;
                            dp.Start();
                        }
                    });
                });
            }
        });
    };
    return DynamicProjectService;
}());
exports.DynamicProjectService = DynamicProjectService;
//# sourceMappingURL=DynamicProject.js.map


text:
module JenkinsJob
  module Common
    class Timestamps < BasicObject
    end
  end
end


text:
require('../lib/cli');
var os = require('os');
var path = require('path');

describe("CommandLineParser Tests", function() {

  it("returns templateName without handlebars extension when valid filepath passed in", function() {
    var tpl = path.join('file-system', 'app', 'templates', 'foo.handlebars');
    var sut = new Cli({args:[tpl]});
    result = sut.parseCommandLineArgs();
    expect(result['name']).toEqual('foo');
  });

  it("returns template content when valid filepath passed in and it exists on the filesystem", function() {
    var tpl = path.join('file-system', 'app', 'templates', 'foo.handlebars');
    var sut = new Cli({args:[tpl]});
    result = sut.parseCommandLineArgs();
    expect(result['content']).toEqual('{{outlet}}' + os.EOL);
  });

  it("returns template content and name when file extension is handlebars", function() {
    var tpl = path.join('file-system', 'app', 'templates', 'tables', 'index.handlebars');
    var sut = new Cli({args:[tpl]});
    result = sut.parseCommandLineArgs();
    expect(result['content']).toEqual('{{outlet}}' + os.EOL);
    expect(result['name']).toEqual('tables/index');
  });

  it("returns template content and name when file extension is hbs", function() {
    var tpl = path.join('file-system', 'app', 'templates', 'tables', 'other.hbs');
    var sut = new Cli({args:[tpl]});
    result = sut.parseCommandLineArgs();
    expect(result['content']).toEqual('{{outlet}}' + os.EOL);
    expect(result['name']).toEqual('tables/other');
  });

  it('returns nested template paths', function () {
    var tpl = path.join('file-system', 'app', 'templates', 'tables', 'child', 'index.handlebars');
    var sut = new Cli({args:[tpl]});
    result = sut.parseCommandLineArgs();
    expect(result['content']).toEqual('{{outlet}}' + os.EOL);
    expect(result['name']).toEqual('tables/child/index');
  });

  it("returns template content and name when a path is used that is not normalized for the current operating system",
      function() {
        var tpl = './file-system/app/templates/tables/other.hbs'
        var sut = new Cli({args:[tpl]});
        result = sut.parseCommandLineArgs();
        expect(result['content']).toEqual('{{outlet}}' + os.EOL);
        expect(result['name']).toEqual('tables/other');
      });

});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Zignoëlla boreella P. Karst.

### Remarks
null


text:
import cv2
import numpy as np

def find_features(img, hessian_threshold=500):
    """Given a gray OpenCV image (such as from imread) return a list
    of OpenCV features and their descriptors as a tuple
    Params:
    img -- OpenCV image
    hessian_threshold -- threshold for feature selection
      (larger means fewer features)
    Returns:
    ([keypoints], [descriptors])
    """
    surf = cv2.SURF(hessian_threshold)
    kp, des = surf.detectAndCompute(img, None) # Second param is mask
    return (kp, des)

def display_features(img, kp):
    """Display window of image with feature keypoints superimposed
    The window closes on keypress
    Params:
    img -- OpenCV image
    kp -- list of keypoints outputted by surf.detect()
    Returns:
    None
    """
    kpimg = cv2.drawKeypoints(img, kp)
    cv2.imshow("Feature Keypoints", kpimg)
    cv2.waitKey(0)
    cv2.destroyWindow("Feature Keypoints")

def get_features(filename, hessian_threshold=500, sx=0.5, sy=0.5):
    """Loads an image from <filename>, performs preprocessing,
    and calls find_features() on it to retrieve features
    Preprocessing involves converting to grayscale and resizing
    Params:
    filename -- string indicating relative directory to file
    hessian_threshold -- threshold for feature selection (default 500)
    sx -- factor to resize in x (default 1)
    sy -- factor to resize in y (default 1)
    Returns:
    ([keypoints], [descriptors])
    """
    img = cv2.imread(filename)
    gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
    resized_img = cv2.resize(gray, None, fx=sx, fy=sy, interpolation=cv2.INTER_NEAREST)
    return find_features(resized_img)

def get_normalized_features(filename):
    f = get_features(filename)
    f_normalized = np.array([v/np.linalg.norm(v) for v in f[1]])
    return (f_normalized, f_normalized.T)

sift = cv2.SIFT(500)

def get_descriptors(filename):
    img = cv2.imread(filename)
    img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    _, des = sift.detectAndCompute(img, None)
    return des

if __name__ == "__main__":
    img = cv2.imread("img/test.jpg")
    gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
    (kp, _) = get_features("img/test.jpg")
    display_features(gray, kp)


text:
#include <sys/types.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <syscall.h>
#include <perfmon/pfmlib.h>
#include <perfmon/perfmon.h>

#include "detect_pmcs.h"

#define NUM_PMCS PFMLIB_MAX_PMCS
#define NUM_PMDS PFMLIB_MAX_PMDS

static void fatal_error(char *fmt,...) __attribute__((noreturn));

static void
fatal_error(char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	vfprintf(stderr, fmt, ap);
	va_end(ap);

	exit(1);
}

/*
 * pin task to CPU
 */
#ifndef __NR_sched_setaffinity
#error "you need to define __NR_sched_setaffinity"
#endif

#define MAX_CPUS	2048
#define NR_CPU_BITS	(MAX_CPUS>>3)
int
pin_cpu(pid_t pid, unsigned int cpu)
{
	uint64_t my_mask[NR_CPU_BITS];

	if (cpu >= MAX_CPUS)
		fatal_error("this program supports only up to %d CPUs\n", MAX_CPUS);

	my_mask[cpu>>6] = 1ULL << (cpu&63);

	return syscall(__NR_sched_setaffinity, pid, sizeof(my_mask), &my_mask);
}

static volatile int quit;
void sig_handler(int n)
{
	quit = 1;
}

static void
do_child(int fr, int fw)
{
	char c;
	ssize_t ret;

	for(;;) {
		ret = read(fr, &c, 1);
		if (ret < 0)
			break;
		ret = write(fw, "c", 1);
		if (ret < 0)
			break;

	}
	printf("child exited\n");
	exit(0);
}

int
main(int argc, char **argv)
{
	char **p;
	unsigned int i;
	int ret, ctx_fd;
	pfmlib_input_param_t inp;
	pfmlib_output_param_t outp;
	pfarg_pmd_t pd[NUM_PMDS];
	pfarg_pmc_t pc[NUM_PMCS];
	pfarg_ctx_t ctx;
	pfarg_load_t load_args;
	pfmlib_options_t pfmlib_options;
	unsigned int num_counters;
	int pr[2], pw[2];
	int which_cpu;
	pid_t pid;
	size_t len;
	ssize_t nbytes;
	char *name;
	char c = '0';

	/*
	 * pass options to library (optional)
	 */
	memset(&pfmlib_options, 0, sizeof(pfmlib_options));
	pfmlib_options.pfm_debug   = 0; /* set to 1 for debug */
	pfmlib_options.pfm_verbose = 1; /* set to 1 for verbose */
	pfm_set_options(&pfmlib_options);

	srandom(getpid());
	which_cpu = random() % sysconf(_SC_NPROCESSORS_ONLN);

	/*
	 * Initialize pfm library (required before we can use it)
	 */
	ret = pfm_initialize();
	if (ret != PFMLIB_SUCCESS)
		fatal_error("Cannot initialize library: %s\n", pfm_strerror(ret));

	ret = pipe(pr);
	if (ret)
		fatal_error("cannot create read pipe: %s\n", strerror(errno));

	ret = pipe(pw);
	if (ret)
		fatal_error("cannot create write pipe: %s\n", strerror(errno));

	pfm_get_max_event_name_len(&len);
	name = malloc(len+1);
	if (!name)
		fatal_error("cannot allocate event name buffer\n");

	/*
 	 * Pin to CPU0, inherited by child process. That will enforce
 	 * the ping-pionging and thus stress the PMU context switch
 	 * which is what we want
 	 */
	ret = pin_cpu(getpid(), which_cpu);
	if (ret)
		fatal_error("cannot pin to CPU%d: %s\n", which_cpu, strerror(errno));

	printf("Both processes pinned to CPU%d\n", which_cpu);

	pfm_get_num_counters(&num_counters);

	memset(pd, 0, sizeof(pd));
	memset(pc, 0, sizeof(pc));
	memset(&ctx, 0, sizeof(ctx));
	memset(&load_args, 0, sizeof(load_args));

	/*
	 * prepare parameters to library.
	 */
	memset(&inp,0, sizeof(inp));
	memset(&outp,0, sizeof(outp));

	/*
	 * be nice to user!
	 */
	if (argc > 1) {
		p = argv+1;
		for (i=0; *p ; i++, p++) {
			ret = pfm_find_full_event(*p, &inp.pfp_events[i]);
			if (ret != PFMLIB_SUCCESS)
				fatal_error("event %s: %s\n", *p, pfm_strerror(ret));
		}
	} else {
		if (pfm_get_cycle_event(&inp.pfp_events[0]) != PFMLIB_SUCCESS)
			fatal_error("cannot find cycle event\n");

		if (pfm_get_inst_retired_event(&inp.pfp_events[1]) != PFMLIB_SUCCESS)
			fatal_error("cannot find inst retired event\n");
		i = 2;
	}

	/*
	 * set the default privilege mode for all counters:
	 * 	PFM_PLM3 : user level only
	 */
	inp.pfp_dfl_plm   = PFM_PLM3;

	if (i > num_counters) {
		i = num_counters;
		printf("too many events provided (max=%d events), using first %d event(s)\n", num_counters, i);
	}

	/*
	 * how many counters we use
	 */
	inp.pfp_event_count = i;

	/*
	 * now create a new context, per process context.
	 * This just creates a new context with some initial state, it is not
	 * active nor attached to any process.
	 */
	ctx_fd = pfm_create_context(&ctx, NULL, NULL, 0);
	if (ctx_fd == -1)  {
		if (errno == ENOSYS)
			fatal_error("Your kernel does not have performance monitoring support!\n");
		fatal_error("Can't create PFM context %s\n", strerror(errno));
	}

	/*
	 * build the pfp_unavail_pmcs bitmask by looking
	 * at what perfmon has available. It is not always
	 * the case that all PMU registers are actually available
	 * to applications. For instance, on IA-32 platforms, some
	 * registers may be reserved for the NMI watchdog timer.
	 *
	 * With this bitmap, the library knows which registers NOT to
	 * use. Of source, it is possible that no valid assignement may
	 * be possible if certain PMU registers  are not available.
	 */
	detect_unavail_pmcs(ctx_fd, &inp.pfp_unavail_pmcs);

	/*
	 * let the library figure out the values for the PMCS
	 */
	if ((ret=pfm_dispatch_events(&inp, NULL, &outp, NULL)) != PFMLIB_SUCCESS)
		fatal_error("cannot configure events: %s\n", pfm_strerror(ret));

	/*
	 * Now prepare the argument to initialize the PMDs and PMCS.
	 * We use pfp_pmc_count to determine the number of PMC to intialize.
	 * We use pfp_pmd_count to determine the number of PMD to initialize.
	 * Some events/features may cause extra PMCs to be used, leading to:
	 * 	- pfp_pmc_count may be >= pfp_event_count
	 * 	- pfp_pmd_count may be >= pfp_event_count
	 */
	for (i=0; i < outp.pfp_pmc_count; i++) {
		pc[i].reg_num   = outp.pfp_pmcs[i].reg_num;
		pc[i].reg_value = outp.pfp_pmcs[i].reg_value;
	}

	for (i=0; i < outp.pfp_pmd_count; i++) {
		pd[i].reg_num   = outp.pfp_pmds[i].reg_num;
	}

	/*
	 * Now program the registers
	 */
	if (pfm_write_pmcs(ctx_fd, pc, outp.pfp_pmc_count))
		fatal_error("pfm_write_pmcs error errno %d\n",errno);

	if (pfm_write_pmds(ctx_fd, pd, outp.pfp_pmd_count))
		fatal_error("pfm_write_pmds error errno %d\n",errno);

	/*
	 * now we load (i.e., attach) the context to ourself
	 */
	load_args.load_pid = getpid();
	if (pfm_load_context(ctx_fd, &load_args))
		fatal_error("pfm_load_context error errno %d\n",errno);

	/*
 	 * create second process which is not monitoring at the moment
 	 */
	switch(pid=fork()) {
		case -1:
			fatal_error("cannot create child\n");
		case 0:
			/* do not inherit context fd */
			close(ctx_fd);
			/* pr[]: write master, read child */
			/* pw[]: read master, write child */
			close(pr[1]); close(pw[0]);
			do_child(pr[0], pw[1]);
			exit(1);
	}

	close(pr[0]);
	close(pw[1]);

	/*
	 * Let's roll now
	 */
	if (pfm_start(ctx_fd, NULL))
		fatal_error("pfm_start error errno %d\n",errno);

	signal(SIGALRM, sig_handler);
	alarm(10);
	/*
	 * ping pong loop
	 */
	while(!quit) {
		nbytes = write(pr[1], "c", 1);
		nbytes = read(pw[0], &c, 1);
	}

	if (pfm_stop(ctx_fd))
		fatal_error("pfm_stop error errno %d\n",errno);

	/*
	 * now read the results. We use pfp_event_count because
	 * libpfm guarantees that counters for the events always
	 * come first.
	 */
	if (pfm_read_pmds(ctx_fd, pd, inp.pfp_event_count))
		fatal_error( "pfm_read_pmds error errno %d\n",errno);

	/*
	 * print the results
	 */
	for (i=0; i < inp.pfp_event_count; i++) {
		pfm_get_full_event_name(&inp.pfp_events[i], name, len+1);
		printf("PMD%-3u %20"PRIu64" %s\n",
			pd[i].reg_num,
			pd[i].reg_value,
			name);
	}
	free(name);
	/*
	 * kill child process
	 */
	kill(SIGKILL, pid);
	/*
 	 * close pipes
 	 */
	close(pr[1]);
	close(pw[0]);
	/*
	 * and destroy our context
	 */
	close(ctx_fd);
	return 0;
}


text:
package com.pilotfish22.ricecake;

import java.util.List;

import net.daum.adam.publisher.AdView;
import net.daum.adam.publisher.AdView.OnAdFailedListener;
import net.daum.adam.publisher.impl.AdError;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.Toast;

public class SelectBackgroundActivity extends ImageManager {
	private String TAG = "SelectBacground";
	private AdView adView = null;

	/* Back key µÎ¹ø´·¯ Á¾·á ÄÚµå ½ÃÀÛ */
	private static final int MSG_TIMER_EXPIRED = 1;
	private static final int BACKEY_TIMEOUT = 2000;
	private boolean mIsBackKeyPressed = false;
	private long mCurrentTimeInMillis = 0;

	/** Called when the activity is first created. */
	IntegerImageAdapter adapter;
	Integer[] mThumbIds = {
			R.drawable.bg_10, R.drawable.bg_11, R.drawable.bg_12,
			R.drawable.bg_13, R.drawable.bg_05, R.drawable.bg_01,
			R.drawable.bg_02, R.drawable.bg_03, R.drawable.bg_04,
			R.drawable.bg_06, R.drawable.bg_07, R.drawable.bg_08, R.drawable.bg_09
	};

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_selectbackground);

		initAdam();

		GridView gridView = (GridView) findViewById(R.id.gridview_background);
		gridView.setColumnWidth(getWindowManager().getDefaultDisplay()
				.getWidth() / 3);
		ImageButton btnInvitationList = (ImageButton) findViewById(R.id.btnInvitationList);
		ImageButton btnInvitationAdd = (ImageButton) findViewById(R.id.btnInvitationAdd);

		adapter = new IntegerImageAdapter(this, mThumbIds, getWindowManager().getDefaultDisplay().getWidth() / 2);
		gridView.setAdapter(adapter);
		gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {

				Intent intent = new Intent(getApplicationContext(),
						MakeInvitationActivity.class);

				intent.putExtra(Constant.INTENT_EXTR_IMAGE_TYPE, "res");
				intent.putExtra(Constant.INTENT_EXTR_IMAGEID, mThumbIds[position]);
				Log.i(TAG, String.valueOf(mThumbIds[position]));
				startActivity(intent);

			}
		});

		//SavedIvitationActivity À̵¿
		btnInvitationList.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(getApplicationContext(),
						SavedIvitationActivity.class);
				startActivity(intent);
			}
		});

		//»ç¿ëÀÚ À̹ÌÁö Ãß°¡
		btnInvitationAdd.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				selectedImage();
			}
		});
	}// end create

	// ÀÎÅÙÆ® °á°ú¸ñ·Ï
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);

		if (resultCode == RESULT_OK) {

			switch (requestCode) {
			// »çÁø ¼±ÅýÃ
			case Constant.REQ_CODE_PICK_IMAGE:

				try {
					mImageCaptureUri = data.getData();

					//Log.i("hyun", mImageCaptureUri.toString()); // logCat

					Intent intent = new Intent("com.android.camera.action.CROP");
					intent.setType("image/*");
					//TODO
					intent.putExtra("aspectX", 3);
					intent.putExtra("aspectY", 5);
					//intent.putExtra("scale",true);

					List<ResolveInfo> list = getPackageManager()
							.queryIntentActivities(intent, 0);
					intent.setData(mImageCaptureUri);
					intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,  getTempUri());

					Intent i = new Intent(intent);
					ResolveInfo res = list.get(0);

					i.setComponent(new ComponentName(
							res.activityInfo.packageName, res.activityInfo.name));

					startActivityForResult(i, Constant.CROP_FROM_CAMERA);

				} catch (Exception e) {
					Log.e(TAG, e.getMessage());
				}

				break;

			//Àß¶ó³½ À̹ÌÁö¸¦ º¸¿©ÁÜ
			case Constant.CROP_FROM_CAMERA:

				//TODO
				Intent intent = new Intent(getApplicationContext(),
						MakeInvitationActivity.class);
				intent.putExtra(Constant.INTENT_EXTR_IMAGE_TYPE, "url");
				intent.putExtra(Constant.INTENT_EXTR_IMAGEID, getTempUri().getPath());
				//Log.i(TAG, String.valueOf(mThumbIds[position]));
				startActivity(intent);

				break;
			default:
				break;
			}
		} else {
			Log.e(TAG, String.valueOf(resultCode));
		}

	}// end onActivityResult

	// ¹é¹öÆ°
	@Override
	public void onBackPressed() {
		if (mIsBackKeyPressed == false) {
			mIsBackKeyPressed = true;

			mCurrentTimeInMillis = System.currentTimeMillis();

			Toast.makeText(this, R.string.toast_msg_quit, Toast.LENGTH_SHORT)
					.show();
			startTimer();
		} else {
			mIsBackKeyPressed = false;

			if (System.currentTimeMillis() <= (mCurrentTimeInMillis + (BACKEY_TIMEOUT))) {
				finish();
			}
		}
	}

	private void startTimer() {
		mTimerHander.sendEmptyMessageDelayed(MSG_TIMER_EXPIRED, BACKEY_TIMEOUT);
	}

	private Handler mTimerHander = new Handler() {
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case MSG_TIMER_EXPIRED:
				mIsBackKeyPressed = false;
				break;
			}
		}
	};

	//onDestroy
	@Override
	protected void onDestroy() {
		super.onDestroy();
		if (adView != null) {
			adView.destroy();
			adView = null;
		}
	}

	// Ad@m sdk ÃʱâÈ ½ÃÀÛ
	private void initAdam() {
		adView = (AdView) findViewById(R.id.adview);
		adView.setOnAdFailedListener(new OnAdFailedListener() {
			@Override
			public void OnAdFailed(AdError error, String message) {
				Log.w(TAG, message);
			}
		});
		adView.setAdCache(false);
		adView.setVisibility(View.VISIBLE);
	}

}// end class


text:
<?php

/**
 * Contains a pair of recursive functions that implement the bencode data
 * encoding format.
 *
 * @author  Michael J. I. Jackson <mjijackson@gmail.com>
 */
class Bencode
{

    /**
     * The version of the library.
     *
     * @var string
     */
    const VERSION = "1.0";

    /**
     * Bencodes the given data structure.
     *
     * @param   mixed
     * @return  string
     * @throws  Exception
     */
    public static function encode($value)
    {
        if (is_null($value)) {
            return "0:";
        }
        if (is_int($value)) {
            return "i" . $value . "e";
        }
        if (is_string($value)) {
            return strlen($value) . ":" . $value;
        }
        if (is_array($value)) {
            if (self::isAssoc($value)) {
                ksort($value, SORT_STRING);
                $buffer = "d";
                foreach ($value as $key => $v) {
                    $buffer .= self::encode(strval($key));
                    $buffer .= self::encode($v);
                }
                $buffer .= "e";
            } else {
                ksort($value, SORT_NUMERIC);
                $buffer = "l";
                foreach ($value as $v) {
                    $buffer .= self::encode($v);
                }
                $buffer .= "e";
            }
            return $buffer;
        }

        throw new Exception("Unable to encode data type: " . gettype($value));
    }

    /**
     * Decodes the given string. The second parameter is only used in recursion.
     *
     * @param   string
     * @param   int
     * @return  mixed
     * @throws  Exception
     */
    public static function decode($tokens, &$i=0)
    {
        if (is_string($tokens)) {
            $tokens = str_split($tokens);
        }

        switch ($tokens[$i]) {
        case "d":
            $dict = array();
            while (isset($tokens[++$i])) {
                if ($tokens[$i] == "e") {
                    return $dict;
                } else {
                    $key = self::decode($tokens, $i);
                    if (isset($tokens[++$i])) {
                        $dict[$key] = self::decode($tokens, $i);
                    } else {
                        throw new Exception("Dictionary key ($key) without a value at index $i");
                    }
                }
            }
            throw new Exception("Unterminated dictionary at index $i");

        case "l":
            $list = array();
            while (isset($tokens[++$i])) {
                if ($tokens[$i] == "e") {
                    return $list;
                } else {
                    $list[] = self::decode($tokens, $i);
                }
            }
            throw new Exception("Unterminated list at index $i");

        case "i":
            $buffer = '';
            while (isset($tokens[++$i])) {
                if ($tokens[$i] == "e") {
                    return intval($buffer);
                } elseif (ctype_digit($tokens[$i])) {
                    $buffer .= $tokens[$i];
                } else {
                    throw new Exception("Unexpected token while parsing integer at index $i: {$tokens[$i]}");
                }
            }
            throw new Exception("Unterminated integer at index $i");

        case ctype_digit($tokens[$i]):
            $length = $tokens[$i];
            while (isset($tokens[++$i])) {
                if ($tokens[$i] == ":") {
                    break;
                } elseif (ctype_digit($tokens[$i])) {
                    $length .= $tokens[$i];
                } else {
                    throw new Exception("Unexpected token while parsing string length at index $i: {$tokens[$i]}");
                }
            }
            $end = $i + intval($length);
            $buffer = '';
            while (isset($tokens[++$i])) {
                if ($i <= $end) {
                    $buffer .= $tokens[$i];
                    if ($i == $end) {
                        return $buffer;
                    }
                }
            }
            throw new Exception("Unterminated string at index $i");
        }

        throw new Exception("Unexpected token at index $i: {$tokens[$i]}");
    }

    /**
     * Tells whether an array is associative or not. In order to be non-associative,
     * each of the array's key numbers must correspond exactly to it's position
     * in the array.
     *
     * @param   array
     * @return  bool
     */
    public static function isAssoc($array)
    {
        return count($array) !== array_reduce(array_keys($array), array("Bencode", "isAssocCallback"), 0);
    }

    /**
     * A callback function used by {@link isAssoc()}.
     *
     * @return  int
     */
    protected static function isAssocCallback($a, $b)
    {
        return $a === $b ? $a + 1 : 0;
    }

}

/**
 * Shorthand for {@link Bencode::encode()}.
 *
 * @param   mixed
 * @return  string
 * @throws  Exception
 * @see     Bencode::encode()
 */
function bencode($value)
{
    return Bencode::encode($value);
}

/**
 * Shorthand for {@link Bencode::decode()}.
 *
 * @param   string
 * @return  mixed
 * @throws  Exception
 * @see     Bencode::decode()
 */
function bdecode($value)
{
    return Bencode::decode($value);
}


text:
package com.vessel.ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.vessel.VesselAB;
import com.vessel.interfaces.VesselImageListener;
import com.vessel.landingdemo.R;

import external.com.android.volley.VolleyError;
import external.com.android.volley.toolbox.ImageLoader.ImageContainer;

/**
 * Fragment loading Normail Email. Demonstrates loading of assets and strings
 * from Vessel Server.
 * @author dev
 *
 */
public class FragmentNormalEmail extends FragmentBase {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View emailView = inflater.inflate(R.layout.email_signup, container, false);
        TextView welcomeMsg = (TextView) emailView.findViewById(R.id.welcome_text);
        final ImageView logo = (ImageView) emailView.findViewById(R.id.vessel_logo);

        // Find and set the value if any variation is loaded.
        welcomeMsg.setText(VesselAB.getValue("socialemail", "welcome_text",
                getString(R.string.welcome_msg)));
        VesselAB.getImageForKey("socialemail", "signuplogo", new VesselImageListener() {

            @Override
            public void onResponse(ImageContainer container, boolean isImmediate) {
                if (container != null) {
                    logo.setImageBitmap(container.getBitmap());
                }
            }

            @Override
            public void onErrorResponse(VolleyError error) {

            }

        });

        return emailView;
    }

}


text:
package ru.stqa.training.selenium.tests;

import org.openqa.selenium.By;
import org.testng.annotations.Test;

import static org.junit.Assert.assertTrue;

/**
 * Created by irinagavrilova on 1/30/17.
 */
public class AdminMenu extends TestBase {
  @Test
  public void testAdminMenu() {

    int commandMenuSize = app.categoryPage().quantityElementsPresent(By.cssSelector("li#app-"));
    String[] commandText = app.categoryPage().list(By.cssSelector("li#app-"), commandMenuSize);
    for (int j = 0; j < commandMenuSize; j++) {
      app.goTo().gotoPage(By.linkText(commandText[j]));
      assertTrue(app.goTo().isElementPresent(By.cssSelector("h1")));
      int k = app.categoryPage().quantityElementsPresent(By.cssSelector("li#app-.selected span.name")) - 1;
      if (k > 0) {
        String[] commandSubText = app.categoryPage().list(By.cssSelector("li#app-.selected ul.docs span.name"), k);
        for (int m = 0; m < k; m++) {
          app.goTo().gotoPage(By.linkText(commandSubText[m]));
          assertTrue(app.goTo().isElementPresent(By.cssSelector("h1")));
        }
      }
    }
    app.goTo().gotoHomePage();
    app.goTo().logoutAdminSession();
  }
}


text: just a few things for a java course i have put together


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

namespace Azure.ResourceManager.DigitalTwins.Models
{
    /// <summary> properties related to servicebus. </summary>
    public partial class ServiceBus : DigitalTwinsEndpointResourceProperties
    {
        /// <summary> Initializes a new instance of ServiceBus. </summary>
        /// <param name="primaryConnectionString"> PrimaryConnectionString of the endpoint. Will be obfuscated during read. </param>
        /// <param name="secondaryConnectionString"> SecondaryConnectionString of the endpoint. Will be obfuscated during read. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="primaryConnectionString"/> or <paramref name="secondaryConnectionString"/> is null. </exception>
        public ServiceBus(string primaryConnectionString, string secondaryConnectionString)
        {
            if (primaryConnectionString == null)
            {
                throw new ArgumentNullException(nameof(primaryConnectionString));
            }
            if (secondaryConnectionString == null)
            {
                throw new ArgumentNullException(nameof(secondaryConnectionString));
            }

            PrimaryConnectionString = primaryConnectionString;
            SecondaryConnectionString = secondaryConnectionString;
            EndpointType = EndpointType.ServiceBus;
        }

        /// <summary> Initializes a new instance of ServiceBus. </summary>
        /// <param name="endpointType"> The type of Digital Twins endpoint. </param>
        /// <param name="provisioningState"> The provisioning state. </param>
        /// <param name="createdTime"> Time when the Endpoint was added to DigitalTwinsInstance. </param>
        /// <param name="tags"> The resource tags. </param>
        /// <param name="primaryConnectionString"> PrimaryConnectionString of the endpoint. Will be obfuscated during read. </param>
        /// <param name="secondaryConnectionString"> SecondaryConnectionString of the endpoint. Will be obfuscated during read. </param>
        internal ServiceBus(EndpointType endpointType, EndpointProvisioningState? provisioningState, DateTimeOffset? createdTime, IDictionary<string, string> tags, string primaryConnectionString, string secondaryConnectionString) : base(endpointType, provisioningState, createdTime, tags)
        {
            PrimaryConnectionString = primaryConnectionString;
            SecondaryConnectionString = secondaryConnectionString;
            EndpointType = endpointType;
        }

        /// <summary> PrimaryConnectionString of the endpoint. Will be obfuscated during read. </summary>
        public string PrimaryConnectionString { get; set; }
        /// <summary> SecondaryConnectionString of the endpoint. Will be obfuscated during read. </summary>
        public string SecondaryConnectionString { get; set; }
    }
}


text: #include "scene_controller.h"