text:
<?php

namespace Kunstmaan\BehatBundle\Features\Context\SubContext;

use Behat\Behat\Context\BehatContext;
use Behat\Mink\Exception\ElementNotFoundException;

class RadioButtonSubContext extends BehatContext
{
    /**
     * Initializes context.
     * Every scenario gets it's own context object.
     *
     * @param array $parameters context parameters
     */
    public function __construct(array $parameters)
    {
    }

    /**
     * Get Mink session from MinkContext
     */
    public function getSession($name = null)
    {
        return $this->getMainContext()->getSession($name);
    }

    /**
     * @param string $radioLabel
     *
     * @throws ElementNotFoundException
     *
     * @Given /^I select the "([^"]*)" radio button$/
     */
    public function iSelectTheRadioButton($radioLabel)
    {
        $radioButton = $this->getSession()->getPage()->findField($radioLabel);
        if (null === $radioButton) {
            throw new ElementNotFoundException($this->getSession(), 'form field', 'id|name|label|value', $radioLabel);
        }
        $this->getSession()->getDriver()->click($radioButton->getXPath());
    }
}


text:
.class Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;
.super Lcom/android/internal/content/PackageMonitor;
.source "UsbProfileGroupSettingsManager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/usb/UsbProfileGroupSettingsManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "MyPackageMonitor"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

# direct methods
.method private constructor <init>(Lcom/android/server/usb/UsbProfileGroupSettingsManager;)V
    .locals 0

    iput-object p1, p0, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;->this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

    invoke-direct {p0}, Lcom/android/internal/content/PackageMonitor;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/android/server/usb/UsbProfileGroupSettingsManager;Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;-><init>(Lcom/android/server/usb/UsbProfileGroupSettingsManager;)V

    return-void
.end method

# virtual methods
.method public onPackageAdded(Ljava/lang/String;I)V
    .locals 4

    iget-object v0, p0, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;->this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

    invoke-static {v0}, Lcom/android/server/usb/UsbProfileGroupSettingsManager;->-get2(Lcom/android/server/usb/UsbProfileGroupSettingsManager;)Landroid/os/UserManager;

    move-result-object v0

    iget-object v1, p0, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;->this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

    invoke-static {v1}, Lcom/android/server/usb/UsbProfileGroupSettingsManager;->-get1(Lcom/android/server/usb/UsbProfileGroupSettingsManager;)Landroid/os/UserHandle;

    move-result-object v1

    invoke-virtual {v1}, Landroid/os/UserHandle;->getIdentifier()I

    move-result v1

    invoke-static {p2}, Landroid/os/UserHandle;->getUserId(I)I

    move-result v2

    invoke-virtual {v0, v1, v2}, Landroid/os/UserManager;->isSameProfileGroup(II)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    :cond_0
    iget-object v0, p0, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;->this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

    new-instance v1, Lcom/android/server/usb/UsbProfileGroupSettingsManager$UserPackage;

    invoke-static {p2}, Landroid/os/UserHandle;->getUserHandleForUid(I)Landroid/os/UserHandle;

    move-result-object v2

    const/4 v3, 0x0

    invoke-direct {v1, p1, v2, v3}, Lcom/android/server/usb/UsbProfileGroupSettingsManager$UserPackage;-><init>(Ljava/lang/String;Landroid/os/UserHandle;Lcom/android/server/usb/UsbProfileGroupSettingsManager$UserPackage;)V

    invoke-static {v0, v1}, Lcom/android/server/usb/UsbProfileGroupSettingsManager;->-wrap1(Lcom/android/server/usb/UsbProfileGroupSettingsManager;Lcom/android/server/usb/UsbProfileGroupSettingsManager$UserPackage;)V

    return-void
.end method

.method public onPackageRemoved(Ljava/lang/String;I)V
    .locals 3

    iget-object v0, p0, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;->this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

    invoke-static {v0}, Lcom/android/server/usb/UsbProfileGroupSettingsManager;->-get2(Lcom/android/server/usb/UsbProfileGroupSettingsManager;)Landroid/os/UserManager;

    move-result-object v0

    iget-object v1, p0, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;->this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

    invoke-static {v1}, Lcom/android/server/usb/UsbProfileGroupSettingsManager;->-get1(Lcom/android/server/usb/UsbProfileGroupSettingsManager;)Landroid/os/UserHandle;

    move-result-object v1

    invoke-virtual {v1}, Landroid/os/UserHandle;->getIdentifier()I

    move-result v1

    invoke-static {p2}, Landroid/os/UserHandle;->getUserId(I)I

    move-result v2

    invoke-virtual {v0, v1, v2}, Landroid/os/UserManager;->isSameProfileGroup(II)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    :cond_0
    iget-object v0, p0, Lcom/android/server/usb/UsbProfileGroupSettingsManager$MyPackageMonitor;->this$0:Lcom/android/server/usb/UsbProfileGroupSettingsManager;

    invoke-static {p2}, Landroid/os/UserHandle;->getUserHandleForUid(I)Landroid/os/UserHandle;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Lcom/android/server/usb/UsbProfileGroupSettingsManager;->clearDefaults(Ljava/lang/String;Landroid/os/UserHandle;)V

    return-void
.end method

redpajama_set_name: RedPajamaGithub


text:
Catches last.fm scrobble requests and stores them in a database instead.

This does not proxy requests! It receives a subset of requests of the last.fm
api:

- auth.getMobileSession
- track.updateNowPlaying
- track.scrobble (single track only)

and returns dummy ok responses.

Remember to set `--username`, `--api-key` and `--secret` as expected by the
client. `--api-key` and `--secret` are best set differently to your valid lastfm
details if possible.

``` bash
$ go get hawx.me/code/trobble
$ trobble --username "Me" --api-key "..." --secret "..."
...
```


text:
package mockkubeapiserver

import (
	"context"
	"fmt"
	"io/ioutil"
	"net/http"

	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/klog/v2"
)

// postResource is a request to create a new resource
type postResource struct {
	baseRequest

	Group    string
	Version  string
	Resource string

	Namespace string
}

// Run serves the http request
func (req *postResource) Run(ctx context.Context, s *MockKubeAPIServer) error {
	gr := schema.GroupResource{Group: req.Group, Resource: req.Resource}

	resource := s.storage.FindResource(gr)
	if resource == nil {
		return req.writeErrorResponse(http.StatusNotFound)
	}

	bodyBytes, err := ioutil.ReadAll(req.r.Body)
	if err != nil {
		return err
	}

	klog.V(4).Infof("post request %#v", string(bodyBytes))

	obj := &unstructured.Unstructured{}
	if err := obj.UnmarshalJSON(bodyBytes); err != nil {
		return fmt.Errorf("failed to parse payload: %w", err)
	}

	id := types.NamespacedName{Namespace: obj.GetNamespace(), Name: obj.GetName()}

	if id.Namespace != req.Namespace {
		return fmt.Errorf("namespace in payload did not match namespace in URL")
	}
	if id.Name == "" {
		return fmt.Errorf("name must be provided in payload")
	}

	if err := s.storage.CreateObject(ctx, resource, id, obj); err != nil {
		return err
	}
	return req.writeResponse(obj)
}


text:
import schema from './index'
import { allValid, allInvalid } from '../../../test/utils'

const validModuleConfigs = [
  { input: { console: true } },
  { input: { global: true } },
  { input: { Buffer: true } },
  { input: { process: 'mock' } },
  { input: { __filename: true } },
  { input: { __dirname: false } },
  { input: { foo: 'mock' } },
]

const invalidModuleConfigs = [
  { input: [1], error: { } },
]

describe('node', () => {
  allValid(validModuleConfigs, schema)
  allInvalid(invalidModuleConfigs, schema)
})


text:
<?php

/**
 * @package sitemapfriend
 */
class SitemapFriend {
  /* @var modX $modx */
  protected $modx = null;
  public $config = array();

  /* @var sitemapfriend */
  protected $skipResources = array();
  protected $includeResources = array();
  protected $excludeChildrenOf = array();
  protected $queryWhere = array();
  protected $parentTitles = array();

  /**
   * Constructs the SitemapFriend class.
   *
   * @param \modX $modx
   * @param array $config
   */
  function __construct(modX &$modx, array $config = array()) {
    $this->modx =& $modx;

    $basePath = $this->modx->getOption('sitemapfriend.core_path',$config,$this->modx->getOption('core_path').'components/sitemapfriend/');
    $this->config = array_merge(array(
      'base_path' => $basePath,
      'core_path' => $basePath,
      'model_path' => $basePath.'model/',
      'elements_path' => $basePath.'elements/'
    ), $config);

    $this->config['type'] = strtolower($this->config['type']);

    if ($this->config['type'] != 'xml' &&
        $this->config['type'] != 'html') {
      $this->config['type'] = 'html';
    }

    if ($this->config['titleField'] != 'pagetitle' &&
        $this->config['titleField'] != 'longtitle' &&
        $this->config['titleField'] != 'menutitle') {
      $this->config['titleField'] = 'pagetitle';
    }

    // shorthand for XML sitemaps
    if ($this->config['type'] == 'xml') {
      $this->config['tplItem'] = 'sitemap_xml_item';
      $this->config['tplOuter'] = 'sitemap_xml_outer';
      $this->config['tplContainer'] = '';
      $this->config['urlScheme'] = 'full';
      $this->config['lastmodFormat'] = 'c';
    }

  }

  /**
   * Generate the entire site map.
   *
   * @access public
   * @return string The site map output, based on current configuration. Format
   * is entirely dependent on the chunks used.
   */
  public function run() {
    $this->parentTitles = array();
    $this->skipResources = array();
    $this->includeResources = array();
    $this->excludeChildrenOf = array();

    if (!$this->config['includeWebLinks']) {
      $this->queryWhere = array(
        'modResource.class_key:!=' => 'modWebLink',
      );
    }

    if (!empty($this->config['contexts'])) {
      $this->queryWhere['modResource.context_key:IN'] =
        $this->prepareList($this->config['contexts']);
    } else {
      $this->queryWhere['modResource.context_key'] =
        $this->modx->context->get('key');
    }

    if (!empty($this->config['onlyTemplates'])) {
      $this->queryWhere['Template.id:IN'] =
        $this->prepareList($this->config['onlyTemplates']);
    }

    if (!empty($this->config['skipTemplates'])) {
      $skipTemplates = $this->prepareList($this->config['skipTemplates'], true);
      $this->queryWhere[1] = '`Template`.`id` NOT IN (' . $skipTemplates . ')';
      unset($skipTemplates);
    }

    if (!empty($this->config['excludeResources'])) {
      $excludeResources =
        $this->prepareList($this->config['excludeResources']);
    } else {
      $excludeResources = array();
    }

    // exclude self
    $excludeResources[] = $this->modx->resource->get('id');
    $site_start = $this->modx->getOption('site_start');
    $error_page = $this->modx->getOption('error_page');
    if ($error_page && $error_page != $site_start) {
      $excludeResources[] = $error_page;
    }

    $unauthorized_page = $this->modx->getOption('unauthorized_page');
    if ($unauthorized_page && $unauthorized_page != $site_start) {
      $excludeResources[] = $unauthorized_page;
    }
    $site_unavailable_page = $this->modx->getOption('site_unavailable_page');
    if ($site_unavailable_page && $site_unavailable_page != $site_start) {
      $excludeResources[] = $site_unavailable_page;
    }

    if (!empty($excludeResources)) {
      $excludeResources = implode('", "', array_unique($excludeResources));
      $this->queryWhere[2] = '`modResource`.`id` NOT IN ("' .
        $excludeResources . '")';
    }
    unset($excludeResources);

    if (!empty($this->config['skipResources'])) {
      $this->skipResources = $this->prepareList($this->config['skipResources']);
    }

    if (!empty($this->config['excludeChildrenOf'])) {
      $this->excludeChildrenOf = $this->prepareList($this->config['excludeChildrenOf']);
    }

    if (!empty($this->config['includeResources'])) {
      $this->includeResources = $this->prepareList($this->config['includeResources']);
    } else {
      if (!$this->config['showUnpublished']) {
        $this->queryWhere['published'] = 1;
      }

      if (!$this->config['showDeleted']) {
        $this->queryWhere['deleted'] = 0;
      }

      if ($this->config['onlySearchable']) {
        $this->queryWhere['searchable'] = 1;
      }

      if (!$this->config['showHidden']) {
        $this->queryWhere['hidemenu'] = 0;
      }
    }

    $output = $this->runDeep($this->config['startId']);
    if (!empty($this->config['tplOuter'])) {
      $props = array(
        'startId' => $this->config['startId'],
        'items' => $output,
      );
      $output = $this->getChunk('tplOuter', $props);
      unset($props);
    }

    $this->parentTitles = array();
    $this->queryWhere = array();
    $this->skipResources = array();
    $this->includeResources = array();
    $this->excludeChildrenOf = array();

    return $output;
  }

