text:
/// <summary>
/// Transaction codes of client requests.
/// </summary>
var v_queryRequestCodes = {
	Login: 0,
	Query: 1,
	Execute: 2,
	Script: 3,
	QueryEditData: 4,
	SaveEditData: 5,
	CancelThread: 6,
	Debug: 7,
	CloseTab: 8,
	AdvancedObjectSearch: 9,
	Console: 10,
	Terminal: 11,
	Ping: 12
}

/// <summary>
/// Transaction codes of server responses.
/// </summary>
var v_queryResponseCodes = {
	LoginResult: 0,
	QueryResult: 1,
	QueryEditDataResult: 2,
	SaveEditDataResult: 3,
	SessionMissing: 4,
	PasswordRequired: 5,
	QueryAck: 6,
	MessageException: 7,
	DebugResponse: 8,
	RemoveContext: 9,
	AdvancedObjectSearchResult: 10,
	ConsoleResult: 11,
	TerminalResult: 12,
	Pong: 13
}

//If client is connected or not
var v_client_connected = false;

//Tooltip object and timer
var v_client_tooltip = null;
var v_client_tooltip_timer = null;

//Ping timer
var v_client_ping_timer = null;
var v_client_ping_response_timer = null;

/// <summary>
/// The variable that will receive the WebSocket object.

/// </summary>
var v_queryWebSocket;

var v_ws_offline = document.getElementById('websocket_status_offline');
var v_ws_connecting = document.getElementById('websocket_status_connecting');
var v_ws_online = document.getElementById('websocket_status_online');

function setStatusIcon(p_mode) {
	var v_img = document.getElementById('websocket_status');
	v_ws_offline.style.display = 'none';
	v_ws_connecting.style.display = 'none';
	v_ws_online.style.display = 'none';
	if (p_mode == 0)
		v_ws_offline.style.display = '';
	else if (p_mode == 1)
		v_ws_connecting.style.display = '';
	else if (p_mode == 2)
		v_ws_online.style.display = '';
}

//
function websocketPing() {
	v_client_ping_timer = setTimeout( function() {
		sendWebSocketMessage(v_queryWebSocket, v_queryRequestCodes.Ping, null, false);
		v_client_ping_response_timer = setTimeout(function() {
			try {
				v_queryWebSocket.close();
			}
			catch {

			}
			websocketClosed();
		},20000);
	},120000);

}

function websocketPong() {
	clearTimeout(v_client_ping_timer);
	clearTimeout(v_client_ping_response_timer);
	websocketPing();

}

/// <summary>
/// Starts query client
/// </summary>
/// <param name="p_port">Port where chat will listen for connections.</param>
function startQueryWebSocket(p_port) {

	clearTimeout(v_client_ping_timer);
	clearTimeout(v_client_ping_response_timer);

	setStatusIcon(1);

	var v_address = '';
	var v_channel = '';

	var v_secure = false;
	if (window.location.protocol == "https:")
		v_secure  = true;

	var v_port = v_query_port_external;
	if (p_port)
		v_port = p_port;

	if (v_secure) {
		v_address = 'wss://' + window.location.hostname;
		v_channel = 'wss';
	}
	else {
		v_address = 'ws://' + window.location.hostname;
		v_channel = 'ws';
	}

	v_queryWebSocket  = createWebSocket(
		v_address,
		v_port,
		function(p_event) {//Open
			sendWebSocketMessage(v_queryWebSocket, v_queryRequestCodes.Login, v_user_key, false);
			setStatusIcon(2);
			websocketPing();
			v_client_connected = true;

			if (v_client_tooltip!=null) {
				v_client_tooltip.dispose();
				v_client_tooltip = new Tooltip($('#tooltip_status'),{
					title: 'Reconnected.',
					placement: "bottom",
				});
				v_client_tooltip.show();
				v_client_tooltip_timer = window.setTimeout(function() {
						v_client_tooltip.dispose();
				}, 4000);
			}

		},
		function(p_message, p_context, p_context_code) {//Message
			var v_message = p_message;

			switch(v_message.v_code) {
				case parseInt(v_queryResponseCodes.Pong): {
					websocketPong();
					break;
				}
				case parseInt(v_queryResponseCodes.SessionMissing): {
					showAlert('Session not found please reload the page.');
					break;
				}
				case parseInt(v_queryResponseCodes.MessageException): {
					showError(p_message.v_data);
					break;
				}
				case parseInt(v_queryResponseCodes.PasswordRequired): {
					if (p_context) {
						SetAcked(p_context);
						QueryPasswordRequired(p_context,v_message.v_data);
						break;
					}
				}
				case parseInt(v_queryResponseCodes.QueryAck): {
					if (p_context) {
						SetAcked(p_context);
						break;
					}
				}
				case parseInt(v_queryResponseCodes.QueryResult): {
					if (p_context) {
						SetAcked(p_context);
						if (!v_message.v_error || v_message.v_data.v_chunks) {
							p_context.tab_tag.tempData = p_context.tab_tag.tempData.concat(v_message.v_data.v_data);
						}
						if (!v_message.v_data.v_chunks || v_message.v_data.v_last_block || v_message.v_error) {
							v_message.v_data.v_data = [];
							querySQLReturn(v_message,p_context);
							//Remove context
							removeContext(v_queryWebSocket,p_context_code);
						}

					}
					break;
				}
				case parseInt(v_queryResponseCodes.ConsoleResult): {
					if (p_context) {
						if (!v_message.v_error) {
							p_context.tab_tag.tempData = p_context.tab_tag.tempData += v_message.v_data.v_data;
						}
						if (v_message.v_data.v_last_block || v_message.v_error) {
							v_message.v_data.v_data = [];
							consoleReturn(v_message,p_context);
							//Remove context
							removeContext(v_queryWebSocket,p_context_code);
						}
					}
					break;
				}
				case parseInt(v_queryResponseCodes.TerminalResult): {
					if (p_context) {
						terminalReturn(v_message,p_context);
					}
					break;
				}
				case parseInt(v_queryResponseCodes.QueryEditDataResult): {
					if (p_context) {
						SetAcked(p_context);
						queryEditDataReturn(v_message,p_context);
						removeContext(v_queryWebSocket,p_context_code);
					}
					break;
				}
				case parseInt(v_queryResponseCodes.SaveEditDataResult): {
					if (p_context) {
						saveEditDataReturn(v_message,p_context);
						removeContext(v_queryWebSocket,p_context_code);
					}
					break;
				}
				case parseInt(v_queryResponseCodes.DebugResponse): {
					if (p_context) {
						SetAcked(p_context);
						debugResponse(p_message, p_context);
						if (p_message.v_data.v_remove_context) {
							removeContext(v_queryWebSocket,p_context_code);
						}
					}
					break;
				}
				case parseInt(v_queryResponseCodes.RemoveContext): {
					if (p_context) {
						removeContext(v_queryWebSocket,p_context_code);
					}
					break;
				}
				default: {
					break;
				}
				case parseInt(v_queryResponseCodes.AdvancedObjectSearchResult): {
					if (p_context) {
						SetAcked(p_context);
						advancedObjectSearchReturn(v_message, p_context);
						//Remove context
						removeContext(v_queryWebSocket,p_context_code);
					}
					break;
				}
			}
		},
		function(p_event) {//Close

			websocketClosed(p_port);
		},
		function(p_event) {//Error
			//showError('An error has occurred during the communication with the query server.');
		},
		v_channel
	);

}

function websocketClosed(p_port) {

	setStatusIcon(0);

	if (p_port==null && !v_client_connected) {
		startQueryWebSocket(v_query_port);
	}
	else if (v_client_connected) {
		v_client_connected = false;
		startQueryWebSocket();

		if (v_client_tooltip!=null) {
			if (v_client_tooltip_timer!=null) {
				clearTimeout(v_client_tooltip_timer);
				v_client_tooltip_timer = null;
			}
			v_client_tooltip.dispose();
		}

		v_client_tooltip = new Tooltip($('#tooltip_status'),{
			title: 'Lost connection to server, reconnecting...',
			placement: "bottom",
		});
		v_client_tooltip.show();
	}
	else {
		if (v_client_tooltip!=null) {
			if (v_client_tooltip_timer!=null) {
				clearTimeout(v_client_tooltip_timer);
				v_client_tooltip_timer = null;
			}
			v_client_tooltip.dispose();
		}

		showAlert(
			'Cannot connect to websocket server with ports ' + v_query_port_external + ' (external) and ' + v_query_port + ' (internal). Trying again in 2 seconds...'
		,function() {
			setTimeout(function() {
				startQueryWebSocket();
			},2000);
		})
	}

}

function SetAcked(p_context) {
	if (p_context)
		p_context.acked = true;
}

function QueryPasswordRequired(p_context, p_message) {
	if (p_context.tab_tag.mode=='query') {
		showPasswordPrompt(
			p_context.database_index,
			function() {
				cancelSQLTab(p_context.tab_tag);
				//querySQL(p_context.mode);
				querySQL(p_context.mode,
								 p_context.all_data,
								 p_context.query,
								 p_context.callback,
								 p_context.log_query,
								 p_context.save_query,
								 p_context.cmd_type,
								 p_context.clear_data,
								 p_context.tab_title);
			},
			function() {
				cancelSQLTab(p_context.tab_tag);
			},
			p_message
		);
	}
	else if (p_context.tab_tag.mode=='edit') {
		showPasswordPrompt(
			p_context.database_index,
			function() {
				cancelEditDataTab(p_context.tab_tag);
				//queryEditData();
			},
			function() {
				cancelEditDataTab(p_context.tab_tag);
			},
			p_message
		);
	}
	else if (p_context.tab_tag.mode=='console') {
		showPasswordPrompt(
			p_context.database_index,
			function() {
				cancelConsoleTab(p_context.tab_tag);
				p_context.tab_tag.editor_input.setValue(p_context.tab_tag.last_command);
        p_context.tab_tag.editor_input.clearSelection();
				consoleSQL(p_context.check_command,
									 p_context.mode);
			},
			function() {
				cancelConsoleTab(p_context.tab_tag);
			},
			p_message
		);
	}
}


text:
/*!
 * Picky
 * @license MIT
 */

/*
 * Module
 */

var completion = {
	watch: {}
};

var command = function (cli) {
	cli.program
		.command('watch')
		.description('Watch files changes and run the test suite.')
		.action(function () {
			// action dependencies
			// action
			console.log('Not implemented');
		});
};

/*
 * Module exports
 */

exports.completion = completion;
exports.command = command;

redpajama_set_name: RedPajamaGithub


text:
@implementation TWCategoryRequest

- (NSString *)schema {
    return @"https";
}

- (NSString *)host {
    return @"baking.ieasynote.com";
}

- (NSString *)port {
    return @"443";
}

- (NSString *)path {
    return @"";
}

- (NSString *)api {
    return @"app/category.html";
}

