text:
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_data/gpio-rcar.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/spinlock.h>
#include <linux/slab.h>

struct gpio_rcar_priv {
	void __iomem *base;
	spinlock_t lock;
	struct gpio_rcar_config config;
	struct platform_device *pdev;
	struct gpio_chip gpio_chip;
	struct irq_chip irq_chip;
	unsigned int irq_parent;
	struct clk *clk;
};

#define IOINTSEL 0x00	/* General IO/Interrupt Switching Register */
#define INOUTSEL 0x04	/* General Input/Output Switching Register */
#define OUTDT 0x08	/* General Output Register */
#define INDT 0x0c	/* General Input Register */
#define INTDT 0x10	/* Interrupt Display Register */
#define INTCLR 0x14	/* Interrupt Clear Register */
#define INTMSK 0x18	/* Interrupt Mask Register */
#define MSKCLR 0x1c	/* Interrupt Mask Clear Register */
#define POSNEG 0x20	/* Positive/Negative Logic Select Register */
#define EDGLEVEL 0x24	/* Edge/level Select Register */
#define FILONOFF 0x28	/* Chattering Prevention On/Off Register */
#define BOTHEDGE 0x4c	/* One Edge/Both Edge Select Register */

#define RCAR_MAX_GPIO_PER_BANK		32

static inline u32 gpio_rcar_read(struct gpio_rcar_priv *p, int offs)
{
	return ioread32(p->base + offs);
}

static inline void gpio_rcar_write(struct gpio_rcar_priv *p, int offs,
				   u32 value)
{
	iowrite32(value, p->base + offs);
}

static void gpio_rcar_modify_bit(struct gpio_rcar_priv *p, int offs,
				 int bit, bool value)
{
	u32 tmp = gpio_rcar_read(p, offs);

	if (value)
		tmp |= BIT(bit);
	else
		tmp &= ~BIT(bit);

	gpio_rcar_write(p, offs, tmp);
}

static void gpio_rcar_irq_disable(struct irq_data *d)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct gpio_rcar_priv *p = container_of(gc, struct gpio_rcar_priv,
						gpio_chip);

	gpio_rcar_write(p, INTMSK, ~BIT(irqd_to_hwirq(d)));
}

static void gpio_rcar_irq_enable(struct irq_data *d)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct gpio_rcar_priv *p = container_of(gc, struct gpio_rcar_priv,
						gpio_chip);

	gpio_rcar_write(p, MSKCLR, BIT(irqd_to_hwirq(d)));
}

static void gpio_rcar_config_interrupt_input_mode(struct gpio_rcar_priv *p,
						  unsigned int hwirq,
						  bool active_high_rising_edge,
						  bool level_trigger,
						  bool both)
{
	unsigned long flags;

	/* follow steps in the GPIO documentation for
	 * "Setting Edge-Sensitive Interrupt Input Mode" and
	 * "Setting Level-Sensitive Interrupt Input Mode"
	 */

	spin_lock_irqsave(&p->lock, flags);

	/* Configure postive or negative logic in POSNEG */
	gpio_rcar_modify_bit(p, POSNEG, hwirq, !active_high_rising_edge);

	/* Configure edge or level trigger in EDGLEVEL */
	gpio_rcar_modify_bit(p, EDGLEVEL, hwirq, !level_trigger);

	/* Select one edge or both edges in BOTHEDGE */
	if (p->config.has_both_edge_trigger)
		gpio_rcar_modify_bit(p, BOTHEDGE, hwirq, both);

	/* Select "Interrupt Input Mode" in IOINTSEL */
	gpio_rcar_modify_bit(p, IOINTSEL, hwirq, true);

	/* Write INTCLR in case of edge trigger */
	if (!level_trigger)
		gpio_rcar_write(p, INTCLR, BIT(hwirq));

	spin_unlock_irqrestore(&p->lock, flags);
}

static int gpio_rcar_irq_set_type(struct irq_data *d, unsigned int type)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct gpio_rcar_priv *p = container_of(gc, struct gpio_rcar_priv,
						gpio_chip);
	unsigned int hwirq = irqd_to_hwirq(d);

	dev_dbg(&p->pdev->dev, "sense irq = %d, type = %d\n", hwirq, type);

	switch (type & IRQ_TYPE_SENSE_MASK) {
	case IRQ_TYPE_LEVEL_HIGH:
		gpio_rcar_config_interrupt_input_mode(p, hwirq, true, true,
						      false);
		break;
	case IRQ_TYPE_LEVEL_LOW:
		gpio_rcar_config_interrupt_input_mode(p, hwirq, false, true,
						      false);
		break;
	case IRQ_TYPE_EDGE_RISING:
		gpio_rcar_config_interrupt_input_mode(p, hwirq, true, false,
						      false);
		break;
	case IRQ_TYPE_EDGE_FALLING:
		gpio_rcar_config_interrupt_input_mode(p, hwirq, false, false,
						      false);
		break;
	case IRQ_TYPE_EDGE_BOTH:
		if (!p->config.has_both_edge_trigger)
			return -EINVAL;
		gpio_rcar_config_interrupt_input_mode(p, hwirq, true, false,
						      true);
		break;
	default:
		return -EINVAL;
	}
	return 0;
}

static int gpio_rcar_irq_set_wake(struct irq_data *d, unsigned int on)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct gpio_rcar_priv *p = container_of(gc, struct gpio_rcar_priv,
						gpio_chip);
	int error;

	if (p->irq_parent) {
		error = irq_set_irq_wake(p->irq_parent, on);
		if (error) {
			dev_dbg(&p->pdev->dev,
				"irq %u doesn't support irq_set_wake\n",
				p->irq_parent);
			p->irq_parent = 0;
		}
	}

	if (!p->clk)
		return 0;

	if (on)
		clk_enable(p->clk);
	else
		clk_disable(p->clk);

	return 0;
}

static irqreturn_t gpio_rcar_irq_handler(int irq, void *dev_id)
{
	struct gpio_rcar_priv *p = dev_id;
	u32 pending;
	unsigned int offset, irqs_handled = 0;

	while ((pending = gpio_rcar_read(p, INTDT) &
			  gpio_rcar_read(p, INTMSK))) {
		offset = __ffs(pending);
		gpio_rcar_write(p, INTCLR, BIT(offset));
		generic_handle_irq(irq_find_mapping(p->gpio_chip.irqdomain,
						    offset));
		irqs_handled++;
	}

	return irqs_handled ? IRQ_HANDLED : IRQ_NONE;
}

static inline struct gpio_rcar_priv *gpio_to_priv(struct gpio_chip *chip)
{
	return container_of(chip, struct gpio_rcar_priv, gpio_chip);
}

static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip,
						       unsigned int gpio,
						       bool output)
{
	struct gpio_rcar_priv *p = gpio_to_priv(chip);
	unsigned long flags;

	/* follow steps in the GPIO documentation for
	 * "Setting General Output Mode" and
	 * "Setting General Input Mode"
	 */

	spin_lock_irqsave(&p->lock, flags);

	/* Configure postive logic in POSNEG */
	gpio_rcar_modify_bit(p, POSNEG, gpio, false);

	/* Select "General Input/Output Mode" in IOINTSEL */
	gpio_rcar_modify_bit(p, IOINTSEL, gpio, false);

	/* Select Input Mode or Output Mode in INOUTSEL */
	gpio_rcar_modify_bit(p, INOUTSEL, gpio, output);

	spin_unlock_irqrestore(&p->lock, flags);
}

static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset)
{
	struct gpio_rcar_priv *p = gpio_to_priv(chip);
	int error;

	error = pm_runtime_get_sync(&p->pdev->dev);
	if (error < 0)
		return error;

	error = pinctrl_request_gpio(chip->base + offset);
	if (error)
		pm_runtime_put(&p->pdev->dev);

	return error;
}

static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset)
{
	struct gpio_rcar_priv *p = gpio_to_priv(chip);

	pinctrl_free_gpio(chip->base + offset);

	/* Set the GPIO as an input to ensure that the next GPIO request won't
	 * drive the GPIO pin as an output.
	 */
	gpio_rcar_config_general_input_output_mode(chip, offset, false);

	pm_runtime_put(&p->pdev->dev);
}

static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset)
{
	gpio_rcar_config_general_input_output_mode(chip, offset, false);
	return 0;
}

static int gpio_rcar_get(struct gpio_chip *chip, unsigned offset)
{
	u32 bit = BIT(offset);

	/* testing on r8a7790 shows that INDT does not show correct pin state
	 * when configured as output, so use OUTDT in case of output pins */
	if (gpio_rcar_read(gpio_to_priv(chip), INOUTSEL) & bit)
		return !!(gpio_rcar_read(gpio_to_priv(chip), OUTDT) & bit);
	else
		return !!(gpio_rcar_read(gpio_to_priv(chip), INDT) & bit);
}

static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)
{
	struct gpio_rcar_priv *p = gpio_to_priv(chip);
	unsigned long flags;

	spin_lock_irqsave(&p->lock, flags);
	gpio_rcar_modify_bit(p, OUTDT, offset, value);
	spin_unlock_irqrestore(&p->lock, flags);
}

static int gpio_rcar_direction_output(struct gpio_chip *chip, unsigned offset,
				      int value)
{
	/* write GPIO value to output before selecting output mode of pin */
	gpio_rcar_set(chip, offset, value);
	gpio_rcar_config_general_input_output_mode(chip, offset, true);
	return 0;
}

struct gpio_rcar_info {
	bool has_both_edge_trigger;
};

static const struct gpio_rcar_info gpio_rcar_info_gen1 = {
	.has_both_edge_trigger = false,
};

static const struct gpio_rcar_info gpio_rcar_info_gen2 = {
	.has_both_edge_trigger = true,
};

static const struct of_device_id gpio_rcar_of_table[] = {
	{
		.compatible = "renesas,gpio-r8a7790",
		.data = &gpio_rcar_info_gen2,
	}, {
		.compatible = "renesas,gpio-r8a7791",
		.data = &gpio_rcar_info_gen2,
	}, {
		.compatible = "renesas,gpio-r8a7793",
		.data = &gpio_rcar_info_gen2,
	}, {
		.compatible = "renesas,gpio-r8a7794",
		.data = &gpio_rcar_info_gen2,
	}, {
		.compatible = "renesas,gpio-r8a7795",
		/* Gen3 GPIO is identical to Gen2. */
		.data = &gpio_rcar_info_gen2,
	}, {
		.compatible = "renesas,gpio-rcar",
		.data = &gpio_rcar_info_gen1,
	}, {
		/* Terminator */
	},
};

MODULE_DEVICE_TABLE(of, gpio_rcar_of_table);

