text:
<?php

namespace Symfony\Component\ErrorHandler\Exception;

/**
 * Fatal Error Exception.
 *
 * @author Konstanton Myakshin <koc-dp@yandex.ru>
 */
class FatalErrorException extends \ErrorException
{
    public function __construct(string $message, int $code, int $severity, string $filename, int $lineno, int $traceOffset = null, bool $traceArgs = true, array $trace = null, \Throwable $previous = null)
    {
        parent::__construct($message, $code, $severity, $filename, $lineno, $previous);

        if (null !== $trace) {
            if (!$traceArgs) {
                foreach ($trace as &$frame) {
                    unset($frame['args'], $frame['this'], $frame);
                }
            }

            $this->setTrace($trace);
        } elseif (null !== $traceOffset) {
            if (\function_exists('xdebug_get_function_stack')) {
                $trace = xdebug_get_function_stack();
                if (0 < $traceOffset) {
                    array_splice($trace, -$traceOffset);
                }

                foreach ($trace as &$frame) {
                    if (!isset($frame['type'])) {
                        // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695
                        if (isset($frame['class'])) {
                            $frame['type'] = '::';
                        }
                    } elseif ('dynamic' === $frame['type']) {
                        $frame['type'] = '->';
                    } elseif ('static' === $frame['type']) {
                        $frame['type'] = '::';
                    }

                    // XDebug also has a different name for the parameters array
                    if (!$traceArgs) {
                        unset($frame['params'], $frame['args']);
                    } elseif (isset($frame['params']) && !isset($frame['args'])) {
                        $frame['args'] = $frame['params'];
                        unset($frame['params']);
                    }
                }

                unset($frame);
                $trace = array_reverse($trace);
            } else {
                $trace = [];
            }

            $this->setTrace($trace);
        }
    }

    protected function setTrace(array $trace): void
    {
        $traceReflector = new \ReflectionProperty('Exception', 'trace');
        $traceReflector->setAccessible(true);
        $traceReflector->setValue($this, $trace);
    }
}


text:
package org.robolectric.shadows;

import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.view.Choreographer;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.Resetter;
import org.robolectric.internal.Shadow;
import org.robolectric.util.SoftThreadLocal;
import org.robolectric.util.TimeUtils;

/**
 * Shadow for {@link android.view.Choreographer}.
 *
 *
This class maintains its own concept of the current time aimed at making animations
 * work correctly. Time starts out at 0 and advances by "frameInterval" every time
 * {@link android.view.Choreographer#getFrameTimeNanos} is called.

 */
@Implements(Choreographer.class)
public class ShadowChoreographer {
  private long nanoTime = 0;
  private static long FRAME_INTERVAL = 10 * TimeUtils.NANOS_PER_MS; // 10ms
  private static final Thread MAIN_THREAD = Thread.currentThread();
  private static SoftThreadLocal<Choreographer> instance = makeThreadLocal();
  private Handler handler = new Handler(Looper.myLooper());

  private static SoftThreadLocal<Choreographer> makeThreadLocal() {
    return new SoftThreadLocal<Choreographer>() {
      @Override
      protected Choreographer create() {
        Looper looper = Looper.myLooper();
        if (looper == null) {
          throw new IllegalStateException("The current thread must have a looper!");
        }
        return Shadow.newInstance(Choreographer.class, new Class[]{Looper.class}, new Object[]{looper});
      }
    };
  }

  @Implementation
  public static Choreographer getInstance() {
    return instance.get();
  }

  @Implementation
  public void postCallbackDelayed(int callbackType, Runnable action, Object token, long delayMillis) {
    handler.postDelayed(action, delayMillis);
  }

  @Implementation
  public void removeCallbacks(int callbackType, Runnable action, Object token) {
    handler.removeCallbacks(action, token);
  }

  @Implementation
  public void postFrameCallbackDelayed(final Choreographer.FrameCallback callback, long delayMillis) {
    handler.postAtTime(new Runnable() {
      @Override public void run() {
        callback.doFrame(getFrameTimeNanos());
      }
    }, callback, SystemClock.uptimeMillis() + delayMillis);
  }

  @Implementation
  public void removeFrameCallback(Choreographer.FrameCallback callback) {
    handler.removeCallbacksAndMessages(callback);
  }

  @Implementation
  public long getFrameTimeNanos() {
    final long now = nanoTime;
    nanoTime += ShadowChoreographer.FRAME_INTERVAL;
    return now;
  }

  /**
   * Return the current inter-frame interval.
   *
   * @return  Inter-frame interval.
   */
  public static long getFrameInterval() {
    return ShadowChoreographer.FRAME_INTERVAL;
  }

  /**
   * Set the inter-frame interval used to advance the clock. By default, this is set to 1ms.
   *
   * @param frameInterval  Inter-frame interval.
   */
  public static void setFrameInterval(long frameInterval) {
    ShadowChoreographer.FRAME_INTERVAL = frameInterval;
  }

  @Resetter
  public static synchronized void reset() {
    // Blech. We need to share the main looper because somebody might refer to it in a static
    // field. We also need to keep it in a soft reference so we don't max out permgen.
    if (Thread.currentThread() != MAIN_THREAD) {
      throw new RuntimeException("You should only call this from the main thread!");
    }
    instance = makeThreadLocal();
    FRAME_INTERVAL = 10 * TimeUtils.NANOS_PER_MS; // 10ms
  }
}

redpajama_set_name: RedPajamaGithub


text:
class ChangeOptin < ActiveRecord::Migration[5.0]
  def change
    change_column_default(:users, :opt_in, true)
  end
end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

namespace Microsoft.VisualStudio.LanguageServices.CSharp.CodeModel.Interop
{
    [ComImport]
    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    [Guid("f82170cc-efe8-4f5e-8209-bc2c27b3f54d")]
    internal interface ICSExtensionMethodExtender
    {
        bool IsExtension { get; }
    }
}


text:
'use strict'

const app = require('./express')
const slapp = require('./slapp')

// use `PORT` env var on Beep Boop - default to 3000 locally
var port = process.env.PORT || 3000

var server = slapp.attachToExpress(app)

// start http server
server.listen(port, (err) => {
  if (err) {
    return console.error(err)
  }

  console.log(`Listening on port ${port}`)
})


text:
import pytest

OF_PLATDATA_OUTPUT = '''
of-platdata probe:
bool 1
byte 05
bytearray 06 00 00
int 1
intarray 2 3 4 0
longbytearray 09 0a 0b 0c 0d 0e 0f 10 11
string message
stringarray "multi-word" "message" ""
of-platdata probe:
bool 0
byte 08
bytearray 01 23 34
int 3
intarray 5 0 0 0
longbytearray 09 00 00 00 00 00 00 00 00
string message2
stringarray "another" "multi-word" "message"
of-platdata probe:
bool 0
byte 00
bytearray 00 00 00
int 0
intarray 0 0 0 0
longbytearray 00 00 00 00 00 00 00 00 00
string <NULL>
stringarray "one" "" ""
'''

@pytest.mark.buildconfigspec('spl_of_platdata')
def test_ofplatdata(u_boot_console):
    """Test that of-platdata can be generated and used in sandbox"""
    cons = u_boot_console
    output = cons.get_spawn_output().replace('\r', '')
    assert OF_PLATDATA_OUTPUT in output


text:
> Generates a static dashboard based on data parsed within specified files.

## Install

```
$ npm install --save-dev gulp-dashboard
```

### Usage Examples

#### Default Options
In this example, the default options are used to parse JSON data from within a `*.dash.json`. So when the task below runs, it will create a `index.html` file within the `dashboard` directory built from all the scanned JSON files within the `index` directory.

`index/index.dash.json`:
```json
{
    "status": "development",
    "category": "page",
    "label": "Home",
    "link": "path/to/file/index.html"
}
```

`gulpfile.js`
```js
var gulp = require('gulp');
var dashboard = require('gulp-dashboard');

gulp.task('default', function () {
  return gulp.src('index/*.dash.json')
    .pipe(dashboard())
    .pipe(gulp.dest('dist'));
});
```

#### Custom Compiler Options
In this example, you can see that the `options.compiler` property is used to control which compiler to use for rendering module templates.
So when the task below runs, it will create a `index.html` file within the `dashboard` directory built from all the scanned Jade files within the `index` directory.
Notice the `index/index.dash.jade` example: This will build out an HTML partial file using the markup within that file using the jade compiler.
It's compiled source will then be rendered out to the handlebars template specified with `options.moduleTemplate`.

`index/index.dash.json`:
```json
{
    "status": "development",
    "category": "page",
    "label": "Home",
    "link": "path/to/file/index.html"
}
```

`index/index.dash.jade`
```jade
div
  h1 Testing
    p
      This is just a simple test
```

`gulpfile.js`
```js
var gulp = require('gulp');
var dashboard = require('gulp-dashboard');

gulp.task('default', function () {
  return gulp.src('index/*.dash.{json,jade}')
    .pipe(dashboard({
      compiler: require('jade'),
      compilerOptions: {pretty: true, filename: true},
      dashTemplate: 'dashboard/dashboard-template.hbs',
      moduleTemplate: 'dashboard/module-template.hbs'
    }))
    .pipe(gulp.dest('dist'));
});
```

## API

### Options

#### options.compiler
Type: `Object`
Default value: `undefined`

Compiler you would like to use for rendering templates. The compiler you use must have a `render` method in order to work (ex. Jade, Swig, etc)

> NOTE: You will need to install your desired template compiler and require it as the value of the compile key

Example:
```js
options: {
  compiler: require('jade')
}
```

#### options.compilerOptions
Type: `Object`
Default value: `{}`

Compiler options you would like to pass into your desired compiler.

Example:
```js
options: {
  compiler: require('jade'),
  compilerOptions: {pretty: true, filename: true}
}
```

