text:
sfThemePlugin
=============

This plugin allows for themes to be used with your symfony project. A
theme is a very simple idea and consists of:

 * a layout
 * a collection of stylesheets
 * a collection of javascripts

By defining several themes, you can:

 * Have different themes on an action-by-action, module-by-module, or even
   route-by-route basis.

 * Easily change the entire look of your site for promotional or seasonal reasons

 * Switch between themes on the fly using the web debug toolbar

Using the plugin couldn't be easier and consists of two steps

 * Create a theme or themes
 * Set each theme globally or exactly where you need it

Installation
------------

With git:

    git submodule add git://github.com/weaverryan/sfThemePlugin.git plugins/sfThemePlugin
    git submodule init
    git submodule update

With subversion

    svn propedit svn:externals plugins

    // In the editor, add the following entry and then save
    sfThemePlugin https://svn.github.com/weaverryan/sfThemePlugin.git

    svn up

In your `config/ProjectConfiguration.class.php` file, make sure you have
the plugin enabled.

    $this->enablePlugins('sfThemePlugin');

Finally, run the `publish:assets` task which will create a symbolic link
from the plugin into your web directory:

    ./symfony plugin:publish-assets

Creating themes
---------------

As mentioned, a theme consists of a layout, stylesheets, and javascript.
To create a theme, simply define each of these in `app.yml`:

    all:
      theme:
        themes:
          new_design:
            layout:       new_design
            stylesheets:  [main, print: { media: print }]
            javascripts:  []

The layout can exist in the `templates` directory of your application or in
the `templates` directory of any plugin. This means that your entire
theme can live inside a plugin and be repackaged for other projects.

A few other, optional, configuration variables exist for a theme. See the
`config/app.yml` packaged with the plugin for full examples.

Setting Themes
--------------

Once you've created a theme or themes, you'll want to instruct your application
to use those themes. By default, the plugin won't start using themes until
you tell it to. So, you can apply theming selectively without affecting
the rest of your application.

Themes can be attached in many different ways:

### Using a global theme

Very commonly, you'll want to use one theme for your entire application.
This basically replaces the use of `view.yml` to define the layout,
stylesheets, and javascripts for your application. Defining a default
theme is easy:

    all:
      theme:
        controller_options:
          default_theme:   new_design

By doing this, the `new_design` theme will be used globally in your application.

### Setting a theme in the action

The global default theme can easily be overridden in any action. For example,
suppose that you still need to use the `old_design` theme for a particular action:

    public function executeIndex(sfWebRequest $request)
    {
      // ...

      $this->loadTheme('old_design');
    }

This method is the "strongest" method of setting a theme and will override
all other methods.

### Setting a theme for a module

Alternatively, themes can be set on a module-by-module basis. Once again,
this will override the global default theme. For example, suppose the module
`old_module` should use the theme `old_design`:

    all:
      theme:
        controller_options:
          modules:
            old_module:    old_design

### Setting a theme for a route

You can even set a theme for a paricular route. This means that you could
have the same content served by two different urls, each rendering their
own theme! For example, suppose that you create a route called `homepage_old`,
and you want it to use the `old_design` theme:

    all:
      theme:
        controller_options:
          routes:
            homepage_old:    old_design

### Switching themes based on a url parameter `?sf_theme=`

By default (this can be turned off), you can switch to any available theme
by appending `?sf_theme=theme_name` to the end of any url.

This will set a user attribute so that you can browse your entire site
with this theme. To clar the user attribute, simply append `?sf_theme=clear`
to the end of your url.

### Advanced theming using an event

If you need to be more specific in your theming, you can easily do this
by connecting to the `theme.set_theme_from_request` event. For example,
suppose you want to use a different theme for users with the `fr` culture.
In your application configuration file (`apps/app_name/config/app_nameConfiguration.class.php`):

    public function configure()
    {
      $this->dispatcher->connect(
        'theme.set_theme_from_request',
        array($this, 'listenSetThemeFromRequest')
      );
    }

    public function listenSetThemeFromRequest(sfEvent $event)
    {
      $context = $event['context'];

      if ($context->getUser()->getCulture() == 'fr')
      {
        $event->setReturnValue('fr_theme');

        return true;
      }

      return false;
    }

Web Debug Panel
---------------

This plugin comes with a web debug panel that allows you to see your themes
and switch between them:

![The web debug panel icon](http://github.com/weaverryan/sfThemePlugin/raw/master/docs/debug_toolbar1.png)

![The web debug panel expanded](http://github.com/weaverryan/sfThemePlugin/raw/master/docs/debug_toolbar2.png)

Advanced Options
----------------

The `app.yml` file packaged with the plugin shows several other configuration
options for the plugin. These are documented in the `app.yml` file itself
and won't normally need to be modified.

Testing
-------

In your functional tests, you can easily test so a particular module has
the correct theme. First, notify your `sfTestFunctional` instance of the
theme tester:

    $browser = new sfTestFunctional(new sfBrowser());
    $browser->setTester('theme', 'sfTesterTheme');

To use it, simply do the following:

    $browser->get('/some/url')

    ->with('theme')->begin()
      ->isCurrentTheme('wordpress_default')
    ->end();

The Fine Details
----------------

This plugin was taken from [sympal CMF](http://www.sympalphp.org) and was
developed by both Jon Wage and Ryan Weaver.

If you have questions, comments or anything else, email me at ryan [at] thatsquality.com


text:
overflowserver
==============

Example of stack overflow vulnerable server and exploit which can be used to gain unauthorized access to machine running this server.

Server simulates a multi-user chat server and asks user for a username and after that user can send chat-messages to server.
Server can be exploited using EIP-based stack buffer overflow attack in chat-message.
Server uses winsock2 for networking and should work atleast with Windows XP and Windows 7.

For included exploit to work, DEP&ASLR must be disabled and few variables inside exploit-script must be modified.

Included batch-files require gcc-compiler and included exploit requires python-interpreter.

For instructions, see comments in source-files.

Use of this source code is governed by a MIT-style licence that can be found in the [LICENCE](https://raw.githubusercontent.com/putsi/overflowserver/master/LICENSE)-file.

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

  <meta charset="utf-8">
  <title>harder_better_faster_stronger</title>
  <meta name="description" content="Visualizing Music with Backbone JS">
  <meta name="author" content="Jack C. Viers">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <link href="css/bootstrap.css" rel="stylesheet">

  <link href="css/flat-ui.css" rel="stylesheet">
  <link rel="shortcut icon" href="images/favicon.ico">

  <link rel="stylesheet" href="css/harder_better_faster_stronger.css">


text:
'use strict';

module.exports = {
	IsPropertyDescriptor: 'https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type', // not actually an abstract op

	abs: 'https://262.ecma-international.org/7.0/#sec-algorithm-conventions',
	'Abstract Equality Comparison': 'https://262.ecma-international.org/7.0/#sec-abstract-equality-comparison',
	'Abstract Relational Comparison': 'https://262.ecma-international.org/7.0/#sec-abstract-relational-comparison',
	AddRestrictedFunctionProperties: 'https://262.ecma-international.org/7.0/#sec-addrestrictedfunctionproperties',
	AdvanceStringIndex: 'https://262.ecma-international.org/7.0/#sec-advancestringindex',
	AllocateArrayBuffer: 'https://262.ecma-international.org/7.0/#sec-allocatearraybuffer',
	AllocateTypedArray: 'https://262.ecma-international.org/7.0/#sec-allocatetypedarray',
	AllocateTypedArrayBuffer: 'https://262.ecma-international.org/7.0/#sec-allocatetypedarraybuffer',
	ArrayCreate: 'https://262.ecma-international.org/7.0/#sec-arraycreate',
	ArraySetLength: 'https://262.ecma-international.org/7.0/#sec-arraysetlength',
	ArraySpeciesCreate: 'https://262.ecma-international.org/7.0/#sec-arrayspeciescreate',
	BlockDeclarationInstantiation: 'https://262.ecma-international.org/7.0/#sec-blockdeclarationinstantiation',
	BoundFunctionCreate: 'https://262.ecma-international.org/7.0/#sec-boundfunctioncreate',
	Call: 'https://262.ecma-international.org/7.0/#sec-call',
	Canonicalize: 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-canonicalize-ch',
	CanonicalNumericIndexString: 'https://262.ecma-international.org/7.0/#sec-canonicalnumericindexstring',
	CharacterRange: 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-characterrange-abstract-operation',
	CharacterRangeOrUnion: 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-characterrangeorunion-abstract-operation',
	CharacterSetMatcher: 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-charactersetmatcher-abstract-operation',
	CloneArrayBuffer: 'https://262.ecma-international.org/7.0/#sec-clonearraybuffer',
	CompletePropertyDescriptor: 'https://262.ecma-international.org/7.0/#sec-completepropertydescriptor',
	Completion: 'https://262.ecma-international.org/7.0/#sec-completion-record-specification-type',
	Construct: 'https://262.ecma-international.org/7.0/#sec-construct',
	CopyDataBlockBytes: 'https://262.ecma-international.org/7.0/#sec-copydatablockbytes',
	CreateArrayFromList: 'https://262.ecma-international.org/7.0/#sec-createarrayfromlist',
	CreateArrayIterator: 'https://262.ecma-international.org/7.0/#sec-createarrayiterator',
	CreateBuiltinFunction: 'https://262.ecma-international.org/7.0/#sec-createbuiltinfunction',
	CreateByteDataBlock: 'https://262.ecma-international.org/7.0/#sec-createbytedatablock',
	CreateDataProperty: 'https://262.ecma-international.org/7.0/#sec-createdataproperty',
	CreateDataPropertyOrThrow: 'https://262.ecma-international.org/7.0/#sec-createdatapropertyorthrow',
	CreateDynamicFunction: 'https://262.ecma-international.org/7.0/#sec-createdynamicfunction',
	CreateHTML: 'https://262.ecma-international.org/7.0/#sec-createhtml',
	CreateIntrinsics: 'https://262.ecma-international.org/7.0/#sec-createintrinsics',
	CreateIterResultObject: 'https://262.ecma-international.org/7.0/#sec-createiterresultobject',
	CreateListFromArrayLike: 'https://262.ecma-international.org/7.0/#sec-createlistfromarraylike',
	CreateListIterator: 'https://262.ecma-international.org/7.0/#sec-createlistiterator',
	CreateMapIterator: 'https://262.ecma-international.org/7.0/#sec-createmapiterator',
	CreateMappedArgumentsObject: 'https://262.ecma-international.org/7.0/#sec-createmappedargumentsobject',
	CreateMethodProperty: 'https://262.ecma-international.org/7.0/#sec-createmethodproperty',
	CreatePerIterationEnvironment: 'https://262.ecma-international.org/7.0/#sec-createperiterationenvironment',
	CreateRealm: 'https://262.ecma-international.org/7.0/#sec-createrealm',
	CreateResolvingFunctions: 'https://262.ecma-international.org/7.0/#sec-createresolvingfunctions',
	CreateSetIterator: 'https://262.ecma-international.org/7.0/#sec-createsetiterator',
	CreateStringIterator: 'https://262.ecma-international.org/7.0/#sec-createstringiterator',
	CreateUnmappedArgumentsObject: 'https://262.ecma-international.org/7.0/#sec-createunmappedargumentsobject',
	DateFromTime: 'https://262.ecma-international.org/7.0/#sec-date-number',
	Day: 'https://262.ecma-international.org/7.0/#sec-day-number-and-time-within-day',
	DayFromYear: 'https://262.ecma-international.org/7.0/#sec-year-number',
	DaylightSavingTA: 'https://262.ecma-international.org/7.0/#sec-daylight-saving-time-adjustment',
	DaysInYear: 'https://262.ecma-international.org/7.0/#sec-year-number',
	DayWithinYear: 'https://262.ecma-international.org/7.0/#sec-month-number',
	Decode: 'https://262.ecma-international.org/7.0/#sec-decode',
	DefinePropertyOrThrow: 'https://262.ecma-international.org/7.0/#sec-definepropertyorthrow',
	DeletePropertyOrThrow: 'https://262.ecma-international.org/7.0/#sec-deletepropertyorthrow',
	DetachArrayBuffer: 'https://262.ecma-international.org/7.0/#sec-detacharraybuffer',
	Encode: 'https://262.ecma-international.org/7.0/#sec-encode',
	EnqueueJob: 'https://262.ecma-international.org/7.0/#sec-enqueuejob',
	EnumerableOwnNames: 'https://262.ecma-international.org/7.0/#sec-enumerableownnames',
	EnumerateObjectProperties: 'https://262.ecma-international.org/7.0/#sec-enumerate-object-properties',
	EscapeRegExpPattern: 'https://262.ecma-international.org/7.0/#sec-escaperegexppattern',
	EvalDeclarationInstantiation: 'https://262.ecma-international.org/7.0/#sec-evaldeclarationinstantiation',
	EvaluateCall: 'https://262.ecma-international.org/7.0/#sec-evaluatecall',
	EvaluateDirectCall: 'https://262.ecma-international.org/7.0/#sec-evaluatedirectcall',
	EvaluateNew: 'https://262.ecma-international.org/7.0/#sec-evaluatenew',
	floor: 'https://262.ecma-international.org/7.0/#sec-algorithm-conventions',
	ForBodyEvaluation: 'https://262.ecma-international.org/7.0/#sec-forbodyevaluation',
	'ForIn/OfBodyEvaluation': 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset',
	'ForIn/OfHeadEvaluation': 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind',
	FromPropertyDescriptor: 'https://262.ecma-international.org/7.0/#sec-frompropertydescriptor',
	FulfillPromise: 'https://262.ecma-international.org/7.0/#sec-fulfillpromise',
	FunctionAllocate: 'https://262.ecma-international.org/7.0/#sec-functionallocate',
	FunctionCreate: 'https://262.ecma-international.org/7.0/#sec-functioncreate',
	FunctionDeclarationInstantiation: 'https://262.ecma-international.org/7.0/#sec-functiondeclarationinstantiation',
	FunctionInitialize: 'https://262.ecma-international.org/7.0/#sec-functioninitialize',
	GeneratorFunctionCreate: 'https://262.ecma-international.org/7.0/#sec-generatorfunctioncreate',
	GeneratorResume: 'https://262.ecma-international.org/7.0/#sec-generatorresume',
	GeneratorResumeAbrupt: 'https://262.ecma-international.org/7.0/#sec-generatorresumeabrupt',
	GeneratorStart: 'https://262.ecma-international.org/7.0/#sec-generatorstart',
	GeneratorValidate: 'https://262.ecma-international.org/7.0/#sec-generatorvalidate',
	GeneratorYield: 'https://262.ecma-international.org/7.0/#sec-generatoryield',
	Get: 'https://262.ecma-international.org/7.0/#sec-get-o-p',
	GetActiveScriptOrModule: 'https://262.ecma-international.org/7.0/#sec-getactivescriptormodule',
	GetFunctionRealm: 'https://262.ecma-international.org/7.0/#sec-getfunctionrealm',
	GetGlobalObject: 'https://262.ecma-international.org/7.0/#sec-getglobalobject',
	GetIdentifierReference: 'https://262.ecma-international.org/7.0/#sec-getidentifierreference',
	GetIterator: 'https://262.ecma-international.org/7.0/#sec-getiterator',
	GetMethod: 'https://262.ecma-international.org/7.0/#sec-getmethod',
	GetModuleNamespace: 'https://262.ecma-international.org/7.0/#sec-getmodulenamespace',
	GetNewTarget: 'https://262.ecma-international.org/7.0/#sec-getnewtarget',
	GetOwnPropertyKeys: 'https://262.ecma-international.org/7.0/#sec-getownpropertykeys',
	GetPrototypeFromConstructor: 'https://262.ecma-international.org/7.0/#sec-getprototypefromconstructor',
	GetSubstitution: 'https://262.ecma-international.org/7.0/#sec-getsubstitution',
	GetSuperConstructor: 'https://262.ecma-international.org/7.0/#sec-getsuperconstructor',
	GetTemplateObject: 'https://262.ecma-international.org/7.0/#sec-gettemplateobject',
	GetThisEnvironment: 'https://262.ecma-international.org/7.0/#sec-getthisenvironment',
	GetThisValue: 'https://262.ecma-international.org/7.0/#sec-getthisvalue',
	GetV: 'https://262.ecma-international.org/7.0/#sec-getv',
	GetValue: 'https://262.ecma-international.org/7.0/#sec-getvalue',
	GetValueFromBuffer: 'https://262.ecma-international.org/7.0/#sec-getvaluefrombuffer',
	GetViewValue: 'https://262.ecma-international.org/7.0/#sec-getviewvalue',
	GlobalDeclarationInstantiation: 'https://262.ecma-international.org/7.0/#sec-globaldeclarationinstantiation',
	HasOwnProperty: 'https://262.ecma-international.org/7.0/#sec-hasownproperty',
	HasProperty: 'https://262.ecma-international.org/7.0/#sec-hasproperty',
	HostPromiseRejectionTracker: 'https://262.ecma-international.org/7.0/#sec-host-promise-rejection-tracker',
	HostReportErrors: 'https://262.ecma-international.org/7.0/#sec-host-report-errors',
	HostResolveImportedModule: 'https://262.ecma-international.org/7.0/#sec-hostresolveimportedmodule',
	HourFromTime: 'https://262.ecma-international.org/7.0/#sec-hours-minutes-second-and-milliseconds',
	IfAbruptRejectPromise: 'https://262.ecma-international.org/7.0/#sec-ifabruptrejectpromise',
	ImportedLocalNames: 'https://262.ecma-international.org/7.0/#sec-importedlocalnames',
	InitializeBoundName: 'https://262.ecma-international.org/7.0/#sec-initializeboundname',
	InitializeHostDefinedRealm: 'https://262.ecma-international.org/7.0/#sec-initializehostdefinedrealm',
	InitializeReferencedBinding: 'https://262.ecma-international.org/7.0/#sec-initializereferencedbinding',
	InLeapYear: 'https://262.ecma-international.org/7.0/#sec-year-number',
	InstanceofOperator: 'https://262.ecma-international.org/7.0/#sec-instanceofoperator',
	IntegerIndexedElementGet: 'https://262.ecma-international.org/7.0/#sec-integerindexedelementget',
	IntegerIndexedElementSet: 'https://262.ecma-international.org/7.0/#sec-integerindexedelementset',
	IntegerIndexedObjectCreate: 'https://262.ecma-international.org/7.0/#sec-integerindexedobjectcreate',
	InternalizeJSONProperty: 'https://262.ecma-international.org/7.0/#sec-internalizejsonproperty',
	Invoke: 'https://262.ecma-international.org/7.0/#sec-invoke',
	IsAccessorDescriptor: 'https://262.ecma-international.org/7.0/#sec-isaccessordescriptor',
	IsAnonymousFunctionDefinition: 'https://262.ecma-international.org/7.0/#sec-isanonymousfunctiondefinition',
	IsArray: 'https://262.ecma-international.org/7.0/#sec-isarray',
	IsCallable: 'https://262.ecma-international.org/7.0/#sec-iscallable',
	IsCompatiblePropertyDescriptor: 'https://262.ecma-international.org/7.0/#sec-iscompatiblepropertydescriptor',
	IsConcatSpreadable: 'https://262.ecma-international.org/7.0/#sec-isconcatspreadable',
	IsConstructor: 'https://262.ecma-international.org/7.0/#sec-isconstructor',
	IsDataDescriptor: 'https://262.ecma-international.org/7.0/#sec-isdatadescriptor',
	IsDetachedBuffer: 'https://262.ecma-international.org/7.0/#sec-isdetachedbuffer',
	IsExtensible: 'https://262.ecma-international.org/7.0/#sec-isextensible-o',
	IsGenericDescriptor: 'https://262.ecma-international.org/7.0/#sec-isgenericdescriptor',
	IsInTailPosition: 'https://262.ecma-international.org/7.0/#sec-isintailposition',
	IsInteger: 'https://262.ecma-international.org/7.0/#sec-isinteger',
	IsLabelledFunction: 'https://262.ecma-international.org/7.0/#sec-islabelledfunction',
	IsPromise: 'https://262.ecma-international.org/7.0/#sec-ispromise',
	IsPropertyKey: 'https://262.ecma-international.org/7.0/#sec-ispropertykey',
	IsRegExp: 'https://262.ecma-international.org/7.0/#sec-isregexp',
	IsWordChar: 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-iswordchar-abstract-operation',
	IterableToArrayLike: 'https://262.ecma-international.org/7.0/#sec-iterabletoarraylike',
	IteratorClose: 'https://262.ecma-international.org/7.0/#sec-iteratorclose',
	IteratorComplete: 'https://262.ecma-international.org/7.0/#sec-iteratorcomplete',
	IteratorNext: 'https://262.ecma-international.org/7.0/#sec-iteratornext',
	IteratorStep: 'https://262.ecma-international.org/7.0/#sec-iteratorstep',
	IteratorValue: 'https://262.ecma-international.org/7.0/#sec-iteratorvalue',
	LocalTime: 'https://262.ecma-international.org/7.0/#sec-localtime',
	LoopContinues: 'https://262.ecma-international.org/7.0/#sec-loopcontinues',
	MakeArgGetter: 'https://262.ecma-international.org/7.0/#sec-makearggetter',
	MakeArgSetter: 'https://262.ecma-international.org/7.0/#sec-makeargsetter',
	MakeClassConstructor: 'https://262.ecma-international.org/7.0/#sec-makeclassconstructor',
	MakeConstructor: 'https://262.ecma-international.org/7.0/#sec-makeconstructor',
	MakeDate: 'https://262.ecma-international.org/7.0/#sec-makedate',
	MakeDay: 'https://262.ecma-international.org/7.0/#sec-makeday',
	MakeMethod: 'https://262.ecma-international.org/7.0/#sec-makemethod',
	MakeSuperPropertyReference: 'https://262.ecma-international.org/7.0/#sec-makesuperpropertyreference',
	MakeTime: 'https://262.ecma-international.org/7.0/#sec-maketime',
	max: 'https://262.ecma-international.org/7.0/#sec-algorithm-conventions',
	min: 'https://262.ecma-international.org/7.0/#sec-algorithm-conventions',
	MinFromTime: 'https://262.ecma-international.org/7.0/#sec-hours-minutes-second-and-milliseconds',
	ModuleNamespaceCreate: 'https://262.ecma-international.org/7.0/#sec-modulenamespacecreate',
	modulo: 'https://262.ecma-international.org/7.0/#sec-algorithm-conventions',
	MonthFromTime: 'https://262.ecma-international.org/7.0/#sec-month-number',
	msFromTime: 'https://262.ecma-international.org/7.0/#sec-hours-minutes-second-and-milliseconds',
	NewDeclarativeEnvironment: 'https://262.ecma-international.org/7.0/#sec-newdeclarativeenvironment',
	NewFunctionEnvironment: 'https://262.ecma-international.org/7.0/#sec-newfunctionenvironment',
	NewGlobalEnvironment: 'https://262.ecma-international.org/7.0/#sec-newglobalenvironment',
	NewModuleEnvironment: 'https://262.ecma-international.org/7.0/#sec-newmoduleenvironment',
	NewObjectEnvironment: 'https://262.ecma-international.org/7.0/#sec-newobjectenvironment',
	NewPromiseCapability: 'https://262.ecma-international.org/7.0/#sec-newpromisecapability',
	NextJob: 'https://262.ecma-international.org/7.0/#sec-nextjob-result',
	NormalCompletion: 'https://262.ecma-international.org/7.0/#sec-normalcompletion',
	ObjectCreate: 'https://262.ecma-international.org/7.0/#sec-objectcreate',
	ObjectDefineProperties: 'https://262.ecma-international.org/7.0/#sec-objectdefineproperties',
	OrdinaryCallBindThis: 'https://262.ecma-international.org/7.0/#sec-ordinarycallbindthis',
	OrdinaryCallEvaluateBody: 'https://262.ecma-international.org/7.0/#sec-ordinarycallevaluatebody',
	OrdinaryCreateFromConstructor: 'https://262.ecma-international.org/7.0/#sec-ordinarycreatefromconstructor',
	OrdinaryDefineOwnProperty: 'https://262.ecma-international.org/7.0/#sec-ordinarydefineownproperty',
	OrdinaryDelete: 'https://262.ecma-international.org/7.0/#sec-ordinarydelete',
	OrdinaryGet: 'https://262.ecma-international.org/7.0/#sec-ordinaryget',
	OrdinaryGetOwnProperty: 'https://262.ecma-international.org/7.0/#sec-ordinarygetownproperty',
	OrdinaryGetPrototypeOf: 'https://262.ecma-international.org/7.0/#sec-ordinarygetprototypeof',
	OrdinaryHasInstance: 'https://262.ecma-international.org/7.0/#sec-ordinaryhasinstance',
	OrdinaryHasProperty: 'https://262.ecma-international.org/7.0/#sec-ordinaryhasproperty',
	OrdinaryIsExtensible: 'https://262.ecma-international.org/7.0/#sec-ordinaryisextensible',
	OrdinaryOwnPropertyKeys: 'https://262.ecma-international.org/7.0/#sec-ordinaryownpropertykeys',
	OrdinaryPreventExtensions: 'https://262.ecma-international.org/7.0/#sec-ordinarypreventextensions',
	OrdinarySet: 'https://262.ecma-international.org/7.0/#sec-ordinaryset',
	OrdinarySetPrototypeOf: 'https://262.ecma-international.org/7.0/#sec-ordinarysetprototypeof',
	ParseModule: 'https://262.ecma-international.org/7.0/#sec-parsemodule',
	ParseScript: 'https://262.ecma-international.org/7.0/#sec-parse-script',
	PerformEval: 'https://262.ecma-international.org/7.0/#sec-performeval',
	PerformPromiseAll: 'https://262.ecma-international.org/7.0/#sec-performpromiseall',
	PerformPromiseRace: 'https://262.ecma-international.org/7.0/#sec-performpromiserace',
	PerformPromiseThen: 'https://262.ecma-international.org/7.0/#sec-performpromisethen',
	PrepareForOrdinaryCall: 'https://262.ecma-international.org/7.0/#sec-prepareforordinarycall',
	PrepareForTailCall: 'https://262.ecma-international.org/7.0/#sec-preparefortailcall',
	PromiseReactionJob: 'https://262.ecma-international.org/7.0/#sec-promisereactionjob',
	PromiseResolveThenableJob: 'https://262.ecma-international.org/7.0/#sec-promiseresolvethenablejob',
	ProxyCreate: 'https://262.ecma-international.org/7.0/#sec-proxycreate',
	PutValue: 'https://262.ecma-international.org/7.0/#sec-putvalue',
	QuoteJSONString: 'https://262.ecma-international.org/7.0/#sec-quotejsonstring',
	RegExpAlloc: 'https://262.ecma-international.org/7.0/#sec-regexpalloc',
	RegExpBuiltinExec: 'https://262.ecma-international.org/7.0/#sec-regexpbuiltinexec',
	RegExpCreate: 'https://262.ecma-international.org/7.0/#sec-regexpcreate',
	RegExpExec: 'https://262.ecma-international.org/7.0/#sec-regexpexec',
	RegExpInitialize: 'https://262.ecma-international.org/7.0/#sec-regexpinitialize',
	RejectPromise: 'https://262.ecma-international.org/7.0/#sec-rejectpromise',
	RepeatMatcher: 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-repeatmatcher-abstract-operation',
	RequireObjectCoercible: 'https://262.ecma-international.org/7.0/#sec-requireobjectcoercible',
	ResolveBinding: 'https://262.ecma-international.org/7.0/#sec-resolvebinding',
	ResolveThisBinding: 'https://262.ecma-international.org/7.0/#sec-resolvethisbinding',
	ReturnIfAbrupt: 'https://262.ecma-international.org/7.0/#sec-returnifabrupt',
	SameValue: 'https://262.ecma-international.org/7.0/#sec-samevalue',
	SameValueNonNumber: 'https://262.ecma-international.org/7.0/#sec-samevaluenonnumber',
	SameValueZero: 'https://262.ecma-international.org/7.0/#sec-samevaluezero',
	ScriptEvaluation: 'https://262.ecma-international.org/7.0/#sec-runtime-semantics-scriptevaluation',
	ScriptEvaluationJob: 'https://262.ecma-international.org/7.0/#sec-scriptevaluationjob',
	SecFromTime: 'https://262.ecma-international.org/7.0/#sec-hours-minutes-second-and-milliseconds',
	SerializeJSONArray: 'https://262.ecma-international.org/7.0/#sec-serializejsonarray',
	SerializeJSONObject: 'https://262.ecma-international.org/7.0/#sec-serializejsonobject',
	SerializeJSONProperty: 'https://262.ecma-international.org/7.0/#sec-serializejsonproperty',
	Set: 'https://262.ecma-international.org/7.0/#sec-set-o-p-v-throw',
	SetDefaultGlobalBindings: 'https://262.ecma-international.org/7.0/#sec-setdefaultglobalbindings',
	SetFunctionName: 'https://262.ecma-international.org/7.0/#sec-setfunctionname',
	SetIntegrityLevel: 'https://262.ecma-international.org/7.0/#sec-setintegritylevel',
	SetRealmGlobalObject: 'https://262.ecma-international.org/7.0/#sec-setrealmglobalobject',
	SetValueInBuffer: 'https://262.ecma-international.org/7.0/#sec-setvalueinbuffer',
	SetViewValue: 'https://262.ecma-international.org/7.0/#sec-setviewvalue',
	SortCompare: 'https://262.ecma-international.org/7.0/#sec-sortcompare',
	SpeciesConstructor: 'https://262.ecma-international.org/7.0/#sec-speciesconstructor',
	SplitMatch: 'https://262.ecma-international.org/7.0/#sec-splitmatch',
	'Strict Equality Comparison': 'https://262.ecma-international.org/7.0/#sec-strict-equality-comparison',
	StringCreate: 'https://262.ecma-international.org/7.0/#sec-stringcreate',
	SymbolDescriptiveString: 'https://262.ecma-international.org/7.0/#sec-symboldescriptivestring',
	TestIntegrityLevel: 'https://262.ecma-international.org/7.0/#sec-testintegritylevel',
	thisBooleanValue: 'https://262.ecma-international.org/7.0/#sec-thisbooleanvalue',
	thisNumberValue: 'https://262.ecma-international.org/7.0/#sec-properties-of-the-number-prototype-object',
	thisStringValue: 'https://262.ecma-international.org/7.0/#sec-properties-of-the-string-prototype-object',
	thisTimeValue: 'https://262.ecma-international.org/7.0/#sec-properties-of-the-date-prototype-object',
	TimeClip: 'https://262.ecma-international.org/7.0/#sec-timeclip',
	TimeFromYear: 'https://262.ecma-international.org/7.0/#sec-year-number',
	TimeWithinDay: 'https://262.ecma-international.org/7.0/#sec-day-number-and-time-within-day',
	ToBoolean: 'https://262.ecma-international.org/7.0/#sec-toboolean',
	ToDateString: 'https://262.ecma-international.org/7.0/#sec-todatestring',
	ToInt16: 'https://262.ecma-international.org/7.0/#sec-toint16',
	ToInt32: 'https://262.ecma-international.org/7.0/#sec-toint32',
	ToInt8: 'https://262.ecma-international.org/7.0/#sec-toint8',
	ToInteger: 'https://262.ecma-international.org/7.0/#sec-tointeger',
	ToLength: 'https://262.ecma-international.org/7.0/#sec-tolength',
	ToNumber: 'https://262.ecma-international.org/7.0/#sec-tonumber',
	ToObject: 'https://262.ecma-international.org/7.0/#sec-toobject',
	TopLevelModuleEvaluationJob: 'https://262.ecma-international.org/7.0/#sec-toplevelmoduleevaluationjob',
	ToPrimitive: 'https://262.ecma-international.org/7.0/#sec-toprimitive',
	ToPropertyDescriptor: 'https://262.ecma-international.org/7.0/#sec-topropertydescriptor',
	ToPropertyKey: 'https://262.ecma-international.org/7.0/#sec-topropertykey',
	ToString: 'https://262.ecma-international.org/7.0/#sec-tostring',
	'ToString Applied to the Number Type': 'https://262.ecma-international.org/7.0/#sec-tostring-applied-to-the-number-type',
	ToUint16: 'https://262.ecma-international.org/7.0/#sec-touint16',
	ToUint32: 'https://262.ecma-international.org/7.0/#sec-touint32',
	ToUint8: 'https://262.ecma-international.org/7.0/#sec-touint8',
	ToUint8Clamp: 'https://262.ecma-international.org/7.0/#sec-touint8clamp',
	TriggerPromiseReactions: 'https://262.ecma-international.org/7.0/#sec-triggerpromisereactions',
	Type: 'https://262.ecma-international.org/7.0/#sec-ecmascript-data-types-and-values',
	TypedArrayCreate: 'https://262.ecma-international.org/7.0/#typedarray-create',
	TypedArraySpeciesCreate: 'https://262.ecma-international.org/7.0/#typedarray-species-create',
	UpdateEmpty: 'https://262.ecma-international.org/7.0/#sec-updateempty',
	UTC: 'https://262.ecma-international.org/7.0/#sec-utc-t',
	UTF16Decode: 'https://262.ecma-international.org/7.0/#sec-utf16decode',
	UTF16Encoding: 'https://262.ecma-international.org/7.0/#sec-utf16encoding',
	ValidateAndApplyPropertyDescriptor: 'https://262.ecma-international.org/7.0/#sec-validateandapplypropertydescriptor',
	ValidateTypedArray: 'https://262.ecma-international.org/7.0/#sec-validatetypedarray',
	WeekDay: 'https://262.ecma-international.org/7.0/#sec-week-day',
	YearFromTime: 'https://262.ecma-international.org/7.0/#sec-year-number'
};


text:
import * as BaseProvider from './BaseProvider';

export class Api extends BaseProvider.Api {
  apiName = 'Kucoin';

  apiDocs = [['API Docs', 'https://docs.kucoin.com/']];

  interval = 15;

  getUrl({ base, quote }) {
    return 'https://openapi-v2.kucoin.com/api/v1/market/orderbook/level1?symbol=' + `${base}-${quote}`.toUpperCase();
  }

  getLast({ code, msg, data }) {
    if (code != 200000) {
      throw new Error(msg);
    }

    return data.price;
  }

  getDefaultTicker(): BaseProvider.Ticker {
    return { base: 'BTC', quote: 'USDT' };
  }
}


text:
package com.izforge.izpack.panels;

import com.izforge.izpack.gui.LabelFactory;
import com.izforge.izpack.installer.InstallData;
import com.izforge.izpack.installer.InstallerFrame;
import com.izforge.izpack.installer.IzPanel;
import com.izforge.izpack.installer.ResourceManager;
import com.izforge.izpack.util.VariableSubstitutor;

import javax.swing.*;
import java.awt.*;

/**
 * The XInfo panel class - shows some adaptative text (ie by parsing for some variables.
 *
 * @author Julien Ponge
 */
public class XInfoPanel extends IzPanel
{

    /**
     *
     */
    private static final long serialVersionUID = 3257009856274970416L;

    /**
     * The text area.
     */
    private JTextArea textArea;

    /**
     * The info to display.
     */
    private String info;

    /**
     * The constructor.
     *
     * @param parent The parent window.
     * @param idata  The installation data.
     */
    public XInfoPanel(InstallerFrame parent, InstallData idata)
    {
        super(parent, idata);

        // We initialize our layout
        GridBagLayout layout = new GridBagLayout();
        GridBagConstraints gbConstraints = new GridBagConstraints();
        setLayout(layout);

        // We add the components

        JLabel infoLabel = LabelFactory.create(parent.langpack.getString("InfoPanel.info"), parent.icons
                .getImageIcon("edit"), JLabel.TRAILING);
        parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0);
        gbConstraints.insets = new Insets(5, 5, 5, 5);
        gbConstraints.fill = GridBagConstraints.BOTH;
        gbConstraints.anchor = GridBagConstraints.SOUTHWEST;
        layout.addLayoutComponent(infoLabel, gbConstraints);
        add(infoLabel);

        textArea = new JTextArea();
        textArea.setEditable(false);
        JScrollPane scroller = new JScrollPane(textArea);
        parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9);
        gbConstraints.anchor = GridBagConstraints.CENTER;
        layout.addLayoutComponent(scroller, gbConstraints);
        add(scroller);
    }

    /**
     * Loads the info text.
     */
    private void loadInfo()
    {
        try
        {
            // We read it
            info = ResourceManager.getInstance().getTextResource("XInfoPanel.info");
        }
        catch (Exception err)
        {
            info = "Error : could not load the info text !";
        }
    }

    /**
     * Parses the text for special variables.
     */
    private void parseText()
    {
        try
        {
            // Initialize the variable substitutor
            VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables());

            // Parses the info text
            info = vs.substitute(info, null);
        }
        catch (Exception err)
        {
            err.printStackTrace();
        }
    }

    /**
     * Called when the panel becomes active.
     */
    public void panelActivate()
    {
        // Text handling
        loadInfo();
        parseText();

        // UI handling
        textArea.setText(info);
        textArea.setCaretPosition(0);
    }

    /**
     * Indicates wether the panel has been validated or not.
     *
     * @return Always true.
     */
    public boolean isValidated()
    {
        return true;
    }
}


text:
<?php

namespace Weba\UserInterface\Symfony\UserManagementBundle\Form\Type\Account;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Weba\Domain\Account\Repository;

class AccountType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name', TextType::class, [
            'constraints' => [
                new NotBlank(),
                new Length([
                    'min' => 3,
                    'max' => 30
                ]),
                new Callback([
                    'callback' => function ($object, ExecutionContextInterface $context, $payload) use ($options) {
                        if ($options['account_query']->accountExists($object) && is_string($object)) {
                            $context->buildViolation('name.not_unique')
                                ->atPath('name')
                                ->addViolation();
                        }
                    }
                ])
            ]
        ]);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults([
                'account_query' => null,
                'csrf_protection' => false
            ])
            ->setAllowedTypes('account_query', [
                Repository::class
            ])
            ->setRequired([
                'account_query'
            ]);
    }
}


