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

Casino (1995)

reviewed by
James Berardinelli

                                     CASINO
                       A film review by James Berardinelli
                        Copyright 1995 James Berardinelli

RATING (0 TO 10): 8.6

United States, 1995
U.S. Availability: 11/22/95 (wide)
Running Length: 2:58
MPAA Classification: R (Violence, profanity, drug use, sexual
      situations)
Theatrical Aspect Ratio: 2.35:1

Cast: Robert De Niro, Joe Pesci, Sharon Stone, Don Rickles, James Woods,
      Alan King, Kevin Pollak, Frank Vincent, L. Q. Jones
Director: Martin Scorsese
Producer: Barbara De Fina
Screenplay: Nicholas Pileggi & Martin Scorsese based on the book by
      Nicholas Pileggi
Cinematography: Robert Richardson
Music: various artists
U.S. Distributor: Universal Pictures

     After viewing CASINO, you may never look at Las Vegas in quite the
same way.  While this film, adapted from Nicholas Pileggi's nonfiction
book, CASINO: LOVE AND HONOR IN LAS VEGAS, doesn't offer much in the way
of startling revelations, it presents a fascinating insider's
perspective of what goes on behind-the-scenes in the country's gambling
mecca.  As is stated several times, Vegas isn't about fun, glitz, or
glamour.  Those things are just the surface gloss.  Instead, it's all
about greed and money--bringing customers in, keeping them playing,
and sucking them dry.

     CASINO opens with short sequence in 1983 before moving on to the
meat of the story, which is related through flashbacks.  Director Martin
Scorsese makes heavy use of voiceovers, employing disembodied monologues
by both lead actors--Robert De Niro and Joe Pesci--to fill in gaps.
The sheer volume of words sporadically detracts from character
development, but it is integrated successfully enough not to seem overly
intrusive.  While the intelligence and wit of the voiceovers makes them
palatable, such nonstop talking isn't always the best way to convey a
story--the temptation to tell something, rather than show it, is too
great.  CASINO doesn't always avoid that trap.

     In every way--from the fantastic sets, rich dialogue, and
unapologetic violence to the well-portrayed characters and themes of
loyalty and betrayal--CASINO is pure Scorsese.  Although not the
director's top work, this is nevertheless compelling film making.
Scorsese has never pulled punches in breathing life into his ideas, and
he doesn't start here.  If there's an obvious weakness in CASINO, it's
that it occasionally seems derivative of GOODFELLAS.

     During its three-hour running time, CASINO tells the story of two
men's intermingled lives.  "Back home years ago" (as an on-screen
caption reads), they were friends and co-workers.  Sam "Ace" Rothstein
(Robert De Niro, in his eighth acting collaboration with Scorsese) was a
gambler who never lost.  He researched all his bets carefully, and
rarely made a bad pick.  His winning tendencies gained him popularity
and favor with the local mob, who used Nicky Santoro (Joe Pesci) to
shadow and protect him.  Now that Ace has moved to Vegas to manage the
Tangiers Casino, Nicky isn't far behind.  And, while the two gravitate
to opposite sides of the law, with Ace keeping his fingers clean and
Nicky taking over the local crime scene, their paths continue to cross,
and their encounters become increasingly less friendly.  Stirred into
the mix is Ace's girlfriend, Ginger (Sharon Stone), an expert hustler
who attracts men like flies.  Although she agrees to marry Ace, she
continues a liaison with her former pimp (James Woods) while encouraging
Nicky's affections.

     As usual, Scorsese obtains excellent performances from his leads.
Joe Pesci, essentially reprising his GOODFELLAS performance, will
probably get all the attention, since this sort of flamboyance attracts
raves.  Actually, though, it's De Niro's more subtle, better-contained
acting that's riveting.  CASINO is supposed to focus on both Ace and
Nicky, but, despite nearly equal screen time for each, our sympathy is
drawn towards the former.  For this, De Niro's portrayal shares equal
responsibility with the screenplay.

     In his most recent four films, Scorsese has shown the ability to
take a mediocre actress and cull an impressive performance from her.  In
GOODFELLAS, it was Lorraine Bracco.  In CAPE FEAR, Juliette Lewis.  In
THE AGE OF INNOCENCE, Michelle Pfeiffer (arguably the best of the
bunch).  And now, in CASINO, it's Sharon Stone, whose resume (BASIC
INSTINCT, SLIVER, THE SPECIALIST) is enough to make any serious movie-
goer wince.  Surprisingly, however, she's fine--not Oscar material,
but strong enough not to drag down the film.  Stone doesn't stick out
like a sore thumb, and, based on Scorsese's track record, a lion's share
of the credit for this should be given to him.

     Supporting players include a restrained James Woods, comedian Don
Rickles in a serious role, Alan King (also playing it straight), and
Kevin Pollak.  Scorsese's mother has a brief (and very funny) appearance
as the no-nonsense parent of a bumbling, small-time gangster.  And faces
associated with Vegas, like Steve Allen, Frankie Avalon, Jayne Meadows,
and Jerry Vale, have cameos.

     CASINO was filmed in Las Vegas, and this shows in the splashiness
