text:
using Supido.Business.Query;
using Supido.Core.Proxy;
using System;
using System.Collections;
using System.Collections.Generic;

namespace Supido.Business.BO
{
    /// <summary>
    /// Abstract class for a Business Object that is based on the mapping of a DTO to an entity.
    /// </summary>
    /// <typeparam name="TDto">The type of the dto.</typeparam>
    public abstract class BaseBO<TDto> : IBO<TDto>, IEntityBO
    {
        #region - Properties -

        /// <summary>
        /// Gets or sets the type of the entity.
        /// </summary>
        /// <value>
        /// The type of the entity.
        /// </value>
        public Type EntityType { get; set; }

        /// <summary>
        /// Gets the type of the dto.
        /// </summary>
        /// <value>
        /// The type of the dto.
        /// </value>
        public Type DtoType
        {
            get { return typeof(TDto); }
        }

        #endregion

        #region - Constructors -

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseBO{TDto}"/> class.
        /// </summary>
        /// <param name="entityType">Type of the entity.</param>
        public BaseBO(Type entityType)
        {
            this.EntityType = entityType;
        }

        #endregion

        #region - Events -

        /// <summary>
        /// Delegate for an event of the business object.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="BOEventArgs{TDto}"/> instance containing the event data.</param>
        public delegate void BOEvent(IBO<TDto> sender, BOEventArgs<TDto> args);

        /// <summary>
        /// Occurs when [before get all].
        /// </summary>
        public event BOEvent BeforeGetAll;

        /// <summary>
        /// Occurs when [before get one].
        /// </summary>
        public event BOEvent BeforeGetOne;

        /// <summary>
        /// Occurs when [before insert].
        /// </summary>
        public event BOEvent BeforeInsert;

        /// <summary>
        /// Occurs when [before update].
        /// </summary>
        public event BOEvent BeforeUpdate;

        /// <summary>
        /// Occurs when [before delete].
        /// </summary>
        public event BOEvent BeforeDelete;

        /// <summary>
        /// Occurs when [after get all].
        /// </summary>
        public event BOEvent AfterGetAll;

        /// <summary>
        /// Occurs when [after get one].
        /// </summary>
        public event BOEvent AfterGetOne;

        /// <summary>
        /// Occurs when [after insert].
        /// </summary>
        public event BOEvent AfterInsert;

        /// <summary>
        /// Occurs when [after update].
        /// </summary>
        public event BOEvent AfterUpdate;

        /// <summary>
        /// Occurs when [after delete].
        /// </summary>
        public event BOEvent AfterDelete;

        #endregion

        #region - Methods -

        #region - Abstract Methods -

        /// <summary>
        /// Gets all the entities.
        /// </summary>
        /// <param name="info">The query information.</param>
        /// <returns></returns>
        protected abstract IList GetEntityAll(QueryInfo info);

        /// <summary>
        /// Gets one entity by primary key.
        /// </summary>
        /// <param name="pk">The primary key.</param>
        /// <param name="info">The query information.</param>
        /// <returns></returns>
        protected abstract object GetEntityOne(string pk, QueryInfo info);

        /// <summary>
        /// Inserts the entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        protected abstract object InsertEntity(object entity);

        /// <summary>
        /// Updates the entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        protected abstract object UpdateEntity(object entity);

        /// <summary>
        /// Deletes the entity.
        /// </summary>
        /// <param name="pk">The pk.</param>
        /// <returns></returns>
        protected abstract int DeleteEntity(string pk);

        #endregion

        #region - Methods from IBO -

        /// <summary>
        /// Gets all the DTOs.
        /// </summary>
        /// <returns></returns>
        public IList<TDto> GetAll()
        {
            if (this.BeforeGetAll != null)
            {
                this.BeforeGetAll(this, new BOEventArgs<TDto>());
            }
            IList<TDto> result = ObjectProxyFactory.MapToList<TDto>(this.GetEntityAll(null));
            if (this.AfterGetAll != null)
            {
                this.AfterGetAll(this, new BOEventArgs<TDto>(null, null, default(TDto), default(TDto), result, null));
            }
            return result;
        }

        /// <summary>
        /// Gets all the DTOs.
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public IList<TDto> GetAll(QueryInfo info)
        {
            if (this.BeforeGetAll != null)
            {
                this.BeforeGetAll(this, new BOEventArgs<TDto>(null, info, default(TDto), default(TDto), null, null));
            }
            IList<TDto> result = ObjectProxyFactory.MapToList<TDto>(this.GetEntityAll(info));
            if (this.AfterGetAll != null)
            {
                this.AfterGetAll(this, new BOEventArgs<TDto>(null, info, default(TDto), default(TDto), result, null));
            }
            return result;
        }

        /// <summary>
        /// Gets one DTO.
        /// </summary>
        /// <param name="pk">The pk.</param>
        /// <returns></returns>
        public TDto GetOne(string pk)
        {
            if (this.BeforeGetOne != null)
            {
                this.BeforeGetOne(this, new BOEventArgs<TDto>(pk, null, default(TDto), default(TDto), null, null));
            }
            TDto result = ObjectProxyFactory.MapTo<TDto>(this.GetEntityOne(pk, null));
            if (this.AfterGetOne != null)
            {
                this.AfterGetOne(this, new BOEventArgs<TDto>(pk, null, default(TDto), result, null, null));
            }
            return result;
        }

        /// <summary>
        /// Gets one DTO.
        /// </summary>
        /// <param name="pk">The pk.</param>
        /// <param name="info"></param>
        /// <returns></returns>
        public TDto GetOne(string pk, QueryInfo info)
        {
            if (this.BeforeGetOne != null)
            {
                this.BeforeGetOne(this, new BOEventArgs<TDto>(pk, info, default(TDto), default(TDto), null, null));
            }
            TDto result = ObjectProxyFactory.MapTo<TDto>(this.GetEntityOne(pk, info));
            if (this.AfterGetOne != null)
            {
                this.AfterGetOne(this, new BOEventArgs<TDto>(pk, info, default(TDto), result, null, null));
            }
            return result;
        }

        /// <summary>
        /// Inserts one DTO.
        /// </summary>
        /// <param name="src">The source.</param>
        /// <returns></returns>
        public TDto Insert(TDto src)
        {
            object entity = ObjectProxyFactory.MapTo(this.EntityType, src);
            if (this.BeforeInsert != null)
            {
                this.BeforeInsert(this, new BOEventArgs<TDto>(null, null, src, default(TDto), null, entity));
            }
            TDto result = ObjectProxyFactory.MapTo<TDto>(this.InsertEntity(entity));
            if (this.AfterInsert != null)
            {
                this.AfterInsert(this, new BOEventArgs<TDto>(null, null, src, result, null, entity));
            }
            return result;
        }

        /// <summary>
        /// Updates one DTO.
        /// </summary>
        /// <param name="src">The source.</param>
        /// <returns></returns>
        public TDto Update(TDto src)
        {
            object entity = ObjectProxyFactory.MapTo(this.EntityType, src);
            if (this.BeforeUpdate != null)
            {
                this.BeforeUpdate(this, new BOEventArgs<TDto>(null, null, src, default(TDto), null, entity));
            }
            TDto result = ObjectProxyFactory.MapTo<TDto>(this.UpdateEntity(entity));
            if (this.AfterUpdate != null)
            {
                this.AfterUpdate(this, new BOEventArgs<TDto>(null, null, src, result, null, entity));
            }
            return result;
        }

        /// <summary>
        /// Deletes one DTO by primary key.
        /// </summary>
        /// <param name="pk">The primary key.</param>
        /// <returns></returns>
        public int Delete(string pk)
        {
            if (this.BeforeDelete != null)
            {
                this.BeforeDelete(this, new BOEventArgs<TDto>(pk, null, default(TDto), default(TDto), null, null));
            }
            int result = this.DeleteEntity(pk);
            if (this.AfterDelete != null)
            {
                this.AfterDelete(this, new BOEventArgs<TDto>(pk, null, default(TDto), default(TDto), null, null));
            }
            return result;
        }

        #endregion

        #endregion
    }
}


text:
<?php

/**
 * Allows user to patrol pages
 * @ingroup API
 */
class ApiPatrol extends ApiBase {

	public function __construct( $main, $action ) {
		parent::__construct( $main, $action );
	}

	/**
	 * Patrols the article or provides the reason the patrol failed.
	 */
	public function execute() {
		$params = $this->extractRequestParams();

		$rc = RecentChange::newFromID( $params['rcid'] );
		if ( !$rc instanceof RecentChange ) {
			$this->dieUsageMsg( array( 'nosuchrcid', $params['rcid'] ) );
		}
		$retval = $rc->doMarkPatrolled( $this->getUser() );

		if ( $retval ) {
			$this->dieUsageMsg( reset( $retval ) );
		}

		$result = array( 'rcid' => intval( $rc->getAttribute( 'rc_id' ) ) );
		ApiQueryBase::addTitleInfo( $result, $rc->getTitle() );
		$this->getResult()->addValue( null, $this->getModuleName(), $result );
	}

	public function mustBePosted() {
		return true;
	}

	public function isWriteMode() {
		return true;
	}

	public function getAllowedParams() {
		return array(
			'token' => null,
			'rcid' => array(
				ApiBase::PARAM_TYPE => 'integer',
				ApiBase::PARAM_REQUIRED => true
			),
		);
	}

	public function getParamDescription() {
		return array(
			'token' => 'Patrol token obtained from list=recentchanges',
			'rcid' => 'Recentchanges ID to patrol',
		);
	}

	public function getDescription() {
		return 'Patrol a page or revision';
	}

	public function getPossibleErrors() {
		return array_merge( parent::getPossibleErrors(), array(
			array( 'nosuchrcid', 'rcid' ),
		) );
	}

