text:
In addition to the [Exploration page](Exploration.md), the GDC Data Portal also has features used to save and compare sets of cases, genes, and mutations. These sets can either be generated with existing filters (e.g. males with lung cancer) or through custom selection (e.g. a user-generated list of case IDs).

Note that saving a set only saves the type of entity included in the set. For example, a saved case set will not include filters that were applied to genes or mutations. Please be aware that your custom sets are deleted during each new GDC data release. You can export them and re-upload them in the "Manage Sets" link at the top right of the Portal.

## Generating a Cohort for Analysis

Cohort sets are completely customizable and can be generated for cases, genes, or mutations using the following methods:

__Upload ID Set:__ This feature is available in the "Manage Sets" link at the top right of the Portal. Choose "Upload Set" and then select whether the set comprises cases, genes, or mutations. A set of IDs (IDs* or UUIDs) can then be uploaded in a text file or copied and pasted into the list of identifiers field along with a name identifying the set. Once the list of identifiers is uploaded, they are validated and grouped according to whether the identifier matched an existing GDC ID or did not match ("Unmatched").

[![Upload Set](images/GDC-UploadSet-Cohort_v2.png)](images/GDC-UploadSet-Cohort_v2.png "Click to see the full image.")

\* This is referred to as a `submitter_id` in the GDC API, which is a non-UUID identifier such as a TCGA barcode.

__Apply Filters in Exploration:__ Sets can be assembled using the existing filters in the Exploration page.  They can be saved by choosing the "Save/Edit Case Set" button under the pie charts for case sets. This will prompt a decision to save as new case set.

Similarly, gene and mutation filters can be applied and saved in the Exploration page in the Genes and Mutations tab, respectively.

[![Exploration Set](images/GDC-ExplorationSet-Cohort_v2.png)](images/GDC-ExplorationSet-Cohort_v2.png "Click to see the full image.")

## Analysis Page
Clicking on the `Analysis` button in the top toolbar will launch the Analysis Page which displays the various options available for comparing saved sets.

[![Analysis Tab](images/GDC-Analysis-Tab.png)](images/GDC-Analysis-Tab.png "Click to see the full image.")

There are two tabs on this page:

* __Launch Analysis__: Where users can select either to do `Set Operations` or `Cohort Comparison`
* __Results__: Where users can view the results of current or previous set analyses

## Analysis Page: Set Operations

Up to three sets of the same set type can be compared and exported based on complex overlapping subsets. The features of this page include:

[![Set Operations](images/GDC-SetOpsFull-Cohort.png)](images/GDC-SetOpsFull-Cohort.png "Click to see the full image.")

* __Venn Diagram:__ Visually displays the overlapping items included within the three sets. Subsets based on overlap can be selected by clicking one or many sections of the Venn diagram. As sections of the Venn Diagram become highlighted in blue, their corresponding row in the overlap table becomes highlighted.

* __Summary Table:__ Displays the alias, item type, and name for each set included in this analysis

* __Overlap Table:__ Displays the number of overlapping items with set operations rather than a visual diagram. Subsets can be selected by checking boxes in the "Select" column, which will highlight the corresponding section of the Venn Diagram. As rows are selected, the "Union of selected sets" row is populated. Each row has an option to save the subset as a new set,  export the set as a TSV, or view files in the repository. The links that correspond to the number of items in each row will open the cohort in the Exploration page.

## Analysis Tab: Cohort Comparison

The "Cohort Comparison" analysis displays a series of graphs and tables that demonstrate the similarities and differences between two case sets. The following features are displayed for each two sets:

* A key detailing the number of cases in each cohort and the color that represents each (blue/gold)

* A Venn diagram, which shows the overlap between the two cohorts.  The Venn diagram can be opened in a 'Set Operations' tab by choosing "Open venn diagram in new tab"

