text:
// ==========================================================================
// Project:   Ember - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

require('ember-views/views/view');
var get = Ember.get, set = Ember.set, meta = Ember.meta;
var forEach = Ember.EnumerableUtils.forEach;

var childViewsProperty = Ember.computed(function() {
  return get(this, '_childViews');
}).property('_childViews').cacheable();

/**
  @class

  A `ContainerView` is an `Ember.View` subclass that allows for manual or programatic
  management of a view's `childViews` array that will correctly update the `ContainerView`
  instance's rendered DOM representation.

  ## Setting Initial Child Views
  The initial array of child views can be set in one of two ways. You can provide
  a `childViews` property at creation time that contains instance of `Ember.View`:

        aContainer = Ember.ContainerView.create({
          childViews: [Ember.View.create(), Ember.View.create()]
        })

  You can also provide a list of property names whose values are instances of `Ember.View`:

        aContainer = Ember.ContainerView.create({
          childViews: ['aView', 'bView', 'cView'],
          aView: Ember.View.create(),
          bView: Ember.View.create()
          cView: Ember.View.create()
        })

  The two strategies can be combined:

        aContainer = Ember.ContainerView.create({
          childViews: ['aView', Ember.View.create()],
          aView: Ember.View.create()
        })

  Each child view's rendering will be inserted into the container's rendered HTML in the same
  order as its position in the `childViews` property.

  ## Adding and Removing Child Views
  The views in a container's `childViews` array should be added and removed by manipulating
  the `childViews` property directly.

  To remove a view pass that view into a `removeObject` call on the container's `childViews` property.

  Given an empty `<body>` the following code

        aContainer = Ember.ContainerView.create({
          classNames: ['the-container'],
          childViews: ['aView', 'bView'],
          aView: Ember.View.create({
            template: Ember.Handlebars.compile("A")
          }),
          bView: Ember.View.create({
            template: Ember.Handlebars.compile("B")
          })
        })

        aContainer.appendTo('body')

  Results in the HTML

A

B

  Removing a view

        aContainer.get('childViews') // [aContainer.aView, aContainer.bView]
        aContainer.get('childViews').removeObject(aContainer.get('bView'))
        aContainer.get('childViews') // [aContainer.aView]

  Will result in the following HTML

A

  Similarly, adding a child view is accomplished by adding `Ember.View` instances to the
  container's `childViews` property.

  Given an empty `<body>` the following code

        aContainer = Ember.ContainerView.create({
          classNames: ['the-container'],
          childViews: ['aView', 'bView'],
          aView: Ember.View.create({
            template: Ember.Handlebars.compile("A")
          }),
          bView: Ember.View.create({
            template: Ember.Handlebars.compile("B")
          })
        })

        aContainer.appendTo('body')

  Results in the HTML

A

B

  Adding a view

        AnotherViewClass = Ember.View.extend({
          template: Ember.Handlebars.compile("Another view")
        })

        aContainer.get('childViews') // [aContainer.aView, aContainer.bView]
        aContainer.get('childViews').pushObject(AnotherViewClass.create())
        aContainer.get('childViews') // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]

  Will result in the following HTML

A

B

Another view

  Direct manipulation of childViews presence or absence in the DOM via calls to
  `remove` or `removeFromParent` or calls to a container's `removeChild` may not behave
  correctly.

  Calling `remove()` on a child view will remove the view's HTML, but it will remain as part of its
  container's `childView`s property.

  Calling `removeChild()` on the container will remove the passed view instance from the container's
  `childView`s but keep its HTML within the container's rendered view.

  Calling `removeFromParent()` behaves as expected but should be avoided in favor of direct
  manipulation of a container's `childViews` property.

        aContainer = Ember.ContainerView.create({
          classNames: ['the-container'],
          childViews: ['aView', 'bView'],
          aView: Ember.View.create({
            template: Ember.Handlebars.compile("A")
          }),
          bView: Ember.View.create({
            template: Ember.Handlebars.compile("B")
          })
        })

        aContainer.appendTo('body')

  Results in the HTML

A

B

  Calling `aContainer.get('aView').removeFromParent()` will result in the following HTML

B

  And the `Ember.View` instance stored in `aContainer.aView` will be removed from `aContainer`'s
  `childViews` array.

  ## Templates and Layout
  A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or `defaultLayout`
  property on a container view will not result in the template or layout being rendered.
  The HTML contents of a `Ember.ContainerView`'s DOM representation will only be the rendered HTML
  of its child views.

  ## Binding a View to Display

  If you would like to display a single view in your ContainerView, you can set its `currentView`
  property. When the `currentView` property is set to a view instance, it will be added to the
  ContainerView's `childViews` array. If the `currentView` property is later changed to a
  different view, the new view will replace the old view. If `currentView` is set to `null`, the
  last `currentView` will be removed.

  This functionality is useful for cases where you want to bind the display of a ContainerView to
  a controller or state manager. For example, you can bind the `currentView` of a container to
  a controller like this:

      // Controller
      App.appController = Ember.Object.create({
        view: Ember.View.create({
          templateName: 'person_template'
        })
      });

      // Handlebars template
      {{view Ember.ContainerView currentViewBinding="App.appController.view"}}

  @extends Ember.View
*/

Ember.ContainerView = Ember.View.extend({

  init: function() {
    var childViews = get(this, 'childViews');
    Ember.defineProperty(this, 'childViews', childViewsProperty);

    this._super();

    var _childViews = get(this, '_childViews');

    forEach(childViews, function(viewName, idx) {
      var view;

      if ('string' === typeof viewName) {
        view = get(this, viewName);
        view = this.createChildView(view);
        set(this, viewName, view);
      } else {
        view = this.createChildView(viewName);
      }

      _childViews[idx] = view;
    }, this);

    // Make the _childViews array observable
    Ember.A(_childViews);

    // Sets up an array observer on the child views array. This
    // observer will detect when child views are added or removed
    // and update the DOM to reflect the mutation.
    get(this, 'childViews').addArrayObserver(this, {
      willChange: 'childViewsWillChange',
      didChange: 'childViewsDidChange'
    });
  },

  /**
    Instructs each child view to render to the passed render buffer.

    @param {Ember.RenderBuffer} buffer the buffer to render to
    @private
  */
  render: function(buffer) {
    this.forEachChildView(function(view) {
      view.renderToBuffer(buffer);
    });
  },

  /**
    When the container view is destroyed, tear down the child views
    array observer.

    @private
  */
  willDestroy: function() {
    get(this, 'childViews').removeArrayObserver(this, {
      willChange: 'childViewsWillChange',
      didChange: 'childViewsDidChange'
    });

    this._super();
  },

  /**
    When a child view is removed, destroy its element so that
    it is removed from the DOM.

    The array observer that triggers this action is set up in the
    `renderToBuffer` method.

    @private
    @param {Ember.Array} views the child views array before mutation
    @param {Number} start the start position of the mutation
    @param {Number} removed the number of child views removed
  **/
  childViewsWillChange: function(views, start, removed) {
    if (removed === 0) { return; }

    var changedViews = views.slice(start, start+removed);
    this.initializeViews(changedViews, null, null);

    this.invokeForState('childViewsWillChange', views, start, removed);
  },

  /**
    When a child view is added, make sure the DOM gets updated appropriately.

    If the view has already rendered an element, we tell the child view to
    create an element and insert it into the DOM. If the enclosing container view
    has already written to a buffer, but not yet converted that buffer into an
    element, we insert the string representation of the child into the appropriate
    place in the buffer.

    @private
    @param {Ember.Array} views the array of child views afte the mutation has occurred
    @param {Number} start the start position of the mutation
    @param {Number} removed the number of child views removed
    @param {Number} the number of child views added
  */
  childViewsDidChange: function(views, start, removed, added) {
    var len = get(views, 'length');

    // No new child views were added; bail out.
    if (added === 0) return;

    var changedViews = views.slice(start, start+added);
    this.initializeViews(changedViews, this, get(this, 'templateData'));

    // Let the current state handle the changes
    this.invokeForState('childViewsDidChange', views, start, added);
  },

  initializeViews: function(views, parentView, templateData) {
    forEach(views, function(view) {
      set(view, '_parentView', parentView);

      if (!get(view, 'templateData')) {
        set(view, 'templateData', templateData);
      }
    });
  },

  /**
    Schedules a child view to be inserted into the DOM after bindings have
    finished syncing for this run loop.

    @param {Ember.View} view the child view to insert
    @param {Ember.View} prev the child view after which the specified view should
                     be inserted
    @private
  */
  _scheduleInsertion: function(view, prev) {
    if (prev) {
      prev.domManager.after(prev, view);
    } else {
      this.domManager.prepend(this, view);
    }
  },

  currentView: null,

  _currentViewWillChange: Ember.beforeObserver(function() {
    var childViews = get(this, 'childViews'),
        currentView = get(this, 'currentView');

    if (currentView) {
      childViews.removeObject(currentView);
    }
  }, 'currentView'),

  _currentViewDidChange: Ember.observer(function() {
    var childViews = get(this, 'childViews'),
        currentView = get(this, 'currentView');

    if (currentView) {
      childViews.pushObject(currentView);
    }
  }, 'currentView')
});

// Ember.ContainerView extends the default view states to provide different
// behavior for childViewsWillChange and childViewsDidChange.
Ember.ContainerView.states = {
  parent: Ember.View.states,

  inBuffer: {
    childViewsDidChange: function(parentView, views, start, added) {
      var buffer = parentView.buffer,
          startWith, prev, prevBuffer, view;

      // Determine where to begin inserting the child view(s) in the
      // render buffer.
      if (start === 0) {
        // If views were inserted at the beginning, prepend the first
        // view to the render buffer, then begin inserting any
        // additional views at the beginning.
        view = views[start];
        startWith = start + 1;
        view.renderToBuffer(buffer, 'prepend');
      } else {
        // Otherwise, just insert them at the same place as the child
        // views mutation.
        view = views[start - 1];
        startWith = start;
      }

      for (var i=startWith; i<start+added; i++) {
        prev = view;
        view = views[i];
        prevBuffer = prev.buffer;
        view.renderToBuffer(prevBuffer, 'insertAfter');
      }
    }
  },

  hasElement: {
    childViewsWillChange: function(view, views, start, removed) {
      for (var i=start; i<start+removed; i++) {
        views[i].remove();
      }
    },

    childViewsDidChange: function(view, views, start, added) {
      // If the DOM element for this container view already exists,
      // schedule each child view to insert its DOM representation after
      // bindings have finished syncing.
      var prev = start === 0 ? null : views[start-1];

      for (var i=start; i<start+added; i++) {
        view = views[i];
        this._scheduleInsertion(view, prev);
        prev = view;
      }
    }
  }
};

Ember.ContainerView.states.inDOM = {
  parentState: Ember.ContainerView.states.hasElement
};

Ember.ContainerView.reopen({
  states: Ember.ContainerView.states
});