	public function needsToken() {
		return true;
	}

	public function getTokenSalt() {
		return 'patrol';
	}

	public function getExamples() {
		return array(
			'api.php?action=patrol&token=123abc&rcid=230672766'
		);
	}

	public function getHelpUrls() {
		return 'https://www.mediawiki.org/wiki/API:Patrol';
	}

	public function getVersion() {
		return __CLASS__ . ': $Id$';
	}
}

redpajama_set_name: RedPajamaGithub


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/orchestration/airflow/service/v1/environments.proto

package com.google.cloud.orchestration.airflow.service.v1;

public interface EnvironmentOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.orchestration.airflow.service.v1.Environment)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * The resource name of the environment, in the form:
   * "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
   * EnvironmentId must start with a lowercase letter followed by up to 63
   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
   *

   *
   * string name = 1;
   *
   * @return The name.
   */
  java.lang.String getName();
  /**
   *
   *
   *

   * The resource name of the environment, in the form:
   * "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
   * EnvironmentId must start with a lowercase letter followed by up to 63
   * lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
   *

   *
   * string name = 1;
   *
   * @return The bytes for name.
   */
  com.google.protobuf.ByteString getNameBytes();

  /**
   *
   *
   *

   * Configuration parameters for this environment.
   *

   *
   * .google.cloud.orchestration.airflow.service.v1.EnvironmentConfig config = 2;
   *
   * @return Whether the config field is set.
   */
  boolean hasConfig();
  /**
   *
   *
   *

   * Configuration parameters for this environment.
   *

   *
   * .google.cloud.orchestration.airflow.service.v1.EnvironmentConfig config = 2;
   *
   * @return The config.
   */
  com.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig getConfig();
  /**
   *
   *
   *

   * Configuration parameters for this environment.
   *

   *
   * .google.cloud.orchestration.airflow.service.v1.EnvironmentConfig config = 2;
   */
  com.google.cloud.orchestration.airflow.service.v1.EnvironmentConfigOrBuilder getConfigOrBuilder();

  /**
   *
   *
   *

   * Output only. The UUID (Universally Unique IDentifier) associated with this environment.
   * This value is generated when the environment is created.
   *

   *
   * string uuid = 3;
   *
   * @return The uuid.
   */
  java.lang.String getUuid();
  /**
   *
   *
   *

   * Output only. The UUID (Universally Unique IDentifier) associated with this environment.
   * This value is generated when the environment is created.
   *

   *
   * string uuid = 3;
   *
   * @return The bytes for uuid.
   */
  com.google.protobuf.ByteString getUuidBytes();

  /**
   *
   *
   *

   * The current state of the environment.
   *

   *
   * .google.cloud.orchestration.airflow.service.v1.Environment.State state = 4;
   *
   * @return The enum numeric value on the wire for state.
   */
  int getStateValue();
  /**
   *
   *
   *

   * The current state of the environment.
   *

   *
   * .google.cloud.orchestration.airflow.service.v1.Environment.State state = 4;
   *
   * @return The state.
   */
  com.google.cloud.orchestration.airflow.service.v1.Environment.State getState();

  /**
   *
   *
   *

   * Output only. The time at which this environment was created.
   *

   *
   * .google.protobuf.Timestamp create_time = 5;
   *
   * @return Whether the createTime field is set.
   */
  boolean hasCreateTime();
  /**
   *
   *
   *

   * Output only. The time at which this environment was created.
   *

   *
   * .google.protobuf.Timestamp create_time = 5;
   *
   * @return The createTime.
   */
  com.google.protobuf.Timestamp getCreateTime();
  /**
   *
   *
   *

   * Output only. The time at which this environment was created.
   *

   *
   * .google.protobuf.Timestamp create_time = 5;
   */
  com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();

  /**
   *
   *
   *

   * Output only. The time at which this environment was last modified.
   *

   *
   * .google.protobuf.Timestamp update_time = 6;
   *
   * @return Whether the updateTime field is set.
   */
  boolean hasUpdateTime();
  /**
   *
   *
   *

   * Output only. The time at which this environment was last modified.
   *

   *
   * .google.protobuf.Timestamp update_time = 6;
   *
   * @return The updateTime.
   */
  com.google.protobuf.Timestamp getUpdateTime();
  /**
   *
   *
   *

   * Output only. The time at which this environment was last modified.
   *

   *
   * .google.protobuf.Timestamp update_time = 6;
   */
  com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder();

  /**
   *
   *
   *

   * Optional. User-defined labels for this environment.
   * The labels map can contain no more than 64 entries. Entries of the labels
   * map are UTF8 strings that comply with the following restrictions:
   * * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
   * * Values must conform to regexp:  [\p{Ll}\p{Lo}\p{N}_-]{0,63}
   * * Both keys and values are additionally constrained to be <= 128 bytes in
   * size.
   *

   *
   * map<string, string> labels = 7;
   */
  int getLabelsCount();
  /**
   *
   *
   *

   * Optional. User-defined labels for this environment.
   * The labels map can contain no more than 64 entries. Entries of the labels
   * map are UTF8 strings that comply with the following restrictions:
   * * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
   * * Values must conform to regexp:  [\p{Ll}\p{Lo}\p{N}_-]{0,63}
   * * Both keys and values are additionally constrained to be <= 128 bytes in
   * size.
   *

   *
   * map<string, string> labels = 7;
   */
  boolean containsLabels(java.lang.String key);
  /** Use {@link #getLabelsMap()} instead. */
  @java.lang.Deprecated
  java.util.Map<java.lang.String, java.lang.String> getLabels();
  /**
   *
   *
   *

   * Optional. User-defined labels for this environment.
   * The labels map can contain no more than 64 entries. Entries of the labels
   * map are UTF8 strings that comply with the following restrictions:
   * * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
   * * Values must conform to regexp:  [\p{Ll}\p{Lo}\p{N}_-]{0,63}
   * * Both keys and values are additionally constrained to be <= 128 bytes in
   * size.
   *

   *
   * map<string, string> labels = 7;
   */
  java.util.Map<java.lang.String, java.lang.String> getLabelsMap();
  /**
   *
   *
   *

   * Optional. User-defined labels for this environment.
   * The labels map can contain no more than 64 entries. Entries of the labels
   * map are UTF8 strings that comply with the following restrictions:
   * * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
   * * Values must conform to regexp:  [\p{Ll}\p{Lo}\p{N}_-]{0,63}
   * * Both keys and values are additionally constrained to be <= 128 bytes in
   * size.
   *

   *
   * map<string, string> labels = 7;
   */

  /* nullable */
  java.lang.String getLabelsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue);
  /**
   *
   *
   *

   * Optional. User-defined labels for this environment.
   * The labels map can contain no more than 64 entries. Entries of the labels
   * map are UTF8 strings that comply with the following restrictions:
   * * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
   * * Values must conform to regexp:  [\p{Ll}\p{Lo}\p{N}_-]{0,63}
   * * Both keys and values are additionally constrained to be <= 128 bytes in
   * size.
   *

   *
   * map<string, string> labels = 7;
   */
  java.lang.String getLabelsOrThrow(java.lang.String key);
}


text:
namespace ui {

class FakeCursorDelegateEvdev : public CursorDelegateEvdev {
 public:
  FakeCursorDelegateEvdev() {}
  ~FakeCursorDelegateEvdev() override {}

  // CursorDelegateEvdev:
  void MoveCursorTo(gfx::AcceleratedWidget widget,
                    const gfx::PointF& location) override {
    cursor_location_ = location;
  }
  void MoveCursorTo(const gfx::PointF& location) override {
    cursor_location_ = location;
  }
  void MoveCursor(const gfx::Vector2dF& delta) override {
    cursor_location_ = gfx::PointF(delta.x(), delta.y());
  }
  bool IsCursorVisible() override { return 1; }
  gfx::Rect GetCursorConfinedBounds() override {
    NOTIMPLEMENTED();
    return gfx::Rect();
  }
  gfx::PointF GetLocation() override { return cursor_location_; }
  void InitializeOnEvdev() override {}

 private:
  // The location of the mock cursor.
  gfx::PointF cursor_location_;

  DISALLOW_COPY_AND_ASSIGN(FakeCursorDelegateEvdev);
};

}  // namespace ui

#endif  // UI_EVENTS_OZONE_EVDEV_TESTING_FAKE_CURSOR_DELEGATE_EVDEV_H_


text:
package nerd_test

import (
	"context"

	"code.cloudfoundry.org/guardian/rundmc/runcontainerd/nerd"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Nerd Stopper", func() {
	var (
		nerdStopper *nerd.NerdStopper
		stopErr     error
	)

	BeforeEach(func() {
		nerdStopper = nerd.NewNerdStopper(containerdClient)
	})

	JustBeforeEach(func() {
		stopErr = nerdStopper.Stop()
	})

	It("succeeds", func() {
		Expect(stopErr).NotTo(HaveOccurred())
	})

	It("closes the underlying GRPC connection", func() {
		_, err := containerdClient.Containers(context.Background())
		Expect(err).To(MatchError(ContainSubstring("grpc")))
	})

})


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


text:
<?php

namespace RealEstate;

/**
 * Class FinancieleGegevens
 *
 * @package RealEstate
 * @author Jordi Jolink <mail@jordijolink.nl>
 */
class FinancieleGegevens
{
    /**
     * @var ProjectMaten
     */
    public $KoopAanneemsom;

    /**
     * @var ProjectMaten
     */
    public $Huurprijs;
}


text:
package kong.unirest;

/**
 * A summary of a request about to be performed
 */
public interface HttpRequestSummary {
    /**
     * @return The HTTP method of the request
     */
    HttpMethod getHttpMethod();

