text:
package com.qualcomm.ftcrobotcontroller.opmodes.phoenix;

import com.lasarobotics.library.sensor.kauailabs.navx.NavXDevice;
import com.lasarobotics.library.util.MathUtil;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorController;

import org.lasarobotics.vision.android.Cameras;
import org.lasarobotics.vision.detection.objects.Rectangle;
import org.lasarobotics.vision.ftc.resq.Beacon;
import org.lasarobotics.vision.opmode.LinearVisionOpMode;
import org.lasarobotics.vision.util.ScreenOrientation;
import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Size;

import android.util.Log;

/**
 * Pheonix (TM) Autonomous
 */
public class AutoPhoenix extends LinearVisionOpMode {
    //Frame counter
    int frameCount = 0;
    DcMotor left,right;
    NavXDevice navx;
    private static final int TOLERANCE_DEGREES = 1;
    private final int NAVX_DIM_I2C_PORT = 2;

    public void resetEncoder(DcMotor m) {
        while (m.getCurrentPosition() != 0) {
            m.setMode(DcMotorController.RunMode.RESET_ENCODERS);
        }
        m.setMode(DcMotorController.RunMode.RUN_USING_ENCODERS);
    }
    public float convertDegNavX(float deg) {
        if (deg < 0)
            deg = 360 - Math.abs(deg);
        return deg;
    }
    public void turnToDegNavX(int deg, double power) throws InterruptedException {
        navx.reset();
        while (!MathUtil.inBounds(-1,1,navx.getRotation().x)){}
        left.setPower(-power);
        right.setPower(power);

        float yaw;

        boolean arrived = false;

        while(!arrived) {
            yaw = navx.getRotation().x;
            navx.displayTelemetry(telemetry);
            if (MathUtil.inBounds(convertDegNavX(deg) - TOLERANCE_DEGREES, convertDegNavX(deg) + TOLERANCE_DEGREES, convertDegNavX(yaw)))
                arrived = true;
        }

        left.setPower(0);
        right.setPower(0);
    }
    public void driveTo(int ticks, double powerl, double powerr) throws InterruptedException {
        double wheelPosition = 0;
        resetEncoder(right);
        while (Math.abs(wheelPosition) < ticks) {
            wheelPosition = right.getCurrentPosition();
            telemetry.addData("Wheel at", wheelPosition + " ticks.");
            left.setPower(powerl);
            right.setPower(powerr);
            waitOneFullHardwareCycle();
        }
        left.setPower(0);
        right.setPower(0);
        waitOneFullHardwareCycle();
        resetEncoder(right);
        waitOneFullHardwareCycle();
    }
    private void initVision() throws InterruptedException {
        waitForVisionStart();

        this.setCamera(Cameras.PRIMARY);
        this.setFrameSize(new Size(900, 900));

        enableExtension(Extensions.BEACON);
        enableExtension(Extensions.ROTATION);
        beacon.setAnalysisMethod(Beacon.AnalysisMethod.FAST);
    }
    @Override
    public void runOpMode() throws InterruptedException {
        left = hardwareMap.dcMotor.get("l");
        right = hardwareMap.dcMotor.get("r");
        left.setDirection(DcMotor.Direction.REVERSE);
        navx = new NavXDevice(hardwareMap, "dim",NAVX_DIM_I2C_PORT);
        initVision();
        waitForStart();
        driveTo(500, 1, 1);
        turnToDegNavX(320, -1);
        driveTo(7600, 1, 1);
        turnToDegNavX(315, -1);
        sleep(1000);
        driveTo(800, 1, 1);
        sleep(1000);
        while (opModeIsActive()) {
            //Log a few things
            telemetry.addData("Beacon Color", beacon.getAnalysis().getColorString());
            telemetry.addData("Beacon Location (Center)", beacon.getAnalysis().getLocationString());
            telemetry.addData("Beacon Confidence", beacon.getAnalysis().getConfidenceString());
            telemetry.addData("Rotation Compensation", rotation.getRotationCompensationAngle());
            telemetry.addData("Frame Rate", fps.getFPSString() + " FPS");
            telemetry.addData("Frame Size", "Width: " + width + " Height: " + height);
            telemetry.addData("Frame Counter", frameCount);
            //You can access the most recent frame data and modify it here using getFrameRgba() or getFrameGray()
            //Vision will run asynchronously (parallel) to any user code so your programs won't hang
            //You can use hasNewFrame() to test whether vision processed a new frame
            //Once you copy the frame, discard it immediately with discardFrame()
            if (hasNewFrame()) {
                //Get the frame
                Mat rgba = getFrameRgba();
                Mat gray = getFrameGray();
                //Discard the current frame to allow for the next one to render
                discardFrame();
                //Do all of your custom frame processing here
                //For this demo, let's just add to a frame counter
                frameCount++;
            }
            //Wait for a hardware cycle to allow other processes to run
            waitOneFullHardwareCycle();
        }
    }
}


text:
import os
import sys

root_dir = os.path.join('/', 'home', 'igor', 'Projects', 'python', 'forum')
os.chdir(root_dir)
sys.path.append(root_dir)

import functools
import json
import logging
import threading

import tornado.web
import tornado.gen
import tornado.ioloop
from tornado.options import define, options

from api import api_executor
from api.util.response_helpers import *
from api.util.DataService import DataService

ds = DataService()

def async_task(func):
    @functools.wraps(func)
    def async_func(*args, **kwargs):
        th = threading.Thread(target=func, args=args, kwargs=kwargs)
        th.start()

    return async_func

class ThreadMixin(tornado.web.RequestHandler):
    def start_worker(self):
        threading.Thread(target=self.worker).start()

    def _worker(self):
        raise NotImplementedError("Abstract method")

    def worker(self):
        try:
            self._worker()
        except tornado.web.HTTPError, e:
            self.set_status(e.status_code)
        except:
            logging.error("_worker problem", exc_info=True)
            self.set_status(500)
        tornado.ioloop.IOLoop.instance().add_callback(self.async_callback(self.results))

    def results(self):
        if self.get_status() != 200:
            self.send_error(self.get_status())
            return
        if hasattr(self, 'res') and self.res is not None:
            self.finish(self.res)
            return
        if hasattr(self, 'redir'):
            self.redirect(self.redir)
            return
        self.send_error(500)

class Handler(ThreadMixin):
    entity = None
    action = None
    data = None
    res = None

    def _worker(self):
        self.res = api_executor.execute(ds, self.entity, self.action, self.data)

    @tornado.web.asynchronous
    def get(self, entity, action):
        self.entity = entity
        self.action = action
        self.data = parse_get(self.request.arguments)
        self.start_worker()

    @tornado.web.asynchronous
    def post(self, entity, action):
        self.entity = entity
        self.action = action
        self.data = json.loads(self.request.body, encoding='utf-8')
        self.start_worker()

class ClearHandler(ThreadMixin):
    res = None

    def _worker(self):
        self.res = api_executor.clear_db()

    @tornado.web.asynchronous
    def get(self):
        self.send_error(405)

    @tornado.web.asynchronous
    def post(self):
        self.start_worker()

define('port', type=int, default=9001)

def main():
    tornado.options.parse_command_line()

    application = tornado.web.Application([
        (r"/(\S+)/(\S+)", Handler),
        (r"/clear/", ClearHandler),
        (r"/clear", ClearHandler),
    ])

    logging.info("Server started on port %s", options.port)
    application.listen(options.port)
    try:
        tornado.ioloop.IOLoop.instance().start()
    except KeyboardInterrupt:
        ds.close_all()
        logging.info("Server stopped")

if __name__ == "__main__":
    main()

redpajama_set_name: RedPajamaGithub


text:
#ifndef SG_ENTRY_H
#define SG_ENTRY_H
#include <stdarg.h>
#include "sg/defs.h"
#ifdef __cplusplus
extern "C" {
#endif
union sg_event;
struct sg_error;

/**
 * @file sg/entry.h
 *
 * @brief Game entry points.
 *
 * This layer connects the library code with the game code.  This file
 * defines functions both in the game code (which must be implemented
 * by the game) and functions in the library code.
 */

/**
 * @brief Game flags, returned in the ::sg_game_info structure.
 */
enum {
    /**
     * @brief Allow high resolution windows.
     */
    SG_GAME_ALLOW_HIDPI = 01,

    /**
     * @brief Allow the window to be resized.
     */
    SG_GAME_ALLOW_RESIZE = 02
};

/**
 * @brief Game startup information.
 */
struct sg_game_info {
    /** @brief The minimum window width.  */
    int min_width;
    /** @brief The minimum window height.  */
    int min_height;

    /** @brief The suggested default window width.  */
    int default_width;
    /** @brief The suggested default window height.  */
    int default_height;

    /** @brief The minimum window aspect ratio, width divided by
        height.  */
    double min_aspect;
    /** @brief The maximum window aspect ratio, width divided by
        height.  */
    double max_aspect;

    /** @brief Game flags.  */
    unsigned flags;

    /** @brief The name of the game.  */
    const char *name;
};

/**
 * @brief Handle game startup.
 *
 * This is a game entry point, and must be implemented.  This function
 * will be called exactly once, before any other entry points.  The
 * OpenGL context will not be valid.
 */
void
sg_game_init(void);

/**
 * @brief Handle request for game startup information.
 *
 * This is a game entry point, and must be implemented.  The OpenGL
 * context will not be valid.
 *
 * @param info When called, this contains the default startup
 * information.  This may be modified or left unmodified.
 */
void
sg_game_getinfo(struct sg_game_info *info);

/**
 * @brief Handle an event.
 *
 * This is a game entry point, and must be implemented.  The OpenGL
 * context will not be valid except for certain event types.
 *
 * @brief evt The event to handle.
 */
void
sg_game_event(union sg_event *evt);

/**
 * @brief Handle screen redraw.
 *
 * This is a game entry point, and must be implemented.  OpenGL
 * functions may be used.
 *
 * @param width The viewport width.
 * @param height The viewport height.
 * @param time The current time, in seconds, since startup.
 */
void
sg_game_draw(int width, int height, double time);

/**
 * @brief Handle game shutdown.
 *
 * This is a game entry point, and must be implemented.  The OpenGL
 * context will not be valid.  This function may be called at most
 * once, before the program shuts down.  No other entry points will be
 * called after this one.
 */
void
sg_game_destroy(void);

/**
 * @brief Quit the program.
 */
void
sg_sys_quit(void);

/**
 * @brief Display the given error message and exit the program
 * immediately.
 *
 * @param msg The message to display, a NUL-terminated UTF-8 string.
 */
SG_ATTR_NORETURN
void
sg_sys_abort(const char *msg);

/**
 * @brief Display the given error message and exit the program
 * immediately.
 *
 * @param msg The message to display, a NUL-terminated UTF-8 string.
 */
SG_ATTR_NORETURN
SG_ATTR_FORMAT(printf, 1, 2)
void
sg_sys_abortf(const char *msg, ...);

/**
 * @brief Display the given error message and exit the program
 * immediately.
 *
 * @param msg The message to display, a NUL-terminated UTF-8 string.
 */
SG_ATTR_NORETURN
void
sg_sys_abortv(const char *msg, va_list ap);

/**
 * @brief Enable or disable mouse capture.
 *
 * @param enabled Whether mouse capture should be enabled.
 */
void
sg_sys_capturemouse(int enabled);

#ifdef __cplusplus
}
#endif
#endif


