text:
Use this block as a part of the [menu](../menu/menu.en.md) block.

## Overview

### Modifiers of the block

| Modifier | Acceptable values | Use cases | Description |
| ----------- | ------------------- | -------------------- | -------- |
| type | 'link' | BEMJSON | The menu item implemented by the link block. |
| disabled | true | BEMJSON, JS | The disabled state. |
| hovered | true | – | The hovered state. |

### Custom fields of the block

| Field | Type | Description |
| ---- | --- | -------- |
| val | Number, String | The value of the menu item. |

## Block description

Use the `menu-item` block to control the size, state and appearance of the menu items. Use this block as a part of the [menu](../menu/menu.en.md) block.

### Modifiers of the block

#### `type` modifier

Acceptable value: `'link'`.

Use case: `BEMJSON`.

Use this modifier to create the menu items implemented by the [link](../link/link.en.md) block that must be declared in the `content` field in BEMJSON.

```js
{
    block : 'menu',
    mods : { theme : 'islands', size : 'm' },
    content : [
        {
            block : 'menu-item',
            mods : { type : 'link' },
            content : {
                block : 'link',
                url : 'https://bem.info/',
                content : 'bem.info'
            }
        },
        {
            block : 'menu-item',
            mods : { type : 'link' },
            content : {
                block : 'link',
                url : 'https://tech.yandex.ru/',
                content : 'tech.yandex.ru'
            }
        }
    ]
}
```

#### `disabled` modifier

Acceptable value: `true`.

Use cases: `BEMJSON`, `JS`.

The modifier makes the block inactive. The disabled block is visible but not available for user actions.

```js
{
    block : 'menu',
    mods : { theme : 'islands', size : 'm' },
    content : [
        {
            block : 'menu-item',
            mods : { disabled : true },
            content : 'BH'
        },
        {
            block : 'menu-item',
            content : 'BEMHTML'
        }
    ]
}
```

#### `hovered` modifier

Acceptable value: `true`.

Use case: – .

The modifier is added to the block automatically at the moment when you mouse it over.

### Custom fields of the block

#### `val` field

Type: `Number`, `String`.

Specifies the value of the menu item.

```js
{
    block : 'menu',
    mods : { theme : 'islands', size : 'm', mode : 'radio' },
    val : 'item-1',
    content : [
        {
            block : 'menu-item',
            val : 'item-1',
            content : 'BH'
        },
        {
            block : 'menu-item',
            val : 'item-2',
            content : 'BEMHTML'
        }
    ]
}
```


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Fl. Amer. sept. 1:202. 1813-1814

#### Original name
null

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
// TypeScript Version: 2.0

/**
* Difference between one and the smallest value greater than one that can be represented as a double-precision floating-point number.
*
* @example
* var eps = FLOAT64_EPSILON;
* // returns 2.220446049250313e-16
*/
declare const FLOAT64_EPSILON: number;

// EXPORTS //

export = FLOAT64_EPSILON;


text:
from django.conf.urls import url, patterns
from rest_framework import routers
from parkkeeper import views
from rest_framework.urlpatterns import format_suffix_patterns

router = routers.DefaultRouter()
router.register('host', views.HostViewSet)
router.register('host_group', views.HostGroupViewSet)
router.register('monit_schedule', views.MonitScheduleViewSet)
router.register('work_schedule', views.WorkScheduleViewSet)

urlpatterns = [
    url(r'^$', views.index),
    url(r'^monit_status_latest/$', views.monit_status_latest),
    url(r'^work_status_latest/$', views.work_status_latest),
    url(r'^monit_task/(.+)/$', views.monit_task),
    url(r'^work_task/(.+)/$', views.work_task),
]

urlpatterns = format_suffix_patterns(urlpatterns)

urlpatterns += router.urls


text:
package com.gu.example

import com.gu.automation.core.{GivenWhenThen, WebDriverFeatureSpec}
import org.openqa.selenium.WebDriver

/**
 *
 * To run this test against example.html, just add a local.conf with something like the following line:
 *
 * "testBaseUrl"           : "file:///Users/jduffell/ws/scala-automation/src/examples/resources"
 */
class ExampleTests extends WebDriverFeatureSpec with GivenWhenThen {

  info("Tests for the Example project")

  feature("My example feature") {

    /**
     * scenarioWeb handles starting and stopping the browser, you will have to declare an implicit driver as shown
     */
    scenarioWeb("My first test") { implicit driver: WebDriver =>

      given {
        ExampleSteps().loggedIn()
      }
      .when {
        _.IGoToTheEventsPage()
      }
      .then {
        _.ISeeAListOfEvents()
      }
//      .when {
//        _.goToTheEventsPage()
//      }
//      .then {
//        _.seeAListOfEvents()
//      }

    }

  }

}


text:
layout: page
title: Mendoza Family Reunion
date: 2016-05-24
author: Wayne Castillo
tags: weekly links, java
status: published
summary: In enim libero, blandit sed pulvinar in.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 09/19/2016
  endDate: 09/24/2016
  ctyhocn: GSBNCHX
  groupCode: MFR
published: true
---
Nulla commodo consectetur elementum. Ut congue metus et erat imperdiet posuere. Phasellus at orci ut lectus hendrerit blandit. Nulla dapibus nisi id elit dapibus ultrices. Proin scelerisque aliquam faucibus. In feugiat sed lectus sit amet egestas. Nulla accumsan nisi sed metus congue mollis. Praesent aliquet arcu ante, quis feugiat nunc sollicitudin et. Integer cursus sem lobortis erat efficitur cursus.
In ut arcu vitae diam pellentesque aliquet a finibus metus. Morbi at euismod magna. Nullam in sem a libero dictum fermentum vel at tellus. In hac habitasse platea dictumst. Suspendisse dapibus vestibulum facilisis. Cras eleifend eros in ligula aliquet luctus. Fusce nec laoreet orci. Sed ut orci porta, tempor leo a, rhoncus tortor.

* Maecenas tincidunt nisl at auctor finibus
* Fusce pulvinar arcu in urna dapibus, nec ultrices diam scelerisque
* Proin commodo nunc nec velit pretium, eget facilisis velit dictum
* Morbi nec ex sit amet felis elementum mattis.

Vivamus pharetra placerat enim, eget sollicitudin felis sollicitudin a. Quisque eget elit vitae massa congue laoreet non at risus. Etiam sollicitudin sodales elit, id efficitur lacus sagittis in. Ut vel dui sed nulla congue interdum. Pellentesque faucibus ultrices tortor, ut gravida nibh. Morbi rhoncus risus est, vitae auctor ligula eleifend ac. Curabitur in eros est. Nulla a molestie orci, nec mattis ligula. Etiam at mi egestas velit accumsan ullamcorper quis a ex. Nullam felis diam, dignissim quis tempus nec, auctor ut metus. Suspendisse eu dignissim urna. Nam rutrum hendrerit risus nec aliquet. Ut vel elementum dolor. Sed tempor rutrum tortor, id efficitur arcu ullamcorper quis. Aliquam aliquet eu nulla nec viverra. Vestibulum sollicitudin massa vel ipsum ullamcorper, et convallis risus tempor.


text:
/**
 * Module dependencies.
 */

var express = require('express');
var session = require('express-session');
var compression = require('compression');
var morgan = require('morgan');
var cookieParser = require('cookie-parser');
var cookieSession = require('cookie-session');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var csrf = require('csurf');
var multer = require('multer');
var swig = require('swig');
var cors = require('cors');

var mongoStore = require('connect-mongo')(session);
var flash = require('connect-flash');
var winston = require('winston');
var helpers = require('view-helpers');
var config = require('config');
var pkg = require('../package.json');

var env = process.env.NODE_ENV || 'development';

/**
 * Expose
 */

module.exports = function (app, passport) {

  // Compression middleware (should be placed before express.static)
  app.use(compression({
    threshold: 512
  }));

  var allowCrossDomain = function(req, res, next) {
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
      res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-DCV-Token');

      if ('OPTIONS' == req.method) {
        res.send(200);
      }
      else {
        next();
      }
  };

  // Static files middleware
  app.use(express.static(config.root + '/public'));

  // Use winston on production
  var log;
  if (env !== 'development') {
    log = {
      stream: {
        write: function (message, encoding) {
          winston.info(message);
        }
      }
    };
  } else {
    log = 'dev';
  }

  // Don't log during tests
  // Logging middleware
  if (env !== 'test') app.use(morgan(log));

  // Swig templating engine settings
  if (env === 'development' || env === 'test') {
    swig.setDefaults({
      cache: false
    });
  }

  // set views path, template engine and default layout
  app.engine('html', swig.renderFile);
  app.set('views', config.root + '/app/views');
  app.set('view engine', 'html');

  // expose package.json to views
  app.use(function (req, res, next) {
    res.locals.pkg = pkg;
    res.locals.env = env;
    next();
  });

  app.use(allowCrossDomain);

  // bodyParser should be above methodOverride
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(multer());
  app.use(methodOverride(function (req, res) {
    if (req.body && typeof req.body === 'object' && '_method' in req.body) {
      // look in urlencoded POST bodies and delete it
      var method = req.body._method;
      delete req.body._method;
      return method;
    }
  }));

  // CookieParser should be above session
  app.use(cookieParser());

  // enable cors
  app.use(cors());

  // use passport session
  app.use(passport.initialize());
  // app.use(passport.session());

  // should be declared after session and flash
  app.use(helpers(pkg.name));

  // adds CSRF support
  if (process.env.NODE_ENV !== 'test') {
    // app.use(csrf());

    // This could be moved to view-helpers :-)
    app.use(function (req, res, next) {
      // res.locals.csrf_token = req.csrfToken();
      next();
    });
  }
};


text:
	<title>Richard Dannatt's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Richard Dannatt's panel show appearances

Richard Dannatt (born 1950-12-23[ref]) has appeared in 2 episodes between 2009-2010.  Richard Dannatt on Wikipedia.

2009

2010

2010-10-21 / Question Time

2009-12-10 / Question Time


text:
        Chaya

Hi! My name is yourname!

One shalt not speak shakespearean, or brocolli McDonalds

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


text:
namespace {

void SendResponse(dbus::MethodCall* method_call,
                  dbus::ExportedObject::ResponseSender response_sender,
                  bool answer) {
  std::unique_ptr<dbus::Response> response =
      dbus::Response::FromMethodCall(method_call);
  dbus::MessageWriter writer(response.get());
  writer.AppendBool(answer);
  std::move(response_sender).Run(std::move(response));
}

Profile* GetSenderProfile(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender* response_sender) {
  dbus::MessageReader reader(method_call);
  std::string user_id_hash;

  if (!reader.PopString(&user_id_hash)) {
    LOG(ERROR) << "Failed to pop user_id_hash from incoming message.";
    std::move(*response_sender)
        .Run(dbus::ErrorResponse::FromMethodCall(method_call,
                                                 DBUS_ERROR_INVALID_ARGS,
                                                 "No user_id_hash string arg"));
    return nullptr;
  }

  if (user_id_hash.empty())
    return ProfileManager::GetActiveUserProfile();

  return g_browser_process->profile_manager()->GetProfileByPath(
      chromeos::ProfileHelper::GetProfilePathByUserIdHash(user_id_hash));
}
}  // namespace

