text:
Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");

Sys.Extended.UI.HtmlEditor.Popups.LinkProperties = function(element) {
    Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.initializeBase(this, [element]);

    this._defaultTarget = "_self";
    this._targetTextHolder = null;
    this._urlTextHolder = null;
}

Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.prototype = {

    get_defaultTarget: function() {
        return this._defaultTarget;
    },

    set_defaultTarget: function(value) {
        this._defaultTarget = value;
    }
}

Sys.Extended.UI.HtmlEditor.Popups.LinkProperties.registerClass("Sys.Extended.UI.HtmlEditor.Popups.LinkProperties", Sys.Extended.UI.HtmlEditor.Popups.OkCancelAttachedTemplatePopup);

redpajama_set_name: RedPajamaGithub


text:
/*

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package client

import "encoding/json"

func get(to *Session, endpoint string, respStruct interface{}) (ReqInf, error) {
	return makeReq(to, "GET", endpoint, nil, respStruct)
}

func post(to *Session, endpoint string, body []byte, respStruct interface{}) error {
	_, err := makeReq(to, "POST", endpoint, body, respStruct)
	return err
}

func put(to *Session, endpoint string, body []byte, respStruct interface{}) error {
	_, err := makeReq(to, "PUT", endpoint, body, respStruct)
	return err
}

func del(to *Session, endpoint string, respStruct interface{}) error {
	_, err := makeReq(to, "DELETE", endpoint, nil, respStruct)
	return err
}

func makeReq(to *Session, method, endpoint string, body []byte, respStruct interface{}) (ReqInf, error) {
	resp, remoteAddr, err := to.request(method, endpoint, body) // TODO change to getBytesWithTTL
	reqInf := ReqInf{RemoteAddr: remoteAddr, CacheHitStatus: CacheHitStatusMiss}
	if err != nil {
		return reqInf, err
	}
	defer resp.Body.Close()

	if err := json.NewDecoder(resp.Body).Decode(respStruct); err != nil {
		return reqInf, err
	}

	return reqInf, nil
}


text:
package org.codehaus.xharness.tasks;

import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.ExecuteWatchdog;
import org.apache.tools.ant.types.Path;

import org.codehaus.xharness.log.LineBuffer;
import org.codehaus.xharness.log.TaskRegistry;
import org.codehaus.xharness.procutil.KillableExecuteWatchdog;
import org.codehaus.xharness.testutil.ProcessTester;
import org.codehaus.xharness.types.EnvSet;
import org.codehaus.xharness.types.EnvironmentVariable;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class XhExecTaskTest extends TestCase {
    private static final String JVM_DIR = new String(
            (System.getProperty("java.home") + "/bin")
            .replace('/', File.separatorChar).replace(
                     '\\', File.separatorChar));
    private static final String JVM_CMD = new String(
            "java" + (System.getProperty("os.name").toLowerCase().startsWith("win") ? ".exe" : ""));

    private static final String JVM = new String(
            JVM_DIR + File.separator + JVM_CMD);

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

    public static void main(String[] args) throws Exception {
        if (System.getProperty("gui") != null) {
            String[] newArgs = new String[args.length + 2];
            System.arraycopy(args, 0, newArgs, 0, args.length);
            newArgs[args.length] = XhExecTaskTest.class.getName();
            newArgs[args.length + 1] = "-noloading";
            junit.swingui.TestRunner.main(newArgs);
        } else {
            String[] newArgs = new String[args.length + 1];
            System.arraycopy(args, 0, newArgs, 0, args.length);
            newArgs[args.length] = XhExecTaskTest.class.getName();
            junit.textui.TestRunner.main(newArgs);
        }
    }

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

    protected String getClassPath() {
        ClassLoader loader = getClass().getClassLoader();
        StringBuffer classPath = new StringBuffer();
        if (loader instanceof URLClassLoader) {
            URLClassLoader urlLoader = (URLClassLoader)loader;
            URL[] urls = urlLoader.getURLs();
            for (int x = 0; x < urls.length; x++) {
                String file = urls[x].getFile().replaceAll("%20", " ");
                if (file.indexOf("junit") == -1) {
                    classPath.append(file);
                    classPath.append(System.getProperty("path.separator"));
                }
            }
        }
        return classPath.toString();
    }

    public void testExecuteNoExecutable() throws Exception {
        Project project = new Project();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.createArg().setLine("blah");

        try {
            task.execute();
            fail("Expected BuildException");
        } catch (BuildException be) {
            assertEquals("Wrong message", "executable not set!", be.getMessage());
        }
    }

    public void testExecuteAbsolute() throws Exception {
        Project project = new Project();

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", System.getProperty("user.dir"), server.getReceivedData());
    }

    public void testExecuteRelative() throws Exception {
        Project project = new Project();

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM_CMD);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", System.getProperty("user.dir"), server.getReceivedData());
    }

    public void testExecuteAbsoluteWithDir() throws Exception {
        Project project = new Project();

        ProcessTester server = new ProcessTester();
        File execDir = new File("temp");

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.setDir(execDir);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        try {
            execDir.mkdir();
            task.execute();
        } finally {
            execDir.delete();
        }
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", execDir.getAbsolutePath(), server.getReceivedData());
    }

    public void testExecuteRelativeWithDir() throws Exception {
        Project project = new Project();

        ProcessTester server = new ProcessTester();
        File execDir = new File("temp");

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM_CMD);
        task.setDir(execDir);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        try {
            execDir.mkdir();
            task.execute();
        } finally {
            execDir.delete();
        }
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", execDir.getAbsolutePath(), server.getReceivedData());
    }

    public void testExecuteTimeout() throws Exception {
        Project project = new Project();

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM_CMD);
        task.setTimeout(new Long(2000));
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");
        task.createArg().setLine("-t 10");

        try {
            task.execute();
            fail("Expected BuildException");
        } catch (BuildException be) {
            assertEquals("Wrong message", "Timeout: killed the sub-process", be.getMessage());
        }
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", System.getProperty("user.dir"), server.getReceivedData());
    }

    public void testExecuteCurrentTestDirProperty() throws Exception {
        Project project = new Project();
        project.setProperty(TaskRegistry.CURRENT_TEST_DIR_PROPERY, JVM_DIR);

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM_CMD);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        if (!System.getProperty("os.name").equals("Mac OS X")) {
            assertEqualsIgnoreCase("Wrong user dir", JVM_DIR, server.getReceivedData());
        }
    }

    public void testExecuteCurrentTestDirPropertyDirOverride() throws Exception {
        Project project = new Project();
        project.setProperty(TaskRegistry.CURRENT_TEST_DIR_PROPERY, JVM_DIR);

        ProcessTester server = new ProcessTester();
        File execDir = new File("temp");

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM_CMD);
        task.setDir(execDir);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        try {
            execDir.mkdir();
            task.execute();
        } finally {
            execDir.delete();
        }

        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", execDir.getAbsolutePath(), server.getReceivedData());
    }

    public void testExecuteCurrentTestDirPropertyExecutableOverride() throws Exception {
        Project project = new Project();
        project.setProperty(TaskRegistry.CURRENT_TEST_DIR_PROPERY, JVM_DIR);

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEqualsIgnoreCase("Wrong user dir", JVM_DIR, server.getReceivedData());
    }

    public void testExecuteCurrentTestDirPropertyExecutableAndDirOverride() throws Exception {
        Project project = new Project();
        project.setProperty(TaskRegistry.CURRENT_TEST_DIR_PROPERY, JVM_DIR);

        ProcessTester server = new ProcessTester();
        File execDir = new File("temp");

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.setDir(execDir);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        try {
            execDir.mkdir();
            task.execute();
        } finally {
            execDir.delete();
        }

        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", execDir.getAbsolutePath(), server.getReceivedData());
    }

    public void testExecuteCurrentTestDirPropertyNonExistent() throws Exception {
        Project project = new Project();
        project.setProperty(TaskRegistry.CURRENT_TEST_DIR_PROPERY, "bogus");

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM_CMD);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong temp dir", System.getProperty("user.dir"), server.getReceivedData());
    }

    public void testExecuteEnvSet() throws Exception {
        Project project = new Project();

        EnvironmentVariable var = new EnvironmentVariable();
        var.setKey("CLASSPATH");
        var.setPath(new Path(project, getClassPath() + ";\\marker"));

        EnvSet envset = new EnvSet();
        envset.setLoadenvironment(true);
        envset.addEnv(var);

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.addEnvset(envset);
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s java.class.path");

        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEndsWith("Wrong classpath",
                       "marker",
                       server.getReceivedData());
    }

    public void testExecuteLogging() throws Exception {
        Project project = new Project();
        LineBuffer buffer = new LineBuffer();

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.createArg().setValue("-cp");
        task.createArg().setPath(new Path(project, getClassPath()));
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");
        task.enableLogging(buffer, 0, 1);

        task.execute();
        assertEquals("Wrong return value", 0, task.getReturnValue());
        assertTrue("Client did not run", server.passed());
        assertEquals("Wrong user dir", System.getProperty("user.dir"), server.getReceivedData());
        assertEquals("Wrong stderr", "Welcome stderr!", buffer.toString(1));
        String stdout = buffer.toString(0);
        assertTrue("Wrong stdout", stdout.startsWith("Welcome stdout!"));
        assertTrue("Wrong stdout", stdout.endsWith("...done. Exiting."));
    }

    public void testGetCommandline() throws Exception {
        Project project = new Project();

        ProcessTester server = new ProcessTester();

        XhExecTask task = new XhExecTask();
        task.setProject(project);
        task.setExecutable(JVM);
        task.createArg().setValue("-cp");
        Path path = new Path(project, getClassPath());
        task.createArg().setPath(path);
        task.createArg().setLine(ProcessTester.class.getName());
        task.createArg().setLine("-p " + server.getPort());
        task.createArg().setLine("-s user.dir");

        task.execute();
        assertContains("Wrong commandline", JVM, task.getCommandline());
        assertContains("Wrong commandline", path.toString(), task.getCommandline());
        assertContains("Wrong commandline", ProcessTester.class.getName(), task.getCommandline());
        assertContains("Wrong commandline", " -s user.dir", task.getCommandline());
    }

    public void testCreateWatchdog() throws Exception {
        Project project = new Project();
        XhExecTask task = new XhExecTask();
        task.setProject(project);
        ExecuteWatchdog dog = task.createWatchdog();
        assertEquals("Wrong watchdog",
                     KillableExecuteWatchdog.class.getName(),
                     dog.getClass().getName());
        assertEquals("Wrong watchdog", dog, task.getWatchdog());
    }

    private static void assertEqualsIgnoreCase(String msg, String s1, String s2) {
        assertEquals(msg, s1.toLowerCase(), s2.toLowerCase());
    }

    private static void assertContains(String msg, String s1, String s2) {
        assertTrue(msg + " <" + s1 + "> not found in <" + s2 + ">", s2.indexOf(s1) >= 0);
    }

    private static void assertEndsWith(String msg, String s1, String s2) {
        assertTrue(msg + " <" + s2 + "> doesn't end with <" + s1 + ">", s2.endsWith(s1));
    }
}


text:
package gores

import (
	"net/http"
	"net/http/httptest"
	"testing"
)

type User struct {
	Name  string
	Email string
	Age   int
}

var user = User{
	Name:  "Jhon",
	Email: "jhon@example.com",
	Age:   20,
}

func TestHTML(t *testing.T) {
	responseString := "
Hello World
"
	responseCode := http.StatusOK

	resp := httptest.NewRecorder()

	HTML(resp, responseCode, responseString)

	if resp.Body.String() != responseString || resp.Header().Get(ContentType) != TextHTMLCharsetUTF8 || resp.Code != responseCode {
		t.Fail()
	}
}

func TestString(t *testing.T) {
	responseString := "Hello World"
	responseCode := http.StatusOK

	resp := httptest.NewRecorder()

	String(resp, responseCode, responseString)

	if resp.Body.String() != responseString || resp.Header().Get(ContentType) != TextPlainCharsetUTF8 || resp.Code != responseCode {
		t.Fail()
	}
}

func TestJSON(t *testing.T) {

	responseString := `{"Name":"Jhon","Email":"jhon@example.com","Age":20}`
	responseCode := http.StatusOK

	resp := httptest.NewRecorder()

	JSON(resp, responseCode, user)

	if resp.Body.String() != responseString || resp.Header().Get(ContentType) != ApplicationJSONCharsetUTF8 || resp.Code != responseCode {
		t.Fail()
	}
}

func TestJSONIndent(t *testing.T) {

	responseString := `{
**%%"Name": "Jhon",
**%%"Email": "jhon@example.com",
**%%"Age": 20
**}`

	responseCode := http.StatusOK

	resp := httptest.NewRecorder()

	JSONIndent(resp, responseCode, user, "**", "%%")

	if resp.Body.String() != responseString || resp.Header().Get(ContentType) != ApplicationJSONCharsetUTF8 || resp.Code != responseCode {
		t.Fail()
	}
}

func TestJSONP(t *testing.T) {

	responseString := `parseResponse({"Name":"Jhon","Email":"jhon@example.com","Age":20});`

	responseCode := http.StatusOK

	resp := httptest.NewRecorder()

	JSONP(resp, responseCode, "parseResponse", user)

	if resp.Body.String() != responseString || resp.Header().Get(ContentType) != ApplicationJavaScriptCharsetUTF8 || resp.Code != responseCode {
		t.Fail()
	}
}

func TestXML(t *testing.T) {

	responseString := `<?xml version="1.0" encoding="UTF-8"?>
<User><Name>Jhon</Name><Email>jhon@example.com</Email><Age>20</Age></User>`

	responseCode := http.StatusOK

	resp := httptest.NewRecorder()

	XML(resp, responseCode, user)

	if resp.Body.String() != responseString || resp.Header().Get(ContentType) != ApplicationXMLCharsetUTF8 || resp.Code != responseCode {
		t.Fail()
	}
}

func TestXMLIndent(t *testing.T) {

	responseString := `<?xml version="1.0" encoding="UTF-8"?>
**<User>
**%%<Name>Jhon</Name>
**%%<Email>jhon@example.com</Email>
**%%<Age>20</Age>
**</User>`

	responseCode := http.StatusOK

	resp := httptest.NewRecorder()

	XMLIndent(resp, responseCode, user, "**", "%%")

	if resp.Body.String() != responseString || resp.Header().Get(ContentType) != ApplicationXMLCharsetUTF8 || resp.Code != responseCode {
		t.Fail()
	}
}

func TestNoContent(t *testing.T) {

	responseString := ``

	responseCode := http.StatusNoContent

	resp := httptest.NewRecorder()

	NoContent(resp)

	if resp.Body.String() != responseString || resp.Code != responseCode {
		t.Fail()
	}
}

func TestError(t *testing.T) {

	responseString := `error`

	responseCode := http.StatusBadRequest

	resp := httptest.NewRecorder()

	Error(resp, responseCode, responseString)

	if resp.Body.String() != responseString+"\n" || resp.Code != responseCode {
		t.Fail()
	}
}


text:
using Microsoft.Owin.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace Owin.Api
{
    class Program
    {
        static void Main(string[] args)
        {
            // Start OWIN host
            var server = WebApp.Start<Startup>(url: "http://localhost:3000/");
            Console.WriteLine("Web API listening at http://localhost:3000/");
            Console.WriteLine("Press ENTER to terminate");
            Console.ReadLine();
        }
    }
}


text:
import {NgModule,Component,Input,ContentChildren,QueryList,AfterContentInit,AfterViewInit,AfterViewChecked,TemplateRef,ChangeDetectionStrategy, ViewEncapsulation, ViewChild, ElementRef} from '@angular/core';
import {CommonModule} from '@angular/common';
import {MenuItem} from 'primeng/api';
import {RippleModule} from 'primeng/ripple';
import {PrimeTemplate, SharedModule} from 'primeng/api';
import {RouterModule} from '@angular/router';
import {DomHandler} from 'primeng/dom';

@Component({
    selector: 'p-tabMenu',
    template: `

                        <ng-container *ngIf="!itemTemplate">

                            {{item.label}}
                            <ng-template #htmlLabel></ng-template>
                        </ng-container>
                        <ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"></ng-container>

                    <a *ngIf="item.routerLink" [routerLink]="item.routerLink" [queryParams]="item.queryParams" [routerLinkActive]="'p-menuitem-link-active'" [routerLinkActiveOptions]="item.routerLinkActiveOptions||{exact:false}"
                        role="presentation" class="p-menuitem-link" (click)="itemClick($event,item)" (keydown.enter)="itemClick($event,item)" [attr.tabindex]="item.disabled ? null : '0'"
                        [attr.target]="item.target" [attr.title]="item.title" [attr.id]="item.id"
                        [fragment]="item.fragment" [queryParamsHandling]="item.queryParamsHandling" [preserveFragment]="item.preserveFragment" [skipLocationChange]="item.skipLocationChange" [replaceUrl]="item.replaceUrl" [state]="item.state" pRipple>
                        <ng-container *ngIf="!itemTemplate">

                            {{item.label}}
                            <ng-template #htmlRouteLabel></ng-template>
                        </ng-container>
                        <ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"></ng-container>

    `,
    changeDetection: ChangeDetectionStrategy.OnPush,
    encapsulation: ViewEncapsulation.None,
    styleUrls: ['./tabmenu.css']
})
export class TabMenu implements AfterContentInit,AfterViewInit,AfterViewChecked {

    @Input() model: MenuItem[];

    @Input() activeItem: MenuItem;

    @Input() popup: boolean;

    @Input() style: any;

    @Input() styleClass: string;

    @ViewChild('navbar') navbar: ElementRef;

    @ViewChild('inkbar') inkbar: ElementRef;

    @ContentChildren(PrimeTemplate) templates: QueryList<any>;

    itemTemplate: TemplateRef<any>;

    tabChanged: boolean;

    ngAfterContentInit() {
        this.templates.forEach((item) => {
            switch(item.getType()) {
                case 'item':
                    this.itemTemplate = item.template;
                break;

                default:
                    this.itemTemplate = item.template;
                break;
            }
        });
    }

    ngAfterViewInit() {
        this.updateInkBar();
    }

    ngAfterViewChecked() {
        if (this.tabChanged) {
            this.updateInkBar();
            this.tabChanged = false;
        }
    }

    itemClick(event: Event, item: MenuItem) {
        if (item.disabled) {
            event.preventDefault();
            return;
        }

        if (item.command) {
            item.command({
                originalEvent: event,
                item: item
            });
        }

        this.activeItem = item;
        this.tabChanged = true;
    }

    updateInkBar() {
        let tabHeader = DomHandler.findSingle(this.navbar.nativeElement, 'li.p-highlight');
        if (tabHeader) {
            this.inkbar.nativeElement.style.width = DomHandler.getWidth(tabHeader) + 'px';
            this.inkbar.nativeElement.style.left = DomHandler.getOffset(tabHeader).left - DomHandler.getOffset(this.navbar.nativeElement).left + 'px';
        }
    }
}

@NgModule({
    imports: [CommonModule,RouterModule,SharedModule,RippleModule],
    exports: [TabMenu,RouterModule,SharedModule],
    declarations: [TabMenu]
})
export class TabMenuModule { }


text:
package aws

import (
	"github.com/hashicorp/terraform/helper/schema"
)

func resourceAwsOpsworksCustomLayer() *schema.Resource {
	layerType := &opsworksLayerType{
		TypeName:        "custom",
		CustomShortName: true,

		// The "custom" layer type has no additional attributes
		Attributes: map[string]*opsworksLayerTypeAttribute{},
	}

	return layerType.SchemaResource()
}


text:
/*
 Simple program to test the Rcat Low Level routines to Postgres or Oracle.
 */