and energy of nearly every scene.  By using gaudy costumes and a 70's
soundtrack, Scorsese takes us back some two decades.  Starting with the
vivid opening credits (designed by Elaine and Saul Bass, whose amazing
work on THE AGE OF INNOCENCE was one of that film's highlights), CASINO
sparkles like its fake diamond of a host city.  The cinematography,
which uses surprisingly few tricks other than freeze-framing to
emphasize key moments, is crisp and clean.

     By now, audiences have come to expect forceful films from Martin
Scorsese.  With CASINO, he doesn't disappoint.  The movie is long, but,
with a fast-moving storyline, escalating tension, and surprisingly
robust humor, the three hours move quickly.  Several flaws, mostly
minor, keep CASINO on a plateau slightly below that of the director's
best (MEAN STREETS, RAGING BULL, TAXI DRIVER, GOODFELLAS), but, in this
relatively-bland Thanksgiving movie season, this is one of the few
entries worth making an effort to see.

- James Berardinelli (jberardinell@delphi.com)

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

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

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

Broken URLs inthe reviews are the responsibility of the author.

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

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


text:
package cs516.gabrielGheorghian.splash;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JWindow;

public class SplashScreen extends JWindow {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private int duration;
	private String image = "images/mail.png";
	private String splash = null;

	/**
	 * default constructor for SplashScreen
	 */
	public SplashScreen(){
		duration = 3000;
		splash = "hi";
	}

	/**
	 * constructor for SplashScreen
	 * @param d
	 */
	public SplashScreen(int d, String splash) {
		duration = d;
		this.splash = splash;
	}

	/**
	 * shows the SplashScreen panel
	 */
	public void showSplash() {
		setBackground(Color.white);

		// Build the splash screen
		JLabel label = new JLabel(createImageIcon(image));
		JLabel copyrt = new JLabel(splash, JLabel.CENTER);
		copyrt.setFont(new Font("Sans-Serif", Font.BOLD, 15));
		add(label, BorderLayout.CENTER);
		add(copyrt, BorderLayout.SOUTH);
		pack();

		// Retrieve the window's bounds, centering the window
		int width = this.getWidth();
		int height = this.getHeight();
		Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
		int x = (screen.width - width) / 2;
		int y = (screen.height - height) / 2;
		setBounds(x, y, width, height);

		// Display it
		setVisible(true);

		// Wait a little while, maybe while loading resources
	}

	/** Returns an ImageIcon, or null if the path was invalid. */
	protected static ImageIcon createImageIcon(String path) {
		java.net.URL imgURL = SplashScreen.class.getResource(path);
		if (imgURL != null) {
			return new ImageIcon(imgURL);
		} else {
			System.err.println("Couldn't find file: " + path);
			return null;
		}
	}

	/**
	 * Runs and closes
	 */
	public void showSplashAndExit() {
		showSplash();
		try {
			Thread.sleep(duration);
		} catch (Exception e) {
		}

		setVisible(false);
		this.dispose();
	}
}

redpajama_set_name: RedPajamaGithub


text:
Typus::Resources.setup do |config|

  # Defines default_action_on_item.
  # config.default_action_on_item = "edit"

  # Defines end_year.
  # config.end_year = nil

  # Defines form_rows.
  # config.form_rows = 15

  # Defines action_after_save.
  # config.action_after_save = "edit"

  # Defines minute_step.
  # config.minute_step = 5

  # Defines only_user_items.
  # config.only_user_items = false

  # Defines per_page.
  # config.per_page = 15

  # Defines start_year.
  # config.start_year = nil

end


text:
package cloudcmd.common.srv

import io.viper.core.server.router.{RouteResponse, RouteUtil, Route}
import org.jboss.netty.channel._
import org.jboss.netty.handler.codec.http.HttpVersion._
import java.net.{URI, URLDecoder}
import org.jboss.netty.buffer.ChannelBuffers._
import org.jboss.netty.handler.codec.http.HttpHeaders._
import org.jboss.netty.handler.codec.http
import http._
import org.json.JSONObject
import java.io.File
import cloudcmd.common.FileUtil
import com.ning.http.client.oauth.{RequestToken, ConsumerKey, OAuthSignatureCalculator}
import com.ning.http.client.FluentStringsMap

/*
{
  "<appKey>": {
    "key": "<appKey",
    "secret": "<appSecret>",
    "userId": "1234"
  }
}
*/

class OAuthSession(session: JSONObject) {
  def getAppKey: String = session.getString("key")
  def getSecret: String = session.getString("secret")

  def getAsConsumerKey : ConsumerKey = new ConsumerKey(getAppKey, getSecret)
  def getAsRequestToken : RequestToken = new RequestToken(getAppKey, getSecret)

  def hasProperty(name: String): Boolean = session.has(name)
}

trait OAuthSessionService {
  def getSession(key: String): OAuthSession

  def setSession(key: String, session: OAuthSession)

  def deleteSession(key: String)
}

object SimpleOAuthSessionService {
  val sessions = {
    val file = new File("auth.json") // TODO: get path from config
    if (file.exists()) {
      new JSONObject(FileUtil.readFile(file))
    } else {
      System.err.println("Warning: could not find auth.json")
      new JSONObject()
    }
  }
  val instance = new SimpleOAuthSessionService
}

class SimpleOAuthSessionService extends OAuthSessionService {
  def getSession(key: String): OAuthSession = {
    if (key != null && SimpleOAuthSessionService.sessions.has(key)) {
      new OAuthSession(SimpleOAuthSessionService.sessions.getJSONObject(key))
    } else {
      null
    }
  }

  def isValidKey(key: String): Boolean = {
    (key != null && SimpleOAuthSessionService.sessions.has(key))
  }

  def setSession(key: String, session: OAuthSession) = {
    SimpleOAuthSessionService.sessions.put(key, session)
  }

  def deleteSession(key: String) {
    SimpleOAuthSessionService.sessions.remove(key)
  }
}

class OAuthRouteConfig(val baseHostPort: String, val sessions: OAuthSessionService) {}

trait OAuthRouteHandler {
  def exec(session: OAuthSession, args: Map[String, String]): RouteResponse
}

class OAuthGetRestRoute(config: OAuthRouteConfig, route: String, handler: OAuthRouteHandler) extends OAuthRestRoute(route, handler, HttpMethod.GET, config) {}

class OAuthPostRestRoute(config: OAuthRouteConfig, route: String, handler: OAuthRouteHandler) extends OAuthRestRoute(route, handler, HttpMethod.POST, config) {}

class OAuthPutRestRoute(config: OAuthRouteConfig, route: String, handler: OAuthRouteHandler) extends OAuthRestRoute(route, handler, HttpMethod.PUT, config) {}

class OAuthDeleteRestRoute(config: OAuthRouteConfig, route: String, handler: OAuthRouteHandler) extends OAuthRestRoute(route, handler, HttpMethod.DELETE, config) {}

object OAuthRestRoute {

  val APP_KEY_HEADER = "X-APPKEY"
  val OAuth_MD5_SIGNATURE_HEADER = "X-OAuth-MD5"

  // Authorization=OAuth oauth_consumer_key="cloudcmd", oauth_token="13257392", oauth_signature_method="OAuth-SHA1", oauth_signature="PdeSBeSYKCFxHeNqkojH32IjJP4%3D", oauth_timestamp="1344481924", oauth_nonce="oE9Tkskhi3gqCADgN4AZ3w%3D%3D", oauth_version="1.0"
  // Authorization=OAuth
  //  oauth_consumer_key="cloudcmd",
  //  oauth_token="13257392",
  //  oauth_signature_method="OAuth-SHA1",
  //  oauth_signature="PdeSBeSYKCFxHeNqkojH32IjJP4%3D",
  //  oauth_timestamp="1344481924",
  //  oauth_nonce="oE9Tkskhi3gqCADgN4AZ3w%3D%3D",
  //  oauth_version="1.0"

  // TODO: should we return FluentStringsMap instead of a Map[String, String]
  def validate(config: OAuthRouteConfig, request: HttpRequest): (Boolean, OAuthSession, Map[String, String]) = {
    // get app key from header
    val authorization = request.getHeader(HttpHeaders.Names.AUTHORIZATION)
    if (!authorization.startsWith("OAuth")) return (false, null, null)

    val authKeyPairs = authorization.substring(6).split(",")

    val authMap = Map() ++ authKeyPairs.flatMap{ pair =>
      val parts = pair.split("=")
      if (parts.size != 2) return (false, null, null)
      Map(parts(0).trim -> parts(1).trim.replace("\"", ""))
    }

    if (!authMap.contains("oauth_consumer_key")) return (false, null, null)
    if (!authMap.contains("oauth_token")) return (false, null, null)
    if (!authMap.contains("oauth_timestamp")) return (false, null, null)
    if (!authMap.contains("oauth_nonce")) return (false, null, null)
    if (!authMap.contains("oauth_signature")) return (false, null, null)

    val consumerKey = authMap.get("oauth_consumer_key").getOrElse(null)
    val consumerSession = config.sessions.getSession(consumerKey)
    if (consumerSession == null) return (false, null, null)

    val userKey = authMap.get("oauth_token").getOrElse(null)
    val userSession = config.sessions.getSession(userKey)
    if (userSession == null) return (false, null, null)

    val sigCalc = new OAuthSignatureCalculator(consumerSession.getAsConsumerKey, userSession.getAsRequestToken)

    val method = request.getMethod.getName
    val baseURL = config.baseHostPort + request.getUri
    val timestamp = authMap.get("oauth_timestamp").get.toLong
    val nonce = URLDecoder.decode(authMap.get("oauth_nonce").get, "UTF-8")
    val formParams = getFormParams(request)
    val queryParams = getQueryParams(request)

    val signature = sigCalc.calculateSignature(method, baseURL, timestamp, nonce, formParams, queryParams)
    if (signature == URLDecoder.decode(authMap.get("oauth_signature").get, "UTF-8")) {
      import scala.collection.JavaConversions._
      val args = Map() ++ queryParams.entrySet.flatMap{ entry => Map(entry.getKey -> entry.getValue.get(0)) } ++ formParams.entrySet.flatMap{  entry => Map(entry.getKey -> entry.getValue.get(0)) }
      (true, userSession, args)
    } else {
      (false, null, null)
    }
  }

  def getQueryParams(request: HttpRequest) : FluentStringsMap = {
    val queryParams = RouteUtil.extractQueryParams(new URI(request.getUri))
    val map = new FluentStringsMap()
    import scala.collection.JavaConversions._
    queryParams.foreach{ case (key, value) => map.put(key, List(value)) }
    map
  }

  def getFormParams(request: HttpRequest) : FluentStringsMap = {
    val map = new FluentStringsMap()
    if (request.getMethod == HttpMethod.POST || request.getMethod == HttpMethod.PUT) {
      if (request.getHeader("x-streampost") == null) {
        val content = request.getContent
        if (content.hasArray) {
          val body = content.array()
          val contentLengthHeader = request.getHeader(HttpHeaders.Names.CONTENT_LENGTH)
          val contentLength = if (contentLengthHeader != null) contentLengthHeader.toInt else body.length
          if (contentLength == body.length) {
            val rawContent = new String(body, "UTF-8")
            val formParams = RouteUtil.extractQueryParams(rawContent)
            import scala.collection.JavaConversions._
            formParams.foreach{ case (key, value) => map.put(key, List(value))}
          }
        }
      }
    }
    map
  }
}

class OAuthRestRoute(route: String, handler: OAuthRouteHandler, method: HttpMethod, protected val config: OAuthRouteConfig) extends Route(route) {

  override
  def isMatch(request: HttpRequest) : Boolean = {
    (super.isMatch(request) && request.getMethod.equals(method))
  }

  override
  def handleUpstream(ctx: ChannelHandlerContext, e: ChannelEvent) {
    if (!(e.isInstanceOf[MessageEvent]) || !(e.asInstanceOf[MessageEvent].getMessage.isInstanceOf[HttpRequest])) {
      super.handleUpstream(ctx, e)
      return
    }

    val request = e.asInstanceOf[MessageEvent].getMessage.asInstanceOf[HttpRequest]
    if (!super.isMatch(request) || !request.getMethod.equals(method)) {
      super.handleUpstream(ctx, e)
      return
    }

    val (isValid, session, args) = {
      OAuthRestRoute.validate(config, request)
    }

    val response = if (isValid) {
      try {
        val path = RouteUtil.parsePath(request.getUri)

        import scala.collection.JavaConversions._
        val handlerArgs = args ++ RouteUtil.extractPathArgs(_route, path)

        val routeResponse = handler.exec(session, handlerArgs)
        if (routeResponse.HttpResponse == null) {
          val response = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.OK)
          response.setContent(wrappedBuffer("{\"status\": true}".getBytes))
          response
        } else {
          val response = routeResponse.HttpResponse
          if (response.getHeader(HttpHeaders.Names.CONTENT_LENGTH) == null) {
            setContentLength(response, response.getContent.readableBytes())
          }
          if (isKeepAlive(request)) {
            response.setHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE)
          } else {
            response.setHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE)
          }

          writeResponse(request, routeResponse, e)
          null
        }
      } catch {
        case e: Exception => new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.BAD_REQUEST)
      }
    } else {
      new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.FORBIDDEN)
    }

    if (response != null) writeResponse(request, response, e)
  }

  def writeResponse(request: HttpRequest, response: HttpResponse, e: ChannelEvent) : ChannelFuture = {
    val writeFuture = e.getChannel.write(response)
    if (response.getStatus != HttpResponseStatus.OK || !isKeepAlive(request)) {
      writeFuture.addListener(ChannelFutureListener.CLOSE)
    }
    writeFuture
  }

  def writeResponse(request: HttpRequest, routeResponse: RouteResponse, e: ChannelEvent) {
    val writeFuture = writeResponse(request, routeResponse.HttpResponse, e)
    writeFuture.addListener(new ChannelFutureListener {
      def operationComplete(channelFuture: ChannelFuture) {
        routeResponse.dispose()
      }
    })
  }
}


