text:
describe('/login behaviour', () => {
  before(() => {
    cy.dbReset()
  })

  afterEach(() => {
    cy.visitPage('/logout')
  })

  beforeEach(() => {
    cy.visitPage('/login')
  })

  it('should have tutorial Guide link', () => {
    cy.get("a[href='/tutorial']")
      .should('have.attr', 'target', '_blank')
      .and('be.visible')
  })

  it('Should open the tutorial in another tab', () => {
    cy.get("a[href='/tutorial']").then(function ($a) {
      const href =
      $a.prop('href')
      cy.visit(href)
      cy.url().should('include', 'tutorial')
    })
  })

  it('should have admin user able to login', () => {
    cy.fixture('users/admin.json').as('admin')
    cy.get('@admin').then(admin => {
      cy.get('#userName').type(admin.user)
      cy.get('#password').type(admin.pass)
      cy.get('[type="submit"]').click()
      cy.url().should('include', 'benefits')
    })
  })

  it('should have non-admin user able to login', () => {
    cy.fixture('users/user.json').as('user')
    cy.get('@user').then(user => {
      cy.get('#userName').type(user.user)
      cy.get('#password').type(user.pass)
      cy.get('[type="submit"]').click()
      cy.url().should('include', 'dashboard')
    })
  })

  it('should reject wrong password', () => {
    cy.fixture('users/user.json').as('user')
    cy.get('@user').then(user => {
      cy.get('#userName').type(user.user)
      cy.get('#password').type('TO BE REJECTED')
      cy.get('[type="submit"]').click()

      cy.url().should('include', 'login')

      cy.get('.alert-danger')
        .contains('Invalid password')
        .and('be.visible')
    })
  })

  it('should reject wrong username', () => {
    cy.fixture('users/user.json').as('user')
    cy.get('@user').then(user => {
      cy.get('#userName').type('INVENTED')
      cy.get('#password').type(user.pass)
      cy.get('[type="submit"]').click()

      cy.url().should('include', 'login')

      cy.get('.alert-danger')
        .contains('Invalid username')
        .and('be.visible')
    })
  })

  it('should have new user/ sign up link', () => {
    cy.get("a[href='/signup']")
      .and('be.visible')
  })

  it('Should redirect to the signup', () => {
    cy.get("a[href='/signup']").click()
    cy.url().should('include', 'signup')
  })
})

redpajama_set_name: RedPajamaGithub


text:
package com.navercorp.pinpoint.common.util;

import org.junit.Assert;

import org.junit.Test;

import java.nio.charset.StandardCharsets;

public class HttpUtilsTest {
    @Test
    public void contentTypeCharset1() {
        String test = "text/plain; charset=UTF-8";

        String charset = HttpUtils.parseContentTypeCharset(test);
        Assert.assertEquals(StandardCharsets.UTF_8.name(), charset);
    }

    @Test
    public void contentTypeCharset2() {
        String test = "text/plain; charset=UTF-8;";

        String charset = HttpUtils.parseContentTypeCharset(test);
        Assert.assertEquals(StandardCharsets.UTF_8.name(), charset);
    }

    @Test
    public void contentTypeCharset3() {
        String test = "text/plain; charset=UTF-8; test=a";

        String charset = HttpUtils.parseContentTypeCharset(test);
        Assert.assertEquals(StandardCharsets.UTF_8.name(), charset);
    }

    @Test
    public void contentTypeCharset4() {
        String test = "text/plain; charset= UTF-8 ; test=a";

        String charset = HttpUtils.parseContentTypeCharset(test);
        Assert.assertEquals(StandardCharsets.UTF_8.name(), charset);
    }

}


text:
import sys
pathList = ['lib',
           'lib/thirdparty',
           'lib/tumblr-python',
           'lib/DBWrapper/',
           'lib/facebook-sdk/',
           'lib/python-flickr',
           'lib/thirdparty/httplib2/python2',
           'lib/python-oauth2/',
           'lib/python-twitter/',
           'lib/webpy/',
           'lib/wordspew/']

for path in pathList:
  if path not in sys.path:
    sys.path.insert(0,path)


text:
package io.mifos.reporting;

import io.mifos.reporting.api.v1.domain.ReportDefinition;
import org.junit.Assert;
import org.junit.Test;

import java.util.List;

public class TestDepositListReportSpecification extends AbstractReportingSpecificationTest {
    public TestDepositListReportSpecification() {
        super();
    }

    @Test
    public void shouldReturnReportDefinition() {
        final List<ReportDefinition> reportDefinitions = super.testSubject.fetchReportDefinitions("Deposit");
        Assert.assertTrue(
                reportDefinitions.stream().anyMatch(reportDefinition -> reportDefinition.getIdentifier().equals("Listing"))
        );
    }
}


text:
#pragma once

#include <QtCore/QObject>

#include <trikControl/vectorSensorInterface.h>
#include <trikControl/motorInterface.h>
#include <trikControl/displayInterface.h>

class AccelerometerListener : public QObject
{
	Q_OBJECT

public:
	explicit AccelerometerListener(
			trikControl::VectorSensorInterface &accelerometer
			, trikControl::MotorInterface &motor1
			, trikControl::MotorInterface &motor2
			, trikControl::DisplayInterface &display);

public slots:
	void onTimeout();

private:
	trikControl::VectorSensorInterface &mAccelerometer;
	trikControl::MotorInterface &mMotor1;
	trikControl::MotorInterface &mMotor2;
	trikControl::DisplayInterface &mDisplay;
};


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.orange.web.annotation;

/**
 *
 * @author lining
 */
public enum SingletonMode {
    SINGLETON,MULTITON
}


text:
namespace Tempest{

class WidgetBase;

class LinearLayout;

//! The Layout class is the base class of ui-geometry managers
class Layout {
  public:
    Layout();
    virtual ~Layout();

    Widget * owner();
    const Widget * owner() const;

    void add( Widget* w, size_t pos);
    void add( Widget* widget );
    void del( Widget* widget );
    void removeAll();

    Widget* take( Widget* widget );

    const std::vector<Widget*>& widgets();

    virtual void applyLayout(){}

    void setSpacing( int s );
    int  spacing() const;

    void setMargin( const Margin & m );
    void setMargin( int l, int r, int t, int b );
    const Margin& margin() const;

    static void placeIn( Widget *wx, int x, int y, int w, int h );
    static void placeIn( Widget *wx, const Rect & r );

  protected:
    static Size sizeHint(const Widget *wx );
    int         summarySpacings();
    int         visibleCount() const;

  private:
    std::vector<Widget*> w;
    Widget* ow;
    int mspacing;
    Margin mmargin;

    void rebind( Widget* w);
    void swap( Layout* other );

  friend class Widget;
  };

class LinearLayout : public Layout {
  public:
    LinearLayout( Orientation ori = Vertical ):orient(ori){
      this->setSpacing(2);
      }

    virtual void applyLayout(){
      if( orient==Vertical ){
        applyLayoutPrivate( &h, &w, &typeV, &typeH, false, &setGeometryR );
        } else {
        applyLayoutPrivate( &w, &h, &typeH, &typeV,  true, &setGeometryD );
        }
      }

    Orientation orientation() const {
      return orient;
      }

    void setOrientation( Orientation ori ){
      if( orient!=ori ){
        orient = ori;
        applyLayout();
        }
      }

  private:
    Orientation orient;

    static void setGeometryD( Widget* wd, int x, int y, int w, int h){
      //wd->setGeometry(x,y,w,h);
      placeIn(wd, x, y, w, h );
      }
    static void setGeometryR( Widget* wd, int x, int y, int w, int h ){
      //wd->setGeometry(y,x,h,w);
      placeIn(wd, y, x, h, w );
      }

    static int w( const Size& wd ){
      return wd.w;
      }

    static int h( const Size& wd ){
      return wd.h;
      }

    static SizePolicyType typeH( const Widget* wd ){
      return wd->sizePolicy().typeH;
      }

    static SizePolicyType typeV( const Widget* wd ){
      return wd->sizePolicy().typeV;
      }

    int marg(bool h){
      if( h )
        return this->margin().left + this->margin().right; else
        return this->margin().top + this->margin().bottom;
      }

    void applyLayoutPrivate( int (*w)( const Size& wd ),
                             int (*h)( const Size& wd ),
                             SizePolicyType (*typeH)( const Widget*  ),
                             SizePolicyType (*typeV)( const Widget*  ),
                             bool hor,
                             void (*setGeometry)( Widget* wd,
                                                  int x, int y,
                                                  int w, int h ) );
  };

}

#endif // LAYOUT_H


text:
============================
Logging In to a Master Node
============================

This section describes how to log in to the Master nodes of a cluster using the GUI and SSH.

Logging In to an ECS Using VNC
===============================

This section describes how to log in to an ECS using VNC on the ECS management console. This login method is mainly used for emergent O&M. In other scenarios, it is recommended that you log in to the ECS using SSH.

.. toctree::
   :maxdepth: 1

   logging-in-to-an-ecs-using-vnc.md

Logging In to a Linux ECS Using a Key Pair (SSH)
=================================================

This section describes how to log in to a Linux ECS using a key pair.

.. toctree::
   :maxdepth: 1

   logging-in-to-a-linux-ecs-using-a-key-pair-(ssh).md

Logging In to a Linux ECS Using a Password (SSH)
=================================================

Logging in to a Linux ECS in SSH password authentication mode is disabled by default. If you require the password authentication mode, configure it after logging in to the ECS. To ensure system security, you must reset the common user password for logging in to the Linux ECS after configuring the SSH password authentication mode.

.. toctree::
   :maxdepth: 1

   logging-in-to-a-linux-ecs-using-a-password-(ssh).md


text:
'use strict';

module.exports = function(grunt) {
  var util    = grunt.util,
      // Alias for Lo-Dash
      _       = util._,
      path = require("path"),
      exists = grunt.file.exists;

  grunt.registerMultiTask('mocha_phantomjs', 'Run client-side mocha test with phantomjs.', function() {
    // Merge options
    var options        = this.options({
          reporter: 'spec',
          // Non file urls to test
          urls: []
        }),
        files          = this.filesSrc,
        args           = [],
        binPath        = '.bin/mocha-phantomjs' + (process.platform === 'win32' ? '.cmd' : ''),
        phantomjs_path = path.join(__dirname, '..', '/node_modules/', binPath),
        urls           = options.urls.concat(this.filesSrc),
        done           = this.async(),
        errors         = 0,
        results        = '',
        output         = options.output || false;

    // Check for a local install of mocha-phantomjs to use
    if (!exists(phantomjs_path)) {
      var i = module.paths.length,
          bin;
      while(i--) {
        bin = path.join(module.paths[i], binPath);
        if (exists(bin)) {
          phantomjs_path = bin;
          break;
        }
      }
    }

    if(!exists(phantomjs_path)) {
      grunt.fail.warn('Unable to find mocha-phantomjs.');
    }

    // Loop through the options and add them to args
    // Omit urls from the options to be passed through
    _.each(_.omit(options, 'urls', 'output'), function(value, key) {
      // Convert to the key to a switch
      var sw = (key.length > 1 ? '--' : '-') + key;
      // Add the switch and its value
      // If the value is an array, add all array elements to the array.
      if(!_.isArray(value)) {
        value = [value];
      }

      _.each(value, function(value) {
        args.push([sw, value.toString()]);
      });
    });

    util.async.forEachSeries(urls, function(f, next) {
      var phantomjs = grunt.util.spawn({
        cmd: phantomjs_path,
        args: _.flatten([f].concat(args))
      }, function(error, result, code) {
        next();
      });

      phantomjs.stdout.pipe(process.stdout);
      phantomjs.stderr.pipe(process.stderr);

      // Append output to be written to a file
      if(output) {
        phantomjs.stdout.on('data', function(data){
          results += String(data.toString());
        });
      }

      phantomjs.on('exit', function(code){
        if (code === 127) {
          grunt.fail.warn("Phantomjs isn't installed");
        }
        errors += code;
      });

    }, function(){
      // Fail if errors are reported and we aren't outputing to a file
      if(!output && errors > 0) {
        grunt.fail.warn(errors + " tests failed");
      } else if(output) {
        grunt.file.write(output, results);
      }
      done();
    });
  });

};


