text:
import { URI as uri } from 'vs/base/common/uri';
import * as resources from 'vs/base/common/resources';
import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IModeService } from 'vs/editor/common/services/modeService';
import { toResource, IEditorInput } from 'vs/workbench/common/editor';
import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IDecorationsService, IResourceDecorationChangeEvent, IDecorationData } from 'vs/workbench/services/decorations/browser/decorations';
import { Schemas } from 'vs/base/common/network';
import { FileKind, FILES_ASSOCIATIONS_CONFIG } from 'vs/platform/files/common/files';
import { ITextModel } from 'vs/editor/common/model';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { Event, Emitter } from 'vs/base/common/event';
import { ILabelService } from 'vs/platform/label/common/label';
import { getIconClasses, getConfiguredLangId } from 'vs/editor/common/services/getIconClasses';

export interface IResourceLabel {
	name: string;
	description?: string;
	resource?: uri;
}

export interface IResourceLabelOptions extends IIconLabelValueOptions {
	fileKind?: FileKind;
	fileDecorations?: { colors: boolean, badges: boolean, data?: IDecorationData };
}

export class ResourceLabel extends IconLabel {

	private _onDidRender = this._register(new Emitter<void>());
	get onDidRender(): Event<void> { return this._onDidRender.event; }

	private label: IResourceLabel;
	private options: IResourceLabelOptions;
	private computedIconClasses: string[];
	private lastKnownConfiguredLangId: string;
	private computedPathLabel: string;

	constructor(
		container: HTMLElement,
		options: IIconLabelCreationOptions,
		@IExtensionService private extensionService: IExtensionService,
		@IConfigurationService private configurationService: IConfigurationService,
		@IModeService private modeService: IModeService,
		@IModelService private modelService: IModelService,
		@IDecorationsService protected decorationsService: IDecorationsService,
		@IThemeService private themeService: IThemeService,
		@ILabelService protected labelService: ILabelService
	) {
		super(container, options);

		this.registerListeners();
	}

	private registerListeners(): void {

		// update when extensions are registered with potentially new languages
		this._register(this.extensionService.onDidRegisterExtensions(() => this.render(true /* clear cache */)));

		// react to model mode changes
		this._register(this.modelService.onModelModeChanged(e => this.onModelModeChanged(e)));

		// react to file decoration changes
		this._register(this.decorationsService.onDidChangeDecorations(this.onFileDecorationsChanges, this));

		// react to theme changes
		this._register(this.themeService.onThemeChange(() => this.render(false)));

		// react to files.associations changes
		this._register(this.configurationService.onDidChangeConfiguration(e => {
			if (e.affectsConfiguration(FILES_ASSOCIATIONS_CONFIG)) {
				this.render(true /* clear cache */);
			}
		}));
	}

	private onModelModeChanged(e: { model: ITextModel; oldModeId: string; }): void {
		if (!this.label || !this.label.resource) {
			return; // only update if label exists
		}

		if (!e.model.uri) {
			return; // we need the resource to compare
		}

		if (e.model.uri.scheme === Schemas.file && e.oldModeId === PLAINTEXT_MODE_ID) { // todo@remote does this apply?
			return; // ignore transitions in files from no mode to specific mode because this happens each time a model is created
		}

		if (e.model.uri.toString() === this.label.resource.toString()) {
			if (this.lastKnownConfiguredLangId !== e.model.getLanguageIdentifier().language) {
				this.render(true); // update if the language id of the model has changed from our last known state
			}
		}
	}

	private onFileDecorationsChanges(e: IResourceDecorationChangeEvent): void {
		if (!this.options || !this.label || !this.label.resource) {
			return;
		}

		if (this.options.fileDecorations && e.affectsResource(this.label.resource)) {
			this.render(false);
		}
	}

	setLabel(label: IResourceLabel, options?: IResourceLabelOptions): void {
		const hasResourceChanged = this.hasResourceChanged(label, options);

		this.label = label;
		this.options = options;

		if (hasResourceChanged) {
			this.computedPathLabel = void 0; // reset path label due to resource change
		}

		this.render(hasResourceChanged);
	}

	private hasResourceChanged(label: IResourceLabel, options: IResourceLabelOptions): boolean {
		const newResource = label ? label.resource : void 0;
		const oldResource = this.label ? this.label.resource : void 0;

		const newFileKind = options ? options.fileKind : void 0;
		const oldFileKind = this.options ? this.options.fileKind : void 0;

		if (newFileKind !== oldFileKind) {
			return true; // same resource but different kind (file, folder)
		}

		if (newResource && this.computedPathLabel !== this.labelService.getUriLabel(newResource)) {
			return true;
		}

		if (newResource && oldResource) {
			return newResource.toString() !== oldResource.toString();
		}

		if (!newResource && !oldResource) {
			return false;
		}

		return true;
	}

	clear(): void {
		this.label = void 0;
		this.options = void 0;
		this.lastKnownConfiguredLangId = void 0;
		this.computedIconClasses = void 0;
		this.computedPathLabel = void 0;

		this.setValue();
	}

	private render(clearIconCache: boolean): void {
		if (this.label) {
			const configuredLangId = getConfiguredLangId(this.modelService, this.label.resource);
			if (this.lastKnownConfiguredLangId !== configuredLangId) {
				clearIconCache = true;
				this.lastKnownConfiguredLangId = configuredLangId;
			}
		}

		if (clearIconCache) {
			this.computedIconClasses = void 0;
		}

		if (!this.label) {
			return;
		}

		const iconLabelOptions: IIconLabelValueOptions = {
			title: '',
			italic: this.options && this.options.italic,
			matches: this.options && this.options.matches,
			extraClasses: []
		};

		const resource = this.label.resource;
		const label = this.label.name;

		if (this.options && typeof this.options.title === 'string') {
			iconLabelOptions.title = this.options.title;
		} else if (resource && resource.scheme !== Schemas.data /* do not accidentally inline Data URIs */) {
			if (!this.computedPathLabel) {
				this.computedPathLabel = this.labelService.getUriLabel(resource);
			}

			iconLabelOptions.title = this.computedPathLabel;
		}

		if (this.options && !this.options.hideIcon) {
			if (!this.computedIconClasses) {
				this.computedIconClasses = getIconClasses(this.modelService, this.modeService, resource, this.options && this.options.fileKind);
			}
			iconLabelOptions.extraClasses = this.computedIconClasses.slice(0);
		}
		if (this.options && this.options.extraClasses) {
			iconLabelOptions.extraClasses.push(...this.options.extraClasses);
		}

		if (this.options && this.options.fileDecorations && resource) {
			const deco = this.decorationsService.getDecoration(
				resource,
				this.options.fileKind !== FileKind.FILE,
				this.options.fileDecorations.data
			);

			if (deco) {
				if (deco.tooltip) {
					iconLabelOptions.title = `${iconLabelOptions.title} • ${deco.tooltip}`;
				}

				if (this.options.fileDecorations.colors) {
					iconLabelOptions.extraClasses.push(deco.labelClassName);
				}

				if (this.options.fileDecorations.badges) {
					iconLabelOptions.extraClasses.push(deco.badgeClassName);
				}
			}
		}

		this.setValue(label, this.label.description, iconLabelOptions);

		this._onDidRender.fire();
	}

	dispose(): void {
		super.dispose();

		this.label = void 0;
		this.options = void 0;
		this.lastKnownConfiguredLangId = void 0;
		this.computedIconClasses = void 0;
		this.computedPathLabel = void 0;
	}
}

export class EditorLabel extends ResourceLabel {

	setEditor(editor: IEditorInput, options?: IResourceLabelOptions): void {
		this.setLabel({
			resource: toResource(editor, { supportSideBySide: true }),
			name: editor.getName(),
			description: editor.getDescription()
		}, options);
	}
}

export interface IFileLabelOptions extends IResourceLabelOptions {
	hideLabel?: boolean;
	hidePath?: boolean;
}

export class FileLabel extends ResourceLabel {

	constructor(
		container: HTMLElement,
		options: IIconLabelCreationOptions,
		@IExtensionService extensionService: IExtensionService,
		@IWorkspaceContextService private contextService: IWorkspaceContextService,
		@IConfigurationService configurationService: IConfigurationService,
		@IModeService modeService: IModeService,
		@IModelService modelService: IModelService,
		@IDecorationsService decorationsService: IDecorationsService,
		@IThemeService themeService: IThemeService,
		@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
		@ILabelService labelService: ILabelService
	) {
		super(container, options, extensionService, configurationService, modeService, modelService, decorationsService, themeService, labelService);
	}

	setFile(resource: uri, options?: IFileLabelOptions): void {
		const hideLabel = options && options.hideLabel;
		let name: string;
		if (!hideLabel) {
			if (options && options.fileKind === FileKind.ROOT_FOLDER) {
				const workspaceFolder = this.contextService.getWorkspaceFolder(resource);
				if (workspaceFolder) {
					name = workspaceFolder.name;
				}
			}

			if (!name) {
				name = resources.basenameOrAuthority(resource);
			}
		}

		let description: string;
		const hidePath = (options && options.hidePath) || (resource.scheme === Schemas.untitled && !this.untitledEditorService.hasAssociatedFilePath(resource));
		if (!hidePath) {
			description = this.labelService.getUriLabel(resources.dirname(resource), { relative: true });
		}

		this.setLabel({ resource, name, description }, options);
	}
}

redpajama_set_name: RedPajamaGithub


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

import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.Map.Entry;

import javax.xml.stream.events.XMLEvent;

import com.amazonaws.services.identitymanagement.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.MapEntry;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;

/**
 * UserDetail StAX Unmarshaller
 */
