text:
<?php

namespace Octower\Command\Project;

use Octower\IO\IOInterface;
use Octower\Metadata\Project;
use Octower\Octower;
use Symfony\Component\Console\Input\InputInterface;

class StatusCommand extends ProjectCommand
{
    protected function configure()
    {
        $this
            ->setName('project:status')
            ->setDescription('Display project status')
            ->setHelp(<<<EOT
<info>%command.name%</info> display project status

  <info>%command.full_name%</info>
EOT
            );
    }

    protected function doExecute(InputInterface $input)
    {
        /** @var Project $project */
        $project = $this->getOctower()->getContext();

        $this->getIO()->write('<info>~~ Project status ~~</info>');
        $this->getIO()->write('<info>Project: <comment>' . $project->getName() . '</comment></info>');
        $this->getIO()->write('<info>Version: <comment>' . $project->getVersion() . '</comment></info>');

        $this->getIO()->write('<info>Scripts:</info>');

        foreach(Project::getScriptEvents() as $event) {
            $scripts = $project->getScriptsByPriority($event);

            if(count($scripts) == 0) {
                continue;
            }

            $this->getIO()->write(sprintf('    - <comment>%s</comment> :', $event));

            foreach($scripts as $script) {
                $this->getIO()->write(sprintf('        - "%s" <notice>(priority : %s)</notice>', $script['command'], $script['priority']));
            }
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Stuki
 *
 * @author tanderson@soliantconsulting.com
 */

function undoMagicQuotes($array, $topLevel=true) {
    $newArray = array();
    foreach($array as $key => $value) {
        if (!$topLevel) {
            $newKey = stripslashes($key);
            if ($newKey!==$key) {
                unset($array[$key]);
            }
            $key = $newKey;
        }
        $newArray[$key] = is_array($value) ? undoMagicQuotes($value, false) : stripslashes($value);
    }
    return $newArray;
}

if (get_magic_quotes_gpc()) {
    $_GET = undoMagicQuotes($_GET);
    $_POST = undoMagicQuotes($_POST);
}

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(__DIR__ . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ?: 'development'));

// Ensure library is on the include path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

// Start autoloader
require_once 'Zend/Loader/AutoloaderFactory.php';
Zend\Loader\AutoloaderFactory::factory(array(
    'Zend\Loader\StandardAutoloader' => array()
));

// Load global application config
$appConfig = include APPLICATION_PATH . '/configs/application.config.php';

// Start Module Loader
$listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']);
$defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions);
$defaultListeners->getConfigListener()->addConfigGlobPath(APPLICATION_PATH . '/configs/autoload/*.config.php');
$defaultListeners->getConfigListener()->addConfigGlobPath(APPLICATION_PATH . '/configs/autoload/' . APPLICATION_ENV . '/*.config.php');

// Module settings
$moduleManager = new Zend\Module\Manager($appConfig['modules']);
$moduleManager->events()->attachAggregate($defaultListeners);
$moduleManager->loadModules();

// Bootstrap and run
#print_r($defaultListeners->getConfigListener()->getMergedConfig()); die();
$bootstrap = new Zend\Mvc\Bootstrap($defaultListeners->getConfigListener()->getMergedConfig());
$application = new Zend\Mvc\Application;
$bootstrap->bootstrap($application);

$application->run(); #->send();


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>javaPS</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="shortcut icon" href="favicon.ico">

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">

javaPS

Service information

WPS Service endpoint: GetCapabilities document

OGC API - Processes endpoint: Landing page

Info endpoint: Build information

Service version: ${project.version}

Powered by arctic-sea from 52°North.


text:
package cz.zcu.kiv.jop.construction;

import cz.zcu.kiv.jop.JopException;

/**
 * Exception which may be thrown if some error occurs during construction of some object in
 * {@link ConstructionStrategy}. It's recommended to not throw another exception from
 * {@link ConstructionStrategy#constructObject construct method}.
 *
 * @author Mr.FrAnTA
 * @since 1.0.0
 */
public class ConstructionStrategyException extends JopException {

  /**
   * Determines if a de-serialized file is compatible with this class.
   *

   * Maintainers must change this value if and only if the new version of this class is not
   * compatible with old versions. See Oracle docs for details.
   *

   * Not necessary to include in first version of the class, but included here as a reminder of its
   * importance.
   */
  private static final long serialVersionUID = 20160406;

  /**
   * Constructs a new exception for construction strategy with null as its detail
   * message. The cause is not initialized, and may subsequently be initialized by a call to
   * {@link #initCause}.
   */
  public ConstructionStrategyException() {
    super();
  }

  /**
   * Constructs a new exception for construction strategy with the specified detail message. The
   * cause is not initialized, and may subsequently be initialized by a call to {@link #initCause}.
   *
   * @param message the detail message. The detail message is saved for later retrieval by the
   *          {@link #getMessage()} method.
   */
  public ConstructionStrategyException(String message) {
    super(message);
  }

  /**
   * Constructs a new exception for construction strategy with the specified cause and
   * null as its detail message. This constructor is different to parent
   * {@link RuntimeException#RuntimeException(Throwable) constructor} which sets detail message as
   * message from cause. This constructor brings possibility to use {@link #getDefaultMessage}
   * instead.
   *
   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
   *          (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
   *          unknown.)
   */
  public ConstructionStrategyException(Throwable cause) {
    super(cause);
  }

  /**
   * Constructs a new exception for construction strategy with the specified detail message and
   * cause.
   *

   * Note that the detail message associated with cause is not automatically
   * incorporated in this exception's detail message.
   *
   * @param message the detail message (which is saved for later retrieval by the
   *          {@link #getMessage()} method).
   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
   *          (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
   *          unknown.)
   */
  public ConstructionStrategyException(String message, Throwable cause) {
    super(message, cause);
  }
}


text:
import os

from .. import OratorTestCase
from . import IntegrationTestCase

class PostgresQmarkIntegrationTestCase(IntegrationTestCase, OratorTestCase):
    @classmethod
    def get_manager_config(cls):
        ci = os.environ.get("CI", False)

        if ci:
            database = "orator_test"
            user = "postgres"
            password = None
        else:
            database = "orator_test"
            user = "orator"
            password = "orator"

        return {
            "default": "postgres",
            "postgres": {
                "driver": "pgsql",
                "database": database,
                "user": user,
                "password": password,
                "use_qmark": True,
            },
        }

    def get_marker(self):
        return "?"


text:
<?php

namespace Ipanema\CmsBundle\Admin;

use Sonata\AdminBundle\Admin\AdminInterface;
use Ipanema\CmsBundle\MultilangPage;
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin as BaseAdmin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Knp\Menu\ItemInterface as MenuItemInterface;

class PageAdmin extends BaseAdmin
{
    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('path', 'text')
            ->add('title', 'text')
            ->add('label', 'text')
            ->add('name', 'text')
            ->add('createDate', 'date')
            ->add('publishStartDate', 'date')
            ->add('publishEndDate', 'date');
    }

    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('parent', 'doctrine_phpcr_odm_tree', array('choice_list' => array(), 'root_node' => $this->root))
            ->add('name', 'text')
            ->add('label', null, array('required' => false))
            ->add('title')
            ->add('createDate')
            ->add('publishStartDate', null, array('required' => false))
            ->add('publishEndDate', null, array('required' => false))
            ->add('body', 'textarea');
    }

    protected function configureSideMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
    {
        if (!in_array($action, array('edit', 'create'))) {
            return;
        }

        $menu->addChild(
            $this->trans('sidemenu.publish_start_end_date')
        );

        $menu->addChild(
            $this->trans('sidemenu.end_date_disable')
        );

        if ('edit' == $action) {
            $page = $this->getSubject();
            $uri = $this->routeGenerator->generate($page);
            if ($page instanceof MultilangPage) {
                $uri.= '#'.$page->getTitle();
            }

            $menu->addChild(
                $this->trans('sidemenu.review'),
                array('uri' => $uri)
            );
        }

    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('title', 'doctrine_phpcr_string')
            ->add('name',  'doctrine_phpcr_string');
    }

    public function getExportFormats()
    {
        return array();
    }
}


text:
goog.require('goog.dom');
goog.require('goog.date');
goog.require('goog.i18n.DateTimeSymbols');
goog.require('goog.i18n.DateTimeSymbols_en_US');
goog.require('goog.i18n.DateTimeSymbols_fr');
goog.require('goog.i18n.DateTimeSymbols_de');
goog.require('goog.i18n.DateTimeSymbols_da');
goog.require('goog.i18n.DateTimeSymbols_nl');
goog.require('goog.locale');
goog.require('goog.ui.DatePicker');


text:
<?php

namespace Google\AdsApi\Common;

use Google\AdsApi\Common\Testing\AdsBuildersTestProvider;
use Google\Auth\Credentials\ServiceAccountCredentials;
use Google\Auth\Credentials\UserRefreshCredentials;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;

/**
 * Unit tests for `OAuth2TokenBuilder`.
 *
 * @see OAuth2TokenBuilder
 * @small
 */
class OAuth2TokenBuilderTest extends TestCase
{

    private $oAuth2TokenBuilder;
    private $jsonKeyFilePath;