text:
package Database;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCMySQLDemo {

	public static void main(String[] args) {
		 ResultSet rs = null;
	     Connection connection = null;
	     Statement statement = null;

	     String query = "SELECT * FROM perioxes";

	     try {
	            connection = JDBCMySQLConnection.getConnection();
	            statement = connection.createStatement();

	            rs = statement.executeQuery(query);

	            while(rs.next()) {
	                int aa = rs.getInt("id");
	                String ONOMA = rs.getString("ÐÅÑÉÏ×Ç");
	                System.out.println("id: "+ aa +
	                				   " ÐÅÑÉÏ×Ç: "+ ONOMA);

	            }
	        } catch (SQLException e) {
	            e.printStackTrace();
	        } finally {
	            if (connection != null) {
	                try {
	                    connection.close();
	                } catch (SQLException e) {
	                    e.printStackTrace();
	                }
	            }
	        }

	    }

}


text:
import React from "react";
import Tippy from "@tippyjs/react/headless";

import * as Styles from "../components/search/SearchStyles";
import Meta from "../components/Meta";
import { useSearch } from "../components/search/useSearch";
import { isBlank } from "components/search/searchUtil";

export default function render() {
  if (typeof document === "undefined") {
    return
;
  }
  const { query, response, setQuery, cat, setCat, setStartIndex } = useSearch();

  const entry = {
    title: "Search results for " + query,
  };
  return (
    <>
      <Meta {...entry} />

Help Center Search

            <form className="js-search-form form-search" action="/search/">

                <input
                  type="text"
                  className="search-query"
                  name="q"
                  value={query}
                  onChange={(e) => setQuery(e.target.value)}
                />
                <button type="submit" className="btn">
                  Search Help Center
                </button>

                  <input
                    type="radio"
                    name="cat"
                    value=""
                    checked={cat === ""}
                    onChange={() => setCat("")}
                  />
                  All

                  <input
                    type="radio"
                    name="cat"
                    value="successCenter"
                    checked={cat === "successCenter"}
                    onChange={() => setCat("successCenter")}
                  />
                  Success

                  <input
                    type="radio"
                    name="cat"
                    value="developerCenter"
                    checked={cat === "developerCenter"}
                    onChange={() => setCat("developerCenter")}
                  />
                  Developer

                  <input
                    type="radio"
                    name="cat"
                    value="designerCenter "
                    checked={cat === "designerCenter"}
                    onChange={() => setCat("designerCenter")}
                  />
                  Designer

            </form>

              Back to Help Center

              {!response && (

Searching Help Center...

              )}
              {response && response.error && (

{response.error.message}

              )}
              {response && !response.error && (
                <Results
                  response={response}
                  setStartIndex={setStartIndex}
                  query={query}
                />
              )}

    </>
  );
}