    /**
     * @return The current full URL string for the request with query params (http://somewhere/else?colour=red)
     */
    String getUrl();

    /**
     * @return The raw un-parameterized path without query strings (http://somewhere/{param})
     */
    String getRawPath();

    /**
     * @return a string summary of the request suitable for logging
     */
    String asString();
}


text:
title: "Matten til monografer: Detaljert spesifikasjon"
linkTitle: "Matten til monografer"
date: 2017-01-06
description: >
 En kort oppsummering av denne siden. Tekst kan **utheves** sller skrives i _kursiv_ og kan ha flere avsnitt.
---

Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://gohugo.io) should be blue with no underlines (unless hovered over).

There should be whitespace between paragraphs. Lorem markdownum tempus auras formasque ore vir crescere est! Malo quod, hunc, est dura; aut haec simillima nec per conantemque iusserat audax moriensque confessasque. Haec vulneret quam libratum homo pede arbore tu manus membrisque iuveni Clymeneia se cepi unda, iustae? Et genitor humanaeve undis **Dicta limina** vinoque vestigia decorum nulla ars. Pectora sede: quoque magnum Persidaque in suos, adiciunt tenebor.

Formidine humo velle vulnera remotis admonitu suo mora vivo ubi. Libidine et mittor Orphei nulla. Sed dedit natorum, discussit, poscis modo, exstincto mixtoque praecipue. Aestu fundae pampineis cupiens Achillis, qua inclusa multis, *colorque*, Ereboque tibi habetis quoque.

> There should be no margin above this first sentence.
>
> Blockquotes should be a lighter gray with a border along the left side in the secondary color.
>
> There should be no margin below this final sentence.

## First Header 2

This is a normal paragraph following a header. Victrix tridentigero corripuere messibus, una rector, me se Iovis. *Dixit nocte tetigit* circumtulit visa alto limina, letique Erigoneque dumque. Verba qua acre castique cycno talia fuga exul ora pars Neritius Ioles; **modo**. Solacia fores servat querno tamen! Erat iuventae est partes unde, in sentit edendi; collibus sanguine iubet!

Deae legum paulatimque terra, non vos mutata tacet: dic. Vocant docuique me plumas fila quin afuerunt copia haec o neque.

On big screens, paragraphs and headings should not take up the full container width, but we want tables, code blocks and similar to take the full width.

Erat vera cur scelus mundo quam? Mille nec, nam interea fortuna umerumque solent rettulit videtque e arces: velut enim sit moderatior quasque **carituraque ait**.

## Second Header 2

> This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.

### Header 3

```
This is a code block following a header.
```

Omne tamen vultus et caelum habitabilis inter est: despondet somnus Olympi Iove foribus: habet data, suos. Suis illi auro verba sibi os Turno. Oris avis mariti callida deficis tangor.

#### Header 4

* This is an unordered list following a header.
* This is an unordered list following a header.
* This is an unordered list following a header.

##### Header 5

1. This is an ordered list following a header.
2. This is an ordered list following a header.
3. This is an ordered list following a header.

###### Header 6

| What      | Follows         |
|-----------|-----------------|
| A table   | A header        |
| A table   | A header        |
| A table   | A header        |

----------------

There's a horizontal rule above and below this.

----------------

Here is an unordered list:

* Liverpool F.C.
* Chelsea F.C.
* Manchester United F.C.

And an ordered list:

1. Michael Brecker
2. Seamus Blake
3. Branford Marsalis

And an unordered task list:

- [x] Create a Hugo theme
- [x] Add task lists to it
- [ ] Take a vacation

And a "mixed" task list:

- [ ] Pack bags
- ?
- [ ] Travel!

And a nested list:

* Jackson 5
  * Michael
  * Tito
  * Jackie
  * Marlon
  * Jermaine
* TMNT
  * Leonardo
  * Michelangelo
  * Donatello
  * Raphael

Definition lists can be used with Markdown syntax. Definition headers are bold.

Name
: Godzilla

Born
: 1952

Birthplace
: Japan

Color
: Green

----------------

Tables should have bold headings and alternating shaded rows.

| Artist            | Album           | Year |
|-------------------|-----------------|------|
| Michael Jackson   | Thriller        | 1982 |
| Prince            | Purple Rain     | 1984 |
| Beastie Boys      | License to Ill  | 1986 |

If a table is too wide, it should scroll horizontally.

| Artist            | Album           | Year | Label       | Awards   | Songs     |
|-------------------|-----------------|------|-------------|----------|-----------|
| Michael Jackson   | Thriller        | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life |
| Prince            | Purple Rain     | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain |
| Beastie Boys      | License to Ill  | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill |

----------------

Code snippets like `var foo = "bar";` can be shown inline.

Also, `this should vertically align` ~~`with this`~~ ~~and this~~.

Code can also be shown in a block element.

```
foo := "bar";
bar := "foo";
```

Code can also use syntax highlighting.

```go
func main() {
  input := `var foo = "bar";`

  lexer := lexers.Get("javascript")
  iterator, _ := lexer.Tokenise(nil, input)
  style := styles.Get("github")
  formatter := html.New(html.WithLineNumbers())

  var buff bytes.Buffer
  formatter.Format(&buff, style, iterator)

  fmt.Println(buff.String())
}
```

```
Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
```

Inline code inside table cells should still be distinguishable.

| Language    | Code               |
|-------------|--------------------|
| Javascript  | `var foo = "bar";` |
| Ruby        | `foo = "bar"{`      |

----------------

Small images should be shown at their actual size.

![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg/240px-Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg)

Large images should always scale down and fit in the content container.

![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg/1024px-Picea_abies_shoot_with_buds%2C_Sogndal%2C_Norway.jpg)

_The photo above of the Spruce Picea abies shoot with foliage buds: Bjørn Erik Pedersen, CC-BY-SA._

## Components

### Alerts

{{< alert >}}This is an alert.{{< /alert >}}
{{< alert title="Note" >}}This is an alert with a title.{{< /alert >}}
{{% alert title="Note" %}}This is an alert with a title and **Markdown**.{{% /alert %}}
{{< alert color="success" >}}This is a successful alert.{{< /alert >}}
{{< alert color="warning" >}}This is a warning.{{< /alert >}}
{{< alert color="warning" title="Warning" >}}This is a warning with a title.{{< /alert >}}

## Another Heading

Add some sections here to see how the ToC looks like. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.

### This Document

Inguina genus: Anaphen post: lingua violente voce suae meus aetate diversi. Orbis unam nec flammaeque status deam Silenum erat et a ferrea. Excitus rigidum ait: vestro et Herculis convicia: nitidae deseruit coniuge Proteaque adiciam *eripitur*? Sitim noceat signa *probat quidem*. Sua longis *fugatis* quidem genae.

### Pixel Count

Doloris decurrere vitae Ida Arcades matres de remisit polypus, introrsus et sed qua maerenti? Serpit meta illic ut sinu. Transformat ungues genitor, et visis ademit sustinet abstulit lampadibus. Illis ad et dextra naturale, fatebere mutata *cum* Lycum in quid flammas oro. Populus Aurora caerula et feremus clavigeri ungues dubitant et inde corpore clamat, qui non Ilioneus pugnat abstuleris undas, habet.

### Contact Info

Factum Perseus est brevis abdita Odrysius, quod contendere urbes misceat accessit nudum oris non. Cumque dentibus nullam nec mille potentia regnumque supplex!

### External Links

Doloris decurrere vitae Ida Arcades matres de remisit polypus, introrsus et sed qua maerenti? Serpit meta illic ut sinu. Transformat ungues genitor, et visis ademit sustinet abstulit lampadibus. Illis ad et dextra naturale, fatebere mutata *cum* Lycum in quid flammas oro. Populus Aurora caerula et feremus clavigeri ungues dubitant et inde corpore clamat, qui non Ilioneus pugnat abstuleris undas, habet.

```
This is the final element on the page and there should be no margin below this.
```


text:
import { Object3D } from './../../core/Object3D';
import { Material } from './../../materials/Material';

// Extras / Objects /////////////////////////////////////////////////////////////////////

export class ImmediateRenderObject extends Object3D {

	constructor( material: Material );

	material: Material;
	render( renderCallback: Function ): void;

}


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

<title>Dynamic (etude 3.0.0-SNAPSHOT API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.github.andrewthehan.etude.theory

Class Dynamic

java.lang.Object

com.github.andrewthehan.etude.theory.Dynamic

public final class Dynamic
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field and Description

static Dynamic
FORTE

static Dynamic
FORTISSIMO

static Dynamic
FORTISSISSIMO

static int
MAXIMUM_VELOCITY

static Dynamic
MEZZO_FORTE

static Dynamic
MEZZO_PIANO

static int
MINIMUM_VELOCITY

static Dynamic
PIANISSIMO

static Dynamic
PIANISSISSIMO

static Dynamic
PIANO

Constructor Summary

Constructors

Constructor and Description

Dynamic(int velocity)

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

Dynamic
crescendo(int amount)

Dynamic
diminuendo(int amount)

boolean
equals(java.lang.Object other)

static Exceptional<Dynamic>
fromString(java.lang.String dynamicString)

int
getVelocity()

int
hashCode()

java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

MINIMUM_VELOCITY

public static final int MINIMUM_VELOCITY

See Also:

Constant Field Values

MAXIMUM_VELOCITY

public static final int MAXIMUM_VELOCITY

See Also:

Constant Field Values

PIANISSISSIMO

public static final Dynamic PIANISSISSIMO

PIANISSIMO

public static final Dynamic PIANISSIMO

PIANO

public static final Dynamic PIANO

MEZZO_PIANO

public static final Dynamic MEZZO_PIANO

MEZZO_FORTE

public static final Dynamic MEZZO_FORTE

FORTE

public static final Dynamic FORTE

FORTISSIMO

public static final Dynamic FORTISSIMO

FORTISSISSIMO

public static final Dynamic FORTISSISSIMO

Constructor Detail

Dynamic

public Dynamic(int velocity)

Method Detail

crescendo

public final Dynamic crescendo(int amount)

diminuendo

public final Dynamic diminuendo(int amount)

fromString

public static final Exceptional<Dynamic> fromString(java.lang.String dynamicString)

toString

public final java.lang.String toString()

Overrides:

toString in class java.lang.Object

hashCode

public final int hashCode()

Overrides:

hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object other)

