text:
USER=$(getent passwd php 2>&1)
GROUP=$(getent group php 2>&1)

echo "==> Attempting to create 'php' user."

if [ ${#USER} == 0 ] && [ ${#GROUP} == 0 ]; then
    # Create the user with the given home directory.
    echo "    Creating user with UID:GID of ${PHP_UID}:${PHP_GID}"
    groupadd -g ${PHP_GID} -o php
    useradd -s /bin/bash -u ${PHP_UID} -g ${PHP_GID} -d ${PHP_HOME} -M -o php
else
    echo "    User 'php' already exists."
fi

echo "==> Attempting to create home directory at '${PHP_HOME}'."

# Create the home directory, if it doesn't already exist. We won't bother with the skeleton.
if [ ! -d "${PHP_HOME}" ]; then
    mkdir -p "${PHP_HOME}"
    echo "    Done!"
else
    echo "    Already exists!"
fi

echo "==> Attempting to create working directory at '${PHP_WORKDIR}'."

# Create the workspace.
if [ ! -d "${PHP_WORKDIR}" ]; then
    mkdir -p "${PHP_WORKDIR}"
    echo "    Done!"
else
    echo "    Already exists!"
fi

echo "==> Updating home and working directory permissions..."

chown ${PHP_UID}:${PHP_GID} "${PHP_HOME}"
chown ${PHP_UID}:${PHP_GID} "${PHP_WORKDIR}"

echo "    Done!"

echo "==> Running CMD..."

cd "${PHP_WORKDIR}"

if [ "${PHP_SHELL}" == "1" ]; then
    exec gosu php "$@"
else
    exec "$@"
fi

redpajama_set_name: RedPajamaGithub


text:
import sys
import logging
import logging.handlers
from crossplatform import CrossPlatform

#The terminal has 8 colors with codes from 0 to 7
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)

#These are the sequences need to get colored ouput
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"

#The background is set with 40 plus the number of the color,
#and the foreground with 30
COLORS = {
    'WARNING':  COLOR_SEQ % (30 + YELLOW) + 'WARNING' + RESET_SEQ,
    'INFO':     COLOR_SEQ % (30 + WHITE) + 'INFO' + RESET_SEQ,
    'DEBUG':    COLOR_SEQ % (30 + BLUE) + 'DEBUG' + RESET_SEQ,
    'CRITICAL': COLOR_SEQ % (30 + YELLOW) + 'CRITICAL' + RESET_SEQ,
    'ERROR':    COLOR_SEQ % (30 + RED) + 'ERROR' + RESET_SEQ,
}

class ColoredFormatter(logging.Formatter):
    def __init__(self, msg, use_color=True):
        logging.Formatter.__init__(self, msg)
        self.use_color = use_color

    def format(self, record):
        if self.use_color:
            record.levelname = COLORS.get(record.levelname, record.levelname)
        return logging.Formatter.format(self, record)

class LoggingConfiguration(object):
    COLOR_FORMAT = "[" + BOLD_SEQ + "%(asctime)s" + RESET_SEQ + \
                   "][%(levelname)s] %(message)s (" + BOLD_SEQ + \
                   "%(filename)s" + RESET_SEQ + ":%(lineno)d)"
    NO_COLOR_FORMAT = "[%(asctime)s][%(levelname)s] %(message)s " \
                      "(%(filename)s:%(lineno)d)"

    @classmethod
    def set(cls, log_level, log_filename, append):
        """ Configure a rotating file logging
        """
        logger = logging.getLogger()
        logger.setLevel(logging.DEBUG)

        # Log to sys.stderr using log level passed through command line
        if log_level != logging.NOTSET:
            log_handler = logging.StreamHandler(sys.stdout)
            if sys.platform.find('linux') >= 0:
                formatter = ColoredFormatter(cls.COLOR_FORMAT)
            else:
                formatter = ColoredFormatter(cls.NO_COLOR_FORMAT, False)
            log_handler.setFormatter(formatter)
            log_handler.setLevel(log_level)
            logger.addHandler(log_handler)

        if CrossPlatform.get().is_windows():
            log_filename = CrossPlatform.get().user_config_path('dm.log')
        # Log to rotating file using DEBUG log level
        log_handler = logging.handlers.RotatingFileHandler(log_filename,
                                                           mode='a+',
                                                           backupCount=3)
        formatter = logging.Formatter('%(asctime)s %(levelname)-8s '
                                      '%(message)s')
        log_handler.setFormatter(formatter)
        log_handler.setLevel(logging.DEBUG)
        logger.addHandler(log_handler)

        if not append:
            # Create a new log file on every new
            # (i.e. not scheduled) invocation
            log_handler.doRollover()


text:
<TITLE>Review for Tarzan and the Lost City (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Tarzan and the Lost City (1998)

reviewed by
David Sunga

TARZAN AND THE LOST CITY (1998)

Rating: 2.0 stars (out of 4.0)
********************************
Key to rating system:
2.0 stars - Debatable
2.5 stars - Some people may like it
3.0 stars - I liked it
3.5 stars - I am biased in favor of the movie
4.0 stars - I felt the movie's impact personally or it stood out
*********************************

Directed by: Carl Schenkel

Written by: Bayard Johnson, J. Anderson Black
from stories and characters by Edgar Rice Burroughs

Starring: Casper Van Dien, Jane March, Steven Waddington

Ingredients: True love, Tarzan, Jane, lost city of Opar

Synopsis:
Tarzan, (Casper Van Dien) jungle lord turned society guy, is in Britain
preparing for his wedding to Jane Porter (Jane March) when he receives a
psychic call from an African medicine man, telling him that white men
are plundering Africa. Some bad guys led by Mr. Nigel Ravens are on an
expedition to find and loot the lost African city of Opar, considered
taboo and sacred by the African natives, who unfortunately, don't have
the guns to stop Ravens and his men. Tarzan sails back to Africa to stop
Ravens. Jane soon follows Tarzan to Africa and is captured by Ravens.

Can Tarzan stop Ravens?

Opinion:
Other than less vine-swinging for Tarzan, and a more liberated Jane,
there is nothing new to be found here. Like Kevin Coster's accent in
ROBINHOOD, the African language, songs, and drum rhythms in TARZAN AND
THE LOST CITY are obviously faked. Tarzan's British accent seems to come
and go as well.

The plot also has a big hole in it: the African medicine man Mugambi
supposedly summons Tarzan for help, but the shaman apparently possesses
enough magical powers to easily handle the white men on his own; he can
turn himself into giant bulletproof snakes and hordes of bees, and can
make dead bones turn into magical warriors. Even the non-magical African
villagers are able to send Raven and his looters scurrying away into a
cave - - using mere spears and arrows. So why ask Tarzan to come over
from England? The only real purpose Tarzan serves is to rescue Jane,
who, predictably gets captured following Tarzan to Africa.

Is it bad? Not really. TARZAN AND THE LOST CITY feels a lot like a
Saturday afternoon made-for-TV movie. With the same movie set and
characters but a different plot, language, and music, it would have been
a sharper, more exotic film.

Actually TARZAN AND THE LOST CITY reminds me a lot of the 12 BOMBA OF
THE JUNGLE action series movies made between 1949 and 1955, which - -
according to MATT'S BOMBA THE JUNGLE BOY MOVIE GUIDE - - were created by
hiring a B-movie veteran as the director/writer, and using "a shoestring
budget with predictable plots and a heavy reliance on stock jungle
footage."

Campy and predictable? Yes, but good enough for a Saturday afternoon.

Reviewed April 24, 1998

Copyright © 1998 by David Sunga
This review and others like it can be found at
THE CRITIC ZOO: http://www.criticzoo.com
email: zookeeper@criticzoo.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
\input{header.tex}
\title{IAM 950: Spatiotemporal Dynamics and Turbulence\\
ASSIGNMENT NAME}
\author{Aaron D. Carta}
\date{DATE}

\begin{document}

\maketitle

\begin{enumerate}

\vspace{.2in}

\item
Write a numerical simulation for the heat equation
\[
u_t=\nu u_{xx}
\]
on a periodic domain $\brac{-\frac{L_x}{2},\frac{L_x}{2}}$ using Fourier spatial discretization and Crank-Nicolson temporal discretizatiion. Verify that your code works correctly by simulating the Gaussian-decay solution
\[
u(x,t)=\p{4 \pi \nu t} \E{- \frac{x^2}{4 \nu t}}
\]
from $t=1$ to $100$ for parameters $\nu =2$, $L_x=100$, $\dt=\frac{1}{16}$, $N_x=128$ (number of $x$ gridpoints). Initialize your numerical code with $u(x,1)$ and then compare the results of the numerical time integration with $u(x,t)$ evaluated from the above formula. I suggest plotting both quantities versus $x$ at regular intervals in time during the simulation, using ''pause" (MATLAB) to stop the simulation temporarily.

Make a plot of the numerical solution and the Gaussian solution versus $x$ at $t=100$ to turn in. Are the two entirely consistent? If not, why not?

\medskip

\underline{\bf Solution}.

\pagebreak

\item
Copy and revise your heat equation code so that it simulates the 1D Swift-Hohenberg equation,
\[
u_t=(r-1)u-2u_{xx}-u_{xxxx}-u^3
\]
on a periodic domain $\brac{0, L_x}$ using Fourier spatial discretization and Crank-Nicolson/Adams-Bashforth semi-implicit temporal discretization. Use the initial condition
\[
u(x,0)=\cos(ax)+0.1 \cos(2ax), \quad a = \frac{2\pi}{L_x},
\]
parameter values $r=0.2$, $L_x=100$, $N_x=256$, $\dt=\frac{1}{16}$, and integrate from $t=0$ to $100$.

Make a colorplot of $u(x,t)$ in the $xt-$plane (using every $x$ gridpoint but plotting $t$ at a larger interval than $\dt$, perhaps at intervals of $1/2$ or $1$).

When you are satisfied with the correctness of your simulation, make a plot of $u(x,100)$ versus $x$ for the above parameters and initial conditions to turn in.

Now, play around with the forcing parameter in the range $0<r<1$ and the initial condition by changing the wavelengths and magnitudes of the cosines, and possibly the total integration time (if you don't see patterns develop by $t=100$).

Answer the following questions:
\begin{itemize}
\item Does the wavelength of the final pattern depend on $r$ or the initial condition?

\item Does the wavelength of the final pattern match your expectation from linear analysis?

\item Can you relate the amplitude of the final pattern or the time scale of its growth from the initial condition to the Swift-Hohenberg equation?
\end{itemize}
\underline{\bf Solution}.

\medskip

\pagebreak

\item

Copy and revise your Swift-Hohenberg code so that it simulates the 1D Kuramoto-Sivashinsky equation
\[
u_t=-u_{xx}-u_{xxxx}-u u_x,
\]
with parameters $L_x=100$, $N_x=512$, and $\dt=1/16$, and initial condition
\[
u(x,0)=\cos(ax)+0.1\cos(2ax),
\]
integrating from $t=0$ to $100$. Make a color plot of $u(x,t)$ as before. Further, make a plot of $u(x,100)$ versus $x$ to turn in.

Now, play around with the domain size $L_x$ (adjusting $N_x$ so that $L_x/N_x$ is approximately constant). Try replacing the initial condition with random numbers of order 0.01, and answer the following questions:
\begin{itemize}
\item Does the wavelength of the final pattern depend on $r$ or the initial condition?

\item Does the wavelength of the final pattern match your expectation from linear analysis?

\item What qualitative changes in behavior do you observe as $L$ increases from small ($L\sim1$) to large ($L\sim 100$)?
\end{itemize}
\medskip

\underline{\bf Solution}.

\pagebreak

\item
For each of the above codes, fix the initial condition and parameters, and run the simulation with $\dt=1/8, 1/4, \dots$. What happens? Why?
\medskip

\underline{\bf Solution}.

\pagebreak

\end{enumerate}

\end{document}


text:
package org.opentides.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.opentides.bean.UserWidgets;
import org.opentides.bean.Widget;
import org.opentides.service.UserService;
import org.opentides.service.UserWidgetsService;
import org.opentides.service.WidgetService;
import org.opentides.util.SecurityUtil;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

/**
 * @author allanctan
 *
 */
public class AddWidgetController extends AbstractController {

	private WidgetService widgetService;
	private UserWidgetsService userWidgetsService;
	private UserService userService;

	private String formView = "/core/widget/widget-add";

	@Override
	protected ModelAndView handleRequestInternal(
			HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// is Form Submit?
		if ("POST".equals(request.getMethod())) {
			Map<String, Object> model = new HashMap<String, Object>();
			try {
				userWidgetsService.addUserWidgets(SecurityUtil.getSessionUser().getRealId(),
						request.getParameter("mergedCheckboxes"));
				model.put("frameRedirect", true);
				return new ModelAndView(formView,model);
				//return new ModelAndView("redirect:"+dashboardView+".jspx",model);
			}catch (Exception e) {
				//error occurs, just redirect page
				model.put("frameRedirect", true);
				return new ModelAndView(formView,model);
				//return new ModelAndView("redirect:"+dashboardView+".jspx",model);
			}
		} else {
			Map<String,Object> model = new HashMap<String,Object>();
			List<Widget> widgets = widgetService.getCurrentUserWidgets();
			List<UserWidgets> installedWidgets = userWidgetsService.findUserWidgets(SecurityUtil.getSessionUser().getRealId(), WidgetService.WIDGET_STATUS_MINIMIZE, WidgetService.WIDGET_STATUS_SHOW);
			for (Widget widget:widgets) {
				for (UserWidgets userWidget:installedWidgets) {
					if (userWidget.getWidget() == widget)
						widget.setInstalled(true);
				}
			}
			model.put("widgets", widgets);
			return new ModelAndView(formView, model);
		}
	}

	/**
	 * @param formView the formView to set
	 */
	public void setFormView(String formView) {
		this.formView = formView;
	}

	/**
	 * @param widgetService the widgetService to set
	 */
	public void setWidgetService(WidgetService widgetService) {
		this.widgetService = widgetService;
	}

	/**
	 * @param userWidgetService the userWidgetService to set
	 */
	public void setUserWidgetsService(UserWidgetsService userWidgetsService) {
		this.userWidgetsService = userWidgetsService;
	}

	/**
	 * @return the userService
	 */
	public UserService getUserService() {
		return userService;
	}

	/**
	 * @param userService the userService to set
	 */
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
}


text:
layout: page
title: Sellers Trade Executive Retreat
date: 2016-05-24
author: Jane Strickland
tags: weekly links, java
status: published
summary: Integer finibus eleifend nibh sit amet aliquet. Quisque fringilla.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 11/26/2019
  endDate: 11/27/2019
  ctyhocn: CLRSSHX
  groupCode: STER
published: true
---
Phasellus enim ipsum, aliquam vel nisi vitae, auctor tempus elit. Nunc non posuere ipsum. In placerat lacinia viverra. Morbi sit amet molestie tortor. Sed a tristique leo. In augue lorem, placerat nec semper vitae, consectetur id elit. Nam vel libero consectetur, consequat sem non, pellentesque magna. Integer leo orci, dignissim in magna nec, scelerisque vulputate dui. Suspendisse imperdiet et arcu eget varius. Aenean dignissim odio sed est malesuada sollicitudin.

1 Donec faucibus nulla a nisi rutrum, eget pretium risus vulputate
1 Sed vitae lectus ac nisi venenatis sollicitudin
1 Donec mattis augue id est semper imperdiet
1 Donec non ligula convallis, laoreet sem in, vehicula sem
1 Duis placerat quam ut porta maximus
1 Sed eu ex fermentum, hendrerit metus eget, molestie ipsum.

Morbi consequat imperdiet velit, in semper mauris. Nam lobortis vel ipsum a efficitur. Donec sit amet erat urna. Quisque id cursus dolor, et semper metus. Phasellus in egestas massa. Aliquam varius laoreet nisi, ac hendrerit nulla lobortis aliquam. Nullam tortor nulla, mollis vitae tempus id, eleifend non lectus. In pellentesque neque nec justo egestas, nec blandit dui elementum. Curabitur sollicitudin lacus eget leo porta, at maximus justo condimentum. Aenean vitae suscipit nulla, non ullamcorper dolor. Phasellus urna elit, molestie at fermentum non, pretium eget nisl. Donec orci neque, tincidunt eget aliquam a, aliquam eget diam.


text:
<?php

namespace Drupal\rabbit_hole;

/**
 * Interface BehaviorInvokerInterface.
 *
 * @package Drupal\rabbit_hole
 */
interface BehaviorInvokerInterface {

}


text:
<?php

namespace ZendTest\Cache\Storage;

use Zend\Cache\Storage\Capabilities;
use Zend\Cache\Storage\Adapter\Memory as MemoryAdapter;

/**
 * @group      Zend_Cache
 */
class CapabilitiesTest extends \PHPUnit_Framework_TestCase
{

    /**
     * Capabilities instance
     *
     * @var Zend\Cache\Storage\Capabilities
     */
    protected $_capabilities;

    /**
     * Base capabilities instance
     *
     * @var Zend\Cache\Storage\Capabilities
     */
    protected $_baseCapabilities;

    /**
     * Set/Change marker
     *
     * @var \stdClass
     */
    protected $_marker;

    /**
     * The storage adapter
     *
     * @var Zend\Cache\Storage\Adapter
     */
    protected $_adapter;

    public function setUp()
    {
        $this->_marker  = new \stdClass();
        $this->_adapter = new MemoryAdapter();

        $this->_baseCapabilities = new Capabilities($this->_adapter, $this->_marker);
        $this->_capabilities     = new Capabilities($this->_adapter, $this->_marker, array(), $this->_baseCapabilities);
    }

    public function testGetAdapter()
    {
        $this->assertSame($this->_adapter, $this->_capabilities->getAdapter());
        $this->assertSame($this->_adapter, $this->_baseCapabilities->getAdapter());
    }

    public function testSetAndGetCapability()
    {
        $this->_capabilities->setMaxTtl($this->_marker, 100);
        $this->assertEquals(100, $this->_capabilities->getMaxTtl());
    }

    public function testGetCapabilityByBaseCapabilities()
    {
        $this->_baseCapabilities->setMaxTtl($this->_marker, 100);
        $this->assertEquals(100, $this->_capabilities->getMaxTtl());
    }

    public function testTriggerCapabilityEvent()
    {
        $em    = $this->_capabilities->getAdapter()->getEventManager();
        $event = null;
        $em->attach('capability', function ($eventArg) use (&$event) {
            $event = $eventArg;
        });

        $this->_capabilities->setMaxTtl($this->_marker, 100);

        $this->assertInstanceOf('Zend\EventManager\Event', $event);
        $this->assertEquals('capability', $event->getName());
        $this->assertSame($this->_adapter, $event->getTarget());

        $params = $event->getParams();
        $this->assertInstanceOf('ArrayObject', $params);
        $this->assertTrue(isset($params ['maxTtl']));
        $this->assertEquals(100, $params['maxTtl']);
    }
}


text:
import os
import bottle
from bottle import get, post, delete, request, redirect
from host.middleware.mediator import ClientMediator
from host.server.transformer import FormTransformer

from host.system.docker import image_to_package_name

# The path to the views from the app's root directory.
VIEW_PATH = ['./host/server/views']

def template(*args, **kwargs):
    """
    Builds and renders a Bottle template with the lookup path set correctly.
    """
    kwargs['template_lookup'] = VIEW_PATH
    return bottle.template(*args, **kwargs)

class RestServer:
    """
    Implements an HTTP REST server for registration and invocation.
    """
    def __init__(self, client_mediator=None):
        if client_mediator is None:
            client_mediator = ClientMediator()
        self.client_mediator = client_mediator
        self.transformer = FormTransformer()

    def register_package(self, docker_id, package=None):
        """
        Registers a package to a Docker image ID. The request should contain a
        "docker_id" parameter specifying the ID of the Docker image implementing
        the package.
        """
        if not package:
            package = image_to_package_name(docker_id)

        service_classes = self.client_mediator.handle_registration(docker_id,
                                                                   package)

        return "Registered %d services in package %s" % (
            len(service_classes), package)

    def unregister_package(self, package):
        """
        Unregisters a service module that was previously registered.
        """
        self.client_mediator.handle_unregistration(package)

    def invoke(self, package, service, arguments):
        """
        Invokes a method of a previously-registered service class.

        :param package: The name of the service containing the desired method.
        :param service: The name of the method to invoke.
        :param arguments: The JSON string body of the request specifying the
        method arguments.
        :return: The result of the invocation.
        """
        # Load the service class to get the Client class from.
        image = self.client_mediator.registry.get_service_image(package)
        return self.client_mediator.handle_invocation(image, package, service,
                                                      arguments)

    def bind(self):
        """
        Starts up the HTTP server on port 5000.
        """

        @get('/')
        def home():
            packages = self.client_mediator.registry.get_registered_packages()
            return template('home.tpl', packages=packages)

        @get('/packages/<package>')
        def package_detail(package):
            services = self.client_mediator.get_services(package)
            return template('packages/detail.tpl', package=package,
                            services=services)

        # TODO(orlade): Replace with decorators on RestServer methods.
        @post('/packages/register')
        def register():
            docker_id = request.params.docker_id
            package = request.params.package
            self.register_package(docker_id, package)
            redirect('/')

        @get('/packages/<package>/<service>')
        def service_detail(package, service):
            params = self.client_mediator.get_services(package)[service]
            return template('services/detail.tpl', package=package,
                            service=service, params=params)

        @post('/packages/<package>/<service>/invoke')
        def invoke(package, service):
            # Prepare the arguments to invoke the method with.
            params = self.client_mediator.get_services(package)[service]
            args = self.transformer.parse(request, params)
            result = self.invoke(package, service, args)
            response = self.transformer.serialize(result)
            display_params = self.transformer.parse_display(request, params)
            return template('output/result.tpl', package=package,
                            service=service, params=display_params,
                            result=response)

        @get('/packages/<package>/unregister')
        def confirm_unregister(package):
            return template('packages/unregister.tpl', package=package)

        @post('/packages/<package>/unregister')
        def unregister(package):
            self.unregister_package(package)
            redirect('/')

        return self

    def run(self):
        bottle.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)),
                   debug=True)