text:
<!-- General Meta Data -->
<meta name="keywords" content="realtime collaboration api" />
<!-- Open Graph Meta Data -->
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="{{ site.title }}" />
{% if page.title %}
<meta property="og:title" content="{{ page.title }}" />
{% else %}
<meta property="og:title" content="{{ site.title }}" />
{% endif %}
{% if page.title %}
<meta property="og:type" content="article" />
{% else %}
<meta property="og:type" content="website" />
{% endif %}
{% if page.description %}
<meta property="og:description" content="{{ page.description }}" />
{% else %}
<meta property="og:description" content="{{ site.description }}" />
{% endif %}
{% if page.url %}
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
{% endif %}
{% if page.image %}
<meta property="og:image" content="{{ site.url }}{{ page.image }}" />
{% else %}
<meta property="og:image" content="{{ site.url }}/assets/img/convergence_logo_card.png" />
{% endif %}
<!-- Article Information -->
{% if page.categories %}
{% for category in page.categories limit:1 %}
<meta property="article:section" content="{{ category }}" />
{% endfor %}
{% endif %}
{% if page.tags %}
{% for tag in page.tags %}
<meta property="article:tag" content="{{ tag }}" />
{% endfor %}
{% endif %}
{% if page.date %}
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}" />
<meta property="article:author" content="{{ site.url }}" />
{% endif %}
<!-- Google Meta Data -->
{% if page.title %}
<meta itemprop="name" content="{{ page.title }}" />
{% else %}
<meta itemprop="name" content="{{ site.title }}" />
{% endif %}
{% if page.description %}
<meta itemprop="description" content="{{ page.description }}" />
{% else %}
<meta itemprop="description" content="{{ site.description }}" />
{% endif %}
{% if page.image %}
<meta itemprop="image" content="{{ page.image }}" />
{% else %}
<meta itemprop="image" content="{{ site.url }}/assets/img/convergence-logo.png" />
{% endif %}
<!-- Twitter Cards -->
{% if page.title %}
<meta name="twitter:title" content="{{ page.title }}" />
{% else %}
<meta name="twitter:title" content="{{ site.title }}" />
{% endif %}
{% if page.url %}
<meta name="twitter:url" content="{{ site.url }}{{ page.url }}" />
{% endif %}
{% if page.description %}
<meta name="twitter:description" content="{{ page.description }}" />
{% else %}
<meta name="twitter:description" content="{{ site.description }}" />
{% endif %}
{% if page.image %}
<meta name="twitter:image" content="{{ page.image }}" />
{% else %}
<meta name="twitter:image" content="{{ site.url }}/assets/img/convergence-logo.png" />
{% endif %}
<meta name="twitter:card" content="summary_large_image"/>

<meta name="google-site-verification" content="HtwXdOhfAvJni6JgXQLeE8Ij40rBCucyBzXA7sGpA90" />

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace IPS\forums\modules\front\forums;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Topic View
 */
class _topic extends \IPS\Content\Controller
{
	/**
	 * [Content\Controller]	Class
	 */
	protected static $contentModel = 'IPS\forums\Topic';

	/**
	 * Execute
	 *
	 * @return	void
	 */
	public function execute()
	{
		\IPS\Output::i()->jsFiles	= array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_topic.js', 'forums' ) );
		parent::execute();
	}