#### options.generatedDir
Type: `String`
Default value: `dashboard/generated`

A string value that is used to determine where the dashboard html file will be generated.

#### options.dashTemplate
Type: `String`
Default value: `node_modules/gulp-dashboard/dashboard/dashboard-template.hbs`

A string value that is used to determine what handlebars template should be used for generating the dashboard.

#### options.name
Type: `String`
Default value: `dashboard`

A string value that is used to determine what the filename will be for the generated dashboard HTML.

#### options.moduleTemplate
Type: `String`
Default value: `node_modules/gulp-dashboard/dashboard/module-template.hbs`

A string value that is used to determine what handlebars template should be used for generating components and other HTML partials.

#### options.logo
Type: `String`
Default value: `''`

A string value that is used to determine what image should be used in a template as a logo.

#### options.data
Type: `Object`
Default value: `{}`

An object of custom variables that will be passed to the Handlebars template. Useful if you want to pass things like version information or other custom variables from your Gulp build process.

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Gulp](http://gulpjs.com/).

## Release History

v1.0.2 - Added `options.name` to allow user to change the filename output

v1.0.1 - Fixed output pathing errors

v1.0.0 - Initial release

## License

MIT © [Jake Larson](https://github.com/larsonjj)


text:
<?php

namespace Mimazoo\SoaBundle\Tests\Utils;

use Mimazoo\SoaBundle\Utils\Regex;

class RegexTest extends \PHPUnit_Framework_TestCase
{

	public function providerOkGetIdFromUrl()
	{
		return array(
			array('http://api.buksl.loc/app_dev.php/providers/2/employees/5?expand=selectionItems', 5),
			array('http://api.buksl.loc/app_dev.php/providers/2/employees/7', 7),
		);
	}

	/**
	 * @dataProvider providerOkGetIdFromUrl
	 */
	public function testGetIdFromUrlOk($url, $expectedValue)
    {
        $this->assertEquals( $expectedValue, Regex::getIdFromUrl($url) );
    }

   public function providerExceptionGetIdFromUrl()
	{
		return array(
			array('http://api.buksl.loc/app_dev.php/providers/2/employees'),
		);
	}

    /**
     * @dataProvider providerExceptionGetIdFromUrl
     * @expectedException Mimazoo\SoaBundle\Utils\Exception\RegexException
     */
    public function testGetIdFromUrlException($url)
    {
    	Regex::getIdFromUrl($url);
    }

}


text:
<resources>
    <string name="app_name">MusicPlayer</string>
    <string name="action_settings">Settings</string>
    <string name="section_format">Hello World from section: %1$d</string>
</resources>


text:
import React from 'react';
import renderer from 'react-test-renderer';
import { TableCell } from 'cf-component-table';

test('should render', () => {
  const component = renderer.create(<TableCell>TableCell</TableCell>);
  expect(component.toJSON()).toMatchSnapshot();
});

test('should render extra class name', () => {
  const component = renderer.create(
    <TableCell className="extra">TableCell</TableCell>
  );
  expect(component.toJSON()).toMatchSnapshot();
});

test('should render with align', () => {
  const component = renderer.create(
    <TableCell align="center">TableCell</TableCell>
  );
  expect(component.toJSON()).toMatchSnapshot();
});


text:
<resources>
    <string name="title_activity_home">Torrents - NyaaPantsu</string>
    <string name="title_activity_results">Results for</string>

    <string name="navigation_drawer_open">Open navigation drawer</string>
    <string name="navigation_drawer_close">Close navigation drawer</string>

    <string name="action_settings">Settings</string>
    <string name="upload">Upload</string>
    <string name="search">Search</string>
    <string name="torrents">Torrents</string>
    <string name="settings">Settings</string>
    <string name="about">About Us</string>
    <string name="title_activity_search">Search - NyaaPantsu</string>
    <string name="category">Category</string>
    <string name="status">Status</string>
    <string name="max">Max</string>
    <string name="other">Other</string>
    <string name="loading">Loading data…</string>
    <string name="preparing">Preparing streaming…</string>
    <string name="downloading">Downloading…</string>
    <string name="uploaded_by">Uploaded by</string>
    <string name="date">Date</string>
    <string name="size">Size</string>
    <string name="download">Download</string>
    <string name="copy">Copy</string>
    <string name="show_more">Show More</string>
    <string name="website">Website</string>
    <string name="hash">Hash</string>
    <string name="Files">Files</string>
    <string name="last_scraped">Last Scraped</string>
    <string name="downloads">Downloads</string>
    <string-array name="cat_array">
        <item>All Categories</item>
        <item>Anime</item>
        <item>Anime - Anime Music Video</item>
        <item>Anime - English-translated</item>
        <item>Anime - Non-English-translated</item>
        <item>Anime - Raw</item>
        <item>Audio</item>
        <item>Audio - Lossless</item>
        <item>Audio - Lossy</item>
        <item>Literature</item>
        <item>Literature - English-translated</item>
        <item>Literature - Non-English-translated</item>
        <item>Literature - Raw</item>
        <item>Live Action</item>
        <item>Live Action - English-translated</item>
        <item>Live Action - Idol/Promotional Video</item>
        <item>Live Action - Non-English-translated</item>
        <item>Live Action - Raw</item>
        <item>Pictures</item>
        <item>Pictures - Graphics</item>
        <item>Pictures - Photos</item>
        <item>Software</item>
        <item>Software - Applications</item>
        <item>Software - Games</item>
    </string-array>
    <string-array name="status_array">
        <item>Show All</item>
        <item>Filter Remakes</item>
        <item>Trusted</item>
        <item>A+</item>
    </string-array>
    <string-array name="language_array">
        <item>Catalan</item>
        <item>Simplified Chinese</item>
        <item>Traditional Chinese</item>
        <item>Dutch</item>
        <item>English</item>
        <item>French</item>
        <item>German</item>
        <item>Hungarian</item>
        <item>Icelandic</item>
        <item>Italian</item>
        <item>Japanese</item>
        <item>Korean</item>
        <item>Norwegian</item>
        <item>Portuguese</item>
        <item>Romanian</item>
        <item>Spanish</item>
        <item>Swedish</item>
        <item>Thai</item>
    </string-array>

    <string name="network_error">Network error</string>
    <string name="token_expired">You\'ve been logged out, your token credentials have expired.</string>
    <string name="title_activity_login">Sign in</string>
    <string name="title_activity_about">About - NyaaPantsu</string>
    <string name="torrent_not_available">The torrent doesn\'t seem to be available</string>
    <string name="external_storage_not_available">External Storage doesn\'t seem to be available</string>
    <string name="magnet_copied">Magnet Link copied!</string>

    <!-- Upload Messages -->
    <string name="upload_progress">Uploading at [[UPLOAD_RATE]] ([[PROGRESS]])</string>
    <string name="upload_done">Upload completed successfully in [[ELAPSED_TIME]]</string>
    <string name="try_error">The torrent couldn\'t be created due to an error, please try again!</string>

    <!-- Upload Errors -->
    <string name="upload_error">Error while uploading</string>
    <string name="name_required">Torrent name is required!</string>
    <string name="file_required">A torrent file or magnet is needed!</string>
    <string name="category_required">A category must be selected!</string>
    <string name="lang_next_time">No language selected! You should select one next time!</string>

    <!-- Strings related to login -->
    <string name="prompt_username">Username</string>
    <string name="prompt_password">Password</string>
    <string name="action_sign_in">Sign in</string>
    <string name="action_sign_in_short">Sign in</string>
    <string name="error_invalid_username">This username is too short</string>
    <string name="error_invalid_password">This password is too short</string>
    <string name="error_incorrect_password">This password is incorrect</string>
    <string name="error_field_required">This field is required</string>
    <string name="permission_rationale">"Contacts permissions are needed for providing email
        completions."
    </string>
    <string name="log_in">Log In</string>
    <string name="log_out">Log out</string>

    <string name="hello_blank_fragment">Hello blank fragment</string>
    <string name="close">Close</string>
    <string name="torrent_file">Torrent File</string>
    <string name="choose">Choose...</string>
    <string name="name">Name</string>
    <string name="language">Language</string>
    <string name="description">Description</string>
    <string name="mark_as_remake">Mark as Remake</string>
    <string name="mark_as_anon">Upload as Anonymous</string>
    <string name="congrats">Congratulation!</string>
    <string name="welcome_mess">You just have downloaded the NyaaPantsu App. You can now try to *mofu* *mofu* (click) Megumin to have full access!</string>
    <string name="about_mess">This app is distributed under MIT License. This is purely an educational proof of concept.</string>
    <string name="megumin">Megumin</string>
    <string name="title_activity_settings">Settings</string>

    <!-- Strings related to Settings -->

    <string name="pref_header_account">Account</string>
    <string name="pref_header_general">General</string>

    <string name="pref_title_keep_login">Remember my account</string>
    <string name="pref_description_keep_login">Log you in every time you start the app (does not store your password)
    </string>

    <!-- Example settings for Data & Sync -->
    <string name="pref_header_data_sync">Data & sync</string>

    <string name="pref_title_sync_frequency">Sync frequency</string>
    <string-array name="pref_sync_frequency_titles">
        <item>15 minutes</item>
        <item>30 minutes</item>
        <item>1 hour</item>
        <item>3 hours</item>
        <item>6 hours</item>
        <item>Never</item>
    </string-array>
    <string-array name="pref_sync_frequency_values">
        <item>15</item>
        <item>30</item>
        <item>60</item>
        <item>180</item>
        <item>360</item>
        <item>-1</item>
    </string-array>

    <string name="pref_title_system_sync_settings">System sync settings</string>

    <!-- Example settings for Notifications -->
    <string name="pref_header_notifications">Notifications</string>

    <string name="pref_title_enable_notifications">Enable notifications</string>

    <string name="pref_title_ringtone">Ringtone</string>
    <string name="pref_ringtone_silent">Silent</string>

    <string name="pref_title_vibrate">Vibrate</string>
    <string name="from">From</string>
    <string name="to">To</string>
    <string name="watch">Watch</string>
    <string name="title_activity_watch">Watch Anime!</string>
    <string name="recent">Recent</string>
    <string name="stream">Stream</string>
    <string name="clear">Clear</string>
    <string name="ok">OK</string>
    <string name="cancel">Cancel</string>
    <string name="doubleBackToExit">Please click BACK again to exit</string>
    <string name="pref_title_double_back_to_exit">Double back to exit</string>
    <string name="pref_title_enable_mascot_voice">Enable mascot voice</string>
    <string name="title_activity_profile">ProfileActivity</string>
    <string name="user_profile">User profile</string>
    <string name="deleted">Deleted</string>
    <string name="permission_required">Permission required</string>
    <string name="type_languages">Type languages</string>
    <string name="done">Done</string>
    <string name="magnet">Magnet</string>
    <string name="play">Play</string>
</resources>


text:
<?php

namespace Tests\Unit\WindowsAzure\ServiceRuntime\Internal;
use Tests\Framework\TestResources;
use WindowsAzure\ServiceRuntime\Internal\RuntimeKernel;

/**
 * Unit tests for class RuntimeKernel.
 *
 * @category  Microsoft
 * @package   Tests\Unit\WindowsAzure\ServiceRuntime\Internal
 * @author    Azure PHP SDK <azurephpsdk@microsoft.com>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @version   Release: 0.4.1_2015-03
 * @link      https://github.com/windowsazure/azure-sdk-for-php
 */
class RuntimeKernelTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::__construct
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getKernel
     */
    public function testGetKernel()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel(true);

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\RuntimeKernel', $runtimeKernel);
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getCurrentStateSerializer
     */
    public function testGetCurrentStateSerializer()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\XmlCurrentStateSerializer',
            $runtimeKernel->getCurrentStateSerializer());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getGoalStateDeserializer
     */
    public function testGetGoalStateDeserializer()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\ChunkedGoalStateDeserializer',
            $runtimeKernel->getGoalStateDeserializer());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getInputChannel
     */
    public function testGetInputChannel()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\FileInputChannel',
            $runtimeKernel->getInputChannel());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getOutputChannel
     */
    public function testGetOutputChannel()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\FileOutputChannel',
            $runtimeKernel->getOutputChannel());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getProtocol1RuntimeCurrentStateClient
     */
    public function testGetProtocol1RuntimeCurrentStateClient()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeCurrentStateClient',
            $runtimeKernel->getProtocol1RuntimeCurrentStateClient());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getRoleEnvironmentDataDeserializer
     */
    public function testGetRoleEnvironmentDataDeserializer()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\XmlRoleEnvironmentDataDeserializer',
            $runtimeKernel->getRoleEnvironmentDataDeserializer());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getProtocol1RuntimeGoalStateClient
     */
    public function testGetProtocol1RuntimeGoalStateClient()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient',
            $runtimeKernel->getProtocol1RuntimeGoalStateClient());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getRuntimeVersionProtocolClient
     */
    public function testGetRuntimeVersionProtocolClient()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\RuntimeVersionProtocolClient',
            $runtimeKernel->getRuntimeVersionProtocolClient());
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeKernel::getRuntimeVersionManager
     */
    public function testGetRuntimeVersionManager()
    {
        // Setup
        $runtimeKernel = RuntimeKernel::getKernel();

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\RuntimeVersionManager',
            $runtimeKernel->getRuntimeVersionManager());
    }
}