text:
<?php

declare(strict_types=1);

namespace Kreait\Firebase\Tests\Unit;

use Beste\Json;
use Kreait\Firebase\Exception\InvalidArgumentException;
use Kreait\Firebase\ServiceAccount;
use Kreait\Firebase\Tests\UnitTestCase;
use stdClass;

use function chmod;
use function file_get_contents;

/**
 * @internal
 */
final class ServiceAccountTest extends UnitTestCase
{
    private string $pathToUnreadableJson;
    private string $pathToValidJson;
    private string $validJson;

    /** @var array<string, string> */
    private array $validData;

    protected function setUp(): void
    {
        $this->pathToUnreadableJson = self::$fixturesDir.'/ServiceAccount/unreadable.json';
        chmod($this->pathToUnreadableJson, 0);

        $this->pathToValidJson = self::$fixturesDir.'/ServiceAccount/valid.json';
        $this->validJson = (string) file_get_contents($this->pathToValidJson);
        $this->validData = Json::decode($this->validJson, true);
    }

    protected function tearDown(): void
    {
        chmod($this->pathToUnreadableJson, 0o644);
    }

    public function testCreateFromJsonText(): void
    {
        $serviceAccount = ServiceAccount::fromValue($this->validJson);
        $this->assertSame($this->validData, $serviceAccount->asArray());
    }

    public function testCreateFromJsonFile(): void
    {
        $serviceAccount = ServiceAccount::fromValue($this->pathToValidJson);
        $this->assertSame($this->validData, $serviceAccount->asArray());
    }

    public function testCreateFromMissingFile(): void
    {
        $this->expectException(InvalidArgumentException::class);
        ServiceAccount::fromValue('missing.json');
    }

    public function testCreateFromDirectory(): void
    {
        $this->expectException(InvalidArgumentException::class);
        ServiceAccount::fromValue(__DIR__);
    }

    public function testCreateFromUnreadableFile(): void
    {
        $this->expectException(InvalidArgumentException::class);
        ServiceAccount::fromValue($this->pathToUnreadableJson);
    }

    public function testCreateFromArray(): void
    {
        $serviceAccount = ServiceAccount::fromValue($this->validData);
        $this->assertSame($this->validData, $serviceAccount->asArray());
    }

    public function testCreateFromArrayWithMissingTypeField(): void
    {
        $data = $this->validData;
        unset($data['type']);

        $this->expectException(InvalidArgumentException::class);
        ServiceAccount::fromValue($data);
    }

    public function testCreateFromServiceAccount(): void
    {
        $serviceAccount = ServiceAccount::fromValue($this->validJson);

        $this->assertSame($serviceAccount, ServiceAccount::fromValue($serviceAccount));
    }

    /**
     * @dataProvider invalidValues
     */
    public function testCreateFromInvalidValue(mixed $value): void
    {
        $this->expectException(InvalidArgumentException::class);
        ServiceAccount::fromValue($value);
    }

    /**
     * @return array<string, array<int, mixed>>
     */
    public function invalidValues(): array
    {
        return [
            'true' => [true],
            'false' => [false],
            'malformed_json' => ['{'],
            'empty_json' => ['{}'],
            'empty_array' => [[]],
            'invalid_type' => [['type' => 'invalid']],
            'unsupported' => [new stdClass()],
        ];
    }
}


text:
'use strict';

var angular = require('angular');

module.exports = angular.module('app').controller('DashboardCtrl',
    function ($scope, currentLocationForecastService, predefinedLocationsForecastService) {

        var allForecasts = [],
            currentLocationForecast = currentLocationForecastService.get(),
            predefinedLocationsForecast = predefinedLocationsForecastService.getAll();

        allForecasts.push(currentLocationForecast);
        allForecasts = allForecasts.concat(predefinedLocationsForecast);

        $scope.forecasts = allForecasts;
    });


text: {PAGENO}


text:
namespace OCIO = OCIO_NAMESPACE;

OCIO_ADD_TEST(CDLOpData, accessors)
{
    OCIO::CDLOpData::ChannelParams slopeParams(1.35, 1.1, 0.71);
    OCIO::CDLOpData::ChannelParams offsetParams(0.05, -0.23, 0.11);
    OCIO::CDLOpData::ChannelParams powerParams(0.93, 0.81, 1.27);

    OCIO::CDLOpData cdlOp(OCIO::CDLOpData::CDL_V1_2_FWD,
                          slopeParams, offsetParams, powerParams, 1.23);

    // Update slope parameters with the same value.
    OCIO::CDLOpData::ChannelParams newSlopeParams(0.66);
    cdlOp.setSlopeParams(newSlopeParams);

    OCIO_CHECK_ASSERT(cdlOp.getSlopeParams() == newSlopeParams);
    OCIO_CHECK_ASSERT(cdlOp.getOffsetParams() == offsetParams);
    OCIO_CHECK_ASSERT(cdlOp.getPowerParams() == powerParams);
    OCIO_CHECK_EQUAL(cdlOp.getSaturation(), 1.23);

    // Update offset parameters with the same value.
    OCIO::CDLOpData::ChannelParams newOffsetParams(0.09);
    cdlOp.setOffsetParams(newOffsetParams);

    OCIO_CHECK_ASSERT(cdlOp.getSlopeParams() == newSlopeParams);
    OCIO_CHECK_ASSERT(cdlOp.getOffsetParams() == newOffsetParams);
    OCIO_CHECK_ASSERT(cdlOp.getPowerParams() == powerParams);
    OCIO_CHECK_EQUAL(cdlOp.getSaturation(), 1.23);

    // Update power parameters with the same value.
    OCIO::CDLOpData::ChannelParams newPowerParams(1.1);
    cdlOp.setPowerParams(newPowerParams);

    OCIO_CHECK_ASSERT(cdlOp.getSlopeParams() == newSlopeParams);
    OCIO_CHECK_ASSERT(cdlOp.getOffsetParams() == newOffsetParams);
    OCIO_CHECK_ASSERT(cdlOp.getPowerParams() == newPowerParams);
    OCIO_CHECK_EQUAL(cdlOp.getSaturation(), 1.23);

    // Update the saturation parameter.
    cdlOp.setSaturation(0.99);

    OCIO_CHECK_ASSERT(cdlOp.getSlopeParams() == newSlopeParams);
    OCIO_CHECK_ASSERT(cdlOp.getOffsetParams() == newOffsetParams);
    OCIO_CHECK_ASSERT(cdlOp.getPowerParams() == newPowerParams);
    OCIO_CHECK_EQUAL(cdlOp.getSaturation(), 0.99);

}

OCIO_ADD_TEST(CDLOpData, constructors)
{
    // Check default constructor.
    OCIO::CDLOpData cdlOpDefault;

    OCIO_CHECK_EQUAL(cdlOpDefault.getType(), OCIO::CDLOpData::CDLType);

    OCIO_CHECK_EQUAL(cdlOpDefault.getID(), "");
    OCIO_CHECK_ASSERT(cdlOpDefault.getFormatMetadata().getChildrenElements().empty());

    OCIO_CHECK_EQUAL(cdlOpDefault.getStyle(),
                     OCIO::CDLOpData::CDL_NO_CLAMP_FWD);

    OCIO_CHECK_ASSERT(!cdlOpDefault.isReverse());

    OCIO_CHECK_ASSERT(cdlOpDefault.getSlopeParams()
        == OCIO::CDLOpData::ChannelParams(1.0));
    OCIO_CHECK_ASSERT(cdlOpDefault.getOffsetParams()
        == OCIO::CDLOpData::ChannelParams(0.0));
    OCIO_CHECK_ASSERT(cdlOpDefault.getPowerParams()
        == OCIO::CDLOpData::ChannelParams(1.0));
    OCIO_CHECK_EQUAL(cdlOpDefault.getSaturation(), 1.0);

    // Check complete constructor.
    OCIO::CDLOpData cdlOpComplete(OCIO::CDLOpData::CDL_NO_CLAMP_REV,
                                  OCIO::CDLOpData::ChannelParams(1.35, 1.1, 0.71),
                                  OCIO::CDLOpData::ChannelParams(0.05, -0.23, 0.11),
                                  OCIO::CDLOpData::ChannelParams(0.93, 0.81, 1.27),
                                  1.23);

    auto & metadata = cdlOpComplete.getFormatMetadata();
    metadata.addAttribute(OCIO::METADATA_NAME, "cdl-name");
    metadata.addAttribute(OCIO::METADATA_ID, "cdl-id");

    OCIO_CHECK_EQUAL(cdlOpComplete.getName(), "cdl-name");
    OCIO_CHECK_EQUAL(cdlOpComplete.getID(), "cdl-id");

    OCIO_CHECK_EQUAL(cdlOpComplete.getType(), OCIO::OpData::CDLType);

    OCIO_CHECK_EQUAL(cdlOpComplete.getStyle(),
                     OCIO::CDLOpData::CDL_NO_CLAMP_REV);

    OCIO_CHECK_ASSERT(cdlOpComplete.isReverse());

    OCIO_CHECK_ASSERT(cdlOpComplete.getSlopeParams()
        == OCIO::CDLOpData::ChannelParams(1.35, 1.1, 0.71));
    OCIO_CHECK_ASSERT(cdlOpComplete.getOffsetParams()
        == OCIO::CDLOpData::ChannelParams(0.05, -0.23, 0.11));
    OCIO_CHECK_ASSERT(cdlOpComplete.getPowerParams()
        == OCIO::CDLOpData::ChannelParams(0.93, 0.81, 1.27));
    OCIO_CHECK_EQUAL(cdlOpComplete.getSaturation(), 1.23);
}

