text:
<?php

namespace WSP\SecondBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class JamProductionYearAdmin extends Admin
{
    /** @var string route */
    protected $baseRoutePattern = 'jam/production-year';

    // Fields to be shown on create/edit forms
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('year')
        ;
    }

    // Fields to be shown on filter forms
    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('year')
        ;
    }

    // Fields to be shown on lists
    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('id')
            ->addIdentifier('year')
        ;
    }
}


text:
<?php

namespace Tests;

use App\Jobs\SendMail;
use Closure;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Mail\Mailable;
use Mail;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;

    public function assertHasMailPushed($class, $recipient = null, Closure $callback = null)
    {
        Mail::assertSent(function (Mailable $mail) use ($class, $recipient, $callback) {
            if (
                $mail instanceof $class &&
                ($recipient === null || $mail->hasTo($recipient))
            ) {
                if ($callback !== null) {
                    $callback($mail);
                }

                return true;
            }

            return false;
        });
    }
}

redpajama_set_name: RedPajamaGithub


text:
# DSC pull Server can be setup either as HTTP or HTTPS endpoint
# The xPSDesiredStateConfiguration module can be used to setup the pull server in a declarative way
# Install the module
Install-Module -Name xPSDesiredStateConfiguration -Force

# Get the resource names from xPSDesiredStateConfiguration module
Get-DscResource -Module xPSDesiredStateConfiguration

# We use the xDSCWebService resource to setup a pull server
# For the demo purpose, we will setup a HTTP web service
configuration DscPullServer
{
    param
    (
        [ValidateNotNullOrEmpty()]
        [string] $certificateThumbPrint,

        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string] $RegistrationKey
    )

    Import-DSCResource -ModuleName xPSDesiredStateConfiguration
    Import-DSCResource –ModuleName PSDesiredStateConfiguration

    WindowsFeature DSCServiceFeature
    {
        Ensure = 'Present'
        Name   = 'DSC-Service'
    }

    xDscWebService PSDSCPullServer
    {
        Ensure                   = 'Present'
        EndpointName             = 'PSDSCPullServer'
        Port                     = 8080
        PhysicalPath             = "$env:SystemDrive\inetpub\PSDSCPullServer"
        CertificateThumbPrint    = $certificateThumbPrint
        ModulePath               = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
        ConfigurationPath        = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
        State                    = 'Started'
        DependsOn                = '[WindowsFeature]DSCServiceFeature'
        UseSecurityBestPractices = $false
    }

    File RegistrationKeyFile
    {
        Ensure          = 'Present'
        Type            = 'File'
        DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt"
        Contents        = $RegistrationKey
    }
}

# For http based pull service, we will pass AllowUnencryptedTraffic as the argument to CertificateThumbprint
DSCPullServer -certificateThumbprint 'AllowUnencryptedTraffic' -RegistrationKey '140a952b-b9d6-406b-b416-e0f759c9c0e4' -OutputPath C:\DemoScripts\PullServer

# Run the compiled configuration to make the target node a DSC Pull Server
Start-DscConfiguration -Path C:\DemoScripts\PullServer -Wait -Verbose -Force

# Access the DSC pull endpoint in browser
Start-Process -FilePath 'http://localhost:8080/PSDSCPullServer.svc'

(irm 'http://localhost:8080/PSDSCPullServer.svc' -Headers @{Accept='application/json'}).value

# explore what is created
Import-Module WebAdministration
Get-Website -Name PSDSCPullServer | select *
Get-ChildItem C:\inetpub\PSDSCPullServer
$Configuration = [xml](Get-Content C:\inetpub\PSDSCPullServer\web.config)
$Configuration.configuration.appSettings.GetEnumerator()

# We can now onboard a DSC Pull client
[DSCLocalConfigurationManager()]
configuration PullClientConfig
{
    Node S12R2-01
    {
        Settings
        {
            RefreshMode          = 'Pull'
            RefreshFrequencyMins = 30
            RebootNodeIfNeeded   = $true
        }

        ConfigurationRepositoryWeb PSConfEU-PullSrv
        {
            ServerURL          = 'http://S16-DC:8080/PSDSCPullServer.svc'
            RegistrationKey    = '140a952b-b9d6-406b-b416-e0f759c9c0e4'
            AllowUnsecureConnection = $true
            ConfigurationNames = @('ArchiveDemo')
        }

        ReportServerWeb PSConfEU-PullSrv
        {
            ServerURL       = 'http://S16-DC:8080/PSDSCPullServer.svc'
            RegistrationKey = '140a952b-b9d6-406b-b416-e0f759c9c0e4'
            AllowUnsecureConnection = $true
        }
    }
}

PullClientConfig -OutputPath c:\DemoScripts\PullClientConfig
Set-DscLocalConfigurationManager -Path c:\DemoScripts\PullClientConfig -ComputerName S12R2-01 -Verbose

# explore registration
function GetReport
{
    param(
        $AgentId,
        $serviceURL = "http://localhost:8080/PSDSCPullServer.svc"
    )
    $requestUri = "$serviceURL/Nodes(AgentId= '$AgentId')/Reports"
    $request = Invoke-WebRequest -Uri $requestUri  -ContentType "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" `
               -UseBasicParsing -Headers @{Accept = "application/json";ProtocolVersion = "2.0"} `
               -ErrorAction SilentlyContinue -ErrorVariable ev
    $object = ConvertFrom-Json $request.content
    return $object.value
}
GetReport -AgentId (Get-DscLocalConfigurationManager -CimSession s12r2-01).AgentId

Install-Module DSCPullServerAdmin -Force
Get-Command -Module DSCPullServerAdmin
Stop-Website -Name PSDSCPullServer
Stop-WebAppPool -Name PSWS
Mount-DSCPullServerAdminDatabase -ESEPath "$env:PROGRAMFILES\WindowsPowerShell\DscService\Devices.edb"
# v1
Get-DSCPullServerAdminDevice
# v2
Get-DSCPullServerAdminRegistration
Get-DSCPullServerAdminReport -NodeName S12R2-01

Dismount-DSCPullServerAdminDataBase

Start-WebAppPool -Name PSWS
Start-Website -Name PSDSCPullServer

# Before the LCM client can pull the configuration, ArchiveDemo in this example, the configuration and any required modules should be available on the pull server.
# for configuration, the naming convention should be <ConfigurationName>.mof.
# This configurationname should match what is listed in the configurationnames property of the LCM client configuration
configuration ArchiveDemo
{
    Import-DscResource -modulename PSDesiredStateConfiguration
    Import-DscResource -ModuleName xNetworking -ModuleVersion 3.2.0.0

    Archive ArchiveResource
    {
        Path = 'C:\DemoScripts\scripts.zip'
        Destination = 'C:\Scripts'
        Ensure = 'Present'
    }

    xHostsFile HostEntry
    {
        IPAddress = '101.09.01.10'
        HostName = 'TESTHOST100'
    }
}

# Compile
ArchiveDemo -OutputPath C:\DemoScripts\ArchiveDemoForPull

# rename the MOF to reflect configuration name
Rename-Item -Path C:\DemoScripts\ArchiveDemoForPull\localhost.mof -NewName C:\DemoScripts\ArchiveDemoForPull\ArchiveDemo.mof

# Create a checksum for this. This is needed for the pull client to understand if there are subsequent changes to the configuration
New-DscChecksum -Path C:\DemoScripts\ArchiveDemoForPull\ArchiveDemo.mof -OutPath C:\DemoScripts\ArchiveDemoForPull

# move to configuration repository
Move-Item -Path C:\DemoScripts\ArchiveDemoForPull\* -Destination "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"

# update the config and show it fails
Update-DscConfiguration -ComputerName S12R2-01 -Wait -Verbose

# Package custom module as a zip archive. This is not required if configuration contains only in-box resources
# Before packaging up for the pull server simply remove the {Module version} folder so the path becomes '{Module Folder}\DscResources{DSC Resource Folder}\'.
# With this change, zip the folder as described above and place these zip files in the ModulePath folder.
# Copy the module zip to Pull Server.
$xNetworkingModule = Get-Module -Name xNetworking -ListAvailable
Compress-Archive -Path "$($xNetworkingModule.ModuleBase)\*" -DestinationPath "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules\xNetworking_$($xNetworkingModule.Version).zip" -Verbose

# inspect result
Get-ChildItem "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
[io.compression.zipfile]::OpenRead("$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules\xNetworking_$($xNetworkingModule.Version).zip").Entries.FullName

# update the LCM client so that it downloads the configuration and modules
Update-DscConfiguration -ComputerName S12R2-01 -Wait -Verbose

# add checksum and try again :)
New-DscChecksum -Path "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
Get-ChildItem "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
Update-DscConfiguration -ComputerName S12R2-01 -Wait -Verbose


text:
DEST="$1" ; shift
MEMLIMIT="$1" ; shift
MAINSOURCE="$1"
MAINCLASS=""

# Amount of memory reserved for the Java virtual machine in kB. The
# default below is just above the maximum memory usage of current
# versions of the jvm, but might need increasing in some cases.
MEMRESERVED=300000

TMPFILE=`mktemp --tmpdir domjudge_javac_output.XXXXXX` || exit 1

# Byte-compile:
javac -d . "$@" 2> "$TMPFILE"
EXITCODE=$?
if [ "$EXITCODE" -ne 0 ]; then
	# Let's see if should have named the .java differently
	PUBLICCLASS=$(sed -n -e '/class .* is public, should be declared in a file named /{s/.*file named //;s/\.java.*//;p;q}' "$TMPFILE")
	if [ -z "$PUBLICCLASS" ]; then
		cat $TMPFILE
		rm -f $TMPFILE
		exit $EXITCODE
	fi
	rm -f $TMPFILE
	echo "Info: renaming main source '$MAINSOURCE' to '$PUBLICCLASS.java'"
	mv "$MAINSOURCE" "$PUBLICCLASS.java"
	javac -d . "$PUBLICCLASS.java"
	EXITCODE=$?
	[ "$EXITCODE" -ne 0 ] && exit $EXITCODE
fi

