text:
package com.hlyue.totpauthenticator;

import com.google.firebase.auth.FirebaseUser;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by helin on 2016/5/24.
 */

public class FirebaseUserUtils {
    static Map<String, String> toMap(final FirebaseUser user) {
        final Map<String, String> map = new HashMap<>();
        map.put("email", user.getEmail());
        map.put("displayName", user.getDisplayName());
        map.put("providerId", user.getProviderId());
        return map;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.github.chrisblutz.trinity.natives.math;

import com.github.chrisblutz.trinity.lang.TyObject;
import com.github.chrisblutz.trinity.lang.errors.Errors;
import com.github.chrisblutz.trinity.lang.types.TyString;

/**
 * @author Christopher Lutz
 */
public class DefaultUnaryOperationHandler extends UnaryOperationHandler {

    private static DefaultUnaryOperationHandler instance = new DefaultUnaryOperationHandler();

    private DefaultUnaryOperationHandler() {

    }

    @Override
    public TyString toString(TyObject operand) {

        Errors.throwError(Errors.Classes.UNSUPPORTED_ERROR, "String conversion not defined for numeric type " + operand.getObjectClass().getFullName() + ".");
        return new TyString("");
    }

    @Override
    public TyString toHexString(TyObject operand) {

        Errors.throwError(Errors.Classes.UNSUPPORTED_ERROR, "Hexadecimal string conversion not defined for numeric type " + operand.getObjectClass().getFullName() + ".");
        return new TyString("");
    }

    @Override
    public TyObject bitwiseComplement(TyObject operand) {

        throwOperationUnsupportedError("~", operand.getObjectClass());
        return TyObject.NIL;
    }

    public static DefaultUnaryOperationHandler getInstance() {

        return instance;
    }
}


text:
package io.iansoft.blockchain.web.rest;

import io.iansoft.blockchain.domain.Quote;
import io.iansoft.blockchain.repository.QuoteRepository;
import io.iansoft.blockchain.repository.search.QuoteSearchRepository;
import io.iansoft.blockchain.service.dto.QuoteDTO;
import io.iansoft.blockchain.web.rest.errors.BadRequestAlertException;

import io.github.jhipster.web.util.HeaderUtil;
import io.github.jhipster.web.util.ResponseUtil;
import org.modelmapper.ModelMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

import static org.elasticsearch.index.query.QueryBuilders.*;

/**
 * REST controller for managing {@link io.iansoft.blockchain.domain.Quote}.
 */
@RestController
@RequestMapping("/api")
public class QuoteResource {

    private final Logger log = LoggerFactory.getLogger(QuoteResource.class);

    private static final String ENTITY_NAME = "quote";

    @Value("${jhipster.clientApp.name}")
    private String applicationName;

    private final QuoteRepository quoteRepository;

    private final QuoteSearchRepository quoteSearchRepository;

    private final ModelMapper modelMapper;

    QuoteResource(QuoteRepository quoteRepository,
                  QuoteSearchRepository quoteSearchRepository, ModelMapper modelMapper) {
        this.quoteRepository = quoteRepository;
        this.quoteSearchRepository = quoteSearchRepository;
        this.modelMapper = modelMapper;
    }

    /**
     * {@code POST  /quotes} : Create a new quote.
     *
     * @param quote the quote to create.
     * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new quote, or with status {@code 400 (Bad Request)} if the quote has already an ID.
     * @throws URISyntaxException if the Location URI syntax is incorrect.
     */
    @PostMapping("/quotes")
    public ResponseEntity<Quote> createQuote(@Valid @RequestBody Quote quote) throws URISyntaxException {
        log.debug("REST request to save Quote : {}", quote);
        if (quote.getId() != null) {
            throw new BadRequestAlertException("A new quote cannot already have an ID", ENTITY_NAME, "idexists");
        }
        Quote result = quoteRepository.save(quote);
        quoteSearchRepository.save(result);
        return ResponseEntity.created(new URI("/api/quotes/" + result.getId()))
            .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString()))
            .body(result);
    }

    /**
     * {@code PUT  /quotes} : Updates an existing quote.
     *
     * @param quote the quote to update.
     * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated quote,
     * or with status {@code 400 (Bad Request)} if the quote is not valid,
     * or with status {@code 500 (Internal Server Error)} if the quote couldn't be updated.
     * @throws URISyntaxException if the Location URI syntax is incorrect.
     */
    @PutMapping("/quotes")
    public ResponseEntity<Quote> updateQuote(@Valid @RequestBody Quote quote) throws URISyntaxException {
        log.debug("REST request to update Quote : {}", quote);
        if (quote.getId() == null) {
            throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
        }
        Quote result = quoteRepository.save(quote);
        quoteSearchRepository.save(result);
        return ResponseEntity.ok()
            .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, quote.getId().toString()))
            .body(result);
    }

    /**
     * {@code GET  /quotes} : get all the quotes.
     *
     * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of quotes in body.
     */
    @GetMapping("/quotes")
    public List<Quote> getAllQuotes() {
        log.debug("REST request to get all Quotes");
        return quoteRepository.findAll();
    }

    /**
     * {@code GET  /quotes/:id} : get the "id" quote.
     *
     * @param id the id of the quote to retrieve.
     * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the quote, or with status {@code 404 (Not Found)}.
     */
    @GetMapping("/quotes/{id}")
    public ResponseEntity<Quote> getQuote(@PathVariable Long id) {
        log.debug("REST request to get Quote : {}", id);
        Optional<Quote> quote = quoteRepository.findById(id);
        return ResponseUtil.wrapOrNotFound(quote);
    }

    /**
     * {@code DELETE  /quotes/:id} : delete the "id" quote.
     *
     * @param id the id of the quote to delete.
     * @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
     */
    @DeleteMapping("/quotes/{id}")
    public ResponseEntity<Void> deleteQuote(@PathVariable Long id) {
        log.debug("REST request to delete Quote : {}", id);
        quoteRepository.deleteById(id);
        quoteSearchRepository.deleteById(id);
        return ResponseEntity.noContent().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())).build();
    }

    /**
     * {@code SEARCH  /_search/quotes?query=:query} : search for the quote corresponding
     * to the query.
     *
     * @param query the query of the quote search.
     * @return the result of the search.
     */
    @GetMapping("/_search/quotes")
    public List<Quote> searchQuotes(@RequestParam String query) {
        log.debug("REST request to search Quotes for query {}", query);
        return StreamSupport
            .stream(quoteSearchRepository.search(queryStringQuery(query)).spliterator(), false)
            .collect(Collectors.toList());
    }

    @GetMapping("/quotes/last/{id}")
    @Timed
    public ResponseEntity<QuoteDTO> getLastQuote(@PathVariable Long id) {
        log.debug("REST request to get Quote : {}", id);
        Quote quote = quoteRepository.findFirstByMarketCoinIdOrderByIdDesc(id);
        QuoteDTO quoteDTO = modelMapper.map(quote,QuoteDTO.class);
        quoteDTO.setCurrency(quote.getMarketCoin().getCurrency());
        return ResponseUtil.wrapOrNotFound(Optional.ofNullable(quoteDTO));
    }

}


text:
const test = require('tape')
const Deserializer = require('../../src/lib/deserializer')
const mockedWorld = {
  get (id) { return { id } }
}
const deserializer = new Deserializer(mockedWorld)

test('Deserializer: deserializes a string', t => {
  const value = { value: 'foo' }
  const expected = 'foo'
  const actual = deserializer.deserialize(value)

  t.equal(actual, expected)
  t.end()
})

test('Deserializer: deserializes a number', t => {
  const value = { value: 3.14159 }
  const expected = 3.14159
  const actual = deserializer.deserialize(value)

  t.equal(actual, expected)
  t.end()
})

test('Deserializer: deserializes not a number', t => {
  const value = { NaN: true }
  const actual = deserializer.deserialize(value)

  t.true(isNaN(actual))
  t.end()
})

test('Deserializer: deserializes true', t => {
  const value = { value: true }
  const expected = true
  const actual = deserializer.deserialize(value)

  t.equal(actual, expected)
  t.end()
})

test('Deserializer: deserializes false', t => {
  const value = { value: false }
  const expected = false
  const actual = deserializer.deserialize(value)

  t.equal(actual, expected)
  t.end()
})

test('Deserializer: deserializes a date', t => {
  const value = { date: '2016-01-01T00:00:00.000Z' }
  const expected = new Date(Date.UTC(2016, 0))
  const actual = deserializer.deserialize(value)

  t.equal(actual.getTime(), expected.getTime())
  t.end()
})

test('Deserializer: deserializes a regular expression', t => {
  const value = { regexp: 'foo|bar', flags: 'gi' }
  const expected = /foo|bar/gi
  const actual = deserializer.deserialize(value)

  t.equal(actual.source, expected.source)
  t.equal(actual.flags, expected.flags)
  t.end()
})

test('Deserializer: deserializes undefined', t => {
  const value = { undefined: true }
  const expected = undefined
  const actual = deserializer.deserialize(value)

  t.equal(actual, expected)
  t.end()
})