text:
package org.apache.commons.beanutils.converters;

import junit.framework.TestSuite;

import org.apache.commons.beanutils.Converter;

/**
 * Test Case for the ShortConverter class.
 *
 * @version $Id: ShortConverterTestCase.java 1540186 2013-11-08 21:08:30Z oheger $
 */

public class ShortConverterTestCase extends NumberConverterTestBase {

    private Converter converter = null;

    // ------------------------------------------------------------------------

    public ShortConverterTestCase(String name) {
        super(name);
    }

    // ------------------------------------------------------------------------

    @Override
    public void setUp() throws Exception {
        converter = makeConverter();
        numbers[0] = new Short("-12");
        numbers[1] = new Short("13");
        numbers[2] = new Short("-22");
        numbers[3] = new Short("23");
    }

    public static TestSuite suite() {
        return new TestSuite(ShortConverterTestCase.class);
    }

    @Override
    public void tearDown() throws Exception {
        converter = null;
    }

    // ------------------------------------------------------------------------

    @Override
    protected NumberConverter makeConverter() {
        return new ShortConverter();
    }

    @Override
    protected NumberConverter makeConverter(Object defaultValue) {
        return new ShortConverter(defaultValue);
    }

    @Override
    protected Class<?> getExpectedType() {
        return Short.class;
    }

    // ------------------------------------------------------------------------

    public void testSimpleConversion() throws Exception {
        String[] message= {
            "from String",
            "from String",
            "from String",
            "from String",
            "from String",
            "from String",
            "from String",
            "from Byte",
            "from Short",
            "from Integer",
            "from Long",
            "from Float",
            "from Double"
        };

        Object[] input = {
            String.valueOf(Short.MIN_VALUE),
            "-17",
            "-1",
            "0",
            "1",
            "17",
            String.valueOf(Short.MAX_VALUE),
            new Byte((byte)7),
            new Short((short)8),
            new Integer(9),
            new Long(10),
            new Float(11.1),
            new Double(12.2)
        };

        Short[] expected = {
            new Short(Short.MIN_VALUE),
            new Short((short)-17),
            new Short((short)-1),
            new Short((short)0),
            new Short((short)1),
            new Short((short)17),
            new Short(Short.MAX_VALUE),
            new Short((short)7),
            new Short((short)8),
            new Short((short)9),
            new Short((short)10),
            new Short((short)11),
            new Short((short)12)
        };

        for(int i=0;i<expected.length;i++) {
            assertEquals(message[i] + " to Short",expected[i],converter.convert(Short.class,input[i]));
            assertEquals(message[i] + " to short",expected[i],converter.convert(Short.TYPE,input[i]));
            assertEquals(message[i] + " to null type",expected[i],converter.convert(null,input[i]));
        }
    }

    /**
     * Test Invalid Amounts (too big/small)
     */
    public void testInvalidAmount() {
        Converter converter = makeConverter();
        Class<?> clazz = Short.class;

        Long min         = new Long(Short.MIN_VALUE);
        Long max         = new Long(Short.MAX_VALUE);
        Long minMinusOne = new Long(min.longValue() - 1);
        Long maxPlusOne  = new Long(max.longValue() + 1);

        // Minimum
        assertEquals("Minimum", new Short(Short.MIN_VALUE), converter.convert(clazz, min));

        // Maximum
        assertEquals("Maximum", new Short(Short.MAX_VALUE), converter.convert(clazz, max));

        // Too Small
        try {
            assertEquals("Minimum - 1", null, converter.convert(clazz, minMinusOne));
            fail("Less than minimum, expected ConversionException");
        } catch (Exception e) {
            // expected result
        }

        // Too Large
        try {
            assertEquals("Maximum + 1", null, converter.convert(clazz, maxPlusOne));
            fail("More than maximum, expected ConversionException");
        } catch (Exception e) {
            // expected result
        }
    }
}


text:
BEGIN {
	base = File::dirname( File::dirname(File::expand_path(__FILE__)) )
	$LOAD_PATH.unshift "#{base}/lib"

	require "#{base}/utils.rb"
	include UtilityFunctions

	require 'linguistics'
}

$yaml = false
Linguistics::use( :en )

def plural(singular)
	consonantYPattern = Regexp.new("([^aeiou])y$", Regexp::IGNORECASE)
	if singular =~ consonantYPattern
		singular.gsub consonantYPattern, '\1ies'
	elsif singular =~ /[xs]$/
		singular + "es"
	else
		singular + "s"
	end
end

Words = %w[tree fairy address opus mythos child persona datum nucleus
           phenomenon commando radix seraph nexus series dais trellis ]

Words.each do |word|
	puts "%s vs. %s" % [plural(word), word.en.plural]
end


text:
'use strict';

module.exports = function(app) {
	var users = require('../../app/controllers/users');
	var searchusers = require('../../app/controllers/searchusers');

	// Searchusers Routes
	app.route('/searchusers')
		.get(searchusers.list)
		.post(users.requiresLogin, searchusers.create);

	app.route('/searchusers/:searchuserId')
		.get(searchusers.read)
		.put(users.requiresLogin, searchusers.hasAuthorization, searchusers.update)
		.delete(users.requiresLogin, searchusers.hasAuthorization, searchusers.delete);

	// Finish by binding the Searchuser middleware
	app.param('searchuserId', searchusers.searchuserByID);
};


