text:
Install dependencies:

    # yum install perl-devel 'perl(ExtUtils::Embed)'

Compile the wrapper:

    # gcc -o cwrapper_perl cwrapper_perl.c `perl -MExtUtils::Embed -e ccopts -e ldopts`

Create a fatpack: https://github.com/centreon/centreon-plugins/blob/master/docs/en/user/guide.rst#can-i-have-one-standalone-perl-file-

Comment following lines in the end of fatpack file:

    use strict;
    use warnings;
    # Not perl embedded compliant at all
    #use FindBin;
    #use lib "$FindBin::Bin";
    # use lib '/usr/lib/nagios/plugins/';

    use centreon::plugins::script;

    centreon::plugins::script->new()->run();

Set setuid right:

    # chown root:root cwrapper_perl
    # chmod 4775 cwrapper_perl

Test it:

    $ cwrapper_perl centreon_protocol_udp.pl --plugin --mode=connection --hostname=10.30.2.65 --port=161


text:
'use strict';

import { TPromise } from 'vs/base/common/winjs.base';
import { isFalsyOrEmpty } from 'vs/base/common/arrays';
import { MainThreadDiaglogsShape, MainContext, IExtHostContext, MainThreadDialogOpenOptions, MainThreadDialogSaveOptions } from '../node/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IWindowService } from 'vs/platform/windows/common/windows';
import { forEach } from 'vs/base/common/collections';

@extHostNamedCustomer(MainContext.MainThreadDialogs)
export class MainThreadDialogs implements MainThreadDiaglogsShape {

	constructor(
		context: IExtHostContext,
		@IWindowService private readonly _windowService: IWindowService
	) {
		//
	}

	dispose(): void {
		//
	}

	$showOpenDialog(options: MainThreadDialogOpenOptions): TPromise<string[]> {
		// TODO@joh what about remote dev setup?
		if (options.defaultUri && options.defaultUri.scheme !== 'file') {
			return TPromise.wrapError(new Error('Not supported - Open-dialogs can only be opened on `file`-uris.'));
		}
		return new TPromise<string[]>(resolve => {
			this._windowService.showOpenDialog(
				MainThreadDialogs._convertOpenOptions(options),
				filenames => resolve(isFalsyOrEmpty(filenames) ? undefined : filenames)
			);
		});
	}

	$showSaveDialog(options: MainThreadDialogSaveOptions): TPromise<string> {
		// TODO@joh what about remote dev setup?
		if (options.defaultUri && options.defaultUri.scheme !== 'file') {
			return TPromise.wrapError(new Error('Not supported - Save-dialogs can only be opened on `file`-uris.'));
		}
		return new TPromise<string>(resolve => {
			this._windowService.showSaveDialog(
				MainThreadDialogs._convertSaveOptions(options),
				filename => resolve(!filename ? undefined : filename)
			);
		});
	}

	private static _convertOpenOptions(options: MainThreadDialogOpenOptions): Electron.OpenDialogOptions {
		const result: Electron.OpenDialogOptions = {
			properties: ['createDirectory']
		};
		if (options.openLabel) {
			result.buttonLabel = options.openLabel;
		}
		if (options.defaultUri) {
			result.defaultPath = options.defaultUri.fsPath;
		}
		if (!options.canSelectFiles && !options.canSelectFolders) {
			options.canSelectFiles = true;
		}
		if (options.canSelectFiles) {
			result.properties.push('openFile');
		}
		if (options.canSelectFolders) {
			result.properties.push('openDirectory');
		}
		if (options.canSelectMany) {
			result.properties.push('multiSelections');
		}
		if (options.filters) {
			result.filters = [];
			forEach(options.filters, entry => result.filters.push({ name: entry.key, extensions: entry.value }));
		}
		return result;
	}

	private static _convertSaveOptions(options: MainThreadDialogSaveOptions): Electron.SaveDialogOptions {
		const result: Electron.SaveDialogOptions = {

		};
		if (options.defaultUri) {
			result.defaultPath = options.defaultUri.fsPath;
		}
		if (options.saveLabel) {
			result.buttonLabel = options.saveLabel;
		}
		if (options.filters) {
			result.filters = [];
			forEach(options.filters, entry => result.filters.push({ name: entry.key, extensions: entry.value }));
		}
		return result;
	}
}

redpajama_set_name: RedPajamaGithub


text:
class Permission < RouteAuthorizer::Permission

  # Users can access all actions of HomeController
  # all_roles do
  #   permit :home
  # end

  # Admin can access all controllers and actions
  # role :admin do
  #   permit_all
  # end

  # Staff can access all actions of ProductsController
  # role :staff do
  #   permit :products
  # end

  # Customer can access all actions of OrdersController and just actions Index and Show of ProductsController
  # role :customer do
  #   permit :orders
  #   permit :products, only: [:index, :show]
  # end

end


text:
.class Lcom/android/internal/telephony/gsm/GsmConnection$MyHandler;
.super Landroid/os/Handler;
.source "GsmConnection.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/telephony/gsm/GsmConnection;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "MyHandler"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/internal/telephony/gsm/GsmConnection;