  /**
   * @see \PHPUnit\Framework\TestCase::setUp
   */
    protected function setUp(): void
    {
        $this->oAuth2TokenBuilder = new OAuth2TokenBuilder();
        $this->jsonKeyFilePath = AdsBuildersTestProvider::getFakeJsonKeyFilePath();
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::from
   */
    public function testBuildFromWithServiceAccountFlow()
    {
        $valueMap = [
        [
            'jsonKeyFilePath',
            'OAUTH2',
            $this->jsonKeyFilePath
        ], [
            'scopes',
            'OAUTH2',
            'https://www.googleapis.com/auth/dfp'
        ],
        ];
        $configurationMock = $this->getMockBuilder(Configuration::class)
        ->disableOriginalConstructor()
        ->getMock();
        $configurationMock->expects($this->any())
        ->method('getConfiguration')
        ->will($this->returnValueMap($valueMap));

        $tokenFetcher = $this->oAuth2TokenBuilder
        ->from($configurationMock)
        ->build();

        $this->assertInstanceOf(ServiceAccountCredentials::class, $tokenFetcher);
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::from
   */
    public function testBuildFromWithServiceAccountFlowUsingImpersonation()
    {
        $valueMap = [
        [
            'jsonKeyFilePath',
            'OAUTH2',
            $this->jsonKeyFilePath
        ], [
            'scopes',
            'OAUTH2',
            'https://www.googleapis.com/auth/dfp'
        ], [
            'impersonatedEmail',
            'OAUTH2',
            'dfp@gmail.com'
        ]
        ];
        $configurationMock = $this->getMockBuilder(Configuration::class)
        ->disableOriginalConstructor()
        ->getMock();
        $configurationMock->expects($this->any())
        ->method('getConfiguration')
        ->will($this->returnValueMap($valueMap));

        $tokenFetcher = $this->oAuth2TokenBuilder
        ->from($configurationMock)
        ->build();

        $this->assertInstanceOf(ServiceAccountCredentials::class, $tokenFetcher);
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::build
   */
    public function testBuildFailsWhenSettingValuesForMultipleFlows()
    {
        $this->expectExceptionMessageMatches("/both service account.+installed.+web.+flow.+set/");
        $this->expectException(InvalidArgumentException::class);
        $this->oAuth2TokenBuilder
        ->withJsonKeyFilePath($this->jsonKeyFilePath)
        ->withScopes('https://www.googleapis.com/auth/dfp')
        ->withClientId('abcxyz-123.apps.googleusercontent.com')
        ->withClientSecret('ABcXyZ-123abc')
        ->withRefreshToken('1/AbC-xY123Za-bc')
        ->build();
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::build
   */
    public function testBuildWithServiceAccountFlow()
    {
        $tokenFetcher = $this->oAuth2TokenBuilder
        ->withJsonKeyFilePath($this->jsonKeyFilePath)
        ->withScopes('https://www.googleapis.com/auth/dfp')
        ->build();
        $this->assertInstanceOf(ServiceAccountCredentials::class, $tokenFetcher);
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::build
   */
    public function testBuildWithServiceAccountFlowUsingImpersonation()
    {
        $tokenFetcher = $this->oAuth2TokenBuilder
        ->withJsonKeyFilePath($this->jsonKeyFilePath)
        ->withScopes('https://www.googleapis.com/auth/dfp')
        ->withImpersonatedEmail('dfp@gmail.com')
        ->build();
        $this->assertInstanceOf(ServiceAccountCredentials::class, $tokenFetcher);
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::build
   */
    public function testBuildFailsWhenMissingRequiredValuesForSAFlow()
    {
        $this->expectExceptionMessageMatches("/jsonKeyFilePath.+scopes.+must be set/");
        $this->expectException(InvalidArgumentException::class);
        $this->oAuth2TokenBuilder
        ->withJsonKeyFilePath($this->jsonKeyFilePath)
        ->build();
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::build
   */
    public function testBuildWithWebOrInstalledAppFlow()
    {
        $tokenFetcher = $this->oAuth2TokenBuilder
        ->withClientId('abcxyz-123.apps.googleusercontent.com')
        ->withClientSecret('ABcXyZ-123abc')
        ->withRefreshToken('1/AbC-xY123Za-bc')
        ->build();
        $this->assertInstanceOf(UserRefreshCredentials::class, $tokenFetcher);
    }

  /**
   * @covers \Google\AdsApi\Common\OAuth2TokenBuilder::build
   */
    public function testBuildFailsWhenMissingRequiredValuesForInstAppOrWebFlow()
    {
        $this->expectExceptionMessageMatches("/clientId.+clientSecret.+refreshToken.+must be set/");
        $this->expectException(InvalidArgumentException::class);
        $this->oAuth2TokenBuilder
        ->withClientId('abcxyz-123.apps.googleusercontent.com')
        ->withClientSecret('ABcXyZ-123abc')
        ->build();
    }
}


text:
package org.optaplanner.core.impl.testdata.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Serializable;

import com.thoughtworks.xstream.XStream;
import org.apache.commons.lang3.SerializationUtils;
import org.mockito.AdditionalAnswers;
import org.optaplanner.core.api.domain.solution.Solution;
import org.optaplanner.core.api.score.Score;
import org.optaplanner.core.api.score.buildin.simple.SimpleScore;
import org.optaplanner.core.config.score.trend.InitializingScoreTrendLevel;
import org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor;
import org.optaplanner.core.impl.score.buildin.simple.SimpleScoreDefinition;
import org.optaplanner.core.impl.score.director.InnerScoreDirector;
import org.optaplanner.core.impl.score.director.easy.EasyScoreCalculator;
import org.optaplanner.core.impl.score.director.easy.EasyScoreDirector;
import org.optaplanner.core.impl.score.director.easy.EasyScoreDirectorFactory;
import org.optaplanner.core.impl.score.trend.InitializingScoreTrend;

import static org.mockito.Mockito.*;

public class PlannerTestUtils {

    // ************************************************************************
    // ScoreDirector methods
    // ************************************************************************

    public static InnerScoreDirector mockScoreDirector(SolutionDescriptor solutionDescriptor) {
        EasyScoreDirectorFactory scoreDirectorFactory = new EasyScoreDirectorFactory(new EasyScoreCalculator() {
            @Override
            public Score calculateScore(Solution solution) {
                return SimpleScore.valueOf(0);
            }
        });
        scoreDirectorFactory.setSolutionDescriptor(solutionDescriptor);
        scoreDirectorFactory.setScoreDefinition(new SimpleScoreDefinition());
        scoreDirectorFactory.setInitializingScoreTrend(
                InitializingScoreTrend.buildUniformTrend(InitializingScoreTrendLevel.ONLY_DOWN, 1));
        return mock(InnerScoreDirector.class, AdditionalAnswers.delegatesTo(scoreDirectorFactory.buildScoreDirector(false)));
    }

    // ************************************************************************
    // Serialization methods
    // ************************************************************************

    public static <T> void serializeAndDeserializeWithAll(T input, OutputAsserter<T> outputAsserter) {
        outputAsserter.assertOutput(serializeAndDeserializeWithJavaSerialization(input));
        outputAsserter.assertOutput(serializeAndDeserializeWithXStream(input));
    }

    public static <T> T serializeAndDeserializeWithJavaSerialization(T input) {
        byte[] bytes = SerializationUtils.serialize((Serializable) input);
        return (T) SerializationUtils.deserialize(bytes);
    }

    public static <T> T serializeAndDeserializeWithXStream(T input) {
        XStream xStream = new XStream();
        xStream.setMode(XStream.ID_REFERENCES);
        if (input != null) {
            xStream.processAnnotations(input.getClass());
        }
        String xmlString = xStream.toXML(input);
        return (T) xStream.fromXML(xmlString);
    }

    public static interface OutputAsserter<T> {

        void assertOutput(T output);

    }

    // ************************************************************************
    // Private constructor
    // ************************************************************************

    private PlannerTestUtils() {
    }

}


text:
using System;
using Ormikon.AspNetCore.Static.Cache;
using Ormikon.AspNetCore.Static.Extensions;

namespace Ormikon.AspNetCore.Static
{
    /// <summary>
    /// Base Configuration settings for Static middlewares
    /// </summary>
    public abstract class StaticSettingsBase
    {
        /// <summary>
        /// Represents a default file names for a default HTML file like 'index.html'
        /// </summary>
        public const string DefaultFileValue = "index.html;index.htm;start.html;start.htm;default.html;default.htm";
        /// <summary>
        /// Represents a default types need to be compressed if client support compressed content
        /// </summary>
        public const string DefaultCompressedTypesFilter = "text/*;*/xml;application/*javascript;application/*json*"
            + ";application/*+xml;image/*+xml";

        /// <summary>
        /// Default cache class implementation for caching static content
        /// </summary>
        public static readonly IStaticCache DefaultMemoryCache = new SimpleMemoryStaticCache();
        private static IStaticCache defaultCache = DefaultMemoryCache;

        private int maxAge;

        /// <summary>
        /// Creates a new instance with defaults
        /// </summary>
        protected StaticSettingsBase()
        {
            Expires = DateTimeOffset.MinValue;
            RedirectIfFolderFound = true;
            DefaultFile = DefaultFileValue;
            CompressedContentTypes = DefaultCompressedTypesFilter;
        }

        /// <summary>
        /// Default memory cache that will used in the middleware if custom cache was not set.
        /// </summary>
        public static IStaticCache DefaultCache
        {
            get => defaultCache;
            set => defaultCache = value ?? DefaultMemoryCache;
        }

        /// <summary>
        /// If files in the collection should be cached
        /// </summary>
        public bool Cached { get; set; }

        /// <summary>
        /// Cache implementation. In Memory Cache will be used by default
        /// </summary>
        public IStaticCache Cache { get; set; }

        /// <summary>
        /// Expires header value for the static content
        /// </summary>
        public DateTimeOffset Expires { get; set; }

        /// <summary>
        /// Max age value for the static content in seconds
        /// </summary>
        public int MaxAge
        {
            get => maxAge;
            set => maxAge = value < 0 ? 0 : value;
        }

        /// <summary>
        /// Max age value for the static content as expression. Supported numbers (one-twelve | 0-...) and periods
        /// (second(s) | sec(s) | minute(s) | min(s) | hour(s) | day(s) | week(s) | month(s) | year(s))
        /// <example>
        /// 1Day
        /// </example>
        /// <example>
        /// oneDay
        /// </example>
        /// <example>
        /// threeYearsTwoweeksFiveDays
        /// </example>
        /// <example>
        /// Year5Days
        /// </example>
        /// </summary>
        public string MaxAgeExpression
        {
            set { maxAge = value.ToMaxAge(); }
        }

        /// <summary>
        /// Default file in the directory. index.html by default
        /// </summary>
        public string DefaultFile { get; set; }

        /// <summary>
        /// Send redirect request if user requested folder without slash: http://someFolder -> http://someFolder/.
        /// Is true by default
        /// </summary>
        public bool RedirectIfFolderFound { get; set; }

        /// <summary>
        /// The file pattern for the files that should be included into the collection
        /// </summary>
        public string Include { get; set; }

        /// <summary>
        /// The file pattern for the files that should be excluded from the collection
        /// </summary>
        public string Exclude { get; set; }

        /// <summary>
        /// The pattern for content types that can be compressed in the response
        /// </summary>
        /// <value>The compressed content types in filter like representation.</value>
        public string CompressedContentTypes { get; set; }
    }
}


text:
const getByType = (method, type, requestContentType, postData, url) => {
  return new Promise((resolve, reject) => {
    var xhr = new window.XMLHttpRequest()
    xhr.open(method, url, true)
    xhr.responseType = type
    if (requestContentType) {
      xhr.setRequestHeader('Content-Type', requestContentType)
    }
    xhr.onload = () => {
      // var status = xhr.status
      if (xhr.status === 200) {
        resolve(xhr.response)
      } else {
        reject(xhr.status)
      }
    }
    xhr.onerror = e => reject(e)
    if (postData &&
        requestContentType === 'application/json' &&
        typeof postData === 'object') {
      xhr.send(JSON.stringify(postData))
    } else if (postData) {
      xhr.send(postData)
    } else {
      xhr.send()
    }
  })
}

const getJSON = getByType.bind(null, 'GET', 'json', undefined, undefined)
const getText = getByType.bind(null, 'GET', 'text', undefined, undefined)
const getHtml = getText

/**
 * Fetch a single blog post
 */
export function fetchBlogPost (id) {
  return getJSON(`/api/blog/${id}`)
}

/**
 * Fetch a single markdown path
 */
export function fetchMarkdown (id) {
  return getText(`/markdown/${id}`)
}

/**
 * Fetch a single html fragment page
 */
export function fetchHtml (id) {
  return getHtml(`/html/${id}`)
}

/**
 * Fetch a bunch of blog posts
 */
export function fetchBlogPosts (filter) {
  let urlParams = ''
  if (filter.page) {
    urlParams = `?page=${filter.page}`
  }
  if (filter && filter.year) {
    return getJSON(`/api/blog/posted/${filter.year}${urlParams}`)
  } else if (filter && filter.tag) {
    return getJSON(`/api/blog/tagged/${filter.tag}${urlParams}`)
  }
  return getJSON(`/api/blog${urlParams}`)
}

/**
 * Fetch a list of tags
 */
export function fetchTags () {
  return getJSON('/api/tags')
}


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen 2.8.0" />

	<title>Class WC_Validation | WooCommerce</title>

	<link rel="stylesheet" type="text/css" media="all" href="resources/bootstrap.min-2450451432.css" />
	<link rel="stylesheet" type="text/css" media="all" href="resources/style-1319793728.css" />

				WooCommerce

							Package

Class

							Tree

							Download

							← Back to WooDocs

		<form id="search" class="form-search">
			<input type="hidden" name="cx" value="" />
			<input type="hidden" name="ie" value="UTF-8" />
			<input type="text" name="q" class="search-query" placeholder="Search" />
		</form>

Packages

WooCommerce

Abstracts

Admin

Coupons

Dashboard

Import

Importers

Install

Orders

Products

Reports

Settings

System

Taxonomies

Updates

Users

WritePanels

Classes

Emails

Integrations

Payment

Products

Shipping

Walkers

Functions

AJAX

Shortcodes

Cart

Change

Password

Checkout

Edit

Address

Lost

Password

My

Account

Order

Tracking

Pay

Thankyou

View

Order

Templates

Archives

Cart

Checkout

Forms

Loop

Orders

Product

Tabs

Widgets

Classes

WC_API

WC_Cache_Helper

WC_Cart

WC_Checkout

WC_Countries

WC_Coupon

WC_Customer

WC_Logger

WC_Order

WC_Order_Item_Meta

WC_Product_Factory

WC_Product_Variation

WC_Query

WC_Session_Handler

WC_Shortcodes

WC_Tax

WC_Validation

Class WC_Validation

Contains Validation functions

		Package: WooCommerce\Classes

				Category:
				Class

				Author:
				WooThemes

				Version:
				1.6.4

				Class:
				WC_Validation

		Located at classes/class-wc-validation.php

Methods summary

				 public
				boolean

			#
			is_email( string <var>$email</var> )

Validates an email using wordpress native is_email function

Validates an email using wordpress native is_email function

Parameters

<var>$email</var>

string
email address

Returns

						boolean

				 public
				boolean

			#
			is_phone( string <var>$phone</var> )

Validates a phone number using a regular expression

Validates a phone number using a regular expression

Parameters

<var>$phone</var>

string
phone number

Returns

						boolean

				 public
				boolean

			#
			is_postcode( string <var>$postcode</var>, string <var>$country</var> )

Checks for a valid postcode (UK)

Checks for a valid postcode (UK)

Parameters

<var>$postcode</var>

string
postcode

<var>$country</var>

string
country

Returns

						boolean

				 public
				boolean

			#
			is_GB_postcode( mixed <var>$toCheck</var> )

is_GB_postcode function.

is_GB_postcode function.

Parameters

<var>$toCheck</var>

mixed
$toCheck A postcode

Returns

						boolean

Author

							John Gardner

				 public
				string

			#
			format_postcode( string <var>$postcode</var>, string <var>$country</var> )

Format the postcode according to the country and length of the postcode

Format the postcode according to the country and length of the postcode

Parameters

<var>$postcode</var>

string
postcode

<var>$country</var>

string
country

Returns

						string
formatted postcode

				 public
				string

			#
			format_phone( mixed <var>$tel</var> )

format_phone function.

format_phone function.

Parameters

<var>$tel</var>

mixed
$tel

Returns

						string

Magic methods summary

		WooCommerce API documentation generated by ApiGen 2.8.0


text:
date: 2017-04-13
title: "Open Source Radio"
speaker: "Dan Zeleznikar"
type: "Meeting"
---

<!-- INSERT TEXT HERE -->
This Thursday, April 13, at 19:00 in Dreese Labs 264, join the Open Source Club and Dan Zeleznikar, Ohio State ECE alumni and current LGS Signal Processing Engineer, for an overview of open source HW/SW that can be used for radio communications transceivers, including a demo of reverse engineering the controls of an RC car. Attendees are encouraged to bring their own RC toys for experimentation as well. Feel free to bring resumes, and dinner will be provided!

<!-- generated by _helpers/newPost.rb -->


text:
using TA.NetMF.NetworkCommandProtocol.CommandProcessors;

namespace TA.NetMF.NetworkCommandProtocol.CommandTargets
    {
    internal class TemperatureProbe : ICommandTarget
        {
        readonly string deviceAddress;

        public TemperatureProbe(string deviceAddress)
            {
            this.deviceAddress = deviceAddress;
            }

        internal double Temperature { get { return 12.5; } }

        public ICommandProcessor[] GetCommandProcessors()
            {
            var temperature = new Temperature(deviceAddress, this);
            var processors = new ICommandProcessor[] {temperature};
            return processors;
            }
        }
    }


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

	<modelVersion>4.0.0</modelVersion>

	<groupId>com.opnitech.rules</groupId>
	<artifactId>ez-rules</artifactId>
	<version>0.7-beta-SNAPSHOT</version>

	<modules>
		<module>ez-rules-core</module>
		<module>ez-rules-samples</module>
	</modules>

	<name>Easy Rules Framework</name>
	<description>Easy Rule is a light framework that allow the users to model the business behavior as rules</description>
	<url>http://opnitech.com/content/documentation/ez-rules-documentation/</url>
	<packaging>pom</packaging>

	<prerequisites>
		<maven>3.0.4</maven>
	</prerequisites>

	<developers>
		<developer>
			<id>rigregs</id>
			<name>Rigre Gregorio Garciandia Sonora</name>
			<organization>Opnitech</organization>
			<organizationUrl>http://opnitech.com</organizationUrl>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<!-- maven-compiler-plugin -->
		<maven.compiler.target>1.7</maven.compiler.target>
		<maven.compiler.source>1.7</maven.compiler.source>

		<!-- plugins -->
		<ez.nexus-staging-maven-plugin.version>1.6.5</ez.nexus-staging-maven-plugin.version>
		<ez.maven-source-plugin.version>2.2.1</ez.maven-source-plugin.version>
		<ez.maven-javadoc-plugin.version>2.9.1</ez.maven-javadoc-plugin.version>
		<ez.maven-gpg-plugin.version>1.5</ez.maven-gpg-plugin.version>
		<ez.maven-release-plugin.version>2.5</ez.maven-release-plugin.version>
		<ez.maven-compiler-plugin.version>3.3</ez.maven-compiler-plugin.version>
		<ez.build-helper-maven-plugin.version>1.9.1</ez.build-helper-maven-plugin.version>
		<ez.maven-eclipse-plugin.version>2.10</ez.maven-eclipse-plugin.version>

		<!-- project dependencies versions -->
		<ez.org.slf4j.version>1.7.12</ez.org.slf4j.version>
		<ez.junit.version>4.4</ez.junit.version>
		<ez.commons-lang.version>3.4</ez.commons-lang.version>
		<ez.commons-collections.version>3.2.2</ez.commons-collections.version>
	</properties>

	<scm>
		<url>git@github.com:rigregs/ez-rules.git</url>
		<connection>scm:git:git@github.com:rigregs/ez-rules.git</connection>
		<developerConnection>scm:git:git@github.com:rigregs/ez-rules.git</developerConnection>
		<tag>HEAD</tag>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/rigregs/ez-rules/issues</url>
	</issueManagement>

	<ciManagement>
		<system>Jenkins</system>
		<url>https://buildhive.cloudbees.com/job/rigregs/job/ez-rules</url>
	</ciManagement>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://opensource.org/licenses/mit-license.php</url>
		</license>
	</licenses>

	<distributionManagement>
		<snapshotRepository>
			<id>com_opnitech</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>com_opnitech</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<dependencyManagement>
		<dependencies>
			<!-- this project's own modules -->
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>ez-rules-core</artifactId>
				<version>${project.version}</version>
			</dependency>

			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>ez-rules-samples</artifactId>
				<version>${project.version}</version>
			</dependency>

			<!-- SLF4J -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${ez.org.slf4j.version}</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-log4j12</artifactId>
				<version>${ez.org.slf4j.version}</version>
			</dependency>

			<!-- Unit Tests -->
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>${ez.junit.version}</version>
				<scope>test</scope>
			</dependency>

			<!-- Apache commons -->
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-lang3</artifactId>
				<version>${ez.commons-lang.version}</version>
			</dependency>

			<dependency>
				<groupId>commons-collections</groupId>
				<artifactId>commons-collections</artifactId>
				<version>${ez.commons-collections.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>${ez.nexus-staging-maven-plugin.version}</version>
					<extensions>true</extensions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${ez.maven-source-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${ez.maven-javadoc-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${ez.maven-gpg-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>${ez.maven-release-plugin.version}</version>
				</plugin>

				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${ez.maven-compiler-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>${ez.build-helper-maven-plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-eclipse-plugin</artifactId>
					<version>${ez.maven-eclipse-plugin.version}</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<serverId>com_opnitech</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>false</autoReleaseAfterClose>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<useReleaseProfile>false</useReleaseProfile>
					<releaseProfiles>release</releaseProfiles>
					<goals>deploy</goals>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>release-sign</id>
			<activation>
				<property>
					<name>signRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>


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

<title>Uses of Class org.apache.cassandra.cql3.VariableSpecifications (apache-cassandra API)</title>
<meta name="date" content="2015-06-18">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.cassandra.cql3.VariableSpecifications

Packages that use VariableSpecifications

Package
Description

org.apache.cassandra.cql3

org.apache.cassandra.cql3.functions

org.apache.cassandra.cql3.statements

Uses of VariableSpecifications in org.apache.cassandra.cql3

Methods in org.apache.cassandra.cql3 with parameters of type VariableSpecifications

Modifier and Type
Method and Description

void
AbstractMarker.collectMarkerSpecification(VariableSpecifications boundNames)

void
Attributes.collectMarkerSpecification(VariableSpecifications boundNames)

void
ColumnCondition.collectMarkerSpecification(VariableSpecifications boundNames)

Collects the column specification for the bind variables of this operation.

void
Lists.DelayedValue.collectMarkerSpecification(VariableSpecifications boundNames)

void
Lists.SetterByIndex.collectMarkerSpecification(VariableSpecifications boundNames)

void
Maps.DelayedValue.collectMarkerSpecification(VariableSpecifications boundNames)

void
Maps.SetterByKey.collectMarkerSpecification(VariableSpecifications boundNames)

void
Operation.collectMarkerSpecification(VariableSpecifications boundNames)

Collects the column specification for the bind variables of this operation.

void
Sets.DelayedValue.collectMarkerSpecification(VariableSpecifications boundNames)

void
Term.collectMarkerSpecification(VariableSpecifications boundNames)

Collects the column specification for the bind variables in this Term.

void
Term.Terminal.collectMarkerSpecification(VariableSpecifications boundNames)

void
Tuples.DelayedValue.collectMarkerSpecification(VariableSpecifications boundNames)

Uses of VariableSpecifications in org.apache.cassandra.cql3.functions

Methods in org.apache.cassandra.cql3.functions with parameters of type VariableSpecifications

Modifier and Type
Method and Description

void
FunctionCall.collectMarkerSpecification(VariableSpecifications boundNames)

Uses of VariableSpecifications in org.apache.cassandra.cql3.statements

Methods in org.apache.cassandra.cql3.statements that return VariableSpecifications

Modifier and Type
Method and Description

VariableSpecifications
ParsedStatement.getBoundVariables()

Methods in org.apache.cassandra.cql3.statements with parameters of type VariableSpecifications

Modifier and Type
Method and Description

ModificationStatement
ModificationStatement.Parsed.prepare(VariableSpecifications boundNames)

protected ModificationStatement
DeleteStatement.Parsed.prepareInternal(CFDefinition cfDef,
               VariableSpecifications boundNames,
               Attributes attrs)

protected abstract ModificationStatement
ModificationStatement.Parsed.prepareInternal(CFDefinition cfDef,
               VariableSpecifications boundNames,
               Attributes attrs)

protected ModificationStatement
UpdateStatement.ParsedInsert.prepareInternal(CFDefinition cfDef,
               VariableSpecifications boundNames,
               Attributes attrs)

protected ModificationStatement
UpdateStatement.ParsedUpdate.prepareInternal(CFDefinition cfDef,
               VariableSpecifications boundNames,
               Attributes attrs)

void
ModificationStatement.processWhereClause(java.util.List<Relation> whereClause,
                  VariableSpecifications names)

Constructors in org.apache.cassandra.cql3.statements with parameters of type VariableSpecifications

Constructor and Description

ParsedStatement.Prepared(CQLStatement statement,
                        VariableSpecifications names)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2015 The Apache Software Foundation


text:
====================
Installation & Setup
====================

Installation
============

Install via ``pip``.

To download latest dev version:

::

    $ pip install git+git://github.com/scdoshi/django-notifier.git

From PyPI (latest release):

::

    $ pip install django-notifier

Setup
=====

1. Add ``notifier`` to INSTALLED_APPS in your django settings file.

    ::

        INSTALLED_APPS = (
            ...
            'notifier',
            ...
        )

2. Settings

    If you are going to use any custom backends to send notifications, add the setting NOTIFIER_BACKENDS to your settings file. If this setting is not defined, only the EmailBackend is used by default.

    ::

        NOTIFIER_BACKENDS = (
            'notifier.backends.EmailBackend',
            'path.to.custom.backend.CustomBackend',
        )

3. Run ``syncdb`` or ``migrate`` (if using South) to create the necessary tables in the database.

    ::

        $ python manage.py syndb

    If using South:

    ::

        $ python manage.py migrate

Terminology
===========

* ``Notification``: A message that can be sent from the system to users (payment declined, email verification).
* ``Backend``: A way to send notifications to users (email, SMS etc.)


text:
package com.spun.util.database;

import java.sql.Array;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.NClob;
import java.sql.PreparedStatement;
import java.sql.SQLClientInfoException;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Savepoint;
import java.sql.Statement;
import java.sql.Struct;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executor;

import com.sshtools.j2ssh.SshClient;

/***********************************************************************/
public class SshConnection implements Connection {
	private Connection con;
	private SshClient ssh;

	/***********************************************************************/
	private void closeSsh() {
		ssh.disconnect();
		ssh = null;
	}

	/***********************************************************************/
	public SshConnection(SshClient ssh, Connection connection) {
		this.ssh = ssh;
		this.con = connection;
	}

	/***********************************************************************/
	public int getHoldability() throws SQLException {
		return con.getHoldability();
	}

	/***********************************************************************/
	public int getTransactionIsolation() throws SQLException {
		return con.getTransactionIsolation();
	}

	/***********************************************************************/
	public void clearWarnings() throws SQLException {
		con.clearWarnings();
	}

	/***********************************************************************/
	public void close() throws SQLException {
		if (con != null) {
			con.close();
			closeSsh();
			con = null;
		}
	}

	/***********************************************************************/
	public void commit() throws SQLException {
		con.commit();
	}

	/***********************************************************************/
	public void rollback() throws SQLException {
		con.rollback();
	}

	/***********************************************************************/
	public boolean getAutoCommit() throws SQLException {
		return con.getAutoCommit();
	}

	/***********************************************************************/
	public boolean isClosed() throws SQLException {
		return con.isClosed();
	}

	/***********************************************************************/
	public boolean isReadOnly() throws SQLException {
		return con.isReadOnly();
	}

	/***********************************************************************/
	public void setHoldability(int holdability) throws SQLException {
		con.setHoldability(holdability);
	}

	/***********************************************************************/
	public void setTransactionIsolation(int level) throws SQLException {
		con.setTransactionIsolation(level);
	}

	/***********************************************************************/
	public void setAutoCommit(boolean autoCommit) throws SQLException {
		con.setAutoCommit(autoCommit);
	}

	/***********************************************************************/
	public void setReadOnly(boolean readOnly) throws SQLException {
		con.setReadOnly(readOnly);
	}

	/***********************************************************************/
	public String getCatalog() throws SQLException {
		return con.getCatalog();
	}

	/***********************************************************************/
	public void setCatalog(String catalog) throws SQLException {
		con.setCatalog(catalog);
	}

	/***********************************************************************/
	public DatabaseMetaData getMetaData() throws SQLException {
		return con.getMetaData();
	}

	/***********************************************************************/
	public SQLWarning getWarnings() throws SQLException {
		return con.getWarnings();
	}

	/***********************************************************************/
	public Savepoint setSavepoint() throws SQLException {
		return con.setSavepoint();
	}

	/***********************************************************************/
	public void releaseSavepoint(Savepoint savepoint) throws SQLException {
		con.releaseSavepoint(savepoint);
	}

	/***********************************************************************/
	public void rollback(Savepoint savepoint) throws SQLException {
		con.rollback(savepoint);
	}

	/***********************************************************************/
	public Statement createStatement() throws SQLException {
		return con.createStatement();
	}

	/***********************************************************************/
	public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
		return con.createStatement(resultSetType, resultSetConcurrency);
	}

	/***********************************************************************/
	public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
		return con.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
	}

	/***********************************************************************/
	public Map getTypeMap() throws SQLException {
		return con.getTypeMap();
	}

	/***********************************************************************/
	public void setTypeMap(Map<String, Class<?>> arg0) throws SQLException {
		con.setTypeMap(arg0);
	}

	/***********************************************************************/
	public String nativeSQL(String sql) throws SQLException {
		return con.nativeSQL(sql);
	}

	/***********************************************************************/
	public CallableStatement prepareCall(String sql) throws SQLException {
		return con.prepareCall(sql);
	}

	/***********************************************************************/
	public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
		return con.prepareCall(sql, resultSetType, resultSetConcurrency);
	}

	/***********************************************************************/
	public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
		return con.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
	}

	/***********************************************************************/
	public PreparedStatement prepareStatement(String sql) throws SQLException {
		return con.prepareStatement(sql);
	}

	/***********************************************************************/
	public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
		return con.prepareStatement(sql, autoGeneratedKeys);
	}

	/***********************************************************************/
	public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
		return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
	}

	/***********************************************************************/
	public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
		return con.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
	}

	/***********************************************************************/
	public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
		return con.prepareStatement(sql, columnIndexes);
	}

	/***********************************************************************/
	public Savepoint setSavepoint(String name) throws SQLException {
		return con.setSavepoint(name);
	}

	/***********************************************************************/
	public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
		return con.prepareStatement(sql, columnNames);
	}

	/***********************************************************************/
	protected void finalize() throws Throwable {
		super.finalize();
		close();
	}

	/***********************************************************************/
	public Array createArrayOf(String arg0, Object[] arg1) throws SQLException {
		return con.createArrayOf(arg0, arg1);
	}

	/***********************************************************************/
	public Blob createBlob() throws SQLException {
		return con.createBlob();
	}

	/***********************************************************************/
	public Clob createClob() throws SQLException {
		return con.createClob();
	}

	/***********************************************************************/
	public NClob createNClob() throws SQLException {
		return con.createNClob();
	}

	/***********************************************************************/
	public SQLXML createSQLXML() throws SQLException {
		return con.createSQLXML();
	}

	/***********************************************************************/
	public Struct createStruct(String arg0, Object[] arg1) throws SQLException {
		return con.createStruct(arg0, arg1);
	}

	/***********************************************************************/
	public Properties getClientInfo() throws SQLException {
		return con.getClientInfo();
	}

	/***********************************************************************/
	public String getClientInfo(String arg0) throws SQLException {
		return con.getClientInfo(arg0);
	}

	/***********************************************************************/
	public boolean isValid(int arg0) throws SQLException {
		return con.isValid(arg0);
	}

	/***********************************************************************/
	public void setClientInfo(Properties arg0) throws SQLClientInfoException {
		con.setClientInfo(arg0);
	}

	/***********************************************************************/
	public void setClientInfo(String arg0, String arg1) throws SQLClientInfoException {
		con.setClientInfo(arg0, arg1);
	}

	/***********************************************************************/
	public boolean isWrapperFor(Class<?> arg0) throws SQLException {
		return con.isWrapperFor(arg0);
	}

	/***********************************************************************/
	public <T> T unwrap(Class<T> arg0) throws SQLException {
		return con.unwrap(arg0);
	}

	/***********************************************************************/
	/***********************************************************************/
	public void abort(Executor executor) throws SQLException {
		// TODO Auto-generated method stub
	}

	public int getNetworkTimeout() throws SQLException {
		// TODO Auto-generated method stub
		return 0;
	}

	public String getSchema() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
		// TODO Auto-generated method stub
	}

	public void setSchema(String schema) throws SQLException {
		// TODO Auto-generated method stub
	}
}


text:
import React from 'react';
import PropTypes from 'prop-types';

class TextInput extends React.Component {
    refInput = React.createRef();

    handleChange = event => {
        let {
            value,
            validity: { valid }
        } = event.target;
        value = value.trim();
        if (valid && value.length) {
            this.props.onChange(value);
        } else {
            this.props.onChange(null);
        }
    };

    clear() {
        this.input.clear();
        this.props.onChange(null);
    }

    render() {
        let className = 'form-element-block';
        if (this.props.required) {
            className += ' check-validity';
        }
        return (
            <input
                type="text"
                className={className}
                id={this.props.id}
                pattern={this.props.pattern || null}
                required={this.props.required}
                onChange={this.handleChange}
                placeholder={this.props.placeholder}
                defaultValue={this.props.value}
            />
        );
    }
}

TextInput.propTypes = {
    // Callback receiving the validated text input.
    onChange: PropTypes.func.isRequired,

    // CSS id for the text input.
    id: PropTypes.string.isRequired,

    // Placeholder of the input.
    placeholder: PropTypes.string,

    // A regular expression that the value will be checked against on form submission.
    pattern: PropTypes.string,

    // An initial value for the input.
    value: PropTypes.string,

    // Whether the text input is required.
    required: PropTypes.bool
};

TextInput.defaultProps = {
    value: '',
    required: false
};

export default TextInput;


text:
function Start-TestFixture
{
    & (Join-Path -Path $PSScriptRoot -ChildPath '..\Import-CarbonForTest.ps1' -Resolve)
}

function Test-ShouldGetCanonicalCaseForDirectory
{
    $currentDir = (Resolve-Path '.').Path
    foreach( $badPath in ($currentDir.ToUpper(),$currentDir.ToLower()) )
    {
        $canonicalCase = Resolve-PathCase -Path $badPath
        Assert-True ($currentDir -ceq $canonicalCase) ('{0} != {1}' -f $currentDir,$canonicalCase)
    }
}

function Test-ShouldGetCanonicalCaseForFile
{
    $currentFile = Join-Path $TestDir 'Test-ResolvePathCase.ps1' -Resolve
    $canonicalCase = Resolve-PathCase -Path ($currentFile.ToUpper())
    Assert-True ($currentFile -ceq $canonicalCase) ('{0} != {1}' -f $currentFile,$canonicalCase)
}

function Test-ShouldNotGetCaseForFileThatDoesNotExist
{
    $error.Clear()
    $result = Resolve-PathCase 'C:\I\Do\Not\Exist' -ErrorAction SilentlyContinue
    Assert-False $result
    Assert-Equal 1 $error.Count
}

function Test-ShouldAcceptPipelineInput
{
    $gotSomething = $false
    Get-ChildItem 'C:\WINDOWS' |
        ForEach-Object {
            Assert-True ($_.FullName.StartsWith( 'C:\WINDOWS' ) )
            $_
        } |
        Resolve-PathCase |
        ForEach-Object {
            $gotSomething = $true
            Assert-True ( $_.StartsWith( 'C:\Windows' ) ) ('{0} doesn''t start with C:\Windows' -f $_)
        }
    Assert-True $gotSomething

}

function Test-ShouldGetRelativePath
{
    Push-Location -Path $PSScriptRoot
    try
    {
        $path = '..\..\Carbon\Import-Carbon.ps1'
        $canonicalCase = Resolve-PathCase ($path.ToUpper())
        Assert-Equal (Resolve-Path -Path $path).Path $canonicalCase -CaseSensitive

    }
    finally
    {
        Pop-Location
    }
}

function Test-ShouldGetPathToShare
{
    $shareName = Get-WmiObject 'Win32_Share' | Where-Object { $_.Name -notlike '*$' } | Select-Object -First 1 | Select-Object -ExpandProperty 'Name'
    if( -not $shareName )
    {
        Fail ('Computer {0} has no shares. Need a share to exist so we can test Resolve-PathCase.' -f $env:COMPUTERNAME)
    }

    $path = '\\{0}\{1}' -f $env:COMPUTERNAME,$shareName
    $path = Get-ChildItem -Path $path | Select-Object -First 1 | Select-Object -ExpandProperty 'FullName'

    $canonicalCase = Resolve-PathCase ($path.ToUpper()) -ErrorAction SilentlyContinue
    Assert-Error -Last -Regex 'UNC .* not supported'
    Assert-Null $canonicalCase

}


text: Sample Javascript Program to be used for BSA Programming Merit Badge


text:
/*
* Bluetooth.cpp
*
* Created: 8/20/2014 1:35:23 PM
*  Author: Sonny
*/
#include "Bluetooth.h"

aci_evt_opcode_t laststatus = ACI_EVT_DISCONNECTED;

void Bluetooth::setBLESerial(Adafruit_BLE_UART *BTLEserial) {
    serial = BTLEserial;
}

void Bluetooth::enableBluetooth() {
    serial->begin();
}

void Bluetooth::sendSystemStatus(int systemStatus) {
    char test[20];
    sprintf(test, "%d", systemStatus);
    String res = test;
    sendData(res);
}

void Bluetooth::sendData(String msg) {
    uint8_t sendbuffer[20];
    msg.getBytes(sendbuffer, 20);
    char sendbuffersize = min(20, msg.length());
    serial->write(sendbuffer, sendbuffersize);
}

void Bluetooth::checkBluetooth(void (*bleCallback)(BLUETOOTH_STATE)) {
    serial->pollACI();
    // Ask what is our current status
    aci_evt_opcode_t status = serial->getState();
    // If the status changed....
    if (status != laststatus) {
        // print it out!
        if (status == ACI_EVT_DEVICE_STARTED) {
            bleCallback(ADVERTISING);
            Serial.println(F("* Advertising started"));
        }
        if (status == ACI_EVT_CONNECTED) {
            Serial.println(F("* Connected! HERE"));
            bleCallback(CONNECTED);
        }
        if (status == ACI_EVT_DISCONNECTED) {
            Serial.println(F("* Disconnected or advertising timed out"));
            bleCallback(DISCONNECTED);
        }
        // OK set the last status change to this one
        laststatus = status;
    }

    if (status == ACI_EVT_CONNECTED) {
        // Lets see if there's any data for us!
        // OK while we still have something to read, get a character and print it out
        char returnValue = 0;
        while (serial->available()) {
            char c = serial->read();
            Serial.print(c);
            returnValue = 1;
            if(returnValue) {
                bleCallback(CONFIRMED);
            }
        }
    }
}


text:
package gosnmp

import (
	"bytes"
	"errors"
	"fmt"
	"math"
	"math/big"
	"math/rand"
	"net"
	"strconv"
	"strings"
)

// Generate a valid SNMP request ID.
func getRandomRequestID() uint32 {
	return uint32(rand.Int31())
}

func decodeValue(data []byte, msg string) (retVal *Variable, err error) {
	dumpBytes1(data, fmt.Sprintf("decodeValue: %s", msg), 16)
	retVal = new(Variable)

	switch ASN1BER(data[0]) {

	case Integer:
		// 0x02. signed
		slog.Print("decodeValue: type is Integer")
		length, cursor := parseLength(data)
		var ret int
		var err error
		if ret, err = parseInt(data[cursor:length]); err != nil {
			slog.Printf("%v:", err)
			return retVal, fmt.Errorf("bytes: % x err: %v", data, err)
		}
		retVal.Type = Integer
		retVal.Value = ret
	case OctetString:
		// 0x04
		slog.Print("decodeValue: type is OctetString")
		length, cursor := parseLength(data)
		retVal.Type = OctetString
		if data[cursor] == 0 && length == 2 {
			retVal.Value = ""
		} else if data[cursor] == 0 {
			retVal.Value = fmt.Sprintf("% x", data[cursor:length])
		} else {
			retVal.Value = string(data[cursor:length])
		}
	case Null:
		// 0x05
		slog.Print("decodeValue: type is Null")
		retVal.Type = Null
		retVal.Value = nil
	case ObjectIdentifier:
		// 0x06
		slog.Print("decodeValue: type is ObjectIdentifier")
		rawOid, _, err := parseRawField(data, "OID")
		if err != nil {
			return nil, fmt.Errorf("Error parsing OID Value: %s", err.Error())
		}
		var oid []int
		var ok bool
		if oid, ok = rawOid.([]int); !ok {
			return nil, fmt.Errorf("unable to type assert rawOid |%v| to []int", rawOid)
		}
		retVal.Type = ObjectIdentifier
		retVal.Value = oidToString(oid)
	case IPAddress:
		// 0x40
		slog.Print("decodeValue: type is IpAddress")
		retVal.Type = IPAddress
		switch data[1] {
		case 4: // IPv4
			if len(data) < 6 {
				return nil, fmt.Errorf("not enough data for ipv4 address: %x", data)
			}
			retVal.Value = net.IPv4(data[2], data[3], data[4], data[5]).String()
		case 16: // IPv6
			if len(data) < 18 {
				return nil, fmt.Errorf("not enough data for ipv6 address: %x", data)
			}
			d := make(net.IP, 16)
			copy(d, data[2:17])
			retVal.Value = d.String()
		default:
			return nil, fmt.Errorf("got ipaddress len %d, expected 4 or 16", data[1])
		}
	case Counter32:
		// 0x41. unsigned
		slog.Print("decodeValue: type is Counter32")
		length, cursor := parseLength(data)
		ret, err := parseUint(data[cursor:length])
		if err != nil {
			slog.Printf("decodeValue: err is %v", err)
			break
		}
		retVal.Type = Counter32
		retVal.Value = ret
	case Gauge32:
		// 0x42. unsigned
		slog.Print("decodeValue: type is Gauge32")
		length, cursor := parseLength(data)
		ret, err := parseUint(data[cursor:length])
		if err != nil {
			slog.Printf("decodeValue: err is %v", err)
			break
		}
		retVal.Type = Gauge32
		retVal.Value = ret
	case TimeTicks:
		// 0x43
		slog.Print("decodeValue: type is TimeTicks")
		length, cursor := parseLength(data)
		ret, err := parseInt(data[cursor:length])
		if err != nil {
			slog.Printf("decodeValue: err is %v", err)
			break
		}
		retVal.Type = TimeTicks
		retVal.Value = ret
	case Counter64:
		// 0x46
		slog.Print("decodeValue: type is Counter64")
		length, cursor := parseLength(data)
		ret, err := parseInt64(data[cursor:length])
		if err != nil {
			slog.Printf("decodeValue: err is %v", err)
			break
		}
		retVal.Type = Counter64
		retVal.Value = ret
	case NoSuchObject:
		// 0x80
		slog.Print("decodeValue: type is NoSuchObject")
		retVal.Type = NoSuchObject
		retVal.Value = nil
	case NoSuchInstance:
		// 0x81
		slog.Print("decodeValue: type is NoSuchInstance")
		retVal.Type = NoSuchInstance
		retVal.Value = nil
	case EndOfMibView:
		// 0x82
		slog.Print("decodeValue: type is EndOfMibView")
		retVal.Type = EndOfMibView
		retVal.Value = nil
	default:
		slog.Printf("decodeValue: type %x isn't implemented", data[0])
		retVal.Type = UnknownType
		retVal.Value = nil
	}

	slog.Printf("decodeValue: value is %#v", retVal.Value)
	return
}

//dump bytes in a format similar to Wireshark
func dumpBytes1(data []byte, msg string, maxlength int) {
	for i, b := range data {
		if i >= maxlength {
			break
		}
		if (i % 8) == 0 {
			msg += "\n"
			msg += fmt.Sprintf("%3d ", i)
		} else if i == 0 {
			msg += fmt.Sprintf("%3d ", 0)
		}
		msg += fmt.Sprintf(" %02x", b)
	}
	slog.Print(msg)
}

// dump bytes in one row, up to about screen width. Returns a string
// rather than (dumpBytes1) writing to debugging log.
func dumpBytes2(desc string, bb []byte, cursor int) string {
	cursor = cursor - 4 // give some context to dump
	if cursor < 0 {
		cursor = 0
	}
	result := desc
	for i, b := range bb[cursor:] {
		if i > 30 { // about screen width...
			break
		}
		result += fmt.Sprintf(" %02x", b)
	}
	return result
}

func marshalBase128Int(out *bytes.Buffer, n int64) (err error) {
	if n == 0 {
		_ = out.WriteByte(0)
		return
	}

	l := 0
	for i := n; i > 0; i >>= 7 {
		l++
	}

	for i := l - 1; i >= 0; i-- {
		o := byte(n >> uint(i*7))
		o &= 0x7f
		if i != 0 {
			o |= 0x80
		}
		_ = out.WriteByte(o)
	}

	return nil
}

func oidToString(oid []int) (ret string) {
	values := make([]interface{}, len(oid))
	for i, v := range oid {
		values[i] = v
	}
	return fmt.Sprintf(strings.Repeat(".%d", len(oid)), values...)
}

// parseBase128Int parses a base-128 encoded int from the given offset in the
// given byte slice. It returns the value and the new offset.
func parseBase128Int(bytes []byte, initOffset int) (ret, offset int, err error) {
	offset = initOffset
	for shifted := 0; offset < len(bytes); shifted++ {
		if shifted > 4 {
			err = fmt.Errorf("Structural Error: base 128 integer too large")
			return
		}
		ret <<= 7
		b := bytes[offset]
		ret |= int(b & 0x7f)
		offset++
		if b&0x80 == 0 {
			return
		}
	}
	err = fmt.Errorf("Syntax Error: truncated base 128 integer")
	return
}

// parseBitString parses an ASN.1 bit string from the given byte slice and returns it.
func parseBitString(bytes []byte) (ret BitStringValue, err error) {
	if len(bytes) == 0 {
		err = errors.New("zero length BIT STRING")
		return
	}
	paddingBits := int(bytes[0])
	if paddingBits > 7 ||
		len(bytes) == 1 && paddingBits > 0 ||
		bytes[len(bytes)-1]&((1<<bytes[0])-1) != 0 {
		err = errors.New("invalid padding bits in BIT STRING")
		return
	}
	ret.BitLength = (len(bytes)-1)*8 - paddingBits
	ret.Bytes = bytes[1:]
	return
}

// parseInt64 treats the given bytes as a big-endian, signed integer and
// returns the result.
func parseInt64(bytes []byte) (ret int64, err error) {
	if len(bytes) > 8 {
		// We'll overflow an int64 in this case.
		err = errors.New("integer too large")
		return
	}
	for bytesRead := 0; bytesRead < len(bytes); bytesRead++ {
		ret <<= 8
		ret |= int64(bytes[bytesRead])
	}

	// Shift up and down in order to sign extend the result.
	ret <<= 64 - uint8(len(bytes))*8
	ret >>= 64 - uint8(len(bytes))*8
	return
}

// parseInt treats the given bytes as a big-endian, signed integer and returns
// the result.
func parseInt(bytes []byte) (int, error) {
	ret64, err := parseInt64(bytes)
	if err != nil {
		return 0, err
	}
	if ret64 != int64(int(ret64)) {
		return 0, errors.New("integer too large")
	}
	return int(ret64), nil
}

// parseLength parses and calculates an snmp packet lengths
// http://luca.ntop.org/Teaching/Appunti/asn1.html
//
// Length octets. There are two forms: short (for lengths between 0 and 127),
// and long definite (for lengths between 0 and 2^1008 -1).
//
// * Short form. One octet. Bit 8 has value "0" and bits 7-1 give the length.
// * Long form. Two to 127 octets. Bit 8 of first octet has value "1" and bits
//   7-1 give the number of additional length octets. Second and following
//   octets give the length, base 256, most significant digit first.
func parseLength(bytes []byte) (length int, cursor int) {
	if len(bytes) <= 2 {
		// handle null octet strings ie "0x04 0x00"
		cursor = 1
		length = 2
	} else if int(bytes[1]) <= 127 {
		length = int(bytes[1])
		length += 2
		cursor += 2
	} else {
		numOctets := int(bytes[1]) & 127
		for i := 0; i < numOctets; i++ {
			length <<= 8
			length += int(bytes[2+i])
		}
		length += 2 + numOctets
		cursor += 2 + numOctets
	}
	return length, cursor
}

// parseObjectIdentifier parses an OBJECT IDENTIFIER from the given bytes and
// returns it. An object identifier is a sequence of variable length integers
// that are assigned in a hierarchy.
func parseObjectIdentifier(bytes []byte) (s []int, err error) {
	if len(bytes) == 0 {
		err = fmt.Errorf("zero length OBJECT IDENTIFIER")
		return
	}

	// In the worst case, we get two elements from the first byte (which is
	// encoded differently) and then every varint is a single byte long.
	s = make([]int, len(bytes)+1)

	// The first byte is 40*value1 + value2:
	s[0] = int(bytes[0]) / 40
	s[1] = int(bytes[0]) % 40
	i := 2
	for offset := 1; offset < len(bytes); i++ {
		var v int
		v, offset, err = parseBase128Int(bytes, offset)
		if err != nil {
			return
		}
		s[i] = v
	}
	s = s[0:i]
	return
}

func parseRawField(data []byte, msg string) (interface{}, int, error) {
	dumpBytes1(data, fmt.Sprintf("parseRawField: %s", msg), 16)

	switch ASN1BER(data[0]) {
	case Integer:
		var i int
		var err error
		length, cursor := parseLength(data)
		if i, err = parseInt(data[cursor:length]); err != nil {
			return nil, 0, fmt.Errorf("Unable to parse raw INTEGER: %x err: %v", data, err)
		}
		return i, length, nil
	case OctetString:
		length, cursor := parseLength(data)
		return string(data[cursor:length]), length, nil
	case ObjectIdentifier:
		length := int(data[1])
		oid, err := parseObjectIdentifier(data[2 : 2+length])
		return oid, length + 2, err
	default:
		return nil, 0, fmt.Errorf("Unknown field type: %x\n", data[0])
	}
}

func parseUint16(content []byte) int {
	number := uint8(content[1]) | uint8(content[0])<<8
	return int(number)
}

// parseUint64 treats the given bytes as a big-endian, unsigned integer and returns
// the result.
func parseUint64(bytes []byte) (ret uint64, err error) {
	if len(bytes) > 8 {
		// We'll overflow a uint64 in this case.
		err = errors.New("integer too large")
		return
	}
	for bytesRead := 0; bytesRead < len(bytes); bytesRead++ {
		ret <<= 8
		ret |= uint64(bytes[bytesRead])
	}
	return
}

// parseUint treats the given bytes as a big-endian, signed integer and returns
// the result.
func parseUint(bytes []byte) (uint, error) {
	ret64, err := parseUint64(bytes)
	if err != nil {
		return 0, err
	}
	if ret64 != uint64(uint(ret64)) {
		return 0, errors.New("integer too large")
	}
	return uint(ret64), nil
}

//TODO: Figure out if this is still an issue?
// Issue 4389: math/big: add SetUint64 and Uint64 functions to *Int
// uint64ToBigInt copied from: http://github.com/cznic/mathutil/blob/master/mathutil.go#L341
// replace with Uint64ToBigInt or equivalent when using Go 1.1
var uint64ToBigIntDelta big.Int

func init() {
	uint64ToBigIntDelta.SetBit(&uint64ToBigIntDelta, 63, 1)
}

func uint64ToBigInt(n uint64) *big.Int {
	if n <= math.MaxInt64 {
		return big.NewInt(int64(n))
	}

	y := big.NewInt(int64(n - uint64(math.MaxInt64) - 1))
	return y.Add(y, &uint64ToBigIntDelta)
}

// BitStringValue is the structure to use when you want an ASN.1 BIT STRING type. A
// bit string is padded up to the nearest byte in memory and the number of
// valid bits is recorded. Padding bits will be zero.
type BitStringValue struct {
	Bytes     []byte // bits packed into bytes.
	BitLength int    // length in bits.
}

// At returns the bit at the given index. If the index is out of range it
// returns false.
func (b BitStringValue) At(i int) int {
	if i < 0 || i >= b.BitLength {
		return 0
	}
	x := i / 8
	y := 7 - uint(i%8)
	return int(b.Bytes[x]>>y) & 1
}

// RightAlign returns a slice where the padding bits are at the beginning. The
// slice may share memory with the BitString.
func (b BitStringValue) RightAlign() []byte {
	shift := uint(8 - (b.BitLength % 8))
	if shift == 8 || len(b.Bytes) == 0 {
		return b.Bytes
	}

	a := make([]byte, len(b.Bytes))
	a[0] = b.Bytes[0] >> shift
	for i := 1; i < len(b.Bytes); i++ {
		a[i] = b.Bytes[i-1] << (8 - shift)
		a[i] |= b.Bytes[i] >> shift
	}

	return a
}

func (s SNMPVersion) String() string {
	if s == Version1 {
		return "1"
	}
	return "2c"
}

// Partition - returns true when dividing a slice into
// partition_size lengths, including last partition which may be smaller
// than partition_size. This is useful when you have a large array of OIDs
// to run Get() on. See the tests for example usage.
//
// For example for a slice of 8 items to be broken into partitions of
// length 3, Partition returns true for the current_position having
// the following values:
//
// 0  1  2  3  4  5  6  7
//       T        T     T
//
func Partition(curPos, partitionSize, sliceLen int) bool {
	if curPos < 0 || curPos >= sliceLen {
		return false
	}
	if partitionSize == 1 { // redundant, but an obvious optimisation
		return true
	}
	if curPos%partitionSize == partitionSize-1 {
		return true
	}
	if curPos == sliceLen-1 {
		return true
	}
	return false
}

// ToBigInt converts SNMPData.Value to big.Int, or returns a zero big.Int for
// non int-like types (eg strings).
//
// This is a convenience function to make working with SNMPData's easier - it
// reduces the need for type assertions. A big.Int is convenient, as SNMP can
// return int32, uint32, and uint64.
func ToBigInt(value interface{}) *big.Int {
	var val int64
	switch value := value.(type) { // shadow
	case int:
		val = int64(value)
	case int8:
		val = int64(value)
	case int16:
		val = int64(value)
	case int32:
		val = int64(value)
	case int64:
		val = int64(value)
	case uint:
		val = int64(value)
	case uint8:
		val = int64(value)
	case uint16:
		val = int64(value)
	case uint32:
		val = int64(value)
	case uint64:
		return (uint64ToBigInt(value))
	case string:
		// for testing and other apps - numbers may appear as strings
		var err error
		if val, err = strconv.ParseInt(value, 10, 64); err != nil {
			return new(big.Int)
		}
	default:
		return new(big.Int)
	}
	return big.NewInt(val)
}


text:
#import "NSObject.h"

#import "TSWPStorageObserver-Protocol.h"

@class TSWPCTTypesetterCache, TSWPStorage;

// Not exported
@interface TSWPLayoutManager : NSObject <TSWPStorageObserver>
{
    id <TSWPLayoutOwner> _owner;
    TSWPStorage *_storage;
    _Bool _isObservingStorage;
    _Bool _useLigatures;
    long long _delta;
    struct _NSRange _dirtyRange;
    TSWPCTTypesetterCache *_typesetterCache;
    struct TSWPTopicNumberHints _cachedTopicNumbers;
}

+ (void)fixColumnBoundsForTarget:(id)arg1 storage:(id)arg2 charIndex:(unsigned long long)arg3 firstColumnIndex:(unsigned long long)arg4 precedingHeight:(double)arg5 height:(double)arg6 alreadyHasMargins:(_Bool)arg7 styleProvider:(id)arg8 vertical:(_Bool)arg9;
@property(readonly, nonatomic) struct _NSRange dirtyRange; // @synthesize dirtyRange=_dirtyRange;
@property(readonly, nonatomic) TSWPStorage *storage; // @synthesize storage=_storage;
@property(readonly, nonatomic) id <TSWPLayoutOwner> owner; // @synthesize owner=_owner;
- (id).cxx_construct;
- (void).cxx_destruct;
- (int)p_layoutConfigFlagsForTarget:(id)arg1;
@property(readonly, nonatomic) TSWPCTTypesetterCache *typesetterCache;
- (void)destroyLayoutState:(void *)arg1;
- (void)inflateTarget:(id)arg1 fromHints:(const vector_b76bc591 *)arg2 childHint:(id)arg3 anchoredAttachmentPositions:(id)arg4 topicNumbers:(const struct TSWPTopicNumberHints *)arg5;
- (void)deflateTarget:(id)arg1 intoHints:(vector_b76bc591 *)arg2 childHints:(id [2])arg3 anchoredAttachmentPositions:(id *)arg4 topicNumbers:(struct TSWPTopicNumberHints *)arg5 layoutState:(void *)arg6;
- (void *)layoutStateForLayoutAfterHint:(const CDStruct_6026ced1 *)arg1 childHint:(id)arg2 topicNumbers:(const struct TSWPTopicNumberHints *)arg3 textIsVertical:(_Bool)arg4;
- (void *)layoutIntoTarget:(id)arg1 withLayoutState:(void *)arg2 outSync:(_Bool *)arg3;
- (_Bool)needsLayoutInColumn:(id)arg1;
- (void)storage:(id)arg1 didChangeRange:(struct _NSRange)arg2 delta:(long long)arg3 broadcastKind:(int)arg4;
- (void)clearTypesetterCache;
- (void)clearOwner;
- (id)styleProvider;
- (void)dealloc;
- (id)initWithStorage:(id)arg1 owner:(id)arg2;

@end


text:
package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid.property;

import javax.ws.rs.core.MediaType;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest;
import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
import org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation;
import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class Get_whenRequestHeaders_Accept_ok {

    @Rule
    public IsisWebServerRule webServerRule = new IsisWebServerRule();

    private RestfulClient client;

    private RestfulRequest request;

    @Before
    public void setUp() throws Exception {
        client = webServerRule.getClient();
        request = client.createRequest(RestfulHttpMethod.GET, "objects/org.apache.isis.core.tck.dom.defaults.WithDefaultsEntity/68/properties/anInt");
    }

    @Test
    public void applicationJson_noProfile_returns200() throws Exception {

        request.withHeader(RestfulRequest.Header.ACCEPT, MediaType.APPLICATION_JSON_TYPE);
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.OK));
    }

    @Test
    public void applicationJson_profileObjectProperty_returns200() throws Exception {

        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.OBJECT_PROPERTY.getMediaType());
        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.OK));
    }

    @Test
    public void missingHeader_returns200() throws Exception {

        final RestfulResponse<VersionRepresentation> restfulResp = request.executeT();

        assertThat(restfulResp.getStatus(), is(RestfulResponse.HttpStatusCode.OK));
    }

}