static int gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
{
	struct gpio_rcar_config *pdata = dev_get_platdata(&p->pdev->dev);
	struct device_node *np = p->pdev->dev.of_node;
	struct of_phandle_args args;
	int ret;

	if (pdata) {
		p->config = *pdata;
	} else if (IS_ENABLED(CONFIG_OF) && np) {
		const struct of_device_id *match;
		const struct gpio_rcar_info *info;

		match = of_match_node(gpio_rcar_of_table, np);
		if (!match)
			return -EINVAL;

		info = match->data;

		ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0,
						       &args);
		p->config.number_of_pins = ret == 0 ? args.args[2]
					 : RCAR_MAX_GPIO_PER_BANK;
		p->config.gpio_base = -1;
		p->config.has_both_edge_trigger = info->has_both_edge_trigger;
	}

	if (p->config.number_of_pins == 0 ||
	    p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) {
		dev_warn(&p->pdev->dev,
			 "Invalid number of gpio lines %u, using %u\n",
			 p->config.number_of_pins, RCAR_MAX_GPIO_PER_BANK);
		p->config.number_of_pins = RCAR_MAX_GPIO_PER_BANK;
	}

	return 0;
}

static int gpio_rcar_probe(struct platform_device *pdev)
{
	struct gpio_rcar_priv *p;
	struct resource *io, *irq;
	struct gpio_chip *gpio_chip;
	struct irq_chip *irq_chip;
	struct device *dev = &pdev->dev;
	const char *name = dev_name(dev);
	int ret;

	p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL);
	if (!p)
		return -ENOMEM;

	p->pdev = pdev;
	spin_lock_init(&p->lock);

	/* Get device configuration from DT node or platform data. */
	ret = gpio_rcar_parse_pdata(p);
	if (ret < 0)
		return ret;

	platform_set_drvdata(pdev, p);

	p->clk = devm_clk_get(dev, NULL);
	if (IS_ERR(p->clk)) {
		dev_warn(dev, "unable to get clock\n");
		p->clk = NULL;
	}

	pm_runtime_enable(dev);

	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);

	if (!io || !irq) {
		dev_err(dev, "missing IRQ or IOMEM\n");
		ret = -EINVAL;
		goto err0;
	}

	p->base = devm_ioremap_nocache(dev, io->start, resource_size(io));
	if (!p->base) {
		dev_err(dev, "failed to remap I/O memory\n");
		ret = -ENXIO;
		goto err0;
	}

	gpio_chip = &p->gpio_chip;
	gpio_chip->request = gpio_rcar_request;
	gpio_chip->free = gpio_rcar_free;
	gpio_chip->direction_input = gpio_rcar_direction_input;
	gpio_chip->get = gpio_rcar_get;
	gpio_chip->direction_output = gpio_rcar_direction_output;
	gpio_chip->set = gpio_rcar_set;
	gpio_chip->label = name;
	gpio_chip->dev = dev;
	gpio_chip->owner = THIS_MODULE;
	gpio_chip->base = p->config.gpio_base;
	gpio_chip->ngpio = p->config.number_of_pins;

	irq_chip = &p->irq_chip;
	irq_chip->name = name;
	irq_chip->irq_mask = gpio_rcar_irq_disable;
	irq_chip->irq_unmask = gpio_rcar_irq_enable;
	irq_chip->irq_set_type = gpio_rcar_irq_set_type;
	irq_chip->irq_set_wake = gpio_rcar_irq_set_wake;
	irq_chip->flags	= IRQCHIP_SET_TYPE_MASKED | IRQCHIP_MASK_ON_SUSPEND;

	ret = gpiochip_add(gpio_chip);
	if (ret) {
		dev_err(dev, "failed to add GPIO controller\n");
		goto err0;
	}

	ret = gpiochip_irqchip_add(gpio_chip, irq_chip, p->config.irq_base,
				   handle_level_irq, IRQ_TYPE_NONE);
	if (ret) {
		dev_err(dev, "cannot add irqchip\n");
		goto err1;
	}

	p->irq_parent = irq->start;
	if (devm_request_irq(dev, irq->start, gpio_rcar_irq_handler,
			     IRQF_SHARED, name, p)) {
		dev_err(dev, "failed to request IRQ\n");
		ret = -ENOENT;
		goto err1;
	}

	dev_info(dev, "driving %d GPIOs\n", p->config.number_of_pins);

	/* warn in case of mismatch if irq base is specified */
	if (p->config.irq_base) {
		ret = irq_find_mapping(gpio_chip->irqdomain, 0);
		if (p->config.irq_base != ret)
			dev_warn(dev, "irq base mismatch (%u/%u)\n",
				 p->config.irq_base, ret);
	}

	if (p->config.pctl_name) {
		ret = gpiochip_add_pin_range(gpio_chip, p->config.pctl_name, 0,
					     gpio_chip->base, gpio_chip->ngpio);
		if (ret < 0)
			dev_warn(dev, "failed to add pin range\n");
	}

	return 0;

err1:
	gpiochip_remove(gpio_chip);
err0:
	pm_runtime_disable(dev);
	return ret;
}

static int gpio_rcar_remove(struct platform_device *pdev)
{
	struct gpio_rcar_priv *p = platform_get_drvdata(pdev);

	gpiochip_remove(&p->gpio_chip);

	pm_runtime_disable(&pdev->dev);
	return 0;
}

static struct platform_driver gpio_rcar_device_driver = {
	.probe		= gpio_rcar_probe,
	.remove		= gpio_rcar_remove,
	.driver		= {
		.name	= "gpio_rcar",
		.of_match_table = of_match_ptr(gpio_rcar_of_table),
	}
};

module_platform_driver(gpio_rcar_device_driver);

MODULE_AUTHOR("Magnus Damm");
MODULE_DESCRIPTION("Renesas R-Car GPIO Driver");
MODULE_LICENSE("GPL v2");


text:
import * as MomentTS from 'moment'; import MomentBabel from 'moment'; const moment = typeof MomentTS === 'function' ? MomentTS : MomentBabel; // moment import uses export = {} syntax - which works differently in typescript and babel, so we load both and pick the one that worked :'(
import { NormalizedProject } from '../../index.types';
import { createProject, createTags } from '../..';

import { tags as parentTags } from '..';

export let title = `Pathfinder 2`;

export let start = `2019-10`;
export let end = ``;

export let duration = moment.duration(moment().diff(moment(start))).toJSON();

export let summaryMarkdown = `
Rewrite to reduce technical debt of pathfinder

`;

export let tags = parentTags.concat(createTags(duration, [
  `Typescript`,
  `NodeJS`,
  `Webpack`,
  `Git`,
  `Sass`,
  `React`,
  `Redux`,
  `HTML`,
  `CSS`,
  `Koa`,
  `Docker`,
  `GraphQL`,
]));

export let icons = [
  `Webpack`,
  `NodeJS`,
  `Docker`,
  `React`,
];

export let portfolio = undefined;

export let project: NormalizedProject = createProject({
  title,
  start,
  end,
  duration,
  icons,
  tags,
  summaryMarkdown,
  portfolio,
});

export default project;

redpajama_set_name: RedPajamaGithub


text:
package greycat.ml;

import greycat.Node;
import greycat.Callback;

public interface ClusteringNode extends Node {

    /**
     * Main training function to learn from the the expected output,
     * The input features are defined through features extractions.
     *
     * @param callback Called when the learning is completed with the status of learning true/false
     */
    void learn(Callback<Boolean> callback);

    /**
     * Main infer function to give a cluster ID,
     * The input features are defined through features extractions.
     *
     * @param callback Called when the infer is completed with the result of the cluster ID
     */
    void inferCluster(Callback<Integer> callback);
}


text:
Some lifetime patterns are overwelmingly common and so the borrow checker
will implicitly add them to save typing and to improve readability.
This process of implicit addition is called elision. Elision exists in Rust
solely because these patterns are common.

The following code shows a few examples of elision. For a more comprehensive
description of elision, see [lifetime elision][elision] in the book.

{elision.play}

### See also:

[elision][elision]

[elision]: http://doc.rust-lang.org/book/lifetimes.html#lifetime-elision


text:
package com.github.abel533.echarts.code;

/**
 * @author liuzh
 */
public enum FontWeight {
    normal, bold, bolder, lighter
}


text:
package com.sequenceiq.redbeams.service.drivers;

import java.sql.Driver;
import java.util.function.Consumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.sequenceiq.cloudbreak.api.endpoint.v4.common.DatabaseVendor;
import com.sequenceiq.redbeams.domain.DatabaseConfig;
import com.sequenceiq.redbeams.domain.DatabaseServerConfig;

/**
 * Caches and retrieves database drivers.
 */
@Service
public class DriverFunctions {

    private static final Logger LOGGER = LoggerFactory.getLogger(DriverFunctions.class);

    /**
     * Executes the given function with the associated driver.
     *
     * @param databaseConfig the database config used to get the driver
     * @param consumer       the function to execute
     * @throws DriverLoadingException if there was a problem loading the driver
     */
    public void execWithDatabaseDriver(DatabaseConfig databaseConfig, Consumer<DriverWithConnectivity> consumer) {
        execWithDatabaseDriver(databaseConfig.getDatabaseVendor(), consumer);
    }

    /**
     * Executes the given function with the associated driver.
     *
     * @param databaseServerConfig the database server config used to get the driver
     * @param consumer             the function to execute
     */
    public void execWithDatabaseDriver(DatabaseServerConfig databaseServerConfig,
        Consumer<DriverWithConnectivity> consumer) {
        execWithDatabaseDriver(databaseServerConfig.getDatabaseVendor(), consumer);
    }

    /**
     * Executes the given function with the associated driver.
     *
     * @param databaseVendor  the database vendor
     * @param consumer        the function to execute
     * @throws DriverLoadingException if there was a problem loading the driver
     */
    private void execWithDatabaseDriver(DatabaseVendor databaseVendor, Consumer<DriverWithConnectivity> consumer) {
        Driver driver;
        switch (databaseVendor) {
            case POSTGRES:
                LOGGER.debug("Using internal driver for " + databaseVendor);
                driver = new org.postgresql.Driver();
                break;
            default:
                throw new UnsupportedOperationException("Database access not supported for " + databaseVendor);
        }
        consumer.accept(new DriverWithConnectivity(driver));
    }
}


text:
class Enemy : public GameObject {
 public:

  void setSpeed(int);  // Function for setting enemy speed
  int getSpeed();  // Function for getting enemy speed

  void setHealth(int);  // Function for setting enemny health
  int getHealth();  // Function for getting enemy health

  void setAlive(bool);  // Function for setting enemy life status
  bool getAlive();  // Function for getting enemy life status

  void setPosition(int, int);
  void setPosition(std::pair<int, int>);
  std::pair<int, int> getPosition();

  void setMoney(int);
  int getMoney();

  bool move();
  void setPath(Path*);

  virtual void setWave(int);
  int wave;

  void setPower(int);
  int getPower();

 protected:
  int power;
  int x;
  int y;
  int speed;
  int money;
  int health;
  bool isAlive;
  Path* path;
  int pathInd;
};
#endif


text:
package io.muoncore.message;

public class MuonOutboundMessage extends MuonMessage {

    public MuonOutboundMessage(String id, long created, String targetServiceName, String targetInstance, String sourceServiceName, String protocol, String step, Status status, byte[] payload, String contentType, ChannelOperation channelOperation) {
        super(id, created, targetServiceName, targetInstance, sourceServiceName, protocol, step, status, payload, contentType, channelOperation);
    }