	/**
	 * View Topic
	 *
	 * @return	void
	 */
	protected function manage()
	{
		/* Load topic */
		\IPS\forums\Forum::loadIntoMemory();
		$topic = parent::manage();
		\IPS\Member::loggedIn()->language()->words['submit_comment'] = \IPS\Member::loggedIn()->language()->addToStack( 'submit_reply', FALSE );

		/* If there's only one forum we actually don't want the nav */
		if ( \IPS\forums\Forum::theOnlyForum() )
		{
			$topicBreadcrumb = array_pop( \IPS\Output::i()->breadcrumb );
			\IPS\Output::i()->breadcrumb = isset( \IPS\Output::i()->breadcrumb['module'] ) ? array( 'module' => \IPS\Output::i()->breadcrumb['module'] ) : array();
			\IPS\Output::i()->breadcrumb[] = $topicBreadcrumb;
		}

		/* If it failed, it might be because we want a password */
		if ( $topic === NULL )
		{
			$forum = NULL;
			try
			{
				$topic = \IPS\forums\Topic::load( \IPS\Request::i()->id );
				$forum = $topic->container();
				if ( $forum->can('view') and !$forum->loggedInMemberHasPasswordAccess() )
				{
					\IPS\Output::i()->redirect( $forum->url()->setQueryString( 'topic', \IPS\Request::i()->id ) );
				}

				if ( !$topic->canView() )
				{
					if ( $topic instanceof \IPS\Content\Hideable and $topic->hidden() )
					{
						/* If the item is hidden we don't want to show the custom no permission error as the conditions may not apply */
						\IPS\Output::i()->error( 'node_error', '2F173/O', 404, '' );
					}
					else
					{
						\IPS\Output::i()->error(  $forum ? $forum->errorMessage() : 'node_error_no_perm', '2F173/H', 403, '' );
					}
				}
			}
			catch ( \OutOfRangeException $e )
			{
				/* Nope, just a generic no access error */
				\IPS\Output::i()->error( 'node_error', '2F173/1', 404, '' );
			}
		}

		/* Legacy findpost redirect */
		if ( \IPS\Request::i()->findpost )
		{
			\IPS\Output::i()->redirect( $topic->url()->setQueryString( array( 'do' => 'findComment', 'comment' => \IPS\Request::i()->findpost ) ), NULL, 301 );
		}
		elseif ( \IPS\Request::i()->p )
		{
			\IPS\Output::i()->redirect( $topic->url()->setQueryString( array( 'do' => 'findComment', 'comment' => \IPS\Request::i()->p ) ), NULL, 301 );
		}

		if ( \IPS\Request::i()->view )
		{
			$this->_doViewCheck();
		}

		/* If this is an AJAX request fetch the comment form now. The HTML will be cached so calling here and then again in the template has no overhead
			and this is necessary if you entered into a topic with &queued_posts=1, approve the posts, then try to reply. Otherwise, clicking into the
			editor produces an error when the getUploader=1 call occurs, and submitting a reply results in an error. */
		if ( \IPS\Request::i()->isAjax() )
		{
			$topic->commentForm();
		}

		/* AJAX hover preview? */
		if ( \IPS\Request::i()->isAjax() and \IPS\Request::i()->preview )
		{
			$postClass = '\IPS\forums\Topic\Post';

			if( $topic->isArchived() )
			{
				$postClass = '\IPS\forums\Topic\ArchivedPost';
			}

			$firstPost = $postClass::load( $topic->topic_firstpost );

			$topicOverview = array( 'firstPost' => array( $topic->isQuestion() ? 'question_mainTab' : 'first_post', $firstPost ) );

			if ( $topic->posts > 1 )
			{
				$latestPost = $topic->comments( 1, 0, 'date', 'DESC' );
				$topicOverview['latestPost'] = array( $topic->isQuestion() ? 'latest_answer' : 'latest_post', $latestPost );

				$timeLastRead = $topic->timeLastRead();
				if ( $timeLastRead instanceof \IPS\DateTime AND $topic->unread() !== 0 )
				{
					$firstUnread = $topic->comments( 1, NULL, 'date', 'asc', NULL, NULL, $timeLastRead );
					if( $firstUnread instanceof \IPS\forums\Topic\Post AND $firstUnread->date !== $latestPost->date AND $firstUnread->date !== $firstPost->date )
					{
						$topicOverview['firstUnread'] = array( 'first_unread_post_hover', $topic->comments( 1, NULL, 'date', 'asc', NULL, NULL, $timeLastRead ) );
					}
				}
			}

			if ( $topic->isQuestion() and $topic->topic_answered_pid )
			{
				$topicOverview['bestAnswer'] = array( 'best_answer_post', \IPS\forums\Topic\Post::load( $topic->topic_answered_pid ) );
			}

			\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'forums' )->topicHover( $topic, $topicOverview ) );
			return;
		}

		$topic->container()->setTheme();

		/* Watch for votes */
		if ( $poll = $topic->getPoll() )
		{
			$poll->attach( $topic );
		}

		/* How are we sorting posts? */
		$question = NULL;
		$offset = NULL;
		$order = 'date';
		$orderDirection = 'asc';
		$where = NULL;
		if( \IPS\forums\Topic::modPermission( 'unhide', NULL, $topic->container() ) AND \IPS\Request::i()->queued_posts )
		{
			if ( $topic->isArchived() )
			{
				$where = 'archive_queued=1';
			}
			else
			{
				$where = 'queued=1';
			}

			$queuedPagesCount = ceil( \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts', array( 'topic_id=? AND queued=1', $topic->id ) )->first() / $topic->getCommentsPerPage() );
			$pagination = ( $queuedPagesCount > 1 ) ? $topic->commentPagination( array( 'queued_posts', 'sortby' ), 'pagination', $queuedPagesCount ) : NULL;

			if ( $topic->isQuestion() )
			{
				$question = $topic->comments( 1, 0 );
			}
		}
		else
		{
			if ( $topic->isQuestion() )
			{
				$question	= $topic->comments( 1, 0 );
				try
				{
					$question->warning = \IPS\core\Warnings\Warning::constructFromData( \IPS\Db::i()->select( '*', 'core_members_warn_logs', array( array( 'wl_content_app=? AND wl_content_module=? AND wl_content_id1=? AND wl_content_id2=?', 'forums', 'forums-comment', $question->topic_id, $question->pid ) ) )->first() );
				}
				catch ( \UnderflowException $e ) { }

				$page		= ( isset( \IPS\Request::i()->page ) ) ? intval( \IPS\Request::i()->page ) : 1;

				if( $page < 1 )
				{
					$page	= 1;
				}

				$offset		= ( ( $page - 1 ) * $topic::getCommentsPerPage() ) + 1;

				if ( ( !isset( \IPS\Request::i()->sortby ) or \IPS\Request::i()->sortby != 'date' ) )
				{
					if ( $topic->isArchived() )
					{
						$order = "archive_is_first desc, archive_bwoptions";
						$orderDirection = 'desc';
					}
					else
					{
						$order = "new_topic DESC, post_bwoptions DESC, post_field_int DESC, post_date";
						$orderDirection = 'ASC';
					}
				}
			}
			$pagination = ( $topic->commentPageCount() > 1 ) ? $topic->commentPagination( array( 'sortby' ) ) : NULL;
		}
		$comments = $topic->comments( NULL, $offset, $order, $orderDirection, NULL, NULL, NULL, $where );
		$current  = current( $comments );
		reset( $comments );

		if( !count( $comments ) AND !$topic->isQuestion() )
		{
			\IPS\Output::i()->error( 'no_posts_returned', '2F173/L', 404, '' );
		}

		/* On pages 2 and more, it will show the first post on that page, and that is fine as the title has - Page 2 in it meaning its a different page */
		$metaDescription = $topic->isQuestion() ? $question->post : $current->post;

		/* Did we request a specific post? If so, reset descriptions. */
		if( isset( $_SESSION['_findComment'] ) )
		{
			$commentId	= $_SESSION['_findComment'];
			unset( $_SESSION['_findComment'] );

			try
			{
				$comment = \IPS\forums\Topic\Post::loadAndCheckPerms( $commentId );

				$metaDescription = $comment->content();
			}
			catch( \Exception $e ){}
		}

		$metaDescription = strip_tags( $metaDescription );
		\IPS\Output::i()->metaTags['description'] = \IPS\Output::i()->metaTags['og:description'] = mb_strlen( $metaDescription ) > 160 ? ( mb_substr( $metaDescription, 0, 157 ) . '...' ) : $metaDescription;

		/* Mark read */
		if( !$topic->isLastPage() )
		{
			$maxTime	= 0;

			foreach( $comments as $comment )
			{
				$maxTime	= ( $comment->mapped('date') > $maxTime ) ? $comment->mapped('date') : $maxTime;
			}

			$topic->markRead( NULL, $maxTime );
		}

		$votes		= array();
		$topicVotes = array();

		/* Get post ratings for this user */
		if ( $topic->isQuestion() && \IPS\Member::loggedIn()->member_id )
		{
			$votes		= $topic->answerVotes( \IPS\Member::loggedIn() );
			$topicVotes	= $topic->votes();
		}

		if ( $topic->isQuestion() )
		{
			\IPS\Member::loggedIn()->language()->words[ 'topic__comment_placeholder' ] = \IPS\Member::loggedIn()->language()->addToStack( 'question__comment_placeholder', FALSE );
		}

		/* Online User Location */
		\IPS\Session::i()->setLocation( $topic->url(), ( $topic->container()->password or !$topic->container()->can_view_others or $topic->container()->min_posts_view ) ? 0 : $topic->onlineListPermissions(), 'loc_forums_viewing_topic', array( $topic->title => FALSE ) );

		/* Next unread */
		try
		{
			$nextUnread	= $topic->nextUnread();
		}
		catch( \Exception $e )
		{
			$nextUnread	= NULL;
		}

		/* Show topic */
		\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'topics' )->topic( $topic, $comments, $question, $votes, $nextUnread, $pagination, $topicVotes );
	}

	/**
	 * Check our view method and act accordingly (redirect if appropriate)
	 *
	 * @return	void
	 */
	protected function _doViewCheck()
	{
		try
		{
			$class	= static::$contentModel;
			$topic	= $class::loadAndCheckPerms( \IPS\Request::i()->id );

			switch( \IPS\Request::i()->view )
			{
				case 'getnewpost':
					\IPS\Output::i()->redirect( $topic->url( 'getNewComment' ) );
				break;

				case 'getlastpost':
					\IPS\Output::i()->redirect( $topic->url( 'getLastComment' ) );
				break;
			}
		}
		catch( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/F', 403, '' );
		}
	}

	/**
	 * Edit topic
	 *
	 * @return	void
	 */
	public function edit()
	{
		try
		{
			$class = static::$contentModel;
			$topic = $class::loadAndCheckPerms( \IPS\Request::i()->id );
			$forum = $topic->container();
			$forum->setTheme();
		}
		catch ( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'no_module_permission', '2F173/D', 403, 'no_module_permission_guest' );
		}

		if ( $forum->forums_bitoptions['bw_enable_answers'] )
		{
			\IPS\Member::loggedIn()->language()->words['topic_mainTab'] = \IPS\Member::loggedIn()->language()->addToStack( 'question_mainTab', FALSE );
		}

		if ( !$topic->canEdit() and !\IPS\Request::i()->form_submitted ) // We check if the form has been submitted to prevent the user loosing their content
		{
			\IPS\Output::i()->error( 'edit_no_perm_err', '2F173/E', 403, '' );
		}

		$formElements = $class::formElements( $topic, $forum );

		$hasModOptions = FALSE;

		/* We used to just check against the ability to lock, however this may not be enough - a moderator could pin, for example, but not lock */
		foreach( array( 'lock', 'pin', 'hide', 'feature' ) AS $perm )
		{
			if ( $class::modPermission( $perm, NULL, $forum ) )
			{
				$hasModOptions = TRUE;
				break;
			}
		}

		$form = $topic->buildEditForm();

		if ( $values = $form->values() )
		{
			if ( $topic->canEdit() )
			{
				$topic->processForm( $values );
				$topic->save();
				$topic->processAfterEdit( $values );

				/* Moderator log */
				\IPS\Session::i()->modLog( 'modlog__item_edit', array( $topic::$title => FALSE, $topic->url()->__toString() => FALSE, $topic::$title => TRUE, $topic->mapped( 'title' ) => FALSE ), $topic );

				\IPS\Output::i()->redirect( $topic->url() );
			}
			else
			{
				$form->error = \IPS\Member::loggedIn()->language()->addToStack('edit_no_perm_err');
			}
		}

		$formTemplate = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'submit', 'forums' ) ), 'createTopicForm' ), $forum, $hasModOptions, $topic );

		$title = $forum->forums_bitoptions['bw_enable_answers'] ? 'edit_question' : 'edit_topic';

		\IPS\Output::i()->sidebar['enabled'] = FALSE;
		\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->createTopic( $formTemplate, $forum, $title );
		\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( $title );

		if ( !\IPS\forums\Forum::theOnlyForum() )
		{
			try
			{
				foreach( $forum->parents() AS $parent )
				{
					\IPS\Output::i()->breadcrumb[] = array( $parent->url(), $parent->_title );
				}
				\IPS\Output::i()->breadcrumb[] = array( $forum->url(), $forum->_title );
			}
			catch( \Exception $e ) {}
		}

		\IPS\Output::i()->breadcrumb[] = array( $topic->url(), $topic->mapped('title') );
		\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack( $title ) );
	}

	/**
	 * Unarchive
	 *
	 * @return	void
	 */
	public function unarchive()
	{
		\IPS\Session::i()->csrfCheck();

		try
		{
			$topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
			if ( !$topic->canUnarchive() )
			{
				throw new \OutOfRangeException;
			}
		}
		catch ( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/B', 404, '' );
		}

		$topic->topic_archive_status = \IPS\forums\Topic::ARCHIVE_RESTORE;
		$topic->save();

		/* Log */
		\IPS\Session::i()->modLog( 'modlog__unarchived_topic', array( $topic->url()->__toString() => FALSE, $topic->mapped( 'title' ) => FALSE ), $topic );

		\IPS\Output::i()->redirect( $topic->url() );
	}

	/**
	 * Rate Question
	 *
	 * @return	void
	 */
	public function rateQuestion()
	{
		/* CSRF Check */
		\IPS\Session::i()->csrfCheck();

		/* Get the question */
		try
		{
			$question = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
		}
		catch ( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/8', 404, '' );
		}

		/* Voting up or down? */
		$rating = intval( \IPS\Request::i()->rating );
		if ( $rating !== 1 and $rating !== -1 )
		{
			\IPS\Output::i()->error( 'form_bad_value', '2F173/A', 403, '' );
		}

		/* Check we can cast this vote */
		if ( !$question->canVote( $rating ) )
		{
			\IPS\Output::i()->error( 'no_module_permission', '2F173/9', 403, '' );
		}

		/* If we have an existing vote, we're just undoing that, otherwise, insert the vote */
		$ratings = $question->votes();
		if ( isset( $ratings[ \IPS\Member::loggedIn()->member_id ] ) )
		{
			\IPS\Db::i()->delete( 'forums_question_ratings', array( 'topic=? AND member=?', $question->tid, \IPS\Member::loggedIn()->member_id ) );
		}
		else
		{
			\IPS\Db::i()->insert( 'forums_question_ratings', array(
				'topic'		=> $question->tid,
				'forum'		=> $question->forum_id,
				'member'	=> \IPS\Member::loggedIn()->member_id,
				'rating'	=> $rating,
				'date'		=> time()
			), TRUE );
		}

		/* Rebuild count */
		$question->question_rating = \IPS\Db::i()->select( 'SUM(rating)', 'forums_question_ratings', array( 'topic=?', $question->tid ) )->first();
		$question->save();

		/* Redirect back */
		\IPS\Output::i()->redirect( $question->url() );
	}

	/**
	 * Rate Answer
	 *
	 * @return	void
	 */
	public function rateAnswer()
	{
		\IPS\Session::i()->csrfCheck();

		try
		{
			$question = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
			$answer = \IPS\forums\Topic\Post::loadAndCheckPerms( \IPS\Request::i()->answer );
		}
		catch ( \Exception $e )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/4', 404, '' );
		}

		if ( !$answer->item()->can('read') or !$answer->canVote() )
		{
			\IPS\Output::i()->error( 'no_module_permission', '2F173/5', 403, '' );
		}

		$rating = intval( \IPS\Request::i()->rating );
		if ( $rating !== 1 and $rating !== -1 )
		{
			\IPS\Output::i()->error( 'form_bad_value', '2F173/6', 403, '' );
		}

		/* Have we already rated ? */
		try
		{
			$rating = \IPS\Db::i()->select( '*', 'forums_answer_ratings', array( 'topic=? AND post=? AND member=?', $question->tid, $answer->pid, \IPS\Member::loggedIn()->member_id ) )->first();
			\IPS\Db::i()->delete( 'forums_answer_ratings', array( 'topic=? AND post=? AND member=?', $question->tid, $answer->pid, \IPS\Member::loggedIn()->member_id ) );
		}
		catch ( \UnderflowException $e )
		{
			\IPS\Db::i()->insert( 'forums_answer_ratings', array(
				'post'		=> $answer->pid,
				'topic'		=> $question->tid,
				'member'	=> \IPS\Member::loggedIn()->member_id,
				'rating'	=> $rating,
				'date'		=> time()
			), TRUE );
		}

		$answer->post_field_int = (int) \IPS\Db::i()->select( 'SUM(rating)', 'forums_answer_ratings', array( 'post=?', $answer->pid ) )->first();
		$answer->save();

		if ( \IPS\Request::i()->isAjax() )
		{
			\IPS\Output::i()->json( array( 'votes' => $answer->post_field_int, 'canVoteUp' => $answer->canVote(1), 'canVoteDown' => $answer->canVote(-1) ) );
		}
		else
		{
			\IPS\Output::i()->redirect( $answer->url() );
		}
	}

	/**
	 * Set Best Answer
	 *
	 * @return	void
	 */
	public function bestAnswer()
	{
		\IPS\Session::i()->csrfCheck();

		try
		{
			$topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
			if ( !$topic->canSetBestAnswer() )
			{
				throw new \OutOfRangeException;
			}

			$post = \IPS\forums\Topic\Post::loadAndCheckPerms( \IPS\Request::i()->answer );
			if ( $post->item() != $topic )
			{
				throw new \OutOfRangeException;
			}
		}
		catch ( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/7', 404, '' );
		}

		if ( $topic->topic_answered_pid )
		{
			try
			{
				$oldBestAnswer = \IPS\forums\Topic\Post::load( $topic->topic_answered_pid );
				$oldBestAnswer->post_bwoptions['best_answer'] = FALSE;
				$oldBestAnswer->save();
			}
			catch ( \Exception $e ) {}
		}

		$post->post_bwoptions['best_answer'] = TRUE;
		$post->save();

		$topic->topic_answered_pid = $post->pid;
		$topic->save();

		/* Log */
		if ( \IPS\Member::loggedIn()->modPermission('can_set_best_answer') )
		{
			\IPS\Session::i()->modLog( 'modlog__best_answer_set', array( $post->pid => FALSE ), $topic );
		}

		\IPS\Output::i()->redirect( $topic->url() );
	}

	/**
	 * Unset Best Answer
	 *
	 * @return	void
	 */
	public function unsetBestAnswer()
	{
		\IPS\Session::i()->csrfCheck();

		try
		{
			$topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
			if ( !$topic->canSetBestAnswer() )
			{
				throw new \OutOfRangeException;
			}
		}
		catch ( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/G', 404, '' );
		}

		if ( $topic->topic_answered_pid )
		{
			try
			{
				$post = \IPS\forums\Topic\Post::load( $topic->topic_answered_pid );
				$post->post_bwoptions['best_answer'] = FALSE;
				$post->save();

				if ( \IPS\Member::loggedIn()->modPermission('can_set_best_answer') )
				{
					\IPS\Session::i()->modLog( 'modlog__best_answer_unset', array( $topic->topic_answered_pid => FALSE ), $topic );
				}
			}
			catch ( \Exception $e ) {}
		}

		$topic->topic_answered_pid = FALSE;
		$topic->save();

		\IPS\Output::i()->redirect( $topic->url() );
	}

	/**
	 * Saved Action
	 *
	 * @return	void
	 */
	public function savedAction()
	{
		try
		{
			\IPS\Session::i()->csrfCheck();

			$topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
			$action = \IPS\forums\SavedAction::load( \IPS\Request::i()->action );
			$action->runOn( $topic );

			/* Log */
			\IPS\Session::i()->modLog( 'modlog__saved_action', array( 'forums_mmod_' . $action->mm_id => TRUE, $topic->url()->__toString() => FALSE, $topic->mapped( 'title' ) => FALSE ), $topic );
			\IPS\Output::i()->redirect( $topic->url() );
		}
		catch ( \LogicException $e )
		{

		}
	}

	/**
	 * Mark Topic Read
	 *
	 * @return	void
	 */
	public function markRead()
	{
		\IPS\Session::i()->csrfCheck();

		try
		{
			$topic = \IPS\forums\Topic::load( \IPS\Request::i()->id );
			$topic->markRead();

			if ( \IPS\Request::i()->isAjax() )
			{
				\IPS\Output::i()->json( "OK" );
			}
			else
			{
				\IPS\Output::i()->redirect( $topic->url() );
			}
		}
		catch ( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'no_module_permission', '2F173/C', 403, 'no_module_permission_guest' );
		}
	}

	/**
	 * We need to use the custom widget poll template for ajax methods
	 *
	 * @return void
	 */
	public function widgetPoll()
	{
		try
		{
			$topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
		}
		catch( \OutOfRangeException $ex )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/N', 403, '' );
		}

		$poll  = $topic->getPoll();
		$poll->displayTemplate = array( \IPS\Theme::i()->getTemplate( 'widgets', 'forums', 'front' ), 'pollWidget' );
		$poll->url = $topic->url();

		\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'widgets', 'forums', 'front' )->poll( $topic, $poll );
	}

	/**
	 * Edit Comment/Review
	 *
	 * @param	string					$commentClass	The comment/review class
	 * @param	\IPS\Content\Comment	$comment		The comment/review
	 * @param	\IPS\Content\Item		$item			The item
	 * @return	void
	 * @throws	\LogicException
	 */
	protected function _edit( $commentClass, $comment, $item )
	{
		\IPS\Member::loggedIn()->language()->words['edit_comment']		= \IPS\Member::loggedIn()->language()->addToStack( 'edit_reply', FALSE );

		return parent::_edit( $commentClass, $comment, $item );
	}

	/**
	 * Stuff that applies to both comments and reviews
	 *
	 * @param	string	$method	Desired method
	 * @param	array	$args	Arguments
	 * @return	void
	 */
	public function __call( $method, $args )
	{
		$class = static::$contentModel;

		try
		{
			$item = $class::load( \IPS\Request::i()->id );
			if ( !$item->canView() )
			{
				$forum = $item->container();
				\IPS\Output::i()->error( $forum ? $forum->errorMessage() : 'node_error_no_perm', '2F173/K', 403, '' );
			}

			if ( $item->isArchived() )
			{
				$class::$commentClass = $class::$archiveClass;
			}

			return parent::__call( $method, $args );
		}
		catch( \OutOfRangeException $e )
		{
			if ( isset( \IPS\Request::i()->do ) AND \IPS\Request::i()->do === 'findComment' AND isset( \IPS\Request::i()->comment ) )
			{
				try
				{
					$comment = \IPS\forums\Topic\Post::load( \IPS\Request::i()->comment );
					$topic   = \IPS\forums\Topic::load( $comment->topic_id );

					\IPS\Output::i()->redirect( $topic->url()->setQueryString( array( 'do' => 'findComment', 'comment' => \IPS\Request::i()->comment ) ), NULL, 301 );
				}
				catch( \Exception $e )
				{
					\IPS\Output::i()->error( 'node_error', '2F173/M', 404, '' );
				}
			}
		}
		catch ( \Exception $e )
		{
			\IPS\Output::i()->error( 'node_error', '2F173/I', 404, '' );
		}
	}
}