#include "rods.h"
#include "icatLowLevel.h"

/*int ProcessType=CLIENT_PT; */

int
main(int argc, char **argv) {
   int i;

   i = cllTest(argv[1], argv[2]);
   return(i);
}

/* This is a dummy version of icatApplyRule for this test program so
   the rule-engine is not needed in this ICAT test. */
int
icatApplyRule(rsComm_t *rsComm, char *ruleName, char *arg1) {
  return(0);
}


text:
package tw.soleil.androidvillage.Object;

import android.util.Log;

/**
 * Created by edward_chiang on 14/10/25.
 */
public class MathCalculator {

    private double originalNumber;

    private Operation operation;

    private double comingNumber;

    public enum Operation {
        PLUS, MINUS, TIME, DIVIDE
    }

    public double getOriginalNumber() {
        return originalNumber;
    }

    public Operation getOperation() {
        return operation;
    }

    public void setOperation(Operation operation) {
        this.operation = operation;
//        this.operate();
        this.moveAndSaveNumber();
        this.clearComingNumber();
    }

    public double getAnswer () {
        return this.originalNumber;
    }

    public double getComingNumber() {
        return comingNumber;
    }

    public void setComingNumber(float comingNumber) {
        // If the operation is null, then we know user want to start over.
        if (this.operation == null) {
            this.originalNumber = 0;
            this.comingNumber = 0;
        }
        this.comingNumber = comingNumber;
    }