    public MuonInboundMessage toInbound() {
        return new MuonInboundMessage(
                getId(), getCreated(), getSourceServiceName(), null, getTargetServiceName(),
          getProtocol(), getStep(), getStatus(), getPayload(), getContentType(), getChannelOperation());
    }
}


text:
set -o errexit -o errtrace -o nounset -o pipefail

MODULE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOG_FILE_NAME="generate.log"
LOG_FILE=${MODULE_DIR}/${LOG_FILE_NAME}

function errNotify() {
    println "Error while generating conformance tests";
    if [[ ${CI:-false} == true ]]; then
      println "Dumping log file to stderr..."
      println "--- ${LOG_FILE_NAME} -----------------------------------------------"
      cat ${LOG_FILE_NAME} | sed 's/^/>> /g' >&2;
      println "----------------------------------------------------------------"
    else
      println "See ${LOG_FILE_NAME} for details";
    fi
    return 1
}
trap errNotify ERR

function reportMaven() {
  if [[ ${CI:-false} == true ]]; then
    mvn --version >> $1 2>&1
  fi
}

function cpDir() {
  mkdir -p $1
  cp -R -t $1 ${@:2}
}

function main() {
  rm ${LOG_FILE} 2> /dev/null || true
  reportMaven "${LOG_FILE}"

  local javaBasePackage="com/google/cloud/conformance"
  local firestorePackage="${javaBasePackage}/firestore/v1"
  local storagePackage="${javaBasePackage}/storage/v1"
  local bigtablePackage="${javaBasePackage}/bigtable/v2"

  msg "Cleaning existing generated protos"
  rm -rf src/main/java/${firestorePackage}/*
  rm -rf src/main/java/${storagePackage}/*
  rm -rf src/main/java/${bigtablePackage}/*
  msg "Cleaning existing test definitions"
  rm -rf src/main/resources/${firestorePackage}/*
  rm -rf src/main/resources/${storagePackage}/*
  rm -rf src/main/resources/${bigtablePackage}/*
  msg "Cleaning existing proto files"
  rm -rf src/main/proto/google/cloud/conformance/firestore/v1/*
  rm -rf src/main/proto/google/cloud/conformance/storage/v1/*
  rm -rf src/main/proto/google/cloud/conformance/bigtable/v2/*

  msg "Copying new proto files"
  cpDir src/main/proto/ conformance-tests/firestore/v1/proto/*
  cpDir src/main/proto/ conformance-tests/storage/v1/proto/*
  cpDir src/main/proto/ conformance-tests/bigtable/v2/proto/*
  msg "Copying new test definitions"
  cpDir "src/main/resources/${firestorePackage}/" conformance-tests/firestore/v1/*.json
  cpDir "src/main/resources/${storagePackage}/" conformance-tests/storage/v1/*.json
  cpDir "src/main/resources/${bigtablePackage}/" conformance-tests/bigtable/v2/*.json

  msg "Generating protos"
  set +o errexit
  mvn -Pgen-conformance-protos clean verify >> ${LOG_FILE} 2>&1
  mvnExitCode=$?
  set -o errexit

  ## move generated proto class(es) into the main src root
  cpDir src/main/java/ target/generated-sources/protobuf/java/*

  if [ $mvnExitCode -ne 0 ]; then
    exit $mvnExitCode
  fi
  ## cleanup any generated files that may have not been moved over
  mvn clean >> ${LOG_FILE} 2>&1

  msg "Building module..."
  ## ensure building of the module still works
  mvn clean package | tee -a ${LOG_FILE}
  msg "Complete"
}

function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
function msg { println "$*" | tee -a ${LOG_FILE} >&2 ;}
function println { printf '%s\n' "$(now) $*" ;}

main


text:
		<title>PxPrismaticJoint Class Reference</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">

				Main Page
				Class Hierarchy
				Compound List
				Compound Members

Public Member Functions |
Protected Member Functions |
List of all members

PxPrismaticJoint Class Referenceabstract
Extensions

A prismatic joint permits relative translational movement between two bodies along an axis, but no relative rotational movement.
 More...

#include <PxPrismaticJoint.h>

Inheritance diagram for PxPrismaticJoint:

<map name="PxPrismaticJoint_inherit__map" id="PxPrismaticJoint_inherit__map">
</map>
[legend]

Collaboration diagram for PxPrismaticJoint:

<map name="PxPrismaticJoint_coll__map" id="PxPrismaticJoint_coll__map">
</map>
[legend]

Public Member Functions

virtual PxReal 	getPosition () const =0

 	returns the displacement of the joint along its axis.  More...

virtual PxReal 	getVelocity () const =0

 	returns the velocity of the joint along its axis  More...

virtual void 	setLimit (const PxJointLinearLimitPair &)=0

 	sets the joint limit parameters.  More...

virtual PxJointLinearLimitPair 	getLimit () const =0

 	gets the joint limit parameters.  More...

virtual void 	setPrismaticJointFlags (PxPrismaticJointFlags flags)=0

 	Set the flags specific to the Prismatic Joint.  More...

virtual void 	setPrismaticJointFlag (PxPrismaticJointFlag::Enum flag, bool value)=0

 	Set a single flag specific to a Prismatic Joint to true or false.  More...

virtual PxPrismaticJointFlags 	getPrismaticJointFlags (void) const =0

 	Get the flags specific to the Prismatic Joint.  More...

virtual void 	setProjectionLinearTolerance (PxReal tolerance)=0

 	Set the linear tolerance threshold for projection.  More...

virtual PxReal 	getProjectionLinearTolerance () const =0

 	Get the linear tolerance threshold for projection.  More...

virtual void 	setProjectionAngularTolerance (PxReal tolerance)=0

 	Set the angular tolerance threshold for projection. Projection is enabled if PxConstraintFlag::ePROJECTION is set for the joint.  More...

virtual PxReal 	getProjectionAngularTolerance () const =0

 	Get the angular tolerance threshold for projection.  More...

virtual const char * 	getConcreteTypeName () const

 	Returns string name of PxPrismaticJoint, used for serialization.  More...

 Public Member Functions inherited from PxJoint

virtual void 	setActors (PxRigidActor *actor0, PxRigidActor *actor1)=0

 	Set the actors for this joint.  More...

virtual void 	getActors (PxRigidActor *&actor0, PxRigidActor *&actor1) const =0

 	Get the actors for this joint.  More...

virtual void 	setLocalPose (PxJointActorIndex::Enum actor, const PxTransform &localPose)=0

 	Set the joint local pose for an actor.  More...

virtual PxTransform 	getLocalPose (PxJointActorIndex::Enum actor) const =0

 	get the joint local pose for an actor.  More...

virtual PxTransform 	getRelativeTransform () const =0

 	get the relative pose for this joint  More...

virtual PxVec3 	getRelativeLinearVelocity () const =0

 	get the relative linear velocity of the joint  More...

virtual PxVec3 	getRelativeAngularVelocity () const =0

 	get the relative angular velocity of the joint  More...

virtual void 	setBreakForce (PxReal force, PxReal torque)=0

 	set the break force for this joint.  More...

virtual void 	getBreakForce (PxReal &force, PxReal &torque) const =0

 	get the break force for this joint.  More...

virtual void 	setConstraintFlags (PxConstraintFlags flags)=0

 	set the constraint flags for this joint.  More...

virtual void 	setConstraintFlag (PxConstraintFlag::Enum flag, bool value)=0

 	set a constraint flags for this joint to a specified value.  More...

virtual PxConstraintFlags 	getConstraintFlags () const =0

 	get the constraint flags for this joint.  More...

virtual void 	setInvMassScale0 (PxReal invMassScale)=0

 	set the inverse mass scale for actor0.  More...

virtual PxReal 	getInvMassScale0 () const =0

 	get the inverse mass scale for actor0.  More...

virtual void 	setInvInertiaScale0 (PxReal invInertiaScale)=0

 	set the inverse inertia scale for actor0.  More...

virtual PxReal 	getInvInertiaScale0 () const =0

 	get the inverse inertia scale for actor0.  More...

virtual void 	setInvMassScale1 (PxReal invMassScale)=0

 	set the inverse mass scale for actor1.  More...

virtual PxReal 	getInvMassScale1 () const =0

 	get the inverse mass scale for actor1.  More...

virtual void 	setInvInertiaScale1 (PxReal invInertiaScale)=0

 	set the inverse inertia scale for actor1.  More...

virtual PxReal 	getInvInertiaScale1 () const =0

 	get the inverse inertia scale for actor1.  More...

virtual PxConstraint * 	getConstraint () const =0

 	Retrieves the PxConstraint corresponding to this joint.  More...

virtual void 	setName (const char *name)=0

 	Sets a name string for the object that can be retrieved with getName().  More...

virtual const char * 	getName () const =0

 	Retrieves the name string set with setName().  More...

virtual void 	release ()=0

 	Deletes the joint.  More...

virtual PxScene * 	getScene () const =0

 	Retrieves the scene which this joint belongs to.  More...

PX_DEPRECATED PxJointType::Enum 	getType ()

 	Deprecated method to retrieves the type of this joint. Please use getConcreteType()  More...

 Public Member Functions inherited from PxBase

template<class T >

T * 	is ()

template<class T >

const T * 	is () const

PX_INLINE PxType 	getConcreteType () const

 	Returns concrete type of object.  More...

PX_INLINE void 	setBaseFlag (PxBaseFlag::Enum flag, bool value)

 	Set PxBaseFlag.  More...

PX_INLINE void 	setBaseFlags (PxBaseFlags inFlags)

 	Set PxBaseFlags.  More...

PX_INLINE PxBaseFlags 	getBaseFlags () const

 	Returns PxBaseFlags.  More...

virtual bool 	isReleasable () const

 	Whether the object is subordinate.  More...

Protected Member Functions

PX_INLINE 	PxPrismaticJoint (PxType concreteType, PxBaseFlags baseFlags)

 	Constructor.  More...

PX_INLINE 	PxPrismaticJoint (PxBaseFlags baseFlags)

 	Deserialization constructor.  More...

virtual bool 	isKindOf (const char *name) const

 	Returns whether a given type name matches with the type of this instance.  More...

 Protected Member Functions inherited from PxJoint

virtual 	~PxJoint ()

PX_INLINE 	PxJoint (PxType concreteType, PxBaseFlags baseFlags)

 	Constructor.  More...

PX_INLINE 	PxJoint (PxBaseFlags baseFlags)

 	Deserialization constructor.  More...

 Protected Member Functions inherited from PxBase

PX_INLINE 	PxBase (PxType concreteType, PxBaseFlags baseFlags)

 	Constructor setting concrete type and base flags.  More...

PX_INLINE 	PxBase (PxBaseFlags baseFlags)

 	Deserialization constructor setting base flags.  More...

virtual 	~PxBase ()

 	Destructor.  More...

template<class T >

bool 	typeMatch () const

Additional Inherited Members

 Static Public Member Functions inherited from PxJoint

static void 	getBinaryMetaData (PxOutputStream &stream)

 	Put class meta data in stream, used for serialization.  More...

 Public Attributes inherited from PxJoint

void * 	userData

 	user can assign this to whatever, usually to create a 1:1 relationship with a user object.  More...

 Protected Attributes inherited from PxBase

PxType 	mConcreteType

PxBaseFlags 	mBaseFlags

Detailed Description

A prismatic joint permits relative translational movement between two bodies along an axis, but no relative rotational movement.

the axis on each body is defined as the line containing the origin of the joint frame and extending along the x-axis of that frame

See Also

PxPrismaticJointCreate() PxJoint

Constructor & Destructor Documentation

          PX_INLINE PxPrismaticJoint::PxPrismaticJoint
          (
          PxType
          concreteType,

          PxBaseFlags
          baseFlags

          )

inlineprotected

Constructor.

          PX_INLINE PxPrismaticJoint::PxPrismaticJoint
          (
          PxBaseFlags
          baseFlags	)

inlineprotected

Deserialization constructor.

Member Function Documentation

          virtual const char* PxPrismaticJoint::getConcreteTypeName
          (
          	)
           const

inlinevirtual

Returns string name of PxPrismaticJoint, used for serialization.

Reimplemented from PxBase.

          virtual PxJointLinearLimitPair PxPrismaticJoint::getLimit
          (
          	)
           const

pure virtual

gets the joint limit parameters.

See Also

PxJointLinearLimit getLimit()

          virtual PxReal PxPrismaticJoint::getPosition
          (
          	)
           const

pure virtual

returns the displacement of the joint along its axis.

          virtual PxPrismaticJointFlags PxPrismaticJoint::getPrismaticJointFlags
          (
          void
          	)
           const

pure virtual

Get the flags specific to the Prismatic Joint.

Returns

the joint flags

See Also

PxPrismaticJoint::flags, PxPrismaticJointFlag setFlag() setFlags()

          virtual PxReal PxPrismaticJoint::getProjectionAngularTolerance
          (
          	)
           const

pure virtual

Get the angular tolerance threshold for projection.

See Also

getProjectionAngularTolerance()

          virtual PxReal PxPrismaticJoint::getProjectionLinearTolerance
          (
          	)
           const

pure virtual

Get the linear tolerance threshold for projection.

Returns

the linear tolerance threshold in radians

See Also

setProjectionLinearTolerance()

          virtual PxReal PxPrismaticJoint::getVelocity
          (
          	)
           const

pure virtual

returns the velocity of the joint along its axis

          virtual bool PxPrismaticJoint::isKindOf
          (
          const char *
          name	)
           const

inlineprotectedvirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from PxJoint.

References PxJoint::isKindOf().

          virtual void PxPrismaticJoint::setLimit
          (
          const PxJointLinearLimitPair &
          	)

pure virtual

sets the joint limit parameters.

The limit range is [-PX_MAX_F32, PX_MAX_F32], but note that the width of the limit (upper-lower) must also be a valid float.

See Also

PxJointLinearLimitPair getLimit()

          virtual void PxPrismaticJoint::setPrismaticJointFlag
          (
          PxPrismaticJointFlag::Enum
          flag,

          bool
          value

          )

pure virtual

Set a single flag specific to a Prismatic Joint to true or false.

Parameters

[in]	flag	The flag to set or clear.

[in]	value	the value to which to set the flag

See Also

PxPrismaticJointFlag, getFlags() setFlags()

          virtual void PxPrismaticJoint::setPrismaticJointFlags
          (
          PxPrismaticJointFlags
          flags	)

pure virtual

Set the flags specific to the Prismatic Joint.

Default PxPrismaticJointFlags(0)

Parameters

[in]	flags	The joint flags.

See Also

PxPrismaticJointFlag setFlag() getFlags()

          virtual void PxPrismaticJoint::setProjectionAngularTolerance
          (
          PxReal
          tolerance	)

pure virtual

Set the angular tolerance threshold for projection. Projection is enabled if PxConstraintFlag::ePROJECTION is set for the joint.

If the joint separates by more than this distance along its locked degrees of freedom, the solver will move the bodies to close the distance.

Setting a very small tolerance may result in simulation jitter or other artifacts.

Sometimes it is not possible to project (for example when the joints form a cycle).

Range: [0, PX_MAX_F32)

 Default: Pi

Parameters

[in]	tolerance	the linear tolerance threshold

See Also

getProjectionLinearTolerance() PxJoint::setConstraintFlags()

          virtual void PxPrismaticJoint::setProjectionLinearTolerance
          (
          PxReal
          tolerance	)

pure virtual

Set the linear tolerance threshold for projection.

If the joint separates by more than this distance along its locked degrees of freedom, the solver will move the bodies to close the distance.

Setting a very small tolerance may result in simulation jitter or other artifacts.

Sometimes it is not possible to project (for example when the joints form a cycle).

This value must be nonnegative.

Range: [0, PX_MAX_F32)

 Default: 1e10f

Parameters

[in]	tolerance	the linear tolerance threshold

See Also

getProjectionLinearTolerance()

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

PxPrismaticJoint.h

Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com


text:
var pageObject = $('#element').semiAutoTable('getPageObject');
/*
{
  currentPage: ...,
  totalPages: ...,
  totalRows: ...,
  rowsPerPage: ...
}
*/


text:
package main

import (
	"fmt"
	wysteria "github.com/voidshard/wysteria/client"
)

func main() {
	// Example 05: Adding metadata: the sequel
	//  Alternatively, creating things with metadata out of the box is more efficient
	//  as we don't have to make two round trips - handy if we know all the facets we want up front!

	client, err := wysteria.New()
	if err != nil {
		panic(err)
	}

	// Grab our collection
	tiles, err := client.Collection("tiles")
	if err != nil {
		panic(err)
	}

	// Create an item with some metadata
	facets := map[string]string{
		"publisher": "batman",
	}
	redwood, err := tiles.CreateItem(
		"tree",
		"redwood",
		wysteria.Facets(facets),
	)
	if err != nil {
		panic(err)
	}

	// Add a version
	_, err = redwood.CreateVersion(wysteria.Facets(facets))
	if err != nil {
		panic(err)
	}

	fmt.Println("Created with metadata")
}


text:
// Test an attribute that doesn't do anything special. The same value is
// observed through content attribute and idl attribute.
function testStringAttr(tagname, attrname, idlname) {
    if (Array.isArray(tagname)) {
        tagname.forEach(function(t) { testStringAttr(t, attrname, idlname); });
        return;
    }

    idlname = idlname || attrname;
    var e = document.createElement(tagname);

    // Set idl attribute
    var value = "value1"
    e[idlname] = value;
    assert(e[idlname] === value);
    assert(e.getAttribute(attrname) === value);
    assert(e.attributes[0].value === value);

    // set content attribute
    value = "value2";
    e.setAttribute(attrname, value);
    assert(e[idlname] === value);
    assert(e.getAttribute(attrname) === value);
    assert(e.attributes[0].value === value);

    // Set through the Attr object
    value = "value3";
    e.attributes[0].value = value;
    assert(e[idlname] === value);
    assert(e.getAttribute(attrname) === value);
    assert(e.attributes[0].value === value);
}

function testStringAttrs(tagname, attrnames) {
    attrnames.forEach(function(n) { testStringAttr(tagname, n); });
}

function testEnumeratedAttr(tagname, attrname, idlname, legalvals,
                            missing_default, invalid_default)
{
    if (Array.isArray(tagname)) {
        tagname.forEach(function(t) {
            testEnumeratedAttr(t, attrname, idlname, legalvals,
                               missing_default, invalid_default);
        });
        return;
    }

    idlname = idlname || attrname;
    function testLegalValue(val) {
        var e = document.createElement(tagname);
        e.setAttribute(attrname, val);
        assert(e.getAttribute(attrname) === val);
        assert(e[idlname] === val.toLowerCase());

        e = document.createElement(tagname);
        e[idlname] = val;
        assert(e.getAttribute(attrname) === val);
        assert(e[idlname] === val.toLowerCase());
    }

    legalvals.forEach(function(value) {
        testLegalValue(value);
        testLegalValue(value.toUpperCase());
    });

    var e = document.createElement(tagname);

    // Test the missing default value
    assert(e[idlname] === (missing_default || ""));

    // Now test some illegal values.
    var illegal = "not_a_legal_value";

    e.setAttribute(attrname, illegal);
    assert(e.getAttribute(attrname) === illegal);
    assert(e[idlname] === (invalid_default || missing_default || ""));

    e = document.createElement(tagname);
    e[idlname] = illegal;
    assert(e.getAttribute(attrname) === illegal);
    assert(e[idlname] === (invalid_default || missing_default || ""));
}

function testBooleanAttr(tagname, attrname, idlname) {
    if (Array.isArray(tagname)) {
        tagname.forEach(function(t) { testBooleanAttr(t, attrname, idlname); });
        return;
    }

    idlname = idlname || attrname
    var e = document.createElement(tagname);
    assert(e.hasAttribute(attrname) === false);
    assert(e.getAttribute(attrname) === null);
    assert(e[idlname] === false);

    e.setAttribute(attrname, attrname);
    assert(e.getAttribute(attrname) === attrname);
    assert(e[idlname] === true);

    e.setAttribute(attrname, "");
    assert(e.getAttribute(attrname) === "");
    assert(e[idlname] === true);

    e.setAttribute(attrname, "whatever");
    assert(e.getAttribute(attrname) === "whatever");
    assert(e[idlname] === true);

    e[idlname] = false;
    assert(e[idlname] === false);
    assert(e.hasAttribute(attrname) === false);

    e[idlname] = true;
    assert(e[idlname] === true);
    assert(e.hasAttribute(attrname) === true);
    assert(e.getAttribute(attrname) === "");
}

// Test attributes of type long that can be negative or positive
function testIntAttr(tagname, attrname, defval, idlname) {
    idlname = idlname || attrname;
    if (defval === undefined) defval = 0;

    [-100, -10, -1, 0, 1, 10, 100].forEach(function(x) {
        var e = document.createElement(tagname);
        e[idlname] = x;
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));

        e = document.createElement(tagname);
        e.setAttribute(attrname, String(x));
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));
    });

    // Now test default value and non-numbers
    var e = document.createElement(tagname);
    assert(e[idlname] === defval);
    e[idlname] = "foo";  // The IDL layer converts this to the number 0
    assert(e[idlname] === 0);
    assert(e.getAttribute(attrname) === "0");

    var e = document.createElement(tagname);
    e.setAttribute(attrname, "foo");
    assert(e[idlname] === defval);  // Can't parse "foo" so use the default
    assert(e.getAttribute(attrname) === "foo");
}