text:
package com.amazonaws.services.kinesisfirehose.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.kinesisfirehose.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * CloudWatchLoggingOptions JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CloudWatchLoggingOptionsJsonUnmarshaller implements Unmarshaller<CloudWatchLoggingOptions, JsonUnmarshallerContext> {

    public CloudWatchLoggingOptions unmarshall(JsonUnmarshallerContext context) throws Exception {
        CloudWatchLoggingOptions cloudWatchLoggingOptions = new CloudWatchLoggingOptions();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("Enabled", targetDepth)) {
                    context.nextToken();
                    cloudWatchLoggingOptions.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));
                }
                if (context.testExpression("LogGroupName", targetDepth)) {
                    context.nextToken();
                    cloudWatchLoggingOptions.setLogGroupName(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("LogStreamName", targetDepth)) {
                    context.nextToken();
                    cloudWatchLoggingOptions.setLogStreamName(context.getUnmarshaller(String.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return cloudWatchLoggingOptions;
    }

    private static CloudWatchLoggingOptionsJsonUnmarshaller instance;

    public static CloudWatchLoggingOptionsJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new CloudWatchLoggingOptionsJsonUnmarshaller();
        return instance;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Data;
using Orchard.Environment.Extensions;
using Orchard.Localization;
using Quicklogons.Models;

namespace Quicklogons.Handlers
{
    [OrchardFeature("Quicklogons")]
    public class UserProfilePartHandler : ContentHandler
    {
        public UserProfilePartHandler(IRepository<UserProfilePartRecord> repository)
        {
            Filters.Add(StorageFilter.For(repository));
        }
    }
}


text:
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

}

- (IBAction)takePhoto:(id)sender {

    [self tt_showAlbumWithPhoto:^(UIImage *photo) {
        self.imageView.image = photo;
    } canclePick:^{

        NSLog(@"取消");
    }];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
<?php
namespace Aspose\Cells\Models;
/**
 * $model.description$
 *
 * NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
 *
 */
class PatternFill {
	static $swaggerTypes = array(
		'Pattern' => 'string',
		'BackgroundCellsColor' => 'CellsColor',
		'ForegroundCellsColor' => 'CellsColor',
		'ForegroundColor' => 'Color',
		'BackgroundColor' => 'Color',
		'BackTransparency' => 'float',
		'ForeTransparency' => 'float'

	);

	public $Pattern; // string
	public $BackgroundCellsColor; // CellsColor
	public $ForegroundCellsColor; // CellsColor
	public $ForegroundColor; // Color
	public $BackgroundColor; // Color
	public $BackTransparency; // float
	public $ForeTransparency; // float
	}


text:
package es.usc.citius.hipster.graph;

public class UnorderedPair<E> {
    private E e1, e2;

    public UnorderedPair(E e1, E e2) {
        if (e1 == null) throw new IllegalArgumentException("First element cannot be null");
        this.e1 = e1;
        if (e2 == null) throw new IllegalArgumentException("Second element cannot be null");
        this.e2 = e2;
    }

    public boolean contains(Object vertex){
        return e1.equals(vertex) || e2.equals(vertex);
    }

    public E getE1() {
        return e1;
    }

    public void setE1(E e1) {
        this.e1 = e1;
    }

    public E getE2() {
        return e2;
    }

    public void setE2(E e2) {
        this.e2 = e2;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UnorderedPair<?> that = (UnorderedPair<?>) o;
        return that.contains(e1) && that.contains(e2);
    }

    @Override
    public int hashCode() {
        return e1.hashCode() + e2.hashCode();
    }

    @Override
    public String toString() {
        return "(" + e1 + ", " + e2 + ")";
    }
}


text:
import sys

import pytest

from .db_helpers import mark_exists, mark_database, drop_database, db_exists, skip_if_sqlite

skip_on_python32 = pytest.mark.skipif(sys.version_info[:2] == (3, 2),
                                      reason='xdist is flaky with Python 3.2')

def test_db_reuse(django_testdir):
    """
    Test the re-use db functionality. This test requires a PostgreSQL server
    to be available and the environment variables PG_HOST, PG_DB, PG_USER to
    be defined.
    """
    skip_if_sqlite()

    django_testdir.create_test_module('''
        import pytest

        from .app.models import Item

        @pytest.mark.django_db
        def test_db_can_be_accessed():
            assert Item.objects.count() == 0
    ''')

    # Use --create-db on the first run to make sure we are not just re-using a
    # database from another test run
    drop_database()
    assert not db_exists()

    # Do not pass in --create-db to make sure it is created when it
    # does not exist
    result_first = django_testdir.runpytest('-v', '--reuse-db')

    result_first.stdout.fnmatch_lines([
        "*test_db_can_be_accessed PASSED*",
    ])

    assert not mark_exists()
    mark_database()
    assert mark_exists()

    result_second = django_testdir.runpytest('-v', '--reuse-db')
    result_second.stdout.fnmatch_lines([
        "*test_db_can_be_accessed PASSED*",
    ])

    # Make sure the database has not been re-created
    assert mark_exists()

    result_third = django_testdir.runpytest('-v', '--reuse-db', '--create-db')
    result_third.stdout.fnmatch_lines([
        "*test_db_can_be_accessed PASSED*",
    ])

    # Make sure the database has been re-created and the mark is gone
    assert not mark_exists()

@skip_on_python32
def test_xdist_with_reuse(django_testdir):
    skip_if_sqlite()

    drop_database('gw0')
    drop_database('gw1')

    django_testdir.create_test_module('''
        import pytest

        from .app.models import Item

        def _check(settings):
            # Make sure that the database name looks correct
            db_name = settings.DATABASES['default']['NAME']
            assert db_name.endswith('_gw0') or db_name.endswith('_gw1')

            assert Item.objects.count() == 0
            Item.objects.create(name='foo')
            assert Item.objects.count() == 1

        @pytest.mark.django_db
        def test_a(settings):
            _check(settings)

        @pytest.mark.django_db
        def test_b(settings):
            _check(settings)
    ''')

    result = django_testdir.runpytest('-vv', '-n2', '-s', '--reuse-db')
    result.stdout.fnmatch_lines(['*PASSED*test_a*'])
    result.stdout.fnmatch_lines(['*PASSED*test_b*'])

    assert db_exists('gw0')
    assert db_exists('gw1')

    result = django_testdir.runpytest('-vv', '-n2', '-s', '--reuse-db')
    result.stdout.fnmatch_lines(['*PASSED*test_a*'])
    result.stdout.fnmatch_lines(['*PASSED*test_b*'])

    result = django_testdir.runpytest('-vv', '-n2', '-s', '--reuse-db', '--create-db')
    result.stdout.fnmatch_lines(['*PASSED*test_a*'])
    result.stdout.fnmatch_lines(['*PASSED*test_b*'])

class TestSqliteWithXdist:

    pytestmark = skip_on_python32

    db_settings = {'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/tmp/should-not-be-used',
    }}

    def test_sqlite_in_memory_used(self, django_testdir):

        django_testdir.create_test_module('''
            import pytest
            from django.db import connections

            @pytest.mark.django_db
            def test_a():
                (conn, ) = connections.all()

                assert conn.vendor == 'sqlite'
                assert conn.settings_dict['NAME'] == ':memory:'
        ''')

        result = django_testdir.runpytest('--tb=short', '-vv', '-n1')
        result.stdout.fnmatch_lines(['*PASSED*test_a*'])


text:
import type { Compilation } from 'webpack';

export function addWarning(compilation: Compilation, message: string): void {
  compilation.warnings.push(new compilation.compiler.webpack.WebpackError(message));
}

export function addError(compilation: Compilation, message: string): void {
  compilation.errors.push(new compilation.compiler.webpack.WebpackError(message));
}


text:
from . import packets as channelpackets
from .map import models as mapmodels

def load_player(packet, client):
    char_id = packet.read_int()
    character = client.factory.world_factory.get_character(char_id)

    character.channel = client.factory.key
    client.character = character

    # TODO BUFFS
    # TODO DUEY
    client.send(channelpackets.char_info(character, client.factory.key))
    client.send(channelpackets.keymap(character))
    # client.send(channelpackets.skillmacros(character)) NOT IMPLEMENTED
    # client.send(channelpackets.buddy_list(character)) NOT IMPLEMENTED
    # client.send(channelpackets.load_family(character)) NOT IMPLEMENTED
    # TODO NOTES
    # TODO PARTY
    mapmodels.Map.get(character.map, client.factory.key).add_client(client)


text:
/*
 * Xilinx TFT frame buffer driver
 *
 * Author: MontaVista Software, Inc.
 *         source@mvista.com
 *
 * 2002-2007 (c) MontaVista Software, Inc.
 * 2007 (c) Secret Lab Technologies, Ltd.
 * 2009 (c) Xilinx Inc.
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2.  This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 */

/*
 * This driver was based on au1100fb.c by MontaVista rewritten for 2.6
 * by Embedded Alley Solutions <source@embeddedalley.com>, which in turn
 * was based on skeletonfb.c, Skeleton for a frame buffer device by
 * Geert Uytterhoeven.
 */

#include <linux/device.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/io.h>
#include <linux/xilinxfb.h>
#include <linux/slab.h>

#ifdef CONFIG_PPC_DCR
#include <asm/dcr.h>
#endif

#define DRIVER_NAME		"xilinxfb"

/*
 * Xilinx calls it "PLB TFT LCD Controller" though it can also be used for
 * the VGA port on the Xilinx ML40x board. This is a hardware display
 * controller for a 640x480 resolution TFT or VGA screen.
 *
 * The interface to the framebuffer is nice and simple.  There are two
 * control registers.  The first tells the LCD interface where in memory
 * the frame buffer is (only the 11 most significant bits are used, so
 * don't start thinking about scrolling).  The second allows the LCD to
 * be turned on or off as well as rotated 180 degrees.
 *
 * In case of direct PLB access the second control register will be at
 * an offset of 4 as compared to the DCR access where the offset is 1
 * i.e. REG_CTRL. So this is taken care in the function
 * xilinx_fb_out_be32 where it left shifts the offset 2 times in case of
 * direct PLB access.
 */
#define NUM_REGS	2
#define REG_FB_ADDR	0
#define REG_CTRL	1
#define REG_CTRL_ENABLE	 0x0001
#define REG_CTRL_ROTATE	 0x0002

/*
 * The hardware only handles a single mode: 640x480 24 bit true
 * color. Each pixel gets a word (32 bits) of memory.  Within each word,
 * the 8 most significant bits are ignored, the next 8 bits are the red
 * level, the next 8 bits are the green level and the 8 least
 * significant bits are the blue level.  Each row of the LCD uses 1024
 * words, but only the first 640 pixels are displayed with the other 384
 * words being ignored.  There are 480 rows.
 */
#define BYTES_PER_PIXEL	4
#define BITS_PER_PIXEL	(BYTES_PER_PIXEL * 8)

#define RED_SHIFT	16
#define GREEN_SHIFT	8
#define BLUE_SHIFT	0

#define PALETTE_ENTRIES_NO	16	/* passed to fb_alloc_cmap() */

/*
 * Default xilinxfb configuration
 */
static struct xilinxfb_platform_data xilinx_fb_default_pdata = {
	.xres = 640,
	.yres = 480,
	.xvirt = 1024,
	.yvirt = 480,
};

/*
 * Here are the default fb_fix_screeninfo and fb_var_screeninfo structures
 */
static struct fb_fix_screeninfo xilinx_fb_fix = {
	.id =		"Xilinx",
	.type =		FB_TYPE_PACKED_PIXELS,
	.visual =	FB_VISUAL_TRUECOLOR,
	.accel =	FB_ACCEL_NONE
};

static struct fb_var_screeninfo xilinx_fb_var = {
	.bits_per_pixel =	BITS_PER_PIXEL,

	.red =		{ RED_SHIFT, 8, 0 },
	.green =	{ GREEN_SHIFT, 8, 0 },
	.blue =		{ BLUE_SHIFT, 8, 0 },
	.transp =	{ 0, 0, 0 },

	.activate =	FB_ACTIVATE_NOW
};

#define PLB_ACCESS_FLAG	0x1		/* 1 = PLB, 0 = DCR */

struct xilinxfb_drvdata {

	struct fb_info	info;		/* FB driver info record */

	phys_addr_t	regs_phys;	/* phys. address of the control
						registers */
	void __iomem	*regs;		/* virt. address of the control
						registers */
#ifdef CONFIG_PPC_DCR
	dcr_host_t      dcr_host;
	unsigned int    dcr_len;
#endif
	void		*fb_virt;	/* virt. address of the frame buffer */
	dma_addr_t	fb_phys;	/* phys. address of the frame buffer */
	int		fb_alloced;	/* Flag, was the fb memory alloced? */

	u8 		flags;		/* features of the driver */

	u32		reg_ctrl_default;

	u32		pseudo_palette[PALETTE_ENTRIES_NO];
					/* Fake palette of 16 colors */
};

#define to_xilinxfb_drvdata(_info) \
	container_of(_info, struct xilinxfb_drvdata, info)

/*
 * The XPS TFT Controller can be accessed through PLB or DCR interface.
 * To perform the read/write on the registers we need to check on
 * which bus its connected and call the appropriate write API.
 */
static void xilinx_fb_out_be32(struct xilinxfb_drvdata *drvdata, u32 offset,
				u32 val)
{
	if (drvdata->flags & PLB_ACCESS_FLAG)
		out_be32(drvdata->regs + (offset << 2), val);
#ifdef CONFIG_PPC_DCR
	else
		dcr_write(drvdata->dcr_host, offset, val);
#endif
}

static int
xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
	unsigned transp, struct fb_info *fbi)
{
	u32 *palette = fbi->pseudo_palette;

	if (regno >= PALETTE_ENTRIES_NO)
		return -EINVAL;

	if (fbi->var.grayscale) {
		/* Convert color to grayscale.
		 * grayscale = 0.30*R + 0.59*G + 0.11*B */
		red = green = blue =
			(red * 77 + green * 151 + blue * 28 + 127) >> 8;
	}

	/* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */

	/* We only handle 8 bits of each color. */
	red >>= 8;
	green >>= 8;
	blue >>= 8;
	palette[regno] = (red << RED_SHIFT) | (green << GREEN_SHIFT) |
			 (blue << BLUE_SHIFT);

	return 0;
}

static int
xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
{
	struct xilinxfb_drvdata *drvdata = to_xilinxfb_drvdata(fbi);

	switch (blank_mode) {
	case FB_BLANK_UNBLANK:
		/* turn on panel */
		xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
		break;

	case FB_BLANK_NORMAL:
	case FB_BLANK_VSYNC_SUSPEND:
	case FB_BLANK_HSYNC_SUSPEND:
	case FB_BLANK_POWERDOWN:
		/* turn off panel */
		xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
	default:
		break;

	}
	return 0; /* success */
}

static struct fb_ops xilinxfb_ops =
{
	.owner			= THIS_MODULE,
	.fb_setcolreg		= xilinx_fb_setcolreg,
	.fb_blank		= xilinx_fb_blank,
	.fb_fillrect		= cfb_fillrect,
	.fb_copyarea		= cfb_copyarea,
	.fb_imageblit		= cfb_imageblit,
};

/* ---------------------------------------------------------------------
 * Bus independent setup/teardown
 */

static int xilinxfb_assign(struct device *dev,
			   struct xilinxfb_drvdata *drvdata,
			   unsigned long physaddr,
			   struct xilinxfb_platform_data *pdata)
{
	int rc;
	int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL;

	if (drvdata->flags & PLB_ACCESS_FLAG) {
		/*
		 * Map the control registers in if the controller
		 * is on direct PLB interface.
		 */
		if (!request_mem_region(physaddr, 8, DRIVER_NAME)) {
			dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
				physaddr);
			rc = -ENODEV;
			goto err_region;
		}

		drvdata->regs_phys = physaddr;
		drvdata->regs = ioremap(physaddr, 8);
		if (!drvdata->regs) {
			dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
				physaddr);
			rc = -ENODEV;
			goto err_map;
		}
	}

	/* Allocate the framebuffer memory */
	if (pdata->fb_phys) {
		drvdata->fb_phys = pdata->fb_phys;
		drvdata->fb_virt = ioremap(pdata->fb_phys, fbsize);
	} else {
		drvdata->fb_alloced = 1;
		drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
					&drvdata->fb_phys, GFP_KERNEL);
	}

	if (!drvdata->fb_virt) {
		dev_err(dev, "Could not allocate frame buffer memory\n");
		rc = -ENOMEM;
		if (drvdata->flags & PLB_ACCESS_FLAG)
			goto err_fbmem;
		else
			goto err_region;
	}

	/* Clear (turn to black) the framebuffer */
	memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize);

	/* Tell the hardware where the frame buffer is */
	xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);

	/* Turn on the display */
	drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
	if (pdata->rotate_screen)
		drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
	xilinx_fb_out_be32(drvdata, REG_CTRL,
					drvdata->reg_ctrl_default);

	/* Fill struct fb_info */
	drvdata->info.device = dev;
	drvdata->info.screen_base = (void __iomem *)drvdata->fb_virt;
	drvdata->info.fbops = &xilinxfb_ops;
	drvdata->info.fix = xilinx_fb_fix;
	drvdata->info.fix.smem_start = drvdata->fb_phys;
	drvdata->info.fix.smem_len = fbsize;
	drvdata->info.fix.line_length = pdata->xvirt * BYTES_PER_PIXEL;

	drvdata->info.pseudo_palette = drvdata->pseudo_palette;
	drvdata->info.flags = FBINFO_DEFAULT;
	drvdata->info.var = xilinx_fb_var;
	drvdata->info.var.height = pdata->screen_height_mm;
	drvdata->info.var.width = pdata->screen_width_mm;
	drvdata->info.var.xres = pdata->xres;
	drvdata->info.var.yres = pdata->yres;
	drvdata->info.var.xres_virtual = pdata->xvirt;
	drvdata->info.var.yres_virtual = pdata->yvirt;

	/* Allocate a colour map */
	rc = fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0);
	if (rc) {
		dev_err(dev, "Fail to allocate colormap (%d entries)\n",
			PALETTE_ENTRIES_NO);
		goto err_cmap;
	}

	/* Register new frame buffer */
	rc = register_framebuffer(&drvdata->info);
	if (rc) {
		dev_err(dev, "Could not register frame buffer\n");
		goto err_regfb;
	}

	if (drvdata->flags & PLB_ACCESS_FLAG) {
		/* Put a banner in the log (for DEBUG) */
		dev_dbg(dev, "regs: phys=%lx, virt=%p\n", physaddr,
					drvdata->regs);
	}
	/* Put a banner in the log (for DEBUG) */
	dev_dbg(dev, "fb: phys=%llx, virt=%p, size=%x\n",
		(unsigned long long)drvdata->fb_phys, drvdata->fb_virt, fbsize);

	return 0;	/* success */