text:
package gueei.binding.viewAttributes.view;

import java.util.ArrayList;
import java.util.Collection;

import gueei.binding.DynamicObject;
import gueei.binding.IObservable;
import gueei.binding.Observer;
import gueei.binding.ViewAttribute;
import android.view.View;

/**
 * Assign a value back to View Model
 * In MVVM, ideally we don't want to let View Model to know much about display logic,
 * but the layout XML is supposed to aware of different device configuration
 *
 * for example, we can write
 * binding:assign="{ displayInNewActivity=TRUE() }"
 *
 * so, in the view model, the displayInActivity will set to true.
 *
 * In this way, we can free the view model from trying to detect what display configuration it is in,
 * because XML layout/resources can be prepared with different configurations (e.g. -land, -port, -v14 etc)
 *
 * You can assign to multiple properties, since the accepted parameter is dynamic object:
 *
 * e.g. binding:assign="{ propA = 'AValue', propB = 'BValue', propC = 'CValue' }"
 *
 * Note: This is currently only attribute that is not related to any view
 *
 * @name assign
 * @widget View
 * @type gueei.binding.DynamicObject
 *
 * @accepts	gueei.binding.DynamicObject

 * @category simple special
 *
 * @author andy
 */
public class AssignViewAttribute extends ViewAttribute<View, DynamicObject> {

	IObservable<?> prop, val;

	public AssignViewAttribute(View view) {
		super(DynamicObject.class, view, "assign");
	}

	@Override
	protected void doSetAttributeValue(Object newValue) {
		if(getView()==null) return;
		if (newValue==null || !(newValue instanceof DynamicObject)){
			return;
		}
		DynamicObject value = (DynamicObject)newValue;
		try{
			prop = value.getObservableByName("prop");
			val = value.getObservableByName("value");
			val.subscribe(new Observer(){
				@Override
				public void onPropertyChanged(IObservable<?> prop,
						Collection<Object> initiators) {
					prop._setObject(val.get(), initiators);
				}
			});
			ArrayList<Object> initiators = new ArrayList<Object>();
			initiators.add(this);
			initiators.add(value);
			prop._setObject(val.get(), initiators);
		}catch(Exception e){}
	}

	@Override
	public DynamicObject get() {
		return null;
	}
}


text:
import collections

from metrics import Metric
from telemetry.core import bitmap

class SpeedIndexMetric(Metric):
  """The speed index metric is one way of measuring page load speed.

  It is meant to approximate user perception of page load speed, and it
  is based on the amount of time that it takes to paint to the visual
  portion of the screen. It includes paint events that occur after the
  onload event, and it doesn't include time loading things off-screen.

  This speed index metric is based on WebPageTest.org (WPT).
  For more info see: http://goo.gl/e7AH5l
  """
  def __init__(self):
    super(SpeedIndexMetric, self).__init__()
    self._impl = None

  @classmethod
  def CustomizeBrowserOptions(cls, options):
    options.AppendExtraBrowserArgs('--disable-infobars')

  def Start(self, _, tab):
    """Start recording events.

    This method should be called in the WillNavigateToPage method of
    a PageMeasurement, so that all the events can be captured. If it's called
    in DidNavigateToPage, that will be too late.
    """
    self._impl = (VideoSpeedIndexImpl() if tab.video_capture_supported else
                  PaintRectSpeedIndexImpl())
    self._impl.Start(tab)

  def Stop(self, _, tab):
    """Stop timeline recording."""
    assert self._impl, 'Must call Start() before Stop()'
    assert self.IsFinished(tab), 'Must wait for IsFinished() before Stop()'
    self._impl.Stop(tab)

  # Optional argument chart_name is not in base class Metric.
  # pylint: disable=W0221
  def AddResults(self, tab, results, chart_name=None):
    """Calculate the speed index and add it to the results."""
    index = self._impl.CalculateSpeedIndex(tab)
    # Release the tab so that it can be disconnected.
    self._impl = None
    results.Add('speed_index', 'ms', index, chart_name=chart_name)

  def IsFinished(self, tab):
    """Decide whether the timeline recording should be stopped.

    When the timeline recording is stopped determines which paint events
    are used in the speed index metric calculation. In general, the recording
    should continue if there has just been some data received, because
    this suggests that painting may continue.

    A page may repeatedly request resources in an infinite loop; a timeout
    should be placed in any measurement that uses this metric, e.g.:
      def IsDone():
        return self._speedindex.IsFinished(tab)
      util.WaitFor(IsDone, 60)

    Returns:
      True if 2 seconds have passed since last resource received, false
      otherwise.
    """
    return tab.HasReachedQuiescence()

class SpeedIndexImpl(object):

  def Start(self, tab):
    raise NotImplementedError()

  def Stop(self, tab):
    raise NotImplementedError()

  def GetTimeCompletenessList(self, tab):
    """Returns a list of time to visual completeness tuples.

    In the WPT PHP implementation, this is also called 'visual progress'.
    """
    raise NotImplementedError()

  def CalculateSpeedIndex(self, tab):
    """Calculate the speed index.

    The speed index number conceptually represents the number of milliseconds
    that the page was "visually incomplete". If the page were 0% complete for
    1000 ms, then the score would be 1000; if it were 0% complete for 100 ms
    then 90% complete (ie 10% incomplete) for 900 ms, then the score would be
    1.0*100 + 0.1*900 = 190.

    Returns:
      A single number, milliseconds of visual incompleteness.
    """
    time_completeness_list = self.GetTimeCompletenessList(tab)
    prev_completeness = 0.0
    speed_index = 0.0
    prev_time = time_completeness_list[0][0]
    for time, completeness in time_completeness_list:
      # Add the incemental value for the interval just before this event.
      elapsed_time = time - prev_time
      incompleteness = (1.0 - prev_completeness)
      speed_index += elapsed_time * incompleteness

      # Update variables for next iteration.
      prev_completeness = completeness
      prev_time = time
    return int(speed_index)