// Test attributes of type long must be >= 0
function testNonNegIntAttr(tagname, attrname, defval, idlname) {
    idlname = idlname || attrname;
    if (defval === undefined) defval = 0;

    // Test legal values
    [0, 1, 10, 100].forEach(function(x) {
        var e = document.createElement(tagname);
        e[idlname] = x;
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));

        e = document.createElement(tagname);
        e.setAttribute(attrname, String(x));
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));
    });

    // Now test default value and non-numbers
    var e = document.createElement(tagname);
    assert(e[idlname] === defval);
    e[idlname] = "foo";  // The IDL layer converts this to the number 0
    assert(e[idlname] === 0);
    assert(e.getAttribute(attrname) === "0");

    var e = document.createElement(tagname);
    e.setAttribute(attrname, "foo");
    assert(e[idlname] === defval);  // Can't parse "foo" so use the default
    assert(e.getAttribute(attrname) === "foo");

    // try some illegal values
    // Setting to -1 should throw an error
    var e = document.createElement(tagname);
    assertThrows(function() { e[idlname] = -1; }, DOMException.INDEX_SIZE_ERR);
    assert(e[idlname] === defval);

    e.setAttribute(attrname, "-1")
    assert(e.getAttribute(attrname) === "-1");
    assert(e[idlname] === defval);
}