text:
from datetime import datetime, timedelta
from time import sleep
from subprocess import Popen

import pymongo

PORT = 31415

def get_mongo_server():
    return Popen(['mongod', '--quiet', '--port', str(PORT), '--dbpath', 'mongo_data/'])

class Cache:
    def __init__(self, name):
        self.server = get_mongo_server()
        sleep(10) # wait for server to start
        connection = pymongo.MongoClient('localhost', PORT)
        self.collection = connection[name]['cache']

        self.collection.ensure_index(
            [('key', pymongo.DESCENDING)]
        )
        self.collection.ensure_index(
            [('ts', pymongo.DESCENDING)],
            # expireAfterSeconds=10 # not working
        )
    def __del__(self):
        self.server.terminate()

    def set(self, key, value):
        self.collection.insert({
            'key': key,
            'ts': datetime.now(),
            'value': value
        })

    def get(self, key):
        res = self.collection.find_one({'key': key})
        if datetime.now() - res['ts'] > timedelta(seconds=20):

            return None


text:
var handleMouseButtonCommand = require('../helpers/handleMouseButtonCommand');

module.exports = function rightClick (cssSelector, callback) {

    handleMouseButtonCommand.call(
        this,
        cssSelector,
        'right',
        callback
    );

};


text:
<?php