  /**
   * Run the sitemapFriend generation, recursively.
   *
   * @access protected
   * @param integer $currentParent The current parent resource the iteration
   * is on.
   * @return string The generated output.
   */
  protected function runDeep($currentParent = 0, $depth = 0) {
    if ($this->config['maxDepth'] > 0 && $depth > $this->config['maxDepth']) {
      return '';
    }

    $output = '';

    /* build query */
    $c = $this->modx->newQuery('modResource');
    $c->leftJoin('modResource', 'Children');
    $c->select('`modResource`.*, COUNT(`Children`.`id`) AS `children`');

    /* if restricting to templates */
    if (!empty($this->config['onlyTemplates']) || !empty($this->config['skipTemplates'])) {
      $c->innerJoin('modTemplate', 'Template');
    }

    $c->where(array('parent' => $currentParent));
    $c->where($this->queryWhere);

    /* sorting/grouping */
    $c->sortby($this->config['sortBy'], $this->config['sortDir']);
    $c->groupby('modResource.id');

    /* get collection */
    $collection = $this->modx->getCollection('modResource', $c);
    unset($c);

    /* iterate */
    foreach ($collection as $child) {
      $id = $child->get('id');
      if (!empty($this->includeResources)) {
        if (!in_array($id, $this->includeResources) &&
            ((!$this->config['showUnpublished'] && !$child->get('published')) ||
            (!$this->config['showDeleted'] && $child->get('deleted')) ||
            ($this->config['onlySearchable'] && !$child->get('searchable')) ||
            (!$this->config['showHidden'] && $child->get('hidemenu')))) {
              continue;
        }
      }

      $children = $child->get('children');

      if ($this->config['parentTitles']) {
        if ($this->config['parentTitlesReversed']) {
          array_unshift($this->parentTitles, $this->getTitleField($child));
        } else {
          $this->parentTitles[] = $this->getTitleField($child);
        }
        $title = implode($this->config['titleSeparator'], $this->parentTitles);
      } else {
        $title = $this->getTitleField($child);
      }

      $props = array('items' => '');

      /* if children, recurse */
      if ($children > 0 && !in_array($id, $this->excludeChildrenOf)) {
        $props['items'] = $this->runDeep($id, $depth + 1);
      }

      // skip this resource if needed
      if (!in_array($id, $this->skipResources)) {
        $url = $this->modx->makeUrl($id, '', '', $this->config['urlScheme']);

        $lastmod = $child->get('editedon');
        if (!$lastmod) {
          $lastmod = $child->get('publishedon');
          if (!$lastmod) {
            $lastmod = $child->get('createdon');
          }
        }
        $lastmod = strtotime($lastmod);

        $props['parent'] = $currentParent;
        $props['id'] = $id;
        $props['url'] = $url;
        $props['lastmod'] = date($this->config['lastmodFormat'], $lastmod);
        $props['title'] = $title;

        if ($this->config['type'] == 'xml') {
          $datediff = floor((time() - $lastmod) / 86400);
          if ($datediff <= 1) {
            $priority = '1.0';
            $changefreq = 'daily';
          } else if (($datediff > 1) && ($datediff <= 7)) {
            $priority = '0.75';
            $changefreq = 'weekly';
          } else if (($datediff > 7) && ($datediff <= 30)) {
            $priority = '0.50';
            $changefreq = 'weekly';
          } else {
            $priority = '0.25';
            $changefreq = 'monthly';
          }
          $props['changefreq'] = $changefreq;
          $props['priority'] = $priority;
          // escape ampersand as per http://www.w3.org/TR/REC-xml/#syntax
          $props['title'] = preg_replace('/&/', '&', $props['title']);
        }

        $output .= $this->getChunk('tplItem', $props);
      } else {
        $output .= $props['items'];
      }

      if ($this->config['parentTitles']) {
        if ($this->config['parentTitlesReversed']) {
          array_shift($this->parentTitles);
        } else {
          array_pop($this->parentTitles);
        }
      }
    }
    unset($child, $collection);

    if ($depth > 0 && !empty($this->config['tplContainer'])) {
      $props = array(
        'depth' => $depth,
        'id' => $currentParent,
        'items' => $output,
      );
      $output = $this->getChunk('tplContainer', $props);
    }
    unset($props);

    return $output;
  }

  /**
   * Prepares a comma-separated list for a query.
   *
   * @access protected
   * @param string $str The comma-separated list to prepare.
   * @param boolean $resultAsString Tells if you want the list as a string. If
   * false, this method returns an array.
   * @return Array|string The prepared array, or the comma-separated string
   * prepared for the SQL query.
   */
  protected function prepareList($str, $resultAsString = false) {
    $arr = array_map('trim', explode(',', $str));
    if ($resultAsString) {
      return '"' . implode('", "', $arr) . '"';
    } else {
      return $arr;
    }
  }

  /**
   * Gets the titleField; falls back to the value of pagetitle.
   *
   * @author Jérôme Perrin
   * @access private
   * @param \modResource $resource The resource to get the title from.
   * @return string The title
   */
    private function getTitleField($resource) {
      $title_field = $resource->get($this->config['titleField']);
      if (empty($title_field)) {
        $title_field = $resource->get('pagetitle');
      }
      return $title_field;
    }

  /**
   * Gets a Chunk and caches it; also falls back to file-based templates
   * for easier debugging.
   *
   * @author Shaun McCormick
   * @access public
   * @param string $name The name of the Chunk
   * @param array $properties The properties for the Chunk
   * @return string The processed content of the Chunk
   */
  public function getChunk($name,$properties = array()) {
      $chunk = null;
      if (!isset($this->chunks[$name])) {
          $chunk = $this->modx->getObject('modChunk',array('name' => $this->config[$name]),true);
          if ($chunk == false) {
              $chunk = $this->_getTplChunk($this->config[$name]);
              if ($chunk == false) return false;
          }
          $this->chunks[$name] = $chunk->getContent();
      } else {
          $o = $this->chunks[$name];
          $chunk = $this->modx->newObject('modChunk');
          $chunk->setContent($o);
      }
      $chunk->setCacheable(false);
      return $chunk->process($properties);
  }

  /**
   * Returns a modChunk object from a template file.
   *
   * @author Shaun McCormick
   * @access private
   * @param string $name The name of the Chunk. Will parse to name.chunk.tpl
   * @param string $postFix The postfix to append to the name
   * @return modChunk/boolean Returns the modChunk object if found, otherwise
   * false.
   */
  private function _getTplChunk($name,$postFix = '.chunk.tpl') {
      $chunk = false;
      $f = $this->config['elements_path'].'chunks/'.strtolower($name).$postFix;
      if (file_exists($f)) {
          $o = file_get_contents($f);
          /* @var modChunk $chunk */
          $chunk = $this->modx->newObject('modChunk');
          $chunk->set('name',$name);
          $chunk->setContent($o);
      }
      return $chunk;
  }

}


text:
package com.iampfac.bleach.test.core.post;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

import com.iampfac.bleach.core.post.Post;

public class PostBuilder {

	private static AtomicLong counter = new AtomicLong();

	public static Post build() {
		final Long id = counter.incrementAndGet();
		Post post = new Post();
		post.setId(id);
		return post;
	}

	public static List<Post> build(final int size) {
		List<Post> posts = new ArrayList<Post>(size);
		for (int i = 0; i < size; ++i) {
			final Post post = build();
			posts.add(post);
		}
		return posts;
	}
}


text:
static const cv::Size frameSize(1280, 720);
static const double MIN_AREA = 0.0002 * frameSize.height * frameSize.width;
static const char* default_intrinsic_file = "jetson-camera-720.yml";

#ifdef XGUI_ENABLED
	#include "opencv2/highgui.hpp"
	static const cv::Size displaySize(640, 360);
	static const double displayRatio = double(displaySize.height) / frameSize.height;
	static const char* detection_window = "Object Detection";
#endif

void CheezyInRange(cv::cuda::GpuMat src, cv::Vec3i BlobLower, cv::Vec3i BlobUpper, cv::cuda::GpuMat dst) {
	cv::cuda::GpuMat channels[3];
	cv::cuda::split(src, channels);
	//threshold, reset to zero everything that is above the upper limit
	cv::cuda::threshold(channels[0], channels[0], BlobUpper[0], 255, cv::THRESH_TOZERO_INV);
	cv::cuda::threshold(channels[1], channels[1], BlobUpper[1], 255, cv::THRESH_TOZERO_INV);
	cv::cuda::threshold(channels[2], channels[2], BlobUpper[2], 255, cv::THRESH_TOZERO_INV);
	//threshold, reset to zero what is below the lower limit, otherwise to 255
	cv::cuda::threshold(channels[0], channels[0], BlobLower[0], 255, cv::THRESH_BINARY);
	cv::cuda::threshold(channels[1], channels[1], BlobLower[1], 255, cv::THRESH_BINARY);
	cv::cuda::threshold(channels[2], channels[2], BlobLower[2], 255, cv::THRESH_BINARY);
	//combine all three channels and collapse them into one B/W image (to channels[0])
	cv::cuda::bitwise_and(channels[0], channels[1], channels[0]);
	cv::cuda::bitwise_and(channels[0], channels[2], dst);
}