namespace chromeos {

ChromeFeaturesServiceProvider::ChromeFeaturesServiceProvider() {}

ChromeFeaturesServiceProvider::~ChromeFeaturesServiceProvider() = default;

void ChromeFeaturesServiceProvider::Start(
    scoped_refptr<dbus::ExportedObject> exported_object) {
  exported_object->ExportMethod(
      kChromeFeaturesServiceInterface,
      kChromeFeaturesServiceIsFeatureEnabledMethod,
      base::BindRepeating(&ChromeFeaturesServiceProvider::IsFeatureEnabled,
                          weak_ptr_factory_.GetWeakPtr()),
      base::BindOnce(&ChromeFeaturesServiceProvider::OnExported,
                     weak_ptr_factory_.GetWeakPtr()));
  exported_object->ExportMethod(
      kChromeFeaturesServiceInterface,
      kChromeFeaturesServiceIsCrostiniEnabledMethod,
      base::BindRepeating(&ChromeFeaturesServiceProvider::IsCrostiniEnabled,
                          weak_ptr_factory_.GetWeakPtr()),
      base::BindOnce(&ChromeFeaturesServiceProvider::OnExported,
                     weak_ptr_factory_.GetWeakPtr()));
  exported_object->ExportMethod(
      kChromeFeaturesServiceInterface,
      kChromeFeaturesServiceIsPluginVmEnabledMethod,
      base::BindRepeating(&ChromeFeaturesServiceProvider::IsPluginVmEnabled,
                          weak_ptr_factory_.GetWeakPtr()),
      base::BindOnce(&ChromeFeaturesServiceProvider::OnExported,
                     weak_ptr_factory_.GetWeakPtr()));
  exported_object->ExportMethod(
      kChromeFeaturesServiceInterface,
      kChromeFeaturesServiceIsUsbguardEnabledMethod,
      base::BindRepeating(&ChromeFeaturesServiceProvider::IsUsbguardEnabled,
                          weak_ptr_factory_.GetWeakPtr()),
      base::BindOnce(&ChromeFeaturesServiceProvider::OnExported,
                     weak_ptr_factory_.GetWeakPtr()));
  exported_object->ExportMethod(
      kChromeFeaturesServiceInterface,
      kChromeFeaturesServiceIsCryptohomeDistributedModelEnabledMethod,
      base::BindRepeating(
          &ChromeFeaturesServiceProvider::IsCryptohomeDistributedModelEnabled,
          weak_ptr_factory_.GetWeakPtr()),
      base::BindRepeating(&ChromeFeaturesServiceProvider::OnExported,
                          weak_ptr_factory_.GetWeakPtr()));
  exported_object->ExportMethod(
      kChromeFeaturesServiceInterface,
      kChromeFeaturesServiceIsCryptohomeUserDataAuthEnabledMethod,
      base::BindRepeating(
          &ChromeFeaturesServiceProvider::IsCryptohomeUserDataAuthEnabled,
          weak_ptr_factory_.GetWeakPtr()),
      base::BindRepeating(&ChromeFeaturesServiceProvider::OnExported,
                          weak_ptr_factory_.GetWeakPtr()));
  exported_object->ExportMethod(
      kChromeFeaturesServiceInterface,
      kChromeFeaturesServiceIsVmManagementCliAllowedMethod,
      base::BindRepeating(
          &ChromeFeaturesServiceProvider::IsVmManagementCliAllowed,
          weak_ptr_factory_.GetWeakPtr()),
      base::BindOnce(&ChromeFeaturesServiceProvider::OnExported,
                     weak_ptr_factory_.GetWeakPtr()));
}

void ChromeFeaturesServiceProvider::OnExported(
    const std::string& interface_name,
    const std::string& method_name,
    bool success) {
  if (!success) {
    LOG(ERROR) << "Failed to export " << interface_name << "." << method_name;
  }
}

void ChromeFeaturesServiceProvider::IsFeatureEnabled(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  static const base::Feature constexpr* kFeatureLookup[] = {
      &::features::kUsbbouncer,
      &::features::kUsbguard,
      &arc::kBootCompletedBroadcastFeature,
      &arc::kCustomTabsExperimentFeature,
      &arc::kFilePickerExperimentFeature,
      &arc::kNativeBridgeToggleFeature,
      &arc::kPrintSpoolerExperimentFeature,
      &features::kSessionManagerLongKillTimeout,
  };

  dbus::MessageReader reader(method_call);
  std::string feature_name;
  if (!reader.PopString(&feature_name)) {
    LOG(ERROR) << "Failed to pop feature_name from incoming message.";
    std::move(response_sender)
        .Run(dbus::ErrorResponse::FromMethodCall(
            method_call, DBUS_ERROR_INVALID_ARGS,
            "Missing or invalid feature_name string arg."));
    return;
  }

  auto* const* it =
      std::find_if(std::begin(kFeatureLookup), std::end(kFeatureLookup),
                   [&feature_name](const base::Feature* feature) -> bool {
                     return feature_name == feature->name;
                   });
  if (it == std::end(kFeatureLookup)) {
    LOG(ERROR) << "Unexpected feature name.";
    std::move(response_sender)
        .Run(dbus::ErrorResponse::FromMethodCall(
            method_call, DBUS_ERROR_INVALID_ARGS, "Unexpected feature name."));
    return;
  }

  SendResponse(method_call, std::move(response_sender),
               base::FeatureList::IsEnabled(**it));
}

void ChromeFeaturesServiceProvider::IsCrostiniEnabled(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  Profile* profile = GetSenderProfile(method_call, &response_sender);
  if (!profile)
    return;

  SendResponse(
      method_call, std::move(response_sender),
      profile ? crostini::CrostiniFeatures::Get()->IsAllowed(profile) : false);
}

void ChromeFeaturesServiceProvider::IsCryptohomeDistributedModelEnabled(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  SendResponse(
      method_call, std::move(response_sender),
      base::FeatureList::IsEnabled(::features::kCryptohomeDistributedModel));
}

void ChromeFeaturesServiceProvider::IsCryptohomeUserDataAuthEnabled(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  SendResponse(
      method_call, std::move(response_sender),
      base::FeatureList::IsEnabled(::features::kCryptohomeUserDataAuth));
}

void ChromeFeaturesServiceProvider::IsPluginVmEnabled(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  Profile* profile = GetSenderProfile(method_call, &response_sender);
  if (!profile)
    return;

  SendResponse(
      method_call, std::move(response_sender),
      profile ? plugin_vm::IsPluginVmAllowedForProfile(profile) : false);
}

void ChromeFeaturesServiceProvider::IsUsbguardEnabled(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  SendResponse(method_call, std::move(response_sender),
               base::FeatureList::IsEnabled(::features::kUsbguard));
}

void ChromeFeaturesServiceProvider::IsVmManagementCliAllowed(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  Profile* profile = GetSenderProfile(method_call, &response_sender);
  if (!profile)
    return;

  SendResponse(method_call, std::move(response_sender),
               profile->GetPrefs()->GetBoolean(
                   crostini::prefs::kVmManagementCliAllowedByPolicy));
}

}  // namespace chromeos


text:
#ifndef INC_NoViableAltException_hpp__
#define INC_NoViableAltException_hpp__

/*
 * SOFTWARE RIGHTS
 *

 * ANTLR 2.7.1 MageLang Insitute, 1999, 2000, 20001
 *

 * We reserve no legal rights to the ANTLR--it is fully in the
 * public domain. An individual or company may do whatever
 * they wish with source code distributed with ANTLR or the
 * code generated by ANTLR, including the incorporation of
 * ANTLR, or its output, into commerical software.
 *

 * We encourage users to develop software with ANTLR. However,
 * we do ask that credit is given to us for developing
 * ANTLR. By "credit", we mean that if you use ANTLR or
 * incorporate any source code into one of your programs
 * (commercial product, research project, or otherwise) that
 * you acknowledge this fact somewhere in the documentation,
 * research report, etc... If you like ANTLR and have
 * developed a nice tool with the output, please mention that
 * you developed it using ANTLR. In addition, we ask that the
 * headers remain intact in our source code. As long as these
 * guidelines are kept, we expect to continue enhancing this
 * system and expect to make other tools available as they are
 * completed.
 *

 * The ANTLR gang:
 * @version ANTLR 2.7.1 MageLang Insitute, 1999, 2000, 2001
 * @author Terence Parr, MageLang Institute
 * @author
John Lilley, Empathy Software
 * @author
Pete Wells
 */

#include <antlr/config.hpp>
#include <antlr/RecognitionException.hpp>
#include <antlr/Token.hpp>
#include <antlr/AST.hpp>

#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
namespace antlr {
#endif

class ANTLR_API NoViableAltException : public RecognitionException {
public:
	const RefToken token;
	const RefAST node; // handles parsing and treeparsing

	NoViableAltException(RefAST t);
	NoViableAltException(RefToken t,const ANTLR_USE_NAMESPACE(std)string& fileName_);

	~NoViableAltException() throw() {}

	/**
	 * Returns a clean error message (no line number/column information)
	 */
	ANTLR_USE_NAMESPACE(std)string getMessage() const;
};

#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
}
#endif

#endif //INC_NoViableAltException_hpp__


text:
package eu.greenlightning.hypercubepdf.page;

import java.io.IOException;
import java.util.Objects;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;

import eu.greenlightning.hypercubepdf.HCPElement;

abstract class HCPAbstractPage implements HCPPage {

	protected final PDDocument document;
	protected final PDPage page;

	private HCPAbstractPage(PDDocument document, PDPage page) {
		this.document = Objects.requireNonNull(document, "Document must not be null.");
		this.page = Objects.requireNonNull(page, "Page must not be null.");
		document.addPage(page);
	}

	public HCPAbstractPage(PDDocument document) {
		this(document, new PDPage());
	}

	public HCPAbstractPage(PDDocument document, PDRectangle size) {
		this(document, new PDPage(Objects.requireNonNull(size, "Size must not be null.")));
	}

	@Override
	public PDPage asPDPage() {
		return page;
	}

	@Override
	public void paint(HCPElement element) throws IOException {
		try (PDPageContentStream content = createPageContentStream()) {
			element.paint(content, getPageSize());
		}
	}

