text:
<?php
require_once("autoload.php");

$controllers = [
	'home' 			=> 'HomeController',
	'detail' 		=> 'DetailController',
	'upload'		=> 'UploadController',
	'register' 		=> 'RegistrationController',
	'tags'			=> 'TagsController',
	'login'			=> 'SessionController',
	'logout' 		=> 'SessionController',
	'mail_sent' 	=> 'MailController',
	'profile'   	=> 'ProfileController',
	'purchase'		=> 'PurchaseController',
	'pictures'		=> 'PicturesController',
	'checkout'		=> 'CheckoutController',
	'activation'	=> 'ActivationController',
	'user'			=> 'UserController',
	'admin'			=> 'AdminController',
	'payment'		=> 'PaymentController',
	'order'			=> 'OrderController',
	'special_offer'	=> 'SpecialOfferController',
	'current_offer'	=> 'CurrentOfferController',
	'impressum'		=> 'ImpressumController',
];
$dir = $_SERVER['DOCUMENT_ROOT'];
$directories = array_merge(glob("$dir/*" , GLOB_ONLYDIR), glob("$dir/**/*", GLOB_ONLYDIR));

$languages = [
	"de",
	"en"
];

function load_template($template, array $options = []) {
	$options["language"] = get_language();
	$options["languages"] = $GLOBALS['languages'];
	$options["controllers"] = $GLOBALS['controllers'];
	$options["page"] = $GLOBALS['page'];
	include $template;
}

function require_ajax(){
	$isAjax = isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND
	strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
	if(!$isAjax) {
		die("Access denied");
	}
}

function get_param($var, $default = null, $type = "GET") {
	if ($type === "GET")
		$method = $_GET;
	elseif ($type === "POST")
		$method = $_POST;
	//   $method = constant('$_' . $type);
	//  $method = ${'$_'.$type};
	if (isset($method) && isset($method[$var])) {
		return urldecode($method[$var]);
	}
	return $default;
}

function redirect($url, $statusCode = 303) {
	header('Location: ' . $url, true, $statusCode);
	die();
}

function current_user(){
	if(isset($_SESSION['user_id'])) return User::find_by(['id' => $_SESSION['user_id'] ]);
	return null;
}

/**
 * Determines the method by the http method and the url
 *
 * method   HTTP Verb   path
 * index    GET         <controller>/
 * show     GET         <controller>/:id
 * edit     GET         <controller>/:id/edit
 * newly    GET         <controller>/new
 * post     POST        <controller>/:id
 * delete   DELETE      <controller>/:id
 * update   PATCH       <controller>/:id
 * update   PUT         <controller>/:id
 *
 * @return mixed
 */
function determine_method(){
	$default_rgx = '/\w*\/\d{1,}(\?.+)?$/'; // /<whatever>/:id or /<whatever>/:id?what=a_shit
	$any_page = '/\w*[^\/\d](\?.+)?$/'; // /<whatever> or /<whatever>?what=a_shit
	$available_methods = [
		'post'   => [
			['rgx' => $default_rgx, 'method' => 'create'],
			['rgx' => $any_page, 'method' => 'create']
		],
		'get'    => [
			['rgx' => $default_rgx, 					'method' => 'show'],
			['rgx' => '/\w*\/\d{1,}\/edit(\?.+)?$/', 	'method' => 'edit'],
			['rgx' => '/\w*\/new(\?.+)?$/', 			'method' => 'newly'], //NOTICE new is a keyword...
			['rgx' => $any_page, 						'method' => 'index'],
		],
		'delete' => [
			['rgx' => $default_rgx,		'method' => 'delete'],
			['rgx' => $any_page, 		'method' => 'delete']
		],
		'patch'  => [
			['rgx' => $default_rgx, 'method' => 'update']
		],
		'put'    => [
			['rgx' => $default_rgx, 'method' => 'update']
		],
	];
	$url = $_SERVER['REQUEST_URI'];
	$methods = $available_methods[determine_http_method()];
	foreach($methods as $route){
		if(preg_match($route['rgx'], $url)) return $route['method'];
	}
	return null;
}
function determine_http_method(){
	$method = strtolower($_SERVER['REQUEST_METHOD']);
	return $method;
}

function get_controller($page){
	$class = $GLOBALS['controllers'][$page];
	return new $class();
}

function set_language(){
	$lang = get_param('lang');
	if($lang !== null && in_array($lang, $GLOBALS['languages'])){
		setcookie("lang", $lang, time() + (86400 * 30), "/");
		$_COOKIE['lang'] = $lang;
	} // 30 days
}

function get_language(){
	if(isset($_COOKIE['lang'])) return $_COOKIE['lang'];
	return 'de';
}


text:
package org.apache.ode.bpel.runtime.channels;

import org.apache.ode.jacob.Channel;

/**
 */
public interface LinkStatus extends Channel {

  void linkStatus(boolean value);

}

redpajama_set_name: RedPajamaGithub


text:
using Newtonsoft.Json.Linq;
using System.Linq;

namespace EDDiscovery.EliteDangerous.JournalEvents
{
    //When Written: when changing the task assignment of a member of crew
    //Parameters:
    //•	Name
    //•	Role

    public class JournalCrewAssign : JournalEntry
    {
        public JournalCrewAssign(JObject evt) : base(evt, JournalTypeEnum.CrewAssign)
        {
            Name = JSONHelper.GetStringDef(evt["Name"]);
            Role = JSONHelper.GetStringDef(evt["Role"]);
        }
        public string Name { get; set; }
        public string Role { get; set; }

        public static System.Drawing.Bitmap Icon { get { return EDDiscovery.Properties.Resources.crew; } }

    }
}


text:
'use strict';

var restify = require('restify')
  , domainMiddleware = require('../domain-middleware');

function initApi (customInit, send500) {
  var apiApp = restify.createServer();

  var domainMw = domainMiddleware(send500);
  apiApp.use(domainMw.middleware);

  customInit(apiApp, restify);
  return { domainMw: domainMw, apiApp: apiApp };
}

function postInitApi (apiApp, apiServer, customPostInit) {
  customPostInit(apiApp, apiServer, restify);
}

/**
 * Starts up API server.
 *
 * @name startApi
 * @private
 * @function
 * @param {Object}        opts
 * @param {Function}      opts.customInit     a custom app server initialization function that is called before server starts listening
 * @param {Function}      opts.customPostInit a custom app server initialization function that is called after server starts listening
 * @param {Function=}     opts.send500        function that is invoked with `(req, res)` when a server error occurs
 * @param {number}        opts.port           the port at which the server should listen
 * @param {EventEmitter}  opts.events         on which errors will be triggered if they are passed, otherwise errors are logged
 * @param {Function} cb called when server started listening
 */
var go = module.exports = function startApi (opts, cb) {
  var inited = initApi(opts.customInit, opts.send500);
  var apiApp = inited.apiApp;
  var domainMw = inited.domainMw;

  var apiServer = apiApp.listen(opts.port);

  domainMw.server = apiServer;

  domainMw.events.on('server-error', opts.events.emit.bind(opts.events, 'server-error'));
  domainMw.events.on('fatal-error', opts.events.emit.bind(opts.events, 'fatal-error'));

  apiServer.once('listening', function () {
    var address = apiServer.address();

    postInitApi(apiApp, apiServer, opts.customPostInit);
    cb(null, address);
  });
  return apiServer;
};


text:
/*
 * $Id$
 */

/*

Copyright (c) 2000-2016 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.

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
STANFORD UNIVERSITY 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.

Except as contained in this notice, the name of Stanford University shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Stanford University.

*/

package org.lockss.plugin.highwire;

import java.io.IOException;
import java.text.*;
import java.util.*;

import org.apache.commons.collections.ListUtils;
import org.lockss.config.ConfigManager;
import org.lockss.config.Configuration;
import org.lockss.crawler.CrawlSeed;
import org.lockss.daemon.*;
import org.lockss.daemon.PluginException.InvalidDefinition;
import org.lockss.plugin.ArchivalUnit.ConfigurationException;
import org.lockss.test.*;
import org.lockss.util.*;

public class TestHighWirePressH20CrawlSeedFactory extends LockssTestCase {

  protected MockLockssDaemon theDaemon;
  protected MockArchivalUnit mau = null;
  protected MockArchivalUnit oup_mau = null;
  protected MockAuState aus = new MockAuState();
  protected MockCrawlRule crawlRule = null;
  protected String permissionUrl = "http://www.example.com/permission.html";
  protected List<String> permissionUrls;
  protected String startUrl = "http://www.example.com/lockss-manifest/vol_20_manifest.dtl";
  protected List<String> startUrls;
  protected MockLinkExtractor extractor = new MockLinkExtractor();
  protected HighWirePressH20CrawlSeedFactory csf;
  protected CrawlSeed cs, oup_cs;
  protected MockServiceProvider msp;
  protected Configuration config;
  protected DateFormat df;

  public void setUp() throws Exception {
    super.setUp();

    theDaemon = getMockLockssDaemon();
    mau = new MockArchivalUnit();
    mau.setPlugin(new MockPlugin(theDaemon));
    mau.setAuId("MyMockTestAu");
    permissionUrls = ListUtil.list(permissionUrl);
    startUrls = ListUtil.list(startUrl);
    mau.setPermissionUrls(permissionUrls);
    mau.setStartUrls(startUrls);

    oup_mau = new MockArchivalUnit();
    oup_mau.setPlugin(new MockPlugin(theDaemon));
    oup_mau.setAuId("MyMockTestAu");

    config = ConfigManager.newConfiguration();
    config.put(ConfigParamDescr.YEAR.getKey(), "1988");
    config.put(ConfigParamDescr.BASE_URL.getKey(), "http://www.example.com/");
    mau.setConfiguration(config);
    csf = new HighWirePressH20CrawlSeedFactory();
    cs = csf.createCrawlSeed(new MockCrawler().new MockCrawlerFacade(mau));
    config.put(ConfigParamDescr.BASE_URL.getKey(), "http://www.oxfordjournals.org/");
    oup_mau.setConfiguration(config);
    oup_cs = csf.createCrawlSeed(new MockCrawler().new MockCrawlerFacade(oup_mau));
  }

  public void testNullAu() throws PluginException, ConfigurationException {
    try {
      // XXX fail("should throw because there is no au");
    } catch(IllegalArgumentException e) {
      assertMatchesRE("Valid ArchivalUnit", e.getMessage());
    }
  }

  public void testBadPermissionUrlListThrows()
      throws ConfigurationException, PluginException, IOException {

    mau.setStartUrls(null);
    mau.setPermissionUrls(null);
    try {
      cs.getPermissionUrls();
      fail("null permission url list should have thrown");
    } catch(InvalidDefinition e) {
      assertMatchesRE("non-null permission URL list", e.getMessage());
    }

    mau.setPermissionUrls(ListUtils.EMPTY_LIST);
    try {
      cs.getPermissionUrls();
      fail("empty permission url list should have thrown");
    } catch(InvalidDefinition e) {
      assertMatchesRE("non-null permission URL list", e.getMessage());
    }
  }