# direct methods
.method constructor <init>(Lcom/android/internal/telephony/gsm/GsmConnection;Landroid/os/Looper;)V
    .locals 0
    .parameter
    .parameter "l"

    .prologue
    .line 131
    iput-object p1, p0, Lcom/android/internal/telephony/gsm/GsmConnection$MyHandler;->this$0:Lcom/android/internal/telephony/gsm/GsmConnection;

    invoke-direct {p0, p2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    return-void
.end method

# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 2
    .parameter "msg"

    .prologue
    .line 136
    iget v0, p1, Landroid/os/Message;->what:I

    packed-switch v0, :pswitch_data_0

    .line 153
    :goto_0
    return-void

    .line 142
    :pswitch_0
    iget v0, p1, Landroid/os/Message;->what:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    .line 143
    iget-object v0, p0, Lcom/android/internal/telephony/gsm/GsmConnection$MyHandler;->this$0:Lcom/android/internal/telephony/gsm/GsmConnection;

    invoke-virtual {v0}, Lcom/android/internal/telephony/gsm/GsmConnection;->stopTone()V

    .line 147
    :cond_0
    iget-object v0, p0, Lcom/android/internal/telephony/gsm/GsmConnection$MyHandler;->this$0:Lcom/android/internal/telephony/gsm/GsmConnection;

    #calls: Lcom/android/internal/telephony/gsm/GsmConnection;->processNextPostDialChar()V
    invoke-static {v0}, Lcom/android/internal/telephony/gsm/GsmConnection;->access$000(Lcom/android/internal/telephony/gsm/GsmConnection;)V

    goto :goto_0

    .line 150
    :pswitch_1
    iget-object v0, p0, Lcom/android/internal/telephony/gsm/GsmConnection$MyHandler;->this$0:Lcom/android/internal/telephony/gsm/GsmConnection;

    #calls: Lcom/android/internal/telephony/gsm/GsmConnection;->releaseWakeLock()V
    invoke-static {v0}, Lcom/android/internal/telephony/gsm/GsmConnection;->access$100(Lcom/android/internal/telephony/gsm/GsmConnection;)V

    goto :goto_0

    .line 136
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method


text:
LocationBarSeparatorView::LocationBarSeparatorView()
    : separator_color_(SK_ColorBLACK) {
}

LocationBarSeparatorView::~LocationBarSeparatorView() {
}

gfx::Size LocationBarSeparatorView::GetPreferredSize() {
  // Height doesn't matter.
  return gfx::Size(1, 0);
}

void LocationBarSeparatorView::OnPaint(gfx::Canvas* canvas) {
  // Note that views::Border::CreateSolidSidedBorder is not used because it
  // paints a 2-px thick border in retina display, whereas we want a 1-px thick
  // vertical line in both regular and retina displays.
  SkPaint paint;
  paint.setAntiAlias(false);
  paint.setStrokeWidth(0);
  paint.setColor(separator_color_);
  canvas->DrawLine(gfx::Point(0, 0), gfx::Point(0, height()), paint);
}


text:
#ifndef VIDEO_H
#define VIDEO_H

#include <types.h>
#include <multiboot.h>

extern void int32(uint8_t intnum, regs16_t *regs);

void video_init(int h, int w);
void printk(char *buffer, ...);
void printk_string(char *buffer);
void check();
void scroll();
void clear();
void vbe_init(multiboot_info_t *info);
void refresh_screen();
void draw_pixel(int x, int y, uint32_t color);
void draw_rect(int x, int y, int w, int h, uint32_t color);
void draw_string(int x, int y, char *string);
void draw_char(int x, int y, char *font_char);
int is_text_mode();

struct video_mem {
    int heigth;
    int width;
    uint16_t *ram;
};

struct vbe_mem {
    uint32_t buffer_size;
    uint32_t *mem;
    uint32_t *buffer;
    uint16_t xres;
    uint16_t yres;
    uint8_t bpp;
    uint16_t pitch;
};

typedef struct vbe_controller_info {
    uint8_t signature[4];      // "VESA"
    uint16_t version;          // Either 0x0200 (VBE 2.0) or 0x0300 (VBE 3.0)
    uint32_t oem_string;       // Far pointer to OEM name
    uint8_t capabilities[4];   // capabilities
    uint32_t video_modes_ptr;  // Far pointer to video mode list
    uint16_t total_memory;     // Memory size in 64K blocks
    uint16_t oem_software_rev;
    uint32_t oem_vendor_name_ptr;
    uint32_t oem_product_name_ptr;
    uint32_t oem_product_rev_ptr;
    uint8_t reserved[222];
    uint8_t oem_data[256];
} __attribute__((__packed__)) vbe_controller_info_t;

typedef struct vbe_mode_info {
    uint16_t attributes;		// deprecated, only bit 7 should be of interest to you, and it indicates the mode supports a linear frame buffer.
    uint8_t window_a;			// deprecated
    uint8_t window_b;			// deprecated
    uint16_t granularity;		// deprecated; used while calculating bank numbers
    uint16_t window_size;
    uint16_t segment_a;
    uint16_t segment_b;
    uint32_t win_func_ptr;		// deprecated; used to switch banks from protected mode without returning to real mode
    uint16_t pitch;			// number of bytes per horizontal line
    uint16_t width;			// width in pixels
    uint16_t height;			// height in pixels
    uint8_t w_char;			// unused...
    uint8_t y_char;			// ...
    uint8_t planes;
    uint8_t bpp;			// bits per pixel in this mode
    uint8_t banks;			// deprecated; total number of banks in this mode
    uint8_t memory_model;
    uint8_t bank_size;		// deprecated; size of a bank, almost always 64 KB but may be 16 KB...
    uint8_t image_pages;
    uint8_t reserved0;

    uint8_t red_mask;
    uint8_t red_position;
    uint8_t green_mask;
    uint8_t green_position;
    uint8_t blue_mask;
    uint8_t blue_position;
    uint8_t reserved_mask;
    uint8_t reserved_position;
    uint8_t direct_color_attributes;

    uint32_t framebuffer;		// physical address of the linear frame buffer; write here to draw to the screen
    uint32_t off_screen_mem_off;
    uint16_t off_screen_mem_size;	// size of memory in the framebuffer but not being displayed on the screen
    uint8_t reserved1[206];
} __attribute__((packed)) vbe_mode_info_t;

#endif


text:
package com.vityuk.ginger.loader;

import com.vityuk.ginger.PropertyResolver;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.data.MapEntry.entry;

public class PropertiesLocalizationLoaderTest {
    private final LocalizationLoader loader = new PropertiesLocalizationLoader();

    @Test
    public void testLoadWithoutProperties() throws Exception {
        String content = "";

        PropertyResolver propertyResolver = load(content);

        assertThat(propertyResolver).isNotNull();
        assertThat(propertyResolver.getString("")).isNull();
        assertThat(propertyResolver.getStringList("")).isNull();
        assertThat(propertyResolver.getStringMap("")).isNull();
    }

    @Test
    public void testLoadWithoutPropertiesAndWithComments() throws Exception {
        String content = "" +
                "\n" +
                "# Test comment\t  \n" +
                "#\tLine 2\r" +
                "#Line 3\\\r\n" +
                "\t \n" +
                "\n";

        PropertyResolver propertyResolver = load(content);

        assertThat(propertyResolver).isNotNull();
        assertThat(propertyResolver.getString("")).isNull();
        assertThat(propertyResolver.getString("#")).isNull();
    }

    @Test
    public void testLoadSingleProperty() throws Exception {
        String content = "prop=test-value";

        PropertyResolver propertyResolver = load(content);

        assertThat(propertyResolver.getString("prop")).isNotNull().isEqualTo("test-value");
    }

    @Test
    public void testLoadMultipleProperties() throws Exception {
        String content = "" +
                "Truth1 = Beauty1\n" +
                "       Truth2:Beauty2\r" +
                "Truth3                  :Beauty3\r\n" +
                "Truth4 Beauty4\n" +
                "fruits                           apple, banana, pear, \\\n" +
                "                                  cantaloupe, watermelon, \\\r\n" +
                "                                  kiwi, mango";

        PropertyResolver propertyResolver = load(content);

        assertThat(propertyResolver.getString("Truth1")).isNotNull().isEqualTo("Beauty1");
        assertThat(propertyResolver.getString("Truth2")).isNotNull().isEqualTo("Beauty2");
        assertThat(propertyResolver.getString("Truth3")).isNotNull().isEqualTo("Beauty3");
        assertThat(propertyResolver.getString("Truth4")).isNotNull().isEqualTo("Beauty4");
        assertThat(propertyResolver.getString("fruits")).isNotNull().isEqualTo("apple, banana, pear, cantaloupe, watermelon, kiwi, mango");
    }

    @Test
    public void testLoadMultiplePropertiesAndWithComments() throws Exception {
        String content = "" +
                "#Truth1 = Beauty1\n" +
                " #\t Truth2:Beauty2\r" +
                "!Truth3                  :Beauty3\r\n" +
                "fruits#                           apple, banana, pear, \\\n" +
                "#                                  cantaloupe, watermelon, \\\r\n" +
                "                                  kiwi, mango";

        PropertyResolver propertyResolver = load(content);

        assertThat(propertyResolver.getString("#")).isNotNull().isEqualTo("Truth2:Beauty2");
        assertThat(propertyResolver.getString("fruits#")).isNotNull().
                isEqualTo("apple, banana, pear, #                                  cantaloupe, watermelon, kiwi, mango");
    }

    @Test
    public void testLoadListProperties() throws Exception {
        String content = "" +
                "vegetables=potato,squash,carrot,beat\n" +
                "fruits                           apple,  banana\t, pear, \\\n" +
                "                                  cantaloupe, \twatermelon, \\\r\n" +
                "                                  kiwi , mango";

        PropertyResolver propertyResolver = load(content);

        assertThat(propertyResolver.getStringList("vegetables")).isNotNull().hasSize(4).
                containsExactly("potato", "squash", "carrot", "beat");

        assertThat(propertyResolver.getStringList("fruits")).isNotNull().hasSize(7).
                containsExactly("apple", "banana", "pear", "cantaloupe", "watermelon", "kiwi", "mango");
    }

    @Test
    public void testLoadMapProperties() throws Exception {
        String content = "" +
                "weekdays[1]=Sunday\n" +
                "weekdays[2]=Monday\n" +
                "weekdays[3]=Tuesday\n" +
                "weekdays[4]=Wednesday\n" +
                "weekdays[5]=Thursday\n" +
                "weekdays[6]=Friday\n" +
                "weekdays[7]=Saturday\n" +
                "\n" +
                "colors[red]=#FF0000\n" +
                "colors[cyan]=#00FFFF\n" +
                "colors[white]=#FFFFFF\n" +
                "colors[black]=#000000";

        PropertyResolver propertyResolver = load(content);

        assertThat(propertyResolver.getStringMap("weekdays")).isNotNull().hasSize(7).
                contains(entry("1", "Sunday"), entry("2", "Monday"), entry("3", "Tuesday"), entry("4", "Wednesday"),
                        entry("5", "Thursday"), entry("6", "Friday"), entry("7", "Saturday"));

        assertThat(propertyResolver.getStringMap("colors")).isNotNull().hasSize(4).
                contains(entry("red", "#FF0000"), entry("cyan", "#00FFFF"),
                        entry("white", "#FFFFFF"), entry("black", "#000000"));
    }

    private PropertyResolver load(String content) throws IOException {
        InputStream inputStream = new ByteArrayInputStream(content.getBytes());
        return loader.load(inputStream);
    }

}


text:
/*
$("#change").click(function() {
				  $("html").toggleClass("csstransforms");
				 });
$(function() {
            $("#education").organicTabs();
                    });

//for toggle effect
/*function resettoggle() {
var e = document.getElementById('Analyst');
e.style.display = 'none';
}
function resettoggle() {
var e = document.getElementById('Intern');
e.style.display = 'none';
}
function resettoggle() {
var e = document.getElementById('WebDeveloper');
e.style.display = 'none';
}

function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}


text:
<?php

// File generated from our OpenAPI spec

namespace Stripe;

/**
 * Cardholder authentication via 3D Secure is initiated by creating a 3D
 * Secure object. Once the object has been created, you can use it to
 * authenticate the cardholder and create a charge.
 *
 * @property string $id Unique identifier for the object.
 * @property string $object String representing the object's type. Objects of the same type share the same value.
 * @property int $amount Amount of the charge that you will create when authentication completes.
 * @property bool $authenticated True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded.
 * @property \Stripe\Card $card
You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
 * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
 * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
 * @property null|string $redirect_url If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value "_callback".
 * @property string $status Possible values are redirect_pending, succeeded, or failed. When the cardholder can be authenticated, the object starts with status redirect_pending. When liability will be shifted to the cardholder's bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status succeeded. failed indicates that authentication was attempted unsuccessfully.
 */
class ThreeDSecure extends ApiResource
{
    const OBJECT_NAME = 'three_d_secure';

    use ApiOperations\Create;
    use ApiOperations\Retrieve;

    /**
     * @return string the endpoint URL for the given class
     */
    public static function classUrl()
    {
        return '/v1/3d_secure';
    }
}


text:
@interface PMInnerShadowLayer : CAShapeLayer
@property (nonatomic) UIRectEdge edges;
@end

@implementation PMInnerShadowView
{
    PMInnerShadowLayer *_innerShadowLayer;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self PM_commonPMInnerShadowViewInit];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self PM_commonPMInnerShadowViewInit];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _innerShadowLayer.frame = self.layer.bounds;
}