// test attributes of type unsigned long that can have any value >= 0
function testUIntAttr(tagname, attrname, defval, idlname) {
    idlname = idlname || attrname;
    if (defval === undefined) defval = 0;

    [0, 1, 10, 100].forEach(function(x) {
        var e = document.createElement(tagname);
        e[idlname] = x;
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));

        e = document.createElement(tagname);
        e.setAttribute(attrname, String(x));
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));
    });

    // Now test default value and non-numbers
    var e = document.createElement(tagname);
    assert(e[idlname] === defval);
    e[idlname] = "foo";  // The IDL layer converts this to the number 0
    assert(e[idlname] === 0);
    assert(e.getAttribute(attrname) === "0");

    var e = document.createElement(tagname);
    e.setAttribute(attrname, "foo");
    assert(e[idlname] === defval);  // Can't parse "foo" so use the default
    assert(e.getAttribute(attrname) === "foo");
}

// Test unsigned long attrs that are not allowed to be 0
function testNonZeroUIntAttr(tagname, attrname, defval, idlname) {
    idlname = idlname || attrname;
    if (defval === undefined) defval = 1;

    [1, 10, 100].forEach(function(x) {
        var e = document.createElement(tagname);
        e[idlname] = x;
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));

        e = document.createElement(tagname);
        e.setAttribute(attrname, String(x));
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));
    });

    // Now test default value
    var e = document.createElement(tagname);
    assert(e[idlname] === defval);

    // Setting to 0 should throw an error
    assertThrows(function() { e[idlname] = 0; }, DOMException.INDEX_SIZE_ERR);
    assert(e[idlname] === defval);

    e.setAttribute(attrname, "0")
    assert(e.getAttribute(attrname) === "0");
    assert(e[idlname] === defval);

    // Now test non-numbers
    // The IDL layer converts this to the number 0
    assertThrows(function() { e[idlname] = "foo"; },
                 DOMException.INDEX_SIZE_ERR);
    assert(e[idlname] === defval);
    e.setAttribute(attrname, "foo");
    assert(e[idlname] === defval);  // Can't parse "foo" so use the default
    assert(e.getAttribute(attrname) === "foo");
}

function testFloatAttr(tagname, attrname, defval, idlname) {
    idlname = idlname || attrname;
    if (defval === undefined) defval = 0.0;

    [-1.0e2,-10,-1.23,-.123,0.0,1.23e-2,1.23,Math.PI,100].forEach(function(x) {
        var e = document.createElement(tagname);
        e[idlname] = x;
        assert(e[idlname] === x);
        assert(Number(e.getAttribute(attrname)) === x);

        e = document.createElement(tagname);
        e.setAttribute(attrname, String(x));
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));
    });

    // Test default value
    var e = document.createElement(tagname);
    assert(e[idlname] === defval);

    // Non-numeric values
    e.setAttribute(attrname, "foo");
    assert(e.getAttribute(attrname) === "foo");
    assert(e[idlname], defval);

    // Setting Infinity or NaN should throw an error
    [Infinity, NaN, -Infinity, "foo"].forEach(function(x) {
        var e = document.createElement(tagname);
        assertThrows(function() { e[idlname] = x; },
                     DOMException.NOT_SUPPORTED_ERR);
    });
}

function testPositiveFloatAttr(tagname, attrname, defval, idlname) {
    idlname = idlname || attrname;
    if (defval === undefined) defval = 0.0;

    [1,1.23e-2,1.23,Math.PI,100].forEach(function(x) {
        var e = document.createElement(tagname);
        e[idlname] = x;
        assert(e[idlname] === x);
        assert(Number(e.getAttribute(attrname)) === x);

        e = document.createElement(tagname);
        e.setAttribute(attrname, String(x));
        assert(e[idlname] === x);
        assert(e.getAttribute(attrname) === String(x));
    });

    // Test default value
    var e = document.createElement(tagname);
    assert(e[idlname] === defval);

    // Non-numeric values
    e.setAttribute(attrname, "foo");
    assert(e.getAttribute(attrname) === "foo");
    assert(e[idlname], defval);

    // Setting Infinity or NaN should throw an error
    [Infinity, NaN, -Infinity, "foo"].forEach(function(x) {
        var e = document.createElement(tagname);
        assertThrows(function() { e[idlname] = x; },
                     DOMException.NOT_SUPPORTED_ERR);
    });

    // Setting a negative number through idl should be ignored
    e = document.createElement(tagname);
    e[idlname] = -2.0;
    assert(e[idlname] === defval);
    assert(e.hasAttribute(attrname) === false);
    e[idlname] = 1.0;
    e[idlname] = -1.0;
    assert(e[idlname] === 1.0);
    assert(Number(e.getAttribute(attrname)) === 1.0);

    // Setting a negative number with setAttribute should return defval
    // through idl
    e = document.createElement(tagname);
    e.setAttribute(attrname, "-1.25");
    assert(e.getAttribute(attrname) === "-1.25");
    assert(e[idlname], defval);
}

testStringAttrs("div", ["id", "title", "lang"]);
testStringAttr("div", "class", "className");
testStringAttr("div", "accesskey", "accessKey");
testEnumeratedAttr("div", "dir", null, ["ltr", "rtl", "auto"]);
testBooleanAttr("div", "hidden");

// Different tags have different default values
testIntAttr("div","tabindex", -1, "tabIndex")
testIntAttr("button","tabindex", 0, "tabIndex")

testStringAttr("base", "target");

testStringAttrs("link", ["rel", "media", "hreflang","type"]);

testStringAttrs("meta", ["name", "content"]);
testStringAttr("meta", "http-equiv", "httpEquiv");

testStringAttrs("style", ["media", "type"]);
testBooleanAttr("style", "scoped");

testStringAttrs("script", ["type", "charset"]);
testBooleanAttr("script", "defer");

testStringAttr("q", "cite");
testStringAttr("blockquote", "cite");

testStringAttr("ol", "type");
testBooleanAttr("ol", "reversed");
// XXX: the default value of the start attribute for <ol reversed> is
// the number of <li> children. Need a test for that case.
testIntAttr("ol", "start", 1);

testIntAttr("li", "value", 0);

testStringAttrs("a",["download", "target", "rel", "media", "hreflang", "type"]);

testStringAttr("time", "datetime", "dateTime");
testBooleanAttr("time", "pubdate", "pubDate");

testStringAttr("ins", "cite");
testStringAttr("ins", "datetime", "dateTime");
testStringAttr("del", "cite");
testStringAttr("del", "datetime", "dateTime");

testStringAttr("img", "alt");
testStringAttr("img", "crossorigin", "crossOrigin");
testStringAttr("img", "usemap", "useMap");
testBooleanAttr("img", "ismap", "isMap");

testStringAttrs("iframe", ["srcdoc","name"]);
testBooleanAttr("iframe", "seamless");

testStringAttr("embed", "type");

testStringAttrs("object", ["type", "name"]);
testStringAttr("object", "usemap", "useMap");
testBooleanAttr("object", "typemustmatch", "typeMustMatch");

testStringAttrs("source", ["type", "media"]);

testStringAttrs("track", ["srclang", "label"]);
testBooleanAttr("track", "default");
testEnumeratedAttr("track", "kind", null,
                   ["subtitles","captions","descriptions", "chapters","metadata"],
                  "subtitles");

testStringAttr("audio", "crossorigin", "crossOrigin");
testStringAttr("audio", "mediagroup", "mediaGroup");
testEnumeratedAttr("audio", "preload", null,
                   ["none", "metadata", "auto"],
                   "metadata");
testBooleanAttr("audio", "loop");
testBooleanAttr("audio", "autoplay");
testBooleanAttr("audio", "controls");
testBooleanAttr("audio", "muted", "defaultMuted");

testStringAttr("video", "crossorigin", "crossOrigin");
testStringAttr("video", "mediagroup", "mediaGroup");
testEnumeratedAttr("video", "preload", null,
                   ["none", "metadata", "auto"],
                   "metadata");
testBooleanAttr("video", "loop");
testBooleanAttr("video", "autoplay");
testBooleanAttr("video", "controls");
testBooleanAttr("video", "muted", "defaultMuted");

testStringAttr("map", "name");

testStringAttrs("area",[
    "alt", "target", "download", "rel", "media",
    "hreflang", "type", "shape", "coords"
]);

// These are string attributes
testStringAttrs("iframe", ["width","height"]);
testStringAttrs("object", ["width","height"]);
testStringAttrs("embed", ["width","height"]);

// But these are integers
testUIntAttr("video", "width", 0);
testUIntAttr("video", "height", 0);

testStringAttr("table", "border");

// Test it on both colgroup and col.
testNonZeroUIntAttr("colgroup", "span");
testNonZeroUIntAttr("col", "span");

testEnumeratedAttr("th", "scope", null, ["row", "col", "rowgroup", "colgroup"]);

testNonZeroUIntAttr("th", "colspan", 1, "colSpan");
testNonZeroUIntAttr("td", "colspan", 1, "colSpan");
testUIntAttr("th", "rowspan", 1, "rowSpan");
testUIntAttr("td", "rowspan", 1, "rowSpan");

/*
 * Can't create form elements yet, because they need a FormElementProxy class.
 *
testStringAttr("form", "name");
testStringAttr("form", "accept-charset", "acceptCharset");
testEnumeratedAttr("form", "autocomplete", null, ["on", "off"], "on");
*/

testBooleanAttr("fieldset", "disabled");

testStringAttr("label", "for", "htmlFor");

testStringAttrs("input", [
    "accept","alt","max", "min","pattern", "placeholder", "step"
]);
testStringAttr("input", "dirname", "dirName");
testStringAttr("input", "value", "defaultValue");
testBooleanAttr("input", "multiple");
testBooleanAttr("input", "required");
testBooleanAttr("input", "readonly", "readOnly");
testBooleanAttr("input", "checked", "defaultChecked");
testNonZeroUIntAttr("input", "size", 20);
testNonNegIntAttr("input", "maxlength", -1, "maxLength");

testEnumeratedAttr("input", "type", null, [
    "hidden", "text", "search", "tel", "url", "email", "password",
    "datetime", "date", "month", "week", "time", "datetime-local",
    "number", "range", "color", "checkbox", "radio", "file", "submit",
    "image", "reset", "button"
], "text");