err_regfb:
	fb_dealloc_cmap(&drvdata->info.cmap);

err_cmap:
	if (drvdata->fb_alloced)
		dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt,
			drvdata->fb_phys);
	else
		iounmap(drvdata->fb_virt);

	/* Turn off the display */
	xilinx_fb_out_be32(drvdata, REG_CTRL, 0);

err_fbmem:
	if (drvdata->flags & PLB_ACCESS_FLAG)
		iounmap(drvdata->regs);

err_map:
	if (drvdata->flags & PLB_ACCESS_FLAG)
		release_mem_region(physaddr, 8);

err_region:
	kfree(drvdata);
	dev_set_drvdata(dev, NULL);

	return rc;
}

static int xilinxfb_release(struct device *dev)
{
	struct xilinxfb_drvdata *drvdata = dev_get_drvdata(dev);

#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
	xilinx_fb_blank(VESA_POWERDOWN, &drvdata->info);
#endif

	unregister_framebuffer(&drvdata->info);

	fb_dealloc_cmap(&drvdata->info.cmap);

	if (drvdata->fb_alloced)
		dma_free_coherent(dev, PAGE_ALIGN(drvdata->info.fix.smem_len),
				  drvdata->fb_virt, drvdata->fb_phys);
	else
		iounmap(drvdata->fb_virt);

	/* Turn off the display */
	xilinx_fb_out_be32(drvdata, REG_CTRL, 0);

	/* Release the resources, as allocated based on interface */
	if (drvdata->flags & PLB_ACCESS_FLAG) {
		iounmap(drvdata->regs);
		release_mem_region(drvdata->regs_phys, 8);
	}
#ifdef CONFIG_PPC_DCR
	else
		dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
#endif

	kfree(drvdata);
	dev_set_drvdata(dev, NULL);

	return 0;
}

/* ---------------------------------------------------------------------
 * OF bus binding
 */

static int __devinit xilinxfb_of_probe(struct platform_device *op)
{
	const u32 *prop;
	u32 *p;
	u32 tft_access;
	struct xilinxfb_platform_data pdata;
	struct resource res;
	int size, rc;
	struct xilinxfb_drvdata *drvdata;

	/* Copy with the default pdata (not a ptr reference!) */
	pdata = xilinx_fb_default_pdata;

	/* Allocate the driver data region */
	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata) {
		dev_err(&op->dev, "Couldn't allocate device private record\n");
		return -ENOMEM;
	}

	/*
	 * To check whether the core is connected directly to DCR or PLB
	 * interface and initialize the tft_access accordingly.
	 */
	p = (u32 *)of_get_property(op->dev.of_node, "xlnx,dcr-splb-slave-if", NULL);
	tft_access = p ? *p : 0;

	/*
	 * Fill the resource structure if its direct PLB interface
	 * otherwise fill the dcr_host structure.
	 */
	if (tft_access) {
		drvdata->flags |= PLB_ACCESS_FLAG;
		rc = of_address_to_resource(op->dev.of_node, 0, &res);
		if (rc) {
			dev_err(&op->dev, "invalid address\n");
			goto err;
		}
	}
#ifdef CONFIG_PPC_DCR
	else {
		int start;
		res.start = 0;
		start = dcr_resource_start(op->dev.of_node, 0);
		drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0);
		drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len);
		if (!DCR_MAP_OK(drvdata->dcr_host)) {
			dev_err(&op->dev, "invalid DCR address\n");
			goto err;
		}
	}
#endif

	prop = of_get_property(op->dev.of_node, "phys-size", &size);
	if ((prop) && (size >= sizeof(u32)*2)) {
		pdata.screen_width_mm = prop[0];
		pdata.screen_height_mm = prop[1];
	}

	prop = of_get_property(op->dev.of_node, "resolution", &size);
	if ((prop) && (size >= sizeof(u32)*2)) {
		pdata.xres = prop[0];
		pdata.yres = prop[1];
	}

	prop = of_get_property(op->dev.of_node, "virtual-resolution", &size);
	if ((prop) && (size >= sizeof(u32)*2)) {
		pdata.xvirt = prop[0];
		pdata.yvirt = prop[1];
	}

	if (of_find_property(op->dev.of_node, "rotate-display", NULL))
		pdata.rotate_screen = 1;

	dev_set_drvdata(&op->dev, drvdata);
	return xilinxfb_assign(&op->dev, drvdata, res.start, &pdata);

 err:
	kfree(drvdata);
	return -ENODEV;
}

static int __devexit xilinxfb_of_remove(struct platform_device *op)
{
	return xilinxfb_release(&op->dev);
}

/* Match table for of_platform binding */
static struct of_device_id xilinxfb_of_match[] __devinitdata = {
	{ .compatible = "xlnx,xps-tft-1.00.a", },
	{ .compatible = "xlnx,xps-tft-2.00.a", },
	{ .compatible = "xlnx,xps-tft-2.01.a", },
	{ .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", },
	{ .compatible = "xlnx,plb-dvi-cntlr-ref-1.00.c", },
	{},
};
MODULE_DEVICE_TABLE(of, xilinxfb_of_match);

static struct platform_driver xilinxfb_of_driver = {
	.probe = xilinxfb_of_probe,
	.remove = __devexit_p(xilinxfb_of_remove),
	.driver = {
		.name = DRIVER_NAME,
		.owner = THIS_MODULE,
		.of_match_table = xilinxfb_of_match,
	},
};

/* ---------------------------------------------------------------------
 * Module setup and teardown
 */

static int __init
xilinxfb_init(void)
{
	return platform_driver_register(&xilinxfb_of_driver);
}

static void __exit
xilinxfb_cleanup(void)
{
	platform_driver_unregister(&xilinxfb_of_driver);
}

module_init(xilinxfb_init);
module_exit(xilinxfb_cleanup);

MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
MODULE_DESCRIPTION("Xilinx TFT frame buffer driver");
MODULE_LICENSE("GPL");


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="/sass/main.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

<link rel="alternate" type="application/rss+xml" title="RSS Feed for dmacleod.ca" href="https://dmacleod.ca/ra/index.xml" />

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        Toggle navigation

      </button>
      Readers' Advisory blog

About this blog

Browse by topics

Contact

Publications

Itsuka by Joy Kogawa
March 25, 2018

                    About the book Author: Kogawa, Joy
Title: Itsuka
Publication: Toronto, Ont. : Viking, 1992. ISBN 0140169881.
DAISY audio format narrated by Sandra Scott. CELA library call number …

La fiancée américaine …
January 3, 2018

                    About the book Author: Dupont, Éric, 1970-
Title: La fiancée américaine : roman
Publication: Montréal : Marchand de feuilles, 2012. ISBN 9782923896151.
DAISY audio format narrated …

obasan-by-joy-kogawa
November 4, 2017

                    About the book Author: Kogawa, Joy
Title: Obasan.
Publication: Toronto : Lester &amp; Orpen Dennys, 1981. ISBN 0-919630-42-1.
DAISY audio format narrated by the author. CELA …

Flavia de Luce books by …
August 14, 2017

                    About the book Author: Bradley, Alan C., 1938-
Title: The sweetness at the bottom of the pie.
Publication: New York : Bantam, 2009. ISBN 9780553840766.
DAISY audio format narrated …

Natural order by Brian …
August 5, 2017

                    About the book Author: Francis, Brian, 1971-
Title: Natural order
Publication: Toronto : Doubleday Canada, 2011. ISBN 9780385671538.
DAISY audio format narrated by Bennett …

Miss Julia speaks her …
October 22, 2016