public class UserDetailStaxUnmarshaller implements
        Unmarshaller<UserDetail, StaxUnmarshallerContext> {

    public UserDetail unmarshall(StaxUnmarshallerContext context)
            throws Exception {
        UserDetail userDetail = new UserDetail();
        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        if (context.isStartOfDocument())
            targetDepth += 1;

        while (true) {
            XMLEvent xmlEvent = context.nextEvent();
            if (xmlEvent.isEndDocument())
                return userDetail;

            if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

                if (context.testExpression("Path", targetDepth)) {
                    userDetail.setPath(StringStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context.testExpression("UserName", targetDepth)) {
                    userDetail.setUserName(StringStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context.testExpression("UserId", targetDepth)) {
                    userDetail.setUserId(StringStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context.testExpression("Arn", targetDepth)) {
                    userDetail.setArn(StringStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context.testExpression("CreateDate", targetDepth)) {
                    userDetail.setCreateDate(DateStaxUnmarshaller.getInstance()
                            .unmarshall(context));
                    continue;
                }

                if (context
                        .testExpression("UserPolicyList/member", targetDepth)) {
                    userDetail.withUserPolicyList(PolicyDetailStaxUnmarshaller
                            .getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("GroupList/member", targetDepth)) {
                    userDetail.withGroupList(StringStaxUnmarshaller
                            .getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("AttachedManagedPolicies/member",
                        targetDepth)) {
                    userDetail
                            .withAttachedManagedPolicies(AttachedPolicyStaxUnmarshaller
                                    .getInstance().unmarshall(context));
                    continue;
                }

            } else if (xmlEvent.isEndElement()) {
                if (context.getCurrentDepth() < originalDepth) {
                    return userDetail;
                }
            }
        }
    }

    private static UserDetailStaxUnmarshaller instance;

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


text:
<?php

namespace PHPhotoSuit\PhotoSuite\Infrastructure\Storage;

class AmazonS3Config
{

    /** @var string */
    private $bucket;
    /** @var string */
    private $urlBase;
    /** @var string */
    private $key;
    /** @var string */
    private $secret;

    /**
     * AmazonS3Config constructor.
     * @param string $bucket
     * @param string $urlBase
     * @param string $key
     * @param string $secret
     */
    public function __construct($bucket, $urlBase, $key, $secret)
    {
        $this->bucket = $bucket;
        $this->urlBase = $urlBase;
        $this->key = $key;
        $this->secret = $secret;
    }

    /**
     * @param $config
     * @return AmazonS3Config
     */
    public static function getInstanceByArray(array $config)
    {
        return new self($config['bucket'], $config['urlBase'], $config['key'], $config['secret']);
    }

    /**
     * @return string
     */
    public function bucket()
    {
        return $this->bucket;
    }

    /**
     * @return string
     */
    public function urlBase()
    {
        return $this->urlBase;
    }

    public function getKey()
    {
        return $this->key;
    }

    public function getSecret()
    {
        return $this->secret;
    }
}


text:
package org.apache.geronimo.tomcat.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for ResourceEnvRefType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ResourceEnvRefType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResourceEnvRefType")
public class ResourceEnvRefType {

}


text:
<?php

include_once '../../klase/checkLogin.php';
include_once '../../klase/radniNalog.php';
header('Content-type: application/json');
$rn=new servisRN();
$rn = $rn->RNbyPrimka($_POST['primka']);
echo json_encode($rn, JSON_UNESCAPED_UNICODE);


text:
<!DOCTYPE element [
<?xml version="1.0" encoding="utf-8"?>
<!-- xml declaration not allowed here -->
<!ELEMENT element EMPTY>]>
<element/>


text:
using content::RenderViewHostImpl;
using content::WebContents;

class RenderViewHostTest : public InProcessBrowserTest {
 public:
  RenderViewHostTest() {}
};

IN_PROC_BROWSER_TEST_F(RenderViewHostTest,
                       ExecuteJavascriptAndGetValue) {
  ASSERT_TRUE(test_server()->Start());
  GURL empty_url(test_server()->GetURL("files/empty.html"));
  ui_test_utils::NavigateToURL(browser(), empty_url);

  RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
      browser()->GetSelectedWebContents()->GetRenderViewHost());

  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
                                                     ASCIIToUTF16("!false;"));
    EXPECT_EQ(Value::TYPE_BOOLEAN, value->GetType());
    bool bool_value;
    EXPECT_TRUE(value->GetAsBoolean(&bool_value));
    EXPECT_TRUE(bool_value);
  }

  // Execute the script 'true' and make sure we get back true.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
                                                     ASCIIToUTF16("true;"));
    EXPECT_EQ(Value::TYPE_BOOLEAN, value->GetType());
    bool bool_value;
    EXPECT_TRUE(value->GetAsBoolean(&bool_value));
    EXPECT_TRUE(bool_value);
  }

  // Execute the script 'false' and make sure we get back false.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
                                                     ASCIIToUTF16("false;"));
    EXPECT_EQ(Value::TYPE_BOOLEAN, value->GetType());
    bool bool_value;
    EXPECT_TRUE(value->GetAsBoolean(&bool_value));
    EXPECT_FALSE(bool_value);
  }

  // And now, for something completely different, try a number.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
                                                     ASCIIToUTF16("42;"));
    EXPECT_EQ(Value::TYPE_INTEGER, value->GetType());
    int int_value;
    EXPECT_TRUE(value->GetAsInteger(&int_value));
    EXPECT_EQ(42, int_value);
  }

  // Try a floating point number.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
                                                     ASCIIToUTF16("42.2;"));
    EXPECT_EQ(Value::TYPE_DOUBLE, value->GetType());
    double double_value;
    EXPECT_TRUE(value->GetAsDouble(&double_value));
    EXPECT_EQ(42.2, double_value);
  }

  // Let's check out string.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
        ASCIIToUTF16("\"something completely different\";"));
    EXPECT_EQ(Value::TYPE_STRING, value->GetType());
    std::string string_value;
    EXPECT_TRUE(value->GetAsString(&string_value));
    EXPECT_EQ(std::string("something completely different"), string_value);
  }

  // Regular expressions might be fun.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
        ASCIIToUTF16("/finder.*foo/g;"));
    EXPECT_EQ(Value::TYPE_STRING, value->GetType());
    std::string string_value;
    EXPECT_TRUE(value->GetAsString(&string_value));
    EXPECT_EQ(std::string("/finder.*foo/g"), string_value);
  }

  // Let's test some date conversions.  First up, epoch.  Can't use 0 because
  // that means uninitialized, so use the next best thing.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
        ASCIIToUTF16("new Date(1);"));
    EXPECT_EQ(Value::TYPE_DOUBLE, value->GetType());
    double date_seconds;
    EXPECT_TRUE(value->GetAsDouble(&date_seconds));

    base::Time time = base::Time::FromDoubleT(date_seconds);

    base::Time::Exploded time_exploded;
    time.UTCExplode(&time_exploded);
    EXPECT_EQ(1970, time_exploded.year);
    EXPECT_EQ(1, time_exploded.month);
    EXPECT_EQ(1, time_exploded.day_of_month);
    EXPECT_EQ(0, time_exploded.hour);
    EXPECT_EQ(0, time_exploded.minute);
    EXPECT_EQ(0, time_exploded.second);
  }

  // Test date with a real date input.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
        ASCIIToUTF16("new Date(Date.UTC(2006, 7, 16, 12, 0, 15));"));
    EXPECT_EQ(Value::TYPE_DOUBLE, value->GetType());
    double date_seconds;
    EXPECT_TRUE(value->GetAsDouble(&date_seconds));

    base::Time time = base::Time::FromDoubleT(date_seconds);

    base::Time::Exploded time_exploded;
    time.UTCExplode(&time_exploded);
    EXPECT_EQ(2006, time_exploded.year);
    // Subtle; 0 based in JS, 1 based in base::Time:
    EXPECT_EQ(8, time_exploded.month);
    EXPECT_EQ(16, time_exploded.day_of_month);
    EXPECT_EQ(12, time_exploded.hour);
    EXPECT_EQ(0, time_exploded.minute);
    EXPECT_EQ(15, time_exploded.second);
  }

  // And something more complicated - get an array back as a list.
  {
    Value* value = rvh->ExecuteJavascriptAndGetValue(string16(),
        ASCIIToUTF16("new Array(\"one\", 2, false);"));
    EXPECT_EQ(Value::TYPE_LIST, value->GetType());
    ListValue* list_value;
    EXPECT_TRUE(value->GetAsList(&list_value));
    EXPECT_EQ(3U, list_value->GetSize());
    Value* element_value;
    EXPECT_TRUE(list_value->Get(0, &element_value));
    EXPECT_EQ(Value::TYPE_STRING, element_value->GetType());
    EXPECT_TRUE(list_value->Get(1, &element_value));
    EXPECT_EQ(Value::TYPE_INTEGER, element_value->GetType());
    EXPECT_TRUE(list_value->Get(2, &element_value));
    EXPECT_EQ(Value::TYPE_BOOLEAN, element_value->GetType());
  }
}

class RenderViewHostTestWebContentsObserver
    : public content::WebContentsObserver {
 public:
  explicit RenderViewHostTestWebContentsObserver(WebContents* web_contents)
      : content::WebContentsObserver(web_contents),
        navigation_count_(0) {}
  virtual ~RenderViewHostTestWebContentsObserver() {}

  virtual void DidNavigateMainFrame(
      const content::LoadCommittedDetails& details,
      const content::FrameNavigateParams& params) OVERRIDE {
    observed_socket_address_ = params.socket_address;
    base_url_ = params.base_url;
    ++navigation_count_;
  }

  const net::HostPortPair& observed_socket_address() const {
    return observed_socket_address_;
  }

  GURL base_url() const {
    return base_url_;
  }

  int navigation_count() const { return navigation_count_; }

 private:
  net::HostPortPair observed_socket_address_;
  GURL base_url_;
  int navigation_count_;

  DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestWebContentsObserver);
};

IN_PROC_BROWSER_TEST_F(RenderViewHostTest, FrameNavigateSocketAddress) {
  ASSERT_TRUE(test_server()->Start());
  RenderViewHostTestWebContentsObserver observer(
      browser()->GetSelectedWebContents());

  GURL test_url = test_server()->GetURL("files/simple.html");
  ui_test_utils::NavigateToURL(browser(), test_url);

  EXPECT_EQ(test_server()->host_port_pair().ToString(),
            observer.observed_socket_address().ToString());
  EXPECT_EQ(1, observer.navigation_count());
}

IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BaseURLParam) {
  ASSERT_TRUE(test_server()->Start());
  RenderViewHostTestWebContentsObserver observer(
      browser()->GetSelectedWebContents());

  // Base URL is not set if it is the same as the URL.
  GURL test_url = test_server()->GetURL("files/simple.html");
  ui_test_utils::NavigateToURL(browser(), test_url);
  EXPECT_TRUE(observer.base_url().is_empty());
  EXPECT_EQ(1, observer.navigation_count());

  // But should be set to the original page when reading MHTML.
  test_url = net::FilePathToFileURL(test_server()->document_root().Append(
      FILE_PATH_LITERAL("google.mht")));
  ui_test_utils::NavigateToURL(browser(), test_url);
  EXPECT_EQ("http://www.google.com/", observer.base_url().spec());
}


text:
<?php
$servername = "localhost";
$username = "root";
$password = "bitnami";
$dbname = "experts";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("");
}

$sql = "SELECT locations.Location FROM locations,movies WHERE locations.ID=movies.ID AND movies.Name='" . $_REQUEST["Name"] . "'";
$res = $conn->query($sql);

$prefix = "";
if ($res->num_rows > 0) {
	while($row = $res->fetch_assoc()) {
		echo $prefix . $row["Location"];
		$prefix = "@";
	}
}