test('Deserializer: deserializes null', t => {
  const value = { object: null }
  const expected = null
  const actual = deserializer.deserialize(value)

  t.equal(actual, expected)
  t.end()
})

test('Deserializer: deserializes a simple object', t => {
  const value = { object: { foo: { value: 'bar' } } }
  const expected = { foo: 'bar' }
  const actual = deserializer.deserialize(value)

  t.deepEqual(actual, expected)
  t.end()
})

test('Deserializer: deserializes a simple array', t => {
  const value = { array: [{ value: 1 }, { value: 'two' }] }
  const expected = [1, 'two']
  const actual = deserializer.deserialize(value)

  t.deepEqual(actual, expected)
  t.end()
})

test('Deserializer: deserializes a complex object', t => {
  const value = {
    object: {
      s: { value: 's' },
      n: { value: 2 },
      nl: { object: null },
      u: { undefined: true },
      o: {
        object: { x: { value: 'y' }, z: { object: null } }
      },
      a: {
        array: [{ value: 1 }, { value: 't' }]
      }
    }
  }
  const expected = {
    s: 's', n: 2, nl: null, u: undefined, o: { x: 'y', z: null }, a: [1, 't']
  }
  const actual = deserializer.deserialize(value)

  t.deepEqual(actual, expected)
  t.end()
})

test('Deserializer: deserializes a world object reference', t => {
  const value = { ref: 'foo' }
  const expected = { id: 'foo' }
  const actual = deserializer.deserialize(value)

  t.deepEqual(actual, expected)
  t.end()
})

test('Deserializer: deserializes a function', t => {
  const value = { function: true, source: 'function foo() { return "foo"; }' }
  const fn = deserializer.deserialize(value)

  t.equal(typeof fn, 'function')
  t.equal(fn.function, true)
  t.equal(fn.source, 'function foo() { return "foo"; }')
  t.end()
})

test('Deserializer: deserializes a verb', t => {
  const value = {
    verb: true,
    pattern: 'f*oo',
    source: "function foo() { return 'foo'; }",
    dobjarg: 'this',
    preparg: 'none',
    iobjarg: 'none'
  }
  const fn = deserializer.deserialize(value)

  t.equal(typeof fn, 'function')
  t.equal(fn.verb, true)
  t.equal(fn.pattern, value.pattern)
  t.equal(fn.source, value.source)
  t.equal(fn.dobjarg, value.dobjarg)
  t.equal(fn.preparg, value.preparg)
  t.equal(fn.iobjarg, value.iobjarg)
  t.end()
})

test('Deserializer: deserializes invalid object', t => {
  const value = { invalid: true }

  t.throws(() => { deserializer.deserialize(value) }, /Unable to deserialize object/)
  t.end()
})

test('Deserializer: deserializes null', t => {
  const value = null

  t.throws(() => { deserializer.deserialize(value) }, /Unable to deserialize value/)
  t.end()
})

test('Deserializer: deserializes invalid value', t => {
  const value = 'foo'

  t.throws(() => { deserializer.deserialize(value) }, /Unable to deserialize value/)
  t.end()
})


text:
#pragma once

namespace raytracer
{
	/**
	 * Structure containing information about scene metadata.
	 */
	struct metadata
	{
		using size_type = size_t;

		size_type rows;
		size_type columns;
	};
}


text:
package gohcl

import (
	"fmt"
	"reflect"

	"github.com/zclconf/go-cty/cty"

	"github.com/hashicorp/hcl/v2"
	"github.com/zclconf/go-cty/cty/convert"
	"github.com/zclconf/go-cty/cty/gocty"
)

// DecodeBody extracts the configuration within the given body into the given
// value. This value must be a non-nil pointer to either a struct or
// a map, where in the former case the configuration will be decoded using
// struct tags and in the latter case only attributes are allowed and their
// values are decoded into the map.
//
// The given EvalContext is used to resolve any variables or functions in
// expressions encountered while decoding. This may be nil to require only
// constant values, for simple applications that do not support variables or
// functions.
//
// The returned diagnostics should be inspected with its HasErrors method to
// determine if the populated value is valid and complete. If error diagnostics
// are returned then the given value may have been partially-populated but
// may still be accessed by a careful caller for static analysis and editor
// integration use-cases.
func DecodeBody(body hcl.Body, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics {
	rv := reflect.ValueOf(val)
	if rv.Kind() != reflect.Ptr {
		panic(fmt.Sprintf("target value must be a pointer, not %s", rv.Type().String()))
	}

	return decodeBodyToValue(body, ctx, rv.Elem())
}

func decodeBodyToValue(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics {
	et := val.Type()
	switch et.Kind() {
	case reflect.Struct:
		return decodeBodyToStruct(body, ctx, val)
	case reflect.Map:
		return decodeBodyToMap(body, ctx, val)
	default:
		panic(fmt.Sprintf("target value must be pointer to struct or map, not %s", et.String()))
	}
}

func decodeBodyToStruct(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics {
	schema, partial := ImpliedBodySchema(val.Interface())

	var content *hcl.BodyContent
	var leftovers hcl.Body
	var diags hcl.Diagnostics
	if partial {
		content, leftovers, diags = body.PartialContent(schema)
	} else {
		content, diags = body.Content(schema)
	}
	if content == nil {
		return diags
	}

	tags := getFieldTags(val.Type())

	if tags.Remain != nil {
		fieldIdx := *tags.Remain
		field := val.Type().Field(fieldIdx)
		fieldV := val.Field(fieldIdx)
		switch {
		case bodyType.AssignableTo(field.Type):
			fieldV.Set(reflect.ValueOf(leftovers))
		case attrsType.AssignableTo(field.Type):
			attrs, attrsDiags := leftovers.JustAttributes()
			if len(attrsDiags) > 0 {
				diags = append(diags, attrsDiags...)
			}
			fieldV.Set(reflect.ValueOf(attrs))
		default:
			diags = append(diags, decodeBodyToValue(leftovers, ctx, fieldV)...)
		}
	}

	for name, fieldIdx := range tags.Attributes {
		attr := content.Attributes[name]
		field := val.Type().Field(fieldIdx)
		fieldV := val.Field(fieldIdx)

		if attr == nil {
			if !exprType.AssignableTo(field.Type) {
				continue
			}

			// As a special case, if the target is of type hcl.Expression then
			// we'll assign an actual expression that evalues to a cty null,
			// so the caller can deal with it within the cty realm rather
			// than within the Go realm.
			synthExpr := hcl.StaticExpr(cty.NullVal(cty.DynamicPseudoType), body.MissingItemRange())
			fieldV.Set(reflect.ValueOf(synthExpr))
			continue
		}

		switch {
		case attrType.AssignableTo(field.Type):
			fieldV.Set(reflect.ValueOf(attr))
		case exprType.AssignableTo(field.Type):
			fieldV.Set(reflect.ValueOf(attr.Expr))
		default:
			diags = append(diags, DecodeExpression(
				attr.Expr, ctx, fieldV.Addr().Interface(),
			)...)
		}
	}

	blocksByType := content.Blocks.ByType()

	for typeName, fieldIdx := range tags.Blocks {
		blocks := blocksByType[typeName]
		field := val.Type().Field(fieldIdx)

		ty := field.Type
		isSlice := false
		isPtr := false
		if ty.Kind() == reflect.Slice {
			isSlice = true
			ty = ty.Elem()
		}
		if ty.Kind() == reflect.Ptr {
			isPtr = true
			ty = ty.Elem()
		}

		if len(blocks) > 1 && !isSlice {
			diags = append(diags, &hcl.Diagnostic{
				Severity: hcl.DiagError,
				Summary:  fmt.Sprintf("Duplicate %s block", typeName),
				Detail: fmt.Sprintf(
					"Only one %s block is allowed. Another was defined at %s.",
					typeName, blocks[0].DefRange.String(),
				),
				Subject: &blocks[1].DefRange,
			})
			continue
		}

		if len(blocks) == 0 {
			if isSlice || isPtr {
				val.Field(fieldIdx).Set(reflect.Zero(field.Type))
			} else {
				diags = append(diags, &hcl.Diagnostic{
					Severity: hcl.DiagError,
					Summary:  fmt.Sprintf("Missing %s block", typeName),
					Detail:   fmt.Sprintf("A %s block is required.", typeName),
					Subject:  body.MissingItemRange().Ptr(),
				})
			}
			continue
		}

		switch {

		case isSlice:
			elemType := ty
			if isPtr {
				elemType = reflect.PtrTo(ty)
			}
			sli := reflect.MakeSlice(reflect.SliceOf(elemType), len(blocks), len(blocks))

			for i, block := range blocks {
				if isPtr {
					v := reflect.New(ty)
					diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...)
					sli.Index(i).Set(v)
				} else {
					diags = append(diags, decodeBlockToValue(block, ctx, sli.Index(i))...)
				}
			}

			val.Field(fieldIdx).Set(sli)

		default:
			block := blocks[0]
			if isPtr {
				v := reflect.New(ty)
				diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...)
				val.Field(fieldIdx).Set(v)
			} else {
				diags = append(diags, decodeBlockToValue(block, ctx, val.Field(fieldIdx))...)
			}

		}

	}

	return diags
}

func decodeBodyToMap(body hcl.Body, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics {
	attrs, diags := body.JustAttributes()
	if attrs == nil {
		return diags
	}

	mv := reflect.MakeMap(v.Type())

	for k, attr := range attrs {
		switch {
		case attrType.AssignableTo(v.Type().Elem()):
			mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr))
		case exprType.AssignableTo(v.Type().Elem()):
			mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr.Expr))
		default:
			ev := reflect.New(v.Type().Elem())
			diags = append(diags, DecodeExpression(attr.Expr, ctx, ev.Interface())...)
			mv.SetMapIndex(reflect.ValueOf(k), ev.Elem())
		}
	}

	v.Set(mv)

	return diags
}