std::vector<cv::Point> FindCorners2(
		const std::vector<cv::Point> cont_one,
		cv::RotatedRect box,
		double dir=1)
{
	std::vector<cv::Point> ret(2, cv::Point(0,0));
	double maxLo = 0;
	double maxHi = 0;
	double r = dir * (box.size.height*box.size.height + box.size.width*box.size.width) / (2 * box.size.width);
	double alpha = CV_PI * box.angle / 180.0;
	cv::Matx22f rot(cos(alpha),-sin(alpha),sin(alpha),cos(alpha));
	cv::Point2f refHi = rot * cv::Point2f(r,  box.size.height/2) + box.center;
	cv::Point2f refLo = rot * cv::Point2f(r, -box.size.height/2) + box.center;
	for (cv::Point pnt : cont_one)
	{
		cv::Point2f lo = cv::Point2f(pnt) - refLo;
		double sLo = cv::norm(lo);
		if (sLo > maxLo) {
			maxLo = sLo;
			ret[1] = pnt;
		}

		cv::Point2f hi = cv::Point2f(pnt) - refHi;
		double sHi = cv::norm(hi);
		if (sHi > maxHi) {
			maxHi = sHi;
			ret[0] = pnt;
		}
	}
	return ret;
}

void righten(cv::RotatedRect &other)
{
	if (other.size.height < other.size.width) {
		std::swap(other.size.height, other.size.width);
		other.angle += 90.0;
	}
	other.angle = fmod(other.angle, 180.0);
	if (other.angle >  90.0) other.angle -= 180;
	if (other.angle < -90.0) other.angle += 180;
}

float rate2rects(cv::RotatedRect one, cv::RotatedRect two)
{
	static const float perf_height = 5.0 / 8.25;
	static const float perf_width  = 2.0 / 8.25;
	float acc = fabs(sin(CV_PI*one.angle/180.0)) + fabs(sin(CV_PI*two.angle/180.0));
	cv::Point2f bar = two.center - one.center;
	if(bar.x == 0) return 999999;
	acc += fabs(bar.y/bar.x);
	float bar_len = cv::norm(bar);
	acc += fabs(one.size.height / bar_len - perf_height);
	acc += fabs(one.size.width  / bar_len - perf_width);
	acc += fabs(two.size.height / bar_len - perf_height);
	acc += fabs(two.size.width  / bar_len - perf_width);
	acc += fabs((one.size.height - two.size.height) / bar_len);
	return acc;
}

float rate3rects(cv::RotatedRect one, cv::RotatedRect two, cv::RotatedRect three)
{
	float acc = 0;
//	cv::Point2f pole = three.center - two.center;
//	if (pole.y == 0) return 99999;
//	acc += fabs(pole.x / pole.y);
	cv::Point2f pts[8];
	two.points(pts);
	three.points(pts+4);
	std::vector<cv::Point2f> new_points;
	new_points.reserve(8);
	for(size_t i=0; i<8; ++i) new_points.push_back(pts[i]);
	cv::RotatedRect other = cv::minAreaRect(new_points);
	righten(other);
	acc += rate2rects(one, other);
	return acc;
}

std::string date_now()
{
    std::time_t result = std::time(nullptr);
    return std::string(std::asctime(std::localtime(&result)));
}

bool readIntrinsics(const char *filename, cv::Mat &intrinsic, cv::Mat &distortion)
{
	cv::FileStorage fs( filename, cv::FileStorage::READ );
	if( !fs.isOpened() )
	{
		std::cerr << date_now() << " Error: Couldn't open intrinsic parameters file "
				<< filename << std::endl;
		return false;
	}
	fs["camera_matrix"] >> intrinsic;
	fs["distortion_coefficients"] >> distortion;
	if( intrinsic.empty() || distortion.empty() )
	{
		std::cerr <<date_now() << " Error: Couldn't load intrinsic parameters from "
				<< filename << std::endl;
		return false;
	}
	fs.release();
	return true;
}

bool initCamera(cv::VideoCapture &capture)
{
	for(int i = 0; i < 12; ++i) {
		std::ostringstream capturePipe;
	#ifdef ICS_CAMERA_PRESENT
		capturePipe << "nvcamerasrc ! video/x-raw(memory:NVMM)"
			<< ", width=(int)" << frameSize.width
			<< ", height=(int)" << frameSize.height
			<< ", format=(string)I420, framerate=(fraction)30/1 ! "
			<< "nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! "
			<< "videoconvert ! video/x-raw, format=(string)BGR ! appsink";
	#else
		capturePipe << "NoCSIcamera";
	#endif
		if(!capture.open(capturePipe.str())) {
			capture.open(1);
			capture.set(cv::CAP_PROP_FRAME_WIDTH, frameSize.width);
			capture.set(cv::CAP_PROP_FRAME_HEIGHT, frameSize.height);
			capture.set(cv::CAP_PROP_FPS, 7.5);
			capture.set(cv::CAP_PROP_AUTO_EXPOSURE, 0.25); // Magic! 0.25 means manual exposure, 0.75 = auto
			capture.set(cv::CAP_PROP_EXPOSURE, 0);
			capture.set(cv::CAP_PROP_BRIGHTNESS, 0.5);
			capture.set(cv::CAP_PROP_CONTRAST, 0.5);
			capture.set(cv::CAP_PROP_SATURATION, 0.5);
		}
		if(capture.isOpened()) {
			std::this_thread::sleep_for(std::chrono::seconds(2));
			std::cerr << date_now() << " Camera connected. Resolution: "<< capture.get(cv::CAP_PROP_FRAME_WIDTH)
								<< "x" << capture.get(cv::CAP_PROP_FRAME_HEIGHT) << std::endl;
			return true;
		}
		std::cerr << date_now() << " Couldn't connect to camera.. sleeping [" << i << "]" << std::endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
	}
}

int main(int argc, const char** argv)
{
	const char* intrinsic_file = default_intrinsic_file;
	if(argc > 1) intrinsic_file = argv[1];

	cv::Mat intrinsic, distortion;
	if(!readIntrinsics(intrinsic_file, intrinsic, distortion)) return -1;

	NetworkTable::SetClientMode();
	NetworkTable::SetTeam(3130);
	std::shared_ptr<NetworkTable> table = NetworkTable::GetTable("/Jetson");

	cv::Mat frame, filtered, display;
	cv::cuda::GpuMat gpuC, gpu1, gpu2;
	static cv::Vec3i BlobLower(66, 200,  30);
	static cv::Vec3i BlobUpper(94, 255, 255);
	static int dispMode = 0; // 0: none, 1: bw, 2: color

	cv::Vec3d camera_offset(-13.0, -4.0, 0.0);

	static std::vector<cv::Point3f> realPoints;
	realPoints.push_back(cv::Point3f(-5.125,-2.5, 10.5)); // Top left
	realPoints.push_back(cv::Point3f(-5.125, 2.5, 10.5)); // Bottom Left
	realPoints.push_back(cv::Point3f( 5.125,-2.5, 10.5)); // Top right
	realPoints.push_back(cv::Point3f( 5.125, 2.5, 10.5)); // Bottom right

	cv::VideoCapture capture;
	if(! initCamera(capture)) return 1;

#ifdef XGUI_ENABLED
	cv::namedWindow(detection_window, cv::WINDOW_NORMAL);
	cv::createTrackbar("Lo H",detection_window, &BlobLower[0], 255);
	cv::createTrackbar("Hi H",detection_window, &BlobUpper[0], 255);
	cv::createTrackbar("Lo S",detection_window, &BlobLower[1], 255);
	cv::createTrackbar("Hi S",detection_window, &BlobUpper[1], 255);
	cv::createTrackbar("Lo V",detection_window, &BlobLower[2], 255);
	cv::createTrackbar("Hi V",detection_window, &BlobUpper[2], 255);
#endif

	int elemSize(5);
	cv::Mat element = getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(elemSize+1,elemSize+1));
	cv::Ptr<cv::cuda::Filter> erode = cv::cuda::createMorphologyFilter(cv::MORPH_ERODE, gpu1.type(), element);
	cv::Ptr<cv::cuda::Filter> dilate = cv::cuda::createMorphologyFilter(cv::MORPH_DILATE, gpu1.type(), element);

	gpu1.create(frameSize, CV_8UC1);
	gpu2.create(frameSize, CV_8UC1);

	int nofEmpty = 0;
	for(;;) {
		capture >> frame;
		if (frame.empty()) {
			std::cerr << date_now() << " Error reading from camera, empty frame." << std::endl;
			std::this_thread::sleep_for(std::chrono::seconds(2));
			if(nofEmpty++ > 10) {
				nofEmpty = 0;
				if( ! initCamera(capture) ) return 1;
			}
			continue;
		}
		gpuC.upload(frame);
		cv::cuda::cvtColor(gpuC, gpuC, CV_BGR2HSV);
		CheezyInRange(gpuC, BlobLower, BlobUpper, gpu1);
		erode->apply(gpu1, gpu2);
		dilate->apply(gpu2, gpu1);

		gpu1.download(filtered);

#ifdef XGUI_ENABLED
		switch(dispMode) {
		case 1:
			cv::resize(filtered, display, displaySize);
			break;
		case 2:
			cv::resize(frame, display, displaySize);
			break;
		}
#endif

		std::vector<std::vector<cv::Point>> contours;
		cv::findContours(filtered, contours, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);

		std::vector<cv::Point> cont_one[3];
		cv::RotatedRect rect_one[3];
		float biggest[3] = {0,0,0};
		for (std::vector<cv::Point> cont : contours)
		{
			cv::RotatedRect rect = cv::minAreaRect(cont);
			float area = rect.size.height * rect.size.width;
			if (area < MIN_AREA) continue;
			righten(rect);

			if (area > biggest[0]) {
				cont_one[2] = cont_one[1];
				cont_one[1] = cont_one[0];
				cont_one[0] = cont;
				rect_one[2] = rect_one[1];
				rect_one[1] = rect_one[0];
				rect_one[0] = rect;
				biggest[2] = biggest[1];
				biggest[1] = biggest[0];
				biggest[0] = area;
			}
			else if (area > biggest[1]) {
				cont_one[2] = cont_one[1];
				cont_one[1] = cont;
				rect_one[2] = rect_one[1];
				rect_one[1] = rect;
				biggest[2] = biggest[1];
				biggest[1] = area;
			}
			else if (area > biggest[2]) {
				cont_one[2] = cont;
				rect_one[2] = rect;
				biggest[2] = area;
			}
		}

		table->PutNumber("Peg Sys Time", cv::getTickCount() / cv::getTickFrequency());
		if (biggest[0] > 0 && biggest[1] > 0) {
			cv::RotatedRect lRect, rRect;
			std::vector<cv::Point> lCont, rCont;
			float mscore = 999999;

			if(biggest[2] > 0) {
				for(size_t i=0; i < 3; ++i) {
					float score = rate2rects(rect_one[i], rect_one[(i+1)%3]);
					if(score < mscore) {
						mscore = score;
						lRect = rect_one[i];
						lCont = cont_one[i];
						rRect = rect_one[(i+1)%3];
						rCont = cont_one[(i+1)%3];
					}
				}
				for(size_t i=0; i < 3; ++i) {
					float score = rate3rects(rect_one[i], rect_one[(i+1)%3], rect_one[(i+2)%3]);
					if(score < mscore) {
						mscore = score;
						lRect = rect_one[i];
						lCont = cont_one[i];
						rCont = cont_one[(i+1)%3];
						rCont.reserve(rCont.size() + cont_one[(i+2)%3].size());
						rCont.insert(rCont.end(), cont_one[(i+2)%3].begin(), cont_one[(i+2)%3].end());
						rRect = cv::minAreaRect(rCont);
						righten(rRect);
					}
				}
			}
			else {
				lRect = rect_one[0];
				lCont = cont_one[0];
				rRect = rect_one[1];
				rCont = cont_one[1];
			}

			if (lRect.center.x > rRect.center.x) {
				std::swap(lRect, rRect);
				std::swap(lCont, rCont);
			}

			std::vector<cv::Point> lCorn = FindCorners2(lCont, lRect,  1);
			std::vector<cv::Point> rCorn = FindCorners2(rCont, rRect, -1);
			std::vector<cv::Point2f> imagePoints;
			imagePoints.push_back(lCorn[0]);
			imagePoints.push_back(lCorn[1]);
			imagePoints.push_back(rCorn[0]);
			imagePoints.push_back(rCorn[1]);

			cv::Vec3d rvec, tvec, lvec;
			cv::Matx33d rmat;

			cv::solvePnP(
					realPoints,       // 3-d points in object coordinate
					imagePoints,        // 2-d points in image coordinates
					intrinsic,           // Our camera matrix
					distortion,
					rvec,                // Output rotation *vector*.
					tvec                 // Output translation vector.
			);
			cv::Rodrigues(rvec, rmat);
			// tvec is where the target is in the camera coordinates
			// We offset it with the camera_offset vector and rotate opposite to the target's rotation
			lvec = rmat.t() * -(tvec + camera_offset);

			table->PutNumber("Peg Crossrange", lvec[0]);
			table->PutNumber("Peg Downrange", -lvec[2]); // Robot is in negative Z area. We expect positive down range
			table->PutNumber("Peg Yaw", atan2(tvec[0],tvec[2]));
			table->PutNumber("Peg Time", cv::getTickCount() / cv::getTickFrequency());

#ifdef XGUI_ENABLED
			cv::Point dispTarget = cv::Point(
					0.5*displaySize.width  + (displaySize.height/150)*tvec[0],
					0.9*displaySize.height - (displaySize.height/150)*tvec[2]
					);
			cv::Vec3d peg = rmat.t() * (tvec + camera_offset);
			cv::Point peg2D = displaySize.height/10 * (cv::Point2d(peg[0],peg[2]) / cv::norm(peg));
			if (dispMode == 2) {
				cv::line(display, imagePoints[0] * displayRatio, imagePoints[1] * displayRatio, cv::Scalar(200, 0, 255), 1, cv::LINE_AA);
				cv::line(display, imagePoints[1] * displayRatio, imagePoints[3] * displayRatio, cv::Scalar(200, 0, 255), 1, cv::LINE_AA);
				cv::line(display, imagePoints[3] * displayRatio, imagePoints[2] * displayRatio, cv::Scalar(200, 0, 255), 1, cv::LINE_AA);
				cv::line(display, imagePoints[2] * displayRatio, imagePoints[0] * displayRatio, cv::Scalar(200, 0, 255), 1, cv::LINE_AA);

				cv::circle(display, lCorn[0]*displayRatio, 8, cv::Scalar(0,125,255), 1);
				cv::circle(display, lCorn[1]*displayRatio, 8, cv::Scalar(0,0,255), 1);
				cv::circle(display, rCorn[0]*displayRatio, 8, cv::Scalar(125,255,0), 1);
				cv::circle(display, rCorn[1]*displayRatio, 8, cv::Scalar(0,255,0), 1);

				cv::line(display,
						dispTarget,
						cv::Point(displaySize.width/2,displaySize.height*0.9),
						cv::Scalar(0,255,255));
				cv::line(display,
						dispTarget,
						dispTarget - peg2D,
						cv::Scalar(0,0,255));
				std::ostringstream oss;
				oss << "Yaw:  " << 180.0*atan2(tvec[0],tvec[2])/CV_PI << " (" << rvec[0] << " : " << rvec[1] << " : " << rvec[2] << ")";
				cv::putText(display, oss.str(), cv::Point(20,20), 0, 0.33, cv::Scalar(0,200,200));
				std::ostringstream oss1;
				oss1 << "Downrange: " << lvec[2];
				cv::putText(display, oss1.str(), cv::Point(20,40), 0, 0.33, cv::Scalar(0,200,200));
				std::ostringstream oss2;
				oss2 << "Crossrange: " << lvec[0];
				cv::putText(display, oss2.str(), cv::Point(20,60), 0, 0.33, cv::Scalar(0,200,200));
			}
#endif
		}

#ifdef XGUI_ENABLED
		if (dispMode > 0) {
			cv::imshow(detection_window, display);
		}

		int key = cv::waitKey(20);
		if ((key & 255) == 27) break;
		if ((key & 255) == 32) {
			if(++dispMode > 2) dispMode =0;
		}
		if ((key & 255) == 's') cv::waitKey(0);
#endif
	}
	return 0;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mbean PUBLIC
   "-//JBoss//DTD JBOSS XMBEAN 1.1//EN"
   "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_1.dtd">