  public void testPermissionUrl()
      throws ConfigurationException, PluginException, IOException {
    assertEquals(permissionUrls, cs.getPermissionUrls());
  }

  public void testStartUrl()
      throws ConfigurationException, PluginException, IOException {
    assertEquals(startUrls, cs.getStartUrls());
  }

  public void testOupStartUrl()
      throws ConfigurationException, PluginException, IOException {
    List<String> startUrls = ListUtil.list("http://www.oxfordjournals.org/lockss-manifest/vol_20_manifest.dtl",
                                          "https://www.oxfordjournals.org/lockss-manifest/vol_20_manifest.dtl");
    oup_mau.setStartUrls(ListUtil.list("http://www.oxfordjournals.org/lockss-manifest/vol_20_manifest.dtl"));
    assertEquals(startUrls, oup_cs.getStartUrls());
  }

  public void testIsFailOnStartUrl() {
    assertTrue(cs.isFailOnStartUrlError());
  }

}


text:
var http = require('http'),
    httpProxy = require('http-proxy'),
    colors = require('colors'),
    connect = require('connect');

var selects = [];
var simpleselect = {};

simpleselect.query = 'head';
simpleselect.func = function (node) {
    var out = '';
    node.createWriteStream({ outer: false }).end(out)
}

selects.push(simpleselect);

//
// Basic Connect App
//

var app = connect();

var proxy = httpProxy.createProxyServer({
   target: 'http://localhost:9000'
})

app.use(require('../')([], selects));
app.use(function (req, res) {
         proxy.web(req, res);
      })

http.createServer(app).listen(8000);

http.createServer(function (req, res) {
  res.writeHead(200, { 'Content-Type': 'text/html' });
  var output =  '
A simple example of injecting some css to rotate an image into a page before it is rendered.
'
      output += '<image src="http://i.imgur.com/fpMGL.png" />

';
  res.end(output);
}).listen(9000);


text:
//
//  InterfaceController.m
//  Communication WatchKit Extension
//
//  Created by Samrat on 2/26/15.
//  Copyright (c) 2015 footyapps27. All rights reserved.
//

#import "InterfaceController.h"

@interface InterfaceController()

@end

@implementation InterfaceController

- (void)awakeWithContext:(id)context {
    [super awakeWithContext:context];

    // Configure interface objects here.
    [self.lblData setHidden:YES];
}

- (void)willActivate {
    // This method is called when watch view controller is about to be visible to user
    [super willActivate];
}

- (void)didDeactivate {
    // This method is called when watch view controller is no longer visible
    [super didDeactivate];
}

/* Request the data from the parent application. */
- (IBAction)btnDataRequested
{
    [WKInterfaceController openParentApplication:[NSDictionary dictionary] reply:^(NSDictionary *replyInfo, NSError *error) {

        NSString *strData = replyInfo[@"key"];
        [self.lblData setText:strData];
        [self.lblData setHidden:NO];
    }];
}
@end


text:
package com.pivotal.gemfirexd.internal.iapi.db;

import com.pivotal.gemfirexd.internal.iapi.error.PublicAPI;
import com.pivotal.gemfirexd.internal.iapi.error.StandardException;
import com.pivotal.gemfirexd.internal.iapi.sql.conn.ConnectionUtil;
import com.pivotal.gemfirexd.internal.iapi.sql.conn.LanguageConnectionContext;

import java.sql.SQLException;

/**
 *
 * ConnectionInfo class provides static methods for getting information
 * related to a JDBC connection.
 *
 * When called from within the query language,
 * each method returns information about the connection from which it was called.
 *

 * Use the methods of this class only within an SQL-J statement; do not call
 * them directly.
 */

public abstract class ConnectionInfo
{

	/** no requirement for a constructor */
	private ConnectionInfo() {}

	/**
	 * Get the last autoincrement value inserted into the column by
	 * a statement in this connection.

 In JDBC 3.0 an application should use the standard methods provided by
	 JDBC 3.0 to obtain generated key values. See java.sql.Statement.getGeneratedKeys().
	 *
	 * @param 	schemaName		Name of the schema.
	 * @param	tableName		Name of the table.
	 * @param 	columnName		Name of the column.
	 *
	 * @return  the last value to be inserted into the named autoincrement
	 * column by this connection. Returns null if this connection has never
	 * inserted into this column.
	 *
	 * @exception SQLException if the current connection could not be
	 * 			  established properly.
	 */
	public static Long lastAutoincrementValue(String schemaName,
											  String tableName,
											  String columnName)
			throws SQLException
	{
		// a static method can manipulate lcc?
		LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
		return lcc.lastAutoincrementValue(schemaName, tableName, columnName);
	}

	/**
	 * INTERNAL USE ONLY
	 * (THIS METHOD MAY BE REMOVED IN A FUTURE RELEASE.)
	 * @throws SQLException on error
	 **/
	public static long nextAutoincrementValue(String schemaName,
											  String tableName,
											  String columnName
											  )
	     throws SQLException
	{
		LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
		try
		{
			return
				lcc.nextAutoincrementValue(schemaName, tableName, columnName);
		}
		catch (StandardException se)
		{
			throw PublicAPI.wrapStandardException(se);
		}
	}
}


text:
require File.dirname(__FILE__) + '/test_helper'
require File.dirname(__FILE__) + '/cache_store_behavior.rb'

# Most tests borrowed from the Rails tests
# http://github.com/rails/rails/blob/master/activesupport/test/caching_test.rb

class LocalmemcacheStoreTest < ActiveSupport::TestCase

  def setup
    @cache = ActiveSupport::Cache.lookup_store(:localmemcache_store,
      { :namespace => 'lmc_store_test' })
    @cache.clear
    @cache.silence!
    @cache.logger = Logger.new("/dev/null")
  end

  test "write a value to the cache" do
    assert_nothing_raised do
      value = :value
      ret = @cache.write :key, value
      assert_equal ret, value
    end
  end

  test "read a cached value" do
    assert_nothing_raised do
      value = :value
      @cache.write :key, value
      assert_equal value, @cache.read(:key)
    end
  end

  test "entry expires" do
    value = :value
    @cache.write :key, value, :expires_in => 1.second
    assert_equal :value, @cache.read(:key)
    sleep 2
    assert_nil @cache.read(:key)
  end

  test "delete an entry" do
    @cache.write :key, :value
    @cache.delete :key
    assert_nil @cache.read(:key)
  end

  test "entry exists" do
    assert !@cache.exist?(:foo)
    @cache.write :foo, :bar
    assert @cache.exist?(:foo)
  end

  test "delete entries by regex" do
    @cache.write :foo1, :bar
    @cache.write :foo2, :bar
    @cache.write :baz, :bar

    @cache.delete_matched /^foo/

    assert !@cache.exist?(:foo1)
    assert !@cache.exist?(:foo2)
    assert @cache.exist?(:baz)
  end

  include CacheStoreBehavior

  def test_store_objects_should_be_immutable
    @cache.write('foo', 'bar')
    @cache.read('foo').gsub!(/.*/, 'baz')
    assert_equal 'bar', @cache.read('foo')
  end

  def test_stored_objects_should_not_be_frozen
    @cache.write('foo', 'bar')
    assert !@cache.read('foo').frozen?
  end

  def test_write_should_return_true_on_success
    result = @cache.write('foo', 'bar')
    assert_equal 'bar', @cache.read('foo') # make sure 'foo' was written
    assert result
  end

  test "has status" do
    assert_not_nil @cache.status
  end
  test "status has free_bytes" do
    assert_not_nil @cache.status[:free_bytes]
  end
  test "status has used_bytes" do
    assert_not_nil @cache.status[:used_bytes]
  end
  test "status has total_bytes" do
    assert_not_nil @cache.status[:total_bytes]
  end
  test "status has usage" do
    assert_not_nil @cache.status[:usage]
  end

  test "specifing a filename is not overridden by the standard namespace" do
    ExpiryCache.expects(:new).with(Not(has_entries(:namespace => :lmc_store)))
    cache = ActiveSupport::Cache.lookup_store(:localmemcache_store,
      { :filename => 'alternative_test_file' })
  end
  test "specifing a namespace is not overridden" do
    mock = ExpiryCache.expects(:new)
    mock.with(all_of(has_entries(:namespace => :alternative),
                     Not(has_entries(:namespace => :lmc_store))))
    cache = ActiveSupport::Cache.lookup_store(:localmemcache_store,
      { :namespace => :alternative })
  end
end


text:
layout: page
title: Peak Industries Trade Fair
date: 2016-05-24
author: Scott Hodges
tags: weekly links, java
status: published
summary: Sed ultricies massa vitae augue suscipit, vitae imperdiet metus scelerisque.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 08/25/2019
  endDate: 08/29/2019
  ctyhocn: LAGGAHX
  groupCode: PITF
published: true
---
Sed condimentum ac massa ut elementum. Quisque vestibulum volutpat dui in laoreet. In ut posuere sapien. Maecenas suscipit ex non turpis aliquet, eu dictum arcu consequat. Curabitur rhoncus in metus pulvinar porttitor. Cras et felis molestie, auctor arcu bibendum, vehicula arcu. Mauris egestas, dui vel pharetra semper, enim nisi suscipit quam, vitae bibendum nunc eros ac ex. Sed mi massa, sodales id magna id, imperdiet laoreet neque. Cras sed euismod velit. Nullam viverra justo tempor felis convallis ullamcorper. Vivamus vestibulum mauris non sapien porta pretium. Mauris augue sapien, fringilla at mi sit amet, congue tempus libero. Nam suscipit eu neque ut dapibus. Aliquam erat volutpat.

1 Vivamus aliquet enim id sapien gravida hendrerit
1 Maecenas tempor diam vel eros fermentum, non placerat neque efficitur.

Sed et orci malesuada, tincidunt eros vitae, porttitor nibh. Proin sit amet eros ut tortor ultrices semper. Sed tincidunt tortor elit, vitae aliquam felis lacinia sed. Curabitur tristique nisl vitae justo feugiat bibendum. Nunc scelerisque ultricies ipsum in feugiat. Nulla cursus orci dui, eget euismod elit vestibulum ac. Nullam eget commodo est, eget auctor lorem.


text:
window._runtime_before = function() {
  return 'Hello before';
};


text:
using System;
using System.Diagnostics;
using NUnit.Framework;

