text:
class ExperimentalConditionsController < ApplicationController
  include Seek::FactorStudied
  include Seek::AnnotationCommon
  include Seek::AssetsCommon

  before_filter :login_required
  before_filter :find_and_auth_sop
  before_filter :create_new_condition, :only=>[:index]
  before_filter :no_comma_for_decimal, :only=>[:create, :update]

  include Seek::BreadCrumbs

  def index
    respond_to do |format|
      format.html
      format.xml {render :xml=>@sop.experimental_conditions}
    end
  end

  def create
    @experimental_condition=ExperimentalCondition.new(experimental_condition_params)
    @experimental_condition.sop=@sop
    @experimental_condition.sop_version = params[:version]
    substances = find_or_new_substances(params[:substance_list])
    substances.each do |substance|
      @experimental_condition.experimental_condition_links.build(:substance => substance )
    end

    update_annotations(params[:annotation][:value], @experimental_condition, 'description') if try_block{!params[:annotation][:value].blank?}

    render :update do |page|
      if @experimental_condition.save
        page.insert_html :bottom,"condition_or_factor_rows",:partial=>"studied_factors/condition_or_factor_row",:object=>@experimental_condition,:locals=>{:asset => 'sop', :show_delete=>true}
        page.visual_effect :highlight,"condition_or_factor_rows"
        # clear the _add_factor form
        page.call "autocompleters['substance_autocompleter'].deleteAllTokens"
        page[:add_condition_or_factor_form].reset
        page[:substance_condition_factor].hide
        page[:growth_medium_or_buffer_description].hide
      else
        page.alert(@experimental_condition.errors.full_messages)
      end
    end
  end

  def create_from_existing
    experimental_condition_ids = []
    new_experimental_conditions = []
    #retrieve the selected FSes
    params.each do |key, value|
       if key =~ /checkbox_/
         experimental_condition_ids.push value.to_i
       end
    end
    #create the new FSes based on the selected FSes
    experimental_condition_ids.each do |id|
      experimental_condition = ExperimentalCondition.find(id)
      new_experimental_condition = ExperimentalCondition.new(:measured_item_id => experimental_condition.measured_item_id, :unit_id => experimental_condition.unit_id, :start_value => experimental_condition.start_value)
      new_experimental_condition.sop=@sop
      new_experimental_condition.sop_version = params[:version]
      experimental_condition.experimental_condition_links.each do |ecl|
         new_experimental_condition.experimental_condition_links.build(:substance => ecl.substance)
      end
      params[:annotation] = {}
      params[:annotation][:value] = try_block{Annotation.for_annotatable(experimental_condition.class.name, experimental_condition.id).with_attribute_name('description').first.value.text}
      update_annotations(params[:annotation][:value], new_experimental_condition, 'description') if try_block{!params[:annotation][:value].blank?}

      new_experimental_conditions.push new_experimental_condition
    end
    #
    render :update do |page|
        new_experimental_conditions.each do  |ec|
          if ec.save
            page.insert_html :bottom,"condition_or_factor_rows",:partial=>"studied_factors/condition_or_factor_row",:object=>ec,:locals=>{:asset => 'sop', :show_delete=>true}
          else
            page.alert("can not create factor studied: item: #{try_block{ec.substance.name}} #{ec.measured_item.title}, value: #{ec.start_value}}#{ec.unit.title}")
          end
        end
        page.visual_effect :highlight,"condition_or_factor_rows"
    end
  end

  def destroy
    @experimental_condition=ExperimentalCondition.find(params[:id])
    render :update do |page|
      if @experimental_condition.destroy
        page.visual_effect :fade, "condition_or_factor_row_#{@experimental_condition.id}"
        page.visual_effect :fade, "edit_condition_or_factor_#{@experimental_condition.id}_form"
      else
        page.alert(@experimental_condition.errors.full_messages)
      end
    end
  end

  def update
      @experimental_condition = ExperimentalCondition.find(params[:id])

      new_substances = params["#{@experimental_condition.id}_substance_autocompleter_unrecognized_items"] || []
      known_substance_ids_and_types = params["#{@experimental_condition.id}_substance_autocompleter_selected_ids"] || []
      substances = find_or_new_substances(params[:substance_list])

      #delete the old experimental_condition_links
      @experimental_condition.experimental_condition_links.each do |ecl|
        ecl.destroy
      end

      #create the new experimental_condition_links
      experimental_condition_links = []
      substances.each do |substance|
        experimental_condition_links.push ExperimentalConditionLink.new(:substance => substance)
      end
      @experimental_condition.experimental_condition_links = experimental_condition_links

      update_annotations(params[:annotation][:value], @experimental_condition, 'description') if try_block{!params[:annotation][:value].blank?}

      if @experimental_condition.update_attributes(experimental_condition_params)
        render :update do |page|
          page.visual_effect :fade,"edit_condition_or_factor_#{@experimental_condition.id}_form"
          page.call "autocompleters['#{@experimental_condition.id}_substance_autocompleter'].deleteAllTokens"
          page.replace "condition_or_factor_row_#{@experimental_condition.id}", :partial => 'studied_factors/condition_or_factor_row', :object => @experimental_condition, :locals=>{:asset => 'sop', :show_delete=>true}
        end
      else
        render :update do |page|
          page.alert(@experimental_condition.errors.full_messages)
        end
      end
  end

  private

  def experimental_condition_params
    params.require(:experimental_condition).permit(:measured_item_id, :unit_id, :start_value)
  end

  def find_and_auth_sop
    begin
      sop = Sop.find(params[:sop_id])
      if sop.can_edit? current_user
        @sop = sop
        find_display_asset @sop
      else
        respond_to do |format|
          flash[:error] = "You are not authorized to perform this action"
          format.html { redirect_to sops_path }
        end
        return false
      end
    rescue ActiveRecord::RecordNotFound
      respond_to do |format|
        flash[:error] = "Couldn't find the #{t('sop')} or you are not authorized to view it"
        format.html { redirect_to sops_path }
      end
      return false
    end

  end

  def create_new_condition
    @experimental_condition=ExperimentalCondition.new(:sop=>@sop)
  end
end


text:
/**
 * Created by mysim1 on 26/03/15.
 */
import Surface                      from 'famous/core/Surface';
import View                         from 'famous/core/View';
import {ObjectHelper}               from 'arva-utils/ObjectHelper';
import LayoutController             from 'famous-flex/src/LayoutController';
import DataBoundScrollView          from 'arva/components/DataBoundScrollView';
import Background                   from '../../components/Background';
import AutoFontsizeSurface          from 'famous-autofontsizesurface/AutoFontSizeSurface';
import _                            from 'lodash';

const DEFAULT_OPTIONS = {
    headerHeight: 75
};

export default class InvitePlayerView extends View {

    constructor(options = {}) {
        let newOptions = _.extend(options, DEFAULT_OPTIONS);
        super(newOptions);

        /* Bind all local methods to the current object instance, so we can refer to 'this'
         * in the methods as expected, even when they're called from event handlers.        */
        ObjectHelper.bindAllMethods(this, this);

        /* Hide all private properties (starting with '_') and methods from enumeration,
         * so when you do for( in ), only actual data properties show up. */
        ObjectHelper.hideMethodsAndPrivatePropertiesFromObject(this);

        /* Hide the priority field from enumeration, so we don't save it to the dataSource. */
        ObjectHelper.hidePropertyFromObject(Object.getPrototypeOf(this), 'length');

        this._createRenderables();
        this._createLayout();
        this._createListeners();

    }

    _createRenderables() {
        let contextView = this;

        var invitePlayers = new DataBoundScrollView({

            flowOptions: {
                spring: {               // spring-options used when transitioning between states
                    dampingRatio: 0.8,  // spring damping ratio
                    period: 1000        // duration of the animation
                },
                insertSpec: {           // render-spec used when inserting renderables
                    opacity: 0          // start opacity is 0, causing a fade-in effect,
                    //size: [0, 0],     // uncommented to create a grow-effect
                    //transform: Transform.translate(-300, 0, 0) // uncomment for slide-in effect
                }
                //removeSpec: {...},    // render-spec used when removing renderables
            },

            layoutOptions: {
                margins: [5, 5, 5, 5],
                spacing: 5
            },

            sortingDirection: 'descending',

            dataFilter: (player) => {
                return player.id != contextView.options.activePlayer;
            },

            itemTemplate: function(player) {

                let isOnline = (Date.now() - player.lastTimeAccessed)<10000?'online':'offline';

                let surface = new Surface({
                    size: [undefined, 50],
                    classes: ['arena-item'],
                    properties: {
                        backgroundColor: '#efefef',
                        lineHeight: '50px',
                        paddingLeft: '10px',
                        paddingRight: '10px',
                        data: player
                    },
                    content: `

${player.name}

${player.score}
`
                });

                surface.on('click', function() {
                    contextView._eventOutput.emit('invite', this.properties.data);
                });

                return surface;
            },

            dataStore: this.options.dataSource

        });

        this._renderables = {
            background: new Background(),
            header: new Surface({
                content: '
Spelers
Daag iemand uit voor een potje Boter Kaas en Eieren',
                classes: ['header']
            }),
            close: new AutoFontsizeSurface({
                classes:['icon', 'icon-circle-arrow-left'],
                fontSizeRange: [16, 52],
                properties: {
                    color: '#FF8000'
                }
            }),
            players: invitePlayers
        };
    }

    _createLayout() {
        let top = this.options.headerHeight;

        this.layout = new LayoutController({
            autoPipeEvents: true,
            layout: function(context) {

                context.set('background', {
                    size: context.size,
                    translate: [0,0,0]
                });

                context.set('header', {
                    size: [context.size[0], top],
                    translate: [0,0,20]
                });

                context.set('close', {
                    size: [56, 56],
                    translate: [0,0,3],
                    align: [0.90,0.85],
                    origin: [0.5,0.5]
                });

                context.set('players', {
                    size: [context.size[0], context.size[1]/1.3],
                    translate: [0, top, 2]
                });

            }.bind(this),
            dataSource: this._renderables
        });
        this.add(this.layout);
        this.layout.pipe(this._eventOutput);
    }

    _createListeners() {
        this._renderables.close.on('click', () => {
            this._eventOutput.emit('close');
        });
    }
}

redpajama_set_name: RedPajamaGithub


text:
package config

const (
	// RulesGoRepoName is the canonical name of the rules_go repository. It must
	// match the workspace name in WORKSPACE.
	RulesGoRepoName = "io_bazel_rules_go"
	// DefaultLibName is the name of the default go_library rule in a Go
	// package directory. It must be consistent to DEFAULT_LIB in go/private/common.bf.
	DefaultLibName = "go_default_library"
	// DefaultTestName is a name of an internal test corresponding to
	// DefaultLibName. It does not need to be consistent to something but it
	// just needs to be unique in the Bazel package
	DefaultTestName = "go_default_test"
	// DefaultXTestName is a name of an external test corresponding to
	// DefaultLibName.
	DefaultXTestName = "go_default_xtest"
	// DefaultProtosName is the name of a filegroup created
	// whenever the library contains .pb.go files
	DefaultProtosName = "go_default_library_protos"
	// DefaultCgoLibName is the name of the default cgo_library rule in a Go package directory.
	DefaultCgoLibName = "cgo_default_library"

	// GrpcCompilerLabel is the label for the gRPC compiler plugin, used in the
	// "compilers" attribute of go_proto_library rules.
	GrpcCompilerLabel = "@io_bazel_rules_go//proto:go_grpc"

	// WellKnownTypesProtoRepo is the repository containing proto_library rules
	// for the Well Known Types.
	WellKnownTypesProtoRepo = "com_google_protobuf"
	// WellKnownTypeProtoPrefix is the proto import path prefix for the
	// Well Known Types.
	WellKnownTypesProtoPrefix = "google/protobuf"
	// WellKnownTypesGoPrefix is the import path for the Go repository containing
	// pre-generated code for the Well Known Types.
	WellKnownTypesGoPrefix = "github.com/golang/protobuf"
	// WellKnownTypesPkg is the package name for the predefined WKTs in rules_go.
	WellKnownTypesPkg = "proto/wkt"

	// GazelleImportsKey is an internal attribute that lists imported packages
	// on generated rules. It is replaced with "deps" during import resolution.
	GazelleImportsKey = "_gazelle_imports"
)