text:
require 'ffi-ncurses'

# newterm2 - how to use newterm to emulate initscr (see also newterm.rb)

def log(*a)
  File.open("ncurses.log", "a") do |file|
    file.puts(a.inspect)
  end
end

module CLib
  extend FFI::Library
  ffi_lib FFI::Library::LIBC
  # FILE* open and close
  typedef :pointer, :FILEP
  attach_function :fdopen, [:int, :string], :FILEP
  attach_function :fopen, [:string, :string], :FILEP
  attach_function :fclose, [:FILEP], :int
end

begin
  input = CLib.fdopen(STDIN.fileno, "rb+")
  output = CLib.fdopen(STDOUT.fileno, "rb+")
  screen = FFI::NCurses.newterm(nil, output, input)
  old_screen = FFI::NCurses.set_term(screen)
  FFI::NCurses.noecho
  FFI::NCurses.border(*([0]*8))
  FFI::NCurses.move(4, 4)
  FFI::NCurses.addstr("Hello")
  FFI::NCurses.refresh
  FFI::NCurses.flushinp
  FFI::NCurses.getch
rescue => e
  log :e1, e
ensure
  begin
    # Watch the ordering of these calls, i.e. do not call delscreen
    # before endwin
    FFI::NCurses.flushinp
    FFI::NCurses.echo
    FFI::NCurses.endwin
    FFI::NCurses.delscreen(screen)
  rescue => e
    log :e2, e
  end