- (NSDictionary *)headers {
    NSDictionary *parameters = self.parameters;
    NSArray *keys = [parameters.allKeys sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
    NSString *params = @"";
    for (int i=0; i<keys.count; i++) {
        NSString * key = [keys objectAtIndex:i];
        id value = [parameters valueForKey:key];

        if (value && [value isKindOfClass:[NSString class]]) {
            params = [params stringByAppendingFormat:@"%@=%@", key, value];
        }
        if (i<(keys.count-1)) {
            params = [params stringByAppendingString:@"&"];
        }
    }
    params = [params base64:YES];

    NSString *secret = [[NSString stringWithFormat:@"%@%@%@", [self appkey], params, [self secretKey]] md5];

    return @{
             @"Accept" : @"application/json",
             @"Content-Type" : @"application/json",
             @"Data-Type" : @"json",
             @"Accept-Encoding" : @"gzip",
             @"Content-Encoding" : @"gzip",
             @"params" : params,
             @"appSecret" : secret,
             };
}

- (NSString *)appkey {
    return @"";
}

- (NSString *)secretKey {
    return @"";
}

@end


text:
A `sizeStop` object describes the size of the symbol at various values of the expression.

**Referenced by:** [SizeInfo Visual Variable](sizeInfo_visualVariable.md)

### Properties

| Property | Details
| --- | ---
| label | Value if a label is needed on the legend for a stop.
| size | Specifies the marker size to use for the specified value.
| value | The value to be mapped to a size.

### Example

```json
{
  "stop": {
    "value": 0,
    "size": 255
  }
}
```


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">

<sqlMap namespace="logRPSDAO">
	<typeAlias alias="LogRPSVO" type="kr.pe.courage.tech.das.log.service.LogRPSVO"/>

	<resultMap class="LogRPSVO" id="selectList-resultMap">

	</resultMap>

	<sql id="listCondition">
		<dynamic prepend="WHERE">

		</dynamic>
	</sql>

	<select id="selectList" parameterClass="LogRPSVO" resultMap="selectList-resultMap">

	</select>

	<select id="selectListCount" parameterClass="LogRPSVO" resultClass="int">

	</select>

	<select id="selectRPSChartDataGroupId" parameterClass="LogRPSVO" resultClass="string">
		SELECT A.GROUP_ID
		  FROM CURG_LOGRPS A
		 WHERE STDR_DE = #condStdrDe#
		<isNotEmpty prepend="AND" property="condGroupId">
			A.GROUP_ID = #condGroupId#
		</isNotEmpty>
		 GROUP BY GROUP_ID
	</select>

	<select id="selectRPSChartDataMap" parameterClass="LogRPSVO" resultClass="java.util.HashMap">
		SELECT STDR_TIME, RPS
		  FROM CURG_LOGRPS
		 WHERE GROUP_ID = #condGroupId#
		   AND STDR_DE = #condStdrDe#
		 ORDER BY STDR_TIME ASC
	</select>

	<insert id="insert" parameterClass="LogRPSVO">
		INSERT INTO CURG_LOGRPS (
			GROUP_ID, STDR_DE, STDR_DT, STDR_TIME, RPS
		)
		SELECT GROUP_ID, LOG_DATA_CHRCTR_2, LOG_DATA_CHRCTR_3, LOG_DATA_NUMBER_1, COUNT(*) AS RPS
		  FROM CURG_LOGDETAIL
		 WHERE GROUP_ID = #groupId#
		   AND LOG_DATA_CHRCTR_2 = #stdrDe#
		 GROUP BY GROUP_ID, LOG_DATA_CHRCTR_2, LOG_DATA_CHRCTR_3
	</insert>

	<delete id="delete" parameterClass="LogRPSVO">
		DELETE FROM CURG_LOGRPS
		 WHERE GROUP_ID = #groupId#
		   AND STDR_DE = #stdrDe#
	</delete>
</sqlMap>


text:
package backup

import (
	"os"
	"strings"
	"time"

	"github.com/lxc/lxd/lxd/project"
	"github.com/lxc/lxd/lxd/revert"
	"github.com/lxc/lxd/lxd/state"
	"github.com/lxc/lxd/shared"
	"github.com/lxc/lxd/shared/api"
)

// VolumeBackup represents a custom volume backup.
type VolumeBackup struct {
	CommonBackup

	projectName string
	poolName    string
	volumeName  string
	volumeOnly  bool
}

// NewVolumeBackup instantiates a new VolumeBackup struct.
func NewVolumeBackup(state *state.State, projectName, poolName, volumeName string, ID int, name string, creationDate, expiryDate time.Time, volumeOnly, optimizedStorage bool) *VolumeBackup {
	return &VolumeBackup{
		CommonBackup: CommonBackup{
			state:            state,
			id:               ID,
			name:             name,
			creationDate:     creationDate,
			expiryDate:       expiryDate,
			optimizedStorage: optimizedStorage,
		},
		projectName: projectName,
		poolName:    poolName,
		volumeName:  volumeName,
		volumeOnly:  volumeOnly,
	}
}

// VolumeOnly returns whether only the volume itself is to be backed up.
func (b *VolumeBackup) VolumeOnly() bool {
	return b.volumeOnly
}

// OptimizedStorage returns whether the backup is to be performed using optimization format of the storage driver.
func (b *VolumeBackup) OptimizedStorage() bool {
	return b.optimizedStorage
}

// Rename renames a volume backup.
func (b *VolumeBackup) Rename(newName string) error {
	oldBackupPath := shared.VarPath("backups", "custom", b.poolName, project.StorageVolume(b.projectName, b.name))
	newBackupPath := shared.VarPath("backups", "custom", b.poolName, project.StorageVolume(b.projectName, newName))

	// Extract the old and new parent backup paths from the old and new backup names rather than use
	// instance.Name() as this may be in flux if the instance itself is being renamed, whereas the relevant
	// instance name is encoded into the backup names.
	oldParentName, _, _ := api.GetParentAndSnapshotName(b.name)
	oldParentBackupsPath := shared.VarPath("backups", "custom", b.poolName, project.StorageVolume(b.projectName, oldParentName))
	newParentName, _, _ := api.GetParentAndSnapshotName(newName)
	newParentBackupsPath := shared.VarPath("backups", "custom", b.poolName, project.StorageVolume(b.projectName, newParentName))

	revert := revert.New()
	defer revert.Fail()

	// Create the new backup path if doesn't exist.
	if !shared.PathExists(newParentBackupsPath) {
		err := os.MkdirAll(newParentBackupsPath, 0700)
		if err != nil {
			return err
		}
	}

	// Rename the backup directory.
	err := os.Rename(oldBackupPath, newBackupPath)
	if err != nil {
		return err
	}

	revert.Add(func() { _ = os.Rename(newBackupPath, oldBackupPath) })

	// Check if we can remove the old parent directory.
	empty, _ := shared.PathIsEmpty(oldParentBackupsPath)
	if empty {
		err := os.Remove(oldParentBackupsPath)
		if err != nil {
			return err
		}
	}

	// Rename the database record.
	err = b.state.DB.Cluster.RenameVolumeBackup(b.name, newName)
	if err != nil {
		return err
	}

	revert.Success()
	return nil
}

// Delete removes a volume backup.
func (b *VolumeBackup) Delete() error {
	backupPath := shared.VarPath("backups", "custom", b.poolName, project.StorageVolume(b.projectName, b.name))
	// Delete the on-disk data.
	if shared.PathExists(backupPath) {
		err := os.RemoveAll(backupPath)
		if err != nil {
			return err
		}
	}

	// Check if we can remove the volume directory.
	backupsPath := shared.VarPath("backups", "custom", b.poolName, project.StorageVolume(b.projectName, b.volumeName))
	empty, _ := shared.PathIsEmpty(backupsPath)
	if empty {
		err := os.Remove(backupsPath)
		if err != nil {
			return err
		}
	}

	// Remove the database record.
	err := b.state.DB.Cluster.DeleteStoragePoolVolumeBackup(b.name)
	if err != nil {
		return err
	}

	return nil
}

// Render returns a VolumeBackup struct of the backup.
func (b *VolumeBackup) Render() *api.StoragePoolVolumeBackup {
	return &api.StoragePoolVolumeBackup{
		Name:             strings.SplitN(b.name, "/", 2)[1],
		CreatedAt:        b.creationDate,
		ExpiresAt:        b.expiryDate,
		VolumeOnly:       b.volumeOnly,
		OptimizedStorage: b.optimizedStorage,
	}
}


text:
class ExtensionVersionContentItem < ActiveRecord::Base
  belongs_to :extension_version
end


text:
from distutils.core import Command, setup
from sys import version_info
import unittest

UNITTESTS = [
		"basic",
	]

class TestCommand(Command):
	user_options = [ ]

	def initialize_options(self):
		pass

	def finalize_options(self):
		pass

	def run(self):
		suite = unittest.TestSuite()

		if version_info[0] >= 3:
			version = "_3"
		else:
			version = "_2"

		suite.addTests(
			unittest.defaultTestLoader.loadTestsFromNames(
				"tests." + test + version for test in UNITTESTS) )

		result = unittest.TextTestRunner(verbosity=2).run(suite)

setup(name='Unidecode',
      version='0.04.17',
      description='ASCII transliterations of Unicode text',
      license='GPL',
      long_description=open("README").read(),
      author='Tomaz Solc',
      author_email='tomaz.solc@tablix.org',

      packages = [ 'unidecode' ],

      provides = [ 'unidecode' ],

      cmdclass = { 'test': TestCommand },

      classifiers = [
	"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
	"Programming Language :: Python",
	"Programming Language :: Python :: 2",
	"Programming Language :: Python :: 3",
	"Topic :: Text Processing",
	"Topic :: Text Processing :: Filters",
	],
)


text:
<?php

namespace Symfony\Bundle\TwigBundle\CacheWarmer;

@trigger_error('The '.TemplateCacheCacheWarmer::class.' class is deprecated since version 4.4 and will be removed in 5.0; use Twig instead.', E_USER_DEPRECATED);

use Psr\Container\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface;
use Symfony\Bundle\TwigBundle\DependencyInjection\CompatibilityServiceSubscriberInterface as ServiceSubscriberInterface;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
use Twig\Environment;
use Twig\Error\Error;

/**
 * Generates the Twig cache for all templates.
 *
 * This warmer must be registered after TemplatePathsCacheWarmer,
 * as the Twig loader will need the cache generated by it.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 *
 * @deprecated since version 4.4, to be removed in 5.0; use Twig instead.
 */
class TemplateCacheCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
{
    protected $container;
    protected $finder;
    private $paths;

    /**
     * @param array $paths Additional twig paths to warm
     */
    public function __construct(ContainerInterface $container, TemplateFinderInterface $finder = null, array $paths = [])
    {
        // We don't inject the Twig environment directly as it depends on the
        // template locator (via the loader) which might be a cached one.
        // The cached template locator is available once the TemplatePathsCacheWarmer
        // has been warmed up.
        // But it can also be null if templating has been disabled.
        $this->container = $container;
        $this->finder = $finder;
        $this->paths = $paths;
    }

    /**
     * Warms up the cache.
     *
     * @param string $cacheDir The cache directory
     */
    public function warmUp($cacheDir)
    {
        if (null === $this->finder) {
            return;
        }

        $twig = $this->container->get('twig');

        $templates = $this->finder->findAllTemplates();

        foreach ($this->paths as $path => $namespace) {
            $templates = array_merge($templates, $this->findTemplatesInFolder($namespace, $path));
        }

        foreach ($templates as $template) {
            try {
                $twig->load($template);
            } catch (Error $e) {
                // problem during compilation, give up
            }
        }
    }

    /**
     * Checks whether this warmer is optional or not.
     *
     * @return bool always true
     */
    public function isOptional()
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public static function getSubscribedServices()
    {
        return [
            'twig' => Environment::class,
        ];
    }

    /**
     * Find templates in the given directory.
     */
    private function findTemplatesInFolder(?string $namespace, string $dir): array
    {
        if (!is_dir($dir)) {
            return [];
        }

        $templates = [];
        $finder = new Finder();

        foreach ($finder->files()->followLinks()->in($dir) as $file) {
            $name = $file->getRelativePathname();
            $templates[] = $namespace ? sprintf('@%s/%s', $namespace, $name) : $name;
        }

        return $templates;
    }
}


text:
app = angular.module('appOracleDbMonitor', [ 'ngMaterial', 'ngMessages', 'ngRoute', 'ngVidBg', 'ngDragDrop' ]);

app.directive('draggable', [ '$document', '$log', function($document, $log) {
	return {
		restrict : 'A',
		link : function(scope, elm, attrs) {
			var startX, startY, initialMouseX, initialMouseY;
			elm.css({
				position : 'absolute'
			});

			elm.bind('mousedown', function($event) {
				$log.info("mousedown");
				startX = elm.prop('offsetLeft');
				startY = elm.prop('offsetTop');
				initialMouseX = $event.clientX;
				initialMouseY = $event.clientY;
				$document.bind('mousemove', mousemove);
				$document.bind('mouseup', mouseup);
				return false;
			});

			function mousemove($event) {
				$log.info("mousemove");
				var dx = $event.clientX - initialMouseX;
				var dy = $event.clientY - initialMouseY;
				elm.css({
					top : startY + dy + 'px',
					left : startX + dx + 'px'
				});
				return false;
			}

			function mouseup($event) {
				$log.info("mouseup");
				$document.unbind('mousemove', mousemove);
				$document.unbind('mouseup', mouseup);
			}
		}
	};
} ]);


text:
module Gisele
  class VM
    module Simulator
      class Resumer < Component

        def enter_heartbeat
          @timer = EM.add_periodic_timer(0.01, &method(:resume))
        end

        def leave_heartbeat
          @timer.cancel
        end

      private

        def resume
          prog = vm.pick(:waitfor => :world)
          resume_one(prog) if prog
        end

        def resume_one(prog)
          event = prog.waitlist.keys.sample
          debug("Resuming Prog #{prog.puid}@#{prog.pc} -> #{event}")
          vm.resume(prog, [ event ])
        rescue Exception => ex
          error error_message(ex, "Resume error (#{prog.puid}):")
        end

      end # class Resumer
    end # class Simulator
  end # class VM
end # module Gisele


text:
class BooleanField < Field
  def initialize(*args)
    super(*args)
  end

  def convert(value)
    value == "1"
  end
end


text:
package org.sakaiproject.metaobj.shared.control;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.sakaiproject.metaobj.utils.mvc.intf.Controller;
import org.sakaiproject.metaobj.utils.mvc.intf.CancelableController;
import org.sakaiproject.metaobj.utils.mvc.intf.CustomCommandController;
import org.sakaiproject.metaobj.utils.mvc.intf.FormController;
import org.sakaiproject.metaobj.shared.model.StructuredArtifact;
import org.sakaiproject.metaobj.shared.model.ElementBean;
import org.sakaiproject.metaobj.shared.model.Artifact;
import org.sakaiproject.metaobj.shared.model.PersistenceException;
import org.sakaiproject.metaobj.shared.mgt.home.StructuredArtifactHomeInterface;
import org.sakaiproject.metaobj.shared.mgt.WritableObjectHome;
import org.sakaiproject.metaobj.shared.FormHelper;
import org.sakaiproject.tool.api.ToolSession;
import org.sakaiproject.content.api.FilePickerHelper;

import java.util.Map;
import java.util.Hashtable;

/**
 * Created by IntelliJ IDEA.
 *

 * User: John Ellis
 *

 * Date: Apr 20, 2004
 *

 * Time: 3:31:02 PM
 *

 * To change this template use File | Settings | File Templates.
 */
public class AddXmlElementController extends XmlControllerBase
   implements Controller, CustomCommandController, CancelableController {
   protected final Log logger = LogFactory.getLog(getClass());

   public Object formBackingObject(Map request, Map session, Map application) {
      ElementBean returnedBean;
      if (session.get(EditedArtifactStorage.STORED_ARTIFACT_FLAG) == null) {
         StructuredArtifactHomeInterface home = getSchema(session);
         if ( home == null || home.getParentHome() == null ) {
            logger.error(this+".formBackingObject schema not found (perhaps multiple submits): " + getSchemaName(session));
            session.remove(EditedArtifactStorage.EDITED_ARTIFACT_STORAGE_SESSION_KEY);
            return new ElementBean();
         }

         StructuredArtifact bean = (StructuredArtifact)home.createInstance();

         if (session.get(FormHelper.NEW_FORM_DISPLAY_NAME_TAG) != null) {
            bean.setDisplayName((String) session.get(FormHelper.NEW_FORM_DISPLAY_NAME_TAG));
         }

         bean.setParentFolder((String)session.get(FormHelper.PARENT_ID_TAG));
         EditedArtifactStorage sessionBean = new EditedArtifactStorage(bean.getCurrentSchema(),
            bean);
         session.put(EditedArtifactStorage.EDITED_ARTIFACT_STORAGE_SESSION_KEY,
            sessionBean);
         returnedBean = bean;
      }
      else {
         EditedArtifactStorage sessionBean = (EditedArtifactStorage)session.get(
            EditedArtifactStorage.EDITED_ARTIFACT_STORAGE_SESSION_KEY);
         returnedBean = sessionBean.getCurrentElement();
      }

      if (session.get(FilePickerHelper.FILE_PICKER_CANCEL) != null ||
            session.get(FilePickerHelper.FILE_PICKER_ATTACHMENTS) != null) {
         retrieveFileAttachments(request, session, returnedBean);
      }

      return returnedBean;
   }

   public ModelAndView handleRequest(Object requestModel, Map request, Map session,
                                     Map application, Errors errors) {
      ElementBean bean = (ElementBean)requestModel;
      if (request.get("cancel") != null) {
         session.put(FormHelper.RETURN_ACTION_TAG, FormHelper.RETURN_ACTION_CANCEL);
         session.remove(FormHelper.PREVIEW_HOME_TAG);
         session.remove(EditedArtifactStorage.STORED_ARTIFACT_FLAG);
         return new ModelAndView("success");
      }
      if (request.get("submitButton") == null) {
         return handleNonSubmit(bean, request, session, application, errors);
      }

      // ignore -- perhaps multiple submits -- error logged in formBackingObject()
      if ( bean.getCurrentSchema() == null ) {
         return new ModelAndView("success");
      }

      getValidator().validate(bean, errors, true);
      if (errors.hasErrors()) {
         logger.warn(this+"validate failed for: " + getSchemaName(session));
         return new ModelAndView("success");
      }

      StructuredArtifact artifact = (StructuredArtifact)bean;
      Artifact newArtifact;

      if (session.get(FormHelper.PREVIEW_HOME_TAG) != null) {
         request.remove("fileHelper");
         Map model = new Hashtable();
         model.put("success", "validationSuccessful");
         return handleNonSubmit(bean, request, session, application, errors, model);
      }

      String externalType = null;
      try {
         WritableObjectHome home = getSchema(session);
         externalType = home.getExternalType();
         newArtifact = home.store(artifact);
         if (newArtifact.getId() != null) {
            session.put(FormHelper.FORM_SAVE_SUCCESS, newArtifact.getId().getValue());
            session.put(FormHelper.RETURN_REFERENCE_TAG, newArtifact.getId().getValue());
            session.put(FormHelper.RETURN_ACTION_TAG, FormHelper.RETURN_ACTION_SAVE);
         }
      } catch (PersistenceException e) {
         logger.warn("Could not create instance of form typed: " + (externalType == null ? "[UNKNOWN]" : externalType));
         errors.rejectValue(e.getField(), e.getErrorCode(), e.getErrorInfo(),
            e.getDefaultMessage());
      }
      session.remove(EditedArtifactStorage.STORED_ARTIFACT_FLAG);
      return new ModelAndView("success");
   }

}


text:
var gulp = require('gulp');
var nightwatch = require('../');

gulp.task('default', function() {
  gulp.src('')
    .pipe(nightwatch({
      configFile: 'nightwatch.json'
    }));
});

gulp.task('withNoOptions', function() {
  gulp.src('')
    .pipe(nightwatch());
});

gulp.task('withCliArgs:array', function() {
  gulp.src('')
    .pipe(nightwatch({
      configFile: 'nightwatch.json',
      cliArgs: [ '--env chrome', '--tag sandbox' ]
    }));
});

gulp.task('withCliArgs:object', function() {
  gulp.src('')
    .pipe(nightwatch({
      configFile: 'nightwatch.json',
      cliArgs: {
        env: 'chrome',
        tag: 'sandbox'
      }
    }));
});

gulp.task('withCliArgs:testcase', function() {
  gulp.src('')
    .pipe(nightwatch({
      configFile: 'nightwatch.json',
      cliArgs: {
        test: 'tests/github',
        testcase: "Demo: GitHub Title Test"
      }
      // or, cliArgs: [ '--test tests/github', '--testcase="Demo: GitHub Title Test"' ]
    }));
});

gulp.task('withCliArgs:multi-env', function() {
  gulp.src('')
    .pipe(nightwatch({
      configFile: 'nightwatch.json',
      cliArgs: [ '--env chrome,default' ]
    }));
});

gulp.task('all', ['default', 'withNoOptions', 'withCliArgs:array', 'withCliArgs:object',
                  'withCliArgs:testcase', 'withCliArgs:multi-env']);


text:
ASMJIT_BEGIN_SUB_NAMESPACE(x86)

//! \cond INTERNAL
//! \addtogroup asmjit_x86
//! \{

namespace InstDB {

//! Instruction encoding (X86).
//!
//! This is a specific identifier that is used by AsmJit to describe the way each instruction is encoded. Some
//! encodings are special only for a single instruction as X86 instruction set contains a lot of legacy encodings,
//! and some encodings describe a group of instructions that share some commons, like MMX, SSE, AVX, AVX512
//! instructions, etc...
enum EncodingId : uint32_t {
  kEncodingNone = 0,                     //!< Never used.
  kEncodingX86Op,                        //!< X86 [OP].
  kEncodingX86Op_Mod11RM,                //!< X86 [OP] (opcode with ModRM byte where MOD must be 11b).
  kEncodingX86Op_Mod11RM_I8,             //!< X86 [OP] (opcode with ModRM byte + 8-bit immediate).
  kEncodingX86Op_xAddr,                  //!< X86 [OP] (implicit address in the first register operand).
  kEncodingX86Op_xAX,                    //!< X86 [OP] (implicit or explicit '?AX' form).
  kEncodingX86Op_xDX_xAX,                //!< X86 [OP] (implicit or explicit '?DX, ?AX' form).
  kEncodingX86Op_MemZAX,                 //!< X86 [OP] (implicit or explicit '[EAX|RAX]' form).
  kEncodingX86I_xAX,                     //!< X86 [I] (implicit or explicit '?AX' form).
  kEncodingX86M,                         //!< X86 [M] (handles 2|4|8-bytes size).
  kEncodingX86M_NoMemSize,               //!< X86 [M] (handles 2|4|8-bytes size, but doesn't consider memory size).
  kEncodingX86M_NoSize,                  //!< X86 [M] (doesn't handle any size).
  kEncodingX86M_GPB,                     //!< X86 [M] (handles single-byte size).
  kEncodingX86M_GPB_MulDiv,              //!< X86 [M] (like GPB, handles implicit|explicit MUL|DIV|IDIV).
  kEncodingX86M_Only,                    //!< X86 [M] (restricted to memory operand of any size).
  kEncodingX86M_Only_EDX_EAX,            //!< X86 [M] (memory operand only, followed by implicit <edx> and <eax>).
  kEncodingX86M_Nop,                     //!< X86 [M] (special case of NOP instruction).
  kEncodingX86R_Native,                  //!< X86 [R] (register must be either 32-bit or 64-bit depending on arch).
  kEncodingX86R_FromM,                   //!< X86 [R] - which specifies memory address.
  kEncodingX86R32_EDX_EAX,               //!< X86 [R32] followed by implicit EDX and EAX.
  kEncodingX86Rm,                        //!< X86 [RM] (doesn't handle single-byte size).
  kEncodingX86Rm_Raw66H,                 //!< X86 [RM] (used by LZCNT, POPCNT, and TZCNT).
  kEncodingX86Rm_NoSize,                 //!< X86 [RM] (doesn't add REX.W prefix if 64-bit reg is used).
  kEncodingX86Mr,                        //!< X86 [MR] (doesn't handle single-byte size).
  kEncodingX86Mr_NoSize,                 //!< X86 [MR] (doesn't handle any size).
  kEncodingX86Arith,                     //!< X86 adc, add, and, cmp, or, sbb, sub, xor.
  kEncodingX86Bswap,                     //!< X86 bswap.
  kEncodingX86Bt,                        //!< X86 bt, btc, btr, bts.
  kEncodingX86Call,                      //!< X86 call.
  kEncodingX86Cmpxchg,                   //!< X86 [MR] cmpxchg.
  kEncodingX86Cmpxchg8b_16b,             //!< X86 [MR] cmpxchg8b, cmpxchg16b.
  kEncodingX86Crc,                       //!< X86 crc32.
  kEncodingX86Enter,                     //!< X86 enter.
  kEncodingX86Imul,                      //!< X86 imul.
  kEncodingX86In,                        //!< X86 in.
  kEncodingX86Ins,                       //!< X86 ins[b|q|d].
  kEncodingX86IncDec,                    //!< X86 inc, dec.
  kEncodingX86Int,                       //!< X86 int (interrupt).
  kEncodingX86Jcc,                       //!< X86 jcc.
  kEncodingX86JecxzLoop,                 //!< X86 jcxz, jecxz, jrcxz, loop, loope, loopne.
  kEncodingX86Jmp,                       //!< X86 jmp.
  kEncodingX86JmpRel,                    //!< X86 xbegin.
  kEncodingX86LcallLjmp,                 //!< X86 lcall/ljmp.
  kEncodingX86Lea,                       //!< X86 lea.
  kEncodingX86Mov,                       //!< X86 mov (all possible cases).
  kEncodingX86Movabs,                    //!< X86 movabs.
  kEncodingX86MovsxMovzx,                //!< X86 movsx, movzx.
  kEncodingX86MovntiMovdiri,             //!< X86 movnti/movdiri.
  kEncodingX86EnqcmdMovdir64b,           //!< X86 enqcmd/enqcmds/movdir64b.
  kEncodingX86Out,                       //!< X86 out.
  kEncodingX86Outs,                      //!< X86 out[b|w|d].
  kEncodingX86Push,                      //!< X86 push.
  kEncodingX86Pop,                       //!< X86 pop.
  kEncodingX86Ret,                       //!< X86 ret.
  kEncodingX86Rot,                       //!< X86 rcl, rcr, rol, ror, sal, sar, shl, shr.
  kEncodingX86Set,                       //!< X86 setcc.
  kEncodingX86ShldShrd,                  //!< X86 shld, shrd.
  kEncodingX86StrRm,                     //!< X86 lods.
  kEncodingX86StrMr,                     //!< X86 scas, stos.
  kEncodingX86StrMm,                     //!< X86 cmps, movs.
  kEncodingX86Test,                      //!< X86 test.
  kEncodingX86Xadd,                      //!< X86 xadd.
  kEncodingX86Xchg,                      //!< X86 xchg.
  kEncodingX86Fence,                     //!< X86 lfence, mfence, sfence.
  kEncodingX86Bndmov,                    //!< X86 [RM|MR] (used by BNDMOV).
  kEncodingFpuOp,                        //!< FPU [OP].
  kEncodingFpuArith,                     //!< FPU fadd, fdiv, fdivr, fmul, fsub, fsubr.
  kEncodingFpuCom,                       //!< FPU fcom, fcomp.
  kEncodingFpuFldFst,                    //!< FPU fld, fst, fstp.
  kEncodingFpuM,                         //!< FPU fiadd, ficom, ficomp, fidiv, fidivr, fild, fimul, fist, fistp, fisttp, fisub, fisubr.
  kEncodingFpuR,                         //!< FPU fcmov, fcomi, fcomip, ffree, fucom, fucomi, fucomip, fucomp, fxch.
  kEncodingFpuRDef,                      //!< FPU faddp, fdivp, fdivrp, fmulp, fsubp, fsubrp.
  kEncodingFpuStsw,                      //!< FPU fnstsw, Fstsw.
  kEncodingExtRm,                        //!< EXT [RM].
  kEncodingExtRm_XMM0,                   //!< EXT [RM<XMM0>].
  kEncodingExtRm_ZDI,                    //!< EXT [RM<ZDI>].
  kEncodingExtRm_P,                      //!< EXT [RM] (propagates 66H if the instruction uses XMM register).
  kEncodingExtRm_Wx,                     //!< EXT [RM] (propagates REX.W if GPQ is used or the second operand is GPQ/QWORD_PTR).
  kEncodingExtRm_Wx_GpqOnly,             //!< EXT [RM] (propagates REX.W if the first operand is GPQ register).
  kEncodingExtRmRi,                      //!< EXT [RM|RI].
  kEncodingExtRmRi_P,                    //!< EXT [RM|RI] (propagates 66H if the instruction uses XMM register).
  kEncodingExtRmi,                       //!< EXT [RMI].
  kEncodingExtRmi_P,                     //!< EXT [RMI] (propagates 66H if the instruction uses XMM register).
  kEncodingExtPextrw,                    //!< EXT pextrw.
  kEncodingExtExtract,                   //!< EXT pextrb, pextrd, pextrq, extractps.
  kEncodingExtMov,                       //!< EXT mov?? - #1:[MM|XMM, MM|XMM|Mem] #2:[MM|XMM|Mem, MM|XMM].
  kEncodingExtMovbe,                     //!< EXT movbe.
  kEncodingExtMovd,                      //!< EXT movd.
  kEncodingExtMovq,                      //!< EXT movq.
  kEncodingExtExtrq,                     //!< EXT extrq (SSE4A).
  kEncodingExtInsertq,                   //!< EXT insrq (SSE4A).
  kEncodingExt3dNow,                     //!< EXT [RMI] (3DNOW specific).
  kEncodingVexOp,                        //!< VEX [OP].
  kEncodingVexOpMod,                     //!< VEX [OP] with MODR/M.
  kEncodingVexKmov,                      //!< VEX [RM|MR] (used by kmov[b|w|d|q]).
  kEncodingVexR_Wx,                      //!< VEX|EVEX [R] (propagatex VEX.W if GPQ used).
  kEncodingVexM,                         //!< VEX|EVEX [M].
  kEncodingVexM_VM,                      //!< VEX|EVEX [M] (propagates VEX|EVEX.L, VSIB support).
  kEncodingVexMr_Lx,                     //!< VEX|EVEX [MR] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexMr_VM,                     //!< VEX|EVEX [MR] (VSIB support).
  kEncodingVexMri,                       //!< VEX|EVEX [MRI].
  kEncodingVexMri_Lx,                    //!< VEX|EVEX [MRI] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexMri_Vpextrw,               //!< VEX|EVEX [MRI] (special case required by VPEXTRW instruction).
  kEncodingVexRm,                        //!< VEX|EVEX [RM].
  kEncodingVexRm_ZDI,                    //!< VEX|EVEX [RM<ZDI>].
  kEncodingVexRm_Wx,                     //!< VEX|EVEX [RM] (propagates VEX|EVEX.W if GPQ used).
  kEncodingVexRm_Lx,                     //!< VEX|EVEX [RM] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRm_Lx_Narrow,              //!< VEX|EVEX [RM] (the destination vector size is narrowed).
  kEncodingVexRm_Lx_Bcst,                //!< VEX|EVEX [RM] (can handle broadcast r32/r64).
  kEncodingVexRm_VM,                     //!< VEX|EVEX [RM] (propagates VEX|EVEX.L, VSIB support).
  kEncodingVexRm_T1_4X,                  //!<     EVEX [RM] (used by NN instructions that use RM-T1_4X encoding).
  kEncodingVexRmi,                       //!< VEX|EVEX [RMI].
  kEncodingVexRmi_Wx,                    //!< VEX|EVEX [RMI] (propagates VEX|EVEX.W if GPQ used).
  kEncodingVexRmi_Lx,                    //!< VEX|EVEX [RMI] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvm,                       //!< VEX|EVEX [RVM].
  kEncodingVexRvm_Wx,                    //!< VEX|EVEX [RVM] (propagates VEX|EVEX.W if GPQ used).
  kEncodingVexRvm_ZDX_Wx,                //!< VEX|EVEX [RVM<ZDX>] (propagates VEX|EVEX.W if GPQ used).
  kEncodingVexRvm_Lx,                    //!< VEX|EVEX [RVM] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvm_Lx_KEvex,              //!< VEX|EVEX [RVM] (forces EVEX prefix if K register is used on destination).
  kEncodingVexRvm_Lx_2xK,                //!< VEX|EVEX [RVM] (vp2intersectd/vp2intersectq).
  kEncodingVexRvmr,                      //!< VEX|EVEX [RVMR].
  kEncodingVexRvmr_Lx,                   //!< VEX|EVEX [RVMR] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvmi,                      //!< VEX|EVEX [RVMI].
  kEncodingVexRvmi_KEvex,                //!< VEX|EVEX [RVMI] (forces EVEX prefix if K register is used on destination).
  kEncodingVexRvmi_Lx,                   //!< VEX|EVEX [RVMI] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvmi_Lx_KEvex,             //!< VEX|EVEX [RVMI] (forces EVEX prefix if K register is used on destination).
  kEncodingVexRmv,                       //!< VEX|EVEX [RMV].
  kEncodingVexRmv_Wx,                    //!< VEX|EVEX [RMV] (propagates VEX|EVEX.W if GPQ used).
  kEncodingVexRmv_VM,                    //!< VEX|EVEX [RMV] (propagates VEX|EVEX.L, VSIB support).
  kEncodingVexRmvRm_VM,                  //!< VEX|EVEX [RMV|RM] (propagates VEX|EVEX.L, VSIB support).
  kEncodingVexRmvi,                      //!< VEX|EVEX [RMVI].
  kEncodingVexRmMr,                      //!< VEX|EVEX [RM|MR].
  kEncodingVexRmMr_Lx,                   //!< VEX|EVEX [RM|MR] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvmRmv,                    //!< VEX|EVEX [RVM|RMV].
  kEncodingVexRvmRmi,                    //!< VEX|EVEX [RVM|RMI].
  kEncodingVexRvmRmi_Lx,                 //!< VEX|EVEX [RVM|RMI] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvmRmvRmi,                 //!< VEX|EVEX [RVM|RMV|RMI].
  kEncodingVexRvmMr,                     //!< VEX|EVEX [RVM|MR].
  kEncodingVexRvmMvr,                    //!< VEX|EVEX [RVM|MVR].
  kEncodingVexRvmMvr_Lx,                 //!< VEX|EVEX [RVM|MVR] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvmVmi,                    //!< VEX|EVEX [RVM|VMI].
  kEncodingVexRvmVmi_Lx,                 //!< VEX|EVEX [RVM|VMI] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvmVmi_Lx_MEvex,           //!< VEX|EVEX [RVM|VMI] (propagates EVEX if the second operand is memory).
  kEncodingVexVm,                        //!< VEX|EVEX [VM].
  kEncodingVexVm_Wx,                     //!< VEX|EVEX [VM] (propagates VEX|EVEX.W if GPQ used).
  kEncodingVexVmi,                       //!< VEX|EVEX [VMI].
  kEncodingVexVmi_Lx,                    //!< VEX|EVEX [VMI] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexVmi4_Wx,                   //!< VEX|EVEX [VMI] (propagates VEX|EVEX.W if GPQ used, DWORD Immediate).
  kEncodingVexVmi_Lx_MEvex,              //!< VEX|EVEX [VMI] (force EVEX prefix when the second operand is memory)
  kEncodingVexRvrmRvmr,                  //!< VEX|EVEX [RVRM|RVMR].
  kEncodingVexRvrmRvmr_Lx,               //!< VEX|EVEX [RVRM|RVMR] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexRvrmiRvmri_Lx,             //!< VEX|EVEX [RVRMI|RVMRI] (propagates VEX|EVEX.L if YMM used).
  kEncodingVexMovdMovq,                  //!< VEX|EVEX vmovd, vmovq.
  kEncodingVexMovssMovsd,                //!< VEX|EVEX vmovss, vmovsd.
  kEncodingFma4,                         //!< FMA4 [R, R, R/M, R/M].
  kEncodingFma4_Lx,                      //!< FMA4 [R, R, R/M, R/M] (propagates AVX.L if YMM used).
  kEncodingAmxCfg,                       //!< AMX ldtilecfg/sttilecfg.
  kEncodingAmxR,                         //!< AMX [R] - tilezero.
  kEncodingAmxRm,                        //!< AMX tileloadd/tileloaddt1.
  kEncodingAmxMr,                        //!< AMX tilestored.
  kEncodingAmxRmv,                       //!< AMX instructions that use TMM registers.
  kEncodingCount                         //!< Count of instruction encodings.
};

//! Additional information table, provides CPU extensions required to execute an instruction and RW flags.
struct AdditionalInfo {
  //! Features vector.
  uint8_t _features[6];
  //! Index to `_rwFlagsTable`.
  uint8_t _rwFlagsIndex;
  //! Reserved for future use.
  uint8_t _reserved;

  inline const uint8_t* featuresBegin() const noexcept { return _features; }
  inline const uint8_t* featuresEnd() const noexcept { return _features + ASMJIT_ARRAY_SIZE(_features); }
};

// ${NameLimits:Begin}
// ------------------- Automatically generated, do not edit -------------------
enum : uint32_t { kMaxNameSize = 17 };
// ----------------------------------------------------------------------------
// ${NameLimits:End}

struct InstNameIndex {
  uint16_t start;
  uint16_t end;
};

struct RWInfo {
  enum Category : uint8_t {
    kCategoryGeneric,
    kCategoryMov,
    kCategoryMovabs,
    kCategoryImul,
    kCategoryMovh64,
    kCategoryPunpcklxx,
    kCategoryVmaskmov,
    kCategoryVmovddup,
    kCategoryVmovmskpd,
    kCategoryVmovmskps,
    kCategoryVmov1_2,
    kCategoryVmov1_4,
    kCategoryVmov1_8,
    kCategoryVmov2_1,
    kCategoryVmov4_1,
    kCategoryVmov8_1
  };

  uint8_t category;
  uint8_t rmInfo;
  uint8_t opInfoIndex[6];
};

struct RWInfoOp {
  uint64_t rByteMask;
  uint64_t wByteMask;
  uint8_t physId;
  uint8_t consecutiveLeadCount;
  uint8_t reserved[2];
  OpRWFlags flags;
};

//! R/M information.
//!
//! This data is used to replace register operand by a memory operand reliably.
struct RWInfoRm {
  enum Category : uint8_t {
    kCategoryNone = 0,
    kCategoryFixed,
    kCategoryConsistent,
    kCategoryHalf,
    kCategoryQuarter,
    kCategoryEighth
  };

  enum Flags : uint8_t {
    kFlagAmbiguous = 0x01
  };

  uint8_t category;
  uint8_t rmOpsMask;
  uint8_t fixedSize;
  uint8_t flags;
  uint8_t rmFeature;
};

struct RWFlagsInfoTable {
  //! CPU/FPU flags read.
  uint32_t readFlags;
  //! CPU/FPU flags written or undefined.
  uint32_t writeFlags;
};

extern const uint8_t rwInfoIndexA[Inst::_kIdCount];
extern const uint8_t rwInfoIndexB[Inst::_kIdCount];
extern const RWInfo rwInfoA[];
extern const RWInfo rwInfoB[];
extern const RWInfoOp rwInfoOp[];
extern const RWInfoRm rwInfoRm[];
extern const RWFlagsInfoTable _rwFlagsInfoTable[];

extern const uint32_t _mainOpcodeTable[];
extern const uint32_t _altOpcodeTable[];

#ifndef ASMJIT_NO_TEXT
extern const char _nameData[];
extern const InstNameIndex instNameIndex[26];
#endif // !ASMJIT_NO_TEXT

extern const AdditionalInfo _additionalInfoTable[];

} // {InstDB}

//! \}
//! \endcond

ASMJIT_END_SUB_NAMESPACE

#endif // ASMJIT_X86_X86INSTDB_P_H_INCLUDED


text:
using Microsoft.Web.Administration;

namespace WebsitePanel.Providers.Web.Iis.DefaultDocuments
{
	using Common;
	using Microsoft.Web.Administration;
	using Microsoft.Web.Management.Server;
	using System;
	using System.Text;
	using System.Collections.Generic;
	using System.Collections;
	using WebsitePanel.Providers.Web.Iis.Utility;

	internal sealed class DefaultDocsModuleService : ConfigurationModuleService
	{
		public const string ValueAttribute = "value";

		public string GetDefaultDocumentSettings(ServerManager srvman, string siteId)
		{
			// Load web site configuration
			var config = srvman.GetWebConfiguration(siteId);
			// Load corresponding section
			var section = config.GetSection(Constants.DefaultDocumentsSection);
			//
			var filesCollection = section.GetCollection("files");
			// Build default documents
			var defaultDocs = new List<String>();
			//
			foreach (var item in filesCollection)
			{
				var item2Get = GetDefaultDocument(item);
				//
				if (String.IsNullOrEmpty(item2Get))
					continue;
				//
				defaultDocs.Add(item2Get);
			}
			//
			return String.Join(",", defaultDocs.ToArray());
		}

		public void SetDefaultDocumentsEnabled(string siteId, bool enabled)
		{
			using (var srvman = GetServerManager())
			{
				// Load web site configuration
				var config = srvman.GetWebConfiguration(siteId);
				// Load corresponding section
				var section = config.GetSection(Constants.DefaultDocumentsSection);
				//
				section.SetAttributeValue("enabled", enabled);
				//
				srvman.CommitChanges();
			}
		}

		public void SetDefaultDocumentSettings(string siteId, string defaultDocs)
		{
			#region Revert to parent settings (inherited)
			using (var srvman = GetServerManager())
			{
				// Load web site configuration
				var config = srvman.GetWebConfiguration(siteId);
				// Load corresponding section
				var section = config.GetSection(Constants.DefaultDocumentsSection);
				//
				section.RevertToParent();
				//
				srvman.CommitChanges();
			}
			#endregion

			// Exit if no changes have been made
			if (String.IsNullOrEmpty(defaultDocs))
				return;

			// Update default documents list
			var docs2Add = defaultDocs.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

			#region Put changes in effect
			using (var srvman = GetServerManager())
			{
				// Load web site configuration
				var config = srvman.GetWebConfiguration(siteId);
				// Load corresponding section
				var section = config.GetSection(Constants.DefaultDocumentsSection);
				//
				var filesCollection = section.GetCollection("files");
				// The only solution to override inherited default documents is to use <clear/> element
				filesCollection.Clear();
				//
				foreach (var item in docs2Add)
				{
					// The default document specified exists
					if (FindDefaultDocument(filesCollection, item) > -1)
						continue;
					//
					var item2Add = CreateDefaultDocument(filesCollection, item);
					//
					if (item2Add == null)
						continue;
					//
					filesCollection.Add(item2Add);
				}
				//
				srvman.CommitChanges();
			}
			#endregion
		}

		private string GetDefaultDocument(ConfigurationElement element)
		{
			if (element == null)
				return null;
			//
			return Convert.ToString(element.GetAttributeValue(ValueAttribute));
		}

		private ConfigurationElement CreateDefaultDocument(ConfigurationElementCollection collection, string valueStr)
		{
			if (valueStr == null)
				return null;
			//
			valueStr = valueStr.Trim();
			//
			if (String.IsNullOrEmpty(valueStr))
				return null;

			//
			ConfigurationElement file2Add = collection.CreateElement("add");
			file2Add.SetAttributeValue(ValueAttribute, valueStr);
			//
			return file2Add;
		}

		private int FindDefaultDocument(ConfigurationElementCollection collection, string valueStr)
		{
			for (int i = 0; i < collection.Count; i++)
			{
				var item = collection[i];
				//
				var valueObj = item.GetAttributeValue(ValueAttribute);
				//
				if (String.Equals((String)valueObj, valueStr, StringComparison.OrdinalIgnoreCase))
				{
					return i;
				}
			}
			//
			return -1;
		}
	}
}


text:
package com.easyooo.framework.configure;

import java.util.List;

import org.springframework.beans.factory.config.BeanDefinitionHolder;

import com.easyooo.framework.support.zookeeper.ZookeeperTemplate;

/**
 * Node 执行器接口定义
 *
 * @author Killer
 */
public interface NodeExecutor {

	/**
	 * 当在直接子节点时就执行该方法
	 *
	 * @param source
	 * @return
	 */
	List<BeanDefinitionHolder> doExecute(ZookeeperTemplate zookeeperTemplate,
			String source)throws UnifiedConfigException;

}


text:
function noise = orderedNoiseParamInit(noise, y)

% ORDEREDNOISEPARAMINIT ORDERED noise parameter initialisation.
%
%	Description:
%	The ordered categorical noise model is an ordinal regression noise
%	model. The real line is divided into categories, which have some
%	ordering (such as small, medium, large).
%
%
%	NOISE = ORDEREDNOISEPARAMINIT(NOISE) initialises the ordered
%	categorical noise structure with some default parameters.
%	 Returns:
%	  NOISE - the noise structure with the default parameters placed in.
%	 Arguments:
%	  NOISE - the noise structure which requires initialisation.
%
%
%	See also
%	NOISECREATE, NOISEPARAMINIT

%	Copyright (c) 2004, 2005 Neil D. Lawrence

if nargin > 1
  noise.C = max(max(y))+1;
  noise.numProcess = size(y, 2);
  noise.bias = zeros(1, noise.numProcess);
  for i = 1:size(y, 2)
    noise.bias(i) = mean(y(find(~isnan(y(:, i))), i));
  end
else
  noise.bias = repmat(1/2, 1, noise.numProcess);
end
noise.nParams = noise.C-2 + noise.numProcess;

if noise.C > 2
  noise.widths = repmat(1/(noise.C-2), noise.C-2, 1);
  noise.transforms.index = [noise.numProcess+1:noise.nParams];
  noise.transforms.type = optimiDefaultConstraint('positive');
else
  noise.widths = [];
end
noise.variance = 0.1; % needs to be set a bit above zero for numerical reasons.

% Can handle missing values?
noise.missing = 1;


text:
var declare: number;
var module: string;

module container {
    declare                // this is the identifier 'declare'
    module                 // this is the identifier 'module'
    "my external module"   // this is just a string
    { }                    // this is a block body
}


text:
package fake

import (
	v1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
	rest "k8s.io/client-go/rest"
	testing "k8s.io/client-go/testing"
)

type FakeConfigV1 struct {
	*testing.Fake
}

func (c *FakeConfigV1) Builds() v1.BuildInterface {
	return &FakeBuilds{c}
}

func (c *FakeConfigV1) Images() v1.ImageInterface {
	return &FakeImages{c}
}

// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeConfigV1) RESTClient() rest.Interface {
	var ret *rest.RESTClient
	return ret
}