class VideoSpeedIndexImpl(SpeedIndexImpl):

  def __init__(self):
    super(VideoSpeedIndexImpl, self).__init__()
    self._time_completeness_list = None

  def Start(self, tab):
    assert tab.video_capture_supported
    # Blank out the current page so it doesn't count towards the new page's
    # completeness.
    tab.Highlight(bitmap.WHITE)
    # TODO(tonyg): Bitrate is arbitrary here. Experiment with screen capture
    # overhead vs. speed index accuracy and set the bitrate appropriately.
    tab.StartVideoCapture(min_bitrate_mbps=4)

  def Stop(self, tab):
    # Ignore white because Chrome may blank out the page during load and we want
    # that to count as 0% complete. Relying on this fact, we also blank out the
    # previous page to white. The tolerance of 8 experimentally does well with
    # video capture at 4mbps. We should keep this as low as possible with
    # supported video compression settings.
    histograms = [(time, bmp.ColorHistogram(ignore_color=bitmap.WHITE,
                                            tolerance=8))
                  for time, bmp in tab.StopVideoCapture()]

    start_histogram = histograms[0][1]
    final_histogram = histograms[-1][1]
    total_distance = start_histogram.Distance(final_histogram)

    def FrameProgress(histogram):
      if total_distance == 0:
        if histogram.Distance(final_histogram) == 0:
          return 1.0
        else:
          return 0.0
      return 1 - histogram.Distance(final_histogram) / total_distance

    self._time_completeness_list = [(time, FrameProgress(hist))
                                    for time, hist in histograms]

  def GetTimeCompletenessList(self, tab):
    assert self._time_completeness_list, 'Must call Stop() first.'
    return self._time_completeness_list

class PaintRectSpeedIndexImpl(SpeedIndexImpl):

  def __init__(self):
    super(PaintRectSpeedIndexImpl, self).__init__()

  def Start(self, tab):
    tab.StartTimelineRecording()

  def Stop(self, tab):
    tab.StopTimelineRecording()

  def GetTimeCompletenessList(self, tab):
    events = tab.timeline_model.GetAllEvents()
    viewport = self._GetViewportSize(tab)
    paint_events = self._IncludedPaintEvents(events)
    time_area_dict = self._TimeAreaDict(paint_events, viewport)
    total_area = sum(time_area_dict.values())
    assert total_area > 0.0, 'Total paint event area must be greater than 0.'
    completeness = 0.0
    time_completeness_list = []

    # TODO(tonyg): This sets the start time to the start of the first paint
    # event. That can't be correct. The start time should be navigationStart.
    # Since the previous screen is not cleared at navigationStart, we should
    # probably assume the completeness is 0 until the first paint and add the
    # time of navigationStart as the start. We need to confirm what WPT does.
    time_completeness_list.append(
        (tab.timeline_model.GetAllEvents()[0].start, completeness))

    for time, area in sorted(time_area_dict.items()):
      completeness += float(area) / total_area
      # Visual progress is rounded to the nearest percentage point as in WPT.
      time_completeness_list.append((time, round(completeness, 2)))
    return time_completeness_list

  def _GetViewportSize(self, tab):
    """Returns dimensions of the viewport."""
    return tab.EvaluateJavaScript('[ window.innerWidth, window.innerHeight ]')

  def _IncludedPaintEvents(self, events):
    """Get all events that are counted in the calculation of the speed index.

    There's one category of paint event that's filtered out: paint events
    that occur before the first 'ResourceReceiveResponse' and 'Layout' events.

    Previously in the WPT speed index, paint events that contain children paint
    events were also filtered out.
    """
    def FirstLayoutTime(events):
      """Get the start time of the first layout after a resource received."""
      has_received_response = False
      for event in events:
        if event.name == 'ResourceReceiveResponse':
          has_received_response = True
        elif has_received_response and event.name == 'Layout':
          return event.start
      assert False, 'There were no layout events after resource receive events.'

    first_layout_time = FirstLayoutTime(events)
    paint_events = [e for e in events
                    if e.start >= first_layout_time and e.name == 'Paint']
    return paint_events

  def _TimeAreaDict(self, paint_events, viewport):
    """Make a dict from time to adjusted area value for events at that time.

    The adjusted area value of each paint event is determined by how many paint
    events cover the same rectangle, and whether it's a full-window paint event.
    "Adjusted area" can also be thought of as "points" of visual completeness --
    each rectangle has a certain number of points and these points are
    distributed amongst the paint events that paint that rectangle.

    Args:
      paint_events: A list of paint events
      viewport: A tuple (width, height) of the window.

    Returns:
      A dictionary of times of each paint event (in milliseconds) to the
      adjusted area that the paint event is worth.
    """
    width, height = viewport
    fullscreen_area = width * height

    def ClippedArea(rectangle):
      """Returns rectangle area clipped to viewport size."""
      _, x0, y0, x1, y1 = rectangle
      clipped_width = max(0, min(width, x1) - max(0, x0))
      clipped_height = max(0, min(height, y1) - max(0, y0))
      return clipped_width * clipped_height

    grouped = self._GroupEventByRectangle(paint_events)
    event_area_dict = collections.defaultdict(int)

    for rectangle, events in grouped.items():
      # The area points for each rectangle are divided up among the paint
      # events in that rectangle.
      area = ClippedArea(rectangle)
      update_count = len(events)
      adjusted_area = float(area) / update_count

      # Paint events for the largest-area rectangle are counted as 50%.
      if area == fullscreen_area:
        adjusted_area /= 2

      for event in events:
        # The end time for an event is used for that event's time.
        event_time = event.end
        event_area_dict[event_time] += adjusted_area

    return event_area_dict

  def _GetRectangle(self, paint_event):
    """Get the specific rectangle on the screen for a paint event.

    Each paint event belongs to a frame (as in html <frame> or <iframe>).
    This, together with location and dimensions, comprises a rectangle.
    In the WPT source, this 'rectangle' is also called a 'region'.
    """
    def GetBox(quad):
      """Gets top-left and bottom-right coordinates from paint event.

      In the timeline data from devtools, paint rectangle dimensions are
      represented x-y coordinates of four corners, clockwise from the top-left.
      See: function WebInspector.TimelinePresentationModel.quadFromRectData
      in file src/out/Debug/obj/gen/devtools/TimelinePanel.js.
      """
      x0, y0, _, _, x1, y1, _, _ = quad
      return (x0, y0, x1, y1)

    assert paint_event.name == 'Paint'
    frame = paint_event.args['frameId']
    return (frame,) + GetBox(paint_event.args['data']['clip'])

  def _GroupEventByRectangle(self, paint_events):
    """Group all paint events according to the rectangle that they update."""
    result = collections.defaultdict(list)
    for event in paint_events:
      assert event.name == 'Paint'
      result[self._GetRectangle(event)].append(event)
    return result


text:
package main

import (
	"github.com/zephyyrr/plugins"
	"os"
	"time"
)

func main() {
	client, err := plugins.NewClient(plugins.PluginDecl{
		Name: "messanger",
		Provides: []plugins.Event{
			"log",
		},
	}, os.Stdin, os.Stdout)

	if err != nil {
		panic(err)
	}

	go client.Run()

	client.Dispatch("log", plugins.Args{
		"Level":   "INFO",
		"Origin":  "messanger",
		"Message": "Remote pluging through stdin/stdout is connected.",
	})
	time.Sleep(1000 * time.Millisecond)
}


text:
#region Copyright (c) Lokad 2009
// This code is released under the terms of the new BSD licence.
// URL: http://www.lokad.com/
#endregion

using System.IO;
using System.Xml.Linq;
using Lokad.Serialization;

namespace Lokad.Cloud.Storage
{
	///
	/// Optional extension for custom formatters supporting an
	/// intermediate xml representation for inspection and recovery.
	///
	/// <remarks>
	/// This extension can be implemented even when the serializer
	/// is not xml based but in a format that can be transformed
	/// to xml easily in a robust way (i.e. more robust than
	/// deserializing to a full object). Note that formatters
	/// should be registered in IoC as IBinaryFormatter, not by
	/// this extension interface.
	/// </remarks>
	public interface IIntermediateDataSerializer : IDataSerializer
	{
		/// Unpack and transform an object from a stream to xml.
		XElement UnpackXml(Stream source);

		/// Transform and repack an object from xml to a stream.
		void RepackXml(XElement data, Stream destination);
	}
}


text:
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.actions;

import com.intellij.openapi.actionSystem.ActionGroupUtil;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.project.DumbAware;
import org.jetbrains.annotations.NotNull;

/**
 * This group turns itself into a popup if there's more than {@link #getChildrenCountThreshold()} children
 *
 * @see NonEmptyActionGroup
 * @see NonTrivialActionGroup
 */
public class SmartPopupActionGroup extends DefaultActionGroup implements DumbAware {

  @Override
  public final @NotNull ActionUpdateThread getActionUpdateThread() {
    return ActionUpdateThread.BGT;
  }

  protected int getChildrenCountThreshold() {
    return 2;
  }

  @Override
  public void update(@NotNull AnActionEvent e) {
    int size = ActionGroupUtil.getVisibleActions(this, e).take(getChildrenCountThreshold() + 1).size();
    e.getPresentation().setEnabledAndVisible(size > 0);
    e.getPresentation().setPopupGroup(size > getChildrenCountThreshold());
    e.getPresentation().setDisableGroupIfEmpty(false);
  }
}


text:
package org.axonframework.spring.config.annotation;

import org.axonframework.messaging.annotation.ClasspathHandlerEnhancerDefinition;
import org.axonframework.messaging.annotation.HandlerEnhancerDefinition;
import org.axonframework.messaging.annotation.MultiHandlerEnhancerDefinition;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;

/**
 * Spring factory bean that creates a HandlerEnhancerDefinition instance that is capable of resolving parameter values
 * as Spring Beans, in addition to the default behavior defined by Axon.
 *
 * @author Milan Savic
 * @see ClasspathHandlerEnhancerDefinition
 * @since 3.3
 * @deprecated Replaced by the {@link HandlerDefinitionFactoryBean}.
 */