                    About the book Author: Ross, Ann B.
Title: Miss Julia speaks her mind
Publication: William Morrow, 2000. ISBN 9780061978302.
DAISY audio format narrated by Terry Hayes Sales. CELA …

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License by Donna MacLeod.


text:
angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerController",
    function ($scope, entityResource, mediaHelper, $timeout, userService, localizationService, editorService, angularHelper, overlayService) {

        var vm = this;

        vm.labels = {};
        vm.labels.deletedItem = "";

        vm.add = add;
        vm.remove = remove;
        vm.editItem = editItem;
        vm.showAdd = showAdd;

        //check the pre-values for multi-picker
        var multiPicker = $scope.model.config.multiPicker && $scope.model.config.multiPicker !== '0' ? true : false;
        var onlyImages = $scope.model.config.onlyImages && $scope.model.config.onlyImages !== '0' ? true : false;
        var disableFolderSelect = $scope.model.config.disableFolderSelect && $scope.model.config.disableFolderSelect !== '0' ? true : false;

        $scope.allowEditMedia = false;
        $scope.allowAddMedia = false;

        function setupViewModel() {
            $scope.mediaItems = [];
            $scope.ids = [];

            $scope.isMultiPicker = multiPicker;

            if ($scope.model.value) {
                var ids = $scope.model.value.split(',');

                //NOTE: We need to use the entityResource NOT the mediaResource here because
                // the mediaResource has server side auth configured for which the user must have
                // access to the media section, if they don't they'll get auth errors. The entityResource
                // acts differently in that it allows access if the user has access to any of the apps that
                // might require it's use. Therefore we need to use the metaData property to get at the thumbnail
                // value.

                entityResource.getByIds(ids, "Media").then(function (medias) {

                    // The service only returns item results for ids that exist (deleted items are silently ignored).
                    // This results in the picked items value to be set to contain only ids of picked items that could actually be found.
                    // Since a referenced item could potentially be restored later on, instead of changing the selected values here based
                    // on whether the items exist during a save event - we should keep "placeholder" items for picked items that currently
                    // could not be fetched. This will preserve references and ensure that the state of an item does not differ depending
                    // on whether it is simply resaved or not.
                    // This is done by remapping the int/guid ids into a new array of items, where we create "Deleted item" placeholders
                    // when there is no match for a selected id. This will ensure that the values being set on save, are the same as before.

                    medias = ids.map(id => {
                        // We could use coercion (two ='s) here .. but not sure if this works equally well in all browsers and
                        // it's prone to someone "fixing" it at some point without knowing the effects. Rather use toString()
                        // compares and be completely sure it works.
                        var found = medias.find(m => m.udi.toString() === id.toString() || m.id.toString() === id.toString());

                        var mediaItem = found ||
                        {
                            name: vm.labels.deletedItem,
                            id: $scope.model.config.idType !== "udi" ? id : null,
                            udi: $scope.model.config.idType === "udi" ? id : null,
                            icon: "icon-picture",
                            thumbnail: null,
                            trashed: true
                        };

                        return mediaItem;
                    });

                    medias.forEach(media => {
                        if (!media.extension && media.id && media.metaData) {
                            media.extension = mediaHelper.getFileExtension(media.metaData.MediaPath);
                        }

                        // if there is no thumbnail, try getting one if the media is not a placeholder item
                        if (!media.thumbnail && media.id && media.metaData) {
                            media.thumbnail = mediaHelper.resolveFileFromEntity(media, true);
                        }

                        $scope.mediaItems.push(media);

                        if ($scope.model.config.idType === "udi") {
                            $scope.ids.push(media.udi);
                        } else {
                            $scope.ids.push(media.id);
                        }
                    });

                    sync();
                });
            }
        }

        function sync() {
            $scope.model.value = $scope.ids.join();
            removeAllEntriesAction.isDisabled = $scope.ids.length === 0;
        }

        function setDirty() {
            angularHelper.getCurrentForm($scope).$setDirty();
        }

        function reloadUpdatedMediaItems(updatedMediaNodes) {
            // because the images can be edited through the media picker we need to
            // reload. We only reload the images that is already picked but has been updated.
            // We have to get the entities from the server because the media
            // can be edited without being selected
            $scope.mediaItems.forEach(media => {
                if (updatedMediaNodes.indexOf(media.udi) !== -1) {
                    media.loading = true;
                    entityResource.getById(media.udi, "Media")
                        .then(function (mediaEntity) {
                            angular.extend(media, mediaEntity);
                            media.thumbnail = mediaHelper.resolveFileFromEntity(media, true);
                            media.loading = false;
                        });
                }
            });
        }

        function init() {

            // localize labels
            var labelKeys = [
                "mediaPicker_deletedItem",
                "mediaPicker_trashed"
            ];

            localizationService.localizeMany(labelKeys)
                .then(function(data) {
                    vm.labels.deletedItem = data[0];
                    vm.labels.trashed = data[1];

                    userService.getCurrentUser().then(function (userData) {

                        if (!$scope.model.config.startNodeId) {
                            if ($scope.model.config.ignoreUserStartNodes === true) {
                                $scope.model.config.startNodeId = -1;
                                $scope.model.config.startNodeIsVirtual = true;
                            }
                            else {
                                $scope.model.config.startNodeId = userData.startMediaIds.length !== 1 ? -1 : userData.startMediaIds[0];
                                $scope.model.config.startNodeIsVirtual = userData.startMediaIds.length !== 1;
                            }
                        }

                        // only allow users to add and edit media if they have access to the media section
                        var hasAccessToMedia = userData.allowedSections.indexOf("media") !== -1;
                        $scope.allowEditMedia = hasAccessToMedia;
                        $scope.allowAddMedia = hasAccessToMedia;

                        setupViewModel();
                    });
                });
        }

        function remove(index) {
            $scope.mediaItems.splice(index, 1);
            $scope.ids.splice(index, 1);
            sync();
            setDirty();
        }

        function editItem(item) {
            var mediaEditor = {
                id: item.id,
                submit: function (model) {
                    editorService.close();
                    // update the selected media item to match the saved media item
                    // the media picker is using media entities so we get the
                    // entity so we easily can format it for use in the media grid
                    if (model && model.mediaNode) {
                        entityResource.getById(model.mediaNode.id, "Media")
                            .then(function (mediaEntity) {
                                // if an image is selecting more than once
                                // we need to update all the media items
                                $scope.mediaItems.forEach(media => {
                                    if (media.id === model.mediaNode.id) {
                                        angular.extend(media, mediaEntity);
                                        media.thumbnail = mediaHelper.resolveFileFromEntity(media, true);
                                    }
                                });
                            });
                    }
                },
                close: function () {
                    editorService.close();
                }
            };
            editorService.mediaEditor(mediaEditor);
        }

        function add() {
            var mediaPicker = {
                startNodeId: $scope.model.config.startNodeId,
                startNodeIsVirtual: $scope.model.config.startNodeIsVirtual,
                dataTypeKey: $scope.model.dataTypeKey,
                multiPicker: multiPicker,
                onlyImages: onlyImages,
                disableFolderSelect: disableFolderSelect,
                submit: function (model) {

                    editorService.close();

                    model.selection.forEach(media => {
                        // if there is no thumbnail, try getting one if the media is not a placeholder item
                        if (!media.thumbnail && media.id && media.metaData) {
                            media.thumbnail = mediaHelper.resolveFileFromEntity(media, true);
                        }

                        $scope.mediaItems.push(media);

                        if ($scope.model.config.idType === "udi") {
                            $scope.ids.push(media.udi);
                        }
                        else {
                            $scope.ids.push(media.id);
                        }

                    });

                    sync();
                    reloadUpdatedMediaItems(model.updatedMediaNodes);
                    setDirty();
                },
                close: function (model) {
                    editorService.close();
                    reloadUpdatedMediaItems(model.updatedMediaNodes);
                }
            }

            editorService.mediaPicker(mediaPicker);
        }

        function showAdd() {
            if (!multiPicker) {
                if ($scope.model.value && $scope.model.value !== "") {
                    return false;
                }
            }
            return true;
        }

        function removeAllEntries() {
            localizationService.localizeMany(["content_nestedContentDeleteAllItems", "general_delete"]).then(function (data) {
                overlayService.confirmDelete({
                    title: data[1],
                    content: data[0],
                    close: function () {
                        overlayService.close();
                    },
                    submit: function () {
                        $scope.mediaItems.length = 0;// AngularJS way to empty the array.
                        $scope.ids.length = 0;// AngularJS way to empty the array.
                        sync();
                        setDirty();
                        overlayService.close();
                    }
                });
            });
        }

        var removeAllEntriesAction = {
            labelKey: 'clipboard_labelForRemoveAllEntries',
            labelTokens: [],
            icon: 'trash',
            method: removeAllEntries,
            isDisabled: true
        };

        if (multiPicker === true) {
            var propertyActions = [
                removeAllEntriesAction
            ];

            if ($scope.umbProperty) {
                $scope.umbProperty.setPropertyActions(propertyActions);
            }
        }

        $scope.sortableOptions = {
            containment: 'parent',
            cursor: 'move',
            tolerance: 'pointer',
            disabled: !multiPicker,
            items: "li:not(.add-wrapper)",
            cancel: ".unsortable",
            update: function () {
                setDirty();
                $timeout(function() {
                    // TODO: Instead of doing this with a timeout would be better to use a watch like we do in the
                    // content picker. Then we don't have to worry about setting ids, render models, models, we just set one and let the
                    // watch do all the rest.
                    $scope.ids = $scope.mediaItems.map(media => $scope.model.config.idType === "udi" ? media.udi : media.id);

                    sync();
                });
            }
        };

        init();

    });


text:
package org.zaproxy.zap.extension.custompages;

import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.parosproxy.paros.Constant;
import org.zaproxy.zap.utils.I18N;

class DefaultCustomPageUnitTest {

    private static final String TEST_MATCH_PATTERN = ".*Something went wrong.*";
    private static final String BASE64_TEST_PATTERN =
            new String(
                    Base64.getEncoder().encode(TEST_MATCH_PATTERN.getBytes(StandardCharsets.UTF_8)),
                    StandardCharsets.US_ASCII);

    @BeforeEach
    public void setup() {
        Constant.messages = mock(I18N.class);
    }

    @Test
    public void shouldEncodeCustomPage() {
        // Given
        DefaultCustomPage customPage =
                new DefaultCustomPage(
                        0,
                        TEST_MATCH_PATTERN,
                        CustomPageMatcherLocation.RESPONSE_CONTENT,
                        true,
                        CustomPage.Type.ERROR_500,
                        true);
        // When
        String encodedCustomPage = DefaultCustomPage.encode(customPage);
        // Then
        assertTrue(encodedCustomPage.equals(BASE64_TEST_PATTERN + ";1;true;1;true;"));
    }

    @Test
    public void shouldDecodeCustomPage() {
        // Given
        String encodedCustomPage = BASE64_TEST_PATTERN + ";1;true;1;true;";
        DefaultCustomPage expectedCustomPage =
                new DefaultCustomPage(
                        0,
                        TEST_MATCH_PATTERN,
                        CustomPageMatcherLocation.RESPONSE_CONTENT,
                        true,
                        CustomPage.Type.ERROR_500,
                        true);
        // When
        DefaultCustomPage customPage = DefaultCustomPage.decode(0, encodedCustomPage);
        // Then
        assertCustomPagesMatch(expectedCustomPage, customPage);
    }

    @Test
    public void shouldDecodeCustomPageWithDefaultTypeIfTypeIdInvalid() {
        // Given/When
        DefaultCustomPage actual =
                DefaultCustomPage.decode(0, BASE64_TEST_PATTERN + ";1;true;5;true;");
        DefaultCustomPage expected =
                new DefaultCustomPage(
                        0,
                        TEST_MATCH_PATTERN,
                        CustomPageMatcherLocation.getCustomPagePageMatcherLocationWithId(1),
                        true,
                        CustomPage.Type.getDefaultType(),
                        true);
        // Then
        assertCustomPagesMatch(expected, actual);
    }

    @Test
    public void shouldDecodeCustomPageWithDefaultMatcherLocationIfMatcherLocationIdInvalid() {
        // Given/When
        DefaultCustomPage actual =
                DefaultCustomPage.decode(0, BASE64_TEST_PATTERN + ";5;true;1;true;");
        DefaultCustomPage expected =
                new DefaultCustomPage(
                        0,
                        TEST_MATCH_PATTERN,
                        CustomPageMatcherLocation.getDefaultLocation(),
                        true,
                        CustomPage.Type.getCustomPageTypeWithId(1),
                        true);
        // Then
        assertCustomPagesMatch(expected, actual);
    }

    @Test
    public void shouldDecodeCustomPageWithIsRegexFalseWhenIsRegexComponentInvalid() {
        // Given/When
        DefaultCustomPage actual =
                DefaultCustomPage.decode(0, BASE64_TEST_PATTERN + ";1;foo;1;true;");
        DefaultCustomPage expected =
                new DefaultCustomPage(
                        0,
                        TEST_MATCH_PATTERN,
                        CustomPageMatcherLocation.getCustomPagePageMatcherLocationWithId(1),
                        false,
                        CustomPage.Type.getCustomPageTypeWithId(1),
                        true);
        // Then
        assertCustomPagesMatch(expected, actual);
    }

    @Test
    public void shouldDecodeCustomPageWithEnabledFalseWhenEnabledComponentInvalid() {
        // Given/When
        DefaultCustomPage actual =
                DefaultCustomPage.decode(0, BASE64_TEST_PATTERN + ";1;true;1;foo;");
        DefaultCustomPage expected =
                new DefaultCustomPage(
                        0,
                        TEST_MATCH_PATTERN,
                        CustomPageMatcherLocation.getCustomPagePageMatcherLocationWithId(1),
                        true,
                        CustomPage.Type.getCustomPageTypeWithId(1),
                        false);
        // Then
        assertCustomPagesMatch(expected, actual);
    }

    private void assertCustomPagesMatch(CustomPage expected, CustomPage actual) {
        assertTrue(actual.getPageMatcher().equals(expected.getPageMatcher()));
        assertTrue(actual.getPageMatcherLocation().equals(expected.getPageMatcherLocation()));
        assertTrue(actual.isRegex() == expected.isRegex());
        assertTrue(actual.getType().equals(expected.getType()));
        assertTrue(actual.isEnabled() == expected.isEnabled());
    }
}


text:
#region copyright
// Copyright 2015 Habart Thierry
//
// 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.
#endregion

using SimpleIdentityServer.Uma.Core.Policies;

namespace SimpleIdentityServer.Uma.Core.Responses
{
    public class AuthorizationResponse
    {
        public AuthorizationPolicyResultEnum AuthorizationPolicyResult { get; set; }
        public object ErrorDetails { get; set; }
        public string Rpt { get; set; }
    }
}