export type InputComponent = typeof Styles.DefaultInput;

export function Results({ response, setStartIndex, query }) {
  const { items, queries, searchInformation } = response;

  // Some pages have `meta` tags via `pagemap.metatags`, and things like ios/android don't.
  const getTitle = (item) => {
    try {
      return items.pagemap.metatags[0].title;
    } catch (e) {}
    return item.htmlTitle;
  };

  return (
    <>
      {items &&
        items
          .filter((item) => item)
          .map((item) => (

                <div
                  className="search-results-title"
                  dangerouslySetInnerHTML={{
                    __html:
                      getTitle(item) +
                      `<i className="search-results-type fa"></i>`,
                  }}
                />

          ))}
      {items && (

          {searchInformation.totalResults} total results found in{" "}
          {searchInformation.formattedSearchTime} seconds

      )}

        {queries?.previousPage && (
           setStartIndex(queries.previousPage[0].startIndex)}
            className="btn js-search-pager"
          >
            Previous

        )}

        {queries?.nextPage && (
           setStartIndex(queries.nextPage[0].startIndex)}
            className="btn js-search-pager"
          >
            Next

        )}

      {!items && isBlank(query) && (

What are you looking for?

      )}
      {!items && !isBlank(query) && (

            No matching Docs!

            Looks like we couldn't find any Help Center page that matches your
            search term "{query}"

      )}
    </>
  );
}


text:
#ifndef BOOST_SPIRIT_INCLUDE_PHOENIX1_TUPLES
#define BOOST_SPIRIT_INCLUDE_PHOENIX1_TUPLES
#include <lslboost/spirit/home/classic/phoenix/tuples.hpp>
#endif


text:
package javaschtasks.batchjob;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import org.apache.log4j.Logger;

public class wintask {
	private static Logger logger = Logger.getLogger(wintask.class.getName());

	public static void main(String args[]) throws IOException, InterruptedException {
		StringBuffer sb = wintask.getrunoncexml();
		String myxml = sb.toString();
		ReadXMLFile.readxmlString(myxml, null);
		System.out.println(myxml);

	}