	protected abstract PDRectangle getPageSize();

	protected abstract PDPageContentStream createPageContentStream() throws IOException;

}


text:
'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var sqlite3 = _interopDefault(require('sqlite3'));
var fs = _interopDefault(require('fs'));
var path = _interopDefault(require('path'));

/**
 * SQLite client library for Node.js applications
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

function prepareParams(args, { offset = 0, excludeLastArg = false } = {}) {
  const hasOneParam = args.length === offset + 1 + (excludeLastArg ? 1 : 0);
  if (hasOneParam) {
    return args[offset];
  }
  return Array.prototype.slice.call(args, offset, args.length - (excludeLastArg ? 1 : 0));
}

function resolveTemplateStringObject(args, { offset = 0, excludeLastArg = false } = {}) {
  const hasOneParam = args.length === offset + 1 + (excludeLastArg ? 1 : 0);
  if (hasOneParam && typeof args[offset] === 'object') {
    return {
      sql: args[offset].sql,
      params: args[offset].values
    };
  }
  return {
    sql: args[offset],
    params: prepareParams(args, { offset: offset + 1, excludeLastArg })
  };
}

/**
 * SQLite client library for Node.js applications
 *
 * Copyright © 2016 Kriasoft, LLC. All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

class Statement {

  constructor(stmt, Promise) {
    this.stmt = stmt;
    this.Promise = Promise;
  }

  get sql() {
    return this.stmt.sql;
  }

  get lastID() {
    return this.stmt.lastID;
  }

  get changes() {
    return this.stmt.changes;
  }

  bind() {
    const params = prepareParams(arguments);
    return new this.Promise((resolve, reject) => {
      this.stmt.bind(params, err => {
        if (err) {
          reject(err);
        } else {
          resolve(this);
        }
      });
    });
  }

  reset() {
    return new this.Promise(resolve => {
      this.stmt.reset(() => {
        resolve(this);
      });
    });
  }

  finalize() {
    return new this.Promise((resolve, reject) => {
      this.stmt.finalize(err => {
        if (err) {
          reject(err);
        } else {
          resolve();
        }
      });
    });
  }

  run() {
    const params = prepareParams(arguments);
    return new this.Promise((resolve, reject) => {
      this.stmt.run(params, err => {
        if (err) {
          reject(err);
        } else {
          resolve(this);
        }
      });
    });
  }

  get() {
    const params = prepareParams(arguments);
    return new this.Promise((resolve, reject) => {
      this.stmt.get(params, (err, row) => {
        if (err) {
          reject(err);
        } else {
          resolve(row);
        }
      });
    });
  }

  all() {
    const params = prepareParams(arguments);
    return new this.Promise((resolve, reject) => {
      this.stmt.all(params, (err, rows) => {
        if (err) {
          reject(err);
        } else {
          resolve(rows);
        }
      });
    });
  }

  each() {
    const params = prepareParams(arguments, { excludeLastArg: true });
    const callback = arguments[arguments.length - 1];
    return new this.Promise((resolve, reject) => {
      this.stmt.each(params, callback, (err, rowsCount = 0) => {
        if (err) {
          reject(err);
        } else {
          resolve(rowsCount);
        }
      });
    });
  }

}

var asyncToGenerator = function (fn) {
  return function () {
    var gen = fn.apply(this, arguments);
    return new Promise(function (resolve, reject) {
      function step(key, arg) {
        try {
          var info = gen[key](arg);
          var value = info.value;
        } catch (error) {
          reject(error);
          return;
        }

        if (info.done) {
          resolve(value);
        } else {
          return Promise.resolve(value).then(function (value) {
            step("next", value);
          }, function (err) {
            step("throw", err);
          });
        }
      }

      return step("next");
    });
  };
};

/**
 * SQLite client library for Node.js applications
 *
 * Copyright © 2016 Kriasoft, LLC. All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

// eslint-disable-next-line no-unused-vars,import/no-unresolved,import/extensions
class Database {
  /**
   * Initializes a new instance of the database client.
   * @param {sqlite3.Database} driver An instance of SQLite3 driver library.
   * @param {{Promise: PromiseConstructor}} promiseLibrary ES6 Promise library to use.
     */
  constructor(driver, promiseLibrary) {
    this.driver = driver;
    this.Promise = promiseLibrary.Promise;
  }

  /**
   * Close the database.
   */
  close() {
    return new this.Promise((resolve, reject) => {
      this.driver.close(err => {
        if (err) {
          reject(err);
        } else {
          resolve();
        }
      });
    });
  }

  /**
   * Register listeners for Sqlite3 events
   *
   * @param {'trace'|'profile'|'error'|'open'|'close'} eventName
   * @param {() => void} listener trigger listener function
   */
  on(eventName, listener) {
    this.driver.on(eventName, listener);
  }

  run() {
    const { sql, params } = resolveTemplateStringObject(arguments);
    const Promise = this.Promise;
    return new Promise((resolve, reject) => {
      this.driver.run(sql, params, function runExecResult(err) {
        if (err) {
          reject(err);
        } else {
          // Per https://github.com/mapbox/node-sqlite3/wiki/API#databaserunsql-param--callback
          // when run() succeeds, the `this' object is a driver statement object. Wrap it as a
          // Statement.
          resolve(new Statement(this, Promise));
        }
      });
    });
  }

  get() {
    const { sql, params } = resolveTemplateStringObject(arguments);
    return new this.Promise((resolve, reject) => {
      this.driver.get(sql, params, (err, row) => {
        if (err) {
          reject(err);
        } else {
          resolve(row);
        }
      });
    });
  }

  all() {
    const { sql, params } = resolveTemplateStringObject(arguments);
    return new this.Promise((resolve, reject) => {
      this.driver.all(sql, params, (err, rows) => {
        if (err) {
          reject(err);
        } else {
          resolve(rows);
        }
      });
    });
  }

  /**
   * Runs all the SQL queries in the supplied string. No result rows are retrieved.
   */
  exec(sql) {
    return new this.Promise((resolve, reject) => {
      this.driver.exec(sql, err => {
        if (err) {
          reject(err);
        } else {
          resolve(this);
        }
      });
    });
  }

  each() {
    const { sql, params } = resolveTemplateStringObject(arguments, { excludeLastArg: true });
    const callback = arguments[arguments.length - 1];
    return new this.Promise((resolve, reject) => {
      this.driver.each(sql, params, callback, (err, rowsCount = 0) => {
        if (err) {
          reject(err);
        } else {
          resolve(rowsCount);
        }
      });
    });
  }

  prepare() {
    const { sql, params } = resolveTemplateStringObject(arguments);
    return new this.Promise((resolve, reject) => {
      const stmt = this.driver.prepare(sql, params, err => {
        if (err) {
          reject(err);
        } else {
          resolve(new Statement(stmt, this.Promise));
        }
      });
    });
  }

  /**
   * Set a configuration option for the database.
   */
  configure(option, value) {
    this.driver.configure(option, value);
  }

  /**
   * Migrates database schema to the latest version
   */
  migrate({ force, table = 'migrations', migrationsPath = './migrations' } = {}) {
    var _this = this;

    return asyncToGenerator(function* () {
      /* eslint-disable no-await-in-loop */
      const location = path.resolve(migrationsPath);

      // Get the list of migration files, for example:
      //   { id: 1, name: 'initial', filename: '001-initial.sql' }
      //   { id: 2, name: 'feature', fielname: '002-feature.sql' }
      const migrations = yield new _this.Promise(function (resolve, reject) {
        fs.readdir(location, function (err, files) {
          if (err) {
            reject(err);
          } else {
            resolve(files.map(function (x) {
              return x.match(/^(\d+).(.*?)\.sql$/);
            }).filter(function (x) {
              return x !== null;
            }).map(function (x) {
              return { id: Number(x[1]), name: x[2], filename: x[0] };
            }).sort(function (a, b) {
              return Math.sign(a.id - b.id);
            }));
          }
        });
      });

      if (!migrations.length) {
        throw new Error(`No migration files found in '${location}'.`);
      }

      // Ge the list of migrations, for example:
      //   { id: 1, name: 'initial', filename: '001-initial.sql', up: ..., down: ... }
      //   { id: 2, name: 'feature', fielname: '002-feature.sql', up: ..., down: ... }
      yield Promise.all(migrations.map(function (migration) {
        return new _this.Promise(function (resolve, reject) {
          const filename = path.join(location, migration.filename);
          fs.readFile(filename, 'utf-8', function (err, data) {
            if (err) {
              reject(err);
            } else {
              const [up, down] = data.split(/^--\s+?down\b/mi);
              if (!down) {
                const message = `The ${migration.filename} file does not contain '-- Down' separator.`;
                reject(new Error(message));
              } else {
                /* eslint-disable no-param-reassign */
                migration.up = up.replace(/^-- .*?$/gm, '').trim(); // Remove comments
                migration.down = down.trim(); // and trim whitespaces
                /* eslint-enable no-param-reassign */
                resolve();
              }
            }
          });
        });
      }));

      // Create a database table for migrations meta data if it doesn't exist
      yield _this.run(`CREATE TABLE IF NOT EXISTS "${table}" (
  id   INTEGER PRIMARY KEY,
  name TEXT    NOT NULL,
  up   TEXT    NOT NULL,
  down TEXT    NOT NULL
)`);

      // Get the list of already applied migrations
      let dbMigrations = yield _this.all(`SELECT id, name, up, down FROM "${table}" ORDER BY id ASC`);

      // Undo migrations that exist only in the database but not in files,
      // also undo the last migration if the `force` option was set to `last`.
      const lastMigration = migrations[migrations.length - 1];
      for (const migration of dbMigrations.slice().sort(function (a, b) {
        return Math.sign(b.id - a.id);
      })) {
        if (!migrations.some(function (x) {
          return x.id === migration.id;
        }) || force === 'last' && migration.id === lastMigration.id) {
          yield _this.run('BEGIN');
          try {
            yield _this.exec(migration.down);
            yield _this.run(`DELETE FROM "${table}" WHERE id = ?`, migration.id);
            yield _this.run('COMMIT');
            dbMigrations = dbMigrations.filter(function (x) {
              return x.id !== migration.id;
            });
          } catch (err) {
            yield _this.run('ROLLBACK');
            throw err;
          }
        } else {
          break;
        }
      }

      // Apply pending migrations
      const lastMigrationId = dbMigrations.length ? dbMigrations[dbMigrations.length - 1].id : 0;
      for (const migration of migrations) {
        if (migration.id > lastMigrationId) {
          yield _this.run('BEGIN');
          try {
            yield _this.exec(migration.up);
            yield _this.run(`INSERT INTO "${table}" (id, name, up, down) VALUES (?, ?, ?, ?)`, migration.id, migration.name, migration.up, migration.down);
            yield _this.run('COMMIT');
          } catch (err) {
            yield _this.run('ROLLBACK');
            throw err;
          }
        }
      }

      /* eslint-enable no-await-in-loop */
      return _this;
    })();
  }
}