    public void moveAndSaveNumber() {
        this.originalNumber = this.comingNumber;
    }

    public void clearComingNumber () {
        this.comingNumber = 0;
    }

    public void clearAll() {
        this.comingNumber = 0;
        this.operation = null;
    }

    public void operate() {
        if (this.operation == null) return;
        switch (this.operation) {
            case PLUS:
                this.originalNumber = this.originalNumber + this.comingNumber;
                Log.i("Calculator: ", "Plus: " + this.originalNumber);
                break;
            case MINUS:
                this.originalNumber = this.originalNumber - this.comingNumber;
                break;
            case TIME:
                this.originalNumber = this.originalNumber * this.comingNumber;
                break;
            case DIVIDE:
                this.originalNumber = this.originalNumber / this.comingNumber;
                break;

            default:
        }
    }

    @Override
    public String toString() {
        return "MathCalculator{" +
                "originalNumber=" + originalNumber +
                ", operation=" + operation +
                ", comingNumber=" + comingNumber +
                '}';
    }
}


text:
/* @flow */
import arrayReduce from 'fast-loops/lib/arrayReduce'

export default function enhance(...enhancers: Array<Function>): Function {
  return createRenderer => config =>
    arrayReduce(
      enhancers,
      (enhancedRenderer, enhancer) => {
        enhancedRenderer = enhancer(enhancedRenderer)
        return enhancedRenderer
      },
      createRenderer(config)
    )
}


text:
<?php

/**
 * Created by PhpStorm.
 * User: sglushko
 * Date: 04.09.2015
 * Time: 13:26
 */

namespace reinvently\ondemand\core\components\base;

trait ErrorManagerTrait
{
    /**
     * @var array validation errors (attribute name => array of errors)
     */
    private $_errors;

    /**
     * Returns a value indicating whether there is any validation error.
     * @param string|null $attribute attribute name. Use null to check all attributes.
     * @return boolean whether there is any error.
     */
    public function hasErrors($attribute = null)
    {
        return $attribute === null ? !empty($this->_errors) : isset($this->_errors[$attribute]);
    }

    /**
     * Returns the errors for all attribute or a single attribute.
     * @param string $attribute attribute name. Use null to retrieve errors for all attributes.
     * @property array An array of errors for all attributes. Empty array is returned if no error.
     * The result is a two-dimensional array. See [[getErrors()]] for detailed description.
     * @return array errors for all attributes or the specified attribute. Empty array is returned if no error.
     * Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:
     *
     * ~~~
     * [
     *     'username' => [
     *         'Username is required.',
     *         'Username must contain only word characters.',
     *     ],
     *     'email' => [
     *         'Email address is invalid.',
     *     ]
     * ]
     * ~~~
     *
     * @see getFirstErrors()
     * @see getFirstError()
     */
    public function getErrors($attribute = null)
    {
        if ($attribute === null) {
            return $this->_errors === null ? [] : $this->_errors;
        } else {
            return isset($this->_errors[$attribute]) ? $this->_errors[$attribute] : [];
        }
    }

    /**
     * Returns the first error of every attribute in the model.
     * @return array the first errors. The array keys are the attribute names, and the array
     * values are the corresponding error messages. An empty array will be returned if there is no error.
     * @see getErrors()
     * @see getFirstError()
     */
    public function getFirstErrors()
    {
        if (empty($this->_errors)) {
            return [];
        } else {
            $errors = [];
            foreach ($this->_errors as $name => $es) {
                if (!empty($es)) {
                    $errors[$name] = reset($es);
                }
            }

            return $errors;
        }
    }

    /**
     * Returns the first error of the specified attribute.
     * @param string $attribute attribute name.
     * @return string the error message. Null is returned if no error.
     * @see getErrors()
     * @see getFirstErrors()
     */
    public function getFirstError($attribute)
    {
        return isset($this->_errors[$attribute]) ? reset($this->_errors[$attribute]) : null;
    }

    /**
     * Adds a new error to the specified attribute.
     * @param string $attribute attribute name
     * @param string $error new error message
     */
    public function addError($attribute, $error = '')
    {
        $this->_errors[$attribute][] = $error;
    }

    /**
     * Adds a list of errors.
     * @param array $items a list of errors. The array keys must be attribute names.
     * The array values should be error messages. If an attribute has multiple errors,
     * these errors must be given in terms of an array.
     * You may use the result of [[getErrors()]] as the value for this parameter.
     * @since 2.0.2
     */
    public function addErrors(array $items)
    {
        foreach ($items as $attribute => $errors) {
            if (is_array($errors)) {
                foreach ($errors as $error) {
                    $this->addError($attribute, $error);
                }
            } else {
                $this->addError($attribute, $errors);
            }
        }
    }

    /**
     * Removes errors for all attributes or a single attribute.
     * @param string $attribute attribute name. Use null to remove errors for all attribute.
     */
    public function clearErrors($attribute = null)
    {
        if ($attribute === null) {
            $this->_errors = [];
        } else {
            unset($this->_errors[$attribute]);
        }
    }

}


text:
<!DOCTYPE HTML>

		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>CloudWatchDescribeAlarmsForMetricRequest Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<meta name="viewport" content="width=550" />
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.0.5 (build 789)" />

AWS SDK for iOS v1.4.3

				Amazon Web Services, Inc.

CloudWatchDescribeAlarmsForMetricRequest Class Reference

					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents">Table of Contents</button>

					<select id="jumpTo">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<option value="properties">Properties</option>

	<option value="//api/name/dimensions">    dimensions</option>

	<option value="//api/name/metricName">    metricName</option>

	<option value="//api/name/namespace">    namespace</option>

	<option value="//api/name/period">    period</option>

	<option value="//api/name/statistic">    statistic</option>

	<option value="//api/name/unit">    unit</option>

	<option value="instance_methods">Instance Methods</option>

	<option value="//api/name/addDimension:">    - addDimension:</option>

	<option value="//api/name/description">    - description</option>

	<option value="//api/name/init">    - init</option>

</select>

Overview

Tasks

Properties

dimensions

metricName

namespace

period

statistic

unit

Instance Methods

addDimension:

description

init

Index

Hierarchy

CloudWatchDescribeAlarmsForMetricRequest Class Reference

	Inherits from
	AmazonServiceRequestConfig : NSObject

	Declared in
	CloudWatchDescribeAlarmsForMetricRequest.h

Overview

Describe Alarms For Metric Request

Tasks

		– init

Default constructor for a new  object.  Callers should use the
property methods to initialize this object after creating it.

		  metricName

The name of the metric.

Constraints:

Length: 1 – 255

	property

		  namespace

The namespace of the metric.

Constraints:

Length: 1 – 255

Pattern: [^:].*

	property

		  statistic

The statistic for the metric.

Constraints:

Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

	property

		  dimensions

The list of dimensions associated with the metric.

Constraints:

Length: 0 – 10

	property

		  period

The period in seconds over which the statistic is applied.

Constraints:

Range: 60 –

	property

		  unit

The unit for the metric.

Constraints:

Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

	property

		– addDimension:

Adds a single object to dimensions.
This function will alloc and init dimensions if not already done.

		– description

Returns a string representation of this object; useful for testing and
debugging.

Properties

dimensions

The list of dimensions associated with the metric.

Constraints:

Length: 0 – 10

@property (nonatomic, retain) NSMutableArray *dimensions

Discussion

The list of dimensions associated with the metric.

Constraints:

Length: 0 – 10

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

metricName

The name of the metric.

Constraints:

Length: 1 – 255

@property (nonatomic, retain) NSString *metricName

Discussion

The name of the metric.

Constraints:

Length: 1 – 255

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

namespace

The namespace of the metric.

Constraints:

Length: 1 – 255

Pattern: [^:].*

@property (nonatomic, retain) NSString *namespace

Discussion

The namespace of the metric.

Constraints:

Length: 1 – 255

Pattern: [^:].*

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

period

The period in seconds over which the statistic is applied.

Constraints:

Range: 60 –

@property (nonatomic, retain) NSNumber *period

Discussion

The period in seconds over which the statistic is applied.

Constraints:

Range: 60 –

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

statistic

The statistic for the metric.

Constraints:

Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

@property (nonatomic, retain) NSString *statistic

Discussion

The statistic for the metric.

Constraints:

Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

unit

The unit for the metric.

Constraints:

Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

@property (nonatomic, retain) NSString *unit

Discussion

The unit for the metric.

Constraints:

Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

Instance Methods

addDimension:

Adds a single object to dimensions.
This function will alloc and init dimensions if not already done.

- (void)addDimension:(CloudWatchDimension *)dimensionObject

Discussion

Adds a single object to dimensions.
This function will alloc and init dimensions if not already done.

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

description

Returns a string representation of this object; useful for testing and
debugging.

