text:
<?php

class DataConverter {

  public function serialize($data)
  {
    $sanitized = $this->sanitize($data);

    return json_encode($sanitized);
  }

  protected function sanitize($data)
  {
    if (is_scalar($data) || null === $data) {
      $sanitized = $data;
    } else if ($data instanceof \DateTime) {
      $sanitized = $data->format(\DateTime::ISO8601);
    } else if (is_array($data)) {
      foreach ($data as $property => $value) {
        $data[$property] = $this->sanitize($value);
      }
      $sanitized = $data;
    } else if (is_object($data)) {
      $values = array();
      foreach (array_keys($data::$swaggerTypes) as $property) {
        $dirty = call_user_func(array($data, 'get' . $property));
        $values[$property] = $this->sanitize($dirty);
      }
      $sanitized = $values;
    } else {
      $sanitized = (string)$data;
    }

    return $sanitized;
  }

  /**
   * Take value and turn it into a string suitable for inclusion in
   * the path, by url-encoding.
   * @param string $value a string which will be part of the path
   * @return string the serialized object
   */
  public function toPathValue($value) {
    return rawurlencode($value);
  }

  /**
   * Take value and turn it into a string suitable for inclusion in
   * the query, by imploding comma-separated if it's an object.
   * If it's a string, pass through unchanged. It will be url-encoded
   * later.
   * @param object $object an object to be serialized to a string
   * @return string the serialized object
   */
  public function toQueryValue($object) {
    if (is_array($object)) {
      return implode(',', $object);
    } else {
      return $object;
    }
  }

  /**
   * Just pass through the header value for now. Placeholder in case we
   * find out we need to do something with header values.
   * @param string $value a string which will be part of the header
   * @return string the header string
   */
  public function toHeaderValue($value) {
    return $value;
  }

  /**
   * @param string $serialized
   * @param string $class
   * @return mixed
   */
  public function deserialize($serialized, $class)
  {
    $deserialized = json_decode($serialized);

    return $this->bind($deserialized, $class);
  }

  private function bind($data, $class)
  {

    if (null === $data) {
      $deserialized = null;
    } else if (substr($class, 0, 6) == 'array[') {
      $subClass = substr($class, 6, -1);
      $values = array();
      foreach ($data as $value) {
        $values[] = $this->bind($value, $subClass);
      }
      $deserialized = $values;
    } elseif ($class == 'DateTime') {
      $deserialized = new \DateTime($data);
    } elseif (in_array($class, array('string', 'int', 'float', 'bool'))) {
      settype($data, $class);
      $deserialized = $data;
    } else {
      $instance = new $class();
      foreach ($instance::$swaggerTypes as $property => $type) {
        if (isset($data->$property)) {
          $value = $this->bind($data->$property, $type);
          if (null !== $value) {
            call_user_func(array($instance, 'set' . $property), $value);
          }
        }
      }
      $deserialized = $instance;
    }

    return $deserialized;
  }

}


text:
* since: v1.10
* langs: js

`WorkerInfo` contains information about the worker that is running tests. It is available to [`method: Test.beforeAll`] and [`method: Test.afterAll`] hooks and worker-scoped fixtures.

```js tab=js-js
const { test, expect } = require('@playwright/test');

test.beforeAll(async ({ browserName }, workerInfo) => {
  console.log(`Running ${browserName} in worker #${workerInfo.workerIndex}`);
});
```

```js tab=js-ts
import { test, expect } from '@playwright/test';