text:
package com.dtodorov.androlib.services;

import android.content.Intent;

public interface IIntentService
{
    void enactIntent(String action, IIntentListener listener);

    // unfortunately you have to call this manually from your activity, thanks android
    void onActivityResult(int requestCode, int resultCode, Intent data);
}


text:
package org.onosproject.net.intent;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onosproject.core.IdGenerator;
import org.onosproject.store.Timestamp;

import com.google.common.testing.EqualsTester;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.onosproject.net.intent.IntentTestsMocks.MockIntent;
import static org.onosproject.net.intent.IntentTestsMocks.MockTimestamp;

/**
 * Unit tests for intent data objects.
 */
public class IntentDataTest {

    private Timestamp timestamp1;
    private Timestamp timestamp2;
    private Timestamp timestamp3;

    private Intent intent1;
    private Intent intent2;
    private Intent intent3;

    private IntentData data1;
    private IntentData data1Copy;
    private IntentData data2;
    private IntentData data2Copy;
    private IntentData data3;
    private IntentData data3Copy;

    IdGenerator idGenerator;

    @Before
    public void setUpTest() {
        idGenerator = new MockIdGenerator();
        Intent.bindIdGenerator(idGenerator);

        timestamp1 = new MockTimestamp(1);
        timestamp2 = new MockTimestamp(2);
        timestamp3 = new MockTimestamp(3);

        intent1 = new MockIntent(1L);
        intent2 = new MockIntent(2L);
        intent3 = new MockIntent(3L);

        data1 = new IntentData(intent1, IntentState.INSTALLED, timestamp1);
        data1Copy = new IntentData(intent1, IntentState.INSTALLED, timestamp1);
        data2 = new IntentData(intent2, IntentState.INSTALLED, timestamp2);
        data2Copy = new IntentData(intent2, IntentState.INSTALLED, timestamp2);
        data3 = new IntentData(intent3, IntentState.INSTALLED, timestamp3);
        data3Copy = new IntentData(intent3, IntentState.INSTALLED, timestamp3);
    }

    @After
    public void tearDownTest() {
        Intent.unbindIdGenerator(idGenerator);
    }

    /**
     * Checks that intent data objects are properly constructed.
     */
    @Test
    public void checkConstruction() {
        assertThat(data1.state(), is(IntentState.INSTALLED));
        assertThat(data1.version(), is(timestamp1));
        assertThat(data1.intent(), is(intent1));
    }

    /**
     * Checks equals() for intent data objects.
     */
    @Test
    public void checkEquals() {
        new EqualsTester()
                .addEqualityGroup(data1, data1Copy)
                .addEqualityGroup(data2, data2Copy)
                .addEqualityGroup(data3, data3Copy)
                .testEquals();
    }
}


text:
require 'spec_helper'

describe Axiom::Adapter::Arango::Visitor::Literal, '#root' do
  subject { object.root }

  let(:relation) { 'foo' }
  let(:context)  { mock }

  expect_aql('"foo"')
end


text:
use strict;
package main;

# Define AdminName and reportOwner
$adminName = $sessionObj->param("selectedAdmin");
$userName = $sessionObj->param("selectedUser");

# Set UserIndex
$userIndex = setUserIndex();

# init message variables
$sessionObj->param("userMessage", "");
my $errorMessage = "";

checkAdminName($adminName);
syncAdminName($adminName);
checkUserName($adminName, $userName);
syncUserName($userName);
my $memberName = $request->param('memberName');
$reportName = $request->param('reportName');

insertSharedReportMember($adminName, $userName, $memberName, $reportName);
$queryString = 	"reportName=" . URLEncode($reportName);

################################################### SUBROUTINES
#INSERT  TO HOST GROUP
sub insertSharedReportMember {
	my ($adminName, $ownerName, $memberName, $reportName) = @_;

	# Update user2Report Index
	my $user2Report = lock_retrieve("$perfhome/var/db/mappings/user2Report.ser") or die("Could not lock_retrieve from $perfhome/var/db/mappings/user2Report.ser");
	$user2Report->{$adminName}->{$ownerName}->{$memberName}->{$reportName} = "r";
	lock_store($user2Report, "$perfhome/var/db/mappings/user2Report.ser") or die("Can't store host2HostGroup in $perfhome/var/db/mappings/user2Report.ser\n");
}

1;


text:
<!DOCTYPE html>
<html>
   <head>
      <title>Mirrored Sphere</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" ></meta>
    <link rel="stylesheet" type="text/css" href="http://www.x3dom.org/download/dev/x3dom.css"></link>
    <script type="text/javascript" src="http://www.x3dom.org/download/dev/x3dom-full.js"></script>
   <style>
body {
	margin:0px;
	padding:0px;
}
   </style>
  </head>
  <body>
<X3D profile="Full" version="3.3" xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd' xmlns:xsd='http://www.web3d.org/specifications/x3d-namespace'>
      <Scene>
        <Viewpoint position='0 5 100' description='Switch background and cubemap texture'></Viewpoint>
        <Transform >
          <Shape>
            <Appearance>
                <Material diffuseColor=".7 .7 .7" specularColor=".5 .5 .5" ></Material>
                <ComposedCubeMapTexture>
                    <ImageTexture id="backShader" containerField="back" url='"cubemap/all_probes/beach_cross/beach_back.png"' ></ImageTexture>
                    <ImageTexture id="bottomShader" containerField="bottom" url='"cubemap/all_probes/beach_cross/beach_bottom.png"' ></ImageTexture>
                    <ImageTexture id="frontShader" containerField="front" url='"cubemap/all_probes/beach_cross/beach_front.png"' ></ImageTexture>
                    <ImageTexture id="leftShader" containerField="left" url='"cubemap/all_probes/beach_cross/beach_left.png"' ></ImageTexture>
                    <ImageTexture id="rightShader" containerField="right" url='"cubemap/all_probes/beach_cross/beach_right.png"' ></ImageTexture>
                    <ImageTexture id="topShader" containerField="top" url='"cubemap/all_probes/beach_cross/beach_top.png"' ></ImageTexture>
                </ComposedCubeMapTexture>

                <ComposedShader language='GLSL'>
<!--http://hypertextbook.com/facts/2005/JustinChe.shtml-->
                  <field name='chromaticDispersion' accessType='inputOutput' type='SFVec3f' value='0.98 1 1.033'></field>
                  <field name='background' accessType='inputOutput' type='SFInt32' value='0'></field>
		  <field name='bias' accessType='inputOutput' type='SFFloat' value='0.5'></field>
                  <field name='scale' accessType='inputOutput' type='SFFloat' value='0.5'></field>
                  <field name='power' accessType='inputOutput' type='SFFloat' value='2'></field>
                  <ShaderPart type='VERTEX' containerField="parts">

attribute vec3 position;
attribute vec3 normal;
attribute vec2 texcoord;

uniform mat4 modelViewProjectionMatrix;
uniform mat4 modelViewMatrix;
uniform mat4 modelViewMatrixInverse;
uniform mat4 normalMatrix;

varying vec3 r;
varying vec3 tr;
varying vec3 tg;
varying vec3 tb;
varying float rfac;

uniform vec3 chromaticDispersion;
uniform float bias;
uniform float scale;
uniform float power;

void main()
{
    vec4 eye = vec4(modelViewMatrixInverse * vec4(0,0,0,1));
    vec3 fragEyeVector = position - eye.xyz;

    vec3 i = normalize(fragEyeVector);
    r = reflect(i, normal);
    tr = refract(i, normal, chromaticDispersion.x);
    tg = refract(i, normal, chromaticDispersion.y);
    tb = refract(i, normal, chromaticDispersion.z);
    rfac = bias + scale * pow(0.5+0.5*dot(i, normal), power);

    gl_Position = modelViewProjectionMatrix*vec4(position, 1);
}
                  </ShaderPart>
                  <ShaderPart type='FRAGMENT' containerField="parts">