@Deprecated
public class SpringHandlerEnhancerDefinitionBean implements FactoryBean<HandlerEnhancerDefinition>,
        BeanClassLoaderAware, InitializingBean, ApplicationContextAware {

    private final List<HandlerEnhancerDefinition> enhancers = new ArrayList<>();
    private ClassLoader classLoader;
    private ApplicationContext applicationContext;

    /**
     * Initializes definition bean with assumption that application context will be injected.
     */
    public SpringHandlerEnhancerDefinitionBean() {
        // nothing to do, application context will be injected by spring
    }

    /**
     * Initializes definition bean with given application context.
     *
     * @param applicationContext application context
     */
    public SpringHandlerEnhancerDefinitionBean(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
        initialize();
    }

    @Override
    public void setBeanClassLoader(@Nonnull ClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    @Override
    public HandlerEnhancerDefinition getObject() {
        return MultiHandlerEnhancerDefinition.ordered(enhancers);
    }

    @Override
    public Class<?> getObjectType() {
        return MultiHandlerEnhancerDefinition.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }

    @Override
    public void afterPropertiesSet() {
        initialize();
    }

    @Override
    public void setApplicationContext(@Nonnull ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    /**
     * Defines any additional handler enhancer definitions that should be used. By default, the
     * HandlerEnhancerDefinitions are found on the classpath, as well as a SpringBeanParameterResolverFactory are
     * registered.
     *
     * @param additionalFactories The extra definitions to register
     * @see SpringBeanParameterResolverFactory
     * @see ClasspathHandlerEnhancerDefinition
     */
    public void setAdditionalHandlers(List<HandlerEnhancerDefinition> additionalFactories) {
        this.enhancers.addAll(additionalFactories);
    }

    private void initialize() {
        enhancers.addAll(ClasspathHandlerEnhancerDefinition.forClassLoader(classLoader).getDelegates());
        Map<String, HandlerEnhancerDefinition> enhancersFound = applicationContext.getBeansOfType(
                HandlerEnhancerDefinition.class);
        enhancers.addAll(enhancersFound.values());
    }
}


text: The 5 minute PHP framework


text:
<!DOCTYPE html>

    <title>Adron's Thrashing Code</title>
    <meta name="description" content="">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="alternate" href="/feed.xml" type="application/rss+xml" title="Coder, Messenger, Recon, Infrastructure, Ops, & A Sprinkling of Metal">
    <link rel="icon" type="image/png" href="/img/favicons/favicon-16x16.png" sizes="16x16">
    <link rel="icon" type="image/png" href="/img/favicons/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/img/favicons/favicon-96x96.png" sizes="96x96">
    <link rel="apple-touch-icon" sizes="57x57" href="/img/favicons/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/img/favicons/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/img/favicons/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/img/favicons/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/img/favicons/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/img/favicons/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/img/favicons/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/img/favicons/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/img/favicons/apple-touch-icon-180x180.png">
    <link rel="stylesheet" href="/css/custom.css">
    <link rel="stylesheet" href="/css/style.min.css">

Thrashing Code News

Conf - Meetup - Events

Speaking - Presentations - Workshops

Calendar of Engagements

Docs

Contact

Message

Hire

About

Speaking, Coding, and Visiting Salem, Oregon

 « Home

                <docs class="article">

original post on Medium

I like to take a trip down to Salem every now and again. It's a great chance to break away from the daily grind in the bigger city. When I lived in Portland or now in Seattle, it didn't matter, still a great small city to go visit. The other cool thing is

I can often combine business and taking a break at the same time in Salem.

The City

Even though it's a small city it bats way above its size when it comes to excellent food, coffee, beer, and related things. This is always nice to combine with that slower pace of things that a small city provides. The downtown is also beautifully walkable and compact. One can walk to any point in the city in a matter of minutes.

The coffee scene there is seriously on point too. With establishments like The Gov Cup and Archive providing premium coffee options in truly relaxed, chill, and comfortable settings it makes doing a little work and enjoying some espresso an easy thing to do.

Combine that with my other requirements of easy to get to, easy to bike, non-hostile drivers, and beautiful parks and natural environments around and Salem is perfect.

The Tech

Combining all the aforementioned things with some tech makes everything even more fun! In Salem there's a group I've spoken at a few times called Willamette Valley Software Engineers. It's a solid group of people, where I regularly gather an audience of 40+ people to present to, converse with, and we often continue onward after presentations across Mill Creek to Boon's Treasury for conversation a round afterward.

This recent trip I presented, with direct inspiration from Bob Ross, on "The Joy of Coding". It was the first time attempting to put a talk together in this format. Overall, I believe it worked out pretty well, which the audience elaborated on after the talk on ways I can tidy up this or that and really add some "wonderful trees and forests to the grand mountains" of the presentation as a painting. I'll be presenting this again and hoping to put a video of the talk together soon. So stay tuned to Composite Code and follow me on Twitter @Adron for future dates.

All in all a great trip. I always enjoy Salem. So until another time, cheers Salem!

                </docs>

« Home


text:
<!DOCTYPE html>

    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/3c214ab9/css/bootstrap.css" rel="stylesheet">
<link href="./assets/14832793/style.css" rel="stylesheet">

    <title>Component, canis\keyProvider\Component - Yii 2 Key Provider</title>

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

</button>Yii 2 Key Provider

Class reference

    <input id="searchbox" type="text" class="form-control" placeholder="Search">

canis\keyProvider
Component
Extension
KeyPairReference

canis\keyProvider\base
FailedDecryptionException
FailedEncryptionException
InaccessibleKeyPairException
InsecureKeyPairException

canis\keyProvider\encryption
BaseKeyPair
KeyPair
KeyPairInterface
SecureKeyPair
SecureKeyPairInterface

canis\keyProvider\providers
BaseFlysystemProvider
BaseProvider
FlysystemProvider
LocalProvider
ProviderInterface

Class canis\keyProvider\Component

    All Classes
                | Methods

    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>

Inheritance	canis\keyProvider\Component »
yii\base\Component

Available since version	1.0

Public Methods

Hide inherited methods

<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>

  Method	Description	Defined By

        getInstance()
        Gets an instance of itself
        canis\keyProvider\Component

        getProvider()
        Retrieves a provider by ID
        canis\keyProvider\Component

        init()
        Initializes the component; statically store instance
        canis\keyProvider\Component

        internalRegisterProvider()
        Providers self-register themselves using this function
        canis\keyProvider\Component

        registerProvider()
        Register a provider with the component
        canis\keyProvider\Component

        registerProviders()

        canis\keyProvider\Component

        setProviders()
        Sets the providers for instantiation when first retrieved
        canis\keyProvider\Component

Method Details

        getInstance()

            public            method

Gets an instance of itself

canis\keyProvider\Component getInstance( )

                  return
                  canis\keyProvider\Component

Instance of self

        getProvider()

            public            method

Retrieves a provider by ID

boolean|canis\keyProvider\providers\ProviderInterface getProvider( $id )

                  $id
                  string

ID of provider to retrieve

                  return
                  boolean|canis\keyProvider\providers\ProviderInterface

Provider instance or false if not found

        init()

            public            method

Initializes the component; statically store instance

void init( )

        internalRegisterProvider()

            public            method

Providers self-register themselves using this function

void internalRegisterProvider( $provider )

                  $provider
                  canis\keyProvider\providers\BaseProvider

        registerProvider()

            public            method

Register a provider with the component

void registerProvider( $id, $provider )

                  $id
                  string

ID of provider to register

                  $provider
                  canis\keyProvider\providers\ProviderInterface|array

Provider to register

                  throws
                  \yii\base\InvalidConfigException

when provider is invalid

        registerProviders()

            public            method

void registerProviders( $providers, $replace = true )

                  $providers
                  array

Providers to be registered

                  $replace
                  boolean

Replace if provider already has been registered

        setProviders()

            public            method

Sets the providers for instantiation when first retrieved

void setProviders( $providers )

                  $providers
                  array

Page generated on Wed, 13 Jan 2016 18:52:06 +0000

    Powered by Yii Framework


text:
package org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact;

import org.gradle.api.artifacts.component.ComponentArtifactIdentifier;
import org.gradle.api.attributes.AttributeContainer;

import java.io.File;

/**
 * A visitor over the contents of a {@link ResolvedArtifactSet}.
 */
public interface ArtifactVisitor {
    /**
     * Visits an artifact. Artifacts are resolved but not necessarily downloaded unless {@link #requireArtifactFiles()} returns true.
     */
    void visitArtifact(AttributeContainer variant, ResolvableArtifact artifact);

    /**
     * Should the file for each artifacts be made available prior to calling {@link #visitArtifact(AttributeContainer, ResolvableArtifact)}?
     *
     * Returns true here allows the collection to pre-emptively resolve the files in parallel.
     */
    boolean requireArtifactFiles();

    /**
     * Should {@link #visitFile(ComponentArtifactIdentifier, AttributeContainer, File)} be called?
     */
    boolean includeFiles();

    /**
     * Visits a file. Should be considered an artifact but is separate as a migration step.
     */
    void visitFile(ComponentArtifactIdentifier artifactIdentifier, AttributeContainer variant, File file);

    /**
     * Called when some problem occurs visiting some element of the set. Visiting may continue.
     */
    void visitFailure(Throwable failure);
}


text:
Ensures that the link exists. If the directory structure does not exist, it is created.

- `srcpath` `<String>`
- `dstpath` `<String>`
- `callback` `<Function>`

## Example:

```js
const fs = require('fs-extra')

const srcpath = '/tmp/file.txt'
const dstpath = '/tmp/this/path/does/not/exist/file.txt'
fs.ensureLink(srcpath, dstpath, err => {
  console.log(err) // => null
  // link has now been created, including the directory it is to be placed in
})

// With Promises:
fs.ensureLink(srcpath, dstpath)
.then(() => {
  console.log('success!')
})
.catch(err => {
  // handle error
})
```


text:
class ServerUserRequestsAddColumnPseudoUserId < ActiveRecord::Migration

  # old:
  # create_table "server_user_requests", force: true do |t|
  #   t.integer  "user_id",    null: false
  #   t.string   "sha256"
  #   t.datetime "created_at"
  #   t.datetime "updated_at"
  #   t.integer  "server_id",  null: false
  # end
  # add_index "server_user_requests", ["server_id", "user_id"], name: "index_server_user_requests_pk", unique: true, using: :btree

  # new:
  # create_table "server_user_requests", force: true do |t|
  #   t.integer  "pseudo_user_id", null: false
  #   t.string   "sha256"
  #   t.datetime "created_at"
  #   t.datetime "updated_at"
  #   t.integer  "server_id",      null: false
  #   t.integer  "user_id"
  # end
  # add_index "server_user_requests", ["server_id", "pseudo_user_id"], name: "index_server_user_requests_pk", unique: true, using: :btree

  def up
    remove_index :server_user_requests, :name => "index_server_user_requests_pk"
    rename_column :server_user_requests, :user_id, :pseudo_user_id
    add_index "server_user_requests", ["server_id", "pseudo_user_id"], name: "index_server_user_requests_pk", unique: true, using: :btree
    add_column :server_user_requests, :user_id, :integer
  end
  def down
    remove_column :server_user_requests, :user_id
    remove_index :server_user_requests, :name => "index_server_user_requests_pk"
    rename_column :server_user_requests, :user_id, :pseudo_user_id
    add_index "server_user_requests", ["server_id", "user_id"], name: "index_server_user_requests_pk", unique: true, using: :btree
  end

end


text:
package org.onosproject.athena.database;

import org.onosproject.core.ApplicationId;

/**
 * Created by seunghyeon on 8/27/15.
 */
public interface FeatureDatabaseService {
    //To be added "Register/Unregister AthenaFeatureEventListener"
    void addDatabaseEventListener(int prioirity, AthenaFeatureEventListener listener);

    void removeDatabaseEventListener(AthenaFeatureEventListener listener);

    /**
     * It returns features requested from user.
     *
     * @param applicationId          identifies Who requested.
     * @param athenaFeatureRequester It includes constrains and other detials.
     */
    void requestFeatures(ApplicationId applicationId, AthenaFeatureRequester athenaFeatureRequester);

    //Request database with advanced query (Online, Offline)
    boolean registerOnlineFeature(ApplicationId applicationId,
                                  QueryIdentifier identifier,
                                  AthenaFeatureRequester athenaFeatureRequester);

    boolean unRegisterOnlineFeature(ApplicationId applicationId, QueryIdentifier identifier);

    Object kyroSerializerInitialize();

    void debugCommand1(String param);

    void debugCommand2(String param);

    void debugCommand3(String param);
}


text:
import EmberTruncate from 'ember-cli-truncate/components/ember-truncate';

export default EmberTruncate;


text:
.dg-arrange-table-rows-drag-icon{
	background-image: url('dg-arrange-table-rows.gif') !important;
	background-repeat: repeat-y !important;
	cursor: move;
}

/* Container used while dragging */
.dg-arrange-table-rows-container{
	background-color: #FFF;
}

.dg-arrange-table-rows-insertion-marker{
	width:7px;
	height:10px;
	background-image:url('insert.gif');
	background-repeat:no-repeat;
}


text:
<?php

/* PMWeaponBundle:Weapon:listWeapons.html.twig */
class __TwigTemplate_da691fbd8f5a95175fd81aa7950c8624a870c171491b8d3e62ca2cf91663acbc extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 3
        try {
            $this->parent = $this->env->loadTemplate("PMWeaponBundle:Weapon:layoutAdmin.html.twig");
        } catch (Twig_Error_Loader $e) {
            $e->setTemplateFile($this->getTemplateName());
            $e->setTemplateLine(3);

            throw $e;
        }

        $this->blocks = array(
            'title' => array($this, 'block_title'),
            'h1' => array($this, 'block_h1'),
            'breadcrumb' => array($this, 'block_breadcrumb'),
            'PM_body' => array($this, 'block_PM_body'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "PMWeaponBundle:Weapon:layoutAdmin.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 5
    public function block_title($context, array $blocks = array())
    {
        // line 6
        echo "    Liste - ";
        $this->displayParentBlock("title", $context, $blocks);
        echo "
";
    }

    // line 9
    public function block_h1($context, array $blocks = array())
    {
        // line 10
        echo "    Liste des Armes :
";
    }

    // line 13
    public function block_breadcrumb($context, array $blocks = array())
    {
        // line 14
        echo "    ";
        $this->displayParentBlock("breadcrumb", $context, $blocks);
        echo "

Liste

";
    }

    // line 18
    public function block_PM_body($context, array $blocks = array())
    {
        // line 19
        echo "

        ";
        // line 21
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "session", array()), "flashbag", array()), "get", array(0 => "notice"), "method"));
        foreach ($context['_seq'] as $context["_key"] => $context["flashMessage"]) {
            // line 22
            echo "

                ";
            // line 23
            echo twig_escape_filter($this->env, $context["flashMessage"], "html", null, true);
            echo "

        ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['flashMessage'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 26
        echo "

                #
                Nom

            ";
        // line 32
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["listWeapons"]) ? $context["listWeapons"] : $this->getContext($context, "listWeapons")));
        $context['_iterated'] = false;
        $context['loop'] = array(
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        );
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["_key"] => $context["weapon"]) {
            // line 33
            echo "

                    ";
            // line 34
            echo twig_escape_filter($this->env, $this->getAttribute($context["loop"], "index", array()), "html", null, true);
            echo "
                    env, $this->env->getExtension('routing')->getPath("pm_weapon_administration_view", array("slug" => $this->getAttribute($context["weapon"], "slug", array()))), "html", null, true);
            echo "\">";
            echo twig_escape_filter($this->env, $this->getAttribute($context["weapon"], "name", array()), "html", null, true);
            echo "

            ";
            $context['_iterated'] = true;
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        if (!$context['_iterated']) {
            // line 38
            echo "

                    Aucune Arme connue.

            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['weapon'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 42
        echo "

";
    }

    public function getTemplateName()
    {
        return "PMWeaponBundle:Weapon:listWeapons.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  151 => 42,  142 => 38,  124 => 35,  120 => 34,  117 => 33,  99 => 32,  91 => 26,  82 => 23,  79 => 22,  75 => 21,  71 => 19,  68 => 18,  60 => 14,  57 => 13,  52 => 10,  49 => 9,  42 => 6,  39 => 5,  11 => 3,);
    }
}