testStringAttr("button", "value");
testEnumeratedAttr("button", "type", null,
                   ["submit","reset","button"],
                   "submit");

//
// XXX: Can't test these yet because I need a SelectElementProxy
//
//testBooleanAttr("select", "multiple")
//testBooleanAttr("select", "required")
//testUIntAttr("select", "size", 0);

testBooleanAttr("optgroup", "disabled")
testStringAttr("optgroup", "label")

testBooleanAttr("option", "disabled")
testBooleanAttr("option", "selected", "defaultSelected")
testStringAttr("option", "label")

testStringAttr("textarea", "placeholder");
testStringAttr("textarea", "wrap");
testStringAttr("textarea", "dirname", "dirName");
testBooleanAttr("textarea", "required");
testBooleanAttr("textarea", "readonly", "readOnly");
testNonZeroUIntAttr("textarea", "cols", 20);
testNonZeroUIntAttr("textarea", "rows", 2);
testNonNegIntAttr("textarea", "maxlength", -1, "maxLength");

testStringAttr("keygen", "challenge");
testEnumeratedAttr("keygen", "keytype", null, ["rsa"], "rsa");

testPositiveFloatAttr("progress", "max", 1.0);

testStringAttr(["fieldset",
                "input",
                "button",
// XXX               "select",  Need proxy to test this
                "textarea",
                "keygen",
                "output",
               ], "name");

testBooleanAttr([
    "input",
    "button",
//    "select", XXX: needs proxy
    "textarea",
    "keygen"
], "disabled");

testBooleanAttr([
    "input",
    "button",
//    "select", XXX: needs proxy
    "textarea",
    "keygen"
], "autofocus");

/* XXX
 * Can't test form elements until I at least have a stub for
 * HTMLFormElementProxy
 *
testStringAttr("form", "target");
testBooleanAttr("form", "novalidate", "noValidate");
testEnumeratedAttr("form", "method", null,
                   ["get", "post"], "get");
testEnumeratedAttr("form", "enctype", null,
                   ["application/x-www-form-urlencoded",
                    "multipart/form-data",
                    "text/plain"],
                   "application/x-www-form-urlencoded");
testEnumeratedAttr("form", "encoding", null,
                   ["application/x-www-form-urlencoded",
                    "multipart/form-data",
                    "text/plain"],
                   "application/x-www-form-urlencoded");

// enctype and encoding are two idl names for the same content attribute.
// This isn't tested by any of the tests above, so check explicitly that it
// works.
var f = document.createElement("form");
f.setAttribute("enctype", "foo/bar");
assert(f.enctype === "foo/bar");
assert(f.encoding === "foo/bar");
f.encoding = "text/plain";
assert(f.enctype === "text/plain");
assert(f.getAttribute("enctype") === "text/plain");
f.enctype = "multipart/form-data";
assert(f.encoding === "multipart/form-data");
assert(f.getAttribute("enctype") === "multipart/form-data");
*/

testStringAttr(["input", "button"], "formtarget", "formTarget");
testEnumeratedAttr(["input","button"], "formmethod", "formMethod",
                   ["get", "post"], "get");
testEnumeratedAttr(["input","button"], "formenctype", "formEnctype",
                   ["application/x-www-form-urlencoded",
                    "multipart/form-data",
                    "text/plain"],
                   "application/x-www-form-urlencoded");
testBooleanAttr(["input", "button"], "formnovalidate", "formNoValidate");

testBooleanAttr("details", "open");

testBooleanAttr("command", "checked");
testBooleanAttr("command", "disabled");
testStringAttrs("command", ["label", "radiogroup"]);
testEnumeratedAttr("command", "type", null,
                   ["command","checkbox","radio"], "command");

testStringAttrs("menu", ["type", "label"]);


text:
/**
 * Module dependencies.
 */
var util = require('util')
  , OAuth2Strategy = require('passport-oauth').OAuth2Strategy
  , InternalOAuthError = require('passport-oauth').InternalOAuthError;

/**
 * `Strategy` constructor.
 *
 * The Weibo authentication strategy authenticates requests by delegating to
 * Weibo using the OAuth 2.0 protocol.
 *
 * Applications must supply a `verify` callback which accepts an `accessToken`,
 * `refreshToken` and service-specific `profile`, and then calls the `done`
 * callback supplying a `user`, which should be set to `false` if the
 * credentials are not valid.  If an exception occured, `err` should be set.
 *
 * Options:
 *   - `clientID`      your Weibo application's Client ID
 *   - `clientSecret`  your Weibo application's Client Secret
 *   - `callbackURL`   URL to which Weibo will redirect the user after granting authorization
 *   - `scope`         array of permission scopes to request.  valid scopes include:
 *                     'user', 'public_repo', 'repo', 'gist', or none.
 *                     (see http://open.weibo.com/wiki/Oauth/en#User_Authentication for more info)
 *
 * Examples:
 *
 *     passport.use(new WeiboStrategy({
 *         clientID: '123-456-789',
 *         clientSecret: 'shhh-its-a-secret'
 *         callbackURL: 'https://www.example.net/auth/weibo/callback'
 *       },
 *       function(accessToken, refreshToken, profile, done) {
 *         User.findOrCreate(..., function (err, user) {
 *           done(err, user);
 *         });
 *       }
 *     ));
 *
 * @param {Object} options
 * @param {Function} verify
 * @api public
 */
function Strategy(options, verify) {
  options = options || {};
  options.authorizationURL = options.authorizationURL || 'https://api.weibo.com/oauth2/authorize';
  options.tokenURL = options.tokenURL || 'https://api.weibo.com/oauth2/access_token';
  options.scopeSeparator = options.scopeSeparator || ',';
  options.customHeaders = options.customHeaders || {};
  if (!options.customHeaders['User-Agent']) {
    options.customHeaders['User-Agent'] = options.userAgent || 'passport-weibo';
  }

  OAuth2Strategy.call(this, options, verify);
  this.name = 'weibo';
  this._getuidAPI = options.getuidAPI || 'https://api.weibo.com/2/account/get_uid.json';
  this._getProfileAPI = options.getProfileAPI || 'https://api.weibo.com/2/users/show.json';

}

/**
 * Inherit from `OAuth2Strategy`.
 */
util.inherits(Strategy, OAuth2Strategy);

/**
 * Retrieve user profile from Weibo.
 *
 * This function constructs a normalized profile, with the following properties:
 *
 *   - `provider`         always set to `weibo`
 *   - `id`               the user's Weibo ID
 *   - `username`         the user's Weibo username
 *   - `displayName`      the user's full name
 *   - `profileUrl`       the URL of the profile for the user on Weibo
 *   - `emails`           the user's email addresses
 *
 * @param {String} accessToken
 * @api protected
 * @param callback
 */
Strategy.prototype.userProfile = function(accessToken, callback) {
    var self = this;
    this._oauth2.getProtectedResource(this._getuidAPI, accessToken, function(err, body, res) {
        if (err) return callback(new InternalOAuthError('', err));

        try {
            var raw = JSON.parse(body);
            self._oauth2.getProtectedResource(self._getProfileAPI + '?uid=' + raw.uid, accessToken, function(err, body, res) {
                if (err) return callback(new InternalOAuthError('', err));

                try {
                  callback(null, self.formatProfile(JSON.parse(body))); // this is different with raw.
                } catch(e) {
                  callback(e);
                }
            })
        } catch(e) {
            callback(e);
        }
    })
};

Strategy.prototype.formatProfile = function(raw) {
    var user = {};
    user.provider = 'weibo';
    user.id = raw.idstr;
    user.displayName = raw.screen_name || raw.name;
    user._raw = raw;
    user._json = raw;

    return user;
};

/**
 * Expose `Strategy`.
 */
module.exports = Strategy;


text:
require "fileutils"
require "spec_helper"

describe "CLI options", :cli do
  %w[INT TERM].each do |signal|
    it "terminates gracefully on SIG#{signal}" do
      run_cli("-r ../spec/dummies/app.rb") do |cli|
        expect(cli).to have_output_line("Serving application")
        # wait before terminating
        sleep 0.5
        cli.signal(signal)
        expect(cli).to have_output_line("SIG#{signal} received")
        expect(cli).to have_output_line("Stopping...")
        expect(cli).to have_stopped
        expect(cli).to have_exit_status(0)
      end
    end
  end
end


text:
FactoryGirl.define do
  factory :user do
    sequence(:name) {|n| "User #{n}"}
    sequence(:email) {|n| "user#{n}@example.com"}
    password "password"
    password_confirmation "password"
  end

  factory :billing_period do
    user
    begin_date { Date.current - 1.week }
    end_date   { Date.current + 1.week }
  end

  factory :billing_period_range do
    user
    begin_date 1
    end_date -1
  end

  factory :recurring_bill do
    user
    billing_period_range
    sequence(:name) {|n| "Bill #{n}" }
  end

  factory :bill do
    user
    sequence(:name) {|n| "Bill #{n}" }
    amount_cents { rand(100) * 100 }

    trait :settled do
      settled true
    end

    trait :unsettled do
      settled false
    end
  end
end


text:
/**
* Directive used to manage the edition of the properties of a node template.
* Note this directive is not used in the TOSCA topology editor as the editor provides some specific options related to the topology (input/outputs/)
*/
define(function(require) {
  'use strict';

  var modules = require('modules');

  require('scripts/tosca/controllers/node_template_edit_ctrl');

  modules.get('a4c-tosca').directive('a4cNodeTemplateEdit', function() {
    return {
      templateUrl: 'views/tosca/node_template_edit.html',
      controller: 'a4cNodeTemplateEditCtrl',
      restrict: 'E',
      scope: {
        'template': '=', // This is the actual node template to edit.
        'type': '=', // The type of the node template.
        'nodeCapabilityTypes': '=', // map of capability types
        'resourceDataTypes': '=', // map of capability types
        'dependencies': '=', // dependencies
        'onPropertyUpdate': '&', // callback operation triggered when a property is actually updated
        'isPropertyEditable': '&?', // callback operation that should return true if a property or a capability property can be edited.
        'isSecretEditable': '&?', // callback operation that should return true if a secret
        'onCapabilityPropertyUpdate': '&', // callback operation triggered when a capability property is actually updated
        'onHalfRelationshipTypeUpdate' : '&?', // callback operation triggered when an half relationship type is updated (isService should be true)
        'capabilitiesRelationshipTypes' : '=?', // list of relationship type by capabilities (isService should be true)
        'isService': '=?', // is it a service ?
        'isRelEditable': '&?', // callback operation that should return true if a relationship can be edited.
        'propEditionContext': '=?'
      },
      link: {}
    };
  });
});


text:
from pprint import pformat
from django.core.management.base import BaseCommand
from django.conf import settings
from ..bower import bower_adapter
from ..exceptions import BowerNotInstalled

