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=UTF-8">
<title>com.communote.server.core.rest Class Hierarchy (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package com.communote.server.core.rest

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

org.restlet.engine.http.adapter.Adapter

org.restlet.engine.http.adapter.ServerAdapter

org.restlet.ext.servlet.ServletAdapter

com.communote.server.core.rest.CommunoteRestletServletAdapter

com.communote.server.core.rest.HttpServletRequestWrapper (implements javax.servlet.http.HttpServletRequest)

java.io.InputStream (implements java.io.Closeable)

javax.servlet.ServletInputStream

com.communote.server.core.rest.RestApiByteArrayInputStream

com.communote.server.core.rest.RestletApplicationManager<T>

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2019 Communote team. All rights reserved.


text:
@interface ToDoListTableViewController : UITableViewController

- (IBAction)unwindToList:(UIStoryboardSegue *)segue;

@end

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Altus.Suffūz.Collections
{
    public interface IManagePersistentCollections
    {
        TCollection GetOrCreate<TCollection>(string fileName, Func<string, TCollection> creator)
            where TCollection : IPersistentCollection;
    }
}


text:
This example demonstrates how to make a color bar to that reflects the range
of values associated with a data set.


text:
package com.yumodev.rxjava1;

import android.util.Log;

import com.yumo.demo.view.YmTestFragment;

import java.util.concurrent.TimeUnit;

import rx.Observable;
import rx.Subscriber;
import rx.functions.Action1;
import rx.functions.Func0;

import static com.yumodev.rxjava1.Define.LOG_TAG;

/**
 * Created by yumodev on 17/12/5.
 *
 * just:利用just依次将数据发送出去
 * from:利用from将一个数组数据依次发送出去,和just一样
 * defer:直到有观察者订阅时才创建Observable,并且为每个观察者创建一个新的Observable
 * timer:操作符创建一个在给定的时间段之后返回一个特殊值的Observable。
 * interval: 创建一个按固定时间间隔发射整数序列的Observable
 * range:操作符发射一个范围内的有序整数序列,你可以指定范围的起始和长度
 * repeat:创建一个发射特定数据重复多次的Observable
 */

public class TestCreateOperateView extends YmTestFragment {

    String mData = "a";

    /**
     * 利用just依次将数据发送出去
     */
    public void testObservablejust(){
        Observable
                .just("a", "b", "c", "d")
                .subscribe(getSubscribe());
    }

    /**
     * 利用from将一个数组数据依次发送出去,和just一样
     */
    public void testObservableFrom(){
        String[] str = {"a", "b", "c"};
        Observable
                .from(str)
                .subscribe(getSubscribe());
    }

    /**
     * Range操作符发射一个范围内的有序整数序列,你可以指定范围的起始和长度。
     */
    public void testObservableRange(){

        Observable
                .range(0, 10)
                .subscribe(new Action1<Integer>() {
                    @Override
                    public void call(Integer value) {
                        Log.i(LOG_TAG, value+"");
                    }
                });
    }

    /**
     * repeat:创建一个发射特定数据重复多次的Observable
     */
    public void testObserableRepeat(){
        Observable
                .range(0, 10)
                .repeat(5)
                .subscribe(new Action1<Integer>() {
                    @Override
                    public void call(Integer value) {
                        Log.i(LOG_TAG, value+"");
                    }
                });
    }

    /**
     * Timer操作符创建一个在给定的时间段之后返回一个特殊值的Observable。
     */
    public void testTimer(){
        Observable.just(null)
                .timer(2, TimeUnit.SECONDS)
                .subscribe(new Action1<Object>() {
                    @Override
                    public void call(Object o) {
                        Log.i(LOG_TAG, "testTimer");
                    }
                });
    }

    /**
     * Delay操作符创建一个在给定的时间段之后返回一个特殊值的Observable。
     */
    public void testDeleay(){
        Observable.just(null)
                .delay(2, TimeUnit.SECONDS)
                .subscribe(new Action1<Object>() {
                    @Override
                    public void call(Object o) {
                        Log.i(LOG_TAG, "testDelay");
                    }
                });
    }

    /**
     * interval: 创建一个按固定时间间隔发射整数序列的Observable
     */
    public void testInterval(){
        Observable.range(10,10)
                .interval(2, TimeUnit.SECONDS)
                .subscribe(new Action1<Long>() {
                    @Override
                    public void call(Long aLong) {
                        Log.i(LOG_TAG, "testInterval:"+aLong);
                    }
                });
    }

    /**
     * Empty 创建一个不发射任何数据但是正常终止的Observable
     */
    public void testEmpty(){
        Observable.<String>empty().subscribe(getSubscribe());
    }

    /**
     * never 创建一个不发射数据也不终止的Observable
     */
    public void testNever(){
        Observable.<String>never().subscribe(getSubscribe());
    }

    /**
     * throw 创建一个不发射数据以一个错误终止的Observable
     */
    public void testThrowable(){
        Observable.<String>error(new Throwable()).subscribe(getSubscribe());
    }
    /**
     * 直到有观察者订阅时才创建Observable,并且为每个观察者创建一个新的Observable
     */
    public void testDefer(){
        Observable observable = Observable.just(mData).defer(new Func0<Observable<String>>() {
            @Override
            public Observable<String> call() {
                return Observable.just(mData);
            }
        });

        mData = "c";
        observable.subscribe(new Action1<String>() {
            @Override
            public void call(String s) {
                Log.i(LOG_TAG, s);
            }
        });
    }

    private Subscriber<String> getSubscribe(){
        Subscriber<String> subscriber = new Subscriber<String>() {
            @Override
            public void onCompleted() {
                Log.i(LOG_TAG, "onCompleted threadName:"+Thread.currentThread().getName());
            }

            @Override
            public void onError(Throwable e) {
                Log.i(LOG_TAG, "onError");
            }

            @Override
            public void onNext(String s) {
                Log.i(LOG_TAG, "onNext:"+s);
                Log.i(LOG_TAG, "onNext threadName:"+Thread.currentThread().getName());
            }

            @Override
            public void onStart() {
                super.onStart();
                Log.i(LOG_TAG, "onStart threadName:"+Thread.currentThread().getName());
            }
        };
        return subscriber;
    }

}


text:
require "backup_restore/utils"
require "backup_restore/backuper"
require "backup_restore/restorer"

module BackupRestore

  class OperationRunningError < RuntimeError; end

  VERSION_PREFIX = "v".freeze
  DUMP_FILE = "dump.sql.gz".freeze
  OLD_DUMP_FILE = "dump.sql".freeze
  METADATA_FILE = "meta.json"
  LOGS_CHANNEL = "/admin/backups/logs"

  def self.backup!(user_id, opts={})
    start! BackupRestore::Backuper.new(user_id, opts)
  end

  def self.restore!(user_id, opts={})
    start! BackupRestore::Restorer.new(user_id, opts)
  end

  def self.rollback!
    raise BackupRestore::OperationRunningError if BackupRestore.is_operation_running?
    if can_rollback?
      move_tables_between_schemas("backup", "public")
      after_fork
    end
  end

  def self.cancel!
    set_shutdown_signal!
    true
  end

  def self.mark_as_running!
    $redis.setex(running_key, 60, "1")
    save_start_logs_message_id
    keep_it_running
  end

  def self.is_operation_running?
    !!$redis.get(running_key)
  end

  def self.mark_as_not_running!
    $redis.del(running_key)
  end

  def self.should_shutdown?
    !!$redis.get(shutdown_signal_key)
  end

  def self.can_rollback?
    backup_tables_count > 0
  end

  def self.operations_status
    {
      is_operation_running: is_operation_running?,
      can_rollback: can_rollback?,
      allow_restore: Rails.env.development? || SiteSetting.allow_restore
    }
  end

  def self.logs
    id = start_logs_message_id
    MessageBus.backlog(LOGS_CHANNEL, id).map { |m| m.data }
  end

  def self.current_version
    ActiveRecord::Migrator.current_version
  end

  def self.move_tables_between_schemas(source, destination)
    User.exec_sql(move_tables_between_schemas_sql(source, destination))
  end

  def self.move_tables_between_schemas_sql(source, destination)
    <<-SQL
      DO $$DECLARE row record;
      BEGIN
        -- create <destination> schema if it does not exists already
        -- NOTE: DROP & CREATE SCHEMA is easier, but we don't want to drop the public schema
        -- ortherwise extensions (like hstore & pg_trgm) won't work anymore...
        CREATE SCHEMA IF NOT EXISTS #{destination};
        -- move all <source> tables to <destination> schema
        FOR row IN SELECT tablename FROM pg_tables WHERE schemaname = '#{source}'
        LOOP
          EXECUTE 'DROP TABLE IF EXISTS #{destination}.' || quote_ident(row.tablename) || ' CASCADE;';
          EXECUTE 'ALTER TABLE #{source}.' || quote_ident(row.tablename) || ' SET SCHEMA #{destination};';
        END LOOP;
        -- move all <source> views to <destination> schema
        FOR row IN SELECT viewname FROM pg_views WHERE schemaname = '#{source}'
        LOOP
          EXECUTE 'DROP VIEW IF EXISTS #{destination}.' || quote_ident(row.viewname) || ' CASCADE;';
          EXECUTE 'ALTER VIEW #{source}.' || quote_ident(row.viewname) || ' SET SCHEMA #{destination};';
        END LOOP;
      END$$;
    SQL
  end

  DatabaseConfiguration = Struct.new(:host, :port, :username, :password, :database)

  def self.database_configuration
    config = ActiveRecord::Base.connection_pool.spec.config
    config = config.with_indifferent_access

    DatabaseConfiguration.new(
      config["host"],
      config["port"],
      config["username"] || ENV["USER"] || "postgres",
      config["password"],
      config["database"]
    )
  end

  private

  def self.running_key
    "backup_restore_operation_is_running"
  end

  def self.keep_it_running
    # extend the expiry by 1 minute every 30 seconds
    Thread.new do
      # this thread will be killed when the fork dies
      while true
        $redis.expire(running_key, 1.minute)
        sleep 30.seconds
      end
    end
  end

  def self.shutdown_signal_key
    "backup_restore_operation_should_shutdown"
  end

  def self.set_shutdown_signal!
    $redis.set(shutdown_signal_key, "1")
  end

  def self.clear_shutdown_signal!
    $redis.del(shutdown_signal_key)
  end

  def self.save_start_logs_message_id
    id = MessageBus.last_id(LOGS_CHANNEL)
    $redis.set(start_logs_message_id_key, id)
  end

  def self.start_logs_message_id
    $redis.get(start_logs_message_id_key).to_i
  end

  def self.start_logs_message_id_key
    "start_logs_message_id"
  end

  def self.start!(runner)
    child = fork do
      begin
        after_fork
        runner.run
      rescue Exception => e
        puts "--------------------------------------------"
        puts "---------------- EXCEPTION -----------------"
        puts e.message
        puts e.backtrace.join("\n")
        puts "--------------------------------------------"
      ensure
        begin
          clear_shutdown_signal!
        rescue Exception => e
          puts "============================================"
          puts "================ EXCEPTION ================="
          puts e.message
          puts e.backtrace.join("\n")
          puts "============================================"
        ensure
          exit!(0)
        end
      end
    end

    Process.detach(child)

    true
  end

  def self.after_fork
    Discourse.after_fork
  end

  def self.backup_tables_count
    User.exec_sql("SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = 'backup'")[0]['count'].to_i
  end

end


text:
const express        =  require ('express')
const sequelize      =  require('sequelize')
const session        =  require('express-session')
const router         =  express.Router()
const db         =  require('../models/database');
const passport       =  require('passport')
const LocalStrategy  =  require('passport-local').Strategy;
const local          =  require('../models/local')

router.use(session({
	secret: 'oh wow very secret much security',
	resave: true,
	saveUninitialized: false,
	cookie: {
		secure: false,
		maxAge: 24*60*60*1000
	}
}));

router.route('/request')
 	.get((req,res) => {

 		let user = req.user
 		if (user === undefined) {
 			res.render('index')
 		} else {
 			db.model.findAll().then(models => {
 				db.product.findAll().then(products => {
 				res.render('request', {
 					user: req.user,
 					models: models,
 					products:products
 				})
 			})})

 		}
  	});

module.exports = router


text:
@extends('back.template')
@section('main')

    @include('back.partials.entete', ['title' => 'Cấu hình khác' ])

    @if (count($errors) > 0)

                @foreach ($errors->all() as $error)

{{ $error }}

                @endforeach

    @elseif (Session()->has('flash_level'))

                {!! Session::get('flash_massage') !!}

    @endif

            <form action="settLogo" method="POST" role="form" enctype="multipart/form-data">
                {{ csrf_field() }}

 <?php $dataLogoGet = $dataLogo[0]['content']; ?>
                    Ảnh hiện tại:
<?php if ( isset($dataLogoGet)) {?> <?php } ?>

                    Logo: <input type="file" name="logo"   class="form-control">

                <input type="submit" name="btnLogo" class="btn btn-primary" value="Lưu logo" class="button" />
            </form>

            <form action="settHotline" method="POST" role="form">
                {{ csrf_field() }}

                    <?php $dataHotline = $dataHotline[0]['content']; ?>
                        Hotline : <input type="text" name="hotline" class="form-control" value="<?php if ( isset($dataHotline)) { echo $dataHotline;} ?>">

                <input type="submit" name="btnDiachi" class="btn btn-primary" value="Lưu hotline" class="button" />
            </form>

            <form action="settMuaho" method="POST" role="form">
                {{ csrf_field() }}

                    <?php $dataKMGet = $dataKM[0]['content']; ?>
                    Phí mua hộ : <input type="text" name="muaho" class="form-control" value="<?php if ( isset($dataKMGet)) { echo $dataKMGet;} ?>">

                <input type="submit" name="btnHotline" class="btn btn-primary" value="Lưu mua hộ" class="button" />
            </form>

            <form action="settVanchuyen" method="POST" role="form">
                {{ csrf_field() }}

                    <?php $dataVCGet = $dataVC[0]['content']; ?>
                    Phí vận chuyển : <input type="text" name="vanchuyen" class="form-control" value="<?php if ( isset($dataVCGet)) { echo $dataVCGet;} ?>">

                <input type="submit" name="btnHotline" class="btn btn-primary" value="Lưu vận chuyển" class="button" />
            </form>

            <form action="settKMVC" method="POST" role="form">
                {{ csrf_field() }}

                    <?php $dataKMVC = $dataKMVC[0]['content']; ?>
                    Phí KM vận chuyển : <input type="text" name="kmvanchuyen" class="form-control" value="<?php if ( isset($dataKMVC)) { echo $dataKMVC;} ?>">

                <input type="submit" name="btnHotline" class="btn btn-primary" value="Lưu KM vận chuyển" class="button" />
            </form>

            <form action="settMinDiscount" method="POST" role="form">
                {{ csrf_field() }}

                    <?php $dataDiscount = $dataDiscount[0]['content']; ?>
                    Chiết khẩu nhỏ nhất : <input type="text" name="mindiscount" class="form-control" value="<?php if ( isset($dataDiscount)) { echo $dataDiscount;} ?>">

                <input type="submit" name="btnHotline" class="btn btn-primary" value="Lưu Chiết khẩu nhỏ nhất" class="button" />
            </form>

            <form action="settQD" method="POST" role="form" enctype="multipart/form-data">
                {{ csrf_field() }}

                    Quy định:
                    <textarea name="quydinh" id="quydinh" class="form-control" rows="4"  >
										<?php $dataQD = $dataQD[0]['content']; ?>
                        <?php if ( isset($dataQD)) {echo $dataQD;} ?>
									</textarea>

                <input type="submit" name="btnFooter" class="btn btn-primary" value="Lưu quy định" class="button" />
            </form>

            <form action="settHT" method="POST" role="form" enctype="multipart/form-data">
                {{ csrf_field() }}

                    Hỗ trợ:
                    <textarea name="hotro" id="hotro" class="form-control" rows="4"  >
										<?php $dataHT = $dataHT[0]['content']; ?>
                        <?php if ( isset($dataHT)) {echo $dataHT;} ?>
									</textarea>

                <input type="submit" name="btnFooter" class="btn btn-primary" value="Lưu hỗ trợ" class="button" />
            </form>

@stop


text:
<?php

namespace Puli\Manager\Conflict;

use Exception;
use RuntimeException;

/**
 * Thrown when two modules have conflicting path mappings.
 *
 * @since  1.0
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class ModuleConflictException extends RuntimeException
{
    public static function forPathConflict(ModuleConflict $conflict, Exception $cause = null)
    {
        $moduleNames = $conflict->getModuleNames();
        $lastModuleName = array_pop($moduleNames);

        return new static(sprintf(
            'The modules "%s" and "%s" add resources for the same path '.
            "\"%s\", but have no override order defined between them.\n\n".
            "Resolutions:\n\n(1) Add the key \"override\" to the puli.json ".
            "of one module and set its value to the other module name.\n(2) ".
            'Add the key "override-order" to the puli.json of the root '.
            'module and define the order of the modules there.',
            implode('", "', $moduleNames),
            $lastModuleName,
            $conflict->getConflictingToken()
        ), 0, $cause);
    }
}


text:
@interface UINavigationController (HMObjcSugar)

/// 自定义全屏拖拽返回手势
@property (nonatomic, strong, readonly) UIPanGestureRecognizer *hm_popGestureRecognizer;

@end


text:
package org.springframework.boot.actuate.neo4j;

import java.util.Collections;

import org.neo4j.ogm.model.Result;
import org.neo4j.ogm.session.Session;
import org.neo4j.ogm.session.SessionFactory;

import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;

/**
 * {@link HealthIndicator} that tests the status of a Neo4j by executing a Cypher
 * statement.
 *
 * @author Eric Spiegelberg
 * @author Stephane Nicoll
 * @since 2.0.0
 */
public class Neo4jHealthIndicator extends AbstractHealthIndicator {

	/**
	 * The Cypher statement used to verify Neo4j is up.
	 */
	static final String CYPHER = "match (n) return count(n) as nodes";

	private final SessionFactory sessionFactory;

	/**
	 * Create a new {@link Neo4jHealthIndicator} using the specified
	 * {@link SessionFactory}.
	 * @param sessionFactory the SessionFactory
	 */
	public Neo4jHealthIndicator(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	protected void doHealthCheck(Health.Builder builder) throws Exception {
		Session session = this.sessionFactory.openSession();
		Result result = session.query(CYPHER, Collections.emptyMap());
		builder.up().withDetail("nodes",
				result.queryResults().iterator().next().get("nodes"));
	}

}


text:
Date: Tue, 14 Jan 1997 22:07:54 GMT
Server: NCSA/1.5.2
Last-modified: Thu, 29 Aug 1996 13:34:07 GMT
Content-type: text/html
Content-length: 2885

<TITLE>Publications</TITLE>

PUBLICATIONS FUNDED IN PART BY THIS PROJECT

(8) Buffer/Latency Tradeoff in Video Servers, A. Rousskov, V. Soloviev,
and I Tatarinov, Second International Workshop on Multimedia Information
Systems, West Point, NY, September 26-28, 1996, in review.

(7) Disk Scheduling for Video Servers, A. Rousskov and V. Soloviev,
Second International Workshop on Multimedia Information Systems,
West Point, NY, September 26-28, 1996, in review.

(6) A Scheme for Available Bit Rate Traffic Control in ATM Networks,
H. Choi and R. Vetter, Proceedings of the 21st Local Area Networks Conference,
Minneapolis, Minnesota, October 13-16, 1996, submitted March 1996,
in review.

(5) Database Query Processing Over Very High Speed Networks,
W. Perrizo, R. Vetter, A. Duggal, Z. Zhang, and S. Krebsbach,
International Journal on Systems Sciences, Special issue on
Distributed Systems, in review.

(4) TM-LAB: An Experimental Program for Viewing and Investigating
Thematic Mapper Imagery on the PC, J. Sanchez, M. Canton, W. Perrizo,
and R. Vetter, Poster Presenation at the Pecora 13 Symposium, EROS Data
Center, Sioux Falls, South Dakota, August 19-22, 1996, to appear.

(3) Survey of Congestion Control Schemes for ABR Traffic in ATM Networks,
H. Choi and R. Vetter, Data Communications Management, October 1996.

(2) Some Aspects of Distributed Database Management in High Speed
Network Environments, R. Vetter, S. Junnuru, and W. Perrizo,
Proceedings of the 11th International Conference on Systems
Engineering (ICSE '96), Las Vegas, Nevada, July 9-11, 1996.

(1) Emerging Technologies for Distance Education, R. Vetter,
V. Tong and P. Juell, Proceedings of the 29th Annual Small College
Computing Symposium (SCCS '96), St. Cloud University, St. Cloud, MN,
April 18-20, 1996.

        <!WA0><!WA1>
        <!WA2><!WA3>
        <!WA4><!WA5>
        <!WA6><!WA7>
        <!WA8><!WA9>
        <!WA10><!WA11>
        <!WA12><!WA13>
        <!WA14><!WA15>
        <!WA16><!WA17>


text:
package com.genghiskahn.letsmodreboot.proxy;

import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient;

import com.genghiskahn.letsmodreboot.init.ModBlocks;
import com.genghiskahn.letsmodreboot.tileentity.TileEntityWindmill;
import com.genghiskahn.letsmodreboot.tileentity.render.TileEntityRenderWindmill;

import cpw.mods.fml.client.registry.ClientRegistry;

public class ClientProxy extends CommonProxy
{
	@Override
	public void registerProxies()
	{
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWindmill.class, new TileEntityRenderWindmill());
	}
}


text:
package org.js4ms.server;

import java.util.Properties;

/**
 * Interface exposed by objects that contruct {@link Server} objects.
 *
 * @author Greg Bumgardner (gbumgard)
 */
public interface ServerFactory {

    /**
     * @param properties
     *            Factory configuration properties.
     * @return
     */
    Server construct(Properties properties);
}


text: .. include:: ../../../dbcollection/datasets/pascal/pascal_voc_2012/README.rst


text:
/*
 * QueryResult.java
 *
 * Created on October 28, 2005, 11:01 AM
 */

package ORG.oclc.os.SRW;

import gov.loc.www.zing.srw.ExtraDataType;

/**
 *
 * @author levan
 */
public class TestQueryResult extends QueryResult {
    public long getNumberOfRecords() {
        return 1;
    }
    public int getResultSetIdleTime() {
        return 0;
    }
    public RecordIterator newRecordIterator(long index, int numRecs, String schemaId, ExtraDataType edt)
      throws InstantiationException {
        return new TestRecordIterator(index, schemaId);
    }
}


text:
class ToonzScene;

//**********************************************************************************
//    TTextureStyle  declaration
//**********************************************************************************
class TTextureParams
{
public:
	enum TYPE {
		FIXED = 0, //texture is applied fixed respect the image raster borders.
		AUTOMATIC, //texture is centered on the centroid of the filled area to texture
		RANDOM
	};

	TYPE m_type;
	double m_scale;
	double m_rotation;
	TPointD m_displacement;
	double m_contrast;
	bool m_isPattern;
	TPixel32 m_patternColor;

	TTextureParams() : m_type(AUTOMATIC), m_scale(1.0), m_rotation(0.0), m_displacement(), m_contrast(1.0), m_isPattern(false), m_patternColor(TPixel::White) {}

	bool operator==(const TTextureParams &p) const
	{
		if (m_type != p.m_type)
			return false;
		if (m_scale != p.m_scale)
			return false;
		if (m_rotation != p.m_rotation)
			return false;
		if (m_displacement != p.m_displacement)
			return false;
		if (m_contrast != p.m_contrast)
			return false;
		if (m_isPattern != p.m_isPattern)
			return false;
		if (m_patternColor != p.m_patternColor)
			return false;
		return true;
	}
};

class DVAPI TImageStyle
{
protected:
	static TFilePath m_libraryDir;
	static ToonzScene *m_currentScene;

public:
	TImageStyle(){};
	static void setLibraryDir(const TFilePath &fp) { m_libraryDir = fp; }
	static void setCurrentScene(ToonzScene *currentScene) { m_currentScene = currentScene; }
};

//--------------------------------------------------------------------------------------------------------

class DVAPI TTextureStyle : public TOutlineStyle, TRasterStyleFx, TImageStyle
{
public:
private:
	TTextureParams m_params;
	TRaster32P m_texture;
	TFilePath m_texturePath, m_texturePathLoaded;

	TTessellator *m_tessellator;
	TPixel32 m_averageColor;

protected:
	void makeIcon(const TDimension &d);

	virtual void loadData(TInputStreamInterface &);
	virtual void saveData(TOutputStreamInterface &) const;

public:
	//TTextureStyle();
	//TTextureStyle(const TFilePath &path);
	TTextureStyle(const TRasterP &ras, const TFilePath &m_texturePath);
	TTextureStyle(const TTextureStyle &);

	~TTextureStyle();

	int getParamCount() const;
	TColorStyle::ParamType getParamType(int index) const;
	QString getParamNames(int index) const;
	void getParamRange(int index, double &min, double &max) const;
	double getParamValue(TColorStyle::double_tag, int index) const;

	void getParamRange(int index, QStringList &enumItems) const;
	bool getParamValue(TColorStyle::bool_tag, int index) const;
	int getParamValue(TColorStyle::int_tag, int index) const;
	TFilePath getParamValue(TColorStyle::TFilePath_tag, int index) const;
	bool isPattern() const { return m_params.m_isPattern; }
	static void fillCustomTextureIcon(const TRaster32P &r);

	//-------------------------------------------------------------------

	void setParamValue(int index, const TFilePath &value);
	void setParamValue(int index, double value);
	void setParamValue(int index, bool value);
	void setParamValue(int index, int value);

	int getColorParamCount() const;
	TPixel32 getColorParamValue(int index) const;
	void setColorParamValue(int index, const TPixel32 &color);

	TColorStyle *clone() const;
	QString getDescription() const;

	bool hasMainColor() const { return true; }
	TPixel32 getMainColor() const { return m_averageColor; }
	void setMainColor(const TPixel32 &color) { m_params.m_patternColor = color; }

	//void draw(const TVectorRenderData &rd,  TStrokeOutline* outline) const;
	void drawRegion(const TColorFunction *cf, const bool antiAliasing, TRegionOutline &outline) const;
	//void drawRegion( const TVectorRenderData &rd, TRegionOutline &boundary ) const;
	void drawRegion(TFlash &flash, const TRegion *r) const;
	void drawStroke(const TColorFunction *cf, TStrokeOutline *outline, const TStroke *stroke) const;
	//void drawStroke(TFlash& flash, const TStroke* s) const;

	TRasterStyleFx *getRasterStyleFx() { return this; }

	bool isRasterStyle() const { return true; }

	void computeOutline(const TStroke *stroke,
						TStrokeOutline &outline,
						TOutlineUtil::OutlineParameter param) const;

	void setTexture(const TRasterP &color);
	TRasterP getTexture() const;

	TPixel32 getAverageColor() const;

	int getTagId() const;

	//static TRaster32P loadTexture(const TFilePath &path);
	void setFill(TFlash &flash) const;

	bool isPaintStyle() const { return true; }
	bool isInkStyle() const { return true; }
	bool inkFxNeedRGBMRaster() const { return true; }

	bool compute(const Params &params) const { return doCompute(params); } //faccio questo per compilare su mac! le virtuali pubbliche devono essere inline

private:
	bool doCompute(const Params &params) const;
	void setAverageColor();
	bool loadTextureRaster();
	TRaster32P loadTextureRasterWithFrame(int frame) const;
	// Not assignable
	TTextureStyle &operator=(const TTextureStyle &);
};

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
-->

<plugin>

   <extension point="org.eclipse.ui.newWizards">
      <!-- @generated Configuration -->
      <category
            id="org.eclipse.emf.ecore.Wizard.category.ID"
            name="%_UI_Wizard_category"/>
      <wizard
            id="configuration.presentation.ConfigurationModelWizardID"
            name="%_UI_ConfigurationModelWizard_label"
            class="configuration.presentation.ConfigurationModelWizard"
            category="org.eclipse.emf.ecore.Wizard.category.ID"
            icon="icons/full/obj16/ConfigurationModelFile.gif">
         <description>%_UI_ConfigurationModelWizard_description</description>
         <selection class="org.eclipse.core.resources.IResource"/>
      </wizard>
   </extension>

   <extension point="org.eclipse.ui.editors">
      <!-- @generated Configuration -->
      <editor
            id="configuration.presentation.ConfigurationEditorID"
            name="%_UI_ConfigurationEditor_label"
            icon="icons/full/obj16/ConfigurationModelFile.gif"
            extensions="configuration"
            class="configuration.presentation.ConfigurationEditor"
            contributorClass="configuration.presentation.ConfigurationActionBarContributor">
      </editor>
   </extension>

</plugin>


text:
package cz.metacentrum.perun.core.implApi.modules.attributes;

import cz.metacentrum.perun.core.api.Attribute;
import cz.metacentrum.perun.core.api.AttributeDefinition;
import cz.metacentrum.perun.core.api.Group;
import cz.metacentrum.perun.core.api.Resource;
import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException;
import cz.metacentrum.perun.core.impl.PerunSessionImpl;

/**
 * This interface serves as a template for virtual attributes.
 *
 * @author Slavek Licehammer <glory@ics.muni.cz>
 */
public interface GroupResourceVirtualAttributesModuleImplApi extends GroupResourceAttributesModuleImplApi, VirtualAttributesModuleImplApi {

	/**
	 * This method will return computed value.
	 *
	 * @param sess perun session
	 * @param group group which is needed for computing the value
	 * @param resource resource which is needed for computing the value
	 * @param attribute attribute to operate on
	 * @return
	 * @throws InternalErrorException if an exception is raised in particular
	 *         implementation, the exception is wrapped in InternalErrorException
	 */
	Attribute getAttributeValue(PerunSessionImpl sess, Group group, Resource resource, AttributeDefinition attribute);

	/**
	 * Method sets attributes' values which are dependent on this virtual attribute.
	 *
	 * @param sess
	 * @param group group which is needed for computing the value
	 * @param resource resource which is needed for computing the value
	 * @param attribute attribute to operate on
	 * @return true if attribute was really changed
	 * @throws InternalErrorException if an exception is raised in particular
	 *         implementation, the exception is wrapped in InternalErrorException
	 */
	boolean setAttributeValue(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws WrongReferenceAttributeValueException;

	/**
	 * Currently do nothing.
	 *
	 * @param sess
	 * @param group group which is needed for computing the value
	 * @param resource resource which is needed for computing the value
	 * @param attribute attribute to operate on
	 * @return {@code true} if attribute was changed (deleted) or {@code false} if attribute was not present in a first place
	 */
	boolean removeAttributeValue(PerunSessionImpl sess, Group group, Resource resource, AttributeDefinition attribute);
}


text:
/**
 *  Global app config
 *  @module lib/env/context
 *
 *  emits:
 *     + ENV_READY
 */

var __SASSDOCJS_VERSION = '0.0.1';

var _           = require('lodash'),
	_sd         = require('./const'),
	path        = require('path'),
	util        = require('util'),
	semver      = require('semver'),
	IO          = require('./io'),
	log         = require('../util/logger');

/**
 * object containing app & environment data
 */
var _env = {

	/**
	 * runtime related data
	 * @memberof env
	 */
	runenv: {
		start: new Date(),
		status: false,
		finish: null

	},

	/**
	 * file related environment data
	 * @memberof env
	 */
	fileparams: {},

	/**
	 * file data
	 * @memberof env
	 */
	files: {},

	/**
	 * project info settings - name, desctiption, etc
	 * @memberof env
	 */
	project: {},

	/**
	 * version of app used to build project
	 * @memberof env
	 */
	version: null,

	/**
	 * helper info
	 * @returns {object} project info
	 */
	projinfo: function() {

		return {
			name: this.project[_sd.ENV.PROJ_NAME].value,
			logo: this.project[_sd.ENV.PROJ_LOGO].value,
			description: this.project[_sd.ENV.PROJ_DESC].value,
			version: this.project[_sd.ENV.PROJ_VERSION].value,
			authors: this.project[_sd.ENV.PROJ_AUTHORS].value.split(','),
			contributors: this.project[_sd.ENV.PROJ_CONTRIB].value.split(','),
			status: this.project[_sd.ENV.PROJ_STATUS].value,
			created: new Date(),
			sassdocjs_version: __SASSDOCJS_VERSION
		};
	}
};

/**
 * Configure environment object, sourced from
 * defaults, yaml config, command line args
 *
 * @param {object} env
 */
function get_context(env) {

	var _self = this;
	var _cwd = process.cwd();

	this._config = {};

	/**
	 * helper to assign config item
	 * @param alias
	 * @param demand
	 * @param prop
	 * @param def
	 * @param desc
	 * @private
	 */
	var _assign = function(alias, demand, prop, val, desc) {
		this[prop] = {
			demand: demand, alias: alias, describe: desc, default: val
		};
	};

	/* defaults */
	(function(c){
		c.project = {};
		c.fileparams = {};
		c.runenv = {};

		var undef;

		_assign.call(c.project,     'name',         undef, _sd.ENV.PROJ_NAME,      'Untitled',      'name of the project');
		_assign.call(c.project,     'logo',         undef, _sd.ENV.PROJ_LOGO,      '',              'logo file url to appear in documentation header');
		_assign.call(c.project,     'desc',         undef, _sd.ENV.PROJ_DESC,      '',              'project description');
		_assign.call(c.project,     'version',      undef, _sd.ENV.PROJ_VERSION,   '0.0.1',         'version of the documentation');
		_assign.call(c.project,     'authors',      undef, _sd.ENV.PROJ_AUTHORS,   '',              'project author(s)');
		_assign.call(c.project,     'contrib',      undef, _sd.ENV.PROJ_CONTRIB,   '',              'project contributors');
		_assign.call(c.project,     'status',       undef, _sd.ENV.PROJ_STATUS,    '',              'project status');
		_assign.call(c.fileparams,  'exclude',      false, _sd.ENV.FILTER_EXCLUDE, [],              'file pattern for exclusion');
		_assign.call(c.fileparams,  'include',      false, _sd.ENV.FILTER_INCLUDE, ['.*\\.scss$'],  'file pattern for inclusion');
		_assign.call(c.fileparams,  'out',          false, _sd.ENV.PATH_DEST,      path.join(_cwd,  '../doc'), 'output directory for sass documentation');
		_assign.call(c.fileparams,  'templ',        false, _sd.ENV.PATH_TEMPLATE,  path.join(__dirname,       '../../template/build/'), 'path to output template directory');
		_assign.call(c.fileparams,  'recurse',      false, _sd.ENV.RECURSIVE,      false,           'recurse working directory for sass sources');
		_assign.call(c.runenv,      'prefix',       false, _sd.ENV.PREFIXED,       false,           'categorize by prefix (e.g. m- = module)');
		_assign.call(c.runenv,      'log',          false, _sd.ENV.LOG,            false,           'toggle logging');
		_assign.call(c.runenv,      'verbose',      false, _sd.ENV.VERBOSITY,      1,               'logging verbosity');
		_assign.call(c.runenv,      'config',       false, _sd.ENV.SAVE_CONFIG,    false,           'save .yml config file in working directory');
		_assign.call(c.runenv,      'limit',        false, _sd.ENV.WORKER_LIMIT,   4,               'set the allowed file parsing concurrencey');

	}(this._config));

	var _ops = {};
	var _sourcedir = _cwd;

	if(process.argv[2] && process.argv[2].charAt(0) != '-') {

		_sourcedir = path.resolve(process.argv[2]);
	}

	/* yml file */
	this._havefile = IO.getEnvironmentFile(_sourcedir, function(err, obj){

		if(err) { throw err; }

		if(obj && obj.project) {
			_.each(_self._config.project, function(item) {
				if(obj.project.hasOwnProperty(item.alias)) {
					item.default = obj.project[item.alias];
				}
			});
		}

		if(obj && obj.files) {
			_.each(_self._config.fileparams, function(item) {

				if(obj.files.hasOwnProperty(item.alias)) {
					item.default = obj.files[item.alias];
				}
			});
		}

		if(obj && obj.run) {
			_.each(_self._config.runenv, function(item) {
				if(obj.run.hasOwnProperty(item.alias)) {
					item.default = obj.run[item.alias];
				}
			});
		}

		_.defaults(_ops, _self._config.project, _self._config.fileparams, _self._config.runenv, { h: { alias: 'help', default:'', demand:false, describe:'show sassdocjs usage options' }} );

		/* command line */
		var optimist = require('optimist')
			.usage('Create documentation from Sass source files.\nUsage: sassdocjs [path] [options]')
			.options(_ops);

		_self._argv = optimist.argv;
		process.silent = false;

		if (_self._argv.help) {
			process.silent = true;
			optimist.showHelp();
			process.exit(0);
		}

		/* set config data in order of precedence: 1) argv 2) yaml 3) defaults */
		_.each(Object.keys(_self._config), function(key) {

			var propnames = Object.keys(_self._config[key]);

			for(var i=0;i<propnames.length;i++) {
				var obj = _self._config[key][propnames[i]];
			    obj.value = _self._argv[propnames[i]];
			}

		});

	});
	env.fileparams = this._config.fileparams;
	env.fileparams[_sd.ENV.PATH_INPUT] = _sourcedir;
	env.fileparams[_sd.ENV.PATH_OUTPUT] = path.resolve(this._config.fileparams[_sd.ENV.PATH_DEST].value);

	env.project = this._config.project;
	_.defaults(env.runenv, this._config.runenv);

	var _sassdoc_version = require('../../package.json').version;
	env.version = _sassdoc_version;

	env.serialize = function() {
		var _this = this;

		var _ex = _this.fileparams[_sd.ENV.FILTER_EXCLUDE].value,
			_in = _this.fileparams[_sd.ENV.FILTER_INCLUDE].value;

		if(Object.prototype.toString.call(_ex) === '[object Array]') {
			_ex = _ex.join(',');
		}

		if(Object.prototype.toString.call(_in) === '[object Array]') {
			_in = _in.join(',');
		}

		return {
			default: {
				project: {
					name: _this.project[_sd.ENV.PROJ_NAME].value,
					logo: _this.project[_sd.ENV.PROJ_LOGO].value,
					description: _this.project[_sd.ENV.PROJ_DESC].value,
					version: _this.project[_sd.ENV.PROJ_VERSION].value,
					authors: _this.project[_sd.ENV.PROJ_AUTHORS].value,
					contributors: _this.project[_sd.ENV.PROJ_CONTRIB].value,
					status: _this.project[_sd.ENV.PROJ_STATUS].value
				},
				files: {
					exclude: _ex,
					include: _in,
					out: _this.fileparams[_sd.ENV.PATH_DEST].value,
					templ: _this.fileparams[_sd.ENV.PATH_TEMPLATE].value,
					recurse: _this.fileparams[_sd.ENV.RECURSIVE].value
				},
				run: {
					prefix: _this.runenv[_sd.ENV.PREFIXED].value,
					log: _this.runenv[_sd.ENV.LOG].value,
					verbosity: _this.runenv[_sd.ENV.VERBOSITY].value,
					config: _this.runenv[_sd.ENV.SAVE_CONFIG].value,
					limit: _this.runenv[_sd.ENV.WORKER_LIMIT].value
				}
			}

		};
	};
}

/**
 * exports
 *
 * @param callback - callback function
 * @returns {boolean}
 */

new get_context(_env);
module.exports = _env;


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Myosotis albiflora Banks & Sol. ex Hook.f.

### Remarks
null


text:
package org.elasticsearch.search.aggregations;

import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntIntMap;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode;
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
import org.elasticsearch.search.aggregations.bucket.missing.Missing;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.test.ESIntegTestCase;
import org.hamcrest.Matchers;

import java.util.Collection;

import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
import static org.elasticsearch.search.aggregations.AggregationBuilders.missing;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNull.notNullValue;

/**
 *
 */
public class CombiIT extends ESIntegTestCase {

    /**
     * Making sure that if there are multiple aggregations, working on the same field, yet require different
     * value source type, they can all still work. It used to fail as we used to cache the ValueSource by the
     * field name. If the cached value source was of type "bytes" and another aggregation on the field required to see
     * it as "numeric", it didn't work. Now we cache the Value Sources by a custom key (field name + ValueSource type)
     * so there's no conflict there.
     */
    public void testMultipleAggsOnSameField_WithDifferentRequiredValueSourceType() throws Exception {

        createIndex("idx");
        IndexRequestBuilder[] builders = new IndexRequestBuilder[randomInt(30)];
        IntIntMap values = new IntIntHashMap();
        long missingValues = 0;
        for (int i = 0; i < builders.length; i++) {
            String name = "name_" + randomIntBetween(1, 10);
            if (rarely()) {
                missingValues++;
                builders[i] = client().prepareIndex("idx", "type").setSource(jsonBuilder()
                        .startObject()
                        .field("name", name)
                        .endObject());
            } else {
                int value = randomIntBetween(1, 10);
                values.put(value, values.getOrDefault(value, 0) + 1);
                builders[i] = client().prepareIndex("idx", "type").setSource(jsonBuilder()
                        .startObject()
                        .field("name", name)
                        .field("value", value)
                        .endObject());
            }
        }
        indexRandom(true, builders);
        ensureSearchable();

        SubAggCollectionMode aggCollectionMode = randomFrom(SubAggCollectionMode.values());
        SearchResponse response = client().prepareSearch("idx")
                .addAggregation(missing("missing_values").field("value"))
                .addAggregation(terms("values").field("value")
                        .collectMode(aggCollectionMode ))
                .execute().actionGet();

        assertSearchResponse(response);

        Aggregations aggs = response.getAggregations();

        Missing missing = aggs.get("missing_values");
        assertNotNull(missing);
        assertThat(missing.getDocCount(), equalTo(missingValues));

        Terms terms = aggs.get("values");
        assertNotNull(terms);
        Collection<Terms.Bucket> buckets = terms.getBuckets();
        assertThat(buckets.size(), equalTo(values.size()));
        for (Terms.Bucket bucket : buckets) {
            values.remove(((Number) bucket.getKey()).intValue());
        }
        assertTrue(values.isEmpty());
    }

    /**
     * Some top aggs (eg. date_/histogram) that are executed on unmapped fields, will generate an estimate count of buckets - zero.
     * when the sub aggregator is then created, it will take this estimation into account. This used to cause
     * and an ArrayIndexOutOfBoundsException...
     */
    public void testSubAggregationForTopAggregationOnUnmappedField() throws Exception {

        prepareCreate("idx").addMapping("type", jsonBuilder()
                .startObject()
                .startObject("type").startObject("properties")
                    .startObject("name").field("type", "text").endObject()
                    .startObject("value").field("type", "integer").endObject()
                .endObject().endObject()
                .endObject()).execute().actionGet();

        ensureSearchable("idx");

        SubAggCollectionMode aggCollectionMode = randomFrom(SubAggCollectionMode.values());
        SearchResponse searchResponse = client().prepareSearch("idx")
                .addAggregation(histogram("values").field("value1").interval(1)
                        .subAggregation(terms("names").field("name")
                                .collectMode(aggCollectionMode )))
                .execute().actionGet();

        assertThat(searchResponse.getHits().getTotalHits(), Matchers.equalTo(0L));
        Histogram values = searchResponse.getAggregations().get("values");
        assertThat(values, notNullValue());
        assertThat(values.getBuckets().isEmpty(), is(true));
    }
}


text:
var InternalResources = require('../lib/resources/internal-resources')
  , Files = require('../lib/resources/files')
  , config = require('../lib/config-loader')
  , sh = require('shelljs')
  , fs = require('fs')
  , path = require('path')
  , testCollection = {type: 'Collection', path: '/my-objects', properties: {title: {type: 'string'}}}
  , Collection = require('../lib/resources/collection')
  , ClientLib = require('../lib/resources/client-lib')
  , configPath = './test/support/proj'
  , Dashboard = require('../lib/resources/dashboard');

describe('InternalResources', function() {
  describe('.handle(ctx)', function() {
    beforeEach(function() {
      // reset
      sh.rm('-rf', __dirname + '/support/proj');
      if(!sh.test('-d', __dirname + '/support/proj')) {
        sh.mkdir(__dirname + '/support/proj');
        sh.mkdir('-p', __dirname + '/support/proj/resources');
      }

      this.ir = new InternalResources('__resources', {config: {configPath: configPath}});
    });

    it('should require root access', function(done) {
      var r = {type: 'Bar'}
        , created = false;

      this.ir.handle({req: {method: 'POST', url: '/__resources/foo'}, body: r, done: function(err, resource) {
        expect(resource).to.not.exist;
        expect(err).to.exist;
        expect(err.statusCode).to.equal(401);
        done();
      }});
    });

    it('should not allow a generic POST', function(done) {
      var r = {type: 'Bar'}
        , created = false;

      this.ir.handle({req: {method: 'POST', url: '/__resources', isRoot: true}, body: r, done: function(err, resource) {
        expect(resource).to.not.exist;
        expect(err).to.exist;
        expect(err.statusCode).to.equal(400);
        done();
      }});
    });

    it('should create a resource when handling a POST request', function(done) {
      var r = {type: 'Bar'}
        , created = false;

      this.ir.handle({req: {method: 'POST', url: '/__resources/foo', isRoot: true}, url: '/foo', body: r, done: function(err, resource) {
        if (err) return done(err);
        expect(resource.type).to.equal('Bar');
        var file = path.join(configPath, '/resources/foo/config.json');
        expect(sh.test('-f', file)).to.be.ok;
        expect(JSON.parse(sh.cat(file)).type).to.equal('Bar');
        done();
      }});
    });

    it('should save a file when handling a POST request', function(done) {
      var r = {type: 'Bar'}
        , created = false;

      sh.mkdir('-p', path.join(configPath, 'resources/foo'));
      JSON.stringify(r).to(path.join(configPath, 'resources/foo/config.json'));

      this.ir.handle({req: {method: 'POST', url: '/__resources/foo/get.js', isRoot: true}, url: '/foo/get.js', body: {value: "this.foo = 'bar';"}, done: function(err, resource) {
        if (err) return done(err);
        var fileVal = sh.cat(path.join(configPath, 'resources/foo/get.js'));
        expect(fileVal).to.exist.and.to.equal("this.foo = 'bar';");
        done();
      }});
    });

    it('should update a resource when handling a PUT request', function(done) {
      var r = {type: 'Bar', val: 1};
      var test = this;

      sh.mkdir('-p', path.join(configPath, 'resources/foo'));
      JSON.stringify(r).to(path.join(configPath, 'resources/foo/config.json'));

      r.val = 2;
      test.ir.handle({req: {method: 'PUT', url: '/__resources/foo', isRoot: true}, url: '/foo', body: r, done: function() {
        var file = path.join(configPath, '/resources/foo/config.json');
        expect(JSON.parse(sh.cat(file)).val).to.equal(2);
        done();
      }}, function() {
        throw Error("next called");
      });

    });

    it('should partially update a resource when handing a PUT request', function(done) {
      var r = {type: 'Bar', val: 1, other: 'test'};
      var test = this;

      sh.mkdir('-p', path.join(configPath, 'resources/foo'));
      JSON.stringify(r).to(path.join(configPath, 'resources/foo/config.json'));
      test.ir.handle({req: {method: 'PUT', url: '/__resources/foo', isRoot: true}, url: '/foo', body: {val: 2}, done: function() {
        var file = path.join(configPath, '/resources/foo/config.json');
        var json = JSON.parse(sh.cat(file));
        expect(json.val).to.equal(2);
        expect(json.other).to.equal('test');
        done();
      }}, function() {
        throw Error("next called");
      });

    });

    it('should update a resource when handing a PUT request with $setAll', function(done) {
      var r = {type: 'Bar', val: 1, other: 'test'};
      var test = this;

      sh.mkdir('-p', path.join(configPath, 'resources/foo'));
      JSON.stringify(r).to(path.join(configPath, 'resources/foo/config.json'));
      test.ir.handle({req: {method: 'PUT', url: '/__resources/foo', isRoot: true}, url: '/foo', body: {type: 'Bar', val: 2, $setAll: true}, done: function() {
        var file = path.join(configPath, '/resources/foo/config.json');
        var json = JSON.parse(sh.cat(file));

        expect(json.val).to.equal(2);
        expect(json.other).to.not.exist;
        done();
      }}, function() {
        throw Error("next called");
      });

    });

    it('should find all resources when handling a GET request', function(done) {
      var q = {type: 'Bar'}
        , q2 = {type: 'Bar'}
        , test = this;

      sh.mkdir('-p', path.join(configPath, 'resources/foo'));
      sh.mkdir('-p', path.join(configPath, 'resources/bar'));
      JSON.stringify(q).to(path.join(configPath, 'resources/foo/config.json'));
      JSON.stringify(q2).to(path.join(configPath, 'resources/bar/config.json'));

      test.ir.handle({req: {method: 'GET', url: '/__resources', isRoot: true}, url: '/', done: function(err, result) {
        if (err) return done(err);
        expect(result).to.have.length(2);
        result.forEach(function(r) {
          expect(r.id).to.exist;
        });
        done();
      }}, function() {
        throw Error("next called");
      });
    });

    it('should find a single resource when handling a GET request', function(done) {
      var q = {type: 'Bar'}
        , q2 = {type: 'Bar'}
        , test = this;

      sh.mkdir('-p', path.join(configPath, 'resources/foo'));
      sh.mkdir('-p', path.join(configPath, 'resources/bar'));
      JSON.stringify(q).to(path.join(configPath, 'resources/foo/config.json'));
      JSON.stringify(q2).to(path.join(configPath, 'resources/bar/config.json'));

      test.ir.handle({req: {method: 'GET', url: '/__resources/bar', isRoot: true}, url: '/bar', done: function(err, result) {
        if (err) return done(err);
        expect(result).to.exist;
        expect(result.id).to.equal('bar');
        expect(result.type).to.equal('Bar');
        done();
      }}, function() {
        throw Error("next called");
      });
    });

    it('should delete a resource when handling a DELETE request', function(done) {
      var q = {path: '/foo', type: 'Bar'}
        , q2 = {path: '/bar', type: 'Bar'}
        , test = this;

        sh.mkdir('-p', path.join(configPath, 'resources/foo'));
        sh.mkdir('-p', path.join(configPath, 'resources/bar'));
        JSON.stringify(q).to(path.join(configPath, 'resources/foo/config.json'));
        JSON.stringify(q2).to(path.join(configPath, 'resources/bar/config.json'));

        test.ir.handle({req: {method: 'DELETE', url: '/__resources/bar', isRoot: true}, url: '/bar', done: function() {
          expect(sh.test('-d', path.join(configPath, 'resources/bar'))).to.not.be.ok;
          done();
        }}, function() {
          throw Error("next called");
        });
    });
  });
});


text:
"use strict";
module.exports = require("./color_box/color_box");
module.exports.default = module.exports;


text:
<?php

  require('includes/application_top.php');

 $slideshow_dir = 'slideshow/';

  define('DIR_FS_CATALOG_SLIDES', DIR_FS_CATALOG_IMAGES . $slideshow_dir);
  define('DIR_WS_CATALOG_SLIDES', DIR_WS_CATALOG_IMAGES . $slideshow_dir);

  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

  if (tep_not_null($action)) {
    switch ($action) {
      case 'insert':
      case 'save':
        if (isset($HTTP_GET_VARS['slideID'])) $slideshow_id = tep_db_prepare_input($HTTP_GET_VARS['slideID']);
        $slideshow_name = tep_db_prepare_input($HTTP_POST_VARS['slideshow_name']);
		 $slideshow_url = tep_db_prepare_input($HTTP_POST_VARS['slideshow_url']);
		 $slideshow_addtocart = tep_db_prepare_input($HTTP_POST_VARS['slideshow_addtocart']);
		 $slideshow_description = tep_db_prepare_input($HTTP_POST_VARS['slideshow_description']);

        $sql_data_array = array('slideshow_name' => $slideshow_name,
								'slideshow_url' => $slideshow_url,
								'slideshow_addtocart' => $slideshow_addtocart,
		                        'slideshow_description' => $slideshow_description);

        if ($action == 'insert') {
          $insert_sql_data = array('date_added' => 'now()');

          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

          tep_db_perform(TABLE_SLIDESHOW, $sql_data_array);
          $slideshow_id = tep_db_insert_id();
        } elseif ($action == 'save') {
          $update_sql_data = array('last_modified' => 'now()');

          $sql_data_array = array_merge($sql_data_array, $update_sql_data);

          tep_db_perform(TABLE_SLIDESHOW, $sql_data_array, 'update', "slideshow_id = '" . (int)$slideshow_id . "'");
        }

	  if($_FILES['slideshow_image']['size']!=0){

	  $slideshow_image = new upload('slideshow_image', DIR_FS_CATALOG_SLIDES);

	    if ($slideshow_image) {
          tep_db_query("update " . TABLE_SLIDESHOW . " set slideshow_image = '" .$slideshow_dir . $slideshow_image->filename . "' where slideshow_id = '" . (int)$slideshow_id . "'");
        }

	  }

	if (USE_CACHE == 'true') {
          tep_reset_cache_block('slideshow');
        }

        tep_redirect(tep_href_link(FILENAME_SLIDESHOW, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'slideID=' . $slideshow_id));
        break;
      case 'deleteconfirm':
        $slideshow_id = tep_db_prepare_input($HTTP_GET_VARS['slideID']);

        if (isset($HTTP_POST_VARS['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) {
          $slideshow_query = tep_db_query("select slideshow_image from " . TABLE_SLIDESHOW . " where slideshow_id = '" . (int)$slideshow_id . "'");
          $slideshow = tep_db_fetch_array($slideshow_query);

          $image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_SLIDES . $slideshow['slideshow_image'];

          if (file_exists($image_location)) @unlink($image_location);
        }

        tep_db_query("delete from " . TABLE_SLIDESHOW . " where slideshow_id = '" . (int)$slideshow_id . "'");

        if (USE_CACHE == 'true') {
          tep_reset_cache_block('slideshow');
        }

        tep_redirect(tep_href_link(FILENAME_SLIDESHOW, 'page=' . $HTTP_GET_VARS['page']));
        break;
    }
  }

require(DIR_WS_INCLUDES . 'template_top.php');
?>

            <?php echo HEADING_TITLE; ?>
            <?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>

                <?php echo TABLE_HEADING_SLIDESHOW; ?>
                <?php echo TABLE_HEADING_ACTION; ?>

<?php
  $slideshow_query_raw = "select slideshow_id, slideshow_name, slideshow_description, slideshow_image, slideshow_url, slideshow_addtocart, date_added, last_modified from " . TABLE_SLIDESHOW . " order by slideshow_id";
  $slideshow_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $slideshow_query_raw, $slideshow_query_numrows);
  $slideshow_query = tep_db_query($slideshow_query_raw);

  while ($slideshow = tep_db_fetch_array($slideshow_query)) {

   if ((!isset($HTTP_GET_VARS['slideID']) || (isset($HTTP_GET_VARS['slideID']) && ($HTTP_GET_VARS['slideID'] == $slideshow['slideshow_id']))) && !isset($sdInfo) && (substr($action, 0, 3) != 'new')) {

      $sdInfo = new objectInfo($slideshow);
    }
 if (isset($sdInfo) && is_object($sdInfo) && ($slideshow['slideshow_id'] == $sdInfo->slideshow_id)) {
      echo '
' . "\n";
    } else {
      echo '
' . "\n";
    }
?>
                <?php echo $slideshow['slideshow_name']; ?>
                <?php if (isset($sdInfo) && is_object($sdInfo) && ($slideshow['slideshow_id'] == $sdInfo->slideshow_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>

<?php
  }
?>

                    <?php echo $slideshow_split->display_count($slideshow_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SLIDES); ?>
                    <?php echo $slideshow_split->display_links($slideshow_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>

<?php
  if (empty($action)) {
?>

                <?php echo 'slideshow_id . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?>

<?php
  }
?>

<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'new':
      $heading[] = array('text' => '' . TEXT_HEADING_NEW_SLIDE . '');

      $contents = array('form' => tep_draw_form('slideshow', FILENAME_SLIDESHOW, 'action=insert', 'post', 'enctype="multipart/form-data"'));
      $contents[] = array('text' => TEXT_NEW_INTRO);
      $contents[] = array('text' => '
' . TEXT_SLIDESHOW_NAME . '
' . tep_draw_input_field('slideshow_name'));
	  $contents[] = array('text' => '
' . TEXT_SLIDESHOW_DESCRIPTION . '
' . tep_draw_textarea_field('slideshow_description','',50,10));
      $contents[] = array('text' => '
' . TEXT_SLIDESHOW_IMAGE . '
' . tep_draw_file_field('slideshow_image'));
      $contents[] = array('text' => '
' . TEXT_SLIDESHOW_URL . '
' . tep_draw_input_field('slideshow_url'));
      $contents[] = array('text' => '
' . TEXT_SLIDESHOW_ADD_TO_CART . '
' . tep_draw_input_field('slideshow_addtocart'));

      $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
      break;
    case 'edit':
      $heading[] = array('text' => '' . TEXT_HEADING_EDIT_SLIDE . '');

      $contents = array('form' => tep_draw_form('slideshow', FILENAME_SLIDESHOW, 'page=' . $HTTP_GET_VARS['page'] . '&slideID=' . $sdInfo->slideshow_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
      $contents[] = array('text' => TEXT_EDIT_INTRO);
      $contents[] = array('text' => '
' . TEXT_SLIDESHOW_NAME . '
' . tep_draw_input_field('slideshow_name', $sdInfo->slideshow_name));
     $contents[] = array('text' => '
' . TEXT_SLIDESHOW_DESCRIPTION . '
' . tep_draw_textarea_field('slideshow_description', 'soft',50,10,$sdInfo->slideshow_description));

	 if($sdInfo->slideshow_image) $slideshow_image_src = 'slideshow_image. '">';

	  $contents[] = array('text' => '
' . TEXT_SLIDESHOW_IMAGE . '
' . tep_draw_file_field('slideshow_image') . '
' . $slideshow_image_src);
      $contents[] = array('text' => '
' . TEXT_SLIDESHOW_URL . '
' . tep_draw_input_field('slideshow_url', $sdInfo->slideshow_url));
      $contents[] = array('text' => '
' . TEXT_SLIDESHOW_ADD_TO_CART . '
' . tep_draw_input_field('slideshow_addtocart', $sdInfo->slideshow_addtocart));

	  $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' slideshow_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
      break;
    case 'delete':
      $heading[] = array('text' => '' . TEXT_HEADING_DELETE_SLIDE . '');

      $contents = array('form' => tep_draw_form('slideshow', FILENAME_SLIDESHOW, 'page=' . $HTTP_GET_VARS['page'] . '&slideID=' . $sdInfo->slideshow_id . '&action=deleteconfirm'));
      $contents[] = array('text' => TEXT_DELETE_INTRO);
      $contents[] = array('text' => '
' . $sdInfo->slideshow_name . '');
	  $contents[] = array('text' => '
' . $sdInfo->slideshow_description . '');
      $contents[] = array('text' => '
' . tep_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE);
      $contents[] = array('text' => '
' . $sdInfo->slideshow_url . '');
      $contents[] = array('text' => '
' . $sdInfo->slideshow_addtocart . '');

      $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' slideshow_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
      break;
    default:
      if (isset($sdInfo) && is_object($sdInfo)) {
        $heading[] = array('text' => '' . $sdInfo->slideshow_name . '');

        $contents[] = array('align' => 'center', 'text' => 'slideshow_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . ' slideshow_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '');
        $contents[] = array('text' => '
' . TEXT_DATE_ADDED . ' ' . tep_date_short($sdInfo->date_added));

        if (tep_not_null($sdInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($sdInfo->last_modified));
        $contents[] = array('text' => '
' . tep_info_image($sdInfo->slideshow_image, $sdInfo->slideshow_name));
        $contents[] = array('text' => '
' . TEXT_SLIDESHOW_URL . ' ' . $sdInfo->slideshow_url);
        $contents[] = array('text' => '
' . TEXT_SLIDESHOW_URL . ' ' . $sdInfo->slideshow_addtocart);
      }
      break;
  }

  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
    echo '            ' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            	' . "\n";
  }
?>

<?php
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>


text:
extern int powerupSize [MAX_POWERUP_IDS_D2];

extern int robotSize [MAX_ROBOT_IDS_TOTAL];

extern int robotShield [MAX_ROBOT_IDS_TOTAL];

extern ubyte robotClip [MAX_ROBOT_IDS_TOTAL];

extern ubyte powerupClip [MAX_POWERUP_IDS_D2];

extern ubyte powerupTypeTable [MAX_POWERUP_IDS_D2];

//------------------------------------------------------------------------

typedef struct {
  short jointnum;
  CAngleVector angles;
} JOINTPOS;

//------------------------------------------------------------------------

typedef struct {
  ubyte	renderType;		// How to draw 0=laser, 1=blob, 2=object
  ubyte	persistent;		// 0 = dies when it hits something, 1 = continues (eg, fusion cannon)
  short	nModel;			// Model num if rendertype==2.
  short	nInnerModel;	// Model num of inner part if rendertype==2.

  ubyte	flash_vclip;		// What vclip to use for muzzle flash
  ubyte	robot_hit_vclip;	// What vclip for impact with robot
  short	flash_sound;		// What sound to play when fired

  ubyte	wall_hit_vclip;	// What vclip for impact with wall
  ubyte	fire_count;			// Number of bursts fired from EACH GUN per firing.
									// ..For weapons which fire from both sides, 3*fire_count shots will be fired.
  short	robot_hit_sound;	// What sound for impact with robot

  ubyte	ammo_usage;			// How many units of ammunition it uses.
  ubyte	weapon_vclip;		// Vclip to render for the weapon, itself.
  short	wall_hit_sound;	// What sound for impact with wall

  ubyte	destructible;		// If !0, this weapon can be destroyed by another weapon.
  ubyte	matter;				// Flag: set if this object is matter (as opposed to energy)
  ubyte	bounce;				// 1==always bounces, 2=bounces twice
  ubyte	homing_flag;		// Set if this weapon can home in on a target.

  ubyte	speedvar;			// allowed variance in speed below average, /128: 64 = 50% meaning if speed = 100,
									// ..can be 50..100

  ubyte	flags;				// see values above
  ubyte	flash;				// Flash effect
  ubyte	afterburnerSize;	// Size of blobs in F1_0/16 units, specify in bitmaps.tbl as floating point. Player afterburner size = 2.5.
  ubyte	children;				// ID of weapon to drop if this contains children.  -1 means no children.
  int		energy_usage;			// How much fuel is consumed to fire this weapon.
  int		fire_wait;				// Time until this weapon can be fired again.
  int		multi_damage_scale;	// Scale damage by this amount when applying to player in multiplayer. F1_0 means no change.
  ushort bitmap;					// Pointer to bitmap if rendertype==0 or 1.
  int		blobSize;				// Size of blob if blob type
  int		flashSize;				// How big to draw the flash
  int		impactSize;				// How big of an impact
  int		strength[NDL];			// How much damage it can inflict
  int		speed[NDL];				// How fast it can move, difficulty level based.
  int		mass;						// How much mass it has
  int		drag;						// How much drag it has
  int		thrust;					// How much thrust it has
  int		poLenToWidthRatio;	// For polyobjects, the ratio of len/width. (10 maybe?)
  int		light;					// Amount of light this weapon casts.
  int		lifetime;				// Lifetime in seconds of this weapon.
  int		damageRadius;			// Radius of damage caused by weapon, used for missiles (not lasers) to apply to damage to things it did not hit
  ushort	picture [2];			// a picture and a hires picture of the weapon for the cockpit
} WEAPON_INFO;

//------------------------------------------------------------------------

typedef struct {
  int		nAnimation;
  int		hit_sound;
  int		size;				// 3d size of longest dimension
  int		light;			// amount of light cast by this powerup, set in bitmaps.tbl
} POWERUP_TYPE_INFO;

//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------

class CObjPhysicsInfo {
public:
	tFixVector velocity;   // velocity vector of this object
	tFixVector thrust;     // constant force applied to this object
	int        mass;       // the mass of this object
	int        drag;       // how fast this slows down
	int        brakes;     // how much brakes applied
	tFixVector rotVel;     // rotational velecity (angles)
	tFixVector rotThrust;  // rotational acceleration
	short     turnRoll;    // rotation caused by turn banking
	ushort     flags;      // misc physics flags

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------
// stuctures for different kinds of simulation

class CObjLaserInfo {
public:
	short parent_type;   // The type of the parent of this object
	short parent_num;    // The object's parent's number
	int parent_signature;// The object's parent's signature...
	int creation_time;   //  Absolute time of creation.
	ubyte last_hitobj;    //  For persistent weapons (survive object collision), object it most recently hit.
	ubyte track_goal;     //  Object this object is tracking.
	int multiplier;		//  Power if this is a fusion bolt (or other super weapon to be added).

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CObjExplosionInfo {
public:
	int   spawn_time;     // when lifeleft is < this, spawn another
	int   delete_time;    // when to delete object
	ubyte  delete_objnum;  // and what object to delete
	ubyte  attach_parent;  // explosion is attached to this object
	ubyte  prev_attach;    // previous explosion in attach list
	ubyte  next_attach;    // next explosion in attach list

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CObjLightInfo {
public:
  int  intensity;    // how bright the light is

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CObjPowerupInfo {
public:
	int  count;      // how many/much we pick up (vulcan cannon only?)

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CObjAnimationInfo {
public:
	int	nAnimation;
	int	nFrameTime;
	ubyte	nFrame;

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------
// structures for different kinds of rendering

class CObjPolyModelInfo {
public:
	int      nModel;				// which polygon model
	tAngleVector anim_angles[MAX_SUBMODELS];  // angles for each subobject
	int      subobj_flags;     // specify which subobjs to draw
	int      nOverrideTexture;    // if this is not -1, map all face to this
	ubyte     alt_textures;     // if not -1, use these textures instead

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CObjAIInfo {
public:
	ubyte  behavior;
	ubyte   flags[MAX_AI_FLAGS]; // various flags, meaning defined by constants
	short  hide_segment;        // Segment to go to for hiding.
	short  hide_index;          // Index in Path_seg_points
	short  path_length;         // Length of hide path.
	short  cur_path_index;      // Current index in path.

	short  follow_path_start_seg;  // Start segment for robot which follows path.
	short  follow_path_end_seg;    // End segment for robot which follows path.

	int  danger_laser_signature;
	short  danger_laser_num;

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CParticleInfo {
public:
	int			nLife;
	int			nSize [2];
	int			nParts;
	int			nSpeed;
	int			nDrift;
	int			nBrightness;
	ubyte			color [4];
	ubyte			nSide;
	ubyte			nType;
	ubyte			bEnabled;

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CLightningInfo {
public:
	int			nLife;
	int			nDelay;
	int			nLength;
	int			nAmplitude;
	int			nOffset;
	int			nWayPoint;
	short			nBolts;
	short			nId;
	short			nTarget;
	short			nNodes;
	short			nChildren;
	short			nFrames;
	ubyte			nWidth;
	ubyte			nAngle;
	ubyte			nStyle;
	ubyte			nSmoothe;
	ubyte			bClamp;
	ubyte			bPlasma;
	ubyte			bSound;
	ubyte			bRandom;
	ubyte			bInPlane;
	ubyte			bEnabled;
	ubyte			color [4];

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CSoundInfo {
public:
	int			nVolume;
	char			szFilename [40];
	ubyte			bEnabled;

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
};

//------------------------------------------------------------------------

class CWayPointInfo {
public:
	int			nId;
	int			nSuccessor;
	int			nSpeed;

	void Read (CFileManager* fp);
	void Write (CFileManager* fp);
	};

//------------------------------------------------------------------------

typedef struct tObjContentsInfo {
public:
	ubyte			type;  // Type of object this object contains (eg, spider contains powerup)
	ubyte			id;    // ID of object this object contains (eg, id = blue type = key)
	ubyte			count; // number of objects of type:id this object contains
} tObjContentsInfo;

//------------------------------------------------------------------------

typedef struct CObjLocationInfo {
public:
	CVertex			pos;           // absolute x,y,z coordinate of center of object
	CVertex			lastPos;			// where object was last frame
	CDoubleMatrix	orient;        // orientation of object in world

	inline void Clear (void) {
		pos.Clear ();
		lastPos.Clear ();
		orient.Clear ();
		}

	inline void operator+= (CDoubleVector v) {
		pos += v;
		lastPos += v;
		}

	inline void operator-= (CDoubleVector v) {
		pos -= v;
		lastPos -= v;
		}

} tObjLocationInfo;

//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------

typedef struct tGameObject {
	short				signature;     // reduced size to save memory
	ubyte				type;          // what type of object this is... robot, weapon, hostage, powerup, fireball
	ubyte				id;            // which form of object...which powerup, robot, etc.
	ubyte				controlType;   // how this object is controlled
	ubyte				movementType;  // how this object moves
	ubyte				renderType;    // how this object renders
	ubyte				flags;         // misc flags
	ubyte				multiplayer;   // object only available in multiplayer games
	short				nSegment;      // segment number containing object
	tObjContentsInfo contents;
	int				size;          // 3d size of object - for collision detection
	int				shields;       // Starts at maximum, when <0, object dies..
} tGameObject;

class CGameObject : public CGameItem {
	public:
		tGameObject			m_info;
		CObjLocationInfo	m_location;

		// movement info, determined by MOVEMENT_TYPE
		union {
			CObjPhysicsInfo	physInfo; // a physics object
			tFixVector			spinRate; // for spinning objects
			} mType;

		// control info, determined by CONTROL_TYPE
		union {
			CObjLaserInfo     laserInfo;
			CObjExplosionInfo explInfo;   //NOTE: debris uses this also
			CObjAIInfo			aiInfo;
			CObjLightInfo     lightInfo;  //why put this here?  Didn't know what else to do with it.
			CObjPowerupInfo   powerupInfo;
			CWayPointInfo		wayPointInfo;
			} cType;

		// render info, determined by RENDER_TYPE
		union {
			CObjPolyModelInfo	polyModelInfo; //polygon model
			CObjAnimationInfo	animationInfo;	//vclip
			CParticleInfo		particleInfo;
			CLightningInfo		lightningInfo;
			CSoundInfo			soundInfo;
			} rType;

		// CGameObject () { memset (this, 0, sizeof (*this)); }
		inline tObjContentsInfo& Contents (void) { return m_info.contents; }

		inline tGameObject& Info (void) { return m_info; }

		inline ubyte& Id (void) { return m_info.id; }

		inline ubyte& Type (void) { return m_info.type; }

		void Read (CFileManager* fp = 0, bool bFlag = false);

		void Write (CFileManager* fp = 0, bool bFlag = false);

		void Create (ubyte type, short nSegment);

		void Setup (ubyte type);

		void DrawBitmap (CWnd* pWindow);

		int DrawArrow (CRenderer& renderer, int bCurrent);

		bool DrawSprite (CRenderer& renderer);

		void DrawHighlight (CRenderer& renderer, int bCurrent);

		bool IsInView (CRenderer& renderer, bool wholeObject);

		CVertex& Transform (CVertex& vDest, CVertex& vSource);

		int CheckNormal (CViewMatrix& viewMatrix, CVertex& a, CVertex& b);

		int CheckNormal (CViewMatrix& viewMatrix, CFixVector& a, CFixVector& b);

		CSegment* Segment (void);

		inline CDoubleVector& Position (void) { return m_location.pos; }

		inline CDoubleMatrix& Orient (void) { return m_location.orient; }

		virtual void Clear (void) {
			memset (&m_info, 0, sizeof (m_info));
			m_location.Clear ();
			}

		inline bool IsD2X (void) { return m_info.type >= OBJ_CAMBOT; }

		inline bool IsVertigo (void) { return (m_info.type == OBJ_ROBOT) && (m_info.id > N_ROBOT_TYPES_D2); }

		virtual CGameItem* Clone (void);

		virtual void Backup (eEditType editType = opModify);

		virtual CGameItem* Copy (CGameItem* pDest);

		virtual void Undo (void);

		virtual void Redo (void);

		int Contains (ubyte nType);

		int TypeContains (ubyte nType);

		bool IsBoss (void);

		inline bool HasPolyModel (void) {
			return (m_info.renderType == RT_POLYOBJ) &&
					 (Type () != OBJ_CAMBOT) &&
					 (Type () != OBJ_MONSTERBALL) &&
					 (Type () != OBJ_EXPLOSION) &&
					 (Type () != OBJ_SMOKE) &&
					 (Type () != OBJ_EFFECT);
			}

		inline bool HasSprite (void) {
				return (Type () == OBJ_EFFECT) ||
						 (m_info.renderType == RT_WEAPON_VCLIP) ||
						 (m_info.renderType == RT_HOSTAGE) ||
						 (m_info.renderType == RT_POWERUP) ||
						 (m_info.renderType == RT_FIREBALL);
			}

		short Sprite (void);

		bool CheckEffectType (bool bFix = true);
	};

//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------

#endif // __gameobject_h


text:
package pals.plugins.handlers.defaultqch.data;

import java.io.Serializable;

/**
 * Stores the criteria settings for Java Custom criteria.
 *
 * @version 1.0
 */
public class JavaCustom_Criteria implements Serializable
{
    static final long serialVersionUID = 1L;

    // Fields ******************************************************************
    private String                  className,
                                    method;
    private int                     messageThreshold;
    // Methods - Constructors **************************************************
    /**
     * Creates a new instance.
     *
     * @since 1.0
     */
    public JavaCustom_Criteria()
    {
        this.className = null;
        this.method = null;
        this.messageThreshold = 30;
    }
    // Methods - Mutators ******************************************************
    /**
     * Sets the entry-point class-name.
     *
     * @param className The full class-name.
     * @since 1.0
     * @return True = updated, false = invalid.
     */
    public boolean setClassName(String className)
    {
        if(className == null || className.length() < 0)
            return false;
        this.className = className;
        return true;
    }
    /**
     * Sets the entry-point method name.
     *
     * @param method The method name.
     * @since 1.0
     * @return True = updated, false = invalid.
     */
    public boolean setMethod(String method)
    {
        if(className == null || className.length() < 0)
            return false;
        this.method = method;
        return true;
    }
    /**
     * Sets the maximum number of feedback messages allowed.
     *
     * @param messageThreshold Must be 1 or greater.
     * @since 1.0
     */
    public void setMessageThreshold(int messageThreshold)
    {
        this.messageThreshold = messageThreshold;
    }
    // Methods - Accessors *****************************************************
    /**
     * Retrieves the entry-point class-name.
     *
     * @return Full class-name.
     * @since 1.0
     */
    public String getClassName()
    {
        return className;
    }
    /**
     * Retrieves the entry-point method.
     *
     * @return Method name.
     * @since 1.0
     */
    public String getMethod()
    {
        return method;
    }
    /**
     * The maximum allowed feedback messages. Once exceeded, the process is
     * terminated.
     *
     * @return Maximum number of feedback messages.
     * @since 1.0
     */
    public int getMessageThreshold()
    {
        return messageThreshold;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scheme_element"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:id="@+id/time"
        android:layout_width="wrap_content"
        android:layout_height="100dp"
        android:layout_centerVertical="true"

        >

        <View
            android:layout_width="5dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="70dp"
            android:background="@color/white"
            android:id="@+id/line"
             />

        <ImageView
            android:id="@+id/scheme_element_image"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_centerVertical="true"
            android:src="@drawable/test_nojen"
            android:layout_marginLeft="33dp"
            android:contentDescription="@string/picture"
            />

        <se.lundakarnevalen.extern.widget.LKTextView
            android:id="@+id/time1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/white"
            android:layout_alignTop="@id/scheme_element_image"
            android:layout_alignLeft="@id/scheme_element_image"
            android:layout_marginLeft="-26dp"
            android:textSize="11sp"
            android:padding="2dp"
            android:gravity="center"
            android:shadowRadius="1"
            android:shadowDy="1"
            android:shadowColor="@color/black"
            android:text="16:00"/>
        <se.lundakarnevalen.extern.widget.LKTextView
            android:id="@+id/time2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@id/scheme_element_image"
            android:textColor="@color/white"
            android:layout_alignLeft="@id/scheme_element_image"
            android:layout_marginLeft="-26dp"
            android:textSize="11sp"
            android:gravity="center"
            android:padding="2dp"
            android:shadowRadius="1"
            android:shadowDy="1"
            android:shadowColor="@color/black"

            android:text="16:00"/>

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/desc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@id/time"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="50dp"
        >
        <se.lundakarnevalen.extern.widget.LKTextView
            android:id="@+id/place"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/white"
            android:textSize="10sp"
            android:shadowRadius="1"
            android:shadowDy="1"
            android:paddingLeft="1dp"
            android:paddingRight="1dp"
            android:gravity="center"
            android:shadowColor="@color/black"
            android:text="@string/dansen_place"/>
  <se.lundakarnevalen.extern.widget.LKTextView
            android:id="@+id/name"
            android:paddingLeft="1dp"
      android:paddingRight="1dp"
      android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/place"
            android:textColor="@color/white"
            android:textSize="18sp"
      android:shadowRadius="1"
      android:shadowDy="1"
      android:shadowColor="@color/black"
            android:text="@string/dansen_title"/>

    </RelativeLayout>
    <RelativeLayout
        android:id="@+id/heart"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_alignParentRight="true"

        >
        <ImageView
            android:id="@+id/heart_image"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_marginRight="16dp"
            android:layout_alignParentRight="true"
            android:src="@drawable/heart_clicked"
            android:contentDescription="@string/picture"
            />
</RelativeLayout>

</RelativeLayout>


text:
/* dbticket/mod_trailer.c
 * (c) jan (dfragment.net) 2015
 * Licensed under MIT licence.
 */

#include <stdio.h>
#include <stdlib.h>

#include "modules.h"

/* So far all calculated offsets were a good guess, and it was sufficient
 * in all cases. Now we want more -- official counts and offsets.
 * For that, we need the trailer and the xref table.
 *
 * Recommended procedure: find the last startxref, parse xref table, then
 * read the following trailer dict. Every PDF library on this planet uses
 * the recommended section order, so we'll rely on it.
 */

int * readXrefTable(FILE *file, int *entryCount)
{
	// TODO Deal with these damn HTML appendices.
	int xrefStart = getXrefLocation(file) + 5; // skips "xref\n"
	fseek(file, xrefStart, SEEK_SET);
	char nums[6];
	fread(nums, 5, 1, file);
	nums[5] = '\0';

	int start, count;
	sscanf(nums, "%d %d\x0a", &start, &count);
	if (start == 0 && count == 0)
		return NULL;

	int *offsets = (int *)calloc(count, sizeof(int));
	char nextEntry[20]; // Xref entrys are ALWAYS 20 bytes
	int offset, generation;
	char usageFlag;
	for (int i=0; i<count; i++) {
		fread(nextEntry, 20, 1, file);
		// We don't care about generation and free/used flag
		sscanf(nextEntry, "%d %d %c", &offset, &generation, &usageFlag);
		if (usageFlag == 'n') // free entries confuse everything
			offsets[i] = offset;
	}

	*entryCount = count;
	return offsets;
}


text:
<?php

namespace Controller;

/**
 * The terms page for the website, you can render this page by going
 * to your website url "/Terms"
 * Class Terms
 * @package View
 */
class Terms extends Controller implements IController {
	public function __construct($dir = __DIR__) {
		parent::__construct($dir);
	}

	public function Title() {
		echo 'Terms';
	}

	public function JS() {

	}

	public function CSS() {

	}

	public function Render() {
		$this->RenderHTML('terms', get_defined_vars());
	}

	public function EndJS() {

	}

	public function Footer() {

	}
}


text:
A dot matrix JavaFX control.

## Overview
![Overview](https://dl.dropboxusercontent.com/u/84552/DotMatrix.png)


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by \generate-code.bat.
//
//     Changes to this file will be lost when the code is regenerated.
//     The build server regenerates the code before each build and a pre-build
//     step will regenerate the code on each local build.
//
//     See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
//     Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
//     Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------

// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.

using System;

#nullable enable

namespace UnitsNet.NumberExtensions.NumberToElectricPotentialDc
{
    /// <summary>
    /// A number to ElectricPotentialDc Extensions
    /// </summary>
    public static class NumberToElectricPotentialDcExtensions
    {
        /// <inheritdoc cref="ElectricPotentialDc.FromKilovoltsDc(UnitsNet.QuantityValue)" />
        public static ElectricPotentialDc KilovoltsDc<T>(this T value) =>
            ElectricPotentialDc.FromKilovoltsDc(Convert.ToDouble(value));

        /// <inheritdoc cref="ElectricPotentialDc.FromMegavoltsDc(UnitsNet.QuantityValue)" />
        public static ElectricPotentialDc MegavoltsDc<T>(this T value) =>
            ElectricPotentialDc.FromMegavoltsDc(Convert.ToDouble(value));

        /// <inheritdoc cref="ElectricPotentialDc.FromMicrovoltsDc(UnitsNet.QuantityValue)" />
        public static ElectricPotentialDc MicrovoltsDc<T>(this T value) =>
            ElectricPotentialDc.FromMicrovoltsDc(Convert.ToDouble(value));

        /// <inheritdoc cref="ElectricPotentialDc.FromMillivoltsDc(UnitsNet.QuantityValue)" />
        public static ElectricPotentialDc MillivoltsDc<T>(this T value) =>
            ElectricPotentialDc.FromMillivoltsDc(Convert.ToDouble(value));

        /// <inheritdoc cref="ElectricPotentialDc.FromVoltsDc(UnitsNet.QuantityValue)" />
        public static ElectricPotentialDc VoltsDc<T>(this T value) =>
            ElectricPotentialDc.FromVoltsDc(Convert.ToDouble(value));

    }
}


text:
"""Base class for pilight."""
import voluptuous as vol

from homeassistant.const import (
    CONF_ID,
    CONF_NAME,
    CONF_PROTOCOL,
    CONF_STATE,
    STATE_OFF,
    STATE_ON,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.restore_state import RestoreEntity

from . import DOMAIN, EVENT, SERVICE_NAME
from .const import (
    CONF_ECHO,
    CONF_OFF,
    CONF_OFF_CODE,
    CONF_OFF_CODE_RECEIVE,
    CONF_ON,
    CONF_ON_CODE,
    CONF_ON_CODE_RECEIVE,
    CONF_SYSTEMCODE,
    CONF_UNIT,
    CONF_UNITCODE,
)

COMMAND_SCHEMA = vol.Schema(
    {
        vol.Optional(CONF_PROTOCOL): cv.string,
        vol.Optional(CONF_ON): cv.positive_int,
        vol.Optional(CONF_OFF): cv.positive_int,
        vol.Optional(CONF_UNIT): cv.positive_int,
        vol.Optional(CONF_UNITCODE): cv.positive_int,
        vol.Optional(CONF_ID): vol.Any(cv.positive_int, cv.string),
        vol.Optional(CONF_STATE): vol.Any(STATE_ON, STATE_OFF),
        vol.Optional(CONF_SYSTEMCODE): cv.positive_int,
    },
    extra=vol.ALLOW_EXTRA,
)

RECEIVE_SCHEMA = COMMAND_SCHEMA.extend({vol.Optional(CONF_ECHO): cv.boolean})

SWITCHES_SCHEMA = vol.Schema(
    {
        vol.Required(CONF_ON_CODE): COMMAND_SCHEMA,
        vol.Required(CONF_OFF_CODE): COMMAND_SCHEMA,
        vol.Optional(CONF_NAME): cv.string,
        vol.Optional(CONF_OFF_CODE_RECEIVE): vol.All(cv.ensure_list, [COMMAND_SCHEMA]),
        vol.Optional(CONF_ON_CODE_RECEIVE): vol.All(cv.ensure_list, [COMMAND_SCHEMA]),
    }
)

class PilightBaseDevice(RestoreEntity):
    """Base class for pilight switches and lights."""

    _attr_should_poll = False

    def __init__(self, hass, name, config):
        """Initialize a device."""
        self._hass = hass
        self._name = config.get(CONF_NAME, name)
        self._is_on = False
        self._code_on = config.get(CONF_ON_CODE)
        self._code_off = config.get(CONF_OFF_CODE)

        code_on_receive = config.get(CONF_ON_CODE_RECEIVE, [])
        code_off_receive = config.get(CONF_OFF_CODE_RECEIVE, [])

        self._code_on_receive = []
        self._code_off_receive = []

        for code_list, conf in (
            (self._code_on_receive, code_on_receive),
            (self._code_off_receive, code_off_receive),
        ):
            for code in conf:
                echo = code.pop(CONF_ECHO, True)
                code_list.append(_ReceiveHandle(code, echo))

        if any(self._code_on_receive) or any(self._code_off_receive):
            hass.bus.listen(EVENT, self._handle_code)

        self._brightness = 255

    async def async_added_to_hass(self):
        """Call when entity about to be added to hass."""
        await super().async_added_to_hass()
        if state := await self.async_get_last_state():
            self._is_on = state.state == STATE_ON
            self._brightness = state.attributes.get("brightness")

    @property
    def name(self):
        """Get the name of the switch."""
        return self._name

    @property
    def assumed_state(self):
        """Return True if unable to access real state of the entity."""
        return True

    @property
    def is_on(self):
        """Return true if switch is on."""
        return self._is_on

    def _handle_code(self, call):
        """Check if received code by the pilight-daemon.

        If the code matches the receive on/off codes of this switch the switch
        state is changed accordingly.
        """
        # - True if off_code/on_code is contained in received code dict, not
        #   all items have to match.
        # - Call turn on/off only once, even if more than one code is received
        if any(self._code_on_receive):
            for on_code in self._code_on_receive:
                if on_code.match(call.data):
                    on_code.run(switch=self, turn_on=True)
                    break

        if any(self._code_off_receive):
            for off_code in self._code_off_receive:
                if off_code.match(call.data):
                    off_code.run(switch=self, turn_on=False)
                    break

    def set_state(self, turn_on, send_code=True, dimlevel=None):
        """Set the state of the switch.

        This sets the state of the switch. If send_code is set to True, then
        it will call the pilight.send service to actually send the codes
        to the pilight daemon.
        """
        if send_code:
            if turn_on:
                code = self._code_on
                if dimlevel is not None:
                    code.update({"dimlevel": dimlevel})

                self._hass.services.call(DOMAIN, SERVICE_NAME, code, blocking=True)
            else:
                self._hass.services.call(
                    DOMAIN, SERVICE_NAME, self._code_off, blocking=True
                )

        self._is_on = turn_on
        self.schedule_update_ha_state()

    def turn_on(self, **kwargs):
        """Turn the switch on by calling pilight.send service with on code."""
        self.set_state(turn_on=True)

    def turn_off(self, **kwargs):
        """Turn the switch on by calling pilight.send service with off code."""
        self.set_state(turn_on=False)

class _ReceiveHandle:
    def __init__(self, config, echo):
        """Initialize the handle."""
        self.config_items = config.items()
        self.echo = echo

    def match(self, code):
        """Test if the received code matches the configured values.

        The received values have to be a subset of the configured options.
        """
        return self.config_items <= code.items()

    def run(self, switch, turn_on):
        """Change the state of the switch."""
        switch.set_state(turn_on=turn_on, send_code=self.echo)


text:
title: 'T&A crossover'
author: alba
layout: post
permalink: /2003/03/10/ta-crossover/
categories:
  - photography
tags:
  - photography
---
the 'hollywood issue' of vanity will have a section entitled ['the actresses'][1] which features 3 adult entertainers from Vivid Video photographed by David Lachapelle.

[book][2] your flights now.[Hooters Air takes off!][3] i can just hear it now, 'i fly them because of their chicken wings". i wonder if all those old stewardess jokes are going to make a comeback now?

 [1]: http://blogs.salon.com/0001437/stories/2003/03/08/vanityFairDoesJenna.html "Vanity Fair Does Jenna"
 [2]: https://reservations.hootersair.com/Criteria.aspx
 [3]: http://www.msnbc.com/news/881728.asp?cp1=1#BODY "Hooters Air, with hot pants, takes off"


text:
package pm.hhp.core.services.users.save;

import pm.hhp.core.model.users.User;
import pm.hhp.core.model.users.UserFactory;
import pm.hhp.core.model.users.UserRepository;
import pm.hhp.core.model.users.exceptions.UserAlreadyExistsException;
import pm.hhp.core.model.users.exceptions.UserNotAllowedToPerfomActionException;
import pm.hhp.core.model.users.exceptions.UserNotFoundException;
import pm.hhp.core.services.Service;
import pm.hhp.core.services.UserSession;
import pm.hhp.core.services.users.UserRequest;
import pm.hhp.core.services.users.UserResponse;

public class SaveUserService implements Service<UserRequest, UserResponse> {
  private final UserRepository repository;

  private final UserFactory factory;

  private final UserSession userSession;

  /**
   * Get the save user service instance.
   *
   * @param repository  User repository.
   * @param factory     User factory.
   * @param userSession User session.
   */
  public SaveUserService(UserRepository repository, UserFactory factory, UserSession userSession) {
    this.repository = repository;
    this.factory = factory;
    this.userSession = userSession;
  }

  @Override
  public UserResponse execute(UserRequest request) throws UserNotAllowedToPerfomActionException {
    if (!userSession.isLoggedInUserId(request.getUserId().orElse(null))) {
      throw new UserNotAllowedToPerfomActionException();
    }

    User user = factory.getUserEntity(
            request.getUserId().orElse(null), request.getName(), request.getEmail()
    );

    try {
      repository.findById(user.getUserId());
      if (emailAlreadyExists(request)) {
        throw new UserAlreadyExistsException();
      }

      return factory.getUserResponse(repository.save(user));
    } catch (UserNotFoundException | UserAlreadyExistsException userNotFound) {
      return null;
    }
  }

  private boolean emailAlreadyExists(UserRequest request) {
    try {
      User user = repository.findByEmail(request.getEmail());

      return user.getEmail().equals(request.getEmail())
              && !user.getUserId().equals(request.getUserId().orElse(null));
    } catch (UserNotFoundException ignored) {
      return false;
    }
  }
}