	public static StringBuffer stoutErrors(Process p) {
		BufferedReader br = null;
		try{
			// stdout
			StringBuffer ret = new StringBuffer();
			InputStream is = p.getInputStream();
			InputStreamReader isr = new InputStreamReader(is);
			br = new BufferedReader(isr);
			String line;
			while ((line = br.readLine()) != null) {
				logger.debug(line);
				ret.append(line);
			}
			//stderr
			is = p.getErrorStream();
			isr = new InputStreamReader(is);
			br = new BufferedReader(isr);
			while ((line = br.readLine()) != null) {
				logger.debug(line);
				ret.append(line);
			}
			return ret;
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null)br.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
		}
		return null;
	}

	public static StringBuffer runawinho() {

				List<String> commands = new ArrayList<String>();

				commands.add("schtasks.exe");
				commands.add("/run");
				commands.add("/S");
				commands.add(JobSubmitGui.defaultserverip);
				commands.add("/U");
				commands.add(JobSubmitGui.defaultuser);
				commands.add("/P");
				commands.add(JobSubmitGui.defaultpass);
				commands.add("/TN");
				commands.add("FOLDERJOBS\\Testing777");

				logger.debug("Running shell command: " + commands);
				ProcessBuilder builder = new ProcessBuilder(commands);
				Process p;
				try {
					p = builder.start();
					StringBuffer sb = wintask.stoutErrors(p);
					p.waitFor();
					System.out.println(p.exitValue());
					return sb;
				} catch (IOException | InterruptedException e) {
					e.printStackTrace();
				}
				return null;

	}

	public static StringBuffer deltask1(Taskobj task) {
		List<String> commands = new ArrayList<String>();

		String taskname = wintask.getGoodTaskName(task);
		commands.add("schtasks.exe");
		commands.add("/delete");
		commands.add("/S");
		commands.add(JobSubmitGui.defaultserverip);
		commands.add("/U");
		commands.add(JobSubmitGui.defaultuser);
		commands.add("/P");
		commands.add(JobSubmitGui.defaultpass);
		commands.add("/TN");
		commands.add("FOLDERJOBS\\" + taskname);
		commands.add("/F");

		logger.debug("Running shell command: " + commands);
		ProcessBuilder builder = new ProcessBuilder(commands);
		Process p;
		try {
			p = builder.start();
			StringBuffer sb = wintask.stoutErrors(p);
			p.waitFor();
			System.out.println(p.exitValue());
			return sb;
		} catch (IOException | InterruptedException e) {
			e.printStackTrace();
		}
		return null;

	}

	public static StringBuffer linuxfortune(Taskobj task) {
		List<String> commands = new ArrayList<String>();
		commands.add("/bin/bash");
		commands.add("-c");
		commands.add("sleep 5");
		commands.add(";");
		commands.add("fortune");

		logger.debug("Running shell command: " + commands);
		ProcessBuilder builder = new ProcessBuilder(commands);
		Process p;
		try {
			p = builder.start();
			StringBuffer sb = wintask.stoutErrors(p);
			p.waitFor();
			System.out.println(p.exitValue());
			return sb;
		} catch (IOException | InterruptedException e) {
			e.printStackTrace();
		}
		return null;

	}

	public static StringBuffer runataskl(Taskobj task) {

		List<String> commands = new ArrayList<String>();
		String taskname = wintask.getGoodTaskName(task);
		commands.add("schtasks.exe");
		commands.add("/Create");
		commands.add("/S");
		commands.add(JobSubmitGui.defaultserverip);
		commands.add("/U");
		commands.add(JobSubmitGui.defaultuser);
		commands.add("/P");
		commands.add(JobSubmitGui.defaultpass);
		commands.add("/XML");
		commands.add(task.getFilename());
		commands.add("/TN");
		commands.add("FOLDERJOBS\\" + taskname);
		commands.add("/F");
		//commands.add("/RU");
		//commands.add(JobSubmitGui.defaultservername + "\\" + JobSubmitGui.defaultuser);
		//commands.add("/RP");
		//commands.add(JobSubmitGui.defaultpass);

		logger.debug("Running shell command: " + commands);
		ProcessBuilder builder = new ProcessBuilder(commands);
		Process p;
		try {
			p = builder.start();
			StringBuffer sb = wintask.stoutErrors(p);
			p.waitFor();
			logger.debug(p.exitValue());
			return sb;
		} catch (IOException | InterruptedException e) {
			e.printStackTrace();
		}
		return null;

	}

	private static String getGoodTaskName(Taskobj task) {

		File afile = new File(task.getFilename());
		String filenameshort = afile.getName();

		Calendar ca1 = Calendar.getInstance();
		int DAY_OF_YEAR = ca1.get(Calendar.DAY_OF_YEAR);
		String newtask = DAY_OF_YEAR + filenameshort;

		return newtask;

	}

	public static StringBuffer getrunoncexml() {
		List<String> commands = new ArrayList<String>();
		commands.add("schtasks.exe");
		commands.add("/query");
		commands.add("/S");
		commands.add(JobSubmitGui.defaultserverip);
		commands.add("/U");
		commands.add(JobSubmitGui.defaultuser);
		commands.add("/P");
		commands.add(JobSubmitGui.defaultpass);
		commands.add("/TN");
		commands.add("FOLDERJOBS\\");
		commands.add("/XML");

		logger.debug("Running shell command: " + commands);
		ProcessBuilder builder = new ProcessBuilder(commands);
		Process p;
		try {
			p = builder.start();
			StringBuffer sb = wintask.stoutErrors(p);
			p.waitFor();
			System.out.println(p.exitValue());
			return sb;
		} catch (IOException e) {
			e.printStackTrace();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		return null;

	}

}


text:
package org.onehippo.cms7.essentials.dashboard.utils.update;

import org.junit.Assert;
import org.junit.Test;

public class UpdateConfigTest {

    public static final String NAME = "name";
    public static final String SCRIPT = "println echo";
    public static final String QUERY = "//element(*,hippo:document)";
    public static final long BATCH_SIZE = 10l;
    public static final long THROTTLE = 10l;
    public static final boolean DRY_RUN = false;
    private UpdateUtils.UpdateConfig config;

    @Test
    public void testParams() throws Exception {
        config = new UpdateUtils.UpdateConfig(NAME, SCRIPT, QUERY, BATCH_SIZE, THROTTLE, DRY_RUN);
        Assert.assertEquals(NAME, config.getName());
        Assert.assertEquals(SCRIPT, config.getScript());
        Assert.assertEquals(QUERY, config.getQuery());
        Assert.assertEquals(BATCH_SIZE, config.getBatchSize());
        Assert.assertEquals(THROTTLE, config.getThrottle());
        Assert.assertEquals(DRY_RUN, config.isDryRun());
    }

    @Test(expected = IllegalArgumentException.class)
    public void testExceptionOnEmptyName() throws Exception {
        config = new UpdateUtils.UpdateConfig("", SCRIPT, QUERY, BATCH_SIZE, THROTTLE, DRY_RUN);
    }

}


text:
package pack.block.server;

import java.io.Closeable;
import java.io.File;
import java.io.FileFilter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.security.PrivilegedExceptionAction;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.security.UserGroupInformation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableList.Builder;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Closer;

import pack.PackStorage;
import pack.block.blockstore.BlockStoreMetaData;
import pack.block.blockstore.hdfs.CreateVolumeRequest;
import pack.block.blockstore.hdfs.HdfsBlockStoreAdmin;
import pack.block.blockstore.hdfs.lock.PackLockFactory;
import pack.block.blockstore.hdfs.util.HdfsSnapshotStrategy;
import pack.block.blockstore.hdfs.util.HdfsSnapshotUtil;
import pack.block.blockstore.hdfs.util.LastestHdfsSnapshotStrategy;
import pack.block.fuse.FuseFileSystemSingleMount;
import pack.block.server.fs.LinuxFileSystem;
import pack.block.server.json.BlockPackFuseConfig;
import pack.block.server.json.BlockPackFuseConfig.BlockPackFuseConfigBuilder;
import pack.block.util.FileCounter;
import pack.block.util.Utils;
import pack.docker.PackServer;
import pack.docker.json.Err;
import pack.docker.json.MountUnmountRequest;
import pack.docker.json.PathResponse;
import pack.util.ExecUtil;
import pack.util.Result;
import spark.Route;
import spark.Service;

public class BlockPackStorage implements PackStorage {

  private static final Logger LOGGER = LoggerFactory.getLogger(BlockPackStorage.class);

  public static final String VOLUME_DRIVER_MOUNT_DEVICE = "/VolumeDriver.MountDevice";
  public static final String VOLUME_DRIVER_UNMOUNT_DEVICE = "/VolumeDriver.UnmountDevice";
  public static final String CLONE_PATH = "clonePath";
  public static final String SYMLINK_CLONE = "symlinkClone";
  public static final String MOUNT_COUNT = "mountCount";
  public static final String MOUNT = "mount";
  public static final String METRICS = "metrics";
  public static final String SUDO = "sudo";
  public static final String SYNC = "sync";
  public static final String CONFIG_JSON = "config.json";
  private static final String LOCKED = "locked";
  private static final String UNLOCKED = "unlocked";
  private static final String BRICK = "brick";
  private static final String VOLUMES = "volumes";
  private static final String FS = "fs";
  private static final String DEV = "dev";
  private static final String SHUTDOWN = "shutdown";
  private static final long MAX_AGE = TimeUnit.MINUTES.toMillis(20);
  private static final String BASH = "bash";
  private static final String LS = "ls";
  private static final String ERROR = ".error.";
  private static final String SNAPSHOT = "snapshot";
  private static final String RF = "-rf";
  private static final String RM = "rm";

  protected final Configuration _configuration;
  protected final Path _root;
  protected final File _localLogDir;
  protected final Set<String> _currentMountedVolumes = Collections.newSetFromMap(new ConcurrentHashMap<>());
  protected final int _numberOfMountSnapshots;
  protected final File _workingDir;
  protected final HdfsSnapshotStrategy _snapshotStrategy;
  protected final Timer _cleanupTimer;
  protected final Map<String, Long> _cleanUpMap = new ConcurrentHashMap<>();
  protected final Map<String, Long> _shutdownMap = new ConcurrentHashMap<>();
  protected final Map<String, Object> _volumeLocks = new ConcurrentHashMap<>();

  public BlockPackStorage(BlockPackStorageConfig config) throws IOException, InterruptedException {
    addServiceExtras(config.getService());
    _snapshotStrategy = config.getStrategy();
    _numberOfMountSnapshots = config.getNumberOfMountSnapshots();
    LastestHdfsSnapshotStrategy.setMaxNumberOfMountSnapshots(_numberOfMountSnapshots);

    Closer closer = Closer.create();
    closer.register((Closeable) () -> {
      for (String volumeName : _currentMountedVolumes) {
        try {
          unmount(volumeName, null);
        } catch (Exception e) {
          LOGGER.error("Unknown error while trying to umount volume " + volumeName);
        }
      }
    });
    addShutdownHook(closer);

    _configuration = config.getConfiguration();
    FileSystem fileSystem = getFileSystem(config.getRemotePath());
    Path remotePath = config.getRemotePath()
                            .makeQualified(fileSystem.getUri(), fileSystem.getWorkingDirectory());
    _root = remotePath;

    LOGGER.info("Creating hdfs root path {}", _root);
    getUgi().doAs(HdfsPriv.create(() -> getFileSystem(_root).mkdirs(_root)));

    _localLogDir = config.getLogDir();
    _localLogDir.mkdirs();

    _workingDir = config.getWorkingDir();
    _workingDir.mkdirs();

    long period = TimeUnit.SECONDS.toMillis(30);
    _cleanupTimer = new Timer("Pack cleanup", true);
    _cleanupTimer.scheduleAtFixedRate(new TimerTask() {
      @Override
      public void run() {
        try {
          cleanup();
        } catch (Throwable t) {
          LOGGER.error("Unknown error", t);
        }
      }
    }, period, period);
  }

  void cleanup() throws IOException, InterruptedException {
    LOGGER.debug("cleanup");
    File volumesDir = getVolumesDir();
    if (!volumesDir.exists()) {
      return;
    }
    for (File volumeDir : volumesDir.listFiles()) {
      cleanup(volumeDir);
    }
  }

  private void cleanup(File volumeDir) throws IOException, InterruptedException {
    if (!volumeDir.exists()) {
      return;
    }
    File[] ids = volumeDir.listFiles();
    for (File idFile : ids) {
      cleanup(volumeDir.getName(), idFile);
    }
  }