// Language is the name of a programming langauge that Gazelle knows about.
// This is used to specify import paths.
type Language int

const (
	// GoLang marks Go targets.
	GoLang Language = iota

	// ProtoLang marks protocol buffer targets.
	ProtoLang
)

func (l Language) String() string {
	switch l {
	case GoLang:
		return "go"
	case ProtoLang:
		return "proto"
	default:
		return "unknown"
	}
}


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width">
    <title>Babylon.js - Chibi Rex demo</title>

    <link href="../../css/index.css" rel="stylesheet" />

    <canvas id="renderCanvas" touch-action="none"></canvas>

Chibi Rex by Patrick Ryan

Sorry but your browser does not support WebGL...


text:
title: Off-canvas
description: Off-canvas panels are positioned outside of the viewport and slide in when activated. Setting up an off-canvas layout in Foundation is super easy.
sass:
  - scss/components/_off-canvas.scss
  - scss/components/_title-bar.scss
js: js/foundation.offcanvas.js
tags:
  - navigation
  - offcanvas
  - off-canvas
  - nav
  - title bar
flex: true
---

Good news! We've updated Off-canvas to offer more and better functionality. Another bonus is the markup is simplified. This new version applies to version 6.3+. We work hard to avoid breaking changes, so any markup updates are listed in the migration section of this page.

<button class="button" type="button" data-toggle="offCanvasLeft">Toggle Off-canvas</button>

Foundation's Off-canvas is a well established mobile pattern for navigation that can also be used to create a responsive sidebar. It can open from any direction, left, tight, top, and bottom. There are options to allow the Off-canvas to push your page over or to overlap your page plus a few other neat tricks.

## Setup

Setting up the Off-canvas only requires two elements! To setup the Off-canvas create an off-canvas container with the class `.off-canvas` and the attribute `data-off-canvas`. This is the container that holds your Off-canvas content.

The Off-canvas container also needs a positioning class to determine which side of the viewport it opens from:

- `.position-left`
- `.position-right`
- `.position-top`
- `.position-bottom`

Also be sure the off-canvas panel has a unique ID so it can be targeted by the click trigger.

Example:

```html
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
  <!-- Your menu or Off-canvas content goes here -->
</div>
```

Along with the Off-canvas container, the main content of your page will be housed in its own container with the class `.off-canvas-content` and attribute `data-off-canvas-content`. This is where your page content lives.

```html
<div class="off-canvas-content" data-off-canvas-content>
  <!-- Your page content lives here -->
</div>
```

So putting it all together:

```html
<body>
  <div class="off-canvas position-left" id="offCanvas" data-off-canvas>
    <!-- Your menu or Off-canvas content goes here -->
  </div>
  <div class="off-canvas-content" data-off-canvas-content>
    <!-- Your page content lives here -->
  </div>
</body>
```

### Wrapper

You can add an optionalwrapper around off-canvas and the content. This hides the vertical (on top/bottom off-canvas) or horizontal (on left/right off-canvas) scrollbars the body will have.
Simply add a container with the class `.off-canvas-wrapper`.

```html
<body>
  <div class="off-canvas-wrapper">
    <div class="off-canvas position-left" id="offCanvas" data-off-canvas>
      <!-- Your menu or Off-canvas content goes here -->
    </div>
    <div class="off-canvas-content" data-off-canvas-content>
      <!-- Your page content lives here -->
    </div>
  </div>
</body>
```

### Click Triggers

To create a click trigger that opens the panel, add the attribute `data-open` or `data-toggle` to any element. That element will then open or toggle the panel when clicked on. The value of the data attribute should be the ID of the off-canvas.

```html_example
<button type="button" class="button" data-toggle="offCanvasLeft">Open Menu</button>
```

### Close Button

Foundation's Close component can be used inside the off-canvas to close it.

```html
<button class="close-button" aria-label="Close menu" type="button" data-close>
  <span aria-hidden="true">×</span>
</button>
```

### Complete Example

Here's a complete example that can be pasted into the `<body>` tag of your page. It includes a close button and basic menu styles.

```html
<body>
  <div class="off-canvas position-left" id="offCanvas" data-off-canvas>

    <!-- Close button -->
    <button class="close-button" aria-label="Close menu" type="button" data-close>
      <span aria-hidden="true">×</span>
    </button>

    <!-- Menu -->
    <ul class="vertical menu">
      <li><a href="#">Foundation</a></li>
      <li><a href="#">Dot</a></li>
      <li><a href="#">ZURB</a></li>
      <li><a href="#">Com</a></li>
      <li><a href="#">Slash</a></li>
      <li><a href="#">Sites</a></li>
    </ul>

  </div>

  <div class="off-canvas-content" data-off-canvas-content>
    <!-- Your page content lives here -->
  </div>
</body>
```
---

## Off-canvas Position

Foundation's Off-canvas is set to `position: fixed` by default using the `.off-canvas` class. This makes the off-canvas panel sit in relation to the viewport, and is the desired behavior for most users. However you can also set an off-canvas container to `position: absolute` by using the alternative class `.off-canvas-absolute`. Also be sure to use the `.off-canvas-wrapper` when using this method.

```html_example
<button type="button" class="button" data-toggle="offCanvasLeftSPlit1">Open Left</button>
<button type="button" class="button" data-toggle="offCanvasLeftSplit2">Open Left</button>

<div class="row">
  <div class="small-6 columns">
    <div class="off-canvas-wrapper">
      <div class="off-canvas-absolute position-left" id="offCanvasLeftSPlit1" data-off-canvas>
        <!-- Your menu or Off-canvas content goes here -->
      </div>
      <div class="off-canvas-content" style="min-height: 300px;" data-off-canvas-content>
        <p>I have nothing to do with the off-canvas on the right!</p>
      </div>
    </div>
  </div>
  <div class="small-6 columns">
    <div class="off-canvas-wrapper">
      <div class="off-canvas-absolute position-left" id="offCanvasLeftSplit2" data-off-canvas>
        <!-- Your menu or Off-canvas content goes here -->
      </div>
      <div class="off-canvas-content" style="min-height: 300px;" data-off-canvas-content>
        <p>Im a unique off-canvas container all on my own!</p>
      </div>
    </div>
  </div>
</div>
```

---

## Off-canvas Directions

Foundation's Off-canvas can open from any direction, left, right, top, and bottom.

The Off-canvas container requires a positioning class to determine which side of the viewport it opens from:

- `.position-left`
- `.position-right`
- `.position-top`
- `.position-bottom`

```html_example
<button type="button" class="button" data-toggle="offCanvasLeft1">Open Left</button>
<button type="button" class="button" data-toggle="offCanvasRight1">Open Right</button>
<button type="button" class="button" data-toggle="offCanvasTop1">Open Top</button>
<button type="button" class="button" data-toggle="offCanvasBottom1">Open Bottom</button>

<div class="row column">
  <div class="off-canvas-wrapper">
    <div class="off-canvas position-left" id="offCanvasLeft1" data-off-canvas>
      <!-- Your menu or Off-canvas content goes here -->
    </div>
    <div class="off-canvas position-right" id="offCanvasRight1" data-off-canvas>
      <!-- Your menu or Off-canvas content goes here -->
    </div>
    <div class="off-canvas position-top" id="offCanvasTop1" data-off-canvas>
      <!-- Your menu or Off-canvas content goes here -->
    </div>
    <div class="off-canvas position-bottom" id="offCanvasBottom1" data-off-canvas>
      <!-- Your menu or Off-canvas content goes here -->
    </div>
    <div class="off-canvas-content" data-off-canvas-content>
      <img src="http://placehold.it/300x300" class="" height="" width="" alt="">
    </div>
  </div>
</div>
```

---

## Multiple Panels

A design can have multiple panels. Be sure that all panels come *before* the `.off-canvas-content` wrapper—this is required for the CSS to apply correctly.

When using Foundation in right-to-left mode, "right" still means right, and "left" still means left.

```html
<body>
  <div class="off-canvas position-left" id="offCanvasLeft" data-off-canvas></div>
  <div class="off-canvas position-right" id="offCanvasRight" data-off-canvas></div>
  <div class="off-canvas-content" data-off-canvas-content></div>
</body>
```

<button class="button" type="button" data-toggle="offCanvasLeft">Open Left Menu</button>
<button class="button" type="button" data-toggle="offCanvasRight">Open Right Menu</button>

---

## Off-canvas Transitions

You can switch the default transition of the off-canvas from pushing the page over as it open to overlapping the page by adding the `data-transition="overlap"` to the `.off-canvas`.
There are 2 available transitions: push (`data-transition="push"`) which is the default, and overlap (`data-transition="overlap"`).

```html
<div class="off-canvas position-left" id="offCanvasLeft1" data-off-canvas>
  <!-- Your menu or Off-canvas content goes here -->
</div>
```

<button type="button" class="button" data-toggle="offCanvasOverlap">Open Left with Overlap</button>
<button class="button" type="button" data-toggle="offCanvasRight">Open Right with Push</button>

Foundation

Dot

ZURB

Com

Slash

Sites

---

## Reveal on Larger Screens

The left- and right-hand off-canvas panes can be set to be persistent on larger screens like a sidebar. Add the class `.reveal-for-medium` or `.reveal-for-large` to the off-canvas menu. These classes determine what breakpoint the off-canvas will default open.

The main content area (`.off-canvas-content`) will be padded to the left or right equal to the width of the container.

The menu will be fixed-position by default, meaning it follows you as you scroll up and down. The menu also gets its own scroll bar if it's taller than the window. To disable these features, set the $offcanvas-fixed-reveal variable to false.

The slide in/out of the plugin still works when these classes are active. If you use this feature on a larger screen, be sure to hide any click triggers on those larger breakpoints as well. Foundation's visibility classes can help you with that.

```html
<div class="off-canvas position-left reveal-for-large" data-off-canvas>
  <!-- ... -->
</div>
```

<button type="button" class="button" data-docs-example-ofc>Toggle Reveal Class</button>

---

## Combining with Title Bar

If you need a simple bar to contain your hamburger icon/s and toggle the off-canvas, `.title-bar` is here to help. It supports left- and right-aligned sections. You can add your off-canvas toggle triggers here:

```html_example
<div class="title-bar">
  <div class="title-bar-left">
    <button class="menu-icon" type="button" data-open="offCanvasLeft"></button>
    <span class="title-bar-title">Foundation</span>
  </div>
  <div class="title-bar-right">
    <button class="menu-icon" type="button" data-open="offCanvasRight"></button>
  </div>
</div>
```

When using the `title-bar` with a vertical off-canvas, the title-bar icons are still either `title-bar-left` or `title-bar-right`.

```html_example
<div class="title-bar">
  <div class="title-bar-left">
    <button class="menu-icon" type="button" data-open="offCanvasTop"></button>
    <span class="title-bar-title">Foundation title bar with top off-canvas</span>
  </div>
  <div class="title-bar-right">
    <button class="menu-icon" type="button" data-open="offCanvasTop"></button>
  </div>
</div>
```

---

#### Responsive Off-Canvas (Putting it all together)

For an example of off-canvas on small screens and Top Bar Menu with Dropdowns, check out this Building Block: http://zurb.com/building-blocks/top-bar-with-off-canvas

---

## Migrating from versions prior to v6.3

`off-canvas-wrapper` and `off-canvas-wrapper-inner` are no longer needed on the new off-canvas. If you leave them in with 6.3+ off-canvas will work as expected.

The default off-canvas position has changed from absolute to fixed. This will likely be the position you want since the menu is in view when opened regardless of the scroll position. You can choose the off-canvas position back to absolute using the built in classes:

- `.is-overlay-absolute`
- `.is-overlay-fixed`

Or in globally in the _settings.scss, set the $offcanvas-fixed-reveal variable to false.