text:
using UnityEngine;
using System.Collections;

public class RandomRotator : MonoBehaviour {

	public float tumble;

	void Start() {
		rigidbody.angularVelocity = Random.insideUnitSphere * (Random.Range (0.1f * tumble, 1.5f * tumble));;
	}
}


text:
package org.elassandra.cli;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.dataformat.smile.SmileFactory;
import joptsimple.OptionSet;
import joptsimple.OptionSpec;
import org.apache.cassandra.exceptions.InvalidRequestException;
import org.apache.cassandra.utils.Hex;
import org.elasticsearch.cli.LoggingAwareCommand;
import org.elasticsearch.cli.Terminal;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.common.xcontent.*;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import static org.elasticsearch.cluster.metadata.MetaData.CONTEXT_CASSANDRA_PARAM;

public class DecodeIndexMetaDataCommand extends LoggingAwareCommand {

    private final OptionSpec<String> smileOption = parser.acceptsAll(Arrays.asList("s", "smile"), "smile to decode (in hex format)").withRequiredArg().required().ofType(String.class);

    public DecodeIndexMetaDataCommand() {
        super("Command to decode the index metadata form a table extension");
    }

    @Override
    protected void execute(Terminal terminal, OptionSet options) throws Exception {
        final String smile = options.valueOf(smileOption);
        terminal.println(String.format("Decoding : [%s]", smile));
        terminal.println(convertToIndexMetaData(smile));
    }

    private String convertToIndexMetaData(String smile) {
        final byte[] bytes = Hex.hexToBytes(smile.startsWith("0x") ? smile.substring(2) : smile);
        return convertToIndexMetaData(bytes);
    }

    public final String convertToIndexMetaData(byte[] bytes) {
        try{
            IndexMetaData indexMetaData = IndexMetaData.FORMAT.loadLatestState(null, new NamedXContentRegistry(Collections.emptyList()), bytes);

            XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
            builder.prettyPrint();
            builder.startObject();

            Map<String, String> params = new HashMap<>(1);
            params.put(CONTEXT_CASSANDRA_PARAM, "true");
            IndexMetaData.Builder.toXContent(indexMetaData, builder, new ToXContent.MapParams(params));

            builder.endObject();

            builder.flush();
            return builder.bytes().utf8ToString();
        } catch (IOException e) {
            throw new InvalidRequestException(String.format("Error while converting smile to json : %s", e.getMessage()));
        }
    }
}


text:
import setuptools
from setuptools import setup

with open("README.md", "r") as fh:
    long_description = fh.read()

params = {
    'name':"remi",
    'description':"Python REMote Interface library",
    'use_scm_version':{'version_scheme': 'post-release'},
    'long_description':long_description,
    'long_description_content_type':"text/markdown",
    'url':"https://github.com/rawpython/remi",
    'download_url':"https://github.com/rawpython/remi/archive/master.zip",
    'keywords':["gui-library", "remi", "platform-independent", "ui", "gui"],
    'author':"Davide Rosa",
    'author_email':"dddomodossola@gmail.com",
    'license':"Apache",
    'packages':setuptools.find_packages(),
    'include_package_data':True,
    'setup_requires':['setuptools_scm'],
}
try:
    setup(**params)
except:
    del params['setup_requires']
    params['use_scm_version'] = False
    params['version'] = '2022.03.07'
    setup(**params)