namespace Oro\Bundle\CommentBundle\Tests\Unit\Form\Handler;

use Oro\Bundle\CommentBundle\Entity\Comment;
use Oro\Bundle\CommentBundle\Form\Handler\CommentApiHandler;

class CommentApiHandlerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $form;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $request;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $om;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $configManager;

    /**
     * @var Comment
     */
    protected $comment;

    /**
     * @var CommentApiHandler
     */
    protected $handler;

    public function setUp()
    {
        $this->form = $this->createMock('Symfony\Component\Form\Test\FormInterface');
        $this->request = $this->createMock('Symfony\Component\HttpFoundation\Request');
        $this->om = $this->createMock('Doctrine\Common\Persistence\ObjectManager');
        $this->configManager = $this->getMockBuilder('Oro\Bundle\EntityConfigBundle\Config\ConfigManager')
            ->disableOriginalConstructor()
            ->getMock();
        $this->comment = new Comment();

        $this->handler = new CommentApiHandler($this->form, $this->request, $this->om, $this->configManager);
    }

    /**
     * @dataProvider getTestData
     *
     * @param string $type
     * @param int $callsCount
     * @param bool $valid
     * @param bool $expects
     */
    public function testRequest($type, $callsCount, $valid, $expects)
    {
        $persistCallsCount = 0;
        if ($valid && $callsCount) {
            $persistCallsCount = 1;
        }
        $this->request->expects($this->once())
            ->method('getMethod')
            ->will($this->returnValue($type));

        $this->form->expects($this->exactly($callsCount))
            ->method('submit');

        $this->form->expects($this->exactly($callsCount))
            ->method('isValid')
            ->will($this->returnValue($valid));

        $this->om->expects($this->exactly($persistCallsCount))
            ->method('persist')
            ->with($this->equalTo($this->comment));
        $this->om->expects($this->exactly($persistCallsCount))
            ->method('flush');

        $this->assertEquals($expects, $this->handler->process($this->comment));
    }

    public function getTestData()
    {
        return [
            'correct request type GET' => ['GET', 0, true, false],
            'incorrect request type GET' => ['GET', 0, false, false],
            'correct request type DELETE' => ['DELETE', 0, true, false],
            'incorrect request type DELETE' => ['DELETE', 0, false, false],
            'correct request type POST' => ['POST', 1, true, true],
            'incorrect request type POST' => ['POST', 1, false, false],
            'correct request type PUT' => ['PUT', 1, true, true],
            'incorrect request type PUT' => ['PUT', 1, false, false],
        ];
    }
}


text:
//GENERAL
var gulp = require('gulp');
var less = require('gulp-less');
var sass = require('gulp-sass');
var filter = require('gulp-filter');
var autoprefixer = require('gulp-autoprefixer');
var minify = require('gulp-minify-css');
var mainBowerFiles = require('main-bower-files');
var concat = require('gulp-concat');
var clean = require('gulp-clean');
var plumber = require('gulp-plumber');
var lessImport = require('gulp-less-import');
var replace = require('gulp-replace');
var flatten = require('gulp-flatten');

var pkg = require('../package.json');
var currVersion = pkg.name + "-" + pkg.version;
/*var lessFilter = filter('**!/!*.less');
var sassFilter = filter(['**!/!*.sass', '**!/!*.scss']);
var cssFilter = filter('**!/!*.css');*/

/*BUILD*/

gulp.task('b_m:less', function() {
    return gulp.src(mainBowerFiles({filter: '**/*.less'})
        .concat(config.import_less))
        .pipe(plumber())
        .pipe(lessImport('lessStyles.less'))
        .pipe(less())
        .pipe(gulp.dest(config.temp))
});

gulp.task('b_m:sass', function() {
    return gulp.src(mainBowerFiles({filter: ['**/*.sass', '**/*.scss']})
        .concat([config.source + '**/*.scss', config.source + '**/*.sass']))
        .pipe(plumber())
        .pipe(sass())
        .pipe(concat(config.temp + 'sassStyles.css'))
        .pipe(gulp.dest(config.temp))
});

gulp.task('b_m:css', function() {
    return gulp
        .src(mainBowerFiles({filter: '**/*.css'}).concat('!**/font-awesome.css'))
        .pipe(plumber())
        .pipe(autoprefixer({browsers: ['last 2 versions']}))
        .pipe(concat('bowerStyles.css'))
        .pipe(gulp.dest(config.temp))
});

gulp.task('b_m:appCss', function() {
    return gulp
        .src(config.source + '**/*.css')
        .pipe(plumber())
        .pipe(autoprefixer({browsers: ['last 2 versions']}))
        .pipe(concat('appCss.css'))
        .pipe(gulp.dest(config.temp))
});

gulp.task('b_m:styles', function() {
    return gulp
        .src([config.temp + 'bowerStyles.css', config.temp + 'lessStyles.css', config.temp + 'sassStyles.css', config.temp + 'appCss.css'])
        .pipe(replace('../fonts/', 'fonts/'))
        .pipe(concat(currVersion + '.css'))
        .pipe(gulp.dest(config.build + 'assets'))
        .pipe(browserSync.stream())
});

gulp.task('b_c:styles', function() {
    return gulp.src([config.build + 'assets/**/*.css', config.temp + '**/*' ], {read:false})
        .pipe(clean());
});

gulp.task('b_m:assets', function() {
    return gulp.src([
        config.source + 'assets/**/*',
        '!' + config.source + '**/*.css',
        '!' + config.source + '**/*.less',
        '!' + config.source + '**/*.scss',
        '!' + config.source + '**/*.sass'])
        .pipe(gulp.dest(config.build + 'assets'))
});

gulp.task('b_m:fonts', function() {
    return gulp.src('vendor/**/fonts/*', '!vendor/**/dist')
        .pipe(flatten())
        .pipe(gulp.dest(config.build + 'assets/fonts'))
});

gulp.task('b_c:assets', function() {
    return gulp.src([
        config.build + 'assets/**/*',
        '!' + config.build + '**/*.css',
        '!' + config.build + '**/*.less',
        '!' + config.build + '**/*.scss',
        '!' + config.build + '**/*.sass',
        '!' + config.build + 'assets/fonts/**/*'], {read:false})
        .pipe(clean())
});

/*COMPILE*/
gulp.task('c_m:css', function() {
    return gulp.src(config.build + 'assets/**/*.css')
        .pipe(minify())
        .pipe(gulp.dest(config.compile + 'assets/'));
});

gulp.task('c_c:css', function() {
    return gulp
        .src(config.compile + '**/*.css', {read:false})
        .pipe(clean());
});

gulp.task('c_m:assets', function() {
    return gulp.src([
        config.build + 'assets/**/*',
        '!' + config.build + '**/*.css',
        '!' + config.build + '**/*.less',
        '!' + config.build + '**/*.scss',
        '!' + config.build + '**/*.sass'])
        .pipe(gulp.dest(config.compile + 'assets'))
});

gulp.task('c_c:assets', function() {
    return gulp
        .src([config.compile + 'assets/**/*', '!' + config.compile + 'assets/**/*.css'], {read:false})
        .pipe(clean());
});