```html
<div class="off-canvas position-left reveal-for-large" data-off-canvas>
  <!-- ... -->
</div>
```

### Pre 6.3 Off-canvas Setup

To start, create two wrappers to house the page. These are necessary to prevent the off-canvas panels from being visible when they're not open. They also smooth out cross-browser bugs.
- The outer wrapper has the class `.off-canvas-wrapper`.
- The inner wrapper has the class `.off-canvas-wrapper-inner` and the attribute `data-off-canvas-wrapper`.

```html
<body>
  <div class="off-canvas-wrapper">
    <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper></div>
  </div>
</body>
```

Inside these wrappers, create an off-canvas panel with the class `.off-canvas` and the attribute `data-off-canvas`. The panel also needs a positioning class, which can be `.position-left` or `.position-right`, and an attribute set for the position, `data-position="left"` or `data-position="right"`. Last, make sure the off-canvas panel has a unique ID so it can be targeted.

Along with the panel, the main content of your page will be housed in its own container with the class `.off-canvas-content` and attribute `data-off-canvas-content`. You will be putting your actual page content inside a class of `.off-canvas-content`.)

```html
<body>
  <div class="off-canvas-wrapper">
    <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
      <div class="off-canvas position-left" id="offCanvas" data-off-canvas></div>
      <div class="off-canvas-content" data-off-canvas-content></div>
    </div>
  </div>
</body>
```


text:
<?xml version="1.0"?>

<rss version="2.0">
	<channel>
		<title>SourceForge.net: SF.net Project News: TinyXPath : a tiny C++ XPath processor (including full news text)</title>
		<link>http://sourceforge.net/projects/tinyxpath/</link>
		<description>SF.net Project News: TinyXPath : a tiny C++ XPath processor (tinyxpath project) - Small footprint C++ library to extract an XPath expression from an XML tree. Uses the TinyXML project to parse XML trees and store intermediate results. Runs on any platform. Optional use of STL. Overhead less than 100KB, including TinyXML.</description>
		<copyright>Copyright and acceptable usage information for this RSS may feed may be found at: http://sourceforge.net/docman/display_doc.php?docid=6048&group_id=1#licensing_and_other_terms</copyright>
		<lastBuildDate>Sat, 13 Mar 2004 13:34:51 GMT</lastBuildDate>
		<generator>SourceForge.net RSS generator</generator>
		<image>
			<title>SourceForge.net logo</title>
			<url>http://images.sourceforge.net/images/sflogo-88-1.png</url>
			<link>http://sourceforge.net/</link>
			<width>88</width>
			<height>31</height>
			<description>The world's largest Open Source software development website</description>
		</image>
		<item>
			<title>TinyXPath 1.2.1 is released</title>
			<description>TinyXPath has release the 1.2.1 version.
It's a maintenance release, with one bug fix.
The API has been improved with some easier-to-use static functions. (0 comments)</description>
			<author>yvesb@users.sourceforge.net (Yves Berquin)</author>
			<link>http://sourceforge.net/forum/forum.php?forum_id=345812</link>
			<guid isPermaLink="true">http://sourceforge.net/forum/forum.php?forum_id=345812</guid>
			<pubDate>Sun, 18 Jan 2004 13:33:55 GMT</pubDate>
			<comments>http://sourceforge.net/forum/forum.php?forum_id=345812</comments>
		</item>
		<item>
			<title>TinyXPath 1.2 is released</title>
			<description>Maintenance release with some bug fixing (0 comments)</description>
			<author>yvesb@users.sourceforge.net (Yves Berquin)</author>
			<link>http://sourceforge.net/forum/forum.php?forum_id=343535</link>
			<guid isPermaLink="true">http://sourceforge.net/forum/forum.php?forum_id=343535</guid>
			<pubDate>Fri, 09 Jan 2004 21:24:09 GMT</pubDate>
			<comments>http://sourceforge.net/forum/forum.php?forum_id=343535</comments>
		</item>
		<item>
			<title>Version 1.1 is out</title>
			<description>This is a fully working version of TinyXPath. All regression tests are working. (0 comments)</description>
			<author>yvesb@users.sourceforge.net (Yves Berquin)</author>
			<link>http://sourceforge.net/forum/forum.php?forum_id=342689</link>
			<guid isPermaLink="true">http://sourceforge.net/forum/forum.php?forum_id=342689</guid>
			<pubDate>Wed, 07 Jan 2004 08:52:10 GMT</pubDate>
			<comments>http://sourceforge.net/forum/forum.php?forum_id=342689</comments>
		</item>
		<item>
			<title>Release 0.3 is out</title>
			<description>(Windows only - Linux to follow)
A big chunck of XPath is working now.
Still need some functions, but we are close (0 comments)</description>
			<author>yvesb@users.sourceforge.net (Yves Berquin)</author>
			<link>http://sourceforge.net/forum/forum.php?forum_id=185341</link>
			<guid isPermaLink="true">http://sourceforge.net/forum/forum.php?forum_id=185341</guid>
			<pubDate>Tue, 11 Jun 2002 19:31:51 GMT</pubDate>
			<comments>http://sourceforge.net/forum/forum.php?forum_id=185341</comments>
		</item>
		<item>
			<title>Release 0.2 is out</title>
			<description>A lot more syntax is now applied to the XML tree. See http://tinyxpath.sourceforge.net for a list of expressions correctly handled and http://tinyxpath.sourceforge.net/res.html for the current output. (0 comments)</description>
			<author>yvesb@users.sourceforge.net (Yves Berquin)</author>
			<link>http://sourceforge.net/forum/forum.php?forum_id=181445</link>
			<guid isPermaLink="true">http://sourceforge.net/forum/forum.php?forum_id=181445</guid>
			<pubDate>Mon, 27 May 2002 20:14:31 GMT</pubDate>
			<comments>http://sourceforge.net/forum/forum.php?forum_id=181445</comments>
		</item>
		<item>
			<title>First release 0.1 is out</title>
			<description>Basic functionnality. Syntax is completed parsed. Some expressions correctly solved already (0 comments)</description>
			<author>yvesb@users.sourceforge.net (Yves Berquin)</author>
			<link>http://sourceforge.net/forum/forum.php?forum_id=179942</link>
			<guid isPermaLink="true">http://sourceforge.net/forum/forum.php?forum_id=179942</guid>
			<pubDate>Tue, 21 May 2002 21:23:53 GMT</pubDate>
			<comments>http://sourceforge.net/forum/forum.php?forum_id=179942</comments>
		</item>
		<item>
			<title>Syntax decoding is done</title>
			<description>The step1 (syntax decoding) seems to be flying.
Now attacking the application to an XML tree, using the TinyXML module (0 comments)</description>
			<author>yvesb@users.sourceforge.net (Yves Berquin)</author>
			<link>http://sourceforge.net/forum/forum.php?forum_id=178180</link>
			<guid isPermaLink="true">http://sourceforge.net/forum/forum.php?forum_id=178180</guid>
			<pubDate>Tue, 14 May 2002 20:09:56 GMT</pubDate>
			<comments>http://sourceforge.net/forum/forum.php?forum_id=178180</comments>
		</item>
	</channel>
</rss>


text:
package server

import (
	"errors"
	"fmt"
	"math"
	"strconv"
	"strings"

	"github.com/tidwall/tile38/internal/field"
	lua "github.com/yuin/gopher-lua"
)

const defaultSearchOutput = outputObjects

var errInvalidNumberOfArguments = errors.New("invalid number of arguments")
var errKeyNotFound = errors.New("key not found")
var errIDNotFound = errors.New("id not found")
var errIDAlreadyExists = errors.New("id already exists")
var errPathNotFound = errors.New("path not found")
var errKeyHasHooksSet = errors.New("key has hooks set")
var errNotRectangle = errors.New("not a rectangle")

func errInvalidArgument(arg string) error {
	return fmt.Errorf("invalid argument '%s'", arg)
}
func errDuplicateArgument(arg string) error {
	return fmt.Errorf("duplicate argument '%s'", arg)
}
func token(line string) (newLine, token string) {
	for i := 0; i < len(line); i++ {
		if line[i] == ' ' {
			return line[i+1:], line[:i]
		}
	}
	return "", line
}

func tokenval(vs []string) (nvs []string, token string, ok bool) {
	if len(vs) > 0 {
		token = vs[0]
		nvs = vs[1:]
		ok = true
	}
	return
}

func lc(s1, s2 string) bool {
	if len(s1) != len(s2) {
		return false
	}
	for i := 0; i < len(s1); i++ {
		ch := s1[i]
		if ch >= 'A' && ch <= 'Z' {
			if ch+32 != s2[i] {
				return false
			}
		} else if ch != s2[i] {
			return false
		}
	}
	return true
}

type whereT struct {
	expr bool
	name string
	minx bool
	min  field.Value
	maxx bool
	max  field.Value
}

func mLT(a, b field.Value) bool  { return a.Less(b) }
func mLTE(a, b field.Value) bool { return !mLT(b, a) }
func mGT(a, b field.Value) bool  { return mLT(b, a) }
func mGTE(a, b field.Value) bool { return !mLT(a, b) }
func mEQ(a, b field.Value) bool  { return a.Equals(b) }

func (where whereT) matchField(value field.Value) bool {
	switch where.min.Data() {
	case "<":
		return mLT(value, where.max)
	case "<=":
		return mLTE(value, where.max)
	case ">":
		return mGT(value, where.max)
	case ">=":
		return mGTE(value, where.max)
	case "==":
		return mEQ(value, where.max)
	case "!=":
		return !mEQ(value, where.max)
	}
	if !where.minx {
		if mLT(value, where.min) { // if value < where.min {
			return false
		}
	} else {
		if mLTE(value, where.min) { // if value <= where.min {
			return false
		}
	}
	if !where.maxx {
		if mGT(value, where.max) { // if value > where.max {
			return false
		}
	} else {
		if mGTE(value, where.max) { // if value >= where.max {
			return false
		}
	}
	return true
}

type whereinT struct {
	name   string
	valArr []field.Value
}

func (wherein whereinT) match(value field.Value) bool {
	for _, val := range wherein.valArr {
		if mEQ(val, value) {
			return true
		}
	}
	return false
}

type whereevalT struct {
	c        *Server
	luaState *lua.LState
	fn       *lua.LFunction
}

func (whereeval whereevalT) Close() {
	luaSetRawGlobals(
		whereeval.luaState, map[string]lua.LValue{
			"ARGV": lua.LNil,
		})
	whereeval.c.luapool.Put(whereeval.luaState)
}

func luaSetField(tbl *lua.LTable, name string, val field.Value) {
	var lval lua.LValue
	switch val.Kind() {
	case field.Null:
		lval = lua.LNil
	case field.False:
		lval = lua.LFalse
	case field.True:
		lval = lua.LTrue
	case field.Number:
		lval = lua.LNumber(val.Num())
	default:
		lval = lua.LString(val.Data())
	}
	tbl.RawSetString(name, lval)
}

func (whereeval whereevalT) match(fieldsWithNames map[string]field.Value) (bool, error) {
	fieldsTbl := whereeval.luaState.CreateTable(0, len(fieldsWithNames))
	for name, val := range fieldsWithNames {
		luaSetField(fieldsTbl, name, val)
	}
	luaSetRawGlobals(
		whereeval.luaState, map[string]lua.LValue{
			"FIELDS": fieldsTbl,
		})
	defer luaSetRawGlobals(
		whereeval.luaState, map[string]lua.LValue{
			"FIELDS": lua.LNil,
		})

	whereeval.luaState.Push(whereeval.fn)
	if err := whereeval.luaState.PCall(0, 1, nil); err != nil {
		return false, err
	}
	ret := whereeval.luaState.Get(-1)
	whereeval.luaState.Pop(1)

	// Make bool out of returned lua value
	switch ret.Type() {
	case lua.LTNil:
		return false, nil
	case lua.LTBool:
		return ret == lua.LTrue, nil
	case lua.LTNumber:
		return float64(ret.(lua.LNumber)) != 0, nil
	case lua.LTString:
		return ret.String() != "", nil
	case lua.LTTable:
		tbl := ret.(*lua.LTable)
		if tbl.Len() != 0 {
			return true, nil
		}
		var match bool
		tbl.ForEach(func(lk lua.LValue, lv lua.LValue) { match = true })
		return match, nil
	}
	return false, fmt.Errorf("script returned value of type %s", ret.Type())
}