text:
default['sol']['dell-inc']['tty']['name'] = 'ttyS0'
default['sol']['dell-inc']['serial']['bios_speed'] = '115200'
default['sol']['dell-inc']['serial']['speed'] = '115200'

# Tested against IPMI v2.0 compliant KVM on a Quanta S99k.

default['sol']['quanta']['tty']['name'] = 'ttyS1' # COM1 with VT100
default['sol']['quanta']['serial']['bios_speed'] = '115200'
default['sol']['quanta']['serial']['speed'] = '115200'

# defaults

default['sol']['tty']['dir'] = File.join File::SEPARATOR, 'etc', 'init'
default['sol']['tty']['name'] = 'ttyS1'

default['sol']['serial']['bios_speed'] = '115200'
default['sol']['serial']['speed'] = '38400'
default['sol']['serial']['unit'] = '0'
default['sol']['serial']['word'] = '8'
default['sol']['serial']['parity'] = 'no'
default['sol']['serial']['stop'] = '1'

default['sol']['grub']['conf'] = File.join(
  File::SEPARATOR, 'etc', 'default', 'grub'
)
default['sol']['grub']['default'] = '0'
default['sol']['grub']['hidden_timeout'] = '0'
default['sol']['grub']['hidden_timeout_quiet'] = 'true'
default['sol']['grub']['timeout'] = '10'
default['sol']['grub']['cmdline_linux_default'] = 'quiet'
default['sol']['grub']['bootif'] = 'eth0'


text:
using System;
using Parquet.CLI.Models;

namespace Parquet.CLI.Views.Tablular
{
   internal class ConsoleOutputter : IConsoleOutputter
   {
      public ConsoleColor BackgroundColor { get; set; }

      public void ResetColor()
      {
         Console.ResetColor();
      }

      public void SetForegroundColor(ConsoleColor foreColor)
      {
         Console.ForegroundColor = foreColor;
      }

      public void Write(string s)
      {
         Console.Write(s);
      }
   }
}


text:
#pragma once
#include <aws/honeycode/Honeycode_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{

namespace Honeycode
{
namespace HoneycodeEndpoint
{
AWS_HONEYCODE_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace HoneycodeEndpoint
} // namespace Honeycode
} // namespace Aws


text:
<?php

namespace Backend\Controller\Plugin\Booking;

use Booking\Entity\Booking;
use Booking\Manager\BookingManager;
use Booking\Manager\ReservationManager;
use Square\Entity\Square;
use Square\Manager\SquareManager;
use User\Entity\User;
use User\Manager\UserManager;
use Zend\Db\Adapter\Driver\ConnectionInterface;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;

class Create extends AbstractPlugin
{

    protected $bookingManager;
    protected $reservationManager;
    protected $squareManager;
    protected $userManager;
    protected $connection;

    public function __construct(BookingManager $bookingManager, ReservationManager $reservationManager,
        SquareManager $squareManager, UserManager $userManager, ConnectionInterface $connection)
    {
        $this->bookingManager = $bookingManager;
        $this->reservationManager = $reservationManager;
        $this->squareManager = $squareManager;
        $this->userManager = $userManager;
        $this->connection = $connection;
    }

    public function __invoke($user, $timeStart, $timeEnd, $dateStart, $dateEnd, $repeat, $square, $statusBilling, $quantity, $notes = null, $creator = null)
    {
        $controller = $this->getController();

        if (! $this->connection->inTransaction()) {
            $this->connection->beginTransaction();
            $transaction = true;
        } else {
            $transaction = false;
        }

        try {

            /* Determine or create user */

            if (preg_match('/\(([0-9]+)\)/', $user, $matches)) {
                $user = $this->userManager->get($matches[1]);
            } else {
                $users = $this->userManager->getBy(['email' => $user]);

                if ($users) {
                    $user = current($users);
                } else {
                    $users = $this->userManager->getBy(['alias' => $user]);

                    if ($users) {
                        $user = current($users);
                    }
                }
            }

            if (! ($user instanceof User)) {
                $user = $this->userManager->create($user);
            }

            /* Determine square */

            if ($square instanceof Square) {
                $square = $this->squareManager->get($square->get('sid'));
            } else {
                $square = $this->squareManager->get($square);
            }

            /* Determine status */

            $repeat = intval($repeat);

            if ($repeat == 0) {
                $status = 'single';

                $controller->authorize('admin.booking, calendar.create-single-bookings');
            } else {
                $status = 'subscription';

                $controller->authorize('admin.booking, calendar.create-subscription-bookings');
            }

            /* Determine visibility */

            $visibility = 'public';

            /* Determine date */

            $dateStart = new \DateTime($dateStart);
            $dateEnd = new \DateTime($dateEnd);

            /* Determine booking meta */

            $bookingMeta = array();

            if ($status == 'subscription') {
                $bookingMeta['date_start'] = $dateStart->format('Y-m-d');
                $bookingMeta['date_end'] = $dateEnd->format('Y-m-d');
                $bookingMeta['time_start'] = $timeStart;
                $bookingMeta['time_end'] = $timeEnd;
                $bookingMeta['repeat'] = $repeat;
            }

            $bookingMeta['notes'] = $notes;
            $bookingMeta['creator'] = $creator;

            /* Create booking */

            $booking = new Booking(array(
                'uid' => $user->need('uid'),
                'sid' => $square->need('sid'),
                'status' => $status,
                'status_billing' => $statusBilling,
                'visibility' => $visibility,
                'quantity' => $quantity,
            ), $bookingMeta);

            $this->bookingManager->save($booking);

            /* Determine reservations */

            if ($status == 'single') {
                $reservations = $this->reservationManager->create($booking, $dateStart, $timeStart, $timeEnd);
            } else {
                $reservations = $this->reservationManager->createByRange($booking, $dateStart, $dateEnd, $timeStart, $timeEnd, $repeat);
            }

            $booking->setExtra('reservations', $reservations);

            if ($transaction) {
                $this->connection->commit();
                $transaction = false;
            }

            return $booking;

        } catch (\Exception $e) {
            if ($transaction) {
                $this->connection->rollback();
            }

            throw $e;
        }
    }

}


text:
import { Injectable }	from '@angular/core';

@Injectable()
export class DictionaryService {
   	getRegex() {
   	    return {
   	        "sentence": /[^\.\s].+?(?=\.\s|\.$)/g,
   	        "att": /(fire|wood|water|light|dark)/ig,
   	        "type": /(god|devil|dragon|balanced|attacker|physical|healer|machine|vendor|enhance|awoken)/ig,
   	        "att_type": /(god|devil|dragon|balanced|attacker|physical|healer|machine|vendor|enhance|awoken|fire|wood|water|light|dark|heal|heart)/ig,
   	        "startwith_att_type": /^(god|devil|dragon|balanced|attack|physical|healer|machine|vendor|evolve|enhance|awoken|fire|water|wood|light|dark)/i,
   	        "stat": /((HP|ATK|RCV)( x\d+)(\.\d)?)|(\d+%)/g
   	    }
   	}

   getDictionary() {
      return {
         "keys": {
            "scaling" : /connected|flex match|following orb types|additional orb type/ig,
            "standard" : /same time|when reaching/ig
         },
         "values" : {
             "scaling" : /connected orbs|flex match/i,
             "standard" : /color match|color cross|heart cross/i,
             "combo count" : /combo count/i,
             "special" : /special/i
             // "all" : /connected|flex match|following orb types|additional orb type|same time|when reaching|skill use|combo count|special|skill is used/i
         },

         "connected": "connected orbs",
         "skill is used": "skill use",
         "following orb types": "flex match",
         "additional orb type": "flex match",
         "same time": "color match",
         "when reaching": "color match"
      }
   }
}


text:
import os
import time
import threading
import re
import getopt
import subprocess
import sys

# Usage function
def usage():
        print """
                aggCountDisctinct.py -E <planner path> -B <Branch path> -T <time in seconds>

                -E              planner path
                -B              unit test overlog path
		-T              time (secs) for test to run
                -h              prints usage message
        """

# Function to parse the output file and check whether the output matches the expected value
def script_output(stdout):
	output = ""
	whole_output = ""
	for line in stdout.readlines():
		output = output + line
		whole_output = whole_output + line

	#print output
	p = re.compile(r"""
		([#][#]Print\[SendAction: \s* RULE \s* q1\]: \s* \[countResult\(localhost:10000, \s* 6\)\] \s*
		[#][#]Print\[SendAction: \s* RULE \s* q3\]: \s*  \[countDistinctRes\(localhost:10000, \s* 3\)\] \s*
		|
		[#][#]Print\[SendAction: \s* RULE \s* q3\]: \s*  \[countDistinctRes\(localhost:10000, \s* 3\)\] \s*
		[#][#]Print\[SendAction: \s* RULE \s* q1\]: \s* \[countResult\(localhost:10000, \s* 6\)\] \s*)
		""", re.VERBOSE)

	flag = p.search(output)
	if flag:
		print "Test passed"
	else:
		print "Test failed"
		print "Port 10000 output:"
		print whole_output