text:
/*Grid daftar penyesuaian pembelian*/
Ext.define('App.view.pradjustment.lists', {
	extend: 'Ext.grid.Panel',
	alias: 'widget.apppradjustmentvpradjustmentlists',
	layout: { type: 'fit', align: 'stretch'},
	store: 'App.store.pradjustment.spradjustment',
	groupid: 5,

	frame: true,
	initComponent: function () {
		var me = this;
		Ext.apply(me, {
			flex: 1,
			viewConfig: {
				getRowClass: function (record) {
					if (record) {
						var approve = 'cgreen';
						var denied = 'cred';
						var unprocess = 'corange';
						var pending = 'cpending';
						var processed = 'row-processed';
						var color;
						var status = parseInt(record.get('status'));
						switch (status) {
							case 2:
								color = approve;
								break;
							case 3:
								color = denied;
								break;
							case 4:
								color = pending;
								break;
							/*Sudah diproses*/
							case 5:
								color = processed;
								break;
							default:
								color = unprocess
						}
						return color;
					}
				}
			},
			columns: [
				{xtype: 'rownumberer'},
				{text: 'Transaksi Number', dataIndex: 'trxnumber', flex: 2,
					renderer: function(v,m,r){
						var totalitem = r.get('totalitems');
						var total = (totalitem >0) ? totalitem : 0 ;
						var s = (total > 0 ) ? 's' : '';
						return v + ' ( ' + total + ' item'+s+' )';
					}
				},
				{text: 'Sudah di Proses', dataIndex: 'process', flex: 1, xtype: 'checkcolumn'},
				{
					xtype: 'actioncolumn',
					width: 50,
					items: [
						{
							iconCls: 'forward',
							tooltip: 'Proses',
							handler: function (grid, rowIndex, colIndex) {
								var rec = grid.getStore().getAt(rowIndex);
								/*Jika Status == Sudah diproses (code 5) */
								if (rec.get('status')==5){
									App.util.box.error('Pengajuan ini sudah diajukan ke management tidak bisa untuk diproses');
									return false;
								}
								var tab = grid.up('tabpanel');
								var trxnumber = rec.get('trxnumber');
								var trxid = rec.get('id');
								var title = 'Proses Adjustment Pembelian [ '+trxnumber+' ]';
								var config = {
									iconCls: 'form',
									closable:true,
									adjid : trxid,
									title: title,
									adjtrx: trxnumber,
									status : rec.get('status'),
									store : Ext.create('App.store.pradjustment.item')
								}
								App.util.box.openNewtab(tab,title,'App.view.pradjustment.edit',config);
							}
						}
					]
				}
			],
			columnLines: true,
			/*==========  Plugins  ==========*/
			plugins: [
				Ext.create('Ext.grid.plugin.RowEditing', {
					clicksToEdit: !1,
					clicksToMoveEditor: 1
				})
			],
			store: me.getStore(),
			dockedItems: [
				{
					xtype: 'pagingtoolbar',
					dock: 'bottom',
					displayInfo: true,
					store: me.getStore()
				}
			]

		});
		me.callParent(arguments);
//		}
	}
});


text:
package com.consol.citrus.kubernetes.endpoint;

import java.util.Map;

import com.consol.citrus.context.TestContext;
import com.consol.citrus.endpoint.Endpoint;
import com.consol.citrus.endpoint.EndpointComponent;
import com.consol.citrus.endpoint.direct.DirectEndpointComponent;
import com.consol.citrus.http.client.HttpEndpointComponent;
import com.consol.citrus.http.client.HttpsEndpointComponent;
import com.consol.citrus.kubernetes.client.KubernetesClient;
import org.testng.Assert;
import org.testng.annotations.Test;

/**
 * @author Christoph Deppisch
 * @since 2.7
 */
public class KubernetesEndpointComponentTest {

    private TestContext context = new TestContext();

    @Test
    public void testCreateClientEndpoint() throws Exception {
        KubernetesEndpointComponent component = new KubernetesEndpointComponent();

        Endpoint endpoint = component.createEndpoint("k8s:localhost:8443/", context);

        Assert.assertEquals(endpoint.getClass(), KubernetesClient.class);

        Assert.assertEquals(((KubernetesClient)endpoint).getEndpointConfiguration().getKubernetesClientConfig().getMasterUrl(), "https://localhost:8443/");

        endpoint = component.createEndpoint("k8s:http://localhost:8443/", context);

        Assert.assertEquals(endpoint.getClass(), KubernetesClient.class);

        Assert.assertEquals(((KubernetesClient)endpoint).getEndpointConfiguration().getKubernetesClientConfig().getMasterUrl(), "http://localhost:8443/");
        Assert.assertEquals(((KubernetesClient) endpoint).getEndpointConfiguration().getTimeout(), 5000L);
    }

    @Test
    public void testCreateClientEndpointWithParameters() throws Exception {
        KubernetesEndpointComponent component = new KubernetesEndpointComponent();

        Endpoint endpoint = component.createEndpoint("k8s:localhost:8443?namespace=myNamespace&timeout=10000", context);

        Assert.assertEquals(endpoint.getClass(), KubernetesClient.class);

        Assert.assertEquals(((KubernetesClient)endpoint).getEndpointConfiguration().getKubernetesClientConfig().getMasterUrl(), "https://localhost:8443");
        Assert.assertEquals(((KubernetesClient)endpoint).getEndpointConfiguration().getKubernetesClientConfig().getNamespace(), "myNamespace");
        Assert.assertEquals(((KubernetesClient) endpoint).getEndpointConfiguration().getTimeout(), 10000L);
    }

    @Test
    public void testLookupAll() {
        Map<String, EndpointComponent> validators = EndpointComponent.lookup();
        Assert.assertEquals(validators.size(), 4L);
        Assert.assertNotNull(validators.get("direct"));
        Assert.assertEquals(validators.get("direct").getClass(), DirectEndpointComponent.class);
        Assert.assertNotNull(validators.get("http"));
        Assert.assertEquals(validators.get("http").getClass(), HttpEndpointComponent.class);
        Assert.assertNotNull(validators.get("https"));
        Assert.assertEquals(validators.get("https").getClass(), HttpsEndpointComponent.class);
        Assert.assertNotNull(validators.get("k8s"));
        Assert.assertEquals(validators.get("k8s").getClass(), KubernetesEndpointComponent.class);
    }

    @Test
    public void testLookupByQualifier() {
        Assert.assertTrue(EndpointComponent.lookup("k8s").isPresent());
    }

}


text:
CityData::CityData() {}

CityData::CityData(QString name, QString commercialName, QString countryCode,
                   QString urlCarto, QString urlAllStationDetails, QString urlStationDetails,
                   BikeDataParser* (*ptr)())
{
    _name = name;
    _commercialName = commercialName;
    _countryCode = countryCode;
    _urlCarto = urlCarto;
    _urlAllStationsDetails = urlAllStationDetails;
    _urlStationDetails = urlStationDetails;
    _getParserFunction = ptr;
}

QString CityData::getName() const
{
    return _name;
}

QString CityData::getCommercialName() const
{
    return _commercialName;
}

QString CityData::getCountryCode() const
{
    return _countryCode;
}

QString CityData::getUrlCarto() const
{
    return _urlCarto;
}

QString CityData::getUrlAllStationsDetails() const
{
    return _urlAllStationsDetails;
}

QString CityData::getUrlStationDetails() const
{
    return _urlStationDetails;
}

BikeDataParser* CityData::getBikeDataParser()
{
    return _getParserFunction();
}


text:
package com.intellij.plugins.haxe;

import com.intellij.codeInspection.InspectionProfileEntry;
import com.intellij.openapi.project.Project;
import com.intellij.plugins.haxe.build.ClassWrapper;
import com.intellij.plugins.haxe.build.IdeaTarget;
import com.intellij.plugins.haxe.build.MethodWrapper;
import com.intellij.plugins.haxe.util.HaxeDebugLogger;
import com.intellij.plugins.haxe.util.HaxeTestUtils;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;

/**
 * Created by fedorkorotkov.
 */
abstract public class HaxeCodeInsightFixtureTestCase extends JavaCodeInsightFixtureTestCase {
  @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
  protected HaxeCodeInsightFixtureTestCase() {
    super();
    HaxeDebugLogger.configurePrimaryLoggerToSwallowLogs();
  }

  @Override
  protected String getTestDataPath() {
    return HaxeTestUtils.BASE_TEST_DATA_PATH + getBasePath();
  }

  /**
   * Use reflection to load an annotator inspection class.
   * Specific to annotation tests, but placed here just to avoid adding yet another single-function base class.
   *
   * When we don't support versions of the plugin prior to v2016.1, we can revert the code to importing
   * the classes directly and get rid of this function.
   *
   * @return - An annotator-based inspection class instance.
   */
  protected InspectionProfileEntry getAnnotatorBasedInspection() {
    // Because we're loading an inner class, and Class.forName simply substitutes '.' for '/', it won't find
    // the class unless we use the '$' as the final path separator.  (Which is what the Java compiler does
    // when it  creates an inner class.)
    //String defaultInspectorClassName = IdeaTarget.IS_VERSTION_16_COMPATIBLE
    //                       ? "com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitorBasedInspection$AnnotatorBasedInspection"
    //                       : "com.intellij.codeInspection.DefaultHighlightVisitorBasedInspection$AnnotatorBasedInspection";
    String defaultInspectorClassName = IdeaTarget.IS_VERSTION_16_COMPATIBLE
                                       ? "com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitorBasedInspection"
                                       : "com.intellij.codeInspection.DefaultHighlightVisitorBasedInspection";

    ClassWrapper<InspectionProfileEntry> wrapper = new ClassWrapper<InspectionProfileEntry>(defaultInspectorClassName);
    ClassWrapper<InspectionProfileEntry> annotator = new ClassWrapper<InspectionProfileEntry>(wrapper, "AnnotatorBasedInspection");

    return annotator.newInstance();
  }

  public void setTestStyleSettings() {
    setTestStyleSettings(2);
  }

  public void setTestStyleSettings(int indent) {
    Project project = getProject();
    CodeStyleSettings currSettings = CodeStyleSettingsManager.getSettings(project);
    assertNotNull(currSettings);
    CodeStyleSettings tempSettings = currSettings.clone();
    CodeStyleSettings.IndentOptions indentOptions = tempSettings.getIndentOptions(HaxeFileType.HAXE_FILE_TYPE);
    indentOptions.INDENT_SIZE = indent;
    assertNotNull(indentOptions);
    CodeStyleSettingsManager.getInstance(project).setTemporarySettings(tempSettings);
  }
}


text:
package com.github.jochenw.afw.core.util;

import java.util.LinkedHashMap;
import java.util.Map;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.github.jochenw.afw.core.function.Functions;
import com.github.jochenw.afw.core.function.Functions.FailableBiConsumer;
import com.github.jochenw.afw.core.function.Functions.FailableConsumer;

/** A class for reading, and writing property files, including comments.
 */
public class PropertyUtils {
	/** A class, which representy an entry in the property set.
	 */
	public static class Entry {
		private final @Nonnull String key, value;
		private final @Nullable String comment;
		/** Creates a new instance with the given key, value, and comment.
		 * @param pKey The property key.
		 * @param pValue The property value.
		 * @param pComment The property comment.
		 */
		public Entry(@Nonnull String pKey, @Nonnull String pValue, @Nullable String pComment) {
			key = pKey;
			value = pValue;
			comment = pComment;
		}
		/** Returns the property key.
		 * @return The property key.
		 */
		public @Nonnull String getKey() { return key; }
		/** Returns the property value.
		 * @return The property value.
		 */
		public @Nonnull String getValue() { return value; }
		/** Returns the property comment.
		 * @return The property comment.
		 */
		public @Nullable String getComment() { return comment; }
	}

	private final Map<String,Entry> map = new LinkedHashMap<>();

	/** Returns the property entry with the given key.
	 * @param pKey The requested property key.
	 * @return A property entry with the given key, if any, or null.
	 */
	public Entry getEntry(String pKey) {
		return map.get(pKey);
	}
	/** Returns the property value with the given key.
	 * @param pKey The requested property key.
	 * @return A property value with the given key, if any, or null.
	 */
	public String getValue(String pKey) {
		final Entry entry = getEntry(pKey);
		return entry == null ? null : entry.getValue();
	}
	/** Returns the comment with the given key.
	 * @param pKey The requested property key.
	 * @return A property comment with the given key, if any, or null.
	 */
	public String getComment(String pKey) {
		final Entry entry = getEntry(pKey);
		return entry == null ? null : entry.getComment();
	}
	/**
	 * Iterates over all the entries in the property set,
	 * invoking the given consumer.
	 * @param pConsumer  The consumer, which ought to process the property entries.
	 */
	public void forEach(@Nonnull FailableConsumer<Entry,?> pConsumer) {
		map.values().forEach((e) -> Functions.accept(pConsumer, e));
	}
	/**
	 * Iterates over all the entries in the property set,
	 * invoking the given consumer.
	 * @param pConsumer The consumer, which ought to process the properties.
	 */
	public void forEach(@Nonnull FailableBiConsumer<String,String,?> pConsumer) {
		forEach((e) -> Functions.accept(pConsumer, e.getKey(), e.getValue()));
	}
	/**
	 * Adds a new entry to the property set. If an entry with the given
	 * property key already exists, then it is being replaced by the new entry.
	 * @param pKey The property key.
	 * @param pValue The property value.
	 */
	public void put(@Nonnull String pKey, @Nonnull String pValue) {
		put(pKey, pValue, null);
	}
	/**
	 * Adds a new entry to the property set. If an entry with the given
	 * property key already exists, then it is being replaced by the new entry.
	 * @param pKey The property key.
	 * @param pValue The property value.
	 * @param pComment The property comment.
	 */
	public void put(@Nonnull String pKey, @Nonnull String pValue, @Nullable String pComment) {
		map.put(pKey, new Entry(pKey, pValue, pComment));
	}
}