rm -f $TMPFILE

# Look for class that has the 'main' function:
for cn in $(find * -type f -regex '^.*\.class$' \
		| sed -e 's/\.class$//' -e 's/\//./'); do
	javap -public "$cn" \
	| egrep -q 'public static (|final )void main\(java.lang.String(\[\]|\.\.\.)\)' \
	&& {
		if [ -n "$MAINCLASS" ]; then
			echo "Warning: found another 'main' in '$cn'"
		else
			echo "Info: using 'main' from '$cn'"
			MAINCLASS=$cn
		fi
	}
done
if [ -z "$MAINCLASS" ]; then
	echo "Error: no 'main' found in any class file."
	exit 1
fi

# Calculate Java program memlimit as MEMLIMIT - max. JVM memory usage:
MEMLIMITJAVA=$(($MEMLIMIT - $MEMRESERVED))

# Write executing script:
# Executes java byte-code interpreter with following options
# -Xmx: maximum size of memory allocation pool
# -Xrs: reduces usage signals by java, because that generates debug
#       output when program is terminated on timelimit exceeded.
cat > $DEST <<EOF
#!/bin/sh
# Generated shell-script to execute java interpreter on source.

# Detect dirname and change dir to prevent class not found errors.
if [ "\${0%/*}" != "\$0" ]; then
	cd "\${0%/*}"
fi

exec java -Xrs -Xss8m -DONLINE_JUDGE=1 -DDOMJUDGE=1 -Xmx${MEMLIMITJAVA}k $MAINCLASS
EOF

chmod a+x $DEST

exit 0


text:
var gulp = require('gulp'),
    requireDir = require('require-dir'),
    sequence = require('gulp-sequence');

var tasks = requireDir('./../tasks');
var run = ['clean'];

gulp.task('cleanAll', function (cb) {
    run.push(cb);
    sequence.apply(this, run);
});


text:
#include <aws/quicksight/model/IdentityTypeNotSupportedException.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace QuickSight
{
namespace Model
{

IdentityTypeNotSupportedException::IdentityTypeNotSupportedException() :
    m_messageHasBeenSet(false),
    m_requestIdHasBeenSet(false)
{
}

IdentityTypeNotSupportedException::IdentityTypeNotSupportedException(JsonView jsonValue) :
    m_messageHasBeenSet(false),
    m_requestIdHasBeenSet(false)
{
  *this = jsonValue;
}

IdentityTypeNotSupportedException& IdentityTypeNotSupportedException::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("Message"))
  {
    m_message = jsonValue.GetString("Message");

    m_messageHasBeenSet = true;
  }

  if(jsonValue.ValueExists("RequestId"))
  {
    m_requestId = jsonValue.GetString("RequestId");

    m_requestIdHasBeenSet = true;
  }

  return *this;
}

JsonValue IdentityTypeNotSupportedException::Jsonize() const
{
  JsonValue payload;

  if(m_messageHasBeenSet)
  {
   payload.WithString("Message", m_message);

  }

  if(m_requestIdHasBeenSet)
  {
   payload.WithString("RequestId", m_requestId);

  }

  return payload;
}

} // namespace Model
} // namespace QuickSight
} // namespace Aws


text:
package socialite.parser.antlr;

import socialite.util.Assert;

public class Predefined extends TableOpt {
	public Predefined() {
		super();
	}
}


text:
var ical = require('ical');
var moment = require('moment');
var request = require('request');
var travelBotKeys = require ('../api_keys/travel_bot_keys.js');

ical.fromURL(travelBotKeys.ICAL_URL, {}, function(err, data){
  for (var k in data){
    if (data.hasOwnProperty(k)) {
      var listing = data[k];

      // does the listing have "is in" in the descrition,
      // which TripIt does for trip entries
      if (listing.description.match(/.+is in/) ){

        trip_start = moment(listing.start);
        trip_end = moment(listing.end).subtract(1, 'days');  // -1 because end is posted at midnight next day
        rightnow = moment();

        // Message only at the start and end of the trip.
        // Is right now either the same day as the first day or the last
        // day of the trip?
        if ( trip_start.isSame(rightnow, "day") || trip_end.isSame(rightnow, "day") ) {

          // match up to the newline character, and take the first element
          phrase = listing.description.match(/(.+)\n/)[1];
          console.log(phrase);

          if (trip_end.isSame(rightnow, "day")) {
            phrase = phrase + " (Trip ending today.)";
          }

          // Compose the message and other details to send to Slack
          var payload = {
          	text: phrase,
          	icon_emoji: ":airplane:",
          	username: "Travel Bot",
          	channel: "#fyi"
          };

          // Set up the sending options for the request function.
          // See note about the travelBotKeys.SLACK_WEBHOOK_URL in
          // in README.md.
          var options = {
          	url: travelBotKeys.SLACK_WEBHOOK_URL,
          	method: 'POST',
          	body: payload,
          	json: true
          };

          slackIt(options);

        }
      }
    }
  }
});

// Send the webhook

function slackIt(options) {
  request(options, function (error, response, body){
    if (!error && response.statusCode == 200) {
      console.log(body);
    } else {
      console.log(error);
    }
  });
}


text:
<?php
namespace Codeception\Module;

use Codeception\Exception\ModuleConfig;
use Codeception\Subscriber\ErrorHandler;
use Illuminate\Http\Request;
use Illuminate\Foundation\Testing\Client;
use Illuminate\Auth\UserInterface;
use Illuminate\Support\MessageBag;

/**
 *
 * This module allows you to run functional tests for Laravel 4.
 * Module is very fresh and should be improved with Laravel testing capabilities.
 * Please try it and leave your feedbacks. If you want to maintain it - connect Codeception team.
 *
 * Uses 'bootstrap/start.php' to launch.
 *
 * ## Demo Project
 *
 * <https://github.com/Codeception/sample-l4-app>
 *
 * ## Status
 *
 * * Maintainer: **Jon Phipps, Davert**
 * * Stability: **alpha**
 * * Contact: davert.codeception@mailican.com
 *
 * ## Config
 *
 * * start: `bootstrap/start.php` - relative path to start.php config file
 * * cleanup: true - all db queries will be run in transaction, which will be rolled back at the end of test.
 *
 *
 * ## API
 *
 * * kernel - `Illuminate\Foundation\Application` instance
 * * client - `BrowserKit` client
 *
 * ## Known Issues
 *
 * When submitting form do not use `Input::all` to pass to store (hope you won't do this anyway).
 * Codeception creates internal form fields, so you get exception trying to save them.
 *
 */
class Laravel4 extends \Codeception\Util\Framework implements \Codeception\Util\ActiveRecordInterface
{
    /**
     * @var \Illuminate\Foundation\Application
     */
    public $kernel;

    protected $config = array();

    public function __construct($config = null)
    {
        $this->config = array_merge(
            array(
                'cleanup' => true,
                'start' => 'bootstrap'  . DIRECTORY_SEPARATOR .  'start.php'
            ),
            (array) $config
        );

        parent::__construct();
    }

    public function _initialize()
    {
        $projectDir = \Codeception\Configuration::projectDir();
        require $projectDir .  'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

        \Illuminate\Support\ClassLoader::register();

        if (is_dir($workbench = $projectDir . 'workbench')) {
            \Illuminate\Workbench\Starter::start($workbench);
        }
        $unitTesting = true;
        $testEnvironment = 'testing';

        $startFile = $projectDir . $this->config['start'];
        if (!file_exists($startFile)) {
            throw new ModuleConfig($this, "Laravel start.php file not found in $startFile.\nPlease provide a valid path to it using 'start' config param. ");
        }
        $app = require $startFile;
        $app->boot();
        $this->kernel = $app;

        $this->revertErrorHandler();
    }

    protected function revertErrorHandler()
    {
        $handler = new ErrorHandler();
        set_error_handler(array($handler, 'errorHandler'));
    }

    public function _before(\Codeception\TestCase $test)
    {
        $this->client = new Client($this->kernel);
        $this->client->followRedirects(true);
        if ($this->config['cleanup'] and $this->expectedLaravelVersion(4.1)) {
            $this->kernel['db']->beginTransaction();
        }
    }

    public function _after(\Codeception\TestCase $test)
    {
        if ($this->config['cleanup'] and $this->expectedLaravelVersion(4.1)) {
            $this->kernel['db']->rollback();
        }
        $this->kernel->shutdown();
    }

    protected function expectedLaravelVersion($ver)
    {
        return floatval(\Illuminate\Foundation\Application::VERSION) >= floatval($ver);
    }

    public function _beforeStep(\Codeception\Step $step)
    {
        // saving referer for redirecting back
        $headers = $this->kernel->request->headers;
        if (!$this->client->getHistory()->isEmpty()) {
            $headers->set('referer', $this->client->getHistory()->current()->getUri());
        }
    }

    /**
     * Assert that the session has a given list of values.
     *
     * @param  string|array $key
     * @param  mixed $value
     * @return void
     */
    public function seeInSession($key, $value = null)
    {
        if (is_array($key)) {
            $this->seeSessionHasValues($key);
            return;
        }

        if (is_null($value)) {
            $this->assertTrue($this->kernel['session']->has($key));
        } else {
            $this->assertEquals($value, $this->kernel['session']->get($key));
        }
    }

    /**
     * Assert that the session has a given list of values.
     *
     * @param  array $bindings
     * @return void
     */
    public function seeSessionHasValues(array $bindings)
    {
        foreach ($bindings as $key => $value) {
            if (is_int($key)) {
                $this->seeInSession($value);
            } else {
                $this->seeInSession($key, $value);
            }
        }
    }