- (NSString *)description

Return Value

A string representation of this object.

Discussion

Returns a string representation of this object; useful for testing and
debugging.

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

init

Default constructor for a new  object.  Callers should use the
property methods to initialize this object after creating it.

- (id)init

Discussion

Default constructor for a new  object.  Callers should use the
property methods to initialize this object after creating it.

Declared In

		CloudWatchDescribeAlarmsForMetricRequest.h

Index

Hierarchy

© 2012 Amazon Web Services, Inc.. All rights reserved. (Last updated: 2012-10-05)

						Generated by appledoc 2.0.5 (build 789).


text:
import pytest
import unittest

from modules.sfp_botvrij import sfp_botvrij
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget

@pytest.mark.usefixtures
class TestModuleIntegrationBotvrij(unittest.TestCase):

    @unittest.skip("todo")
    def test_handleEvent(self):
        sf = SpiderFoot(self.default_options)

        module = sfp_botvrij()
        module.setup(sf, dict())

        target_value = 'example target value'
        target_type = 'IP_ADDRESS'
        target = SpiderFootTarget(target_value, target_type)
        module.setTarget(target)

        event_type = 'ROOT'
        event_data = 'example data'
        event_module = ''
        source_event = ''
        evt = SpiderFootEvent(event_type, event_data, event_module, source_event)

        result = module.handleEvent(evt)

        self.assertIsNone(result)


text:
package org.teavm.backend.wasm;

import org.teavm.interop.Address;
import org.teavm.interop.Import;
import org.teavm.interop.StaticInit;
import org.teavm.interop.Unmanaged;

@StaticInit
@Unmanaged
public final class WasmRuntime {
    public static Address stack = initStack();

    private WasmRuntime() {
    }

    private static native Address initStack();

    public static int compare(int a, int b) {
        return gt(a, b) ? 1 : lt(a, b) ? -1 : 0;
    }

    public static int compare(long a, long b) {
        return gt(a, b) ? 1 : lt(a, b) ? -1 : 0;
    }

    public static int compare(float a, float b) {
        return gt(a, b) ? 1 : lt(a, b) ? -1 : 0;
    }

    public static int compare(double a, double b) {
        return gt(a, b) ? 1 : lt(a, b) ? -1 : 0;
    }

    public static float remainder(float a, float b) {
        return a - (float) (int) (a / b) * b;
    }

    public static double remainder(double a, double b) {
        return a - (double) (long) (a / b) * b;
    }

    private static native boolean lt(int a, int b);

    private static native boolean gt(int a, int b);

    private static native boolean lt(long a, long b);

    private static native boolean gt(long a, long b);

    private static native boolean lt(float a, float b);

    private static native boolean gt(float a, float b);

    private static native boolean lt(double a, double b);

    private static native boolean gt(double a, double b);

    public static Address align(Address address, int alignment) {
        int value = address.toInt();
        if (value == 0) {
            return address;
        }
        value = ((value - 1) / alignment + 1) * alignment;
        return Address.fromInt(value);
    }

    @Import(name = "print", module = "spectest")
    public static native void print(int a);

    public static void fillZero(Address address, int count) {
        int start = address.toInt();

        int alignedStart = start >>> 2 << 2;
        address = Address.fromInt(alignedStart);
        switch (start - alignedStart) {
            case 0:
                address.putInt(0);
                break;
            case 1:
                address.add(1).putByte((byte) 0);
                address.add(2).putShort((short) 0);
                break;
            case 2:
                address.add(2).putShort((short) 0);
                break;
            case 3:
                address.add(3).putByte((byte) 0);
                break;
        }

        int end = start + count;
        int alignedEnd = end >>> 2 << 2;
        address = Address.fromInt(alignedEnd);
        switch (end - alignedEnd) {
            case 0:
                break;
            case 1:
                address.putByte((byte) 0);
                break;
            case 2:
                address.putShort((short) 0);
                break;
            case 3:
                address.putShort((short) 0);
                address.add(2).putByte((byte) 0);
                break;
        }

        for (address = Address.fromInt(alignedStart + 4); address.toInt() < alignedEnd; address = address.add(4)) {
            address.putInt(0);
        }
    }

    public static void moveMemoryBlock(Address source, Address target, int count) {
        if (count < 8) {
            slowMemoryMove(source, target, count);
        }
        int diff = source.toInt() - target.toInt();
        if (diff == 0) {
            return;
        }
        if ((diff & 3) != 0) {
            slowMemoryMove(source, target, count);
            return;
        }

        Address alignedSourceStart = Address.fromInt(source.toInt() >>> 2 << 2);
        Address alignedTargetStart = Address.fromInt(target.toInt() >>> 2 << 2);

        Address alignedSourceEnd = Address.fromInt((source.toInt() + count) >>> 2 << 2);
        Address alignedTargetEnd = Address.fromInt((target.toInt() + count) >>> 2 << 2);

        if (source.toInt() > target.toInt()) {
            switch (source.toInt() - alignedSourceStart.toInt()) {
                case 0:
                    alignedTargetStart.putInt(alignedSourceStart.getInt());
                    break;
                case 1:
                    alignedTargetStart.add(1).putByte(alignedSourceStart.add(1).getByte());
                    alignedTargetStart.add(2).putShort(alignedSourceStart.add(2).getShort());
                    break;
                case 2:
                    alignedTargetStart.add(2).putShort(alignedSourceStart.add(2).getShort());
                    break;
                case 3:
                    alignedTargetStart.add(3).putByte(alignedSourceStart.add(3).getByte());
                    break;
            }

            alignedSourceStart = alignedSourceStart.add(4);
            alignedTargetStart = alignedTargetStart.add(4);

            while (alignedSourceStart.toInt() < alignedSourceEnd.toInt()) {
                alignedTargetStart.putInt(alignedSourceStart.getInt());
                alignedSourceStart = alignedSourceStart.add(4);
                alignedTargetStart = alignedTargetStart.add(4);
            }

            switch (source.toInt() + count - alignedSourceEnd.toInt()) {
                case 0:
                    break;
                case 1:
                    alignedTargetEnd.putByte(alignedSourceEnd.getByte());
                    break;
                case 2:
                    alignedTargetEnd.putShort(alignedSourceEnd.getShort());
                    break;
                case 3:
                    alignedTargetEnd.putShort(alignedSourceEnd.getShort());
                    alignedTargetEnd.add(2).putByte(alignedSourceEnd.add(2).getByte());
                    break;
            }
        } else {
            switch (source.toInt() + count - alignedSourceEnd.toInt()) {
                case 0:
                    break;
                case 1:
                    alignedTargetEnd.putByte(alignedSourceEnd.getByte());
                    break;
                case 2:
                    alignedTargetEnd.putShort(alignedSourceEnd.getShort());
                    break;
                case 3:
                    alignedTargetEnd.add(2).putByte(alignedSourceEnd.add(2).getByte());
                    alignedTargetEnd.putShort(alignedSourceEnd.getShort());
                    break;
            }

            while (alignedSourceEnd.toInt() > alignedSourceStart.toInt()) {
                alignedTargetEnd.putInt(alignedSourceEnd.getInt());
                alignedSourceEnd = alignedSourceEnd.add(-4);
                alignedTargetEnd = alignedTargetEnd.add(-4);
            }

            switch (source.toInt() - alignedSourceStart.toInt()) {
                case 0:
                    alignedTargetStart.putInt(alignedSourceStart.getInt());
                    break;
                case 1:
                    alignedTargetStart.add(2).putShort(alignedSourceStart.add(2).getShort());
                    alignedTargetStart.add(1).putByte(alignedSourceStart.add(1).getByte());
                    break;
                case 2:
                    alignedTargetStart.add(2).putShort(alignedSourceStart.add(2).getShort());
                    break;
                case 3:
                    alignedTargetStart.add(3).putByte(alignedSourceStart.add(3).getByte());
                    break;
            }
        }
    }

    private static void slowMemoryMove(Address source, Address target, int count) {
        if (source.toInt() > target.toInt()) {
            while (count-- > 0) {
                target.putByte(source.getByte());
                target = target.add(1);
                source = source.add(1);
            }
        } else {
            source.add(count);
            target.add(count);
            while (count-- > 0) {
                target = target.add(-1);
                source = source.add(-1);
                target.putByte(source.getByte());
            }
        }
    }

    public static Address allocStack(int size) {
        Address result = stack.add(4);
        stack = result.add((size << 2) + 4);
        stack.putInt(size);
        return result;
    }

    public static Address getStackTop() {
        return stack != initStack() ? stack : null;
    }

    public static Address getNextStackFrame(Address stackFrame) {
        int size = stackFrame.getInt() + 2;
        Address result = stackFrame.add(-size * 4);
        if (result == initStack()) {
            result = null;
        }
        return result;
    }

    public static int getStackRootCount(Address stackFrame) {
        return stackFrame.getInt();
    }

    public static Address getStackRootPointer(Address stackFrame) {
        int size = stackFrame.getInt();
        return stackFrame.add(-size * 4);
    }

    private static Address getExceptionHandlerPtr(Address stackFrame) {
        int size = stackFrame.getInt();
        return stackFrame.add(-size * 4 - 4);
    }

    public static int getCallSiteId(Address stackFrame) {
        return getExceptionHandlerPtr(stackFrame).getInt();
    }

    public static void setExceptionHandlerId(Address stackFrame, int id) {
        getExceptionHandlerPtr(stackFrame).putInt(id);
    }
}


text:
package com.hack23.cia.service.data.impl;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.hack23.cia.service.data.api.DocumentContentDataDAO;

/**
 * The Class DocumentContentDataDAOITest.
 */
public final class DocumentContentDataDAOITest extends AbstractServiceDataFunctionalIntegrationTest {

	/** The document content data DAO. */
	@Autowired
	private DocumentContentDataDAO documentContentDataDAO;

	/**
	 * Check document content data exist test.
	 */
	@Test
	public void checkDocumentContentDataExistTest() {
		assertTrue(documentContentDataDAO.checkDocumentContentData("H501MJU4"));
	}