OCIO_ADD_TEST(CDLOpData, inverse)
{
    OCIO::CDLOpData cdlOp(OCIO::CDLOpData::CDL_V1_2_FWD,
                          OCIO::CDLOpData::ChannelParams(1.35, 1.1, 0.71),
                          OCIO::CDLOpData::ChannelParams(0.05, -0.23, 0.11),
                          OCIO::CDLOpData::ChannelParams(0.93, 0.81, 1.27),
                          1.23);
    cdlOp.getFormatMetadata().addAttribute(OCIO::METADATA_ID, "test_id");
    cdlOp.getFormatMetadata().addChildElement(OCIO::METADATA_DESCRIPTION, "Inverse op test description");

    // Test CDL_V1_2_FWD inverse
    {
        cdlOp.setStyle(OCIO::CDLOpData::CDL_V1_2_FWD);
        const OCIO::CDLOpDataRcPtr invOp = cdlOp.inverse();

        // Ensure metadata is copied
        OCIO_CHECK_EQUAL(invOp->getID(), "test_id");
        OCIO_REQUIRE_EQUAL(invOp->getFormatMetadata().getChildrenElements().size(), 1);
        OCIO_CHECK_EQUAL(std::string(OCIO::METADATA_DESCRIPTION),
                         invOp->getFormatMetadata().getChildrenElements()[0].getElementName());
        OCIO_CHECK_EQUAL(std::string("Inverse op test description"),
                         invOp->getFormatMetadata().getChildrenElements()[0].getElementValue());

        // Ensure style is inverted
        OCIO_CHECK_EQUAL(invOp->getStyle(), OCIO::CDLOpData::CDL_V1_2_REV);

        OCIO_CHECK_ASSERT(invOp->isReverse());

        // Ensure CDL parameters are unchanged
        OCIO_CHECK_ASSERT(invOp->getSlopeParams()
                          == OCIO::CDLOpData::ChannelParams(1.35, 1.1, 0.71));

        OCIO_CHECK_ASSERT(invOp->getOffsetParams()
                         == OCIO::CDLOpData::ChannelParams(0.05, -0.23, 0.11));

        OCIO_CHECK_ASSERT(invOp->getPowerParams()
                          == OCIO::CDLOpData::ChannelParams(0.93, 0.81, 1.27));

        OCIO_CHECK_EQUAL(invOp->getSaturation(), 1.23);
    }

    // Test CDL_V1_2_REV inverse
    {
        cdlOp.setStyle(OCIO::CDLOpData::CDL_V1_2_REV);
        const OCIO::CDLOpDataRcPtr invOp = cdlOp.inverse();

        // Ensure metadata is copied
        OCIO_CHECK_EQUAL(invOp->getID(), "test_id");
        OCIO_CHECK_EQUAL(invOp->getFormatMetadata().getChildrenElements().size(), 1);

        // Ensure style is inverted
        OCIO_CHECK_EQUAL(invOp->getStyle(), OCIO::CDLOpData::CDL_V1_2_FWD);

        OCIO_CHECK_EQUAL(invOp->isReverse(), false);

        // Ensure CDL parameters are unchanged
        OCIO_CHECK_ASSERT(invOp->getSlopeParams()
                          == OCIO::CDLOpData::ChannelParams(1.35, 1.1, 0.71));

        OCIO_CHECK_ASSERT(invOp->getOffsetParams()
                          == OCIO::CDLOpData::ChannelParams(0.05, -0.23, 0.11));

        OCIO_CHECK_ASSERT(invOp->getPowerParams()
                          == OCIO::CDLOpData::ChannelParams(0.93, 0.81, 1.27));

        OCIO_CHECK_EQUAL(invOp->getSaturation(), 1.23);
    }

    // Test CDL_NO_CLAMP_FWD inverse
    {
        cdlOp.setStyle(OCIO::CDLOpData::CDL_NO_CLAMP_FWD);
        const OCIO::CDLOpDataRcPtr invOp = cdlOp.inverse();

        // Ensure metadata is copied
        OCIO_CHECK_EQUAL(invOp->getID(), "test_id");
        OCIO_CHECK_EQUAL(invOp->getFormatMetadata().getChildrenElements().size(), 1);

        // Ensure style is inverted
        OCIO_CHECK_EQUAL(invOp->getStyle(), OCIO::CDLOpData::CDL_NO_CLAMP_REV);
        OCIO_CHECK_ASSERT(invOp->isReverse());

        // Ensure CDL parameters are unchanged
        OCIO_CHECK_ASSERT(invOp->getSlopeParams()
                           == OCIO::CDLOpData::ChannelParams(1.35, 1.1, 0.71));

        OCIO_CHECK_ASSERT(invOp->getOffsetParams()
                           == OCIO::CDLOpData::ChannelParams(0.05, -0.23, 0.11));

        OCIO_CHECK_ASSERT(invOp->getPowerParams()
                           == OCIO::CDLOpData::ChannelParams(0.93, 0.81, 1.27));

        OCIO_CHECK_EQUAL(invOp->getSaturation(), 1.23);
    }

    // Test CDL_NO_CLAMP_REV inverse
    {
        cdlOp.setStyle(OCIO::CDLOpData::CDL_NO_CLAMP_REV);
        const OCIO::CDLOpDataRcPtr invOp = cdlOp.inverse();

        // Ensure metadata is copied
        OCIO_CHECK_EQUAL(invOp->getID(), "test_id");
        OCIO_CHECK_EQUAL(invOp->getFormatMetadata().getChildrenElements().size(), 1);

        // Ensure style is inverted
        OCIO_CHECK_EQUAL(invOp->getStyle(), OCIO::CDLOpData::CDL_NO_CLAMP_FWD);
        OCIO_CHECK_ASSERT(!invOp->isReverse());

        // Ensure CDL parameters are unchanged
        OCIO_CHECK_ASSERT(invOp->getSlopeParams()
                          == OCIO::CDLOpData::ChannelParams(1.35, 1.1, 0.71));

        OCIO_CHECK_ASSERT(invOp->getOffsetParams()
                          == OCIO::CDLOpData::ChannelParams(0.05, -0.23, 0.11));

        OCIO_CHECK_ASSERT(invOp->getPowerParams()
                          == OCIO::CDLOpData::ChannelParams(0.93, 0.81, 1.27));

        OCIO_CHECK_EQUAL(invOp->getSaturation(), 1.23);
    }
}

OCIO_ADD_TEST(CDLOpData, style)
{
    // Check default constructor
    OCIO::CDLOpData cdlOp;

    // Check CDL_V1_2_FWD

    cdlOp.setStyle(OCIO::CDLOpData::CDL_V1_2_FWD);
    OCIO_CHECK_EQUAL(cdlOp.getStyle(), OCIO::CDLOpData::CDL_V1_2_FWD);
    OCIO_CHECK_ASSERT(!cdlOp.isReverse());

    // Check the identity replacement.
    OCIO::OpDataRcPtr op = cdlOp.getIdentityReplacement();
    OCIO::RangeOpDataRcPtr rg = OCIO::DynamicPtrCast<OCIO::RangeOpData>(op);
    OCIO_REQUIRE_ASSERT(rg);
    OCIO_CHECK_ASSERT(rg->hasMinInValue()  && (rg->getMinInValue()  == 0.));
    OCIO_CHECK_ASSERT(rg->hasMaxInValue()  && (rg->getMaxInValue()  == 1.));
    OCIO_CHECK_ASSERT(rg->hasMinOutValue() && (rg->getMinOutValue() == 0.));
    OCIO_CHECK_ASSERT(rg->hasMaxOutValue() && (rg->getMaxOutValue() == 1.));
    OCIO_CHECK_ASSERT(!rg->scales());

    // Check CDL_V1_2_REV

    cdlOp.setStyle(OCIO::CDLOpData::CDL_V1_2_REV);
    OCIO_CHECK_EQUAL(cdlOp.getStyle(), OCIO::CDLOpData::CDL_V1_2_REV);
    OCIO_CHECK_ASSERT(cdlOp.isReverse());

    // Check the identity replacement.
    op = cdlOp.getIdentityReplacement();
    rg = OCIO::DynamicPtrCast<OCIO::RangeOpData>(op);
    OCIO_REQUIRE_ASSERT(rg);
    OCIO_CHECK_ASSERT(rg->hasMinInValue()  && (rg->getMinInValue()  == 0.));
    OCIO_CHECK_ASSERT(rg->hasMaxInValue()  && (rg->getMaxInValue()  == 1.));
    OCIO_CHECK_ASSERT(rg->hasMinOutValue() && (rg->getMinOutValue() == 0.));
    OCIO_CHECK_ASSERT(rg->hasMaxOutValue() && (rg->getMaxOutValue() == 1.));
    OCIO_CHECK_ASSERT(!rg->scales());

    // Check CDL_NO_CLAMP_FWD

    cdlOp.setStyle(OCIO::CDLOpData::CDL_NO_CLAMP_FWD);
    OCIO_CHECK_EQUAL(cdlOp.getStyle(), OCIO::CDLOpData::CDL_NO_CLAMP_FWD);
    OCIO_CHECK_ASSERT(!cdlOp.isReverse());

    // Check the identity replacement.
    op = cdlOp.getIdentityReplacement();
    OCIO::MatrixOpDataRcPtr mtx = OCIO::DynamicPtrCast<OCIO::MatrixOpData>(op);
    OCIO_REQUIRE_ASSERT(mtx);
    OCIO_CHECK_ASSERT(mtx->isIdentity());

    // Check CDL_NO_CLAMP_REV

    cdlOp.setStyle(OCIO::CDLOpData::CDL_NO_CLAMP_REV);
    OCIO_CHECK_EQUAL(cdlOp.getStyle(), OCIO::CDLOpData::CDL_NO_CLAMP_REV);
    OCIO_CHECK_ASSERT(cdlOp.isReverse());

    // Check the identity replacement.
    op = cdlOp.getIdentityReplacement();
    mtx = OCIO::DynamicPtrCast<OCIO::MatrixOpData>(op);
    OCIO_REQUIRE_ASSERT(mtx);
    OCIO_CHECK_ASSERT(mtx->isIdentity());

    // Check unknown style

    OCIO_CHECK_THROW_WHAT(OCIO::CDLOpData::GetStyle("unknown_style"),
                          OCIO::Exception,
                          "Unknown style for CDL");
}