$conn->close();
?>


text:
using TH.Model;
using TH.Repositories.Infrastructure;

namespace TH.Repositories.Repository
{
    public class PostRepository : RepositoryBase<Post>, IPostRepository
    {
        public PostRepository(IDatabaseFactory databaseFactory)
            : base(databaseFactory)
        {
        }
    }

    public interface IPostRepository : IRepository<Post>
    {
    }
}


text:
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.ps1", ".ps1")
$pathtosut = join-path $here $sut

iex ( gc $pathtosut -Raw )

<#
Describe 'how Test-ZippedModuleChanged reponds' {
    $Setup = {
        mkdir testdrive:\Source -erroraction silentlycontinue | out-null
        $Source = get-item testdrive:\source | select -expand fullname

        mkdir testdrive:\Destination -erroraction silentlycontinue | out-null
        $Destination = get-item testdrive:\Destination | select -expand fullname

        $InputObjectProperties = @{
            Name = 'MyCustomResource'
            fullname = (join-path $Source 'MyCustomResource')
        }

        $InputObject = [pscustomobject]$InputObjectProperties

        mock -command Get-FileHash -parameterFilter {$path -like $InputObject.fullname} -mockwith {[pscustomobject]@{hash='123'}}
    }

	context "when the current version is the same as a previous version" {
        . $Setup
        mock -command test-path -mockwith {$true}
        mock -command Get-FileHash -parameterFilter {$path -like (Join-path $Destination 'MyCustomResource')} -mockwith {[pscustomobject]@{hash='123'}}

		$result = Test-ZippedModuleChanged

		it "should return false" {
			$result | should be $false
		}
	}

    context "when the current version is the different as a previous version" {
        . $Setup
        mock -command test-path -mockwith {$true}
        mock -command Get-FileHash -parameterFilter {$path -like (Join-path $Destination 'MyCustomResource')} -mockwith {[pscustomobject]@{hash='321'}}

        $result = Test-ZippedModuleChanged

        it "should return true" {
            $result | should be $true
        }
    }

    context "when no previous version exists" {
        . $Setup
        mock -command test-path -mockwith {$false}

        $result = Test-ZippedModuleChanged

        it "should return true" {
            $result | should be $true
        }
    }
}
#>

Describe 'how Test-DscModuleResourceIsValid behaves' {

    context 'when there are failed DSC resources' {
        mock Get-DscResourceForModule -mockwith {}
        mock Get-FailedDscResource -mockwith {
            [pscustomobject]@{name='TestResource'},
            [pscustomobject]@{name='SecondResource'}
        }

        it 'should throw an exception' {
            { Test-DscModuleResourceIsValid} |
                should throw
        }
    }

    context 'when there are no DSC resources' {
        mock Get-DscResourceForModule -mockwith {}
        mock Get-FailedDscResource -mockwith {}

        $result = Test-DscModuleResourceIsValid

        it 'should return true' {
            $result | should be $true
        }
    }

    context 'when all DSC resources are valid' {
        mock Get-DscResourceForModule -mockwith {
            [pscustomobject]@{name='TestResource'},
            [pscustomobject]@{name='SecondResource'}
        }
        mock Get-FailedDscResource -mockwith {}

        $result = Test-DscModuleResourceIsValid

        it 'should return true' {
            $result | should be $true
        }
    }
}


text:
using UnityEngine;
using System.Collections;
using DG.Tweening;
using UnityEngine.EventSystems;

public class Planet : MonoBehaviour
{
    public GameObject DefaultSelector;

    bool isFocused = false;

    public CanvasGroup canvas;

    public bool IsFocused
    {
        get
        {
            return isFocused;
        }
    }

    public void Start()
    {
        canvas.alpha = 0;
        canvas.interactable = false;
    }

    public void Focus()
    {
        isFocused = true;
        transform.DOKill();
        transform.DOScale(1.1f * Vector3.one, 0.5f);

        canvas.DOKill();
        canvas.DOFade(1f, 0.5f);
        canvas.interactable = true;

        EventSystem.current.SetSelectedGameObject(DefaultSelector);
    }

    public void Unfocus()
    {
        isFocused = false;
        transform.DOKill();
        transform.DOScale(1.0f * Vector3.one, 0.5f);

        canvas.DOKill();
        canvas.DOFade(0f, 0.5f);
        canvas.interactable = false;
    }

    static string GetCoordinate(int index)
	{
		switch(index)
		{
		case 0:
			return "x"; break;
		case 1:
			return "y"; break;
		case 2:
			return "z"; break;
		default:
			return "w"; break;
		}
	}

	Quaternion initialSubEuler = Quaternion.identity;
	Vector3 initialEuler = Vector3.zero;

	void Update ()
	{

		if (IsFocused && Controller.targeting)
		{
			if (initialSubEuler == Vector3.zero)
			{
				initialSubEuler = InputRemoute.InputPacket.Gyroscope.Attitude.eulerAngles;
				initialEuler = transform.eulerAngles;
			}

			transform.eulerAngles = initialEuler + InputRemoute.InputPacket.Gyroscope.Attitude.eulerAngles - initialSubEuler;
		}
		else if(initialSubEuler != Vector3.zero)
			initialSubEuler = Vector3.zero;

//		if (IsFocused && Controller.targeting)
//		{
//			if (initialSubEuler == Quaternion.identity)
//			{
//				initialSubEuler = InputRemoute.InputPacket.Gyroscope.Attitude;
//				initialEuler = transform.eulerAngles;
//			}
//
//			transform.localRotation = Quaternion.Inverse(InputRemoute.InputPacket.Gyroscope.Attitude) * initialSubEuler;
//		}
//		else if(initialSubEuler != Quaternion.identity)
//			initialSubEuler = Quaternion.identity;
	}

}

/*
 * if (IsFocused && Controller.IsTargeting)
		{
			if (initialSubEuler == Vector3.zero)
			{
				initialSubEuler = InputRemoute.InputPacket.Gyroscope.Attitude.eulerAngles;
				initialEuler = transform.eulerAngles;
			}

			transform.eulerAngles = initialEuler + InputRemoute.InputPacket.Gyroscope.Attitude.eulerAngles - initialSubEuler;
		}
		else if(initialSubEuler != Vector3.zero)
			initialSubEuler = Vector3.zero;
			*/


text:
$(document).ready(function(){
})

toggleStar = function(event) {
  event.target.className == "fa fa-star-o" ? fillStar(event) : emptyStar(event)
}

fillStar = function(event) {
  event.target.className = "fa fa-star";
  review_rating.value =  parseInt($('#review_rating')[0].value) + 1;
}

emptyStar = function(event) {
  event.target.className = "fa fa-star-o";
  review_rating.value = parseInt($('#review_rating')[0].value) - 1;
}


text:
// Copyright 2018 Google Inc. All Rights Reserved.
//
// 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.

using Google.Api.Gax;
using Google.Cloud.ClientTesting;
using Google.Cloud.Diagnostics.Common;
using Google.Cloud.Diagnostics.Common.IntegrationTests;
using Google.Cloud.Logging.Type;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
using static Google.Cloud.Diagnostics.AspNetCore3.IntegrationTests.TestServerHelpers;

namespace Google.Cloud.Diagnostics.AspNetCore3.IntegrationTests
{
    public class DiagnosticsTests
    {
        public DiagnosticsTests()
        {
            // The rate limiter instance is static and only set once.  If we do not reset it at the
            // beginning of each tests the qps will not change.  This is dependent on the tests not
            // running in parallel.
            RateLimiter.Reset();
        }

        [SkippableFact]
        public async Task AddGoogleDiagnosticsForAspNetCore_ConfiguresServices_Default()
        {
            Skip.If((await Platform.InstanceAsync()).Type == PlatformType.Unknown,
                "Default configuration can only be used when running on GCP.");

            var testId = IdGenerator.FromDateTime();
            var startTime = DateTime.UtcNow;

            var hostBuilder = GetHostBuilder(webHostBuilder =>
                webHostBuilder.ConfigureServices(services =>
                    services.AddGoogleDiagnosticsForAspNetCore()));

            using var server = GetTestServer(hostBuilder);
            using var client = server.CreateClient();
            await TestTrace(testId, startTime, client);
            await TestLogging(testId, startTime, client);
            await TestErrorReporting(testId, client, verifyServiceAndVersion: false);
        }

        [Fact]
        public async Task AddGoogleDiagnosticsForAspNetCore_ConfiguresServices()
        {
            var testId = IdGenerator.FromDateTime();
            var startTime = DateTime.UtcNow;

            var hostBuilder = GetHostBuilder(webHostBuilder =>
                webHostBuilder.ConfigureServices(services =>
                    services.AddGoogleDiagnosticsForAspNetCore(
                        TestEnvironment.GetTestProjectId(), EntryData.Service, EntryData.Version)));

            using var server = GetTestServer(hostBuilder);

            var services = GetServices(server);

            // Test tracing DI
            Assert.NotNull(services.GetService<IHttpContextAccessor>());
            Assert.NotNull(services.GetService<IManagedTracer>());

            // Test logging DI
            Assert.NotNull(services.GetService<IExceptionLogger>());
            Assert.NotNull(services.GetService<IContextExceptionLogger>());

            using var client = server.CreateClient();
            await TestTrace(testId, startTime, client);
            await TestLogging(testId, startTime, client);
            await TestErrorReporting(testId, client);
        }

        [Fact]
        public async Task AddGoogleDiagnosticsForAspNetCore_ConfiguresServices_FromHostBuilderContext()
        {
            var testId = IdGenerator.FromDateTime();
            var startTime = DateTime.UtcNow;
            var configurationData = new Dictionary<string, string>
            {
                { "project_id", TestEnvironment.GetTestProjectId() },
                { "module_id", EntryData.Service },
                { "version_id", EntryData.Version }
            };

            var hostBuilder = GetHostBuilder(webHostBuilder =>
                webHostBuilder
                    .ConfigureServices((ctx, services) =>
                        services.AddGoogleDiagnosticsForAspNetCore(
                            ctx.Configuration["project_id"], ctx.Configuration["module_id"], ctx.Configuration["version_id"]))
                    .ConfigureAppConfiguration((hostContext, configBuilder) => configBuilder.AddInMemoryCollection(configurationData)));

            using var server = GetTestServer(hostBuilder);
            using var client = server.CreateClient();
            await TestTrace(testId, startTime, client);
            await TestLogging(testId, startTime, client);
            await TestErrorReporting(testId, client);
        }