namespace IntXLib.Test
{
	[TestFixture, Explicit]
	public class PerformanceTest
	{
		[Test]
		public void Multiply128BitNumbers()
		{
			IntX int1 = new IntX(new uint[] { 47668, 58687, 223234234, 42424242 }, false);
			IntX int2 = new IntX(new uint[] { 5674356, 34656476, 45667, 678645646 }, false);

			Stopwatch stopwatch = Stopwatch.StartNew();

			TestHelper.Repeat(
				100000,
				delegate
					{
						IntX.Multiply(int1, int2, MultiplyMode.Classic);
					}
			);

			stopwatch.Stop();
			Console.WriteLine(stopwatch.ElapsedMilliseconds);
		}
	}
}


text:
namespace Xamarin.Forms.Pictograms
{
    public class Button : Forms.Button
    {
        #region Constructors

        public Button()
        {
            AutoSize = true;
        }

        public Button(string fontface)
            : this()
        {
            FontFamily = fontface;
        }

        public Button(string fontface, int type)
            : this(fontface)
        {
            Text = Pictogram.GetText(type);
        }

        public Button(Pictogram glyph)
            : this(glyph.GetTypeface())
        {
        }

        public Button(Pictogram glyph, int type)
            : this(glyph.GetTypeface(), type)
        {
        }

        #endregion Constructors

        protected override void InvalidateMeasure()
        {
            base.InvalidateMeasure();
            if (AutoSize)
            {
                WidthRequest = FontSize;
            }
        }

        private bool autoSize = true;

        public bool AutoSize
        {
            get
            {
                return autoSize;
            }
            set
            {
                autoSize = value;
                InvalidateMeasure();
            }
        }

        public Pictogram Pictogram;
    }
}


text:
package org.kaaproject.kaa.server.datamigration.model;

public class Schema {

    private Long id;

    private int version;

    private String name;

    private String description;

    private String createdUsername;

    private long createdTime;

    private Long appId;

    private String schems;

    private String type;

    public Schema() {
    }

    public Schema(Long id, int version, String name, String description, String createdUsername, long createdTime, Long appId, String schems, String type) {
        this.id = id;
        this.version = version;
        this.name = name;
        this.description = description;
        this.createdUsername = createdUsername;
        this.createdTime = createdTime;
        this.appId = appId;
        this.schems = schems;
        this.type = type;
    }

    public Long getId() {
        return id;
    }

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

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCreatedUsername() {
        return createdUsername;
    }

    public void setCreatedUsername(String createdUsername) {
        this.createdUsername = createdUsername;
    }

    public long getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(long createdTime) {
        this.createdTime = createdTime;
    }

    public Long getAppId() {
        return appId;
    }

    public void setAppId(Long appId) {
        this.appId = appId;
    }

    public String getSchems() {
        return schems;
    }

    public void setSchems(String schems) {
        this.schems = schems;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

}


text:
namespace RecruitYourself.Data.Common
{
    using System;
    using System.Data.Entity;
    using System.Linq;

    using Contracts;
    using Models;

    public class DbRepository<T, TKey> : IDbRepository<T, TKey>
        where T : class, IBaseModel<TKey>
    {
        public DbRepository(DbContext context)
        {
            if (context == null)
            {
                throw new ArgumentException("An instance of DbContext is required to use this repository.", nameof(context));
            }

            this.Context = context;
            this.DbSet = this.Context.Set<T>();
        }

        private IDbSet<T> DbSet { get; }

        private DbContext Context { get; }

        public IQueryable<T> All()
        {
            return this.DbSet.Where(x => !x.IsDeleted);
        }

        public IQueryable<T> AllWithDeleted()
        {
            return this.DbSet;
        }

        public T GetById(TKey id)
        {
            var entity = this.All().FirstOrDefault(x => x.Id.ToString() == id.ToString());

            return entity;
        }

        public void Add(T entity)
        {
            this.DbSet.Add(entity);
        }

        public void Delete(T entity)
        {
            entity.IsDeleted = true;
            entity.DeletedOn = DateTime.UtcNow;
        }

        public void Delete(TKey id)
        {
            var entity = this.GetById(id);
            if (entity != null)
            {
                this.Delete(entity);
            }
        }

        public void HardDelete(T entity)
        {
            this.DbSet.Remove(entity);
        }

        public void Save()
        {
            this.Context.SaveChanges();
        }
    }
}


text:
"""
Merge MEC Entities.
"""
from tqdm import tqdm

# This chunky logic transfers all the data from one finance entity into the new one.
def merge_entity(entity_from, entity_into):
    """
    Merge two MEC entities.
    :param entity_from:
    :param entity_into:
    :return:
    """
    for person in entity_from.related_people.all():
        entity_into.related_people.add(person)
        entity_from.related_people.remove(person)

    for transaction in entity_from.income.all():
        tqdm.write("Moving income transaction {}.".format(transaction.id))
        transaction.t_to = entity_into
        transaction.save()
    for transaction in entity_from.spending.all():
        tqdm.write("Moving spending transaction {}.".format(transaction.id))
        transaction.t_from = entity_into
        transaction.save()

    for mec_link in entity_from.mec_links.all():
        mec_link.entity = entity_into
        mec_link.save()

    extras = {}
    if any(entity_into.extras):
        extras = entity_into.extras

    priors = []
    if 'priors' in extras:
        priors = extras['priors']
    priors.append({
        "name": entity_from.name,
        "id": entity_from.id,
        "mec_id": entity_from.mec_id,
        "e_type": entity_from.e_type,
        "first_name": entity_from.first_name,
        "last_name": entity_from.last_name,
        "address_first": entity_from.address_first,
        "address_second": entity_from.address_second,
        "address_city": entity_from.address_city,
        "address_state": entity_from.address_state,
        "address_zip": entity_from.address_zip,
        "employer": entity_from.employer,
        "occupation": entity_from.occupation
    })
    extras['priors'] = priors
    entity_into.extras = extras
    entity_into.save()
    entity_from.delete()


text:
"""Deduplicate Anagrams Package"""

from collections import Counter

def deduplicate_anagrams(words):
    """Deduplicate anagrams in a list of n words with at most k characters"""
    # O(nk) time complexity

    words_hash = {}
    # O(nk) n times at most k inserts in a hashtable + additional constant operations
    for word in words:
        words_hash[word] = tuple(
            value * key for key, value in Counter(word).iteritems())

    # remove duplicates per anagram group
    # O(n) - n inserts in set (hashtable)
    anagram_groups = {tuple_repr for tuple_repr in words_hash.itervalues()}

    result = []
    # O(n) - n times constant operations
    for word, tuple_repr in words_hash.iteritems():
        if tuple_repr in anagram_groups:
            result.append(word)
            anagram_groups.remove(tuple_repr)

    return result


text:
class Fbuilder(object):
    "Same as Ftypes, but placed in builder"
    def __get__(self, instance, owner):
        out = {}
        for program in instance:
            out.update(program.ftypes)
        return out
    def __set__(self, instance, value):
        for program in instance:
            program.ftypes = value

class Ibuilder(object):
    "Same as Itypes, but placed in builder"
    def __get__(self, instance, owner):
        out = set()
        for program in instance:
            out = out.union(program.itypes)
        return out
    def __set__(self, instance, value):
        for program in instance:
            program.itypes = value

class Sbuilder(object):
    "Same as Stypes, but placed in builder"
    def __get__(self, instance, owner):
        out = {}
        for program in instance:
            out.update(program.stypes)
        return out
    def __set__(self, instance, value):
        for program in instance:
            program.stypes = value

class Vbuilder(object):
    "Same as Vtypes, but placed in builder"
    def __get__(self, instance, owner):
        out = {}
        for program in instance:
            out.update(program.vtypes)
        return out
    def __set__(self, instance, value):
        for program in instance:
            program.vtypes = value


text:
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
            new Propel\PropelBundle\PropelBundle(),
            new Liip\ImagineBundle\LiipImagineBundle(),
            new Etf1\ImaginizeBundle\Etf1ImaginizeBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}


text:
package org.apache.ignite.examples.ml.preprocessing;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.examples.ml.dataset.model.Person;
import org.apache.ignite.examples.ml.util.DatasetHelper;
import org.apache.ignite.ml.dataset.DatasetFactory;
import org.apache.ignite.ml.dataset.primitive.SimpleDataset;
import org.apache.ignite.ml.math.functions.IgniteBiFunction;
import org.apache.ignite.ml.math.primitives.vector.Vector;
import org.apache.ignite.ml.math.primitives.vector.VectorUtils;
import org.apache.ignite.ml.preprocessing.binarization.BinarizationTrainer;

/**
 * Example that shows how to use binarization preprocessor to binarize data.
 *

 * Code in this example launches Ignite grid and fills the cache with simple test data.

 *

 * After that it defines preprocessors that extract features from an upstream data and normalize features.

 *

 * Finally, it creates the dataset based on the processed data and uses Dataset API to find and output
 * various statistical metrics of the data.

 *

 * You can change the test data used in this example and re-run it to explore this functionality further.

 */
public class BinarizationExample {
    /** Run example. */
    public static void main(String[] args) throws Exception {
        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
            System.out.println(">>> Binarization example started.");

            IgniteCache<Integer, Person> persons = createCache(ignite);

            // Defines first preprocessor that extracts features from an upstream data.
            IgniteBiFunction<Integer, Person, Vector> featureExtractor = (k, v) -> VectorUtils.of(
                v.getAge()
            );

            // Defines second preprocessor that normalizes features.
            IgniteBiFunction<Integer, Person, Vector> preprocessor = new BinarizationTrainer<Integer, Person>()
                .withThreshold(40)
                .fit(ignite, persons, featureExtractor);

            // Creates a cache based simple dataset containing features and providing standard dataset API.
            try (SimpleDataset<?> dataset = DatasetFactory.createSimpleDataset(ignite, persons, preprocessor)) {
                new DatasetHelper(dataset).describe();
            }

            System.out.println(">>> Binarization example completed.");
        }
    }

    /** */
    private static IgniteCache<Integer, Person> createCache(Ignite ignite) {
        CacheConfiguration<Integer, Person> cacheConfiguration = new CacheConfiguration<>();

        cacheConfiguration.setName("PERSONS");
        cacheConfiguration.setAffinity(new RendezvousAffinityFunction(false, 2));

        IgniteCache<Integer, Person> persons = ignite.createCache(cacheConfiguration);

        persons.put(1, new Person("Mike", 42, 10000));
        persons.put(2, new Person("John", 32, 64000));
        persons.put(3, new Person("George", 53, 120000));
        persons.put(4, new Person("Karl", 24, 70000));

        return persons;
    }
}


text:
import { dirname } from 'node:path'
import { watch, promises as fsAsync } from 'node:fs'
import { throttle } from 'source/common/function.js'
import { createHub } from 'source/common/module/Event.js'
import { nearestExistPath } from './Path.js'

// single node only: a file, or one level of directory
// will throttle event
// listener should check the file for actual file change
// - can watch a non-exist file
// - watch will resume when deleted file is recreated