//Master Asset Tasks
gulp.task('build:styles', gulp.series('b_c:styles', 'b_m:less', 'b_m:sass', 'b_m:css', 'b_m:appCss', 'b_m:styles'));
gulp.task('compile:css', gulp.series('c_c:css', 'build:styles', 'c_m:css'));
gulp.task('build:assets', gulp.series('b_c:assets', 'b_m:assets', 'b_m:fonts'));
gulp.task('compile:assets', gulp.series('c_c:assets', 'build:assets', 'c_m:assets'));


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;

namespace TubeStarMetro
{
    public static class PopupExtension
    {
        public static async Task<bool?> ShowAsync(this UserControl dialog)
        {
            PopupHelper popup = new PopupHelper(dialog);
            await popup.ShowAsync();
            return popup.DialogResult;
        }
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=constant.CL_COMMAND_BARRIER.html">

Redirecting to constant.CL_COMMAND_BARRIER.html...


text:
Without any recipes, we need to acquire them
automatically from the specified run list.
If you have roles listed in your run list
they are NOT expanded.

    if recipes.empty? and Chef::Config[:solo]
      node.run_list.map do |item|
        item.name if item.type == :recipe
      end
    end


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Pycnodactylus mararlhensis Bat., A.A. Silva & Cavalc.

### Remarks
null


text:
var path = require('path');
var fs = require('fs');

if(fs.existsSync(path.resolve(__dirname, "../../chrome/content/Firecrow/helpers/valueTypeHelper.js"))) //Standalone
{
    var ValueTypeHelper = require(path.resolve(__dirname, "../../chrome/content/Firecrow/helpers/valueTypeHelper.js")).ValueTypeHelper;
    var ASTHelper = require(path.resolve(__dirname, "../../chrome/content/Firecrow/helpers/ASTHelper.js")).ASTHelper;
}
else
{
    var ValueTypeHelper = require(path.resolve(__dirname, "../valueTypeHelper.js")).ValueTypeHelper;
    var ASTHelper = require(path.resolve(__dirname, "../ASTHelper.js")).ASTHelper;
}

var ConflictFixerCommon = require(path.resolve(__dirname, "ConflictFixerCommon.js")).ConflictFixerCommon;

var Changes = { html: 0, js: 0, css: 0};

var HtmlConflictFixer =
{
    replacementsMap: {},

    fixHtmlConflicts: function(pageAModel, pageBModel, pageAExecutionSummary)
    {
        var changes = this._getHtmlConflictChanges(pageAModel, pageBModel, pageAModel.trackedElementsSelectors);
        var reusedCssNodes = pageAModel.cssNodes;

        for(var i = 0; i < changes.length; i++)
        {
            var change = changes[i];

            for(var j = 0; j < reusedCssNodes.length; j++)
            {
                var cssNode = reusedCssNodes[j];

                if(cssNode.selector == null || cssNode.selector.indexOf(change.oldValue) == -1) { continue; }

                ConflictFixerCommon.replaceSelectorInCssNode(cssNode, change.oldValue, change.newValue);

                if(cssNode.shouldBeIncluded)
                {
                    Changes.css++;
                }
            }

            this._fixDynamicallySetAttributes(change);
            this._fixHtmlAttributeConflictsDomQueries(change, pageAExecutionSummary);
        }

        return Changes;
    },

    _getHtmlConflictChanges: function(pageAModel, pageBModel, reuseSelectors)
    {
        var pageAHtmlNodes = pageAModel.htmlNodes;
        var pageBHtmlNodes = pageBModel.htmlNodes;

        var changes = {};

        for(var i = 0; i < pageAHtmlNodes.length; i++)
        {
            var pageANode = pageAHtmlNodes[i];

            for(var j = 0; j < pageBHtmlNodes.length; j++)
            {
                var pageBNode = pageBHtmlNodes[j];

                this._aggregateConflictChanges(changes, this._getClassesAndIdsWithEqualValue(pageANode, pageBNode), reuseSelectors);
            }
        }

        return ValueTypeHelper.convertObjectMapToArray(changes);
    },

    _fixDynamicallySetAttributes: function(change)
    {
        if(change.setConstruct != null)
        {
            if(ASTHelper.isAssignmentExpression(change.setConstruct))
            {
                var hasReplaced = ConflictFixerCommon.replaceLiteralOrDirectIdentifierValue(change, change.setConstruct.right)

                if(hasReplaced) { Changes.js++; }

                return;
            }

            ConflictFixerCommon.addCommentToParentStatement(change.setConstruct, "Firecrow - Could not rename: " + change.oldValue + " -> " + change.newValue);
        }
    },

    _fixHtmlAttributeConflictsDomQueries: function(change, pageAExecutionSummary)
    {
        if(change == null) { return; }
        if(pageAExecutionSummary.domQueriesMap == null) { return;}

        for(var domQueryProp in pageAExecutionSummary.domQueriesMap)
        {
            var domQuery = pageAExecutionSummary.domQueriesMap[domQueryProp];
            var callExpressionFirstArgument = ASTHelper.getFirstArgumentOfCallExpression(domQuery.codeConstruct);

            for(var selector in domQuery.selectorsMap)
            {
                if(this._containsCssFragment(selector, change.oldValue))
                {
                    var hasChanged = ConflictFixerCommon.replaceLiteralOrDirectIdentifierValue(change, callExpressionFirstArgument);
                    if(hasChanged)
                    {
                        Changes.js++;
                    }
                }
            }
        }
    },

    _containsCssFragment: function(selector, needle)
    {
        var parts = selector.split(/(\s)+|\.|#|>/gi);

        for(var i = 0; i < parts.length; i++)
        {
            if(parts[i] == needle) { return true; }
        }

        return false;
    },

    _aggregateConflictChanges: function(changes, conflictingAttributes, reuseSelectors)
    {
        if(changes == null || conflictingAttributes == null || conflictingAttributes.length == 0) { return; }

        for(var i = 0; i < conflictingAttributes.length; i++)
        {
            var conflictingAttribute = conflictingAttributes[i];

            var change = { oldValue:conflictingAttribute.value, newValue: ConflictFixerCommon.generateReusePrefix() + conflictingAttribute.value, setConstruct: conflictingAttribute.setConstruct};
            var changeId = change.oldValue + change.newValue + (conflictingAttribute.setConstruct != null ? conflictingAttribute.setConstruct.nodeId : "");

            changes[changeId] = change;

            this._handleSelectorChange(reuseSelectors, change);

            conflictingAttribute.value = change.newValue;
            Changes.html++;
        }
    },

    _handleSelectorChange: function(reuseSelectors, change)
    {
        for(var i = 0; i < reuseSelectors.length; i++)
        {
            var selector = reuseSelectors[i];

            if(selector == "." + change.oldValue)
            {
                reuseSelectors[i] = "." + change.newValue;
            }
            else if(selector == "#" + change.oldValue)
            {
                reuseSelectors[i] = "#" + change.newValue;
            }
        }

        this.replacementsMap[change.oldValue] = change.newValue;
    },

    _getClassesAndIdsWithEqualValue: function(pageANode, pageBNode)
    {
        if(pageANode == null || pageBNode == null) { return []; }

        var pageAAttributes = (pageANode.attributes || []).concat(pageANode.dynamicClasses || []).concat(pageANode.dynamicIds || []);
        var pageBAttributes = (pageBNode.attributes || []).concat(pageBNode.dynamicClasses || []).concat(pageBNode.dynamicIds || []);

        if(pageAAttributes.length == 0) { return []; }
        if(pageBAttributes.length == 0) { return []; }

        var matchingAttributes = {};

        for(var i = 0; i < pageAAttributes.length; i++)
        {
            var pageAAttribute = pageAAttributes[i];

            if(pageAAttribute.name != "class" && pageAAttribute.name != "name" && pageAAttribute.name != "id") { continue; }
            if(pageAAttribute.value == "") { continue; }

            for(var j = 0; j < pageBAttributes.length; j++)
            {
                var pageBAttribute = pageBAttributes[j];

                if(pageBAttribute.name != "class" && pageBAttribute.name != "name" && pageBAttribute.name != "id") { continue; }

                if(pageAAttribute.value == pageBAttribute.value && pageAAttribute.name == pageBAttribute.name)
                {
                    var uniqueName = pageAAttribute.name + pageAAttribute.value;
                    uniqueName += pageAAttribute.setConstruct != null ? pageAAttribute.setConstruct.nodeId : "";
                    matchingAttributes[uniqueName] = pageAAttribute;
                }
            }
        }

        return ValueTypeHelper.convertObjectMapToArray(matchingAttributes);
    }
}

exports.HtmlConflictFixer = HtmlConflictFixer;


text:
Catarse::Application.routes.draw do
  mount RedactorRails::Engine => '/redactor_rails'
  mount JasmineRails::Engine => '/specs' if defined?(JasmineRails)
  devise_for(
    :users,
    {
      path: '',
      path_names:   { sign_in: :login, sign_out: :logout, sign_up: :sign_up },
      controllers:  { omniauth_callbacks: :omniauth_callbacks, passwords: :passwords }
    }
  )

  devise_scope :user do
    post '/sign_up', {to: 'devise/registrations#create', as: :sign_up}
  end

  get '/thank_you' => "static#thank_you"

  filter :locale, exclude: /\/auth\//

  mount CatarseMoip::Engine => "/", as: :catarse_moip
  mount CatarsePagarme::Engine => "/", as: :catarse_pagarme
  mount CatarseApi::Engine => "/api", as: :catarse_api
 #mount CatarseWepay::Engine => "/", as: :catarse_wepay
  mount Dbhero::Engine => "/dbhero", as: :dbhero

  resources :bank_accounts, except: [:destroy, :index] do
    member do
      get 'confirm'
      put 'request_refund'
    end
  end

  resources :categories, only: [] do
    member do
      get :subscribe, to: 'categories/subscriptions#create'
      get :unsubscribe, to: 'categories/subscriptions#destroy'
    end
  end
  resources :auto_complete_projects, only: [:index]
  resources :donations, only: [:create] do
    collection do
      get :confirm
    end
  end
  resources :auto_complete_cities, only: [:index]
  resources :projects, only: [ :index, :create, :update, :edit, :new, :show] do
    resources :accounts, only: [:create, :update]
    resources :posts, controller: 'projects/posts', only: [ :destroy ]
    resources :rewards do
      post :sort, on: :member
    end
    resources :contributions, {except: [:index], controller: 'projects/contributions'} do
      collection do
        get :fallback_create, to: 'projects/contributions#create'
      end
      member do
        get 'toggle_anonymous'
        get :second_slip
        get :no_account_refund
      end
      put :credits_checkout, on: :member
    end

    get 'video', on: :collection
    member do
      get 'insights'
      put 'pay'
      get 'embed'
      get 'video_embed'
      get 'embed_panel'
      get 'send_to_analysis'
      get 'publish'
    end
  end
  resources :users do
    resources :credit_cards, controller: 'users/credit_cards', only: [ :destroy ]
    member do
      get :unsubscribe_notifications
      get :credits
      get :settings
      get :billing
      get :reactivate
    end

    resources :unsubscribes, only: [:create]
    member do
      get 'projects'
      put 'unsubscribe_update'
      put 'update_email'
      put 'update_password'
    end
  end

  get "/terms-of-use" => 'high_voltage/pages#show', id: 'terms_of_use'
  get "/privacy-policy" => 'high_voltage/pages#show', id: 'privacy_policy'
  get "/start" => 'high_voltage/pages#show', id: 'start'
  get "/jobs" => 'high_voltage/pages#show', id: 'jobs'
  get "/hello" => 'high_voltage/pages#show', id: 'hello'
  get "/press" => 'high_voltage/pages#show', id: 'press'
  get "/assets" => 'high_voltage/pages#show', id: 'assets'
  get "/guides" => 'high_voltage/pages#show', id: 'guides', as: :guides
  get "/new-admin" => 'high_voltage/pages#show', id: 'new_admin'
  get "/explore" => 'high_voltage/pages#show', id: 'explore'
  get "/team" => 'high_voltage/pages#show', id: 'team'
  get "/flex" => 'high_voltage/pages#show', id: 'flex'

  # User permalink profile
  constraints SubdomainConstraint do
    get "/", to: 'users#show'
  end

  # Root path should be after channel constraints
  root to: 'projects#index'

  namespace :reports do
    resources :contribution_reports_for_project_owners, only: [:index]
  end

  # Feedback form
  resources :feedbacks, only: [:create]

  namespace :admin do
    resources :projects, only: [ :index, :update, :destroy ] do
      member do
        put 'approve'
        put 'push_to_online'
        put 'reject'
        put 'push_to_draft'
        put 'push_to_trash'
      end
    end

    resources :financials, only: [ :index ]

    resources :contributions, only: [ :index, :update, :show ] do
      member do
        get :second_slip
        put 'pay'
        put 'change_reward'
        put 'refund'
        put 'trash'
        put 'request_refund'
        put 'chargeback'
        put 'gateway_refund'
      end
    end
    resources :users, only: [ :index ]

    namespace :reports do
      resources :contribution_reports, only: [ :index ]
    end
  end

  resource :api_token, only: [:show]

  get "/:permalink" => "projects#show", as: :project_by_slug

end


text:
package com.mongodb;

import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import org.bson.Document;

public class App {
    public static void main(String[] args) {
        MongoClientOptions options = MongoClientOptions.builder().build();

        MongoClient client = new MongoClient(new ServerAddress(), options);

        MongoDatabase db = client.getDatabase("test");

        MongoCollection<Document> collection = db.getCollection("test");

    }
}


text:
module Opscode
  module ChefClient
    # helper methods for use in chef-client recipe code
    module Helpers
      include Chef::Mixin::Language if Chef::VERSION < '11.0.0'
      include Chef::DSL::PlatformIntrospection if Chef::VERSION >= '11.0.0'

      def chef_server_user
        if Chef::VERSION >= '11.0.0'
          system('getent passwd opscode') ? 'opscode' : 'chef_server'
        else
         'chef'
        end
      end

      def chef_server?
        if node['platform'] == 'windows'
          node.recipe?('chef-server')
        else
          Chef::Log.debug("Node has Chef Server Recipe? #{node.recipe?("chef-server")}")
          Chef::Log.debug("Node has Chef Server Executable? #{system("which chef-server > /dev/null 2>&1")}") # ~FC048 Prefer Mixlib::ShellOut is ignored here
          Chef::Log.debug("Node has Chef Server Ctl Executable? #{system("which chef-server-ctl > /dev/null 2>&1")}") # ~FC048 Prefer Mixlib::ShellOut is ignored here
          node.recipe?('chef-server') || system('which chef-server > /dev/null 2>&1') || system('which chef-server-ctl > /dev/null 2>&1') # ~FC048 Prefer Mixlib::ShellOut is ignored here
        end
      end

      def wmi_property_from_query(wmi_property, wmi_query)
        @wmi = ::WIN32OLE.connect("winmgmts://")
        result = @wmi.ExecQuery(wmi_query)
        return nil unless result.each.count > 0
        result.each.next.send(wmi_property)
      end

      def chef_client_service_running
        wmi_property_from_query(:name, "select * from Win32_Service where name = 'chef-client'") != nil
      end

      def root_owner
        if ['windows'].include?(node['platform'])
          wmi_property_from_query(:name, "select * from Win32_UserAccount where sid like 'S-1-5-21-%-500' and LocalAccount=True")
        else
          'root'
        end
      end

      def dir_owner
        if chef_server?
          chef_server_user
        else
          root_owner
        end
      end

      def root_group
        if %w{ openbsd freebsd mac_os_x mac_os_x_server }.include?(node['platform'])
          'wheel'
        elsif ['aix'].include?(node['platform'])
          'system'
        elsif ['windows'].include?(node['platform'])
          wmi_property_from_query(:name, "select * from Win32_Group where SID = 'S-1-5-32-544' AND LocalAccount=TRUE")
        else
          'root'
        end
      end

      def dir_group
        if chef_server?
          chef_server_user
        else
          root_group
        end
      end

      def create_directories
        # dir_owner and dir_group are not found in the block below.
        d_owner = dir_owner
        d_group = dir_group
        %w{run_path cache_path backup_path log_dir conf_dir}.each do |dir|
          # Do not redefine the resource if it exist
          begin
            r = resources(directory: node['chef_client'][dir])
          rescue Chef::Exceptions::ResourceNotFound
            directory node['chef_client'][dir] do
              recursive true
              mode 00750 if dir == 'log_dir'
              owner d_owner
              group d_group
            end
          end
        end
      end

      def find_chef_client
        if node['platform'] == 'windows'
          existence_check = :exists?
          # Where will also return files that have extensions matching PATHEXT (e.g.
          # *.bat). We don't want the batch file wrapper, but the actual script.
          which = 'set PATHEXT=.exe & where'
          Chef::Log.debug "Using exists? and 'where', since we're on Windows"
        else
          existence_check = :executable?
          which = 'which'
          Chef::Log.debug "Using executable? and 'which' since we're on Linux"
        end

        chef_in_sane_path = lambda do
          begin
            Chef::Client::SANE_PATHS.map do |p|
              p = "#{p}/chef-client"
              p if ::File.send(existence_check, p)
            end.compact.first
          rescue NameError
            false
          end
        end

        # COOK-635 account for alternate gem paths
        # try to use the bin provided by the node attribute
        if ::File.send(existence_check, node['chef_client']['bin'])
          Chef::Log.debug 'Using chef-client bin from node attributes'
          node['chef_client']['bin']
        # search for the bin in some sane paths
        elsif Chef::Client.const_defined?('SANE_PATHS') && chef_in_sane_path.call
          Chef::Log.debug 'Using chef-client bin from sane path'
          chef_in_sane_path
        # last ditch search for a bin in PATH
      elsif (chef_in_path = %x{#{which} chef-client}.chomp) && ::File.send(existence_check, chef_in_path)  # ~FC048 Prefer Mixlib::ShellOut is ignored here
          Chef::Log.debug 'Using chef-client bin from system path'
          chef_in_path
        else
          fail "Could not locate the chef-client bin in any known path. Please set the proper path by overriding the node['chef_client']['bin'] attribute."
        end
      end
    end
  end
end


text:
module.exports = {
    'ceil': require('./math/ceil'),
    'clamp': require('./math/clamp'),
    'countSteps': require('./math/countSteps'),
    'floor': require('./math/floor'),
    'inRange': require('./math/inRange'),
    'isNear': require('./math/isNear'),
    'lerp': require('./math/lerp'),
    'loop': require('./math/loop'),
    'map': require('./math/map'),
    'norm': require('./math/norm'),
    'overflow': require('./math/overflow'),
    'round': require('./math/round')
};


text:
```bash
composer require socialiteproviders/bitbucket
```

## Installation & Basic Usage

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

```php
'bitbucket' => [
  'client_id' => env('BITBUCKET_CLIENT_ID'),
  'client_secret' => env('BITBUCKET_CLIENT_SECRET'),
  'redirect' => env('BITBUCKET_REDIRECT_URI')
],
```

### Add provider event listener

Configure the package's listener to listen for `SocialiteWasCalled` events.

Add the event to your `listen[]` array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.

```php
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Bitbucket\BitbucketExtendSocialite::class.'@handle',
    ],
];
```

### Usage

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

```php
return Socialite::driver('bitbucket')->redirect();
```

### Returned User fields

- ``id``
- ``nickname``
- ``name``
- ``email``
- ``avatar``

### Reference

- [Bitbucket API Reference](https://developer.atlassian.com/bitbucket/api/2/reference/)


text:
package com.palantir.atlasdb.keyvalue.dbkvs.impl.sweep;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import com.google.common.collect.ImmutableList;
import com.palantir.atlasdb.keyvalue.api.CandidateCellForSweeping;
import com.palantir.atlasdb.keyvalue.api.Cell;
import com.palantir.atlasdb.keyvalue.api.ImmutableCandidateCellForSweeping;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;

public class CandidateGroupingIteratorTest {

    @Test
    public void emptyInput() {
        assertThat(group(ImmutableList.of())).isEmpty();
    }

    @Test
    public void singleCellInOnePage() {
        assertThat(group(ImmutableList.of(ImmutableList.of(cellTs("a", "x", 10L), cellTs("a", "x", 20L)))))
                .containsExactly(ImmutableList.of(candidate("a", "x", false, 10L, 20L)));
    }

    @Test
    public void singleCellSpanningTwoPages() {
        assertThat(group(ImmutableList.of(
                        ImmutableList.of(cellTs("a", "x", 10L), cellTs("a", "x", 20L)),
                        ImmutableList.of(cellTs("a", "x", 30L)))))
                .containsExactly(ImmutableList.of(), ImmutableList.of(candidate("a", "x", false, 10L, 20L, 30L)));
    }

    @Test
    public void severalCellsInSinglePage() {
        assertThat(group(ImmutableList.of(
                        ImmutableList.of(cellTs("a", "x", 10L), cellTs("a", "y", 10L), cellTs("b", "y", 10L)))))
                .containsExactly(ImmutableList.of(
                        candidate("a", "x", false, 10L),
                        candidate("a", "y", false, 10L),
                        candidate("b", "y", false, 10L)));
    }

    @Test
    public void latestValueEmpty() {
        assertThat(group(ImmutableList.of(ImmutableList.of(cellTs("a", "x", 10L, false), cellTs("a", "x", 20L, true)))))
                .containsExactly(ImmutableList.of(candidate("a", "x", true, 10L, 20L)));
    }

    @Test
    public void nonLatestValueEmpty() {
        assertThat(group(ImmutableList.of(ImmutableList.of(cellTs("a", "x", 10L, true), cellTs("a", "x", 20L, false)))))
                .containsExactly(ImmutableList.of(candidate("a", "x", false, 10L, 20L)));
    }

    @Test
    public void throwIfTimestampsAreOutOfOrder() {
        assertThatThrownBy(
                        () -> group(ImmutableList.of(ImmutableList.of(cellTs("a", "x", 20L), cellTs("a", "x", 10L)))))
                .hasMessage("Timestamps for each cell must be fed in strictly increasing order");
    }

    private static CandidateCellForSweeping candidate(
            String rowName, String colName, boolean latestValEmpty, Long... ts) {
        Arrays.sort(ts);
        return ImmutableCandidateCellForSweeping.builder()
                .cell(Cell.create(bytes(rowName), bytes(colName)))
                .isLatestValueEmpty(latestValEmpty)
                .sortedTimestamps(Arrays.asList(ts))
                .build();
    }

    private static List<List<CandidateCellForSweeping>> group(List<List<CellTsPairInfo>> cellTsPairBatches) {
        return ImmutableList.copyOf(CandidateGroupingIterator.create(cellTsPairBatches.iterator()));
    }

    private static CellTsPairInfo cellTs(String rowName, String colName, long ts) {
        return cellTs(rowName, colName, ts, false);
    }

    private static CellTsPairInfo cellTs(String rowName, String colName, long ts, boolean emptyVal) {
        return new CellTsPairInfo(bytes(rowName), bytes(colName), ts, emptyVal);
    }

    private static byte[] bytes(String string) {
        return string.getBytes(StandardCharsets.UTF_8);
    }
}


text:
![Dev-Mind](http://dev-mind.fr/logo/logo_1500.png)

How to implement tests in a JS app in 15 minutes


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd">

<title>Documentation for Growl Framework (Growl.hdoc)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="HeaderDoc">

<frameset cols="190,100%">
<frame src="toc.html" name="toc">
<frame src="Growldoc.html" name="doc">
</frameset>
<noframes>

This document set is best viewed in a browser that supports frames. To access the TOC, Click here

</noframes>


text:
package main

import (
	"flag"
	"fmt"
	"net/http"
	_ "net/http/pprof"
	"os"
	"os/signal"
	"runtime/debug"
	"sync"

	"github.com/netflix/rend/handlers"
	"github.com/netflix/rend/handlers/inmem"
	"github.com/netflix/rend/handlers/memcached"
	"github.com/netflix/rend/handlers/memcached/batched"
	"github.com/netflix/rend/metrics"
	"github.com/netflix/rend/orcas"
	"github.com/netflix/rend/protocol"
	"github.com/netflix/rend/protocol/binprot"
	"github.com/netflix/rend/protocol/textprot"
	"github.com/netflix/rend/server"
)

func init() {
	// Set GOGC default explicitly
	if _, set := os.LookupEnv("GOGC"); !set {
		debug.SetGCPercent(100)
	}

	// Setting up signal handlers
	sigs := make(chan os.Signal)
	signal.Notify(sigs, os.Interrupt)

	go func() {
		<-sigs
		panic("Keyboard Interrupt")
	}()

	// http debug and metrics endpoint
	go http.ListenAndServe("localhost:11299", nil)

	// metrics output prefix
	metrics.SetPrefix("rend_")
}

// Flags
var (
	chunked bool
	l1sock  string
	l1inmem bool

	l1batched bool
	batchOpts batched.Opts

	l2enabled bool
	l2sock    string

	locked      bool
	concurrency int
	multiReader bool

	port            int
	batchPort       int
	useDomainSocket bool
	sockPath        string
)

func init() {
	flag.BoolVar(&chunked, "chunked", false, "If --chunked is specified, the chunked handler is used for L1")
	flag.BoolVar(&l1inmem, "l1-inmem", false, "Use the debug in-memory in-process L1 cache")
	flag.StringVar(&l1sock, "l1-sock", "invalid.sock", "Specifies the unix socket to connect to L1")

	var tempBatchSize,
		tempBatchDelay,
		tempBatchReadBufSize,
		tempBatchWriteBufSize,
		tempBatchEvalIntervalSec int

	var tempBatchLoadFactorRatio,
		tempBatchOverloadedRatio float64

	flag.BoolVar(&l1batched, "l1-batched", false, "Uses the batching handler for L1")
	flag.IntVar(&tempBatchSize, "batch-size", 0, "The size of each batch sent to the remote server in the batched handler. Positive values only. 0 assumes default.")
	flag.IntVar(&tempBatchDelay, "batch-delay", 0, "The max time a batch will wait to fill up (microseconds). Positive values only. 0 assumes default.")
	flag.IntVar(&tempBatchReadBufSize, "batch-read-buf-size", 0, "The read buffer size per pooled connection (bytes). Positive values only. 0 assumes default.")
	flag.IntVar(&tempBatchWriteBufSize, "batch-write-buf-size", 0, "The write buffer size per pooled connection (bytes). Positive values only. 0 assumes default.")
	flag.IntVar(&tempBatchEvalIntervalSec, "batch-eval-interval", 0, "The interval between evalations of the pool size (seconds). Positive values only. 0 assumes default.")
	flag.Float64Var(&tempBatchLoadFactorRatio, "batch-expand-load-factor-ratio", 0, "The ratio of average batch size above which the pool will expand (float). Positive values only between 0 and 1. 0 assumes default.")
	flag.Float64Var(&tempBatchOverloadedRatio, "batch-expand-overloaded-ratio", 0, "The ratio of connections whose average size is greater than the max batch size - 1 above which the pool will expand (float). Positive values only between 0 and 1. 0 assumes default.")

	flag.BoolVar(&l2enabled, "l2-enabled", false, "Specifies if l2 is enabled")
	flag.StringVar(&l2sock, "l2-sock", "invalid.sock", "Specifies the unix socket to connect to L2. Only used if --l2-enabled is true.")

	flag.BoolVar(&locked, "locked", false, "Add locking to overall operations (above L1/L2 layers)")
	flag.IntVar(&concurrency, "concurrency", 8, "Concurrency level. 2^(concurrency) parallel operations permitted, assuming no collisions. Large values (>16) are likely useless and will eat up RAM. Default of 8 means 256 operations (on different keys) can happen in parallel.")
	flag.BoolVar(&multiReader, "multi-reader", true, "Allow (or disallow) multiple readers on the same key. If chunking is used, this will always be false and setting it to true will be ignored.")

	flag.IntVar(&port, "p", 11211, "External port to listen on")
	flag.IntVar(&batchPort, "bp", 11212, "External port to listen on for batch systems")
	flag.BoolVar(&useDomainSocket, "use-domain-socket", false, "Listen on a domain socket instead of a TCP port. --port will be ignored.")
	flag.StringVar(&sockPath, "sock-path", "/tmp/invalid.sock", "The socket path to listen on. Only valid in conjunction with --use-domain-socket.")

	flag.Parse()

	// Validation
	if tempBatchSize < 0 {
		fmt.Println("ERROR: argument --batch-size must be >= 0")
		os.Exit(-1)
	}
	if tempBatchDelay < 0 {
		fmt.Println("ERROR: argument --batch-delay must be >= 0")
		os.Exit(-1)
	}
	if tempBatchReadBufSize < 0 {
		fmt.Println("ERROR: argument --batch-read-buf-size must be >= 0")
		os.Exit(-1)
	}
	if tempBatchWriteBufSize < 0 {
		fmt.Println("ERROR: argument --batch-write-buf-size must be >= 0")
		os.Exit(-1)
	}
	if tempBatchEvalIntervalSec < 0 {
		fmt.Println("ERROR: argument --batch-eval-interval must be >= 0")
		os.Exit(-1)
	}
	if tempBatchLoadFactorRatio < 0 {
		fmt.Println("ERROR: argument --batch-expand-load-factor-ratio must be >= 0")
		os.Exit(-1)
	}
	if tempBatchOverloadedRatio < 0 {
		fmt.Println("ERROR: argument --batch-expand-overloaded-ratio must be >= 0")
		os.Exit(-1)
	}

	if concurrency >= 64 {
		fmt.Println("ERROR: Concurrency cannot be more than 2^64")
		os.Exit(-1)
	}

	batchOpts = batched.Opts{
		BatchSize:             uint32(tempBatchSize),
		BatchDelayMicros:      uint32(tempBatchDelay),
		ReadBufSize:           uint32(tempBatchReadBufSize),
		WriteBufSize:          uint32(tempBatchWriteBufSize),
		EvaluationIntervalSec: uint32(tempBatchEvalIntervalSec),
		LoadFactorExpandRatio: tempBatchLoadFactorRatio,
		OverloadedConnRatio:   tempBatchOverloadedRatio,
	}
}

// And away we go
func main() {
	var l server.ListenConst

	if useDomainSocket {
		l = server.UnixListener(sockPath)
	} else {
		l = server.TCPListener(port)
	}

	protocols := []protocol.Components{binprot.Components, textprot.Components}

	var o orcas.OrcaConst
	var h2 handlers.HandlerConst
	var h1 handlers.HandlerConst

	// Choose the proper L1 handler
	if l1inmem {
		h1 = inmem.New
	} else if chunked {
		h1 = memcached.Chunked(l1sock)
	} else if l1batched {
		h1 = memcached.Batched(l1sock, batchOpts)
	} else {
		h1 = memcached.Regular(l1sock)
	}

	if l2enabled {
		o = orcas.L1L2
		h2 = memcached.Regular(l2sock)
	} else {
		o = orcas.L1Only
		h2 = handlers.NilHandler
	}

	// Add the locking wrapper if requested. The locking wrapper can either allow mutltiple readers
	// or not, with the same difference in semantics between a sync.Mutex and a sync.RWMutex. If
	// chunking is enabled, we want to ensure that stricter locking is enabled, since concurrent
	// sets into L1 with chunking can collide and cause data corruption.
	var lockset uint32
	if locked {
		if chunked || !multiReader {
			o, lockset = orcas.Locked(o, false, uint8(concurrency))
		} else {
			o, lockset = orcas.Locked(o, true, uint8(concurrency))
		}
	}

	go server.ListenAndServe(l, protocols, server.Default, o, h1, h2)

	if l2enabled {
		// If L2 is enabled, start the batch L1 / L2 orchestrator
		l = server.TCPListener(batchPort)
		o := orcas.L1L2Batch

		if locked {
			o = orcas.LockedWithExisting(o, lockset)
		}

		go server.ListenAndServe(l, protocols, server.Default, o, h1, h2)
	}

	// Block forever
	wg := sync.WaitGroup{}
	wg.Add(1)
	wg.Wait()
}


text:
cask 'skala-preview' do
  version '2.0'
  sha256 '4dd88357012c75216dc9bac018b789db37e150608fc1078da00b9c2c36bb7f94'

  # s3.amazonaws.com/bjango was verified as official when first introduced to the cask
  url "https://s3.amazonaws.com/bjango/files/skalapreview/skalapreview#{version}.zip"
  name 'Skala Preview'
  homepage 'https://bjango.com/mac/skalapreview/'
  license :gratis

  app 'Skala Preview.app'
end


text:
main() {
  local num=${1:?'num is required'}

  if [ -f ./package.json ]; then
    echo "./package.json already exists, deleting"
    rm ./package.json
  fi

  if [ -d ./local_module/ ]; then
    echo "./local_module already exists, deleting"
    rm -r ./local_module
  fi

  echo "Generating local_module"
  mkdir ./local_module/

  # Write package.json header
  cat > "./package.json" << EOF
{
  "name": "npm-race",
  "version": "1.0.0",
  "description": "Small repo to reproduce race condition in npm",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "https://github.com/hatchan/npm-race.git"
  },
  "author": "bvdberg",
  "license": "MIT",
  "dependencies": {
EOF

  for (( i=1; i <= $num; i++ )); do
    local module_name="module_$i"
    local module_dir="./local_module/module_$i"
    local comma=","

    if [ "$i" = "$num" ]; then
      comma=""
    fi

    # Add to main package.json dependency list
    cat >> "./package.json" << EOF
    "$module_name": "file:$module_dir"$comma
EOF

    generate_module "$module_name" "$module_dir"
  done

  # Write package.json footer
  cat >> "./package.json" << EOF
  }
}
EOF
}

generate_module() {
  local module_name=${1:?'module_name is required'}
  local module_dir=${2:?'module_dir is required'}

  echo "Creating $module_name"
  mkdir "$module_dir"

  cat > "$module_dir/package.json" << EOF
{
  "name": "$module_name",
  "version": "1.0.0",
  "description": "$module_name",
  "main": "index.js",
  "license": "MIT",
  "private": true
}
EOF

  for (( file=0; file < 10; file++ )); do
    touch "$module_dir/file_$file.js"
  done
}

main $@;


text:
Console solitaire game written by me with C/C++ while I was taking Data Structures course.

### How to Use?
Put "solitaire.cpp" and "solitaire.txt" files in same folder.
Then just compile "solitaire.cpp" with any cpp compiler.

### How to play?
Select a choice with 1,2,3,4.
Enter a card like: B S A, R D Q ...
B S A = (Black Spades A), R D Q = (Red Diamond Queen) ...

First Attribute is card color: B (Black), R (Red)
Second Attribute is card figure: S (Spades), C (Clubs), H (Hearts), D (Diamonds)
Third Attribute is card number: A K Q J 10 9 8 7 6 5 4 3 2


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boln de la Real Soc. Españ. Hist. Nat. , Madrid 25: 366 (1925)

#### Original name
Pestalotia espaillatii Cif. & Gonz. Frag.

### Remarks
null


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Enum MapBaseAbstractionBehavior
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Enum MapBaseAbstractionBehavior
   ">
    <meta name="generator" content="docfx 2.43.2.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Enum MapBaseAbstractionBehavior

Describes mapping behaviors for mapping abstraction types in the serializer.

Namespace: Manatee.Json.Serialization

Assembly: Manatee.Json.dll

Syntax

public enum MapBaseAbstractionBehavior

Fields

        Name
        Description

        None

Specifies that no additional mappings will be made.

        Override

Specifies that all base classes and interfaces will be mapped, overriding any existing mappings.

        Unmapped

Specifies that any unmapped base classes and interfaces will be mapped.

                    Improve this Doc

                    View Source

              Back to top

            Generated by DocFX


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>themelock.com - Chain Responsive Bootstrap3 Admin</title>

        <link href="css/style.default.css" rel="stylesheet">

                        <form class="form form-search" action="search-results.html">
                            <input type="search" class="form-control" placeholder="Search" />
                        </form>

                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

                              5
                            </button>

Notification

                                          Nusja Nawancali likes a photo of you
                                           15 minutes ago

                                          Weno Carasbong shared a photo of you in your Mobile Uploads album.
                                           July 04, 2014

                                          Venro Leonga likes a photo of you
                                           July 03, 2014

                                          Nanterey Reslaba shared a photo of you in your Mobile Uploads album.
                                           July 03, 2014

                                          Nusja Nawancali shared a photo of you in your Mobile Uploads album.
                                           July 02, 2014

                                    See All Notifications

                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

                                2
                            </button>

New Messages

                                        New

                                          Nusja Nawancali

Hi! How are you?...

                                           15 minutes ago

                                        New

                                          Weno Carasbong

Lorem ipsum dolor sit amet...

                                           July 04, 2014

                                          Venro Leonga

Do you have the time to listen to me...

                                           July 03, 2014

                                          Nanterey Reslaba

It might seem crazy what I'm about to say...

                                           July 03, 2014

                                          Nusja Nawancali

Hey I just met you and this is crazy...

                                           July 02, 2014

                                    See All Messages

                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

                            </button>

 My Profile

 Activity Log

 Account Settings

 Help

Sign Out

Elen Adarna

                            Beach Lover

Navigation

 Dashboard

5 Messages

 UI Elements

Alerts & Notifications

Buttons

Extras

Graphs & Charts

Icons

Modals

Panels & Widgets

Sliders

Tabs & Accordions

Typography

 Forms

Code Editor

General Forms

Layouts

Text Editor

Validation

Wizards

 Tables

Basic Tables

Data Tables

 Maps

 Pages

404 Page

Blank Page

Calendar

Invoice

Locked Screen

Media Manager

People Directory

Profile

Search Results

Sign In

Sign Up

UI Elements

Sliders

Sliders

jQuery UI Slider

The jQuery UI Slider plugin makes selected elements into sliders. There are various options such as multiple handles and ranges. The handle can be moved with the mouse or the arrow keys.

Basic Slider

The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys.

Range Slider

Set the range option to true to capture a range of values with two drag handles. The space between the handles is filled with a different background color to indicate those values are selected.

Range With Fixed Maximum

Fix the maximum value of the range slider so that the user can only select a minimum. Set the range option to max.

Range With Fixed Minimum

Fix the minimum value of the range slider so that the user can only select a maximum. Set the range option to min.

Vertical Slider

Change the orientation of the slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to vertical

Vertical Range Slider

Change the orientation of the range slider to vertical. Assign a height value via .height() or by setting the height through CSS, and set the orientation option to vertical


text:
'use strict';

var minimumComicsNumber = 1;
var maximumComicsNumber = 10;
var remoteComicsFetcherURL = 'xkcdcomics.php';
var remoteSelectedDeleteURL = 'xkcdcomicsselecteddelete.php';
var remoteAllDeleteURL = 'xkcdcomicsalldelete.php';
var defaultServerFolderName = 'Images/xkcdImages';

hideLoadingIndicator("Waiting for user input ..");

$("#getImagesButton").click(function() {

    sendRequestToServerWithParameters({
        loadingText: "Downloading ......... Please Wait

",
        remoteURL: remoteComicsFetcherURL,
        parameters: getRequestParametersToSendToServer(),
        requestType: 0
    });

});

$("#removeSelectedImagesButton").click(function() {

    if (confirm('Are you sure you want to remove input range of images from server directory ' + defaultServerFolderName + '?')) {
        sendRequestToServerWithParameters({
            loadingText: "Removing Selected files... Please be patient",
            remoteURL: remoteSelectedDeleteURL,
            parameters: getRequestParametersToSendToServer(),
            requestType: 1
        });
    }

})

$("#removeAllImagesButton").click(function() {

    if (confirm('Are you sure you want to remove all Comics from server directory ' + defaultServerFolderName + '?')) {
        sendRequestToServerWithParameters({
            loadingText: "Removing all files. Please be patient",
            remoteURL: remoteAllDeleteURL,
            parameters: {
                defaultFolderNameValue: defaultServerFolderName
            },
            requestType: 2
        })
    }

})

function sendRequestToServerWithParameters(parametersDictionary) {

    showLoadingIndicator(parametersDictionary.loadingText);
    getPromiseWithURLAndParameters(parametersDictionary.remoteURL, parametersDictionary.parameters, 'text').then(function(response) {
        hideLoadingIndicator(response);
    }, function(error) {
        console.log('Promise rejected With Error ' + JSON.stringify(error));
    });
}

$("#minimumNumber").on("keyup change", function() {
    updateLiveContentWithcomicsInfo();
});

$("#maximumNumber").on("keyup change", function() {
    updateLiveContentWithcomicsInfo();
});

$("input#folderNameInput").on("keyup change", function() {
    defaultServerFolderName = 'Images/' + this.value;
});

//Source - http://stackoverflow.com/questions/469357/html-text-input-allow-only-numeric-input
$("input.numberInput").keydown(function(e) {
    // Allow: backspace, delete, tab, escape, enter and .
    if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
        // Allow: Ctrl+A
        (e.keyCode == 65 && e.ctrlKey === true) ||
        // Allow: home, end, left, right
        (e.keyCode >= 35 && e.keyCode <= 39)) {
        // let it happen, don't do anything
        return;
    }
    // Ensure that it is a number and stop the keypress
    if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
        e.preventDefault();
    }
});

function updateLiveContentWithcomicsInfo() {
    minimumComicsNumber = $("#minimumNumber").val()
    maximumComicsNumber = $("#maximumNumber").val()

    minimumComicsNumber = (minimumComicsNumber.length > 0) ? minimumComicsNumber : 1;
    maximumComicsNumber = (maximumComicsNumber.length > 0) ? maximumComicsNumber : 100;

    //Only for retarded users
    if (maximumComicsNumber <= minimumComicsNumber) {
        maximumComicsNumber = minimumComicsNumber + 1;
    }

    $("div#currentInputStatus").text("Requesting comics sequence ranging from " + minimumComicsNumber + " to " + maximumComicsNumber);
}

function showLoadingIndicator(loadingMessage) {
    $("#loadingIndicator").html(loadingMessage);

}

function hideLoadingIndicator(displayMessage) {
    $("#loadingIndicator").html(displayMessage);

}

function getRequestParametersToSendToServer() {
    return {
        miniComicsSequence: minimumComicsNumber,
        maxComicsSequence: maximumComicsNumber,
        defaultFolderNameValue: defaultServerFolderName
    };
}


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

namespace ReactNative.Bridge
{
    /// <summary>
    /// Interface for making JavaScript calls from native code.
    /// </summary>
    public interface IJavaScriptExecutor : IDisposable
    {
        /// <summary>
        /// Call the JavaScript method from the given module.
        /// </summary>
        /// <param name="moduleName">The module name.</param>
        /// <param name="methodName">The method name.</param>
        /// <param name="arguments">The arguments.</param>
        /// <returns>The flushed queue of native operations.</returns>
        JToken CallFunctionReturnFlushedQueue(string moduleName, string methodName, JArray arguments);

        /// <summary>
        /// Invoke the JavaScript callback.
        /// </summary>
        /// <param name="callbackId">The callback identifier.</param>
        /// <param name="arguments">The arguments.</param>
        /// <returns>The flushed queue of native operations.</returns>
        JToken InvokeCallbackAndReturnFlushedQueue(int callbackId, JArray arguments);

        /// <summary>
        /// Invoke the React 'flushedQueue' function.
        /// </summary>
        /// <returns>The flushed queue of native operations.</returns>
        JToken FlushedQueue();

        /// <summary>
        /// Sets a global variable in the JavaScript runtime.
        /// </summary>
        /// <param name="propertyName">The global variable name.</param>
        /// <param name="value">The value.</param>
        void SetGlobalVariable(string propertyName, JToken value);

        /// <summary>
        /// Runs the JavaScript at the given path.
        /// </summary>
        /// <param name="sourcePath">The source path.</param>
        /// <param name="sourceUrl">The source URL.</param>
        void RunScript(string sourcePath, string sourceUrl);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Flora Lishainikiv Ukraïni (Kiev), <b>2</b>(2) 193 (1956)

#### Original name
Polyblastiaceae Oksner

### Remarks
null


text:
import { store } from 'stores/redux-store';
import { getIsLoggedIn } from 'actions/authentication';
import { Promise } from 'lib/promise';

/**
 * Function for use in a route's onEnter hook that will verify a user if authenticated before proceeding and if not,
 * will redirect to the sign in page.
 */
export function checkAuthentication(nextState, replace, cb) {
  // See if user is authenticated
  let { authentication: { currentUser: { isLoggedIn } } } = store.getState();

  const isLoggedInPromise = isLoggedIn !== null
    ? Promise.resolve(isLoggedIn)
    : store.dispatch(getIsLoggedIn())
        .then(() => {
          // See if they are logged in after asking the server for their userId
          const { authentication: { currentUser: { isLoggedIn: isLoggedInFromServer } } } = store.getState();
          return isLoggedInFromServer;
        })
        .catchReturn(false);

  isLoggedInPromise.then(loggedIn => {
    if (loggedIn === false) {
      // Send them to the sign in page and remember where they were trying to go
      replace({
        pathname: '/account/signin',
        state: {
          redirectAfterLogin: {
            pathname: nextState.location.pathname,
            search: nextState.location.search
          }
        }
      });
    }
  })
  .then(cb);
};

export default checkAuthentication;


text:
BI.DynamicDatePane = BI.inherit(BI.Widget, {

    props: {
        baseCls: "bi-dynamic-date-pane",
        minDate: "1900-01-01",
        maxDate: "2099-12-31",
        supportDynamic: true
    },

    render: function () {
        var self = this, o = this.options;
        return {
            type: "bi.vtape",
            items: [{
                el: {
                    type: "bi.linear_segment",
                    invisible: !o.supportDynamic,
                    cls: "bi-split-bottom",
                    height: 30,
                    items: BI.createItems([{
                        text: BI.i18nText("BI-Multi_Date_YMD"),
                        value: BI.DynamicDatePane.Static
                    }, {
                        text: BI.i18nText("BI-Basic_Dynamic_Title"),
                        value: BI.DynamicDatePane.Dynamic
                    }], {
                        textAlign: "center"
                    }),
                    listeners: [{
                        eventName: BI.ButtonGroup.EVENT_CHANGE,
                        action: function () {
                            var value = this.getValue()[0];
                            self.dateTab.setSelect(value);
                            switch (value) {
                                case BI.DynamicDatePane.Static:
                                    var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
                                    self.ymd.setValue({
                                        year: date.getFullYear(),
                                        month: date.getMonth() + 1,
                                        day: date.getDate()
                                    });
                                    break;
                                case BI.DynamicDatePane.Dynamic:
                                    self.dynamicPane.setValue({
                                        year: 0
                                    });
                                    break;
                                default:
                                    break;
                            }
                            self.fireEvent(BI.DynamicDatePane.EVENT_CHANGE);
                        }
                    }],
                    ref: function () {
                        self.switcher = this;
                    }
                },
                height: o.supportDynamic ? 30 : 0
            }, {
                type: "bi.tab",
                ref: function () {
                    self.dateTab = this;
                },
                showIndex: BI.DynamicDatePane.Static,
                cardCreator: function (v) {
                    switch (v) {
                        case BI.DynamicDatePane.Static:
                            return {
                                type: "bi.static_date_pane_card",
                                min: o.minDate,
                                max: o.maxDate,
                                behaviors: o.behaviors,
                                listeners: [{
                                    eventName: "EVENT_CHANGE",
                                    action: function () {
                                        self.fireEvent(BI.DynamicDatePane.EVENT_CHANGE);
                                    }
                                }, {
                                    eventName: "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW",
                                    action: function () {
                                        self.fireEvent(BI.DynamicDatePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
                                    }
                                }],
                                ref: function () {
                                    self.ymd = this;
                                }
                            };
                        case BI.DynamicDatePane.Dynamic:
                        default:
                            return {
                                type: "bi.vtape",
                                items: [{
                                    type: "bi.dynamic_date_card",
                                    min: o.minDate,
                                    max: o.maxDate,
                                    ref: function () {
                                        self.dynamicPane = this;
                                    }
                                }, {
                                    el: {
                                        type: "bi.center",
                                        items: [{
                                            type: "bi.text_button",
                                            cls: "bi-high-light bi-border-top",
                                            shadow: true,
                                            text: BI.i18nText("BI-Basic_Clear"),
                                            textHeight: 23,
                                            listeners: [{
                                                eventName: BI.TextButton.EVENT_CHANGE,
                                                action: function () {
                                                    self.setValue();
                                                    self.fireEvent(BI.DynamicDatePane.EVENT_CHANGE);
                                                }
                                            }]
                                        }, {
                                            type: "bi.text_button",
                                            cls: "bi-border-left bi-high-light bi-border-top",
                                            textHeight: 23,
                                            shadow: true,
                                            text: BI.i18nText("BI-Basic_OK"),
                                            listeners: [{
                                                eventName: BI.TextButton.EVENT_CHANGE,
                                                action: function () {
                                                    var type = self.dateTab.getSelect();
                                                    if (type === BI.DynamicDateCombo.Dynamic) {
                                                        self.dynamicPane.checkValidation(true) && self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE);
                                                    } else {
                                                        self.fireEvent(BI.DynamicDatePane.EVENT_CHANGE);
                                                    }
                                                }
                                            }]
                                        }]
                                    },
                                    height: 24
                                }]
                            };
                    }
                }
            }]
        };
    },

    created: function () {
        this.setValue(this.options.value);
    },

    _checkValueValid: function (value) {
        return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
    },

    _checkValue: function (v) {
        switch (v.type) {
            case BI.DynamicDateCombo.Dynamic:
                return BI.isNotEmptyObject(v.value);
            case BI.DynamicDateCombo.Static:
            default:
                return true;
        }
    },

    setMinDate: function (minDate) {
        if (this.options.minDate !== minDate) {
            this.options.minDate = minDate;
            this.ymd.setMinDate(minDate);
        }
    },

    setMaxDate: function (maxDate) {
        if (this.options.maxDate !== maxDate) {
            this.options.maxDate = maxDate;
            this.ymd.setMaxDate(maxDate);
        }
    },

    setValue: function (v) {
        v = v || {};
        var type = v.type || BI.DynamicDateCombo.Static;
        var value = v.value || v;
        this.switcher.setValue(type);
        this.dateTab.setSelect(type);
        switch (type) {
            case BI.DynamicDateCombo.Dynamic:
                this.dynamicPane.setValue(value);
                break;
            case BI.DynamicDateCombo.Static:
            default:
                if (this._checkValueValid(value)) {
                    var date = BI.getDate();
                    this.ymd.setValue({
                        year: date.getFullYear(),
                        month: date.getMonth() + 1
                    });
                } else {
                    this.ymd.setValue(value);
                }
                break;
        }
    },

    getValue: function () {
        var type = this.dateTab.getSelect();
        return {
            type: type,
            value: type === BI.DynamicDatePane.Static ? this.dateTab.getValue() : this.dynamicPane.getValue()
        };
    }
});

BI.DynamicDatePane.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDatePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW";

BI.shortcut("bi.dynamic_date_pane", BI.DynamicDatePane);

BI.extend(BI.DynamicDatePane, {
    Static: 1,
    Dynamic: 2
});