        [Fact]
        public async Task AddGoogleDiagnosticsForAspNetCore_ConfiguresComponents()
        {
            var testId = IdGenerator.FromDateTime();
            var startTime = DateTime.UtcNow;

            var hostBuilder = GetHostBuilder(webHostBuilder =>
                webHostBuilder
                    .UseDefaultServiceProvider(options => options.ValidateScopes = true)
                    .ConfigureServices(services =>
                        services.AddGoogleDiagnosticsForAspNetCore(
                            TestEnvironment.GetTestProjectId(), EntryData.Service, EntryData.Version,
                            traceOptions: TraceOptions.Create(retryOptions: RetryOptions.NoRetry(ExceptionHandling.Propagate)),
                            loggingOptions: LoggingOptions.Create(retryOptions: RetryOptions.NoRetry(ExceptionHandling.Propagate)),
                            errorReportingOptions: ErrorReportingOptions.Create(retryOptions: RetryOptions.NoRetry(ExceptionHandling.Propagate)))));

            using var server = GetTestServer(hostBuilder);
            using var client = server.CreateClient();
            await TestTrace(testId, startTime, client);
            await TestLogging(testId, startTime, client);
            await TestErrorReporting(testId, client);
        }

        [Fact]
        public async Task AddGoogleDiagnosticsForAspNetCore_ConfiguresComponents_FullyIndividually()
        {
            var testId = IdGenerator.FromDateTime();
            var startTime = DateTime.UtcNow;
            string projectId = TestEnvironment.GetTestProjectId();
            string serviceName = EntryData.Service;
            string version = EntryData.Version;

            var hostBuilder = GetHostBuilder(webHostBuilder =>
                webHostBuilder
                    .UseDefaultServiceProvider(options => options.ValidateScopes = true)
                    .ConfigureServices(services =>
                        services.AddGoogleDiagnosticsForAspNetCore(
                            traceOptions: new AspNetCoreTraceOptions
                            {
                                ServiceOptions = new TraceServiceOptions
                                {
                                    ProjectId = projectId,
                                    Options = TraceOptions.Create(retryOptions: RetryOptions.NoRetry(ExceptionHandling.Propagate))
                                }
                            },
                            loggingOptions: new LoggingServiceOptions
                            {
                                ProjectId = projectId,
                                ServiceName = serviceName,
                                Version = version,
                                Options = LoggingOptions.Create(retryOptions: RetryOptions.NoRetry(ExceptionHandling.Propagate))
                            },
                            errorReportingOptions: new ErrorReportingServiceOptions
                            {
                                ProjectId = projectId,
                                ServiceName = serviceName,
                                Version = version,
                                Options = ErrorReportingOptions.Create(retryOptions: RetryOptions.NoRetry(ExceptionHandling.Propagate))
                            })));

            using var server = GetTestServer(hostBuilder);
            using var client = server.CreateClient();
            await TestTrace(testId, startTime, client);
            await TestLogging(testId, startTime, client);
            await TestErrorReporting(testId, client);
        }

        private static async Task TestLogging(string testId, DateTime startTime, HttpClient client)
        {
            await client.GetAsync($"/Main/Warning/{testId}");
            var results = LogEntryPolling.Default.GetEntries(startTime, testId, 1, LogSeverity.Warning);

            Assert.Single(results);
            var result = results.Single();
            Assert.Single(result.Labels);
            var label = result.Labels.Single();
            Assert.Equal("trace_identifier", label.Key);
            Assert.NotEmpty(label.Value);
        }

        private static async Task TestTrace(string testId, DateTimeOffset startTime, HttpClient client)
        {
            var uri = $"/Trace/{nameof(TraceController.Trace)}/{testId}";
            var childSpanName = EntryData.GetMessage(nameof(TraceController.Trace), testId);

            var response = await client.GetAsync(uri);

            var trace = TraceEntryPolling.Default.GetTrace(uri, startTime);

            TraceEntryVerifiers.AssertParentChildSpan(trace, uri, childSpanName);
            TraceEntryVerifiers.AssertSpanLabelsContains(
                trace.Spans.First(s => s.Name == uri), TraceEntryData.HttpGetSuccessLabels);

            Assert.False(response.Headers.Contains(TraceHeaderContext.TraceHeader));
        }

        private static async Task TestErrorReporting(string testId, HttpClient client, bool verifyServiceAndVersion = true)
        {
            await Assert.ThrowsAsync<Exception>(() => client.GetAsync($"/ErrorReporting/{nameof(ErrorReportingController.ThrowsException)}/{testId}"));
            var errorEvent = ErrorEventEntryVerifiers.VerifySingle(ErrorEventEntryPolling.Default, testId);
            ErrorEventEntryVerifiers.VerifyFullErrorEventLogged(errorEvent, testId, nameof(ErrorReportingController.ThrowsException), verifyServiceAndVersion: verifyServiceAndVersion);
        }
    }
}


text:
package org.scalatest.tools

import org.scalatest._

class RunnerSuite() extends Suite with PrivateMethodTester {