type searchScanBaseTokens struct {
	key        string
	cursor     uint64
	output     outputT
	precision  uint64
	fence      bool
	distance   bool
	nodwell    bool
	detect     map[string]bool
	accept     map[string]bool
	globs      []string
	wheres     []whereT
	whereins   []whereinT
	whereevals []whereevalT
	nofields   bool
	ulimit     bool
	limit      uint64
	usparse    bool
	sparse     uint8
	desc       bool
	clip       bool
	buffer     float64
	hasbuffer  bool
}

func (s *Server) parseSearchScanBaseTokens(
	cmd string, t searchScanBaseTokens, vs []string,
) (
	vsout []string, tout searchScanBaseTokens, err error,
) {
	var ok bool
	if vs, t.key, ok = tokenval(vs); !ok || t.key == "" {
		err = errInvalidNumberOfArguments
		return
	}

	fromFence := t.fence

	var slimit string
	var ssparse string
	var scursor string
	var asc bool
	for {
		nvs, wtok, ok := tokenval(vs)
		if ok && len(wtok) > 0 {
			switch strings.ToLower(wtok) {
			case "buffer":
				vs = nvs
				var sbuf string
				if vs, sbuf, ok = tokenval(vs); !ok || sbuf == "" {
					err = errInvalidNumberOfArguments
					return
				}
				var buf float64
				buf, err = strconv.ParseFloat(sbuf, 64)
				if err != nil || buf < 0 || math.IsInf(buf, 0) || math.IsNaN(buf) {
					err = errInvalidArgument(sbuf)
					return
				}
				t.buffer = buf
				t.hasbuffer = true
				continue
			case "cursor":
				vs = nvs
				if scursor != "" {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				if vs, scursor, ok = tokenval(vs); !ok || scursor == "" {
					err = errInvalidNumberOfArguments
					return
				}
				continue
			case "where":
				vs = nvs
				if detectExprToken(vs) {
					// using expressions
					// WHERE expr
					var expr string
					if vs, expr, ok = tokenval(vs); !ok {
						err = errInvalidNumberOfArguments
						return
					}
					t.wheres = append(t.wheres, whereT{name: expr, expr: true})
					continue
				} else {
					// using field filter
					// WHERE min max
					var name, smin, smax string
					if vs, name, ok = tokenval(vs); !ok {
						err = errInvalidNumberOfArguments
						return
					}
					if vs, smin, ok = tokenval(vs); !ok {
						err = errInvalidNumberOfArguments
						return
					}
					if vs, smax, ok = tokenval(vs); !ok {
						err = errInvalidNumberOfArguments
						return
					}
					var minx, maxx bool
					smin = strings.ToLower(smin)
					smax = strings.ToLower(smax)
					if smax == "+inf" || smax == "inf" {
						smax = "inf"
					}
					switch smin {
					case "<", "<=", ">", ">=", "==", "!=":
					default:
						if strings.HasPrefix(smin, "(") {
							minx = true
							smin = smin[1:]
						}
						if strings.HasPrefix(smax, "(") {
							maxx = true
							smax = smax[1:]
						}
					}
					t.wheres = append(t.wheres, whereT{
						name: strings.ToLower(name),
						minx: minx,
						min:  field.ValueOf(smin),
						maxx: maxx,
						max:  field.ValueOf(smax),
					})
					continue
				}
			case "wherein":
				vs = nvs
				var name, nvalsStr, valStr string
				if vs, name, ok = tokenval(vs); !ok {
					err = errInvalidNumberOfArguments
					return
				}
				if vs, nvalsStr, ok = tokenval(vs); !ok {
					err = errInvalidNumberOfArguments
					return
				}
				var i, nvals uint64
				if nvals, err = strconv.ParseUint(nvalsStr, 10, 64); err != nil {
					err = errInvalidArgument(nvalsStr)
					return
				}
				valArr := make([]field.Value, nvals)
				for i = 0; i < nvals; i++ {
					if vs, valStr, ok = tokenval(vs); !ok {
						err = errInvalidNumberOfArguments
						return
					}
					valArr[i] = field.ValueOf(valStr)
				}
				t.whereins = append(t.whereins, whereinT{
					name:   strings.ToLower(name),
					valArr: valArr,
				})
				continue
			case "whereevalsha":
				fallthrough
			case "whereeval":
				scriptIsSha := strings.ToLower(wtok) == "whereevalsha"
				vs = nvs
				var script, nargsStr, arg string
				if vs, script, ok = tokenval(vs); !ok || script == "" {
					err = errInvalidNumberOfArguments
					return
				}
				if vs, nargsStr, ok = tokenval(vs); !ok || nargsStr == "" {
					err = errInvalidNumberOfArguments
					return
				}

				var i, nargs uint64
				if nargs, err = strconv.ParseUint(nargsStr, 10, 64); err != nil {
					err = errInvalidArgument(nargsStr)
					return
				}

				var luaState *lua.LState
				luaState, err = s.luapool.Get()
				if err != nil {
					return
				}

				argsTbl := luaState.CreateTable(len(vs), 0)
				for i = 0; i < nargs; i++ {
					if vs, arg, ok = tokenval(vs); !ok || arg == "" {
						err = errInvalidNumberOfArguments
						return
					}
					argsTbl.Append(lua.LString(arg))
				}

				var shaSum string
				if scriptIsSha {
					shaSum = script
				} else {
					shaSum = Sha1Sum(script)
				}

				luaSetRawGlobals(
					luaState, map[string]lua.LValue{
						"ARGV": argsTbl,
					})

				compiled, ok := s.luascripts.Get(shaSum)
				var fn *lua.LFunction
				if ok {
					fn = &lua.LFunction{
						IsG: false,
						Env: luaState.Env,

						Proto:     compiled,
						GFunction: nil,
						Upvalues:  make([]*lua.Upvalue, 0),
					}
				} else if scriptIsSha {
					err = errShaNotFound
					return
				} else {
					fn, err = luaState.Load(strings.NewReader(script), "f_"+shaSum)
					if err != nil {
						err = makeSafeErr(err)
						return
					}
					s.luascripts.Put(shaSum, fn.Proto)
				}
				t.whereevals = append(t.whereevals, whereevalT{
					c: s, luaState: luaState, fn: fn,
				})
				continue
			case "nofields":
				vs = nvs
				if t.nofields {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.nofields = true
				continue
			case "limit":
				vs = nvs
				if slimit != "" {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				if vs, slimit, ok = tokenval(vs); !ok || slimit == "" {
					err = errInvalidNumberOfArguments
					return
				}
				continue
			case "sparse":
				vs = nvs
				if ssparse != "" {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				if vs, ssparse, ok = tokenval(vs); !ok || ssparse == "" {
					err = errInvalidNumberOfArguments
					return
				}
				continue
			case "fence":
				vs = nvs
				if t.fence && !fromFence {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.fence = true
				continue
			case "commands":
				vs = nvs
				if t.accept != nil {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.accept = make(map[string]bool)
				var peek string
				if vs, peek, ok = tokenval(vs); !ok || peek == "" {
					err = errInvalidNumberOfArguments
					return
				}
				for _, s := range strings.Split(peek, ",") {
					part := strings.TrimSpace(strings.ToLower(s))
					if t.accept[part] {
						err = errDuplicateArgument(s)
						return
					}
					t.accept[part] = true
				}
				if len(t.accept) == 0 {
					t.accept = nil
				}
				continue
			case "distance":
				vs = nvs
				if t.distance {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.distance = true
				continue
			case "detect":
				vs = nvs
				if t.detect != nil {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.detect = make(map[string]bool)
				var peek string
				if vs, peek, ok = tokenval(vs); !ok || peek == "" {
					err = errInvalidNumberOfArguments
					return
				}
				for _, s := range strings.Split(peek, ",") {
					part := strings.TrimSpace(strings.ToLower(s))
					switch part {
					default:
						err = errInvalidArgument(peek)
						return
					case "inside", "outside", "enter", "exit", "cross":
					}
					if t.detect[part] {
						err = errDuplicateArgument(s)
						return
					}
					t.detect[part] = true
				}
				if len(t.detect) == 0 {
					t.detect = map[string]bool{
						"inside":  true,
						"outside": true,
						"enter":   true,
						"exit":    true,
						"cross":   true,
					}
				}
				continue
			case "nodwell":
				vs = nvs
				if t.desc || asc {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.nodwell = true
				continue
			case "desc":
				vs = nvs
				if t.desc || asc {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.desc = true
				continue
			case "asc":
				vs = nvs
				if t.desc || asc {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				asc = true
				continue
			case "match":
				vs = nvs
				var glob string
				if vs, glob, ok = tokenval(vs); !ok || glob == "" {
					err = errInvalidNumberOfArguments
					return
				}
				t.globs = append(t.globs, glob)
				continue
			case "clip":
				vs = nvs
				if t.clip {
					err = errDuplicateArgument(strings.ToUpper(wtok))
					return
				}
				t.clip = true
				continue
			}
		}
		break
	}

	// check to make sure that there aren't any conflicts
	if cmd == "scan" || cmd == "search" {
		if ssparse != "" {
			err = errors.New("SPARSE is not allowed for " + strings.ToUpper(cmd))
			return
		}
		if t.fence {
			err = errors.New("FENCE is not allowed for " + strings.ToUpper(cmd))
			return
		}
	} else {
		if t.desc {
			err = errors.New("DESC is not allowed for " + strings.ToUpper(cmd))
			return
		}
		if asc {
			err = errors.New("ASC is not allowed for " + strings.ToUpper(cmd))
			return
		}
	}
	if ssparse != "" && slimit != "" {
		err = errors.New("LIMIT is not allowed when SPARSE is specified")
		return
	}
	if scursor != "" && ssparse != "" {
		err = errors.New("CURSOR is not allowed when SPARSE is specified")
		return
	}
	if scursor != "" && t.fence {
		err = errors.New("CURSOR is not allowed when FENCE is specified")
		return
	}
	if t.detect != nil && !t.fence {
		err = errors.New("DETECT is not allowed when FENCE is not specified")
		return
	}

	t.output = defaultSearchOutput
	var nvs []string
	var sprecision string
	var which string
	if nvs, which, ok = tokenval(vs); ok && which != "" {
		updline := true
		switch strings.ToLower(which) {
		default:
			if cmd == "scan" {
				err = errInvalidArgument(which)
				return
			}
			updline = false
		case "count":
			t.output = outputCount
		case "objects":
			t.output = outputObjects
		case "points":
			t.output = outputPoints
		case "hashes":
			t.output = outputHashes
			if nvs, sprecision, ok = tokenval(nvs); !ok || sprecision == "" {
				err = errInvalidNumberOfArguments
				return
			}
		case "bounds":
			t.output = outputBounds
		case "ids":
			t.output = outputIDs
		}
		if updline {
			vs = nvs
		}
	}
	if scursor != "" {
		if t.cursor, err = strconv.ParseUint(scursor, 10, 64); err != nil {
			err = errInvalidArgument(scursor)
			return
		}
	}
	if sprecision != "" {
		t.precision, err = strconv.ParseUint(sprecision, 10, 64)
		if err != nil || t.precision == 0 || t.precision > 12 {
			err = errInvalidArgument(sprecision)
			return
		}
	}
	if slimit != "" {
		t.ulimit = true
		if t.limit, err = strconv.ParseUint(slimit, 10, 64); err != nil || t.limit == 0 {
			err = errInvalidArgument(slimit)
			return
		}
	}
	if ssparse != "" {
		t.usparse = true
		var sparse uint64
		if sparse, err = strconv.ParseUint(ssparse, 10, 8); err != nil || sparse == 0 || sparse > 8 {
			err = errInvalidArgument(ssparse)
			return
		}
		t.sparse = uint8(sparse)
		t.limit = math.MaxUint64
	}
	vsout = vs
	tout = t
	return
}

func detectExprToken(vs []string) bool {
	// Detect the kind of where, either:
	// - expr
	// - name min max
	if len(vs) == 0 {
		return false
	} else if len(vs) == 1 || (len(vs) == 2 && len(vs[1]) == 0) {
		return true
	}
	v := vs[1]
	if (v[0] >= 'a' && v[0] <= 'z') || (v[0] >= 'A' && v[0] <= 'Z') {
		if (v[0] == 'i' || v[0] == 'I') && strings.ToLower(v) == "inf" {
			return false
		}
		return true
	}
	return false
}

type parentStack []*areaExpression

func (ps *parentStack) isEmpty() bool {
	return len(*ps) == 0
}

func (ps *parentStack) push(e *areaExpression) {
	*ps = append(*ps, e)
}

func (ps *parentStack) pop() (e *areaExpression, empty bool) {
	n := len(*ps)
	if n == 0 {
		return nil, true
	}
	x := (*ps)[n-1]
	*ps = (*ps)[:n-1]
	return x, false
}

func (s *Server) parseAreaExpression(vsin []string, doClip bool) (vsout []string, ae *areaExpression, err error) {
	ps := &parentStack{}
	vsout = vsin[:]
	var negate, needObj bool
loop:
	for {
		nvs, wtok, ok := tokenval(vsout)
		if !ok || len(wtok) == 0 {
			break
		}
		switch strings.ToLower(wtok) {
		case tokenLParen:
			newExpr := &areaExpression{negate: negate, op: NOOP}
			negate = false
			needObj = false
			if ae != nil {
				ae.children = append(ae.children, newExpr)
			}
			ae = newExpr
			ps.push(ae)
			vsout = nvs
		case tokenRParen:
			if needObj {
				err = errInvalidArgument(tokenRParen)
				return
			}
			parent, empty := ps.pop()
			if empty {
				err = errInvalidArgument(tokenRParen)
				return
			}
			ae = parent
			vsout = nvs
		case tokenNOT:
			negate = !negate
			needObj = true
			vsout = nvs
		case tokenAND:
			if needObj {
				err = errInvalidArgument(tokenAND)
				return
			}
			needObj = true
			if ae == nil {
				err = errInvalidArgument(tokenAND)
				return
			} else if ae.obj == nil {
				switch ae.op {
				case OR:
					numChildren := len(ae.children)
					if numChildren < 2 {
						err = errInvalidNumberOfArguments
						return
					}
					ae.children = append(
						ae.children[:numChildren-1],
						&areaExpression{
							op:       AND,
							children: []*areaExpression{ae.children[numChildren-1]}})
				case NOOP:
					ae.op = AND
				}
			} else {
				ae = &areaExpression{op: AND, children: []*areaExpression{ae}}
			}
			vsout = nvs
		case tokenOR:
			if needObj {
				err = errInvalidArgument(tokenOR)
				return
			}
			needObj = true
			if ae == nil {
				err = errInvalidArgument(tokenOR)
				return
			} else if ae.obj == nil {
				switch ae.op {
				case AND:
					if len(ae.children) < 2 {
						err = errInvalidNumberOfArguments
						return
					}
					ae = &areaExpression{op: OR, children: []*areaExpression{ae}}
				case NOOP:
					ae.op = OR
				}
			} else {
				ae = &areaExpression{op: OR, children: []*areaExpression{ae}}
			}
			vsout = nvs
		case "point", "circle", "object", "bounds", "hash", "quadkey", "tile", "get", "sector":
			parsedVs, parsedObj, areaErr := s.parseArea(vsout, doClip)
			if areaErr != nil {
				err = areaErr
				return
			}
			newExpr := &areaExpression{negate: negate, obj: parsedObj, op: NOOP}
			negate = false
			needObj = false
			if ae == nil {
				ae = newExpr
			} else {
				ae.children = append(ae.children, newExpr)
			}
			vsout = parsedVs
		default:
			break loop
		}
	}
	if !ps.isEmpty() || needObj || ae == nil || (ae.obj == nil && len(ae.children) == 0) {
		err = errInvalidNumberOfArguments
	}
	return
}


text:
"""
    Ce module permet de créer des commandes pour faire agir les robots.
    Des fonctions utilitaire permettent de transformer une commande de
    Position (Pose) en une commande de vitesse.

    L'embarqué et le simulateur utilise un vecteur de vitesse (Pose) pour
    contrôler les robots.
"""
from abc import abstractmethod
import threading
from pyhermes import McuCommunicator

from RULEngine.Game.OurPlayer import OurPlayer
from RULEngine.Util.Pose import Pose

class Command(object):
    def __init__(self, player: OurPlayer):
        assert isinstance(player, OurPlayer)
        self.player = player
        # fixme Why does command need the speed???
        if player.ai_command is not None:
            self.cmd_repr = player.ai_command.speed

    @abstractmethod
    def package_command(self, mcu_communicator: McuCommunicator):
        pass

class ResponseCommand(Command):
    def __init__(self, player: OurPlayer, pause_cond: threading.Condition):
        super().__init__(player)
        self.pause_cond = pause_cond
        self.completed = False

    def wakeup_thread(self):
        # We don't want wake up
        with self.pause_cond:
            self.completed = True
            self.pause_cond.notify()

    def pause_thread(self):
        with self.pause_cond:
            if not self.completed:
                self.pause_cond.wait()

    def package_command(self, mcu_communicator: McuCommunicator):
        pass

class GetBattery(ResponseCommand):
    def __init__(self, player, pause_cond: threading.Condition):
        super().__init__(player, pause_cond)

    def package_command(self, mcu_communicator: McuCommunicator):
        return mcu_communicator.getBatterie(self.player.id)

class Move(Command):
    def __init__(self, player: OurPlayer):
        super().__init__(player)

    def package_command(self, mcu_communicator: McuCommunicator) -> None:
        mcu_communicator.sendSpeed(self.player.id,
                                   self.cmd_repr.position.x,
                                   self.cmd_repr.position.y,
                                   self.cmd_repr.orientation)

class Kick(Command):
    def __init__(self, player: OurPlayer):
        super().__init__(player)
        # TODO ask embedded for kick force integration MGL 2017/05/29
        self.kick_speed = self.player.ai_command.kick_strength

    def package_command(self, mcu_communicator: McuCommunicator) -> None:
        mcu_communicator.kick(self.player.id)

class Stop(Command):
    def __init__(self, player: OurPlayer):
        super().__init__(player)
        self.speed_repr = Pose()

    def package_command(self, mcu_communicator: McuCommunicator) -> None:
        mcu_communicator.sendSpeed(self.player.id, 0, 0, 0)

class StartChargingKick(Command):
    def __init__(self, player: OurPlayer):
        super().__init__(player)

    def package_command(self, mcu_communicator: McuCommunicator) -> None:
        mcu_communicator.charge(self.player.id)

class Dribbler(Command):
    def __init__(self, player: OurPlayer, activate: bool=True):
        super().__init__(player)
        self.activate = activate
        # todo ask embedded about dribbler strength MGL 2017/05/29

    def package_command(self, mcu_communicator: McuCommunicator) -> None:
        if self.activate:
            mcu_communicator.turnOnDribbler(self.player.id)
        else:
            mcu_communicator.turnOffDribbler(self.player.id)


text:
package facetoday.spring.service;

import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;

import facetoday.exception.PasswdConfirmException;
import facetoday.service.PwdEncryption;
import facetoday.spring.web.dao.MemberDao;
import facetoday.spring.web.vo.FriendsVo;
import facetoday.spring.web.vo.MemberVo;

public class MemberServiceImpl implements MemberService {

	@Resource(name = "memberDao")
	private MemberDao memberDao;

	/**
	 * 회원 가입 - 소셜 계정의 경우
	 */
	@Override
	public int memberInsert(MemberVo vo) {

		int result = 0;

		try {
			result = memberDao.memberInsert(vo);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
	}

	/**
	 * 회원 가입
	 */
	@Override
	public int memberInsert(MemberVo memberVo, String passwdConfirm) throws Exception {

		int result = 0;

		if (memberVo.getPasswd().equals(passwdConfirm)) {
			memberVo.setPasswd(PwdEncryption.pwdCode(memberVo.getPasswd()));
			result = memberDao.memberInsert(memberVo);
		} else {
			System.out.println("비번 틀림");
			throw new PasswdConfirmException();
		}

		if (result == 0) {
			throw new SQLException("가입하는 중 오류가 발생했습니다.");
		}

		return result;
	}

	@Override
	public String recentMusic(MemberVo vo) throws SQLException {
		return memberDao.recentMusic(vo);
	}
	/**
	 * 로그인 과정
	 */
	@Override
	public MemberVo login(String email, String passwd) throws SQLException {

		List<MemberVo> list = memberDao.login(email);
		MemberVo memberVo = null;

		if(list.isEmpty()) {
			throw new SQLException("없는 이메일입니다.");
		} else {
			if(PwdEncryption.pwdCode(passwd).equals(list.get(0).getPasswd()))
				memberVo = new MemberVo(list.get(0).getEmail(),list.get(0).getName(),list.get(0).getPasswd(),list.get(0).getBirth(),list.get(0).getSocial());
			else
				throw new SQLException("비밀번호가 일치하지 않습니다.");
		}

		return memberVo;
	}

	/**
	 * 친구 추천... 현재는 친구 추천을 전 멤버를 준다.
	 */
	@Override
	public List<MemberVo> selectAllMember(String email) throws SQLException {

		List<MemberVo> list = memberDao.selectAllMember(email);

		if (list.isEmpty()) {
			throw new SQLException("추천할 친구가 없습니다.");
		}

		return list;
	}

	/**
	 * 이메일 체크
	 */
	@Override
	public boolean emailCheck(String email) throws SQLException {
		// TODO Auto-generated method stub
		return memberDao.emailCheck(email);
	}

	@Override
	public List<MemberVo> searchUser(FriendsVo vo) throws SQLException {
		return memberDao.searchUser(vo);
	}

	@Override
	public int addFriends(FriendsVo vo) throws SQLException {
		int result = memberDao.addFriends(vo);

		if (result == 0)
			throw new SQLException("친구가 추가되지 않았습니다.");

		return result;
	}

	@Override
	public List<FriendsVo> checkFollower(MemberVo vo) throws SQLException {

		return memberDao.checkFollower(vo);
	}
}


text:
/* CALENDAR WIDGET */
#live-calendar-widget {
	padding: 5px 4px;
	font-family: Verdana, sans-serif;
	}
#live-calendar-widget-wrap {width:250px;margin:0 auto;}
#live-calendar-widget a:link {  }
#live-calendar-widget a:hover { text-decoration: none; }

/* table globals */
#live-calendar-widget table.calendar {
	margin: 0;
	border: 0; border-collapse: collapse;
	font-size: 11px;
width:250px;
	}
#live-calendar-widget .calendar td {
	border: 0;
	padding: 0;
	vertical-align: middle;
	}

/* thead */
#live-calendar-widget .calendar td.calendarMonthName {padding:4px 0;}
#live-calendar-widget .calendar tr.calendarHeader a { color: #225eaf; }
#live-calendar-widget .calendar thead td {
	color: #fff;
	font-weight: normal;
	text-align: center;
	}
#live-calendar-widget .calendar thead td.calendarMonthName {
	font-family: Georgia;
	font-size: 13px;
	text-align:center;
	}
#live-calendar-widget select#live-calendar-widget-navigator option  {
    font-family: Georgia;
    text-align:left;
  }
#live-calendar-widget .calendar thead tr.calendarDays {

	}
#live-calendar-widget .calendar thead td.calendarDayName {
	background: #989898;
	border: 1px solid #666;
	font-weight:400;
	}

/* tbody */
#live-calendar-widget .calendar tbody {
	border-left: 1px solid #666;
	}
#live-calendar-widget .calendar tbody td {
	border: 1px solid #666;
	background-color: #fff;
	}
#live-calendar-widget .calendar tbody td a {
	display: block;
	height: 26px;
	width: 30px;
	padding: 3px 0 0 3px;
	}
#live-calendar-widget .calendar tbody td a:hover {
	background-color: #fff9bf;
	background-image:inherit;
	background-repeat:inherit;
	background-position:inherit;
	}