text:
<?php
/* @var $this yii\web\View */

use app\components\widgets\modal\Message;

?>

Обо мне

<?=$guide['info_full']['rt_about_text']; ?>

Контакты

Телефон

<? if($guide['info_full']['phone']): ?><?=$guide['info_full']['phone']; ?><? else: ?>не добавлено<? endif; ?>

Опыт работы

Опыт работы <?=$serviceData['work_experience']; ?> <?=\app\helpers\Text::getDeclension($serviceData['work_experience'], ['год', 'года', 'лет']); ?>

Связь с гидом

Написать

Дополнительные услуги

Услуги, которые предоставляет гид помимо проведения экскурсий:

<? foreach($serviceItems as $sItem): ?>

    <? foreach ($sItem as $_item): ?>
    <p class="club-user-card-contact-serv-p club-user-card-contact-serv-p<?=$serviceAssocStyle[$_item['type']][$_item['type_id']]; ?>"><?=$_item['name']; ?>

    <? endforeach; ?>

<? endforeach; ?>

Перейти ко всем услугам →

Индивидуальный гид участвует в программе лояльности
Интересно? получите свой бонус!

<?=Message::widget(); ?>


text:
using System;
using Xamarin.Forms;
using Xamarin.FormsBook.Toolkit;

namespace BezierLoop
{
    public partial class BezierLoopPage : ContentPage
    {
        public BezierLoopPage()
        {
            InitializeComponent();
        }

        async void OnButtonClicked(object sender, EventArgs args)
        {
            Button button = (Button)sender;
            Layout parent = (Layout)button.Parent;

            // Center of Button in upper-left corner.
            Point point0 = new Point(button.Width / 2, button.Height / 2);

            // Lower-right corner of page.
            Point point1 = new Point(parent.Width, parent.Height);

            // Lower-left corner of page.
            Point point2 = new Point(0, parent.Height);

            // Center of Button in upper-right corner.
            Point point3 = new Point(parent.Width - button.Width / 2, button.Height / 2);

            // Initial angle of Bezier curve (vector from Point0 to Point1).
            double angle = 180 / Math.PI * Math.Atan2(point1.Y - point0.Y,
                                                      point1.X - point0.X);

            await button.RotateTo(angle, 1000, Easing.SinIn);

            await button.BezierPathTo(point1, point2, point3, 5000,
                                      BezierTangent.Normal, Easing.SinOut);

            await button.BezierPathTo(point2, point1, point0, 5000,
                                      BezierTangent.Reversed, Easing.SinIn);

            await button.RotateTo(0, 1000, Easing.SinOut);
        }
    }
}


text:
<?php
/**
 * @author Tomáš Blatný
 */

namespace Tempeus\ApiModule;

class DashboardPresenter extends BaseApiPresenter
{
	public function actionDefault()
	{

	}
}


text:
#include <math.h>
#include <stdlib.h>
#include <string.h>

#include "DataSet_JSonDB.h"

JSonDB::JSonDB()
:m_startRecord			(NULL)
,mStringRecordBuffer	(NULL)
{
}

JSonDB::~JSonDB() {
	clean();
}

void JSonDB::clean() {
	RecordListHeader* pRecord = m_startRecord;
	while (pRecord) {
		RecordListHeader* pNextRecord = pRecord->pNextRecord;
		KLBDELETE(pRecord->fields);
		KLBDELETE(pRecord);
		pRecord = pNextRecord;
	}
	m_startRecord = NULL;

	KLBDELETEA(mStringRecordBuffer);
	mStringRecordBuffer = NULL;
}

/*static*/ int JSonDB::read_start_map		(void * ctx, unsigned int size)
{ return ((JSonDB*)ctx)->readStartMap(size); }
/*static*/ int JSonDB::read_null			(void * ctx)
{ return ((JSonDB*)ctx)->readNull(); }
/*static*/ int JSonDB::read_boolean			(void * ctx, int boolean)
{ return ((JSonDB*)ctx)->readBoolean(boolean); }
/*static*/ int JSonDB::read_int				(void * ctx, long long integerVal)
{ return ((JSonDB*)ctx)->readInt(integerVal); }
/*static*/ int JSonDB::read_double			(void * ctx, double doubleVal)
{ return ((JSonDB*)ctx)->readDouble(doubleVal); }
/*static*/ int JSonDB::read_string			(void * ctx, const unsigned char * stringVal, size_t stringLen, int cte_pool)
{ return ((JSonDB*)ctx)->readString(stringVal, stringLen,cte_pool); }
/*static*/ int JSonDB::read_map_key			(void * ctx, const unsigned char * stringVal, size_t stringLen, int cte_pool)
{ return ((JSonDB*)ctx)->readMapKey(stringVal, stringLen,cte_pool); }
/*static*/ int JSonDB::read_end_map			(void * ctx)
{ return ((JSonDB*)ctx)->readEndMap(); }
/*static*/ int JSonDB::read_start_array		(void * ctx, unsigned int size)
{ return ((JSonDB*)ctx)->readStartArray(size); }
/*static*/ int JSonDB::read_end_array		(void * ctx)
{ return ((JSonDB*)ctx)->readEndArray(); }

/*static*/
IDataSource* JSonDB::openDB(const u8* source, u32 sourceLength) {
	JSonDB* newDB = KLBNEW(JSonDB);
	if (!newDB->readDBInternal(source, sourceLength)) {
		KLBDELETE(newDB);
		newDB = NULL;
	}
	return newDB;
}

bool JSonDB::readDBInternal(const u8* source, u32 sourceLength) {
	bool res = false;
	m_baseRecordHeader.fields		= &m_field[0];
	m_baseRecordHeader.pNextRecord	= NULL;
	m_arrayCnt		= 0;
	m_record		= 0;
	m_recordEntry	= 0;
	m_stringAlloc	= 0;
	m_startRecord	= NULL;
	m_currRecIdx	= 0;
	m_mapCnt		= 0;
	m_res			= MOVE_UNFETCH;

	mStringRecordBuffer	= KLBNEWA(char, sourceLength);
	mStringRecordCount  = 0;
	m_StringRecordBufferSize = sourceLength;

	if (mStringRecordBuffer) {
		static yajl_callbacks callbacks = {
			JSonDB::read_null,
			JSonDB::read_boolean,
			JSonDB::read_int,
			JSonDB::read_double,
			NULL,
			JSonDB::read_string,
			JSonDB::read_start_map,
			JSonDB::read_map_key,
			JSonDB::read_end_map,
			JSonDB::read_start_array,
			JSonDB::read_end_array
		};

		memcpy(mStringRecordBuffer, source, sourceLength);
		yajl_handle hand;
		/* generator config */
//		yajl_gen g;				// My Context. 2012.12.06  使用していなかったのでコメントアウト
		yajl_status stat;

//		g = yajl_gen_alloc(NULL); // 2012.12.06  使用していなかったのでコメントアウト

		/* ok.  open file.  let's read and parse */
		hand = yajl_alloc(&callbacks, NULL, this);
		if (hand) {
			this->parserCtx = hand;

			/* and let's allow comments by default */
			yajl_config(hand, yajl_allow_comments, 1);

			stat = yajl_parse(hand, (const unsigned char*)mStringRecordBuffer, sourceLength);

			if (stat == yajl_status_ok) {
				stat = yajl_complete_parse(hand);
				if (stat == yajl_status_ok) {
					res = true;
				}
			}
		}
	}

	if (!res) {
		clean();
	}
	m_recordPtr		= m_startRecord;
	return res;
}

int JSonDB::readNull()
{
	if (m_record == 1) {
		// Set data type to entry -> String for null, only type tolerated as we do not tolerate sub object / array for now.
		setFieldType(m_entryIdx, TYPE_STR);
	}
	setString(m_entryIdx, NULL, 0);
    return 1;
}

int JSonDB::readBoolean(int boolean)
{
	if (m_record == 1) {
		// Set data type to entry.
		setFieldType(m_entryIdx, TYPE_BOOL);
	}

	setBool(m_entryIdx, boolean);
	return 1;
}

int JSonDB::readInt(long long integerVal)
{
	if (m_record == 1) {
		// Set data type to entry.
		setFieldType(m_entryIdx, TYPE_INT);
	}

	setInt(m_entryIdx, (s32)integerVal);
    return 1;
}

int JSonDB::readDouble(double doubleVal)
{
	if (m_record == 1) {
		// Set data type to entry.
		setFieldType(m_entryIdx, TYPE_FLOAT);
	}

	setFloat(m_entryIdx, (float)doubleVal);
	return 1;
}

int JSonDB::readString(const unsigned char * stringVal, size_t stringLen, int /*cte_pool*/)
{
	if (m_record == 1) {
		// Set data type to entry.
		setFieldType(m_entryIdx, TYPE_STR);
	}

	setString(m_entryIdx, stringVal, stringLen);
	return 1;
}

/*static*/
int JSonDB::readMapKey(const unsigned char * stringVal, size_t stringLen, int cte_pool)
{
	if (m_record == 1) {
		if (m_recordEntry < MAX_FIELD_PER_RECORD) {
			// Store name and index.
			m_entryIdx = addField(stringVal, stringLen);
			m_recordEntry++;
		} else {
			klb_assertAlways("Limit is 64 field / record");
			return 0;
		}
	} else {
		if (cte_pool > -1) {
			int id = bjson_getCPCacheID((yajl_handle)this->parserCtx, cte_pool);
			if (id != -1) {
				m_entryIdx = id;
				return 1;
			}
		}

		// remap key to index.
		m_entryIdx = getFieldID(stringVal, stringLen);
		if (m_entryIdx == -1) {
			klb_assertAlways("Record structure changed between records.");
		}

		if (cte_pool > -1) {
			bjson_setCPCacheID((yajl_handle)this->parserCtx, cte_pool, m_entryIdx);
		}
	}
	return 1;
}

int JSonDB::readStartMap(unsigned int /*size*/) {
	if (m_mapCnt == 0) {
		if (allocateRecord()) {
			m_record++;
		} else {
			return 0;
		}
	}
	return 1;
}

int JSonDB::readEndMap()
{
	if (m_record == 1) {
		if (!allocateRecord()) {
			return 0;
		}
		copyFromTempToRecord();
		m_startRecord = m_currRecord;
	}
	return 1;
}

int JSonDB::readStartArray(unsigned int /*size*/)
{
	if (m_arrayCnt == 0) {
		// First level
	} else {
		klb_assertAlways("Do not support nested arrays in DB for now");
	}
	m_arrayCnt++;
	return 1;
}

/*static*/
int JSonDB::readEndArray()  {
	m_arrayCnt--;
	return 1;
}

s32	 JSonDB::addField(const unsigned char* str, s32 strLen) {
	klb_assert((m_stringAlloc + strLen+1) < DB_MAX_STRING_POOL_SIZE, "Field Name String pool too small.");
	memcpy(&m_stringBuffer[m_stringAlloc], str, strLen);
	m_fieldName[m_recordEntry] = (u16)m_stringAlloc;
	m_stringBuffer[m_stringAlloc + strLen] = 0; // End string.
	m_stringAlloc += strLen + 1;
	return m_recordEntry;
}

void JSonDB::setFieldType	(s32 field, u8 type) {
	klb_assert(((u32)field) < MAX_FIELD_PER_RECORD, "Invalid field index");
	m_fieldType[field] = type;
}