<mbean>
   <description>File System Management Service. Specifies the location of
file systems in which DICOM objects received from the Store SCP Server
are stored. You can also set up rules to delete the most infrequently
accessed studies.</description>

   <descriptors>
      <persistence persistPolicy="OnUpdate"/>
      <persistence-manager value="org.jboss.mx.persistence.DelegatingPersistenceManager" />
   </descriptors>

   <class>org.dcm4chex.archive.mbean.FileSystemMgtService</class>

   <constructor>
      <description>The default constructor</description>
      <name>FileSystemMgtService</name>
   </constructor>

   <attribute access="read-write"
      getMethod="getDirectoryPathList"
      setMethod="setDirectoryPathList">
      <description>List directories (mount points) on this DICOM node.
      To separate multiple directories, use ; (semi-colon) on Windows and
      : (colon) on UNIX-like platforms. Relative path names are
      resolved relative to the archive-install-directory/server/pacs/.
      To mark the directory used for storage of newly received DICOM Instances
      by the Storage SCP on this DICOM node,
      add * (asterisk) to the end of the directory path name.
      </description>
      <name>DirectoryPaths</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="archive*" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getReadOnlyDirectoryPathList"
      setMethod="setReadOnlyDirectoryPathList">
      <description>List read-only directories (mount points) on this
      DICOM node. To separate multiple directories, use ; (semi-colon) on Windows and
      : (colon) on UNIX-like platforms. Relative path names are
      resolved relative to the archive-install-directory/server/pacs/.
      NONE = no read-only directory or mount point.
      </description>
      <name>ReadOnlyDirectoryPaths</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="NONE" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getRetrieveAET"
      setMethod="setRetrieveAET">
      <description>Retrieve AE titles associated with this DICOM Node.
      </description>
      <name>RetrieveAETitles</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="PACS_TIANI" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getMinFreeDiskSpace"
      setMethod="setMinFreeDiskSpace">
      <description><![CDATA[Minimum free disk space.
      The storage directory, or cache, switches to the next entry in
      Directory Paths, if the amount of free disk space falls below this value.
      1MB = 1000000 bytes, 1GB = 1000MB.]]>
      </description>
      <name>MinimumFreeDiskSpace</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="50MB" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getMountFailedCheckFile"
      setMethod="setMountFailedCheckFile">
      <description>If the specified file exists, this signals a failed mount.
      </description>
      <name>MountFailedCheckFile</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="NO_MOUNT" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="isMakeStorageDirectory"
      setMethod="setMakeStorageDirectory">
      <description>Make a storage directory, or cache, if one does not already exist.
      </description>
      <name>MakeStorageDirectory</name>
      <type>boolean</type>
      <descriptors>
         <value value="true" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getFreeDiskSpaceLowerThreshold"
      setMethod="setFreeDiskSpaceLowerThreshold">
      <description>Defines lower threshold of free disk space for
          deleting the most infrequently accessed studies.
          If the average free disk space on the storage directories falls below
          MinimumFreeDiskSpace x FreeDiskSpaceLowerThreshold, the most
          infrequently accessed studies are deleted.
      </description>
      <name>FreeDiskSpaceLowerThreshold</name>
      <type>float</type>
      <descriptors>
         <value value="1.5" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getFreeDiskSpaceUpperThreshold"
      setMethod="setFreeDiskSpaceUpperThreshold">
      <description>Defines the upper threshold of free disk space for
          deleting the most infrequently accessed studies.
          The most infrequently accessed studies are deleted until the
          average free disk space on the storage directories exceeds
          MinimumFreeDiskSpace x FreeDiskSpaceUpperThreshold.
      </description>
      <name>FreeDiskSpaceUpperThreshold</name>
      <type>float</type>
      <descriptors>
         <value value="2.0" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="isFlushStudiesExternalRetrievable"
      setMethod="setFlushStudiesExternalRetrievable">
      <description>Enables deletion of studies in local cache if the studies
      are retrieveable from an external Retrieve AE. Database entries for
      the studies are not removed.
      </description>
      <name>DeleteStudiesExternallyRetrievable</name>
      <type>boolean</type>
      <descriptors>
         <value value="false" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="isFlushStudiesOnMedia"
      setMethod="setFlushStudiesOnMedia">
      <description>Enables the deletion studies in local cache that are
      stored on media (offline storage). Database entries for the studies are not
      be removed.
      </description>
      <name>DeleteLocalStudiesStoredOnMedia</name>
      <type>boolean</type>
      <descriptors>
         <value value="false" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="isDeleteStudiesStorageNotCommited"
      setMethod="setDeleteStudiesStorageNotCommited">
      <description>Enables deletion of the most infrequently accessed studies for
          which no storage commitment request was received. Enabling this feature
          deletes the studies and the database entries, so the study is completely
          removed from the system. We recommend extreme caution
          when using this feature.
      </description>
      <name>DeleteStudiesFromSystem</name>
      <type>boolean</type>
      <descriptors>
         <value value="false" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getStudyCacheTimeout"
      setMethod="setStudyCacheTimeout">
      <description><![CDATA[Defines how long a study is not accessed before it will
      be deleted from cache if it matches one of the configured conditions:
      Delete Studies Externally Retrievable, Delete Studies On Media, or
      Delete Studies from System.

Format:

##h (in hours) | ##d (in days) | ##w (in weeks) | NEVER

NEVER = deletion of studies is only triggered by running out of disk space.

Example:

52w = any studies that have not been accessed for 52 weeks or more can be
      deleted if they match the preconfigured conditions.]]>
      </description>
      <name>StudyAgeForDeletion</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="NEVER" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getPurgeFilesInterval"
      setMethod="setPurgeFilesInterval">
      <description>Interval in which unreferenced files are deleted. The
      Delete Files Interval must be less than the Free Disk Space Interval.
      Format: ##s (in seconds), ##m (in minutes), ##h (in hours)
      NEVER = never delete unreferenced files.
      </description>
      <name>DeleteFilesInterval</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="1m" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getLimitNumberOfFilesPerTask"
      setMethod="setLimitNumberOfFilesPerTask">
      <description>Limit the number of unreferenced files that are deleted in one
      delete task.</description>
      <name>DeleteFilesLimit</name>
      <type>int</type>
      <descriptors>
         <value value="1000" />
      </descriptors>
   </attribute>

   <attribute access="read-write"
      getMethod="getFreeDiskSpaceInterval"
      setMethod="setFreeDiskSpaceInterval">
      <description>Interval in which free disk space checked to
      see whether the deletion of the most infrequently accessed
      studies should be triggered. The Free Disk Space Interval must be
      greater than Delete Files Interval.
      Format: ##s (in seconds), ##m (in minutes), ##h (in hours).
      NEVER = do not delete of studies.
      </description>
      <name>FreeDiskSpaceInterval</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="NEVER" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="isFreeDiskSpaceOnDemand"
      setMethod="setFreeDiskSpaceOnDemand">
      <description>Enables the "free disk space on demand" feature.
    Services such as the StorageSCP use this flag to permit or omit
    the call of free disk space after their work.
      </description>
      <name>FreeDiskSpaceOnDemand</name>
      <type>boolean</type>
      <descriptors>
         <value value="true" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="isPurgeFilesAfterFreeDiskSpace"
      setMethod="setPurgeFilesAfterFreeDiskSpace">
      <description>Enables deletion of files after free disk space has processed.
      </description>
      <name>DeleteFilesAfterFreeDiskSpace</name>
      <type>boolean</type>
      <descriptors>
         <value value="true" />
      </descriptors>
   </attribute>

   <attribute access="read-write"
      getMethod="getEjbProviderURL"
      setMethod="setEjbProviderURL">
      <description>Identifies JNDI (e.g: jnp://hostname:1099) with EJBs.
      "LOCAL", if EJBs are deployed in same JBoss instance.
      </description>
      <name>EJBProviderURL</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="LOCAL" />
      </descriptors>
   </attribute>
   &defaultAttributes;

   &defaultOperations;
   <operation impact="INFO">
      <description>Determines if the specified directory or mount point is
      accessible on this DICOM node</description>
      <name>isLocalFileSystem</name>
      <parameter>
        <description>Directory Path</description>
        <name>DirPath</name>
        <type>java.lang.String</type>
      </parameter>
      <return-type>boolean</return-type>
   </operation>
   <operation impact="INFO">
      <description>Used internally</description>
      <name>fileSystemDirPaths</name>
      <return-type>[Ljava.lang.String;</return-type>
   </operation>
   <operation impact="INFO">
      <description>Show free disk space on the local directories or mount points.</description>
      <name>showAvailableDiskSpace</name>
      <return-type>java.lang.String</return-type>
   </operation>
   <operation impact="INFO">
      <description>Select the storage directory or mount point
      where the free disk space is less than the Minimum Free Disk Space</description>
      <name>selectStorageFileSystem</name>
      <return-type>org.dcm4chex.archive.mbean.FileSystemInfo</return-type>
   </operation>
   <operation impact="ACTION">
      <description>Purge unreferenced Files</description>
      <name>purgeFiles</name>
      <return-type>void</return-type>
   </operation>
   <operation impact="ACTION">
      <description>Delete unreferenced files on specific directories or mount points.</description>
      <name>purgeFiles</name>
      <parameter>
        <description>Directory path of filesystem.
        			Delete all directories or mount points if the parameter is null.
        </description>
        <name>purgeDirPath</name>
        <type>java.lang.String</type>
      </parameter>
      <return-type>void</return-type>
   </operation>
   <operation impact="INFO">
      <description>Locate SOP Instance. Return a File object, if the instance
      is locally available, or the hostname as String object if a file
      of the instance is located on another host.</description>
      <name>locateInstance</name>
      <parameter>
        <description>SOP Instance UID</description>
        <name>iuid</name>
        <type>java.lang.String</type>
      </parameter>
      <return-type>java.lang.Object</return-type>
   </operation>
   <operation impact="INFO">
      <description>Locate SOP Instance. Return a Dataset object, if the instance
      is locally available. The attributes of the dataset are updated with the attributes from database.</description>
      <name>getDatasourceOfInstance</name>
      <parameter>
        <description>SOP Instance UID</description>
        <name>iuid</name>
        <type>java.lang.String</type>
      </parameter>
      <return-type>org.dcm4che.net.DataSource</return-type>
   </operation>
   <operation impact="INFO">
      <description>Check if it is necessary to free disk space.
      </description>
      <name>checkFreeDiskSpaceNecessary</name>
      <return-type>boolean</return-type>
   </operation>
   <operation impact="ACTION">
      <description>Free disk space by deleting old studies.
      Deletes all older files on study level that fullfill the freeDiskSpacePolicy.
      </description>
      <name>freeDiskSpace</name>
      <return-type>long</return-type>
   </operation>

</mbean>


text:
import React from "react";
import { t } from "../i18next_wrapper";
import { TaggedSensor } from "farmbot";
import { Content } from "../constants";
import { readPin } from "../devices/actions";
import { isBotOnlineFromState } from "../devices/must_be_online";
import { error } from "../toast/toast";
import { ToolVerificationProps } from "./interfaces";

const toolStatus = (value: number | undefined): string => {
  switch (value) {
    case 1: return t("disconnected");
    case 0: return t("connected");
    default: return t("unknown");
  }
};

export const ToolVerification = (props: ToolVerificationProps) => {
  const toolVerificationSensor =
    props.sensors.filter(sensor => sensor.body.label.toLowerCase()
      .includes("tool verification"))[0] as TaggedSensor | undefined;
  const toolVerificationPin = toolVerificationSensor
    ? toolVerificationSensor.body.pin || 63
    : 63;
  const pins = props.bot.hardware.pins;
  const pinData = pins[toolVerificationPin];
  const toolVerificationValue = pinData ? pinData.value : undefined;
  const arduinoBusy = !!props.bot.hardware.informational_settings.busy;
  const botOnline = isBotOnlineFromState(props.bot);
  return

{t("status")}: {toolStatus(toolVerificationValue)}

    <button
      className={`fb-button yellow ${botOnline ? "" : "pseudo-disabled"}`}
      disabled={arduinoBusy}
      title={botOnline ? "" : t(Content.NOT_AVAILABLE_WHEN_OFFLINE)}
      onClick={() => botOnline
        ? readPin(toolVerificationPin,
          `pin${toolVerificationPin}`, 0)
        : error(t(Content.NOT_AVAILABLE_WHEN_OFFLINE))}>
      {t("verify")}
    </button>

;
};


text:
<title>Zend Framework API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link>

API Documentation

Feed/Writer/Extension/RendererInterface.php

Global

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to padraic dot brady at yahoo dot com so we can send you a copy immediately.

category

Zend

copyright

Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

license

New BSD License

package

Zend_Feed_Writer

version

$Id: RendererInterface.php 23775 2011-03-01 17:25:24Z ralph $

\Zend_Feed_Writer_Extension_RendererInterface
jump to top

category

Zend

copyright

Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

license

New BSD License

package

Zend_Feed_Writer

Methods

__construct(
          mixed $container
          )

        :
          void

Constructor

Parameters

Name
Type
Description

$container
mixed

getDataContainer(

          )

        :
          mixed

Retrieve container

Returns

Type
Description

mixed

render(

          )

        :
          void

Render

setDomDocument(
          \DOMDocument $dom, \DOMElement $base
          )

        :
          void

Set DOMDocument and DOMElement on which to operate

Parameters

Name
Type
Description

$dom
\DOMDocument

$base
\DOMElement

Documentation was generated by DocBlox 0.13.3.


text:
                {{idea.usuario}}
                {{idea.usuario}} compartida de: {{idea.usuarioOriginal}}

                Publicada: {{idea.fechaCreacion | date:"dd/MM/yyyy"}}

{{idea.contenido}}

Tags: {{tags}}

 0" class="col-xs-4">Lights: {{idea.lights}}

Lights: {{idea.lights}}

 0" class="col-xs-4">Comentarios: {{idea.comentarios}}

Comentarios: {{idea.comentarios}}

Detalles

<button type="button" (click)="light()" class="btn btn-default btn-block" [style.backgroundColor]="(idea.isLight)? '#BBE3EF' : 'Transparent'">
             Light</button>

<button type="button" (click)="comentar()" class="btn btn-default btn-block">
             Comentar</button>

<button type="button" [disabled]="username.toLowerCase() == idea.usuario.toLowerCase() || idea.tipo == 'PR'
            || (idea.usuarioOriginal && idea.usuarioOriginal.toLowerCase() == username.toLowerCase())" class="btn btn-default btn-block"
            (click)="compartir()">
             Compartir</button>


text:
#include "session.h"
#include "transaction.h"

#include "storage/integer.h"
#include "database.h"
#include "set.h"
#include "unitutilities.h"

#include "CUnit/Basic.h"

void test_ensure_transaction(void)
{
    int created = 0;
    struct obl_database *d = obl_open_defdatabase(NULL);
    struct obl_session *s = obl_create_session(d);
    struct obl_transaction *t, *same;

    CU_ASSERT(s->current_transaction == NULL);

    t = obl_ensure_transaction(s, &created);
    CU_ASSERT(t != NULL);
    CU_ASSERT(created == 1);
    CU_ASSERT(s->current_transaction == t);
    obl_abort_transaction(t);

    CU_ASSERT(s->current_transaction == NULL);

    t = obl_begin_transaction(s);
    CU_ASSERT(s->current_transaction == t);
    created = 0;
    same = obl_ensure_transaction(s, &created);
    CU_ASSERT(created == 0);
    CU_ASSERT(same == t);
    obl_abort_transaction(t);

    obl_destroy_session(s);
    obl_close_database(d);
}

void test_mark_dirty(void)
{
    struct obl_database *d = obl_open_defdatabase(NULL);
    struct obl_session *s = obl_create_session(d);
    struct obl_transaction *t;
    struct obl_object *o;

    o = obl_create_integer(42);
    CU_ASSERT(o->session == NULL);

    /*
     * Without a session or a transaction, obl_mark_dirty should be a no-op.
     * Basically, these calls shouldn't segfault.
     */
    obl_mark_dirty(o);
    o->session = s;
    o->logical_address = 200;
    o->physical_address = 1024;
    obl_mark_dirty(o);

    t = obl_begin_transaction(s);
    obl_mark_dirty(o);

    CU_ASSERT(obl_set_includes(t->write_set, o));
    CU_ASSERT(!obl_set_includes(s->read_set, o));

    obl_abort_transaction(t);

    obl_destroy_object(o);
    obl_destroy_session(s);
    obl_close_database(d);
}

void test_simple_commit(void)
{
    struct obl_database *d = obl_open_defdatabase(NULL);
    struct obl_session *s = obl_create_session(d);
    struct obl_transaction *t;
    struct obl_object *o;

    t = obl_begin_transaction(s);

    o = obl_create_integer(-400);
    o->session = s;
    o->logical_address = 100;
    o->physical_address = 256;
    obl_mark_dirty(o);

    obl_commit_transaction(t);
    CU_ASSERT(readable_logical(d->content[256]) == OBL_INTEGER_SHAPE_ADDR);
    CU_ASSERT(readable_int(d->content[257]) == (obl_int) -400);

    obl_destroy_object(o);
    obl_destroy_session(s);
    obl_close_database(d);
}

void test_object_discovery(void)
{
    struct obl_database *d = obl_open_defdatabase(NULL);
    struct obl_session *s = obl_create_session(d);
    struct obl_transaction *t;

    struct obl_object *root_shape, *root;
    struct obl_object *one_shape, *one, *a, *b;
    struct obl_object *two;

    char *root_slots[] = { "one", "two" };
    char *one_slots[] = { "a", "b" };

    t = obl_begin_transaction(s);

    root_shape = obl_create_cshape("RootClass", 2, root_slots, OBL_SLOTTED);
    root = obl_create_slotted(root_shape);

    one_shape = obl_create_cshape("OneClass", 2, one_slots, OBL_SLOTTED);
    one = obl_create_slotted(one_shape);

    a = obl_create_cstring("A", 1);
    b = obl_create_integer(42);

    two = obl_create_cstring("b", 1);

    obl_slotted_atcnamed_put(one, "a", a);
    obl_slotted_atcnamed_put(one, "b", b);
    obl_slotted_atcnamed_put(root, "one", one);
    obl_slotted_atcnamed_put(root, "two", two);

    /* Fake the insertion of root. */
    root->session = s;
    obl_mark_dirty(root);

    CU_ASSERT(one->physical_address == OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(a->physical_address == OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(b->physical_address == OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(two->physical_address == OBL_PHYSICAL_UNASSIGNED);

    obl_commit_transaction(t);

    CU_ASSERT(one->physical_address != OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(one->logical_address != OBL_LOGICAL_UNASSIGNED);
    CU_ASSERT(one->session == s);
    CU_ASSERT(a->physical_address != OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(a->logical_address != OBL_LOGICAL_UNASSIGNED);
    CU_ASSERT(a->session == s);
    CU_ASSERT(b->physical_address != OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(b->logical_address != OBL_LOGICAL_UNASSIGNED);
    CU_ASSERT(b->session == s);
    CU_ASSERT(two->physical_address != OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(two->logical_address != OBL_LOGICAL_UNASSIGNED);
    CU_ASSERT(two->session == s);
    CU_ASSERT(root_shape->physical_address != OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(root_shape->logical_address != OBL_LOGICAL_UNASSIGNED);
    CU_ASSERT(root_shape->session == s);
    CU_ASSERT(one_shape->physical_address != OBL_PHYSICAL_UNASSIGNED);
    CU_ASSERT(one_shape->logical_address != OBL_LOGICAL_UNASSIGNED);
    CU_ASSERT(one_shape->session == s);

    CU_ASSERT(obl_set_includes(s->read_set, one));
    CU_ASSERT(obl_set_includes(s->read_set, two));
    CU_ASSERT(obl_set_includes(s->read_set, a));
    CU_ASSERT(obl_set_includes(s->read_set, b));
    CU_ASSERT(obl_set_includes(s->read_set, root_shape));
    CU_ASSERT(obl_set_includes(s->read_set, one_shape));

    CU_ASSERT(obl_nil()->session == NULL);
    CU_ASSERT(! obl_set_includes(s->read_set, obl_nil()));

    obl_destroy_session(s);
    obl_close_database(d);
}

void test_auto_mark_dirty(void)
{
    struct obl_database *d = obl_open_defdatabase(NULL);
    struct obl_session *s = obl_create_session(d);
    struct obl_transaction *t;

    struct obl_object *root_shape;
    char *slots[] = { "one", "two" };
    struct obl_object *root, *one, *two;

    root_shape = obl_create_cshape("RootShape", 2, slots, OBL_SLOTTED);

    /* Fake-persist the root object and its shape. */
    root = obl_create_slotted(root_shape);
    t = obl_begin_transaction(s);
    root->session = s;
    obl_mark_dirty(root);
    obl_commit_transaction(t);

    /*
     * Put a new object into one of root's slots without an active transaction.
     * This should occur within its own implicit transaction.
     */
    one = obl_create_integer(12);
    CU_ASSERT(one->session == NULL);
    obl_slotted_atcnamed_put(root, "one", one);
    CU_ASSERT(one->session == s);

    /*
     * Put a new object into another slot while there is an active transaction.
     * This should add root to the transaction's write set, but the new
     * object should not be persisted until the transaction commits.
     */
    t = obl_begin_transaction(s);

    two = obl_create_integer(42);
    obl_slotted_atcnamed_put(root, "two", two);
    CU_ASSERT(two->session == NULL);
    CU_ASSERT(obl_set_includes(t->write_set, root));

    obl_commit_transaction(t);
    CU_ASSERT(two->session == s);

    obl_destroy_session(s);
    obl_close_database(d);
}

void test_refresh_object(void)
{
    struct obl_database *d = obl_open_defdatabase(NULL);
    struct obl_session *s = obl_create_session(d);
    struct obl_transaction *t;
    struct obl_object *o;

    /*
     * Force the persistance of o.
     */
    t = obl_begin_transaction(s);
    o = obl_create_integer(16);
    o->session = s;
    obl_mark_dirty(o);
    obl_commit_transaction(t);

    /*
     * Change the storage of o directly within the database.
     */
    SET_UINT(d->content, o->physical_address + 1, 15);

    CU_ASSERT(obl_integer_value(o) == 16);
    obl_refresh_object(o);
    CU_ASSERT(obl_integer_value(o) == 15);

    obl_destroy_session(s);
    obl_close_database(d);
}

void test_simple_abort(void)
{
    struct obl_database *d = obl_open_defdatabase(NULL);
    struct obl_session *s = obl_create_session(d);
    struct obl_transaction *t;
    struct obl_object *root_shape, *root, *o;
    char *slots[] = { "abc", "def" };

    /*
     * Force the persistance of o.
     */
    t = obl_begin_transaction(s);
    root_shape = obl_create_cshape("RootShape", 2, slots, OBL_SLOTTED);
    root = obl_create_slotted(root_shape);
    root->session = s;
    obl_mark_dirty(root);
    obl_commit_transaction(t);

    CU_ASSERT(obl_slotted_atcnamed(root, "abc") == obl_nil());

    /*
     * Assign o to one of root's slots.  Abort the transaction.
     */
    t = obl_begin_transaction(s);
    o = obl_create_integer(5);
    obl_slotted_atcnamed_put(root, "abc", o);
    obl_abort_transaction(t);

    /*
     * Assert that root has been reverted to its previous state.
     */
    CU_ASSERT(o->session == NULL);
    CU_ASSERT(obl_slotted_atcnamed(root, "abc") == obl_nil());

    obl_destroy_object(o);
    obl_destroy_session(s);
    obl_close_database(d);
}

void test_cross_session(void)
{
    struct obl_database *d = obl_open_defdatabase(NULL);

    struct obl_session *s0 = obl_create_session(d);
    struct obl_transaction *t0;
    struct obl_object *o0;

    struct obl_session *s1 = obl_create_session(d);
    struct obl_object *o1;

    t0 = obl_begin_transaction(s0);
    o0 = obl_create_integer(123);
    o0->session = s0;
    obl_mark_dirty(o0);
    obl_commit_transaction(t0);

    o1 = obl_in(s1, o0);

    /*
     * Change the object within session 0.
     */
    t0 = obl_begin_transaction(s0);
    obl_integer_set(o0, 1000);

    /*
     * The change should be visible from session 0, but not session 1.
     */
    CU_ASSERT(obl_integer_value(o0) == 1000);
    CU_ASSERT(obl_integer_value(o1) == 123);

    obl_commit_transaction(t0);

    CU_ASSERT(obl_integer_value(o0) == 1000);
    CU_ASSERT(obl_integer_value(o1) == 1000);

    obl_destroy_session(s0);
    obl_destroy_session(s1);
    obl_close_database(d);
}

/*
 * Collect the unit tests defined here into a CUnit test suite.  Return the
 * initialized suite on success, or NULL on failure.  Invoked by unittests.c.
 */
CU_pSuite initialize_session_suite(void)
{
    CU_pSuite pSuite = NULL;

    pSuite = CU_add_suite("session", NULL, NULL);
    if (pSuite == NULL) {
        return NULL;
    }

    ADD_TEST(test_ensure_transaction);
    ADD_TEST(test_mark_dirty);
    ADD_TEST(test_simple_commit);
    ADD_TEST(test_object_discovery);
    ADD_TEST(test_auto_mark_dirty);
    ADD_TEST(test_refresh_object);
    ADD_TEST(test_simple_abort);
    ADD_TEST(test_cross_session);

    return pSuite;
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RetryTrackingCodesInSpecificStatusesMessage.cs" company="Naos Project">
//    Copyright (c) Naos Project 2019. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Naos.MessageBus.Domain
{
    using System;

    /// <summary>
    /// Message to wait for tracking codes to be in a set of statuses.
    /// </summary>
    public class RetryTrackingCodesInSpecificStatusesMessage : IMessage, IShareTrackingCodes
    {
        /// <inheritdoc />
        public string Description { get; set; }

        /// <inheritdoc />
        public TrackingCode[] TrackingCodes { get; set; }

        /// <summary>
        /// Gets or sets the wait time between checks on status.
        /// </summary>
        public TimeSpan WaitTimeBetweenChecks { get; set; }

        /// <summary>
        /// Gets or sets the number of retries to attempt, -1 is infinity.
        /// </summary>
        public int NumberOfRetriesToAttempt { get; set; }

        /// <summary>
        /// Gets or sets the statuses that should be retried.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Keeping this way for now.")]
        public ParcelStatus[] StatusesToRetry { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether or not to throw an exception if the retries are exhausted without moving all messages out of the needing retry status.
        /// </summary>
        public bool ThrowIfRetriesExceededWithSpecificStatuses { get; set; }
    }
}


text:
#ifndef TESTAPP_H_
#define TESTAPP_H_

#include "ofMain.h"
#include "ofxQNX.h"

#define GRID_WIDTH  16
#define GRID_HEIGHT 16
#define LENGTH		2 * 8

class testApp : public ofxQNXApp {

public:
	void setup();
	void update();
	void draw();

	void touchDown(ofTouchEventArgs &touch);
	void touchMoved(ofTouchEventArgs &touch);
	void touchUp(ofTouchEventArgs &touch);
	void touchDoubleTap(ofTouchEventArgs &touch);
	void touchCancelled(ofTouchEventArgs &touch);

	ofVbo	vbo;
	ofVec3f pos[GRID_WIDTH*GRID_HEIGHT*LENGTH];
	ofVec3f center;

	float   restLength;
	int		total;
	int		space;
	int		count;
	bool	bPause;
	int		zoom, zoomTarget;
};

#endif /* TESTAPP_H_ */


text:
package excelize

import "encoding/xml"

// xlsxSST directly maps the sst element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main. String values may
// be stored directly inside spreadsheet cell elements; however, storing the
// same value inside multiple cell elements can result in very large worksheet
// Parts, possibly resulting in performance degradation. The Shared String Table
// is an indexed list of string values, shared across the workbook, which allows
// implementations to store values only once.
type xlsxSST struct {
	XMLName     xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main sst"`
	Count       int      `xml:"count,attr"`
	UniqueCount int      `xml:"uniqueCount,attr"`
	SI          []xlsxSI `xml:"si"`
}

// xlsxSI directly maps the si element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
// not checked this for completeness - it does as much as I need.
type xlsxSI struct {
	T string  `xml:"t"`
	R []xlsxR `xml:"r"`
}

// xlsxR directly maps the r element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
// not checked this for completeness - it does as much as I need.
type xlsxR struct {
	RPr *xlsxRPr `xml:"rPr"`
	T   string   `xml:"t"`
}

// xlsxRPr (Run Properties) specifies a set of run properties which shall be
// applied to the contents of the parent run after all style formatting has been
// applied to the text. These properties are defined as direct formatting, since
// they are directly applied to the run and supersede any formatting from
// styles.
type xlsxRPr struct {
	B      string         `xml:"b,omitempty"`
	Sz     *attrValFloat  `xml:"sz"`
	Color  *xlsxColor     `xml:"color"`
	RFont  *attrValString `xml:"rFont"`
	Family *attrValInt    `xml:"family"`
}


text: sync; echo 3 > /proc/sys/vm/drop_caches


text:
import path from 'path';

import linkRewrite from './remark-link-rewrite';

// helper functions to construct remark nodes
const makeFile = filePath => ({
  cwd: '/absolue/path/to/docs',
  history: [path.join('/absolue/path/to/docs/pages', filePath)],
});

const rewrite = (file, url) => {
  const link = { type: 'link', url };
  const tree = { type: 'root', children: [link] };
  linkRewrite()(tree, file);
  return link.url;
};

describe('only rewrites internal links', () => {
  const file = makeFile('index.md');

  it('skips https://external.link', () => {
    expect(rewrite(file, 'https://external.link')).toBe('https://external.link');
  });

  it('skips http://external.link?some=query', () => {
    expect(rewrite(file, 'http://external.link?some=query')).toBe(
      'http://external.link?some=query'
    );
  });
});

describe('maintains header reference', () => {
  it('resolves hash for index', () => {
    const file = makeFile('index.md');
    expect(rewrite(file, './#a-header')).toBe('/#a-header');
  });

  it('resolves hash for nested page sibling', () => {
    const file = makeFile('push-notifications/overview.md');
    expect(rewrite(file, './using-fcm.md#a-header')).toBe(
      '/push-notifications/using-fcm/#a-header'
    );
  });

  it('resolves hash from nested to index', () => {
    const file = makeFile('push-notifications/overview.md');
    expect(rewrite(file, '../index.md#a-header')).toBe('/#a-header');
  });
});

describe('from pages/index.md', () => {
  const file = makeFile('index.md');

  it('resolves guides to /guides', () => {
    expect(rewrite(file, 'guides')).toBe('/guides');
  });

  it('resolves guides.md to /guides/', () => {
    expect(rewrite(file, 'guides.md')).toBe('/guides/');
  });

  it('resolves ./guides.md to /guides/', () => {
    expect(rewrite(file, './guides.md')).toBe('/guides/');
  });

  it('resolves ./nested/reference.md to /nested/reference/', () => {
    expect(rewrite(file, './nested/reference.md')).toBe('/nested/reference/');
  });
});

describe('from pages/push-notifications/overview.md', () => {
  const file = makeFile('push-notifications/overview.md');

  it('resolves using-fcm to /push-notifications/using-fcm', () => {
    expect(rewrite(file, 'using-fcm')).toBe('/push-notifications/using-fcm');
  });

  it('resolves using-fcm.md to /push-notifications/using-fcm/', () => {
    expect(rewrite(file, 'using-fcm.md')).toBe('/push-notifications/using-fcm/');
  });

  it('resolves ./using-fcm.md to /push-notifications/using-fcm/', () => {
    expect(rewrite(file, './using-fcm.md')).toBe('/push-notifications/using-fcm/');
  });

  it('resolves ../guides.md to /guides/', () => {
    expect(rewrite(file, '../guides.md')).toBe('/guides/');
  });

  it('resolves ./ to /push-notifications', () => {
    expect(rewrite(file, './')).toBe('/push-notifications');
  });

  it('resolves ../ to /', () => {
    expect(rewrite(file, '../')).toBe('/');
  });

  it('resolves ../index.md to /', () => {
    expect(rewrite(file, '../index.md')).toBe('/');
  });
});

describe('from pages/versions/latest/sdk/app-auth.md', () => {
  const file = makeFile('versions/latest/sdk/app-auth.md');

  it('resolves app-loading.md to /versions/latest/sdk/app-loading/', () => {
    expect(rewrite(file, 'app-loading.md')).toBe('/versions/latest/sdk/app-loading/');
  });

  it('resolves ./app-loading.md to /versions/latest/sdk/app-loading/', () => {
    expect(rewrite(file, './app-loading.md')).toBe('/versions/latest/sdk/app-loading/');
  });

  it('resolves ../config/app.md#android to /versions/latest/config/app/#android', () => {
    expect(rewrite(file, '../config/app.md#android')).toBe('/versions/latest/config/app/#android');
  });

  it('resolves ../../../workflow/debugging.md to /workflow/debugging/', () => {
    expect(rewrite(file, '../../../workflow/debugging.md')).toBe('/workflow/debugging/');
  });
});

describe('from pages/workflow/debugging.md', () => {
  const file = makeFile('workflow/debugging.md');

  it('resolves hash only to same file', () => {
    expect(rewrite(file, '#some-header')).toBe('/workflow/debugging/#some-header');
  });

  it('resolves hash with ./ to same file', () => {
    expect(rewrite(file, './#some-header')).toBe('/workflow/debugging/#some-header');
  });
});


text:
namespace ouzel
{
    FileSystemEm::FileSystemEm()
    {
    }
}


text:
<?php

namespace Ticketmatic\Model;

use Ticketmatic\Json;

/**
 * A single ticket.
 *
 * ## Help Center
 *
 * Full documentation can be found in the Ticketmatic Help Center
 * (https://apps.ticketmatic.com/#/knowledgebase/api/types/EventTicket).
 */
class EventTicket implements \jsonSerializable
{
    /**
     * Create a new EventTicket
     *
     * @param array $data
     */
    public function __construct(array $data = array()) {
        foreach ($data as $key => $value) {
            $this->$key = $value;
        }
    }

    /**
     * Ticket ID
     *
     * @var int
     */
    public $id;

    /**
     * Link to the order the ticket is contained in
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $orderid;

    /**
     * The id of the scanner used for the last succesful entry
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $accesscontrollastenteredscandeviceid;

    /**
     * The timestamp of the last succesful entry with this ticket
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var \DateTime
     */
    public $accesscontrollastenteredts;

    /**
     * The id of the scanner used for the last succesful exit
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $accesscontrollastexitscandeviceid;

    /**
     * The timestamp of the last succesful exit with this ticket
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var \DateTime
     */
    public $accesscontrollastexitts;

    /**
     * The access control status for this ticket. 0 means not scanned, 1 means
     * succesful entry, 2 means succesful exit
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $accesscontrolstatus;

    /**
     * Ticket barcode
     *
     * @var string
     */
    public $barcode;

    /**
     * Link to the bundle (orderproduct) that this ticket belongs to.
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $bundleid;

    /**
     * Link to the locktype used for locking the ticket
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $locktypeid;

    /**
     * Fee for the ticket in the order
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var float
     */
    public $orderfee;

    /**
     * Price for the ticket in the order (without fee)
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var float
     */
    public $price;

    /**
     * String to string key-value mapping of properties
     *
     * @var string[]
     */
    public $properties;

    /**
     * The seat description for this ticket (only for seated tickets)
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var string
     */
    public $seatdescription;

    /**
     * Seat ID (for seated tickets)
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var string
     */
    public $seatid;

    /**
     * Number indicating the priority for this ticket for the best available algorithm.
     * Tickets with a higher priority will be considered first when performing a best
     * available allocation.
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $seatpriority;

    /**
     * Row number for the ticket (only for seated tickets)
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var string
     */
    public $seatrownumber;

    /**
     * Seat number for the ticket (only for seated tickets)
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var string
     */
    public $seatseatnumber;

    /**
     * Optional seatzone for the ticket
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $seatzoneid;

    /**
     * Zone name for the ticket (only for seated tickets)
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var string
     */
    public $seatzonename;

    /**
     * Optional link to the contact that is the ticketholder for this ticket
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $ticketholderid;

    /**
     * Optional name on the ticket
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var string
     */
    public $ticketname;

    /**
     * Link to the contingent this ticket belongs to
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $tickettypeid;

    /**
     * Link to the tickettypeprice that is assigned to this ticket for the order.
     * Through the tickettypeprice you can retrieve the pricetype
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $tickettypepriceid;

    /**
     * Link to the vouchercode that was used to reserve this ticket.
     *
     * **Note:** Ignored in the result for updating tickets
     *
     * **Note:** Ignored when updating tickets
     *
     * @var int
     */
    public $vouchercodeid;

    /**
     * Custom fields
     *
     * @var array
     */
    public $custom_fields;

    /**
     * Unpack EventTicket from JSON.
     *
     * @param object $obj
     *
     * @return \Ticketmatic\Model\EventTicket
     */
    public static function fromJson($obj) {
        if ($obj === null) {
            return null;
        }

        $result = new EventTicket(array(
            "id" => isset($obj->id) ? $obj->id : null,
            "orderid" => isset($obj->orderid) ? $obj->orderid : null,
            "accesscontrollastenteredscandeviceid" => isset($obj->accesscontrollastenteredscandeviceid) ? $obj->accesscontrollastenteredscandeviceid : null,
            "accesscontrollastenteredts" => isset($obj->accesscontrollastenteredts) ? Json::unpackTimestamp($obj->accesscontrollastenteredts) : null,
            "accesscontrollastexitscandeviceid" => isset($obj->accesscontrollastexitscandeviceid) ? $obj->accesscontrollastexitscandeviceid : null,
            "accesscontrollastexitts" => isset($obj->accesscontrollastexitts) ? Json::unpackTimestamp($obj->accesscontrollastexitts) : null,
            "accesscontrolstatus" => isset($obj->accesscontrolstatus) ? $obj->accesscontrolstatus : null,
            "barcode" => isset($obj->barcode) ? $obj->barcode : null,
            "bundleid" => isset($obj->bundleid) ? $obj->bundleid : null,
            "locktypeid" => isset($obj->locktypeid) ? $obj->locktypeid : null,
            "orderfee" => isset($obj->orderfee) ? $obj->orderfee : null,
            "price" => isset($obj->price) ? $obj->price : null,
            "properties" => isset($obj->properties) ? $obj->properties : null,
            "seatdescription" => isset($obj->seatdescription) ? $obj->seatdescription : null,
            "seatid" => isset($obj->seatid) ? $obj->seatid : null,
            "seatpriority" => isset($obj->seatpriority) ? $obj->seatpriority : null,
            "seatrownumber" => isset($obj->seatrownumber) ? $obj->seatrownumber : null,
            "seatseatnumber" => isset($obj->seatseatnumber) ? $obj->seatseatnumber : null,
            "seatzoneid" => isset($obj->seatzoneid) ? $obj->seatzoneid : null,
            "seatzonename" => isset($obj->seatzonename) ? $obj->seatzonename : null,
            "ticketholderid" => isset($obj->ticketholderid) ? $obj->ticketholderid : null,
            "ticketname" => isset($obj->ticketname) ? $obj->ticketname : null,
            "tickettypeid" => isset($obj->tickettypeid) ? $obj->tickettypeid : null,
            "tickettypepriceid" => isset($obj->tickettypepriceid) ? $obj->tickettypepriceid : null,
            "vouchercodeid" => isset($obj->vouchercodeid) ? $obj->vouchercodeid : null,
        ));

        $result->custom_fields = array();
        foreach ($obj as $key => $value) {
            if (substr($key, 0, 2) === "c_") {
                $key = substr($key, 2);
                $result->custom_fields[$key] = $value;
            }
        }

        return $result;
    }

    /**
     * Serialize EventTicket to JSON.
     *
     * @return array
     */
    public function jsonSerialize() {
        $result = array();
        if (!is_null($this->id)) {
            $result["id"] = intval($this->id);
        }
        if (!is_null($this->orderid)) {
            $result["orderid"] = intval($this->orderid);
        }
        if (!is_null($this->accesscontrollastenteredscandeviceid)) {
            $result["accesscontrollastenteredscandeviceid"] = intval($this->accesscontrollastenteredscandeviceid);
        }
        if (!is_null($this->accesscontrollastenteredts)) {
            $result["accesscontrollastenteredts"] = Json::packTimestamp($this->accesscontrollastenteredts);
        }
        if (!is_null($this->accesscontrollastexitscandeviceid)) {
            $result["accesscontrollastexitscandeviceid"] = intval($this->accesscontrollastexitscandeviceid);
        }
        if (!is_null($this->accesscontrollastexitts)) {
            $result["accesscontrollastexitts"] = Json::packTimestamp($this->accesscontrollastexitts);
        }
        if (!is_null($this->accesscontrolstatus)) {
            $result["accesscontrolstatus"] = intval($this->accesscontrolstatus);
        }
        if (!is_null($this->barcode)) {
            $result["barcode"] = strval($this->barcode);
        }
        if (!is_null($this->bundleid)) {
            $result["bundleid"] = intval($this->bundleid);
        }
        if (!is_null($this->locktypeid)) {
            $result["locktypeid"] = intval($this->locktypeid);
        }
        if (!is_null($this->orderfee)) {
            $result["orderfee"] = floatval($this->orderfee);
        }
        if (!is_null($this->price)) {
            $result["price"] = floatval($this->price);
        }
        if (!is_null($this->properties)) {
            $result["properties"] = $this->properties;
        }
        if (!is_null($this->seatdescription)) {
            $result["seatdescription"] = strval($this->seatdescription);
        }
        if (!is_null($this->seatid)) {
            $result["seatid"] = strval($this->seatid);
        }
        if (!is_null($this->seatpriority)) {
            $result["seatpriority"] = intval($this->seatpriority);
        }
        if (!is_null($this->seatrownumber)) {
            $result["seatrownumber"] = strval($this->seatrownumber);
        }
        if (!is_null($this->seatseatnumber)) {
            $result["seatseatnumber"] = strval($this->seatseatnumber);
        }
        if (!is_null($this->seatzoneid)) {
            $result["seatzoneid"] = intval($this->seatzoneid);
        }
        if (!is_null($this->seatzonename)) {
            $result["seatzonename"] = strval($this->seatzonename);
        }
        if (!is_null($this->ticketholderid)) {
            $result["ticketholderid"] = intval($this->ticketholderid);
        }
        if (!is_null($this->ticketname)) {
            $result["ticketname"] = strval($this->ticketname);
        }
        if (!is_null($this->tickettypeid)) {
            $result["tickettypeid"] = intval($this->tickettypeid);
        }
        if (!is_null($this->tickettypepriceid)) {
            $result["tickettypepriceid"] = intval($this->tickettypepriceid);
        }
        if (!is_null($this->vouchercodeid)) {
            $result["vouchercodeid"] = intval($this->vouchercodeid);
        }

        if (is_array($this->custom_fields)) {
            foreach ($this->custom_fields as $key => $value) {
                $result["c_" . $key] = $value;
            }
        }

        return $result;
    }
}


text:
package org.jivesoftware.openfire.muc.cluster;

import org.dom4j.Element;
import org.jivesoftware.openfire.muc.MUCRole;
import org.jivesoftware.openfire.muc.NotAllowedException;
import org.jivesoftware.openfire.muc.spi.LocalMUCRoom;
import org.jivesoftware.util.cache.ExternalizableUtil;
import org.xmpp.packet.Presence;

import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

/**
 * Task that requests the cluster node hosting a room occupant to change his
 * role and/or affiliation. If the occupant was not found or the change is
 * not allowed then a <tt>null</tt> value is returned. Otherwise the DOM
 * object representing the new presence of the room occupant is returned.
 *
 * @author Gaston Dombiak
 */
public class UpdateOccupantRequest extends MUCRoomTask<Element> {
    private Element answer;
    private String nickname;
    private int role;
    private MUCRole.Affiliation affiliation;

    public UpdateOccupantRequest() {
    }

    public UpdateOccupantRequest(LocalMUCRoom room, String nickname, MUCRole.Affiliation newAffiliation,
                                 MUCRole.Role newRole) {
        super(room);
        this.nickname = nickname;
        this.role = newRole.ordinal();
        this.affiliation = newAffiliation;
    }

    public String getNickname() {
        return nickname;
    }

    public MUCRole.Role getRole() {
        return MUCRole.Role.values()[role];
    }

    public MUCRole.Affiliation getAffiliation() {
        return affiliation;
    }

    public boolean isAffiliationChanged() {
        return affiliation != null;
    }

    @Override
    public Element getResult() {
        return answer;
    }

    @Override
    public void run() {
        try {
            Presence presence = getRoom().updateOccupant(this);
            if (presence != null) {
                answer = presence.getElement();
            }
        } catch (NotAllowedException e) {
            // Do nothing. A null return value means that the operation failed
        }
    }

    @Override
	public void writeExternal(ObjectOutput out) throws IOException {
        super.writeExternal(out);
        ExternalizableUtil.getInstance().writeSafeUTF(out, nickname);
        ExternalizableUtil.getInstance().writeInt(out, role);
        ExternalizableUtil.getInstance().writeBoolean(out, affiliation != null);
        if (affiliation != null) {
            ExternalizableUtil.getInstance().writeInt(out, affiliation.ordinal());
        }
    }

    @Override
	public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        super.readExternal(in);
        nickname = ExternalizableUtil.getInstance().readSafeUTF(in);
        role = ExternalizableUtil.getInstance().readInt(in);
        if (ExternalizableUtil.getInstance().readBoolean(in)) {
            affiliation = MUCRole.Affiliation.values()[ExternalizableUtil.getInstance().readInt(in)];
        }
    }
}


text:
'use strict';

/* Controllers Declaration */

angular.module('septWebRadioControllers', ['septWebRadioServices']);


text:
import Autorun from './Autorun';

export default class Computation {
  constructor(autorun, isFirstRun, stack) {
    this.autorun = autorun;
    this.isFirstRun = isFirstRun;
    this.stack = stack;
  }

  get isAlive() {
    return this.autorun !== null;
  }

  continue(func) {
    if (this.autorun) {
      return this.autorun.exec(func);
    }
    return undefined;
  }

  fork(func) {
    if (this.autorun) {
      const autorun = new Autorun(func, this);
      try {
        return autorun.rerun();
      } catch (err) {
        autorun.dispose();
        throw err;
      }
    }
    return undefined;
  }

  dispose() {
    this.autorun = null;
    this.stack = null;
  }
}


text:
from PySide import QtCore, QtGui

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(418, 303)
        self.gridLayout = QtGui.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.configGroupBox = QtGui.QGroupBox(Dialog)
        self.configGroupBox.setTitle("")
        self.configGroupBox.setObjectName("configGroupBox")
        self.formLayout = QtGui.QFormLayout(self.configGroupBox)
        self.formLayout.setObjectName("formLayout")
        self.label0 = QtGui.QLabel(self.configGroupBox)
        self.label0.setObjectName("label0")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label0)
        self.lineEdit0 = QtGui.QLineEdit(self.configGroupBox)
        self.lineEdit0.setObjectName("lineEdit0")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.lineEdit0)
        self.label1 = QtGui.QLabel(self.configGroupBox)
        self.label1.setObjectName("label1")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label1)
        self.lineEdit1 = QtGui.QLineEdit(self.configGroupBox)
        self.lineEdit1.setObjectName("lineEdit1")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.lineEdit1)
        self.label2 = QtGui.QLabel(self.configGroupBox)
        self.label2.setObjectName("label2")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label2)
        self.lineEdit2 = QtGui.QLineEdit(self.configGroupBox)
        self.lineEdit2.setObjectName("lineEdit2")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.lineEdit2)
        self.lineEdit3 = QtGui.QLineEdit(self.configGroupBox)
        self.lineEdit3.setObjectName("lineEdit3")
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.lineEdit3)
        self.label3 = QtGui.QLabel(self.configGroupBox)
        self.label3.setObjectName("label3")
        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label3)
        self.gridLayout.addWidget(self.configGroupBox, 0, 0, 1, 1)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "ConfigureDialog", None, QtGui.QApplication.UnicodeUTF8))
        self.label0.setText(QtGui.QApplication.translate("Dialog", "identifier:  ", None, QtGui.QApplication.UnicodeUTF8))
        self.label1.setText(QtGui.QApplication.translate("Dialog", "discretisation:  ", None, QtGui.QApplication.UnicodeUTF8))
        self.label2.setText(QtGui.QApplication.translate("Dialog", "node coordinates:  ", None, QtGui.QApplication.UnicodeUTF8))
        self.label3.setText(QtGui.QApplication.translate("Dialog", "elements:", None, QtGui.QApplication.UnicodeUTF8))


text:
import Box from '@mui/material/Box'
import Button from '@mui/material/Button'
import Dialog from '@mui/material/Dialog'
import DialogActions from '@mui/material/DialogActions'
import DialogContent from '@mui/material/DialogContent'
import DialogContentText from '@mui/material/DialogContentText'
import DialogTitle from '@mui/material/DialogTitle'
import WarningIcon from '@mui/icons-material/Warning'

interface ConfirmDialogProps {
  isOpen: boolean
  onCancel: () => void
  onConfirm: () => void
}

export const ConfirmDialog = ({
  isOpen,
  onCancel,
  onConfirm,
}: ConfirmDialogProps) => {
  const handleDialogClose = () => {
    onCancel()
  }

  return (
    <Dialog
      open={isOpen}
      aria-labelledby="alert-dialog-title"
      aria-describedby="alert-dialog-description"
      onClose={handleDialogClose}
    >
      <DialogTitle id="alert-dialog-title">
        <Box sx={{ display: 'flex', alignItems: 'center' }}>
          <WarningIcon
            fontSize="medium"
            sx={theme => ({
              color: theme.palette.warning.main,
              mr: theme.spacing(1),
            })}
          />
          Are you sure?
        </Box>
      </DialogTitle>
      <DialogContent>
        <DialogContentText id="alert-dialog-description">
          This action cannot be undone.
        </DialogContentText>
      </DialogContent>
      <DialogActions>
        <Button onClick={onCancel} autoFocus>
          Cancel
        </Button>
        <Button onClick={onConfirm} color="error">
          Confirm
        </Button>
      </DialogActions>
    </Dialog>
  )
}


text:
// Copyright 2009 Opera Software.
// This code is released under the BSD license found in the license.txt file.

function test(){  /**  JSON.stringify() replacer argument - array */
	var obj={
		test:'abc',
		name:'value'
	}
	var str = JSON.stringify(obj, ['test'] )  ;
	var passed =  !(/"name"\s*:\s*/.test( str )) && (/"test"\s*:\s*/.test(str));
	return passed ;
}