// TODO:
//   upper directory renaming will not trigger change (still the same stat for this node & upper node)
//   so renaming then replace the path will not trigger change

// NOTE:
//   macos seems to queue up fs changes, so the throttle may be off a bit

const CHANGE_PATH = 'rename' // const CHANGE_CONTENT = 'change'

const EMPTY_FUNC = () => {}

const createFileWatcherExot = ({
  path,
  wait = 250, // TODO: maybe throttle should be done outside, so this only emit raw event
  // set true to keep process from exiting, like `timeout.ref()`
  // once set, should call clear for process to unref and exit
  persistent = false,
  id = 'exot:file-watcher'
}) => {
  const hub = createHub()

  let prevStat

  let watcherPath // the nearest existing path, may be upper path
  let watcherStat
  let watcher
  let watcherUpper

  const emitThrottled = throttle(async () => {
    // hasChange: true = path level change = create/delete(also for rename since this watches single node)
    // hasChange: false = content level change = path-change/file-content/directory-file-list
    const stat = await fsAsync.lstat(path).catch(EMPTY_FUNC)
    const hasChange = Boolean(prevStat) !== Boolean(stat) // TODO: consider rename to `hasPathChange`?
    __DEV__ && console.log('emitThrottled', hasChange, Boolean(prevStat), Boolean(stat))

    if (stat === undefined) { // target file not found
      if (path === watcherPath) await setupWatch() // renamed, not the target any more

      __DEV__ && hasChange === false && console.log('emitThrottled dropped')
      if (hasChange === false) return
    }

    __DEV__ && console.log('emitThrottled send')
    const changeState = { path, stat, hasChange }
    prevStat = stat
    hub.send(changeState)
  }, wait)

  const onErrorEvent = async (...args) => {
    __DEV__ && console.log('[onErrorEvent]', args)
    await setupWatch()
    onChangeEvent(CHANGE_PATH)
  }
  const onChangeEvent = (changeType, path) => {
    __DEV__ && console.log('[onChangeEvent]', changeType, path)
    emitThrottled(/* changeType, path */)
  }

  const clearWatch = () => {
    watcher && watcher.close()
    watcherUpper && watcherUpper.close()
    watcherPath = undefined
    watcherStat = undefined
    watcher = undefined
    watcherUpper = undefined
  }

  const setupWatch = async () => {
    const stat = await fsAsync.lstat(path).catch(EMPTY_FUNC)

    if (stat) {
      clearWatch()
      __DEV__ && console.log('[Watch] path visible', path, stat.isDirectory())

      watcherPath = path
      watcherStat = stat
      watcher = watch(path, { persistent, recursive: false })
      watcher.addListener('error', onErrorEvent)
      watcher.addListener('change', onChangeEvent)

      // TODO: directly watch directory will miss rename, upper will receive content change, but upper will not receive add/delete change
      if (stat.isDirectory()) {
        watcherUpper = watch(dirname(path))
        watcherUpper.addListener('error', EMPTY_FUNC) // not care this error
        watcherUpper.addListener('change', onChangeEvent)
      }
    } else {
      __DEV__ && console.log('[Watch] path invisible')
      const pathNearest = await nearestExistPath(path)
      if (pathNearest === watcherPath) return // same nearest path
      clearWatch()
      __DEV__ && console.log(`[Watch] change pathNearest: ${pathNearest}`)

      watcherPath = pathNearest
      watcherStat = stat
      watcher = watch(pathNearest, { persistent, recursive: false })
      watcher.addListener('error', onErrorEvent)
      watcher.addListener('change', onErrorEvent)
    }
  }

  return {
    id,
    up: async (onExotError) => {
      await setupWatch()
      prevStat = watcherPath === path ? watcherStat : undefined
    },
    down: () => { // NOTE: this is sync
      clearWatch()
      hub.clear()
      prevStat = undefined
    },
    isUp: () => watcher !== undefined,

    subscribe: (listener) => hub.subscribe(listener),
    unsubscribe: (listener) => hub.unsubscribe(listener)
  }
}

export { createFileWatcherExot }


text:
package rdc

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// SyncUserToRdc invokes the rdc.SyncUserToRdc API synchronously
// api document: https://help.aliyun.com/api/rdc/syncusertordc.html
func (client *Client) SyncUserToRdc(request *SyncUserToRdcRequest) (response *SyncUserToRdcResponse, err error) {
	response = CreateSyncUserToRdcResponse()
	err = client.DoAction(request, response)
	return
}