text:
class CreateAbstractorAbstractionSources < ActiveRecord::Migration
  def change
    create_table :abstractor_abstraction_sources do |t|
      t.integer :abstractor_subject_id
      t.string :from_method
      t.datetime :deleted_at

      t.timestamps
    end
  end
end


text:
package org.talend.sdk.component.junit.beam;

import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static lombok.AccessLevel.PRIVATE;
import static lombok.AccessLevel.PROTECTED;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.json.JsonBuilderFactory;
import javax.json.JsonObject;
import javax.json.bind.Jsonb;
import javax.json.spi.JsonProvider;

import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.coders.MapCoder;
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.PTransform;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.values.PCollection;
import org.talend.sdk.component.api.record.Record;
import org.talend.sdk.component.api.record.Schema;
import org.talend.sdk.component.api.service.record.RecordBuilderFactory;
import org.talend.sdk.component.runtime.beam.coder.JsonbCoder;
import org.talend.sdk.component.runtime.beam.coder.JsonpJsonObjectCoder;
import org.talend.sdk.component.runtime.beam.coder.registry.SchemaRegistryCoder;
import org.talend.sdk.component.runtime.beam.spi.record.RecordCollectors;
import org.talend.sdk.component.runtime.record.RecordConverters;
import org.talend.sdk.component.runtime.serialization.ContainerFinder;
import org.talend.sdk.component.runtime.serialization.LightContainer;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = PRIVATE)
public class Data {

    public static final RecordConverters.MappingMetaRegistry REGISTRY = new RecordConverters.MappingMetaRegistry();

    public static <T> PTransform<PCollection<Record>, PCollection<Map<String, T>>> map(final String plugin,
            final Class<T> expectedRecordType) {
        return new DataMapper<>(plugin, expectedRecordType);
    }

    public static Create.Values<Record> of(final String plugin, final Iterable<Map<String, List<?>>> elems) {
        return Create.of(() -> {
            final Iterator<Map<String, List<?>>> delegate = elems.iterator();
            return new Iterator<Record>() {

                private transient volatile RecordConverters converters;

                private transient volatile Jsonb jsonb;

                private transient volatile RecordBuilderFactory recordBuilderFactory;

                @Override
                public boolean hasNext() {
                    return delegate.hasNext();
                }

                @Override
                public Record next() {
                    return map(delegate.next());
                }

                private Record map(final Map<String, List<?>> next) {
                    if (next == null) {
                        return null;
                    }
                    if (converters == null) {
                        synchronized (this) {
                            if (converters == null) {
                                final LightContainer container = ContainerFinder.Instance.get().find(plugin);
                                recordBuilderFactory = container.findService(RecordBuilderFactory.class);
                                jsonb = container.findService(Jsonb.class);
                                converters = new RecordConverters();
                            }
                        }
                    }
                    return next
                            .entrySet()
                            .stream()
                            .filter(it -> !it.getValue().isEmpty())
                            .collect(recordBuilderFactory::newRecordBuilder, (aggregator, entry) -> {
                                final List<Record> list = entry
                                        .getValue()
                                        .stream()
                                        .map(it -> Record.class
                                                .cast(converters
                                                        .toRecord(REGISTRY, it, () -> jsonb,
                                                                () -> recordBuilderFactory)))
                                        .collect(toList());
                                aggregator
                                        .withArray(recordBuilderFactory
                                                .newEntryBuilder()
                                                .withName(entry.getKey())
                                                .withType(Schema.Type.ARRAY)
                                                .withElementSchema(list.iterator().next().getSchema())
                                                .build(), list)
                                        .build();
                            }, RecordCollectors::merge)
                            .build();
                }
            };
        }).withCoder(SchemaRegistryCoder.of());
    }

    @NoArgsConstructor(access = PROTECTED)
    @AllArgsConstructor(access = PRIVATE)
    private static class DataMapper<T> extends PTransform<PCollection<Record>, PCollection<Map<String, T>>> {

        private String plugin;

        private Class<T> type;

        @Override
        protected Coder<?> getDefaultOutputCoder() {
            return MapCoder.of(StringUtf8Coder.of(), SchemaRegistryCoder.of());
        }

        @Override
        public PCollection<Map<String, T>> expand(final PCollection<Record> collection) {
            return collection
                    .apply(ParDo
                            .of(new DataMapperFn<>(JsonpJsonObjectCoder.of(plugin), JsonbCoder.of(type, plugin), plugin,
                                    new RecordConverters(), new RecordConverters.MappingMetaRegistry())));
        }
    }

    @NoArgsConstructor(access = PROTECTED)
    @AllArgsConstructor(access = PRIVATE)
    private static class DataMapperFn<T> extends DoFn<Record, Map<String, T>> {

        private Coder<JsonObject> jsonpCoder;

        private JsonbCoder<T> jsonbCoder;

        private String plugin;

        private RecordConverters converters;

        private volatile RecordConverters.MappingMetaRegistry registry;

        @ProcessElement
        public void onElement(final ProcessContext context) {
            context.output(map(context.element()));
        }

        private Map<String, T> map(final Record object) {
            if (registry == null) {
                registry = new RecordConverters.MappingMetaRegistry();
            }
            return object.getSchema().getEntries().stream().collect(toMap(Schema.Entry::getName, e -> {
                try {
                    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    final Record record = object.getArray(Record.class, e.getName()).iterator().next();
                    final JsonObject jsonObject = JsonObject.class
                            .cast(converters
                                    .toType(registry, record, JsonObject.class, this::getJsonBuilder,
                                            this::getJsonProvider, this::getJsonb, this::getRecordBuilderFactory));
                    if (Record.class == jsonbCoder.getType()) {
                        return (T) new RecordConverters()
                                .toRecord(REGISTRY, jsonObject, this::getJsonb, this::getRecordBuilderFactory);
                    }
                    jsonpCoder.encode(jsonObject, baos);
                    return jsonbCoder.decode(new ByteArrayInputStream(baos.toByteArray()));
                } catch (final IOException ex) {
                    throw new IllegalArgumentException(ex);
                }
            }));

        }

        private LightContainer getContainer() {
            return ContainerFinder.Instance.get().find(plugin);
        }

        private RecordBuilderFactory getRecordBuilderFactory() {
            return getContainer().findService(RecordBuilderFactory.class);
        }

        private JsonBuilderFactory getJsonBuilder() {
            return getContainer().findService(JsonBuilderFactory.class);
        }

        private JsonProvider getJsonProvider() {
            return getContainer().findService(JsonProvider.class);
        }