bool JSonDB::allocateRecord	() {
	if (m_record != 0) {
		RecordListHeader* pRecord = (RecordListHeader*)KLBNEWA(u8, sizeof(RecordListHeader) + 4 + (m_recordEntry * sizeof(Field)));
		if (pRecord) {
			// Init new record.
			pRecord->pNextRecord	= NULL;
			pRecord->fields			= (Field*)&pRecord[1];	// Trick : use field after record header in memory.

			// Connect to link list and go to next element.
			m_currRecord->pNextRecord	= pRecord;
			m_currRecord				= pRecord;
		} else {
			return false;
		}
	} else {
		m_currRecord = &m_baseRecordHeader;
	}
	return true;
}

void JSonDB::copyFromTempToRecord() {
	// Move data to first allocated record
	memcpy(m_currRecord->fields, this->m_field,m_recordEntry * sizeof(Field));
}

void JSonDB::setInt			(s32 idx, s32 value) {
	klb_assert(m_fieldType[idx]==TYPE_INT,"Type does not match");
	klb_assert(((u32)idx) < m_recordEntry, "Field index out of range");
	m_currRecord->fields[idx].v.i = value;
}

void JSonDB::setFloat		(s32 idx, float value) {
	klb_assert(m_fieldType[idx]==TYPE_FLOAT,"Type does not match");
	klb_assert(((u32)idx) < m_recordEntry, "Field index out of range");
	m_currRecord->fields[idx].v.f = value;
}

void JSonDB::setBool		(s32 idx, s32 value) {
	klb_assert(m_fieldType[idx]==TYPE_BOOL,"Type does not match");
	klb_assert(((u32)idx) < m_recordEntry, "Field index out of range");
	m_currRecord->fields[idx].v.b = value ? true : false;
}

s32 JSonDB::getTotalRecordCount		() {
	return m_record;
}

s32 JSonDB::getCurrentRecordCount	() {
	return m_record;
}

bool JSonDB::fetchRecords			(u32 /*count*/) {
	// All fetched
	return true;
}

bool JSonDB::receivedUpdate			() {
	// Data always available
	return true;
}

const char*	JSonDB::getFieldName(u32 index, u32& len) {
	klb_assert(index < m_recordEntry, "Field index out of range");
	len = strlen(&m_stringBuffer[m_fieldName[index]]);
	return &m_stringBuffer[m_fieldName[index]];
}

s32 JSonDB::getFieldID(const unsigned char* str, s32 strLen) {
	klb_assert((m_stringAlloc + strLen+1) < DB_MAX_STRING_POOL_SIZE, "Field Name String pool too small for temp usage.");

	// Copy and create temp string (do NOT modify m_stringAlloc : no allocation really done)
	memcpy(&m_stringBuffer[m_stringAlloc], str, strLen);
	m_stringBuffer[m_stringAlloc + strLen] = 0; // End string.

	return this->getFieldIndex(&m_stringBuffer[m_stringAlloc]);
}

void JSonDB::setString		(s32 idx, const unsigned char* str, s32 strLen) {
	klb_assert(m_fieldType[idx]==TYPE_STR,"Type does not match");
	klb_assert(((u32)idx) < m_recordEntry, "Field index out of range");
	klb_assert((mStringRecordCount+strLen) < m_StringRecordBufferSize, "String buffer full");

	if (str && strLen) {
		memcpy(&mStringRecordBuffer[mStringRecordCount], str, strLen);
		mStringRecordBuffer[mStringRecordCount + strLen] = 0; // End string.

		m_currRecord->fields[idx].v.str = mStringRecordCount;
		mStringRecordCount += strLen + 1;
	} else {
		m_currRecord->fields[idx].v.str = -1;
	}
}

const char*	JSonDB::getAsString	(IDataRecord rec, u32 index, u32& len) {
	klb_assert(m_fieldType[index]==TYPE_STR,"Type does not match");
	klb_assert(index < m_recordEntry, "Field index out of range");
	RecordListHeader* pRecord = (RecordListHeader*)rec;
	const char* res;
	if (pRecord->fields[index].v.str != -1) {
		res = &mStringRecordBuffer[pRecord->fields[index].v.str];
		len = strlen(res);
	} else {
		res = NULL;
		len = 0;
	}
	return res;
}

EMOVECODE JSonDB::moveTo(u32 rec) {
	RecordListHeader* p = m_startRecord;
	u32 counter = 0;
	while (p) {
		if (counter == rec) {
			m_res			= MOVE_SUCCEED;
			m_recordPtr		= p;
			m_currRecIdx	= rec;
			return m_res;
		}
	}

	m_res		= MOVE_EOF;
	m_recordPtr = p;
	m_currRecIdx= m_record;
	return m_res;
}

EMOVECODE JSonDB::moveNext() {
	if (m_currRecIdx < m_record) {
		m_currRecIdx++;
		m_recordPtr = m_recordPtr->pNextRecord;
	} else {
		m_recordPtr = NULL;
	}

	m_res = (m_recordPtr != NULL) ? MOVE_SUCCEED : MOVE_EOF;
	return m_res;
}

EMOVECODE JSonDB::movePrevious() {
	if (m_currRecIdx > 0) {
		m_currRecIdx--;
		moveTo(m_currRecIdx);
	} else {
		m_recordPtr = NULL;
	}
	m_res = (m_recordPtr != NULL) ? MOVE_SUCCEED : MOVE_EOF;
	return m_res;
}

IDataRecord JSonDB::getRecord() {
	if (m_res == MOVE_SUCCEED) {
		return (IDataRecord)m_recordPtr;
	} else {
		return NULL;
	}
}

u32	JSonDB::getFieldCount() {
	return this->m_recordEntry;
}

u32	JSonDB::getFieldType(u32 index) {
	klb_assert(((u32)index) < MAX_FIELD_PER_RECORD, "Invalid field index");
	return m_fieldType[index];
}

u32	JSonDB::getFieldIndex(const char* fieldName) {
	for (u32 idx = 0; idx < m_recordEntry; idx++) {
		if (strcmp(fieldName, &this->m_stringBuffer[m_fieldName[idx]]) == 0) {
			return idx;
		}
	}
	return 0xFFFFFFFF;
}

s32	JSonDB::getAsInt		(IDataRecord rec, u32 index) {
	klb_assert(m_fieldType[index]==TYPE_INT,"Type does not match");
	klb_assert(index < m_recordEntry, "Field index out of range");
	RecordListHeader* pRecord = (RecordListHeader*)rec;
	return pRecord->fields[index].v.i;
}

bool JSonDB::getAsBool		(IDataRecord rec, u32 index) {
	klb_assert(m_fieldType[index]==TYPE_BOOL,"Type does not match");
	klb_assert(index < m_recordEntry, "Field index out of range");
	RecordListHeader* pRecord = (RecordListHeader*)rec;
	return pRecord->fields[index].v.b;
}

float JSonDB::getAsFloat	(IDataRecord rec, u32 index) {
	klb_assert(m_fieldType[index]==TYPE_FLOAT,"Type does not match");
	klb_assert(index < m_recordEntry, "Field index out of range");
	RecordListHeader* pRecord = (RecordListHeader*)rec;
	return pRecord->fields[index].v.f;
}

/*
static const char* testStr = "[ { \"hello\": 1, \"valuebool\": true, \"nilfield\": null, \"strfield\": \"hello world\" }, { \"hello\": 2, \"valuebool\": false, \"nilfield\": \"string guys\", \"strfield\": \"hello world 2\" } ]";

class DInitializer {
public:
	DInitializer();
};

// Global variable force constructor exec.
DInitializer _gInit;

DInitializer::DInitializer() {
	IDataSource* pDBObj = JSonDB::openDB((const u8*)testStr, strlen(testStr));
}
*/


text:
import $ from "jquery";
import registry from "@patternslib/patternslib/src/core/registry";
import utils from "../../core/utils";
import Modal from "../modal/modal";
import Base from "@patternslib/patternslib/src/core/base";

export default class ConfigRegistry {
    constructor(el) {
        this.el = el;
    }
    loadModals() {
        $(".recordsEditLink").each(function () {
            var $el = $(this);
            var options = {
                actionOptions: {
                    onSuccess: function (modal) {
                        modal.hide();
                        $("#searchrow form#registry-filter").trigger("submit");
                    },
                },
            };
            $el.addClass("pat-modal");
            let modal_obj = new Modal($el, options);
        });
    }

    init() {
        var self = this;
        self.loadModals();
        $("#recordsContainer").on("click", "[type='reset']", function () {
            document.querySelector('#searchrow input[name="q"]').value = "";
            document
                .querySelector("#searchrow form#registry-filter button[type='submit']")
                .click();
        });
        /* ajax retrieval of paging */
        $("#recordsContainer").on(
            "click",
            "nav.pagination a, div.listingBar a",
            function () {
                var $el = $(this);
                utils.loading.show();
                $("#recordsContainer").load(
                    $el.attr("href") + " #recordsTable",
                    function () {
                        /* scan registry */
                        registry.scan($("#recordsTable"));
                        self.loadModals();
                        utils.loading.hide();
                    }
                );
                return false;
            }
        );

        /* ajax form submission */
        $("#recordsContainer").on("submit", "#searchrow form", function (e) {
            var $el = $(this);
            utils.loading.show();
            $("#recordsContainer").load(
                $("body").attr("data-base-url") +
                    "?" +
                    $el.serialize() +
                    " #recordsTable",
                function () {
                    $("#spinner").hide();
                    $('#searchrow input[name="q"]').trigger("keypress");
                    registry.scan($("#recordsTable"));
                    self.loadModals();
                    utils.loading.hide();
                }
            );
            e.preventDefault();
            return false;
        });

        /* force submit on select change */
        $("#recordsContainer").on("change", "#searchrow select", function () {
            $("#searchrow form#registry-filter").trigger("submit");
        });

        /* some init */
        $('#searchrow input[name="q"]').trigger("keypress");
    }
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_Object2689449295.h"

// Mono.Globalization.Unicode.Level2MapComparer
struct Level2MapComparer_t914717527;

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// Mono.Globalization.Unicode.Level2MapComparer
struct  Level2MapComparer_t914717527  : public Il2CppObject
{
public:

public:
};

struct Level2MapComparer_t914717527_StaticFields
{
public:
	// Mono.Globalization.Unicode.Level2MapComparer Mono.Globalization.Unicode.Level2MapComparer::Instance
	Level2MapComparer_t914717527 * ___Instance_0;

public:
	inline static int32_t get_offset_of_Instance_0() { return static_cast<int32_t>(offsetof(Level2MapComparer_t914717527_StaticFields, ___Instance_0)); }
	inline Level2MapComparer_t914717527 * get_Instance_0() const { return ___Instance_0; }
	inline Level2MapComparer_t914717527 ** get_address_of_Instance_0() { return &___Instance_0; }
	inline void set_Instance_0(Level2MapComparer_t914717527 * value)
	{
		___Instance_0 = value;
		Il2CppCodeGenWriteBarrier(&___Instance_0, value);
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
namespace ui {

class UI_EXPORT ScopedOleInitializer {
 public:
  ScopedOleInitializer();
  ~ScopedOleInitializer();

 private:
#ifndef NDEBUG
  // In debug builds we use this variable to catch a potential bug where a
  // ScopedOleInitializer instance is deleted on a different thread than it
  // was initially created on.  If that ever happens it can have bad
  // consequences and the cause can be tricky to track down.
  DWORD thread_id_;
#endif
  HRESULT hr_;

  DISALLOW_COPY_AND_ASSIGN(ScopedOleInitializer);
};

}  // namespace

#endif  // UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_


text:
title: Error::backtrace — Eregansu Framework
package: framework
packageTitle: Eregansu Framework
layout: default
className: Error
type: method
---

# Error::backtrace

## Synopsis

uses('error');

public static function Error::backtrace($backtrace = null)

## Parameters

      Name
      Direction
      Type
      Description

      $backtrace