#pragma mark - Accessors

- (UIRectEdge)edges
{
    return _innerShadowLayer.edges;
}

- (void)setEdges:(UIRectEdge)edges
{
    _innerShadowLayer.edges = edges;
}

- (UIColor *)shadowColor
{
    return [UIColor colorWithCGColor:_innerShadowLayer.shadowColor];
}

- (void)setShadowColor:(UIColor *)shadowColor
{
    _innerShadowLayer.shadowColor = shadowColor.CGColor;
}

- (CGFloat)shadowOpacity
{
    return _innerShadowLayer.shadowOpacity;
}

- (void)setShadowOpacity:(CGFloat)shadowOpacity
{
    _innerShadowLayer.shadowOpacity = shadowOpacity;
}

- (CGSize)shadowOffset
{
    return _innerShadowLayer.shadowOffset;
}

- (void)setShadowOffset:(CGSize)shadowOffset
{
    _innerShadowLayer.shadowOffset = shadowOffset;
}

- (CGFloat)shadowRadius
{
    return _innerShadowLayer.shadowRadius;
}

- (void)setShadowRadius:(CGFloat)shadowRadius
{
    _innerShadowLayer.shadowRadius = shadowRadius;
}

- (CGFloat)cornerRadius;
{
    return _innerShadowLayer.cornerRadius;
}

- (void)setCornerRadius:(CGFloat)cornerRadius;
{
    self.layer.cornerRadius = cornerRadius;
    _innerShadowLayer.cornerRadius = cornerRadius;
}

#pragma mark - Private Methods

- (void)PM_commonPMInnerShadowViewInit
{
    NSNull *null = [NSNull null];
    _innerShadowLayer = [PMInnerShadowLayer layer];
    _innerShadowLayer.actions = @{@"position": null,
                                  @"bounds": null,
                                  @"contents": null,
                                  @"shadowColor": null,
                                  @"shadowOpacity": null,
                                  @"shadowOffset": null,
                                  @"shadowRadius": null};
    [self.layer addSublayer:_innerShadowLayer];
    self.layer.masksToBounds = YES;
    self.userInteractionEnabled = NO;
}

@end

@implementation PMInnerShadowLayer

- (id)init
{
    self = [super init];
    if (self) {
        self.masksToBounds = YES;
        self.needsDisplayOnBoundsChange = YES;
        self.shouldRasterize = YES;
        self.shadowColor = [UIColor whiteColor].CGColor;
        self.shadowOffset = CGSizeZero;
        self.shadowOpacity = 1.0f;
        self.shadowRadius = 5;
        self.fillRule = kCAFillRuleEvenOdd;
        self.edges = UIRectEdgeAll;
    }
    return self;
}

- (void)layoutSublayers
{
    [super layoutSublayers];

    CGFloat top = (self.edges & UIRectEdgeTop)? self.shadowRadius : 0.0f;
    CGFloat bottom = (self.edges & UIRectEdgeBottom)? self.shadowRadius : 0.0f;
    CGFloat left = (self.edges & UIRectEdgeLeft)? self.shadowRadius : 0.0f;
    CGFloat right = (self.edges & UIRectEdgeRight)? self.shadowRadius : 0.0f;
    CGRect largerRect = self.bounds;
    largerRect.origin.x -= left;
    largerRect.origin.y -= right;
    largerRect.size.width += left + right;
    largerRect.size.height += top + bottom;

    CGMutablePathRef path = CGPathCreateMutable();
    CGPathAddRect(path, NULL, largerRect);

    UIBezierPath *bezier = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:self.cornerRadius];
    CGPathAddPath(path, NULL, bezier.CGPath);
    CGPathCloseSubpath(path);

    [self setPath:path];
    CGPathRelease(path);
}

#pragma mark - Accessors

- (void)setEdges:(UIRectEdge)edges
{
    _edges = edges;
    [self setNeedsLayout];
}

- (void)setShadowColor:(CGColorRef)shadowColor
{
    [super setShadowColor:shadowColor];
    [self setNeedsLayout];
}

- (void)setShadowOpacity:(float)shadowOpacity
{
    [super setShadowOpacity:shadowOpacity];
    [self setNeedsLayout];
}

- (void)setShadowOffset:(CGSize)shadowOffset
{
    [super setShadowOffset:shadowOffset];
    [self setNeedsLayout];
}

- (void)setShadowRadius:(CGFloat)shadowRadius
{
    [super setShadowRadius:shadowRadius];
    [self setNeedsLayout];
}