/**
 * SQLite client library for Node.js applications
 *
 * Copyright © 2016 Kriasoft, LLC. All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

const promise = global.Promise;
const db = new Database(null, { Promise: promise });

/**
 * Opens SQLite database.
 *
 * @returns Promise<Database> A promise that resolves to an instance of SQLite database client.
 */
db.open = (filename, {
  mode = null,
  verbose = false,
  Promise = promise,
  cached = false } = {}) => {
  let driver;
  let DBDriver = sqlite3.Database;

  if (cached) {
    DBDriver = sqlite3.cached.Database;
  }

  if (verbose) {
    sqlite3.verbose();
  }

  return new Promise((resolve, reject) => {
    if (mode !== null) {
      driver = new DBDriver(filename, mode, err => {
        if (err) {
          reject(err);
        } else {
          resolve();
        }
      });
    } else {
      driver = new DBDriver(filename, err => {
        if (err) {
          reject(err);
        } else {
          resolve();
        }
      });
    }
  }).then(() => {
    db.driver = driver;
    db.Promise = Promise;
    return new Database(driver, { Promise });
  });
};

module.exports = db;
//# sourceMappingURL=main.js.map


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:orientation="horizontal"
              android:divider="?android:attr/dividerHorizontal"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <fragment
            android:id="@+id/recipe_list"
            android:name="com.zzolta.android.gfrecipes.fragments.MyRecipesFragment"
            android:layout_width="0dp"
            android:layout_weight="2"
            android:layout_height="match_parent"
            tools:layout="@android:layout/list_content"/>

    <FrameLayout
            android:id="@+id/recipe_detail_container"
            android:layout_width="0dp"
            android:layout_weight="4"
            android:layout_height="match_parent"
            android:background="@color/light"/>
</LinearLayout>


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 92(6): 1158 (2000)

#### Original name
Odontia subscopinella G. Cunn., 1959

### Remarks
null


text:
<?php

namespace Fabrica;

use Illuminate\Database\Eloquent\Model;

class Personal extends Model
{
    protected $table='personal';
    public $timestamps=false;
    protected $fillable=['id_usuario','id_tipo'];
}


text:
// @comments: false

// @Filename: file0.ts
/// <reference path="file1.ts" />
declare var OData: any;

// @Filename: file1.ts
/// <reference path="file0.ts" />
interface F { }


text:
package com.svartsjo.scalautil

import java.util.concurrent.ExecutorService
import scala.concurrent.ExecutionContext

object Concurrency {
  def createCloneOfDefaultExecutionContext() = {
    import scala.language.reflectiveCalls
    type ECI = { def createExecutorService: ExecutorService }
    val executor = ExecutionContext.Implicits.global.asInstanceOf[ECI].createExecutorService
    (ExecutionContext.fromExecutor(executor), executor)
  }
}


text:
//
//  ========================================================================
//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
//  ------------------------------------------------------------------------
//  All rights reserved. This program and the accompanying materials
//  are made available under the terms of the Eclipse Public License v1.0
//  and Apache License v2.0 which accompanies this distribution.
//
//      The Eclipse Public License is available at
//      http://www.eclipse.org/legal/epl-v10.html
//
//      The Apache License v2.0 is available at
//      http://www.opensource.org/licenses/apache2.0.php
//
//  You may elect to redistribute this code under either of these licenses.
//  ========================================================================
//

package org.eclipse.jetty.spdy.api;

import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

/**
 *
A container for DATA frames metadata and content bytes.

 *
Specialized subclasses (like {@link StringDataInfo}) may be used by applications
 * to send specific types of content.

 *
Applications may send multiple instances of {@link DataInfo}, usually of the same
 * type, via {@link Stream#data(DataInfo)}. The last instance must have the
 * {@link #isClose() close flag} set, so that the client knows that no more content is
 * expected.

 *
Receivers of {@link DataInfo} via {@link StreamFrameListener#onData(Stream, DataInfo)}
 * have two different APIs to read the data content bytes: a {@link #readInto(ByteBuffer) read}
 * API that does not interact with flow control, and a {@link #consumeInto(ByteBuffer) drain}
 * API that interacts with flow control.

 *
Flow control is defined so that when the sender wants to sends a number of bytes larger
 * than the {@link Settings.ID#INITIAL_WINDOW_SIZE} value, it will stop sending as soon as it
 * has sent a number of bytes equal to the window size. The receiver has to consume
 * the data bytes that it received in order to tell the sender to send more bytes.

 *
Consuming the data bytes can be done only via {@link #consumeInto(ByteBuffer)} or by a combination
 * of {@link #readInto(ByteBuffer)} and {@link #consume(int)} (possibly at different times).

 */
public abstract class DataInfo extends Info
{
    /**
     *
Flag that indicates that this {@link DataInfo} is the last frame in the stream.

     *
     * @see #isClose()
     * @see #getFlags()
     */
    public final static byte FLAG_CLOSE = 1;

    private final AtomicInteger consumed = new AtomicInteger();
    private boolean close;

    /**
     *
Creates a new {@link DataInfo} with the given close flag and no compression flag.

     *
     * @param close the value of the close flag
     */
    public DataInfo(boolean close)
    {
        setClose(close);
    }

    /**
     *
Creates a new {@link DataInfo} with the given close flag and no compression flag.

     *
     * @param timeout
     * @param unit
     * @param close the value of the close flag
     */
    protected DataInfo(long timeout, TimeUnit unit, boolean close)
    {
        super(timeout, unit);
        this.close = close;
    }

    /**
     * @return the value of the close flag
     * @see #setClose(boolean)
     */
    public boolean isClose()
    {
        return close;
    }

    /**
     * @param close the value of the close flag
     * @see #isClose()
     */
    public void setClose(boolean close)
    {
        this.close = close;
    }

    /**
     * @return the close and compress flags as integer
     * @see #FLAG_CLOSE
     */
    public byte getFlags()
    {
        return isClose() ? FLAG_CLOSE : 0;
    }

    /**
     * @return the total number of content bytes
     * @see #available()
     */
    public abstract int length();

    /**
     *
Returns the available content bytes that can be read via {@link #readInto(ByteBuffer)}.

     *
Each invocation to {@link #readInto(ByteBuffer)} modifies the value returned by this method,
     * until no more content bytes are available.

     *
     * @return the available content bytes
     * @see #readInto(ByteBuffer)
     */
    public abstract int available();

    /**
     *
Copies the content bytes of this {@link DataInfo} into the given {@link ByteBuffer}.

     *
If the given {@link ByteBuffer} cannot contain the whole content of this {@link DataInfo}
     * then after the read {@link #available()} will return a positive value, and further content
     * may be retrieved by invoking again this method with a new output buffer.

     *
     * @param output the {@link ByteBuffer} to copy the bytes into
     * @return the number of bytes copied
     * @see #available()
     * @see #consumeInto(ByteBuffer)
     */
    public abstract int readInto(ByteBuffer output);

    /**
     *
Copies the content bytes of this {@link DataInfo} into the given byte array.

     *
If the given byte array cannot contain the whole content of this {@link DataInfo}
     * then after the read {@link #available()} will return a positive value, and further content
     * may be retrieved by invoking again this method with a new byte array.

     *
     * @param bytes the byte array to copy the bytes into
     * @param offset the index of the byte array to start copying
     * @param length the number of bytes to copy
     * @return the number of bytes copied
     */
    public abstract int readInto(byte[] bytes, int offset, int length);

    /**
     *
Reads and consumes the content bytes of this {@link DataInfo} into the given {@link ByteBuffer}.

     *
     * @param output the {@link ByteBuffer} to copy the bytes into
     * @return the number of bytes copied
     * @see #consume(int)
     */
    public int consumeInto(ByteBuffer output)
    {
        int read = readInto(output);
        consume(read);
        return read;
    }

    /**
     *
Reads and consumes the content bytes of this {@link DataInfo} into the given byte array,
     * starting from index {@code offset} for {@code length} bytes.

     *
     * @param bytes the byte array to copy the bytes into
     * @param offset the offset of the byte array to start copying
     * @param length the number of bytes to copy
     * @return the number of bytes copied
     */
    public int consumeInto(byte[] bytes, int offset, int length)
    {
        int read = readInto(bytes, offset, length);
        consume(read);
        return read;
    }

    /**
     *
Consumes the given number of bytes from this {@link DataInfo}.

     *
     * @param delta the number of bytes consumed
     */
    public void consume(int delta)
    {
        if (delta < 0)
            throw new IllegalArgumentException();
        int read = length() - available();
        int newConsumed = consumed() + delta;
//        if (newConsumed > read)
//            throw new IllegalStateException("Consuming without reading: consumed " + newConsumed + " but only read " + read);
        consumed.addAndGet(delta);
    }

    /**
     * @return the number of bytes consumed
     */
    public int consumed()
    {
        return consumed.get();
    }

    /**
     *
     * @param charset the charset used to convert the bytes
     * @param consume whether to consume the content
     * @return a String with the content of this {@link DataInfo}
     */
    public String asString(String charset, boolean consume)
    {
        return asString(Charset.forName(charset), consume);
    }

    /**
     *
     * @param charset the charset used to convert the bytes
     * @param consume whether to consume the content
     * @return a String with the content of this {@link DataInfo}
     */
    public String asString(Charset charset, boolean consume)
    {
        ByteBuffer buffer = asByteBuffer(consume);
        return charset.decode(buffer).toString();
    }

    /**
     * @return a byte array with the content of this {@link DataInfo}
     * @param consume whether to consume the content
     */
    public byte[] asBytes(boolean consume)
    {
        ByteBuffer buffer = asByteBuffer(consume);
        byte[] result = new byte[buffer.remaining()];
        buffer.get(result);
        return result;
    }

    /**
     * @return a {@link ByteBuffer} with the content of this {@link DataInfo}
     * @param consume whether to consume the content
     */
    public ByteBuffer asByteBuffer(boolean consume)
    {
        ByteBuffer buffer = allocate(available());
        if (consume)
            consumeInto(buffer);
        else
            readInto(buffer);
        buffer.flip();
        return buffer;
    }

    protected ByteBuffer allocate(int size)
    {
        return ByteBuffer.allocate(size);
    }

    @Override
    public String toString()
    {
        return String.format("DATA @%x available=%d consumed=%d close=%b", hashCode(), available(), consumed(), isClose());
    }
}


text:
"""
This application presents a 'console' prompt to the user asking for read commands
which create ReadPropertyRequest PDUs, then lines up the coorresponding ReadPropertyACK
and prints the value.
"""