// SyncUserToRdcWithChan invokes the rdc.SyncUserToRdc API asynchronously
// api document: https://help.aliyun.com/api/rdc/syncusertordc.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) SyncUserToRdcWithChan(request *SyncUserToRdcRequest) (<-chan *SyncUserToRdcResponse, <-chan error) {
	responseChan := make(chan *SyncUserToRdcResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.SyncUserToRdc(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// SyncUserToRdcWithCallback invokes the rdc.SyncUserToRdc API asynchronously
// api document: https://help.aliyun.com/api/rdc/syncusertordc.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) SyncUserToRdcWithCallback(request *SyncUserToRdcRequest, callback func(response *SyncUserToRdcResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *SyncUserToRdcResponse
		var err error
		defer close(result)
		response, err = client.SyncUserToRdc(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// SyncUserToRdcRequest is the request struct for api SyncUserToRdc
type SyncUserToRdcRequest struct {
	*requests.RpcRequest
	LoginTicket string `position:"Body" name:"LoginTicket"`
}

// SyncUserToRdcResponse is the response struct for api SyncUserToRdc
type SyncUserToRdcResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
	Success   bool   `json:"Success" xml:"Success"`
	Code      int    `json:"Code" xml:"Code"`
	Message   string `json:"Message" xml:"Message"`
	Data      Data   `json:"Data" xml:"Data"`
}

// CreateSyncUserToRdcRequest creates a request to invoke SyncUserToRdc API
func CreateSyncUserToRdcRequest() (request *SyncUserToRdcRequest) {
	request = &SyncUserToRdcRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("Rdc", "2018-08-21", "SyncUserToRdc", "rdc", "openAPI")
	return
}

// CreateSyncUserToRdcResponse creates a response to parse from SyncUserToRdc response
func CreateSyncUserToRdcResponse() (response *SyncUserToRdcResponse) {
	response = &SyncUserToRdcResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
import { drawMpage } from './components/ctl.utils'
import injectTapEventPlugin from 'react-tap-event-plugin'

injectTapEventPlugin();

module.exports = {
    drawCtls2: (runtime) => {
        var renderRE = drawMpage(runtime);
        console.log(renderRE, runtime.container[0]);
        ReactDOM.render(
            renderRE,
            runtime.container[0]
        );
    }
};


text:
// Copyright (c) Petabridge <https://petabridge.com/>. All rights reserved.
// Licensed under the Apache 2.0 license. See LICENSE file in the project root for full license information.
// See ThirdPartyNotices.txt for references to third party code used inside Helios.

using System;
using Helios.Reactor.Tcp;
using Helios.Topology;

namespace Helios.Reactor.Bootstrap
{
    /// <summary>
    ///     <see cref="IServerFactory" /> instance for spawning TCP-based <see cref="IReactor" /> instances
    /// </summary>
    public sealed class TcpServerFactory : ServerFactoryBase
    {
        public TcpServerFactory(ServerBootstrap other)
            : base(other)
        {
        }

        protected override ReactorBase NewReactorInternal(INode listenAddress)
        {
            if (UseProxies)
                return new TcpProxyReactor(listenAddress.Host, listenAddress.Port, EventLoop, Encoder, Decoder,
                    Allocator, BufferBytes);
            throw new NotImplementedException("Have not implemented non-TCP proxies");
        }
    }
}


text:
package system

import (
	"bytes"
	"io/ioutil"
	"strconv"

	"github.com/influxdata/telegraf"
	"github.com/influxdata/telegraf/plugins/inputs"
)

// https://www.kernel.org/doc/Documentation/sysctl/fs.txt
type SysctlFS struct {
	path string
}

var sysctlFSDescription = `Provides Linux sysctl fs metrics`
var sysctlFSSampleConfig = ``

func (_ SysctlFS) Description() string {
	return sysctlFSDescription
}
func (_ SysctlFS) SampleConfig() string {
	return sysctlFSSampleConfig
}

func (sfs *SysctlFS) gatherList(file string, fields map[string]interface{}, fieldNames ...string) error {
	bs, err := ioutil.ReadFile(sfs.path + "/" + file)
	if err != nil {
		return err
	}

	bsplit := bytes.Split(bytes.TrimRight(bs, "\n"), []byte{'\t'})
	for i, name := range fieldNames {
		if i >= len(bsplit) {
			break
		}
		if name == "" {
			continue
		}

		v, err := strconv.ParseUint(string(bsplit[i]), 10, 64)
		if err != nil {
			return err
		}
		fields[name] = v
	}

	return nil
}

func (sfs *SysctlFS) gatherOne(name string, fields map[string]interface{}) error {
	bs, err := ioutil.ReadFile(sfs.path + "/" + name)
	if err != nil {
		return err
	}

	v, err := strconv.ParseUint(string(bytes.TrimRight(bs, "\n")), 10, 64)
	if err != nil {
		return err
	}

	fields[name] = v
	return nil
}

func (sfs *SysctlFS) Gather(acc telegraf.Accumulator) error {
	fields := map[string]interface{}{}

	for _, n := range []string{"aio-nr", "aio-max-nr", "dquot-nr", "dquot-max", "super-nr", "super-max"} {
		sfs.gatherOne(n, fields)
	}

	sfs.gatherList("inode-state", fields, "inode-nr", "inode-free-nr", "inode-preshrink-nr")
	sfs.gatherList("dentry-state", fields, "dentry-nr", "dentry-unused-nr", "dentry-age-limit", "dentry-want-pages")
	sfs.gatherList("file-nr", fields, "file-nr", "", "file-max")

	acc.AddFields("linux_sysctl_fs", fields, nil)
	return nil
}

func init() {
	inputs.Add("linux_sysctl_fs", func() telegraf.Input {
		return &SysctlFS{
			path: "/proc/sys/fs",
		}
	})
}


text:
<?php
declare(strict_types=1);
namespace Ivory\Exception;

use Exception;

/**
 * An exception above a database connection.
 *
 * This class of exceptions gets thrown upon an error with the database connection itself. For errors on querying the
 * database, a {@link StatementException} is used.
 */
class ConnectionException extends \RuntimeException
{
    /**
     * @param string|resource $message alternatively to the message, a connection handler may be given - the last error
     *                                   message on this connection is considered then
     * @param int $code
     * @param Exception|null $previous
     */
    public function __construct($message = '', int $code = 0, ?Exception $previous = null)
    {
        if (is_resource($message)) {
            $message = pg_last_error($message);
        }

        parent::__construct($message, $code, $previous);
    }

}


text: Rails.application.config.session_store :cookie_store, key: '_limbforge_session'


text:
package de.leanovate.swaggercheck.simple

import de.leanovate.swaggercheck.ResponseExtractor

/**
 * Simple response object implementation.
 *
 * This is not supposed to be (or become) a web framework. Just a convenient fallback that
 * could be used without any extra dependencies.
 *
 * @param status the response status code (i.e. 200, 201, ...)
 * @param headers the response headers
 * @param body the response body
 */
case class SimpleResponse(
                           status: Int,
                           headers: Map[String, String],
                           body: String
                           )

object SimpleResponse {
  implicit val extractor = new ResponseExtractor[SimpleResponse] {
    override def status(response: SimpleResponse): Int = response.status

    override def headers(response: SimpleResponse): Map[String, String] =
      response.headers.map {
        case (name, value) =>
          name.toLowerCase -> value
      }

    override def body(response: SimpleResponse): String = response.body
  }
}


text:
"""Parser for pdp eprimer3 subcommand

(c) The James Hutton Institute 2017-2019

Author: Leighton Pritchard
Contact: leighton.pritchard@hutton.ac.uk

Leighton Pritchard,
Information and Computing Sciences,
James Hutton Institute,
Errol Road,
Invergowrie,
Dundee,
DD2 5DA,
Scotland,
UK

The MIT License

Copyright (c) 2017-2019 The James Hutton Institute
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.
"""

from diagnostic_primers.scripts import subcommands
from argparse import ArgumentDefaultsHelpFormatter

def build(subparsers, parents=None):
    """Add parser for `eprimer3` subcommand to subparsers

    This parser implements options for controlling primer creation with the
    EMBOSS ePrimer3 tool.
    """
    parser = subparsers.add_parser("eprimer3", aliases=["e3"], parents=parents,
                                   formatter_class=ArgumentDefaultsHelpFormatter)

    # Primer prediction options - subcommand eprimer3
    parser.add_argument("outfilename", help="Path to write new configuration file")
    parser.add_argument(
        "--eprimer3",
        dest="eprimer3_exe",
        action="store",
        default="eprimer3",
        help="path to ePrimer3 executable",
    )
    parser.add_argument(
        "--outdir",
        dest="eprimer3_dir",
        action="store",
        default="eprimer3",
        help="path to directory for ePrimer3 output",
    )
    parser.add_argument(
        "-f",
        "--force",
        dest="eprimer3_force",
        action="store_true",
        default=False,
        help="Overwrite old ePrimer3 output",
    )
    parser.add_argument(
        "--filter",
        dest="ep_filter",
        action="store_true",
        default=False,
        help="use the filtered_seqfile to design primer sets",
    )
    parser.add_argument(
        "--numreturn",
        dest="ep_numreturn",
        action="store",
        default=10,
        type=int,
        help="number of primers to return",
    )
    parser.add_argument(
        "--osize",
        dest="ep_osize",
        action="store",
        default=20,
        type=int,
        help="optimal size for primer oligo",
    )
    parser.add_argument(
        "--minsize",
        dest="ep_minsize",
        action="store",
        default=18,
        type=int,
        help="minimum size for primer oligo",
    )
    parser.add_argument(
        "--maxsize",
        dest="ep_maxsize",
        action="store",
        default=22,
        type=int,
        help="maximum size for primer oligo",
    )
    parser.add_argument(
        "--opttm",
        dest="ep_opttm",
        action="store",
        default=59,
        type=int,
        help="optimal Tm for primer oligo",
    )
    parser.add_argument(
        "--mintm",
        dest="ep_mintm",
        action="store",
        default=58,
        type=int,
        help="minimum Tm for primer oligo",
    )
    parser.add_argument(
        "--maxtm",
        dest="ep_maxtm",
        action="store",
        default=60,
        type=int,
        help="maximum Tm for primer oligo",
    )
    parser.add_argument(
        "--ogcpercent",
        dest="ep_ogcpercent",
        action="store",
        default=55,
        type=int,
        help="optimal %%GC for primer oligo",
    )
    parser.add_argument(
        "--mingcpercent",
        dest="ep_mingc",
        action="store",
        default=30,
        type=int,
        help="minimum %%GC for primer oligo",
    )
    parser.add_argument(
        "--maxgcpercent",
        dest="ep_maxgc",
        action="store",
        default=80,
        type=int,
        help="maximum %%GC for primer oligo",
    )
    parser.add_argument(
        "--psizeopt",
        dest="ep_psizeopt",
        action="store",
        default=100,
        type=int,
        help="optimal size of amplified region",
    )
    parser.add_argument(
        "--psizemin",
        dest="ep_psizemin",
        action="store",
        default=50,
        type=int,
        help="minimum size of amplified region",
    )
    parser.add_argument(
        "--psizemax",
        dest="ep_psizemax",
        action="store",
        default=150,
        type=int,
        help="maximum size of amplified region",
    )
    parser.add_argument(
        "--maxpolyx",
        dest="ep_maxpolyx",
        action="store",
        default=3,
        type=int,
        help="maximum run of repeated nucleotides " + "in primer",
    )
    parser.add_argument(
        "--hybridprobe",
        dest="ep_hybridprobe",
        action="store_true",
        default=False,
        help="design a reporter oligo",
    )
    parser.add_argument(
        "--oligoosize",
        dest="ep_osizeopt",
        action="store",
        default=20,
        type=int,
        help="optimal size for internal oligo",
    )
    parser.add_argument(
        "--oligominsize",
        dest="ep_ominsize",
        action="store",
        default=13,
        type=int,
        help="minimum size for internal oligo",
    )
    parser.add_argument(
        "--oligomaxsize",
        dest="ep_omaxsize",
        action="store",
        default=30,
        type=int,
        help="maximum size for internal oligo",
    )
    parser.add_argument(
        "--oligootm",
        dest="ep_otmopt",
        action="store",
        default=69,
        type=int,
        help="optimal Tm for internal oligo",
    )
    parser.add_argument(
        "--oligomintm",
        dest="ep_otmmin",
        action="store",
        default=68,
        type=int,
        help="minimum Tm for internal oligo",
    )
    parser.add_argument(
        "--oligomaxtm",
        dest="ep_otmmax",
        action="store",
        default=70,
        type=int,
        help="maximum Tm for internal oligo",
    )
    parser.add_argument(
        "--oligoogcpercent",
        dest="ep_ogcopt",
        action="store",
        default=55,
        type=int,
        help="optimal %%GC for internal oligo",
    )
    parser.add_argument(
        "--oligomingcpercent",
        dest="ep_ogcmin",
        action="store",
        default=30,
        type=int,
        help="minimum %%GC for internal oligo",
    )
    parser.add_argument(
        "--oligomaxgcpercent",
        dest="ep_ogcmax",
        action="store",
        default=80,
        type=int,
        help="maximum %%GC for internal oligo",
    )
    # Commented out until Biopython command line code catches up with new
    # EMBOSS options
    #    parser.add_argument("--oligomaxpolyx", dest="ep_opolymax",
    #                                 action="store",
    #                                 default=3, type=int,
    #                                 help="maximum run of repeated nucleotides " +
    #                                 "in internal primer")
    parser.set_defaults(func=subcommands.subcmd_eprimer3)


text:
import ko from 'knockout';
    import moment from 'moment';

    ko.bindingHandlers.bindingHandlerDate = {

        update: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
            var value = valueAccessor();
            //var mode = ko.unwrap(value);
            //var mode = viewModel.displayMode();
            var inRow = allBindings.get("inRow");
            var readOnly = allBindings.get("readOnly");
            var colName = $(element).data("field");
            var markup = "
";

            //var value_utc = new Date(value().getUTCFullYear(), value().getUTCMonth(), value().getUTCDate(), value().getUTCHours(), value().getUTCMinutes(), value().getUTCSeconds())
            //var dateStr = (value().getUTCMonth() + 1) + "/" + value().getUTCDate() + "/" + value().getUTCFullYear() + " " + value().getUTCHours() + ":" + value().getUTCMinutes() + ":" + value().getUTCSeconds();
            var dateStr = value() == null ? "" : moment.utc(value()).format("MMM Do YY, h:mm");

            //value().toUTCString()
            //var str = (pickDate ? dateStr : value_utc.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
            var isViewMode = viewModel.isViewMode();
            if (isViewMode || readOnly) {
                markup += "" + dateStr + ""
            }
            else {
            }
            markup += "
";

            $(element)
                .html(markup)
        }
    }

    ko.bindingHandlers.bindingHandlerEdit = {
        init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
            var value = valueAccessor();
            var colName = $(element).data("field");
            $("")
                .appendTo(element)
        }
    };

    ko.bindingHandlers.bindingHandlerEditInline = {
        init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
            // here isViewMode needs computed
            var colName = $(element).data("field"); //allBindings.get('colName');
            var markup =
                "\
                    \
                        \
                    \
                    \
                        Save \
                    \
                    \
                        Cancel \
                    \
                \
                \
                        \
                ";
            $(markup).appendTo(element)
        },

    };

    ko.bindingHandlers.bindingHandlerMoney = {

        init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
            var mode = viewModel.displayMode()
            var inRow = allBindings.get("inRow");
            var isViewMode = vewModel.isViewMode();

            if (!isViewMode) {
                var colName = $(element).data("field");
                $(element).html("<input style='text-align:right' class='form-control' data-field='" + colName
                + "' data-bind=\"value: " + colName + "().toFixed(2), valueUpdate:'keyup'\">")
            }
        },

        update: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
            var value = ko.utils.unwrapObservable(valueAccessor())
            var mode = viewModel.displayMode()
            var inRow = allBindings.get("inRow");
            var isViewMode = viewModel.isViewMode();

            if (isViewMode) {
                var tokens = value.toFixed(2).replace('-', '').split('.');
                var s = '$' + $.map(tokens[0].split('').reverse(), function (elm, i) {
                    return [(i % 3 === 0 && i > 0 ? ',' : ''), elm];
                }).reverse().join('') + '.' + tokens[1];
                var markup = value < 0 ? '-' + s : s;
                $(element).html(markup)
            }
        }
    }

    ko.bindingHandlers.bindingHandlerCheckbox = {
        init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {

            var markup =
               "\
                    <input type='checkbox' data-bind='checked: " + $(element).data("field") + "' />\
                \
                \
                    \
                        \
                    \
                    \
                        jok\
                    \
                ";
            $(markup).appendTo(element);

            //var value = valueAccessor();
            //var mode = viewModel.displayMode()
            //var inRow = allBindings.get("inRow");
        }
    }


text:
/**
 * This package contains abstract testing builders.
 */
@javax.annotation.ParametersAreNonnullByDefault package com.codereligion.beast.internal.test.builder;