	/**
	 * Check document content data do not exist test.
	 */
	@Test
	public void checkDocumentContentDataDoNotExistTest() {
		assertFalse(documentContentDataDAO.checkDocumentContentData("somemissingdocumentId"));
	}

	/**
	 * Gets the id list test.
	 *
	 * @return the id list test
	 */
	@Test
	public void getIdListTest() {
		assertFalse(documentContentDataDAO.getIdList().isEmpty());
	}

}


text:
package com.navercorp.pinpoint.common.server.bo.serializer.stat;

import com.navercorp.pinpoint.common.hbase.HbaseColumnFamily;
import com.navercorp.pinpoint.common.server.bo.serializer.stat.join.ApplicationStatSerializer;
import com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo;
import com.navercorp.pinpoint.common.server.bo.stat.join.StatType;

import com.sematext.hbase.wd.AbstractRowKeyDistributor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Scan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;

/**
 * @author Minwoo Jung
 */
@Component
public class ApplicationStatHbaseOperationFactory {

    private final ApplicationStatRowKeyEncoder rowKeyEncoder;

    private final ApplicationStatRowKeyDecoder rowKeyDecoder;

    private final AbstractRowKeyDistributor rowKeyDistributor;

    public ApplicationStatHbaseOperationFactory(
                ApplicationStatRowKeyEncoder rowKeyEncoder,
                ApplicationStatRowKeyDecoder rowKeyDecoder,
                @Qualifier("applicationStatRowKeyDistributor") AbstractRowKeyDistributor rowKeyDistributor) {
        this.rowKeyEncoder = Objects.requireNonNull(rowKeyEncoder, "rowKeyEncoder");
        this.rowKeyDecoder = Objects.requireNonNull(rowKeyDecoder, "rowKeyDecoder");
        this.rowKeyDistributor = Objects.requireNonNull(rowKeyDistributor, "rowKeyDistributor");
    }

    public <T extends JoinStatBo> List<Put> createPuts(String applicationId, List<T> joinStatBoList, StatType statType, ApplicationStatSerializer<T> applicationStatSerializer) {
        if (CollectionUtils.isEmpty(joinStatBoList)) {
            return Collections.emptyList();
        }

        Map<Long, List<T>> timeslots = slotApplicationStatDataPoints(joinStatBoList);
        List<Put> puts = new ArrayList<>();
        for (Map.Entry<Long, List<T>> timeslot : timeslots.entrySet()) {
            long baseTimestamp = timeslot.getKey();
            List<T> slottedApplicationStatDataPoints = timeslot.getValue();

            final ApplicationStatRowKeyComponent rowKeyComponent = new ApplicationStatRowKeyComponent(applicationId, statType, baseTimestamp);
            byte[] rowKey = this.rowKeyEncoder.encodeRowKey(rowKeyComponent);
            byte[] distributedRowKey = this.rowKeyDistributor.getDistributedKey(rowKey);

            Put put = new Put(distributedRowKey);
            applicationStatSerializer.serialize(slottedApplicationStatDataPoints, put, null);
            puts.add(put);
        }
        return puts;
    }

    public Scan createScan(String applicationId, StatType statType, long startTimestamp, long endTimestamp) {
        final ApplicationStatRowKeyComponent startRowKeyComponent = new ApplicationStatRowKeyComponent(applicationId, statType, AgentStatUtils.getBaseTimestamp(endTimestamp));
        final ApplicationStatRowKeyComponent endRowKeyComponenet = new ApplicationStatRowKeyComponent(applicationId, statType, AgentStatUtils.getBaseTimestamp(startTimestamp) - HbaseColumnFamily.APPLICATION_STAT_STATISTICS.TIMESPAN_MS);
        byte[] startRowKey = this.rowKeyEncoder.encodeRowKey(startRowKeyComponent);
        byte[] endRowKey = this.rowKeyEncoder.encodeRowKey(endRowKeyComponenet);
        Scan scan = new Scan();
        scan.withStartRow(startRowKey);
        scan.withStopRow(endRowKey);
        return scan;
    }

    public AbstractRowKeyDistributor getRowKeyDistributor() {
        return this.rowKeyDistributor;
    }

    public String getApplicationId(byte[] distributedRowKey) {
        byte[] originalRowKey = this.rowKeyDistributor.getOriginalKey(distributedRowKey);
        return this.rowKeyDecoder.decodeRowKey(originalRowKey).getApplicationId();
    }

    public long getBaseTimestamp(byte[] distributedRowKey) {
        byte[] originalRowKey = this.rowKeyDistributor.getOriginalKey(distributedRowKey);
        return this.rowKeyDecoder.decodeRowKey(originalRowKey).getBaseTimestamp();
    }

    private <T extends JoinStatBo> Map<Long, List<T>> slotApplicationStatDataPoints(List<T> joinStatBoList) {
        Map<Long, List<T>> timeslots = new TreeMap<>();
        for (T joinStatBo : joinStatBoList) {
            long timestamp = joinStatBo.getTimestamp();
            long timeslot = AgentStatUtils.getBaseTimestamp(timestamp);
            List<T> slottedDataPoints = timeslots.computeIfAbsent(timeslot, k -> new ArrayList<>());
            slottedDataPoints.add(joinStatBo);
        }
        return timeslots;
    }
}


text:
package net.bytebuddy.description.type;

import net.bytebuddy.description.annotation.AnnotationList;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.MethodRule;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.when;

public class TypeDescriptionGenericLazyProjectionWithLazyNavigationTest {

    @Rule
    public MethodRule mockitoRule = MockitoJUnit.rule().silent();

    @Mock
    private TypeDescription typeDescription, rawSuperType;

    @Mock
    private TypeDescription.Generic superType;

    @Before
    public void setUp() throws Exception {
        when(typeDescription.asErasure()).thenReturn(typeDescription);
        when(superType.asErasure()).thenReturn(rawSuperType);
        when(superType.asGenericType()).thenReturn(superType);
    }

    @Test
    public void testLazySuperClass() throws Exception {
        when(typeDescription.getSuperClass()).thenReturn(superType);
        assertThat(new AssertingLazyType(typeDescription).getSuperClass().asErasure(), is(rawSuperType));
    }

    @Test
    public void testUndefinedLazySuperClass() throws Exception {
        assertThat(new AssertingLazyType(typeDescription).getSuperClass(), nullValue(TypeDescription.Generic.class));
    }

    @Test
    public void testInterfaceType() throws Exception {
        when(typeDescription.getInterfaces()).thenReturn(new TypeList.Generic.Explicit(superType));
        assertThat(new AssertingLazyType(typeDescription).getInterfaces().getOnly().asErasure(), is(rawSuperType));
    }

    @Test(expected = IndexOutOfBoundsException.class)
    public void testInterfaceTypeOutOfBounds() throws Exception {
        when(typeDescription.getInterfaces()).thenReturn(new TypeList.Generic.Explicit(superType));
        new AssertingLazyType(typeDescription).getInterfaces().get(1);
    }

    private static class AssertingLazyType extends TypeDescription.Generic.LazyProjection.WithLazyNavigation {

        private final TypeDescription typeDescription;

        private AssertingLazyType(TypeDescription typeDescription) {
            this.typeDescription = typeDescription;
        }

        public AnnotationList getDeclaredAnnotations() {
            throw new AssertionError();
        }

        public TypeDescription asErasure() {
            return typeDescription;
        }

        @Override
        protected TypeDescription.Generic resolve() {
            throw new AssertionError();
        }
    }
}


text:
### Web AppBuilder Custom Theme

In this lab you will add a custom theme to Web AppBuilder and style the Geocoder Widget.

1. [Download the Bright Theme] (wab/BrightTheme.zip?raw=true) unzip and copy the folder to the themes directory(e.g. webappbuilder\client\stemapp\themes)

2. Click the manifest.json to describe the theme's content by adding the following JSON:
	```json
	{
	  "name": "BrightTheme",
	  "platform": "HTML",
	  "panels": [
	    {
	      "name": "FoldablePanel",
	      "description": "This is foldable panel"
	    },
	    {
	      "name": "SimplePanel",
	      "description": "this is simple panel"
	    }
	  ],
	  "styles": [
	    {
	      "name": "default",
	      "description": "this is default style",
	      "styleColor": "#efa602"
	    },
	    {
	      "name": "yellow",
	      "description": "this is yellow style",
	      "styleColor": "#d8d00f"
	    },
	    {
	      "name": "blue",
	      "description": "this is light blue style",
	      "styleColor": "#27a4d2"
	    },
	    {
	      "name": "red",
	      "description": "this is red style",
	      "styleColor": "#c50143"
	    },
	    {
	      "name": "green",
	      "description": "this is green style",
	      "styleColor": "#93bf2c"
	    },
	    {
	      "name": "purple",
	      "description": "this is purple style",
	      "styleColor": "#660066"
	    }
	  ],
	  "layouts": [
	    {
	      "name": "default",
	      "description": "this is default layout"
	    },
	    {
	      "name": "layout1",
	      "description": "this is layout1"
	    }
	  ],
	  "widgets": [
	    {
	      "name": "HeaderController",
	      "description": "this is theme widget controller"
	    }
	  ],
	  "version": "1.3",
	  "wabVersion": "1.2",
	  "author": "enter your name",
	  "description": "",
	  "copyright": "",
	  "license": "http://www.apache.org/licenses/LICENSE-2.0"
	}
	```