class BaseBowerCommand(BaseCommand):
    """Base management command with bower support"""

    def handle(self, *args, **options):
        self._check_bower_exists()
        bower_adapter.create_components_root()

    def _check_bower_exists(self):
        """Check bower exists or raise exception"""
        if not bower_adapter.is_bower_exists():
            raise BowerNotInstalled()

    def _install(self, args):
        bower_adapter.install(settings.BOWER_INSTALLED_APPS, *args)

    def _freeze(self):
        packages = tuple(bower_adapter.freeze())
        output = 'BOWER_INSTALLED_APPS = {0}'.format(
            pformat(packages),
        )
        self.stdout.write(output)


text:
FROM php:7.4-cli
WORKDIR "/opt/php"

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && \
    pecl channel-update pecl.php.net && \
    pecl install xdebug && \
    docker-php-source delete && \
    rm -r /tmp/* /var/cache/*

COPY ./.docker/php-ini-overrides.ini /usr/local/etc/php/conf.d/99-overrides.ini


text:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"


text:
package org.kaazing.netx.ws.internal.ext;

import java.io.IOException;

import org.kaazing.netx.ws.internal.ext.flyweight.Frame;
import org.kaazing.netx.ws.internal.ext.function.WebSocketConsumer;
import org.kaazing.netx.ws.internal.ext.function.WebSocketFrameConsumer;

/**
 * {@link WebSocketExtensionSpi} is part of Service Provider Interface (SPI) for extension developers.
 *

 * Developing an extension involves implementing:
 *

 *
 a sub-class of {@link WebSocketExtensionFactorySpi}
 *
 a sub-class of {@link WebSocketExtensionSpi}
 *

 *

 * When an enabled extension is successfully negotiated, an instance of this class is created using the corresponding
 * {@link WebSocketExtensionFactorySpi} that is registered through META-INF/services. This class is used to instantiate the
 * hooks that can be exercised as the state machine transitions from one state to another while
 * handling the WebSocket traffic. Based on the functionality of the extension, the extension developer can decide which
 * hooks to code.
 */
public abstract class WebSocketExtensionSpi {

    /**
     * onInitialized hook is exercised when an extension is successfully negotiated.
     */
    public WebSocketConsumer onInitialized = new WebSocketConsumer() {

        @Override
        public void accept(WebSocketContext context) {
            return;
        }
    };

    /**
     * onError hook is exercised in case of an error.
     */
    public WebSocketConsumer onError = new WebSocketConsumer() {

        @Override
        public void accept(WebSocketContext context) {
            return;
        }
    };

    /**
     * onBinaryReceived hook is exercised when a BINARY frame is received.
     */
    public WebSocketFrameConsumer onBinaryReceived = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onBinaryReceived(frame);
        }
    };

    /**
     * onBinarySent hook is exercised when sending a BINARY frame.
     */
    public WebSocketFrameConsumer onBinarySent = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onBinarySent(frame);
        }
    };

    /**
     * onContinuationReceived hook is exercised when a CONTINUATION frame is being received.
     */
    public WebSocketFrameConsumer onContinuationReceived = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onContinuationReceived(frame);
        }
    };

    /**
     * onContinuationSent hook is exercised when sending a CONTINUATION frame.
     */
    public WebSocketFrameConsumer onContinuationSent = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onContinuationSent(frame);
        }
    };

    /**
     * onCloseReceived hook is exercised when a CLOSE frame is received.
     */
    public WebSocketFrameConsumer onCloseReceived = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onCloseReceived(frame);
        }
    };

    /**
     * onCloseSent hook is exercised when sending a CLOSE frame.
     */
    public WebSocketFrameConsumer onCloseSent = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onCloseSent(frame);
        }
    };

    /**
     * onPingReceived hook is exercised when a PING frame is received.
     */
    public WebSocketFrameConsumer onPingReceived = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onPingReceived(frame);
        }
    };

    /**
     * onPongReceived hook is exercised when a PONG frame is received.
     */
    public WebSocketFrameConsumer onPongReceived = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onPongReceived(frame);
        }
    };

    /**
     * onPongSent hook is exercised when sending a PONG frame.
     */
    public WebSocketFrameConsumer onPongSent = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onPongSent(frame);
        }
    };

    /**
     * onTextReceived hook is exercised when a TEXT frame is received.
     */
    public WebSocketFrameConsumer onTextReceived = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onTextReceived(frame);
        }
    };

    /**
     * onTextSent hook is exercised when sending a TEXT frame.
     */
    public WebSocketFrameConsumer onTextSent = new WebSocketFrameConsumer() {

        @Override
        public void accept(WebSocketContext context, Frame frame) throws IOException {
            context.onTextSent(frame);
        }
    };
}


text:
layout: post
status: publish
published: true
title: Native XML Databases
author:
  display_name: Tomas Restrepo
  login: tomasr
  email: tomas@winterdom.com
  url: http://winterdom.com/
author_login: tomasr
author_email: tomas@winterdom.com
author_url: http://winterdom.com/
wordpress_id: 345
wordpress_url: http://winterdom.com/2002/05/nativexmldatabases
date: '2002-05-26 14:18:54 +0000'
date_gmt: '2002-05-26 14:18:54 +0000'
categories:
- XML
tags: []
comments: []
---

As I was reading XML-related things around the web, a question dawned on me: Does anyone know of any Native XML Databases that work well with .NET? (or just plain work at all?) I personally don't need one right now (altough it would certainly be cool), I'd just like to know what's available...

Or has anyone thought of porting to .NET something like Xindice?


text:
package org.lastaflute.web.validation.exception;

import org.lastaflute.core.message.UserMessages;
import org.lastaflute.web.exception.Forced400BadRequestException;

/**
 * @author jflute
 * @since 0.6.0 (2015/08/08 Saturday at Showbase)
 */
public class ClientErrorByValidatorException extends Forced400BadRequestException {

    // ===================================================================================
    //                                                                          Definition
    //                                                                          ==========
    private static final long serialVersionUID = 1L;

    // ===================================================================================
    //                                                                         Constructor
    //                                                                         ===========
    public ClientErrorByValidatorException(String debugMsg, UserMessages messages) {
        super(debugMsg, messages);
    }

    // ===================================================================================
    //                                                                      Basic Override
    //                                                                      ==============
    @Override
    public String toString() {
        return "validationClientError:{messages=" + userMessages + "}";
    }
}


text:
package com.example.administrator.boomtimer.model;

import java.util.List;

/**
 * Created by shady on 2017/5/30.
 * 天气bean
 */

public class WeatherBean {
    private List<HeWeather5Bean> HeWeather5;

    public List<HeWeather5Bean> getHeWeather5() {
        return HeWeather5;
    }

    public void setHeWeather5(List<HeWeather5Bean> HeWeather5) {
        this.HeWeather5 = HeWeather5;
    }

    public static class HeWeather5Bean {
        /**
         * basic : {"city":"北京","cnty":"中国","id":"CN101010100","lat":"39.904000","lon":"116.391000","prov":"北京","update":{"loc":"2016-08-31 11:52","utc":"2016-08-31 03:52"}}
         * now : {"cond":{"code":"104","txt":"阴"},"fl":"11","hum":"31","pcpn":"0","pres":"1025","tmp":"13","vis":"10","wind":{"deg":"40","dir":"东北风","sc":"4-5","spd":"24"}}
         * status : ok
         */

        private BasicBean basic;
        private NowBean now;
        private String status;

        public BasicBean getBasic() {
            return basic;
        }

        public void setBasic(BasicBean basic) {
            this.basic = basic;
        }

        public NowBean getNow() {
            return now;
        }

        public void setNow(NowBean now) {
            this.now = now;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public static class BasicBean {
            /**
             * city : 北京
             * cnty : 中国
             * id : CN101010100
             * lat : 39.904000
             * lon : 116.391000
             * prov : 北京
             * update : {"loc":"2016-08-31 11:52","utc":"2016-08-31 03:52"}
             */

            private String city;
            private String cnty;
            private String id;
            private String lat;
            private String lon;
            private String prov;
            private UpdateBean update;

            public String getCity() {
                return city;
            }

            public void setCity(String city) {
                this.city = city;
            }

            public String getCnty() {
                return cnty;
            }

            public void setCnty(String cnty) {
                this.cnty = cnty;
            }

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getLat() {
                return lat;
            }

            public void setLat(String lat) {
                this.lat = lat;
            }

            public String getLon() {
                return lon;
            }

            public void setLon(String lon) {
                this.lon = lon;
            }

            public String getProv() {
                return prov;
            }

            public void setProv(String prov) {
                this.prov = prov;
            }

            public UpdateBean getUpdate() {
                return update;
            }

            public void setUpdate(UpdateBean update) {
                this.update = update;
            }

            public static class UpdateBean {
                /**
                 * loc : 2016-08-31 11:52
                 * utc : 2016-08-31 03:52
                 */

                private String loc;
                private String utc;

                public String getLoc() {
                    return loc;
                }

                public void setLoc(String loc) {
                    this.loc = loc;
                }

                public String getUtc() {
                    return utc;
                }

                public void setUtc(String utc) {
                    this.utc = utc;
                }
            }
        }

        public static class NowBean {
            /**
             * cond : {"code":"104","txt":"阴"}
             * fl : 11
             * hum : 31
             * pcpn : 0
             * pres : 1025
             * tmp : 13
             * vis : 10
             * wind : {"deg":"40","dir":"东北风","sc":"4-5","spd":"24"}
             */

            private CondBean cond;
            private String fl;
            private String hum;
            private String pcpn;
            private String pres;
            private String tmp;
            private String vis;
            private WindBean wind;

            public CondBean getCond() {
                return cond;
            }

            public void setCond(CondBean cond) {
                this.cond = cond;
            }

            public String getFl() {
                return fl;
            }

            public void setFl(String fl) {
                this.fl = fl;
            }

            public String getHum() {
                return hum;
            }

            public void setHum(String hum) {
                this.hum = hum;
            }

            public String getPcpn() {
                return pcpn;
            }

            public void setPcpn(String pcpn) {
                this.pcpn = pcpn;
            }

            public String getPres() {
                return pres;
            }

            public void setPres(String pres) {
                this.pres = pres;
            }

            public String getTmp() {
                return tmp;
            }

            public void setTmp(String tmp) {
                this.tmp = tmp;
            }

            public String getVis() {
                return vis;
            }

            public void setVis(String vis) {
                this.vis = vis;
            }

            public WindBean getWind() {
                return wind;
            }

            public void setWind(WindBean wind) {
                this.wind = wind;
            }

            public static class CondBean {
                /**
                 * code : 104
                 * txt : 阴
                 */

                private String code;
                private String txt;

                public String getCode() {
                    return code;
                }

                public void setCode(String code) {
                    this.code = code;
                }

                public String getTxt() {
                    return txt;
                }

                public void setTxt(String txt) {
                    this.txt = txt;
                }
            }

            public static class WindBean {
                /**
                 * deg : 40
                 * dir : 东北风
                 * sc : 4-5
                 * spd : 24
                 */

                private String deg;
                private String dir;
                private String sc;
                private String spd;

                public String getDeg() {
                    return deg;
                }

                public void setDeg(String deg) {
                    this.deg = deg;
                }

                public String getDir() {
                    return dir;
                }

                public void setDir(String dir) {
                    this.dir = dir;
                }

                public String getSc() {
                    return sc;
                }

                public void setSc(String sc) {
                    this.sc = sc;
                }

                public String getSpd() {
                    return spd;
                }

                public void setSpd(String spd) {
                    this.spd = spd;
                }
            }
        }
    }
}


text:
<?php

namespace Casaris\Bundle\SocialBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\JoinColumn;

/**
 * Gallery
 *
 * @ORM\Table(name="gallery")
 * @ORM\Entity(repositoryClass="Casaris\Bundle\SocialBundle\Repository\GalleryRepository")
 */
class Gallery {