end


text:
#pragma once
#include <aws/kms/KMS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace KMS
{
namespace Model
{
  enum class AlgorithmSpec
  {
    NOT_SET,
    RSAES_PKCS1_V1_5,
    RSAES_OAEP_SHA_1,
    RSAES_OAEP_SHA_256
  };

namespace AlgorithmSpecMapper
{
AWS_KMS_API AlgorithmSpec GetAlgorithmSpecForName(const Aws::String& name);

AWS_KMS_API Aws::String GetNameForAlgorithmSpec(AlgorithmSpec value);
} // namespace AlgorithmSpecMapper
} // namespace Model
} // namespace KMS
} // namespace Aws


text:
/**
 * This plug-in will provide date sorting for the "dd/mm/YYY hh:ii:ss"
 * formatting, which is common in France and other European countries. It can
 * also be quickly adapted for other formatting as required. Furthermore, this
 * date sorting plug-in allows for empty values in the column.
 *
 * Please note that this plug-in is **deprecated*. The
 * [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
 * functionality and flexibility.
 *
 *  @name Date (dd/mm/YYY hh:ii:ss)
 *  @summary Sort date / time in the format `dd/mm/YYY hh:ii:ss`
 *  @author [Ronan Guilloux](http://coolforest.net/)
 *  @deprecated
 *
 *  @example
 *    $('#example').dataTable( {
 *       columnDefs: [
 *         { type: 'date-euro', targets: 0 }
 *       ]
 *    } );
 */

 jQuery.extend( jQuery.fn.dataTableExt.oSort, {
    "date-euro-pre": function ( a ) {
        var x;

        if ( $.trim(a) !== '' ) {
            var frDatea = $.trim(a).split(' ');
            var frTimea = ['00', '00'];
            if(frDatea.length > 1) {
            	frTimea = frDatea[1].split(':');
            }
            var frDatea2 = frDatea[0].split('/');
            x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1]/* + frTimea[2]*/) * 1;
        }
        else {
            x = Infinity;
        }

        return x;
    },

    "date-euro-asc": function ( a, b ) {
        return a - b;
    },

    "date-euro-desc": function ( a, b ) {
        return b - a;
    }
} );