import sys
from collections import deque

from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.consolelogging import ConfigArgumentParser

from bacpypes.core import run, stop, deferred
from bacpypes.iocb import IOCB

from bacpypes.pdu import Address
from bacpypes.apdu import ReadPropertyRequest

from bacpypes.app import BIPSimpleApplication
from bacpypes.object import get_object_class, get_datatype
from bacpypes.local.device import LocalDeviceObject

# some debugging
_debug = 0
_log = ModuleLogger(globals())

# globals
this_application = None
device_address = None
object_identifier = None
property_list = None

#
#   ReadPropertyApplication
#

@bacpypes_debugging
class ReadPropertyApplication(BIPSimpleApplication):

    def __init__(self, *args):
        if _debug: ReadPropertyApplication._debug("__init__ %r", args)
        BIPSimpleApplication.__init__(self, *args)

        # current property being read
        self.property_identifier = None

    def next_request(self):
        if _debug: ReadPropertyApplication._debug("next_request")
        global device_address, object_identifier, property_list

        # check to see if we're done
        if not property_list:
            if _debug: ReadPropertyApplication._debug("    - done")
            stop()
            return

        # get the next request
        self.property_identifier = property_list.popleft()
        if _debug: ReadPropertyApplication._debug("    - property_identifier: %r", self.property_identifier)

        # build a request
        request = ReadPropertyRequest(
            destination=device_address,
            objectIdentifier=object_identifier,
            propertyIdentifier=self.property_identifier,
            )
        if _debug: ReadPropertyApplication._debug("    - request: %r", request)

        # make an IOCB
        iocb = IOCB(request)

        # set a callback for the response
        iocb.add_callback(self.complete_request)
        if _debug: ReadPropertyApplication._debug("    - iocb: %r", iocb)

        # send the request
        this_application.request_io(iocb)

    def complete_request(self, iocb):
        if _debug: ReadPropertyApplication._debug("complete_request %r", iocb)

        if iocb.ioResponse:
            apdu = iocb.ioResponse

            # find the datatype
            datatype = get_datatype(apdu.objectIdentifier[0], self.property_identifier)
            if _debug: ReadPropertyApplication._debug("    - datatype: %r", datatype)
            if not datatype:
                raise TypeError("unknown datatype")

            # special case for array parts, others are managed by cast_out
            value = apdu.propertyValue.cast_out(datatype)
            if _debug: ReadPropertyApplication._debug("    - value: %r", value)

            sys.stdout.write(self.property_identifier + " = " + str(value) + '\n')
            if hasattr(value, 'debug_contents'):
                value.debug_contents(file=sys.stdout)
            sys.stdout.flush()

        if iocb.ioError:
            if _debug: ReadPropertyApplication._debug("    - error: %r", iocb.ioError)

            # if it is an unknown property, just skip to the next one
            if getattr(iocb.ioError, 'errorCode', '') != 'unknownProperty':
                sys.stdout.write(self.property_identifier + "! " + str(iocb.ioError) + '\n')
                sys.stdout.flush()

        # fire off another request
        deferred(self.next_request)

#
#   __main__
#

def main():
    global this_application, device_address, object_identifier, property_list

    # parse the command line arguments
    parser = ConfigArgumentParser(description=__doc__)
    parser.add_argument(
        "address",
        help="device address",
        )
    parser.add_argument(
        "objtype",
        help="object types, e.g., analogInput",
        )
    parser.add_argument(
        "objinstance", type=int,
        help="object instance",
        )
    args = parser.parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # interpret the address
    device_address = Address(args.address)
    if _debug: _log.debug("    - device_address: %r", device_address)

    # build an identifier
    object_identifier = (args.objtype, args.objinstance)
    if _debug: _log.debug("    - object_identifier: %r", object_identifier)

    # get the object class
    object_class = get_object_class(args.objtype)
    if _debug: _log.debug("    - object_class: %r", object_class)

    # make a queue of the properties
    property_list = deque(prop.identifier for prop in object_class.properties)
    if _debug: _log.debug("    - property_list: %r", property_list)

    # make a device object
    this_device = LocalDeviceObject(ini=args.ini)
    if _debug: _log.debug("    - this_device: %r", this_device)

    # make a simple application
    this_application = ReadPropertyApplication(this_device, args.ini.address)

    # fire off a request when the core has a chance
    deferred(this_application.next_request)

    _log.debug("running")

    run()

    _log.debug("fini")

if __name__ == "__main__":
    main()


text:
<?php

namespace Cyclear\GameBundle\Filter;

class RennerIdFilter extends \Doctrine\ORM\Query\Filter\SQLFilter
{

    public function addFilterConstraint(\Doctrine\ORM\Mapping\ClassMetadata $targetEntity, $targetTableAlias)
    {

        //if ($targetEntity->name != "Doctrine\Tests\Models\Company\CompanyPerson") {
        if ($targetEntity->name != "Cyclear\GameBundle\Entity\Renner") {
            return "";
        }
//        if($value instanceof \Cyclear\GameBundle\Entity\Renner){
//            throw new \UnexpectedValueException("filter expects an id, not an object");
//        }
        $value = $this->getParameter('renner');
        return sprintf("%s.renner = %d", $targetTableAlias, $value->getId());
    }

}


text:
package com.itracker.android.data.extension.archive;

/**
 * Store history for the user while receiving from the message archive.
 *
 * @author alexander.ivanov
 */
public class HistoryStorage extends HeaderSequence {

    /**
     * Packet ID of the list request.
     */
    private String packetId;

    /**
     * Number of new received messages.
     */
    private int receivedNew;

    /**
     * Number of incoming received messages.
     */
    private int receivedIncoming;

    /**
     * Number of new messages to be received.
     */
    private Integer requestedNew;

    /**
     * Number of incoming messages to be received.
     */
    private Integer requestedIncoming;

    public HistoryStorage() {
        super();
        onSuccess();
    }

    public boolean hasPacketId(String packetId) {
        return this.packetId != null && this.packetId.equals(packetId);
    }

    public void setPacketId(String packetId) {
        this.packetId = packetId;
    }

    /**
     * @param receivedNew
     * @param receivedIncoming
     * @return Whether there is enough messages received.
     */
    public boolean enoughMessages(int receivedNew, int receivedIncoming) {
        this.receivedNew += receivedNew;
        this.receivedIncoming += receivedIncoming;
        return this.receivedNew >= requestedNew
                && this.receivedIncoming >= requestedIncoming;
    }

    /**
     * Request has been started.
     *
     * @param requestedNew
     * @param requestedIncoming
     */
    public void onRequest(int requestedNew, int requestedIncoming) {
        this.requestedNew = requestedNew;
        this.requestedIncoming = requestedIncoming;
        onResume();
    }

    /**
     * @return Whether next history request should be sent.
     */
    public boolean onResume() {
        packetId = null;
        if (requestedNew <= 0 && requestedIncoming <= 0)
            return false;
        super.setInProgress(true);
        return true;
    }

    /**
     * Set number of requested messages at least as specified.
     *
     * @param requestedNew
     * @param requestedIncoming
     */
    public void setRequestedCountAtLeast(int requestedNew, int requestedIncoming) {
        this.requestedNew = Math.max(this.requestedNew, requestedNew);
        this.requestedIncoming = Math.max(this.requestedIncoming,
                requestedIncoming);
    }

    /**
     * History portion request has been completed.
     */
    public void onSuccess() {
        super.setInProgress(false);
        packetId = null;
        receivedNew = 0;
        receivedIncoming = 0;
        requestedNew = 0;
        requestedIncoming = 0;
    }

}


text:
package org.broadleafcommerce.core.offer.service.discount.domain;

import org.apache.commons.beanutils.BeanComparator;
import org.broadleafcommerce.common.currency.domain.BroadleafCurrency;
import org.broadleafcommerce.common.money.Money;
import org.broadleafcommerce.core.offer.domain.AdvancedOffer;
import org.broadleafcommerce.core.offer.domain.Offer;
import org.broadleafcommerce.core.offer.domain.OfferTier;
import org.broadleafcommerce.core.offer.service.type.OfferDiscountType;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Collections;
import java.util.List;

/**
 * Provides shared code for the default implementations of PromotableOrderItemPriceDetailAdjustmentImpl and
 * PromotableCandidateItemOfferImpl
 * @author bpolster
 *
 */
public class PromotableOfferUtility {

    public static Money computeAdjustmentValue(Money currentPriceDetailValue, BigDecimal offerUnitValue, OfferHolder offerHolder, PromotionRounding rounding) {
        Offer offer = offerHolder.getOffer();
        BroadleafCurrency currency = offerHolder.getCurrency();

        OfferDiscountType discountType = offer.getDiscountType();
        Money adjustmentValue;
        if (currency != null) {
            adjustmentValue = new Money(currency);
        } else {
            adjustmentValue = new Money();
        }

        if (OfferDiscountType.AMOUNT_OFF.equals(discountType)) {
            adjustmentValue = new Money(offerUnitValue, currency);
        }

        if (OfferDiscountType.FIX_PRICE.equals(discountType)) {
            adjustmentValue = currentPriceDetailValue.subtract(new Money(offerUnitValue, currency));
        }

        if (OfferDiscountType.PERCENT_OFF.equals(discountType)) {
            BigDecimal offerValue = currentPriceDetailValue.getAmount().multiply(offerUnitValue.divide(new BigDecimal("100"), 5, RoundingMode.HALF_EVEN));

            if (rounding.isRoundOfferValues()) {
                offerValue = offerValue.setScale(rounding.getRoundingScale(), rounding.getRoundingMode());
            }
            adjustmentValue = new Money(offerValue, currency);
        }

        if (currentPriceDetailValue.lessThan(adjustmentValue)) {
            adjustmentValue = currentPriceDetailValue;
        }
        return adjustmentValue;
    }

    @SuppressWarnings("unchecked")
    public static BigDecimal determineOfferUnitValue(Offer offer, PromotableCandidateItemOffer promotableCandidateItemOffer) {
        if (offer instanceof AdvancedOffer) {
            AdvancedOffer advancedOffer = (AdvancedOffer) offer;
            if (advancedOffer.isTieredOffer()) {
                int quantity = promotableCandidateItemOffer.calculateTargetQuantityForTieredOffer();
                List<OfferTier> offerTiers = advancedOffer.getOfferTiers();

                Collections.sort(offerTiers, new BeanComparator("minQuantity"));

                OfferTier maxTier = null;
                //assuming that promotableOffer.getOffer()).getOfferTiers() is sorted already
                for (OfferTier currentTier : offerTiers) {

                    if (quantity >= currentTier.getMinQuantity()) {
                        maxTier = currentTier;
                    } else {
                        break;
                    }
                }

                if (maxTier != null) {
                    return maxTier.getAmount();
                }

                if (OfferDiscountType.FIX_PRICE.equals(offer.getDiscountType())) {
                    // Choosing an arbitrary large value.    The retail / sale price will be less than this,
                    // so the offer will not get selected.
                    return BigDecimal.valueOf(Integer.MAX_VALUE);
                } else {
                    return BigDecimal.ZERO;
                }
            }
        }
        return offer.getValue();
    }

}