#live-calendar-widget .calendar tbody td.calendarOutOfMonth a:link, #live-calendar-widget .calendar tbody td.calendarOutOfMonth a:active, #live-calendar-widget .calendar tbody td.calendarOutOfMonth a:hover, #live-calendar-widget .calendar tbody td.calendarOutOfMonth a:visited { color: #666; }

#live-calendar-widget .calendar tbody td.showWeek {
	border: 0;
	background-color: transparent;
	font-size: 18px;
	text-align: left;
	}
#live-calendar-widget .calendar tbody td.showWeek a:hover {
	padding: 3px 3px 0 0;
	background-color: transparent;
	}
#live-calendar-widget .calendar tbody td.currentDay {
	background-color: #fff9bf;
	}
#live-calendar-widget .calendar tbody td.calendarToday {
	background-color: #def0f2;
	}
#live-calendar-widget .calendar tbody td.hasEvent,
#live-calendar-widget .calendar tbody td.hasEvent a:hover {
  background-image:url(../images/dot.png);
  background-repeat:no-repeat;
  background-position: center 20px;
  }


text:
/*	$NetBSD: sbdspvar.h,v 1.61 2011/11/23 23:07:33 jmcneill Exp $	*/

/*
 * Copyright (c) 1991-1993 Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the Computer Systems
 *	Engineering Group at Lawrence Berkeley Laboratory.
 * 4. Neither the name of the University nor of the Laboratory may be used
 *    to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

#include "mpu.h"
#if NMPU > 0
#include <dev/ic/mpuvar.h>
#endif

#define SB_MASTER_VOL	0
#define SB_MIDI_VOL	1
#define SB_CD_VOL	2
#define SB_VOICE_VOL	3
#define SB_OUTPUT_CLASS	4

#define SB_MIC_VOL	5
#define SB_LINE_IN_VOL	6
#define	SB_RECORD_SOURCE 7
#define SB_TREBLE	8
#define SB_BASS		9
#define SB_RECORD_CLASS	10
#define SB_INPUT_CLASS	11

#define SB_PCSPEAKER	12
#define SB_INPUT_GAIN	13
#define SB_OUTPUT_GAIN	14
#define SB_AGC		15
#define SB_EQUALIZATION_CLASS 16

#define SB_CD_IN_MUTE	17
#define SB_MIC_IN_MUTE	18
#define SB_LINE_IN_MUTE	19
#define SB_MIDI_IN_MUTE	20

#define SB_CD_SWAP	21
#define SB_MIC_SWAP	22
#define SB_LINE_SWAP	23
#define SB_MIDI_SWAP	24

#define SB_CD_OUT_MUTE	25
#define SB_MIC_OUT_MUTE	26
#define SB_LINE_OUT_MUTE 27

#define SB_NDEVS	28

#define SB_IS_IN_MUTE(x) ((x) < SB_CD_SWAP)

/*
 * Software state, per SoundBlaster card.
 * The soundblaster has multiple functionality, which we must demultiplex.
 * One approach is to have one major device number for the soundblaster card,
 * and use different minor numbers to indicate which hardware function
 * we want.  This would make for one large driver.  Instead our approach
 * is to partition the design into a set of drivers that share an underlying
 * piece of hardware.  Most things are hard to share, for example, the audio
 * and midi ports.  For audio, we might want to mix two processes' signals,
 * and for midi we might want to merge streams (this is hard due to
 * running status).  Moreover, we should be able to re-use the high-level
 * modules with other kinds of hardware.  In this module, we only handle the
 * most basic communications with the sb card.
 */