text:
import mocks from '../data/mocks.json'; // eslint-disable-line
import request from 'supertest';
import sinon from 'sinon';
import sizeOf from 'image-size';
import { expect } from 'chai';

import api from '../../server/src/lib/api';
import app from '../../server/src/index';
import config from 'config';

import shieldIONock from '../data/shields.io.nock';

mocks.backers = mocks.users.filter(u => u.tier == 'backer')

describe("avatar", () => {
  let sandbox;
  beforeEach(() => {
    sandbox = sinon.sandbox.create();
    sandbox.stub(api, 'get', () => {
      return Promise.resolve(mocks.users);
    });
  });

  afterEach(() => {
    sandbox.restore();
  });

  it("wraps the avatar of a backer in a 64x64 SVG", (done) => {
    request(app)
      .get('/yeoman/backers/0/avatar.svg')
      .expect('content-type', 'image/svg+xml; charset=utf-8')
      .expect((res) => {
        res.body = sizeOf(res.body);
      })
      .expect(200, { width: 64, height: 64, type: 'svg' }, done);
  });

  it("wraps the logo of a sponsor in a SVG with maxHeight 64", (done) => {
    request(app)
      .get('/yeoman/sponsor/0/avatar.svg')
      .expect('content-type', 'image/svg+xml; charset=utf-8')
      .expect((res) => {
        res.body = sizeOf(res.body);
      })
      .expect(200, { width: 128, height: 64, type: 'svg' }, done);
  });

  it("redirects to the avatar url of the backer", (done) => {
    request(app)
      .get('/yeoman/backers/0/avatar.png')
      .expect('content-type', 'image/png')
      .expect(200, done);
  });

  it("redirects to 'become a backer' placeholder", (done) => {
    request(app)
      .get(`/yeoman/backers/${mocks.backers.length}/avatar`)
      .expect('Location', '/public/images/become_backer.svg')
      .expect(302, done);
  });

  it("redirects to the 1px transparent png if out of bound", (done) => {
    request(app)
      .get(`/yeoman/backers/${(mocks.backers.length+1)}/avatar`)
      .expect('Location', '/public/images/1px.png')
      .expect(302, done);
  });

  it("handles the avatarHeight option", (done) => {
    request(app)
      .get('/yeoman/backers/0/avatar.png?avatarHeight=256')
      .expect((res) => {
        res.body = sizeOf(res.body);
      })
      .expect(200, { width: 260, height: 260, type: 'png' }, done);
  });
});