Overrides:

equals in class java.lang.Object

getVelocity

public final int getVelocity()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
using System;

namespace NetProperty.Serialization
{
    /// <summary>
    /// Used to provide additional information when serializing a field/property,
    /// or when deserializing a property into a field/property.
    /// </summary>
    [Obsolete]
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
    public class PropertyAttribute : Attribute
    {
        /// <summary>
        /// The converter to use when serializing and deserializing.
        /// </summary>
        public PropertyConverter Converter;

        /// <summary>
        /// The property's name when serialized and deserialized.
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// Initializes a new instance of PropertyAttribute with a provided <paramref name="name"/> and
        /// initialize <see cref="Converter"/> to <c>null</c>.
        /// </summary>
        /// <param name="name">The name to use.</param>
        public PropertyAttribute(string name)
        {
            Name = name;
            Converter = null;
        }

        /// <summary>
        /// Initializes a new instance of PropertyAttribute with a provided <paramref name="converter"/> and
        /// initialize <see cref="Name"/> to <c>null</c>.
        /// </summary>
        /// <remarks>
        /// This will use the name of the field/property when serializing and deserializing.
        /// </remarks>
        /// <param name="converter">The converter to use.</param>
        /// <exception cref="ArgumentException">The provided converter is not a PropertyConverter.</exception>
        /// <exception cref="System.Reflection.TargetInvocationException">The constructor in <paramref name="converter"/> throws an exception.</exception>
        /// <exception cref="TypeLoadException"><paramref name="converter" /> is not a valid type. </exception>
        /// <exception cref="NotSupportedException">
        /// <paramref name="converter" /> cannot be a <see cref="T:System.Reflection.Emit.TypeBuilder" />.
        /// -or-
        /// Creation of <see cref="T:System.TypedReference" />, <see cref="T:System.ArgIterator" />, <see cref="T:System.Void" />, and <see cref="T:System.RuntimeArgumentHandle" /> types,
        /// or arrays of those types, is not supported.
        /// -or-
        /// The assembly that contains <paramref name="converter" /> is a dynamic assembly that was created with <see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.Save" />.
        /// </exception>
        /// <exception cref="System.Runtime.InteropServices.COMException"><paramref name="converter" /> is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="converter" /> is null.</exception>
        public PropertyAttribute(Type converter)
        {
            Name = null;

            if (converter == null)
                Converter = null;
            else
            {
                var instance = Activator.CreateInstance(converter);

                if (instance is PropertyConverter pconv)
                    Converter = pconv;
                else
                    throw new ArgumentException("The provided converter is not a PropertyConverter.", nameof(converter));
            }
        }

        /// <summary>
        /// Initializes a new instance of PropertyAttribute with a provided <paramref name="name"/> and a <paramref name="converter"/>.
        /// </summary>
        /// <param name="name">The name to use.</param>
        /// <param name="converter">The converter to use.</param>
        /// <exception cref="ArgumentNullException"><paramref name="converter" /> is null.</exception>
        /// <exception cref="ArgumentException">The provided <paramref name="converter"/> is not a <see cref="PropertyConverter"/>.</exception>
        /// <exception cref="System.Reflection.TargetInvocationException">The constructor in <paramref name="converter"/> throws an exception.</exception>
        /// <exception cref="TypeLoadException"><paramref name="converter" /> is not a valid type. </exception>
        /// <exception cref="NotSupportedException">
        /// <paramref name="converter" /> cannot be a <see cref="T:System.Reflection.Emit.TypeBuilder" />.
        /// -or-
        /// Creation of <see cref="T:System.TypedReference" />, <see cref="T:System.ArgIterator" />, <see cref="T:System.Void" />, and <see cref="T:System.RuntimeArgumentHandle" /> types,
        /// or arrays of those types, is not supported.
        /// -or-
        /// The assembly that contains <paramref name="converter" /> is a dynamic assembly that was created with <see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.Save" />.
        /// </exception>
        /// <exception cref="System.Runtime.InteropServices.COMException"><paramref name="converter" /> is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered.</exception>
        /// <exception cref="InvalidPropertyException">Property names cannot contain \"=\" or \"~\".</exception>
        public PropertyAttribute(string name, Type converter)
        {
            if (name.Contains("=") || name.Contains("~"))
                throw new InvalidPropertyException("Property names cannot contain \"=\" or \"~\" : " + name);

            Name = name;

            if (converter == null)
                Converter = null;
            else
            {
                var instance = Activator.CreateInstance(converter);

                if (instance is PropertyConverter pconv)
                    Converter = pconv;
                else
                    throw new ArgumentException("The provided converter is not a PropertyConverter.", nameof(converter));
            }
        }
    }
}


text:
package org.infinispan.dataplacement.c50.tree;

import org.infinispan.dataplacement.c50.keyfeature.Feature;
import org.infinispan.dataplacement.c50.keyfeature.FeatureValue;
import org.infinispan.dataplacement.c50.tree.node.DecisionTreeNode;

import java.io.Serializable;
import java.util.Map;

/**
 * Represents a decision tree in which you can query based on the values of some attributes and returns the new owner
 *
 * @author Pedro Ruivo
 * @since 5.2
 */
public class DecisionTree implements Serializable {

   private final DecisionTreeNode root;

   public DecisionTree(DecisionTreeNode root) {
      this.root = root;
   }

   /**
    * queries the decision tree looking for the value depending of the features value
    *
    * @param keyFeature the feature values
    * @return the index of the new owner
    */
   public final int query(Map<Feature, FeatureValue> keyFeature) {
      if (root == null) {
         throw new IllegalStateException("Expected to find a root node to start");
      }
      DecisionTreeNode node = root.find(keyFeature);

      if (node == null) {
         return root.getValue();
      }

      DecisionTreeNode result = node;

      while (node != null) {
         result = node;
         node = node.find(keyFeature);
      }

      return result.getValue();
   }

   /**
    * @return the deep of the tree
    */
   public final int getDeep() {
      return root.getDeep();
   }
}


text:
package com.orionplatform.machine_learning.classification.k_nearest_neighbours.error.empirical;

import com.orionplatform.core.abstraction.Orion;
import com.orionplatform.machine_learning.classification.k_nearest_neighbours.KNearestNeighboursRules;
import com.orionplatform.machine_learning.training.set.TrainingSet;

public class KNearestNeighboursEmpiricalErrorRules extends Orion
{
    @SuppressWarnings({"rawtypes", "unchecked"})
    public static synchronized void isValid(TrainingSet trainingSet, int k)
    {
        KNearestNeighboursRules.isValid(trainingSet, k);
    }
}


text:
'use strict';
const common = require('../common');
const assert = require('assert');

const { MessageChannel } = require('worker_threads');

{
  const { port1, port2 } = new MessageChannel();

  const arrayBuffer = new ArrayBuffer(40);
  const typedArray = new Uint32Array(arrayBuffer);
  typedArray[0] = 0x12345678;

  port1.postMessage(typedArray, [ arrayBuffer ]);
  port2.on('message', common.mustCall((received) => {
    assert.strictEqual(received[0], 0x12345678);
    port2.close(common.mustCall());
  }));
}


text:
<?php
namespace Cora\App;

class EventMapping extends \Cora\EventMapping
{
    public function setListeners()
    {
        return [
            'Events\\UserRegistered' => [
                ['Listeners\\ThankYouForRegistering'],
                ['Listeners\\NewRegistrationEmail'],
                [$this->app->listeners->displayGreeting]
            ],
            'Events\\PasswordReset' => [
                [$this->app->listeners->emails->sendPasswordResetToken]
            ]
        ];
    }
}


text:
<?php

namespace ZendTest\Permissions\Rbac\Assertion;

use Zend\Permissions\Rbac;

class CallbackAssertionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Ensures constructor throws InvalidArgumentException if not callable is provided
     */
    public function testConstructorThrowsExceptionIfNotCallable()
    {
        $this->setExpectedException(
            'Zend\Permissions\Rbac\Exception\InvalidArgumentException',
            'Invalid callback provided; not callable'
        );
        new Rbac\Assertion\CallbackAssertion('I am not callable!');
    }

    /**
     * Ensures callback is set in object
     */
    public function testCallbackIsSet()
    {
        $callback   = function () {
        };
        $assert     = new Rbac\Assertion\CallbackAssertion($callback);
        $this->assertAttributeSame($callback, 'callback', $assert);
    }

    /**
     * Ensures assert method provides callback with rbac as argument
     */
    public function testAssertMethodPassRbacToCallback()
    {
        $rbac   = new Rbac\Rbac();
        $that   = $this;
        $assert = new Rbac\Assertion\CallbackAssertion(function ($rbacArg) use ($that, $rbac) {
            $that->assertSame($rbacArg, $rbac);
            return false;
        });
        $foo  = new Rbac\Role('foo');
        $foo->addPermission('can.foo');
        $this->assertFalse($rbac->isGranted($foo, 'can.foo', $assert));
    }

    /**
     * Ensures assert method returns callback's function value
     */
    public function testAssertMethod()
    {
        $rbac = new Rbac\Rbac();
        $foo  = new Rbac\Role('foo');
        $bar  = new Rbac\Role('bar');

        $assertRoleMatch = function ($role) {
            return function ($rbac) use ($role) {
                return $role->getName() == 'foo';
            };
        };

        $roleNoMatch = new Rbac\Assertion\CallbackAssertion($assertRoleMatch($bar));
        $roleMatch   = new Rbac\Assertion\CallbackAssertion($assertRoleMatch($foo));

        $foo->addPermission('can.foo');
        $bar->addPermission('can.bar');

        $rbac->addRole($foo);
        $rbac->addRole($bar);

        $this->assertFalse($rbac->isGranted($bar, 'can.bar', $roleNoMatch));
        $this->assertFalse($rbac->isGranted($bar, 'can.foo', $roleNoMatch));
        $this->assertTrue($rbac->isGranted($foo, 'can.foo', $roleMatch));
    }
}