#Function to kill the child after a set time
def kill_pid(stdout, pid):
        #print "killing child"
        os.kill(pid, 3)
	#print "program killed"
	script_output(stdout)

try:
	opt, arg = getopt.getopt(sys.argv[1:], 'B:E:T:h')
except getopt.GetoptError:
        usage()
        sys.exit(2)

if len(opt) != 3:
        usage()
        sys.exit(1)

for key,val in opt:
        if key=='-B':
                olg_path = val
        elif key == '-E':
                executable_path = val
	elif key == '-T':
                time_interval = val
	elif key == '-h':
                usage()
                sys.exit(0)
try:
        args=[executable_path , '-o', os.path.join(olg_path, 'aggCountDistinct.olg'), '2>&1']
        p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
except OSError, e:
        #print "Execution failed"
        print e
        sys.exit(0)

#print p.pid

if os.getpid() != p.pid:
        t = threading.Timer(int(time_interval), kill_pid, [p.stdout, p.pid])
        t.start()


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">

  <!-- POM file generated with GWT webAppCreator -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.jcommerce</groupId>
  <artifactId>jcommerce-web</artifactId>
  <packaging>war</packaging>
  <version>1.0</version>
  <name>jcommerce web</name>

  <properties>
    <!-- Convenience property to set the GWT version -->
    <gwtVersion>2.0.0</gwtVersion>
    <!-- GWT needs at least java 1.6 -->
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
    <version.hibernate>4.2.0.Final</version.hibernate>
  </properties>

  <dependencies>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${version.hibernate}</version>
		</dependency>

	<dependency>
		<groupId>com.jcommerce</groupId>
		<artifactId>jcommerce-core</artifactId>
		<version>1.0</version>
	</dependency>
		<dependency>
		<groupId>com.jcommerce</groupId>
		<artifactId>jcommerce-model</artifactId>
		<version>1.0</version>
	</dependency>

	<dependency>
		<groupId>javax.mail</groupId>
		<artifactId>mail</artifactId>
		<version>1.4.5</version>
	</dependency>

	<!---->
	<dependency>
		<groupId>jasperreports</groupId>
		<artifactId>jasperreports</artifactId>
		<version>3.5.0</version>
		<exclusions>
           <exclusion>
             <artifactId>jdtcore</artifactId>
             <groupId>eclipse</groupId>
           </exclusion>
        </exclusions>
	</dependency>

	<dependency>
        <groupId>net.sf.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>1.7</version>
      </dependency>

	<dependency>
		<groupId>org.htmlparser</groupId>
		<artifactId>htmlparser</artifactId>
		<version>2.1</version>
	</dependency>

	<dependency>
		<groupId>org.datanucleus</groupId>
		<artifactId>datanucleus-core</artifactId>
		<version>3.2.3</version>
	</dependency>

	<dependency>
        <groupId>com.googlecode</groupId>
        <artifactId>google-api-translate-java</artifactId>
        <version>0.92</version>
	</dependency>

	<dependency>
		<groupId>opensymphony</groupId>
		<artifactId>xwork</artifactId>
		<version>2.0.0</version>
	</dependency>

  	<dependency>
		<groupId>org.apache.struts</groupId>
		<artifactId>struts2-core</artifactId>
		<version>2.1.2</version>
	</dependency>

    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <version>${gwtVersion}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwtVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
		<groupId>com.extjs</groupId>
		<artifactId>gxt</artifactId>
		<version>2.2.0</version>
	</dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>${gwtVersion}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>1.0.0.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>1.0.0.GA</version>
      <classifier>sources</classifier>
      <scope>provided</scope>
    </dependency>
    <dependency>
		<groupId>mysql</groupId>
		<artifactId>mysql-connector-java</artifactId>
		<version>5.1.20</version>
	</dependency>
  </dependencies>

	<build>
		<outputDirectory>target/www/WEB-INF/classes</outputDirectory>
		<finalName>${artifactId}</finalName>
		<plugins>

      <!-- GWT Maven Plugin-->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <!--  -->
	    <version>2.2.0</version>

	<dependencies>
          <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
          </dependency>
          <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwtVersion}</version>
          </dependency>
          <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwtVersion}</version>
          </dependency>
	</dependencies>
        <!-- JS is only needed in the package phase, this speeds up testing -->
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <!-- Plugin configuration. There are many available options,
             see gwt-maven-plugin documentation at codehaus.org -->
        <configuration>
          <!-- URL that should be automatically opened in the GWT shell (gwt:run). -->
          <runTarget>iShop.html</runTarget>
          <!-- Location of the develop-mode web application structure (gwt:run). -->
          <hostedWebapp>target/www</hostedWebapp>
          <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
          <compileReport>true</compileReport>
        </configuration>
      </plugin>

      <!-- Add source folders to test classpath in order to run gwt-tests as normal junit-tests -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
	<version>2.5</version>
        <configuration>
          <additionalClasspathElements>
            <additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
            <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
          </additionalClasspathElements>
          <useManifestOnlyJar>false</useManifestOnlyJar>
          <forkMode>always</forkMode>

          <!-- Folder for generated testing stuff -->
          <systemProperties>
            <property>
              <name>gwt.args</name>
              <value>-out target/www</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>

      <!-- Copy static web files before executing gwt:run -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.2</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>target/www</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/webapp</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Delete gwt generated stuff -->
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
	<version>2.3</version>
        <configuration>
          <filesets>
            <fileset><directory>src/main/webapp/ishop</directory></fileset>
            <fileset><directory>src/main/webapp/WEB-INF/classes</directory></fileset>
            <fileset><directory>tomcat</directory></fileset>
            <fileset><directory>www-test</directory></fileset>
            <fileset><directory>.gwt-tmp</directory></fileset>
          </filesets>
        </configuration>
      </plugin>

      <plugin>
	<artifactId>maven-eclipse-plugin</artifactId>
	<version>2.7</version>  <!--  Note 2.8 does not work with AspectJ aspect path -->
	<configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>false</downloadJavadocs>
          <wtpversion>2.0</wtpversion>
          <additionalBuildcommands>
            <buildCommand>
              <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
            </buildCommand>
          </additionalBuildcommands>
          <additionalProjectnatures>
            <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
          </additionalProjectnatures>
	</configuration>
      </plugin>

    </plugins>
	</build>
</project>


text:
MyCtrl

controller in module myapp

Description

This is MyCtrl description


text:
define([
	"omega/_Widget",
	"text!./templates/TabContainer.html",
	"omega/widgets/TabContainer"
], function(_Widget, template) {

	return _Widget.extend({

		templateString: template,

		startup: function() {

			this.inherited(_Widget, arguments);

			this._tabContainerNode.layoutChildren();

		}

	});

});


text:
var Handlebars = {};

if (typeof module !== 'undefined' && module.exports) {
  module.exports = Handlebars;
}