describe("badge", () => {
  let sandbox;
  beforeEach(() => {
    sandbox = sinon.sandbox.create();
    sandbox.stub(api, 'get', () => {
      return Promise.resolve(mocks.users);
    });
  });

  beforeEach(shieldIONock);

  afterEach(() => {
    sandbox.restore();
  });

  it("generates a SVG with the number of backers", (done) => {
    request(app)
      .get('/yeoman/badge/backers.svg')
      .expect('content-type', 'image/svg+xml; charset=utf-8')
      .expect(200)
      .end(done);
  });
});

describe("redirect", () => {

  let sandbox;
  beforeEach(() => {
    sandbox = sinon.sandbox.create();
    sandbox.stub(api, 'get', () => {
      return Promise.resolve(mocks.users);
    });
  });

  afterEach(() => {
    sandbox.restore();
  });

  it("494 if no backer at that position", (done) => {
    request(app)
      .get('/yeoman/backers/999/website')
      .expect(404, done);
  });

  it(`redirects to the website of the sponsor and keeps pre-existing utm tracking data`, (done) => {
    request(app)
      .get('/yeoman/sponsors/0/website')
      .expect('Location', `https://digitalocean.com/?utm_campaign=opensource&utm_medium=github&utm_source=oc`)
      .expect(301, done);
  });

  it(`redirects to profile of the backer (@${mocks.backers[2].twitterHandle})`, (done) => {
    request(app)
      .get('/yeoman/backers/2/website')
      .expect('Location', `${config.host.website}/${mocks.backers[2].twitterHandle}?utm_campaign=yeoman&utm_medium=github&utm_source=opencollective`)
      .expect(301, done);
  });

})