  def testParseArgsIntoLists() {

    // this is how i solved the problem of wanting to reuse these val names, runpathList, reportersList, etc.
    // by putting them in a little verify method, it gets reused each time i call that method
    def verify(
      args: Array[String],
      expectedRunpathList: List[String],
      expectedReporterList: List[String],
      expectedSuitesList: List[String],
      expectedJunitsList: List[String],
      expectedPropsList: List[String],
      expectedIncludesList: List[String],
      expectedExcludesList: List[String],
      expectedConcurrentList: List[String],
      expectedMemberOfList: List[String],
      expectedBeginsWithList: List[String],
      expectedTestNGList: List[String]
    ) = {

      val (
        runpathList,
        reportersList,
        suitesList,
        junitsList,
        propsList,
        includesList,
        excludesList,
        concurrentList,
        memberOfList,
        beginsWithList,
        testNGList
      ) = Runner.parseArgs(args)

      assert(runpathList === expectedRunpathList)
      assert(reportersList === expectedReporterList)
      assert(suitesList === expectedSuitesList)
      assert(junitsList === expectedJunitsList)
      assert(propsList === expectedPropsList)
      assert(includesList === expectedIncludesList)
      assert(excludesList === expectedExcludesList)
      assert(concurrentList === expectedConcurrentList)
      assert(memberOfList === expectedMemberOfList)
      assert(beginsWithList === expectedBeginsWithList)
      assert(testNGList === expectedTestNGList)
    }

    verify(
      Array("-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
            "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out", "-p"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-p"),
      List("-g", "-g", "-f", "file.out"),
      Nil,
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil
    )

    verify(
      Array("-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
            "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out",
            "-s", "SuiteOne", "-s", "SuiteTwo"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-f", "file.out"),
      List("-s", "SuiteOne", "-s", "SuiteTwo"),
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil
    )

    verify(
      Array(),
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil,
      Nil
    )

    verify(
      Array("-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
            "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out",
            "-n", "JustOne", "-s", "SuiteOne", "-s", "SuiteTwo"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-f", "file.out"),
      List("-s", "SuiteOne", "-s", "SuiteTwo"),
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      List("-n", "JustOne"),
      Nil,
      Nil,
      Nil,
      Nil,
      Nil
    )

    verify(
      Array("-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
            "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out",
            "-n", "One Two Three", "-l", "SlowTests", "-s", "SuiteOne", "-s", "SuiteTwo"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-f", "file.out"),
      List("-s", "SuiteOne", "-s", "SuiteTwo"),
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      List("-n", "One Two Three"),
      List("-l", "SlowTests"),
      Nil,
      Nil,
      Nil,
      Nil
    )

    verify(
      Array("-c", "-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
            "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out",
            "-n", "One Two Three", "-l", "SlowTests", "-s", "SuiteOne", "-s", "SuiteTwo"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-f", "file.out"),
      List("-s", "SuiteOne", "-s", "SuiteTwo"),
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      List("-n", "One Two Three"),
      List("-l", "SlowTests"),
      List("-c"),
      Nil,
      Nil,
      Nil
    )

    verify(
      Array("-c", "-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
          "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out",
          "-n", "One Two Three", "-l", "SlowTests", "-s", "SuiteOne", "-s", "SuiteTwo", "-m", "com.example.webapp",
          "-w", "com.example.root"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-f", "file.out"),
      List("-s", "SuiteOne", "-s", "SuiteTwo"),
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      List("-n", "One Two Three"),
      List("-l", "SlowTests"),
      List("-c"),
      List("-m", "com.example.webapp"),
      List("-w", "com.example.root"),
      Nil
    )
    // Try a TestNGSuite
    verify(
      Array("-c", "-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
          "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out",
          "-n", "One Two Three", "-l", "SlowTests", "-s", "SuiteOne", "-s", "SuiteTwo", "-m", "com.example.webapp",
          "-w", "com.example.root", "-t", "some/path/file.xml"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-f", "file.out"),
      List("-s", "SuiteOne", "-s", "SuiteTwo"),
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      List("-n", "One Two Three"),
      List("-l", "SlowTests"),
      List("-c"),
      List("-m", "com.example.webapp"),
      List("-w", "com.example.root"),
      List("-t", "some/path/file.xml")
    )
    // Try a junit Suite
    verify(
      Array("-c", "-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
          "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-f", "file.out",
          "-n", "One Two Three", "-l", "SlowTests", "-s", "SuiteOne", "-j", "junitTest", "-j", "junitTest2",
          "-m", "com.example.webapp", "-w", "com.example.root", "-t", "some/path/file.xml"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-f", "file.out"),
      List("-s", "SuiteOne"),
      List("-j", "junitTest", "-j", "junitTest2"),
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      List("-n", "One Two Three"),
      List("-l", "SlowTests"),
      List("-c"),
      List("-m", "com.example.webapp"),
      List("-w", "com.example.root"),
      List("-t", "some/path/file.xml")
    )
    // Test -u option
    verify(
      Array("-c", "-g", "-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188", "-p",
          "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\"", "-g", "-u", "directory/",
          "-n", "One Two Three", "-l", "SlowTests", "-s", "SuiteOne",
          "-m", "com.example.webapp", "-w", "com.example.root", "-t", "some/path/file.xml"),
      List("-p", "\"serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar\""),
      List("-g", "-g", "-u", "directory/"),
      List("-s", "SuiteOne"),
      Nil,
      List("-Dincredible=whatshername", "-Ddbname=testdb", "-Dserver=192.168.1.188"),
      List("-n", "One Two Three"),
      List("-l", "SlowTests"),
      List("-c"),
      List("-m", "com.example.webapp"),
      List("-w", "com.example.root"),
      List("-t", "some/path/file.xml")
    )
  }

  def testParseCompoundArgIntoSet() {
    expect(Set("Cat", "Dog")) {
      Runner.parseCompoundArgIntoSet(List("-n", "Cat Dog"), "-n")
    }
  }

  def testParseConfigSet() {

    val parseConfigSet = PrivateMethod[Set[ReporterConfigParam]]('parseConfigSet)

    intercept[NullPointerException] {
      Runner invokePrivate parseConfigSet(null)
    }
    intercept[IllegalArgumentException] {
      Runner invokePrivate parseConfigSet("-fJ")
    }
    intercept[IllegalArgumentException] {
      Runner invokePrivate parseConfigSet("-uJ")
    }
    intercept[IllegalArgumentException] {
      Runner invokePrivate parseConfigSet("-oYZTFUPBISARG-")
    }
    intercept[IllegalArgumentException] {
      Runner invokePrivate parseConfigSet("-")
    }
    intercept[IllegalArgumentException] {
      Runner invokePrivate parseConfigSet("")
    }

    expect(Set(FilterTestStarting)) {
      Runner invokePrivate parseConfigSet("-oN")
    }
    expect(Set(FilterTestSucceeded)) {
      Runner invokePrivate parseConfigSet("-oC")
    }
    expect(Set(FilterTestIgnored)) {
      Runner invokePrivate parseConfigSet("-oX")
    }
    expect(Set(FilterTestPending)) {
      Runner invokePrivate parseConfigSet("-oE")
    }
    expect(Set(FilterSuiteStarting)) {
      Runner invokePrivate parseConfigSet("-oH")
    }
    expect(Set(FilterSuiteCompleted)) {
      Runner invokePrivate parseConfigSet("-oL")
    }
    expect(Set(FilterInfoProvided)) {
      Runner invokePrivate parseConfigSet("-oO")
    }
    expect(Set(PresentWithoutColor)) {
      Runner invokePrivate parseConfigSet("-oW")
    }
    expect(Set(PresentAllDurations)) {
      Runner invokePrivate parseConfigSet("-oD")
    }
    expect(Set(PresentFullStackTraces)) {
      Runner invokePrivate parseConfigSet("-oF")
    }
    expect(Set[ReporterConfigParam]()) {
      Runner invokePrivate parseConfigSet("-f")
    }
    expect(Set[ReporterConfigParam]()) {
      Runner invokePrivate parseConfigSet("-u")
    }

    expect(Set(FilterInfoProvided, PresentWithoutColor)) {
      Runner invokePrivate parseConfigSet("-oOW")
    }
    expect(Set(FilterInfoProvided, PresentWithoutColor)) {
      Runner invokePrivate parseConfigSet("-oWO") // Just reverse the order of the params
    }
    val allOpts = Set(
      FilterInfoProvided,
      FilterSuiteCompleted,
      FilterSuiteStarting,
      FilterTestIgnored,
      FilterTestPending,
      FilterTestStarting,
      FilterTestSucceeded,
      PresentAllDurations,
      PresentWithoutColor,
      PresentFullStackTraces
    )
    expect(allOpts) {
      Runner invokePrivate parseConfigSet("-oNCXEHLOWDF")
    }
  }

  def testParseReporterArgsIntoSpecs() {
    intercept[NullPointerException] {
      Runner.parseReporterArgsIntoConfigurations(null)
    }
    intercept[NullPointerException] {
      Runner.parseReporterArgsIntoConfigurations(List("Hello", null, "World"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("Hello", "-", "World"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("Hello", "", "World"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("-g", "-l", "-o"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("Hello", " there", " world!"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("-g", "-o", "-g", "-e"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("-o", "-o", "-g", "-e"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("-e", "-o", "-g", "-e"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("-f")) // Can't have -f last, because need a file name
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("-u")) // Can't have -u last, because need a directory name
    }
    intercept[IllegalArgumentException] {
      Runner.parseReporterArgsIntoConfigurations(List("-r")) // Can't have -r last, because need a reporter class
    }
    expect(new ReporterConfigurations(None, Nil, Nil, None, None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(Nil)
    }
    expect(new ReporterConfigurations(Some(new GraphicReporterConfiguration(Set())), Nil, Nil, None, None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-g"))
    }
    expect(new ReporterConfigurations(Some(new GraphicReporterConfiguration(Set(FilterSuiteCompleted))), Nil, Nil, None, None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-gL"))
    }
    expect(new ReporterConfigurations(None, Nil, Nil, Some(new StandardOutReporterConfiguration(Set())), None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-o"))
    }
    expect(new ReporterConfigurations(None, Nil, Nil, Some(new StandardOutReporterConfiguration(Set(FilterTestSucceeded,FilterTestIgnored))), None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-oCX"))
    }
    expect(new ReporterConfigurations(None, Nil, Nil, None, Some(new StandardErrReporterConfiguration(Set())), Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-e"))
    }
    expect(new ReporterConfigurations(None, Nil, Nil, None, Some(new StandardErrReporterConfiguration(Set(PresentFullStackTraces))), Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-eF"))
    }
    expect(new ReporterConfigurations(None, List(new FileReporterConfiguration(Set(), "theFilename")), Nil, None, None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-f", "theFilename"))
    }
    expect(new ReporterConfigurations(None, Nil, List(new XmlReporterConfiguration(Set(), "target")), None, None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-u", "target"))
    }
    expect(new ReporterConfigurations(None, Nil, List(new XmlReporterConfiguration(Set(), "target")), None, None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-uN", "target"))
    }
    expect(new ReporterConfigurations(None, List(new FileReporterConfiguration(Set(FilterTestStarting), "theFilename")), Nil, None, None, Nil, Nil)) {
      Runner.parseReporterArgsIntoConfigurations(List("-fN", "theFilename"))
    }
    expect(new ReporterConfigurations(None, Nil, Nil, None, None, Nil, List(new CustomReporterConfiguration(Set(), "the.reporter.Class")))) {
      Runner.parseReporterArgsIntoConfigurations(List("-r", "the.reporter.Class"))
    }
    expect(new ReporterConfigurations(None, Nil, Nil, None, None, Nil, List(new CustomReporterConfiguration(Set(FilterTestPending), "the.reporter.Class")))) {
      Runner.parseReporterArgsIntoConfigurations(List("-rE", "the.reporter.Class"))
    }
  }

  def testParseSuiteArgsIntoClassNameStrings() {
    intercept[NullPointerException] {
      Runner.parseSuiteArgsIntoNameStrings(null, "-s")
    }
    intercept[NullPointerException] {
      Runner.parseSuiteArgsIntoNameStrings(List("-s", null, "-s"), "-s")
    }
    intercept[IllegalArgumentException] {
      Runner.parseSuiteArgsIntoNameStrings(List("-s", "SweetSuite", "-s"), "-s")
    }
    intercept[IllegalArgumentException] {
      Runner.parseSuiteArgsIntoNameStrings(List("-s", "SweetSuite", "-s", "-s"), "-s")
    }
    expect(List("SweetSuite", "OKSuite")) {
      Runner.parseSuiteArgsIntoNameStrings(List("-s", "SweetSuite", "-s", "OKSuite"), "-s")
    }
    expect(List("SweetSuite", "OKSuite", "SomeSuite")) {
      Runner.parseSuiteArgsIntoNameStrings(List("-s", "SweetSuite", "-s", "OKSuite", "-s", "SomeSuite"), "-s")
    }
  }

  def testParseRunpathArgIntoList() {
    intercept[NullPointerException] {
      Runner.parseRunpathArgIntoList(null)
    }
    intercept[NullPointerException] {
      Runner.parseRunpathArgIntoList(List("-p", null))
    }
    intercept[NullPointerException] {
      Runner.parseRunpathArgIntoList(List(null, "serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseRunpathArgIntoList(List("-p"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseRunpathArgIntoList(List("-p", "bla", "bla"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseRunpathArgIntoList(List("-pX", "bla"))
    }
    intercept[IllegalArgumentException] {
      Runner.parseRunpathArgIntoList(List("-p", "  "))
    }
    intercept[IllegalArgumentException] {
      Runner.parseRunpathArgIntoList(List("-p", "\t"))
    }
    expect(List("bla")) {
      Runner.parseRunpathArgIntoList(List("-p", "bla"))
    }
    expect(List("bla", "bla", "bla")) {
      Runner.parseRunpathArgIntoList(List("-p", "bla bla bla"))
    }
    expect(List("serviceuitest-1.1beta4.jar", "myjini", "http://myhost:9998/myfile.jar")) {
      Runner.parseRunpathArgIntoList(List("-p", "serviceuitest-1.1beta4.jar myjini http://myhost:9998/myfile.jar"))
    }
    expect(List("\\", "c:\\", "c:\\Program Files", "c:\\Documents and Settings", "\\", "myjini")) {
      Runner.parseRunpathArgIntoList(List("-p", """\ c:\ c:\Program\ Files c:\Documents\ and\ Settings \ myjini"""))
    }
  }

  def testParsePropertiesArgsIntoMap() {
    intercept[NullPointerException] {
      Runner.parsePropertiesArgsIntoMap(null)
    }
    intercept[NullPointerException] {
      Runner.parsePropertiesArgsIntoMap(List("-Da=b", null))
    }
    intercept[IllegalArgumentException] {
      Runner.parsePropertiesArgsIntoMap(List("-Dab")) // = sign missing
    }
    intercept[IllegalArgumentException] {
      Runner.parsePropertiesArgsIntoMap(List("ab")) // needs to start with -D
    }
    intercept[IllegalArgumentException] {
      Runner.parsePropertiesArgsIntoMap(List("-D=ab")) // no key
    }
    intercept[IllegalArgumentException] {
      Runner.parsePropertiesArgsIntoMap(List("-Dab=")) // no value
    }
    expect(Map("a" -> "b", "cat" -> "dog", "Glorp" -> "Glib")) {
      Runner.parsePropertiesArgsIntoMap(List("-Da=b", "-Dcat=dog", "-DGlorp=Glib"))
    }
  }

  def testCheckArgsForValidity() {
    intercept[NullPointerException] {
      Runner.checkArgsForValidity(null)
    }
    expect(None) {
      Runner.checkArgsForValidity(Array("-Ddbname=testdb", "-Dserver=192.168.1.188", "-p", "serviceuitest-1.1beta4.jar", "-g", "-eFBA", "-s", "MySuite"))
    }
    assert(Runner.checkArgsForValidity(Array("-Ddbname=testdb", "-Dserver=192.168.1.188", "-z", "serviceuitest-1.1beta4.jar", "-g", "-eFBA", "-s", "MySuite")) != None)
    expect(None) {
      Runner.checkArgsForValidity(Array("-Ddbname=testdb", "-Dserver=192.168.1.188", "-p", "serviceuitest-1.1beta4.jar", "-g", "-eFBA", "-s", "MySuite", "-c"))
    }
  }

/*
  def testRunpathPropertyAddedToPropertiesMap() {
    val a = new Suite {
      var theProperties: Map[String, Any] = Map()
      override def execute(testName: Option[String], reporter: Reporter, stopper: Stopper, includes: Set[String], excludes: Set[String],
          properties: Map[String, Any], distributor: Option[Distributor]) {
        theProperties = properties
      }
    }

    val dispatchReporter = new DispatchReporter(Nil, System.out)
    val suitesList = List("org.scalatest.usefulstuff.RunpathPropCheckerSuite")

    // Runner.doRunRunRunADoRunRun(new DispatchReporter)
    // Runner.doRunRunRunADoRunRun(dispatchReporter, suitesList, new Stopper {}, Filter(), Map(), false,
         List(), List(), runpath: "build_tests", loader: ClassLoader,
      doneListener: RunDoneListener) = {

    ()
  }
}

package org.scalatest.usefulstuff {

  class RunpathPropCheckerSuite extends Suite {
    var theProperties: Map[String, Any] = Map()
    override def execute(testName: Option[String], reporter: Reporter, stopper: Stopper, includes: Set[String], excludes: Set[String],
        properties: Map[String, Any], distributor: Option[Distributor]) {
      theProperties = properties
    }
  }
*/
}


text:
@interface BBFloatingExamplesViewController () <BBFormElementDelegate>
{
    BBFormTextFieldElement *textFieldElement;
    BBFormSelectFieldElement *selectFieldElement;
    BBFormDateFieldElement *dateFieldElement;
    BBFormTextViewElement *textViewElement;
    BBFormAutoCompleteFieldElement *autoCompleteElement;
}

@property (nonatomic, strong) IBOutlet BBFloatingLabelDateField *dateField;
@property (nonatomic, strong) IBOutlet BBFloatingLabelSelectField *selectField;
@property (nonatomic, strong) IBOutlet BBFloatingLabelTextField *textField;
@property (nonatomic, strong) IBOutlet BBFloatingLabelTextView *textView;
@property (nonatomic, strong) IBOutlet BBFloatingLabelAutoCompleteField *autoTextField;

@end

@implementation BBFloatingExamplesViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    textFieldElement = [BBFormTextFieldElement textInputElementWithID:0 placeholderText:@"Question" value:nil delegate:self];
    selectFieldElement = [BBFormSelectFieldElement selectElementWithID:1 labelText:@"Select Option" values:@[@"1 minute",@"5 minutes",@"15 minutes",@"1 hour"] index:0 insertBlank:YES delegate:self];
    dateFieldElement = [BBFormDateFieldElement datePickerElementWithID:2 labelText:@"Enter a date" date:nil datePickerMode:UIDatePickerModeDate delegate:nil];
    textViewElement = [BBFormTextViewElement textViewElementWithID:3 placeholderText:@"Enter some text" value:nil delegate:nil];
    autoCompleteElement = [BBFormAutoCompleteFieldElement selectElementWithID:1 labelText:@"Select Option" values:@[@"Dog",@"Cat",@"Rabbity Rabbit",@"Horse",@"Dog",@"Cat",@"Rabbit",@"Horse",@"Dog",@"Cat",@"Rabbit",@"Horse"] delegate:self];
    autoCompleteElement.displayAllWhenBlank = YES;
    autoCompleteElement.indexRequired = YES;

    if (self.prePopulate)
    {
        textFieldElement.value = @"Some text";
        selectFieldElement.index = 1;
        dateFieldElement.date = [NSDate date];
        textViewElement.value = @"A longer piece of text";
        autoCompleteElement.index = 1;
    }

    [_textField updateWithElement:textFieldElement];
    [_selectField updateWithElement:selectFieldElement];
    [_dateField updateWithElement:dateFieldElement];
    [_textView updateWithElement:textViewElement];
    [_autoTextField updateWithElement:autoCompleteElement];

    BBConditionPresent *presentCondition = [[BBConditionPresent alloc] initWithLocalizedViolationString:NSLocalizedString(@"Please complete all fields", @"Please complete all fields")];
    textFieldElement.validator = [[BBValidator alloc] initWithCondition:presentCondition,nil];
    selectFieldElement.validator = [[BBValidator alloc] initWithCondition:presentCondition,nil];
    dateFieldElement.validator = [[BBValidator alloc] initWithCondition:presentCondition,nil];
    textViewElement.validator = [[BBValidator alloc] initWithCondition:presentCondition,nil];
    autoCompleteElement.validator = [[BBValidator alloc] initWithCondition:presentCondition,nil];

    self.formModel = @[textFieldElement, selectFieldElement, dateFieldElement, textViewElement, autoCompleteElement];

}

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

    // create the model
}
@end


text:
import { inspect } from "ember-metal/utils";
import create from 'ember-metal/platform/create';

QUnit.module("Ember.inspect");

QUnit.test("strings", function() {
  equal(inspect("foo"), "foo");
});

QUnit.test("numbers", function() {
  equal(inspect(2.6), "2.6");
});

QUnit.test("null", function() {
  equal(inspect(null), "null");
});

QUnit.test("undefined", function() {
  equal(inspect(undefined), "undefined");
});

QUnit.test("true", function() {
  equal(inspect(true), "true");
});

QUnit.test("false", function() {
  equal(inspect(false), "false");
});

QUnit.test("object", function() {
  equal(inspect({}), "{}");
  equal(inspect({ foo: 'bar' }), "{foo: bar}");
  equal(inspect({ foo() { return this; } }), "{foo: function() { ... }}");
});

QUnit.test("objects without a prototype", function() {
  var prototypelessObj = create(null);
  equal(inspect({ foo: prototypelessObj }), "{foo: [object Object]}");
});

QUnit.test("array", function() {
  equal(inspect([1,2,3]), "[1,2,3]");
});

QUnit.test("regexp", function() {
  equal(inspect(/regexp/), "/regexp/");
});

QUnit.test("date", function() {
  var inspected = inspect(new Date("Sat Apr 30 2011 13:24:11"));
  ok(inspected.match(/Sat Apr 30/), "The inspected date has its date");
  ok(inspected.match(/2011/), "The inspected date has its year");
  ok(inspected.match(/13:24:11/), "The inspected date has its time");
});


text:
package net.liftweb {
package record {
package field {

import scala.xml._
import net.liftweb.util._
import net.liftweb.common._
import Helpers._
import net.liftweb.http.{S}
import S._

class LongField[OwnerType <: Record[OwnerType]](rec: OwnerType) extends NumericField[Long, OwnerType] {

  def owner = rec

  /**
   * Sets the field value from an Any
   */
  def setFromAny(in: Any): Box[Long] = {
    in match {
      case n: Int => Full(this.set(n))
      case n: Number => Full(this.set(n.longValue))
      case (n: Number) :: _ => Full(this.set(n.longValue))
      case Some(n: Number) => Full(this.set(n.longValue))
      case Full(n: Number) => Full(this.set(n.longValue))
      case None | Empty | Failure(_, _, _) => Full(this.set(0))
      case (s: String) :: _ => setFromString(s)
      case null => Full(this.set(0))
      case s: String => setFromString(s)
      case o => setFromString(o.toString)
    }
  }

  def setFromString(s: String): Box[Long] = {
    try{
      Full(set(java.lang.Long.parseLong(s)));
    } catch {
      case e: Exception => valueCouldNotBeSet = true; Empty
    }
  }

  def defaultValue = 0L

}

import _root_.java.sql.{ResultSet, Types}
import _root_.net.liftweb.mapper.{DriverType}

/**
 * An int field holding DB related logic
 */
abstract class DBLongField[OwnerType <: DBRecord[OwnerType]](rec: OwnerType) extends LongField[OwnerType](rec)
  with JDBCFieldFlavor[Long]{

  def targetSQLType = Types.BIGINT

  /**
   * Given the driver type, return the string required to create the column in the database
   */
  def fieldCreatorString(dbType: DriverType, colName: String): String = colName + " " + dbType.enumColumnType

  def jdbcFriendly(field : String) : Long = value

}

}
}
}


text:
<wpml-config>
    <admin-texts>
        <key name="rossi_options">
            <key name="social_icons">
                <key name="facebook" />
                <key name="twitter" />
				<key name="instagram" />
				<key name="tumblr" />
				<key name="pinterest" />
				<key name="google-plus" />
				<key name="linkedin" />
				<key name="behance" />
				<key name="dribbble" />
				<key name="youtube" />
				<key name="vimeo" />
				<key name="rss" />
            </key>
			<key name="slider_alias" />
			<key name="mini_cart_title" />
			<key name="login_title" />
			<key name="mobile_menu_label" />
			<key name="footer_shipping" />
			<key name="footer_phone" />
			<key name="footer_promo" />
			<key name="footer_signup" />
			<key name="footer_logo_link" />
			<key name="footer_email" />
			<key name="newsletter_title" />
			<key name="newsletter_form" />
			<key name="follow_title" />
			<key name="ftsocial_icons">
                <key name="facebook" />
                <key name="twitter" />
				<key name="instagram" />
				<key name="tumblr" />
				<key name="pinterest" />
				<key name="google-plus" />
				<key name="linkedin" />
				<key name="behance" />
				<key name="dribbble" />
				<key name="youtube" />
				<key name="vimeo" />
				<key name="rss" />
            </key>
			<key name="related_project_title" />
			<key name="related_title" />
			<key name="upsells_title" />
			<key name="crosssells_title" />
			<key name="detail_link_text" />
			<key name="quickview_link_text" />
			<key name="readmore_text" />
			<key name="map_desc" />
			<key name="map_address" />
        </key>
        <key name="simple_string_option" />
    </admin-texts>
</wpml-config>


text:
namespace mlir {
class Identifier;
class Operation;

/// This class allows for representing and managing the symbol table used by
/// operations with the 'SymbolTable' trait. Inserting into and erasing from
/// this SymbolTable will also insert and erase from the Operation given to it
/// at construction.
class SymbolTable {
public:
  /// Build a symbol table with the symbols within the given operation.
  SymbolTable(Operation *symbolTableOp);

  /// Look up a symbol with the specified name, returning null if no such
  /// name exists. Names never include the @ on them.
  Operation *lookup(StringRef name) const;
  template <typename T> T lookup(StringRef name) const {
    return dyn_cast_or_null<T>(lookup(name));
  }

  /// Erase the given symbol from the table.
  void erase(Operation *symbol);

  /// Insert a new symbol into the table, and rename it as necessary to avoid
  /// collisions. Also insert at the specified location in the body of the
  /// associated operation.
  void insert(Operation *symbol, Block::iterator insertPt = {});

  /// Return the name of the attribute used for symbol names.
  static StringRef getSymbolAttrName() { return "sym_name"; }

  /// Returns the associated operation.
  Operation *getOp() const { return symbolTableOp; }

  /// Return the name of the attribute used for symbol visibility.
  static StringRef getVisibilityAttrName() { return "sym_visibility"; }

  //===--------------------------------------------------------------------===//
  // Symbol Utilities
  //===--------------------------------------------------------------------===//

  /// An enumeration detailing the different visibility types that a symbol may
  /// have.
  enum class Visibility {
    /// The symbol is public and may be referenced anywhere internal or external
    /// to the visible references in the IR.
    Public,

    /// The symbol is private and may only be referenced by SymbolRefAttrs local
    /// to the operations within the current symbol table.
    Private,

    /// The symbol is visible to the current IR, which may include operations in
    /// symbol tables above the one that owns the current symbol. `Nested`
    /// visibility allows for referencing a symbol outside of its current symbol
    /// table, while retaining the ability to observe all uses.
    Nested,
  };

  /// Returns the name of the given symbol operation.
  static StringRef getSymbolName(Operation *symbol);
  /// Sets the name of the given symbol operation.
  static void setSymbolName(Operation *symbol, StringRef name);

  /// Returns the visibility of the given symbol operation.
  static Visibility getSymbolVisibility(Operation *symbol);
  /// Sets the visibility of the given symbol operation.
  static void setSymbolVisibility(Operation *symbol, Visibility vis);

  /// Returns the nearest symbol table from a given operation `from`. Returns
  /// nullptr if no valid parent symbol table could be found.
  static Operation *getNearestSymbolTable(Operation *from);

  /// Walks all symbol table operations nested within, and including, `op`. For
  /// each symbol table operation, the provided callback is invoked with the op
  /// and a boolean signifying if the symbols within that symbol table can be
  /// treated as if all uses within the IR are visible to the caller.
  /// `allSymUsesVisible` identifies whether all of the symbol uses of symbols
  /// within `op` are visible.
  static void walkSymbolTables(Operation *op, bool allSymUsesVisible,
                               function_ref<void(Operation *, bool)> callback);

  /// Returns the operation registered with the given symbol name with the
  /// regions of 'symbolTableOp'. 'symbolTableOp' is required to be an operation
  /// with the 'OpTrait::SymbolTable' trait.
  static Operation *lookupSymbolIn(Operation *op, StringRef symbol);
  static Operation *lookupSymbolIn(Operation *op, SymbolRefAttr symbol);
  /// A variant of 'lookupSymbolIn' that returns all of the symbols referenced
  /// by a given SymbolRefAttr. Returns failure if any of the nested references
  /// could not be resolved.
  static LogicalResult lookupSymbolIn(Operation *op, SymbolRefAttr symbol,
                                      SmallVectorImpl<Operation *> &symbols);

  /// Returns the operation registered with the given symbol name within the
  /// closest parent operation of, or including, 'from' with the
  /// 'OpTrait::SymbolTable' trait. Returns nullptr if no valid symbol was
  /// found.
  static Operation *lookupNearestSymbolFrom(Operation *from, StringRef symbol);
  static Operation *lookupNearestSymbolFrom(Operation *from,
                                            SymbolRefAttr symbol);
  template <typename T>
  static T lookupNearestSymbolFrom(Operation *from, StringRef symbol) {
    return dyn_cast_or_null<T>(lookupNearestSymbolFrom(from, symbol));
  }
  template <typename T>
  static T lookupNearestSymbolFrom(Operation *from, SymbolRefAttr symbol) {
    return dyn_cast_or_null<T>(lookupNearestSymbolFrom(from, symbol));
  }

  /// This class represents a specific symbol use.
  class SymbolUse {
  public:
    SymbolUse(Operation *op, SymbolRefAttr symbolRef)
        : owner(op), symbolRef(symbolRef) {}

    /// Return the operation user of this symbol reference.
    Operation *getUser() const { return owner; }

    /// Return the symbol reference that this use represents.
    SymbolRefAttr getSymbolRef() const { return symbolRef; }

  private:
    /// The operation that this access is held by.
    Operation *owner;

    /// The symbol reference that this use represents.
    SymbolRefAttr symbolRef;
  };

  /// This class implements a range of SymbolRef uses.
  class UseRange {
  public:
    UseRange(std::vector<SymbolUse> &&uses) : uses(std::move(uses)) {}

    using iterator = std::vector<SymbolUse>::const_iterator;
    iterator begin() const { return uses.begin(); }
    iterator end() const { return uses.end(); }

  private:
    std::vector<SymbolUse> uses;
  };

  /// Get an iterator range for all of the uses, for any symbol, that are nested
  /// within the given operation 'from'. This does not traverse into any nested
  /// symbol tables. This function returns None if there are any unknown
  /// operations that may potentially be symbol tables.
  static Optional<UseRange> getSymbolUses(Operation *from);
  static Optional<UseRange> getSymbolUses(Region *from);

  /// Get all of the uses of the given symbol that are nested within the given
  /// operation 'from'. This does not traverse into any nested symbol tables.
  /// This function returns None if there are any unknown operations that may
  /// potentially be symbol tables.
  static Optional<UseRange> getSymbolUses(StringRef symbol, Operation *from);
  static Optional<UseRange> getSymbolUses(Operation *symbol, Operation *from);
  static Optional<UseRange> getSymbolUses(StringRef symbol, Region *from);
  static Optional<UseRange> getSymbolUses(Operation *symbol, Region *from);

  /// Return if the given symbol is known to have no uses that are nested
  /// within the given operation 'from'. This does not traverse into any nested
  /// symbol tables. This function will also return false if there are any
  /// unknown operations that may potentially be symbol tables. This doesn't
  /// necessarily mean that there are no uses, we just can't conservatively
  /// prove it.
  static bool symbolKnownUseEmpty(StringRef symbol, Operation *from);
  static bool symbolKnownUseEmpty(Operation *symbol, Operation *from);
  static bool symbolKnownUseEmpty(StringRef symbol, Region *from);
  static bool symbolKnownUseEmpty(Operation *symbol, Region *from);

  /// Attempt to replace all uses of the given symbol 'oldSymbol' with the
  /// provided symbol 'newSymbol' that are nested within the given operation
  /// 'from'. This does not traverse into any nested symbol tables. If there are
  /// any unknown operations that may potentially be symbol tables, no uses are
  /// replaced and failure is returned.
  LLVM_NODISCARD static LogicalResult replaceAllSymbolUses(StringRef oldSymbol,
                                                           StringRef newSymbol,
                                                           Operation *from);
  LLVM_NODISCARD static LogicalResult
  replaceAllSymbolUses(Operation *oldSymbol, StringRef newSymbolName,
                       Operation *from);
  LLVM_NODISCARD static LogicalResult
  replaceAllSymbolUses(StringRef oldSymbol, StringRef newSymbol, Region *from);
  LLVM_NODISCARD static LogicalResult
  replaceAllSymbolUses(Operation *oldSymbol, StringRef newSymbolName,
                       Region *from);

private:
  Operation *symbolTableOp;

  /// This is a mapping from a name to the symbol with that name.
  llvm::StringMap<Operation *> symbolTable;

  /// This is used when name conflicts are detected.
  unsigned uniquingCounter = 0;
};

//===----------------------------------------------------------------------===//
// SymbolTable Trait Types
//===----------------------------------------------------------------------===//

namespace detail {
LogicalResult verifySymbolTable(Operation *op);
LogicalResult verifySymbol(Operation *op);
} // namespace detail

namespace OpTrait {
/// A trait used to provide symbol table functionalities to a region operation.
/// This operation must hold exactly 1 region. Once attached, all operations
/// that are directly within the region, i.e not including those within child
/// regions, that contain a 'SymbolTable::getSymbolAttrName()' StringAttr will
/// be verified to ensure that the names are uniqued. These operations must also
/// adhere to the constraints defined by the `Symbol` trait, even if they do not
/// inherit from it.
template <typename ConcreteType>
class SymbolTable : public TraitBase<ConcreteType, SymbolTable> {
public:
  static LogicalResult verifyTrait(Operation *op) {
    return ::mlir::detail::verifySymbolTable(op);
  }

  /// Look up a symbol with the specified name, returning null if no such
  /// name exists. Symbol names never include the @ on them. Note: This
  /// performs a linear scan of held symbols.
  Operation *lookupSymbol(StringRef name) {
    return mlir::SymbolTable::lookupSymbolIn(this->getOperation(), name);
  }
  template <typename T> T lookupSymbol(StringRef name) {
    return dyn_cast_or_null<T>(lookupSymbol(name));
  }
  Operation *lookupSymbol(SymbolRefAttr symbol) {
    return mlir::SymbolTable::lookupSymbolIn(this->getOperation(), symbol);
  }
  template <typename T>
  T lookupSymbol(SymbolRefAttr symbol) {
    return dyn_cast_or_null<T>(lookupSymbol(symbol));
  }
};

} // end namespace OpTrait

/// Include the generated symbol interfaces.
#include "mlir/IR/SymbolInterfaces.h.inc"

} // end namespace mlir

#endif // MLIR_IR_SYMBOLTABLE_H


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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.dfareporting.model;

/**
 * Represents a Custom Rich Media Events group.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Campaign Manager 360 API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class CustomRichMediaEvents extends com.google.api.client.json.GenericJson {

  /**
   * List of custom rich media event IDs. Dimension values must be all of type
   * dfa:richMediaEventTypeIdAndName.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<DimensionValue> filteredEventIds;

  /**
   * The kind of resource this is, in this case dfareporting#customRichMediaEvents.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String kind;

  /**
   * List of custom rich media event IDs. Dimension values must be all of type
   * dfa:richMediaEventTypeIdAndName.
   * @return value or {@code null} for none
   */
  public java.util.List<DimensionValue> getFilteredEventIds() {
    return filteredEventIds;
  }

  /**
   * List of custom rich media event IDs. Dimension values must be all of type
   * dfa:richMediaEventTypeIdAndName.
   * @param filteredEventIds filteredEventIds or {@code null} for none
   */
  public CustomRichMediaEvents setFilteredEventIds(java.util.List<DimensionValue> filteredEventIds) {
    this.filteredEventIds = filteredEventIds;
    return this;
  }

  /**
   * The kind of resource this is, in this case dfareporting#customRichMediaEvents.
   * @return value or {@code null} for none
   */
  public java.lang.String getKind() {
    return kind;
  }

  /**
   * The kind of resource this is, in this case dfareporting#customRichMediaEvents.
   * @param kind kind or {@code null} for none
   */
  public CustomRichMediaEvents setKind(java.lang.String kind) {
    this.kind = kind;
    return this;
  }

  @Override
  public CustomRichMediaEvents set(String fieldName, Object value) {
    return (CustomRichMediaEvents) super.set(fieldName, value);
  }

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

}


text:
/*
 *  Written by xphh 2015 with 'MIT License'
 */
#ifndef _POLL_H_
#define _POLL_H_

#include "src/socket.h"

#define READABLE 1
#define WRITABLE 2

C_API int socket_wait(int fd, int flag, int timeout);

typedef struct poll_t *poll_handle;

typedef struct
{
	int fd;
	int flag;
} event_t;

#define POLL_DEL 0
#define POLL_ADD 1
#define POLL_MOD 2

C_API int check_poll(poll_handle);
C_API poll_handle poll_create(int size);
C_API void poll_destroy(poll_handle);
C_API int poll_control(poll_handle, int mode, const event_t *ev);
C_API int poll_do(poll_handle, int timeout);
C_API void poll_event(poll_handle, int id, event_t *ev);

#endif


text:
[![Gem Version](https://img.shields.io/gem/v/capistrano-rails-log.svg)](https://rubygems.org/gems/capistrano-rails-log)
[![Dependencies](https://img.shields.io/gemnasium/ferblape/capistrano-rails-log.svg)](https://gemnasium.com/ferblape/capistrano-rails-log)
[![Code Climate](https://img.shields.io/codeclimate/github/ferblape/capistrano-rails-log.svg)](https://codeclimate.com/github/ferblape/capistrano-rails-log)

# Capistrano::Rails::Log

Remote rails logs for capistrano

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'capistrano-rails-log'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install capistrano-rails-log

## Usage

Require in `Capfile` to use the default task:

```ruby
require 'capistrano/rails/log'
```

This will add a task `rails:log`:

    $ cap production rails:log

You can also start a sandbox session:

    $ cap production rails:log sandbox=1

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Special thanks

This gem has been totally inspired by [capistrano-rails-console](https://github.com/ydkn/capistrano-rails-console) and [this post](http://www.talkingquickly.co.uk/2013/12/tailing-log-files-with-capistrano-3/) from
[talkinquickly](http://www.talkingquickly.co.uk). All the merit is theirs.


text:
package com.register.alien.exportformat;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

import com.register.alien.model.AlienModel;
import com.register.main.CommonConstant;

// TODO: Auto-generated Javadoc
/**
 * The Class TextFormat.
 */
public class TextFormat extends BaseExportFormat {

	/**
	 * Instantiates a new text format.
	 *
	 * @param alien the alien
	 */
	public TextFormat(AlienModel alien) {
		super(alien);
	}

	/* (non-Javadoc)
	 * @see com.register.alien.exportformat.BaseExportFormat#export()
	 */
	@Override
	public void export() {
		if (null != alien) {
			BufferedWriter out = null;
			try {
				String fileName = alien.getCodeName()
						+ CommonConstant.TEXT_FORMAT_EXTENTION;
				System.out.println("Exporting " + fileName);
				FileWriter saveFile = new FileWriter(fileName);
				out = new BufferedWriter(saveFile);
				List<String> data = alien.getDataInListFormat();
				for (String singleData : data) {
					out.write(singleData + CommonConstant.NEW_LINE);
				}

				System.out.println("Export Completed.");
			} catch (IOException e) {
				e.printStackTrace(errStream);
			} finally {
				if (null != errStream) {
					errStream.close();
				}
				if (null != out) {
					try {
						out.close();
					} catch (IOException e) {
						// left intentionally
					}
				}
			}
		}
	}
}


text:
<?php
	$thn_ajaran = $settingData->thn_ajaran;
	$next = $thn_ajaran+1;
	$smt = $settingData->smt == 1 ? 'Ganjil' : 'Genap';
	$bts_kelompok = new DateTime($settingData->bts_kelompok);

?>

   		 	Daftar Kelompok

    			Praktikum Tugas Perancangan Sistem Tahun Ajaran <?= $thn_ajaran.' / '.$next.' Semester '. $smt ?>

            		Anda belum memiliki kelompok. Batas akhir pemilihan kelompok sampai <?= $bts_kelompok->format('d-m-Y') ?>

	                            Kode Kelompok
	                            Dosen Pembimbing
	                            #

<?php $this->load->view('participant/join_group/detail_group_modal'); ?>


text:
module ActiveRecord
  module AttributeMethods
    module Write
      extend ActiveSupport::Concern

      included do
        attribute_method_suffix "="
      end

      module ClassMethods
        protected
          def define_method_attribute=(attr_name)
            if attr_name =~ ActiveModel::AttributeMethods::COMPILABLE_REGEXP
              generated_attribute_methods.module_eval("def #{attr_name}=(new_value); write_attribute('#{attr_name}', new_value); end", __FILE__, __LINE__)
            else
              generated_attribute_methods.send(:define_method, "#{attr_name}=") do |new_value|
                write_attribute(attr_name, new_value)
              end
            end
          end
      end

      # Updates the attribute identified by <tt>attr_name</tt> with the specified +value+. Empty strings
      # for fixnum and float columns are turned into +nil+.
      def write_attribute(attr_name, value)
        attr_name = attr_name.to_s
        attr_name = self.class.primary_key if attr_name == 'id'
        @attributes_cache.delete(attr_name)
        if (column = column_for_attribute(attr_name)) && column.number?
          @attributes[attr_name] = convert_number_column_value(value)
        else
          @attributes[attr_name] = value
        end
      end
      alias_method :raw_write_attribute, :write_attribute

      private
        # Handle *= for method_missing.
        def attribute=(attribute_name, value)
          write_attribute(attribute_name, value)
        end
    end
  end
end


text:
var _ = require('lodash');

var MIN_SPAWN_ENERGY = 100;
var MIN_HARVESTERS = 2;

var RATIO_GUARD_HARVESTER = 3/2;
var RATIO_MEDIC_HARVESTER = 1/3;
var RATIO_BUILDER_HARVESTER = 1/4;

// Load up the creeps 'personality types'
var roles = {

	harvester: {creeps: [], fn: require('harvester'),
		parts:   ["work", "carry", "move"] },

	medic:     {creeps: [], fn: require('medic'),
		parts:   ["tough", "move", "heal",  "move"] },

	builder:   {creeps: [], fn: require('builder'),
		parts:   ["work", "work", "carry", "move"] },

	guard:     {creeps: [], fn: require('guard'),
		parts:   ["tough", "move", "move", "attack"] }

}

// Assign roles
_.each(Game.creeps, function(creep){
	roles[creep.memory.role].creeps.push(creep)
})

// Construction logix
_.each(Game.spawns, function(spawn){
	if (!spawn.spawning && spawn.energy > MIN_SPAWN_ENERGY){
		if(roles.harvester.creeps.length < MIN_HARVESTERS){
			createCreep(spawn, "harvester")
		} else if (roleRatio('guard', 'harvester', RATIO_GUARD_HARVESTER)){
			createCreep(spawn, "guard")
		} else if (roleRatio('medic', 'harvester', RATIO_MEDIC_HARVESTER)){
			createCreep(spawn, "medic")
		} else if (roleRatio('builder', 'harvester', RATIO_BUILDER_HARVESTER)){
			createCreep(spawn, "builder")
		} else {
			createCreep(spawn, "harvester")
		}
	}
})

// Apply roles
_.each(roles, function(role){
	_.each(role.creeps, function(creep){
		role.fn(creep)
	})
})

function createCreep(spawn, role){
	var creepName = spawn.createCreep(roles[role].parts)
	if (typeof creepName == 'string'){
		Memory.creeps[creepName].role = role
	}
}

function roleRatio(role1, role2, ratio){
	var r1 = roles[role1].creeps.length;
	var r2 = roles[role2].creeps.length;
	if (r2 == 0) return true;
	else return (r1/r2 < ratio);
}


text:
<?php
/**
 * ZN PHP Web Framework
 *
 * "Simplicity is the ultimate sophistication." ~ Da Vinci
 *
 * @package ZN
 * @license MIT [http://opensource.org/licenses/MIT]
 * @author  Ozan UYKUN [ozan@znframework.com]
 */

class Sheet
{
    use ZN\Ability\Facade;

    const target = 'ZN\Hypertext\Sheet';
}


text:
import logging
import logging.handlers
import sys

def logger_handler_factory(logtype='syslog', logfile=None, level='WARNING',
                           logid='Trac', format=None):
    logger = logging.getLogger(logid)
    logtype = logtype.lower()
    if logtype == 'file':
        hdlr = logging.FileHandler(logfile)
    elif logtype in ('winlog', 'eventlog', 'nteventlog'):
        # Requires win32 extensions
        hdlr = logging.handlers.NTEventLogHandler(logid,
                                                  logtype='Application')
    elif logtype in ('syslog', 'unix'):
        hdlr = logging.handlers.SysLogHandler('/dev/log')
    elif logtype in ('stderr'):
        hdlr = logging.StreamHandler(sys.stderr)
    else:
        hdlr = logging.handlers.BufferingHandler(0)
        # Note: this _really_ throws away log events, as a `MemoryHandler`
        # would keep _all_ records in case there's no target handler (a bug?)

    if not format:
        format = 'Trac[%(module)s] %(levelname)s: %(message)s'
        if logtype in ('file', 'stderr'):
            format = '%(asctime)s ' + format
    datefmt = ''
    if logtype == 'stderr':
        datefmt = '%X'
    level = level.upper()
    if level in ('DEBUG', 'ALL'):
        logger.setLevel(logging.DEBUG)
    elif level == 'INFO':
        logger.setLevel(logging.INFO)
    elif level == 'ERROR':
        logger.setLevel(logging.ERROR)
    elif level == 'CRITICAL':
        logger.setLevel(logging.CRITICAL)
    else:
        logger.setLevel(logging.WARNING)
    formatter = logging.Formatter(format, datefmt)
    hdlr.setFormatter(formatter)
    logger.addHandler(hdlr)

    # Remember our handler so that we can remove it later
    logger._trac_handler = hdlr

    return logger, hdlr


text:
<?php

namespace Project\AppBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Project\AppBundle\Entity\User;

class Users implements FixtureInterface
{
    public function load(ObjectManager $manager)
    {
        $users = array(
            array(
                'name'     => 'Laurent',
                'surname'  => 'Ricard',
                'email'    => 'roundandsoft@gmail.com',
                'phone'    => '',
                'login'    => 'laurent',
                'password' => 'laurent',
            ),
            array(
                'name'     => 'Emmanuelle',
                'surname'  => 'Roux',
                'email'    => 'emmanuelle.roux@gmail.com',
                'phone'    => '',
                'login'    => 'emmanuelle',
                'password' => 'emmanuelle',
            ),
        );

        foreach ($users as $user) {
            $newUser = new User();

            $newUser->setName($user['name']);
            $newUser->setSurname($user['surname']);
            $newUser->setEmail($user['email']);
            $newUser->setPhone($user['phone']);
            $newUser->setLogin($user['login']);
            $newUser->setPassword($user['password']);

            $manager->persist($newUser);
        }

        $manager->flush();
    }
}