/*
The MIT License (MIT)
Copyright (c) 2011 Authors of J3D. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef GL_ES
  precision highp float;
#endif

uniform samplerCube background;

varying vec3 r;
varying vec3 tr;
varying vec3 tg;
varying vec3 tb;
varying float rfac;

void main()
{
    vec4 tcol = vec4(1.0);

    vec4 rcol = textureCube(background, r);
    tcol.r = textureCube(background, tr).r;
    tcol.g = textureCube(background, tg).g;
    tcol.b = textureCube(background, tb).b;

    gl_FragColor = mix(tcol, rcol, rfac);
}

                  </ShaderPart>
                </ComposedShader>
            </Appearance>
            <Sphere radius="30"></Sphere>
          </Shape>
        </Transform>
      </Scene>
    </X3D>
<script type="text/javascript">
var frontUrls = ["cubemap/all_probes/beach_cross/beach_front.png","cubemap/all_probes/building_cross/building_front.png","cubemap/all_probes/campus_cross/campus_front.png","cubemap/all_probes/galileo_cross/galileo_front.png","cubemap/all_probes/grace_cross/grace_front.png","cubemap/all_probes/kitchen_cross/kitchen_front.png","cubemap/all_probes/rnl_cross/rnl_front.png","cubemap/all_probes/stpeters_cross/stpeters_front.png","cubemap/all_probes/uffizi_cross/uffizi_front.png"];

var backUrls = ["cubemap/all_probes/beach_cross/beach_back.png","cubemap/all_probes/building_cross/building_back.png","cubemap/all_probes/campus_cross/campus_back.png","cubemap/all_probes/galileo_cross/galileo_back.png","cubemap/all_probes/grace_cross/grace_back.png","cubemap/all_probes/kitchen_cross/kitchen_back.png","cubemap/all_probes/rnl_cross/rnl_back.png","cubemap/all_probes/stpeters_cross/stpeters_back.png","cubemap/all_probes/uffizi_cross/uffizi_back.png"];

var leftUrls = ["cubemap/all_probes/beach_cross/beach_left.png","cubemap/all_probes/building_cross/building_left.png","cubemap/all_probes/campus_cross/campus_left.png","cubemap/all_probes/galileo_cross/galileo_left.png","cubemap/all_probes/grace_cross/grace_left.png","cubemap/all_probes/kitchen_cross/kitchen_left.png","cubemap/all_probes/rnl_cross/rnl_left.png","cubemap/all_probes/stpeters_cross/stpeters_left.png","cubemap/all_probes/uffizi_cross/uffizi_left.png"];

var rightUrls = ["cubemap/all_probes/beach_cross/beach_right.png","cubemap/all_probes/building_cross/building_right.png","cubemap/all_probes/campus_cross/campus_right.png","cubemap/all_probes/galileo_cross/galileo_right.png","cubemap/all_probes/grace_cross/grace_right.png","cubemap/all_probes/kitchen_cross/kitchen_right.png","cubemap/all_probes/rnl_cross/rnl_right.png","cubemap/all_probes/stpeters_cross/stpeters_right.png","cubemap/all_probes/uffizi_cross/uffizi_right.png"];

var topUrls = ["cubemap/all_probes/beach_cross/beach_top.png","cubemap/all_probes/building_cross/building_top.png","cubemap/all_probes/campus_cross/campus_top.png","cubemap/all_probes/galileo_cross/galileo_top.png","cubemap/all_probes/grace_cross/grace_top.png","cubemap/all_probes/kitchen_cross/kitchen_top.png","cubemap/all_probes/rnl_cross/rnl_top.png","cubemap/all_probes/stpeters_cross/stpeters_top.png","cubemap/all_probes/uffizi_cross/uffizi_top.png"];

var bottomUrls = ["cubemap/all_probes/beach_cross/beach_bottom.png","cubemap/all_probes/building_cross/building_bottom.png","cubemap/all_probes/campus_cross/campus_bottom.png","cubemap/all_probes/galileo_cross/galileo_bottom.png","cubemap/all_probes/grace_cross/grace_bottom.png","cubemap/all_probes/kitchen_cross/kitchen_bottom.png","cubemap/all_probes/rnl_cross/rnl_bottom.png","cubemap/all_probes/stpeters_cross/stpeters_bottom.png","cubemap/all_probes/uffizi_cross/uffizi_bottom.png"];

var old = -1;

function setSide(id, url) {
    console.log(id, url);
    document.querySelector(id).setAttribute("url",  '"'+url+'"');
}

setInterval(function () {
	    var side = old+1;
	    if (side > frontUrls.length-1) {
	    	side = 0;
	    }
	    if (side != old) {
	    	    console.log(side);
	    	    old = side;
		    setSide("#frontShader",  frontUrls[side]);
		    setSide("#backShader",  backUrls[side]);
		    setSide("#leftShader",  leftUrls[side]);
		    setSide("#rightShader",  rightUrls[side]);
		    setSide("#topShader",  topUrls[side]);
		    setSide("#bottomShader",  bottomUrls[side]);
            }
        }, 1000)
</script>
  </body>
</html>


text:
import base64
import pickle
from collections import UserDict

from openid.association import Association as OIDAssociation
from openid.extensions.ax import FetchResponse
from openid.extensions.sreg import SRegResponse
from openid.store.interface import OpenIDStore as OIDStore

from allauth.utils import valid_email_or_none

from .models import OpenIDNonce, OpenIDStore

class JSONSafeSession(UserDict):
    """
    openid puts e.g. class OpenIDServiceEndpoint in the session.
    Django 1.6 no longer pickles stuff, so we'll need to do some
    hacking here...
    """
    def __init__(self, session):
        UserDict.__init__(self)
        self.data = session

    def __setitem__(self, key, value):
        data = base64.b64encode(pickle.dumps(value)).decode('ascii')
        return UserDict.__setitem__(self, key, data)

    def __getitem__(self, key):
        data = UserDict.__getitem__(self, key)
        return pickle.loads(base64.b64decode(data.encode('ascii')))

class OldAXAttribute:
    PERSON_NAME = 'http://openid.net/schema/namePerson'
    PERSON_FIRST_NAME = 'http://openid.net/schema/namePerson/first'
    PERSON_LAST_NAME = 'http://openid.net/schema/namePerson/last'

class AXAttribute:
    CONTACT_EMAIL = 'http://axschema.org/contact/email'
    PERSON_NAME = 'http://axschema.org/namePerson'
    PERSON_FIRST_NAME = 'http://axschema.org/namePerson/first'
    PERSON_LAST_NAME = 'http://axschema.org/namePerson/last'

AXAttributes = [
    AXAttribute.CONTACT_EMAIL,
    AXAttribute.PERSON_NAME,
    AXAttribute.PERSON_FIRST_NAME,
    AXAttribute.PERSON_LAST_NAME,
    OldAXAttribute.PERSON_NAME,
    OldAXAttribute.PERSON_FIRST_NAME,
    OldAXAttribute.PERSON_LAST_NAME,
]

class SRegField:
    EMAIL = 'email'
    NAME = 'fullname'

SRegFields = [
    SRegField.EMAIL,
    SRegField.NAME,
]

class DBOpenIDStore(OIDStore):
    max_nonce_age = 6 * 60 * 60

    def storeAssociation(self, server_url, assoc=None):
        try:
            secret = base64.encodebytes(assoc.secret)
        except AttributeError:
            # Python 2.x compat
            secret = base64.encodestring(assoc.secret)
        else:
            secret = secret.decode()
        OpenIDStore.objects.create(
            server_url=server_url,
            handle=assoc.handle,
            secret=secret,
            issued=assoc.issued,
            lifetime=assoc.lifetime,
            assoc_type=assoc.assoc_type
        )

    def getAssociation(self, server_url, handle=None):
        stored_assocs = OpenIDStore.objects.filter(
            server_url=server_url
        )
        if handle:
            stored_assocs = stored_assocs.filter(handle=handle)

        stored_assocs.order_by('-issued')

        if stored_assocs.count() == 0:
            return None

        return_val = None

        for stored_assoc in stored_assocs:
            assoc = OIDAssociation(
                stored_assoc.handle,
                base64.decodestring(stored_assoc.secret.encode('utf-8')),
                stored_assoc.issued, stored_assoc.lifetime,
                stored_assoc.assoc_type
            )
            # See:
            # necaris/python3-openid@1abb155c8fc7b508241cbe9d2cae24f18e4a379b
            if hasattr(assoc, 'getExpiresIn'):
                expires_in = assoc.getExpiresIn()
            else:
                expires_in = assoc.expiresIn
            if expires_in == 0:
                stored_assoc.delete()
            else:
                if return_val is None:
                    return_val = assoc

        return return_val

    def removeAssociation(self, server_url, handle):
        stored_assocs = OpenIDStore.objects.filter(
            server_url=server_url
        )
        if handle:
            stored_assocs = stored_assocs.filter(handle=handle)

        stored_assocs.delete()

    def useNonce(self, server_url, timestamp, salt):
        try:
            OpenIDNonce.objects.get(
                server_url=server_url,
                timestamp=timestamp,
                salt=salt
            )
        except OpenIDNonce.DoesNotExist:
            OpenIDNonce.objects.create(
                server_url=server_url,
                timestamp=timestamp,
                salt=salt
            )
            return True

        return False

def get_email_from_response(response):
    email = None
    sreg = SRegResponse.fromSuccessResponse(response)
    if sreg:
        email = valid_email_or_none(sreg.get(SRegField.EMAIL))
    if not email:
        ax = FetchResponse.fromSuccessResponse(response)
        if ax:
            try:
                values = ax.get(AXAttribute.CONTACT_EMAIL)
                if values:
                    email = valid_email_or_none(values[0])
            except KeyError:
                pass
    return email

def get_value_from_response(response, sreg_names=None, ax_names=None):
    value = None
    if sreg_names:
        sreg = SRegResponse.fromSuccessResponse(response)
        if sreg:
            for name in sreg_names:
                value = sreg.get(name)
                if value:
                    break

    if not value and ax_names:
        ax = FetchResponse.fromSuccessResponse(response)
        if ax:
            for name in ax_names:
                try:
                    values = ax.get(name)
                    if values:
                        value = values[0]
                except KeyError:
                    pass
                if value:
                    break
    return value


text:
#include "aton_framebuffer.h"
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>

using namespace std;
using namespace boost;

const std::string chStr::RGBA = "RGBA",
                  chStr::rgb = "rgb",
                  chStr::depth = "depth",
                  chStr::Z = "Z",
                  chStr::N = "N",
                  chStr::P = "P",
                  chStr::ID = "ID",
                  chStr::_red = ".red",
                  chStr::_green = ".green",
                  chStr::_blue = ".blue",
                  chStr::_X = ".X",
                  chStr::_Y = ".Y",
                  chStr::_Z = ".Z";

// Unpack 1 int to 4
const std::vector<int> unpack_4_int(const int& i)
{
    const int arr[] = {((i % 10000000) / 1000000),
                       ((i % 1000000) / 10000),
                       ((i % 10000) / 100),
                        (i % 100)};

    std::vector<int> out(arr, arr + 4);
    return out;
}

// Lightweight color pixel class
RenderColor::RenderColor() { _val[0] = _val[1] = _val[2] = 0.0f; }

float& RenderColor::operator[](int i) { return _val[i]; }

const float& RenderColor::operator[](int i) const { return _val[i]; }

void RenderColor::reset() { _val[0] = _val[1] = _val[2] = 0.0f; }

// AOVBuffer class
AOVBuffer::AOVBuffer(const unsigned int& width,
                     const unsigned int& height,
                     const int& spp)
{
    const int size = width * height;

    switch (spp)
    {
        case 1: // Float channels
            _float_data.resize(size);
            break;
        case 3: // Color Channels
            _color_data.resize(size);
            break;
        case 4: // Color + Alpha channels
            _color_data.resize(size);
            _float_data.resize(size);
            break;
    }
}

// RenderBuffer class
RenderBuffer::RenderBuffer(const double& currentFrame,
                           const int& w,
                           const int& h,
                           const float& p): _frame(currentFrame),
                                            _width(w),
                                            _height(h),
                                            _pix_aspect(p),
                                            _progress(0),
                                            _time(0),
                                            _ram(0),
                                            _pram(0),
                                            _ready(false),
                                            _fov(0.0f),
                                            _matrix(Matrix4()),
                                            _version_int(0),
                                            _version_str(""),
                                            _samples_str("") {}
// Add new buffer
void RenderBuffer::add_aov(const char* aov,
                           const int& spp)
{
    AOVBuffer buffer(_width, _height, spp);

    _buffers.push_back(buffer);
    _aovs.push_back(aov);
}

// Get writable buffer object
void RenderBuffer::set_aov_pix(const int& b,
                               const int& x,
                               const int& y,
                               const int& spp,
                               const int& c,
                               const float& pix)
{
    AOVBuffer& rb = _buffers[b];
    const unsigned int index = (_width * y) + x;
    if (c < 3 && spp != 1)
        rb._color_data[index][c] = pix;
    else
        rb._float_data[index] = pix;
}

// Get read only buffer object
const float& RenderBuffer::get_aov_pix(const int& b,
                                       const int& x,
                                       const int& y,
                                       const int& c) const
{
    const AOVBuffer& rb = _buffers[b];
    const unsigned int index = (_width * y) + x;
    if (c < 3 && !rb._color_data.empty())
        return rb._color_data[index][c];
    else
        return rb._float_data[index];
}

// Get the current buffer index
int RenderBuffer::get_aov_index(const Channel& z)
{
    int aov_index = 0;
    if (_aovs.size() > 1)
    {
        using namespace chStr;
        const std::string& layer = getLayerName(z);

        std::vector<std::string>::iterator it;
        for(it = _aovs.begin(); it != _aovs.end(); ++it)
        {
            if (*it == layer)
            {
                aov_index = static_cast<int>(it - _aovs.begin());
                break;
            }
            else if (*it == Z && layer == depth)
            {
                aov_index = static_cast<int>(it - _aovs.begin());
                break;
            }
        }

    }
    return aov_index;
}

// Get the current buffer index
int RenderBuffer::get_aov_index(const char* aov_name)
{
    int aov_index = 0;
    if (_aovs.size() > 1)
    {
        std::vector<std::string>::iterator it;
        for(it = _aovs.begin(); it != _aovs.end(); ++it)
        {
            if (*it == aov_name)
            {
                aov_index = static_cast<int>(it - _aovs.begin());
                break;
            }
        }
    }
    return aov_index;
}

// Get N buffer/aov name name
std::string RenderBuffer::get_aov_name(const int& aov_index)
{
    std::string aov_name = "";

    if(!_aovs.empty())
    {
        try
        {
            aov_name = _aovs.at(aov_index);
        }
        catch (const std::out_of_range& e)
        {
            (void)e;
        }
        catch (...)
        {
            std::cerr << "Unexpected error at getting buffer name" << std::endl;
        }
    }

    return aov_name;
}

// Get last buffer/aov name
bool RenderBuffer::first_aov_name(const char* aovName)
{
    return strcmp(_aovs.front().c_str(), aovName) == 0;
}

// Check if Aovs has been changed
bool RenderBuffer::aovs_changed(const std::vector<std::string>& aovs)
{
    return (aovs != _aovs);
}

// Check if Resolution has been changed
bool RenderBuffer::resolution_changed(const unsigned int& w,
                                      const unsigned int& h)
{
    return (w != _width || h != _height);
}

bool RenderBuffer::camera_changed(const float& fov,
                                  const Matrix4& matrix)
{
    return (_fov != fov || _matrix != matrix);
}

// Resize the containers to match the resolution
void RenderBuffer::set_resolution(const unsigned int& w,
                                  const unsigned int& h)
{
    _width = w;
    _height = h;

    const int size = _width * _height;

    std::vector<AOVBuffer>::iterator it;
    for(it = _buffers.begin(); it != _buffers.end(); ++it)
    {
        if (!it->_color_data.empty())
        {
            RenderColor color;
            std::fill(it->_color_data.begin(), it->_color_data.end(), color);
            it->_color_data.resize(size);
        }
        if (!it->_float_data.empty())
        {
            std::fill(it->_float_data.begin(), it->_float_data.end(), 0.0f);
            it->_float_data.resize(size);
        }
    }
}

// Clear buffers and aovs
void RenderBuffer::clear_all()
{
    _buffers = std::vector<AOVBuffer>();
    _aovs = std::vector<std::string>();
}

// Check if the given buffer/aov name name is exist
bool RenderBuffer::aov_exists(const char* aovName)
{
    return std::find(_aovs.begin(), _aovs.end(), aovName) != _aovs.end();
}

// Resize the buffers
void RenderBuffer::resize(const size_t& s)
{
    _aovs.resize(s);
    _buffers.resize(s);
}

// Set status parameters
void RenderBuffer::set_progress(const int& area)
{
    // Calculate the progress percentage
    _rendered_area -= area;
    const float progress = 100.0f - (_rendered_area * 100.0f) / _region_area;
    _progress = progress > 100 ? 100 : static_cast<int>(progress);
}

void RenderBuffer::set_memory(const long long& ram)
{
    _ram = static_cast<int>(ram / 1048576);
    _pram = _ram > _pram ? _ram : _pram;
}
void RenderBuffer::set_time(const int& time,
                            const int& dtime)
{
    _time = dtime > time ? time : time - dtime;

    const int hour = _time / 3600000;
    const int minute = (_time % 3600000) / 60000;
    const int second = ((_time % 3600000) % 60000) / 1000;

    _time_str = (boost::format("%02ih:%02im:%02is")%hour%minute%second).str();
}

// Set Version
void RenderBuffer::set_version(const int& version)
{
    const std::vector<int> ver = unpack_4_int(version);

    _version_str = lexical_cast<string>(ver[0]) + "." +
                   lexical_cast<string>(ver[1]) + "." +
                   lexical_cast<string>(ver[2]) + "." +
                   lexical_cast<string>(ver[3]);
}

// Set Samples
void RenderBuffer::set_samples(std::vector<int> sp)
{
    _samples_str = lexical_cast<string>(sp[0]) + "/" +
                   lexical_cast<string>(sp[1]) + "/" +
                   lexical_cast<string>(sp[2]) + "/" +
                   lexical_cast<string>(sp[3]) + "/" +
                   lexical_cast<string>(sp[4]) + "/" +
                   lexical_cast<string>(sp[5]);
}

void RenderBuffer::set_camera(const float& fov, const Matrix4& matrix)
{
    _fov = fov;
    _matrix = matrix;
}

RenderBuffer* FrameBuffer::get_renderbuffer(double frame)
{
    int index = 0;
    if (_frames.size() > 1)
    {
        int nearFIndex = INT_MIN;
        int minFIndex = INT_MAX;

        std::vector<double>::iterator it;
        for(it = _frames.begin(); it != _frames.end(); ++it)
        {
            if (frame == *it)
            {
                index = static_cast<int>(it - _frames.begin());
                break;
            }
            else if (frame > *it && nearFIndex < *it)
            {
                nearFIndex = static_cast<int>(*it);
                index = static_cast<int>(it - _frames.begin());
                continue;
            }
            else if (*it < minFIndex && nearFIndex == INT_MIN)
            {
                minFIndex = static_cast<int>(*it);
                index = static_cast<int>(it - _frames.begin());
            }
        }
    }

    return &_renderbuffers[index];
}

RenderBuffer* FrameBuffer::add_renderbuffer(DataHeader* dh)
{
        RenderBuffer rb(dh->frame(), dh->xres(), dh->yres(), dh->pixel_aspect());

        _output_name = (boost::format("%s_%d_%s")%dh->output_name()
                                                 %dh->frame()%get_date()).str();

        if (!_frames.empty())
            rb = _renderbuffers.back();

        _frame  = dh->frame();
        _session = dh->session();
        _frames.push_back(dh->frame());
        _renderbuffers.push_back(rb);
        return &_renderbuffers.back();
}

// Udpate RenderBuffer
void FrameBuffer::update_renderbuffer(DataHeader* dh)
{
    _session = dh->session();
    _output_name = (boost::format("%s_%d_%s")%dh->output_name()
                                             %dh->frame()%get_date()).str();
    _frame = dh->frame();
}

// Clear All Data
void FrameBuffer::clear_all()
{
    _frames = std::vector<double>();
    _renderbuffers = std::vector<RenderBuffer>();
}

// Check if RenderBuffer already exists
bool FrameBuffer::renderbuffer_exists(double frame)
{
    if (!_frames.empty())
        return (std::find(_frames.begin(), _frames.end(), frame) != _frames.end());
    else
        return 0;
}


text:
package org.spongepowered.common.data.provider.entity;

import net.minecraft.core.MappedRegistry;
import net.minecraft.world.entity.animal.Cat;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.Keys;
import org.spongepowered.api.data.type.CatType;
import org.spongepowered.api.data.type.DyeColor;
import org.spongepowered.api.registry.RegistryTypes;
import org.spongepowered.common.data.provider.DataProviderRegistrator;
import org.spongepowered.common.util.MissingImplementationException;

public final class CatData {

    private CatData() {
    }

    // @formatter:off
    public static void register(final DataProviderRegistrator registrator) {
        registrator
                .asMutable(Cat.class)
                    .create(Keys.CAT_TYPE)
                        .get(h -> {
                            final int type = h.getCatType();
                            return ((MappedRegistry<CatType>) (Object) Sponge.game().registry(RegistryTypes.CAT_TYPE)).byId(type);
                        })
                        .set((h, v) -> h.setCatType(((MappedRegistry<CatType>) (Object) Sponge.game().registry(RegistryTypes.CAT_TYPE)).getId(v)))
                    .create(Keys.DYE_COLOR)
                        .get(h -> (DyeColor) (Object) h.getCollarColor())
                        .set((h, v) -> h.setCollarColor((net.minecraft.world.item.DyeColor) (Object) v))
                    .create(Keys.IS_BEGGING_FOR_FOOD)
                        .get(h -> {
                            throw new MissingImplementationException("CatData", "IS_BEGGING_FOR_FOOD::getter");
                        })
                        .set((h, v) -> {
                            throw new MissingImplementationException("CatData", "IS_BEGGING_FOR_FOOD::setter");
                        })
                    .create(Keys.IS_HISSING)
                        .get(h -> {
                            throw new MissingImplementationException("CatData", "IS_HISSING::getter");
                        })
                        .set((h, v) -> {
                            throw new MissingImplementationException("CatData", "IS_HISSING::setter");
                        })
                    .create(Keys.IS_LYING_DOWN)
                        .get(Cat::isLying)
                        .set(Cat::setLying)
                    .create(Keys.IS_PURRING)
                        .get(h -> {
                            throw new MissingImplementationException("CatData", "IS_PURRING::getter");
                        })
                        .set((h, v) -> {
                            throw new MissingImplementationException("CatData", "IS_PURRING::setter");
                        })
                    .create(Keys.IS_RELAXED)
                        .get(Cat::isRelaxStateOne)
                        .set(Cat::setRelaxStateOne);
    }
    // @formatter:on
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Platfone</title>
	<link rel="stylesheet" href="css/lib/bootstrap/bootstrap.css">
	<link rel="stylesheet" href="css/main.css">

	    	Platfone

	    <form class="navbar-form navbar-left" role="search">

		      <input type="text" class="form-control" placeholder="Find a Dream">

		        <button class="btn btn-default" type="button">

		        </button>

			</form>

	    	Your Dream?

	<ui-view></ui-view>


text:
layout: page
title: About
permalink: /about/
---

Hi there,

I am a research associate with a solid analytical background on real-world data and an experienced environmental science researcher. I crunch an assortment of large data-set during my spare time to refine and build up on my analytical and visualisation techniques.

### Contact me

[adamquek79@gmail.com](mailto:adamquek79@gmail.com)


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

namespace PertEstimate
{
    public static class PertEstimate
    {

        public static double Estimate(double likelyAmount, double bestCaseAmount, double worstCaseAmount)
        {
            return (likelyAmount * 4 + bestCaseAmount + worstCaseAmount) / 6;
        }

    }
}


text:
import {Component} from "@angular/core";

@Component({
	templateUrl: "./templates/login.php"
})

export class LoginComponent {}


text:
<?php

use BEM\BH;

class bhMatchTest extends PHPUnit_Framework_TestCase
{
    /**
     * @before
     */
    public function setupBhInstance()
    {
        $this->bh = new BH();
    }

    public function test_it_should_not_create_invalid_matcher()
    {
        $this->bh->match(false, function () {});
        $this->assertEquals('', $this->bh->apply(''));
    }

    public function test_it_should_allow_to_use_chaining()
    {
        $this->assertEquals(
            $this->bh,
            $this->bh->match('button', function () {})
        );
    }

    public function test_it_should_match_on_elem_of_block_with_modifier()
    {
        $this->bh->match('button_disabled__control', function ($ctx) {
            $ctx->tag('input');
        });

        $this->assertEquals(
            '
<input class="button__control"/>
',
            $this->bh->apply([
                'block' => 'button',
                'mods' => ['disabled' => true],
                'content' => ['elem' => 'control']
            ])
        );
    }

    public function test_it_should_allow_to_use_a_few_matchers_in_one_call_n1()
    {
        $this->bh->match([
            'button' => function ($ctx) {
                $ctx->tag('button');
            },
            'button_type_submit' => function ($ctx) {
                $ctx->attr('type', 'submit');
            }
        ]);

        $this->assertEquals(
            '<button class="button button_type_submit" type="submit"></button>',
            $this->bh->apply(['block' => 'button', 'mods' => ['type' => 'submit']])
        );
    }

    public function test_it_should_allow_to_use_a_few_matchers_in_one_call_n2()
    {
        $this->bh->match(
            [
                'item__mark',
                'item__text'
            ],
            function ($ctx) {
                $ctx->tag('span');
            }
        );

        $this->assertEquals(
            '
' .
                '*' .
                'foobar' .
            '
',
            $this->bh->apply([
                'block' => 'item',
                'content' => [
                    ['elem' => 'mark', 'content' => '*'],
                    ['elem' => 'text', 'content' => 'foobar']
                ]
            ])
        );
    }

    public function test_it_should_match_string_mods()
    {
        $this->bh->match('button_type_link', function ($ctx) {
            $ctx->tag('a');
        });
        $this->assertEquals(
            '',
            $this->bh->apply(['block' => 'button', 'mods' => ['type' => 'link']])
        );
    }

    public function test_it_should_match_new_mods()
    {
        $this->bh->match('button_disabled', function ($ctx) {
            $ctx->tag('span');
        });
        $this->bh->match('button', function ($ctx) {
            $ctx->mod('disabled', true);
            $ctx->applyBase();
        });
        $this->assertEquals(
            '',
            $this->bh->apply([ 'block' => 'button' ]));
    }

    public function test_it_should_match_new_mods2()
    {
        $this->bh->match('button_visible', function ($ctx) {
            $ctx->tag('a');
        });
        $this->bh->match('button_disabled', function ($ctx) {
            $ctx->mod('visible', true);
            $ctx->mix([ 'block' => 'clearfix' ]);
        });
        $this->bh->match('button', function ($ctx) {
            $ctx->mod('disabled', true);
        });
        $this->assertEquals(
            '',
            $this->bh->apply([ 'block' => 'button', 'mods' => [ 'disabled' => true ] ]));
    }

    public function test_it_should_not_fail_on_non_identifier_mods()
    {
        $this->bh->match('button_is-bem_yes__control', function ($ctx) {
            $ctx->content('Hello');
        });
        $this->assertEquals(
            '

Hello

',
            $this->bh->apply(['block' => 'button', 'mods' => ['is-bem' => 'yes'], 'content' => ['elem' => 'control']])
        );
    }

    public function test_it_should_match_boolean_mods()
    {
        $this->bh->match('button_disabled', function ($ctx) {
            $ctx->attr('disabled', 'disabled');
        });
        $this->assertEquals(
            '

',
            $this->bh->apply(['block' => 'button', 'mods' => ['disabled' => true]])
        );
    }

    public function test_it_should_not_match_string_values_of_boolean_mods()
    {
        $this->bh->match('button_type', function ($ctx) {
            $ctx->tag('span');
        });
        $this->assertEquals(
            '

',
            $this->bh->apply(['block' => 'button', 'mods' => ['type' => 'link']])
        );
    }

    public function test_it_should_not_match_block_mods_when__elem__is_present()
    {
        $this->bh->match('button_disabled__control', function ($ctx) {
            $ctx->tag('span', true);
        });
        $this->bh->match('button__control_disabled', function ($ctx) {
            $ctx->tag('button', true);
        });
        $this->assertEquals(
            '<button class="button__control button__control_disabled"></button>',
            $this->bh->apply(['block' => 'button', 'elem' => 'control', 'mods' => ['disabled' => true]])
        );
    }

    public function test_it_should_properly_match_inherited_block_mods()
    {
        $this->bh->match('button_visibility_hidden__control', function ($ctx) {
            $ctx->mod('foo', 'bar');
        });
        $this->bh->match('button_visibility_visible__control', function ($ctx) {
            $ctx->mod('foo', 'baz');
        });
        $this->bh->match('button__control_visibility_hidden', function ($ctx) {
            $ctx->tag('span');
        });
        $this->bh->match('button__control_visibility_visible', function ($ctx) {
            $ctx->tag('button');
        });
        $this->assertEquals(
            '
' .
            '<button class="button__control ' .
                'button__control_visibility_visible button__control_foo_bar"></button>' .
            '
',
            $this->bh->apply([
                'block' => 'button',
                'mods' => ['visibility' => 'hidden'],
                'content' => [
                    'elem' => 'control',
                    'mods' => ['visibility' => 'visible']
                ]
            ])
        );
    }

    public function test_it_should_properly_match_elem_mods()
    {
        $this->bh->match('button', function ($ctx) {
            $ctx->content(['elem' => 'control']);
        });
        // Should not fail on elem mod match - #93
        $this->bh->match('button__control_disabled', function ($ctx) {
            $ctx->tag('button');
        });
        $this->assertEquals(
            '

',
            $this->bh->apply(['block' => 'button'])
        );
    }

    public function test_it_should_recursively_call_matchers()
    {
        $this->bh->match('X__x', function ($ctx, $json) {
            $ctx->bem(false);
            $ctx->tag('b');
        });
        $this->bh->match('X__x', function ($ctx, $json) {
            if (!key_exists('r', $json)) {
                return;
            }
            $r = $json->r;
            if ($r === true) {
                $url = $json->url;
                return array_map(function ($v) use ($url) {
                    return [ 'elem' => 'x', 'r' => 'R' . $v ];
                }, [1, 2, 3]);
            } else {
                return [
                    '(' . $r . ')',
                    $json,
                    '(/' . $r . ')'
                ];
            }
        });
        $this->assertEquals(
            '(R1)(/R1)(R2)(/R2)(R3)(/R3)',
            $this->bh->apply(['block' => 'X', 'elem' => 'x', 'r' => true]));
    }
}