describe("banner", () => {
  let sandbox;
  beforeEach(() => {
    sandbox = sinon.sandbox.create();
    sandbox.stub(api, 'get', () => {
      return Promise.resolve(mocks.users);
    });
  });

  afterEach(() => {
    sandbox.restore();
  });

  it("request the banner.svg", done => {
    request(app)
      .get('/yeoman/backers.svg')
      .expect('content-type', 'image/svg+xml; charset=utf-8')
      .expect(res => {
        const svg = new Buffer(res.body).toString('utf8');
        const firstLine = svg.substr(0, svg.indexOf('\n'));
        res.body = { firstLine };
      })
      .expect({
        firstLine: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="414" height="74">'
      })
      .expect(200, done);
  });

  it("request the banner.png", function(done) {
    this.timeout(10000);
    request(app)
      .get('/yeoman/backers.png')
      .expect('content-type', 'image/png')
      .expect(res => {
        res.body = { contentLength: Number(res.headers['content-length']) };
      })
      .expect({
        contentLength: 8738
      })
      .expect(200, done);
  });

  it("adds a margin the banner.svg", done => {
    request(app)
      .get('/yeoman/backers.svg?margin=20')
      .expect('content-type', 'image/svg+xml; charset=utf-8')
      .expect(res => {
        const svg = new Buffer(res.body).toString('utf8');
        const firstLine = svg.substr(0, svg.indexOf('\n'));
        res.body = { firstLine };
      })
      .expect({
        firstLine: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="504" height="104">'
      })
      .expect(200, done);
  });

  it("sets a max width for banner.svg", done => {
    request(app)
      .get('/yeoman/backers.svg?width=200')
      .expect('content-type', 'image/svg+xml; charset=utf-8')
      .expect(res => {
        const svg = new Buffer(res.body).toString('utf8');
        const firstLine = svg.substr(0, svg.indexOf('\n'));
        res.body = { firstLine };
      })
      .expect({
        firstLine: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="212">'
      })
      .expect(200, done);
  });

  it('has target blank on the links', (done) => {
    request(app)
      .get('/yeoman/backers.svg')
      .expect('content-type', 'image/svg+xml; charset=utf-8')
      .expect(200)
      .end((err, res) => {
        const svg = new Buffer(res.body).toString('utf8');
        expect(svg).to.contain(`target="_blank"`);
        done();
      })
  });
})