text:
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { create as createJss } from 'jss';
import { JssProvider } from 'react-jss';
import jssPreset from 'jss-preset-default';
import reducers from './core/reducers';
import storage from './core/storage';
import ThemeProvider from './components/ThemeProvider';
import App from './components/App';
import themes from './themes';
import initializeI18n from './initializeI18n';
import registerServiceWorker from './registerServiceWorker';

// Expose the verison of the application in a global variable to ease debugging.
global.APP_VERSION = process.env.REACT_APP_VERSION;

initializeI18n();

const jss = createJss(jssPreset());
const store = createStore(reducers, storage.load());

store.subscribe(() => {
  // Save the applicaiton state on each update.
  storage.save(store.getState());
});

ReactDOM.render(
  <Provider store={store}>
    <JssProvider jss={jss}>
      <ThemeProvider themes={themes}>
        <BrowserRouter>
          <App />
        </BrowserRouter>
      </ThemeProvider>
    </JssProvider>
  </Provider>,
  document.getElementById('root'),
);

// To allow the service worker to notify the app on background updates.
registerServiceWorker(store);


text:
<div id="container">

</div>
<script src="../js/browser.min.js"></script>
<script type="text/babel" src="../js/appUser.js">


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layoutDirection="rtl"
    android:tag="0,0,300,300"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- b/69293180 -->

    <tag android:id="@+id/wrap_horizontal" android:value="0,0,300,1920 0,300,0,0 0,1620,0,0 0,384,0,0 0,0,0,0 300,0,0,0 240,0,0,0"/>
    <tag android:id="@+id/wrap_vertical" android:value="0,0,1080,300 0,300,0,0 0,0,0,0 0,60,0,0 780,0,0,0 300,0,0,0 864,0,0,0"/>

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline1"
        android:tag="0,300,0,0"
        app:layout_constraintGuide_begin="100dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline2"
        android:tag="0,1620,0,0"
        app:layout_constraintGuide_end="100dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline3"
        android:tag="0,384,0,0"
        app:layout_constraintGuide_percent="0.2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline4"
        android:tag="780,0,0,0"
        app:layout_constraintGuide_begin="100dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline5"
        android:tag="300,0,0,0"
        app:layout_constraintGuide_end="100dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline6"
        android:tag="864,0,0,0"
        app:layout_constraintGuide_percent="0.2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" />

</androidx.constraintlayout.widget.ConstraintLayout>


text:
#include "VoxelDCamera.h"
#include "VoxelXUProgrammer.h"
#include <Logger.h>
#include <UVCStreamer.h>

#include <Parameter.h>
#define _USE_MATH_DEFINES
#include <math.h>
namespace Voxel
{

namespace TI
{

VoxelDCamera::VoxelDCamera(Voxel::DevicePtr device): ToFTinTinCamera("VoxelDCamera", device)
{
  _init();
}

class VoxelDMixVoltageParameter: public UnsignedIntegerParameter
{
protected:
  virtual uint _fromRawValue(uint32_t value) const
  {
    if(value > 0x80U)
      return (value - 0x80U)*25 + 500;
    else
      return 500;
  }

  virtual uint32_t _toRawValue(uint value) const
  {
    if(value > 500)
      return (value - 500)/25 + 0x80U;
    else
      return 0x80U;
  }

public:
  VoxelDMixVoltageParameter(RegisterProgrammer &programmer):
  UnsignedIntegerParameter(programmer, MIX_VOLTAGE, "mV", 0x2D05, 8, 7, 0, 500, 2075, 1500, "Mixing voltage",
                           "Mixing voltage?", Parameter::IO_READ_WRITE, {})
  {}

  virtual ~VoxelDMixVoltageParameter() {}
};

class VoxelDIlluminationVoltageParameter: public UnsignedIntegerParameter
{
protected:
  virtual uint _fromRawValue(uint32_t value) const
  {
    if(value > 0x80U)
      return (value - 0x80U)*50 + 500;
    else
      return 500;
  }

  virtual uint32_t _toRawValue(uint value) const
  {
    if(value > 500)
      return (value - 500)/50 + 0x80U;
    else
      return 0x80U;
  }

public:
  VoxelDIlluminationVoltageParameter(RegisterProgrammer &programmer):
  UnsignedIntegerParameter(programmer, ILLUM_VOLTAGE, "mV", 0x2D0E, 8, 7, 0, 500, 3650, 1500, "Illumination voltage",
                           "Voltage applied to the infra-red Illumination source", Parameter::IO_READ_WRITE, {})
  {}

  virtual ~VoxelDIlluminationVoltageParameter() {}
};

bool VoxelDCamera::_init()
{
  USBDevice &d = (USBDevice &)*_device;

  DevicePtr controlDevice;

  if(d.productID() == VOXEL_D_PRODUCT_ID1)
  {
    Vector<DevicePtr> devices = DeviceScanner::scan();

    uint repeatCount = 0;
    for(auto &d1: devices)
    {
      if(d1->interfaceID() != Device::USB)
        continue;

      USBDevice &usbd = (USBDevice &)*d1;

      if(usbd.vendorID() == VOXEL_D_VENDOR_ID && usbd.productID() == VOXEL_D_PRODUCT_ID2 &&
        (d.serialNumber().size() == 0 || d.serialNumber() == usbd.serialNumber()))
        repeatCount++;
    }

    _downloader = Ptr<Downloader>(new USBDownloader(_device));
    if(!_downloader->download(configFile.get("core", "fw"))) // TODO: This needs to come from a configuration
    {
      logger(LOG_ERROR) << "VoxelDCamera: Firmware download failed" << std::endl;
      return false;
    }
    else
      std::this_thread::sleep_for(std::chrono::milliseconds(2000)); // wait for device to get ready after loading firmware

    controlDevice = DevicePtr(new USBDevice(VOXEL_D_VENDOR_ID, VOXEL_D_PRODUCT_ID2, _device->serialNumber(),
                                            _device->channelID(), _device->description(), _device->serialIndex(), repeatCount > 0));
    _device = controlDevice;
    _makeID();
  }
  else
    controlDevice = _device;

  _programmer = Ptr<RegisterProgrammer>(new VoxelXUProgrammer(
    { {0x2D, 1}, {0x58, 3}, {0x5C, 3} },
    controlDevice));
  _streamer = Ptr<Streamer>(new UVCStreamer(controlDevice));

  if(!_programmer->isInitialized() || !_streamer->isInitialized())
    return false;

  if(!_addParameters({
    ParameterPtr(new VoxelDMixVoltageParameter(*_programmer)),
    ParameterPtr(new VoxelDIlluminationVoltageParameter(*_programmer)),
    }))
  {
    return false;
  }

  if(!ToFTinTinCamera::_init())
    return false;

  return true;
}

bool VoxelDCamera::_initStartParams()
{
  return
  //set(ILLUM_VOLTAGE, 1500U) &&
  //set(MIX_VOLTAGE, 1500U) &&
  ToFTinTinCamera::_initStartParams() &&
  set(ILLUM_EN_POL, true);
}

bool VoxelDCamera::_getFieldOfView(float &fovHalfAngle) const
{
  fovHalfAngle = (87/2.0f)*(M_PI/180.0f);
  return true;
}

bool VoxelDCamera::_setStreamerFrameSize(const FrameSize &s)
{
  UVCStreamer *streamer = dynamic_cast<UVCStreamer *>(&*_streamer);

  if(!streamer)
  {
    logger(LOG_ERROR) << "VoxelDCamera: Streamer is not of type UVC" << std::endl;
    return false;
  }

  VideoMode m;
  m.frameSize = s;

  int bytesPerPixel;

  if(!_get(PIXEL_DATA_SIZE, bytesPerPixel))
  {
    logger(LOG_ERROR) << "VoxelDCamera: Could not get current bytes per pixel" << std::endl;
    return false;
  }

  if(bytesPerPixel == 4)
    m.frameSize.width *= 2;

  if(!_getFrameRate(m.frameRate))
  {
    logger(LOG_ERROR) << "VoxelDCamera: Could not get current frame rate" << std::endl;
    return false;
  }

  if(!streamer->setVideoMode(m))
  {
    logger(LOG_ERROR) << "VoxelDCamera: Could not set video mode for UVC" << std::endl;
    return false;
  }

  return true;
}

bool VoxelDCamera::_getSupportedVideoModes(Vector<SupportedVideoMode> &supportedVideoModes) const
{
  supportedVideoModes = Vector<SupportedVideoMode> {
    SupportedVideoMode(320,240,25,1,4),
    SupportedVideoMode(160,240,50,1,4),
    SupportedVideoMode(160,120,100,1,4),
    SupportedVideoMode(80,120,200,1,4),
    SupportedVideoMode(80,60,400,1,4),
    SupportedVideoMode(320,240,50,1,2),
    SupportedVideoMode(320,120,100,1,2),
    SupportedVideoMode(160,120,200,1,2),
    SupportedVideoMode(160,60,400,1,2),
    SupportedVideoMode(80,60,400,1,2),
  };
  return true;
}

bool VoxelDCamera::_getMaximumVideoMode(VideoMode &videoMode) const
{
  int bytesPerPixel;
  if(!_get(PIXEL_DATA_SIZE, bytesPerPixel))
  {
    logger(LOG_ERROR) << "VoxelDCamera: Could not get current bytes per pixel" << std::endl;
    return false;
  }

  videoMode.frameSize.width = 320;
  videoMode.frameSize.height = 240;
  videoMode.frameRate.denominator = 1;
  videoMode.frameRate.numerator = (bytesPerPixel == 4)?25:50;
  return true;
}

}
}


text:
import { NgModule } from '@angular/core';
import { AboutComponent } from './index';

@NgModule({
    declarations: [
        AboutComponent
    ],
    exports: [
        AboutComponent
    ]
})
export class AboutModule {
}


text:
source yobichain.conf

db_root_pass=$1
db_admin_user=$2
db_admin_pass=$3

homedir=`su -l $linux_admin_user -c 'cd ~ && pwd'`
source $homedir/.multichain/$chainname/multichain.conf

user_id=1
user_password_hash=`php -r 'echo password_hash("'$default_user_pass'",PASSWORD_BCRYPT);'`

user_addr=`curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/json;' http://127.0.0.1:$rpcport | jq -r '.result'`

user_pubkey=`curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "validateaddress", "params": ["'$user_addr'"] }' -H 'content-type: text/json;' http://127.0.0.1:$rpcport | jq -r '.result.pubkey'`

su -l $linux_admin_user -c  "multichain-cli "$chainname" grant "$user_addr" send,receive,issue > /dev/null 2>/dev/null"