  private void cleanup(String volumeName, File idFile) throws IOException, InterruptedException {
    if (!idFile.exists()) {
      return;
    }
    String id = idFile.getName();
    LOGGER.debug("cleanup for volume {} id {}", volumeName, id);
    synchronized (getVolumeLock(volumeName)) {
      if (!isVolumeStillInUse(id)) {
        LOGGER.debug("volume {} id {} is not running", volumeName, id);
        if (shouldPerformCleanup(volumeName, id)) {
          LOGGER.debug("volume {} id {} cleanup", volumeName, id);
          ExecUtil.execAsResult(LOGGER, Level.DEBUG, SUDO, RM, RF, idFile.getCanonicalPath());
          LOGGER.info("delete {} {}", idFile, idFile.delete());
          removeCleanupEntry(volumeName, id);
        } else {
          addCleanupEntry(volumeName, id);
        }
      } else {
        LOGGER.debug("volume {} id {} is still in use", volumeName, id);
      }
    }
  }

  private boolean isVolumeStillInUse(String id) throws IOException {
    Result result = ExecUtil.execAsResult(LOGGER, Level.DEBUG, SUDO, MOUNT);
    if (result.exitCode == 0) {
      return result.stdout.contains(id);
    }
    return false;
  }

  private boolean shouldPerformCleanup(String volumeName, String id) {
    Long ts = _cleanUpMap.get(volumeName + id);
    if (ts == null) {
      return false;
    }
    return ts + MAX_AGE < System.currentTimeMillis();
  }

  private void removeCleanupEntry(String volumeName, String id) {
    LOGGER.info("add cleanup entry volume {} id {}", volumeName, id);
    _cleanUpMap.remove(volumeName + id);
  }

  private void addCleanupEntry(String volumeName, String id) {
    if (_cleanUpMap.putIfAbsent(volumeName + id, System.currentTimeMillis()) == null) {
      LOGGER.info("add cleanup entry volume {} id {}", volumeName, id);
    }
  }

  private UserGroupInformation getUgi() throws IOException {
    return Utils.getUserGroupInformation();
  }

  private void addServiceExtras(Service service) {
    if (service == null) {
      return;
    }
    service.post(VOLUME_DRIVER_MOUNT_DEVICE, (Route) (request, response) -> {
      PackServer.debugInfo(request);
      MountUnmountRequest mountUnmountRequest = PackServer.read(request, MountUnmountRequest.class);
      try {
        String deviceMountPoint = getUgi().doAs(
            (PrivilegedExceptionAction<String>) () -> mountVolume(mountUnmountRequest.getVolumeName(),
                mountUnmountRequest.getId(), true));
        return PathResponse.builder()
                           .mountpoint(deviceMountPoint)
                           .build();
      } catch (Throwable t) {
        LOGGER.error("error", t);
        return PathResponse.builder()
                           .mountpoint("<unknown>")
                           .error(t.getMessage())
                           .build();
      }
    }, PackServer.TRANSFORMER);

    service.post(VOLUME_DRIVER_UNMOUNT_DEVICE, (Route) (request, response) -> {
      PackServer.debugInfo(request);
      MountUnmountRequest mountUnmountRequest = PackServer.read(request, MountUnmountRequest.class);
      try {
        getUgi().doAs(HdfsPriv.create(
            () -> umountVolume(mountUnmountRequest.getVolumeName(), mountUnmountRequest.getId(), true)));
        return Err.builder()
                  .build();
      } catch (Throwable t) {
        LOGGER.error("error", t);
        return PathResponse.builder()
                           .mountpoint("<unknown>")
                           .error(t.getMessage())
                           .build();
      }
    }, PackServer.TRANSFORMER);
  }

  private void addShutdownHook(Closer closer) {
    Runtime.getRuntime()
           .addShutdownHook(new Thread(() -> {
             try {
               closer.close();
             } catch (IOException e) {
               LOGGER.error("Unknown error while trying to umount volumes");
             }
           }));
  }

  @Override
  public void create(String volumeName, Map<String, Object> options) throws Exception {
    getUgi().doAs(HdfsPriv.create(() -> createVolume(volumeName, options)));
  }

  @Override
  public void remove(String volumeName) throws Exception {
    getUgi().doAs(HdfsPriv.create(() -> removeVolume(volumeName)));
  }

  @Override
  public String mount(String volumeName, String id) throws Exception {
    return getUgi().doAs((PrivilegedExceptionAction<String>) () -> mountVolume(volumeName, id, false));
  }

  @Override
  public void unmount(String volumeName, String id) throws Exception {
    getUgi().doAs(HdfsPriv.create(() -> umountVolume(volumeName, id, false)));
  }

  @Override
  public boolean exists(String volumeName) throws Exception {
    return getUgi().doAs((PrivilegedExceptionAction<Boolean>) () -> existsVolume(volumeName));
  }

  @Override
  public String getMountPoint(String volumeName) throws IOException {
    LOGGER.info("get mountPoint volume {}", volumeName);
    List<String> ids = getPossibleVolumeIds(volumeName);
    for (String id : ids) {
      File localFileSystemMount = getLocalFileSystemMount(volumeName, id);
      if (isMounted(localFileSystemMount)) {
        LOGGER.info("volume {} is mounted {}", volumeName, localFileSystemMount);
        return localFileSystemMount.getCanonicalPath();
      }
    }
    return null;
  }

  private List<String> getPossibleVolumeIds(String volumeName) {
    File file = new File(getVolumesDir(), volumeName);
    if (!file.exists()) {
      return ImmutableList.of();
    }
    Builder<String> builder = ImmutableList.builder();
    for (File f : file.listFiles((FileFilter) pathname -> pathname.isDirectory())) {
      builder.add(f.getName());
    }
    return builder.build();
  }

  @Override
  public List<String> listVolumes() throws Exception {
    return getUgi().doAs((PrivilegedExceptionAction<List<String>>) () -> listHdfsVolumes(getFileSystem(_root), _root));
  }

  public static List<String> listHdfsVolumes(FileSystem fileSystem, Path root)
      throws IOException, FileNotFoundException {
    LOGGER.info("list volumes");
    FileStatus[] listStatus = fileSystem.listStatus(root);
    List<String> result = new ArrayList<>();
    for (FileStatus fileStatus : listStatus) {
      Path path = fileStatus.getPath();
      if (HdfsBlockStoreAdmin.hasMetaData(fileSystem, path)) {
        result.add(path.getName());
      }
    }
    return result;
  }

  protected boolean existsVolume(String volumeName) throws IOException {
    LOGGER.info("exists {}", volumeName);
    FileSystem fileSystem = getFileSystem(_root);
    return HdfsBlockStoreAdmin.hasMetaData(fileSystem, getVolumePath(volumeName));
  }

  protected void createVolume(String volumeName, Map<String, Object> options) throws IOException {
    LOGGER.info("create volume {}", volumeName);
    BlockStoreMetaData defaultmetaData = BlockStoreMetaData.DEFAULT_META_DATA;
    BlockStoreMetaData metaData = BlockStoreMetaData.setupOptions(defaultmetaData, options);

    Path volumePath = getVolumePath(volumeName);
    FileSystem fileSystem = getFileSystem(volumePath);

    CreateVolumeRequest request = CreateVolumeRequest.builder()
                                                     .metaData(metaData)
                                                     .volumeName(volumeName)
                                                     .volumePath(volumePath)
                                                     .clonePath(getClonePath(options))
                                                     .symlinkClone(getSymlinkClone(options))
                                                     .build();
    HdfsBlockStoreAdmin.createVolume(fileSystem, request);
  }

  private boolean getSymlinkClone(Map<String, Object> options) {
    Object object = options.get(SYMLINK_CLONE);
    if (object == null) {
      return false;
    }
    return Boolean.parseBoolean(object.toString()
                                      .toLowerCase());
  }

  private Path getClonePath(Map<String, Object> options) {
    Object object = options.get(CLONE_PATH);
    if (object == null) {
      return null;
    }
    return new Path(object.toString());
  }

  protected void removeVolume(String volumeName) throws IOException {
    LOGGER.info("Remove Volume {}", volumeName);
    Path volumePath = getVolumePath(volumeName);
    FileSystem fileSystem = getFileSystem(volumePath);
    Utils.dropVolume(volumePath, fileSystem);
  }

  protected String mountVolume(String volumeName, String id, boolean deviceOnly) throws Exception {
    LOGGER.info("mountVolume {} id {} deviceOnly {}", volumeName, id, deviceOnly);

    if (!existsVolume(volumeName)) {
      createVolume(volumeName, ImmutableMap.of());
    }
    LOGGER.debug("Mount Id {} volumeName {}", id, volumeName);

    Path volumePath = getVolumePath(volumeName);
    LOGGER.debug("Mount Id {} volumePath {}", id, volumePath);

    File logDir = getLogDir(volumeName);
    LOGGER.debug("Mount Id {} logDir {}", id, logDir);
    File localMetrics = getLocalMetrics(logDir);
    LOGGER.debug("Mount Id {} localMetrics {}", id, localMetrics);

    File localFileSystemMount = getLocalFileSystemMount(volumeName, id);
    LOGGER.debug("Mount Id {} localFileSystemMount {}", id, localFileSystemMount);
    File localDevice = getLocalDevice(volumeName, id);
    LOGGER.debug("Mount Id {} localDevice {}", id, localDevice);

    File localIndex = getLocalIndex(volumeName, id);
    LOGGER.debug("Mount Id {} localIndex {}", id, localIndex);
    File localCache = getLocalCache(volumeName, id);
    LOGGER.debug("Mount Id {} localCache {}", id, localCache);
    File libDir = getLibDir(volumeName, id);
    LOGGER.debug("Mount Id {} libDir {}", id, libDir);
    File configFile = getConfigFile(volumeName, id);
    LOGGER.debug("Mount Id {} configFile {}", id, configFile);
    File volumeDir = getVolumeDir(volumeName, id);
    LOGGER.debug("Mount Id {} volumeDir {}", id, volumeDir);

    FileSystem fileSystem = getFileSystem(volumePath);
    BlockStoreMetaData metaData = HdfsBlockStoreAdmin.readMetaData(fileSystem, volumePath);
    if (metaData == null) {
      throw new IOException("No metadata found for path " + volumePath);
    }

    FileCounter counter = getFileCounter(volumeName, id);

    try {
      synchronized (getVolumeLock(volumeName)) {
        counter.inc();

        libDir.mkdirs();
        localCache.mkdirs();
        localIndex.mkdirs();
        localFileSystemMount.mkdirs();
        localDevice.mkdirs();
        localMetrics.mkdirs();

        if (isMounted(localFileSystemMount)) {
          LOGGER.info("volume {} id {} already mounted {}", volumeName, id, localFileSystemMount.getCanonicalPath());
          return localFileSystemMount.getCanonicalPath();
        }

        String path = volumePath.toUri()
                                .getPath();

        BlockPackFuseConfigBuilder configBuilder = BlockPackFuseConfig.builder();
        BlockPackFuseConfig config = configBuilder.volumeName(volumeName)
                                                  .fuseMountLocation(localDevice.getCanonicalPath())
                                                  .fsMetricsLocation(localMetrics.getCanonicalPath())
                                                  .fsLocalCache(localCache.getCanonicalPath())
                                                  .fsLocalIndex(localIndex.getCanonicalPath())
                                                  .hdfsVolumePath(path)
                                                  .numberOfMountSnapshots(_numberOfMountSnapshots)
                                                  .build();
        BlockPackFuseProcessBuilder.startProcess(volumeName, volumeDir.getCanonicalPath(), logDir.getCanonicalPath(),
            libDir.getCanonicalPath(), configFile.getCanonicalPath(), _configuration, config);

        File brick = new File(localDevice, BRICK);
        if (!waitForDevice(brick, true, 60)) {
          Path lockPath = Utils.getLockPathForVolumeMount(volumePath);
          boolean lock = PackLockFactory.isLocked(_configuration, lockPath);
          throw new IOException(
              "Error waiting for device " + brick.getCanonicalPath() + " volume is " + (lock ? LOCKED : UNLOCKED));
        }
      }
      File device = new File(localDevice, FuseFileSystemSingleMount.BRICK);
      if (deviceOnly) {
        return device.getCanonicalPath();
      }
      mkfsIfNeeded(metaData, volumeName, device);
      tryToAssignUuid(metaData, device);
      mountFs(metaData, device, localFileSystemMount, volumeName, id);
      waitForMount(localDevice);
      HdfsSnapshotUtil.cleanupOldMountSnapshots(fileSystem, volumePath, _snapshotStrategy);
      return localFileSystemMount.getCanonicalPath();
    } catch (Exception e) {
      counter.dec();
      throw e;
    }
  }