text:
/**
**  @file PointDefense.cpp
*/
/*
**  Copyright (c) 2014, GCBLUE PROJECT
**  All rights reserved.
**
**  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
**
**  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
**
**  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
**     documentation and/or other materials provided with the distribution.
**
**  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from
**     this software without specific prior written permission.
**
**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
**  NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
**  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
**  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
**  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
**  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "stdwx.h"

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "ai/PointDefense.h"
#include "ai/Brain.h"
#include "scriptinterface/tcPlatformInterface.h"
#include "simmath.h"
#include "tcSensorMapTrack.h"
#include "tcWeaponDBObject.h"
#include "tcLauncher.h"

#include "common/tcStream.h"
#include "common/tcObjStream.h"
#include "common/tcGameStream.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

using namespace ai;
using scriptinterface::tcPlatformInterface;
using scriptinterface::tcTrackList;

/**
* Saves state to command stream
*/
tcCommandStream& PointDefense::operator>>(tcCommandStream& stream)
{
    return stream;
}

/**
* Loads state to command stream
*/
tcCommandStream& PointDefense::operator<<(tcCommandStream& stream)
{
    return stream;
}

/**
* Read from stream
*/
tcGameStream& PointDefense::operator<<(tcGameStream& stream)
{
    Task::operator<<(stream);

    return stream;
}