OCIO_ADD_TEST(CDLOpData, validation_success)
{
    OCIO::CDLOpData cdlOp;

    // Set valid parameters
    const OCIO::CDLOpData::ChannelParams slopeParams(1.15);
    const OCIO::CDLOpData::ChannelParams offsetParams(-0.02);
    const OCIO::CDLOpData::ChannelParams powerParams(0.97);

    cdlOp.setStyle(OCIO::CDLOpData::CDL_V1_2_FWD);

    cdlOp.setSlopeParams(slopeParams);
    cdlOp.setOffsetParams(offsetParams);
    cdlOp.setPowerParams(powerParams);
    cdlOp.setSaturation(1.22);

    OCIO_CHECK_ASSERT(!cdlOp.isIdentity());
    OCIO_CHECK_ASSERT(!cdlOp.isNoOp());

    OCIO_CHECK_NO_THROW(cdlOp.validate());

    // Set an identity operation
    cdlOp.setSlopeParams(OCIO::kOneParams);
    cdlOp.setOffsetParams(OCIO::kZeroParams);
    cdlOp.setPowerParams(OCIO::kOneParams);
    cdlOp.setSaturation(1.0);

    OCIO_CHECK_ASSERT(cdlOp.isIdentity());
    OCIO_CHECK_ASSERT(!cdlOp.isNoOp());
    // Set to non clamping
    cdlOp.setStyle(OCIO::CDLOpData::CDL_NO_CLAMP_FWD);
    OCIO_CHECK_ASSERT(cdlOp.isIdentity());
    OCIO_CHECK_ASSERT(cdlOp.isNoOp());

    OCIO_CHECK_NO_THROW(cdlOp.validate());

    // Check for slope = 0
    cdlOp.setSlopeParams(OCIO::CDLOpData::ChannelParams(0.0));
    cdlOp.setOffsetParams(offsetParams);
    cdlOp.setPowerParams(powerParams);
    cdlOp.setSaturation(1.0);

    cdlOp.setStyle(OCIO::CDLOpData::CDL_V1_2_FWD);

    OCIO_CHECK_ASSERT(!cdlOp.isIdentity());
    OCIO_CHECK_ASSERT(!cdlOp.isNoOp());

    OCIO_CHECK_NO_THROW(cdlOp.validate());

    // Check for saturation = 0
    cdlOp.setSlopeParams(slopeParams);
    cdlOp.setOffsetParams(offsetParams);
    cdlOp.setPowerParams(powerParams);
    cdlOp.setSaturation(0.0);

    OCIO_CHECK_ASSERT(!cdlOp.isIdentity());
    OCIO_CHECK_ASSERT(!cdlOp.isNoOp());

    OCIO_CHECK_NO_THROW(cdlOp.validate());
}

OCIO_ADD_TEST(CDLOpData, validation_failure)
{
    OCIO::CDLOpData cdlOp;

    // Fail: invalid scale
    cdlOp.setSlopeParams(OCIO::CDLOpData::ChannelParams(-0.9));
    cdlOp.setOffsetParams(OCIO::CDLOpData::ChannelParams(0.01));
    cdlOp.setPowerParams(OCIO::CDLOpData::ChannelParams(1.2));
    cdlOp.setSaturation(1.17);

    OCIO_CHECK_THROW_WHAT(cdlOp.validate(), OCIO::Exception, "should be greater than 0");

    // Fail: invalid power
    cdlOp.setSlopeParams(OCIO::CDLOpData::ChannelParams(0.9));
    cdlOp.setOffsetParams(OCIO::CDLOpData::ChannelParams(0.01));
    cdlOp.setPowerParams(OCIO::CDLOpData::ChannelParams(-1.2));
    cdlOp.setSaturation(1.17);

    OCIO_CHECK_THROW_WHAT(cdlOp.validate(), OCIO::Exception, "should be greater than 0");

    // Fail: invalid saturation
    cdlOp.setSlopeParams(OCIO::CDLOpData::ChannelParams(0.9));
    cdlOp.setOffsetParams(OCIO::CDLOpData::ChannelParams(0.01));
    cdlOp.setPowerParams(OCIO::CDLOpData::ChannelParams(1.2));
    cdlOp.setSaturation(-1.17);

    OCIO_CHECK_THROW_WHAT(cdlOp.validate(), OCIO::Exception, "should be greater than 0");

    // Check for power = 0
    cdlOp.setSlopeParams(OCIO::CDLOpData::ChannelParams(0.7));
    cdlOp.setOffsetParams(OCIO::CDLOpData::ChannelParams(0.2));
    cdlOp.setPowerParams(OCIO::CDLOpData::ChannelParams(0.0));
    cdlOp.setSaturation(1.4);

    OCIO_CHECK_THROW_WHAT(cdlOp.validate(), OCIO::Exception, "should be greater than 0");
}

// TODO: CDLOp_inverse_bypass_test is missing

OCIO_ADD_TEST(CDLOpData, channel)
{
  {
    OCIO::CDLOpData cdlOp;

    // False: identity
    OCIO_CHECK_ASSERT(!cdlOp.hasChannelCrosstalk());
  }

  {
    OCIO::CDLOpData cdlOp;
    cdlOp.setSlopeParams(OCIO::CDLOpData::ChannelParams(-0.9));
    cdlOp.setOffsetParams(OCIO::CDLOpData::ChannelParams(0.01));
    cdlOp.setPowerParams(OCIO::CDLOpData::ChannelParams(1.2));

    // False: slope, offset, and power
    OCIO_CHECK_ASSERT(!cdlOp.hasChannelCrosstalk());
  }

  {
    OCIO::CDLOpData cdlOp;
    cdlOp.setSaturation(1.17);

    // True: saturation
    OCIO_CHECK_ASSERT(cdlOp.hasChannelCrosstalk());
  }
}


text:
sap.ui.define(["sap/ui/integration/Designtime"
], function (Designtime) {
	"use strict";
	return function () {
		return new Designtime({
			"form": {
				"items": {
					"group": {
						"type": "group",
						"label": "no default group"
					},
					"stringParameter": {
						"manifestpath": "/sap.card/configuration/parameters/stringParameter/value",
						"type": "string",
						"allowDynamicValues": true
					}
				}
			}
		});
	};
});


text:
package com.mentor.nucleus.bp.ui.graphics.actions;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.jface.action.Action;

import com.mentor.nucleus.bp.core.CorePlugin;
import com.mentor.nucleus.bp.core.common.ClassQueryInterface_c;
import com.mentor.nucleus.bp.core.common.Transaction;
import com.mentor.nucleus.bp.core.common.TransactionManager;
import com.mentor.nucleus.bp.ui.canvas.Connector_c;
import com.mentor.nucleus.bp.ui.canvas.GraphicalElement_c;
import com.mentor.nucleus.bp.ui.canvas.Graphicalelementinlayer_c;
import com.mentor.nucleus.bp.ui.canvas.Layer_c;
import com.mentor.nucleus.bp.ui.canvas.Model_c;
import com.mentor.nucleus.bp.ui.canvas.Ooaofgraphics;
import com.mentor.nucleus.bp.ui.canvas.Shape_c;
import com.mentor.nucleus.bp.ui.graphics.editor.GraphicalEditor;
import com.mentor.nucleus.bp.ui.graphics.parts.ConnectorEditPart;
import com.mentor.nucleus.bp.ui.graphics.parts.ShapeEditPart;

public class AddToLayerAction extends Action {

	private String layerName;
	private Model_c model;

	public AddToLayerAction(String layerName, Model_c model) {
		this.layerName = layerName;
		this.model = model;
	}