  private File getLocalIndex(String volumeName, String id) {
    return new File(getVolumeDir(volumeName, id), "index");
  }

  private void umountVolume(String volumeName, String id, boolean deviceOnly) throws Exception {
    LOGGER.info("umountVolume {} id {} deviceOnly {}", volumeName, id, deviceOnly);
    Path volumePath = getVolumePath(volumeName);
    File localDevice = getLocalDevice(volumeName, id);
    synchronized (getVolumeLock(volumeName)) {
      FileCounter counter = getFileCounter(volumeName, id);
      counter.dec();
      long value = counter.getValue();
      if (value == 0) {
        LOGGER.info("ref counter {}, shutdown", value);
        shutdownPack(volumeName, id);
        File brick = new File(localDevice, BRICK);
        if (!waitForDevice(brick, false, 60)) {
          Path lockPath = Utils.getLockPathForVolumeMount(volumePath);
          boolean lock = PackLockFactory.isLocked(_configuration, lockPath);
          throw new IOException(
              "Error waiting for device " + brick.getCanonicalPath() + " volume is " + (lock ? LOCKED : UNLOCKED));
        }
      } else {
        LOGGER.info("ref counter {}, ref too high for shutdown", value);
      }
    }
  }

  private FileCounter getFileCounter(String volumeName, String id) {
    File file = new File(getVolumeDir(volumeName, id), "mount.ref");
    file.getParentFile()
        .mkdirs();
    return new FileCounter(file);
  }

  private synchronized Object getVolumeLock(String volumeName) {
    _volumeLocks.putIfAbsent(volumeName, new Object());
    return _volumeLocks.get(volumeName);
  }

  private static boolean waitForDevice(File brick, boolean toExist, int timeInSeconds)
      throws InterruptedException, IOException {
    for (int i = 0; i < timeInSeconds; i++) {
      if (toExist) {
        if (ExecUtil.execReturnExitCode(LOGGER, Level.DEBUG, SUDO, LS, brick.getCanonicalPath()) == 0) {
          return true;
        }
      } else {
        if (ExecUtil.execReturnExitCode(LOGGER, Level.DEBUG, SUDO, LS, brick.getCanonicalPath()) != 0) {
          return true;
        }
      }
      LOGGER.info("Waiting for device {}", brick);
      Thread.sleep(TimeUnit.SECONDS.toMillis(1));
    }
    return false;
  }

  private File getConfigFile(String volumeName, String id) {
    return new File(getVolumeDir(volumeName, id), CONFIG_JSON);
  }

  private void tryToAssignUuid(BlockStoreMetaData metaData, File device) throws IOException {
    LinuxFileSystem linuxFileSystem = metaData.getFileSystemType()
                                              .getLinuxFileSystem();
    if (linuxFileSystem.isUuidAssignmentSupported()) {
      linuxFileSystem.assignUuid(metaData.getUuid(), device);
    }
  }

  private void mountFs(BlockStoreMetaData metaData, File device, File localFileSystemMount, String volumeName, String id)
      throws IOException, InterruptedException {
    String mountOptions = metaData.getMountOptions();
    LinuxFileSystem linuxFileSystem = metaData.getFileSystemType()
                                              .getLinuxFileSystem();
    try {
      linuxFileSystem.mount(device, localFileSystemMount, mountOptions);
    } catch (IOException e) {
      LOGGER.error("Error while trying to mount device {} to {}", device, localFileSystemMount);
      createMountErrorSnapshot(volumeName, id);

      LOGGER.info("Repairing device {}", device);
      linuxFileSystem.repair(device);

      LOGGER.info("Retrying mount device {} to {}", device, localFileSystemMount);
      linuxFileSystem.mount(device, localFileSystemMount, mountOptions);
    }
    if (linuxFileSystem.isFstrimSupported()) {
      linuxFileSystem.fstrim(localFileSystemMount);
    }
    if (linuxFileSystem.isGrowOnlineSupported()) {
      linuxFileSystem.growOnline(localFileSystemMount);
    }
  }

  private void mkfsIfNeeded(BlockStoreMetaData metaData, String volumeName, File device) throws IOException {
    LinuxFileSystem linuxFileSystem = metaData.getFileSystemType()
                                              .getLinuxFileSystem();
    if (!linuxFileSystem.isFileSystemExists(device)) {
      linuxFileSystem.mkfs(device, metaData.getFileSystemBlockSize());
    }
  }

  private File getLibDir(String volumeName, String id) {
    return new File(getVolumeDir(volumeName, id), "lib");
  }

  private File getVolumesDir() {
    return new File(_workingDir, VOLUMES);
  }

  private File getVolumeDir(String volumeName, String id) {
    return new File(new File(getVolumesDir(), volumeName), id);
  }

  private static boolean isMounted(File localFileSystemMount) throws IOException {
    Result result = ExecUtil.execAsResult(LOGGER, Level.DEBUG, SUDO, MOUNT);
    return result.stdout.contains(localFileSystemMount.getCanonicalPath());
  }

  private File getLocalCache(String volumeName, String id) {
    return new File(getVolumeDir(volumeName, id), "cache");
  }

  private File getLocalMetrics(File logDir) {
    File file = new File(logDir, METRICS);
    file.mkdirs();
    return file;
  }

  private File getLogDir(String volumeName) {
    File logDir = new File(_localLogDir, volumeName);
    logDir.mkdirs();
    return logDir;
  }

  public static void waitForMount(File localFileSystemMount) throws InterruptedException, IOException {
    while (!isMounted(localFileSystemMount)) {
      LOGGER.info("Waiting for mount {}", localFileSystemMount);
      Thread.sleep(TimeUnit.SECONDS.toMillis(1));
    }
  }

  private void shutdownPack(String volumeName, String id) throws IOException, InterruptedException {
    File localDevice = getLocalDevice(volumeName, id);
    File shutdownFile = new File(localDevice, SHUTDOWN);

    Process process = ExecUtil.execAsInteractive(LOGGER, Level.DEBUG, SUDO, BASH);
    try (PrintWriter writer = new PrintWriter(process.getOutputStream())) {
      writer.println("echo 1>" + shutdownFile.getCanonicalPath());
    }
    if (process.waitFor() != 0) {
      throw new IOException("Unknown error on shutdown");
    }
  }

  private void createMountErrorSnapshot(String volumeName, String id)
      throws FileNotFoundException, IOException, InterruptedException {
    File localDevice = getLocalDevice(volumeName, id);
    File snapshotFile = new File(localDevice, SNAPSHOT);
    SimpleDateFormat dateFormat = new SimpleDateFormat(HdfsSnapshotStrategy.YYYYMMDDKKMMSS);
    String format = dateFormat.format(new Date());
    String name = ERROR + format;

    Process process = ExecUtil.execAsInteractive(LOGGER, Level.DEBUG, SUDO, BASH);
    LOGGER.info("Creating mount error snapshot {} for volume {} id {}", name, volumeName, id);
    try (PrintWriter writer = new PrintWriter(process.getOutputStream())) {
      writer.println("echo " + name + ">" + snapshotFile.getCanonicalPath());
    }
    if (process.waitFor() != 0) {
      throw new IOException("Unknown error on shutdown");
    }
  }

  private File getLocalFileSystemMount(String volumeName, String id) {
    return new File(getVolumeDir(volumeName, id), FS);
  }

  private File getLocalDevice(String volumeName, String id) {
    return new File(getVolumeDir(volumeName, id), DEV);
  }

  private FileSystem getFileSystem(Path path) throws IOException {
    return path.getFileSystem(_configuration);
  }

  static class HdfsPriv implements PrivilegedExceptionAction<Void> {

    private final Exec exec;

    private HdfsPriv(Exec exec) {
      this.exec = exec;
    }

    @Override
    public Void run() throws Exception {
      exec.exec();
      return null;
    }

    static PrivilegedExceptionAction<Void> create(Exec exec) {
      return new HdfsPriv(exec);
    }

  }

  static interface Exec {
    void exec() throws Exception;
  }

  private Path getVolumePath(String volumeName) {
    return new Path(_root, volumeName);
  }
}


text:
@interface NSString (Path)

#pragma mark - value-path key

//+ (NSString *)cachePathForKey:(NSString *)key;

+ (NSString *)tempPathForKey:(NSString *)key;

#pragma mark - yun2win

+ (NSString *)realmPathForUID:(NSString *)uid;

+ (NSString *)webAppDataPathForUID:(NSString *)uid name:(NSString *)name;

+ (NSString *)attachmentPathForID:(NSString *)ID name:(NSString *)name;

+ (NSString *)getDocumentPath:(NSString *)fileName Type:(NSString *)type;

+ (NSString *)emojiPath;

#pragma mark - Helper

- (BOOL)isPathExsit;

- (unsigned long long)fileSize;

@end


text:
package com.raoulvdberge.refinedstorage.apiimpl.network.grid;

import com.raoulvdberge.refinedstorage.api.network.grid.GridFactoryType;
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
import com.raoulvdberge.refinedstorage.api.network.grid.IGridFactory;
import com.raoulvdberge.refinedstorage.tile.grid.TileGrid;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

import javax.annotation.Nullable;

public class GridFactoryGridBlock implements IGridFactory {
    @Override
    @Nullable
    public IGrid createFromStack(EntityPlayer player, ItemStack stack) {
        return null;
    }

    @Override
    @Nullable
    public IGrid createFromBlock(EntityPlayer player, BlockPos pos) {
        TileEntity tile = getRelevantTile(player.world, pos);

        if (tile instanceof TileGrid) {
            return ((TileGrid) tile).getNode();
        }

        return null;
    }

    @Nullable
    @Override
    public TileEntity getRelevantTile(World world, BlockPos pos) {
        return world.getTileEntity(pos);
    }

    @Override
    public GridFactoryType getType() {
        return GridFactoryType.BLOCK;
    }
}