func decodeBlockToValue(block *hcl.Block, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics {
	var diags hcl.Diagnostics

	ty := v.Type()

	switch {
	case blockType.AssignableTo(ty):
		v.Elem().Set(reflect.ValueOf(block))
	case bodyType.AssignableTo(ty):
		v.Elem().Set(reflect.ValueOf(block.Body))
	case attrsType.AssignableTo(ty):
		attrs, attrsDiags := block.Body.JustAttributes()
		if len(attrsDiags) > 0 {
			diags = append(diags, attrsDiags...)
		}
		v.Elem().Set(reflect.ValueOf(attrs))
	default:
		diags = append(diags, decodeBodyToValue(block.Body, ctx, v)...)

		if len(block.Labels) > 0 {
			blockTags := getFieldTags(ty)
			for li, lv := range block.Labels {
				lfieldIdx := blockTags.Labels[li].FieldIndex
				v.Field(lfieldIdx).Set(reflect.ValueOf(lv))
			}
		}

	}

	return diags
}

// DecodeExpression extracts the value of the given expression into the given
// value. This value must be something that gocty is able to decode into,
// since the final decoding is delegated to that package.
//
// The given EvalContext is used to resolve any variables or functions in
// expressions encountered while decoding. This may be nil to require only
// constant values, for simple applications that do not support variables or
// functions.
//
// The returned diagnostics should be inspected with its HasErrors method to
// determine if the populated value is valid and complete. If error diagnostics
// are returned then the given value may have been partially-populated but
// may still be accessed by a careful caller for static analysis and editor
// integration use-cases.
func DecodeExpression(expr hcl.Expression, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics {
	srcVal, diags := expr.Value(ctx)

	convTy, err := gocty.ImpliedType(val)
	if err != nil {
		panic(fmt.Sprintf("unsuitable DecodeExpression target: %s", err))
	}

	srcVal, err = convert.Convert(srcVal, convTy)
	if err != nil {
		diags = append(diags, &hcl.Diagnostic{
			Severity: hcl.DiagError,
			Summary:  "Unsuitable value type",
			Detail:   fmt.Sprintf("Unsuitable value: %s", err.Error()),
			Subject:  expr.StartRange().Ptr(),
			Context:  expr.Range().Ptr(),
		})
		return diags
	}

	err = gocty.FromCtyValue(srcVal, val)
	if err != nil {
		diags = append(diags, &hcl.Diagnostic{
			Severity: hcl.DiagError,
			Summary:  "Unsuitable value type",
			Detail:   fmt.Sprintf("Unsuitable value: %s", err.Error()),
			Subject:  expr.StartRange().Ptr(),
			Context:  expr.Range().Ptr(),
		})
	}

	return diags
}


text:
package org.apache.ignite.ml.math;

import com.github.fommil.netlib.BLAS;
import com.github.fommil.netlib.F2jBLAS;
import java.util.Set;
import org.apache.ignite.ml.math.exceptions.math.CardinalityException;
import org.apache.ignite.ml.math.exceptions.math.MathIllegalArgumentException;
import org.apache.ignite.ml.math.exceptions.math.NonSquareMatrixException;
import org.apache.ignite.ml.math.primitives.matrix.Matrix;
import org.apache.ignite.ml.math.primitives.matrix.impl.DenseMatrix;
import org.apache.ignite.ml.math.primitives.matrix.impl.SparseMatrix;
import org.apache.ignite.ml.math.primitives.vector.Vector;
import org.apache.ignite.ml.math.primitives.vector.impl.DenseVector;
import org.apache.ignite.ml.math.primitives.vector.impl.SparseVector;
import org.apache.ignite.ml.math.util.MatrixUtil;

/**
 * Useful subset of BLAS operations.
 * This class is based on 'BLAS' class from Apache Spark MLlib.
 */
public class Blas {
    /** F2J implementation of BLAS. */
    private static transient BLAS f2jBlas = new F2jBLAS();

    /**
     * Native implementation of BLAS. F2J implementation will be used as fallback if no native implementation is found.
     */
    private static transient BLAS nativeBlas = BLAS.getInstance();

    /**
     * Performs y += a * x
     *
     * @param a Scalar a.
     * @param x Vector x.
     * @param y Vector y.
     */
    public static void axpy(Double a, Vector x, Vector y) {
        if (x.size() != y.size())
            throw new CardinalityException(x.size(), y.size());

        if (x.isArrayBased() && y.isArrayBased())
            axpy(a, x.getStorage().data(), y.getStorage().data());
        else if (x instanceof SparseVector && y.isArrayBased())
            axpy(a, (SparseVector)x, y.getStorage().data());
        else
            throw new MathIllegalArgumentException("Operation 'axpy' doesn't support this combination of parameters [x="
                + x.getClass().getName() + ", y=" + y.getClass().getName() + "].");
    }

    /** */
    private static void axpy(Double a, double[] x, double[] y) {
        f2jBlas.daxpy(x.length, a, x, 1, y, 1);
    }

    /** */
    private static void axpy(Double a, SparseVector x, double[] y) {
        int xSize = x.size();

        if (a == 1.0) {
            int k = 0;

            while (k < xSize) {
                y[k] += x.getX(k);
                k++;
            }
        }
        else {
            int k = 0;

            while (k < xSize) {
                y[k] += a * x.getX(k);
                k++;
            }
        }
    }

    /**
     * Returns dot product of vectors x and y.
     *
     * @param x Vector x.
     * @param y Vector y.
     * @return Dot product of x and y.
     **/
    public static Double dot(Vector x, Vector y) {
        return x.dot(y);
    }

    /**
     * Copies Vector x into Vector y. (y = x)
     *
     * @param x Vector x.
     * @param y Vector y.
     */
    public void copy(Vector x, Vector y) {
        int n = y.size();

        if (x.size() != n)
            throw new CardinalityException(x.size(), n);

        if (y.isArrayBased()) {
            double[] yData = y.getStorage().data();

            if (x.isArrayBased())
                System.arraycopy(x.getStorage().data(), 0, y.getStorage().data(), 0, n);
            else {
                if (y instanceof SparseVector) {
                    for (int i = 0; i < n; i++)
                        yData[i] = x.getX(i);
                }
            }
        }
        else
            throw new IllegalArgumentException("Vector y must be array based in copy.");
    }

    /**
     * Performs in-place multiplication of vector x by a real scalar a. (x = a * x)
     *
     * @param a Scalar a.
     * @param x Vector x.
     **/
    public static void scal(Double a, Vector x) {
        if (x.isArrayBased())
            f2jBlas.dscal(x.size(), a, x.getStorage().data(), 1);
        else if (x instanceof SparseVector) {
            Set<Integer> indexes = ((SparseVector)x).indexes();

            for (Integer i : indexes)
                x.compute(i, (ind, v) -> v * a);
        }
        else
            throw new IllegalArgumentException();
    }

    /**
     * Adds alpha * v * v.t to a matrix in-place. This is the same as BLAS's ?SPR.
     *
     * @param u the upper triangular part of the matrix in a [[DenseVector]](column major)
     */
    public static void spr(Double alpha, DenseVector v, DenseVector u) {
        nativeBlas.dspr("U", v.size(), alpha, v.getStorage().data(), 1, u.getStorage().data());
    }

    /** */
    public static void spr(Double alpha, SparseVector v, DenseVector u) {
        int prevNonDfltInd = 0;
        int startInd = 0;
        double av;
        double[] uData = u.getStorage().data();

        for (Integer nonDefaultInd : v.indexes()) {
            startInd += (nonDefaultInd - prevNonDfltInd) * (nonDefaultInd + prevNonDfltInd + 1) / 2;
            av = alpha * v.get(nonDefaultInd);

            for (Integer i : v.indexes())
                if (i <= nonDefaultInd)
                    uData[startInd + i] += av * v.getX(i);

            prevNonDfltInd = nonDefaultInd;
        }
    }

    /**
     * A := alpha * x * x^T + A.
     *
     * @param alpha a real scalar that will be multiplied to x * x^T^.
     * @param x the vector x that contains the n elements.
     * @param a the symmetric matrix A. Size of n x n.
     */
    void syr(Double alpha, Vector x, DenseMatrix a) {
        int mA = a.rowSize();
        int nA = a.columnSize();

        if (mA != nA)
            throw new NonSquareMatrixException(mA, nA);

        if (mA != x.size())
            throw new CardinalityException(x.size(), mA);

        // TODO: IGNITE-5535, Process DenseLocalOffHeapVector
        if (x instanceof DenseVector)
            syr(alpha, x, a);
        else if (x instanceof SparseVector)
            syr(alpha, x, a);
        else
            throw new IllegalArgumentException("Operation 'syr' does not support vector [class="
                + x.getClass().getName() + "].");
    }

    /** TODO: IGNTIE-5770, add description for a */
    static void syr(Double alpha, DenseVector x, DenseMatrix a) {
        int nA = a.rowSize();
        int mA = a.columnSize();

        nativeBlas.dsyr("U", x.size(), alpha, x.getStorage().data(), 1, a.getStorage().data(), nA);

        // Fill lower triangular part of A
        int i = 0;
        while (i < mA) {
            int j = i + 1;

            while (j < nA) {
                a.setX(j, i, a.getX(i, j));
                j++;
            }
            i++;
        }
    }

    /** */
    public static void syr(Double alpha, SparseVector x, DenseMatrix a) {
        int mA = a.columnSize();

        for (Integer i : x.indexes()) {
            double mult = alpha * x.getX(i);
            for (Integer j : x.indexes())
                a.getStorage().data()[mA * i + j] += mult * x.getX(j);
        }
    }

    /**
     * For the moment we have no flags indicating if matrix is transposed or not. Therefore all dgemm parameters for
     * transposition are equal to 'N'.
     */
    public static void gemm(double alpha, Matrix a, Matrix b, double beta, Matrix c) {
        if (alpha == 0.0 && beta == 1.0)
            return;
        else if (alpha == 0.0)
            scal(c, beta);
        else {

            double[] fA = a.getStorage().data();
            double[] fB = b.getStorage().data();
            double[] fC = c.getStorage().data();

            assert fA != null;

            nativeBlas.dgemm("N", "N", a.rowSize(), b.columnSize(), a.columnSize(), alpha, fA,
                a.rowSize(), fB, b.rowSize(), beta, fC, c.rowSize());

            if (c instanceof SparseMatrix)
                MatrixUtil.unflatten(fC, c);
        }
    }

    /**
     * y := alpha * A * x + beta * y.
     *
     * @param alpha Alpha.
     * @param a Matrix a.
     * @param x Vector x.
     * @param beta Beta.
     * @param y Vector y.
     */
    public static void gemv(double alpha, Matrix a, Vector x, double beta, Vector y) {
        checkCardinality(a, x);

        if (a.rowSize() != y.size())
            throw new CardinalityException(a.columnSize(), y.size());

        if (alpha == 0.0 && beta == 1.0)
            return;

        if (alpha == 0.0) {
            scal(y, beta);
            return;
        }

        double[] fA = a.getStorage().data();
        double[] fX = x.getStorage().data();
        double[] fY = y.getStorage().data();

        nativeBlas.dgemv("N", a.rowSize(), a.columnSize(), alpha, fA, a.rowSize(), fX, 1, beta, fY, 1);

        if (y instanceof SparseVector)
            y.assign(fY);
    }

    /**
     * M := alpha * M.
     *
     * @param m Matrix M.
     * @param alpha Alpha.
     */
    private static void scal(Matrix m, double alpha) {
        if (alpha != 1.0)
            for (int i = 0; i < m.rowSize(); i++)
                for (int j = 0; j < m.columnSize(); j++)
                    m.setX(i, j, m.getX(i, j) * alpha);
    }

    /**
     * v := alpha * v.
     *
     * @param v Vector v.
     * @param alpha Aplha.
     */
    private static void scal(Vector v, double alpha) {
        if (alpha != 1.0)
            for (int i = 0; i < v.size(); i++)
                v.compute(i, (ind, val) -> val * alpha);
    }

    /**
     * Checks if Matrix A can be multiplied by vector v, if not CardinalityException is thrown.
     *
     * @param a Matrix A.
     * @param v Vector v.
     */
    public static void checkCardinality(Matrix a, Vector v) throws CardinalityException {
        if (a.columnSize() != v.size())
            throw new CardinalityException(a.columnSize(), v.size());
    }
}


text:
<?php

require_once 'Sabre/CardDAV/Backend/Mock.php';
require_once 'Sabre/DAVACL/MockPrincipalBackend.php';
require_once 'Sabre/HTTP/ResponseMock.php';

class Sabre_CardDAV_ValidateVCardTest extends PHPUnit_Framework_TestCase {

    protected $server;
    protected $cardBackend;

    function setUp() {

        $addressbooks = array(
            array(
                'id' => 'addressbook1',
                'principaluri' => 'principals/admin',
                'uri' => 'addressbook1',
            )
        );

        $this->cardBackend = new Sabre_CardDAV_Backend_Mock($addressbooks,array());
        $principalBackend = new Sabre_DAVACL_MockPrincipalBackend();

        $tree = array(
            new Sabre_CardDAV_AddressBookRoot($principalBackend, $this->cardBackend),
        );

        $this->server = new Sabre_DAV_Server($tree);
        $this->server->debugExceptions = true;

        $plugin = new Sabre_CardDAV_Plugin();
        $this->server->addPlugin($plugin);

        $response = new Sabre_HTTP_ResponseMock();
        $this->server->httpResponse = $response;

    }

    function request(Sabre_HTTP_Request $request) {

        $this->server->httpRequest = $request;
        $this->server->exec();

        return $this->server->httpResponse;

    }

    function testCreateFile() {

        $request = new Sabre_HTTP_Request(array(
            'REQUEST_METHOD' => 'PUT',
            'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
        ));

        $response = $this->request($request);

        $this->assertEquals('HTTP/1.1 415 Unsupported Media Type', $response->status);

    }

    function testCreateFileValid() {

        $request = new Sabre_HTTP_Request(array(
            'REQUEST_METHOD' => 'PUT',
            'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
        ));
        $request->setBody("BEGIN:VCARD\r\nUID:foo\r\nEND:VCARD\r\n");

        $response = $this->request($request);

        $this->assertEquals('HTTP/1.1 201 Created', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
        $expected = array(
            'uri'          => 'blabla.vcf',
            'carddata' => "BEGIN:VCARD\r\nUID:foo\r\nEND:VCARD\r\n",
        );

        $this->assertEquals($expected, $this->cardBackend->getCard('addressbook1','blabla.vcf'));

    }

    function testCreateFileNoUID() {

        $request = new Sabre_HTTP_Request(array(
            'REQUEST_METHOD' => 'PUT',
            'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
        ));
        $request->setBody("BEGIN:VCARD\r\nEND:VCARD\r\n");

        $response = $this->request($request);

        $this->assertEquals('HTTP/1.1 400 Bad request', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);

    }

    function testCreateFileVCalendar() {

        $request = new Sabre_HTTP_Request(array(
            'REQUEST_METHOD' => 'PUT',
            'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
        ));
        $request->setBody("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n");

        $response = $this->request($request);

        $this->assertEquals('HTTP/1.1 415 Unsupported Media Type', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);

    }

    function testUpdateFile() {

        $this->cardBackend->createCard('addressbook1','blabla.vcf','foo');
        $request = new Sabre_HTTP_Request(array(
            'REQUEST_METHOD' => 'PUT',
            'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
        ));

        $response = $this->request($request);

        $this->assertEquals('HTTP/1.1 415 Unsupported Media Type', $response->status);

    }

    function testUpdateFileParsableBody() {

        $this->cardBackend->createCard('addressbook1','blabla.vcf','foo');
        $request = new Sabre_HTTP_Request(array(
            'REQUEST_METHOD' => 'PUT',
            'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
        ));
        $body = "BEGIN:VCARD\r\nUID:foo\r\nEND:VCARD\r\n";
        $request->setBody($body);

        $response = $this->request($request);

        $this->assertEquals('HTTP/1.1 204 No Content', $response->status);

        $expected = array(
            'uri'          => 'blabla.vcf',
            'carddata' => $body,
        );

        $this->assertEquals($expected, $this->cardBackend->getCard('addressbook1','blabla.vcf'));

    }
}

?>


text:
from __future__ import absolute_import

from selenium.common.exceptions import NoSuchElementException

from ..settings import (
    PDB_ON_MISSING,
    TEXT_ON_MISSING,
    PNG_ON_MISSING,
)

class FindTestMixin:

    # exit to debugger on missing element
    pdb_on_missing = PDB_ON_MISSING

    # dump page text on missing element
    text_on_missing = TEXT_ON_MISSING

    # dump png image uri on missing element
    png_on_missing = PNG_ON_MISSING

    def _raise_no_such_element(self, message, *args, **kwargs):
        """ Raise missing exception with extra features. """

        if kwargs.get('text', self.text_on_missing):
            message += "---\n" + self.get_visible_text() + "\n---\n"

        # dump image data link to exception message
        if kwargs.get('png', self.png_on_missing):
            message += "---\n" + self.get_image_uri() + "\n---\n"

        # exit to pdb if flag is set
        if kwargs.get('pdb', self.pdb_on_missing):
            import pdb
            pdb.set_trace()

        # raise the exception if we get this far
        raise NoSuchElementException(message)

    def find_text(self, text, *args, **kwargs):
        """ Return true if text is found on page. """

        visible_text = self.get_visible_text()

        if text in visible_text:
            return True

        # if we get this far, raise exception
        message = "Unable to find {} on page:\n".format(text)
        self._raise_no_such_element(message, *args, **kwargs)

    def find_element(self, search_list, *args, **kwargs):
        """ Return a single element by optional index. """
        index = kwargs.get('index', 0)
        kwargs['count'] = index + 1
        elements = self.find_elements(search_list, *args, **kwargs)
        return elements[index]

    def find_elements(self, search_list, *args, **kwargs):
        """ Traverse a search list looking for count visible elements. """

        # find this many visible elements at a minimum
        count = kwargs.get('count', 1)

        # construct error message string just in case
        message = "Unable to find element, tried:\n"

        for method, pattern in search_list:

            # format the string as necessary
            # ignore index out of range values
            try:
                value = pattern.format(*args)
            except IndexError:
                continue

            # add method and value about to try
            message += "{}: {}\n".format(method, value)

            # try each of the patterns in order
            try:
                elements = self.browser.find_elements(method, value)
            except NoSuchElementException:
                pass
            else:
                # filter down to visible elements
                visible = [e for e in elements if e.is_displayed()]

                # try next if we don't have enough visible elements
                if len(visible) < count:
                    continue
                else:
                    return visible

        # raise the exception if we get this far
        self._raise_no_such_element(message, *args, **kwargs)


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.03.15 at 01:54:55 PM MEZ
//
// Based on the XML schmema: TigerXMLHeader.xsd
// Reference: http://www.coli.uni-saarland.de/projects/salsa/
//

package tigerxml;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for metaType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="metaType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="author" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="date" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="format" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="history" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "metaType", propOrder = {
    "name",
    "author",
    "date",
    "description",
    "format",
    "history"
})
public class Meta {

    protected String name;
    protected String author;
    protected String date;
    protected String description;
    protected String format;
    protected String history;

    /**
     * Gets the value of the name property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Gets the value of the author property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAuthor() {
        return author;
    }

    /**
     * Sets the value of the author property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAuthor(String value) {
        this.author = value;
    }

    /**
     * Gets the value of the date property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDate() {
        return date;
    }

    /**
     * Sets the value of the date property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDate(String value) {
        this.date = value;
    }

    /**
     * Gets the value of the description property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDescription(String value) {
        this.description = value;
    }

    /**
     * Gets the value of the format property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getFormat() {
        return format;
    }

    /**
     * Sets the value of the format property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setFormat(String value) {
        this.format = value;
    }

    /**
     * Gets the value of the history property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getHistory() {
        return history;
    }

    /**
     * Sets the value of the history property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setHistory(String value) {
        this.history = value;
    }

}


text:
package commands

import (
	"errors"
	"fmt"

	"github.com/concourse/concourse/atc"
	"github.com/concourse/concourse/fly/commands/internal/flaghelpers"
	"github.com/concourse/concourse/fly/rc"
	"github.com/jessevdk/go-flags"
	"github.com/vito/go-interact/interact"
)

type ClearVersionsCommand struct {
	Resource     flaghelpers.ResourceFlag `long:"resource" value-name:"PIPELINE/RESOURCE" description:"Name of a resource to clear versions"`
	ResourceType flaghelpers.ResourceFlag `long:"resource-type" value-name:"PIPELINE/RESOURCE-TYPE" description:"Name of a resource type to clear versions"`
}

func (command *ClearVersionsCommand) Execute(args []string) error {
	target, err := rc.LoadTarget(Fly.Target, Fly.Verbose)
	if err != nil {
		return err
	}

	err = target.Validate()
	if err != nil {
		return err
	}

	if command.Resource.ResourceName == "" && command.ResourceType.ResourceName == "" {
		return &flags.Error{
			Type:    flags.ErrRequired,
			Message: "please specify one of the required flags --resource or --resource-type",
		}
	} else if command.Resource.ResourceName != "" && command.ResourceType.ResourceName != "" {
		return &flags.Error{
			Type:    flags.ErrRequired,
			Message: "can specify only one of --resource or --resource-type",
		}
	}

	team := target.Team()

	if command.Resource.ResourceName != "" {
		shared, found, err := team.ListSharedForResource(command.Resource.PipelineRef, command.Resource.ResourceName)
		if err != nil {
			return err
		}

		if !found {
			return errors.New(fmt.Sprintf("resource '%s' is not found", command.Resource.ResourceName))
		}

		confirmed, err := command.warningMessage(shared)
		if err != nil {
			return err
		}

		if !confirmed {
			return nil
		}

		numDeleted, err := team.ClearResourceVersions(command.Resource.PipelineRef, command.Resource.ResourceName)
		if err != nil {
			return err
		} else {
			fmt.Printf("%d versions removed\n", numDeleted)
			return nil
		}

	} else if command.ResourceType.ResourceName != "" {
		shared, found, err := team.ListSharedForResourceType(command.ResourceType.PipelineRef, command.ResourceType.ResourceName)
		if err != nil {
			return err
		}

		if !found {
			return errors.New(fmt.Sprintf("resource type '%s' is not found", command.ResourceType.ResourceName))
		}

		confirmed, err := command.warningMessage(shared)
		if err != nil {
			return err
		}

		if !confirmed {
			return nil
		}

		numDeleted, err := team.ClearResourceTypeVersions(command.ResourceType.PipelineRef, command.ResourceType.ResourceName)
		if err != nil {
			return err
		} else {
			fmt.Printf("%d versions removed\n", numDeleted)
			return nil
		}
	}

	return nil
}

func (command *ClearVersionsCommand) warningMessage(shared atc.ResourcesAndTypes) (bool, error) {
	fmt.Println("!!! this will clear the version histories for the following resources:")
	for _, r := range shared.Resources {
		fmt.Printf("- %s/%s/%s\n", r.TeamName, r.PipelineName, r.Name)
	}

	fmt.Println(`
and the following resource types:`)
	for _, rt := range shared.ResourceTypes {
		fmt.Printf("- %s/%s/%s\n", rt.TeamName, rt.PipelineName, rt.Name)
	}

	fmt.Println("")

	var confirm bool
	err := interact.NewInteraction("are you sure?").Resolve(&confirm)
	if err != nil || !confirm {
		fmt.Println("bailing out")
		return false, err
	}

	return true, nil
}


text:
#ifndef _STE_Edit_Style_h
#define _STE_Edit_Style_h

// STE_Edit_Style.h
//------------------------------------------
// synopsis:
// STE_Edit_Style dialog in libGT
//------------------------------------------

#ifndef _prototypes_h
#include <prototypes.h>
#endif
#ifndef _ui_struct_h
#include <ui-struct.h>
#endif
#ifndef _gt_h
#include <gt.h>
#endif

#include <machdep.h>

#ifndef _ui_globals_h
#include <ui-globals.h>
#endif

class STE_Edit_Style_RGB;

class STE_Edit_Style {
    gtHorzBox		*name_slot, *options, *font_slot, *text_slot, *cursor_slot;
    gtPushButton	*style_name, *document_options, *tp_options, *text_color;
    gtPushButton	*cursor_color;
    gtStringEditor	*style_name_btn;
    gtLabeledStringEditor	*es_level_text, *es_fontname_text, *es_fontsize_text;
    gtOptionMenu	*style_type_options;
    gtSeparator		*sep;
    gtToggleBox		*text_toggles, *cursor_toggles, *text_options;
    STE_Edit_Style_RGB	*TextColor_Editor, *CursorColor_Editor;

  public:
    gtDialogTemplate	*shell;
    int			i_style_type;
    ui_style		uis;
    swidget The_swidget_from_HELL;
    STE_Edit_Style(ui_style *, swidget I_really_needed_a_swidget);
    ~STE_Edit_Style();
    double text_val(gtStringEditor *);
    void set_fval(gtStringEditor *, double);
    void set_ival(gtStringEditor *, int);
    void write_style(ui_style *style);
    char *make_hex_name(unsigned long);
    void do_it();
    void disable_level();
    void enable_level();
    void disable_doc_items();
    void enable_doc_items();
    void disable_para_items();
    void enable_para_items();
    void read_style(ui_style *);
    static void read_style_name(ui_RTL_info *);
    static void OK_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void Apply_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void Cancel_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void StyleName_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void Document_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void Title_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void Paragraph_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void Character_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void DocOptions_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void TPOptions_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void Plain_CB(gtToggleButton *, gtEvent *, void *cd, gtReason);
    static void Bold_CB(gtToggleButton *, gtEvent *, void *cd, gtReason);
    static void Italic_CB(gtToggleButton *, gtEvent *, void *cd, gtReason);
    static void Underline_CB(gtToggleButton *, gtEvent *, void *cd, gtReason);
    static void Shaded_CB(gtToggleButton *, gtEvent *, void *cd, gtReason);
    static void Reverse_CB(gtToggleButton *, gtEvent *, void *cd, gtReason);
    static void TextColor_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static void CursorColor_CB(gtPushButton *, gtEvent *, void *cd, gtReason);
    static int WMDestroyCancel(void*);
};

typedef STE_Edit_Style* STE_Edit_Style_Ptr;

/*
    START-LOG-------------------------------

   $Log: STE_Edit_Style.h  $
   Revision 1.1 1993/10/05 09:33:43EDT builder
   made from unix file
 * Revision 1.2.1.4  1993/10/04  20:36:22  kws
 * Port
 *
 * Revision 1.2.1.3  1993/05/27  20:17:16  glenn
 * Protect nested includes using protect_includes script.
 *
 * Revision 1.2.1.2  1992/10/09  19:56:10  kws
 * Fix comments
 *
    END-LOG---------------------------------
*/

#endif // _STE_Edit_Style_h


text:
<?php

namespace FrametekLight\Http;

use FrametekLight\Collections\DataCollection;
use FrametekLight\Exception\UndefinedHttpException;

/**
 * Cookie
 *
 * This class
 *
 * @package FrametekLight
 * @author Rémi Rebillard
 */
class Cookie extends DataCollection
{

    /**
     *
     * @var integer
     */
    public static $_EXPIRE = 259200;

    /**
     *
     * @throws UndefinedHttpException
     */
    public function __construct()
    {
        parent::__construct();
        if (! isset($_COOKIE)) {
            throw new UndefinedHttpException("COOKIE");
        } else {
            $this->setAll($_COOKIE);
        }
    }

    /**
     * Set cookie item with expire
     *
     * @param string $key
     *            The cookie key
     * @param mixed $value
     *            The cookie value
     * @param integer $expire
     *            The cookie $expire
     *
     * @return boolean Fail if an output has be done before this method call
     */
    public function setWithExpire($key, $value, $expire)
    {
        if (setcookie($key, $value, time() + $expire, '/', '', false, true)) {
            return true;
        }
        return false;
    }

    /**
     * ******************************************************************************
     * Collection interface
     * *****************************************************************************
     */
    /**
     * Set cookie item
     *
     * @param string $key
     *            The cookie key
     * @param mixed $value
     *            The cookie value
     */
    public function set($key, $value)
    {
        $this->setWithExpire($key, $value, static::$_EXPIRE);
    }

    /**
     * Remove item from cookies
     *
     * @param string $key
     *            The cookie key
     * @param boolean $all[optional]
     *            (unused) Specifie if all folders of the key path will be remove or not
     */
    public function remove($key, $all = FALSE)
    {
        $this->setWithExpire($key, $value, time() - 1);
    }
}


text:
/**
 *
 */
package model;

import gui.Describable;

/**
 * A generalized resource.
 *
 */
public interface Asset extends Describable {

	public AssetType getType();

}


text:
require 'rails_helper'

describe Meta::GamesController do
  before(:all) do
    @admin = create(:user)
    @admin.grant(:edit, :games)

    @user = create(:user)
  end

  describe 'GET #index' do
    it 'succeeds for authorized user' do
      sign_in @admin

      get :index

      expect(response).to have_http_status(:success)
    end
  end

  describe 'GET #new' do
    it 'succeeds for authorized user' do
      sign_in @admin

      get :new

      expect(response).to have_http_status(:success)
    end
  end

  describe 'POST #create' do
    it 'succeeds for authorized user' do
      sign_in @admin

      post :create, params: { game: { name: 'Bar' } }

      game = Game.first
      expect(game.name).to eq('Bar')
      expect(response).to redirect_to(meta_game_path(game))
    end

    it 'fails for invalid data' do
      sign_in @admin

      post :create, params: { game: { name: '' } }

      expect(Game.all).to be_empty
      expect(response).to have_http_status(:success)
    end

    it 'redirects for unauthorized user' do
      sign_in @user

      post :create, params: { game: { name: 'Bar' } }

      expect(Game.all).to be_empty
      expect(response).to redirect_to(root_path)
    end
  end

  context 'existing game' do
    let!(:game) { create(:game) }

    describe 'GET #show' do
      it 'succeeds' do
        get :show, params: { id: game.id }

        expect(response).to have_http_status(:success)
      end
    end

    describe 'GET #edit' do
      it 'succeeds for authorized user' do
        sign_in @admin

        get :edit, params: { id: game.id }

        expect(response).to have_http_status(:success)
      end
    end

    describe 'PATCH #update' do
      it 'succeeds for authorized user' do
        sign_in @admin

        patch :update, params: { id: game.id, game: { name: 'A' } }

        game.reload
        expect(game.name).to eq('A')
      end

      it 'fails for invalid data' do
        sign_in @admin

        patch :update, params: { id: game.id, game: { name: '' } }

        game.reload
        expect(game.name).to_not eq('')
        expect(response).to have_http_status(:success)
      end

      it 'redirects for unauthorized user' do
        sign_in @user

        patch :update, params: { id: game.id, game: { name: 'Bar' } }

        game.reload
        expect(game.name).to_not eq('Bar')
        expect(response).to redirect_to(root_path)
      end
    end

    describe 'DELETE #destroy' do
      before do
        create(:map, game: game)
        create(:format, game: game)
      end

      it 'succeeds for authorized user' do
        sign_in @admin

        delete :destroy, params: { id: game.id }

        expect(Game.all).to be_empty
        expect(Map.all).to be_empty
        expect(Format.all).to be_empty
      end

      it 'fails for unauthorized user' do
        sign_in @user

        delete :destroy, params: { id: game.id }

        expect(Game.all).to_not be_empty
      end

      it 'fails for unauthenticated user' do
        delete :destroy, params: { id: game.id }

        expect(Game.all).to_not be_empty
      end
    end
  end
end


text:
package anuncioArrayList;

public abstract class Anuncio {
private String	nombre;
private String producto;
private int diasEmision;

public Anuncio(String nombre, String producto, int diasEmision) {
	this.nombre = nombre;
	this.producto = producto;
	this.diasEmision = diasEmision;
}

public abstract double costeAnuncio();

@Override
public String toString() {
	return "Anuncio [nombre=" + nombre + ", producto=" + producto + ", diasEmision=" + diasEmision + "]";
}

public String getNombre() {
	return nombre;
}

public String getProducto() {
	return producto;
}

public int getDiasEmision() {
	return diasEmision;
}

public void setNombre(String nombre) {
	this.nombre = nombre;
}

public void setProducto(String producto) {
	this.producto = producto;
}

public void setDiasEmision(int diasEmision) {
	this.diasEmision = diasEmision;
}

}


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
        <title>OpenLayers WMTS Capabilities Example</title>
        <link rel="stylesheet" href="../theme/default/style.css" type="text/css"/>
        <link rel="stylesheet" href="style.css" type="text/css">

Web Map Tile Service (WMTS) Capabilities Parsing

            wmts, capabilities, getcapabilities

            The WMTS Capabilities format allows for parsing of capabilities
            documents from OGC Web Map Tile Service (WMTS) version 1.0.0
            implementations.

                This example creates an OpenLayers.Layer.WMTS layer to based
                on the results of parsing a capabilities doc with the
                OpenLayers.Format.WMTSCapabilities parser.

                See the
                wmts-capabilities.js source to see how this is done.


text:
A utility project to support fast class instantiation, using cached Delegate (ConstructorInvoker) methods, rather than Activator.CreateInstance or Expression Trees.

A Test project is included to verify class instantiation including multiple constructors, inheritance, etc.

GenericFactory is especially suited to systems architected using DDD, CQRS, CQRS+ES approaches, where many thousands of objects are instantiated.

A partner project, Pro.FastBus, will be released shortly, which can be used in conjunction with GenericFactory for Command dispatching, and Aggregate instance instantiation.

#Usage

####Step 1.

Register the class to be instantiated, using the generic Register method specifying the Type, and supplying a string id, and array of Types for any paramaters. Examples are listed below:

    GenericFactory.Register<EntityNoConstructor>("EntityNoConstructorKey", new Type[] { });
    GenericFactory.Register<EntitySingleConstructor>("EntitySingleConstructorKey", new[] { typeof(int) });

    GenericFactory.Register<EntityDoubleConstructor>("EntityDoubleConstructorKey1", new[] { typeof(int) });
    GenericFactory.Register<EntityDoubleConstructor>("EntityDoubleConstructorKey2", new[] { typeof(string) });

    GenericFactory.Register<EntityPerformanceTest>("EntityPerformanceTestKey", new[] { typeof(int), typeof(List<int>) });

####Step 2.

Instantiate an instance of a class using the generic CreateInstance method, specifying the Type, and supplying a string id, and any params.

    var instance = GenericFactory.CreateInstance<EntityPerformanceTest>("EntityPerformanceTestKey", 1, list);

    var instance = GenericFactory.CreateInstance<TAggregate>(aggregateTypeName, uid);

The project uses Fasterflect to create the ConstructorInvoker:
http://fasterflect.codeplex.com

The ConstructorInvoker is then cached in a static dictionary, and accessed via a string key that is matched using StringComparer.Ordinal; testing has shown this to be more performant than using Fasterflects internal caching.

#Performance

Basic performance tests are included which can be used to compare time to instantiate x number of classes, against using 'new' of a concrete type. Please test your own specific circumstances, and be aware that at these low time values, many other factors may influence results (Garbage Collection can have a significant impact).

Sample results, running the performance tests on an Azure VM - Standard DS3 v2 (4 cores, 14 GB memory).

####GenericFactory

10,000 instantiations 0.0007806 seconds

1,000,000 instantiations 0.0827468 seconds

####Concrete New

10,000 instantiations 0.0000559 seconds

1,000,000 instantiations 0.0121796 seconds

--
**All Feedback Welcome!**

*David Paul McQuiggin, Pro-Coded.*


text:
package de.uniaugsburg.isse.util;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collection;
import java.util.List;

import de.uniaugsburg.isse.abstraction.InOutPair;

/**
 * Provides really basic support for writing csv files
 *
 * @author alexander
 *
 */
public class FileUtil {

	public static File writeSampledPoints(Collection<InOutPair> sampledPoints) {
		File f = null;
		try {
			f = File.createTempFile("iopairs", "samp");
			double[] doubleArray = new double[sampledPoints.size() * 2];
			int i = 0;
			for (InOutPair ioPair : sampledPoints) {
				doubleArray[i] = ioPair.getInput();
				doubleArray[i + 1] = ioPair.getOutput();
				i += 2;
			}
			writeCsv(doubleArray, 2, f);
			return f;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * Takes a double array which needs to have doubleArray.length = n X dim entries and writes it as n lines with dim
	 * numbers each line separated by a comma and terminated by end line
	 *
	 * @param doubleArray
	 * @param dim
	 * @param fileName
	 */
	public static void writeCsv(double[] doubleArray, int dim, File file) {
		FileWriter fw = null;
		try {
			fw = new FileWriter(file);
			StringBuilder lineBuilder = new StringBuilder();
			for (int i = 0; i < doubleArray.length; i += dim) {
				for (int d = 0; d < dim; ++d) {
					lineBuilder.append(doubleArray[i + d]);
					if (d + 1 < dim)
						lineBuilder.append(",");
				}
				fw.write(lineBuilder.toString() + "\n");
				lineBuilder = new StringBuilder();
			}
		} catch (IOException e) {
			e.printStackTrace();
			return;
		} finally {
			if (fw != null)
				try {
					fw.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
		}
	}

	public static File writeDoubleList(List<Double> doubleList) {
		File f = null;
		try {
			f = File.createTempFile("complete_input", "samp");
			double[] doubleArray = new double[doubleList.size()];
			int i = 0;
			for (double val : doubleList) {
				doubleArray[i] = val;
				++i;
			}
			writeCsv(doubleArray, 1, f);
			return f;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
}


text:
namespace ADO.NET_Fetching_Resultsets
{
    using System.Data.SqlClient;

    public class Startup
    {
        /* SQLDataProvider Installation Guide
                Open: Package Manager Console
                Type: Install-Package System.Data.SQLClient
                Press: Enter
                Ready. :)
         */

        private const string InitialConnectionString = @"
            Server=DESKTOP-5FMQC2G\SQLEXPRESS;
            Integrated Security=true";
        /* Same result as this one
        private const string InitialConnectionString = @"
            Server=DESKTOP-5FMQC2G\SQLEXPRESS;
            Database=master;
            Integrated Security=true";
         */

        private const string MinionsDBConnectionString = @"
            Server=DESKTOP-5FMQC2G\SQLEXPRESS;
            Database=MinionsDB;
            Integrated Security=true";

        public static void Main()
        {
            var exercises = new Exercises();
            // exercises.InitialSetup(InitialConnectionString); // 1. Initial Setup
            // exercises.VillainNames(MinionsDBConnectionString); // 2. Villain Names
            // exercises.MinionNames(MinionsDBConnectionString); // 3. Minion Names
            // exercises.AddMinion(MinionsDBConnectionString); // 4. Add Minion
            // exercises.ChangeTownNamesCasing(MinionsDBConnectionString); // 5. Change Town Names Casing
            exercises.RemoveVillain(MinionsDBConnectionString); // 6. *Remove Villain
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

	<title>Encontre a Trello</title>
	<meta name="description" content="" />

	<link rel="apple-touch-icon" href="//elidiaz.com/themes/chop/assets/images/apple-touch-icon.png?v=1508393273556" />
    <link rel="icon" type="image/png" href="//elidiaz.com/themes/chop/assets/images/favicon-32x32.png?v=1508393273556" sizes="32x32" />
    <link rel="icon" type="image/png" href="//elidiaz.com/themes/chop/assets/images/favicon-16x16.png?v=1508393273556" sizes="16x16" />

	<link href='https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic|Droid+Serif:400,400italic,700,700italic' rel='stylesheet' type='text/css'>

	<link href="//elidiaz.com/themes/chop/assets/css/normalize.css?v=1508393273556" rel="stylesheet">

    <link href="//elidiaz.com/themes/chop/assets/css/bootstrap.min.css?v=1508393273556" rel="stylesheet">

    <link href="//elidiaz.com/themes/chop/assets/css/style.css?v=1508393273556" rel="stylesheet">

    <link href="//elidiaz.com/themes/chop/assets/css/font-awesome.min.css?v=1508393273556" rel="stylesheet">

    <link rel="canonical" href="http://elidiaz.com/2012/04/24/Encontre-a-Trello.html" />
    <meta name="referrer" content="origin" />

    <meta property="og:site_name" content="EliDiaz.com" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Encontre a Trello" />
    <meta property="og:description" content="Dentro de lo que es aprender a organizar el trabajo de un equipo, surge la necesidad de utilizar una herramienta de gestión dejando atrás el utilizar papel y lápiz, hojas de Excel e incluso algo que en alguna época utilice mucho y creí que me solucionaban los google docs, que" />
    <meta property="og:url" content="http://elidiaz.com/2012/04/24/Encontre-a-Trello.html" />
    <meta property="og:image" content="https://farm3.staticflickr.com/2663/3879260297_dfc867d531_b.jpg" />
    <meta property="article:published_time" content="2012-04-24T00:00:00.000Z" />
    <meta property="article:tag" content="agile" />
    <meta property="article:tag" content="product" />
    <meta property="article:tag" content="development" />

    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content="Encontre a Trello" />
    <meta name="twitter:description" content="Dentro de lo que es aprender a organizar el trabajo de un equipo, surge la necesidad de utilizar una herramienta de gestión dejando atrás el utilizar papel y lápiz, hojas de Excel e incluso algo que en alguna época utilice mucho y creí que me solucionaban los google docs, que" />
    <meta name="twitter:url" content="http://elidiaz.com/2012/04/24/Encontre-a-Trello.html" />
    <meta name="twitter:image:src" content="https://farm3.staticflickr.com/2663/3879260297_dfc867d531_b.jpg" />

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="EliDiaz.com" href="http://elidiaz.com/rss/" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/atom-one-dark.min.css">

			  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#cp-navbar-collapse" aria-expanded="false">
				Toggle navigation

			  </button>

About

Portfolio

Innovation

Education

Technology

Healthy

Wealthy

Wise

Encontre a Trello

								Eli Diaz

								Apr 24, 2012

								0 Comments

Dentro de lo que es aprender a organizar el trabajo de un equipo, surge la necesidad de utilizar una herramienta de gestión dejando atrás el utilizar papel y lápiz, hojas de Excel e incluso algo que en alguna época utilice mucho y creí que me solucionaban los google docs, que son muy útiles para realizar documentos en conjunto, pero no para llevar el control del trabajo.

Algo que es muy necesario y con el tiempo te vas dando cuenta es que la herramienta debe de ser lo mas sencilla posible, debe de ser fácil de usar y que no tiene que consumir mucho tiempo el utilizarla.

Me he encontrado con varias, algunas muy completas que en la demostración y el video/concepto se ven muy bien, hay algunas que generan todo tipo de reportes y tienen miles de funcionalidades, pero que lo único que hacen es ocuparte en estar alimentándolas de información y no siendo productivo, en el caso de la industria de software una particularidad que es difícil es identificar es saber que esta haciendo cada quien.

El problema con los programadores es que nunca sabes lo que están haciendo hasta que es demasiado tarde. — Seymour Cray

Para mi Trello me viene a solucionar esto: es fácil, intuitivo y sobre todo dinámico.

Trello fue creado para ser lo mas general posible y no necesariamente para usarse en el desarrollo de software, se puede utilizar para cualquier proyecto que tenga tareas o pasos a realizarse y se quiere llevar el control de su proceso.

Trello esta basado en Kanban que es un sistema de información que controla de modo armónico la fabricación de los productos necesarios en la cantidad y tiempo necesarios en cada uno de los procesos.

Trello se enfoca en: en derivar tareas y controlar el progreso de las mismas.

Otra cosa que es fascinante es que cuenta con un api, para que uno pueda añadirle funcionalidad, incluso ya existen varios plugins que se pueden usar: Trello en ChromeStore

							 agile | product | development

						   Share:

Eli Diaz

Worldwide

Website

							Please enable JavaScript to view the comments powered by Disqus.

Your Host

							Humble and always open to learning.

							Eli Diaz is an enterprise-level solution digital consultant working in the research and development industry.

							More about me in my biography and my portfolio work.

blog@elidiaz.com

Facebook

Podcast

Advertisement

Consigue inspiracion gratis

Directamente a tu correo cada lunes por la mañana.

							<form action="#" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate form-horizontal" novalidate>

									<input type="email" value="" name="EMAIL" class="required email form-control" id="mce-EMAIL">

									<button type="submit" name="subscribe" id="mc-embedded-subscribe" class="btn btn-primary">Subscribe</button>

							</form>

© 2017 EliDiaz.com. All right Reserved


text:
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { TdDynamicFormsComponent } from '../../../../platform/dynamic-forms';
import { InventTableService, ClaimService, ProdlineService, ErrortypeService, ErrordescriptiondimService, DiscarditemService,LocationService } from '../../../services';
import { Claim, Prodline, Errortype, Errordescriptiondim } from '../../../models';
import { AppService } from '../../../services';

@Component({
    selector: 'claim-detail',
    templateUrl: './claimDetail.template.html',
    styleUrls: ['../claim.css']
})

export class ClaimDetailComponent implements OnInit, AfterViewInit {
    claim: Claim;
    errortypes: Errortype[];
    prodlines: Prodline[];
    errordescriptiondims: Errordescriptiondim[];
    permissionToUnLock: boolean;
    permissionToUnlockedIsPressed: boolean = false;
    dynamicFormsAttrs: any[] = [];
    newMode: boolean;
    @ViewChild(TdDynamicFormsComponent) form: TdDynamicFormsComponent;

    constructor(
        private _prodlineService: ProdlineService,
        private _errortypeService: ErrortypeService,
        private route: ActivatedRoute,
        private _claimService: ClaimService,
        private _errordescriptiondimService: ErrordescriptiondimService,
        private _inventTableServ: InventTableService,
        private _discarditemService: DiscarditemService,
        private router: Router,
        private _locationService: LocationService,
        private _appService: AppService) {
        this.dynamicFormsAttrs = this._claimService.datastore.gridparam.myForm
    }

    ngAfterViewInit() {
        this.dynamicFormsAttrs = this._claimService.datastore.gridparam.myForm
        this.loadFormNeeded();
        this.initForm();
        this.form.form.controls['ERRORTYPE'].valueChanges
            .subscribe((v: any) => {
                this.onErrorTypeChange(v);
            });
    }
    ngOnInit() {
        this._inventTableServ.myItemSearch$.subscribe(items => {
            this.form.fillSelections('ITEM', items);
        });
        this.route.data.subscribe((data: { claim: any }) => {
            (data.claim === -1) ? this.newMode = true : this.newMode = false;
            if (data.claim !== -1) {
                this.claim = data.claim;
                this.permissionToUnlockedIsPressed = false;
            }
            this.initForm();
            // this.toggleLocked(this.claim.CLOSED)
        });
    }
    initForm() {
        // check if form is loaded and load init values to form.
        if (this.form.elements && this.form.elements.length > 0) {
            // load errors based on errortype value.
            if (this.newMode) {
                console.log('test')
                this.form.form.reset();
                this.form.form.markAsPristine(); // reset form
                this.form.form.controls['CLAIMDATE'].setValue(new Date());
            } else {
                console.log('lll')
                this.form.form.controls['CLAIMDATE'].setValue(new Date(this.claim.CLAIMDATE)); //parse stringdate to date
                this.form.form.controls['PRODLINEID'].setValue(this.claim.PRODLINEID);
                this.form.form.controls['ERRORTYPE'].setValue(this.claim.Errortypeid);
                this.onErrorTypeChange(this.claim.Errortypeid);

                this.form.form.controls['ITEM'].setValue(this.claim.ITEMID);
                this.form.form.controls['NUMBER'].setValue(this.claim.NUMBER);
                this.form.form.controls['DESCRIPTION'].setValue(this.claim.DESCRIPTION);
            }
            // this.toggleLocked(this.claim.CLOSED)
        }

    }
    loadFormNeeded() {
        this.prodlines = this._prodlineService.datastore.gridView.data;
        this.errortypes = this._errortypeService.datastore.gridView.data;
        this.errordescriptiondims = this._errordescriptiondimService.datastore.gridView.data;

        this.form.fillSelections('PRODLINEID', this.prodlines);
        this.form.fillSelections('ERRORTYPE', this.errortypes);
        this.form.fillSelections('ERRORDESCRIPTIONDIMID', this.errordescriptiondims);
    }
    submit() {
        let claimObj: any = {}
        claimObj = Object.assign({}, this.form.form.value) // fill obj with values from form

        // ********************* CREATE NEW *******************************
        if (this.newMode) {
            // add default values
            claimObj.CREATED = new Date();
            claimObj.LOCATIONID = this._appService.myCurrentLoc.ID;
            claimObj.CREATEDBY = this._appService.myProfile.user_id;
            claimObj.CLOSED = false;
            this._claimService.createClaim(claimObj, this.route );
        }
        // ********************* UPDATE *******************************
        else {
            claimObj.CREATED = this.claim.CREATED;
            claimObj.LOCATIONID = this.claim.LOCATIONID;
            claimObj.CREATEDBY = this.claim.CREATEDBY;
            claimObj.CLOSED = this.claim.CLOSED;
            claimObj.CLAIMDATE = this.form.form.controls['CLAIMDATE'].value.toLocaleDateString(); // parse date
            console.log(JSON.stringify(claimObj));
            this._claimService.update(this.claim.ID, JSON.stringify(claimObj))
        }
    }
    toggleLocked(event: any) {
        // event ? this.form.setAllControlsDisable(true) : this.form.setAllControlsDisable(false);
        // this.onErrortypeChange(this.claim.Errortypeid);
        this.permissionToUnlockedIsPressed = event;
        // to let discardList know readonly
        // this._claimService.updateClaimLocked(event);
    }
    cancel() {
        this.router.navigate(['../'], { relativeTo: this.route });
    }
    onErrorTypeChange(v: any) {
        let myErrDims = this.errordescriptiondims.filter(f => f.ERRORTYPEID === v);
        this.form.fillSelections('ERRORDESCRIPTIONDIMID', myErrDims);
        if (this.claim && this.claim.ERRORDESCRIPTIONDIMID) {
            this.form.form.controls['ERRORDESCRIPTIONDIMID'].setValue(this.claim.ERRORDESCRIPTIONDIMID);
        }

    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<!-- Link to the parent pom -->
	<parent>
		<groupId>de.cau.cs.se.geco.architecture</groupId>
		<artifactId>de.cau.cs.se.geco.architecture.parent</artifactId>
		<version>1.1.0-SNAPSHOT</version>
	</parent>

	<artifactId>de.cau.cs.se.geco.architecture.graph</artifactId>

	<packaging>eclipse-plugin</packaging>

	<name>GECO Generator Composition Language Kieler View</name>
</project>


text:
namespace TicketingSystem.Web.ViewModels.Home
{
    using System;
    using System.Linq.Expressions;

    using TicketingSystem.Data.Models;

    public class DisplayTicketViewModel
    {
        public static Expression<Func<Ticket, DisplayTicketViewModel>> ViewModel
        {
            get
            {
                return ticket => new DisplayTicketViewModel
                {
                    Id = ticket.Id,
                    Title = ticket.Title,
                    Author = ticket.Author.UserName,
                    Category = ticket.Category.Name,
                    CommentsCount = ticket.Comments.Count
                };
            }
        }

        public int Id { get; set; }

        public string Title { get; set; }

        public string Category { get; set; }

        public string Author { get; set; }

        public int CommentsCount { get; set; }
    }
}


text:
function updateTask(elm, id, task, props) {
  var rtn, check, item;

  check = data(elm, 'item', id);
  if(check===null) {
    rtn = utils.exception("File Not Found", "No record on file", 404);
  }
  else {
    item = check;
    item.id = id;
    item.title = (task.title===undefined?check.title:task.title);
    item.completed = (task.completed===undefined?check.completed:task.completed);

    if(item.completed!=="false" && item.completed!=="true") {
      item.completed="false";
    }
    if (item.title === "") {
      rtn = utils.exception("Missing Title");
    }
    else {
      data(elm, 'update', id, setProps(item, props));
    }
  }

  return rtn;
}


text:
layout: post
categories:
- talk
title: "Intro to being anti-racist in civic tech"
location: "Chi Hack Night"
date: 2021-04-13
image: /images/talks/chn-anti-racism.jpg
description: "What does it mean to be anti-racist? What is white supremacy culture and how does it show up? Over the past months, Chi Hack Night's Diversity, Equity and Inclusion (DEI) committee has discussed and researched these questions. I am joined by fellow Chi Hack Night Board Members Ryan Spencer and Samantha Evans to share what we learned in our blog post so that we can all work to make our communities more equitable and just."
link: https://chihacknight.org/events/2021/04/13/anti-racist-in-civic-tech.html
tags: presentation
medium: video
featured: true
published: true
---


text:
^title Storing C Data

**TODO: Write these docs.**

Until these are written, you can read the docs in [wren.h][].

[wren.h]: https://github.com/munificent/wren/blob/master/src/include/wren.h

Configuring the VM →
← Calling C from Wren


text:
<?php

namespace Oro\Bundle\EntityBundle\Handler;

/**
 * The default implementation of the delete handler extension.
 */
final class EntityDeleteHandlerExtension extends AbstractEntityDeleteHandlerExtension
{
}