struct sbdsp_softc {
	device_t sc_dev;		/* base device */
	isa_chipset_tag_t sc_ic;
	bus_space_tag_t sc_iot;		/* tag */
	bus_space_handle_t sc_ioh;	/* handle */
	void	*sc_ih;			/* interrupt vectoring */
	kmutex_t sc_lock;
	kmutex_t sc_intr_lock;

	/* XXX These are only for setting chip configuration registers. */
	int	sc_iobase;		/* I/O port base address */
	int	sc_irq;			/* interrupt */

	int	sc_drq8;		/* DMA (8-bit) */
	bus_size_t sc_drq8_maxsize;
	int	sc_drq16;		/* DMA (16-bit) */
	bus_size_t sc_drq16_maxsize;

	u_int	sc_quirks;		/* minor variations */
#define SB_QUIRK_NO_INIT_DRQ	0x01

	int	sc_open;		/* reference count of open calls */
#define SB_CLOSED 0
#define SB_OPEN_AUDIO 1
#define SB_OPEN_MIDI 2
	u_char	sc_fullduplex;		/* can do full duplex */

	u_char	gain[SB_NDEVS][2];	/* kept in input levels */
#define SB_LEFT 0
#define SB_RIGHT 1
#define SB_LR 0

	u_int	in_mask;		/* input ports */
	u_int	in_port;		/* XXX needed for MI interface */
	u_int	in_filter;		/* one of SB_TREBLE_EQ, SB_BASS_EQ, 0 */

	u_int	spkr_state;		/* non-null is on */

	struct sbdsp_state {
		u_int	rate;		/* Sample rate */
		u_char	tc;		/* Time constant */
		struct	sbmode *modep;
		u_char	bmode;
		int	dmachan;	/* DMA channel */
		int	blksize;	/* Block size, preadjusted */
		u_char	run;
#define SB_NOTRUNNING 0		/* Not running, not initialized */
#define SB_RUNNING 3		/* non-looping mode */
#define SB_LOOPING 2		/* DMA&PCM running (looping mode) */
	} sc_i, sc_o;			/* Input and output state */

	u_long	sc_interrupts;		/* number of interrupts taken */

	int	(*sc_intr8)(void*);	/* DMA completion intr handler */
	int	(*sc_intr16)(void*);	/* DMA completion intr handler */
	void	(*sc_intrp)(void*);	/* PCM output intr handler */
	void	*sc_argp;		/* arg for sc_intrp() */
	void	(*sc_intrr)(void*);	/* PCM input intr handler */
	void	*sc_argr;		/* arg for sc_intrr() */
	void	(*sc_intrm)(void*, int);/* midi input intr handler */
	void	*sc_argm;		/* arg for sc_intrm() */

	u_int	sc_mixer_model;
#define SBM_NONE	0
#define SBM_CT1335	1
#define SBM_CT1345	2
#define SBM_CT1XX5	3
#define SBM_CT1745	4
#define ISSBM1745(x) ((x)->sc_mixer_model >= SBM_CT1XX5)

	u_int	sc_model;		/* DSP model */
#define SB_UNK	-1
#define SB_1	0			/* original SB */
#define SB_20	1			/* SB 2 */
#define SB_2x	2			/* SB 2, new version */
#define SB_PRO	3			/* SB Pro */
#define SB_JAZZ	4			/* Jazz 16 */
#define SB_16	5			/* SB 16 */
#define SB_32	6			/* SB AWE 32 */
#define SB_64	7			/* SB AWE 64 */

#define SB_NAMES { "SB_1", "SB_2.0", "SB_2.x", "SB_Pro", "Jazz_16", "SB_16", \
		"SB_AWE_32", "SB_AWE_64" }

	u_int	sc_version;		/* DSP version */
#define SBVER_MAJOR(v)	(((v)>>8) & 0xff)
#define SBVER_MINOR(v)	((v)&0xff)

#if NMPU > 0
	int	sc_hasmpu;
#define SBMPU_EXTERNAL	1
#define SBMPU_INTERNAL	0
#define SBMPU_NONE	-1
	device_t sc_mpudev;
	bus_space_tag_t sc_mpu_iot;	/* tag */
	bus_space_handle_t sc_mpu_ioh;	/* handle */
#endif
};

#define ISSBPRO(sc) ((sc)->sc_model == SB_PRO || (sc)->sc_model == SB_JAZZ)
#define ISSBPROCLASS(sc) ((sc)->sc_model >= SB_PRO)
#define ISSB16CLASS(sc) ((sc)->sc_model >= SB_16)

#ifdef _KERNEL
struct malloc_type;

int	sbdsp_open(void *, int);
void	sbdsp_close(void *);

int	sbdsp_probe(struct sbdsp_softc *, cfdata_t);
void	sbdsp_attach(struct sbdsp_softc *);

int	sbdsp_set_in_gain(void *, u_int, u_char);
int	sbdsp_set_in_gain_real(void *, u_int, u_char);
int	sbdsp_get_in_gain(void *);
int	sbdsp_set_out_gain(void *, u_int, u_char);
int	sbdsp_set_out_gain_real(void *, u_int, u_char);
int	sbdsp_get_out_gain(void *);
int	sbdsp_set_monitor_gain(void *, u_int);
int	sbdsp_get_monitor_gain(void *);
int	sbdsp_query_encoding(void *, struct audio_encoding *);
int	sbdsp_set_params(void *, int, int, audio_params_t *, audio_params_t *,
	    stream_filter_list_t *, stream_filter_list_t *);
int	sbdsp_round_blocksize(void *, int, int, const audio_params_t *);
int	sbdsp_get_avail_in_ports(void *);
int	sbdsp_get_avail_out_ports(void *);
int	sbdsp_speaker_ctl(void *, int);

int	sbdsp_commit(void *);
int	sbdsp_trigger_output(void *, void *, void *, int, void (*)(void *),
	    void *, const audio_params_t *);
int	sbdsp_trigger_input(void *, void *, void *, int, void (*)(void *),
	    void *, const audio_params_t *);
int	sbdsp_halt_output(void *);
int	sbdsp_halt_input(void *);

void	sbdsp_compress(int, u_char *, int);
void	sbdsp_expand(int, u_char *, int);

int	sbdsp_reset(struct sbdsp_softc *);
void	sbdsp_spkron(struct sbdsp_softc *);
void	sbdsp_spkroff(struct sbdsp_softc *);

int	sbdsp_wdsp(struct sbdsp_softc *, int);
int	sbdsp_rdsp(struct sbdsp_softc *);

int	sbdsp_intr(void *);

int	sbdsp_set_sr(struct sbdsp_softc *, u_long *, int);

void	sbdsp_mix_write(struct sbdsp_softc *, int, int);
int	sbdsp_mix_read(struct sbdsp_softc *, int);

int	sbdsp_mixer_set_port(void *, mixer_ctrl_t *);
int	sbdsp_mixer_get_port(void *, mixer_ctrl_t *);
int	sbdsp_mixer_query_devinfo(void *, mixer_devinfo_t *);

void	*sb_malloc(void *, int, size_t);
void	sb_free(void *, void *, size_t);
size_t	sb_round_buffersize(void *, int, size_t);
paddr_t	sb_mappage(void *, void *, off_t, int);

int	sbdsp_get_props(void *);
void	sbdsp_get_locks(void *, kmutex_t **, kmutex_t **);

int	sbdsp_midi_open(void *, int, void (*iintr)(void *, int),
	    void (*ointr)(void *), void *);
void	sbdsp_midi_close(void *);
int	sbdsp_midi_output(void *, int);
void	sbdsp_midi_getinfo(void *, struct midi_info *);
#endif


text:
<?php
namespace Vivo\CMS\UI\Content;

use Vivo\CMS\Api\CMS;
use Vivo\CMS\Model\Content;
use Vivo\CMS\UI\Component;
use Vivo\CMS\UI\Exception;
use Vivo\Util\MIME;

/**
 * UI component for content file.
 */
class File extends Component
{

    /**
     * @var CMS
     */
    private $cms;

    /**
     * @var string
     */
    private $templateVariant;

    /**
     * @param CMS $cms
     */
    public function __construct(CMS $cms)
    {
        $this->cms = $cms;
    }