3. Click the styles\blue\style.css and update the CSS classes below to add a light blue theme to the header controller widget, which is a theme based widget.

	```CSS
	.jimu-main-bgcolor{
	/* #27a4d2 is color for this theme */
	  background-color: #27a4d2;
	}
	.jimu-widget-header-controller .jimu-drop-menu{
	  background-color: #27a4d2;
	}
	.jimu-widget-header-controller .jimu-drop-menu .menu-item {
		border-top: 1px solid #abcecf;
	}
	.jimu-header-more-popup {
		background-color: #abcecf;
	}
	.jimu-header-more-popup .icon-node {
		background-color: #27a4d2;
	}
	.jimu-header-more-popup .close {
		background-color: #abcecf;
	}
	.jimu-header-more-popup .close-inner {
		background-color: #27a4d2;
	}
	.jimu-preload-widget-icon-panel>.title,
	.jimu-foldable-panel>.title,
	.jimu-title-panel>.title{
	  background-color: #27a4d2;
	}

	.jimu-widget-header-controller .subtitle{
	  color: #ffffff;
	}

	.jimu-widget-header-controller .links .link{
	  color: #ffffff;
	}

	.jimu-widget-header-controller .signin-section .link{
	  color: #ffffff;
	}

	.jimu-widget-header-controller .icon-node{
	  border-right: 1px solid #27a4d2;
	}

	.jimu-widget-header-controller .icon-node.jimu-state-selected{
	  background-color: #8db8b9 !important;
	}
	```

4. [Download GeocoderCustom] (wab/GeocoderCustom.zip?raw=true) unzip and copy the folder to the widgets directory(e.g., webappbuilder\client\stemapp\widgets).

5. Click GeocoderCustom/css/style and update the CSS classes below to give the geocoder a white background with no border and a rounded edge.

	```CSS
	.jimu-widget-geocodercustom{
	  width: 225px !important;
	  height: 30px !important;
	  background: white;
	  opacity: .90;
	  border-radius: 30px;
	}

	.jimu-widget-geocodercustom .simpleGeocoder .esriGeocoder {
	  background: transparent;
	  border: none;

	}

	.esriPopup .titlePane {
		background-color: #5491B8
	  	border: none;
	}
	```
6. Click config.json in BrightTheme\layouts\default to add the Geocoder Custom Widget to the Header Controller. Modify the existing uri "widgets/Geocoder/Widget at line 14.

	```json
	{
	      "uri": "widgets/GeocoderCustom/Widget",
	      "positionRelativeTo": "browser",
	      "position": {
	        "right": 15,
	        "top": 5
	      },
	     "style":{"z-index":1000},
	     "version": "1.2"
	```

7. Click Widgets\HeaderController\Widget.js to add some space for the geocoder in the header controller. Find the _calcContainerAndEmptyWidth method and at the end of the if statement for (containerWidth < this.iconwidth * 2)
   add containerWidth -= 280 (Line 678) .

	```javascript
	containerWidth -= 280//280 width of the geocoder plus margin
	```

8. Create a new application in Web AppBuilder using with the Bright Theme and add the StreetView Widget to the Header Controller.


text:
#ifndef VOXEL_DEPTHCAMERALIBRARY_H
#define VOXEL_DEPTHCAMERALIBRARY_H

#include <Common.h>
#include <DepthCameraFactory.h>
#include <Filter/FilterFactory.h>
#include "DownloaderFactory.h"

namespace Voxel
{

/**
  * \addtogroup CamSys
  * @{
  */

class VOXEL_NO_EXPORT DepthCameraLibraryPrivate;

class VOXEL_EXPORT DepthCameraLibrary
{
protected:
  String _libName;

  Ptr<DepthCameraLibraryPrivate> _libraryPrivate;

public:
  DepthCameraLibrary(const String &libName);

  bool load();

  inline bool isLoaded();

  DepthCameraFactoryPtr getDepthCameraFactory();

  FilterFactoryPtr getFilterFactory();

  DownloaderFactoryPtr getDownloaderFactory();

  int getABIVersion(); // Get DepthCameraLibrary's ABI version

  virtual ~DepthCameraLibrary();
};

typedef Ptr<DepthCameraLibrary> DepthCameraLibraryPtr;

/**
 * @}
 */
}

#endif // VOXEL_DEPTHCAMERALIBRARY_H


text:
"""Setup script for ExquisiteCorpse."""

import setuptools

from ec import __project__, __version__, CLI, DESCRIPTION

import os
if os.path.exists('README.rst'):
    README = open('README.rst').read()
else:
    README = ""  # a placeholder, readme is generated on release
CHANGES = open('CHANGES.md').read()

setuptools.setup(
    name=__project__,
    version=__version__,

    description=DESCRIPTION,
    url='https://github.com/jacebrowning/exquisite-corpse',
    author='Jace Browning',
    author_email='jacebrowning@gmail.com',

    packages=setuptools.find_packages(),

    entry_points={'console_scripts': [CLI + ' = ec.cli:main']},

    long_description=(README + '\n' + CHANGES),
    license='MIT',
    classifiers=[
        'Development Status :: 1 - Planning',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 3.3',
    ],

    install_requires=open('requirements.txt').readlines(),
)


text:
id: b451b86b-b60d-4807-a08d-a7409f74e1f9
post_id: a46270ff-6664-4dba-bfd5-b34cbbe388ae
draft: false
author:
    name: Brandon
    email: ronald.raindrop@gmail.com
    ip: 71.209.11.178
---

I loved the show. I'd talk a lot more about, but one thing bothers me: why on earth is this post tagged with 'queerats'? Granted they factor into the series enormously, but what kind of blog do you run where people go searching for queerat related posts?...


text:
Open Source Data Visualization Music