        private Jsonb getJsonb() {
            return getContainer().findService(Jsonb.class);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <property key="HelpNotFound">
        <value xml:lang="da">Hjælp emne ikke fundet</value>
        <value xml:lang="de">Hilfe Thema nicht gefunden.</value>
        <value xml:lang="en">Help topic not found.</value>
        <value xml:lang="es">No se ha encontrado el tema de ayuda.</value>
        <value xml:lang="fr">Sujet d'aide non trouvé.</value>
        <value xml:lang="it">Voce aiuto non trovata.</value>
        <value xml:lang="ja">ヘルプが見つかりません</value>
        <value xml:lang="pt_BR">Tópico de ajuda não foi encontrado.</value>
        <value xml:lang="ru">Справочник помощи не найден.</value>
        <value xml:lang="vi">Không tìm thấy nội dung Trợ giúp.</value>
        <value xml:lang="zh">帮助主题没有找到。</value>
        <value xml:lang="zh_TW">說明主題沒有找到.</value>
    </property>
    <property key="PageTitleHelp">
        <value xml:lang="da">Open for Business hjælp</value>
        <value xml:lang="de">Open for Business Hilfe</value>
        <value xml:lang="en">Open for Business Help</value>
        <value xml:lang="es">Ayuda de Open for Business</value>
        <value xml:lang="fr">Aide OFBiz (Open for Business)</value>
        <value xml:lang="it">Aiuto</value>
        <value xml:lang="ja">OFBizヘルプ</value>
        <value xml:lang="pt_BR">Ajuda do OFBiz</value>
        <value xml:lang="ru">Открыть для бизнес-помощи</value>
        <value xml:lang="vi">Trợ giúp từ OFBiz</value>
        <value xml:lang="zh">OFBiz帮助</value>
        <value xml:lang="zh_TW">OFBiz說明</value>
    </property>
</resource>


text:
export {APIv2Call} from "./api/APIv2Call"
export {APIv2} from "./api/APIv2"
export * from "./api/interfaces/interfaces"


text:
package org.apache.camel.dataformat.bindy.csv;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;

import org.apache.camel.EndpointInject;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.model.simple.oneclass.Order;
import org.apache.camel.model.dataformat.BindyDataFormat;
import org.apache.camel.model.dataformat.BindyType;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

@ContextConfiguration
public class BindySimpleCsvMarshallDslTest extends AbstractJUnit4SpringContextTests {

    private List<Map<String, Object>> models = new ArrayList<>();
    private String result = "1,B2,Keira,Knightley,ISIN,XX23456789,BUY,Share,450.45,EUR,14-01-2009,17-05-2010 23:21:59\r\n";

    @Produce(uri = "direct:start")
    private ProducerTemplate template;

    @EndpointInject(uri = "mock:result")
    private MockEndpoint resultEndpoint;

    @Test
    public void testMarshallMessage() throws Exception {
        resultEndpoint.expectedBodiesReceived(result);

        template.sendBody(generateModel());

        resultEndpoint.assertIsSatisfied();
    }

    public List<Map<String, Object>> generateModel() {
        Map<String, Object> modelObjects = new HashMap<>();

        Order order = new Order();
        order.setOrderNr(1);
        order.setOrderType("BUY");
        order.setClientNr("B2");
        order.setFirstName("Keira");
        order.setLastName("Knightley");
        order.setAmount(new BigDecimal("450.45").setScale(2));
        order.setInstrumentCode("ISIN");
        order.setInstrumentNumber("XX23456789");
        order.setInstrumentType("Share");
        order.setCurrency("EUR");

        Calendar calendar = new GregorianCalendar();
        calendar.set(2009, 0, 14);
        order.setOrderDate(calendar.getTime());

        calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
        // 4 hour shift
        // 17-05-2010 23:21:59 by GMT+4
        calendar.set(2010, 4, 17, 19, 21, 59);
        order.setOrderDateTime(calendar.getTime());

        modelObjects.put(order.getClass().getName(), order);

        models.add(modelObjects);

        return models;
    }

    public static class ContextConfig extends RouteBuilder {

        public void configure() {
            BindyDataFormat bindy = new BindyDataFormat();
            bindy.setLocale("en");
            bindy.setClassType(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class);
            bindy.setType(BindyType.Csv);

            from("direct:start").
                marshal(bindy)
                .to("mock:result");
        }

    }

}


text:
package com.amazonaws.services.opsworks.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeServiceErrorsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified stack.
     *

     */
    private String stackId;
    /**
     *

     * The instance ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified instance.
     *

     */
    private String instanceId;
    /**
     *

     * An array of service error IDs. If you use this parameter, DescribeServiceErrors returns descriptions
     * of the specified errors. Otherwise, it returns a description of every error.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> serviceErrorIds;

    /**
     *

     * The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified stack.
     *

     *
     * @param stackId
     *        The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions of the
     *        errors associated with the specified stack.
     */

    public void setStackId(String stackId) {
        this.stackId = stackId;
    }

    /**
     *

     * The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified stack.
     *

     *
     * @return The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions of the
     *         errors associated with the specified stack.
     */

    public String getStackId() {
        return this.stackId;
    }

    /**
     *

     * The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified stack.
     *

     *
     * @param stackId
     *        The stack ID. If you use this parameter, DescribeServiceErrors returns descriptions of the
     *        errors associated with the specified stack.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeServiceErrorsRequest withStackId(String stackId) {
        setStackId(stackId);
        return this;
    }

    /**
     *

     * The instance ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified instance.
     *

     *
     * @param instanceId
     *        The instance ID. If you use this parameter, DescribeServiceErrors returns descriptions of the
     *        errors associated with the specified instance.
     */

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    /**
     *

     * The instance ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified instance.
     *

     *
     * @return The instance ID. If you use this parameter, DescribeServiceErrors returns descriptions of
     *         the errors associated with the specified instance.
     */

    public String getInstanceId() {
        return this.instanceId;
    }

    /**
     *

     * The instance ID. If you use this parameter, DescribeServiceErrors returns descriptions of the errors
     * associated with the specified instance.
     *

     *
     * @param instanceId
     *        The instance ID. If you use this parameter, DescribeServiceErrors returns descriptions of the
     *        errors associated with the specified instance.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeServiceErrorsRequest withInstanceId(String instanceId) {
        setInstanceId(instanceId);
        return this;
    }

    /**
     *

     * An array of service error IDs. If you use this parameter, DescribeServiceErrors returns descriptions
     * of the specified errors. Otherwise, it returns a description of every error.
     *

     *
     * @return An array of service error IDs. If you use this parameter, DescribeServiceErrors returns
     *         descriptions of the specified errors. Otherwise, it returns a description of every error.
     */

    public java.util.List<String> getServiceErrorIds() {
        if (serviceErrorIds == null) {
            serviceErrorIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return serviceErrorIds;
    }

    /**
     *

     * An array of service error IDs. If you use this parameter, DescribeServiceErrors returns descriptions
     * of the specified errors. Otherwise, it returns a description of every error.
     *

     *
     * @param serviceErrorIds
     *        An array of service error IDs. If you use this parameter, DescribeServiceErrors returns
     *        descriptions of the specified errors. Otherwise, it returns a description of every error.
     */

    public void setServiceErrorIds(java.util.Collection<String> serviceErrorIds) {
        if (serviceErrorIds == null) {
            this.serviceErrorIds = null;
            return;
        }

        this.serviceErrorIds = new com.amazonaws.internal.SdkInternalList<String>(serviceErrorIds);
    }

    /**
     *

     * An array of service error IDs. If you use this parameter, DescribeServiceErrors returns descriptions
     * of the specified errors. Otherwise, it returns a description of every error.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setServiceErrorIds(java.util.Collection)} or {@link #withServiceErrorIds(java.util.Collection)} if you
     * want to override the existing values.
     *

     *
     * @param serviceErrorIds
     *        An array of service error IDs. If you use this parameter, DescribeServiceErrors returns
     *        descriptions of the specified errors. Otherwise, it returns a description of every error.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeServiceErrorsRequest withServiceErrorIds(String... serviceErrorIds) {
        if (this.serviceErrorIds == null) {
            setServiceErrorIds(new com.amazonaws.internal.SdkInternalList<String>(serviceErrorIds.length));
        }
        for (String ele : serviceErrorIds) {
            this.serviceErrorIds.add(ele);
        }
        return this;
    }

    /**
     *

     * An array of service error IDs. If you use this parameter, DescribeServiceErrors returns descriptions
     * of the specified errors. Otherwise, it returns a description of every error.
     *

     *
     * @param serviceErrorIds
     *        An array of service error IDs. If you use this parameter, DescribeServiceErrors returns
     *        descriptions of the specified errors. Otherwise, it returns a description of every error.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeServiceErrorsRequest withServiceErrorIds(java.util.Collection<String> serviceErrorIds) {
        setServiceErrorIds(serviceErrorIds);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getStackId() != null)
            sb.append("StackId: ").append(getStackId()).append(",");
        if (getInstanceId() != null)
            sb.append("InstanceId: ").append(getInstanceId()).append(",");
        if (getServiceErrorIds() != null)
            sb.append("ServiceErrorIds: ").append(getServiceErrorIds());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof DescribeServiceErrorsRequest == false)
            return false;
        DescribeServiceErrorsRequest other = (DescribeServiceErrorsRequest) obj;
        if (other.getStackId() == null ^ this.getStackId() == null)
            return false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false)
            return false;
        if (other.getInstanceId() == null ^ this.getInstanceId() == null)
            return false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false)
            return false;
        if (other.getServiceErrorIds() == null ^ this.getServiceErrorIds() == null)
            return false;
        if (other.getServiceErrorIds() != null && other.getServiceErrorIds().equals(this.getServiceErrorIds()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode());
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode());
        hashCode = prime * hashCode + ((getServiceErrorIds() == null) ? 0 : getServiceErrorIds().hashCode());
        return hashCode;
    }

    @Override
    public DescribeServiceErrorsRequest clone() {
        return (DescribeServiceErrorsRequest) super.clone();
    }

}


text:
<?php

namespace denbora\R_T_G_Services\examples\RESTv2\Tournament;

use denbora\R_T_G_Services\casino\CasinoRestV2;
use denbora\R_T_G_Services\examples\RESTv2\RestExample;
use denbora\R_T_G_Services\R_T_G_ServiceException;

class GetSlotTournamentsListGET extends RestExample
{
    /**
     * GetSlotTournamentsListGET constructor.
     * @param CasinoRestV2 $casino
     */
    public function __construct(CasinoRestV2 $casino)
    {
        try {
            $query = [
                'status' => 'all',
                'startDate' => '2021-09-22 00:00:00',
                'endDate' => '2021-09-22 23:59:59',
            ];

            $result = $casino->TournamentService->getSlotTournamentsListGET(json_encode($query));
            dd($result);
        } catch (R_T_G_ServiceException $exception) {
            dd($exception->getMessage());
        }
    }
}


text:
We are developing knowledge library for learning programming. The best resources to learn something(related to computer science) on the web are scattered and newcomers waste lot of time to go through choices of tools, then where to learn and all. We aim to elinimate this by recommending beginners the best resource for a tool or language. And who will decide which is best, its the users themselves(plus some AI behind the door).

##Version 1 features

+ Users can share any link of interesting blog post or video or tutorial in the Resource Section.
+ Resources are divided in topics around 3 levels(beginner, intermediate, advanced).
+ Users can share snippets(a shorte blog post) on their wall to share their views and experiences in learning.
+ Users can save interesting resources to their profile for later use.
+ Topic follow button allow users to follow topics to get interesting news, new resources.
+ Explore section lets view the ongoind activity of the site at a glance.

##Later features

+ Moderators and more active users will be able to edit wiki like content in the topics and resources.
+ Tracks will be introduced to give teachers/tutors ability to create content for the their students and distribute them.
+ Users can follow other interesting users.

##Tools/Apps Used

+ [Django 1.6](https://www.djangoproject.com/)
+ [Twitter Bootstrap](http://getbootstrap.com/)
+ [django-registration](https://django-registration.readthedocs.org/en/latest/)
+ [django-guardian](https://github.com/lukaszb/django-guardian)
+ [django-braces](https://github.com/brack3t/django-braces/)
+ [django-ratings](https://github.com/dcramer/django-ratings/)
+ MySQL (sqlite3 for dev)
+ [django-haystack](http://haystacksearch.org/)
+ [elasticsearch](http://elasticsearch.org/)

*For full requirements, see requirment.txt*

##Install

See INSTALL.md for full installation instructions.

## Contributors

+ [Karambir Singh Nain](http://nainomics.in/)
+ [Mohammad Adil](http://madil.in/)
+ [Mayank Jain](http://mayank-jain.in/)
+ Naman Sharma

## We need your help

+ We are porting this project to Django 1.8 and rewriting the way the resources are categorised into types and topics. We need Django developers for this.
+ None of us are a designer, if you can help or know someone who can, please [mail us](mailto:karambir@codesters.org).

## LICENSE

This project is licensed under [MIT License](http://mit-license.org). See LICENSE.txt