test.beforeAll(async ({ browserName }, workerInfo) => {
  console.log(`Running ${browserName} in worker #${workerInfo.workerIndex}`);
});
```

## property: WorkerInfo.config
* since: v1.10
- type: <[TestConfig]>

Processed configuration from the [configuration file](../test-configuration.md).

## property: WorkerInfo.parallelIndex
* since: v1.10
- type: <[int]>

The index of the worker between `0` and `workers - 1`. It is guaranteed that workers running at the same time have a different `parallelIndex`. When a worker is restarted, for example after a failure, the new worker process has the same `parallelIndex`.

Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about [parallelism and sharding](../test-parallel.md) with Playwright Test.

## property: WorkerInfo.project
* since: v1.10
- type: <[TestProject]>

Processed project configuration from the [configuration file](../test-configuration.md).

## property: WorkerInfo.workerIndex
* since: v1.10
- type: <[int]>

The unique index of the worker process that is running the test. When a worker is restarted, for example after a failure, the new worker process gets a new unique `workerIndex`.

Also available as `process.env.TEST_WORKER_INDEX`. Learn more about [parallelism and sharding](../test-parallel.md) with Playwright Test.

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lbookshelf.Business
{
    public class BookOpenedException : ApplicationException
    {
        public BookOpenedException(string path, Exception innerException)
            : base(String.Format("This book is currently opened: {0}. Please close it and try again.", path), innerException)
        {

        }
    }
}


text:
Animation Editor

The animation Editor is


text:
package OpenXPKI::Client::UI::Handle::Profile;

use Moose;
use Data::Dumper;
use English;
use OpenXPKI::Serialization::Simple;

sub render_profile_select {

    my $class = shift; # static call
    my $self = shift; # reference to the wrapping workflow/result
    my $args = shift;
    my $wf_action = shift;

    $self->logger()->debug( 'render_profile_select with args: ' . Dumper $args );

    my $wf_info = $args->{WF_INFO};

    # Get the list of profiles from the backend - return is a hash with id => hash
    my $profiles = $self->send_command( 'get_cert_profiles', {});
    # Transform hash into value/label list and sort it
    # Apply translation
    map { $profiles->{$_}->{label} = $profiles->{$_}->{label} } keys %{$profiles};
    # Sort
    my @profiles = sort { lc($a->{label}) cmp lc($b->{label}) } values %{$profiles};

    my $context = $wf_info->{WORKFLOW}->{CONTEXT};

    my $cert_profile = $context->{cert_profile} || '';

    # If the profile is preselected, we need to fetch the options
    my @styles;
    if ($cert_profile) {
        my $styles = $self->send_command( 'get_cert_subject_profiles', { PROFILE => $cert_profile });
        # TODO clean up API after Mason decomissioning
        # Transform hash into value/label list and sort it
        @styles = map { { value => $_, label => $styles->{$_}->{LABEL}, description => $styles->{$_}->{DESCRIPTION} } } keys %{$styles};
        @styles = sort { lc($a->{label}) cmp lc($b->{label}) } @styles;
    }

    my @fields;
    foreach my $field (@{$wf_info->{ACTIVITY}->{$wf_action}->{field}}) {
        my $name = $field->{name};
        my $item = $self->__render_input_field( $field, $context->{$name} );

        if ($name eq 'cert_profile') {
            $item = {
                %{$item},
                options => \@profiles,
                actionOnChange => 'profile!get_styles_for_profile',
                prompt => $item->{placeholder}, # todo - rename in UI
            };
        } elsif ($name eq 'cert_subject_style') {
            $item = {
                %{$item},
                options => \@styles,
                prompt => $item->{placeholder}, # todo - rename in UI
            };
        }

        push @fields, $item;
    }

    # record the workflow info in the session
    push @fields, $self->__register_wf_token($wf_info, {
        wf_action => $wf_action,
        wf_fields => \@fields,
    });

    $self->add_section({
        type => 'form',
        action => 'workflow',
        content => {
            submit_label => 'I18N_OPENXPKI_UI_WORKFLOW_SUBMIT_BUTTON',
            fields => \@fields
        }
    });

    return $self;

}

sub render_subject_form {

    my $class = shift; # static call
    my $self = shift; # reference to the wrapping workflow/result
    my $args = shift;
    my $wf_action = shift;

    my $wf_info = $args->{WF_INFO};

    my $context = $wf_info->{WORKFLOW}->{CONTEXT};

    # get profile and style from the context
    my $cert_profile = $context->{'cert_profile'};
    my $cert_subject_style = $context->{'cert_subject_style'};

    # Parse out the field name and type, we assume that there is only one activity with one field
    $wf_action = (keys %{$wf_info->{ACTIVITY}})[0] unless($wf_action);
    my $field_name = $wf_info->{ACTIVITY}->{$wf_action}->{field}[0]->{name};
    my $field_type = $wf_info->{ACTIVITY}->{$wf_action}->{field}[0]->{type};

    $self->logger()->debug( " Render subject for $field_name with type $field_type in $wf_action " );

    # Allowed types are cert_subject, cert_san, cert_info
    my $fields = $self->send_command( 'get_field_definition',
        { PROFILE => $cert_profile, STYLE => $cert_subject_style, 'SECTION' =>  substr($field_type, 5) });

    $self->logger()->debug( 'Profile fields' . Dumper $fields );

    # Load preexisiting values from context
    my $values = {};
    if ($context->{$field_name}) {
        $values = $self->serializer()->deserialize( $context->{$field_name} );
    }

    $self->logger()->debug( 'Preset ' . Dumper $values );

    # Map the old notation for the new UI
    $fields = OpenXPKI::Client::UI::Handle::Profile::__translate_form_def( $fields, $field_name, $values );

    $self->logger()->debug( 'Mapped fields' . Dumper $fields );

    # record the workflow info in the session
    push @{$fields}, $self->__register_wf_token($wf_info, {
        wf_action => $wf_action,
        wf_fields => $fields,
    });

    $self->add_section({
        type => 'form',
        action => 'workflow',
        content => {
            submit_label => 'I18N_OPENXPKI_UI_WORKFLOW_SUBMIT_BUTTON',
            fields => $fields,
            buttons => $self->__get_form_buttons( $wf_info ),
        }
    });

    return $self;

}

sub render_key_select {

    my $class = shift; # static call
    my $self = shift; # reference to the wrapping workflow/result
    my $args = shift;
    my $wf_action = shift;

    $self->logger()->debug( 'render_profile_select with args: ' . Dumper $args );

    my $wf_info = $args->{WF_INFO};
    my $context = $wf_info->{WORKFLOW}->{CONTEXT};

    # Get the list of allowed algorithms
    my $key_alg = $self->send_command( 'get_key_algs', { PROFILE => $context->{cert_profile} });
    my @key_type;
    foreach my $alg (@{$key_alg}) {
       push @key_type, { label => 'I18N_OPENXPKI_UI_KEY_ALG_'.uc($alg) , value => $alg };
    }

    my $key_gen_param_names = $self->send_command( 'get_key_params', { PROFILE => $context->{cert_profile} });

    # current values from context when changing values!
    my $key_gen_param_values = $context->{key_gen_params} ? $self->serializer()->deserialize( $context->{key_gen_params} ) : {};

    # Encryption
    my $key_enc = $self->send_command( 'get_key_enc', { PROFILE => $context->{cert_profile} });
    my @enc = map { { value => $_, label => 'I18N_OPENXPKI_UI_KEY_ENC_'.uc($_)  }  } @{$key_enc};

    my @fields;
    FIELDS:
    foreach my $field (@{$wf_info->{ACTIVITY}->{$wf_action}->{field}}) {
        my $name = $field->{name};

        if ($name eq 'key_gen_params') {
            foreach my $pn (@{$key_gen_param_names}) {
                $pn = uc($pn);
                # We create the label as I18 string from the param name
                my $label = 'I18N_OPENXPKI_UI_KEY_'.$pn;
                push @fields, {
                    name => "key_gen_params{$pn}",
                    label => $label,
                    value => $key_gen_param_values->{ $pn },
                    type => 'select',
                    options => []
                };
            }
            next FIELDS;
        }

        my $item = $self->__render_input_field( $field );
        $item->{prompt} = $item->{placeholder}; # todo - rename in UI
        if ($name eq 'key_alg') {
            $item = {
                %{$item},
                options => \@key_type,
                actionOnChange => 'profile!get_key_param'
            };
        } elsif ($name eq 'enc_alg') {
            $item->{options} = \@enc;
        } elsif ($name eq 'csr_type') {
             $item->{value} = 'pkcs10';
        }
        push @fields, $item;
    }

    # record the workflow info in the session
    push @fields, $self->__register_wf_token($wf_info, {
        wf_action => $wf_action,
        wf_fields => \@fields,
        cert_profile => $context->{cert_profile}
    });

    $self->add_section({
        type => 'form',
        action => 'workflow',
        content => {
        submit_label => 'I18N_OPENXPKI_UI_WORKFLOW_SUBMIT_BUTTON',
            fields => \@fields
        }
    });

    return $self;

}

sub render_server_password {

    my $class = shift; # static call
    my $self = shift; # reference to the wrapping workflow/result
    my $args = shift;
    my $wf_action = shift;

    $self->logger()->debug( 'render_server_password with args: ' . Dumper $args );

    my $wf_info = $args->{WF_INFO};
    my $context = $wf_info->{WORKFLOW}->{CONTEXT};

    my @fields;
    my $pwdfailed = 0;
    foreach my $field (@{$wf_info->{ACTIVITY}->{$wf_action}->{field}}) {
        my $value;
        if ($field->{name} eq '_password') {
            $value = $self->send_command( 'get_random', { LENGTH => 16 });
            if (!$value) {
                $self->set_status('I18N_OPENXPKI_UI_PROFILE_UNABLE_TO_GENERATE_PASSWORD_ERROR_LABEL','error');
                $self->add_section({
                    type => 'text',
                    content => {
                        label => 'I18N_OPENXPKI_UI_PROFILE_UNABLE_TO_GENERATE_PASSWORD_LABEL',
                        description => 'I18N_OPENXPKI_UI_PROFILE_UNABLE_TO_GENERATE_PASSWORD_DESC'
                    }
                });
                return $self;
            }
        } else {
            $value = $context->{$field->{name}};
        }
        my $item = $self->__render_input_field( $field, $value );
        push @fields, $item;
    }

    # record the workflow info in the session
    push @fields, $self->__register_wf_token($wf_info, {
        wf_action =>  (keys %{$wf_info->{ACTIVITY}})[0],
        wf_fields => \@fields,
        cert_profile => $context->{cert_profile}
    });

    $self->add_section({
        type => 'form',
        action => 'workflow',
        content => {
        submit_label => 'I18N_OPENXPKI_UI_WORKFLOW_SUBMIT_BUTTON',
            fields => \@fields
        }
    });

    return $self;

}

sub __translate_form_def {

    my $fields = shift;
    my $field_name = shift;
    my $values = shift;

    # TODO - Refactor profile definitions to make this obsolete
    my @fields;
    foreach my $field (@{$fields}) {
        my $new = {
            name => $field_name.'{'.$field->{ID}.'}',
            label => $field->{LABEL},
            tooltip => $field->{DESCRIPTION},
             # Placeholder is the new attribute, fallback to old default
            placeholder => (defined $field->{PLACEHOLDER} ? $field->{PLACEHOLDER} : $field->{DEFAULT}),
            value => $values->{$field->{ID}}
        };

        if ($field->{TYPE} eq 'freetext') {
            $new->{type} = 'text';
        } elsif ($field->{TYPE} eq 'select') {
            $new->{type} = 'select';

            my @options;
            foreach my $item (@{$field->{OPTIONS}}) {
               push @options, { label => $item, value => $item};
            }
            $new->{options} = \@options;
        } else {
            $new->{type} = 'text';
        }

        if (defined $field->{MIN}) {
            if ($field->{MIN} == 0) {
                $new->{is_optional} = 1;
            } else {
                $new->{min} = $field->{MIN};
                $new->{clonable} = 1;
            }
        }

        if (defined $field->{MAX}) {
            $new->{max} = $field->{MAX};
            $new->{clonable} = 1;
        }

        # Check for key/value field
        if ($field->{KEYS}) {
            $new->{name} =  $field_name.'{*}';
            my $format = $field_name.'{%s}';
            $format .= '[]' if ($new->{clonable});

            my @keys = map { {
                value => sprintf ($format, $_->{value}),
                label => $_->{label}
            } } @{$field->{KEYS}};
            $new->{keys} = \@keys;
        }

        if ($new->{clonable}) {
            $new->{name} .= '[]';
        }

        push @fields, $new;
    }

    return \@fields;

}

1;

__END__


text:
BASE_DIR=`dirname $0`
INCLUDE_DIR=$BASE_DIR/../../proton-c/include/proton
OUTPUT_DIR=$BASE_DIR/target

mkdir -p $OUTPUT_DIR
ctags --c-kinds=p -x $INCLUDE_DIR/*.h | awk '{print $1'} > $OUTPUT_DIR/cfunctions.txt


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=type.N16384.html">

Redirecting to type.N16384.html...


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:osgi="http://www.eclipse.org/gemini/blueprint/schema/blueprint"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                        http://www.eclipse.org/gemini/blueprint/schema/blueprint
                        http://www.eclipse.org/gemini/blueprint/schema/blueprint/gemini-blueprint.xsd">

    <import resource="classpath*:META-INF/motech/*.xml" />

    <osgi:service id="appointmentServiceOsgi" interface="org.motechproject.appointments.service.AppointmentService" ref="appointmentService" />
    <osgi:reference id="appointmentDataService" interface="org.motechproject.appointments.repository.AppointmentDataService" />
    <osgi:reference id="appointmentRecordDataService" interface="org.motechproject.appointments.repository.AppointmentChangeRecordDataService" />
    <osgi:reference id="schedulerService" interface="org.motechproject.scheduler.service.MotechSchedulerService" />
    <osgi:reference id="transactionManager" interface="org.springframework.transaction.PlatformTransactionManager" context-class-loader="unmanaged"/>

</beans>


text:
module Telegram
  API_KEY = ENV.fetch('telegram_bot_token') { 'telegram_bot_token' }
  CHAT_ID = ENV.fetch('telegram_chat_id') { 'telegram_chat_id' }
  BASE_URI = 'https://api.telegram.org'

  class ParseError < StandardError; end
  class LongMessageError < StandardError; end
  class Error < StandardError; end
end


text:
<?php

use Zver\Finder;

class FinderCest
{

    public $testDirectoriesDepth = 40;

    public function _before()
    {
        $this->_createTestDirectories();
    }

    public function _createTestDirectories()
    {
        $mostDepthDirectory = __DIR__ . str_repeat(DIRECTORY_SEPARATOR . 'test', $this->testDirectoriesDepth);
        if (!file_exists($mostDepthDirectory))
        {
            mkdir($mostDepthDirectory, 0777, true);
        }

        for ($i = $this->testDirectoriesDepth; $i > 0; $i--)
        {
            $testFile = __DIR__ . str_repeat(DIRECTORY_SEPARATOR . 'test', $i) . DIRECTORY_SEPARATOR . 'test.txt';
            touch($testFile);
        }
    }

    public function _after()
    {
        $this->_deleteTestDirectories();
    }

    public function _deleteTestDirectories()
    {
        for ($i = $this->testDirectoriesDepth; $i > 0; $i--)
        {
            $testFile = __DIR__ . str_repeat(DIRECTORY_SEPARATOR . 'test', $i) . DIRECTORY_SEPARATOR . 'test.txt';
            $testDir = __DIR__ . str_repeat(DIRECTORY_SEPARATOR . 'test', $i);
            unlink($testFile);
            rmdir($testDir);
        }
    }

    public function testInstance(UnitTester $I)
    {
        Finder::instance();
        $I->assertEquals(gettype(Finder::instance()), 'object');
        $I->assertEquals(get_class(Finder::instance()), 'Zver\Finder');
    }

    public function testDirectoriesSetAndGet(UnitTester $I)
    {
        $object = Finder::instance();
        $I->assertEquals($object->getDirectories(), []);

        $object->addDirectory(__DIR__);
        $object->addDirectories(__DIR__);
        $object->addDirectories([__DIR__, __DIR__]);

        $I->assertEquals($object->getDirectories(), [__DIR__]);

        $object->addDirectory(__DIR__ . '/../');
        $object->addDirectory(__DIR__ . '/../../../');
        $object->addDirectory(__DIR__ . '/../');
        $object->addDirectories([__DIR__, __DIR__ . '/../../../']);
        $object->addDirectories([__DIR__, __DIR__ . '/../../../']);
        $object->addDirectories([__DIR__, __DIR__ . '/../../../']);
        $object->addDirectories([__DIR__, __DIR__ . '/../../../']);
        $object->addDirectories([__DIR__, __DIR__ . '/../../../']);

        $I->assertEquals(
            $object->getDirectories(), [
                                         __DIR__,
                                         realpath(__DIR__ . '/../'),
                                         realpath(__DIR__ . '/../../../'),
                                     ]
        );

        $object->addDirectoryFirst(__DIR__ . '/../../../../../');
        $object->addDirectory(__DIR__ . '/../../../../../');
        $I->assertEquals(
            $object->getDirectories(), [
                                         realpath(__DIR__ . '/../../../../../'),
                                         __DIR__,
                                         realpath(__DIR__ . '/../'),
                                         realpath(__DIR__ . '/../../../'),
                                     ]
        );

        $object->resetDirectories();
        $I->assertEquals($object->getDirectories(), []);
    }

    public function testResultsDirectories(UnitTester $I)
    {
        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return is_dir($path);
                             }
                         )
                         ->find();

        $I->assertEquals(count($results), $this->testDirectoriesDepth);
    }

    public function testResultsFiles(UnitTester $I)
    {
        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return is_file($path);
                             }
                         )
                         ->find();

        $I->assertEquals(count($results), $this->testDirectoriesDepth);
    }

    public function testResultsReadable(UnitTester $I)
    {
        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return is_readable($path);
                             }
                         )
                         ->find();

        $I->assertEquals(count($results), $this->testDirectoriesDepth * 2);
    }

    public function testResultPassedToFilter(UnitTester $I)
    {
        $originalValues = [];
        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path) use (&$originalValues)
                             {
                                 $originalValues[] = $path;

                                 return is_readable($path);
                             }
                         )
                         ->find();

        $I->assertEquals(count($originalValues), $this->testDirectoriesDepth * 2);
        $I->assertEquals(count($originalValues), count(array_unique($originalValues)));
    }

    public function testResultsFilterFalse(UnitTester $I)
    {
        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return false;
                             }
                         )
                         ->find();

        $I->assertEquals($results, []);
    }

    public function testResultsLimitFilterFalse(UnitTester $I)
    {
        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return false;
                             }
                         )
                         ->limit(10)
                         ->find();

        $I->assertEquals($results, []);

        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return false;
                             }
                         )
                         ->find();

        $I->assertEquals($results, []);

        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return false;
                             }
                         )
                         ->resetFilters()
                         ->find();

        $I->assertEquals(count($results), $this->testDirectoriesDepth * 2);
    }

    public function testResultsLimitFilterTrue(UnitTester $I)
    {
        $results = Finder::instance(__DIR__ . '/test/')
                         ->filter(
                             function ($path)
                             {
                                 return true;
                             }
                         )
                         ->limit(10)
                         ->find();

        $I->assertEquals(count($results), 10);
    }

    public function testLimitException(UnitTester $I)
    {

        $I->expectException(
            'InvalidArgumentException', function ()
        {

            Finder::instance()
                  ->limit('sd3r3rf');
        }
        );
    }

    public function testAddDirectoryException(UnitTester $I)
    {

        $I->expectException(
            'Exception', function ()
        {
            Finder::instance()
                  ->addDirectory('sd3r3rf');
        }
        );
    }

    public function testNoDirectoriesSet(UnitTester $I)
    {
        $results = Finder::instance()
                         ->find();

        $I->assertEquals($results, []);
    }

}


text:
package tw.com.ischool.fireflylite.credential;

/**
 * Created by 西華 on 2015/1/22.
 */
public class CallerException extends Exception {
    public CallerException(){
        super();
    }

    public CallerException(String message){
        super(message);
    }

    public CallerException(String message, Throwable cause){
        super(message,cause);
    }
}


text:
class Attendee
  def initialize(height)
    raise NotImplementedError, 'Implement the Attendee#initialize method'
  end

  def height
    raise NotImplementedError, 'Implement the Attendee#height method'
  end

  def pass_id
    raise NotImplementedError, 'Implement the Attendee#pass_id method'
  end

  def issue_pass!(pass_id)
    raise NotImplementedError, 'Implement the Attendee#issue_pass! method'
  end

  def revoke_pass!
    raise NotImplementedError, 'Implement the Attendee#revoke_pass! method'
  end
end


text:
<?php

/**
 * Converts the field value to valid html
 * @param Field $field The calling Kirby Field instance
 * @param boolean $keepTags Don't touch valid html tags
 * @return Field
 */
field::$methods['html'] = field::$methods['h'] = function($field, $keepTags = true) {
  $field->value = html($field->value, $keepTags);
  return $field;
};

/**
 * Escapes unwanted characters in the field value
 * to protect from possible xss attacks or other
 * unwanted side effects in your html code
 * @param Field $field The calling Kirby Field instance
 * @param string $context html|attr|css|js|url
 * @return Field
 */
field::$methods['escape'] = field::$methods['esc'] = function($field, $context = 'html') {
  $field->value = esc($field->value, $context);
  return $field;
};

/**
 * Converts html entities and specialchars in the field
 * value to valid xml entities
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['xml'] = field::$methods['x'] = function($field) {
  $field->value = xml($field->value);
  return $field;
};

/**
 * Parses the field value as kirbytext
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['kirbytext'] = field::$methods['kt'] = function($field) {
  $field->value = kirbytext($field);
  return $field;
};

/**
 * Parses the field value as markdown
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['markdown'] = field::$methods['md'] = function($field) {
  $field->value = markdown($field->value);
  return $field;
};

/**
 * Converts the field value to lower case
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['lower'] = function($field) {
  $field->value = str::lower($field->value);
  return $field;
};

/**
 * Converts the field value to upper case
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['upper'] = function($field) {
  $field->value = str::upper($field->value);
  return $field;
};

/**
 * Applies the widont rule to avoid single
 * words on the last line
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['widont'] = function($field) {
  $field->value = widont($field->value);
  return $field;
};

/**
 * Creates a simple text excerpt without formats
 * @param Field $field The calling Kirby Field instance
 * @param integer $chars The desired excerpt length
 * @return string
 */
field::$methods['excerpt'] = function($field, $chars = 140) {
  return excerpt($field->value, $chars);
};

/**
 * Shortens the field value by the given length
 * @param Field $field The calling Kirby Field instance
 * @param integer $length The desired string length
 * @param string $rep The attached ellipsis character if the string is longer
 * @return string
 */
field::$methods['short'] = function($field, $length, $rep = '…') {
  return str::short($field->value, $length, $rep);
};

/**
 * Returns the string length of the field value
 * @param Field $field The calling Kirby Field instance
 * @return integer
 */
field::$methods['length'] = function($field) {
  return str::length($field->value);
};

/**
 * Returns the word count for the field value
 * @param Field $field The calling Kirby Field instance
 * @return integer
 */
field::$methods['words'] = function($field) {
  return str_word_count(strip_tags($field->value));
};

/**
 * Splits the field value by the given separator
 * @param Field $field The calling Kirby Field instance
 * @param string $separator The string to split the field value by
 * @return array
 */
field::$methods['split'] = function($field, $separator = ',') {
  return str::split($field->value, $separator);
};

/**
 * Parses the field value as yaml and returns an array
 * @param Field $field The calling Kirby Field instance
 * @return array
 */
field::$methods['yaml'] = function($field) {
  return yaml($field->value);
};

/**
 * Checks if the field value is empty
 * @param Field $field The calling Kirby Field instance
 * @return boolean
 */
field::$methods['empty'] = field::$methods['isEmpty'] = function($field) {
  return empty($field->value);
};

/**
 * Returns all page objects from a yaml list in a field
 * @param Field $field The calling Kirby Field instance
 * @return Collection
 */
field::$methods['pages'] = function($field) {

  $related = array();

  foreach($field->yaml() as $r) {
    // make sure to only add found related pages
    if($rel = page($r)) $related[$rel->id()] = $rel;
  }

  return new Collection($related);

};

/**
 * Adds 'or' method to Field objects, which allows getting a field
 * value or getting back a default value if the field is empty.
 * @author fvsch <florent@fvsch.com>
 * @param Field $field The calling Kirby Field instance
 * @param mixed $fallback Fallback value returned if field is empty
 * @return mixed
 */
field::$methods['or'] = function($field, $fallback = null) {
  return $field->empty() ? $fallback : $field;
};

/**
 * Filter the Field value, or a fallback value if the Field is empty,
 * to get a boolean value. '1', 'on', 'true' or 'yes' will be true,
 * and everything else will be false.
 * @author fvsch <florent@fvsch.com>
 * @param Field $field The calling Kirby Field instance
 * @param boolean $default Default value returned if field is empty
 * @return boolean
 */
field::$methods['bool'] = function($field, $default = false) {
  $val = $field->empty() ? $default : $field->value;
  return filter_var($val, FILTER_VALIDATE_BOOLEAN);
};

/**
 * Get an integer value for the Field.
 * @author fvsch <florent@fvsch.com>
 * @param Object(Field) [$field] The calling Kirby Field instance
 * @param integer [$default] Default value returned if field is empty
 * @return integer
 */
field::$methods['int'] = function($field, $default = 0) {
  $val = $field->empty() ? $default : $field->value;
  return intval($val);
};


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

	<TextView   android:text="Date Climbed" android:id="@+id/date_climbed_label"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<DatePicker android:id="@+id/dialog_climbed_date_picker"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></DatePicker>
	<TextView   android:text="Notes" android:id="@+id/notes_label"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<EditText  android:id="@+id/dialog_climbed_notes"
		android:layout_width="match_parent" android:layout_height="wrap_content"></EditText>
	<LinearLayout
		android:orientation="horizontal" android:layout_width="match_parent"
		android:layout_height="wrap_content">
		<Button android:text="OK" android:id="@+id/Button_ok"
			android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
		<Button android:text="Cancel" android:id="@+id/Button_cancel"
			android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>

	</LinearLayout>

</LinearLayout>


text:
@interface DRArtWork : DRObject

@property(copy, nonatomic) NSString *created_at;
@property(copy, nonatomic) NSString *createdTime;

@property(copy, nonatomic) NSString *updated_at;
@property(copy, nonatomic) NSString *updatedTime;

@property(strong, nonatomic) DRUser *user;
@property(strong, nonatomic) DRTeam *team;

@end


text:
package info.naiv.lab.java.jmt.runtime;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.Callable;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

/**
 *
 * @author enlo
 */
public interface MethodInvoker {

    final int ARGC_MAX = 0xFF;

    boolean checkParameterCount(int argc);

    /**
     * 渡された引数を用いて、メソッド呼び出しが可能と判断な場合、 Function オブジェクトを戻す.
     *
     * @param target ターゲット
     * @param args 引数
     * @return 呼び出しが可能と判断された場合は関数オブジェクト. それ以外は null
     */
    @CheckForNull
    Callable<Object> toCallable(@Nonnull Object target, Object... args);

    /**
     * アノテーションの取得.
     *
     * @param <A>
     * @param annotationClass
     * @return
     */
    <A extends Annotation> A getAnnotation(Class<A> annotationClass);

    /**
     *
     * @return パラメータタイプの取得.
     */
    Class<?>[] getParameterTypes();

    /**
     * メソッド呼び出し.
     *
     * @param target
     * @param args
     * @return
     * @throws IllegalAccessException
     * @throws IllegalArgumentException
     * @throws InvocationTargetException
     */
    Object invoke(Object target, Object... args) throws IllegalAccessException,
                                                        IllegalArgumentException,
                                                        InvocationTargetException;
}


text:
#include "SkBitmap.h"
#include "SkRegion.h"

bool SkBitmap::scrollRect(const SkIRect* subset, int dx, int dy,
                          SkRegion* inval) const
{
    if (this->isImmutable() || kUnknown_SkColorType == this->colorType()) {
        return false;
    }

    if (subset) {
        SkBitmap tmp;

        return  this->extractSubset(&tmp, *subset) &&
                // now call again with no rectangle
                tmp.scrollRect(NULL, dx, dy, inval);
    }

    int shift = this->bytesPerPixel() >> 1;
    int width = this->width();
    int height = this->height();

    // check if there's nothing to do
    if ((dx | dy) == 0 || width <= 0 || height <= 0) {
        if (inval) {
            inval->setEmpty();
        }
        return true;
    }

    // compute the inval region now, before we see if there are any pixels
    if (inval) {
        SkIRect r;

        r.set(0, 0, width, height);
        // initial the region with the entire bounds
        inval->setRect(r);
        // do the "scroll"
        r.offset(dx, dy);

        // check if we scrolled completely away
        if (!SkIRect::Intersects(r, inval->getBounds())) {
            // inval has already been updated...
            return true;
        }

        // compute the dirty area
        inval->op(r, SkRegion::kDifference_Op);
    }

    SkAutoLockPixels    alp(*this);
    // if we have no pixels, just return (inval is already updated)
    // don't call readyToDraw(), since we don't require a colortable per se
    if (this->getPixels() == NULL) {
        return true;
    }

    char*       dst = (char*)this->getPixels();
    const char* src = dst;
    int         rowBytes = (int)this->rowBytes();    // need rowBytes to be signed

    if (dy <= 0) {
        src -= dy * rowBytes;
        height += dy;
    } else {
        dst += dy * rowBytes;
        height -= dy;
        // now jump src/dst to the last scanline
        src += (height - 1) * rowBytes;
        dst += (height - 1) * rowBytes;
        // now invert rowbytes so we copy backwards in the loop
        rowBytes = -rowBytes;
    }

    if (dx <= 0) {
        src -= dx << shift;
        width += dx;
    } else {
        dst += dx << shift;
        width -= dx;
    }

    // If the X-translation would push it completely beyond the region,
    // then there's nothing to draw.
    if (width <= 0) {
        return true;
    }

    width <<= shift;    // now width is the number of bytes to move per line
    while (--height >= 0) {
        memmove(dst, src, width);
        dst += rowBytes;
        src += rowBytes;
    }

    this->notifyPixelsChanged();
    return true;
}


text:
layout: post
title: NOIP2017
excerpt: Adios
category: Blog
tag: NOIP
comments: true
private: true
---

*GGWP Stogov.*

Lo siento mi amigos, there should be no more Stogov.


text:
export var environment = {
    production: false
};
//# sourceMappingURL=environment.js.map


text:
var myCustomTemplateModule = {};

myCustomTemplateModule["fixtures/one.tpl.html"] = "1 2 3";

myCustomTemplateModule["fixtures/two.tpl.html"] = "Testing";


text:
```bash
bundle exec rake update
```
// TODO : automation using rake

### 2. Update gem version number

Edit `lib/summernote-image-attributes-rails/version.rb`

```ruby
module SummernoteImageAttributesRails
  module Rails
    VERSION = x.y.0
  end