/**
* Write to stream
*/
tcGameStream& PointDefense::operator>>(tcGameStream& stream)
{
    Task::operator>>(stream);

    return stream;
}

void PointDefense::GetPointDefenseLaunchers(std::vector<unsigned int>& launchers)
{
    wxASSERT(platform != 0);

    unsigned int nLaunchers = platform->GetLauncherCount();
    for (unsigned int n=0; n<nLaunchers; n++)
    {
        tcLauncher* launcher = platform->GetLauncher(n);
        tcWeaponDBObject* weaponData = dynamic_cast<tcWeaponDBObject*>(launcher->mpChildDBObj);

        unsigned char launcherStatus = launcher->GetStatus(); // doesn't update, returns last status
        bool statusOkay = true;
        switch (launcherStatus)
        {
        case tcLauncher::BAD_LAUNCHER:
        case tcLauncher::LAUNCHER_EMPTY:
        case tcLauncher::LAUNCHER_BUSY:
        case tcLauncher::LAUNCHER_ERROR:
        case tcLauncher::LAUNCHER_INACTIVE:
        case tcLauncher::NO_FIRECONTROL:
        case tcLauncher::DAMAGED:
        case tcLauncher::LAUNCHER_LOADING:
        case tcLauncher::LAUNCHER_UNLOADING:
        case tcLauncher::LAUNCHER_EMPTY_AUTORELOAD:
            statusOkay = false;
            break;
        default:
            statusOkay = true;
            break;
        }

        if (((launcher->mnTargetFlags & 0x0008) != 0) && (weaponData != 0) && (weaponData->minRange_km < 1.0f) &&
            statusOkay)
        {
            launchers.push_back(n);
        }
    }
}