su -l $linux_admin_user -c  "multichain-cli "$chainname" grant "$user_addr" file_data.write > /dev/null 2>/dev/null"
su -l $linux_admin_user -c  "multichain-cli "$chainname" grant "$user_addr" file_details.write > /dev/null 2>/dev/null"
su -l $linux_admin_user -c  "multichain-cli "$chainname" grant "$user_addr" asset_details.write > /dev/null 2>/dev/null"
su -l $linux_admin_user -c  "multichain-cli "$chainname" grant "$user_addr" offers_hex.write > /dev/null 2>/dev/null"
su -l $linux_admin_user -c  "multichain-cli "$chainname" grant "$user_addr" offers_details.write > /dev/null 2>/dev/null"

echo ''
echo ''
echo -e 'SETTING UP DATABASE. Please wait...'
echo ''
echo ''
echo ''

mysql -u root -p$db_root_pass -Bse 'SET GLOBAL FOREIGN_KEY_CHECKS=0;'
mysql -u root -p$db_root_pass -Bse 'DROP DATABASE IF EXISTS `'$db_name'`'
mysql -u root -p$db_root_pass -Bse 'CREATE DATABASE IF NOT EXISTS `'$db_name'`'
mysql --user=root --password=$db_root_pass $db_name < $db_file_name

mysql -u root -p$db_root_pass -Bse "CREATE USER IF NOT EXISTS '"$db_admin_user"'@'localhost' IDENTIFIED BY '"$db_admin_pass"';GRANT ALL PRIVILEGES ON \`"$db_name"\`. * TO '"$db_admin_user"'@'localhost';FLUSH PRIVILEGES;"

mysql -u root -p$db_root_pass $db_name -Bse 'SET GLOBAL FOREIGN_KEY_CHECKS=1'

echo ''
echo ''
echo ''

echo -e '-----------------------------'
echo -e 'YOBICHAIN CONFIGURED SUCCESSFULLY!'
echo -e '-----------------------------'
echo ''
echo ''


text:
var fs = require('fs');
var path = require('path');
var Promise = require('bluebird');
var mongoose = Promise.promisifyAll(require('mongoose'));

var Database = function(){};

Database.prototype = (function(){
	return {
		initialize: function(){
			var env = process.env.NODE_ENV || 'development';
			var root = path.join(__dirname, '..', 'model');

			this.models = {};
			this.loadConfig(env);
			this.loadModels(root);
		},
		loadConfig: function(env){
			var file = path.join(__dirname, '..', 'config', env+'.json');
			if(!fs.lstatSync(file).isFile()){
				throw new Error('Database not loaded');
			}
			var config = require(file);

			this.mongo = mongoose.createConnection('mongodb://' + config.db.host + ':' + config.db.port + '/' + config.db.name );
		},
		loadModels: function(root){
			var self = this;
			var files = fs.readdirSync(root);

			files.forEach(function(file){
				var fullPath = path.join(root, file);
				var stat = fs.lstatSync(fullPath);

				if(stat.isFile() && file.match(/\.js$/) !== null){
					self.models[path.basename(file, '.js')] =  require(fullPath)(self.mongo);
				}
			});
		}
	};
})();

var database = new Database();

module.exports = database;
//module.exports


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Polyblastia epigaea A. Massal.

### Remarks
null


text:
class AllIntervention < AactRecord
  include BelongsToStudy
end


text:
package kr.jm.utils.collections;

import kr.jm.utils.datastructure.JMMap;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

/**
 * The type Jm list map.
 *
 * @param <K> the type parameter
 * @param <V> the type parameter
 */
public class JMListMap<K, V> implements Map<K, List<V>> {

    private Map<K, List<V>> listMap;

    /**
     * Instantiates a new Jm list map.
     */
    public JMListMap() {
        this.listMap = new ConcurrentHashMap<>();
    }