* A selectable [survival plot](Projects/#survival-analysis) that compares both sets with information about the percentage of represented cases

[![Top Cohort](images/GDC-Cohort-Comparison-Top.png)](images/GDC-Cohort-Comparison-Top.png "Click to see the full image.")

* A breakdown of each cohort by selectable clinical facets with a bar graph and table. Facets include `vital_status`, `gender`, `race`, `ethnicity`, and `age_at_diagnosis`.  A p-value (if it can be calculated from the data) that demonstrates whether the statuses are proportionally represented is displayed for the `vital_status`, `gender`, and `ethnicity` facets.

[![Clinical Cohort](images/GDC-Clinical-Cohort.png)](images/GDC-Clinical-Cohort.png "Click to see the full image.")

## Analysis Page: Results

The results of the previous analyses are displayed on this page.

[![Results](images/gdc-analysis-resultstab.png)](images/gdc-analysis-resultstab.png "Click to see the full image.")

Each tab at the left side of the page is labeled according to the analysis type and the date that the analysis was performed and can be reviewed as long as it is present. The "Delete All" button will remove all of the previous analyses.


text:
using SignalR.Hosting.Common.Routing;

namespace SignalR.Hosting.Common
{
    public class RoutingHost : Host
    {
        private readonly RouteManager _routeManager;

        public RoutingHost()
            : this(Global.DependencyResolver)
        {
        }

        public RoutingHost(IDependencyResolver resolver)
            : base(resolver)
        {
            _routeManager = new RouteManager(resolver);
        }

        public RoutingHost MapHubs()
        {
            return MapHubs("/signalr");
        }

        public RoutingHost MapHubs(string path)
        {
            _routeManager.MapHubs(path);

            return this;
        }

        public RoutingHost MapConnection<TConnection>(string path) where TConnection : PersistentConnection
        {
            _routeManager.MapConnection<TConnection>(path);
            return this;
        }

        public bool TryGetConnection(string path, out PersistentConnection connection)
        {
            return _routeManager.TryGetConnection(path, out connection);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
module Travis
  module Notification
    module Publisher
      class Log
        def publish(event)
          return if event[:message].end_with? "received"
          level = event.key?(:exception) ? :error : :info
          log(level, event[:payload][:msg])

          if level == :error || Travis.logger.level == ::Logger::DEBUG
            event[:payload].each do |key, value|
              next if key == :msg
              level = event.key?(:exception) ? :error : :debug
              log(level, "  #{key}: #{value.inspect}")
            end
          end
        end

        def log(level, msg)
          Travis.logger.send(level, msg)
        end
      end
    end
  end
end


text:
using System;
using Marten.Linq.SqlGeneration;
using Weasel.Postgresql;
using Marten.Util;
using NpgsqlTypes;

namespace Marten.Linq.Filters
{
    public class ByIdFilter<T> : ISqlFragment
    {
        private readonly CommandParameter _parameter;

        public ByIdFilter(T value, NpgsqlDbType dbType)
        {
            _parameter = new CommandParameter(value, dbType);
        }

        public void Apply(CommandBuilder builder)
        {
            builder.Append("id = ");
            _parameter.Apply(builder);
        }

        public bool Contains(string sqlText)
        {
            return false;
        }
    }

    public class ByGuidFilter: ByIdFilter<Guid>
    {
        public ByGuidFilter(Guid value) : base(value, NpgsqlDbType.Uuid)
        {
        }
    }

    public class ByStringFilter: ByIdFilter<string>
    {
        public ByStringFilter(string value) : base(value, NpgsqlDbType.Varchar)
        {
        }
    }

    public class ByIntFilter: ByIdFilter<int>
    {
        public ByIntFilter(int value) : base(value, NpgsqlDbType.Integer)
        {
        }
    }

    public class ByLongFilter: ByIdFilter<long>
    {
        public ByLongFilter(long value) : base(value, NpgsqlDbType.Bigint)
        {
        }

        public ByLongFilter(int value) : base(value, NpgsqlDbType.Bigint)
        {
        }
    }

}


text:
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';

const ClassificationButton = ({ type, action, label, style, ...rest }) => (
  <button
    type='button'
    disabled={rest.disabled}
    style={style}
    className={classnames('btn', `btn-${type}`, `${rest.className}`)}
    onClick={action}
  >
    {rest.icon && <i className={classnames('fa', `${rest.icon}`)} />} {label}
  </button>
);

ClassificationButton.propTypes = {
  action: PropTypes.func.isRequired,
  icon: PropTypes.string,
  label: PropTypes.string.isRequired,
  style: PropTypes.object,
  type: PropTypes.string
};

export default ClassificationButton;


text:
import request from 'request'
import {
  initialTemplate,
  updateTemplate} from './templates'
import {
  set,
  get} from './store'

export default class {
  constructor (username, password) {
    this.username = username
    this.password = password
  }

  /**
   * when an event is received
   */
  async onEvent (event) {
    if (event.issue && event.action === 'opened') {
      try {
        await this.commentIssue(event)
      } catch (err) {
        console.log(err)
      }
    }

    if (event.comment && this.isPlusOne(event.comment.body)) {
      try {
        await this.amendComment(event)
      } catch (err) {
        console.log(err)
      }
    }
  }

  /**
   * if the comment received is a +1
   */
  isPlusOne (comment) {
    switch (comment.trim()) {
      case '+1':
      case ':+1:':
      case ':thumbsup:':
        return true
    }
    return false
  }

  /**
   * handle sending requests back to github
   */
  async request (method, url, body) {
    return await new Promise((resolve, reject) => {
      return request({
        auth: {
          username: this.username,
          password: this.password
        },
        headers: {
          'User-Agent': this.username
        },
        method: method,
        url: `https://api.github.com/${url}`,
        json: true,
        body: body
      }, (err, res, body) => {
        if (err) {
          reject(err)
        } else {
          resolve(body)
        }
      })
    })
  }

  /**
   * create the initial comment to be used
   */
  async commentIssue (event) {
    let comment = await this.request('POST', `repos/${event.repository.full_name}/issues/${event.issue.number}/comments`, {
      body: initialTemplate()
    })

    let issue = {
      initialComment: comment.id,
      count: 0,
      users: []
    }

    set(event.repository.full_name, event.issue.number, issue, 'save')
  }

  /**
   * delete the +1 comment
   */
  async deleteComment (event) {
    await this.request('DELETE', `repos/${event.repository.full_name}/issues/comments/${event.comment.id}`)
  }

  /**
   * update the initial comment with the new +1'er
   */
  async amendComment (event) {
    await this.deleteComment(event)
    let issue = await get(event.repository.full_name, event.issue.number)

    if (issue.users.indexOf(event.comment.user.login) === -1) {
      issue.users.push(event.comment.user.login)
      issue.count++
      await this.request('PATCH', `repos/${event.repository.full_name}/issues/comments/${issue.initialComment}`, {
        body: updateTemplate(issue.count, issue.users)
      })
      set(event.repository.full_name, event.issue.number, issue, 'merge')
    }
  }

}


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('profiles', '0008_auto_20150801_1847'),
        ('Forum', '0004_auto_20150803_0236'),
    ]

    operations = [
        migrations.CreateModel(
            name='MusicianResponseNonMusicianPost',
            fields=[
                ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
                ('text', models.TextField()),
                ('score', models.IntegerField(default=0)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('post', models.ForeignKey(to='Forum.NonMusicianPost')),
                ('user', models.ForeignKey(to='profiles.Musician')),
                ('votes', models.ManyToManyField(to='Forum.Vote', blank=True)),
            ],
            options={
                'ordering': ['-score', '-timestamp'],
            },
        ),
        migrations.AlterField(
            model_name='musicianresponse',
            name='votes',
            field=models.ManyToManyField(to='Forum.Vote', blank=True),
        ),
        migrations.AlterField(
            model_name='nonmusicianresponse',
            name='votes',
            field=models.ManyToManyField(to='Forum.Vote', blank=True),
        ),
    ]


text:
<?php

class Scalr_Service_Zookeeper_Queue implements Scalr_Util_Queue {

	/**
	 * @var Scalr_Service_Zookeeper
	 */
	public $zookeeper;

	/**
	 * @var string
	 */
	public $path;

	/**
	 * @var bool
	 */
	public $blocking;

	/**
	 * @var int
	 */
	public $blockingTimeout;

	protected $initialized = false;

	protected $children = array();

	protected $logger;

	/**
	 *
	 * @param $config
	 * @key Scalr_Service_Zookeeper $zookeeper
	 * @key string $path
	 * @key bool $blocking
	 * @key int $blockingTimeout
	 * @key bool $autoInit
	 */
	function __construct ($config) {
		foreach ($config as $k => $v) {
			$this->{$k} = $v;
		}
		$this->logger = Logger::getLogger(__CLASS__);

		if ($this->autoInit) {
			$this->init();
			unset($this->autoInit);
		}
	}

	protected function init () {
		if (!$this->initialized) {
			if (!$this->zookeeper->exists($this->path)) {
				$this->zookeeper->create($this->path);
			}
			$this->initialized = true;
		}
	}

	function put ($data) {
		$this->init();
		$pathData = $this->zookeeper->create("{$this->path}/element", $data, array("sequence" => true));
	}

	function peek () {
		$this->init();
		do {
			// Fetch path child nodes
			if (!$this->children) {
				//$this->logger->debug("Getting queue path child nodes");

				if ($this->blocking) {
					$start = microtime(true);
					try {
						do {
							$childData = $this->zookeeper->getChildren($this->path);

							$loop = !$childData->children &&
									(($this->blockingTimeout &&
									 !Scalr_Util_Timeout::reached($this->blockingTimeout, $start)) ||
									 !$this->blockingTimeout);
						} while ($loop);
					} catch (Scalr_Util_TimeoutException $e) {
						return null;
					}
				} else {
					$childData = $this->zookeeper->getChildren($this->path);
				}

				if ($childData->children) {
					sort($childData->children);
					$this->children = $childData->children;
				} else {
					$this->logger->debug("Queue is empty");
					if (!$this->blocking) {
						return null;
					}
				}
			}

			$this->logger->debug("Children capacity: " . count($this->children));
			while ($childName = array_shift($this->children)) {
				try {
					$statData = $this->zookeeper->get("{$this->path}/{$childName}");
					$this->zookeeper->delete("{$this->path}/{$childName}");

					$this->logger->info("Peeked {$this->path}/{$childName} from queue");
					return base64_decode($statData->data64);
				} catch (Exception $wasDeleted) {
					// Continue loop
					$this->logger->debug(sprintf("Got error while delete node %s. "
							. "I think it was processed by another client", "{$this->path}/{$childName}"));
				}
			}

		} while (!$this->children);
	}

	function capacity () {
		$this->init();
		if ($this->children) {
			return count($this->children);
		} else {
			$stat = $this->zookeeper->get($this->path);
			return $stat->numChildren;
		}
	}

	/**
	 * Delete queue and all her items
	 */
	function delete () {
		$this->zookeeper->deleteRecursive($this->path);
	}
}


text:
module.exports = {
  event: function (browser) {
    browser
      .url('http://localhost:8080/examples/event/')
      // initial loaded
      .waitForElementVisible('#app', 1000)
      // invalid inputing
      .enterValue('input', 't')
      .assert.attributeContains('.events p:nth-child(3)', 'data-event', 'invalid')
      .assert.attributeContains('.events p:nth-child(2)', 'data-event', 'dirty')
      .assert.attributeContains('.events p:nth-child(1)', 'data-event', 'modified')
      // valid inputing
      .enterValue('input', 'testtest')
      .assert.attributeContains('.events p:nth-child(1)', 'data-event', 'valid')
      // re-invalid inputing
      .enterBackSpace('input', 8)
      .assert.attributeContains('.events p:nth-child(1)', 'data-event', 'modified')
      .assert.attributeContains('.events p:nth-child(2)', 'data-event', 'invalid')
      // focueout
      .click('.errors')
      .assert.attributeContains('.events p:nth-child(1)', 'data-event', 'touched')
      .end()
  }
}


text:
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/slab.h>

#include <mach/map.h>
#include <plat/gpio-core.h>
#include <plat/gpio-cfg.h>

#include <asm/mach/irq.h>

#define GPIO_BASE(chip)		(((unsigned long)(chip)->base) & 0xFFFFF000u)

#define CON_OFFSET		0x700
#define MASK_OFFSET		0x900
#define PEND_OFFSET		0xA00
#define REG_OFFSET(x)		((x) << 2)

struct s5p_gpioint_bank {
	struct list_head	list;
	int			start;
	int			nr_groups;
	int			irq;
	struct samsung_gpio_chip	**chips;
	void			(*handler)(unsigned int, struct irq_desc *);
};

static LIST_HEAD(banks);

static int s5p_gpioint_set_type(struct irq_data *d, unsigned int type)
{
	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
	struct irq_chip_type *ct = gc->chip_types;
	unsigned int type_s5p = 0;
	unsigned int shift = (d->irq - gc->irq_base) << 2;

	switch (type) {
	case IRQ_TYPE_EDGE_RISING:
		type_s5p = S5P_IRQ_TYPE_EDGE_RISING;
		break;
	case IRQ_TYPE_EDGE_FALLING:
		type_s5p = S5P_IRQ_TYPE_EDGE_FALLING;
		break;
	case IRQ_TYPE_EDGE_BOTH:
		type_s5p = S5P_IRQ_TYPE_EDGE_BOTH;
		break;
	case IRQ_TYPE_LEVEL_HIGH:
		type_s5p = S5P_IRQ_TYPE_LEVEL_HIGH;
		break;
	case IRQ_TYPE_LEVEL_LOW:
		type_s5p = S5P_IRQ_TYPE_LEVEL_LOW;
		break;
	case IRQ_TYPE_NONE:
	default:
		printk(KERN_WARNING "No irq type\n");
		return -EINVAL;
	}

	gc->type_cache &= ~(0x7 << shift);
	gc->type_cache |= type_s5p << shift;
	writel(gc->type_cache, gc->reg_base + ct->regs.type);

	if (type & IRQ_TYPE_EDGE_BOTH)
		__irq_set_handler_locked(d->irq, handle_edge_irq);
	else
		__irq_set_handler_locked(d->irq, handle_level_irq);

	return 0;
}

static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
{
	struct s5p_gpioint_bank *bank = irq_get_handler_data(irq);
	int group, pend_offset, mask_offset;
	unsigned int pend, mask;

	struct irq_chip *chip = irq_get_chip(irq);
	chained_irq_enter(chip, desc);

	for (group = 0; group < bank->nr_groups; group++) {
		struct samsung_gpio_chip *chip = bank->chips[group];
		if (!chip)
			continue;

		pend_offset = REG_OFFSET(group);
		pend = __raw_readl(GPIO_BASE(chip) + PEND_OFFSET + pend_offset);
		if (!pend)
			continue;

		mask_offset = REG_OFFSET(group);
		mask = __raw_readl(GPIO_BASE(chip) + MASK_OFFSET + mask_offset);
		pend &= ~mask;

		while (pend) {
			int offset = fls(pend) - 1;
			int real_irq = chip->irq_base + offset;
			generic_handle_irq(real_irq);
			pend &= ~BIT(offset);
		}
	}
	chained_irq_exit(chip, desc);
}

static void s5p_gpioint_resume(struct irq_data *d)
{
	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
	struct irq_chip_type *ct = gc->chip_types;

	writel(gc->type_cache, gc->reg_base + ct->regs.type);
}

static __init int s5p_gpioint_add(struct samsung_gpio_chip *chip)
{
	static int used_gpioint_groups = 0;
	int group = chip->group;
	struct s5p_gpioint_bank *b, *bank = NULL;
	struct irq_chip_generic *gc;
	struct irq_chip_type *ct;

	if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT)
		return -ENOMEM;

	list_for_each_entry(b, &banks, list) {
		if (group >= b->start && group < b->start + b->nr_groups) {
			bank = b;
			break;
		}
	}
	if (!bank)
		return -EINVAL;

	if (!bank->handler) {
		bank->chips = kzalloc(sizeof(struct samsung_gpio_chip *) *
				      bank->nr_groups, GFP_KERNEL);
		if (!bank->chips)
			return -ENOMEM;

		irq_set_chained_handler(bank->irq, s5p_gpioint_handler);
		irq_set_handler_data(bank->irq, bank);
		bank->handler = s5p_gpioint_handler;
		printk(KERN_INFO "Registered chained gpio int handler for interrupt %d.\n",
		       bank->irq);
	}

	/*
	 * chained GPIO irq has been successfully registered, allocate new gpio
	 * int group and assign irq nubmers
	 */
	chip->irq_base = S5P_GPIOINT_BASE +
			 used_gpioint_groups * S5P_GPIOINT_GROUP_SIZE;
	used_gpioint_groups++;

	bank->chips[group - bank->start] = chip;

	gc = irq_alloc_generic_chip("s5p_gpioint", 1, chip->irq_base,
				    (void __iomem *)GPIO_BASE(chip),
				    handle_level_irq);
	if (!gc)
		return -ENOMEM;
	ct = gc->chip_types;
	ct->chip.irq_ack = irq_gc_ack_set_bit;
	ct->chip.irq_mask = irq_gc_mask_set_bit;
	ct->chip.irq_unmask = irq_gc_mask_clr_bit;
	ct->chip.irq_set_type = s5p_gpioint_set_type;
	ct->chip.irq_resume = s5p_gpioint_resume;
	ct->regs.ack = PEND_OFFSET + REG_OFFSET(group - bank->start);
	ct->regs.mask = MASK_OFFSET + REG_OFFSET(group - bank->start);
	ct->regs.type = CON_OFFSET + REG_OFFSET(group - bank->start);
	irq_setup_generic_chip(gc, IRQ_MSK(chip->chip.ngpio),
			       IRQ_GC_INIT_MASK_CACHE,
			       IRQ_NOREQUEST | IRQ_NOPROBE, 0);
	return 0;
}

int __init s5p_register_gpio_interrupt(int pin)
{
	struct samsung_gpio_chip *my_chip = samsung_gpiolib_getchip(pin);
	int offset, group;
	int ret;

	if (!my_chip)
		return -EINVAL;

	offset = pin - my_chip->chip.base;
	group = my_chip->group;

	/* check if the group has been already registered */
	if (my_chip->irq_base)
		goto success;

	/* register gpio group */
	ret = s5p_gpioint_add(my_chip);
	if (ret == 0) {
		my_chip->chip.to_irq = samsung_gpiolib_to_irq;
		printk(KERN_INFO "Registered interrupt support for gpio group %d.\n",
		       group);
		goto success;
	}
	return ret;
success:
	my_chip->bitmap_gpio_int |= BIT(offset);

	return my_chip->irq_base + offset;
}

int __init s5p_register_gpioint_bank(int chain_irq, int start, int nr_groups)
{
	struct s5p_gpioint_bank *bank;

	bank = kzalloc(sizeof(*bank), GFP_KERNEL);
	if (!bank)
		return -ENOMEM;

	bank->start = start;
	bank->nr_groups = nr_groups;
	bank->irq = chain_irq;

	list_add_tail(&bank->list, &banks);
	return 0;
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
MappingTransformer
</TITLE>

<META NAME="date" CONTENT="2012-04-16">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

gov.nih.nci.cbiit.cmts.transform

Class MappingTransformer

java.lang.Object
  gov.nih.nci.cbiit.cmts.transform.DefaultTransformer
      gov.nih.nci.cbiit.cmts.transform.MappingTransformer

All Implemented Interfaces:
TransformationService

Direct Known Subclasses:
Csv2XmlTransformer, Hl7v2XmlTransformer, XQueryTransformer

public class MappingTransformer
extends DefaultTransformer

This class performs the transformation using XQuery

Since:

CMTS v1.0

Field Summary

Fields inherited from interface gov.nih.nci.cbiit.cmts.transform.TransformationService

TRANSFER_CSV_TO_CDA, TRANSFER_CSV_TO_XML, TRANSFER_HL7_V2_TO_CDA, TRANSFER_HL7_V2_TO_XML, TRANSFER_XML_TO_CDA, TRANSFER_XML_TO_XML

Constructor Summary

MappingTransformer()

          constructor

Method Summary

protected  javax.xml.xquery.XQConnection
getConn()

 Mapping
getTransformationMapping()

 boolean
isTemporaryFileCreated()

static void
main(java.lang.String[] args)

protected  java.lang.String
parseRawData(java.lang.String sourceRawDataFile,
             Mapping map)

          Pre-process raw source data for transformer

protected  javax.xml.xquery.XQPreparedExpression
prepareXQExpression(java.lang.String instruction)

 void
setTemporaryFileCreated(boolean temporaryFileCreated)

 java.lang.String
transfer(java.lang.String sourceFile,
         java.lang.String mappingFile)

          Transfer source data into target data using process instruction file

 java.util.List<ApplicationResult>
validateSourceXmlData(java.lang.Object validator,
                      java.lang.String xmlData)

 java.util.List<ApplicationResult>
validateXmlData(java.lang.Object validator,
                java.lang.String xmlData)

          Verify an XML data against validator

Methods inherited from class gov.nih.nci.cbiit.cmts.transform.DefaultTransformer

isPresentable, setPresentable

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MappingTransformer

public MappingTransformer()
                   throws javax.xml.xquery.XQException

constructor

Throws:

javax.xml.xquery.XQException

Method Detail

main

public static void main(java.lang.String[] args)

getConn

protected final javax.xml.xquery.XQConnection getConn()

Returns:
the conn

isTemporaryFileCreated

public boolean isTemporaryFileCreated()

setTemporaryFileCreated

public void setTemporaryFileCreated(boolean temporaryFileCreated)

prepareXQExpression

protected javax.xml.xquery.XQPreparedExpression prepareXQExpression(java.lang.String instruction)
                                                             throws javax.xml.xquery.XQException,
                                                                    javax.xml.bind.JAXBException

Throws:

javax.xml.xquery.XQException

javax.xml.bind.JAXBException

transfer

public java.lang.String transfer(java.lang.String sourceFile,
                                 java.lang.String mappingFile)

Description copied from interface: TransformationService

Transfer source data into target data using process instruction file

Specified by:
transfer in interface TransformationService
Overrides:
transfer in class DefaultTransformer

Parameters:
sourceFile - URI of source data file
mappingFile - URI of transformation file, such as, mapping, XQuery artifact, or XSLT style sheet artfact

Returns:
Result XML data

parseRawData

protected java.lang.String parseRawData(java.lang.String sourceRawDataFile,
                                        Mapping map)
                                 throws javax.xml.bind.JAXBException,
                                        java.io.IOException

Pre-process raw source data for transformer

Parameters:
sourceRawDataFile - URI of source raw data file
map - Mapping object

Returns:
URI of pre-processed source data, it may be a temporary file

Throws:

javax.xml.bind.JAXBException

java.io.IOException

validateXmlData

public java.util.List<ApplicationResult> validateXmlData(java.lang.Object validator,
                                                         java.lang.String xmlData)

Description copied from interface: TransformationService

Verify an XML data against validator

Specified by:
validateXmlData in interface TransformationService
Overrides:
validateXmlData in class DefaultTransformer

Returns:

validateSourceXmlData

public java.util.List<ApplicationResult> validateSourceXmlData(java.lang.Object validator,
                                                               java.lang.String xmlData)

getTransformationMapping

public Mapping getTransformationMapping()

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
package org.opensmartgridplatform.adapter.protocol.oslp.elster.device.requests;

import org.opensmartgridplatform.adapter.protocol.oslp.elster.device.DeviceRequest;

public class SwitchConfigurationBankRequest extends DeviceRequest {

    private final String configurationBank;

    public SwitchConfigurationBankRequest(final String organisationIdentification, final String deviceIdentification,
            final String correlationUid, final int messagePriority, final String configurationBank) {
        super(organisationIdentification, deviceIdentification, correlationUid, messagePriority);

        this.configurationBank = configurationBank;
    }

    public SwitchConfigurationBankRequest(final Builder deviceRequestBuilder, final String configurationBank) {
        super(deviceRequestBuilder);
        this.configurationBank = configurationBank;
    }

    public String getConfigurationBank() {
        return this.configurationBank;
    }
}


text:
import sys, os
sys.path.insert(0, '/var/www/camera')
#import textindex

from time import strftime, localtime, sleep
import picamera
import datetime

pic = '/var/www/camera/%s_cam_shot.jpg'

if len(sys.argv) is 1:
	print '   *****'
	print '    A picture has default file name in default path.'
	print '     '+pic
	print '   *****'

elif len(sys.argv) > 2:
	print '   Insert only the file name with directory where you want to save a picture in'
	print '   default :'+pic

else:
	pic = sys.argv[1]

foto_cnt = 0

camera =  picamera.PiCamera()
camera.resolution = (1024, 768)
camera.rotation = 180

while True:

    camera.start_preview()
    sleep(10)
    camera.stop_preview()

    time = strftime("%Y-%m%d-%H:%M", localtime())

    camera.capture(pic %time)
    print '\n A picture was saved at ' + pic %time

    sleep(2.5)


text:
from abc import ABC, abstractmethod

class Animation(ABC):

#     __start_time = abstract_attribute()
#     __stop_time = abstract_attribute()
#     __start_pos = abstract_attribute()
#     __stop_pos = abstract_attribute()

    @abstractmethod
    def get_color(self, time, pos):
        """
        get the color of the animation at a given time and 0-1 location on the
        strip

        :param time: seconds since the epoch
        :type time: float
        :param pos: location on strip between 0 and 1
        :type pos: float
        :return: unsigned 32-bit value defining RGB
        :rtype: int
        """
        return 0x000000

    def get_start_time(self):
        return self.__start_time

    def set_start_time(self, time):
        self.__start_time = time

    def get_stop_time(self):
        return self.__stop_time

    def set_stop_time(self, time):
        self.__stop_time = time

    def get_start_pos(self):
        return self.__start_pos

    def set_start_pos(self, pos):
        self.__start_pos = pos

    def get_stop_pos(self):
        return self.__stop_pos

    def set_stop_pos(self, pos):
        self.__stop_pos = pos


text:
/**
 */
package org.scribble.trace.editor.dsl.scribbleTraceDsl.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer;
import org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter;
import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage;

/**
 *
 * An implementation of the model object 'Messagetransfer'.
 *
 *

 * The following features are implemented:
 *

 *
{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.MessagetransferImpl#getParameters Parameters}

 *

 *

 *
 * @generated
 */
public class MessagetransferImpl extends StepdefnImpl implements Messagetransfer
{
  /**
   * The cached value of the '{@link #getParameters() Parameters}' containment reference list.
   *
   *
   * @see #getParameters()
   * @generated
   * @ordered
   */
  protected EList<Parameter> parameters;

  /**
   *
   *
   * @generated
   */
  protected MessagetransferImpl()
  {
    super();
  }

  /**
   *
   *
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ScribbleTraceDslPackage.Literals.MESSAGETRANSFER;
  }

  /**
   *
   *
   * @generated
   */
  public EList<Parameter> getParameters()
  {
    if (parameters == null)
    {
      parameters = new EObjectContainmentEList<Parameter>(Parameter.class, this, ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS);
    }
    return parameters;
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS:
        return ((InternalEList<?>)getParameters()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS:
        return getParameters();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   *
   *
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS:
        getParameters().clear();
        getParameters().addAll((Collection<? extends Parameter>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS:
        getParameters().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS:
        return parameters != null && !parameters.isEmpty();
    }
    return super.eIsSet(featureID);
  }

} //MessagetransferImpl


text:
package rule;

import java.util.List;
import java.util.Random;

import cellsociety_team13.BackgroundCell;
import cellsociety_team13.Cell;
import cellsociety_team13.CellGrid;
import javafx.scene.paint.Color;

/**
 * WatorWorld is a simulation in which the sharks eat the fish and the fish eat
 * the kelp, the shark has preference over the fish in eating, if the animal has
 * been alive for more than x amount of time they move and reproduce
 *
 * @author Lucia Martos
 */
public class WatorWorld extends Rule {

	void evaluateCell(Cell myCell, CellGrid myGrid) {
		myNeighbours = myGrid.getNeighbours(myCell);
		nonDiagNeighbours = myGrid.getNonDiagNeighbours(myCell);
		if (myCell.getCurrentType().equals("FISH")) {
			updateFishAndShark(myCell, myGrid, "FISH", "KELP");
		} else if (myCell.getCurrentType().equals("SHARK")) {
			updateFishAndShark(myCell, myGrid, "SHARK", "FISH");
		} else {
			myCell.setNextType("KELP");
		}

	}

	private boolean checkNeighboursForTarget(String target) {
		for (Cell myNeighbour : nonDiagNeighbours) {
			if (myNeighbour.getCurrentType().equals(target)) {
				return true;
			}
		}
		return false;
	}

	private void updateFishAndShark(Cell myCell, CellGrid myGrid, String attacker, String target) {
		boolean containsTarget = checkNeighboursForTarget(target);
		if (containsTarget) {
			handleNeighbourHasTarget(myCell, myGrid, attacker, target);
		} else {
			handleNeighourNoTarget(myCell, myGrid, attacker, target);
		}
	}

	private void handleNeighourNoTarget(Cell myCell, CellGrid myGrid, String attacker, String target) {
		// potentially messy code?
		if (attacker.equals("SHARK") && target.equals("FISH")) {
			updateFishAndShark(myCell, myGrid, "SHARK", "KELP");
		} else {
			myCell.setNextType(attacker);
			myCell.setNextState("lifetime", myCell.getCurrentState("lifetime") + 1);
		}
	}

	private void handleNeighbourHasTarget(Cell myCell, CellGrid myGrid, String attacker, String target) {
		// the cell it moves to will always be FISH
		Cell nextCell = chooseRandomNeighbourCell(myCell, myGrid, target);
		nextCell.setNextType(attacker);
		nextCell.setNextState("lifetime", myCell.getCurrentState("lifetime") + 1);

		// if it has lived the lifetime required it can reproduce
		if (myCell.getCurrentState("lifetime") < getParameter("lifetime")) {
			// set the lifetime to the previous one +1
			myCell.setNextType("KELP");
		} else {
			myCell.setNextType(attacker);
		}
		myCell.setNextState("lifetime", 0);
	}

	@Override
	public void evaluateGrid(CellGrid myGrid) {
		iterateArrayListAndUpdate(myGrid, "SHARK");
		iterateArrayListAndUpdate(myGrid, "FISH");
		iterateArrayListAndUpdate(myGrid, "KELP");
	}

	private void iterateArrayListAndUpdate(CellGrid myGrid, String type) {
		List<Cell> myCells = myGrid.getCellsByType(type);
		for (Cell myCell : myCells) {
			if (myCell.getNextType() == null) {
				evaluateCell(myCell, myGrid);
			}
		}
	}

	void setStatesInMap(Cell myCell) {
		myCell.setCurrentState("lifetime", 0);
	}

	public void setColor(Cell myCell, CellGrid myGrid) {
		if (myCell.getCurrentType().equals("FISH")) {
			myCell.setFill(Color.BLUE);
		} else if (myCell.getCurrentType().equals("KELP")) {
			myCell.setFill(Color.GREEN);
		} else if (myCell.getCurrentType().equals("SHARK")) {
			myCell.setFill(Color.RED);
		}
	}

	private Cell chooseRandomNeighbourCell(Cell myCell, CellGrid myGrid, String type) {
		// not perfectly random or efficient... need to take another look
		Random rn = new Random();
		return nonDiagNeighbours.get(rn.nextInt(nonDiagNeighbours.size()-1));
	}

	@Override
	void setBGStatesInMap(BackgroundCell myBGCell) {
		// TODO Auto-generated method stub

	}

	@Override
	void evaluateBackgroundCell(BackgroundCell myBackgroundCell) {
		// TODO Auto-generated method stub

	}

}


text:
package nl.gridline.zieook.client.tools;

import java.io.Console;

import uk.co.flamingpenguin.jewel.cli.CliFactory;

/**
 * Some interactive console helper methods
 *

 * Project zieook-client

 * AbstractCliExecutor.java created 16 dec. 2011
 *

 * Copyright, all rights reserved 2011 GridLine Amsterdam
 * @author Job
 * @version $Revision:$, $Date:$
 */
public abstract class AbstractCliExecutor implements CliExecutor
{

	/**
	 * get the help message for an option class
	 * @param clazz
	 * @return
	 */
	public static String getHelp(Class<?> clazz)
	{
		return CliFactory.createCli(clazz).getHelpMessage();
	}

	protected void printHelpAndExit(String msg, Class<?> clazz)
	{
		System.out.println(msg);
		System.out.println(CliFactory.createCli(clazz).getHelpMessage());
		System.exit(-1);

	}

	public boolean confirmYesNo(String message)
	{
		Console c = getConsole();
		String msg = message + " [Y/n]?";

		int result = isYesNo(c.readLine(msg));
		do
		{
			result = isYesNo(c.readLine(msg));
		}
		while (result == -1);

		return result == 1;
	}

	public boolean confirmReallyYesNo(String message)
	{
		Console c = getConsole();
		int result = isYesNo(c.readLine(message + " [Yes/no]?"));
		do
		{
			result = isReallyYesNo(message + " type [Yes/no]?");
		}
		while (result == -1);

		return result == 1;
	}

	private Console getConsole()
	{
		Console c = System.console();
		if (c == null)
		{
			System.err.println("No console.");
			System.exit(1);
		}
		return c;
	}

	private int isReallyYesNo(String c)
	{
		if (c == null)
		{
			return -1;
		}

		if ("yes".equals(c))
		{
			return 1;
		}
		if ("no".equals(c))
		{
			return 0;
		}
		return -1;
	}

	/**
	 * return 1 on yes,y return 0 on
	 * @param confirm
	 * @return
	 */
	private int isYesNo(String confirm)
	{
		if (confirm == null)
		{
			return -1;
		}

		String c = confirm.toLowerCase();
		if ("yes".equals(c) || "y".equals(c))
		{
			return 1;
		}
		if ("no".equals(c) || "n".equals(c))
		{
			return 0;
		}
		return -1;
	}
}


text:
package geese.dk.whiskysearch.helpers;

/**
 * Created by f2k on 23/05/15.
 */
public class TastingNote extends Note
{
    protected String mColour;
    protected String mNose;
    protected String mTaste;
    protected String mFinish;
    protected String mComments;

    public TastingNote()
    {}

    public TastingNote( String author, String date, String rating, String note,
                        String colour, String nose, String taste, String finish, String comments )
    {
        super( author, date, rating, note );
        mColour = colour;
        mNose = nose;
        mTaste = taste;
        mFinish = finish;
        mComments = comments;
    }

    public String getColour()
    {
        return mColour;
    }

    public void setColour(String colour)
    {
        this.mColour = colour;
    }

    public String getNose()
    {
        return mNose;
    }

    public void setNose(String nose)
    {
        this.mNose = nose;
    }

    public String getTaste()
    {
        return mTaste;
    }

    public void setTaste(String taste)
    {
        this.mTaste = taste;
    }

    public String getFinish()
    {
        return mFinish;
    }

    public void setFinish(String finish)
    {
        this.mFinish = finish;
    }

    public String getComments()
    {
        return mComments;
    }

    public void setComments(String comments)
    {
        this.mComments = comments;
    }
}


text:
using System;
using anime_downloader.Enums;
using anime_downloader.Models;

namespace anime_downloader.Classes
{
    public static class Predicates
    {
        public static Func<Anime, bool> Watching => anime =>
            anime.Status == Status.Watching;

        public static Func<Anime, bool> WatchingOrFinished => anime =>
            anime.Status == Status.Watching || anime.Status == Status.Finished;

        public static Func<Anime, bool> MarkedAsAiring => anime =>
            anime.Airing;

        public static Func<Anime, bool> AiringNow => anime =>
            anime.Details.AiringNow;

        public static Func<Anime, bool> NotCompleted => anime =>
        {
            if (anime.Details.HasId && anime.Details.Total != 0)
                return anime.Episode != anime.Details.Total;
            return true;
        };

        public static Func<Anime, bool> NeedsUpdates => anime =>
            anime.Details.NeedsUpdating && anime.Status != Status.Considering;

        public static Func<Anime, bool> HasMyAnimeListId => anime =>
            anime.Details.HasId;

        public static Func<Anime, bool> OnFinalEpisode => anime =>
            (anime.Details.HasId || anime.Details.OverallTotal > 0 || anime.Details.TotalEpisodes > 0) &&
            (anime.Details.OverallTotal > 0 && anime.Episode == anime.Details.OverallTotal ||
             anime.Details.TotalEpisodes > 0 && anime.Episode == anime.Details.TotalEpisodes);

        public static Func<Anime, bool> Completed => anime =>
            anime.Details.Total != 0 && anime.Episode == anime.Details.Total;
    }
}


text:
using System;
using System.Text.Json;
using System.Collections.Generic;
using SocketIOClient.Transport;

namespace SocketIOClient.Messages
{
    public class OpenedMessage : IMessage
    {
        public MessageType Type => MessageType.Opened;

        public string Sid { get; set; }

        public string Namespace { get; set; }

        public List<string> Upgrades { get; private set; }

        public int PingInterval { get; private set; }

        public int PingTimeout { get; private set; }

        public List<byte[]> OutgoingBytes { get; set; }

        public List<byte[]> IncomingBytes { get; set; }

        public int BinaryCount { get; }

        public int Eio { get; set; }

        public TransportProtocol Protocol { get; set; }

        private int GetInt32FromJsonElement(JsonElement element, string msg, string name)
        {
            var p = element.GetProperty(name);
            int val;
            switch (p.ValueKind)
            {
                case JsonValueKind.String:
                    val = int.Parse(p.GetString());
                    break;
                case JsonValueKind.Number:
                    val = p.GetInt32();
                    break;
                default:
                    throw new ArgumentException($"Invalid message: '{msg}'");
            }
            return val;
        }

        public void Read(string msg)
        {
            var doc = JsonDocument.Parse(msg);
            var root = doc.RootElement;
            Sid = root.GetProperty("sid").GetString();

            PingInterval = GetInt32FromJsonElement(root, msg, "pingInterval");
            PingTimeout = GetInt32FromJsonElement(root, msg, "pingTimeout");

            Upgrades = new List<string>();
            var upgrades = root.GetProperty("upgrades").EnumerateArray();
            foreach (var item in upgrades)
            {
                Upgrades.Add(item.GetString());
            }
        }

        public string Write()
        {
            //var builder = new StringBuilder();
            //builder.Append("40");
            //if (!string.IsNullOrEmpty(Namespace))
            //{
            //    builder.Append(Namespace).Append(',');
            //}
            //return builder.ToString();
            throw new NotImplementedException();
        }
    }
}


text:
layout: article
title: Health professionals
tags:
  - wala
  - wa
  - lyme association
  - health
  - professionals
image:
  feature: leaves.jpg
published: true
---

The WA Lyme Association (WALA) is holding two Lyme Awareness seminars for health professionals in East Perth (25 October) and Bridgetown (29 November).

Please view or download the [practitioner information brochure](/media/Lyme-MSIDS Information for Health Practitioners.pdf) and [invitation flyer](/media/Lyme-MSIDS Seminar Invitation Flyer.pdf) for these seminars.

Bookings can be made at [wala.eventbrite.com.au](http://wala.eventbrite.com.au).

As WALA is still in the process of developing this new website, we have yet to upload a comprehensive information section for health practitioners but will endeavour to expand the information available on this link in coming months.

In the interim, health professionals are encouraged to view the [Information for Doctors](http://www.lymedisease.org.au/for-doctors/) section on the Lyme Disease Association of Australia (LDAA) website.


text:
#ifndef COMMON_TIMING_PARAMS_H
#define COMMON_TIMING_PARAMS_H

typedef struct {
	/* parameters to constrict */

	unsigned int tckmin_x_ps;
	unsigned int tckmax_ps;
	unsigned int trcd_ps;
	unsigned int trp_ps;
	unsigned int tras_ps;
#if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4)
	unsigned int taamin_ps;
#endif

#ifdef CONFIG_SYS_FSL_DDR4
	unsigned int trfc1_ps;
	unsigned int trfc2_ps;
	unsigned int trfc4_ps;
	unsigned int trrds_ps;
	unsigned int trrdl_ps;
	unsigned int tccdl_ps;
	unsigned int trfc_slr_ps;
#else
	unsigned int twtr_ps;	/* maximum = 63750 ps */
	unsigned int trfc_ps;	/* maximum = 255 ns + 256 ns + .75 ns
					   = 511750 ps */

	unsigned int trrd_ps;	/* maximum = 63750 ps */
	unsigned int trtp_ps;	/* byte 38, spd->trtp */
#endif
	unsigned int twr_ps;	/* maximum = 63750 ps */
	unsigned int trc_ps;	/* maximum = 254 ns + .75 ns = 254750 ps */

	unsigned int refresh_rate_ps;
	unsigned int extended_op_srt;

#if defined(CONFIG_SYS_FSL_DDR1) || defined(CONFIG_SYS_FSL_DDR2)
	unsigned int tis_ps;	/* byte 32, spd->ca_setup */
	unsigned int tih_ps;	/* byte 33, spd->ca_hold */
	unsigned int tds_ps;	/* byte 34, spd->data_setup */
	unsigned int tdh_ps;	/* byte 35, spd->data_hold */
	unsigned int tdqsq_max_ps;	/* byte 44, spd->tdqsq */
	unsigned int tqhs_ps;	/* byte 45, spd->tqhs */
#endif

	unsigned int ndimms_present;
	unsigned int lowest_common_spd_caslat;
	unsigned int highest_common_derated_caslat;
	unsigned int additive_latency;
	unsigned int all_dimms_burst_lengths_bitmask;
	unsigned int all_dimms_registered;
	unsigned int all_dimms_unbuffered;
	unsigned int all_dimms_ecc_capable;

	unsigned long long total_mem;
	unsigned long long base_address;

	/* DDR3 RDIMM */
	unsigned char rcw[16];	/* Register Control Word 0-15 */
} common_timing_params_t;

#endif


text:
""" Create a new project """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function

import os

import qisrc  # for QISRC_ROOT_DIR
import qisrc.templates
import qisys.parsers
from qisys import ui

def parse_params_arg(params_arg):
    """ Parse Params Arg """
    params = dict()
    args = params_arg.split(',')
    for arg in args:
        keyvalue = arg.split('=')
        params[keyvalue[0]] = keyvalue[1]
    return params

def configure_parser(parser):
    """ Configure parser for this action """
    qisys.parsers.worktree_parser(parser)
    parser.add_argument("project_name",
                        help="The name of the project. "
                        "The project will be created in PWD/<name> ")
    parser.add_argument("-i", "--input", "--template-path", dest="template_path")
    parser.add_argument("--git", action="store_true",
                        help="Create a git repository.")
    parser.add_argument("-o", "--output", dest="output_dir")
    parser.add_argument("-p", "--params", action="append", type=parse_params_arg, dest="params",
                        help="Set parameters to be used to fill in the template, for example:"
                        "--params namespace=AL,domain=aldebaran.com")

def do(args):
    """" Create a new project """
    try:
        worktree = qisys.parsers.get_worktree(args)
    except qisys.worktree.NotInWorkTree:
        worktree = None
    template_kwargs = dict()
    if args.params is not None:
        for params in args.params:
            template_kwargs.update(params)
    template_kwargs["project_name"] = os.path.basename(args.project_name)
    output_dir = args.output_dir
    if not output_dir:
        output_dir = qisrc.templates.attached_lower(template_kwargs["project_name"])
        output_dir = os.path.join(os.getcwd(), output_dir)
    if os.path.exists(output_dir):
        raise Exception("%s already exists" % output_dir)
    template_path = args.template_path
    if not template_path:
        template_path = os.path.join(qisrc.QISRC_ROOT_DIR, "templates", "project")
    qisrc.templates.process(template_path, output_dir, **template_kwargs)
    if args.git:
        qisys.command.call(["git", "init"], cwd=output_dir)
        with open(os.path.join(output_dir, ".gitignore"), "w") as fp:
            fp.write("build-*\n")
        qisys.command.call(["git", "add", "."], cwd=output_dir)
        qisys.command.call(["git", "commit", "-m", "initial commit"], cwd=output_dir)
    ui.info(ui.green, "New project initialized in", ui.bold, output_dir)
    if worktree:
        worktree.add_project(output_dir)
        return worktree.get_project(output_dir)
    return None


text:
@interface ViewController () <GADNativeAppInstallAdLoaderDelegate, GADNativeContentAdLoaderDelegate,
                              GADNativeCustomTemplateAdLoaderDelegate>

/// You must keep a strong reference to the GADAdLoader during the ad loading process.
@property(strong, nonatomic) GADAdLoader *adLoader;

/// The native ad view that is being presented.
@property(strong, nonatomic) UIView *nativeAdView;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  [self refreshAd:nil];
}

- (IBAction)refreshAd:(id)sender {
  // Loads an ad for any of app install, content, or custom native ads.
  NSMutableArray *adTypes = [[NSMutableArray alloc] init];
  if (self.appInstallAdSwitch.on) {
    [adTypes addObject:kGADAdLoaderAdTypeNativeAppInstall];
  }
  if (self.contentAdSwitch.on) {
    [adTypes addObject:kGADAdLoaderAdTypeNativeContent];
  }
  if (self.customNativeAdSwitch.on) {
    [adTypes addObject:kGADAdLoaderAdTypeNativeCustomTemplate];
  }

  if (!adTypes.count) {
    NSLog(@"Error: You must specify at least one ad type to load.");
    return;
  }

  self.refreshButton.enabled = NO;
  self.adLoader = [[GADAdLoader alloc] initWithAdUnitID:@"/6499/example/native"
                                     rootViewController:self
                                                adTypes:adTypes
                                                options:nil];
  self.adLoader.delegate = self;
  [self.adLoader loadRequest:[GADRequest request]];
}

- (void)setAdView:(UIView *)view {
  // Remove previous ad view.
  [self.nativeAdView removeFromSuperview];
  self.nativeAdView = view;

  // Add new ad view and set constraints to fill its container.
  [self.nativeAdPlaceholder addSubview:view];
  [self.nativeAdView setTranslatesAutoresizingMaskIntoConstraints:NO];

  NSDictionary *viewDictionary = NSDictionaryOfVariableBindings(_nativeAdView);
  [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_nativeAdView]|"
                                                                    options:0
                                                                    metrics:nil
                                                                      views:viewDictionary]];
  [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_nativeAdView]|"
                                                                    options:0
                                                                    metrics:nil
                                                                      views:viewDictionary]];
}

#pragma mark GADAdLoaderDelegate implementation

- (void)adLoader:(GADAdLoader *)adLoader didFailToReceiveAdWithError:(GADRequestError *)error {
  NSLog(@"%@ failed with error: %@", adLoader, [error localizedDescription]);
  self.refreshButton.enabled = YES;
}

#pragma mark GADNativeAppInstallAdLoaderDelegate implementation

- (void)adLoader:(GADAdLoader *)adLoader
    didReceiveNativeAppInstallAd:(GADNativeAppInstallAd *)nativeAppInstallAd {
  NSLog(@"Received native app install ad: %@", nativeAppInstallAd);
  self.refreshButton.enabled = YES;

  // Create and place ad in view hierarchy.
  GADNativeAppInstallAdView *appInstallAdView =
      [[[NSBundle mainBundle] loadNibNamed:@"NativeAppInstallAdView"
                                     owner:nil
                                   options:nil] firstObject];
  [self setAdView:appInstallAdView];

  // Associate the app install ad view with the app install ad object. This is required to make the
  // ad clickable.
  appInstallAdView.nativeAppInstallAd = nativeAppInstallAd;

  // Populate the app install ad view with the app install ad assets.
  ((UILabel *)appInstallAdView.headlineView).text = nativeAppInstallAd.headline;
  [((UIButton *)appInstallAdView.callToActionView)setTitle:nativeAppInstallAd.callToAction
                                                  forState:UIControlStateNormal];
  ((UIImageView *)appInstallAdView.iconView).image = nativeAppInstallAd.icon.image;
  ((UILabel *)appInstallAdView.bodyView).text = nativeAppInstallAd.body;
  ((UILabel *)appInstallAdView.storeView).text = nativeAppInstallAd.store;
  ((UILabel *)appInstallAdView.priceView).text = nativeAppInstallAd.price;
  ((UIImageView *)appInstallAdView.imageView).image =
      ((GADNativeAdImage *)[nativeAppInstallAd.images firstObject]).image;
  ((UIImageView *)appInstallAdView.starRatingView).image =
      [self imageForStars:nativeAppInstallAd.starRating];
}

/// Gets an image representing the number of stars. Returns nil if rating is less than 3.5 stars.
- (UIImage *)imageForStars:(NSDecimalNumber *)numberOfStars {
  double starRating = [numberOfStars doubleValue];
  if (starRating >= 5) {
    return [UIImage imageNamed:@"stars_5.png"];
  } else if (starRating >= 4.5) {
    return [UIImage imageNamed:@"stars_4_5.png"];
  } else if (starRating >= 4) {
    return [UIImage imageNamed:@"stars_4.png"];
  } else if (starRating >= 3.5) {
    return [UIImage imageNamed:@"stars_3_5.png"];
  } else {
    return nil;
  }
}

#pragma mark GADNativeContentAdLoaderDelegate implementation

- (void)adLoader:(GADAdLoader *)adLoader
    didReceiveNativeContentAd:(GADNativeContentAd *)nativeContentAd {
  NSLog(@"Received native content ad: %@", nativeContentAd);
  self.refreshButton.enabled = YES;

  // Create and place ad in view hierarchy.
  GADNativeContentAdView *contentAdView =
      [[[NSBundle mainBundle] loadNibNamed:@"NativeContentAdView"
                                     owner:nil
                                   options:nil] firstObject];
  [self setAdView:contentAdView];

  // Associate the content ad view with the content ad object. This is required to make the ad
  // clickable.
  contentAdView.nativeContentAd = nativeContentAd;

  // Populate the content ad view with the content ad assets.
  ((UILabel *)contentAdView.headlineView).text = nativeContentAd.headline;
  ((UILabel *)contentAdView.bodyView).text = nativeContentAd.body;
  ((UIImageView *)contentAdView.imageView).image =
      ((GADNativeAdImage *)[nativeContentAd.images firstObject]).image;

  ((UIImageView *)contentAdView.logoView).image = nativeContentAd.logo.image;
  [((UIButton *)contentAdView.callToActionView)setTitle:nativeContentAd.callToAction
                                               forState:UIControlStateNormal];
  ((UILabel *)contentAdView.advertiserView).text = nativeContentAd.advertiser;
}

#pragma mark GADNativeCustomTemplateAdLoaderDelegate implementation

- (void)adLoader:(GADAdLoader *)adLoader
    didReceiveNativeCustomTemplateAd:(GADNativeCustomTemplateAd *)nativeCustomTemplateAd {
  NSLog(@"Received custom native ad: %@", nativeCustomTemplateAd);
  self.refreshButton.enabled = YES;

  // Create and place ad in view hierarchy.
  MySimpleNativeAdView *mySimpleNativeAdView =
      [[[NSBundle mainBundle] loadNibNamed:@"SimpleCustomNativeAdView"
                                     owner:nil
                                   options:nil] firstObject];
  [self setAdView:mySimpleNativeAdView];

  // Populate the custom native ad view with its assets.
  [mySimpleNativeAdView populateWithCustomNativeAd:nativeCustomTemplateAd];
}

- (NSArray *)nativeCustomTemplateIDsForAdLoader:(GADAdLoader *)adLoader {
  return @[ @"10063170" ];
}

@end


text:
<!--
  ~ Copyright (c) 2010-2017 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<role oid="7385820e-5cb3-11e7-96a3-1ba6f1dc6281"
        xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3">
    <name>Whatever</name>

</role>


text:
package org.springframework.web.filter;

import io.micrometer.observation.ObservationRegistry;
import io.micrometer.observation.tck.TestObservationRegistry;
import io.micrometer.observation.tck.TestObservationRegistryAssert;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import org.junit.jupiter.api.Test;

import org.springframework.http.HttpMethod;
import org.springframework.http.server.observation.ServerRequestObservationContext;
import org.springframework.web.testfixture.servlet.MockFilterChain;
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

/**
 * Tests for {@link ServerHttpObservationFilter}.
 *
 * @author Brian Clozel
 */
class ServerHttpObservationFilterTests {

	private final TestObservationRegistry observationRegistry = TestObservationRegistry.create();

	private final ServerHttpObservationFilter filter = new ServerHttpObservationFilter(this.observationRegistry);

	private final MockFilterChain mockFilterChain = new MockFilterChain();

	private final MockHttpServletRequest request = new MockHttpServletRequest(HttpMethod.GET.name(), "/resource/test");

	private final MockHttpServletResponse response = new MockHttpServletResponse();

	@Test
	void filterShouldFillObservationContext() throws Exception {
		this.filter.doFilter(this.request, this.response, this.mockFilterChain);

		ServerRequestObservationContext context = (ServerRequestObservationContext) this.request
				.getAttribute(ServerHttpObservationFilter.CURRENT_OBSERVATION_CONTEXT_ATTRIBUTE);
		assertThat(context).isNotNull();
		assertThat(context.getCarrier()).isEqualTo(this.request);
		assertThat(context.getResponse()).isEqualTo(this.response);
		assertThat(context.getPathPattern()).isNull();
		assertThatHttpObservation().hasLowCardinalityKeyValue("outcome", "SUCCESS");
	}

	@Test
	void filterShouldAcceptNoOpObservationContext() throws Exception {
		ServerHttpObservationFilter filter = new ServerHttpObservationFilter(ObservationRegistry.NOOP);
		filter.doFilter(this.request, this.response, this.mockFilterChain);

		ServerRequestObservationContext context = (ServerRequestObservationContext) this.request
				.getAttribute(ServerHttpObservationFilter.CURRENT_OBSERVATION_CONTEXT_ATTRIBUTE);
		assertThat(context).isNull();
	}

	@Test
	void filterShouldUseThrownException() throws Exception {
		IllegalArgumentException customError = new IllegalArgumentException("custom error");
		this.request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, customError);
		this.filter.doFilter(this.request, this.response, this.mockFilterChain);

		ServerRequestObservationContext context = (ServerRequestObservationContext) this.request
				.getAttribute(ServerHttpObservationFilter.CURRENT_OBSERVATION_CONTEXT_ATTRIBUTE);
		assertThat(context.getError()).isEqualTo(customError);
		assertThatHttpObservation().hasLowCardinalityKeyValue("exception", "IllegalArgumentException");
	}

	@Test
	void filterShouldUnwrapServletException() {
		IllegalArgumentException customError = new IllegalArgumentException("custom error");

		assertThatThrownBy(() -> {
			this.filter.doFilter(this.request, this.response, (request, response) -> {
				throw new ServletException(customError);
			});
		}).isInstanceOf(ServletException.class);
		ServerRequestObservationContext context = (ServerRequestObservationContext) this.request
				.getAttribute(ServerHttpObservationFilter.CURRENT_OBSERVATION_CONTEXT_ATTRIBUTE);
		assertThat(context.getError()).isEqualTo(customError);
		assertThatHttpObservation().hasLowCardinalityKeyValue("outcome", "SERVER_ERROR");
	}

	@Test
	void filterShouldSetDefaultErrorStatusForBubblingExceptions() {
		assertThatThrownBy(() -> {
			this.filter.doFilter(this.request, this.response, (request, response) -> {
				throw new ServletException(new IllegalArgumentException("custom error"));
			});
		}).isInstanceOf(ServletException.class);
		assertThatHttpObservation().hasLowCardinalityKeyValue("outcome", "SERVER_ERROR")
				.hasLowCardinalityKeyValue("status", "500");
	}

	private TestObservationRegistryAssert.TestObservationRegistryAssertReturningObservationContextAssert assertThatHttpObservation() {
		return TestObservationRegistryAssert.assertThat(this.observationRegistry)
				.hasObservationWithNameEqualTo("http.server.requests").that();
	}

}


text:
namespace GDQSchedule
{
    partial class Form2
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form2));
            this.button1 = new System.Windows.Forms.Button();
            this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
            this.label1 = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.textBox3 = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.textBox4 = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.BackColor = System.Drawing.Color.Black;
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.Location = new System.Drawing.Point(109, 238);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(134, 32);
            this.button1.TabIndex = 0;
            this.button1.Text = "Save";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // numericUpDown1
            //
            this.numericUpDown1.BackColor = System.Drawing.Color.Black;
            this.numericUpDown1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.numericUpDown1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.numericUpDown1.ForeColor = System.Drawing.Color.White;
            this.numericUpDown1.Location = new System.Drawing.Point(109, 191);
            this.numericUpDown1.Maximum = new decimal(new int[] {
            1000000000,
            0,
            0,
            0});
            this.numericUpDown1.Minimum = new decimal(new int[] {
            1000000000,
            0,
            0,
            -2147483648});
            this.numericUpDown1.Name = "numericUpDown1";
            this.numericUpDown1.Size = new System.Drawing.Size(134, 31);
            this.numericUpDown1.TabIndex = 1;
            //
            // label1
            //
            this.label1.ForeColor = System.Drawing.Color.White;
            this.label1.Location = new System.Drawing.Point(106, 165);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(137, 14);
            this.label1.TabIndex = 2;
            this.label1.Text = "Minutes Behind Schedule";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.label1.Click += new System.EventHandler(this.label1_Click);
            //
            // textBox1
            //
            this.textBox1.BackColor = System.Drawing.Color.Black;
            this.textBox1.ForeColor = System.Drawing.Color.White;
            this.textBox1.Location = new System.Drawing.Point(51, 25);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(250, 20);
            this.textBox1.TabIndex = 4;
            this.textBox1.Text = "[Event]";
            //
            // label2
            //
            this.label2.ForeColor = System.Drawing.Color.White;
            this.label2.Location = new System.Drawing.Point(51, 9);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(250, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "Event Name";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // textBox2
            //
            this.textBox2.BackColor = System.Drawing.Color.Black;
            this.textBox2.ForeColor = System.Drawing.Color.White;
            this.textBox2.Location = new System.Drawing.Point(51, 64);
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new System.Drawing.Size(250, 20);
            this.textBox2.TabIndex = 6;
            this.textBox2.Text = "[Event]";
            //
            // label3
            //
            this.label3.ForeColor = System.Drawing.Color.White;
            this.label3.Location = new System.Drawing.Point(51, 48);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(250, 13);
            this.label3.TabIndex = 5;
            this.label3.Text = "Web Link";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // textBox3
            //
            this.textBox3.BackColor = System.Drawing.Color.Black;
            this.textBox3.ForeColor = System.Drawing.Color.White;
            this.textBox3.Location = new System.Drawing.Point(51, 103);
            this.textBox3.Name = "textBox3";
            this.textBox3.Size = new System.Drawing.Size(192, 20);
            this.textBox3.TabIndex = 8;
            this.textBox3.Text = "[Event]";
            //
            // label4
            //
            this.label4.ForeColor = System.Drawing.Color.White;
            this.label4.Location = new System.Drawing.Point(51, 87);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(250, 13);
            this.label4.TabIndex = 7;
            this.label4.Text = "Schedule File Path";
            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // textBox4
            //
            this.textBox4.BackColor = System.Drawing.Color.Black;
            this.textBox4.ForeColor = System.Drawing.Color.White;
            this.textBox4.Location = new System.Drawing.Point(51, 142);
            this.textBox4.Name = "textBox4";
            this.textBox4.Size = new System.Drawing.Size(192, 20);
            this.textBox4.TabIndex = 10;
            this.textBox4.Text = "[Event]";
            //
            // label5
            //
            this.label5.ForeColor = System.Drawing.Color.White;
            this.label5.Location = new System.Drawing.Point(51, 126);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(250, 13);
            this.label5.TabIndex = 9;
            this.label5.Text = "Info Panel File Path";
            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // button2
            //
            this.button2.BackColor = System.Drawing.Color.Black;
            this.button2.ForeColor = System.Drawing.Color.White;
            this.button2.Location = new System.Drawing.Point(249, 103);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(52, 20);
            this.button2.TabIndex = 11;
            this.button2.Text = "Browse";
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // button3
            //
            this.button3.BackColor = System.Drawing.Color.Black;
            this.button3.ForeColor = System.Drawing.Color.White;
            this.button3.Location = new System.Drawing.Point(249, 142);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(52, 20);
            this.button3.TabIndex = 12;
            this.button3.Text = "Browse";
            this.button3.UseVisualStyleBackColor = false;
            this.button3.Click += new System.EventHandler(this.button3_Click);
            //
            // openFileDialog1
            //
            this.openFileDialog1.FileName = "openFileDialog1";
            this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk);
            //
            // Form2
            //
            this.AcceptButton = this.button1;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.Black;
            this.ClientSize = new System.Drawing.Size(346, 286);
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.textBox4);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.textBox3);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.textBox2);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.numericUpDown1);
            this.Controls.Add(this.button1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Form2";
            this.Text = "Settings";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form2_FormClosing);
            this.Load += new System.EventHandler(this.Form2_Load);
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.NumericUpDown numericUpDown1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox textBox3;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.TextBox textBox4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
    }
}