	@Override
	public void run() {
		Layer_c layer = Layer_c.getOneGD_LAYOnR34(model,
				new ClassQueryInterface_c() {

					@Override
					public boolean evaluate(Object candidate) {
						return ((Layer_c) candidate).getLayer_name().equals(
								layerName);
					}
				});
		if (layer != null) {
			Transaction transaction = null;
			TransactionManager manager = TransactionManager.getSingleton();
			try {
				transaction = manager.startTransaction(
						"Add element(s) to layer", Ooaofgraphics
								.getDefaultInstance());
				List<GraphicalEditPart> selection = new ArrayList<GraphicalEditPart>();
				GraphicalViewer viewer = GraphicalEditor.getEditor(model)
						.getGraphicalViewer();
				for (Object selected : viewer.getSelectedEditParts()) {
					selection.add((GraphicalEditPart) selected);
				}
				for (GraphicalEditPart part : selection) {
					if (part instanceof ShapeEditPart
							|| part instanceof ConnectorEditPart) {
						GraphicalElement_c elem = null;
						Object partModel = part.getModel();
						if (partModel instanceof Connector_c) {
							elem = GraphicalElement_c
									.getOneGD_GEOnR2((Connector_c) partModel);
						} else {
							elem = GraphicalElement_c
									.getOneGD_GEOnR2((Shape_c) partModel);
						}
						if (elem != null) {
							// if this element already exists in the layer
							// skip, the tool allows this when at least one
							// selected element is not part of the layer
							Layer_c[] participatingLayers = Layer_c
									.getManyGD_LAYsOnR35(Graphicalelementinlayer_c
											.getManyGD_GLAYsOnR35(elem));
							for(int i = 0; i < participatingLayers.length; i++) {
								if(participatingLayers[i] == layer) {
									continue;
								}
							}
							if (part instanceof ShapeEditPart) {
								ShapeEditPart shapePart = (ShapeEditPart) part;
								participatingLayers = shapePart
										.getInheritedLayers();
								for (int i = 0; i < participatingLayers.length; i++) {
									if (participatingLayers[i] == layer) {
										continue;
									}
								}
							}
							if (part instanceof ConnectorEditPart) {
								ConnectorEditPart conPart = (ConnectorEditPart) part;
								participatingLayers = conPart
										.getInheritedLayers();
								for (int i = 0; i < participatingLayers.length; i++) {
									if (participatingLayers[i] == layer) {
										continue;
									}
								}
							}
							layer.Addelementtolayer(elem.getElementid());
						}
						if(!layer.getVisible()) {
							// see if the part also belongs to any
							// visible layers, otherwise de-select
							Layer_c[] existingLayers = Layer_c
									.getManyGD_LAYsOnR35(Graphicalelementinlayer_c
											.getManyGD_GLAYsOnR35(elem));
							boolean participatesInVisibleLayer = false;
							for(int i = 0; i < existingLayers.length; i++) {
								if(existingLayers[i].getVisible()) {
									participatesInVisibleLayer = true;
									break;
								}
							}
							if(!participatesInVisibleLayer) {
								viewer.deselect(part);
							}
						}
					}
				}

				manager.endTransaction(transaction);
			} catch (Exception e) {
				if (transaction != null) {
					manager.cancelTransaction(transaction, e);
				}
				CorePlugin.logError("Unable to add element to layer.", e);
			}
		}
	}

}


text:
require "spec_helper"

describe DpdApi::Order do
  include Savon::SpecHelper
  before(:all) { savon.mock!   }
  after(:all)  { savon.unmock! }

  let(:auth) do
    { request: {
      auth: {
        client_number: ENV['DPD_CLIENT_NUMBER'] || '234',
        client_key:    ENV['DPD_CLIENT_KEY']    || '123'
      } } }
  end
  let(:message) { auth.clone.deep_merge!({ request: params }) }

  # TODO: Add
  xcontext ".states_by_client_order" do
    let(:fixture) { File.read("spec/fixtures/dpd_api/tracing/states_by_client_order.xml") }
    let(:params) do
    end

    it "is success" do
      savon.expects(:get_states_by_client_order).with(message: message).returns(fixture)

      response = described_class.states_by_client_order(params)
      expect(response.first).to have_key(:parcel_status)
    end
  end

  # TODO: Add
  xcontext ".states_by_client_parcel" do
    let(:fixture) { File.read("spec/fixtures/dpd_api/tracing/states_by_client_parcel.xml") }
    let(:params) do
    end

    it "is success" do
      savon.expects(:get_states_by_client_parcel).with(message: message).returns(fixture)

      response = described_class.states_by_client_parcel(params)
      expect(response.first).to have_key(:parcel_status)
    end
  end

  # TODO: Add
  xcontext ".states_by_dpd_order" do
    let(:fixture) { File.read("spec/fixtures/dpd_api/tracing/states_by_dpd_order.xml") }
    let(:params) do
    end

    it "is success" do
      savon.expects(:get_states_by_dpd_order).with(message: message).returns(fixture)

      response = described_class.states_by_dpd_order(params)
      expect(response.first).to have_key(:parcel_status)
    end
  end
end


text:
<?php
/**
 * @author Nicola Puddu
 * @package userGroups
 * form model used on installation
 */
class UserGroupsInstallation extends CFormModel
{
	/**
	 * Current module version
	 * @var string
	 */
	const VERSION = '1.8';
	/**
	 * access code to access installation
	 * @var string
	 */
	public $accesscode;
	/**
	 * root username
	 * @var string
	 */
	public $root_user;
	/**
	 * root password
	 * @var string
	 */
	public $root_password;
	/**
	 * root password confirmation field
	 * @var string
	 */
	public $root_password_confirm;
	/**
	 * root email address
	 * @var string
	 */
	public $root_email;
	/**
	 * root password recovery question
	 * @var string
	 */
	public $root_question;
	/**
	 * root password recovery answer
	 * @var string
	 */
	public $root_answer;

	public function rules()
	{
		return array(
			array('accesscode', 'required', 'on'=>'access_code', 'message' => Yii::t('userGroupsModule.install', 'the Access Code cannot be blank')),
			array('accesscode', 'authenticate', 'on'=>'access_code'),
			array('root_user, root_password, root_password_confirm, root_email, root_question, root_answer', 'required', 'on'=>'installation'),
			array('root_password', 'passwordStrength', 'on'=>'installation'),
			array('root_email', 'email', 'on'=>'installation'),
			array('root_password_confirm', 'compare', 'compareAttribute' => 'root_password', 'on'=>'installation',
				'message' => Yii::t('userGroupsModule.install', 'the confirmation password doesn\'t match the password')),
		);
	}