(function(Handlebars, undefined) {


text:
require 'spec_helper'

describe 'neutron::services::vpnaas' do

  let :default_params do
    { :package_ensure    => 'present',
      :service_providers => '<SERVICE DEFAULT>'}
  end

  shared_examples_for 'neutron vpnaas service plugin' do

    context 'with default params' do
      let :params do
        default_params
      end

      it 'installs vpnaas package' do
        is_expected.to contain_package('neutron-vpnaas-agent').with(
          :ensure => params[:package_ensure],
          :name   => platform_params[:vpnaas_package_name],
        )
      end
    end

    context 'with multiple service providers' do
      let :params do
        default_params.merge(
          { :service_providers => ['provider1', 'provider2'] }
        )
      end

      it 'configures neutron_vpnaas.conf' do
        is_expected.to contain_neutron_vpnaas_service_config(
          'service_providers/service_provider'
        ).with_value(['provider1', 'provider2'])
      end
    end

  end

  context 'on Debian platforms' do
    let :facts do
      @default_facts.merge({
        :osfamily => 'Debian',
        :os       => { :name  => 'Debian', :family => 'Debian', :release => { :major => '8', :minor => '0' } },
      })
    end

    let :platform_params do
      { :vpnaas_package_name => 'neutron-vpn-agent'}
    end

    it_configures 'neutron vpnaas service plugin'
  end

  context 'on Red Hat platforms' do
    let :facts do
      @default_facts.merge({
        :osfamily => 'RedHat',
        :operatingsystemrelease => '7',
        :os       => { :name  => 'CentOS', :family => 'RedHat', :release => { :major => '7', :minor => '0' } },
      })
    end

    let :platform_params do
      { :vpnaas_package_name => 'openstack-neutron-vpnaas'}
    end

    it_configures 'neutron vpnaas service plugin'
  end

end


text:
.example-listbox {
  display: flex;
  width: 250px;
  padding: 0;
}

.example-option {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  position: relative;
  list-style: none;
  padding: 12px;
  border: solid black;
  border-width: 1px 1px 1px 0;
}

.example-option:first-child {
  border-left-width: 1px;
}

.example-option[aria-selected='true']::before {
  content: '';
  position: absolute;
  border: 2px solid black;
  top: 3px;
  bottom: 3px;
  left: 3px;
  right: 3px;
}

.example-option:focus {
  background: rgba(0, 0, 0, 0.2);
}


text:
**_version 1.5.3_**

A HTML, CSS, and JavaScript framework for instructional designers at University of Wisconsin-Extension division of Continuing Education, Outreach & E-Learning (UW-EX CEOEL).

### How To Use
1. To start, download the [framework](https://github.com/uwex-learning-tech/droplets/archive/master.zip) (ZIP).
2. Unzip or extract the ZIP file when the download is completed.
3. Open the `dist` directory.
4. Upload all of the files and directories inside the `dist` directory to your LMS's file storage.
5. Include the `style.css` stylesheet from the `css` directory to the HTML head element. For example, `<link href="path_to_your_lms_file_directory/style.css" rel="stylesheet" />`.
6. If interested in using the JavaScript components, include the `style.js` javascript file from the `script` directory to the HTML head element. For example:
```
<script src="path_to_your_lms_file_directory/style.js" type="text/javascript"></script>
```
**Note:** This framework is specifically developed for designers use at UW-EX CEOEL. Some setups or usages may not be optimal or preferable for your organization. In addition, this framework is somewhat built to accommodate the LMS (Desire2Learn) that is being used at UW-EX CEOEL. However, you are most welcome to download or fork this repository and modified it to your organization's needs.

### Development Requirements
* HTML5
* Cascading Style Sheets (CSS3)
* SASS (http://sass-lang.com/)
* Compass (http://compass-style.org/)
* jQuery 3.x

Knowledges of SASS and Compass are essential to write the CSS for this framework. The CSS file is created/compiled and minified by SASS, a CSS preprocessor.

**Note:** [CodeKit](https://incident57.com/codekit/) is highly recommended for Mac users during the development process.

### Minimum Supported Web Browsers
* Internet Explorer 9+
* Mozilla Firefox 30+
* Google Chrome 33+
* Apple Safari 5+
* Opera 20+

*Latest stable version is always recommended.*

### Bug Reporting and Questions
If any bugs/glitches are found in this framework, please report them under the "**[Issues](https://github.com/uwex-learning-tech/droplets/issues)**" page on GitHub. When reporting a bug, please write the report as detailed and specifically as possible. Note the steps to reproduce the bug and include screen captures if possible.

For questions, please also post them under the "**[Issues](https://github.com/uwex-learning-tech/droplets/issues)**" page on GitHub.

---
#### Version Change Log

**1.5.3**
* Fixed an issue where img in figure tag is not respecting to img's width and height attributes.

**1.5.2**
* Lightbox enhancements: grid layout & support both img and figure (with figcaption as well)

**1.5.1**
* Two new icons: Email and Extra Credit
* Icons are now alphabetically ordered
* Fixed child iFrame element height when not nested inside a parent iFrame

**1.5.0**
* New Icon: Lab
* New Feature: Reveal
* New Feature: Lightbox (for image only)
* Updated Read More style
* Updated jQuery to version 3.2.1 slim build
* Minor fixes

**1.4.7**
* Added a new briefcase icon
* Fixed popover position issue

**1.4.6**
* Rework CSS for figure element.
* Figure element can now be floated.

**1.4.5**
* Updated a few font icons to improve legibility
* Adjusted a few font icons vertical alignments

**1.4.4**
* Fixed the issue where first icon size in a callout was larger than others.
* Icon font encoding in CSS is back.

**1.4.3**
* Added four new icons to the [icon set](https://media.uwex.edu/app/droplets/icons.html).

**1.4.2**
* Added three new icons to the [icon set](https://media.uwex.edu/app/droplets/icons.html): tech need, welcome, and competency.
* Enhanced the tab style for more visibility.
* Tab can now be colored. See doc for more info.

**1.4.1**
* Updated [Learning Resources Component](https://media.uwex.edu/app/droplets/learning_resources.html) to reflect feedback from Instructional Designers.

**1.4.0**
* New JavaScript component: [Learning Resources](https://media.uwex.edu/app/droplets/learning_resources.html)

**1.3.6**
* Improvements and minor fixes
* Added more contextual styles for tables: border with thickness and styles, cell text indentations, and neutral gray background color
* Added WAI-ARIA (accessibility) markups to elements
* Converted "Helpers" page to "Helpers & Accessibility", which now contains information on WAI-ARIA

**1.3.5**
* Fixed the issue where calendar tab was not working
* Added a short message about view agenda details in Display All view

**1.3.4**
* Removed unwanted css rules
* Resolved a tag name conflict with columns in tab

**1.3.3**
* Fixed an issue where popover is not aligned correctly

**1.3.2**
* Added left margin to right-floated block-level callout
* Table head are now properly aligned base on the specified class
* iFrame height is now properly set when expanding agenda detail on calendar

**1.3.1**
* Fixed page header line height
* Added more spacing after the page header
* Fixed accordion's auto-height calculation in an iFrame
* Fixed calendar not displaying/highlighting current day of the month
* Nested unordered list bullet is now a circle rather than a disc

**1.3.0**
* Added two new classes for table: `minimal-padding` and `small-text`
* `vert-top`, `vert-center`, `vert-bottom`, `horz-left`, `horz-center`, and `horz-right` classes can now be applied to the whole table rather than individual cells or `td` elements.
* Read More feature has a new look
* [Calendar](https://media.uwex.edu/app/droplets/calendar.html)
* Minor bug fixes

---
© 2013 - 2018. Ethan Lin, University of Wisconsin-Extension Division of Continuing Education, Outreach & E-Learning, and Board of Regents. All rights reserved.


text:
import roslib
roslib.load_manifest('goale')
import rospy
import tf

class DriveSquare:
  direction = 0

  def runFrame(self):
    if self.direction == 0:
      rospy.loginfo("straight")
      self.direction = 1
    elif self.direction == 1:
      rospy.loginfo("left")
      self.direction = 2
    elif self.direction == 2:
      rospy.loginfo("back")
      self.direction = 3
    else:
      rospy.loginfo("right")
      self.direction = 0

if __name__ == '__main__':
  rospy.init_node('Ai')

  ai = DriveSquare()

  r = rospy.Rate(0.5) # 0.5hz
  while not rospy.is_shutdown():
    ai.runFrame()
    r.sleep()


text:
<?php

namespace NetSuite\Classes;

class InventoryNumberSearch extends SearchRecord {
    /**
     * @var \NetSuite\Classes\InventoryNumberSearchBasic
     */
    public $basic;
    /**
     * @var \NetSuite\Classes\ItemSearchBasic
     */
    public $itemJoin;
    /**
     * @var \NetSuite\Classes\EmployeeSearchBasic
     */
    public $userJoin;
    /**
     * @var \NetSuite\Classes\CustomSearchJoin[]
     */
    public $customSearchJoin;
    static $paramtypesmap = array(
        "basic" => "InventoryNumberSearchBasic",
        "itemJoin" => "ItemSearchBasic",
        "userJoin" => "EmployeeSearchBasic",
        "customSearchJoin" => "CustomSearchJoin[]",
    );
}


text:
package html

import (
	"fmt"
	"html/template"
	"io"
	"os"
	"path"
	"path/filepath"

	"github.com/spf13/cobra"
)

type flags struct {
	OutputFile string
}

// MakeCommand returns a `diff` command.
func MakeCommand() *cobra.Command {
	flags := &flags{}
	cmd := &cobra.Command{
		Use:   "html [coverage...]",
		Short: "Emits an HTML file to browse coverage files.",
		Long: `Produces a self-contained HTML file that enables browsing the provided
coverage files by directory. The resulting file can be distributed alone to
produce the same rendering (but does currently require gstatic.com to be
accessible).

If multiple files are provided, they will all be
shown in the generated HTML file, with the columns in the same order the files
were listed. When there are multiples columns, each column will have an arrow
indicating the change from the column immediately to its right.`,
		Run: func(cmd *cobra.Command, args []string) {
			run(flags, cmd, args)
		},
	}
	cmd.Flags().StringVarP(&flags.OutputFile, "output", "o", "-", "output file")
	return cmd
}

type coverageFile struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

func run(flags *flags, cmd *cobra.Command, args []string) {
	if len(args) < 1 {
		fmt.Println("Expected at least one coverage file.")
		cmd.Usage()
		os.Exit(2)
	}

	var resourceDir string
	if exe, err := os.Executable(); err == nil {
		resourceDir = path.Join(path.Dir(exe), "cmd/html/static")
	} else {
		resourceDir = "gopherage/cmd/html/static"
	}
	if _, err := os.Stat(resourceDir); os.IsNotExist(err) {
		fmt.Fprintf(os.Stderr, "Resource directory %q does not exist. Are you trying to use go run? You must build this program.\n", resourceDir)
		os.Exit(1)
	}

	tpl, err := template.ParseFiles(filepath.Join(resourceDir, "browser.html"))
	if err != nil {
		fmt.Fprintf(os.Stderr, "Couldn't read the HTML template: %v.", err)
		os.Exit(1)
	}
	script, err := os.ReadFile(filepath.Join(resourceDir, "browser_bundle.es2015.js"))
	if err != nil {
		fmt.Fprintf(os.Stderr, "Couldn't read JavaScript: %v.", err)
		os.Exit(1)
	}

	// If we're under bazel, move into BUILD_WORKING_DIRECTORY so that manual
	// invocations of bazel run are less confusing.
	if wd, ok := os.LookupEnv("BUILD_WORKING_DIRECTORY"); ok {
		if err := os.Chdir(wd); err != nil {
			fmt.Fprintf(os.Stderr, "Couldn't chdir into expected working directory.")
			os.Exit(1)
		}
	}

	var coverageFiles []coverageFile
	for _, arg := range args {
		var content []byte
		var err error
		if arg == "-" {
			content, err = io.ReadAll(os.Stdin)
		} else {
			content, err = os.ReadFile(arg)
		}
		if err != nil {
			fmt.Fprintf(os.Stderr, "Couldn't read coverage file: %v.", err)
			os.Exit(1)
		}
		coverageFiles = append(coverageFiles, coverageFile{Path: arg, Content: string(content)})
	}

	outputPath := flags.OutputFile
	var output io.Writer
	if outputPath == "-" {
		output = os.Stdout
	} else {
		f, err := os.Create(outputPath)
		if err != nil {
			fmt.Fprintf(os.Stderr, "Couldn't open output file: %v.", err)
			os.Exit(1)
		}
		defer f.Close()
		output = f
	}

	err = tpl.Execute(output, struct {
		Script   template.JS
		Coverage []coverageFile
	}{template.JS(script), coverageFiles})
	if err != nil {
		fmt.Fprintf(os.Stderr, "Couldn't write output file: %v.", err)
	}
}


text:
UpdateStmt::UpdateStmt()
{
	m_type = STMTTYPE_UPDATE;
}

UpdateStmt::~UpdateStmt()
{

}

void UpdateStmt::verify()
{

}

void UpdateStmt::transform()
{

}

void UpdateStmt::createExecuter()
{

}

void UpdateStmt::createSql( StmtSinkGroup *pStmtSinkGroup, char *sql )
{

}


text:
import socket
import select
import threading
import client

class Server(object):
    def __init__(self, port, host='localhost'):
        self.port = port
        self.host = host
        self.running = True
        self.exit_request = False
        self.clients = []

        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.socket.setblocking(0)
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        self.socket.bind((self.host, self.port))

        self.thread = ServerThread(self)
        self.thread.start()

    def disconnect_all(self):
        for cli in self.clients:
            cli.disconnect()
            while cli.connected:
                pass

    def create_client(self, client_socket, address):
        return client.Client(client_socket, address, self)

    def close(self):
        self.exit_request = True
        while self.running:
            pass

class ServerThread(threading.Thread):
    def __init__(self, parent):
        super(ServerThread, self).__init__()
        self.parent = parent

    def run(self):
        self.parent.socket.listen(1)
        while not self.parent.exit_request:
            ready_to_read, ready_to_write, in_error = select.select(
                [self.parent.socket], [], [], 2
            )
            if self.parent.socket not in ready_to_read:
                continue

            client_socket, address = self.parent.socket.accept()
            self.parent.clients.append(self.parent.create_client(client_socket, address))

        self.parent.socket.close()
        self.parent.disconnect_all()
        self.parent.running = False


text:
import click
from ghutil.showing import print_json
from ghutil.types import Gist

@click.command()
@click.option("-v", "--verbose", is_flag=True, help="Show full response body")
@Gist.argument_list("gists")
def cli(gists, verbose):
    """Show gist details"""
    print_json(gists, verbose)


text:
package uk.co.datumedge.docscraper;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;

import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.usermodel.TableIterator;

import com.google.common.base.Function;
import com.google.common.collect.Iterables;

public class DocumentScraper {
	public static Iterable<Table> extractTablesFrom(InputStream inputStream) throws IOException {
		HWPFDocument document = new HWPFDocument(inputStream);
		Collection<org.apache.poi.hwpf.usermodel.Table> tables = getTablesFrom(document);

		// can't use diamond operator on anonymous classes?  aww.
		return Iterables.transform(tables, new Function<org.apache.poi.hwpf.usermodel.Table, Table>() {
			@Override
			public Table apply(org.apache.poi.hwpf.usermodel.Table table) {
				return new Table(table);
			}
		});
	}

	private static Collection<org.apache.poi.hwpf.usermodel.Table> getTablesFrom(
			HWPFDocument document) {
		TableIterator tableIterator = new TableIterator(document.getRange());
		Collection<org.apache.poi.hwpf.usermodel.Table> tables = new ArrayList<>();

		while (tableIterator.hasNext()) {
			tables.add(tableIterator.next());
		}

		return tables;
	}
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Empleado_model extends CI_Model {
    function __construct(){
        parent::__construct();
    }

    function get_departamento(){
        $this->db->select('id');
        $this->db->select('nombre');
        $this->db->from('departamento');
        $query = $this->db->get();
        $result = $query->result();

        $id = array('-SELECT-');
        $nombre = array('-SELECT-');

        for($i = 0; $i < count($result); $i++){
            array_push($id, $result[$i]->id);
            array_push($nombre, $result[$i]->nombre);
        }
        return $resultado_departamento = array_combine($id, $nombre);
    }

    function get_puesto(){
        $this->db->select('id');
        $this->db->select('nombre');
        $this->db->from('puesto');
        $query = $this->db->get();
        $result = $query->result();

        $id = array('-SELECT-');
        $nombre = array('-SELECT-');

        for($i = 0; $i < count($result); $i++){
            array_push($id, $result[$i]->id);
            array_push($nombre, $result[$i]->nombre);
        }
        return $resultado_puesto = array_combine($id, $nombre);
    }

    //fetch employee record by employee no
    function get_empleado($numero)
    {
        $this->db->where('numero', $numero);
        $this->db->from('empleado');
        $query = $this->db->get();
        return $query->result();
    }

    //fetch all employee records
    function get_empleados($limit, $start)
    {
        $this->db->select('empleado.*, departamento.nombre as dpto_nombre, puesto.nombre as pto_nombre');
        $this->db->from('empleado');
        $this->db->join('departamento', 'empleado.departamento_id = departamento.id');
        $this->db->join('puesto', 'empleado.puesto_id = puesto.id');
        $this->db->order_by('numero', 'asc');
        $this->db->limit($limit, $start);
        $query = $this->db->get();
        return $query->result();
    }

    function get_kardex($numero){
        $this->db->select('curso.nombre as cur_nombre, fecha_inicial, fecha_final, institucion.nombre as ins_nombre');
        $this->db->from('empleado');
        $this->db->join('edicion_curso_empleado', 'empleado.numero = edicion_curso_empleado.empleado_numero');
        $this->db->join('edicion_curso', 'edicion_curso.id = edicion_curso_empleado.edicion_curso_id');
        $this->db->join('curso', 'edicion_curso.curso_id = curso.id');
        $this->db->join('institucion', 'edicion_curso.institucion_id = institucion.id');
        $this->db->where('empleado.numero', $numero);
        $this->db->order_by('fecha_inicial', 'asc');
        $query = $this->db->get();
        return $query->result();
    }

    function delete($numero)
    {
        //delete employee record
        $this->db->where('numero', $numero);
        $this->db->delete('empleado');
        redirect('empleado');
    }

    function exists($numero)
    {
        $this->db->where('numero',$numero);
        $query = $this->db->get('empleado');
        if ($query->num_rows() > 0){
            return true;
        }
        else{
            return false;
        }
    }

}


text:
<?php

namespace Sylius\Component\Core\Factory;

use Sylius\Component\Core\Promotion\Action\FixedDiscountAction;
use Sylius\Component\Core\Promotion\Action\UnitFixedDiscountAction;
use Sylius\Component\Core\Promotion\Action\UnitPercentageDiscountAction;
use Sylius\Component\Core\Promotion\Action\PercentageDiscountAction;
use Sylius\Component\Core\Promotion\Action\ShippingDiscountAction;
use Sylius\Component\Promotion\Model\ActionInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;

/**
 * @author Mateusz Zalewski <mateusz.zalewski@lakion.com>
 */
class ActionFactory implements ActionFactoryInterface
{
    /**
     * @var FactoryInterface
     */
    private $decoratedFactory;

    /**
     * @param FactoryInterface $decoratedFactory
     */
    public function __construct(FactoryInterface $decoratedFactory)
    {
        $this->decoratedFactory = $decoratedFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function createNew()
    {
        return $this->decoratedFactory->createNew();
    }

    /**
     * {@inheritdoc}
     */
    public function createFixedDiscount($amount)
    {
        return $this->createAction(FixedDiscountAction::TYPE, ['amount' => $amount]);
    }

    /**
     * {@inheritdoc}
     */
    public function createUnitFixedDiscount($amount)
    {
        return $this->createAction(UnitFixedDiscountAction::TYPE, ['amount' => $amount]);
    }

    /**
     * {@inheritdoc}
     */
    public function createPercentageDiscount($percentage)
    {
        return $this->createAction(PercentageDiscountAction::TYPE, ['percentage' => $percentage]);
    }

    /**
     * {@inheritdoc}
     */
    public function createUnitPercentageDiscount($percentage)
    {
        return $this->createAction(UnitPercentageDiscountAction::TYPE, ['percentage' => $percentage]);
    }

    /**
     * {@inheritdoc}
     */
    public function createPercentageShippingDiscount($percentage)
    {
        return $this->createAction(ShippingDiscountAction::TYPE, ['percentage' => $percentage]);
    }

    /**
     * @param string $type
     * @param array $configuration
     *
     * @return ActionInterface
     */
    private function createAction($type, array $configuration)
    {
        $action = $this->createNew();
        $action->setType($type);
        $action->setConfiguration($configuration);

        return $action;
    }
}


text:
require 'helper'

class TestIniProvider < Test::Unit::TestCase

  context 'A configuration provider for INI files' do

    should 'return correct values' do
      ini = File.join(File.dirname(__FILE__), 'config', 'test.ini')
      expected = {
        'section' => {
          'value' => '1',
          'test1' => '1',
          'test2' => '2'
        }
      }
      assert_equal expected, Rubikon::Config::IniProvider.load_config(ini)
    end

  end

end


text:
<!DOCTYPE html>

    <title>WebStorage Test: window_sessionStorage_iframe_item</title>
    <link rel="author" title="Intel" href="http://www.intel.com" >
    <link rel="help" href="http://www.w3.org/TR/2011/CR-webstorage-20111208/#dom-sessionStorage" >
    <meta name="flags" content="" />
    <meta name="assert" content="Check if sessionStorage access to the API for pages from other domains running in iframes" />

      Directions: If the page shows "Pass" the test case pass, otherwise it fail.


text:
package com.github.poeatlas.cli.dat.util;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EmbeddedId;
import javax.persistence.Id;

/**
 * Created by blei on 7/19/17.
 */
public final class DatUtils {

  private DatUtils() {
    // do not create
  }

  /**
   * get fields in dat file
   * @param clazz class of dat file (e.g. AtlasNode.dat is AtlasNode class)
   * @return list of fileds
   */
  public static List<Field> getFields(final Class<?> clazz) {
    final List<Field> fields = new ArrayList<>();

    for (final Field field : clazz.getDeclaredFields()) {
      final boolean isStatic = Modifier.isStatic(field.getModifiers());
      final boolean isId = field.getAnnotation(Id.class) != null
                           || field.getAnnotation(EmbeddedId.class) != null;

      if (!isStatic && !isId) {
        fields.add(field);
      }
    }

    return fields;
  }

  /** Gets the table id field. */
  public static Field getId(final Class<?> clazz) {
    for (final Field field : clazz.getDeclaredFields()) {
      // if it has the Id class, it's the one
      if (field.getAnnotation(Id.class) != null) {
        return field;
      }
    }
    // throw new RuntimeException("No Id annotation found in class.");
    return null;
  }
}


text:
define(
   ({
    instruction: "Content maken die wordt weergegeven in deze widget.",
    defaultContent: "Voeg hier tekst, koppelingen en kleine afbeeldingen toe."
  })
);


text:
/*-------JSHint Directives-------*/
/* global THREE                  */
/* global THREEx                 */
/* global $:false                */
/*-------------------------------*/
'use strict';

/***************************************************************
* Global Variables and Settings
***************************************************************/
var containerID = '#canvas-body';
var scene, camera, renderer;
var keyboard = new THREEx.KeyboardState();
var clock = new THREE.Clock();
var fov = 45;
var zoomX = 0;
var zoomY = 20;
var zoomZ = 40;

// Example figure
var movingFigure;
var pixelsPerSec = 30;
var rotationSteed = 1.2;

/***************************************************************
* Custom User Functions
***************************************************************/
function basicFloorGrid(lines, steps, gridColor) {
  lines = lines || 40;
  steps = steps || 2;
  gridColor = gridColor || 0xFFFFFF;
  var floorGrid = new THREE.Geometry();

  var gridLine = new THREE.LineBasicMaterial( {color: gridColor} );

  for (var i = -lines; i <= lines; i += steps) {
    floorGrid.vertices.push(new THREE.Vector3(-lines, 0, i));
    floorGrid.vertices.push(new THREE.Vector3( lines, 0, i));
    floorGrid.vertices.push(new THREE.Vector3( i, 0, -lines));
    floorGrid.vertices.push(new THREE.Vector3( i, 0, lines));
  }
  return new THREE.Line(floorGrid, gridLine, THREE.LinePieces);
}

function simpleBox(figureSize, figureColor) {
  figureSize  = figureSize  || 4;
  figureColor = figureColor || 0xDADADA;
  var figureGeometry = new THREE.BoxGeometry(figureSize, figureSize, figureSize);
  var figureMaterial = new THREE.MeshLambertMaterial({color: 0xcccccc});
  var boxFigure = new THREE.Mesh(figureGeometry, figureMaterial);
  boxFigure.position.set(0, figureSize/2, 0);
  return boxFigure;
}

function updateMovingFigure() {
  var delta = clock.getDelta();
  var moveDistance = pixelsPerSec * delta;
  var rotationAngle = 0.5*Math.PI / rotationSteed * delta;

  // Basic rotation
  if (keyboard.pressed('w') || keyboard.pressed('up') ) {
    movingFigure.translateZ(-moveDistance);
  }
  if (keyboard.pressed('s') || keyboard.pressed('down') ) {
    movingFigure.translateZ(moveDistance);
  }
  if (keyboard.pressed('a') || keyboard.pressed('left') ) {
    movingFigure.rotation.y += rotationAngle;
  }
  if (keyboard.pressed('d') || keyboard.pressed('right') ) {
    movingFigure.rotation.y -= rotationAngle;
  }

  // Adjust chase camera
  var relativeCameraOffset = new THREE.Vector3(zoomX, zoomY, zoomZ);
  var cameraOffset = relativeCameraOffset.applyMatrix4( movingFigure.matrixWorld );
  camera.position.x = cameraOffset.x;
  camera.position.y = cameraOffset.y;
  camera.position.z = cameraOffset.z;
  camera.lookAt( movingFigure.position );
}

/***************************************************************
* Helper Functions Declarations
***************************************************************/
function renderScene() {
  renderer.render( scene, camera );
}

function animateScene() {
  window.requestAnimationFrame( animateScene );
  renderScene();
  updateMovingFigure();
}

function resizeWindow() {
  camera.aspect = window.innerWidth / window.innerHeight;
  camera.updateProjectionMatrix();
  renderer.setSize( window.innerWidth, window.innerHeight );
  renderScene();
}

/***************************************************************
* Scene Initialization
***************************************************************/
function initializeScene() {

  // Scene and resize listener
  scene = new THREE.Scene();
  var canvasWidth  = window.innerWidth;
  var canvasHeight = window.innerHeight;
  window.addEventListener( 'resize', resizeWindow, false );

  // Camera and initial view
  var aspectRatio  = canvasWidth/canvasHeight;
  camera = new THREE.PerspectiveCamera(fov, aspectRatio, 0.01, 3000);
  camera.position.set(zoomX, zoomY, zoomZ);
  camera.lookAt(scene.position);
  scene.add(camera);

  // WebGL renderer
  renderer = new THREE.WebGLRenderer();
  renderer.setSize(canvasWidth, canvasHeight);
  $(containerID).append(renderer.domElement);

  // Ambient light
  var lightAmbient = new THREE.AmbientLight(0x5a5a5a);
  var lightSource = new THREE.PointLight(0x7a7a7a);
  lightSource.position.set(0, 50, -100);
  scene.add(lightAmbient);
  scene.add(lightSource);

  // Starter floor grid
  var floor = basicFloorGrid(60, 4);
  scene.add(floor);

  // Add Movable Cube
  movingFigure = simpleBox();
  scene.add(movingFigure);

}

/***************************************************************
* Render and Animate
***************************************************************/
initializeScene();
animateScene();


text:
layout: post
date: 2017-07-05
title: "Pearl by Alexia Designs Style 1054"
category: Pearl by Alexia Designs
tags: [Pearl by Alexia Designs]
---
### Pearl by Alexia Designs Style 1054
Just **$359.99**
###

BRANDS	Pearl by Alexia Designs

Buy it: [https://www.readybrides.com/en/pearl-by-alexia-designs/46841-pearl-by-alexia-designs-style-1054.html](https://www.readybrides.com/en/pearl-by-alexia-designs/46841-pearl-by-alexia-designs-style-1054.html)


text:
{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia filermedia %}

{% block extrahead %}{{ block.super }}
{% endblock %}

{% block breadcrumbs %}
{% with original as instance %}
{% include "admin/filer/breadcrumbs.html" %}
{% endwith %}
{% endblock %}

{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% filer_staticmedia_prefix %}css/admin_style.css" />
{% endblock %}

{% block coltype %}colMS{% endblock %}

{% block after_field_sets %}
    {% if is_popup and select_folder %}<input type="hidden" name="select_folder" value="1" />{% endif %}
{% endblock %}

{% block sidebar %}

	{% block file_sidebar %}
		{% with original.duplicates as duplicates %}
			{% if duplicates %}

{% trans 'duplicates' %}

					{% for duplicate in duplicates %}
{{ duplicate }}
{% endfor %}

			{% endif %}
		{% endwith %}
	{% endblock %}

{% endblock %}

{% block content %}

  	{{ block.super }}

{% endblock %}


text:
template <class AtomicType>
static void TestAtomicIncrement() {
  // For now, we just test single threaded execution

  // use a guard value to make sure the NoBarrier_AtomicIncrement doesn't go
  // outside the expected address bounds.  This is in particular to
  // test that some future change to the asm code doesn't cause the
  // 32-bit NoBarrier_AtomicIncrement doesn't do the wrong thing on 64-bit
  // machines.
  struct {
    AtomicType prev_word;
    AtomicType count;
    AtomicType next_word;
  } s;

  AtomicType prev_word_value, next_word_value;
  memset(&prev_word_value, 0xFF, sizeof(AtomicType));
  memset(&next_word_value, 0xEE, sizeof(AtomicType));

  s.prev_word = prev_word_value;
  s.count = 0;
  s.next_word = next_word_value;

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 1), 1);
  EXPECT_EQ(s.count, 1);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 2), 3);
  EXPECT_EQ(s.count, 3);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 3), 6);
  EXPECT_EQ(s.count, 6);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -3), 3);
  EXPECT_EQ(s.count, 3);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -2), 1);
  EXPECT_EQ(s.count, 1);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -1), 0);
  EXPECT_EQ(s.count, 0);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -1), -1);
  EXPECT_EQ(s.count, -1);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -4), -5);
  EXPECT_EQ(s.count, -5);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);

  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 5), 0);
  EXPECT_EQ(s.count, 0);
  EXPECT_EQ(s.prev_word, prev_word_value);
  EXPECT_EQ(s.next_word, next_word_value);
}