    /**
     * Assert that Session has error messages
     * The seeSessionHasValues cannot be used, as Message bag Object is returned by Laravel4
     *
     * Useful for validation messages and generally messages array
     *  e.g.
     *  return `Redirect::to('register')->withErrors($validator);`
     *
     * Example of Usage
     *
     * ``` php
     * <?php
     * $I->seeSessionErrorMessage(array('username'=>'Invalid Username'));
     * ?>
     * ```
     * @param array $bindings
     */
    public function seeSessionErrorMessage(array $bindings)
    {
        $this->seeSessionHasErrors(); //check if  has errors at all
        $errorMessageBag = $this->kernel['session']->get('errors');
        foreach($bindings as $key => $value){
            $this->assertEquals($value, $errorMessageBag->first($key));
        }
    }
    /**
     * Assert that the session has errors bound.
     *
     * @return bool
     */
    public function seeSessionHasErrors()
    {
        $this->seeInSession('errors');
    }

    /**
     * Set the currently logged in user for the application.
     *
     * @param  \Illuminate\Auth\UserInterface $user
     * @param  string $driver
     * @return void
     */
    public function amLoggedAs(UserInterface $user, $driver = null)
    {
        $this->kernel['auth']->driver($driver)->setUser($user);
    }

    /**
     * Return an instance of a class from the IoC Container.
     * (http://laravel.com/docs/ioc)
     *
     * Example
     * ``` php
     * <?php
     * // In Laravel
     * App::bind('foo', function($app)
     * {
     *     return new FooBar;
     * });
     *
     * // Then in test
     * $service = $I->grabService('foo');
     *
     * // Will return an instance of FooBar, also works for singletons.
     * ?>
     * ```
     *
     * @param  string $class
     * @return mixed
     */
    public function grabService($class)
    {
        return $this->kernel[$class];
    }

    /**
     * Inserts record into the database.
     *
     * ``` php
     * <?php
     * $user_id = $I->haveRecord('users', array('name' => 'Davert'));
     * ?>
     * ```
     *
     * @param $model
     * @param array $attributes
     * @return mixed
     */
    public function haveRecord($model, $attributes = array())
    {
        $id = $this->kernel['db']->table($model)->insertGetId($attributes);
        if (!$id) {
            $this->fail("Couldnt insert record into table $model");
        }
        return $id;
    }

    /**
     * Checks that record exists in database.
     *
     * ``` php
     * $I->seeRecord('users', array('name' => 'davert'));
     * ```
     *
     * @param $model
     * @param array $attributes
     */
    public function seeRecord($model, $attributes = array())
    {
        $record = $this->findRecord($model, $attributes);
        if (!$record) {
            $this->fail("Couldn't find $model with ".json_encode($attributes));
        }
        $this->debugSection($model, json_encode($record));
    }

    /**
     * Checks that record does not exist in database.
     *
     * ``` php
     * $I->dontSeeRecord('users', array('name' => 'davert'));
     * ```
     *
     * @param $model
     * @param array $attributes
     */
    public function dontSeeRecord($model, $attributes = array())
    {
        $record = $this->findRecord($model, $attributes);
        $this->debugSection($model, json_encode($record));
        if ($record) {
            $this->fail("Unexpectedly managed to find $model with ".json_encode($attributes));
        }
    }

    /**
     * Retrieves record from database
     *
     * ``` php
     * $category = $I->grabRecord('users', array('name' => 'davert'));
     * ```
     *
     * @param $model
     * @param array $attributes
     * @return mixed
     */
    public function grabRecord($model, $attributes = array())
    {
        return $this->findRecord($model, $attributes);
    }

    protected function findRecord($model, $attributes = array())
    {
        $query = $this->kernel['db']->table($model);
        foreach ($attributes as $key => $value) {
            $query->where($key, $value);
        }
        return $query->first();
    }

}


text:
Ti.include("model/api.js");
var win = Titanium.UI.currentWindow;
win.layout = 'vertical';

var btnPost = Titanium.UI.createButton({
	title:'Finish',
});
win.setRightNavButton(btnPost);

var data = [];
if (Titanium.Platform.osname == 'iphone')
{
var ta1 = Titanium.UI.createTextArea({
	editable: true,
	top:-50,
	left:55,
	height: 155,
	width: (Titanium.Platform.displayCaps.platformWidth - 55),
	backgroundColor:'#ffffff',
	color:'#888',
	textAlign:'left',
	appearance:Titanium.UI.KEYBOARD_APPEARANCE_

,
//	keyboardType:Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION,
//	returnKeyType:Titanium.UI.RETURNKEY_SENDRETURNKEY_EMERGENCY_CALL,
	suppressReturn:false

});
var pict = Titanium.UI.createImageView({
				image: Titanium.App.Properties.getString('photo_url'),
				top: 0,
				left: 0,
				height:50,
				width:50,
			});
			win.add(pict);
win.add(ta1);
} else {
	var ta1 = Titanium.UI.createTextArea({
	editable: true,
	top:-75,
	left:80,
	height: 155,
	width: (Titanium.Platform.displayCaps.platformWidth - 75),
	backgroundColor:'#ffffff',
	color:'#888',
	textAlign:'left',
	appearance:Titanium.UI.KEYBOARD_APPEARANCE_ALERT,
    font:{fontSize:16},
	suppressReturn:false

});
var pict = Titanium.UI.createImageView({
				image: Titanium.App.Properties.getString('photo_url'),
				top: 0,
				left: 0,
				height:75,
				width:75,
			});
			win.add(pict);
win.add(ta1);
}
btnPost.addEventListener('click', function(e){
		if(ta1.value.length < 1)
		{
			alert("Your post must be at least 1 character");
		} else {
		var postData = {'text' :ta1.value};
		xhr = postReplyCreate(Titanium.App.Properties.getString("mmat"),win.postid,postData);
		xhr.onload = function(){
			var response = this.responseText;
			var test = JSON.parse(response);
			win.navGroup.closeWindow(win);

		};
		xhr.send(postData);

	}
});
setTimeout(function(e){
            ta1.focus();
            },500);


text:
BUOY_DETECT
-----------
This repository contains the codes that uses ML (Machine Learning) techniques to detect the buoy. This is a combination of 3 parts -

(1) `Pixel-trainer` : A ML-trainer module.

(2) `vw_detect` (`vw` = `vowpal wabbit`) : This module detects the buoy boundary with the help of ML, by taking the training data output of `Pixel-trainer`.

(3) `Region-blower` : This module blows / colors the region within the buoy boundary detected by `vw_detect`.

RUNNING THE SCRIPTS
-------------------

// include the steps with further commits.
// doubt : steps for working with ROS or without ROS?

CONTRIBUTION
------------
The work flow is the same as that of any other repository.

 (1) Fork / clone the repository.

 (2) Create a new branch , say `my-changes` and make your changes in this branch.

 (3) Commit your changes and send a Pull request (PR) to this repository.