end
```

### 3. Publish

Publish on rubygems

```bash
bundle exec rake release
```

this command git tagging and publish


text:
package com.netflix.spinnaker.halyard.config.validate.v1.providers.oracle;

import com.netflix.spinnaker.halyard.config.model.v1.node.Validator;
import com.netflix.spinnaker.halyard.config.model.v1.providers.oracle.OracleAccount;
import com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemSetBuilder;
import com.netflix.spinnaker.halyard.core.problem.v1.Problem.Severity;
import org.springframework.stereotype.Component;

@Component
public class OracleAccountValidator extends Validator<OracleAccount> {
  @Override
  public void validate(ConfigProblemSetBuilder psBuilder, OracleAccount account) {

    notNullOrEmpty(account.getCompartmentId(), "compartment id", psBuilder);
    notNullOrEmpty(account.getUserId(), "user id", psBuilder);
    notNullOrEmpty(account.getFingerprint(), "fingerprint", psBuilder);
    notNullOrEmpty(account.getSshPrivateKeyFilePath(), "ssh private key file path", psBuilder);
    notNullOrEmpty(account.getTenancyId(), "tenancy id", psBuilder);
    notNullOrEmpty(account.getRegion(), "region", psBuilder);

    // TODO (simonlord): Once BMCS SDK is in maven we can access via
    // spinnaker.dependency("clouddriverOracleBmcs") and test account login
  }

  private void notNullOrEmpty(String param, String paramName, ConfigProblemSetBuilder psBuilder) {
    if (param == null || param.isEmpty()) {
      psBuilder.addProblem(Severity.FATAL, "You must provide a " + paramName);
    }
  }
}


text:
livestreamer -Q -l none -o ~/Desktop/iss_`date +"%m-%d-%yT%I-%M-%S-%p"`.flv http://ustream.tv/channel/iss-hdev-payload mobile_720p &
PID=$!

# Wait to start streaming
sleep 15

# Stream until specified timeout
sleep $1
kill $PID

echo "Done"


text:
layout: post
title: "Running a Rails Application on Deis"
tags: [rails, deis, docker, coreos]
header-img: img/post-bg-06.jpg
---

In the last couple of years, we have seen a lot of development in the devops
field. It's becoming much easier for developers to provision servers and deploy
their applications on those servers just with a couple of key strokes. Since the
start of the SaaS and PaaS products (even before we knew them as that), we have
seen a vast number of companies and communities try to make our lives easier by
developing smart tools that will fit into our workflow seamlessly.

As a side effect, or perhaps intentionally, we've also seen the open-source
community create tools to not just make the workflow easier but to cut costs and
enable us to make great software without thinking about the costs of the
hardware.

Amazon with its huge selection of web services ([AWS](https://aws.amazon.com/))
and the like have made our lives much easier when it comes to incorporating
infrastructure and tools in the cloud. Then there are
[Chef](https://www.chef.io/chef/) and [Puppet](https://puppetlabs.com/) that made
provisioning servers a breeze. Then came containerization in the form of
[Docker](https://www.docker.com/), although some would argue that containers,
or at least the idea around them, existed well before Docker came along.

Read the rest of the blog post on
[Codeship's Blog](http://blog.codeship.com/running-a-rails-application-on-deis/).


text:
package org.apache.ambari.server.state.stack.upgrade;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

/**
 * Used to represent an execution that should occur on an agent.
 * An equivalent class exists in the python server-side, called ExecuteTask in ru_execute_tasks.py
 */
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="execute")
public class ExecuteTask extends Task {

  @XmlTransient
  private Task.Type type = Task.Type.EXECUTE;

  /**
   * The hosts to run the task on. Default to running on
   * {@link ExecuteHostType#ALL}.
   */
  @XmlAttribute
  public ExecuteHostType hosts = ExecuteHostType.ALL;

  /**
   * Similar to a command, but instead it is a call to invoke the script (using its relative path).
   * THe script and function elements are used together, and are invoked with additional environment variables.
   * If both a (script, function) and command are defined, only the (script, function) will be executed.
   * The service is already specified as part of the group.
   */
  @XmlElement(name="script")
  public String script;

  /**
   * Function name to call in the {@see script} element.
   */
  @XmlElement(name="function")
  public String function;

  public static final String actionVerb = "Executing";

  @Override
  public Task.Type getType() {
    return type;
  }

  @Override
  public StageWrapper.Type getStageWrapperType() {
    return StageWrapper.Type.UPGRADE_TASKS;
  }

  @Override
  public String getActionVerb() {
    return actionVerb;
  }
}


text:
//
// Copyright (c) 2014 Limit Point Systems, Inc.
//
// Licensed 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.
//

package tools.common.gui;

import tools.common.util.LPSDebug;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.URL;

/**
 * GuiUtilities provides static utility methods for
 * application gui support.
 * <p>
 */

public class GuiUtilities
{
  public static void setToExitOnClose(Frame frame)
  {
    frame.addWindowListener(new WindowAdapter()
                            {
                              public void windowClosing(WindowEvent e)
                              {
                                System.exit(0);
                              }
                            }
                           ); // Could be better!!!
  }

  public static Dimension getScreenSize()
  {
    return Toolkit.getDefaultToolkit().getScreenSize();
  }

  public static Dimension getScreenSize(Component c)
  {
    return c.getToolkit().getScreenSize();
  }

  public static void centerOnScreen(Component c)
  {
    Dimension screenSize = getScreenSize(c);
    Dimension size = c.getSize();
    int y = (screenSize.height - size.height) / 2;
    int x = (screenSize.width - size.width) / 2;
    c.setLocation(x, y);
  }

  public static void centerOnOwner(Dialog d)
  {
    Rectangle ownerBounds = d.getOwner().getBounds();
    Dimension size = d.getSize();
    int y = ownerBounds.y + ((ownerBounds.height - size.height) / 2);
    if(y < 0) y = 0;
    int x = ownerBounds.x + ((ownerBounds.width - size.width) / 2);
    if(x < 0) x = 0;
    d.setLocation(x, y);
  }

  public static ImageIcon getImageIcon(String fileName)
  {
    URL url = ClassLoader.getSystemResource(fileName);
    return getImageIcon(url);
  }

  public static ImageIcon getImageIcon(URL url)
  {
    ImageIcon icon = (url == null) ? null : (new ImageIcon(url));
    return icon;
  }

  public static ImageIcon getImageIcon(Object obj, String filePath)
  {
    URL url = obj.getClass().getResource(filePath);
    return getImageIcon(url);
  }

  public static Image getImage(String fileName)
  {
    ImageIcon icon = getImageIcon(fileName);
    return (icon != null) ? icon.getImage() : null;
  }

  public static Image getImage(URL url)
  {
    ImageIcon icon = getImageIcon(url);
    return (icon != null) ? icon.getImage() : null;
  }

  public static Image getImage(Object obj, String filePath)
  {
    URL url = obj.getClass().getResource(filePath);
    return getImage(url);
  }

  public static JLabel makeLabel(String text)
  {
    String labelText = " " + text + ": ";
    JLabel label = new JLabel(labelText, JLabel.RIGHT);
    return label;
  }

  public static JLabel makeLabel(String text, String toolTip)
  {
    JLabel label = makeLabel(text);
    label.setToolTipText(toolTip);
    return label;
  }
}


text:
Spree::Core::Engine.routes.draw do
  resources :orders do
    resource :checkout, :controller => 'checkout' do
      member do
        get  :europabank_confirm
        post :europabank_return
      end
    end
  end
end


text:
var ServiceArgument, ServiceDefinition;

ServiceArgument = use('@Konsserto/Component/DependencyInjection/ServiceArgument');

ServiceDefinition = (function() {
  function ServiceDefinition(registeredService, type) {
    var argument, _i, _len, _ref, _ref1;
    this.registeredService = registeredService;
    this.type = type != null ? type : 'bundle';
    this.name = this.registeredService.name.toLowerCase();
    this.className = this.registeredService._class;
    this.rawArguments = (_ref = this.registeredService.args) != null ? _ref : [];
    this["arguments"] = [];
    _ref1 = this.rawArguments;
    for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
      argument = _ref1[_i];
      this["arguments"].push(new ServiceArgument(argument));
    }
  }

  ServiceDefinition.prototype.setName = function(name) {
    this.name = name;
    return this;
  };

  ServiceDefinition.prototype.setClassName = function(className) {
    this.className = className;
    return this;
  };

  ServiceDefinition.prototype.setRawArguments = function(rawArguments) {
    this.rawArguments = rawArguments;
    return this;
  };

  ServiceDefinition.prototype.setArguments = function(_arguments) {
    this["arguments"] = _arguments;
    return this;
  };

  ServiceDefinition.prototype.getName = function() {
    return this.name.toLowerCase();
  };

  ServiceDefinition.prototype.getType = function() {
    return this.type;
  };

  ServiceDefinition.prototype.getClassName = function() {
    return this.className;
  };

  ServiceDefinition.prototype.getRawArguments = function() {
    return this.rawArguments;
  };

  ServiceDefinition.prototype.getArguments = function() {
    return this["arguments"];
  };

  ServiceDefinition.prototype.addArguments = function(serviceArgument) {
    return this["arguments"].push(serviceArgument);
  };

  ServiceDefinition.prototype.getCompilerArguments = function(parameterContainer) {
    var args, argument, _i, _len, _ref;
    args = [];
    _ref = this["arguments"];
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      argument = _ref[_i];
      args.push(argument.getCompilerArgument(parameterContainer));
    }
    return args;
  };

  ServiceDefinition.prototype.getServiceArgumentsOnly = function() {
    var args, argument, _i, _len, _ref;
    args = [];
    _ref = this["arguments"];
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      argument = _ref[_i];
      if (!argument.isConfiguration()) {
        args.push(argument);
      }
    }
    return args;
  };

  return ServiceDefinition;

})();

module.exports = ServiceDefinition;


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

Licensed 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.

=cut

package EnsEMBL::Web::Component::Location::SyntenyImage;

### Module to replace part of the former SyntenyView, in this case displaying
### an image of the syntenous chromosome regions

use strict;

use base qw(EnsEMBL::Web::Component::Location);

sub _init {
  my $self = shift;
  $self->cacheable(1);
  $self->ajaxable(1);
}

sub content {
  my $self    = shift;
  my $hub     = $self->hub;
  my $object  = $self->object || $self->hub->core_object('location');
  my $species = $hub->species;
  my %synteny = $hub->species_defs->multi('DATABASE_COMPARA', 'SYNTENY');
  my $other   = $self->hub->otherspecies;
  my $other_prodname = $hub->species_defs->get_config($other, 'SPECIES_PRODUCTION_NAME');
  my $chr     = $object->seq_region_name;
  my %chr_1   = map { $_, 1 } @{$hub->species_defs->ENSEMBL_CHROMOSOMES || []};
  my %chr_2   = map { $_, 1 } @{$hub->species_defs->get_config($other, 'ENSEMBL_CHROMOSOMES') || []};

  unless ($synteny{$other_prodname}) {
    $hub->problem('fatal', "Can't display synteny",  "There is no synteny data for these two species ($species and $other)");
    return undef;
  }

  my $ka         = $hub->get_adaptor('get_KaryotypeBandAdaptor', 'core', $species);
  my $ka2        = $hub->get_adaptor('get_KaryotypeBandAdaptor', 'core', $other);
  my $compara_db = $hub->database('compara');
  my $raw_data   = $object->chromosome->get_all_compara_Syntenies($other, undef, $compara_db);
  my $chr_length = $object->chromosome->length;
  my $other_chr;

  OUTER:
  foreach my $synteny_region (@$raw_data) {
    foreach my $dfr (@{$synteny_region->get_all_DnaFragRegions}) {
      # Check if any of the synteny regions map to a chromosome in the other species
      if ($dfr->dnafrag->genome_db->name eq $other_prodname && $chr_2{$dfr->dnafrag->name}) {
        $other_chr = 1;
        last OUTER;
      }
    }
  }

  my $image_html;
  if ($chr_1{$chr} && $other_chr) {

    my ($localgenes, $offset) = $object->get_synteny_local_genes;
    my $loc = (@$localgenes ? $localgenes->[0]->start + $object->seq_region_start : 1); # Jump loc to the location of the genes

    my $image_config = $hub->get_imageconfig('Vsynteny');

    $image_config->{'other_species_installed'} = $synteny{$other};
    $image_config->container_width($chr_length);

    my $image = $self->new_vimage({
      chr           => $chr,
      ka_main       => $ka,
      sa_main       => $hub->get_adaptor('get_SliceAdaptor'),
      ka_secondary  => $ka2,
      sa_secondary  => $hub->get_adaptor('get_SliceAdaptor', 'core', $other),
      synteny       => $raw_data,
      other_species => $other,
      line          => $loc,
      format        => $hub->param('export')
    }, $image_config);

    $image->centred    = 1;
    $image->imagemap   = 'yes';
    $image->image_type = 'syntenyview';
    $image->image_name = "$species-$chr-$other";
    $image->set_button('drag', 'title' => 'Click or drag to change region');

    $image->{'export_params'} = [['otherspecies', $other]];
    return if $self->_export_image($image,'no_text no_pdf');

    $image_html = $image->render;
  }
  else {
    $image_html = $self->info_panel("Unassembled chromosomes", "
No image can be drawn, because the syntenous species has no assembled chromosomes.
");
  }
  my $chr_form = $self->chromosome_form('Vsynteny');

  $chr_form->add_element(
      type  => 'Hidden',
      name  => 'otherspecies',
      value => $hub->param('otherspecies') || $hub->otherspecies,
  );

  my @coords = split(/[:-]/, $hub->param('r'));
  my $caption = sprintf('Synteny between %s chromosome %s and %s',
                    $hub->species_defs->SPECIES_DISPLAY_NAME,
                    $coords[0],
                    $hub->species_defs->get_config($hub->otherspecies, 'SPECIES_DISPLAY_NAME'),
                );

  my $html = sprintf('

%s

    %s

    %s
    %s

', $caption, $image_html, $self->species_form->render, $chr_form->render);

  return $html;
}

sub species_form {
  my $self              = shift;
  my $hub               = $self->hub;
  my $species_defs      = $hub->species_defs;
  my $url               = $hub->url({ otherspecies => undef }, 1);
  my $image_config      = $hub->get_imageconfig('Vsynteny');
  my $vwidth            = $image_config->image_height;
  my $form              = $self->new_form({ id => 'change_sp', action => $url->[0], method => 'get', class => 'autocenter', style => $vwidth ? "width:${vwidth}px" : undef });
  my %synteny_hash      = $species_defs->multi('DATABASE_COMPARA', 'SYNTENY');
  my $prod_name         = $species_defs->get_config($hub->species, 'SPECIES_PRODUCTION_NAME');
  my %synteny           = %{$synteny_hash{$prod_name} || {}};
  my $url_map           = $species_defs->multi_val('ENSEMBL_SPECIES_URL_MAP');
  my @sorted            = sort { $a->{'display'} cmp $b->{'display'} } map {{ name => $url_map->{$_}, display => $species_defs->get_config($url_map->{$_}, 'SPECIES_DISPLAY_NAME') }} keys %synteny;
  my @values;

  foreach my $next (@sorted) {
    next if $next->{'name'} eq $hub->species;
    push @values, { caption => $next->{'display'}, value => $next->{'name'} };
  }

  $form->add_hidden({ name => $_, value => $url->[1]->{$_} }) for keys %{$url->[1]};
  $form->add_field({
    'label'       => 'Change species',
    'inline'      => 1,
    'elements'    => [{
      'type'        => 'dropdown',
      'name'        => 'otherspecies',
      'values'      => \@values,
      'value'       => $hub->param('otherspecies') || $hub->param('species') || $hub->otherspecies,
    }, {
      'type'        => 'submit',
      'value'       => 'Go'
    }]
  });

  return $form;
}

1;


text:
namespace NArchive {
namespace N7z {

class CFolderInStream:
  public ISequentialInStream,
  public ICompressGetSubStreamSize,
  public CMyUnknownImp
{
public:

  MY_UNKNOWN_IMP1(ICompressGetSubStreamSize)

  CFolderInStream();

  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);

  STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
private:
  CSequentialInStreamWithCRC *_inStreamWithHashSpec;
  CMyComPtr<ISequentialInStream> _inStreamWithHash;
  CMyComPtr<IArchiveUpdateCallback> _updateCallback;

  bool _currentSizeIsDefined;
  UInt64 _currentSize;

  bool _fileIsOpen;
  UInt64 _filePos;

  const UInt32 *_fileIndices;
  UInt32 _numFiles;
  UInt32 _fileIndex;

  HRESULT OpenStream();
  HRESULT CloseStream();
  void AddDigest();
public:
  void Init(IArchiveUpdateCallback *updateCallback,
      const UInt32 *fileIndices, UInt32 numFiles);
  CRecordVector<bool> Processed;
  CRecordVector<UInt32> CRCs;
  CRecordVector<UInt64> Sizes;
  UInt64 GetFullSize() const
  {
    UInt64 size = 0;
    for (int i = 0; i < Sizes.Size(); i++)
      size += Sizes[i];
    return size;
  }
};

}}

#endif


text:
#include <numeric>
#include <iomanip>

#include "logging.hpp"
#include "spdlog/fmt/fmt.h"

#include "LIEF/MachO/hash.hpp"
#include "LIEF/MachO/Symbol.hpp"
#include "LIEF/MachO/RelocationFixup.hpp"
#include "LIEF/MachO/EnumToString.hpp"
#include "MachO/ChainedFixup.hpp"

namespace LIEF {
namespace MachO {

inline uint64_t unpack_target(const details::dyld_chained_ptr_64_rebase& rebase) {
  details::dyld_chained_ptr_generic64 value;
  value.rebase = rebase;
  return value.unpack_target();
}

inline uint64_t unpack_target(const details::dyld_chained_ptr_arm64e_rebase& rebase) {
  details::dyld_chained_ptr_arm64e value;
  value.rebase = rebase;
  return value.unpack_target();
}

RelocationFixup::~RelocationFixup() {
  switch (rtypes_) {
    case REBASE_TYPES::ARM64E_REBASE:      delete arm64_rebase_;      break;
    case REBASE_TYPES::ARM64E_AUTH_REBASE: delete arm64_auth_rebase_; break;
    case REBASE_TYPES::PTR64_REBASE:       delete p64_rebase_;        break;
    case REBASE_TYPES::PTR32_REBASE:       delete p32_rebase_;        break;
    case REBASE_TYPES::UNKNOWN: {}
  }
}

RelocationFixup::RelocationFixup(DYLD_CHAINED_PTR_FORMAT fmt, uint64_t imagebase) :
  ptr_fmt_{fmt},
  imagebase_{imagebase}
{}

RelocationFixup& RelocationFixup::operator=(const RelocationFixup& other) {
  if (this == &other) {
    return *this;
  }
  ptr_fmt_   = other.ptr_fmt_;
  imagebase_ = other.imagebase_;
  offset_    = other.offset_;
  rtypes_    = other.rtypes_;

  switch (rtypes_) {
    case REBASE_TYPES::ARM64E_REBASE:      arm64_rebase_      = new details::dyld_chained_ptr_arm64e_rebase{*other.arm64_rebase_}; break;
    case REBASE_TYPES::ARM64E_AUTH_REBASE: arm64_auth_rebase_ = new details::dyld_chained_ptr_arm64e_auth_rebase{*other.arm64_auth_rebase_}; break;
    case REBASE_TYPES::PTR64_REBASE:       p64_rebase_        = new details::dyld_chained_ptr_64_rebase{*other.p64_rebase_}; break;
    case REBASE_TYPES::PTR32_REBASE:       p32_rebase_        = new details::dyld_chained_ptr_32_rebase{*other.p32_rebase_}; break;
    case REBASE_TYPES::UNKNOWN: {}
  }
  return *this;
}

RelocationFixup::RelocationFixup(const RelocationFixup& other) :
  Relocation(other),
  ptr_fmt_{other.ptr_fmt_},
  imagebase_{other.imagebase_},
  offset_{other.offset_},
  rtypes_{other.rtypes_}
{
  switch (rtypes_) {
    case REBASE_TYPES::ARM64E_REBASE:      arm64_rebase_      = new details::dyld_chained_ptr_arm64e_rebase{*other.arm64_rebase_}; break;
    case REBASE_TYPES::ARM64E_AUTH_REBASE: arm64_auth_rebase_ = new details::dyld_chained_ptr_arm64e_auth_rebase{*other.arm64_auth_rebase_}; break;
    case REBASE_TYPES::PTR64_REBASE:       p64_rebase_        = new details::dyld_chained_ptr_64_rebase{*other.p64_rebase_}; break;
    case REBASE_TYPES::PTR32_REBASE:       p32_rebase_        = new details::dyld_chained_ptr_32_rebase{*other.p32_rebase_}; break;
    case REBASE_TYPES::UNKNOWN: {}
  }
}

RelocationFixup& RelocationFixup::operator=(RelocationFixup&&) = default;
RelocationFixup::RelocationFixup(RelocationFixup&&) = default;

bool RelocationFixup::is_pc_relative() const {
  return false;
}

Relocation* RelocationFixup::clone() const {
  return new RelocationFixup(*this);
}

RELOCATION_ORIGINS RelocationFixup::origin() const {
  return RELOCATION_ORIGINS::ORIGIN_CHAINED_FIXUPS;
}

void RelocationFixup::pc_relative(bool) {}

void RelocationFixup::accept(Visitor& visitor) const {
  visitor.visit(*this);
}

bool RelocationFixup::operator==(const RelocationFixup& rhs) const {
  if (this == &rhs) {
    return true;
  }
  size_t hash_lhs = Hash::hash(*this);
  size_t hash_rhs = Hash::hash(rhs);
  return hash_lhs == hash_rhs;
}

bool RelocationFixup::operator!=(const RelocationFixup& rhs) const {
  return !(*this == rhs);
}

bool RelocationFixup::classof(const Relocation& r) {
  return r.origin() == RELOCATION_ORIGINS::ORIGIN_CHAINED_FIXUPS;
}

std::ostream& RelocationFixup::print(std::ostream& os) const {
  os << fmt::format("0x{:08x}: 0x{:08x}", address(), target());
  if (const Symbol* sym = symbol()) {
    os << fmt::format("({})", sym->name());
  }
  os << "\n";
  return Relocation::print(os);
}

uint64_t RelocationFixup::target() const {
  switch (rtypes_) {
    case REBASE_TYPES::ARM64E_REBASE:
      {
        return imagebase_ + unpack_target(*arm64_rebase_);
      }

    case REBASE_TYPES::ARM64E_AUTH_REBASE:
      {
        return imagebase_ + arm64_auth_rebase_->target;
      }

    case REBASE_TYPES::PTR64_REBASE:
      {
        return imagebase_ + unpack_target(*p64_rebase_);
      }

    case REBASE_TYPES::PTR32_REBASE:
      {
        /* We tricked the parser to make sure it covers the case
         * where fixup.rebase.target > seg_info.max_valid_pointer
         */
        return imagebase_ + p32_rebase_->target;
      }

    case REBASE_TYPES::UNKNOWN:
      {
        LIEF_ERR("Can't get target: unknown rebase type");
        break;
      }
  }
  return 0;
}

void RelocationFixup::target(uint64_t target) {
  switch (rtypes_) {
    case REBASE_TYPES::ARM64E_REBASE:
      {
        uint64_t rel_target = target;
        if (rel_target >= imagebase_) {
          rel_target -= imagebase_;
        }
        pack_target(*arm64_rebase_, rel_target);
        break;
      }

    case REBASE_TYPES::ARM64E_AUTH_REBASE:
      {
        uint64_t rel_target = target;
        if (rel_target >= imagebase_) {
          rel_target -= imagebase_;
        }
        arm64_auth_rebase_->target = rel_target;
        break;
      }

    case REBASE_TYPES::PTR64_REBASE:
      {
        uint64_t rel_target = target;
        if (rel_target >= imagebase_) {
          rel_target -= imagebase_;
        }
        pack_target(*p64_rebase_, rel_target);
        break;
      }

    case REBASE_TYPES::PTR32_REBASE:
      {
        LIEF_WARN("Updating a dyld_chained_ptr_generic32 is not supported yet");
        return;
      }

    case REBASE_TYPES::UNKNOWN:
      {
        LIEF_ERR("Can't set target: unknown rebase type");
        break;
      }
  }
}

uint64_t RelocationFixup::address() const {
  return imagebase_ + offset_;
}

void RelocationFixup::address(uint64_t address)  {
  offset_ = address - imagebase_;
}

void RelocationFixup::set(const details::dyld_chained_ptr_arm64e_rebase& fixup) {
  rtypes_ = REBASE_TYPES::ARM64E_REBASE;
  arm64_rebase_ = new details::dyld_chained_ptr_arm64e_rebase(fixup);
}

void RelocationFixup::set(const details::dyld_chained_ptr_arm64e_auth_rebase& fixup) {
  rtypes_ = REBASE_TYPES::ARM64E_AUTH_REBASE;
  arm64_auth_rebase_ = new details::dyld_chained_ptr_arm64e_auth_rebase(fixup);
}

void RelocationFixup::set(const details::dyld_chained_ptr_64_rebase& fixup) {
  rtypes_ = REBASE_TYPES::PTR64_REBASE;
  p64_rebase_ = new details::dyld_chained_ptr_64_rebase(fixup);
}

void RelocationFixup::set(const details::dyld_chained_ptr_32_rebase& fixup) {
  rtypes_ = REBASE_TYPES::PTR32_REBASE;
  p32_rebase_ = new details::dyld_chained_ptr_32_rebase(fixup);
}

}
}


text:
title: TestDriven.NET 1.0
disqus_identifier: 2004-11-testdrivennet-10
comments: true
---

Looks like Jamie finally released [TestDriven.NET][1] version 1.0 today. This is the tool formerly known as NUnitAddin. Jamie has taken this thing *so* much further, now providing integrated support for all major unit testing frameworks, including the forthcoming Team System.

I was using the NUnitGUI until I came across this tool. No more. No more switching back and forth between NUnitGUI and VS.NET. TestDriven.NET runs all of your tests from a right click context menu in VS.NET. Test output goes directly to the output window.

What do you want to test? A single method? Right click on the method and click Run Test(s). An entire class? Right click on the class name and click Run Test(s). A namespace? Right click on the namespace and click Run Test(s). You get the idea.

Again, this is compatible with all major unit testing frameworks, so the Right click/Run Test(s) technique works whether your using mbUnit, nUnit or even Team System. How cool is that?

Ad-hoc tests are also supported. Ad-hoc tests offer a useful alternative to those throw-away console applications which we use to explore private methods or 3rd party code. Any method can be executed as an ad-hoc test by right clicking inside it and selecting Run Test(s). Are you starting to see a theme here? :=)

On a side note, I've been really exploring [mbUnit][2] lately. (It is distributed with TestDriven.NET). This tool is definately worth a look, as it provides a lot of stuff that requires you to jump through hoops to do with nUnit. For example:

* A Rollback attribute, which would come in handy for unit testing a data layer. This attribute uses EnterpriseServices to create a COM+ domain around the test. All tests are transacted and rolled back when completed.
* A Duration attribute. This verifies that the method call duration is below a given value.</li>

Earlier today I came across a very interesting feature of mbUnit. [TypeFixture][3] lets you write a fixture for a specific type and apply it to a number of instances of this type. For me, this came in really handy for writing a single fixture for an interface and applying the fixture to all the types that implement the interface.

Wow! This is what people had in mind by doing continuous integration and TDD...

[1]:http://www.testdriven.net
[2]:http://mbunit.tigris.org/
[3]:http://www.testdriven.net/wiki/default.aspx/MyWiki.TypeFixture


text:
% bei Standalone in documentclass noch:
% \RequirePackage{luatex85}

\documentclass[captions=tableheading, titlepage= firstiscover, parskip = half , bibliography=totoc]{scrartcl}
%paper = a5 für andere optinen
% titlepage= firstiscover
% bibliography=totoc für bibdateien
% parskip=half  Veränderung um Absätze zu verbessern

\usepackage{scrhack} % nach \documentclass
\usepackage[aux]{rerunfilecheck}
\usepackage{polyglossia}
\usepackage[style=numeric, backend=biber]{biblatex} % mit [style = alphabetic oder numeric] nach polyglossia
\addbibresource{lit.bib}
\setmainlanguage{english}

\usepackage[autostyle]{csquotes}
\usepackage{amsmath} % unverzichtbare Mathe-Befehle
\usepackage{amssymb} % viele Mathe-Symbole
\usepackage{mathtools} % Erweiterungen für amsmath
\usepackage{fontspec} % nach amssymb
% muss ins document: \usefonttheme{professionalfonts} % für Beamer Präsentationen
\usepackage{longtable}

\usepackage[
math-style=ISO,    % \
bold-style=ISO,    % |
sans-style=italic, % | ISO-Standard folgen
nabla=upright,     % |
partial=upright,   % /
]{unicode-math} % "Does exactly what it says on the tin."
\setmathfont{Latin Modern Math}
% \setmathfont{Tex Gyre Pagella Math} % alternativ

\usepackage[
% die folgenden 3 nur einschalten bei documenten
locale=DE,
separate-uncertainty=true, % Immer Fehler mit ±
per-mode=symbol-or-fraction, % m/s im Text, sonst \frac
]{siunitx}

% alternativ:
% per-mode=reciprocal, % m s^{-1}
% output-decimal-marker=., % . statt , für Dezimalzahlen

\usepackage[
version=4,
math-greek=default,
text-greek=default,
]{mhchem}

\usepackage[section, below]{placeins}
\usepackage{caption} % Captions schöner machen
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{subcaption}

% \usepackage{showframe} Wenn man die Ramen sehen will

\usepackage{float}
\floatplacement{figure}{htbp}
\floatplacement{table}{htbp}

%\usepackage[version=4]{mhchem} %chemische Symbole Beispiel: \ce{^{227}_{90}Th+}

\usepackage{booktabs}

 \usepackage{microtype}
 \usepackage{xfrac}

 \usepackage{expl3}
 \usepackage{xparse}

 % \ExplSyntaxOn
 % \NewDocumentComman \I {}  %Befehl\I definieren, keine Argumente
 % {
 %    \symup{i}              %Ergebnis von \I
 % }
 % \ExplSyntaxOff

 \usepackage{pdflscape}
 \usepackage{mleftright}

 % Mit dem mathtools-Befehl \DeclarePairedDelimiter können Befehle erzeugen werden,
 % die Symbole um Ausdrücke setzen.
 % \DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
 % \DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
 % in Mathe:
 %\abs{x} \abs*{\frac{1}{x}}
 %\norm{\symbf{y}}

 % Für Physik IV und Quantenmechanik
 \usepackage{braket}
 % \DeclarePairedDelimiter{\bra}{\langle}{\rvert}
 % \DeclarePairedDelimiter{\ket}{\lvert}{\rangle}
 % % <name> <#arguments> <left> <right> <body>
 % \DeclarePairedDelimiterX{\braket}[2]{\langle}{\rangle}{
 % #1 \delimsize| #2
 % }

\setlength{\delimitershortfall}{-1sp}

 \usepackage{tikz}
 \usepackage{tikz-feynman}

 \usepackage{csvsimple}
 % Tabellen mit \csvautobooktabular{"file"}
 % muss in table umgebung gesetzt werden

% \multicolumn{#Spalten}{Ausrichtung}{Inhalt}

\usepackage{hyperref}
\usepackage{bookmark}
\usepackage[shortcuts]{extdash} %nach hyperref, bookmark

\newcommand{\ua}[1]{_{\symup{#1}}}
\newcommand{\us}[1]{_{\symup{#1}}}
\newcommand{\ut}[1]{_{\text{#1}}}
\newcommand{\su}[1]{\symup{#1}}


text:
package org.jetbrains.plugins.scala.lang.parser

import com.intellij.psi.PsiErrorElement
import com.intellij.psi.impl.DebugUtil.psiToString
import org.jetbrains.plugins.scala.extensions.{IterableOnceExt, PsiElementExt, PsiNamedElementExt, StringExt}
import org.jetbrains.plugins.scala.lang.parser.ScalaParserTestOps.extractExpectedErrors
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.junit.Assert.assertEquals

trait ScalaParserTestOps {

  def parseText(text: String): ScalaFile

  def checkTree(text: String, expectedTree: String): Unit = {
    val file = parseText(text.withNormalizedSeparator)
    val resultTree = psiToString(file, true).replace(": " + file.name, "")
    assertEquals(expectedTree.trim.withNormalizedSeparator, resultTree.trim)
  }

  def err(err: String): String =
    s"[[Err($err)]]"

  def checkParseErrors(text: String): ScalaFile = {
    val (code, expectedErrors) = extractExpectedErrors(text.withNormalizedSeparator)

    val file = parseText(code)
    val errors = file.depthFirst().toSeq.filterByType[PsiErrorElement]
    val errorsWithPos = errors.map(psi => psi.getTextOffset -> psi.getErrorDescription).toSet
    assertEquals("parse errors do not match", expectedErrors.toSeq.sorted, errorsWithPos.toSeq.sorted)
    file
  }
}

object ScalaParserTestOps {

  private val errRegex = raw"\[\[Err\((.+)\)\]\]".r

  def extractExpectedErrors(text: String): (String, Set[(Int, String)]) = {
    var code = text
    val errorsBuilder = Set.newBuilder[(Int, String)]
    while (true) {
      errRegex.findFirstMatchIn(code) match {
        case Some(matc) =>
          code = code.substring(0, matc.start) + code.substring(matc.end)
          errorsBuilder += (matc.start -> matc.group(1))
        case None =>
          return code -> errorsBuilder.result()
      }
    }
    ???
  }
}


text:
package io.subutai.core.registration.impl.entity.entity;

import org.junit.Before;
import org.junit.Test;

import io.subutai.common.host.HostInterface;
import io.subutai.core.registration.impl.entity.HostInterfaceImpl;

import static org.junit.Assert.assertNotEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class HostInterfaceImplImplTest
{

    private HostInterfaceImpl hostInterface;

    String iname = "iname", ip = "ip", mac = "mac";

    @Before
    public void setUp() throws Exception
    {
        HostInterface iface = mock( HostInterface.class );
        when( iface.getName() ).thenReturn( iname );
        when( iface.getIp() ).thenReturn( ip );
        hostInterface = new HostInterfaceImpl( iface );
    }

    @Test
    public void testSetInterfaceName() throws Exception
    {
        String newName = "iname2";
        hostInterface.setInterfaceName( newName );
        assertNotEquals( iname, hostInterface.getInterfaceName() );
    }

    @Test
    public void testSetIp() throws Exception
    {
        String newIp = "ip2";
        hostInterface.setIp( newIp );
        assertNotEquals( ip, hostInterface.getIp() );
    }

    @Test
    public void testEquals() throws Exception
    {

    }

    @Test
    public void testHashCode() throws Exception
    {

    }

    @Test
    public void testToString() throws Exception
    {

    }
}