- (void)setCornerRadius:(CGFloat)cornerRadius
{
    [super setCornerRadius:cornerRadius];
    [self setNeedsLayout];
}

@end


text:
'use strict';
var $ = require('../internals/export');
var $padStart = require('../internals/string-pad').start;
var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');

// `String.prototype.padStart` method
// https://tc39.es/ecma262/#sec-string.prototype.padstart
$({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
  padStart: function padStart(maxLength /* , fillString = ' ' */) {
    return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  }
});


text:
<?php

namespace Google\Service\VMMigrationService;

class CancelCloneJobResponse extends \Google\Model
{
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(CancelCloneJobResponse::class, 'Google_Service_VMMigrationService_CancelCloneJobResponse');


text:
var Stream = require('stream');
var deepEqual = require('deep-equal');
var defined = require('defined');
var path = require('path');
var inherits = require('util').inherits;
var EventEmitter = require('events').EventEmitter;

module.exports = Test;

var nextTick = typeof setImmediate !== 'undefined'
    ? setImmediate
    : process.nextTick
;

inherits(Test, EventEmitter);

function Test (name_, opts_, cb_) {
    var self = this;
    var name = '(anonymous)';
    var opts = {};
    var cb;

    for (var i = 0; i < arguments.length; i++) {
        switch (typeof arguments[i]) {
            case 'string':
                name = arguments[i];
                break;
            case 'object':
                opts = arguments[i] || opts;
                break;
            case 'function':
                cb = arguments[i];
        }
    }

    this.readable = true;
    this.name = name || '(anonymous)';
    this.assertCount = 0;
    this.pendingCount = 0;
    this._skip = opts.skip || false;
    this._plan = undefined;
    this._cb = cb;
    this._progeny = [];
    this._ok = true;
    this.end = function () {
        return Test.prototype.end.apply(self, arguments);
    };
}

Test.prototype.run = function () {
    if (!this._cb || this._skip) {
        return this._end();
    }
    this.emit('prerun');
    try {
        this._cb(this);
    }
    catch (err) {
        this.error(err);
        this._end();
        return;
    }
    this.emit('run');
};

Test.prototype.test = function (name, opts, cb) {
    var self = this;
    var t = new Test(name, opts, cb);
    this._progeny.push(t);
    this.pendingCount++;
    this.emit('test', t);
    t.on('prerun', function () {
        self.assertCount++;
    })

    if (!self._pendingAsserts()) {
        nextTick(function () {
            self._end();
        });
    }

    nextTick(function() {
        if (!self._plan && self.pendingCount == self._progeny.length) {
            self._end();
        }
    });
};

Test.prototype.comment = function (msg) {
    this.emit('result', msg.trim().replace(/^#\s*/, ''));
};

Test.prototype.plan = function (n) {
    this._plan = n;
    this.emit('plan', n);
};

Test.prototype.end = function (err) {
    var self = this;
    if (arguments.length >= 1) {
        this.ifError(err);
    }

    if (this.calledEnd) {
        this.fail('.end() called twice');
    }
    this.calledEnd = true;
    this._end();
};

Test.prototype._end = function (err) {
    var self = this;
    if (this._progeny.length) {
        var t = this._progeny.shift();
        t.on('end', function () { self._end() });
        t.run();
        return;
    }

    if (!this.ended) this.emit('end');
    var pendingAsserts = this._pendingAsserts();
    if (!this._planError && this._plan !== undefined && pendingAsserts) {
        this._planError = true;
        this.fail('plan != count', {
            expected : this._plan,
            actual : this.assertCount
        });
    }
    this.ended = true;
};

Test.prototype._exit = function () {
    if (this._plan !== undefined &&
        !this._planError && this.assertCount !== this._plan) {
        this._planError = true;
        this.fail('plan != count', {
            expected : this._plan,
            actual : this.assertCount,
            exiting : true
        });
    }
    else if (!this.ended) {
        this.fail('test exited without ending', {
            exiting: true
        });
    }
};

Test.prototype._pendingAsserts = function () {
    if (this._plan === undefined) {
        return 1;
    }
    else {
        return this._plan - (this._progeny.length + this.assertCount);
    }
};

Test.prototype._assert = function assert (ok, opts) {
    var self = this;
    var extra = opts.extra || {};

    var res = {
        id : self.assertCount ++,
        ok : Boolean(ok),
        skip : defined(extra.skip, opts.skip),
        name : defined(extra.message, opts.message, '(unnamed assert)'),
        operator : defined(extra.operator, opts.operator)
    };
    if (has(opts, 'actual') || has(extra, 'actual')) {
        res.actual = defined(extra.actual, opts.actual);
    }
    if (has(opts, 'expected') || has(extra, 'expected')) {
        res.expected = defined(extra.expected, opts.expected);
    }
    this._ok = Boolean(this._ok && ok);

    if (!ok) {
        res.error = defined(extra.error, opts.error, new Error(res.name));
    }

    var e = new Error('exception');
    var err = (e.stack || '').split('\n');
    var dir = path.dirname(__dirname) + '/';

    for (var i = 0; i < err.length; i++) {
        var m = /^\s*\bat\s+(.+)/.exec(err[i]);
        if (!m) continue;

        var s = m[1].split(/\s+/);
        var filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]);
        if (!filem) {
            filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]);

            if (!filem) continue;
        }

        if (filem[1].slice(0, dir.length) === dir) continue;

        res.functionName = s[0];
        res.file = filem[1];
        res.line = Number(filem[2]);
        if (filem[3]) res.column = filem[3];

        res.at = m[1];
        break;
    }

    self.emit('result', res);

    var pendingAsserts = self._pendingAsserts();
    if (!pendingAsserts) {
        if (extra.exiting) {
            self._end();
        } else {
            nextTick(function () {
                self._end();
            });
        }
    }

    if (!self._planError && pendingAsserts < 0) {
        self._planError = true;
        self.fail('plan != count', {
            expected : self._plan,
            actual : self._plan - pendingAsserts
        });
    }
};

Test.prototype.fail = function (msg, extra) {
    this._assert(false, {
        message : msg,
        operator : 'fail',
        extra : extra
    });
};

Test.prototype.pass = function (msg, extra) {
    this._assert(true, {
        message : msg,
        operator : 'pass',
        extra : extra
    });
};

Test.prototype.skip = function (msg, extra) {
    this._assert(true, {
        message : msg,
        operator : 'skip',
        skip : true,
        extra : extra
    });
};

Test.prototype.ok
= Test.prototype['true']
= Test.prototype.assert
= function (value, msg, extra) {
    this._assert(value, {
        message : msg,
        operator : 'ok',
        expected : true,
        actual : value,
        extra : extra
    });
};

Test.prototype.notOk
= Test.prototype['false']
= Test.prototype.notok
= function (value, msg, extra) {
    this._assert(!value, {
        message : msg,
        operator : 'notOk',
        expected : false,
        actual : value,
        extra : extra
    });
};

Test.prototype.error
= Test.prototype.ifError
= Test.prototype.ifErr
= Test.prototype.iferror
= function (err, msg, extra) {
    this._assert(!err, {
        message : defined(msg, String(err)),
        operator : 'error',
        actual : err,
        extra : extra
    });
};

Test.prototype.equal
= Test.prototype.equals
= Test.prototype.isEqual
= Test.prototype.is
= Test.prototype.strictEqual
= Test.prototype.strictEquals
= function (a, b, msg, extra) {
    this._assert(a === b, {
        message : defined(msg, 'should be equal'),
        operator : 'equal',
        actual : a,
        expected : b,
        extra : extra
    });
};