    public function init()
    {
        //TODO validate mimetype
        //TODO determine resource filename and mimetype
        //TODO include phtml resource, tpl resource

        if (!$this->content instanceof Content\File) {
            throw new Exception\Exception (sprintf("%s: Incompatible model. Expected 'Vivo\CMS\Model\Content\File'.", __METHOD__));
        }

        $mimeType = $this->content->getMimeType();
        $resourceFile = 'resource.' . MIME::getExt($mimeType);
        $this->view->resourceFile = $resourceFile;
        if ($mimeType == 'text/html') {
            $this->view->fileContent = $this->cms->getResource($this->content, $resourceFile);
            $templateVariant = 'html';
        } elseif ($mimeType == 'text/plain') {
            $this->view->fileContent = $this->cms->getResource($this->content, $resourceFile);
            $templateVariant = 'plain';
        } elseif ($mimeType == 'application/x-shockwave-flash') {
            $templateVariant = 'flash';
        } elseif (substr($mimeType, 0, 6) == 'image/') {
            $templateVariant = 'image';
        } else {
            $templateVariant = null;
        }
        $this->view->setTemplate($this->getDefaultTemplate() .
                ($templateVariant ? ':' . $templateVariant : ''));
    }
}


text:
import {TestBed, ComponentFixture}  from '@angular/core/testing';
import {Component} from '@angular/core';
import {createGenericTestComponent} from '../../../test/util/helpers';
import {NglFormsModule} from '../module';
import {getRequiredElement, getErrorElement} from './input.spec';

const createTestComponent = (html?: string, detectChanges?: boolean) =>
  createGenericTestComponent(TestComponent, html, detectChanges) as ComponentFixture<TestComponent>;

function getInputElement(element: Element): HTMLInputElement {
  return <HTMLInputElement>element.querySelector('input');
}

function getLabelElement(element: Element): HTMLLabelElement {
  return <HTMLLabelElement>element.querySelector('.slds-form-element__label');
}

function getEnabledTextElement(element: Element): HTMLSpanElement {
  return <HTMLSpanElement>element.querySelector('.slds-checkbox--on');
}

function getDisabledTextElement(element: Element): HTMLSpanElement {
  return <HTMLSpanElement>element.querySelector('.slds-checkbox--off');
}

describe('`NglFormCheckboxToggle`', () => {

  beforeEach(() => TestBed.configureTestingModule({declarations: [TestComponent], imports: [NglFormsModule]}));

  it('should render correctly', () => {
    const fixture = createTestComponent();
    const element = fixture.nativeElement.firstElementChild;
    expect(element).toHaveCssClass('slds-form-element');

    const labelEl = getLabelElement(fixture.nativeElement);
    expect(labelEl).toHaveText('My label');

    const enabledText = getEnabledTextElement(fixture.nativeElement);
    expect(enabledText).toHaveText('Enabled');

    const disabledText = getDisabledTextElement(fixture.nativeElement);
    expect(disabledText).toHaveText('Disabled');

    expect(getErrorElement(fixture.nativeElement)).toBeFalsy();
  });

  it('should hook label indication on input required', () => {
    const fixture = createTestComponent(`<ngl-form-checkbox-toggle><input nglFormControl type="checkbox" [required]="required" /></ngl-form-checkbox-toggle>`);
    expect(getRequiredElement(fixture.nativeElement)).toBeFalsy();

    fixture.componentInstance.required = true;
    fixture.detectChanges();
    const abbrEl = getRequiredElement(fixture.nativeElement);
    expect(abbrEl).toHaveCssClass('slds-required');

    fixture.componentInstance.required = false;
    fixture.detectChanges();
    expect(getRequiredElement(fixture.nativeElement)).toBeFalsy();
  });

  it('should show error correctly', () => {
    const fixture = createTestComponent();
    fixture.componentInstance.error = 'An error';
    fixture.detectChanges();

    const errorEl = getErrorElement(fixture.nativeElement);
    const inputEl = getInputElement(fixture.nativeElement);
    expect(errorEl).toHaveText('An error');
    expect(errorEl.id).toEqual(inputEl.getAttribute('aria-describedby'));
  });

  it('should be able to configure enabled/disabled text correctly', () => {
    const fixture = createTestComponent(`<ngl-form-checkbox-toggle [enabledText]="enabledText" [disabledText]="disabledText"><input nglFormControl type="checkbox" /></ngl-form-checkbox-toggle>`);
    fixture.componentInstance.enabledText = 'On';
    fixture.componentInstance.disabledText = 'Off';
    fixture.detectChanges();

    const enabledTextEl = getEnabledTextElement(fixture.nativeElement);
    expect(enabledTextEl).toHaveText('On');

    const disabledTextEl = getDisabledTextElement(fixture.nativeElement);
    expect(disabledTextEl).toHaveText('Off');
  });

});

@Component({
  template: `
    <ngl-form-checkbox-toggle [label]="label" [error]="error">
      <input nglFormControl type="checkbox" />
    </ngl-form-checkbox-toggle>
  `,
})
export class TestComponent {
  label: string = 'My label';
  required: boolean;
  error: string;
  enabledText: string;
  disabledText: string;
}