text:
<link href="<?php echo base_url("assets/css/register.css"); ?>" rel="stylesheet">

            <md-toolbar class="md-primary">

                    INSCRIPTION
                    <img class="pull-right" src="<?php echo base_url("assets/img/logo.png"); ?>" style="height : 40px; margin : 10px;" />

            </md-toolbar>

                <form id="signupForm" name="signupForm" class="form-horizontal" novalidate ng-submit="registerCompany()">

{{message}}

                    <fieldset class="m-5">

                        <legend class="md-title">RENSEIGNEMENTS D'ENTREPRISE</legend>

                                <md-input-container class="md-block col-md-12" flex-gt-sm>
                                    Nom de l'entreprise
                                    <input required name="company_name" ng-model="company.name" />

Vous devez entrer au moins un nom pour l'entreprise

                                </md-input-container>

                                <md-input-container class="md-block col-md-6 col-sm-12">
                                    Site Web
                                    <input name="website" ng-model="company.website" />
                                </md-input-container>

                                <md-input-container class="md-block col-md-6 col-sm-12">
                                    Contact
                                    <input required name="contact" ng-model="company.phone" />

Veillez entrer un numéro de téléphone de contact

                                </md-input-container>

                                <image-upload
                                    caption="Ajouter logo"
                                    on-file-removed="onFileRemoved()"
                                    on-file-selected="imageChanged(file)">
                                </image-upload>

                    </fieldset>

                    <fieldset class="m-5">

                        <legend class="md-title">PERSONNE DE CONTACT</legend>

                                <md-input-container class="md-block col-md-6 col-sm-12" flex-gt-sm>
                                    Prénom
                                    <md-icon class="md-primary">person</md-icon>
                                    <input name="firstname" ng-model="profile.firstname" />
                                </md-input-container>

                                <md-input-container class="md-block col-md-6 col-sm-12" flex-gt-sm>
                                    Nom
                                    <input required name="lastname" ng-model="profile.lastname" />

Vous devez entrer au moins un nom

                                </md-input-container>

                                <md-input-container class="col-12">

                                    <input
                                        vs-google-autocomplete
                                        vs-autocomplete-validator
                                        ng-model="profile.address"

                                        vs-city="profile.city"
                                        vs-state="profile.state"
                                        vs-country="profile.country"
                                        vs-post-code="profile.postcode"
                                        vs-longitude="profile.longitude"
                                        vs-latitude="profile.latitude"
                                        name="address"
                                        >
                                </md-input-container>

                                <md-input-container class="md-block col-md-6 col-sm-12" flex-gt-sm>
                                    Ville
                                    <input required name="city" ng-model="profile.city" />

Vous devez entrer une ville

                                </md-input-container>

                                <md-input-container class="md-block col-md-6 col-sm-12" flex-gt-sm>
                                    Province
                                    <input required name="state" ng-model="profile.state" />

Veillez entrer la province

                                </md-input-container>

                                <md-input-container class="md-block col-md-6 col-sm-12" flex-gt-sm>
                                    Pays
                                    <input required name="country" ng-model="profile.country" />

Vous devez entrer le pays

                                </md-input-container>

                                <md-input-container class="md-block col-md-6 col-sm-12" flex-gt-sm>
                                    Code Postal
                                    <input required name="postcode" ng-model="profile.postcode" />

Veillez entrer votre code postal

                                </md-input-container>

                    </fieldset>

                    <fieldset class="m-5">

                        <legend class="md-title">IDENTIFICATION</legend>

                                <md-input-container class="md-block col-md-12" flex-gt-sm>
                                    Email
                                    <md-icon class="md-primary">email</md-icon>
                                    <input style="border-left: none; border-top: none; border-right: none;" type="email" required name="email" ng-model="account.email" />

Entrez un email valide.

Ce champ est requis.

                                </md-input-container>

                                <md-input-container class="md-block col-md-6" flex-gt-sm>
                                    Mot de passe
                                    <md-icon class="md-primary">lock</md-icon>
                                    <input style="border-left : none; border-right : none;border-top : none;" type="password" required name="password" ng-model="account.password" equals="{{user.confirm_password}}" ng-pattern="/^(?=.*?[0-9])(?=.*?[a-z])(?=.*?[A-Z]).{8,}/" />

Un mot de passe est requis.

Le mot de passe n'est pas assez fort. Le mot de passe doit comporter au moins huit caractères, au moins une lettre majuscule, une lettre minuscule et un chiffre.

Les mots de passe ne correspondent pas.

                                </md-input-container>

                                <md-input-container class="md-block col-md-6" flex-gt-sm>
                                    Confirmer mot de passe
                                    <input style="border-left : none; border-right : none;border-top : none;" type="password" required name="confirm_password" ng-model="confirm_password" equals="{{account.password}}" />

Vous devez confirmer votre mot de passe.

Les mots de passe ne correspondent pas.

                                </md-input-container>

                                <md-input-container class="md-block col-md-12" flex-gt-sm>
                                    Question secrète
                                    <md-select ng-model="account.security_question_id">
                                        <md-option ng-value="$index" ng-repeat="question in securityQuestions">{{ question.name }}</md-option>
                                    </md-select>
                                </md-input-container>

                                <md-input-container class="md-block col-md-12" flex-gt-sm>
                                    Reponse
                                    <input required name="response" ng-model="account.security_question_answer" />

Une réponse de sécurité est nécessaire..

                                </md-input-container>

                    </fieldset>

                            Vous avez deja un compte?
                            <a href="<?php echo site_url("/account/login") ?>" >Se Connecter

                        <a  href  onclick="window.open('<?php echo base_url("/assets/files/terms_and_conditions.pdf")?>', '_blank', 'fullscreen=yes'); return false;">Terme et Condition

                        <md-progress-circular ng-show="creatingAccount"  class="md-hue-2 pull-right" md-diameter="20px" style="margin-top: 12px;"></md-progress-circular>
                        <md-button type="submit" class="md-raised md-primary pull-right" type="submit">
                            &nbsp Créer Entreprise
                        </md-button>

                </form>


text:
package io.reactivesw.common.util.converter;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.reactivesw.common.model.AssetDimensions;

import javax.persistence.AttributeConverter;
import java.io.IOException;

/**
 * Created by Davis on 16/11/23.
 */
public class AssetDimensionsJsonConverter implements AttributeConverter<AssetDimensions, String> {

  private final static ObjectMapper objectMapper = new ObjectMapper();

  @Override
  public String convertToDatabaseColumn(AssetDimensions meta) {
    try {
      return objectMapper.writeValueAsString(meta);
    } catch (Exception ex) {
      return null;
      // or throw an error
    }
  }

  @Override
  public AssetDimensions convertToEntityAttribute(String dbData) {
    try {
      return objectMapper.readValue(dbData, AssetDimensions.class);
    } catch (IOException ex) {
      return null;
    }
  }

}


text:
package vgrechka.phizdetsidea.phizdets.validation;

import com.intellij.lang.annotation.AnnotationHolder;
import com.intellij.psi.util.PsiTreeUtil;
import vgrechka.phizdetsidea.phizdets.PyBundle;
import vgrechka.phizdetsidea.phizdets.psi.*;
import vgrechka.phizdetsidea.phizdets.psi.impl.ParamHelper;

import java.util.HashSet;
import java.util.Set;

/**
 * Annotates errors in 'global' statements.
 */
public class GlobalAnnotator extends PyAnnotator {
  @Override
  public void visitPyGlobalStatement(final PyGlobalStatement node) {
    PyFunction function = PsiTreeUtil.getParentOfType(node, PyFunction.class);
    if (function != null) {
      PyParameterList paramList = function.getParameterList();
      // collect param names
      final Set<String> paramNames = new HashSet<>();

      ParamHelper.walkDownParamArray(
        paramList.getParameters(),
        new ParamHelper.ParamVisitor() {
          @Override
          public void visitNamedParameter(PyNamedParameter param, boolean first, boolean last) {
            paramNames.add(param.getName());
          }
        }
      );

      // check globals
      final AnnotationHolder holder = getHolder();
      for (PyTargetExpression expr : node.getGlobals()) {
        final String expr_name = expr.getReferencedName();
        if (paramNames.contains(expr_name)) {
          holder.createErrorAnnotation(expr.getTextRange(), PyBundle.message("ANN.$0.both.global.and.param", expr_name));
        }
      }
    }
  }
}


text:
<?php

namespace Misd\Highcharts;

use Misd\Highcharts\Exception\InvalidArgumentException;
use Zend\Json\Expr;

interface FormatableInterface
{
    /**
     * Gets the formatter.
     *
     * @return Expr|null Formatter, or `null` if not set.
     */
    public function getFormatter();