text:
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="content-type" content="text/html" charset="UTF-8"/>
		<title>TP JSON</title>
		<script type="text/javascript" src="tpjson.js"></script>
		<style>
			a {
				display: block;
			}
		</style>
	</head>
	<body>
	</body>
</html>


text:
import codecs
import unittest
from yiddish_solr import *

class SolrYiddishTest(unittest.TestCase):
    """a simple test suite to check that my connection with Solr is executing
    queries correctly and returning results, as well as other functionalities
    within the yiddish_solr file

    """

    def setUp(self):
        self.rms = RednMitSolr("http://localhost:8983/solr")
        self.yiddish_queries = map(lambda x: codecs.decode(x,"UTF-8"),\
                                   ["לעצט", "ברודער", "קאמוניזם"])
        self.articles = self.rms.all_documents
        self.queries,self.regexes = zip(*read_queries("resources/yid_regex"))

    def test_simple(self):
        """make sure we can handle a simple single query"""
        resp = self.rms.connection.search(self.yiddish_queries[0], rows=50)
        self.assertGreater(len(resp.docs), 0)

    def test_get_all_docs(self):
        """making sure we have access to all of the documents"""
        resp = self.rms.connection.search("*:*", rows=100)
        self.assertEqual(len(resp.docs), 50)

    def test_batch_query(self):
        """see if the class function works properly"""
        self.resp = self.rms.batch_query(self.yiddish_queries)
        self.assertEqual(len(self.resp), 3)

    def test_regex_matching(self):
        """make sure the regular expression works on a synthetic example"""
        yd = YiddishDocument(36, codecs.decode("מיין ברודער", "UTF-8"), "")
        bruder = self.regexes[0]
        match = self.rms.get_articles_gold([bruder])
        self.assertEqual(36, list(match[0])[0])

    def test_regex_all_docs(self):
        """test that the regular expressions are at least matching a single doc"""
        match = self.rms.get_articles_gold(self.regexes)
        self.assertTrue(any(map(lambda x: len(x) > 0, match)))

    def test_solr_all_docs(self):
        """test that our specific queries are bringing back docs"""
        responses = self.rms.batch_query(self.queries)
        self.assertTrue(any(map(lambda x: len(x) > 0, responses)))

if __name__ == "__main__":
    unittest.main()


text:
import React from 'react';
import { useTheme } from '../Theme';

const ThemePicker = () => {
   const { font, darkMode, setFont, toggleDarkMode } = useTheme();
   const onFontChange = (e) => {
      setFont(e.target.value);
   };
   const onThemeChange = toggleDarkMode;

   return (

                     Font family

                     <select
                        className="env-form-input"
                        id="selectFont"
                        value={font}
                        onChange={onFontChange}
                     >
                        <optgroup label="Web Safe">
                           <option value="">Helvetica</option>
                           <option value="georgia">Georgia</option>
                        </optgroup>
                        <optgroup label="Web Font - Serif">
                           <option value="frank-ruhl">Frank Ruhl Libre</option>
                        </optgroup>
                        <optgroup label="Web Font - Sans Serif">
                           <option value="roboto">Roboto</option>
                           <option value="open-sans">Open Sans</option>
                           <option value="source-sans">Source Sans</option>
                        </optgroup>
                     </select>

                        <input
                           type="checkbox"
                           checked={darkMode}
                           onChange={onThemeChange}
                        />
                        Dark Theme

   );
};

export default ThemePicker;


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Dialog Example</title>
	<link rel="stylesheet" href="https://filamentgroup.github.io/demo-head/demohead.css">
	<link rel="stylesheet" href="docs.css">
	<link rel="stylesheet" href="../lib/xrayhtml.css">
	<link rel="stylesheet" href="../src/dialog.css">

Demo of Dialog
				Just a simple, minimal jQuery dialog with typical interactivity

Code

Issues

Dialog Examples

The dialog itself is an element with a class of dialog.  It'll auto-initialize on dom-ready.

Typical dialog example

This is a dialog

				Close

			Open Dialog

Markup broken down

The dialog itself is an element with a class of dialog:

<div class="dialog">Content here...</div>

To open it via a link, give the dialog an id and link to that ID somewhere on the page:

<div class="dialog" id="mydialog">Content here....</div>

<a href="#mydialog">Open Dialog</a>

Once open, the dialog can be closed via back button, escape key, clicking or tapping the overlay screen (if styled to be visible).

You can also add a close link by adding a link anywhere in the dialog element with an attribute data-dialog-close.

<div class="dialog" id="mydialog">
			<p>This is a dialog</p>
			<a href="#" data-dialog-close>Close</a>
		</div>

Rather than using a null # href for the close link, we find it's nice to link back to the link that opened the dialog, just in case the user scrolled away from that place while the dialog was open. You can do this by giving the opener link an id attribute and linking to that ID from the close link:

<div class="dialog" id="mydialog">
			<p>This is a dialog</p>
			<a href="#mydialog-btn" data-dialog-close>Close</a>
		</div>

		<a href="#mydialog" id="mydialog-btn">Open Dialog</a>

Lastly, it's helpful to add a title for the dialog and identify it as such for assistive technology. You can either do that by setting the aria-labelledby attribute on the dialog element to reference the ID of another element that acts as its title, or by adding an aria-label attribute with a text value that acts as a title for the dialog. The demos on this page use aria-label.

<div class="dialog" id="mydialog" aria-label="dialog example">Content here...</div>

Modal and non-modal

Much of the presentation of the dialog is configured in CSS.
			The default modal appearance is applied to .dialog-background element that the script generates by default.
			If you want to style this element differently, just style that selector however you'd like:

.dialog-background {
			background: red;
		}

You can also configure the background to be transparent via the dialog markup, by using the data-transbg attribute:

<div class="dialog" data-transbg>Content here...</div>

If you'd prefer to have no background element at all, you can use the data-dialog-nobg attribute:

<div class="dialog" data-dialog-nobg>Content here...</div>

Opening and closing programatically

You can open and close the dialog via JavaScript by triggering an open or close event:

// open:
		$( "#mydialog" ).trigger( "dialog-open" );

		// close:
		$( "#mydialog" ).trigger( "dialog-close" );

Ajax linking

You can pull another page into a dialog by adding a data-dialog-link attribute to a link.

		Open in dialog

Additional external dialog with a # in its href, just for testing purposes:

		Open in dialog

Adding a class via ajax linking

To set classes on the ajax dialog container, you can specify classes in a data-dialog-addclass attribute on the anchor:

	Open in dialog

Adding a label via ajax linking

To set the aria-label or aria-labelledby attributes on the ajax dialog container, you can specify a value in a data-dialog-label or data-dialog-labelledby attribute on the anchor:

Open in dialog

Iframe linking

You can pull another page into a dialog in an iframe by adding a data-dialog-iframe attribute to a data-dialog-link link.

		Open in dialog

"Nested" Dialogs

Dialogs can open without closing already-open dialogs, and they'll close in the order they were opened.

This is a dialog

Open the first Dialog on the page

Close

			Open Dialog

Non-history Dialogs

			By default, dialogs are re-openable via the back or forward button, and
			can be deep-linked via the hash. To opt out of this behavior, use
			the data-dialog-history="false" attribute and value on the
			dialog or a dialog link. History tracking can be turned of globally by
			setting a property on the dialog component
			constructor, window.Dialog.history = false

This is a no-history dialog

Open the first Dialog on the page (that one does have history!)

Close

			Open Dialog

		Open Non-history Ajax Dialog

Dialog styled to be visible at some breakpoints

If a dialog is styled to be visible and non-closeable at any breakpoint, the JavaScript will detect that and remove the dialog's role and tabindex attributes so that its role in the page is communicated accurately to assistive technology.
			This happens both upon initialization and whenever the viewport is resized.

To take advantage of this accessibility feature, the following criteria must be met in your dialog's CSS:

The dialog element's CSS display property does not equal "none"

The dialog element's CSS visibility property does not equal "hidden"

The dialog close link's (if it is in the markup) CSS display property equals "none"

The dialog background screen's CSS display property equals "none"

The following dialog uses CSS to display it as static content at wider breakpoints, as well as hiding the elements associated with deeming the dialog non-closeable.

This is a dialog

				<form action="">
					<input type="text" placeholder="sample focusable element to test focus handling">
				</form>
				Close

			Open Dialog

Dialog is taller than the document

This is a dialog

				Close

< 600px: 5000px height

> 600px: 10000px height

			Open Dialog


text:
package org.apache.camel.component.nsq;

import java.util.concurrent.ExecutorService;

import com.github.brainlag.nsq.NSQConsumer;
import com.github.brainlag.nsq.NSQMessage;
import com.github.brainlag.nsq.ServerAddress;
import com.github.brainlag.nsq.callbacks.NSQMessageCallback;
import com.github.brainlag.nsq.lookup.DefaultNSQLookup;
import com.github.brainlag.nsq.lookup.NSQLookup;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePattern;
import org.apache.camel.ExtendedExchange;
import org.apache.camel.Processor;
import org.apache.camel.support.DefaultConsumer;
import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The nsq consumer.
 */
public class NsqConsumer extends DefaultConsumer {

    private static final Logger LOG = LoggerFactory.getLogger(NsqConsumer.class);

    NSQConsumer consumer;

    private final Processor processor;
    private ExecutorService executor;
    private boolean active;
    private final NsqConfiguration configuration;

    public NsqConsumer(NsqEndpoint endpoint, Processor processor) {
        super(endpoint, processor);
        this.processor = processor;
        this.configuration = getEndpoint().getConfiguration();
    }

    @Override
    public NsqEndpoint getEndpoint() {
        return (NsqEndpoint) super.getEndpoint();
    }

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        LOG.debug("Starting NSQ Consumer");
        executor = getEndpoint().createExecutor();

        NSQLookup lookup;

        LOG.debug("Getting NSQ Connection");
        if (ObjectHelper.isEmpty(configuration.getCustomNSQLookup())) {
            lookup = new DefaultNSQLookup();
        } else {
            lookup = configuration.getCustomNSQLookup();
        }

        for (ServerAddress server : configuration.getServerAddresses()) {
            lookup.addLookupAddress(server.getHost(),
                    server.getPort() == 0 ? configuration.getLookupServerPort() : server.getPort());
        }