void PointDefense::GetPointDefenseTargets(std::vector<tcSensorMapTrack>& targets, tcPlatformInterface& platformInterface)
{
    const float maxRange_km = 12.0f;
    tcTrackList trackList = platformInterface.GetTrackListValidROE(0x0060, maxRange_km);
    for (size_t n=0; n<trackList.track.size(); n++)
    {
        tcSensorMapTrack& track = trackList.track[n];
        double staleness_s = track.mfTimestamp - track.GetLastReportTime();
        bool valid = (!track.IsDestroyed()) && (staleness_s < 15.0f);
        if (valid)
        {
            targets.push_back(track);
        }
    }
}

void PointDefense::Update(double t)
{
    if (!IsReadyForUpdate(t)) return;

    // return if conn is locked by another higher priority task
    //if (!Write("ConnLock", "")) return;

    if (platform == 0)
    {
        wxASSERT(false);
        return;
    }
    tcPlatformInterface platformInterface = GetPlatformInterface();

    std::vector<tcSensorMapTrack> targets;
    GetPointDefenseTargets(targets, platformInterface);

    if (targets.size() == 0)
    {
        SetUpdateInterval(10.0f);
        return;
    }
    else
    {
        SetUpdateInterval(2.0f);
    }

    std::vector<unsigned int> launchers;
    GetPointDefenseLaunchers(launchers);

    for (size_t n=0; n<launchers.size(); n++)
    {
        unsigned int launcher_idx = launchers[n];

        size_t nTargets = targets.size();
        size_t random_offset = rand() % nTargets;
        bool lookingForTarget = true;
        for (size_t k=0; (k<nTargets) && lookingForTarget; k++)
        {
            size_t target_idx = (k + random_offset) % nTargets;
            long targetId = targets[target_idx].mnID;
            platform->DesignateLauncherTarget(targetId, launcher_idx);

            GeoPoint p(targets[target_idx].mfLon_rad, targets[target_idx].mfLat_rad, targets[target_idx].mfAlt_m);
            platform->DesignateLauncherDatum(p, launcher_idx);

            tcLauncher* launcher = platform->GetLauncher(launcher_idx);
            launcher->UpdateStatus();
            unsigned char launcherStatus = launcher->GetStatus();
            if (launcherStatus == tcLauncher::LAUNCHER_READY)
            {
                lookingForTarget = false;
                platform->SetLaunch(launcher_idx, 8);
            }
        }
    }

    FinishUpdate(t);
}