    /**
     * @var integer
     *
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\Column(name="id", type="integer")
     */
    private $id;

    /**
     * @ManyToOne(targetEntity="User")
     * @JoinColumn(name="user_id", referencedColumnName="id")
     * */
    private $user;

    /**
     * @ManyToOne(targetEntity="Document", cascade={"remove"})
     * @JoinColumn(name="document_id", referencedColumnName="id")
     * */
    private $document;

    /**
     *
     * @var \DateTime
     * @ORM\Column(type="datetime")
     */
    private $date;
    public function getId() {
        return $this->id;
    }

    public function getUser() {
        return $this->user;
    }

    public function getDocument() {
        return $this->document;
    }

    public function getDate() {
        return $this->date;
    }

    public function setId($id) {
        $this->id = $id;
    }

    public function setUser($user) {
        $this->user = $user;
    }

    public function setDocument($document) {
        $this->document = $document;
    }

    public function setDate(\DateTime $date) {
        $this->date = $date;
    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <title>Taking off the CfP masks: the ones who made it in the shortlist</title>

    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <meta property="og:type" content="website">
    <meta property="og:title" content="Taking off the CfP masks: the ones who made it in the shortlist">
    <meta property="og:description" content="">
    <meta property="og:url" content="http://euruko2013.org/blog/2013-04-28-taking-off-the-cfp-masks-the-ones-who-made-it-in-the-shortlist/index.html">
    <meta property="og:image" content="http://euruko2013.org/../../images/euruko2013_logo_408x300-d4ec480c.png">

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

    <meta name="apple-itunes-app" content="app-id=648956739">

    <link rel="shortcut icon" href="http://euruko2013.org/favicon.ico?v=2" />

    <link href='http://fonts.googleapis.com/css?family=Ubuntu:400,500,700,300italic' rel='stylesheet' type='text/css'>

    <link rel="alternate" type="application/atom+xml" title="EuRuKo 2013 Blog feed" href="/blog/feed.xml" />

    <link href="../../stylesheets/main-3f15c2ec.css" media="screen" rel="stylesheet" type="text/css" />

About

Videos

Photos

Speakers

Schedule

Party

Venue

Sponsors

Contact

              Blog

Taking off the CfP masks: the ones who made it in the shortlist

Apr 28, 2013

        by pagojo

&

        by  gfotos

If you are like us then you just can't wait to find out who was behind each proposal and which ones got shortlisted for your final vote! Even ourselves, the organisers, refrained from peeking at the database (yes, it wasn't easy), so even we don't know who is behind each proposal… until now that is! :-)

We had 91 outstanding proposals and we wish we could have many, many more of them presented than the 14 (plus a few lightning ones) we scheduled for the 2 days of the event. There are so many truly intriguing talks proposed that we wish we could do something about it. But, we can't.

What should happen now is that everyone should carefully review the shortlist and vote for the ones that will make it for this summer's event. Author names will be shown, voter names will also be shown, votes will be counted (and recounted if necessary), withdrawn proposal authors will be named and in general a lot of light will be shed on what is a fine assortment of Ruby themes and trends.

Now it is up to all of us to craft the best EuRuKo programme ever made, for which we only have from tomorrow April 29th until the 5th of May to do so!

To stir things up, we also recommend that when you vote for your favourites proposals you also tweet about them using #euruko as the hashtag.

So have a look at the shortlist and make sure you grab a ticket before the voting ends because it probably will end too after that!

Recent Articles

Meet our sponsors: Heroku

Meet our sponsors: Pamediakopes.gr

Meet our sponsors: Generation Y

Meet our sponsors: Workable

Meet our sponsors: XING

Tags

                euruko (20)

                contribution (1)

                organisation (1)

                transparency (1)

                announcements (3)

                speakers (5)

                venue (2)

                april fools (1)

                tickets (4)

                sponsors (10)

                support (1)

                community (1)

                announcement (1)

                anynines (1)

                cfp (2)

                proposals (2)

                xing (1)

                workable (1)

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus

Conference

About

Videos

Photos

Speakers

Schedule

Party

Tickets

Venue

Sponsors

Proposals

Guide

Athens

Travel Info

Accommodation

Transportation

Sightseeing

Side Activities

Vacations

Mobile

Stay in touch

Blog

Twitter

Facebook

info@euruko2013.org

      <form action="http://euruko2013.us5.list-manage.com/subscribe/post?u=d1a6bd50eb7d9b61b9101b5eb&id=c70313aaa0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
        Subscribe to our mailing list
        <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>

<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">

      </form>

          ©

      EuRuKo 2013 - All Rights Reversed

Code of Conduct
 |

Terms of Use
 |

Privacy Policy


text:
import xyz

class Ncurses(xyz.Package):
    pkg_name = 'ncurses'

    def configure(self):
        self.host_lib_configure('--with-shared', '--without-cxx-binding', enable_shared=True)

    def install(self):
        super().install()
        self.rmtree('{prefix_dir}', 'man')
        self.rmtree('{prefix_dir}', 'share', 'terminfo')
        self.rmtree('{prefix_dir}', 'share', 'tabset')
        self.rmtree('{eprefix_dir}', 'bin')

rules = Ncurses


text:
class Profile;

namespace printing {

// An abstraction of a printer manager dialog. This is used for the printing
// sub-section of Settings.
// This includes the OS-dependent UI to manage the network and local printers.
class PrinterManagerDialog {
 public:
  PrinterManagerDialog() = delete;
  PrinterManagerDialog(const PrinterManagerDialog&) = delete;
  PrinterManagerDialog& operator=(const PrinterManagerDialog&) = delete;

  // Displays the native printer manager dialog.
  static void ShowPrinterManagerDialog(Profile* profile);
};

}  // namespace printing

#endif  // CHROME_BROWSER_PRINTING_PRINTER_MANAGER_DIALOG_H_


text:
using System;

namespace DotSpatial.Data
{
    /// <summary>
    /// A DataProvider that is specific to raster formats.
    /// </summary>
    public interface IRasterProvider : IDataProvider
    {
        /// <summary>
        /// This create new method implies that this provider has the priority for creating a new file.
        /// An instance of the dataset should be created and then returned. By this time, the fileName
        /// will already be checked to see if it exists, and deleted if the user wants to overwrite it.
        /// </summary>
        /// <param name="name">The string fileName for the new instance.</param>
        /// <param name="driverCode">The string short name of the driver for creating the raster.</param>
        /// <param name="xSize">The number of columns in the raster.</param>
        /// <param name="ySize">The number of rows in the raster.</param>
        /// <param name="numBands">The number of bands to create in the raster.</param>
        /// <param name="dataType">The data type to use for the raster.</param>
        /// <param name="options">The options to be used.</param>
        /// <returns>An IRaster.</returns>
        IRaster Create(string name, string driverCode, int xSize, int ySize, int numBands, Type dataType, string[] options);

        /// <summary>
        /// This open method is only called if this plugin has been given priority for one
        /// of the file extensions supported in the DialogReadFilter property supplied by
        /// this control. Failing to provide a DialogReadFilter will result in this plugin
        /// being added to the list of DataProviders being supplied under the Add Other Data
        /// option in the file menu.
        /// </summary>
        /// <param name="fileName">A string specifying the complete path and extension of the file to open.</param>
        /// <returns>An IDataSet to be added to the Map. These can also be groups of datasets.</returns>
        new IRaster Open(string fileName);
    }
}


text:
package org.zezutom.schematic.service.parser.json.node;

import org.junit.Test;
import org.zezutom.schematic.model.json.BooleanNode;
import org.zezutom.schematic.service.generator.json.BooleanGenerator;

public class BooleanParserTest extends BaseJsonNodeParserTestCase<Boolean, BooleanGenerator, BooleanNode, BooleanParser> {

    @Override
    BooleanGenerator createGenerator() {
        return new BooleanGenerator();
    }

    @Override
    BooleanParser createParser(BooleanGenerator generator) {
        return new BooleanParser(generator);
    }

    @Override
    String getResourceDir() {
        return "boolean";
    }

    @Test
    public void parse() {
        // Leave with a default verification
        parse("basic.json");
    }
}


text:
'use strict';
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
global.rabbit = require('352-wascally');

module.exports = {
  init: init
};

function init() {

  global.rabbitConfig = {
    connection: {
      user: process.env.AMQP_USER || null,
      pass: process.env.AMQP_PASSWORD || null,
      server: process.env.AMQP_HOST || '127.0.0.1',
      port: process.env.AMQP_PORT || 5672,
      vhost: process.env.AMQP_VHOST || null
    },
    exchanges: [
      {name: 'tnj.' + process.env.NODE_ENV, type: 'topic', persistent: true},
      {name: 'tnj-deadLetter.' + process.env.NODE_ENV, type: 'topic', persistent: true}
    ],
    queues: [
      {
        name: 'tnj.main',
        limit: 100,
        queueLimit: 100000,
        subscribe: true,
        durable: true,
        deadLetterExchange: 'tnj-deadLetter.' + process.env.NODE_ENV,
        deadLetterRoutingKey: 'tnj.main.rejected'
      },
      {
        name: 'tnj.main.rejected',
        subscribe: false,
        messageTtl: 3600000
      }
    ],
    bindings: [
      {
        exchange: 'tnj.' + process.env.NODE_ENV, target: 'tnj.main',
        keys: [
          'tnj.main.get',
          'tnj.main.post',
          'tnj.main.put',
          'tnj.main.destroy'
        ]
      },
      {
        exchange: 'tnj-deadLetter.' + process.env.NODE_ENV, target: 'tnj.main.rejected',
        keys: ['tnj.main.rejected']
      }
    ]
  };
}


text:
import React from 'react'
import PropTypes from 'prop-types'
import cssModules from 'react-css-modules'
import styles from './BangumiCard.module.scss'

function BangumiCard({
  link = 'https://imuntil.com',
  title = '青春猪头少年不会梦到兔女郎学姐ssss古利特曼',
  wa = 5,
  follow = false
}) {
  return (

22:00

              {follow ? 已追番 : null}
              {title}

            第{wa}话

  )
}

BangumiCard.propTypes = {
  follow: PropTypes.bool,
  time: PropTypes.string,
  thumb: PropTypes.string,
  title: PropTypes.string,
  wa: PropTypes.number,
  link: PropTypes.string,
  onClick: PropTypes.func
}

export default cssModules(BangumiCard, styles)