    /**
     * Sets the formatter.
     *
     * @param Expr|null $formatter Formatter, or `null` to remove a set value.
     *
     * @return self Reference to the tooltip.
     *
     * @throws InvalidArgumentException If an argument is invalid.
     */
    public function setFormatter($formatter);
}


text:
#import "PBXTSStreamConsuming-Protocol.h"

@protocol PBXTSByteStreamConsuming <PBXTSStreamConsuming>
- (void)stream:(id)arg1 processBytes:(id)arg2;
@end


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>DataStore | @phosphor/datastore</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

					@phosphor/datastore

						Options

								All

Public

Public/Protected

All

							<input type="checkbox" id="tsd-filter-inherited" checked />
							Inherited
							<input type="checkbox" id="tsd-filter-externals" checked />
							Externals

					Menu

					Globals

					DataStore

Class DataStore<S>

A lightweight data store which mostly follows the redux pattern.

Notes

The S type parameter is an interface defining the state shape.

More information on redux can be found at: http://redux.js.org

Type parameters

S

Hierarchy

						DataStore

Index

Constructors

constructor

Properties

_changed

_dispatching

_reducer

_state

Accessors

changed

state

Methods

dispatch

Constructors

constructor

new <wbr>Data<wbr>Store(reducer: Reducer<S>, state: S): DataStore

Defined in datastore.ts:30

Construct a new data store.

Parameters

reducer: Reducer<S>

The root reducer function for the data store.

state: S

The initial state for the data store.

Returns DataStore

Properties

Private _changed

_changed: Signal<this, void> = new Signal<this, void>(this)

Defined in datastore.ts:112

Private _dispatching

_dispatching: boolean = false

Defined in datastore.ts:111

Private _reducer

_reducer: Reducer<S>

Defined in datastore.ts:110

Private _state

_state: S

Defined in datastore.ts:109

Accessors

changed

get changed(): ISignal<this, void>

Defined in datastore.ts:46

A signal emitted when the data store state is changed.

Returns ISignal<this, void>

state

get state(): S

Defined in datastore.ts:58

The current state of the data store.

Notes

The state must be treated as immutable.

The only way to change the state is to dispatch an action.

Returns S

Methods

dispatch

dispatch(action: IAction | IAction[]): void

Defined in datastore.ts:74

Dispatch an action to the data store.

Parameters

action: IAction | IAction[]

The action(s) to dispatch to the store.

Notes

An array of actions will be dispatched atomically.

If an action causes an exception, the state will not be modified.

The changed signal is emitted at most once per dispatch.

Returns void

						Globals

						Action

						Data<wbr>Store

								constructor

								_changed

								_dispatching

								_reducer

								_state

								changed

								state

								dispatch

						IAction

						Reducer

						Reducer<wbr>Map

						combine<wbr>Reducers

Legend

Module

Object literal

Variable

Function

Function with type parameter

Index signature

Type alias

Enumeration

Enumeration member

Property

Method

Interface

Interface with type parameter

Constructor

Property

Method

Index signature

Class

Class with type parameter

Constructor

Property

Method

Accessor

Index signature

Inherited constructor

Inherited property

Inherited method

Inherited accessor

Protected property

Protected method

Protected accessor

Private property

Private method

Private accessor

Static property

Static method

Generated using TypeDoc


text:
package net.tapcat.sample;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author Maksim Zakharov
 * @since 1.0
 */
public class Starter {

    public static void main(String[] args) throws Exception {
        new Starter().doSomethingDangerous();
    }

    private void doSomethingDangerous() throws ExecutionException, InterruptedException {
        final NotThreadSafeService service = new NotThreadSafeService();
        final Runnable r = new RunnableService(service);
        final ExecutorService executor = Executors.newSingleThreadExecutor();

        System.out.println("Going to run @NotThreadSafe service from different threads");
        executor.submit(r).get();
        executor.shutdown();
        r.run();
        System.out.println("Successfully ran @NotThreadSafe service from different threads. Aspect not applied?");
    }

    private static class RunnableService implements Runnable {

        private final NotThreadSafeService service;

        private RunnableService(NotThreadSafeService service) {
            this.service = service;
        }

        @Override
        public void run() {
            service.doSomething();
        }
    }
}


text:
namespace Appccelerate.MappingEventBroker
{
    using Appccelerate.EventBroker;
    using Appccelerate.EventBroker.Internals;

    using Moq;

    using Xunit;

    public class EventTopicCollectionTest
    {
        private readonly EventTopicCollection testee;

        public EventTopicCollectionTest()
        {
            this.testee = new EventTopicCollection();
        }

        [Fact]
        public void ItemsMustBeKeyedAfterUri()
        {
            const string Topic = "Topic";

            var eventTopic = new Mock<IEventTopicInfo>();
            eventTopic.SetupGet(t => t.Uri).Returns(Topic);

            this.testee.Add(eventTopic.Object);

            var result = this.testee[Topic];

            Assert.Same(eventTopic.Object, result);
        }
    }
}


text:
require.ensure([], function(require) {
require("./76.async.js");
require("./152.async.js");
require("./305.async.js");
require("./610.async.js");
});
module.exports = 611;


text:
<?php

require 'std.php';

$dom = new DOMDocument();

$doc->formatOutput = false;
$dom->load($STORE_FILE_NAME);
$root=$dom->documentElement;

$cmd = "";
if(!empty($_GET['cmd']))
        $cmd = $_GET['cmd'];

if($cmd == 'dismiss'){
        $dom->getElementsByTagName('alertIsActive')->item(0)->nodeValue = 'false';
} else if ($cmd == 'enable') {
        $dom->getElementsByTagName('alertIsActive')->item(0)->nodeValue = 'true';
        $dom->getElementsByTagName('alertText')->item(0)->nodeValue = $_GET['msg'];
        $dom->getElementsByTagName('alertSender')->item(0)->nodeValue = $_GET['sender'];
} else if ($cmd == 'setTwitch'){
		$dom->getElementsByTagName('twitchChannel')->item(0)->nodeValue = $_GET['channel'];
} else if ($cmd == 'setBus'){
    $dom->getElementsByTagName('defaultStop')->item(0)->nodeValue = $_GET['stop'];
}

$dom->save($STORE_FILE_NAME);
echo $dom->saveXML();

?>