PointDefense::PointDefense(tcPlatformObject* platform_, Blackboard* bb,
                                   long id_, double priority_, int attributes_, const std::string& taskName_)
: Task(platform_, bb, id_, priority_, attributes_, taskName_)
{
    wxASSERT(platform);
}

PointDefense::~PointDefense()
{
}


text:
require 'queryitis'

response = Queryitis::Query.query_by_name("American Bullfrog")

response.each do |entry|
  puts entry
end


text:
describe API do
  include ApiSpecHelper
  include_context 'default_api_settings'

  describe 'AuditAPI' do
    before { audit }

    describe 'GET /audits' do
      let(:method) { 'get' }
      let(:url) { '/api/v1/audits' }
      let(:result) { format_iso8601([audit]) }

      context 'not_logged_in' do
        it_behaves_like('401 Unauthorized')
      end

      context 'normal_account', normal: true do
        let(:result) { [] }
        it_behaves_like('200 OK')
      end

      context 'administrator', admin: true do
        it_behaves_like('200 OK')
      end

      context 'project_owner', project_owner: true do
        let(:result) { [] }
        it_behaves_like('200 OK')
      end

      context 'project_operator', project_operator: true do
        let(:result) { [] }
        it_behaves_like('200 OK')
      end

      context 'with project' do
        let(:params) { { project_id: system.project.id } }

        context 'not_logged_in' do
          it_behaves_like('401 Unauthorized')
        end

        context 'normal_account', normal: true do
          let(:result) { [] }
          it_behaves_like('200 OK')
        end

        context 'administrator', admin: true do
          it_behaves_like('200 OK')
        end

        context 'project_owner', project_owner: true do
          let(:result) { [] }
          it_behaves_like('200 OK')
        end

        context 'project_operator', project_operator: true do
          let(:result) { [] }
          it_behaves_like('200 OK')
        end

        context 'in not exists project_id' do
          let(:params) { { project_id: 9999 } }
          let(:result) { [] }

          context 'not_logged_in' do
            it_behaves_like('401 Unauthorized')
          end

          context 'normal_account', normal: true do
            it_behaves_like('200 OK')
          end

          context 'administrator', admin: true do
            it_behaves_like('200 OK')
          end

          context 'project_owner', project_owner: true do
            it_behaves_like('200 OK')
          end

          context 'project_operator', project_operator: true do
            it_behaves_like('200 OK')
          end
        end
      end
    end
  end
end


text:
class UNIX_ContainedTransformFixture :
	public CIMFixtureBase
{
public:
	UNIX_ContainedTransformFixture();
	~UNIX_ContainedTransformFixture();
	virtual void Run();

};


text:
<?php

class VFS_smb extends VFS {

    /**
     * List of additional credentials required for this VFS backend.
     *
     * @var array
     */
    var $_credentials = array('username', 'password');

    /**
     * List of permissions and if they can be changed in this VFS backend.
     *
     * @var array
     */
    var $_permissions = array(
        'owner' => array('read' => false, 'write' => false, 'execute' => false),
        'group' => array('read' => false, 'write' => false, 'execute' => false),
        'all'   => array('read' => false, 'write' => false, 'execute' => false));

    /**
     * Authenticates a user on the SMB server and share.
     *
     * @access private
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function _connect()
    {
        $cmd = array('quit');
        $err = $this->_command('', $cmd);
        if (is_a($err, 'PEAR_Error')) {
            return PEAR::raiseError(_("Authentication to the SMB server failed."));
        }
        return true;
    }

    /**
     * Retrieves a file from the VFS.
     *
     * @param string $path  The pathname to the file.
     * @param string $name  The filename to retrieve.
     *
     * @return string  The file data.
     */
    function read($path, $name)
    {
        $file = $this->readFile($path, $name);
        if (is_a($file, 'PEAR_Error')) {
            return $file;
        }

        $size = filesize($file);
        if ($size === 0) {
            return '';
        }

        return file_get_contents($file);
    }

    /**
     * Retrieves a file from the VFS as an on-disk local file.
     *
     * This function provides a file on local disk with the data of a VFS file
     * in it. This file cannot be modified! The behavior if you do
     * modify it is undefined. It will be removed at the end of the request.
     *
     * @param string $path  The pathname to the file.
     * @param string $name  The filename to retrieve.
     *
     * @return string A local filename.
     */
    function readFile($path, $name)
    {
        // Create a temporary file and register it for deletion at the
        // end of this request.
        $localFile = $this->_getTempFile();
        if (!$localFile) {
            return PEAR::raiseError(_("Unable to create temporary file."));
        }
        register_shutdown_function(create_function('', 'unlink(\'' . addslashes($localFile) . '\');'));

        list($path, $name) = $this->_escapeShellCommand($path, $name);
        $cmd = array('get \"' . $name . '\" ' . $localFile);
        $result = $this->_command($path, $cmd);
        if (is_a($result, 'PEAR_Error')) {
            return $result;
        }
        if (!file_exists($localFile)) {
            return PEAR::raiseError(sprintf(_("Unable to open VFS file \"%s\"."), $this->_getPath($path, $name)));
        }

        return $localFile;
    }

    /**
     * Open a stream to a file in the VFS.
     *
     * @param string $path  The pathname to the file.
     * @param string $name  The filename to retrieve.
     *
     * @return resource  The stream.
     */
    function readStream($path, $name)
    {
        $file = $this->readFile($path, $name);
        if (is_a($file, 'PEAR_Error')) {
            return $file;
        }

        $mode = OS_WINDOWS ? 'rb' : 'r';
        return fopen($file, $mode);
    }

    /**
     * Stores a file in the VFS.
     *
     * @param string $path         The path to store the file in.
     * @param string $name         The filename to use.
     * @param string $tmpFile      The temporary file containing the data to be
     *                             stored.
     * @param boolean $autocreate  Automatically create directories?
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function write($path, $name, $tmpFile, $autocreate = false)
    {
        // Double quotes not allowed in SMB filename.
        $name = str_replace('"', "'", $name);

        list($path, $name) = $this->_escapeShellCommand($path, $name);
        $cmd = array('put \"' . $tmpFile . '\" \"' . $name . '\"');
        // do we need to first autocreate the directory?
        if ($autocreate) {
            $result = $this->autocreatePath($path);
            if (is_a($result, 'PEAR_Error')) {
                return $result;
            }
        }
        $err = $this->_command($path, $cmd);
        if (is_a($err, 'PEAR_Error')) {
            return $err;
        }
        return true;
    }

    /**
     * Stores a file in the VFS from raw data.
     *
     * @param string $path         The path to store the file in.
     * @param string $name         The filename to use.
     * @param string $data         The file data.
     * @param boolean $autocreate  Automatically create directories?
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function writeData($path, $name, $data, $autocreate = false)
    {
        $tmpFile = $this->_getTempFile();
        $fp = fopen($tmpFile, 'wb');
        fwrite($fp, $data);
        fclose($fp);
        $result = $this->write($path, $name, $tmpFile, $autocreate);
        unlink($tmpFile);
        return $result;
    }

    /**
     * Deletes a file from the VFS.
     *
     * @param string $path  The path to delete the file from.
     * @param string $name  The filename to use.
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function deleteFile($path, $name)
    {
        // In some samba versions after samba-3.0.25-pre2, $path must
        // end in a trailing slash.
        if (substr($path, -1) != '/') {
            $path .= '/';
        }

        list($path, $name) = $this->_escapeShellCommand($path, $name);
        $cmd = array('del \"' . $name . '\"');
        $err = $this->_command($path, $cmd);
        if (is_a($err, 'PEAR_Error')) {
            return $err;
        }
        return true;
    }

    /**
     * Checks if a given pathname is a folder.
     *
     * @param string $path  The path to the folder.
     * @param string $name  The file or folder name.
     *
     * @return boolean  True if it is a folder, false otherwise.
     */
    function isFolder($path, $name)
    {
        list($path, $name) = $this->_escapeShellCommand($path, $name);
        $cmd = array('quit');
        $err = $this->_command($this->_getPath($path, $name), $cmd);
        if (is_a($err, 'PEAR_Error')) {
            return false;
        }
        return true;
    }

    /**
     * Deletes a folder from the VFS.
     *
     * @param string $path        The path to delete the folder from.
     * @param string $name        The name of the folder to delete.
     * @param boolean $recursive  Force a recursive delete?
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function deleteFolder($path, $name, $recursive = false)
    {
        // In some samba versions after samba-3.0.25-pre2, $path must
        // end in a trailing slash.
        if (substr($path, -1) != '/') {
            $path .= '/';
        }

        if (!$this->isFolder($path, $name)) {
            return PEAR::raiseError(sprintf(_("\"%s\" is not a directory."), $path . '/' . $name));
        }

        $file_list = $this->listFolder($this->_getPath($path, $name));
        if (is_a($file_list, 'PEAR_Error')) {
            return $file_list;
        }

        if ($file_list && !$recursive) {
            return PEAR::raiseError(sprintf(_("Unable to delete \"%s\", the directory is not empty."),
                                            $this->_getPath($path, $name)));
        }

        foreach ($file_list as $file) {
            if ($file['type'] == '**dir') {
                $result = $this->deleteFolder($this->_getPath($path, $name), $file['name'], $recursive);
            } else {
                $result = $this->deleteFile($this->_getPath($path, $name), $file['name']);
            }
            if (is_a($result, 'PEAR_Error')) {
                return $result;
            }
        }

        // Really delete the folder.
        list($path, $name) = $this->_escapeShellCommand($path, $name);
        $cmd = array('rmdir \"' . $name . '\"');
        $err = $this->_command($path, $cmd);
        if (is_a($err, 'PEAR_Error')) {
            return PEAR::raiseError(sprintf(_("Unable to delete VFS folder \"%s\"."), $this->_getPath($path, $name)));
        } else {
            return true;
        }
    }

    /**
     * Renames a file in the VFS.
     *
     * @param string $oldpath  The old path to the file.
     * @param string $oldname  The old filename.
     * @param string $newpath  The new path of the file.
     * @param string $newname  The new filename.
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function rename($oldpath, $oldname, $newpath, $newname)
    {
        if (is_a($result = $this->autocreatePath($newpath), 'PEAR_Error')) {
            return $result;
        }

        // Double quotes not allowed in SMB filename. The '/' character should
        // also be removed from the beginning/end of the names.
        $oldname = str_replace('"', "'", trim($oldname, '/'));
        $newname = str_replace('"', "'", trim($newname, '/'));

        if (empty($oldname)) {
            return PEAR::raiseError(_("Unable to rename VFS file to same name."));
        }

        /* If the path was not empty (i.e. the path is not the root path),
         * then add the trailing '/' character to path. */
        if (!empty($oldpath)) {
            $oldpath .= '/';
        }
        if (!empty($newpath)) {
            $newpath .= '/';
        }