text:
$(function() {
  $(".simple_attachments_singleton_div").bind("new_field", function(event, field) {
    field.appendTo($(this).children(".simple_attachments_add_file_div"));
    field.bind("loaded", function(event, data) {
      $("<img>").attr("src", data.filepath).appendTo(this);
    });
  });
  $(".simple_attachments_multiple_div").bind("new_field", function(event, field) {
    field.appendTo(this);
    field.bind("loaded", function(event, data) {
      data.destroy_link.appendTo(this);
      data.attachment_link.html(data.filename).appendTo(this);
    });
  });
});


text:
Originally published: 2008-08-10 16:45:46
Last updated: 2008-08-10 16:45:46
Author: Devan L Devan L

An example Enumeration class and metaclass to declare an enumeration in ctypes.


text:
The javascript parser got completly rewritten by [Michael Diarmid](https://github.com/Salakar) and [Ruben Bridgewater](https://github.com/BridgeAR) and is now a lot faster than the hiredis parser.
Therefore the hiredis parser was deprecated and should only be used for testing purposes and benchmarking comparison.

All Errors returned by the parser are from now on of class ReplyError

Features

-  Improved performance by up to 15x as fast as before
-  Improved options validation
-  Added ReplyError Class
-  Added parser benchmark
-  Switched default parser from hiredis to JS, no matter if hiredis is installed or not

Removed

-  Deprecated hiredis support

## v.1.3.0 - 27 Mar, 2016

Features

-  Added `auto` as parser name option to check what parser is available
-  Non existing requested parsers falls back into auto mode instead of always choosing the JS parser

## v.1.2.0 - 27 Mar, 2016

Features

-  Added `stringNumbers` option to make sure all numbers are returned as string instead of a js number for precision
-  The parser is from now on going to print warnings if a parser is explicitly requested that does not exist and gracefully chooses the JS parser

## v.1.1.0 - 26 Jan, 2016

Features

-  The parser is from now on going to reset itself on protocol errors


text:
from random import randint
from django.utils.translation import ugettext_lazy as _
from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from models import Quote, QuotePlugin

START_VAR = 'start'

class RotatingQuotes(CMSPluginBase):
    '''
    '''
    model = QuotePlugin
    name = _("Rotating Quotes")
    module = _("Quotes")

    def render(self, context, instance, placeholder):
        """ """

        request = context['request']

        self.render_template = instance.template

        # number of quotes to display
        count = instance.count
        # number of quotes in db
        base = Quote.objects.by_tag(instance.tag)
        n = len(base)
        count = min(n, count)

        quotes = []
        next = n
        if count > 0:
            try:
                a = int(request.GET.get(START_VAR, -1))
            except ValueError:
                a = -1
            if a < 0:
                a = randint(0, max(n-1,0))

            # max index
            b = (a + count) % n
            next = b #(b + 1) % n

            if b > a:
                quotes = base[a:b]
            else:
                quotes = base[a:] + base[:b]

        context.update({
            'object':instance,
            'placeholder':placeholder,
            'quotes':quotes,
            'next': next
        })
        return context

plugin_pool.register_plugin(RotatingQuotes)


text:
/**
 *  Defines the Autofocus Module.
 *  This module used to override the original `autofocus` attribute since it doesn't work properly with ngRoute
 *
 *  @author  Howard.Zuo
 *  @date    Feb 15, 2016
 *
 */
'use strict';
var FeatureBase = require('lib/FeatureBase');

class Feature extends FeatureBase{

    constructor(){
        super('AutofocusModule');
    }

    autofocus(utils){
        return {
            restrict: 'A',
            link: function($scope, element){
                utils.delay(function(){
                    element[0].focus();
                }, 100);
            }
        };
    }

    execute(){
        this.autofocus.$inject = ['utils'];
        this.directive('autofocus', this.autofocus);
    }
}

module.exports = Feature;


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <fragment
        android:id="@+id/fixed_remuxing"
        android:name="sagex.miniclient.android.ui.settings.FixedRemuxingFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>


text:
namespace StripeTests
{
    using System.Collections.Generic;
    using System.Linq;
    using System.Net.Http;
    using System.Threading.Tasks;

    using Stripe;
    using Xunit;

    public class PayoutServiceTest : BaseStripeTest
    {
        private const string PayoutId = "po_123";

        private readonly PayoutService service;
        private readonly PayoutCreateOptions createOptions;
        private readonly PayoutUpdateOptions updateOptions;
        private readonly PayoutListOptions listOptions;

        public PayoutServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new PayoutService(this.StripeClient);

            this.createOptions = new PayoutCreateOptions
            {
                Amount = 123,
                Currency = "usd",
            };

            this.updateOptions = new PayoutUpdateOptions
            {
                Metadata = new Dictionary<string, string>
                {
                    { "key", "value" },
                },
            };

            this.listOptions = new PayoutListOptions
            {
                Limit = 1,
            };
        }

        [Fact]
        public void Create()
        {
            var payout = this.service.Create(this.createOptions);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public async Task CreateAsync()
        {
            var payout = await this.service.CreateAsync(this.createOptions);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public void Cancel()
        {
            var payout = this.service.Cancel(PayoutId);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts/po_123/cancel");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public async Task CancelAsync()
        {
            var payout = await this.service.CancelAsync(PayoutId);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts/po_123/cancel");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public void Get()
        {
            var payout = this.service.Get(PayoutId);
            this.AssertRequest(HttpMethod.Get, "/v1/payouts/po_123");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public async Task GetAsync()
        {
            var payout = await this.service.GetAsync(PayoutId);
            this.AssertRequest(HttpMethod.Get, "/v1/payouts/po_123");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public void List()
        {
            var payouts = this.service.List(this.listOptions);
            this.AssertRequest(HttpMethod.Get, "/v1/payouts");
            Assert.NotNull(payouts);
            Assert.Equal("list", payouts.Object);
            Assert.Single(payouts.Data);
            Assert.Equal("payout", payouts.Data[0].Object);
        }

        [Fact]
        public async Task ListAsync()
        {
            var payouts = await this.service.ListAsync(this.listOptions);
            this.AssertRequest(HttpMethod.Get, "/v1/payouts");
            Assert.NotNull(payouts);
            Assert.Equal("list", payouts.Object);
            Assert.Single(payouts.Data);
            Assert.Equal("payout", payouts.Data[0].Object);
        }

        [Fact]
        public void ListAutoPaging()
        {
            var payout = this.service.ListAutoPaging(this.listOptions).First();
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public async Task ListAutoPagingAsync()
        {
            var payout = await this.service.ListAutoPagingAsync(this.listOptions).FirstAsync();
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public void Reverse()
        {
            var payout = this.service.Reverse(PayoutId);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts/po_123/reverse");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public async Task ReverseAsync()
        {
            var payout = await this.service.ReverseAsync(PayoutId);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts/po_123/reverse");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public void Update()
        {
            var payout = this.service.Update(PayoutId, this.updateOptions);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts/po_123");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }

        [Fact]
        public async Task UpdateAsync()
        {
            var payout = await this.service.UpdateAsync(PayoutId, this.updateOptions);
            this.AssertRequest(HttpMethod.Post, "/v1/payouts/po_123");
            Assert.NotNull(payout);
            Assert.Equal("payout", payout.Object);
        }
    }
}


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

<title>DebuggableScheduledThreadPoolExecutor (apache-cassandra API)</title>
<meta name="date" content="2016-04-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.concurrent

Class DebuggableScheduledThreadPoolExecutor

java.lang.Object

java.util.concurrent.AbstractExecutorService

java.util.concurrent.ThreadPoolExecutor

java.util.concurrent.ScheduledThreadPoolExecutor

org.apache.cassandra.concurrent.DebuggableScheduledThreadPoolExecutor

All Implemented Interfaces:

java.util.concurrent.Executor, java.util.concurrent.ExecutorService, java.util.concurrent.ScheduledExecutorService

public class DebuggableScheduledThreadPoolExecutor
extends java.util.concurrent.ScheduledThreadPoolExecutor

Like DebuggableThreadPoolExecutor, DebuggableScheduledThreadPoolExecutor always
 logs exceptions from the tasks it is given, even if Future.get is never called elsewhere.

 DebuggableScheduledThreadPoolExecutor also catches exceptions during Task execution
 so that they don't supress subsequent invocations of the task.

 Finally, there is a special rejected execution handler for tasks rejected during the shutdown hook.

 For fire and forget tasks (like ref tidy) we can safely ignore the exceptions.
 For any callers that care to know their task was rejected we cancel passed task.

Nested Class Summary

Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor

java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy

Field Summary

Fields

Modifier and Type
Field and Description

static java.util.concurrent.RejectedExecutionHandler
rejectedExecutionHandler

Constructor Summary

Constructors

Constructor and Description

DebuggableScheduledThreadPoolExecutor(int corePoolSize,
                                     java.lang.String threadPoolName,
                                     int priority)

DebuggableScheduledThreadPoolExecutor(int corePoolSize,
                                     java.util.concurrent.ThreadFactory threadFactory)

DebuggableScheduledThreadPoolExecutor(java.lang.String threadPoolName)

Method Summary

Methods

Modifier and Type
Method and Description

void
afterExecute(java.lang.Runnable r,
            java.lang.Throwable t)

java.util.concurrent.ScheduledFuture<?>
scheduleAtFixedRate(java.lang.Runnable command,
                   long initialDelay,
                   long period,
                   java.util.concurrent.TimeUnit unit)

java.util.concurrent.ScheduledFuture<?>
scheduleWithFixedDelay(java.lang.Runnable command,
                      long initialDelay,
                      long delay,
                      java.util.concurrent.TimeUnit unit)

Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor

decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submit

Methods inherited from class java.util.concurrent.ThreadPoolExecutor

allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString

Methods inherited from class java.util.concurrent.AbstractExecutorService

invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor

Methods inherited from class java.lang.Object

clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface java.util.concurrent.ExecutorService

awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated

Field Detail

rejectedExecutionHandler

public static final java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler

Constructor Detail

DebuggableScheduledThreadPoolExecutor

public DebuggableScheduledThreadPoolExecutor(int corePoolSize,
                                     java.lang.String threadPoolName,
                                     int priority)

DebuggableScheduledThreadPoolExecutor

public DebuggableScheduledThreadPoolExecutor(int corePoolSize,
                                     java.util.concurrent.ThreadFactory threadFactory)

DebuggableScheduledThreadPoolExecutor

public DebuggableScheduledThreadPoolExecutor(java.lang.String threadPoolName)

Method Detail

afterExecute

public void afterExecute(java.lang.Runnable r,
                java.lang.Throwable t)

Overrides:

afterExecute in class java.util.concurrent.ThreadPoolExecutor

scheduleAtFixedRate

public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command,
                                                          long initialDelay,
                                                          long period,
                                                          java.util.concurrent.TimeUnit unit)

Specified by:

scheduleAtFixedRate in interface java.util.concurrent.ScheduledExecutorService

Overrides:

scheduleAtFixedRate in class java.util.concurrent.ScheduledThreadPoolExecutor

scheduleWithFixedDelay

public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command,
                                                             long initialDelay,
                                                             long delay,
                                                             java.util.concurrent.TimeUnit unit)

Specified by:

scheduleWithFixedDelay in interface java.util.concurrent.ScheduledExecutorService

Overrides:

scheduleWithFixedDelay in class java.util.concurrent.ScheduledThreadPoolExecutor

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2016 The Apache Software Foundation