#define NUM_BITS(T) (sizeof(T) * 8)

template <class AtomicType>
static void TestCompareAndSwap() {
  AtomicType value = 0;
  AtomicType prev = base::subtle::NoBarrier_CompareAndSwap(&value, 0, 1);
  EXPECT_EQ(1, value);
  EXPECT_EQ(0, prev);

  // Use test value that has non-zero bits in both halves, more for testing
  // 64-bit implementation on 32-bit platforms.
  const AtomicType k_test_val = (GG_ULONGLONG(1) <<
                                 (NUM_BITS(AtomicType) - 2)) + 11;
  value = k_test_val;
  prev = base::subtle::NoBarrier_CompareAndSwap(&value, 0, 5);
  EXPECT_EQ(k_test_val, value);
  EXPECT_EQ(k_test_val, prev);

  value = k_test_val;
  prev = base::subtle::NoBarrier_CompareAndSwap(&value, k_test_val, 5);
  EXPECT_EQ(5, value);
  EXPECT_EQ(k_test_val, prev);
}

template <class AtomicType>
static void TestAtomicExchange() {
  AtomicType value = 0;
  AtomicType new_value = base::subtle::NoBarrier_AtomicExchange(&value, 1);
  EXPECT_EQ(1, value);
  EXPECT_EQ(0, new_value);

  // Use test value that has non-zero bits in both halves, more for testing
  // 64-bit implementation on 32-bit platforms.
  const AtomicType k_test_val = (GG_ULONGLONG(1) <<
                                 (NUM_BITS(AtomicType) - 2)) + 11;
  value = k_test_val;
  new_value = base::subtle::NoBarrier_AtomicExchange(&value, k_test_val);
  EXPECT_EQ(k_test_val, value);
  EXPECT_EQ(k_test_val, new_value);

  value = k_test_val;
  new_value = base::subtle::NoBarrier_AtomicExchange(&value, 5);
  EXPECT_EQ(5, value);
  EXPECT_EQ(k_test_val, new_value);
}