## Description
My project is about the data visualization of open source music. I used three categories for the data visualization: MusicInterests, MusicListens and MusicDownloads. I have made a chart of these values of the songs. So for every category there is one graphic, based on values of different songs. The graphs look like a music wave. These data is from [FreeMusicArchive](http://freemusicarchive.org). I also made a combination of the three graphs in an animation. Here the values change between the three categories. The sound wave changes in shape as a result of the data.

## Graph
Music Interests
![musicinterests](https://cloud.githubusercontent.com/assets/21360973/26760269/4cbe0c16-4914-11e7-9b9e-e74992553c7e.png)

Music Listens
![musiclistens](https://cloud.githubusercontent.com/assets/21360973/26760289/f0815a60-4914-11e7-9d12-4022aad67016.png)

Music Downloads
![musicdownloads](https://cloud.githubusercontent.com/assets/21360973/26760302/0f81e8f8-4915-11e7-834f-70db1c5a9140.png)

## Animation
Animation GIF
![dm_2-5-17_graph_wave_anim](https://cloud.githubusercontent.com/assets/21360973/26760473/0d57ed8a-4919-11e7-9197-aae8ccc81309.gif)

## Source Information
### site
The data is from [FreeMusicArchive](http://freemusicarchive.org)

### json file
This is the link to the [json file](code/DM_tracks_data2.json) with the data I used.

## Code
This are the files with the code I used for the graphs. I made these graphs and animation in [plotdevice](http://plotdevice.io). The code to flatten the data is a python file.
### Organize code
The code to [flatten](code/DM_flatten_track.py) your data. This means that you delete the information/data in the code that you don't need. You can choose which data you want.
### Code graph
This is the code for the [wave graph](code/DM_2-5-17_graph_wave.pv). The code is used for the three categories [interests, listens and downloads]. You can do this by changing all the track_listens to track_interests or track_downloads.
### Code animation
This is the code for the [wave animation](code/DM_2-5-17_graph_wave_anim.pv).

## Sketch
Here you can find all the [sketches](sketch) of graphs I made with plotdevice.


text:
"use strict";

const NO_MODULES = '!**/node_modules/**';
var gulp = require('gulp');
var xmlValidator = require('gulp-xml-validator');
var eslint = require('gulp-eslint');
var NamingfaceValidator = require('./verifiers/namingValidator');

gulp.task('xml-lint', function () {
  return gulp.src(['**/*.xml', NO_MODULES])
    .pipe(xmlValidator())
});

gulp.task('js-lint', () => {
    return gulp.src(['**/*.js', NO_MODULES])
        .pipe(eslint())
        .pipe(eslint.format())
        .pipe(eslint.failAfterError());
});

gulp.task('json-lint', () => {
    return gulp.src(['**/*.json', NO_MODULES])
        .pipe(eslint())
        .pipe(eslint.format())
        .pipe(eslint.failAfterError());
});

gulp.task('validate-naming', function () {
  return gulp.src(['**/js/package.json', NO_MODULES])
    .pipe(NamingfaceValidator())
});

gulp.task('ci-checks', ['js-lint', 'json-lint', 'xml-lint', 'validate-naming']);


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//Boost//DTD BoostBook XML V1.1//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">

  <title>ExceptionPolicy<EP></title>

  <?dbhtml stop-chunking?>

    <title>Description</title>

    <para>The exception policy specifies what is to occur when a safe
    operation cannot return a valid result. A type is an ExceptionPolicy if it
    has functions for handling exceptional events that occur in the course of
    safe numeric operations.</para>

    <title>Notation</title>

    <informaltable>
      <tgroup cols="2" colsep="1" rowsep="1">
        <colspec align="left" colwidth="1*"/>

        <colspec align="left" colwidth="6*"/>

          <row>
            <entry>EP</entry>

            <entry>A type that fulfills the requirements of an
            ExceptionPolicy</entry>
          </row>

          <row>
            <entry>e</entry>

            <entry>A code from <link
            linkend="safe_numerics.safe_numerics_error">safe_numerics_error</link></entry>
          </row>

          <row>
            <entry>message</entry>

            <entry>A const char * which refers to a text message about the
            cause of an exception</entry>
          </row>

      </tgroup>
    </informaltable>

    <title>Valid Expressions</title>

    <para>Whenever an operation yield an invalid result, one of the following
    functions will be invoked.</para>

    <para><informaltable>
        <tgroup cols="3">
          <colspec align="left" colwidth="9*"/>

          <colspec align="left" colwidth="1*"/>

          <colspec align="left" colwidth="12*"/>

            <row>
              <entry align="left">Expression</entry>

              <entry>Return Value</entry>

              <entry>Invoked when:</entry>
            </row>

            <row>
              <entry>EP::on_arithmetic_error(e, message)</entry>

              <entry>void</entry>

              <entry>The operation cannot produce valid arithmetic result such
              as overflows, divide by zero, etc.</entry>
            </row>

            <row>
              <entry>EP::on_undefined_behavior(e,
              message)</entry>

              <entry>void</entry>

              <entry>The result is undefined by the C++ standard</entry>
            </row>

            <row>
              <entry>EP::on_implementation_defined_behavior(e,
              message)</entry>

              <entry>void</entry>

              <entry>The result depends upon implementation defined behavior
              according to the C++ standard</entry>
            </row>

            <row>
              <entry>EP::on_uninitialized_value(e,
              message)</entry>

              <entry>void</entry>

              <entry>A variable is not initialized</entry>
            </row>

        </tgroup>
      </informaltable></para>

    <title>dispatch<EP>(const safe_numerics_error & e, const char *
    msg)</title>

    <para>This function is used to invoke the exception handling policy for a
    particular exception code.</para>

      <title>Synopsis</title>

      <para><programlisting>template<class EP>
constexpr void
dispatch<EP>(const boost::numeric::safe_numerics_error & e, char const * const & msg);</programlisting></para>

      <title>Example of use</title>

      <programlisting>#include <boost/safe_numerics/exception_policies.hpp"

dispatch<boost::numeric::loose_exception_policy>(
    boost::numeric::safe_numerics_error::positive_overflow_error,
    "operation resulted in overflow"
);</programlisting>

    <title>Models</title>

    <para>The library header <ulink
    url="../../include/boost/safe_numerics/exception_policies.hpp"><boost/safe_numerics/exception_policies.hpp>
    </ulink>contains a number of pre-made exception policies:</para>

    <itemizedlist>
      <listitem>
        <para>boost::numeric::loose_exception_policy</para>

        <para>Throw on arithmetic errors, ignore other errors. Some
        applications ignore these issues and still work and we don't want to
        update them.</para>
      </listitem>

      <listitem>
        <para>boost::numeric::loose_trap_policy</para>

        <para>Same as above in that it doesn't check for various undefined
        behaviors but traps at compile time for hard arithmetic errors. This
        policy would be suitable for older embedded systems which depend on
        bit manipulation operations to work.</para>
      </listitem>

      <listitem>
        <para>boost::numeric::strict_exception_policy</para>

        <para>Permit just about anything, throw at runtime on any kind of
        error. Recommended for new code. Check everything at compile time if
        possible and runtime if necessary. Trap or Throw as appropriate.
        Should guarantee code to be portable across architectures.</para>
      </listitem>

      <listitem>
        <para>boost::numeric::strict_trap_policy</para>

        <para>Same as above but requires code to be written in such a way as
        to make it impossible for errors to occur. This naturally will require
        extra coding effort but might be justified for embedded and/or safety
        critical systems.</para>
      </listitem>

      <listitem>
        <para>boost::numeric::default_exception_policy</para>

        <para>Alias for strict_exception_policy, One would use
        this first. After experimentation, one might switch to one of the
        above policies or perhaps use a custom policy.</para>
      </listitem>
    </itemizedlist>

    <title>Header</title>

    <para><ulink
    url="../../include/boost/safe_numerics/concept/exception_policy.hpp">#include
    <boost/safe_numerics/concepts/exception_policy.hpp>
    </ulink></para>


text:
using System.Collections.Generic;
using Senparc.NeuChar.Entities;

namespace Senparc.Weixin.MP.Entities
{
    public class RequestMessageEvent_Subscribe_Msg_Change : RequestMessageEventBase, IRequestMessageEventBase
    {

        public override Event Event => Event.subscribe_msg_change_event;

        public RequestMessageEvent_Subscribe_Msg_Change()
        {
            SubscribeMsgChangeEvent = new List<SubscribeMsgChangeEvent>();
        }

        public List<SubscribeMsgChangeEvent> SubscribeMsgChangeEvent { get; set; }
    }
}


text:
namespace chromecast {
namespace media {

AvPipelineClient::AvPipelineClient() {
}

AvPipelineClient::AvPipelineClient(AvPipelineClient&& other) = default;
AvPipelineClient& AvPipelineClient::operator=(AvPipelineClient&& other) =
    default;

AvPipelineClient::~AvPipelineClient() {
}

}  // namespace media
}  // namespace chromecast


text:
package main

import (
	"os"

	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
	_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
	"knative.dev/client-contrib/plugins/admin/core"
)

func main() {
	if err := core.NewAdminCommand().Execute(); err != nil {
		os.Exit(1)
	}
}


text:
<?xml version="1.0" encoding="UTF-8" ?>

<schema name="example" version="1.5">

  <types>
    <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

    <!-- A general text field that has reasonable, generic
         cross-language defaults: it tokenizes with StandardTokenizer,
         removes stop words from case-insensitive "stopwords.txt"
         (empty by default), and down cases.  At query time only, it
         also applies synonyms. -->
    <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>

    <!-- A text field with defaults appropriate for English: it
         tokenizes with StandardTokenizer, removes English stop words
         (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
         finally applies Porter's stemming.  The query time analyzer
         also applies synonyms from synonyms.txt. -->
    <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <!-- Case insensitive stop word removal.
        -->
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
        <filter class="solr.EnglishMinimalStemFilterFactory"/>
        -->
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
        <filter class="solr.EnglishMinimalStemFilterFactory"/>
        -->
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
    </fieldType>

    <!-- German -->
    <fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" />
        <filter class="solr.GermanNormalizationFilterFactory"/>
        <filter class="solr.GermanLightStemFilterFactory"/>
        <!-- less aggressive: <filter class="solr.GermanMinimalStemFilterFactory"/> -->
        <!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="German2"/> -->
      </analyzer>
    </fieldType>

    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>

    <fieldType name="int" class="solr.TrieIntField"/>
    <fieldType name="date" class="solr.TrieDateField"/>
 </types>

 <fields>
   <!-- The _version_ field is required when using the Solr update log or SolrCloud (cfr. SOLR-3432) -->
   <field name="_version_" type="long" indexed="true" stored="true"/>

   <field name="lily.key" type="string" indexed="true" stored="true" required="true"/>
   <field name="lily.id" type="string" indexed="true" stored="true" required="true"/>
   <field name="lily.table" type="string" indexed="true" stored="true" required="true"/>
   <field name="lily.vtagId" type="string" indexed="true" stored="true"/>
   <field name="lily.vtag" type="string" indexed="true" stored="true"/>
   <field name="lily.version" type="long" indexed="true" stored="true"/>

   <field name="url" type="text_de" indexed="true" stored="true" required="false"/>
   <field name="date" type="date" indexed="true" stored="true" required="false"/>
   <field name="contentType" type="text_general" indexed="true" stored="true" required="false"/>
   <field name="size" type="int" indexed="true" stored="true" required="false"/>
   <field name="category" type="text_de" indexed="true" stored="true" required="false"/>
   <field name="headline" type="text_de" indexed="true" stored="true" required="false"/>
   <field name="author" type="text_general" indexed="true" stored="true" required="false"/>
   <field name="datePublished" type="date" indexed="true" stored="true" required="false"/>
   <field name="articleBody" type="text_de" indexed="true" stored="true" required="false"/>
   <field name="postings" type="int" indexed="true" stored="true" required="false"/>
   <field name="body" type="text_general" indexed="true" stored="true" required="false"/>
 </fields>

 <uniqueKey>lily.key</uniqueKey>

</schema>


text:
By default `axion-release-plugin` reads last released version and
increments least significant (patch) version number to reflect changes.
In some cases though, you might want to mark start of work on next major
version (like 2.0.0) and release `2.0.0-SNAPSHOT` instead of
`1.5.1-SNAPSHOT`. Next version markers make it possible.

Next version marker is simply a specific tag. It ends with customizable
suffix and is handled differently. When reading version number and last
tag is next version marker, version is treated as SNAPSHOT, but version
is not incremented:

    # git tag
    v1.5.0

    # ./gradlew cV
    1.5.1-SNAPSHOT

    # ./gradlew markNextVersion -Prelease.version=2.0.0

    # git tag
    v1.5.0 v2.0.0-alpha

    # ./gradlew cV
    2.0.0-SNAPSHOT

    # ./gradlew markNextVersion

    # ./gradlew cV
    2.0.1-SNAPSHOT

    # ./gradlew markNextVersion -Prelease.incrementer=incrementMinor

    # ./gradlew cV
    2.1.0-SNAPSHOT

To create next version marker use `markNextVersion`. Without parameters next version will be created with default
version incrementer - incrementMinor, which can be overwritten with `release.incrementer` parameter.
Custom next version can be created along with command line option `release.version`.

Default next version marker serializer/deserializer can be customized
using `scmVersion.nextVersion.suffix` and
`scmVersion.nextVersion.separator` properties:

    scmVersion {
        nextVersion {
            suffix.set("alpha")
            separator.set("-")
        }
    }

As with normal tags, you can specify custom serializers and
deserializers for next version markers. See [Version Creation](version.md)
documentation to see what serializers and deserializers are:

    scmVersion {
        nextVersion {
            serializer( { nextVersionConfig, version -> ...})
            deserializer( { nextVersionConfig, position -> ...})
        }
    }


text:
libraries.css - found a missing font-family on line 143
mod_skins.css - found a missing "*" on line 12, so comment was incomplete


text:
"""Eval Cross Convolutional Model."""
import io
import os
import sys
import time

import numpy as np
import tensorflow as tf

import model as cross_conv_model
import reader

FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_string('log_root', '/tmp/moving_obj', 'The root dir of output.')
tf.flags.DEFINE_string('data_filepattern',
                       'est',
                       'training data file pattern.')
tf.flags.DEFINE_integer('batch_size', 1, 'Batch size.')
tf.flags.DEFINE_integer('image_size', 64, 'Image height and width.')
tf.flags.DEFINE_float('norm_scale', 1.0, 'Normalize the original image')
tf.flags.DEFINE_float('scale', 10.0,
                      'Scale the image after norm_scale and move the diff '
                      'to the positive realm.')
tf.flags.DEFINE_integer('sequence_length', 2, 'tf.SequenceExample length.')
tf.flags.DEFINE_integer('eval_batch_count', 100,
                        'Average the result this number of examples.')
tf.flags.DEFINE_bool('l2_loss', True, 'If true, include l2_loss.')
tf.flags.DEFINE_bool('reconstr_loss', False, 'If true, include reconstr_loss.')
tf.flags.DEFINE_bool('kl_loss', True, 'If true, include KL loss.')

slim = tf.contrib.slim

def _Eval():
  params = dict()
  params['batch_size'] = FLAGS.batch_size
  params['seq_len'] = FLAGS.sequence_length
  params['image_size'] = FLAGS.image_size
  params['is_training'] = False
  params['norm_scale'] = FLAGS.norm_scale
  params['scale'] = FLAGS.scale
  params['l2_loss'] = FLAGS.l2_loss
  params['reconstr_loss'] = FLAGS.reconstr_loss
  params['kl_loss'] = FLAGS.kl_loss

  eval_dir = os.path.join(FLAGS.log_root, 'eval')

  images = reader.ReadInput(
      FLAGS.data_filepattern, shuffle=False, params=params)
  images *= params['scale']
  # Increase the value makes training much faster.
  image_diff_list = reader.SequenceToImageAndDiff(images)
  model = cross_conv_model.CrossConvModel(image_diff_list, params)
  model.Build()

  summary_writer = tf.summary.FileWriter(eval_dir)
  saver = tf.train.Saver()
  sess = tf.Session('', config=tf.ConfigProto(allow_soft_placement=True))
  tf.train.start_queue_runners(sess)

  while True:
    time.sleep(60)
    try:
      ckpt_state = tf.train.get_checkpoint_state(FLAGS.log_root)
    except tf.errors.OutOfRangeError as e:
      sys.stderr.write('Cannot restore checkpoint: %s\n' % e)
      continue
    if not (ckpt_state and ckpt_state.model_checkpoint_path):
      sys.stderr.write('No model to eval yet at %s\n' % FLAGS.log_root)
      continue
    sys.stderr.write('Loading checkpoint %s\n' %
                     ckpt_state.model_checkpoint_path)
    saver.restore(sess, ckpt_state.model_checkpoint_path)
    # Use the empirical distribution of z from training set.
    if not tf.gfile.Exists(os.path.join(FLAGS.log_root, 'z_mean.npy')):
      sys.stderr.write('No z at %s\n' % FLAGS.log_root)
      continue

    with tf.gfile.Open(os.path.join(FLAGS.log_root, 'z_mean.npy')) as f:
      sample_z_mean = np.load(io.BytesIO(f.read()))
    with tf.gfile.Open(
        os.path.join(FLAGS.log_root, 'z_stddev_log.npy')) as f:
      sample_z_stddev_log = np.load(io.BytesIO(f.read()))

    total_loss = 0.0
    for _ in xrange(FLAGS.eval_batch_count):
      loss_val, total_steps, summaries = sess.run(
          [model.loss, model.global_step, model.summary_op],
          feed_dict={model.z_mean: sample_z_mean,
                     model.z_stddev_log: sample_z_stddev_log})
      total_loss += loss_val

    summary_writer.add_summary(summaries, total_steps)
    sys.stderr.write('steps: %d, loss: %f\n' %
                     (total_steps, total_loss / FLAGS.eval_batch_count))

def main(_):
  _Eval()

if __name__ == '__main__':
  tf.app.run()


text:
#include "UnitTestPCH.h"
#include <assimp/SceneCombiner.h>
#include <assimp/mesh.h>
#include <memory>

using namespace ::Assimp;

class utSceneCombiner : public ::testing::Test {
    // empty
};

TEST_F( utSceneCombiner, MergeMeshes_ValidNames_Test ) {
    std::vector<aiMesh*> merge_list;
    aiMesh *mesh1 = new aiMesh;
    mesh1->mName.Set( "mesh_1" );
    merge_list.push_back( mesh1 );

    aiMesh *mesh2 = new aiMesh;
    mesh2->mName.Set( "mesh_2" );
    merge_list.push_back( mesh2 );

    aiMesh *mesh3 = new aiMesh;
    mesh3->mName.Set( "mesh_3" );
    merge_list.push_back( mesh3 );

    std::unique_ptr<aiMesh> out;
    aiMesh* ptr = nullptr;
    SceneCombiner::MergeMeshes( &ptr, 0, merge_list.begin(), merge_list.end() );
    out.reset(ptr);
    std::string outName = out->mName.C_Str();
    EXPECT_EQ( "mesh_1.mesh_2.mesh_3", outName );
}


text:
void UnityInit();
void UnityTest();


text:
''' pidhandler.py '''
import traceback
import tornado.gen
import tornado.web

from heron.common.src.python.utils.log import Log
from heron.tools.tracker.src.python import utils
from heron.tools.tracker.src.python.handlers import BaseHandler

@tornado.gen.coroutine
def getInstancePid(topology_info, instance_id):
  """
  This method is used by other modules, and so it
  is not a part of the class.
  Fetches Instance pid from heron-shell.
  """
  try:
    http_client = tornado.httpclient.AsyncHTTPClient()
    endpoint = utils.make_shell_endpoint(topology_info, instance_id)
    url = "%s/pid/%s" % (endpoint, instance_id)
    Log.debug("HTTP call for url: %s", url)
    response = yield http_client.fetch(url)
    raise tornado.gen.Return(response.body)
  except tornado.httpclient.HTTPError as e:
    raise Exception(str(e))

class PidHandler(BaseHandler):
  """
  URL - /topologies/jmap?cluster=<cluster>&topology=<topology> \
        &environ=<environment>&instance=<instance>
  Parameters:
   - cluster - Name of the cluster.
   - role - (optional) Role used to submit the topology.
   - environ - Running environment.
   - topology - Name of topology (Note: Case sensitive. Can only
                include [a-zA-Z0-9-_]+)
   - instance - Instance Id

  If successfule returns the pid of instance. May include training
  spaces and/or linefeed before/after.
  The response JSON is a dict with following format:
  {
     'command': Full command executed at server.
     'stdout': Text on stdout of executing the command.
     'stderr': <optional> Text on stderr.
  }
  """

  # pylint: disable=attribute-defined-outside-init
  def initialize(self, tracker):
    """ initialize """
    self.tracker = tracker

  @tornado.gen.coroutine
  def get(self):
    """ get method """
    try:
      cluster = self.get_argument_cluster()
      role = self.get_argument_role()
      environ = self.get_argument_environ()
      topology_name = self.get_argument_topology()
      instance = self.get_argument_instance()
      topology_info = self.tracker.getTopologyInfo(topology_name, cluster, role, environ)
      result = yield getInstancePid(topology_info, instance)
      self.write_success_response(result)
    except Exception as e:
      Log.debug(traceback.format_exc())
      self.write_error_response(e)


text:
package org.springframework.boot.configurationdocs;

import org.junit.Test;

import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author Brian Clozel
 */
public class SingleKeyEntryTests {

	private static String NEWLINE = System.lineSeparator();

	@Test
	public void simpleProperty() {
		ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
		property.setId("spring.test.prop");
		property.setDefaultValue("something");
		property.setDescription("This is a description.");
		property.setType("java.lang.String");

		SingleKeyEntry entry = new SingleKeyEntry(property);
		StringBuilder builder = new StringBuilder();
		entry.writeAsciidoc(builder);

		assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE
				+ "|`+something+`" + NEWLINE + "|+++This is a description.+++" + NEWLINE);
	}

	@Test
	public void noDefaultValue() {
		ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
		property.setId("spring.test.prop");
		property.setDescription("This is a description.");
		property.setType("java.lang.String");

		SingleKeyEntry entry = new SingleKeyEntry(property);
		StringBuilder builder = new StringBuilder();
		entry.writeAsciidoc(builder);

		assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|"
				+ NEWLINE + "|+++This is a description.+++" + NEWLINE);
	}

	@Test
	public void defaultValueWithPipes() {
		ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
		property.setId("spring.test.prop");
		property.setDefaultValue("first|second");
		property.setDescription("This is a description.");
		property.setType("java.lang.String");

		SingleKeyEntry entry = new SingleKeyEntry(property);
		StringBuilder builder = new StringBuilder();
		entry.writeAsciidoc(builder);

		assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE
				+ "|`+first{vbar}" + NEWLINE + "second+`" + NEWLINE
				+ "|+++This is a description.+++" + NEWLINE);
	}

	@Test
	public void defaultValueWithBackslash() {
		ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
		property.setId("spring.test.prop");
		property.setDefaultValue("first\\second");
		property.setDescription("This is a description.");
		property.setType("java.lang.String");

		SingleKeyEntry entry = new SingleKeyEntry(property);
		StringBuilder builder = new StringBuilder();
		entry.writeAsciidoc(builder);

		assertThat(builder.toString())
				.isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\\\second+`"
						+ NEWLINE + "|+++This is a description.+++" + NEWLINE);
	}

	@Test
	public void mapProperty() {
		ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
		property.setId("spring.test.prop");
		property.setDescription("This is a description.");
		property.setType("java.util.Map<java.lang.String,java.lang.String>");

		SingleKeyEntry entry = new SingleKeyEntry(property);
		StringBuilder builder = new StringBuilder();
		entry.writeAsciidoc(builder);

		assertThat(builder.toString()).isEqualTo("|`+spring.test.prop.*+`" + NEWLINE + "|"
				+ NEWLINE + "|+++This is a description.+++" + NEWLINE);
	}

	@Test
	public void listProperty() {
		String[] defaultValue = new String[] { "first", "second", "third" };
		ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
		property.setId("spring.test.prop");
		property.setDescription("This is a description.");
		property.setType("java.util.List<java.lang.String>");
		property.setDefaultValue(defaultValue);

		SingleKeyEntry entry = new SingleKeyEntry(property);
		StringBuilder builder = new StringBuilder();
		entry.writeAsciidoc(builder);

		assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE
				+ "|`+first," + NEWLINE + "second," + NEWLINE + "third+`" + NEWLINE
				+ "|+++This is a description.+++" + NEWLINE);
	}

}