text:
void AliITSVertexerZTest(Float_t delphi=0.05,Float_t window=3.,Float_t initx=0., Float_t inity=0.,TString FileIn="galice.root"){
  // delphi ---> azimuthal range to accept tracklets
  // window ---> window in Z around the peak of tracklets proj. in mm
  Int_t kDebug = 50;
  TH2F *diff2 = new TH2F("diff2","Zfound vs Ztrue",100,-6,6,100,-6,6);
  TH1F *diff1 = new TH1F("diff1","Zfound - Ztrue(#mu m)",100,-500,500);
  delete gAlice;
  gAlice = 0;
  AliRunLoader *rl = AliRunLoader::Open(FileIn.Data());
  Int_t retval = rl->LoadgAlice();
  if(retval){
    cerr<<"AliITSVertexerZTest.C: AliRun object not found"<<endl;
    return;
  }
  retval = rl->LoadHeader();
  if (retval){
    cerr<<"AliITSVertexerZTest.C : LoadHeader returned error"<<endl;
    return;
  }
  retval = rl->LoadKinematics();
  if (retval){
    cerr<<"AliITSVertexerZTest.C : LoadKinematics returned error"<<endl;
    return;
  }

  AliGeomManager::LoadGeometry("geometry.root");

  AliITSVertexerZ *dovert = new AliITSVertexerZ(initx,inity);
  dovert->Init("default");
  //dovert->SetDebug(0);
  //  dovert->SetDiffPhiMax(delphi);
  //  dovert->SetWindow(window);
  dovert->PrintStatus();
  Int_t sigmazero=0;
  AliESDVertex *vert = 0;
  AliITSLoader* itsloader =  (AliITSLoader*) rl->GetLoader("ITSLoader");
  itsloader->LoadRecPoints("read");
  for(Int_t i=0; i<rl->TreeE()->GetEntries(); i++){
    rl->GetEvent(i);
    // The true Z coord. is fetched for comparison
    AliHeader *header = rl->GetHeader();
    AliGenEventHeader* genEventHeader = header->GenEventHeader();
    TArrayF primaryVertex(3);
    genEventHeader->PrimaryVertex(primaryVertex);
    TTree* cltree = itsloader->TreeR();
    vert = dovert->FindVertexForCurrentEvent(cltree);
    if(kDebug>0){
      // Prints the results
      cout <<"========================================================\n";
      cout << "Event number: "<<i<<")  Z Vertex:"<<endl;
      if(vert){
	cout<<"FOUND: "<<vert->GetZ()<<"; ";
	cout<<vert->GetZRes()<<"; "<<vert->GetNContributors()<<endl;
	cout <<" True Z position "<<primaryVertex[2]<<", diff= ";
	cout<<(primaryVertex[2]-vert->GetZ())*10000.<<endl;
      } else {
	cout<<"NOT FOUND"<<endl;
      }
    }
    if(vert){
      Float_t found = vert->GetZ();
      diff2->Fill(primaryVertex[2],found);
      found = 10000.*(found-primaryVertex[2]);
      if(vert->GetZRes()!=0){
	diff1->Fill(found);
      } else {
	sigmazero++;
      }
      dovert->WriteCurrentVertex();
    }
  }
  if(kDebug>0){
    cout<<"Only one tracklet (sigma = 0) "<<sigmazero<<endl;
  }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Drake: drake/math/autodiff.h File 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" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>

     Home

     Installation

     Gallery

API Documentation

      C++
      Python

Resources

      Getting Help
      Tutorials
      Python Bindings
      For Developers
      Credits

     GitHub

Drake

  Drake C++ Documentation

  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search C++ API only…">
   <input type="hidden" name="sites" value="drake.mit.edu/doxygen_cxx">
  </form>
  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search all of Drake…">
   <input type="hidden" name="sites" value="drake.mit.edu">
  </form>

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

Namespaces |
Typedefs |
Functions

autodiff.h File Reference

Detailed Description

Utilities for arithmetic on AutoDiffScalar.

#include <array>

#include <cmath>

#include <optional>

#include <tuple>

#include <utility>

#include <Eigen/Dense>

#include <unsupported/Eigen/AutoDiff>

#include "drake/common/autodiff.h"

#include "drake/common/eigen_types.h"

#include "drake/common/unused.h"

Include dependency graph for autodiff.h:

This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.

This graph shows which files directly or indirectly include this file:

This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.

Namespaces

  	drake

  	drake::math

Typedefs

template<typename Derived , int nq>

using 	AutoDiffMatrixType = MatrixLikewise< Eigen::AutoDiffScalar< Vector< typename Derived::Scalar, nq > >, Derived >

 	The appropriate AutoDiffScalar matrix type given the value type and the number of derivatives at compile time.  More...

Functions

template<typename Derived >

MatrixLikewise< typename Derived::Scalar::Scalar, Derived > 	ExtractValue (const Eigen::MatrixBase< Derived > &auto_diff_matrix)

 	Extracts the value() portion from a matrix of AutoDiffScalar entries.  More...

template<typename Derived >

decltype(auto) 	DiscardGradient (const Eigen::MatrixBase< Derived > &matrix)

 	B = DiscardGradient(A) enables casting from a matrix of AutoDiffScalars to AutoDiffScalar::Scalar type, explicitly throwing away any gradient information.  More...

template<typename Derived , typename DerivedAutoDiff >

void 	InitializeAutoDiff (const Eigen::MatrixBase< Derived > &value, std::optional< int > num_derivatives, std::optional< int > deriv_num_start, Eigen::MatrixBase< DerivedAutoDiff > *auto_diff_matrix)

 	Initializes a single AutoDiff matrix given the corresponding value matrix.  More...

template<typename Derived , typename DerivedAutoDiff >

void 	InitializeAutoDiff (const Eigen::MatrixBase< Derived > &value, Eigen::MatrixBase< DerivedAutoDiff > *auto_diff_matrix)

 	Alternate signature provides default values for the number of derivatives (dynamic, determined at run time) and the starting index (0).  More...

template<int nq = Eigen::Dynamic, typename Derived >

AutoDiffMatrixType< Derived, nq > 	InitializeAutoDiff (const Eigen::MatrixBase< Derived > &value, std::optional< int > num_derivatives={}, std::optional< int > deriv_num_start={})

 	Initializes a single AutoDiff matrix given the corresponding value matrix.  More...

template<typename... Deriveds>

auto 	InitializeAutoDiffTuple (const Eigen::MatrixBase< Deriveds > &... args)

drake

math

autodiff.h

          C++

          Python

          GitHub


text:
/* $This file is distributed under the terms of the license in LICENSE$ */

package edu.cornell.mannlib.vitro.webapp.controller.jena;

import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.FULL_ASSERTIONS;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.FULL_INFERENCES;

import java.io.IOException;
import java.io.OutputStream;
import java.io.StringWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jena.iri.IRI;
import org.apache.jena.iri.IRIFactory;

import org.apache.jena.ontology.AllValuesFromRestriction;
import org.apache.jena.ontology.OntClass;
import org.apache.jena.ontology.OntModel;
import org.apache.jena.ontology.OntModelSpec;
import org.apache.jena.ontology.Restriction;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.rdf.model.Literal;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;
import org.apache.jena.shared.Lock;
import org.apache.jena.vocabulary.OWL;
import org.apache.jena.vocabulary.RDF;
import org.apache.jena.vocabulary.RDFS;

import edu.cornell.mannlib.vedit.controller.BaseEditController;
import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
import edu.cornell.mannlib.vitro.webapp.modules.tboxreasoner.TBoxReasonerModule;

@WebServlet(name = "JenaAdminServlet", urlPatterns = {"/jenaAdmin"} )
public class JenaAdminActions extends BaseEditController {

	private static final Log log = LogFactory.getLog(JenaAdminActions.class.getName());

    private boolean checkURI( String uri ) {
    	IRIFactory factory = IRIFactory.jenaImplementation();
        IRI iri = factory.create( uri );
        if (iri.hasViolation(false) ) {
        	log.error("Bad URI: "+uri);
        	log.error( "Only well-formed absolute URIrefs can be included in RDF/XML output: "
                 + iri.violations(false).next().getShortMessage());
        	return true;
        } else {
        	return false;
        }
    }

	private static final String VITRO = "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#";
    private static final String AKT_SUPPORT = "http://www.aktors.org/ontology/support#";
    private static final String AKT_PORTAL = "http://www.aktors.org/ontology/portal#";

    private void copyStatements(Model src, Model dest, Resource subj, Property pred, RDFNode obj) {
    	for (Statement stmt : src.listStatements(subj,pred,obj).toList()) {
    		String subjNs = stmt.getSubject().getNameSpace();
    		if (subjNs == null || (! (subjNs.equals(VITRO) || subjNs.equals(AKT_SUPPORT) || subjNs.equals(AKT_PORTAL) ) ) ) {
    			if (stmt.getObject().isLiteral()) {
    				dest.add(stmt);
    			} else if (stmt.getObject().isResource()) {
    				String objNs = ((Resource)stmt.getObject()).getNameSpace();
    				if (objNs == null || (! (objNs.equals(VITRO) || objNs.equals(AKT_SUPPORT) || objNs.equals(AKT_PORTAL) ) ) ) {
    					dest.add(stmt);
    				}
    			}
    		}
    	}
    }

    /**
     * This doesn't really print just the TBox.  It takes a copy of the model, removes all the individuals, and writes the result.
     */
    private void outputTbox(HttpServletResponse response) {
        OntModel memoryModel = ModelAccess.on(getServletContext()).getOntModel(FULL_ASSERTIONS);
        try {
        	OntModel tempOntModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
        	memoryModel.enterCriticalSection(Lock.READ);
        	try {
        		copyStatements(memoryModel,tempOntModel,null,RDF.type,OWL.Class);
        		copyStatements(memoryModel,tempOntModel,null,RDF.type,OWL.ObjectProperty);
        		copyStatements(memoryModel,tempOntModel,null,RDF.type,OWL.DatatypeProperty);
        		copyStatements(memoryModel,tempOntModel,null,RDF.type,OWL.AnnotationProperty);
        		copyStatements(memoryModel,tempOntModel,null,RDFS.subClassOf,null);
        		copyStatements(memoryModel,tempOntModel,null,RDFS.subPropertyOf,null);
        		copyStatements(memoryModel,tempOntModel,null,RDFS.domain,null);
        		copyStatements(memoryModel,tempOntModel,null,RDFS.range,null);
        		copyStatements(memoryModel,tempOntModel,null,OWL.inverseOf,null);
        	} finally {
        		memoryModel.leaveCriticalSection();
        	}
            response.setContentType("application/rdf+xml");
            OutputStream out = response.getOutputStream();
            tempOntModel.write(out);
            out.flush();
            out.close();
            tempOntModel = null; // Hit it, GC
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private Model extractTaxonomy(OntModel ontModel) {
    	ontModel.enterCriticalSection(Lock.READ);
    	Model taxonomyModel = ModelFactory.createDefaultModel();
    	try {
    		HashSet<Resource> typeSet = new HashSet<Resource>();
    		for (Statement stmt : ontModel.listStatements((Resource)null,RDF.type,(RDFNode)null).toList()) {
    			if (stmt.getObject().isResource()) {
    				typeSet.add((Resource) stmt.getObject());
    			}
    		}
			typeSet.addAll(ontModel.listClasses().toList());
    		for (Resource ontClass : typeSet) {
    			if (!ontClass.isAnon()) { // Only query for named classes
    				System.out.println("Describing "+ontClass.getURI());
    				// We want a subgraph describing this class, including related BNodes
    				String queryStr = "DESCRIBE <"+ontClass.getURI()+">";
    				Query describeQuery = QueryFactory.create(queryStr);
    				QueryExecution qe = QueryExecutionFactory.create(describeQuery,ontModel);
    				qe.execDescribe(taxonomyModel);
    			}
			}
    	} finally {
    		ontModel.leaveCriticalSection();
    	}
    	System.out.println("Cleaning out the vitro properties");
    	Model cleanModel = ModelFactory.createDefaultModel();
    	StmtIterator stmtIt = taxonomyModel.listStatements();
    	while (stmtIt.hasNext()) {
    		Statement stmt = stmtIt.nextStatement();
    		if ( !(stmt.getPredicate().getURI().indexOf(VitroVocabulary.vitroURI)==0) ) {
    			// if it's not a vitro internal property, copy it over
    			cleanModel.add(stmt);
    		}
    	}
    	return cleanModel;
    }

	private String testWriteXML() {
		StringBuilder output = new StringBuilder();
		output.append("<title>Test Write XML</title>
\n");
		OntModel model = ModelAccess.on(getServletContext()).getOntModel();
		Model tmp = ModelFactory.createDefaultModel();
		boolean valid = true;
		for (Statement stmt : model.listStatements().toList() ) {
			tmp.add(stmt);
				StringWriter writer = new StringWriter();
				try {
					tmp.write(writer, "RDF/XML");
				} catch (Exception e) {
					valid = false;
					output.append("-----\n");
					output.append("Unable to write statement as RDF/XML:\n");
					output.append("Subject : \n").append(stmt.getSubject().getURI());
					output.append("Subject : \n").append(stmt.getPredicate().getURI());
					String objectStr = (stmt.getObject().isLiteral()) ? ((Literal)stmt.getObject()).getLexicalForm() : ((Resource)stmt.getObject()).getURI();
					output.append("Subject : \n").append(objectStr);
					output.append("Exception: \n");
					e.printStackTrace();
				}
			tmp.removeAll();
		}
		if (valid) {
			output.append("All statements were able to be written as RDF/XML\n");
		}
		output.append("");
		return output.toString();
	}

    private void printRestrictions() {
		try {
			TBoxReasonerModule reasoner = ApplicationUtils.instance().getTBoxReasonerModule();
			for (Restriction rest : reasoner.listRestrictions() ) {
				if (rest.isAllValuesFromRestriction()) {
					log.trace("All values from: ");
					AllValuesFromRestriction avfr = rest.asAllValuesFromRestriction();
					Resource res = avfr.getAllValuesFrom();
					if (res.canAs(OntClass.class)) {
						OntClass resClass = res.as(OntClass.class);
						for (Resource inst : resClass.listInstances().toList() ) {
							log.trace("    -"+inst.getURI());
						}
					}
				} else if (rest.isSomeValuesFromRestriction()) {
					log.trace("Some values from: ");
				} else if (rest.isHasValueRestriction()) {
					log.trace("Has value: ");
				}
				log.trace("On property "+rest.getOnProperty().getURI());
				for (Resource inst : rest.listInstances().toList() ) {
					log.trace("     "+inst.getURI());
				}
			}
		}
		catch (IllegalStateException e) {
			log.warn("Status of reasoner could not be determined. It is likely disabled", e);
		}
    }

    private void removeLongLiterals() {
		OntModel memoryModel = ModelAccess.on(getServletContext()).getOntModel();
    	memoryModel.enterCriticalSection(Lock.WRITE);
    	try {
    		List<Statement> statementsToRemove = new LinkedList<Statement>();
    		for (Statement stmt :  memoryModel.listStatements(null,null,(Literal)null).toList() ) {
    			if (stmt.getObject().isLiteral()) {
    				Literal lit = (Literal) stmt.getObject();
    				if ( lit.getString().length() > 24) {
    					statementsToRemove.add(stmt);
    				}
    			}
    		}
			for (Statement stmt : statementsToRemove) {
				memoryModel.remove(stmt);
			}
    	} finally {
    		memoryModel.leaveCriticalSection();
    	}
    }

    @Override
	public void doGet(HttpServletRequest req, HttpServletResponse response) {
        if (!isAuthorizedToDisplayPage(req, response, SimplePermission.USE_MISCELLANEOUS_ADMIN_PAGES.ACTION)) {
        	return;
        }

        VitroRequest request = new VitroRequest(req);
        String actionStr = request.getParameter("action");

		switch (actionStr) {
			case "printRestrictions":
				printRestrictions();
				break;
			case "outputTbox":
				outputTbox(response);
				break;
			case "testWriteXML":
				try {
					response.getWriter().write(testWriteXML());
				} catch (IOException ioe) {
					throw new RuntimeException(ioe);
				}
				break;
		}

        if (actionStr.equals("checkURIs")) {
    		OntModel memoryModel = ModelAccess.on(getServletContext()).getOntModel();
        	StmtIterator stmtIt = memoryModel.listStatements();
        	try {
        		for (Statement stmt : stmtIt.toList() ) {
	        		boolean sFailed = false;
	        		boolean pFailed = false;
	        		boolean oFailed = false;
	        		String sURI = "<bNode>";
	        		String pURI = "???";
	        		String oURI = "<bNode>";
	        		if (stmt.getSubject().getURI() != null) {
	        			sFailed = checkURI(sURI = stmt.getSubject().getURI());
	        		}
	        		if (stmt.getPredicate().getURI() != null) {
	        			pFailed = checkURI(pURI = stmt.getPredicate().getURI());
	        		}
	        		if (stmt.getObject().isResource() && ((Resource)stmt.getObject()).getURI() != null) {
	        			oFailed = checkURI(oURI = ((Resource)stmt.getObject()).getURI());
	        		}
	        		if (sFailed || pFailed || oFailed) {
	        			log.debug(sURI+" | "+pURI+" | "+oURI);
	        		}
	        	}
        	} finally {
        		stmtIt.close();
        	}
        }

        if (actionStr.equals("output")) {
            OntModel memoryModel = null;
	    if (request.getParameter("assertionsOnly") != null) {
	        memoryModel = ModelAccess.on(getServletContext()).getOntModel(FULL_ASSERTIONS);
	    	System.out.println("baseOntModel");
	    } else if (request.getParameter("inferences") != null) {
	    	memoryModel = ModelAccess.on(getServletContext()).getOntModel(FULL_INFERENCES);
	    	System.out.println("inferenceOntModel");
	    } else {
			memoryModel = ModelAccess.on(getServletContext()).getOntModel();
	    	System.out.println("jenaOntModel");
	    }
	    int subModelCount = memoryModel.listSubModels().toList().size();
	    System.out.println("Submodels: "+subModelCount);
	        try {
	            //response.setContentType("application/rdf+xml");
	        	response.setContentType("application/x-turtle");
	            OutputStream out = response.getOutputStream();
	            memoryModel.write(out, "TTL");
	            out.flush();
	            out.close();
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
        }

        if (actionStr.equals("removeLongLiterals")) {
        	removeLongLiterals();
        }

        if (actionStr.equals("outputTaxonomy")) {
            OntModel ontModel = ModelAccess.on(getServletContext()).getOntModel(FULL_ASSERTIONS);
        	Model taxonomyModel = extractTaxonomy(ontModel);
        	try {
        		taxonomyModel.write(response.getOutputStream());
        	} catch (Exception e) {
        		log.error(e, e);
        	}
        }
    }

    @Override
	public void doPost(HttpServletRequest request, HttpServletResponse response) {
        doGet(request ,response);
    }

}