template <class AtomicType>
static void TestAtomicIncrementBounds() {
  // Test at rollover boundary between int_max and int_min
  AtomicType test_val = (GG_ULONGLONG(1) <<
                         (NUM_BITS(AtomicType) - 1));
  AtomicType value = -1 ^ test_val;
  AtomicType new_value = base::subtle::NoBarrier_AtomicIncrement(&value, 1);
  EXPECT_EQ(test_val, value);
  EXPECT_EQ(value, new_value);

  base::subtle::NoBarrier_AtomicIncrement(&value, -1);
  EXPECT_EQ(-1 ^ test_val, value);

  // Test at 32-bit boundary for 64-bit atomic type.
  test_val = GG_ULONGLONG(1) << (NUM_BITS(AtomicType) / 2);
  value = test_val - 1;
  new_value = base::subtle::NoBarrier_AtomicIncrement(&value, 1);
  EXPECT_EQ(test_val, value);
  EXPECT_EQ(value, new_value);

  base::subtle::NoBarrier_AtomicIncrement(&value, -1);
  EXPECT_EQ(test_val - 1, value);
}

// Return an AtomicType with the value 0xa5a5a5..
template <class AtomicType>
static AtomicType TestFillValue() {
  AtomicType val = 0;
  memset(&val, 0xa5, sizeof(AtomicType));
  return val;
}