    /**
     * Instantiates a new Jm list map.
     *
     * @param map the map
     */
    public JMListMap(Map<K, List<V>> map) {
        this.listMap = map;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#size()
     */
    @Override
    public int size() {
        return listMap.size();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#isEmpty()
     */
    @Override
    public boolean isEmpty() {
        return listMap.isEmpty();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#containsKey(java.lang.Object)
     */
    @Override
    public boolean containsKey(Object key) {
        return listMap.containsKey(key);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#containsValue(java.lang.Object)
     */
    @Override
    public boolean containsValue(Object value) {
        return listMap.containsValue(value);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#get(java.lang.Object)
     */
    @Override
    public List<V> get(Object key) {
        return listMap.get(key);
    }

    /**
     * Add boolean.
     *
     * @param key   the key
     * @param value the value
     * @return the boolean
     */
    public boolean add(K key, V value) {
        return getOrPutGetNewList(key).add(value);
    }

    /**
     * Add all boolean.
     *
     * @param key  the key
     * @param list the list
     * @return the boolean
     */
    public boolean addAll(K key, List<V> list) {
        return getOrPutGetNewList(key).addAll(list);
    }

    /**
     * Merge jm list map.
     *
     * @param jmListMap the jm list map
     * @return the jm list map
     */
    public JMListMap<K, V> merge(JMListMap<K, V> jmListMap) {
        jmListMap.forEach(this::addAll);
        return this;
    }

    private List<V> getOrPutGetNewList(K key) {
        return JMMap.getOrPutGetNew(listMap, key, () -> Collections
                .synchronizedList(new ArrayList<>()));
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#put(java.lang.Object, java.lang.Object)
     */
    @Override
    public List<V> put(K key, List<V> valueList) {
        return listMap.put(key, valueList);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#remove(java.lang.Object)
     */
    @Override
    public List<V> remove(Object key) {
        return listMap.remove(key);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#putAll(java.util.Map)
     */
    @Override
    public void putAll(Map<? extends K, ? extends List<V>> m) {
        listMap.putAll(m);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#clear()
     */
    @Override
    public void clear() {
        listMap.clear();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#keySet()
     */
    @Override
    public Set<K> keySet() {
        return listMap.keySet();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#values()
     */
    @Override
    public Collection<List<V>> values() {
        return listMap.values();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.util.Map#entrySet()
     */
    @Override
    public Set<java.util.Map.Entry<K, List<V>>> entrySet() {
        return listMap.entrySet();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object o) {
        return listMap.equals(o);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        return listMap.hashCode();
    }

    /**
     * Gets all.
     *
     * @return the all
     */
    public Map<K, List<V>> getAll() {
        return new HashMap<>(this.listMap);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return listMap.toString();
    }

}


text:
layout: global
title: Powered By Alluxio
group: Resources
---

目前有许多公司和组织都在使用Alluxio,下面列出了其中一部分。如果你的组织也在使用,可以自由地[编辑这个列表](https://github.com/alluxio/alluxio/edit/master/docs/cn/Powered-By-Alluxio.md),或者通过邮件告诉我们(project.alluxio@gmail.com),或者填写[调查](http://alluxio.org/resources/survey-users/)让我们知道。

* [Alibaba](http://www.alibaba.com/)
* [Alluxio](http://www.alluxio.com/)
* [Ants Programmatic AD](http://ants.vn/)
* [Arimo](http://arimo.com/)
* [Atigeo](http://atigeo.com/)
* [Baidu](http://www.baidu.com/)
* [Barclays](http://www.barclays.co.uk/)
* [Huawei](http://www.huawei.com/)
* [IBM Research](http://www.research.ibm.com/)
* [Intel](http://www.intel.com/)
* [JD](http://www.jd.com/)
* [Juniper Networks](http://www.juniper.net/)
* [Neusoft](http://www.neusoft.com/)
* [Qunar](http://www.qunar.com/)
* [Radicalbit](http://www.radicalbit.io)
* [UC Berkeley AMPLab](https://amplab.cs.berkeley.edu/)
* [Ultra Tendency](http://ultratendency.com/)

以下是一些将Alluxio加入到自身的生态系统以增强功能的第三方软件项目。

* [Alibaba OSS](http://www.aliyun.com/product/oss/?lang=en)
* [Amazon S3](https://aws.amazon.com/s3/)
* [Alluxio C++ Client](https://github.com/stormspirit/libtachyon)
* [Alluxio Service for Ambari](https://github.com/chuyqa/tachyon-ambari-service)
* [Apache Flink](https://flink.apache.org/)
* [Apache Hadoop](https://hadoop.apache.org/)
* [Apache Spark](http://spark.apache.org/)
* [Apache Zeppelin](http://zeppelin-project.org/)
* [GlusterFS](http://www.gluster.org/)
* [Openstack Swift](http://docs.openstack.org/developer/swift/)


text:
module Besepa
  class Subscription < Besepa::Resource

    include Besepa::ApiCalls::List
    include Besepa::ApiCalls::Search
    include Besepa::ApiCalls::Create
    include Besepa::ApiCalls::Update
    include Besepa::ApiCalls::Destroy

    FIELDS = [:id, :last_debit, :next_debit, :status, :metadata, :starts_at, :renew_at, :created_at, :setup_fee, :customer_code, :debits_count]

    FIELDS.each do |f|
      attr_accessor f
    end

    attr_accessor :debtor_bank_account, :product, :customer

    def to_hash
      values = {}
      self.class::FIELDS.each do |key|
        values[key] = self.send("#{key.to_s}")
      end
      values[:debtor_bank_account] = debtor_bank_account.to_hash if debtor_bank_account
      values[:product] = product.to_hash if product
      values[:customer] = customer.to_hash if customer
      values
    end

    def self.api_path(filters={})
      customer_id = filters[:customer_id]
      if customer_id
        "#{Customer.api_path}/#{CGI.escape(customer_id)}/subscriptions"
      else
        "/subscriptions"
      end
    end

    def self.query_params(filters = {})
      filters = filters.dup
      filters.delete(:customer_id)
      filters
    end

    def stats
      response = get "#{api_path}/stats"
      response['response']
    end

    def api_path(filters={})
      "#{self.class.api_path(filters)}/#{CGI.escape(id)}"
    end

    def process_attributes(attrs)
      self.class::FIELDS.each do |key|
        self.send("#{key.to_s}=", attrs[key.to_s] || attrs[key.to_sym])
      end
      self.debtor_bank_account = Besepa::BankAccount.new(attrs['debtor_bank_account']) if attrs['debtor_bank_account']
      self.product = Besepa::Product.new(attrs['product']) if attrs['product']
      self.customer = Besepa::Customer.new(attrs['customer']) if attrs['customer']
      process_activities(attrs)
      self
    end
  end
end


text:
angular.module('quassel', ['ngQuassel', 'ngSanitize', 'ui.bootstrap', 'dragAndDrop', 'cgNotify'])
.factory('$ignore', ['$quassel', function($quassel){
    var IgnoreList = require('ignore').IgnoreList;
    var IgnoreItem = require('ignore').IgnoreItem;
    var ignoreList = new IgnoreList();
    var savedIgnoreList = null;
    var ignoreListRevision = 0;
    return {
        createItem: function() {
            ignoreList.list.push(new IgnoreItem(1, '', 0, 0, 1, 0, 'rule'));
        },
        deleteItem: function(indice) {
            if (ignoreList.list[indice]) {
                ignoreList.list.splice(indice, 1);
            }
        },
        getList: function() {
            return ignoreList;
        },
        restoreSavedList: function() {
            ignoreList = angular.copy(savedIgnoreList);
        },
        setList: function(obj) {
            ignoreList = obj;
            savedIgnoreList = angular.copy(ignoreList);
        },
        getRevision: function() {
            return ignoreListRevision;
        },
        incRevision: function() {
            ignoreListRevision++;
        },
        save: function() {
            savedIgnoreList = angular.copy(ignoreList);
            $quassel.requestUpdate(ignoreList.export());
        }
    };
}])
.factory('$config', ['$rootScope', function($rootScope){

    var keys = {};

    return {
        set: function(key, val) {
            localStorage.setItem(key, JSON.stringify(val));
            if (keys[key]) {
                for (var x in keys[key]) {
                    keys[key][x](val);
                }
            }
            $rootScope.$emit('config.'+key, val);
        },
        get: function(key) {
            return JSON.parse(localStorage.getItem(key));
        }
    };
}])
.factory('$favico', [function() {
    var num = 0;
    var favico = new Favico({
        animation: 'pop',
        type: 'rectangle',
        bgColor: '#f0ad4e',
        textColor: '#fff'
    });

    var more = function() {
        num = num + 1;
        favico.badge(num);
    };

    var less = function() {
        num = (num-1 < 0) ? 0 : (num - 1);
        favico.badge(num);
    };

    var reset = function() {
        favico.reset();
    };

    return {
        more: more,
        less: less,
        reset: reset
    };
}])
.factory('$alert', ['notify', function(notify) {

    notify.config({startTop: 2, verticalSpacing: 4, duration: 8000});

    function info(message, options) {
        options = options || {};
        options.message = message;
        options.classes = ["alert-info"];
        notify(options);
    }

    function warn(message, options) {
        options = options || {};
        options.message = message;
        options.classes = ["alert-warning"];
        notify(options);
    }

    function error(message, options) {
        options = options || {};
        options.message = message;
        options.classes = ["alert-danger"];
        notify(options);
    }

    return {
        info: info,
        warn: warn,
        error: error
    };
}])
.factory('$desktop', [function(){
    var granted = false;
    if (!("Notification" in window)) {
        granted = false;
    } else if (Notification.permission === "granted") {
        granted = true;
    } else if (Notification.permission !== 'denied') {
        Notification.requestPermission(function (permission) {
            if(!('permission' in Notification)) {
                Notification.permission = permission;
            }
            granted = permission === "granted";
        });
    }

    return function(title, body, timeout){
        if (granted) {
            var options = {};
            timeout = timeout || 5000;
            if (body) options.body = body;
            var notif = new Notification(title, options);
            setTimeout(function(){
                if (notif) {
                    notif.close();
                }
            }, timeout);
            return notif;
        }
    };
}])
.factory('$theme', [function(){
    var defaultTheme = '';
    var packagedThemes = [
        'default',
        'darksolarized',
    ];

    return {
        setDefaultTheme: function(theme) {
            defaultTheme = theme;
        },
        getClientTheme: function() {
            return localStorage.defaultTheme || null;
        },
        setClientTheme: function(theme) {
            localStorage.defaultTheme = theme;
        },
        getAllThemes: function() {
            var themes = [].concat(packagedThemes);
            if (defaultTheme && themes.indexOf(defaultTheme) === -1) {
                themes.push(defaultTheme);
            }
            return themes;
        },
    };
}])
.factory('$wfocus', [function(){
    var focus = true;
    var nextFocusCallback = null;
    $(window).focus(function() {
        focus = true;
        if (nextFocusCallback !== null)
            nextFocusCallback();
        nextFocusCallback = null;
    });

    $(window).blur(function() {
        focus = false;
    });

    return {
        isFocus: function() {
            return focus;
        },
        onNextFocus: function(callback) {
            nextFocusCallback = callback;
        }
    };
}])
.run([function(){
    console.log('AngularJS loaded');
}]);


text:
from django.test import TestCase

import os

from chords.forms import AddCommentForm, AddSongForm, ContactForm, SearchForm
from .helper_functions import (create_user, create_song, valid_song_data,
                               valid_contact_data)

class AddSongFormTests(TestCase):
    def test_form_with_valid_data(self):
        """
        Form must be valid with sensible data.
        """
        form = AddSongForm(data=valid_song_data())
        self.assertTrue(form.is_valid())

    def test_form_with_invalid_data(self):
        """
        Form cannot be valid if any of title, artist_txt, genre or content
        is missing, or if we give an invalid url.
        """
        self.assertFalse(AddSongForm().is_valid())
        # title required
        self.assertFalse(AddSongForm(valid_song_data(title='')).is_valid())
        # artist_txt required
        self.assertFalse(AddSongForm(valid_song_data(artist_txt='')).is_valid())
        # genre required
        self.assertFalse(AddSongForm(valid_song_data(genre=None)).is_valid())
        # invalid video url
        self.assertFalse(AddSongForm(valid_song_data(video='invalid_url')).is_valid())

class AddCommentFormTests(TestCase):
    def setUp(self):
        os.environ['RECAPTCHA_TESTING'] = 'True'
        self.valid_data = {
            'user' : create_user().id,
            'song' : create_song().id,
            'content': 'comment',
            'g-recaptcha-response' : 'PASSED'
        }

    def tearDown(self):
        os.environ['RECAPTCHA_TESTING'] = 'False'

    def test_form_with_valid_data(self):
        """
        Form must be valid with sensible data.
        """
        self.assertTrue(AddCommentForm(self.valid_data).is_valid())

    def test_form_with_invalid_data(self):
        """
        Test form with invalid data.
        """
        self.assertFalse(AddCommentForm().is_valid())

        # user required
        data = self.valid_data.copy()
        data['user'] = ''
        self.assertFalse(AddCommentForm(data).is_valid())

        # user must exist
        data = self.valid_data.copy()
        data['user'] = -1
        self.assertFalse(AddCommentForm(data).is_valid())

        # song required
        data = self.valid_data.copy()
        data['song'] = ''
        self.assertFalse(AddCommentForm(data).is_valid())

        # song must exist
        data = self.valid_data.copy()
        data['song'] = -1
        self.assertFalse(AddCommentForm(data).is_valid())

        # content required
        data = self.valid_data.copy()
        data['content'] = ''
        self.assertFalse(AddCommentForm(data).is_valid())

        # g-recaptcha-response required
        data = self.valid_data.copy()
        data['g-recaptcha-response'] = ''
        self.assertFalse(AddCommentForm(data).is_valid())

class ContactFormTests(TestCase):
    def test_form_with_valid_data(self):
        """
        Form must be valid with sensible data.
        """
        self.assertTrue(ContactForm(valid_contact_data()).is_valid())

    def test_form_with_invalid_data(self):
        """
        Test form with invalid data.
        """
        self.assertFalse(ContactForm().is_valid())

        # name required
        form = ContactForm(valid_contact_data(name=''))
        self.assertFalse(form.is_valid())
        # email required
        form = ContactForm(valid_contact_data(email=''))
        self.assertFalse(form.is_valid())
        # email must be valid
        form = ContactForm(valid_contact_data(email='junk string'))
        self.assertFalse(form.is_valid())
        # subject required
        form = ContactForm(valid_contact_data(subject=''))
        self.assertFalse(form.is_valid())
        # body required
        form = ContactForm(valid_contact_data(body=''))
        self.assertFalse(form.is_valid())

class SearchFormTests(TestCase):
    def test_form_with_valid_data(self):
        """
        Form must be valid with sensible data.
        """
        form = SearchForm(data={'searchBy': SearchForm.SEARCH_SONG})
        self.assertTrue(form.is_valid())

    def test_form_with_invalid_data(self):
        """
        Form cannot be valid if searchBy field is missing.
        """
        self.assertFalse(SearchForm().is_valid())


text:
:: AH 20-12-06 modified for new PCRE-7.0 and VP/BCC
:: PH 19-03-07 renamed !compile.txt and !linklib.txt as makevp-compile.txt and
::             makevp-linklib.txt
:: PH 26-03-07 re-renamed !compile.txt and !linklib.txt as makevp-c.txt and
::             makevp-l.txt
:: PH 29-03-07 hopefully the final rename to makevp_c and makevp_l
:: AH 27.08.08 updated for new PCRE-7.7
::             required PCRE.H and CONFIG.H will be generated if not existing

@echo off
echo.
echo Compiling PCRE with BORLAND C++ for VIRTUAL PASCAL
echo.

REM This file was contributed by Alexander Tokarev for building PCRE for use
REM with Virtual Pascal. It has not been tested with the latest PCRE release.

REM This file has been modified and extended to compile with newer PCRE releases
REM by Stefan Weber (Angels Holocaust).

REM CHANGE THIS FOR YOUR BORLAND C++ COMPILER PATH
SET BORLAND=f:\bcc
REM location of the TASM binaries, if compiling with the -B BCC switch
SET TASM=f:\tasm

SET PATH=%PATH%;%BORLAND%\bin;%TASM%\bin
SET PCRE_VER=77
SET COMPILE_DEFAULTS=-DHAVE_CONFIG_H -DPCRE_STATIC -I%BORLAND%\include

del pcre%PCRE_VER%.lib >nul 2>nul

:: sh configure

:: check for needed header files
if not exist pcre.h copy pcre.h.generic pcre.h
if not exist config.h copy config.h.generic config.h

bcc32 -DDFTABLES %COMPILE_DEFAULTS% -L%BORLAND%\lib dftables.c
IF ERRORLEVEL 1 GOTO ERROR

:: dftables > chartables.c
dftables pcre_chartables.c

REM compile and link the PCRE library into lib: option -B for ASM compile works too
bcc32 -a4 -c -RT- -y- -v- -u- -R- -Q- -X -d -fp -ff -P- -O2 -Oc -Ov -3 -w-8004 -w-8064 -w-8065 -w-8012 -UDFTABLES -DVPCOMPAT %COMPILE_DEFAULTS% @makevp_c.txt
IF ERRORLEVEL 1 GOTO ERROR

tlib %BORLAND%\lib\cw32.lib *calloc *del *strncmp *memcpy *memmove *memset *memcmp *strlen
IF ERRORLEVEL 1 GOTO ERROR
tlib pcre%PCRE_VER%.lib @makevp_l.txt +calloc.obj +del.obj +strncmp.obj +memcpy.obj +memmove.obj +memset.obj +memcmp.obj +strlen.obj
IF ERRORLEVEL 1 GOTO ERROR

del *.obj *.tds *.bak >nul 2>nul

echo ---
echo Now the library should be complete. Please check all messages above.
echo Don't care for warnings, it's OK.
goto END

:ERROR
echo ---
echo Error while compiling PCRE. Aborting...
pause
goto END

:END