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

<title>Uses of Class java.time.OffsetDateTime (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

Uses of Class
java.time.OffsetDateTime

Packages that use OffsetDateTime

Package
Description

java.time

 The main API for dates, times, instants, and durations.

Uses of OffsetDateTime in java.time

Fields in java.time declared as OffsetDateTime

Modifier and Type
Field and Description

static OffsetDateTime
OffsetDateTime.MAX

The maximum supported OffsetDateTime, '+999999999-12-31T23:59:59.999999999-18:00'.

static OffsetDateTime
OffsetDateTime.MIN

The minimum supported OffsetDateTime, '-999999999-01-01T00:00:00+18:00'.

Methods in java.time that return OffsetDateTime

Modifier and Type
Method and Description

OffsetDateTime
OffsetTime.atDate(LocalDate date)

Combines this time with a date to create an OffsetDateTime.

OffsetDateTime
Instant.atOffset(ZoneOffset offset)

Combines this instant with an offset to create an OffsetDateTime.

OffsetDateTime
LocalDateTime.atOffset(ZoneOffset offset)

Combines this date-time with an offset to create an OffsetDateTime.

OffsetDateTime
LocalDate.atTime(OffsetTime time)

Combines this date with an offset time to create an OffsetDateTime.

static OffsetDateTime
OffsetDateTime.from(TemporalAccessor temporal)

Obtains an instance of OffsetDateTime from a temporal object.

OffsetDateTime
OffsetDateTime.minus(long amountToSubtract,
     TemporalUnit unit)

Returns a copy of this date-time with the specified amount subtracted.

OffsetDateTime
OffsetDateTime.minus(TemporalAmount amountToSubtract)

Returns a copy of this date-time with the specified amount subtracted.

OffsetDateTime
OffsetDateTime.minusDays(long days)

Returns a copy of this OffsetDateTime with the specified period in days subtracted.

OffsetDateTime
OffsetDateTime.minusHours(long hours)

Returns a copy of this OffsetDateTime with the specified period in hours subtracted.

OffsetDateTime
OffsetDateTime.minusMinutes(long minutes)

Returns a copy of this OffsetDateTime with the specified period in minutes subtracted.

OffsetDateTime
OffsetDateTime.minusMonths(long months)

Returns a copy of this OffsetDateTime with the specified period in months subtracted.

OffsetDateTime
OffsetDateTime.minusNanos(long nanos)

Returns a copy of this OffsetDateTime with the specified period in nanoseconds subtracted.

OffsetDateTime
OffsetDateTime.minusSeconds(long seconds)

Returns a copy of this OffsetDateTime with the specified period in seconds subtracted.

OffsetDateTime
OffsetDateTime.minusWeeks(long weeks)

Returns a copy of this OffsetDateTime with the specified period in weeks subtracted.

OffsetDateTime
OffsetDateTime.minusYears(long years)

Returns a copy of this OffsetDateTime with the specified period in years subtracted.

static OffsetDateTime
OffsetDateTime.now()

Obtains the current date-time from the system clock in the default time-zone.

static OffsetDateTime
OffsetDateTime.now(Clock clock)

Obtains the current date-time from the specified clock.

static OffsetDateTime
OffsetDateTime.now(ZoneId zone)

Obtains the current date-time from the system clock in the specified time-zone.

static OffsetDateTime
OffsetDateTime.of(int year,
  int month,
  int dayOfMonth,
  int hour,
  int minute,
  int second,
  int nanoOfSecond,
  ZoneOffset offset)

Obtains an instance of OffsetDateTime from a year, month, day,
 hour, minute, second, nanosecond and offset.

static OffsetDateTime
OffsetDateTime.of(LocalDate date,
  LocalTime time,
  ZoneOffset offset)

Obtains an instance of OffsetDateTime from a date, time and offset.

static OffsetDateTime
OffsetDateTime.of(LocalDateTime dateTime,
  ZoneOffset offset)

Obtains an instance of OffsetDateTime from a date-time and offset.

static OffsetDateTime
OffsetDateTime.ofInstant(Instant instant,
         ZoneId zone)

Obtains an instance of OffsetDateTime from an Instant and zone ID.

static OffsetDateTime
OffsetDateTime.parse(CharSequence text)

Obtains an instance of OffsetDateTime from a text string
 such as 2007-12-03T10:15:30+01:00.

static OffsetDateTime
OffsetDateTime.parse(CharSequence text,
     DateTimeFormatter formatter)

Obtains an instance of OffsetDateTime from a text string using a specific formatter.

OffsetDateTime
OffsetDateTime.plus(long amountToAdd,
    TemporalUnit unit)

Returns a copy of this date-time with the specified amount added.

OffsetDateTime
OffsetDateTime.plus(TemporalAmount amountToAdd)

Returns a copy of this date-time with the specified amount added.

OffsetDateTime
OffsetDateTime.plusDays(long days)

Returns a copy of this OffsetDateTime with the specified period in days added.

OffsetDateTime
OffsetDateTime.plusHours(long hours)

Returns a copy of this OffsetDateTime with the specified period in hours added.

OffsetDateTime
OffsetDateTime.plusMinutes(long minutes)

Returns a copy of this OffsetDateTime with the specified period in minutes added.

OffsetDateTime
OffsetDateTime.plusMonths(long months)

Returns a copy of this OffsetDateTime with the specified period in months added.

OffsetDateTime
OffsetDateTime.plusNanos(long nanos)

Returns a copy of this OffsetDateTime with the specified period in nanoseconds added.

OffsetDateTime
OffsetDateTime.plusSeconds(long seconds)

Returns a copy of this OffsetDateTime with the specified period in seconds added.

OffsetDateTime
OffsetDateTime.plusWeeks(long weeks)

Returns a copy of this OffsetDateTime with the specified period in weeks added.

OffsetDateTime
OffsetDateTime.plusYears(long years)

Returns a copy of this OffsetDateTime with the specified period in years added.

OffsetDateTime
ZonedDateTime.toOffsetDateTime()

Converts this date-time to an OffsetDateTime.

OffsetDateTime
OffsetDateTime.truncatedTo(TemporalUnit unit)

Returns a copy of this OffsetDateTime with the time truncated.

OffsetDateTime
OffsetDateTime.with(TemporalAdjuster adjuster)

Returns an adjusted copy of this date-time.

OffsetDateTime
OffsetDateTime.with(TemporalField field,
    long newValue)

Returns a copy of this date-time with the specified field set to a new value.

OffsetDateTime
OffsetDateTime.withDayOfMonth(int dayOfMonth)

Returns a copy of this OffsetDateTime with the day-of-month altered.

OffsetDateTime
OffsetDateTime.withDayOfYear(int dayOfYear)

Returns a copy of this OffsetDateTime with the day-of-year altered.

OffsetDateTime
OffsetDateTime.withHour(int hour)

Returns a copy of this OffsetDateTime with the hour-of-day value altered.

OffsetDateTime
OffsetDateTime.withMinute(int minute)

Returns a copy of this OffsetDateTime with the minute-of-hour value altered.

OffsetDateTime
OffsetDateTime.withMonth(int month)

Returns a copy of this OffsetDateTime with the month-of-year altered.

OffsetDateTime
OffsetDateTime.withNano(int nanoOfSecond)

Returns a copy of this OffsetDateTime with the nano-of-second value altered.

OffsetDateTime
OffsetDateTime.withOffsetSameInstant(ZoneOffset offset)

Returns a copy of this OffsetDateTime with the specified offset ensuring
 that the result is at the same instant.

OffsetDateTime
OffsetDateTime.withOffsetSameLocal(ZoneOffset offset)

Returns a copy of this OffsetDateTime with the specified offset ensuring
 that the result has the same local date-time.

OffsetDateTime
OffsetDateTime.withSecond(int second)

Returns a copy of this OffsetDateTime with the second-of-minute value altered.

OffsetDateTime
OffsetDateTime.withYear(int year)

Returns a copy of this OffsetDateTime with the year altered.

Methods in java.time that return types with arguments of type OffsetDateTime

Modifier and Type
Method and Description

static Comparator<OffsetDateTime>
OffsetDateTime.timeLineOrder()

Gets a comparator that compares two OffsetDateTime instances
 based solely on the instant.

Methods in java.time with parameters of type OffsetDateTime

Modifier and Type
Method and Description

int
OffsetDateTime.compareTo(OffsetDateTime other)

Compares this OffsetDateTime to another date-time.

boolean
OffsetDateTime.isAfter(OffsetDateTime other)

Checks if the instant of this date-time is after that of the specified date-time.

boolean
OffsetDateTime.isBefore(OffsetDateTime other)

Checks if the instant of this date-time is before that of the specified date-time.

boolean
OffsetDateTime.isEqual(OffsetDateTime other)

Checks if the instant of this date-time is equal to that of the specified date-time.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
[![dependencies status](https://david-dm.org/LotusTM/grunt-sitemap-xml/status.svg)](https://david-dm.org/LotusTM/grunt-sitemap-xml#info=dependencies)

> Grunt task for generating sitemap.xml

## Getting Started
This plugin requires Grunt `~0.4.5` and Node.js `4.0.0`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-sitemap-xml --save
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-sitemap-xml');
```

## The "sitemap_xml" task

### Overview
In your project's Gruntfile, add a section named `sitemap_xml` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  sitemap_xml: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  }
});
```

### Options

#### options.siteRoot
Type: `String`
Default value: `pkg.homepage`

A string value that is used to define the site root of the URL. Defaults to homepage from package.json.

#### options.stripIndex
Type: `Boolean`
Default value: `true`

A boolean value that is used to determine whether to strip index.html from the URL.

#### options.trailingSlash
Type: `Boolean`
Default value: `true`

Should trailing slash be stripped from the URL.

#### options.lastMod
Type: `String`
Default value: `moment().format('YYYY-MM-DDTHH:mm:ssZ')`

The date of last modification of the file. This date should be in [W3C Datetime](http://www.w3.org/TR/NOTE-datetime) format.

#### options.priority
Type: `String`
Default value: `0.5`

The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0.

#### options.changeFreq
Type: `String`
Default value: `weekly`

How frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page. Valid values are:

 - always
 - hourly
 - daily
 - weekly
 - monthly
 - yearly
 - never

#### options.pretty
Type: `Boolean`
Default value: `false`

A boolean value that is used to determine whether print the results indented with spaces

### Usage Example

```js
grunt.initConfig({
  sitemap_xml: {
    build: {
      files: [
        {
          cwd: 'app/build',
          src: '{,**/}*.html',
          dest: 'app/build/sitemap.xml'
        }
      ]
    }
  }
});
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History
see [CHANGELOG.md](CHANGELOG.md)

redpajama_set_name: RedPajamaGithub


text:
import StringIO
"""
Common library to export either CSV or XLS.
"""
import gc
import logging
import tablib
import openpyxl

from django.http import StreamingHttpResponse
from django.utils.encoding import smart_str
from desktop.lib import i18n

LOG = logging.getLogger(__name__)
MAX_XLS_ROWS = 30000
MAX_XLS_COLS = 5000

def nullify(cell):
  return cell if cell is not None else "NULL"

def format(row, encoding=None):
  return [smart_str(nullify(cell), encoding or i18n.get_site_encoding(), strings_only=True, errors='replace') for cell in row]

def dataset(headers, data, encoding=None):
  """
  dataset(headers, data) -> Dataset object

  Return a dataset object for a csv or excel document.
  """
  dataset = tablib.Dataset()

  if headers:
    dataset.headers = format(headers, encoding)

  for row in data:
    dataset.append(format(row, encoding))

  return dataset

class XlsWrapper():
  def __init__(self, xls):
    self.xls = xls

def xls_dataset(headers, data, encoding=None):
  output = StringIO.StringIO()

  workbook = openpyxl.Workbook(write_only=True)
  worksheet = workbook.create_sheet()

  if headers:
    worksheet.append(format(headers, encoding))

  for row in data:
    worksheet.append(format(row, encoding))

  workbook.save(output)

  output.seek(0)

  return XlsWrapper(output.read())

def create_generator(content_generator, format, encoding=None):
  if format == 'csv':
    show_headers = True
    for headers, data in content_generator:
      yield dataset(show_headers and headers or None, data, encoding).csv
      show_headers = False

  elif format == 'xls':
    headers = None
    data = []
    for _headers, _data in content_generator:
      # Forced limit on size from tablib
      if len(data) > MAX_XLS_ROWS:
        LOG.warn('The query results exceeded the maximum row limit of %d. Data has been truncated.' % MAX_XLS_ROWS)
        break

      if _headers and len(_headers) > MAX_XLS_COLS:
        LOG.warn('The query results exceeded the maximum column limit of %d. Data has been truncated.' % MAX_XLS_COLS)
        _headers = _headers[:MAX_XLS_COLS]

      headers = _headers

      for row in _data:
        if len(row) >= MAX_XLS_COLS:
          row = row[:MAX_XLS_COLS]

        data.append(row)

    if len(data) > MAX_XLS_ROWS:
      LOG.warn('The query results exceeded the maximum row limit of %d. Data has been truncated.' % MAX_XLS_ROWS)
      data = data[:MAX_XLS_ROWS]

    yield xls_dataset(headers, data, encoding).xls
    gc.collect()

def make_response(generator, format, name, encoding=None):
  """
  @param data An iterator of rows, where every row is a list of strings
  @param format Either "csv" or "xls"
  @param name Base name for output file
  @param encoding Unicode encoding for data
  """
  if format == 'csv':
    content_type = 'application/csv'
  elif format == 'xls':
    content_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
    format = 'xlsx'
  elif format == 'json':
    content_type = 'application/json'
  else:
    raise Exception("Unknown format: %s" % format)

  resp = StreamingHttpResponse(generator, content_type=content_type)
  resp['Content-Disposition'] = 'attachment; filename=%s.%s' % (name, format)

  try:
    del resp['Content-Length']
  except KeyError:
    pass

  return resp


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ServiceInjectionModule.cs" company="">
//
// </copyright>
// <summary>
//
// </summary>
// --------------------------------------------------------------------------------------------------------------------

#region License
// PH.APPL -  ServiceInjectionModule.cs
//
// Copyright (c) 2015, Paolo Innocenti - paonath
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
// 3. Neither the name of PH.APPL nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#endregion

using System.Data.Entity;
using System.Globalization;
using System.Linq;

using Autofac;

using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;

using NLog;

using PH.APPL.Model;
using PH.APPL.Services;
using PH.APPL.Services.Contracts;

namespace PH.APPL.AutofacInjection.Modules
{
    /// <summary>
    /// The service injection module.
    /// </summary>
    public class ServiceInjectionModule : Module
    {
        #region Overrides of Module

        /// <summary>
        /// Override to add registrations to the container.
        /// </summary>
        /// <remarks>
        /// Note that the ContainerBuilder parameter is unique to this module.
        /// </remarks>
        /// <param name="builder">
        /// The builder through which components can be
        ///             registered.
        /// </param>
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            var logger = LogManager.GetLogger(typeof(Application).Name, typeof(Application));

            builder.RegisterAssemblyTypes(typeof(Services.commonBase.BaseService).Assembly)
                .AsSelf()
                .AsImplementedInterfaces()
                .InstancePerRequest();

            builder.RegisterAssemblyTypes(typeof(IdentityService).Assembly)
                .AsSelf()
                .AsImplementedInterfaces()
                .InstancePerRequest();

            /*
            builder.Register(c => logger)
                .AsSelf()
                .AsImplementedInterfaces()
                .InstancePerRequest();
            */
            builder.RegisterType<NLogService>()
                .AsImplementedInterfaces()
                .As<ILogService>()
                .OnPreparing(
                    e =>
                    e.Parameters.Union(
                        new[]
                            {
                                new NamedParameter(
                                    "logger",
                                    LogManager.GetLogger(typeof(Application).Name, typeof(Application))),
                                new NamedParameter("formatProvider", CultureInfo.CurrentCulture),
                                new NamedParameter("customFields", null)
                            }))
                .InstancePerRequest();

            // builder.RegisterAssemblyTypes(typeof(NLogService).Assembly).AsSelf()
            // .AsImplementedInterfaces().InstancePerRequest();
            builder.Register(
                c =>
                new IdentityPasswordValidator(c.Resolve<IdentityService>())
                    {
                        RequiredLength = 6,
                        RequireNonLetterOrDigit = true,
                        RequireDigit = true,
                        RequireLowercase = true,
                        RequireUppercase = true,
                        RequireDifferentFromPrevious = true,
                        RequireDoNotContainEmail = true,
                        RequireDoNotContainUsername = true
                    })
                .AsSelf()
                .InstancePerRequest();

            builder.RegisterType<ApplicationUserManager>().As<UserManager<User, string>>().InstancePerRequest();

            builder.RegisterType<ApplicationSignInManager>().As<SignInManager<User, string>>().InstancePerRequest();
        }

        #endregion
    }
}


text:
import { PipeTransform } from 'angular2/src/core/change_detection';
/**
 * Implements uppercase transforms to text.
 *
 * ### Example
 *
 * In this example we transform the user text uppercase.
 *
 *  ```
 * @Component({
 *   selector: "username-cmp",
 *   template: "Username: {{ user | uppercase }}"
 * })
 * class Username {
 *   user:string;
 * }
 *
 * ```
 */
export declare class UpperCasePipe implements PipeTransform {
    transform(value: string, args?: any[]): string;
}


text:
name: clojure.browser.net/xhr-connection
see also:
---

## Summary

## Details

## Examples


text:
Relevance is a smart tab organizer for Chrome, written in ClojureScript.

It'll create a natural arrangement where the tabs you have spent the longest on, which are expected to be the most relevant, are placed first, and the ones you haven't read at all are shunted to the end of your list.

[You can read more about it here](https://numergent.com/relevance/), which includes a changelog.

This is Relevance 1.1.1-SNAPSHOT.

# Building

## Development

To get a development build, run

```
lein chromebuild auto
```

You'll find the result in `target/unpacked/`, which you'll need to install into Chrome using developer mode.

## Release

To get the release version, run

```
lein clean
lein with-profile release chromebuild zip
```

# Testing

Relevance uses `doo` for running ClojureScript tests. I normally use `phantomjs`, but you can use it with the [environment of your choice](https://github.com/bensu/doo#setting-up-environments).

We can't test the entire application externally, since a lot of its API depend on Chrome functions being present (which only happens when you're running as a Chrome extension).  You can however test the general functions running:

```
lein with-profile test doo
```

# Development

## Continuous integration

I'm using [Gitlab CI](https://gitlab.com/ricardojmendez/relevance/pipelines) to test Relevance.

[![build status](https://gitlab.com/Numergent/relevance/badges/develop/build.svg)](https://gitlab.com/Numergent/relevance/commits/develop)

I've had some issues with Travis builds failing to get dependencies, so I decided to deprecate it.

## Process

I'm using [git-flow](http://nvie.com/posts/a-successful-git-branching-model/). Pull requests are welcome. Please base them off the `develop` branch.

## Version number conventions

Relevance uses [break versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md).

The development version on `project.clj` will reflect the current state of the code, and will normally include SNAPSHOT.

I can't update the package version from `manifest.json` to include alphanumerics, so that version will remain as the last public until I'm nearing a release (or need to test a data migration).

# License

Includes pixeden's [iOS 7 vector icons](http://themes-pixeden.com/font-demos/7-stroke/).

Relevance is (c) 2016-2017 Numergent Limited, and released under the [MIT License](https://tldrlegal.com/license/mit-license).


text:
require 'test_helper'

class BuildingTest < ActiveSupport::TestCase
  before do
    @building = buildings(:one)
  end

  it "validates a new building" do
    b = Building.create(name: "name")
    b.valid?.must_equal true
  end

  it "cannot save a building without name" do
    b = Building.create(description: "building")
    b.valid?.must_equal false
  end

  it "cannot save a building with a same name" do
    b = Building.create(name: @building.name)
    b.valid?.must_equal false
  end

end


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>de.papke</groupId>
	<artifactId>health-checker</artifactId>
	<version>1.0.5</version>
	<name>Health Checker</name>

	<properties>
        <!-- project configuration -->
      	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
     	<maven.compiler.source>${java.version}</maven.compiler.source>
     	<maven.compiler.target>${java.version}</maven.compiler.target>

		<!-- dependency versions -->
		<docker-maven-plugin.version>0.26.1</docker-maven-plugin.version>
		<unboundid-ldapsdk.version>2.3.1</unboundid-ldapsdk.version>
		<commons-exec.version>1.1</commons-exec.version>
		<commons-io.version>1.3.2</commons-io.version>
		<commons-lang3.version>3.3.2</commons-lang3.version>
		<commons-cli.version>1.2</commons-cli.version>
		<mongo-java-driver.version>2.12.4</mongo-java-driver.version>
		<jongo.version>1.1</jongo.version>
		<mysql-connector-java.version>5.1.34</mysql-connector-java.version>
		<postgresql.version>9.1-901.jdbc4</postgresql.version>
		<jtds.version>1.3.1</jtds.version>
		<ascii_table.version>1.0</ascii_table.version>
		<elasticsearch.version>0.19.2</elasticsearch.version>
		<solr-solrj.version>1.4.1</solr-solrj.version>
		<slf4j-simple.version>1.5.5</slf4j-simple.version>
		<httpclient.version>4.1.2</httpclient.version>
		<mail-api.version>1.6.2</mail-api.version>

		<!-- docker build configuration -->
		<registry>docker.io</registry>
		<pull.registry>${registry}</pull.registry>
		<push.registry>${registry}</push.registry>
		<tenant>chrisipa</tenant>
		<user>${tenant}</user>
		<group>${tenant}</group>
		<opt.folder>/opt</opt.folder>
		<jdk.version>8</jdk.version>
		<health.checker.folder>${opt.folder}/health-checker</health.checker.folder>
        <health.checker.start.script>${health.checker.folder}/health-checker</health.checker.start.script>
	</properties>

	<build>
		<finalName>${project.artifactId}</finalName>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>de.papke.health.checker.Main</mainClass>
						</manifest>
					</archive>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<appendAssemblyId>false</appendAssemblyId>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
				<version>${docker-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <verbose>true</verbose>
                    <images>
                        <image>
                            <name>${push.registry}/${tenant}/${project.artifactId}</name>
                            <alias>${project.artifactId}</alias>
                            <build>
                                <tags>
                                    <tag>${project.version}</tag>
                                </tags>
                                <from>${pull.registry}/${tenant}/jdk-base:${jdk.version}</from>
								<env>
                                    <PATH>$PATH:${health.checker.folder}</PATH>
                                </env>
                                <optimise>true</optimise>
                                <entryPoint>
                                    <exec>
                                        <args>/${project.artifactId}.sh</args>
                                    </exec>
                                </entryPoint>
                                <runCmds>
                                    <!-- create health-checker folder -->
                                    <run>mkdir -p ${health.checker.folder}</run>

                                    <!-- change permissions -->
                                    <run>chown -R ${user}.${group} ${health.checker.folder}</run>
                                </runCmds>
                                <user>${user}</user>
                                <assembly>
                                    <basedir>/</basedir>
                                    <inline>
                                        <dependencySets>
                                            <dependencySet>
                                                <includes>
                                                    <include>${project.groupId}:${project.artifactId}:${project.packaging}</include>
                                                </includes>
                                                <outputDirectory>${health.checker.folder}</outputDirectory>
												<outputFileNameMapping>${project.artifactId}.${project.packaging}</outputFileNameMapping>
                                            </dependencySet>
                                        </dependencySets>
                                        <fileSets>
                                            <fileSet>
                                                <directory>${project.basedir}/src/main/resources/docker/entrypoint</directory>
                                                <outputDirectory>/</outputDirectory>
                                                <includes>
                                                    <include>**/*</include>
                                                </includes>
                                            </fileSet>
                                            <fileSet>
                                                <directory>${project.basedir}/bin</directory>
                                                <outputDirectory>${health.checker.folder}</outputDirectory>
                                                <includes>
                                                    <include>**/*</include>
                                                </includes>
                                            </fileSet>
                                        </fileSets>
                                    </inline>
                                </assembly>
                            </build>
                        </image>
                    </images>
                </configuration>
            </plugin>
		</plugins>
	</build>

	<profiles>
	   <profile>
	       <id>generate-bom</id>
	       <build>
	           <plugins>
			       <plugin>
		                <groupId>org.cyclonedx</groupId>
		                <artifactId>cyclonedx-maven-plugin</artifactId>
		                <version>2.0.3</version>
		                <executions>
		                    <execution>
		                        <phase>verify</phase>
		                        <goals>
		                            <goal>makeAggregateBom</goal>
		                        </goals>
		                    </execution>
		                </executions>
		                <configuration>
		                    <projectType>library</projectType>
		                    <schemaVersion>1.2</schemaVersion>
		                    <includeBomSerialNumber>true</includeBomSerialNumber>
		                    <includeCompileScope>true</includeCompileScope>
		                    <includeProvidedScope>true</includeProvidedScope>
		                    <includeRuntimeScope>true</includeRuntimeScope>
		                    <includeSystemScope>true</includeSystemScope>
		                    <includeTestScope>false</includeTestScope>
		                    <includeLicenseText>false</includeLicenseText>
		                    <outputFormat>all</outputFormat>
		                </configuration>
		            </plugin>
	            </plugins>
            </build>
	   </profile>
	</profiles>

	<repositories>
		<repository>
			<id>project-local</id>
			<name>project-local</name>
			<url>file:${project.basedir}/repo</url>
        </repository>
	</repositories>

	<dependencies>
		<dependency>
			<groupId>com.unboundid</groupId>
			<artifactId>unboundid-ldapsdk</artifactId>
			<version>${unboundid-ldapsdk.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-exec</artifactId>
			<version>${commons-exec.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons-io.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>${commons-lang3.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-cli</groupId>
			<artifactId>commons-cli</artifactId>
			<version>${commons-cli.version}</version>
		</dependency>
		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>mongo-java-driver</artifactId>
			<version>${mongo-java-driver.version}</version>
		</dependency>
		<dependency>
			<groupId>org.jongo</groupId>
			<artifactId>jongo</artifactId>
			<version>${jongo.version}</version>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>${mysql-connector-java.version}</version>
		</dependency>
		<dependency>
			<groupId>postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>${postgresql.version}</version>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.jtds</groupId>
			<artifactId>jtds</artifactId>
			<version>${jtds.version}</version>
		</dependency>
		<dependency>
			<groupId>com.bethecoder</groupId>
			<artifactId>ascii_table</artifactId>
			<version>${ascii_table.version}</version>
		</dependency>
		<dependency>
			<groupId>org.elasticsearch</groupId>
			<artifactId>elasticsearch</artifactId>
			<version>${elasticsearch.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.solr</groupId>
			<artifactId>solr-solrj</artifactId>
			<version>${solr-solrj.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>${slf4j-simple.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>${httpclient.version}</version>
		</dependency>
		<dependency>
		    <groupId>javax.mail</groupId>
		    <artifactId>javax.mail-api</artifactId>
		    <version>${mail-api.version}</version>
		</dependency>
		<dependency>
    		<groupId>com.sun.mail</groupId>
    		<artifactId>javax.mail</artifactId>
    		<version>${mail-api.version}</version>
		</dependency>
	</dependencies>
</project>


text:
package de.unkrig.notemplate.tools;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.util.StringTokenizer;

import de.unkrig.commons.io.IoUtil;
import de.unkrig.commons.lang.protocol.ConsumerWhichThrows;
import de.unkrig.commons.nullanalysis.Nullable;
import de.unkrig.notemplate.NoTemplate;

/**
 * Generates source code for Java classes (which extend {@link NoTemplate}) from text files.
 * @author Arno
 *
 */
public abstract
class MakeClass {

    /**
     *
Usage:

     *

     *
{@code MakeClass -help}

     *

     *     Print this text.
     *

     *
{@code MakeClass} [ <var>option</var> ] ... <var>text-file</var> ...

     *

     *     Generates one Java compilation unit (".java" file) for each <var>text-file</var>.
     *

     *

     *
     *
Options:

     *
     *

     *
{@code -d} <var>dir</var>

     *

     *     Where to create the compilation units (".java" files). Defaults to "{@code .}".
     *

     *
{@code -package} <var>package-name</var>

     *

     *     The Java package to create the class in. The default is to create the classes in the root package.
     *

     *

     */
    public static void
    main(String[] args) throws IOException {

        int idx = 0;

        File   destination = new File(".");
        String packagE     = null;
        for (; idx < args.length;) {

            String arg = args[idx];
            if (!arg.startsWith("-")) break;

            idx++;

            if ("-help".equals(arg)) {
                IoUtil.copyResource(
                    MakeClass.class,                // clasS
                    "MakeClass.main(String[]).txt", // resourceName
                    System.out,                     // outputStream
                    false                           // closeOutputStream
                );
                return;
            } else
            if ("-d".equals(arg)) {
                destination = new File(args[idx++]);
            } else
            if ("-package".equals(arg)) {
                packagE = args[idx++];
            } else
            {
                System.err.println("Unrecognized command line option \"" + arg + "\"; try \"-help\".");
                System.exit(1);
            }
        }

        for (; idx < args.length; idx++) {

            File textFile = new File(args[idx]);

            String className;
            {
                StringBuilder sb = new StringBuilder();
                for (StringTokenizer st = new StringTokenizer(textFile.getName(), "-."); st.hasMoreTokens();) {
                    String t = st.nextToken();
                    sb.append(Character.toUpperCase(t.charAt(0)));
                    sb.append(t.substring(1).toLowerCase());
                }
                className = sb.toString();
            }

            MakeClass.generate(
                textFile,       // textFile
                new File(       // sourceFile
                    destination,
                    (packagE == null ? className : packagE.replace('.', '/') + '/' + className) + ".java"
                ),
                packagE,        // packagE
                className       // className
            );
        }
    }

    private static void
    generate(File textFile, File sourceFile, @Nullable final String packagE, final String className)
    throws IOException {

        final BufferedReader br = new BufferedReader(
            new InputStreamReader(new FileInputStream(textFile), Charset.forName("UTF-8"))
        );
        try {

            IoUtil.outputFilePrintWriter(
                sourceFile,
                Charset.forName("UTF-8"),
                new ConsumerWhichThrows<PrintWriter, IOException>() {

                    @Override public void
                    consume(PrintWriter pw) throws IOException {
                        pw.println();
                        if (packagE != null) {
                            pw.println("package " + packagE + ";");
                            pw.println();
                        }
                        pw.println("import de.unkrig.notemplate.NoTemplate;");
                        pw.println();
                        pw.println("public");
                        pw.println("class " + className + " extends NoTemplate {");
                        pw.println();
                        pw.println("    public void");
                        pw.println("    render() {");
                        pw.println("        this.l(");
                        for (;;) {
                            String line = br.readLine();
                            if (line == null) break;

                            line = line.replaceAll("\\\\", "\\\\\\\\");
                            line = line.replaceAll("\"", "\\\\\"");

                            pw.print("\"");
                            pw.print(line);
                            pw.println("\",");
                        }
                        pw.println("        );");
                        pw.println("    }");
                        pw.println("}");
                    }
                }
            );

            br.close();
        } finally {
            try { br.close(); } catch (Exception e) {}
        }
    }
}


text:
package main

import (
	"crypto/rsa"
	"errors"
	"fmt"
	"os"
	"os/user"
	"sort"

	"github.com/mrgosti/rosa"
)

type command func() error

var _PrivateKey *rsa.PrivateKey

func generate() error {
	if len(os.Args) < 3 {
		return errors.New("Not enought parameter to generate a key\n Rosae generate usage => rosae generate identity")
	}
	_, _, err := rosa.Generate(os.Args[2], true)
	return err
}

func friends() error {
	var fd []string
	for _, v := range rosa.FriendList {
		fd = append(fd, v.Name)
	}
	sort.Strings(fd)
	for _, v := range fd {
		fmt.Println(v)
	}
	return nil
}

func friend() error {
	if len(os.Args) < 3 {
		return errors.New("Not enought parameter to find a friend\n Rosae friend usage => rosae friend friend_name")
	}
	him := rosa.SeekByName(os.Args[2])
	if him == nil {
		return errors.New("Friend not found")
	}
	fmt.Println(rosa.StringifyPublicKey(him.PublicKey))
	return nil
}

func add() error {
	if len(os.Args) < 4 {
		return errors.New("Not enought parameter to add a friend\n Rosae friend usage => rosae add friend_name encoded_key")
	}
	key, err := rosa.UnStringifyPublicKey(os.Args[3])
	if err != nil {
		return err
	}
	him := &rosa.Friend{os.Args[2], key}
	return him.Register(rosa.FriendListPath)
}

func deleteFriend() error {
	if len(os.Args) < 3 {
		return errors.New("Not enought parameter to delete a friend\n Rosae delete usage => rosae delete friend_name")
	}
	him := rosa.SeekByName(os.Args[2])
	if him == nil {
		return errors.New("Friend not found\n")
	}
	return him.Delete(rosa.FriendListPath)
}

func public() error {
	fmt.Println(rosa.StringifyPublicKey(&_PrivateKey.PublicKey))
	return nil
}

func help() error {
	fmt.Println("Rosae usage :")
	fmt.Println("\trosae generate identity : generate a key pair")
	fmt.Println("\trosae friends : give the name of all your friends")
	fmt.Println("\trosae friend friend_name : give encoded public key of a given friend")
	fmt.Println("\trosae public : give your public key")
	fmt.Println("\trosae add friend_name encoded_key: add a friend to your friends list")
	fmt.Println("\trosae delete friend_name: delete a friend from your friends list")
	fmt.Println("\trosae help : duh.")
	return nil
}

func checkErr(err error) {
	if err != nil {
		fmt.Printf("Rosae error: %v\n", err)
		os.Exit(1)
	}
}

func main() {
	me, err := user.Current()
	checkErr(err)

	rosa.PrivateKeyPath = me.HomeDir + "/.rosa/key.priv"
	rosa.PublicKeyPath = me.HomeDir + "/.rosa/key.pub"
	rosa.FriendListPath = me.HomeDir + "/.rosa/friend_list"

	_PrivateKey, err = rosa.LoadPrivateKey(rosa.PrivateKeyPath)

	err = rosa.LoadFriends(rosa.FriendListPath)

	var cmdList map[string]command

	cmdList = make(map[string]command)

	cmdList["friends"] = friends
	cmdList["friend"] = friend
	cmdList["add"] = add
	cmdList["delete"] = deleteFriend
	cmdList["generate"] = generate
	cmdList["public"] = public
	cmdList["help"] = help

	if len(os.Args) < 2 || cmdList[os.Args[1]] == nil {
		checkErr(cmdList["help"]())
		os.Exit(0)
	}

	checkErr(cmdList[os.Args[1]]())
}


text:
<?php

namespace Ongoing;

class ArticleStructureType
{
    const __default = 'StructureArticle';
    const StructureArticle = 'StructureArticle';
    const ProductionArticle = 'ProductionArticle';

}


text:
FactoryGirl.define do
  factory :post do
    category
    site { category.site }
    user
    title "Title"
    content "Content"
  end

end


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

class FChatChromeViewModel
	: public TSharedFromThis<FChatChromeViewModel>
{
public:

	virtual void AddTab(const TSharedRef<class IChatTabViewModel>& Tab) = 0;
	virtual void ActivateTab(const TSharedRef<class IChatTabViewModel>& Tab) = 0;
	virtual TSharedPtr<class IChatTabViewModel> GetActiveTab() const = 0;
	virtual TArray<TSharedRef<IChatTabViewModel>>& GetVisibleTabs() = 0;
	virtual TArray<TSharedRef<IChatTabViewModel>>& GetAllTabs() = 0;
	virtual bool IsFading() const = 0;
	virtual bool IsActive() const = 0;
	virtual EVisibility GetHeaderVisibility() const = 0;
	virtual TSharedPtr<class FChatSettingsViewModel> GetChatSettingsViewModel() = 0;

	virtual ~FChatChromeViewModel() {}

	DECLARE_EVENT(FChatChromeViewModel, FActiveTabChangedEvent)
	virtual FActiveTabChangedEvent& OnActiveTabChanged() = 0;

	DECLARE_EVENT(FChatChromeViewModel, FVisibleTabsChangedEvent)
	virtual FVisibleTabsChangedEvent& OnVisibleTabsChanged() = 0;

	DECLARE_EVENT(FChatChromeViewModel, FOnOpenSettingsEvent)
	virtual FOnOpenSettingsEvent& OnOpenSettings() = 0;
};

/**
 * Creates the implementation for an ChatChromeViewModel.
 *
 * @return the newly created ChatChromeViewModel implementation.
 */
FACTORY(TSharedRef< FChatChromeViewModel >, FChatChromeViewModel,
	const TSharedRef<class FFriendsNavigationService>& NavigationService,
	const TSharedRef<class IChatDisplayService> & ChatDisplayService,
	const TSharedRef<class IChatSettingsService>& ChatSettingsService);


text:
{#  Copyright 2017 Cargill Incorporated

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License. #}

-- Create a Parquet table in Impala
set sync_ddl=1;
USE `{{ conf.staging_database.name }}`;
CREATE EXTERNAL TABLE IF NOT EXISTS `{{ table.destination.name }}` (
{%- for column in table.columns %}
`{{ cleanse_column(column.name) }}` {{ map_datatypes_v2(column, 'parquet') }} COMMENT "{{ column.comment }}" {%- if not loop.last -%}, {% endif %}
{%- endfor %})
COMMENT '{{ table.comment }}'
STORED AS PARQUET
LOCATION '{{ conf.staging_database.path }}/{{ table.destination.name }}/'
{%- if table.metadata %}
TBLPROPERTIES(
  {%- for key, value in table.metadata.items() %}
  '{{ key }}' = '{{ value }}'{%- if not loop.last -%}, {% endif %}
  {%- endfor %}
)
{%- endif %}


text:
/* The original from which this derives bore the following: */

/*

   Derby - Class org.apache.derby.impl.sql.compile.ConstantNode

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to you under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

 */

package com.akiban.sql.parser;

import com.akiban.sql.StandardException;
import com.akiban.sql.types.TypeId;

/**
 * ConstantNode holds literal constants as well as nulls.
 *

 * A NULL from the parser may not yet know its type; that
 * must be set during binding, as it is for parameters.
 *

 * the DataValueDescriptor methods want to throw exceptions
 * when they are of the wrong type, but to do that they
 * must check typeId when the value is null, rather than
 * the instanceof check they do for returning a valid value.
 *

 * For code generation, we generate a static field.  Then we set the
 * field be the proper constant expression (something like
 * getDatavalueFactory().getCharDataValue("hello", ...)) )
 * in the constructor of the generated method.  Ideally
 * we would have just
 */
public abstract class ConstantNode extends ValueNode
{
    Object value;

    /**
     * Initializer for non-numeric types
     *
     * @param typeId The Type ID of the datatype
     * @param nullable True means the constant is nullable
     * @param maximumWidth The maximum number of bytes in the data value
     *
     * @exception StandardException
     */
    public void init(Object typeId,
                     Object nullable,
                     Object maximumWidth)
            throws StandardException {
        setType((TypeId)typeId,
                ((Boolean)nullable).booleanValue(),
                ((Integer)maximumWidth).intValue());
    }

    /**
     * Fill this node with a deep copy of the given node.
     */
    public void copyFrom(QueryTreeNode node) throws StandardException {
        super.copyFrom(node);

        ConstantNode other = (ConstantNode)node;
        this.value = other.value;       // Assumed to be immutable.
    }

    /**
     * Get the value in this ConstantNode
     */
    public Object getValue() {
        return value;
    }

    /**
     * Set the value in this ConstantNode.
     */
    public void setValue(Object value) {
        this.value = value;
    }

    /**
     * Convert this object to a String.  See comments in QueryTreeNode.java
     * for how this should be done for tree printing.
     *
     * @return This object as a String
     */

    public String toString() {
        return "value: " + value + "\n" +
            super.toString();
    }

    /**
     * Return whether or not this expression tree represents a constant expression.
     *
     * @return Whether or not this expression tree represents a constant expression.
     */
    public boolean isConstantExpression() {
        return true;
    }

    /**
     * Return whether or not this node represents a typed null constant.
     *
     */
    boolean isNull() {
        return (value == null);
    }

    protected boolean isEquivalent(ValueNode o) throws StandardException {
        if (isSameNodeType(o)) {
            ConstantNode other = (ConstantNode)o;

            // value can be null which represents a SQL NULL value.
            return ((other.getValue() == null && getValue() == null) ||
                    (other.getValue() != null && other.getValue().equals(getValue())));
        }
        return false;
    }
}


text:
USE aspnet_identity_test;

-- Drop tables
DROP TABLE IF EXISTS
UserLogin,
UserRole,
UserClaim,
Role,
`User`;

-- Create tables
CREATE TABLE Role
(
	Id INT(10) NOT NULL AUTO_INCREMENT,
	Name VARCHAR (64) NOT NULL,
	UNIQUE INDEX (Name),
	PRIMARY KEY (Id)
);

CREATE TABLE `User`
(
	Id INT(10) NOT NULL AUTO_INCREMENT,
	UserName VARCHAR (64) NOT NULL,
	SecurityStamp VARCHAR (255) NULL,
	PasswordHash VARCHAR (255) NULL,
	Email VARCHAR (64) NULL,
	EmailConfirmed TINYINT(1) NOT NULL DEFAULT 0,
	PhoneNumber VARCHAR (16) NULL,
	PhoneNumberConfirmed TINYINT(1) NOT NULL DEFAULT 0,
	TwoFactorEnabled TINYINT(1) NOT NULL DEFAULT 0,
	LockoutEnabled TINYINT(1) NOT NULL DEFAULT 0,
	LockoutEndDateUtc DATETIME NULL,
	AccessFailedCount INT(10) NOT NULL DEFAULT 0,
	UNIQUE INDEX (UserName),
	PRIMARY KEY (Id)
);

CREATE TABLE UserLogin
(
	LoginProvider VARCHAR (128) NOT NULL,
	ProviderKey VARCHAR (128) NOT NULL,
	UserId INT(10) NOT NULL,
	FOREIGN KEY (UserId) REFERENCES `User` (Id),
	PRIMARY KEY (LoginProvider, ProviderKey, UserId)
);

CREATE TABLE UserRole
(
	UserId INT(10) NOT NULL,
	RoleId INT(10) NOT NULL,
	FOREIGN KEY (UserId) REFERENCES `User` (Id),
	FOREIGN KEY (RoleId) REFERENCES Role (Id),
	PRIMARY KEY (UserId, RoleId)
);

CREATE TABLE UserClaim
(
	Id INT(10) NOT NULL AUTO_INCREMENT,
	UserId INT(10) NOT NULL,
	ClaimType VARCHAR (255) NULL,
	ClaimValue VARCHAR (255) NULL,
	FOREIGN KEY (UserId) REFERENCES `User` (Id),
	PRIMARY KEY (Id)
);

-- Initial data
INSERT INTO Role (Name) VALUES ('System Administrator');
INSERT INTO Role (Name) VALUES ('Application Admin');
INSERT INTO Role (Name) VALUES ('General User');
INSERT INTO Role (Name) VALUES ('Report User');
INSERT INTO Role (Name) VALUES ('Test User');

INSERT INTO `User` (UserName, PasswordHash, Email, EmailConfirmed, PhoneNumber, PhoneNumberConfirmed, AccessFailedCount, LockoutEnabled, LockoutEndDateUtc, SecurityStamp)
			VALUES ('john_doe', '10b8b801768fc884a43f5f319313dd8e', 'john_doe@exmaple.com', 1, '+12142521234', 1, 2, 1, '2016-04-20 00:00', 'fake_security_stamp');
INSERT INTO `User` (UserName) VALUES ('james_blonde');
INSERT INTO `User` (UserName) VALUES ('hannibal_lecter');

INSERT INTO UserLogin (LoginProvider, ProviderKey, UserId) VALUES ('Microsoft', 'A516261B-0AE5-4D7F-926F-910C1A2BE51A', 1);
INSERT INTO UserLogin (LoginProvider, ProviderKey, UserId) VALUES ('Github', '7584027F-D8EA-4EFB-9852-0B447B98C752', 1);
INSERT INTO UserLogin (LoginProvider, ProviderKey, UserId) VALUES ('Yahoo', '341113DF-9091-4750-A2DD-9A1B56A8FCDC', 1);
INSERT INTO UserClaim (UserId, ClaimType, ClaimValue) VALUES (1, 'Edit Log', 'Yes');
INSERT INTO UserClaim (UserId, ClaimType, ClaimValue) VALUES (1, 'Full Edit', 'Yes');
INSERT INTO UserClaim (UserId, ClaimType, ClaimValue) VALUES (1, 'Delete All', 'Yes');
INSERT INTO UserRole (UserId, RoleId) VALUES (1, 1);
INSERT INTO UserRole (UserId, RoleId) VALUES (1, 2);
INSERT INTO UserRole (UserId, RoleId) VALUES (1, 3);


text:
layout: page
title: Montgomery Productions Dinner
date: 2016-05-24
author: George Key
tags: weekly links, java
status: published
summary: Fusce posuere commodo magna. Donec eu volutpat.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 07/12/2017
  endDate: 07/17/2017
  ctyhocn: APFBSHX
  groupCode: MPD
published: true
---
Nulla tincidunt sit amet risus id volutpat. Ut at mi nec lectus maximus eleifend vel eu libero. Vivamus quis augue bibendum, facilisis nisl eu, faucibus massa. In tincidunt sem eget nibh pulvinar sagittis. Maecenas lacinia lectus sit amet euismod egestas. Nunc sit amet placerat tellus. Vivamus suscipit cursus lectus, a euismod nibh rhoncus gravida. Maecenas porttitor interdum quam vitae lobortis.

* Nullam scelerisque dolor quis magna condimentum, a bibendum mauris hendrerit
* Aliquam euismod augue vitae odio fermentum placerat
* Vestibulum faucibus enim a viverra faucibus.

Etiam vulputate finibus egestas. Morbi dictum lacus quis diam eleifend, vel tincidunt tortor condimentum. Fusce mattis lorem leo, non porta elit molestie vel. Mauris sed urna id neque faucibus feugiat. Praesent viverra feugiat eleifend. Phasellus pharetra magna at enim feugiat pellentesque. Sed sit amet lacinia nibh. Praesent lacus lacus, iaculis sed commodo sit amet, malesuada non lectus. Etiam tempus nibh id est volutpat ultricies. In at felis tempus, iaculis nulla ut, accumsan neque.
Maecenas tristique a mi vitae molestie. Duis in tortor et turpis luctus auctor. Cras in eros tincidunt, auctor libero ut, cursus nisi. Sed mattis lacus egestas nulla aliquet, nec fringilla nunc accumsan. Cras condimentum, turpis id cursus maximus, neque nisl pharetra lectus, sed laoreet nulla magna sit amet neque. Praesent euismod nisi sed sem iaculis sodales. Praesent mattis in elit eget commodo. In vitae sagittis felis. Pellentesque sollicitudin lectus et neque convallis volutpat id ut ante. Cras volutpat, tellus sed ultricies consectetur, quam ex consequat massa, id aliquam velit ex vitae libero. Curabitur rutrum purus diam, et maximus nisi laoreet id. Cras efficitur id metus at convallis. Mauris sit amet nulla sit amet arcu luctus pulvinar. Etiam sagittis auctor arcu sit amet auctor.


text:
import angular from 'angular';

import TodoResource from './todo.resource';
import configureResource from './resource.config';

const moduleName = 'todoManager.common.resource';
const dependencies = [];

export default angular.module(moduleName, dependencies)
  .service('TodoResource', TodoResource.serviceFactory)
  .run(configureResource);


text:
// Copyright 2016 by Sandro Santilli <strk@kbt.io>
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.

// Implements support for federated avatars lookup.
// See https://wiki.libravatar.org/api/

package libravatar

import (
	"crypto/md5"
	"crypto/sha256"
	"fmt"
	"math/rand"
	"net"
	"net/mail"
	"net/url"
	"strings"
	"time"
)

// Default images (to be used as defaultURL)
const (
	// Do not load any image if none is associated with the email
	// hash, instead return an HTTP 404 (File Not Found) response
	HTTP404 = "404"
	// (mystery-man) a simple, cartoon-style silhouetted outline of
	// a person (does not vary by email hash)
	MysteryMan = "mm"
	// a geometric pattern based on an email hash
	IdentIcon = "identicon"
	// a generated 'monster' with different colors, faces, etc
	MonsterID = "monsterid"
	// generated faces with differing features and backgrounds
	Wavatar = "wavatar"
	// awesome generated, 8-bit arcade-style pixelated faces
	Retro = "retro"
)

var (
	// Default object, enabling object-less function calls
	DefaultLibravatar = New()
)

/* This should be moved in its own file */
type cacheKey struct {
	service string
	domain  string
}

type cacheValue struct {
	target    string
	checkedAt time.Time
}

type Libravatar struct {
	defUrl             string // default url
	picSize            int    // picture size
	fallbackHost       string // default fallback URL
	secureFallbackHost string // default fallback URL for secure connections
	useHTTPS           bool
	nameCache          map[cacheKey]cacheValue
	nameCacheDuration  time.Duration
	minSize            uint   // smallest image dimension allowed
	maxSize            uint   // largest image dimension allowed
	size               uint   // what dimension should be used
	serviceBase        string // SRV record to be queried for federation
	secureServiceBase  string // SRV record to be queried for federation with secure servers
}

// Instanciate a library handle
func New() *Libravatar {
	// According to https://wiki.libravatar.org/running_your_own/
	// the time-to-live (cache expiry) should be set to at least 1 day.
	return &Libravatar{
		fallbackHost:       `cdn.libravatar.org`,
		secureFallbackHost: `seccdn.libravatar.org`,
		minSize:            1,
		maxSize:            512,
		size:               0, // unset, defaults to 80
		serviceBase:        `avatars`,
		secureServiceBase:  `avatars-sec`,
		nameCache:          make(map[cacheKey]cacheValue),
		nameCacheDuration:  24 * time.Hour,
	}
}

// Set the hostname for fallbacks in case no avatar service is defined
// for a domain
func (v *Libravatar) SetFallbackHost(host string) {
	v.fallbackHost = host
}

// Set the hostname for fallbacks in case no avatar service is defined
// for a domain, when requiring secure domains
func (v *Libravatar) SetSecureFallbackHost(host string) {
	v.secureFallbackHost = host
}

// Set useHTTPS flag
func (v *Libravatar) SetUseHTTPS(use bool) {
	v.useHTTPS = use
}

// Set Avatars image dimension (0 for default)
func (v *Libravatar) SetAvatarSize(size uint) {
	v.size = size
}

// generate hash, either with email address or OpenID
func (v *Libravatar) genHash(email *mail.Address, openid *url.URL) string {
	if email != nil {
		email.Address = strings.ToLower(strings.TrimSpace(email.Address))
		sum := md5.Sum([]byte(email.Address))
		return fmt.Sprintf("%x", sum)
	} else if openid != nil {
		openid.Scheme = strings.ToLower(openid.Scheme)
		openid.Host = strings.ToLower(openid.Host)
		sum := sha256.Sum256([]byte(openid.String()))
		return fmt.Sprintf("%x", sum)
	}
	// panic, because this should not be reachable
	panic("Neither Email or OpenID set")
}

// Gets domain out of email or openid (for openid to be parsed, email has to be nil)
func (v *Libravatar) getDomain(email *mail.Address, openid *url.URL) string {
	if email != nil {
		u, err := url.Parse("//" + email.Address)
		if err != nil {
			if v.useHTTPS && v.secureFallbackHost != "" {
				return v.secureFallbackHost
			}
			return v.fallbackHost
		}
		return u.Host
	} else if openid != nil {
		return openid.Host
	}
	// panic, because this should not be reachable
	panic("Neither Email or OpenID set")
}

// Processes email or openid (for openid to be processed, email has to be nil)
func (v *Libravatar) process(email *mail.Address, openid *url.URL) (string, error) {
	URL, err := v.baseURL(email, openid)
	if err != nil {
		return "", err
	}
	res := fmt.Sprintf("%s/avatar/%s", URL, v.genHash(email, openid))

	values := make(url.Values)
	if v.defUrl != "" {
		values.Add("d", v.defUrl)
	}
	if v.size > 0 {
		values.Add("s", fmt.Sprintf("%d", v.size))
	}

	if len(values) > 0 {
		return fmt.Sprintf("%s?%s", res, values.Encode()), nil
	}
	return res, nil
}

// Finds or defaults a URL for Federation (for openid to be used, email has to be nil)
func (v *Libravatar) baseURL(email *mail.Address, openid *url.URL) (string, error) {
	var service, protocol, domain string

	if v.useHTTPS {
		protocol = "https://"
		service = v.secureServiceBase
		domain = v.secureFallbackHost

	} else {
		protocol = "http://"
		service = v.serviceBase
		domain = v.fallbackHost
	}

	host := v.getDomain(email, openid)
	key := cacheKey{service, host}
	now := time.Now()
	val, found := v.nameCache[key]
	if found && now.Sub(val.checkedAt) <= v.nameCacheDuration {
		return protocol + val.target, nil
	}

	_, addrs, err := net.LookupSRV(service, "tcp", host)
	if err != nil && err.(*net.DNSError).IsTimeout {
		return "", err
	}

	if len(addrs) == 1 {
		// select only record, if only one is available
		domain = strings.TrimSuffix(addrs[0].Target, ".")
	} else if len(addrs) > 1 {
		// Select first record according to RFC2782 weight
		// ordering algorithm (page 3)

		type record struct {
			srv    *net.SRV
			weight uint16
		}

		var (
			total_weight uint16
			records      []record
			top_priority = addrs[0].Priority
			top_record   *net.SRV
		)

		for _, rr := range addrs {
			if rr.Priority > top_priority {
				continue
			} else if rr.Priority < top_priority {
				// won't happen, because net sorts
				// by priority, but just in case
				total_weight = 0
				records = nil
				top_priority = rr.Priority
			}

			total_weight += rr.Weight

			if rr.Weight > 0 {
				records = append(records, record{rr, total_weight})
			} else if rr.Weight == 0 {
				records = append([]record{record{srv: rr, weight: total_weight}}, records...)
			}
		}

		if len(records) == 1 {
			top_record = records[0].srv
		} else {
			randnum := uint16(rand.Intn(int(total_weight)))

			for _, rr := range records {
				if rr.weight >= randnum {
					top_record = rr.srv
					break
				}
			}
		}

		domain = fmt.Sprintf("%s:%d", top_record.Target, top_record.Port)
	}

	v.nameCache[key] = cacheValue{checkedAt: now, target: domain}
	return protocol + domain, nil
}

// Return url of the avatar for the given email
func (v *Libravatar) FromEmail(email string) (string, error) {
	addr, err := mail.ParseAddress(email)
	if err != nil {
		return "", err
	}

	link, err := v.process(addr, nil)
	if err != nil {
		return "", err
	}

	return link, nil
}

// Object-less call to DefaultLibravatar for an email adders
func FromEmail(email string) (string, error) {
	return DefaultLibravatar.FromEmail(email)
}

// Return url of the avatar for the given url (typically for OpenID)
func (v *Libravatar) FromURL(openid string) (string, error) {
	ourl, err := url.Parse(openid)
	if err != nil {
		return "", err
	}

	if !ourl.IsAbs() {
		return "", fmt.Errorf("Is not an absolute URL")
	} else if ourl.Scheme != "http" && ourl.Scheme != "https" {
		return "", fmt.Errorf("Invalid protocol: %s", ourl.Scheme)
	}

	link, err := v.process(nil, ourl)
	if err != nil {
		return "", err
	}

	return link, nil
}

// Object-less call to DefaultLibravatar for a URL
func FromURL(openid string) (string, error) {
	return DefaultLibravatar.FromURL(openid)
}


text:
using System;

namespace Alluvial.Tests.BankDomain
{
    public class FundsDeposited : IDomainEvent
    {
        public decimal Amount { get; set; }
        public string AggregateId { get; set; }
        public int StreamRevision { get; set; }
        public string CheckpointToken { get; set; }
    }
}


text:
Baltimore Neighborhood Vital Signs

  <button class="controls-trigger"
    ng-click="toggleControls();"
    ng-show="!controlsActive">
    Choose Indicators
  </button>

© 2014 Anand Thakker (@anandthakker) and Bryan Connor (@bryanconnor)

Fork this project on github.

    Data from
      BNIA.

    Built with

 d3js

 AngularJS

 ♥


text:
"""Offer sun based automation rules."""
from datetime import timedelta

import voluptuous as vol

from homeassistant.const import (
    CONF_EVENT,
    CONF_OFFSET,
    CONF_PLATFORM,
    SUN_EVENT_SUNRISE,
)
from homeassistant.core import HassJob, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_sunrise, async_track_sunset

# mypy: allow-untyped-defs, no-check-untyped-defs

TRIGGER_SCHEMA = cv.TRIGGER_BASE_SCHEMA.extend(
    {
        vol.Required(CONF_PLATFORM): "sun",
        vol.Required(CONF_EVENT): cv.sun_event,
        vol.Required(CONF_OFFSET, default=timedelta(0)): cv.time_period,
    }
)

async def async_attach_trigger(hass, config, action, automation_info):
    """Listen for events based on configuration."""
    trigger_data = automation_info.get("trigger_data", {}) if automation_info else {}
    event = config.get(CONF_EVENT)
    offset = config.get(CONF_OFFSET)
    description = event
    if offset:
        description = f"{description} with offset"
    job = HassJob(action)

    @callback
    def call_action():
        """Call action with right context."""
        hass.async_run_hass_job(
            job,
            {
                "trigger": {
                    **trigger_data,
                    "platform": "sun",
                    "event": event,
                    "offset": offset,
                    "description": description,
                }
            },
        )

    if event == SUN_EVENT_SUNRISE:
        return async_track_sunrise(hass, call_action, offset)
    return async_track_sunset(hass, call_action, offset)


text:
class AddTaskCategoryToTask < ActiveRecord::Migration[5.0]
  def change
    add_column :lato_swpmanager_tasks, :task_category_id, :integer
  end
end


text:
/**
 * Delimited record parser implementation.
 */
package org.beanio.stream.delimited;


text:
@interface A2DynamicUIAlertViewDelegate : A2DynamicDelegate

@end

@implementation A2DynamicUIAlertViewDelegate

- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView {
	BOOL should = YES;

	id realDelegate = self.realDelegate;
	if (realDelegate && [realDelegate respondsToSelector:@selector(alertViewShouldEnableFirstOtherButton:)])
		should &= [realDelegate alertViewShouldEnableFirstOtherButton:alertView];

	BOOL (^block)(UIAlertView *) = [self blockImplementationForMethod:_cmd];
	if (block)
		should &= block(alertView);

	return should;
}

- (void)alertViewCancel:(UIAlertView *)alertView {
	id realDelegate = self.realDelegate;
	if (realDelegate && [realDelegate respondsToSelector:@selector(alertViewCancel:)])
		[realDelegate alertViewCancel:alertView];

	id key = @(alertView.cancelButtonIndex);
	BKBlock cancelBlock = (self.handlers)[key];
	if (cancelBlock)
		cancelBlock();
}

- (void)willPresentAlertView:(UIAlertView *)alertView {
	id realDelegate = self.realDelegate;
	if (realDelegate && [realDelegate respondsToSelector:@selector(willPresentAlertView:)])
		[realDelegate willPresentAlertView:alertView];

	void (^block)(UIAlertView *) = [self blockImplementationForMethod:_cmd];
	if (block)
		block(alertView);
}

- (void)didPresentAlertView:(UIAlertView *)alertView {
	id realDelegate = self.realDelegate;
	if (realDelegate && [realDelegate respondsToSelector:@selector(didPresentAlertView:)])
		[realDelegate didPresentAlertView:alertView];

	void (^block)(UIAlertView *) = [self blockImplementationForMethod:_cmd];
	if (block)
		block(alertView);
}

- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex {
	id realDelegate = self.realDelegate;
	if (realDelegate && [realDelegate respondsToSelector:@selector(alertView:willDismissWithButtonIndex:)])
		[realDelegate alertView:alertView willDismissWithButtonIndex:buttonIndex];

	void (^block)(UIAlertView *, NSInteger) = [self blockImplementationForMethod:_cmd];
	if (block)
		block(alertView, buttonIndex);
}

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
	id realDelegate = self.realDelegate;
	if (realDelegate && [realDelegate respondsToSelector:@selector(alertView:didDismissWithButtonIndex:)])
		[realDelegate alertView:alertView didDismissWithButtonIndex:buttonIndex];

	void (^block)(UIAlertView *, NSInteger) = [self blockImplementationForMethod:_cmd];
	if (block)
		block(alertView, buttonIndex);
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
	id realDelegate = self.realDelegate;
	if (realDelegate && [realDelegate respondsToSelector:@selector(alertView:clickedButtonAtIndex:)])
		[realDelegate alertView:alertView clickedButtonAtIndex:buttonIndex];

	void (^block)(UIAlertView *, NSInteger) = [self blockImplementationForMethod:_cmd];
	if (block)
		block(alertView, buttonIndex);

	id key = @(buttonIndex);
	BKBlock buttonBlock = (self.handlers)[key];
	if (buttonBlock)
		buttonBlock();
}

@end

#pragma mark - Category

@implementation UIAlertView (BlocksKit)

@dynamic willShowBlock, didShowBlock, willDismissBlock, didDismissBlock, shouldEnableFirstOtherButtonBlock;

+ (void)load {
	@autoreleasepool {
		[self registerDynamicDelegate];
		[self linkDelegateMethods: @{
		 @"willShowBlock": @"willPresentAlertView:",
		 @"didShowBlock": @"didPresentAlertView:",
		 @"willDismissBlock": @"alertView:willDismissWithButtonIndex:",
		 @"didDismissBlock": @"alertView:didDismissWithButtonIndex:",
		 @"shouldEnableFirstOtherButtonBlock": @"alertViewShouldEnableFirstOtherButton:"
		}];
	}
}

#pragma mark Convenience

+ (void) showAlertViewWithTitle: (NSString *) title message: (NSString *) message cancelButtonTitle: (NSString *) cancelButtonTitle otherButtonTitles: (NSArray *) otherButtonTitles handler: (void (^)(UIAlertView *, NSInteger)) block
{
	// If no buttons were specified, cancel button becomes "Dismiss"
	if (!cancelButtonTitle.length && !otherButtonTitles.count)
		cancelButtonTitle = NSLocalizedString(@"Dismiss", nil);

	UIAlertView *alertView = [[[self class] alloc] initWithTitle:title message:message delegate:self.dynamicDelegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil];

	// Set other buttons
	[otherButtonTitles each: ^(NSString *button) {
		[alertView addButtonWithTitle: button];
	}];

	// Set `didDismissBlock`
	if (block) alertView.didDismissBlock = block;

	// Show alert view
	[alertView show];
}

#pragma mark Initializers

+ (id)alertViewWithTitle:(NSString *)title {
	return [self alertViewWithTitle:title message:nil];
}

+ (id)alertViewWithTitle:(NSString *)title message:(NSString *)message {
	return [[[self class] alloc] initWithTitle:title message:message];
}

- (id)initWithTitle:(NSString *)title message:(NSString *)message {
	return [self initWithTitle:title message:message delegate:self.dynamicDelegate cancelButtonTitle:nil otherButtonTitles:nil];
}

#pragma Actions

- (NSInteger)addButtonWithTitle:(NSString *)title handler:(BKBlock)block {
	NSAssert(title.length, @"A button without a title cannot be added to the alert view.");
	NSInteger index = [self addButtonWithTitle:title];
	[self setHandler:block forButtonAtIndex:index];
	return index;
}

- (NSInteger)setCancelButtonWithTitle:(NSString *)title handler:(BKBlock)block {
	if (!title.length)
		title = NSLocalizedString(@"Cancel", nil);
	NSInteger cancelButtonIndex = [self addButtonWithTitle:title];
	self.cancelButtonIndex = cancelButtonIndex;
	[self setHandler:block forButtonAtIndex:cancelButtonIndex];
	return cancelButtonIndex;
}

#pragma mark Properties

- (void)setHandler:(BKBlock)block forButtonAtIndex:(NSInteger)index {
	id key = @(index);

	if (block)
		[self.dynamicDelegate handlers][key] = [block copy];
	else
		[[self.dynamicDelegate handlers] removeObjectForKey: key];
}

- (BKBlock)handlerForButtonAtIndex:(NSInteger)index {
	id key = @(index);
	return [self.dynamicDelegate handlers][key];
}

- (BKBlock)cancelBlock {
	return [self handlerForButtonAtIndex:self.cancelButtonIndex];
}

- (void)setCancelBlock:(BKBlock)block {
	if (block && self.cancelButtonIndex == -1) {
		[self setCancelButtonWithTitle:nil handler:block];
		return;
	}

	[self setHandler:block forButtonAtIndex:self.cancelButtonIndex];
}

@end


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.daDK = void 0;

var _merge = _interopRequireDefault(require("lodash/merge"));

var _da = _interopRequireDefault(require("date-fns/locale/da"));

var _filterExpressions = require("@looker/filter-expressions");

var _components = require("@looker/components");

var resources = {
  AddRemoveButtons: {
    Add: 'Tilføj',
    Remove: 'Fjern'
  },
  before_after_units: {
    'days ago': 'dage siden',
    'days from now': 'dage fra nu',
    'fiscal quarter from now': 'regnskabskvartal fra nu',
    'fiscal quarters ago': 'regnskabskvartaler siden',
    'fiscal years ago': 'regnskabsår siden',
    'fiscal years from now': 'regnskabsår fra nu',
    'hours ago': 'timer siden',
    'hours from now': 'timer fra nu',
    'minutes ago': 'minutter siden',
    'minutes from now': 'minutter fra nu',
    'months ago': 'måneder siden',
    'months from now': 'måneder fra nu',
    now: 'nu',
    'quarters ago': 'kvartaler siden',
    'quarters from now': 'kvartaler fra nu',
    'seconds ago': 'sekunder siden',
    'seconds from now': 'sekunder fra nu',
    'weeks ago': 'uger siden',
    'weeks from now': 'uger fra nu',
    'years ago': 'år siden',
    'years from now': 'år fra nu'
  },
  BeforeAfter: {
    absolute: '(absolut)',
    relative: '(relativ)'
  },
  Between: {
    AND: 'OG'
  },
  date_units: {
    day: 'dag',
    days: 'dage',
    'fiscal quarter': 'regnskabskvartal',
    'fiscal quarters': 'regnskabskvartaler',
    'fiscal year': 'regnskabsår',
    'fiscal years': 'regnskabsår',
    hour: 'time',
    hours: 'timer',
    minute: 'minut',
    minutes: 'minutter',
    month: 'måned',
    months: 'måneder',
    quarter: 'kvartal',
    quarters: 'kvartaler',
    second: 'sekund',
    seconds: 'sekunder',
    week: 'uge',
    weeks: 'uger',
    year: 'år',
    years: 'år'
  },
  DateRange: {
    'until (before)': 'indtil (før)'
  },
  get_date_filter_options: {
    is: 'er',
    'is any time': 'er når som helst',
    'is before': 'er før',
    'is in range': 'er i område',
    'is in the last': 'er inden for den/det seneste',
    'is in the month': 'er i måneden',
    'is in the year': 'er i året',
    'is next': 'er næste',
    'is not null': 'er ikke null',
    'is null': 'er null',
    'is on or after': 'er på eller efter',
    'is on the day': 'er på dagen',
    'is previous': 'er forrige',
    'is this': 'er dette'
  },
  get_filter_options: {
    'matches advanced': 'resultater (avanceret)'
  },
  get_location_filter_options: {
    Box: 'Boks',
    Circle: 'Cirkel',
    Location: 'Placering',
    feet: 'fod',
    'is anywhere': 'er hvor som helst',
    'is not null': 'er ikke null',
    'is null': 'er null',
    kilometers: 'kilometer',
    meters: 'meter',
    miles: 'miles'
  },
  get_number_filter_options: {
    exclusive: '(eksklusive)',
    inclusive: '[inklusive]',
    is: 'er',
    'is between': 'er mellem',
    'is greater': 'er >',
    'is greater equal': 'er >=',
    'is less': 'er <',
    'is less equal': 'er <=',
    'is not': 'er ikke',
    'is not between': 'er ikke mellem',
    'is not null': 'er ikke null',
    'is null': 'er null',
    'left exclusive': '(venstre-eksklusive]',
    'right exclusive': '[højre-eksklusive)'
  },
  get_relative_timeframe_presets: {
    'Last 14 Days': 'De seneste 14 dage',
    'Last 180 Days': 'De seneste 180 dage',
    'Last 28 Days': 'De seneste 28 dage',
    'Last 30 Days': 'De seneste 30 dage',
    'Last 365 Days': 'De seneste 365 dage',
    'Last 7 Days': 'De seneste 7 dage',
    'Last 90 Days': 'De seneste 90 dage',
    'Previous Month': 'Forrige måned',
    'Previous Quarter': 'Forrige kvartal',
    'Previous Week': 'Forrige uge',
    'Previous Year': 'Forrige år',
    'This Month': 'Denne måned',
    'This Quarter': 'Dette kvartal',
    'This Week': 'Denne uge',
    'This Year': 'Dette år',
    Today: 'I dag',
    'Year To Date': 'År til dato',
    Yesterday: 'I går'
  },
  get_string_filter_options: {
    contains: 'indeholder',
    'doesnt contain': 'indeholder ikke',
    'doesnt end with': 'slutter ikke med',
    'doesnt start with': 'starter ikke med',
    'ends with': 'slutter med',
    is: 'er',
    'is blank': 'er tom',
    'is not': 'er ikke',
    'is not blank': 'er ikke tom',
    'is not null': 'er ikke null',
    'is null': 'er null',
    'starts with': 'starter med'
  },
  get_tier_filter_options: {
    is: 'er',
    'is any value': 'er enhver værdi',
    'is not': 'er ikke'
  },
  get_user_attribute_option: {
    'matches a user attribute': 'matcher en brugerattribut'
  },
  MultiInput: {
    'Clear all': '',
    Remove: '',
    Toggle: ''
  },
  NumberFilter: {
    'any value': 'enhver værdi'
  },
  OperatorLabel: {
    AND: 'OG',
    OR: 'ELLER'
  },
  past_units: {
    'complete days': 'hele dage',
    'complete fiscal quarters': 'hele regnskabskvartaler',
    'complete fiscal years': 'hele regnskabsår',
    'complete hours': 'hele timer',
    'complete minutes': 'hele minutter',
    'complete months': 'hele måneder',
    'complete quarters': 'hele kvartaler',
    'complete seconds': 'hele sekunder',
    'complete weeks': 'hele uger',
    'complete years': 'hele år'
  },
  RadioGroup: {
    'any value': 'enhver værdi'
  },
  ReactSelectCustomIcons: {
    'Clear all': 'Ryd alt',
    Remove: 'Fjern',
    Toggle: 'Slå til/fra'
  },
  Relative: {
    ago: 'siden',
    'from now': 'fra nu'
  },
  RelativeTimeframe: {
    'Choose a Timeframe': 'Vælg en tidsramme'
  },
  RelativeTimeframePopoverContent: {
    Custom: 'Tilpasning',
    Presets: 'Forudindstillinger'
  },
  RelativeTimeframePresets: {
    More: 'Mere'
  },
  use_filters_errors: {
    'Invalid value': 'Ugyldig værdi',
    'No value is set for your user attribute': 'Der er ikke angivet nogen værdi for din brugerattribut',
    'Selection required': 'Valg kræves'
  },
  use_option_filtering: {
    'No values': 'Ingen værdier',
    'No values match': 'Ingen matchende værdier'
  },
  use_placeholder: {
    'any value': 'enhver værdi'
  },
  use_suggestable: {
    'Error loading suggestions': 'Fejl under indlæsning af forslag'
  },
  use_validation_message: {
    'Value required': 'Værdi kræves'
  }
};
var daDK = {
  dateLocale: _da["default"],
  locale: 'da-DK',
  resources: {
    'da-DK': (0, _merge["default"])({}, resources, _filterExpressions.daDK.resources['da-DK'], _components.daDK.resources['da-DK'])
  }
};
exports.daDK = daDK;
//# sourceMappingURL=da-DK.js.map


text:
from dataclasses import dataclass
from typing import Dict, Any, Tuple, List

from siebenapp.domain import Graph, Command, EdgeType, GoalId, RenderResult, RenderRow

@dataclass(frozen=True)
class ToggleProgress(Command):
    pass

def _progress_status(
    row: RenderRow, progress_cache: Dict[GoalId, Tuple[int, int]]
) -> str:
    dividend = progress_cache[row.goal_id][0]
    divisor = progress_cache[row.goal_id][1]
    percent = int(100.0 * dividend / divisor)
    return f"{percent}% ({dividend}/{divisor})"

class ProgressView(Graph):
    def __init__(self, goaltree: Graph):
        super().__init__(goaltree)
        self.show_progress = False

    def accept_ToggleProgress(self, command: ToggleProgress) -> None:
        self.show_progress = not self.show_progress

    def settings(self, key: str) -> Any:
        if key == "filter_progress":
            return self.show_progress
        return self.goaltree.settings(key)

    def reconfigure_from(self, origin: "Graph") -> None:
        super().reconfigure_from(origin)
        self.show_progress = origin.settings("filter_progress")

    def q(self) -> RenderResult:
        render_result = self.goaltree.q()
        if not self.show_progress:
            return render_result
        progress_cache: Dict[GoalId, Tuple[int, int]] = {}
        rows = render_result.rows
        queue: List[RenderRow] = list(rows)
        while queue:
            row = queue.pop(0)
            children = [x[0] for x in row.edges if x[1] == EdgeType.PARENT]
            open_count = 0 if row.is_open else 1
            if not children:
                progress_cache[row.goal_id] = (open_count, 1)
            elif all(g in progress_cache for g in children):
                progress_cache[row.goal_id] = (
                    sum(progress_cache[x][0] for x in children) + open_count,
                    sum(progress_cache[x][1] for x in children) + 1,
                )
            else:
                queue.append(row)

        result_rows: List[RenderRow] = [
            RenderRow(
                row.goal_id,
                row.raw_id,
                row.name,
                row.is_open,
                row.is_switchable,
                row.edges,
                {
                    # We could use `r.attrs | (...)` in Python 3.9+
                    **row.attrs,
                    **{"Progress": _progress_status(row, progress_cache)},
                },
            )
            for row in rows
        ]

        return RenderResult(
            result_rows, select=render_result.select, roots=render_result.roots
        )


text:
import { Pipe, PipeTransform } from '@angular/core';

import { IBook } from './books.service';
import { ExternLibsService } from '../common/extern-libs/extern-libs.service';

@Pipe({
	name: 'booksFilter'
})
export class BooksFilterPipe implements PipeTransform{

	constructor(
		private externLibsService: ExternLibsService
	){

	}

	transform(value: Array<IBook>, args: string[]): any{
		if(typeof value === 'undefined' || value === null || value.length <= 0){
			return null;
		}
		else{
			let filterString = '';

			if(typeof args !== 'undefined' && args !== null && args.length > 0){
				if(typeof args[0] !== 'undefined' && args[0] !== null){
					filterString = args[0];
				}
			}

			filterString = filterString.toLowerCase();
			let lazyjs: any = this.externLibsService.lazyjs();
			return lazyjs(value).filter((book) => {
				return ((book.title.toLowerCase().indexOf(filterString) > -1) || (book.author.toLowerCase().indexOf(filterString) > -1))
			}).toArray();
		}
	}
}


text:
"""
Core Models
"""
from __future__ import absolute_import

# Without this, makemigrations doesn't recognize the models in that file
from .geo import *


text:
from datetime import datetime, timedelta, time
import logging
import uuid
from couchdbkit import ResourceNotFound
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.reports.generic import GenericTabularReport
from corehq.apps.reports.standard import CustomProjectReport
from corehq.util.dates import iso_string_to_date
from dimagi.utils.parsing import json_format_date
from pact.models import PactPatientCase, CObservation
from pact.reports.dot import PactDOTPatientField

class PactDOTAdminPatientField(PactDOTPatientField):
    slug = "dot_patient"
    name = "DOT Patient"
    default_option = "All Patients"

COUCH_CHUNK_LIMIT = 500
COUCH_MAX_LIMIT = 1000

class PactDOTAdminReport(GenericTabularReport, CustomProjectReport):
    fields = ['pact.reports.admin_dot_reports.PactDOTAdminPatientField',
              'corehq.apps.reports.filters.dates.DatespanFilter']
    name = "PACT DOT Admin"
    slug = "pactdotadmin"
    emailable = True
    exportable = True
    report_template_path = "pact/admin/pact_dot_admin.html"

    def tabular_data(self, mode, case_id, start_date, end_date):#, limit=50, skip=0):
        try:
            case_doc = PactPatientCase.get(case_id)
        except ResourceNotFound:
            case_doc = None

        if case_doc is not None:
            # patient is selected
            startkey = [case_id, 'anchor_date', start_date.year, start_date.month, start_date.day]
            endkey = [case_id, 'anchor_date', end_date.year, end_date.month, end_date.day]
        elif case_doc is None:
            # patient is not selected, do all patients
            startkey = [start_date.year, start_date.month, start_date.day]
            endkey = [end_date.year, end_date.month, end_date.day]
        skip = 0
        view_results = CObservation.view(
            'pact/dots_observations',
            startkey=startkey,
            endkey=endkey,
            limit=COUCH_CHUNK_LIMIT,
            skip=skip,
            classes={None: CObservation},
        ).all()
        while len(view_results) > 0:
            if skip > COUCH_MAX_LIMIT:
                logging.error("Pact DOT admin query: Too much data returned for query %s-%s" % (startkey, endkey))
                break
            for v in view_results:
                yield v
            skip += COUCH_CHUNK_LIMIT
            view_results = CObservation.view(
                'pact/dots_observations',
                startkey=startkey,
                endkey=endkey,
                limit=COUCH_CHUNK_LIMIT,
                skip=skip,
                classes={None: CObservation},
            ).all()

    @property
    def headers(self):
        headers = DataTablesHeader(
            DataTablesColumn("PACT ID", prop_name="pact_id"),
            DataTablesColumn("ART", prop_name="is_art"),
            DataTablesColumn("CHW", prop_name="provider"),
            DataTablesColumn("Method", prop_name="method"),
            DataTablesColumn("Encounter Date", prop_name="encounter_date"),
            DataTablesColumn("Anchor Date", prop_name="anchor_date"),
            DataTablesColumn("Observed Date", prop_name="observed_date"),
            DataTablesColumn("Adherence", prop_name="adherence"),
            DataTablesColumn("Created Date", prop_name="created_date"),
            DataTablesColumn("Submitted Date", prop_name="submitted_date"),
            DataTablesColumn("Dose Number", prop_name="dose_number"),
            DataTablesColumn("Total Doses", prop_name="total_doses"),
            DataTablesColumn("Day Slot", prop_name="day_slot"),
            DataTablesColumn("Note", prop_name="note")
        )
        return headers

    @property
    def rows(self):
        """
            Override this method to create a functional tabular report.
            Returns 2D list of rows.
            [['row1'],[row2']]
        """
        case_id = self.request.GET.get('dot_patient', '')
        start_date_str = self.request.GET.get('startdate',
                                              json_format_date(datetime.utcnow() - timedelta(days=7)))
        end_date_str = self.request.GET.get('enddate', json_format_date(datetime.utcnow()))

        if case_id == '':
            mode = 'all'
        else:
            mode = ''

        start_datetime = datetime.combine(iso_string_to_date(start_date_str),
                                          time())
        end_datetime = datetime.combine(iso_string_to_date(end_date_str),
                                        time())
        for num, obs in enumerate(self.tabular_data(mode, case_id, start_datetime, end_datetime)):
            dict_obj = obs.to_json()
            row = [dict_obj[x.prop_name].encode('utf-8') if isinstance(dict_obj[x.prop_name], unicode) else dict_obj[x.prop_name] for x in self.headers]
            yield row


text:
using System;
using System.Diagnostics;

namespace FclEx.Helpers
{
    public static class DebuggerHepler
    {
        public static void Write(string msg)
        {
            if (Debugger.IsLogging())
                Debugger.Log(1, "", msg);
        }

        public static void Write(Func<string> msg)
        {
            if (Debugger.IsLogging() && msg != null)
                Debugger.Log(1, "", msg());
        }

        public static void WriteLine(string msg)
        {
            if (Debugger.IsLogging())
                Debugger.Log(1, "", msg + Environment.NewLine);
        }

        public static void WriteLine(Func<string> msg)
        {
            if (Debugger.IsLogging() && msg != null)
                Debugger.Log(1, "", msg() + Environment.NewLine);
        }
    }
}


text:
"""
Load cmudict data into dynamodb
"""

import boto3
import re
import json

from nltk.corpus import cmudict

def num_syl(word, syl):
    """
    Return the number of syllables.

    This is a helper method for the other readability score methods.
    You can call it directly against a particular word if you would like.
    """

    # substitute integers for the word
    # example: 10 should be "ten"
    if re.match('^[0-9]+$', word):
        word = num2words(int(word))

    # this block protects against KeyErrors
    if word in syl:
        return [len(list(y for y in x if y[-1].isdigit())) for x in syl[word]][0]
    else:
        if (re.match('\b', word) or word in self.not_found):
            pass
        else:
            self.not_found.append(word)

        return 0

if __name__=='__main__':
    dynamodb = boto3.resource('dynamodb')
    table = dynamodb.Table('cmudict')

    # cmudict data
    d = cmudict.dict()

    with table.batch_writer() as batch:
        for i in d:
            w = re.sub("'","",i)
            syl = str(num_syl(i, d))

            print(json.dumps({'word': w, 'syllables': syl}, indent=4))

            batch.put_item(Item={'word': w, 'syllables': syl})


text:
<?xml version="1.0" ?>
<tei>
	<teiHeader>
		<fileDesc xml:id="ZNB-1947-2b-0094"/>
	</teiHeader>
	<text xml:lang="de">
		<front>
			<lb/>
			<docTitle>
				<titlePart>Wasserstoffbindung, Struktur und Energietransport bei Proteinen<lb/></titlePart>
			</docTitle>

			<byline>
				<docAuthor>Von KARL WIRTZ<lb/></docAuthor>
			</byline>

			<byline>
				<affiliation>Aus dem Max-Planck-Institut für Physik, </affiliation>
			</byline>

			<address>Göttingen<lb/></address>

			<reference>(Z. Naturforschg. 2 b, 04—98 [1947];</reference>

			<note type="submission">eingegangen am 23. Juli 1946)<lb/></note>

In Proteinen gibt es wahrscheinlich "Kettensysteme" von Wasserstoffbindungen zwi-<lb/>schen den Imidgruppen senkrecht zur Achse der Polypeptidketten. Diese "Systeme"<lb/> müssen nach Überlegungen des Verfassers 1 mit zunehmender Gliederzahl stabiler wer-<lb/>den. Dies dürfte einer der energetischen Gründe für die geordnete Faltung der Poly-<lb/>peptidkette sein. Wird ein Glied eines solchen Systems durch einen "Treffer", wie er in<lb/> der Strahlengenetik vorkommt, ionisiert, so muß sich die Ladung durch Verschiebung der<lb/> innermolekularen jt-Elektronen und der zwischenmolekularen Protonen über einen Teil<lb/> des "Systems" ausbreiten. Auch der "Treffbereich" kann in diesem Energieleitungsmodell<lb/> veranschaulicht werden.<lb/>

		</front>
	</text>
</tei>