text:
package generated.zcsclient.admin;

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

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

 * <complexType name="getDistributionListRequest">
 *   <complexContent>
 *     <extension base="{urn:zimbraAdmin}adminAttrsImpl">
 *       <sequence>
 *         <element name="dl" type="{urn:zimbraAdmin}distributionListSelector" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="limit" type="{http://www.w3.org/2001/XMLSchema}int" />
 *       <attribute name="offset" type="{http://www.w3.org/2001/XMLSchema}int" />
 *       <attribute name="sortAscending" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getDistributionListRequest", propOrder = {
    "dl"
})
public class testGetDistributionListRequest
    extends testAdminAttrsImpl
{

    protected testDistributionListSelector dl;
    @XmlAttribute(name = "limit")
    protected Integer limit;
    @XmlAttribute(name = "offset")
    protected Integer offset;
    @XmlAttribute(name = "sortAscending")
    protected Boolean sortAscending;

    /**
     * Gets the value of the dl property.
     *
     * @return
     *     possible object is
     *     {@link testDistributionListSelector }
     *
     */
    public testDistributionListSelector getDl() {
        return dl;
    }

    /**
     * Sets the value of the dl property.
     *
     * @param value
     *     allowed object is
     *     {@link testDistributionListSelector }
     *
     */
    public void setDl(testDistributionListSelector value) {
        this.dl = value;
    }

    /**
     * Gets the value of the limit property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getLimit() {
        return limit;
    }

    /**
     * Sets the value of the limit property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setLimit(Integer value) {
        this.limit = value;
    }

    /**
     * Gets the value of the offset property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getOffset() {
        return offset;
    }

    /**
     * Sets the value of the offset property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setOffset(Integer value) {
        this.offset = value;
    }

    /**
     * Gets the value of the sortAscending property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    public Boolean isSortAscending() {
        return sortAscending;
    }

    /**
     * Sets the value of the sortAscending property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    public void setSortAscending(Boolean value) {
        this.sortAscending = value;
    }

}


text:
package edu.sdsc.vospace;

import java.io.IOException;

import org.apache.commons.httpclient.URIException;
import org.apache.commons.lang3.RandomStringUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.configuration.Configuration;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.util.EntityUtils;
import org.apache.log4j.Logger;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;

import edu.jhu.pha.vospace.DbPoolServlet;
import edu.jhu.pha.vospace.SettingsServlet;
import edu.jhu.pha.vospace.DbPoolServlet.SqlWorker;
import edu.jhu.pha.vospace.api.AccountInfo;
import edu.jhu.pha.vospace.api.exceptions.InternalServerErrorException;
import edu.jhu.pha.vospace.api.exceptions.PermissionDeniedException;
import edu.jhu.pha.vospace.jobs.MyHttpConnectionPoolProvider;
import edu.jhu.pha.vospace.meta.MetaStoreFactory;
import edu.jhu.pha.vospace.meta.Share;
import edu.jhu.pha.vospace.meta.UserGroup;
import edu.jhu.pha.vospace.meta.UserHelper;
import edu.jhu.pha.vospace.node.ContainerNode;
import edu.jhu.pha.vospace.node.Node;
import edu.jhu.pha.vospace.node.NodeFactory;
import edu.jhu.pha.vospace.node.NodePath;
import edu.jhu.pha.vospace.node.NodeType;
import edu.jhu.pha.vospace.node.VospaceId;
import edu.jhu.pha.vospace.oauth.SciDriveUser;
import edu.jhu.pha.vospace.storage.StorageManager;
import edu.jhu.pha.vospace.storage.StorageManagerFactory;

public class UserHelperImpl implements UserHelper {
	private static final Logger logger = Logger.getLogger(UserHelperImpl.class);
	private final static Configuration conf = SettingsServlet.getConfig();

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#getDataStoreCredentials(java.lang.String)
	 */
	@Override
	public HashMap<String, String> getDataStoreCredentials(final String username) {
        return DbPoolServlet.goSql("Retrieving credentials for " + username,
                "select storage_credentials from users where identity = ?;",
                new SqlWorker<HashMap<String, String>>() {
                    @Override
                    public HashMap<String, String> go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, username);
                        ResultSet rs = stmt.executeQuery();
                        if (!rs.next())
                            throw new PermissionDeniedException("The user "+username+" does not exist.");

                        String credentials = rs.getString("storage_credentials");
                        if(credentials == null || credentials.length() == 0)
                        	return new HashMap<String, String>();

                    	ObjectMapper mapper = new ObjectMapper();
                    	try {
                    		HashMap<String, String> result = mapper.readValue(rs.getBytes("storage_credentials"), new HashMap<String, String>().getClass());
	                        return result;
	                    } catch(IOException ex) {
	                    	throw new InternalServerErrorException("Unable to read user "+username+" storage credentials");
	                    }
                    }
                });
	}

	/* (non-Javadoc)
	 * @see edu.jhu.pha.vospace.oauth.UserHelper#getProcessorCredentials(edu.jhu.pha.vospace.oauth.SciDriveUser)
	 */
	@Override
	public JsonNode getProcessorCredentials(final SciDriveUser username) {
        return DbPoolServlet.goSql("Retrieving processor credentials for " + username,
                "select service_credentials from users where identity = ?;",
                new SqlWorker<JsonNode>() {
                    @Override
                    public JsonNode go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, username.getName());
                        ResultSet rs = stmt.executeQuery();
                        if (!rs.next())
                            throw new PermissionDeniedException("The user "+username+" does not exist.");

                    	ObjectMapper mapper = new ObjectMapper();
                    	try {
                    		byte[] credBytes = rs.getBytes("service_credentials");
                    		if(null == credBytes || credBytes.length == 0)
                    			credBytes = "{}".getBytes();
                    		JsonNode allCredentials = mapper.readValue(credBytes, JsonNode.class);
	                        return allCredentials;
	                    } catch(IOException ex) {
	                    	throw new InternalServerErrorException("Unable to read user "+username+" service credentials");
	                    }
                    }
                });
	}

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#setDataStoreCredentials(java.lang.String, java.lang.String)
	 */
	@Override
	public int setDataStoreCredentials(final String username, final String credentials) {
        return DbPoolServlet.goSql("Retrieving credentials for " + username,
                "update users set storage_credentials = ? where identity = ?;",
                new SqlWorker<Integer>() {
                    @Override
                    public Integer go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, credentials);
                        stmt.setString(2, username);
                        int result = stmt.executeUpdate();
                        return result;
                    }
                });
	}

	private static String generateRandomCredentials(final SciDriveUser username) {
		ObjectMapper mapper = new ObjectMapper();
		HashMap<String, String> credentials = new HashMap<String, String>();
		String newUserName = RandomStringUtils.randomAlphanumeric(12);
		String account_name = conf.getString("service.user").split(":")[0];
		credentials.put("username", account_name+":"+newUserName);
		credentials.put("apikey", RandomStringUtils.randomAlphanumeric(12));

		try {
			HttpPut createUserRequest = new HttpPut(conf.getString("keystone.url")+"/"+newUserName);
			createUserRequest.addHeader("X-Auth-Admin-User", conf.getString("service.user"));
			createUserRequest.addHeader("X-Auth-Admin-Key", conf.getString("service.password"));
			createUserRequest.addHeader("X-Auth-User-Key", credentials.get("apikey"));
			createUserRequest.addHeader("X-Auth-User-Admin", "true");
			HttpResponse resp = StorageManagerFactory.getHttpClient().execute(createUserRequest);
			if(resp.getStatusLine().getStatusCode() != 201)
				logger.error("Error creating new user: "+resp.getStatusLine());
			EntityUtils.consume(resp.getEntity());
			return mapper.writeValueAsString(credentials);
		} catch (IOException e) {
			e.printStackTrace();
			return "{}";
		}
	}

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#addDefaultUser(edu.jhu.pha.vospace.oauth.SciDriveUser)
	 */
    @Override
	public synchronized boolean addDefaultUser(final SciDriveUser username) {
		if(DbPoolServlet.goSql("Add new user",
         		"INSERT IGNORE INTO users (identity, storage_credentials)"+
				"values(?, ?);",
                new SqlWorker<Boolean>() {
                    @Override
                    public Boolean go(Connection conn, PreparedStatement stmt) throws SQLException {
                    	stmt.setString(1, username.getName());
                    	stmt.setString(2, generateRandomCredentials(username));
                        return stmt.executeUpdate() > 0;
                    }
                }
        )) {

			try {
				logger.debug("Creating new root node");
				VospaceId identifier = new VospaceId(new NodePath("/"));
				Node node = NodeFactory.createNode(identifier, username, NodeType.CONTAINER_NODE);
				if(!node.isStoredMetadata()){
					node.setNode(null);
					ContainerNode firstNode = (ContainerNode)NodeFactory.createNode(identifier.appendPath(new NodePath("/first_container")), username, NodeType.CONTAINER_NODE);
					firstNode.setNode(null);
				}
				logger.debug("new toor node was created");
			} catch(URIException ex) {
				logger.error("Error creating root node for user: "+ex.getMessage());
				return false;
			}
			return true;
		}
		return false;
	}

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#getAccountInfo(edu.jhu.pha.vospace.oauth.SciDriveUser)
	 */
	@Override
	public AccountInfo getAccountInfo(final SciDriveUser username) {
		AccountInfo info = DbPoolServlet.goSql("Getting user \"" + username.getName() + "\" limits from DB.",
                "select hardlimit, softlimit, bound_identity from users "
				+ "LEFT OUTER JOIN user_bindings ON users.user_id = user_bindings.user_id "
                + "WHERE identity = ?;",
                new SqlWorker<AccountInfo>() {
                    @Override
                    public AccountInfo go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, username.getName());
                        ResultSet rs = stmt.executeQuery();
                        AccountInfo info = new AccountInfo();
                        while (rs.next()){
                            info.setUsername(username.getName());
                            info.setHardLimit(rs.getInt("hardlimit"));
                            info.setSoftLimit(rs.getInt("softlimit"));
                            String boundIdentity = rs.getString("bound_identity");
                            if(null != boundIdentity) {
                            	info.getAliases().add(boundIdentity);
                            }
                        }
                    	return info;
                    }
                }
        );

		StorageManager storage = StorageManagerFactory.getStorageManager(username);
		info.setBytesUsed(storage.getBytesUsed());

		return info;
	}

    /*
     * (non-Javadoc)
     * @see edu.jhu.pha.vospace.meta.UserHelper#userExists(edu.jhu.pha.vospace.oauth.SciDriveUser)
     */
    @Override
	public boolean userExists(final SciDriveUser username) {
        return DbPoolServlet.goSql("Checking whether user \"" + username + "\" exists in DB.",
                "select count(identity) from users where identity = ?;",
                new SqlWorker<Boolean>() {
                    @Override
                    public Boolean go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, username.getName());
                        ResultSet rs = stmt.executeQuery();
                        if (rs.next())
                            return rs.getInt(1) > 0;
                        else
                            throw new IllegalStateException("No result from query.");
                    }
                }
        );
    }

    /*
     * (non-Javadoc)
     * @see edu.jhu.pha.vospace.meta.UserHelper#updateUserService(edu.jhu.pha.vospace.oauth.SciDriveUser, java.lang.String, org.codehaus.jackson.JsonNode)
     */
    @Override
	public boolean updateUserService(final SciDriveUser username, final String processorId, JsonNode updateNode) {
        byte[] curNode = DbPoolServlet.goSql("Retrieving user's service credentials from db",
                "select service_credentials from users where identity = ?;",
                new SqlWorker<byte[]>() {
                    @Override
                    public byte[] go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, username.getName());
                        ResultSet rs = stmt.executeQuery();
                        if (rs.next()) {
                        	byte[] b = rs.getBytes(1);
                        	if(null == b || b.length == 0)
                        		return "{}".getBytes();
                            return b;
                        } else
                            throw new IllegalStateException("No result from query.");
                    }
                }
        );
		ObjectMapper mapper = new ObjectMapper();
    	final JsonNode mainNode;
		try {
			mainNode = mapper.readTree(curNode);
		} catch (Exception e) {
            throw new IllegalStateException("Error parsing user's credentials");
		}

		if(null != updateNode) {
			((org.codehaus.jackson.node.ObjectNode)mainNode).put(processorId, updateNode);
		} else {
			((org.codehaus.jackson.node.ObjectNode)mainNode).remove(processorId);
		}

        return DbPoolServlet.goSql("Updating user's service credentials from db",
            "update users set service_credentials = ? where identity = ?",
            new SqlWorker<Boolean>() {
                @Override
                public Boolean go(Connection conn, PreparedStatement stmt) throws SQLException {
                    stmt.setString(1, mainNode.toString());
                    stmt.setString(2, username.getName());
                    return stmt.execute();
                }
            }
        );

    }

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#getUserServices(edu.jhu.pha.vospace.oauth.SciDriveUser)
	 */
	@Override
	public JsonNode getUserServices(final SciDriveUser username) {
        byte[] curNode = DbPoolServlet.goSql("Retrieving user's service credentials from db",
                "select service_credentials from users where identity = ?;",
                new SqlWorker<byte[]>() {
                    @Override
                    public byte[] go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, username.getName());
                        ResultSet rs = stmt.executeQuery();
                        if (rs.next()) {
                        	byte[] b = rs.getBytes(1);
                        	if(null == b || b.length == 0)
                                return "{}".getBytes();
                            return b;
                        } else
                            throw new IllegalStateException("No result from query.");
                    }
                }
        );

		try {
			ObjectMapper mapper = new ObjectMapper();
			return mapper.readTree(curNode);
		} catch (Exception e) {
            throw new IllegalStateException("Error parsing user's credentials");
		}
	}

    /*
     * (non-Javadoc)
     * @see edu.jhu.pha.vospace.meta.UserHelper#getGroups(edu.jhu.pha.vospace.oauth.SciDriveUser)
     */
    @Override
	public List<UserGroup> getGroups(final SciDriveUser user) {
    	final ArrayList<UserGroup> groups = new ArrayList<UserGroup>();
    	DbPoolServlet.goSql("Get share groups",
        		"select group_id, group_name from groups order by group_name;",
                new SqlWorker<Boolean>() {
                    @Override
                    public Boolean go(Connection conn, PreparedStatement stmt) throws SQLException {
            			ResultSet rs = stmt.executeQuery();
            			while(rs.next()){
            				UserGroup group = new UserGroup();
            				group.setId(rs.getString(1));
            				group.setName(rs.getString(2));
            				groups.add(group);
            			}
            			return true;
                    }
                }
        );
        return groups;
    }

    /*
     * (non-Javadoc)
     * @see edu.jhu.pha.vospace.meta.UserHelper#getGroupUsers(edu.jhu.pha.vospace.oauth.SciDriveUser, java.lang.String)
     */
    @Override
	public List<String> getGroupUsers(final SciDriveUser user, final String groupId) {
    	final ArrayList<String> users = new ArrayList<String>();
    	DbPoolServlet.goSql("Get share group members",
        		"select identity from users JOIN user_groups ON users.user_id = user_groups.user_id WHERE group_id = ? order by identity;",
                new SqlWorker<Boolean>() {
                    @Override
                    public Boolean go(Connection conn, PreparedStatement stmt) throws SQLException {
                    	stmt.setInt(1, Integer.parseInt(groupId));
            			ResultSet rs = stmt.executeQuery();
            			while(rs.next()){
            				users.add(rs.getString(1));
            			}
            			return true;
                    }
                }
    	);
        return users;
    }

    /*
     * (non-Javadoc)
     * @see edu.jhu.pha.vospace.meta.UserHelper#getSharePermission(java.lang.String, java.lang.String)
     */
	@Override
	public Share getSharePermission(final String requestUserId, final String shareId) {
    	return new Share(requestUserId, "", Share.SharePermission.DENIED, null);
	}

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#getUserIdFromBoundId(java.lang.String)
	 */
	@Override
	public String getUserIdFromBoundId(final String boundName) {
        return DbPoolServlet.goSql("Checking bound users table and returning userId",
                "select identity from users JOIN user_bindings ON users.user_id = user_bindings.user_id where bound_identity = ?;",
                new SqlWorker<String>() {
                    @Override
                    public String go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, boundName);
                        ResultSet rs = stmt.executeQuery();
                        if (rs.next())
                            return rs.getString(1);
                        else {
                        	logger.error("Can't find user bind "+boundName);
                            throw new PermissionDeniedException("The user "+boundName+" is not bound.");
                        }
                    }
                }
        );
	}

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#removeUserAlias(java.lang.String, java.lang.String)
	 */
	@Override
	public void removeUserAlias(final String userName, final String alias) {
        DbPoolServlet.goSql("Removing user's alias",
                "delete from user_bindings WHERE bound_identity = ? and user_id = (select user_id from users where identity = ?);",
                new SqlWorker<Boolean>() {
                    @Override
                    public Boolean go(Connection conn, PreparedStatement stmt) throws SQLException {
                        stmt.setString(1, alias);
                        stmt.setString(2, userName);
                        return stmt.execute();
                    }
                }
        );
	}

	/*
	 * (non-Javadoc)
	 * @see edu.jhu.pha.vospace.meta.UserHelper#addUserAlias(java.lang.String, java.lang.String)
	 */
	@Override
	public void addUserAlias(final String username, final String alias) {
		DbPoolServlet.goSql("Add user alias",
				"insert IGNORE into user_bindings (user_id, bound_identity) " +
				"select users.user_id, ? from users WHERE identity = ?",
                new SqlWorker<Boolean>() {
                    @Override
                    public Boolean go(Connection conn, PreparedStatement stmt) throws SQLException {
                    	stmt.setString(1, alias);
                    	stmt.setString(2, username);
                        stmt.executeUpdate();
                        return true;
                    }
		});
    }

}