        consumer = new NSQConsumer(
                lookup, configuration.getTopic(), configuration.getChannel(), new CamelNsqMessageHandler(),
                getEndpoint().getNsqConfig());
        consumer.setLookupPeriod(configuration.getLookupInterval());
        consumer.setExecutor(getEndpoint().createExecutor());
        consumer.start();
    }

    @Override
    protected void doStop() throws Exception {

        LOG.debug("Stopping NSQ Consumer");
        if (consumer != null) {
            consumer.shutdown();
        }
        if (executor != null) {
            if (getEndpoint() != null && getEndpoint().getCamelContext() != null) {
                getEndpoint().getCamelContext().getExecutorServiceManager().shutdownNow(executor);
            } else {
                executor.shutdownNow();
            }
        }

        executor = null;

        super.doStop();
    }

    class CamelNsqMessageHandler implements NSQMessageCallback {

        @Override
        public void message(NSQMessage msg) {
            LOG.debug("Received Message: {}", msg);
            Exchange exchange = getEndpoint().createExchange(ExchangePattern.InOnly);
            exchange.getIn().setBody(msg.getMessage());
            exchange.getIn().setHeader(NsqConstants.NSQ_MESSAGE_ID, msg.getId());
            exchange.getIn().setHeader(NsqConstants.NSQ_MESSAGE_ATTEMPTS, msg.getAttempts());
            exchange.getIn().setHeader(NsqConstants.NSQ_MESSAGE_TIMESTAMP, msg.getTimestamp());
            try {
                if (configuration.getAutoFinish()) {
                    msg.finished();
                } else {
                    exchange.adapt(ExtendedExchange.class)
                            .addOnCompletion(new NsqSynchronization(msg, (int) configuration.getRequeueInterval()));
                }
                processor.process(exchange);
            } catch (Exception e) {
                if (!configuration.getAutoFinish()) {
                    msg.requeue((int) configuration.getRequeueInterval());
                }
                getExceptionHandler().handleException("Error during processing", exchange, e);
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015-2022 Micro Focus or one of its affiliates.

    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.

-->
<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>com.github.cafaudit</groupId>
    <artifactId>caf-audit-schema</artifactId>

    <parent>
        <groupId>com.github.cafaudit</groupId>
        <artifactId>audit-service-aggregator</artifactId>
        <version>3.10.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.activation</groupId>
            <artifactId>jakarta.activation-api</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-xjc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>xsdtojava</goal>
                        </goals>
                        <configuration>
                            <sourceRoot>${basedir}/target/generated-sources/src/main/java</sourceRoot>
                            <xsdOptions>
                                <xsdOption>
                                    <xsd>src/main/resources/schema/AuditedApplication.xsd</xsd>
                                    <packagename>com.hpe.caf.auditing.schema</packagename>
                                </xsdOption>
                            </xsdOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>**/*.xsd</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
module.exports = function(app, passport) {

// normal routes ===============================================================

    // show the home page (will also have our login links)
    app.get('/', function(req, res) {
        res.render('../app/auth/index.ejs');
    });

    // PROFILE SECTION =========================
    app.get('/profile', isLoggedIn, function(req, res) {
        res.render('../app/index.ejs', {
            user : req.user
        });
    });

    // LOGOUT ==============================
    app.get('/logout', function(req, res) {
        req.logout();
        res.redirect('/');
    });

// =============================================================================
// AUTHENTICATE (FIRST LOGIN) ==================================================
// =============================================================================

    // locally --------------------------------
        // LOGIN ===============================
        // show the login form
        app.get('/login', function(req, res) {
            res.render('../app/auth/login.ejs', { message: req.flash('loginMessage') });
        });

        // process the login form
        app.post('/login', passport.authenticate('local-login', {
            successRedirect : '/profile', // redirect to the secure profile section
            failureRedirect : '/login', // redirect back to the signup page if there is an error
            failureFlash : true // allow flash messages
        }));

        // SIGNUP =================================
        // show the signup form
        app.get('/signup', function(req, res) {
            res.render('../app/auth/signup.ejs', { message: req.flash('signupMessage') });
        });

        // process the signup form
        app.post('/signup', passport.authenticate('local-signup', {
            successRedirect : '/profile', // redirect to the secure profile section
            failureRedirect : '/signup', // redirect back to the signup page if there is an error
            failureFlash : true // allow flash messages
        }));

// =============================================================================
// AUTHORIZE (ALREADY LOGGED IN / CONNECTING OTHER SOCIAL ACCOUNT) =============
// =============================================================================

    // locally --------------------------------
        app.get('/connect/local', function(req, res) {
            res.render('../app/auth/connect-local.ejs', { message: req.flash('loginMessage') });
        });
        app.post('/connect/local', passport.authenticate('local-signup', {
            successRedirect : '/profile', // redirect to the secure profile section
            failureRedirect : '/connect/local', // redirect back to the signup page if there is an error
            failureFlash : true // allow flash messages
        }));

// =============================================================================
// UNLINK ACCOUNTS =============================================================
// =============================================================================
// used to unlink accounts. for social accounts, just remove the token
// for local account, remove email and password
// user account will stay active in case they want to reconnect in the future

    // local -----------------------------------
    app.get('/unlink/local', isLoggedIn, function(req, res) {
        var user            = req.user;
        user.local.email    = undefined;
        user.local.password = undefined;
        user.save(function(err) {
            res.redirect('/profile');
        });
    });

};

// route middleware to ensure user is logged in
function isLoggedIn(req, res, next) {
    if (req.isAuthenticated())
        return next();

    res.redirect('/');
}


text:
using UnityEngine;
using System.Collections;

public class Recycler : MonoBehaviour {

    public Transform startPoint;
    public Transform endPoint;

    // Use this for initialization
    void Start () {

	}

	// Update is called once per frame
	void Update () {
        if(transform.position.x < endPoint.position.x)
        {
            float gap = transform.position.x - endPoint.position.x;
            transform.position = new Vector3(startPoint.position.x+gap,transform.position.y,transform.position.z);
        }

	}
}


text:
/**
 * Definition for a binary tree node.
 * function TreeNode(val) {
 *     this.val = val;
 *     this.left = this.right = null;
 * }
 */
/**
 * @param {number[]} preorder
 * @param {number[]} inorder
 * @return {TreeNode}
 */
var buildTree = function(preorder, inorder) {

    var pLen = preorder.length;
    var iLen = inorder.length;

    return getRoot(preorder, inorder, 0, pLen-1, 0, iLen-1);
};

function getRoot(preorder, inorder, pStart, pEnd, iStart, iEnd) {
    if(pStart > pEnd || iStart > iEnd){
        return null;
    }

    var value = preorder[pStart];
    var node = new TreeNode(value);
    var index = inorder.indexOf(value);

    node.left = getRoot(preorder, inorder, pStart+1, index-iStart+pStart, iStart, index-1);
    node.right = getRoot(preorder, inorder, index-iStart+pStart+1, pEnd, index+1, iEnd);

    return node;
}


text:
<!--

  Copyright (c) 2001, 2002, 2003 Steven Knight

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:

  The above copyright notice and this permission notice shall be included
  in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
  KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-->

<blockquote>
 <para>

  Copyright (c) 2001 Steven Knight

  Portions of this document, by the same author, were previously
  published Copyright 2000 by CodeSourcery LLC, under the Software Carpentry
  Open Publication License, the terms of which are available at
  <ulink url="http://www.software-carpentry.com/openpub-license.html">
   http://www.software-carpentry.com/openpub-license.html
  </ulink>.

 </para>
</blockquote>


text:
namespace download {
class BackgroundDownloadService;
}  // namespace download

namespace network {
class SharedURLLoaderFactory;
}  // namespace network

class OptimizationGuideLogger;
class PrefService;

namespace optimization_guide {

enum class OptimizationGuideDecision;
class OptimizationGuideStore;
class OptimizationTargetModelObserver;
class PredictionModelDownloadManager;
class PredictionModelFetcher;
class ModelInfo;

// A PredictionManager supported by the optimization guide that makes an
// OptimizationTargetDecision by evaluating the corresponding prediction model
// for an OptimizationTarget.
class PredictionManager : public PredictionModelDownloadObserver {
 public:
  // BackgroundDownloadService is only available once the profile is fully
  // initialized and that cannot be done as part of |Initialize|. Get a provider
  // to retrieve the service when it is needed.
  using BackgroundDownloadServiceProvider =
      base::OnceCallback<download::BackgroundDownloadService*(void)>;

  // Callback to whether component updates are enabled for the browser.
  using ComponentUpdatesEnabledProvider = base::RepeatingCallback<bool(void)>;

  PredictionManager(
      base::WeakPtr<OptimizationGuideStore> model_and_features_store,
      scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
      PrefService* pref_service,
      bool off_the_record,
      const std::string& application_locale,
      const base::FilePath& models_dir_path,
      OptimizationGuideLogger* optimization_guide_logger,
      BackgroundDownloadServiceProvider background_download_service_provider,
      ComponentUpdatesEnabledProvider component_updates_enabled_provider);

  PredictionManager(const PredictionManager&) = delete;
  PredictionManager& operator=(const PredictionManager&) = delete;

  ~PredictionManager() override;

  // Adds an observer for updates to the model for |optimization_target|.
  //
  // It is assumed that any model retrieved this way will be passed to the
  // Machine Learning Service for inference.
  void AddObserverForOptimizationTargetModel(
      proto::OptimizationTarget optimization_target,
      const absl::optional<proto::Any>& model_metadata,
      OptimizationTargetModelObserver* observer);

  // Removes an observer for updates to the model for |optimization_target|.
  //
  // If |observer| is registered for multiple targets, |observer| must be
  // removed for all observed targets for in order for it to be fully
  // removed from receiving any calls.
  void RemoveObserverForOptimizationTargetModel(
      proto::OptimizationTarget optimization_target,
      OptimizationTargetModelObserver* observer);

  // Set the prediction model fetcher for testing.
  void SetPredictionModelFetcherForTesting(
      std::unique_ptr<PredictionModelFetcher> prediction_model_fetcher);

  PredictionModelFetcher* prediction_model_fetcher() const {
    return prediction_model_fetcher_.get();
  }

  // Set the prediction model download manager for testing.
  void SetPredictionModelDownloadManagerForTesting(
      std::unique_ptr<PredictionModelDownloadManager>
          prediction_model_download_manager);

  PredictionModelDownloadManager* prediction_model_download_manager() const {
    return prediction_model_download_manager_.get();
  }

  base::WeakPtr<OptimizationGuideStore> model_and_features_store() const {
    return model_and_features_store_;
  }

  // Return the optimization targets that are registered.
  base::flat_set<proto::OptimizationTarget> GetRegisteredOptimizationTargets()
      const;

  // Override |clock_| for testing.
  void SetClockForTesting(const base::Clock* clock);

  // Override the model file returned to observers for |optimization_target|.
  // Use |TestModelInfoBuilder| to construct the model files. For
  // testing purposes only.
  void OverrideTargetModelForTesting(
      proto::OptimizationTarget optimization_target,
      std::unique_ptr<ModelInfo> model_info);

  // PredictionModelDownloadObserver:
  void OnModelReady(const proto::PredictionModel& model) override;
  void OnModelDownloadStarted(
      proto::OptimizationTarget optimization_target) override;
  void OnModelDownloadFailed(
      proto::OptimizationTarget optimization_target) override;

  std::vector<optimization_guide_internals::mojom::DownloadedModelInfoPtr>
  GetDownloadedModelsInfoForWebUI() const;

 protected:
  // Process |prediction_models| to be stored in the in memory optimization
  // target prediction model map for immediate use and asynchronously write the
  // models to the model and features store to be persisted.
  void UpdatePredictionModels(
      const google::protobuf::RepeatedPtrField<proto::PredictionModel>&
          prediction_models);

 private:
  friend class PredictionManagerTestBase;

  // Called on construction to initialize the prediction model.
  // |background_dowload_service_provider| can provide the
  // BackgroundDownloadService if needed to download models.
  void Initialize(
      BackgroundDownloadServiceProvider background_dowload_service_provider);

  // Called to make a request to fetch models from the remote Optimization Guide
  // Service. Used to fetch models for the registered optimization targets.
  // |is_first_model_fetch| indicates whether this is the first model fetch
  // happening at startup, and is used to record metrics.
  void FetchModels(bool is_first_model_fetch);

  // Callback when the models have been fetched from the remote Optimization
  // Guide Service and are ready for parsing. Processes the prediction models in
  // the response and stores them for use. The metadata entry containing the
  // time that updates should be fetched from the remote Optimization Guide
  // Service is updated, even when the response is empty.
  void OnModelsFetched(const std::vector<proto::ModelInfo> models_request_info,
                       absl::optional<std::unique_ptr<proto::GetModelsResponse>>
                           get_models_response_data);

  // Callback run after the model and host model features store is fully
  // initialized. The prediction manager can load models from
  // the store for registered optimization targets. |store_is_ready_| is set to
  // true.
  void OnStoreInitialized(
      BackgroundDownloadServiceProvider background_dowload_service_provider);

  // Callback run after prediction models are stored in
  // |model_and_features_store_|.
  void OnPredictionModelsStored();

  // Load models for every target in |optimization_targets| that have not yet
  // been loaded from the store.
  void LoadPredictionModels(
      const base::flat_set<proto::OptimizationTarget>& optimization_targets);

  // Callback run after a prediction model is loaded from the store.
  // |prediction_model| is used to construct a PredictionModel capable of making
  // prediction for the appropriate |optimization_target|.
  void OnLoadPredictionModel(
      proto::OptimizationTarget optimization_target,
      bool record_availability_metrics,
      std::unique_ptr<proto::PredictionModel> prediction_model);

  // Callback run after a prediction model is loaded from a command-line
  // override.
  void OnPredictionModelOverrideLoaded(
      proto::OptimizationTarget optimization_target,
      std::unique_ptr<proto::PredictionModel> prediction_model);

  // Process loaded |model| into memory. Return true if a prediction
  // model object was created and successfully stored, otherwise false.
  bool ProcessAndStoreLoadedModel(const proto::PredictionModel& model);

  // Return whether the model stored in memory for |optimization_target| should
  // be updated based on what's currently stored and |new_version|.
  bool ShouldUpdateStoredModelForTarget(
      proto::OptimizationTarget optimization_target,
      int64_t new_version) const;

  // Updates the in-memory model file for |optimization_target| to
  // |prediction_model_file|.
  void StoreLoadedModelInfo(proto::OptimizationTarget optimization_target,
                            std::unique_ptr<ModelInfo> prediction_model_file);

  // Post-processing callback invoked after processing |model|.
  void OnProcessLoadedModel(const proto::PredictionModel& model, bool success);

  // Return the time when a prediction model fetch was last attempted.
  base::Time GetLastFetchAttemptTime() const;

  // Set the last time when a prediction model fetch was last attempted to
  // |last_attempt_time|.
  void SetLastModelFetchAttemptTime(base::Time last_attempt_time);

  // Return the time when a prediction model fetch was last successfully
  // completed.
  base::Time GetLastFetchSuccessTime() const;

  // Set the last time when a fetch for prediction models last succeeded to
  // |last_success_time|.
  void SetLastModelFetchSuccessTime(base::Time last_success_time);

  // Schedule first fetch for models if enabled for this profile.
  void MaybeScheduleFirstModelFetch();

  // Schedule |fetch_timer_| to fire based on:
  // 1. The update time for models in the store and
  // 2. The last time a fetch attempt was made.
  void ScheduleModelsFetch();

  // Notifies observers of |optimization_target| that the model has been
  // updated.
  void NotifyObserversOfNewModel(proto::OptimizationTarget optimization_target,
                                 const ModelInfo& model_info);

  // A map of optimization target to the model file containing the model for the
  // target.
  base::flat_map<proto::OptimizationTarget, std::unique_ptr<ModelInfo>>
      optimization_target_model_info_map_;

  // The map from optimization targets to feature-provided metadata that have
  // been registered with the prediction manager.
  base::flat_map<proto::OptimizationTarget, absl::optional<proto::Any>>
      registered_optimization_targets_and_metadata_;

  // The map from optimization target to observers that have been registered to
  // receive model updates from the prediction manager.
  std::map<proto::OptimizationTarget,
           base::ObserverList<OptimizationTargetModelObserver>>
      registered_observers_for_optimization_targets_;

  // The fetcher that handles making requests to update the models and host
  // model features from the remote Optimization Guide Service.
  std::unique_ptr<PredictionModelFetcher> prediction_model_fetcher_;

  // The downloader that handles making requests to download the prediction
  // models. Can be null if model downloading is disabled.
  std::unique_ptr<PredictionModelDownloadManager>
      prediction_model_download_manager_;

  // TODO(crbug/1183507): Remove host model features store and all relevant
  // code, and deprecate the proto field too.
  // The optimization guide store that contains prediction models and host
  // model features from the remote Optimization Guide Service.
  base::WeakPtr<OptimizationGuideStore> model_and_features_store_;

  // A stored response from a model and host model features fetch used to hold
  // models to be stored once host model features are processed and stored.
  std::unique_ptr<proto::GetModelsResponse> get_models_response_data_to_store_;

  // The URL loader factory used for fetching model and host feature updates
  // from the remote Optimization Guide Service.
  scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;

  // The logger that plumbs the debug logs to the optimization guide
  // internals page. Not owned. Guaranteed to outlive |this|, since the logger
  // and |this| are owned by the optimization guide keyed service.
  raw_ptr<OptimizationGuideLogger> optimization_guide_logger_;

  // A reference to the PrefService for this profile. Not owned.
  raw_ptr<PrefService> pref_service_ = nullptr;

  // The repeating callback that will be used to determine if component updates
  // are enabled.
  ComponentUpdatesEnabledProvider component_updates_enabled_provider_;

  // Time the prediction manager got initialized.
  base::TimeTicks init_time_;

  // The timer used to schedule fetching prediction models and host model
  // features from the remote Optimization Guide Service.
  base::OneShotTimer fetch_timer_;

  // The clock used to schedule fetching from the remote Optimization Guide
  // Service.
  raw_ptr<const base::Clock> clock_;

  // Whether the |model_and_features_store_| is initialized and ready for use.
  bool store_is_ready_ = false;

  // Whether host model features have been loaded from the store and are ready
  // for use.
  bool host_model_features_loaded_ = false;

  // Whether the profile for this PredictionManager is off the record.
  bool off_the_record_ = false;

  // The locale of the application.
  std::string application_locale_;

  // The path to the directory containing the models.
  base::FilePath models_dir_path_;

  SEQUENCE_CHECKER(sequence_checker_);

  // Used to get |weak_ptr_| to self on the UI thread.
  base::WeakPtrFactory<PredictionManager> ui_weak_ptr_factory_{this};
};

}  // namespace optimization_guide

#endif  // COMPONENTS_OPTIMIZATION_GUIDE_CORE_PREDICTION_MANAGER_H_


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Le Genre Amanita Persoon (Lons-le-Saunier) 145 (1918)

#### Original name
Amanita vaginata f. aurantiofulva E.-J. Gilbert

### Remarks
null


text:
Rails.configuration.to_prepare do
  Ecm::Tags::Configuration.taggable_classes.each do |taggable|
    puts "Including Model::Ecm::Tags::TaggableConcern in #{taggable}"
    taggable.send(:include, Model::Ecm::Tags::TaggableConcern)
  end
end


text:
package com.nortal.jroad.client.ehis;

import com.nortal.jroad.client.ehis.types.ee.riik.xtee.ehis.producers.producer.ehis.*;
import com.nortal.jroad.client.exception.XRoadServiceConsumptionException;

import java.math.BigInteger;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * @author Margus Hanni
 */
public interface EhisXTeeService {

  /**
   * ehis.tootukassale_kehtivad.v1 service.
   */
  List<TootukassaleKehtivadIsik> findTootukassaleKehtivad(Date algkuup, Date loppkuup, String... isikukoodid)
      throws XRoadServiceConsumptionException;

  /**
   * ehis.tootukassale_kehtivad_v2.v1 service.
   */
  List<TootukassaleKehtivadV2Isik> findTootukassaleKehtivadV2(Date algusKp, Date loppKp, String... isikukoodid)
      throws XRoadServiceConsumptionException;

  PolOppurVastus findPolOppur(String isikukood, Calendar algKp, Calendar loppKp) throws XRoadServiceConsumptionException;

  /**
   * ehis.tootukassale_oppimised_tellimus.v1 service.
   */
  TootukassaleOppimisedTellimusVastus submitTootukassaleOppimisedTellimusV1(Date algusKp, Date loppKp, BigInteger tkId, String... isikukoodid)
      throws XRoadServiceConsumptionException;

  /**
   * ehis.tootukassale_oppimised_vastus.v1 service.
   */
  TootukassaleOppimisedVastusVastus getTootukassaleOppimisedVastusV1(BigInteger tkId)
      throws XRoadServiceConsumptionException;

  /**
   * ehis.tootukassale_tegevusload.v1 service.
   */
  TootukassaleTegevusloadVastus getTootukassaleTegevusload(String registrikood, Date algusKp, Date loppKp)
      throws XRoadServiceConsumptionException;
}