// This is a simple sanity check that values are correct. Not testing
// atomicity
template <class AtomicType>
static void TestStore() {
  const AtomicType kVal1 = TestFillValue<AtomicType>();
  const AtomicType kVal2 = static_cast<AtomicType>(-1);

  AtomicType value;

  base::subtle::NoBarrier_Store(&value, kVal1);
  EXPECT_EQ(kVal1, value);
  base::subtle::NoBarrier_Store(&value, kVal2);
  EXPECT_EQ(kVal2, value);

  base::subtle::Acquire_Store(&value, kVal1);
  EXPECT_EQ(kVal1, value);
  base::subtle::Acquire_Store(&value, kVal2);
  EXPECT_EQ(kVal2, value);

  base::subtle::Release_Store(&value, kVal1);
  EXPECT_EQ(kVal1, value);
  base::subtle::Release_Store(&value, kVal2);
  EXPECT_EQ(kVal2, value);
}

// This is a simple sanity check that values are correct. Not testing
// atomicity
template <class AtomicType>
static void TestLoad() {
  const AtomicType kVal1 = TestFillValue<AtomicType>();
  const AtomicType kVal2 = static_cast<AtomicType>(-1);

  AtomicType value;

  value = kVal1;
  EXPECT_EQ(kVal1, base::subtle::NoBarrier_Load(&value));
  value = kVal2;
  EXPECT_EQ(kVal2, base::subtle::NoBarrier_Load(&value));

  value = kVal1;
  EXPECT_EQ(kVal1, base::subtle::Acquire_Load(&value));
  value = kVal2;
  EXPECT_EQ(kVal2, base::subtle::Acquire_Load(&value));

  value = kVal1;
  EXPECT_EQ(kVal1, base::subtle::Release_Load(&value));
  value = kVal2;
  EXPECT_EQ(kVal2, base::subtle::Release_Load(&value));
}

TEST(AtomicOpsTest, Inc) {
  TestAtomicIncrement<base::subtle::Atomic32>();
  TestAtomicIncrement<base::subtle::AtomicWord>();
}

TEST(AtomicOpsTest, CompareAndSwap) {
  TestCompareAndSwap<base::subtle::Atomic32>();
  TestCompareAndSwap<base::subtle::AtomicWord>();
}

TEST(AtomicOpsTest, Exchange) {
  TestAtomicExchange<base::subtle::Atomic32>();
  TestAtomicExchange<base::subtle::AtomicWord>();
}

TEST(AtomicOpsTest, IncrementBounds) {
  TestAtomicIncrementBounds<base::subtle::Atomic32>();
  TestAtomicIncrementBounds<base::subtle::AtomicWord>();
}

TEST(AtomicOpsTest, Store) {
  TestStore<base::subtle::Atomic32>();
  TestStore<base::subtle::AtomicWord>();
}

TEST(AtomicOpsTest, Load) {
  TestLoad<base::subtle::Atomic32>();
  TestLoad<base::subtle::AtomicWord>();
}


text:
/*
 * Created on 2004/11/24
 * Author aki@www.xucker.jpn.org
 * License Apache2.0 or Common Public License
 */
package com.akjava.wiki.client.keyword;

/**
 *
 *
 */
public class Keyword implements Comparable{
private String keyword;
private String url;
private String icon;
public String getIcon() {
	return icon;
}
public void setIcon(String icon) {
	this.icon = icon;
}
/**
 * @param string
 * @param string2
 */
public Keyword(String keyword, String url) {
    this.keyword=keyword;
    this.url=url;
}
public String getKeyword() {
    return keyword;
}
public void setKeyword(String keyword) {
    this.keyword = keyword;
}
public String getUrl() {
    return url;
}
public void setUrl(String url) {
    this.url = url;
}

public int compareTo(Object o) {
    if(o instanceof Keyword){
        return ((Keyword)o).getKeyword().compareTo(this.getKeyword());
    }
    return 0;
}

public boolean equals(Object o) {
	if(o instanceof Keyword){
		return this.toString().equals(o.toString());
	}
   return false;
  }

public boolean isRelative(){
	return url.startsWith("/");
}

public String toString() {
    return keyword+","+url;
  }
}


text:
layout: recrut
permalink: /recrut/assistante.html
title: Assistante administrative
slug: Assistante administrative
upload: true
---

Missions

Missions classiques de secrétariat (standard, courriers, préparation de réunions…).

Relance auprès des interlocuteurs dans le suivi de l'activité.

La gestion des rdv/ planning des managers.

Aider dans la gestion RH, exemple : Prise de contact avec les candidats potentiels.Vous serez amené(e) à travailler en collaboration avec les différentes structures de l'entreprise (juridique, architecture, marketing, technique, commercial...).

Profil recherché

Une excellente communication.

Expérience minimum de 5 ans.

Expérience dans un poste similaire dans une multinationale.
                    Sens des responsabilités.

Aptitude à apprendre.

Travail en équipe, adaptation.

Organisée.

Bonne maîtrise des outils informatiques.

Polyvalence.

Réflexion.

Avantages du poste

Cadre de travail agréable.

Salaire attractif.

Possibilité d'évolution rapide.

Candidature pour le poste de {{page.title}}

          <form class="col s12 m12" action="https://formspree.io/recrut@bessapromotion.com"
        method="POST">

                account_circle
                Prenom
                <input  id="first_name" type="text" class="validate" name="Prenom" required>

                account_circle
                <input id="last_name" type="text" class="validate active" name="Nom" required>
                Nom

                email
                <input id="email" type="email" class="validate" name="Email" required>
                Email

            <input type="hidden" name="_subject" value="Nouvelle candidature reçue pour le poste de {{page.title}}" />
            <input type="hidden" name="_language" value="fr" />

               <input type="hidden" role="uploadcare-uploader" name="my_file" required />

         <button class="btn waves-effect waves-light m-top" type="submit">Je depose
         send
        </button>
          </form>


text:
class EnquiriesController < ApplicationController
  def create
    @enquiry = Enquiry.new(enquiry_params)

    if @enquiry.save
      render nothing: true
      Notifier.contact_us(@enquiry).deliver_now
    else
      render json: @enquiry.errors, status: 400
    end
  end

  private

  def enquiry_params
    params.require(:enquiry).permit(:message, :name, :email, :company)
  end
end


text:
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.ObjectResolution;
using Umbraco.Web;

namespace Umbraco.Tests.TestHelpers
{
    /// <summary>
    /// A base test class used for umbraco tests whcih sets up the logging, plugin manager any base resolvers, etc... and
    /// ensures everything is torn down properly.
    /// </summary>
    [TestFixture]
    public abstract class BaseUmbracoApplicationTest
    {
        [SetUp]
        public virtual void Initialize()
        {
            TestHelper.SetupLog4NetForTests();
            TestHelper.InitializeContentDirectories();

            SettingsForTests.UseLegacyXmlSchema = false;
            SettingsForTests.ForceSafeAliases = true;
            SettingsForTests.UmbracoLibraryCacheDuration = 1800;

            SetupPluginManager();

            SetupApplicationContext();

            FreezeResolution();
        }

        [TearDown]
        public virtual void TearDown()
        {
            //reset settings
            SettingsForTests.Reset();
            UmbracoContext.Current = null;
            TestHelper.CleanContentDirectories();
            //reset the app context, this should reset most things that require resetting like ALL resolvers
            ApplicationContext.Current.DisposeIfDisposable();
            ApplicationContext.Current = null;
            ResetPluginManager();
        }

        /// <summary>
        /// By default this returns false which means the plugin manager will not be reset so it doesn't need to re-scan
        /// all of the assemblies. Inheritors can override this if plugin manager resetting is required, generally needs
        /// to be set to true if the  SetupPluginManager has been overridden.
        /// </summary>
        protected virtual bool PluginManagerResetRequired
        {
            get { return false; }
        }

        /// <summary>
        /// Inheritors can resset the plugin manager if they choose to on teardown
        /// </summary>
        protected virtual void ResetPluginManager()
        {
            if (PluginManagerResetRequired)
            {
                PluginManager.Current = null;
            }
        }

        /// <summary>
        /// Inheritors can override this if they wish to create a custom application context
        /// </summary>
        protected virtual void SetupApplicationContext()
        {
            //DO NOT ENABLE CACHE
            ApplicationContext.Current = new ApplicationContext(false) {IsReady = true};
        }

        /// <summary>
        /// Inheritors can override this if they wish to setup the plugin manager differenty (i.e. specify certain assemblies to load)
        /// </summary>
        protected virtual void SetupPluginManager()
        {
            if (PluginManager.Current == null || PluginManagerResetRequired)
            {
                PluginManager.Current = new PluginManager(false);
            }
        }

        /// <summary>
        /// Inheritors can override this to setup any resolvers before resolution is frozen
        /// </summary>
        protected virtual void FreezeResolution()
        {
            Resolution.Freeze();
        }

        protected ApplicationContext ApplicationContext
        {
            get { return ApplicationContext.Current; }
        }
    }
}


text:
import os
import re
import json
try:
    from common import pluginRootPath
except:
    from .common import pluginRootPath

class Symbol(object):
    def __init__(self, name = "", type = "", path = "", pos = (0,0)):
        self.name = name
        self.type = type;
        self.path = path
        self.pos = pos

    @staticmethod
    def json2Symbol(d):
        return Symbol(d['name'], d['type'], d['path'], d['pos'])

# builtin_shader root path
root = ""
def generateSymbolList(beginPath):
    global root
    root = beginPath
    symbolList = []
    generateFunctionList(symbolList)
    generateDefineList(symbolList)
    generateVariableList(symbolList)

    f = open(os.path.join(pluginRootPath, 'builtin_shader.symbol'), 'w')
    json.dump(symbolList, f, default=lambda obj: obj.__dict__, indent = 4)
    f.close()