Test.prototype.notEqual
= Test.prototype.notEquals
= Test.prototype.notStrictEqual
= Test.prototype.notStrictEquals
= Test.prototype.isNotEqual
= Test.prototype.isNot
= Test.prototype.not
= Test.prototype.doesNotEqual
= Test.prototype.isInequal
= function (a, b, msg, extra) {
    this._assert(a !== b, {
        message : defined(msg, 'should not be equal'),
        operator : 'notEqual',
        actual : a,
        notExpected : b,
        extra : extra
    });
};

Test.prototype.deepEqual
= Test.prototype.deepEquals
= Test.prototype.isEquivalent
= Test.prototype.same
= function (a, b, msg, extra) {
    this._assert(deepEqual(a, b, { strict: true }), {
        message : defined(msg, 'should be equivalent'),
        operator : 'deepEqual',
        actual : a,
        expected : b,
        extra : extra
    });
};

Test.prototype.deepLooseEqual
= Test.prototype.looseEqual
= Test.prototype.looseEquals
= function (a, b, msg, extra) {
    this._assert(deepEqual(a, b), {
        message : defined(msg, 'should be equivalent'),
        operator : 'deepLooseEqual',
        actual : a,
        expected : b,
        extra : extra
    });
};

Test.prototype.notDeepEqual
= Test.prototype.notEquivalent
= Test.prototype.notDeeply
= Test.prototype.notSame
= Test.prototype.isNotDeepEqual
= Test.prototype.isNotDeeply
= Test.prototype.isNotEquivalent
= Test.prototype.isInequivalent
= function (a, b, msg, extra) {
    this._assert(!deepEqual(a, b, { strict: true }), {
        message : defined(msg, 'should not be equivalent'),
        operator : 'notDeepEqual',
        actual : a,
        notExpected : b,
        extra : extra
    });
};

Test.prototype.notDeepLooseEqual
= Test.prototype.notLooseEqual
= Test.prototype.notLooseEquals
= function (a, b, msg, extra) {
    this._assert(deepEqual(a, b), {
        message : defined(msg, 'should be equivalent'),
        operator : 'notDeepLooseEqual',
        actual : a,
        expected : b,
        extra : extra
    });
};

Test.prototype['throws'] = function (fn, expected, msg, extra) {
    if (typeof expected === 'string') {
        msg = expected;
        expected = undefined;
    }
    var caught = undefined;
    try {
        fn();
    }
    catch (err) {
        caught = { error : err };
        var message = err.message;
        delete err.message;
        err.message = message;
    }

    var passed = caught;

    if (expected instanceof RegExp) {
        passed = expected.test(caught && caught.error);
        expected = String(expected);
    }

    this._assert(passed, {
        message : defined(msg, 'should throw'),
        operator : 'throws',
        actual : caught && caught.error,
        expected : expected,
        error: !passed && caught && caught.error,
        extra : extra
    });
};

Test.prototype.doesNotThrow = function (fn, expected, msg, extra) {
    if (typeof expected === 'string') {
        msg = expected;
        expected = undefined;
    }
    var caught = undefined;
    try {
        fn();
    }
    catch (err) {
        caught = { error : err };
    }
    this._assert(!caught, {
        message : defined(msg, 'should not throw'),
        operator : 'throws',
        actual : caught && caught.error,
        expected : expected,
        error : caught && caught.error,
        extra : extra
    });
};

function has (obj, prop) {
    return Object.prototype.hasOwnProperty.call(obj, prop);
}

// vim: set softtabstop=4 shiftwidth=4:


text:
          A creative design & development studio that loves to build great user experiences. We help our clients craft sites, apps and playful games on the web.

          14islands is based in Stockholm, Sweden and was founded in 2011.

          Say hello

            Blog

            Instagram

            Twitter

            Facebook

            Codepen

            Join Us

			{% include svgs/logo/logo-new-full.min.svg %}


text:
NSString *const FBSDKUserAgeRangeMinCodingKey = @"FBSDKUserAgeRangeMinCodingKey";
NSString *const FBSDKUserAgeRangeMaxCodingKey = @"FBSDKUserAgeRangeMaxCodingKey";

@implementation FBSDKUserAgeRange

- (instancetype)initMin:(NSNumber *)min
                    max:(NSNumber *)max
{
  if (self = [super init]) {
    _min = min;
    _max = max;
  }

  return self;
}

+ (instancetype)ageRangeFromDictionary:(NSDictionary *)dictionary
{
  if (![FBSDKTypeUtility dictionaryValue:dictionary]) {
    return nil;
  }

  NSNumber *min = [FBSDKTypeUtility numberValue:dictionary[@"min"]];
  NSNumber *max = [FBSDKTypeUtility numberValue:dictionary[@"max"]];

  if ((min == nil && max == nil)
      || (min != nil && min.longValue < 0)
      || (max != nil && max.longValue < 0)
      || (min != nil && max != nil && min.longValue >= max.longValue)) {
    return nil;
  }

  return [[FBSDKUserAgeRange alloc] initMin:min max:max];
}

#pragma mark - Equality

- (NSUInteger)hash
{
  NSUInteger subhashes[] = {
    _min.hash,
    _max.hash,
  };
  return [FBSDKMath hashWithIntegerArray:subhashes count:sizeof(subhashes) / sizeof(subhashes[0])];
}

- (BOOL)isEqual:(id)object
{
  if (self == object) {
    return YES;
  }
  if (![object isKindOfClass:[FBSDKUserAgeRange class]]) {
    return NO;
  }
  return [self isEqualToUserAgeRange:object];
}

- (BOOL)isEqualToUserAgeRange:(FBSDKUserAgeRange *)ageRange
{
  return (_max == ageRange.max) && (_min == ageRange.min);
}

#pragma mark - NSCopying

- (id)copyWithZone:(NSZone *)zone
{
  // we're immutable.
  return self;
}

#pragma mark NSCoding
+ (BOOL)supportsSecureCoding
{
  return YES;
}

- (void)encodeWithCoder:(nonnull NSCoder *)coder
{
  [coder encodeObject:_min forKey:FBSDKUserAgeRangeMinCodingKey];
  [coder encodeObject:_max forKey:FBSDKUserAgeRangeMaxCodingKey];
}

- (instancetype)initWithCoder:(nonnull NSCoder *)coder
{
  NSNumber *min = [coder decodeObjectOfClass:NSNumber.class forKey:FBSDKUserAgeRangeMinCodingKey];
  NSNumber *max = [coder decodeObjectOfClass:NSNumber.class forKey:FBSDKUserAgeRangeMaxCodingKey];

  return [self initMin:min max:max];
}

@end


text:
    SANITIZER_OPENBSD || SANITIZER_SOLARIS
#include "sanitizer_common.h"
#include "sanitizer_internal_defs.h"
#include "sanitizer_platform_limits_freebsd.h"
#include "sanitizer_platform_limits_netbsd.h"
#include "sanitizer_platform_limits_openbsd.h"
#include "sanitizer_platform_limits_posix.h"
#include "sanitizer_platform_limits_solaris.h"
#include "sanitizer_posix.h"

struct link_map;  // Opaque type returned by dlopen().

namespace __sanitizer {
// Dirent structure for getdents(). Note that this structure is different from
// the one in <dirent.h>, which is used by readdir().
struct linux_dirent;

struct ProcSelfMapsBuff {
  char *data;
  uptr mmaped_size;
  uptr len;
};

struct MemoryMappingLayoutData {
  ProcSelfMapsBuff proc_self_maps;
  const char *current;
};

void ReadProcMaps(ProcSelfMapsBuff *proc_maps);

// Syscall wrappers.
uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
uptr internal_sigaltstack(const void* ss, void* oss);
uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
    __sanitizer_sigset_t *oldset);
uptr internal_clock_gettime(__sanitizer_clockid_t clk_id, void *tp);