text:
var express = require('express');
var router = express.Router();
const spawn = require('child_process').spawn;

/* Test */
/*
router.get('/', function(req, res, next) {

    var child = spawn('ls', [ '-lh', '/usr' ] );

    child.stdout.on('data', function(chunk) {
        // output will be here in chunks
        process.stdout.write(chunk + '\n');
    });

    child.stderr.on('data', function(chunk) {
        // output will be here in chunks
        process.stdout.write(chunk + '\n');
    });

    res.render('new', { title: 'Express' });
});
*/

/* GET All Requests. */
router.get('/', function (req, res, next) {
    var db = req.db;
    var requests = db.get('requests');
    requests.find({ email: req.user.email }, {}, function (e, rqsts) {
        res.json(201, rqsts);
    });
});

/* Write to the requests file */
router.post('/', function (req, res, next) {

    var db = req.db;
    var requests = db.get('requests');

    /*

     misc:
     email:a.j@xyz.com
     status:EMAILED
     aggregationmetric:
     lats:Array[3]
     timelogged:
     longs:Array[3]
     variable:Array[1]
     interval:
     text:Request for extract
     enddate:19810102
     outputformat:csv
     startdate:19810102
     sourcetype:ErA5

     */

    // If not multiple select
    //var variable = req.body.variable;
    // If  multiple select
    var variable = req.body["variable[]"];

    var latN = req.body.latN;
    var latS = req.body.latS;
    var lonW = req.body.lonW;
    var lonE = req.body.lonE;

    var stdate = req.body.startdate;
    var eddate = req.body.enddate;
    var file = req.body.file;
    var email = req.body.email;
    var dateperformed = req.body.dateperformed;

    var shadelevel = req.body.shadelevel;
    var hod = req.body.hod;
    var interval = req.body.interval;
    var aggregation = req.body.aggregation;

    var sourcetype = req.body.sourcetype;

    if (variable != null && !Array.isArray(variable))
        variable = [variable];

    //latS,latN,lonW,lonE
    var new_request = {
        misc: "",
        email: email,
        status: "OPEN",
        lats: [latS, latN],
        timelogged: dateperformed,
        longs: [lonW, lonE],
        variable: variable,
        text: "",
        shadelevel: shadelevel,
        hod: hod,
        interval: interval,
        aggregation: aggregation,
        enddate: eddate,
        outputformat: file,
        startdate: stdate,
        status_message: "",
        sourcetype: sourcetype,
        version:"2"
    };

    //Using the {w:1} option ensure you get the error back if the document fails to insert correctly.
    //TODO handle error
    //const sgMail = require('@sendgrid/mail')
    //const sgMailApiKey = ''
    //sgMail.setApiKey(sgMailApiKey)

    requests.insert(new_request, { w: 1 }, function (err, request_added) {

        //Request logged
        if (request_added) {
            const childPython = spawn('python', ['index1.py']);

            childPython.stdout.on('data', (data) => {
                var result = `${data}`;
                console.log(result);
            });

            childPython.stderr.on(`data`, (data) => {
                console.error(`stderr: ${data}`);
            });

            childPython.on('close', (code) => {
                console.log(`childprocess exited with code ${code}`)
            })
            //sgMail.setApiKey(process.env.SENDGRID_API_KEY)
/*
            const msg = {
                to: req.body.email, // Change to your recipient
                from: '', // Change to your verified sender
                subject: 'Message from send grid',
                text: 'Message from Send Grid',
            }
            sgMail.send(msg)
                .then((respose) => {
                    console.log('Email sent')
                })
                .catch((error) => {
                    console.error(error)
                })
            */
            res.json(201, {
                success: 'Request logged',
                request_id: request_added._id.toString()
            })
        }
        else {
            res.json(500, {
                error: 'Request not logged.'
            });

        }

    });
});
module.exports = router;


text:
class FileAttachment : public Attachment {
 public:
  using Type = sharing::mojom::FileMetadata::Type;

  explicit FileAttachment(base::FilePath file_path);
  FileAttachment(int64_t id,
                 int64_t size,
                 std::string file_name,
                 std::string mime_type,
                 Type type);
  FileAttachment(const FileAttachment&);
  FileAttachment(FileAttachment&&);
  FileAttachment& operator=(const FileAttachment&);
  FileAttachment& operator=(FileAttachment&&);
  ~FileAttachment() override;

  const std::string& file_name() const { return file_name_; }
  const std::string& mime_type() const { return mime_type_; }
  Type type() const { return type_; }
  const absl::optional<base::FilePath>& file_path() const { return file_path_; }

  // Attachment:
  void MoveToShareTarget(ShareTarget& share_target) override;
  const std::string& GetDescription() const override;
  nearby_share::mojom::ShareType GetShareType() const override;

  void set_file_path(absl::optional<base::FilePath> path) {
    file_path_ = std::move(path);
  }

 private:
  std::string file_name_;
  std::string mime_type_;
  Type type_;
  absl::optional<base::FilePath> file_path_;
};

#endif  // CHROME_BROWSER_NEARBY_SHARING_FILE_ATTACHMENT_H_