def generateFunctionList(symbolList):
    print(root)
    for path, folders, files in os.walk(root):
        for filename in files:
            f = open(os.path.join(root, filename))
            buf = f.read()
            f.close()

            functionIter = re.finditer(r"^(inline[ \t]+)?[ \t]*[\w]+[ \t]+(\w+)[ \t]*\((([ \t]*(\w+[ \t]+)?\w+[ \t]+\w)|([ \t]*\n)|([ \t]*\)))",
                buf, re.M)
            for i in functionIter:
                # todo, path截短
                name = i.group(2)
                path = os.path.join(root, filename)
                path = path.replace(pluginRootPath+"\\", "")
                lineNo = len(re.findall(r".*\n", buf[0:i.start()])) + 1
                columnNo = re.search(i.group(2), i.group(0)).start()
                pos = (lineNo, columnNo)
                symbolList.append(Symbol(name, "builtin-function", path, pos))

def generateDefineList(symbolList):
    for path, folders, files in os.walk(root):
        for filename in files:

            if filename == "HLSLSupport.cginc":
                continue

            f = open(os.path.join(root, filename))
            buf = f.read()
            f.close()

            functionIter = re.finditer(r"^[\s]*#define[\s]+(\w+)\b(?!\s*\n)", buf, re.M)
            for i in functionIter:
                name = i.group(1)
                path = os.path.join(root, filename)
                path = path.replace(pluginRootPath+"\\", "")
                lineNo = len(re.findall(r".*\n", buf[0:i.start()])) + 1
                columnNo = re.search(i.group(1), i.group(0)).start()
                pos = (lineNo, columnNo)
                symbolList.append(Symbol(name, "builtin-marco", path, pos))

def generateVariableList(symbolList):
    for path, folders, files in os.walk(root):
        for filename in files:

            if not filename in ["UnityShaderVariables.cginc", "UnityLightingCommon.cginc", "Lighting.cginc", "AutoLight.cginc"]:
                continue

            f = open(os.path.join(root, filename))
            buf = f.read()
            f.close()

            variablePattern = r"(uniform[\s]*)?(((float|half|fixed)([2-4](x[2-4])?)?)|sampler(CUBE|[23]D))[\s]*([\w]*)(\[\d*\])?\s*;"
            # sometimes, define statement can break above rule
            variablePattern2 = r"(uniform[\s]*)(\w+)[\s]*([\w]*)(\[\d*\])?\s*;"

            lineMatchIter = re.finditer(".*\n", buf)
            for index, line in enumerate(lineMatchIter):
                lineBuf = line.group()
                if re.search("\(", lineBuf):
                    match = re.search("\(", lineBuf)
                    _skipToBracketEnd(lineMatchIter, lineBuf[match.end():], "\)")
                elif re.search("{", lineBuf):
                    match = re.search("{", lineBuf)
                    _skipToBracketEnd(lineMatchIter, lineBuf[match.end():], "}")
                elif re.search(variablePattern, lineBuf):
                    match = re.search(variablePattern, lineBuf)
                    name = match.group(8)
                    _fillVariableRecord(symbolList, name, root, filename, index+1, line)
                elif re.search(variablePattern2, lineBuf):
                    match = re.search(variablePattern2, lineBuf)
                    name = match.group(3)
                    _fillVariableRecord(symbolList, name, root, filename, index+1, line)
                else:
                    pass

def _skipToBracketEnd(lineMatchIter, lineBuf, bracket):
    while (True):
        if re.search(bracket, lineBuf):
            return
        elif re.search("\(", lineBuf):
            match = re.search("\(", lineBuf)
            _skipToBracketEnd(lineMatchIter, lineBuf[match.end():], "\)")
        elif re.search("{", lineBuf):
            match = re.search("{", lineBuf)
            _skipToBracketEnd(lineMatchIter, lineBuf[match.end():], "}")

        lineBuf = next(lineMatchIter).group(0)

def _fillVariableRecord(symbolList, name, root, filename, lineNo, lineMatch):
    path = os.path.join(root, filename)
    path = path.replace(pluginRootPath+"\\", "")
    columnNo = re.search(name, lineMatch.group(0)).start()
    pos = (lineNo, columnNo)
    symbolList.append(Symbol(name, "builtin-variable", path, pos))

def printSymbolList():
    f = open(r'../builtin_shader.symbol', 'r')
    symbolList = json.load(f, object_hook=Symbol.json2Symbol)
    f.close()

    f = open(r'C:\Users\Administrator\Desktop\Tmp\symbolList.txt', 'w')
    for i in symbolList:
        f.write("%s,\t%s,\t%s,\t%s\n" % (i.name, i.type, i.path, i.pos))
    f.close()

def generateCompletesFile():
    symbolFile = os.path.join(pluginRootPath, 'builtin_shader.symbol')
    f = open( symbolFile, 'r')
    symbolList = json.load(f, object_hook=Symbol.json2Symbol)
    f.close()

    completesFile = os.path.join(pluginRootPath, 'builtin.sublime-completions')
    f = open(completesFile, 'w')
    f.write(r'''{
    "scope": "source.shader",
    "completions":
    [
''')

    isExists = set()
    for i in symbolList:
        if i.name in isExists:
            continue
        else:
            isExists.add(i.name)

        if i.type == "builtin-function":
            line = '        { "trigger": "%s\\tbuiltin-function", "contents": "%s($0)"},\n' % (i.name, i.name)
        elif i.type == "builtin-marco":
            line = '        { "trigger": "%s\\tbuiltin-marco", "contents": "%s"},\n' % (i.name, i.name)
        elif i.type == "builtin-variable":
            line = '        { "trigger": "%s\\tbuiltin-variable", "contents": "%s"},\n' % (i.name, i.name)
        else:
            line = '        { "trigger": "%s", "contents": "%s"},\n' % (i.name, i.name)

        f.write(line)

    f.write(r'''    ]
}
''')

    f.close()

if __name__ == "__main__":
    root = r"C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\UnityShader\builtin_shaders-5.3.4f1\CGIncludes"
    generateSymbolList(root)
    generateCompletesFile()


text:
package com.sputnik.strava.activity;

import com.sputnik.strava.segmenteffort.SegmentEffort;
import junit.framework.TestCase;

import java.util.List;

import static java.util.Arrays.asList;

public class ActivityTest extends TestCase {

    public void testGetSegmentIds() throws Exception {
        SegmentEffort firstSegmentEffort = new SegmentEffort(1, "Pearl Street", "34", 34F, "Tuesday", 123, 5L, 4);
        SegmentEffort secondSegmentEffort = new SegmentEffort(1, "Pearl Street", "34", 34F, "Tuesday", 456, 5L, 4);
        SegmentEffort thirdSegmentEffort = new SegmentEffort(1, "Pearl Street", "34", 34F, "Tuesday", 789, 5L, 4);

        List<SegmentEffort> segmentEfforts = asList(firstSegmentEffort, secondSegmentEffort, thirdSegmentEffort);

        Activity activity = new Activity(123, "Pearl Street", "Ride", "Cool ride", 23.4F, 15, "2006-04-21T13:20:40Z", "^&UIHT^&", "(*&",  segmentEfforts);

        assertEquals(asList(123L, 456L, 789L), activity.getSegmentIds());
    }
}


text:
namespace ons{

class ONSCLIENT_API ONSClientException: public std::exception
{
    public:
        ONSClientException() throw();
        virtual ~ONSClientException() throw();
        ONSClientException(std::string msg, int error) throw();
        const char* GetMsg() const throw();
        const char* what() const throw();
        int GetError() const throw();

    private:
        std::string  m_msg;
        int             m_error;
};

}

#endif


text:
package com.seekermob.songseeker.data;

import android.os.Parcel;
import android.os.Parcelable;

import com.seekermob.songseeker.data.ArtistInfo;

public class ReleaseInfo implements Parcelable {
	public String name;
	public String id;
	public String buyUrl;
	public String image;

	public ArtistInfo artist;

	public ReleaseInfo() {
		artist = new ArtistInfo();

		name = null;
		id = null;
		buyUrl = null;
		image = null;
	}

	public ReleaseInfo(Parcel in) {
		readFromParcel(in);
	}

	/*public ReleaseInfo(ReleaseInfoCache release) {
		if(release == null){
			artist = new ArtistInfo();

			name = null;
			id = null;
			buyUrl = null;
			image = null;
			return;
		}

		artist = new ArtistInfo(release.artist);

		name = release.name;
		id = release.id;
		buyUrl = release.buyUrl;
		image = release.image;
	}*/

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {

		dest.writeString(name);
		dest.writeString(buyUrl);
		dest.writeString(id);
		dest.writeString(image);
		dest.writeParcelable(artist, flags);
	}

	private void readFromParcel(Parcel in) {

		// We just need to read back each
		// field in the order that it was
		// written to the parcel
		name = in.readString();
		buyUrl = in.readString();
		id = in.readString();
		image = in.readString();

		// readParcelable needs the ClassLoader
		// but that can be picked up from the class
		// This will solve the BadParcelableException
		// because of ClassNotFoundException
		artist = in.readParcelable(ArtistInfo.class.getClassLoader());
	}

    /**
     *
     * This field is needed for Android to be able to
     * create new objects, individually or as arrays.
     *
     * This also means that you can use use the default
     * constructor to create the object and use another
     * method to hyrdate it as necessary.
     *
     * I just find it easier to use the constructor.
     * It makes sense for the way my brain thinks ;-)
     *
     */
    @SuppressWarnings("rawtypes")
	public static final Parcelable.Creator CREATOR =
    	new Parcelable.Creator() {
            public ReleaseInfo createFromParcel(Parcel in) {
                return new ReleaseInfo(in);
            }

            public ReleaseInfo[] newArray(int size) {
                return new ReleaseInfo[size];
            }
        };
}


text:
// This code is auto-generated, do not modify
using Ds3.Models;

namespace Ds3.Calls
{
    public class PutJobCreatedNotificationRegistrationSpectraS3Response
    {
        public JobCreatedNotificationRegistration ResponsePayload { get; private set; }

        public PutJobCreatedNotificationRegistrationSpectraS3Response(JobCreatedNotificationRegistration responsePayload)
        {
            this.ResponsePayload = responsePayload;
        }
    }
}