	/**
	 * Authenticates the accesscode against the one in the configuration file.
	 * This is the 'authenticate' validator as declared in rules().
	 */
	public function authenticate($attribute,$params)
	{
		if (!Yii::app()->controller->module->accessCode)
			$this->addError('accesscode', Yii::t('userGroupsModule.install', 'You didn\'t set the access code in your config file.'));
		if(Yii::app()->controller->module->accessCode !== $this->accesscode)
			$this->addError('accesscode', Yii::t('userGroupsModule.install', 'The two access codes don\'t match.'));
		if(!Yii::app()->getComponent('user') instanceof WebUserGroups)
			$this->addError('accesscode', Yii::t('userGroupsModule.install', 'You didn\'t correctly set the class property in the user component.
Value set: {class}
Value expected: WebUserGroups', array('{class}'=>get_class(Yii::app()->getComponent('user'))) ));
		if(!Yii::app()->params->adminEmail)
			$this->addError('accesscode', Yii::t('userGroupsModule.install', 'You didn\'t set an adminEmail param inside your application configuration file.'));
	}

	/**
	 * Authenticates the password against checking it's strength.
	 * This is the 'passwordStrength' validator as declared in rules().
	 */
	public function passwordStrength($attribute,$params)
	{
		if(!preg_match('/^(?=.*\d(?=.*\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/', $this->root_password))
			$this->addError('root_password',Yii::t('userGroupsModule.install', 'for security reasons the root password must contain at least 2 digits and 2 letters'));
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'access_code' => Yii::t('userGroupsModule.install', 'Access Code'),
			'root_user' => Yii::t('userGroupsModule.install', 'Root User'),
			'root_password' => Yii::t('userGroupsModule.install', 'Root Password'),
			'root_password_confirm' => Yii::t('userGroupsModule.install', 'Retype Root Password'),
			'root_email' => Yii::t('userGroupsModule.install', 'Root Email'),
			'root_question' => Yii::t('userGroupsModule.general', 'Password Reset: Question'),
			'root_answer' => Yii::t('userGroupsModule.general', 'Password Reset: Answer'),
		);
	}

}


text:
There are some important concepts that have changed from version 3.2 to 4 and full backward-compatability is not possible. This document **is not to explain how to convert a project in XEO V3.2 to XEO V4**, but instead to show you what changes in the way you do things.

## Viewer definition
XEO V3 Viewer definitions are mostly compatible with V4, with the following exceptions

- If you use the xvw:form component in a viewer, you need to **remove** it (yes delete it)
- List viewers and Main viewers require an additional parameter in the xvw:viewer element, which is **transactionLess='true'**
- The defaults beans are no longer the XEOBaseBean, XEOEditBean, XEOBaseList and XEOBaseLookupList (more on that in the beans section)
- The Main viewer definition is not compatible with the new version (more on that bellow)
- The faces-config.xml and web.xml files require a small change

### Main Viewer

In XEO V4 the Main viewer definition is different from the previous version. In V4 you use a template (or create oyour own) and then replace the declared "areas" in the template with your content. In XEO you can declare a template as a regular viewer ( usually without any bean associated ) with special "areas" marked as replaceable (using the **xvw:insert** directive). See the following exemple of a template (**named MainTemplate.xvw**)

```xml
<xvw:root xmlns:xeo="http://www.netgest.net/xeo/xeo" xmlns:xvw="http://www.netgest.net/xeo/xvw">
    <xvw:viewer transactionLess='true'>
        <xvw:form id='mainForm'>
        	<header id="header">
				 <xvw:insert src='header.xvw' name='header'/>
			</header>
		<aside id="left-panel">
			<!-- User info -->
			<div class="login-info">
				<xvw:insert source='profile.xvw' name='profile' />
			</div>
            <!-- TREE PANEL -->
			<xvw:insert name='treePanel'>
			</xvw:insert>
			<span class="minifyme" data-action="minifyMenu"> <i class="fa fa-arrow-circle-left hit"></i> </span>
		</aside>

		<div id="main" role="main">

			<!-- RIBBON -->
			<div id="ribbon">
				<!-- breadcrumb -->
				<xvw:sceneCrumb id='breadcrumb'></xvw:sceneCrumb>
			</div>
			<!-- END RIBBON -->

			<!-- MAIN CONTENT -->
			<div id="content" class='scroll-content'>
				<xvw:errorMessages></xvw:errorMessages>
				<xvw:applicationContainer id='appContainer'></xvw:applicationContainer>
			</div>
			<!-- END MAIN CONTENT -->

		</div>

		</xvw:form>
    </xvw:viewer>
</xvw:root>

```
And use a Main Viewer definition using the xvw:composition directive and replacing the content of the "treePanel" and "profile" areas with your content, like the following:

```xml
<xvw:root xmlns:xeo="http://www.netgest.net/xeo/xeo" xmlns:xvw="http://www.netgest.net/xeo/xvw">
	<xvw:viewer beanClass="path.to.the.MainBean" beanId="viewBean"	transactionLess='true'>
		<xvw:composition template='MainTemplate.xvw'>

				<xvw:define name='profile'>
					<xvw:template template="profile.ftl" username='#{viewBean.loggedUser}' profiles='#{viewBean.profiles}'></xvw:template>
				</xvw:define>
			<xvw:define name='treePanel'>
				<xvw:treePanel>

					<xvw:menu text="Some action"
						icon="path/to/icon.gif" serverAction="#{viewBean.createObject}"
						value='{viewerName : "path/to/viewer/edit.xvw" , objectName : "SOME_OBJECT"}'></xvw:menu>
                        <!-- More menus -->

				</xvw:treePanel>
				<!-- Content to include, can be html or components -->
			</xvw:define>
		</xvw:composition>
	</xvw:viewer>
</xvw:root>

```
This allows to reuse the template across the project (for multiple main viewers) only replacing what you need.

### Sample List Viewer

```xml
<?xml version="1.0" encoding="UTF-8"?>
<xvw:root xmlns:xeo="http://www.netgest.net/xeo/xeo" xmlns:xvw="http://www.netgest.net/xeo/xvw">
    <xvw:viewer
        beanClass="netgest.bo.xwc.xeo.controllers.beans.ListBean"
        beanId="viewBean" transactionLess='true' >
        <xeo:formList>
            <xeo:list>
                <xvw:columns>
                    <!-- Columns specific to the model -->
                </xvw:columns>
            </xeo:list>
        </xeo:formList>
    </xvw:viewer>
</xvw:root>

```

####Important Note:
The template/main viewer should have a xvw:form component envolving the entire content (it's required for things such as asking the user if he wants to loose content when changing scenes)

## Beans (to be used in scenes inside the applicationContainer)

Since version 4
brings so many changes, we decided to create a new set of beans for the various types of situations.

- netgest.bo.xwc.framework.controllers.ApplicationBaseBean (for any viewer)
- netgest.bo.xwc.xeo.controllers.MainBean (for Main Viewers)
- netgest.bo.xwc.xeo.controllers.beans.ListBean (for List viewers)
- netgest.bo.xwc.xeo.controllers.beans.EditBean (for Edit viewers)
- netgest.bo.xwc.xeo.controllers.beans.LookupBean (for Lookup viewers)

This means that you will have to change XEO Studio's default beans in the project's properties menu to have the scaffolding utility generate correct viewer definitions.

## FacesConfig.xml

For the new version you need to make a slight change in the faces-config.xml, previous versions of XEO will have the following:

```xml
	<lifecycle>
    <phase-listener>netgest.bo.xwc.framework.jsf.XUIPhaseListener</phase-listener>
  </lifecycle>
```

You need to change it to the following (notice the additional phase-listener)

```xml
<lifecycle>
    <phase-listener>netgest.bo.xwc.framework.jsf.XUIPhaseListener</phase-listener>
    <phase-listener>netgest.bo.xwc.framework.jsf.ComponentReferenceBindingPhaseListener</phase-listener>
  </lifecycle>

```
##Web.xml / boconfig.xml

You also need to change the **renderKit**, which can be done in the web.xml like the following (you will need the to set the renderKit to **XEOSMART**:

```xml
<servlet>
		<servlet-name>XWC Servlet</servlet-name>
		<servlet-class>netgest.bo.xwc.framework.http.XUIServlet</servlet-class>
		<!-- Other parameters -->
		<init-param>
			<param-name>renderKit</param-name>
			<param-value>XEOSMART<param-value>
		</init-param>
		<!-- Other parameters -->
	</servlet>

```

This can also be done in the boconfig.xml file (which makes the renderKit available to all web contexts in the application)

```xml
<!-- remaining boConfig -->
<renderKits default="XEOSMART">
</renderKits>
<!-- remaining boconfig -->
```

## Eclipse

Until the XEO Studio plugin is updated to support the new version you have to manually set somethings, namely the templates for the Scaffolding tool.

For each project you want to use with XEO 4 you may want to:
- Right Click the Project in Eclipse (Project Explorer)
- Find the "XEO Studio" options section
- Select the "Default Beans" option and replace the beans with the ones described in the previous section.

EditBean     -> netgest.bo.xwc.xeo.controllers.beans.EditBean
ListBean     -> netgest.bo.xwc.xeo.controllers.beans.ListBean
LookupBean   -> netgest.bo.xwc.xeo.controllers.beans.LookupBean
MainBean     -> netgest.bo.xwc.xeo.controllers.MainBean
Main with Regions Bean -> netgest.bo.xwc.xeo.controllers.MainBean
BaseBean     -> netgest.bo.xwc.framework.controllers.ApplicationBaseBean

You also want to add the "transactionLess='true'" to the List and Main viewer templates.


text:
from model import Magikarp
import numpy as np
import tensorflow as tf

config = {}
config['batch_size'] = 64
config['datafile'] = '../Data/training_data.hdf5'
config['p_datafile'] = '../Data/tal_data.hdf5'
config['full_boards_file'] = '../Data/full_boards.pkl'
config['num_epochs'] = 10
config['save_file'] = 'trained_model/trained_genadv.ckpt'

with tf.Session() as sess:
	magikarp = Magikarp(config, sess)
	magikarp.train()


text:
package Html;

use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);

sub new {
   my $object = shift();
   my $class = ref( $object ) || $object;
   my $self = { actualText => "",
                startTags => [],
                endTags => [],
                priority => 1,
                nonBreaking => 1};
   bless ( $self, $class );
   return $self;
}

sub setActualText {
   my $self = shift();
   $self->{ actualText } = shift();
}

sub getActualText {
   my $self = shift();
   return $self->{ actualText };
}

sub addStartTag {
   my $self = shift();
   my $newTag = shift();
   my $arrayReference = $self->{ startTags };
   push(@$arrayReference, $newTag);
}

sub getStartTags {
   my $self = shift();
   my $tempString = join ("",@{$self->{ startTags }});
   return $tempString;
}

sub addEndTag {
   my $self = shift();
   my $newTag = shift();
   my $arrayReference = $self->{ endTags };
   push(@$arrayReference, $newTag);
}

sub getEndTags {
   my $self = shift();
   my @reversed = reverse(@{$self->{ endTags }});
   my $tempString = join ("",@reversed);
   return $tempString;
}

sub setPriority {
   my $self = shift();
   $self->{ priority } = shift();
}

sub getPriority {
   my $self = shift();
   return $self->{ priority };
}

sub setNonBreaking {
   my $self = shift();
   $self->{ nonBreaking } = shift();
}

sub getNonBreaking {
   my $self = shift();
   return $self->{ nonBreaking };
}

return 1;


text:
/*
 *= require fancybox/jquery.fancybox
 *= require jquery.jgrowl
 *= require codemirror/codemirror
 *= require codemirror/util/simple-hint
 *= require codemirror/util/dialog.css
 *= require codemirror/theme/neat
 *= require codemirror/theme/elegant
 *= require codemirror/theme/erlang-dark
 *= require codemirror/theme/night
 *= require codemirror/theme/monokai
 *= require codemirror/theme/cobalt
 *= require codemirror/theme/eclipse
 *= require codemirror/theme/rubyblue
 *= require codemirror/theme/lesser-dark
 *= require codemirror/theme/xq-dark
 *= require codemirror/theme/ambiance
 *= require codemirror/theme/blackboard
 *= require codemirror/theme/vibrant-ink
 *= require codemirror/theme/solarized
 *= require codemirror/theme/twilight
 *= require_self
*/

#records table tr td {
    padding-top: 20px;
}

a.fancybox {
    text-align: center;
    border-bottom: none !important;
}

a.fancybox-close {
    border-bottom: none !important;
}

.screenshot {
    width: 100%;
}

.fullwidth {
    width: 98%;
}

.theme-info {
    display: inline-block;
    vertical-align: top;
    padding-left: 20px;
}


text:
<?php

namespace DmnDatabase\Data;

interface CountryMapperInterface {