// Linux-only syscalls.
#if SANITIZER_LINUX
uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
// Used only by sanitizer_stoptheworld. Signal handlers that are actually used
// (like the process-wide error reporting SEGV handler) must use
// internal_sigaction instead.
int internal_sigaction_norestorer(int signum, const void *act, void *oldact);
void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
#if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) \
  || defined(__powerpc64__) || defined(__s390__) || defined(__i386__) \
  || defined(__arm__)
uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
                    int *parent_tidptr, void *newtls, int *child_tidptr);
#endif
#elif SANITIZER_FREEBSD
void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
#elif SANITIZER_NETBSD
void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg);
#endif  // SANITIZER_LINUX

// This class reads thread IDs from /proc/<pid>/task using only syscalls.
class ThreadLister {
 public:
  explicit ThreadLister(pid_t pid);
  ~ThreadLister();
  enum Result {
    Error,
    Incomplete,
    Ok,
  };
  Result ListThreads(InternalMmapVector<tid_t> *threads);

 private:
  bool IsAlive(int tid);

  pid_t pid_;
  int descriptor_ = -1;
  InternalMmapVector<char> buffer_;
};

// Exposed for testing.
uptr ThreadDescriptorSize();
uptr ThreadSelf();
uptr ThreadSelfOffset();

// Matches a library's file name against a base name (stripping path and version
// information).
bool LibraryNameIs(const char *full_name, const char *base_name);

// Call cb for each region mapped by map.
void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr));

// Releases memory pages entirely within the [beg, end] address range.
// The pages no longer count toward RSS; reads are guaranteed to return 0.
// Requires (but does not verify!) that pages are MAP_PRIVATE.
INLINE void ReleaseMemoryPagesToOSAndZeroFill(uptr beg, uptr end) {
  // man madvise on Linux promises zero-fill for anonymous private pages.
  // Testing shows the same behaviour for private (but not anonymous) mappings
  // of shm_open() files, as long as the underlying file is untouched.
  CHECK(SANITIZER_LINUX);
  ReleaseMemoryPagesToOS(beg, end);
}

#if SANITIZER_ANDROID

#if defined(__aarch64__)
# define __get_tls() \
    ({ void** __v; __asm__("mrs %0, tpidr_el0" : "=r"(__v)); __v; })
#elif defined(__arm__)
# define __get_tls() \
    ({ void** __v; __asm__("mrc p15, 0, %0, c13, c0, 3" : "=r"(__v)); __v; })
#elif defined(__mips__)
// On mips32r1, this goes via a kernel illegal instruction trap that's
// optimized for v1.
# define __get_tls() \
    ({ register void** __v asm("v1"); \
       __asm__(".set    push\n" \
               ".set    mips32r2\n" \
               "rdhwr   %0,$29\n" \
               ".set    pop\n" : "=r"(__v)); \
       __v; })
#elif defined(__i386__)
# define __get_tls() \
    ({ void** __v; __asm__("movl %%gs:0, %0" : "=r"(__v)); __v; })
#elif defined(__x86_64__)
# define __get_tls() \
    ({ void** __v; __asm__("mov %%fs:0, %0" : "=r"(__v)); __v; })
#else
#error "Unsupported architecture."
#endif

// The Android Bionic team has allocated a TLS slot for sanitizers starting
// with Q, given that Android currently doesn't support ELF TLS. It is used to
// store sanitizer thread specific data.
static const int TLS_SLOT_SANITIZER = 6;

ALWAYS_INLINE uptr *get_android_tls_ptr() {
  return reinterpret_cast<uptr *>(&__get_tls()[TLS_SLOT_SANITIZER]);
}

#endif  // SANITIZER_ANDROID

}  // namespace __sanitizer

#endif
#endif  // SANITIZER_LINUX_H


text:
using System;
using Azure.Core.TestFramework;

namespace Azure.Monitor.Query.Tests
{
    public class MonitorQueryTestEnvironment : TestEnvironment
    {
        public string WorkspaceId => GetRecordedVariable("WORKSPACE_ID");
        public string SecondaryWorkspaceId => GetRecordedVariable("SECONDARY_WORKSPACE_ID");
        public string WorkspaceKey => GetRecordedVariable("WORKSPACE_KEY", options => options.IsSecret(SanitizedValue.Base64));
        public string SecondaryWorkspaceKey => GetRecordedVariable("SECONDARY_WORKSPACE_KEY", options => options.IsSecret(SanitizedValue.Base64));
        public string MetricsResource => GetRecordedVariable("METRICS_RESOURCE_ID");
        public string MetricsNamespace => GetRecordedVariable("METRICS_RESOURCE_NAMESPACE");
        public string MonitorIngestionEndpoint => GetOptionalVariable("METRICS_INGEST_SUFFIX") ?? "ods.opinsights.azure.com";
        public string MetricsIngestionEndpoint => GetOptionalVariable("METRICS_INGEST_SUFFIX") ?? "monitoring.azure.com";
        public Uri LogsEndpoint => new(GetRecordedVariable("LOGS_ENDPOINT"));
        public Uri MetricsEndpoint => new(ResourceManagerUrl);
    }
}


text:
import sys
import os
import re

def is_guid(dir_name):
	return re.match(r"[\da-fA-F]+-[\da-fA-F]+-[\da-fA-F]+-[\da-fA-F]+-[\da-fA-F]+", dir_name)

def is_apple_plist(file_name):
	return re.match(r"com.apple.[^.]+.plist", file_name)

def main():
	# iOS7: /var/mobile/Applications/<GUID>/Library/Preferences/<BundleId>.plist
	# iOS8: /var/mobile/Containers/Data/Application/<GUID>/Library/Preferences/<BundleId>.plist
	AppRoot = "/var/mobile/Applications/"
	if (not os.path.isdir(AppRoot)):
		AppRoot = "/var/mobile/Containers/Data/Application/"

	for d in os.listdir(AppRoot):
		if (os.path.isdir(AppRoot+d) and is_guid(d)):
			path = "%s%s/Library/Preferences/" % (AppRoot, d)
			for f in os.listdir(path):
				if (not is_apple_plist(f)):
					filename = "%s%s" % (path, f)
					print ">>> %s" % f
					os.system("plutil %s" % (filename))
					print " "

main()


text:
<?php
namespace canis\broadcaster\handlers\configuration;
class WebhookConfiguration extends Configuration
{
	public $url;

	public function getDescriptor()
	{
		return $this->url;
	}

	public function rules()
	{
		return [
            [['url'], 'url'],
            [['url'], 'required'],
		];
	}

	public function getAttributeConfig()
	{
		$f = [];
		$f['url'] = [
			'type' => 'text'
		];
		return $f;
	}