text:
from __future__ import absolute_import, division, print_function

from cryptography import utils
from cryptography.exceptions import (
    AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons
)
from cryptography.hazmat.backends.interfaces import ScryptBackend
from cryptography.hazmat.primitives import constant_time
from cryptography.hazmat.primitives.kdf import KeyDerivationFunction

@utils.register_interface(KeyDerivationFunction)
class Scrypt(object):
    def __init__(self, salt, length, n, r, p, backend):
        if not isinstance(backend, ScryptBackend):
            raise UnsupportedAlgorithm(
                "Backend object does not implement ScryptBackend.",
                _Reasons.BACKEND_MISSING_INTERFACE
            )

        self._length = length
        if not isinstance(salt, bytes):
            raise TypeError("salt must be bytes.")

        if n < 2 or (n & (n - 1)) != 0:
            raise ValueError("n must be greater than 1 and be a power of 2.")

        if r < 1:
            raise ValueError("r must be greater than or equal to 1.")

        if p < 1:
            raise ValueError("p must be greater than or equal to 1.")

        self._used = False
        self._salt = salt
        self._n = n
        self._r = r
        self._p = p
        self._backend = backend

    def derive(self, key_material):
        if self._used:
            raise AlreadyFinalized("Scrypt instances can only be used once.")
        self._used = True

        if not isinstance(key_material, bytes):
            raise TypeError("key_material must be bytes.")
        return self._backend.derive_scrypt(
            key_material, self._salt, self._length, self._n, self._r, self._p
        )

    def verify(self, key_material, expected_key):
        derived_key = self.derive(key_material)
        if not constant_time.bytes_eq(derived_key, expected_key):
            raise InvalidKey("Keys do not match.")


text:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
          "https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
  Checkstyle configuration that checks the sun coding conventions from:
    - the Java Language Specification at
      https://docs.oracle.com/javase/specs/jls/se11/html/index.html
    - the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
    - the Javadoc guidelines at
      https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
    - the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
    - some best practices
  Checkstyle is very configurable. Be sure to read the documentation at
  https://checkstyle.org (or in your downloaded distribution).
  Most Checks are configurable, be sure to consult the documentation.
  To completely disable a check, just comment it out or delete it from the file.
  To suppress certain violations please review suppression filters.
  Finally, it is worth reading the documentation.
-->

<module name="Checker">
  <!--
      If you set the basedir property below, then all reported file
      names will be relative to the specified directory. See
      https://checkstyle.org/config.html#Checker
      <property name="basedir" value="${basedir}"/>
  -->
  <property name="severity" value="error"/>

  <property name="fileExtensions" value="java, sql, xtend, properties, xml"/>

  <!-- Excludes all 'module-info.java' files              -->
  <!-- See https://checkstyle.org/config_filefilters.html -->
  <module name="BeforeExecutionExclusionFileFilter">
    <property name="fileNamePattern" value="module\-info\.java$"/>
  </module>

  <!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
  <module name="SuppressionFilter">
    <property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
              default="checkstyle-suppressions.xml" />
    <property name="optional" value="true"/>
  </module>

  <!-- Checks that a package-info.java file exists for each package.     -->
  <!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
<!--  jpaw: Currently not
  <module name="JavadocPackage"/>
-->
  <!-- Checks whether files end with a new line.                        -->
  <!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
  <module name="NewlineAtEndOfFile"/>

  <!-- Checks that property files contain the same keys.         -->
  <!-- See https://checkstyle.org/config_misc.html#Translation -->
  <module name="Translation"/>

  <!-- Checks for Size Violations.                    -->
  <!-- See https://checkstyle.org/config_sizes.html -->
  <module name="FileLength"/>
  <module name="LineLength">
    <property name="fileExtensions" value="java"/>
    <property name="max" value="160"/>
  </module>

  <!-- Checks for whitespace                               -->
  <!-- See https://checkstyle.org/config_whitespace.html -->
  <module name="FileTabCharacter">
    <property name="fileExtensions" value="java, xml, xtend, xtend, bon, bddl"/>
  </module>

  <!-- Miscellaneous other checks.                   -->
  <!-- See https://checkstyle.org/config_misc.html -->
  <module name="RegexpSingleline">
    <property name="format" value="\s+$"/>
    <property name="minimum" value="0"/>
    <property name="maximum" value="0"/>
    <property name="message" value="Line has trailing spaces."/>
  </module>

  <!-- Checks for Headers                                -->
  <!-- See https://checkstyle.org/config_header.html   -->
  <!-- <module name="Header"> -->
  <!--   <property name="headerFile" value="${checkstyle.header.file}"/> -->
  <!--   <property name="fileExtensions" value="java"/> -->
  <!-- </module> -->

  <module name="TreeWalker">

    <!-- Checks for Javadoc comments.                     -->
    <!-- See https://checkstyle.org/config_javadoc.html -->
<!-- jpaw: not yet enabled, FIXME
    <module name="InvalidJavadocPosition"/>
    <module name="JavadocMethod"/>
    <module name="JavadocType"/>
    <module name="JavadocVariable"/>
    <module name="JavadocStyle"/>
    <module name="MissingJavadocMethod"/>