	/**
	 * @return data | NULL
	 */
	public function getCountries();

	/**
	 * @param integer $priorityId
	 * @return mixed | NULL
	 */
	public function getCountryById($id);
	/**
	 * @return data | NULL
	 */
	public function getExecutorCities();
}

?>


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Alcea laxiflora I.Riedl

### Remarks
null


text:
nav a i::before{
	font-size: 20px;
	margin-right: 3px;
}
.spinner{
	position: absolute;
	left: calc(50% - 20px);
	top: 45%;
	display: none;
	font-size: 40px;
}
.error-messages{
	font-family: "Courier New", Courier, monospace;
}
.error-messages p{
	margin:0;
}
.error-messages pre{
	padding:0;
	margin:0;
	line-height: 1;
	color:inherit;
	font-family: inherit;
	background-color: inherit;
	border:none;
}
.editor-btn-container{
	padding:0;
	overflow: hidden;
}
.alert-success i{
	margin-right: 4px;
}
.buttons-container{
	border-top:1px solid white;
	border-bottom: 1px solid white;
	border-bottom-right-radius: 4px;
	border-top-right-radius: 4px;
}
.buttons-container div{
	text-align: center;
	padding: 10px 6px;
	color:#777;
	border-bottom:1px solid #d3d3d3;
	font-family: Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace;
	font-weight: bold;
}
.buttons-container div:hover{
	color:white;
	cursor: pointer;
}
.body{
	position: relative;
	margin-bottom: 15px;
	padding:0;
}
.ace_editor {
    position: relative !important;
    margin: 0;
    height: 100%;
    width: 100%;
}
pre#editor{
	border-bottom-right-radius: 0px;
    border-top-right-radius: 0px;
}
.buttons-container{
	padding-left:0;
	padding-right: 0;
	margin-left:-15px;
	height: 100%;
	background-color: #32322D;
}
.lex-content{
	position: relative;
}
.table-scroll tr{
	width:100%;
	display: inline-table;
	text-align: left;
}
table.table-scroll{
	position: relative;
	width: 100%;
}
.table-scroll thead{
	position: absolute;
	width:100%;
}
.table-scroll tbody{
	margin-top: 37px;
	overflow-y: scroll;
	height:calc(100% - 37px);
	width:100%;
	position: absolute;
}
.table-scroll td,
.table-scroll th{
	width:33%;
}
.parsed-output{
	display: none;
}


text:
package cx.ath.matthew.unix;

/**
 * Represents an address for a Unix Socket
 */
public class UnixSocketAddress
{
   String path;
   boolean abs;
  /**
    * Create the address.
    * @param path The path to the Unix Socket.
    * @param abs True if this should be an abstract socket.
    */
   public UnixSocketAddress(String path, boolean abs)
   {
      this.path = path;
      this.abs = abs;
   }
   /**
    * Create the address.
    * @param path The path to the Unix Socket.
    */
   public UnixSocketAddress(String path)
   {
      this.path = path;
      this.abs = false;
   }
   /**
    * Return the path.
    */
   public String getPath()
   {
      return path;
   }
   /**
    * Returns true if this an address for an abstract socket.
    */
   public boolean isAbstract()
   {
      return abs;
   }
   /**
    * Return the Address as a String.
    */
   public String toString()
   {
      return "unix"+(abs?":abstract":"")+":path="+path;
   }
   public boolean equals(Object o)
   {
      if (!(o instanceof UnixSocketAddress)) return false;
      return ((UnixSocketAddress) o).path.equals(this.path);
   }
   public int hashCode()
   {
      return path.hashCode();
   }
}


text:
from __future__ import absolute_import

from rest_framework.response import Response

from sentry import filters
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import ResourceDoesNotExist

class ProjectFilterDetailsEndpoint(ProjectEndpoint):
    def put(self, request, project, filter_id):
        """
        Update a filter

        Update a project's filter.

            {method} {path}

        """
        try:
            filter = filters.get(filter_id)(project)
        except filters.FilterNotRegistered:
            raise ResourceDoesNotExist

        serializer = filter.serializer_cls(data=request.DATA, partial=True)
        if not serializer.is_valid():
            return Response(serializer.errors, status=400)

        filter.enable(serializer.object)

        return Response(status=201)


text:
//
//  KDTreeVectorOfVectorsAdaptor.hpp
//  classifyWords
//
//  Created by fengjian on 15/2/6.
//  Copyright (c) 2015年 ziipin. All rights reserved.
//

#ifndef classifyWords_KDTreeVectorOfVectorsAdaptor_hpp
#define classifyWords_KDTreeVectorOfVectorsAdaptor_hpp

#include "nanoflann.hpp"
//#include "constructFullKeyboardWordsMatrixList.hpp"
#include <cstdlib>
#include <iostream>

using namespace nanoflann;

/** A simple vector-of-vectors adaptor for nanoflann, without duplicating the storage.
 *  The i'th vector represents a point in the state space.
 *
 *  \tparam DIM If set to >0, it specifies a compile-time fixed dimensionality for the points in the data set, allowing more compiler optimizations.
 *  \tparam num_t The type of the point coordinates (typically, double or float).
 *  \tparam Distance The distance metric to use: nanoflann::metric_L1, nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc.
 *  \tparam IndexType The type for indices in the KD-tree index (typically, size_t of int)
 */
template <class VectorOfVectorsType, typename num_t = double, int DIM = -1, class Distance = nanoflann::metric_L2, typename IndexType = size_t>
struct KDTreeVectorOfVectorsAdaptor
{
  typedef KDTreeVectorOfVectorsAdaptor<VectorOfVectorsType,num_t,DIM,Distance> self_t;
  typedef typename Distance::template traits<num_t,self_t>::distance_t metric_t;
  typedef KDTreeSingleIndexAdaptor< metric_t,self_t,DIM,IndexType>  index_t;

  index_t* index; //! The kd-tree index for the user to call its methods as usual with any other FLANN index.

  /// Constructor: takes a const ref to the vector of vectors object with the data points
  KDTreeVectorOfVectorsAdaptor(const int dimensionality, const VectorOfVectorsType &mat, const int leaf_max_size = 10) : m_data(mat)
  {
    assert(mat.size()!=0 && mat[0].size()!=0);
    const size_t dims = mat[0].size();
    if (DIM>0 && static_cast<int>(dims)!=DIM)
      throw std::runtime_error("Data set dimensionality does not match the 'DIM' template argument");
    index = new index_t( dims, *this /* adaptor */, nanoflann::KDTreeSingleIndexAdaptorParams(leaf_max_size ) );
    index->buildIndex();
  }

  ~KDTreeVectorOfVectorsAdaptor() {
    delete index;
  }

  const VectorOfVectorsType &m_data;

  /** Query for the \a num_closest closest points to a given point (entered as query_point[0:dim-1]).
	  *  Note that this is a short-cut method for index->findNeighbors().
	  *  The user can also call index->... methods as desired.
	  * \note nChecks_IGNORED is ignored but kept for compatibility with the original FLANN interface.
	  */
  inline void query(const num_t *query_point, const size_t num_closest, IndexType *out_indices, num_t *out_distances_sq, const int nChecks_IGNORED = 10) const
  {
    nanoflann::KNNResultSet<typename VectorOfVectorsType::Scalar,IndexType> resultSet(num_closest);
    resultSet.init(out_indices, out_distances_sq);
    index->findNeighbors(resultSet, query_point, nanoflann::SearchParams());
  }

  /** @name Interface expected by KDTreeSingleIndexAdaptor
	  * @{ */

  const self_t & derived() const {
    return *this;
  }
  self_t & derived()       {
    return *this;
  }

  // Must return the number of data points
  inline size_t kdtree_get_point_count() const {
    return m_data.size();
  }

  // Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class:
  inline num_t kdtree_distance(const num_t *p1, const size_t idx_p2,size_t size) const
  {
    num_t s=0;
    for (size_t i=0; i<size; i++) {
      const num_t d= p1[i]-m_data[idx_p2][i];
      s+=d*d;
    }
    return s;
  }

  // Returns the dim'th component of the idx'th point in the class:
  inline num_t kdtree_get_pt(const size_t idx, int dim) const {
    return m_data[idx][dim];
  }

  // Optional bounding-box computation: return false to default to a standard bbox computation loop.
  //   Return true if the BBOX was already computed by the class and returned in "bb" so it can be avoided to redo it again.
  //   Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)
  template <class BBOX>
  bool kdtree_get_bbox(BBOX & /*bb*/) const {
    return false;
  }

  /** @} */

}; // end of KDTreeVectorOfVectorsAdaptor

#endif