LICENSE
-------
[The MIT License](LICENSE.md) - [Team AUV , IIT Kharagpur](https://github.com/auviitkgp) - All Rights Reserved.


text:
using System.IO;
using System.Text;

namespace Mono.Cecil.PE
{
	internal class RsrcReader
	{
		internal static ResourceDirectory ReadResourceDirectory(byte[] b, uint baseAddress)
		{
			var dr = new MemoryStream(b);
			return ReadResourceDirectory(new BinaryReader(dr), baseAddress);
		}

		private static ResourceDirectory ReadResourceDirectory(BinaryReader dr, uint baseAddress)
		{
			var d = ReadResourceDirectoryTable(dr);
			int ne = d.NumNameEntries + d.NumIdEntries;
			for (int i = 0; i < ne; i++)
				d.Entries.Add(ReadResourceEntry(dr, baseAddress));
			return d;
		}

		private static ResourceEntry ReadResourceEntry(BinaryReader dr, uint baseAddress)
		{
			var re = new ResourceEntry();
			uint id = dr.ReadUInt32();
			uint offset = dr.ReadUInt32();
			long pos = dr.BaseStream.Position;
			if ((id & 0x80000000) != 0)
			{
				dr.BaseStream.Position = (id & 0x7fffffff);
				var b = new StringBuilder();
				int c;
				while ((c = dr.Read()) > 0)
					b.Append((char) c);
				re.Name = b.ToString();
			}
			else
			{
				re.Id = id;
			}
			if ((offset & 0x80000000) != 0)
			{
				dr.BaseStream.Position = (offset & 0x7fffffff);
				re.Directory = ReadResourceDirectory(dr, baseAddress);
			}
			else
			{
				dr.BaseStream.Position = offset;
				uint rva = dr.ReadUInt32();
				uint size = dr.ReadUInt32();
				uint cp = dr.ReadUInt32();
				uint res = dr.ReadUInt32();
				re.CodePage = cp;
				re.Reserved = res;
				dr.BaseStream.Position = (rva - baseAddress);
				re.Data = dr.ReadBytes((int)size);
			}
			dr.BaseStream.Position = pos;
			return re;
		}

		private static ResourceDirectory ReadResourceDirectoryTable(BinaryReader dr)
		{
			var t = new ResourceDirectory
			{
				Characteristics = dr.ReadUInt32(),
				TimeDateStamp = dr.ReadUInt32(),
				MajorVersion = dr.ReadUInt16(),
				MinVersion = dr.ReadUInt16(),
				NumNameEntries = dr.ReadUInt16(),
				NumIdEntries = dr.ReadUInt16()
			};
			return t;
		}
	}
}


text:
var EventEmitter = require('events').EventEmitter;
var assert = require('assert');

var emitter = new EventEmitter();

var eventCnt1 = 0;
var eventCnt2 = 0;
var eventCnt3 = 0;
var onceCnt = 0;
var eventSequence = "";

emitter.once('once', function() {
  onceCnt += 1;
});

assert.equal(onceCnt, 0);
emitter.emit('once');
assert.equal(onceCnt, 1);
emitter.emit('once');
assert.equal(onceCnt, 1);

emitter.once('once2', function() {
  onceCnt += 1;
  assert.equal(arguments.length, 14);
  assert.equal(arguments[0], 0);
  assert.equal(arguments[1], 1);
  assert.equal(arguments[2], 2);
  assert.equal(arguments[3], 3);
  assert.equal(arguments[4], 4);
  assert.equal(arguments[5], 5);
  assert.equal(arguments[6], 6);
  assert.equal(arguments[7], 7);
  assert.equal(arguments[8], 8);
  assert.equal(arguments[9], 9);
  assert.equal(arguments[10], "a");
  assert.equal(arguments[11], "b");
  assert.equal(arguments[12], "c");
  assert.equal(arguments[13].a, 123);
});

assert.equal(onceCnt, 1);
emitter.emit('once2', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", { a: 123});
assert.equal(onceCnt, 2);
emitter.emit('once2', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", { a: 123});
assert.equal(onceCnt, 2);

emitter.addListener('event', function() {
  eventCnt1 += 1;
  eventSequence += "1";
});

assert.equal(eventCnt1, 0);
emitter.emit('event');
assert.equal(eventCnt1, 1);

emitter.addListener('event', function() {
  eventCnt2 += 1;
  eventSequence += "2";
});

assert.equal(eventCnt2, 0);
emitter.emit('event');
assert.equal(eventCnt1, 2);
assert.equal(eventCnt2, 1);

emitter.addListener('event', function() {
  eventCnt3 += 1;
  eventSequence += "3";
});

assert.equal(eventCnt3, 0);
emitter.emit('event');
assert.equal(eventCnt1, 3);
assert.equal(eventCnt2, 2);
assert.equal(eventCnt3, 1);
emitter.emit('event');
assert.equal(eventCnt1, 4);
assert.equal(eventCnt2, 3);
assert.equal(eventCnt3, 2);
emitter.emit('no receiver');
assert.equal(eventCnt1, 4);
assert.equal(eventCnt2, 3);
assert.equal(eventCnt3, 2);

emitter.addListener('args', function() {
  assert.equal(arguments.length, 14);
  assert.equal(arguments[0], 0);
  assert.equal(arguments[1], 1);
  assert.equal(arguments[2], 2);
  assert.equal(arguments[3], 3);
  assert.equal(arguments[4], 4);
  assert.equal(arguments[5], 5);
  assert.equal(arguments[6], 6);
  assert.equal(arguments[7], 7);
  assert.equal(arguments[8], 8);
  assert.equal(arguments[9], 9);
  assert.equal(arguments[10], "a");
  assert.equal(arguments[11], "b");
  assert.equal(arguments[12], "c");
  assert.equal(arguments[13].a, 123);
  eventSequence += "4";
});

emitter.addListener('args', function() {
  assert.equal(arguments.length, 14);
  eventSequence += "5";
})

emitter.emit('args', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", { a: 123});

var listener1 = function() {
  eventSequence += '6';
};

emitter.addListener('rmTest', listener1);
emitter.emit('rmTest');
emitter.removeListener('rmTest', function() {});
emitter.emit('rmTest');
emitter.removeListener('rmTest', listener1);
emitter.emit('rmTest');

var listener2 = function() {
  eventSequence += '7';
};

emitter.addListener('rmTest', listener2);
emitter.addListener('rmTest', listener2);
emitter.emit('rmTest');
eventSequence += "|"
emitter.removeListener('rmTest', listener2);
emitter.emit('rmTest');
eventSequence += "|"
emitter.removeListener('rmTest', listener2);
emitter.emit('rmTest');
eventSequence += "|"

var listener3 = function() {
  eventSequence += '8';
};

emitter.addListener('rmTest', listener3);
emitter.addListener('rmTest', listener3);
emitter.emit('rmTest');
eventSequence += "|";
emitter.removeAllListeners('rmTest');
emitter.emit('rmTest');
eventSequence += "|";

emitter.emit('event');
eventSequence += "|";
emitter.removeAllListeners();
emitter.emit('event');
eventSequence += "|";

assert.equal(eventSequence, "112123123456677|7||88||123||");


text:
<?php

class UserSeeder extends Seeder {

    public function run()
    {
        DB::table('user')->truncate();
        DB::table('password_reminder')->truncate();

        /*
        User::create(array(
            'email' => null,
            'password' => Hash::make(''),
            'username' => null,
        ));
        */
    }

}


text:
package de.terrestris.shoguncore.dao;

import org.springframework.stereotype.Repository;

import de.terrestris.shoguncore.model.module.Button;

@Repository("buttonDao")
public class ButtonDao<E extends Button> extends
    GenericHibernateDao<E, Integer> {

    /**
     * Public default constructor for this DAO.
     */
    @SuppressWarnings("unchecked")
    public ButtonDao() {
        super((Class<E>) Button.class);
    }

    /**
     * Constructor that has to be called by subclasses.
     *
     * @param clazz
     */
    protected ButtonDao(Class<E> clazz) {
        super(clazz);
    }

}


text:
using Microsoft.Extensions.DependencyInjection;

using Goofy.Data;
using Goofy.Core.Infrastructure;

namespace Goofy.Component.ControllersAndRoutes
{
    public class ControllersAndRoutesDependencyAssembler : IDependencyAssembler
    {
        public int Order
        {
            get
            {
                return 0;
            }
        }

        public void Register(IServiceCollection services)
        {
            services.Configure<ControllerAndRoutesConfiguration>(a => { });
            services.AddScoped<IWriter, FileSystemWriter>();
            services.AddDbContextObject<BookContext>();
        }
    }
}


text:
package uk.ac.imperial.doc.masspa.gui.interfaces;

/**
 * An interface for a tab GUI component
 * @author Chris Guenther
 */
public interface ITab
{
	/**
	 * @return tab's controller
	 */
	public ITabController getTabController();
}


text:
package org.subethamail.smtp.client;

import java.io.IOException;
import java.net.SocketAddress;
import java.net.UnknownHostException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A somewhat smarter abstraction of an SMTP client which doesn't require knowing
 * anything about the nitty gritty of SMTP.
 *
 * @author Jeff Schnitzer
 */
public class SmartClient extends SMTPClient
{
	/** */
	private static Logger log = LoggerFactory.getLogger(SmartClient.class);

	/** */
	boolean sentFrom;
	int recipientCount;
	/** The host name which is sent in the HELO and EHLO commands */
	private String heloHost;

	/**
	 * True if the server sent a 421
	 * "Service not available, closing transmission channel" response. In this
	 * case the QUIT command should not be sent.
	 */
	private boolean serverClosingTransmissionChannel = false;

	/**
	 * Creates an unconnected client.
	 */
	public SmartClient()
	{
		// nothing to do
	}

	/**
	 * Connects to the specified server and issues the initial HELO command.
	 *
	 * @throws UnknownHostException if problem looking up hostname
	 * @throws SMTPException if problem reported by the server
	 * @throws IOException if problem communicating with host
	 */
	public SmartClient(String host, int port, String myHost) throws UnknownHostException, IOException, SMTPException
	{
		this(host, port, null, myHost);
	}

	/**
	 * Connects to the specified server and issues the initial HELO command.
	 *
	 * @throws UnknownHostException if problem looking up hostname
	 * @throws SMTPException if problem reported by the server
	 * @throws IOException if problem communicating with host
	 */
	public SmartClient(String host, int port, SocketAddress bindpoint, String myHost) throws UnknownHostException,
			IOException, SMTPException
	{
		this.setBindpoint(bindpoint);
		this.setHeloHost(myHost);
		this.connect(host, port);
	}

	/**
	 * Connects to the specified server and issues the initial HELO command. It
	 * gracefully closes the connection if it could be established but
	 * subsequently it fails or if the server does not accept messages.
	 */
	@Override
	public void connect(String host, int port) throws IOException, SMTPException
	{
		if (heloHost == null)
			throw new IllegalStateException("Helo host must be specified before connecting");

		super.connect(host, port);
		try
		{
			this.receiveAndCheck(); // The server announces itself first
			this.sendAndCheck("HELO " + heloHost);
		}
		catch (SMTPException e)
		{
			this.quit();
			throw e;
		}
		catch (IOException e)
		{
			this.close(); // just close the socket, issuing QUIT is hopeless now
			throw e;
		}
	}

	/**
	 * Returns the server response. It takes note of a 421 response code, so
	 * QUIT will not be issued unnecessarily.
	 */
	@Override
	protected Response receive() throws IOException
	{
		Response response = super.receive();
		if (response.getCode() == 421)
			serverClosingTransmissionChannel = true;
		return response;
	}

	/** */
	public void from(String from) throws IOException, SMTPException
	{
		this.sendAndCheck("MAIL FROM: <" + from + ">");
		this.sentFrom = true;
	}

	/** */
	public void to(String to) throws IOException, SMTPException
	{
		this.sendAndCheck("RCPT TO: <" + to + ">");
		this.recipientCount++;
	}

	/**
	 * Prelude to writing data
	 */
	public void dataStart() throws IOException, SMTPException
	{
		this.sendAndCheck("DATA");
	}

	/**
	 * Actually write some data
	 */
	public void dataWrite(byte[] data, int numBytes) throws IOException
	{
		this.dataOutput.write(data, 0, numBytes);
	}

	/**
	 * Last step after writing data
	 */
	public void dataEnd() throws IOException, SMTPException
	{
		this.dataOutput.flush();
		this.dotTerminatedOutput.writeTerminatingSequence();
		this.dotTerminatedOutput.flush();

		this.receiveAndCheck();
	}

	/**
	 * Quit and close down the connection. Ignore any errors.
	 *

	 * It still closes the connection, but it does not send the QUIT command if
	 * a 421 Service closing transmission channel is received previously. In
	 * these cases QUIT would fail anyway.
	 *
	 * @see RFC 5321
	 *      Terminating Sessions and Connections
	 */
	public void quit()
	{
		try
		{
			if (!this.serverClosingTransmissionChannel)
				this.sendAndCheck("QUIT");
		}
		catch (IOException ex)
		{
			log.warn("Failed to issue QUIT to " + this.hostPort);
		}

		this.close();
	}

	/**
	 * @return true if we have already specified from()
	 */
	public boolean sentFrom()
	{
		return this.sentFrom;
	}

	/**
	 * @return true if we have already specified to()
	 */
	public boolean sentTo()
	{
		return this.recipientCount > 0;
	}

	/**
	 * @return the number of recipients that have been accepted by the server
	 */
	public int getRecipientCount()
	{
		return this.recipientCount;
	}

	/**
	 * Sets the domain name or address literal of this system, which name will
	 * be sent to the server in the parameter of the HELO and EHLO commands.
	 * This has no default and is required.
	 */
	public void setHeloHost(String myHost)
	{
		this.heloHost = myHost;
	}

	/**
	 * Returns the HELO name of this system.
	 */
	public String getHeloHost()
	{
		return heloHost;
	}
}


text:
package main

import (
	"flag"
	"fmt"
	"github.com/zach-klippenstein/goregen"
	"io/ioutil"
	"math/rand"
	"os"
	"path"
	"strings"
	"time"
)

var NumberOfGenerations = flag.Int("n", 1, "number of strings to generate. A value of 0 will keep generating strings until the process is killed.")

func main() {
	flag.Usage = func() {
		fmt.Fprintf(os.Stderr, "Usage: %s [args] [pattern]\n", path.Base(os.Args[0]))
		fmt.Fprintln(os.Stderr, "Generates random strings from regular expressions.")
		fmt.Fprintln(os.Stderr, "If no pattern is given on the command line, it will be read from stdin. If the last character is \\n, it will be removed.")
		fmt.Fprintln(os.Stderr, "\nargs:")
		flag.PrintDefaults()
	}
	flag.Parse()

	var pattern string

	if flag.NArg() > 1 {
		fmt.Fprintln(os.Stderr, "error: too many arguments")
		flag.Usage()
	} else if flag.NArg() == 1 {
		pattern = flag.Arg(0)
	} else {
		pattern = ReadPatternFromStdin()
	}

	rand.Seed(time.Now().UTC().UnixNano())

	generator, err := regen.NewGenerator(pattern, nil)
	if err != nil {
		fmt.Fprintf(os.Stderr, "%s\n", err)
		os.Exit(1)
	}

	for i := 0; *NumberOfGenerations == 0 || i < *NumberOfGenerations; i++ {
		fmt.Println(generator.Generate())
	}
}

func ReadPatternFromStdin() string {
	patternBytes, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		fmt.Fprintf(os.Stderr, "error reading from stdin: %s\n", err)
		os.Exit(1)
	}
	pattern := string(patternBytes)

	// if entered interactively, there will be an extra \n at the end that
	// is probably not intended to be part of the regex.
	pattern = strings.TrimSuffix(pattern, "\n")

	return pattern
}


text:
package com.lazyloris.modeler;

public interface Attribute {

    Type getType();

    String getName();

    boolean isReadOnly();

    String getDefault();

    boolean isUnique();
}


text:
#ifndef OPENAV_CTLRA_H
#define OPENAV_CTLRA_H

/* Tell Doxygen to ignore this header */
/**  \cond */
#include <stdint.h>
/** \endcond */

#ifdef __cplusplus
extern "C" {
#endif

/*! \mainpage Ctlra - A plain C library to program with hardware controllers.
 *
 * Official Codebase, please file any issues with Ctlra against this repo:
 *  https://github.com/openAVproductions/openAV-ctlra
 *
 * The README.md file has instructions on building.
 *
 * General questions / comments:
 * Harry van Haaren <harryhaaren@gmail.com>
 * OpenAV Productions
 */

/** @file
 * Ctlra is a lightweight C library for accessing controllers, to
 * make it easier to implement support for them in software. This library
 * abstracts the hardware and transport layer, providing events for all
 * inputs available, and functions that can be called to display feedback
 * on the device.
 */

#include <stdio.h>

#include "event.h"

#define DEPRECATED __attribute__((deprecated))

#define CTLRA_STR_MAX        32
#define CTLRA_DEV_SERIAL_MAX 64
#define CTLRA_NUM_GRIDS_MAX   8
#define CTLRA_NUM_SCREENS_MAX 2

/** Ctlra context forward declaration. This struct is opaque to the user
 * of the ctlra library. It provides a handle for ctlra internals such as
 * hotplug callbacks and backend details (libusb context for example). It
 * also holds a handle to each ctlra_dev_t in use, allowing it to clean up
 * resources if the application calls ctlra_exit() on the *ctlra_t*.
 */
struct ctlra_t;

/* Errors only is default */
#define CTLRA_DEBUG_ERROR 0
#define CTLRA_DEBUG_NONE  1
#define CTLRA_DEBUG_WARN  2
#define CTLRA_DEBUG_INFO  3
#define CTLRA_DEBUG_LEVEL_MASK (0x0f)
#define CTLRA_DEBUG_DRIVER (1 << 6)
#define CTLRA_DEBUG_BACKEND (1 << 7)

/** Struct for forward compatibility, allowing various options to be passed
 * to ctlra, without breaking all the function calls */
struct ctlra_create_opts_t {
	/* creation time flags */
	uint8_t flags_usb_no_own_context : 1;
	uint8_t flags_usb_unsued : 7;

	/* debug verbosity */
	uint8_t debug_level;

	/* for any devices with screens, attempt to achieve this number of
	 * frames-per-second. This means the screen_redraw() callback will
	 * be called this fps value number of times per second.
	 */
	uint8_t screen_redraw_target_fps;

	/* reserve lots of space */
	uint8_t padding[62];
};

/** Get the human readable name for *control_id* from *dev*. The
 * control id is passed in eg: event.button.id, or can be any of the
 * DEVICE_NAME_CONTROLS enumeration. Ownership of the string *remains* in
 * the driver, so the application *must not* attempt to free the returned
 * pointer.
 * @retval 0 Invalid control_id requested
 * @retval Ptr A pointer to a string representing the control name
 */
typedef const char *(*ctlra_info_get_name_func)(enum ctlra_event_type_t type,
						uint32_t control_id);

/** Struct that provides physical layout and capabilities about each
 * item on the controller. Sizes are provided in millimeters. An item can
 * represent a control such as a slider or dial, but also feedback only
 * items such as an LED, or screen.
 */
#define CTLRA_ITEM_BUTTON        (1<< 0)
#define CTLRA_ITEM_FADER         (1<< 1) /* check W vs H for orientation */
#define CTLRA_ITEM_DIAL          (1<< 2)
#define CTLRA_ITEM_ENCODER       (1<< 3)
#define CTLRA_ITEM_CENTER_NOTCH  (1<< 4)

#define CTLRA_ITEM_LED_INTENSITY (1<< 5)
#define CTLRA_ITEM_LED_COLOR     (1<< 6)

#define CTLRA_ITEM_FB_LED_STRIP  (1<< 7)
#define CTLRA_ITEM_FB_SCREEN     (1<< 8)
#define CTLRA_ITEM_FB_7_SEGMENT  (1<< 9)

#define CTLRA_ITEM_HAS_FB_ID     (1<<31)
struct ctlra_item_info_t {
	uint32_t x; /* location of item on X axis */
	uint32_t y; /* location of item on Y axis */
	uint32_t w; /* size of item on X axis */
	uint32_t h; /* size of item on Y axis */

	/* TODO: figure out how to expose capabilities of item */
	uint64_t flags;

	/* The feedback id for this item. Calling ctlra_dev_light_set()
	 * with this light_id should result the the LED under the item
	 * changing state */
	uint32_t fb_id;
	/* mask of colours the hw can represent */
	uint32_t colour;
	/* feedback parameters depending on flags */
	uint16_t params[4];
};

/** A struct describing the properties of a grid */
struct ctlra_grid_info_t {
	/* capabilities of each pad */
	/** When non-zero each pad has the capability to show RGB colour.
	 * When zero, the pad either has no LED, or brightness only */
	uint8_t rgb;
	uint8_t velocity;
	uint8_t pressure;
	/* number of pads in x and y direction */
	uint32_t x;
	uint32_t y;
	/* location of grid itself on the device */
	struct ctlra_item_info_t info;
};

#define CTLRA_DEV_TYPE_INVALID          0
#define CTLRA_DEV_TYPE_USB_HID          1
#define CTLRA_DEV_TYPE_BLUETOOTH        2
#define CTLRA_DEV_TYPE_USB_MIDI         3

/** ID struct for a USB HID device */
struct ctlra_dev_usb_hid_t {
	/** USB Vendor ID */
	uint32_t vendor_id;
	/** USB device ID */
	uint32_t device_id;
	/** Serial number from USB library (if available) */
	uint64_t serial_number;
};

struct ctlra_dev_id_t {
	/* integer representing the type of this device.
	 * Eg: CTLRA_DEV_TYPE_USB_HID */
	uint32_t type;
	union {
		struct ctlra_dev_usb_hid_t usb_hid;
	};
};

/** Struct that provides info about the controller. Passed to the
 * application on probe().
 */
struct ctlra_dev_info_t {
	/** Name of the vendor/company */
	char vendor[CTLRA_STR_MAX];
	/** Name of the device */
	char device[CTLRA_STR_MAX];
	/** Serial as a string (if applicable) */
	char serial[CTLRA_DEV_SERIAL_MAX];

	/** USB Vendor ID */
	uint32_t vendor_id;
	/** USB device ID */
	uint32_t device_id;
	/** Serial as a number (if applicable) */
	uint64_t serial_number;
	/** The Unique ID assigned to this particular controller by the
	 * Ctlra library. A specific device (device + serial_number combo)
	 * is assigned an integer ID when accepted. This unique_id remains
	 * constant for the device - even if hot-plugged out and back in.
	 *
	 * The use-case for this runtime-constant ID number is to allow an
	 * application to easily detect when a controller is "returning",
	 * or when a new controller is being plugged in.
	 */
	uint32_t unique_id;

	/** Number of controls the device has of each type. Read eg number
	 * buttons by accessing the array by *ctlra_event_type_t*
	 * CTRLA_EVENT_BUTTON */
	uint32_t control_count[CTLRA_EVENT_T_COUNT];

	/** An array pointers to ctlra_item_info_t structures.
	 * The pointers can be used to look up information about each
	 * control that the device has.
	 */
	struct ctlra_item_info_t *control_info[CTLRA_EVENT_T_COUNT];

	/* TODO: feedback/led only ctlra_item info */

	uint32_t size_x;
	uint32_t size_y;

	struct ctlra_grid_info_t grid_info[CTLRA_NUM_GRIDS_MAX];

	/** @internal function to get name from device. Application must
	 * use *ctlra_info_get_name* function. */
	ctlra_info_get_name_func get_name;
};

/** Callback function that gets invoked just before a device is removed,
 * or disconnected, by Ctlra. This allows the application to notify the
 * user of a disconnection, or free memory that was used by this instance.
 * The *unexpected_removal* parameter is set when eg: a cable is unplugged
 * unexpectedly, it is 0 on a clean shutdown.
 */
typedef void (*ctlra_remove_dev_func)(struct ctlra_dev_t *dev,
				      int unexpected_removal,
				      void *userdata);

/** A callback function that the application implements, called by the
 * Ctlra library when probing for supported devices. The application must
 * accept the device, and provide *ctlra_event_func* and userdata to Ctlra.
 * \retval 1 Accept the device - Ctlra will connect to the device
 * \retval 0 Reject the device - Ctlra does not connect, and the device
 *           is not used by this instance of Ctlra
 */
typedef int (*ctlra_accept_dev_func)(struct ctlra_t *ctlra,
				     const struct ctlra_dev_info_t *info,
				     struct ctlra_dev_t *dev,
				     void *userdata);

/* struct to represent a "zone" of a screen. Can be used for eg: redraw */
struct ctlra_screen_zone_t {
	uint32_t x;
	uint32_t y;
	uint32_t w;
	uint32_t h;
};

/** A callback function that the application must implement in order to
 * redraw a screen for a device. This callback is registered using the
 * *ctlra_dev_screen_register_callback* function.
 *
 * The application must write exactly the number of *bytes* specified, to
 * the location provided in *pixel_data. The data written must be formatted
 * in the devices native screen data type.
 *
 * In order to abstract the application from the device's native data
 * format, various functions are exposed to translate the data. For
 * example, the common Cairo library can be used to draw pixels, and the
 * cairo_surface_t * passed to the *ctlra_screen_cairo_to_device* helper
 * function, and then the appropriate pixel converion will take place.
 *
 * @retval 0 Screen will not be redrawn
 * @retval 1 Screen will fully redrawn
 * @retval 2 Screen will redraw only zone as indicated in *redraw_zone*
 */
typedef int32_t (*ctlra_screen_redraw_cb)(struct ctlra_dev_t *dev,
					  uint32_t screen_idx,
					  uint8_t *pixel_data,
					  uint32_t bytes,
					  struct ctlra_screen_zone_t *redraw_zone,
					  void *userdata);

/** Create a new ctlra context. This context holds state about the
 * connected devices, hotplug callbacks and backends (usb, bluetooth, etc)
 * for the controllers. The *opts* argument is a pointer to a struct
 * allowing specific control over the ctlra context being created. For
 * simple usage, pass NULL.
 */
struct ctlra_t *ctlra_create(const struct ctlra_create_opts_t *opts);

/** Probe for any devices that ctlra understands. This will depend on the
 * version of the Ctlra library, what compile options were enabled, and
 * the opts argument to ctlra_create(). This function causes the
 * ctlra_accept_dev callback function to be called in the application, once
 * for each device that is understood by Ctlra.
 * \retval The number of devices accepted and connected to successfully
 */
int ctlra_probe(struct ctlra_t *ctlra, ctlra_accept_dev_func accept_func,
		void *userdata);

/** Sets the feedback function for the device */
void ctlra_dev_set_feedback_func(struct ctlra_dev_t *dev,
				 ctlra_feedback_func func);

void ctlra_dev_set_callback_userdata(struct ctlra_dev_t *dev,
				     void *app_userdata);

/** Sets the screen redraw function for the device */
void ctlra_dev_set_screen_feedback_func(struct ctlra_dev_t *dev,
					ctlra_screen_redraw_cb func);

/** Sets the function that will be called on device removal */
void ctlra_dev_set_remove_func(struct ctlra_dev_t *dev,
			       ctlra_remove_dev_func func);

/** Iterate backends and see if anything has changed - this enables hotplug
 * detection and removal of devices.
 */
void ctlra_idle_iter(struct ctlra_t *ctlra);

/** Cleanup any resources allocated internally in Ctlra. This function
 * releases all resources attached to this context, but does NOT interfere
 * with other ctlra instances */
void ctlra_exit(struct ctlra_t *ctlra);

/** Disconnect from controller device, resetting to a neutral state.
 * @param dev The device to be disconnected
 * @retval 0 Successfully disconnected
 * @retval -ENOTSUP Disconnect not supported by driver
 * @retval <0 Error in disconnecting device
 */
int32_t ctlra_dev_disconnect(struct ctlra_dev_t *dev);

/** Retrieve a list of vendors. The returned strings are human readable
 * names of the companies/manufacturers of controller hardware. This
 * function is to allow eg: a drop-down list of vendors be displayed to
 * the user, which are supported by ctlra (and can be virtualized).
 *
 * Note that the strings pointed to by vendors after this call *remain*
 * owned by the Ctlra library - and they must not be freed by the callee.
 *
 * @param vendors An array of *size* that will be filled in with null
 *                terminated strings, where each entry is a vendor's name.
 * @param size    Size of the callee supplied array
 * @returns       Number of vendors populated in the array
 */
int32_t ctlra_get_vendors(const char *vendors[], int32_t size);

/** Retrieve a list of devices by a specific vendor. The returned strings
 * are human-readable names of devices. These names could be presented to
 * the user in eg: a drop down box allowing the user to select a specific
 * device. One use case could be virtualizing a specific hardware device
 *
 * @param vendor The vendor from which to find all supported devices. See
 *               the *ctlra_get_vendors* function to retrieve vendors.
 * @param devices An array of at least *size* to be filled in with null
 *                terminated strings, with each string representing a device.
 * @param size   Size of the devices array passed in.
 * @return       The number of devices populated in the array
 */
int32_t ctlra_get_devices_by_vendor(const char *vendor,
				    const char *devices[],
				    int32_t size);

/** Add a virtualized device. This function adds a "virtual" device, which
 * provides the controls of the physical device by displaying a user
 * interface. In order for this function to operate, the device being
 * virtualized must provide its info statically in the driver.
 *
 * The info provided about the device is used to emulate the device
 * itself - the normal accept dev callback will be called in the
 * application, with the device descriptor filled out as if it was the
 * actual hardware plugged in. This allows total emulation of the hardware.
 *
 * @retval 0 Successfully virtualized the device using an available backend
 * @retval -1 Error in virtualizing
 */
int32_t ctlra_dev_virtualize(struct ctlra_t *ctlra, const char *vendor,
			     const char *device);

void ctlra_strerror(struct ctlra_t *ctlra, FILE* out);

/** Change the Event func. This may be useful when integrating into
 * an application that doesn't know yet which event func to attach to
 * the device when connecting to it. A dummy event_func can be used, and
 * the correct one set on the device when it is known.
 */
void ctlra_dev_set_event_func(struct ctlra_dev_t* dev,
			      ctlra_event_func event_func);

/** Write Lights/LEDs feedback to device. See *ctlra_dev_lights_flush* to
 * flush the actual bytes over the cable to the device.
 * The *light_id* is a value specific to the device that enumerates each
 * available light. The *light_status* variable represents the state of
 * the light, as a bitmask of 3 properties: blinking, brightness, colour.
 * The top bit (1 << 31) indicates if the light should be blinking.
 * The brightness (0x7F << 24) is a 0 to 127 brightness value.
 * The remaining 16 bits are encoded as 0xRRGGBB in hex.
 * Controllers should support these inputs as best they can for the given
 * light_id.
 */
void ctlra_dev_light_set(struct ctlra_dev_t *dev,
			uint32_t light_id,
			uint32_t light_status);

/** Feedback item set: sets the value for a feedback item */
void ctlra_dev_feedback_set(struct ctlra_dev_t *dev,
			    uint32_t fb_id,
			    float value);

/** Feedback item set: sets the value for a feedback item */
void ctlra_dev_feedback_digits(struct ctlra_dev_t *dev,
			       uint32_t feedback_id,
			       float value);

/** Flush the bytes with the Lights/LEDs info over the cable. The device
 * implementation must track which lights are actually dirty, and only
 * flush the bytes needed. If *force* is set, force flush everything.
 */
void ctlra_dev_light_flush(struct ctlra_dev_t *dev, uint32_t force);

/** Send Lights/LEDs feedback to a grid on the device. See
 * *ctlra_dev_light_set* documentation for details. The *grid_id* is
 * unique to the device, and allows easy access to lights in an array
 * or grid pattern.
 */
void ctlra_dev_grid_light_set(struct ctlra_dev_t *dev,
			     uint32_t grid_id,
			     uint32_t light_id,
			     uint32_t light_status);

/** @warning
 * @b DEPRECATED: this API has been superseeded, use the screen update
 * callback APIs instead.
 *
 * This function serves a dual purpose of getting the pixel data pointer
 * of the driver, and allows flushing the data to the device itself.
 * The function returns 0 on success, -ENOTSUP if the device doesn't
 * have a screen, or it is not yet supported.
 *
 * The *pixel_data* a pointer to where pixel data should be written,
 * where up to *bytes* may be written. Writing past *bytes* characters is
 * an error, and may cause memory corruption - don't do it. It is assumed
 * that the application writing the data knows the format to write.
 *
 * When *flush* is non-zero, the driver will flush the pixel data
 * from the driver to the device */

int32_t
#ifndef CTLRA_INTERNAL
DEPRECATED
#endif
ctlra_dev_screen_get_data(struct ctlra_dev_t *dev,
					 uint8_t **pixel_data,
					 uint32_t *bytes,
					 uint8_t flush);

/** Get the info struct from a device. The user-supplied info pointer is
 * filled in by the device driver */
void ctlra_dev_get_info(const struct ctlra_dev_t *dev,
		       struct ctlra_dev_info_t * info);

/** Get the human readable name for *control_id* from *dev*. The
 * control id is passed in eg: event.button.id, or can be any of the
 * DEVICE_NAME_CONTROLS enumeration. Ownership of the string *remains* in
 * the driver, so the application *must not* attempt to free the returned
 * pointer.
 * @retval 0 Invalid control_id requested
 * @retval Ptr A pointer to a string representing the control name
 */
const char *ctlra_info_get_name(const struct ctlra_dev_info_t *info,
				enum ctlra_event_type_t type,
				uint32_t control_id);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* OPENAV_CTLRA_H */


text:
/**
 * provides a template wrapper around an application for including CLUE. Includes the common frame for switching modes, provenance, and story visualizations
 */
/// <amd-dependency path='font-awesome' />
/// <amd-dependency path='bootstrap' />
import { merge } from 'lodash';
import { select } from 'd3v3';
import * as d3v3 from 'd3v3';
import { MixedStorageProvenanceGraphManager, IObjectRef, ProvenanceGraph } from '../provenance';
import { SelectionRecorder } from '../../base/Selection';
import { CLUEMode, ButtonModeSelector, ModeWrapper } from '../base/mode';
import { VisLoader } from '../provvis/VisLoader';
import { CLUEGraphManager } from '../base/CLUEGraphManager';
import { ProvenanceGraphMenu } from '../provenance/ProvenanceGraphMenu';
import { LoginMenu } from '../../base/LoginMenu';
import { ACLUEWrapper, IACLUEWrapperOptions } from './ACLUEWrapper';
import { AppHeader, AppHeaderLink, IAppHeaderOptions, IHeaderLink } from '../../components';
import { IEvent } from '../../base';

export interface ICLUEWrapperOptions extends IACLUEWrapperOptions {
  /**
   * the name of the application
   */
  app?: string;
  /**
   * the URL of the application, used e.g., for generating screenshots
   */
  application?: string;
  /**
   * the id of the application, for differentiating provenance graphs
   */
  id?: string;
  /**
   * the selection type to record
   */
  recordSelectionTypes?: string;
  /**
   * whether selection replays should be animated
   */
  animatedSelections?: boolean;
  /**
   * whether thumbnails should be shown in the provenance or story vis
   */
  thumbnails?: boolean;
  /**
   * App Header Link
   */
  appLink?: IHeaderLink;
  /**
   * Should the provenance graph layout be collapsed by default?
   */
  provVisCollapsed?: boolean;
  /**
   * Options that will be passed to the header
   */
  headerOptions?: IAppHeaderOptions;

  /**
   * formular used for the login dialog
   */
  loginForm?: string;
}

export class CLUEWrapper extends ACLUEWrapper {
  private options: ICLUEWrapperOptions = {
    app: 'CLUE',
    application: '/clue',
    id: 'clue',
    recordSelectionTypes: 'selected',
    animatedSelections: false,
    thumbnails: true,
    appLink: new AppHeaderLink('CLUE'),
    provVisCollapsed: false,
    headerOptions: {},
  };

  header: AppHeader;

  $main: d3v3.Selection<any>;

  $mainRef: IObjectRef<d3v3.Selection<any>>;

  constructor(body: HTMLElement, options: ICLUEWrapperOptions = {}) {
    super();
    merge(this.options, options);
    this.build(body, options);
    this.on('jumped_to,loaded_graph', () => this.header.ready());
  }

  protected buildImpl(body: HTMLElement) {
    // create the common header
    const headerOptions = merge(this.options.headerOptions, {
      showOptionsLink: true, // always activate options
      appLink: this.options.appLink,
    });
    this.header = AppHeader.create(<HTMLElement>body.querySelector('div.box'), headerOptions);

    // load all available provenance graphs
    const manager = new MixedStorageProvenanceGraphManager({
      prefix: this.options.id,
      storage: sessionStorage,
      application: this.options.application,
    });
    const clueManager = new CLUEGraphManager(manager);

    this.header.wait();

    // eslint-disable-next-line @typescript-eslint/naming-convention
    const _ = new LoginMenu(this.header, {
      loginForm: this.options.loginForm,
      insertIntoHeader: true,
    });
    const provenanceMenu = new ProvenanceGraphMenu(clueManager, body, false);
    this.header.insertCustomRightMenu(provenanceMenu.node);

    const phoveaNavbar = document.body.querySelector('.phovea-navbar');
    const modeSelector = phoveaNavbar.appendChild(document.createElement('header'));
    modeSelector.classList.add('clue-modeselector');
    ButtonModeSelector.createButton(modeSelector, {
      size: 'sm',
    });

    this.$main = select(body).select('main');

    const graph = clueManager.list().then((graphs) => {
      provenanceMenu.build(graphs);
      return clueManager.choose(graphs);
    });

    graph.then((g) => {
      provenanceMenu.setGraph(g);
      this.$mainRef = g.findOrAddObject(this.$main, 'Application', 'visual');

      g.on('sync_start,sync', (event: IEvent) => {
        select('nav span.glyphicon-cog').classed('fa-spin', event.type !== 'sync');
      });

      if (this.options.recordSelectionTypes) {
        // record selections of the given type
        SelectionRecorder.createSelectionRecorder(g, this.options.recordSelectionTypes, {
          filter(idtype) {
            return idtype && idtype.name[0] !== '_';
          },
          animated: this.options.animatedSelections,
        });
      }
    });

    const provVis = VisLoader.loadProvenanceGraphVis(graph, body.querySelector('div.content'), {
      thumbnails: this.options.thumbnails,
      provVisCollapsed: this.options.provVisCollapsed,
    });
    const storyVis = VisLoader.loadStoryVis(graph, <HTMLElement>body.querySelector('div.content'), <HTMLElement>this.$main.node(), {
      thumbnails: this.options.thumbnails,
    });

    return { graph, manager: clueManager, storyVis, provVis };
  }

  reset() {
    this.graph.then((graph) => {
      graph.jumpTo(graph.states[0]).then(() => {
        graph.clear();
        this.$mainRef = graph.findOrAddObject(this.$main, 'Application', 'visual');
        ModeWrapper.getInstance().setMode(CLUEMode.modes.Exploration);
      });
    });
  }

  /**
   * factory method creating a CLUEWrapper instance
   * @param body
   * @param options
   * @returns {CLUEWrapper}
   */
  static createCLUEWrapper(body: HTMLElement, options: any = {}) {
    return new CLUEWrapper(body, options);
  }

  /**
   * factory method creating a CLUEWrapper instance
   * @param body
   * @param options
   * @returns {CLUEWrapper}
   */
  static createWrapperFactory(body: HTMLElement, options: any = {}) {
    AppHeader.create(body, {
      appLink: new AppHeaderLink(options.app || 'Caleydo'),
      inverse: true,
    });
    const $main = d3v3.select(body).append('main').style('height', '92vh');
    const graph = ProvenanceGraph.createDummy();
    return {
      on: (...args: any[]) => 0,
      $main,
      graph: Promise.resolve(graph),
      jumpToStored: () => 0,
    };
  }
}


text:
<?php namespace App\Mail;

use App\Gig;
use App\Http\Controllers\MySettings;
use App\User;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;

class GigPublishedMail extends Mailable implements ShouldQueue
{
    use RecordsEmail;

    public $gigLink;
    public $mySettingsLink;

    public function __construct(public Gig $gig, User $user)
    {
        $this->email = $this->email($gig->emails(), $user);
        $this->gigLink = $this->email->signedLink($gig->wwwLocale($user->locale));
        $this->mySettingsLink = $this->email->signedLink(path_locale([MySettings::class, 'edit'], [], false, $user->locale));
    }

    public function build()
    {
        return $this->subject(__('mail.gig_published_title', ['title' => $this->gig->title]))
            ->markdown('emails.gig-published')
            ->with('locale', $this->locale);
    }
}


text:
If multiple data disks are attached to the ECS used to create a private image, ECSs created from the image may be unavailable. Therefore, you need to detach all data disks from the ECS before using it to create a private image.

This section describes how to detach all data disks from an ECS.

## Prerequisites

You have logged in to the ECS used to create a Linux private image.

## Procedure

1.  Check whether the ECS has data disks.

    Run the following command to check the number of disks attached to the ECS:

    **fdisk -l**

    -   If the number is greater than 1, the ECS has data disks. Go to  [2](#li113301841113110).
    -   If the number is equal to 1, no data disk is attached to the ECS. Go to  [3](#li9263195973116).

2.  Run the following command to check the data disks attached to the ECS:

    **mount**

    -   If the command output does not contain any EVS disk information, no EVS data disks need to be detached.

        ```
        /dev/vda1 on / type ext4 (rw,relatime,data=ordered)
        ```

    -   If information similar to the following is displayed, go to  [3](#li9263195973116):

        ```
        /dev/vda1 on / type ext4 (rw,relatime,data=ordered)
        /dev/vdb1 on /mnt/test type ext4 (rw,relatime,data=ordered)
        ```

3.  Delete the configuration information in the  **fstab**  file.
    1.  Run the following command to edit the  **fstab**  file:

        **vi /etc/fstab**

    2.  Delete the disk configuration from the  **fstab**  file.

        The  **/etc/fstab**  file contains information about the file systems and storage devices automatically attached to the ECS when the ECS starts. The configuration about data disks automatically attached to the ECS needs to be deleted, for example, the last row shown in the following figure.

        **Figure  1**  EVS disk configuration in the  **fstab**  file
        ![](figures/evs-disk-configuration-in-the-fstab-file.png "evs-disk-configuration-in-the-fstab-file")

4.  Run the following command to detach data disks from the ECS:

    Run the following command to detach the disks:

    **umount** _/dev/vdb__1_

5.  Run the following command to check the data disks attached to the ECS:

    **mount**

    If the command output contain no information about the data disks, they have been detached from the ECS.


text:
var GitHub = require('..');
var github = new GitHub(require('./_fake_user'));

var rand = require('randomatic');
var name = rand('*', 10);

github.post('/user/repos', { name:  name }, function(err, res) {
  if (err) return console.error(err);
  console.log(res);
});


text:
<?php

namespace aw\clubapiclient\collection;

/**
 * Collection object. Handles groups of objects output from
 * a fetch command.
 *
 * @category  Collection
 * @package   ClubApiClient
 * @author    Alex Wyett <alex@wyett.co.uk>
 * @copyright 2015 Alex Wyett
 * @license   http://www.php.net/license/3_01.txt  PHP License 3.01
 * @link      http://www.wyett.co.uk
 */
abstract class StaticCollection extends Collection
{
    /**
     * Stop fetch requests
     *
     * @throws \aw\clubapiclient\client\Exception
     */
    public function fetch()
    {
        throw new \aw\clubapiclient\client\Exception(
            null,
            'Fetch not allow for Static collections',
            -1
        );
    }

    /**
     * Stop filter requests
     *
     * @throws \aw\clubapiclient\client\Exception
     */
    public function filters()
    {
        throw new \aw\clubapiclient\client\Exception(
            null,
            'Filters not allow for Static collections',
            -1
        );
    }

    /**
     * @inheritDoc
     */
    public function getRoute()
    {
        return '';
    }
}


text:
from .client import GlobalOperationsClient

__all__ = ("GlobalOperationsClient",)


text:
package com.cool.weather.adapter;

import java.util.List;

import com.cool.weather.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class CityListAdapter extends BaseAdapter {

	public List<String> list;
	private LayoutInflater mInflater;
	private Context context;

	public CityListAdapter(Context context, List<String> list) {
		this.list = list;
		this.mInflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public String getItem(int position) {
		// TODO Auto-generated method stub
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup arg2) {
		View rowView = null;
		if (convertView == null) {
			rowView = mInflater.inflate(R.layout.item_city_list, null);
		} else {
			rowView = convertView;
		}

		TextView tv_city = (TextView) rowView.findViewById(R.id.tv_city);
		tv_city.setText(getItem(position));

		return rowView;
	}

}


text:
apt_update() {
unset UCF_FORCE_CONFFOLD
export UCF_FORCE_CONFFNEW=YES
ucf --purge /boot/grub/menu.lst
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get -o Dpkg::Options::="--force-confold" --force-yes -fuy dist-upgrade
}


text:
sap.ui.define(function () {
	"use strict";

	var BlockBaseRenderer = {
		apiVersion: 2
	};

	BlockBaseRenderer.render = function (oRm, oControl) {

		if (!oControl.getVisible()) {
			return;
		}

		oRm.openStart("div", oControl);
		if (oControl._getSelectedViewContent()) {
			oRm.class('sapUxAPBlockBase')
				.class("sapUxAPBlockBase" + oControl.getMode());
		} else {
			var sClassShortName = oControl.getMetadata().getName().split(".").pop();

			oRm.class(sClassShortName + oControl.getMode());
		}
		oRm.openEnd();

		if (oControl._getSelectedViewContent()) {
			oRm.renderControl(oControl._getSelectedViewContent());
		}
		oRm.close("div");
	};

	return BlockBaseRenderer;

}, /* bExport= */ true);


text:
# tweetboard

A dead simple tweetboard used for the Camunda Community Day on
17th September 2015 in the Camunda headquarters.

## Instalation

Ohhhhhh c'mon...

`git clone` `npm i` and all that stuff,

```js
'use strict';
/*jshint node: true*/
module.exports = {
  tag: 'bpmcon',
  credentials: {
    consumer_key:
      process.env.TWITTER_CONSUMER_KEY,
    consumer_secret:
      process.env.TWITTER_CONSUMER_SECRET,
    access_token_key:
      process.env.TWITTER_ACCESS_TOKEN_KEY,
    access_token_secret:
      process.env.TWITTER_ACCESS_TOKEN_SECRET
  }
};
```

# License

Sure, there's one, it's MIT


text:
package ws16.tut10.example;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Comparator;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Created by proj on 1/25/17.
 */
public class Baum<E extends Comparable<E>> {
    public Element<E> root;

    private class Element<E extends Comparable<E>> {
        public E data;
        private Element<E> left, right;

        public Element(E data) {
            this.data = data;
        }

        public void add(E el)
        {
            if(el.compareTo(data) < 0)
            {
                if(left == null)
                    left = new Element<>(el);
                else
                    left.add(el);
            }
            else
            {
                if(right == null)
                    right = new Element<>(el);
                else
                    right.add(el);
            }
        }

        public void print()
        {
            if(left!= null) left.print();
            System.out.println(data.toString());
            if(right != null) right.print();
        }
    }

    public void add(E el)
    {
        if(root == null)
            root = new Element<>(el);
        else
            root.add(el);
    }

    public void print()
    {
        if(root != null)
            root.print();
    }

    @Test
    public void testIfListIsEmpty()
    {
        ArrayList<Integer> xx = new ArrayList<>();
        assertTrue(xx.isEmpty());
    }

    @Test
    public void testMultiplication()
    {
        int a = 2, b = 3;
        int r = a * b;
        assertEquals(r, 6);
    }
}


text:
#include "small/region.h"
#include <sys/types.h> /* ssize_t */

void *
region_reserve_slow(struct region *region, size_t size)
{
	/* The new slab must have at least this many bytes available. */
	size_t slab_min_size = size + rslab_sizeof() - slab_sizeof();

	struct rslab *slab;
	slab = (struct rslab *) slab_get(region->cache, slab_min_size);
	if (slab == NULL)
		return NULL;
	slab->used = 0;
	/*
	 * Sic: add the new slab to the beginning of the
	 * region, even if it is full, otherwise,
	 * region_truncate() won't work.
	 */
	slab_list_add(&region->slabs, &slab->slab, next_in_list);
	return rslab_data(slab);
}

void
region_free(struct region *region)
{
	struct slab *slab, *tmp;
	rlist_foreach_entry_safe(slab, &region->slabs.slabs,
				 next_in_list, tmp)
		slab_put(region->cache, slab);

	slab_list_create(&region->slabs);
}

/**
 * Release all memory down to new_size; new_size has to be previously
 * obtained by calling region_used().
 */
void
region_truncate(struct region *region, size_t used)
{
	ssize_t cut_size = region_used(region) - used;
	assert(cut_size >= 0);

	while (! rlist_empty(&region->slabs.slabs)) {
		struct rslab *slab = rlist_first_entry(&region->slabs.slabs,
						       struct rslab,
						       slab.next_in_list);
		if (slab->used > cut_size) {
			/* This is the last slab to trim. */
			slab->used -= cut_size;
			cut_size = 0;
			break;
		}
		cut_size -= slab->used;
		/* Remove the entire slab. */
		slab_list_del(&region->slabs, &slab->slab, next_in_list);
		slab_put(region->cache, &slab->slab);
	}
	assert(cut_size == 0);
	region->slabs.stats.used = used;
}

void *
region_join_nothrow(struct region *region, size_t size)
{
	if (rlist_empty(&region->slabs.slabs)) {
		assert(size == 0);
		return region_alloc_nothrow(region, 0);
	}
	struct rslab *slab = rlist_first_entry(&region->slabs.slabs,
					       struct rslab,
					       slab.next_in_list);

	if (slab->used >= size) {
		/* Don't move stuff if it's in a single chunk. */
		return (char *) rslab_data(slab) + slab->used - size;
	}
	/**
	 * Use region_reserve() to ensure slab->size is not
	 * changed when the joined region is in the same slab
	 * as the final chunk.
	 */
	char *ptr = region_reserve_nothrow(region, size);
	size_t offset = size;
	if (ptr == NULL)
		return NULL;
	/*
	 * Copy data from last chunk to first, i.e. in the reverse order.
	 */
	while (offset > 0 && slab->used <= offset) {
		memcpy(ptr + offset - slab->used, rslab_data(slab), slab->used);
		offset -= slab->used;
		slab = rlist_next_entry(slab, slab.next_in_list);
	}
	if (offset > 0)
		memcpy(ptr, rslab_data(slab) + slab->used - offset, offset);
	region_alloc_nothrow(region, size);
	return ptr;
}


text:
package com.communote.server.core.vo.query;

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

import com.communote.common.util.PageableList;

/**
 * Query Result Converter generates from temporary object by the query definition the list object
 *
 * @author Communote GmbH - http://www.communote.com/
 * @param
 *            The object type of the returning temporary object
 *
 * @param <O>
 *            The returning list object
 */

public abstract class QueryResultConverter {

    /**
     * Converts the temporary object of the query to a list object
     *
     * @param source
     *            The temporary object returned by the executed query
     * @param target
     *            The converted list object
     * @return A boolean, which decide to add or remove the object from the list.
     */
    public abstract boolean convert(I source, O target);

    /**
     * Converts the temporary object of the query to a list object
     *
     * @param queryResult
     *            the temporary object returned by the executed query
     * @return the pageable list object
     */
    public PageableList<O> convert(PageableList queryResult) {
        PageableList<O> finalResult = new PageableList<O>(new ArrayList<O>(queryResult.size()));
        finalResult.setMinNumberOfElements(queryResult.getMinNumberOfElements());
        finalResult.setOffset(queryResult.getOffset());
        for (I item : queryResult) {
            O listObject = create();
            // TODO should we remove those that failed from the minNumberOfElements?
            if (convert(item, listObject)) {
                finalResult.add(listObject);
            }
        }
        return finalResult;
    }

    /**
     * Converts the temporary object to a list object
     *
     * @param results
     *            the temporary object returned by the executed query
     * @return the converted list
     */
    public List<O> convertCollection(Collection results) {
        return convert(new PageableList<>(results));
    }

    /**
     * Creates a new pageable list object to fill
     *
     * @return pageable list object
     */

    public abstract O create();
}


text:
/* Written by Bruno Haible <haible@clisp.cons.org>.  */

#include <config.h>

/* Specification.  */
#include "concat-filename.h"

#include "xalloc.h"

/* Concatenate a directory filename, a relative filename and an optional
   suffix.  The directory may end with the directory separator.  The second
   argument may not start with the directory separator (it is relative).
   Return a freshly allocated filename.  */
char *
xconcatenated_filename (const char *directory, const char *filename,
                        const char *suffix)
{
  char *result;

  result = concatenated_filename (directory, filename, suffix);
  if (result == NULL)
    xalloc_die ();

  return result;
}