text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "When recognizing requests" do

  describe "a route with a String path condition" do

    before(:each) do
      prepare do |r|
        r.map "/",         :get, :to => FooApp, :with => { :action => "root" }, :anchor => true
        r.map "/info",     :get, :to => FooApp, :with => { :action => "info" }, :anchor => true
        r.map "/info/bar", :get, :to => FooApp, :with => { :action => "bar" },  :anchor => true
      end
    end

    it "matches the path and return the parameters passed in" do
      route_for("/").should have_route(FooApp, :action => "root")
      route_for("/info").should have_route(FooApp, :action => "info")
      route_for("/info/bar").should have_route(FooApp, :action => "bar")
    end

    it "does not match a different path" do
      route_for("/notinfo").should be_missing
      route_for("/info/bad").should be_missing
    end

    it "ignores trailing slashes" do
      prepare do |r|
        r.map "/info/", :get, :to => FooApp, :with => { :action => "info" }
      end

      route_for("/info").should have_route(FooApp, :action => "info")
    end

    it "ignores repeated slashes" do
      prepare do |r|
        r.map "//info", :get, :to => FooApp, :with => { :action => "info" }
      end

      route_for("/info").should have_route(FooApp, :action => "info")
    end

    it "maps to the correct rack app" do
      prepare do |r|
        r.map "/first",  :get, :to => FirstApp
        r.map "/second", :get, :to => SecondApp
      end

      route_for("/second").should have_route(SecondApp)
    end

  end

  describe "a route with a Request method condition" do

    before(:each) do
      prepare do |r|
        r.map nil, :post, :to => PostingApp, :with => { :action => "posting" }
      end
    end

    it "matches any path with a post method" do
      # route_for("/foo/create/12", :method => "post").should have_route(PostingApp, :action => "posting")
      route_for("", :method => "post").should               have_route(PostingApp, :action => "posting")
    end

    it "does not match any paths that don't have a post method" do
      route_for("/foo/create/12", :method => "get").should be_missing
      route_for("", :method => "get").should be_missing
    end

    it "can use a regular expression to specify OR" do
      prepare do |r|
        r.map nil, /get|post/i, :to => HelloApp, :with => { :action => "index" }
      end

      route_for('/anything', :method => "get").should    have_route(HelloApp, :action => "index")
      route_for('/anything', :method => "post").should   have_route(HelloApp, :action => "index")
      route_for('/anything', :method => "put").should    be_missing
      route_for('/anything', :method => "delete").should be_missing
    end

    it "ignores nil values" do
      prepare do |r|
        r.map "/hello", :method => nil, :to => HelloApp
      end

      [:get, :post, :put, :delete].each do |method|
        route_for("/hello", :method => method).should have_route(HelloApp)
      end
    end

    describe "a route with an arbitrary Request method condition and a path condition" do

      before(:each) do
        prepare do |r|
          r.map "/foo", :to => ProtocolApp, :conditions => { :scheme => "http" }, :with => { :action => "text" }
        end
      end

      it "matches the route if the path and the protocol match" do
        route_for("/foo", :scheme => "http").should have_route(ProtocolApp, :action => "text")
      end

      it "does not match if the route does not match" do
        route_for("/bar", :scheme => "http").should be_missing
      end

      it "does not match if the protocol does not match" do
        route_for("/foo", :scheme => "https").should be_missing
      end

      it "can use regular expressions" do
        prepare do |r|
          r.map "/hello", /get|post/i, :to => HelloApp
        end

        route_for("/hello",   :method => "get").should    have_route(HelloApp)
        route_for("/hello",   :method => "post").should   have_route(HelloApp)
        route_for("/hello",   :method => "put").should    be_missing
        route_for("/hello",   :method => "delete").should be_missing
        route_for("/goodbye", :method => "get").should    be_missing
        route_for("/goodbye", :method => "post").should   be_missing
        route_for("/goodbye", :method => "put").should    be_missing
        route_for("/goodbye", :method => "delete").should be_missing
      end
    end
  end

end


text:
<!DOCTYPE html>

	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>TimePicker</title>


text:
using System;
using System.Windows.Forms;
using QuickBooks_POS_Email_List.Properties;

namespace QuickBooks_POS_Email_List
{
    public partial class DatabasePickForm : Form
    {
        public String Database { get; private set; }
        public DatabasePickForm()
        {
            InitializeComponent();
        }

        private void OpenDatabaseButton_Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog {Filter = Resources.DatabaseFilter};
            if (dialog.ShowDialog() != DialogResult.OK) return;
            Settings.Default.Database = dialog.FileName;
            Settings.Default.Save();
            Database = dialog.FileName;
            DialogResult = DialogResult.OK;
            Close();
        }

        private void NewDatabaseButton_Click(object sender, EventArgs e)
        {
            var dialog = new SaveFileDialog {Filter = Resources.DatabaseFilter};
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Settings.Default.Database = dialog.FileName;
                Settings.Default.Save();
                Database = dialog.FileName;
                DialogResult = DialogResult.OK;
                Close();
            }
        }
    }
}