        list($file, $name) = $this->_escapeShellCommand($oldname, $newname);
        $cmd = array('rename \"' .  str_replace('/', '\\\\', $oldpath) . $file . '\" \"' .
                                    str_replace('/', '\\\\', $newpath) . $name . '\"');
        if (is_a($err = $this->_command('', $cmd), 'PEAR_Error')) {
            return PEAR::raiseError(sprintf(_("Unable to rename VFS file \"%s\"."), $this->_getPath($path, $name)));
        }

        return true;
    }

    /**
     * Creates a folder on the VFS.
     *
     * @param string $path  The path of directory to create folder.
     * @param string $name  The name of the new folder.
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function createFolder($path, $name)
    {
        // In some samba versions after samba-3.0.25-pre2, $path must
        // end in a trailing slash.
        if (substr($path, -1) != '/') {
            $path .= '/';
        }

        // Double quotes not allowed in SMB filename.
        $name = str_replace('"', "'", $name);

        list($dir, $mkdir) = $this->_escapeShellCommand($path, $name);
        $cmd = array('mkdir \"' . $mkdir . '\"');
        $err = $this->_command($dir, $cmd);
        if (is_a($err, 'PEAR_Error')) {
            return PEAR::raiseError(sprintf(_("Unable to create VFS folder \"%s\"."), $this->_getPath($path, $name)));
        }
        return true;
    }

    /**
     * Returns an unsorted file list.
     *
     * @param string $path       The path of the directory to get the file list
     *                           for.
     * @param mixed $filter      Hash of items to filter based on filename.
     * @param boolean $dotfiles  Show dotfiles? This is irrelevant with
     *                           smbclient.
     * @param boolean $dironly   Show directories only?
     *
     * @return boolean|PEAR_Error  File list on success or a PEAR_Error on
     *                             failure.
     */
    function listFolder($path = '', $filter = null, $dotfiles = true, $dironly = false)
    {
        list($path) = $this->_escapeShellCommand($path);
        $cmd = array('ls');
        $res = $this->_command($path, $cmd);
        if (is_a($res, 'PEAR_Error')) {
            return $res;
        }
        $num_lines = count($res);
        $files = array();
        for ($r = 0; $r < $num_lines; $r++) {
            // Match file listing.
            if (preg_match('/^(\s\s.+\s{6,})/', $res[$r])) {
                // Split into columns at every six spaces
                $split1 = preg_split('/\s{6,}/', trim($res[$r]));
                // If the file name isn't . or ..
                if ($split1[0] != '.' && $split1[0] != '..') {
                    if (isset($split1[2])) {
                        // If there is a small file size, inf could be split
                        // into 3 cols.
                        $split1[1] .= ' ' . $split1[2];
                    }
                    // Split file inf at every one or more spaces.
                    $split2 = preg_split('/\s+/', $split1[1]);
                    if (is_numeric($split2[0])) {
                        // If there is no file attr, shift cols over.
                        array_unshift($split2, '');
                    }
                    $my_name = $split1[0];

                    // Filter out dotfiles if they aren't wanted.
                    if (!$dotfiles && substr($my_name, 0, 1) == '.') {
                        continue;
                    }

                    $my_size = $split2[1];
                    $ext_name = explode('.', $my_name);

                    if ((strpos($split2[0], 'D') !== false)) {
                        $my_type = '**dir';
                        $my_size = -1;
                    } else {
                        $my_type = VFS::strtolower($ext_name[count($ext_name) - 1]);
                    }
                    $my_date = strtotime($split2[4] . ' ' . $split2[3] . ' ' .
                                         $split2[6] . ' ' . $split2[5]);
                    $filedata = array('owner' => '',
                                      'group' => '',
                                      'perms' => '',
                                      'name' => $my_name,
                                      'type' => $my_type,
                                      'date' => $my_date,
                                      'size' => $my_size);
                    // watch for filters and dironly
                    if ($this->_filterMatch($filter, $my_name)) {
                        unset($file);
                        continue;
                    }
                    if ($dironly && $my_type !== '**dir') {
                        unset($file);
                        continue;
                    }

                    $files[$filedata['name']] = $filedata;
                }
            }
        }
        return $files;
    }

    /**
     * Returns a sorted list of folders in specified directory.
     *
     * @param string $path         The path of the directory to get the
     *                             directory list for.
     * @param mixed $filter        Hash of items to filter based on folderlist.
     * @param boolean $dotfolders  Include dotfolders? Irrelevant for SMB.
     *
     * @return boolean|PEAR_Error  Folder list on success or a PEAR_Error on
     *                             failure.
     */
    function listFolders($path = '', $filter = null, $dotfolders = true)
    {
        $folders = array();
        $folder = array();

        $folderList = $this->listFolder($path, null, $dotfolders, true);
        if (is_a($folderList, 'PEAR_Error')) {
            return $folderList;
        }

        // dirname will strip last component from path, even on a directory
        $folder['val'] = dirname($path);
        $folder['abbrev'] = '..';
        $folder['label'] = '..';

        $folders[$folder['val']] = $folder;

        foreach ($folderList as $files) {
            $folder['val'] = $this->_getPath($path, $files['name']);
            $folder['abbrev'] = $files['name'];
            $folder['label'] = $folder['val'];

            $folders[$folder['val']] = $folder;
        }

        ksort($folders);
        return $folders;
    }

    /**
     * Copies a file through the backend.
     *
     * @param string $path         The path to store the file in.
     * @param string $name         The filename to use.
     * @param string $dest         The destination of the file.
     * @param boolean $autocreate  Automatically create directories?
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function copy($path, $name, $dest, $autocreate = false)
    {
        $orig = $this->_getPath($path, $name);
        if (preg_match('|^' . preg_quote($orig) . '/?$|', $dest)) {
            return PEAR::raiseError(_("Cannot copy file(s) - source and destination are the same."));
        }

        if ($autocreate) {
            $result = $this->autocreatePath($dest);
            if (is_a($result, 'PEAR_Error')) {
                return $result;
            }
        }

        $fileCheck = $this->listFolder($dest, null, true);
        if (is_a($fileCheck, 'PEAR_Error')) {
            return $fileCheck;
        }
        foreach ($fileCheck as $file) {
            if ($file['name'] == $name) {
                return PEAR::raiseError(sprintf(_("%s already exists."),
                                                $this->_getPath($dest, $name)));
            }
        }

        if ($this->isFolder($path, $name)) {
            if (is_a($result = $this->_copyRecursive($path, $name, $dest), 'PEAR_Error')) {
                return $result;
            }
        } else {
            $tmpFile = $this->readFile($path, $name);
            if (is_a($tmpFile, 'PEAR_Error')) {
                return PEAR::raiseError(sprintf(_("Failed to retrieve: %s"), $orig));
            }

            $result = $this->write($dest, $name, $tmpFile);
            if (is_a($result, 'PEAR_Error')) {
                return PEAR::raiseError(sprintf(_("Copy failed: %s"),
                                                $this->_getPath($dest, $name)));
            }
        }

        return true;
    }

    /**
     * Moves a file through the backend.
     *
     * @param string $path         The path to store the file in.
     * @param string $name         The filename to use.
     * @param string $dest         The destination of the file.
     * @param boolean $autocreate  Automatically create directories?
     *
     * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
     */
    function move($path, $name, $dest, $autocreate = false)
    {
        $orig = $this->_getPath($path, $name);
        if (preg_match('|^' . preg_quote($orig) . '/?$|', $dest)) {
            return PEAR::raiseError(_("Cannot move file(s) - destination is within source."));
        }

        if ($autocreate) {
            $result = $this->autocreatePath($dest);
            if (is_a($result, 'PEAR_Error')) {
                return $result;
            }
        }

        $fileCheck = $this->listFolder($dest, null, true);
        if (is_a($fileCheck, 'PEAR_Error')) {
            return $fileCheck;
        }
        foreach ($fileCheck as $file) {
            if ($file['name'] == $name) {
                return PEAR::raiseError(sprintf(_("%s already exists."),
                                                $this->_getPath($dest, $name)));
            }
        }

        $err = $this->rename($path, $name, $dest, $name);
        if (is_a($err, 'PEAR_Error')) {
            return PEAR::raiseError(sprintf(_("Failed to move to \"%s\"."),
                                            $this->_getPath($dest, $name)));
        }
        return true;
    }

    /**
     * Replacement for escapeshellcmd(), variable length args, as we only want
     * certain characters escaped.
     *
     * @access private
     *
     * @param array $array  Strings to escape.
     *
     * @return array
     */
    function _escapeShellCommand()
    {
        $ret = array();
        $args = func_get_args();
        foreach ($args as $arg) {
            $ret[] = str_replace(array(';', '\\'), array('\;', '\\\\'), $arg);
        }
        return $ret;
    }

    /**
     * Executes a command and returns output lines in array.
     *
     * @access private
     *
     * @param string $cmd  Command to be executed
     *
     * @return mixed  Array on success, false on failure.
     */
    function _execute($cmd)
    {
        $cmd = str_replace('"-U%"', '-N', $cmd);
        exec($cmd, $out, $ret);

        // In some cases, (like trying to delete a nonexistant file),
        // smbclient will return success (at least on 2.2.7 version I'm
        // testing on). So try to match error strings, even after success.
        if ($ret != 0) {
            $err = '';
            foreach ($out as $line) {
                if (strpos($line, 'Usage:') === 0) {
                    $err = 'Command syntax incorrect';
                    break;
                }
                if (strpos($line, 'ERRSRV') !== false ||
                    strpos($line, 'ERRDOS') !== false) {
                    $err = preg_replace('/.*\((.+)\).*/', '\\1', $line);
                    if (!$err) {
                        $err = $line;
                    }
                    break;
                }
            }
            if (!$err) {
                $err = $out ? $out[count($out) - 1] : $ret;
            }
            return PEAR::raiseError($err);
        }

        // Check for errors even on success.
        $err = '';
        foreach ($out as $line) {
            if (strpos($line, 'NT_STATUS_NO_SUCH_FILE') !== false ||
                strpos($line, 'NT_STATUS_OBJECT_NAME_NOT_FOUND') !== false) {
                $err = _("No such file");
                break;
            } elseif (strpos($line, 'NT_STATUS_ACCESS_DENIED') !== false) {
                $err = _("Permission Denied");
                break;
            }
        }

        if ($err) {
            return PEAR::raiseError($err);
        }

        return $out;
    }

    /**
     * Executes SMB commands - without authentication - and returns output
     * lines in array.
     *
     * @access private
     *
     * @param array $path  Base path for command.
     * @param array $cmd   Commands to be executed.
     *
     * @return mixed  Array on success, false on failure.
     */
    function _command($path, $cmd)
    {
        list($share) = $this->_escapeShellCommand($this->_params['share']);
        putenv('PASSWD=' . $this->_params['password']);
        $ipoption = (isset($this->_params['ipaddress'])) ? (' -I ' . $this->_params['ipaddress']) : null;
        $fullcmd = $this->_params['smbclient'] .
            ' "//' . $this->_params['hostspec'] . '/' . $share . '"' .
            ' "-p' . $this->_params['port'] . '"' .
            ' "-U' . $this->_params['username'] . '"' .
            ' -D "' . $path . '" ' .
            $ipoption .
            ' -c "';
        foreach ($cmd as $c) {
            $fullcmd .= $c . ";";
        }
        $fullcmd .= '"';
        return $this->_execute($fullcmd);
    }

}