	/**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'url' => 'Webhook URL',
        ];
    }
}


text:
namespace test_helpers {
namespace {

class DummyTest {
public:
  explicit DummyTest(const std::string& name) : m_name(name) {}
  const std::string& get_name() const { return m_name; }
  void run() {}

private:
  const std::string m_name;
};

class FailTest {
public:
  explicit FailTest(const std::string& name) : m_name(name) {}
  const std::string& get_name() const { return m_name; }
  void run() { PASSERT(2 == 3); }

private:
  const std::string m_name;
};

class ErrorTest {
public:
  explicit ErrorTest(const std::string& name) : m_name(name) {}
  const std::string& get_name() const { return m_name; }
  void run() { throw std::runtime_error("This is an error."); }

private:
  const std::string m_name;
};

class ErrorUnknownTest {
public:
  explicit ErrorUnknownTest(const std::string& name) : m_name(name) {}
  const std::string& get_name() const { return m_name; }
  void run() { throw 4; }

private:
  const std::string m_name;
};

} // namespace test_helpers::<unnamed>

ptest::hiera::Test
create_dummy_test(const char* name) {
  return DummyTest(name);
}

ptest::hiera::Test
create_fail_test(const char* name) {
  return FailTest(name);
}

ptest::hiera::Test
create_error_test(const char* name) {
  return ErrorTest(name);
}

ptest::hiera::Test
create_error_unknown_test(const char* name) {
  return ErrorUnknownTest(name);
}

} // namespace test_helpers


text:
<?php

/**
 * Adminhtml Catalog Product List Sortable allowed sortable attributes source
 *
 * @category   Mage
 * @package    Mage_Adminhtml
 * @author     Magento Core Team <core@magentocommerce.com>
 */
class Mage_Adminhtml_Model_System_Config_Source_Catalog_ListSort
{
    /**
     * Retrieve option values array
     *
     * @return array
     */
    public function toOptionArray()
    {
        $options = array();
        $options[] = array(
            'label' => Mage::helper('catalog')->__('Best Value'),
            'value' => 'position'
        );
        foreach ($this->_getCatalogConfig()->getAttributesUsedForSortBy() as $attribute) {
            $options[] = array(
                'label' => Mage::helper('catalog')->__($attribute['frontend_label']),
                'value' => $attribute['attribute_code']
            );
        }
        return $options;
    }

    /**
     * Retrieve Catalog Config Singleton
     *
     * @return Mage_Catalog_Model_Config
     */
    protected function _getCatalogConfig() {
        return Mage::getSingleton('catalog/config');
    }
}


text:
package org.blocks4j.feature.toggle.exception;

public class ParamtersToggleFactoryException extends RuntimeException {

    public ParamtersToggleFactoryException() {
        super();
    }

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

    public ParamtersToggleFactoryException(Throwable cause) {
        super(cause);
    }

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


text:
package play.utils

import java.io._
import scala.io.Codec
import java.net.URL
import play.api.Logger

/**
 * IO utilites for internal use by Play projects.
 *
 * This is intentionally not public API.
 */
private[play] object PlayIO {

  private val logger = Logger(this.getClass)

  /**
   * Read the given stream into a byte array.
   *
   * Closes the stream.
   */
  private def readStream(stream: InputStream): Array[Byte] = {
    try {
      val buffer = new Array[Byte](8192)
      var len = stream.read(buffer)
      val out = new ByteArrayOutputStream() // Doesn't need closing
      while (len != -1) {
        out.write(buffer, 0, len)
        len = stream.read(buffer)
      }
      out.toByteArray
    } finally closeQuietly(stream)
  }

  /**
   * Read the file into a byte array.
   */
  def readFile(file: File): Array[Byte] = {
    readStream(new FileInputStream(file))
  }

  /**
   * Read the given stream into a String.
   *
   * Closes the stream.
   */
  def readStreamAsString(stream: InputStream)(implicit codec: Codec): String = {
    new String(readStream(stream), codec.name)
  }

  /**
   * Read the URL as a String.
   */
  def readUrlAsString(url: URL)(implicit codec: Codec): String = {
    readStreamAsString(url.openStream())
  }

  /**
   * Read the file as a String.
   */
  def readFileAsString(file: File)(implicit codec: Codec): String = {
    readStreamAsString(new FileInputStream(file))
  }

  /**
   * Close the given closeable quietly.
   *
   * Logs any IOExceptions encountered.
   */
  def closeQuietly(closeable: Closeable) = {
    try {
      if (closeable != null) {
        closeable.close()
      }
    } catch {
      case e: IOException => logger.warn("Error closing stream", e)
    }
  }
}


text:
require File.join(File.dirname(__FILE__), %w(.. vertex))

module Dagnabit::Vertex
  ##
  # Contains methods for bonding a vertex to a graph.
  module Bonding
    ##
    # Calculates a bond for this vertex (the method receiver) to all source
    # vertices of `graph`.
    #
    # This method expects the receiver to have been persisted, and will raise
    # `RuntimeError` if that is not the case.
    #
    # Persisted edges that already connect the receiver vertex to source
    # vertices in `graph` will not be duplicated.  Unpersisted edges connecting
    # the receiver to a source in `graph` _will_ be duplicated, so it is
    # advised that you ensure that all vertices and edges in `graph` have been
    # persisted before using {#bond_for}.
    #
    # This method requires the existence of an edge model; see
    # {Settings#edge_model} and {Settings#edge_model_name=}.  If an edge model
    # has not been set, this method raises `RuntimeError`.
    #
    # Edges instantiated by `bond_for` are not automatically saved.
    #
    # @param [Dagnabit::Graph] graph the graph to bond
    # @return [Array<edge_model>] a list of edges that, when saved, will bond the
    #   vertex to `graph`
    # @raise [RuntimeError] if an edge model has not been set
    def bond_for(graph)
      edge = self.class.edge_model

      raise 'edge_model must be set' unless edge
      raise "#{self} must be persisted before invoking bond_for" if new_record?

      sources = graph.sources
      existing = edge.all(:conditions => { :parent_id => id, :child_id => sources.map(&:id) }).map { |e| [e.parent_id, e.child_id] }
      new = sources.inject([]) { |es, s| es << [id, s.id] }

      (new - existing).map { |p, c| edge.new(:parent_id => p, :child_id => c) }
    end
  end
end


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
 * Package containing the implementations for StorageCacheManagementClient. A Storage Cache provides scalable caching
 * service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets").
 * These operations allow you to manage Caches.
 */
package com.azure.resourcemanager.storagecache.implementation;


text:
/**
 * middleware el cual comprueba si hay una session con el rol de admin en linea
 *
 */function middlewareComprobarPermisoDeAdmnistracion($this, $localStorage, $sessionStorage, rolAdmin) {
  if ($sessionStorage.usuario.rol_id == rolAdmin) {
    $this.next();
  } else {
    $this.redirectTo('/');
  }
}


text:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export TERM=xterm-256color

# Core config
export EDITOR=vim
export VISUAL=vim # editor for crontab

# OS-dependent locations
if [[ $OSTYPE == 'linux-gnu' ]]; then
	ANSIBLE_ROLES_PATH='/etc/ansible'
elif [[ $OSTYPE == darwin* ]]; then
	ANSIBLE_ROLES_PATH='/usr/local/etc/ansible'
fi

# Customize github.com/djui/alias-tips
export ZSH_PLUGINS_ALIAS_TIPS_REVEAL=1
export ZSH_PLUGINS_ALIAS_TIPS_REVEAL_EXCLUDES="(_ ll vi)"

# XDG config location
export XDG_CONFIG_HOME="$HOME/.config"


text:
local skynet = require "skynet"
require "skynet.manager"
local G = require "global"
local room_mgr = require "room_mgr"
local timer_mgr = require "timer_mgr"

local function init()
    G.timer_mgr = timer_mgr.new()
    G.room_mgr = room_mgr
    room_mgr:init()
    G.room_timer = G.timer_mgr:add(1*1000, -1, function() room_mgr:check_ready() end)
end

local CMD = {}

function CMD.create_room(game_id, player_info)
    return room_mgr:create(game_id, player_info)
end

function CMD.join_room(room_id, player_info)
    return room_mgr:join(room_id, player_info)
end

function CMD.room_begin(room_id)
    room_mgr:room_begin(room_id)
end

local function dispatch(_, session, cmd, ...)
    local f = CMD[cmd]
    assert(f, "room_mgr接收到非法lua消息: "..cmd)