text:
Aria.classDefinition({
    $classpath : "test.aria.widgetLibs.sampleWidget.test.SampleContainerWidget",
    $extends : "aria.widgetLibs.BaseWidget",
    $dependencies : ["aria.utils.String", "aria.utils.Dom"],
    $constructor : function (cfg, ctxt, lineNumber) {
        this.$BaseWidget.constructor.apply(this, arguments);

        /**
         * Id of the main DOM element of this widget.
         * @type String
         */
        this._id = this._createDynamicId();

        /**
         * Reference of the DOM element with id this._id.
         * @type HTMLElement
         */
        this._domElt = null;
    },
    $prototype : {
        /**
         * Main widget entry-point. Write the beginning of the widget markup, corresponding to the opening tag (for a
         * container widget).
         * @param {aria.templates.MarkupWriter} out
         */
        writeMarkupBegin : function (out) {
            var cfg = this._cfg;
            var html = ['', '', aria.utils.String.escapeHTML(cfg.title), ''];
            out.write(html.join(''));
            out.skipContent = cfg.skipContent === true;
        },

        /**
         * Write the end of the widget markup, corresponding to the closing tag (for a container widget).
         * @param {aria.templates.MarkupWriter} out
         */
        writeMarkupEnd : function (out) {
            out.write(aria.utils.String.escapeHTML(this._cfg.end) + '');
        },

        /**
         * Initialization method called after the markup of the widget has been inserted in the DOM.
         */
        initWidget : function () {
            this._domElt = aria.utils.Dom.getElementById(this._id);
            var titleElt = aria.utils.Dom.getDomElementChild(this._domElt, 0);
            titleElt.innerHTML += aria.utils.String.escapeHTML(this._cfg.add);
        }
    }
});