text:
/**
 * Content script: runs in a sandbox and is the only one to interact with the page and its DOM
 * Used to get and set content
 */

/* Listens for any messages incoming from background script or popup page
 * @msg: incoming message
 * @sender: tab who sent the message, in case the sender was another content script
 * @sendResponse: function to send a response back
 */
chrome.runtime.onMessage.addListener(function(msg, sender, sendResponse) {
  if (msg.text && (msg.text == "get_panel")) {

    // Gets the status of the panel and sends it back
    isPanel = ( document.getElementById('sidebarPanel') ? true : false );
    sendResponse({ text: isPanel});
  }
  else if (msg.text && (msg.text == "open_panel")) {
    /*TODO:
     * - Rename variables
     * - convert to jQuery
     * - reorder CSS
     * - module it
     */

    // Gets the url of the active page and gets the domain from it
    var matches = msg.tab.url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
    var domain = matches && matches[1];

    // Create the iFrame element and appends it to the body of the page
    var newPanel = document.createElement('iframe');
    newPanel.setAttribute('id','sidebarPanel');
    newPanel.setAttribute('src',  chrome.extension.getURL('../sidebar-angular.html') + '#' + domain);
    newPanel.setAttribute("style",
     "z-index: 9999;" +
     "overflow-x: hidden;" +
     "position:fixed;" +
     "top:0;" +
     "right:-25%;" +
     "width:25%;" +
     "border: none;" +
     "-webkit-box-shadow: -4px 0px 7px 0px rgba(0,0,0,0.33);" +
     "-moz-box-shadow: -4px 0px 7px 0px rgba(0,0,0,0.33);" +
     "box-shadow: -4px 0px 7px 0px rgba(0,0,0,0.33);" +
     "height:100%;");
    //newPanel.setAttribute("scrolling", "no");

    /*document.body.appendChild(newPanel);
    sidebarElement = $('#sidebarPanel');
    sidebarElement.animate({right: 0},50);*/
    $('body').append(newPanel);
    sidebarElement = $('#sidebarPanel');
    sidebarElement.animate({right: 0},50);

  }

  else if (msg.text && (msg.text == "close_panel")) {
    if (sidebarElement.css('right') == '0px'){
      sidebarElement.animate({right: "-25%"},50,function(){
        sidebarElement.remove();
      });
    } else {
      sidebarElement.animate({right: 0},50);
    }
  }
});

// assign a document listener
$(document).click(function(e){
  if( $(e.target) != $('#sidebarPanel') ){
    sidebarElement.animate({right: "-25%"},50);
  }
});


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title><?php echo config_item('admin_page_title'); ?></title>
	<link href="<?php echo config_item('base_url'); ?>assets/css/bootstrap.min.css" rel="stylesheet">
	<link href="<?php echo config_item('base_url'); ?>assets/css/font-awesome.css" rel="stylesheet">
	<link href="<?php echo config_item('base_url'); ?>assets/css/animate.css" rel="stylesheet">
	<link href="<?php echo config_item('base_url'); ?>assets/css/style.css" rel="stylesheet">
	<link href="<?php echo config_item('base_url'); ?>assets/css/awesome-bootstrap-checkbox.css" rel="stylesheet">
	<link href="<?php echo config_item('base_url'); ?>assets/css/datatables.min.css" rel="stylesheet">
	<link href="<?php echo config_item('base_url'); ?>assets/css/switchery.css" rel="stylesheet">

        <?php $this->load->view('include/inc_navigation'); ?>

                <?php $this->load->view('include/inc_topnav'); ?>

Hide

                <?php $this->load->view('include/inc_sidebar'); ?>

Home

                                  <?php echo validation_errors(); ?>

							<?php echo form_open('', array('class' => 'form-horizontal')); ?>

												<input type="text" name="res_name" class="form-control fnt12" placeholder="Establishment Name" id="res_name">

											 <input type="submit" class="btn btn-primary" value="Filter" />

                                           <?php echo form_close(); ?>

									S No

									Time & Date
                                    Establishment Name
                                    Payment Method

									Order Id
									Accepted
									Customer Name

                               <?php
								 if (count ($order['orders']) > 0)
									  {
										 foreach ($order['orders'] as $ordata)
											   {

								if(count($order['estab'])>0)
								{
									 //echo $data->{'estabname'};
								?>

                                      <?php
									 $i = 0;
							foreach ($order['estab'] as $data)
											   {
												 foreach($data as $getdata)
												 {

												 switch($getdata->{'payment_method'}){
													   case 1 :
													    $paymnt_method = "Credit Purchase";
													   break;
													   case 2 :
													    $paymnt_method = "COD";
													   break;
													   case 3 :
													   $paymnt_method = "Payu";
													   break;
												   }

												   switch($getdata->{'status'}){
													   case 1 :
													    $status = "In Preparation";
													   break;
													   case 2 :
													    $status = "In Priority";
													   break;
													   case 3 :
													   $status = "Completed";
													   break;
													    case 4 :
													    $status = "Cancelled";
													   break;
													   case 5 :
													    $status = "Threshold";
													   break;

												   }
												  $i++;
												   if($ordata->{'estabid'}==$getdata->{'establishment_id'})
												   {

							                           echo '

												            '.$i.'

														'.date('h:i A, M d Y', $getdata->order_time).'
														'.$ordata->{'estabname'}.'
														'.$paymnt_method.'
														{'order_id'}.'">'.$getdata->{'order_id'}.'
													    '. $status.'	';

														foreach ($order['cust_name'] as $data)
											   {
												 foreach($data as $getdata)
												 {

														echo ''.$getdata->{'name'}.'	';

												 }

											   }
												   }
							   }
											   }

												   }
											    else
									   {
										           echo '

												            No Data.
												            <input type="checkbox" class="js-switch" checked />
												            <button class="btn btn-primary"> </button> <button class="btn btn-danger"> </button>

';

								/**/
							?>

                                <?php }  }
									  } ?>

				 <?php $this->load->view('include/inc_footer'); ?>


text:
#ifndef __MATCHPOINT_BROWSER_PREFERENCE_PAGE_H
#define __MATCHPOINT_BROWSER_PREFERENCE_PAGE_H

#include "berryIQtPreferencePage.h"

class QWidget;
class QCheckBox;
class QComboBox;
class QSpinBox;
class QmitkDirectoryListWidget;
class QmitkFileListWidget;
class ctkDirectoryButton;

class berryIPreferences;

/**
 * \class MatchPointBrowserPreferencesPage
 * \brief Preference page for the MatchPoint Browser plugin
 */
class MatchPointBrowserPreferencesPage : public QObject, public berry::IQtPreferencePage
{
    Q_OBJECT
        Q_INTERFACES(berry::IPreferencePage)

public:
    MatchPointBrowserPreferencesPage();
    ~MatchPointBrowserPreferencesPage();

    /**
     * \brief Called by framework to initialise this preference page, but currently does nothing.
     * \param workbench The workbench.
     */
    void Init(berry::IWorkbench::Pointer workbench);

    /**
     * \brief Called by framework to create the GUI, and connect signals and slots.
     * \param widget The Qt widget that acts as parent to all GUI components, as this class itself is not derived from QWidget.
     */
    void CreateQtControl(QWidget* widget);

    /**
     * \brief Required by framework to get hold of the GUI.
     * \return QWidget* the top most QWidget for the GUI.
     */
    QWidget* GetQtControl() const;

    /**
     * \see IPreferencePage::PerformOk
     */
    virtual bool PerformOk();

    /**
     * \see IPreferencePage::PerformCancel
     */
    virtual void PerformCancel();

    /**
     * \see IPreferencePage::Update
     */
    virtual void Update();

    public slots:

protected:

    QWidget*                  m_MainControl;
    QCheckBox*                m_DebugOutput;
    QmitkDirectoryListWidget* m_AlgDirectories;
    QmitkFileListWidget*      m_AlgFiles;
    QCheckBox*                m_LoadFromHomeDir;
    QCheckBox*                m_LoadFromCurrentDir;
    QCheckBox*                m_LoadFromApplicationDir;
    QCheckBox*                m_LoadFromAutoLoadPathDir;

    berry::IPreferences::Pointer m_BrowserPreferencesNode;

private:

    QString ConvertToString(const QStringList& list);
};

#endif // COMMANDLINEMODULESPREFERENCESPAGE_H


text:
using System;
using System.Collections.Generic;
using System.IO;

/*  Write a program that reads a text file containing a list of strings, sorts them and saves them to another text file.

    Example:
    input.txt 	output.txt
    Ivan        George
    Peter       Ivan
    Maria       Maria
    George 	    Peter
*/

class SaveSortedNames
{
    static void Main()
    {
        //file is in 'bin/Debug' directory of the project
        using (StreamReader unsorted = new StreamReader("unsorted.txt"))
        {
            List<string> names = new List<string>();
            for (string currName = unsorted.ReadLine(); currName != null; currName = unsorted.ReadLine())
            {
                names.Add(currName);
            }
            names.Sort();
            using (StreamWriter sorted = new StreamWriter("sorted.txt"))
            {
                foreach (string name in names)
                {
                    sorted.WriteLine(name);
                }
            }
        }
        Console.WriteLine("Names are sorted!");
    }
}


text:
OPT and H1B Forms

Step1: fill out G1145 form and I765 form
G1145 form let you know you got permission
I765 form is mainly about OPT application

Step2: take a photo and copy your visa or passport relavant pages

Application Materials:

1. Check of $380 to "US Department of Homeland Security"
2. [G-1145](https://www.uscis.gov/sites/default/files/files/form/g-1145.pdf) Form
3. Two passport photos
4. [I-765](https://www.uscis.gov/sites/default/files/files/form/i-765.pdf) Form
5. Copy of new I20
6. Copy of 2 old I20 (if you intern in the US)
7. Copy of I94
8. Copy of first page of passport


text:
from m5.params import *
from m5.SimObject import SimObject
from m5.proxy import *

# Abstract clock domain
class ClockDomain(SimObject):
    type = 'ClockDomain'
    cxx_header = "sim/clock_domain.hh"
    abstract = True

# Source clock domain with an actual clock
class SrcClockDomain(ClockDomain):
    type = 'SrcClockDomain'
    cxx_header = "sim/clock_domain.hh"
    clock = Param.Clock("Clock period")

    # A source clock must be associated with a voltage domain
    voltage_domain = Param.VoltageDomain("Voltage domain")

# Derived clock domain with a parent clock domain and a frequency
# divider
class DerivedClockDomain(ClockDomain):
    type = 'DerivedClockDomain'
    cxx_header = "sim/clock_domain.hh"
    clk_domain = Param.ClockDomain("Parent clock domain")
    clk_divider = Param.Unsigned(1, "Frequency divider")


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

<title>By.ByXPath</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.openqa.selenium

Class By.ByXPath

java.lang.Object

org.openqa.selenium.By

org.openqa.selenium.By.ByXPath

All Implemented Interfaces:

java.io.Serializable

Enclosing class:

By

public static class By.ByXPath
extends By
implements java.io.Serializable

See Also:

Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.openqa.selenium.By

By.ByClassName, By.ByCssSelector, By.ById, By.ByLinkText, By.ByName, By.ByPartialLinkText, By.ByTagName, By.ByXPath

Constructor Summary

Constructors

Constructor and Description

ByXPath(java.lang.String xpathExpression)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

WebElement
findElement(SearchContext context)

Find a single element.

java.util.List<WebElement>
findElements(SearchContext context)

Find many elements.

java.lang.String
toString()

Methods inherited from class org.openqa.selenium.By

className, cssSelector, equals, hashCode, id, linkText, name, partialLinkText, tagName, xpath

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ByXPath

public ByXPath(java.lang.String xpathExpression)

Method Detail

findElements

public java.util.List<WebElement> findElements(SearchContext context)

Description copied from class: By

Find many elements.

Specified by:

findElements in class By

Parameters:

context - A context to use to find the element

Returns:

A list of WebElements matching the selector

findElement

public WebElement findElement(SearchContext context)

Description copied from class: By

Find a single element. Override this method if necessary.

Overrides:

findElement in class By

Parameters:

context - A context to use to find the element

Returns:

The WebElement that matches the selector

toString

public java.lang.String toString()

Overrides:

toString in class By

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method