    if session == 0 then
        f(...)
    else
        skynet.ret(skynet.pack(f(...)))
    end
end

skynet.start(function ()
    skynet.dispatch("lua", dispatch)

    init()

    skynet.register("room_mgr")

    skynet.error("room_mgr booted...")
end)


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.trino.plugin.jdbc.expression;

import io.trino.matching.Capture;
import io.trino.matching.Captures;
import io.trino.matching.Pattern;
import io.trino.plugin.base.expression.AggregateFunctionRule;
import io.trino.plugin.jdbc.JdbcClient;
import io.trino.plugin.jdbc.JdbcColumnHandle;
import io.trino.plugin.jdbc.JdbcExpression;
import io.trino.plugin.jdbc.JdbcTypeHandle;
import io.trino.spi.connector.AggregateFunction;
import io.trino.spi.expression.Variable;
import io.trino.spi.type.BigintType;
import io.trino.spi.type.CharType;
import io.trino.spi.type.VarcharType;

import java.util.Optional;

import static com.google.common.base.Verify.verify;
import static io.trino.matching.Capture.newCapture;
import static io.trino.plugin.base.expression.AggregateFunctionPatterns.distinct;
import static io.trino.plugin.base.expression.AggregateFunctionPatterns.functionName;
import static io.trino.plugin.base.expression.AggregateFunctionPatterns.hasFilter;
import static io.trino.plugin.base.expression.AggregateFunctionPatterns.singleInput;
import static io.trino.plugin.base.expression.AggregateFunctionPatterns.variable;
import static io.trino.spi.type.BigintType.BIGINT;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;

/**
 * Implements {@code count(DISTINCT x)}.
 */
public class ImplementCountDistinct
        implements AggregateFunctionRule<JdbcExpression>
{
    private static final Capture<Variable> INPUT = newCapture();

    private final JdbcTypeHandle bigintTypeHandle;
    private final boolean isRemoteCollationSensitive;

    /**
     * @param bigintTypeHandle A {@link JdbcTypeHandle} that will be mapped to {@link BigintType} by {@link JdbcClient#toColumnMapping}.
     */
    public ImplementCountDistinct(JdbcTypeHandle bigintTypeHandle, boolean isRemoteCollationSensitive)
    {
        this.bigintTypeHandle = requireNonNull(bigintTypeHandle, "bigintTypeHandle is null");
        this.isRemoteCollationSensitive = isRemoteCollationSensitive;
    }

    @Override
    public Pattern<AggregateFunction> getPattern()
    {
        return Pattern.typeOf(AggregateFunction.class)
                .with(distinct().equalTo(true))
                .with(hasFilter().equalTo(false))
                .with(functionName().equalTo("count"))
                .with(singleInput().matching(variable().capturedAs(INPUT)));
    }

    @Override
    public Optional<JdbcExpression> rewrite(AggregateFunction aggregateFunction, Captures captures, RewriteContext context)
    {
        Variable input = captures.get(INPUT);
        JdbcColumnHandle columnHandle = (JdbcColumnHandle) context.getAssignment(input.getName());
        verify(aggregateFunction.getOutputType() == BIGINT);

        boolean isCaseSensitiveType = columnHandle.getColumnType() instanceof CharType || columnHandle.getColumnType() instanceof VarcharType;
        if (aggregateFunction.isDistinct() && !isRemoteCollationSensitive && isCaseSensitiveType) {
            // Remote database is case insensitive or compares values differently from Trino
            return Optional.empty();
        }

        return Optional.of(new JdbcExpression(
                format("count(DISTINCT %s)", context.getIdentifierQuote().apply(columnHandle.getColumnName())),
                bigintTypeHandle));
    }
}


text:
JSONDataSchemaInferencer
========================
2014/11/16
Hoon H.

Inferences data schema from multiple JSON data samples.

Algorithm
---------

1.	Prepare a *path* which can describe any value at any location.
	In my case, I desribed it using field name and array index.
2.	Iterate all objects, arrays and *values*.
3.	Collect all of thier paths.
4.	Extract paths for composite type values.
5.	Extract its field paths.

Now you have composite types and its fields. Everything is prepared.

A Little More Explanation
-------------------------

Because JSON does not denote types, `JSON Object` is actually an
anonymous tuple with named fields. I sorted every values based on
tuples.

Array indexes are ignored, and all arrays at same location will be
treated as homogeneous arrays. All subpaths of all elements will be
merged.

Tuple is unnamed, then the name of tuple is set to its path without
array indexing. This equals to conatenated field names to the object.

Caveats
-------
This is nothing related to ["JSON Schema"](http://json-schema.org)
thing. This does not use any of that stuffs. (maybe layer!)

This is inference. Does not provide precise schema. This program is
designed just to help initial data class design, and you shouldn't
be fully rely only on this because schema can be wrong if there's
undiscovered data.

API writers. Please! Provide full data schema for all of input and
output! Just an example output can't be enough. It's something like
a library without function signature and refernce manual AT ALL!!!
Binary only library huh? If you don't provide precise schema, your're
a selfish idiot who can't even imagine position of peer developer.

License
-------
Copyright © 2014 Hoon H..
Licensed under MIT license.


text:
from __future__ import unicode_literals

import urllib3

from pyfeld.upnpService import UpnpService

class Room:
    def __init__(self, udn, renderer_list, name, location):
        self.name = name
        self.udn = udn
        self.renderer_list = renderer_list
        self.volume = 0
        self.mute = 0
        self.upnp_service = None
        self.location = location
        base_url_parsed = urllib3.util.parse_url(location)
        base_url = base_url_parsed.scheme + "://" + base_url_parsed.netloc
        #we need to parse these out of the xml to make it robust
        self.scpdurl = base_url+"/rendercontrol.xml"
        self.controlURL = base_url+"/RenderingControl/ctrl"
        self.eventSubURL = base_url+"/RenderingControl/evt"

    def set_volume(self, volume):
        self.volume = volume

    def set_name(self, name):
        self.name = name

    def get_name(self):
        return self.name

    def get_location(self):
        return self.location

    def get_udn(self):
        return self.udn

    def get_renderer_list(self):
        return self.renderer_list

    def get_volume(self):
        return self.volume

    def set_upnp_service(self, location):
        self.upnp_service = UpnpService()
        if location is not None:
            self.upnp_service.set_location(location)

    def set_event_update(self, udn, items_dict):
        assert(udn == self.udn)
        if 'Volume' in items_dict:
            self.volume = items_dict['Volume']
        if 'Mute' in items_dict:
            self.mute = items_dict['Mute']


text:
This is an implementation of the Trains problem from the various options.

##Installation instructions.

This has been tested on OS X 10.13...

It is written in Javascript using NodeJS v6.9.5 and NPM 6.4.1

##Setup:

1. Ensure correct versions of Node and NPM are installed
2. Unzip the file, routes.zip into a folder
3. Go into that folder and type `NPM install`
4. Then enter `NPM link`

At this point, the app should be ready to go on your system as a console app using the alias rr (if you want to use something else, then it can be changed in the package.json file)

##Usage:

The graph that is loaded is in ./input/graph.txt.  This can be swapped with another valid graph if desired.
The app runs using the alias `sr` by default
The list of cities (nodes) is currently limited to A B C D E

`sr --route A B C`

This will give you the distance of a route constructed from the digraph given in the file

`sr --shortroute A D`

This will give you the shortest distance between two points (modified Floyd Warshall algorithm)

`sr --nroutes B B`

This will give you the different routes between two points

`sr --thoughtworks`

This will create the output as directed by the assignment

`sr --version`
`sr --help`

These come out of the box with the commander package...

##Notes:

* Basic unit tests have been implemented with Jest, run them with NPM test
* I have used one package, commander to simplify the usage of the app if you want to run it interactively.  Other than that I have stcuk with the core language features as far as possible.
* It should work out of the box - I have tested on a couple of different machines with success
* There is some input validation, there needs to be more
* There are some tests - ideally I would add more time permitting including some other kinds (eg: BDD style tests)