-->

    <!-- Checks for Naming Conventions.                  -->
    <!-- See https://checkstyle.org/config_naming.html -->
    <module name="ConstantName"/>
    <module name="LocalFinalVariableName"/>
    <module name="LocalVariableName"/>
    <module name="MemberName"/>
    <module name="MethodName">
      <property name="format" value="^(operator_)?[a-z][a-zA-Z0-9]*$"/>  <!-- support operator overloading for xtend as long as we still use it -->
    </module>
    <module name="PackageName"/>
    <module name="ParameterName"/>
    <module name="StaticVariableName"/>
    <module name="TypeName"/>

    <!-- Checks for imports                              -->
    <!-- See https://checkstyle.org/config_imports.html -->
    <module name="AvoidStarImport"/>
    <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
    <module name="RedundantImport"/>
    <module name="UnusedImports"/>  <!-- use default (consider javadoc) because Eclipse asks for imports of types referenced in Javadoc. -->

    <!-- Checks for Size Violations.                    -->
    <!-- See https://checkstyle.org/config_sizes.html -->
    <module name="MethodLength">
      <property name="max" value="200"/>
      <property name="countEmpty" value="false"/>  <!-- leaving it at true could lead to deletion of empty lines or comments! -->
    </module>
    <module name="ParameterNumber">
      <property name="max" value="15"/>
    </module>

    <!-- Checks for whitespace                               -->
    <!-- See https://checkstyle.org/config_whitespace.html -->
    <module name="EmptyForIteratorPad"/>
    <module name="GenericWhitespace"/>
<!--    <module name="MethodParamPad"/> -->
    <module name="MethodParamPad">
      <property name="tokens" value="CTOR_DEF, LITERAL_NEW, SUPER_CTOR_CALL"/>  <!-- allow before "METHOD_DEF, METHOD_CALL" for alignment -->
      <property name="option" value="nospace"/>
    </module>

    <module name="NoWhitespaceAfter"> <!-- omitting ARRAY_INIT and TYPECAST from default, adding METHOD_REF -->
      <property name="tokens" value="AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, ARRAY_DECLARATOR, INDEX_OP,  METHOD_REF"/>
      <property name="allowLineBreaks" value="false"/>
    </module>

    <module name="NoWhitespaceBefore"/>
    <module name="OperatorWrap"/>
    <module name="ParenPad"/>
    <module name="TypecastParenPad"/>

    <!-- jpaw: no whitespace after TYPECAST, because it acts like a method call (convertTo()) -->
    <module name="WhitespaceAfter">
      <property name="tokens" value="COMMA, SEMI, LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/>
    </module>
    <module name="WhitespaceAround"/>
    <!-- does not seem to work. Not critical, because global search/replace {} => { } will cure it (and could also be reverted easily later if desired).
      <property name="allowEmptyConstructors" value="true"/>
      <property name="allowEmptyMethods" value="true"/>
    </module> -->

    <!-- Modifier Checks                                    -->
    <!-- See https://checkstyle.org/config_modifier.html -->
    <module name="ModifierOrder"/>
    <module name="RedundantModifier"/>

    <!-- Checks for blocks. You know, those {}'s         -->
    <!-- See https://checkstyle.org/config_blocks.html -->
    <module name="AvoidNestedBlocks">
      <property name="allowInSwitchCase" value="true"/>
    </module>
    <module name="EmptyBlock"/>
    <module name="LeftCurly"/>

    <!-- jpaw: conditional expressions should not need braces -->
    <module name="NeedBraces">
      <property name="tokens" value="LITERAL_DO, LITERAL_FOR, LITERAL_WHILE"/>
    </module>
    <module name="RightCurly"/>

    <!-- Checks for common coding problems               -->
    <!-- See https://checkstyle.org/config_coding.html -->
    <module name="EmptyStatement"/>
    <module name="EqualsHashCode"/>

    <!-- jpaw: same name in constructors is common practice -->
    <module name="HiddenField">
      <property name="ignoreConstructorParameter" value="true"/>
      <property name="ignoreSetter" value="true"/>
    </module>
    <module name="IllegalInstantiation"/>
    <module name="InnerAssignment"/>
    <!-- TODO: decide which checks we want
    <module name="MagicNumber"/>
    -->
    <!-- deactivating: a default maskes no sense if all enum instances have been addressed!
    <module name="MissingSwitchDefault"/>
    -->
    <module name="MultipleVariableDeclarations"/>
    <module name="SimplifyBooleanExpression"/>
    <module name="SimplifyBooleanReturn"/>

    <!-- Checks for class design                         -->
    <!-- See https://checkstyle.org/config_design.html -->
    <!-- deactivated because it depends on Javadoc, which we will do later
    <module name="DesignForExtension">
      <property name="ignoredAnnotations" value="Override, Test"/>
    </module>
    -->
    <module name="FinalClass"/>
    <module name="HideUtilityClassConstructor"/>
    <module name="InterfaceIsType"/>
    <module name="VisibilityModifier">
      <property name="protectedAllowed" value="true"/> <!-- we want final protected only, but that option does not exist -->
      <property name="allowPublicFinalFields" value="true"/>
    </module>

    <!-- Miscellaneous other checks.                   -->
    <!-- See https://checkstyle.org/config_misc.html -->
    <module name="ArrayTypeStyle"/>
    <!--  FIXME: We want this!
    <module name="FinalParameters"/>
    -->
    <module name="TodoComment">
      <property name="format" value="(TODO)|(FIXME)"/>
      <property name="severity" value="warning"/>
    </module>
    <module name="UpperEll"/>

    <!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
    <module name="SuppressionXpathFilter">
      <property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
                default="checkstyle-xpath-suppressions.xml" />
      <property name="optional" value="true"/>
    </module>

  </module>

</module>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>HE_Mesh: wblut.geom.WB_PolygonTriangulatorJTS.IndexedDoubleComparator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

HE_Mesh
    6.0.1

Main Page

Packages

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

Public Member Functions |
List of all members

wblut.geom.WB_PolygonTriangulatorJTS.IndexedDoubleComparator Class Reference

   Inheritance diagram for wblut.geom.WB_PolygonTriangulatorJTS.IndexedDoubleComparator:

  <map id="wblut.geom.WB_PolygonTriangulatorJTS.IndexedDoubleComparator_map" name="wblut.geom.WB_PolygonTriangulatorJTS.IndexedDoubleComparator_map">
</map>

Public Member Functions

int 	compare (final IndexedDouble o1, final IndexedDouble o2)

Member Function Documentation

          int wblut.geom.WB_PolygonTriangulatorJTS.IndexedDoubleComparator.compare
          (
          final IndexedDouble
          o1,

          final IndexedDouble
          o2

          )

References wblut.math.WB_Epsilon.EPSILON.

The documentation for this class was generated from the following file:

src/geom/wblut/geom/WB_PolygonTriangulatorJTS.java

wblut

geom

WB_PolygonTriangulatorJTS

IndexedDoubleComparator

Generated on Tue Dec 19 2017 21:20:29 for HE_Mesh by

     1.8.10


text:
package cmd

import (
	"fmt"
	"strings"

	"github.com/3Blades/cli-tools/tbs/api"
	"github.com/3Blades/cli-tools/tbs/utils"
	"github.com/3Blades/go-sdk/client/billing"
	"github.com/3Blades/go-sdk/models"
	"github.com/spf13/cobra"
	jww "github.com/spf13/jwalterweatherman"
	"github.com/spf13/viper"
)

func init() {
	cmd := subscriptionCmd()
	cmd.AddCommand(subscriptionListCmd(),
		subscriptionCreateCmd(),
		subscriptionDescribeCmd(),
		subscriptionDeleteCmd())
	RootCmd.AddCommand(cmd)
}

func subscriptionCmd() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "subscription",
		Short: "Manage your subscriptions",
	}
	cmd.PersistentFlags().StringP("format", "f", "json", "Output format")
	viper.BindPFlag("subscription_format", cmd.PersistentFlags().Lookup("format"))
	return cmd
}

func subscriptionListCmd() *cobra.Command {
	var lf utils.ListFlags
	cmd := &cobra.Command{
		Use:   "ls",
		Short: "List Subscriptions",
		RunE: func(cmd *cobra.Command, args []string) error {
			cli := api.Client()
			params := billing.NewBillingSubscriptionsListParams()
			params.SetNamespace(cli.Namespace)
			lf.Apply(params)
			resp, err := cli.Billing.BillingSubscriptionsList(params, cli.AuthInfo)
			if err != nil {
				return err
			}
			return api.Render("subscription_format", resp.Payload)
		},
	}
	lf.Set(cmd)
	return cmd
}

func subscriptionCreateCmd() *cobra.Command {
	body := &models.SubscriptionData{
		Plan: new(string),
	}
	cmd := &cobra.Command{
		Use:   "create",
		Short: "Create new subscription",
		RunE: func(cmd *cobra.Command, args []string) error {
			cli := api.Client()
			params := billing.NewBillingSubscriptionsCreateParams()
			params.SetNamespace(cli.Namespace)
			params.SetSubscriptionData(body)
			resp, err := cli.Billing.BillingSubscriptionsCreate(params, cli.AuthInfo)

			if err != nil {
				return err
			}
			jww.FEEDBACK.Println("Subscription successfully created")
			return api.Render("subscription_format", resp.Payload)
		},
	}
	cmd.Flags().StringVar(body.Plan, "plan", "", "Plan ID")
	return cmd
}

func subscriptionDescribeCmd() *cobra.Command {
	var subscriptionID string

	cmd := &cobra.Command{
		Use:   "describe",
		Short: "Subscription Details",
		RunE: func(cmd *cobra.Command, args []string) error {
			cli := api.Client()
			params := billing.NewBillingSubscriptionsReadParams()
			params.SetNamespace(cli.Namespace)
			params.SetID(subscriptionID)

			resp, err := cli.Billing.BillingSubscriptionsRead(params, cli.AuthInfo)

			if err != nil {
				return err
			}
			return api.Render("subscription_format", resp.Payload)

		},
	}

	cmd.Flags().StringVar(&subscriptionID, "uuid", "", "Subscription ID")
	return cmd
}

func subscriptionDeleteCmd() *cobra.Command {
	var subscriptionID string
	cmd := &cobra.Command{
		Use:   "cancel",
		Short: "Cancel a subscription",
		RunE: func(cmd *cobra.Command, args []string) error {
			confirm, err := readStdin(fmt.Sprint("Are you sure you want to cancel this subscription? (Y/n): "))
			if err != nil {
				return err
			}
			confirm = strings.ToLower(confirm)
			if confirm == "n" || confirm == "no" {
				jww.FEEDBACK.Println("Aborted")
				return nil
			}

			cli := api.Client()
			params := billing.NewBillingSubscriptionsDeleteParams()
			params.SetNamespace(cli.Namespace)
			params.SetID(subscriptionID)

			_, err = cli.Billing.BillingSubscriptionsDelete(params, cli.AuthInfo)

			if err != nil {
				return err
			}

			jww.FEEDBACK.Println("Subscription canceled.")
			return nil
		},
	}

	cmd.Flags().StringVar(&subscriptionID, "uuid", "", "Subscription ID")
	return cmd
}


text:
name: Bug report
about: Create a report to help resolve an issue.
title: ''
labels: bug
assignees: ''

---

**Describe the issue**
A clear and concise description of what the bug is.

**Run Log**
Please attach your `run.log` detailing the issue.

**Other comments (optional)**


text:
namespace SubsetOfStrings
{
    using System;

    public class Startup
    {
        private const int N = 2;
        private static readonly string[] Set = { "test", "rock", "fun" };
        private static int[] arr;

        public static void Main()
        {
            ////  Write a program for generating and printing all subsets of k strings from given set of strings.
            ////  Example: s = { test, rock, fun}, k = 2 → (test rock), (test fun), (rock fun)

            arr = new int[N];

            GenerateCombinations(0, 0, 2);
        }

        private static void GenerateCombinations(int index, int start, int end)
        {
            if (index >= arr.Length)
            {
                PrintCombinations();
                return;
            }
            else
            {
                for (int i = start; i <= end; i++)
                {
                    arr[index] = i;
                    GenerateCombinations(index + 1, i + 1, end);
                }
            }
        }

        private static void PrintCombinations()
        {
            Console.Write("( ");
            for (int i = 0; i < arr.Length; i++)
            {
                Console.Write(Set[arr[i]] + " ");
            }

            Console.WriteLine(")");
        }
    }
}